w-echarts-vue 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +9 -0
- package/.eslintignore +3 -0
- package/.eslintrc.js +55 -0
- package/.jsdoc +25 -0
- package/LICENSE +21 -0
- package/README.md +130 -0
- package/SECURITY.md +5 -0
- package/babel.config.js +16 -0
- package/dist/w-echarts-vue.umd.js +30 -0
- package/dist/w-echarts-vue.umd.js.map +1 -0
- package/docs/components_WEchartsVue.vue.html +420 -0
- package/docs/examples/app.html +62 -0
- package/docs/examples/app.umd.js +31 -0
- package/docs/examples/app.umd.js.map +1 -0
- package/docs/examples/w-echarts-vue_area.html +1733 -0
- package/docs/examples/w-echarts-vue_bar3D.html +1733 -0
- package/docs/examples/w-echarts-vue_continuous.html +1733 -0
- package/docs/examples/w-echarts-vue_heatmap.html +1733 -0
- package/docs/examples/w-echarts-vue_line.html +1733 -0
- package/docs/examples/w-echarts-vue_line3D.html +1733 -0
- package/docs/examples/w-echarts-vue_parallel.html +1733 -0
- package/docs/examples/w-echarts-vue_polar heatmap.html +1733 -0
- package/docs/examples/w-echarts-vue_polar.html +1733 -0
- package/docs/examples/w-echarts-vue_radar.html +1733 -0
- package/docs/examples/w-echarts-vue_resize.html +1746 -0
- package/docs/examples/w-echarts-vue_scatter.html +1733 -0
- package/docs/examples/w-echarts-vue_stack.html +1733 -0
- package/docs/examples/w-echarts-vue_surface.html +1733 -0
- package/docs/examples/w-echarts-vue_tree.html +1736 -0
- package/docs/examples/w-echarts-vue_treemap.html +1734 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
- package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
- package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
- package/docs/global.html +281 -0
- package/docs/index.html +84 -0
- package/docs/js_iniEcharts.mjs.html +104 -0
- package/docs/module-WEchartsVue.html +1006 -0
- package/docs/scripts/collapse.js +39 -0
- package/docs/scripts/commonNav.js +28 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/nav.js +12 -0
- package/docs/scripts/polyfill.js +4 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/scripts/prettify/prettify.js +28 -0
- package/docs/scripts/search.js +99 -0
- package/docs/styles/jsdoc.css +776 -0
- package/docs/styles/prettify.css +80 -0
- package/package.json +70 -0
- package/public/index.html +31 -0
- package/script.txt +22 -0
- package/src/App.vue +180 -0
- package/src/AppZoneWEchartsVue.vue +1171 -0
- package/src/components/WEchartsVue.vue +348 -0
- package/src/js/iniEcharts.mjs +32 -0
- package/src/main.js +8 -0
- package/test/all.test.mjs +10 -0
- package/toolg/addVersion.mjs +4 -0
- package/toolg/cleanFolder.mjs +5 -0
- package/toolg/cvCasename.mjs +43 -0
- package/toolg/gDistApp.mjs +35 -0
- package/toolg/gDistRollupComps.mjs +24 -0
- package/toolg/gDocExams.mjs +47 -0
- package/toolg/gExtractHtml.mjs +285 -0
- package/toolg/modifyReadme.mjs +4 -0
- package/vue.config.js +27 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* w-echarts-vue v1.0.0
|
|
3
|
+
* (c) 2018-2021 yuda-lyu(semisphere)
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self)["w-echarts-vue"]=e()}(this,function(){"use strict";
|
|
7
|
+
/*! *****************************************************************************
|
|
8
|
+
Copyright (c) Microsoft Corporation.
|
|
9
|
+
|
|
10
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
+
purpose with or without fee is hereby granted.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
14
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
16
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
17
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
20
|
+
***************************************************************************** */var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};function e(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},r=new function(){this.browser=new n,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="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(r.wxa=!0,r.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?r.worker=!0:!r.hasGlobalWindow||"Deno"in window||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Node.js")>-1?(r.node=!0,r.svgSupported=!0):function(t,e){var n=e.browser,r=t.match(/Firefox\/([\d.]+)/),i=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);r&&(n.firefox=!0,n.version=r[1]);i&&(n.ie=!0,n.version=i[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11);var s=e.domSupported="undefined"!=typeof document;if(s){var l=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in l||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}}(navigator.userAgent,r);var i=r,o="sans-serif",a="12px "+o;var s,l,u=function(t){var e={};if("undefined"==typeof JSON)return e;for(var n=0;n<t.length;n++){var r=String.fromCharCode(n+32),i=(t.charCodeAt(n)-20)/100;e[r]=i}return e}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),h={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){if(!s){var n=h.createCanvas();s=n&&n.getContext("2d")}if(s)return l!==e&&(l=s.font=e||a),s.measureText(t);t=t||"";var r=/((?:\d+)?\.?\d*)px/.exec(e=e||a),i=r&&+r[1]||12,o=0;if(e.indexOf("mono")>=0)o=i*t.length;else for(var c=0;c<t.length;c++){var d=u[t[c]];o+=null==d?i:d*i}return{width:o}},loadImage:function(t,e,n){var r=new Image;return r.onload=e,r.onerror=n,r.src=t,r},getTime:function(){return Date.now?Date.now():+new Date}};function c(t){for(var e in h)h.hasOwnProperty(e)&&t[e]&&(h[e]=t[e])}var d=F(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),p=F(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),f=Object.prototype.toString,g=Array.prototype,m=g.forEach,v=g.filter,y=g.slice,_=g.map,x=function(){}.constructor,b=x?x.prototype:null,w="__proto__",S=2311,T=Math.pow(2,53)-1;function M(){return S>=T&&(S=0),S++}function C(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];"undefined"!=typeof console&&console.error.apply(console,t)}function I(t){if(null==t||"object"!=typeof t)return t;var e=t,n=f.call(t);if("[object Array]"===n){if(!ft(t)){e=[];for(var r=0,i=t.length;r<i;r++)e[r]=I(t[r])}}else if(p[n]){if(!ft(t)){var o=t.constructor;if(o.from)e=o.from(t);else{e=new o(t.length);for(r=0,i=t.length;r<i;r++)e[r]=t[r]}}}else if(!d[n]&&!ft(t)&&!tt(t))for(var a in e={},t)t.hasOwnProperty(a)&&a!==w&&(e[a]=I(t[a]));return e}function A(t,e,n){if(!J(e)||!J(t))return n?I(e):t;for(var r in e)if(e.hasOwnProperty(r)&&r!==w){var i=t[r],o=e[r];!J(o)||!J(i)||j(o)||j(i)||tt(o)||tt(i)||Q(o)||Q(i)||ft(o)||ft(i)?!n&&r in t||(t[r]=I(e[r])):A(i,o,n)}return t}function D(t,e){for(var n=t[0],r=1,i=t.length;r<i;r++)n=A(n,t[r],e);return n}function L(t,e){if(Object.assign)Object.assign(t,e);else for(var n in e)e.hasOwnProperty(n)&&n!==w&&(t[n]=e[n]);return t}function P(t,e,n){t=t||{};for(var r=0;r<n.length;r++){var i=n[r];t[i]=e[i]}return t}function E(t,e,n){for(var r=U(e),i=0,o=r.length;i<o;i++){var a=r[i];(n?null!=e[a]:null==t[a])&&(t[a]=e[a])}return t}var O=h.createCanvas;function N(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n}return-1}function R(t,e){var n=t.prototype;function r(){}for(var i in r.prototype=e.prototype,t.prototype=new r,n)n.hasOwnProperty(i)&&(t.prototype[i]=n[i]);t.prototype.constructor=t,t.superClass=e}function k(t,e,n){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(e),i=0;i<r.length;i++){var o=r[i];"constructor"!==o&&(n?null!=e[o]:null==t[o])&&(t[o]=e[o])}else E(t,e,n)}function z(t){return!!t&&("string"!=typeof t&&"number"==typeof t.length)}function B(t,e,n){if(t&&e)if(t.forEach&&t.forEach===m)t.forEach(e,n);else if(t.length===+t.length)for(var r=0,i=t.length;r<i;r++)e.call(n,t[r],r,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)}function V(t,e,n){if(!t)return[];if(!e)return lt(t);if(t.map&&t.map===_)return t.map(e,n);for(var r=[],i=0,o=t.length;i<o;i++)r.push(e.call(n,t[i],i,t));return r}function F(t,e,n,r){if(t&&e){for(var i=0,o=t.length;i<o;i++)n=e.call(r,n,t[i],i,t);return n}}function G(t,e,n){if(!t)return[];if(!e)return lt(t);if(t.filter&&t.filter===v)return t.filter(e,n);for(var r=[],i=0,o=t.length;i<o;i++)e.call(n,t[i],i,t)&&r.push(t[i]);return r}function H(t,e,n){if(t&&e)for(var r=0,i=t.length;r<i;r++)if(e.call(n,t[r],r,t))return t[r]}function U(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e}var W=b&&Z(b.bind)?b.call.bind(b.bind):function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){return t.apply(e,n.concat(y.call(arguments)))}};function X(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(this,e.concat(y.call(arguments)))}}function j(t){return Array.isArray?Array.isArray(t):"[object Array]"===f.call(t)}function Z(t){return"function"==typeof t}function Y(t){return"string"==typeof t}function q(t){return"[object String]"===f.call(t)}function K(t){return"number"==typeof t}function J(t){var e=typeof t;return"function"===e||!!t&&"object"===e}function Q(t){return!!d[f.call(t)]}function $(t){return!!p[f.call(t)]}function tt(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function et(t){return null!=t.colorStops}function nt(t){return null!=t.image}function rt(t){return"[object RegExp]"===f.call(t)}function it(t){return t!=t}function ot(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0,r=t.length;n<r;n++)if(null!=t[n])return t[n]}function at(t,e){return null!=t?t:e}function st(t,e,n){return null!=t?t:null!=e?e:n}function lt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return y.apply(t,e)}function ut(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function ht(t,e){if(!t)throw new Error(e)}function ct(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var dt="__ec_primitive__";function pt(t){t[dt]=!0}function ft(t){return t[dt]}var gt=function(){function t(){this.data={}}return t.prototype.delete=function(t){var e=this.has(t);return e&&delete this.data[t],e},t.prototype.has=function(t){return this.data.hasOwnProperty(t)},t.prototype.get=function(t){return this.data[t]},t.prototype.set=function(t,e){return this.data[t]=e,this},t.prototype.keys=function(){return U(this.data)},t.prototype.forEach=function(t){var e=this.data;for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)},t}(),mt="function"==typeof Map;var vt=function(){function t(e){var n=j(e);this.data=mt?new Map:new gt;var r=this;function i(t,e){n?r.set(t,e):r.set(e,t)}e instanceof t?e.each(i):e&&B(e,i)}return t.prototype.hasKey=function(t){return this.data.has(t)},t.prototype.get=function(t){return this.data.get(t)},t.prototype.set=function(t,e){return this.data.set(t,e),e},t.prototype.each=function(t,e){this.data.forEach(function(n,r){t.call(e,n,r)})},t.prototype.keys=function(){var t=this.data.keys();return mt?Array.from(t):t},t.prototype.removeKey=function(t){this.data.delete(t)},t}();function yt(t){return new vt(t)}function _t(t,e){for(var n=new t.constructor(t.length+e.length),r=0;r<t.length;r++)n[r]=t[r];var i=t.length;for(r=0;r<e.length;r++)n[r+i]=e[r];return n}function xt(t,e){var n;if(Object.create)n=Object.create(t);else{var r=function(){};r.prototype=t,n=new r}return e&&L(n,e),n}function bt(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function wt(t,e){return t.hasOwnProperty(e)}function St(){}var Tt=180/Math.PI,Mt=Number.EPSILON||Math.pow(2,-52),Ct=Object.freeze({__proto__:null,EPSILON:Mt,HashMap:vt,RADIAN_TO_DEGREE:Tt,assert:ht,assignProps:P,bind:W,clone:I,concatArray:_t,createCanvas:O,createHashMap:yt,createObject:xt,curry:X,defaults:E,disableUserSelect:bt,each:B,eqNaN:it,extend:L,filter:G,find:H,guid:M,hasOwn:wt,indexOf:N,inherits:R,isArray:j,isArrayLike:z,isBuiltInObject:Q,isDom:tt,isFunction:Z,isGradientObject:et,isImagePatternObject:nt,isNumber:K,isObject:J,isPrimitive:ft,isRegExp:rt,isString:Y,isStringSafe:q,isTypedArray:$,keys:U,logError:C,map:V,merge:A,mergeAll:D,mixin:k,noop:St,normalizeCssArray:ut,reduce:F,retrieve:ot,retrieve2:at,retrieve3:st,setAsPrimitive:pt,slice:lt,trim:ct});function It(t,e){return null==t&&(t=0),null==e&&(e=0),[t,e]}function At(t,e){return t[0]=e[0],t[1]=e[1],t}function Dt(t){return[t[0],t[1]]}function Lt(t,e,n){return t[0]=e,t[1]=n,t}function Pt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function Et(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function Ot(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function Nt(t){return Math.sqrt(kt(t))}var Rt=Nt;function kt(t){return t[0]*t[0]+t[1]*t[1]}var zt=kt;function Bt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function Vt(t,e){var n=Nt(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t}function Ft(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Gt=Ft;function Ht(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var Ut=Ht;function Wt(t,e,n,r){return t[0]=e[0]+r*(n[0]-e[0]),t[1]=e[1]+r*(n[1]-e[1]),t}function Xt(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function jt(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function Zt(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}var Yt=Object.freeze({__proto__:null,add:Pt,applyTransform:Xt,clone:Dt,copy:At,create:It,dist:Gt,distSquare:Ut,distance:Ft,distanceSquare:Ht,div:function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},len:Nt,lenSquare:kt,length:Rt,lengthSquare:zt,lerp:Wt,max:Zt,min:jt,mul:function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},normalize:Vt,scale:Bt,scaleAndAdd:Et,set:Lt,sub:Ot}),qt=function(t,e){this.target=t,this.topTarget=e&&e.topTarget},Kt=function(){function t(t){this.handler=t,t.on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent||e.__hostTarget;e&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new qt(e,t),"dragstart",t.event))},t.prototype._drag=function(t){var e=this._draggingTarget;if(e){var n=t.offsetX,r=t.offsetY,i=n-this._x,o=r-this._y;this._x=n,this._y=r,e.drift(i,o,t),this.handler.dispatchToElement(new qt(e,t),"drag",t.event);var a=this.handler.findHover(n,r,e).target,s=this._dropTarget;this._dropTarget=a,e!==a&&(s&&a!==s&&this.handler.dispatchToElement(new qt(s,t),"dragleave",t.event),a&&a!==s&&this.handler.dispatchToElement(new qt(a,t),"dragenter",t.event))}},t.prototype._dragEnd=function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.handler.dispatchToElement(new qt(e,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new qt(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},t}(),Jt=Kt,Qt=function(){function t(t){t&&(this._$eventProcessor=t)}return t.prototype.on=function(t,e,n,r){this._$handlers||(this._$handlers={});var i=this._$handlers;if("function"==typeof e&&(r=n,n=e,e=null),!n||!t)return this;var o=this._$eventProcessor;null!=e&&o&&o.normalizeQuery&&(e=o.normalizeQuery(e)),i[t]||(i[t]=[]);for(var a=0;a<i[t].length;a++)if(i[t][a].h===n)return this;var s={h:n,query:e,ctx:r||this,callAtLast:n.zrEventfulCallAtLast},l=i[t].length-1,u=i[t][l];return u&&u.callAtLast?i[t].splice(l,0,s):i[t].push(s),this},t.prototype.isSilent=function(t){var e=this._$handlers;return!e||!e[t]||!e[t].length},t.prototype.off=function(t,e){var n=this._$handlers;if(!n)return this;if(!t)return this._$handlers={},this;if(e){if(n[t]){for(var r=[],i=0,o=n[t].length;i<o;i++)n[t][i].h!==e&&r.push(n[t][i]);n[t]=r}n[t]&&0===n[t].length&&delete n[t]}else delete n[t];return this},t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[t],i=this._$eventProcessor;if(r)for(var o=e.length,a=r.length,s=0;s<a;s++){var l=r[s];if(!i||!i.filter||null==l.query||i.filter(t,l.query))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,e[0]);break;case 2:l.h.call(l.ctx,e[0],e[1]);break;default:l.h.apply(l.ctx,e)}}return i&&i.afterTrigger&&i.afterTrigger(t),this},t.prototype.triggerWithContext=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[t],i=this._$eventProcessor;if(r)for(var o=e.length,a=e[o-1],s=r.length,l=0;l<s;l++){var u=r[l];if(!i||!i.filter||null==u.query||i.filter(t,u.query))switch(o){case 0:u.h.call(a);break;case 1:u.h.call(a,e[0]);break;case 2:u.h.call(a,e[0],e[1]);break;default:u.h.apply(a,e.slice(1,o-1))}}return i&&i.afterTrigger&&i.afterTrigger(t),this},t}(),$t=Qt,te=Math.log(2);function ee(t,e,n,r,i,o){var a=r+"-"+i,s=t.length;if(o.hasOwnProperty(a))return o[a];if(1===e){var l=Math.round(Math.log((1<<s)-1&~i)/te);return t[n][l]}for(var u=r|1<<n,h=n+1;r&1<<h;)h++;for(var c=0,d=0,p=0;d<s;d++){var f=1<<d;f&i||(c+=(p%2?-1:1)*t[n][d]*ee(t,e-1,h,u,i|f,o),p++)}return o[a]=c,c}function ne(t,e){var n=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],r={},i=ee(n,8,0,0,0,r);if(0!==i){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*ee(n,7,0===a?1:0,1<<a,1<<s,r)/i*e[a];return function(t,e,n){var r=e*o[6]+n*o[7]+1;t[0]=(e*o[0]+n*o[1]+o[2])/r,t[1]=(e*o[3]+n*o[4]+o[5])/r}}}var re="___zrEVENTSAVED",ie=[];function oe(t,e,n,r,o){if(e.getBoundingClientRect&&i.domSupported&&!ae(e)){var a=e[re]||(e[re]={}),s=function(t,e){var n=e.markers;if(n)return n;n=e.markers=[];for(var r=["left","right"],i=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=o%2,l=(o>>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[s]+":0",i[l]+":0",r[1-s]+":auto",i[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return e.clearMarkers=function(){B(n,function(t){t.parentNode&&t.parentNode.removeChild(t)})},n}(e,a),l=function(t,e,n){for(var r=n?"invTrans":"trans",i=e[r],o=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var h=t[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;a.push(d,p),l=l&&o&&d===o[c]&&p===o[c+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&i?i:(e.srcCoords=a,e[r]=n?ne(s,a):ne(a,s))}(s,a,o);if(l)return l(t,n,r),!0}return!1}function ae(t){return"CANVAS"===t.nodeName.toUpperCase()}var se=/([&<>"'])/g,le={"&":"&","<":"<",">":">",'"':""","'":"'"};function ue(t){return null==t?"":(t+"").replace(se,function(t,e){return le[e]})}var he=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ce=[],de=i.browser.firefox&&+i.browser.version.split(".")[0]<39;function pe(t,e,n,r){return n=n||{},r?fe(t,e,n):de&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):fe(t,e,n),n}function fe(t,e,n){if(i.domSupported&&t.getBoundingClientRect){var r=e.clientX,o=e.clientY;if(ae(t)){var a=t.getBoundingClientRect();return n.zrX=r-a.left,void(n.zrY=o-a.top)}if(oe(ce,t,r,o))return n.zrX=ce[0],void(n.zrY=ce[1])}n.zrX=n.zrY=0}function ge(t){return t||window.event}function me(t,e,n){if(null!=(e=ge(e)).zrX)return e;var r=e.type;if(r&&r.indexOf("touch")>=0){var i="touchend"!==r?e.targetTouches[0]:e.changedTouches[0];i&&pe(t,i,e,n)}else{pe(t,e,e,n);var o=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,r=t.deltaY;if(null==n||null==r)return e;var i=0!==r?Math.abs(r):Math.abs(n),o=r>0?-1:r<0?1:n>0?-1:1;return 3*i*o}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&he.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function ve(t,e,n,r){t.addEventListener(e,n,r)}function ye(t,e,n,r){t.removeEventListener(e,n,r)}var _e=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function xe(t){return 2===t.which||3===t.which}var be=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var r=t.touches;if(r){for(var i={points:[],touches:[],target:e,event:t},o=0,a=r.length;o<a;o++){var s=r[o],l=pe(n,s,{});i.points.push([l.zrX,l.zrY]),i.touches.push(s)}this._track.push(i)}},t.prototype._recognize=function(t){for(var e in Se)if(Se.hasOwnProperty(e)){var n=Se[e](this._track,t);if(n)return n}},t}();function we(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}var Se={pinch:function(t,e){var n=t.length;if(n){var r,i=(t[n-1]||{}).points,o=(t[n-2]||{}).points||i;if(o&&o.length>1&&i&&i.length>1){var a=we(i)/we(o);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((r=i)[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function Te(){return[1,0,0,1,0,0]}function Me(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Ce(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 Ie(t,e,n){var r=e[0]*n[0]+e[2]*n[1],i=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t}function Ae(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function De(t,e,n,r){void 0===r&&(r=[0,0]);var i=e[0],o=e[2],a=e[4],s=e[1],l=e[3],u=e[5],h=Math.sin(n),c=Math.cos(n);return t[0]=i*c+s*h,t[1]=-i*h+s*c,t[2]=o*c+l*h,t[3]=-o*h+c*l,t[4]=c*(a-r[0])+h*(u-r[1])+r[0],t[5]=c*(u-r[1])-h*(a-r[0])+r[1],t}function Le(t,e,n){var r=n[0],i=n[1];return t[0]=e[0]*r,t[1]=e[1]*i,t[2]=e[2]*r,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*i,t}function Pe(t,e){var n=e[0],r=e[2],i=e[4],o=e[1],a=e[3],s=e[5],l=n*a-o*r;return l?(l=1/l,t[0]=a*l,t[1]=-o*l,t[2]=-r*l,t[3]=n*l,t[4]=(r*s-a*i)*l,t[5]=(o*i-n*s)*l,t):null}function Ee(t){var e=[1,0,0,1,0,0];return Ce(e,t),e}var Oe=Object.freeze({__proto__:null,clone:Ee,copy:Ce,create:Te,identity:Me,invert:Pe,mul:Ie,rotate:De,scale:Le,translate:Ae}),Ne=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.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 t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,r){t.x=e.x+n.x*r,t.y=e.y+n.y*r},t.lerp=function(t,e,n,r){var i=1-r;t.x=i*e.x+r*n.x,t.y=i*e.y+r*n.y},t}(),Re=Ne,ke=Math.min,ze=Math.max,Be=Math.abs,Ve=["x","y"],Fe=["width","height"],Ge=new Re,He=new Re,Ue=new Re,We=new Re,Xe=sn(),je=Xe.minTv,Ze=Xe.maxTv,Ye=[0,0],qe=function(){function t(t,e,n,r){Je(this,t,e,n,r)}return t.set=function(t,e,n,r,i){return r<0&&(e+=r,r=-r),i<0&&(n+=i,i=-i),t.x=e,t.y=n,t.width=r,t.height=i,t},t.prototype.union=function(t){var e=ke(t.x,this.x),n=ke(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=ze(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=ze(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){return $e([1,0,0,1,0,0],this,t)},t.prototype.intersect=function(e,n,r){return t.intersect(this,e,n,r)},t.intersect=function(e,n,r,i){r&&Re.set(r,0,0);var o=i&&i.outIntersectRect||null,a=i&&i.clamp;if(o&&(o.x=o.y=o.width=o.height=NaN),!e||!n)return!1;e instanceof t||(e=Je(nn,e.x,e.y,e.width,e.height)),n instanceof t||(n=Je(rn,n.x,n.y,n.width,n.height));var s=!!r;Xe.reset(i,s);var l=Xe.touchThreshold,u=e.x+l,h=e.x+e.width-l,c=e.y+l,d=e.y+e.height-l,p=n.x+l,f=n.x+n.width-l,g=n.y+l,m=n.y+n.height-l;if(u>h||c>d||p>f||g>m)return!1;var v=!(h<p||f<u||d<g||m<c);return(s||o)&&(Ye[0]=1/0,Ye[1]=0,an(u,h,p,f,0,s,o,a),an(c,d,g,m,1,s,o,a),s&&Re.copy(r,v?Xe.useDir?Xe.dirMinTv:je:Ze)),v},t.contain=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},t.prototype.contain=function(e,n){return t.contain(this,e,n)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(t){Qe(this,t)},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 0===this.width||0===this.height},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(t,e){return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t},t.applyTransform=function(t,e,n){if(n){if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],i=n[3],o=n[4],a=n[5];return t.x=e.x*r+o,t.y=e.y*i+a,t.width=e.width*r,t.height=e.height*i,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}Ge.x=Ue.x=e.x,Ge.y=We.y=e.y,He.x=We.x=e.x+e.width,He.y=Ue.y=e.y+e.height,Ge.transform(n),We.transform(n),He.transform(n),Ue.transform(n),t.x=ke(Ge.x,He.x,Ue.x,We.x),t.y=ke(Ge.y,He.y,Ue.y,We.y);var s=ze(Ge.x,He.x,Ue.x,We.x),l=ze(Ge.y,He.y,Ue.y,We.y);t.width=s-t.x,t.height=l-t.y}else t!==e&&Qe(t,e)},t.calculateTransform=function(t,e,n){var r=n.width/e.width,i=n.height/e.height;return Ae(t=Me(t||[]),t,Lt(on,-e.x,-e.y)),Le(t,t,Lt(on,r,i)),Ae(t,t,Lt(on,n.x,n.y)),t},t}(),Ke=qe.create,Je=qe.set,Qe=qe.copy,$e=qe.calculateTransform,tn=qe.applyTransform,en=qe.contain,nn=new qe(0,0,0,0),rn=new qe(0,0,0,0),on=[];function an(t,e,n,r,i,o,a,s){var l=Be(e-n),u=Be(r-t),h=ke(l,u),c=Ve[i],d=Ve[1-i],p=Fe[i];e<n||r<t?l<u?(o&&(Ze[c]=-l),s&&(a[c]=e,a[p]=0)):(o&&(Ze[c]=u),s&&(a[c]=t,a[p]=0)):(a&&(a[c]=ze(t,n),a[p]=ke(e,r)-a[c]),o&&(h<Ye[0]||Xe.useDir)&&(Ye[0]=ke(h,Ye[0]),(l<u||!Xe.bidirectional)&&(je[c]=l,je[d]=0,Xe.useDir&&Xe.calcDirMTV()),(l>=u||!Xe.bidirectional)&&(je[c]=-u,je[d]=0,Xe.useDir&&Xe.calcDirMTV())))}function sn(){var t=0,e=new Re,n=new Re,r={minTv:new Re,maxTv:new Re,useDir:!1,dirMinTv:new Re,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(i,o){r.touchThreshold=0,i&&null!=i.touchThreshold&&(r.touchThreshold=ze(0,i.touchThreshold)),r.negativeSize=!1,o&&(r.minTv.set(1/0,1/0),r.maxTv.set(0,0),r.useDir=!1,i&&null!=i.direction&&(r.useDir=!0,r.dirMinTv.copy(r.minTv),n.copy(r.minTv),t=i.direction,r.bidirectional=null==i.bidirectional||!!i.bidirectional,r.bidirectional||e.set(Math.cos(t),Math.sin(t))))},calcDirMTV:function(){var o=r.minTv,a=r.dirMinTv,s=o.y*o.y+o.x*o.x,l=Math.sin(t),u=Math.cos(t),h=l*o.y+u*o.x;i(h)?i(o.x)&&i(o.y)&&a.set(0,0):(n.x=s*u/h,n.y=s*l/h,i(n.x)&&i(n.y)?a.set(0,0):(r.bidirectional||e.dot(n)>0)&&n.len()<a.len()&&a.copy(n))}};function i(t){return Be(t)<1e-10}return r}var ln=qe,un="silent";function hn(){_e(this.event)}var cn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return e(n,t),n.prototype.dispose=function(){},n.prototype.setCursor=function(){},n}($t),dn=function(t,e){this.x=t,this.y=e},pn=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],fn=new ln(0,0,0,0),gn=function(t){function n(e,n,r,i,o){var a=t.call(this)||this;return a._hovered=new dn(0,0),a.storage=e,a.painter=n,a.painterRoot=i,a._pointerSize=o,r=r||new cn,a.proxy=null,a.setHandlerProxy(r),a._draggingMgr=new Jt(a),a}return e(n,t),n.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(B(pn,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},n.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,r=yn(this,e,n),i=this._hovered,o=i.target;o&&!o.__zr&&(o=(i=this.findHover(i.x,i.y)).target);var a=this._hovered=r?new dn(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(i,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},n.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},n.prototype.resize=function(){this._hovered=new dn(0,0)},n.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},n.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},n.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},n.prototype.dispatchToElement=function(t,e,n){var r=(t=t||{}).target;if(!r||!r.silent){for(var i="on"+e,o=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:hn}}(e,t,n);r&&(r[i]&&(o.cancelBubble=!!r[i].call(r,o)),r.trigger(e,o),r=r.__hostTarget?r.__hostTarget:r.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[i]&&t[i].call(t,o),t.trigger&&t.trigger(e,o)}))}},n.prototype.findHover=function(t,e,n){var r=this.storage.getDisplayList(),i=new dn(t,e);if(vn(r,i,t,e,n),this._pointerSize&&!i.target){for(var o=[],a=this._pointerSize,s=a/2,l=new ln(t-s,e-s,a,a),u=r.length-1;u>=0;u--){var h=r[u];h===n||h.ignore||h.ignoreCoarsePointer||h.parent&&h.parent.ignoreCoarsePointer||(fn.copy(h.getBoundingRect()),h.transform&&fn.applyTransform(h.transform),fn.intersect(l)&&o.push(h))}if(o.length)for(var c=Math.PI/12,d=2*Math.PI,p=0;p<s;p+=4)for(var f=0;f<d;f+=c){if(vn(o,i,t+p*Math.cos(f),e+p*Math.sin(f),n),i.target)return i}}return i},n.prototype.processGesture=function(t,e){this._gestureMgr||(this._gestureMgr=new be);var n=this._gestureMgr;"start"===e&&n.clear();var r=n.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&n.clear(),r){var i=r.type;t.gestureEvent=i;var o=new dn;o.target=r.target,this.dispatchToElement(o,i,r.event)}},n}($t);function mn(t,e,n){if(t[t.rectHover?"rectContain":"contain"](e,n)){for(var r=t,i=void 0,o=!1;r;){if(r.ignoreClip&&(o=!0),!o){var a=r.getClipPath();if(a&&!a.contain(e,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s?r.ignoreHostSilent?null:s:r.parent}return!i||un}return!1}function vn(t,e,n,r,i){for(var o=t.length-1;o>=0;o--){var a=t[o],s=void 0;if(a!==i&&!a.ignore&&(s=mn(a,n,r))&&(!e.topTarget&&(e.topTarget=a),s!==un)){e.target=a;break}}}function yn(t,e,n){var r=t.painter;return e<0||e>r.getWidth()||n<0||n>r.getHeight()}B(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){gn.prototype[t]=function(e){var n,r,i=e.zrX,o=e.zrY,a=yn(this,i,o);if("mouseup"===t&&a||(r=(n=this.findHover(i,o)).target),"mousedown"===t)this._downEl=r,this._downPoint=[e.zrX,e.zrY],this._upEl=r;else if("mouseup"===t)this._upEl=r;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Gt(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}});var _n=gn;function xn(t,e,n,r){var i=e+1;if(i===n)return 1;if(r(t[i++],t[e])<0){for(;i<n&&r(t[i],t[i-1])<0;)i++;!function(t,e,n){n--;for(;e<n;){var r=t[e];t[e++]=t[n],t[n--]=r}}(t,e,i)}else for(;i<n&&r(t[i],t[i-1])>=0;)i++;return i-e}function bn(t,e,n,r,i){for(r===e&&r++;r<n;r++){for(var o,a=t[r],s=e,l=r;s<l;)i(a,t[o=s+l>>>1])<0?l=o:s=o+1;var u=r-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function wn(t,e,n,r,i,o){var a=0,s=0,l=1;if(o(t,e[n+i])>0){for(s=r-i;l<s&&o(t,e[n+i+l])>0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}else{for(s=i+1;l<s&&o(t,e[n+i-l])<=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}for(a++;a<l;){var h=a+(l-a>>>1);o(t,e[n+h])>0?a=h+1:l=h}return l}function Sn(t,e,n,r,i,o){var a=0,s=0,l=1;if(o(t,e[n+i])<0){for(s=i+1;l<s&&o(t,e[n+i-l])<0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}else{for(s=r-i;l<s&&o(t,e[n+i+l])>=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}for(a++;a<l;){var h=a+(l-a>>>1);o(t,e[n+h])<0?l=h:a=h+1}return l}function Tn(t,e){var n,r,i=7,o=0,a=[];function s(s){var l=n[s],u=r[s],h=n[s+1],c=r[s+1];r[s]=u+c,s===o-3&&(n[s+1]=n[s+2],r[s+1]=r[s+2]),o--;var d=Sn(t[h],t,l,u,0,e);l+=d,0!==(u-=d)&&0!==(c=wn(t[l+u-1],t,h,c,c-1,e))&&(u<=c?function(n,r,o,s){var l=0;for(l=0;l<r;l++)a[l]=t[n+l];var u=0,h=o,c=n;if(t[c++]=t[h++],0===--s){for(l=0;l<r;l++)t[c+l]=a[u+l];return}if(1===r){for(l=0;l<s;l++)t[c+l]=t[h+l];return void(t[c+s]=a[u])}var d,p,f,g=i;for(;;){d=0,p=0,f=!1;do{if(e(t[h],a[u])<0){if(t[c++]=t[h++],p++,d=0,0===--s){f=!0;break}}else if(t[c++]=a[u++],d++,p=0,1===--r){f=!0;break}}while((d|p)<g);if(f)break;do{if(0!==(d=Sn(t[h],a,u,r,0,e))){for(l=0;l<d;l++)t[c+l]=a[u+l];if(c+=d,u+=d,(r-=d)<=1){f=!0;break}}if(t[c++]=t[h++],0===--s){f=!0;break}if(0!==(p=wn(a[u],t,h,s,0,e))){for(l=0;l<p;l++)t[c+l]=t[h+l];if(c+=p,h+=p,0===(s-=p)){f=!0;break}}if(t[c++]=a[u++],1===--r){f=!0;break}g--}while(d>=7||p>=7);if(f)break;g<0&&(g=0),g+=2}if((i=g)<1&&(i=1),1===r){for(l=0;l<s;l++)t[c+l]=t[h+l];t[c+s]=a[u]}else{if(0===r)throw new Error;for(l=0;l<r;l++)t[c+l]=a[u+l]}}(l,u,h,c):function(n,r,o,s){var l=0;for(l=0;l<s;l++)a[l]=t[o+l];var u=n+r-1,h=s-1,c=o+s-1,d=0,p=0;if(t[c--]=t[u--],0===--r){for(d=c-(s-1),l=0;l<s;l++)t[d+l]=a[l];return}if(1===s){for(p=(c-=r)+1,d=(u-=r)+1,l=r-1;l>=0;l--)t[p+l]=t[d+l];return void(t[c]=a[h])}var f=i;for(;;){var g=0,m=0,v=!1;do{if(e(a[h],t[u])<0){if(t[c--]=t[u--],g++,m=0,0===--r){v=!0;break}}else if(t[c--]=a[h--],m++,g=0,1===--s){v=!0;break}}while((g|m)<f);if(v)break;do{if(0!==(g=r-Sn(a[h],t,n,r,r-1,e))){for(r-=g,p=(c-=g)+1,d=(u-=g)+1,l=g-1;l>=0;l--)t[p+l]=t[d+l];if(0===r){v=!0;break}}if(t[c--]=a[h--],1===--s){v=!0;break}if(0!==(m=s-wn(t[u],a,0,s,s-1,e))){for(s-=m,p=(c-=m)+1,d=(h-=m)+1,l=0;l<m;l++)t[p+l]=a[d+l];if(s<=1){v=!0;break}}if(t[c--]=t[u--],0===--r){v=!0;break}f--}while(g>=7||m>=7);if(v)break;f<0&&(f=0),f+=2}(i=f)<1&&(i=1);if(1===s){for(p=(c-=r)+1,d=(u-=r)+1,l=r-1;l>=0;l--)t[p+l]=t[d+l];t[c]=a[h]}else{if(0===s)throw new Error;for(d=c-(s-1),l=0;l<s;l++)t[d+l]=a[l]}}(l,u,h,c))}return n=[],r=[],{mergeRuns:function(){for(;o>1;){var t=o-2;if(t>=1&&r[t-1]<=r[t]+r[t+1]||t>=2&&r[t-2]<=r[t]+r[t-1])r[t-1]<r[t+1]&&t--;else if(r[t]>r[t+1])break;s(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&r[t-1]<r[t+1]&&t--,s(t)}},pushRun:function(t,e){n[o]=t,r[o]=e,o+=1}}}function Mn(t,e,n,r){n||(n=0),r||(r=t.length);var i=r-n;if(!(i<2)){var o=0;if(i<32)bn(t,n,r,n+(o=xn(t,n,r,e)),e);else{var a=Tn(t,e),s=function(t){for(var e=0;t>=32;)e|=1&t,t>>=1;return t+e}(i);do{if((o=xn(t,n,r,e))<s){var l=i;l>s&&(l=s),bn(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),i-=o,n+=o}while(0!==i);a.forceMergeRuns()}}}var Cn=!1;function In(){Cn||(Cn=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function An(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var Dn=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=An}return t.prototype.traverse=function(t,e){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(t,e)},t.prototype.getDisplayList=function(t,e){e=e||!1;var n=this._displayList;return!t&&n.length||this.updateDisplayList(e),n},t.prototype.updateDisplayList=function(t){this._displayListLen=0;for(var e=this._roots,n=this._displayList,r=0,i=e.length;r<i;r++)this._updateAndAddDisplayable(e[r],null,t);n.length=this._displayListLen,Mn(n,An)},t.prototype._updateAndAddDisplayable=function(t,e,n){if(!t.ignore||n){t.beforeUpdate(),t.update(),t.afterUpdate();var r=t.getClipPath(),i=e&&e.length,o=0,a=t.__clipPaths;if(!t.ignoreClip&&(i||r)){if(a||(a=t.__clipPaths=[]),i)for(var s=0;s<e.length;s++)a[o++]=e[s];for(var l=r,u=t;l;)l.parent=u,l.updateTransform(),a[o++]=l,u=l,l=l.getClipPath()}if(a&&(a.length=o),t.childrenRef){for(var h=t.childrenRef(),c=0;c<h.length;c++){var d=h[c];t.__dirty&&(d.__dirty|=1),this._updateAndAddDisplayable(d,a,n)}t.__dirty=0}else{var p=t;isNaN(p.z)&&(In(),p.z=0),isNaN(p.z2)&&(In(),p.z2=0),isNaN(p.zlevel)&&(In(),p.zlevel=0),this._displayList[this._displayListLen++]=p}var f=t.getDecalElement&&t.getDecalElement();f&&this._updateAndAddDisplayable(f,a,n);var g=t.getTextGuideLine();g&&this._updateAndAddDisplayable(g,a,n);var m=t.getTextContent();m&&this._updateAndAddDisplayable(m,a,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e<n;e++)this.delRoot(t[e]);else{var r=N(this._roots,t);r>=0&&this._roots.splice(r,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}(),Ln=Dn,Pn=i.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)},En={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 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},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,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1,r=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=r*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*.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?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-En.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*En.bounceIn(2*t):.5*En.bounceOut(2*t-1)+.5}},On=En,Nn=Math.pow,Rn=Math.sqrt,kn=1e-8,zn=1e-4,Bn=Rn(3),Vn=1/3,Fn=It(),Gn=It(),Hn=It();function Un(t){return t>-1e-8&&t<kn}function Wn(t){return t>kn||t<-1e-8}function Xn(t,e,n,r,i){var o=1-i;return o*o*(o*t+3*i*e)+i*i*(i*r+3*o*n)}function jn(t,e,n,r,i){var o=1-i;return 3*(((e-t)*o+2*(n-e)*i)*o+(r-n)*i*i)}function Zn(t,e,n,r,i,o){var a=r+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-i,h=s*s-3*a*l,c=s*l-9*a*u,d=l*l-3*s*u,p=0;if(Un(h)&&Un(c)){if(Un(s))o[0]=0;else(T=-l/s)>=0&&T<=1&&(o[p++]=T)}else{var f=c*c-4*h*d;if(Un(f)){var g=c/h,m=-g/2;(T=-s/a+g)>=0&&T<=1&&(o[p++]=T),m>=0&&m<=1&&(o[p++]=m)}else if(f>0){var v=Rn(f),y=h*s+1.5*a*(-c+v),_=h*s+1.5*a*(-c-v);(T=(-s-((y=y<0?-Nn(-y,Vn):Nn(y,Vn))+(_=_<0?-Nn(-_,Vn):Nn(_,Vn))))/(3*a))>=0&&T<=1&&(o[p++]=T)}else{var x=(2*h*s-3*a*c)/(2*Rn(h*h*h)),b=Math.acos(x)/3,w=Rn(h),S=Math.cos(b),T=(-s-2*w*S)/(3*a),M=(m=(-s+w*(S+Bn*Math.sin(b)))/(3*a),(-s+w*(S-Bn*Math.sin(b)))/(3*a));T>=0&&T<=1&&(o[p++]=T),m>=0&&m<=1&&(o[p++]=m),M>=0&&M<=1&&(o[p++]=M)}}return p}function Yn(t,e,n,r,i){var o=6*n-12*e+6*t,a=9*e+3*r-3*t-9*n,s=3*e-3*t,l=0;if(Un(a)){if(Wn(o))(h=-s/o)>=0&&h<=1&&(i[l++]=h)}else{var u=o*o-4*a*s;if(Un(u))i[0]=-o/(2*a);else if(u>0){var h,c=Rn(u),d=(-o-c)/(2*a);(h=(-o+c)/(2*a))>=0&&h<=1&&(i[l++]=h),d>=0&&d<=1&&(i[l++]=d)}}return l}function qn(t,e,n,r,i,o){var a=(e-t)*i+t,s=(n-e)*i+e,l=(r-n)*i+n,u=(s-a)*i+a,h=(l-s)*i+s,c=(h-u)*i+u;o[0]=t,o[1]=a,o[2]=u,o[3]=c,o[4]=c,o[5]=h,o[6]=l,o[7]=r}function Kn(t,e,n,r,i,o,a,s,l,u,h){var c,d,p,f,g,m=.005,v=1/0;Fn[0]=l,Fn[1]=u;for(var y=0;y<1;y+=.05)Gn[0]=Xn(t,n,i,a,y),Gn[1]=Xn(e,r,o,s,y),(f=Ut(Fn,Gn))<v&&(c=y,v=f);v=1/0;for(var _=0;_<32&&!(m<zn);_++)d=c-m,p=c+m,Gn[0]=Xn(t,n,i,a,d),Gn[1]=Xn(e,r,o,s,d),f=Ut(Gn,Fn),d>=0&&f<v?(c=d,v=f):(Hn[0]=Xn(t,n,i,a,p),Hn[1]=Xn(e,r,o,s,p),g=Ut(Hn,Fn),p<=1&&g<v?(c=p,v=g):m*=.5);return h&&(h[0]=Xn(t,n,i,a,c),h[1]=Xn(e,r,o,s,c)),Rn(v)}function Jn(t,e,n,r,i,o,a,s,l){for(var u=t,h=e,c=0,d=1/l,p=1;p<=l;p++){var f=p*d,g=Xn(t,n,i,a,f),m=Xn(e,r,o,s,f),v=g-u,y=m-h;c+=Math.sqrt(v*v+y*y),u=g,h=m}return c}function Qn(t,e,n,r){var i=1-r;return i*(i*t+2*r*e)+r*r*n}function $n(t,e,n,r){return 2*((1-r)*(e-t)+r*(n-e))}function tr(t,e,n){var r=t+n-2*e;return 0===r?.5:(t-e)/r}function er(t,e,n,r,i){var o=(e-t)*r+t,a=(n-e)*r+e,s=(a-o)*r+o;i[0]=t,i[1]=o,i[2]=s,i[3]=s,i[4]=a,i[5]=n}function nr(t,e,n,r,i,o,a,s,l){var u,h=.005,c=1/0;Fn[0]=a,Fn[1]=s;for(var d=0;d<1;d+=.05){Gn[0]=Qn(t,n,i,d),Gn[1]=Qn(e,r,o,d),(m=Ut(Fn,Gn))<c&&(u=d,c=m)}c=1/0;for(var p=0;p<32&&!(h<zn);p++){var f=u-h,g=u+h;Gn[0]=Qn(t,n,i,f),Gn[1]=Qn(e,r,o,f);var m=Ut(Gn,Fn);if(f>=0&&m<c)u=f,c=m;else{Hn[0]=Qn(t,n,i,g),Hn[1]=Qn(e,r,o,g);var v=Ut(Hn,Fn);g<=1&&v<c?(u=g,c=v):h*=.5}}return l&&(l[0]=Qn(t,n,i,u),l[1]=Qn(e,r,o,u)),Rn(c)}function rr(t,e,n,r,i,o,a){for(var s=t,l=e,u=0,h=1/a,c=1;c<=a;c++){var d=c*h,p=Qn(t,n,i,d),f=Qn(e,r,o,d),g=p-s,m=f-l;u+=Math.sqrt(g*g+m*m),s=p,l=f}return u}var ir=/cubic-bezier\(([0-9,\.e ]+)\)/;function or(t){var e=t&&ir.exec(t);if(e){var n=e[1].split(","),r=+ct(n[0]),i=+ct(n[1]),o=+ct(n[2]),a=+ct(n[3]);if(isNaN(r+i+o+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:Zn(0,r,o,1,t,s)&&Xn(0,i,a,1,s[0])}}}var ar=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||St,this.ondestroy=t.ondestroy||St,this.onrestart=t.onrestart||St,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,r=t-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,a=o?o(i):i;if(this.onframe(a),1===i){if(!this.loop)return!0;var s=r%n;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=Z(t)?t:On[t]||or(t)},t}(),sr=function(t){this.value=t},lr=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new sr(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),ur=function(){function t(t){this._list=new lr,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,r=this._map,i=null;if(null==r[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new sr(e),a.key=t,n.insertEntry(a),r[t]=a}return i},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),hr=ur,cr={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 dr(t){return(t=Math.round(t))<0?0:t>255?255:t}function pr(t){return t<0?0:t>1?1:t}function fr(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?dr(parseFloat(e)/100*255):dr(parseInt(e,10))}function gr(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?pr(parseFloat(e)/100):pr(parseFloat(e))}function mr(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function vr(t,e,n){return t+(e-t)*n}function yr(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function _r(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var xr=new hr(20),br=null;function wr(t,e){br&&_r(br,e),br=xr.put(t,br||e.slice())}function Sr(t,e){if(t){e=e||[];var n=xr.get(t);if(n)return _r(e,n);var r=(t+="").replace(/ /g,"").toLowerCase();if(r in cr)return _r(e,cr[r]),wr(t,e),e;var i,o=r.length;if("#"===r.charAt(0))return 4===o||5===o?(i=parseInt(r.slice(1,4),16))>=0&&i<=4095?(yr(e,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,5===o?parseInt(r.slice(4),16)/15:1),wr(t,e),e):void yr(e,0,0,0,1):7===o||9===o?(i=parseInt(r.slice(1,7),16))>=0&&i<=16777215?(yr(e,(16711680&i)>>16,(65280&i)>>8,255&i,9===o?parseInt(r.slice(7),16)/255:1),wr(t,e),e):void yr(e,0,0,0,1):void 0;var a=r.indexOf("("),s=r.indexOf(")");if(-1!==a&&s+1===o){var l=r.substr(0,a),u=r.substr(a+1,s-(a+1)).split(","),h=1;switch(l){case"rgba":if(4!==u.length)return 3===u.length?yr(e,+u[0],+u[1],+u[2],1):yr(e,0,0,0,1);h=gr(u.pop());case"rgb":return u.length>=3?(yr(e,fr(u[0]),fr(u[1]),fr(u[2]),3===u.length?h:gr(u[3])),wr(t,e),e):void yr(e,0,0,0,1);case"hsla":return 4!==u.length?void yr(e,0,0,0,1):(u[3]=gr(u[3]),Tr(u,e),wr(t,e),e);case"hsl":return 3!==u.length?void yr(e,0,0,0,1):(Tr(u,e),wr(t,e),e);default:return}}yr(e,0,0,0,1)}}function Tr(t,e){var n=(parseFloat(t[0])%360+360)%360/360,r=gr(t[1]),i=gr(t[2]),o=i<=.5?i*(r+1):i+r-i*r,a=2*i-o;return yr(e=e||[],dr(255*mr(a,o,n+1/3)),dr(255*mr(a,o,n)),dr(255*mr(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Mr(t,e){var n=Sr(t);if(n){for(var r=0;r<3;r++)n[r]=e<0?n[r]*(1-e)|0:(255-n[r])*e+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return Er(n,4===n.length?"rgba":"rgb")}}function Cr(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var r=t*(e.length-1),i=Math.floor(r),o=Math.ceil(r),a=e[i],s=e[o],l=r-i;return n[0]=dr(vr(a[0],s[0],l)),n[1]=dr(vr(a[1],s[1],l)),n[2]=dr(vr(a[2],s[2],l)),n[3]=pr(vr(a[3],s[3],l)),n}}var Ir=Cr;function Ar(t,e,n){if(e&&e.length&&t>=0&&t<=1){var r=t*(e.length-1),i=Math.floor(r),o=Math.ceil(r),a=Sr(e[i]),s=Sr(e[o]),l=r-i,u=Er([dr(vr(a[0],s[0],l)),dr(vr(a[1],s[1],l)),dr(vr(a[2],s[2],l)),pr(vr(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:i,rightIndex:o,value:r}:u}}var Dr=Ar;function Lr(t,e,n,r){var i=Sr(t);if(t)return i=function(t){if(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-r)/6+l/2)/l,c=((s-i)/6+l/2)/l,d=((s-o)/6+l/2)/l;r===s?e=d-c:i===s?e=1/3+h-d:o===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,u];return null!=t[3]&&p.push(t[3]),p}}(i),null!=e&&(i[0]=function(t){return(t=Math.round(t))<0?0:t>360?360:t}(Z(e)?e(i[0]):e)),null!=n&&(i[1]=gr(Z(n)?n(i[1]):n)),null!=r&&(i[2]=gr(Z(r)?r(i[2]):r)),Er(Tr(i),"rgba")}function Pr(t,e){var n=Sr(t);if(n&&null!=e)return n[3]=pr(e),Er(n,"rgba")}function Er(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}function Or(t,e){var n=Sr(t);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*e:0}var Nr=new hr(100);function Rr(t){if(Y(t)){var e=Nr.get(t);return e||(e=Mr(t,-.1),Nr.put(t,e)),e}if(et(t)){var n=L({},t);return n.colorStops=V(t.colorStops,function(t){return{offset:t.offset,color:Mr(t.color,-.1)}}),n}return t}var kr=Object.freeze({__proto__:null,fastLerp:Cr,fastMapToColor:Ir,lerp:Ar,lift:Mr,liftColor:Rr,lum:Or,mapToColor:Dr,modifyAlpha:Pr,modifyHSL:Lr,parse:Sr,parseCssFloat:gr,parseCssInt:fr,random:function(){return Er([Math.round(255*Math.random()),Math.round(255*Math.random()),Math.round(255*Math.random())],"rgb")},stringify:Er,toHex:function(t){var e=Sr(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}}),zr=Math.round;function Br(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var n=Sr(t);n&&(t="rgb("+n[0]+","+n[1]+","+n[2]+")",e=n[3])}}else t="none";return{color:t,opacity:null==e?1:e}}var Vr=1e-4;function Fr(t){return t<Vr&&t>-1e-4}function Gr(t){return zr(1e3*t)/1e3}function Hr(t){return zr(1e4*t)/1e4}var Ur={left:"start",right:"end",center:"middle",middle:"middle"};function Wr(t){return t&&!!t.image}function Xr(t){return Wr(t)||function(t){return t&&!!t.svgElement}(t)}function jr(t){return"linear"===t.type}function Zr(t){return"radial"===t.type}function Yr(t){return t&&("linear"===t.type||"radial"===t.type)}function qr(t){return"url(#"+t+")"}function Kr(t){var e=t.getGlobalScale(),n=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function Jr(t){var e=t.x||0,n=t.y||0,r=(t.rotation||0)*Tt,i=at(t.scaleX,1),o=at(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,l=[];return(e||n)&&l.push("translate("+e+"px,"+n+"px)"),r&&l.push("rotate("+r+")"),1===i&&1===o||l.push("scale("+i+","+o+")"),(a||s)&&l.push("skew("+zr(a*Tt)+"deg, "+zr(s*Tt)+"deg)"),l.join(" ")}var Qr="undefined"!=typeof Buffer&&"function"==typeof Buffer.from?function(t){return Buffer.from(t).toString("base64")}:"function"==typeof btoa&&"function"==typeof unescape&&"function"==typeof encodeURIComponent?function(t){return btoa(unescape(encodeURIComponent(t)))}:function(t){return C("Base64 isn't natively supported in the current environment."),null},$r=Array.prototype.slice;function ti(t,e,n){return(e-t)*n+t}function ei(t,e,n,r){for(var i=e.length,o=0;o<i;o++)t[o]=ti(e[o],n[o],r);return t}function ni(t,e,n,r){for(var i=e.length,o=0;o<i;o++)t[o]=e[o]+n[o]*r;return t}function ri(t,e,n,r){for(var i=e.length,o=i&&e[0].length,a=0;a<i;a++){t[a]||(t[a]=[]);for(var s=0;s<o;s++)t[a][s]=e[a][s]+n[a][s]*r}return t}function ii(t,e){for(var n=t.length,r=e.length,i=n>r?e:t,o=Math.min(n,r),a=i[o-1]||{color:[0,0,0,0],offset:0},s=o;s<Math.max(n,r);s++)i.push({offset:a.offset,color:a.color.slice()})}function oi(t,e,n){var r=t,i=e;if(r.push&&i.push){var o=r.length,a=i.length;if(o!==a)if(o>a)r.length=a;else for(var s=o;s<a;s++)r.push(1===n?i[s]:$r.call(i[s]));var l=r[0]&&r[0].length;for(s=0;s<r.length;s++)if(1===n)isNaN(r[s])&&(r[s]=i[s]);else for(var u=0;u<l;u++)isNaN(r[s][u])&&(r[s][u]=i[s][u])}}function ai(t){if(z(t)){var e=t.length;if(z(t[0])){for(var n=[],r=0;r<e;r++)n.push($r.call(t[r]));return n}return $r.call(t)}return t}function si(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=null==t[3]?1:t[3],"rgba("+t.join(",")+")"}function li(t){return 4===t||5===t}function ui(t){return 1===t||2===t}var hi=[0,0,0,0],ci=function(){function t(t){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=t}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,n){this._needsSort=!0;var r=this.keyframes,i=r.length,o=!1,a=6,s=e;if(z(e)){var l=function(t){return z(t&&t[0])?2:1}(e);a=l,(1===l&&!K(e[0])||2===l&&!K(e[0][0]))&&(o=!0)}else if(K(e)&&!it(e))a=0;else if(Y(e))if(isNaN(+e)){var u=Sr(e);u&&(s=u,a=3)}else a=0;else if(et(e)){var h=L({},s);h.colorStops=V(e.colorStops,function(t){return{offset:t.offset,color:Sr(t.color)}}),jr(e)?a=4:Zr(e)&&(a=5),s=h}0===i?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var c={time:t,value:s,rawValue:e,percent:0};return n&&(c.easing=n,c.easingFunc=Z(n)?n:On[n]||or(n)),r.push(c),c},t.prototype.prepare=function(t,e){var n=this.keyframes;this._needsSort&&n.sort(function(t,e){return t.time-e.time});for(var r=this.valType,i=n.length,o=n[i-1],a=this.discrete,s=ui(r),l=li(r),u=0;u<i;u++){var h=n[u],c=h.value,d=o.value;h.percent=h.time/t,a||(s&&u!==i-1?oi(c,d,r):l&&ii(c.colorStops,d.colorStops))}if(!a&&5!==r&&e&&this.needsAnimate()&&e.needsAnimate()&&r===e.valType&&!e._finished){this._additiveTrack=e;var p=n[0].value;for(u=0;u<i;u++)0===r?n[u].additiveValue=n[u].value-p:3===r?n[u].additiveValue=ni([],n[u].value,p,-1):ui(r)&&(n[u].additiveValue=1===r?ni([],n[u].value,p,-1):ri([],n[u].value,p,-1))}},t.prototype.step=function(t,e){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n,r,i,o=null!=this._additiveTrack,a=o?"additiveValue":"value",s=this.valType,l=this.keyframes,u=l.length,h=this.propName,c=3===s,d=this._lastFr,p=Math.min;if(1===u)r=i=l[0];else{if(e<0)n=0;else if(e<this._lastFrP){for(n=p(d+1,u-1);n>=0&&!(l[n].percent<=e);n--);n=p(n,u-2)}else{for(n=d;n<u&&!(l[n].percent>e);n++);n=p(n-1,u-2)}i=l[n+1],r=l[n]}if(r&&i){this._lastFr=n,this._lastFrP=e;var f=i.percent-r.percent,g=0===f?1:p((e-r.percent)/f,1);i.easingFunc&&(g=i.easingFunc(g));var m=o?this._additiveValue:c?hi:t[h];if(!ui(s)&&!c||m||(m=this._additiveValue=[]),this.discrete)t[h]=g<1?r.rawValue:i.rawValue;else if(ui(s))1===s?ei(m,r[a],i[a],g):function(t,e,n,r){for(var i=e.length,o=i&&e[0].length,a=0;a<i;a++){t[a]||(t[a]=[]);for(var s=0;s<o;s++)t[a][s]=ti(e[a][s],n[a][s],r)}}(m,r[a],i[a],g);else if(li(s)){var v=r[a],y=i[a],_=4===s;t[h]={type:_?"linear":"radial",x:ti(v.x,y.x,g),y:ti(v.y,y.y,g),colorStops:V(v.colorStops,function(t,e){var n=y.colorStops[e];return{offset:ti(t.offset,n.offset,g),color:si(ei([],t.color,n.color,g))}}),global:y.global},_?(t[h].x2=ti(v.x2,y.x2,g),t[h].y2=ti(v.y2,y.y2,g)):t[h].r=ti(v.r,y.r,g)}else if(c)ei(m,r[a],i[a],g),o||(t[h]=si(m));else{var x=ti(r[a],i[a],g);o?this._additiveValue=x:t[h]=x}o&&this._addToTarget(t)}}},t.prototype._addToTarget=function(t){var e=this.valType,n=this.propName,r=this._additiveValue;0===e?t[n]=t[n]+r:3===e?(Sr(t[n],hi),ni(hi,hi,r,1),t[n]=si(hi)):1===e?ni(t[n],t[n],r,1):2===e&&ri(t[n],t[n],r,1)},t}(),di=function(){function t(t,e,n,r){this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&r?C("Can' use additive animation on looped animation."):(this._additiveAnimators=r,this._allowDiscrete=n)}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(t){this._target=t},t.prototype.when=function(t,e,n){return this.whenWithKeys(t,e,U(e),n)},t.prototype.whenWithKeys=function(t,e,n,r){for(var i=this._tracks,o=0;o<n.length;o++){var a=n[o],s=i[a];if(!s){s=i[a]=new ci(a);var l=void 0,u=this._getAdditiveTrack(a);if(u){var h=u.keyframes,c=h[h.length-1];l=c&&c.value,3===u.valType&&l&&(l=si(l))}else l=this._target[a];if(null==l)continue;t>0&&s.addKeyframe(0,ai(l),r),this._trackKeys.push(a)}s.addKeyframe(t,ai(e[a]),r)}return this._maxTime=Math.max(this._maxTime,t),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(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,n=0;n<e;n++)t[n].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var t=this.animation,e=this._abortedCbs;if(t&&t.removeClip(this._clip),this._clip=null,e)for(var n=0;n<e.length;n++)e[n].call(this)},t.prototype._setTracksFinished=function(){for(var t=this._tracks,e=this._trackKeys,n=0;n<e.length;n++)t[e[n]].setFinished()},t.prototype._getAdditiveTrack=function(t){var e,n=this._additiveAnimators;if(n)for(var r=0;r<n.length;r++){var i=n[r].getTrack(t);i&&(e=i)}return e},t.prototype.start=function(t){if(!(this._started>0)){this._started=1;for(var e=this,n=[],r=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var o=this._trackKeys[i],a=this._tracks[o],s=this._getAdditiveTrack(o),l=a.keyframes,u=l.length;if(a.prepare(r,s),a.needsAnimate())if(!this._allowDiscrete&&a.discrete){var h=l[u-1];h&&(e._target[a.propName]=h.rawValue),a.setFinished()}else n.push(a)}if(n.length||this._force){var c=new ar({life:r,loop:this._loop,delay:this._delay||0,onframe:function(t){e._started=2;var r=e._additiveAnimators;if(r){for(var i=!1,o=0;o<r.length;o++)if(r[o]._clip){i=!0;break}i||(e._additiveAnimators=null)}for(o=0;o<n.length;o++)n[o].step(e._target,t);var a=e._onframeCbs;if(a)for(o=0;o<a.length;o++)a[o](e._target,t)},ondestroy:function(){e._doneCallback()}});this._clip=c,this.animation&&this.animation.addClip(c),t&&c.setEasing(t)}else this._doneCallback();return this}},t.prototype.stop=function(t){if(this._clip){var e=this._clip;t&&e.onframe(1),this._abortedCallback()}},t.prototype.delay=function(t){return this._delay=t,this},t.prototype.during=function(t){return t&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(t)),this},t.prototype.done=function(t){return t&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(t)),this},t.prototype.aborted=function(t){return t&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(t)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(t){return this._tracks[t]},t.prototype.getTracks=function(){var t=this;return V(this._trackKeys,function(e){return t._tracks[e]})},t.prototype.stopTracks=function(t,e){if(!t.length||!this._clip)return!0;for(var n=this._tracks,r=this._trackKeys,i=0;i<t.length;i++){var o=n[t[i]];o&&!o.isFinished()&&(e?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}var a=!0;for(i=0;i<r.length;i++)if(!n[r[i]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},t.prototype.saveTo=function(t,e,n){if(t){e=e||this._trackKeys;for(var r=0;r<e.length;r++){var i=e[r],o=this._tracks[i];if(o&&!o.isFinished()){var a=o.keyframes,s=a[n?0:a.length-1];s&&(t[i]=ai(s.rawValue))}}}},t.prototype.__changeFinalValue=function(t,e){e=e||U(t);for(var n=0;n<e.length;n++){var r=e[n],i=this._tracks[r];if(i){var o=i.keyframes;if(o.length>1){var a=o.pop();i.addKeyframe(a.time,t[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},t}(),pi=di;function fi(){return(new Date).getTime()}var gi,mi,vi=function(t){function n(e){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,e=e||{},n.stage=e.stage||{},n}return e(n,t),n.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},n.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},n.prototype.removeClip=function(t){if(t.animation){var e=t.prev,n=t.next;e?e.next=n:this._head=n,n?n.prev=e:this._tail=e,t.next=t.prev=t.animation=null}},n.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},n.prototype.update=function(t){for(var e=fi()-this._pausedTime,n=e-this._time,r=this._head;r;){var i=r.next;r.step(e,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=e,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},n.prototype._startLoop=function(){var t=this;this._running=!0,Pn(function e(){t._running&&(Pn(e),!t._paused&&t.update())})},n.prototype.start=function(){this._running||(this._time=fi(),this._pausedTime=0,this._startLoop())},n.prototype.stop=function(){this._running=!1},n.prototype.pause=function(){this._paused||(this._pauseStart=fi(),this._paused=!0)},n.prototype.resume=function(){this._paused&&(this._pausedTime+=fi()-this._pauseStart,this._paused=!1)},n.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},n.prototype.isFinished=function(){return null==this._head},n.prototype.animate=function(t,e){e=e||{},this.start();var n=new pi(t,e.loop);return this.addAnimator(n),n},n}($t),yi=vi,_i=i.domSupported,xi=(mi={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:gi=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:V(gi,function(t){var e=t.replace("mouse","pointer");return mi.hasOwnProperty(e)?e:t})}),bi=["mousemove","mouseup"],wi=["pointermove","pointerup"],Si=!1;function Ti(t){var e=t.pointerType;return"pen"===e||"touch"===e}function Mi(t){t&&(t.zrByTouch=!0)}function Ci(t,e){for(var n=e,r=!1;n&&9!==n.nodeType&&!(r=n.domBelongToZr||n!==e&&n===t.painterRoot);)n=n.parentNode;return r}var Ii=function(t,e){this.stopPropagation=St,this.stopImmediatePropagation=St,this.preventDefault=St,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},Ai={mousedown:function(t){t=me(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=me(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=me(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Ci(this,(t=me(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){Si=!0,t=me(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){Si||(t=me(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){Mi(t=me(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Ai.mousemove.call(this,t),Ai.mousedown.call(this,t)},touchmove:function(t){Mi(t=me(this.dom,t)),this.handler.processGesture(t,"change"),Ai.mousemove.call(this,t)},touchend:function(t){Mi(t=me(this.dom,t)),this.handler.processGesture(t,"end"),Ai.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&Ai.click.call(this,t)},pointerdown:function(t){Ai.mousedown.call(this,t)},pointermove:function(t){Ti(t)||Ai.mousemove.call(this,t)},pointerup:function(t){Ai.mouseup.call(this,t)},pointerout:function(t){Ti(t)||Ai.mouseout.call(this,t)}};B(["click","dblclick","contextmenu"],function(t){Ai[t]=function(e){e=me(this.dom,e),this.trigger(t,e)}});var Di={pointermove:function(t){Ti(t)||Di.mousemove.call(this,t)},pointerup:function(t){Di.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function Li(t,e){var n=e.domHandlers;i.pointerEventsSupported?B(xi.pointer,function(r){Ei(e,r,function(e){n[r].call(t,e)})}):(i.touchEventsSupported&&B(xi.touch,function(r){Ei(e,r,function(i){n[r].call(t,i),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}(e)})}),B(xi.mouse,function(r){Ei(e,r,function(i){i=ge(i),e.touching||n[r].call(t,i)})}))}function Pi(t,e){function n(n){Ei(e,n,function(r){r=ge(r),Ci(t,r.target)||(r=function(t,e){return me(t.dom,new Ii(t,e),!0)}(t,r),e.domHandlers[n].call(t,r))},{capture:!0})}i.pointerEventsSupported?B(wi,n):i.touchEventsSupported||B(bi,n)}function Ei(t,e,n,r){t.mounted[e]=n,t.listenerOpts[e]=r,ve(t.domTarget,e,n,r)}function Oi(t){var e=t.mounted;for(var n in e)e.hasOwnProperty(n)&&ye(t.domTarget,n,e[n],t.listenerOpts[n]);t.mounted={}}var Ni=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e},Ri=function(t){function n(e,n){var r=t.call(this)||this;return r.__pointerCapturing=!1,r.dom=e,r.painterRoot=n,r._localHandlerScope=new Ni(e,Ai),_i&&(r._globalHandlerScope=new Ni(document,Di)),Li(r,r._localHandlerScope),r}return e(n,t),n.prototype.dispose=function(){Oi(this._localHandlerScope),_i&&Oi(this._globalHandlerScope)},n.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},n.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,_i&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?Pi(this,e):Oi(e)}},n}($t),ki=1;i.hasGlobalWindow&&(ki=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var zi=ki,Bi="#333",Vi="#ccc",Fi=Me,Gi=5e-5;function Hi(t){return t>Gi||t<-5e-5}var Ui=[],Wi=[],Xi=[1,0,0,1,0,0],ji=Math.abs,Zi=function(){function t(){}return t.prototype.getLocalTransform=function(t){return Yi(this,t)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Hi(this.rotation)||Hi(this.x)||Hi(this.y)||Hi(this.scaleX-1)||Hi(this.scaleY-1)||Hi(this.skewX)||Hi(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),n=this.transform;e||t?(n=n||[1,0,0,1,0,0],e?this.getLocalTransform(n):Fi(n),t&&(e?Ie(n,t,n):Ce(n,t)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||[1,0,0,1,0,0],Pe(this.invTransform,n)):n&&(Fi(n),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(Ui);var n=Ui[0]<0?-1:1,r=Ui[1]<0?-1:1,i=((Ui[0]-n)*e+n)/Ui[0]||0,o=((Ui[1]-r)*e+r)/Ui[1]||0;t[0]*=i,t[1]*=i,t[2]*=o,t[3]*=o}},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],n=t[2]*t[2]+t[3]*t[3],r=Math.atan2(t[1],t[0]),i=Math.PI/2+r-Math.atan2(t[3],t[2]);n=Math.sqrt(n)*Math.cos(i),e=Math.sqrt(e),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],Ie(Wi,t.invTransform,e),e=Wi);var n=this.originX,r=this.originY;(n||r)&&(Xi[4]=n,Xi[5]=r,Ie(Wi,e,Xi),Wi[4]-=n,Wi[5]-=r,e=Wi),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var n=[t,e],r=this.invTransform;return r&&Xt(n,n,r),n},t.prototype.transformCoordToGlobal=function(t,e){var n=[t,e],r=this.transform;return r&&Xt(n,n,r),n},t.prototype.getLineScale=function(){var t=this.transform;return t&&ji(t[0]-1)>1e-10&&ji(t[3]-1)>1e-10?Math.sqrt(ji(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){Ji(this,t)},t.getLocalTransform=function(t,e){e=e||[];var n=t.originX||0,r=t.originY||0,i=t.scaleX,o=t.scaleY,a=t.anchorX,s=t.anchorY,l=t.rotation||0,u=t.x,h=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(n||r||a||s){var p=n+a,f=r+s;e[4]=-p*i-c*f*o,e[5]=-f*o-d*p*i}else e[4]=e[5]=0;return e[0]=i,e[3]=o,e[1]=d*i,e[2]=c*o,l&&De(e,e,l),e[4]+=n+u,e[5]+=r+h,e},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}(),Yi=Zi.getLocalTransform;function qi(){return new Zi}var Ki=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Ji(t,e){return P(t,e,Ki)}var Qi,$i=Zi;function to(t){Qi||(Qi=new hr(100)),t=t||a;var e=Qi.get(t);return e||(e={font:t,strWidthCache:new hr(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:h.measureText("国",t).width,asciiCharWidth:h.measureText("a",t).width},Qi.put(t,e)),e}var eo=0,no=5;function ro(t,e){return t.asciiWidthMapTried||(t.asciiWidthMap=function(t){if(!(eo>=no)){t=t||a;for(var e=[],n=+new Date,r=0;r<=127;r++)e[r]=h.measureText(String.fromCharCode(r),t).width;var i=+new Date-n;return i>16?eo=no:i>2&&eo++,e}}(t.font),t.asciiWidthMapTried=!0),0<=e&&e<=127?null!=t.asciiWidthMap?t.asciiWidthMap[e]:t.asciiCharWidth:t.stWideCharWidth}function io(t,e){var n=t.strWidthCache,r=n.get(e);return null==r&&(r=h.measureText(e,t.font).width,n.put(e,r)),r}function oo(t,e,n,r){var i=io(to(e),t),o=uo(e),a=so(0,i,n),s=lo(0,o,r);return new ln(a,s,i,o)}function ao(t,e,n,r){var i=((t||"")+"").split("\n");if(1===i.length)return oo(i[0],e,n,r);for(var o=new ln(0,0,0,0),a=0;a<i.length;a++){var s=oo(i[a],e,n,r);0===a?o.copy(s):o.union(s)}return o}function so(t,e,n,r){return"right"===n?r?t+=e:t-=e:"center"===n&&(r?t+=e/2:t-=e/2),t}function lo(t,e,n,r){return"middle"===n?r?t+=e/2:t-=e/2:"bottom"===n&&(r?t+=e:t-=e),t}function uo(t){return to(t).stWideCharWidth}function ho(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function co(t,e,n){var r=e.position||"inside",i=null!=e.distance?e.distance:5,o=n.height,a=n.width,s=o/2,l=n.x,u=n.y,h="left",c="top";if(r instanceof Array)l+=ho(r[0],n.width),u+=ho(r[1],n.height),h=null,c=null;else switch(r){case"left":l-=i,u+=s,h="right",c="middle";break;case"right":l+=i+a,u+=s,c="middle";break;case"top":l+=a/2,u-=i,h="center",c="bottom";break;case"bottom":l+=a/2,u+=o+i,h="center";break;case"inside":l+=a/2,u+=s,h="center",c="middle";break;case"insideLeft":l+=i,u+=s,c="middle";break;case"insideRight":l+=a-i,u+=s,h="right",c="middle";break;case"insideTop":l+=a/2,u+=i,h="center";break;case"insideBottom":l+=a/2,u+=o-i,h="center",c="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=a-i,u+=i,h="right";break;case"insideBottomLeft":l+=i,u+=o-i,c="bottom";break;case"insideBottomRight":l+=a-i,u+=o-i,h="right",c="bottom"}return(t=t||{}).x=l,t.y=u,t.align=h,t.verticalAlign=c,t}var po="__zr_normal__",fo=Ki.concat(["ignore"]),go=F(Ki,function(t,e){return t[e]=!0,t},{ignore:!1}),mo={},vo=new ln(0,0,0,0),yo=[],_o=function(){function t(t){this.id=M(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,n){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=t,r[5]+=e,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(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var n=this.textConfig,r=n.local,i=e.innerTransformable,o=void 0,a=void 0,s=!1;i.parent=r?this:null;var l=!1;i.copyTransform(e);var u=null!=n.position,h=n.autoOverflowArea,c=void 0;if((h||u)&&(c=vo,n.layoutRect?c.copy(n.layoutRect):c.copy(this.getBoundingRect()),r||c.applyTransform(this.transform)),u){this.calculateTextPosition?this.calculateTextPosition(mo,n,c):co(mo,n,c),i.x=mo.x,i.y=mo.y,o=mo.align,a=mo.verticalAlign;var d=n.origin;if(d&&null!=n.rotation){var p=void 0,f=void 0;"center"===d?(p=.5*c.width,f=.5*c.height):(p=ho(d[0],c.width),f=ho(d[1],c.height)),l=!0,i.originX=-i.x+p+(r?0:c.x),i.originY=-i.y+f+(r?0:c.y)}}null!=n.rotation&&(i.rotation=n.rotation);var g=n.offset;g&&(i.x+=g[0],i.y+=g[1],l||(i.originX=-g[0],i.originY=-g[1]));var m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(h){var v=m.overflowRect=m.overflowRect||new ln(0,0,0,0);i.getLocalTransform(yo),Pe(yo,yo),ln.copy(v,c),v.applyTransform(yo)}else m.overflowRect=null;var y=void 0,_=void 0,x=void 0;(null==n.inside?"string"==typeof n.position&&n.position.indexOf("inside")>=0:n.inside)&&this.canBeInsideText()?(y=n.insideFill,_=n.insideStroke,null!=y&&"auto"!==y||(y=this.getInsideTextFill()),null!=_&&"auto"!==_||(_=this.getInsideTextStroke(y),x=!0)):(y=n.outsideFill,_=n.outsideStroke,null!=y&&"auto"!==y||(y=this.getOutsideFill()),null!=_&&"auto"!==_||(_=this.getOutsideStroke(y),x=!0)),(y=y||"#000")===m.fill&&_===m.stroke&&x===m.autoStroke&&o===m.align&&a===m.verticalAlign||(s=!0,m.fill=y,m.stroke=_,m.autoStroke=x,m.align=o,m.verticalAlign=a,e.setDefaultTextStyle(m)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Vi:Bi},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),n="string"==typeof e&&Sr(e);n||(n=[255,255,255,1]);for(var r=n[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*r+(i?0:255)*(1-r);return n[3]=1,Er(n,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},L(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(J(t))for(var n=U(t),r=0;r<n.length;r++){var i=n[r];this.attrKV(i,t[i])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(t){this._innerSaveToNormal(t);for(var e=this._normalState,n=0;n<this.animators.length;n++){var r=this.animators[n],i=r.__fromStateTransition;if(!(r.getLoop()||i&&i!==po)){var o=r.targetName,a=o?e[o]:e;r.saveTo(a)}}},t.prototype._innerSaveToNormal=function(t){var e=this._normalState;e||(e=this._normalState={}),t.textConfig&&!e.textConfig&&(e.textConfig=this.textConfig),this._savePrimaryToNormal(t,e,fo)},t.prototype._savePrimaryToNormal=function(t,e,n){for(var r=0;r<n.length;r++){var i=n[r];null==t[i]||i in e||(e[i]=this[i])}},t.prototype.hasState=function(){return this.currentStates.length>0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(po,!1,t)},t.prototype.useState=function(t,e,n,r){var i=t===po;if(this.hasState()||!i){var o=this.currentStates,a=this.stateTransition;if(!(N(o,t)>=0)||!e&&1!==o.length){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||i){i||this.saveCurrentToNormalState(s);var l=this._textContent,u=To(this,l,s,r);u&&!this.__inHover&&(this.__inHover=u),this._applyStateObj(t,s,this._normalState,e,Co(this,n,a),a);var h=this._textGuide;return l&&l.useState(t,e,n,!!u),h&&h.useState(t,e,n,!!u),i?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2),s}C("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,n){if(t.length){var r=[],i=this.currentStates,o=t.length,a=o===i.length;if(a)for(var s=0;s<o;s++)if(t[s]!==i[s]){a=!1;break}if(a)return;for(s=0;s<o;s++){var l=t[s],u=void 0;this.stateProxy&&(u=this.stateProxy(l,t)),u||(u=this.states[l]),u&&r.push(u)}var h=r[o-1],c=this._textContent,d=To(this,c,h,n);d&&!this.__inHover&&(this.__inHover=d);var p=this._mergeStates(r),f=this.stateTransition;this.saveCurrentToNormalState(p),this._applyStateObj(t.join(","),p,this._normalState,!1,Co(this,e,f),f);var g=this._textGuide;c&&c.useStates(t,e,!!d),g&&g.useStates(t,e,!!d),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!d&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var e=t.__hostTarget;t=e?t.ignoreHostSilent?null:e:t.parent}return!1},t.prototype._updateAnimationTargets=function(){for(var t=0;t<this.animators.length;t++){var e=this.animators[t];e.targetName&&e.changeTarget(this[e.targetName])}},t.prototype.removeState=function(t){var e=N(this.currentStates,t);if(e>=0){var n=this.currentStates.slice();n.splice(e,1),this.useStates(n)}},t.prototype.replaceState=function(t,e,n){var r=this.currentStates.slice(),i=N(r,t),o=N(r,e)>=0;i>=0?o?r.splice(i,1):r[i]=e:n&&!o&&r.push(e),this.useStates(r)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,n={},r=0;r<t.length;r++){var i=t[r];L(n,i),i.textConfig&&L(e=e||{},i.textConfig)}return e&&(n.textConfig=e),n},t.prototype._applyStateObj=function(t,e,n,r,i,o){if(1!==this.__inHover){var a=!(e&&r);e&&e.textConfig?(this.textConfig=L({},r?this.textConfig:n.textConfig),L(this.textConfig,e.textConfig)):a&&n.textConfig&&(this.textConfig=n.textConfig);for(var s={},l=!1,u=0;u<fo.length;u++){var h=fo[u],c=i&&go[h];e&&null!=e[h]?c?(l=!0,s[h]=e[h]):this[h]=e[h]:a&&null!=n[h]&&(c?(l=!0,s[h]=n[h]):this[h]=n[h])}if(!i)for(u=0;u<this.animators.length;u++){var d=this.animators[u],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(e||n)[p]:e||n)}l&&this._transitionState(t,s,o)}},t.prototype._attachComponent=function(t){if(t.__zr&&!t.__hostTarget)throw new Error("Text element has been added to zrender.");if(t===this)throw new Error("Recursive component attachment.");var e=this.__zr;e&&t.addSelfToZr(e),t.__zr=e,t.__hostTarget=this},t.prototype._detachComponent=function(t){t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(t){this._clipPath&&this._clipPath!==t&&this.removeClipPath(),this._attachComponent(t),this._clipPath=t,this.markRedraw()},t.prototype.removeClipPath=function(){var t=this._clipPath;t&&(this._detachComponent(t),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(t){var e=this._textContent;if(e!==t){if(e&&e!==t&&this.removeTextContent(),t.__zr&&!t.__hostTarget)throw new Error("Text element has been added to zrender.");t.innerTransformable=new $i,this._attachComponent(t),this._textContent=t,this.markRedraw()}},t.prototype.setTextConfig=function(t){this.textConfig||(this.textConfig={}),L(this.textConfig,t),this.markRedraw()},t.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},t.prototype.removeTextContent=function(){var t=this._textContent;t&&(t.innerTransformable=null,this._detachComponent(t),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(t){this._textGuide&&this._textGuide!==t&&this.removeTextGuideLine(),this._attachComponent(t),this._textGuide=t,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var t=this._textGuide;t&&(this._detachComponent(t),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=1;var t=this.__zr;t&&(this.__inHover?t.refreshHover():t.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},t.prototype.dirty=function(){this.markRedraw()},t.prototype.addSelfToZr=function(t){if(this.__zr!==t){this.__zr=t;var e=this.animators;if(e)for(var n=0;n<e.length;n++)t.animation.addAnimator(e[n]);this._clipPath&&this._clipPath.addSelfToZr(t),this._textContent&&this._textContent.addSelfToZr(t),this._textGuide&&this._textGuide.addSelfToZr(t)}},t.prototype.removeSelfFromZr=function(t){if(this.__zr){this.__zr=null;var e=this.animators;if(e)for(var n=0;n<e.length;n++)t.animation.removeAnimator(e[n]);this._clipPath&&this._clipPath.removeSelfFromZr(t),this._textContent&&this._textContent.removeSelfFromZr(t),this._textGuide&&this._textGuide.removeSelfFromZr(t)}},t.prototype.animate=function(t,e,n){var r=t?this[t]:this;if(r){var i=new pi(r,e,n);return t&&(i.targetName=t),this.addAnimator(i,t),i}C('Property "'+t+'" is not existed in element '+this.id)},t.prototype.addAnimator=function(t,e){var n=this.__zr,r=this;t.during(function(){r.updateDuringAnimation(e)}).done(function(){var e=r.animators,n=N(e,t);n>=0&&e.splice(n,1)}),this.animators.push(t),n&&n.animation.addAnimator(t),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var n=this.animators,r=n.length,i=[],o=0;o<r;o++){var a=n[o];t&&t!==a.scope?i.push(a):a.stop(e)}return this.animators=i,this},t.prototype.animateTo=function(t,e,n){xo(this,t,e,n)},t.prototype.animateFrom=function(t,e,n){xo(this,t,e,n,!0)},t.prototype._transitionState=function(t,e,n,r){for(var i=xo(this,e,n,r),o=0;o<i.length;o++)i[o].__fromStateTransition=t},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.initDefaultProps=function(){var e=t.prototype;e.type="element",e.name="",e.ignore=e.silent=e.ignoreHostSilent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=!1,e.__inHover=0,e.__dirty=1;var n={};function r(t,e,r){n[t+e+r]||(console.warn("DEPRECATED: '"+t+"' has been deprecated. use '"+e+"', '"+r+"' instead"),n[t+e+r]=!0)}function i(t,n,i,o){function a(t,e){Object.defineProperty(e,0,{get:function(){return t[i]},set:function(e){t[i]=e}}),Object.defineProperty(e,1,{get:function(){return t[o]},set:function(e){t[o]=e}})}Object.defineProperty(e,t,{get:function(){(r(t,i,o),this[n])||a(this,this[n]=[]);return this[n]},set:function(e){r(t,i,o),this[i]=e[0],this[o]=e[1],this[n]=e,a(this,e)}})}Object.defineProperty&&(i("position","_legacyPos","x","y"),i("scale","_legacyScale","scaleX","scaleY"),i("origin","_legacyOrigin","originX","originY"))}(),t}();function xo(t,e,n,r,i){var o=[];So(t,"",t,e,n=n||{},r,o,i);var a=o.length,s=!1,l=n.done,u=n.aborted,h=function(){s=!0,--a<=0&&(s?l&&l():u&&u())},c=function(){--a<=0&&(s?l&&l():u&&u())};a||l&&l(),o.length>0&&n.during&&o[0].during(function(t,e){n.during(e)});for(var d=0;d<o.length;d++){var p=o[d];h&&p.done(h),c&&p.aborted(c),n.force&&p.duration(n.duration),p.start(n.easing)}return o}function bo(t,e,n){for(var r=0;r<n;r++)t[r]=e[r]}function wo(t,e,n){if(z(e[n]))if(z(t[n])||(t[n]=[]),$(e[n])){var r=e[n].length;t[n].length!==r&&(t[n]=new e[n].constructor(r),bo(t[n],e[n],r))}else{var i=e[n],o=t[n],a=i.length;if(z(i[0]))for(var s=i[0].length,l=0;l<a;l++)o[l]?bo(o[l],i[l],s):o[l]=Array.prototype.slice.call(i[l]);else bo(o,i,a);o.length=i.length}else t[n]=e[n]}function So(t,e,n,r,i,o,a,s){for(var l=U(r),u=i.duration,h=i.delay,c=i.additive,d=i.setToFinal,p=!J(o),f=t.animators,g=[],m=0;m<l.length;m++){var v=l[m],y=r[v];if(null!=y&&null!=n[v]&&(p||o[v]))if(!J(y)||z(y)||et(y))g.push(v);else{if(e){s||(n[v]=y,t.updateDuringAnimation(e));continue}So(t,v,n[v],y,i,o&&o[v],a,s)}else s||(n[v]=y,t.updateDuringAnimation(e),g.push(v))}var _=g.length;if(!c&&_)for(var x=0;x<f.length;x++){if((w=f[x]).targetName===e)if(w.stopTracks(g)){var b=N(f,w);f.splice(b,1)}}if(i.force||(g=G(g,function(t){return e=r[t],i=n[t],!(e===i||z(e)&&z(i)&&function(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}(e,i));var e,i}),_=g.length),_>0||i.force&&!a.length){var w,S=void 0,T=void 0,M=void 0;if(s){T={},d&&(S={});for(x=0;x<_;x++){T[v=g[x]]=n[v],d?S[v]=r[v]:n[v]=r[v]}}else if(d){M={};for(x=0;x<_;x++){M[v=g[x]]=ai(n[v]),wo(n,r,v)}}(w=new pi(n,!1,!1,c?G(f,function(t){return t.targetName===e}):null)).targetName=e,i.scope&&(w.scope=i.scope),d&&S&&w.whenWithKeys(0,S,g),M&&w.whenWithKeys(0,M,g),w.whenWithKeys(null==u?500:u,s?T:r,g).delay(h||0),t.addAnimator(w,e),a.push(w)}}function To(t,e,n,r){return!(n&&n.hoverLayer||r)||Mo(t)||e&&Mo(e)?0:1}function Mo(t){return"text"===t.type||"tspan"===t.type}function Co(t,e,n){return!e&&!t.__inHover&&n&&n.duration>0}k(_o,$t),k(_o,$i);var Io=_o,Ao=function(t){function n(e){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(e),n}return e(n,t),n.prototype.childrenRef=function(){return this._children},n.prototype.children=function(){return this._children.slice()},n.prototype.childAt=function(t){return this._children[t]},n.prototype.childOfName=function(t){for(var e=this._children,n=0;n<e.length;n++)if(e[n].name===t)return e[n]},n.prototype.childCount=function(){return this._children.length},n.prototype.add=function(t){if(t&&(t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),t.__hostTarget))throw"This elemenet has been used as an attachment";return this},n.prototype.addBefore=function(t,e){if(t&&t!==this&&t.parent!==this&&e&&e.parent===this){var n=this._children,r=n.indexOf(e);r>=0&&(n.splice(r,0,t),this._doAdd(t))}return this},n.prototype.replace=function(t,e){var n=N(this._children,t);return n>=0&&this.replaceAt(e,n),this},n.prototype.replaceAt=function(t,e){var n=this._children,r=n[e];if(t&&t!==this&&t.parent!==this&&t!==r){n[e]=t,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(t)}return this},n.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},n.prototype.remove=function(t){var e=this.__zr,n=this._children,r=N(n,t);return r<0||(n.splice(r,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},n.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,n=0;n<t.length;n++){var r=t[n];e&&r.removeSelfFromZr(e),r.parent=null}return t.length=0,this},n.prototype.eachChild=function(t,e){for(var n=this._children,r=0;r<n.length;r++){var i=n[r];t.call(e,i,r)}return this},n.prototype.traverse=function(t,e){for(var n=0;n<this._children.length;n++){var r=this._children[n],i=t.call(e,r);r.isGroup&&!i&&r.traverse(t,e)}return this},n.prototype.addSelfToZr=function(e){t.prototype.addSelfToZr.call(this,e);for(var n=0;n<this._children.length;n++){this._children[n].addSelfToZr(e)}},n.prototype.removeSelfFromZr=function(e){t.prototype.removeSelfFromZr.call(this,e);for(var n=0;n<this._children.length;n++){this._children[n].removeSelfFromZr(e)}},n.prototype.getBoundingRect=function(t){for(var e=new ln(0,0,0,0),n=t||this._children,r=[],i=null,o=0;o<n.length;o++){var a=n[o];if(!a.ignore&&!a.invisible){var s=a.getBoundingRect(),l=a.getLocalTransform(r);l?(ln.applyTransform(e,s,l),(i=i||e.clone()).union(e)):(i=i||s.clone()).union(s)}}return i||e},n}(Io);Ao.prototype.type="group";var Do=Ao,Lo={},Po={};
|
|
21
|
+
/*!
|
|
22
|
+
* ZRender, a high performance 2d drawing library.
|
|
23
|
+
*
|
|
24
|
+
* Copyright (c) 2013, Baidu Inc.
|
|
25
|
+
* All rights reserved.
|
|
26
|
+
*
|
|
27
|
+
* LICENSE
|
|
28
|
+
* https://github.com/ecomfe/zrender/blob/master/LICENSE
|
|
29
|
+
*/var Eo,Oo=function(){function t(t,e,n){var r=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!1,this._darkMode=!1,n=n||{},this.dom=e,this.id=t;var o=new Ln,a=n.renderer||"canvas";if(Lo[a]||(a=U(Lo)[0]),!Lo[a])throw new Error("Renderer '"+a+"' is not imported. Please import it first.");n.useDirtyRect=null!=n.useDirtyRect&&n.useDirtyRect;var s=new Lo[a](e,o,n,t),l=n.ssr||s.ssrOnly;this.storage=o,this.painter=s;var u,h=i.node||i.worker||l?null:new Ri(s.getViewportRoot(),s.root),c=n.useCoarsePointer;(null==c||"auto"===c?i.touchEventsSupported:!!c)&&(u=at(n.pointerSize,44)),this.handler=new _n(o,s,h,s.root,u),this.animation=new yi({stage:{update:l?null:function(){return r._flush(!1)}}}),l||this.animation.start()}return t.prototype.add=function(t){!this._disposed&&t&&(this.storage.addRoot(t),t.addSelfToZr(this),this.refresh())},t.prototype.remove=function(t){!this._disposed&&t&&(this.storage.delRoot(t),t.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(t,e){this._disposed||(this.painter.configLayer&&this.painter.configLayer(t,e),this.refresh())},t.prototype.setBackgroundColor=function(t){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this.refresh(),this._backgroundColor=t,this._darkMode=function(t){if(!t)return!1;if("string"==typeof t)return Or(t,1)<.4;if(t.colorStops){for(var e=t.colorStops,n=0,r=e.length,i=0;i<r;i++)n+=Or(e[i].color,1);return(n/=r)<.4}return!1}(t))},t.prototype.getBackgroundColor=function(){return this._backgroundColor},t.prototype.setDarkMode=function(t){this._darkMode=t},t.prototype.isDarkMode=function(){return this._darkMode},t.prototype.refreshImmediately=function(t){this._disposed||this._refresh({animUpdate:!t,refresh:!0,refreshHover:!1})},t.prototype._refresh=function(t){t.animUpdate&&this.animation.update(!0),this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh({refresh:t.refresh,refreshHover:t.refreshHover}),this._needsRefresh=this._needsRefreshHover=!1},t.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},t.prototype.flush=function(){this._disposed||this._flush(!0)},t.prototype._flush=function(t){var e,n=fi(),r=this._needsRefresh,i=this._needsRefreshHover;(r||i)&&(e=!0,this._refresh({animUpdate:t,refresh:r,refreshHover:i}));var o=fi();e?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:o-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},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(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.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(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,n){return this._disposed||this.handler.on(t,e,n),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e<t.length;e++)t[e]instanceof Do&&t[e].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},t.prototype.dispose=function(){var t;this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,t=this.id,delete Po[t])},t}();function No(t,e){var n=new Oo(M(),t,e);return Po[n.id]=n,n}function Ro(t,e){Lo[t]=e}function ko(t){if("function"==typeof Eo)return Eo(t)}function zo(t){Eo=t}var Bo=Object.freeze({__proto__:null,dispose:function(t){t.dispose()},disposeAll:function(){for(var t in Po)Po.hasOwnProperty(t)&&Po[t].dispose();Po={}},getElementSSRData:ko,getInstance:function(t){return Po[t]},init:No,registerPainter:Ro,registerSSRDataGetter:zo,version:"6.1.0"}),Vo=1e-4;var Fo=Math.min,Go=Math.max,Ho=Math.abs,Uo=Math.round,Wo=Math.floor,Xo=Math.ceil,jo=Math.pow,Zo=Math.log,Yo=Math.LN10,qo=Math.PI,Ko=Math.random;function Jo(t,e,n,r){var i=e[0],o=e[1],a=n[0],s=n[1],l=o-i,u=s-a;if(0===l)return 0===u?a:(a+s)/2;if(r)if(l>0){if(t<=i)return a;if(t>=o)return s}else{if(t>=i)return a;if(t<=o)return s}else{if(t===i)return a;if(t===o)return s}return(t-i)/l*u+a}var Qo=function(t,e,n){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return $o(t,e,n)};function $o(t,e,n){return Y(t)?ta(t)?parseFloat(t)/100*e+(n||0):parseFloat(t):null==t?NaN:+t}function ta(t){return!!(e=t,e.replace(/^\s+|\s+$/g,"")).match(/%$/);var e}function ea(t,e,n){return ht(null!=e),isNaN(e)?n?""+t:+t:(e=Fo(Go(0,e),20),t=(+t).toFixed(e),n?t:+t)}function na(t,e,n){return null==e&&(e=10),ea(t,e,n)}function ra(t){return t.sort(function(t,e){return t-e}),t}function ia(t){if(t=+t,isNaN(t))return 0;if(t>1e-14)for(var e=1,n=0;n<15;n++,e*=10)if(Uo(t*e)/e===t)return n;return oa(t)}function oa(t){var e=t.toString().toLowerCase(),n=e.indexOf("e"),r=n>0?+e.slice(n+1):0,i=n>0?n:e.length,o=e.indexOf(".");return Go(0,(o<0?0:i-1-o)-r)}function aa(t,e,n){var r=Ho(t[1]-t[0]);if(!isFinite(r)||0===r)return NaN;var i=Zo(2*Ho(n||1)*Ho(r))/Yo,o=Zo(Ho(e))/Yo,a=Go(0,Xo(-i+o));return isFinite(a)||(a=NaN),a}function sa(t,e){var n=F(t,function(t,e){return t+(isNaN(e)?0:e)},0);if(0===n)return[];for(var r=jo(10,e),i=V(t,function(t){return(isNaN(t)?0:t)/n*r*100}),o=100*r,a=V(i,function(t){return Wo(t)}),s=F(a,function(t,e){return t+e},0),l=V(i,function(t,e){return t-a[e]});s<o;){for(var u=Number.NEGATIVE_INFINITY,h=null,c=0,d=l.length;c<d;++c)l[c]>u&&(u=l[c],h=c);++a[h],l[h]=0,++s}return V(a,function(t){return t/r})}function la(t,e){var n=Go(ia(t),ia(e)),r=t+e;return n>20?r:ea(r,n)}var ua=jo(2,53)-1;function ha(t){var e=2*qo;return(t%e+e)%e}function ca(t){return t>-1e-4&&t<Vo}var da=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function pa(t){if(t instanceof Date)return t;if(Y(t)){var e=da.exec(t);if(!e)return new Date(NaN);if(e[8]){var n=+e[4]||0;return"Z"!==e[8].toUpperCase()&&(n-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,n,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}return null==t?new Date(NaN):new Date(Uo(t))}function fa(t){return jo(10,ga(t))}function ga(t){if(0===t)return 0;var e=Wo(Zo(t)/Yo);return t/jo(10,e)>=10&&e++,e}function ma(t,e){var n=ga(t),r=jo(10,n),i=t/r;return ea(t=(2===e?1:e?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,-n)}function va(t,e){var n=(t.length-1)*e+1,r=Wo(n),i=+t[r-1],o=n-r;return o?i+o*(t[r]-i):i}function ya(t){t.sort(function(t,e){return s(t,e,0)?-1:1});for(var e=-1/0,n=1,r=0;r<t.length;){for(var i=t[r].interval,o=t[r].close,a=0;a<2;a++)i[a]<=e&&(i[a]=e,o[a]=a?1:1-n),e=i[a],n=o[a];i[0]===i[1]&&o[0]*o[1]!==1?t.splice(r,1):r++}return t;function s(t,e,n){return t.interval[n]<e.interval[n]||t.interval[n]===e.interval[n]&&(t.close[n]-e.close[n]===(n?-1:1)||!n&&s(t,e,1))}}function _a(t){var e=parseFloat(t);return e==t&&(0!==e||!Y(t)||t.indexOf("x")<=0)?e:NaN}function xa(t){return!isNaN(_a(t))}function ba(){return Uo(9*Ko())}function wa(t,e){return 0===e?t:wa(e,t%e)}function Sa(t,e){return null==t?e:null==e?t:t*e/wa(t,e)}function Ta(t){return null!=t&&isFinite(t)}var Ma={},Ca="undefined"!=typeof console&&console.warn&&console.log;function Ia(t,e,n){if(Ca){if(n){if(Ma[e])return;Ma[e]=!0}console[t]("[ECharts] "+e)}}function Aa(t,e){Ia("log",t,e)}function Da(t,e){Ia("warn",t,e)}function La(t,e){Ia("error",t,e)}function Pa(t){Ia("warn","DEPRECATED: "+t,!0)}function Ea(t,e,n){Pa((n?"["+n+"]":"")+t+" is deprecated; use "+e+" instead.")}function Oa(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(t){return void 0===t?"undefined":t===1/0?"Infinity":t===-1/0?"-Infinity":it(t)?"NaN":t instanceof Date?"Date("+t.toISOString()+")":Z(t)?"function () { ... }":rt(t)?t+"":null};return V(t,function(t){if(Y(t))return t;var e=n(t);if(null!=e)return e;if("undefined"==typeof JSON||!JSON.stringify)return"?";try{return JSON.stringify(t,function(t,e){var r=n(e);return null==r?e:r})}catch(t){return"?"}}).join(" ")}function Na(t){throw new Error(t)}function Ra(t,e,n){return(e-t)*n+t}var ka="series\0",za="\0_ec_\0";function Ba(t){return t instanceof Array?t:null==t?[]:[t]}function Va(t,e,n){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var r=0,i=n.length;r<i;r++){var o=n[r];!t.emphasis[e].hasOwnProperty(o)&&t[e].hasOwnProperty(o)&&(t.emphasis[e][o]=t[e][o])}}}var Fa=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function Ga(t){return!J(t)||j(t)||t instanceof Date?t:t.value}function Ha(t){return J(t)&&!(t instanceof Array)}function Ua(t,e,n){var r="normalMerge"===n,i="replaceMerge"===n,o="replaceAll"===n;t=t||[],e=(e||[]).slice();var a=yt();B(e,function(t,n){J(t)?(null==t.id||Ya(t.id)||Za(t.id),null==t.name||Ya(t.name)||Za(t.name)):e[n]=null});var s,l,u=function(t,e,n){var r=[];if("replaceAll"===n)return r;for(var i=0;i<t.length;i++){var o=t[i];o&&null!=o.id&&e.set(o.id,i),r.push({existing:"replaceMerge"===n||Ka(o)?null:o,newOption:null,keyInfo:null,brandNew:null})}return r}(t,a,n);return(r||i)&&function(t,e,n,r){B(r,function(i,o){if(i&&null!=i.id){var a=Xa(i.id),s=n.get(a);if(null!=s){var l=t[s];ht(!l.newOption,'Duplicated option on id "'+a+'".'),l.newOption=i,l.existing=e[s],r[o]=null}}})}(u,t,a,e),r&&function(t,e){B(e,function(n,r){if(n&&null!=n.name)for(var i=0;i<t.length;i++){var o=t[i].existing;if(!t[i].newOption&&o&&(null==o.id||null==n.id)&&!Ka(n)&&!Ka(o)&&Wa("name",o,n))return t[i].newOption=n,void(e[r]=null)}})}(u,e),r||i?function(t,e,n){B(e,function(e){if(e){for(var r,i=0;(r=t[i])&&(r.newOption||Ka(r.existing)||r.existing&&null!=e.id&&!Wa("id",e,r.existing));)i++;r?(r.newOption=e,r.brandNew=n):t.push({newOption:e,brandNew:n,existing:null,keyInfo:null}),i++}})}(u,e,i):o&&function(t,e){B(e,function(e){t.push({newOption:e,brandNew:!0,existing:null,keyInfo:null})})}(u,e),s=u,l=yt(),B(s,function(t){var e=t.existing;e&&l.set(e.id,t)}),B(s,function(t){var e=t.newOption;ht(!e||null==e.id||!l.get(e.id)||l.get(e.id)===t,"id duplicates: "+(e&&e.id)),e&&null!=e.id&&l.set(e.id,t),!t.keyInfo&&(t.keyInfo={})}),B(s,function(t,e){var n=t.existing,r=t.newOption,i=t.keyInfo;if(J(r)){if(i.name=null!=r.name?Xa(r.name):n?n.name:ka+e,n)i.id=Xa(n.id);else if(null!=r.id)i.id=Xa(r.id);else{var o=0;do{i.id="\0"+i.name+"\0"+o++}while(l.get(i.id))}l.set(i.id,t)}}),u}function Wa(t,e,n){var r=ja(e[t],null),i=ja(n[t],null);return null!=r&&null!=i&&r===i}function Xa(t){if(null==t)throw new Error;return ja(t,"")}function ja(t,e){return null==t?e:Y(t)?t:K(t)||q(t)?t+"":e}function Za(t){Da("`"+t+"` is invalid id or name. Must be a string or number.")}function Ya(t){return q(t)||xa(t)}function qa(t){var e=t.name;return!(!e||!e.indexOf(ka))}function Ka(t){return t&&null!=t.id&&0===Xa(t.id).indexOf(za)}function Ja(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?j(e.dataIndex)?V(e.dataIndex,function(e){return t.indexOfRawIndex(e)}):t.indexOfRawIndex(e.dataIndex):null!=e.name?j(e.name)?V(e.name,function(e){return t.indexOfName(e)}):t.indexOfName(e.name):void 0}function Qa(){var t="__ec_inner_"+$a++;return function(e){return e[t]||(e[t]={})}}var $a=ba();function ts(t,e,n){var r=es(e,n),i=r.mainTypeSpecified,o=r.queryOptionMap,a=r.others,s=n?n.defaultMainType:null;return!i&&s&&o.set(s,{}),o.each(function(e,r){var i=is(t,r,e,{useDefault:s===r,enableAll:!n||null==n.enableAll||n.enableAll,enableNone:!n||null==n.enableNone||n.enableNone});a[r+"Models"]=i.models,a[r+"Model"]=i.models[0]}),a}function es(t,e){var n;if(Y(t)){var r={};r[t+"Index"]=0,n=r}else n=t;var i=yt(),o={},a=!1;return B(n,function(t,n){if("dataIndex"!==n&&"dataIndexInside"!==n){var r=n.match(/^(\w+)(Index|Id|Name)$/)||[],s=r[1],l=(r[2]||"").toLowerCase();if(s&&l&&!(e&&e.includeMainTypes&&N(e.includeMainTypes,s)<0))a=a||!!s,(i.get(s)||i.set(s,{}))[l]=t}else o[n]=t}),{mainTypeSpecified:a,queryOptionMap:i,others:o}}var ns={useDefault:!0,enableAll:!1,enableNone:!1},rs={useDefault:!1,enableAll:!0,enableNone:!0};function is(t,e,n,r){r=r||ns;var i=n.index,o=n.id,a=n.name,s={models:null,specified:null!=i||null!=o||null!=a};if(!s.specified){var l=void 0;return s.models=r.useDefault&&(l=t.getComponent(e))?[l]:[],s}if("none"===i||!1===i){if(r.enableNone)return s.models=[],s;La('`"none"` or `false` is not a valid value on index option.'),i=-1}return"all"===i&&(r.enableAll?i=o=a=null:(La('`"all"` is not a valid value on index option.'),i=-1)),s.models=t.queryComponents({mainType:e,index:i,id:o,name:a}),s}function os(t,e,n){ht(e);var r={};r[e+"Id"]=t[e+"Id"],r[e+"Index"]=t[e+"Index"],r[e+"Name"]=t[e+"Name"];var i={mainType:e,query:r};return n&&(i.subType=n),i}function as(t,e,n){t.setAttribute?t.setAttribute(e,n):t[e]=n}function ss(t,e){var n=yt(),r=[];return B(t,function(t){var i=e(t);(n.get(i)||(r.push(i),n.set(i,[]))).push(t)}),{keys:r,buckets:n}}function ls(t,e,n,r,i){var o=null==e||"auto"===e;if(null==r)return r;if(K(r))return ea(f=Ra(n||0,r,i),o?Math.max(ia(n||0),ia(r)):e);if(Y(r))return i<1?n:r;for(var a=[],s=n,l=r,u=Math.max(s?s.length:0,l.length),h=0;h<u;++h){var c=t.getDimensionInfo(h);if(c&&"ordinal"===c.type)a[h]=(i<1&&s?s:l)[h];else{var d=s&&s[h]?s[h]:0,p=l[h],f=Ra(d,p,i);a[h]=ea(f,o?Math.max(ia(d),ia(p)):e)}}return a}var us=function(){function t(){}return t.prototype.reset=function(t,e,n,r){return this._list=t,this._step=r=r||1,this._idx=e,this._end=null!=n?n:r>0?t.length:0,this.item=null,this.key=NaN,this},t.prototype.next=function(){return(this._step>0?this._idx<this._end:this._idx>=this._end)&&(this.item=this._list[this._idx],this.key=this._idx=this._idx+this._step,!0)},t}();function hs(t){t.option=t.parentModel=t.ecModel=null}function cs(){return[1/0,-1/0]}function ds(t,e){gs(e)&&(e<t[0]&&(t[0]=e),e>t[1]&&(t[1]=e))}function ps(t,e){gs(e)&&e<t[0]&&(t[0]=e)}function fs(t,e){gs(e)&&e>t[1]&&(t[1]=e)}function gs(t){return null!=t&&isFinite(t)}function ms(t,e){return gs(t)&&gs(e)&&t<=e}function vs(t){ms(t[0],t[1])&&t[0]>t[1]&&(t[0]=t[1])}function ys(){var t="__ec_once_"+_s++;return function(e,n){ht(e),wt(e,t)||(e[t]=1,n())}}var _s=ba();function xs(t,e,n){var r=yt(),i=0;B(t,function(o){var a=e(o);ht(Y(a));var s=r.get(a)||0;n&&n(o,s),s||n||(t[i++]=o),r.set(a,s+1)}),n||(t.length=i)}function bs(t){return ht(null!=t.value),t.value+""}function ws(t){return ht(null!=t),t+""}function Ss(t,e){return at(e,!0)?t.seriesIndex+2:0}function Ts(t,e,n){var r=t.getData().count();return{progressiveRender:n.progressiveEnabled&&e.incrementalPrepareRender&&r>=n.threshold,large:t.get("large")&&r>=t.get("largeThreshold"),modDataCount:"mod"===t.get("progressiveChunkMode")?t.getData().count():null}}function Ms(t,e){ht(t.start===e.start&&t.end===e.end)}function Cs(t,e){return{seriesType:t,overallReset:e}}function Is(t){return{overallReset:t}}var As="___EC__COMPONENT__CONTAINER___",Ds="___EC__EXTENDED_CLASS___";function Ls(t){var e={main:"",sub:""};if(t){var n=t.split(".");e.main=n[0]||"",e.sub=n[1]||""}return e}function Ps(t,n){t.$constructor=t,t.extend=function(t){B(n,function(e){t[e]||console.warn("Method `"+e+"` should be implemented"+(t.type?" in "+t.type:"")+".")});var r,i,o=this;return Z(i=o)&&/^class\s/.test(Function.prototype.toString.call(i))?r=function(t){function n(){return t.apply(this,arguments)||this}return e(n,t),n}(o):(r=function(){(t.$constructor||o).apply(this,arguments)},R(r,this)),L(r.prototype,t),r[Ds]=!0,r.extend=this.extend,r.superCall=Ns,r.superApply=Rs,r.superClass=o,r}}function Es(t,e){t.extend=e.extend}var Os=Math.round(10*Math.random());function Ns(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return this.superClass.prototype[e].apply(t,n)}function Rs(t,e,n){return this.superClass.prototype[e].apply(t,n)}function ks(t){var e={};t.registerClass=function(t){var n,r=t.type||t.prototype.type;if(r){ht(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(n=r),'componentType "'+n+'" illegal'),t.prototype.type=r;var i=Ls(r);if(i.sub){if(i.sub!==As){var o=function(t){var n=e[t.main];n&&n[As]||((n=e[t.main]={})[As]=!0);return n}(i);o[i.sub]=t}}else e[i.main]&&console.warn(i.main+" exists."),e[i.main]=t}return t},t.getClass=function(t,n,r){var i=e[t];if(i&&i[As]&&(i=n?i[n]:null),r&&!i)throw new Error(n?"Component "+t+"."+(n||"")+" is used but not imported.":t+".type should be specified.");return i},t.getClassesByMainType=function(t){var n=Ls(t),r=[],i=e[n.main];return i&&i[As]?B(i,function(t,e){e!==As&&r.push(t)}):r.push(i),r},t.hasClass=function(t){var n=Ls(t);return!!e[n.main]},t.getAllClassMainTypes=function(){var t=[];return B(e,function(e,n){t.push(n)}),t},t.hasSubTypes=function(t){var n=Ls(t),r=e[n.main];return r&&r[As]}}function zs(t,e){for(var n=0;n<t.length;n++)t[n][1]||(t[n][1]=t[n][0]);return e=e||!1,function(n,r,i){for(var o={},a=0;a<t.length;a++){var s=t[a][1];if(!(r&&N(r,s)>=0||i&&N(i,s)<0)){var l=n.getShallow(s,e);null!=l&&(o[t[a][0]]=l)}}return o}}var Bs=zs([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Vs=function(){function t(){}return t.prototype.getAreaStyle=function(t,e){return Bs(this,t,e)},t}(),Fs=new hr(50);function Gs(t){if("string"==typeof t){var e=Fs.get(t);return e&&e.image}return t}function Hs(t,e,n,r,i){if(t){if("string"==typeof t){if(e&&e.__zrImageSrc===t||!n)return e;var o=Fs.get(t),a={hostEl:n,cb:r,cbPayload:i};return o?!Ws(e=o.image)&&o.pending.push(a):((e=h.loadImage(t,Us,Us)).__zrImageSrc=t,Fs.put(t,e.__cachedImgObj={image:e,pending:[a]})),e}return t}return e}function Us(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var n=t.pending[e],r=n.cb;r&&r(this,n.cbPayload),n.hostEl.dirty()}t.pending.length=0}function Ws(t){return t&&t.width&&t.height}var Xs=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function js(t,e,n,r,i,o){if(!n)return t.text="",void(t.isTruncated=!1);var a=(e+"").split("\n");o=Zs(n,r,i,o);for(var s=!1,l={},u=0,h=a.length;u<h;u++)Ys(l,a[u],o),a[u]=l.textLine,s=s||l.isTruncated;t.text=a.join("\n"),t.isTruncated=s}function Zs(t,e,n,r){var i=L({},r=r||{});n=at(n,"..."),i.maxIterations=at(r.maxIterations,2);var o=i.minChar=at(r.minChar,0),a=i.fontMeasureInfo=to(e),s=a.asciiCharWidth;i.placeholder=at(r.placeholder,"");for(var l=t=Math.max(0,t-1),u=0;u<o&&l>=s;u++)l-=s;var h=io(a,n);return h>l&&(n="",h=0),l=t-h,i.ellipsis=n,i.ellipsisWidth=h,i.contentWidth=l,i.containerWidth=t,i}function Ys(t,e,n){var r=n.containerWidth,i=n.contentWidth,o=n.fontMeasureInfo;if(!r)return t.textLine="",void(t.isTruncated=!1);var a=io(o,e);if(a<=r)return t.textLine=e,void(t.isTruncated=!1);for(var s=0;;s++){if(a<=i||s>=n.maxIterations){e+=n.ellipsis;break}var l=0===s?qs(e,i,o):a>0?Math.floor(e.length*i/a):0;a=io(o,e=e.substr(0,l))}""===e&&(e=n.placeholder),t.textLine=e,t.isTruncated=!0}function qs(t,e,n){for(var r=0,i=0,o=t.length;i<o&&r<e;i++)r+=ro(n,t.charCodeAt(i));return i}var Ks=function(){},Js=function(t){this.tokens=[],t&&(this.tokens=t)},Qs=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1};function $s(t,e,n,r,i){var o,a,s=""===e,l=i&&n.rich[i]||{},u=t.lines,h=l.font||n.font,c=!1;if(r){var d=l.padding,p=d?d[1]+d[3]:0;if(null!=l.width&&"auto"!==l.width){var f=ho(l.width,r.width)+p;u.length>0&&f+r.accumWidth>r.width&&(o=e.split("\n"),c=!0),r.accumWidth=f}else{var g=nl(e,h,r.width,r.breakAll,r.accumWidth);r.accumWidth=g.accumWidth+p,a=g.linesWidths,o=g.lines}}o||(o=e.split("\n"));for(var m=to(h),v=0;v<o.length;v++){var y=o[v],_=new Ks;if(_.styleName=i,_.text=y,_.isLineHolder=!y&&!s,"number"==typeof l.width?_.width=l.width:_.width=a?a[v]:io(m,y),v||c)u.push(new Js([_]));else{var x=(u[u.length-1]||(u[0]=new Js)).tokens,b=x.length;1===b&&x[0].isLineHolder?x[0]=_:(y||!b||s)&&x.push(_)}}}var tl=F(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function el(t){return!function(t){var e=t.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!tl[t]}function nl(t,e,n,r,i){for(var o=[],a=[],s="",l="",u=0,h=0,c=to(e),d=0;d<t.length;d++){var p=t.charAt(d);if("\n"!==p){var f=ro(c,p.charCodeAt(0)),g=!r&&!el(p);(o.length?h+f>n:i+h+f>n)?h?(s||l)&&(g?(s||(s=l,l="",h=u=0),o.push(s),a.push(h-u),l+=p,s="",h=u+=f):(l&&(s+=l,l="",u=0),o.push(s),a.push(h),s=p,h=f)):g?(o.push(l),a.push(u),l=p,u=f):(o.push(p),a.push(f)):(h+=f,g?(l+=p,u+=f):(l&&(s+=l,l="",u=0),s+=p))}else l&&(s+=l,h+=u),o.push(s),a.push(h),s="",l="",u=0,h=0}return l&&(s+=l),s&&(o.push(s),a.push(h)),1===o.length&&(h+=i),{accumWidth:h,lines:o,linesWidths:a}}function rl(t,e,n,r,i,o){if(t.baseX=n,t.baseY=r,t.outerWidth=t.outerHeight=null,e){var a=2*e.width,s=2*e.height;ln.set(il,so(n,a,i),lo(r,s,o),a,s),ln.intersect(e,il,null,ol);var l=ol.outIntersectRect;t.outerWidth=l.width,t.outerHeight=l.height,t.baseX=so(l.x,l.width,i,!0),t.baseY=lo(l.y,l.height,o,!0)}}var il=new ln(0,0,0,0),ol={outIntersectRect:{},clamp:!0};function al(t){return null!=t?t+="":t=""}function sl(t,e,n,r){var i=new ln(so(t.x||0,e,t.textAlign),lo(t.y||0,n,t.textBaseline),e,n),o=null!=r?r:ll(t)?t.lineWidth:0;return o>0&&(i.x-=o/2,i.y-=o/2,i.width+=o,i.height+=o),i}function ll(t){var e=t.stroke;return null!=e&&"none"!==e&&t.lineWidth>0}var ul="__zr_style_"+Math.round(10*Math.random()),hl={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},cl={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};hl[ul]=!0;var dl=["z","z2","invisible"],pl=["invisible"],fl=function(t){function n(e){return t.call(this,e)||this}var r;return e(n,t),n.prototype._init=function(e){for(var n=U(e),r=0;r<n.length;r++){var i=n[r];"style"===i?this.useStyle(e[i]):t.prototype.attrKV.call(this,i,e[i])}this.style||this.useStyle({})},n.prototype.beforeBrush=function(t){},n.prototype.afterBrush=function(){},n.prototype.innerBeforeBrush=function(){},n.prototype.innerAfterBrush=function(){},n.prototype.shouldBePainted=function(t,e,n,r){var i=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&function(t,e,n){gl.copy(t.getBoundingRect()),t.transform&&gl.applyTransform(t.transform);return ml.width=e,ml.height=n,!gl.intersect(ml)}(this,t,e)||i&&!i[0]&&!i[3])return!1;if(n&&this.__clipPaths&&this.__clipPaths.length)for(var o=0;o<this.__clipPaths.length;++o)if(this.__clipPaths[o].isZeroArea())return!1;if(r&&this.parent)for(var a=this.parent;a;){if(a.ignore)return!1;a=a.parent}return!0},n.prototype.contain=function(t,e){return this.rectContain(t,e)},n.prototype.traverse=function(t,e){t.call(e,this)},n.prototype.rectContain=function(t,e){var n=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(n[0],n[1])},n.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var e=this.transform,n=this.getBoundingRect(),r=this.style,i=r.shadowBlur||0,o=r.shadowOffsetX||0,a=r.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new ln(0,0,0,0)),e?ln.applyTransform(t,n,e):t.copy(n),(i||o||a)&&(t.width+=2*i+Math.abs(o),t.height+=2*i+Math.abs(a),t.x=Math.min(t.x,t.x+o-i),t.y=Math.min(t.y,t.y+a-i));var s=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-s),t.y=Math.floor(t.y-s),t.width=Math.ceil(t.width+1+2*s),t.height=Math.ceil(t.height+1+2*s))}return t},n.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new ln(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},n.prototype.getPrevPaintRect=function(){return this._prevPaintRect},n.prototype.animateStyle=function(t){return this.animate("style",t)},n.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():this.markRedraw()},n.prototype.attrKV=function(e,n){"style"!==e?t.prototype.attrKV.call(this,e,n):this.style?this.setStyle(n):this.useStyle(n)},n.prototype.setStyle=function(t,e){return"string"==typeof t?this.style[t]=e:L(this.style,t),this.dirtyStyle(),this},n.prototype.dirtyStyle=function(t){t||this.markRedraw(),this.__dirty|=2,this._rect&&(this._rect=null)},n.prototype.dirty=function(){this.dirtyStyle()},n.prototype.styleChanged=function(){return!!(2&this.__dirty)},n.prototype.styleUpdated=function(){this.__dirty&=-3},n.prototype.createStyle=function(t){return xt(hl,t)},n.prototype.useStyle=function(t){t[ul]||(t=this.createStyle(t)),this.style=t,this.dirtyStyle()},n.prototype._useHoverStyle=function(t){this.__hoverStyle=t},n.prototype.isStyleObject=function(t){return t[ul]},n.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(e,n,dl)},n.prototype._applyStateObj=function(e,n,r,i,o,a){t.prototype._applyStateObj.call(this,e,n,r,i,o,a);var s,l=!(n&&i),u=1===this.__inHover;if(n&&n.style?o?i?s=n.style:(s=this._mergeStyle(this.createStyle(),r.style),this._mergeStyle(s,n.style)):(s=this._mergeStyle(this.createStyle(),i?this.style:r.style),this._mergeStyle(s,n.style)):l&&(s=r.style),s)if(o){var h=this.style;if(this.style=this.createStyle(l?{}:h),l)for(var c=U(h),d=0;d<c.length;d++){(f=c[d])in s&&(s[f]=s[f],this.style[f]=h[f])}var p=U(s);for(d=0;d<p.length;d++){var f=p[d];this.style[f]=this.style[f]}this._transitionState(e,{style:s},a,this.getAnimationStyleProps())}else u?this._useHoverStyle(s):this.useStyle(s);if(!u){var g=this.__inHover?pl:dl;for(d=0;d<g.length;d++){f=g[d];n&&null!=n[f]?this[f]=n[f]:l&&null!=r[f]&&(this[f]=r[f])}}},n.prototype._mergeStates=function(e){for(var n,r=t.prototype._mergeStates.call(this,e),i=0;i<e.length;i++){var o=e[i];o.style&&(n=n||{},this._mergeStyle(n,o.style))}return n&&(r.style=n),r},n.prototype._mergeStyle=function(t,e){return L(t,e),t},n.prototype.getAnimationStyleProps=function(){return cl},n.initDefaultProps=((r=n.prototype).type="displayable",r.invisible=!1,r.z=0,r.z2=0,r.zlevel=0,r.culling=!1,r.cursor="pointer",r.rectHover=!1,r.incremental=0,r._rect=null,r.dirtyRectTolerance=0,void(r.__dirty=3)),n}(Io),gl=new ln(0,0,0,0),ml=new ln(0,0,0,0);var vl=fl,yl=Math.min,_l=Math.max,xl=Math.sin,bl=Math.cos,wl=2*Math.PI,Sl=It(),Tl=It(),Ml=It();function Cl(t,e,n){if(0!==t.length){for(var r=t[0],i=r[0],o=r[0],a=r[1],s=r[1],l=1;l<t.length;l++)r=t[l],i=yl(i,r[0]),o=_l(o,r[0]),a=yl(a,r[1]),s=_l(s,r[1]);e[0]=i,e[1]=a,n[0]=o,n[1]=s}}function Il(t,e,n,r,i,o){i[0]=yl(t,n),i[1]=yl(e,r),o[0]=_l(t,n),o[1]=_l(e,r)}var Al=[],Dl=[];function Ll(t,e,n,r,i,o,a,s,l,u){var h=Yn,c=Xn,d=h(t,n,i,a,Al);l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0;for(var p=0;p<d;p++){var f=c(t,n,i,a,Al[p]);l[0]=yl(f,l[0]),u[0]=_l(f,u[0])}d=h(e,r,o,s,Dl);for(p=0;p<d;p++){var g=c(e,r,o,s,Dl[p]);l[1]=yl(g,l[1]),u[1]=_l(g,u[1])}l[0]=yl(t,l[0]),u[0]=_l(t,u[0]),l[0]=yl(a,l[0]),u[0]=_l(a,u[0]),l[1]=yl(e,l[1]),u[1]=_l(e,u[1]),l[1]=yl(s,l[1]),u[1]=_l(s,u[1])}function Pl(t,e,n,r,i,o,a,s){var l=tr,u=Qn,h=_l(yl(l(t,n,i),1),0),c=_l(yl(l(e,r,o),1),0),d=u(t,n,i,h),p=u(e,r,o,c);a[0]=yl(t,i,d),a[1]=yl(e,o,p),s[0]=_l(t,i,d),s[1]=_l(e,o,p)}function El(t,e,n,r,i,o,a,s,l){var u=jt,h=Zt,c=Math.abs(i-o);if(c%wl<1e-4&&c>1e-4)return s[0]=t-n,s[1]=e-r,l[0]=t+n,void(l[1]=e+r);if(Sl[0]=bl(i)*n+t,Sl[1]=xl(i)*r+e,Tl[0]=bl(o)*n+t,Tl[1]=xl(o)*r+e,u(s,Sl,Tl),h(l,Sl,Tl),(i%=wl)<0&&(i+=wl),(o%=wl)<0&&(o+=wl),i>o&&!a?o+=wl:i<o&&a&&(i+=wl),a){var d=o;o=i,i=d}for(var p=0;p<o;p+=Math.PI/2)p>i&&(Ml[0]=bl(p)*n+t,Ml[1]=xl(p)*r+e,u(s,Ml,s),h(l,Ml,l))}var Ol={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Nl=[],Rl=[],kl=[],zl=[],Bl=[],Vl=[],Fl=Math.min,Gl=Math.max,Hl=Math.cos,Ul=Math.sin,Wl=Math.abs,Xl=Math.PI,jl=2*Xl,Zl="undefined"!=typeof Float32Array,Yl=[];function ql(t){return Math.round(t/Xl*1e8)/1e8%2*Xl}function Kl(t,e){var n=ql(t[0]);n<0&&(n+=jl);var r=n-t[0],i=t[1];i+=r,!e&&i-n>=jl?i=n+jl:e&&n-i>=jl?i=n-jl:!e&&n>i?i=n+(jl-ql(n-i)):e&&n<i&&(i=n-(jl-ql(i-n))),t[0]=n,t[1]=i}var Jl=function(){function t(t){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,t&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(t,e,n){(n=n||0)>0&&(this._ux=Wl(n/zi/t)||0,this._uy=Wl(n/zi/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},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(t,e){return this._drawPendingPt(),this.addData(Ol.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var n=Wl(t-this._xi),r=Wl(e-this._yi),i=n>this._ux||r>this._uy;if(this.addData(Ol.L,t,e),this._ctx&&i&&this._ctx.lineTo(t,e),i)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=n*n+r*r;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,n,r,i,o){return this._drawPendingPt(),this.addData(Ol.C,t,e,n,r,i,o),this._ctx&&this._ctx.bezierCurveTo(t,e,n,r,i,o),this._xi=i,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,n,r){return this._drawPendingPt(),this.addData(Ol.Q,t,e,n,r),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,r),this._xi=n,this._yi=r,this},t.prototype.arc=function(t,e,n,r,i,o){this._drawPendingPt(),Yl[0]=r,Yl[1]=i,Kl(Yl,o),r=Yl[0];var a=(i=Yl[1])-r;return this.addData(Ol.A,t,e,n,n,r,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,n,r,i,o),this._xi=Hl(i)*n+t,this._yi=Ul(i)*n+e,this},t.prototype.arcTo=function(t,e,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,n,r,i),this},t.prototype.rect=function(t,e,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,n,r),this.addData(Ol.R,t,e,n,r),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ol.Z);var t=this._ctx,e=this._x0,n=this._y0;return t&&t.closePath(),this._xi=e,this._yi=n,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(t){if(this._saveData){var e=t.length;this.data&&this.data.length===e||!Zl||(this.data=new Float32Array(e));for(var n=0;n<e;n++)this.data[n]=t[n];this._len=e}},t.prototype.appendPath=function(t){if(this._saveData){t instanceof Array||(t=[t]);for(var e=t.length,n=0,r=this._len,i=0;i<e;i++)n+=t[i].len();var o=this.data;if(Zl&&(o instanceof Float32Array||!o)&&(this.data=new Float32Array(r+n),r>0&&o))for(var a=0;a<r;a++)this.data[a]=o[a];for(i=0;i<e;i++){var s=t[i].data;for(a=0;a<s.length;a++)this.data[r++]=s[a]}this._len=r}},t.prototype.addData=function(t,e,n,r,i,o,a,s,l){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var h=0;h<arguments.length;h++)u[this._len++]=arguments[h]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var t=this.data;t instanceof Array&&(t.length=this._len,Zl&&this._len>11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){kl[0]=kl[1]=Bl[0]=Bl[1]=Number.MAX_VALUE,zl[0]=zl[1]=Vl[0]=Vl[1]=-Number.MAX_VALUE;var t,e=this.data,n=0,r=0,i=0,o=0;for(t=0;t<this._len;){var a=e[t++],s=1===t;switch(s&&(i=n=e[t],o=r=e[t+1]),a){case Ol.M:n=i=e[t++],r=o=e[t++],Bl[0]=i,Bl[1]=o,Vl[0]=i,Vl[1]=o;break;case Ol.L:Il(n,r,e[t],e[t+1],Bl,Vl),n=e[t++],r=e[t++];break;case Ol.C:Ll(n,r,e[t++],e[t++],e[t++],e[t++],e[t],e[t+1],Bl,Vl),n=e[t++],r=e[t++];break;case Ol.Q:Pl(n,r,e[t++],e[t++],e[t],e[t+1],Bl,Vl),n=e[t++],r=e[t++];break;case Ol.A:var l=e[t++],u=e[t++],h=e[t++],c=e[t++],d=e[t++],p=e[t++]+d;t+=1;var f=!e[t++];s&&(i=Hl(d)*h+l,o=Ul(d)*c+u),El(l,u,h,c,d,p,f,Bl,Vl),n=Hl(p)*h+l,r=Ul(p)*c+u;break;case Ol.R:Il(i=n=e[t++],o=r=e[t++],i+e[t++],o+e[t++],Bl,Vl);break;case Ol.Z:n=i,r=o}jt(kl,kl,Bl),Zt(zl,zl,Vl)}return 0===t&&(kl[0]=kl[1]=zl[0]=zl[1]=0),new ln(kl[0],kl[1],zl[0]-kl[0],zl[1]-kl[1])},t.prototype._calculateLength=function(){var t=this.data,e=this._len,n=this._ux,r=this._uy,i=0,o=0,a=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var l=this._pathSegLen,u=0,h=0,c=0;c<e;){var d=t[c++],p=1===c;p&&(a=i=t[c],s=o=t[c+1]);var f=-1;switch(d){case Ol.M:i=a=t[c++],o=s=t[c++];break;case Ol.L:var g=t[c++],m=(_=t[c++])-o;(Wl(D=g-i)>n||Wl(m)>r||c===e-1)&&(f=Math.sqrt(D*D+m*m),i=g,o=_);break;case Ol.C:var v=t[c++],y=t[c++],_=(g=t[c++],t[c++]),x=t[c++],b=t[c++];f=Jn(i,o,v,y,g,_,x,b,10),i=x,o=b;break;case Ol.Q:f=rr(i,o,v=t[c++],y=t[c++],g=t[c++],_=t[c++],10),i=g,o=_;break;case Ol.A:var w=t[c++],S=t[c++],T=t[c++],M=t[c++],C=t[c++],I=t[c++],A=I+C;c+=1,p&&(a=Hl(C)*T+w,s=Ul(C)*M+S),f=Gl(T,M)*Fl(jl,Math.abs(I)),i=Hl(A)*T+w,o=Ul(A)*M+S;break;case Ol.R:a=i=t[c++],s=o=t[c++],f=2*t[c++]+2*t[c++];break;case Ol.Z:var D=a-i;m=s-o;f=Math.sqrt(D*D+m*m),i=a,o=s}f>=0&&(l[h++]=f,u+=f)}return this._pathLen=u,u},t.prototype.rebuildPath=function(t,e){var n,r,i,o,a,s,l,u,h,c,d=this.data,p=this._ux,f=this._uy,g=this._len,m=e<1,v=0,y=0,_=0;if(!m||(this._pathSegLen||this._calculateLength(),l=this._pathSegLen,u=e*this._pathLen))t:for(var x=0;x<g;){var b=d[x++],w=1===x;switch(w&&(n=i=d[x],r=o=d[x+1]),b!==Ol.L&&_>0&&(t.lineTo(h,c),_=0),b){case Ol.M:n=i=d[x++],r=o=d[x++],t.moveTo(i,o);break;case Ol.L:a=d[x++],s=d[x++];var S=Wl(a-i),T=Wl(s-o);if(S>p||T>f){if(m){if(v+(Y=l[y++])>u){var M=(u-v)/Y;t.lineTo(i*(1-M)+a*M,o*(1-M)+s*M);break t}v+=Y}t.lineTo(a,s),i=a,o=s,_=0}else{var C=S*S+T*T;C>_&&(h=a,c=s,_=C)}break;case Ol.C:var I=d[x++],A=d[x++],D=d[x++],L=d[x++],P=d[x++],E=d[x++];if(m){if(v+(Y=l[y++])>u){qn(i,I,D,P,M=(u-v)/Y,Nl),qn(o,A,L,E,M,Rl),t.bezierCurveTo(Nl[1],Rl[1],Nl[2],Rl[2],Nl[3],Rl[3]);break t}v+=Y}t.bezierCurveTo(I,A,D,L,P,E),i=P,o=E;break;case Ol.Q:I=d[x++],A=d[x++],D=d[x++],L=d[x++];if(m){if(v+(Y=l[y++])>u){er(i,I,D,M=(u-v)/Y,Nl),er(o,A,L,M,Rl),t.quadraticCurveTo(Nl[1],Rl[1],Nl[2],Rl[2]);break t}v+=Y}t.quadraticCurveTo(I,A,D,L),i=D,o=L;break;case Ol.A:var O=d[x++],N=d[x++],R=d[x++],k=d[x++],z=d[x++],B=d[x++],V=d[x++],F=!d[x++],G=R>k?R:k,H=Wl(R-k)>.001,U=z+B,W=!1;if(m)v+(Y=l[y++])>u&&(U=z+B*(u-v)/Y,W=!0),v+=Y;if(H&&t.ellipse?t.ellipse(O,N,R,k,V,z,U,F):t.arc(O,N,G,z,U,F),W)break t;w&&(n=Hl(z)*R+O,r=Ul(z)*k+N),i=Hl(U)*R+O,o=Ul(U)*k+N;break;case Ol.R:n=i=d[x],r=o=d[x+1],a=d[x++],s=d[x++];var X=d[x++],j=d[x++];if(m){if(v+(Y=l[y++])>u){var Z=u-v;t.moveTo(a,s),t.lineTo(a+Fl(Z,X),s),(Z-=X)>0&&t.lineTo(a+X,s+Fl(Z,j)),(Z-=j)>0&&t.lineTo(a+Gl(X-Z,0),s+j),(Z-=X)>0&&t.lineTo(a,s+Gl(j-Z,0));break t}v+=Y}t.rect(a,s,X,j);break;case Ol.Z:if(m){var Y;if(v+(Y=l[y++])>u){M=(u-v)/Y;t.lineTo(i*(1-M)+n*M,o*(1-M)+r*M);break t}v+=Y}t.closePath(),i=n,o=r}}},t.prototype.clone=function(){var e=new t,n=this.data;return e.data=n.slice?n.slice():Array.prototype.slice.call(n),e._len=this._len,e},t.prototype.canSave=function(){return!!this._saveData},t.CMD=Ol,t.initDefaultProps=function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),t}(),Ql=Jl;function $l(t,e,n,r,i,o,a){if(0===i)return!1;var s=i,l=0;if(a>e+s&&a>r+s||a<e-s&&a<r-s||o>t+s&&o>n+s||o<t-s&&o<n-s)return!1;if(t===n)return Math.abs(o-t)<=s/2;var u=(l=(e-r)/(t-n))*o-a+(t*r-n*e)/(t-n);return u*u/(l*l+1)<=s/2*s/2}function tu(t,e,n,r,i,o,a,s,l,u,h){if(0===l)return!1;var c=l;return!(h>e+c&&h>r+c&&h>o+c&&h>s+c||h<e-c&&h<r-c&&h<o-c&&h<s-c||u>t+c&&u>n+c&&u>i+c&&u>a+c||u<t-c&&u<n-c&&u<i-c&&u<a-c)&&Kn(t,e,n,r,i,o,a,s,u,h,null)<=c/2}function eu(t,e,n,r,i,o,a,s,l){if(0===a)return!1;var u=a;return!(l>e+u&&l>r+u&&l>o+u||l<e-u&&l<r-u&&l<o-u||s>t+u&&s>n+u&&s>i+u||s<t-u&&s<n-u&&s<i-u)&&nr(t,e,n,r,i,o,s,l,null)<=u/2}var nu=2*Math.PI;function ru(t){return(t%=nu)<0&&(t+=nu),t}var iu=2*Math.PI;function ou(t,e,n,r,i,o,a,s,l){if(0===a)return!1;var u=a;s-=t,l-=e;var h=Math.sqrt(s*s+l*l);if(h-u>n||h+u<n)return!1;if(Math.abs(r-i)%iu<1e-4)return!0;if(o){var c=r;r=ru(i),i=ru(c)}else r=ru(r),i=ru(i);r>i&&(i+=iu);var d=Math.atan2(l,s);return d<0&&(d+=iu),d>=r&&d<=i||d+iu>=r&&d+iu<=i}function au(t,e,n,r,i,o){if(o>e&&o>r||o<e&&o<r)return 0;if(r===e)return 0;var a=(o-e)/(r-e),s=r<e?1:-1;1!==a&&0!==a||(s=r<e?.5:-.5);var l=a*(n-t)+t;return l===i?1/0:l>i?s:0}var su=Ql.CMD,lu=2*Math.PI;var uu=[-1,-1,-1],hu=[-1,-1];function cu(){var t=hu[0];hu[0]=hu[1],hu[1]=t}function du(t,e,n,r,i,o,a,s,l,u){if(u>e&&u>r&&u>o&&u>s||u<e&&u<r&&u<o&&u<s)return 0;var h=Zn(e,r,o,s,u,uu);if(0===h)return 0;for(var c=0,d=-1,p=void 0,f=void 0,g=0;g<h;g++){var m=uu[g],v=0===m||1===m?.5:1;Xn(t,n,i,a,m)<l||(d<0&&(d=Yn(e,r,o,s,hu),hu[1]<hu[0]&&d>1&&cu(),p=Xn(e,r,o,s,hu[0]),d>1&&(f=Xn(e,r,o,s,hu[1]))),2===d?m<hu[0]?c+=p<e?v:-v:m<hu[1]?c+=f<p?v:-v:c+=s<f?v:-v:m<hu[0]?c+=p<e?v:-v:c+=s<p?v:-v)}return c}function pu(t,e,n,r,i,o,a,s){if(s>e&&s>r&&s>o||s<e&&s<r&&s<o)return 0;var l=function(t,e,n,r,i){var o=t-2*e+n,a=2*(e-t),s=t-r,l=0;if(Un(o))Wn(a)&&(h=-s/a)>=0&&h<=1&&(i[l++]=h);else{var u=a*a-4*o*s;if(Un(u))(h=-a/(2*o))>=0&&h<=1&&(i[l++]=h);else if(u>0){var h,c=Rn(u),d=(-a-c)/(2*o);(h=(-a+c)/(2*o))>=0&&h<=1&&(i[l++]=h),d>=0&&d<=1&&(i[l++]=d)}}return l}(e,r,o,s,uu);if(0===l)return 0;var u=tr(e,r,o);if(u>=0&&u<=1){for(var h=0,c=Qn(e,r,o,u),d=0;d<l;d++){var p=0===uu[d]||1===uu[d]?.5:1;Qn(t,n,i,uu[d])<a||(uu[d]<u?h+=c<e?p:-p:h+=o<c?p:-p)}return h}p=0===uu[0]||1===uu[0]?.5:1;return Qn(t,n,i,uu[0])<a?0:o<e?p:-p}function fu(t,e,n,r,i,o,a,s){if((s-=e)>n||s<-n)return 0;var l=Math.sqrt(n*n-s*s);uu[0]=-l,uu[1]=l;var u=Math.abs(r-i);if(u<1e-4)return 0;if(u>=lu-1e-4){r=0,i=lu;var h=o?1:-1;return a>=uu[0]+t&&a<=uu[1]+t?h:0}if(r>i){var c=r;r=i,i=c}r<0&&(r+=lu,i+=lu);for(var d=0,p=0;p<2;p++){var f=uu[p];if(f+t>a){var g=Math.atan2(s,f);h=o?1:-1;g<0&&(g=lu+g),(g>=r&&g<=i||g+lu>=r&&g+lu<=i)&&(g>Math.PI/2&&g<1.5*Math.PI&&(h=-h),d+=h)}}return d}function gu(t,e,n,r,i){for(var o,a,s,l,u=t.data,h=t.len(),c=0,d=0,p=0,f=0,g=0,m=0;m<h;){var v=u[m++],y=1===m;switch(v===su.M&&m>1&&(n||(c+=au(d,p,f,g,r,i))),y&&(f=d=u[m],g=p=u[m+1]),v){case su.M:d=f=u[m++],p=g=u[m++];break;case su.L:if(n){if($l(d,p,u[m],u[m+1],e,r,i))return!0}else c+=au(d,p,u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case su.C:if(n){if(tu(d,p,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],e,r,i))return!0}else c+=du(d,p,u[m++],u[m++],u[m++],u[m++],u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case su.Q:if(n){if(eu(d,p,u[m++],u[m++],u[m],u[m+1],e,r,i))return!0}else c+=pu(d,p,u[m++],u[m++],u[m],u[m+1],r,i)||0;d=u[m++],p=u[m++];break;case su.A:var _=u[m++],x=u[m++],b=u[m++],w=u[m++],S=u[m++],T=u[m++];m+=1;var M=!!(1-u[m++]);o=Math.cos(S)*b+_,a=Math.sin(S)*w+x,y?(f=o,g=a):c+=au(d,p,o,a,r,i);var C=(r-_)*w/b+_;if(n){if(ou(_,x,w,S,S+T,M,e,C,i))return!0}else c+=fu(_,x,w,S,S+T,M,C,i);d=Math.cos(S+T)*b+_,p=Math.sin(S+T)*w+x;break;case su.R:if(f=d=u[m++],g=p=u[m++],o=f+u[m++],a=g+u[m++],n){if($l(f,g,o,g,e,r,i)||$l(o,g,o,a,e,r,i)||$l(o,a,f,a,e,r,i)||$l(f,a,f,g,e,r,i))return!0}else c+=au(o,g,o,a,r,i),c+=au(f,a,f,g,r,i);break;case su.Z:if(n){if($l(d,p,f,g,e,r,i))return!0}else c+=au(d,p,f,g,r,i);d=f,p=g}}return n||(s=p,l=g,Math.abs(s-l)<1e-4)||(c+=au(d,p,f,g,r,i)||0),0!==c}var mu=E({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},hl),vu={style:E({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},cl.style)},yu=Ki.concat(["invisible","culling","z","z2","zlevel","parent"]),_u=function(t){function n(e){return t.call(this,e)||this}var r;return e(n,t),n.prototype.update=function(){var e=this;t.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new n;i.buildPath===n.prototype.buildPath&&(i.buildPath=function(t){e.buildPath(t,e.shape)}),i.silent=!0;var o=i.style;for(var a in r)o[a]!==r[a]&&(o[a]=r[a]);o.fill=r.fill?r.decal:null,o.decal=null,o.shadowColor=null,r.strokeFirst&&(o.stroke=null);for(var s=0;s<yu.length;++s)i[yu[s]]=this[yu[s]];i.__dirty|=1}else this._decalEl&&(this._decalEl=null)},n.prototype.getDecalElement=function(){return this._decalEl},n.prototype._init=function(e){var n=U(e);this.shape=this.getDefaultShape();var r=this.getDefaultStyle();r&&this.useStyle(r);for(var i=0;i<n.length;i++){var o=n[i],a=e[o];"style"===o?this.style?L(this.style,a):this.useStyle(a):"shape"===o?L(this.shape,a):t.prototype.attrKV.call(this,o,a)}this.style||this.useStyle({})},n.prototype.getDefaultStyle=function(){return null},n.prototype.getDefaultShape=function(){return{}},n.prototype.canBeInsideText=function(){return this.hasFill()},n.prototype.getInsideTextFill=function(){var t=this.style.fill;if("none"!==t){if(Y(t)){var e=Or(t,0);return e>.5?Bi:e>.2?"#eee":Vi}if(t)return Vi}return Bi},n.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(Y(e)){var n=this.__zr;if(!(!n||!n.isDarkMode())===Or(t,0)<.4)return e}},n.prototype.buildPath=function(t,e,n){},n.prototype.pathUpdated=function(){this.__dirty&=-5},n.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},n.prototype.createPathProxy=function(){this.path=new Ql(!1)},n.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},n.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},n.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,n=!t;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||4&this.__dirty)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),t=i.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||n){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var l=this.strokeContainThreshold;s=Math.max(s,null==l?4:l)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),r=this.getBoundingRect(),i=this.style;if(t=n[0],e=n[1],r.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,n,r){return gu(t,e,!0,n,r)}(o,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,n){return gu(t,0,!1,e,n)}(o,t,e)}return!1},n.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},n.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},n.prototype.animateShape=function(t){return this.animate("shape",t)},n.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},n.prototype.attrKV=function(e,n){"shape"===e?this.setShape(n):t.prototype.attrKV.call(this,e,n)},n.prototype.setShape=function(t,e){var n=this.shape;return n||(n=this.shape={}),"string"==typeof t?n[t]=e:L(n,t),this.dirtyShape(),this},n.prototype.shapeChanged=function(){return!!(4&this.__dirty)},n.prototype.createStyle=function(t){return xt(mu,t)},n.prototype._innerSaveToNormal=function(e){t.prototype._innerSaveToNormal.call(this,e);var n=this._normalState;e.shape&&!n.shape&&(n.shape=L({},this.shape))},n.prototype._applyStateObj=function(e,n,r,i,o,a){if(t.prototype._applyStateObj.call(this,e,n,r,i,o,a),1!==this.__inHover){var s,l=!(n&&i);if(n&&n.shape?o?i?s=n.shape:(s=L({},r.shape),L(s,n.shape)):(s=L({},i?this.shape:r.shape),L(s,n.shape)):l&&(s=r.shape),s)if(o){this.shape=L({},this.shape);for(var u={},h=U(s),c=0;c<h.length;c++){var d=h[c];"object"==typeof s[d]?this.shape[d]=s[d]:u[d]=s[d]}this._transitionState(e,{shape:u},a)}else this.shape=s,this.dirtyShape()}},n.prototype._mergeStates=function(e){for(var n,r=t.prototype._mergeStates.call(this,e),i=0;i<e.length;i++){var o=e[i];o.shape&&(n=n||{},this._mergeStyle(n,o.shape))}return n&&(r.shape=n),r},n.prototype.getAnimationStyleProps=function(){return vu},n.prototype.isZeroArea=function(){return!1},n.extend=function(t){var r=function(n){function r(e){var r=n.call(this,e)||this;return t.init&&t.init.call(r,e),r}return e(r,n),r.prototype.getDefaultStyle=function(){return I(t.style)},r.prototype.getDefaultShape=function(){return I(t.shape)},r}(n);for(var i in t)"function"==typeof t[i]&&(r.prototype[i]=t[i]);return r},n.initDefaultProps=((r=n.prototype).type="path",r.strokeContainThreshold=5,r.segmentIgnoreThreshold=0,r.subPixelOptimize=!1,r.autoBatch=!1,void(r.__dirty=7)),n}(vl),xu=_u,bu=E({strokeFirst:!0,font:a,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},mu),wu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.hasStroke=function(){return ll(this.style)},n.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},n.prototype.createStyle=function(t){return xt(bu,t)},n.prototype.setBoundingRect=function(t){this._rect=t},n.prototype.getBoundingRect=function(){var t,e,n;return this._rect||(this._rect=(t=this.style,e=al(t.text),n=t.font,sl(t,io(to(n),e),uo(n),null))),this._rect},n.initDefaultProps=void(n.prototype.dirtyRectTolerance=10),n}(vl);wu.prototype.type="tspan";var Su=wu,Tu=E({x:0,y:0},hl),Mu={style:E({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},cl.style)};var Cu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.createStyle=function(t){return xt(Tu,t)},n.prototype._getSize=function(t){var e=this.style,n=e[t];if(null!=n)return n;var r,i=(r=e.image)&&"string"!=typeof r&&r.width&&r.height?e.image:this.__image;if(!i)return 0;var o="width"===t?"height":"width",a=e[o];return null==a?i[t]:i[t]/i[o]*a},n.prototype.getWidth=function(){return this._getSize("width")},n.prototype.getHeight=function(){return this._getSize("height")},n.prototype.getAnimationStyleProps=function(){return Mu},n.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new ln(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},n}(vl);Cu.prototype.type="image";var Iu=Cu;var Au=Math.round;function Du(t,e,n){if(e){var r=e.x1,i=e.x2,o=e.y1,a=e.y2;t.x1=r,t.x2=i,t.y1=o,t.y2=a;var s=n&&n.lineWidth;return s?(Au(2*r)===Au(2*i)&&(t.x1=t.x2=Pu(r,s,!0)),Au(2*o)===Au(2*a)&&(t.y1=t.y2=Pu(o,s,!0)),t):t}}function Lu(t,e,n){if(e){var r=e.x,i=e.y,o=e.width,a=e.height;t.x=r,t.y=i,t.width=o,t.height=a;var s=n&&n.lineWidth;return s?(t.x=Pu(r,s,!0),t.y=Pu(i,s,!0),t.width=Math.max(Pu(r+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(Pu(i+a,s,!1)-t.y,0===a?0:1),t):t}}function Pu(t,e,n){if(!e)return t;var r=Au(2*t);return(r+Au(e))%2==0?r/2:(r+(n?1:-1))/2}var Eu=function(){this.x=0,this.y=0,this.width=0,this.height=0},Ou={},Nu=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultShape=function(){return new Eu},n.prototype.buildPath=function(t,e){var n,r,i,o;if(this.subPixelOptimize){var a=Lu(Ou,e,this.style);n=a.x,r=a.y,i=a.width,o=a.height,a.r=e.r,e=a}else n=e.x,r=e.y,i=e.width,o=e.height;e.r?function(t,e){var n,r,i,o,a,s=e.x,l=e.y,u=e.width,h=e.height,c=e.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?n=r=i=o=c:c instanceof Array?1===c.length?n=r=i=o=c[0]:2===c.length?(n=i=c[0],r=o=c[1]):3===c.length?(n=c[0],r=o=c[1],i=c[2]):(n=c[0],r=c[1],i=c[2],o=c[3]):n=r=i=o=0,n+r>u&&(n*=u/(a=n+r),r*=u/a),i+o>u&&(i*=u/(a=i+o),o*=u/a),r+i>h&&(r*=h/(a=r+i),i*=h/a),n+o>h&&(n*=h/(a=n+o),o*=h/a),t.moveTo(s+n,l),t.lineTo(s+u-r,l),0!==r&&t.arc(s+u-r,l+r,r,-Math.PI/2,0),t.lineTo(s+u,l+h-i),0!==i&&t.arc(s+u-i,l+h-i,i,0,Math.PI/2),t.lineTo(s+o,l+h),0!==o&&t.arc(s+o,l+h-o,o,Math.PI/2,Math.PI),t.lineTo(s,l+n),0!==n&&t.arc(s+n,l+n,n,Math.PI,1.5*Math.PI),t.closePath()}(t,e):t.rect(n,r,i,o)},n.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},n}(xu);Nu.prototype.type="rect";var Ru=Nu,ku={fill:"#000"},zu={},Bu={style:E({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},cl.style)},Vu=function(t){function n(e){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=ku,n.attr(e),n}return e(n,t),n.prototype.childrenRef=function(){return this._children},n.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e<this._children.length;e++){var n=this._children[e];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},n.prototype.updateTransform=function(){var e=this.innerTransformable;e?(e.updateTransform(),e.transform&&(this.transform=e.transform)):t.prototype.updateTransform.call(this)},n.prototype.getLocalTransform=function(e){var n=this.innerTransformable;return n?n.getLocalTransform(e):t.prototype.getLocalTransform.call(this,e)},n.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),t.prototype.getComputedTransform.call(this)},n.prototype._updateSubTexts=function(){var t;this._childCursor=0,ju(t=this.style),B(t.rich,ju),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},n.prototype.addSelfToZr=function(e){t.prototype.addSelfToZr.call(this,e);for(var n=0;n<this._children.length;n++)this._children[n].__zr=e},n.prototype.removeSelfFromZr=function(e){t.prototype.removeSelfFromZr.call(this,e);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},n.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var t=new ln(0,0,0,0),e=this._children,n=[],r=null,i=0;i<e.length;i++){var o=e[i],a=o.getBoundingRect(),s=o.getLocalTransform(n);s?(t.copy(a),t.applyTransform(s),(r=r||t.clone()).union(t)):(r=r||a.clone()).union(a)}this._rect=r||t}return this._rect},n.prototype.setDefaultTextStyle=function(t){this._defaultStyle=t||ku},n.prototype.setTextContent=function(t){throw new Error("Can't attach text on another text")},n.prototype._mergeStyle=function(t,e){if(!e)return t;var n=e.rich,r=t.rich||n&&{};return L(t,e),n&&r?(this._mergeRich(r,n),t.rich=r):r&&(t.rich=r),t},n.prototype._mergeRich=function(t,e){for(var n=U(e),r=0;r<n.length;r++){var i=n[r];t[i]=t[i]||{},L(t[i],e[i])}},n.prototype.getAnimationStyleProps=function(){return Bu},n.prototype._getOrCreateChild=function(t){var e=this._children[this._childCursor];return e&&e instanceof t||(e=new t),this._children[this._childCursor++]=e,e.__zr=this.__zr,e.parent=this,e},n.prototype._updatePlainTexts=function(){var t=this.style,e=t.font||a,n=t.padding,r=this._defaultStyle,i=t.x||0,o=t.y||0,s=t.align||r.align||"left",l=t.verticalAlign||r.verticalAlign||"top";rl(zu,r.overflowRect,i,o,s,l),i=zu.baseX,o=zu.baseY;var u=function(t,e,n,r){var i=al(t),o=e.overflow,a=e.padding,s=a?a[1]+a[3]:0,l=a?a[0]+a[2]:0,u=e.font,h="truncate"===o,c=uo(u),d=at(e.lineHeight,c),p="truncate"===e.lineOverflow,f=!1,g=e.width;null==g&&null!=n&&(g=n-s);var m,v=e.height;null==v&&null!=r&&(v=r-l);var y=(m=null==g||"break"!==o&&"breakAll"!==o?i?i.split("\n"):[]:i?nl(i,e.font,g,"breakAll"===o,0).lines:[]).length*d;if(null==v&&(v=y),y>v&&p){var _=Math.floor(v/d);f=f||m.length>_,y=(m=m.slice(0,_)).length*d}if(i&&h&&null!=g)for(var x=Zs(g,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),b={},w=0;w<m.length;w++)Ys(b,m[w],x),m[w]=b.textLine,f=f||b.isTruncated;var S=v,T=0,M=to(u);for(w=0;w<m.length;w++)T=Math.max(io(M,m[w]),T);null==g&&(g=T);var C=g;return{lines:m,height:v,outerWidth:C+=s,outerHeight:S+=l,lineHeight:d,calculatedLineHeight:c,contentWidth:T,contentHeight:y,width:g,isTruncated:f}}(Ku(t),t,zu.outerWidth,zu.outerHeight),h=Ju(t),c=!!t.backgroundColor,d=u.outerHeight,p=u.outerWidth,f=u.lines,g=u.lineHeight;this.isTruncated=!!u.isTruncated;var m=i,v=lo(o,u.contentHeight,l);if(h||n){var y=so(i,p,s),_=lo(o,d,l);h&&this._renderBackground(t,t,y,_,p,d)}v+=g/2,n&&(m=qu(i,s,n),"top"===l?v+=n[0]:"bottom"===l&&(v-=n[2]));for(var x=0,b=!1,w=!1,S=(Yu("fill"in t?t.fill:(w=!0,r.fill))),T=(Zu("stroke"in t?t.stroke:c||r.autoStroke&&!w?null:(x=2,b=!0,r.stroke))),M=t.textShadowBlur>0,C=0;C<f.length;C++){var I=this._getOrCreateChild(Su),A=I.createStyle();I.useStyle(A),A.text=f[C],A.x=m,A.y=v,s&&(A.textAlign=s),A.textBaseline="middle",A.opacity=t.opacity,A.strokeFirst=!0,M&&(A.shadowBlur=t.textShadowBlur||0,A.shadowColor=t.textShadowColor||"transparent",A.shadowOffsetX=t.textShadowOffsetX||0,A.shadowOffsetY=t.textShadowOffsetY||0),A.stroke=T,A.fill=S,T&&(A.lineWidth=t.lineWidth||x,A.lineDash=t.lineDash,A.lineDashOffset=t.lineDashOffset||0),A.font=e,Wu(A,t),v+=g,I.setBoundingRect(sl(A,u.contentWidth,u.calculatedLineHeight,b?0:null))}},n.prototype._updateRichTexts=function(){var t=this.style,e=this._defaultStyle,n=t.align||e.align,r=t.verticalAlign||e.verticalAlign,i=t.x||0,o=t.y||0;rl(zu,e.overflowRect,i,o,n,r),i=zu.baseX,o=zu.baseY;var a=function(t,e,n,r,i){var o=new Qs,a=al(t);if(!a)return o;var s=e.padding,l=s?s[1]+s[3]:0,u=s?s[0]+s[2]:0,h=e.width;null==h&&null!=n&&(h=n-l);var c=e.height;null==c&&null!=r&&(c=r-u);for(var d,p=e.overflow,f="break"!==p&&"breakAll"!==p||null==h?null:{width:h,accumWidth:0,breakAll:"breakAll"===p},g=Xs.lastIndex=0;null!=(d=Xs.exec(a));){var m=d.index;m>g&&$s(o,a.substring(g,m),e,f),$s(o,d[2],e,f,d[1]),g=Xs.lastIndex}g<a.length&&$s(o,a.substring(g,a.length),e,f);var v=[],y=0,_=0,x="truncate"===p,b="truncate"===e.lineOverflow,w={};function S(t,e,n){t.width=e,t.lineHeight=n,y+=n,_=Math.max(_,e)}t:for(var T=0;T<o.lines.length;T++){for(var M=o.lines[T],C=0,I=0,A=0;A<M.tokens.length;A++){var D=(F=M.tokens[A]).styleName&&e.rich[F.styleName]||{},L=F.textPadding=D.padding,P=L?L[1]+L[3]:0,E=F.font=D.font||e.font;F.contentHeight=uo(E);var O=at(D.height,F.contentHeight);if(F.innerHeight=O,L&&(O+=L[0]+L[2]),F.height=O,F.lineHeight=st(D.lineHeight,e.lineHeight,O),F.align=D&&D.align||i,F.verticalAlign=D&&D.verticalAlign||"middle",b&&null!=c&&y+F.lineHeight>c){var N=o.lines.length;A>0?(M.tokens=M.tokens.slice(0,A),S(M,I,C),o.lines=o.lines.slice(0,T+1)):o.lines=o.lines.slice(0,T),o.isTruncated=o.isTruncated||o.lines.length<N;break t}var R=D.width,k=null==R||"auto"===R;if("string"==typeof R&&"%"===R.charAt(R.length-1))F.percentWidth=R,v.push(F),F.contentWidth=io(to(E),F.text);else{if(k){var z=D.backgroundColor,B=z&&z.image;B&&Ws(B=Gs(B))&&(F.width=Math.max(F.width,B.width*O/B.height))}var V=x&&null!=h?h-I:null;null!=V&&V<F.width?!k||V<P?(F.text="",F.width=F.contentWidth=0):(js(w,F.text,V-P,E,e.ellipsis,{minChar:e.truncateMinChar}),F.text=w.text,o.isTruncated=o.isTruncated||w.isTruncated,F.width=F.contentWidth=io(to(E),F.text)):F.contentWidth=io(to(E),F.text)}F.width+=P,I+=F.width,D&&(C=Math.max(C,F.lineHeight))}S(M,I,C)}for(o.outerWidth=o.width=at(h,_),o.outerHeight=o.height=at(c,y),o.contentHeight=y,o.contentWidth=_,o.outerWidth+=l,o.outerHeight+=u,T=0;T<v.length;T++){var F,G=(F=v[T]).percentWidth;F.width=parseInt(G,10)/100*o.width}return o}(Ku(t),t,zu.outerWidth,zu.outerHeight,n),s=a.width,l=a.outerWidth,u=a.outerHeight,h=t.padding;this.isTruncated=!!a.isTruncated;var c=so(i,l,n),d=lo(o,u,r),p=c,f=d;h&&(p+=h[3],f+=h[0]);var g=p+s;Ju(t)&&this._renderBackground(t,t,c,d,l,u);for(var m=!!t.backgroundColor,v=0;v<a.lines.length;v++){for(var y=a.lines[v],_=y.tokens,x=_.length,b=y.lineHeight,w=y.width,S=0,T=p,M=g,C=x-1,I=void 0;S<x&&(!(I=_[S]).align||"left"===I.align);)this._placeToken(I,t,b,f,T,"left",m),w-=I.width,T+=I.width,S++;for(;C>=0&&"right"===(I=_[C]).align;)this._placeToken(I,t,b,f,M,"right",m),w-=I.width,M-=I.width,C--;for(T+=(s-(T-p)-(g-M)-w)/2;S<=C;)I=_[S],this._placeToken(I,t,b,f,T+I.width/2,"center",m),T+=I.width,S++;f+=b}},n.prototype._placeToken=function(t,e,n,r,i,o,s){var l=e.rich[t.styleName]||{};l.text=t.text;var u=t.verticalAlign,h=r+n/2;"top"===u?h=r+t.height/2:"bottom"===u&&(h=r+n-t.height/2),!t.isLineHolder&&Ju(l)&&this._renderBackground(l,e,"right"===o?i-t.width:"center"===o?i-t.width/2:i,h-t.height/2,t.width,t.height);var c=!!l.backgroundColor,d=t.textPadding;d&&(i=qu(i,o,d),h-=t.height/2-d[0]-t.innerHeight/2);var p=this._getOrCreateChild(Su),f=p.createStyle();p.useStyle(f);var g=this._defaultStyle,m=!1,v=0,y=!1,_=Yu("fill"in l?l.fill:"fill"in e?e.fill:(m=!0,g.fill)),x=Zu("stroke"in l?l.stroke:"stroke"in e?e.stroke:c||s||g.autoStroke&&!m?null:(v=2,y=!0,g.stroke)),b=l.textShadowBlur>0||e.textShadowBlur>0;f.text=t.text,f.x=i,f.y=h,b&&(f.shadowBlur=l.textShadowBlur||e.textShadowBlur||0,f.shadowColor=l.textShadowColor||e.textShadowColor||"transparent",f.shadowOffsetX=l.textShadowOffsetX||e.textShadowOffsetX||0,f.shadowOffsetY=l.textShadowOffsetY||e.textShadowOffsetY||0),f.textAlign=o,f.textBaseline="middle",f.font=t.font||a,f.opacity=st(l.opacity,e.opacity,1),Wu(f,l),x&&(f.lineWidth=st(l.lineWidth,e.lineWidth,v),f.lineDash=at(l.lineDash,e.lineDash),f.lineDashOffset=e.lineDashOffset||0,f.stroke=x),_&&(f.fill=_),p.setBoundingRect(sl(f,t.contentWidth,t.contentHeight,y?0:null))},n.prototype._renderBackground=function(t,e,n,r,i,o){var a,s,l,u=t.backgroundColor,h=t.borderWidth,c=t.borderColor,d=u&&u.image,p=u&&!d,f=t.borderRadius,g=this;if(p||t.lineHeight||h&&c){(a=this._getOrCreateChild(Ru)).useStyle(a.createStyle()),a.style.fill=null;var m=a.shape;m.x=n,m.y=r,m.width=i,m.height=o,m.r=f,a.dirtyShape()}if(p)(l=a.style).fill=u||null,l.fillOpacity=at(t.fillOpacity,1);else if(d){(s=this._getOrCreateChild(Iu)).onload=function(){g.dirtyStyle()};var v=s.style;v.image=u.image,v.x=n,v.y=r,v.width=i,v.height=o}h&&c&&((l=a.style).lineWidth=h,l.stroke=c,l.strokeOpacity=at(t.strokeOpacity,1),l.lineDash=t.borderDash,l.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(l.strokeFirst=!0,l.lineWidth*=2));var y=(a||s).style;y.shadowBlur=t.shadowBlur||0,y.shadowColor=t.shadowColor||"transparent",y.shadowOffsetX=t.shadowOffsetX||0,y.shadowOffsetY=t.shadowOffsetY||0,y.opacity=st(t.opacity,e.opacity,1)},n.makeFont=function(t){var e="";return Xu(t)&&(e=[t.fontStyle,t.fontWeight,Uu(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&ct(e)||t.textFont||t.font},n}(vl),Fu={left:!0,right:1,center:1},Gu={top:1,bottom:1,middle:1},Hu=["fontStyle","fontWeight","fontSize","fontFamily"];function Uu(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function Wu(t,e){for(var n=0;n<Hu.length;n++){var r=Hu[n],i=e[r];null!=i&&(t[r]=i)}}function Xu(t){return null!=t.fontSize||t.fontFamily||t.fontWeight}function ju(t){if(t){t.font=Vu.makeFont(t);var e=t.align;"middle"===e&&(e="center"),t.align=null==e||Fu[e]?e:"left";var n=t.verticalAlign;"center"===n&&(n="middle"),t.verticalAlign=null==n||Gu[n]?n:"top",t.padding&&(t.padding=ut(t.padding))}}function Zu(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function Yu(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function qu(t,e,n){return"right"===e?t-n[1]:"center"===e?t+n[3]/2-n[1]/2:t+n[3]}function Ku(t){var e=t.text;return null!=e&&(e+=""),e}function Ju(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var Qu=Vu,$u=Qa(),th=function(t,e,n,r){if(r){var i=$u(r);i.dataIndex=n,i.dataType=e,i.seriesIndex=t,i.ssrType="chart","group"===r.type&&r.traverse(function(r){var i=$u(r);i.seriesIndex=t,i.dataIndex=n,i.dataType=e,i.ssrType="chart"})}},eh="undefined",nh="series",rh=yt(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),ih="original",oh="arrayRows",ah="objectRows",sh="keyedColumns",lh="typedArray",uh="unknown",hh="column",ch="row",dh="Roam",ph=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"];function fh(t,e){return e.mainType===nh?t.getViewOfSeriesModel(e):t.getViewOfComponentModel(e)}var gh=function(t){B(ph,function(e){this[e]=W(t[e],t)},this)},mh=1,vh={},yh=Qa(),_h=Qa(),xh=["emphasis","blur","select"],bh=["normal","emphasis","blur","select"],wh=10,Sh="highlight",Th="downplay",Mh="select",Ch="unselect",Ih="toggleSelect",Ah="selectchanged";function Dh(t){return null!=t&&"none"!==t}function Lh(t,e,n){t.onHoverStateChange&&(t.hoverState||0)!==n&&t.onHoverStateChange(e),t.hoverState=n}function Ph(t){Lh(t,"emphasis",2)}function Eh(t){2===t.hoverState&&Lh(t,"normal",0)}function Oh(t){Lh(t,"blur",1)}function Nh(t){1===t.hoverState&&Lh(t,"normal",0)}function Rh(t){t.selected=!0}function kh(t){t.selected=!1}function zh(t,e,n){e(t,n)}function Bh(t,e,n){zh(t,e,n),t.isGroup&&t.traverse(function(t){zh(t,e,n)})}function Vh(t,e){switch(e){case"emphasis":t.hoverState=2;break;case"normal":t.hoverState=0;break;case"blur":t.hoverState=1;break;case"select":t.selected=!0}}function Fh(t,e){var n=this.states[t];if(this.style){if("emphasis"===t)return function(t,e,n,r){var i=n&&N(n,"select")>=0,o=!1;if(t instanceof xu){var a=yh(t),s=i&&a.selectFill||a.normalFill,l=i&&a.selectStroke||a.normalStroke;if(Dh(s)||Dh(l)){var u=(r=r||{}).style||{};"inherit"===u.fill?(o=!0,r=L({},r),(u=L({},u)).fill=s):!Dh(u.fill)&&Dh(s)?(o=!0,r=L({},r),(u=L({},u)).fill=Rr(s)):!Dh(u.stroke)&&Dh(l)&&(o||(r=L({},r),u=L({},u)),u.stroke=Rr(l)),r.style=u}}if(r&&null==r.z2){o||(r=L({},r));var h=t.z2EmphasisLift;r.z2=t.z2+(null!=h?h:wh)}return r}(this,0,e,n);if("blur"===t)return function(t,e,n){var r=N(t.currentStates,e)>=0,i=t.style.opacity,o=r?null:function(t,e,n,r){for(var i=t.style,o={},a=0;a<e.length;a++){var s=e[a],l=i[s];o[s]=null==l?r&&r[s]:l}for(a=0;a<t.animators.length;a++){var u=t.animators[a];u.__fromStateTransition&&u.__fromStateTransition.indexOf(n)<0&&"style"===u.targetName&&u.saveTo(o,e)}return o}(t,["opacity"],e,{opacity:1}),a=(n=n||{}).style||{};return null==a.opacity&&(n=L({},n),a=L({opacity:r?i:.1*o.opacity},a),n.style=a),n}(this,t,n);if("select"===t)return function(t,e,n){if(n&&null==n.z2){n=L({},n);var r=t.z2SelectLift;n.z2=t.z2+(null!=r?r:9)}return n}(this,0,n)}return n}function Gh(t){t.stateProxy=Fh;var e=t.getTextContent(),n=t.getTextGuideLine();e&&(e.stateProxy=Fh),n&&(n.stateProxy=Fh)}function Hh(t,e){!Kh(t,e)&&!t.__highByOuter&&Bh(t,Ph)}function Uh(t,e){!Kh(t,e)&&!t.__highByOuter&&Bh(t,Eh)}function Wh(t,e){t.__highByOuter|=1<<(e||0),Bh(t,Ph)}function Xh(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Bh(t,Eh)}function jh(t){Bh(t,Oh)}function Zh(t){Bh(t,Nh)}function Yh(t){Bh(t,Rh)}function qh(t){Bh(t,kh)}function Kh(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Jh(t){var e=t.getModel(),n=[],r=[];e.eachComponent(function(e,i){var o=_h(i),a=fh(t,i),s="series"===e;!s&&r.push(a),o.isBlured&&(a.group.traverse(function(t){Nh(t)}),s&&n.push(i)),o.isBlured=!1}),B(r,function(t){t&&t.toggleBlurSeries&&t.toggleBlurSeries(n,!1,e)})}function Qh(t,e,n,r){var i=r.getModel();function o(t,e){for(var n=0;n<e.length;n++){var r=t.getItemGraphicEl(e[n]);r&&Zh(r)}}if(n=n||"coordinateSystem",null!=t&&e&&"none"!==e){var a=i.getSeriesByIndex(t),s=a.coordinateSystem;s&&s.master&&(s=s.master);var l=[];i.eachSeries(function(t){var i=a===t,u=t.coordinateSystem;if(u&&u.master&&(u=u.master),!("series"===n&&!i||"coordinateSystem"===n&&!(u&&s?u===s:i)||"series"===e&&i)){if(r.getViewOfSeriesModel(t).group.traverse(function(t){t.__highByOuter&&i&&"self"===e||Oh(t)}),z(e))o(t.getData(),e);else if(J(e))for(var h=U(e),c=0;c<h.length;c++)o(t.getData(h[c]),e[h[c]]);l.push(t),_h(t).isBlured=!0}}),i.eachComponent(function(t,e){if("series"!==t){var n=r.getViewOfComponentModel(e);n&&n.toggleBlurSeries&&n.toggleBlurSeries(l,!0,i)}})}}function $h(t,e,n){if(null!=t&&null!=e){var r=n.getModel().getComponent(t,e);if(r){_h(r).isBlured=!0;var i=n.getViewOfComponentModel(r);i&&i.focusBlurEnabled&&i.group.traverse(function(t){Oh(t)})}}}function tc(t,e,n,r){var i={focusSelf:!1,dispatchers:null};if(null==t||"series"===t||null==e||null==n)return i;var o=r.getModel().getComponent(t,e);if(!o)return i;var a=r.getViewOfComponentModel(o);if(!a||!a.findHighDownDispatchers)return i;for(var s,l=a.findHighDownDispatchers(n),u=0;u<l.length;u++)if(hc(l[u])||La("param should be highDownDispatcher"),"self"===$u(l[u]).focus){s=!0;break}return{focusSelf:s,dispatchers:l}}function ec(t){B(t.getAllData(),function(e){var n=e.data,r=e.type;n.eachItemGraphicEl(function(e,n){t.isSelected(n,r)?Yh(e):qh(e)})})}function nc(t){var e=[];return t.eachSeries(function(t){B(t.getAllData(),function(n){n.data;var r=n.type,i=t.getSelectedDataIndices();if(i.length>0){var o={dataIndex:i,seriesIndex:t.seriesIndex};null!=r&&(o.dataType=r),e.push(o)}})}),e}function rc(t,e,n){uc(t,!0),Bh(t,Gh),oc(t,e,n)}function ic(t,e,n,r){r?function(t){uc(t,!1)}(t):rc(t,e,n)}function oc(t,e,n){var r=$u(t);null!=e?(r.focus=e,r.blurScope=n):r.focus&&(r.focus=null)}var ac=["emphasis","blur","select"],sc={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function lc(t,e,n,r){n=n||"itemStyle";for(var i=0;i<ac.length;i++){var o=ac[i],a=e.getModel([o,n]);t.ensureState(o).style=r?r(a):a[sc[n]]()}}function uc(t,e){var n=!1===e,r=t;t.highDownSilentOnTouch&&(r.__highDownSilentOnTouch=t.highDownSilentOnTouch),n&&!r.__highDownDispatcher||(r.__highByOuter=r.__highByOuter||0,r.__highDownDispatcher=!n)}function hc(t){return!(!t||!t.__highDownDispatcher)}function cc(t){var e=t.type;return e===Mh||e===Ch||e===Ih}function dc(t){var e=t.type;return e===Sh||e===Th}var pc=Ql.CMD,fc=[[],[],[]],gc=Math.sqrt,mc=Math.atan2;function vc(t,e){if(e){var n,r,i,o,a,s,l=t.data,u=t.len(),h=pc.M,c=pc.C,d=pc.L,p=pc.R,f=pc.A,g=pc.Q;for(i=0,o=0;i<u;){switch(n=l[i++],o=i,r=0,n){case h:case d:r=1;break;case c:r=3;break;case g:r=2;break;case f:var m=e[4],v=e[5],y=gc(e[0]*e[0]+e[1]*e[1]),_=gc(e[2]*e[2]+e[3]*e[3]),x=mc(-e[1]/_,e[0]/y);l[i]*=y,l[i++]+=m,l[i]*=_,l[i++]+=v,l[i++]*=y,l[i++]*=_,l[i++]+=x,l[i++]+=x,o=i+=2;break;case p:s[0]=l[i++],s[1]=l[i++],Xt(s,s,e),l[o++]=s[0],l[o++]=s[1],s[0]+=l[i++],s[1]+=l[i++],Xt(s,s,e),l[o++]=s[0],l[o++]=s[1]}for(a=0;a<r;a++){var b=fc[a];b[0]=l[i++],b[1]=l[i++],Xt(b,b,e),l[o++]=b[0],l[o++]=b[1]}}t.increaseVersion()}}var yc=Math.sqrt,_c=Math.sin,xc=Math.cos,bc=Math.PI;function wc(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Sc(t,e){return(t[0]*e[0]+t[1]*e[1])/(wc(t)*wc(e))}function Tc(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Sc(t,e))}function Mc(t,e,n,r,i,o,a,s,l,u,h){var c=l*(bc/180),d=xc(c)*(t-n)/2+_c(c)*(e-r)/2,p=-1*_c(c)*(t-n)/2+xc(c)*(e-r)/2,f=d*d/(a*a)+p*p/(s*s);f>1&&(a*=yc(f),s*=yc(f));var g=(i===o?-1:1)*yc((a*a*(s*s)-a*a*(p*p)-s*s*(d*d))/(a*a*(p*p)+s*s*(d*d)))||0,m=g*a*p/s,v=g*-s*d/a,y=(t+n)/2+xc(c)*m-_c(c)*v,_=(e+r)/2+_c(c)*m+xc(c)*v,x=Tc([1,0],[(d-m)/a,(p-v)/s]),b=[(d-m)/a,(p-v)/s],w=[(-1*d-m)/a,(-1*p-v)/s],S=Tc(b,w);if(Sc(b,w)<=-1&&(S=bc),Sc(b,w)>=1&&(S=0),S<0){var T=Math.round(S/bc*1e6)/1e6;S=2*bc+T%2*bc}h.addData(u,y,_,a,s,x,S,c,o)}var Cc=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Ic=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var Ac=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.applyTransform=function(t){},n}(xu);function Dc(t){return null!=t.setData}function Lc(t,e){var n=function(t){var e=new Ql;if(!t)return e;var n,r=0,i=0,o=r,a=i,s=Ql.CMD,l=t.match(Cc);if(!l)return e;for(var u=0;u<l.length;u++){for(var h=l[u],c=h.charAt(0),d=void 0,p=h.match(Ic)||[],f=p.length,g=0;g<f;g++)p[g]=parseFloat(p[g]);for(var m=0;m<f;){var v=void 0,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,T=r,M=i,C=void 0,I=void 0;switch(c){case"l":r+=p[m++],i+=p[m++],d=s.L,e.addData(d,r,i);break;case"L":r=p[m++],i=p[m++],d=s.L,e.addData(d,r,i);break;case"m":r+=p[m++],i+=p[m++],d=s.M,e.addData(d,r,i),o=r,a=i,c="l";break;case"M":r=p[m++],i=p[m++],d=s.M,e.addData(d,r,i),o=r,a=i,c="L";break;case"h":r+=p[m++],d=s.L,e.addData(d,r,i);break;case"H":r=p[m++],d=s.L,e.addData(d,r,i);break;case"v":i+=p[m++],d=s.L,e.addData(d,r,i);break;case"V":i=p[m++],d=s.L,e.addData(d,r,i);break;case"C":d=s.C,e.addData(d,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),r=p[m-2],i=p[m-1];break;case"c":d=s.C,e.addData(d,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i,p[m++]+r,p[m++]+i),r+=p[m-2],i+=p[m-1];break;case"S":v=r,y=i,C=e.len(),I=e.data,n===s.C&&(v+=r-I[C-4],y+=i-I[C-3]),d=s.C,T=p[m++],M=p[m++],r=p[m++],i=p[m++],e.addData(d,v,y,T,M,r,i);break;case"s":v=r,y=i,C=e.len(),I=e.data,n===s.C&&(v+=r-I[C-4],y+=i-I[C-3]),d=s.C,T=r+p[m++],M=i+p[m++],r+=p[m++],i+=p[m++],e.addData(d,v,y,T,M,r,i);break;case"Q":T=p[m++],M=p[m++],r=p[m++],i=p[m++],d=s.Q,e.addData(d,T,M,r,i);break;case"q":T=p[m++]+r,M=p[m++]+i,r+=p[m++],i+=p[m++],d=s.Q,e.addData(d,T,M,r,i);break;case"T":v=r,y=i,C=e.len(),I=e.data,n===s.Q&&(v+=r-I[C-4],y+=i-I[C-3]),r=p[m++],i=p[m++],d=s.Q,e.addData(d,v,y,r,i);break;case"t":v=r,y=i,C=e.len(),I=e.data,n===s.Q&&(v+=r-I[C-4],y+=i-I[C-3]),r+=p[m++],i+=p[m++],d=s.Q,e.addData(d,v,y,r,i);break;case"A":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],Mc(T=r,M=i,r=p[m++],i=p[m++],w,S,_,x,b,d=s.A,e);break;case"a":_=p[m++],x=p[m++],b=p[m++],w=p[m++],S=p[m++],Mc(T=r,M=i,r+=p[m++],i+=p[m++],w,S,_,x,b,d=s.A,e)}}"z"!==c&&"Z"!==c||(d=s.Z,e.addData(d),r=o,i=a),n=d}return e.toStatic(),e}(t),r=L({},e);return r.buildPath=function(t){var e,r=Dc(t);r&&t.canSave()?(t.appendPath(n),(e=t.getContext())&&t.rebuildPath(e,1)):(e=r?t.getContext():t)&&n.rebuildPath(e,1)},r.applyTransform=function(t){vc(n,t),this.dirtyShape()},r}function Pc(t,e){return new Ac(Lc(t,e))}function Ec(t,e){e=e||{};var n=new xu;return t.shape&&n.setShape(t.shape),n.setStyle(t.style),e.bakeTransform?vc(n.path,t.getComputedTransform()):e.toLocal?n.setLocalTransform(t.getComputedTransform()):n.copyTransform(t),n.buildPath=t.buildPath,n.applyTransform=n.applyTransform,n.z=t.z,n.z2=t.z2,n.zlevel=t.zlevel,n}var Oc=function(){this.cx=0,this.cy=0,this.r=0},Nc=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultShape=function(){return new Oc},n.prototype.buildPath=function(t,e){t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},n}(xu);Nc.prototype.type="circle";var Rc=Nc,kc=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},zc=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultShape=function(){return new kc},n.prototype.buildPath=function(t,e){var n=.5522848,r=e.cx,i=e.cy,o=e.rx,a=e.ry,s=o*n,l=a*n;t.moveTo(r-o,i),t.bezierCurveTo(r-o,i-l,r-s,i-a,r,i-a),t.bezierCurveTo(r+s,i-a,r+o,i-l,r+o,i),t.bezierCurveTo(r+o,i+l,r+s,i+a,r,i+a),t.bezierCurveTo(r-s,i+a,r-o,i+l,r-o,i),t.closePath()},n}(xu);zc.prototype.type="ellipse";var Bc=zc,Vc=Math.PI,Fc=2*Vc,Gc=Math.sin,Hc=Math.cos,Uc=Math.acos,Wc=Math.atan2,Xc=Math.abs,jc=Math.sqrt,Zc=Math.max,Yc=Math.min,qc=1e-4;function Kc(t,e,n,r,i,o,a){var s=t-n,l=e-r,u=(a?o:-o)/jc(s*s+l*l),h=u*l,c=-u*s,d=t+h,p=e+c,f=n+h,g=r+c,m=(d+f)/2,v=(p+g)/2,y=f-d,_=g-p,x=y*y+_*_,b=i-o,w=d*g-f*p,S=(_<0?-1:1)*jc(Zc(0,b*b*x-w*w)),T=(w*_-y*S)/x,M=(-w*y-_*S)/x,C=(w*_+y*S)/x,I=(-w*y+_*S)/x,A=T-m,D=M-v,L=C-m,P=I-v;return A*A+D*D>L*L+P*P&&(T=C,M=I),{cx:T,cy:M,x0:-h,y0:-c,x1:T*(i/b-1),y1:M*(i/b-1)}}function Jc(t,e){var n,r=Zc(e.r,0),i=Zc(e.r0||0,0),o=r>0;if(o||i>0){if(o||(r=i,i=0),i>r){var a=r;r=i,i=a}var s=e.startAngle,l=e.endAngle;if(!isNaN(s)&&!isNaN(l)){var u=e.cx,h=e.cy,c=!!e.clockwise,d=Xc(l-s),p=d>Fc&&d%Fc;if(p>qc&&(d=p),r>qc)if(d>Fc-qc)t.moveTo(u+r*Hc(s),h+r*Gc(s)),t.arc(u,h,r,s,l,!c),i>qc&&(t.moveTo(u+i*Hc(l),h+i*Gc(l)),t.arc(u,h,i,l,s,c));else{var f=void 0,g=void 0,m=void 0,v=void 0,y=void 0,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0,T=void 0,M=void 0,C=void 0,I=void 0,A=void 0,D=void 0,L=r*Hc(s),P=r*Gc(s),E=i*Hc(l),O=i*Gc(l),N=d>qc;if(N){var R=e.cornerRadius;R&&(n=function(t){var e;if(j(t)){var n=t.length;if(!n)return t;e=1===n?[t[0],t[0],0,0]:2===n?[t[0],t[0],t[1],t[1]]:3===n?t.concat(t[2]):t}else e=[t,t,t,t];return e}(R),f=n[0],g=n[1],m=n[2],v=n[3]);var k=Xc(r-i)/2;if(y=Yc(k,m),_=Yc(k,v),x=Yc(k,f),b=Yc(k,g),T=w=Zc(y,_),M=S=Zc(x,b),(w>qc||S>qc)&&(C=r*Hc(l),I=r*Gc(l),A=i*Hc(s),D=i*Gc(s),d<Vc)){var z=function(t,e,n,r,i,o,a,s){var l=n-t,u=r-e,h=a-i,c=s-o,d=c*l-h*u;if(!(d*d<qc))return[t+(d=(h*(e-o)-c*(t-i))/d)*l,e+d*u]}(L,P,A,D,C,I,E,O);if(z){var B=L-z[0],V=P-z[1],F=C-z[0],G=I-z[1],H=1/Gc(Uc((B*F+V*G)/(jc(B*B+V*V)*jc(F*F+G*G)))/2),U=jc(z[0]*z[0]+z[1]*z[1]);T=Yc(w,(r-U)/(H+1)),M=Yc(S,(i-U)/(H-1))}}}if(N)if(T>qc){var W=Yc(m,T),X=Yc(v,T),Z=Kc(A,D,L,P,r,W,c),Y=Kc(C,I,E,O,r,X,c);t.moveTo(u+Z.cx+Z.x0,h+Z.cy+Z.y0),T<w&&W===X?t.arc(u+Z.cx,h+Z.cy,T,Wc(Z.y0,Z.x0),Wc(Y.y0,Y.x0),!c):(W>0&&t.arc(u+Z.cx,h+Z.cy,W,Wc(Z.y0,Z.x0),Wc(Z.y1,Z.x1),!c),t.arc(u,h,r,Wc(Z.cy+Z.y1,Z.cx+Z.x1),Wc(Y.cy+Y.y1,Y.cx+Y.x1),!c),X>0&&t.arc(u+Y.cx,h+Y.cy,X,Wc(Y.y1,Y.x1),Wc(Y.y0,Y.x0),!c))}else t.moveTo(u+L,h+P),t.arc(u,h,r,s,l,!c);else t.moveTo(u+L,h+P);if(i>qc&&N)if(M>qc){W=Yc(f,M),Z=Kc(E,O,C,I,i,-(X=Yc(g,M)),c),Y=Kc(L,P,A,D,i,-W,c);t.lineTo(u+Z.cx+Z.x0,h+Z.cy+Z.y0),M<S&&W===X?t.arc(u+Z.cx,h+Z.cy,M,Wc(Z.y0,Z.x0),Wc(Y.y0,Y.x0),!c):(X>0&&t.arc(u+Z.cx,h+Z.cy,X,Wc(Z.y0,Z.x0),Wc(Z.y1,Z.x1),!c),t.arc(u,h,i,Wc(Z.cy+Z.y1,Z.cx+Z.x1),Wc(Y.cy+Y.y1,Y.cx+Y.x1),c),W>0&&t.arc(u+Y.cx,h+Y.cy,W,Wc(Y.y1,Y.x1),Wc(Y.y0,Y.x0),!c))}else t.lineTo(u+E,h+O),t.arc(u,h,i,l,s,c);else t.lineTo(u+E,h+O)}else t.moveTo(u,h);t.closePath()}}}var Qc=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0},$c=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultShape=function(){return new Qc},n.prototype.buildPath=function(t,e){Jc(t,e)},n.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},n}(xu);$c.prototype.type="sector";var td=$c,ed=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},nd=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultShape=function(){return new ed},n.prototype.buildPath=function(t,e){var n=e.cx,r=e.cy,i=2*Math.PI;t.moveTo(n+e.r,r),t.arc(n,r,e.r,0,i,!1),t.moveTo(n+e.r0,r),t.arc(n,r,e.r0,0,i,!0)},n}(xu);nd.prototype.type="ring";var rd=nd;function id(t,e,n){var r=e.smooth,i=e.points;if(i&&i.length>=2){if(r){var o=function(t,e,n,r){var i,o,a,s,l=[],u=[],h=[],c=[];if(r){a=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=t.length;d<p;d++)jt(a,a,t[d]),Zt(s,s,t[d]);jt(a,a,r[0]),Zt(s,s,r[1])}for(d=0,p=t.length;d<p;d++){var f=t[d];if(n)i=t[d?d-1:p-1],o=t[(d+1)%p];else{if(0===d||d===p-1){l.push(Dt(t[d]));continue}i=t[d-1],o=t[d+1]}Ot(u,o,i),Bt(u,u,e);var g=Ft(f,i),m=Ft(f,o),v=g+m;0!==v&&(g/=v,m/=v),Bt(h,u,-g),Bt(c,u,m);var y=Pt([],f,h),_=Pt([],f,c);r&&(Zt(y,y,a),jt(y,y,s),Zt(_,_,a),jt(_,_,s)),l.push(y),l.push(_)}return n&&l.push(l.shift()),l}(i,r,n,e.smoothConstraint);t.moveTo(i[0][0],i[0][1]);for(var a=i.length,s=0;s<(n?a:a-1);s++){var l=o[2*s],u=o[2*s+1],h=i[(s+1)%a];t.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{t.moveTo(i[0][0],i[0][1]);s=1;for(var c=i.length;s<c;s++)t.lineTo(i[s][0],i[s][1])}n&&t.closePath()}}var od=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},ad=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultShape=function(){return new od},n.prototype.buildPath=function(t,e){id(t,e,!0)},n}(xu);ad.prototype.type="polygon";var sd=ad,ld=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},ud=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},n.prototype.getDefaultShape=function(){return new ld},n.prototype.buildPath=function(t,e){id(t,e,!1)},n}(xu);ud.prototype.type="polyline";var hd=ud,cd={},dd=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},pd=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},n.prototype.getDefaultShape=function(){return new dd},n.prototype.buildPath=function(t,e){var n,r,i,o;if(this.subPixelOptimize){var a=Du(cd,e,this.style);n=a.x1,r=a.y1,i=a.x2,o=a.y2}else n=e.x1,r=e.y1,i=e.x2,o=e.y2;var s=e.percent;0!==s&&(t.moveTo(n,r),s<1&&(i=n*(1-s)+i*s,o=r*(1-s)+o*s),t.lineTo(i,o))},n.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},n}(xu);pd.prototype.type="line";var fd=pd,gd=[],md=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function vd(t,e,n){var r=t.cpx2,i=t.cpy2;return null!=r||null!=i?[(n?jn:Xn)(t.x1,t.cpx1,t.cpx2,t.x2,e),(n?jn:Xn)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(n?$n:Qn)(t.x1,t.cpx1,t.x2,e),(n?$n:Qn)(t.y1,t.cpy1,t.y2,e)]}var yd=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},n.prototype.getDefaultShape=function(){return new md},n.prototype.buildPath=function(t,e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.cpx1,s=e.cpy1,l=e.cpx2,u=e.cpy2,h=e.percent;0!==h&&(t.moveTo(n,r),null==l||null==u?(h<1&&(er(n,a,i,h,gd),a=gd[1],i=gd[2],er(r,s,o,h,gd),s=gd[1],o=gd[2]),t.quadraticCurveTo(a,s,i,o)):(h<1&&(qn(n,a,l,i,h,gd),a=gd[1],l=gd[2],i=gd[3],qn(r,s,u,o,h,gd),s=gd[1],u=gd[2],o=gd[3]),t.bezierCurveTo(a,s,l,u,i,o)))},n.prototype.pointAt=function(t){return vd(this.shape,t,!1)},n.prototype.tangentAt=function(t){var e=vd(this.shape,t,!0);return Vt(e,e)},n}(xu);yd.prototype.type="bezier-curve";var _d=yd,xd=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},bd=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},n.prototype.getDefaultShape=function(){return new xd},n.prototype.buildPath=function(t,e){var n=e.cx,r=e.cy,i=Math.max(e.r,0),o=e.startAngle,a=e.endAngle,s=e.clockwise,l=Math.cos(o),u=Math.sin(o);t.moveTo(l*i+n,u*i+r),t.arc(n,r,i,o,a,!s)},n}(xu);bd.prototype.type="arc";var wd=bd,Sd=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="compound",e}return e(n,t),n.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),n=0;n<t.length;n++)e=e||t[n].shapeChanged();e&&this.dirtyShape()},n.prototype.beforeBrush=function(){this._updatePathDirty();for(var t=this.shape.paths||[],e=this.getGlobalScale(),n=0;n<t.length;n++)t[n].path||t[n].createPathProxy(),t[n].path.setScale(e[0],e[1],t[n].segmentIgnoreThreshold)},n.prototype.buildPath=function(t,e){for(var n=e.paths||[],r=0;r<n.length;r++)n[r].buildPath(t,n[r].shape,!0)},n.prototype.afterBrush=function(){for(var t=this.shape.paths||[],e=0;e<t.length;e++)t[e].pathUpdated()},n.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),xu.prototype.getBoundingRect.call(this)},n}(xu),Td=Sd,Md=function(){function t(t){this.colorStops=t||[]}return t.prototype.addColorStop=function(t,e){this.colorStops.push({offset:t,color:e})},t}(),Cd=Md,Id=function(t){function n(e,n,r,i,o,a){var s=t.call(this,o)||this;return s.x=null==e?0:e,s.y=null==n?0:n,s.x2=null==r?1:r,s.y2=null==i?0:i,s.type="linear",s.global=a||!1,s}return e(n,t),n}(Cd),Ad=function(t){function n(e,n,r,i,o){var a=t.call(this,i)||this;return a.x=null==e?.5:e,a.y=null==n?.5:n,a.r=null==r?.5:r,a.type="radial",a.global=o||!1,a}return e(n,t),n}(Cd),Dd=Math.min,Ld=Math.max,Pd=Math.abs,Ed=[0,0],Od=[0,0],Nd=sn(),Rd=Nd.minTv,kd=Nd.maxTv,zd=function(){function t(t,e){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new Re;for(n=0;n<2;n++)this._axes[n]=new Re;t&&this.fromBoundingRect(t,e)}return t.prototype.fromBoundingRect=function(t,e){var n=this._corners,r=this._axes,i=t.x,o=t.y,a=i+t.width,s=o+t.height;if(n[0].set(i,o),n[1].set(a,o),n[2].set(a,s),n[3].set(i,s),e)for(var l=0;l<4;l++)n[l].transform(e);Re.sub(r[0],n[1],n[0]),Re.sub(r[1],n[3],n[0]),r[0].normalize(),r[1].normalize();for(l=0;l<2;l++)this._origin[l]=r[l].dot(n[0])},t.prototype.intersect=function(t,e,n){var r=!0,i=!e;return e&&Re.set(e,0,0),Nd.reset(n,!i),!this._intersectCheckOneSide(this,t,i,1)&&(r=!1,i)||!this._intersectCheckOneSide(t,this,i,-1)&&(r=!1,i)||i||Nd.negativeSize||Re.copy(e,r?Nd.useDir?Nd.dirMinTv:Rd:kd),r},t.prototype._intersectCheckOneSide=function(t,e,n,r){for(var i=!0,o=0;o<2;o++){var a=t._axes[o];if(t._getProjMinMaxOnAxis(o,t._corners,Ed),t._getProjMinMaxOnAxis(o,e._corners,Od),Nd.negativeSize||Ed[1]<Od[0]||Ed[0]>Od[1]){if(i=!1,Nd.negativeSize||n)return i;var s=Pd(Od[0]-Ed[1]),l=Pd(Ed[0]-Od[1]);Dd(s,l)>kd.len()&&(s<l?Re.scale(kd,a,-s*r):Re.scale(kd,a,l*r))}else if(!n){s=Pd(Od[0]-Ed[1]),l=Pd(Ed[0]-Od[1]);(Nd.useDir||Dd(s,l)<Rd.len())&&((s<l||!Nd.bidirectional)&&(Re.scale(Rd,a,s*r),Nd.useDir&&Nd.calcDirMTV()),(s>=l||!Nd.bidirectional)&&(Re.scale(Rd,a,-l*r),Nd.useDir&&Nd.calcDirMTV()))}}return i},t.prototype._getProjMinMaxOnAxis=function(t,e,n){for(var r=this._axes[t],i=this._origin,o=e[0].dot(r)+i[t],a=o,s=o,l=1;l<e.length;l++){var u=e[l].dot(r)+i[t];a=Dd(u,a),s=Ld(u,s)}n[0]=a+Nd.touchThreshold,n[1]=s-Nd.touchThreshold,Nd.negativeSize=n[1]<n[0]},t}(),Bd=zd,Vd=[],Fd=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.notClear=!0,e.incremental=1,e._displayables=[],e._temporaryDisplayables=[],e._cursor=0,e}return e(n,t),n.prototype.traverse=function(t,e){t.call(e,this)},n.prototype.useStyle=function(){this.style={}},n.prototype._useHoverStyle=function(){this.__hoverStyle=null},n.prototype.getCursor=function(){return this._cursor},n.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},n.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},n.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},n.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.markRedraw()},n.prototype.addDisplayables=function(t,e){e=e||!1;for(var n=0;n<t.length;n++)this.addDisplayable(t[n],e)},n.prototype.getDisplayables=function(){return this._displayables},n.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},n.prototype.eachPendingDisplayable=function(t){for(var e=this._cursor;e<this._displayables.length;e++)t&&t(this._displayables[e]);for(e=0;e<this._temporaryDisplayables.length;e++)t&&t(this._temporaryDisplayables[e])},n.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++){(e=this._displayables[t]).parent=this,e.update(),e.parent=null}for(t=0;t<this._temporaryDisplayables.length;t++){var e;(e=this._temporaryDisplayables[t]).parent=this,e.update(),e.parent=null}},n.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new ln(1/0,1/0,-1/0,-1/0),e=0;e<this._displayables.length;e++){var n=this._displayables[e],r=n.getBoundingRect().clone();n.needLocalTransform()&&r.applyTransform(n.getLocalTransform(Vd)),t.union(r)}this._rect=t}return this._rect},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e);if(this.getBoundingRect().contain(n[0],n[1]))for(var r=0;r<this._displayables.length;r++){if(this._displayables[r].contain(t,e))return!0}return!1},n}(vl),Gd=Fd,Hd=Qa();function Ud(t,e,n,r,i){var o;if(e&&e.ecModel){var a=e.ecModel.getUpdatePayload();o=a&&a.animation}var s="update"===t;if(e&&e.isAnimationEnabled()){var l=void 0,u=void 0,h=void 0;return r?(l=at(r.duration,200),u=at(r.easing,"cubicOut"),h=0):(l=e.getShallow(s?"animationDurationUpdate":"animationDuration"),u=e.getShallow(s?"animationEasingUpdate":"animationEasing"),h=e.getShallow(s?"animationDelayUpdate":"animationDelay")),o&&(null!=o.duration&&(l=o.duration),null!=o.easing&&(u=o.easing),null!=o.delay&&(h=o.delay)),Z(h)&&(h=h(n,i)),Z(l)&&(l=l(n)),{duration:l||0,delay:h,easing:u}}return null}function Wd(t,e,n,r,i,o,a){var s,l=!1;Z(i)?(a=o,o=i,i=null):J(i)&&(o=i.cb,a=i.during,l=i.isFrom,s=i.removeOpt,i=i.dataIndex);var u="leave"===t;u||e.stopAnimation("leave");var h=Ud(t,r,i,u?s||{}:null,r&&r.getAnimationDelayParams?r.getAnimationDelayParams(e,i):null);if(h&&h.duration>0){var c={duration:h.duration,delay:h.delay||0,easing:h.easing,done:o,force:!!o||!!a,setToFinal:!u,scope:t,during:a};l?e.animateFrom(n,c):e.animateTo(n,c)}else e.stopAnimation(),!l&&e.attr(n),a&&a(1),o&&o()}function Xd(t,e,n,r,i,o){Wd("update",t,e,n,r,i,o)}function jd(t,e,n,r,i,o){Wd("enter",t,e,n,r,i,o)}function Zd(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){if("leave"===t.animators[e].scope)return!0}return!1}function Yd(t,e,n,r,i,o){Zd(t)||Wd("leave",t,e,n,r,i,o)}function qd(t,e,n,r){t.removeTextContent(),t.removeTextGuideLine(),Yd(t,{style:{opacity:0}},e,n,r)}function Kd(t,e,n){function r(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse(function(t){t.isGroup||qd(t,e,n,r)}):qd(t,e,n,r)}function Jd(t){Hd(t).oldStyle=t.style}var Qd={},$d=["x","y"],tp=["width","height"];function ep(t){return xu.extend(t)}var np=function(t,n){var r=Lc(t,n);return function(t){function n(e){var n=t.call(this,e)||this;return n.applyTransform=r.applyTransform,n.buildPath=r.buildPath,n}return e(n,t),n}(Ac)};function rp(t,e){return np(t,e)}function ip(t,e){Qd[t]=e}function op(t){if(Qd.hasOwnProperty(t))return Qd[t]}function ap(t,e,n,r){var i=Pc(t,e);return n&&("center"===r&&(n=lp(n,i.getBoundingRect())),hp(i,n)),i}function sp(t,e,n){var r=new Iu({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===n){var i={width:t.width,height:t.height};r.setStyle(lp(e,i))}}});return r}function lp(t,e){var n,r=e.width/e.height,i=t.height*r;return n=i<=t.width?t.height:(i=t.width)/r,{x:t.x+t.width/2-i/2,y:t.y+t.height/2-n/2,width:i,height:n}}var up=function(t,e){for(var n=[],r=t.length,i=0;i<r;i++){var o=t[i];n.push(o.getUpdatedPathProxy(!0))}var a=new xu(e);return a.createPathProxy(),a.buildPath=function(t){if(Dc(t)){t.appendPath(n);var e=t.getContext();e&&t.rebuildPath(e,1)}},a};function hp(t,e){if(t.applyTransform){var n=t.getBoundingRect().calculateTransform(e);t.applyTransform(n)}}function cp(t,e){return Du(t,t,{lineWidth:e}),t}var dp=Pu;function pp(t,e){for(var n=Me([]);t&&t!==e;)Ie(n,t.getLocalTransform(),n),t=t.parent;return n}function fp(t,e,n){return e&&!z(e)&&(e=$i.getLocalTransform(e)),n&&(e=Pe([],e)),Xt([],t,e)}function gp(t,e,n){var r=0===e[4]||0===e[5]||0===e[0]?1:Ho(2*e[4]/e[0]),i=0===e[4]||0===e[5]||0===e[2]?1:Ho(2*e[4]/e[2]),o=["left"===t?-r:"right"===t?r:0,"top"===t?-i:"bottom"===t?i:0];return o=fp(o,e,n),Ho(o[0])>Ho(o[1])?o[0]>0?"right":"left":o[1]>0?"bottom":"top"}function mp(t){return!t.isGroup}function vp(t,e,n){if(t&&e){var r=function(t){var e={};return t.traverse(function(t){mp(t)&&t.anid&&(e[t.anid]=t)}),e}(t);e.traverse(function(t){if(mp(t)&&t.anid){var e=r[t.anid];if(e){var o=i(t);t.attr(i(e)),Xd(t,o,n,$u(t).dataIndex)}}})}function i(t){var e={x:t.x,y:t.y,rotation:t.rotation};return function(t){return null!=t.shape}(t)&&(e.shape=I(t.shape)),e}}function yp(t,e){return V(t,function(t){var n=t[0];n=Go(n,e.x),n=Fo(n,e.x+e.width);var r=t[1];return r=Go(r,e.y),[n,r=Fo(r,e.y+e.height)]})}function _p(t,e){var n=Go(t.x,e.x),r=Fo(t.x+t.width,e.x+e.width),i=Go(t.y,e.y),o=Fo(t.y+t.height,e.y+e.height);if(r>=n&&o>=i)return{x:n,y:i,width:r-n,height:o-i}}function xp(t,e,n){var r=L({rectHover:!0},e),i=r.style={strokeNoScale:!0};if(n=n||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(i.image=t.slice(8),E(i,n),new Iu(r)):ap(t.replace("path://",""),r,n,"center")}function bp(t,e,n,r,i){for(var o=0,a=i[i.length-1];o<i.length;o++){var s=i[o];if(wp(t,e,n,r,s[0],s[1],a[0],a[1]))return!0;a=s}}function wp(t,e,n,r,i,o,a,s){var l,u=n-t,h=r-e,c=a-i,d=s-o,p=Sp(c,d,u,h);if((l=p)<=1e-6&&l>=-1e-6)return!1;var f=t-i,g=e-o,m=Sp(f,g,u,h)/p;if(m<0||m>1)return!1;var v=Sp(f,g,c,d)/p;return!(v<0||v>1)}function Sp(t,e,n,r){return t*r-n*e}function Tp(t,e,n,r,i){return null==e||(K(e)?Mp[0]=Mp[1]=Mp[2]=Mp[3]=e:(ht(4===e.length),Mp[0]=e[0],Mp[1]=e[1],Mp[2]=e[2],Mp[3]=e[3]),r&&(Mp[0]=Go(0,Mp[0]),Mp[1]=Go(0,Mp[1]),Mp[2]=Go(0,Mp[2]),Mp[3]=Go(0,Mp[3])),n&&(Mp[0]=-Mp[0],Mp[1]=-Mp[1],Mp[2]=-Mp[2],Mp[3]=-Mp[3]),Cp(t,Mp,"x","width",3,1,i&&i[0]||0),Cp(t,Mp,"y","height",0,2,i&&i[1]||0)),t}var Mp=[0,0,0,0];function Cp(t,e,n,r,i,o,a){var s=e[o]+e[i],l=t[r];t[r]+=s,a=Go(0,Fo(a,l)),t[r]<a?(t[r]=a,t[n]+=e[i]>=0?-e[i]:e[o]>=0?l+e[o]:Ho(s)>1e-8?(l-a)*e[i]/s:0):t[n]-=e[i]}function Ip(t){var e=t.itemTooltipOption,n=t.componentModel,r=t.itemName,i=Y(e)?{formatter:e}:e,o=n.mainType,a=n.componentIndex,s={componentType:o,name:r,$vars:["name"]};s[o+"Index"]=a;var l=t.formatterParamsExtra;l&&B(U(l),function(t){wt(s,t)||(s[t]=l[t],s.$vars.push(t))});var u=$u(t.el);u.componentMainType=o,u.componentIndex=a,u.tooltipConfig={name:r,option:E({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function Ap(t,e){var n;t.isGroup&&(n=e(t)),n||t.traverse(e)}function Dp(t,e){if(t)if(j(t))for(var n=0;n<t.length;n++)Ap(t[n],e);else Ap(t,e)}function Lp(t){return!t||Ho(t[1])<Pp&&Ho(t[2])<Pp||Ho(t[0])<Pp&&Ho(t[3])<Pp}var Pp=1e-5;function Ep(t,e){return t?ln.copy(t,e):e.clone()}function Op(t,e){return e?Ce(t||[1,0,0,1,0,0],e):void 0}function Np(t){return{z:t.get("z")||0,zlevel:t.get("zlevel")||0}}function Rp(t){var e=-1/0,n=1/0;function r(t){if(t&&!t.isGroup){var e=t.currentStates;if(e.length)for(var n=0;n<e.length;n++)i(t.states[e[n]]);i(t)}}function i(t){if(t){var r=t.z2;r>e&&(e=r),r<n&&(n=r)}}return Ap(t,function(t){r(t),r(t.getTextContent()),r(t.getTextGuideLine())}),n>e&&(n=e=0),{min:n,max:e}}function kp(t,e,n){zp(t,e,n,-1/0)}function zp(t,e,n,r){if(t.ignoreModelZ)return r;var i=t.getTextContent(),o=t.getTextGuideLine();if(t.isGroup)for(var a=t.childrenRef(),s=0;s<a.length;s++)r=Go(zp(a[s],e,n,r),r);else t.z=e,t.zlevel=n,r=Go(t.z2||0,r);if(i&&(i.z=e,i.zlevel=n,isFinite(r)&&(i.z2=r+2)),o){var l=t.textGuideLineConfig;o.z=e,o.zlevel=n,isFinite(r)&&(o.z2=r+(l&&l.showAbove?1:-1))}return r}function Bp(t){return t.animation={duration:0},t}function Vp(t,e){return e?Ce(Fp.transform,e):Me(Fp.transform),Fp.decomposeTransform(),Ji(t,Fp),t}var Fp=new $i;function Gp(t){var e=t.getZr().painter;return"canvas"===e.getType()?e:null}Fp.transform=[1,0,0,1,0,0],ip("circle",Rc),ip("ellipse",Bc),ip("sector",td),ip("ring",rd),ip("polygon",sd),ip("polyline",hd),ip("rect",Ru),ip("line",fd),ip("bezierCurve",_d),ip("arc",wd);var Hp=Object.freeze({__proto__:null,Arc:wd,BezierCurve:_d,BoundingRect:ln,Circle:Rc,CompoundPath:Td,Ellipse:Bc,Group:Do,HOVER_LAYER_FOR_INCREMENTAL:2,HOVER_LAYER_FROM_THRESHOLD:1,HOVER_LAYER_NO:0,Image:Iu,IncrementalDisplayable:Gd,Line:fd,LinearGradient:Id,OrientedBoundingRect:Bd,Path:xu,Point:Re,Polygon:sd,Polyline:hd,RadialGradient:Ad,Rect:Ru,Ring:rd,Sector:td,Text:Qu,WH:tp,XY:$d,applyTransform:fp,calcZ2Range:Rp,clipPointsByRect:yp,clipRectByRect:_p,createIcon:xp,decomposeTransform:Vp,ensureCopyRect:Ep,ensureCopyTransform:Op,expandOrShrinkRect:Tp,extendPath:rp,extendShape:ep,getCurrentCanvasPainter:Gp,getShapeClass:op,getTransform:pp,groupTransition:vp,initProps:jd,isBoundingRectAxisAligned:Lp,isElementRemoved:Zd,lineLineIntersect:wp,linePolygonIntersect:bp,makeImage:sp,makePath:ap,mergePath:up,payloadDisableAnimation:Bp,registerShape:ip,removeElement:Yd,removeElementWithFadeOut:Kd,resizePath:hp,retrieveZInfo:Np,setTooltipConfig:Ip,subPixelOptimize:dp,subPixelOptimizeLine:cp,subPixelOptimizeRect:function(t,e){return Lu(t,t,e),t},transformDirection:gp,traverseElements:Dp,traverseUpdateZ:kp,updateProps:Xd}),Up={};function Wp(t,e){for(var n=0;n<xh.length;n++){var r=xh[n],i=e[r],o=t.ensureState(r);o.style=o.style||{},o.style.text=i}var a=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(a,!0)}function Xp(t,e,n){var r,i=t.labelFetcher,o=t.labelDataIndex,a=t.labelDimIndex,s=e.normal;i&&(r=i.getFormattedLabel(o,"normal",null,a,s&&s.get("formatter"),null!=n?{interpolatedValue:n}:null)),null==r&&(r=Z(t.defaultText)?t.defaultText(o,t,n):t.defaultText);for(var l={normal:r},u=0;u<xh.length;u++){var h=xh[u],c=e[h];l[h]=at(i?i.getFormattedLabel(o,h,null,a,c&&c.get("formatter")):null,r)}return l}function jp(t,e,n,r){n=n||Up;for(var i=t instanceof Qu,o=!1,a=0;a<bh.length;a++){if((d=e[bh[a]])&&d.getShallow("show")){o=!0;break}}var s=i?t:t.getTextContent();if(o){i||(s||(s=new Qu,t.setTextContent(s)),t.stateProxy&&(s.stateProxy=t.stateProxy));var l=Xp(n,e),u=e.normal,h=!!u.getShallow("show"),c=Yp(u,r&&r.normal,n,!1,!i);c.text=l.normal,i||t.setTextConfig(qp(u,n,!1));for(a=0;a<xh.length;a++){var d,p=xh[a];if(d=e[p]){var f=s.ensureState(p),g=!!at(d.getShallow("show"),h);if(g!==h&&(f.ignore=!g),f.style=Yp(d,r&&r[p],n,!0,!i),f.style.text=l[p],!i)t.ensureState(p).textConfig=qp(d,n,!0)}}s.silent=!!u.getShallow("silent"),null!=s.style.x&&(c.x=s.style.x),null!=s.style.y&&(c.y=s.style.y),s.ignore=!h,s.useStyle(c),s.dirty(),n.enableTextSetter&&(ef(s).setLabelText=function(t){var r=Xp(n,e,t);Wp(s,r)})}else s&&(s.ignore=!0);t.dirty()}function Zp(t,e){e=e||"label";for(var n={normal:t.getModel(e)},r=0;r<xh.length;r++){var i=xh[r];n[i]=t.getModel([i,e])}return n}function Yp(t,e,n,r,i){var o={};return function(t,e,n,r,i){n=n||Up;var o,a=e.ecModel,s=a&&a.option.textStyle,l=function(t){var e;for(;t&&t!==t.ecModel;){var n=(t.option||Up).rich;if(n){e=e||{};for(var r=U(n),i=0;i<r.length;i++){e[r[i]]=1}}t=t.parentModel}return e}(e);if(l){o={};var u="richInheritPlainLabel",h=at(e.get(u),a?a.get(u):void 0);for(var c in l)if(l.hasOwnProperty(c)){var d=e.getModel(["rich",c]);$p(o[c]={},d,s,e,h,n,r,i,!1,!0)}}o&&(t.rich=o);var p=e.get("overflow");p&&(t.overflow=p);var f=e.get("lineOverflow");f&&(t.lineOverflow=f);var g=t,m=e.get("minMargin");if(null!=m)m=K(m)?m/2:0,g.margin=[m,m,m,m],g.__marginType=sf.minMargin;else{var v=e.get("textMargin");null!=v&&(g.margin=ut(v),g.__marginType=sf.textMargin)}$p(t,e,s,null,null,n,r,i,!0,!1)}(o,t,n,r,i),e&&L(o,e),o}function qp(t,e,n){e=e||{};var r,i={},o=t.getShallow("rotate"),a=at(t.getShallow("distance"),n?null:5),s=t.getShallow("offset");return"outside"===(r=t.getShallow("position")||(n?null:"inside"))&&(r=e.defaultOutsidePosition||"top"),null!=r&&(i.position=r),null!=s&&(i.offset=s),null!=o&&(o*=Math.PI/180,i.rotation=o),null!=a&&(i.distance=a),i.outsideFill="inherit"===t.get("color")?e.inheritColor||null:"auto",null!=e.autoOverflowArea&&(i.autoOverflowArea=e.autoOverflowArea),null!=e.layoutRect&&(i.layoutRect=e.layoutRect),i}var Kp=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],Jp=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],Qp=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function $p(t,e,n,r,i,o,a,s,l,u){n=!a&&n||Up;var h=o&&o.inheritColor,c=e.getShallow("color"),d=e.getShallow("textBorderColor"),p=at(e.getShallow("opacity"),n.opacity);"inherit"!==c&&"auto"!==c||("auto"===c&&Ea("color: 'auto'","color: 'inherit'"),c=h||null),"inherit"!==d&&"auto"!==d||("auto"===d&&Ea("color: 'auto'","color: 'inherit'"),d=h||null),s||(c=c||n.color,d=d||n.textBorderColor),null!=c&&(t.fill=c),null!=d&&(t.stroke=d);var f=at(e.getShallow("textBorderWidth"),n.textBorderWidth);null!=f&&(t.lineWidth=f);var g=at(e.getShallow("textBorderType"),n.textBorderType);null!=g&&(t.lineDash=g);var m=at(e.getShallow("textBorderDashOffset"),n.textBorderDashOffset);null!=m&&(t.lineDashOffset=m),a||null!=p||u||(p=o&&o.defaultOpacity),null!=p&&(t.opacity=p),a||s||null==t.fill&&o.inheritColor&&(t.fill=o.inheritColor);for(var v=0;v<Kp.length;v++){var y=Kp[v];null!=(x=!1!==i&&r?st(e.getShallow(y),r.getShallow(y),n[y]):at(e.getShallow(y),n[y]))&&(t[y]=x)}for(v=0;v<Jp.length;v++){y=Jp[v];null!=(x=e.getShallow(y))&&(t[y]=x)}if(null==t.verticalAlign){var _=e.getShallow("baseline");null!=_&&(t.verticalAlign=_)}if(!l||!o.disableBox){for(v=0;v<Qp.length;v++){var x;y=Qp[v];null!=(x=e.getShallow(y))&&(t[y]=x)}var b=e.getShallow("borderType");null!=b&&(t.borderDash=b),"auto"!==t.backgroundColor&&"inherit"!==t.backgroundColor||!h||("auto"===t.backgroundColor&&Ea("backgroundColor: 'auto'","backgroundColor: 'inherit'"),t.backgroundColor=h),"auto"!==t.borderColor&&"inherit"!==t.borderColor||!h||("auto"===t.borderColor&&Ea("borderColor: 'auto'","borderColor: 'inherit'"),t.borderColor=h)}}function tf(t,e){var n=e&&e.getModel("textStyle");return ct([t.fontStyle||n&&n.getShallow("fontStyle")||"",t.fontWeight||n&&n.getShallow("fontWeight")||"",(t.fontSize||n&&n.getShallow("fontSize")||12)+"px",t.fontFamily||n&&n.getShallow("fontFamily")||"sans-serif"].join(" "))}var ef=Qa();function nf(t,e,n,r){if(t){var i=ef(t);i.prevValue=i.value,i.value=n;var o=e.normal;i.valueAnimation=o.get("valueAnimation"),i.valueAnimation&&(i.precision=o.get("precision"),i.defaultInterpolatedText=r,i.statesModels=e)}}function rf(t,e,n,r,i){var o=ef(t);if(o.valueAnimation&&o.prevValue!==o.value){var a=o.defaultInterpolatedText,s=at(o.interpolatedValue,o.prevValue),l=o.value;t.percent=0,(null==o.prevValue?jd:Xd)(t,{percent:1},r,e,null,function(r){var u=ls(n,o.precision,s,l,r);o.interpolatedValue=1===r?null:u;var h=Xp({labelDataIndex:e,labelFetcher:i,defaultText:a?a(u):u+""},o.statesModels,u);Wp(t,h)})}}var of,af,sf={minMargin:1,textMargin:2},lf=["textStyle","color"],uf=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],hf=new Qu,cf=function(){function t(){}return t.prototype.getTextColor=function(t){var e=this.ecModel;return this.getShallow("color")||(!t&&e?e.get(lf):null)},t.prototype.getFont=function(){return tf({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(t){for(var e={text:t,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<uf.length;n++)e[uf[n]]=this.getShallow(uf[n]);return hf.useStyle(e),hf.update(),hf.getBoundingRect()},t}(),df=cf,pf=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],ff=zs(pf),gf=function(){function t(){}return t.prototype.getLineStyle=function(t){return ff(this,t)},t}(),mf=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],vf=zs(mf),yf=function(){function t(){}return t.prototype.getItemStyle=function(t,e){return vf(this,t,e)},t}(),_f=function(){function t(t,e,n){this.parentModel=e,this.ecModel=n,this.option=t}return t.prototype.init=function(t,e,n){},t.prototype.mergeOption=function(t,e){A(this.option,t,!0)},t.prototype.get=function(t,e){return null==t?this.option:this._doGet(this.parsePath(t),!e&&this.parentModel)},t.prototype.getShallow=function(t,e){var n=this.option,r=null==n?n:n[t];if(null==r&&!e){var i=this.parentModel;i&&(r=i.getShallow(t))}return r},t.prototype.getModel=function(e,n){var r=null!=e,i=r?this.parsePath(e):null;return new t(r?this._doGet(i):this.option,n=n||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(i)),this.ecModel)},t.prototype.isEmpty=function(){return null==this.option},t.prototype.restoreData=function(){},t.prototype.clone=function(){return new(0,this.constructor)(I(this.option))},t.prototype.parsePath=function(t){return"string"==typeof t?t.split("."):t},t.prototype.resolveParentPath=function(t){return t},t.prototype.isAnimationEnabled=function(){if(!i.node&&this.option){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(t,e){var n=this.option;if(!t)return n;for(var r=0;r<t.length&&(!t[r]||null!=(n=n&&"object"==typeof n?n[t[r]]:null));r++);return null==n&&e&&(n=e._doGet(this.resolveParentPath(t),e.parentModel)),n},t}();Ps(_f),of=_f,af=["__\0is_clz",Os++].join("_"),of.prototype[af]=!0,ht(!of.isInstance,'The method "is" can not be defined.'),of.isInstance=function(t){return!(!t||!t[af])},k(_f,gf),k(_f,yf),k(_f,Vs),k(_f,df);var xf=_f,bf=Math.round(10*Math.random());function wf(t){return[t||"",bf++].join("_")}function Sf(t,e){return A(A({},t,!0),e,!0)}var Tf="ZH",Mf="EN",Cf=Mf,If={},Af={},Df=i.domSupported&&(document.documentElement.lang||navigator.language||navigator.browserLanguage||Cf).toUpperCase().indexOf(Tf)>-1?Tf:Cf;function Lf(t,e){t=t.toUpperCase(),Af[t]=new xf(e),If[t]=e}function Pf(t){return Af[t]}Lf(Mf,{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:". "}}}}),Lf(Tf,{time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}});var Ef=null;function Of(){return Ef}function Nf(t,e){var n=Of(),r=e.breakOption,i=e.breakParsed;return!i&&n&&(i=n.parseAxisBreakOption(r,t)),i}function Rf(t){var e=t.brk;return e?e.breaks:[]}function kf(t){var e=t.brk;return!!e&&e.hasBreaks()}var zf=1e3,Bf=6e4,Vf=36e5,Ff=864e5,Gf=31536e6,Hf={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})/},Uf={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}"},Wf="{yyyy}-{MM}-{dd}",Xf={year:"{yyyy}",month:"{yyyy}-{MM}",day:Wf,hour:Wf+" "+Uf.hour,minute:Wf+" "+Uf.minute,second:Wf+" "+Uf.second,millisecond:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},jf=["year","month","day","hour","minute","second","millisecond"],Zf=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function Yf(t){return Y(t)||Z(t)?t:function(t){t=t||{};var e={},n=!0;return B(jf,function(e){n&&(n=null==t[e])}),B(jf,function(r,i){var o=t[r];e[r]={};for(var a=null,s=i;s>=0;s--){var l=jf[s],u=J(o)&&!j(o)?o[l]:o,h=void 0;j(u)?a=(h=u.slice())[0]||"":Y(u)?h=[a=u]:(null==a?a=Uf[r]:Hf[l].test(a)||(a=e[l][l][0]+" "+a),h=[a],n&&(h[1]="{primary|"+a+"}")),e[r][l]=h}}),e}(t)}function qf(t,e){return"0000".substr(0,e-(t+="").length)+t}function Kf(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 Jf(t){return t===Kf(t)}function Qf(t,e,n,r){var i=pa(t),o=i[eg(n)](),a=i[ng(n)]()+1,s=Math.floor((a-1)/3)+1,l=i[rg(n)](),u=i["get"+(n?"UTC":"")+"Day"](),h=i[ig(n)](),c=(h-1)%12+1,d=i[og(n)](),p=i[ag(n)](),f=i[sg(n)](),g=h>=12?"pm":"am",m=g.toUpperCase(),v=(r instanceof xf?r:Pf(r||Df)||Af[Cf]).getModel("time"),y=v.get("month"),_=v.get("monthAbbr"),x=v.get("dayOfWeek"),b=v.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,g+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,o+"").replace(/{yy}/g,qf(o%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,y[a-1]).replace(/{MMM}/g,_[a-1]).replace(/{MM}/g,qf(a,2)).replace(/{M}/g,a+"").replace(/{dd}/g,qf(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,x[u]).replace(/{ee}/g,b[u]).replace(/{e}/g,u+"").replace(/{HH}/g,qf(h,2)).replace(/{H}/g,h+"").replace(/{hh}/g,qf(c+"",2)).replace(/{h}/g,c+"").replace(/{mm}/g,qf(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,qf(p,2)).replace(/{s}/g,p+"").replace(/{SSS}/g,qf(f,3)).replace(/{S}/g,f+"")}function $f(t,e){var n=pa(t),r=n[ng(e)]()+1,i=n[rg(e)](),o=n[ig(e)](),a=n[og(e)](),s=n[ag(e)](),l=0===n[sg(e)](),u=l&&0===s,h=u&&0===a,c=h&&0===o,d=c&&1===i;return d&&1===r?"year":d?"month":c?"day":h?"hour":u?"minute":l?"second":"millisecond"}function tg(t,e,n){switch(e){case"year":t[ug(n)](0);case"month":t[hg(n)](1);case"day":t[cg(n)](0);case"hour":t[dg(n)](0);case"minute":t[pg(n)](0);case"second":t[fg(n)](0)}return t}function eg(t){return t?"getUTCFullYear":"getFullYear"}function ng(t){return t?"getUTCMonth":"getMonth"}function rg(t){return t?"getUTCDate":"getDate"}function ig(t){return t?"getUTCHours":"getHours"}function og(t){return t?"getUTCMinutes":"getMinutes"}function ag(t){return t?"getUTCSeconds":"getSeconds"}function sg(t){return t?"getUTCMilliseconds":"getMilliseconds"}function lg(t){return t?"setUTCFullYear":"setFullYear"}function ug(t){return t?"setUTCMonth":"setMonth"}function hg(t){return t?"setUTCDate":"setDate"}function cg(t){return t?"setUTCHours":"setHours"}function dg(t){return t?"setUTCMinutes":"setMinutes"}function pg(t){return t?"setUTCSeconds":"setSeconds"}function fg(t){return t?"setUTCMilliseconds":"setMilliseconds"}function gg(t){if(!xa(t))return Y(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function mg(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(t,e){return e.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var vg=ut;function yg(t,e,n){function r(t){return t&&ct(t)?t:"-"}function i(t){return Ta(t)}var o="time"===e,a=t instanceof Date;if(o||a){var s=o?pa(t):t;if(!isNaN(+s))return Qf(s,"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}",n);if(a)return"-"}if("ordinal"===e)return q(t)?r(t):K(t)&&i(t)?t+"":"-";var l=_a(t);return i(l)?gg(l):q(t)?r(t):"boolean"==typeof t?t+"":"-"}var _g=["a","b","c","d","e","f","g"],xg=function(t,e){return"{"+t+(null==e?"":e)+"}"};function bg(t,e,n){j(e)||(e=[e]);var r=e.length;if(!r)return"";for(var i=e[0].$vars||[],o=0;o<i.length;o++){var a=_g[o];t=t.replace(xg(a),xg(a,0))}for(var s=0;s<r;s++)for(var l=0;l<i.length;l++){var u=e[s][i[l]];t=t.replace(xg(_g[l],s),n?ue(u):u)}return t}function wg(t,e,n){return B(e,function(e,r){t=t.replace("{"+r+"}",n?ue(e):e)}),t}function Sg(t,e){var n=Y(t)?{color:t,extraCssText:e}:t||{},r=n.color,i=n.type;e=n.extraCssText;var o=n.renderMode||"html";return r?"html"===o?"subItem"===i?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+ue(r)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+ue(r)+";"+(e||"")+'"></span>':{renderMode:o,content:"{"+(n.markerId||"markerX")+"|} ",style:"subItem"===i?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:""}function Tg(t,e,n){Ea("echarts.format.formatTime","echarts.time.format"),"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var r=pa(e),i=n?"getUTC":"get",o=r[i+"FullYear"](),a=r[i+"Month"]()+1,s=r[i+"Date"](),l=r[i+"Hours"](),u=r[i+"Minutes"](),h=r[i+"Seconds"](),c=r[i+"Milliseconds"]();return t=t.replace("MM",qf(a,2)).replace("M",a).replace("yyyy",o).replace("yy",qf(o%100+"",2)).replace("dd",qf(s,2)).replace("d",s).replace("hh",qf(l,2)).replace("h",l).replace("mm",qf(u,2)).replace("m",u).replace("ss",qf(h,2)).replace("s",h).replace("SSS",qf(c,3))}function Mg(t,e){return e=e||"transparent",Y(t)?t:J(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}function Cg(t,e){if("_blank"===e||"blank"===e){var n=window.open();n.opener=null,n.location.href=t}else window.open(t,e)}var Ig={},Ag={},Dg=function(){function t(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return t.prototype.create=function(t,e){function n(n,r){var i=[];return B(n,function(n,o){var a=n.create(t,e);i=i.concat(a||[]),r&&B(a,function(t){return ht(!t.update)})}),i}this._nonSeriesBoxMasterList=n(Ig,!0),this._normalMasterList=n(Ag,!1)},t.prototype.update=function(t,e){B(this._normalMasterList,function(n){n.update&&n.update(t,e)})},t.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},t.register=function(t,e){"matrix"!==t&&"calendar"!==t?Ag[t]=e:Ig[t]=e},t.get=function(t){return Ag[t]||Ig[t]},t}();var Lg=yt();function Pg(t){var e=t.getShallow("coord",!0),n=1;if(null==e){var r=Lg.get(t.type);r&&r.getCoord2&&(n=2,e=r.getCoord2(t))}return{coord:e,from:n}}function Eg(t,e){var n=t.getShallow("coordinateSystem"),r=t.getShallow("coordinateSystemUsage",!0),i=null!=r,o=0;if(n){var a="series"===t.mainType;null==r&&(r=a?"data":"box"),"data"===r?(o=1,a||(i&&e&&La('coordinateSystemUsage "data" is not supported in non-series components.'),o=0)):"box"===r&&(o=2,a||function(t){return!!Ig[t]}(n)||(i&&e&&La('coordinateSystem "'+n+'" cannot be used as coordinateSystemUsage "box" for "'+t.type+'" yet.'),o=0))}return{coordSysType:n,kind:o}}function Og(t){var e=t.targetModel,n=t.coordSysType,r=t.coordSysProvider,i=t.isDefaultDataCoordSys,o=t.allowNotFound;ht(!!n);var a=Eg(e,!0),s=a.kind,l=a.coordSysType;if(i&&1!==s&&(s=1,l=n),0===s||l!==n)return 0;var u=r(n,e);return u?(1===s?(ht("series"===e.mainType),e.coordinateSystem=u):e.boxCoordinateSystem=u,s):(o||La(n+" cannot be found for "+e.type+" (index: "+e.componentIndex+")."),0)}var Ng=function(t,e){var n=e.getReferringComponents(t,ns).models[0];return n&&n.coordinateSystem},Rg=Dg,kg=B,zg=["left","right","top","bottom","width","height"],Bg=[["width","left","right"],["height","top","bottom"]];function Vg(t,e,n,r,i){var o=0,a=0;null==r&&(r=1/0),null==i&&(i=1/0);var s=0;e.eachChild(function(l,u){var h,c,d=l.getBoundingRect(),p=e.childAt(u+1),f=p&&p.getBoundingRect();if("horizontal"===t){var g=d.width+(f?-f.x+d.x:0);(h=o+g)>r||l.newline?(o=0,h=g,a+=s+n,s=d.height):s=Math.max(s,d.height)}else{var m=d.height+(f?-f.y+d.y:0);(c=a+m)>i||l.newline?(o+=s+n,a=0,c=m,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=o,l.y=a,l.markRedraw(),"horizontal"===t?o=h+n:a=c+n)})}var Fg=Vg;function Gg(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 Hg(t,e){var n=function(t,e){var n,r,i=jg(t,e,{enableLayoutOnlyByCenter:!0}),o=t.getBoxLayoutParams();if(i.type===Xg.point)r=i.refPoint,n=Ug(o,{width:e.getWidth(),height:e.getHeight()});else{var a=t.get("center"),s=j(a)?a:[a,a];n=Ug(o,i.refContainer),r=2===i.boxCoordFrom?i.refPoint:[Qo(s[0],n.width)+n.x,Qo(s[1],n.height)+n.y]}return{viewRect:n,center:r}}(t,e),r=n.viewRect,i=n.center,o=t.get("radius");j(o)||(o=[0,o]);var a=Qo(r.width,e.getWidth()),s=Qo(r.height,e.getHeight()),l=Math.min(a,s),u=Qo(o[0],l/2),h=Qo(o[1],l/2);return{cx:i[0],cy:i[1],r0:u,r:h,viewRect:r}}function Ug(t,e,n){n=vg(n||0);var r=e.width,i=e.height,o=Qo(t.left,r),a=Qo(t.top,i),s=Qo(t.right,r),l=Qo(t.bottom,i),u=Qo(t.width,r),h=Qo(t.height,i),c=n[2]+n[0],d=n[1]+n[3],p=t.aspect;switch(isNaN(u)&&(u=r-s-d-o),isNaN(h)&&(h=i-l-c-a),null!=p&&(isNaN(u)&&isNaN(h)&&(p>r/i?u=.8*r:h=.8*i),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(o)&&(o=r-s-u-d),isNaN(a)&&(a=i-l-h-c),t.left||t.right){case"center":o=r/2-u/2-n[3];break;case"right":o=r-u-d}switch(t.top||t.bottom){case"middle":case"center":a=i/2-h/2-n[0];break;case"bottom":a=i-h-c}o=o||0,a=a||0,isNaN(u)&&(u=r-d-o-(s||0)),isNaN(h)&&(h=i-c-a-(l||0));var f=new ln((e.x||0)+o+n[3],(e.y||0)+a+n[0],u,h);return f.margin=n,f}function Wg(t,e,n){var r=t.getShallow("preserveAspect",!0);if(!r)return e;var i=e.width/e.height;if(Math.abs(Math.atan(n)-Math.atan(i))<1e-9)return e;var o=t.getShallow("preserveAspectAlign",!0),a=t.getShallow("preserveAspectVerticalAlign",!0),s={width:e.width,height:e.height},l="cover"===r;return i>n&&!l||i<n&&l?(s.width=e.height*n,"left"===o?s.left=0:"right"===o?s.right=0:s.left="center"):(s.height=e.width/n,"top"===a?s.top=0:"bottom"===a?s.bottom=0:s.top="middle"),Ug(s,e)}X(Vg,"vertical"),X(Vg,"horizontal");var Xg={rect:1,point:2};function jg(t,e,n){var r,i,o,a,s=t.boxCoordinateSystem;if(s){var l=Pg(t),u=l.coord,h=l.from;if(s.dataToLayout){o=Xg.rect,a=h;var c=s.dataToLayout(u);r=c.contentRect||c.rect}else n&&n.enableLayoutOnlyByCenter&&s.dataToPoint?(o=Xg.point,a=h,i=s.dataToPoint(u)):La(t.type+"["+t.componentIndex+"] layout based on "+s.type+" is not supported.")}return null==o&&(o=Xg.rect),o===Xg.rect&&(r||(r={x:0,y:0,width:e.getWidth(),height:e.getHeight()}),i=[r.x+r.width/2,r.y+r.height/2]),{type:o,refContainer:r,refPoint:i,boxCoordFrom:a}}function Zg(t,e,n,r,i,o){var a,s=!i||!i.hv||i.hv[0],l=!i||!i.hv||i.hv[1],u=i&&i.boundingMode||"all";if((o=o||t).x=t.x,o.y=t.y,!s&&!l)return!1;if("raw"===u)a="group"===t.type?new ln(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(a=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(a=a.clone()).applyTransform(h)}var c=Ug(E({width:a.width,height:a.height},e),n,r),d=s?c.x-a.x:0,p=l?c.y-a.y:0;return"raw"===u?(o.x=d,o.y=p):(o.x+=d,o.y+=p),o===t&&t.markRedraw(),!0}function Yg(t){var e=t.layoutMode||t.constructor.layoutMode;return J(e)?e:e?{type:e}:null}function qg(t,e,n){var r=n&&n.ignoreSize;!j(r)&&(r=[r,r]);var i=a(Bg[0],0),o=a(Bg[1],1);function a(n,i){var o={},a=0,l={},u=0;if(kg(n,function(e){l[e]=t[e]}),kg(n,function(t){wt(e,t)&&(o[t]=l[t]=e[t]),s(o,t)&&a++,s(l,t)&&u++}),r[i])return s(e,n[1])?l[n[2]]=null:s(e,n[2])&&(l[n[1]]=null),l;if(2!==u&&a){if(a>=2)return o;for(var h=0;h<n.length;h++){var c=n[h];if(!wt(o,c)&&wt(t,c)){o[c]=t[c];break}}return o}return l}function s(t,e){return null!=t[e]&&"auto"!==t[e]}function l(t,e,n){kg(t,function(t){e[t]=n[t]})}l(Bg[0],t,i),l(Bg[1],t,o)}function Kg(t){return Jg({},t)}function Jg(t,e){return e&&t&&kg(zg,function(n){wt(e,n)&&(t[n]=e[n])}),t}var Qg=Qa(),$g=function(t){function n(e,n,r){var i=t.call(this,e,n,r)||this;return i.uid=wf("ec_cpt_model"),i}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Yg(this),r=n?Kg(t):{};A(t,e.getTheme().get(this.mainType)),A(t,this.getDefaultOption()),n&&qg(t,r,n)},n.prototype.mergeOption=function(t,e){A(this.option,t,!0);var n=Yg(this);n&&qg(this.option,t,n)},n.prototype.optionUpdated=function(t,e){},n.prototype.getDefaultOption=function(){var t=this.constructor;if(!function(t){return!(!t||!t[Ds])}(t))return t.defaultOption;var e=Qg(this);if(!e.defaultOption){for(var n=[],r=t;r;){var i=r.prototype.defaultOption;i&&n.push(i),r=r.superClass}for(var o={},a=n.length-1;a>=0;a--)o=A(o,n[a],!0);e.defaultOption=o}return e.defaultOption},n.prototype.getReferringComponents=function(t,e){var n=t+"Index",r=t+"Id";return is(this.ecModel,t,{index:this.get(n,!0),id:this.get(r,!0)},e)},n.prototype.getBoxLayoutParams=function(){return Gg(this,!1)},n.prototype.getZLevelKey=function(){return""},n.prototype.setZLevel=function(t){this.option.zlevel=t},n.protoInitialize=function(){var t=n.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),n}(xf);Es($g,xf),ks($g),function(t){var e={};t.registerSubTypeDefaulter=function(t,n){var r=Ls(t);e[r.main]=n},t.determineSubType=function(n,r){var i=r.type;if(!i){var o=Ls(n).main;t.hasSubTypes(n)&&e[o]&&(i=e[o](r))}return i}}($g),function(t,e){function n(t,e){return t[e]||(t[e]={predecessor:[],successor:[]}),t[e]}t.topologicalTravel=function(t,r,i,o){if(t.length){var a=function(t){var r={},i=[];return B(t,function(o){var a=n(r,o),s=function(t,e){var n=[];return B(t,function(t){N(e,t)>=0&&n.push(t)}),n}(a.originalDeps=e(o),t);a.entryCount=s.length,0===a.entryCount&&i.push(o),B(s,function(t){N(a.predecessor,t)<0&&a.predecessor.push(t);var e=n(r,t);N(e.successor,t)<0&&e.successor.push(o)})}),{graph:r,noEntryList:i}}(r),s=a.graph,l=a.noEntryList,u={};for(B(t,function(t){u[t]=!0});l.length;){var h=l.pop(),c=s[h],d=!!u[h];d&&(i.call(o,h,c.originalDeps.slice()),delete u[h]),B(c.successor,d?f:p)}B(u,function(){var e;throw e=Oa("Circular dependency may exists: ",u,t,r),new Error(e)})}function p(t){s[t].entryCount--,0===s[t].entryCount&&l.push(t)}function f(t){u[t]=!0,p(t)}}}($g,function(t){var e=[];B($g.getClassesByMainType(t),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=V(e,function(t){return Ls(t).main}),"dataset"!==t&&N(e,"dataset")<=0&&e.unshift("dataset");return e});var tm=$g,em={color:{},darkColor:{},size:{}},nm=em.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)"};for(var rm in L(nm,{primary:nm.neutral80,secondary:nm.neutral70,tertiary:nm.neutral60,quaternary:nm.neutral50,disabled:nm.neutral20,border:nm.neutral30,borderTint:nm.neutral20,borderShade:nm.neutral40,background:nm.neutral05,backgroundTint:"rgba(234,237,245,0.5)",backgroundTransparent:"rgba(255,255,255,0)",backgroundShade:nm.neutral10,shadow:"rgba(0,0,0,0.2)",shadowTint:"rgba(129,130,136,0.2)",axisLine:nm.neutral70,axisLineTint:nm.neutral40,axisTick:nm.neutral70,axisTickMinor:nm.neutral60,axisLabel:nm.neutral70,axisSplitLine:nm.neutral15,axisMinorSplitLine:nm.neutral05}),nm)if(nm.hasOwnProperty(rm)){var im=nm[rm];"theme"===rm?em.darkColor.theme=nm.theme.slice():"highlight"===rm?em.darkColor.highlight="rgba(255,231,130,0.4)":0===rm.indexOf("accent")?em.darkColor[rm]=Lr(im,null,function(t){return.5*t},function(t){return Math.min(1,1.3-t)}):em.darkColor[rm]=Lr(im,null,function(t){return.9*t},function(t){return 1-Math.pow(t,1.5)})}em.size={xxs:2,xs:5,s:10,m:15,l:20,xl:30,xxl:40,xxxl:50};var om=em,am="";"undefined"!=typeof navigator&&(am=navigator.platform||"");var sm="rgba(0, 0, 0, 0.2)",lm=om.color.theme[0],um=Lr(lm,null,null,.9),hm={darkMode:"auto",colorBy:"series",color:om.color.theme,gradientColor:[um,lm],aria:{decal:{decals:[{color:sm,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:sm,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:sm,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:sm,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:sm,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:sm,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:am.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},cm=1,dm=2,pm=3,fm=Qa();function gm(t,e,n){var r={},i=vm(e);if(!i||!t)return r;var o,a,s=[],l=[],u=e.ecModel,h=fm(u).datasetMap,c=i.uid+"_"+n.seriesLayoutBy;B(t=t.slice(),function(e,n){var i=J(e)?e:t[n]={name:e};"ordinal"===i.type&&null==o&&(o=n,a=f(i)),r[i.name]=[]});var d=h.get(c)||h.set(c,{categoryWayDim:a,valueWayDim:0});function p(t,e,n){for(var r=0;r<n;r++)t.push(e+r)}function f(t){var e=t.dimsDef;return e?e.length:1}return B(t,function(t,e){var n=t.name,i=f(t);if(null==o){var a=d.valueWayDim;p(r[n],a,i),p(l,a,i),d.valueWayDim+=i}else if(o===e)p(r[n],0,i),p(s,0,i);else{a=d.categoryWayDim;p(r[n],a,i),p(l,a,i),d.categoryWayDim+=i}}),s.length&&(r.itemName=s),l.length&&(r.seriesName=l),r}function mm(t,e,n){var r={};if(!vm(t))return r;var i,o=e.sourceFormat,a=e.dimensionsDefine;o!==ah&&o!==sh||B(a,function(t,e){"name"===(J(t)?t.name:t)&&(i=e)});var s=function(){for(var t={},r={},s=[],l=0,u=Math.min(5,n);l<u;l++){var h=_m(e.data,o,e.seriesLayoutBy,a,e.startIndex,l);s.push(h);var c=h===pm;if(c&&null==t.v&&l!==i&&(t.v=l),(null==t.n||t.n===t.v||!c&&s[t.n]===pm)&&(t.n=l),d(t)&&s[t.n]!==pm)return t;c||(h===dm&&null==r.v&&l!==i&&(r.v=l),null!=r.n&&r.n!==r.v||(r.n=l))}function d(t){return null!=t.v&&null!=t.n}return d(t)?t:d(r)?r:null}();if(s){r.value=[s.v];var l=null!=i?i:s.n;r.itemName=[l],r.seriesName=[l]}return r}function vm(t){if(!t.get("data",!0))return is(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},ns).models[0]}function ym(t,e){return _m(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function _m(t,e,n,r,i,o){var a,s,l;if($(t))return pm;if(r){var u=r[o];J(u)?(s=u.name,l=u.type):Y(u)&&(s=u)}if(null!=l)return"ordinal"===l?cm:pm;if(e===oh){var h=t;if(n===ch){for(var c=h[o],d=0;d<(c||[]).length&&d<5;d++)if(null!=(a=y(c[i+d])))return a}else for(d=0;d<h.length&&d<5;d++){var p=h[i+d];if(p&&null!=(a=y(p[o])))return a}}else if(e===ah){var f=t;if(!s)return pm;for(d=0;d<f.length&&d<5;d++){if((m=f[d])&&null!=(a=y(m[s])))return a}}else if(e===sh){if(!s)return pm;if(!(c=t[s])||$(c))return pm;for(d=0;d<c.length&&d<5;d++)if(null!=(a=y(c[d])))return a}else if(e===ih){var g=t;for(d=0;d<g.length&&d<5;d++){var m,v=Ga(m=g[d]);if(!j(v))return pm;if(null!=(a=y(v[o])))return a}}function y(t){var e=Y(t);return null!=t&&isFinite(Number(t))&&""!==t?e?dm:pm:e&&"-"!==t?cm:void 0}return pm}var xm=yt();var bm,wm,Sm,Tm=Qa(),Mm=Qa(),Cm=function(){function t(){}return t.prototype.getColorFromPalette=function(t,e,n){var r=Ba(this.get("color",!0)),i=this.get("colorLayer",!0);return Am(this,Tm,r,i,t,e,n)},t.prototype.clearColorPalette=function(){!function(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}(this,Tm)},t}();function Im(t,e,n,r){var i=Ba(t.get(["aria","decal","decals"]));return Am(t,Mm,i,null,e,n,r)}function Am(t,e,n,r,i,o,a){var s=e(o=o||t),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var h=null!=a&&r?function(t,e){for(var n=t.length,r=0;r<n;r++)if(t[r].length>e)return t[r];return t[n-1]}(r,a):n;if((h=h||n)&&h.length){var c=h[l];return i&&(u[i]=c),s.paletteIdx=(l+1)%h.length,c}}var Dm="\0_ec_inner",Lm={grid:"GridComponent",polar:"PolarComponent",geo:"GeoComponent",singleAxis:"SingleAxisComponent",parallel:"ParallelComponent",calendar:"CalendarComponent",matrix:"MatrixComponent",graphic:"GraphicComponent",toolbox:"ToolboxComponent",tooltip:"TooltipComponent",axisPointer:"AxisPointerComponent",brush:"BrushComponent",title:"TitleComponent",timeline:"TimelineComponent",markPoint:"MarkPointComponent",markLine:"MarkLineComponent",markArea:"MarkAreaComponent",legend:"LegendComponent",dataZoom:"DataZoomComponent",visualMap:"VisualMapComponent",xAxis:"GridComponent",yAxis:"GridComponent",angleAxis:"PolarComponent",radiusAxis:"PolarComponent"},Pm={line:"LineChart",bar:"BarChart",pie:"PieChart",scatter:"ScatterChart",radar:"RadarChart",map:"MapChart",tree:"TreeChart",treemap:"TreemapChart",graph:"GraphChart",chord:"ChordChart",gauge:"GaugeChart",funnel:"FunnelChart",parallel:"ParallelChart",sankey:"SankeyChart",boxplot:"BoxplotChart",candlestick:"CandlestickChart",effectScatter:"EffectScatterChart",lines:"LinesChart",heatmap:"HeatmapChart",pictorialBar:"PictorialBarChart",themeRiver:"ThemeRiverChart",sunburst:"SunburstChart",custom:"CustomChart"},Em={};var Om=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.init=function(t,e,n,r,i,o){r=r||{},this.option=null,this._theme=new xf(r),this._locale=new xf(i),this._optionManager=o},n.prototype.setOption=function(t,e,n){ht(null!=t,"option is null/undefined"),ht(1!==t[Dm],"please use chart.getOption()");var r=km(e);this._optionManager.setOption(t,n,r),this._resetOption(null,r)},n.prototype.resetOption=function(t,e){return this._resetOption(t,km(e))},n.prototype._resetOption=function(t,e){var n=!1,r=this._optionManager;if(!t||"recreate"===t){var i=r.mountOption("recreate"===t);B(i,function(t,e){if(!tm.hasClass(e)){var n=Lm[e];n&&!Em[n]&&(La("Component "+e+" is used but not imported.\nimport { "+n+" } from 'echarts/components';\necharts.use(["+n+"]);"),Em[n]=!0)}}),this.option&&"recreate"!==t?(this.restoreData(),this._mergeOption(i,e)):Sm(this,i),n=!0}if("timeline"!==t&&"media"!==t||this.restoreData(),!t||"recreate"===t||"timeline"===t){var o=r.getTimelineOption(this);o&&(n=!0,this._mergeOption(o,e))}if(!t||"recreate"===t||"media"===t){var a=r.getMediaOption(this);a.length&&B(a,function(t){n=!0,this._mergeOption(t,e)},this)}return n},n.prototype.mergeOption=function(t){this._mergeOption(t,null)},n.prototype._mergeOption=function(t,e){var n=this.option,r=this._componentsMap,i=this._componentsCount,o=[],a=yt(),s=e&&e.replaceMergeMainTypeMap;fm(this).datasetMap=yt(),B(t,function(t,e){null!=t&&(tm.hasClass(e)?e&&(o.push(e),a.set(e,!0)):n[e]=null==n[e]?I(t):A(n[e],t,!0))}),s&&s.each(function(t,e){tm.hasClass(e)&&!a.get(e)&&(o.push(e),a.set(e,!0))}),tm.topologicalTravel(o,tm.getAllClassMainTypes(),function(e){var o=function(t,e,n){var r=xm.get(e);if(!r)return n;var i=r(t);if(!i)return n;for(var o=0;o<i.length;o++)ht(Ka(i[o]));return n.concat(i)}(this,e,Ba(t[e])),a=r.get(e),l=a?s&&s.get(e)?"replaceMerge":"normalMerge":"replaceAll",u=Ua(a,o,l);(function(t,e,n){B(t,function(t){var r=t.newOption;J(r)&&(t.keyInfo.mainType=e,t.keyInfo.subType=function(t,e,n,r){return e.type?e.type:n?n.subType:r.determineSubType(t,e)}(e,r,t.existing,n))})})(u,e,tm),n[e]=null,r.set(e,null),i.set(e,0);var h,c,d=[],p=[],f=0;B(u,function(t,n){var r=t.existing,i=t.newOption;if(i){var o="series"===e,a=tm.getClass(e,t.keyInfo.subType,!o);if(!a){var s=t.keyInfo.subType,l=Pm[s];return void(Em[s]||(Em[s]=!0,La(l?"Series "+s+" is used but not imported.\nimport { "+l+" } from 'echarts/charts';\necharts.use(["+l+"]);":"Unknown series "+s)))}if("tooltip"===e){if(h)return void(c||(Da("Currently only one tooltip component is allowed."),c=!0));h=!0}if(r&&r.constructor===a)r.name=t.keyInfo.name,r.mergeOption(i,this),r.optionUpdated(i,!1);else{var u=L({componentIndex:n},t.keyInfo);L(r=new a(i,this,this,u),u),t.brandNew&&(r.__requireNewView=!0),r.init(i,this,this),r.optionUpdated(null,!0)}}else r&&(r.mergeOption({},this),r.optionUpdated({},!1));r?(d.push(r.option),p.push(r),f++):(d.push(void 0),p.push(void 0))},this),n[e]=d,r.set(e,p),i.set(e,f),"series"===e&&bm(this)},this),this._seriesIndices||bm(this)},n.prototype.getOption=function(){var t=I(this.option);return B(t,function(e,n){if(tm.hasClass(n)){for(var r=Ba(e),i=r.length,o=!1,a=i-1;a>=0;a--)r[a]&&!Ka(r[a])?o=!0:(r[a]=null,!o&&i--);r.length=i,t[n]=r}}),delete t[Dm],t},n.prototype.setTheme=function(t){this._theme=new xf(t),this._resetOption("recreate",null)},n.prototype.getTheme=function(){return this._theme},n.prototype.getLocaleModel=function(){return this._locale},n.prototype.setUpdatePayload=function(t){this._payload=t},n.prototype.getUpdatePayload=function(){return this._payload},n.prototype.getComponent=function(t,e){var n=this._componentsMap.get(t);if(n){var r=n[e||0];if(r)return r;if(null==e)for(var i=0;i<n.length;i++)if(n[i])return n[i]}},n.prototype.queryComponents=function(t){var e=t.mainType;if(!e)return[];var n,r=t.index,i=t.id,o=t.name,a=this._componentsMap.get(e);return a&&a.length?(null!=r?(n=[],B(Ba(r),function(t){a[t]&&n.push(a[t])})):n=null!=i?Nm("id",i,a):null!=o?Nm("name",o,a):G(a,function(t){return!!t}),Rm(n,t)):[]},n.prototype.findComponents=function(t){var e,n,r,i,o,a=t.query,s=t.mainType,l=(n=s+"Index",r=s+"Id",i=s+"Name",!(e=a)||null==e[n]&&null==e[r]&&null==e[i]?null:{mainType:s,index:e[n],id:e[r],name:e[i]}),u=l?this.queryComponents(l):G(this._componentsMap.get(s),function(t){return!!t});return o=Rm(u,t),t.filter?G(o,t.filter):o},n.prototype.eachComponent=function(t,e,n){var r=this._componentsMap;if(Z(t)){var i=e,o=t;r.each(function(t,e){for(var n=0;t&&n<t.length;n++){var r=t[n];r&&o.call(i,e,r,r.componentIndex)}})}else for(var a=Y(t)?r.get(t):J(t)?this.findComponents(t):null,s=0;a&&s<a.length;s++){var l=a[s];l&&e.call(n,l,l.componentIndex)}},n.prototype.getSeriesByName=function(t){var e=ja(t,null);return G(this._componentsMap.get("series"),function(t){return!!t&&null!=e&&t.name===e})},n.prototype.getSeriesByIndex=function(t){return this._componentsMap.get("series")[t]},n.prototype.getSeriesByType=function(t){return G(this._componentsMap.get("series"),function(e){return!!e&&e.subType===t})},n.prototype.getSeries=function(){return G(this._componentsMap.get("series"),function(t){return!!t})},n.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},n.prototype.eachSeries=function(t,e){wm(this),B(this._seriesIndices,function(n){var r=this._componentsMap.get("series")[n];t.call(e,r,n)},this)},n.prototype.eachRawSeries=function(t,e){B(this._componentsMap.get("series"),function(n){n&&t.call(e,n,n.componentIndex)})},n.prototype.eachSeriesByType=function(t,e,n){wm(this),B(this._seriesIndices,function(r){var i=this._componentsMap.get("series")[r];i.subType===t&&e.call(n,i,r)},this)},n.prototype.eachRawSeriesByType=function(t,e,n){return B(this.getSeriesByType(t),e,n)},n.prototype.isSeriesFiltered=function(t){return wm(this),null==this._seriesIndicesMap.get(t.componentIndex)},n.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},n.prototype.filterSeries=function(t,e){wm(this);var n=[];B(this._seriesIndices,function(r){var i=this._componentsMap.get("series")[r];t.call(e,i,r)&&n.push(r)},this),this._seriesIndices=n,this._seriesIndicesMap=yt(n)},n.prototype.restoreData=function(t){bm(this);var e=this._componentsMap,n=[];e.each(function(t,e){tm.hasClass(e)&&n.push(e)}),tm.topologicalTravel(n,tm.getAllClassMainTypes(),function(n){B(e.get(n),function(e){!e||"series"===n&&function(t,e){if(e){var n=e.seriesIndex,r=e.seriesId,i=e.seriesName;return null!=n&&t.componentIndex!==n||null!=r&&t.id!==r||null!=i&&t.name!==i}}(e,t)||e.restoreData()})})},n.internalField=(bm=function(t){var e=t._seriesIndices=[];B(t._componentsMap.get("series"),function(t){t&&e.push(t.componentIndex)}),t._seriesIndicesMap=yt(e)},wm=function(t){if(!t._seriesIndices)throw new Error("Option should contains series.")},void(Sm=function(t,e){t.option={},t.option[Dm]=1,t._componentsMap=yt({series:[]}),t._componentsCount=yt();var n=e.aria;J(n)&&null==n.enabled&&(n.enabled=!0),function(t,e){var n=t.color&&!t.colorLayer;B(e,function(e,r){"colorLayer"===r&&n||"color"===r&&t.color||tm.hasClass(r)||("object"==typeof e?t[r]=t[r]?A(t[r],e,!1):I(e):null==t[r]&&(t[r]=e))})}(e,t._theme.option),A(e,hm,!1),t._mergeOption(e,null)})),n}(xf);function Nm(t,e,n){if(j(e)){var r=yt();return B(e,function(t){null!=t&&(null!=ja(t,null)&&r.set(t,!0))}),G(n,function(e){return e&&r.get(e[t])})}var i=ja(e,null);return G(n,function(e){return e&&null!=i&&e[t]===i})}function Rm(t,e){return e.hasOwnProperty("subType")?G(t,function(t){return t&&t.subType===e.subType}):t}function km(t){var e=yt();return t&&B(Ba(t.replaceMerge),function(t){ht(tm.hasClass(t),'"'+t+'" is not valid component main type in "replaceMerge"'),e.set(t,!0)}),{replaceMergeMainTypeMap:e}}k(Om,Cm);var zm=Om,Bm=/^(min|max)?(.+)$/,Vm=function(){function t(t){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=t}return t.prototype.setOption=function(t,e,n){t&&(B(Ba(t.series),function(t){t&&t.data&&$(t.data)&&pt(t.data)}),B(Ba(t.dataset),function(t){t&&t.source&&$(t.source)&&pt(t.source)})),t=I(t);var r=this._optionBackup,i=function(t,e,n){var r,i,o=[],a=t.baseOption,s=t.timeline,l=t.options,u=t.media,h=!!t.media,c=!!(l||s||a&&a.timeline);a?(i=a).timeline||(i.timeline=s):((c||h)&&(t.options=t.media=null),i=t);h&&(j(u)?B(u,function(t){t&&!t.option&&J(t.query)&&J(t.query.option)&&La("Illegal media option. Must be like { media: [ { query: {}, option: {} } ] }"),t&&t.option&&(t.query?o.push(t):r||(r=t))}):La("Illegal media option. Must be an array. Like { media: [ {...}, {...} ] }"));function d(t){B(e,function(e){e(t,n)})}return d(i),B(l,function(t){return d(t)}),B(o,function(t){return d(t.option)}),{baseOption:i,timelineOptions:l||[],mediaDefault:r,mediaList:o}}(t,e,!r);this._newBaseOption=i.baseOption,r?(i.timelineOptions.length&&(r.timelineOptions=i.timelineOptions),i.mediaList.length&&(r.mediaList=i.mediaList),i.mediaDefault&&(r.mediaDefault=i.mediaDefault)):this._optionBackup=i},t.prototype.mountOption=function(t){var e=this._optionBackup;return this._timelineOptions=e.timelineOptions,this._mediaList=e.mediaList,this._mediaDefault=e.mediaDefault,this._currentMediaIndices=[],I(t?e.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(t){var e,n=this._timelineOptions;if(n.length){var r=t.getComponent("timeline");r&&(e=I(n[r.getCurrentIndex()]))}return e},t.prototype.getMediaOption=function(t){var e,n,r=this._api.getWidth(),i=this._api.getHeight(),o=this._mediaList,a=this._mediaDefault,s=[],l=[];if(!o.length&&!a)return l;for(var u=0,h=o.length;u<h;u++)Fm(o[u].query,r,i)&&s.push(u);return!s.length&&a&&(s=[-1]),s.length&&(e=s,n=this._currentMediaIndices,e.join(",")!==n.join(","))&&(l=V(s,function(t){return I(-1===t?a.option:o[t].option)})),this._currentMediaIndices=s,l},t}();function Fm(t,e,n){var r={width:e,height:n,aspectratio:e/n},i=!0;return B(t,function(t,e){var n=e.match(Bm);if(n&&n[1]&&n[2]){var o=n[1],a=n[2].toLowerCase();(function(t,e,n){return"min"===n?t>=e:"max"===n?t<=e:t===e})(r[a],t,o)||(i=!1)}}),i}var Gm=Vm,Hm=B,Um=J,Wm=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Xm(t){var e=t&&t.itemStyle;if(e)for(var n=0,r=Wm.length;n<r;n++){var i=Wm[n],o=e.normal,a=e.emphasis;o&&o[i]&&(Ea("itemStyle.normal."+i,i),t[i]=t[i]||{},t[i].normal?A(t[i].normal,o[i]):t[i].normal=o[i],o[i]=null),a&&a[i]&&(Ea("itemStyle.emphasis."+i,"emphasis."+i),t[i]=t[i]||{},t[i].emphasis?A(t[i].emphasis,a[i]):t[i].emphasis=a[i],a[i]=null)}}function jm(t,e,n){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var r=t[e].normal,i=t[e].emphasis;r&&(Pa("'normal' hierarchy in "+e+" has been removed since 4.0. All style properties are configured in "+e+" directly now."),n?(t[e].normal=t[e].emphasis=null,E(t[e],r)):t[e]=r),i&&(Pa(e+".emphasis has been changed to emphasis."+e+" since 4.0"),t.emphasis=t.emphasis||{},t.emphasis[e]=i,i.focus&&(t.emphasis.focus=i.focus),i.blurScope&&(t.emphasis.blurScope=i.blurScope))}}function Zm(t){jm(t,"itemStyle"),jm(t,"lineStyle"),jm(t,"areaStyle"),jm(t,"label"),jm(t,"labelLine"),jm(t,"upperLabel"),jm(t,"edgeLabel")}function Ym(t,e){var n=Um(t)&&t[e],r=Um(n)&&n.textStyle;if(r){Pa("textStyle hierarchy in "+e+" has been removed since 4.0. All textStyle properties are configured in "+e+" directly now.");for(var i=0,o=Fa.length;i<o;i++){var a=Fa[i];r.hasOwnProperty(a)&&(n[a]=r[a])}}}function qm(t){t&&(Zm(t),Ym(t,"label"),t.emphasis&&Ym(t.emphasis,"label"))}function Km(t){return j(t)?t:t?[t]:[]}function Jm(t){return(j(t)?t[0]:t)||{}}function Qm(t,e){Hm(Km(t.series),function(t){Um(t)&&function(t){if(Um(t)){Xm(t),Zm(t),Ym(t,"label"),Ym(t,"upperLabel"),Ym(t,"edgeLabel"),t.emphasis&&(Ym(t.emphasis,"label"),Ym(t.emphasis,"upperLabel"),Ym(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(Xm(e),qm(e));var n=t.markLine;n&&(Xm(n),qm(n));var r=t.markArea;r&&qm(r);var i=t.data;if("graph"===t.type){i=i||t.nodes;var o=t.links||t.edges;if(o&&!$(o))for(var a=0;a<o.length;a++)qm(o[a]);B(t.categories,function(t){Zm(t)})}if(i&&!$(i))for(a=0;a<i.length;a++)qm(i[a]);if((e=t.markPoint)&&e.data){var s=e.data;for(a=0;a<s.length;a++)qm(s[a])}if((n=t.markLine)&&n.data){var l=n.data;for(a=0;a<l.length;a++)j(l[a])?(qm(l[a][0]),qm(l[a][1])):qm(l[a])}"gauge"===t.type?(Ym(t,"axisLabel"),Ym(t,"title"),Ym(t,"detail")):"treemap"===t.type?(jm(t.breadcrumb,"itemStyle"),B(t.levels,function(t){Zm(t)})):"tree"===t.type&&Zm(t.leaves)}}(t)});var n=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&n.push("valueAxis","categoryAxis","logAxis","timeAxis"),Hm(n,function(e){Hm(Km(t[e]),function(t){t&&(Ym(t,"axisLabel"),Ym(t.axisPointer,"label"))})}),Hm(Km(t.parallel),function(t){var e=t&&t.parallelAxisDefault;Ym(e,"axisLabel"),Ym(e&&e.axisPointer,"label")}),Hm(Km(t.calendar),function(t){jm(t,"itemStyle"),Ym(t,"dayLabel"),Ym(t,"monthLabel"),Ym(t,"yearLabel")}),Hm(Km(t.radar),function(t){Ym(t,"name"),t.name&&null==t.axisName&&(t.axisName=t.name,delete t.name,Pa("name property in radar component has been changed to axisName")),null!=t.nameGap&&null==t.axisNameGap&&(t.axisNameGap=t.nameGap,delete t.nameGap,Pa("nameGap property in radar component has been changed to axisNameGap")),Hm(t.indicator,function(t){t.text&&Ea("text","name","radar.indicator")})}),Hm(Km(t.geo),function(t){Um(t)&&(qm(t),Hm(Km(t.regions),function(t){qm(t)}))}),Hm(Km(t.timeline),function(t){qm(t),jm(t,"label"),jm(t,"itemStyle"),jm(t,"controlStyle",!0);var e=t.data;j(e)&&B(e,function(t){J(t)&&(jm(t,"label"),jm(t,"itemStyle"))})}),Hm(Km(t.toolbox),function(t){jm(t,"iconStyle"),Hm(t.feature,function(t){jm(t,"iconStyle")})}),Ym(Jm(t.axisPointer),"label"),Ym(Jm(t.tooltip).axisPointer,"label")}function $m(t){t&&B(tv,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var tv=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],ev=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],nv=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function rv(t){var e=t&&t.itemStyle;if(e)for(var n=0;n<nv.length;n++){var r=nv[n][1],i=nv[n][0];null!=e[r]&&(e[i]=e[r],Ea(r,i))}}function iv(t){t&&"edge"===t.alignTo&&null!=t.margin&&null==t.edgeDistance&&(Ea("label.margin","label.edgeDistance","pie"),t.edgeDistance=t.margin)}function ov(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay,Ea("downplay","blur","sunburst"))}function av(t,e){if(t)for(var n=0;n<t.length;n++)e(t[n]),t[n]&&av(t[n].children,e)}function sv(t,e){Qm(t,e),t.series=Ba(t.series),B(t.series,function(t){if(J(t)){var e=t.type;if("line"===e)null!=t.clipOverflow&&(t.clip=t.clipOverflow,Ea("clipOverflow","clip","line"));else if("pie"===e||"gauge"===e){if(null!=t.clockWise&&(t.clockwise=t.clockWise,Ea("clockWise","clockwise")),iv(t.label),(i=t.data)&&!$(i))for(var n=0;n<i.length;n++)iv(i[n]);null!=t.hoverOffset&&(t.emphasis=t.emphasis||{},(t.emphasis.scaleSize=null)&&(Ea("hoverOffset","emphasis.scaleSize"),t.emphasis.scaleSize=t.hoverOffset))}else if("gauge"===e){var r=function(t,e){for(var n=e.split(","),r=t,i=0;i<n.length&&null!=(r=r&&r[n[i]]);i++);return r}(t,"pointer.color");null!=r&&function(t,e,n,r){for(var i,o=e.split(","),a=t,s=0;s<o.length-1;s++)null==a[i=o[s]]&&(a[i]={}),a=a[i];(r||null==a[o[s]])&&(a[o[s]]=n)}(t,"itemStyle.color",r)}else if("bar"===e){var i;if(rv(t),rv(t.backgroundStyle),rv(t.emphasis),(i=t.data)&&!$(i))for(n=0;n<i.length;n++)"object"==typeof i[n]&&(rv(i[n]),rv(i[n]&&i[n].emphasis))}else if("sunburst"===e){var o=t.highlightPolicy;o&&(t.emphasis=t.emphasis||{},t.emphasis.focus||(t.emphasis.focus=o,Ea("highlightPolicy","emphasis.focus","sunburst"))),ov(t),av(t.data,ov)}else"graph"===e||"sankey"===e?function(t){t&&null!=t.focusNodeAdjacency&&(t.emphasis=t.emphasis||{},null==t.emphasis.focus&&(Ea("focusNodeAdjacency","emphasis: { focus: 'adjacency'}","graph/sankey"),t.emphasis.focus="adjacency"))}(t):"map"===e&&(t.mapType&&!t.map&&(Ea("mapType","map","map"),t.map=t.mapType),t.mapLocation&&(Pa("`mapLocation` is not used anymore."),E(t,t.mapLocation)));null!=t.hoverAnimation&&(t.emphasis=t.emphasis||{},t.emphasis&&null==t.emphasis.scale&&(Ea("hoverAnimation","emphasis.scale"),t.emphasis.scale=t.hoverAnimation)),$m(t)}}),t.dataRange&&(t.visualMap=t.dataRange),B(ev,function(e){var n=t[e];n&&(j(n)||(n=[n]),B(n,function(t){$m(t)}))})}var lv=Is(function(t){var e=yt();t.eachSeries(function(t){var n=t.get("stack");if(n){var r=e.get(n)||e.set(n,[]),i=t.getData(),o={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:t};if(!o.stackedDimension||!o.isStackedByIndex&&!o.stackedByDimension)return;r.push(o)}}),e.each(function(t){0!==t.length&&("seriesDesc"===(t[0].seriesModel.get("stackOrder")||"seriesAsc")&&t.reverse(),B(t,function(e,n){e.data.setCalculationInfo("stackedOnSeries",n>0?t[n-1].seriesModel:null)}),function(t){B(t,function(e,n){var r=[],i=[NaN,NaN],o=[e.stackResultDimension,e.stackedOverDimension],a=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";a.modify(o,function(o,u,h){var c,d,p=a.get(e.stackedDimension,h);if(isNaN(p))return i;s?d=a.getRawIndex(h):c=a.get(e.stackedByDimension,h);for(var f=NaN,g=n-1;g>=0;g--){var m=t[g];if(s||(d=m.data.rawIndexOf(m.stackedByDimension,c)),d>=0){var v=m.data.getByRawIndex(m.stackResultDimension,d);if("all"===l||"positive"===l&&v>0||"negative"===l&&v<0||"samesign"===l&&p>=0&&v>0||"samesign"===l&&p<=0&&v<0){p=la(p,v),f=v;break}}}return r[0]=p,r[1]=f,r})})}(t))})});var uv,hv,cv,dv,pv,fv,gv=function(t){this.data=t.data||(t.sourceFormat===sh?{}:[]),this.sourceFormat=t.sourceFormat||uh,this.seriesLayoutBy=t.seriesLayoutBy||hh,this.startIndex=t.startIndex||0,this.dimensionsDetectedCount=t.dimensionsDetectedCount,this.metaRawOption=t.metaRawOption;var e=this.dimensionsDefine=t.dimensionsDefine;if(e)for(var n=0;n<e.length;n++){var r=e[n];null==r.type&&ym(this,n)===cm&&(r.type="ordinal")}};function mv(t){return t instanceof gv}function vv(t,e,n){n=n||_v(t);var r=e.seriesLayoutBy,i=function(t,e,n,r,i){var o,a;if(!t)return{dimensionsDefine:xv(i),startIndex:a,dimensionsDetectedCount:o};if(e===oh){var s=t;"auto"===r||null==r?bv(function(t){null!=t&&"-"!==t&&(Y(t)?null==a&&(a=1):a=0)},n,s,10):a=K(r)?r:r?1:0,i||1!==a||(i=[],bv(function(t,e){i[e]=null!=t?t+"":""},n,s,1/0)),o=i?i.length:n===ch?s.length:s[0]?s[0].length:null}else if(e===ah)i||(i=function(t){var e,n=0;for(;n<t.length&&!(e=t[n++]););if(e)return U(e)}(t));else if(e===sh)i||(i=[],B(t,function(t,e){i.push(e)}));else if(e===ih){var l=Ga(t[0]);o=j(l)&&l.length||1}else e===lh&&ht(!!i,"dimensions must be given if data is TypedArray.");return{startIndex:a,dimensionsDefine:xv(i),dimensionsDetectedCount:o}}(t,n,r,e.sourceHeader,e.dimensions);return new gv({data:t,sourceFormat:n,seriesLayoutBy:r,dimensionsDefine:i.dimensionsDefine,startIndex:i.startIndex,dimensionsDetectedCount:i.dimensionsDetectedCount,metaRawOption:I(e)})}function yv(t){return new gv({data:t,sourceFormat:$(t)?lh:ih})}function _v(t){var e=uh;if($(t))e=lh;else if(j(t)){0===t.length&&(e=oh);for(var n=0,r=t.length;n<r;n++){var i=t[n];if(null!=i){if(j(i)||$(i)){e=oh;break}if(J(i)){e=ah;break}}}}else if(J(t))for(var o in t)if(wt(t,o)&&z(t[o])){e=sh;break}return e}function xv(t){if(t){var e=yt();return V(t,function(t,n){var r={name:(t=J(t)?t:{name:t}).name,displayName:t.displayName,type:t.type};if(null==r.name)return r;r.name+="",null==r.displayName&&(r.displayName=r.name);var i=e.get(r.name);return i?r.name+="-"+i.count++:e.set(r.name,{count:1}),r})}}function bv(t,e,n,r){if(e===ch)for(var i=0;i<n.length&&i<r;i++)t(n[i]?n[i][0]:null,i);else{var o=n[0]||[];for(i=0;i<o.length&&i<r;i++)t(o[i],i)}}function wv(t){var e=t.sourceFormat;return e===ah||e===sh}var Sv=function(){function t(t,e){var n=mv(t)?t:yv(t);this._source=n;var r=this._data=n.data,i=n.sourceFormat,o=n.seriesLayoutBy;if(i===lh){if(null==e)throw new Error("Typed array data must specify dimension size");this._offset=0,this._dimSize=e,this._data=r}var a=Mv[Rv(i,o)];a&&a(r,n.dimensionsDefine),fv(this,r,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(t,e){},t.prototype.appendData=function(t){},t.prototype.clean=function(){},t.protoInitialize=function(){var e=t.prototype;e.pure=!1,e.persistent=!0}(),t.internalField=function(){var t;fv=function(t,i,o){var a=o.sourceFormat,s=o.seriesLayoutBy,l=o.startIndex,u=o.dimensionsDefine,h=pv[Rv(a,s)];if(ht(h,"Invalide sourceFormat: "+a),L(t,h),a===lh)t.getItem=e,t.count=r,t.fillStorage=n;else{var c=Av(a,s);t.getItem=W(c,null,i,l,u);var d=Pv(a,s);t.count=W(d,null,i,l,u)}};var e=function(t,e){t-=this._offset,e=e||[];for(var n=this._data,r=this._dimSize,i=r*t,o=0;o<r;o++)e[o]=n[i+o];return e},n=function(t,e,n,r){for(var i=this._data,o=this._dimSize,a=0;a<o;a++){for(var s=r[a],l=null==s[0]?1/0:s[0],u=null==s[1]?-1/0:s[1],h=e-t,c=n[a],d=0;d<h;d++){var p=i[d*o+a];c[t+d]=p,p<l&&(l=p),p>u&&(u=p)}s[0]=l,s[1]=u}},r=function(){return this._data?this._data.length/this._dimSize:0};function i(t){for(var e=0;e<t.length;e++)this._data.push(t[e])}(t={})[oh+"_"+hh]={pure:!0,appendData:i},t[oh+"_"+ch]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},t[ah]={pure:!0,appendData:i},t[sh]={pure:!0,appendData:function(t){var e=this._data;B(t,function(t,n){for(var r=e[n]||(e[n]=[]),i=0;i<(t||[]).length;i++)r.push(t[i])})}},t[ih]={appendData:i},t[lh]={persistent:!1,pure:!0,appendData:function(t){ht($(t),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=t},clean:function(){this._offset+=this.count(),this._data=null}},pv=t}(),t}(),Tv=function(t){j(t)||La("series.data or dataset.source must be an array.")},Mv=((uv={})[oh+"_"+hh]=Tv,uv[oh+"_"+ch]=Tv,uv[ah]=Tv,uv[sh]=function(t,e){for(var n=0;n<e.length;n++){null==e[n].name&&La("dimension name must not be null/undefined.")}},uv[ih]=Tv,uv),Cv=function(t,e,n,r){return t[r]},Iv=((hv={})[oh+"_"+hh]=function(t,e,n,r){return t[r+e]},hv[oh+"_"+ch]=function(t,e,n,r,i){r+=e;for(var o=i||[],a=t,s=0;s<a.length;s++){var l=a[s];o[s]=l?l[r]:null}return o},hv[ah]=Cv,hv[sh]=function(t,e,n,r,i){for(var o=i||[],a=0;a<n.length;a++){var s=n[a].name,l=null!=s?t[s]:null;o[a]=l?l[r]:null}return o},hv[ih]=Cv,hv);function Av(t,e){var n=Iv[Rv(t,e)];return ht(n,'Do not support get item on "'+t+'", "'+e+'".'),n}var Dv=function(t,e,n){return t.length},Lv=((cv={})[oh+"_"+hh]=function(t,e,n){return Math.max(0,t.length-e)},cv[oh+"_"+ch]=function(t,e,n){var r=t[0];return r?Math.max(0,r.length-e):0},cv[ah]=Dv,cv[sh]=function(t,e,n){var r=n[0].name,i=null!=r?t[r]:null;return i?i.length:0},cv[ih]=Dv,cv);function Pv(t,e){var n=Lv[Rv(t,e)];return ht(n,'Do not support count on "'+t+'", "'+e+'".'),n}var Ev=function(t,e,n){return t[e]},Ov=((dv={})[oh]=Ev,dv[ah]=function(t,e,n){return t[n]},dv[sh]=Ev,dv[ih]=function(t,e,n){var r=Ga(t);return r instanceof Array?r[e]:r},dv[lh]=Ev,dv);function Nv(t){var e=Ov[t];return ht(e,'Do not support get value on "'+t+'".'),e}function Rv(t,e){return t===oh?t+"_"+e:t}function kv(t,e,n){if(t){var r=t.getRawDataItem(e);if(null!=r){var i=t.getStore(),o=i.getSource().sourceFormat;if(null!=n){var a=t.getDimensionIndex(n),s=i.getDimensionProperty(a);return Nv(o)(r,a,s)}var l=r;return o===ih&&(l=Ga(r)),l}}}var zv=/\{@(.+?)\}/g,Bv=function(){function t(){}return t.prototype.getDataParams=function(t,e){var n=this.getData(e),r=this.getRawValue(t,e),i=n.getRawIndex(t),o=n.getName(t),a=n.getRawDataItem(t),s=n.getItemVisual(t,"style"),l=s&&s[n.getItemVisual(t,"drawType")||"fill"],u=s&&s.stroke,h=this.mainType,c="series"===h,d=n.userOutput&&n.userOutput.get();return{componentType:h,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:c?this.subType:null,seriesIndex:this.seriesIndex,seriesId:c?this.id:null,seriesName:c?this.name:null,name:o,dataIndex:i,data:a,dataType:e,value:r,color:l,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(t,e,n,r,i,o){e=e||"normal";var a=this.getData(n),s=this.getDataParams(t,n);(o&&(s.value=o.interpolatedValue),null!=r&&j(s.value)&&(s.value=s.value[r]),i)||(i=a.getItemModel(t).get("normal"===e?["label","formatter"]:[e,"label","formatter"]));return Z(i)?(s.status=e,s.dimensionIndex=r,i(s)):Y(i)?bg(i,s).replace(zv,function(e,n){var r=n.length,i=n;"["===i.charAt(0)&&"]"===i.charAt(r-1)&&(i=+i.slice(1,r-1),isNaN(i)&&La("Invalide label formatter: @"+n+", only support @[0], @[1], @[2], ..."));var s=kv(a,t,i);if(o&&j(o.interpolatedValue)){var l=a.getDimensionIndex(i);l>=0&&(s=o.interpolatedValue[l])}return null!=s?s+"":""}):void 0},t.prototype.getRawValue=function(t,e){return kv(this.getData(e),t)},t.prototype.formatTooltip=function(t,e,n){},t}();function Vv(t){var e,n;return J(t)?t.type?n=t:console.warn("The return type of `formatTooltip` is not supported: "+Oa(t)):e=t,{text:e,frag:n}}function Fv(t){return new Gv(t)}var Gv=function(){function t(t){t=t||{},this._reset=t.reset,this._plan=t.plan,this._count=t.count,this._onDirty=t.onDirty,this._dirty=!0}return t.prototype.perform=function(t){var e,n=this._upstream,r=t&&t.skip;if(this._dirty&&n){var i=this.context;i.data=i.outputData=n.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!r&&(e=this._plan(this.context));var o,a=h(this._modBy),s=this._modDataCount||0,l=h(t&&t.modBy),u=t&&t.modDataCount||0;function h(t){return!(t>=1)&&(t=1),t}a===l&&s===u||(e="reset"),(this._dirty||"reset"===e)&&(this._dirty=!1,o=this._doReset(r)),this._modBy=l,this._modDataCount=u;var c=t&&t.step;if(n?(ht(null!=n._outputDueEnd),this._dueEnd=n._outputDueEnd):(ht(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):1/0),this._progress){var d=this._dueIndex,p=Math.min(null!=c?this._dueIndex+c:1/0,this._dueEnd);if(!r&&(o||d<p)){var f=this._progress;if(j(f))for(var g=0;g<f.length;g++)this._doProgress(f[g],d,p,l,u);else this._doProgress(f,d,p,l,u)}this._dueIndex=p;var m=null!=this._settedOutputEnd?this._settedOutputEnd:p;ht(m>=this._outputDueEnd),this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(t,e,n,r,i){Hv.reset(e,n,r,i),this._callingProgress=t,this._callingProgress({start:e,end:n,count:n-e,next:Hv.next},this.context)},t.prototype._doReset=function(t){var e,n;this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null,!t&&this._reset&&((e=this._reset(this.context))&&e.progress&&(n=e.forceFirstProgress,e=e.progress),j(e)&&!e.length&&(e=null)),this._progress=e,this._modBy=this._modDataCount=null;var r=this._downstream;return r&&r.dirty(),n},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},t.prototype.pipe=function(t){ht(t&&!t._disposed&&t!==this),(this._downstream!==t||this._dirty)&&(this._downstream=t,t._upstream=this,t.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(t){this._outputDueEnd=this._settedOutputEnd=t},t}(),Hv=function(){var t,e,n,r,i,o={reset:function(l,u,h,c){e=l,t=u,n=h,r=c,i=Math.ceil(r/n),o.next=n>1&&r>0?s:a}};return o;function a(){return e<t?e++:null}function s(){var o=e%i*n+Math.ceil(e/i),a=e>=t?null:o<r?o:e;return e++,a}}();function Uv(t,e){var n=e&&e.type;return"ordinal"===n?t:("time"!==n||K(t)||null==t||"-"===t||(t=+pa(t)),null==t||""===t?NaN:Number(t))}var Wv=yt({number:function(t){return parseFloat(t)},time:function(t){return+pa(t)},trim:function(t){return Y(t)?ct(t):t}});function Xv(t){return Wv.get(t)}var jv={lt:function(t,e){return t<e},lte:function(t,e){return t<=e},gt:function(t,e){return t>e},gte:function(t,e){return t>=e}},Zv=function(){function t(t,e){if(!K(e)){Na('rvalue of "<", ">", "<=", ">=" can only be number in filter.')}this._opFn=jv[t],this._rvalFloat=_a(e)}return t.prototype.evaluate=function(t){return K(t)?this._opFn(t,this._rvalFloat):this._opFn(_a(t),this._rvalFloat)},t}(),Yv=function(){function t(t,e){var n="desc"===t;this._resultLT=n?1:-1,null==e&&(e=n?"min":"max"),this._incomparable="min"===e?-1/0:1/0}return t.prototype.evaluate=function(t,e){var n=K(t)?t:_a(t),r=K(e)?e:_a(e),i=isNaN(n),o=isNaN(r);if(i&&(n=this._incomparable),o&&(r=this._incomparable),i&&o){var a=Y(t),s=Y(e);a&&(n=s?t:0),s&&(r=a?e:0)}return n<r?this._resultLT:n>r?-this._resultLT:0},t}(),qv=function(){function t(t,e){this._rval=e,this._isEQ=t,this._rvalTypeof=typeof e,this._rvalFloat=_a(e)}return t.prototype.evaluate=function(t){var e=t===this._rval;if(!e){var n=typeof t;n===this._rvalTypeof||"number"!==n&&"number"!==this._rvalTypeof||(e=_a(t)===this._rvalFloat)}return this._isEQ?e:!e},t}();function Kv(t,e){return"eq"===t||"ne"===t?new qv("eq"===t,e):wt(jv,t)?new Zv(t,e):null}function Jv(t){var e="",n=-1/0,r=-1/0,i=1/0,o=1/0;return t&&(null!=t.g&&(e+="G"+t.g,n=t.g),null!=t.ge&&(e+="GE"+t.ge,r=t.ge),null!=t.l&&(e+="L"+t.l,i=t.l),null!=t.le&&(e+="LE"+t.le,o=t.le)),{key:e,g:n,ge:r,l:i,le:o}}function Qv(t,e){return e>t.g&&e>=t.ge&&e<t.l&&e<=t.le}var $v=function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(t){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(t){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(t,e){},t.prototype.retrieveValueFromItem=function(t,e){},t.prototype.convertValue=function(t,e){return Uv(t,e)},t}();function ty(t){var e=t.sourceFormat;if(!ay(e)){Na("`getRawData` is not supported in source format "+e)}return t.data}function ey(t){var e=t.sourceFormat,n=t.data;if(!ay(e)){Na("`cloneRawData` is not supported in source format "+e)}if(e===oh){for(var r=[],i=0,o=n.length;i<o;i++)r.push(n[i].slice());return r}if(e===ah){for(r=[],i=0,o=n.length;i<o;i++)r.push(L({},n[i]));return r}}function ny(t,e,n){if(null!=n)return K(n)||!isNaN(n)&&!wt(e,n)?t[n]:wt(e,n)?e[n]:void 0}function ry(t){return I(t)}var iy=yt();function oy(t,e,n,r){e.length||Na("Must have at least one upstream dataset."),J(t)||Na("transform declaration must be an object rather than "+typeof t+".");var i=t.type,o=iy.get(i);o||Na('Can not find transform on type "'+i+'".');var a=V(e,function(t){return function(t,e){var n=new $v,r=t.data,i=n.sourceFormat=t.sourceFormat,o=t.startIndex;t.seriesLayoutBy!==hh&&Na('`seriesLayoutBy` of upstream dataset can only be "column" in data transform.');var a=[],s={},l=t.dimensionsDefine;if(l)B(l,function(t,e){var n=t.name,r={index:e,name:n,displayName:t.displayName};a.push(r),null!=n&&(wt(s,n)&&Na('dimension name "'+n+'" duplicated.'),s[n]=r)});else for(var u=0;u<t.dimensionsDetectedCount;u++)a.push({index:u});var h=Av(i,hh);e.__isBuiltIn&&(n.getRawDataItem=function(t){return h(r,o,a,t)},n.getRawData=W(ty,null,t)),n.cloneRawData=W(ey,null,t);var c=Pv(i,hh);n.count=W(c,null,r,o,a);var d=Nv(i);n.retrieveValue=function(t,e){var n=h(r,o,a,t);return p(n,e)};var p=n.retrieveValueFromItem=function(t,e){if(null!=t){var n=a[e];return n?d(t,e,n.name):void 0}};return n.getDimensionInfo=W(ny,null,a,s),n.cloneAllDimensionInfo=W(ry,null,a),n}(t,o)}),s=Ba(o.transform({upstream:a[0],upstreamList:a,config:I(t.config)}));t.print&&Aa(V(s,function(t){var e=null!=r?" === pipe index: "+r:"";return["=== dataset index: "+n.datasetIndex+e+" ===","- transform result data:",Oa(t.data),"- transform result dimensions:",Oa(t.dimensions)].join("\n")}).join("\n"));return V(s,function(t,n){var r;J(t)||Na("A transform should not return some empty results."),t.data||Na("Transform result data should be not be null or undefined"),ay(_v(t.data))||Na("Transform result data should be array rows or object rows.");var i=e[0];if(i&&0===n&&!t.dimensions){var o=i.startIndex;o&&(t.data=i.data.slice(0,o).concat(t.data)),r={seriesLayoutBy:hh,sourceHeader:o,dimensions:i.metaRawOption.dimensions}}else r={seriesLayoutBy:hh,sourceHeader:0,dimensions:t.dimensions};return vv(t.data,r,null)})}function ay(t){return t===oh||t===ah}var sy,ly=typeof Uint32Array===eh?Array:Uint32Array,uy=typeof Uint16Array===eh?Array:Uint16Array,hy=typeof Int32Array===eh?Array:Int32Array,cy=typeof Float64Array===eh?Array:Float64Array,dy={float:cy,int:hy,ordinal:Array,number:Array,time:cy};function py(t){return t>65535?ly:uy}function fy(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function gy(t,e,n,r,i){var o=dy[n||"float"];if(i){var a=t[e],s=a&&a.length;if(s!==r){for(var l=new o(r),u=0;u<s;u++)l[u]=a[u];t[e]=l}}else t[e]=new o(r)}var my=function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=yt()}return t.prototype.initData=function(t,e,n){ht(Z(t.getItem)&&Z(t.count),"Invalid data provider."),this._provider=t,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var r=t.getSource(),i=this.defaultDimValueGetter=sy[r.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[];var o=wv(r);this._dimensions=V(e,function(t){return o&&ht(null!=t.property),{type:t.type,property:t.property}}),this._initDataFromProvider(0,t.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(t,e){var n=this._calcDimNameToIdx,r=this._dimensions,i=n.get(t);if(null!=i){if(r[i].type===e)return i}else i=r.length;return r[i]={type:e},n.set(t,i),this._chunks[i]=new dy[e||"float"](this._rawCount),this._rawExtent[i]=[1/0,-1/0],i},t.prototype.collectOrdinalMeta=function(t,e){var n=this._chunks[t],r=this._dimensions[t],i=this._rawExtent,o=r.ordinalOffset||0,a=n.length;0===o&&(i[t]=[1/0,-1/0]);for(var s=i[t],l=o;l<a;l++){var u=n[l]=e.parseAndCollect(n[l]);isNaN(u)||(s[0]=Math.min(u,s[0]),s[1]=Math.max(u,s[1]))}r.ordinalMeta=e,r.ordinalOffset=a,r.type="ordinal"},t.prototype.getOrdinalMeta=function(t){return this._dimensions[t].ordinalMeta},t.prototype.getDimensionProperty=function(t){var e=this._dimensions[t];return e&&e.property},t.prototype.appendData=function(t){ht(!this._indices,"appendData can only be called on raw data.");var e=this._provider,n=this.count();e.appendData(t);var r=e.count();return e.persistent||(r+=n),n<r&&this._initDataFromProvider(n,r,!0),[n,r]},t.prototype.appendValues=function(t,e){for(var n=this._chunks,r=this._dimensions,i=r.length,o=this._rawExtent,a=this.count(),s=a+Math.max(t.length,e||0),l=0;l<i;l++){gy(n,l,(p=r[l]).type,s,!0)}for(var u=[],h=a;h<s;h++)for(var c=h-a,d=0;d<i;d++){var p=r[d],f=sy.arrayRows.call(this,t[c]||u,p.property,c,d);n[d][h]=f;var g=o[d];f<g[0]&&(g[0]=f),f>g[1]&&(g[1]=f)}return this._rawCount=this._count=s,{start:a,end:s}},t.prototype._initDataFromProvider=function(t,e,n){for(var r=this._provider,i=this._chunks,o=this._dimensions,a=o.length,s=this._rawExtent,l=V(o,function(t){return t.property}),u=0;u<a;u++){var h=o[u];s[u]||(s[u]=cs()),gy(i,u,h.type,e,n)}if(r.fillStorage)r.fillStorage(t,e,i,s);else for(var c=[],d=t;d<e;d++){c=r.getItem(d,c);for(var p=0;p<a;p++){var f=i[p],g=this._dimValueGetter(c,l[p],d,p);f[d]=g;var m=s[p];g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=e,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(t,e){if(!(e>=0&&e<this._count))return NaN;var n=this._chunks[t];return n?n[this.getRawIndex(e)]:NaN},t.prototype.getValues=function(t,e){var n=[],r=[];if(null==e){e=t,t=[];for(var i=0;i<this._dimensions.length;i++)r.push(i)}else r=t;i=0;for(var o=r.length;i<o;i++)n.push(this.get(r[i],e));return n},t.prototype.getByRawIndex=function(t,e){if(!(e>=0&&e<this._rawCount))return NaN;var n=this._chunks[t];return n?n[e]:NaN},t.prototype.getSum=function(t){var e=0;if(this._chunks[t])for(var n=0,r=this.count();n<r;n++){var i=this.get(t,n);isNaN(i)||(e+=i)}return e},t.prototype.getMedian=function(t){var e=[];this.each([t],function(t){isNaN(t)||e.push(t)}),ra(e);var n=this.count();return 0===n?0:n%2==1?e[(n-1)/2]:(e[n/2]+e[n/2-1])/2},t.prototype.indexOfRawIndex=function(t){if(t>=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,n=e[t];if(null!=n&&n<this._count&&n===t)return t;for(var r=0,i=this._count-1;r<=i;){var o=(r+i)/2|0;if(e[o]<t)r=o+1;else{if(!(e[o]>t))return o;i=o-1}}return-1},t.prototype.getIndices=function(){var t,e=this._indices;if(e){var n=e.constructor,r=this._count;if(n===Array){t=new n(r);for(var i=0;i<r;i++)t[i]=e[i]}else t=new n(e.buffer,0,r)}else{t=new(n=py(this._rawCount))(this.count());for(i=0;i<t.length;i++)t[i]=i}return t},t.prototype.filter=function(t,e){if(!this._count)return this;for(var n=this.clone(),r=n.count(),i=new(py(n._rawCount))(r),o=[],a=t.length,s=0,l=t[0],u=n._chunks,h=0;h<r;h++){var c=void 0,d=n.getRawIndex(h);if(0===a)c=e(h);else if(1===a){c=e(u[l][d],h)}else{for(var p=0;p<a;p++)o[p]=u[t[p]][d];o[p]=h,c=e.apply(null,o)}c&&(i[s++]=d)}return s<r&&(n._indices=i),n._count=s,n._extent=[],n._updateGetRawIdx(),n},t.prototype.selectRange=function(t){var e=this.clone(),n=e._count;if(!n)return this;var r=U(t),i=r.length;if(!i)return this;var o=e.count(),a=new(py(e._rawCount))(o),s=0,l=r[0],u=t[l][0],h=t[l][1],c=e._chunks,d=!1;if(!e._indices){var p=0;if(1===i){for(var f=c[r[0]],g=0;g<n;g++){((_=f[g])>=u&&_<=h||isNaN(_))&&(a[s++]=p),p++}d=!0}else if(2===i){f=c[r[0]];var m=c[r[1]],v=t[r[1]][0],y=t[r[1]][1];for(g=0;g<n;g++){var _=f[g],x=m[g];(_>=u&&_<=h||isNaN(_))&&(x>=v&&x<=y||isNaN(x))&&(a[s++]=p),p++}d=!0}}if(!d)if(1===i)for(g=0;g<o;g++){var b=e.getRawIndex(g);((_=c[r[0]][b])>=u&&_<=h||isNaN(_))&&(a[s++]=b)}else for(g=0;g<o;g++){for(var w=!0,S=(b=e.getRawIndex(g),0);S<i;S++){var T=r[S];((_=c[T][b])<t[T][0]||_>t[T][1])&&(w=!1)}w&&(a[s++]=e.getRawIndex(g))}return s<o&&(e._indices=a),e._count=s,e._extent=[],e._updateGetRawIdx(),e},t.prototype.map=function(t,e){var n=this.clone(t);return this._updateDims(n,t,e),n},t.prototype.modify=function(t,e){this._updateDims(this,t,e)},t.prototype._updateDims=function(t,e,n){for(var r=t._chunks,i=[],o=e.length,a=t.count(),s=[],l=t._rawExtent,u=0;u<e.length;u++)l[e[u]]=cs();for(var h=0;h<a;h++){for(var c=t.getRawIndex(h),d=0;d<o;d++)s[d]=r[e[d]][c];s[o]=h;var p=n&&n.apply(null,s);if(null!=p){"object"!=typeof p&&(i[0]=p,p=i);for(u=0;u<p.length;u++){var f=e[u],g=p[u],m=l[f],v=r[f];v&&(v[c]=g),g<m[0]&&(m[0]=g),g>m[1]&&(m[1]=g)}}}},t.prototype.lttbDownSample=function(t,e){var n,r,i,o=this.clone([t],!0),a=o._chunks[t],s=this.count(),l=0,u=Math.floor(1/e),h=this.getRawIndex(0),c=new(py(this._rawCount))(Math.min(2*(Math.ceil(s/u)+2),s));c[l++]=h;for(var d=1;d<s-1;d+=u){for(var p=Math.min(d+u,s-1),f=Math.min(d+2*u,s),g=(f+p)/2,m=0,v=p;v<f;v++){var y=a[M=this.getRawIndex(v)];isNaN(y)||(m+=y)}m/=f-p;var _=d,x=Math.min(d+u,s),b=d-1,w=a[h];n=-1,i=_;var S=-1,T=0;for(v=_;v<x;v++){var M;y=a[M=this.getRawIndex(v)];isNaN(y)?(T++,S<0&&(S=M)):(r=Math.abs((b-g)*(y-w)-(b-v)*(m-w)))>n&&(n=r,i=M)}T>0&&T<x-_&&(c[l++]=Math.min(S,i),i=Math.max(S,i)),c[l++]=i,h=i}return c[l++]=this.getRawIndex(s-1),o._count=l,o._indices=c,o.getRawIndex=this._getRawIdx,o},t.prototype.minmaxDownSample=function(t,e){for(var n=this.clone([t],!0),r=n._chunks,i=Math.floor(1/e),o=r[t],a=this.count(),s=new(py(this._rawCount))(2*Math.ceil(a/i)),l=0,u=0;u<a;u+=i){var h=u,c=o[this.getRawIndex(h)],d=u,p=o[this.getRawIndex(d)],f=i;u+i>a&&(f=a-u);for(var g=0;g<f;g++){var m=o[this.getRawIndex(u+g)];m<c&&(c=m,h=u+g),m>p&&(p=m,d=u+g)}var v=this.getRawIndex(h),y=this.getRawIndex(d);h<d?(s[l++]=v,s[l++]=y):(s[l++]=y,s[l++]=v)}return n._count=l,n._indices=s,n._updateGetRawIdx(),n},t.prototype.downSample=function(t,e,n,r){for(var i=this.clone([t],!0),o=i._chunks,a=[],s=Math.floor(1/e),l=o[t],u=this.count(),h=i._rawExtent[t]=[1/0,-1/0],c=new(py(this._rawCount))(Math.ceil(u/s)),d=0,p=0;p<u;p+=s){s>u-p&&(s=u-p,a.length=s);for(var f=0;f<s;f++){var g=this.getRawIndex(p+f);a[f]=l[g]}var m=n(a),v=this.getRawIndex(Math.min(p+r(a,m)||0,u-1));l[v]=m,m<h[0]&&(h[0]=m),m>h[1]&&(h[1]=m),c[d++]=v}return i._count=d,i._indices=c,i._updateGetRawIdx(),i},t.prototype.each=function(t,e){if(this._count)for(var n=t.length,r=this._chunks,i=0,o=this.count();i<o;i++){var a=this.getRawIndex(i);switch(n){case 0:e(i);break;case 1:e(r[t[0]][a],i);break;case 2:e(r[t[0]][a],r[t[1]][a],i);break;default:for(var s=0,l=[];s<n;s++)l[s]=r[t[s]][a];l[s]=i,e.apply(null,l)}}},t.prototype.getDataExtent=function(t,e){var n=this._chunks[t],r=[1/0,-1/0];if(!n)return r;var i=this.count();if(!this._indices&&!e)return this._rawExtent[t].slice();var o=this._extent,a=o[t]||(o[t]={}),s=Jv(e),l=s.key,u=a[l];if(u)return u.slice();for(var h=r[0],c=r[1],d=0;d<i;d++){var p=n[this.getRawIndex(d)];e&&!Qv(s,p)||(p<h&&(h=p),p>c&&(c=p))}return a[l]=[h,c]},t.prototype.getRawDataItem=function(t){var e=this.getRawIndex(t);if(this._provider.persistent)return this._provider.getItem(e);for(var n=[],r=this._chunks,i=0;i<r.length;i++)n.push(r[i][e]);return n},t.prototype.clone=function(e,n){var r=new t,i=this._chunks,o=e&&F(e,function(t,e){return t[e]=!0,t},{});if(o)for(var a=0;a<i.length;a++)r._chunks[a]=o[a]?fy(i[a]):i[a];else r._chunks=i;return this._copyCommonProps(r),n||(r._indices=this._cloneIndices()),r._updateGetRawIdx(),r},t.prototype._copyCommonProps=function(t){t._count=this._count,t._rawCount=this._rawCount,t._provider=this._provider,t._dimensions=this._dimensions,t._extent=I(this._extent),t._rawExtent=I(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var t=this._indices.constructor,e=void 0;if(t===Array){var n=this._indices.length;e=new t(n);for(var r=0;r<n;r++)e[r]=this._indices[r]}else e=new t(this._indices);return e}return null},t.prototype._getRawIdxIdentity=function(t){return t},t.prototype._getRawIdx=function(t){return t<this._count&&t>=0?this._indices[t]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=function(){function t(t,e,n,r){return Uv(t[r],this._dimensions[r])}sy={arrayRows:t,objectRows:function(t,e,n,r){return Uv(t[e],this._dimensions[r])},keyedColumns:t,original:function(t,e,n,r){var i=t&&(null==t.value?t:t.value);return Uv(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(t,e,n,r){return t[r]}}}(),t}(),vy=my,yy=function(){function t(t){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=t}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(t,e){this._sourceList=t,this._upstreamSignList=e,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 t,e,n=this._sourceHost,r=this._getUpstreamSourceManagers(),i=!!r.length;if(xy(n)){var o=n,a=void 0,s=void 0,l=void 0;if(i){var u=r[0];u.prepareSource(),a=(l=u.getSource()).data,s=l.sourceFormat,e=[u._getVersionSign()]}else s=$(a=o.get("data",!0))?lh:ih,e=[];var h=this._getSourceMetaRawOption()||{},c=l&&l.metaRawOption||{},d=at(h.seriesLayoutBy,c.seriesLayoutBy)||null,p=at(h.sourceHeader,c.sourceHeader),f=at(h.dimensions,c.dimensions);t=d!==c.seriesLayoutBy||!!p!=!!c.sourceHeader||f?[vv(a,{seriesLayoutBy:d,sourceHeader:p,dimensions:f},s)]:[]}else{var g=n;if(i){var m=this._applyTransform(r);t=m.sourceList,e=m.upstreamSignList}else{t=[vv(g.get("source",!0),this._getSourceMetaRawOption(),null)],e=[]}}ht(t&&e),this._setLocalSource(t,e)},t.prototype._applyTransform=function(t){var e,n=this._sourceHost,r=n.get("transform",!0),i=n.get("fromTransformResult",!0);if(ht(null!=i||null!=r),null!=i){1!==t.length&&by("When using `fromTransformResult`, there should be only one upstream dataset")}var o,a=[],s=[];return B(t,function(t){t.prepareSource();var e=t.getSource(i||0);null==i||e||by("Can not retrieve result by `fromTransformResult`: "+i),a.push(e),s.push(t._getVersionSign())}),r?e=function(t,e,n){var r=Ba(t),i=r.length;i||Na("If `transform` declared, it should at least contain one transform.");for(var o=0,a=i;o<a;o++)e=oy(r[o],e,n,1===i?null:o),o!==a-1&&(e.length=Math.max(e.length,1));return e}(r,a,{datasetIndex:n.componentIndex}):null!=i&&(e=[(o=a[0],new gv({data:o.data,sourceFormat:o.sourceFormat,seriesLayoutBy:o.seriesLayoutBy,dimensionsDefine:I(o.dimensionsDefine),startIndex:o.startIndex,dimensionsDetectedCount:o.dimensionsDetectedCount}))]),{sourceList:e,upstreamSignList:s}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var t=this._getUpstreamSourceManagers(),e=0;e<t.length;e++){var n=t[e];if(n._isDirty()||this._upstreamSignList[e]!==n._getVersionSign())return!0}},t.prototype.getSource=function(t){t=t||0;var e=this._sourceList[t];if(!e){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(t)}return e},t.prototype.getSharedDataStore=function(t){ht(xy(this._sourceHost),"Can only call getDataStore on series source manager.");var e=t.makeStoreSchema();return this._innerGetDataStore(e.dimensions,t.source,e.hash)},t.prototype._innerGetDataStore=function(t,e,n){var r=this._storeList,i=r[0];i||(i=r[0]={});var o=i[n];if(!o){var a=this._getUpstreamSourceManagers()[0];xy(this._sourceHost)&&a?o=a._innerGetDataStore(t,e,n):(o=new vy).initData(new Sv(e,t.length),t),i[n]=o}return o},t.prototype._getUpstreamSourceManagers=function(){var t=this._sourceHost;if(xy(t)){var e=vm(t);return e?[e.getSourceManager()]:[]}return V(function(t){return t.get("transform",!0)||t.get("fromTransformResult",!0)?is(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},ns).models:[]}(t),function(t){return t.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var t,e,n,r=this._sourceHost;if(xy(r))t=r.get("seriesLayoutBy",!0),e=r.get("sourceHeader",!0),n=r.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var i=r;t=i.get("seriesLayoutBy",!0),e=i.get("sourceHeader",!0),n=i.get("dimensions",!0)}return{seriesLayoutBy:t,sourceHeader:e,dimensions:n}},t}();function _y(t){t.option.transform&&pt(t.option.transform)}function xy(t){return"series"===t.mainType}function by(t){throw new Error(t)}function wy(t){var e=t.lineHeight;return null==e?"line-height:1":"line-height:"+ue(e+"")+"px"}function Sy(t,e){var n=t.color||om.color.tertiary,r=t.fontSize||12,i=t.fontWeight||"400",o=t.color||om.color.secondary,a=t.fontSize||14,s=t.fontWeight||"900";return"html"===e?{nameStyle:"font-size:"+ue(r+"")+"px;color:"+ue(n)+";font-weight:"+ue(i+""),valueStyle:"font-size:"+ue(a+"")+"px;color:"+ue(o)+";font-weight:"+ue(s+"")}:{nameStyle:{fontSize:r,fill:n,fontWeight:i},valueStyle:{fontSize:a,fill:o,fontWeight:s}}}var Ty=[0,10,20,30],My=["","\n","\n\n","\n\n\n"];function Cy(t,e){return e.type=t,e}function Iy(t){return"section"===t.type}function Ay(t){return Iy(t)?Ly:Py}function Dy(t){if(Iy(t)){var e=0,n=t.blocks.length,r=n>1||n>0&&!t.noHeader;return B(t.blocks,function(t){var n=Dy(t);n>=e&&(e=n+ +(r&&(!n||Iy(t)&&!t.noHeader)))}),e}return 0}function Ly(t,e,n,r){var i,o=e.noHeader,a=(i=Dy(e),{html:Ty[i],richText:My[i]}),s=[],l=e.blocks||[];ht(!l||j(l)),l=l||[];var u=t.orderMode;if(e.sortBlocks&&u){l=l.slice();var h={valueAsc:"asc",valueDesc:"desc"};if(wt(h,u)){var c=new Yv(h[u],null);l.sort(function(t,e){return c.evaluate(t.sortParam,e.sortParam)})}else"seriesDesc"===u&&l.reverse()}B(l,function(n,i){var o=e.valueFormatter,l=Ay(n)(o?L(L({},t),{valueFormatter:o}):t,n,i>0?a.html:0,r);null!=l&&s.push(l)});var d="richText"===t.renderMode?s.join(a.richText):Oy(r,s.join(""),o?n:a.html);if(o)return d;var p=yg(e.header,"ordinal",t.useUTC),f=Sy(r,t.renderMode).nameStyle,g=wy(r);return"richText"===t.renderMode?Ny(t,p,f)+a.richText+d:Oy(r,'<div style="'+f+";"+g+';">'+ue(p)+"</div>"+d,n)}function Py(t,e,n,r){var i=t.renderMode,o=e.noName,a=e.noValue,s=!e.markerType,l=e.name,u=t.useUTC,h=e.valueFormatter||t.valueFormatter||function(t){return V(t=j(t)?t:[t],function(t,e){return yg(t,j(p)?p[e]:p,u)})};if(!o||!a){var c=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||om.color.secondary,i),d=o?"":yg(l,"ordinal",u),p=e.valueType,f=a?[]:h(e.value,e.rawDataIndex),g=!s||!o,m=!s&&o,v=Sy(r,i),y=v.nameStyle,_=v.valueStyle;return"richText"===i?(s?"":c)+(o?"":Ny(t,d,y))+(a?"":function(t,e,n,r,i){var o=[i],a=r?10:20;return n&&o.push({padding:[0,0,0,a],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(j(e)?e.join(" "):e,o)}(t,f,g,m,_)):Oy(r,(s?"":c)+(o?"":function(t,e,n){return'<span style="'+n+";"+(e?"margin-left:2px":"")+'">'+ue(t)+"</span>"}(d,!s,y))+(a?"":function(t,e,n,r){var i=n?"10px":"20px",o=e?"float:right;margin-left:"+i:"";return t=j(t)?t:[t],'<span style="'+o+";"+r+'">'+V(t,function(t){return ue(t)}).join(" ")+"</span>"}(f,g,m,_)),n)}}function Ey(t,e,n,r,i,o){if(t)return Ay(t)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:e,valueFormatter:t.valueFormatter},t,0,o)}function Oy(t,e,n){return'<div style="'+("margin: "+n+"px 0 0")+";"+wy(t)+';">'+e+'<div style="clear:both"></div></div>'}function Ny(t,e,n){return t.markupStyleCreator.wrapRichTextStyle(e,n)}function Ry(t,e){return Mg(t.getData().getItemVisual(e,"style")[t.visualDrawType])}function ky(t,e){var n=t.get("padding");return null!=n?n:"richText"===e?[8,10]:10}var zy=function(){function t(){this.richTextStyles={},this._nextStyleNameId=ba()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(t,e,n){var r="richText"===n?this._generateStyleName():null,i=Sg({color:e,type:t,renderMode:n,markerId:r});return Y(i)?i:(ht(r),this.richTextStyles[r]=i.style,i.content)},t.prototype.wrapRichTextStyle=function(t,e){var n={};j(e)?B(e,function(t){return L(n,t)}):L(n,e);var r=this._generateStyleName();return this.richTextStyles[r]=n,"{"+r+"|"+t+"}"},t}();function By(t){var e,n,r,i,o=t.series,a=t.dataIndex,s=t.multipleSeries,l=o.getData(),u=l.mapDimensionsAll("defaultedTooltip"),h=u.length,c=o.getRawValue(a),d=j(c),p=Ry(o,a);if(h>1||d&&!h){var f=function(t,e,n,r,i){var o=e.getData(),a=F(t,function(t,e,n){var r=o.getDimensionInfo(n);return t||r&&!1!==r.tooltip&&null!=r.displayName},!1),s=[],l=[],u=[];function h(t,e){var n=o.getDimensionInfo(e);n&&!1!==n.otherDims.tooltip&&(a?u.push(Cy("nameValue",{markerType:"subItem",markerColor:i,name:n.displayName,value:t,valueType:n.type})):(s.push(t),l.push(n.type)))}return r.length?B(r,function(t){h(kv(o,n,t),t)}):B(t,h),{inlineValues:s,inlineValueTypes:l,blocks:u}}(c,o,a,u,p);e=f.inlineValues,n=f.inlineValueTypes,r=f.blocks,i=f.inlineValues[0]}else if(h){var g=l.getDimensionInfo(u[0]);i=e=kv(l,a,u[0]),n=g.type}else i=e=d?c[0]:c;var m=qa(o),v=m&&o.name||"",y=l.getName(a),_=s?v:y;return Cy("section",{header:v,noHeader:s||!m,sortParam:i,blocks:[Cy("nameValue",{markerType:"item",markerColor:p,name:_,noName:!ct(_),value:e,valueType:n,rawDataIndex:l.getRawIndex(a)})].concat(r||[])})}var Vy=Qa();function Fy(t,e){return t.getName(e)||t.getId(e)}var Gy="__universalTransitionEnabled",Hy=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._selectedDataIndicesMap={},e}return e(n,t),n.prototype.init=function(t,e,n){this.seriesIndex=this.componentIndex,this.dataTask=Fv({count:Wy,reset:Xy}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,n),(Vy(this).sourceManager=new yy(this)).prepareSource();var r=this.getInitialData(t,n);Zy(r,this),this.dataTask.context.data=r,ht(r,"getInitialData returned invalid data."),Vy(this).dataBeforeProcessed=r,Uy(this),this._initSelectedMapFromData(r)},n.prototype.mergeDefaultAndTheme=function(t,e){var n=Yg(this),r=n?Kg(t):{},i=this.subType;tm.hasClass(i)&&(i+="Series"),A(t,e.getTheme().get(this.subType)),A(t,this.getDefaultOption()),Va(t,"label",["show"]),this.fillDataTextStyle(t.data),n&&qg(t,r,n)},n.prototype.mergeOption=function(t,e){t=A(this.option,t,!0),this.fillDataTextStyle(t.data);var n=Yg(this);n&&qg(this.option,t,n);var r=Vy(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(t,e);Zy(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,Vy(this).dataBeforeProcessed=i,Uy(this),this._initSelectedMapFromData(i)},n.prototype.fillDataTextStyle=function(t){if(t&&!$(t))for(var e=["show"],n=0;n<t.length;n++)t[n]&&t[n].label&&Va(t[n],"label",e)},n.prototype.getInitialData=function(t,e){},n.prototype.appendData=function(t){this.getRawData().appendData(t.data)},n.prototype.getData=function(t){var e=qy(this);if(e){var n=e.context.data;return null!=t&&n.getLinkedData?n.getLinkedData(t):n}return Vy(this).data},n.prototype.getAllData=function(){var t=this.getData();return t&&t.getLinkedDataAll?t.getLinkedDataAll():[{data:t}]},n.prototype.setData=function(t){var e=qy(this);if(e){var n=e.context;n.outputData=t,e!==this.dataTask&&(n.data=t)}Vy(this).data=t},n.prototype.getEncode=function(){var t=this.get("encode",!0);if(t)return yt(t)},n.prototype.getSourceManager=function(){return Vy(this).sourceManager},n.prototype.getSource=function(){return this.getSourceManager().getSource()},n.prototype.getRawData=function(){return Vy(this).dataBeforeProcessed},n.prototype.getColorBy=function(){return this.get("colorBy")||"series"},n.prototype.isColorBySeries=function(){return"series"===this.getColorBy()},n.prototype.getBaseAxis=function(){var t=this.coordinateSystem;return t&&t.getBaseAxis&&t.getBaseAxis()},n.prototype.indicesOfNearest=function(t,e,n,r){var i=this.getData(),o=this.coordinateSystem,a=o&&o.getAxis(t);if(!o||!a)return[];var s=a.dataToCoord(n);null==r&&(r=1/0);for(var l=[],u=1/0,h=-1,c=0,d=i.getDimensionIndex(e),p=i.getStore(),f=0,g=p.count();f<g;f++){var m=p.get(d,f),v=s-a.dataToCoord(m),y=Math.abs(v);y<=r&&((y<u||y===u&&v>=0&&h<0)&&(u=y,h=v,c=0),v===h&&(l[c++]=f))}return l.length=c,l},n.prototype.formatTooltip=function(t,e,n){return By({series:this,dataIndex:t,multipleSeries:e})},n.prototype.isAnimationEnabled=function(){var t=this.ecModel;if(i.node&&(!t||!t.ssr))return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),!!e},n.prototype.restoreData=function(){this.dataTask.dirty()},n.prototype.getColorFromPalette=function(t,e,n){var r=this.ecModel,i=Cm.prototype.getColorFromPalette.call(this,t,e,n);return i||(i=r.getColorFromPalette(t,e,n)),i},n.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},n.prototype.getProgressive=function(){return this.get("progressive")},n.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},n.prototype.select=function(t,e){this._innerSelect(this.getData(e),t)},n.prototype.unselect=function(t,e){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(e);if("series"===r||"all"===n)return this.option.selectedMap={},void(this._selectedDataIndicesMap={});for(var o=0;o<t.length;o++){var a=Fy(i,t[o]);n[a]=!1,this._selectedDataIndicesMap[a]=-1}}},n.prototype.toggleSelect=function(t,e){for(var n=[],r=0;r<t.length;r++)n[0]=t[r],this.isSelected(t[r],e)?this.unselect(n,e):this.select(n,e)},n.prototype.getSelectedDataIndices=function(){if("all"===this.option.selectedMap)return[].slice.call(this.getData().getIndices());for(var t=this._selectedDataIndicesMap,e=U(t),n=[],r=0;r<e.length;r++){var i=t[e[r]];i>=0&&n.push(i)}return n},n.prototype.isSelected=function(t,e){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(e);return("all"===n||n[Fy(r,t)])&&!r.getItemModel(t).get(["select","disabled"])},n.prototype.isUniversalTransitionEnabled=function(){if(this[Gy])return!0;var t=this.option.universalTransition;return!!t&&(!0===t||t&&t.enabled)},n.prototype._innerSelect=function(t,e){var n,r,i=this.option,o=i.selectedMode,a=e.length;if(o&&a)if("series"===o)i.selectedMap="all";else if("multiple"===o){J(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,l=0;l<a;l++){var u=e[l];s[c=Fy(t,u)]=!0,this._selectedDataIndicesMap[c]=t.getRawIndex(u)}}else if("single"===o||!0===o){var h=e[a-1],c=Fy(t,h);i.selectedMap=((n={})[c]=!0,n),this._selectedDataIndicesMap=((r={})[c]=t.getRawIndex(h),r)}},n.prototype._initSelectedMapFromData=function(t){if(!this.option.selectedMap){var e=[];t.hasItemOption&&t.each(function(n){var r=t.getRawDataItem(n);r&&r.selected&&e.push(n)}),e.length>0&&this._innerSelect(t,e)}},n.registerClass=function(t){return tm.registerClass(t)},n.protoInitialize=function(){var t=n.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),n}(tm);function Uy(t){var e=t.name;qa(t)||(t.name=function(t){var e=t.getRawData(),n=e.mapDimensionsAll("seriesName"),r=[];return B(n,function(t){var n=e.getDimensionInfo(t);n.displayName&&r.push(n.displayName)}),r.join(" ")}(t)||e)}function Wy(t){return t.model.getRawData().count()}function Xy(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),jy}function jy(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Zy(t,e){B(_t(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(n){t.wrapMethod(n,X(Yy,e))})}function Yy(t,e){var n=qy(t);return n&&n.setOutputEnd((e||this).count()),e}function qy(t){var e=(t.ecModel||{}).scheduler,n=e&&e.getPipeline(t.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(t.uid))}return r}}k(Hy,Bv),k(Hy,Cm),Es(Hy,tm);var Ky=Hy,Jy=function(){function t(){this.group=new Do,this.uid=wf("viewComponent")}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,r){},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,r){},t.prototype.updateLayout=function(t,e,n,r){},t.prototype.updateVisual=function(t,e,n,r){},t.prototype.toggleBlurSeries=function(t,e,n){},t.prototype.eachRendered=function(t){var e=this.group;e&&e.traverse(t)},t}();Ps(Jy),ks(Jy);var Qy=Jy;function $y(){var t=Qa();return function(e){var n=t(e),r=e.pipelineContext,i=!!n.large,o=!!n.progressiveRender,a=n.large=!(!r||!r.large),s=n.progressiveRender=!(!r||!r.progressiveRender);return!(i===a&&o===s)&&"reset"}}var t_=Qa(),e_=$y(),n_=function(){function t(){this.group=new Do,this.uid=wf("viewChart"),this.renderTask=Fv({plan:o_,reset:a_}),this.renderTask.context={view:this}}return t.prototype.init=function(t,e){},t.prototype.render=function(t,e,n,r){throw new Error("render method must been implemented")},t.prototype.highlight=function(t,e,n,r){var i=t.getData(r&&r.dataType);i?i_(i,r,"emphasis"):La("Unknown dataType "+r.dataType)},t.prototype.downplay=function(t,e,n,r){var i=t.getData(r&&r.dataType);i?i_(i,r,"normal"):La("Unknown dataType "+r.dataType)},t.prototype.remove=function(t,e){this.group.removeAll()},t.prototype.dispose=function(t,e){},t.prototype.updateView=function(t,e,n,r){this.render(t,e,n,r)},t.prototype.updateVisual=function(t,e,n,r){this.render(t,e,n,r)},t.prototype.eachRendered=function(t){Dp(this.group,t)},t.markUpdateMethod=function(t,e){t_(t).updateMethod=e},t.protoInitialize=void(t.prototype.type="chart"),t}();function r_(t,e,n){t&&hc(t)&&("emphasis"===e?Wh:Xh)(t,n)}function i_(t,e,n){var r=Ja(t,e),i=e&&null!=e.highlightKey?function(t){var e=vh[t];return null==e&&mh<=32&&(e=vh[t]=mh++),e}(e.highlightKey):null;null!=r?B(Ba(r),function(e){r_(t.getItemGraphicEl(e),n,i)}):t.eachItemGraphicEl(function(t){r_(t,n,i)})}function o_(t){return e_(t.model)}function a_(t){var e=t.model,n=t.ecModel,r=t.api,i=t.payload,o=e.pipelineContext.progressiveRender,a=t.view,s=i&&t_(i).updateMethod,l=o?"incrementalPrepareRender":s&&a[s]?s:"render";return"render"!==l&&a[l](e,n,r,i),s_[l]}Ps(n_,["dispose"]),ks(n_);var s_={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)}}},l_=n_,u_="\0__throttleOriginMethod",h_="\0__throttleRate",c_="\0__throttleType";function d_(t,e,n){var r,i,o,a,s,l=0,u=0,h=null;function c(){u=(new Date).getTime(),h=null,t.apply(o,a||[])}e=e||0;var d=function(){for(var t=[],d=0;d<arguments.length;d++)t[d]=arguments[d];r=(new Date).getTime(),o=this,a=t;var p=s||e,f=s||n;s=null,i=r-(f?l:u)-p,clearTimeout(h),f?h=setTimeout(c,p):i>=0?c():h=setTimeout(c,-i),l=r};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(t){s=t},d}function p_(t,e,n,r){var i=t[e];if(i){var o=i[u_]||i,a=i[c_];if(i[h_]!==n||a!==r){if(null==n||!r)return t[e]=o;(i=t[e]=d_(o,n,"debounce"===r))[u_]=o,i[c_]=r,i[h_]=n}return i}}function f_(t,e){var n=t[e];n&&n[u_]&&(n.clear&&n.clear(),t[e]=n[u_])}var g_=Qa(),m_={itemStyle:zs(mf,!0),lineStyle:zs(pf,!0)},v_={lineStyle:"stroke",itemStyle:"fill"};function y_(t,e){var n=t.visualStyleMapper||m_[e];return n||(console.warn("Unknown style type '"+e+"'."),m_.itemStyle)}function __(t,e){var n=t.visualDrawType||v_[e];return n||(console.warn("Unknown style type '"+e+"'."),"fill")}var x_={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData(),r=t.visualStyleAccessPath||"itemStyle",i=t.getModel(r),o=y_(t,r)(i),a=i.getShallow("decal");a&&(n.setVisual("decal",a),a.dirty=!0);var s=__(t,r),l=o[s],u=Z(l)?l:null,h="auto"===o.fill||"auto"===o.stroke;if(!o[s]||u||h){var c=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[s]||(o[s]=c,n.setVisual("colorFromPalette",!0)),o.fill="auto"===o.fill||Z(o.fill)?c:o.fill,o.stroke="auto"===o.stroke||Z(o.stroke)?c:o.stroke}if(n.setVisual("style",o),n.setVisual("drawType",s),!e.isSeriesFiltered(t)&&u)return n.setVisual("colorFromPalette",!1),{dataEach:function(e,n){var r=t.getDataParams(n),i=L({},o);i[s]=u(r),e.setItemVisual(n,"style",i)}}}},b_=new xf,w_={createOnAllSeries:!0,reset:function(t,e){if(!t.ignoreStyleOnData){var n=t.getData(),r=t.visualStyleAccessPath||"itemStyle",i=y_(t,r),o=n.getVisual("drawType");return{dataEach:n.hasItemOption?function(t,e){var n=t.getRawDataItem(e);if(n&&n[r]){b_.option=n[r];var a=i(b_);L(t.ensureUniqueItemVisual(e,"style"),a),b_.option.decal&&(t.setItemVisual(e,"decal",b_.option.decal),b_.option.decal.dirty=!0),o in a&&t.setItemVisual(e,"colorFromPalette",!1)}}:null}}}},S_={performRawSeries:!0,overallReset:function(t){var e=yt();t.eachSeries(function(t){if(!t.isColorBySeries()){var n=t.type+"-"+t.getColorBy();g_(t).scope=e.get(n)||e.set(n,{})}}),t.eachSeries(function(t){if(!t.isColorBySeries()){var e=t.getRawData(),n={},r=t.getData(),i=g_(t).scope,o=t.visualStyleAccessPath||"itemStyle",a=__(t,o);r.each(function(t){var e=r.getRawIndex(t);n[e]=t}),e.each(function(o){var s=n[o];if(r.getItemVisual(s,"colorFromPalette")){var l=r.ensureUniqueItemVisual(s,"style"),u=e.getName(o)||o+"",h=e.count();l[a]=t.getColorFromPalette(u,i,h)}})}})}},T_=Math.PI;var M_=function(){function t(t,e,n,r){this._stageTaskMap=yt(),this.ecInstance=t,this.api=e,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return t.prototype.restoreData=function(t,e){t.restoreData(e),this._stageTaskMap.each(function(t){var e=t.overallTask;e&&e.dirty()})},t.prototype.getPerformArgs=function(t,e){if(t.__pipeline){var n=this._pipelineMap.get(t.__pipeline.id),r=n.context,i=!e&&n.progressiveEnabled&&(!r||r.progressiveRender)&&t.__idxInPipeline>n.blockIndex?n.step:null,o=r&&r.modDataCount;return{step:i,modBy:null!=o?Math.ceil(o/i):null,modDataCount:o}}},t.prototype.getPipeline=function(t){return this._pipelineMap.get(t)},t.prototype.updateStreamModes=function(t,e){var n=this._pipelineMap.get(t.uid),r=t.__preparePipelineContext?t.__preparePipelineContext(e,n):Ts(t,e,n);t.pipelineContext=n.context=r},t.prototype.restorePipelines=function(t,e){var n=this,r=n._pipelineMap=yt();e.eachSeries(function(e){var i="canvas"===t.painter.type&&e.getProgressive(),o=e.uid;r.set(o,{id:o,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:i&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),n._pipe(e,e.dataTask)})},t.prototype.prepareStageTasks=function(){var t=this._stageTaskMap,e=this.api.getModel(),n=this.api;B(this._allHandlers,function(r){var i=t.get(r.uid)||t.set(r.uid,{});ht(!(r.reset&&r.overallReset),'"reset" and "overallReset" must not be both specified.'),r.reset&&this._createSeriesStageTask(r,i,e,n),r.overallReset&&this._createOverallStageTask(r,i,e,n)},this)},t.prototype.prepareView=function(t,e,n,r){var i=t.renderTask,o=i.context;o.model=e,o.ecModel=n,o.api=r,i.__block=!t.incrementalPrepareRender,this._pipe(e,i)},t.prototype.performDataProcessorTasks=function(t,e){this._performStageTasks(this._dataProcessorHandlers,t,e,{block:!0})},t.prototype.performVisualTasks=function(t,e,n){this._performStageTasks(this._visualHandlers,t,e,n)},t.prototype._performStageTasks=function(t,e,n,r){r=r||{};var i=!1,o=this;function a(t,e){return t.setDirty&&(!t.dirtyMap||t.dirtyMap.get(e.__pipeline.id))}B(t,function(t,s){if(!r.visualType||r.visualType===t.visualType){var l=o._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each(function(t){a(r,t)&&(t.dirty(),c=!0)}),c&&h.dirty(),o.updatePayload(h,n);var p=o.getPerformArgs(h,r.block);d.each(function(t){t.perform(p)}),h.perform(p)&&(i=!0)}else u&&u.each(function(s,l){a(r,s)&&s.dirty();var u=o.getPerformArgs(s,r.block);u.skip=!t.performRawSeries&&e.isSeriesFiltered(s.context.model),o.updatePayload(s,n),s.perform(u)&&(i=!0)})}}),this.unfinished=i||this.unfinished},t.prototype.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e=t.dataTask.perform()||e}),this.unfinished=e||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})},t.prototype.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)},t.prototype._createSeriesStageTask=function(t,e,n,r){var i=this,o=e.seriesTaskMap,a=e.seriesTaskMap=yt(),s=t.seriesType,l=t.getTargetSeries;function u(e){var s=e.uid,l=a.set(s,o&&o.get(s)||Fv({plan:L_,reset:P_,count:N_}));l.context={model:e,ecModel:n,api:r,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:i},i._pipe(e,l)}t.createOnAllSeries?n.eachRawSeries(u):s?n.eachRawSeriesByType(s,u):l&&l(n,r).each(u)},t.prototype._createOverallStageTask=function(t,e,n,r){var i=this,o=e.overallTask=e.overallTask||Fv({reset:C_});o.context={ecModel:n,api:r,overallReset:t.overallReset,scheduler:i};var a=o.agentStubMap,s=o.agentStubMap=yt(),l=t.seriesType,u=t.getTargetSeries,h=t.dirtyOnOverallProgress,c=!1;function d(t){var e=t.uid,n=s.set(e,a&&a.get(e)||(c=!0,Fv({reset:I_,onDirty:D_})));n.context={model:t,dirtyOnOverallProgress:h},n.agent=o,n.__block=h,i._pipe(t,n)}ht(!t.createOnAllSeries,'"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'),l?n.eachRawSeriesByType(l,d):u?u(n,r).each(d):B(n.getSeries(),d),c&&o.dirty()},t.prototype._pipe=function(t,e){var n=t.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=e),r.tail&&r.tail.pipe(e),r.tail=e,e.__idxInPipeline=r.count++,e.__pipeline=r},t.wrapStageHandler=function(t,e){return Z(t)&&(t={overallReset:t,seriesType:R_(t)}),t.uid=wf("stageHandler"),e&&(t.visualType=e),t},t}();function C_(t){t.overallReset(t.ecModel,t.api,t.payload)}function I_(t){return t.dirtyOnOverallProgress&&A_}function A_(){this.agent.dirty(),this.getDownstream().dirty()}function D_(){this.agent&&this.agent.dirty()}function L_(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function P_(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Ba(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?V(e,function(t,e){return O_(e)}):E_}var E_=O_(0);function O_(t){return function(e,n){var r=n.data,i=n.resetDefines[t];if(i&&i.dataEach)for(var o=e.start;o<e.end;o++)i.dataEach(r,o);else i&&i.progress&&i.progress(e,r)}}function N_(t){return t.data.count()}function R_(t){k_=null;try{t(z_,B_)}catch(t){}return k_}var k_,z_={},B_={};function V_(t,e){for(var n in e.prototype)t[n]=St}V_(z_,zm),V_(B_,gh),z_.eachSeriesByType=z_.eachRawSeriesByType=function(t){k_=t},z_.eachComponent=function(t){"series"===t.mainType&&t.subType&&(k_=t.subType)};var F_,G_=M_,H_=om.darkColor,U_=H_.background,W_=function(){return{axisLine:{lineStyle:{color:H_.axisLine}},splitLine:{lineStyle:{color:H_.axisSplitLine}},splitArea:{areaStyle:{color:[H_.backgroundTint,H_.backgroundTransparent]}},minorSplitLine:{lineStyle:{color:H_.axisMinorSplitLine}},axisLabel:{color:H_.axisLabel},axisName:{}}},X_={label:{color:H_.secondary},itemStyle:{borderColor:H_.borderTint},dividerLineStyle:{color:H_.border}},j_={darkMode:!0,color:H_.theme,backgroundColor:U_,axisPointer:{lineStyle:{color:H_.border},crossStyle:{color:H_.borderShade},label:{color:H_.tertiary}},legend:{textStyle:{color:H_.secondary},pageTextStyle:{color:H_.tertiary}},textStyle:{color:H_.secondary},title:{textStyle:{color:H_.primary},subtextStyle:{color:H_.quaternary}},toolbox:{iconStyle:{borderColor:H_.accent50},feature:{dataView:{backgroundColor:U_,textColor:H_.primary,textareaColor:H_.background,textareaBorderColor:H_.border,buttonColor:H_.accent50,buttonTextColor:H_.neutral00}}},tooltip:{backgroundColor:H_.neutral20,defaultBorderColor:H_.border,textStyle:{color:H_.tertiary}},dataZoom:{borderColor:H_.accent10,textStyle:{color:H_.tertiary},brushStyle:{color:H_.backgroundTint},handleStyle:{color:H_.neutral00,borderColor:H_.accent20},moveHandleStyle:{color:H_.accent40},emphasis:{handleStyle:{borderColor:H_.accent50}},dataBackground:{lineStyle:{color:H_.accent30},areaStyle:{color:H_.accent20}},selectedDataBackground:{lineStyle:{color:H_.accent50},areaStyle:{color:H_.accent30}}},visualMap:{textStyle:{color:H_.secondary},handleStyle:{borderColor:H_.neutral30}},timeline:{lineStyle:{color:H_.accent10},label:{color:H_.tertiary},controlStyle:{color:H_.accent30,borderColor:H_.accent30}},calendar:{itemStyle:{color:H_.neutral00,borderColor:H_.neutral20},dayLabel:{color:H_.tertiary},monthLabel:{color:H_.secondary},yearLabel:{color:H_.secondary}},matrix:{x:X_,y:X_,backgroundColor:{borderColor:H_.axisLine},body:{itemStyle:{borderColor:H_.borderTint}}},timeAxis:W_(),logAxis:W_(),valueAxis:W_(),categoryAxis:W_(),line:{symbol:"circle"},graph:{color:H_.theme},gauge:{title:{color:H_.secondary},axisLine:{lineStyle:{color:[[1,H_.neutral05]]}},axisLabel:{color:H_.axisLabel},detail:{color:H_.primary}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}},funnel:{itemStyle:{borderColor:H_.background}},radar:(F_=W_(),F_.axisName={color:H_.axisLabel},F_.axisLine.lineStyle.color=H_.neutral20,F_),treemap:{breadcrumb:{itemStyle:{color:H_.neutral20,textStyle:{color:H_.secondary}},emphasis:{itemStyle:{color:H_.neutral30}}}},sunburst:{itemStyle:{borderColor:H_.background}},map:{itemStyle:{borderColor:H_.border,areaColor:H_.neutral10},label:{color:H_.tertiary},emphasis:{label:{color:H_.primary},itemStyle:{areaColor:H_.highlight}},select:{label:{color:H_.primary},itemStyle:{areaColor:H_.highlight}}},geo:{itemStyle:{borderColor:H_.border,areaColor:H_.neutral10},emphasis:{label:{color:H_.primary},itemStyle:{areaColor:H_.highlight}},select:{label:{color:H_.primary},itemStyle:{color:H_.highlight}}}};j_.categoryAxis.splitLine.show=!1;var Z_=j_,Y_=function(){function t(){}return t.prototype.normalizeQuery=function(t){var e={},n={},r={};if(Y(t)){var i=Ls(t);e.mainType=i.main||null,e.subType=i.sub||null}else{var o=["Index","Name","Id"],a={name:1,dataIndex:1,dataType:1};B(t,function(t,i){for(var s=!1,l=0;l<o.length;l++){var u=o[l],h=i.lastIndexOf(u);if(h>0&&h===i.length-u.length){var c=i.slice(0,h);"data"!==c&&(e.mainType=c,e[u.toLowerCase()]=t,s=!0)}}a.hasOwnProperty(i)&&(n[i]=t,s=!0),s||(r[i]=t)})}return{cptQuery:e,dataQuery:n,otherQuery:r}},t.prototype.filter=function(t,e){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,o=n.model,a=n.view;if(!o||!a)return!0;var s=e.cptQuery,l=e.dataQuery;return u(s,o,"mainType")&&u(s,o,"subType")&&u(s,o,"index","componentIndex")&&u(s,o,"name")&&u(s,o,"id")&&u(l,i,"name")&&u(l,i,"dataIndex")&&u(l,i,"dataType")&&(!a.filterForExposedEvent||a.filterForExposedEvent(t,e.otherQuery,r,i));function u(t,e,n,r){return null==t[n]||e[r||n]===t[n]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t}(),q_=["symbol","symbolSize","symbolRotate","symbolOffset"],K_=q_.concat(["symbolKeepAspect"]),J_={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var n=t.getData();if(t.legendIcon&&n.setVisual("legendIcon",t.legendIcon),t.hasSymbolVisual){for(var r={},i={},o=!1,a=0;a<q_.length;a++){var s=q_[a],l=t.get(s);Z(l)?(o=!0,i[s]=l):r[s]=l}if(r.symbol=r.symbol||t.defaultSymbol,n.setVisual(L({legendIcon:t.legendIcon||r.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},r)),!e.isSeriesFiltered(t)){var u=U(i);return{dataEach:o?function(e,n){for(var r=t.getRawValue(n),o=t.getDataParams(n),a=0;a<u.length;a++){var s=u[a];e.setItemVisual(n,s,i[s](r,o))}}:null}}}}},Q_={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(t.hasSymbolVisual&&!e.isSeriesFiltered(t))return{dataEach:t.getData().hasItemOption?function(t,e){for(var n=t.getItemModel(e),r=0;r<K_.length;r++){var i=K_[r],o=n.getShallow(i,!0);null!=o&&t.setItemVisual(e,i,o)}}:null}}};function $_(t,e,n){switch(n){case"color":return t.getItemVisual(e,"style")[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,n);default:console.warn("Unknown visual type "+n)}}function tx(t,e){switch(e){case"color":return t.getVisual("style")[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e);default:console.warn("Unknown visual type "+e)}}function ex(t,e,n,r){switch(n){case"color":t.ensureUniqueItemVisual(e,"style")[t.getVisual("drawType")]=r,t.setItemVisual(e,"colorFromPalette",!1);break;case"opacity":t.ensureUniqueItemVisual(e,"style").opacity=r;break;case"symbol":case"symbolSize":case"liftZ":t.setItemVisual(e,n,r);break;default:console.warn("Unknown visual type "+n)}}function nx(t,e){function n(e,n){var r=[];return e.eachComponent({mainType:"series",subType:t,query:n},function(t){r.push(t.seriesIndex)}),r}B([[t+"ToggleSelect","toggleSelect"],[t+"Select","select"],[t+"UnSelect","unselect"]],function(t){e(t[0],function(e,r,i){Ea((e=L({},e)).type,t[1]),i.dispatchAction(L(e,{type:t[1],seriesIndex:n(r,e)}))})})}function rx(t,e,n,r,i){var o=t+e;n.isSilent(o)||(Pa("event "+o+" is deprecated."),r.eachComponent({mainType:"series",subType:"pie"},function(t){for(var e=t.seriesIndex,r=t.option.selectedMap,a=i.selected,s=0;s<a.length;s++)if(a[s].seriesIndex===e){var l=t.getData(),u=Ja(l,i.fromActionPayload);n.trigger(o,{type:o,seriesId:t.id,name:j(u)?l.getName(u[0]):l.getName(u),selected:Y(r)?r:L({},r)})}}))}function ix(t,e,n){for(var r;t&&(!e(t)||(r=t,!n));)t=t.__hostTarget||t.parent;return r}var ox=new $t,ax={};function sx(t){return ax[t]||La("Implementation of "+t+" doesn't exists."),ax[t]}var lx={};function ux(t,e){lx[t]=e}var hx=Qa();function cx(t){return hx(t).prepare}function dx(t){return hx(t).fullUpdate}var px=Math.round(9*Math.random()),fx="function"==typeof Object.defineProperty,gx=function(){function t(){this._id="__ec_inner_"+px++}return t.prototype.get=function(t){return this._guard(t)[this._id]},t.prototype.set=function(t,e){var n=this._guard(t);return fx?Object.defineProperty(n,this._id,{value:e,enumerable:!1,configurable:!0}):n[this._id]=e,this},t.prototype.delete=function(t){return!!this.has(t)&&(delete this._guard(t)[this._id],!0)},t.prototype.has=function(t){return!!this._guard(t)[this._id]},t.prototype._guard=function(t){if(t!==Object(t))throw TypeError("Value of WeakMap is not a non-null object.");return t},t}(),mx=gx,vx=xu.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,r=e.cy,i=e.width/2,o=e.height/2;t.moveTo(n,r-o),t.lineTo(n+i,r+o),t.lineTo(n-i,r+o),t.closePath()}}),yx=xu.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var n=e.cx,r=e.cy,i=e.width/2,o=e.height/2;t.moveTo(n,r-o),t.lineTo(n+i,r),t.lineTo(n,r+o),t.lineTo(n-i,r),t.closePath()}}),_x=xu.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.x,r=e.y,i=e.width/5*3,o=Math.max(i,e.height),a=i/2,s=a*a/(o-a),l=r-o+a+s,u=Math.asin(s/a),h=Math.cos(u)*a,c=Math.sin(u),d=Math.cos(u),p=.6*a,f=.7*a;t.moveTo(n-h,l+s),t.arc(n,l,a,Math.PI-u,2*Math.PI+u),t.bezierCurveTo(n+h-c*p,l+s+d*p,n,r-f,n,r),t.bezierCurveTo(n,r-f,n-h+c*p,l+s+d*p,n-h,l+s),t.closePath()}}),xx=xu.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var n=e.height,r=e.width,i=e.x,o=e.y,a=r/3*2;t.moveTo(i,o),t.lineTo(i+a,o+n),t.lineTo(i,o+n/4*3),t.lineTo(i-a,o+n),t.lineTo(i,o),t.closePath()}}),bx={line:function(t,e,n,r,i){i.x1=t,i.y1=e+r/2,i.x2=t+n,i.y2=e+r/2},rect:function(t,e,n,r,i){i.x=t,i.y=e,i.width=n,i.height=r},roundRect:function(t,e,n,r,i){i.x=t,i.y=e,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(t,e,n,r,i){var o=Math.min(n,r);i.x=t,i.y=e,i.width=o,i.height=o},circle:function(t,e,n,r,i){i.cx=t+n/2,i.cy=e+r/2,i.r=Math.min(n,r)/2},diamond:function(t,e,n,r,i){i.cx=t+n/2,i.cy=e+r/2,i.width=n,i.height=r},pin:function(t,e,n,r,i){i.x=t+n/2,i.y=e+r/2,i.width=n,i.height=r},arrow:function(t,e,n,r,i){i.x=t+n/2,i.y=e+r/2,i.width=n,i.height=r},triangle:function(t,e,n,r,i){i.cx=t+n/2,i.cy=e+r/2,i.width=n,i.height=r}},Sx={};B({line:fd,rect:Ru,roundRect:Ru,square:Ru,circle:Rc,diamond:yx,pin:_x,arrow:xx,triangle:vx},function(t,e){Sx[e]=new t});var Tx=xu.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,n){var r=co(t,e,n),i=this.shape;return i&&"pin"===i.symbolType&&"inside"===e.position&&(r.y=n.y+.4*n.height),r},buildPath:function(t,e,n){var r=e.symbolType;if("none"!==r){var i=Sx[r];i||(i=Sx[r="rect"]),bx[r](e.x,e.y,e.width,e.height,i.shape),i.buildPath(t,i.shape,n)}}});function Mx(t,e){if("image"!==this.type){var n=this.style;this.__isEmptyBrush?(n.stroke=t,n.fill=e||om.color.neutral00,n.lineWidth=2):"line"===this.shape.symbolType?n.stroke=t:n.fill=t,this.markRedraw()}}function Cx(t,e,n,r,i,o,a){var s,l=0===t.indexOf("empty");return l&&(t=t.substr(5,1).toLowerCase()+t.substr(6)),(s=0===t.indexOf("image://")?sp(t.slice(8),new ln(e,n,r,i),a?"center":"cover"):0===t.indexOf("path://")?ap(t.slice(7),{},new ln(e,n,r,i),a?"center":"cover"):new Tx({shape:{symbolType:t,x:e,y:n,width:r,height:i}})).__isEmptyBrush=l,s.setColor=Mx,o&&s.setColor(o),s}function Ix(t){return j(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function Ax(t,e){if(null!=t)return j(t)||(t=[t,t]),[Qo(t[0],e[0])||0,Qo(at(t[1],t[0]),e[1])||0]}function Dx(t){return isFinite(t)}function Lx(t,e,n){for(var r="radial"===e.type?function(t,e,n){var r=n.width,i=n.height,o=Math.min(r,i),a=null==e.x?.5:e.x,s=null==e.y?.5:e.y,l=null==e.r?.5:e.r;return e.global||(a=a*r+n.x,s=s*i+n.y,l*=o),a=Dx(a)?a:.5,s=Dx(s)?s:.5,l=l>=0&&Dx(l)?l:.5,t.createRadialGradient(a,s,0,a,s,l)}(t,e,n):function(t,e,n){var r=null==e.x?0:e.x,i=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(r=r*n.width+n.x,i=i*n.width+n.x,o=o*n.height+n.y,a=a*n.height+n.y),r=Dx(r)?r:0,i=Dx(i)?i:1,o=Dx(o)?o:0,a=Dx(a)?a:0,t.createLinearGradient(r,o,i,a)}(t,e,n),i=e.colorStops,o=0;o<i.length;o++)r.addColorStop(i[o].offset,i[o].color);return r}function Px(t){return parseInt(t,10)}function Ex(t,e,n){var r=["width","height"][e],i=["clientWidth","clientHeight"][e],o=["paddingLeft","paddingTop"][e],a=["paddingRight","paddingBottom"][e];if(null!=n[r]&&"auto"!==n[r])return parseFloat(n[r]);var s=document.defaultView.getComputedStyle(t);return(t[i]||Px(s[r])||Px(t.style[r]))-(Px(s[o])||0)-(Px(s[a])||0)||0}function Ox(t){var e,n,r=t.style,i=r.lineDash&&r.lineWidth>0&&(e=r.lineDash,n=r.lineWidth,e&&"solid"!==e&&n>0?"dashed"===e?[4*n,2*n]:"dotted"===e?[n]:K(e)?[e]:j(e)?e:null:null),o=r.lineDashOffset;if(i){var a=r.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(i=V(i,function(t){return t/a}),o/=a)}return[i,o]}var Nx=new Ql(!0);function Rx(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function kx(t){return"string"==typeof t&&"none"!==t}function zx(t){var e=t.fill;return null!=e&&"none"!==e}function Bx(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var n=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=n}else t.fill()}function Vx(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var n=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=n}else t.stroke()}function Fx(t,e,n){var r=Hs(e.image,e.__image,n);if(Ws(r)){var i=t.createPattern(r,e.repeat||"repeat");if("function"==typeof DOMMatrix&&i&&i.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*Tt),o.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(o)}return i}}var Gx=["shadowBlur","shadowOffsetX","shadowOffsetY"],Hx=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function Ux(t,e,n,r,i){var o=!1;if(!r&&e===(n=n||{}))return!1;if(r||e.opacity!==n.opacity){jx(t,i),o=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?hl.opacity:a}(r||e.blend!==n.blend)&&(o||(jx(t,i),o=!0),t.globalCompositeOperation=e.blend||hl.blend);for(var s=0;s<Gx.length;s++){var l=Gx[s];(r||e[l]!==n[l])&&(o||(jx(t,i),o=!0),t[l]=t.dpr*(e[l]||0))}return(r||e.shadowColor!==n.shadowColor)&&(o||(jx(t,i),o=!0),t.shadowColor=e.shadowColor||hl.shadowColor),o}function Wx(t,e,n,r,i){var o=e.style,a=r?null:n&&n.style||{};if(o===a)return!1;var s=Ux(t,o,a,r,i);if((r||o.fill!==a.fill)&&(s||(jx(t,i),s=!0),kx(o.fill)&&(t.fillStyle=o.fill)),(r||o.stroke!==a.stroke)&&(s||(jx(t,i),s=!0),kx(o.stroke)&&(t.strokeStyle=o.stroke)),(r||o.opacity!==a.opacity)&&(s||(jx(t,i),s=!0),t.globalAlpha=null==o.opacity?1:o.opacity),e.hasStroke()){var l=o.lineWidth/(o.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==l&&(s||(jx(t,i),s=!0),t.lineWidth=l)}for(var u=0;u<Hx.length;u++){var h=Hx[u],c=h[0];(r||o[c]!==a[c])&&(s||(jx(t,i),s=!0),t[c]=o[c]||h[1])}return s}function Xx(t,e){var n=e.transform,r=t.dpr||1;n?t.setTransform(r*n[0],r*n[1],r*n[2],r*n[3],r*n[4],r*n[5]):t.setTransform(r,0,0,r,0,0)}function jx(t,e){e.batchFill&&(e.batchFill=!1,t.fill()),e.batchStroke&&(e.batchStroke=!1,t.stroke())}function Zx(t,e){var n={inHover:!1,viewWidth:0,viewHeight:0,beforeBrushParam:{}};Yx(t,e,n),qx(t,n)}function Yx(t,e,n){var r=e.transform;if(!e.shouldBePainted(n.viewWidth,n.viewHeight,!1,!1))return e.__dirty&=-2,void(e.__isRendered=!1);var i=e.__clipPaths,o=n.prevElClipPaths,s=e.style,l=!1,u=!1;if(o&&!function(t,e){if(t===e||!t&&!e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!0;return!1}(i,o)||(o&&(jx(t,n),t.restore(),u=l=!0,n.prevElClipPaths=null,n.allClipped=!1,n.prevEl=null),i&&i.length&&(jx(t,n),t.save(),function(t,e,n){for(var r=!1,i=0;i<t.length;i++){var o=t[i];r=r||o.isZeroArea(),Xx(e,o),e.beginPath(),o.buildPath(e,o.shape),e.clip()}n.allClipped=r}(i,t,n),l=!0,n.prevElClipPaths=i)),n.allClipped)return e.__dirty&=-2,void(e.__isRendered=!1);e.beforeBrush&&e.beforeBrush(n.beforeBrushParam),e.innerBeforeBrush();var h=n.prevEl;h||(u=l=!0);var c,d,p=e instanceof xu&&e.autoBatch&&function(t){var e=zx(t),n=Rx(t);return!(t.lineDash||!(+e^+n)||e&&"string"!=typeof t.fill||n&&"string"!=typeof t.stroke||t.strokePercent<1||t.strokeOpacity<1||t.fillOpacity<1)}(s);l||(c=r,d=h.transform,c&&d?c[0]!==d[0]||c[1]!==d[1]||c[2]!==d[2]||c[3]!==d[3]||c[4]!==d[4]||c[5]!==d[5]:c||d)?(jx(t,n),Xx(t,e)):p||jx(t,n),e instanceof xu?(1!==n.lastDrawType&&(u=!0,n.lastDrawType=1),Wx(t,e,h,u,n),p&&(n.batchFill||n.batchStroke)||t.beginPath(),function(t,e,n,r,i){var o,a=Rx(n),s=zx(n),l=n.strokePercent,u=l<1,h=!e.path;e.silent&&!u||!h||e.createPathProxy();var c=e.path||Nx,d=e.__dirty;if(!r){var p=n.fill,f=n.stroke,g=s&&!!p.colorStops,m=a&&!!f.colorStops,v=s&&!!p.image,y=a&&!!f.image,_=void 0,x=void 0,b=void 0,w=void 0,S=void 0;(g||m)&&(S=e.getBoundingRect()),g&&(_=d?Lx(t,p,S):e.__canvasFillGradient,e.__canvasFillGradient=_),m&&(x=d?Lx(t,f,S):e.__canvasStrokeGradient,e.__canvasStrokeGradient=x),v&&(b=d||!e.__canvasFillPattern?Fx(t,p,e):e.__canvasFillPattern,e.__canvasFillPattern=b),y&&(w=d||!e.__canvasStrokePattern?Fx(t,f,e):e.__canvasStrokePattern,e.__canvasStrokePattern=w),g?t.fillStyle=_:v&&(b?t.fillStyle=b:s=!1),m?t.strokeStyle=x:y&&(w?t.strokeStyle=w:a=!1)}var T,M,C=e.getGlobalScale();c.setScale(C[0],C[1],e.segmentIgnoreThreshold),t.setLineDash&&n.lineDash&&(T=(o=Ox(e))[0],M=o[1]);var I=!0;(h||4&d)&&(c.setDPR(t.dpr),u?c.setContext(null):(c.setContext(t),I=!1),c.reset(),e.buildPath(c,e.shape,r),c.toStatic(),e.pathUpdated()),I&&c.rebuildPath(t,u?l:1),T&&(t.setLineDash(T),t.lineDashOffset=M),r?(i.batchFill=s,i.batchStroke=a):n.strokeFirst?(a&&Vx(t,n),s&&Bx(t,n)):(s&&Bx(t,n),a&&Vx(t,n)),T&&t.setLineDash([])}(t,e,s,p,n)):e instanceof Su?(3!==n.lastDrawType&&(u=!0,n.lastDrawType=3),Wx(t,e,h,u,n),function(t,e,n){var r,i=n.text;if(null!=i&&(i+=""),i){t.font=n.font||a,t.textAlign=n.textAlign,t.textBaseline=n.textBaseline;var o=void 0,s=void 0;t.setLineDash&&n.lineDash&&(o=(r=Ox(e))[0],s=r[1]),o&&(t.setLineDash(o),t.lineDashOffset=s),n.strokeFirst?(Rx(n)&&t.strokeText(i,n.x,n.y),zx(n)&&t.fillText(i,n.x,n.y)):(zx(n)&&t.fillText(i,n.x,n.y),Rx(n)&&t.strokeText(i,n.x,n.y)),o&&t.setLineDash([])}}(t,e,s)):e instanceof Iu?(2!==n.lastDrawType&&(u=!0,n.lastDrawType=2),function(t,e,n,r,i){Ux(t,e.style,n&&n.style,r,i)}(t,e,h,u,n),function(t,e,n){var r=e.__image=Hs(n.image,e.__image,e,e.onload);if(r&&Ws(r)){var i=n.x||0,o=n.y||0,a=e.getWidth(),s=e.getHeight(),l=r.width/r.height;if(null==a&&null!=s?a=s*l:null==s&&null!=a?s=a/l:null==a&&null==s&&(a=r.width,s=r.height),n.sWidth&&n.sHeight){var u=n.sx||0,h=n.sy||0;t.drawImage(r,u,h,n.sWidth,n.sHeight,i,o,a,s)}else if(n.sx&&n.sy){var c=a-(u=n.sx),d=s-(h=n.sy);t.drawImage(r,u,h,c,d,i,o,a,s)}else t.drawImage(r,i,o,a,s)}}(t,e,s)):e.getTemporalDisplayables&&(4!==n.lastDrawType&&(u=!0,n.lastDrawType=4),function(t,e,n){var r=e.getDisplayables(),i=e.getTemporalDisplayables();t.save();var o,a,s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:n.viewWidth,viewHeight:n.viewHeight,inHover:n.inHover,beforeBrushParam:{}};for(o=e.getCursor(),a=r.length;o<a;o++){(h=r[o]).beforeBrush&&h.beforeBrush(n.beforeBrushParam),h.innerBeforeBrush(),Yx(t,h,s),h.innerAfterBrush(),h.afterBrush&&h.afterBrush(),s.prevEl=h}qx(t,s);for(var l=0,u=i.length;l<u;l++){var h;(h=i[l]).beforeBrush&&h.beforeBrush(n.beforeBrushParam),h.innerBeforeBrush(),Yx(t,h,s),h.innerAfterBrush(),h.afterBrush&&h.afterBrush(),s.prevEl=h}qx(t,s),e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}(t,e,n)),e.innerAfterBrush(),e.afterBrush&&(p&&jx(t,n),e.afterBrush()),n.prevEl=e,e.__dirty=0,e.__isRendered=!0}function qx(t,e){jx(t,e),e.prevElClipPaths&&t.restore()}var Kx=new mx,Jx=new hr(100),Qx=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function $x(t,e){if("none"===t)return null;var n=e.getDevicePixelRatio(),r=e.getZr(),i="svg"===r.painter.type;t.dirty&&Kx.delete(t);var o=Kx.get(t);if(o)return o;var a=E(t,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===a.backgroundColor&&(a.backgroundColor=null);var s={repeat:"repeat"};return function(t){for(var e,o=[n],s=!0,l=0;l<Qx.length;++l){var u=a[Qx[l]];if(null!=u&&!j(u)&&!Y(u)&&!K(u)&&"boolean"!=typeof u){s=!1;break}o.push(u)}if(s){e=o.join(",")+(i?"-svg":"");var c=Jx.get(e);c&&(i?t.svgElement=c:t.image=c)}var d,p=eb(a.dashArrayX),f=function(t){if(!t||"object"==typeof t&&0===t.length)return[0,0];if(K(t)){var e=Math.ceil(t);return[e,e]}var n=V(t,function(t){return Math.ceil(t)});return t.length%2?n.concat(n):n}(a.dashArrayY),g=tb(a.symbol),m=(b=p,V(b,function(t){return nb(t)})),v=nb(f),y=!i&&h.createCanvas(),_=i&&{tag:"g",attrs:{},key:"dcl",children:[]},x=function(){for(var t=1,e=0,n=m.length;e<n;++e)t=Sa(t,m[e]);var r=1;for(e=0,n=g.length;e<n;++e)r=Sa(r,g[e].length);t*=r;var i=v*m.length*g.length,o=function(t){console.warn("Calculated decal size is greater than "+t+" due to decal option settings so "+t+" is used for the decal size. Please consider changing the decal option to make a smaller decal or set "+t+" to be larger to avoid incontinuity.")};t>a.maxTileWidth&&o("maxTileWidth");i>a.maxTileHeight&&o("maxTileHeight");return{width:Math.max(1,Math.min(t,a.maxTileWidth)),height:Math.max(1,Math.min(i,a.maxTileHeight))}}();var b;y&&(y.width=x.width*n,y.height=x.height*n,d=y.getContext("2d"));(function(){d&&(d.clearRect(0,0,y.width,y.height),a.backgroundColor&&(d.fillStyle=a.backgroundColor,d.fillRect(0,0,y.width,y.height)));for(var t=0,e=0;e<f.length;++e)t+=f[e];if(t<=0)return;var o=-v,s=0,l=0,u=0;for(;o<x.height;){if(s%2==0){for(var h=l/2%g.length,c=0,m=0,b=0;c<2*x.width;){var w=0;for(e=0;e<p[u].length;++e)w+=p[u][e];if(w<=0)break;if(m%2==0){var S=.5*(1-a.symbolSize),T=c+p[u][m]*S,M=o+f[s]*S,C=p[u][m]*a.symbolSize,I=f[s]*a.symbolSize,A=b/2%g[h].length;D(T,M,C,I,g[h][A])}c+=p[u][m],++b,++m===p[u].length&&(m=0)}++u===p.length&&(u=0)}o+=f[s],++l,++s===f.length&&(s=0)}function D(t,e,o,s,l){var u=i?1:n,h=Cx(l,t*u,e*u,o*u,s*u,a.color,a.symbolKeepAspect);if(i){var c=r.painter.renderOneToVNode(h);c&&_.children.push(c)}else Zx(d,h)}})(),s&&Jx.put(e,y||_);t.image=y,t.svgElement=_,t.svgWidth=x.width,t.svgHeight=x.height}(s),s.rotation=a.rotation,s.scaleX=s.scaleY=i?1:1/n,Kx.set(t,s),t.dirty=!1,s}function tb(t){if(!t||0===t.length)return[["rect"]];if(Y(t))return[[t]];for(var e=!0,n=0;n<t.length;++n)if(!Y(t[n])){e=!1;break}if(e)return tb([t]);var r=[];for(n=0;n<t.length;++n)Y(t[n])?r.push([t[n]]):r.push(t[n]);return r}function eb(t){if(!t||0===t.length)return[[0,0]];if(K(t))return[[i=Math.ceil(t),i]];for(var e=!0,n=0;n<t.length;++n)if(!K(t[n])){e=!1;break}if(e)return eb([t]);var r=[];for(n=0;n<t.length;++n)if(K(t[n])){var i=Math.ceil(t[n]);r.push([i,i])}else{(i=V(t[n],function(t){return Math.ceil(t)})).length%2==1?r.push(i.concat(i)):r.push(i)}return r}function nb(t){for(var e=0,n=0;n<t.length;++n)e+=t[n];return t.length%2==1?2*e:e}var rb=Is(function(t,e){t.eachRawSeries(function(n){if(!t.isSeriesFiltered(n)){var r=n.getData();r.hasItemVisual()&&r.each(function(t){var n=r.getItemVisual(t,"decal");n&&(r.ensureUniqueItemVisual(t,"style").decal=$x(n,e))});var i=r.getVisual("decal");if(i)r.getVisual("style").decal=$x(i,e)}})});var ib="6.1.0",ob={zrender:"6.1.0"},ab=2e3,sb=4500,lb={PROCESSOR:{SERIES_FILTER:800,AXIS_STATISTICS:920,FILTER:1e3,STATISTIC:5e3,STATISTICS:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:ab,CHART:3e3,POST_CHART_LAYOUT:4600,COMPONENT:4e3,BRUSH:5e3,CHART_ITEM:sb,ARIA:6e3,DECAL:7e3}},ub="__flagInMainProcess",hb="__mainProcessVersion",cb="__pendingUpdate",db="__needsUpdateStatus",pb=/^[a-zA-Z0-9_]+$/,fb="__connectUpdateStatus";function gb(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!this.isDisposed())return vb(this,t,e);Hb(this.id)}}function mb(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return vb(this,t,e)}}function vb(t,e,n){return n[0]=n[0]&&n[0].toLowerCase(),$t.prototype[e].apply(t,n)}var yb,_b,xb,bb,wb,Sb,Tb,Mb,Cb,Ib,Ab,Db,Lb,Pb,Eb,Ob,Nb,Rb,kb,zb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n}($t),Bb=zb.prototype;Bb.on=mb("on"),Bb.off=mb("off");var Vb=function(t){function n(e,n,r){var o=t.call(this,new Y_)||this;o._chartsViews=[],o._chartsMap={},o._componentsViews=[],o._componentsMap={},o._pendingActions=[],r=r||{},o.__v_skip=!0,o._dom=e;var a="canvas",s="auto",l=!1;o[hb]=1;var u=i.hasGlobalWindow?window:global;u&&(a=at(u.__ECHARTS__DEFAULT__RENDERER__,a),s=at(u.__ECHARTS__DEFAULT__COARSE_POINTER,s),l=at(u.__ECHARTS__DEFAULT__USE_DIRTY_RECT__,l)),r.ssr&&zo(function(t){var e=$u(t),n=e.dataIndex;if(null!=n){var r=yt();return r.set("series_index",e.seriesIndex),r.set("data_index",n),e.ssrType&&r.set("ssr_type",e.ssrType),r}});var h=o._zr=No(e,{renderer:r.renderer||a,devicePixelRatio:r.devicePixelRatio,width:r.width,height:r.height,ssr:r.ssr,useDirtyRect:at(r.useDirtyRect,l),useCoarsePointer:at(r.useCoarsePointer,s),pointerSize:r.pointerSize});o._ssr=r.ssr,o._throttledZrFlush=d_(W(h.flush,h),17),o._updateTheme(n),o._locale=function(t){if(Y(t)){var e=If[t.toUpperCase()]||{};return t===Tf||t===Mf?I(e):A(I(e),I(If[Cf]),!1)}return A(I(t),I(If[Cf]),!1)}(r.locale||Df),o._coordSysMgr=new Rg;var c=o._api=Eb(o);function d(t,e){return t.__prio-e.__prio}return Mn(Yb,d),Mn(jb,d),o._scheduler=new G_(o,c,jb,Yb),o._messageCenter=new zb,o._initEvents(),o.resize=W(o.resize,o),h.animation.on("frame",o._onframe,o),Ib(h,o),Ab(h,o),pt(o),o}return e(n,t),n.prototype._onframe=function(){if(!this._disposed){var t=this._scheduler,e=this._model,n=this._api;if(Rb(this),this[cb]){var r=this[cb].silent;this[ub]=!0,kb(this);try{yb(this),bb.update.call(this,null,this[cb].updateParams)}catch(t){throw this[ub]=!1,this[cb]=null,t}this._zr.flush(),this[ub]=!1,this[cb]=null,Mb.call(this,r),Cb.call(this,r)}else if(t.unfinished){var i=1;do{t.unfinished=!1;var o=h.getTime();t.performSeriesTasks(e),t.performDataProcessorTasks(e),Sb(this,e),t.performVisualTasks(e),Pb(this,this._model,n,"remain",{}),i-=h.getTime()-o}while(i>0&&t.unfinished);t.unfinished||this._zr.flush()}}},n.prototype.getDom=function(){return this._dom},n.prototype.getId=function(){return this.id},n.prototype.getZr=function(){return this._zr},n.prototype.isSSR=function(){return this._ssr},n.prototype.setOption=function(t,e,n){if(this[ub])La("`setOption` should not be called during main process.");else if(this._disposed)Hb(this.id);else{var r,i,o;if(J(e)&&(n=e.lazyUpdate,r=e.silent,i=e.replaceMerge,o=e.transition,e=e.notMerge),this[ub]=!0,kb(this),!this._model||e){var a=new Gm(this._api),s=this._theme,l=this._model=new zm;l.scheduler=this._scheduler,l.ssr=this._ssr,l.init(null,null,null,s,this._locale,a)}this._model.setOption(t,{replaceMerge:i},Zb);var u={seriesTransition:o,optionChanged:!0};if(n)this[cb]={silent:r,updateParams:u},this[ub]=!1,this.getZr().wakeUp();else{try{yb(this),bb.update.call(this,null,u)}catch(t){throw this[cb]=null,this[ub]=!1,t}this._ssr||this._zr.flush(),this[cb]=null,this[ub]=!1,Mb.call(this,r),Cb.call(this,r)}}},n.prototype.setTheme=function(t,e){if(this[ub])La("`setTheme` should not be called during main process.");else if(this._disposed)Hb(this.id);else{var n=this._model;if(n){var r=e&&e.silent,i=null;this[cb]&&(null==r&&(r=this[cb].silent),i=this[cb].updateParams,this[cb]=null),this[ub]=!0,kb(this);try{this._updateTheme(t),n.setTheme(this._theme),yb(this),bb.update.call(this,{type:"setTheme"},i)}catch(t){throw this[ub]=!1,t}this[ub]=!1,Mb.call(this,r),Cb.call(this,r)}}},n.prototype._updateTheme=function(t){Y(t)&&(t=qb[t]),t&&((t=I(t))&&sv(t,!0),this._theme=t)},n.prototype.getModel=function(){return this._model},n.prototype.getOption=function(){return this._model&&this._model.getOption()},n.prototype.getWidth=function(){return this._zr.getWidth()},n.prototype.getHeight=function(){return this._zr.getHeight()},n.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||i.hasGlobalWindow&&window.devicePixelRatio||1},n.prototype.getRenderedCanvas=function(t){return Ea("getRenderedCanvas","renderToCanvas"),this.renderToCanvas(t)},n.prototype.renderToCanvas=function(t){t=t||{};var e=this._zr.painter;if("canvas"!==e.type)throw new Error("renderToCanvas can only be used in the canvas renderer.");return e.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},n.prototype.renderToSVGString=function(t){t=t||{};var e=this._zr.painter;if("svg"!==e.type)throw new Error("renderToSVGString can only be used in the svg renderer.");return e.renderToString({useViewBox:t.useViewBox})},n.prototype.getSvgDataURL=function(){var t=this._zr;return B(t.storage.getDisplayList(),function(t){t.stopAnimation(null,!0)}),t.painter.toDataURL()},n.prototype.getDataURL=function(t){if(!this._disposed){var e=(t=t||{}).excludeComponents,n=this._model,r=[],i=this;B(e,function(t){n.eachComponent({mainType:t},function(t){var e=i._componentsMap[t.__viewId];e.group.ignore||(r.push(e),e.group.ignore=!0)})});var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return B(r,function(t){t.group.ignore=!1}),o}Hb(this.id)},n.prototype.getConnectedDataURL=function(t){if(!this._disposed){var e="svg"===t.type,n=this.group,r=Math.min,i=Math.max,o=1/0;if(Qb[n]){var a=o,s=o,l=-1/0,u=-1/0,c=[],d=t&&t.pixelRatio||this.getDevicePixelRatio();B(Jb,function(o,h){if(o.group===n){var d=e?o.getZr().painter.getSvgDom().innerHTML:o.renderToCanvas(I(t)),p=o.getDom().getBoundingClientRect();a=r(p.left,a),s=r(p.top,s),l=i(p.right,l),u=i(p.bottom,u),c.push({dom:d,left:p.left,top:p.top})}});var p=(l*=d)-(a*=d),f=(u*=d)-(s*=d),g=h.createCanvas(),m=No(g,{renderer:e?"svg":"canvas"});if(m.resize({width:p,height:f}),e){var v="";return B(c,function(t){var e=t.left-a,n=t.top-s;v+='<g transform="translate('+e+","+n+')">'+t.dom+"</g>"}),m.painter.getSvgRoot().innerHTML=v,t.connectedBackgroundColor&&m.painter.setBackgroundColor(t.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}return t.connectedBackgroundColor&&m.add(new Ru({shape:{x:0,y:0,width:p,height:f},style:{fill:t.connectedBackgroundColor}})),B(c,function(t){var e=new Iu({style:{x:t.left*d-a,y:t.top*d-s,image:t.dom}});m.add(e)}),m.refreshImmediately(),g.toDataURL("image/"+(t&&t.type||"png"))}return this.getDataURL(t)}Hb(this.id)},n.prototype.convertToPixel=function(t,e,n){return wb(this,"convertToPixel",t,e,n)},n.prototype.convertToLayout=function(t,e,n){return wb(this,"convertToLayout",t,e,n)},n.prototype.convertFromPixel=function(t,e,n){return wb(this,"convertFromPixel",t,e,n)},n.prototype.containPixel=function(t,e){var n;if(!this._disposed)return B(ts(this._model,t),function(t,r){r.indexOf("Models")>=0&&B(t,function(t){var i=t.coordinateSystem;if(i&&i.containPoint)n=n||!!i.containPoint(e);else if("seriesModels"===r){var o=this._chartsMap[t.__viewId];o&&o.containPoint?n=n||o.containPoint(e,t):Da(r+": "+(o?"The found component do not support containPoint.":"No view mapping to the found component."))}else Da(r+": containPoint is not supported")},this)},this),!!n;Hb(this.id)},n.prototype.getVisual=function(t,e){var n=ts(this._model,t,{defaultMainType:"series"}),r=n.seriesModel;r||Da("There is no specified series model");var i=r.getData(),o=n.hasOwnProperty("dataIndexInside")?n.dataIndexInside:n.hasOwnProperty("dataIndex")?i.indexOfRawIndex(n.dataIndex):null;return null!=o?$_(i,o,e):tx(i,e)},n.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},n.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},n.prototype._initEvents=function(){var t=this;B(Gb,function(e){var n=function(n){var r,i=t.getModel(),o=n.target,a="globalout"===e;if(a?r={}:o&&ix(o,function(t){var e=$u(t);if(e&&null!=e.dataIndex){var n=e.dataModel||i.getSeriesByIndex(e.seriesIndex);return r=n&&n.getDataParams(e.dataIndex,e.dataType,o)||{},!0}if(e.eventData)return r=L({},e.eventData),!0},!0),r){var s=r.componentType,l=r.componentIndex;"markLine"!==s&&"markPoint"!==s&&"markArea"!==s||(s="series",l=r.seriesIndex);var u=s&&null!=l&&i.getComponent(s,l),h=u&&t["series"===u.mainType?"_chartsMap":"_componentsMap"][u.__viewId];a||u&&h||Da("model or view can not be found by params"),r.event=n,r.type=e,t._$eventProcessor.eventInfo={targetEl:o,packedEvent:r,model:u,view:h},t.trigger(e,r)}};n.zrEventfulCallAtLast=!0,t._zr.on(e,n,t)});var e=this._messageCenter;B(Xb,function(n,r){e.on(r,function(e){t.trigger(r,e)})}),function(t,e,n){t.on("selectchanged",function(t){var r=n.getModel();t.isFromClick?(rx("map","selectchanged",e,r,t),rx("pie","selectchanged",e,r,t)):"select"===t.fromAction?(rx("map","selected",e,r,t),rx("pie","selected",e,r,t)):"unselect"===t.fromAction&&(rx("map","unselected",e,r,t),rx("pie","unselected",e,r,t))})}(e,this,this._api)},n.prototype.isDisposed=function(){return this._disposed},n.prototype.clear=function(){this._disposed?Hb(this.id):this.setOption({series:[]},!0)},n.prototype.dispose=function(){if(this._disposed)Hb(this.id);else{this._disposed=!0,this.getDom()&&as(this.getDom(),ew,"");var t=this,e=t._api,n=t._model;B(t._componentsViews,function(t){t.dispose(n,e)}),B(t._chartsViews,function(t){t.dispose(n,e)}),t._zr.dispose(),t._dom=t._model=t._chartsMap=t._componentsMap=t._chartsViews=t._componentsViews=t._scheduler=t._api=t._zr=t._throttledZrFlush=t._theme=t._coordSysMgr=t._messageCenter=null,delete Jb[t.id]}},n.prototype.resize=function(t){if(this[ub])La("`resize` should not be called during main process.");else if(this._disposed)Hb(this.id);else{this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var n=e.resetOption("media"),r=t&&t.silent;this[cb]&&(null==r&&(r=this[cb].silent),n=!0,this[cb]=null),this[ub]=!0,kb(this);try{n&&yb(this),bb.update.call(this,{type:"resize",animation:L({duration:0},t&&t.animation)})}catch(t){throw this[ub]=!1,t}this[ub]=!1,Mb.call(this,r),Cb.call(this,r)}}},n.prototype.showLoading=function(t,e){if(this._disposed)Hb(this.id);else if(J(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),Kb[t]){var n=Kb[t](this._api,e),r=this._zr;this._loadingFX=n,r.add(n)}else Da("Loading effects "+t+" not exists.")},n.prototype.hideLoading=function(){this._disposed?Hb(this.id):(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},n.prototype.makeActionFromEvent=function(t){var e=L({},t);return e.type=Wb[t.type],e},n.prototype.dispatchAction=function(t,e){if(this._disposed)Hb(this.id);else if(J(e)||(e={silent:!!e}),Ub[t.type]&&this._model)if(this[ub])this._pendingActions.push(t);else{var n=e.silent;Tb.call(this,t,n);var r=e.flush;r?this._zr.flush():!1!==r&&i.browser.weChat&&this._throttledZrFlush(),Mb.call(this,n),Cb.call(this,n)}},n.prototype.updateLabelLayout=function(){ox.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},n.prototype.appendData=function(t){if(this._disposed)Hb(this.id);else{var e=t.seriesIndex,n=this.getModel().getSeriesByIndex(e);ht(t.data&&n),n.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()}},n.internalField=function(){function t(t){t.clearColorPalette(),t.eachSeries(function(t){t.clearColorPalette()})}function n(t){for(var e=[],n=t.currentStates,r=0;r<n.length;r++){var i=n[r];"emphasis"!==i&&"blur"!==i&&"select"!==i&&e.push(i)}t.selected&&t.states.select&&e.push("select"),2===t.hoverState&&t.states.emphasis?e.push("emphasis"):1===t.hoverState&&t.states.blur&&e.push("blur"),t.useStates(e)}function r(t,e){if(!t.preventAutoZ){var n=Np(t);e.eachRendered(function(t){return kp(t,n.z,n.zlevel),!0})}}function o(t,e){e.eachRendered(function(t){if(!Zd(t)){var e=t.getTextContent(),n=t.getTextGuideLine();t.stateTransition&&(t.stateTransition=null),e&&e.stateTransition&&(e.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),t.hasState()?(t.prevStates=t.currentStates,t.clearStates()):t.prevStates&&(t.prevStates=null)}})}function a(t,e){var r=t.getModel("stateAnimation"),i=t.isAnimationEnabled(),o=r.get("duration"),a=o>0?{duration:o,delay:r.get("delay"),easing:r.get("easing")}:null;e.eachRendered(function(t){if(t.states&&t.states.emphasis){if(Zd(t))return;if(t instanceof xu&&function(t){var e=yh(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var n=t.states.select||{};e.selectFill=n.style&&n.style.fill||null,e.selectStroke=n.style&&n.style.stroke||null}(t),t.__dirty){var e=t.prevStates;e&&t.useStates(e)}if(i){t.stateTransition=a;var r=t.getTextContent(),o=t.getTextGuideLine();r&&(r.stateTransition=a),o&&(o.stateTransition=a)}t.__dirty&&n(t)}})}yb=function(t){var e;e=t._model,hx(e).prepare={};var n=t._scheduler;n.restorePipelines(t._zr,t._model),n.prepareStageTasks(),_b(t,!0),_b(t,!1),n.plan()},_b=function(t,e){for(var n=t._model,r=t._scheduler,i=e?t._componentsViews:t._chartsViews,o=e?t._componentsMap:t._chartsMap,a=t._zr,s=t._api,l=0;l<i.length;l++)i[l].__alive=!1;function u(t){var l=t.__requireNewView;t.__requireNewView=!1;var u="_ec_"+t.id+"_"+t.type,h=!l&&o[u];if(!h){var c=Ls(t.type),d=e?Qy.getClass(c.main,c.sub):l_.getClass(c.sub);ht(d,c.sub+" does not exist."),(h=new d).init(n,s),o[u]=h,i.push(h),a.add(h.group)}t.__viewId=h.__id=u,h.__alive=!0,h.__model=t,h.group.__ecComponentInfo={mainType:t.mainType,index:t.componentIndex},!e&&r.prepareView(h,t,n,s)}e?n.eachComponent(function(t,e){"series"!==t&&u(e)}):n.eachSeries(u);for(l=0;l<i.length;){var h=i[l];h.__alive?l++:(!e&&h.renderTask.dispose(),a.remove(h.group),h.dispose(n,s),i.splice(l,1),o[h.__id]===h&&delete o[h.__id],h.__id=h.group.__ecComponentInfo=null)}},xb=function(t,e,n,r,i){var o=t._model;if(o.setUpdatePayload(n),r){var a,s=os(n,r,i),l=n.excludeSeriesId;null!=l&&(a=yt(),B(Ba(l),function(t){var e=ja(t,null);null!=e&&a.set(e,!0)})),o&&o.eachComponent(s,function(e){if(!(a&&null!=a.get(e.id)))if(dc(n))if(e instanceof Ky)n.type!==Sh||n.notBlur||e.get(["emphasis","disabled"])||function(t,e,n){var r=t.seriesIndex,i=t.getData(e.dataType);if(i){var o=Ja(i,e);o=(j(o)?o[0]:o)||0;var a=i.getItemGraphicEl(o);if(!a)for(var s=i.count(),l=0;!a&&l<s;)a=i.getItemGraphicEl(l++);if(a){var u=$u(a);Qh(r,u.focus,u.blurScope,n)}else{var h=t.get(["emphasis","focus"]),c=t.get(["emphasis","blurScope"]);null!=h&&Qh(r,h,c,n)}}else La("Unknown dataType "+e.dataType)}(e,n,t._api);else{var r=tc(e.mainType,e.componentIndex,n.name,t._api),i=r.focusSelf,o=r.dispatchers;n.type===Sh&&i&&!n.notBlur&&$h(e.mainType,e.componentIndex,t._api),o&&B(o,function(t){n.type===Sh?Wh(t):Xh(t)})}else cc(n)&&e instanceof Ky&&(!function(t,e){if(cc(e)){var n=e.dataType,r=Ja(t.getData(n),e);j(r)||(r=[r]),t[e.type===Ih?"toggleSelect":e.type===Mh?"select":"unselect"](r,n)}}(e,n,t._api),ec(e),Nb(t))},t),o&&o.eachComponent(s,function(e){a&&null!=a.get(e.id)||u(t["series"===r?"_chartsMap":"_componentsMap"][e.__viewId])},t)}else B([].concat(t._componentsViews).concat(t._chartsViews),u);function u(r){r&&r.__alive&&r[e]&&r[e](r.__model,o,t._api,n)}},bb={prepareAndUpdate:function(t){yb(this),bb.update.call(this,t,t&&{optionChanged:null!=t.newOption})},update:function(e,n){var r=this._model,i=this._api,o=this._zr,a=this._coordSysMgr,s=this._scheduler;if(r){!function(t){hx(t).fullUpdate={}}(r),r.setUpdatePayload(e),s.restoreData(r,e),s.performSeriesTasks(r),a.create(r,i),ox.trigger("coordsys:aftercreate",r,i),s.performDataProcessorTasks(r,e),Sb(this,r),a.update(r,i),t(r),s.performVisualTasks(r,e);var l=r.get("backgroundColor")||"transparent";o.setBackgroundColor(l);var u=r.get("darkMode");null!=u&&"auto"!==u&&o.setDarkMode(u),Db(this,r,i,e,n),ox.trigger("afterupdate",r,i)}},updateTransform:function(t){var e=this,n=e._model,r=e._api;if(n){n.setUpdatePayload(t);var i=[];n.eachComponent(function(o,a){if(o!==nh){var s=e.getViewOfComponentModel(a);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(a,n,r,t);l&&l.update&&i.push(s)}else i.push(s)}});var o=yt();n.eachSeries(function(i){var a=e._chartsMap[i.__viewId],s=i.pipelineContext;if(a.updateTransform&&!s.progressiveRender){var l=a.updateTransform(i,n,r,t);l&&l.update&&o.set(i.uid,1)}else o.set(i.uid,1)}),e._scheduler.performVisualTasks(n,t,{setDirty:!0,dirtyMap:o}),Pb(e,n,r,t,{},o),ox.trigger("afterupdate",n,r)}},updateView:function(e){var n=this._model;n&&(n.setUpdatePayload(e),l_.markUpdateMethod(e,"updateView"),t(n),this._scheduler.performVisualTasks(n,e,{setDirty:!0}),Db(this,n,this._api,e,{}),ox.trigger("afterupdate",n,this._api))},updateVisual:function(e){var n=this,r=this._model;r&&(r.setUpdatePayload(e),r.eachSeries(function(t){t.getData().clearAllVisual()}),l_.markUpdateMethod(e,"updateVisual"),t(r),this._scheduler.performVisualTasks(r,e,{visualType:"visual",setDirty:!0}),r.eachComponent(function(t,i){if("series"!==t){var o=n.getViewOfComponentModel(i);o&&o.__alive&&o.updateVisual(i,r,n._api,e)}}),r.eachSeries(function(t){n._chartsMap[t.__viewId].updateVisual(t,r,n._api,e)}),ox.trigger("afterupdate",r,this._api))},updateLayout:function(t){bb.update.call(this,t)}},wb=function(t,e,n,r,i){if(t._disposed)Hb(t.id);else{for(var o,a=t._model,s=t._coordSysMgr.getCoordinateSystems(),l=ts(a,n),u=0;u<s.length;u++){var h=s[u];if(h[e]&&null!=(o=h[e](a,l,r,i)))return o}Da("No coordinate system that supports "+e+" found by the given finder.")}},Sb=function(t,e){var n=t._chartsMap,r=t._scheduler;e.eachSeries(function(t){r.updateStreamModes(t,n[t.__viewId])})},Tb=function(t,e){var n=this,r=this.getModel(),i=t.type,o=t.escapeConnect,a=Ub[i],s=(a.update||"update").split(":"),l=s.pop(),u=null!=s[0]&&Ls(s[0]);this[ub]=!0,kb(this);var h=[t],c=!1;t.batch&&(c=!0,h=V(t.batch,function(e){return(e=E(L({},e),t)).batch=null,e}));var d,p=[],f=[],g=a.nonRefinedEventType,m=cc(t),v=dc(t);if(v&&Jh(this._api),B(h,function(e){var i=a.action(e,r,n._api);if(a.refineEvent?f.push(i):d=i,(d=d||L({},e)).type=g,p.push(d),v){var o=es(t),s=o.queryOptionMap,h=o.mainTypeSpecified?s.keys()[0]:"series";xb(n,l,e,h),Nb(n)}else m?(xb(n,l,e,"series"),Nb(n)):u&&xb(n,l,e,u.main,u.sub)}),"none"!==l&&!v&&!m&&!u)try{this[cb]?(yb(this),bb.update.call(this,t),this[cb]=null):bb[l].call(this,t)}catch(t){throw this[ub]=!1,t}if(d=c?{type:g,escapeConnect:o,batch:p}:p[0],this[ub]=!1,!e){var y=void 0;if(a.refineEvent){var _=a.refineEvent(f,t,r,this._api).eventContent;ht(J(_)),(y=E({type:a.refinedEventType},_)).fromAction=t.type,y.fromActionPayload=t,y.escapeConnect=!0}var x=this._messageCenter;x.trigger(d.type,d),y&&x.trigger(y.type,y)}},Mb=function(t){for(var e=this._pendingActions;e.length;){var n=e.shift();Tb.call(this,n,t)}},Cb=function(t){!t&&this.trigger("updated")},Ib=function(t,e){t.on("rendered",function(n){e.trigger("rendered",n),!t.animation.isFinished()||e[cb]||e._scheduler.unfinished||e._pendingActions.length?t.refresh():e.trigger("finished")})},Ab=function(t,e){t.on("mouseover",function(t){var n=ix(t.target,hc);n&&(!function(t,e,n){hc(t)||La("param should be highDownDispatcher");var r=$u(t),i=tc(r.componentMainType,r.componentIndex,r.componentHighDownName,n),o=i.dispatchers,a=i.focusSelf;o?(a&&$h(r.componentMainType,r.componentIndex,n),B(o,function(t){return Hh(t,e)})):(Qh(r.seriesIndex,r.focus,r.blurScope,n),"self"===r.focus&&$h(r.componentMainType,r.componentIndex,n),Hh(t,e))}(n,t,e._api),Nb(e))}).on("mouseout",function(t){var n=ix(t.target,hc);n&&(!function(t,e,n){hc(t)||La("param should be highDownDispatcher"),Jh(n);var r=$u(t),i=tc(r.componentMainType,r.componentIndex,r.componentHighDownName,n).dispatchers;i?B(i,function(t){return Uh(t,e)}):Uh(t,e)}(n,t,e._api),Nb(e))}).on("click",function(t){var n=ix(t.target,function(t){return null!=$u(t).dataIndex},!0);if(n){var r=n.selected?"unselect":"select",i=$u(n);e._api.dispatchAction({type:r,dataType:i.dataType,dataIndexInside:i.dataIndex,seriesIndex:i.seriesIndex,isFromClick:!0})}})},Db=function(t,e,n,r,i){!function(t){var e=[],n=[],r=!1;if(t.eachComponent(function(t,i){var o=i.get("zlevel")||0,a=i.get("z")||0,s=i.getZLevelKey();r=r||!!s,("series"===t?n:e).push({zlevel:o,z:a,idx:i.componentIndex,type:t,key:s})}),r){var i,o,a=e.concat(n);Mn(a,function(t,e){return t.zlevel===e.zlevel?t.z-e.z:t.zlevel-e.zlevel}),B(a,function(e){var n=t.getComponent(e.type,e.idx),r=e.zlevel,a=e.key;null!=i&&(r=Math.max(i,r)),a?(r===i&&a!==o&&r++,o=a):o&&(r===i&&r++,o=""),i=r,n.setZLevel(r)})}}(e),Lb(t,e,n,r,i),B(t._chartsViews,function(t){t.__alive=!1}),Pb(t,e,n,r,i),B(t._chartsViews,function(t){t.__alive||t.remove(e,n)})},Lb=function(t,e,n,i,s,l){B(l||t._componentsViews,function(t){var s=t.__model;o(s,t),t.render(s,e,n,i),r(s,t),a(s,t)})},Pb=function(t,e,n,s,l,u){var h=t._scheduler;l=L(l||{},{updatedSeries:e.getSeries()}),ox.trigger("series:beforeupdate",e,n,l);var c=!1;e.eachSeries(function(e){var n=t._chartsMap[e.__viewId];n.__alive=!0;var r=n.renderTask;h.updatePayload(r,s),o(e,n),u&&u.get(e.uid)&&r.dirty(),r.perform(h.getPerformArgs(r))&&(c=!0),n.group.silent=!!e.get("silent"),function(t,e){var n=t.get("blendMode")||null;e.eachRendered(function(t){t.isGroup||(t.style.blend=n)})}(e,n),ec(e)}),h.unfinished=c||h.unfinished,ox.trigger("series:layoutlabels",e,n,l),ox.trigger("series:transition",e,n,l),e.eachSeries(function(e){var n=t._chartsMap[e.__viewId];r(e,n),a(e,n)}),function(t,e){var n=t._zr;if("canvas"!==n.painter.type)return;var r=n.storage,o=0;r.traverse(function(t){t.isGroup||o++});var a=o>at(e.get("hoverLayerThreshold"),hm.hoverLayerThreshold)&&!i.node&&!i.worker;(t._usingTHL||a)&&(e.eachSeries(function(e){if(!e.preventUsingHoverLayer){var n=t._chartsMap[e.__viewId];n.__alive&&n.eachRendered(function(t){var e=t.states.emphasis;e&&2!==e.hoverLayer&&(e.hoverLayer=a?1:0)})}}),t._usingTHL=a)}(t,e),ox.trigger("series:afterupdate",e,n,l)},Nb=function(t){t[db]=!0,t.getZr().wakeUp()},kb=function(t){t[hb]=(t[hb]+1)%1e6},Rb=function(t){t[db]&&(t.getZr().storage.traverse(function(t){Zd(t)||n(t)}),t[db]=!1)},Eb=function(t){return new(function(n){function r(){return null!==n&&n.apply(this,arguments)||this}return e(r,n),r.prototype.getCoordinateSystems=function(){return t._coordSysMgr.getCoordinateSystems()},r.prototype.getComponentByElement=function(e){for(;e;){var n=e.__ecComponentInfo;if(null!=n)return t._model.getComponent(n.mainType,n.index);e=e.parent}},r.prototype.enterEmphasis=function(e,n){Wh(e,n),Nb(t)},r.prototype.leaveEmphasis=function(e,n){Xh(e,n),Nb(t)},r.prototype.enterBlur=function(e){jh(e),Nb(t)},r.prototype.leaveBlur=function(e){Zh(e),Nb(t)},r.prototype.enterSelect=function(e){Yh(e),Nb(t)},r.prototype.leaveSelect=function(e){qh(e),Nb(t)},r.prototype.getModel=function(){return t.getModel()},r.prototype.getViewOfComponentModel=function(e){return t.getViewOfComponentModel(e)},r.prototype.getViewOfSeriesModel=function(e){return t.getViewOfSeriesModel(e)},r.prototype.getECUpdateCycleVersion=function(){return t[hb]},r.prototype.usingTHL=function(){return t._usingTHL},r}(gh))(t)},Ob=function(t){function e(t,e){for(var n=0;n<t.length;n++){t[n][fb]=e}}B(Wb,function(n,r){t._messageCenter.on(r,function(n){if(Qb[t.group]&&0!==t[fb]){if(n&&n.escapeConnect)return;var r=t.makeActionFromEvent(n),i=[];B(Jb,function(e){e!==t&&e.group===t.group&&i.push(e)}),e(i,0),B(i,function(t){1!==t[fb]&&t.dispatchAction(r)}),e(i,2)}})})}}(),n}($t),Fb=Vb.prototype;Fb.on=gb("on"),Fb.off=gb("off"),Fb.one=function(t,e,n){var r=this;Pa("ECharts#one is deprecated."),this.on.call(this,t,function n(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];e&&e.apply&&e.apply(this,i),r.off(t,n)},n)};var Gb=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function Hb(t){Da("Instance "+t+" has been disposed")}var Ub={},Wb={},Xb={},jb=[],Zb=[],Yb=[],qb={},Kb={},Jb={},Qb={},$b=+new Date-0,tw=+new Date-0,ew="_echarts_instance_";function nw(t,e,n){var r=!(n&&n.ssr);if(r){if(!t)throw new Error("Initialize failed: invalid dom.");var i=sw(t);if(i)return Da("There is a chart instance already initialized on the dom."),i;!tt(t)||"CANVAS"===t.nodeName.toUpperCase()||(t.clientWidth||n&&null!=n.width)&&(t.clientHeight||n&&null!=n.height)||Da("Can't get DOM width or height. Please check dom.clientWidth and dom.clientHeight. They should not be 0.For example, you may need to call this in the callback of window.onload.")}var o=new Vb(t,e,n);return o.id="ec_"+$b++,Jb[o.id]=o,r&&as(t,ew,o.id),Ob(o),ox.trigger("afterinit",o),o}function rw(t){if(j(t)){var e=t;t=null,B(e,function(e){null!=e.group&&(t=e.group)}),t=t||"g_"+tw++,B(e,function(e){e.group=t})}return Qb[t]=!0,t}function iw(t){Qb[t]=!1}var ow=iw;function aw(t){Y(t)?t=Jb[t]:t instanceof Vb||(t=sw(t)),t instanceof Vb&&!t.isDisposed()&&t.dispose()}function sw(t){return Jb[function(t,e){return t.getAttribute?t.getAttribute(e):t[e]}(t,ew)]}function lw(t){return Jb[t]}function uw(t,e){qb[t]=e}function hw(t){N(Zb,t)<0&&Zb.push(t)}function cw(t,e){ww(jb,t,e,2e3)}function dw(t){fw("afterinit",t)}function pw(t){fw("afterupdate",t)}function fw(t,e){ox.on(t,e)}function gw(t,e,n){var r,i,o,a,s;function l(t){return t.toLowerCase()}Z(e)&&(n=e,e=""),J(t)?(r=t.type,i=t.event,a=t.update,s=t.publishNonRefinedEvent,n||(n=t.action),o=t.refineEvent):(r=t,i=e),i=l(i||r);var u=o?l(r):i;Ub[r]||(ht(pb.test(r)&&pb.test(i)),o&&ht(i!==r),Ub[r]={actionType:r,refinedEventType:i,nonRefinedEventType:u,update:a,action:n,refineEvent:o},Xb[i]=1,o&&s&&(Xb[u]=1),Wb[u]&&La(u+' must not be shared; use "refineEvent" if you intend to share an event name.'),Wb[u]=r)}function mw(t,e){Rg.register(t,e)}function vw(t){var e=Rg.get(t);if(e)return e.getDimensionsInfo?e.getDimensionsInfo():e.dimensions.slice()}function yw(t,e){ux(t,e)}function _w(t,e){ww(Yb,t,e,1e3,"layout",!0)}function xw(t,e){ww(Yb,t,e,3e3,"visual",!0)}var bw=[];function ww(t,e,n,r,i,o){if((Z(e)||J(e))&&(n=e,e=r),isNaN(e)||null==e)throw new Error("Illegal priority");if(B(t,function(t){ht(t.__raw!==n)}),!(N(bw,n)>=0)){bw.push(n);var a=G_.wrapStageHandler(n,i);a.__prio=e,a.__raw=n,t.push(a),o&&ht(!a.dirtyOnOverallProgress,"dirtyOnOverallProgress is not allowed in "+i+" stage; otherwise progressive rendering is disabled on all series.")}}function Sw(t,e){Kb[t]=e}function Tw(t){Pa("setCanvasCreator is deprecated. Use setPlatformAPI({ createCanvas }) instead."),c({createCanvas:t})}function Mw(t,e,n){var r=sx("registerMap");r&&r(t,e,n)}function Cw(t){var e=sx("getMap");return e&&e(t)}var Iw=function(t){var e=(t=I(t)).type;e||Na("Must have a `type` when `registerTransform`.");var n=e.split(":");2!==n.length&&Na('Name must include namespace like "ns:regression".');var r=!1;"echarts"===n[0]&&(e=n[1],r=!0),t.__isBuiltIn=r,iy.set(e,t)};function Aw(t,e,n,r){return{eventContent:{selected:nc(n),isFromClick:e.isFromClick||!1}}}xw(ab,x_),xw(sb,w_),xw(sb,S_),xw(ab,J_),xw(sb,Q_),xw(7e3,rb),hw(sv),cw(900,lv),Sw("default",function(t,e){E(e=e||{},{text:"loading",textColor:om.color.primary,fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255,255,255,0.8)",showSpinner:!0,color:om.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Do,r=new Ru({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});n.add(r);var i,o=new Qu({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 Ru({style:{fill:"none"},textContent:o,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});return n.add(a),e.showSpinner&&((i=new wd({shape:{startAngle:-T_/2,endAngle:-T_/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001})).animateShape(!0).when(1e3,{endAngle:3*T_/2}).start("circularInOut"),i.animateShape(!0).when(1e3,{startAngle:3*T_/2}).delay(300).start("circularInOut"),n.add(i)),n.resize=function(){var n=o.getBoundingRect().width,s=e.showSpinner?e.spinnerRadius:0,l=(t.getWidth()-2*s-(e.showSpinner&&n?10:0)-n)/2-(e.showSpinner&&n?0:5+n/2)+(e.showSpinner?0:n/2)+(n?0:s),u=t.getHeight()/2;e.showSpinner&&i.setShape({cx:l,cy:u}),a.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),r.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},n.resize(),n}),gw({type:Sh,event:Sh,update:Sh},St),gw({type:Th,event:Th,update:Th},St),gw({type:Mh,event:Ah,update:Mh,action:St,refineEvent:Aw,publishNonRefinedEvent:!0}),gw({type:Ch,event:Ah,update:Ch,action:St,refineEvent:Aw,publishNonRefinedEvent:!0}),gw({type:Ih,event:Ah,update:Ih,action:St,refineEvent:Aw,publishNonRefinedEvent:!0}),uw("default",{}),uw("dark",Z_);var Dw={};function Lw(t){return null==t?0:t.length||1}function Pw(t){return t}var Ew=function(){function t(t,e,n,r,i,o){this._old=t,this._new=e,this._oldKeyGetter=n||Pw,this._newKeyGetter=r||Pw,this.context=i,this._diffModeMultiple="multiple"===o}return t.prototype.add=function(t){return this._add=t,this},t.prototype.update=function(t){return this._update=t,this},t.prototype.updateManyToOne=function(t){return this._updateManyToOne=t,this},t.prototype.updateOneToMany=function(t){return this._updateOneToMany=t,this},t.prototype.updateManyToMany=function(t){return this._updateManyToMany=t,this},t.prototype.remove=function(t){return this._remove=t,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var t=this._old,e=this._new,n={},r=new Array(t.length),i=new Array(e.length);this._initIndexMap(t,null,r,"_oldKeyGetter"),this._initIndexMap(e,n,i,"_newKeyGetter");for(var o=0;o<t.length;o++){var a=r[o],s=n[a],l=Lw(s);if(l>1){var u=s.shift();1===s.length&&(n[a]=s[0]),this._update&&this._update(u,o)}else 1===l?(n[a]=null,this._update&&this._update(s,o)):this._remove&&this._remove(o)}this._performRestAdd(i,n)},t.prototype._executeMultiple=function(){var t=this._old,e=this._new,n={},r={},i=[],o=[];this._initIndexMap(t,n,i,"_oldKeyGetter"),this._initIndexMap(e,r,o,"_newKeyGetter");for(var a=0;a<i.length;a++){var s=i[a],l=n[s],u=r[s],h=Lw(l),c=Lw(u);if(h>1&&1===c)this._updateManyToOne&&this._updateManyToOne(u,l),r[s]=null;else if(1===h&&c>1)this._updateOneToMany&&this._updateOneToMany(u,l),r[s]=null;else if(1===h&&1===c)this._update&&this._update(u,l),r[s]=null;else if(h>1&&c>1)this._updateManyToMany&&this._updateManyToMany(u,l),r[s]=null;else if(h>1)for(var d=0;d<h;d++)this._remove&&this._remove(l[d]);else this._remove&&this._remove(l)}this._performRestAdd(o,r)},t.prototype._performRestAdd=function(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=e[r],o=Lw(i);if(o>1)for(var a=0;a<o;a++)this._add&&this._add(i[a]);else 1===o&&this._add&&this._add(i);e[r]=null}},t.prototype._initIndexMap=function(t,e,n,r){for(var i=this._diffModeMultiple,o=0;o<t.length;o++){var a="_ec_"+this[r](t[o],o);if(i||(n[o]=a),e){var s=e[a],l=Lw(s);0===l?(e[a]=o,i&&n.push(a)):1===l?e[a]=[s,o]:s.push(o)}}},t}(),Ow=Ew,Nw=function(){function t(t,e){this._encode=t,this._schema=e}return t.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t}();function Rw(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function kw(t){return"category"===t?"ordinal":"time"===t?"time":"float"}var zw=function(t){this.otherDims={},null!=t&&L(this,t)},Bw=zw,Vw=Qa(),Fw={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},Gw=function(){function t(t){this.dimensions=t.dimensions,this._dimOmitted=t.dimensionOmitted,this.source=t.source,this._fullDimCount=t.fullDimensionCount,this._updateDimOmitted(t.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(t){this._dimOmitted=t,t&&(this._dimNameMap||(this._dimNameMap=Ww(this.source)))},t.prototype.getSourceDimensionIndex=function(t){return at(this._dimNameMap.get(t),-1)},t.prototype.getSourceDimension=function(t){var e=this.source.dimensionsDefine;if(e)return e[t]},t.prototype.makeStoreSchema=function(){for(var t=this._fullDimCount,e=wv(this.source),n=!Xw(t),r="",i=[],o=0,a=0;o<t;o++){var s=void 0,l=void 0,u=void 0,h=this.dimensions[a];if(h&&h.storeDimIndex===o)s=e?h.name:null,l=h.type,u=h.ordinalMeta,a++;else{var c=this.getSourceDimension(o);c&&(s=e?c.name:null,l=c.type)}i.push({property:s,type:l,ordinalMeta:u}),!e||null==s||h&&h.isCalculationCoord||(r+=n?s.replace(/\`/g,"`1").replace(/\$/g,"`2"):s),r+="$",r+=Fw[l]||"f",u&&(r+=u.uid),r+="$"}var d=this.source;return{dimensions:i,hash:[d.seriesLayoutBy,d.startIndex,r].join("$$")}},t.prototype.makeOutputDimensionNames=function(){for(var t=[],e=0,n=0;e<this._fullDimCount;e++){var r=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===e)i.isCalculationCoord||(r=i.name),n++;else{var o=this.getSourceDimension(e);o&&(r=o.name)}t.push(r)}return t},t.prototype.appendCalculationDimension=function(t){this.dimensions.push(t),t.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},t}();function Hw(t){return t instanceof Gw}function Uw(t){for(var e=yt(),n=0;n<(t||[]).length;n++){var r=t[n],i=J(r)?r.name:r;null!=i&&null==e.get(i)&&e.set(i,n)}return e}function Ww(t){var e=Vw(t);return e.dimNameMap||(e.dimNameMap=Uw(t.dimensionsDefine))}function Xw(t){return t>30}var jw,Zw,Yw,qw,Kw,Jw,Qw,$w=J,tS=V,eS="undefined"==typeof Int32Array?Array:Int32Array,nS=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],rS=["_approximateExtent"],iS=function(){function t(t,e){var n;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 r=!1;Hw(t)?(n=t.dimensions,this._dimOmitted=t.isDimensionOmitted(),this._schema=t):(r=!0,n=t),n=n||["x","y"];for(var i={},o=[],a={},s=!1,l={},u=0;u<n.length;u++){var h=n[u],c=Y(h)?new Bw({name:h}):h instanceof Bw?h:new Bw(h),d=c.name;c.type=c.type||"float",c.coordDim||(c.coordDim=d,c.coordDimIndex=0);var p=c.otherDims=c.otherDims||{};o.push(d),i[d]=c,null!=l[d]&&(s=!0),c.createInvertedIndices&&(a[d]=[]),ht(r||c.storeDimIndex>=0),r&&(c.storeDimIndex=u),0===p.itemName&&(this._nameDimIdx=c.storeDimIndex),0===p.itemId&&(this._idDimIdx=c.storeDimIndex)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(s),this.hostModel=e,this._invertedIndicesMap=a,this._dimOmitted){var f=this._dimIdxToName=yt();B(o,function(t){f.set(i[t].storeDimIndex,t)})}}return t.prototype.getDimension=function(t){var e=this._recognizeDimIndex(t);if(null==e)return t;if(e=t,!this._dimOmitted)return this.dimensions[e];var n=this._dimIdxToName.get(e);if(null!=n)return n;var r=this._schema.getSourceDimension(e);return r?r.name:void 0},t.prototype.getDimensionIndex=function(t){var e=this._recognizeDimIndex(t);if(null!=e)return e;if(null==t)return-1;var n=this._getDimInfo(t);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(t):-1},t.prototype._recognizeDimIndex=function(t){if(K(t)||null!=t&&!isNaN(t)&&!this._getDimInfo(t)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(t)<0))return+t},t.prototype._getStoreDimIndex=function(t){var e=this.getDimensionIndex(t);if(null==e)throw new Error("Unknown dimension "+t);return e},t.prototype.getDimensionInfo=function(t){return this._getDimInfo(this.getDimension(t))},t.prototype._initGetDimensionInfo=function(t){var e=this._dimInfos;this._getDimInfo=t?function(t){return e.hasOwnProperty(t)?e[t]:void 0}:function(t){return e[t]}},t.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},t.prototype.mapDimension=function(t,e){var n=this._dimSummary;if(null==e)return n.encodeFirstDimNotExtra[t];var r=n.encode[t];return r?r[e]:null},t.prototype.mapDimensionsAll=function(t){return(this._dimSummary.encode[t]||[]).slice()},t.prototype.getStore=function(){return this._store},t.prototype.initData=function(t,e,n){var r,i=this;if(t instanceof vy&&(r=t),!r){var o=this.dimensions,a=mv(t)||z(t)?new Sv(t,o.length):t;r=new vy;var s=tS(o,function(t){return{type:i._dimInfos[t].type,property:t}});r.initData(a,s,n)}this._store=r,this._nameList=(e||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,r.count()),this._dimSummary=function(t,e){var n={},r=n.encode={},i=yt(),o=[],a=[],s={};B(t.dimensions,function(e){var n,l=t.getDimensionInfo(e),u=l.coordDim;if(u){ht(null==rh.get(u));var h=l.coordDimIndex;Rw(r,u)[h]=e,l.isExtraCoord||(i.set(u,1),"ordinal"!==(n=l.type)&&"time"!==n&&(o[0]=e),Rw(s,u)[h]=t.getDimensionIndex(l.name)),l.defaultTooltip&&a.push(e)}rh.each(function(t,e){var n=Rw(r,e),i=l.otherDims[e];null!=i&&!1!==i&&(n[i]=l.name)})});var l=[],u={};i.each(function(t,e){var n=r[e];u[e]=n[0],l=l.concat(n)}),n.dataDimsOnCoord=l,n.dataDimIndicesOnCoord=V(l,function(e){return t.getDimensionInfo(e).storeDimIndex}),n.encodeFirstDimNotExtra=u;var h=r.label;h&&h.length&&(o=h.slice());var c=r.tooltip;return c&&c.length?a=c.slice():a.length||(a=o.slice()),r.defaultedLabel=o,r.defaultedTooltip=a,n.userOutput=new Nw(s,e),n}(this,this._schema),this.userOutput=this._dimSummary.userOutput},t.prototype.appendData=function(t){var e=this._store.appendData(t);this._doInit(e[0],e[1])},t.prototype.appendValues=function(t,e){var n=this._store.appendValues(t,e&&e.length),r=n.start,i=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),e)for(var a=r;a<i;a++){var s=a-r;this._nameList[a]=e[s],o&&Qw(this,a)}},t.prototype._updateOrdinalMeta=function(){for(var t=this._store,e=this.dimensions,n=0;n<e.length;n++){var r=this._dimInfos[e[n]];r.ordinalMeta&&t.collectOrdinalMeta(r.storeDimIndex,r.ordinalMeta)}},t.prototype._shouldMakeIdFromName=function(){var t=this._store.getProvider();return null==this._idDimIdx&&t.getSource().sourceFormat!==lh&&!t.fillStorage},t.prototype._doInit=function(t,e){if(!(t>=e)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===ih&&!n.pure)for(var o=[],a=t;a<e;a++){var s=n.getItem(a,o);if(!this.hasItemOption&&Ha(s)&&(this.hasItemOption=!0),s){var l=s.name;null==r[a]&&null!=l&&(r[a]=ja(l,null));var u=s.id;null==i[a]&&null!=u&&(i[a]=ja(u,null))}}if(this._shouldMakeIdFromName())for(a=t;a<e;a++)Qw(this,a);jw(this)}},t.prototype.getApproximateExtent=function(t,e){return this._approximateExtent[t]||this._store.getDataExtent(this._getStoreDimIndex(t),e)},t.prototype.setApproximateExtent=function(t,e){e=this.getDimension(e),this._approximateExtent[e]=t.slice()},t.prototype.getCalculationInfo=function(t){return this._calculationInfo[t]},t.prototype.setCalculationInfo=function(t,e){$w(t)?L(this._calculationInfo,t):this._calculationInfo[t]=e},t.prototype.getName=function(t){var e=this.getRawIndex(t),n=this._nameList[e];return null==n&&null!=this._nameDimIdx&&(n=Yw(this,this._nameDimIdx,e)),null==n&&(n=""),n},t.prototype._getCategory=function(t,e){var n=this._store.get(t,e),r=this._store.getOrdinalMeta(t);return r?r.categories[n]:n},t.prototype.getId=function(t){return Zw(this,this.getRawIndex(t))},t.prototype.count=function(){return this._store.count()},t.prototype.get=function(t,e){var n=this._store,r=this._dimInfos[t];if(r)return n.get(r.storeDimIndex,e)},t.prototype.getByRawIndex=function(t,e){var n=this._store,r=this._dimInfos[t];if(r)return n.getByRawIndex(r.storeDimIndex,e)},t.prototype.getIndices=function(){return this._store.getIndices()},t.prototype.getDataExtent=function(t){return this._store.getDataExtent(this._getStoreDimIndex(t),null)},t.prototype.getSum=function(t){return this._store.getSum(this._getStoreDimIndex(t))},t.prototype.getMedian=function(t){return this._store.getMedian(this._getStoreDimIndex(t))},t.prototype.getValues=function(t,e){var n=this,r=this._store;return j(t)?r.getValues(tS(t,function(t){return n._getStoreDimIndex(t)}),e):r.getValues(t)},t.prototype.hasValue=function(t){for(var e=this._dimSummary.dataDimIndicesOnCoord,n=0,r=e.length;n<r;n++)if(isNaN(this._store.get(e[n],t)))return!1;return!0},t.prototype.indexOfName=function(t){for(var e=0,n=this._store.count();e<n;e++)if(this.getName(e)===t)return e;return-1},t.prototype.getRawIndex=function(t){return this._store.getRawIndex(t)},t.prototype.indexOfRawIndex=function(t){return this._store.indexOfRawIndex(t)},t.prototype.rawIndexOf=function(t,e){var n=t&&this._invertedIndicesMap[t];if(!n)throw new Error("Do not supported yet");var r=n&&n[e];return null==r||isNaN(r)?-1:r},t.prototype.each=function(t,e,n){Z(t)&&(n=e,e=t,t=[]);var r=n||this,i=tS(qw(t),this._getStoreDimIndex,this);this._store.each(i,r?W(e,r):e)},t.prototype.filterSelf=function(t,e,n){Z(t)&&(n=e,e=t,t=[]);var r=n||this,i=tS(qw(t),this._getStoreDimIndex,this);return this._store=this._store.filter(i,r?W(e,r):e),this},t.prototype.selectRange=function(t){var e=this,n={};return B(U(t),function(r){var i=e._getStoreDimIndex(r);n[i]=t[r]}),this._store=this._store.selectRange(n),this},t.prototype.mapArray=function(t,e,n){Z(t)&&(n=e,e=t,t=[]),n=n||this;var r=[];return this.each(t,function(){r.push(e&&e.apply(this,arguments))},n),r},t.prototype.map=function(t,e,n,r){var i=n||r||this,o=tS(qw(t),this._getStoreDimIndex,this),a=Jw(this);return a._store=this._store.map(o,i?W(e,i):e),a},t.prototype.modify=function(t,e,n,r){var i=this,o=n||r||this;B(qw(t),function(t){i.getDimensionInfo(t).isCalculationCoord||console.error("Danger: only stack dimension can be modified")});var a=tS(qw(t),this._getStoreDimIndex,this);this._store.modify(a,o?W(e,o):e)},t.prototype.downSample=function(t,e,n,r){var i=Jw(this);return i._store=this._store.downSample(this._getStoreDimIndex(t),e,n,r),i},t.prototype.minmaxDownSample=function(t,e){var n=Jw(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(t),e),n},t.prototype.lttbDownSample=function(t,e){var n=Jw(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(t),e),n},t.prototype.getRawDataItem=function(t){return this._store.getRawDataItem(t)},t.prototype.getItemModel=function(t){var e=this.hostModel,n=this.getRawDataItem(t);return new xf(n,e,e&&e.ecModel)},t.prototype.diff=function(t){var e=this;return new Ow(t?t.getStore().getIndices():[],this.getStore().getIndices(),function(e){return Zw(t,e)},function(t){return Zw(e,t)})},t.prototype.getVisual=function(t){var e=this._visual;return e&&e[t]},t.prototype.setVisual=function(t,e){this._visual=this._visual||{},$w(t)?L(this._visual,t):this._visual[t]=e},t.prototype.getItemVisual=function(t,e){var n=this._itemVisuals[t],r=n&&n[e];return null==r?this.getVisual(e):r},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(t,e){var n=this._itemVisuals,r=n[t];r||(r=n[t]={});var i=r[e];return null==i&&(j(i=this.getVisual(e))?i=i.slice():$w(i)&&(i=L({},i)),r[e]=i),i},t.prototype.setItemVisual=function(t,e,n){var r=this._itemVisuals[t]||{};this._itemVisuals[t]=r,$w(e)?L(r,e):r[e]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(t,e){$w(t)?L(this._layout,t):this._layout[t]=e},t.prototype.getLayout=function(t){return this._layout[t]},t.prototype.getItemLayout=function(t){return this._itemLayouts[t]},t.prototype.setItemLayout=function(t,e,n){this._itemLayouts[t]=n?L(this._itemLayouts[t]||{},e):e},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(t,e){var n=this.hostModel&&this.hostModel.seriesIndex;th(n,this.dataType,t,e),this._graphicEls[t]=e},t.prototype.getItemGraphicEl=function(t){return this._graphicEls[t]},t.prototype.eachItemGraphicEl=function(t,e){B(this._graphicEls,function(n,r){n&&t&&t.call(e,n,r)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:tS(this.dimensions,this._getDimInfo,this),this.hostModel)),Kw(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(t,e){var n=this[t];Z(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(t),this[t]=function(){var t=n.apply(this,arguments);return e.apply(this,[t].concat(lt(arguments)))})},t.internalField=(jw=function(t){var e=t._invertedIndicesMap;B(e,function(n,r){var i=t._dimInfos[r],o=i.ordinalMeta,a=t._store;if(o){n=e[r]=new eS(o.categories.length);for(var s=0;s<n.length;s++)n[s]=-1;for(s=0;s<a.count();s++)n[a.get(i.storeDimIndex,s)]=s}})},Yw=function(t,e,n){return ja(t._getCategory(e,n),null)},Zw=function(t,e){var n=t._idList[e];return null==n&&null!=t._idDimIdx&&(n=Yw(t,t._idDimIdx,e)),null==n&&(n="e\0\0"+e),n},qw=function(t){return j(t)||(t=null!=t?[t]:[]),t},Jw=function(e){var n=new t(e._schema?e._schema:tS(e.dimensions,e._getDimInfo,e),e.hostModel);return Kw(n,e),n},Kw=function(t,e){B(nS.concat(e.__wrappedMethods||[]),function(n){e.hasOwnProperty(n)&&(t[n]=e[n])}),t.__wrappedMethods=e.__wrappedMethods,B(rS,function(n){t[n]=I(e[n])}),t._calculationInfo=L({},e._calculationInfo)},void(Qw=function(t,e){var n=t._nameList,r=t._idList,i=t._nameDimIdx,o=t._idDimIdx,a=n[e],s=r[e];if(null==a&&null!=i&&(n[e]=a=Yw(t,i,e)),null==s&&null!=o&&(r[e]=s=Yw(t,o,e)),null==s&&null!=a){var l=t._nameRepeatCount,u=l[a]=(l[a]||0)+1;s=a,u>1&&(s+="__ec__"+u),r[e]=s}})),t}(),oS=iS;function aS(t,e){return sS(t,e).dimensions}function sS(t,e){mv(t)||(t=yv(t));var n=(e=e||{}).coordDimensions||[],r=e.dimensionsDefine||t.dimensionsDefine||[],i=yt(),o=[],a=function(t,e,n,r){var i=Math.max(t.dimensionsDetectedCount||1,e.length,n.length,r||0);return B(e,function(t){var e;J(t)&&(e=t.dimsDef)&&(i=Math.max(i,e.length))}),i}(t,n,r,e.dimensionsCount),s=e.canOmitUnusedDimensions&&Xw(a),l=r===t.dimensionsDefine,u=l?Ww(t):Uw(r),h=e.encodeDefine;!h&&e.encodeDefaulter&&(h=e.encodeDefaulter(t,a));for(var c=yt(h),d=new hy(a),p=0;p<d.length;p++)d[p]=-1;function f(t){var e=d[t];if(e<0){var n=r[t],i=J(n)?n:{name:n},a=new Bw,s=i.name;null!=s&&null!=u.get(s)&&(a.name=a.displayName=s),null!=i.type&&(a.type=i.type),null!=i.displayName&&(a.displayName=i.displayName);var l=o.length;return d[t]=l,a.storeDimIndex=t,o.push(a),a}return o[e]}if(!s)for(p=0;p<a;p++)f(p);c.each(function(t,e){var n=Ba(t).slice();if(1===n.length&&!Y(n[0])&&n[0]<0)c.set(e,!1);else{var r=c.set(e,[]);B(n,function(t,n){var i=Y(t)?u.get(t):t;null!=i&&i<a&&(r[n]=i,m(f(i),e,n))})}});var g=0;function m(t,e,n){null!=rh.get(e)?t.otherDims[e]=n:(t.coordDim=e,t.coordDimIndex=n,i.set(e,!0))}B(n,function(t){var e,n,r,i;if(Y(t))e=t,i={};else{e=(i=t).name;var o=i.ordinalMeta;i.ordinalMeta=null,(i=L({},i)).ordinalMeta=o,n=i.dimsDef,r=i.otherDims,i.name=i.coordDim=i.coordDimIndex=i.dimsDef=i.otherDims=null}var s=c.get(e);if(!1!==s){if(!(s=Ba(s)).length)for(var u=0;u<(n&&n.length||1);u++){for(;g<a&&null!=f(g).coordDim;)g++;g<a&&s.push(g++)}B(s,function(t,o){var a=f(t);if(l&&null!=i.type&&(a.type=i.type),m(E(a,i),e,o),null==a.name&&n){var s=n[o];!J(s)&&(s={name:s}),a.name=a.displayName=s.name,a.defaultTooltip=s.defaultTooltip}r&&E(a.otherDims,r)})}});var v=e.generateCoord,y=e.generateCoordCount,_=null!=y;y=v?y||1:0;var x=v||"value";function b(t){null==t.name&&(t.name=t.coordDim)}if(s)B(o,function(t){b(t)}),o.sort(function(t,e){return t.storeDimIndex-e.storeDimIndex});else for(var w=0;w<a;w++){var S=f(w);null==S.coordDim&&(S.coordDim=lS(x,i,_),S.coordDimIndex=0,(!v||y<=0)&&(S.isExtraCoord=!0),y--),b(S),null!=S.type||ym(t,w)!==cm&&(!S.isExtraCoord||null==S.otherDims.itemName&&null==S.otherDims.seriesName)||(S.type="ordinal")}return xs(o,function(t){return t.name},function(t,e){e>0&&(t.name=t.name+(e-1))}),new Gw({source:t,dimensions:o,fullDimensionCount:a,dimensionOmitted:s})}function lS(t,e,n){if(n||e.hasKey(t)){for(var r=0;e.hasKey(t+r);)r++;t+=r}return e.set(t,!0),t}var uS=function(t){this.coordSysDims=[],this.axisMap=yt(),this.categoryAxisMap=yt(),this.coordSysName=t};var hS={cartesian2d:function(t,e,n,r){var i=t.getReferringComponents("xAxis",ns).models[0],o=t.getReferringComponents("yAxis",ns).models[0];if(!i)throw new Error('xAxis "'+ot(t.get("xAxisIndex"),t.get("xAxisId"),0)+'" not found');if(!o)throw new Error('yAxis "'+ot(t.get("xAxisIndex"),t.get("yAxisId"),0)+'" not found');e.coordSysDims=["x","y"],n.set("x",i),n.set("y",o),cS(i)&&(r.set("x",i),e.firstCategoryDimIndex=0),cS(o)&&(r.set("y",o),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,n,r){var i=t.getReferringComponents("singleAxis",ns).models[0];if(!i)throw new Error("singleAxis should be specified.");e.coordSysDims=["single"],n.set("single",i),cS(i)&&(r.set("single",i),e.firstCategoryDimIndex=0)},polar:function(t,e,n,r){var i=t.getReferringComponents("polar",ns).models[0],o=i.findAxisModel("radiusAxis"),a=i.findAxisModel("angleAxis");if(!a)throw new Error("angleAxis option not found");if(!o)throw new Error("radiusAxis option not found");e.coordSysDims=["radius","angle"],n.set("radius",o),n.set("angle",a),cS(o)&&(r.set("radius",o),e.firstCategoryDimIndex=0),cS(a)&&(r.set("angle",a),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=1))},geo:function(t,e,n,r){e.coordSysDims=["lng","lat"]},parallel:function(t,e,n,r){var i=t.ecModel,o=i.getComponent("parallel",t.get("parallelIndex")),a=e.coordSysDims=o.dimensions.slice();B(o.parallelAxisIndex,function(t,o){var s=i.getComponent("parallelAxis",t),l=a[o];n.set(l,s),cS(s)&&(r.set(l,s),null==e.firstCategoryDimIndex&&(e.firstCategoryDimIndex=o))})},matrix:function(t,e,n,r){var i=t.getReferringComponents("matrix",ns).models[0];if(!i)throw new Error("matrix coordinate system should be specified.");e.coordSysDims=["x","y"];var o=i.getDimensionModel("x"),a=i.getDimensionModel("y");n.set("x",o),n.set("y",a),r.set("x",o),r.set("y",a)}};function cS(t){return"category"===t.get("type")}function dS(t,e,n){var r,i,o,a=(n=n||{}).byIndex,s=n.stackedCoordDimension;!function(t){return!Hw(t.schema)}(e)?(i=e.schema,r=i.dimensions,o=e.store):r=e;var l,u,h,c,d=!(!t||!t.get("stack")),p=!0;function f(t){return"ordinal"!==t.type&&"time"!==t.type}if(B(r,function(t,e){Y(t)&&(r[e]=t={name:t}),f(t)||(p=!1)}),B(r,function(t,e){d&&!t.isExtraCoord&&(a||l||!t.ordinalMeta||(l=t),u||!f(t)||p&&("x"===t.coordDim||"angle"===t.coordDim)||s&&s!==t.coordDim||(u=t))}),!u||a||l||(a=!0),u){h="__\0ecstackresult_"+t.id,c="__\0ecstackedover_"+t.id,l&&(l.createInvertedIndices=!0);var g=u.coordDim,m=u.type,v=0;B(r,function(t){t.coordDim===g&&v++});var y={name:h,coordDim:g,coordDimIndex:v,type:m,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length},_={name:c,coordDim:c,coordDimIndex:v+1,type:m,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:r.length+1};i?(o&&(y.storeDimIndex=o.ensureCalculationDimension(c,m),_.storeDimIndex=o.ensureCalculationDimension(h,m)),i.appendCalculationDimension(y),i.appendCalculationDimension(_)):(r.push(y),r.push(_))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:a,stackedOverDimension:c,stackResultDimension:h}}function pS(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function fS(t,e){return pS(t,e)?t.getCalculationInfo("stackResultDimension"):e}function gS(t,e,n){n=n||{};var r,i=e.getSourceManager(),o=!1;t?(o=!0,r=yv(t)):o=(r=i.getSource()).sourceFormat===ih;var a=function(t){var e=t.get("coordinateSystem"),n=new uS(e),r=hS[e];if(r)return r(t,n,n.axisMap,n.categoryAxisMap),n}(e),s=function(t,e){var n,r=t.get("coordinateSystem"),i=Rg.get(r);return e&&e.coordSysDims&&(n=V(e.coordSysDims,function(t){var n={name:t},r=e.axisMap.get(t);if(r){var i=r.get("type");n.type=kw(i)}return n})),n||(n=i&&(i.getDimensionsInfo?i.getDimensionsInfo():i.dimensions.slice())||["x","y"]),n}(e,a),l=n.useEncodeDefaulter,u=Z(l)?l:l?X(gm,s,e):null,h=sS(r,{coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!o}),c=function(t,e,n){var r,i;return n&&B(t,function(t,o){var a=t.coordDim,s=n.categoryAxisMap.get(a);s&&(null==r&&(r=o),t.ordinalMeta=s.getOrdinalMeta(),e&&(t.createInvertedIndices=!0)),null!=t.otherDims.itemName&&(i=!0)}),i||null==r||(t[r].otherDims.itemName=0),r}(h.dimensions,n.createInvertedIndices,a),d=o?null:i.getSharedDataStore(h),p=dS(e,{schema:h,store:d}),f=new oS(h,e);f.setCalculationInfo(p);var g=null!=c&&function(t){if(t.sourceFormat===ih){var e=function(t){var e=0;for(;e<t.length&&null==t[e];)e++;return t[e]}(t.data||[]);return!j(Ga(e))}}(r)?function(t,e,n,r){return r===c?n:this.defaultDimValueGetter(t,e,n,r)}:null;return f.hasItemOption=!1,f.initData(o?r:d,null,g),f}var mS=function(){function t(){}return t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(t){this._isBlank=t},t}();ks(mS);var vS=mS,yS=0,_S=function(){function t(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this.uid=++yS,this._onCollect=t.onCollect}return t.createByAxisModel=function(e){var n=e.option,r=n.data,i=r&&V(r,xS);return new t({categories:i,needCollect:!i,deduplication:!1!==n.dedplication})},t.prototype.getOrdinal=function(t){return this._getOrCreateMap().get(t)},t.prototype.parseAndCollect=function(t){var e,n=this._needCollect;if(!Y(t)&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,this._onCollect&&this._onCollect(t,e),e;var r=this._getOrCreateMap();return null==(e=r.get(t))&&(n?(e=this.categories.length,this.categories[e]=t,r.set(t,e),this._onCollect&&this._onCollect(t,e)):e=NaN),e},t.prototype._getOrCreateMap=function(){return this._map||(this._map=yt(this.categories))},t}();function xS(t){return J(t)&&null!=t.value?t.value:t+""}var bS=_S,wS=U({needTransform:1,normalize:1,scale:1,transformIn:1,transformOut:1,contain:1,getExtent:1,getExtentUnsafe:1,setExtent:1,setExtent2:1,getFilter:1,sanitize:1,getDefaultStartValue:1,freeze:1});function SS(t,e,n){var r;t=t||{};var i=Of();if(i){var o=i.createBreakScaleMapper(e,n);o.hasBreaks()&&(B(wS,function(e){o[e]&&(t[e]=W(o[e],o))}),r=o)}return null==r&&DS(t,n),{brk:r,mapper:t}}function TS(t,e){B(wS,function(n){t[n]=e[n]})}function MS(t,e){t.freeze=St,t.freeze=function(){e.freeze()}}function CS(t){return t.getExtentUnsafe(0,2)}function IS(t,e){return t.getExtentUnsafe(1,e)||t.getExtentUnsafe(0,e)}function AS(t){var e=t.getExtentUnsafe(0,3);return e[1]-e[0]}function DS(t,e){var n=t||{},r=[];return n._extents=r,r[0]=e?e.slice():[1/0,-1/0],L(n,LS),n}var LS={needTransform:function(){return!1},normalize:function(t){var e=this._extents[1]||this._extents[0];return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},scale:function(t){var e=this._extents[1]||this._extents[0];return t*(e[1]-e[0])+e[0]},transformIn:function(t){return t},transformOut:function(t){return t},contain:function(t){var e=IS(this,null);return t>=e[0]&&t<=e[1]},getExtent:function(){return this._extents[0].slice()},getExtentUnsafe:function(t){return this._extents[t]},setExtent:function(t,e){ht(!this._frozen),PS(this._extents,0,t,e)},setExtent2:function(t,e,n){ht(!this._frozen);var r=this._extents;r[t]||(r[t]=r[0].slice()),PS(r,t,e,n)},freeze:function(){this._frozen=!0}};function PS(t,e,n,r){ms(n,r)?(t[e][0]=n,t[e][1]=r):null!=n&&null!=r&&n<=r&&La("Invalid setExtent call - start: "+n+", end: "+r)}function ES(t){return OS(t)||RS(t)}function OS(t){return"interval"===t.type}function NS(t){return"time"===t.type}function RS(t){return"log"===t.type}function kS(t){return"ordinal"===t.type}function zS(t){var e=ga(t),n=jo(10,e),r=Uo(t/n);return r?2===r?r=3:3===r?r=5:r*=2:r=1,ea(r*n,-e)}function BS(t){return ia(t)+2}function VS(t,e){return Zo(t)/Zo(e)}function FS(t,e,n){var r=n&&n.lookup;if(r)for(var i=0;i<r.from.length;i++)if(t===r.from[i])return r.to[i];return jo(e,t)}function GS(t,e,n){var r=t.slice();if(r[0]===r[1]){var i=n&&n.ctnShp;if(0!==r[0]){var o=Ho(r[0]);e[1]||(r[1]+=o/2),r[0]-=o/2}else i?(r[0]=-1,r[1]=1):r[1]=1}return gs(r[0])&&gs(r[1])||(r[0]=0,r[1]=1),r[1]<r[0]&&r.reverse(),r}function HS(t,e){return Uo(Go(t=t||e,1))}function US(t,e,n){var r=CS(t),i=r[0],o=t.count(),a=Math.max((e||0)+1,1);0!==i&&a>1&&o/a>2&&(i=Math.round(Math.ceil(i/a)*a)),i!==r[0]&&l(r[0],!0,!0);for(var s=i;s<=r[1];s+=a)l(s,!1,s===r[0]||s===r[1]);function l(t,e,r){n({value:t,offInterval:e},r)}s-a!==r[1]&&l(r[1],!0,!0)}var WS=function(t){function n(e){var r=t.call(this)||this;r.type="ordinal",r.parse=n.parse,TS(r,n.decoratedMethods);var i=e.ordinalMeta;i||(i=new bS({})),j(i)&&(i=new bS({categories:V(i,function(t){return J(t)?t.value:t})})),r._ordinalMeta=i;var o=SS(null,null,e.extent||[0,i.categories.length-1]);return r._mapper=o.mapper,MS(r,o.mapper),r}return e(n,t),n.parse=function(t){return null==t?t=NaN:Y(t)?null==(t=this._ordinalMeta.getOrdinal(t))&&(t=NaN):t=Uo(t),t},n.prototype.getTicks=function(){var t=[];return US(this,0,function(e){t.push(e)}),t},n.prototype.getMinorTicks=function(t){},n.prototype.setSortInfo=function(t){if(null!=t){for(var e=t.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,o=this._ordinalMeta.categories.length,a=Fo(o,e.length);i<a;++i){r[n[i]=e[i]]=i}for(var s=0;i<o;++i){for(;null!=r[s];)s++;n[i]=s,r[s]=i}}else this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null},n.prototype._getTickNumber=function(t){var e=this._ticksByOrdinalNumber;return e&&t>=0&&t<e.length?e[t]:t},n.prototype.getRawOrdinalNumber=function(t){var e=this._ordinalNumbersByTick;return e&&t>=0&&t<e.length?e[t]:t},n.prototype.getLabel=function(t){if(!this.isBlank()){var e=this.getRawOrdinalNumber(t.value),n=this._ordinalMeta.categories[e];return null==n?"":n+""}},n.prototype.count=function(){var t=CS(this._mapper);return t[1]-t[0]+1},n.prototype.getOrdinalMeta=function(){return this._ordinalMeta},n.type="ordinal",n.decoratedMethods={needTransform:function(){return this._mapper.needTransform()},contain:function(t){return this._mapper.contain(this._getTickNumber(t))&&t>=0&&t<this._ordinalMeta.categories.length},normalize:function(t){return this._mapper.normalize(this._getTickNumber(t))},scale:function(t){return this.getRawOrdinalNumber(Uo(this._mapper.scale(t)))},transformIn:function(t,e){return this._mapper.transformIn(this._getTickNumber(t),e)},transformOut:function(t,e){return this.getRawOrdinalNumber(this._mapper.transformOut(t,e))},getExtent:function(){return this._mapper.getExtent()},getExtentUnsafe:function(t,e){return this._mapper.getExtentUnsafe(t,e)},setExtent:function(t,e){return this._mapper.setExtent(t,e)},setExtent2:function(t,e,n){return this._mapper.setExtent2(t,e,n)}},n}(vS);vS.registerClass(WS);var XS=WS;function jS(t,e,n,r){for(var i=t.getTicks({expandToNicedExtent:!0}),o=[],a=t.getExtent(),s=1;s<i.length;s++){var l=i[s],u=i[s-1];if(!u.break&&!l.break){for(var h=0,c=[],d=(l.value-u.value)/e,p=BS(d);h<e-1;){var f=ea(u.value+(h+1)*d,p);f>a[0]&&f<a[1]&&c.push(f),h++}var g=Of();g&&g.pruneTicksByBreak("auto",c,n,function(t){return t},r,a),o.push(c)}}return o}var ZS=function(t){function n(e){var r=t.call(this)||this;r.type="interval",r.parse=n.parse;var i=SS(r,Nf(r,e=e||{}),null);return r.brk=i.brk,r._cfg={interval:0,intervalPrecision:2,intervalCount:void 0,niceExtent:void 0},r}return e(n,t),n.parse=function(t){return null==t||""===t?NaN:Number(t)},n.prototype.getConfig=function(){return I(this._cfg)},n.prototype.setConfig=function(t){var e=CS(this);ht(null!=t.interval),null!=t.intervalCount&&ht(t.intervalCount>=-1&&null!=t.intervalPrecision&&!kf(this)),null!=t.niceExtent&&(ht(isFinite(t.niceExtent[0])&&isFinite(t.niceExtent[1])),ht(e[0]<=t.niceExtent[0]&&t.niceExtent[1]<=e[1]),ht(ea(t.niceExtent[0]-t.niceExtent[1],ia(t.interval))<=t.interval)),this._cfg=t=I(t),null==t.niceExtent&&(t.niceExtent=e.slice()),null==t.intervalPrecision&&(t.intervalPrecision=BS(t.interval))},n.prototype.getTicks=function(t){t=t||{};var e=this._cfg,n=e.interval,r=CS(this),i=e.niceExtent,o=e.intervalPrecision,a=Of(),s=this.brk,l=a&&s,u=[];if(!n)return u;if("only_break"===t.breakTicks&&l)return a.addBreaksToTicks(u,s.breaks,r),u;ht(null!=i);r[0]<i[0]&&u.push({value:t.expandToNicedExtent?ea(i[0]-n,o):r[0]});for(var h=function(t,e){return Uo((e-t)/n)},c=e.intervalCount,d=i[0],p=0;;p++){if(null==c){if(d>i[1]||!isFinite(d)||!isFinite(i[1]))break}else{if(p>c)break;d=Fo(d,i[1]),p===c&&(d=i[1])}if(u.push({value:d}),d=ea(d+n,o),s){var f=s.calcNiceTickMultiple(d,h);f>=0&&(d=ea(d+f*n,o))}if(u.length>0&&d===u[u.length-1].value)break;if(u.length>3e3)return Da('Exceed safe limit in IntervalScale["getTicks"].'),[]}var g=u.length?u[u.length-1].value:i[1];return r[1]>g&&u.push({value:t.expandToNicedExtent?ea(g+n,o):r[1]}),l&&a.pruneTicksByBreak(t.pruneByBreak,u,s.breaks,function(t){return t.value},e.interval,r),l&&"none"!==t.breakTicks&&a.addBreaksToTicks(u,s.breaks,r),u},n.prototype.getMinorTicks=function(t){return jS(this,t,Rf(this),this._cfg.interval)},n.prototype.getLabel=function(t,e){if(null==t)return"";var n=e&&e.precision;return null==n?n=ia(t.value)||0:"auto"===n&&(n=this._cfg.intervalPrecision),gg(ea(t.value,n,!0))},n.type="interval",n}(vS);vS.registerClass(ZS);var YS=ZS,qS=function(t){function n(e){var r=t.call(this)||this;r.type="time",r.parse=n.parse,r._locale=e.locale,r._useUTC=e.useUTC,r._interval=0;var i=SS(r,Nf(r,e),null);return r.brk=i.brk,r}return e(n,t),n.prototype.getLabel=function(t){return Qf(t.value,Xf[function(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}(Kf(this._minLevelUnit))]||Xf.second,this._useUTC,this._locale)},n.prototype.getFormattedLabel=function(t,e,n){return function(t,e,n,r,i){var o=null;if(Y(n))o=n;else if(Z(n)){var a={time:t.time,level:t.time?t.time.level:0},s=Of();s&&s.makeAxisLabelFormatterParamBreak(a,t.break),o=n(t.value,e,a)}else{var l=t.time;if(l){var u=n[l.lowerTimeUnit][l.upperTimeUnit];o=u[Math.min(l.level,u.length-1)]||""}else{var h=$f(t.value,i);o=n[h][h][0]}}return Qf(new Date(t.value),o,i,r)}(t,e,n,this._locale,this._useUTC)},n.prototype.getTicks=function(t){t=t||{};var e=this._interval,n=CS(this),r=Of(),i=this.brk,o=r&&i,a=[];if(!e)return a;var s=this._useUTC;if(o&&"only_break"===t.breakTicks)return Of().addBreaksToTicks(a,i.breaks,n),a;a=function(t,e,n,r,i,o){var a=3e3,s=Zf,l=0;function u(t,e,n,i,s,u,h){for(var c=function(t,e){var n=new Date(0);n[t](1);var r=n.getTime();n[t](1+e);var i=n.getTime()-r;return function(t,e){return Math.max(0,Math.round((e-t)/i))}}(s,t),d=e,p=new Date(d);d<n&&d<=r[1];){if(h.push({value:d}),l++>a){Da('Exceed safe limit in TimeScale["getTicks"].');break}if(p[s](p[i]()+t),d=p.getTime(),o){var f=o.calcNiceTickMultiple(d,c);f>0&&(p[s](p[i]()+f*t),d=p.getTime())}}h.push({value:d,notAdd:d>r[1]})}function h(t,i,o){var a=[],s=!i.length;if(!JS(Kf(t),r[0],r[1],n)){s&&(i=[{value:rT(r[0],t,n)},{value:r[1]}]);for(var l=0;l<i.length-1;l++){var h=i[l].value,c=i[l+1].value;if(h!==c){var d=void 0,p=void 0,f=void 0,g=!1;switch(t){case"year":d=Math.max(1,Math.round(e/Ff/365)),p=eg(n),f=lg(n);break;case"half-year":case"quarter":case"month":d=$S(e),p=ng(n),f=ug(n);break;case"week":case"half-week":case"day":d=QS(e),p=rg(n),f=hg(n),g=!0;break;case"half-day":case"quarter-day":case"hour":d=tT(e),p=ig(n),f=cg(n);break;case"minute":d=eT(e,!0),p=og(n),f=dg(n);break;case"second":d=eT(e,!1),p=ag(n),f=pg(n);break;case"millisecond":d=nT(e),p=sg(n),f=fg(n)}c>=r[0]&&h<=r[1]&&u(d,h,c,p,f,g,a),"year"===t&&o.length>1&&0===l&&o.unshift({value:o[0].value-d})}}for(l=0;l<a.length;l++)o.push(a[l])}}for(var c=[],d=[],p=0,f=0,g=0;g<s.length;++g){var m=Kf(s[g]);if(Jf(s[g]))if(h(s[g],c[c.length-1]||[],d),m!==(s[g+1]?Kf(s[g+1]):null)){if(d.length){f=p,d.sort(function(t,e){return t.value-e.value});for(var v=[],y=0;y<d.length;++y){var _=d[y].value;0!==y&&d[y-1].value===_||(v.push(d[y]),_>=r[0]&&_<=r[1]&&p++)}var x=i/e;if(p>1.5*x&&f>x/1.5)break;if(c.push(v),p>x||t===s[g])break}d=[]}}var b=G(V(c,function(t){return G(t,function(t){return t.value>=r[0]&&t.value<=r[1]&&!t.notAdd})}),function(t){return t.length>0}),w=b.length-1,S=[];for(g=0;g<b.length;++g)for(var T=b[g],M=0;M<T.length;++M){var C=$f(T[M].value,n);S.push({value:T[M].value,time:{level:w-g,upperTimeUnit:C,lowerTimeUnit:C}})}xs(S,bs,null),S.sort(function(t,e){return t.value-e.value});var I=S[0],A=S[S.length-1],D=$f(r[0],n),L=$f(r[1],n);(!I||I.value>r[0])&&S.unshift({value:r[0],time:{level:0,upperTimeUnit:D,lowerTimeUnit:D},notNice:!0});(!A||A.value<r[1])&&S.push({value:r[1],time:{level:0,upperTimeUnit:L,lowerTimeUnit:L},notNice:!0});return S}(this._minLevelUnit,this._approxInterval,s,n,AS(this),i);var l=jf.length-1,u=0;return B(a,function(t){t.time&&(l=Math.min(l,N(jf,t.time.upperTimeUnit)),u=Math.max(u,t.time.level))}),o&&Of().pruneTicksByBreak(t.pruneByBreak,a,i.breaks,function(t){return t.value},this._approxInterval,n),o&&"none"!==t.breakTicks&&Of().addBreaksToTicks(a,i.breaks,n,function(t){for(var e=Math.max(N(jf,$f(t.vmin,s)),N(jf,$f(t.vmax,s))),n=0,r=0;r<jf.length;r++)if(!JS(jf[r],t.vmin,t.vmax,s)){n=r;break}var i=Math.min(n,l),o=Math.max(i,e);return{level:u,lowerTimeUnit:jf[o],upperTimeUnit:jf[i]}}),a},n.prototype.getMinorTicks=function(t){return jS(this,t,Rf(this),this._interval)},n.prototype.setTimeInterval=function(t){this._interval=t.interval,this._approxInterval=t.approxInterval,this._minLevelUnit=t.minLevelUnit},n.parse=function(t){return K(t)?Math.round(t):+pa(t)},n.type="time",n}(vS),KS=[["second",zf],["minute",Bf],["hour",Vf],["quarter-day",216e5],["half-day",432e5],["day",10368e4],["half-week",3024e5],["week",6048e5],["month",26784e5],["quarter",8208e6],["half-year",Gf/2],["year",Gf]];function JS(t,e,n,r){return tg(new Date(e),t,r).getTime()===tg(new Date(n),t,r).getTime()}function QS(t,e){return(t/=Ff)>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function $S(t){return(t/=2592e6)>6?6:t>3?3:t>2?2:1}function tT(t){return(t/=Vf)>12?12:t>6?6:t>3.5?4:t>2?2:1}function eT(t,e){return(t/=e?Bf:zf)>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function nT(t){return Go(ma(t,!0),1)}function rT(t,e,n){var r=Math.max(0,N(jf,e)-1);return tg(new Date(t),jf[r],n).getTime()}vS.registerClass(qS);var iT=qS,oT=function(t){function n(e){var r=t.call(this)||this;r.type="log",r.parse=YS.parse,r.base=e.logBase||10;var i=[],o=[],a=r._lookup={from:i,to:o};i[0]=i[1]=o[0]=o[1]=NaN,TS(r,n.mapperMethods);var s=Of(),l=e.breakOption,u={lookup:a};return s&&s.parseAxisBreakOptionInwardTransform(l,r,{noNegative:!0},2,u),r.powStub=new YS({breakParsed:u.original}),r.intervalStub=new YS({breakParsed:u.transformed}),MS(r,r.intervalStub),r}return e(n,t),n.prototype.getTicks=function(t){var e=this.base,n=this.powStub,r=Of(),i=this.intervalStub,o={lookup:{from:i.getExtent(),to:n.getExtent()}};return V(i.getTicks(t||{}),function(t){var i,a=FS(t.value,e,o);if(r){var s=r.getTicksBreakOutwardTransform(this,t,Rf(n),this._lookup);s&&(i=s.vBreak,a=s.tickVal)}return{value:a,break:i}},this)},n.prototype.getMinorTicks=function(t){return jS(this,t,Rf(this.powStub),this.intervalStub.getConfig().interval)},n.prototype.getLabel=function(t,e){return this.intervalStub.getLabel(t,e)},n.type="log",n.mapperMethods={needTransform:function(){return!0},normalize:function(t){return this.intervalStub.normalize(VS(t,this.base))},scale:function(t){return FS(this.intervalStub.scale(t),this.base,null)},transformIn:function(t,e){return t=VS(t,this.base),e&&2===e.depth?t:this.intervalStub.transformIn(t,e)},transformOut:function(t,e){var n=e?e.depth:null;return aT.depth=n,sT.lookup=this._lookup,FS(2===n?t:this.intervalStub.transformOut(t,aT),this.base,sT)},contain:function(t){return this.powStub.contain(t)},setExtent:function(t,e){this.setExtent2(0,t,e)},setExtent2:function(t,e,n){if(!(!ms(e,n)||e<=0||n<=0)){var r=lT,i=lT;if(0===t){var o=this._lookup;r=o.to,i=o.from}this.powStub.setExtent2(t,r[0]=e,r[1]=n);var a=this.base;this.intervalStub.setExtent2(t,i[0]=VS(e,a),i[1]=VS(n,a))}},getFilter:function(){return{g:0}},sanitize:function(t,e){return ms(e[0],e[1])&&Ta(t)&&t<=0&&(t=e[0]),t},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(t,e){return null===e?this.powStub.getExtentUnsafe(t,null):this.intervalStub.getExtentUnsafe(t,e)}},n}(vS);vS.registerClass(oT);var aT={},sT={},lT=[],uT=oT,hT={value:1,category:1,time:1,log:1},cT=Qa();function dT(t){var e=t.get("type");return null!=e&&(wt(hT,e)||vS.getClass(e))||(e="value"),e}function pT(t,e,n){var r;switch(Of()&&(r=wT(t,e,n)),e){case"category":return new XS({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new iT({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC"),breakOption:r});case"log":return new uT({logBase:t.get("logBase"),breakOption:r});case"value":return new YS({breakOption:r});default:return new(vS.getClass(e)||YS)({})}}var fT=1,gT=2,mT=3;function vT(t){var e=t.getLabelModel().get("formatter");if("time"===t.type){var n=Yf(e);return function(e,r){return t.scale.getFormattedLabel(e,r,n)}}if(Y(e))return function(n){var r=t.scale.getLabel(n);return e.replace("{value}",null!=r?r:"")};if(Z(e)){if("category"===t.type)return function(n,r){return e(yT(t,n),n.value-t.scale.getExtent()[0],null)};var r=Of();return function(n,i){var o=null;return r&&(o=r.makeAxisLabelFormatterParamBreak(o,n.break)),e(yT(t,n),i,o)}}return function(e){return t.scale.getLabel(e)}}function yT(t,e){var n=t.scale;return kS(n)?n.getLabel(e):e.value}function _T(t){var e=t.get("interval");return null==e?"auto":e}function xT(t){return"middle"===t||"center"===t}function bT(t){return t.getShallow("show")}function wT(t,e,n){var r=t.get("breaks",!0);if(null!=r)return Of()?n&&function(t){return"category"!==t}(e)?r:void La("Axis"+(t instanceof tm?" "+t.type+"["+t.componentIndex+"]":"")+" does not support break."):void La('Must `import {AxisBreak} from "echarts/features.js"; use(AxisBreak);` first if using breaks option.')}function ST(t,e,n,r,i,o){var a,s,l=RS(t),u=l?t.intervalStub:t;if(u.setExtent(r[0],r[1]),l){var h=t.powStub,c={depth:2},d=t.transformOut(r[0],c),p=t.transformOut(r[1],c),f=(s=r,[(a=n)[0]!==s[0],a[1]!==s[1]]);e[0]&&!f[0]&&(d=i[0]),e[1]&&!f[1]&&(p=i[1]),h.setExtent(d,p)}u.setConfig(o)}function TT(t,e){return kS(t)?t.getRawOrdinalNumber(e.value):e.value}function MT(t,e){return kS(t)&&!!e.get("boundaryGap")}var CT,IT=function(){function t(){}return t.prototype.needIncludeZero=function(){return!this.option.scale},t.prototype.getCoordSysModel=function(){},t}(),AT=ys(),DT="|&",LT=Qa(),PT=Qa();function ET(t,e){var n=t.model,r=LT(dx(n.ecModel)).keyed,i=r&&r.get(e);return i&&i.get(n.uid)}function OT(t,e){return ht(null!=e),CT(t),RT(ET(t,e))}function NT(t,e){var n=LT(dx(t)).keyed;n&&n.each(function(t,n){t.each(function(t,r){e(t,n,r)})})}function RT(t){return{liPosMinGap:t?t.liPosMinGap:void 0}}function kT(t,e,n){ht(null!=e),CT(t);var r=ET(t,e);r&&zT(t.model.ecModel,r.sers,n)}function zT(t,e,n){if(e)for(var r=0;r<e.length;r++){var i=e[r];t.isSeriesFiltered(i)||n(i)}}function BT(t,e,n){ht(null!=e);var r=LT(dx(t)).keyed,i=r&&r.get(e);i&&i.each(function(t){ht(t.sers.length>0),n(t.axis)})}function VT(t,e){CT(t);var n=t.model,r=LT(dx(n.ecModel)).keys;r&&B(r.get(n.uid),function(n){var r=ET(t,n);ht(r&&r.sers.length>0),e(n)})}function FT(t){var e=PT(cx(t)),n=e.keyed||(e.keyed=yt());NT(t,function(e,r,i){var o=n.get(r)||n.set(r,yt()),a=o.get(i)||o.set(i,{});e.metrics.liPosMinGap&&HT.liPosMinGap(t,e,a)})}CT=function(t){ht(t&&t.model&&t.model.uid&&t.model.ecModel)};var GT,HT={};function UT(t,e,n){if(t){var r=e.ecModel,i=LT(dx(r)),o=t.model.uid;CT(t);var a=i.axSerPairCheck||(i.axSerPairCheck=yt()),s=""+o+DT+e.uid;ht(!a.get(s)),a.set(s,1);var l=i.axSer||(i.axSer=yt()),u=l.get(o)||l.set(o,[]),h=u[u.length-1];h&&ht(h.seriesIndex<e.seriesIndex),u.push(e);var c=e.subType,d=e.getBaseAxis()===t,p=jT.get(WT(c,d,n))||jT.get(WT(c,d,null));if(p){var f=i.keyed||(i.keyed=yt()),g=i.keys||(i.keys=yt()),m=p.key,v=f.get(m)||f.set(m,yt()),y=v.get(o);y||((y=v.set(o,{axis:t,sers:[],serByIdx:[]})).metrics=p.getMetrics(t),(g.get(o)||g.set(o,[])).push(m)),y.sers.push(e),y.serByIdx[e.seriesIndex]=e}}}function WT(t,e,n){return t+DT+at(e,!0)+DT+(n||"")}function XT(t,e){var n=WT(e.seriesType,e.baseAxis,e.coordSysType);ht(e.seriesType&&e.key&&!GT.get(e.key)&&!jT.get(n)),GT.set(e.key,1),jT.set(n,e),AT(t,function(){t.registerProcessor(t.PRIORITY.PROCESSOR.AXIS_STATISTICS,{overallReset:FT})})}GT=yt();var jT=yt(),ZT=Qa(),YT=function(){function t(t,e,n,r,i){var o,a=kS(t),s=a?e.getCategories().length:null;if(a){var l=e.getCategories(!0);o=l&&!l.length}var u=n.slice();(OS(t)||RS(t)||NS(t))&&(ps(u,KT(t,e.get("dataMin",!0))),fs(u,KT(t,e.get("dataMax",!0)))),function(t){var e=t[1]-t[0];return isFinite(e)&&e>=0}(u)||(u[0]=u[1]=NaN);var h=[],c=[!1,!1],d=e.get("min",!0);"dataMin"===d?(h[0]=u[0],c[0]=!0):(h[0]=KT(t,Z(d)?d({min:u[0],max:u[1]}):d),c[0]=null!=h[0]);var p=e.get("max",!0);"dataMax"===p?(h[1]=u[1],c[1]=!0):(h[1]=KT(t,Z(p)?p({min:u[0],max:u[1]}):p),c[1]=null!=h[1]);var f=function(t,e){var n;if(kS(t))n=[0,0];else{var r=e.get("boundaryGap");"boolean"==typeof r&&(!0===r&&console.warn('Boolean type for boundaryGap is only allowed for ordinal axis. Please use string in percentage instead, e.g., "20%". Currently, boundaryGap is set to 0.'),r=null),n=j(r)?r:[r,r]}return[JT(n[0]),JT(n[1])]}(t,e),g=a?null:u[1]-u[0]||Math.abs(u[0]);null==h[0]&&(h[0]=a?o?u[0]:s?0:NaN:u[0]-f[0]*g),null==h[1]&&(h[1]=a?o?u[1]:s?s-1:NaN:u[1]+f[1]*g),!gs(h[0])&&(h[0]=NaN),!gs(h[1])&&(h[1]=NaN);var m=o||it(h[0])||it(h[1])||a&&!s,v=OS(t),y=v&&e.needIncludeZero&&e.needIncludeZero();y&&(h[0]>0&&h[1]>0&&!c[0]&&(h[0]=0),h[0]<0&&h[1]<0&&!c[1]&&(h[1]=0));var _=!1;h[0]>h[1]&&(h.reverse(),_=!0);var x=KT(t,e.get("startValue",!0)),b=null!=x;!Ta(x)&&r&&(x=t.getDefaultStartValue?t.getDefaultStartValue():0),Ta(x)&&(b||!v||y)&&(x<h[0]&&!c[0]?(h[0]=x,c[0]=!0):x>h[1]&&!c[1]&&(h[1]=x,c[1]=!0)),qT(this._i={scale:t,dataMM:u,noZoomEffMM:h,zoomMM:[],fixMM:c,zoomFixMM:[!1,!1],startValue:x,isBlank:m,incl0:y,tggAxInv:_,ctnShp:i},h)}return t.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},t.prototype.makeFinal=function(){var t=this._i,e=t.zoomMM,n=t.noZoomEffMM,r=t.zoomFixMM,i=t.fixMM,o={fixMM:i,zoomFixMM:r,isBlank:t.isBlank,incl0:t.incl0,tggAxInv:t.tggAxInv,ctnShp:t.ctnShp,effMM:n.slice()},a=o.effMM;return null!=e[0]&&(a[0]=e[0],i[0]=r[0]=!0),null!=e[1]&&(a[1]=e[1],i[1]=r[1]=!0),qT(t,a),o},t.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},t.prototype.setZoomMM=function(t,e){this._i.zoomMM[t]=e},t}();function qT(t,e){var n=t.scale,r=t.dataMM;n.sanitize&&(e[0]=n.sanitize(e[0],r),e[1]=n.sanitize(e[1],r),vs(e))}function KT(t,e){return null==e?null:it(e)?NaN:t.parse(e)}function JT(t){return ho("boolean"==typeof t?0:t,1)||0}function QT(t){var e=ZT(t.scale);return e.extent||(e.extent=[1/0,-1/0]),e}function $T(t,e){var n=t.scale,r=t.model,i=t.dim;ht(n&&r&&i),n.rawExtentInfo?ht(n.rawExtentInfo.from!==e||2===e):function(t,e,n,r,i){var o=QT(e),a=o.extent,s=!1;!function(t,e){CT(t);var n=t.model.ecModel,r=LT(dx(n)).axSer;r&&zT(n,r.get(t.model.uid),e)}(e,function(r){if(r.boxCoordinateSystem){var i=Pg(r).coord,l=o.dimIdxInCoord;if(l>=0){if(j(i)){var u=i[l];null==u||j(u)||ds(a,t.parse(u))}}else La('Property "series.coord" is not supported on axis '+r.boxCoordinateSystem.type+".")}else if(r.coordinateSystem){var h=r.getData();if(h){var c=t.getFilter?t.getFilter():null;B(function(t,e){var n={};return B(t.mapDimensionsAll(e),function(e){n[fS(t,e)]=!0}),U(n)}(h,n),function(t){var e,n;e=a,ms((n=h.getApproximateExtent(t,c))[0],n[1])&&(n[0]<e[0]&&(e[0]=n[0]),n[1]>e[1]&&(e[1]=n[1]))})}r.__requireStartValue&&r.__requireStartValue(e)&&(s=!0)}});var l=function(t,e,n){var r=MT(t,n),i=n.get("containShape",!0);null!=i||r||(i=!0);if(!i)return!1;var o=!1;return VT(e,function(t){o=!!nM.get(t)||o}),o}(t,e,r),u=new YT(t,r,a,s,l);tM(t,u,i),o.extent=null}(n,t,i,r,e)}function tM(t,e,n){t.rawExtentInfo=e,e.from=n}function eM(t,e){ht(!nM.get(t)),nM.set(t,e)}var nM=yt();function rM(t,e,n,r,i){ht(!i||!t.rawExtentInfo),t.rawExtentInfo||function(t,e){var n=t.scale;ht(!n.rawExtentInfo),tM(n,new YT(n,t.model,e,!1,!1),3)}({scale:t,model:e},i||[1/0,-1/0]);var o=t.rawExtentInfo.makeFinal(),a=o.effMM;return t.setExtent(a[0],a[1]),t.setBlank(o.isBlank),r&&o.tggAxInv&&n&&!n.get("legacyMinMaxDontInverseAxis")&&(r.inverse=!r.inverse),o}function iM(t,e,n,r){var i;if(n.ctnShp&&(VT(t,function(e){var n=nM.get(e);if(n){var o=n(t,r);o&&(ps(i=i||[0,0],o[0]),fs(i,o[1]),function(t){cT(t).noOnMyZero=!0}(t))}}),i)){var o=e.getExtent();if(kS(e))t.onBand||e.setExtent2(1,Fo(o[0],o[0]+i[0]),Go(o[1],o[1]+i[1]));else{var a=o.slice();n.zoomFixMM[0]||(a[0]=Fo(a[0],e.transformOut(e.transformIn(a[0],null)+i[0],null))),n.zoomFixMM[1]||(a[1]=Go(a[1],e.transformOut(e.transformIn(a[1],null)+i[1],null))),(a[0]<o[0]||a[1]>o[1])&&e.setExtent2(1,a[0],a[1])}}}function oM(t,e){var n=RS(t),r=n?t.intervalStub:t,i=e.fixMinMax||[],o=n?t.getExtent():null,a=r.getExtent(),s=GS(a,i,e.rawExtentResult);r.setExtent(s[0],s[1]),s=r.getExtent();var l=n?function(t,e){var n=HS(e.splitNumber,10),r=t.getExtent(),i=AS(t);ht(isFinite(i)&&i>0);var o=Go(fa(i),1);n/i*o<=.5&&(o*=10);var a=BS(o),s=[ea(Xo(r[0]/o)*o,a),ea(Wo(r[1]/o)*o,a)];return{intervalPrecision:a,interval:o,niceExtent:s}}(r,e):function(t,e){var n=HS(e.splitNumber,5),r=AS(t);ht(isFinite(r)&&r>0);var i=e.minInterval,o=e.maxInterval,a=ma(r/n,!0);null!=i&&a<i&&(a=i);null!=o&&a>o&&(a=o);var s=BS(a),l=t.getExtent(),u=[ea(Xo(l[0]/a)*a,s),ea(Wo(l[1]/a)*a,s)];return{interval:a,intervalPrecision:s,niceExtent:u}}(r,e),u=l.intervalPrecision,h=l.interval,c=e.userInterval;null!=c&&(l.interval=c,l.intervalPrecision=BS(c)),i[0]||(s[0]=ea(Wo(s[0]/h)*h,u)),i[1]||(s[1]=ea(Xo(s[1]/h)*h,u)),null!=c&&(l.niceExtent=s.slice()),ST(t,i,a,s,o,l)}function aM(t){var e=t.scale,n=t.model,r=n.axis,i=n.ecModel;ht(r&&i),sM(e,n,r,i,null)}function sM(t,e,n,r,i){var o=rM(t,e,r,n,i),a=OS(t)||NS(t);lM(t,{splitNumber:e.get("splitNumber"),fixMinMax:o.fixMM,userInterval:e.get("interval"),minInterval:a?e.get("minInterval"):null,maxInterval:a?e.get("maxInterval"):null,rawExtentResult:o}),n&&r&&iM(n,t,o,r),t.freeze()}function lM(t,e){uM[t.type](t,e)}var uM={interval:oM,log:oM,time:function(t,e){var n=t.getExtent();if(n[0]===n[1]&&(n[0]-=Ff,n[1]+=Ff),n[1]===-1/0&&n[0]===1/0){var r=new Date;n[1]=+new Date(r.getFullYear(),r.getMonth(),r.getDate()),n[0]=n[1]-Ff}t.setExtent(n[0],n[1]);var i=HS(e.splitNumber,10),o=AS(t)/i,a=e.minInterval,s=e.maxInterval;null!=a&&o<a&&(o=a),null!=s&&o>s&&(o=s);var l=KS.length,u=Math.min(function(t,e,n,r){for(;n<r;){var i=n+r>>>1;t[i][1]<e?n=i+1:r=i}return n}(KS,o,0,l),l-1),h=KS[u][1],c=KS[Math.max(u-1,0)][0];t.setTimeInterval({approxInterval:o,interval:h,minLevelUnit:c})},ordinal:St};function hM(t){return gS(null,t)}var cM={isDimensionStacked:pS,enableDataStack:dS,getStackedDimension:fS};function dM(t,e){var n=e;e instanceof xf||(n=new xf(e));var r=pT(n,dT(n),!1);return t[1]<t[0]&&(t=t.slice().reverse()),sM(r,n,null,null,t),r}function pM(t){k(t,IT)}var fM=Object.freeze({__proto__:null,createDimensions:aS,createList:hM,createScale:dM,createSymbol:Cx,createTextStyle:function(t,e){return Yp(t,null,null,"normal"!==(e=e||{}).state)},dataStack:cM,enableHoverEmphasis:rc,getECData:$u,getLayoutRect:Ug,mixinAxisModelCommonMethods:pM}),gM=[],mM={registerPreprocessor:hw,registerProcessor:cw,registerPostInit:dw,registerPostUpdate:pw,registerUpdateLifecycle:fw,registerAction:gw,registerCoordinateSystem:mw,registerLayout:_w,registerVisual:xw,registerTransform:Iw,registerLoading:Sw,registerMap:Mw,registerImpl:function(t,e){ax[t]&&La("Already has an implementation of "+t+"."),ax[t]=e},PRIORITY:lb,ComponentModel:tm,ComponentView:Qy,SeriesModel:Ky,ChartView:l_,registerComponentModel:function(t){tm.registerClass(t)},registerComponentView:function(t){Qy.registerClass(t)},registerSeriesModel:function(t){Ky.registerClass(t)},registerChartView:function(t){l_.registerClass(t)},registerCustomSeries:function(t,e){ux(t,e)},registerSubTypeDefaulter:function(t,e){tm.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){Ro(t,e)}};function vM(t){j(t)?B(t,function(t){vM(t)}):N(gM,t)>=0||(gM.push(t),Z(t)&&(t={install:t}),t.install(mM))}function yM(t,e){return Math.abs(t-e)<1e-8}function _M(t,e,n){var r=0,i=t[0];if(!i)return!1;for(var o=1;o<t.length;o++){var a=t[o];r+=au(i[0],i[1],a[0],a[1],e,n),i=a}var s=t[0];return yM(i[0],s[0])&&yM(i[1],s[1])||(r+=au(i[0],i[1],s[0],s[1],e,n)),0!==r}var xM=[];function bM(t,e){for(var n=0;n<t.length;n++)Xt(t[n],t[n],e)}function wM(t,e,n,r){for(var i=0;i<t.length;i++){var o=t[i];r&&(o=r.project(o)),o&&isFinite(o[0])&&isFinite(o[1])&&(jt(e,e,o),Zt(n,n,o))}}var SM=function(){function t(t){this.name=t}return t.prototype.setCenter=function(t){this._center=t},t.prototype.getCenter=function(){var t=this._center;return t||(t=this._center=this.calcCenter()),t},t}(),TM=function(t,e){this.type="polygon",this.exterior=t,this.interiors=e},MM=function(t){this.type="linestring",this.points=t},CM=function(t){function n(e,n,r){var i=t.call(this,e)||this;return i.type="geoJSON",i.geometries=n,i._center=r&&[r[0],r[1]],i}return e(n,t),n.prototype.calcCenter=function(){for(var t,e=this.geometries,n=0,r=0;r<e.length;r++){var i=e[r],o=i.exterior,a=o&&o.length;a>n&&(t=i,n=a)}if(t)return function(t){for(var e=0,n=0,r=0,i=t.length,o=t[i-1][0],a=t[i-1][1],s=0;s<i;s++){var l=t[s][0],u=t[s][1],h=o*u-l*a;e+=h,n+=(o+l)*h,r+=(a+u)*h,o=l,a=u}return e?[n/e/3,r/e/3,e]:[t[0][0]||0,t[0][1]||0]}(t.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},n.prototype.getBoundingRect=function(t){var e=this._rect;if(e&&!t)return e;var n=[1/0,1/0],r=[-1/0,-1/0];return B(this.geometries,function(e){"polygon"===e.type?wM(e.exterior,n,r,t):B(e.points,function(e){wM(e,n,r,t)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])||(n[0]=n[1]=r[0]=r[1]=0),e=new ln(n[0],n[1],r[0]-n[0],r[1]-n[1]),t||(this._rect=e),e},n.prototype.contain=function(t){var e=this.getBoundingRect(),n=this.geometries;if(!e.contain(t[0],t[1]))return!1;t:for(var r=0,i=n.length;r<i;r++){var o=n[r];if("polygon"===o.type){var a=o.exterior,s=o.interiors;if(_M(a,t[0],t[1])){for(var l=0;l<(s?s.length:0);l++)if(_M(s[l],t[0],t[1]))continue t;return!0}}}return!1},n.prototype.transformTo=function(t,e,n,r){var i=this.getBoundingRect(),o=i.width/i.height;n?r||(r=n/o):n=o*r;for(var a=new ln(t,e,n,r),s=i.calculateTransform(a),l=this.geometries,u=0;u<l.length;u++){var h=l[u];"polygon"===h.type?(bM(h.exterior,s),B(h.interiors,function(t){bM(t,s)})):B(h.points,function(t){bM(t,s)})}(i=this._rect).copy(a),this._center=[i.x+i.width/2,i.y+i.height/2]},n.prototype.cloneShallow=function(t){null==t&&(t=this.name);var e=new n(t,this.geometries,this._center);return e._rect=this._rect,e.transformTo=null,e},n}(SM),IM=function(t){function n(e,n){var r=t.call(this,e)||this;return r.type="geoSVG",r._elOnlyForCalculate=n,r}return e(n,t),n.prototype.calcCenter=function(){for(var t=this._elOnlyForCalculate,e=t.getBoundingRect(),n=[e.x+e.width/2,e.y+e.height/2],r=Me(xM),i=t;i&&!i.isGeoSVGGraphicRoot;)Ie(r,i.getLocalTransform(),r),i=i.parent;return Pe(r,r),Xt(n,n,r),n},n}(SM);function AM(t,e,n){for(var r=0;r<t.length;r++)t[r]=DM(t[r],e[r],n)}function DM(t,e,n){for(var r=[],i=e[0],o=e[1],a=0;a<t.length;a+=2){var s=t.charCodeAt(a)-64,l=t.charCodeAt(a+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),i=s+=i,o=l+=o,r.push([s/n,l/n])}return r}function LM(t,e){return V(G((t=function(t){if(!t.UTF8Encoding)return t;var e=t,n=e.UTF8Scale;return null==n&&(n=1024),B(e.features,function(t){var e=t.geometry,r=e.encodeOffsets,i=e.coordinates;if(r)switch(e.type){case"LineString":e.coordinates=DM(i,r,n);break;case"Polygon":case"MultiLineString":AM(i,r,n);break;case"MultiPolygon":B(i,function(t,e){return AM(t,r[e],n)})}}),e.UTF8Encoding=!1,e}(t)).features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var n=t.properties,r=t.geometry,i=[];switch(r.type){case"Polygon":var o=r.coordinates;i.push(new TM(o[0],o.slice(1)));break;case"MultiPolygon":B(r.coordinates,function(t){t[0]&&i.push(new TM(t[0],t.slice(1)))});break;case"LineString":i.push(new MM([r.coordinates]));break;case"MultiLineString":i.push(new MM(r.coordinates))}var a=new CM(n[e||"name"],i,n.cp);return a.properties=n,a})}var PM=Object.freeze({__proto__:null,MAX_SAFE_INTEGER:ua,asc:ra,getPercentWithPrecision:function(t,e,n){return t[e]&&sa(t,n)[e]||0},getPixelPrecision:function(t,e){var n=Wo(Zo(t[1]-t[0])/Yo),r=Uo(Zo(Ho(e[1]-e[0]))/Yo),i=Fo(Go(-n+r,0),20);return isFinite(i)?i:20},getPrecision:ia,getPrecisionSafe:oa,isNumeric:xa,isRadianAroundZero:ca,linearMap:Jo,nice:ma,numericToNumber:_a,parseDate:pa,parsePercent:Qo,quantile:va,quantity:fa,quantityExponent:ga,reformIntervals:ya,remRadian:ha,round:na}),EM=Object.freeze({__proto__:null,format:Qf,parse:pa,roundTime:tg}),OM=Object.freeze({__proto__:null,Arc:wd,BezierCurve:_d,BoundingRect:ln,Circle:Rc,CompoundPath:Td,Ellipse:Bc,Group:Do,Image:Iu,IncrementalDisplayable:Gd,Line:fd,LinearGradient:Id,Polygon:sd,Polyline:hd,RadialGradient:Ad,Rect:Ru,Ring:rd,Sector:td,Text:Qu,clipPointsByRect:yp,clipRectByRect:_p,createIcon:xp,extendPath:rp,extendShape:ep,getShapeClass:op,getTransform:pp,initProps:jd,makeImage:sp,makePath:ap,mergePath:up,registerShape:ip,resizePath:hp,updateProps:Xd}),NM=Object.freeze({__proto__:null,addCommas:gg,capitalFirst:function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},encodeHTML:ue,formatTime:Tg,formatTpl:bg,getTextRect:function(t,e,n,r,i,o,a,s){return new Qu({style:{text:t,font:e,align:n,verticalAlign:r,padding:i,rich:o,overflow:a?"truncate":null,lineHeight:s}}).getBoundingRect()},getTooltipMarker:Sg,normalizeCssArray:vg,toCamelCase:mg,truncateText:function(t,e,n,r,i){var o={};return js(o,t,e,n,r,i),o.text}}),RM=Object.freeze({__proto__:null,bind:W,clone:I,curry:X,defaults:E,each:B,extend:L,filter:G,indexOf:N,inherits:R,isArray:j,isFunction:Z,isObject:J,isString:Y,map:V,merge:A,reduce:F}),kM=Qa(),zM=Qa(),BM=1,VM=2;function FM(t){return{out:{noPxChangeTryDetermine:[]},kind:t}}function GM(t,e){var n=t.getLabelModel().get("customValues");if(n){var r=t.scale;return{labels:V(UM(n,r),function(e,n){return{formattedLabel:vT(t)(e,n),rawLabel:r.getLabel(e),tick:e}})}}return"category"===t.type?function(t,e){var n=t.getLabelModel(),r=WM(t,n,e);return!n.get("show")||t.scale.isBlank()?{labels:[]}:r}(t,e):function(t){var e=t.scale.getTicks(),n=vT(t);return{labels:V(e,function(e,r){return{formattedLabel:n(e,r),rawLabel:t.scale.getLabel(e),tick:e}})}}(t)}function HM(t,e,n){var r=t.scale,i=t.getTickModel().get("customValues");return i?{ticks:UM(i,r)}:"category"===t.type?function(t,e){var n,r,i=XM(t),o=_T(e),a=YM(i,o);if(a)return a;e.get("show")&&!t.scale.isBlank()||(n=[]);if(Z(o))n=QM(t,o,!0);else if("auto"===o){var s=WM(t,t.getLabelModel(),FM(VM));r=s.labelCategoryInterval,n=V(s.labels,function(t){return t.tick})}else n=QM(t,r=o,!0);return qM(i,o,{ticks:n,tickCategoryInterval:r})}(t,e):{ticks:r.getTicks(n)}}function UM(t,e){var n=e.getExtent(),r=[];return B(t,function(t){(t=e.parse(t))>=n[0]&&t<=n[1]&&r.push(t)}),xs(r,ws,null),ra(r),V(r,function(t){return{value:t}})}function WM(t,e,n){var r,i,o=jM(t),a=_T(e),s=n.kind===BM;if(!s){var l=YM(o,a);if(l)return l}Z(a)?r=QM(t,a,!1):(i="auto"===a?function(t,e){if(e.kind===BM){var n=t.calculateCategoryInterval(e);return e.out.noPxChangeTryDetermine.push(function(){return zM(t).autoInterval=n,!0}),n}var r=zM(t).autoInterval;return null!=r?r:zM(t).autoInterval=t.calculateCategoryInterval(e)}(t,n):a,r=QM(t,i,!1));var u={labels:r,labelCategoryInterval:i};return s?n.out.noPxChangeTryDetermine.push(function(){return qM(o,a,u),!0}):qM(o,a,u),u}var XM=ZM("axisTick"),jM=ZM("axisLabel");function ZM(t){return function(e){return zM(e)[t]||(zM(e)[t]={list:[]})}}function YM(t,e){for(var n=0;n<t.list.length;n++)if(t.list[n].key===e)return t.list[n].value}function qM(t,e,n){return t.list.push({key:e,value:n}),n}function KM(t,e,n){return null==JM(t,e,n)}function JM(t,e,n){var r=kM(t.model),i=t.getExtent(),o=r.lastAutoInterval,a=r.lastTickCount;if(null!=o&&null!=a&&Math.abs(o-e)<=1&&Math.abs(a-n)<=1&&o>e&&r.axisExtent0===i[0]&&r.axisExtent1===i[1])return o;r.lastTickCount=n,r.lastAutoInterval=e,r.axisExtent0=i[0],r.axisExtent1=i[1]}function QM(t,e,n){var r=vT(t),i=t.scale,o=[],a=Z(e);return US(i,a?0:e,function(t,s){var l=i.getLabel(t);if(a){var u=!!e(t.value,l);if(t.offInterval=!u,!u&&!s)return}o.push(n?t:{formattedLabel:r(t),rawLabel:l,tick:t})}),o}function $M(t,e){e=e||{};var n,r={w:NaN,w2:NaN},i=t.scale,o=e.fromStat,a=e.min,s=(n=IS(i,3))[1]-n[0];Ta(s)||(s=NaN);var l=t.getExtent(),u=Ho(l[1]-l[0]);return kS(i)?function(t,e,n,r){var i=e.onBand,o=n+(i?1:0);0===o&&(o=1),t.w=r/o,!i&&n&&r&&(t.w2=t.w*n/r)}(r,t,s,u):o?function(t,e,n,r,i){ht(i);var o=!1,a=-1/0;B(i.key?[OT(e,i.key)]:function(t,e){CT(t);var n=[];return NT(t.model.ecModel,function(t){for(var r=0;r<e.length;r++)e[r]&&t.serByIdx[e[r].seriesIndex]&&n.push(RT(t))}),n}(e,i.sers||[]),function(t){var e=t.liPosMinGap;null!=e&&(e>0?(e>a&&(a=e),o=!1):-2===e&&(o=!0))}),Ta(n)&&n>0&&Ta(a)?(t.w=r/n*a,t.w2=a):o&&(t.w=.8*r,t.w2=t.w*n/r)}(r,t,s,u,o):null==a&&ht(!1),null!=a&&(r.w=Ta(r.w)?Go(a,r.w):a),r}var tC=[0,1],eC=function(){function t(t,e,n){this.onBand=!1,this.inverse=!1,this.dim=t,this.scale=e,this._extent=n||[0,0]}return t.prototype.contain=function(t){var e=this._extent,n=Math.min(e[0],e[1]),r=Math.max(e[0],e[1]);return t>=n&&t<=r},t.prototype.containData=function(t){return this.scale.contain(this.scale.parse(t))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(t,e){var n=this._extent;n[0]=t,n[1]=e},t.prototype.dataToCoord=function(t,e){var n=this.scale;return Jo(t=n.normalize(n.parse(t)),tC,nC(this),e)},t.prototype.coordToData=function(t,e){var n=Jo(t,nC(this),tC,e);return this.scale.scale(n)},t.prototype.pointToData=function(t,e){},t.prototype.getTicksCoords=function(t){var e=(t=t||{}).tickModel||this.getTickModel(),n=V(HM(this,e,{breakTicks:t.breakTicks,pruneByBreak:t.pruneByBreak}).ticks,function(t){return{coord:this.dataToCoord(TT(this.scale,t)),tick:t}},this),r=function(t,e,n){var r=e.length;if(!t.onBand||n||!r)return!1;var i=$M(t).w;if(!i)return!1;B(e,function(t){t.coord-=i/2});var o=t.scale.getExtent(),a=e[r-1];a.tick.offInterval&&e.pop();return e.push({coord:a.coord+i,tick:{value:o[1]+1}}),!0}(this,n,e.get("alignWithLabel"));return V(n,function(t){return{coord:t.coord,tickValue:t.tick.value,onBand:r}})},t.prototype.getMinorTicksCoords=function(){if(kS(this.scale))return[];var t=this.model.getModel("minorTick").get("splitNumber");return t>0&&t<100||(t=5),V(this.scale.getMinorTicks(t),function(t){return V(t,function(t){return{coord:this.dataToCoord(t),tickValue:t}},this)},this)},t.prototype.getViewLabels=function(t){return GM(this,t=t||FM(VM)).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){return $M(this,{min:1}).w},t.prototype.calculateCategoryInterval=function(t){return function(t,e){var n=e.kind,r=function(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()}}(t),i=vT(t),o=(r.axisRotate-r.labelRotate)/180*Math.PI,a=t.scale,s=a.getExtent(),l=a.count();if(s[1]-s[0]<1)return 0;var u=1;l>40&&(u=Math.max(1,Math.floor(l/40)));for(var h=s[0],c=t.dataToCoord(h+1)-t.dataToCoord(h),d=Math.abs(c*Math.cos(o)),p=Math.abs(c*Math.sin(o)),f=0,g=0;h<=s[1];h+=u){var m,v,y=ao(i({value:h}),r.font,"center","top");m=1.3*y.width,v=1.3*y.height,f=Math.max(f,m,7),g=Math.max(g,v,7)}var _=f/d,x=g/p;isNaN(_)&&(_=1/0),isNaN(x)&&(x=1/0);var b=Math.max(0,Math.floor(Math.min(_,x)));if(n===BM)return e.out.noPxChangeTryDetermine.push(W(KM,null,t,b,l)),b;var w=JM(t,b,l);return null!=w?w:b}(this,t=t||FM(VM))},t}();function nC(t){var e=t.getExtent();if(t.onBand){var n=(e[1]-e[0])/t.scale.count()/2;e[0]+=n,e[1]-=n}return e}var rC=eC;function iC(t){var e=tm.extend(t);return tm.registerClass(e),e}function oC(t){var e=Qy.extend(t);return Qy.registerClass(e),e}function aC(t){var e=Ky.extend(t);return Ky.registerClass(e),e}function sC(t){var e=l_.extend(t);return l_.registerClass(e),e}var lC=2*Math.PI,uC=Ql.CMD,hC=["top","right","bottom","left"];function cC(t,e,n,r,i){var o=n.width,a=n.height;switch(t){case"top":r.set(n.x+o/2,n.y-e),i.set(0,-1);break;case"bottom":r.set(n.x+o/2,n.y+a+e),i.set(0,1);break;case"left":r.set(n.x-e,n.y+a/2),i.set(-1,0);break;case"right":r.set(n.x+o+e,n.y+a/2),i.set(1,0)}}function dC(t,e,n,r,i,o,a,s,l){a-=t,s-=e;var u=Math.sqrt(a*a+s*s),h=(a/=u)*n+t,c=(s/=u)*n+e;if(Math.abs(r-i)%lC<1e-4)return l[0]=h,l[1]=c,u-n;if(o){var d=r;r=ru(i),i=ru(d)}else r=ru(r),i=ru(i);r>i&&(i+=lC);var p=Math.atan2(s,a);if(p<0&&(p+=lC),p>=r&&p<=i||p+lC>=r&&p+lC<=i)return l[0]=h,l[1]=c,u-n;var f=n*Math.cos(r)+t,g=n*Math.sin(r)+e,m=n*Math.cos(i)+t,v=n*Math.sin(i)+e,y=(f-a)*(f-a)+(g-s)*(g-s),_=(m-a)*(m-a)+(v-s)*(v-s);return y<_?(l[0]=f,l[1]=g,Math.sqrt(y)):(l[0]=m,l[1]=v,Math.sqrt(_))}function pC(t,e,n,r,i,o,a,s){var l=i-t,u=o-e,h=n-t,c=r-e,d=Math.sqrt(h*h+c*c),p=(l*(h/=d)+u*(c/=d))/d;s&&(p=Math.min(Math.max(p,0),1)),p*=d;var f=a[0]=t+p*h,g=a[1]=e+p*c;return Math.sqrt((f-i)*(f-i)+(g-o)*(g-o))}function fC(t,e,n,r,i,o,a){n<0&&(t+=n,n=-n),r<0&&(e+=r,r=-r);var s=t+n,l=e+r,u=a[0]=Math.min(Math.max(i,t),s),h=a[1]=Math.min(Math.max(o,e),l);return Math.sqrt((u-i)*(u-i)+(h-o)*(h-o))}var gC=[];function mC(t,e,n){var r=fC(e.x,e.y,e.width,e.height,t.x,t.y,gC);return n.set(gC[0],gC[1]),r}function vC(t,e,n){for(var r,i,o=0,a=0,s=0,l=0,u=1/0,h=e.data,c=t.x,d=t.y,p=0;p<h.length;){var f=h[p++];1===p&&(s=o=h[p],l=a=h[p+1]);var g=u;switch(f){case uC.M:o=s=h[p++],a=l=h[p++];break;case uC.L:g=pC(o,a,h[p],h[p+1],c,d,gC,!0),o=h[p++],a=h[p++];break;case uC.C:g=Kn(o,a,h[p++],h[p++],h[p++],h[p++],h[p],h[p+1],c,d,gC),o=h[p++],a=h[p++];break;case uC.Q:g=nr(o,a,h[p++],h[p++],h[p],h[p+1],c,d,gC),o=h[p++],a=h[p++];break;case uC.A:var m=h[p++],v=h[p++],y=h[p++],_=h[p++],x=h[p++],b=h[p++];p+=1;var w=!!(1-h[p++]);r=Math.cos(x)*y+m,i=Math.sin(x)*_+v,p<=1&&(s=r,l=i),g=dC(m,v,_,x,x+b,w,(c-m)*_/y+m,d,gC),o=Math.cos(x+b)*y+m,a=Math.sin(x+b)*_+v;break;case uC.R:g=fC(s=o=h[p++],l=a=h[p++],h[p++],h[p++],c,d,gC);break;case uC.Z:g=pC(o,a,s,l,c,d,gC,!0),o=s,a=l}g<u&&(u=g,n.set(gC[0],gC[1]))}return u}var yC=new Re,_C=new Re,xC=new Re,bC=new Re,wC=new Re;function SC(t,e){if(t){var n=t.getTextGuideLine(),r=t.getTextContent();if(r&&n){var i=t.textGuideLineConfig||{},o=[[0,0],[0,0],[0,0]],a=i.candidates||hC,s=r.getBoundingRect().clone();s.applyTransform(r.getComputedTransform());var l=1/0,u=i.anchor,h=t.getComputedTransform(),c=h&&Pe([],h),d=e.get("length2")||0;u&&xC.copy(u);for(var p=0;p<a.length;p++){cC(a[p],0,s,yC,bC),Re.scaleAndAdd(_C,yC,bC,d),_C.transform(c);var f=t.getBoundingRect(),g=u?u.distance(_C):t instanceof xu?vC(_C,t.path,xC):mC(_C,f,xC);g<l&&(l=g,_C.transform(h),xC.transform(h),xC.toArray(o[0]),_C.toArray(o[1]),yC.toArray(o[2]))}CC(o,e.get("minTurnAngle")),n.setShape({points:o})}}}var TC=[],MC=new Re;function CC(t,e){if(e<=180&&e>0){e=e/180*Math.PI,yC.fromArray(t[0]),_C.fromArray(t[1]),xC.fromArray(t[2]),Re.sub(bC,yC,_C),Re.sub(wC,xC,_C);var n=bC.len(),r=wC.len();if(!(n<.001||r<.001)){bC.scale(1/n),wC.scale(1/r);var i=bC.dot(wC);if(Math.cos(e)<i){var o=pC(_C.x,_C.y,xC.x,xC.y,yC.x,yC.y,TC,!1);MC.fromArray(TC),MC.scaleAndAdd(wC,o/Math.tan(Math.PI-e));var a=xC.x!==_C.x?(MC.x-_C.x)/(xC.x-_C.x):(MC.y-_C.y)/(xC.y-_C.y);if(isNaN(a))return;a<0?Re.copy(MC,_C):a>1&&Re.copy(MC,xC),MC.toArray(t[1])}}}}function IC(t,e,n){if(n<=180&&n>0){n=n/180*Math.PI,yC.fromArray(t[0]),_C.fromArray(t[1]),xC.fromArray(t[2]),Re.sub(bC,_C,yC),Re.sub(wC,xC,_C);var r=bC.len(),i=wC.len();if(!(r<.001||i<.001))if(bC.scale(1/r),wC.scale(1/i),bC.dot(e)<Math.cos(n)){var o=pC(_C.x,_C.y,xC.x,xC.y,yC.x,yC.y,TC,!1);MC.fromArray(TC);var a=Math.PI/2,s=a+Math.acos(wC.dot(e))-n;if(s>=a)Re.copy(MC,xC);else{MC.scaleAndAdd(wC,o/Math.tan(Math.PI/2-s));var l=xC.x!==_C.x?(MC.x-_C.x)/(xC.x-_C.x):(MC.y-_C.y)/(xC.y-_C.y);if(isNaN(l))return;l<0?Re.copy(MC,_C):l>1&&Re.copy(MC,xC)}MC.toArray(t[1])}}}function AC(t,e,n,r){var i="normal"===n,o=i?t:t.ensureState(n);o.ignore=e;var a=r.get("smooth");a=!0===a?.3:Math.max(+a,0)||0,o.shape=o.shape||{},o.shape.smooth=a;var s=r.getModel("lineStyle").getLineStyle();i?t.useStyle(s):o.style=s}function DC(t,e){var n=e.smooth,r=e.points;if(r)if(t.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=Gt(r[0],r[1]),o=Gt(r[1],r[2]);if(!i||!o)return t.lineTo(r[1][0],r[1][1]),void t.lineTo(r[2][0],r[2][1]);var a=Math.min(i,o)*n,s=Wt([],r[1],r[0],a/i),l=Wt([],r[1],r[2],a/o),u=Wt([],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],r[2][0],r[2][1])}else for(var h=1;h<r.length;h++)t.lineTo(r[h][0],r[h][1])}function LC(t,e,n){var r=t.getTextGuideLine(),i=t.getTextContent();if(i){for(var o=e.normal,a=o.get("show"),s=i.ignore,l=0;l<bh.length;l++){var u=bh[l],h=e[u],c="normal"===u;if(h){var d=h.get("show");if((c?s:at(i.states[u]&&i.states[u].ignore,s))||!at(d,a)){var p=c?r:r&&r.states[u];p&&(p.ignore=!0),r&&AC(r,!0,u,h);continue}r||(r=new hd,t.setTextGuideLine(r),c||!s&&a||AC(r,!0,"normal",e.normal),t.stateProxy&&(r.stateProxy=t.stateProxy)),AC(r,!1,u,h)}}if(r){E(r.style,n),r.style.fill=null;var f=o.get("showAbove");(t.textGuideLineConfig=t.textGuideLineConfig||{}).showAbove=f||!1,r.buildPath=DC}}else r&&t.removeTextGuideLine()}function PC(t,e){e=e||"labelLine";for(var n={normal:t.getModel(e)},r=0;r<xh.length;r++){var i=xh[r];n[i]=t.getModel([i,e])}return n}var EC=["label","labelLine","layoutOption","priority","defaultAttr","marginForce","minMarginForce","marginDefault","suggestIgnore"];function OC(t,e,n){n=n||3,e?t.dirty|=n:t.dirty&=~n}function NC(t,e){return e=e||3,null==t.dirty||!!(t.dirty&e)}function RC(t){if(t)return NC(t)&&kC(t,t.label,t),t}function kC(t,e,n){var r=e.getComputedTransform();t.transform=Op(t.transform,r);var i=t.localRect=Ep(t.localRect,e.getBoundingRect()),o=e.style,a=o.margin,s=n&&n.marginForce,l=n&&n.minMarginForce,u=n&&n.marginDefault,h=o.__marginType;null==h&&u&&(a=u,h=sf.textMargin);for(var c=0;c<4;c++)zC[c]=h===sf.minMargin&&l&&null!=l[c]?l[c]:s&&null!=s[c]?s[c]:a?a[c]:0;h===sf.textMargin&&Tp(i,zC,!1,!1);var d=t.rect=Ep(t.rect,i);return r&&d.applyTransform(r),h===sf.minMargin&&Tp(d,zC,!1,!1),t.axisAligned=Lp(r),(t.label=t.label||{}).ignore=e.ignore,OC(t,!1),OC(t,!0,2),t}var zC=[0,0,0,0];function BC(t,e){if(t){t.label.x+=e.x,t.label.y+=e.y,t.label.markRedraw();var n=t.transform;n&&(n[4]+=e.x,n[5]+=e.y);var r=t.rect;r&&(r.x+=e.x,r.y+=e.y);var i=t.obb;i&&i.fromBoundingRect(t.localRect,n)}}function VC(t,e){for(var n=0;n<EC.length;n++){var r=EC[n];null==t[r]&&(t[r]=e[r])}return RC(t)}function FC(t){var e=t.obb;return e&&!NC(t,2)||(t.obb=e=e||new Bd,e.fromBoundingRect(t.localRect,t.transform),OC(t,!1,2)),e}function GC(t,e,n,r,i){var o=t.length,a=$d[e],s=tp[e];if(o<2)return!1;t.sort(function(t,e){return t.rect[a]-e.rect[a]});for(var l,u=0,h=!1,c=0,d=0;d<o;d++){var p=t[d],f=p.rect;(l=f[a]-u)<0&&(f[a]-=l,p.label[a]-=l,h=!0),c+=Math.max(-l,0),u=f[a]+f[s]}c>0&&i&&b(-c/o,0,o);var g,m,v=t[0],y=t[o-1];function _(){g=v.rect[a]-n,m=r-y.rect[a]-y.rect[s]}function x(t,e,n){if(t<0){var r=Math.min(e,-t);if(r>0){b(r*n,0,o);var i=r+t;i<0&&w(-i*n,1)}else w(-t*n,1)}}function b(e,n,r){0!==e&&(h=!0);for(var i=n;i<r;i++){var o=t[i];o.rect[a]+=e,o.label[a]+=e}}function w(e,n){for(var r=[],i=0,l=1;l<o;l++){var u=t[l-1].rect,h=Math.max(t[l].rect[a]-u[a]-u[s],0);r.push(h),i+=h}if(i){var c=Math.min(Math.abs(e)/i,n);if(e>0)for(l=0;l<o-1;l++){b(r[l]*c,0,l+1)}else for(l=o-1;l>0;l--){b(-(r[l-1]*c),l,o)}}}function S(t){var e=t<0?-1:1;t=Math.abs(t);for(var n=Math.ceil(t/(o-1)),r=0;r<o-1;r++)if(e>0?b(n,0,r+1):b(-n,o-r-1,o),(t-=n)<=0)return}return _(),g<0&&w(-g,.8),m<0&&w(m,.8),_(),x(g,m,1),x(m,g,-1),_(),g<0&&S(-g),m<0&&S(m),h}function HC(t){var e=[];function n(t){if(!t.ignore){var e=t.ensureState("emphasis");null==e.ignore&&(e.ignore=!1)}t.ignore=!0}t.sort(function(t,e){return(e.suggestIgnore?1:0)-(t.suggestIgnore?1:0)||e.priority-t.priority});for(var r=0;r<t.length;r++){var i=RC(t[r]);if(!i.label.ignore){for(var o=i.label,a=i.labelLine,s=!1,l=0;l<e.length;l++)if(UC(i,e[l],null,{touchThreshold:.05})){s=!0;break}s?(n(o),a&&n(a)):e.push(i)}}}function UC(t,e,n,r){return!(!t||!e)&&(!(t.label&&t.label.ignore||e.label&&e.label.ignore)&&(!!t.rect.intersect(e.rect,n,r)&&(!(!t.axisAligned||!e.axisAligned)||FC(t).intersect(FC(e),n,r))))}function WC(t){if(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n].slice());return e}}function XC(t,e){var n=t.label,r=e&&e.getTextGuideLine();return{dataIndex:t.dataIndex,dataType:t.dataType,seriesIndex:t.seriesModel.seriesIndex,text:t.label.style.text,rect:t.hostRect,labelRect:t.rect,align:n.style.align,verticalAlign:n.style.verticalAlign,labelLinePoints:WC(r&&r.shape.points)}}var jC=["align","verticalAlign","width","height","fontSize"],ZC=new $i,YC=Qa(),qC=Qa();function KC(t,e,n){for(var r=0;r<n.length;r++){var i=n[r];null!=e[i]&&(t[i]=e[i])}}var JC=["x","y","rotation"],QC=function(){function t(){this._labelList=[],this._chartViewList=[]}return t.prototype.clearLabels=function(){this._labelList=[],this._chartViewList=[]},t.prototype._addLabel=function(t,e,n,r,i){var o=r.style,a=r.__hostTarget.textConfig||{},s=r.getComputedTransform(),l=r.getBoundingRect().plain();ln.applyTransform(l,l,s),s?ZC.setLocalTransform(s):(ZC.x=ZC.y=ZC.rotation=ZC.originX=ZC.originY=0,ZC.scaleX=ZC.scaleY=1),ZC.rotation=ru(ZC.rotation);var u,h=r.__hostTarget;if(h){u=h.getBoundingRect().plain();var c=h.getComputedTransform();ln.applyTransform(u,u,c)}var d=u&&h.getTextGuideLine();this._labelList.push({label:r,labelLine:d,seriesModel:n,dataIndex:t,dataType:e,layoutOptionOrCb:i,layoutOption:null,rect:l,hostRect:u,priority:u?u.width*u.height:0,defaultAttr:{ignore:r.ignore,labelGuideIgnore:d&&d.ignore,x:ZC.x,y:ZC.y,scaleX:ZC.scaleX,scaleY:ZC.scaleY,rotation:ZC.rotation,style:{x:o.x,y:o.y,align:o.align,verticalAlign:o.verticalAlign,width:o.width,height:o.height,fontSize:o.fontSize},cursor:r.cursor,attachedPos:a.position,attachedRot:a.rotation}})},t.prototype.addLabelsOfSeries=function(t){var e=this;this._chartViewList.push(t);var n=t.__model,r=n.get("labelLayout");(Z(r)||U(r).length)&&t.group.traverse(function(t){if(t.ignore)return!0;var i=t.getTextContent(),o=$u(t);i&&!i.disableLabelLayout&&e._addLabel(o.dataIndex,o.dataType,n,i,r)})},t.prototype.updateLayoutConfig=function(t){var e=t.getWidth(),n=t.getHeight();function r(t,e){return function(){SC(t,e)}}for(var i=0;i<this._labelList.length;i++){var o=this._labelList[i],a=o.label,s=a.__hostTarget,l=o.defaultAttr,u=void 0;u=(u=Z(o.layoutOptionOrCb)?o.layoutOptionOrCb(XC(o,s)):o.layoutOptionOrCb)||{},o.layoutOption=u;var h=Math.PI/180;s&&s.setTextConfig({local:!1,position:null!=u.x||null!=u.y?null:l.attachedPos,rotation:null!=u.rotate?u.rotate*h:l.attachedRot,offset:[u.dx||0,u.dy||0]});var c=!1;if(null!=u.x?(a.x=Qo(u.x,e),a.setStyle("x",0),c=!0):(a.x=l.x,a.setStyle("x",l.style.x)),null!=u.y?(a.y=Qo(u.y,n),a.setStyle("y",0),c=!0):(a.y=l.y,a.setStyle("y",l.style.y)),u.labelLinePoints){var d=s.getTextGuideLine();d&&(d.setShape({points:u.labelLinePoints}),c=!1)}YC(a).needsUpdateLabelLine=c,a.rotation=null!=u.rotate?u.rotate*h:l.rotation,a.scaleX=l.scaleX,a.scaleY=l.scaleY;for(var p=0;p<jC.length;p++){var f=jC[p];a.setStyle(f,null!=u[f]?u[f]:l.style[f])}if(u.draggable){if(a.draggable=!0,a.cursor="move",s){var g=o.seriesModel;if(null!=o.dataIndex)g=o.seriesModel.getData(o.dataType).getItemModel(o.dataIndex);a.on("drag",r(s,g.getModel("labelLine")))}}else a.off("drag"),a.cursor=l.cursor}},t.prototype.layout=function(t){var e=t.getWidth(),n=t.getHeight(),r=[];B(this._labelList,function(t){t.defaultAttr.ignore||r.push(VC({},t))});var i=G(r,function(t){return"shiftX"===t.layoutOption.moveOverlap}),o=G(r,function(t){return"shiftY"===t.layoutOption.moveOverlap});GC(i,0,0,e),GC(o,1,0,n);var a=G(r,function(t){return t.layoutOption.hideOverlap});!function(t){for(var e=0;e<t.length;e++){var n=t[e],r=n.defaultAttr,i=n.labelLine;n.label.attr("ignore",r.ignore),i&&i.attr("ignore",r.labelGuideIgnore)}}(a),HC(a)},t.prototype.processLabelsOverall=function(){var t=this;B(this._chartViewList,function(e){var n=e.__model,r=e.ignoreLabelLineUpdate,i=n.isAnimationEnabled();e.group.traverse(function(e){if(e.ignore&&!e.forceLabelAnimation)return!0;var o=!r,a=e.getTextContent();!o&&a&&(o=YC(a).needsUpdateLabelLine),o&&t._updateLabelLine(e,n),i&&t._animateLabels(e,n)})})},t.prototype._updateLabelLine=function(t,e){var n=t.getTextContent(),r=$u(t),i=r.dataIndex;if(n&&null!=i){var o=e.getData(r.dataType),a=o.getItemModel(i),s={},l=o.getItemVisual(i,"style");if(l){var u=o.getVisual("drawType");s.stroke=l[u]}var h=a.getModel("labelLine");LC(t,PC(a),s),SC(t,h)}},t.prototype._animateLabels=function(t,e){var n=t.getTextContent(),r=t.getTextGuideLine();if(n&&(t.forceLabelAnimation||!n.ignore&&!n.invisible&&!t.disableLabelAnimation&&!Zd(t))){var i=(p=YC(n)).oldLayout,o=$u(t),a=o.dataIndex,s={x:n.x,y:n.y,rotation:n.rotation},l=e.getData(o.dataType);if(i){n.attr(i);var u=t.prevStates;u&&(N(u,"select")>=0&&n.attr(p.oldLayoutSelect),N(u,"emphasis")>=0&&n.attr(p.oldLayoutEmphasis)),Xd(n,s,e,a)}else if(n.attr(s),!ef(n).valueAnimation){var h=at(n.style.opacity,1);n.style.opacity=0,jd(n,{style:{opacity:h}},e,a)}if(p.oldLayout=s,n.states.select){var c=p.oldLayoutSelect={};KC(c,s,JC),KC(c,n.states.select,JC)}if(n.states.emphasis){var d=p.oldLayoutEmphasis={};KC(d,s,JC),KC(d,n.states.emphasis,JC)}rf(n,a,l,e,e)}if(r&&!r.ignore&&!r.invisible){i=(p=qC(r)).oldLayout;var p,f={points:r.shape.points};i?(r.attr({shape:i}),Xd(r,{shape:f},e)):(r.setShape(f),r.style.strokePercent=0,jd(r,{style:{strokePercent:1}},e)),p.oldLayout=f}},t}(),$C=QC,tI=Qa();function eI(t){t.registerUpdateLifecycle("series:beforeupdate",function(t,e,n){var r=tI(e).labelManager;r||(r=tI(e).labelManager=new $C),r.clearLabels()}),t.registerUpdateLifecycle("series:layoutlabels",function(t,e,n){var r=tI(e).labelManager;B(n.updatedSeries,function(t){r.addLabelsOfSeries(e.getViewOfSeriesModel(t))}),r.updateLayoutConfig(e),r.layout(e),r.processLabelsOverall()})}var nI=Math.sin,rI=Math.cos,iI=Math.PI,oI=2*Math.PI,aI=180/iI,sI=function(){function t(){}return t.prototype.reset=function(t){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,t||4)},t.prototype.moveTo=function(t,e){this._add("M",t,e)},t.prototype.lineTo=function(t,e){this._add("L",t,e)},t.prototype.bezierCurveTo=function(t,e,n,r,i,o){this._add("C",t,e,n,r,i,o)},t.prototype.quadraticCurveTo=function(t,e,n,r){this._add("Q",t,e,n,r)},t.prototype.arc=function(t,e,n,r,i,o){this.ellipse(t,e,n,n,0,r,i,o)},t.prototype.ellipse=function(t,e,n,r,i,o,a,s){var l=a-o,u=!s,h=Math.abs(l),c=Fr(h-oI)||(u?l>=oI:-l>=oI),d=l>0?l%oI:l%oI+oI,p=!1;p=!!c||!Fr(h)&&d>=iI==!!u;var f=t+n*rI(o),g=e+r*nI(o);this._start&&this._add("M",f,g);var m=Math.round(i*aI);if(c){var v=1/this._p,y=(u?1:-1)*(oI-v);this._add("A",n,r,m,1,+u,t+n*rI(o+y),e+r*nI(o+y)),v>.01&&this._add("A",n,r,m,0,+u,f,g)}else{var _=t+n*rI(a),x=e+r*nI(a);this._add("A",n,r,m,+p,+u,_,x)}},t.prototype.rect=function(t,e,n,r){this._add("M",t,e),this._add("l",n,0),this._add("l",0,r),this._add("l",-n,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,n,r,i,o,a,s,l){for(var u=[],h=this._p,c=1;c<arguments.length;c++){var d=arguments[c];if(isNaN(d))return void(this._invalid=!0);u.push(Math.round(d*h)/h)}this._d.push(t+u.join(" ")),this._start="Z"===t},t.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(""),this._d=[]},t.prototype.getStr=function(){return this._str},t}(),lI=sI,uI="none",hI=Math.round;var cI=["lineCap","miterLimit","lineJoin"],dI=V(cI,function(t){return"stroke-"+t.toLowerCase()});function pI(t,e,n,r){var i=null==e.opacity?1:e.opacity;if(n instanceof Iu)t("opacity",i);else{if(function(t){var e=t.fill;return null!=e&&e!==uI}(e)){var o=Br(e.fill);t("fill",o.color);var a=null!=e.fillOpacity?e.fillOpacity*o.opacity*i:o.opacity*i;(r||a<1)&&t("fill-opacity",a)}else t("fill",uI);if(function(t){var e=t.stroke;return null!=e&&e!==uI}(e)){var s=Br(e.stroke);t("stroke",s.color);var l=e.strokeNoScale?n.getLineScale():1,u=l?(e.lineWidth||0)/l:0,h=null!=e.strokeOpacity?e.strokeOpacity*s.opacity*i:s.opacity*i,c=e.strokeFirst;if((r||1!==u)&&t("stroke-width",u),(r||c)&&t("paint-order",c?"stroke":"fill"),(r||h<1)&&t("stroke-opacity",h),e.lineDash){var d=Ox(n),p=d[0],f=d[1];p&&(f=hI(f||0),t("stroke-dasharray",p.join(",")),(f||r)&&t("stroke-dashoffset",f))}else r&&t("stroke-dasharray",uI);for(var g=0;g<cI.length;g++){var m=cI[g];if(r||e[m]!==mu[m]){var v=e[m]||mu[m];v&&t(dI[g],v)}}}else r&&t("stroke",uI)}}var fI="http://www.w3.org/2000/svg",gI="http://www.w3.org/1999/xlink",mI="ecmeta_";function vI(t){return document.createElementNS(fI,t)}function yI(t,e,n,r,i){return{tag:t,attrs:n||{},children:r,text:i,key:e}}function _I(t,e){var n=(e=e||{}).newline?"\n":"";return function t(e){var r=e.children,i=e.tag,o=e.attrs,a=e.text;return function(t,e){var n=[];if(e)for(var r in e){var i=e[r],o=r;!1!==i&&(!0!==i&&null!=i&&(o+='="'+i+'"'),n.push(o))}return"<"+t+" "+n.join(" ")+">"}(i,o)+("style"!==i?ue(a):a||"")+(r?""+n+V(r,function(e){return t(e)}).join(n)+n:"")+("</"+i+">")}(t)}function xI(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function bI(t,e,n,r){return yI("svg","root",{width:t,height:e,xmlns:fI,"xmlns:xlink":gI,version:"1.1",baseProfile:"full",viewBox:!!r&&"0 0 "+t+" "+e},n)}var wI=0;function SI(){return wI++}var TI={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"},MI="transform-origin";function CI(t,e,n){var r=L({},t.shape);L(r,e),t.buildPath(n,r);var i=new lI;return i.reset(Kr(t)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function II(t,e){var n=e.originX,r=e.originY;(n||r)&&(t[MI]=n+"px "+r+"px")}var AI={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function DI(t,e){var n=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[n]=t,n}function LI(t){return Y(t)?TI[t]?"cubic-bezier("+TI[t]+")":or(t)?t:"":""}function PI(t,e,n,r){var i=t.animators,o=i.length,a=[];if(t instanceof Td){var s=function(t,e,n){var r,i,o=t.shape.paths,a={};if(B(o,function(t){var e=xI(n.zrId);e.animation=!0,PI(t,{},e,!0);var o=e.cssAnims,s=e.cssNodes,l=U(o),u=l.length;if(u){var h=o[i=l[u-1]];for(var c in h){var d=h[c];a[c]=a[c]||{d:""},a[c].d+=d.d||""}for(var p in s){var f=s[p].animation;f.indexOf(i)>=0&&(r=f)}}}),r){e.d=!1;var s=DI(a,n);return r.replace(i,s)}}(t,e,n);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var l={},u=0;u<o;u++){var h=i[u],c=[h.getMaxTime()/1e3+"s"],d=LI(h.getClip().easing),p=h.getDelay();d?c.push(d):c.push("linear"),p&&c.push(p/1e3+"s"),h.getLoop()&&c.push("infinite");var f=c.join(" ");l[f]=l[f]||[f,[]],l[f][1].push(h)}function g(i){var o,a=i[1],s=a.length,l={},u={},h={},c="animation-timing-function";function d(t,e,n){for(var r=t.getTracks(),i=t.getMaxTime(),o=0;o<r.length;o++){var a=r[o];if(a.needsAnimate()){var s=a.keyframes,l=a.propName;if(n&&(l=n(l)),l)for(var u=0;u<s.length;u++){var h=s[u],d=Math.round(h.time/i*100)+"%",p=LI(h.easing),f=h.rawValue;(Y(f)||K(f))&&(e[d]=e[d]||{},e[d][l]=h.rawValue,p&&(e[d][c]=p))}}}}for(var p=0;p<s;p++){(S=(w=a[p]).targetName)?"shape"===S&&d(w,u):!r&&d(w,l)}for(var f in l){var g={};Ji(g,t),L(g,l[f]);var m=Jr(g),v=l[f][c];h[f]=m?{transform:m}:{},II(h[f],g),v&&(h[f][c]=v)}var y=!0;for(var f in u){h[f]=h[f]||{};var _=!o;v=u[f][c];_&&(o=new Ql);var x=o.len();o.reset(),h[f].d=CI(t,u[f],o);var b=o.len();if(!_&&x!==b){y=!1;break}v&&(h[f][c]=v)}if(!y)for(var f in h)delete h[f].d;if(!r)for(p=0;p<s;p++){var w,S;"style"===(S=(w=a[p]).targetName)&&d(w,h,function(t){return AI[t]})}var T,M=U(h),C=!0;for(p=1;p<M.length;p++){var I=M[p-1],A=M[p];if(h[I][MI]!==h[A][MI]){C=!1;break}T=h[I][MI]}if(C&&T){for(var f in h)h[f][MI]&&delete h[f][MI];e[MI]=T}if(G(M,function(t){return U(h[t]).length>0}).length)return DI(h,n)+" "+i[0]+" both"}for(var m in l){(s=g(l[m]))&&a.push(s)}if(a.length){var v=n.zrId+"-cls-"+SI();n.cssNodes["."+v]={animation:a.join(",")},e.class=v}}function EI(t,e,n,r){var i=JSON.stringify(t),o=n.cssStyleCache[i];o||(o=n.zrId+"-cls-"+SI(),n.cssStyleCache[i]=o,n.cssNodes["."+o+(r?":hover":"")]=t),e.class=e.class?e.class+" "+o:o}var OI=Math.round;function NI(t){return t&&Y(t.src)}function RI(t){return t&&Z(t.toDataURL)}function kI(t,e,n,r){pI(function(i,o){var a="fill"===i||"stroke"===i;a&&Yr(o)?ZI(e,t,i,r):a&&Xr(o)?YI(n,t,i,r):t[i]=o,a&&r.ssr&&"none"===o&&(t["pointer-events"]="visible")},e,n,!1),function(t,e,n){var r=t.style;if(function(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}(r)){var i=function(t){var e=t.style,n=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(",")}(t),o=n.shadowCache,a=o[i];if(!a){var s=t.getGlobalScale(),l=s[0],u=s[1];if(!l||!u)return;var h=r.shadowOffsetX||0,c=r.shadowOffsetY||0,d=r.shadowBlur,p=Br(r.shadowColor),f=p.opacity,g=p.color,m=d/2/l+" "+d/2/u;a=n.zrId+"-s"+n.shadowIdx++,n.defs[a]=yI("filter",a,{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},[yI("feDropShadow","",{dx:h/l,dy:c/u,stdDeviation:m,"flood-color":g,"flood-opacity":f})]),o[i]=a}e.filter=qr(a)}}(n,t,r)}function zI(t,e){var n=ko(e);n&&(n.each(function(e,n){null!=e&&(t[(mI+n).toLowerCase()]=e+"")}),e.isSilent()&&(t[mI+"silent"]="true"))}function BI(t){return Fr(t[0]-1)&&Fr(t[1])&&Fr(t[2])&&Fr(t[3]-1)}function VI(t,e,n){if(e&&(!function(t){return Fr(t[4])&&Fr(t[5])}(e)||!BI(e))){var r=n?10:1e4;t.transform=BI(e)?"translate("+OI(e[4]*r)/r+" "+OI(e[5]*r)/r+")":function(t){return"matrix("+Gr(t[0])+","+Gr(t[1])+","+Gr(t[2])+","+Gr(t[3])+","+Hr(t[4])+","+Hr(t[5])+")"}(e)}}function FI(t,e,n){for(var r=t.points,i=[],o=0;o<r.length;o++)i.push(OI(r[o][0]*n)/n),i.push(OI(r[o][1]*n)/n);e.points=i.join(" ")}function GI(t){return!t.smooth}var HI,UI,WI={circle:[(HI=["cx","cy","r"],UI=V(HI,function(t){return"string"==typeof t?[t,t]:t}),function(t,e,n){for(var r=0;r<UI.length;r++){var i=UI[r],o=t[i[0]];null!=o&&(e[i[1]]=OI(o*n)/n)}})],polyline:[FI,GI],polygon:[FI,GI]};function XI(t,e){var n=t.style,r=t.shape,i=WI[t.type],o={},a=e.animation,s="path",l=t.style.strokePercent,u=e.compress&&Kr(t)||4;if(!i||e.willUpdate||i[1]&&!i[1](r)||a&&function(t){for(var e=t.animators,n=0;n<e.length;n++)if("shape"===e[n].targetName)return!0;return!1}(t)||l<1){var h=!t.path||t.shapeChanged();t.path||t.createPathProxy();var c=t.path;h&&(c.beginPath(),t.buildPath(c,t.shape),t.pathUpdated());var d=c.getVersion(),p=t,f=p.__svgPathBuilder;p.__svgPathVersion===d&&f&&l===p.__svgPathStrokePercent||(f||(f=p.__svgPathBuilder=new lI),f.reset(u),c.rebuildPath(f,l),f.generateStr(),p.__svgPathVersion=d,p.__svgPathStrokePercent=l),o.d=f.getStr()}else{s=t.type;var g=Math.pow(10,u);i[0](r,o,g)}return VI(o,t.transform),kI(o,n,t,e),zI(o,t),e.animation&&PI(t,o,e),e.emphasis&&function(t,e,n){if(!t.ignore)if(t.isSilent())EI(u={"pointer-events":"none"},e,n,!0);else{var r=t.states.emphasis&&t.states.emphasis.style?t.states.emphasis.style:{},i=r.fill;if(!i){var o=t.style&&t.style.fill,a=t.states.select&&t.states.select.style&&t.states.select.style.fill,s=t.currentStates.indexOf("select")>=0&&a||o;s&&(i=Rr(s))}var l=r.lineWidth;l&&(l/=!r.strokeNoScale&&t.transform?t.transform[0]:1);var u={cursor:"pointer"};i&&(u.fill=i),r.stroke&&(u.stroke=r.stroke),l&&(u["stroke-width"]=l),EI(u,e,n,!0)}}(t,o,e),yI(s,t.id+"",o)}function jI(t,e){return t instanceof xu?XI(t,e):t instanceof Iu?function(t,e){var n=t.style,r=n.image;if(r&&!Y(r)&&(NI(r)?r=r.src:RI(r)&&(r=r.toDataURL())),r){var i=n.x||0,o=n.y||0,a={href:r,width:n.width,height:n.height};return i&&(a.x=i),o&&(a.y=o),VI(a,t.transform),kI(a,n,t,e),zI(a,t),e.animation&&PI(t,a,e),yI("image",t.id+"",a)}}(t,e):t instanceof Su?function(t,e){var n=t.style,r=n.text;if(null!=r&&(r+=""),r&&!isNaN(n.x)&&!isNaN(n.y)){var i=n.font||a,s=n.x||0,l=function(t,e,n){return"top"===n?t+=e/2:"bottom"===n&&(t-=e/2),t}(n.y||0,uo(i),n.textBaseline),u={"dominant-baseline":"central","text-anchor":Ur[n.textAlign]||n.textAlign};if(Xu(n)){var h="",c=n.fontStyle,d=Uu(n.fontSize);if(!parseFloat(d))return;var p=n.fontFamily||o,f=n.fontWeight;h+="font-size:"+d+";font-family:"+p+";",c&&"normal"!==c&&(h+="font-style:"+c+";"),f&&"normal"!==f&&(h+="font-weight:"+f+";"),u.style=h}else u.style="font: "+i;return r.match(/\s/)&&(u["xml:space"]="preserve"),s&&(u.x=s),l&&(u.y=l),VI(u,t.transform),kI(u,n,t,e),zI(u,t),e.animation&&PI(t,u,e),yI("text",t.id+"",u,void 0,r)}}(t,e):void 0}function ZI(t,e,n,r){var i,o=t[n],a={gradientUnits:o.global?"userSpaceOnUse":"objectBoundingBox"};if(jr(o))i="linearGradient",a.x1=o.x,a.y1=o.y,a.x2=o.x2,a.y2=o.y2;else{if(!Zr(o))return void C("Illegal gradient type.");i="radialGradient",a.cx=at(o.x,.5),a.cy=at(o.y,.5),a.r=at(o.r,.5)}for(var s=o.colorStops,l=[],u=0,h=s.length;u<h;++u){var c=100*Hr(s[u].offset)+"%",d=Br(s[u].color),p=d.color,f=d.opacity,g={offset:c};g["stop-color"]=p,f<1&&(g["stop-opacity"]=f),l.push(yI("stop",u+"",g))}var m=_I(yI(i,"",a,l)),v=r.gradientCache,y=v[m];y||(y=r.zrId+"-g"+r.gradientIdx++,v[m]=y,a.id=y,r.defs[y]=yI(i,y,a,l)),e[n]=qr(y)}function YI(t,e,n,r){var i,o=t.style[n],a=t.getBoundingRect(),s={},l=o.repeat,u="no-repeat"===l,h="repeat-x"===l,c="repeat-y"===l;if(Wr(o)){var d=o.imageWidth,p=o.imageHeight,f=void 0,g=o.image;if(Y(g)?f=g:NI(g)?f=g.src:RI(g)&&(f=g.toDataURL()),"undefined"==typeof Image){var m="Image width/height must been given explictly in svg-ssr renderer.";ht(d,m),ht(p,m)}else if(null==d||null==p){var v=function(t,e){if(t){var n=t.elm,r=d||e.width,i=p||e.height;"pattern"===t.tag&&(h?(i=1,r/=a.width):c&&(r=1,i/=a.height)),t.attrs.width=r,t.attrs.height=i,n&&(n.setAttribute("width",r),n.setAttribute("height",i))}},y=Hs(f,null,t,function(t){u||v(w,t),v(i,t)});y&&y.width&&y.height&&(d=d||y.width,p=p||y.height)}i=yI("image","img",{href:f,width:d,height:p}),s.width=d,s.height=p}else o.svgElement&&(i=I(o.svgElement),s.width=o.svgWidth,s.height=o.svgHeight);if(i){var _,x;u?_=x=1:h?(x=1,_=s.width/a.width):c?(_=1,x=s.height/a.height):s.patternUnits="userSpaceOnUse",null==_||isNaN(_)||(s.width=_),null==x||isNaN(x)||(s.height=x);var b=Jr(o);b&&(s.patternTransform=b);var w=yI("pattern","",s,[i]),S=_I(w),T=r.patternCache,M=T[S];M||(M=r.zrId+"-p"+r.patternIdx++,T[S]=M,s.id=M,w=r.defs[M]=yI("pattern",M,s,[i])),e[n]=qr(M)}}function qI(t,e,n){var r=n.clipPathCache,i=n.defs,o=r[t.id];if(!o){var a={id:o=n.zrId+"-c"+n.clipPathIdx++};r[t.id]=o,i[o]=yI("clipPath",o,a,[XI(t,n)])}e["clip-path"]=qr(o)}function KI(t){return document.createTextNode(t)}function JI(t,e,n){t.insertBefore(e,n)}function QI(t,e){t.removeChild(e)}function $I(t,e){t.appendChild(e)}function tA(t){return t.parentNode}function eA(t){return t.nextSibling}function nA(t,e){t.textContent=e}var rA=yI("","");function iA(t){return void 0===t}function oA(t){return void 0!==t}function aA(t,e,n){for(var r={},i=e;i<=n;++i){var o=t[i].key;void 0!==o&&(null!=r[o]&&console.error("Duplicate key "+o),r[o]=i)}return r}function sA(t,e){var n=t.key===e.key;return t.tag===e.tag&&n}function lA(t){var e,n=t.children,r=t.tag;if(oA(r)){var i=t.elm=vI(r);if(cA(rA,t),j(n))for(e=0;e<n.length;++e){var o=n[e];null!=o&&$I(i,lA(o))}else oA(t.text)&&!J(t.text)&&$I(i,KI(t.text))}else t.elm=KI(t.text);return t.elm}function uA(t,e,n,r,i){for(;r<=i;++r){var o=n[r];null!=o&&JI(t,lA(o),e)}}function hA(t,e,n,r){for(;n<=r;++n){var i=e[n];if(null!=i)if(oA(i.tag))QI(tA(i.elm),i.elm);else QI(t,i.elm)}}function cA(t,e){var n,r=e.elm,i=t&&t.attrs||{},o=e.attrs||{};if(i!==o){for(n in o){var a=o[n];i[n]!==a&&(!0===a?r.setAttribute(n,""):!1===a?r.removeAttribute(n):"style"===n?r.style.cssText=a:120!==n.charCodeAt(0)?r.setAttribute(n,a):"xmlns:xlink"===n||"xmlns"===n?r.setAttributeNS("http://www.w3.org/2000/xmlns/",n,a):58===n.charCodeAt(3)?r.setAttributeNS("http://www.w3.org/XML/1998/namespace",n,a):58===n.charCodeAt(5)?r.setAttributeNS(gI,n,a):r.setAttribute(n,a))}for(n in i)n in o||r.removeAttribute(n)}}function dA(t,e){var n=e.elm=t.elm,r=t.children,i=e.children;t!==e&&(cA(t,e),iA(e.text)?oA(r)&&oA(i)?r!==i&&function(t,e,n){for(var r,i,o,a=0,s=0,l=e.length-1,u=e[0],h=e[l],c=n.length-1,d=n[0],p=n[c];a<=l&&s<=c;)null==u?u=e[++a]:null==h?h=e[--l]:null==d?d=n[++s]:null==p?p=n[--c]:sA(u,d)?(dA(u,d),u=e[++a],d=n[++s]):sA(h,p)?(dA(h,p),h=e[--l],p=n[--c]):sA(u,p)?(dA(u,p),JI(t,u.elm,eA(h.elm)),u=e[++a],p=n[--c]):sA(h,d)?(dA(h,d),JI(t,h.elm,u.elm),h=e[--l],d=n[++s]):(iA(r)&&(r=aA(e,a,l)),iA(i=r[d.key])||(o=e[i]).tag!==d.tag?JI(t,lA(d),u.elm):(dA(o,d),e[i]=void 0,JI(t,o.elm,u.elm)),d=n[++s]);(a<=l||s<=c)&&(a>l?uA(t,null==n[c+1]?null:n[c+1].elm,n,s,c):hA(t,e,a,l))}(n,r,i):oA(i)?(oA(t.text)&&nA(n,""),uA(n,null,i,0,i.length-1)):oA(r)?hA(n,r,0,r.length-1):oA(t.text)&&nA(n,""):t.text!==e.text&&(oA(r)&&hA(n,r,0,r.length-1),nA(n,e.text)))}var pA=0,fA=function(){function t(t,e,n){var r;if(this.type="svg",this.configLayer=(r="configLayer",function(){C('In SVG mode painter not support method "'+r+'"')}),this.storage=e,this._opts=n=L({},n),this.root=t,this._id="zr"+pA++,this._oldVNode=bI(n.width,n.height),t&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var o=this._svgDom=this._oldVNode.elm=vI("svg");cA(null,this._oldVNode),i.appendChild(o),t.appendChild(i)}this.resize(n.width,n.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",function(t,e){if(sA(t,e))dA(t,e);else{var n=t.elm,r=tA(n);lA(e),null!==r&&(JI(r,e.elm,eA(n)),hA(r,[t],0,0))}}(this._oldVNode,t),this._oldVNode=t}},t.prototype.renderOneToVNode=function(t){return jI(t,xI(this._id))},t.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=xI(this._id);i.animation=t.animation,i.willUpdate=t.willUpdate,i.compress=t.compress,i.emphasis=t.emphasis,i.ssr=this._opts.ssr;var o=[],a=this._bgVNode=function(t,e,n,r){var i;if(n&&"none"!==n)if(i=yI("rect","bg",{width:t,height:e,x:"0",y:"0"}),Yr(n))ZI({fill:n},i.attrs,"fill",r);else if(Xr(n))YI({style:{fill:n},dirty:St,getBoundingRect:function(){return{width:t,height:e}}},i.attrs,"fill",r);else{var o=Br(n),a=o.color,s=o.opacity;i.attrs.fill=a,s<1&&(i.attrs["fill-opacity"]=s)}return i}(n,r,this._backgroundColor,i);a&&o.push(a);var s=t.compress?null:this._mainVNode=yI("g","main",{},[]);this._paintList(e,i,s?s.children:o),s&&o.push(s);var l=V(U(i.defs),function(t){return i.defs[t]});if(l.length&&o.push(yI("defs","defs",{},l)),t.animation){var u=function(t,e,n){var r=(n=n||{}).newline?"\n":"",i=" {"+r,o=r+"}",a=V(U(t),function(e){return e+i+V(U(t[e]),function(n){return n+":"+t[e][n]+";"}).join(r)+o}).join(r),s=V(U(e),function(t){return"@keyframes "+t+i+V(U(e[t]),function(n){return n+i+V(U(e[t][n]),function(r){var i=e[t][n][r];return"d"===r&&(i='path("'+i+'")'),r+":"+i+";"}).join(r)+o}).join(r)+o}).join(r);return a||s?["<![CDATA[",a,s,"]]>"].join(r):""}(i.cssNodes,i.cssAnims,{newline:!0});if(u){var h=yI("style","stl",{},[],u);o.push(h)}}return bI(n,r,o,t.useViewBox)},t.prototype.renderToString=function(t){return t=t||{},_I(this.renderToVNode({animation:at(t.cssAnimation,!0),emphasis:at(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:at(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,n){for(var r,i,o=t.length,a=[],s=0,l=0,u=0;u<o;u++){var h=t[u];if(!h.invisible){var c=h.__clipPaths,d=c&&c.length||0,p=i&&i.length||0,f=void 0;for(f=Math.max(d-1,p-1);f>=0&&(!c||!i||c[f]!==i[f]);f--);for(var g=p-1;g>f;g--)r=a[--s-1];for(var m=f+1;m<d;m++){var v={};qI(c[m],v,e);var y=yI("g","clip-g-"+l++,v,[]);(r?r.children:n).push(y),a[s++]=y,r=y}i=c;var _=jI(h,e);_&&(r?r.children:n).push(_)}}},t.prototype.resize=function(t,e){var n=this._opts,r=this.root,i=this._viewport;if(null!=t&&(n.width=t),null!=e&&(n.height=e),r&&i&&(i.style.display="none",t=Ex(r,0,n),e=Ex(r,1,n),i.style.display=""),this._width!==t||this._height!==e){if(this._width=t,this._height=e,i){var o=i.style;o.width=t+"px",o.height=e+"px"}if(Xr(this._backgroundColor))this.refresh();else{var a=this._svgDom;a&&(a.setAttribute("width",t),a.setAttribute("height",e));var s=this._bgVNode&&this._bgVNode.elm;s&&(s.setAttribute("width",t),s.setAttribute("height",e))}}},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t.prototype.dispose=function(){this.root&&(this.root.innerHTML=""),this._svgDom=this._viewport=this.storage=this._oldVNode=this._bgVNode=this._mainVNode=null},t.prototype.clear=function(){this._svgDom&&(this._svgDom.innerHTML=null),this._oldVNode=null},t.prototype.toDataURL=function(t){var e=this.renderToString(),n="data:image/svg+xml;";return t?(e=Qr(e))&&n+"base64,"+e:n+"charset=UTF-8,"+encodeURIComponent(e)},t}();var gA=fA;function mA(t,e,n){var r=h.createCanvas(),i=e.getWidth(),o=e.getHeight(),a=r.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=i+"px",a.height=o+"px",r.setAttribute("data-zr-dom-id",t)),r.width=i*n,r.height=o*n,r}function vA(t){return!t.__cursors.get(0)}function yA(t){var e=t.__cursors.get(0);return{startIdx:e?e.startIdx:0,endIdx:e?e.endIdx:0}}var _A=function(t){function n(e,n,r){var i,o=t.call(this)||this;o.motionBlur=!1,o.lastFrameAlpha=.7,o.dpr=1,o.virtual=!1,o.config={},o.zlevel=0,o.zlevel2=0,o.maxRepaintRectCount=5,o.__dirty=!0,o.__firstTimePaint=!0,o.__prevIdx={startIdx:0,endIdx:0},r=r||zi,"string"==typeof e?i=mA(e,n,r):J(e)&&(e=(i=e).id),o.id=e,o.dom=i;var a=i.style;return a&&(bt(i),i.onselectstart=function(){return!1},a.padding="0",a.margin="0",a.borderWidth="0"),o.painter=n,o.dpr=r,o}return e(n,t),n.prototype.afterBrush=function(){this.__prevIdx=yA(this)},n.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},n.prototype.setUnpainted=function(){this.__firstTimePaint=!0},n.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=mA("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},n.prototype.createRepaintRects=function(t,e,n,r){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var i=[],o=this.maxRepaintRectCount,a=!1,s=new ln(0,0,0,0);function l(t){if(t.isFinite()&&!t.isZero())if(0===i.length){(e=new ln(0,0,0,0)).copy(t),i.push(e)}else{for(var e,n=!1,r=1/0,l=0,u=0;u<i.length;++u){var h=i[u];if(h.intersect(t)){var c=new ln(0,0,0,0);c.copy(h),c.union(t),i[u]=c,n=!0;break}if(a){s.copy(t),s.union(h);var d=t.width*t.height,p=h.width*h.height,f=s.width*s.height-d-p;f<r&&(r=f,l=u)}}if(a&&(i[l].union(t),n=!0),!n)(e=new ln(0,0,0,0)).copy(t),i.push(e);a||(a=i.length>=o)}}for(var u=yA(this),h=u.startIdx;h<u.endIdx;++h){if(g=t[h]){var c=g.shouldBePainted(n,r,!0,!0);(m=g.__isRendered&&(1&g.__dirty||!c)?g.getPrevPaintRect():null)&&l(m);var d=c&&(1&g.__dirty||!g.__isRendered)?g.getPaintRect():null;d&&l(d)}}var p,f=this.__prevIdx;for(h=f.startIdx;h<f.endIdx;++h){var g,m;c=(g=e[h])&&g.shouldBePainted(n,r,!0,!0);if(g&&(!c||!g.__zr)&&g.__isRendered)(m=g.getPrevPaintRect())&&l(m)}do{p=!1;for(h=0;h<i.length;)if(i[h].isZero())i.splice(h,1);else{for(var v=h+1;v<i.length;)i[h].intersect(i[v])?(p=!0,i[h].union(i[v]),i.splice(v,1)):v++;h++}}while(p);return this._paintRects=i,i},n.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},n.prototype.resize=function(t,e){var n=this.dpr,r=this.dom,i=r.style,o=this.domBack;i&&(i.width=t+"px",i.height=e+"px"),r.width=t*n,r.height=e*n,o&&(o.width=t*n,o.height=e*n,1!==n&&this.ctxBack.scale(n,n))},n.prototype.clear=function(t,e,n){var r=this.dom,i=this.ctx,o=r.width,a=r.height;e=e||this.clearColor;var s=this.motionBlur&&!t,l=this.lastFrameAlpha,u=this.dpr,h=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(r,0,0,o/u,a/u));var c=this.domBack;function d(t,n,r,o){if(i.clearRect(t,n,r,o),e&&"transparent"!==e){var a=void 0;if(et(e))a=(e.global||e.__width===r&&e.__height===o)&&e.__canvasGradient||Lx(i,e,{x:0,y:0,width:r,height:o}),e.__canvasGradient=a,e.__width=r,e.__height=o;else nt(e)&&(e.scaleX=e.scaleX||u,e.scaleY=e.scaleY||u,a=Fx(i,e,{dirty:function(){h.setUnpainted(),h.painter.refresh()}}));i.save(),i.fillStyle=a||e,i.fillRect(t,n,r,o),i.restore()}s&&(i.save(),i.globalAlpha=l,i.drawImage(c,t,n,r,o),i.restore())}!n||s?d(0,0,o,a):n.length&&B(n,function(t){d(t.x*u,t.y*u,t.width*u,t.height*u)})},n}($t),xA=_A,bA=1e5,wA=314159,SA=void 0;function TA(t,e,n,r){var i=new xA(t,e,e.dpr);return i.zlevel=n,i.zlevel2=r,i.__builtin__=!0,MA(i),i}function MA(t){t.__cursorStack=[],t.__cursors=yt()}function CA(t,e){var n,r=t.__cursors,i=+e;return r.get(i)||(t.__cursorStack.push(i),r.set(i,((n={key:i}).startIdx=n.drawIdx=n.endIdx=n.endIdxNew=0,n.used=!1,n.first=n.last=NaN,n.notClearIdx=-1,n)))}function IA(t,e){for(var n=t.__cursorStack,r=0;r<n.length;r++)e(t.__cursors.get(n[r]))}function AA(t,e){var n=t.layers;return n[e]||(n[e]=new Array(3))}function DA(t,e,n){for(var r=t.layerStack,i=0;i<r.length;i++){var o=r[i].zl,a=r[i].zl2,s=t.layers[o][a];n&&(n&LA&&!s.__builtin__||n&PA&&s.__builtin__||n&EA&&s===t.hoverlayer)||e(s,o,a,i)}}var LA=1,PA=2,EA=4,OA=LA|EA,NA=function(){function t(t,e,n,r){this.type="canvas",this._prevDisplayList=[],this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas",this._i={layerStack:[],layers:[]};var i=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();if(this._opts=n=L({},n||{}),this.dpr=n.devicePixelRatio||zi,this._singleCanvas=i,this.root=t,t.style&&(bt(t),t.innerHTML=""),this.storage=e,this._prevDisplayList=[],i){var o=t,a=o.width,s=o.height;null!=n.width&&(a=n.width),null!=n.height&&(s=n.height),this.dpr=n.devicePixelRatio||1,o.width=a*this.dpr,o.height=s*this.dpr,this._width=a,this._height=s;var l=TA(o,this,wA,0);l.initContext(),this._insertLayer(l,wA,0,!0),this._domRoot=t}else{this._width=Ex(t,0,n),this._height=Ex(t,1,n);var u=this._domRoot=function(t,e){var n=document.createElement("div");return n.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",n}(this._width,this._height);t.appendChild(u)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.refresh=function(t){var e,n=at((e=t&&!J(t)?{paintAll:!!t}:t||{}).refresh,!0),r=at(e.refreshHover,!1);if(r&&(this._hoverLayerDirty=2),!n)return r&&this._paintHoverList(this.storage.getDisplayList(!1)),this;var i=this.storage.getDisplayList(!0);this._updateLayerStatus(i,e.paintAll),this._redrawId=Math.random();var o=this._prevDisplayList;this._paintList(i,o,this._redrawId);var a=this._backgroundColor;return DA(this._i,function(t,e,n,r){t.refresh&&t.refresh(0===r?a:null)},PA),this._opts.useDirtyRect&&(this._prevDisplayList=i.slice()),this},t.prototype._paintHoverList=function(t){var e=this._i.hoverlayer,n=this._hoverLayerDirty;if(this._hoverLayerDirty=SA,n!==SA&&(e||2!==n||(e=this._i.hoverlayer=this._ensureLayer(bA)),e)){e.clear();for(var r,i={inHover:!0,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},o=0,a=t.length;o<a;o++){var s=t[o];if(s.__inHover){r||(r=e.ctx).save();var l=s.__hoverStyle,u=void 0;l&&(u=s.style,s.style=l),Yx(r,s,i),l&&(s.style=u)}}r&&(qx(r,i),r.restore())}},t.prototype.getHoverLayer=function(){return this._ensureLayer(bA)},t.prototype.paintOne=function(t,e){Zx(t,e)},t.prototype._paintList=function(t,e,n){if(this._redrawId===n){var r=this._doPaintList(t,e);if(this._needsManuallyCompositing&&this._compositeManually(),r)DA(this._i,function(t){t.afterBrush&&t.afterBrush()},OA),this._paintHoverList(t);else{var i=this;Pn(function(){i._paintList(t,e,n)})}}},t.prototype._compositeManually=function(){var t=this._ensureLayer(wA).ctx,e=this._domRoot.width,n=this._domRoot.height;t.clearRect(0,0,e,n),DA(this._i,function(r){r.virtual&&t.drawImage(r.dom,0,0,e,n)},LA)},t.prototype._doPaintList=function(t,e){var n=this,r=!0;return DA(this._i,function(i){var o=!1;if(IA(i,function(t){(t.drawIdx<t.endIdx||t.notClearIdx>=0)&&(o=!0)}),o||i.__dirty){var a=n._opts.useDirtyRect&&!vA(i)?i.createRepaintRects(t,e,n._width,n._height):null,s=n._i.layerStack[0],l=!0;if(i.__dirty){l=!1,i.__dirty=!1;var u=i.zlevel===s.zl&&i.zlevel2===s.zl2?n._backgroundColor:null;i.clear(!1,u,a)}IA(i,function(e){var o=n._paintPerCursor(i,e,t,a,l);r=r&&o})}},OA),i.wxa&&DA(this._i,function(t){t&&t.ctx&&t.ctx.draw&&t.ctx.draw()}),r},t.prototype._paintPerCursor=function(t,e,n,r,i){var o=t.ctx;if(r)if(r.length)for(var a=this.dpr,s=0;s<r.length;++s){var l=r[s];o.save(),o.beginPath(),o.rect(l.x*a,l.y*a,l.width*a,l.height*a),o.clip(),this._paintPerCursorInRect(t,e,n,l,i),o.restore()}else e.drawIdx=e.endIdx;else o.save(),this._paintPerCursorInRect(t,e,n,null,i),o.restore();return e.drawIdx>=e.endIdx},t.prototype._paintPerCursorInRect=function(t,e,n,r,i){for(var o={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:i}},a=t.ctx,s=vA(t),l=s&&h.getTime(),u=e.drawIdx,c=e.notClearIdx,d=c>=0?Math.min(c,u):u;d<e.endIdx;d++){var p=n[d];if(!(d<u)||p.notClear){if(p.__inHover&&(this._hoverLayerDirty=2),null!=r){var f=p.getPaintRect();f&&f.intersect(r)&&(Yx(a,p,o),p.setPrevPaintRect(f))}else Yx(a,p,o);if(s)if(h.getTime()-l>15){d++;break}}}qx(a,o),e.drawIdx=Math.max(d,u)},t.prototype.getLayer=function(t,e){return this._ensureLayer(t,0,e)},t.prototype._ensureLayer=function(t,e,n){e=e||0;var r=this._singleCanvas;r&&!this._needsManuallyCompositing&&(t=wA,e=0);var i=AA(this._i,t)[e];return i||(i=TA("zr_"+t+"."+e,this,t,e),this._layerConfig[t]&&A(i,this._layerConfig[t],!0),(n||r&&t!==wA)&&(i.virtual=!0),this._insertLayer(i,t,e,!1),i.initContext()),i},t.prototype.insertLayer=function(t,e){this._insertLayer(e,t,0,!1)},t.prototype._insertLayer=function(t,e,n,r){var i=this._i,o=i.layers,a=i.layerStack,s=this._domRoot,l=null;if(o[e]&&o[e][n])C("ZLevel "+e+"."+n+" has been used already");else if(function(t){return!!t&&(!!t.__builtin__||"function"==typeof t.resize&&"function"==typeof t.refresh)}(t)){for(var u=a.length,h=0;h<u&&(a[h].zl<e||a[h].zl===e&&a[h].zl2<n);)h++;if(h>0&&(l=AA(i,a[h-1].zl)[a[h-1].zl2]),a.splice(h,0,{zl:e,zl2:n}),AA(i,e)[n]=t,!r&&!t.virtual)if(l){var c=l.dom;c.nextSibling?s.insertBefore(t.dom,c.nextSibling):s.appendChild(t.dom)}else s.firstChild?s.insertBefore(t.dom,s.firstChild):s.appendChild(t.dom);t.painter||(t.painter=this)}else C("Layer of zlevel "+e+" is not valid")},t.prototype.eachLayer=function(t,e){return DA(this._i,function(n,r){t.call(e,n,r)})},t.prototype.eachBuiltinLayer=function(t,e){return DA(this._i,function(n,r){t.call(e,n,r)},LA)},t.prototype.eachOtherLayer=function(t,e){return DA(this._i,function(n,r){t.call(e,n,r)},PA)},t.prototype.getLayers=function(){var t={};return DA(this._i,function(e,n,r){t[e.id]=e}),t},t.prototype._updateLayerStatus=function(t,e){var n,r=this;if(r._singleCanvas)for(var i=1;i<t.length;i++){if((h=t[i]).zlevel!==t[i-1].zlevel||h.incremental){r._needsManuallyCompositing=!0;break}}DA(r._i,function(t){t.__dirty=!1,IA(t,function(t){t.used=!1,t.endIdxNew=0,t.notClearIdx=-1})},OA);for(var o=null,a=null,s=!1,l=0,u=t.length;l<u;l++){var h,c=(h=t[l]).zlevel,d=h.incremental,p=void 0;if(n!==c&&(n=c,s=!1),d?(s=!0,p=1):p=s?2:0,o&&c===o.zlevel&&p===o.zlevel2||(a=null,(o=r._ensureLayer(c,p)).__builtin__)){if(!(a&&d===a.key||(a=CA(o,d)).used))if(a.used=!0,e||a.first!==h.id)o.__dirty=!0,a.first=h.id,a.startIdx=a.drawIdx=l,a.endIdx=l+1;else{var f=l-a.startIdx;a.startIdx=l,a.drawIdx+=f,a.endIdx+=f}a.endIdxNew=l+1,1&h.__dirty&&!h.__inHover&&((!d||!h.notClear&&l<a.drawIdx)&&(o.__dirty=!0),d&&h.notClear&&a.notClearIdx<0&&(a.notClearIdx=l))}else C("ZLevel "+c+" has been used by unknown layer "+o.id)}DA(r._i,function(e){for(var n=e.__cursorStack,i=e.__cursors,o=n.length-1;o>=0;o--){var a=i.get(n[o]);if(a.used){var s=a.endIdxNew;(vA(e)?s<a.drawIdx:s!==a.endIdx||!s||t[s-1].id!==a.last)&&(e.__dirty=!0),a.endIdx=a.endIdxNew,a.last=s?t[s-1].id:NaN}else e.__dirty=!0,i.removeKey(n[o]),n.splice(o,1)}e.__dirty&&(IA(e,function(t){t.drawIdx=t.startIdx}),r._hoverLayerDirty===SA&&(r._hoverLayerDirty=1))},OA)},t.prototype.clear=function(){return DA(this._i,function(t){t.clear(),MA(t)},LA),this},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,DA(this._i,function(t){t.setUnpainted()})},t.prototype.configLayer=function(t,e){if(e){var n=this._layerConfig;n[t]?A(n[t],e,!0):n[t]=e,DA(this._i,function(t,e){A(t,n[e],!0)})}},t.prototype.delLayer=function(t){for(var e=this._i.layerStack,n=this._i.layers,r=e.length-1;r>=0;r--){var i=e[r];if(i.zl===t){var o=n[t][i.zl2];if(o.__builtin__)continue;if(e.splice(r,1),n[t][i.zl2]=void 0,!o.virtual){var a=o.dom.parentNode;a&&a.removeChild(o.dom)}}}},t.prototype.resize=function(t,e){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var r=this._opts,i=this.root;null!=t&&(r.width=t),null!=e&&(r.height=e),t=Ex(i,0,r),e=Ex(i,1,r),n.style.display="",this._width===t&&e===this._height||(n.style.width=t+"px",n.style.height=e+"px",DA(this._i,function(n){n.resize(t,e)}),this.refresh({paintAll:!0})),this._width=t,this._height=e}else{if(null==t||null==e)return;this._width=t,this._height=e,this._ensureLayer(wA).resize(t,e)}return this},t.prototype.clearLayer=function(t){B(this._i.layers[t],function(t){t&&!t.__builtin__&&t.clear()})},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._i=null},t.prototype.getRenderedCanvas=function(t){if(t=t||{},this._singleCanvas&&!this._compositeManually)return this._i.layers[314159][0].dom;var e=new xA("image",this,t.pixelRatio||this.dpr);e.initContext(),e.clear(!1,t.backgroundColor||this._backgroundColor);var n=e.ctx;if(t.pixelRatio<=this.dpr){this.refresh();var r=e.dom.width,i=e.dom.height;DA(this._i,function(t){t.__builtin__?n.drawImage(t.dom,0,0,r,i):t.renderToCanvas&&(n.save(),t.renderToCanvas(n),n.restore())})}else{for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},a=this.storage.getDisplayList(!0),s=0,l=a.length;s<l;s++){var u=a[s];Yx(n,u,o)}qx(n,o)}return e.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t}(),RA=NA;function kA(t){t.registerPainter("canvas",RA)}var zA=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.getInitialData=function(t){var e=t.coordinateSystem;if("polar"!==e&&"cartesian2d"!==e)throw new Error("Line not support coordinateSystem besides cartesian and polar");return gS(null,this,{useEncodeDefaulter:!0})},n.prototype.getLegendIcon=function(t){var e=new Do,n=Cx("line",0,t.itemHeight/2,t.itemWidth,0,t.lineStyle.stroke,!1);e.add(n),n.setStyle(t.lineStyle);var r=this.getData().getVisual("symbol"),i=this.getData().getVisual("symbolRotate"),o="none"===r?"circle":r,a=.8*t.itemHeight,s=Cx(o,(t.itemWidth-a)/2,(t.itemHeight-a)/2,a,a,t.itemStyle.fill);e.add(s),s.setStyle(t.itemStyle);var l="inherit"===t.iconRotate?i:t.iconRotate||0;return s.rotation=l*Math.PI/180,s.setOrigin([t.itemWidth/2,t.itemHeight/2]),o.indexOf("empty")>-1&&(s.style.stroke=s.style.fill,s.style.fill=om.color.neutral00,s.style.lineWidth=2),e},n.type="series.line",n.dependencies=["grid","polar"],n.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},n}(Ky),BA=zA;function VA(t,e){var n=t.mapDimensionsAll("defaultedLabel"),r=n.length;if(1===r){var i=kv(t,e,n[0]);return null!=i?i+"":null}if(r){for(var o=[],a=0;a<n.length;a++)o.push(kv(t,e,n[a]));return o.join(" ")}}function FA(t,e){var n=t.mapDimensionsAll("defaultedLabel");if(!j(e))return e+"";for(var r=[],i=0;i<n.length;i++){var o=t.getDimensionIndex(n[i]);o>=0&&r.push(e[o])}return r.join(" ")}var GA=function(t){function n(e,n,r,i){var o=t.call(this)||this;return o.updateData(e,n,r,i),o}return e(n,t),n.prototype._createSymbol=function(t,e,n,r,i,o){this.removeAll();var a=Cx(t,-1,-1,2,2,null,o);a.attr({z2:at(i,100),culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),a.drift=HA,this._symbolType=t,this.add(a)},n.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},n.prototype.getSymbolType=function(){return this._symbolType},n.prototype.getSymbolPath=function(){return this.childAt(0)},n.prototype.highlight=function(){Wh(this.childAt(0))},n.prototype.downplay=function(){Xh(this.childAt(0))},n.prototype.setZ=function(t,e){var n=this.childAt(0);n.zlevel=t,n.z=e},n.prototype.setDraggable=function(t,e){var n=this.childAt(0);n.draggable=t,n.cursor=!e&&t?"move":n.cursor},n.prototype.updateData=function(t,e,r,i){this.silent=!1;var o=t.getItemVisual(e,"symbol")||"circle",a=t.hostModel,s=n.getSymbolSize(t,e),l=n.getSymbolZ2(t,e),u=o!==this._symbolType,h=i&&i.disableAnimation;if(u){var c=t.getItemVisual(e,"symbolKeepAspect");this._createSymbol(o,t,e,s,l,c)}else{(p=this.childAt(0)).silent=!1;var d={scaleX:s[0]/2,scaleY:s[1]/2};h?p.attr(d):Xd(p,d,a,e),Jd(p)}if(this._updateCommon(t,e,s,r,i),u){var p=this.childAt(0);if(!h){d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:p.style.opacity}};p.scaleX=p.scaleY=0,p.style.opacity=0,jd(p,d,a,e)}}h&&this.childAt(0).stopAnimation("leave")},n.prototype._updateCommon=function(t,e,n,r,i){var o,a,s,l,u,h,c,d,p,f=this.childAt(0),g=t.hostModel;if(r&&(o=r.emphasisItemStyle,a=r.blurItemStyle,s=r.selectItemStyle,l=r.focus,u=r.blurScope,c=r.labelStatesModels,d=r.hoverScale,p=r.cursorStyle,h=r.emphasisDisabled),!r||t.hasItemOption){var m=r&&r.itemModel?r.itemModel:t.getItemModel(e),v=m.getModel("emphasis");o=v.getModel("itemStyle").getItemStyle(),s=m.getModel(["select","itemStyle"]).getItemStyle(),a=m.getModel(["blur","itemStyle"]).getItemStyle(),l=v.get("focus"),u=v.get("blurScope"),h=v.get("disabled"),c=Zp(m),d=v.getShallow("scale"),p=m.getShallow("cursor")}var y=t.getItemVisual(e,"symbolRotate");f.attr("rotation",(y||0)*Math.PI/180||0);var _=Ax(t.getItemVisual(e,"symbolOffset"),n);_&&(f.x=_[0],f.y=_[1]),p&&f.attr("cursor",p);var x=t.getItemVisual(e,"style"),b=x.fill;if(f instanceof Iu){var w=f.style;f.useStyle(L({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},x))}else f.__isEmptyBrush?f.useStyle(L({},x)):f.useStyle(x),f.style.decal=null,f.setColor(b,i&&i.symbolInnerColor),f.style.strokeNoScale=!0;var S=t.getItemVisual(e,"liftZ"),T=this._z2;null!=S?null==T&&(this._z2=f.z2,f.z2+=S):null!=T&&(f.z2=T,this._z2=null);var M=i&&i.useNameLabel;jp(f,c,{labelFetcher:g,labelDataIndex:e,defaultText:function(e){return M?t.getName(e):VA(t,e)},inheritColor:b,defaultOpacity:x.opacity}),this._sizeX=n[0]/2,this._sizeY=n[1]/2;var C=f.ensureState("emphasis");C.style=o,f.ensureState("select").style=s,f.ensureState("blur").style=a;var I=null==d||!0===d?Math.max(1.1,3/this._sizeY):isFinite(d)&&d>0?+d:1;C.scaleX=this._sizeX*I,C.scaleY=this._sizeY*I,this.setSymbolScale(1),ic(this,l,u,h)},n.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},n.prototype.fadeOut=function(t,e,n){var r=this.childAt(0),i=$u(this).dataIndex,o=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var a=r.getTextContent();a&&Yd(a,{style:{opacity:0}},e,{dataIndex:i,removeOpt:o,cb:function(){r.removeTextContent()}})}else r.removeTextContent();Yd(r,{style:{opacity:0},scaleX:0,scaleY:0},e,{dataIndex:i,cb:t,removeOpt:o})},n.getSymbolSize=function(t,e){return Ix(t.getItemVisual(e,"symbolSize"))},n.getSymbolZ2=function(t,e){return t.getItemVisual(e,"z2")},n}(Do);function HA(t,e){this.parent.drift(t,e)}var UA=GA;function WA(t,e,n,r){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(r&&r.isIgnore&&r.isIgnore(n))&&!(r&&r.clipShape&&!r.clipShape.contain(e[0],e[1]))&&"none"!==t.getItemVisual(n,"symbol")}function XA(t){return null==t||J(t)||(t={isIgnore:t}),t||{}}function jA(t){var e=t.hostModel,n=e.getModel("emphasis");return{emphasisItemStyle:n.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:n.get("focus"),blurScope:n.get("blurScope"),emphasisDisabled:n.get("disabled"),hoverScale:n.get("scale"),labelStatesModels:Zp(e),cursorStyle:e.get("cursor")}}function ZA(t,e,n,r,i,o,a){var s=new t(e,n,r,i);return s.setPosition(o),e.setItemGraphicEl(n,s),a.add(s),s}var YA=function(){function t(t){this.group=new Do,this._SymbolCtor=t||UA}return t.prototype.updateData=function(t,e){this._progressiveEls=null,e=XA(e);var n=this.group,r=t.hostModel,i=this._data,o=this._SymbolCtor,a=e.disableAnimation,s=this._seriesScope=jA(t),l={disableAnimation:a},u=e.getSymbolPoint||function(e){return t.getItemLayout(e)};i||n.removeAll(),t.diff(i).add(function(r){var i=u(r);WA(t,i,r,e)&&ZA(o,t,r,s,l,i,n)}).update(function(h,c){var d=i.getItemGraphicEl(c),p=u(h);if(WA(t,p,h,e)){var f=t.getItemVisual(h,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==f)n.remove(d),(d=new o(t,h,s,l)).setPosition(p);else{d.updateData(t,h,s,l);var m={x:p[0],y:p[1]};a?d.attr(m):Xd(d,m,r)}n.add(d),t.setItemGraphicEl(h,d)}else n.remove(d)}).remove(function(t){var e=i.getItemGraphicEl(t);e&&e.fadeOut(function(){n.remove(e)},r)}).execute(),this._getSymbolPoint=u,this._data=t},t.prototype.updateLayout=function(t){var e=this._data;if(e)for(var n=this,r=0,i=e.getStore().count();r<i;r++){var o=e.getItemGraphicEl(r),a=n._getSymbolPoint(r);WA(e,a,r,t)?((o=o||ZA(n._SymbolCtor,e,r,n._seriesScope,{disableAnimation:!0},a,n.group)).stopAnimation(),o.setPosition(a),o.markRedraw()):o&&(n.group.remove(o),e.setItemGraphicEl(r,null))}},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=jA(t),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n,r){function i(t){t.isGroup||(t.incremental=n,t.ensureState("emphasis").hoverLayer=2)}this._progressiveEls=[],r=XA(r);for(var o=t.start;o<t.end;o++){var a=e.getItemLayout(o);if(WA(e,a,o,r)){var s=new this._SymbolCtor(e,o,this._seriesScope);s.traverse(i),s.setPosition(a),this.group.add(s),e.setItemGraphicEl(o,s),this._progressiveEls.push(s)}}},t.prototype.eachRendered=function(t){Dp(this._progressiveEls||this.group,t)},t.prototype.remove=function(t){var e=this.group,n=this._data;n&&t?n.eachItemGraphicEl(function(t){t.fadeOut(function(){e.remove(t)},n.hostModel)}):e.removeAll()},t}(),qA=YA;function KA(t,e,n){var r=t.getBaseAxis(),i=t.getOtherAxis(r),o=function(t,e){var n=0,r=t.scale.getExtent();"start"===e?n=r[0]:"end"===e?n=r[1]:K(e)&&!isNaN(e)?n=e:r[0]>0?n=r[0]:r[1]<0&&(n=r[1]);return n}(i,n),a=r.dim,s=i.dim,l=e.mapDimension(s),u=e.mapDimension(a),h="x"===s||"radius"===s?1:0,c=V(t.dimensions,function(t){return e.mapDimension(t)}),d=!1,p=e.getCalculationInfo("stackResultDimension");return pS(e,c[0])&&(d=!0,c[0]=p),pS(e,c[1])&&(d=!0,c[1]=p),{dataDimsForPoint:c,valueStart:o,valueAxisDim:s,baseAxisDim:a,stacked:!!d,valueDim:l,baseDim:u,baseDataOffset:h,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function JA(t,e,n,r){var i=NaN;t.stacked&&(i=n.get(n.getCalculationInfo("stackedOverDimension"),r)),isNaN(i)&&(i=t.valueStart);var o=t.baseDataOffset,a=[];return a[o]=n.get(t.baseDim,r),a[1-o]=i,e.dataToPoint(a)}function QA(t,e){return!isFinite(t)||!isFinite(e)}var $A=typeof Float32Array!==eh?Float32Array:void 0,tD=typeof Float64Array!==eh?Float64Array:void 0;function eD(t){return nD({ctor:$A},t).arr}function nD(t,e){ht(null!=e&&isFinite(e)&&e>=0&&t.hasOwnProperty("ctor"));var n=t.arr,r=t.ctor;if(e>ua&&(e=ua),!n||t.typed&&n.length<e){var i=void 0;if(r)try{i=new r(e),t.typed=!0,n&&i.set(n)}catch(t){La(t)}if(!i&&(i=[],t.typed=!1,n))for(var o=0,a=n.length;o<a;o++)i[o]=n[o];t.arr=i}return t}var rD=Math.min,iD=Math.max;function oD(t,e,n,r,i,o,a,s,l){for(var u,h,c,d,p,f,g=n,m=0;m<r;m++){var v=e[2*g],y=e[2*g+1];if(g>=i||g<0)break;if(QA(v,y)){if(l){g+=o;continue}break}if(g===n)t[o>0?"moveTo":"lineTo"](v,y),c=v,d=y;else{var _=v-u,x=y-h;if(_*_+x*x<.5){g+=o;continue}if(a>0){for(var b=g+o,w=e[2*b],S=e[2*b+1];w===v&&S===y&&m<r;)m++,g+=o,w=e[2*(b+=o)],S=e[2*b+1],_=(v=e[2*g])-u,x=(y=e[2*g+1])-h;var T=m+1;if(l)for(;QA(w,S)&&T<r;)T++,w=e[2*(b+=o)],S=e[2*b+1];var M=.5,C=0,I=0,A=void 0,D=void 0;if(T>=r||QA(w,S))p=v,f=y;else{C=w-u,I=S-h;var L=v-u,P=w-v,E=y-h,O=S-y,N=void 0,R=void 0;if("x"===s){var k=C>0?1:-1;p=v-k*(N=Math.abs(L))*a,f=y,A=v+k*(R=Math.abs(P))*a,D=y}else if("y"===s){var z=I>0?1:-1;p=v,f=y-z*(N=Math.abs(E))*a,A=v,D=y+z*(R=Math.abs(O))*a}else N=Math.sqrt(L*L+E*E),p=v-C*a*(1-(M=(R=Math.sqrt(P*P+O*O))/(R+N))),f=y-I*a*(1-M),D=y+I*a*M,A=rD(A=v+C*a*M,iD(w,v)),D=rD(D,iD(S,y)),A=iD(A,rD(w,v)),f=y-(I=(D=iD(D,rD(S,y)))-y)*N/R,p=rD(p=v-(C=A-v)*N/R,iD(u,v)),f=rD(f,iD(h,y)),A=v+(C=v-(p=iD(p,rD(u,v))))*R/N,D=y+(I=y-(f=iD(f,rD(h,y))))*R/N}t.bezierCurveTo(c,d,p,f,v,y),c=A,d=D}else t.lineTo(v,y)}u=v,h=y,g+=o}return m}var aD=function(){this.smooth=0,this.smoothConstraint=!0},sD=function(t){function n(e){var n=t.call(this,e)||this;return n.type="ec-polyline",n}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:om.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new aD},n.prototype.buildPath=function(t,e){var n=e.points,r=0,i=n.length/2;if(e.connectNulls){for(;i>0&&QA(n[2*i-2],n[2*i-1]);i--);for(;r<i&&QA(n[2*r],n[2*r+1]);r++);}for(;r<i;)r+=oD(t,n,r,i,i,1,e.smooth,e.smoothMonotone,e.connectNulls)+1},n.prototype.getPointOn=function(t,e){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var n,r,i=this.path.data,o=Ql.CMD,a="x"===e,s=[],l=0;l<i.length;){var u=void 0,h=void 0,c=void 0,d=void 0,p=void 0,f=void 0,g=void 0;switch(i[l++]){case o.M:n=i[l++],r=i[l++];break;case o.L:if(u=i[l++],h=i[l++],(g=a?(t-n)/(u-n):(t-r)/(h-r))<=1&&g>=0){var m=a?(h-r)*g+r:(u-n)*g+n;return a?[t,m]:[m,t]}n=u,r=h;break;case o.C:u=i[l++],h=i[l++],c=i[l++],d=i[l++],p=i[l++],f=i[l++];var v=a?Zn(n,u,c,p,t,s):Zn(r,h,d,f,t,s);if(v>0)for(var y=0;y<v;y++){var _=s[y];if(_<=1&&_>=0){m=a?Xn(r,h,d,f,_):Xn(n,u,c,p,_);return a?[t,m]:[m,t]}}n=p,r=f}}},n}(xu),lD=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n}(aD),uD=function(t){function n(e){var n=t.call(this,e)||this;return n.type="ec-polygon",n}return e(n,t),n.prototype.getDefaultShape=function(){return new lD},n.prototype.buildPath=function(t,e){var n=e.points,r=e.stackedOnPoints,i=0,o=n.length/2,a=e.smoothMonotone;if(e.connectNulls){for(;o>0&&QA(n[2*o-2],n[2*o-1]);o--);for(;i<o&&QA(n[2*i],n[2*i+1]);i++);}for(;i<o;){var s=oD(t,n,i,o,o,1,e.smooth,a,e.connectNulls);oD(t,r,i+s-1,s,o,-1,e.stackedOnSmooth,a,e.connectNulls),i+=s+1,t.closePath()}},n}(xu);function hD(t,e,n,r,i){var o=t.getArea(),a=o.x,s=o.y,l=o.width,u=o.height,h=n.get(["lineStyle","width"])||0;a-=h/2,s-=h/2,l+=h,u+=h,l=Math.ceil(l),a!==Math.floor(a)&&(a=Math.floor(a),l++);var c=new Ru({shape:{x:a,y:s,width:l,height:u}});if(e){var d=t.getBaseAxis(),p=d.isHorizontal(),f=d.inverse;p?(f&&(c.shape.x+=l),c.shape.width=0):(f||(c.shape.y+=u),c.shape.height=0);var g=Z(i)?function(t){i(t,c)}:null;jd(c,{shape:{width:l,height:u,x:a,y:s}},n,null,r,g)}return c}function cD(t,e,n){var r=t.getArea(),i=ea(r.r0,1),o=ea(r.r,1),a=new td({shape:{cx:ea(t.cx,1),cy:ea(t.cy,1),r0:i,r:o,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}});e&&("angle"===t.getBaseAxis().dim?a.shape.endAngle=r.startAngle:a.shape.r=i,jd(a,{shape:{endAngle:r.endAngle,r:o}},n));return a}function dD(t,e,n,r,i){return t?"polar"===t.type?cD(t,e,n):"cartesian2d"===t.type?hD(t,e,n,r,i):null:null}function pD(t,e,n){t?(ht(n),e.setClipPath(n)):e.removeClipPath()}function fD(t){var e=t.coordinateSystem;if(t.get("clip",!0)&&e&&(!e.shouldClip||e.shouldClip()))return e.getArea&&e.getArea(.1)}function gD(t,e){return t.type===e}function mD(t){var e=t.dimensions;return"lng"===e[0]&&"lat"===e[1]&&!!t.getViewRect}var vD={};function yD(t,e,n,r){return t&&(t.legacy||!1!==t.legacy&&!n&&!r&&"tspan"!==e&&("text"===e||wt(t,"text")))}function _D(t,e,n){var r,i,o,a=t;if("text"===e)o=a;else{o={},wt(a,"text")&&(o.text=a.text),wt(a,"rich")&&(o.rich=a.rich),wt(a,"textFill")&&(o.fill=a.textFill),wt(a,"textStroke")&&(o.stroke=a.textStroke),wt(a,"fontFamily")&&(o.fontFamily=a.fontFamily),wt(a,"fontSize")&&(o.fontSize=a.fontSize),wt(a,"fontStyle")&&(o.fontStyle=a.fontStyle),wt(a,"fontWeight")&&(o.fontWeight=a.fontWeight),i={type:"text",style:o,silent:!0},r={};var s=wt(a,"textPosition");n?r.position=s?a.textPosition:"inside":s&&(r.position=a.textPosition),wt(a,"textPosition")&&(r.position=a.textPosition),wt(a,"textOffset")&&(r.offset=a.textOffset),wt(a,"textRotation")&&(r.rotation=a.textRotation),wt(a,"textDistance")&&(r.distance=a.textDistance)}return xD(o,t),B(o.rich,function(t){xD(t,t)}),{textConfig:r,textContent:i}}function xD(t,e){e&&(e.font=e.textFont||e.font,wt(e,"textStrokeWidth")&&(t.lineWidth=e.textStrokeWidth),wt(e,"textAlign")&&(t.align=e.textAlign),wt(e,"textVerticalAlign")&&(t.verticalAlign=e.textVerticalAlign),wt(e,"textLineHeight")&&(t.lineHeight=e.textLineHeight),wt(e,"textWidth")&&(t.width=e.textWidth),wt(e,"textHeight")&&(t.height=e.textHeight),wt(e,"textBackgroundColor")&&(t.backgroundColor=e.textBackgroundColor),wt(e,"textPadding")&&(t.padding=e.textPadding),wt(e,"textBorderColor")&&(t.borderColor=e.textBorderColor),wt(e,"textBorderWidth")&&(t.borderWidth=e.textBorderWidth),wt(e,"textBorderRadius")&&(t.borderRadius=e.textBorderRadius),wt(e,"textBoxShadowColor")&&(t.shadowColor=e.textBoxShadowColor),wt(e,"textBoxShadowBlur")&&(t.shadowBlur=e.textBoxShadowBlur),wt(e,"textBoxShadowOffsetX")&&(t.shadowOffsetX=e.textBoxShadowOffsetX),wt(e,"textBoxShadowOffsetY")&&(t.shadowOffsetY=e.textBoxShadowOffsetY))}function bD(t,e,n){var r=t;r.textPosition=r.textPosition||n.position||"inside",null!=n.offset&&(r.textOffset=n.offset),null!=n.rotation&&(r.textRotation=n.rotation),null!=n.distance&&(r.textDistance=n.distance);var i=r.textPosition.indexOf("inside")>=0,o=t.fill||om.color.neutral99;wD(r,e);var a=null==r.textFill;return i?a&&(r.textFill=n.insideFill||om.color.neutral00,!r.textStroke&&n.insideStroke&&(r.textStroke=n.insideStroke),!r.textStroke&&(r.textStroke=o),null==r.textStrokeWidth&&(r.textStrokeWidth=2)):(a&&(r.textFill=t.fill||n.outsideFill||om.color.neutral00),!r.textStroke&&n.outsideStroke&&(r.textStroke=n.outsideStroke)),r.text=e.text,r.rich=e.rich,B(e.rich,function(t){wD(t,t)}),r}function wD(t,e){e&&(wt(e,"fill")&&(t.textFill=e.fill),wt(e,"stroke")&&(t.textStroke=e.fill),wt(e,"lineWidth")&&(t.textStrokeWidth=e.lineWidth),wt(e,"font")&&(t.font=e.font),wt(e,"fontStyle")&&(t.fontStyle=e.fontStyle),wt(e,"fontWeight")&&(t.fontWeight=e.fontWeight),wt(e,"fontSize")&&(t.fontSize=e.fontSize),wt(e,"fontFamily")&&(t.fontFamily=e.fontFamily),wt(e,"align")&&(t.textAlign=e.align),wt(e,"verticalAlign")&&(t.textVerticalAlign=e.verticalAlign),wt(e,"lineHeight")&&(t.textLineHeight=e.lineHeight),wt(e,"width")&&(t.textWidth=e.width),wt(e,"height")&&(t.textHeight=e.height),wt(e,"backgroundColor")&&(t.textBackgroundColor=e.backgroundColor),wt(e,"padding")&&(t.textPadding=e.padding),wt(e,"borderColor")&&(t.textBorderColor=e.borderColor),wt(e,"borderWidth")&&(t.textBorderWidth=e.borderWidth),wt(e,"borderRadius")&&(t.textBorderRadius=e.borderRadius),wt(e,"shadowColor")&&(t.textBoxShadowColor=e.shadowColor),wt(e,"shadowBlur")&&(t.textBoxShadowBlur=e.shadowBlur),wt(e,"shadowOffsetX")&&(t.textBoxShadowOffsetX=e.shadowOffsetX),wt(e,"shadowOffsetY")&&(t.textBoxShadowOffsetY=e.shadowOffsetY),wt(e,"textShadowColor")&&(t.textShadowColor=e.textShadowColor),wt(e,"textShadowBlur")&&(t.textShadowBlur=e.textShadowBlur),wt(e,"textShadowOffsetX")&&(t.textShadowOffsetX=e.textShadowOffsetX),wt(e,"textShadowOffsetY")&&(t.textShadowOffsetY=e.textShadowOffsetY))}function SD(t,e){var n=t+"^_^"+e;vD[n]||(console.warn('[ECharts] DEPRECATED: "'+t+'" has been deprecated. '+e),vD[n]=!0)}function TD(t,e){if(t.length===e.length){for(var n=0;n<t.length;n++)if(t[n]!==e[n])return;return!0}}function MD(t){for(var e=[1/0,-1/0],n=[1/0,-1/0],r=0;r<t.length;){var i=t[r++],o=t[r++];QA(i,o)||(ds(e,i),ds(n,o))}return[e,n]}function CD(t,e){var n=MD(t),r=n[0],i=n[1],o=MD(e),a=o[0],s=o[1];return Math.max(Math.abs(r[0]-a[0]),Math.abs(i[0]-s[0]),Math.abs(r[1]-a[1]),Math.abs(i[1]-s[1]))}function ID(t){return K(t)?t:t?.5:0}function AD(t,e,n,r,i){var o=n.getBaseAxis(),a="x"===o.dim||"radius"===o.dim?0:1,s=[],l=0,u=[],h=[],c=[],d=[];if(i){for(l=0;l<t.length;l+=2){var p=e||t;QA(p[l],p[l+1])||d.push(t[l],t[l+1])}t=d}for(l=0;l<t.length-2;l+=2)switch(c[0]=t[l+2],c[1]=t[l+3],h[0]=t[l],h[1]=t[l+1],s.push(h[0],h[1]),r){case"end":u[a]=c[a],u[1-a]=h[1-a],s.push(u[0],u[1]);break;case"middle":var f=(h[a]+c[a])/2,g=[];u[a]=g[a]=f,u[1-a]=h[1-a],g[1-a]=c[1-a],s.push(u[0],u[1]),s.push(g[0],g[1]);break;default:u[a]=h[a],u[1-a]=c[1-a],s.push(u[0],u[1])}return s.push(t[l++],t[l++]),s}function DD(t,e,n){var r=t.getVisual("visualMeta");if(r&&r.length&&t.count())if("cartesian2d"===e.type){for(var i,o,a=r.length-1;a>=0;a--){var s=t.getDimensionInfo(r[a].dimension);if("x"===(i=s&&s.coordDim)||"y"===i){o=r[a];break}}if(o){var l=e.getAxis(i),u=V(o.stops,function(t){return{coord:l.toGlobalCoord(l.dataToCoord(t.value)),color:t.color}}),h=u.length,c=o.outerColors.slice();h&&u[0].coord>u[h-1].coord&&(u.reverse(),c.reverse());var d=function(t,e){var n,r,i=[],o=t.length;function a(t,e,n){var r=t.coord;return{coord:n,color:Ar((n-r)/(e.coord-r),[t.color,e.color])}}for(var s=0;s<o;s++){var l=t[s],u=l.coord;if(u<0)n=l;else{if(u>e){r?i.push(a(r,l,e)):n&&i.push(a(n,l,0),a(n,l,e));break}n&&(i.push(a(n,l,0)),n=null),i.push(l),r=l}}return i}(u,"x"===i?n.getWidth():n.getHeight()),p=d.length;if(!p&&h)return u[0].coord<0?c[1]?c[1]:u[h-1].color:c[0]?c[0]:u[0].color;var f=d[0].coord-10,g=d[p-1].coord+10,m=g-f;if(m<.001)return"transparent";B(d,function(t){t.offset=(t.coord-f)/m}),d.push({offset:p?d[p-1].offset:.5,color:c[1]||"transparent"}),d.unshift({offset:p?d[0].offset:.5,color:c[0]||"transparent"});var v=new Id(0,0,0,0,d,!0);return v[i]=f,v[i+"2"]=g,v}console.warn("Visual map on line style only support x or y dimension.")}else console.warn("Visual map on line style is only supported on cartesian2d.")}function LD(t,e,n){var r=t.get("showAllSymbol"),i="auto"===r;if(!r||i){var o=n.getAxesByScale("ordinal")[0];if(o&&(!i||!function(t,e){var n=t.getExtent(),r=Math.abs(n[1]-n[0])/t.scale.count();isNaN(r)&&(r=0);for(var i=e.count(),o=Math.max(1,Math.round(i/5)),a=0;a<i;a+=o)if(1.5*UA.getSymbolSize(e,a)[t.isHorizontal()?1:0]>r)return!1;return!0}(o,e))){var a=e.mapDimension(o.dim),s={};return B(o.getViewLabels(),function(t){t.tick.offInterval||(s[TT(o.scale,t.tick)]=1)}),function(t){return!s.hasOwnProperty(e.get(a,t))}}}}function PD(t,e){return[t[2*e],t[2*e+1]]}function ED(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<xh.length;e++)if(t.get([xh[e],"endLabel","show"]))return!0;return!1}function OD(t,e,n,r){if(gD(e,"cartesian2d")){var i=r.getModel("endLabel"),o=i.get("valueAnimation"),a=r.getData(),s={lastFrameIndex:0},l=ED(r)?function(n,r){t._endLabelOnDuring(n,r,a,s,o,i,e)}:null,u=e.getBaseAxis().isHorizontal(),h=hD(e,n,r,function(){var e=t._endLabel;e&&n&&null!=s.originalX&&e.attr({x:s.originalX,y:s.originalY})},l);if(!r.get("clip",!0)){var c=h.shape,d=Math.max(c.width,c.height);u?(c.y-=d,c.height+=2*d):(c.x-=d,c.width+=2*d)}return l&&l(1,h),h}return r.get(["endLabel","show"])&&console.warn("endLabel is not supported for lines in polar systems."),cD(e,n,r)}var ND=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.init=function(){var t=new Do,e=new qA;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t,this._changePolyState=W(this._changePolyState,this)},n.prototype.render=function(t,e,n){var r=t.coordinateSystem,i=this.group,o=t.getData(),a=t.getModel("lineStyle"),s=t.getModel("areaStyle"),l=o.getLayout("points")||[],u="polar"===r.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,p=this._polygon,f=this._lineGroup,g=!e.ssr&&t.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=KA(r,o,v),_=m&&function(t,e,n){if(null==n.valueDim)return[];for(var r=e.count(),i=eD(2*r),o=0;o<r;o++){var a=JA(n,t,e,o);i[2*o]=a[0],i[2*o+1]=a[1]}return i}(r,o,y),x=t.get("showSymbol"),b=t.get("connectNulls"),w=x&&!u&&LD(t,o,r),S=this._data;S&&S.eachItemGraphicEl(function(t,e){t.__temp&&(i.remove(t),S.setItemGraphicEl(e,null))}),x||c.remove(),i.add(f);var T,M=!u&&t.get("step");r&&r.getArea&&t.get("clip",!0)&&(null!=(T=r.getArea()).width?(T.x-=.1,T.y-=.1,T.width+=.2,T.height+=.2):T.r0&&(T.r0-=.5,T.r+=.5)),this._clipShapeForSymbol=T;var C=DD(o,r,n)||o.getVisual("style")[o.getVisual("drawType")];if(d&&h.type===r.type&&M===this._step){m&&!p?p=this._newPolygon(l,_):p&&!m&&(f.remove(p),p=this._polygon=null),u||this._initOrUpdateEndLabel(t,r,Mg(C));var I=f.getClipPath();if(I)jd(I,{shape:OD(this,r,!1,t).shape},t);else f.setClipPath(OD(this,r,!0,t));x&&c.updateData(o,{isIgnore:w,clipShape:T,disableAnimation:!0,getSymbolPoint:function(t){return[l[2*t],l[2*t+1]]}}),TD(this._stackedOnPoints,_)&&TD(this._points,l)||(g?this._doUpdateAnimation(o,_,r,n,M,v,b):(M&&(_&&(_=AD(_,l,r,M,b)),l=AD(l,null,r,M,b)),d.setShape({points:l}),p&&p.setShape({points:l,stackedOnPoints:_})))}else x&&c.updateData(o,{isIgnore:w,clipShape:T,disableAnimation:!0,getSymbolPoint:function(t){return[l[2*t],l[2*t+1]]}}),g&&this._initSymbolLabelAnimation(o,r,T),M&&(_&&(_=AD(_,l,r,M,b)),l=AD(l,null,r,M,b)),d=this._newPolyline(l),m?p=this._newPolygon(l,_):p&&(f.remove(p),p=this._polygon=null),u||this._initOrUpdateEndLabel(t,r,Mg(C)),f.setClipPath(OD(this,r,!0,t));var A=t.getModel("emphasis"),D=A.get("focus"),L=A.get("blurScope"),P=A.get("disabled");(d.useStyle(E(a.getLineStyle(),{fill:"none",stroke:C,lineJoin:"bevel"})),lc(d,t,"lineStyle"),d.style.lineWidth>0&&"bolder"===t.get(["emphasis","lineStyle","width"]))&&(d.getState("emphasis").style.lineWidth=+d.style.lineWidth+1);$u(d).seriesIndex=t.seriesIndex,ic(d,D,L,P);var O=ID(t.get("smooth")),N=t.get("smoothMonotone");if(d.setShape({smooth:O,smoothMonotone:N,connectNulls:b}),p){var R=o.getCalculationInfo("stackedOnSeries"),k=0;p.useStyle(E(s.getAreaStyle(),{fill:C,opacity:.7,lineJoin:"bevel",decal:o.getVisual("style").decal})),R&&(k=ID(R.get("smooth"))),p.setShape({smooth:O,stackedOnSmooth:k,smoothMonotone:N,connectNulls:b}),lc(p,t,"areaStyle"),$u(p).seriesIndex=t.seriesIndex,ic(p,D,L,P)}var z=this._changePolyState;o.eachItemGraphicEl(function(t){t&&(t.onHoverStateChange=z)}),this._polyline.onHoverStateChange=z,this._data=o,this._coordSys=r,this._stackedOnPoints=_,this._points=l,this._step=M,this._valueOrigin=v;var B=t.get("triggerEvent"),V=t.get("triggerLineEvent");V&&SD("triggerLineEvent","Use the `triggerEvent` option instead.");var F=!0===V||!0===B||"line"===B,G=!0===V||!0===B||"area"===B;this.packEventData(t,d,F),p&&this.packEventData(t,p,G)},n.prototype.packEventData=function(t,e,n){$u(e).eventData=n?{componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line",selfType:e===this._polygon?"area":"line"}:null},n.prototype.highlight=function(t,e,n,r){var i=t.getData(),o=Ja(i,r);if(this._changePolyState("emphasis"),!(o instanceof Array)&&null!=o&&o>=0){var a=i.getLayout("points"),s=i.getItemGraphicEl(o);if(!s){var l=a[2*o],u=a[2*o+1];if(QA(l,u))return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(l,u))return;var h=t.get("zlevel")||0,c=t.get("z")||0;(s=new UA(i,o)).x=l,s.y=u,s.setZ(h,c);var d=s.getSymbolPath().getTextContent();d&&(d.zlevel=h,d.z=c,d.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(o,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else l_.prototype.highlight.call(this,t,e,n,r)},n.prototype.downplay=function(t,e,n,r){var i=t.getData(),o=Ja(i,r);if(this._changePolyState("normal"),null!=o&&o>=0){var a=i.getItemGraphicEl(o);a&&(a.__temp?(i.setItemGraphicEl(o,null),this.group.remove(a)):a.downplay())}else l_.prototype.downplay.call(this,t,e,n,r)},n.prototype._changePolyState=function(t){var e=this._polygon;Vh(this._polyline,t),e&&Vh(e,t)},n.prototype._newPolyline=function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new sD({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(e),this._polyline=e,e},n.prototype._newPolygon=function(t,e){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new uD({shape:{points:t,stackedOnPoints:e},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},n.prototype._initSymbolLabelAnimation=function(t,e,n){var r,i,o=e.getBaseAxis(),a=o.inverse;"cartesian2d"===e.type?(r=o.isHorizontal(),i=!1):"polar"===e.type&&(r="angle"===o.dim,i=!0);var s=t.hostModel,l=s.get("animationDuration");Z(l)&&(l=l(null));var u=s.get("animationDelay")||0,h=Z(u)?u(null):u;t.eachItemGraphicEl(function(t,o){var s=t;if(s){var c=[t.x,t.y],d=void 0,p=void 0,f=void 0;if(n)if(i){var g=n,m=e.pointToCoord(c);r?(d=g.startAngle,p=g.endAngle,f=-m[1]/180*Math.PI):(d=g.r0,p=g.r,f=m[0])}else{var v=n;r?(d=v.x,p=v.x+v.width,f=t.x):(d=v.y+v.height,p=v.y,f=t.y)}var y=p===d?0:(f-d)/(p-d);a&&(y=1-y);var _=Z(u)?u(o):l*y+h,x=s.getSymbolPath(),b=x.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:_}),b&&b.animateFrom({style:{opacity:0}},{duration:300,delay:_}),x.disableLabelAnimation=!0}})},n.prototype._initOrUpdateEndLabel=function(t,e,n){var r=t.getModel("endLabel");if(ED(t)){var i=t.getData(),o=this._polyline,a=i.getLayout("points");if(!a)return o.removeTextContent(),void(this._endLabel=null);var s=this._endLabel;s||((s=this._endLabel=new Qu({z2:200})).ignoreClip=!0,o.setTextContent(this._endLabel),o.disableLabelAnimation=!0);var l=function(t){for(var e=t.length/2;e>0&&QA(t[2*e-2],t[2*e-1]);e--);return e-1}(a);l>=0&&(jp(o,Zp(t,"endLabel"),{inheritColor:n,labelFetcher:t,labelDataIndex:l,defaultText:function(t,e,n){return null!=n?FA(i,n):VA(i,t)},enableTextSetter:!0},function(t,e){var n=e.getBaseAxis(),r=n.isHorizontal(),i=n.inverse,o=r?i?"right":"left":"center",a=r?"middle":i?"top":"bottom";return{normal:{align:t.get("align")||o,verticalAlign:t.get("verticalAlign")||a}}}(r,e)),o.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},n.prototype._endLabelOnDuring=function(t,e,n,r,i,o,a){var s=this._endLabel,l=this._polyline;if(s){t<1&&null==r.originalX&&(r.originalX=s.x,r.originalY=s.y);var u=n.getLayout("points"),h=n.hostModel,c=h.get("connectNulls"),d=o.get("precision"),p=o.get("distance")||0,f=a.getBaseAxis(),g=f.isHorizontal(),m=f.inverse,v=e.shape,y=m?g?v.x:v.y+v.height:g?v.x+v.width:v.y,_=(g?p:0)*(m?-1:1),x=(g?0:-p)*(m?-1:1),b=g?"x":"y",w=function(t,e,n){for(var r,i,o=t.length/2,a="x"===n?0:1,s=0,l=-1,u=0;u<o;u++)if(!QA(i=t[2*u+a],t[2*u+1-a]))if(0!==u){if(r<=e&&i>=e||r>=e&&i<=e){l=u;break}s=u,r=i}else r=i;return{range:[s,l],t:(e-r)/(i-r)}}(u,y,b),S=w.range,T=S[1]-S[0],M=void 0;if(T>=1){if(T>1&&!c){var C=PD(u,S[0]);s.attr({x:C[0]+_,y:C[1]+x}),i&&(M=h.getRawValue(S[0]))}else{(C=l.getPointOn(y,b))&&s.attr({x:C[0]+_,y:C[1]+x});var I=h.getRawValue(S[0]),A=h.getRawValue(S[1]);i&&(M=ls(n,d,I,A,w.t))}r.lastFrameIndex=S[0]}else{var D=1===t||r.lastFrameIndex>0?S[0]:0;C=PD(u,D);i&&(M=h.getRawValue(D)),s.attr({x:C[0]+_,y:C[1]+x})}if(i){var L=ef(s);"function"==typeof L.setLabelText&&L.setLabelText(M)}}},n.prototype._doUpdateAnimation=function(t,e,n,r,i,o,a){var s=this._polyline,l=this._polygon,u=t.hostModel,h=function(t,e,n,r,i,o,a){for(var s=function(t,e){var n=[];return e.diff(t).add(function(t){n.push({cmd:"+",idx:t})}).update(function(t,e){n.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){n.push({cmd:"-",idx:t})}).execute(),n}(t,e),l=[],u=[],h=[],c=[],d=[],p=[],f=[],g=KA(i,e,a),m=t.getLayout("points")||[],v=e.getLayout("points")||[],y=0;y<s.length;y++){var _=s[y],x=!0,b=void 0,w=void 0;switch(_.cmd){case"=":b=2*_.idx,w=2*_.idx1;var S=m[b],T=m[b+1],M=v[w],C=v[w+1];(isNaN(S)||isNaN(T))&&(S=M,T=C),l.push(S,T),u.push(M,C),h.push(n[b],n[b+1]),c.push(r[w],r[w+1]),f.push(e.getRawIndex(_.idx1));break;case"+":var I=_.idx,A=g.dataDimsForPoint,D=i.dataToPoint([e.get(A[0],I),e.get(A[1],I)]);w=2*I,l.push(D[0],D[1]),u.push(v[w],v[w+1]);var L=JA(g,i,e,I);h.push(L[0],L[1]),c.push(r[w],r[w+1]),f.push(e.getRawIndex(I));break;case"-":x=!1}x&&(d.push(_),p.push(p.length))}p.sort(function(t,e){return f[t]-f[e]});var P=l.length,E=eD(P),O=eD(P),N=eD(P),R=eD(P),k=[];for(y=0;y<p.length;y++){var z=p[y],B=2*y,V=2*z;E[B]=l[V],E[B+1]=l[V+1],O[B]=u[V],O[B+1]=u[V+1],N[B]=h[V],N[B+1]=h[V+1],R[B]=c[V],R[B+1]=c[V+1],k[y]=d[z]}return{current:E,next:O,stackedOnCurrent:N,stackedOnNext:R,status:k}}(this._data,t,this._stackedOnPoints,e,this._coordSys,0,this._valueOrigin),c=h.current,d=h.stackedOnCurrent,p=h.next,f=h.stackedOnNext;if(i&&(d=AD(h.stackedOnCurrent,h.current,n,i,a),c=AD(h.current,null,n,i,a),f=AD(h.stackedOnNext,h.next,n,i,a),p=AD(h.next,null,n,i,a)),CD(c,p)>3e3||l&&CD(d,f)>3e3)return s.stopAnimation(),s.setShape({points:p}),void(l&&(l.stopAnimation(),l.setShape({points:p,stackedOnPoints:f})));s.shape.__points=h.current,s.shape.points=c;var g={shape:{points:p}};h.current!==c&&(g.shape.__points=h.next),s.stopAnimation(),Xd(s,g,u),l&&(l.setShape({points:c,stackedOnPoints:d}),l.stopAnimation(),Xd(l,{shape:{stackedOnPoints:f}},u),s.shape.points!==l.shape.points&&(l.shape.points=s.shape.points));for(var m=[],v=h.status,y=0;y<v.length;y++){if("="===v[y].cmd){var _=t.getItemGraphicEl(v[y].idx1);_&&m.push({el:_,ptIdx:y})}}s.animators&&s.animators.length&&s.animators[0].during(function(){l&&l.dirtyShape();for(var t=s.shape.__points,e=0;e<m.length;e++){var n=m[e].el,r=2*m[e].ptIdx;n.x=t[r],n.y=t[r+1],n.markRedraw()}})},n.prototype.remove=function(t){var e=this.group,n=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),n&&n.eachItemGraphicEl(function(t,r){t.__temp&&(e.remove(t),n.setItemGraphicEl(r,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},n.type="line",n}(l_),RD=ND;function kD(t,e){return{seriesType:t,plan:$y(),reset:function(t){var n=t.getData(),r=t.coordinateSystem,i=t.pipelineContext,o=e||i.large;if(r){var a=V(r.dimensions,function(t){return n.mapDimension(t)}).slice(0,2),s=a.length,l=n.getCalculationInfo("stackResultDimension");pS(n,a[0])&&(a[0]=l),pS(n,a[1])&&(a[1]=l);var u=n.getStore(),h=n.getDimensionIndex(a[0]),c=n.getDimensionIndex(a[1]);return s&&{progress:function(t,e){for(var n=t.end-t.start,i=o&&eD(n*s),a=[],l=[],d=t.start,p=0;d<t.end;d++){var f=void 0;if(1===s){var g=u.get(h,d);f=r.dataToPoint(g,null,l)}else a[0]=u.get(h,d),a[1]=u.get(c,d),f=r.dataToPoint(a,null,l);o?(i[p++]=f[0],i[p++]=f[1]):e.setItemLayout(d,f.slice())}o&&(e.setLayout("points",i),e.setLayout("pointsRange",{start:t.start,end:t.end}))}}}}}}var zD={average:function(t){for(var e=0,n=0,r=0;r<t.length;r++)isNaN(t[r])||(e+=t[r],n++);return 0===n?NaN:e/n},sum:function(t){for(var e=0,n=0;n<t.length;n++)e+=t[n]||0;return e},max:function(t){for(var e=-1/0,n=0;n<t.length;n++)t[n]>e&&(e=t[n]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,n=0;n<t.length;n++)t[n]<e&&(e=t[n]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}},BD=function(t){return Math.round(t.length/2)};function VD(t){return{seriesType:t,reset:function(t,e,n){var r=t.getData(),i=t.get("sampling"),o=t.coordinateSystem,a=r.count();if(a>10&&"cartesian2d"===o.type&&i){var s=o.getBaseAxis(),l=o.getOtherAxis(s),u=s.getExtent(),h=n.getDevicePixelRatio(),c=Math.abs(u[1]-u[0])*(h||1),d=Math.round(a/c);if(isFinite(d)&&d>1){"lttb"===i?t.setData(r.lttbDownSample(r.mapDimension(l.dim),1/d)):"minmax"===i&&t.setData(r.minmaxDownSample(r.mapDimension(l.dim),1/d));var p=void 0;Y(i)?p=zD[i]:Z(i)&&(p=i),p&&t.setData(r.downSample(r.mapDimension(l.dim),1/d,p,BD))}}}}}var FD=function(t){function n(e,n,r,i,o){var a=t.call(this,e,n,r)||this;return a.index=0,a.type=i||"value",a.position=o||"bottom",a}return e(n,t),n.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},n.prototype.getGlobalExtent=function(t){var e=this.getExtent();return e[0]=this.toGlobalCoord(e[0]),e[1]=this.toGlobalCoord(e[1]),t&&e[0]>e[1]&&e.reverse(),e},n.prototype.pointToData=function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},n.prototype.setCategorySortInfo=function(t){if("category"!==this.type)return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},n}(rC),GD=FD,HD=null;function UD(){return HD}var WD="expandAxisBreak",XD="collapseAxisBreak",jD="toggleAxisBreak",ZD="axisbreakchanged",YD={type:WD,event:ZD,update:"update",refineEvent:JD},qD={type:XD,event:ZD,update:"update",refineEvent:JD},KD={type:jD,event:ZD,update:"update",refineEvent:JD};function JD(t,e,n,r){var i=[];return B(t,function(t){i=i.concat(t.eventBreaks)}),{eventContent:{breaks:i}}}var QD=Math.PI,$D=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],tL=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],eL=Qa(),nL=Qa(),rL=function(){function t(t){this.recordMap={},this.resolveAxisNameOverlap=t}return t.prototype.ensureRecord=function(t){var e=t.axis.dim,n=t.componentIndex,r=this.recordMap,i=r[e]||(r[e]=[]);return i[n]||(i[n]={ready:{}})},t}();var iL=[1,0,0,1,0,0],oL=new ln(0,0,0,0),aL=function(t,e,n,r,i,o){if(xT(t.nameLocation)){var a=o.stOccupiedRect;a&&sL(function(t,e,n){return t.transform=Op(t.transform,n),t.localRect=Ep(t.localRect,e),t.rect=Ep(t.rect,e),n&&t.rect.applyTransform(n),t.axisAligned=Lp(n),t.obb=void 0,(t.label=t.label||{}).ignore=!1,t}({},a,o.transGroup.transform),r,i)}else lL(o.labelInfoList,o.dirVec,r,i)};function sL(t,e,n){var r=new Re;UC(t,e,r,{direction:Math.atan2(n.y,n.x),bidirectional:!1,touchThreshold:.05})&&BC(e,r)}function lL(t,e,n,r){for(var i=Re.dot(r,e)>=0,o=0,a=t.length;o<a;o++){var s=t[i?o:a-1-o];s.label.ignore||sL(s,n,r)}}var uL=function(){function t(t,e,n,r){this.group=new Do,this._axisModel=t,this._api=e,this._local={},this._shared=r||new rL(aL),this._resetCfgDetermined(n)}return t.prototype.updateCfg=function(t){var e=this._shared.ensureRecord(this._axisModel).ready;ht(!e.axisLine&&!e.axisTickLabelDetermine),e.axisName=e.axisTickLabelEstimate=!1;var n=this._cfg.raw;n.position=t.position,n.labelOffset=t.labelOffset,this._resetCfgDetermined(n)},t.prototype.__getRawCfg=function(){return this._cfg.raw},t.prototype._resetCfgDetermined=function(t){var e=this._axisModel,n=e.getDefaultOption?e.getDefaultOption():{},r=at(t.axisName,e.get("name")),i=e.get("nameMoveOverlap");null!=i&&"auto"!==i||(i=at(t.defaultNameMoveOverlap,!0));var o={raw:t,position:t.position,rotation:t.rotation,nameDirection:at(t.nameDirection,1),tickDirection:at(t.tickDirection,1),labelDirection:at(t.labelDirection,1),labelOffset:at(t.labelOffset,0),silent:at(t.silent,!0),axisName:r,nameLocation:st(e.get("nameLocation"),n.nameLocation,"end"),shouldNameMoveOverlap:xL(r)&&i,optionHideOverlap:e.get(["axisLabel","hideOverlap"]),showMinorTicks:e.get(["minorTick","show"])};ht(null!=o.position),ht(null!=o.rotation),this._cfg=o;var a=new Do({x:o.position[0],y:o.position[1],rotation:o.rotation});a.updateTransform(),this._transformGroup=a;var s=this._shared.ensureRecord(e);s.transGroup=this._transformGroup,s.dirVec=new Re(Math.cos(-o.rotation),Math.sin(-o.rotation))},t.prototype.build=function(t,e){var n=this;return t||(t={axisLine:!0,axisTickLabelEstimate:!1,axisTickLabelDetermine:!0,axisName:!0}),B(hL,function(r){t[r]&&cL[r](n._cfg,n._local,n._shared,n._axisModel,n.group,n._transformGroup,n._api,e||{})}),this},t.innerTextLayout=function(t,e,n){var r,i,o=ha(e-t);return ca(o)?(i=n>0?"top":"bottom",r="center"):ca(o-QD)?(i=n>0?"bottom":"top",r="center"):(i="middle",r=o>0&&o<QD?n>0?"right":"left":n>0?"left":"right"),{rotation:o,textAlign:r,textVerticalAlign:i}},t.makeAxisEventDataBase=function(t){var e={componentType:t.mainType,componentIndex:t.componentIndex};return e[t.mainType+"Index"]=t.componentIndex,e},t.isLabelSilent=function(t){var e=t.get("tooltip");return t.get("silent")||!(t.get("triggerEvent")||e&&e.show)},t}(),hL=["axisLine","axisTickLabelEstimate","axisTickLabelDetermine","axisName"],cL={axisLine:function(t,e,n,r,i,o,a){var s=n.ensureRecord(r).ready;ht(!s.axisLine),s.axisLine=!0;var l=r.get(["axisLine","show"]);if("auto"===l&&(l=!0,null!=t.raw.axisLineAutoShow&&(l=!!t.raw.axisLineAutoShow)),l){var u=r.axis.getExtent(),h=o.transform,c=[u[0],0],d=[u[1],0],p=c[0]>d[0];h&&(Xt(c,c,h),Xt(d,d,h));var f=L({lineCap:"round"},r.getModel(["axisLine","lineStyle"]).getLineStyle()),g={strokeContainThreshold:t.raw.strokeContainThreshold||5,silent:!0,z2:1,style:f};if(r.get(["axisLine","breakLine"])&&kf(r.axis.scale))UD().buildAxisBreakLine(r,i,o,g);else{var m=new fd(L({shape:{x1:c[0],y1:c[1],x2:d[0],y2:d[1]}},g));cp(m.shape,m.style.lineWidth),m.anid="line",i.add(m)}var v=r.get(["axisLine","symbol"]);if(null!=v){var y=r.get(["axisLine","symbolSize"]);Y(v)&&(v=[v,v]),(Y(y)||K(y))&&(y=[y,y]);var _=Ax(r.get(["axisLine","symbolOffset"])||0,y),x=y[0],b=y[1];B([{rotate:t.rotation+Math.PI/2,offset:_[0],r:0},{rotate:t.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((c[0]-d[0])*(c[0]-d[0])+(c[1]-d[1])*(c[1]-d[1]))}],function(e,n){if("none"!==v[n]&&null!=v[n]){var r=Cx(v[n],-x/2,-b/2,x,b,f.stroke,!0),o=e.r+e.offset,a=p?d:c;r.attr({rotation:e.rotate,x:a[0]+o*Math.cos(t.rotation),y:a[1]-o*Math.sin(t.rotation),silent:!0,z2:11}),i.add(r)}})}}},axisTickLabelEstimate:function(t,e,n,r,i,o,a,s){var l=n.ensureRecord(r).ready;ht(!l.axisTickLabelDetermine),l.axisTickLabelEstimate=!0,gL(e,i,s)&&dL(t,e,n,r,i,o,a,BM)},axisTickLabelDetermine:function(t,e,n,r,i,o,a,s){n.ensureRecord(r).ready.axisTickLabelDetermine=!0,gL(e,i,s)&&dL(t,e,n,r,i,o,a,VM);var l=function(t,e,n,r){var i=r.axis,o=r.getModel("axisTick"),a=o.get("show");"auto"===a&&(a=!0,null!=t.raw.axisTickAutoShow&&(a=!!t.raw.axisTickAutoShow));if(!a||i.scale.isBlank())return[];for(var s=o.getModel("lineStyle"),l=t.tickDirection*o.get("length"),u=fL(i.getTicksCoords(),n.transform,l,E(s.getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])}),"ticks"),h=0;h<u.length;h++)e.add(u[h]);return u}(t,i,o,r);!function(t,e,n){if(t.showMinorTicks)return;B(e,function(t){if(t&&t.label.ignore)for(var e=0;e<n.length;e++){var r=n[e],i=nL(r),o=eL(t.label);if(null!=i.tickValue&&!i.onBand&&i.tickValue===o.labelInfo.tick.value)return void pL(r)}})}(t,e.labelLayoutList,l),function(t,e,n,r,i){var o=r.axis,a=r.getModel("minorTick");if(!t.showMinorTicks||o.scale.isBlank())return;var s=o.getMinorTicksCoords();if(!s.length)return;for(var l=a.getModel("lineStyle"),u=i*a.get("length"),h=E(l.getLineStyle(),E(r.getModel("axisTick").getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])})),c=0;c<s.length;c++)for(var d=fL(s[c],n.transform,u,h,"minorticks_"+c),p=0;p<d.length;p++)e.add(d[p])}(t,i,o,r,t.tickDirection)},axisName:function(t,e,n,r,i,o,a,s){var l=n.ensureRecord(r),u=l.ready;ht(u.axisTickLabelEstimate||u.axisTickLabelDetermine),u.axisName=!0,e.nameEl&&(i.remove(e.nameEl),e.nameEl=l.nameLayout=l.nameLocation=null);var h=t.axisName;if(xL(h)){var c=t.nameLocation,d=t.nameDirection,p=r.getModel("nameTextStyle"),f=r.get("nameGap")||0,g=r.axis.getExtent(),m=r.axis.inverse?-1:1,v=new Re(0,0),y=new Re(0,0);"start"===c?(v.x=g[0]-m*f,y.x=-m):"end"===c?(v.x=g[1]+m*f,y.x=m):(v.x=(g[0]+g[1])/2,v.y=t.labelOffset+d*f,y.y=d);var _=[1,0,0,1,0,0];y.transform(De(_,_,t.rotation));var x,b,w=r.get("nameRotate");null!=w&&(w=w*QD/180),xT(c)?x=uL.innerTextLayout(t.rotation,null!=w?w:t.rotation,d):(x=function(t,e,n,r){var i,o,a=ha(n-t),s=r[0]>r[1],l="start"===e&&!s||"start"!==e&&s;ca(a-QD/2)?(o=l?"bottom":"top",i="center"):ca(a-1.5*QD)?(o=l?"top":"bottom",i="center"):(o="middle",i=a<1.5*QD&&a>QD/2?l?"left":"right":l?"right":"left");return{rotation:a,textAlign:i,textVerticalAlign:o}}(t.rotation,c,w||0,g),null!=(b=t.raw.axisNameAvailableWidth)&&(b=Math.abs(b/Math.sin(x.rotation)),!isFinite(b)&&(b=null)));var S=p.getFont(),T=r.get("nameTruncate",!0)||{},M=T.ellipsis,C=ot(t.raw.nameTruncateMaxWidth,T.maxWidth,b),I=s.nameMarginLevel||0,A=new Qu({x:v.x,y:v.y,rotation:x.rotation,silent:uL.isLabelSilent(r),style:Yp(p,{text:h,font:S,overflow:"truncate",width:C,ellipsis:M,fill:p.getTextColor()||r.get(["axisLine","lineStyle","color"]),align:p.get("align")||x.textAlign,verticalAlign:p.get("verticalAlign")||x.textVerticalAlign}),z2:1});if(Ip({el:A,componentModel:r,itemName:h}),A.__fullText=h,A.anid="name",r.get("triggerEvent")){var D=uL.makeAxisEventDataBase(r);D.targetType="axisName",D.name=h,$u(A).eventData=D}o.add(A),A.updateTransform(),e.nameEl=A;var L=l.nameLayout=RC({label:A,priority:A.z2,defaultAttr:{ignore:A.ignore},marginDefault:xT(c)?$D[I]:tL[I]});if(l.nameLocation=c,i.add(A),A.decomposeTransform(),t.shouldNameMoveOverlap&&L){var P=n.ensureRecord(r);ht(P.labelInfoList),n.resolveAxisNameOverlap(t,n,r,L,y,P)}}}};function dL(t,e,n,r,i,o,a,s){mL(e)||function(t,e,n,r,i,o){var a=i.axis,s=ot(t.raw.axisLabelShow,i.get(["axisLabel","show"])),l=new Do;n.add(l);var u=FM(r);if(!s||a.scale.isBlank())return void vL(e,[],l,u);var h=i.getModel("axisLabel"),c=a.getViewLabels(u),d=(ot(t.raw.labelRotate,h.get("rotate"))||0)*QD/180,p=uL.innerTextLayout(t.rotation,d,t.labelDirection),f=i.getCategories&&i.getCategories(!0),g=[],m=i.get("triggerEvent"),v=1/0,y=-1/0;B(c,function(t,e){var n,r=t.tick,s=t.formattedLabel,u=t.rawLabel,d=h,_=TT(a.scale,r);if(f&&f[_]){var x=f[_];J(x)&&x.textStyle&&(d=new xf(x.textStyle,h,i.ecModel))}var b=d.getTextColor()||i.get(["axisLine","lineStyle","color"]),w=d.getShallow("align",!0)||p.textAlign,S=at(d.getShallow("alignMinLabel",!0),w),T=at(d.getShallow("alignMaxLabel",!0),w),M=d.getShallow("verticalAlign",!0)||d.getShallow("baseline",!0)||p.textVerticalAlign,C=at(d.getShallow("verticalAlignMinLabel",!0),M),I=at(d.getShallow("verticalAlignMaxLabel",!0),M),A=10+((null===(n=r.time)||void 0===n?void 0:n.level)||0);v=Math.min(v,A),y=Math.max(y,A);var D=new Qu({x:0,y:0,rotation:0,silent:uL.isLabelSilent(i),z2:A,style:Yp(d,{text:s,align:0===e?S:e===c.length-1?T:w,verticalAlign:0===e?C:e===c.length-1?I:M,fill:Z(b)?b("category"===a.type?u:"value"===a.type?_+"":_,e):b})});D.anid="label_"+_;var L=eL(D);if(L.labelInfo=t,L.layoutRotation=p.rotation,Ip({el:D,componentModel:i,itemName:s,formatterParamsExtra:{isTruncated:function(){return D.isTruncated},value:u,tickIndex:e}}),m){var P=uL.makeAxisEventDataBase(i);P.targetType="axisLabel",P.value=u,P.tickIndex=e;var E=t.tick.break;if(E){var O=E.parsedBreak;P.break={start:O.vmin,end:O.vmax}}"category"===a.type&&(P.dataIndex=_),$u(D).eventData=P,E&&function(t,e,n,r){n.on("click",function(n){var i={type:WD,breaks:[{start:r.parsedBreak.breakOption.start,end:r.parsedBreak.breakOption.end}]};i[t.axis.dim+"AxisIndex"]=t.componentIndex,e.dispatchAction(i)})}(i,o,D,E)}g.push(D),l.add(D)});var _=V(g,function(t){return{label:t,priority:eL(t).labelInfo.tick.break?t.z2+(y-v+1):t.z2,defaultAttr:{ignore:t.ignore}}});vL(e,_,l,u)}(t,e,i,s,r,a);var l=e.labelLayoutList;!function(t,e,n,r){var i=e.get(["axisLabel","margin"]);B(n,function(n,o){var a=RC(n);if(a){var s=a.label,l=eL(s);a.suggestIgnore=s.ignore,s.ignore=!1,Ji(yL,_L);var u=e.axis;yL.x=u.dataToCoord(TT(u.scale,l.labelInfo.tick)),yL.y=t.labelOffset+t.labelDirection*i,yL.rotation=l.layoutRotation,r.add(yL),yL.updateTransform(),r.remove(yL),yL.decomposeTransform(),Ji(s,yL),s.markRedraw(),OC(a,!0),RC(a)}})}(t,r,l,o),function(t,e,n){var r=Of();if(!r)return;var i=r.retrieveAxisBreakPairs(n,function(t){return t&&eL(t.label).labelInfo.tick.break},!0),o=t.get(["breakLabelLayout","moveOverlap"],!0);!0!==o&&"auto"!==o||B(i,function(r){UD().adjustBreakLabelPair(t.axis.inverse,e,[RC(n[r[0]]),RC(n[r[1]])])})}(r,t.rotation,l);var u=t.optionHideOverlap;!function(t,e,n){var r=t.axis,i=t.get(["axisLabel","customValues"]);if(function(t){return"category"===t.type&&0===_T(t.getLabelModel())}(r))return;function o(t,o,a){var s=RC(e[o]),l=RC(e[a]),u=r.scale;if(s&&l){if(null==t){if(!n&&i)return;var h=eL(s.label).labelInfo.tick;if(NS(u)&&h.notNice||kS(u)&&h.offInterval)return void pL(s.label)}if(!1===t||s.suggestIgnore)pL(s.label);else if(l.suggestIgnore)pL(l.label);else{var c=.1;if(!n){var d=[0,0,0,0];s=VC({marginForce:d},s),l=VC({marginForce:d},l)}UC(s,l,null,{touchThreshold:c})&&pL(t?l.label:s.label)}}}var a=t.get(["axisLabel","showMinLabel"]),s=t.get(["axisLabel","showMaxLabel"]),l=e.length;o(a,0,1),o(s,l-1,l-2)}(r,l,u),u&&HC(G(l,function(t){return t&&!t.label.ignore})),function(t,e,n,r){var i,o=n.axis,a=e.ensureRecord(n),s=[],l=xL(t.axisName)&&xT(t.nameLocation);B(r,function(t){var e=RC(t);if(e&&!e.label.ignore){s.push(e);var n=a.transGroup;l&&(n.transform?Pe(iL,n.transform):Me(iL),e.transform&&Ie(iL,iL,e.transform),ln.copy(oL,e.localRect),oL.applyTransform(iL),i?i.union(oL):ln.copy(i=new ln(0,0,0,0),oL))}});var u=Math.abs(a.dirVec.x)>.1?"x":"y",h=a.transGroup[u];if(s.sort(function(t,e){return Math.abs(t.label[u]-h)-Math.abs(e.label[u]-h)}),l&&i){var c=o.getExtent(),d=Math.min(c[0],c[1]),p=Math.max(c[0],c[1])-d;i.union(new ln(d,0,p,1))}a.stOccupiedRect=i,a.labelInfoList=s}(t,n,r,l)}function pL(t){t&&(t.ignore=!0)}function fL(t,e,n,r,i){for(var o=[],a=[],s=[],l=0;l<t.length;l++){var u=t[l].coord;a[0]=u,a[1]=0,s[0]=u,s[1]=n,e&&(Xt(a,a,e),Xt(s,s,e));var h=new fd({shape:{x1:a[0],y1:a[1],x2:s[0],y2:s[1]},style:r,z2:2,autoBatch:!0,silent:!0});cp(h.shape,h.style.lineWidth),h.anid=i+"_"+t[l].tickValue,o.push(h);var c=nL(h);c.onBand=!!t[l].onBand,c.tickValue=t[l].tickValue}return o}function gL(t,e,n){if(mL(t)){var r=t.axisLabelsCreationContext;ht(t.labelGroup&&r);var i=r.out.noPxChangeTryDetermine;if(n.noPxChange){for(var o=!0,a=0;a<i.length;a++)o=o&&i[a]();if(o)return!1}i.length&&(e.remove(t.labelGroup),vL(t,null,null,null))}return!0}function mL(t){return!!t.labelLayoutList}function vL(t,e,n,r){t.labelLayoutList=e,t.labelGroup=n,t.axisLabelsCreationContext=r}var yL=new Ru,_L=new Ru;function xL(t){return!!t}var bL=uL;function wL(t,e,n){n=n||{};var r=e.axis,i={},o=r.getAxesOnZeroOf()[0],a=r.position,s=o?"onZero":a,l=r.dim,u=[t.x,t.x+t.width,t.y,t.y+t.height],h={left:0,right:1,top:0,bottom:1,onZero:2},c=e.get("offset")||0,d="x"===l?[u[2]-c,u[3]+c]:[u[0]-c,u[1]+c];if(o){var p=o.toGlobalCoord(o.dataToCoord(0));d[h.onZero]=Math.max(Math.min(p,d[1]),d[0])}i.position=["y"===l?d[h[s]]:u[0],"x"===l?d[h[s]]:u[3]],i.rotation=Math.PI/2*("x"===l?0:1);i.labelDirection=i.tickDirection=i.nameDirection={top:-1,bottom:1,left:-1,right:1}[a],i.labelOffset=o?d[h[a]]-d[h.onZero]:0,e.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),ot(n.labelInside,e.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var f=e.get(["axisLabel","rotate"]);return i.labelRotate="top"===s?-f:f,i.z2=1,i}function SL(){var t;t=TL,HT["liPosMinGap"]=t}function TL(t,e,n){var r,i=yt(),o=n.serUids,a=n.liPosMinGap,s=e.axis,l=s.scale,u=l.needTransform(),h=l.getFilter?l.getFilter():null,c=Jv(h);function d(n){zT(t,e.sers,function(t){var e=t.getRawData(),r=e.getDimensionIndex(e.mapDimension(s.dim));r>=0&&n(r,t,e.getStore())})}var p=0;if(d(function(t,e,n){i.set(e.uid,1),o&&o.hasKey(e.uid)||(r=!0),p+=n.count()}),o&&o.keys().length===i.keys().length||(r=!0),r||null==a){nD(ML,p);var f=0;d(function(t,e,n){for(var r=0,i=n.count();r<i;++r){var o=n.get(t,r);!isFinite(o)||h&&!Qv(c,o)||(u&&(o=l.transformIn(o,null)),ML.arr[f++]=o)}});var g=ML.typed?ML.arr.subarray(0,f):(ML.arr.length=f,ML.arr);ML.typed?g.sort():ra(g);for(var m=1/0,v=1;v<f;++v){var y=g[v]-g[v-1];y>0&&y<m&&(m=y)}n.liPosMinGap=e.liPosMinGap=Ta(m)?m:f>0?-2:-1,n.serUids=i}else e.liPosMinGap=a}var ML=nD({ctor:tD},50);function CL(t){return function(e,n){var r=$M(e,{fromStat:{key:t}});if(Ta(r.w2))return[-r.w2/2,r.w2/2]}}function IL(t){return t+DT}function AL(t,e){return t+DT+e}function DL(t){return SL(),{liPosMinGap:!kS(t.scale)}}var LL="bar",PL="pictorialBar";function EL(t,e,n,r){XT(t,{key:e,seriesType:n,coordSysType:r,getMetrics:DL})}function OL(t){var e=t.scale.rawExtentInfo.makeRenderInfo().startValue;return ht(Ta(e)),e}var NL={left:0,right:0,top:0,bottom:0},RL=["25%","25%"],kL="cartesian2d",zL=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.mergeDefaultAndTheme=function(e,n){var r=Kg(e.outerBounds);t.prototype.mergeDefaultAndTheme.apply(this,arguments),r&&e.outerBounds&&qg(e.outerBounds,r)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&e.outerBounds&&qg(this.option.outerBounds,e.outerBounds)},n.type="grid",n.dependencies=["xAxis","yAxis"],n.layoutMode="box",n.defaultOption={show:!1,z:0,left:"15%",top:65,right:"10%",bottom:80,containLabel:!1,outerBoundsMode:"auto",outerBounds:NL,outerBoundsContain:"all",outerBoundsClampWidth:RL[0],outerBoundsClampHeight:RL[1],backgroundColor:om.color.transparent,borderWidth:1,borderColor:om.color.neutral30},n}(tm),BL=ys(),VL="__ec_stack_";function FL(t){return t.get("stack")||VL+t.seriesIndex}function GL(t,e){var n=function(t,e){var n=AL(e,kL),r=[],i=$M(t,{fromStat:{key:n},min:1});return kT(t,n,function(t){r.push({barWidth:Qo(t.get("barWidth"),i.w),barMaxWidth:Qo(t.get("barMaxWidth"),i.w),barMinWidth:Qo(t.get("barMinWidth")||(XL(t)?.5:1),i.w),barGap:t.get("barGap"),barCategoryGap:t.get("barCategoryGap"),defaultBarGap:t.get("defaultBarGap"),stackId:FL(t)})}),{bandWidthResult:i,seriesInfo:r}}(t,e);return n.columnMap=HL(n),n}function HL(t){var e,n,r=t.bandWidthResult.w,i=r,o=0,a=[],s={};B(t.seriesInfo,function(t,r){r||(n=t.defaultBarGap||0);var l=t.stackId;wt(s,l)||o++;var u=s[l];u||(u=s[l]={width:0,maxWidth:0},a.push(l));var h=t.barWidth;h&&!u.width&&(u.width=h,h=Fo(i,h),i-=h);var c=t.barMaxWidth;c&&(u.maxWidth=c);var d=t.barMinWidth;d&&(u.minWidth=d);var p=t.barGap;null!=p&&(n=p);var f=t.barCategoryGap;null!=f&&(e=f)}),null==e&&(e=Go(35-4*a.length,15)+"%");var l=Qo(e,r),u=Qo(n,1),h=(i-l)/(o+(o-1)*u);h=Go(h,0),B(a,function(t){var e=s[t],n=e.maxWidth,r=e.minWidth;if(e.width){a=e.width;n&&(a=Fo(a,n)),r&&(a=Go(a,r)),e.width=a,i-=a+u*a,o--}else{var a=h;n&&n<a&&(a=Fo(n,i)),r&&r>a&&(a=r),a!==h&&(e.width=a,i-=a+u*a,o--)}}),h=Go(h=(i-l)/(o+(o-1)*u),0);var c,d=0;B(a,function(t){var e=s[t];e.width||(e.width=h),c=e,d+=e.width*(1+u)}),c&&(d-=c.width*u);var p={},f=-d/2;return B(a,function(t){var e=s[t];p[t]=p[t]||{bandWidth:r,offset:f,width:e.width},f+=e.width*(1+u)}),p}function UL(t){return{seriesType:t,overallReset:function(e){var n=AL(t,kL);BT(e,n,function(e){ht(e instanceof GD);var r=GL(e,t);kT(e,n,function(t){var e=r.columnMap[FL(t)];t.getData().setLayout({bandWidth:e.bandWidth,offset:e.offset,size:e.width})})})}}}function WL(t){return{seriesType:t,plan:$y(),reset:function(t){if(function(t){return t.coordinateSystem&&"cartesian2d"===t.coordinateSystem.type}(t)){var e=t.getData(),n=t.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),o=e.getDimensionIndex(e.mapDimension(i.dim)),a=e.getDimensionIndex(e.mapDimension(r.dim)),s=t.get("showBackground",!0),l=e.mapDimension(i.dim),u=e.getCalculationInfo("stackResultDimension"),h=pS(e,l)&&!!e.getCalculationInfo("stackedOnSeries"),c=i.isHorizontal(),d=i.toGlobalCoord(i.dataToCoord(OL(i))),p=XL(t),f=t.get("barMinHeight")||0,g=u&&e.getDimensionIndex(u),m=e.getLayout("size"),v=e.getLayout("offset");return{progress:function(t,e){for(var r,i=t.count,l=p&&eD(3*i),u=p&&s&&eD(3*i),y=p&&eD(i),_=n.master.getRect(),x=c?_.width:_.height,b=e.getStore(),w=0;null!=(r=t.next());){var S=b.get(h?g:o,r),T=b.get(a,r),M=d,C=void 0;h&&(C=+S-b.get(o,r));var I=void 0,A=void 0,D=void 0,L=void 0;if(c){var P=n.dataToPoint([S,T]);h&&(M=n.dataToPoint([C,T])[0]),I=M,A=P[1]+v,D=P[0]-M,L=m,Ho(D)<f&&(D=(D<0?-1:1)*f)}else{P=n.dataToPoint([T,S]);h&&(M=n.dataToPoint([T,C])[1]),I=P[0]+v,A=M,D=m,L=P[1]-M,Ho(L)<f&&(L=(L<=0?-1:1)*f)}p?(l[w]=I,l[w+1]=A,l[w+2]=c?D:L,u&&(u[w]=c?_.x:I,u[w+1]=c?A:_.y,u[w+2]=x),y[r]=r):e.setItemLayout(r,{x:I,y:A,width:D,height:L}),w+=3}p&&e.setLayout({largePoints:l,largeDataIndices:y,largeBackgroundPoints:u,valueAxisHorizontal:c})}}}}}}function XL(t){return t.pipelineContext&&t.pipelineContext.large}function jL(t){BL(t,function(){function e(e){var n=AL(e,kL);EL(t,n,e,kL),eM(n,function(t){return CL(AL(t,kL))}(e))}e("bar"),e("pictorialBar")})}var ZL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.getInitialData=function(t,e){return gS(null,this,{useEncodeDefaulter:!0})},n.prototype.getMarkerPosition=function(t,e,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(t),o=r.dataToPoint(i);if(n)B(r.getAxes(),function(t,n){if("category"===t.type&&null!=e){var r=t.getTicksCoords(),a=t.getTickModel().get("alignWithLabel"),s=i[n],l="x1"===e[n]||"y1"===e[n];if(l&&!a&&(s+=1),r.length<2)return;if(2===r.length)return void(o[n]=t.toGlobalCoord(t.getExtent()[l?1:0]));for(var u=void 0,h=void 0,c=1,d=0;d<r.length;d++){var p=r[d].coord,f=d===r.length-1?r[d-1].tickValue+c:r[d].tickValue;if(f===s){h=p;break}if(f<s)u=p;else if(null!=u&&f>s){h=(p+u)/2;break}1===d&&(c=f-r[0].tickValue)}null==h&&(u?u&&(h=r[r.length-1].coord):h=r[0].coord),o[n]=t.toGlobalCoord(h)}});else{var a=this.getData(),s=a.getLayout("offset"),l=a.getLayout("size"),u=r.getBaseAxis().isHorizontal()?0:1;o[u]+=s+l/2}return o}return[NaN,NaN]},n.prototype.__requireStartValue=function(t){return this.getBaseAxis()!==t},n.type="series.__base_bar__",n.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",defaultBarGap:"10%"},n}(Ky);Ky.registerClass(ZL);var YL=ZL,qL=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.getInitialData=function(){return gS(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},n.prototype.getProgressive=function(){return!!this.get("large")&&this.get("progressive")},n.prototype.__preparePipelineContext=function(t,e){var n=Ts(this,t,e);return n.progressiveRender&&(n.large=!0),n},n.prototype.brushSelector=function(t,e,n){return n.rect(e.getItemLayout(t))},n.type="series."+LL,n.dependencies=["grid","polar"],n.defaultOption=Sf(YL.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:om.color.primary,borderWidth:2}},realtimeSort:!1}),n}(YL),KL=qL,JL=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},QL=function(t){function n(e){var n=t.call(this,e)||this;return n.type="sausage",n}return e(n,t),n.prototype.getDefaultShape=function(){return new JL},n.prototype.buildPath=function(t,e){var n=e.cx,r=e.cy,i=Math.max(e.r0||0,0),o=Math.max(e.r,0),a=.5*(o-i),s=i+a,l=e.startAngle,u=e.endAngle,h=e.clockwise,c=2*Math.PI,d=h?u-l<c:l-u<c;d||(l=u-(h?c:-c));var p=Math.cos(l),f=Math.sin(l),g=Math.cos(u),m=Math.sin(u);d?(t.moveTo(p*i+n,f*i+r),t.arc(p*s+n,f*s+r,a,-Math.PI+l,l,!h)):t.moveTo(p*o+n,f*o+r),t.arc(n,r,o,l,u,!h),t.arc(g*s+n,m*s+r,a,u-2*Math.PI,u-Math.PI,!h),0!==i&&t.arc(n,r,i,u,l,h)},n}(xu),$L=QL;function tP(t,e,n){return e*Math.sin(t)*(n?-1:1)}function eP(t,e,n){return e*Math.cos(t)*(n?1:-1)}function nP(t,e,n){var r=t.get("borderRadius");if(null==r)return n?{cornerRadius:0}:null;j(r)||(r=[r,r,r,r]);var i=Math.abs(e.r||0-e.r0||0);return{cornerRadius:V(r,function(t){return ho(t,i)})}}var rP=Math.max,iP=Math.min,oP=function(t){function n(){var e=t.call(this)||this;return e.type=LL,e._isFirstFrame=!0,e}return e(n,t),n.prototype.render=function(t,e,n,r){this._model=t,this._removeOnRenderedListener(n),this._updateDrawMode(t);var i=t.get("coordinateSystem");"cartesian2d"===i||"polar"===i?(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(t,e,n):this._renderNormal(t,e,n,r)):Da("Only cartesian2d and polar supported for bar.")},n.prototype.incrementalPrepareRender=function(t){this._clear(),this._updateDrawMode(t),this._updateLargeClip(t)},n.prototype.incrementalRender=function(t,e){this._progressiveEls=[],this._incrementalRenderLarge(t,e)},n.prototype.eachRendered=function(t){Dp(this._progressiveEls||this.group,t)},n.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},n.prototype._renderNormal=function(t,e,n,r){var i,o=this.group,a=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis();"cartesian2d"===l.type?i=u.isHorizontal():"polar"===l.type&&(i="angle"===u.dim);var h=t.isAnimationEnabled()?t:null,c=function(t,e){var n=t.get("realtimeSort",!0),r=e.getBaseAxis();n&&("category"!==r.type&&Da("`realtimeSort` will not work because this bar series is not based on a category axis."),"cartesian2d"!==e.type&&Da("`realtimeSort` will not work because this bar series is not on cartesian2d."));if(n&&"category"===r.type&&"cartesian2d"===e.type)return{baseAxis:r,otherAxis:e.getOtherAxis(r)}}(t,l);c&&this._enableRealtimeSort(c,a,n);var d=t.get("clip",!0)||c,p=l.getArea();o.removeClipPath();var f=t.get("roundCap",!0),g=t.get("showBackground",!0),m=t.getModel("backgroundStyle"),v=m.get("borderRadius")||0,y=[],_=this._backgroundEls,x=r&&r.isInitSort,b=r&&"changeAxisOrder"===r.type;function w(t){var e=pP[l.type](a,t);if(!e)return null;var n=function(t,e,n){var r="polar"===t.type?td:Ru;return new r({shape:xP(e,n,t),silent:!0,z2:0})}(l,i,e);return n.useStyle(m.getItemStyle()),"cartesian2d"===l.type?n.setShape("r",v):n.setShape("cornerRadius",v),y[t]=n,n}a.diff(s).add(function(e){var n=a.getItemModel(e),r=pP[l.type](a,e,n);if(r&&(g&&w(e),a.hasValue(e)&&dP[l.type](r))){var s=!1;d&&(s=aP[l.type](p,r));var m=sP[l.type](t,a,e,r,i,h,u.model,!1,f);c&&(m.forceLabelAnimation=!0),gP(m,a,e,n,r,t,i,"polar"===l.type),x?m.attr({shape:r}):c?lP(c,h,m,r,e,i,!1,!1):jd(m,{shape:r},t,e),a.setItemGraphicEl(e,m),o.add(m),m.ignore=s}}).update(function(e,n){var r=a.getItemModel(e),S=pP[l.type](a,e,r);if(S){if(g){var T=void 0;0===_.length?T=w(n):((T=_[n]).useStyle(m.getItemStyle()),"cartesian2d"===l.type?T.setShape("r",v):T.setShape("cornerRadius",v),y[e]=T);var M=pP[l.type](a,e);Xd(T,{shape:xP(i,M,l)},h,e)}var C=s.getItemGraphicEl(n);if(a.hasValue(e)&&dP[l.type](S)){var I=!1;if(d&&(I=aP[l.type](p,S))&&o.remove(C),C&&("sector"===C.type&&f||"sausage"===C.type&&!f)&&(C&&Kd(C,t,n),C=null),C?Jd(C):C=sP[l.type](t,a,e,S,i,h,u.model,!0,f),c&&(C.forceLabelAnimation=!0),b){var A=C.getTextContent();if(A){var D=ef(A);null!=D.prevValue&&(D.prevValue=D.value)}}else gP(C,a,e,r,S,t,i,"polar"===l.type);x?C.attr({shape:S}):c?lP(c,h,C,S,e,i,!0,b):Xd(C,{shape:S},t,e,null),a.setItemGraphicEl(e,C),C.ignore=I,o.add(C)}else o.remove(C)}}).remove(function(e){var n=s.getItemGraphicEl(e);n&&Kd(n,t,e)}).execute();var S=this._backgroundGroup||(this._backgroundGroup=new Do);S.removeAll();for(var T=0;T<y.length;++T)S.add(y[T]);o.add(S),this._backgroundEls=y,this._data=a},n.prototype._renderLarge=function(t,e,n){this._clear(),yP(t,this.group),this._updateLargeClip(t)},n.prototype._incrementalRenderLarge=function(t,e){this._removeBackground(),yP(e,this.group,this._progressiveEls,!0)},n.prototype._updateLargeClip=function(t){var e=t.get("clip",!0)&&dD(t.coordinateSystem,!1,t),n=this.group;e?n.setClipPath(e):n.removeClipPath()},n.prototype._enableRealtimeSort=function(t,e,n){var r=this;if(e.count()){var i=t.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(e,t,n),this._isFirstFrame=!1;else{var o=function(t){var n=e.getItemGraphicEl(t),r=n&&n.shape;return r&&Math.abs(i.isHorizontal()?r.height:r.width)||0};this._onRendered=function(){r._updateSortWithinSameData(e,o,i,n)},n.getZr().on("rendered",this._onRendered)}}},n.prototype._dataSort=function(t,e,n){var r=[];return t.each(t.mapDimension(e.dim),function(t,e){var i=n(e);i=null==i?NaN:i,r.push({dataIndex:e,mappedValue:i,ordinalNumber:t})}),r.sort(function(t,e){return e.mappedValue-t.mappedValue}),{ordinalNumbers:V(r,function(t){return t.ordinalNumber})}},n.prototype._isOrderChangedWithinSameData=function(t,e,n){for(var r=n.scale,i=t.mapDimension(n.dim),o=Number.MAX_VALUE,a=0,s=r.getOrdinalMeta().categories.length;a<s;++a){var l=t.rawIndexOf(i,r.getRawOrdinalNumber(a)),u=l<0?Number.MIN_VALUE:e(t.indexOfRawIndex(l));if(u>o)return!0;o=u}return!1},n.prototype._isOrderDifferentInView=function(t,e){for(var n=e.scale,r=n.getExtent(),i=Math.max(0,r[0]),o=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=o;++i)if(t.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},n.prototype._updateSortWithinSameData=function(t,e,n,r){if(this._isOrderChangedWithinSameData(t,e,n)){var i=this._dataSort(t,n,e);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:i}))}},n.prototype._dispatchInitSort=function(t,e,n){var r=e.baseAxis,i=this._dataSort(t,r,function(n){return t.get(t.mapDimension(e.otherAxis.dim),n)});n.dispatchAction({type:"changeAxisOrder",componentType:r.dim+"Axis",isInitSort:!0,axisId:r.index,sortInfo:i})},n.prototype.remove=function(t,e){this._clear(this._model),this._removeOnRenderedListener(e)},n.prototype.dispose=function(t,e){this._removeOnRenderedListener(e)},n.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},n.prototype._clear=function(t){var e=this.group,n=this._data;t&&t.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(e){Kd(e,t,$u(e).dataIndex)})):e.removeAll(),this._data=null,this._isFirstFrame=!0},n.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},n.type=LL,n}(l_),aP={cartesian2d:function(t,e){var n=e.width<0?-1:1,r=e.height<0?-1:1;n<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height);var i=t.x+t.width,o=t.y+t.height,a=rP(e.x,t.x),s=iP(e.x+e.width,i),l=rP(e.y,t.y),u=iP(e.y+e.height,o),h=s<a,c=u<l;return e.x=h&&a>i?s:a,e.y=c&&l>o?u:l,e.width=h?0:s-a,e.height=c?0:u-l,n<0&&(e.x+=e.width,e.width=-e.width),r<0&&(e.y+=e.height,e.height=-e.height),h||c},polar:function(t,e){var n=e.r0<=e.r?1:-1;if(n<0){var r=e.r;e.r=e.r0,e.r0=r}var i=iP(e.r,t.r),o=rP(e.r0,t.r0);e.r=i,e.r0=o;var a=i-o<0;if(n<0){r=e.r;e.r=e.r0,e.r0=r}return a}},sP={cartesian2d:function(t,e,n,r,i,o,a,s,l){var u=new Ru({shape:L({},r),z2:1});(u.__dataIndex=n,u.name="item",o)&&(u.shape[i?"height":"width"]=0);return u},polar:function(t,e,n,r,i,o,a,s,l){var u=!i&&l?$L:td,h=new u({shape:r,z2:1});h.name="item";var c,d,p=fP(i);if(h.calculateTextPosition=(c=p,d=({isRoundCap:u===$L}||{}).isRoundCap,function(t,e,n){var r=e.position;if(!r||r instanceof Array)return co(t,e,n);var i=c(r),o=null!=e.distance?e.distance:5,a=this.shape,s=a.cx,l=a.cy,u=a.r,h=a.r0,p=(u+h)/2,f=a.startAngle,g=a.endAngle,m=(f+g)/2,v=d?Math.abs(u-h)/2:0,y=Math.cos,_=Math.sin,x=s+u*y(f),b=l+u*_(f),w="left",S="top";switch(i){case"startArc":x=s+(h-o)*y(m),b=l+(h-o)*_(m),w="center",S="top";break;case"insideStartArc":x=s+(h+o)*y(m),b=l+(h+o)*_(m),w="center",S="bottom";break;case"startAngle":x=s+p*y(f)+tP(f,o+v,!1),b=l+p*_(f)+eP(f,o+v,!1),w="right",S="middle";break;case"insideStartAngle":x=s+p*y(f)+tP(f,-o+v,!1),b=l+p*_(f)+eP(f,-o+v,!1),w="left",S="middle";break;case"middle":x=s+p*y(m),b=l+p*_(m),w="center",S="middle";break;case"endArc":x=s+(u+o)*y(m),b=l+(u+o)*_(m),w="center",S="bottom";break;case"insideEndArc":x=s+(u-o)*y(m),b=l+(u-o)*_(m),w="center",S="top";break;case"endAngle":x=s+p*y(g)+tP(g,o+v,!0),b=l+p*_(g)+eP(g,o+v,!0),w="left",S="middle";break;case"insideEndAngle":x=s+p*y(g)+tP(g,-o+v,!0),b=l+p*_(g)+eP(g,-o+v,!0),w="right",S="middle";break;default:return co(t,e,n)}return(t=t||{}).x=x,t.y=b,t.align=w,t.verticalAlign=S,t}),o){var f=i?"r":"endAngle",g={};h.shape[f]=i?r.r0:r.startAngle,g[f]=r[f],(s?Xd:jd)(h,{shape:g},o)}return h}};function lP(t,e,n,r,i,o,a,s){var l,u;o?(u={x:r.x,width:r.width},l={y:r.y,height:r.height}):(u={y:r.y,height:r.height},l={x:r.x,width:r.width}),s||(a?Xd:jd)(n,{shape:l},e,i,null),(a?Xd:jd)(n,{shape:u},e?t.baseAxis.model:null,i)}function uP(t,e){for(var n=0;n<e.length;n++)if(!isFinite(t[e[n]]))return!0;return!1}var hP=["x","y","width","height"],cP=["cx","cy","r","startAngle","endAngle"],dP={cartesian2d:function(t){return!uP(t,hP)},polar:function(t){return!uP(t,cP)}},pP={cartesian2d:function(t,e,n){var r=t.getItemLayout(e);if(!r)return null;var i=n?function(t,e){var n=t.get(["itemStyle","borderColor"]);if(!n||"none"===n)return 0;var r=t.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),o=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(r,i,o)}(n,r):0,o=r.width>0?1:-1,a=r.height>0?1:-1;return{x:r.x+o*i/2,y:r.y+a*i/2,width:r.width-o*i,height:r.height-a*i}},polar:function(t,e,n){var r=t.getItemLayout(e);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function fP(t){return function(t){var e=t?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}}(t)}function gP(t,e,n,r,i,o,a,s){var l=e.getItemVisual(n,"style");if(s){if(!o.get("roundCap")){var u=t.shape;L(u,nP(r.getModel("itemStyle"),u,!0)),t.setShape(u)}}else{var h=r.get(["itemStyle","borderRadius"])||0;t.setShape("r",h)}t.useStyle(l);var c=r.getShallow("cursor");c&&t.attr("cursor",c);var d=s?a?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":a?function(t,e){if(0===t.height){return e.getOtherAxis(e.getBaseAxis()).inverse?"bottom":"top"}return t.height>0?"bottom":"top"}(i,o.coordinateSystem):function(t,e){if(0===t.width){return e.getOtherAxis(e.getBaseAxis()).inverse?"left":"right"}return t.width>=0?"right":"left"}(i,o.coordinateSystem),p=Zp(r);jp(t,p,{labelFetcher:o,labelDataIndex:n,defaultText:VA(o.getData(),n),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var f=t.getTextContent();if(s&&f){var g=r.get(["label","position"]);t.textConfig.inside="middle"===g||null,function(t,e,n,r){if(K(r))t.setTextConfig({rotation:r});else if(j(e))t.setTextConfig({rotation:0});else{var i,o=t.shape,a=o.clockwise?o.startAngle:o.endAngle,s=o.clockwise?o.endAngle:o.startAngle,l=(a+s)/2,u=n(e);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":i=l;break;case"startAngle":case"insideStartAngle":i=a;break;case"endAngle":case"insideEndAngle":i=s;break;default:return void t.setTextConfig({rotation:0})}var h=1.5*Math.PI-i;"middle"===u&&h>Math.PI/2&&h<1.5*Math.PI&&(h-=Math.PI),t.setTextConfig({rotation:h})}}(t,"outside"===g?d:g,fP(a),r.get(["label","rotate"]))}nf(f,p,o.getRawValue(n),function(t){return FA(e,t)});var m=r.getModel(["emphasis"]);ic(t,m.get("focus"),m.get("blurScope"),m.get("disabled")),lc(t,r),function(t){return null!=t.startAngle&&null!=t.endAngle&&t.startAngle===t.endAngle}(i)&&(t.style.fill="none",t.style.stroke="none",B(t.states,function(t){t.style&&(t.style.fill=t.style.stroke="none")}))}var mP=function(){},vP=function(t){function n(e){var n=t.call(this,e)||this;return n.type="largeBar",n}return e(n,t),n.prototype.getDefaultShape=function(){return new mP},n.prototype.buildPath=function(t,e){for(var n=e.points,r=this.baseDimIdx,i=1-this.baseDimIdx,o=[],a=[],s=this.barWidth,l=0;l<n.length;l+=3)a[r]=s,a[i]=n[l+2],o[r]=n[l+r],o[i]=n[l+i],t.rect(o[0],o[1],a[0],a[1])},n}(xu);function yP(t,e,n,r){var i=t.getData(),o=i.getLayout("valueAxisHorizontal")?1:0,a=i.getLayout("largeDataIndices"),s=i.getLayout("size"),l=t.getModel("backgroundStyle"),u=i.getLayout("largeBackgroundPoints"),h=r?Ss(t):0;if(u){var c=new vP({shape:{points:u},incremental:h,silent:!0,z2:0});c.baseDimIdx=o,c.largeDataIndices=a,c.barWidth=s,c.useStyle(l.getItemStyle()),e.add(c),n&&n.push(c)}var d=new vP({shape:{points:i.getLayout("largePoints")},incremental:h,ignoreCoarsePointer:!0,z2:1});d.baseDimIdx=o,d.largeDataIndices=a,d.barWidth=s,e.add(d),d.useStyle(i.getVisual("style")),d.style.stroke=null,$u(d).seriesIndex=t.seriesIndex,t.get("silent")||(d.on("mousedown",_P),d.on("mousemove",_P)),n&&n.push(d)}var _P=d_(function(t){var e=function(t,e,n){for(var r=t.baseDimIdx,i=1-r,o=t.shape.points,a=t.largeDataIndices,s=[],l=[],u=t.barWidth,h=0,c=o.length/3;h<c;h++){var d=3*h;if(l[r]=u,l[i]=o[d+2],s[r]=o[d+r],s[i]=o[d+i],l[i]<0&&(s[i]+=l[i],l[i]=-l[i]),e>=s[0]&&e<=s[0]+l[0]&&n>=s[1]&&n<=s[1]+l[1])return a[h]}return-1}(this,t.offsetX,t.offsetY);$u(this).dataIndex=e>=0?e:null},30,!1);function xP(t,e,n){if(gD(n,"cartesian2d")){var r=e,i=n.getArea();return{x:t?r.x:i.x,y:t?i.y:r.y,width:t?r.width:i.width,height:t?i.height:r.height}}var o=e;return{cx:(i=n.getArea()).cx,cy:i.cy,r0:t?i.r0:o.r0,r:t?i.r:o.r,startAngle:t?o.startAngle:0,endAngle:t?o.endAngle:2*Math.PI}}var bP=oP;function wP(t){return{seriesType:t,reset:function(t,e){var n=e.findComponents({mainType:"legend"});if(n&&n.length){var r=t.getData();r.filterSelf(function(t){for(var e=r.getName(t),i=0;i<n.length;i++)if(!n[i].isSelected(e))return!1;return!0})}}}}function SP(t,e,n){e=j(e)&&{coordDimensions:e}||L({encodeDefine:t.getEncode()},e);var r=t.getSource(),i=sS(r,e).dimensions,o=new oS(i,t);return o.initData(r,n),o}var TP,MP=function(){function t(t,e){this._getDataWithEncodedVisual=t,this._getRawData=e}return t.prototype.getAllNames=function(){var t=this._getRawData();return t.mapArray(t.getName)},t.prototype.containName=function(t){return this._getRawData().indexOfName(t)>=0},t.prototype.indexOfName=function(t){return this._getDataWithEncodedVisual().indexOfName(t)},t.prototype.getItemVisual=function(t,e){return this._getDataWithEncodedVisual().getItemVisual(t,e)},t}(),CP=MP,IP="pie",AP=Qa(),DP=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new CP(W(this.getData,this),W(this.getRawData,this)),this._defaultLabelLine(e)},n.prototype.mergeOption=function(){t.prototype.mergeOption.apply(this,arguments)},n.prototype.getInitialData=function(){return SP(this,{coordDimensions:["value"],encodeDefaulter:X(mm,this)})},n.prototype.getDataParams=function(e){var n=this.getData(),r=AP(n),i=r.seats;if(!i){var o=[];n.each(n.mapDimension("value"),function(t){o.push(t)}),i=r.seats=sa(o,n.hostModel.get("percentPrecision"))}var a=t.prototype.getDataParams.call(this,e);return a.percent=i[e]||0,a.$vars.push("percent"),a},n.prototype._defaultLabelLine=function(t){Va(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},n.type="series."+IP,n.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"},n}(Ky);TP={fullType:DP.type,getCoord2:function(t){return t.getShallow("center")}},ht(!Lg.get(TP.fullType)),Lg.set(TP.fullType,{getCoord2:void 0}).getCoord2=TP.getCoord2;var LP=DP,PP=Math.PI/180;function EP(t,e,n,r,i,o,a,s,l,u){if(!(t.length<2)){for(var h=t.length,c=0;c<h;c++)if("outer"===t[c].position&&"labelLine"===t[c].labelAlignTo){var d=t[c].label.x-u;t[c].linePoints[1][0]+=d,t[c].label.x=u}GC(t,1,l,l+a)&&function(t){for(var o={list:[],maxY:0},a={list:[],maxY:0},s=0;s<t.length;s++)if("none"===t[s].labelAlignTo){var l=t[s],u=l.label.y>n?a:o,h=Math.abs(l.label.y-n);if(h>=u.maxY){var c=l.label.x-e-l.len2*i,d=r+l.len,f=Math.abs(c)<d?Math.sqrt(h*h/(1-c*c/d/d)):d;u.rB=f,u.maxY=h}u.list.push(l)}p(o),p(a)}(t)}function p(t){for(var o=t.rB,a=o*o,s=0;s<t.list.length;s++){var l=t.list[s],u=Math.abs(l.label.y-n),h=r+l.len,c=h*h,d=Math.sqrt(Math.abs((1-u*u/a)*c)),p=e+(d+l.len2)*i,f=p-l.label.x;OP(l,l.targetTextWidth-f*i,!0),l.label.x=p}}}function OP(t,e,n){if(null==t.labelStyleWidth){var r=t.label,i=r.style,o=t.rect,a=i.backgroundColor,s=i.padding,l=s?s[1]+s[3]:0,u=i.overflow,h=o.width+(a?0:l);if(e<h||n){if(u&&u.match("break")){r.setStyle("backgroundColor",null),r.setStyle("width",e-l);var c=r.getBoundingRect();r.setStyle("width",Math.ceil(c.width)),r.setStyle("backgroundColor",a)}else{var d=e-l,p=e<h?d:n?d>t.unconstrainedWidth?null:d:null;r.setStyle("width",p)}NP(o,r)}}}function NP(t,e){kP.rect=t,kC(kP,e,RP)}var RP={minMarginForce:[null,0,null,0],marginDefault:[1,0,1,0]},kP={};function zP(t){return"center"===t.position}function BP(t){var e,n,r=t.getData(),i=[],o=!1,a=(t.get("minShowLabelAngle")||0)*PP,s=r.getLayout("viewRect"),l=r.getLayout("r"),u=s.width,h=s.x,c=s.y,d=s.height;function p(t){t.ignore=!0}r.each(function(t){var s=r.getItemGraphicEl(t),c=s.shape,f=s.getTextContent(),g=s.getTextGuideLine(),m=r.getItemModel(t),v=m.getModel("label"),y=v.get("position")||m.get(["emphasis","label","position"]),_=v.get("distanceToLabelLine"),x=v.get("alignTo"),b=Qo(v.get("edgeDistance"),u),w=v.get("bleedMargin");null==w&&(w=Math.min(u,d)>200?10:2);var S=m.getModel("labelLine"),T=S.get("length");T=Qo(T,u);var M=S.get("length2");if(M=Qo(M,u),Math.abs(c.endAngle-c.startAngle)<a)return B(f.states,p),f.ignore=!0,void(g&&(B(g.states,p),g.ignore=!0));if(function(t){if(!t.ignore)return!0;for(var e in t.states)if(!1===t.states[e].ignore)return!0;return!1}(f)){var C,I,A,D,L=(c.startAngle+c.endAngle)/2,P=Math.cos(L),E=Math.sin(L);e=c.cx,n=c.cy;var O="inside"===y||"inner"===y;if("center"===y)C=c.cx,I=c.cy,D="center";else{var N=(O?(c.r+c.r0)/2*P:c.r*P)+e,R=(O?(c.r+c.r0)/2*E:c.r*E)+n;if(C=N+3*P,I=R+3*E,!O){var k=N+P*(T+l-c.r),z=R+E*(T+l-c.r),V=k+(P<0?-1:1)*M;C="edge"===x?P<0?h+b:h+u-b:V+(P<0?-_:_),I=z,A=[[N,R],[k,z],[V,z]]}D=O?"center":"edge"===x?P>0?"right":"left":P>0?"left":"right"}var F=Math.PI,G=0,H=v.get("rotate");if(K(H))G=H*(F/180);else if("center"===y)G=0;else if("radial"===H||!0===H){G=P<0?-L+F:-L}else if("tangential"===H||"tangential-noflip"===H&&"outside"!==y&&"outer"!==y){var U=Math.atan2(P,E);U<0&&(U=2*F+U),E>0&&"tangential-noflip"!==H&&(U=F+U),G=U-F}if(o=!!G,f.x=C,f.y=I,f.rotation=G,f.setStyle({verticalAlign:"middle"}),O){f.setStyle({align:D});var W=f.states.select;W&&(W.x+=f.x,W.y+=f.y)}else{var X=new ln(0,0,0,0);NP(X,f),i.push({label:f,labelLine:g,position:y,len:T,len2:M,minTurnAngle:S.get("minTurnAngle"),maxSurfaceAngle:S.get("maxSurfaceAngle"),surfaceNormal:new Re(P,E),linePoints:A,textAlign:D,labelDistance:_,labelAlignTo:x,edgeDistance:b,bleedMargin:w,rect:X,unconstrainedWidth:X.width,labelStyleWidth:f.style.width})}s.setTextConfig({inside:O})}}),!o&&t.get("avoidLabelOverlap")&&function(t,e,n,r,i,o,a,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0;d<t.length;d++){var p=t[d].label;zP(t[d])||(p.x<e?(h=Math.min(h,p.x),l.push(t[d])):(c=Math.max(c,p.x),u.push(t[d])))}for(d=0;d<t.length;d++)if(!zP(m=t[d])&&m.linePoints){if(null!=m.labelStyleWidth)continue;p=m.label;var f=m.linePoints,g=void 0;g="edge"===m.labelAlignTo?p.x<e?f[2][0]-m.labelDistance-a-m.edgeDistance:a+i-m.edgeDistance-f[2][0]-m.labelDistance:"labelLine"===m.labelAlignTo?p.x<e?h-a-m.bleedMargin:a+i-c-m.bleedMargin:p.x<e?p.x-a-m.bleedMargin:a+i-p.x-m.bleedMargin,m.targetTextWidth=g,OP(m,g,!1)}for(EP(u,e,n,r,1,0,o,0,s,c),EP(l,e,n,r,-1,0,o,0,s,h),d=0;d<t.length;d++){var m;if(!zP(m=t[d])&&m.linePoints){p=m.label,f=m.linePoints;var v="edge"===m.labelAlignTo,y=p.style.padding,_=y?y[1]+y[3]:0,x=p.style.backgroundColor?0:_,b=m.rect.width+x,w=f[1][0]-f[2][0];v?p.x<e?f[2][0]=a+m.edgeDistance+b+m.labelDistance:f[2][0]=a+i-m.edgeDistance-b-m.labelDistance:(p.x<e?f[2][0]=p.x+m.labelDistance:f[2][0]=p.x-m.labelDistance,f[1][0]=f[2][0]+w),f[1][1]=f[2][1]=p.y}}}(i,e,n,l,u,d,h,c);for(var f=0;f<i.length;f++){var g=i[f],m=g.label,v=g.labelLine,y=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:g.textAlign}),y&&(B(m.states,p),m.ignore=!0);var _=m.states.select;_&&(_.x+=m.x,_.y+=m.y)}if(v){var x=g.linePoints;y||!x?(B(v.states,p),v.ignore=!0):(CC(x,g.minTurnAngle),IC(x,g.surfaceNormal,g.maxSurfaceAngle),v.setShape({points:x}),m.__hostTarget.textGuideLineConfig={anchor:new Re(x[0][0],x[0][1])})}}}var VP=2*Math.PI,FP=Math.PI/180,GP=Cs(IP,function(t,e){t.eachSeriesByType(IP,function(t){var n=t.getData(),r=n.mapDimension("value"),i=Hg(t,e),o=i.cx,a=i.cy,s=i.r,l=i.r0,u=i.viewRect,h=-t.get("startAngle")*FP,c=t.get("endAngle"),d=t.get("padAngle")*FP;c="auto"===c?h-VP:-c*FP;var p=t.get("minAngle")*FP+d,f=0;n.each(r,function(t){!isNaN(t)&&f++});var g=n.getSum(r),m=Math.PI/(g||f)*2,v=t.get("clockwise"),y=t.get("roseType"),_=t.get("stillShowZeroSum"),x=n.getDataExtent(r);x[0]=0;var b=v?1:-1,w=[h,c],S=b*d/2;Kl(w,!v),h=w[0],c=w[1];var T=HP(t);T.startAngle=h,T.endAngle=c,T.clockwise=v,T.cx=o,T.cy=a,T.r=s,T.r0=l;var M=Math.abs(c-h),C=M,I=0,A=h;if(n.setLayout({viewRect:u,r:s}),n.each(r,function(t,e){var r;if(isNaN(t))n.setItemLayout(e,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:v,cx:o,cy:a,r0:l,r:y?NaN:s});else{(r="area"!==y?0===g&&_?m:t*m:M/f)<p?(r=p,C-=p):I+=t;var i=A+b*r,u=0,h=0;d>r?h=u=A+b*r/2:(u=A+S,h=i-S),n.setItemLayout(e,{angle:r,startAngle:u,endAngle:h,clockwise:v,cx:o,cy:a,r0:l,r:y?Jo(t,x,[l,s]):s}),A=i}}),C<VP&&f)if(C<=.001){var D=M/f;n.each(r,function(t,e){if(!isNaN(t)){var r=n.getItemLayout(e);r.angle=D;var i=0,o=0;D<d?o=i=h+b*(e+.5)*D:(i=h+b*e*D+S,o=h+b*(e+1)*D-S),r.startAngle=i,r.endAngle=o}})}else m=C/I,A=h,n.each(r,function(t,e){if(!isNaN(t)){var r=n.getItemLayout(e),i=r.angle===p?p:t*m,o=0,a=0;i<d?a=o=A+b*i/2:(o=A+S,a=A+b*i-S),r.startAngle=o,r.endAngle=a,A+=b*i}})})});var HP=Qa(),UP=function(t){function n(e,n,r){var i=t.call(this)||this;i.z2=2;var o=new Qu;return i.setTextContent(o),i.updateData(e,n,r,!0),i}return e(n,t),n.prototype.updateData=function(t,e,n,r){var i=this,o=t.hostModel,a=t.getItemModel(e),s=a.getModel("emphasis"),l=t.getItemLayout(e),u=L(nP(a.getModel("itemStyle"),l,!0),l);if(isNaN(u.startAngle))i.setShape(u);else{if(r){i.setShape(u);var h=o.getShallow("animationType");o.ecModel.ssr?(jd(i,{scaleX:0,scaleY:0},o,{dataIndex:e,isFrom:!0}),i.originX=u.cx,i.originY=u.cy):"scale"===h?(i.shape.r=l.r0,jd(i,{shape:{r:l.r}},o,e)):null!=n?(i.setShape({startAngle:n,endAngle:n}),jd(i,{shape:{startAngle:l.startAngle,endAngle:l.endAngle}},o,e)):(i.shape.endAngle=l.startAngle,Xd(i,{shape:{endAngle:l.endAngle}},o,e))}else Jd(i),Xd(i,{shape:u},o,e);i.useStyle(t.getItemVisual(e,"style")),lc(i,a);var c=(l.startAngle+l.endAngle)/2,d=o.get("selectedOffset"),p=Math.cos(c)*d,f=Math.sin(c)*d,g=a.getShallow("cursor");g&&i.attr("cursor",g),this._updateLabel(o,t,e),i.ensureState("emphasis").shape=L({r:l.r+(s.get("scale")&&s.get("scaleSize")||0)},nP(s.getModel("itemStyle"),l)),L(i.ensureState("select"),{x:p,y:f,shape:nP(a.getModel(["select","itemStyle"]),l)}),L(i.ensureState("blur"),{shape:nP(a.getModel(["blur","itemStyle"]),l)});var m=i.getTextGuideLine(),v=i.getTextContent();m&&L(m.ensureState("select"),{x:p,y:f}),L(v.ensureState("select"),{x:p,y:f}),ic(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))}},n.prototype._updateLabel=function(t,e,n){var r=this,i=e.getItemModel(n),o=i.getModel("labelLine"),a=e.getItemVisual(n,"style"),s=a&&a.fill,l=a&&a.opacity;jp(r,Zp(i),{labelFetcher:e.hostModel,labelDataIndex:n,inheritColor:s,defaultOpacity:l,defaultText:t.getFormattedLabel(n,"normal")||e.getName(n)});var u=r.getTextContent();r.setTextConfig({position:null,rotation:null}),u.attr({z2:10});var h=i.get(["label","position"]);if("outside"!==h&&"outer"!==h)r.removeTextGuideLine();else{var c=this.getTextGuideLine();c||(c=new hd,this.setTextGuideLine(c)),LC(this,PC(i),{stroke:s,opacity:st(o.get(["lineStyle","opacity"]),l,1)})}},n}(td),WP=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=IP,e.ignoreLabelLineUpdate=!0,e}return e(n,t),n.prototype.render=function(t,e,n,r){var i,o=t.getData(),a=this._data,s=this.group;if(!a&&o.count()>0){for(var l=o.getItemLayout(0),u=1;isNaN(l&&l.startAngle)&&u<o.count();++u)l=o.getItemLayout(u);l&&(i=l.startAngle)}if(this._emptyCircleSector&&s.remove(this._emptyCircleSector),0===o.count()&&t.get("showEmptyCircle")){var h=HP(t),c=new td({shape:I(h)});c.useStyle(t.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=c,s.add(c)}o.diff(a).add(function(t){var e=new UP(o,t,i);o.setItemGraphicEl(t,e),s.add(e)}).update(function(t,e){var n=a.getItemGraphicEl(e);n.updateData(o,t,i),n.off("click"),s.add(n),o.setItemGraphicEl(t,n)}).remove(function(e){Kd(a.getItemGraphicEl(e),t,e)}).execute(),BP(t),"expansion"!==t.get("animationTypeUpdate")&&(this._data=o)},n.prototype.dispose=function(){},n.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){var r=t[0]-n.cx,i=t[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},n.type=IP,n}(l_),XP=WP;var jP=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.getInitialData=function(t,e){return gS(null,this,{useEncodeDefaulter:!0})},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?5e3:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?1e4:this.get("progressiveThreshold"):t},n.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},n.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},n.type="series.scatter",n.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],n.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:om.color.primary}},universalTransition:{divideShape:"clone"}},n}(Ky),ZP=jP,YP=function(){},qP=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.getDefaultShape=function(){return new YP},n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.beforeBrush=function(t){t&&!t.contentRetained&&this.reset()},n.prototype.buildPath=function(t,e){var n,r=e.points,i=e.size,o=this.symbolProxy,a=o.shape,s=t.getContext?t.getContext():t,l=s&&i[0]<4,u=this.softClipShape;if(l)this._ctx=s;else{for(this._ctx=null,n=this._off;n<r.length;){var h=r[n++],c=r[n++];isNaN(h)||isNaN(c)||(u&&!u.contain(h,c)||(a.x=h-i[0]/2,a.y=c-i[1]/2,a.width=i[0],a.height=i[1],o.buildPath(t,a,!0)))}this.incremental&&(this._off=n,this.notClear=!0)}},n.prototype.afterBrush=function(){var t,e=this.shape,n=e.points,r=e.size,i=this._ctx,o=this.softClipShape;if(i){for(t=this._off;t<n.length;){var a=n[t++],s=n[t++];isNaN(a)||isNaN(s)||(o&&!o.contain(a,s)||i.fillRect(a-r[0]/2,s-r[1]/2,r[0],r[1]))}this.incremental&&(this._off=t,this.notClear=!0)}},n.prototype.findDataIndex=function(t,e){for(var n=this.shape,r=n.points,i=n.size,o=Math.max(i[0],4),a=Math.max(i[1],4),s=r.length/2-1;s>=0;s--){var l=2*s,u=r[l]-o/2,h=r[l+1]-a/2;if(t>=u&&e>=h&&t<=u+o&&e<=h+a)return s}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),r=this.getBoundingRect();return t=n[0],e=n[1],r.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape,n=e.points,r=e.size,i=r[0],o=r[1],a=1/0,s=1/0,l=-1/0,u=-1/0,h=0;h<n.length;){var c=n[h++],d=n[h++];a=Math.min(c,a),l=Math.max(c,l),s=Math.min(d,s),u=Math.max(d,u)}t=this._rect=new ln(a-i/2,s-o/2,l-a+i,u-s+o)}return t},n}(xu),KP=function(){function t(){this.group=new Do}return t.prototype.updateData=function(t,e){this._clear(),this._data=t;var n=this._create();n.setShape({points:t.getLayout("points")}),this._setCommon(n,t,e)},t.prototype.updateLayout=function(t){var e=this._data;if(e){var n=e.getLayout("points");this.group.eachChild(function(t){if(null!=t.startIndex){var e=2*(t.endIndex-t.startIndex),r=4*t.startIndex*2;n=new Float32Array(n.buffer,r,e)}t.setShape("points",n),t.reset(),t.stopAnimation()})}},t.prototype.incrementalPrepareUpdate=function(t){this._clear()},t.prototype.incrementalUpdate=function(t,e,n,r){var i=this._newAdded[0],o=e.getLayout("points"),a=i&&i.shape.points;if(Ms(e.getLayout("pointsRange"),t),a&&a.length<2e4){var s=a.length,l=new Float32Array(s+o.length);l.set(a),l.set(o,s),i.endIndex=t.end,i.setShape({points:l})}else{this._newAdded=[];var u=this._create();u.startIndex=t.start,u.endIndex=t.end,u.incremental=n,u.setShape({points:o}),this._setCommon(u,e,r)}},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new qP({cursor:"default"});return t.ignoreCoarsePointer=!0,this.group.add(t),this._newAdded.push(t),t},t.prototype._setCommon=function(t,e,n){var r=e.hostModel;n=n||{};var i=e.getVisual("symbolSize");t.setShape("size",i instanceof Array?i:[i,i]),t.softClipShape=n.clipShape||null,t.symbolProxy=Cx(e.getVisual("symbol"),0,0,0,0),t.setColor=t.symbolProxy.setColor;var o=t.shape.size[0]<4;t.useStyle(r.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var a=e.getVisual("style"),s=a&&a.fill;s&&t.setColor(s);var l=$u(t);l.seriesIndex=r.seriesIndex,t.on("mousemove",function(e){l.dataIndex=null;var n=t.hoverDataIdx;n>=0&&(l.dataIndex=n+(t.startIndex||0))})},t.prototype.remove=function(){this._clear()},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),JP=KP,QP=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var r=t.getData();this._updateSymbolDraw(r,t).updateData(r,$P(t)),this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var r=t.getData();this._updateSymbolDraw(r,t).incrementalPrepareUpdate(r),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._symbolDraw.incrementalUpdate(t,e.getData(),Ss(e),$P(e)),this._finished=t.end===e.getData().count()},n.prototype.updateTransform=function(t,e,n){var r=t.getData();if(this.group.dirty(),!this._finished)return{update:!0};var i=kD("").reset(t,e,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout($P(t))},n.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},n.prototype._updateSymbolDraw=function(t,e){var n=this._symbolDraw,r=e.pipelineContext.large;return n&&r===this._isLargeDraw||(n&&n.remove(),n=this._symbolDraw=r?new JP:new qA,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},n.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},n.prototype.dispose=function(){},n.type="scatter",n}(l_);function $P(t){return{clipShape:fD(t)}}var tE=QP,eE=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",ns).models[0]},n.type="cartesian2dAxis",n}(tm);k(eE,IT);var nE={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:om.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:om.color.axisLabel,textMargin:[0,3]},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:om.color.axisSplitLine,width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:[om.color.backgroundTint,om.color.backgroundTransparent]}},breakArea:{show:!0,itemStyle:{color:om.color.neutral00,borderColor:om.color.border,borderWidth:1,borderType:[3,3],opacity:.6},zigzagAmplitude:4,zigzagMinSpan:4,zigzagMaxSpan:20,zigzagZ:100,expandOnClick:!0},breakLabelLayout:{moveOverlap:"auto"}},rE=A({boundaryGap:!0,deduplication:null,jitter:0,jitterOverlap:!0,jitterMargin:2,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto",show:"auto"},axisLabel:{interval:"auto"}},nE),iE=A({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:om.color.axisMinorSplitLine,width:1}}},nE),oE={category:rE,value:iE,time:A({splitNumber:6,axisLabel:{rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},iE),log:E({logBase:10},iE)};function aE(t,n,r,i){B(hT,function(o,a){var s=A(A({},oE[a],!0),i,!0),l=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n+"Axis."+a,e}return e(r,t),r.prototype.mergeDefaultAndTheme=function(t,e){var n=Yg(this),r=n?Kg(t):{};A(t,e.getTheme().get(a+"Axis")),A(t,this.getDefaultOption()),t.type=sE(t),n&&qg(t,r,n)},r.prototype.optionUpdated=function(){"category"===this.option.type&&(this.__ordinalMeta=bS.createByAxisModel(this))},r.prototype.getCategories=function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},r.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},r.prototype.updateAxisBreaks=function(t){var e=UD();return e?e.updateModelAxisBreak(this,t):{breaks:[]}},r.type=n+"Axis."+a,r.defaultOption=s,r}(r);t.registerComponentModel(l)}),t.registerSubTypeDefaulter(n+"Axis",sE)}function sE(t){return t.type||(t.data?"category":"value")}var lE=function(){function t(t){this.type="cartesian",this._dimList=[],this._axes={},this.name=t||""}return t.prototype.getAxis=function(t){return this._axes[t]},t.prototype.getAxes=function(){return V(this._dimList,function(t){return this._axes[t]},this)},t.prototype.getAxesByScale=function(t){return t=t.toLowerCase(),G(this.getAxes(),function(e){return e.scale.type===t})},t.prototype.addAxis=function(t){var e=t.dim;this._axes[e]=t,this._dimList.push(e)},t}(),uE=["x","y"];function hE(t){return("interval"===t.type||"time"===t.type)&&!kf(t)}var cE=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=kL,e.dimensions=uE,e}return e(n,t),n.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,e=this.getAxis("y").scale;if(hE(t)&&hE(e)){var n=IS(t,null),r=IS(e,null),i=this.dataToPoint([n[0],r[0]]),o=this.dataToPoint([n[1],r[1]]),a=n[1]-n[0],s=r[1]-r[0];if(a&&s){var l=(o[0]-i[0])/a,u=(o[1]-i[1])/s,h=i[0]-n[0]*l,c=i[1]-r[0]*u,d=this._transform=[l,0,0,u,h,c];this._invTransform=Pe([],d)}}},n.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},n.prototype.containPoint=function(t){var e=this.getAxis("x"),n=this.getAxis("y");return e.contain(e.toLocalCoord(t[0]))&&n.contain(n.toLocalCoord(t[1]))},n.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},n.prototype.containZone=function(t,e){var n=this.dataToPoint(t),r=this.dataToPoint(e),i=this.getArea(),o=new ln(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(o)},n.prototype.dataToPoint=function(t,e,n){n=n||[];var r=t[0],i=t[1];if(this._transform&&null!=r&&isFinite(r)&&null!=i&&isFinite(i))return Xt(n,t,this._transform);var o=this.getAxis("x"),a=this.getAxis("y");return n[0]=o.toGlobalCoord(o.dataToCoord(r,e)),n[1]=a.toGlobalCoord(a.dataToCoord(i,e)),n},n.prototype.clampData=function(t,e){var n=this.getAxis("x").scale,r=this.getAxis("y").scale,i=n.getExtent(),o=r.getExtent(),a=n.parse(t[0]),s=r.parse(t[1]);return(e=e||[])[0]=Math.min(Math.max(Math.min(i[0],i[1]),a),Math.max(i[0],i[1])),e[1]=Math.min(Math.max(Math.min(o[0],o[1]),s),Math.max(o[0],o[1])),e},n.prototype.pointToData=function(t,e,n){if(n=n||[],this._invTransform)return Xt(n,t,this._invTransform);var r=this.getAxis("x"),i=this.getAxis("y");return n[0]=r.coordToData(r.toLocalCoord(t[0]),e),n[1]=i.coordToData(i.toLocalCoord(t[1]),e),n},n.prototype.getOtherAxis=function(t){return this.getAxis("x"===t.dim?"y":"x")},n.prototype.getArea=function(t){t=t||0;var e=this.getAxis("x").getGlobalExtent(),n=this.getAxis("y").getGlobalExtent(),r=Math.min(e[0],e[1])-t,i=Math.min(n[0],n[1])-t,o=Math.max(e[0],e[1])-r+t,a=Math.max(n[0],n[1])-i+t;return new ln(r,i,o,a)},n}(lE);function dE(t,e){var n=t.scale,r=t.model;ht(n&&r&&(n instanceof YS||n instanceof uT)&&(e instanceof YS||e instanceof uT));var i,o,a,s=rM(n,r,r.ecModel,t,null),l=RS(n),u=RS(e)?e.intervalStub:e,h=l?n.intervalStub:n,c=n.base,d=u.getTicks(),p=u.getTicks({expandToNicedExtent:!0}),f=d.length-1;if(ht(!kf(e)&&!kf(n)),ht(f>0),ht(p.length===d.length),ht(d[0].value<=d[f].value),ht(p[0].value<=d[0].value&&d[f].value<=p[f].value),f>=2&&(ht(p[1].value===d[1].value),ht(p[f-1].value===d[f-1].value)),1===f)i=o=0,a=1;else if(2===f){var g=Ho(d[0].value-d[1].value),m=Ho(d[1].value-d[2].value);i=o=0,g===m?a=2:(a=1,g<m?i=g/m:o=m/g)}else{var v=u.getConfig().interval;i=(1-(d[0].value-p[0].value)/v)%1,o=(1-(p[f].value-d[f].value)/v)%1,a=f-(i?1:0)-(o?1:0)}ht(a>=1);var y,_,x,b,w,S,T=s.zoomFixMM,M=T[0]||T[1],C=[s.fixMM[0]||M,s.fixMM[1]||M],I=n.getExtent(),A=h.getExtent(),D=GS(A,C);function L(t){for(var e=0;e<50&&!t();e++)x=l?x*Go(c,2):zS(x),b=BS(x);e>=50&&Da("incorrect impl in `scaleCalcAlign`.")}function P(){y=ea(S-x*i,b)}function E(){_=ea(w+x*o,b)}function O(){S=i?ea(y+x*i,b):y}function N(){w=o?ea(_-x*o,b):_}if(C[0]&&C[1]){y=D[0],_=D[1],x=(_-y)/(a+i+o);var R=t.getExtent(),k=Ho(R[1]-R[0]);b=aa([_,y],k,.5/a),O(),N(),Ta(b)&&(x=ea(x,b))}else{var z=D[1]-D[0];x=l?Go(fa(z),1):ma(z/a,2),b=BS(x),C[0]?(y=D[0],L(function(){if(O(),w=ea(S+x*a,b),E(),_>=D[1])return!0})):C[1]?(_=D[1],L(function(){if(N(),S=ea(w-x*a,b),P(),y<=D[0])return!0})):L(function(){S=ea(Xo(D[0]/x)*x,b),w=ea(Wo(D[1]/x)*x,b);var t=Uo((w-S)/x);if(t<=a){var e=a-t,n=void 0,r=s.incl0||l;if(r&&0===D[0])n=[0,e];else if(r&&0===D[1])n=[e,0];else{var i=Wo(e/2);n=e%2==0?[i,i]:y+_<D[0]+D[1]?[i,i+1]:[i+1,i]}if(S=ea(S-x*n[0],b),w=ea(w+x*n[1],b),P(),E(),y<=D[0]&&_>=D[1])return!0}})}ST(n,C,A,[y,_],I,{interval:x,intervalCount:a,intervalPrecision:b,niceExtent:[S,w]}),n.freeze()}var pE,fE=[[3,1],[0,2]],gE=function(){function t(t,e,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=uE,this._initCartesian(t,e,n),this.model=t}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(t,e){var n=this._axesMap;function r(t){for(var e=U(t),n=[],r=e.length-1;r>=0;r--){var i=t[+e[r]];i.__alignTo?n.push(i):aM(i)}B(n,function(t){var e,n;e=t,n=t.__alignTo,kf(e.scale)||kf(n.scale)||n.scale.getTicks().length<2?aM(t):dE(t,t.__alignTo.scale)})}B(this._axesList,function(t){$T(t,1);var e=t.scale;kS(e)&&e.setSortInfo(t.model.get("categorySortInfo"))}),r(n.x),r(n.y);var i={};B(n.x,function(t){mE(n,"y",t,i)}),B(n.y,function(t){mE(n,"x",t,i)}),this.resize(this.model,e)},t.prototype.resize=function(t,e,n){var r=jg(t,e),i=this._rect=Ug(t.getBoxLayoutParams(),r.refContainer),o=this._axesMap,a=this._coordsList,s=t.get("containLabel");if(_E(o,i),!n){var l=function(t,e,n,r,i){var o=new rL(SE);return B(n,function(n){return B(n,function(n){if(bT(n.model)){var a=!r;n.axisBuilder=function(t,e,n,r,i,o){for(var a=wL(t,n),s=!1,l=!1,u=0;u<e.length;u++)ES(e[u].getOtherAxis(n.axis).scale)&&(s=l=!0,"category"===n.axis.type&&n.axis.onBand&&(l=!1));return a.axisLineAutoShow=s,a.axisTickAutoShow=l,a.defaultNameMoveOverlap=o,new bL(n,r,a,i)}(t,e,n.model,i,o,a)}})}),o}(i,a,o,s,e),u=void 0;if(s)pE?(pE(this._axesList,i),_E(o,i)):(Aa("Specified `grid.containLabel` but no `use(LegacyGridContainLabel)`;use `grid.outerBounds` instead.",!0),u=bE(i.clone(),"axisLabel",null,i,o,l,r));else{var h=function(t,e,n){var r,i=t.get("outerBoundsMode",!0);"same"===i?r=e.clone():null==i||"auto"===i?r=Ug(t.get("outerBounds",!0)||NL,n.refContainer):"none"!==i&&La("Invalid grid["+t.componentIndex+"].outerBoundsMode.");var o,a=t.get("outerBoundsContain",!0);null==a||"auto"===a?o="all":N(["all","axisLabel"],a)<0?(La("Invalid grid["+t.componentIndex+"].outerBoundsContain."),o="all"):o=a;var s=[$o(at(t.get("outerBoundsClampWidth",!0),RL[0]),e.width),$o(at(t.get("outerBoundsClampHeight",!0),RL[1]),e.height)];return{outerBoundsRect:r,parsedOuterBoundsContain:o,outerBoundsClamp:s}}(t,i,r),c=h.outerBoundsRect,d=h.parsedOuterBoundsContain,p=h.outerBoundsClamp;c&&(u=bE(c,d,p,i,o,l,r))}wE(i,o,VM,null,u,r),B(this._coordsList,function(t){t.calcAffineTransform()})}},t.prototype.getAxis=function(t,e){var n=this._axesMap[t];if(null!=n)return n[e||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(t,e){if(null!=t&&null!=e){var n="x"+t+"y"+e;return this._coordsMap[n]}J(t)&&(e=t.yAxisIndex,t=t.xAxisIndex);for(var r=0,i=this._coordsList;r<i.length;r++)if(i[r].getAxis("x").index===t||i[r].getAxis("y").index===e)return i[r]},t.prototype.getCartesians=function(){return this._coordsList.slice()},t.prototype.convertToPixel=function(t,e,n){var r=this._findConvertTarget(e);return r.cartesian?r.cartesian.dataToPoint(n):r.axis?r.axis.toGlobalCoord(r.axis.dataToCoord(n)):null},t.prototype.convertFromPixel=function(t,e,n){var r=this._findConvertTarget(e);return r.cartesian?r.cartesian.pointToData(n):r.axis?r.axis.coordToData(r.axis.toLocalCoord(n)):null},t.prototype._findConvertTarget=function(t){var e,n,r=t.seriesModel,i=t.xAxisModel||r&&r.getReferringComponents("xAxis",ns).models[0],o=t.yAxisModel||r&&r.getReferringComponents("yAxis",ns).models[0],a=t.gridModel,s=this._coordsList;if(r)N(s,e=r.coordinateSystem)<0&&(e=null);else if(i&&o)e=this.getCartesian(i.componentIndex,o.componentIndex);else if(i)n=this.getAxis("x",i.componentIndex);else if(o)n=this.getAxis("y",o.componentIndex);else if(a){a.coordinateSystem===this&&(e=this._coordsList[0])}return{cartesian:e,axis:n}},t.prototype.containPoint=function(t){var e=this._coordsList[0];if(e)return e.containPoint(t)},t.prototype._initCartesian=function(t,e,n){var r=this,i=this,o={left:!1,right:!1,top:!1,bottom:!1},a={x:{},y:{}},s={x:0,y:0};if(e.eachComponent("xAxis",l("x"),this),e.eachComponent("yAxis",l("y"),this),!s.x||!s.y)return this._axesMap={},void(this._axesList=[]);function l(e){return function(n,r){if(function(t,e){return t.getCoordSysModel()===e}(n,t)){var l=n.get("position");"x"===e?"top"!==l&&"bottom"!==l&&(l=o.bottom?"top":"bottom"):"left"!==l&&"right"!==l&&(l=o.left?"right":"left"),o[l]=!0;var u=dT(n),h=new GD(e,pT(n,u,!0),[0,0],u,l);h.onBand=MT(h.scale,n),h.inverse=n.get("inverse"),n.axis=h,h.model=n,h.grid=i,h.index=r,i._axesList.push(h),a[e][r]=h,s[e]++}}}this._axesMap=a,B(a.x,function(e,n){B(a.y,function(i,o){var a="x"+n+"y"+o,s=new cE(a);s.master=r,s.model=t,r._coordsMap[a]=s,r._coordsList.push(s),s.addAxis(e),s.addAxis(i)})}),yE(a.x),yE(a.y)},t.prototype.getTooltipAxes=function(t){var e=[],n=[];return B(this.getCartesians(),function(r){var i=null!=t&&"auto"!==t?r.getAxis(t):r.getBaseAxis(),o=r.getOtherAxis(i);N(e,i)<0&&e.push(i),N(n,o)<0&&n.push(o)}),{baseAxes:e,otherAxes:n}},t.create=function(e,n){var r=[];return e.eachComponent("grid",function(i,o){var a=new t(i,e,n);a.name="grid_"+o,a.resize(i,n,!0),i.coordinateSystem=a,r.push(a),B(a._axesList,function(e){var n,r;n=e,r=t.dimIdxMap,QT(n).dimIdxInCoord=r.get(n.dim)})}),e.eachSeries(function(t){var e,n;Og({targetModel:t,coordSysType:kL,coordSysProvider:function(){var r=function(t){var e={xAxisModel:null,yAxisModel:null};return B(e,function(n,r){var i=r.replace(/Model$/,""),o=t.getReferringComponents(i,ns).models[0];if(!o)throw new Error(i+' "'+st(t.get(i+"Index"),t.get(i+"Id"),0)+'" not found');e[r]=o}),e}(t),i=r.xAxisModel,o=r.yAxisModel;e=i.axis,n=o.axis;var a=i.getCoordSysModel();if(!a)throw new Error('Grid "'+st(i.get("gridIndex"),i.get("gridId"),0)+'" not found');if(i.getCoordSysModel()!==o.getCoordSysModel())throw new Error("xAxis and yAxis must use the same grid");return a.coordinateSystem.getCartesian(i.componentIndex,o.componentIndex)}}),e&&n&&(UT(e,t,kL),UT(n,t,kL))},this),r},t.dimensions=uE,t.dimIdxMap=Uw(uE),t}();function mE(t,e,n,r){n.getAxesOnZeroOf=function(){return i?[i]:[]};var i,o=t[e],a=n.model,s=a.get(["axisLine","onZero"]),l=a.get(["axisLine","onZeroAxisIndex"]);if(s){if(null!=l)vE(s,o[l])&&(i=o[l]);else for(var u in o)if(wt(o,u)&&vE(s,o[u])&&!r[h(o[u])]){i=o[u];break}i&&(r[h(i)]=!0)}function h(t){return t.dim+"_"+t.index}}function vE(t,e){if(!e)return!1;var n=function(t,e,n){var r=n?IS(t,null):t.getExtentUnsafe(0,null),i=r[0],o=r[1];return ms(i,o)?i===e||o===e?gT:i<e&&o>e?fT:mT:mT}(e.scale,0,!1),r=e&&"category"!==e.type&&"time"!==e.type&&n!==mT;return r&&"auto"===t&&function(t){return cT(t).noOnMyZero}(e)&&(r=!1),r}function yE(t){for(var e,n=U(t),r=[],i=n.length-1;i>=0;i--){var o=t[+n[i]];ES(o.scale)&&null==wT(o.model,o.type,!0)&&(o.model.get("alignTicks")&&null==o.model.get("interval")?r.push(o):e=o)}e||(e=r.pop()),e&&B(r,function(t){t.__alignTo=e})}function _E(t,e){B(t.x,function(t){return xE(t,e.x,e.width)}),B(t.y,function(t){return xE(t,e.y,e.height)})}function xE(t,e,n){var r=[0,n],i=t.inverse?1:0;t.setExtent(r[i],r[1-i]),function(t,e){var n=t.getExtent(),r=n[0]+n[1];t.toGlobalCoord="x"===t.dim?function(t){return t+e}:function(t){return r-t+e},t.toLocalCoord="x"===t.dim?function(t){return t-e}:function(t){return r-t+e}}(t,e)}function bE(t,e,n,r,i,o,a){ht("all"===e||"axisLabel"===e),wE(r,i,BM,e,!1,a);var s=[0,0,0,0];u(0),u(1),h(r,0,NaN),h(r,1,NaN);var l=null==H(s,function(t){return t>0});return Tp(r,s,!0,!0,n),_E(i,r),l;function u(t){B(i[$d[t]],function(e){if(bT(e.model)){var n=o.ensureRecord(e.model),r=n.labelInfoList;if(r)for(var i=0;i<r.length;i++){var a=r[i],s=e.scale.normalize(TT(e.scale,eL(a.label).labelInfo.tick));s=1===t?1-s:s,h(a.rect,t,s),h(a.rect,1-t,NaN)}var l=n.nameLayout;if(l){s=xT(n.nameLocation)?.5:NaN;h(l.rect,t,s),h(l.rect,1-t,NaN)}}})}function h(e,n,r){var i=t[$d[n]]-e[$d[n]],o=e[tp[n]]+e[$d[n]]-(t[tp[n]]+t[$d[n]]);i=c(i,1-r),o=c(o,r);var a=fE[n][0],l=fE[n][1];s[a]=Go(s[a],i),s[l]=Go(s[l],o)}function c(t,e){return t>0&&!it(e)&&e>1e-4&&(t/=e),t}}function wE(t,e,n,r,i,o){var a=n===VM;B(e,function(e){return B(e,function(e){bT(e.model)&&(!function(t,e,n){var r=wL(e,n),i=t.__getRawCfg();B(U(r),function(t){"position"!==t&&"labelOffset"!==t&&ht(r[t]===i[t])}),t.updateCfg(r)}(e.axisBuilder,t,e.model),e.axisBuilder.build(a?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};function l(e){s[$d[1-e]]=t[tp[e]]<=.5*o.refContainer[tp[e]]?0:1-e==1?2:1}l(0),l(1),B(e,function(t,e){return B(t,function(t){bT(t.model)&&(("all"===r||a)&&t.axisBuilder.build({axisName:!0},{nameMarginLevel:s[e]}),a&&t.axisBuilder.build({axisLine:!0}))})})}var SE=function(t,e,n,r,i,o){var a="x"===n.axis.dim?"y":"x";aL(t,0,0,r,i,o),xT(t.nameLocation)||B(e.recordMap[a],function(t){t&&t.labelInfoList&&t.dirVec&&lL(t.labelInfoList,t.dirVec,r,i)})},TE=gE;function ME(t,e){var n={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(t,e,n){var r=e.getComponent("tooltip"),i=e.getComponent("axisPointer"),o=i.get("link",!0)||[],a=[];B(n.getCoordinateSystems(),function(n){if(n.axisPointerEnabled){var s=DE(n.model),l=t.coordSysAxesInfo[s]={};t.coordSysMap[s]=n;var u=n.model.getModel("tooltip",r);if(B(n.getAxes(),X(p,!1,null)),n.getTooltipAxes&&r&&u.get("show")){var h="axis"===u.get("trigger"),c="cross"===u.get(["axisPointer","type"]),d=n.getTooltipAxes(u.get(["axisPointer","axis"]));(h||c)&&B(d.baseAxes,X(p,!c||"cross",h)),c&&B(d.otherAxes,X(p,"cross",!1))}}function p(r,s,h){var c=h.model.getModel("axisPointer",i),d=c.get("show");if(d&&("auto"!==d||r||AE(c))){null==s&&(s=c.get("triggerTooltip")),c=r?function(t,e,n,r,i,o){var a=e.getModel("axisPointer"),s={};B(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(t){s[t]=I(a.get(t))}),s.snap="category"!==t.type&&!!o,"cross"===a.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===i){var u=a.get(["label","show"]);if(l.show=null==u||u,!o){var h=s.lineStyle=a.get("crossStyle");h&&E(l,h.textStyle)}}return t.model.getModel("axisPointer",new xf(s,n,r))}(h,u,i,e,r,s):c;var p=c.get("snap"),f=c.get("triggerEmphasis"),g=DE(h.model),m=s||p||"category"===h.type,v=t.axesInfo[g]={key:g,axis:h,coordSys:n,axisPointerModel:c,triggerTooltip:s,triggerEmphasis:f,involveSeries:m,snap:p,useHandle:AE(c),seriesModels:[],linkGroup:null};l[g]=v,t.seriesInvolved=t.seriesInvolved||m;var y=function(t,e){for(var n=e.model,r=e.dim,i=0;i<t.length;i++){var o=t[i]||{};if(CE(o[r+"AxisId"],n.id)||CE(o[r+"AxisIndex"],n.componentIndex)||CE(o[r+"AxisName"],n.name))return i}}(o,h);if(null!=y){var _=a[y]||(a[y]={axesInfo:{}});_.axesInfo[g]=v,_.mapper=o[y].mapper,v.linkGroup=_}}}})}(n,t,e),n.seriesInvolved&&function(t,e){e.eachSeries(function(e){var n=e.coordinateSystem,r=e.get(["tooltip","trigger"],!0),i=e.get(["tooltip","show"],!0);n&&n.model&&"none"!==r&&!1!==r&&"item"!==r&&!1!==i&&!1!==e.get(["axisPointer","show"],!0)&&B(t.coordSysAxesInfo[DE(n.model)],function(t){var r=t.axis;n.getAxis(r.dim)===r&&(t.seriesModels.push(e),null==t.seriesDataCount&&(t.seriesDataCount=0),t.seriesDataCount+=e.getData().count())})})}(n,t),n}function CE(t,e){return"all"===t||j(t)&&N(t,e)>=0||t===e}function IE(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[DE(t)]}function AE(t){return!!t.get(["handle","show"])}function DE(t){return t.type+"||"+t.id}var LE={},PE=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(e,n,r,i){this.axisPointerClass&&function(t){var e=IE(t);if(e){var n=e.axisPointerModel,r=e.axis.scale,i=n.option,o=n.get("status"),a=n.get("value");null!=a&&(a=r.parse(a));var s=AE(n);null==o&&(i.status=s?"show":"hide");var l=r.getExtent();(null==a||a>l[1])&&(a=l[1]),a<l[0]&&(a=l[0]),i.value=a,s&&(i.status=e.axis.scale.isBlank()?"hide":"show")}}(e),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(e,r,!0)},n.prototype.updateAxisPointer=function(t,e,n,r){this._doUpdateAxisPointerClass(t,n,!1)},n.prototype.remove=function(t,e){var n=this._axisPointer;n&&n.remove(e)},n.prototype.dispose=function(e,n){this._disposeAxisPointer(n),t.prototype.dispose.apply(this,arguments)},n.prototype._doUpdateAxisPointerClass=function(t,e,r){var i=n.getAxisPointerClass(this.axisPointerClass);if(i){var o=function(t){var e=IE(t);return e&&e.axisPointerModel}(t);o?(this._axisPointer||(this._axisPointer=new i)).render(t,o,e,r):this._disposeAxisPointer(e)}},n.prototype._disposeAxisPointer=function(t){this._axisPointer&&this._axisPointer.dispose(t),this._axisPointer=null},n.registerAxisPointerClass=function(t,e){if(LE[t])throw new Error("axisPointer "+t+" exists");LE[t]=e},n.getAxisPointerClass=function(t){return t&&LE[t]},n.type="axis",n}(Qy),EE=PE,OE=Qa();function NE(t,e,n,r){var i=n.axis;if(!i.scale.isBlank()){var o=n.getModel("splitArea"),a=o.getModel("areaStyle"),s=a.get("color"),l=r.coordinateSystem.getRect(),u=i.getTicksCoords({tickModel:o,breakTicks:"none",pruneByBreak:"preserve_extent_bound"});if(u.length){var h=s.length,c=OE(t).splitAreaColors,d=yt(),p=0;if(c)for(var f=0;f<u.length;f++){var g=c.get(u[f].tickValue);if(null!=g){p=(g+(h-1)*f)%h;break}}var m=i.toGlobalCoord(u[0].coord),v=a.getAreaStyle();s=j(s)?s:[s];for(f=1;f<u.length;f++){var y=i.toGlobalCoord(u[f].coord),_=void 0,x=void 0,b=void 0,w=void 0;i.isHorizontal()?(_=m,x=l.y,b=y-_,w=l.height,m=_+b):(_=l.x,x=m,b=l.width,m=x+(w=y-x));var S=u[f-1].tickValue;null!=S&&d.set(S,p),e.add(new Ru({anid:null!=S?"area_"+S:null,shape:{x:_,y:x,width:b,height:w},style:E({fill:s[p]},v),autoBatch:!0,silent:!0})),p=(p+1)%h}OE(t).splitAreaColors=d}}}function RE(t){OE(t).splitAreaColors=null}var kE=["splitArea","splitLine","minorSplitLine","breakArea"],zE=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.axisPointerClass="CartesianAxisPointer",e}return e(n,t),n.prototype.render=function(e,n,r,i){this.group.removeAll();var o=this._axisGroup;(this._axisGroup=new Do,this.group.add(this._axisGroup),bT(e))&&(this._axisGroup.add(e.axis.axisBuilder.group),B(kE,function(t){e.get([t,"show"])&&BE[t](this,this._axisGroup,e,e.getCoordSysModel(),r)},this),i&&"changeAxisOrder"===i.type&&i.isInitSort||vp(o,this._axisGroup,e),t.prototype.render.call(this,e,n,r,i))},n.prototype.remove=function(){RE(this)},n.type="cartesianAxis",n}(EE),BE={splitLine:function(t,e,n,r,i){var o=n.axis;if(!o.scale.isBlank()){var a=n.getModel("splitLine"),s=a.getModel("lineStyle"),l=s.get("color"),u=!1!==a.get("showMinLine"),h=!1!==a.get("showMaxLine");l=j(l)?l:[l];for(var c=r.coordinateSystem.getRect(),d=o.isHorizontal(),p=0,f=o.getTicksCoords({tickModel:a,breakTicks:"none",pruneByBreak:"preserve_extent_bound"}),g=[],m=[],v=s.getLineStyle(),y=0;y<f.length;y++){var _=o.toGlobalCoord(f[y].coord);if((0!==y||u)&&(y!==f.length-1||h)){var x=f[y].tickValue;d?(g[0]=_,g[1]=c.y,m[0]=_,m[1]=c.y+c.height):(g[0]=c.x,g[1]=_,m[0]=c.x+c.width,m[1]=_);var b=p++%l.length,w=new fd({anid:null!=x?"line_"+x:null,autoBatch:!0,shape:{x1:g[0],y1:g[1],x2:m[0],y2:m[1]},style:E({stroke:l[b]},v),silent:!0});cp(w.shape,v.lineWidth),e.add(w)}}}},minorSplitLine:function(t,e,n,r,i){var o=n.axis,a=n.getModel("minorSplitLine").getModel("lineStyle"),s=r.coordinateSystem.getRect(),l=o.isHorizontal(),u=o.getMinorTicksCoords();if(u.length)for(var h=[],c=[],d=a.getLineStyle(),p=0;p<u.length;p++)for(var f=0;f<u[p].length;f++){var g=o.toGlobalCoord(u[p][f].coord);l?(h[0]=g,h[1]=s.y,c[0]=g,c[1]=s.y+s.height):(h[0]=s.x,h[1]=g,c[0]=s.x+s.width,c[1]=g);var m=new fd({anid:"minor_line_"+u[p][f].tickValue,autoBatch:!0,shape:{x1:h[0],y1:h[1],x2:c[0],y2:c[1]},style:d,silent:!0});cp(m.shape,d.lineWidth),e.add(m)}},splitArea:function(t,e,n,r,i){NE(t,e,n,r)},breakArea:function(t,e,n,r,i){var o=UD(),a=n.axis.scale;o&&"ordinal"!==a.type&&o.rectCoordBuildBreakAxis(e,t,n,r.coordinateSystem.getRect(),i)}},VE=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="xAxis",n}(zE),FE=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=VE.type,e}return e(n,t),n.type="yAxis",n}(zE),GE=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="grid",e}return e(n,t),n.prototype.render=function(t,e){this.group.removeAll(),t.get("show")&&this.group.add(new Ru({shape:t.coordinateSystem.getRect(),style:E({fill:t.get("backgroundColor")},t.getItemStyle()),silent:!0,z2:-1}))},n.type="grid",n}(Qy),HE={offset:0};function UE(t){t.registerComponentView(GE),t.registerComponentModel(zL),t.registerCoordinateSystem("cartesian2d",TE),aE(t,"x",eE,HE),aE(t,"y",eE,HE),t.registerComponentView(VE),t.registerComponentView(FE),t.registerPreprocessor(function(t){t.xAxis&&t.yAxis&&!t.grid&&(t.grid={})})}var WE="single",XE="singleAxis",jE=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.getCoordSysModel=function(){return this},n.type=XE,n.layoutMode="box",n.defaultOption={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}},jitter:0,jitterOverlap:!0,jitterMargin:2},n}(tm);k(jE,IT.prototype);var ZE=jE;var YE=Qa();function qE(t,e,n,r){if(t instanceof GD&&"ordinal"!==t.scale.type)return n;var i=t.model,o=i.get("jitter");if(!(o>0))return n;var a=i.get("jitterOverlap"),s=i.get("jitterMargin")||0,l=kS(t.scale)?$M(t).w:null;return a?KE(n,o,l,r):function(t,e,n,r,i,o){var a=YE(t);a.items||(a.items=[]);var s=a.items,l=JE(s,e,n,r,i,o,1),u=JE(s,e,n,r,i,o,-1),h=Math.abs(l-n)<Math.abs(u-n)?l:u,c=kS(t.scale)?$M(t).w:null,d=Math.abs(h-n);if(d>i/2||c&&d>c/2-r)return KE(n,i,c,r);return s.push({fixedCoord:e,floatCoord:h,r:r}),h}(t,e,n,r,o,s)}function KE(t,e,n,r){if(null===n)return t+(Math.random()-.5)*e;var i=n-2*r,o=Math.min(Math.max(0,e),i);return t+(Math.random()-.5)*o}function JE(t,e,n,r,i,o,a){for(var s=n,l=0;l<t.length;l++){var u=t[l],h=e-u.fixedCoord,c=s-u.floatCoord,d=h*h+c*c,p=r+u.r+o;if(d<p*p){var f=u.floatCoord+Math.sqrt(p*p-h*h)*a;if(Math.abs(f-n)>i/2)return Number.MAX_VALUE;if(1===a&&f>s||-1===a&&f<s){s=f,l=-1;continue}}}return s}function QE(){return{seriesType:"scatter",plan:$y(),reset:function(t){var e=t.coordinateSystem;if(e&&(e.type===kL||e.type===WE)){var n=e.getBaseAxis&&e.getBaseAxis(),r=n&&function(t,e){var n=t.coordinateSystem,r=n&&n.type,i=n&&n.getBaseAxis&&n.getBaseAxis(),o=i&&i.scale&&i.scale.type,a=r===kL&&"ordinal"===o||r===WE,s=e.model.get("jitter")>0;return a&&s}(t,n);if(r){var i=n.dim,o=n.orient,a="horizontal"===o&&"category"!==n.type||"vertical"===o&&"category"===n.type,s="y"===i||"single"===i&&a,l="x"===i||"single"===i&&!a;if(s||l)return{progress:function(t,e){var r=e.getLayout("points"),i=!!r;i&&Ms(e.getLayout("pointsRange"),t);for(var o=t.start;o<t.end;o++){var a=i?2*(o-t.start):-1,u=i?[r[a],r[a+1]]:e.getItemLayout(o);if(u){var h=e.getItemVisual(o,"symbolSize"),c=h instanceof Array?(h[1]+h[0])/2:h;if(s){var d=qE(n,u[0],u[1],c/2);i?r[a+1]=d:u[1]=d}else if(l){d=qE(n,u[1],u[0],c/2);i?r[a]=d:u[0]=d}}}}}}}}}}function $E(t){var e=t.polar;if(e){j(e)||(e=[e]);var n=[];B(e,function(e,r){e.indicator?(e.type&&!e.shape&&(e.shape=e.type),t.radar=t.radar||[],j(t.radar)||(t.radar=[t.radar]),t.radar.push(e)):n.push(e)}),t.polar=n}B(t.series,function(t){t&&"radar"===t.type&&t.polarIndex&&(t.radarIndex=t.polarIndex)})}var tO="radar",eO=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new CP(W(this.getData,this),W(this.getRawData,this))},n.prototype.getInitialData=function(t,e){return SP(this,{generateCoord:"indicator_",generateCoordCount:1/0})},n.prototype.formatTooltip=function(t,e,n){var r=this.getData(),i=this.coordinateSystem.getIndicatorAxes(),o=this.getData().getName(t),a=""===o?this.name:o,s=Ry(this,t);return Cy("section",{header:a,sortBlocks:!0,blocks:V(i,function(e){var n=r.get(r.mapDimension(e.dim),t);return Cy("nameValue",{markerType:"subItem",markerColor:s,name:e.name,value:n,sortParam:n})})})},n.prototype.getTooltipPosition=function(t){if(null!=t)for(var e=this.getData(),n=this.coordinateSystem,r=e.getValues(V(n.dimensions,function(t){return e.mapDimension(t)}),t),i=0,o=r.length;i<o;i++)if(!isNaN(r[i])){var a=n.getIndicatorAxes();return n.coordToPoint(a[i].dataToCoord(r[i]),i)}},n.type="series."+tO,n.dependencies=["radar"],n.defaultOption={z:2,colorBy:"data",coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid",join:"round"},label:{position:"top"},symbolSize:8},n}(Ky),nO=eO,rO=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=tO,e}return e(n,t),n.prototype.render=function(t,e,n){var r=t.coordinateSystem,i=this.group,o=t.getData(),a=this._data;function s(t,e){var n=t.getItemVisual(e,"symbol")||"circle";if("none"!==n){var r=Ix(t.getItemVisual(e,"symbolSize")),i=Cx(n,-1,-1,2,2),o=t.getItemVisual(e,"symbolRotate")||0;return i.attr({style:{strokeNoScale:!0},z2:100,scaleX:r[0]/2,scaleY:r[1]/2,rotation:o*Math.PI/180||0}),i}}function l(e,n,r,i,o,a){r.removeAll();for(var l=0;l<n.length-1;l++){var u=s(i,o);u&&(u.__dimIdx=l,e[l]?(u.setPosition(e[l]),Hp[a?"initProps":"updateProps"](u,{x:n[l][0],y:n[l][1]},t,o)):u.setPosition(n[l]),r.add(u))}}function u(t){return V(t,function(t){return[r.cx,r.cy]})}o.diff(a).add(function(e){var n=o.getItemLayout(e);if(n){var r=new sd,i=new hd,a={shape:{points:n}};r.shape.points=u(n),i.shape.points=u(n),jd(r,a,t,e),jd(i,a,t,e);var s=new Do,h=new Do;s.add(i),s.add(r),s.add(h),l(i.shape.points,n,h,o,e,!0),o.setItemGraphicEl(e,s)}}).update(function(e,n){var r=a.getItemGraphicEl(n),i=r.childAt(0),s=r.childAt(1),u=r.childAt(2),h={shape:{points:o.getItemLayout(e)}};h.shape.points&&(l(i.shape.points,h.shape.points,u,o,e,!1),Jd(s),Jd(i),Xd(i,h,t),Xd(s,h,t),o.setItemGraphicEl(e,r))}).remove(function(t){i.remove(a.getItemGraphicEl(t))}).execute(),o.eachItemGraphicEl(function(t,e){var n=o.getItemModel(e),r=t.childAt(0),a=t.childAt(1),s=t.childAt(2),l=o.getItemVisual(e,"style"),u=l.fill;i.add(t),r.useStyle(E(n.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:u})),lc(r,n,"lineStyle"),lc(a,n,"areaStyle");var h=n.getModel("areaStyle"),c=h.isEmpty()&&h.parentModel.isEmpty();a.ignore=c,B(["emphasis","select","blur"],function(t){var e=n.getModel([t,"areaStyle"]),i=e.isEmpty()&&e.parentModel.isEmpty();a.ensureState(t).ignore=i&&c;var o=n.getModel([t,"lineStyle"]).getLineStyle();r.ensureState(t).style=o;var l=e.getAreaStyle();a.ensureState(t).style=l;var u=n.getModel([t,"itemStyle"]).getItemStyle();s.eachChild(function(e){e.ensureState(t).style=I(u)})}),a.useStyle(E(n.getModel("areaStyle").getAreaStyle(),{fill:u,opacity:.7,decal:l.decal}));var d=n.getModel("emphasis");s.eachChild(function(t){if(t instanceof Iu){var r=t.style;t.useStyle(L({image:r.image,x:r.x,y:r.y,width:r.width,height:r.height},l))}else t.useStyle(l),t.setColor(u),t.style.strokeNoScale=!0;var i=o.getStore().get(o.getDimensionIndex(t.__dimIdx),e);(null==i||isNaN(i))&&(i=""),jp(t,Zp(n),{labelFetcher:o.hostModel,labelDataIndex:e,labelDimIndex:t.__dimIdx,defaultText:i,inheritColor:u,defaultOpacity:l.opacity})}),ic(t,d.get("focus"),d.get("blurScope"),d.get("disabled"))}),this._data=o},n.prototype.remove=function(){this.group.removeAll(),this._data=null},n.type=tO,n}(l_),iO=rO,oO=oE.value,aO="radar",sO=aO,lO=aO;function uO(t,e){return E({show:e},t)}var hO=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.optionUpdated=function(){var t=this.get("boundaryGap"),e=this.get("splitNumber"),n=this.get("clockwise"),r=this.get("scale"),i=this.get("axisLine"),o=this.get("axisTick"),a=this.get("axisLabel"),s=this.get("axisName"),l=this.get(["axisName","show"]),u=this.get(["axisName","formatter"]),h=this.get("axisNameGap"),c=this.get("triggerEvent"),d=V(this.get("indicator")||[],function(d){null!=d.max&&d.max>0&&!d.min?d.min=0:null!=d.min&&d.min<0&&!d.max&&(d.max=0);var p=s;null!=d.color&&(p=E({color:d.color},s));var f=A(I(d),{boundaryGap:t,splitNumber:e,clockwise:n,scale:r,axisLine:i,axisTick:o,axisLabel:a,name:d.text,showName:l,nameLocation:"end",nameGap:h,nameTextStyle:p,triggerEvent:c},!1);if(Y(u)){var g=f.name;f.name=u.replace("{value}",null!=g?g:"")}else Z(u)&&(f.name=u(f.name,f));var m=new xf(f,null,this.ecModel);return k(m,IT.prototype),m.mainType="radar",m.componentIndex=this.componentIndex,m.uid=wf("ec_radar"),m},this);this._indicatorModels=d},n.prototype.getIndicatorModels=function(){return this._indicatorModels},n.type=sO,n.defaultOption={z:0,center:["50%","50%"],radius:"50%",startAngle:90,clockwise:!1,axisName:{show:!0,color:om.color.axisLabel},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:A({lineStyle:{color:om.color.neutral20}},oO.axisLine),axisLabel:uO(oO.axisLabel,!1),axisTick:uO(oO.axisTick,!1),splitLine:uO(oO.splitLine,!0),splitArea:uO(oO.splitArea,!0),indicator:[]},n}(tm),cO=hO,dO=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){this.group.removeAll(),this._buildAxes(t,n),this._buildSplitLineAndArea(t)},n.prototype._buildAxes=function(t,e){var n=t.coordinateSystem;B(V(n.getIndicatorAxes(),function(t){var r=t.model.get("showName")?t.name:"";return new bL(t.model,e,{axisName:r,position:[n.cx,n.cy],rotation:t.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(t){t.build(),this.group.add(t.group)},this)},n.prototype._buildSplitLineAndArea=function(t){var e=t.coordinateSystem,n=e.getIndicatorAxes();if(n.length){var r=t.get("shape"),i=t.getModel("splitLine"),o=t.getModel("splitArea"),a=i.getModel("lineStyle"),s=o.getModel("areaStyle"),l=i.get("show"),u=o.get("show"),h=a.get("color"),c=s.get("color"),d=j(h)?h:[h],p=j(c)?c:[c],f=[],g=[];if("circle"===r)for(var m=n[0].getTicksCoords(),v=e.cx,y=e.cy,_=0;_<m.length;_++){if(l)f[I(f,d,_)].push(new Rc({shape:{cx:v,cy:y,r:m[_].coord}}));if(u&&_<m.length-1)g[I(g,p,_)].push(new rd({shape:{cx:v,cy:y,r0:m[_].coord,r:m[_+1].coord}}))}else{var x,b=V(n,function(t,n){var r=t.getTicksCoords();return x=null==x?r.length-1:Math.min(r.length-1,x),V(r,function(t){return e.coordToPoint(t.coord,n)})}),w=[];for(_=0;_<=x;_++){for(var S=[],T=0;T<n.length;T++)S.push(b[T][_]);if(S[0]?S.push(S[0].slice()):console.error("Can't draw value axis "+_),l)f[I(f,d,_)].push(new hd({shape:{points:S}}));if(u&&w)g[I(g,p,_-1)].push(new sd({shape:{points:S.concat(w)}}));w=S.slice().reverse()}}var M=a.getLineStyle(),C=s.getAreaStyle();B(g,function(t,e){this.group.add(up(t,{style:E({stroke:"none",fill:p[e%p.length]},C),silent:!0}))},this),B(f,function(t,e){this.group.add(up(t,{style:E({fill:"none",stroke:d[e%d.length]},M),silent:!0}))},this)}function I(t,e,n){var r=n%e.length;return t[r]=t[r]||[],r}},n.type="radar",n}(Qy),pO=dO,fO=function(t){function n(e,n,r){var i=t.call(this,e,n,r)||this;return i.type="value",i.angle=0,i.name="",i}return e(n,t),n}(rC),gO=fO,mO=function(){function t(t,e,n){this.type=aO,this.dimensions=[],this._model=t,this._indicatorAxes=V(t.getIndicatorModels(),function(t,e){var n="indicator_"+e,r=new gO(n,new YS);return r.name=t.get("name"),r.model=t,t.axis=r,this.dimensions.push(n),r},this),this.resize(t,n)}return t.prototype.getIndicatorAxes=function(){return this._indicatorAxes},t.prototype.dataToPoint=function(t,e){var n=this._indicatorAxes[e];return this.coordToPoint(n.dataToCoord(t),e)},t.prototype.coordToPoint=function(t,e){var n=this._indicatorAxes[e].angle;return[this.cx+t*Math.cos(n),this.cy-t*Math.sin(n)]},t.prototype.pointToData=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,r=Math.sqrt(e*e+n*n);e/=r,n/=r;for(var i,o=Math.atan2(-n,e),a=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],h=Math.abs(o-u.angle);h<a&&(i=u,s=l,a=h)}return[s,+(i&&i.coordToData(r))]},t.prototype.resize=function(t,e){var n=jg(t,e).refContainer,r=t.get("center"),i=t.get("clockwise")||!1,o=Math.min(n.width,n.height)/2;this.cx=Qo(r[0],n.width)+n.x,this.cy=Qo(r[1],n.height)+n.y,this.startAngle=t.get("startAngle")*Math.PI/180;var a=t.get("radius");(Y(a)||K(a))&&(a=[0,a]),this.r0=Qo(a[0],o),this.r=Qo(a[1],o);var s=i?-1:1;B(this._indicatorAxes,function(t,e){t.setExtent(this.r0,this.r);var n=this.startAngle+s*e*Math.PI*2/this._indicatorAxes.length;n=Math.atan2(Math.sin(n),Math.cos(n)),t.angle=n},this)},t.prototype.update=function(t,e){var n=this._indicatorAxes,r=HS(this._model.get("splitNumber"),5),i=new YS;i.setExtent(0,r),i.setConfig({interval:1}),B(n,function(t){$T(t,1),dE(t,i)})},t.prototype.convertToPixel=function(t,e,n){return console.warn("Not implemented."),null},t.prototype.convertFromPixel=function(t,e,n){return console.warn("Not implemented."),null},t.prototype.containPoint=function(t){return console.warn("Not implemented."),!1},t.create=function(e,n){var r=[];return e.eachComponent(sO,function(i){var o=new t(i,e,n);r.push(o),i.coordinateSystem=o}),e.eachSeriesByType(lO,function(t){if(t.get("coordinateSystem")===aO){var e=t.coordinateSystem=r[t.get("radarIndex")||0];e&&B(e.getIndicatorAxes(),function(e){UT(e,t,aO)})}}),r},t.dimensions=[],t}(),vO=mO;function yO(t){t.registerCoordinateSystem("radar",vO),t.registerComponentModel(cO),t.registerComponentView(pO),t.registerVisual({seriesType:"radar",reset:function(t){var e=t.getData();e.each(function(t){e.setItemVisual(t,"legendIcon","roundRect")}),e.setVisual("legendIcon","roundRect")}})}var _O=Cs(tO,function(t){t.eachSeriesByType(tO,function(t){var e=t.getData(),n=[],r=t.coordinateSystem;if(r){var i=r.getIndicatorAxes();B(i,function(t,o){e.each(e.mapDimension(i[o].dim),function(t,e){n[e]=n[e]||[];var i=r.dataToPoint(t,o);n[e][o]=xO(i)?i:bO(r)})}),e.each(function(t){var i=H(n[t],function(t){return xO(t)})||bO(r);n[t].push(i.slice()),e.setItemLayout(t,n[t])})}})});function xO(t){return!isNaN(t[0])&&!isNaN(t[1])}function bO(t){return[t.cx,t.cy]}var wO=Qa();function SO(t,e){return!!wO(t)[e]}gw({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},St);var TO={axisPointer:1,tooltip:1,brush:1};function MO(t,e,n){var r=e.getComponentByElement(t.topTarget);if(!r||r===n||TO.hasOwnProperty(r.mainType))return!1;var i=r.coordinateSystem;if(!i||i.model===n)return!1;var o=Np(r),a=Np(n);return!((o.zlevel-a.zlevel||o.z-a.z)<=0)}var CO=function(t){function n(e){var n=t.call(this)||this;n._zr=e;var r=W(n._mousedownHandler,n),i=W(n._mousemoveHandler,n),o=W(n._mouseupHandler,n),a=W(n._mousewheelHandler,n),s=W(n._pinchHandler,n);return n.enable=function(t,n){var l=n.zInfo,u=Np(l.component),h=u.z,c=u.zlevel,d={component:l.component,z:h,zlevel:c,z2:at(l.z2,-1/0)},p=L({},n.triggerInfo);this._opt=E(L({},n),{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0,zInfoParsed:d,triggerInfo:p,cursorGrab:"grab",cursorGrabbing:"grabbing"}),null==t&&(t=!0),this._enabled&&this._controlType===t||(this.disable(),this._enabled=!0,!0!==t&&"move"!==t&&"pan"!==t||(LO(e,"mousedown",r,d),LO(e,"mousemove",i,d),LO(e,"mouseup",o,d)),!0!==t&&"scale"!==t&&"zoom"!==t||(LO(e,"mousewheel",a,d),LO(e,"pinch",s,d)))},n.disable=function(){this._enabled&&(this._enabled=!1,PO(e,"mousedown",r),PO(e,"mousemove",i),PO(e,"mouseup",o),PO(e,"mousewheel",a),PO(e,"pinch",s))},n}return e(n,t),n.prototype.isDragging=function(){return this._dragging},n.prototype.isPinching=function(){return this._pinching},n.prototype._checkPointer=function(t,e,n){var r=this._opt,i=r.zInfoParsed;if(MO(t,r.api,i.component))return!1;var o=r.triggerInfo,a=!1;return"global"===o.roamTrigger&&(a=!0),a||(a=o.isInSelf(t,e,n)),a&&o.isInClip&&!o.isInClip(t,e,n)&&(a=!1),a},n.prototype._decideCursorStyle=function(t,e,n,r){var i=t.target;return!i&&this._checkPointer(t,e,n)?this._opt.cursorGrab:r?i&&i.cursor||"default":void 0},n.prototype.dispose=function(){this.disable()},n.prototype._mousedownHandler=function(t){if(!xe(t)&&!IO(t)){for(var e=t.target;e;){if(e.draggable)return;e=e.__hostTarget||e.parent}var n=t.offsetX,r=t.offsetY;this._checkPointer(t,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},n.prototype._mousemoveHandler=function(t){var e=this._zr;if("pinch"!==t.gestureEvent&&!SO(e,"globalPan")&&!IO(t)){var n=t.offsetX,r=t.offsetY;if(this._dragging&&NO("moveOnMouseMove",t,this._opt)){e.setCursorStyle(this._opt.cursorGrabbing);var i=this._x,o=this._y,a=n-i,s=r-o;this._x=n,this._y=r,this._opt.preventDefaultMouseMove&&_e(t.event),t.__ecRoamConsumed=!0,OO(this,"pan","moveOnMouseMove",t,{dx:a,dy:s,oldX:i,oldY:o,newX:n,newY:r,isAvailableBehavior:null})}else{var l=this._decideCursorStyle(t,n,r,!1);l&&e.setCursorStyle(l)}}},n.prototype._mouseupHandler=function(t){if(!IO(t)){var e=this._zr;if(!xe(t)){this._dragging=!1;var n=this._decideCursorStyle(t,t.offsetX,t.offsetY,!0);n&&e.setCursorStyle(n)}}},n.prototype._mousewheelHandler=function(t){if(!IO(t)){var e=NO("zoomOnMouseWheel",t,this._opt),n=NO("moveOnMouseWheel",t,this._opt),r=t.wheelDelta,i=Math.abs(r),o=t.offsetX,a=t.offsetY;if(0!==r&&(e||n)){if(e){var s=i>3?1.4:i>1?1.2:1.1,l=r>0?s:1/s;this._checkTriggerMoveZoom(this,"zoom","zoomOnMouseWheel",t,{scale:l,originX:o,originY:a,isAvailableBehavior:null})}if(n){var u=Math.abs(r),h=(r>0?1:-1)*(u>3?.4:u>1?.15:.05);this._checkTriggerMoveZoom(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:h,originX:o,originY:a,isAvailableBehavior:null})}}}},n.prototype._pinchHandler=function(t){if(!SO(this._zr,"globalPan")&&!IO(t)){var e=t.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,"zoom",null,t,{scale:e,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},n.prototype._checkTriggerMoveZoom=function(t,e,n,r,i){t._checkPointer(r,i.originX,i.originY)&&(_e(r.event),r.__ecRoamConsumed=!0,OO(t,e,n,r,i))},n}($t);function IO(t){return t.__ecRoamConsumed}var AO=Qa();function DO(t){var e=AO(t);return e.roam=e.roam||{},e.uniform=e.uniform||{},e}function LO(t,e,n,r){for(var i=DO(t).roam,o=i[e]=i[e]||[],a=0;a<o.length;a++){var s=o[a].zInfoParsed;if((s.zlevel-r.zlevel||s.z-r.z||s.z2-r.z2)<=0)break}o.splice(a,0,{listener:n,zInfoParsed:r}),function(t,e){var n=DO(t);n.uniform[e]||t.on(e,n.uniform[e]=function(t){var r=n.roam[e];if(r)for(var i=0;i<r.length;i++)r[i].listener(t)})}(t,e)}function PO(t,e,n){for(var r=DO(t).roam[e]||[],i=0;i<r.length;i++)if(r[i].listener===n)return r.splice(i,1),void(r.length||EO(t,e))}function EO(t,e){var n=DO(t).uniform;n[e]&&(t.off(e,n[e]),n[e]=null)}function OO(t,e,n,r,i){i.isAvailableBehavior=W(NO,null,n,r),t.trigger(e,i)}function NO(t,e,n){var r=n[t];return!t||r&&(!Y(r)||e.event[r+"Key"])}var RO,kO=CO;function zO(t){Y(t)&&(t=(new DOMParser).parseFromString(t,"text/xml"));var e=t;for(9===e.nodeType&&(e=e.firstChild);"svg"!==e.nodeName.toLowerCase()||1!==e.nodeType;)e=e.nextSibling;return e}var BO={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},VO=U(BO),FO={"alignment-baseline":"textBaseline","stop-color":"stopColor"},GO=U(FO),HO=function(){function t(){this._defs={},this._root=null}return t.prototype.parse=function(t,e){e=e||{};var n=zO(t);if(!n)throw new Error("Illegal svg");this._defsUsePending=[];var r=new Do;this._root=r;var i=[],o=n.getAttribute("viewBox")||"",a=parseFloat(n.getAttribute("width")||e.width),s=parseFloat(n.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(s)&&(s=null),YO(n,r,null,!0,!1);for(var l,u,h=n.firstChild;h;)this._parseNode(h,r,i,null,!1,!1),h=h.nextSibling;if(function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r[0].style[r[1]]=t[r[2]]}}(this._defs,this._defsUsePending),this._defsUsePending=[],o){var c=QO(o);c.length>=4&&(l={x:parseFloat(c[0]||0),y:parseFloat(c[1]||0),width:parseFloat(c[2]),height:parseFloat(c[3])})}if(l&&null!=a&&null!=s&&(u=rN(l,{x:0,y:0,width:a,height:s}),!e.ignoreViewBox)){var d=r;(r=new Do).add(d),d.scaleX=d.scaleY=u.scale,d.x=u.x,d.y=u.y}return e.ignoreRootClip||null==a||null==s||r.setClipPath(new Ru({shape:{x:0,y:0,width:a,height:s}})),{root:r,width:a,height:s,viewBoxRect:l,viewBoxTransform:u,named:i}},t.prototype._parseNode=function(t,e,n,r,i,o){var a,s=t.nodeName.toLowerCase(),l=r;if("defs"===s&&(i=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=e;else{if(!i){var u=RO[s];if(u&&wt(RO,s)){a=u.call(this,t,e);var h=t.getAttribute("name");if(h){var c={name:h,namedFrom:null,svgNodeTagLower:s,el:a};n.push(c),"g"===s&&(l=c)}else r&&n.push({name:r.name,namedFrom:r,svgNodeTagLower:s,el:a});e.add(a)}}var d=UO[s];if(d&&wt(UO,s)){var p=d.call(this,t),f=t.getAttribute("id");f&&(this._defs[f]=p)}}if(a&&a.isGroup)for(var g=t.firstChild;g;)1===g.nodeType?this._parseNode(g,a,n,l,i,o):3===g.nodeType&&o&&this._parseText(g,a),g=g.nextSibling},t.prototype._parseText=function(t,e){var n=new Su({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});jO(e,n),YO(t,n,this._defsUsePending,!1,!1),function(t,e){var n=e.__selfStyle;if(n){var r=n.textBaseline,i=r;r&&"auto"!==r?"baseline"===r?i="alphabetic":"before-edge"===r||"text-before-edge"===r?i="top":"after-edge"===r||"text-after-edge"===r?i="bottom":"central"!==r&&"mathematical"!==r||(i="middle"):i="alphabetic",t.style.textBaseline=i}var o=e.__inheritedStyle;if(o){var a=o.textAlign,s=a;a&&("middle"===a&&(s="center"),t.style.textAlign=s)}}(n,e);var r=n.style,i=r.fontSize;i&&i<9&&(r.fontSize=9,n.scaleX*=i/9,n.scaleY*=i/9);var o=(r.fontSize||r.fontFamily)&&[r.fontStyle,r.fontWeight,(r.fontSize||12)+"px",r.fontFamily||"sans-serif"].join(" ");r.font=o;var a=n.getBoundingRect();return this._textX+=a.width,e.add(n),n},t.internalField=void(RO={g:function(t,e){var n=new Do;return jO(e,n),YO(t,n,this._defsUsePending,!1,!1),n},rect:function(t,e){var n=new Ru;return jO(e,n),YO(t,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(t,e){var n=new Rc;return jO(e,n),YO(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),n.silent=!0,n},line:function(t,e){var n=new fd;return jO(e,n),YO(t,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(t,e){var n=new Bc;return jO(e,n),YO(t,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(t,e){var n,r=t.getAttribute("points");r&&(n=ZO(r));var i=new sd({shape:{points:n||[]},silent:!0});return jO(e,i),YO(t,i,this._defsUsePending,!1,!1),i},polyline:function(t,e){var n,r=t.getAttribute("points");r&&(n=ZO(r));var i=new hd({shape:{points:n||[]},silent:!0});return jO(e,i),YO(t,i,this._defsUsePending,!1,!1),i},image:function(t,e){var n=new Iu;return jO(e,n),YO(t,n,this._defsUsePending,!1,!1),n.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),n.silent=!0,n},text:function(t,e){var n=t.getAttribute("x")||"0",r=t.getAttribute("y")||"0",i=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(i),this._textY=parseFloat(r)+parseFloat(o);var a=new Do;return jO(e,a),YO(t,a,this._defsUsePending,!1,!0),a},tspan:function(t,e){var n=t.getAttribute("x"),r=t.getAttribute("y");null!=n&&(this._textX=parseFloat(n)),null!=r&&(this._textY=parseFloat(r));var i=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0",a=new Do;return jO(e,a),YO(t,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(i),this._textY+=parseFloat(o),a},path:function(t,e){var n=Pc(t.getAttribute("d")||"");return jO(e,n),YO(t,n,this._defsUsePending,!1,!1),n.silent=!0,n}}),t}(),UO={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),n=parseInt(t.getAttribute("y1")||"0",10),r=parseInt(t.getAttribute("x2")||"10",10),i=parseInt(t.getAttribute("y2")||"0",10),o=new Id(e,n,r,i);return WO(t,o),XO(t,o),o},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),n=parseInt(t.getAttribute("cy")||"0",10),r=parseInt(t.getAttribute("r")||"0",10),i=new Ad(e,n,r);return WO(t,i),XO(t,i),i}};function WO(t,e){"userSpaceOnUse"===t.getAttribute("gradientUnits")&&(e.global=!0)}function XO(t,e){for(var n=t.firstChild;n;){if(1===n.nodeType&&"stop"===n.nodeName.toLocaleLowerCase()){var r=n.getAttribute("offset"),i=void 0;i=r&&r.indexOf("%")>0?parseInt(r,10)/100:r?parseFloat(r):0;var o={};nN(n,o,o);var a=o.stopColor||n.getAttribute("stop-color")||"#000000",s=o.stopOpacity||n.getAttribute("stop-opacity");if(s){var l=Sr(a);l&&l[3]&&(l[3]*=gr(s),a=Er(l,"rgba"))}e.colorStops.push({offset:i,color:a})}n=n.nextSibling}}function jO(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),E(e.__inheritedStyle,t.__inheritedStyle))}function ZO(t){for(var e=QO(t),n=[],r=0;r<e.length;r+=2){var i=parseFloat(e[r]),o=parseFloat(e[r+1]);n.push([i,o])}return n}function YO(t,e,n,r,i){var o=e,a=o.__inheritedStyle=o.__inheritedStyle||{},s={};1===t.nodeType&&(function(t,e){var n=t.getAttribute("transform");if(n){n=n.replace(/,/g," ");var r=[],i=null;n.replace($O,function(t,e,n){return r.push(e,n),""});for(var o=r.length-1;o>0;o-=2){var a=r[o],s=r[o-1],l=QO(a);switch(i=i||Te(),s){case"translate":Ae(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Le(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":De(i,i,-parseFloat(l[0])*tN,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":Ie(i,[1,0,Math.tan(parseFloat(l[0])*tN),1,0,0],i);break;case"skewY":Ie(i,[1,Math.tan(parseFloat(l[0])*tN),0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5])}}e.setLocalTransform(i)}}(t,e),nN(t,a,s),r||function(t,e,n){for(var r=0;r<VO.length;r++){var i=VO[r];null!=(o=t.getAttribute(i))&&(e[BO[i]]=o)}for(r=0;r<GO.length;r++){var o;i=GO[r];null!=(o=t.getAttribute(i))&&(n[FO[i]]=o)}}(t,a,s)),o.style=o.style||{},null!=a.fill&&(o.style.fill=KO(o,"fill",a.fill,n)),null!=a.stroke&&(o.style.stroke=KO(o,"stroke",a.stroke,n)),B(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],function(t){null!=a[t]&&(o.style[t]=parseFloat(a[t]))}),B(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign"],function(t){null!=a[t]&&(o.style[t]=a[t])}),i&&(o.__selfStyle=s),a.lineDash&&(o.style.lineDash=V(QO(a.lineDash),function(t){return parseFloat(t)})),"hidden"!==a.visibility&&"collapse"!==a.visibility||(o.invisible=!0),"none"===a.display&&(o.ignore=!0)}var qO=/^url\(\s*#(.*?)\)/;function KO(t,e,n,r){var i=n&&n.match(qO);if(!i)return"none"===n&&(n=null),n;var o=ct(i[1]);r.push([t,e,o])}var JO=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function QO(t){return t.match(JO)||[]}var $O=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g,tN=Math.PI/180;var eN=/([^\s:;]+)\s*:\s*([^:;]+)/g;function nN(t,e,n){var r,i=t.getAttribute("style");if(i)for(eN.lastIndex=0;null!=(r=eN.exec(i));){var o=r[1],a=wt(BO,o)?BO[o]:null;a&&(e[a]=r[2]);var s=wt(FO,o)?FO[o]:null;s&&(n[s]=r[2])}}function rN(t,e){var n=e.width/t.width,r=e.height/t.height,i=Math.min(n,r);return{scale:i,x:-(t.x+t.width/2)*i+(e.x+e.width/2),y:-(t.y+t.height/2)*i+(e.y+e.height/2)}}var iN=yt(["rect","circle","line","ellipse","polygon","polyline","path","text","tspan","g"]),oN=function(){function t(t,e){this.type="geoSVG",this._usedGraphicMap=yt(),this._freedGraphics=[],this._mapName=t,this._parsedXML=zO(e)}return t.prototype.load=function(){var t=this._firstGraphic;if(!t){t=this._firstGraphic=this._buildGraphic(this._parsedXML),this._freedGraphics.push(t),this._boundingRect=this._firstGraphic.boundingRect.clone();var e=function(t){var e=[],n=yt();return B(t,function(t){if(null==t.namedFrom){var r=new IM(t.name,t.el);e.push(r),n.set(t.name,r)}}),{regions:e,regionsMap:n}}(t.named),n=e.regions,r=e.regionsMap;this._regions=n,this._regionsMap=r}return{boundingRect:this._boundingRect,regions:this._regions,regionsMap:this._regionsMap}},t.prototype._buildGraphic=function(t){var e,n;try{e=t&&function(t,e){return(new HO).parse(t,e)}(t,{ignoreViewBox:!0,ignoreRootClip:!0})||{},ht(null!=(n=e.root))}catch(t){throw new Error("Invalid svg format\n"+t.message)}var r=new Do;r.add(n),r.isGeoSVGGraphicRoot=!0;var i=e.width,o=e.height,a=e.viewBoxRect,s=this._boundingRect;if(!s){var l=void 0,u=void 0,h=void 0,c=void 0;if(null!=i?(l=0,h=i):a&&(l=a.x,h=a.width),null!=o?(u=0,c=o):a&&(u=a.y,c=a.height),null==l||null==u){var d=n.getBoundingRect();null==l&&(l=d.x,h=d.width),null==u&&(u=d.y,c=d.height)}s=this._boundingRect=new ln(l,u,h,c)}if(a){var p=rN(a,s);n.scaleX=n.scaleY=p.scale,n.x=p.x,n.y=p.y}r.setClipPath(new Ru({shape:s.plain()}));var f=[];return B(e.named,function(t){var e;null!=iN.get(t.svgNodeTagLower)&&(f.push(t),(e=t.el).silent=!1,e.isGroup&&e.traverse(function(t){t.silent=!1}))}),{root:r,boundingRect:s,named:f}},t.prototype.useGraphic=function(t){var e=this._usedGraphicMap,n=e.get(t);return n||(n=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),e.set(t,n),n)},t.prototype.freeGraphic=function(t){var e=this._usedGraphicMap,n=e.get(t);n&&(e.removeKey(t),this._freedGraphics.push(n))},t}();for(var aN=[126,25],sN="南海诸岛",lN=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],uN=0;uN<lN.length;uN++)for(var hN=0;hN<lN[uN].length;hN++)lN[uN][hN][0]/=10.5,lN[uN][hN][1]/=-14,lN[uN][hN][0]+=aN[0],lN[uN][hN][1]+=aN[1];var cN={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};function dN(t,e){if("china"===t){var n=cN[e.name];if(n){var r=e.getCenter();r[0]+=n[0]/10.5,r[1]+=-n[1]/14,e.setCenter(r)}}}var pN=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var fN=function(){function t(t,e,n){var r;this.type="geoJSON",this._parsedMap=yt(),this._mapName=t,this._specialAreas=n,this._geoJSON=Y(r=e)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(r):new Function("return ("+r+");")():r}return t.prototype.load=function(t,e){e=e||"name";var n=this._parsedMap.get(e);if(!n){var r=this._parseToRegions(e);n=this._parsedMap.set(e,{regions:r,boundingRect:gN(r)})}var i=yt(),o=[];return B(n.regions,function(e){var n=e.name;t&&wt(t,n)&&(e=e.cloneShallow(n=t[n])),o.push(e),i.set(n,e)}),{regions:o,boundingRect:n.boundingRect||new ln(0,0,0,0),regionsMap:i}},t.prototype._parseToRegions=function(t){var e,n=this._mapName,r=this._geoJSON;try{e=r?LM(r,t):[]}catch(t){throw new Error("Invalid geoJson format\n"+t.message)}return function(t,e){if("china"===t){for(var n=0;n<e.length;n++)if(e[n].name===sN)return;e.push(new CM(sN,V(lN,function(t){return{type:"polygon",exterior:t}}),aN))}}(n,e),B(e,function(t){var e=t.name;dN(n,t),function(t,e){"china"===t&&"台湾"===e.name&&e.geometries.push({type:"polygon",exterior:pN[0]})}(n,t);var r=this._specialAreas&&this._specialAreas[e];r&&t.transformTo(r.left,r.top,r.width,r.height)},this),e},t.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},t}();function gN(t){for(var e,n=0;n<t.length;n++){var r=t[n].getBoundingRect();(e=e||r.clone()).union(r)}return e}var mN=yt(),vN=function(t,e,n){if(e.svg){var r=new oN(t,e.svg);mN.set(t,r)}else{var i=e.geoJson||e.geoJSON;i&&!e.features?n=e.specialAreas:i=e;r=new fN(t,i,n);mN.set(t,r)}},yN=function(t){return mN.get(t)},_N=function(t){var e=mN.get(t);return e&&"geoJSON"===e.type&&e.getMapForUser()},xN=function(t,e,n){var r=mN.get(t);if(r)return r.load(e,n);console.error("Map "+t+" not exists. The GeoJSON of the map must be provided.")};var bN=function(t){function n(e,n,r){var i=t.call(this)||this;i.type="view",i.dimensions=["x","y"];var o=i;o.invertY=e,o.lgCt=n,o.lgGeo=r;var a=o.trans=[];return a[0]=qi(),a[1]=qi(),a[2]=qi(),o.mtRaw=[1,0,0,1,0,0],o.mtRawInv=[1,0,0,1,0,0],o.mtOverall=[1,0,0,1,0,0],o.mtOverallInv=[1,0,0,1,0,0],o.zoom=1,i}return e(n,t),n.prototype.getBoundingRect=function(){return MN(null,this)},n.prototype.getViewRect=function(){return CN(null,this)},n.prototype.getRoamTransform=function(){return Yi(this.trans[1])},n.prototype.dataToPoint=function(t,e,n){var r=e?this.mtRaw:this.mtOverall;return n=n||[],r?Xt(n,t,r):At(n,t)},n.prototype.pointToData=function(t,e,n){n=n||[];var r=this.mtOverallInv;return r?Xt(n,t,r):At(n,t)},n.prototype.convertToPixel=function(t,e,n){var r=HN(e);return r===this?r.dataToPoint(n):null},n.prototype.convertFromPixel=function(t,e,n){var r=HN(e);return r===this?r.pointToData(n):null},n.prototype.containPoint=function(t){return Qe(wN,this.dataRect),tn(wN,wN,this.mtOverall),en(wN,t[0],t[1])},n.dimensions=["x","y"],n}($i),wN=Ke();function SN(t,e){return Ce(t||[],e.mtOverall)}function TN(t){return t.zoom}function MN(t,e){return Qe(t||Ke(),e.dataRect)}function CN(t,e){return Qe(t||Ke(),e.viewRect)}function IN(t,e,n){return Ji(t||qi(),e.trans[n])}function AN(t){return!(!t.dataRect||!t.viewRect)}function DN(t,e,n){Yi(n,LN),Ie(LN,LN,e.mtRawInv),Vp(t,LN)}var LN=[1,0,0,1,0,0];function PN(t,e){var n=t;n.centerOption=e.getShallow("center");var r=n.zoomLimit=e.getShallow("scaleLimit"),i=e.getShallow("zoom");n.zoom=iR(i||1,r)||1,AN(n)&&NN(n)}function EN(t,e,n,r,i){var o=t;o.dataRect=new ln(e,n,r,i),AN(o)&&NN(o)}function ON(t,e,n,r,i){var o=t;o.viewRect=new ln(e,n,r,i),AN(o)&&NN(o)}function NN(t){!function(t){var e=t.dataRect,n=t.viewRect,r=t.trans[0],i=t.invertY;i&&((e=Qe(kN,e)).y=-e.y-e.height);$e(RN,e,n),Vp(r,RN),i&&(r.scaleY=-r.scaleY);var o=Yi(r,t.mtRaw);Pe(t.mtRawInv,o)}(t),function(t){var e=UN(t),n=function(t,e,n){ht(AN(e));var r=e.dataRect;if(!n)return!1;var i=e.lgCt;i?Lt(t,Qo(n[0],i.w),Qo(n[1],i.h)):r&&Lt(t,Qo(n[0],r.width,r.x),Qo(n[1],r.height,r.y));return!0}(zN,t,t.centerOption)?Xt(zN,zN,t.mtRaw):e,r=t.zoom,i=t.trans[1];i.x=e[0]-r*n[0],i.y=e[1]-r*n[1],i.scaleX=i.scaleY=r}(t),function(t){var e=t.trans,n=e[1],r=e[0],i=e[2];VN(i,r,n);var o=Yi(i,t.mtOverall),a=Pe(t.mtOverallInv,o);BN(t,i,o,a),BN(t.lgGeo,i,o,a)}(t)}var RN=[1,0,0,1,0,0],kN=Ke();var zN=[];function BN(t,e,n,r){t&&(Ji(t,e),Ce(t.transform||(t.transform=[]),n),Ce(t.invTransform||(t.invTransform=[]),r))}function VN(t,e,n){Yi(e,FN),Yi(n,GN),Ie(GN,GN,FN),Vp(t,GN)}var FN=[1,0,0,1,0,0],GN=[1,0,0,1,0,0];function HN(t){var e=t.seriesModel;return e?e.coordinateSystem:null}function UN(t){var e=t.viewRect;return WN[0]=e.x+e.width/2,WN[1]=e.y+e.height/2,WN}var WN=[];function XN(t){return t&&"view"===t.type}function jN(t,e,n,r){var i=n;i.syncBackEl=t,i.syncBackType=e,r?Xd(t,IN(null,n,e),r):(IN(t,n,e),t.dirty())}function ZN(t,e,n,r){var i=t,o=i.syncBackEl;o?(ht(null!=i.syncBackType),o.stopAnimation(),function(t,e,n,r){1===r?VN(t,e.trans[0],n):Ji(t,n)}(YN,i,o,i.syncBackType)):Ji(YN,i.trans[2]),DN(qN,i,YN),r?function(t,e,n,r){null!=r.dx&&null!=r.dy&&(t.x+=r.dx,t.y+=r.dy);var i=r.zoom;if(null!=i){var o=$N(e),a=iR(o*i,n.zoomLimit)/o;t.x-=(r.originX-t.x)*(a-1),t.y-=(r.originY-t.y)*(a-1),t.scaleX*=a,t.scaleY*=a}}(YN,qN,i,r):Ji(YN,qN),DN(YN,i,YN),function(t,e,n,r){var i=UN(t),o=$N(r),a=Ho(o)>1e-6;nR[0]=a?(i[0]-r.x)/o:i[0],nR[1]=a?(i[1]-r.y)/o:i[1],Xt(nR,nR,t.mtRawInv);var s=function(t,e){var n=t.centerOption,r=t.dataRect;return ht(e&&r),!n||t.lgCt?e.slice():[tR(0,e,n,r),tR(1,e,n,r)]}(t,nR);rR(e,s,o),B(n,function(t){t!==e&&rR(t,s.slice(),o)})}(i,e,n,YN)}var YN=qi(),qN=qi();function KN(t,e,n){var r=JN(e);r&&(ZN(r,e,n,t),PN(r,e))}function JN(t){return t.__ownRoamView?t.__ownRoamView():null}function QN(t,e,n,r){n.setUpdatePayload(Bp(t));var i=fh(r,e);i&&i.__updateOnOwnRoam&&i.__updateOnOwnRoam(t,e,r)}function $N(t){return ht(Ho(t.scaleX-t.scaleY)<1e-5),t.scaleX}function tR(t,e,n,r){return n&&r&&r[tp[t]]&&(Y(i=n[t])&&ta(i))?(e[t]-r[$d[t]])/r[tp[t]]*100+"%":e[t];var i}function eR(t,e){return e&&t&&t.getShallow("legacyViewCoordSysCenterBase")?{w:e.getWidth(),h:e.getHeight()}:null}var nR=[];function rR(t,e,n){var r=t.option;r.center=e,r.zoom=n}function iR(t,e){if(e){var n=e.min||0,r=e.max||1/0;t=Math.max(Math.min(r,t),n)}return t}function oR(t,e){var n=e.getShallow("nodeScaleRatio",!0)||1,r=t;return((r.zoom-1)*n+1)/(r.trans[2].scaleX||1)}var aR=bN;function sR(t,e,n,r,i,o,a,s){function l(n){var r=t.mainType,i=Bp(E({type:cR(r,t.subType,dh)},n));s&&(i.componentType=r),i[r+"Id"]=t.id,e.dispatchAction(i)}JN(t)?(n.enable(at(t.get("roam"),a),{api:e,zInfo:{component:t},triggerInfo:{roamTrigger:t.get("roamTrigger"),isInSelf:r,isInClip:function(t,e,n){return!i||i.contain(e,n)}}}),n.off("pan").off("zoom").on("pan",function(t){o&&o("pan"),l({dx:t.dx,dy:t.dy})}).on("zoom",function(t){o&&o("zoom"),l({zoom:t.scale,originX:t.originX,originY:t.originY})})):n.disable()}function lR(t){return function(e,n,r){return uR.copy(t.getBoundingRect()),uR.applyTransform(t.getComputedTransform()),uR.contain(n,r)}}var uR=new ln(0,0,0,0);function hR(t,e,n){var r=cR(e,n,dh);t.registerAction({type:r,event:r,update:"none"},function(t,r,i){r.eachComponent(os(t,e,n),function(e){KN(t,e),QN(t,e,r,i)})})}function cR(t,e,n){return(t!==nh?t:"map"===e?"geo":e)+n}function dR(t){return null!=t.zoom}function pR(t,e,n,r,i,o,a){var s=new aR(null,eR(t.ecModel,e));return EN(s,n,r,i,o),a?ON(s,a.x,a.y,a.width,a.height):ON(s,n,r,i,o),PN(s,t),s}var fR=["rect","circle","line","ellipse","polygon","polyline","path"],gR=yt(fR),mR=yt(fR.concat(["g"])),vR=yt(fR.concat(["g"])),yR=Qa();function _R(t){var e=t.getItemStyle(),n=t.get("areaColor");return null!=n&&(e.fill=n),e}function xR(t){var e=t.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var bR=function(){function t(t){var e=this.group=new Do,n=this._transformGroup=new Do;e.add(n),this.uid=wf("ec_map_draw"),this._controller=new kO(t.getZr()),n.add(this._regionsGroup=new Do),n.add(this._svgGroup=new Do)}return t.prototype.draw=function(t,e,n,r,i){var o=this,a=t.getData&&t.getData();AR(t)&&e.eachComponent({mainType:"series",subType:"map"},function(e){a||e.getHostGeoModel()!==t||(a=e.getData())});var s,l=t.coordinateSystem,u=l.view,h=this._regionsGroup,c=this._transformGroup,d=!h.childAt(0)||i;l.shouldClip()?(s=CN(null,u),this.group.setClipPath(new Ru({shape:s.clone()}))):this.group.removeClipPath(),jN(c,1,u,d?null:t);var p=a&&a.getVisual("visualMeta")&&a.getVisual("visualMeta").length>0;"geoJSON"===l.resourceType?this._buildGeoJSON(u,n,l,t,a,p):"geoSVG"===l.resourceType&&this._buildSVG(u,n,l,t,a,p),sR(t,n,this._controller,function(e,n,r){return t.coordinateSystem.containPoint([n,r])},s,function(){o._mouseDownFlag=!1},!1,!0),this._updateMapSelectHandler(t,h,n,r)},t.prototype.__updateOnOwnRoam=function(t){jN(this._transformGroup,1,t.coordinateSystem.view,null)},t.prototype._buildGeoJSON=function(t,e,n,r,i,o){var a=this._regionsGroupByName=yt(),s=yt(),l=this._regionsGroup,u=n.projection,h=u&&u.stream,c=Yi(IN(null,t,0));function d(t,e){return e&&(t=e(t)),t&&Xt([],t,c)}function p(t){for(var e=[],n=!h&&u&&u.project,r=0;r<t.length;++r){var i=d(t[r],n);i&&e.push(i)}return e}function f(t){return{shape:{points:p(t)}}}l.removeAll(),B(n.regions,function(t){var n=t.name,c=a.get(n),p=s.get(n)||{},g=p.dataIdx,m=p.regionModel;if(!c){c=a.set(n,new Do),l.add(c),g=i?i.indexOfName(n):null;var v=(m=AR(r)?r.getRegionModel(n):i?i.getItemModel(g):null).get("silent",!0);null!=v&&(c.silent=v),s.set(n,{dataIdx:g,regionModel:m})}var y=[],_=[];B(t.geometries,function(t){if("polygon"===t.type){var e=[t.exterior].concat(t.interiors||[]);h&&(e=IR(e,h)),B(e,function(t){y.push(new sd(f(t)))})}else{var n=t.points;h&&(n=IR(n,h,!0)),B(n,function(t){_.push(new hd(f(t)))})}});var x=d(t.getCenter(),u&&u.project);function b(t,a){if(t.length){var s=new Td({culling:!0,segmentIgnoreThreshold:1,shape:{paths:t}});c.add(s),wR(e,i,o,s,g,m),SR(r,i,s,n,m,g,x),a&&(xR(s),B(s.states,xR))}}b(y),b(_,!0)}),a.each(function(t,e){var n=s.get(e),o=n.dataIdx,a=n.regionModel;TR(r,i,t,e,a,o),MR(r,i,t,e,a),CR(r,t,e,a)},this)},t.prototype._buildSVG=function(t,e,n,r,i,o){var a=n.map;IN(this._svgGroup,t,0),this._svgResourceChanged(a)&&(this._freeSVG(),this._useSVG(a));var s=this._svgDispatcherMap=yt(),l=!1;B(this._svgGraphicRecord.named,function(t){var n=t.name,a=t.svgNodeTagLower,u=t.el,h=i?i.indexOfName(n):null,c=r.getRegionModel(n);null!=gR.get(a)&&u instanceof vl&&wR(e,i,o,u,h,c),u instanceof vl&&(u.culling=!0);var d=c.get("silent",!0);(null!=d&&(u.silent=d),u.z2EmphasisLift=0,t.namedFrom)||(null!=vR.get(a)&&SR(r,i,u,n,c,h,null),TR(r,i,u,n,c,h),MR(r,i,u,n,c),null!=mR.get(a)&&("self"===CR(r,u,n,c)&&(l=!0),(s.get(n)||s.set(n,[])).push(u)))},this),this._enableBlurEntireSVG(l,r)},t.prototype._enableBlurEntireSVG=function(t,e){if(t&&AR(e)){var n=e.getModel(["blur","itemStyle"]).getItemStyle().opacity;this._svgGraphicRecord.root.traverse(function(t){if(!t.isGroup){Gh(t);var e=t.ensureState("blur").style||{};null==e.opacity&&null!=n&&(e.opacity=n),t.ensureState("emphasis")}})}},t.prototype.remove=function(){this._regionsGroup.removeAll(),this._regionsGroupByName=null,this._svgGroup.removeAll(),this._freeSVG(),this._controller.disable()},t.prototype.findHighDownDispatchers=function(t,e){if(null==t)return[];var n=e.coordinateSystem;if("geoJSON"===n.resourceType){var r=this._regionsGroupByName;if(r){var i=r.get(t);return i?[i]:[]}}else if("geoSVG"===n.resourceType)return this._svgDispatcherMap&&this._svgDispatcherMap.get(t)||[]},t.prototype._svgResourceChanged=function(t){return this._svgMapName!==t},t.prototype._useSVG=function(t){var e=yN(t);if(e&&"geoSVG"===e.type){var n=e.useGraphic(this.uid);this._svgGroup.add(n.root),this._svgGraphicRecord=n,this._svgMapName=t}},t.prototype._freeSVG=function(){var t=this._svgMapName;if(null!=t){var e=yN(t);e&&"geoSVG"===e.type&&e.freeGraphic(this.uid),this._svgGraphicRecord=null,this._svgDispatcherMap=null,this._svgGroup.removeAll(),this._svgMapName=null}},t.prototype.resetForLabelLayout=function(){this.group.traverse(function(t){var e=t.getTextContent();e&&(e.ignore=yR(e).ignore)})},t.prototype._updateMapSelectHandler=function(t,e,n,r){var i=this;e.off("mousedown"),e.off("click"),t.get("selectedMode")&&(e.on("mousedown",function(){i._mouseDownFlag=!0}),e.on("click",function(t){i._mouseDownFlag&&(i._mouseDownFlag=!1)}))},t}();function wR(t,e,n,r,i,o){var a=o.getModel("itemStyle"),s=o.getModel(["emphasis","itemStyle"]),l=o.getModel(["blur","itemStyle"]),u=o.getModel(["select","itemStyle"]),h=_R(a),c=_R(s),d=_R(u),p=_R(l);if(e){var f=e.getItemVisual(i,"style"),g=e.getItemVisual(i,"decal");n&&f.fill&&(h.fill=f.fill),g&&(h.decal=$x(g,t))}r.setStyle(h),r.style.strokeNoScale=!0,r.ensureState("emphasis").style=c,r.ensureState("select").style=d,r.ensureState("blur").style=p,Gh(r)}function SR(t,e,n,r,i,o,a){var s=e&&isNaN(e.get(e.mapDimension("value"),o)),l=e&&e.getItemLayout(o);if(AR(t)||s||l&&l.showLabel){var u=AR(t)?r:o,h=void 0;(!e||o>=0)&&(h=t);var c=a?{normal:{align:"center",verticalAlign:"middle"}}:null;jp(n,Zp(i),{labelFetcher:h,labelDataIndex:u,defaultText:r},c);var d=n.getTextContent();if(d&&(yR(d).ignore=d.ignore,n.textConfig&&a)){var p=n.getBoundingRect().clone();n.textConfig.layoutRect=p,n.textConfig.position=[(a[0]-p.x)/p.width*100+"%",(a[1]-p.y)/p.height*100+"%"]}n.disableLabelAnimation=!0}else n.removeTextContent(),n.removeTextConfig(),n.disableLabelAnimation=null}function TR(t,e,n,r,i,o){e?e.setItemGraphicEl(o,n):$u(n).eventData={componentType:"geo",componentIndex:t.componentIndex,geoIndex:t.componentIndex,name:r,region:i&&i.option||{}}}function MR(t,e,n,r,i){e||Ip({el:n,componentModel:t,itemName:r,itemTooltipOption:i.get("tooltip")})}function CR(t,e,n,r){e.highDownSilentOnTouch=!!t.get("selectedMode");var i=r.getModel("emphasis"),o=i.get("focus");return ic(e,o,i.get("blurScope"),i.get("disabled")),AR(t)&&function(t,e,n){var r=$u(t);r.componentMainType=e.mainType,r.componentIndex=e.componentIndex,r.componentHighDownName=n}(e,t,n),o}function IR(t,e,n){var r,i=[];function o(){r=[]}function a(){r.length&&(i.push(r),r=[])}var s=e({polygonStart:o,polygonEnd:a,lineStart:o,lineEnd:a,point:function(t,e){isFinite(t)&&isFinite(e)&&r.push([t,e])},sphere:function(){}});return!n&&s.polygonStart(),B(t,function(t){s.lineStart();for(var e=0;e<t.length;e++)s.point(t[e][0],t[e][1]);s.lineEnd()}),!n&&s.polygonEnd(),i}function AR(t){return"geo"===t.mainType}var DR=bR,LR="map",PR=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.getTooltipPosition=function(t){if(null!=t){var e=this.getData().getName(t),n=this.coordinateSystem,r=n.getRegion(e);return r&&n.dataToPoint(r.getCenter())}},e}return e(n,t),n.prototype.getInitialData=function(t){for(var e=SP(this,{coordDimensions:["value"],encodeDefaulter:X(mm,this)}),n=yt(),r=[],i=0,o=e.count();i<o;i++){var a=e.getName(i);n.set(a,i)}return B(xN(this.getMapType(),this.option.nameMap,this.option.nameProperty).regions,function(t){var i,o=t.name,a=n.get(o),s=t.properties&&t.properties.echartsStyle;null==a?(i={name:o},r.push(i)):i=e.getRawDataItem(a),s&&A(i,s)}),e.appendData(r),e},n.prototype.getHostGeoModel=function(){if(2!==Eg(this).kind)return this.getReferringComponents("geo",{useDefault:!1,enableAll:!1,enableNone:!1}).models[0]},n.prototype.getMapType=function(){return(this.getHostGeoModel()||this).option.map},n.prototype.getRawValue=function(t){var e=this.getData();return e.get(e.mapDimension("value"),t)},n.prototype.getRegionModel=function(t){var e=this.getData();return e.getItemModel(e.indexOfName(t))},n.prototype.formatTooltip=function(t,e,n){var r=this.getData(),i=this.getRawValue(t),o=r.getName(t),a=[];return B(this.seriesGroup.f,function(t){var e=t.originalData.indexOfName(o),n=r.mapDimension("value");isNaN(t.originalData.get(n,e))||a.push(t.name)}),Cy("section",{header:a.join(", "),noHeader:!a.length,blocks:[Cy("nameValue",{name:o,value:i})]})},n.prototype.getLegendIcon=function(t){var e=t.icon||"roundRect",n=Cx(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill);return n.setStyle(t.itemStyle),n.style.stroke="none",e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill=om.color.neutral00,n.style.lineWidth=2),n},n.prototype.__ownRoamView=function(){return OR(this)?this.coordinateSystem.view:null},n.type="series."+LR,n.dependencies=["geo"],n.layoutMode="box",n.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:om.color.tertiary},itemStyle:{borderWidth:.5,borderColor:om.color.border,areaColor:om.color.background},emphasis:{label:{show:!0,color:om.color.primary},itemStyle:{areaColor:om.color.highlight}},select:{label:{show:!0,color:om.color.primary},itemStyle:{color:om.color.highlight}},nameProperty:"name"},n}(Ky);function ER(t){return 0===t.indexOf("i")}function OR(t){return NR(t.seriesGroup)===t&&!t.getHostGeoModel()}function NR(t){return t.f[0]}function RR(t,e){var n={};return t.eachRawSeriesByType(LR,function(r){var i=r.getHostGeoModel(),o=i?"o"+i.id:"i"+r.getMapType(),a=n[o]=n[o]||{f:[],r:[]};t.isSeriesFiltered(r)||e||a.f.push(r),a.r.push(r)}),n}var kR=PR,zR=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=LR,e}return e(n,t),n.prototype.render=function(t,e,n,r){if(!r||"mapToggleSelect"!==r.type||r.from!==this.uid){var i=this.group;if(i.removeAll(),!t.getHostGeoModel()){var o=this._mapDraw;o&&r&&"geoRoam"===r.type&&o.resetForLabelLayout(),r&&"geoRoam"===r.type&&"series"===r.componentType&&r.seriesId===t.id?o&&i.add(o.group):OR(t)?(o=o||(this._mapDraw=new DR(n)),i.add(o.group),o.draw(t,e,n,this,r)):this._clearMapDraw(),t.get("showLegendSymbol")&&e.getComponent("legend")&&this._renderSymbols(t)}}},n.prototype.__updateOnOwnRoam=function(t,e,n){var r=this._mapDraw;OR(e)&&r&&r.__updateOnOwnRoam(e)},n.prototype.remove=function(){this._clearMapDraw(),this.group.removeAll()},n.prototype.dispose=function(){this._clearMapDraw()},n.prototype._clearMapDraw=function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},n.prototype._renderSymbols=function(t){var e=t.originalData,n=this.group;e.each(e.mapDimension("value"),function(r,i){if(!isNaN(r)){var o=e.getItemLayout(i);if(o&&o.point){var a=o.point,s=o.offset,l=new Rc({style:{fill:t.getData().getVisual("style").fill},shape:{cx:a[0]+9*s,cy:a[1],r:3},silent:!0,z2:8+(s?0:11)});if(!s){var u=NR(t.seriesGroup).getData(),h=e.getName(i),c=u.indexOfName(h),d=e.getItemModel(i),p=d.getModel("label"),f=u.getItemGraphicEl(c);jp(l,Zp(d),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(c,n)}},defaultText:h}),l.disableLabelAnimation=!0,p.get("position")||l.setTextConfig({position:"bottom"}),f.onHoverStateChange=function(t){Vh(l,t)}}n.add(l)}}})},n.type=LR,n}(l_),BR=zR,VR={geoJSON:{aspectScale:.75,invertLongitute:!0},geoSVG:{aspectScale:1,invertLongitute:!1}},FR=["lng","lat"],GR=function(t){function n(e,n,r){var i=t.call(this)||this;i.dimensions=FR,i.type="geo",i._nameCoordMap=yt(),i.name=e;var o=r.projection,a=xN(n,r.nameMap,r.nameProperty),s=yN(n),l=i.resourceType=s?s.type:null,u=i.regions=a.regions,h=VR[s.type];i._clip=r.clip;var c,d=!o&&h.invertLongitute;if(i.view=new aR(d,eR(r.ecModel,r.api),i),i.map=n,i._regionsMap=a.regionsMap,i.regions=a.regions,o&&("geoSVG"===l&&(Da("Map "+n+" with SVG source can't use projection. Only GeoJSON source supports projection."),o=null),o.project&&o.unproject||(Da("project and unproject must be both provided in the projeciton."),o=null)),i.projection=o,o)for(var p=0;p<u.length;p++){var f=u[p].getBoundingRect(o);(c=c||f.clone()).union(f)}else c=a.boundingRect;return EN(i.view,c.x,c.y,c.width,c.height),i.aspectScale=o?1:at(r.aspectScale,h.aspectScale),i}return e(n,t),n.prototype.getRegion=function(t){return this._regionsMap.get(t)},n.prototype.getRegionByCoord=function(t){for(var e=this.regions,n=0;n<e.length;n++){var r=e[n];if("geoJSON"===r.type&&r.contain(t))return e[n]}},n.prototype.addGeoCoord=function(t,e){this._nameCoordMap.set(t,e)},n.prototype.getGeoCoord=function(t){var e=this._regionsMap.get(t);return this._nameCoordMap.get(t)||e&&e.getCenter()},n.prototype.dataToPoint=function(t,e,n){if(Y(t)&&(t=this.getGeoCoord(t)),t){var r=this.projection;return r&&(t=r.project(t)),t&&this.view.dataToPoint(t,e,n)}},n.prototype.pointToData=function(t,e,n){var r=this.projection;return r&&(t=r.unproject(t)),t&&this.view.pointToData(t,n)},n.prototype.convertToPixel=function(t,e,n){var r=HR(e);return r===this?r.dataToPoint(n):null},n.prototype.convertFromPixel=function(t,e,n){var r=HR(e);return r===this?r.pointToData(n):null},n.prototype.containPoint=function(t){return this.view.containPoint(t)},n.prototype.getArea=function(t){t=t||0;var e=CN(null,this.view);return e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t,e},n.prototype.shouldClip=function(){return this._clip},n.prototype.getBoundingRect=function(){return this.view.getBoundingRect()},n.prototype.getViewRect=function(){return this.view.getViewRect()},n.prototype.getRoamTransform=function(){return this.view.getRoamTransform()},n}($i);function HR(t){var e=t.geoModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem||(n.getReferringComponents("geo",ns).models[0]||{}).coordinateSystem:null}var UR=GR;function WR(t,e){var n=this.view,r=t.get("boundingCoords");if(null!=r){var i=r[0],o=r[1];if(isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])){var a=this.projection;if(a){var s=i[0],l=i[1],u=o[0],h=o[1];i=[1/0,1/0],o=[-1/0,-1/0];var c=function(t,e,n,r){for(var s=n-t,l=r-e,u=0;u<=100;u++){var h=u/100,c=a.project([t+s*h,e+l*h]);jt(i,i,c),Zt(o,o,c)}};c(s,l,u,l),c(u,l,u,h),c(u,h,s,h),c(s,h,u,l)}EN(n,i[0],i[1],o[0]-i[0],o[1]-i[1])}else console.error("Invalid boundingCoords")}var d,p,f,g=n.getBoundingRect(),m=t.get("layoutCenter"),v=t.get("layoutSize"),y=jg(t,e).refContainer,_=g.width/g.height*this.aspectScale,x=!1;if(m&&v&&(d=[Qo(m[0],y.width)+y.x,Qo(m[1],y.height)+y.y],p=Qo(v,Math.min(y.width,y.height)),isNaN(d[0])||isNaN(d[1])||isNaN(p)?console.warn("Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead."):x=!0),x)f={},_>1?(f.width=p,f.height=p/_):(f.height=p,f.width=p*_),f.y=d[1]-f.height/2,f.x=d[0]-f.width/2;else{var b=t.getBoxLayoutParams();b.aspect=_,f=Wg(t,f=Ug(b,y),_)}ON(n,f.x,f.y,f.width,f.height),PN(n,t)}var XR=function(){function t(){this.dimensions=FR}return t.prototype.create=function(t,e){var n=[];function r(t){return{nameProperty:t.get("nameProperty"),aspectScale:t.get("aspectScale"),projection:t.get("projection"),clip:t.getShallow("clip",!0)}}return t.eachComponent("geo",function(i,o){var a=i.get("map"),s=new UR(a+o,a,L({nameMap:i.get("nameMap"),api:e,ecModel:t},r(i)));n.push(s),i.coordinateSystem=s,s.model=i,s.resize=WR,s.resize(i,e)}),t.eachSeries(function(t){Og({targetModel:t,coordSysType:"geo",coordSysProvider:function(){var e=t.subType===LR?t.getHostGeoModel():t.getReferringComponents("geo",ns).models[0];return e&&e.coordinateSystem},allowNotFound:!0})}),B(RR(t,!0),function(i,o){if(ER(o)){var a=i.r[0],s=[];B(i.r,function(t){s.push(t.get("nameMap")),t.seriesGroup=null});var l,u=o.slice(1),h=new UR(u,u,L({nameMap:D(s),api:e,ecModel:t},r(a)));B(i.r,function(t){l=at(l,t.get("scaleLimit"))}),n.push(h),h.resize=WR,h.resize(a,e),B(i.r,function(t){t.coordinateSystem=h,function(t,e){B(e.get("geoCoord"),function(e,n){t.addGeoCoord(n,e)})}(h,t)})}}),n},t.prototype.getFilledRegions=function(t,e,n,r){for(var i=(t||[]).slice(),o=yt(),a=0;a<i.length;a++)o.set(i[a].name,i[a]);return B(xN(e,n,r).regions,function(t){var e=t.name,n=o.get(e),r=t.properties&&t.properties.echartsStyle;n||(n={name:e},i.push(n)),r&&A(n,r)}),i},t}(),jR=new XR,ZR=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n);var r=yN(t.map);if(r&&"geoJSON"===r.type){var i=t.itemStyle=t.itemStyle||{};"color"in i||(i.color=t.defaultItemStyleColor||om.color.backgroundTint)}Va(t,"label",["show"])},n.prototype.optionUpdated=function(){var t=this,e=this.option;e.regions=jR.getFilledRegions(e.regions,e.map,e.nameMap,e.nameProperty);var n={};this._optionModelMap=F(e.regions||[],function(e,r){var i=r.name;return i&&(e.set(i,new xf(r,t,t.ecModel)),r.selected&&(n[i]=!0)),e},yt()),e.selectedMap||(e.selectedMap=n)},n.prototype.getRegionModel=function(t){return this._optionModelMap.get(t)||new xf(null,this,this.ecModel)},n.prototype.getFormattedLabel=function(t,e){var n=this.getRegionModel(t),r="normal"===e?n.get(["label","formatter"]):n.get(["emphasis","label","formatter"]),i={name:t};return Z(r)?(i.status=e,r(i)):Y(r)?r.replace("{a}",null!=t?t:""):void 0},n.prototype.select=function(t){var e=this.option,n=e.selectedMode;n&&("multiple"!==n&&(e.selectedMap=null),(e.selectedMap||(e.selectedMap={}))[t]=!0)},n.prototype.unSelect=function(t){var e=this.option.selectedMap;e&&(e[t]=!1)},n.prototype.toggleSelected=function(t){this[this.isSelected(t)?"unSelect":"select"](t)},n.prototype.isSelected=function(t){var e=this.option.selectedMap;return!(!e||!e[t])},n.prototype.__ownRoamView=function(){return this.coordinateSystem.view},n.type="geo",n.layoutMode="box",n.defaultOption={z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:om.color.tertiary},itemStyle:{borderWidth:.5,borderColor:om.color.border},emphasis:{label:{show:!0,color:om.color.primary},itemStyle:{color:om.color.highlight}},select:{label:{show:!0,color:om.color.primary},itemStyle:{color:om.color.highlight}},regions:[]},n}(tm),YR=ZR,qR=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.focusBlurEnabled=!0,e}return e(n,t),n.prototype.init=function(t,e){this._api=e},n.prototype.render=function(t,e,n,r){if(this._model=t,!t.get("show"))return this._mapDraw&&this._mapDraw.remove(),void(this._mapDraw=null);this._mapDraw||(this._mapDraw=new DR(n));var i=this._mapDraw;i.draw(t,e,n,this,r),i.group.on("click",this._handleRegionClick,this),i.group.silent=t.get("silent"),this.group.add(i.group),this.updateSelectStatus(t,e,n)},n.prototype.__updateOnOwnRoam=function(t,e,n){var r=this._mapDraw;r&&r.__updateOnOwnRoam(e)},n.prototype._handleRegionClick=function(t){var e;ix(t.target,function(t){return null!=(e=$u(t).eventData)},!0),e&&this._api.dispatchAction({type:"geoToggleSelect",geoId:this._model.id,name:e.name})},n.prototype.updateSelectStatus=function(t,e,n){var r=this;this._mapDraw.group.traverse(function(t){var e=$u(t).eventData;if(e)return r._model.isSelected(e.name)?n.enterSelect(t):n.leaveSelect(t),!0})},n.prototype.findHighDownDispatchers=function(t){return this._mapDraw&&this._mapDraw.findHighDownDispatchers(t,this._model)},n.prototype.dispose=function(){this._mapDraw&&this._mapDraw.remove()},n.type="geo",n}(Qy),KR=qR;function JR(t,e,n){vN(t,e,n)}function QR(t){function e(e,n){n.update="geo:updateSelectStatus",t.registerAction(n,function(t,n){var r={},i=[];return n.eachComponent({mainType:"geo",query:t},function(n){n[e](t.name),B(n.coordinateSystem.regions,function(t){r[t.name]=n.isSelected(t.name)||!1});var o=[];B(r,function(t,e){r[e]&&o.push(e)}),i.push({geoIndex:n.componentIndex,name:o})}),{selected:r,allSelected:i,name:t.name}})}t.registerCoordinateSystem("geo",jR),t.registerComponentModel(YR),t.registerComponentView(KR),t.registerImpl("registerMap",JR),t.registerImpl("getMap",function(t){return _N(t)}),e("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),e("select",{type:"geoSelect",event:"geoselected"}),e("unSelect",{type:"geoUnSelect",event:"geounselected"}),t.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(t,e,n){var r=t.componentType||(null!=t.geoId||null!=t.geoName||null!=t.geoIndex?"geo":nh),i=r===nh;if("geo"===r||i){var o=i?"map":null;e.eachComponent(os(t,r,o),function(r){i&&!OR(r)||(KN(t,r,i?r.seriesGroup.r:null),QN(t,r,e,n))})}})}var $R=Cs(LR,function(t){B(RR(t),function(e,n){if(NR(e)&&ER(n)){var r={};B(e.f,function(e){var n=e.coordinateSystem,i=e.originalData;e.get("showLegendSymbol")&&t.getComponent("legend")&&i.each(i.mapDimension("value"),function(t,e){var o=i.getName(e),a=n.getRegion(o);if(a&&!isNaN(t)){var s=r[o]||0,l=n.dataToPoint(a.getCenter());r[o]=s+1,i.setItemLayout(e,{point:l,offset:s})}})});var i=NR(e).getData();i.each(function(t){var e=i.getName(t),n=i.getItemLayout(t)||{};n.showLabel=!r[e],i.setItemLayout(t,n)})}})});var tk=Cs(LR,function(t){B(RR(t),function(t){var e=NR(t);if(e){var n,r,i,o=(n=V(t.f,function(t){return t.getData()}),r=e.get("mapValueCalculation"),i={},B(n,function(t){t.each(t.mapDimension("value"),function(e,n){var r="ec-"+t.getName(n);i[r]=i[r]||[],isNaN(e)||i[r].push(e)})}),n[0].map(n[0].mapDimension("value"),function(t,e){for(var o="ec-"+n[0].getName(e),a=0,s=1/0,l=-1/0,u=i[o].length,h=0;h<u;h++)s=Math.min(s,i[o][h]),l=Math.max(l,i[o][h]),a+=i[o][h];return 0===u?NaN:"min"===r?s:"max"===r?l:"average"===r?a/u:a}));B(t.f,function(e){e.seriesGroup=t,e.originalData=e.getData(),e.setData(o.cloneShallow())})}})});function ek(t,e){var n=t.isExpand?t.children:[],r=t.parentNode.children,i=t.hierNode.i?r[t.hierNode.i-1]:null;if(n.length){!function(t){var e=t.children,n=e.length,r=0,i=0;for(;--n>=0;){var o=e[n];o.hierNode.prelim+=r,o.hierNode.modifier+=r,i+=o.hierNode.change,r+=o.hierNode.shift+i}}(t);var o=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;i?(t.hierNode.prelim=i.hierNode.prelim+e(t,i),t.hierNode.modifier=t.hierNode.prelim-o):t.hierNode.prelim=o}else i&&(t.hierNode.prelim=i.hierNode.prelim+e(t,i));t.parentNode.hierNode.defaultAncestor=function(t,e,n,r){if(e){for(var i=t,o=t,a=o.parentNode.children[0],s=e,l=i.hierNode.modifier,u=o.hierNode.modifier,h=a.hierNode.modifier,c=s.hierNode.modifier;s=ok(s),o=ak(o),s&&o;){i=ok(i),a=ak(a),i.hierNode.ancestor=t;var d=s.hierNode.prelim+c-o.hierNode.prelim-u+r(s,o);d>0&&(lk(sk(s,t,n),t,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=o.hierNode.modifier,l+=i.hierNode.modifier,h+=a.hierNode.modifier}s&&!ok(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=c-l),o&&!ak(a)&&(a.hierNode.thread=o,a.hierNode.modifier+=u-h,n=t)}return n}(t,i,t.parentNode.hierNode.defaultAncestor||r[0],e)}function nk(t){var e=t.hierNode.prelim+t.parentNode.hierNode.modifier;t.setLayout({x:e},!0),t.hierNode.modifier+=t.parentNode.hierNode.modifier}function rk(t){return arguments.length?t:uk}function ik(t,e){return t-=Math.PI/2,{x:e*Math.cos(t),y:e*Math.sin(t)}}function ok(t){var e=t.children;return e.length&&t.isExpand?e[e.length-1]:t.hierNode.thread}function ak(t){var e=t.children;return e.length&&t.isExpand?e[0]:t.hierNode.thread}function sk(t,e,n){return t.hierNode.ancestor.parentNode===e.parentNode?t.hierNode.ancestor:n}function lk(t,e,n){var r=n/(e.hierNode.i-t.hierNode.i);e.hierNode.change-=r,e.hierNode.shift+=n,e.hierNode.modifier+=n,e.hierNode.prelim+=n,t.hierNode.change+=r}function uk(t,e){return t.parentNode===e.parentNode?1:2}var hk=Qa();function ck(t){var e=t.mainData,n=t.datas;n||(n={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,vk(e,n,t),B(n,function(n){B(e.TRANSFERABLE_METHODS,function(e){n.wrapMethod(e,X(dk,t))})}),e.wrapMethod("cloneShallow",X(fk,t)),B(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,X(pk,t))}),ht(n[e.dataType]===e)}function dk(t,e){if(hk(r=this).mainData===r){var n=L({},hk(this).datas);n[this.dataType]=e,vk(e,n,t)}else yk(e,this.dataType,hk(this).mainData,t);var r;return e}function pk(t,e){return t.struct&&t.struct.update(),e}function fk(t,e){return B(hk(e).datas,function(n,r){n!==e&&yk(n.cloneShallow(),r,e,t)}),e}function gk(t){var e=hk(this).mainData;return null==t||null==e?e:hk(e).datas[t]}function mk(){var t=hk(this).mainData;return null==t?[{data:t}]:V(U(hk(t).datas),function(e){return{type:e,data:hk(t).datas[e]}})}function vk(t,e,n){hk(t).datas={},B(e,function(e,r){yk(e,r,t,n)})}function yk(t,e,n,r){hk(n).datas[e]=t,hk(t).mainData=n,t.dataType=e,r.struct&&(t[r.structAttr]=r.struct,r.struct[r.datasAttr[e]]=t),t.getLinkedData=gk,t.getLinkedDataAll=mk}var _k=function(){function t(t,e){this.depth=0,this.height=0,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.isExpand=!1,this.name=t||"",this.hostTree=e}return t.prototype.isRemoved=function(){return this.dataIndex<0},t.prototype.eachNode=function(t,e,n){Z(t)&&(n=e,e=t,t=null),Y(t=t||{})&&(t={order:t});var r,i=t.order||"preorder",o=this[t.attr||"children"];"preorder"===i&&(r=e.call(n,this));for(var a=0;!r&&a<o.length;a++)o[a].eachNode(t,e,n);"postorder"===i&&e.call(n,this)},t.prototype.updateDepthAndHeight=function(t){var e=0;this.depth=t;for(var n=0;n<this.children.length;n++){var r=this.children[n];r.updateDepthAndHeight(t+1),r.height>e&&(e=r.height)}this.height=e+1},t.prototype.getNodeById=function(t){if(this.getId()===t)return this;for(var e=0,n=this.children,r=n.length;e<r;e++){var i=n[e].getNodeById(t);if(i)return i}},t.prototype.contains=function(t){if(t===this)return!0;for(var e=0,n=this.children,r=n.length;e<r;e++){var i=n[e].contains(t);if(i)return i}},t.prototype.getAncestors=function(t){for(var e=[],n=t?this:this.parentNode;n;)e.push(n),n=n.parentNode;return e.reverse(),e},t.prototype.getAncestorsIndices=function(){for(var t=[],e=this;e;)t.push(e.dataIndex),e=e.parentNode;return t.reverse(),t},t.prototype.getDescendantIndices=function(){var t=[];return this.eachNode(function(e){t.push(e.dataIndex)}),t},t.prototype.getValue=function(t){var e=this.hostTree.data;return e.getStore().get(e.getDimensionIndex(t||"value"),this.dataIndex)},t.prototype.setLayout=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,t,e)},t.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},t.prototype.setVisual=function(t,e){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,t,e)},t.prototype.getVisual=function(t){return this.hostTree.data.getItemVisual(this.dataIndex,t)},t.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},t.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},t.prototype.getChildIndex=function(){if(this.parentNode){for(var t=this.parentNode.children,e=0;e<t.length;++e)if(t[e]===this)return e;return-1}return-1},t.prototype.isAncestorOf=function(t){for(var e=t.parentNode;e;){if(e===this)return!0;e=e.parentNode}return!1},t.prototype.isDescendantOf=function(t){return t!==this&&t.isAncestorOf(this)},t}(),xk=function(){function t(t){this.type="tree",this._nodes=[],this.hostModel=t}return t.prototype.eachNode=function(t,e,n){this.root.eachNode(t,e,n)},t.prototype.getNodeByDataIndex=function(t){var e=this.data.getRawIndex(t);return this._nodes[e]},t.prototype.getNodeById=function(t){return this.root.getNodeById(t)},t.prototype.update=function(){for(var t=this.data,e=this._nodes,n=0,r=e.length;n<r;n++)e[n].dataIndex=-1;for(n=0,r=t.count();n<r;n++)e[t.getRawIndex(n)].dataIndex=n},t.prototype.clearLayouts=function(){this.data.clearItemLayouts()},t.createTree=function(e,n,r){var i=new t(n),o=[],a=1;!function t(e,n){var r=e.value;a=Math.max(a,j(r)?r.length:1),o.push(e);var s=new _k(ja(e.name,""),i);n?function(t,e){var n=e.children;if(t.parentNode===e)return;n.push(t),t.parentNode=e}(s,n):i.root=s,i._nodes.push(s);var l=e.children;if(l)for(var u=0;u<l.length;u++)t(l[u],s)}(e),i.root.updateDepthAndHeight(0);var s=sS(o,{coordDimensions:["value"],dimensionsCount:a}).dimensions,l=new oS(s,n);return l.initData(o),r&&r(l),ck({mainData:l,struct:i,structAttr:"tree"}),i.update(),i},t}();var bk=xk;function wk(t,e,n){if(t&&N(e,t.type)>=0){var r=n.getData().tree.root,i=t.targetNode;if(Y(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var o=t.targetNodeId;if(null!=o&&(i=r.getNodeById(o)))return{node:i}}}function Sk(t){for(var e=[];t;)(t=t.parentNode)&&e.push(t);return e.reverse()}function Tk(t,e){return N(Sk(t),e)>=0}function Mk(t,e){for(var n=[];t;){var r=t.dataIndex;n.push({name:t.name,dataIndex:r,value:e.getRawValue(r)}),t=t.parentNode}return n.reverse(),n}var Ck="tree",Ik=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e.ignoreStyleOnData=!0,e}return e(n,t),n.prototype.getInitialData=function(t){var e={name:t.name,children:t.data},n=t.leaves||{},r=new xf(n,this,this.ecModel),i=bk.createTree(e,this,function(t){t.wrapMethod("getItemModel",function(t,e){var n=i.getNodeByDataIndex(e);return n&&n.children.length&&n.isExpand||(t.parentModel=r),t})});var o=0;i.eachNode("preorder",function(t){t.depth>o&&(o=t.depth)});var a=t.expandAndCollapse&&t.initialTreeDepth>=0?t.initialTreeDepth:o;return i.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=a}),i.data},n.prototype.getOrient=function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},n.prototype.formatTooltip=function(t,e,n){for(var r=this.getData().tree,i=r.root.children[0],o=r.getNodeByDataIndex(t),a=o.getValue(),s=o.name;o&&o!==i;)s=o.parentNode.name+"."+s,o=o.parentNode;return Cy("nameValue",{name:s,value:a,noValue:isNaN(a)||null==a})},n.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=Mk(r,this),n.collapsed=!r.isExpand,n},n.prototype.__ownRoamView=function(){return this.coordinateSystem},n.type="series."+Ck,n.layoutMode="box",n.defaultOption={z:2,coordinateSystemUsage:"box",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,roamTrigger:"global",nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:om.color.borderTint,width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},n}(Ky),Ak=Ik,Dk=function(){this.parentPoint=[],this.childPoints=[]},Lk=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:om.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new Dk},n.prototype.buildPath=function(t,e){var n=e.childPoints,r=n.length,i=e.parentPoint,o=n[0],a=n[r-1];if(1===r)return t.moveTo(i[0],i[1]),void t.lineTo(o[0],o[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=Qo(e.forkPosition,1),c=[];c[l]=i[l],c[u]=i[u]+(a[u]-i[u])*h,t.moveTo(i[0],i[1]),t.lineTo(c[0],c[1]),t.moveTo(o[0],o[1]),c[l]=o[l],t.lineTo(c[0],c[1]),c[l]=a[l],t.lineTo(c[0],c[1]),t.lineTo(a[0],a[1]);for(var d=1;d<r-1;d++){var p=n[d];t.moveTo(p[0],p[1]),c[l]=p[l],t.lineTo(c[0],c[1])}},n}(xu),Pk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=Ck,e._mainGroup=new Do,e}return e(n,t),n.prototype.init=function(t,e){this._controller=new kO(e.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},n.prototype.render=function(t,e,n){var r=t.getData(),i=t.layoutInfo,o=this._mainGroup;"radial"===t.get("layout")?(o.x=i.x+i.width/2,o.y=i.y+i.height/2):(o.x=i.x,o.y=i.y),this._updateViewCoordSys(t,n),sR(t,n,this._controller,lR(this.group),null);var a=this._data;r.diff(a).add(function(e){Ek(r,e)&&Ok(r,e,null,o,t)}).update(function(e,n){var i=a.getItemGraphicEl(n);Ek(r,e)?Ok(r,e,i,o,t):i&&kk(a,n,i,o,t)}).remove(function(e){var n=a.getItemGraphicEl(e);n&&kk(a,e,n,o,t)}).execute(),this._updateNodeAndLinkScale(t),!0===t.get("expandAndCollapse")&&r.eachItemGraphicEl(function(e,r){e.off("click").on("click",function(){n.dispatchAction({type:"treeExpandAndCollapse",seriesId:t.id,dataIndex:r})})}),this._data=r,this._firstRender=!1},n.prototype.__updateOnOwnRoam=function(t,e,n){jN(this.group,2,e.coordinateSystem,null),dR(t)&&this._updateNodeAndLinkScale(e)},n.prototype._updateViewCoordSys=function(t,e){var n=t.getData(),r=[];n.each(function(t){var e=n.getItemLayout(t);!e||isNaN(e.x)||isNaN(e.y)||r.push([+e.x,+e.y])});var i=[],o=[];Cl(r,i,o);var a=this._min,s=this._max;o[0]-i[0]===0&&(i[0]=a?a[0]:i[0]-1,o[0]=s?s[0]:o[0]+1),o[1]-i[1]===0&&(i[1]=a?a[1]:i[1]-1,o[1]=s?s[1]:o[1]+1);var l=t.coordinateSystem=pR(t,e,i[0],i[1],o[0]-i[0],o[1]-i[1]);jN(this.group,2,l,this._firstRender?null:t),this._min=i,this._max=o},n.prototype._updateNodeAndLinkScale=function(t){var e=t.getData(),n=oR(t.coordinateSystem,t);e.eachItemGraphicEl(function(t,e){t.setSymbolScale(n)})},n.prototype.dispose=function(){this._controller&&this._controller.dispose()},n.prototype.remove=function(){this._mainGroup.removeAll(),this._data=null},n.type=Ck,n}(l_);function Ek(t,e){var n=t.getItemLayout(e);return n&&!isNaN(n.x)&&!isNaN(n.y)}function Ok(t,e,n,r,i){var o=!n,a=t.tree.getNodeByDataIndex(e),s=a.getModel(),l=a.getVisual("style").fill,u=!1===a.isExpand&&0!==a.children.length?l:om.color.neutral00,h=t.tree.root,c=a.parentNode===h?a:a.parentNode||a,d=t.getItemGraphicEl(c.dataIndex),p=c.getLayout(),f=d?{x:d.__oldX,y:d.__oldY,rawX:d.__radialOldRawX,rawY:d.__radialOldRawY}:p,g=a.getLayout();o?((n=new UA(t,e,null,{symbolInnerColor:u,useNameLabel:!0})).x=f.x,n.y=f.y):n.updateData(t,e,null,{symbolInnerColor:u,useNameLabel:!0}),n.__radialOldRawX=n.__radialRawX,n.__radialOldRawY=n.__radialRawY,n.__radialRawX=g.rawX,n.__radialRawY=g.rawY,r.add(n),t.setItemGraphicEl(e,n),n.__oldX=n.x,n.__oldY=n.y,Xd(n,{x:g.x,y:g.y},i);var m=n.getSymbolPath();if("radial"===i.get("layout")){var v=h.children[0],y=v.getLayout(),_=v.children.length,x=void 0,b=void 0;if(g.x===y.x&&!0===a.isExpand&&v.children.length){var w={x:(v.children[0].getLayout().x+v.children[_-1].getLayout().x)/2,y:(v.children[0].getLayout().y+v.children[_-1].getLayout().y)/2};(x=Math.atan2(w.y-y.y,w.x-y.x))<0&&(x=2*Math.PI+x),(b=w.x<y.x)&&(x-=Math.PI)}else(x=Math.atan2(g.y-y.y,g.x-y.x))<0&&(x=2*Math.PI+x),0===a.children.length||0!==a.children.length&&!1===a.isExpand?(b=g.x<y.x)&&(x-=Math.PI):(b=g.x>y.x)||(x-=Math.PI);var S=b?"left":"right",T=s.getModel("label"),M=T.get("rotate"),C=M*(Math.PI/180),I=m.getTextContent();I&&(m.setTextConfig({position:T.get("position")||S,rotation:null==M?-x:C,origin:"center"}),I.setStyle("verticalAlign","middle"))}var A=s.get(["emphasis","focus"]),D="relative"===A?_t(a.getAncestorsIndices(),a.getDescendantIndices()):"ancestor"===A?a.getAncestorsIndices():"descendant"===A?a.getDescendantIndices():null;D&&($u(n).focus=D),function(t,e,n,r,i,o,a,s){var l=e.getModel(),u=t.get("edgeShape"),h=t.get("layout"),c=t.getOrient(),d=t.get(["lineStyle","curveness"]),p=t.get("edgeForkPosition"),f=l.getModel("lineStyle").getLineStyle(),g=r.__edge;if("curve"===u)e.parentNode&&e.parentNode!==n&&(g||(g=r.__edge=new _d({shape:zk(h,c,d,i,i)})),Xd(g,{shape:zk(h,c,d,o,a)},t));else if("polyline"===u){if("orthogonal"!==h)throw new Error("The polyline edgeShape can only be used in orthogonal layout");if(e!==n&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var m=e.children,v=[],y=0;y<m.length;y++){var _=m[y].getLayout();v.push([_.x,_.y])}g||(g=r.__edge=new Lk({shape:{parentPoint:[a.x,a.y],childPoints:[[a.x,a.y]],orient:c,forkPosition:p}})),Xd(g,{shape:{parentPoint:[a.x,a.y],childPoints:v}},t)}}g&&("polyline"!==u||e.isExpand)&&(g.useStyle(E({strokeNoScale:!0,fill:null},f)),lc(g,l,"lineStyle"),Gh(g),s.add(g))}(i,a,h,n,f,p,g,r),n.__edge&&(n.onHoverStateChange=function(e){if("blur"!==e){var r=a.parentNode&&t.getItemGraphicEl(a.parentNode.dataIndex);r&&1===r.hoverState||Vh(n.__edge,e)}})}function Nk(t,e,n,r,i){var o=Rk(e.tree.root,t),a=o.source,s=o.sourceLayout,l=e.getItemGraphicEl(t.dataIndex);if(l){var u=e.getItemGraphicEl(a.dataIndex).__edge,h=l.__edge||(!1===a.isExpand||1===a.children.length?u:void 0),c=r.get("edgeShape"),d=r.get("layout"),p=r.get("orient"),f=r.get(["lineStyle","curveness"]);h&&("curve"===c?Yd(h,{shape:zk(d,p,f,s,s),style:{opacity:0}},r,{cb:function(){n.remove(h)},removeOpt:i}):"polyline"===c&&"orthogonal"===r.get("layout")&&Yd(h,{shape:{parentPoint:[s.x,s.y],childPoints:[[s.x,s.y]]},style:{opacity:0}},r,{cb:function(){n.remove(h)},removeOpt:i}))}}function Rk(t,e){for(var n,r=e.parentNode===t?e:e.parentNode||e;null==(n=r.getLayout());)r=r.parentNode===t?r:r.parentNode||r;return{source:r,sourceLayout:n}}function kk(t,e,n,r,i){var o=t.tree.getNodeByDataIndex(e),a=Rk(t.tree.root,o).sourceLayout,s={duration:i.get("animationDurationUpdate"),easing:i.get("animationEasingUpdate")};Yd(n,{x:a.x+1,y:a.y+1},i,{cb:function(){r.remove(n),t.setItemGraphicEl(e,null)},removeOpt:s}),n.fadeOut(null,t.hostModel,{fadeLabel:!0,animation:s}),B(o.children,function(e){Nk(e,t,r,i,s)}),Nk(o,t,r,i,s)}function zk(t,e,n,r,i){var o,a,s,l,u,h,c,d;if("radial"===t){u=r.rawX,c=r.rawY,h=i.rawX,d=i.rawY;var p=ik(u,c),f=ik(u,c+(d-c)*n),g=ik(h,d+(c-d)*n),m=ik(h,d);return{x1:p.x||0,y1:p.y||0,x2:m.x||0,y2:m.y||0,cpx1:f.x||0,cpy1:f.y||0,cpx2:g.x||0,cpy2:g.y||0}}return u=r.x,c=r.y,h=i.x,d=i.y,"LR"!==e&&"RL"!==e||(o=u+(h-u)*n,a=c,s=h+(u-h)*n,l=d),"TB"!==e&&"BT"!==e||(o=u,a=c+(d-c)*n,s=h,l=d+(c-d)*n),{x1:u,y1:c,x2:h,y2:d,cpx1:o,cpy1:a,cpx2:s,cpy2:l}}var Bk=Pk;function Vk(t,e){for(var n,r=[t];n=r.pop();)if(e(n),n.isExpand){var i=n.children;if(i.length)for(var o=i.length-1;o>=0;o--)r.push(i[o])}}function Fk(t,e){t.eachSeriesByType("tree",function(t){!function(t,e){var n=jg(t,e).refContainer,r=Ug(t.getBoxLayoutParams(),n);t.layoutInfo=r;var i=t.get("layout"),o=0,a=0,s=null;"radial"===i?(o=2*Math.PI,a=Math.min(r.height,r.width)/2,s=rk(function(t,e){return(t.parentNode===e.parentNode?1:2)/t.depth})):(o=r.width,a=r.height,s=rk());var l=t.getData().tree.root,u=l.children[0];if(u){!function(t){var e=t;e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var n,r,i=[e];n=i.pop();)if(r=n.children,n.isExpand&&r.length)for(var o=r.length-1;o>=0;o--){var a=r[o];a.hierNode={defaultAncestor:null,ancestor:a,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},i.push(a)}}(l),function(t,e,n){for(var r,i=[t],o=[];r=i.pop();)if(o.push(r),r.isExpand){var a=r.children;if(a.length)for(var s=0;s<a.length;s++)i.push(a[s])}for(;r=o.pop();)e(r,n)}(u,ek,s),l.hierNode.modifier=-u.hierNode.prelim,Vk(u,nk);var h=u,c=u,d=u;Vk(u,function(t){var e=t.getLayout().x;e<h.getLayout().x&&(h=t),e>c.getLayout().x&&(c=t),t.depth>d.depth&&(d=t)});var p=h===c?1:s(h,c)/2,f=p-h.getLayout().x,g=0,m=0,v=0,y=0;if("radial"===i)g=o/(c.getLayout().x+p+f),m=a/(d.depth-1||1),Vk(u,function(t){v=(t.getLayout().x+f)*g,y=(t.depth-1)*m;var e=ik(v,y);t.setLayout({x:e.x,y:e.y,rawX:v,rawY:y},!0)});else{var _=t.getOrient();"RL"===_||"LR"===_?(m=a/(c.getLayout().x+p+f),g=o/(d.depth-1||1),Vk(u,function(t){y=(t.getLayout().x+f)*m,v="LR"===_?(t.depth-1)*g:o-(t.depth-1)*g,t.setLayout({x:v,y:y},!0)})):"TB"!==_&&"BT"!==_||(g=o/(c.getLayout().x+p+f),m=a/(d.depth-1||1),Vk(u,function(t){v=(t.getLayout().x+f)*g,y="TB"===_?(t.depth-1)*m:a-(t.depth-1)*m,t.setLayout({x:v,y:y},!0)}))}}}(t,e)})}var Gk=Cs(Ck,function(t){t.eachSeriesByType(Ck,function(t){var e=t.getData();e.tree.eachNode(function(t){var n=t.getModel().getModel("itemStyle").getItemStyle();L(e.ensureUniqueItemVisual(t.dataIndex,"style"),n)})})});var Hk=["treemapZoomToNode","treemapRender","treemapMove"];function Uk(t){var e=t.getData().tree,n={};e.eachNode(function(e){for(var r=e;r&&r.depth>1;)r=r.parentNode;var i=Im(t.ecModel,r.name||r.dataIndex+"",n);e.setVisual("decal",i)})}var Wk=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.preventUsingHoverLayer=!0,e}return e(n,t),n.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};Xk(n);var r=t.levels||[],i=this.designatedVisualItemStyle={},o=new xf({itemStyle:i},this,e);r=t.levels=function(t,e){var n,r,i=Ba(e.get("color")),o=Ba(e.get(["aria","decal","decals"]));if(!i)return;t=t||[],B(t,function(t){var e=new xf(t),i=e.get("color"),o=e.get("decal");(e.get(["itemStyle","color"])||i&&"none"!==i)&&(n=!0),(e.get(["itemStyle","decal"])||o&&"none"!==o)&&(r=!0)});var a=t[0]||(t[0]={});n||(a.color=i.slice());!r&&o&&(a.decal=o.slice());return t}(r,e);var a=V(r||[],function(t){return new xf(t,o,e)},this),s=bk.createTree(n,this,function(t){t.wrapMethod("getItemModel",function(t,e){var n=s.getNodeByDataIndex(e),r=n?a[n.depth]:null;return t.parentModel=r||o,t})});return s.data},n.prototype.optionUpdated=function(){this.resetViewRoot()},n.prototype.formatTooltip=function(t,e,n){var r=this.getData(),i=this.getRawValue(t);return Cy("nameValue",{name:r.getName(t),value:i})},n.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(e);return n.treeAncestors=Mk(r,this),n.treePathInfo=n.treeAncestors,n},n.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},L(this.layoutInfo,t)},n.prototype.mapIdToIndex=function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=yt(),this._idIndexMapCount=0);var n=e.get(t);return null==n&&e.set(t,n=this._idIndexMapCount++),n},n.prototype.getViewRoot=function(){return this._viewRoot},n.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},n.prototype.enableAriaDecal=function(){Uk(this)},n.type="series.treemap",n.layoutMode="box",n.defaultOption={progressive:0,coordinateSystemUsage:"box",left:om.size.l,top:om.size.xxxl,right:om.size.l,bottom:om.size.xxxl,sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,scaleLimit:{max:5,min:.2},roam:!0,roamTrigger:"global",nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",bottom:om.size.m,emptyItemWidth:25,itemStyle:{color:om.color.backgroundShade,textStyle:{color:om.color.secondary}},emphasis:{itemStyle:{color:om.color.background}}},label:{show:!0,distance:0,padding:5,position:"inside",color:om.color.neutral00,overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:om.color.neutral00,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},n}(Ky);function Xk(t){var e=0;B(t.children,function(t){Xk(t);var n=t.value;j(n)&&(n=n[0]),e+=n});var n=t.value;j(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),j(t.value)?t.value[0]=n:t.value=n}var jk=Wk,Zk=function(){function t(t){this.group=new Do,t.add(this.group)}return t.prototype.render=function(t,e,n,r){var i=t.getModel("breadcrumb"),o=this.group;if(o.removeAll(),i.get("show")&&n){var a=i.getModel("itemStyle"),s=i.getModel("emphasis"),l=a.getModel("textStyle"),u=s.getModel(["itemStyle","textStyle"]),h=jg(t,e).refContainer,c={left:i.get("left"),right:i.get("right"),top:i.get("top"),bottom:i.get("bottom")},d={emptyItemWidth:i.get("emptyItemWidth"),totalWidth:0,renderList:[]},p=Ug(c,h);this._prepare(n,d,l),this._renderContent(t,d,p,a,s,l,u,r),Zg(o,c,h)}},t.prototype._prepare=function(t,e,n){for(var r=t;r;r=r.parentNode){var i=ja(r.getModel().get("name"),""),o=n.getTextRect(i),a=Math.max(o.width+16,e.emptyItemWidth);e.totalWidth+=a+8,e.renderList.push({node:r,text:i,width:a})}},t.prototype._renderContent=function(t,e,n,r,i,o,a,s){for(var l=0,u=e.emptyItemWidth,h=t.get(["breadcrumb","height"]),c=e.totalWidth,d=e.renderList,p=i.getModel("itemStyle").getItemStyle(),f=d.length-1;f>=0;f--){var g=d[f],m=g.node,v=g.width,y=g.text;c>n.width&&(c-=v-u,v=u,y=null);var _=new sd({shape:{points:Yk(l,0,v,h,f===d.length-1,0===f)},style:E(r.getItemStyle(),{lineJoin:"bevel"}),textContent:new Qu({style:Yp(o,{text:y})}),textConfig:{position:"inside"},z2:1e5,onclick:X(s,m)});_.disableLabelAnimation=!0,_.getTextContent().ensureState("emphasis").style=Yp(a,{text:y}),_.ensureState("emphasis").style=p,ic(_,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(_),qk(_,t,m),l+=v+8}},t.prototype.remove=function(){this.group.removeAll()},t}();function Yk(t,e,n,r,i,o){var a=[[i?t:t-5,e],[t+n,e],[t+n,e+r],[i?t:t-5,e+r]];return!o&&a.splice(2,0,[t+n+5,e+r/2]),!i&&a.push([t,e+r/2]),a}function qk(t,e,n){$u(t).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&Mk(n,e)}}var Kk=Zk,Jk=function(){function t(){this._storage=[],this._elExistsMap={}}return t.prototype.add=function(t,e,n,r,i){return!this._elExistsMap[t.id]&&(this._elExistsMap[t.id]=!0,this._storage.push({el:t,target:e,duration:n,delay:r,easing:i}),!0)},t.prototype.finished=function(t){return this._finishedCallback=t,this},t.prototype.start=function(){for(var t=this,e=this._storage.length,n=function(){--e<=0&&(t._storage.length=0,t._elExistsMap={},t._finishedCallback&&t._finishedCallback())},r=0,i=this._storage.length;r<i;r++){var o=this._storage[r];o.el.animateTo(o.target,{duration:o.duration,delay:o.delay,easing:o.easing,setToFinal:!0,done:n,aborted:n})}return this},t}();var Qk=Math.max,$k=Math.min,tz=B,ez=["itemStyle","borderWidth"],nz=["itemStyle","gapWidth"],rz=["upperLabel","show"],iz=["upperLabel","height"],oz={seriesType:"treemap",reset:function(t,e,n,r){var i=t.option,o=jg(t,n).refContainer,a=Ug(t.getBoxLayoutParams(),o),s=r&&r.type,l=wk(r,["treemapZoomToNode","treemapRootToNode"],t),u="treemapRender"===s||"treemapMove"===s?r.rootRect:null,h=t.getViewRoot(),c=Sk(h);if("treemapMove"!==s){var d=!1,p="treemapZoomToNode"===s?(d=!0,function(t,e,n,r){var i,o=(e||{}).node,a=r.width,s=r.height,l=L({},r);if(!o||o===n)return l;var u=a*s,h=u*t.option.zoomToNodeRatio;for(;i=o.parentNode;){for(var c=0,d=i.children,p=0,f=d.length;p<f;p++)c+=d[p].getValue();var g=o.getValue();if(0===g)return l;h*=c/g;var m=i.getModel(),v=m.get(ez);(h+=4*v*v+(3*v+Math.max(v,hz(m)))*Math.pow(h,.5))>ua&&(h=ua),o=i}h<u&&(h=u);var y=Math.pow(h/u,.5);return{width:a*y,height:s*y}}(t,l,h,a)):u?(d=!0,L({},u)):L({},a);if(d){var f=cz(a,p);f=dz(f,t),p.width=a.width*f,p.height=a.height*f}var g=i.sort;g&&"asc"!==g&&"desc"!==g&&(g="desc");var m={squareRatio:i.squareRatio,sort:g,leafDepth:i.leafDepth};h.hostTree.clearLayouts();var v={x:0,y:0,width:p.width,height:p.height,area:p.width*p.height};h.setLayout(v),az(h,m,!1,0),v=h.getLayout(),tz(c,function(t,e){var n=(c[e+1]||h).getValue();t.setLayout(L({dataExtent:[n,n],borderWidth:0,upperHeight:0},v))})}var y=t.getData().tree.root;y.setLayout(function(t,e,n){if(e)return{x:e.x,y:e.y};var r={x:0,y:0};if(!n)return r;var i=n.node,o=i.getLayout();if(!o)return r;var a=[o.width/2,o.height/2],s=i;for(;s;){var l=s.getLayout();a[0]+=l.x,a[1]+=l.y,s=s.parentNode}return{x:t.width/2-a[0],y:t.height/2-a[1]}}(a,u,l),!0),t.setLayoutInfo(a),uz(y,new ln(-a.x,-a.y,n.getWidth(),n.getHeight()),c,h,0)}};function az(t,e,n,r){var i,o;if(!t.isRemoved()){var a=t.getLayout();i=a.width,o=a.height;var s=t.getModel(),l=s.get(ez),u=s.get(nz)/2,h=hz(s),c=Math.max(l,h),d=l-u,p=c-u;t.setLayout({borderWidth:l,upperHeight:c,upperLabelHeight:h},!0);var f=(i=Qk(i-2*d,0))*(o=Qk(o-d-p,0)),g=function(t,e,n,r,i,o){var a=t.children||[],s=r.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=r.leafDepth&&r.leafDepth<=o;if(i&&!l)return t.viewChildren=[];a=G(a,function(t){return!t.isRemoved()}),function(t,e){e&&t.sort(function(t,n){var r="asc"===e?t.getValue()-n.getValue():n.getValue()-t.getValue();return 0===r?"asc"===e?t.dataIndex-n.dataIndex:n.dataIndex-t.dataIndex:r})}(a,s);var u=function(t,e,n){for(var r=0,i=0,o=e.length;i<o;i++)r+=e[i].getValue();var a,s=t.get("visualDimension");e&&e.length?"value"===s&&n?(a=[e[e.length-1].getValue(),e[0].getValue()],"asc"===n&&a.reverse()):(a=[1/0,-1/0],tz(e,function(t){var e=t.getValue(s);e<a[0]&&(a[0]=e),e>a[1]&&(a[1]=e)})):a=[NaN,NaN];return{sum:r,dataExtent:a}}(e,a,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=function(t,e,n,r,i){if(!r)return n;for(var o=t.get("visibleMin"),a=i.length,s=a,l=a-1;l>=0;l--){var u=i["asc"===r?a-l-1:l].getValue();u/n*e<o&&(s=l,n-=u)}return"asc"===r?i.splice(0,a-s):i.splice(s,a-s),n}(e,n,u.sum,s,a),0===u.sum)return t.viewChildren=[];for(var h=0,c=a.length;h<c;h++){var d=a[h].getValue()/u.sum*n;a[h].setLayout({area:d})}l&&(a.length&&t.setLayout({isLeafRoot:!0},!0),a.length=0);return t.viewChildren=a,t.setLayout({dataExtent:u.dataExtent},!0),a}(t,s,f,e,n,r);if(g.length){var m={x:d,y:p,width:i,height:o},v=$k(i,o),y=1/0,_=[];_.area=0;for(var x=0,b=g.length;x<b;){var w=g[x];_.push(w),_.area+=w.getLayout().area;var S=sz(_,v,e.squareRatio);S<=y?(x++,y=S):(_.area-=_.pop().getLayout().area,lz(_,v,m,u,!1),v=$k(m.width,m.height),_.length=_.area=0,y=1/0)}if(_.length&&lz(_,v,m,u,!0),!n){var T=s.get("childrenVisibleMin");null!=T&&f<T&&(n=!0)}for(x=0,b=g.length;x<b;x++)az(g[x],e,n,r+1)}}}function sz(t,e,n){for(var r=0,i=1/0,o=0,a=void 0,s=t.length;o<s;o++)(a=t[o].getLayout().area)&&(a<i&&(i=a),a>r&&(r=a));var l=t.area*t.area,u=e*e*n;return l?Qk(u*r/l,l/(u*i)):1/0}function lz(t,e,n,r,i){var o=e===n.width?0:1,a=1-o,s=["x","y"],l=["width","height"],u=n[s[o]],h=e?t.area/e:0;(i||h>n[l[a]])&&(h=n[l[a]]);for(var c=0,d=t.length;c<d;c++){var p=t[c],f={},g=h?p.getLayout().area/h:0,m=f[l[a]]=Qk(h-2*r,0),v=n[s[o]]+n[l[o]]-u,y=c===d-1||v<g?v:g,_=f[l[o]]=Qk(y-2*r,0);f[s[a]]=n[s[a]]+$k(r,m/2),f[s[o]]=u+$k(r,_/2),u+=y,p.setLayout(f,!0)}n[s[a]]+=h,n[l[a]]-=h}function uz(t,e,n,r,i){var o=t.getLayout(),a=n[i],s=a&&a===t;if(!(a&&!s||i===n.length&&t!==r)){t.setLayout({isInView:!0,invisible:!s&&!e.intersect(o),isAboveViewRoot:s},!0);var l=new ln(e.x-o.x,e.y-o.y,e.width,e.height);tz(t.viewChildren||[],function(t){uz(t,l,n,r,i+1)})}}function hz(t){return t.get(rz)?t.get(iz):0}function cz(t,e){return e.width/t.width||e.height/t.height||1}function dz(t,e){return iR(t,e.get("scaleLimit",!0))}var pz=Do,fz=Ru,gz="label",mz="upperLabel",vz=zs([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),yz=function(t){var e=vz(t);return e.stroke=e.fill=e.lineWidth=null,e},_z=Qa(),xz=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._state="ready",e._storage={nodeGroup:[],background:[],content:[]},e}return e(n,t),n.prototype.render=function(t,e,n,r){if(!(N(e.findComponents({mainType:"series",subType:"treemap",query:r}),t)<0)){this.seriesModel=t,this.api=n,this.ecModel=e;var i=wk(r,["treemapZoomToNode","treemapRootToNode"],t),o=r&&r.type,a=t.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===o&&i&&l?{rootNodeGroup:l.nodeGroup[i.node.getRawIndex()],direction:r.direction}:null,h=this._giveContainerGroup(a),c=t.get("animation"),d=this._doRender(h,t,u);!c||s||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?d.renderFinally():this._doAnimation(h,d,t,u),this._resetController(n),this._renderBreadcrumb(t,n,i)}},n.prototype._giveContainerGroup=function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new pz,this._initEvents(e),this.group.add(e)),e.x=t.x,e.y=t.y,e},n.prototype._doRender=function(t,e,n){var r=e.getData().tree,i=this._oldTree,o={nodeGroup:[],background:[],content:[]},a={nodeGroup:[],background:[],content:[]},s=this._storage,l=[];function u(t,r,i,u){return function(t,e,n,r,i,o,a,s,l,u){if(!a)return;var h=a.getLayout(),c=t.getData(),d=a.getModel();if(c.setItemGraphicEl(a.dataIndex,null),!h||!h.isInView)return;var p=h.width,f=h.height,g=h.borderWidth,m=h.invisible,v=a.getRawIndex(),y=s&&s.getRawIndex(),_=a.viewChildren,x=h.upperHeight,b=_&&_.length,w=d.getModel("itemStyle"),S=d.getModel(["emphasis","itemStyle"]),T=d.getModel(["blur","itemStyle"]),M=d.getModel(["select","itemStyle"]),C=w.get("borderRadius")||0,I=H("nodeGroup",pz);if(!I)return;if(l.add(I),I.x=h.x||0,I.y=h.y||0,I.markRedraw(),_z(I).nodeWidth=p,_z(I).nodeHeight=f,h.isAboveViewRoot)return I;var A=H("background",fz,u,20);A&&z(I,A,b&&h.upperLabelHeight);var D=d.getModel("emphasis"),P=D.get("focus"),E=D.get("blurScope"),O=D.get("disabled"),N="ancestor"===P?a.getAncestorsIndices():"descendant"===P?a.getDescendantIndices():P;if(b)hc(I)&&uc(I,!1),A&&(uc(A,!O),c.setItemGraphicEl(a.dataIndex,A),oc(A,N,E));else{var R=H("content",fz,u,30);R&&B(I,R),A.disableMorphing=!0,A&&hc(A)&&uc(A,!1),uc(I,!O),c.setItemGraphicEl(a.dataIndex,I);var k=d.getShallow("cursor");k&&R.attr("cursor",k),oc(I,N,E)}return I;function z(e,n,r){var i=$u(n);if(i.dataIndex=a.dataIndex,i.seriesIndex=t.seriesIndex,n.setShape({x:0,y:0,width:p,height:f,r:C}),m)V(n);else{n.invisible=!1;var o=a.getVisual("style"),s=o.stroke,l=yz(w);l.fill=s;var u=vz(S);u.fill=S.get("borderColor");var h=vz(T);h.fill=T.get("borderColor");var c=vz(M);if(c.fill=M.get("borderColor"),r){var d=p-2*g;F(n,s,o.opacity,{x:g,y:0,width:d,height:x})}else n.removeTextContent();n.setStyle(l),n.ensureState("emphasis").style=u,n.ensureState("blur").style=h,n.ensureState("select").style=c,Gh(n)}e.add(n)}function B(e,n){var r=$u(n);r.dataIndex=a.dataIndex,r.seriesIndex=t.seriesIndex;var i=Math.max(p-2*g,0),o=Math.max(f-2*g,0);if(n.culling=!0,n.setShape({x:g,y:g,width:i,height:o,r:C}),m)V(n);else{n.invisible=!1;var s=a.getVisual("style"),l=s.fill,u=yz(w);u.fill=l,u.decal=s.decal;var h=vz(S),c=vz(T),d=vz(M);F(n,l,s.opacity,null),n.setStyle(u),n.ensureState("emphasis").style=h,n.ensureState("blur").style=c,n.ensureState("select").style=d,Gh(n)}e.add(n)}function V(t){!t.invisible&&o.push(t)}function F(e,n,r,i){var o=d.getModel(i?mz:gz),s=ja(d.get("name"),null),l=o.getShallow("show");jp(e,Zp(d,i?mz:gz),{defaultText:l?s:null,inheritColor:n,defaultOpacity:r,labelFetcher:t,labelDataIndex:a.dataIndex});var u=e.getTextContent();if(u){var c=u.style,p=ut(c.padding||0);i&&(e.setTextConfig({layoutRect:i}),u.disableLabelLayout=!0),u.beforeUpdate=function(){var t=Math.max((i?i.width:e.shape.width)-p[1]-p[3],0),n=Math.max((i?i.height:e.shape.height)-p[0]-p[2],0);c.width===t&&c.height===n||u.setStyle({width:t,height:n})},c.truncateMinChar=2,c.lineOverflow="truncate",G(c,i,h);var f=u.getState("emphasis");G(f?f.style:null,i,h)}}function G(e,n,r){var i=e?e.text:null;if(!n&&r.isLeafRoot&&null!=i){var o=t.get("drillDownIcon",!0);e.text=o?o+" "+i:i}}function H(t,r,o,a){var s=null!=y&&n[t][y],l=i[t];return s?(n[t][y]=null,U(l,s)):m||((s=new r)instanceof vl&&(s.z2=function(t,e){return 100*t+e}(o,a)),W(l,s)),e[t][v]=s}function U(t,e){var n=t[v]={};e instanceof pz?(n.oldX=e.x,n.oldY=e.y):n.oldShape=L({},e.shape)}function W(t,e){var n=t[v]={},o=a.parentNode,s=e instanceof Do;if(o&&(!r||"drillDown"===r.direction)){var l=0,u=0,h=i.background[o.getRawIndex()];!r&&h&&h.oldShape&&(l=h.oldShape.width,u=h.oldShape.height),s?(n.oldX=0,n.oldY=u):n.oldShape={x:l,y:u,width:0,height:0}}n.fadein=!s}}(e,a,s,n,o,l,t,r,i,u)}!function t(e,n,r,i,o){i?(n=e,B(e,function(t,e){!t.isRemoved()&&s(e,e)})):new Ow(n,e,a,a).add(s).update(s).remove(X(s,null)).execute();function a(t){return t.getId()}function s(a,s){var l=null!=a?e[a]:null,h=null!=s?n[s]:null,c=u(l,h,r,o);c&&t(l&&l.viewChildren||[],h&&h.viewChildren||[],c,i,o+1)}}(r.root?[r.root]:[],i&&i.root?[i.root]:[],t,r===i||!i,0);var h=function(t){var e={nodeGroup:[],background:[],content:[]};return t&&B(t,function(t,n){var r=e[n];B(t,function(t){t&&(r.push(t),_z(t).willDelete=!0)})}),e}(s);return this._oldTree=r,this._storage=a,{lastsForAnimation:o,willDeleteEls:h,renderFinally:function(){B(h,function(t){B(t,function(t){t.parent&&t.parent.remove(t)})}),B(l,function(t){t.invisible=!0,t.dirty()})}}},n.prototype._doAnimation=function(t,e,n,r){var i=n.get("animationDurationUpdate"),o=n.get("animationEasing"),a=(Z(i)?0:i)||0,s=(Z(o)?null:o)||"cubicOut",l=new Jk;B(e.willDeleteEls,function(t,e){B(t,function(t,n){if(!t.invisible){var i,o=t.parent,u=_z(o);if(r&&"drillDown"===r.direction)i=o===r.rootNodeGroup?{shape:{x:0,y:0,width:u.nodeWidth,height:u.nodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var h=0,c=0;u.willDelete||(h=u.nodeWidth/2,c=u.nodeHeight/2),i="nodeGroup"===e?{x:h,y:c,style:{opacity:0}}:{shape:{x:h,y:c,width:0,height:0},style:{opacity:0}}}i&&l.add(t,i,a,0,s)}})}),B(this._storage,function(t,n){B(t,function(t,r){var i=e.lastsForAnimation[n][r],o={};i&&(t instanceof Do?null!=i.oldX&&(o.x=t.x,o.y=t.y,t.x=i.oldX,t.y=i.oldY):(i.oldShape&&(o.shape=L({},t.shape),t.setShape(i.oldShape)),i.fadein?(t.setStyle("opacity",0),o.style={opacity:1}):1!==t.style.opacity&&(o.style={opacity:1})),l.add(t,o,a,0,s))})},this),this._state="animating",l.finished(W(function(){this._state="ready",e.renderFinally()},this)).start()},n.prototype._resetController=function(t){var e=this,n=this.seriesModel,r=this._controller;r||((r=this._controller=new kO(t.getZr())).on("pan",W(this._onPan,this)),r.on("zoom",W(this._onZoom,this))),r.enable(n.get("roam"),{api:t,zInfo:{component:n},triggerInfo:{roamTrigger:n.get("roamTrigger"),isInSelf:function(t,n,r){var i=e._containerGroup;return!!i&&i.getBoundingRect().contain(n-i.x,r-i.y)}}})},n.prototype._clearController=function(){var t=this._controller;t&&(t.dispose(),t=null)},n.prototype._onPan=function(t){if("animating"!==this._state&&(Math.abs(t.dx)>3||Math.abs(t.dy)>3)){var e=this.seriesModel.getData().tree.root;if(!e)return;var n=e.getLayout();if(!n)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+t.dx,y:n.y+t.dy,width:n.width,height:n.height}})}},n.prototype._onZoom=function(t){var e=t.originX,n=t.originY,r=t.scale,i=this.seriesModel;if("animating"!==this._state){var o=i.getData().tree.root;if(!o)return;var a=o.getLayout();if(!a)return;var s=new ln(a.x,a.y,a.width,a.height),l=i.layoutInfo,u=cz(l,a),h=u*r,c=(h=dz(h,i))/u,d=[1,0,0,1,0,0];Ae(d,d,[-(e-=l.x),-(n-=l.y)]),Le(d,d,[c,c]),Ae(d,d,[e,n]),s.applyTransform(d),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:s.x,y:s.y,width:s.width,height:s.height}})}},n.prototype._initEvents=function(t){var e=this;t.on("click",function(t){if("ready"===e._state){var n=e.seriesModel.get("nodeClick",!0);if(n){var r=e.findTarget(t.offsetX,t.offsetY);if(r){var i=r.node;if(i.getLayout().isLeafRoot)e._rootToNode(r);else if("zoomToNode"===n)e._zoomToNode(r);else if("link"===n){var o=i.hostTree.data.getItemModel(i.dataIndex),a=o.get("link",!0),s=o.get("target",!0)||"blank";a&&Cg(a,s)}}}}},this)},n.prototype._renderBreadcrumb=function(t,e,n){var r=this;n||(n=null!=t.get("leafDepth",!0)?{node:t.getViewRoot()}:this.findTarget(e.getWidth()/2,e.getHeight()/2))||(n={node:t.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new Kk(this.group))).render(t,e,n.node,function(e){"animating"!==r._state&&(Tk(t.getViewRoot(),e)?r._rootToNode({node:e}):r._zoomToNode({node:e}))})},n.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},n.prototype.dispose=function(){this._clearController()},n.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},n.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},n.prototype.findTarget=function(t,e){var n;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},function(r){var i=this._storage.background[r.getRawIndex()];if(i){var o=i.transformCoordToLocal(t,e),a=i.shape;if(!(a.x<=o[0]&&o[0]<=a.x+a.width&&a.y<=o[1]&&o[1]<=a.y+a.height))return!1;n={node:r,offsetX:o[0],offsetY:o[1]}}},this),n},n.type="treemap",n}(l_);var bz=xz,wz=B,Sz=J,Tz=-1,Mz=function(){function t(e){var n=e.mappingMethod,r=e.type,i=this.option=I(e);this.type=r,this.mappingMethod=n,this._normalizeData=Rz[n];var o=t.visualHandlers[r];this.applyVisual=o.applyVisual,this.getColorMapper=o.getColorMapper,this._normalizedToVisual=o._normalizedToVisual[n],"piecewise"===n?(Cz(i),function(t){var e=t.pieceList;t.hasSpecialVisual=!1,B(e,function(e,n){e.originIndex=n,null!=e.visual&&(t.hasSpecialVisual=!0)})}(i)):"category"===n?i.categories?function(t){var e=t.categories,n=t.categoryMap={},r=t.visual;if(wz(e,function(t,e){n[t]=e}),!j(r)){var i=[];J(r)?wz(r,function(t,e){var r=n[e];i[null!=r?r:Tz]=t}):i[-1]=r,r=Nz(t,i)}for(var o=e.length-1;o>=0;o--)null==r[o]&&(delete n[e[o]],e.pop())}(i):Cz(i,!0):(ht("linear"!==n||i.dataExtent),Cz(i))}return t.prototype.mapValueToVisual=function(t){var e=this._normalizeData(t);return this._normalizedToVisual(e,t)},t.prototype.getNormalizer=function(){return W(this._normalizeData,this)},t.listVisualTypes=function(){return U(t.visualHandlers)},t.isValidType=function(e){return t.visualHandlers.hasOwnProperty(e)},t.eachVisual=function(t,e,n){J(t)?B(t,e,n):e.call(n,t)},t.mapVisual=function(e,n,r){var i,o=j(e)?[]:J(e)?{}:(i=!0,null);return t.eachVisual(e,function(t,e){var a=n.call(r,t,e);i?o=a:o[e]=a}),o},t.retrieveVisuals=function(e){var n,r={};return e&&wz(t.visualHandlers,function(t,i){e.hasOwnProperty(i)&&(r[i]=e[i],n=!0)}),n?r:null},t.prepareVisualTypes=function(t){if(j(t))t=t.slice();else{if(!Sz(t))return[];var e=[];wz(t,function(t,n){e.push(n)}),t=e}return t.sort(function(t,e){return"color"===e&&"color"!==t&&0===t.indexOf("color")?1:-1}),t},t.dependsOn=function(t,e){return"color"===e?!(!t||0!==t.indexOf(e)):t===e},t.findPieceIndex=function(t,e,n){for(var r,i=1/0,o=0,a=e.length;o<a;o++){var s=e[o].value;if(null!=s){if(s===t||Y(s)&&s===t+"")return o;n&&c(s,o)}}for(o=0,a=e.length;o<a;o++){var l=e[o],u=l.interval,h=l.close;if(u){if(u[0]===-1/0){if(kz(h[1],t,u[1]))return o}else if(u[1]===1/0){if(kz(h[0],u[0],t))return o}else if(kz(h[0],u[0],t)&&kz(h[1],t,u[1]))return o;n&&c(u[0],o),n&&c(u[1],o)}}if(n)return t===1/0?e.length-1:t===-1/0?0:r;function c(e,n){var o=Math.abs(e-t);o<i&&(i=o,r=n)}},t.visualHandlers={color:{applyVisual:Dz("color"),getColorMapper:function(){var t=this.option;return W("category"===t.mappingMethod?function(t,e){return!e&&(t=this._normalizeData(t)),Lz.call(this,t)}:function(e,n,r){var i=!!r;return!n&&(e=this._normalizeData(e)),r=Cr(e,t.parsedVisual,r),i?r:Er(r,"rgba")},this)},_normalizedToVisual:{linear:function(t){return Er(Cr(t,this.option.parsedVisual),"rgba")},category:Lz,piecewise:function(t,e){var n=Oz.call(this,e);return null==n&&(n=Er(Cr(t,this.option.parsedVisual),"rgba")),n},fixed:Pz}},colorHue:Iz(function(t,e){return Lr(t,e)}),colorSaturation:Iz(function(t,e){return Lr(t,null,e)}),colorLightness:Iz(function(t,e){return Lr(t,null,null,e)}),colorAlpha:Iz(function(t,e){return Pr(t,e)}),decal:{applyVisual:Dz("decal"),_normalizedToVisual:{linear:null,category:Lz,piecewise:null,fixed:null}},opacity:{applyVisual:Dz("opacity"),_normalizedToVisual:Ez([0,1])},liftZ:{applyVisual:Dz("liftZ"),_normalizedToVisual:{linear:Pz,category:Pz,piecewise:Pz,fixed:Pz}},symbol:{applyVisual:function(t,e,n){n("symbol",this.mapValueToVisual(t))},_normalizedToVisual:{linear:Az,category:Lz,piecewise:function(t,e){var n=Oz.call(this,e);return null==n&&(n=Az.call(this,t)),n},fixed:Pz}},symbolSize:{applyVisual:Dz("symbolSize"),_normalizedToVisual:Ez([0,1])}},t}();function Cz(t,e){var n=t.visual,r=[];J(n)?wz(n,function(t){r.push(t)}):null!=n&&r.push(n);e||1!==r.length||{color:1,symbol:1}.hasOwnProperty(t.type)||(r[1]=r[0]),Nz(t,r)}function Iz(t){return{applyVisual:function(e,n,r){var i=this.mapValueToVisual(e);r("color",t(n("color"),i))},_normalizedToVisual:Ez([0,1])}}function Az(t){var e=this.option.visual;return e[Math.round(Jo(t,[0,1],[0,e.length-1],!0))]||{}}function Dz(t){return function(e,n,r){r(t,this.mapValueToVisual(e))}}function Lz(t){var e=this.option.visual;return e[this.option.loop&&t!==Tz?t%e.length:t]}function Pz(){return this.option.visual[0]}function Ez(t){return{linear:function(e){return Jo(e,t,this.option.visual,!0)},category:Lz,piecewise:function(e,n){var r=Oz.call(this,n);return null==r&&(r=Jo(e,t,this.option.visual,!0)),r},fixed:Pz}}function Oz(t){var e=this.option,n=e.pieceList;if(e.hasSpecialVisual){var r=n[Mz.findPieceIndex(t,n)];if(r&&r.visual)return r.visual[this.type]}}function Nz(t,e){return t.visual=e,"color"===t.type&&(t.parsedVisual=V(e,function(t){var e=Sr(t);return e||Da("'"+t+"' is an illegal color, fallback to '#000000'",!0),e||[0,0,0,1]})),e}var Rz={linear:function(t){return Jo(t,this.option.dataExtent,[0,1],!0)},piecewise:function(t){var e=this.option.pieceList,n=Mz.findPieceIndex(t,e,!0);if(null!=n)return Jo(n,[0,e.length-1],[0,1],!0)},category:function(t){var e=this.option.categories?this.option.categoryMap[t]:t;return null==e?Tz:e},fixed:St};function kz(t,e,n){return t?e<=n:e<n}var zz=Mz,Bz=Qa(),Vz={seriesType:"treemap",reset:function(t){var e=t.getData().tree.root;e.isRemoved()||Fz(e,{},t.getViewRoot().getAncestors(),t)}};function Fz(t,e,n,r){var i=t.getModel(),o=t.getLayout(),a=t.hostTree.data;if(o&&!o.invisible&&o.isInView){var s,l=i.getModel("itemStyle"),u=function(t,e,n){var r=L({},e),i=n.designatedVisualItemStyle;return B(["color","colorAlpha","colorSaturation"],function(n){i[n]=e[n];var o=t.get(n);i[n]=null,null!=o&&(r[n]=o)}),r}(l,e,r),h=a.ensureUniqueItemVisual(t.dataIndex,"style"),c=l.get("borderColor"),d=l.get("borderColorSaturation");null!=d&&(c=function(t,e){return null!=e?Lr(e,null,null,t):null}(d,s=Gz(u))),h.stroke=c;var p=t.viewChildren;if(p&&p.length){var f=function(t,e,n,r,i,o){if(!o||!o.length)return;var a=Uz(e,"color")||null!=i.color&&"none"!==i.color&&(Uz(e,"colorAlpha")||Uz(e,"colorSaturation"));if(!a)return;var s=e.get("visualMin"),l=e.get("visualMax"),u=n.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:a.name,dataExtent:u,visual:a.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new zz(c);return Bz(d).drColorMappingBy=h,d}(0,i,o,0,u,p);B(p,function(t,e){if(t.depth>=n.length||t===n[t.depth]){var o=function(t,e,n,r,i,o){var a=L({},e);if(i){var s=i.type,l="color"===s&&Bz(i).drColorMappingBy,u="index"===l?r:"id"===l?o.mapIdToIndex(n.getId()):n.getValue(t.get("visualDimension"));a[s]=i.mapValueToVisual(u)}return a}(i,u,t,e,f,r);Fz(t,o,n,r)}})}else s=Gz(u),h.fill=s}}function Gz(t){var e=Hz(t,"color");if(e){var n=Hz(t,"colorAlpha"),r=Hz(t,"colorSaturation");return r&&(e=Lr(e,null,null,r)),n&&(e=Pr(e,n)),e}}function Hz(t,e){var n=t[e];if(null!=n&&"none"!==n)return n}function Uz(t,e){var n=t.get(e);return j(n)&&n.length?{name:e,range:n}:null}function Wz(t){return"_EC_"+t}var Xz=function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[Wz(t)]){var r=new jz(t,e);return r.hostGraph=this,this.nodes.push(r),n[Wz(t)]=r,r}console.error("Graph nodes have duplicate name or id")},t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},t.prototype.getNodeById=function(t){return this._nodesMap[Wz(t)]},t.prototype.addEdge=function(t,e,n){var r=this._nodesMap,i=this._edgesMap;if(K(t)&&(t=this.nodes[t]),K(e)&&(e=this.nodes[e]),t instanceof jz||(t=r[Wz(t)]),e instanceof jz||(e=r[Wz(e)]),t&&e){var o=t.id+"-"+e.id,a=new Zz(t,e,n);return a.hostGraph=this,this._directed&&(t.outEdges.push(a),e.inEdges.push(a)),t.edges.push(a),t!==e&&e.edges.push(a),this.edges.push(a),i[o]=a,a}},t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},t.prototype.getEdge=function(t,e){t instanceof jz&&(t=t.id),e instanceof jz&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},t.prototype.eachNode=function(t,e){for(var n=this.nodes,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&t.call(e,n[i],i)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,r=n.length,i=0;i<r;i++)n[i].dataIndex>=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&t.call(e,n[i],i)},t.prototype.breadthFirstTraverse=function(t,e,n,r){if(e instanceof jz||(e=this._nodesMap[Wz(e)]),e){for(var i="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!t.call(r,e,null))for(var a=[e];a.length;){var s=a.shift(),l=s[i];for(o=0;o<l.length;o++){var u=l[o],h=u.node1===s?u.node2:u.node1;if(!h.__visited){if(t.call(r,h,s))return;a.push(h),h.__visited=!0}}}}},t.prototype.update=function(){for(var t=this.data,e=this.edgeData,n=this.nodes,r=this.edges,i=0,o=n.length;i<o;i++)n[i].dataIndex=-1;for(i=0,o=t.count();i<o;i++)n[t.getRawIndex(i)].dataIndex=i;e.filterSelf(function(t){var n=r[e.getRawIndex(t)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0});for(i=0,o=r.length;i<o;i++)r[i].dataIndex=-1;for(i=0,o=e.count();i<o;i++)r[e.getRawIndex(i)].dataIndex=i},t.prototype.clone=function(){for(var e=new t(this._directed),n=this.nodes,r=this.edges,i=0;i<n.length;i++)e.addNode(n[i].id,n[i].dataIndex);for(i=0;i<r.length;i++){var o=r[i];e.addEdge(o.node1.id,o.node2.id,o.dataIndex)}return e},t}(),jz=function(){function t(t,e){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==t?"":t,this.dataIndex=null==e?-1:e}return t.prototype.degree=function(){return this.edges.length},t.prototype.inDegree=function(){return this.inEdges.length},t.prototype.outDegree=function(){return this.outEdges.length},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){for(var t={edge:[],node:[]},e=0;e<this.edges.length;e++){var n=this.edges[e];n.dataIndex<0||(t.edge.push(n.dataIndex),t.node.push(n.node1.dataIndex,n.node2.dataIndex))}return t},t.prototype.getTrajectoryDataIndices=function(){for(var t=yt(),e=yt(),n=0,r=this.edges.length;n<r;n++){var i=this.edges[n];if(!(i.dataIndex<0)){t.set(i.dataIndex,!0);for(var o=[i.node1],a=[i.node2],s=0;s<o.length;){var l=o[s];s++,e.set(l.dataIndex,!0);for(var u=l.inEdges,h=0,c=u.length,d=void 0,p=void 0;h<c;h++)(p=(d=u[h]).dataIndex)>=0&&!t.hasKey(p)&&(t.set(p,!0),o.push(d.node1))}for(s=0;s<a.length;){var f=a[s];s++,e.set(f.dataIndex,!0);for(var g=f.outEdges,m=(h=0,g.length),v=void 0,y=void 0;h<m;h++)(y=(v=g[h]).dataIndex)>=0&&!t.hasKey(y)&&(t.set(y,!0),a.push(v.node2))}}}return{edge:t.keys(),node:e.keys()}},t}(),Zz=function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=yt(),e=yt();t.set(this.dataIndex,!0);for(var n=[this.node1],r=[this.node2],i=0;i<n.length;){var o=n[i];i++,e.set(o.dataIndex,!0);for(var a=0,s=o.inEdges.length,l=void 0,u=void 0;a<s;a++)(u=(l=o.inEdges[a]).dataIndex)>=0&&!t.hasKey(u)&&(t.set(u,!0),n.push(l.node1))}for(i=0;i<r.length;){var h=r[i];i++,e.set(h.dataIndex,!0);a=0,s=h.outEdges.length;for(var c=void 0,d=void 0;a<s;a++)(d=(c=h.outEdges[a]).dataIndex)>=0&&!t.hasKey(d)&&(t.set(d,!0),r.push(c.node2))}return{edge:t.keys(),node:e.keys()}},t}();function Yz(t,e){return{getValue:function(n){var r=this[t][e];return r.getStore().get(r.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,r){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}k(jz,Yz("hostGraph","data")),k(Zz,Yz("hostGraph","edgeData"));var qz=Xz;function Kz(t,e,n,r,i){for(var o=new qz(r),a=0;a<t.length;a++)o.addNode(ot(t[a].id,t[a].name,a),a);var s=[],l=[],u=0;for(a=0;a<e.length;a++){var h=e[a],c=h.source,d=h.target;o.addEdge(c,d,u)&&(l.push(h),s.push(ot(ja(h.id,null),c+" > "+d)),u++)}var p,f=n.get("coordinateSystem");if("cartesian2d"===f||"polar"===f||"matrix"===f)p=gS(t,n);else{var g=Rg.get(f),m=g&&g.dimensions||[];N(m,"value")<0&&m.concat(["value"]);var v=sS(t,{coordDimensions:m,encodeDefine:n.getEncode()}).dimensions;(p=new oS(v,n)).initData(t)}var y=new oS(["value"],n);return y.initData(l,s),i&&i(p,y),ck({mainData:p,struct:o,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}var Jz="--\x3e",Qz=function(t){return t.get("autoCurveness")||null},$z=function(t,e){var n=Qz(t),r=20,i=[];if(K(n))r=n;else if(j(n))return void(t.__curvenessList=n);e>r&&(r=e);var o=r%2?r+2:r+3;i=[];for(var a=0;a<o;a++)i.push((a%2?a+1:a)/10*(a%2?-1:1));t.__curvenessList=i},tB=function(t,e,n){var r=[t.id,t.dataIndex].join("."),i=[e.id,e.dataIndex].join(".");return[n.uid,r,i].join(Jz)},eB=function(t){var e=t.split(Jz);return[e[0],e[2],e[1]].join(Jz)},nB=function(t,e){var n=e.__edgeMap;return n[t]?n[t].length:0};function rB(t,e,n,r){var i=Qz(e),o=j(i);if(!i)return null;var a=function(t,e){var n=tB(t.node1,t.node2,e);return e.__edgeMap[n]}(t,e);if(!a)return null;for(var s=-1,l=0;l<a.length;l++)if(a[l]===n){s=l;break}var u=function(t,e){return nB(tB(t.node1,t.node2,e),e)+nB(tB(t.node2,t.node1,e),e)}(t,e);$z(e,u),t.lineStyle=t.lineStyle||{};var h=tB(t.node1,t.node2,e),c=e.__curvenessList,d=o||u%2?0:1;if(a.isForward)return c[d+s];var p=eB(h),f=nB(p,e),g=c[s+f+d];return r?o?i&&0===i[0]?(f+d)%2?g:-g:((f%2?0:1)+d)%2?g:-g:(f+d)%2?g:-g:c[s+f+d]}var iB="graph",oB=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.init=function(e){t.prototype.init.apply(this,arguments);var n=this;function r(){return n._categoriesData}this.legendVisualProvider=new CP(r,r),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},n.prototype.mergeDefaultAndTheme=function(e){t.prototype.mergeDefaultAndTheme.apply(this,arguments),Va(e,"edgeLabel",["show"])},n.prototype.getInitialData=function(t,e){var n,r=t.edges||t.links||[],i=t.data||t.nodes||[],o=this;if(i&&r){Qz(n=this)&&(n.__curvenessList=[],n.__edgeMap={},$z(n));var a=Kz(i,r,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t){var e=o._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});var n=xf.prototype.getModel;function r(t,e){var r=n.call(this,t,e);return r.resolveParentPath=i,r}function i(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",function(t){return t.resolveParentPath=i,t.getModel=r,t})});return B(a.edges,function(t){!function(t,e,n,r){if(Qz(n)){var i=tB(t,e,n),o=n.__edgeMap,a=o[eB(i)];o[i]&&!a?o[i].isForward=!0:a&&o[i]&&(a.isForward=!0,o[i].isForward=!1),o[i]=o[i]||[],o[i].push(r)}}(t.node1,t.node2,this,t.dataIndex)},this),a.data}},n.prototype.getGraph=function(){return this.getData().graph},n.prototype.getEdgeData=function(){return this.getGraph().edgeData},n.prototype.getCategoriesData=function(){return this._categoriesData},n.prototype.formatTooltip=function(t,e,n){if("edge"===n){var r=this.getData(),i=this.getDataParams(t,n),o=r.graph.getEdgeByIndex(t),a=r.getName(o.node1.dataIndex),s=r.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),Cy("nameValue",{name:l.join(" > "),value:i.value,noValue:null==i.value})}return By({series:this,dataIndex:t,multipleSeries:e})},n.prototype._updateCategoriesData=function(){var t=V(this.option.categories||[],function(t){return null!=t.value?t:L({value:0},t)}),e=new oS(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t)})},n.prototype.isAnimationEnabled=function(){return t.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},n.prototype.__ownRoamView=function(){var t=this.coordinateSystem;return XN(t)&&t},n.type="series."+iB,n.dependencies=["grid","polar","geo","singleAxis","calendar"],n.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:om.color.neutral50,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:om.color.primary}}},n}(Ky),aB=oB;function sB(t){return t instanceof Array||(t=[t,t]),t}var lB=Cs(iB,function(t){t.eachSeriesByType(iB,function(t){var e=t.getGraph(),n=t.getEdgeData(),r=sB(t.get("edgeSymbol")),i=sB(t.get("edgeSymbolSize"));n.setVisual("fromSymbol",r&&r[0]),n.setVisual("toSymbol",r&&r[1]),n.setVisual("fromSymbolSize",i&&i[0]),n.setVisual("toSymbolSize",i&&i[1]),n.setVisual("style",t.getModel("lineStyle").getLineStyle()),n.each(function(t){var r=n.getItemModel(t),i=e.getEdgeByIndex(t),o=sB(r.getShallow("symbol",!0)),a=sB(r.getShallow("symbolSize",!0)),s=r.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(t,"style");switch(L(l,s),l.stroke){case"source":var u=i.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=i.node2.getVisual("style");l.stroke=u&&u.fill}o[0]&&i.setVisual("fromSymbol",o[0]),o[1]&&i.setVisual("toSymbol",o[1]),a[0]&&i.setVisual("fromSymbolSize",a[0]),a[1]&&i.setVisual("toSymbolSize",a[1])})})});function uB(t){var e=t.coordinateSystem;if(!e||"view"===e.type){var n=t.getGraph();n.eachNode(function(t){var e=t.getModel();t.setLayout([+e.get("x"),+e.get("y")])}),hB(n,t)}}function hB(t,e){t.eachEdge(function(t,n){var r=st(t.getModel().get(["lineStyle","curveness"]),-rB(t,e,n,!0),0),i=Dt(t.node1.getLayout()),o=Dt(t.node2.getLayout()),a=[i,o];+r&&a.push([(i[0]+o[0])/2-(i[1]-o[1])*r,(i[1]+o[1])/2-(o[0]-i[0])*r]),t.setLayout(a)})}var cB=Cs(iB,function(t,e){t.eachSeriesByType(iB,function(t){var e=t.get("layout"),n=t.coordinateSystem;if(n&&"view"!==n.type){var r=t.getData(),i=[];B(n.dimensions,function(t){i=i.concat(r.mapDimensionsAll(t))});for(var o=0;o<r.count();o++){for(var a=[],s=!1,l=0;l<i.length;l++){var u=r.get(i[l],o);isNaN(u)||(s=!0),a.push(u)}s?r.setItemLayout(o,n.dataToPoint(a)):r.setItemLayout(o,[NaN,NaN])}hB(r.graph,t)}else e&&"none"!==e||uB(t)})});function dB(t){var e=t.coordinateSystem;return XN(e)?oR(e,t):1}function pB(t){var e=t.getVisual("symbolSize");return e instanceof Array&&(e=(e[0]+e[1])/2),+e}var fB=Math.PI,gB=[];function mB(t,e,n,r){var i=t.coordinateSystem;if(!i||"view"===i.type){var o=i.getBoundingRect(),a=t.getData(),s=a.graph,l=o.width/2+o.x,u=o.height/2+o.y,h=Math.min(o.width,o.height)/2,c=a.count();if(a.setLayout({cx:l,cy:u}),c){if(n){var d=i.pointToData(r),p=d[0],f=d[1],g=[p-l,f-u];Vt(g,g),Bt(g,g,h),n.setLayout([l+g[0],u+g[1]],!0),yB(n,t.get(["circular","rotateLabel"]),l,u)}vB[e](t,s,a,h,l,u,c),s.eachEdge(function(e,n){var r,i=st(e.getModel().get(["lineStyle","curveness"]),rB(e,t,n),0),o=Dt(e.node1.getLayout()),a=Dt(e.node2.getLayout()),s=(o[0]+a[0])/2,h=(o[1]+a[1])/2;+i&&(r=[l*(i*=3)+s*(1-i),u*i+h*(1-i)]),e.setLayout([o,a,r])})}}}var vB={value:function(t,e,n,r,i,o,a){var s=0,l=n.getSum("value"),u=2*Math.PI/(l||a);e.eachNode(function(t){var e=t.getValue("value"),n=u*(l?e:1)/2;s+=n,t.setLayout([r*Math.cos(s)+i,r*Math.sin(s)+o]),s+=n})},symbolSize:function(t,e,n,r,i,o,a){var s=0;gB.length=a;var l=dB(t);e.eachNode(function(t){var e=pB(t);isNaN(e)&&(e=2),e<0&&(e=0),e*=l;var n=Math.asin(e/2/r);isNaN(n)&&(n=fB/2),gB[t.dataIndex]=n,s+=2*n});var u=(2*fB-s)/a/2,h=0;e.eachNode(function(t){var e=u+gB[t.dataIndex];h+=e,(!t.getLayout()||!t.getLayout().fixed)&&t.setLayout([r*Math.cos(h)+i,r*Math.sin(h)+o]),h+=e})}};function yB(t,e,n,r){var i=t.getGraphicEl();if(i){var o=t.getModel().get(["label","rotate"])||0,a=i.getSymbolPath();if(e){var s=t.getLayout(),l=Math.atan2(s[1]-r,s[0]-n);l<0&&(l=2*Math.PI+l);var u=s[0]<n;u&&(l-=Math.PI);var h=u?"left":"right";a.setTextConfig({rotation:-l,position:h,origin:"center"});var c=a.ensureState("emphasis");L(c.textConfig||(c.textConfig={}),{position:h})}else a.setTextConfig({rotation:o*=Math.PI/180})}}var _B=Cs(iB,function(t){t.eachSeriesByType("graph",function(t){"circular"===t.get("layout")&&mB(t,"symbolSize")})});var xB=Et;var bB=Cs(iB,function(t){t.eachSeriesByType(iB,function(t){var e=t.coordinateSystem;if(!e||"view"===e.type)if("force"===t.get("layout")){var n=t.preservedPoints||{},r=t.getGraph(),i=r.data,o=r.edgeData,a=t.getModel("force"),s=a.get("initLayout");t.preservedPoints?i.each(function(t){var e=i.getId(t);i.setItemLayout(t,n[e]||[NaN,NaN])}):s&&"none"!==s?"circular"===s&&mB(t,"value"):uB(t);var l=i.getDataExtent("value"),u=o.getDataExtent("value"),h=a.get("repulsion"),c=a.get("edgeLength"),d=j(h)?h:[h,h],p=j(c)?c:[c,c];p=[p[1],p[0]];var f=i.mapArray("value",function(t,e){var n=i.getItemLayout(e),r=Jo(t,l,d);return isNaN(r)&&(r=(d[0]+d[1])/2),{w:r,rep:r,fixed:i.getItemModel(e).get("fixed"),p:!n||isNaN(n[0])||isNaN(n[1])?null:n}}),g=o.mapArray("value",function(e,n){var i=r.getEdgeByIndex(n),o=Jo(e,u,p);isNaN(o)&&(o=(p[0]+p[1])/2);var a=i.getModel(),s=st(i.getModel().get(["lineStyle","curveness"]),-rB(i,t,n,!0),0);return{n1:f[i.node1.dataIndex],n2:f[i.node2.dataIndex],d:o,curveness:s,ignoreForceLayout:a.get("ignoreForceLayout")}}),m=e.getBoundingRect(),v=function(t,e,n){for(var r=t,i=e,o=n.rect,a=o.width,s=o.height,l=[o.x+a/2,o.y+s/2],u=null==n.gravity?.1:n.gravity,h=0;h<r.length;h++){var c=r[h];c.p||(c.p=It(a*(Math.random()-.5)+l[0],s*(Math.random()-.5)+l[1])),c.pp=Dt(c.p),c.edges=null}var d,p,f=null==n.friction?.6:n.friction,g=f;return{warmUp:function(){g=.8*f},setFixed:function(t){r[t].fixed=!0},setUnfixed:function(t){r[t].fixed=!1},beforeStep:function(t){d=t},afterStep:function(t){p=t},step:function(t){d&&d(r,i);for(var e=[],n=r.length,o=0;o<i.length;o++){var a=i[o];if(!a.ignoreForceLayout){var s=a.n1;Ot(e,(m=a.n2).p,s.p);var h=Nt(e)-a.d,c=m.w/(s.w+m.w);isNaN(c)&&(c=0),Vt(e,e),!s.fixed&&xB(s.p,s.p,e,c*h*g),!m.fixed&&xB(m.p,m.p,e,-(1-c)*h*g)}}for(o=0;o<n;o++)(_=r[o]).fixed||(Ot(e,l,_.p),xB(_.p,_.p,e,u*g));for(o=0;o<n;o++){s=r[o];for(var f=o+1;f<n;f++){var m;Ot(e,(m=r[f]).p,s.p),0===(h=Nt(e))&&(Lt(e,Math.random()-.5,Math.random()-.5),h=1);var v=(s.rep+m.rep)/h/h;!s.fixed&&xB(s.pp,s.pp,e,v),!m.fixed&&xB(m.pp,m.pp,e,-v)}}var y=[];for(o=0;o<n;o++){var _;(_=r[o]).fixed||(Ot(y,_.p,_.pp),xB(_.p,_.p,y,g),At(_.pp,_.p))}var x=(g*=.992)<.01;p&&p(r,i,x),t&&t(x)}}}(f,g,{rect:m,gravity:a.get("gravity"),friction:a.get("friction")});v.beforeStep(function(t,e){for(var n=0,i=t.length;n<i;n++)t[n].fixed&&At(t[n].p,r.getNodeByIndex(n).getLayout())}),v.afterStep(function(t,e,o){for(var a=0,s=t.length;a<s;a++)t[a].fixed||r.getNodeByIndex(a).setLayout(t[a].p),n[i.getId(a)]=t[a].p;for(a=0,s=e.length;a<s;a++){var l=e[a],u=r.getEdgeByIndex(a),h=l.n1.p,c=l.n2.p,d=u.getLayout();(d=d?d.slice():[])[0]=d[0]||[],d[1]=d[1]||[],At(d[0],h),At(d[1],c),+l.curveness&&(d[2]=[(h[0]+c[0])/2-(h[1]-c[1])*l.curveness,(h[1]+c[1])/2-(c[0]-h[0])*l.curveness]),u.setLayout(d)}}),t.forceLayout=v,t.preservedPoints=n,v.step()}else t.forceLayout=null})});function wB(t,e){var n=[];return t.eachSeriesByType("graph",function(t){Og({targetModel:t,coordSysType:"view",coordSysProvider:function(){var r=t.getData(),i=r.mapArray(function(t){var e=r.getItemModel(t);return[+e.get("x"),+e.get("y")]}),o=[],a=[];Cl(i,o,a),a[0]-o[0]===0&&(a[0]+=1,o[0]-=1);a[1]-o[1]===0&&(a[1]+=1,o[1]-=1);var s=(a[0]-o[0])/(a[1]-o[1]),l=function(t,e,n){var r=jg(t,e),i=L(t.getBoxLayoutParams(),{aspect:n});return Wg(t,Ug(i,r.refContainer),n)}(t,e,s);isNaN(s)&&(o=[l.x,l.y],a=[l.x+l.width,l.y+l.height]);var u=a[0]-o[0],h=a[1]-o[1],c=pR(t,e,o[0],o[1],u,h,l);return n.push(c),c},isDefaultDataCoordSys:!0})}),n}var SB=fd.prototype,TB=_d.prototype,MB=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1};function CB(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}!function(t){function n(){return null!==t&&t.apply(this,arguments)||this}e(n,t)}(MB);var IB=function(t){function n(e){var n=t.call(this,e)||this;return n.type="ec-line",n}return e(n,t),n.prototype.getDefaultStyle=function(){return{stroke:om.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new MB},n.prototype.buildPath=function(t,e){CB(e)?SB.buildPath.call(this,t,e):TB.buildPath.call(this,t,e)},n.prototype.pointAt=function(t){return CB(this.shape)?SB.pointAt.call(this,t):TB.pointAt.call(this,t)},n.prototype.tangentAt=function(t){var e=this.shape,n=CB(e)?[e.x2-e.x1,e.y2-e.y1]:TB.tangentAt.call(this,t);return Vt(n,n)},n}(xu),AB=["fromSymbol","toSymbol"];function DB(t){return"_"+t+"Type"}function LB(t,e,n){var r=e.getItemVisual(n,t);if(!r||"none"===r)return r;var i=e.getItemVisual(n,t+"Size"),o=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Ix(i);return r+l+Ax(a||0,l)+(o||"")+(s||"")}function PB(t,e,n){var r=e.getItemVisual(n,t);if(r&&"none"!==r){var i=e.getItemVisual(n,t+"Size"),o=e.getItemVisual(n,t+"Rotate"),a=e.getItemVisual(n,t+"Offset"),s=e.getItemVisual(n,t+"KeepAspect"),l=Ix(i),u=Ax(a||0,l),h=Cx(r,-l[0]/2+u[0],-l[1]/2+u[1],l[0],l[1],null,s);return h.__specifiedRotation=null==o||isNaN(o)?void 0:+o*Math.PI/180||0,h.name=t,h}}function EB(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var n=e[2];n?(t.cpx1=n[0],t.cpy1=n[1]):(t.cpx1=NaN,t.cpy1=NaN)}var OB=function(t){function n(e,n,r){var i=t.call(this)||this;return i._createLine(e,n,r),i}return e(n,t),n.prototype._createLine=function(t,e,n){var r=t.hostModel,i=t.getItemLayout(e),o=t.getItemVisual(e,"z2"),a=function(t){var e=new IB({name:"line",subPixelOptimize:!0});return EB(e.shape,t),e}(i);a.shape.percent=0,jd(a,{z2:at(o,0),shape:{percent:1}},r,e),this.add(a),B(AB,function(n){var r=PB(n,t,e);this.add(r),this[DB(n)]=LB(n,t,e)},this),this._updateCommonStl(t,e,n)},n.prototype.updateData=function(t,e,n){var r=t.hostModel,i=this.childOfName("line"),o=t.getItemLayout(e),a={shape:{}};EB(a.shape,o),Xd(i,a,r,e),B(AB,function(n){var r=LB(n,t,e),i=DB(n);if(this[i]!==r){this.remove(this.childOfName(n));var o=PB(n,t,e);this.add(o)}this[i]=r},this),this._updateCommonStl(t,e,n)},n.prototype.getLinePath=function(){return this.childAt(0)},n.prototype._updateCommonStl=function(t,e,n){var r=t.hostModel,i=this.childOfName("line"),o=n&&n.emphasisLineStyle,a=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,h=n&&n.focus,c=n&&n.blurScope;if(!n||t.hasItemOption){var d=t.getItemModel(e),p=d.getModel("emphasis");o=p.getModel("lineStyle").getLineStyle(),a=d.getModel(["blur","lineStyle"]).getLineStyle(),s=d.getModel(["select","lineStyle"]).getLineStyle(),u=p.get("disabled"),h=p.get("focus"),c=p.get("blurScope"),l=Zp(d)}var f=t.getItemVisual(e,"style"),g=f.stroke;i.useStyle(f),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState("emphasis").style=o,i.ensureState("blur").style=a,i.ensureState("select").style=s,B(AB,function(t){var e=this.childOfName(t);if(e){e.setColor(g),e.style.opacity=f.opacity;for(var n=0;n<xh.length;n++){var r=xh[n],o=i.getState(r);if(o){var a=o.style||{},s=e.ensureState(r),l=s.style||(s.style={});null!=a.stroke&&(l[e.__isEmptyBrush?"stroke":"fill"]=a.stroke),null!=a.opacity&&(l.opacity=a.opacity)}}e.markRedraw()}},this);var m=r.getRawValue(e);jp(this,l,{labelDataIndex:e,labelFetcher:{getFormattedLabel:function(e,n){return r.getFormattedLabel(e,n,t.dataType)}},inheritColor:g||om.color.neutral99,defaultOpacity:f.opacity,defaultText:(null==m?t.getName(e):isFinite(m)?ea(m,10):m)+""});var v=this.getTextContent();if(v){var y=l.normal;v.__align=v.style.align,v.__verticalAlign=v.style.verticalAlign,v.__position=y.get("position")||"middle";var _=y.get("distance");j(_)||(_=[_,_]),v.__labelDistance=_}this.setTextConfig({position:null,local:!0,inside:!1}),ic(this,h,c,u)},n.prototype.highlight=function(){Wh(this)},n.prototype.downplay=function(){Xh(this)},n.prototype.updateLayout=function(t,e){this.childOfName("line").stopAnimation(),this.setLinePoints(t.getItemLayout(e))},n.prototype.setLinePoints=function(t){var e=this.childOfName("line");EB(e.shape,t),e.dirty()},n.prototype.beforeUpdate=function(){var t=this,e=t.childOfName("fromSymbol"),n=t.childOfName("toSymbol"),r=t.getTextContent();if(e||n||r&&!r.ignore){for(var i=1,o=this.parent;o;)o.scaleX&&(i/=o.scaleX),o=o.parent;var a=t.childOfName("line");if(this.__dirty||a.__dirty){var s=a.shape.percent,l=a.pointAt(0),u=a.pointAt(s),h=Ot([],u,l);if(Vt(h,h),e&&(e.setPosition(l),S(e,0),e.scaleX=e.scaleY=i*s,e.markRedraw()),n&&(n.setPosition(u),S(n,1),n.scaleX=n.scaleY=i*s,n.markRedraw()),r&&!r.ignore){r.x=r.y=0,r.originX=r.originY=0;var c=void 0,d=void 0,p=r.__labelDistance,f=p[0]*i,g=p[1]*i,m=s/2,v=a.tangentAt(m),y=[v[1],-v[0]],_=a.pointAt(m);y[1]>0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if("start"!==r.__position&&"end"!==r.__position){var b=-Math.atan2(v[1],v[0]);u[0]<l[0]&&(b=Math.PI+b),r.rotation=b}var w=void 0;switch(r.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-g,d="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=g,d="top";break;default:w=0,d="middle"}switch(r.__position){case"end":r.x=h[0]*f+u[0],r.y=h[1]*g+u[1],c=h[0]>.8?"left":h[0]<-.8?"right":"center",d=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":r.x=-h[0]*f+l[0],r.y=-h[1]*g+l[1],c=h[0]>.8?"right":h[0]<-.8?"left":"center",d=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":r.x=f*x+l[0],r.y=l[1]+w,c=v[0]<0?"right":"left",r.originX=-f*x,r.originY=-w;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":r.x=_[0],r.y=_[1]+w,c="center",r.originY=-w;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":r.x=-f*x+u[0],r.y=u[1]+w,c=v[0]>=0?"right":"left",r.originX=f*x,r.originY=-w}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||d,align:r.__align||c})}}}function S(t,e){var n=t.__specifiedRotation;if(null==n){var r=a.tangentAt(e);t.attr("rotation",(1===e?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else t.attr("rotation",n)}},n}(Do),NB=OB;function RB(t){var e=t.hostModel,n=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:n.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:n.get("disabled"),blurScope:n.get("blurScope"),focus:n.get("focus"),labelStatesModels:Zp(e)}}function kB(t){return isNaN(t[0])||isNaN(t[1])}function zB(t){return t&&!kB(t[0])&&!kB(t[1])}var BB=function(){function t(t){this.group=new Do,this._LineCtor=t||NB}return t.prototype.updateData=function(t){var e=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=t,i||r.removeAll();var o=RB(t);t.diff(i).add(function(n){e._doAdd(t,n,o)}).update(function(n,r){e._doUpdate(i,t,r,n,o)}).remove(function(t){r.remove(i.getItemGraphicEl(t))}).execute()},t.prototype.updateLayout=function(){var t=this._lineData;t&&t.eachItemGraphicEl(function(e,n){e.updateLayout(t,n)},this)},t.prototype.incrementalPrepareUpdate=function(t){this._seriesScope=RB(t),this._lineData=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(t,e,n){function r(t){t.isGroup||function(t){return t.animators&&t.animators.length>0}(t)||(t.incremental=n,t.ensureState("emphasis").hoverLayer=2)}this._progressiveEls=[];for(var i=t.start;i<t.end;i++){if(zB(e.getItemLayout(i))){var o=new this._LineCtor(e,i,this._seriesScope);o.traverse(r),this.group.add(o),e.setItemGraphicEl(i,o),this._progressiveEls.push(o)}}},t.prototype.remove=function(){this.group.removeAll()},t.prototype.eachRendered=function(t){Dp(this._progressiveEls||this.group,t)},t.prototype._doAdd=function(t,e,n){if(zB(t.getItemLayout(e))){var r=new this._LineCtor(t,e,n);t.setItemGraphicEl(e,r),this.group.add(r)}},t.prototype._doUpdate=function(t,e,n,r,i){var o=t.getItemGraphicEl(n);zB(e.getItemLayout(r))?(o?o.updateData(e,r,i):o=new this._LineCtor(e,r,i),e.setItemGraphicEl(r,o),this.group.add(o)):this.group.remove(o)},t}(),VB=[],FB=[],GB=[],HB=Qn,UB=Ut,WB=Math.abs;function XB(t,e,n){for(var r,i=t[0],o=t[1],a=t[2],s=1/0,l=n*n,u=.1,h=.1;h<=.9;h+=.1){VB[0]=HB(i[0],o[0],a[0],h),VB[1]=HB(i[1],o[1],a[1],h),(p=WB(UB(VB,e)-l))<s&&(s=p,r=h)}for(var c=0;c<32;c++){var d=r+u;FB[0]=HB(i[0],o[0],a[0],r),FB[1]=HB(i[1],o[1],a[1],r),GB[0]=HB(i[0],o[0],a[0],d),GB[1]=HB(i[1],o[1],a[1],d);var p=UB(FB,e)-l;if(WB(p)<.01)break;var f=UB(GB,e)-l;u/=2,p<0?f>=0?r+=u:r-=u:f>=0?r-=u:r+=u}return r}function jB(t,e){var n=[],r=er,i=[[],[],[]],o=[[],[]],a=[];e/=2,t.eachEdge(function(t,s){var l=t.getLayout(),u=t.getVisual("fromSymbol"),h=t.getVisual("toSymbol");l.__original||(l.__original=[Dt(l[0]),Dt(l[1])],l[2]&&l.__original.push(Dt(l[2])));var c=l.__original;if(null!=l[2]){if(At(i[0],c[0]),At(i[1],c[2]),At(i[2],c[1]),u&&"none"!==u){var d=pB(t.node1),p=XB(i,c[0],d*e);r(i[0][0],i[1][0],i[2][0],p,n),i[0][0]=n[3],i[1][0]=n[4],r(i[0][1],i[1][1],i[2][1],p,n),i[0][1]=n[3],i[1][1]=n[4]}if(h&&"none"!==h){d=pB(t.node2),p=XB(i,c[1],d*e);r(i[0][0],i[1][0],i[2][0],p,n),i[1][0]=n[1],i[2][0]=n[2],r(i[0][1],i[1][1],i[2][1],p,n),i[1][1]=n[1],i[2][1]=n[2]}At(l[0],i[0]),At(l[1],i[2]),At(l[2],i[1])}else{if(At(o[0],c[0]),At(o[1],c[1]),Ot(a,o[1],o[0]),Vt(a,a),u&&"none"!==u){d=pB(t.node1);Et(o[0],o[0],a,d*e)}if(h&&"none"!==h){d=pB(t.node2);Et(o[1],o[1],a,-d*e)}At(l[0],o[0]),At(l[1],o[1])}})}var ZB=Qa();function YB(t,e){t&&(ZB(t).bridge=e)}var qB=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=iB,e}return e(n,t),n.prototype.init=function(t,e){var n=new qA,r=new BB,i=this.group,o=new Do;this._controller=new kO(e.getZr()),o.add(n.group),o.add(r.group),i.add(o),this._symbolDraw=n,this._lineDraw=r,this._mainGroup=o,this._firstRender=!0},n.prototype.render=function(t,e,n){var r=this,i=JN(t),o=!1;this._model=t,this._api=n,this._active=!0;var a=this._mainGroup,s=this._getThumbnailInfo();s&&s.bridge.reset(n);var l=this._symbolDraw,u=this._lineDraw;i&&jN(a,2,i,this._firstRender?null:t),jB(t.getGraph(),dB(t));var h=t.getData();l.updateData(h);var c=t.getEdgeData();u.updateData(c),this._updateNodeAndLinkScale(),i&&sR(t,n,this._controller,function(e,n,r){return t.coordinateSystem.containPoint([n,r])},null),clearTimeout(this._layoutTimeout);var d=t.forceLayout,p=t.get(["force","layoutAnimation"]);d&&(o=!0,this._startForceLayoutIteration(d,n,p));var f=t.get("layout");h.graph.eachNode(function(e){var i=e.dataIndex,o=e.getGraphicEl(),a=e.getModel();if(o){o.off("drag").off("dragend");var s=a.get("draggable");s&&o.on("drag",function(a){switch(f){case"force":d.warmUp(),!r._layouting&&r._startForceLayoutIteration(d,n,p),d.setFixed(i),h.setItemLayout(i,[o.x,o.y]);break;case"circular":h.setItemLayout(i,[o.x,o.y]),e.setLayout({fixed:!0},!0),mB(t,"symbolSize",e,[a.offsetX,a.offsetY]),r.updateLayout(t);break;default:h.setItemLayout(i,[o.x,o.y]),hB(t.getGraph(),t),r.updateLayout(t)}}).on("dragend",function(){d&&d.setUnfixed(i)}),o.setDraggable(s,!!a.get("cursor")),"adjacency"===a.get(["emphasis","focus"])&&($u(o).focus=e.getAdjacentDataIndices())}}),h.graph.eachEdge(function(t){var e=t.getGraphicEl(),n=t.getModel().get(["emphasis","focus"]);e&&"adjacency"===n&&($u(e).focus={edge:[t.dataIndex],node:[t.node1.dataIndex,t.node2.dataIndex]})});var g="circular"===t.get("layout")&&t.get(["circular","rotateLabel"]),m=h.getLayout("cx"),v=h.getLayout("cy");h.graph.eachNode(function(t){yB(t,g,m,v)}),this._firstRender=!1,o||this._renderThumbnail(t,n,this._symbolDraw,this._lineDraw)},n.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose()},n.prototype._startForceLayoutIteration=function(t,e,n){var r=this,i=!1;!function o(){t.step(function(t){r.updateLayout(r._model),!t&&i||(i=!0,r._renderThumbnail(r._model,e,r._symbolDraw,r._lineDraw)),(r._layouting=!t)&&(n?r._layoutTimeout=setTimeout(o,16):o())})}()},n.prototype.__updateOnOwnRoam=function(t,e,n){var r=JN(e);this._active&&r&&(jN(this._mainGroup,2,r,null),dR(t)&&(this._updateNodeAndLinkScale(),jB(e.getGraph(),dB(e)),this._lineDraw.updateLayout(),n.updateLabelLayout()),this._updateThumbnailWindow())},n.prototype._updateNodeAndLinkScale=function(){var t=this._model,e=t.getData(),n=dB(t);e.eachItemGraphicEl(function(t,e){t&&t.setSymbolScale(n)})},n.prototype.updateLayout=function(t){this._active&&(jB(t.getGraph(),dB(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout())},n.prototype.remove=function(){this._active=!1,clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove(),this._controller&&this._controller.disable()},n.prototype._getThumbnailInfo=function(){var t=this._model,e=t.coordinateSystem;if("view"===e.type){var n=function(t){if(t)return ZB(t).bridge}(t);if(n)return{bridge:n,coordSys:e}}},n.prototype._updateThumbnailWindow=function(){var t=this._getThumbnailInfo();t&&t.bridge.updateWindow(SN(null,t.coordSys),this._api)},n.prototype._renderThumbnail=function(t,e,n,r){var i=this._getThumbnailInfo();if(i){var o=new Do,a=n.group.children(),s=r.group.children(),l=new Do,u=new Do;o.add(u),o.add(l);for(var h=0;h<a.length;h++){var c=(v=a[h]).children()[0],d=v.x,p=v.y,f=L(I(c.shape),{width:c.scaleX,height:c.scaleY,x:d-c.scaleX/2,y:p-c.scaleY/2}),g=I(c.style),m=new c.constructor({shape:f,style:g,z2:151});u.add(m)}for(h=0;h<s.length;h++){var v,y=(v=s[h]).children()[0],_=(g=I(y.style),f=I(y.shape),new IB({style:g,shape:f,z2:151}));l.add(_)}i.bridge.renderContent({api:e,roamType:t.get("roam"),viewportRect:null,group:o,targetTrans:SN(null,i.coordSys)})}},n.type=iB,n}(l_),KB=qB,JB=Cs(iB,function(t){var e=t.findComponents({mainType:"legend"});if(!e||!e.length)return;t.eachSeriesByType(iB,function(t){var n=t.getCategoriesData(),r=t.getGraph().data,i=n.mapArray(n.getName);r.filterSelf(function(t){var n=r.getItemModel(t).getShallow("category");if(null!=n){K(n)&&(n=i[n]);for(var o=0;o<e.length;o++)if(!e[o].isSelected(n))return!1}return!0})})});var QB=Cs(iB,function(t){var e={};t.eachSeriesByType(iB,function(t){var n=t.getCategoriesData(),r=t.getData(),i={};n.each(function(r){var o=n.getName(r);i["ec-"+o]=r;var a=n.getItemModel(r),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=t.getColorFromPalette(o,e)),n.setItemVisual(r,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var h=a.getShallow(l[u],!0);null!=h&&n.setItemVisual(r,l[u],h)}}),n.count()&&r.each(function(t){var e=r.getItemModel(t).getShallow("category");if(null!=e){Y(e)&&(e=i["ec-"+e]);var o=n.getItemVisual(e,"style");L(r.ensureUniqueItemVisual(t,"style"),o);for(var a=["symbol","symbolSize","symbolKeepAspect"],s=0;s<a.length;s++)r.setItemVisual(t,a[s],n.getItemVisual(e,a[s]))}})})});var $B="chord",tV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links),this.legendVisualProvider=new CP(W(this.getData,this),W(this.getRawData,this))},n.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(e.edges||e.links)},n.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],r=t.data||t.nodes||[];if(r&&n)return Kz(r,n,this,!0,function(t,e){var n=xf.prototype.getModel;function r(t,e){var r=n.call(this,t,e);return r.resolveParentPath=i,r}function i(t){if(t&&("label"===t[0]||"label"===t[1])){var e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}e.wrapMethod("getItemModel",function(t){return t.resolveParentPath=i,t.getModel=r,t})}).data},n.prototype.getGraph=function(){return this.getData().graph},n.prototype.getEdgeData=function(){return this.getGraph().edgeData},n.prototype.formatTooltip=function(t,e,n){var r=this.getDataParams(t,n);if("edge"===n){var i=this.getData(),o=i.graph.getEdgeByIndex(t),a=i.getName(o.node1.dataIndex),s=i.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),Cy("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}return Cy("nameValue",{name:r.name,value:r.value,noValue:null==r.value})},n.prototype.getDataParams=function(e,n){var r=t.prototype.getDataParams.call(this,e,n);if("node"===n){var i=this.getData(),o=this.getGraph().getNodeByIndex(e);if(null==r.name&&(r.name=i.getName(e)),null==r.value){var a=o.getLayout().value;r.value=a}}return r},n.type="series."+$B,n.defaultOption={z:2,coordinateSystem:"none",legendHoverLink:!0,colorBy:"data",left:0,top:0,right:0,bottom:0,width:null,height:null,center:["50%","50%"],radius:["70%","80%"],clockwise:!0,startAngle:90,endAngle:"auto",minAngle:0,padAngle:3,itemStyle:{borderRadius:[0,0,5,5]},lineStyle:{width:0,color:"source",opacity:.2},label:{show:!0,position:"outside",distance:5},emphasis:{focus:"adjacency",lineStyle:{opacity:.5}}},n}(Ky),eV=tV,nV=function(t){function n(e,n,r){var i=t.call(this)||this;$u(i).dataType="node",i.z2=2;var o=new Qu;return i.setTextContent(o),i.updateData(e,n,r,!0),i}return e(n,t),n.prototype.updateData=function(t,e,n,r){var i=this,o=t.graph.getNodeByIndex(e),a=t.hostModel,s=o.getModel(),l=s.getModel("emphasis"),u=t.getItemLayout(e),h=L(nP(s.getModel("itemStyle"),u,!0),u),c=this;if(isNaN(h.startAngle))c.setShape(h);else{r?c.setShape(h):Xd(c,{shape:h},a,e);var d=L(nP(s.getModel("itemStyle"),u,!0),u);i.setShape(d),i.useStyle(t.getItemVisual(e,"style")),lc(i,s),this._updateLabel(a,s,o),t.setItemGraphicEl(e,c),lc(c,s,"itemStyle");var p=l.get("focus");ic(this,"adjacency"===p?o.getAdjacentDataIndices():p,l.get("blurScope"),l.get("disabled"))}},n.prototype._updateLabel=function(t,e,n){var r=this.getTextContent(),i=n.getLayout(),o=(i.startAngle+i.endAngle)/2,a=Math.cos(o),s=Math.sin(o),l=e.getModel("label");r.ignore=!l.get("show");var u=Zp(e),h=n.getVisual("style");jp(r,u,{labelFetcher:{getFormattedLabel:function(n,r,i,o,a,s){return t.getFormattedLabel(n,r,"node",o,st(a,u.normal&&u.normal.get("formatter"),e.get("name")),s)}},labelDataIndex:n.dataIndex,defaultText:n.dataIndex+"",inheritColor:h.fill,defaultOpacity:h.opacity,defaultOutsidePosition:"startArc"});var c,d=l.get("position")||"outside",p=l.get("distance")||0;c="outside"===d?i.r+p:(i.r+i.r0)/2,this.textConfig={inside:"outside"!==d};var f="outside"!==d?l.get("align")||"center":a>0?"left":"right",g="outside"!==d?l.get("verticalAlign")||"middle":s>0?"top":"bottom";r.attr({x:a*c+i.cx,y:s*c+i.cy,rotation:0,style:{align:f,verticalAlign:g}})},n}(td),rV=nV,iV=function(t){function n(e,n,r,i){var o=t.call(this)||this;return $u(o).dataType="edge",o.updateData(e,n,r,i,!0),o}return e(n,t),n.prototype.buildPath=function(t,e){t.moveTo(e.s1[0],e.s1[1]);var n=.7,r=e.clockwise;t.arc(e.cx,e.cy,e.r,e.sStartAngle,e.sEndAngle,!r),t.bezierCurveTo((e.cx-e.s2[0])*n+e.s2[0],(e.cy-e.s2[1])*n+e.s2[1],(e.cx-e.t1[0])*n+e.t1[0],(e.cy-e.t1[1])*n+e.t1[1],e.t1[0],e.t1[1]),t.arc(e.cx,e.cy,e.r,e.tStartAngle,e.tEndAngle,!r),t.bezierCurveTo((e.cx-e.t2[0])*n+e.t2[0],(e.cy-e.t2[1])*n+e.t2[1],(e.cx-e.s1[0])*n+e.s1[0],(e.cy-e.s1[1])*n+e.s1[1],e.s1[0],e.s1[1]),t.closePath()},n.prototype.updateData=function(t,e,n,r,i){var o=t.hostModel,a=e.graph.getEdgeByIndex(n),s=a.getLayout(),l=a.node1.getModel(),u=e.getItemModel(a.dataIndex),h=u.getModel("lineStyle"),c=u.getModel("emphasis"),d=c.get("focus"),p=L(nP(l.getModel("itemStyle"),s,!0),s),f=this;isNaN(p.sStartAngle)||isNaN(p.tStartAngle)?f.setShape(p):(i?(f.setShape(p),oV(f,a,t,h)):(Jd(f),oV(f,a,t,h),Xd(f,{shape:p},o,n)),ic(this,"adjacency"===d?a.getAdjacentDataIndices():d,c.get("blurScope"),c.get("disabled")),lc(f,u,"lineStyle"),e.setItemGraphicEl(a.dataIndex,f))},n}(xu);function oV(t,e,n,r){var i=e.node1,o=e.node2,a=t.style;switch(t.setStyle(r.getLineStyle()),r.get("color")){case"source":a.fill=n.getItemVisual(i.dataIndex,"style").fill,a.decal=i.getVisual("style").decal;break;case"target":a.fill=n.getItemVisual(o.dataIndex,"style").fill,a.decal=o.getVisual("style").decal;break;case"gradient":var s=n.getItemVisual(i.dataIndex,"style").fill,l=n.getItemVisual(o.dataIndex,"style").fill;if(Y(s)&&Y(l)){var u=t.shape,h=(u.s1[0]+u.s2[0])/2,c=(u.s1[1]+u.s2[1])/2,d=(u.t1[0]+u.t2[0])/2,p=(u.t1[1]+u.t2[1])/2;a.fill=new Id(h,c,d,p,[{offset:0,color:s},{offset:1,color:l}],!0)}}}var aV=Math.PI/180,sV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=$B,e}return e(n,t),n.prototype.init=function(t,e){},n.prototype.render=function(t,e,n){var r=t.getData(),i=this._data,o=this.group,a=-t.get("startAngle")*aV;if(r.diff(i).add(function(t){if(r.getItemLayout(t)){var e=new rV(r,t,a);$u(e).dataIndex=t,o.add(e)}}).update(function(e,n){var s=i.getItemGraphicEl(n);r.getItemLayout(e)?(s?s.updateData(r,e,a):s=new rV(r,e,a),o.add(s)):s&&Kd(s,t,n)}).remove(function(e){var n=i.getItemGraphicEl(e);n&&Kd(n,t,e)}).execute(),!i){var s=t.get("center");this.group.scaleX=.01,this.group.scaleY=.01,this.group.originX=Qo(s[0],n.getWidth()),this.group.originY=Qo(s[1],n.getHeight()),jd(this.group,{scaleX:1,scaleY:1},t)}this._data=r,this.renderEdges(t,a)},n.prototype.renderEdges=function(t,e){var n=t.getData(),r=t.getEdgeData(),i=this._edgeData,o=this.group;r.diff(i).add(function(t){var i=new iV(n,r,t,e);$u(i).dataIndex=t,o.add(i)}).update(function(t,a){var s=i.getItemGraphicEl(a);s.updateData(n,r,t,e),o.add(s)}).remove(function(e){var n=i.getItemGraphicEl(e);n&&Kd(n,t,e)}).execute(),this._edgeData=r},n.prototype.dispose=function(){},n.type=$B,n}(l_),lV=sV,uV=Math.PI/180,hV=Cs($B,function(t,e){t.eachSeriesByType($B,function(t){!function(t,e){var n=t.getData(),r=n.graph,i=t.getEdgeData();if(!i.count())return;var o=Hg(t,e),a=o.cx,s=o.cy,l=o.r,u=o.r0,h=Math.max((t.get("padAngle")||0)*uV,0),c=Math.max((t.get("minAngle")||0)*uV,0),d=-t.get("startAngle")*uV,p=d+2*Math.PI,f=t.get("clockwise"),g=f?1:-1,m=[d,p];Kl(m,!f);var v=m[0],y=m[1]-v,_=0===n.getSum("value")&&0===i.getSum("value"),x=[],b=0;r.eachEdge(function(t){var e=_?1:t.getValue("value");_&&(e>0||c)&&(b+=2);var n=t.node1.dataIndex,r=t.node2.dataIndex;x[n]=(x[n]||0)+e,x[r]=(x[r]||0)+e});var w=0;if(r.eachNode(function(t){var e=t.getValue("value");isNaN(e)||(x[t.dataIndex]=Math.max(e,x[t.dataIndex]||0)),!_&&(x[t.dataIndex]>0||c)&&b++,w+=x[t.dataIndex]||0}),0===b||0===w)return;h*b>=Math.abs(y)&&(h=Math.max(0,(Math.abs(y)-c*b)/b));(h+c)*b>=Math.abs(y)&&(c=(Math.abs(y)-h*b)/b);var S=(y-h*b*g)/w,T=0,M=0,C=0;r.eachNode(function(t){var e=x[t.dataIndex]||0,n=S*(w?e:1)*g;Math.abs(n)<c?T+=c-Math.abs(n):(M+=Math.abs(n)-c,C+=Math.abs(n)),t.setLayout({angle:n,value:e})});var I=!1;if(T>M){var A=T/M;r.eachNode(function(t){var e=t.getLayout().angle;Math.abs(e)>=c?t.setLayout({angle:e*A,ratio:A},!0):t.setLayout({angle:c,ratio:0===c?1:e/c},!0)})}else r.eachNode(function(t){if(!I){var e=t.getLayout().angle;e-Math.min(e/C,1)*T<c&&(I=!0)}});var D=T;r.eachNode(function(t){if(!(D<=0)){var e=t.getLayout().angle;if(e>c&&c>0){var n=I?1:Math.min(e/C,1),r=e-c,i=Math.min(r,Math.min(D,T*n));D-=i,t.setLayout({angle:e-i,ratio:(e-i)/e},!0)}else c>0&&t.setLayout({angle:c,ratio:0===e?1:c/e},!0)}});var L=v,P=[];r.eachNode(function(t){var e=Math.max(t.getLayout().angle,c);t.setLayout({cx:a,cy:s,r0:u,r:l,startAngle:L,endAngle:L+e*g,clockwise:f},!0),P[t.dataIndex]=L,L+=(e+h)*g}),r.eachEdge(function(t){var e=_?1:t.getValue("value"),n=S*(w?e:1)*g,r=t.node1.dataIndex,i=P[r]||0,o=i+Math.abs((t.node1.getLayout().ratio||1)*n)*g,l=[a+u*Math.cos(i),s+u*Math.sin(i)],h=[a+u*Math.cos(o),s+u*Math.sin(o)],c=t.node2.dataIndex,d=P[c]||0,p=d+Math.abs((t.node2.getLayout().ratio||1)*n)*g,m=[a+u*Math.cos(d),s+u*Math.sin(d)],v=[a+u*Math.cos(p),s+u*Math.sin(p)];t.setLayout({s1:l,s2:h,sStartAngle:i,sEndAngle:o,t1:m,t2:v,tStartAngle:d,tEndAngle:p,cx:a,cy:s,r:u,value:e,clockwise:f}),P[r]=o,P[c]=p})}(t,e)})});var cV=function(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0},dV=function(t){function n(e){var n=t.call(this,e)||this;return n.type="pointer",n}return e(n,t),n.prototype.getDefaultShape=function(){return new cV},n.prototype.buildPath=function(t,e){var n=Math.cos,r=Math.sin,i=e.r,o=e.width,a=e.angle,s=e.x-n(a)*o*(o>=i/3?1:2),l=e.y-r(a)*o*(o>=i/3?1:2);a=e.angle-Math.PI/2,t.moveTo(s,l),t.lineTo(e.x+n(a)*o,e.y+r(a)*o),t.lineTo(e.x+n(e.angle)*i,e.y+r(e.angle)*i),t.lineTo(e.x-n(a)*o,e.y-r(a)*o),t.lineTo(s,l)},n}(xu),pV=dV;function fV(t,e){var n=null==t?"":t+"";return e&&(Y(e)?n=e.replace("{value}",n):Z(e)&&(n=e(t))),n}var gV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){this.group.removeAll();var r=t.get(["axisLine","lineStyle","color"]),i=function(t,e){var n=t.get("center"),r=e.getWidth(),i=e.getHeight(),o=Math.min(r,i);return{cx:Qo(n[0],e.getWidth()),cy:Qo(n[1],e.getHeight()),r:Qo(t.get("radius"),o/2)}}(t,n);this._renderMain(t,e,n,r,i),this._data=t.getData()},n.prototype.dispose=function(){},n.prototype._renderMain=function(t,e,n,r,i){var o=this.group,a=t.get("clockwise"),s=-t.get("startAngle")/180*Math.PI,l=-t.get("endAngle")/180*Math.PI,u=t.getModel("axisLine"),h=u.get("roundCap")?$L:td,c=u.get("show"),d=u.getModel("lineStyle"),p=d.get("width"),f=[s,l];Kl(f,!a);for(var g=(l=f[1])-(s=f[0]),m=s,v=[],y=0;c&&y<r.length;y++){var _=new h({shape:{startAngle:m,endAngle:l=s+g*Math.min(Math.max(r[y][0],0),1),cx:i.cx,cy:i.cy,clockwise:a,r0:i.r-p,r:i.r},silent:!0});_.setStyle({fill:r[y][1]}),_.setStyle(d.getLineStyle(["color","width"])),v.push(_),m=l}v.reverse(),B(v,function(t){return o.add(t)});var x=function(t){if(t<=0)return r[0][1];var e;for(e=0;e<r.length;e++)if(r[e][0]>=t&&(0===e?0:r[e-1][0])<t)return r[e][1];return r[e-1][1]};this._renderTicks(t,e,n,x,i,s,l,a,p),this._renderTitleAndDetail(t,e,n,x,i),this._renderAnchor(t,i),this._renderPointer(t,e,n,x,i,s,l,a,p)},n.prototype._renderTicks=function(t,e,n,r,i,o,a,s,l){for(var u,h,c=this.group,d=i.cx,p=i.cy,f=i.r,g=+t.get("min"),m=+t.get("max"),v=t.getModel("splitLine"),y=t.getModel("axisTick"),_=t.getModel("axisLabel"),x=t.get("splitNumber"),b=y.get("splitNumber"),w=Qo(v.get("length"),f),S=Qo(y.get("length"),f),T=o,M=(a-o)/x,C=M/b,I=v.getModel("lineStyle").getLineStyle(),A=y.getModel("lineStyle").getLineStyle(),D=v.get("distance"),L=0;L<=x;L++){if(u=Math.cos(T),h=Math.sin(T),v.get("show")){var P=new fd({shape:{x1:u*(f-(E=D?D+l:l))+d,y1:h*(f-E)+p,x2:u*(f-w-E)+d,y2:h*(f-w-E)+p},style:I,silent:!0});"auto"===I.stroke&&P.setStyle({stroke:r(L/x)}),c.add(P)}if(_.get("show")){var E=_.get("distance")+D,O=fV(ea(L*(m-g)/x+g,14),_.get("formatter")),N=r(L/x),R=u*(f-w-E)+d,k=h*(f-w-E)+p,z=_.get("rotate"),B=0;"radial"===z?(B=-T+2*Math.PI)>Math.PI/2&&(B+=Math.PI):"tangential"===z?B=-T-Math.PI/2:K(z)&&(B=z*Math.PI/180),0===B?c.add(new Qu({style:Yp(_,{text:O,x:R,y:k,verticalAlign:h<-.8?"top":h>.8?"bottom":"middle",align:u<-.4?"left":u>.4?"right":"center"},{inheritColor:N}),silent:!0})):c.add(new Qu({style:Yp(_,{text:O,x:R,y:k,verticalAlign:"middle",align:"center"},{inheritColor:N}),silent:!0,originX:R,originY:k,rotation:B}))}if(y.get("show")&&L!==x){E=(E=y.get("distance"))?E+l:l;for(var V=0;V<=b;V++){u=Math.cos(T),h=Math.sin(T);var F=new fd({shape:{x1:u*(f-E)+d,y1:h*(f-E)+p,x2:u*(f-S-E)+d,y2:h*(f-S-E)+p},silent:!0,style:A});"auto"===A.stroke&&F.setStyle({stroke:r((L+V/b)/x)}),c.add(F),T+=C}T-=C}else T+=M}},n.prototype._renderPointer=function(t,e,n,r,i,o,a,s,l){var u=this.group,h=this._data,c=this._progressEls,d=[],p=t.get(["pointer","show"]),f=t.getModel("progress"),g=f.get("show"),m=t.getData(),v=m.mapDimension("value"),y=+t.get("min"),_=+t.get("max"),x=[y,_],b=[o,a];function w(e,n){var r,o=m.getItemModel(e).getModel("pointer"),a=Qo(o.get("width"),i.r),s=Qo(o.get("length"),i.r),l=t.get(["pointer","icon"]),u=o.get("offsetCenter"),h=Qo(u[0],i.r),c=Qo(u[1],i.r),d=o.get("keepAspect");return(r=l?Cx(l,h-a/2,c-s,a,s,null,d):new pV({shape:{angle:-Math.PI/2,width:a,r:s,x:h,y:c}})).rotation=-(n+Math.PI/2),r.x=i.cx,r.y=i.cy,r}function S(t,e){var n=f.get("roundCap")?$L:td,r=f.get("overlap"),a=r?f.get("width"):l/m.count(),u=r?i.r-a:i.r-(t+1)*a,h=r?i.r:i.r-t*a,c=new n({shape:{startAngle:o,endAngle:e,cx:i.cx,cy:i.cy,clockwise:s,r0:u,r:h}});return r&&(c.z2=Jo(m.get(v,t),[y,_],[100,0],!0)),c}(g||p)&&(m.diff(h).add(function(e){var n=m.get(v,e);if(p){var r=w(e,o);jd(r,{rotation:-((isNaN(+n)?b[0]:Jo(n,x,b,!0))+Math.PI/2)},t),u.add(r),m.setItemGraphicEl(e,r)}if(g){var i=S(e,o),a=f.get("clip");jd(i,{shape:{endAngle:Jo(n,x,b,a)}},t),u.add(i),th(t.seriesIndex,m.dataType,e,i),d[e]=i}}).update(function(e,n){var r=m.get(v,e);if(p){var i=h.getItemGraphicEl(n),a=i?i.rotation:o,s=w(e,a);s.rotation=a,Xd(s,{rotation:-((isNaN(+r)?b[0]:Jo(r,x,b,!0))+Math.PI/2)},t),u.add(s),m.setItemGraphicEl(e,s)}if(g){var l=c[n],y=S(e,l?l.shape.endAngle:o),_=f.get("clip");Xd(y,{shape:{endAngle:Jo(r,x,b,_)}},t),u.add(y),th(t.seriesIndex,m.dataType,e,y),d[e]=y}}).execute(),m.each(function(t){var e=m.getItemModel(t),n=e.getModel("emphasis"),i=n.get("focus"),o=n.get("blurScope"),a=n.get("disabled"),s=r(Jo(m.get(v,t),x,[0,1],!0));if(p){var l=m.getItemGraphicEl(t),u=m.getItemVisual(t,"style"),h=u.fill;if(l instanceof Iu){var c=l.style;l.useStyle(L({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},u))}else l.useStyle(u),"pointer"!==l.type&&l.setColor(h);l.setStyle(e.getModel(["pointer","itemStyle"]).getItemStyle()),"auto"===l.style.fill&&l.setStyle("fill",s),l.z2EmphasisLift=0,lc(l,e),ic(l,i,o,a)}if(g){var f=d[t];f.useStyle(m.getItemVisual(t,"style")),f.setStyle(e.getModel(["progress","itemStyle"]).getItemStyle()),"auto"===f.style.fill&&f.setStyle("fill",s),f.z2EmphasisLift=0,lc(f,e),ic(f,i,o,a)}}),this._progressEls=d)},n.prototype._renderAnchor=function(t,e){var n=t.getModel("anchor");if(n.get("show")){var r=n.get("size"),i=n.get("icon"),o=n.get("offsetCenter"),a=n.get("keepAspect"),s=Cx(i,e.cx-r/2+Qo(o[0],e.r),e.cy-r/2+Qo(o[1],e.r),r,r,null,a);s.z2=n.get("showAbove")?1:0,s.setStyle(n.getModel("itemStyle").getItemStyle()),this.group.add(s)}},n.prototype._renderTitleAndDetail=function(t,e,n,r,i){var o=this,a=t.getData(),s=a.mapDimension("value"),l=+t.get("min"),u=+t.get("max"),h=new Do,c=[],d=[],p=t.isAnimationEnabled(),f=t.get(["pointer","showAbove"]);a.diff(this._data).add(function(t){c[t]=new Qu({silent:!0}),d[t]=new Qu({silent:!0})}).update(function(t,e){c[t]=o._titleEls[e],d[t]=o._detailEls[e]}).execute(),a.each(function(e){var n=a.getItemModel(e),o=a.get(s,e),g=new Do,m=r(Jo(o,[l,u],[0,1],!0)),v=n.getModel("title");if(v.get("show")){var y=v.get("offsetCenter"),_=i.cx+Qo(y[0],i.r),x=i.cy+Qo(y[1],i.r);(A=c[e]).attr({z2:f?0:2,style:Yp(v,{x:_,y:x,text:a.getName(e),align:"center",verticalAlign:"middle"},{inheritColor:m})}),g.add(A)}var b=n.getModel("detail");if(b.get("show")){var w=b.get("offsetCenter"),S=i.cx+Qo(w[0],i.r),T=i.cy+Qo(w[1],i.r),M=Qo(b.get("width"),i.r),C=Qo(b.get("height"),i.r),I=t.get(["progress","show"])?a.getItemVisual(e,"style").fill:m,A=d[e],D=b.get("formatter");A.attr({z2:f?0:2,style:Yp(b,{x:S,y:T,text:fV(o,D),width:isNaN(M)?null:M,height:isNaN(C)?null:C,align:"center",verticalAlign:"middle"},{inheritColor:I})}),nf(A,{normal:b},o,function(t){return fV(t,D)}),p&&rf(A,e,a,t,{getFormattedLabel:function(t,e,n,r,i,a){return fV(a?a.interpolatedValue:o,D)}}),g.add(A)}h.add(g)}),this.group.add(h),this._titleEls=c,this._detailEls=d},n.type="gauge",n}(l_),mV=gV,vV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.visualStyleAccessPath="itemStyle",e}return e(n,t),n.prototype.getInitialData=function(t,e){return SP(this,["value"])},n.type="series.gauge",n.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,om.color.neutral10]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:om.color.axisTick,width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:om.color.axisTickMinor,width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:om.color.axisLabel,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:om.color.neutral00,borderWidth:0,borderColor:om.color.theme[0]}},title:{show:!0,offsetCenter:[0,"20%"],color:om.color.secondary,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:om.color.transparent,borderWidth:0,borderColor:om.color.neutral40,width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:om.color.primary,fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},n}(Ky),yV=vV;var _V="funnel",xV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new CP(W(this.getData,this),W(this.getRawData,this)),this._defaultLabelLine(e)},n.prototype.getInitialData=function(t,e){return SP(this,{coordDimensions:["value"],encodeDefaulter:X(mm,this)})},n.prototype._defaultLabelLine=function(t){Va(t,"labelLine",["show"]);var e=t.labelLine,n=t.emphasis.labelLine;e.show=e.show&&t.label.show,n.show=n.show&&t.emphasis.label.show},n.prototype.getDataParams=function(e){var n=this.getData(),r=t.prototype.getDataParams.call(this,e),i=n.mapDimension("value"),o=n.getSum(i);return r.percent=o?+(n.get(i,e)/o*100).toFixed(2):0,r.$vars.push("percent"),r},n.type="series."+_V,n.defaultOption={coordinateSystemUsage:"box",z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:65,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:om.color.neutral00,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:om.color.primary}}},n}(Ky),bV=xV,wV=["itemStyle","opacity"],SV=function(t){function n(e,n){var r=t.call(this)||this,i=r,o=new hd,a=new Qu;return i.setTextContent(a),r.setTextGuideLine(o),r.updateData(e,n,!0),r}return e(n,t),n.prototype.updateData=function(t,e,n){var r=this,i=t.hostModel,o=t.getItemModel(e),a=t.getItemLayout(e),s=o.getModel("emphasis"),l=o.get(wV);l=null==l?1:l,n||Jd(r),r.useStyle(t.getItemVisual(e,"style")),r.style.lineJoin="round",n?(r.setShape({points:a.points}),r.style.opacity=0,jd(r,{style:{opacity:l}},i,e)):Xd(r,{style:{opacity:l},shape:{points:a.points}},i,e),lc(r,o),this._updateLabel(t,e),ic(this,s.get("focus"),s.get("blurScope"),s.get("disabled"))},n.prototype._updateLabel=function(t,e){var n=this,r=this.getTextGuideLine(),i=n.getTextContent(),o=t.hostModel,a=t.getItemModel(e),s=t.getItemLayout(e).label,l=t.getItemVisual(e,"style"),u=l.fill;jp(i,Zp(a),{labelFetcher:t.hostModel,labelDataIndex:e,defaultOpacity:l.opacity,defaultText:t.getName(e)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}});var h="inherit"===a.getModel("label").get("color")?u:null;n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:h,outsideFill:h});var c=s.linePoints;r.setShape({points:c}),n.textGuideLineConfig={anchor:c?new Re(c[0][0],c[0][1]):null},Xd(i,{style:{x:s.x,y:s.y}},o,e),i.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),LC(n,PC(a),{stroke:u})},n}(sd),TV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=_V,e.ignoreLabelLineUpdate=!0,e}return e(n,t),n.prototype.render=function(t,e,n){var r=t.getData(),i=this._data,o=this.group;r.diff(i).add(function(t){var e=new SV(r,t);r.setItemGraphicEl(t,e),o.add(e)}).update(function(t,e){var n=i.getItemGraphicEl(e);n.updateData(r,t),o.add(n),r.setItemGraphicEl(t,n)}).remove(function(e){Kd(i.getItemGraphicEl(e),t,e)}).execute(),this._data=r},n.prototype.remove=function(){this.group.removeAll(),this._data=null},n.prototype.dispose=function(){},n.type=_V,n}(l_),MV=TV;var CV=Cs(_V,function(t,e){t.eachSeriesByType(_V,function(t){var n=t.getData(),r=n.mapDimension("value"),i=t.get("sort"),o=jg(t,e),a=Ug(t.getBoxLayoutParams(),o.refContainer),s=IV(t),l=a.width,u=a.height,h=function(t,e){for(var n=t.mapDimension("value"),r=t.mapArray(n,function(t){return t}),i=[],o="ascending"===e,a=0,s=t.count();a<s;a++)i[a]=a;return Z(e)?i.sort(e):"none"!==e&&i.sort(function(t,e){return o?r[t]-r[e]:r[e]-r[t]}),i}(n,i),c=a.x,d=a.y,p=s?[Qo(t.get("minSize"),u),Qo(t.get("maxSize"),u)]:[Qo(t.get("minSize"),l),Qo(t.get("maxSize"),l)],f=n.getDataExtent(r),g=t.get("min"),m=t.get("max");null==g&&(g=Math.min(f[0],0)),null==m&&(m=f[1]);var v=t.get("funnelAlign"),y=t.get("gap"),_=((s?l:u)-y*(n.count()-1))/n.count(),x=function(t,e){if(s){var i=Jo(n.get(r,t)||0,[g,m],p,!0),o=void 0;switch(v){case"top":o=d;break;case"center":o=d+(u-i)/2;break;case"bottom":o=d+(u-i)}return[[e,o],[e,o+i]]}var a,h=Jo(n.get(r,t)||0,[g,m],p,!0);switch(v){case"left":a=c;break;case"center":a=c+(l-h)/2;break;case"right":a=c+l-h}return[[a,e],[a+h,e]]};"ascending"===i&&(_=-_,y=-y,s?c+=l:d+=u,h=h.reverse());for(var b=0;b<h.length;b++){var w=h[b],S=h[b+1],T=n.getItemModel(w);if(s){var M=T.get(["itemStyle","width"]);null==M?M=_:(M=Qo(M,l),"ascending"===i&&(M=-M));var C=x(w,c),I=x(S,c+M);c+=M+y,n.setItemLayout(w,{points:C.concat(I.slice().reverse())})}else{var A=T.get(["itemStyle","height"]);null==A?A=_:(A=Qo(A,u),"ascending"===i&&(A=-A));C=x(w,d),I=x(S,d+A);d+=A+y,n.setItemLayout(w,{points:C.concat(I.slice().reverse())})}}!function(t){var e=IV(t.hostModel);t.each(function(n){var r,i,o,a,s=t.getItemModel(n),l=s.getModel("label").get("position"),u=s.getModel("labelLine"),h=t.getItemLayout(n),c=h.points,d="inner"===l||"inside"===l||"center"===l||"insideLeft"===l||"insideRight"===l;if(d)"insideLeft"===l?(i=(c[0][0]+c[3][0])/2+5,o=(c[0][1]+c[3][1])/2,r="left"):"insideRight"===l?(i=(c[1][0]+c[2][0])/2-5,o=(c[1][1]+c[2][1])/2,r="right"):(i=(c[0][0]+c[1][0]+c[2][0]+c[3][0])/4,o=(c[0][1]+c[1][1]+c[2][1]+c[3][1])/4,r="center"),a=[[i,o],[i,o]];else{var p=void 0,f=void 0,g=void 0,m=void 0,v=u.get("length");Y(l)&&(!e&&N(["top","bottom"],l)>-1&&(l="left",console.warn("Position error: Funnel chart on vertical orient dose not support top and bottom.")),e&&N(["left","right"],l)>-1&&(l="bottom",console.warn("Position error: Funnel chart on horizontal orient dose not support left and right."))),"left"===l?(p=(c[3][0]+c[0][0])/2,f=(c[3][1]+c[0][1])/2,i=(g=p-v)-5,r="right"):"right"===l?(p=(c[1][0]+c[2][0])/2,f=(c[1][1]+c[2][1])/2,i=(g=p+v)+5,r="left"):"top"===l?(p=(c[3][0]+c[0][0])/2,o=(m=(f=(c[3][1]+c[0][1])/2)-v)-5,r="center"):"bottom"===l?(p=(c[1][0]+c[2][0])/2,o=(m=(f=(c[1][1]+c[2][1])/2)+v)+5,r="center"):"rightTop"===l?(p=e?c[3][0]:c[1][0],f=e?c[3][1]:c[1][1],e?(o=(m=f-v)-5,r="center"):(i=(g=p+v)+5,r="top")):"rightBottom"===l?(p=c[2][0],f=c[2][1],e?(o=(m=f+v)+5,r="center"):(i=(g=p+v)+5,r="bottom")):"leftTop"===l?(p=c[0][0],f=e?c[0][1]:c[1][1],e?(o=(m=f-v)-5,r="center"):(i=(g=p-v)-5,r="right")):"leftBottom"===l?(p=e?c[1][0]:c[3][0],f=e?c[1][1]:c[2][1],e?(o=(m=f+v)+5,r="center"):(i=(g=p-v)-5,r="right")):(p=(c[1][0]+c[2][0])/2,f=(c[1][1]+c[2][1])/2,e?(o=(m=f+v)+5,r="center"):(i=(g=p+v)+5,r="left")),e?i=g=p:o=m=f,a=[[p,f],[g,m]]}h.label={linePoints:a,x:i,y:o,verticalAlign:"middle",textAlign:r,inside:d}})}(n)})});function IV(t){return"horizontal"===t.get("orient")}var AV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._dataGroup=new Do,e._initialized=!1,e}return e(n,t),n.prototype.init=function(){this.group.add(this._dataGroup)},n.prototype.render=function(t,e,n,r){var i=this._dataGroup;this._progressiveEls=[],i.removeAll();var o=t.getData(),a=this._data,s=t.coordinateSystem,l=s.dimensions,u=PV(t);if(o.diff(a).add(function(t){EV(LV(o,i,t,l,s),o,t,u)}).update(function(e,n){var r=a.getItemGraphicEl(n);i.add(r);var h=DV(o,e,l,s);o.setItemGraphicEl(e,r),Xd(r,{shape:{points:h}},t,e),Jd(r),EV(r,o,e,u)}).remove(function(t){var e=a.getItemGraphicEl(t);i.remove(e)}).execute(),!this._initialized){this._initialized=!0;var h=function(t,e,n){var r=t.model,i=t.getRect(),o=new Ru({shape:{x:i.x,y:i.y,width:i.width,height:i.height}}),a="horizontal"===r.get("layout")?"width":"height";return o.setShape(a,0),jd(o,{shape:{width:i.width,height:i.height}},e,n),o}(s,t,function(){setTimeout(function(){i.removeClipPath()})});i.setClipPath(h)}this._data=o},n.prototype.incrementalPrepareRender=function(t,e,n){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},n.prototype.incrementalRender=function(t,e,n){for(var r=e.getData(),i=e.coordinateSystem,o=this._progressiveEls=[],a=t.start;a<t.end;a++){var s=LV(r,this._dataGroup,a,i.dimensions,i);s.incremental=Ss(e),EV(s,r,a,PV(e)),o.push(s)}},n.prototype.remove=function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null},n.type="parallel",n}(l_);function DV(t,e,n,r){for(var i=[],o=0;o<n.length;o++){var a=n[o],s=t.get(t.mapDimension(a),e);OV(s,r.getAxis(a).type)||i.push(r.dataToPoint(s,a))}return i}function LV(t,e,n,r,i){var o=DV(t,n,r,i),a=new hd({shape:{points:o},z2:10});return e.add(a),t.setItemGraphicEl(n,a),a}function PV(t){var e=t.get("smooth",!0);return!0===e&&(e=.3),it(e=_a(e))&&(e=0),{smooth:e}}function EV(t,e,n,r){t.useStyle(e.getItemVisual(n,"style")),t.style.fill=null,t.setShape("smooth",r.smooth);var i=e.getItemModel(n),o=i.getModel("emphasis");lc(t,i,"lineStyle"),ic(t,o.get("focus"),o.get("blurScope"),o.get("disabled"))}function OV(t,e){return"category"===e?null==t:null==t||isNaN(t)}var NV=AV,RV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.visualStyleAccessPath="lineStyle",e.visualDrawType="stroke",e}return e(n,t),n.prototype.getInitialData=function(t,e){return gS(null,this,{useEncodeDefaulter:W(kV,null,this)})},n.prototype.getRawIndicesByActiveState=function(t){var e=this.coordinateSystem,n=this.getData(),r=[];return e.eachActiveState(n,function(e,i){t===e&&r.push(n.getRawIndex(i))}),r},n.type="series.parallel",n.dependencies=["parallel"],n.defaultOption={z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:300,smooth:!1,animationEasing:"linear"},n}(Ky);function kV(t){var e=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(e){var n={};return B(e.dimensions,function(t){var e=+t.replace("dim","");n[t]=e}),n}}var zV=RV,BV=["lineStyle","opacity"],VV={seriesType:"parallel",reset:function(t,e){var n=t.coordinateSystem,r={normal:t.get(["lineStyle","opacity"]),active:t.get("activeOpacity"),inactive:t.get("inactiveOpacity")};return{progress:function(t,e){n.eachActiveState(e,function(t,n){var i=r[t];if("normal"===t&&e.hasItemOption){var o=e.getItemModel(n).get(BV,!0);null!=o&&(i=o)}e.ensureUniqueItemVisual(n,"style").opacity=i},t.start,t.end)}}}};function FV(t){!function(t){if(t.parallel)return;var e=!1;B(t.series,function(t){t&&"parallel"===t.type&&(e=!0)}),e&&(t.parallel=[{}])}(t),function(t){var e=Ba(t.parallelAxis);B(e,function(e){if(J(e)){var n=e.parallelIndex||0,r=Ba(t.parallel)[n];r&&r.parallelAxisDefault&&A(e,r.parallelAxisDefault,!1)}})}(t)}var GV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){this._model=t,this._api=n,this._handlers||(this._handlers={},B(HV,function(t,e){n.getZr().on(e,this._handlers[e]=W(t,this))},this)),p_(this,"_throttledDispatchExpand",t.get("axisExpandRate"),"fixRate")},n.prototype.dispose=function(t,e){f_(this,"_throttledDispatchExpand"),B(this._handlers,function(t,n){e.getZr().off(n,t)}),this._handlers=null},n.prototype._throttledDispatchExpand=function(t){this._dispatchExpand(t)},n.prototype._dispatchExpand=function(t){t&&this._api.dispatchAction(L({type:"parallelAxisExpand"},t))},n.type="parallel",n}(Qy),HV={mousedown:function(t){UV(this,"click")&&(this._mouseDownPoint=[t.offsetX,t.offsetY])},mouseup:function(t){var e=this._mouseDownPoint;if(UV(this,"click")&&e){var n=[t.offsetX,t.offsetY];if(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2)>5)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]);"none"!==r.behavior&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(t){if(!this._mouseDownPoint&&UV(this,"mousemove")){var e=this._model,n=e.coordinateSystem.getSlidedAxisExpandWindow([t.offsetX,t.offsetY]),r=n.behavior;"jump"===r&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===r?null:{axisExpandWindow:n.axisExpandWindow,animation:"jump"===r?null:{duration:0}})}}};function UV(t,e){var n=t._model;return n.get("axisExpandable")&&n.get("axisExpandTriggerOn")===e}var WV=GV,XV="parallel",jV=XV,ZV=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(){t.prototype.init.apply(this,arguments),this.mergeOption({})},n.prototype.mergeOption=function(t){var e=this.option;t&&A(e,t,!0),this._initDimensions()},n.prototype.contains=function(t,e){var n=t.get("parallelIndex");return null!=n&&e.getComponent("parallel",n)===this},n.prototype.setAxisExpand=function(t){B(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(e){t.hasOwnProperty(e)&&(this.option[e]=t[e])},this)},n.prototype._initDimensions=function(){var t=this.dimensions=[],e=this.parallelAxisIndex=[];B(G(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(t){return(t.get("parallelIndex")||0)===this.componentIndex},this),function(n){t.push("dim"+n.get("dim")),e.push(n.componentIndex)})},n.type=jV,n.dependencies=["parallelAxis"],n.layoutMode="box",n.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},n}(tm),YV=ZV,qV=function(t){function n(e,n,r,i,o){var a=t.call(this,e,n,r)||this;return a.type=i||"value",a.axisIndex=o,a}return e(n,t),n.prototype.isHorizontal=function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")},n}(rC),KV=qV;function JV(t,e,n,r,i,o){t=t||0;var a=la(n[1],-n[0]);if(null!=i&&(i=$V(i,[0,a])),null!=o&&(o=Math.max(o,null!=i?i:0)),"all"===r){var s=Math.abs(la(e[1],-e[0]));s=$V(s,[0,a]),i=o=$V(s,[i,o]),r=0}e[0]=$V(e[0],n),e[1]=$V(e[1],n);var l=QV(e,r);e[r]+=t;var u,h=i||0,c=n.slice();return l.sign<0?c[0]=la(c[0],h):c[1]=la(c[1],-h),e[r]=$V(e[r],c),u=QV(e,r),null!=i&&(u.sign!==l.sign||u.span<i)&&(e[1-r]=la(e[r],l.sign*i)),u=QV(e,r),null!=o&&u.span>o&&(e[1-r]=la(e[r],u.sign*o)),e}function QV(t,e){var n=t[e]-t[1-e];return{span:Math.abs(n),sign:n>0?-1:n<0?1:e?-1:1}}function $V(t,e){return Math.min(null!=e[1]?e[1]:1/0,Math.max(null!=e[0]?e[0]:-1/0,t))}var tF=function(){function t(t,e,n){this.type=XV,this._axesMap=yt(),this._axesLayout={},this.dimensions=t.dimensions,this._model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var r=t.dimensions,i=t.parallelAxisIndex;B(r,function(t,n){var r=i[n],o=e.getComponent("parallelAxis",r),a=dT(o),s=this._axesMap.set(t,new KV(t,pT(o,a,!1),[0,0],a,r));s.onBand=MT(s.scale,o),s.inverse=o.get("inverse"),o.axis=s,s.model=o,s.coordinateSystem=o.coordinateSystem=this},this)},t.prototype.update=function(t,e){B(this.dimensions,function(t){var e=this._axesMap.get(t);$T(e,1),aM(e)},this)},t.prototype.containPoint=function(t){var e=this._makeLayoutInfo(),n=e.axisBase,r=e.layoutBase,i=e.pixelDimIndex,o=t[1-i],a=t[i];return o>=n&&o<=n+e.axisLength&&a>=r&&a<=r+e.layoutLength},t.prototype.getModel=function(){return this._model},t.prototype.resize=function(t,e){var n=jg(t,e).refContainer;this._rect=Ug(t.getBoxLayoutParams(),n),this._layoutAxes()},t.prototype.getRect=function(){return this._rect},t.prototype._makeLayoutInfo=function(){var t,e=this._model,n=this._rect,r=["x","y"],i=["width","height"],o=e.get("layout"),a="horizontal"===o?0:1,s=n[i[a]],l=[0,s],u=this.dimensions.length,h=eF(e.get("axisExpandWidth"),l),c=eF(e.get("axisExpandCount")||0,[0,u]),d=e.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,p=e.get("axisExpandWindow");p?(t=eF(p[1]-p[0],l),p[1]=p[0]+t):(t=eF(h*(c-1),l),(p=[h*(e.get("axisExpandCenter")||Wo(u/2))-t/2])[1]=p[0]+t);var f=(s-t)/(u-c);f<3&&(f=0);var g=[Wo(ea(p[0]/h,1))+1,Xo(ea(p[1]/h,1))-1],m=f/h*p[0];return{layout:o,pixelDimIndex:a,layoutBase:n[r[a]],layoutLength:s,axisBase:n[r[1-a]],axisLength:n[i[1-a]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:f,axisExpandWindow:p,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},t.prototype._layoutAxes=function(){var t=this._rect,e=this._axesMap,n=this.dimensions,r=this._makeLayoutInfo(),i=r.layout;e.each(function(t){var e=[0,r.axisLength],n=t.inverse?1:0;t.setExtent(e[n],e[1-n])}),B(n,function(e,n){var o=(r.axisExpandable?rF:nF)(n,r),a={horizontal:{x:o.position,y:r.axisLength},vertical:{x:0,y:o.position}},s={horizontal:qo/2,vertical:0},l=[a[i].x+t.x,a[i].y+t.y],u=s[i],h=[1,0,0,1,0,0];De(h,h,u),Ae(h,h,l),this._axesLayout[e]={position:l,rotation:u,transform:h,axisNameAvailableWidth:o.axisNameAvailableWidth,axisLabelShow:o.axisLabelShow,nameTruncateMaxWidth:o.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},t.prototype.getAxis=function(t){return this._axesMap.get(t)},t.prototype.dataToPoint=function(t,e){return this.axisCoordToPoint(this._axesMap.get(e).dataToCoord(t),e)},t.prototype.eachActiveState=function(t,e,n,r){null==n&&(n=0),null==r&&(r=t.count());var i=this._axesMap,o=this.dimensions,a=[],s=[];B(o,function(e){a.push(t.mapDimension(e)),s.push(i.get(e).model)});for(var l=this.hasAxisBrushed(),u=n;u<r;u++){var h=void 0;if(l){h="active";for(var c=t.getValues(a,u),d=0,p=o.length;d<p;d++){if("inactive"===s[d].getActiveState(c[d])){h="inactive";break}}}else h="normal";e(h,u)}},t.prototype.hasAxisBrushed=function(){for(var t=this.dimensions,e=this._axesMap,n=!1,r=0,i=t.length;r<i;r++)"normal"!==e.get(t[r]).model.getActiveState()&&(n=!0);return n},t.prototype.axisCoordToPoint=function(t,e){return fp([t,0],this._axesLayout[e].transform)},t.prototype.getAxisLayout=function(t){return I(this._axesLayout[t])},t.prototype.getSlidedAxisExpandWindow=function(t){var e=this._makeLayoutInfo(),n=e.pixelDimIndex,r=e.axisExpandWindow.slice(),i=r[1]-r[0],o=[0,e.axisExpandWidth*(e.axisCount-1)];if(!this.containPoint(t))return{behavior:"none",axisExpandWindow:r};var a,s=t[n]-e.layoutBase-e.axisExpandWindow0Pos,l="slide",u=e.axisCollapseWidth,h=this._model.get("axisExpandSlideTriggerArea"),c=null!=h[0];if(u)c&&u&&s<i*h[0]?(l="jump",a=s-i*h[2]):c&&u&&s>i*(1-h[0])?(l="jump",a=s-i*(1-h[2])):(a=s-i*h[1])>=0&&(a=s-i*(1-h[1]))<=0&&(a=0),(a*=e.axisExpandWidth/u)?JV(a,r,o,"all"):l="none";else{var d=r[1]-r[0];(r=[Go(0,o[1]*s/d-d/2)])[1]=Fo(o[1],r[0]+d),r[0]=r[1]-d}return{axisExpandWindow:r,behavior:l}},t}();function eF(t,e){return Fo(Go(t,e[0]),e[1])}function nF(t,e){var n=e.layoutLength/(e.axisCount-1);return{position:n*t,axisNameAvailableWidth:n,axisLabelShow:!0}}function rF(t,e){var n,r,i=e.layoutLength,o=e.axisExpandWidth,a=e.axisCount,s=e.axisCollapseWidth,l=e.winInnerIndices,u=s,h=!1;return t<l[0]?(n=t*s,r=s):t<=l[1]?(n=e.axisExpandWindow0Pos+t*o-e.axisExpandWindow[0],u=o,h=!0):(n=i-(a-1-t)*s,r=s),{position:n,axisNameAvailableWidth:u,axisLabelShow:h,nameTruncateMaxWidth:r}}var iF=tF;var oF={create:function(t,e){var n=[];return t.eachComponent(jV,function(r,i){var o=new iF(r,t,e);o.name="parallel_"+i,o.resize(r,e),r.coordinateSystem=o,o.model=r,n.push(o)}),t.eachSeries(function(t){if(t.get("coordinateSystem")===XV){var e=t.getReferringComponents(jV,ns).models[0],n=t.coordinateSystem=e.coordinateSystem;n&&B(n.dimensions,function(e){UT(n.getAxis(e),t,XV)})}}),n}},aF=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.activeIntervals=[],e}return e(n,t),n.prototype.getAreaSelectStyle=function(){return zs([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},n.prototype.setActiveIntervals=function(t){var e=this.activeIntervals=I(t);if(e)for(var n=e.length-1;n>=0;n--)ra(e[n])},n.prototype.getActiveState=function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(+t))return"inactive";if(1===e.length){var n=e[0];if(n[0]<=t&&t<=n[1])return"active"}else for(var r=0,i=e.length;r<i;r++)if(e[r][0]<=t&&t<=e[r][1])return"active";return"inactive"},n}(tm);k(aF,IT);var sF=aF,lF=!0,uF=Math.min,hF=Math.max,cF=Math.pow,dF="globalPan",pF={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},fF={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},gF={brushStyle:{lineWidth:2,stroke:om.color.backgroundTint,fill:om.color.borderTint},transformable:!0,brushMode:"single",removeOnClick:!1},mF=0,vF=function(t){function n(e){var n=t.call(this)||this;return n._track=[],n._covers=[],n._handlers={},ht(e),n._zr=e,n.group=new Do,n._uid="brushController_"+mF++,B(WF,function(t,e){this._handlers[e]=W(t,this)},n),n}return e(n,t),n.prototype.enableBrush=function(t){return ht(this._mounted),this._brushType&&this._doDisableBrush(),t.brushType&&this._doEnableBrush(t),this},n.prototype._doEnableBrush=function(t){var e=this._zr;this._enableGlobalPan||function(t,e,n){wO(t)[e]=n}(e,dF,this._uid),B(this._handlers,function(t,n){e.on(n,t)}),this._brushType=t.brushType,this._brushOption=A(I(gF),t,!0)},n.prototype._doDisableBrush=function(){var t=this._zr;!function(t,e,n){var r=wO(t);r[e]===n&&(r[e]=null)}(t,dF,this._uid),B(this._handlers,function(e,n){t.off(n,e)}),this._brushType=this._brushOption=null},n.prototype.setPanels=function(t){if(t&&t.length){var e=this._panels={};B(t,function(t){e[t.panelId]=I(t)})}else this._panels=null;return this},n.prototype.mount=function(t){t=t||{},this._mounted=!0,this._enableGlobalPan=t.enableGlobalPan;var e=this.group;return this._zr.add(e),e.attr({x:t.x||0,y:t.y||0,rotation:t.rotation||0,scaleX:t.scaleX||1,scaleY:t.scaleY||1}),this._transform=e.getLocalTransform(),this},n.prototype.updateCovers=function(t){ht(this._mounted),t=V(t,function(t){return A(I(gF),t,!0)});var e=this._covers,n=this._covers=[],r=this,i=this._creatingCover;return new Ow(e,t,function(t,e){return o(t.__brushOption,e)},o).add(a).update(a).remove(function(t){e[t]!==i&&r.group.remove(e[t])}).execute(),this;function o(t,e){return(null!=t.id?t.id:"\0-brush-index-"+e)+"-"+t.brushType}function a(o,a){var s=t[o];if(null!=a&&e[a]===i)n[o]=e[a];else{var l=n[o]=null!=a?(e[a].__brushOption=s,e[a]):_F(r,yF(r,s));wF(r,l)}}},n.prototype.unmount=function(){if(this._mounted)return this.enableBrush(!1),CF(this),this._zr.remove(this.group),this._mounted=!1,this},n.prototype.dispose=function(){this.unmount(),this.off()},n}($t);function yF(t,e){var n=jF[e.brushType].createCover(t,e);return n.__brushOption=e,bF(n,e),t.group.add(n),n}function _F(t,e){var n=SF(e);return n.endCreating&&(n.endCreating(t,e),bF(e,e.__brushOption)),e}function xF(t,e){var n=e.__brushOption;SF(e).updateCoverShape(t,e,n.range,n)}function bF(t,e){var n=e.z;null==n&&(n=1e4),t.traverse(function(t){t.z=n,t.z2=n})}function wF(t,e){SF(e).updateCommon(t,e),xF(t,e)}function SF(t){return jF[t.__brushOption.brushType]}function TF(t,e,n){var r,i=t._panels;if(!i)return lF;var o=t._transform;return B(i,function(t){t.isTargetByCursor(e,n,o)&&(r=t)}),r}function MF(t,e){var n=t._panels;if(!n)return lF;var r=e.__brushOption.panelId;return null!=r?n[r]:lF}function CF(t){var e=t._covers,n=e.length;return B(e,function(e){t.group.remove(e)},t),e.length=0,!!n}function IF(t,e){var n=V(t._covers,function(t){var e=t.__brushOption,n=I(e.range);return{brushType:e.brushType,panelId:e.panelId,range:n}});t.trigger("brush",{areas:n,isEnd:!!e.isEnd,removeOnClick:!!e.removeOnClick})}function AF(t){var e=t.length-1;return e<0&&(e=0),[t[0],t[e]]}function DF(t,e,n,r){var i=new Do;return i.add(new Ru({name:"main",style:OF(n),silent:!0,draggable:!0,cursor:"move",drift:X(kF,t,e,i,["n","s","w","e"]),ondragend:X(IF,e,{isEnd:!0})})),B(r,function(n){i.add(new Ru({name:n.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:X(kF,t,e,i,n),ondragend:X(IF,e,{isEnd:!0})}))}),i}function LF(t,e,n,r){var i=r.brushStyle.lineWidth||0,o=hF(i,6),a=n[0][0],s=n[1][0],l=a-i/2,u=s-i/2,h=n[0][1],c=n[1][1],d=h-o+i/2,p=c-o+i/2,f=h-a,g=c-s,m=f+i,v=g+i;EF(t,e,"main",a,s,f,g),r.transformable&&(EF(t,e,"w",l,u,o,v),EF(t,e,"e",d,u,o,v),EF(t,e,"n",l,u,m,o),EF(t,e,"s",l,p,m,o),EF(t,e,"nw",l,u,o,o),EF(t,e,"ne",d,u,o,o),EF(t,e,"sw",l,p,o,o),EF(t,e,"se",d,p,o,o))}function PF(t,e){var n=e.__brushOption,r=n.transformable,i=e.childAt(0);i.useStyle(OF(n)),i.attr({silent:!r,cursor:r?"move":"default"}),B([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(n){var i=e.childOfName(n.join("")),o=1===n.length?RF(t,n[0]):function(t,e){var n=[RF(t,e[0]),RF(t,e[1])];return("e"===n[0]||"w"===n[0])&&n.reverse(),n.join("")}(t,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?fF[o]+"-resize":null})})}function EF(t,e,n,r,i,o,a){var s=e.childOfName(n);s&&s.setShape(function(t){var e=uF(t[0][0],t[1][0]),n=uF(t[0][1],t[1][1]),r=hF(t[0][0],t[1][0]),i=hF(t[0][1],t[1][1]);return{x:e,y:n,width:r-e,height:i-n}}(VF(t,e,[[r,i],[r+o,i+a]])))}function OF(t){return E({strokeNoScale:!0},t.brushStyle)}function NF(t,e,n,r){var i=[uF(t,n),uF(e,r)],o=[hF(t,n),hF(e,r)];return[[i[0],o[0]],[i[1],o[1]]]}function RF(t,e){var n=gp({w:"left",e:"right",n:"top",s:"bottom"}[e],function(t){return pp(t.group)}(t));return{left:"w",right:"e",top:"n",bottom:"s"}[n]}function kF(t,e,n,r,i,o){var a=n.__brushOption,s=t.toRectRange(a.range),l=BF(e,i,o);B(r,function(t){var e=pF[t];s[e[0]][e[1]]+=l[e[0]]}),a.range=t.fromRectRange(NF(s[0][0],s[1][0],s[0][1],s[1][1])),wF(e,n),IF(e,{isEnd:!1})}function zF(t,e,n,r){var i=e.__brushOption.range,o=BF(t,n,r);B(i,function(t){t[0]+=o[0],t[1]+=o[1]}),wF(t,e),IF(t,{isEnd:!1})}function BF(t,e,n){var r=t.group,i=r.transformCoordToLocal(e,n),o=r.transformCoordToLocal(0,0);return[i[0]-o[0],i[1]-o[1]]}function VF(t,e,n){var r=MF(t,e);return r&&r!==lF?r.clipPath(n,t._transform):I(n)}function FF(t){var e=t.event;e.preventDefault&&e.preventDefault()}function GF(t,e,n){return t.childOfName("main").contain(e,n)}function HF(t,e,n,r){var i,o=t._creatingCover,a=t._creatingPanel,s=t._brushOption;if(t._track.push(n.slice()),function(t){var e=t._track;if(!e.length)return!1;var n=e[e.length-1],r=e[0],i=n[0]-r[0],o=n[1]-r[1];return cF(i*i+o*o,.5)>6}(t)||o){if(a&&!o){"single"===s.brushMode&&CF(t);var l=I(s);l.brushType=UF(l.brushType,a),l.panelId=a===lF?null:a.panelId,o=t._creatingCover=yF(t,l),t._covers.push(o)}if(o){var u=jF[UF(t._brushType,a)];o.__brushOption.range=u.getCreatingRange(VF(t,o,t._track)),r&&(_F(t,o),u.updateCommon(t,o)),xF(t,o),i={isEnd:r}}}else r&&"single"===s.brushMode&&s.removeOnClick&&TF(t,e,n)&&CF(t)&&(i={isEnd:r,removeOnClick:!0});return i}function UF(t,e){return"auto"===t?(ht(e&&e.defaultBrushType,'MUST have defaultBrushType when brushType is "atuo"'),e.defaultBrushType):t}var WF={mousedown:function(t){if(this._dragging)XF(this,t);else if(!t.target||!t.target.draggable){FF(t);var e=this.group.transformCoordToLocal(t.offsetX,t.offsetY);this._creatingCover=null,(this._creatingPanel=TF(this,t,e))&&(this._dragging=!0,this._track=[e.slice()])}},mousemove:function(t){var e=t.offsetX,n=t.offsetY,r=this.group.transformCoordToLocal(e,n);if(function(t,e,n){if(t._brushType&&!function(t,e,n){var r=t._zr;return e<0||e>r.getWidth()||n<0||n>r.getHeight()}(t,e.offsetX,e.offsetY)){var r=t._zr,i=t._covers,o=TF(t,e,n);if(!t._dragging)for(var a=0;a<i.length;a++){var s=i[a].__brushOption;if(o&&(o===lF||s.panelId===o.panelId)&&jF[s.brushType].contain(i[a],n[0],n[1]))return}o&&r.setCursorStyle("crosshair")}}(this,t,r),this._dragging){FF(t);var i=HF(this,t,r,!1);i&&IF(this,i)}},mouseup:function(t){XF(this,t)}};function XF(t,e){if(t._dragging){FF(e);var n=e.offsetX,r=e.offsetY,i=t.group.transformCoordToLocal(n,r),o=HF(t,e,i,!0);t._dragging=!1,t._track=[],t._creatingCover=null,o&&IF(t,o)}}var jF={lineX:ZF(0),lineY:ZF(1),rect:{createCover:function(t,e){function n(t){return t}return DF({toRectRange:n,fromRectRange:n},t,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(t){var e=AF(t);return NF(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(t,e,n,r){LF(t,e,n,r)},updateCommon:PF,contain:GF},polygon:{createCover:function(t,e){var n=new Do;return n.add(new hd({name:"main",style:OF(e),silent:!0})),n},getCreatingRange:function(t){return t},endCreating:function(t,e){e.remove(e.childAt(0)),e.add(new sd({name:"main",draggable:!0,drift:X(zF,t,e),ondragend:X(IF,t,{isEnd:!0})}))},updateCoverShape:function(t,e,n,r){e.childAt(0).setShape({points:VF(t,e,n)})},updateCommon:PF,contain:GF}};function ZF(t){return{createCover:function(e,n){return DF({toRectRange:function(e){var n=[e,[0,100]];return t&&n.reverse(),n},fromRectRange:function(e){return e[t]}},e,n,[[["w"],["e"]],[["n"],["s"]]][t])},getCreatingRange:function(e){var n=AF(e);return[uF(n[0][t],n[1][t]),hF(n[0][t],n[1][t])]},updateCoverShape:function(e,n,r,i){var o,a=MF(e,n);if(a!==lF&&a.getLinearBrushOtherExtent)o=a.getLinearBrushOtherExtent(t);else{var s=e._zr;o=[0,[s.getWidth(),s.getHeight()][1-t]]}var l=[r,o];t&&l.reverse(),LF(e,n,l,i)},updateCommon:PF,contain:GF}}var YF=vF;function qF(t){return t=QF(t),function(e){return yp(e,t)}}function KF(t,e){return t=QF(t),function(n){var r=null!=e?e:n,i=r?t.width:t.height,o=r?t.x:t.y;return[o,o+(i||0)]}}function JF(t,e,n){var r=QF(t);return function(t,i){return r.contain(i[0],i[1])&&!MO(t,e,n)}}function QF(t){return ln.create(t)}var $F=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(e,n){t.prototype.init.apply(this,arguments),(this._brushController=new YF(n.getZr())).on("brush",W(this._onBrush,this))},n.prototype.render=function(t,e,n,r){if(!function(t,e,n){return n&&"axisAreaSelect"===n.type&&e.findComponents({mainType:"parallelAxis",query:n})[0]===t}(t,e,r)){this.axisModel=t,this.api=n,this.group.removeAll();var i=this._axisGroup;if(this._axisGroup=new Do,this.group.add(this._axisGroup),t.get("show")){var o=function(t,e){return e.getComponent("parallel",t.get("parallelIndex"))}(t,e),a=o.coordinateSystem,s=t.getAreaSelectStyle(),l=s.width,u=t.axis.dim,h=L({strokeContainThreshold:l},a.getAxisLayout(u)),c=new bL(t,n,h);c.build(),this._axisGroup.add(c.group),this._refreshBrushController(h,s,t,o,l,n),vp(i,this._axisGroup,t)}}},n.prototype._refreshBrushController=function(t,e,n,r,i,o){var a=n.axis.getExtent(),s=a[1]-a[0],l=Math.min(30,.1*Math.abs(s)),u=ln.create({x:a[0],y:-i/2,width:s,height:i});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:qF(u),isTargetByCursor:JF(u,o,r),getLinearBrushOtherExtent:KF(u,0)}]).enableBrush({brushType:"lineX",brushStyle:e,removeOnClick:!0}).updateCovers(function(t){var e=t.axis;return V(t.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}(n))},n.prototype._onBrush=function(t){var e=t.areas,n=this.axisModel,r=n.axis,i=V(e,function(t){return[r.coordToData(t.range[0],!0),r.coordToData(t.range[1],!0)]});(!n.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:n.id,intervals:i})},n.prototype.dispose=function(){this._brushController.dispose()},n.type="parallelAxis",n}(Qy);var tG=$F,eG={type:"axisAreaSelect",event:"axisAreaSelected"};var nG={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function rG(t){t.registerComponentView(WV),t.registerComponentModel(YV),t.registerCoordinateSystem("parallel",oF),t.registerPreprocessor(FV),t.registerComponentModel(sF),t.registerComponentView(tG),aE(t,"parallel",sF,nG),function(t){t.registerAction(eG,function(t,e){e.eachComponent({mainType:"parallelAxis",query:t},function(e){e.axis.model.setActiveIntervals(t.intervals)})}),t.registerAction("parallelAxisExpand",function(t,e){e.eachComponent({mainType:"parallel",query:t},function(e){e.setAxisExpand(t)})})}(t)}var iG="sankey",oG=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.getInitialData=function(t,e){var n=t.edges||t.links||[],r=t.data||t.nodes||[],i=t.levels||[];this.levelModels=[];for(var o=this.levelModels,a=0;a<i.length;a++){if(!(null!=i[a].depth&&i[a].depth>=0))throw new Error("levels[i].depth is mandatory and should be natural number");o[i[a].depth]=new xf(i[a],this,e)}var s=Kz(r,n,this,!0,function(t,e){t.wrapMethod("getItemModel",function(t,e){var n=t.parentModel,r=n.getData().getItemLayout(e);if(r){var i=r.depth,o=n.levelModels[i];o&&(t.parentModel=o)}return t}),e.wrapMethod("getItemModel",function(t,e){var n=t.parentModel,r=n.getGraph().getEdgeByIndex(e).node1.getLayout();if(r){var i=r.depth,o=n.levelModels[i];o&&(t.parentModel=o)}return t})});return s.data},n.prototype.setNodePosition=function(t,e){var n=(this.option.data||this.option.nodes)[t];n.localX=e[0],n.localY=e[1]},n.prototype.getGraph=function(){return this.getData().graph},n.prototype.getEdgeData=function(){return this.getGraph().edgeData},n.prototype.formatTooltip=function(t,e,n){function r(t){return isNaN(t)||null==t}if("edge"===n){var i=this.getDataParams(t,n),o=i.data,a=i.value;return Cy("nameValue",{name:o.source+" -- "+o.target,value:a,noValue:r(a)})}var s=this.getGraph().getNodeByIndex(t).getLayout().value,l=this.getDataParams(t,n).data.name;return Cy("nameValue",{name:null!=l?l+"":null,value:s,noValue:r(s)})},n.prototype.optionUpdated=function(){},n.prototype.getDataParams=function(e,n){var r=t.prototype.getDataParams.call(this,e,n);if(null==r.value&&"node"===n){var i=this.getGraph().getNodeByIndex(e).getLayout().value;r.value=i}return r},n.prototype.__ownRoamView=function(){return this.coordinateSystem},n.type="series."+iG,n.layoutMode="box",n.defaultOption={z:2,coordinateSystemUsage:"box",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,roam:!1,roamTrigger:"global",center:null,zoom:1,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:om.color.neutral50,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:om.color.primary}},animationEasing:"linear",animationDuration:1e3},n}(Ky),aG=oG,sG=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0},lG=function(t){function n(e){return t.call(this,e)||this}return e(n,t),n.prototype.getDefaultShape=function(){return new sG},n.prototype.buildPath=function(t,e){var n=e.extent;t.moveTo(e.x1,e.y1),t.bezierCurveTo(e.cpx1,e.cpy1,e.cpx2,e.cpy2,e.x2,e.y2),"vertical"===e.orient?(t.lineTo(e.x2+n,e.y2),t.bezierCurveTo(e.cpx2+n,e.cpy2,e.cpx1+n,e.cpy1,e.x1+n,e.y1)):(t.lineTo(e.x2,e.y2+n),t.bezierCurveTo(e.cpx2,e.cpy2+n,e.cpx1,e.cpy1+n,e.x1,e.y1+n)),t.closePath()},n.prototype.highlight=function(){Wh(this)},n.prototype.downplay=function(){Xh(this)},n}(xu),uG=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=iG,e._mainGroup=new Do,e}return e(n,t),n.prototype.init=function(t,e){this._controller=new kO(e.getZr()),this.group.add(this._mainGroup),this._firstRender=!0},n.prototype.render=function(t,e,n){var r=t.getGraph(),i=this._mainGroup,o=t.layoutInfo,a=o.width,s=o.height,l=t.getData(),u=t.getData("edge"),h=t.get("orient");i.removeAll(),i.x=o.x,i.y=o.y,this._updateViewCoordSys(t,n),sR(t,n,this._controller,lR(i),null),r.eachEdge(function(e){var n=new lG,r=$u(n);r.dataIndex=e.dataIndex,r.seriesIndex=t.seriesIndex,r.dataType="edge";var o,l,c,d,p,f,g,m,v=e.getModel(),y=v.getModel("lineStyle"),_=y.get("curveness"),x=e.node1.getLayout(),b=e.node1.getModel(),w=b.get("localX"),S=b.get("localY"),T=e.node2.getLayout(),M=e.node2.getModel(),C=M.get("localX"),I=M.get("localY"),A=e.getLayout();n.shape.extent=Math.max(1,A.dy),n.shape.orient=h,"vertical"===h?(o=(null!=w?w*a:x.x)+A.sy,l=(null!=S?S*s:x.y)+x.dy,c=(null!=C?C*a:T.x)+A.ty,p=o,f=l*(1-_)+(d=null!=I?I*s:T.y)*_,g=c,m=l*_+d*(1-_)):(o=(null!=w?w*a:x.x)+x.dx,l=(null!=S?S*s:x.y)+A.sy,p=o*(1-_)+(c=null!=C?C*a:T.x)*_,f=l,g=o*_+c*(1-_),m=d=(null!=I?I*s:T.y)+A.ty),n.setShape({x1:o,y1:l,x2:c,y2:d,cpx1:p,cpy1:f,cpx2:g,cpy2:m}),n.useStyle(y.getItemStyle()),hG(n.style,h,e);var D=""+v.get("value"),L=Zp(v,"edgeLabel");jp(n,L,{labelFetcher:{getFormattedLabel:function(e,n,r,i,o,a){return t.getFormattedLabel(e,n,"edge",i,st(o,L.normal&&L.normal.get("formatter"),D),a)}},labelDataIndex:e.dataIndex,defaultText:D}),n.setTextConfig({position:"inside"});var P=v.getModel("emphasis");lc(n,v,"lineStyle",function(t){var n=t.getItemStyle();return hG(n,h,e),n}),i.add(n),u.setItemGraphicEl(e.dataIndex,n);var E=P.get("focus");ic(n,"adjacency"===E?e.getAdjacentDataIndices():"trajectory"===E?e.getTrajectoryDataIndices():E,P.get("blurScope"),P.get("disabled"))}),r.eachNode(function(e){var n=e.getLayout(),r=e.getModel(),o=r.get("localX"),u=r.get("localY"),h=r.getModel("emphasis"),c=r.get(["itemStyle","borderRadius"])||0,d=new Ru({shape:{x:null!=o?o*a:n.x,y:null!=u?u*s:n.y,width:n.dx,height:n.dy,r:c},style:r.getModel("itemStyle").getItemStyle(),z2:10});jp(d,Zp(r),{labelFetcher:{getFormattedLabel:function(e,n){return t.getFormattedLabel(e,n,"node")}},labelDataIndex:e.dataIndex,defaultText:e.id}),d.disableLabelAnimation=!0,d.setStyle("fill",e.getVisual("color")),d.setStyle("decal",e.getVisual("style").decal),lc(d,r),i.add(d),l.setItemGraphicEl(e.dataIndex,d),$u(d).dataType="node";var p=h.get("focus");ic(d,"adjacency"===p?e.getAdjacentDataIndices():"trajectory"===p?e.getTrajectoryDataIndices():p,h.get("blurScope"),h.get("disabled"))}),l.eachItemGraphicEl(function(e,r){l.getItemModel(r).get("draggable")&&(e.drift=function(e,i){this.shape.x+=e,this.shape.y+=i,this.dirty(),n.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:l.getRawIndex(r),localX:this.shape.x/a,localY:this.shape.y/s})},e.draggable=!0,e.cursor="move")}),!this._data&&t.isAnimationEnabled()&&i.setClipPath(function(t,e,n){var r=new Ru({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return jd(r,{shape:{width:t.width+20}},e,n),r}(i.getBoundingRect(),t,function(){i.removeClipPath()})),this._data=t.getData(),this._firstRender=!1},n.prototype.__updateOnOwnRoam=function(t,e,n){jN(this.group,2,e.coordinateSystem,null)},n.prototype.dispose=function(){this._controller&&this._controller.dispose()},n.prototype._updateViewCoordSys=function(t,e){var n=t.layoutInfo,r=t.coordinateSystem=pR(t,e,n.x,n.y,n.width,n.height);jN(this.group,2,r,this._firstRender?null:t)},n.type=iG,n}(l_);function hG(t,e,n){switch(t.fill){case"source":t.fill=n.node1.getVisual("color"),t.decal=n.node1.getVisual("style").decal;break;case"target":t.fill=n.node2.getVisual("color"),t.decal=n.node2.getVisual("style").decal;break;case"gradient":var r=n.node1.getVisual("color"),i=n.node2.getVisual("color");Y(r)&&Y(i)&&(t.fill=new Id(0,0,+("horizontal"===e),+("vertical"===e),[{color:r,offset:0},{color:i,offset:1}]))}}var cG=uG,dG=Cs(iG,function(t,e){t.eachSeriesByType(iG,function(t){var n=t.get("nodeWidth"),r=t.get("nodeGap"),i=jg(t,e).refContainer,o=Ug(t.getBoxLayoutParams(),i);t.layoutInfo=o;var a=o.width,s=o.height,l=t.getGraph(),u=l.nodes,h=l.edges;!function(t){B(t,function(t){var e=wG(t.outEdges,bG),n=wG(t.inEdges,bG),r=t.getValue()||0,i=Math.max(e,n,r);t.setLayout({value:i},!0)})}(u),function(t,e,n,r,i,o,a,s,l){(function(t,e,n,r,i,o,a){for(var s=[],l=[],u=[],h=[],c=0,d=0;d<e.length;d++)s[d]=1;for(d=0;d<t.length;d++)l[d]=t[d].inEdges.length,0===l[d]&&u.push(t[d]);var p=-1;for(;u.length;){for(var f=0;f<u.length;f++){var g=u[f],m=g.hostGraph.data.getRawDataItem(g.dataIndex),v=null!=m.depth&&m.depth>=0;v&&m.depth>p&&(p=m.depth),g.setLayout({depth:v?m.depth:c},!0),"vertical"===o?g.setLayout({dy:n},!0):g.setLayout({dx:n},!0);for(var y=0;y<g.outEdges.length;y++){var _=g.outEdges[y];s[N(e,_)]=0;var x=_.node2;0===--l[N(t,x)]&&N(h,x)<0&&h.push(x)}}++c,u=h,h=[]}for(d=0;d<s.length;d++)if(1===s[d])throw new Error("Sankey is a DAG, the original data has cycle!");var b=p>c-1?p:c-1;a&&"left"!==a&&function(t,e,n,r){if("right"===e){for(var i=[],o=t,a=0;o.length;){for(var s=0;s<o.length;s++){var l=o[s];l.setLayout({skNodeHeight:a},!0);for(var u=0;u<l.inEdges.length;u++){var h=l.inEdges[u];N(i,h.node1)<0&&i.push(h.node1)}}o=i,i=[],++a}B(t,function(t){pG(t)||t.setLayout({depth:Math.max(0,r-t.getLayout().skNodeHeight)},!0)})}else"justify"===e&&function(t,e){B(t,function(t){pG(t)||t.outEdges.length||t.setLayout({depth:e},!0)})}(t,r)}(t,a,0,b);var w="vertical"===o?(i-n)/b:(r-n)/b;!function(t,e,n){B(t,function(t){var r=t.getLayout().depth*e;"vertical"===n?t.setLayout({y:r},!0):t.setLayout({x:r},!0)})}(t,w,o)})(t,e,n,i,o,s,l),function(t,e,n,r,i,o,a){var s=function(t,e){var n=[],r="vertical"===e?"y":"x",i=ss(t,function(t){return t.getLayout()[r]});return ra(i.keys),B(i.keys,function(t){n.push(i.buckets.get(t))}),n}(t,a);(function(t,e,n,r,i,o){var a=1/0;B(t,function(t){var e=t.length,s=0;B(t,function(t){s+=t.getLayout().value});var l="vertical"===o?(r-(e-1)*i)/s:(n-(e-1)*i)/s;l<a&&(a=l)}),B(t,function(t){B(t,function(t,e){var n=t.getLayout().value*a;"vertical"===o?(t.setLayout({x:e},!0),t.setLayout({dx:n},!0)):(t.setLayout({y:e},!0),t.setLayout({dy:n},!0))})}),B(e,function(t){var e=+t.getValue()*a;t.setLayout({dy:e},!0)})})(s,e,n,r,i,a),fG(s,i,n,r,a);for(var l=1;o>0;o--)gG(s,l*=.99,a),fG(s,i,n,r,a),SG(s,l,a),fG(s,i,n,r,a)}(t,e,o,i,r,a,s),function(t,e){var n="vertical"===e?"x":"y";B(t,function(t){t.outEdges.sort(function(t,e){return t.node2.getLayout()[n]-e.node2.getLayout()[n]}),t.inEdges.sort(function(t,e){return t.node1.getLayout()[n]-e.node1.getLayout()[n]})}),B(t,function(t){var e=0,n=0;B(t.outEdges,function(t){t.setLayout({sy:e},!0),e+=t.getLayout().dy}),B(t.inEdges,function(t){t.setLayout({ty:n},!0),n+=t.getLayout().dy})})}(t,s)}(u,h,n,r,a,s,0!==G(u,function(t){return 0===t.getLayout().value}).length?0:t.get("layoutIterations"),t.get("orient"),t.get("nodeAlign"))})});function pG(t){var e=t.hostGraph.data.getRawDataItem(t.dataIndex);return null!=e.depth&&e.depth>=0}function fG(t,e,n,r,i){var o="vertical"===i?"x":"y";B(t,function(t){var a,s,l;t.sort(function(t,e){return t.getLayout()[o]-e.getLayout()[o]});for(var u=0,h=t.length,c="vertical"===i?"dx":"dy",d=0;d<h;d++)(l=u-(s=t[d]).getLayout()[o])>0&&(a=s.getLayout()[o]+l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]+s.getLayout()[c]+e;if((l=u-e-("vertical"===i?r:n))>0){a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0),u=a;for(d=h-2;d>=0;--d)(l=(s=t[d]).getLayout()[o]+s.getLayout()[c]+e-u)>0&&(a=s.getLayout()[o]-l,"vertical"===i?s.setLayout({x:a},!0):s.setLayout({y:a},!0)),u=s.getLayout()[o]}})}function gG(t,e,n){B(t.slice().reverse(),function(t){B(t,function(t){if(t.outEdges.length){var r=wG(t.outEdges,mG,n)/wG(t.outEdges,bG);if(isNaN(r)){var i=t.outEdges.length;r=i?wG(t.outEdges,vG,n)/i:0}if("vertical"===n){var o=t.getLayout().x+(r-xG(t,n))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(r-xG(t,n))*e;t.setLayout({y:a},!0)}}})})}function mG(t,e){return xG(t.node2,e)*t.getValue()}function vG(t,e){return xG(t.node2,e)}function yG(t,e){return xG(t.node1,e)*t.getValue()}function _G(t,e){return xG(t.node1,e)}function xG(t,e){return"vertical"===e?t.getLayout().x+t.getLayout().dx/2:t.getLayout().y+t.getLayout().dy/2}function bG(t){return t.getValue()}function wG(t,e,n){for(var r=0,i=t.length,o=-1;++o<i;){var a=+e(t[o],n);isNaN(a)||(r+=a)}return r}function SG(t,e,n){B(t,function(t){B(t,function(t){if(t.inEdges.length){var r=wG(t.inEdges,yG,n)/wG(t.inEdges,bG);if(isNaN(r)){var i=t.inEdges.length;r=i?wG(t.inEdges,_G,n)/i:0}if("vertical"===n){var o=t.getLayout().x+(r-xG(t,n))*e;t.setLayout({x:o},!0)}else{var a=t.getLayout().y+(r-xG(t,n))*e;t.setLayout({y:a},!0)}}})})}var TG=Cs(iG,function(t){t.eachSeriesByType(iG,function(t){var e=t.getGraph(),n=e.nodes,r=e.edges;if(n.length){var i=1/0,o=-1/0;B(n,function(t){var e=t.getLayout().value;e<i&&(i=e),e>o&&(o=e)}),B(n,function(e){var n=new zz({type:"color",mappingMethod:"linear",dataExtent:[i,o],visual:t.get("color")}).mapValueToVisual(e.getLayout().value),r=e.getModel().get(["itemStyle","color"]);null!=r?(e.setVisual("color",r),e.setVisual("style",{fill:r})):(e.setVisual("color",n),e.setVisual("style",{fill:n}))})}r.length&&B(r,function(t){var e=t.getModel().get("lineStyle");t.setVisual("style",e)})})});var MG=function(){function t(){}return t.prototype._hasEncodeRule=function(t){var e=this.getEncode();return e&&null!=e.get(t)},t.prototype.getInitialData=function(t,e){var n,r,i=e.getComponent("xAxis",this.get("xAxisIndex")),o=e.getComponent("yAxis",this.get("yAxisIndex")),a=i.get("type"),s=o.get("type"),l=t.layout;"category"===a?(l="horizontal",n=i.getOrdinalMeta(),r=!this._hasEncodeRule("x")):"category"===s&&(l="vertical",n=o.getOrdinalMeta(),r=!this._hasEncodeRule("y")),l||(l="time"===s?"vertical":"horizontal"),this._layout=l;var u=["x","y"],h="horizontal"===l?0:1,c=this._baseAxisDim=u[h],d=u[1-h],p=[i,o],f=p[h].get("type"),g=p[1-h].get("type"),m=t.data;if(m&&r){var v=[];B(m,function(t,e){var n;j(t)?(n=t.slice(),t.unshift(e)):j(t.value)?((n=L({},t)).value=n.value.slice(),t.value.unshift(e)):n=t,v.push(n)}),t.data=v}var y=this.defaultValueDimensions,_=[{name:c,type:kw(f),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:d,type:kw(g),dimsDef:y.slice()}];return SP(this,{coordDimensions:_,dimensionsCount:y.length+1,encodeDefaulter:X(gm,_,this)})},t.prototype.getBaseAxis=function(){var t=this._baseAxisDim;return this.ecModel.getComponent(t+"Axis",this.get(t+"AxisIndex")).axis},t.prototype.getWhiskerBoxesLayout=function(){return this._layout},t}();function CG(t,e){for(var n=e.ends.length,r=0,i=0;i<n;i++)t.contain(e.ends[i][0],e.ends[i][1])&&r++;return r?r<n?1:0:2}var IG="boxplot",AG=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],e.visualDrawType="stroke",e}return e(n,t),n.type="series."+IG,n.dependencies=["xAxis","yAxis","grid"],n.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,boxWidth:[7,50],itemStyle:{color:om.color.neutral00,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:om.color.shadow}},animationDuration:800},n}(Ky);k(AG,MG,!0);var DG=AG,LG=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=IG,e}return e(n,t),n.prototype.render=function(t,e,n){var r=t.getData(),i=this.group,o=this._data;this._data||i.removeAll();var a="horizontal"===t.getWhiskerBoxesLayout()?1:0,s=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea(),h=s&&dD(l,!1,t);r.diff(o).add(function(t){if(r.hasValue(t)){var e=r.getItemLayout(t),n=s?CG(u,e):0;if(2===n)return;var o=OG(e,r,t,a,!0);pD(1===n,o,h),r.setItemGraphicEl(t,o),i.add(o)}}).update(function(t,e){var n=o.getItemGraphicEl(e);if(r.hasValue(t)){var l=r.getItemLayout(t),c=s?CG(u,l):0;2!==c?(n?(Jd(n),NG(l,n,r,t)):n=OG(l,r,t,a),pD(1===c,n,h),i.add(n),r.setItemGraphicEl(t,n)):i.remove(n)}else i.remove(n)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&i.remove(e)}).execute(),this._data=r},n.prototype.remove=function(t){var e=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl(function(t){t&&e.remove(t)})},n.type=IG,n}(l_),PG=function(){},EG=function(t){function n(e){var n=t.call(this,e)||this;return n.type="boxplotBoxPath",n}return e(n,t),n.prototype.getDefaultShape=function(){return new PG},n.prototype.buildPath=function(t,e){var n=e.points,r=0;for(t.moveTo(n[r][0],n[r][1]),r++;r<4;r++)t.lineTo(n[r][0],n[r][1]);for(t.closePath();r<n.length;r++)t.moveTo(n[r][0],n[r][1]),r++,t.lineTo(n[r][0],n[r][1])},n}(xu);function OG(t,e,n,r,i){var o=t.ends,a=new EG({shape:{points:i?RG(o,r,t):o}});return NG(t,a,e,n,i),a}function NG(t,e,n,r,i){var o=n.hostModel;(0,Hp[i?"initProps":"updateProps"])(e,{shape:{points:t.ends}},o,r),e.useStyle(n.getItemVisual(r,"style")),e.style.strokeNoScale=!0,e.z2=100;var a=n.getItemModel(r),s=a.getModel("emphasis");lc(e,a),ic(e,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function RG(t,e,n){return V(t,function(t){return(t=t.slice())[e]=n.initBaseline,t})}var kG=LG,zG=ys(),BG=Cs(IG,function(t){var e=IL(IG);BT(t,e,function(t){var n=function(t,e){ht(null!=e),CT(t);var n=ET(t,e);if(!n||!n.sers.length)return 0;var r=0;return zT(t.model.ecModel,n.sers,function(){r++}),r}(t,e);if(n){var r=function(t,e){var n=[],r=[],i=[],o=$M(t,{fromStat:{key:IL(IG)},min:1}).w;kT(t,IL(IG),function(t){var e=t.get("boxWidth");j(e)||(e=[e,e]),i[t.seriesIndex]=[Qo(e[0],o)||0,Qo(e[1],o)||0]});var a=.8*o-2,s=a/e*.3,l=(a-s*(e-1))/e,u=l/2-a/2;return kT(t,IL(IG),function(t){var e=t.seriesIndex;r[e]=u,u+=s+l,n[e]=Fo(Go(l,i[e][0]),i[e][1])}),{boxOffsetList:r,boxWidthList:n}}(t,n);kT(t,e,function(t){var e=t.seriesIndex;!function(t,e,n){var r=t.coordinateSystem,i=t.getData(),o=n/2,a="horizontal"===t.getWhiskerBoxesLayout()?0:1,s=1-a,l=["x","y"],u=i.mapDimension(l[a]),h=i.mapDimensionsAll(l[s]);if(null==u||h.length<5)return;for(var c=0;c<i.count();c++){var d=i.get(u,c),p=_(d,h[2],c),f=_(d,h[0],c),g=_(d,h[1],c),m=_(d,h[3],c),v=_(d,h[4],c),y=[];x(y,g,!1),x(y,m,!0),y.push(f,g,v,m),b(y,f),b(y,v),b(y,p),i.setItemLayout(c,{initBaseline:p[s],ends:y})}function _(t,n,o){var l,u=i.get(n,o),h=[];return h[a]=t,h[s]=u,isNaN(t)||isNaN(u)?l=[NaN,NaN]:(l=r.dataToPoint(h))[a]+=e,l}function x(t,e,n){var r=e.slice(),i=e.slice();r[a]+=o,i[a]-=o,n?t.push(r,i):t.push(i,r)}function b(t,e){var n=e.slice(),r=e.slice();n[a]-=o,r[a]+=o,t.push(n,r)}}(t,r.boxOffsetList[e],r.boxWidthList[e])})}})});var VG={type:"echarts:boxplot",transform:function(t){var e=t.upstream;if(e.sourceFormat!==oh){Na(Oa("source data is not applicable for this boxplot transform. Expect number[][]."))}var n=function(t,e){for(var n=[],r=[],i=(e=e||{}).boundIQR,o="none"===i||0===i,a=0;a<t.length;a++){var s=ra(t[a].slice()),l=va(s,.25),u=va(s,.5),h=va(s,.75),c=s[0],d=s[s.length-1],p=(null==i?1.5:i)*(h-l),f=o?c:Math.max(c,l-p),g=o?d:Math.min(d,h+p),m=e.itemNameFormatter,v=Z(m)?m({value:a}):Y(m)?m.replace("{value}",a+""):a+"";n.push([v,f,l,u,h,g]);for(var y=0;y<s.length;y++){var _=s[y];if(_<f||_>g){var x=[v,_];r.push(x)}}}return{boxData:n,outliers:r}}(e.getRawData(),t.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:n.boxData},{data:n.outliers}]}};var FG="candlestick",GG=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.defaultValueDimensions=[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],e}return e(n,t),n.prototype.getShadowDim=function(){return"open"},n.prototype.brushSelector=function(t,e,n){var r=e.getItemLayout(t);return r&&n.rect(r.brushRect)},n.type="series."+FG,n.dependencies=["xAxis","yAxis","grid"],n.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,clip:!0,itemStyle:{color:"#eb5454",color0:"#47b262",borderColor:"#eb5454",borderColor0:"#47b262",borderColorDoji:null,borderWidth:1},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationEasing:"linear",animationDuration:300},n}(Ky);k(GG,MG,!0);var HG=GG,UG=["itemStyle","borderColor"],WG=["itemStyle","borderColor0"],XG=["itemStyle","borderColorDoji"],jG=["itemStyle","color"],ZG=["itemStyle","color0"];function YG(t,e){return e.get(t>0?jG:ZG)}function qG(t,e){return e.get(0===t?XG:t>0?UG:WG)}var KG={seriesType:FG,plan:$y(),performRawSeries:!0,reset:function(t,e){if(!e.isSeriesFiltered(t))return!t.pipelineContext.large&&{progress:function(t,e){for(var n;null!=(n=t.next());){var r=e.getItemModel(n),i=e.getItemLayout(n).sign,o=r.getItemStyle();o.fill=YG(i,r),o.stroke=qG(i,r)||o.fill,L(e.ensureUniqueItemVisual(n,"style"),o)}}}}},JG=KG,QG=["color","borderColor"],$G=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},n.prototype.incrementalPrepareRender=function(t,e,n){this._clear(),this._updateDrawMode(t)},n.prototype.incrementalRender=function(t,e,n,r){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,e):this._incrementalRenderNormal(t,e)},n.prototype.eachRendered=function(t){Dp(this._progressiveEls||this.group,t)},n.prototype._updateDrawMode=function(t){var e=t.pipelineContext.large;null!=this._isLargeDraw&&e===this._isLargeDraw||(this._isLargeDraw=e,this._clear())},n.prototype._renderNormal=function(t){var e=t.getData(),n=this._data,r=this.group,i=e.getLayout("isSimpleBox"),o=t.get("clip",!0),a=t.coordinateSystem,s=a.getArea&&a.getArea(),l=o&&dD(a,!1,t);this._data||r.removeAll();var u=oH(t);e.diff(n).add(function(n){if(e.hasValue(n)){var a=e.getItemLayout(n),h=o?CG(s,a):0;if(2===h)return;var c=nH(a,n,u,!0);jd(c,{shape:{points:a.ends}},t,n),pD(1===h,c,l),rH(c,e,n,i),r.add(c),e.setItemGraphicEl(n,c)}}).update(function(a,h){var c=n.getItemGraphicEl(h);if(e.hasValue(a)){var d=e.getItemLayout(a),p=o?CG(s,d):0;2!==p?(c?(Xd(c,{shape:{points:d.ends}},t,a),Jd(c)):c=nH(d,a,u),rH(c,e,a,i),pD(1===p,c,l),r.add(c),e.setItemGraphicEl(a,c)):r.remove(c)}else r.remove(c)}).remove(function(t){var e=n.getItemGraphicEl(t);e&&r.remove(e)}).execute(),this._data=e},n.prototype._renderLarge=function(t){this._clear(),lH(t,this.group);var e=t.get("clip",!0)?dD(t.coordinateSystem,!1,t):null;pD(!!e,this.group,e)},n.prototype._incrementalRenderNormal=function(t,e){for(var n,r=e.getData(),i=r.getLayout("isSimpleBox"),o=oH(e);null!=(n=t.next());){var a=nH(r.getItemLayout(n),n,o);rH(a,r,n,i),a.incremental=Ss(e),this.group.add(a),this._progressiveEls.push(a)}},n.prototype._incrementalRenderLarge=function(t,e){lH(e,this.group,this._progressiveEls,!0)},n.prototype.remove=function(t){this._clear()},n.prototype._clear=function(){this.group.removeAll(),pD(!1,this.group,null),this._data=null},n.type=FG,n}(l_),tH=function(){},eH=function(t){function n(e){var n=t.call(this,e)||this;return n.type="normalCandlestickBox",n}return e(n,t),n.prototype.getDefaultShape=function(){return new tH},n.prototype.buildPath=function(t,e){var n=e.points;this.__simpleBox?(t.moveTo(n[4][0],n[4][1]),t.lineTo(n[6][0],n[6][1])):(t.moveTo(n[0][0],n[0][1]),t.lineTo(n[1][0],n[1][1]),t.lineTo(n[2][0],n[2][1]),t.lineTo(n[3][0],n[3][1]),t.closePath(),t.moveTo(n[4][0],n[4][1]),t.lineTo(n[5][0],n[5][1]),t.moveTo(n[6][0],n[6][1]),t.lineTo(n[7][0],n[7][1]))},n}(xu);function nH(t,e,n,r){var i=t.ends;return new eH({shape:{points:r?iH(i,n,t):i},z2:100})}function rH(t,e,n,r){var i=e.getItemModel(n);t.useStyle(e.getItemVisual(n,"style")),t.style.strokeNoScale=!0;var o=i.getShallow("cursor");o&&t.attr("cursor",o),t.__simpleBox=r,lc(t,i);var a=e.getItemLayout(n).sign;B(t.states,function(t,e){var n=i.getModel(e),r=YG(a,n),o=qG(a,n)||r,s=t.style||(t.style={});r&&(s.fill=r),o&&(s.stroke=o)});var s=i.getModel("emphasis");ic(t,s.get("focus"),s.get("blurScope"),s.get("disabled"))}function iH(t,e,n){return V(t,function(t){return(t=t.slice())[e]=n.initBaseline,t})}function oH(t){return"horizontal"===t.getWhiskerBoxesLayout()?1:0}var aH=function(){},sH=function(t){function n(e){var n=t.call(this,e)||this;return n.type="largeCandlestickBox",n}return e(n,t),n.prototype.getDefaultShape=function(){return new aH},n.prototype.buildPath=function(t,e){for(var n=e.points,r=0;r<n.length;)if(this.__sign===n[r++]){var i=n[r++];t.moveTo(i,n[r++]),t.lineTo(i,n[r++])}else r+=3},n}(xu);function lH(t,e,n,r){var i=t.getData().getLayout("largePoints"),o=new sH({shape:{points:i},__sign:1,ignoreCoarsePointer:!0});e.add(o);var a=new sH({shape:{points:i},__sign:-1,ignoreCoarsePointer:!0});e.add(a);var s=new sH({shape:{points:i},__sign:0,ignoreCoarsePointer:!0});e.add(s),uH(1,o,t),uH(-1,a,t),uH(0,s,t),r&&(o.incremental=Ss(t),a.incremental=Ss(t),s.incremental=Ss(t)),n&&n.push(o,a,s)}function uH(t,e,n,r){var i=qG(t,n)||YG(t,n),o=n.getModel("itemStyle").getItemStyle(QG);e.useStyle(o),e.style.fill=null,e.style.stroke=i;var a=n.get("cursor");a&&e.attr("cursor",a)}var hH=$G;function cH(t){t&&j(t.series)&&B(t.series,function(t){J(t)&&"k"===t.type&&(t.type=FG)})}var dH=ys(),pH={seriesType:FG,plan:$y(),reset:function(t){var e=t.coordinateSystem,n=t.getData(),r=function(t){var e=t.getBaseAxis(),n=$M(e,{fromStat:{key:IL(FG)},min:1}).w,r=Qo(at(t.get("barMaxWidth"),n),n),i=Qo(at(t.get("barMinWidth"),1),n),o=t.get("barWidth");return null!=o?Qo(o,n):Go(Fo(n/2,r),i)}(t),i="horizontal"===t.getWhiskerBoxesLayout()?0:1,o=1-i,a=["x","y"],s=n.getDimensionIndex(n.mapDimension(a[i])),l=V(n.mapDimensionsAll(a[o]),n.getDimensionIndex,n),u=l[0],h=l[1],c=l[2],d=l[3];if(n.setLayout({candleWidth:r,isSimpleBox:r<=1.3}),!(s<0||l.length<4))return{progress:t.pipelineContext.large?function(n,r){var a,l,p=eD(4*n.count),f=0,g=[],m=[],v=r.getStore(),y=!!t.get(["itemStyle","borderColorDoji"]);for(;null!=(l=n.next());){var _=v.get(s,l),x=v.get(u,l),b=v.get(h,l),w=v.get(c,l),S=v.get(d,l);isNaN(_)||isNaN(w)||isNaN(S)?(p[f++]=NaN,f+=3):(p[f++]=fH(v,l,x,b,h,y),g[i]=_,g[o]=w,a=e.dataToPoint(g,null,m),p[f++]=a?a[0]:NaN,p[f++]=a?a[1]:NaN,g[o]=S,a=e.dataToPoint(g,null,m),p[f++]=a?a[1]:NaN)}r.setLayout("largePoints",p)}:function(t,n){var a,l=n.getStore();for(;null!=(a=t.next());){var p=l.get(s,a),f=l.get(u,a),g=l.get(h,a),m=l.get(c,a),v=l.get(d,a),y=Fo(f,g),_=Go(f,g),x=C(y,p),b=C(_,p),w=C(m,p),S=C(v,p),T=[];I(T,b,0),I(T,x,1),T.push(D(S),D(b),D(w),D(x));var M=!!n.getItemModel(a).get(["itemStyle","borderColorDoji"]);n.setItemLayout(a,{sign:fH(l,a,f,g,h,M),initBaseline:f>g?b[o]:x[o],ends:T,brushRect:A(m,v,p)})}function C(t,n){var r=[];return r[i]=n,r[o]=t,isNaN(n)||isNaN(t)?[NaN,NaN]:e.dataToPoint(r)}function I(t,e,n){var o=e.slice(),a=e.slice();o[i]=dp(o[i]+r/2,1,!1),a[i]=dp(a[i]-r/2,1,!0),n?t.push(o,a):t.push(a,o)}function A(t,e,n){var a=C(t,n),s=C(e,n);return a[i]-=r/2,s[i]-=r/2,{x:a[0],y:a[1],width:o?r:s[0]-a[0],height:o?s[1]-a[1]:r}}function D(t){return t[i]=dp(t[i],1),t}}}}};function fH(t,e,n,r,i,o){return n>r?-1:n<r?1:o?0:e>0?t.get(i,e-1)<=r?1:-1:1}function gH(t,e){var n=e.rippleEffectColor||e.color;t.eachChild(function(t){t.attr({z:e.z,zlevel:e.zlevel,style:{stroke:"stroke"===e.brushType?n:null,fill:"fill"===e.brushType?n:null}})})}var mH=function(t){function n(e,n){var r=t.call(this)||this,i=new UA(e,n),o=new Do;return r.add(i),r.add(o),r.updateData(e,n),r}return e(n,t),n.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},n.prototype.startEffectAnimation=function(t){for(var e=t.symbolType,n=t.color,r=t.rippleNumber,i=this.childAt(1),o=0;o<r;o++){var a=Cx(e,-1,-1,2,2,n);a.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scaleX:.5,scaleY:.5});var s=-o/r*t.period+t.effectOffset;a.animate("",!0).when(t.period,{scaleX:t.rippleScale/2,scaleY:t.rippleScale/2}).delay(s).start(),a.animateStyle(!0).when(t.period,{opacity:0}).delay(s).start(),i.add(a)}gH(i,t)},n.prototype.updateEffectAnimation=function(t){for(var e=this._effectCfg,n=this.childAt(1),r=["symbolType","period","rippleScale","rippleNumber"],i=0;i<r.length;i++){var o=r[i];if(e[o]!==t[o])return this.stopEffectAnimation(),void this.startEffectAnimation(t)}gH(n,t)},n.prototype.highlight=function(){Wh(this)},n.prototype.downplay=function(){Xh(this)},n.prototype.getSymbolType=function(){var t=this.childAt(0);return t&&t.getSymbolType()},n.prototype.updateData=function(t,e){var n=this,r=t.hostModel;this.childAt(0).updateData(t,e);var i=this.childAt(1),o=t.getItemModel(e),a=t.getItemVisual(e,"symbol"),s=Ix(t.getItemVisual(e,"symbolSize")),l=t.getItemVisual(e,"style"),u=l&&l.fill,h=o.getModel("emphasis");i.setScale(s),i.traverse(function(t){t.setStyle("fill",u)});var c=Ax(t.getItemVisual(e,"symbolOffset"),s);c&&(i.x=c[0],i.y=c[1]);var d=t.getItemVisual(e,"symbolRotate");i.rotation=(d||0)*Math.PI/180||0;var p={};p.showEffectOn=r.get("showEffectOn"),p.rippleScale=o.get(["rippleEffect","scale"]),p.brushType=o.get(["rippleEffect","brushType"]),p.period=1e3*o.get(["rippleEffect","period"]),p.effectOffset=e/t.count(),p.z=r.getShallow("z")||0,p.zlevel=r.getShallow("zlevel")||0,p.symbolType=a,p.color=u,p.rippleEffectColor=o.get(["rippleEffect","color"]),p.rippleNumber=o.get(["rippleEffect","number"]),"render"===p.showEffectOn?(this._effectCfg?this.updateEffectAnimation(p):this.startEffectAnimation(p),this._effectCfg=p):(this._effectCfg=null,this.stopEffectAnimation(),this.onHoverStateChange=function(t){"emphasis"===t?"render"!==p.showEffectOn&&n.startEffectAnimation(p):"normal"===t&&"render"!==p.showEffectOn&&n.stopEffectAnimation()}),this._effectCfg=p,ic(this,h.get("focus"),h.get("blurScope"),h.get("disabled"))},n.prototype.fadeOut=function(t){t&&t()},n}(Do),vH=mH,yH=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(){this._symbolDraw=new qA(vH)},n.prototype.render=function(t,e,n){var r=t.getData(),i=this._symbolDraw;i.updateData(r,_H(t)),this.group.add(i.group)},n.prototype.updateTransform=function(t,e,n){var r=t.getData();this.group.dirty();var i=kD("").reset(t,e,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(_H(t))},n.prototype._updateGroupTransform=function(t){var e=t.coordinateSystem;e&&e.getRoamTransform&&(this.group.transform=Ee(e.getRoamTransform()),this.group.decomposeTransform())},n.prototype.remove=function(t,e){this._symbolDraw&&this._symbolDraw.remove(!0)},n.type="effectScatter",n}(l_);function _H(t){return{clipShape:fD(t)}}var xH=yH,bH=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e}return e(n,t),n.prototype.getInitialData=function(t,e){return gS(null,this,{useEncodeDefaulter:!0})},n.prototype.brushSelector=function(t,e,n){return n.point(e.getItemLayout(t))},n.type="series.effectScatter",n.dependencies=["grid","polar"],n.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",clip:!0,rippleEffect:{period:4,scale:2.5,brushType:"fill",number:3},universalTransition:{divideShape:"clone"},symbolSize:10},n}(Ky),wH=bH;var SH=function(t){function n(e,n,r){var i=t.call(this)||this;return i.add(i.createLine(e,n,r)),i._updateEffectSymbol(e,n),i}return e(n,t),n.prototype.createLine=function(t,e,n){return new NB(t,e,n)},n.prototype._updateEffectSymbol=function(t,e){var n=t.getItemModel(e).getModel("effect"),r=n.get("symbolSize"),i=n.get("symbol");j(r)||(r=[r,r]);var o=t.getItemVisual(e,"style"),a=n.get("color")||o&&o.stroke,s=this.childAt(1);this._symbolType!==i&&(this.remove(s),(s=Cx(i,-.5,-.5,1,1,a)).z2=100,s.culling=!0,this.add(s)),s&&(s.setStyle("shadowColor",a),s.setStyle(n.getItemStyle(["color"])),s.scaleX=r[0],s.scaleY=r[1],s.setColor(a),this._symbolType=i,this._symbolScale=r,this._updateEffectAnimation(t,n,e))},n.prototype._updateEffectAnimation=function(t,e,n){var r=this.childAt(1);if(r){var i=t.getItemLayout(n),o=1e3*e.get("period"),a=e.get("loop"),s=e.get("roundTrip"),l=e.get("constantSpeed"),u=ot(e.get("delay"),function(e){return e/t.count()*o/3});if(r.ignore=!0,this._updateAnimationPoints(r,i),l>0&&(o=this._getLineLength(r)/l*1e3),o!==this._period||a!==this._loop||s!==this._roundTrip){r.stopAnimation();var h=void 0;h=Z(u)?u(n):u,r.__t>0&&(h=-o*r.__t),this._animateSymbol(r,o,h,a,s)}this._period=o,this._loop=a,this._roundTrip=s}},n.prototype._animateSymbol=function(t,e,n,r,i){if(e>0){t.__t=0;var o=this,a=t.animate("",r).when(i?2*e:e,{__t:i?2:1}).delay(n).during(function(){o._updateSymbolPosition(t)});r||a.done(function(){o.remove(t)}),a.start()}},n.prototype._getLineLength=function(t){return Gt(t.__p1,t.__cp1)+Gt(t.__cp1,t.__p2)},n.prototype._updateAnimationPoints=function(t,e){t.__p1=e[0],t.__p2=e[1],t.__cp1=e[2]||[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]},n.prototype.updateData=function(t,e,n){this.childAt(0).updateData(t,e,n),this._updateEffectSymbol(t,e)},n.prototype._updateSymbolPosition=function(t){var e=t.__p1,n=t.__p2,r=t.__cp1,i=t.__t<=1?t.__t:2-t.__t,o=[t.x,t.y],a=o.slice(),s=Qn,l=$n;o[0]=s(e[0],r[0],n[0],i),o[1]=s(e[1],r[1],n[1],i);var u=t.__t<=1?l(e[0],r[0],n[0],i):l(n[0],r[0],e[0],1-i),h=t.__t<=1?l(e[1],r[1],n[1],i):l(n[1],r[1],e[1],1-i);t.rotation=-Math.atan2(h,u)-Math.PI/2,"line"!==this._symbolType&&"rect"!==this._symbolType&&"roundRect"!==this._symbolType||(void 0!==t.__lastT&&t.__lastT<t.__t?(t.scaleY=1.05*Gt(a,o),1===i&&(o[0]=a[0]+(o[0]-a[0])/2,o[1]=a[1]+(o[1]-a[1])/2)):1===t.__lastT?t.scaleY=2*Gt(e,o):t.scaleY=this._symbolScale[1]),t.__lastT=t.__t,t.ignore=!1,t.x=o[0],t.y=o[1]},n.prototype.updateLayout=function(t,e){this.childAt(0).updateLayout(t,e);var n=t.getItemModel(e).getModel("effect");this._updateEffectAnimation(t,n,e)},n}(Do),TH=SH,MH=function(t){function n(e,n,r){var i=t.call(this)||this;return i._createPolyline(e,n,r),i}return e(n,t),n.prototype._createPolyline=function(t,e,n){var r=t.getItemLayout(e),i=new hd({shape:{points:r}});this.add(i),this._updateCommonStl(t,e,n)},n.prototype.updateData=function(t,e,n){var r=t.hostModel;Xd(this.childAt(0),{shape:{points:t.getItemLayout(e)}},r,e),this._updateCommonStl(t,e,n)},n.prototype._updateCommonStl=function(t,e,n){var r=this.childAt(0),i=t.getItemModel(e),o=n&&n.emphasisLineStyle,a=n&&n.focus,s=n&&n.blurScope,l=n&&n.emphasisDisabled;if(!n||t.hasItemOption){var u=i.getModel("emphasis");o=u.getModel("lineStyle").getLineStyle(),l=u.get("disabled"),a=u.get("focus"),s=u.get("blurScope")}r.useStyle(t.getItemVisual(e,"style")),r.style.fill=null,r.style.strokeNoScale=!0,r.ensureState("emphasis").style=o,ic(this,a,s,l)},n.prototype.updateLayout=function(t,e){var n=this.childAt(0);n.stopAnimation(),n.setShape("points",t.getItemLayout(e))},n}(Do),CH=MH,IH=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._lastFrame=0,e._lastFramePercent=0,e}return e(n,t),n.prototype.createLine=function(t,e,n){return new CH(t,e,n)},n.prototype._updateAnimationPoints=function(t,e){this._points=e;for(var n=[0],r=0,i=1;i<e.length;i++){var o=e[i-1],a=e[i];r+=Gt(o,a),n.push(r)}if(0!==r){for(i=0;i<n.length;i++)n[i]/=r;this._offsets=n,this._length=r}else this._length=0},n.prototype._getLineLength=function(){return this._length},n.prototype._updateSymbolPosition=function(t){var e=t.__t<=1?t.__t:2-t.__t,n=this._points,r=this._offsets,i=n.length;if(r){var o,a=this._lastFrame;if(e<this._lastFramePercent){for(o=Math.min(a+1,i-1);o>=0&&!(r[o]<=e);o--);o=Math.min(o,i-2)}else{for(o=a;o<i&&!(r[o]>e);o++);o=Math.min(o-1,i-2)}var s=(e-r[o])/(r[o+1]-r[o]),l=n[o],u=n[o+1];t.x=l[0]*(1-s)+s*u[0],t.y=l[1]*(1-s)+s*u[1];var h=t.__t<=1?u[0]-l[0]:l[0]-u[0],c=t.__t<=1?u[1]-l[1]:l[1]-u[1];t.rotation=-Math.atan2(c,h)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=e,t.ignore=!1}},n}(TH),AH=IH,DH=function(){this.polyline=!1,this.curveness=0,this.segs=[]},LH=function(t){function n(e){var n=t.call(this,e)||this;return n._off=0,n.hoverDataIdx=-1,n}return e(n,t),n.prototype.reset=function(){this.notClear=!1,this._off=0},n.prototype.beforeBrush=function(t){t&&!t.contentRetained&&this.reset()},n.prototype.getDefaultStyle=function(){return{stroke:om.color.neutral99,fill:null}},n.prototype.getDefaultShape=function(){return new DH},n.prototype.buildPath=function(t,e){var n,r=e.segs,i=e.curveness;if(e.polyline)for(n=this._off;n<r.length;){var o=r[n++];if(o>0){t.moveTo(r[n++],r[n++]);for(var a=1;a<o;a++)t.lineTo(r[n++],r[n++])}}else for(n=this._off;n<r.length;){var s=r[n++],l=r[n++],u=r[n++],h=r[n++];if(t.moveTo(s,l),i>0){var c=(s+u)/2-(l-h)*i,d=(l+h)/2-(u-s)*i;t.quadraticCurveTo(c,d,u,h)}else t.lineTo(u,h)}this.incremental&&(this._off=n,this.notClear=!0)},n.prototype.findDataIndex=function(t,e){var n=this.shape,r=n.segs,i=n.curveness,o=this.style.lineWidth;if(n.polyline)for(var a=0,s=0;s<r.length;){var l=r[s++];if(l>0)for(var u=r[s++],h=r[s++],c=1;c<l;c++){if($l(u,h,d=r[s++],p=r[s++],o,t,e))return a}a++}else for(a=0,s=0;s<r.length;){u=r[s++],h=r[s++];var d=r[s++],p=r[s++];if(i>0){if(eu(u,h,(u+d)/2-(h-p)*i,(h+p)/2-(d-u)*i,d,p,o,t,e))return a}else if($l(u,h,d,p,o,t,e))return a;a++}return-1},n.prototype.contain=function(t,e){var n=this.transformCoordToLocal(t,e),r=this.getBoundingRect();return t=n[0],e=n[1],r.contain(t,e)?(this.hoverDataIdx=this.findDataIndex(t,e))>=0:(this.hoverDataIdx=-1,!1)},n.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var e=this.shape.segs,n=1/0,r=1/0,i=-1/0,o=-1/0,a=0;a<e.length;){var s=e[a++],l=e[a++];n=Math.min(s,n),i=Math.max(s,i),r=Math.min(l,r),o=Math.max(l,o)}t=this._rect=new ln(n,r,i,o)}return t},n}(xu),PH=function(){function t(){this.group=new Do}return t.prototype.updateData=function(t){this._clear();var e=this._create();e.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(e,t)},t.prototype.incrementalPrepareUpdate=function(t){this.group.removeAll(),this._clear()},t.prototype.incrementalUpdate=function(t,e,n){var r=this._newAdded[0],i=e.getLayout("linesPoints"),o=r&&r.shape.segs;if(o&&o.length<2e4){var a=o.length,s=new Float32Array(a+i.length);s.set(o),s.set(i,a),r.setShape({segs:s})}else{this._newAdded=[];var l=this._create();l.incremental=n,l.setShape({segs:i}),this._setCommon(l,e),l.__startIndex=t.start}},t.prototype.remove=function(){this._clear()},t.prototype.eachRendered=function(t){this._newAdded[0]&&t(this._newAdded[0])},t.prototype._create=function(){var t=new LH({cursor:"default",ignoreCoarsePointer:!0});return this._newAdded.push(t),this.group.add(t),t},t.prototype._setCommon=function(t,e,n){var r=e.hostModel;t.setShape({polyline:r.get("polyline"),curveness:r.get(["lineStyle","curveness"])}),t.useStyle(r.getModel("lineStyle").getLineStyle()),t.style.strokeNoScale=!0;var i=e.getVisual("style");i&&i.stroke&&t.setStyle("stroke",i.stroke),t.setStyle("fill",null);var o=$u(t);o.seriesIndex=r.seriesIndex,t.on("mousemove",function(e){o.dataIndex=null;var n=t.hoverDataIdx;n>0&&(o.dataIndex=n+t.__startIndex)})},t.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},t}(),EH={seriesType:"lines",plan:$y(),reset:function(t){var e=t.coordinateSystem;if(e){var n=t.get("polyline"),r=t.pipelineContext.large;return{progress:function(i,o){var a=[];if(r){var s=void 0,l=i.end-i.start;if(n){for(var u=0,h=i.start;h<i.end;h++)u+=t.getLineCoordsCount(h);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var c=0,d=[];for(h=i.start;h<i.end;h++){var p=t.getLineCoords(h,a);n&&(s[c++]=p);for(var f=0;f<p;f++)d=e.dataToPoint(a[f],!1,d),s[c++]=d[0],s[c++]=d[1]}o.setLayout("linesPoints",s)}else for(h=i.start;h<i.end;h++){var g=o.getItemModel(h),m=(p=t.getLineCoords(h,a),[]);if(n)for(var v=0;v<p;v++)m.push(e.dataToPoint(a[v]));else{m[0]=e.dataToPoint(a[0]),m[1]=e.dataToPoint(a[1]);var y=g.get(["lineStyle","curveness"]);+y&&(m[2]=[(m[0][0]+m[1][0])/2-(m[0][1]-m[1][1])*y,(m[0][1]+m[1][1])/2-(m[1][0]-m[0][0])*y])}o.setItemLayout(h,m)}}}}La("The lines series must have a coordinate system.")}},OH=EH,NH=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var r=t.getData(),i=this._updateLineDraw(r,t),o=t.get("zlevel"),a=t.get(["effect","trailLength"]),s=n.getZr(),l=!!Gp(n);l&&s.painter.getLayer(o).clear(!0),null!=this._lastZlevel&&l&&s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(t)&&a>0&&(l?s.configLayer(o,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(a/10+.9,1),0)}):console.warn("SVG render mode doesn't support lines with trail effect")),i.updateData(r);var u=t.get("clip",!0)&&dD(t.coordinateSystem,!1,t);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=o,this._finished=!0},n.prototype.incrementalPrepareRender=function(t,e,n){var r=t.getData();this._updateLineDraw(r,t).incrementalPrepareUpdate(r),this._clearLayer(n),this._finished=!1},n.prototype.incrementalRender=function(t,e,n){this._lineDraw.incrementalUpdate(t,e.getData(),Ss(e)),this._finished=t.end===e.getData().count()},n.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},n.prototype.updateTransform=function(t,e,n){var r=t.getData(),i=this._lineDraw;if(!(this._finished&&i&&i.updateLayout))return{update:!0};var o=OH.reset(t,e,n);o.progress&&o.progress({start:0,end:r.count(),count:r.count()},r),i.updateLayout(),this._clearLayer(n)},n.prototype._updateLineDraw=function(t,e){var n=this._lineDraw,r=this._showEffect(e),i=!!e.get("polyline"),o=e.pipelineContext.large;return r&&o&&console.warn("Large lines not support effect"),n&&r===this._hasEffet&&i===this._isPolyline&&o===this._isLargeDraw||(n&&n.remove(),n=this._lineDraw=o?new PH:new BB(i?r?AH:CH:r?TH:NB),this._hasEffet=r,this._isPolyline=i,this._isLargeDraw=o),this.group.add(n.group),n},n.prototype._showEffect=function(t){return!!t.get(["effect","show"])},n.prototype._clearLayer=function(t){var e=Gp(t);e&&null!=this._lastZlevel&&e.getLayer(this._lastZlevel).clear(!0)},n.prototype.remove=function(t,e){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(e)},n.prototype.dispose=function(t,e){this.remove(t,e)},n.type="lines",n}(l_),RH=NH,kH="undefined"==typeof Uint32Array?Array:Uint32Array,zH="undefined"==typeof Float64Array?Array:Float64Array;function BH(t){var e=t.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(console.warn("Lines data configuration has been changed to { coords:[[1,2],[2,3]] }"),t.data=V(e,function(t){var e={coords:[t[0].coord,t[1].coord]};return t[0].name&&(e.fromName=t[0].name),t[1].name&&(e.toName=t[1].name),D([e,t[0],t[1]])}))}var VH=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.visualStyleAccessPath="lineStyle",e.visualDrawType="stroke",e}return e(n,t),n.prototype.init=function(e){e.data=e.data||[],BH(e);var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count)),t.prototype.init.apply(this,arguments)},n.prototype.mergeOption=function(e){if(BH(e),e.data){var n=this._processFlatCoordsArray(e.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(e.data=new Float32Array(n.count))}t.prototype.mergeOption.apply(this,arguments)},n.prototype.appendData=function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=_t(this._flatCoords,e.flatCoords),this._flatCoordsOffset=_t(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},n.prototype._getCoordsFromItemModel=function(t){var e=this.getData().getItemModel(t),n=e.option instanceof Array?e.option:e.getShallow("coords");if(!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},n.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},n.prototype.getLineCoords=function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],r=this._flatCoordsOffset[2*t+1],i=0;i<r;i++)e[i]=e[i]||[],e[i][0]=this._flatCoords[n+2*i],e[i][1]=this._flatCoords[n+2*i+1];return r}var o=this._getCoordsFromItemModel(t);for(i=0;i<o.length;i++)e[i]=e[i]||[],e[i][0]=o[i][0],e[i][1]=o[i][1];return o.length},n.prototype._processFlatCoordsArray=function(t){var e=0;if(this._flatCoords&&(e=this._flatCoords.length),K(t[0])){for(var n=t.length,r=new kH(n),i=new zH(n),o=0,a=0,s=0,l=0;l<n;){s++;var u=t[l++];r[a++]=o+e,r[a++]=u;for(var h=0;h<u;h++){var c=t[l++],d=t[l++];if(i[o++]=c,i[o++]=d,l>n)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,a),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},n.prototype.getInitialData=function(t,e){if(!Rg.get(t.coordinateSystem))throw new Error("Unknown coordinate system "+t.coordinateSystem);var n=new oS(["value"],this);return n.hasItemOption=!1,n.initData(t.data,[],function(t,e,r,i){if(t instanceof Array)return NaN;n.hasItemOption=!0;var o=t.value;return null!=o?o instanceof Array?o[i]:o:void 0}),n},n.prototype.formatTooltip=function(t,e,n){var r=this.getData(),i=this.getRawValue(t),o=r.getItemModel(t),a=o.get("name");if(!a){var s=o.get("fromName"),l=o.get("toName"),u=[];null!=s&&u.push(s),null!=l&&u.push(l),a=u.join(" > ")}return Cy("nameValue",{name:a,value:i,noValue:null==i||isNaN(i)})},n.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},n.prototype.getProgressive=function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},n.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},n.prototype.getZLevelKey=function(){var t=this.getModel("effect"),e=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&e>0?e+"":""},n.type="series.lines",n.dependencies=["grid","polar","geo","calendar"],n.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},n}(Ky),FH=VH;function GH(t){return t instanceof Array||(t=[t,t]),t}var HH={seriesType:"lines",reset:function(t){var e=GH(t.get("symbol")),n=GH(t.get("symbolSize")),r=t.getData();return r.setVisual("fromSymbol",e&&e[0]),r.setVisual("toSymbol",e&&e[1]),r.setVisual("fromSymbolSize",n&&n[0]),r.setVisual("toSymbolSize",n&&n[1]),{dataEach:r.hasItemOption?function(t,e){var n=t.getItemModel(e),r=GH(n.getShallow("symbol",!0)),i=GH(n.getShallow("symbolSize",!0));r[0]&&t.setItemVisual(e,"fromSymbol",r[0]),r[1]&&t.setItemVisual(e,"toSymbol",r[1]),i[0]&&t.setItemVisual(e,"fromSymbolSize",i[0]),i[1]&&t.setItemVisual(e,"toSymbolSize",i[1])}:null}}};var UH=function(){function t(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var t=h.createCanvas();this.canvas=t}return t.prototype.update=function(t,e,n,r,i,o){var a=this._getBrush(),s=this._getGradient(i,"inRange"),l=this._getGradient(i,"outOfRange"),u=this.pointSize+this.blurSize,h=this.canvas,c=h.getContext("2d"),d=t.length;h.width=e,h.height=n;for(var p=0;p<d;++p){var f=t[p],g=f[0],m=f[1],v=r(f[2]);c.globalAlpha=v,c.drawImage(a,g-u,m-u)}if(!h.width||!h.height)return h;for(var y=c.getImageData(0,0,h.width,h.height),_=y.data,x=0,b=_.length,w=this.minOpacity,S=this.maxOpacity-w;x<b;){v=_[x+3]/256;var T=4*Math.floor(255*v);if(v>0){var M=o(v)?s:l;v>0&&(v=v*S+w),_[x++]=M[T],_[x++]=M[T+1],_[x++]=M[T+2],_[x++]=M[T+3]*v*256}else x+=4}return c.putImageData(y,0,0),h},t.prototype._getBrush=function(){var t=this._brushCanvas||(this._brushCanvas=h.createCanvas()),e=this.pointSize+this.blurSize,n=2*e;t.width=n,t.height=n;var r=t.getContext("2d");return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor=om.color.neutral99,r.beginPath(),r.arc(-e,e,this.pointSize,0,2*Math.PI,!0),r.closePath(),r.fill(),t},t.prototype._getGradient=function(t,e){for(var n=this._gradientPixels,r=n[e]||(n[e]=new Uint8ClampedArray(1024)),i=[0,0,0,0],o=0,a=0;a<256;a++)t[e](a/255,!0,i),r[o++]=i[0],r[o++]=i[1],r[o++]=i[2],r[o++]=i[3];return r},t}(),WH=UH;var XH=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var r;if(e.eachComponent("visualMap",function(e){e.eachTargetSeries(function(n){n===t&&(r=e)})}),!r)throw new Error("Heatmap must use with visualMap");this._progressiveEls=null,this.group.removeAll();var i=t.coordinateSystem;"cartesian2d"===i.type||"calendar"===i.type||"matrix"===i.type?this._renderOnGridLike(t,n,0,t.getData().count()):mD(i)&&this._renderOnGeo(i,t,r,n)},n.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll()},n.prototype.incrementalRender=function(t,e,n,r){var i=e.coordinateSystem;i&&(mD(i)?this.render(e,n,r):(this._progressiveEls=[],this._renderOnGridLike(e,r,t.start,t.end,!0)))},n.prototype.eachRendered=function(t){Dp(this._progressiveEls||this.group,t)},n.prototype._renderOnGridLike=function(t,e,n,r,i){var o,a,s,l,u=t.coordinateSystem,h=gD(u,"cartesian2d"),c=gD(u,"matrix");if(h){var d=u.getAxis("x"),p=u.getAxis("y");if("category"!==d.type||"category"!==p.type)throw new Error("Heatmap on cartesian must have two category axes");if(!d.onBand||!p.onBand)throw new Error("Heatmap on cartesian must have two axes with boundaryGap true");o=$M(d).w+.5,a=$M(p).w+.5,s=d.scale.getExtent(),l=p.scale.getExtent()}for(var f=this.group,g=t.getData(),m=t.getModel(["emphasis","itemStyle"]).getItemStyle(),v=t.getModel(["blur","itemStyle"]).getItemStyle(),y=t.getModel(["select","itemStyle"]).getItemStyle(),_=t.get(["itemStyle","borderRadius"]),x=Zp(t),b=t.getModel("emphasis"),w=b.get("focus"),S=b.get("blurScope"),T=b.get("disabled"),M=h||c?[g.mapDimension("x"),g.mapDimension("y"),g.mapDimension("value")]:[g.mapDimension("time"),g.mapDimension("value")],C=n;C<r;C++){var I=void 0,A=g.getItemVisual(C,"style");if(h){var D=g.get(M[0],C),L=g.get(M[1],C);if(isNaN(g.get(M[2],C))||isNaN(D)||isNaN(L)||D<s[0]||D>s[1]||L<l[0]||L>l[1])continue;var P=u.dataToPoint([D,L]);I=new Ru({shape:{x:P[0]-o/2,y:P[1]-a/2,width:o,height:a},style:A})}else if(c){if(it((E=u.dataToLayout([g.get(M[0],C),g.get(M[1],C)]).rect).x))continue;I=new Ru({z2:1,shape:E,style:A})}else{if(isNaN(g.get(M[1],C)))continue;var E,O=u.dataToLayout([g.get(M[0],C)]);if(it((E=O.contentRect||O.rect).x)||it(E.y))continue;I=new Ru({z2:1,shape:E,style:A})}if(g.hasItemOption){var N=g.getItemModel(C),R=N.getModel("emphasis");m=R.getModel("itemStyle").getItemStyle(),v=N.getModel(["blur","itemStyle"]).getItemStyle(),y=N.getModel(["select","itemStyle"]).getItemStyle(),_=N.get(["itemStyle","borderRadius"]),w=R.get("focus"),S=R.get("blurScope"),T=R.get("disabled"),x=Zp(N)}I.shape.r=_;var k=t.getRawValue(C),z="-";k&&null!=k[2]&&(z=k[2]+""),jp(I,x,{labelFetcher:t,labelDataIndex:C,defaultOpacity:A.opacity,defaultText:z}),I.ensureState("emphasis").style=m,I.ensureState("blur").style=v,I.ensureState("select").style=y,ic(I,w,S,T),I.incremental=Ss(t,i),i&&(I.states.emphasis.hoverLayer=2),f.add(I),g.setItemGraphicEl(C,I),this._progressiveEls&&this._progressiveEls.push(I)}},n.prototype._renderOnGeo=function(t,e,n,r){var i=n.targetVisuals.inRange,o=n.targetVisuals.outOfRange,a=e.getData(),s=this._hmLayer||this._hmLayer||new WH;s.blurSize=e.get("blurSize"),s.pointSize=e.get("pointSize"),s.minOpacity=e.get("minOpacity"),s.maxOpacity=e.get("maxOpacity");var l=t.getViewRect().clone(),u=t.getRoamTransform();l.applyTransform(u);var h=Math.max(l.x,0),c=Math.max(l.y,0),d=Math.min(l.width+l.x,r.getWidth()),p=Math.min(l.height+l.y,r.getHeight()),f=d-h,g=p-c,m=[a.mapDimension("lng"),a.mapDimension("lat"),a.mapDimension("value")],v=a.mapArray(m,function(e,n,r){var i=t.dataToPoint([e,n]);return i[0]-=h,i[1]-=c,i.push(r),i}),y=n.getExtent(),_="visualMap.continuous"===n.type?function(t,e){var n=t[1]-t[0];return e=[(e[0]-t[0])/n,(e[1]-t[0])/n],function(t){return t>=e[0]&&t<=e[1]}}(y,n.option.range):function(t,e,n){var r=t[1]-t[0],i=(e=V(e,function(e){return{interval:[(e.interval[0]-t[0])/r,(e.interval[1]-t[0])/r]}})).length,o=0;return function(t){var r;for(r=o;r<i;r++)if((a=e[r].interval)[0]<=t&&t<=a[1]){o=r;break}if(r===i)for(r=o-1;r>=0;r--){var a;if((a=e[r].interval)[0]<=t&&t<=a[1]){o=r;break}}return r>=0&&r<i&&n[r]}}(y,n.getPieceList(),n.option.selected);s.update(v,f,g,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:o.color.getColorMapper()},_);var x=new Iu({style:{width:f,height:g,x:h,y:c,image:s.canvas},silent:!0});this.group.add(x)},n.type="heatmap",n}(l_),jH=XH,ZH=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.getInitialData=function(t,e){return gS(null,this,{generateCoord:"value"})},n.prototype.preventIncremental=function(){var t=Rg.get(this.get("coordinateSystem"));if(t&&t.dimensions)return"lng"===t.dimensions[0]&&"lat"===t.dimensions[1]},n.type="series.heatmap",n.dependencies=["grid","geo","calendar","matrix"],n.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:om.color.primary}}},n}(Ky),YH=ZH;var qH=["itemStyle","borderWidth"],KH=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],JH=new Rc,QH=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=PL,e}return e(n,t),n.prototype.render=function(t,e,n){var r=this.group,i=t.getData(),o=this._data,a=t.coordinateSystem,s=a.getBaseAxis().isHorizontal(),l=a.master.getRect(),u={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:t,coordSys:a,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:KH[+s],categoryDim:KH[1-+s]};i.diff(o).add(function(t){if(i.hasValue(t)){var e=aU(i,t),n=$H(i,t,e,u),o=uU(i,u,n);i.setItemGraphicEl(t,o),r.add(o),fU(o,u,n)}}).update(function(t,e){var n=o.getItemGraphicEl(e);if(i.hasValue(t)){var a=aU(i,t),s=$H(i,t,a,u),l=cU(i,s);n&&l!==n.__pictorialShapeStr&&(r.remove(n),i.setItemGraphicEl(t,null),n=null),n?function(t,e,n){var r=n.animationModel,i=n.dataIndex,o=t.__pictorialBundle;Xd(o,{x:n.bundlePosition[0],y:n.bundlePosition[1]},r,i),n.symbolRepeat?nU(t,e,n,!0):rU(t,e,n,!0);iU(t,n,!0),oU(t,e,n,!0)}(n,u,s):n=uU(i,u,s,!0),i.setItemGraphicEl(t,n),n.__pictorialSymbolMeta=s,r.add(n),fU(n,u,s)}else r.remove(n)}).remove(function(t){var e=o.getItemGraphicEl(t);e&&hU(o,t,e.__pictorialSymbolMeta.animationModel,e)}).execute();var h=t.get("clip",!0)?dD(t.coordinateSystem,!1,t):null;return h?r.setClipPath(h):r.removeClipPath(),this._data=i,this.group},n.prototype.remove=function(t,e){var n=this.group,r=this._data;t.get("animation")?r&&r.eachItemGraphicEl(function(e){hU(r,$u(e).dataIndex,t,e)}):n.removeAll()},n.type=PL,n}(l_);function $H(t,e,n,r){var i=t.getItemLayout(e),o=n.get("symbolRepeat"),a=n.get("symbolClip"),s=n.get("symbolPosition")||"start",l=(n.get("symbolRotate")||0)*Math.PI/180||0,u=n.get("symbolPatternSize")||2,h=n.isAnimationEnabled(),c={dataIndex:e,layout:i,itemModel:n,symbolType:t.getItemVisual(e,"symbol")||"circle",style:t.getItemVisual(e,"style"),symbolClip:a,symbolRepeat:o,symbolRepeatDirection:n.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?n:null,hoverScale:h&&n.get(["emphasis","scale"]),z2:n.getShallow("z",!0)||0};!function(t,e,n,r,i){var o,a=r.valueDim,s=t.get("symbolBoundingData"),l=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(n[a.wh]<=0);if(j(s)){var c=[tU(l,s[0])-u,tU(l,s[1])-u];c[1]<c[0]&&c.reverse(),o=c[h]}else o=null!=s?tU(l,s)-u:e?r.coordSysExtent[a.index][h]-u:n[a.wh];i.boundingLength=o,e&&(i.repeatCutLength=n[a.wh]);var d="x"===a.xy,p=l.inverse;i.pxSign=d&&!p||!d&&p?o>=0?1:-1:o>0?1:-1}(n,o,i,r,c),function(t,e,n,r,i,o,a,s,l,u){var h,c=l.valueDim,d=l.categoryDim,p=Math.abs(n[d.wh]),f=t.getItemVisual(e,"symbolSize");h=j(f)?f.slice():null==f?["100%","100%"]:[f,f];h[d.index]=Qo(h[d.index],p),h[c.index]=Qo(h[c.index],r?p:Math.abs(o)),u.symbolSize=h;var g=u.symbolScale=[h[0]/s,h[1]/s];g[c.index]*=(l.isHorizontal?-1:1)*a}(t,e,i,o,0,c.boundingLength,c.pxSign,u,r,c),function(t,e,n,r,i){var o=t.get(qH)||0;o&&(JH.attr({scaleX:e[0],scaleY:e[1],rotation:n}),JH.updateTransform(),o/=JH.getLineScale(),o*=e[r.valueDim.index]);i.valueLineWidth=o||0}(n,c.symbolScale,l,r,c);var d=c.symbolSize,p=Ax(n.get("symbolOffset"),d);return function(t,e,n,r,i,o,a,s,l,u,h,c){var d=h.categoryDim,p=h.valueDim,f=c.pxSign,g=Math.max(e[p.index]+s,0),m=g;if(r){var v=Math.abs(l),y=ot(t.get("symbolMargin"),"15%")+"",_=!1;y.lastIndexOf("!")===y.length-1&&(_=!0,y=y.slice(0,y.length-1));var x=Qo(y,e[p.index]),b=Math.max(g+2*x,0),w=_?0:2*x,S=xa(r),T=S?r:gU((v+w)/b);b=g+2*(x=(v-T*g)/2/(_?T:Math.max(T-1,1))),w=_?0:2*x,S||"fixed"===r||(T=u?gU((Math.abs(u)+w)/b):0),m=T*b-w,c.repeatTimes=T,c.symbolMargin=x}var M=f*(m/2),C=c.pathPosition=[];C[d.index]=n[d.wh]/2,C[p.index]="start"===a?M:"end"===a?l-M:l/2,o&&(C[0]+=o[0],C[1]+=o[1]);var I=c.bundlePosition=[];I[d.index]=n[d.xy],I[p.index]=n[p.xy];var A=c.barRectShape=L({},n);A[p.wh]=f*Math.max(Math.abs(n[p.wh]),Math.abs(C[p.index]+M)),A[d.wh]=n[d.wh];var D=c.clipShape={};D[d.xy]=-n[d.xy],D[d.wh]=h.ecSize[d.wh],D[p.xy]=0,D[p.wh]=n[p.wh]}(n,d,i,o,0,p,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,r,c),c}function tU(t,e){return t.toGlobalCoord(t.dataToCoord(t.scale.parse(e)))}function eU(t){var e=t.symbolPatternSize,n=Cx(t.symbolType,-e/2,-e/2,e,e);return n.attr({culling:!0}),"image"!==n.type&&n.setStyle({strokeNoScale:!0}),n}function nU(t,e,n,r){var i=t.__pictorialBundle,o=n.symbolSize,a=n.valueLineWidth,s=n.pathPosition,l=e.valueDim,u=n.repeatTimes||0,h=0,c=o[e.valueDim.index]+a+2*n.symbolMargin;for(dU(t,function(t){t.__pictorialAnimationIndex=h,t.__pictorialRepeatTimes=u,h<u?pU(t,null,f(h),n,r):pU(t,null,{scaleX:0,scaleY:0},n,r,function(){i.remove(t)}),h++});h<u;h++){var d=eU(n);d.__pictorialAnimationIndex=h,d.__pictorialRepeatTimes=u,i.add(d);var p=f(h);pU(d,{x:p.x,y:p.y,scaleX:0,scaleY:0},{scaleX:p.scaleX,scaleY:p.scaleY,rotation:p.rotation},n,r)}function f(t){var e=s.slice(),r=n.pxSign,i=t;return("start"===n.symbolRepeatDirection?r>0:r<0)&&(i=u-1-t),e[l.index]=c*(i-u/2+.5)+s[l.index],{x:e[0],y:e[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function rU(t,e,n,r){var i=t.__pictorialBundle,o=t.__pictorialMainPath;o?pU(o,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,r):(o=t.__pictorialMainPath=eU(n),i.add(o),pU(o,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,r))}function iU(t,e,n){var r=L({},e.barRectShape),i=t.__pictorialBarRect;i?pU(i,null,{shape:r},e,n):((i=t.__pictorialBarRect=new Ru({z2:2,shape:r,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}})).disableMorphing=!0,t.add(i))}function oU(t,e,n,r){if(n.symbolClip){var i=t.__pictorialClipPath,o=L({},n.clipShape),a=e.valueDim,s=n.animationModel,l=n.dataIndex;if(i)Xd(i,{shape:o},s,l);else{o[a.wh]=0,i=new Ru({shape:o}),t.__pictorialBundle.setClipPath(i),t.__pictorialClipPath=i;var u={};u[a.wh]=n.clipShape[a.wh],Hp[r?"updateProps":"initProps"](i,{shape:u},s,l)}}}function aU(t,e){var n=t.getItemModel(e);return n.getAnimationDelayParams=sU,n.isAnimationEnabled=lU,n}function sU(t){return{index:t.__pictorialAnimationIndex,count:t.__pictorialRepeatTimes}}function lU(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function uU(t,e,n,r){var i=new Do,o=new Do;return i.add(o),i.__pictorialBundle=o,o.x=n.bundlePosition[0],o.y=n.bundlePosition[1],n.symbolRepeat?nU(i,e,n):rU(i,0,n),iU(i,n,r),oU(i,e,n,r),i.__pictorialShapeStr=cU(t,n),i.__pictorialSymbolMeta=n,i}function hU(t,e,n,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var o=[];dU(r,function(t){o.push(t)}),r.__pictorialMainPath&&o.push(r.__pictorialMainPath),r.__pictorialClipPath&&(n=null),B(o,function(t){Yd(t,{scaleX:0,scaleY:0},n,e,function(){r.parent&&r.parent.remove(r)})}),t.setItemGraphicEl(e,null)}function cU(t,e){return[t.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function dU(t,e,n){B(t.__pictorialBundle.children(),function(r){r!==t.__pictorialBarRect&&e.call(n,r)})}function pU(t,e,n,r,i,o){e&&t.attr(e),r.symbolClip&&!i?n&&t.attr(n):n&&Hp[i?"updateProps":"initProps"](t,n,r.animationModel,r.dataIndex,o)}function fU(t,e,n){var r=n.dataIndex,i=n.itemModel,o=i.getModel("emphasis"),a=o.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),h=o.get("focus"),c=o.get("blurScope"),d=o.get("scale");dU(t,function(t){if(t instanceof Iu){var e=t.style;t.useStyle(L({image:e.image,x:e.x,y:e.y,width:e.width,height:e.height},n.style))}else t.useStyle(n.style);var r=t.ensureState("emphasis");r.style=a,d&&(r.scaleX=1.1*t.scaleX,r.scaleY=1.1*t.scaleY),t.ensureState("blur").style=s,t.ensureState("select").style=l,u&&(t.cursor=u),t.z2=n.z2});var p=e.valueDim.posDesc[+(n.boundingLength>0)],f=t.__pictorialBarRect;f.ignoreClip=!0,jp(f,Zp(i),{labelFetcher:e.seriesModel,labelDataIndex:r,defaultText:VA(e.seriesModel.getData(),r),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:p}),ic(t,h,c,o.get("disabled"))}function gU(t){var e=Math.round(t);return Math.abs(t-e)<1e-4?e:Math.ceil(t)}var mU=QH,vU=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.hasSymbolVisual=!0,e.defaultSymbol="roundRect",e}return e(n,t),n.prototype.getInitialData=function(e){return e.stack=null,t.prototype.getInitialData.apply(this,arguments)},n.type="series."+PL,n.dependencies=["grid"],n.defaultOption=Sf(YL.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:om.color.primary}}}),n}(YL),yU=vU;var _U="themeRiver",xU=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(e){t.prototype.init.apply(this,arguments),this.legendVisualProvider=new CP(W(this.getData,this),W(this.getRawData,this))},n.prototype.fixData=function(t){var e=t.length,n={},r=ss(t,function(t){return n.hasOwnProperty(t[0]+"")||(n[t[0]+""]=-1),t[2]}),i=[];r.buckets.each(function(t,e){i.push({name:e,dataList:t})});for(var o=i.length,a=0;a<o;++a){for(var s=i[a].name,l=0;l<i[a].dataList.length;++l){var u=i[a].dataList[l][0]+"";n[u]=a}for(var u in n)n.hasOwnProperty(u)&&n[u]!==a&&(n[u]=a,t[e]=[u,0,s],e++)}return t},n.prototype.getInitialData=function(t,e){for(var n=this.getReferringComponents("singleAxis",ns).models[0].get("type"),r=G(t.data,function(t){return void 0!==t[2]}),i=this.fixData(r||[]),o=[],a=this.nameMap=yt(),s=0,l=0;l<i.length;++l)o.push(i[l][2]),a.get(i[l][2])||(a.set(i[l][2],s),s++);var u=sS(i,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:kw(n)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}).dimensions,h=new oS(u,this);return h.initData(i),h},n.prototype.getLayerSeries=function(){for(var t=this.getData(),e=t.count(),n=[],r=0;r<e;++r)n[r]=r;var i=t.mapDimension("single"),o=ss(n,function(e){return t.get("name",e)}),a=[];return o.buckets.each(function(e,n){e.sort(function(e,n){return t.get(i,e)-t.get(i,n)}),a.push({name:n,indices:e})}),a},n.prototype.getAxisTooltipData=function(t,e,n){j(t)||(t=t?[t]:[]);for(var r,i=this.getData(),o=this.getLayerSeries(),a=[],s=o.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,h=-1,c=o[l].indices.length,d=0;d<c;++d){var p=i.get(t[0],o[l].indices[d]),f=Math.abs(p-e);f<=u&&(r=p,u=f,h=o[l].indices[d])}a.push(h)}return{dataIndices:a,nestestValue:r}},n.prototype.formatTooltip=function(t,e,n){var r=this.getData();return Cy("nameValue",{name:r.getName(t),value:r.get(r.mapDimension("value"),t)})},n.type="series."+_U,n.dependencies=["singleAxis"],n.defaultOption={z:2,colorBy:"data",coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",fontSize:11},emphasis:{label:{show:!0}}},n}(Ky),bU=xU,wU=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=_U,e._layers=[],e}return e(n,t),n.prototype.render=function(t,e,n){var r=t.getData(),i=this,o=this.group,a=t.getLayerSeries(),s=r.getLayout("layoutInfo"),l=s.rect,u=s.boundaryGap;function h(t){return t.name}o.x=0,o.y=l.y+u[0];var c=new Ow(this._layersSeries||[],a,h,h),d=[];function p(e,n,s){var l=i._layers;if("remove"!==e){for(var u,h,c=[],p=[],f=a[n].indices,g=0;g<f.length;g++){var m=r.getItemLayout(f[g]),v=m.x,y=m.y0,_=m.y;c.push(v,y),p.push(v,y+_),u=r.getItemVisual(f[g],"style")}var x=r.getItemLayout(f[0]),b=t.getModel("label").get("margin"),w=t.getModel("emphasis");if("add"===e){var S=d[n]=new Do;h=new uD({shape:{points:c,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),S.add(h),o.add(S),t.isAnimationEnabled()&&h.setClipPath(function(t,e,n){var r=new Ru({shape:{x:t.x-10,y:t.y-10,width:0,height:t.height+20}});return jd(r,{shape:{x:t.x-50,width:t.width+100,height:t.height+20}},e,n),r}(h.getBoundingRect(),t,function(){h.removeClipPath()}))}else{S=l[s];h=S.childAt(0),o.add(S),d[n]=S,Xd(h,{shape:{points:c,stackedOnPoints:p}},t),Jd(h)}jp(h,Zp(t),{labelDataIndex:f[g-1],defaultText:r.getName(f[g-1]),inheritColor:u.fill},{normal:{verticalAlign:"middle"}}),h.setTextConfig({position:null,local:!0});var T=h.getTextContent();T&&(T.x=x.x-b,T.y=x.y0+x.y/2),h.useStyle(u),r.setItemGraphicEl(n,h),lc(h,t),ic(h,w.get("focus"),w.get("blurScope"),w.get("disabled"))}else o.remove(l[n])}c.add(W(p,this,"add")).update(W(p,this,"update")).remove(W(p,this,"remove")).execute(),this._layersSeries=a,this._layers=d},n.type=_U,n}(l_);var SU=wU,TU=Cs(_U,function(t,e){t.eachSeriesByType(_U,function(t){var e=t.getData(),n=t.coordinateSystem,r={},i=n.getRect();r.rect=i;var o=t.get("boundaryGap"),a=n.getAxis();(r.boundaryGap=o,"horizontal"===a.orient)?(o[0]=Qo(o[0],i.height),o[1]=Qo(o[1],i.height),MU(e,t,i.height-o[0]-o[1])):(o[0]=Qo(o[0],i.width),o[1]=Qo(o[1],i.width),MU(e,t,i.width-o[0]-o[1]));e.setLayout("layoutInfo",r)})});function MU(t,e,n){if(t.count())for(var r,i=e.coordinateSystem,o=e.getLayerSeries(),a=t.mapDimension("single"),s=t.mapDimension("value"),l=V(o,function(e){return V(e.indices,function(e){var n=i.dataToPoint(t.get(a,e));return n[1]=t.get(s,e),n})}),u=function(t){for(var e=t.length,n=t[0].length,r=[],i=[],o=0,a=0;a<n;++a){for(var s=0,l=0;l<e;++l)s+=t[l][a][1];s>o&&(o=s),r.push(s)}for(var u=0;u<n;++u)i[u]=(o-r[u])/2;o=0;for(var h=0;h<n;++h){var c=r[h]+i[h];c>o&&(o=c)}return{y0:i,max:o}}(l),h=u.y0,c=n/u.max,d=o.length,p=o[0].indices.length,f=0;f<p;++f){r=h[f]*c,t.setItemLayout(o[0].indices[f],{layerIndex:0,x:l[0][f][0],y0:r,y:l[0][f][1]*c});for(var g=1;g<d;++g)r+=l[g-1][f][1]*c,t.setItemLayout(o[g].indices[f],{layerIndex:g,x:l[g][f][0],y0:r,y:l[g][f][1]*c})}}var CU=function(t){function n(e,n,r,i){var o=t.call(this)||this;o.z2=2,o.textConfig={inside:!0},$u(o).seriesIndex=n.seriesIndex;var a=new Qu({z2:4,silent:e.getModel().get(["label","silent"])});return o.setTextContent(a),o.updateData(!0,e,n,r,i),o}return e(n,t),n.prototype.updateData=function(t,e,n,r,i){this.node=e,e.piece=this,n=n||this._seriesModel,r=r||this._ecModel;var o=this;$u(o).dataIndex=e.dataIndex;var a=e.getModel(),s=a.getModel("emphasis"),l=e.getLayout(),u=L({},l);u.label=null;var h=e.getVisual("style");h.lineJoin="bevel";var c=e.getVisual("decal");c&&(h.decal=$x(c,i));var d=nP(a.getModel("itemStyle"),u,!0);L(u,d),B(xh,function(t){var e=o.ensureState(t),n=a.getModel([t,"itemStyle"]);e.style=n.getItemStyle();var r=nP(n,u);r&&(e.shape=r)}),t?(o.setShape(u),o.shape.r=l.r0,jd(o,{shape:{r:l.r}},n,e.dataIndex)):(Xd(o,{shape:u},n),Jd(o)),o.useStyle(h),this._updateLabel(n);var p=a.getShallow("cursor");p&&o.attr("cursor",p),this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel;var f=s.get("focus");ic(this,"relative"===f?_t(e.getAncestorsIndices(),e.getDescendantIndices()):"ancestor"===f?e.getAncestorsIndices():"descendant"===f?e.getDescendantIndices():f,s.get("blurScope"),s.get("disabled"))},n.prototype._updateLabel=function(t){var e=this,n=this.node.getModel(),r=n.getModel("label"),i=this.node.getLayout(),o=i.endAngle-i.startAngle,a=(i.startAngle+i.endAngle)/2,s=Math.cos(a),l=Math.sin(a),u=this,h=u.getTextContent(),c=this.node.dataIndex,d=r.get("minAngle")/180*Math.PI,p=r.get("show")&&!(null!=d&&Math.abs(o)<d);function f(t,e){var n=t.get(e);return null==n?r.get(e):n}h.ignore=!p,B(bh,function(r){var d="normal"===r?n.getModel("label"):n.getModel([r,"label"]),p="normal"===r,g=p?h:h.ensureState(r),m=t.getFormattedLabel(c,r);p&&(m=m||e.node.name),g.style=Yp(d,{},null,"normal"!==r,!0),m&&(g.style.text=m);var v=d.get("show");null==v||p||(g.ignore=!v);var y,_=f(d,"position"),x=p?u:u.states[r],b=x.style.fill;x.textConfig={outsideFill:"inherit"===d.get("color")?b:null,inside:"outside"!==_};var w=f(d,"distance")||0,S=f(d,"align"),T=f(d,"rotate"),M=.5*Math.PI,C=1.5*Math.PI,I=ru("tangential"===T?Math.PI/2-a:a),A=I>M&&!ca(I-M)&&I<C;"outside"===_?(y=i.r+w,S=A?"right":"left"):S&&"center"!==S?"left"===S?(y=i.r0+w,S=A?"right":"left"):"right"===S&&(y=i.r-w,S=A?"left":"right"):(y=0===i.r0&&ca(o-2*Math.PI)?0:(i.r+i.r0)/2,S="center"),g.style.align=S,g.style.verticalAlign=f(d,"verticalAlign")||"middle",g.x=y*s+i.cx,g.y=y*l+i.cy;var D=0;"radial"===T?D=ru(-a)+(A?Math.PI:0):"tangential"===T?D=ru(Math.PI/2-a)+(A?Math.PI:0):K(T)&&(D=T*Math.PI/180),g.rotation=ru(D)}),h.dirtyStyle()},n}(td),IU=CU,AU="sunburst",DU=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.ignoreStyleOnData=!0,e}return e(n,t),n.prototype.getInitialData=function(t,e){var n={name:t.name,children:t.data};LU(n);var r=this._levelModels=V(t.levels||[],function(t){return new xf(t,this,e)},this),i=bk.createTree(n,this,function(t){t.wrapMethod("getItemModel",function(t,e){var n=i.getNodeByDataIndex(e),o=r[n.depth];return o&&(t.parentModel=o),t})});return i.data},n.prototype.optionUpdated=function(){this.resetViewRoot()},n.prototype.getDataParams=function(e){var n=t.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(e);return n.treePathInfo=Mk(r,this),n},n.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},n.prototype.getViewRoot=function(){return this._viewRoot},n.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)},n.prototype.enableAriaDecal=function(){Uk(this)},n.type="series."+AU,n.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},n}(Ky);function LU(t){var e=0;B(t.children,function(t){LU(t);var n=t.value;j(n)&&(n=n[0]),e+=n});var n=t.value;j(n)&&(n=n[0]),(null==n||isNaN(n))&&(n=e),n<0&&(n=0),j(t.value)?t.value[0]=n:t.value=n}var PU=DU,EU="sunburstRootToNode",OU="sunburstHighlight";var NU=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=AU,e}return e(n,t),n.prototype.render=function(t,e,n,r){var i=this;this.seriesModel=t,this.api=n,this.ecModel=e;var o=t.getData(),a=o.tree.root,s=t.getViewRoot(),l=this.group,u=t.get("renderLabelForZeroData"),h=[];s.eachNode(function(t){h.push(t)});var c=this._oldChildren||[];!function(r,i){if(0===r.length&&0===i.length)return;function s(t){return t.getId()}function h(s,h){!function(r,i){u||!r||r.getValue()||(r=null);if(r!==a&&i!==a)if(i&&i.piece)r?(i.piece.updateData(!1,r,t,e,n),o.setItemGraphicEl(r.dataIndex,i.piece)):function(t){if(!t)return;t.piece&&(l.remove(t.piece),t.piece=null)}(i);else if(r){var s=new IU(r,t,e,n);l.add(s),o.setItemGraphicEl(r.dataIndex,s)}}(null==s?null:r[s],null==h?null:i[h])}new Ow(i,r,s,s).add(h).update(h).remove(X(h,null)).execute()}(h,c),function(r,o){o.depth>0?(i.virtualPiece?i.virtualPiece.updateData(!1,r,t,e,n):(i.virtualPiece=new IU(r,t,e,n),l.add(i.virtualPiece)),o.piece.off("click"),i.virtualPiece.on("click",function(t){i._rootToNode(o.parentNode)})):i.virtualPiece&&(l.remove(i.virtualPiece),i.virtualPiece=null)}(a,s),this._initEvents(),this._oldChildren=h},n.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(e){var n=!1;t.seriesModel.getViewRoot().eachNode(function(r){if(!n&&r.piece&&r.piece===e.target){var i=r.getModel().get("nodeClick");if("rootToNode"===i)t._rootToNode(r);else if("link"===i){var o=r.getModel(),a=o.get("link");if(a)Cg(a,o.get("target",!0)||"_blank")}n=!0}})})},n.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:EU,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},n.prototype.containPoint=function(t,e){var n=e.getData().getItemLayout(0);if(n){var r=t[0]-n.cx,i=t[1]-n.cy,o=Math.sqrt(r*r+i*i);return o<=n.r&&o>=n.r0}},n.type=AU,n}(l_),RU=NU,kU=Cs(AU,function(t){var e={};t.eachSeriesByType(AU,function(t){var n=t.getData(),r=n.tree;r.eachNode(function(i){var o=i.getModel().getModel("itemStyle").getItemStyle();o.fill||(o.fill=function(t,n,r){if(0===t.depth)return om.color.neutral50;for(var i=t;i&&i.depth>1;)i=i.parentNode;var o=n.getColorFromPalette(i.name||i.dataIndex+"",e);return t.depth>1&&Y(o)&&(o=Mr(o,(t.depth-1)/(r-1)*.5)),o}(i,t,r.root.height)),L(n.ensureUniqueItemVisual(i.dataIndex,"style"),o)})})});var zU=Math.PI/180,BU=Cs(AU,function(t,e){t.eachSeriesByType(AU,function(t){var n=t.get("center"),r=t.get("radius");j(r)||(r=[0,r]),j(n)||(n=[n,n]);var i=e.getWidth(),o=e.getHeight(),a=Math.min(i,o),s=Qo(n[0],i),l=Qo(n[1],o),u=Qo(r[0],a/2),h=Qo(r[1],a/2),c=-t.get("startAngle")*zU,d=t.get("minAngle")*zU,p=t.getData().tree.root,f=t.getViewRoot(),g=f.depth,m=t.get("sort");null!=m&&VU(f,m);var v=0;B(f.children,function(t){!isNaN(t.getValue())&&v++});var y=f.getValue(),_=Math.PI/(y||v)*2,x=f.depth>0,b=f.height-(x?-1:1),w=(h-u)/(b||1),S=t.get("clockwise"),T=t.get("stillShowZeroSum"),M=S?1:-1,C=function(e,n){if(e){var r=n;if(e!==p){var i=e.getValue(),o=0===y&&T?_:i*_;o<d&&(o=d),r=n+M*o;var h=e.depth-g-(x?-1:1),c=u+w*h,f=u+w*(h+1),m=t.getLevelModel(e);if(m){var v=m.get("r0",!0),b=m.get("r",!0),I=m.get("radius",!0);null!=I&&(v=I[0],b=I[1]),null!=v&&(c=Qo(v,a/2)),null!=b&&(f=Qo(b,a/2))}e.setLayout({angle:o,startAngle:n,endAngle:r,clockwise:S,cx:s,cy:l,r0:c,r:f})}if(e.children&&e.children.length){var A=0;B(e.children,function(t){A+=C(t,n+A)})}return r-n}};if(x){var I=u,A=u+w,D=2*Math.PI;p.setLayout({angle:D,startAngle:c,endAngle:c+D,clockwise:S,cx:s,cy:l,r0:I,r:A})}C(f,c)})});function VU(t,e){var n=t.children||[];t.children=function(t,e){if(Z(e)){var n=V(t,function(t,e){var n=t.getValue();return{params:{depth:t.depth,height:t.height,dataIndex:t.dataIndex,getValue:function(){return n}},index:e}});return n.sort(function(t,n){return e(t.params,n.params)}),V(n,function(e){return t[e.index]})}var r="asc"===e;return t.sort(function(t,e){var n=(t.getValue()-e.getValue())*(r?1:-1);return 0===n?(t.dataIndex-e.dataIndex)*(r?-1:1):n})}(n,e),n.length&&B(t.children,function(t){VU(t,e)})}var FU={color:"fill",borderColor:"stroke"},GU={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},HU=Qa(),UU=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},n.prototype.getInitialData=function(t,e){return gS(null,this)},n.prototype.getDataParams=function(e,n,r){var i=t.prototype.getDataParams.call(this,e,n);return r&&(i.info=HU(r).info),i},n.type="series.custom",n.dependencies=["grid","polar","geo","singleAxis","calendar","matrix"],n.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},n}(Ky),WU=UU;function XU(t,e){return e=e||[0,0],V(["x","y"],function(n,r){var i=this.getAxis(n),o=e[r],a=t[r]/2;return"category"===i.type?$M(i).w:Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a))},this)}function jU(t,e){return e=e||[0,0],V([0,1],function(n){var r=e[n],i=t[n]/2,o=[],a=[];return o[n]=r-i,a[n]=r+i,o[1-n]=a[1-n]=e[1-n],Math.abs(this.dataToPoint(o)[n]-this.dataToPoint(a)[n])},this)}function ZU(t,e){var n=this.getAxis(),r=e instanceof Array?e[0]:e,i=(t instanceof Array?t[0]:t)/2;return"category"===n.type?$M(n).w:Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function YU(t,e){return e=e||[0,0],V(["Radius","Angle"],function(n,r){var i=this["get"+n+"Axis"](),o=e[r],a=t[r]/2,s="category"===i.type?$M(i).w:Math.abs(i.dataToCoord(o-a)-i.dataToCoord(o+a));return"Angle"===n&&(s=s*Math.PI/180),s},this)}var qU={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},KU=U(qU),JU=F(Ki,function(t,e){return t[e]=1,t},{}),QU=Ki.join(", "),$U=["","style","shape","extra"],tW=Qa();function eW(t,e,n,r,i){var o=t+"Animation",a=Ud(t,r,i)||{},s=tW(e).userDuring;return a.duration>0&&(a.during=s?W(hW,{el:e,userDuring:s}):null,a.setToFinal=!0,a.scope=t),L(a,n[o]),a}function nW(t,e,n,r){var i=(r=r||{}).dataIndex,o=r.isInit,a=r.clearStyle,s=n.isAnimationEnabled(),l=tW(t),u=e.style;l.userDuring=e.during;var h={},c={};if(function(t,e,n){for(var r=0;r<KU.length;r++){var i=KU[r],o=qU[i],a=e[i];a&&(n[o[0]]=a[0],n[o[1]]=a[1])}for(r=0;r<Ki.length;r++){var s=Ki[r];null!=e[s]&&(n[s]=e[s])}}(0,e,c),"compound"===t.type)for(var d=t.shape.paths,p=e.shape.paths,f=0;f<p.length;f++){dW("shape",p[f],d[f])}else dW("shape",e,c),dW("extra",e,c);if(!o&&s&&(function(t,e,n){for(var r=e.transition,i=oW(r)?Ki:Ba(r||[]),o=0;o<i.length;o++){var a=i[o];if("style"!==a&&"shape"!==a&&"extra"!==a){var s=t[a];aW(a,"el.transition"),n[a]=s}}}(t,e,h),cW("shape",t,e,h),cW("extra",t,e,h),function(t,e,n,r){if(!n)return;var i,o=t.style;if(o){var a=n.transition,s=e.transition;if(a&&!oW(a)){var l=Ba(a);!i&&(i=r.style={});for(var u=0;u<l.length;u++){var h=o[f=l[u]];i[f]=h}}else if(t.getAnimationStyleProps&&(oW(s)||oW(a)||N(s,"style")>=0)){var c=t.getAnimationStyleProps(),d=c?c.style:null;if(d){!i&&(i=r.style={});var p=U(n);for(u=0;u<p.length;u++){var f;if(d[f=p[u]]){h=o[f];i[f]=h}}}}}}(t,e,u,h)),c.style=u,function(t,e,n){var r=e.style;if(!t.isGroup&&r){if(n){t.useStyle({});for(var i=t.animators,o=0;o<i.length;o++){var a=i[o];"style"===a.targetName&&a.changeTarget(t.style)}}t.setStyle(r)}e&&(e.style=null,e&&t.attr(e),e.style=r)}(t,c,a),function(t,e){wt(e,"silent")&&(t.silent=e.silent),wt(e,"ignore")&&(t.ignore=e.ignore),t instanceof vl&&wt(e,"invisible")&&(t.invisible=e.invisible);t instanceof xu&&wt(e,"autoBatch")&&(t.autoBatch=e.autoBatch)}(t,e),s)if(o){var g={};B($U,function(t){var n=t?e[t]:e;n&&n.enterFrom&&(t&&(g[t]=g[t]||{}),L(t?g[t]:g,n.enterFrom))});var m=eW("enter",t,e,n,i);m.duration>0&&t.animateFrom(g,m)}else!function(t,e,n,r,i){if(i){var o=eW("update",t,e,r,n);o.duration>0&&t.animateFrom(i,o)}}(t,e,i||0,n,h);rW(t,e),u?t.dirty():t.markRedraw()}function rW(t,e){for(var n=tW(t).leaveToProps,r=0;r<$U.length;r++){var i=$U[r],o=i?e[i]:e;o&&o.leaveTo&&(n||(n=tW(t).leaveToProps={}),i&&(n[i]=n[i]||{}),L(i?n[i]:n,o.leaveTo))}}function iW(t,e,n,r){if(t){var i=t.parent,o=tW(t).leaveToProps;if(o){var a=eW("update",t,e,n,0);a.done=function(){i&&i.remove(t),r&&r()},t.animateTo(o,a)}else i&&i.remove(t),r&&r()}}function oW(t){return"all"===t}var aW,sW={},lW={setTransform:function(t,e){return ht(wt(JU,t),"Only "+QU+" available in `setTransform`."),sW.el[t]=e,this},getTransform:function(t){return ht(wt(JU,t),"Only "+QU+" available in `getTransform`."),sW.el[t]},setShape:function(t,e){uW(t);var n=sW.el;return(n.shape||(n.shape={}))[t]=e,n.dirtyShape&&n.dirtyShape(),this},getShape:function(t){uW(t);var e=sW.el.shape;if(e)return e[t]},setStyle:function(t,e){uW(t);var n=sW.el,r=n.style;return r&&(it(e)&&Da("style."+t+" must not be assigned with NaN."),r[t]=e,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(t){uW(t);var e=sW.el.style;if(e)return e[t]},setExtra:function(t,e){return uW(t),(sW.el.extra||(sW.el.extra={}))[t]=e,this},getExtra:function(t){uW(t);var e=sW.el.extra;if(e)return e[t]}};function uW(t){if("transition"===t||"enterFrom"===t||"leaveTo"===t)throw new Error('key must not be "'+t+'"')}function hW(){var t=this,e=t.el;if(e){var n=tW(e).userDuring,r=t.userDuring;n===r?(sW.el=e,r(lW)):t.el=t.userDuring=null}}function cW(t,e,n,r){var i=n[t];if(i){var o,a=e[t];if(a){var s=n.transition,l=i.transition;if(l)if(!o&&(o=r[t]={}),oW(l))L(o,a);else for(var u=Ba(l),h=0;h<u.length;h++){var c=a[p=u[h]];o[p]=c}else if(oW(s)||N(s,t)>=0){!o&&(o=r[t]={});var d=U(a);for(h=0;h<d.length;h++){var p;c=a[p=d[h]];pW(i[p],c)&&(o[p]=c)}}}}}function dW(t,e,n){var r=e[t];if(r)for(var i=n[t]={},o=U(r),a=0;a<o.length;a++){var s=o[a];i[s]=ai(r[s])}}function pW(t,e){return z(t)?t!==e:null!=t&&isFinite(t)}aW=function(t,e){wt(JU,t)||Da("Prop `"+t+"` is not a permitted in `"+e+"`. Only `"+U(JU).join("`, `")+"` are permitted.")};var fW=Qa(),gW=["percent","easing","shape","style","extra"];function mW(t){t.stopAnimation("keyframe"),t.attr(fW(t))}function vW(t,e,n){if(n.isAnimationEnabled()&&e)if(j(e))B(e,function(e){vW(t,e,n)});else{var r=e.keyframes,i=e.duration;if(n&&null==i){var o=Ud("enter",n,0);i=o&&o.duration}if(r&&i){var a=fW(t);B($U,function(n){if(!n||t[n]){var o,s=!1;r.sort(function(t,e){return t.percent-e.percent}),B(r,function(r){var l=t.animators,u=n?r[n]:r;if(r.percent>=1&&(s=!0),u){var h=U(u);if(n||(h=G(h,function(t){return N(gW,t)<0})),h.length){o||((o=t.animate(n,e.loop,!0)).scope="keyframe");for(var c=0;c<l.length;c++)l[c]!==o&&l[c].targetName===o.targetName&&l[c].stopTracks(h);n&&(a[n]=a[n]||{});var d=n?a[n]:a;B(h,function(e){d[e]=((n?t[n]:t)||{})[e]}),o.whenWithKeys(i*r.percent,u,h,r.easing)}}}),o&&(s||Da("End frame with percent: 1 is missing in the keyframeAnimation.",!0),o.delay(e.delay||0).duration(i).start(e.easing))}})}}}var yW="emphasis",_W="normal",xW="blur",bW="select",wW=[_W,yW,xW,bW],SW={normal:["itemStyle"],emphasis:[yW,"itemStyle"],blur:[xW,"itemStyle"],select:[bW,"itemStyle"]},TW={normal:["label"],emphasis:[yW,"label"],blur:[xW,"label"],select:[bW,"label"]},MW=["x","y"],CW={normal:{},emphasis:{},blur:{},select:{}},IW={cartesian2d:function(t){var e=t.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:W(XU,t)}}},geo:function(t){var e=t.view,n=e.getBoundingRect();return{coordSys:{type:"geo",x:n.x,y:n.y,width:n.width,height:n.height,zoom:TN(e)},api:{coord:function(e){return t.dataToPoint(e)},size:W(jU,t)}}},single:function(t){var e=t.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e){return t.dataToPoint(e)},size:W(ZU,t)}}},polar:function(t){var e=t.getRadiusAxis(),n=t.getAngleAxis(),r=e.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:"polar",cx:t.cx,cy:t.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=e.dataToRadius(r[0]),o=n.dataToAngle(r[1]),a=t.coordToPoint([i,o]);return a.push(i,o*Math.PI/180),a},size:W(YU,t)}}},calendar:function(t){var e=t.getRect(),n=t.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:t.getCellWidth(),cellHeight:t.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(e,n){return t.dataToPoint(e,n)},layout:function(e,n){return t.dataToLayout(e,n)}}}},matrix:function(t){var e=t.getRect();return{coordSys:{type:"matrix",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(e,n){return t.dataToPoint(e,n)},layout:function(e,n){return t.dataToLayout(e,n)}}}}};function AW(t){return t instanceof xu}function DW(t){return t instanceof vl}var LW=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n,r){this._progressiveEls=null;var i=this._data,o=t.getData(),a=this.group,s=kW(t,o,e,n);i||a.removeAll(),o.diff(i).add(function(e){BW(n,null,e,s(e,r),t,a,o)}).remove(function(e){var n=i.getItemGraphicEl(e);n&&iW(n,HU(n).option,t)}).update(function(e,l){var u=i.getItemGraphicEl(l);BW(n,u,e,s(e,r),t,a,o)}).execute();var l=t.get("clip",!0)?dD(t.coordinateSystem,!1,t):null;l?a.setClipPath(l):a.removeClipPath(),this._data=o},n.prototype.incrementalPrepareRender=function(t,e,n){this.group.removeAll(),this._data=null},n.prototype.incrementalRender=function(t,e,n,r,i){var o=e.getData(),a=kW(e,o,n,r),s=this._progressiveEls=[];function l(t){t.isGroup||(t.incremental=Ss(e),t.ensureState("emphasis").hoverLayer=2)}for(var u=t.start;u<t.end;u++){var h=BW(null,null,u,a(u,i),e,this.group,o);h&&(h.traverse(l),s.push(h))}},n.prototype.eachRendered=function(t){Dp(this._progressiveEls||this.group,t)},n.prototype.filterForExposedEvent=function(t,e,n,r){var i=e.element;if(null==i||n.name===i)return!0;for(;(n=n.__hostTarget||n.parent)&&n!==this.group;)if(n.name===i)return!0;return!1},n.type="custom",n}(l_),PW=LW;function EW(t){var e,n=t.type;if("path"===n){var r=null!=(o=t.shape).width&&null!=o.height?{x:o.x||0,y:o.y||0,width:o.width,height:o.height}:null,i=YW(o);e=ap(i,null,r,o.layout||"center"),HU(e).customPathData=i}else if("image"===n)e=new Iu({}),HU(e).customImagePath=t.style.image;else if("text"===n)e=new Qu({});else if("group"===n)e=new Do;else if("compoundPath"===n){var o;if(!(o=t.shape)||!o.paths){Na("shape.paths must be specified in compoundPath")}var a=V(o.paths,function(t){if("path"===t.type)return ap(t.shape.pathData,t,null);var e=op(t.type);if(!e){Na('graphic type "'+n+'" can not be found.')}return new e});e=new Td({shape:{paths:a}})}else{var s=op(n);if(!s){Na('graphic type "'+n+'" can not be found.')}e=new s}return HU(e).customGraphicType=n,e.name=t.name,e.z2EmphasisLift=1,e.z2SelectLift=1,e}function OW(t,e,n,r,i,o,a){mW(e);var s=i&&i.normal.cfg;s&&e.setTextConfig(s),r&&null==r.transition&&(r.transition=MW);var l=r&&r.style;if(l){if("text"===e.type){var u=l;wt(u,"textFill")&&(u.fill=u.textFill),wt(u,"textStroke")&&(u.stroke=u.textStroke)}var h=void 0,c=AW(e)?l.decal:null;t&&c&&(c.dirty=!0,h=$x(c,t)),l.__decalPattern=h}DW(e)&&(l&&(h=l.__decalPattern)&&(l.decal=h));nW(e,r,o,{dataIndex:n,isInit:a,clearStyle:!0}),vW(e,r.keyframeAnimation,o)}function NW(t,e,n,r,i){var o=e.isGroup?null:e,a=i&&i[t].cfg;if(o){var s=o.ensureState(t);if(!1===r){var l=o.getState(t);l&&(l.style=null)}else s.style=r||null;a&&(s.textConfig=a),Gh(o)}}function RW(t,e,n){var r=n===_W,i=r?e:HW(e,n),o=i?i.z2:null;null!=o&&((r?t:t.ensureState(n)).z2=o||0)}function kW(t,e,n,r){var i=t.get("renderItem");if("string"==typeof i){var o=lx[i];o?i=o:console.warn("Custom series renderItem '"+i+"' not found.\n Call 'echarts.registerCustomSeries' to register it.")}var a=t.coordinateSystem,s={};a&&(ht(i,"series.render is required."),ht(a.prepareCustoms||IW[a.type],"This coordSys does not support custom series."),s=a.prepareCustoms?a.prepareCustoms(a):IW[a.type](a));for(var l,u,h=E({getWidth:r.getWidth,getHeight:r.getHeight,getZr:r.getZr,getDevicePixelRatio:r.getDevicePixelRatio,value:function(t,n){return null==n&&(n=l),e.getStore().get(e.getDimensionIndex(t||0),n)},style:function(n,r){SD("api.style","Please write literal style directly instead."),null==r&&(r=l);var i=e.getItemVisual(r,"style"),o=i&&i.fill,a=i&&i.opacity,s=_(r,_W).getItemStyle();null!=o&&(s.fill=o),null!=a&&(s.opacity=a);var u={inheritColor:Y(o)?o:om.color.neutral99},h=x(r,_W),c=Yp(h,null,u,!1,!0);c.text=h.getShallow("show")?at(t.getFormattedLabel(r,_W),VA(e,r)):null;var d=qp(h,u,!1);return w(n,s),s=bD(s,c,d),n&&b(s,n),s.legacy=!0,s},ordinalRawValue:function(t,n){null==n&&(n=l),t=t||0;var r=e.getDimensionInfo(t);if(!r){var i=e.getDimensionIndex(t);return i>=0?e.getStore().get(i,n):void 0}var o=e.get(r.name,n),a=r&&r.ordinalMeta;return a?a.categories[o]:o},styleEmphasis:function(n,r){SD("api.styleEmphasis","Please write literal style directly instead."),null==r&&(r=l);var i=_(r,yW).getItemStyle(),o=x(r,yW),a=Yp(o,null,null,!0,!0);a.text=o.getShallow("show")?st(t.getFormattedLabel(r,yW),t.getFormattedLabel(r,_W),VA(e,r)):null;var s=qp(o,null,!0);return w(n,i),i=bD(i,a,s),n&&b(i,n),i.legacy=!0,i},visual:function(t,n){if(null==n&&(n=l),wt(FU,t)){var r=e.getItemVisual(n,"style");return r?r[FU[t]]:null}if(wt(GU,t))return e.getItemVisual(n,t)},barLayout:function(t){if("cartesian2d"===a.type){return function(t){if(kS(t.axis.scale)){for(var e=$M(t.axis),n=[],r=0;r<t.count;r++)n.push(E({stackId:VL+r},t));var i=HL({bandWidthResult:e,seriesInfo:n}),o=[];for(r=0;r<t.count;r++){var a=i[VL+r];a.offsetCenter=a.offset+a.width/2,o.push(a)}return o}}(E({axis:a.getBaseAxis()},t))}},currentSeriesIndices:function(){return n.getCurrentSeriesIndices()},font:function(t){return tf(t,n)}},s.api||{}),c={context:{},seriesId:t.id,seriesName:t.name,seriesIndex:t.seriesIndex,coordSys:s.coordSys,dataInsideLength:e.count(),encode:zW(t.getData()),itemPayload:t.get("itemPayload")||{}},d={},p={},f={},g={},m=0;m<wW.length;m++){var v=wW[m];f[v]=t.getModel(SW[v]),g[v]=t.getModel(TW[v])}function y(t){return t===l?u||(u=e.getItemModel(t)):e.getItemModel(t)}function _(t,n){return e.hasItemOption?t===l?d[n]||(d[n]=y(t).getModel(SW[n])):y(t).getModel(SW[n]):f[n]}function x(t,n){return e.hasItemOption?t===l?p[n]||(p[n]=y(t).getModel(TW[n])):y(t).getModel(TW[n]):g[n]}return function(t,n){return l=t,u=null,d={},p={},i&&i(E({dataIndexInside:t,dataIndex:e.getRawIndex(t),actionType:n?n.type:null},c),h)};function b(t,e){for(var n in e)wt(e,n)&&(t[n]=e[n])}function w(t,e){t&&(t.textFill&&(e.textFill=t.textFill),t.textPosition&&(e.textPosition=t.textPosition))}}function zW(t){var e={};return B(t.dimensions,function(n){var r=t.getDimensionInfo(n);if(!r.isExtraCoord){var i=r.coordDim;(e[i]=e[i]||[])[r.coordDimIndex]=t.getDimensionIndex(n)}}),e}function BW(t,e,n,r,i,o,a){if(r){var s=VW(t,e,n,r,i,o);return s&&a.setItemGraphicEl(n,s),s&&ic(s,r.focus,r.blurScope,r.emphasisDisabled),s}o.remove(e)}function VW(t,e,n,r,i,o){ht(r,"should not have an null/undefined element setting");var a=-1,s=e;e&&FW(e,r,i)&&(a=N(o.childrenRef(),e),e=null);var l,u,h=!e,c=e;c?c.clearStates():(c=EW(r),s&&(l=s,(u=c).copyTransform(l),DW(u)&&DW(l)&&(u.setStyle(l.style),u.z=l.z,u.z2=l.z2,u.zlevel=l.zlevel,u.invisible=l.invisible,u.ignore=l.ignore,AW(u)&&AW(l)&&u.setShape(l.shape)))),!1===r.morph?c.disableMorphing=!0:c.disableMorphing&&(c.disableMorphing=!1),r.tooltipDisabled&&(c.tooltipDisabled=!0),CW.normal.cfg=CW.normal.conOpt=CW.emphasis.cfg=CW.emphasis.conOpt=CW.blur.cfg=CW.blur.conOpt=CW.select.cfg=CW.select.conOpt=null,CW.isLegacy=!1,function(t,e,n,r,i,o){if(t.isGroup||"compoundPath"===t.type)return;GW(n,null,o),GW(n,yW,o);var a=o.normal.conOpt,s=o.emphasis.conOpt,l=o.blur.conOpt,u=o.select.conOpt;if(null!=a||null!=s||null!=u||null!=l){var h=t.getTextContent();if(!1===a)h&&t.removeTextContent();else{a=o.normal.conOpt=a||{type:"text"},h?h.clearStates():(h=EW(a),t.setTextContent(h)),OW(null,h,e,a,null,r,i);for(var c=a&&a.style,d=0;d<wW.length;d++){var p=wW[d];if(p!==_W){var f=o[p].conOpt;NW(p,h,0,UW(a,f,p),null)}}c?h.dirty():h.markRedraw()}}}(c,n,r,i,h,CW),function(t,e,n,r,i){var o=n.clipPath;if(!1===o)t&&t.getClipPath()&&t.removeClipPath();else if(o){var a=t.getClipPath();a&&FW(a,o,r)&&(a=null),a||(ht(AW(a=EW(o)),"Only any type of `path` can be used in `clipPath`, rather than "+a.type+"."),t.setClipPath(a)),OW(null,a,e,o,null,r,i)}}(c,n,r,i,h),OW(t,c,n,r,CW,i,h),wt(r,"info")&&(HU(c).info=r.info);for(var d=0;d<wW.length;d++){var p=wW[d];if(p!==_W){var f=HW(r,p);NW(p,c,0,UW(r,f,p),CW)}}return function(t,e,n){if(!t.isGroup){var r=t,i=n.currentZ,o=n.currentZLevel;r.z=i,r.zlevel=o;var a=e.z2;null!=a&&(r.z2=a||0);for(var s=0;s<wW.length;s++)RW(r,e,wW[s])}}(c,r,i),"group"===r.type&&function(t,e,n,r,i){var o=r.children,a=o?o.length:0,s=r.$mergeChildren,l="byName"===s||r.diffChildrenByName,u=!1===s;if(!a&&!l&&!u)return;if(l)return h={api:t,oldChildren:e.children()||[],newChildren:o||[],dataIndex:n,seriesModel:i,group:e},void new Ow(h.oldChildren,h.newChildren,XW,XW,h).add(jW).update(jW).remove(ZW).execute();var h;u&&e.removeAll();for(var c=0;c<a;c++){var d=o[c],p=e.childAt(c);d?(null==d.ignore&&(d.ignore=!1),VW(t,p,n,d,i,e)):(ht(p,"renderItem should not return a group containing elements as null/undefined/{} if they do not exist before."),p.ignore=!0)}for(var f=e.childCount()-1;f>=c;f--){var g=e.childAt(f);WW(e,g,i)}}(t,c,n,r,i),a>=0?o.replaceAt(c,a):o.add(c),c}function FW(t,e,n){var r,i=HU(t),o=e.type,a=e.shape,s=e.style;return n.isUniversalTransitionEnabled()||null!=o&&o!==i.customGraphicType||"path"===o&&((r=a)&&(wt(r,"pathData")||wt(r,"d")))&&YW(a)!==i.customPathData||"image"===o&&wt(s,"image")&&s.image!==i.customImagePath}function GW(t,e,n){var r=e?HW(t,e):t,i=e?UW(t,r,yW):t.style,o=t.type,a=r?r.textConfig:null,s=t.textContent,l=s?e?HW(s,e):s:null;if(i&&(n.isLegacy||yD(i,o,!!a,!!l))){n.isLegacy=!0;var u=_D(i,o,!e);!a&&u.textConfig&&(a=u.textConfig),!l&&u.textContent&&(l=u.textContent)}if(!e&&l){var h=l;!h.type&&(h.type="text"),ht("text"===h.type,'textContent.type must be "text"')}var c=e?n[e]:n.normal;c.cfg=a,c.conOpt=l}function HW(t,e){return e?t?t[e]:null:t}function UW(t,e,n){var r=e&&e.style;return null==r&&n===yW&&t&&(r=t.styleEmphasis),r}function WW(t,e,n){e&&iW(e,HU(t).option,n)}function XW(t,e){var n=t&&t.name;return null!=n?n:"e\0\0"+e}function jW(t,e){var n=this.context,r=null!=t?n.newChildren[t]:null,i=null!=e?n.oldChildren[e]:null;VW(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function ZW(t){var e=this.context,n=e.oldChildren[t];n&&iW(n,HU(n).option,e.seriesModel)}function YW(t){return t&&(t.pathData||t.d)}var qW=Qa(),KW=I,JW=W,QW=function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(t,e,n,r){var i=e.get("value"),o=e.get("status");if(this._axisModel=t,this._axisPointerModel=e,this._api=n,r||this._lastValue!==i||this._lastStatus!==o){this._lastValue=i,this._lastStatus=o;var a=this._group,s=this._handle;if(!o||"hide"===o)return a&&a.hide(),void(s&&s.hide());a&&a.show(),s&&s.show();var l={};this.makeElOption(l,i,t,e,n);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(t,e);if(a){var c=X($W,e,h);this.updatePointerEl(a,l,c),this.updateLabelEl(a,l,c,e)}else a=this._group=new Do,this.createPointerEl(a,l,t,e),this.createLabelEl(a,l,t,e),n.getZr().add(a);rX(a,e,!0),this._renderHandle(i)}},t.prototype.remove=function(t){this.clear(t)},t.prototype.dispose=function(t){this.clear(t)},t.prototype.determineAnimation=function(t,e){var n=e.get("animation"),r=t.axis,i="category"===r.type,o=e.get("snap");if(!o&&!i)return!1;if("auto"===n||null==n){var a=this.animationThreshold;if(i&&$M(r).w>a)return!0;if(o){var s=IE(t).seriesDataCount,l=r.getExtent();return Math.abs(l[0]-l[1])/s>a}return!1}return!0===n},t.prototype.makeElOption=function(t,e,n,r,i){},t.prototype.createPointerEl=function(t,e,n,r){var i=e.pointer;if(i){var o=qW(t).pointerEl=new Hp[i.type](KW(e.pointer));t.add(o)}},t.prototype.createLabelEl=function(t,e,n,r){if(e.label){var i=qW(t).labelEl=new Qu(KW(e.label));t.add(i),eX(i,r)}},t.prototype.updatePointerEl=function(t,e,n){var r=qW(t).pointerEl;r&&e.pointer&&(r.setStyle(e.pointer.style),n(r,{shape:e.pointer.shape}))},t.prototype.updateLabelEl=function(t,e,n,r){var i=qW(t).labelEl;i&&(i.setStyle(e.label.style),n(i,{x:e.label.x,y:e.label.y}),eX(i,r))},t.prototype._renderHandle=function(t){if(!this._dragging&&this.updateHandleTransform){var e,n=this._axisPointerModel,r=this._api.getZr(),i=this._handle,o=n.getModel("handle"),a=n.get("status");if(!o.get("show")||!a||"hide"===a)return i&&r.remove(i),void(this._handle=null);this._handle||(e=!0,i=this._handle=xp(o.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){_e(t.event)},onmousedown:JW(this._onHandleDragMove,this,0,0),drift:JW(this._onHandleDragMove,this),ondragend:JW(this._onHandleDragEnd,this)}),r.add(i)),rX(i,n,!1),i.setStyle(o.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=o.get("size");j(s)||(s=[s,s]),i.scaleX=s[0]/2,i.scaleY=s[1]/2,p_(this,"_doDispatchAxisPointer",o.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},t.prototype._moveHandleToValue=function(t,e){$W(this._axisPointerModel,!e&&this._moveAnimation,this._handle,nX(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(t,e){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(nX(n),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(nX(r)),qW(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),n=this._group,r=this._handle;e&&n&&(this._lastGraphicKey=null,n&&e.remove(n),r&&e.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),f_(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}},t}();function $W(t,e,n,r){tX(qW(n).lastProp,r)||(qW(n).lastProp=r,e?Xd(n,r,t):(n.stopAnimation(),n.attr(r)))}function tX(t,e){if(J(t)&&J(e)){var n=!0;return B(e,function(e,r){n=n&&tX(t[r],e)}),!!n}return t===e}function eX(t,e){t[e.get(["label","show"])?"show":"hide"]()}function nX(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function rX(t,e,n){var r=e.get("z"),i=e.get("zlevel");t&&t.traverse(function(t){"group"!==t.type&&(null!=r&&(t.z=r),null!=i&&(t.zlevel=i),t.silent=n)})}var iX=QW;function oX(t){var e,n=t.get("type"),r=t.getModel(n+"Style");return"line"===n?(e=r.getLineStyle()).fill=null:"shadow"===n&&((e=r.getAreaStyle()).stroke=null),e}function aX(t,e,n,r,i){var o=sX(n.get("value"),e.axis,e.ecModel,n.get("seriesDataIndices"),{precision:n.get(["label","precision"]),formatter:n.get(["label","formatter"])}),a=n.getModel("label"),s=vg(a.get("padding")||0),l=a.getFont(),u=ao(o,l),h=i.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=i.align;"right"===p&&(h[0]-=c),"center"===p&&(h[0]-=c/2);var f=i.verticalAlign;"bottom"===f&&(h[1]-=d),"middle"===f&&(h[1]-=d/2),function(t,e,n,r){var i=r.getWidth(),o=r.getHeight();t[0]=Math.min(t[0]+e,i)-e,t[1]=Math.min(t[1]+n,o)-n,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}(h,c,d,r);var g=a.get("backgroundColor");g&&"auto"!==g||(g=e.get(["axisLine","lineStyle","color"])),t.label={x:h[0],y:h[1],style:Yp(a,{text:o,font:l,fill:a.getTextColor(),padding:s,backgroundColor:g}),z2:10}}function sX(t,e,n,r,i){t=e.scale.parse(t);var o=e.scale.getLabel({value:t},{precision:i.precision}),a=i.formatter;if(a){var s={value:yT(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};B(r,function(t){var e=n.getSeriesByIndex(t.seriesIndex),r=t.dataIndexInside,i=e&&e.getDataParams(r);i&&s.seriesData.push(i)}),Y(a)?o=a.replace("{value}",o):Z(a)&&(o=a(s))}return o}function lX(t,e,n){var r=[1,0,0,1,0,0];return De(r,r,n.rotation),Ae(r,r,n.position),fp([t.dataToCoord(e),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function uX(t,e,n,r,i,o){var a=bL.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get(["label","margin"]),aX(e,r,i,o,{position:lX(r.axis,t,n),align:a.textAlign,verticalAlign:a.textVerticalAlign})}function hX(t,e,n){return{x1:t[n=n||0],y1:t[1-n],x2:e[n],y2:e[1-n]}}function cX(t,e,n){return{x:t[n=n||0],y:t[1-n],width:e[n],height:e[1-n]}}function dX(t,e,n,r,i,o){return{cx:t,cy:e,r0:n,r:r,startAngle:i,endAngle:o,clockwise:!0}}function pX(t,e,n){return $M(t,{fromStat:{sers:V(e,function(t){return n.getSeriesByIndex(t.seriesIndex)})},min:1}).w}function fX(t,e,n){return[Go(Fo(e[0],e[1]),t-n/2),Fo(t+n/2,Go(e[0],e[1]))]}var gX=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.makeElOption=function(t,e,n,r,i){var o=n.axis,a=o.grid,s=r.get("type"),l=o.getGlobalExtent(),u=mX(a,o).getOtherAxis(o).getGlobalExtent(),h=o.toGlobalCoord(o.dataToCoord(e,!0));if(s&&"none"!==s){var c=oX(r),d=vX[s](o,h,l,u,r.get("seriesDataIndices"),r.ecModel);d.style=c,t.graphicKey=d.type,t.pointer=d}uX(e,t,wL(a.getRect(),n),n,r,i)},n.prototype.getHandleTransform=function(t,e,n){var r=wL(e.axis.grid.getRect(),e,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=lX(e.axis,t,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},n.prototype.updateHandleTransform=function(t,e,n,r){var i=n.axis,o=i.grid,a=i.getGlobalExtent(!0),s=mX(o,i).getOtherAxis(i).getGlobalExtent(),l="x"===i.dim?0:1,u=[t.x,t.y];u[l]+=e[l],u[l]=Fo(a[1],u[l]),u[l]=Go(a[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{x:u[0],y:u[1],rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}},n}(iX);function mX(t,e){var n={};return n[e.dim+"AxisIndex"]=e.index,t.getCartesian(n)}var vX={line:function(t,e,n,r){return{type:"Line",subPixelOptimize:!0,shape:hX([e,r[0]],[e,r[1]],yX(t))}},shadow:function(t,e,n,r,i,o){var a=pX(t,i,o),s=r[1]-r[0],l=fX(e,n,a),u=l[0],h=l[1];return{type:"Rect",shape:cX([u,r[0]],[h-u,s],yX(t))}}};function yX(t){return"x"===t.dim?0:1}var _X=gX,xX=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="axisPointer",n.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:om.color.border,width:1,type:"dashed"},shadowStyle:{color:om.color.shadowTint},label:{show:!0,formatter:null,precision:"auto",margin:3,color:om.color.neutral00,padding:[5,7,5,7],backgroundColor:om.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:om.color.accent40,throttle:40}},n}(tm),bX=xX,wX=Qa(),SX=B;function TX(t,e,n){if(!i.node){var r=e.getZr();wX(r).records||(wX(r).records={}),function(t,e){if(wX(t).initialized)return;function n(n,r){t.on(n,function(n){var i=function(t){var e={showTip:[],hideTip:[]},n=function(r){var i=e[r.type];i?i.push(r):(r.dispatchAction=n,t.dispatchAction(r))};return{dispatchAction:n,pendings:e}}(e);SX(wX(t).records,function(t){t&&r(t,n,i.dispatchAction)}),function(t,e){var n,r=t.showTip.length,i=t.hideTip.length;r?n=t.showTip[r-1]:i&&(n=t.hideTip[i-1]);n&&(n.dispatchAction=null,e.dispatchAction(n))}(i.pendings,e)})}wX(t).initialized=!0,n("click",X(CX,"click")),n("mousemove",X(CX,"mousemove")),n("mousewheel",X(CX,"mousewheel")),n("globalout",MX)}(r,e),(wX(r).records[t]||(wX(r).records[t]={})).handler=n}}function MX(t,e,n){t.handler("leave",null,n)}function CX(t,e,n,r){e.handler(t,n,r)}function IX(t,e){if(!i.node){var n=e.getZr();(wX(n).records||{})[t]&&(wX(n).records[t]=null)}}var AX=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var r=e.getComponent("tooltip"),i=t.get("triggerOn")||r&&r.get("triggerOn")||"mousemove|click|mousewheel";TX("axisPointer",n,function(t,e,n){"none"!==i&&("leave"===t||i.indexOf(t)>=0)&&n({type:"updateAxisPointer",currTrigger:t,x:e&&e.offsetX,y:e&&e.offsetY})})},n.prototype.remove=function(t,e){IX("axisPointer",e)},n.prototype.dispose=function(t,e){IX("axisPointer",e)},n.type="axisPointer",n}(Qy),DX=AX;function LX(t,e){var n,r=[],i=t.seriesIndex;if(null==i||!(n=e.getSeriesByIndex(i)))return{point:[]};var o=n.getData(),a=Ja(o,t);if(null==a||a<0||j(a))return{point:[]};var s=o.getItemGraphicEl(a),l=n.coordinateSystem;if(n.getTooltipPosition)r=n.getTooltipPosition(a)||[];else if(l&&l.dataToPoint)if(t.isStacked){var u=l.getBaseAxis(),h=l.getOtherAxis(u).dim,c=u.dim,d="x"===h||"radius"===h?1:0,p=o.mapDimension(c),f=[];f[d]=o.get(p,a),f[1-d]=o.get(o.getCalculationInfo("stackResultDimension"),a),r=l.dataToPoint(f)||[]}else r=l.dataToPoint(o.getValues(V(l.dimensions,function(t){return o.mapDimension(t)}),a))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var PX=Qa();function EX(t,e,n){var r=t.currTrigger,i=[t.x,t.y],o=t,a=t.dispatchAction||W(n.dispatchAction,n),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){zX(i)&&(i=LX({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=zX(i),u=o.axesInfo,h=s.axesInfo,c="leave"===r||zX(i),d={},p={},f={list:[],map:{}},g={showPointer:X(NX,p),showTooltip:X(RX,f)};B(s.coordSysMap,function(t,e){var n=l||t.containPoint(i);B(s.coordSysAxesInfo[e],function(t,e){var r=t.axis,o=function(t,e){for(var n=0;n<(t||[]).length;n++){var r=t[n];if(e.axis.dim===r.axisDim&&e.axis.model.componentIndex===r.axisIndex)return r}}(u,t);if(!c&&n&&(!u||o)){var a=o&&o.value;null!=a||l||(a=r.pointToData(i)),null!=a&&OX(t,a,g,!1,d)}})});var m={};return B(h,function(t,e){var n=t.linkGroup;n&&!p[e]&&B(n.axesInfo,function(e,r){var i=p[r];if(e!==t&&i){var o=i.value;n.mapper&&(o=t.axis.scale.parse(n.mapper(o,kX(e),kX(t)))),m[t.key]=o}})}),B(m,function(t,e){OX(h[e],t,g,!0,d)}),function(t,e,n){var r=n.axesInfo=[];B(e,function(e,n){var i=e.axisPointerModel.option,o=t[n];o?(!e.useHandle&&(i.status="show"),i.value=o.value,i.seriesDataIndices=(o.payloadBatch||[]).slice()):!e.useHandle&&(i.status="hide"),"show"===i.status&&r.push({axisDim:e.axis.dim,axisIndex:e.axis.model.componentIndex,value:i.value})})}(p,h,d),function(t,e,n,r){if(zX(e)||!t.list.length)return void r({type:"hideTip"});var i=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:t.list})}(f,i,t,a),function(t,e,n){var r=n.getZr(),i="axisPointerLastHighlights",o=PX(r)[i]||{},a=PX(r)[i]={};B(t,function(t,e){var n=t.axisPointerModel.option;"show"===n.status&&t.triggerEmphasis&&B(n.seriesDataIndices,function(t){a[t.seriesIndex+"|"+t.dataIndex]=t})});var s=[],l=[];function u(t){return{seriesIndex:t.seriesIndex,dataIndex:t.dataIndex}}B(o,function(t,e){!a[e]&&l.push(u(t))}),B(a,function(t,e){!o[e]&&s.push(u(t))}),l.length&&n.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&n.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}(h,0,n),d}}function OX(t,e,n,r,i){var o=t.axis;if(!o.scale.isBlank()&&o.containData(e))if(t.involveSeries){var a=function(t,e){var n=e.axis,r=n.dim,i=t,o=[],a=Number.MAX_VALUE,s=-1;return B(e.seriesModels,function(e,l){var u,h,c=e.getData().mapDimensionsAll(r);if(e.getAxisTooltipData){var d=e.getAxisTooltipData(c,t,n);h=d.dataIndices,u=d.nestestValue}else{if(!(h=e.indicesOfNearest(r,c[0],t,"category"===n.type?.5:null)).length)return;u=e.getData().get(c[0],h[0])}if(Ta(u)){var p=t-u,f=Math.abs(p);f<=a&&((f<a||p>=0&&s<0)&&(a=f,s=p,i=u,o.length=0),B(h,function(t){o.push({seriesIndex:e.seriesIndex,dataIndexInside:t,dataIndex:e.getData().getRawIndex(t)})}))}}),{payloadBatch:o,snapToValue:i}}(e,t),s=a.payloadBatch,l=a.snapToValue;s[0]&&null==i.seriesIndex&&L(i,s[0]),!r&&t.snap&&o.containData(l)&&null!=l&&(e=l),n.showPointer(t,e,s),n.showTooltip(t,a,l)}else n.showPointer(t,e)}function NX(t,e,n,r){t[e.key]={value:n,payloadBatch:r}}function RX(t,e,n,r){var i=n.payloadBatch,o=e.axis,a=o.model,s=e.axisPointerModel;if(e.triggerTooltip&&i.length){var l=e.coordSys.model,u=DE(l),h=t.map[u];h||(h=t.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(h)),h.dataByAxis.push({axisDim:o.dim,axisIndex:a.componentIndex,axisType:a.type,axisId:a.id,value:r,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function kX(t){var e=t.axis.model,n={},r=n.axisDim=t.axis.dim;return n.axisIndex=n[r+"AxisIndex"]=e.componentIndex,n.axisName=n[r+"AxisName"]=e.name,n.axisId=n[r+"AxisId"]=e.id,n}function zX(t){return!t||null==t[0]||isNaN(t[0])||null==t[1]||isNaN(t[1])}function BX(t){EE.registerAxisPointerClass("CartesianAxisPointer",_X),t.registerComponentModel(bX),t.registerComponentView(DX),t.registerPreprocessor(function(t){if(t){(!t.axisPointer||0===t.axisPointer.length)&&(t.axisPointer={});var e=t.axisPointer.link;e&&!j(e)&&(t.axisPointer.link=[e])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=ME(t,e)}}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},EX)}var VX=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.makeElOption=function(t,e,n,r,i){var o=n.axis;"angle"===o.dim&&(this.animationThreshold=Math.PI/18);var a=o.polar,s=o.getExtent(),l=a.getOtherAxis(o).getExtent(),u=o.dataToCoord(e),h=r.get("type");if(h&&"none"!==h){var c=oX(r),d=FX[h](o,a,u,s,l,r.get("seriesDataIndices"),r.ecModel);d.style=c,t.graphicKey=d.type,t.pointer=d}var p=function(t,e,n,r,i){var o=e.axis,a=o.dataToCoord(t),s=r.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=r.getRadiusAxis().getExtent();if("radius"===o.dim){var d=[1,0,0,1,0,0];De(d,d,s),Ae(d,d,[r.cx,r.cy]),l=fp([a,-i],d);var p=e.getModel("axisLabel").get("rotate")||0,f=bL.innerTextLayout(s,p*Math.PI/180,-1);u=f.textAlign,h=f.textVerticalAlign}else{var g=c[1];l=r.coordToPoint([g+i,a]);var m=r.cx,v=r.cy;u=Math.abs(l[0]-m)/g<.3?"center":l[0]>m?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(e,n,0,a,r.get(["label","margin"]));aX(t,n,r,i,p)},n}(iX);var FX={line:function(t,e,n,r,i){return"angle"===t.dim?{type:"Line",shape:hX(e.coordToPoint([i[0],n]),e.coordToPoint([i[1],n]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:n}}},shadow:function(t,e,n,r,i,o,a){var s,l=Math.PI/180,u=pX(t,o,a);if("angle"===t.dim)s=dX(e.cx,e.cy,i[0],i[1],(-n-u/2)*l,(u/2-n)*l);else{var h=fX(n,r,u),c=h[0],d=h[1];s=dX(e.cx,e.cy,c,d,0,2*Math.PI)}return{type:"Sector",shape:s}}},GX=VX,HX="polar",UX=HX,WX=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.findAxisModel=function(t){var e;return this.ecModel.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},n.type=HX,n.dependencies=["radiusAxis","angleAxis"],n.defaultOption={z:0,center:["50%","50%"],radius:"80%"},n}(tm),XX=WX,jX=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",ns).models[0]},n.type="polarAxis",n}(tm);k(jX,IT);var ZX=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="angleAxis",n}(jX),YX=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="radiusAxis",n}(jX),qX=function(t){function n(e,n){return t.call(this,"radius",e,n)||this}return e(n,t),n.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},n}(rC);qX.prototype.dataToRadius=rC.prototype.dataToCoord,qX.prototype.radiusToData=rC.prototype.coordToData;var KX=qX,JX=Qa(),QX=function(t){function n(e,n){return t.call(this,"angle",e,n||[0,360])||this}return e(n,t),n.prototype.pointToData=function(t,e){return this.polar.pointToData(t,e)["radius"===this.dim?0:1]},n.prototype.calculateCategoryInterval=function(){var t=this,e=t.getLabelModel(),n=t.scale,r=n.getExtent(),i=n.count();if(r[1]-r[0]<1)return 0;var o=r[0],a=t.dataToCoord(o+1)-t.dataToCoord(o),s=Math.abs(a),l=ao(null==o?"":o+"",e.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var h=Math.max(0,Math.floor(u)),c=JX(t.model),d=c.lastAutoInterval,p=c.lastTickCount;return null!=d&&null!=p&&Math.abs(d-h)<=1&&Math.abs(p-i)<=1&&d>h?h=d:(c.lastTickCount=i,c.lastAutoInterval=h),h},n}(rC);QX.prototype.dataToAngle=rC.prototype.dataToCoord,QX.prototype.angleToData=rC.prototype.coordToData;var $X=QX,tj=["radius","angle"],ej=function(){function t(t){this.dimensions=tj,this.type=HX,this.cx=0,this.cy=0,this._radiusAxis=new KX,this._angleAxis=new $X,this.axisPointerEnabled=!0,this.name=t||"",this._radiusAxis.polar=this._angleAxis.polar=this}return t.prototype.containPoint=function(t){var e=this.pointToCoord(t);return this._radiusAxis.contain(e[0])&&this._angleAxis.contain(e[1])},t.prototype.containData=function(t){return this._radiusAxis.containData(t[0])&&this._angleAxis.containData(t[1])},t.prototype.getAxis=function(t){return this["_"+t+"Axis"]},t.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},t.prototype.getAxesByScale=function(t){var e=[],n=this._angleAxis,r=this._radiusAxis;return n.scale.type===t&&e.push(n),r.scale.type===t&&e.push(r),e},t.prototype.getAngleAxis=function(){return this._angleAxis},t.prototype.getRadiusAxis=function(){return this._radiusAxis},t.prototype.getOtherAxis=function(t){var e=this._angleAxis;return t===e?this._radiusAxis:e},t.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},t.prototype.getTooltipAxes=function(t){var e=null!=t&&"auto"!==t?this.getAxis(t):this.getBaseAxis();return{baseAxes:[e],otherAxes:[this.getOtherAxis(e)]}},t.prototype.dataToPoint=function(t,e,n){return this.coordToPoint([this._radiusAxis.dataToRadius(t[0],e),this._angleAxis.dataToAngle(t[1],e)],n)},t.prototype.pointToData=function(t,e,n){n=n||[];var r=this.pointToCoord(t);return n[0]=this._radiusAxis.radiusToData(r[0],e),n[1]=this._angleAxis.angleToData(r[1],e),n},t.prototype.pointToCoord=function(t){var e=t[0]-this.cx,n=t[1]-this.cy,r=this.getAngleAxis(),i=r.getExtent(),o=Math.min(i[0],i[1]),a=Math.max(i[0],i[1]);r.inverse?o=a-360:a=o+360;var s=Math.sqrt(e*e+n*n);e/=s,n/=s;for(var l=Math.atan2(-n,e)/Math.PI*180,u=l<o?1:-1;l<o||l>a;)l+=360*u;return[s,l]},t.prototype.coordToPoint=function(t,e){e=e||[];var n=t[0],r=t[1]/180*Math.PI;return e[0]=Math.cos(r)*n+this.cx,e[1]=-Math.sin(r)*n+this.cy,e},t.prototype.getArea=function(){var t=this.getAngleAxis(),e=this.getRadiusAxis().getExtent().slice();e[0]>e[1]&&e.reverse();var n=t.getExtent(),r=Math.PI/180,i=1e-4;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-n[0]*r,endAngle:-n[1]*r,clockwise:t.inverse,contain:function(t,e){var n=t-this.cx,r=e-this.cy,o=n*n+r*r,a=this.r,s=this.r0;return a!==s&&o-i<=a*a&&o+i>=s*s},x:this.cx-e[1],y:this.cy-e[1],width:2*e[1],height:2*e[1]}},t.prototype.convertToPixel=function(t,e,n){return nj(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return nj(e)===this?this.pointToData(n):null},t}();function nj(t){var e=t.seriesModel,n=t.polarModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}var rj=ej;function ij(t,e){var n=this.getAngleAxis(),r=this.getRadiusAxis();if($T(n,1),$T(r,1),aM(n),aM(r),"category"===n.type&&!n.onBand){var i=n.getExtent(),o=360/n.scale.count();n.inverse?i[1]+=o:i[1]-=o,n.setExtent(i[0],i[1])}}function oj(t,e){var n;if(t.type=dT(e),t.scale=pT(e,t.type,!1),t.onBand=MT(t.scale,e),t.inverse=e.get("inverse"),function(t){return"angleAxis"===t.mainType}(e)){t.inverse=t.inverse!==e.get("clockwise");var r=e.get("startAngle"),i=null!==(n=e.get("endAngle"))&&void 0!==n?n:r+(t.inverse?-360:360);t.setExtent(r,i)}e.axis=t,t.model=e}var aj={dimensions:tj,create:function(t,e){var n=[];return t.eachComponent(UX,function(t,r){var i=new rj(r+"");i.update=ij;var o=i.getRadiusAxis(),a=i.getAngleAxis(),s=t.findAxisModel("radiusAxis"),l=t.findAxisModel("angleAxis");oj(o,s),oj(a,l),function(t,e,n){var r=e.get("center"),i=jg(e,n).refContainer;t.cx=Qo(r[0],i.width)+i.x,t.cy=Qo(r[1],i.height)+i.y;var o=t.getRadiusAxis(),a=Math.min(i.width,i.height)/2,s=e.get("radius");null==s?s=[0,"100%"]:j(s)||(s=[0,s]);var l=[Qo(s[0],a),Qo(s[1],a)];o.inverse?o.setExtent(l[1],l[0]):o.setExtent(l[0],l[1])}(i,t,e),n.push(i),t.coordinateSystem=i,i.model=t}),t.eachSeries(function(t){if(t.get("coordinateSystem")===HX){var e=t.getReferringComponents(UX,ns).models[0];if(!e)throw new Error('Polar "'+ot(t.get("polarIndex"),t.get("polarId"),0)+'" not found');var n=t.coordinateSystem=e.coordinateSystem;n&&(UT(n.getRadiusAxis(),t,HX),UT(n.getAngleAxis(),t,HX))}}),n}},sj=aj,lj=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function uj(t,e,n){e[1]>e[0]&&(e=e.slice().reverse());var r=t.coordToPoint([e[0],n]),i=t.coordToPoint([e[1],n]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function hj(t){return t.getRadiusAxis().inverse?0:1}function cj(t){var e=t[0],n=t[t.length-1];e&&n&&Math.abs(Math.abs(e.coord-n.coord)-360)<1e-4&&t.pop()}var dj=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.axisPointerClass="PolarAxisPointer",e}return e(n,t),n.prototype.render=function(t,e){if(this.group.removeAll(),t.get("show")){var n=t.axis,r=n.polar,i=r.getRadiusAxis().getExtent(),o=n.getTicksCoords({breakTicks:"none"}),a=n.getMinorTicksCoords(),s=[];B(n.getViewLabels(),function(t){if(!t.tick.offInterval){t=I(t);var e=n.scale;t.coord=n.dataToCoord(TT(e,t.tick)),s.push(t)}}),cj(s),cj(o),B(lj,function(e){!t.get([e,"show"])||n.scale.isBlank()&&"axisLine"!==e||pj[e](this.group,t,r,o,a,i,s)},this)}},n.type="angleAxis",n}(EE),pj={axisLine:function(t,e,n,r,i,o){var a,s=e.getModel(["axisLine","lineStyle"]),l=n.getAngleAxis(),u=Math.PI/180,h=l.getExtent(),c=hj(n),d=c?0:1,p=360===Math.abs(h[1]-h[0])?"Circle":"Arc";(a=0===o[d]?new Hp[p]({shape:{cx:n.cx,cy:n.cy,r:o[c],startAngle:-h[0]*u,endAngle:-h[1]*u,clockwise:l.inverse},style:s.getLineStyle(),z2:1,silent:!0}):new rd({shape:{cx:n.cx,cy:n.cy,r:o[c],r0:o[d]},style:s.getLineStyle(),z2:1,silent:!0})).style.fill=null,t.add(a)},axisTick:function(t,e,n,r,i,o){var a=e.getModel("axisTick"),s=(a.get("inside")?-1:1)*a.get("length"),l=o[hj(n)],u=V(r,function(t){return new fd({shape:uj(n,[l,l+s],t.coord)})});t.add(up(u,{style:E(a.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(t,e,n,r,i,o){if(i.length){for(var a=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(a.get("inside")?-1:1)*s.get("length"),u=o[hj(n)],h=[],c=0;c<i.length;c++)for(var d=0;d<i[c].length;d++)h.push(new fd({shape:uj(n,[u,u+l],i[c][d].coord)}));t.add(up(h,{style:E(s.getModel("lineStyle").getLineStyle(),E(a.getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])}))}))}},axisLabel:function(t,e,n,r,i,o,a){var s=e.getCategories(!0),l=e.getModel("axisLabel"),u=l.get("margin"),h=e.get("triggerEvent");B(a,function(r,i){var a=l,c=r.tick.value,d=o[hj(n)],p=n.coordToPoint([d+u,r.coord]),f=n.cx,g=n.cy,m=Math.abs(p[0]-f)/d<.3?"center":p[0]>f?"left":"right",v=Math.abs(p[1]-g)/d<.3?"middle":p[1]>g?"top":"bottom";if(s&&s[c]){var y=s[c];J(y)&&y.textStyle&&(a=new xf(y.textStyle,l,l.ecModel))}var _=new Qu({silent:bL.isLabelSilent(e),style:Yp(a,{x:p[0],y:p[1],fill:a.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:r.formattedLabel,align:m,verticalAlign:v})});if(t.add(_),Ip({el:_,componentModel:e,itemName:r.formattedLabel,formatterParamsExtra:{isTruncated:function(){return _.isTruncated},value:r.rawLabel,tickIndex:i}}),h){var x=bL.makeAxisEventDataBase(e);x.targetType="axisLabel",x.value=r.rawLabel,$u(_).eventData=x}},this)},splitLine:function(t,e,n,r,i,o){var a=e.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],h=0;h<r.length;h++){var c=l++%s.length;u[c]=u[c]||[],u[c].push(new fd({shape:uj(n,o,r[h].coord)}))}for(h=0;h<u.length;h++)t.add(up(u[h],{style:E({stroke:s[h%s.length]},a.getLineStyle()),silent:!0,z:e.get("z")}))},minorSplitLine:function(t,e,n,r,i,o){if(i.length){for(var a=e.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<i.length;l++)for(var u=0;u<i[l].length;u++)s.push(new fd({shape:uj(n,o,i[l][u].coord)}));t.add(up(s,{style:a.getLineStyle(),silent:!0,z:e.get("z")}))}},splitArea:function(t,e,n,r,i,o){if(r.length){var a=e.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],h=Math.PI/180,c=-r[0].coord*h,d=Math.min(o[0],o[1]),p=Math.max(o[0],o[1]),f=e.get("clockwise"),g=1,m=r.length;g<=m;g++){var v=g===m?r[0].coord:r[g].coord,y=l++%s.length;u[y]=u[y]||[],u[y].push(new td({shape:{cx:n.cx,cy:n.cy,r0:d,r:p,startAngle:c,endAngle:-v*h,clockwise:f},silent:!0})),c=-v*h}for(g=0;g<u.length;g++)t.add(up(u[g],{style:E({fill:s[g%s.length]},a.getAreaStyle()),silent:!0}))}}},fj=dj,gj=["splitLine","splitArea","minorSplitLine"],mj=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.axisPointerClass="PolarAxisPointer",e}return e(n,t),n.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var r=this._axisGroup,i=this._axisGroup=new Do;this.group.add(i);var o=t.axis,a=o.polar,s=a.getAngleAxis(),l=o.getTicksCoords(),u=o.getMinorTicksCoords(),h=s.getExtent()[0],c=o.getExtent(),d=function(t,e,n){return{position:[t.cx,t.cy],rotation:n/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:e.getModel("axisLabel").get("rotate"),z2:1}}(a,t,h),p=new bL(t,n,d);p.build(),i.add(p.group),vp(r,i,t),B(gj,function(e){t.get([e,"show"])&&!o.scale.isBlank()&&vj[e](this.group,t,a,h,c,l,u)},this)}},n.type="radiusAxis",n}(EE),vj={splitLine:function(t,e,n,r,i,o){var a=e.getModel("splitLine").getModel("lineStyle"),s=a.get("color"),l=0,u=n.getAngleAxis(),h=Math.PI/180,c=u.getExtent(),d=360===Math.abs(c[1]-c[0])?"Circle":"Arc";s=s instanceof Array?s:[s];for(var p=[],f=0;f<o.length;f++){var g=l++%s.length;p[g]=p[g]||[],p[g].push(new Hp[d]({shape:{cx:n.cx,cy:n.cy,r:Math.max(o[f].coord,0),startAngle:-c[0]*h,endAngle:-c[1]*h,clockwise:u.inverse}}))}for(f=0;f<p.length;f++)t.add(up(p[f],{style:E({stroke:s[f%s.length],fill:null},a.getLineStyle()),silent:!0}))},minorSplitLine:function(t,e,n,r,i,o,a){if(a.length){for(var s=e.getModel("minorSplitLine").getModel("lineStyle"),l=[],u=0;u<a.length;u++)for(var h=0;h<a[u].length;h++)l.push(new Rc({shape:{cx:n.cx,cy:n.cy,r:a[u][h].coord}}));t.add(up(l,{style:E({fill:null},s.getLineStyle()),silent:!0}))}},splitArea:function(t,e,n,r,i,o){if(o.length){var a=e.getModel("splitArea").getModel("areaStyle"),s=a.get("color"),l=0;s=s instanceof Array?s:[s];for(var u=[],h=o[0].coord,c=1;c<o.length;c++){var d=l++%s.length;u[d]=u[d]||[],u[d].push(new td({shape:{cx:n.cx,cy:n.cy,r0:h,r:o[c].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),h=o[c].coord}for(c=0;c<u.length;c++)t.add(up(u[c],{style:E({fill:s[c%s.length]},a.getAreaStyle()),silent:!0}))}}};var yj=mj,_j=ys();function xj(t){return t.get("stack")||"__ec_stack_"+t.seriesIndex}var bj=Cs(LL,function(t){var e=AL(LL,HX);BT(t,e,function(t){ht(t instanceof $X||t instanceof KX);var n=function(t,e){var n=AL(e,HX),r=$M(t,{fromStat:{key:n},min:1}).w,i=r,o=0,a="20%",s="30%",l={};kT(t,n,function(t){var e=xj(t);l[e]||o++,l[e]=l[e]||{width:0,maxWidth:0};var n=Qo(t.get("barWidth"),r),u=Qo(t.get("barMaxWidth"),r),h=t.get("barGap"),c=t.get("barCategoryGap");n&&!l[e].width&&(n=Fo(i,n),l[e].width=n,i-=n),u&&(l[e].maxWidth=u),null!=h&&(s=h),null!=c&&(a=c)});var u={},h=Qo(a,r),c=Qo(s,1),d=(i-h)/(o+(o-1)*c);d=Go(d,0),B(l,function(t,e){var n=t.maxWidth;n&&n<d&&(n=Fo(n,i),t.width&&(n=Fo(n,t.width)),i-=n,t.width=n,o--)}),d=Go(d=(i-h)/(o+(o-1)*c),0);var p,f=0;B(l,function(t,e){t.width||(t.width=d),p=t,f+=t.width*(1+c)}),p&&(f-=p.width*c);var g=-f/2;return B(l,function(t,e){u[e]=u[e]||{offset:g,width:t.width},g+=t.width*(1+c)}),u}(t,LL),r={};kT(t,e,function(e){!function(t,e,n,r){var i=e.getData(),o=xj(e),a=n[o],s=a.offset,l=a.width,u=e.coordinateSystem;ht(u.type===HX);var h=u.getOtherAxis(t),c=u.cx,d=u.cy,p=e.get("barMinHeight")||0,f=e.get("barMinAngle")||0;r[o]=r[o]||[];for(var g=i.mapDimension(h.dim),m=i.mapDimension(t.dim),v=pS(i,g),y="radius"!==t.dim||!e.get("roundCap",!0),_=h.dataToCoord(OL(h)),x=0,b=i.count();x<b;x++){var w=i.get(g,x),S=i.get(m,x),T=w>=0?"p":"n",M=_;v&&(r[o][S]||(r[o][S]={p:_,n:_}),M=r[o][S][T]);var C=void 0,I=void 0,A=void 0,D=void 0;if("radius"===h.dim){var L=h.dataToCoord(w)-_,P=t.dataToCoord(S);Ho(L)<p&&(L=(L<0?-1:1)*p),C=M,I=M+L,D=(A=P-s)-l,v&&(r[o][S][T]=I)}else{var E=h.dataToCoord(w,y)-_,O=t.dataToCoord(S);Ho(E)<f&&(E=(E<0?-1:1)*f),I=(C=O+s)+l,A=M,D=M+E,v&&(r[o][S][T]=D)}i.setItemLayout(x,{cx:c,cy:d,r0:C,r:I,startAngle:-A*qo/180,endAngle:-D*qo/180,clockwise:A>=D})}}(t,e,n,r)})})});var wj={startAngle:90,clockwise:!0,splitNumber:12,containShape:!1,axisLabel:{rotate:0}},Sj={splitNumber:5},Tj=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="polar",n}(Qy);function Mj(t,e){e=e||{};var n=t.coordinateSystem,r=t.axis,i={},o=r.position,a=r.orient,s=n.getRect(),l=[s.x,s.x+s.width,s.y,s.y+s.height],u={horizontal:{top:l[2],bottom:l[3]},vertical:{left:l[0],right:l[1]}};i.position=["vertical"===a?u.vertical[o]:l[0],"horizontal"===a?u.horizontal[o]:l[3]];i.rotation=Math.PI/2*{horizontal:0,vertical:1}[a];i.labelDirection=i.tickDirection=i.nameDirection={top:-1,bottom:1,right:1,left:-1}[o],t.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),ot(e.labelInside,t.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var h=t.get(["axisLabel","rotate"]);return i.labelRotate="top"===o?-h:h,i.z2=1,i}var Cj=["splitArea","splitLine","breakArea"],Ij=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.axisPointerClass="SingleAxisPointer",e}return e(n,t),n.prototype.render=function(e,n,r,i){var o=this.group;o.removeAll();var a=this._axisGroup;this._axisGroup=new Do;var s=Mj(e),l=new bL(e,r,s);l.build(),o.add(this._axisGroup),o.add(l.group),B(Cj,function(t){e.get([t,"show"])&&Aj[t](this,this.group,this._axisGroup,e,r)},this),vp(a,this._axisGroup,e),t.prototype.render.call(this,e,n,r,i)},n.prototype.remove=function(){RE(this)},n.type="singleAxis",n}(EE),Aj={splitLine:function(t,e,n,r,i){var o=r.axis;if(!o.scale.isBlank()){var a=r.getModel("splitLine"),s=a.getModel("lineStyle"),l=s.get("color");l=l instanceof Array?l:[l];for(var u=s.get("width"),h=r.coordinateSystem.getRect(),c=o.isHorizontal(),d=[],p=0,f=o.getTicksCoords({tickModel:a,breakTicks:"none",pruneByBreak:"preserve_extent_bound"}),g=[],m=[],v=0;v<f.length;++v){var y=o.toGlobalCoord(f[v].coord);c?(g[0]=y,g[1]=h.y,m[0]=y,m[1]=h.y+h.height):(g[0]=h.x,g[1]=y,m[0]=h.x+h.width,m[1]=y);var _=new fd({shape:{x1:g[0],y1:g[1],x2:m[0],y2:m[1]},silent:!0});cp(_.shape,u);var x=p++%l.length;d[x]=d[x]||[],d[x].push(_)}var b=s.getLineStyle(["color"]);for(v=0;v<d.length;++v)e.add(up(d[v],{style:E({stroke:l[v%l.length]},b),silent:!0}))}},splitArea:function(t,e,n,r,i){NE(t,n,r,r)},breakArea:function(t,e,n,r,i){var o=UD(),a=r.axis.scale;o&&"ordinal"!==a.type&&o.rectCoordBuildBreakAxis(e,t,r,r.coordinateSystem.getRect(),i)}},Dj=Ij,Lj=function(t){function n(e,n,r,i,o){var a=t.call(this,e,n,r)||this;return a.type=i||"value",a.position=o||"bottom",a}return e(n,t),n.prototype.isHorizontal=function(){var t=this.position;return"top"===t||"bottom"===t},n.prototype.pointToData=function(t,e){return this.coordinateSystem.pointToData(t)[0]},n}(rC),Pj=Lj,Ej=["single"],Oj=function(){function t(t,e,n){this.type=WE,this.dimension="single",this.dimensions=Ej,this.axisPointerEnabled=!0,this.model=t,this._init(t,e,n)}return t.prototype._init=function(t,e,n){var r=this.dimension,i=dT(t),o=new Pj(r,pT(t,i,!0),[0,0],i,t.get("position"));o.onBand=MT(o.scale,t),o.inverse=t.get("inverse"),o.orient=t.get("orient"),t.axis=o,o.model=t,o.coordinateSystem=this,this._axis=o},t.prototype.update=function(t,e){var n=this._axis;$T(n,1),aM(n)},t.prototype.resize=function(t,e){var n=jg(t,e).refContainer;this._rect=Ug(t.getBoxLayoutParams(),n),this._adjustAxis()},t.prototype.getRect=function(){return this._rect},t.prototype._adjustAxis=function(){var t=this._rect,e=this._axis,n=e.isHorizontal(),r=n?[0,t.width]:[0,t.height],i=e.inverse?1:0;e.setExtent(r[i],r[1-i]),this._updateAxisTransform(e,n?t.x:t.y)},t.prototype._updateAxisTransform=function(t,e){var n=t.getExtent(),r=n[0]+n[1],i=t.isHorizontal();t.toGlobalCoord=i?function(t){return t+e}:function(t){return r-t+e},t.toLocalCoord=i?function(t){return t-e}:function(t){return r-t+e}},t.prototype.getAxis=function(){return this._axis},t.prototype.getBaseAxis=function(){return this._axis},t.prototype.getAxes=function(){return[this._axis]},t.prototype.getTooltipAxes=function(){return{baseAxes:[this.getAxis()],otherAxes:[]}},t.prototype.containPoint=function(t){var e=this.getRect(),n=this.getAxis();return"horizontal"===n.orient?n.contain(n.toLocalCoord(t[0]))&&t[1]>=e.y&&t[1]<=e.y+e.height:n.contain(n.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},t.prototype.pointToData=function(t,e,n){n=n||[];var r=this.getAxis();return n[0]=r.coordToData(r.toLocalCoord(t["horizontal"===r.orient?0:1])),n},t.prototype.dataToPoint=function(t,e,n){var r=this.getAxis(),i=this.getRect();n=n||[];var o="horizontal"===r.orient?0:1;return t instanceof Array&&(t=t[0]),n[o]=r.toGlobalCoord(r.dataToCoord(+t)),n[1-o]=0===o?i.y+i.height/2:i.x+i.width/2,n},t.prototype.convertToPixel=function(t,e,n){return Nj(e)===this?this.dataToPoint(n):null},t.prototype.convertFromPixel=function(t,e,n){return Nj(e)===this?this.pointToData(n):null},t}();function Nj(t){var e=t.seriesModel,n=t.singleAxisModel;return n&&n.coordinateSystem||e&&e.coordinateSystem}var Rj={create:function(t,e){var n=[];return t.eachComponent(XE,function(r,i){var o=new Oj(r,t,e);o.name="single_"+i,o.resize(r,e),r.coordinateSystem=o,n.push(o)}),t.eachSeries(function(t){if("singleAxis"===t.get("coordinateSystem")){var e=t.getReferringComponents(XE,ns).models[0],n=t.coordinateSystem=e&&e.coordinateSystem;n&&UT(n.getAxis(),t,WE)}}),n},dimensions:Ej},kj=["x","y"],zj=["width","height"],Bj=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.makeElOption=function(t,e,n,r,i){var o=n.axis,a=o.coordinateSystem,s=Fj(o),l=Gj(a,s),u=Gj(a,1-s),h=a.dataToPoint(e)[0],c=r.get("type");if(c&&"none"!==c){var d=oX(r),p=Vj[c](o,h,l,u,r.get("seriesDataIndices"),r.ecModel);p.style=d,t.graphicKey=p.type,t.pointer=p}uX(e,t,Mj(n),n,r,i)},n.prototype.getHandleTransform=function(t,e,n){var r=Mj(e,{labelInside:!1});r.labelMargin=n.get(["handle","margin"]);var i=lX(e.axis,t,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},n.prototype.updateHandleTransform=function(t,e,n,r){var i=n.axis,o=i.coordinateSystem,a=Fj(i),s=Gj(o,a),l=[t.x,t.y];l[a]+=e[a],l[a]=Math.min(s[1],l[a]),l[a]=Math.max(s[0],l[a]);var u=Gj(o,1-a),h=(u[1]+u[0])/2,c=[h,h];return c[a]=l[a],{x:l[0],y:l[1],rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}},n}(iX),Vj={line:function(t,e,n,r){return{type:"Line",subPixelOptimize:!0,shape:hX([e,r[0]],[e,r[1]],Fj(t))}},shadow:function(t,e,n,r,i,o){var a=pX(t,i,o),s=r[1]-r[0],l=fX(e,n,a),u=l[0],h=l[1];return{type:"Rect",shape:cX([u,r[0]],[h-u,s],Fj(t))}}};function Fj(t){return t.isHorizontal()?0:1}function Gj(t,e){var n=t.getRect();return[n[kj[e]],n[kj[e]]+n[zj[e]]]}var Hj=Bj,Uj=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="single",n}(Qy);var Wj=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(e,n,r){var i=Kg(e);t.prototype.init.apply(this,arguments),Xj(e,i)},n.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),Xj(this.option,e)},n.prototype.getCellSize=function(){return this.option.cellSize},n.type="calendar",n.layoutMode="box",n.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:om.color.axisLine,width:1,type:"solid"}},itemStyle:{color:om.color.neutral00,borderWidth:1,borderColor:om.color.neutral10},dayLabel:{show:!0,firstDay:0,position:"start",margin:om.size.s,color:om.color.secondary},monthLabel:{show:!0,position:"start",margin:om.size.s,align:"center",formatter:null,color:om.color.secondary},yearLabel:{show:!0,position:null,margin:om.size.xl,formatter:null,color:om.color.quaternary,fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},n}(tm);function Xj(t,e){var n,r=t.cellSize;1===(n=j(r)?r:t.cellSize=[r,r]).length&&(n[1]=n[0]);var i=V([0,1],function(t){return function(t,e){return null!=t[Bg[e][0]]||null!=t[Bg[e][1]]&&null!=t[Bg[e][2]]}(e,t)&&(n[t]="auto"),null!=n[t]&&"auto"!==n[t]});qg(t,e,{type:"box",ignoreSize:i})}var jj=Wj,Zj=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){var r=this.group;r.removeAll();var i=t.coordinateSystem,o=i.getRangeInfo(),a=i.getOrient(),s=e.getLocaleModel();this._renderDayRect(t,o,r),this._renderLines(t,o,a,r),this._renderYearText(t,o,a,r),this._renderMonthText(t,s,a,r),this._renderWeekText(t,s,o,a,r)},n.prototype._renderDayRect=function(t,e,n){for(var r=t.coordinateSystem,i=t.getModel("itemStyle").getItemStyle(),o=r.getCellWidth(),a=r.getCellHeight(),s=e.start.time;s<=e.end.time;s=r.getNextNDay(s,1).time){var l=r.dataToCalendarLayout([s],!1).tl,u=new Ru({shape:{x:l[0],y:l[1],width:o,height:a},cursor:"default",style:i});n.add(u)}},n.prototype._renderLines=function(t,e,n,r){var i=this,o=t.coordinateSystem,a=t.getModel(["splitLine","lineStyle"]).getLineStyle(),s=t.get(["splitLine","show"]),l=a.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=e.start,h=0;u.time<=e.end.time;h++){d(u.formatedDate),0===h&&(u=o.getDateInfo(e.start.y+"-"+e.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=o.getDateInfo(c)}function d(e){i._firstDayOfMonth.push(o.getDateInfo(e)),i._firstDayPoints.push(o.dataToCalendarLayout([e],!1).tl);var l=i._getLinePointsOfOneWeek(t,e,n);i._tlpoints.push(l[0]),i._blpoints.push(l[l.length-1]),s&&i._drawSplitline(l,a,r)}d(o.getNextNDay(e.end.time,1).formatedDate),s&&this._drawSplitline(i._getEdgesPoints(i._tlpoints,l,n),a,r),s&&this._drawSplitline(i._getEdgesPoints(i._blpoints,l,n),a,r)},n.prototype._getEdgesPoints=function(t,e,n){var r=[t[0].slice(),t[t.length-1].slice()],i="horizontal"===n?0:1;return r[0][i]=r[0][i]-e/2,r[1][i]=r[1][i]+e/2,r},n.prototype._drawSplitline=function(t,e,n){var r=new hd({z2:20,shape:{points:t},style:e});n.add(r)},n.prototype._getLinePointsOfOneWeek=function(t,e,n){for(var r=t.coordinateSystem,i=r.getDateInfo(e),o=[],a=0;a<7;a++){var s=r.getNextNDay(i.time,a),l=r.dataToCalendarLayout([s.time],!1);o[2*s.day]=l.tl,o[2*s.day+1]=l["horizontal"===n?"bl":"tr"]}return o},n.prototype._formatterLabel=function(t,e){return Y(t)&&t?wg(t,e):Z(t)?t(e):e.nameMap},n.prototype._yearTextPositionControl=function(t,e,n,r,i){var o=e[0],a=e[1],s=["center","bottom"];"bottom"===r?(a+=i,s=["center","top"]):"left"===r?o-=i:"right"===r?(o+=i,s=["center","top"]):a-=i;var l=0;return"left"!==r&&"right"!==r||(l=Math.PI/2),{rotation:l,x:o,y:a,style:{align:s[0],verticalAlign:s[1]}}},n.prototype._renderYearText=function(t,e,n,r){var i=t.getModel("yearLabel");if(i.get("show")){var o=i.get("margin"),a=i.get("position");a||(a="horizontal"!==n?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===n?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var p=i.get("formatter"),f={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(p,f),m=new Qu({z2:30,style:Yp(i,{text:g}),silent:i.get("silent")});m.attr(this._yearTextPositionControl(m,c[a],n,a,o)),r.add(m)}},n.prototype._monthTextPositionControl=function(t,e,n,r,i){var o="left",a="top",s=t[0],l=t[1];return"horizontal"===n?(l+=i,e&&(o="center"),"start"===r&&(a="bottom")):(s+=i,e&&(a="middle"),"start"===r&&(o="right")),{x:s,y:l,align:o,verticalAlign:a}},n.prototype._renderMonthText=function(t,e,n,r){var i=t.getModel("monthLabel");if(i.get("show")){var o=i.get("nameMap"),a=i.get("margin"),s=i.get("position"),l=i.get("align"),u=[this._tlpoints,this._blpoints];o&&!Y(o)||(o&&(e=Pf(o)||e),o=e.get(["time","monthAbbr"])||[]);var h="start"===s?0:1,c="horizontal"===n?0:1;a="start"===s?-a:a;for(var d="center"===l,p=i.get("silent"),f=0;f<u[h].length-1;f++){var g=u[h][f].slice(),m=this._firstDayOfMonth[f];if(d){var v=this._firstDayPoints[f];g[c]=(v[c]+u[0][f+1][c])/2}var y=i.get("formatter"),_=o[+m.m-1],x={yyyy:m.y,yy:(m.y+"").slice(2),MM:m.m,M:+m.m,nameMap:_},b=this._formatterLabel(y,x),w=new Qu({z2:30,style:L(Yp(i,{text:b}),this._monthTextPositionControl(g,d,n,s,a)),silent:p});r.add(w)}}},n.prototype._weekTextPositionControl=function(t,e,n,r,i){var o="center",a="middle",s=t[0],l=t[1],u="start"===n;return"horizontal"===e?(s=s+r+(u?1:-1)*i[0]/2,o=u?"right":"left"):(l=l+r+(u?1:-1)*i[1]/2,a=u?"bottom":"top"),{x:s,y:l,align:o,verticalAlign:a}},n.prototype._renderWeekText=function(t,e,n,r,i){var o=t.getModel("dayLabel");if(o.get("show")){var a=t.coordinateSystem,s=o.get("position"),l=o.get("nameMap"),u=o.get("margin"),h=a.getFirstDayOfWeek();if(!l||Y(l))l&&(e=Pf(l)||e),l=e.get(["time","dayOfWeekShort"])||V(e.get(["time","dayOfWeekAbbr"]),function(t){return t[0]});var c=a.getNextNDay(n.end.time,7-n.lweek).time,d=[a.getCellWidth(),a.getCellHeight()];u=Qo(u,Math.min(d[1],d[0])),"start"===s&&(c=a.getNextNDay(n.start.time,-(7+n.fweek)).time,u=-u);for(var p=o.get("silent"),f=0;f<7;f++){var g,m=a.getNextNDay(c,f),v=a.dataToCalendarLayout([m.time],!1).center;g=Math.abs((f+h)%7);var y=new Qu({z2:30,style:L(Yp(o,{text:l[g]}),this._weekTextPositionControl(v,r,s,u,d)),silent:p});i.add(y)}}},n.type="calendar",n}(Qy),Yj=Zj,qj=864e5,Kj=function(){function t(e,n,r){this.type="calendar",this.dimensions=t.dimensions,this.getDimensionsInfo=t.getDimensionsInfo,this._model=e,this._update(n,r)}return t.getDimensionsInfo=function(){return[{name:"time",type:"time"},"value"]},t.prototype.getRangeInfo=function(){return this._rangeInfo},t.prototype.getModel=function(){return this._model},t.prototype.getRect=function(){return this._rect},t.prototype.getCellWidth=function(){return this._sw},t.prototype.getCellHeight=function(){return this._sh},t.prototype.getOrient=function(){return this._orient},t.prototype.getFirstDayOfWeek=function(){return this._firstDayOfWeek},t.prototype.getDateInfo=function(t){var e=(t=pa(t)).getFullYear(),n=t.getMonth()+1,r=n<10?"0"+n:""+n,i=t.getDate(),o=i<10?"0"+i:""+i,a=t.getDay();return{y:e+"",m:r,d:o,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:t.getTime(),formatedDate:e+"-"+r+"-"+o,date:t}},t.prototype.getNextNDay=function(t,e){return 0===(e=e||0)||(t=new Date(this.getDateInfo(t).time)).setDate(t.getDate()+e),this.getDateInfo(t)},t.prototype._update=function(t,e){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var n=this._rangeInfo.weeks||1,r=["width","height"],i=this._model.getCellSize().slice(),o=this._model.getBoxLayoutParams(),a="horizontal"===this._orient?[n,7]:[7,n];B([0,1],function(t){u(i,t)&&(o[r[t]]=i[t]*a[t])});var s={width:e.getWidth(),height:e.getHeight()},l=this._rect=Ug(o,s);function u(t,e){return null!=t[e]&&"auto"!==t[e]}B([0,1],function(t){u(i,t)||(i[t]=l[r[t]]/a[t])}),this._sw=i[0],this._sh=i[1]},t.prototype.dataToPoint=function(t,e,n){n=n||[],j(t)&&(t=t[0]),null==e&&(e=!0);var r=this.getDateInfo(t),i=this._rangeInfo,o=r.formatedDate;if(e&&!(r.time>=i.start.time&&r.time<i.end.time+qj))return n[0]=n[1]=NaN,n;var a=r.day,s=this._getRangeInfo([i.start.time,o]).nthWeek;return"vertical"===this._orient?(n[0]=this._rect.x+a*this._sw+this._sw/2,n[1]=this._rect.y+s*this._sh+this._sh/2):(n[0]=this._rect.x+s*this._sw+this._sw/2,n[1]=this._rect.y+a*this._sh+this._sh/2),n},t.prototype.pointToData=function(t){var e=this.pointToDate(t);return e&&e.time},t.prototype.dataToLayout=function(t,e,n){var r=(n=n||{}).rect=n.rect||{},i=n.contentRect=n.contentRect||{},o=this.dataToPoint(t,e);return r.x=o[0]-this._sw/2,r.y=o[1]-this._sh/2,r.width=this._sw,r.height=this._sh,ln.copy(i,r),Tp(i,this._lineWidth/2,!0,!0),n},t.prototype.dataToCalendarLayout=function(t,e){var n=this.dataToPoint(t,e);return{center:n,tl:[n[0]-this._sw/2,n[1]-this._sh/2],tr:[n[0]+this._sw/2,n[1]-this._sh/2],br:[n[0]+this._sw/2,n[1]+this._sh/2],bl:[n[0]-this._sw/2,n[1]+this._sh/2]}},t.prototype.pointToDate=function(t){var e=Math.floor((t[0]-this._rect.x)/this._sw)+1,n=Math.floor((t[1]-this._rect.y)/this._sh)+1,r=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(n,e-1,r):this._getDateByWeeksAndDay(e,n-1,r)},t.prototype.convertToPixel=function(t,e,n){var r=Jj(e);return r===this?r.dataToPoint(n):null},t.prototype.convertToLayout=function(t,e,n){var r=Jj(e);return r===this?r.dataToLayout(n):null},t.prototype.convertFromPixel=function(t,e,n){var r=Jj(e);return r===this?r.pointToData(n):null},t.prototype.containPoint=function(t){return console.warn("Not implemented."),!1},t.prototype._initRangeOption=function(){var t,e=this._model.get("range");if(j(e)&&1===e.length&&(e=e[0]),j(e))t=e;else{var n=e.toString();if(/^\d{4}$/.test(n)&&(t=[n+"-01-01",n+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(n)){var r=this.getDateInfo(n),i=r.date;i.setMonth(i.getMonth()+1);var o=this.getNextNDay(i,-1);t=[r.formatedDate,o.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n)&&(t=[n,n])}if(!t)return C("Invalid date range."),e;var a=this._getRangeInfo(t);return a.start.time>a.end.time&&t.reverse(),t},t.prototype._getRangeInfo=function(t){var e,n=[this.getDateInfo(t[0]),this.getDateInfo(t[1])];n[0].time>n[1].time&&(e=!0,n.reverse());var r=Math.floor(n[1].time/qj)-Math.floor(n[0].time/qj)+1,i=new Date(n[0].time),o=i.getDate(),a=n[1].date.getDate();i.setDate(o+r-1);var s=i.getDate();if(s!==a)for(var l=i.getTime()-n[1].time>0?1:-1;(s=i.getDate())!==a&&(i.getTime()-n[1].time)*l>0;)r-=l,i.setDate(s-l);var u=Math.floor((r+n[0].day+6)/7),h=e?1-u:u-1;return e&&n.reverse(),{range:[n[0].formatedDate,n[1].formatedDate],start:n[0],end:n[1],allDay:r,weeks:u,nthWeek:h,fweek:n[0].day,lweek:n[1].day}},t.prototype._getDateByWeeksAndDay=function(t,e,n){var r=this._getRangeInfo(n);if(t>r.weeks||0===t&&e<r.fweek||t===r.weeks&&e>r.lweek)return null;var i=7*(t-1)-r.fweek+e,o=new Date(r.start.time);return o.setDate(+r.start.d+i),this.getDateInfo(o)},t.create=function(e,n){var r=[];return e.eachComponent("calendar",function(i){var o=new t(i,e,n);r.push(o),i.coordinateSystem=o}),e.eachComponent(function(t,e){Og({targetModel:e,coordSysType:"calendar",coordSysProvider:Ng})}),r},t.dimensions=["time","value"],t}();function Jj(t){var e=t.calendarModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem:null}var Qj=Kj;var $j=1,tZ=2,eZ=3,nZ={none:0,all:1,body:2,corner:3};function rZ(t,e,n){var r=e[$d[n]].getCell(t);return!r&&K(t)&&t<0&&(r=e[$d[1-n]].getUnitLayoutInfo(n,Math.round(t))),r}function iZ(t){var e=t||[];return e[0]=e[0]||[],e[1]=e[1]||[],e[0][0]=e[0][1]=e[1][0]=e[1][1]=NaN,e}function oZ(t,e,n,r,i){aZ(t[0],e,i,n,r,0),aZ(t[1],e,i,n,r,1)}function aZ(t,e,n,r,i,o){t[0]=1/0,t[1]=-1/0;var a=r[o],s=j(a)?a:[a],l=s.length,u=!!n;if(l>=1?(sZ(t,e,s,u,i,o,0),l>1&&sZ(t,e,s,u,i,o,l-1)):(e&&e.push('Should be like [["x1", "x2"], ["y1", "y2"]], or ["x1", "y1"], rather than empty.'),t[0]=t[1]=NaN),u){var h=-i[$d[1-o]].getLocatorCount(o),c=i[$d[o]].getLocatorCount(o)-1;n===nZ.body?h=Go(0,h):n===nZ.corner&&(c=Fo(-1,c)),c<h&&(h=c=NaN),it(t[0])&&(t[0]=h),it(t[1])&&(t[1]=c),t[0]=Go(Fo(t[0],c),h),t[1]=Go(Fo(t[1],c),h)}}function sZ(t,e,n,r,i,o,a){var s=rZ(n[a],i,o);if(!s)return!r&&e&&e.push("Can not find cell by coord["+o+"]["+a+"]."),void(t[0]=t[1]=NaN);var l,u=s.id[$d[o]],h=u,c=!(l=s)||l.type!==tZ&&l.type!==eZ?null:l;c&&(h+=c.span[$d[o]]-1),t[0]=Fo(t[0],u,h),t[1]=Go(t[1],u,h)}function lZ(t,e){return it(t[e][0])||it(t[e][1])}function uZ(t,e,n,r){e=e||hZ;for(var i=0;i<r;i++)e[i]=!1;for(;;){var o=!1;for(i=0;i<r;i++){var a=n[i];!e[i]&&a.cellMergeOwner&&cZ(t,a.locatorRange)&&(e[i]=!0,o=!0)}if(!o)break}}var hZ=[];function cZ(t,e){return!(!dZ(t[0],e[0])||!dZ(t[1],e[1]))&&(t[0][0]=Fo(t[0][0],e[0][0]),t[0][1]=Go(t[0][1],e[0][1]),t[1][0]=Fo(t[1][0],e[1][0]),t[1][1]=Go(t[1][1],e[1][1]),!0)}function dZ(t,e){return t[1]>=e[0]&&t[0]<=e[1]}function pZ(t,e){t.id.set(e[0][0],e[1][0]),t.span.set(e[0][1]-t.id.x+1,e[1][1]-t.id.y+1)}function fZ(t,e,n,r){var i=rZ(e[r][0],n,r),o=rZ(e[r][1],n,r);t[$d[r]]=t[tp[r]]=NaN,i&&o&&(t[$d[r]]=i.xy,t[tp[r]]=o.xy+o.wh-i.xy)}function gZ(t,e,n,r){return t[$d[e]]=n,t[$d[1-e]]=r,t}var mZ=function(){function t(t,e){this._cells=[],this._levels=[],this.dim=t,this.dimIdx="x"===t?0:1,this._model=e,this._uniqueValueGen=function(t){var e=t.toUpperCase(),n=new RegExp("^"+e+"([0-9]+)$"),r=0;function i(t){var e;null!=t&&(e=t.match(n))&&(r=Go(r,+e[1]+1))}function o(){return""+e+r++}function a(t,e){for(var n=yt(),r=0;r<t.length;r++){var i=t[r];null!=i&&null==n.get(i)||(t[r]=i=o(),e[r].option=E({value:i},e[r].option)),n.set(i,!0)}}return{calcDupBase:i,ensureValueUnique:a}}(t);var n=e.get("data",!0),r=e.get("length",!0);if(null==n||j(n)||(La("Illegal echarts option - matrix."+this.dim+".data must be an array if specified."),n=[]),n)this._initByDimModelData(n);else if(null!=r){n=Array(r);for(var i=0;i<r;i++)n[i]=null;this._initByDimModelData(n)}else this._initBySeriesData()}return t.prototype._initByDimModelData=function(t){var e=this,n=e._cells,r=e._levels,i=[],o=0;return e._leavesCount=function t(n,a,s){var l=0;if(!n)return l;return B(n,function(n,u){var h,c=!1;Y(n)?h={value:n}:J(n)?(h=n,null==n.value||Y(n.value)||(c=!0,h={value:null})):(h={value:null},null!=n&&(c=!0)),c&&La("Illegal echarts option - matrix."+e.dim+".data["+u+"] must be `string | {value: string}`.");var d={type:eZ,ordinal:NaN,level:s,firstLeafLocator:a,id:new Re,span:gZ(new Re,e.dimIdx,1,1),option:h,xy:NaN,wh:NaN,dim:e,rect:{x:NaN,y:NaN,width:NaN,height:NaN}};o++,(i[a]||(i[a]=[])).push(d),r[s]||(r[s]={type:$j,xy:NaN,wh:NaN,option:null,id:new Re,dim:e});var p=t(h.children,a,s+1),f=Math.max(1,p);d.span[$d[e.dimIdx]]=f,l+=f,a+=f}),l}(t,0,0),void function(){var t=[];for(;n.length<o;)for(var r=0;r<i.length;r++){var a=i[r].pop();if(a){a.ordinal=t.length;var s=a.option.value;t.push(s),n.push(a),e._uniqueValueGen.calcDupBase(s)}}e._uniqueValueGen.ensureValueUnique(t,n);var l=e._ordinalMeta=new bS({categories:t,needCollect:!1,deduplication:!1});e._scale=new XS({ordinalMeta:l});for(var u=0;u<e._leavesCount;u++){var h=e._cells[u];h.type=tZ,h.span[$d[1-e.dimIdx]]=e._levels.length-h.level}e._initCellsId(),e._initLevelIdOptions()}()},t.prototype._initBySeriesData=function(){var t=this;t._leavesCount=0,t._levels=[{type:$j,xy:NaN,wh:NaN,option:null,id:new Re,dim:t}],t._initLevelIdOptions();var e=t._ordinalMeta=new bS({needCollect:!0,deduplication:!0,onCollect:function(e,n){var r=t._cells[n]={type:tZ,ordinal:n,level:0,firstLeafLocator:n,id:new Re,span:gZ(new Re,t.dimIdx,1,1),option:{value:e+""},xy:NaN,wh:NaN,dim:t,rect:{x:NaN,y:NaN,width:NaN,height:NaN}};t._leavesCount++,t._setCellId(r)}});t._scale=new XS({ordinalMeta:e})},t.prototype._setCellId=function(t){var e=this._levels.length,n=this.dimIdx;gZ(t.id,n,t.firstLeafLocator,t.level-e)},t.prototype._initCellsId=function(){var t=this._levels.length,e=this.dimIdx;B(this._cells,function(n){gZ(n.id,e,n.firstLeafLocator,n.level-t)})},t.prototype._initLevelIdOptions=function(){var t=this._levels.length,e=this.dimIdx,n=this._model.get("levels",!0);n=j(n)?n:[],B(this._levels,function(r,i){gZ(r.id,e,0,i-t),r.option=n[i]})},t.prototype.shouldShow=function(){return!!this._model.getShallow("show",!0)},t.prototype.resetLayoutIterator=function(t,e,n,r){if(t=t||new us,e===this.dimIdx){var i=this._leavesCount,o=null!=n?Math.max(0,n):0;r=null!=r?Math.min(r,i):i,t.reset(this._cells,o,o+r)}else{i=this._levels.length,o=null!=n?Math.max(0,n+i):0;r=null!=r?Math.min(r,i):i,t.reset(this._levels,o,o+r)}return t},t.prototype.resetCellIterator=function(t){return(t||new us).reset(this._cells,0)},t.prototype.resetLevelIterator=function(t){return(t||new us).reset(this._levels,0)},t.prototype.getLayout=function(t,e,n){var r=this.getUnitLayoutInfo(e,n);t[$d[e]]=r?r.xy:NaN,t[tp[e]]=r?r.wh:NaN},t.prototype.getUnitLayoutInfo=function(t,e){return t===this.dimIdx?e<this._leavesCount?this._cells[e]:void 0:this._levels[e+this._levels.length]},t.prototype.getCell=function(t){var e=this._scale.parse(t);return it(e)?void 0:this._cells[e]},t.prototype.getLocatorCount=function(t){return t===this.dimIdx?this._leavesCount:this._levels.length},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t}();var vZ=function(){function t(t,e,n){this._model=e,this._dims=n,this._kind=t,this._cellMergeOwnerList=[]}return t.prototype._ensureCellMap=function(){var t=this,e=t._cellMap;return e||(e=t._cellMap=yt(),function(){var e=[],r=t._model.getShallow("data");r&&!j(r)&&(La("matrix."+r+".data must be an array if specified."),r=null);B(r,function(n,r){if(J(n)&&j(n.coord)){var i=iZ([]),o=null;if(oZ(i,o=[],n.coord,t._dims,n.coordClamp?nZ[t._kind]:nZ.none),lZ(i,0)||lZ(i,1))La("Can not determine cells by option matrix."+t._kind+".data["+r+"]: "+o.join(" "));else{var a=n&&n.mergeCells,s={id:new Re,span:new Re,locatorRange:i,option:n,cellMergeOwner:a};pZ(s,i),e.push(s)}}else La("Illegal matrix."+t._kind+".data["+r+"], must be a {coord: [...], ...}")});for(var i=[],o=0;o<e.length;o++){var a=e[o];if(a.cellMergeOwner){var s=a.locatorRange;uZ(s,i,e,o);for(var l=0;l<o;l++)i[l]&&(e[l].cellMergeOwner=!1);if(s[0][0]!==a.id.x||s[1][0]!==a.id.y){a.cellMergeOwner=!1;var u=L({},a.option);u.coord=null;var h={id:new Re,span:new Re,locatorRange:s,option:u,cellMergeOwner:!0};pZ(h,s),e.push(h)}}}B(e,function(e){var r=n(e.id.x,e.id.y);if(e.cellMergeOwner&&(r.cellMergeOwner=!0,r.span=e.span,r.locatorRange=e.locatorRange,r.spanRect={x:NaN,y:NaN,width:NaN,height:NaN},t._cellMergeOwnerList.push(r)),e.cellMergeOwner||e.option)for(var i=0;i<e.span.y;i++)for(var o=0;o<e.span.x;o++){var a=n(e.id.x+o,e.id.y+i);a.option=e.option,e.cellMergeOwner&&(a.inSpanOf=r)}})}()),e;function n(t,n){var r=_Z(t,n),i=e.get(r);return i||(i=e.set(r,{id:new Re(t,n),option:null,inSpanOf:null,span:null,spanRect:null,locatorRange:null,cellMergeOwner:!1})),i}},t.prototype.getCell=function(t){return this._ensureCellMap().get(_Z(t[0],t[1]))},t.prototype.travelExistingCells=function(t){this._ensureCellMap().each(t)},t.prototype.expandRangeByCellMerge=function(t){if(!lZ(t,0)&&!lZ(t,1)&&t[0][0]===t[0][1]&&t[1][0]===t[1][1]){yZ[0]=t[0][0],yZ[1]=t[1][0];var e=this.getCell(yZ),n=e&&e.inSpanOf;if(n)return void function(t,e){t[0][0]=e[0][0],t[0][1]=e[0][1],t[1][0]=e[1][0],t[1][1]=e[1][1]}(t,n.locatorRange)}var r=this._cellMergeOwnerList;uZ(t,null,r,r.length)},t}(),yZ=[];function _Z(t,e){return t+"|"+e}var xZ={show:!0,color:om.color.secondary,overflow:"break",lineOverflow:"truncate",padding:[2,3,2,3],distance:0};function bZ(t){return{color:"none",borderWidth:1,borderColor:t?"none":om.color.borderTint}}var wZ={show:!0,label:xZ,itemStyle:bZ(!1),silent:void 0,dividerLineStyle:{width:1,color:om.color.border}},SZ={z:-50,left:"10%",top:"10%",right:"10%",bottom:"10%",x:wZ,y:wZ,body:{label:xZ,itemStyle:bZ(!1),silent:void 0},corner:{label:xZ,itemStyle:bZ(!0),silent:void 0},backgroundStyle:{color:"none",borderColor:om.color.axisLine,borderWidth:1},triggerEvent:!1},TZ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.optionUpdated=function(){var t=this._dimModels={x:new MZ(this.get("x",!0)||{}),y:new MZ(this.get("y",!0)||{})};t.x.option.type=t.y.option.type="category";var e={x:t.x.dim=new mZ("x",t.x),y:t.y.dim=new mZ("y",t.y)};this._body=new vZ("body",new xf(this.getShallow("body")),e),this._corner=new vZ("corner",new xf(this.getShallow("corner")),e)},n.prototype.getDimensionModel=function(t){return this._dimModels[t]},n.prototype.getBody=function(){return this._body},n.prototype.getCorner=function(){return this._corner},n.type="matrix",n.layoutMode="box",n.defaultOption=SZ,n}(tm),MZ=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getOrdinalMeta=function(){return this.dim.getOrdinalMeta()},n}(xf),CZ=TZ,IZ=Math.round,AZ={normal:25,special:100},DZ={normal:50,special:125},LZ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e){this.group.removeAll();var n=this.group,r=t.coordinateSystem.getRect(),i=t.getDimensionModel("x"),o=t.getDimensionModel("y"),a=i.dim,s=o.dim;!function(t,e,n){function r(r){var i=e.getDimensionModel($d[r]),o=i.dim;if(o.shouldShow())for(var a=i.getModel("itemStyle"),s=i.getModel("label"),l=e.getShallow("tooltip",!0),u=[],h=o.resetCellIterator();h.next();){var c=h.item,d={};ln.copy(d,c.rect),Lt(u,c.id.x,c.id.y),PZ(u,e,t,n,c.option,a,s,i,d,c.option.value,DZ,l,0===r?"x":"y")}}r(0),r(1)}(n,t,e),function(t,e,n,r,i){o("body",e.getBody(),n,r),n.shouldShow()&&r.shouldShow()&&o("corner",e.getCorner(),r,n);function o(n,r,o,a){var s=new xf(e.getShallow(n,!0)),l=s.getModel("itemStyle"),u=s.getModel("label"),h=new us,c=new us,d=[],p=e.getShallow("tooltip",!0);for(a.resetLayoutIterator(c,1);c.next();)for(o.resetLayoutIterator(h,0);h.next();){var f=h.item,g=c.item;Lt(d,f.id.x,g.id.y);var m=r.getCell(d);if(!m||!m.inSpanOf||m.inSpanOf===m){var v={};m&&m.span?ln.copy(v,m.spanRect):(f.dim.getLayout(v,0,d[0]),g.dim.getLayout(v,1,d[1]));var y=m?m.option:null;PZ(d,e,t,i,y,l,u,s,v,y?y.value:null,AZ,p,n)}}}}(n,t,a,s,e);var l=at(t.getShallow("borderZ2",!0),99),u=l-1,h=t.getModel("backgroundStyle").getItemStyle(["borderWidth"]);h.lineWidth=0;var c=t.getModel("backgroundStyle").getItemStyle(["color","decal","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]);c.fill="none";var d=kZ(r.clone(),h,0),p=kZ(r.clone(),c,l);d.silent=!0,p.silent=!0,n.add(d),n.add(p);var f=a.getUnitLayoutInfo(0,0),g=s.getUnitLayoutInfo(1,0);f&&g&&(a.shouldShow()&&n.add(zZ({x1:r.x,y1:g.xy,x2:r.x+r.width,y2:g.xy},i.getModel("dividerLineStyle").getLineStyle(),u)),s.shouldShow()&&n.add(zZ({x1:f.xy,y1:r.y,x2:f.xy,y2:r.y+r.height},o.getModel("dividerLineStyle").getLineStyle(),u)))},n.type="matrix",n}(Qy);function PZ(t,e,n,r,i,o,a,s,l,u,h,c,d){var p;OZ.option=i?i.itemStyle:null,OZ.parentModel=o,EZ.option=i,EZ.parentModel=s;var f=at(EZ.getShallow("z2"),i&&i.itemStyle?h.special:h.normal),g=c&&c.show,m=kZ(l,OZ.getItemStyle(),f);n.add(m);var v,y=EZ.get("cursor");if(null!=y&&m.attr("cursor",y),null!=u){var _=u+"";NZ.option=i?i.label:null,NZ.parentModel=a,NZ.ecModel=r;var x=NZ.getShallow("formatter");if(x){var b={componentType:"matrix",componentIndex:e.componentIndex,name:_,value:u,coord:t.slice(),$vars:["name","value","coord"]};if(Y(x))_=wg(x,b);else if(Z(x)){var w=x(b);null!=w&&(_=w+"")}}if(jp(m,{normal:NZ},{defaultText:_,autoOverflowArea:!0,layoutRect:I(m.shape)}),v=m.getTextContent()){v.z2=f+1;var S=v.style;if(S&&S.overflow&&"none"!==S.overflow&&S.lineOverflow){var T={};ln.copy(T,l),Tp(T,((null===(p=m.style)||void 0===p?void 0:p.lineWidth)||0)/2,!0,!0),m.updateInnerText(),v.getLocalTransform(RZ),Pe(RZ,RZ),ln.applyTransform(T,T,RZ),v.setClipPath(new Ru({shape:T}))}}Ip({el:m,componentModel:e,itemName:_,itemTooltipOption:c,formatterParamsExtra:{xyLocator:t.slice()}})}var M=e.get("triggerEvent",!0);if(v){var C=NZ.get("silent");null==C&&(C=!(M||g)),v.silent=C,v.ignoreHostSilent=!0}var A=EZ.get("silent");if(null==A&&(A=!m.style||"none"===m.style.fill||!m.style.fill),m.silent=A,M&&m){var D={componentType:"matrix",componentIndex:e.componentIndex,matrixIndex:e.componentIndex,targetType:d,name:v&&v.style?v.style.text:void 0,value:u,coord:t.slice()};$u(m).eventData=D}hs(EZ),hs(OZ),hs(NZ)}var EZ=new xf,OZ=new xf,NZ=new xf,RZ=[];function kZ(t,e,n){var r=e.lineWidth;if(r){var i=t.x+t.width,o=t.y+t.height;t.x=Pu(t.x,r,!0),t.y=Pu(t.y,r,!0),t.width=Pu(i,r,!0)-t.x,t.height=Pu(o,r,!0)-t.y}return new Ru({shape:t,style:e,z2:n})}function zZ(t,e,n){var r=e.lineWidth;return r&&(IZ(2*t.x1)===IZ(2*t.x2)&&(t.x1=t.x2=Pu(t.x1,r,!0)),IZ(2*t.y1)===IZ(2*t.y2)&&(t.y1=t.y2=Pu(t.y1,r,!0))),new fd({shape:t,style:e,silent:!0,z2:n})}var BZ=LZ,VZ=function(){function t(e,n,r){this.dimensions=t.dimensions,this.type="matrix",this._model=e;var i=this._dimModels={x:e.getDimensionModel("x"),y:e.getDimensionModel("y")};this._dims={x:i.x.dim,y:i.y.dim},this._resize(e,r)}return t.getDimensionsInfo=function(){return[{name:"x",type:"ordinal"},{name:"y",type:"ordinal"},{name:"value"}]},t.create=function(e,n){var r=[];return e.eachComponent("matrix",function(i){var o=new t(i,e,n);r.push(o),i.coordinateSystem=o}),e.eachComponent(function(t,e){Og({targetModel:e,coordSysType:"matrix",coordSysProvider:Ng})}),r},t.prototype.getRect=function(){return this._rect},t.prototype._resize=function(t,e){var n=this._dims,r=this._dimModels,i=this._rect=Ug(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});UZ(r,n,i,0),UZ(r,n,i,1),WZ(0,n),WZ(1,n),XZ(this._model.getBody(),n),XZ(this._model.getCorner(),n)},t.prototype.dataToPoint=function(t,e,n){return n=n||[],this.dataToLayout(t,e,FZ),n[0]=FZ.rect.x+FZ.rect.width/2,n[1]=FZ.rect.y+FZ.rect.height/2,n},t.prototype.dataToLayout=function(t,e,n){var r=this._dims,i=(n=n||{}).rect=n.rect||{};i.x=i.y=i.width=i.height=NaN;var o=n.matrixXYLocatorRange=iZ(n.matrixXYLocatorRange);return j(t)?(oZ(o,null,t,r,at(e&&e.clamp,nZ.none)),e&&e.ignoreMergeCells||(e&&e.clamp===nZ.corner||this._model.getBody().expandRangeByCellMerge(o),e&&e.clamp===nZ.body||this._model.getCorner().expandRangeByCellMerge(o)),fZ(i,o,r,0),fZ(i,o,r,1),n):(La("Input data must be an array in `convertToLayout`, `convertToPixel`"),n)},t.prototype.pointToData=function(t,e,n){var r=this._dims;return JZ(KZ,0,r,t,e&&e.clamp),JZ(KZ,1,r,t,e&&e.clamp),(n=n||[])[0]=n[1]=NaN,KZ.y===qZ.inCorner&&KZ.x===qZ.inBody?QZ(KZ,n,0,r):KZ.x===qZ.inCorner&&KZ.y===qZ.inBody?QZ(KZ,n,1,r):($Z(KZ,n,0,r),$Z(KZ,n,1,r)),n},t.prototype.convertToPixel=function(t,e,n,r){var i=YZ(e);return i===this?i.dataToPoint(n,r):void 0},t.prototype.convertToLayout=function(t,e,n,r){var i=YZ(e);return i===this?i.dataToLayout(n,r):void 0},t.prototype.convertFromPixel=function(t,e,n,r){var i=YZ(e);return i===this?i.pointToData(n,r):void 0},t.prototype.containPoint=function(t){return this._rect.contain(t[0],t[1])},t.dimensions=["x","y","value"],t}(),FZ={rect:{x:NaN,y:NaN,width:NaN,height:NaN}},GZ=new us,HZ=new us;function UZ(t,e,n,r){for(var i=1-r,o=e[$d[r]],a=e[$d[i]],s=a.shouldShow(),l=o.resetCellIterator();l.next();)l.item.wh=l.item.xy=NaN;for(var u=a.resetLayoutIterator(null,r);u.next();)u.item.wh=u.item.xy=NaN;for(var h=n[tp[r]],c=o.getLocatorCount(r)+a.getLocatorCount(r),d=new xf,p=a.resetLevelIterator();p.next();)d.option=p.item.option,d.parentModel=t[$d[i]],m(p.item,s?d.get("levelSize"):0);for(var f=new xf,g=o.resetCellIterator();g.next();)g.item.type===tZ&&(f.option=g.item.option,f.parentModel=void 0,m(g.item,f.get("size")));function m(t,e){var i=function(t,e,n){var r=$o(t,n[tp[e]]);return ZZ(r,n[tp[e]])}(e,r,n);it(i)||(t.wh=ZZ(i,h),h=ZZ(h-t.wh),c--)}var v=c?h/c:0,y=!c&&h>=1,_=n[$d[r]],x=o.getLocatorCount(r)-1,b=new us;for(a.resetLayoutIterator(b,r);b.next();)w(b.item);for(o.resetLayoutIterator(b,r);b.next();)w(b.item);function w(t){it(t.wh)&&(t.wh=v),t.xy=_,t.id[$d[r]]!==x||y||(t.wh=n[$d[r]]+n[tp[r]]-t.xy),_+=t.wh}}function WZ(t,e){for(var n=e[$d[t]].resetCellIterator();n.next();){var r=n.item;jZ(r.rect,t,r.id,r.span,e),jZ(r.rect,1-t,r.id,r.span,e),r.type===eZ&&(r.xy=r.rect[$d[t]],r.wh=r.rect[tp[t]])}}function XZ(t,e){t.travelExistingCells(function(t){var n=t.span;if(n){var r=t.spanRect,i=t.id;jZ(r,0,i,n,e),jZ(r,1,i,n,e)}})}function jZ(t,e,n,r,i){t[tp[e]]=0;var o=n[$d[e]]<0?i[$d[1-e]]:i[$d[e]],a=o.getUnitLayoutInfo(e,n[$d[e]]);if(t[$d[e]]=a.xy,t[tp[e]]=a.wh,r[$d[e]]>1){var s=o.getUnitLayoutInfo(e,n[$d[e]]+r[$d[e]]-1);t[tp[e]]=s.xy+s.wh-a.xy}}function ZZ(t,e){return Math.max(Math.min(t,at(e,1/0)),0)}function YZ(t){var e=t.matrixModel,n=t.seriesModel;return e?e.coordinateSystem:n?n.coordinateSystem:null}var qZ={inBody:1,inCorner:2,outside:3},KZ={x:null,y:null,point:[]};function JZ(t,e,n,r,i){var o=n[$d[e]],a=n[$d[1-e]],s=o.getUnitLayoutInfo(e,o.getLocatorCount(e)-1),l=o.getUnitLayoutInfo(e,0),u=a.getUnitLayoutInfo(e,-a.getLocatorCount(e)),h=a.shouldShow()?a.getUnitLayoutInfo(e,-1):null,c=t.point[e]=r[e];if(l||h)if(i!==nZ.body)if(i!==nZ.corner){var d=l?l.xy:h?h.xy+h.wh:NaN,p=u?u.xy:d,f=s?s.xy+s.wh:d;if(c<p){if(!i)return void(t[$d[e]]=qZ.outside);c=p}else if(c>f){if(!i)return void(t[$d[e]]=qZ.outside);c=f}t.point[e]=c,t[$d[e]]=d<=c&&c<=f?qZ.inBody:p<=c&&c<=d?qZ.inCorner:qZ.outside}else h?(t[$d[e]]=qZ.inCorner,c=Fo(h.xy+h.wh,Go(u.xy,c)),t.point[e]=c):t[$d[e]]=qZ.outside;else l?(t[$d[e]]=qZ.inBody,c=Fo(s.xy+s.wh,Go(l.xy,c)),t.point[e]=c):t[$d[e]]=qZ.outside;else t[$d[e]]=qZ.outside}function QZ(t,e,n,r){var i=1-n;if(t[$d[n]]!==qZ.outside)for(r[$d[n]].resetCellIterator(HZ);HZ.next();){var o=HZ.item;if(eY(t.point[n],o.rect,n)&&eY(t.point[i],o.rect,i))return e[n]=o.ordinal,void(e[i]=o.id[$d[i]])}}function $Z(t,e,n,r){if(t[$d[n]]!==qZ.outside)for((t[$d[n]]===qZ.inCorner?r[$d[1-n]]:r[$d[n]]).resetLayoutIterator(GZ,n);GZ.next();)if(tY(t.point[n],GZ.item))return void(e[n]=GZ.item.id[$d[n]])}function tY(t,e){return e.xy<=t&&t<=e.xy+e.wh}function eY(t,e,n){return e[$d[n]]<=t&&t<=e[$d[n]]+e[tp[n]]}var nY=VZ;function rY(t,e){var n;return B(e,function(e){null!=t[e]&&"auto"!==t[e]&&(n=!0)}),n}var iY=["transition","enterFrom","leaveTo"],oY=iY.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function aY(t,e,n){if(n&&(!t[n]&&e[n]&&(t[n]={}),t=t[n],e=e[n]),t&&e)for(var r=n?iY:oY,i=0;i<r.length;i++){var o=r[i];null==t[o]&&null!=e[o]&&(t[o]=e[o])}}var sY=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.preventAutoZ=!0,e}return e(n,t),n.prototype.mergeOption=function(e,n){var r=this.option.elements;this.option.elements=null,t.prototype.mergeOption.call(this,e,n),this.option.elements=r},n.prototype.optionUpdated=function(t,e){var n=this.option,r=(e?n:t).elements,i=n.elements=e?[]:n.elements,o=[];this._flatten(r,o,null);var a=Ua(i,o,"normalMerge"),s=this._elOptionsToUpdate=[];B(a,function(t,e){var n=t.newOption;ht(J(n)||t.existing,"Empty graphic option definition"),n&&(s.push(n),function(t,e){var n=t.existing;if(e.id=t.keyInfo.id,!e.type&&n&&(e.type=n.type),null==e.parentId){var r=e.parentOption;r?e.parentId=r.id:n&&(e.parentId=n.parentId)}e.parentOption=null}(t,n),function(t,e,n){var r=L({},n),i=t[e],o=n.$action||"merge";if("merge"===o)if(i){var a=n.type;ht(!a||i.type===a,'Please set $action: "replace" to change `type`'),A(i,r,!0),qg(i,r,{ignoreSize:!0}),Jg(n,i),aY(n,i),aY(n,i,"shape"),aY(n,i,"style"),aY(n,i,"extra"),n.clipPath=i.clipPath}else t[e]=r;else"replace"===o?t[e]=r:"remove"===o&&i&&(t[e]=null)}(i,e,n),function(t,e){if(t&&(t.hv=e.hv=[rY(e,["left","right"]),rY(e,["top","bottom"])],"group"===t.type)){var n=t,r=e;null==n.width&&(n.width=r.width=0),null==n.height&&(n.height=r.height=0)}}(i[e],n))},this),n.elements=G(i,function(t){return t&&delete t.$action,null!=t})},n.prototype._flatten=function(t,e,n){B(t,function(t){if(t){n&&(t.parentOption=n),e.push(t);var r=t.children;r&&r.length&&this._flatten(r,e,t),delete t.children}},this)},n.prototype.useElOptionsToUpdate=function(){var t=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,t},n.type="graphic",n.defaultOption={elements:[]},n}(tm),lY={path:null,compoundPath:null,group:Do,image:Iu,text:Qu},uY=Qa(),hY=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(){this._elMap=yt()},n.prototype.render=function(t,e,n){t!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=t,this._updateElements(t),this._relocate(t,n)},n.prototype._updateElements=function(t){var e=t.useElOptionsToUpdate();if(e){var n=this._elMap,r=this.group,i=t.get("z"),o=t.get("zlevel");B(e,function(e){var a=ja(e.id,null),s=null!=a?n.get(a):null,l=ja(e.parentId,null),u=null!=l?n.get(l):r,h=e.type,c=e.style;"text"===h&&c&&e.hv&&e.hv[1]&&(c.textVerticalAlign=c.textBaseline=c.verticalAlign=c.align=null);var d=e.textContent,p=e.textConfig;if(c&&yD(c,h,!!p,!!d)){var f=_D(c,h,!0);!p&&f.textConfig&&(p=e.textConfig=f.textConfig),!d&&f.textContent&&(d=f.textContent)}var g=function(t){return t=L({},t),B(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(zg),function(e){delete t[e]}),t}(e);s&&ht(u===s.parent,"Changing parent is not supported.");var m=e.$action||"merge",v="merge"===m,y="replace"===m;if(v){var _=s;(C=!s)?_=dY(a,u,e.type,n):(_&&(uY(_).isNew=!1),mW(_)),_&&(nW(_,g,t,{isInit:C}),fY(_,e,i,o))}else if(y){pY(s,e,n,t);var x=dY(a,u,e.type,n);x&&(nW(x,g,t,{isInit:!0}),fY(x,e,i,o))}else"remove"===m&&(rW(s,e),pY(s,e,n,t));var b=n.get(a);if(b&&d)if(v){var w=b.getTextContent();w?w.attr(d):b.setTextContent(new Qu(d))}else y&&b.setTextContent(new Qu(d));if(b){var S=e.clipPath;if(S){var T=S.type,M=void 0,C=!1;if(v){var I=b.getClipPath();M=(C=!I||uY(I).type!==T)?cY(T):I}else y&&(C=!0,M=cY(T));b.setClipPath(M),nW(M,S,t,{isInit:C}),vW(M,S.keyframeAnimation,t)}var A=uY(b);b.setTextConfig(p),A.option=e,function(t,e,n){var r=$u(t).eventData;t.silent||t.ignore||r||(r=$u(t).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:t.name});r&&(r.info=n.info)}(b,t,e),Ip({el:b,componentModel:t,itemName:b.name,itemTooltipOption:e.tooltip}),vW(b,e.keyframeAnimation,t)}})}},n.prototype._relocate=function(t,e){for(var n=t.option.elements,r=this.group,i=this._elMap,o=e.getWidth(),a=e.getHeight(),s=["x","y"],l=0;l<n.length;l++){if((f=null!=(p=ja((d=n[l]).id,null))?i.get(p):null)&&f.isGroup){var u=(g=f.parent)===r,h=uY(f),c=uY(g);h.width=Qo(h.option.width,u?o:c.width)||0,h.height=Qo(h.option.height,u?a:c.height)||0}}for(l=n.length-1;l>=0;l--){var d,p,f;if(f=null!=(p=ja((d=n[l]).id,null))?i.get(p):null){var g=f.parent,m=(c=uY(g),{}),v=Zg(f,d,g===r?{width:o,height:a}:{width:c.width,height:c.height},null,{hv:d.hv,boundingMode:d.bounding},m);if(!uY(f).isNew&&v){for(var y=d.transition,_={},x=0;x<s.length;x++){var b=s[x],w=m[b];y&&(oW(y)||N(y,b)>=0)?_[b]=w:f[b]=w}Xd(f,_,t,0)}else f.attr(m)}}},n.prototype._clear=function(){var t=this,e=this._elMap;e.each(function(n){pY(n,uY(n).option,e,t._lastGraphicModel)}),this._elMap=yt()},n.prototype.dispose=function(){this._clear()},n.type="graphic",n}(Qy);function cY(t){ht(t,"graphic type MUST be set");var e=wt(lY,t)?lY[t]:op(t);ht(e,"graphic type "+t+" can not be found");var n=new e({});return uY(n).type=t,n}function dY(t,e,n,r){var i=cY(n);return e.add(i),r.set(t,i),uY(i).id=t,uY(i).isNew=!0,i}function pY(t,e,n,r){t&&t.parent&&("group"===t.type&&t.traverse(function(t){pY(t,e,n,r)}),iW(t,e,r),n.removeKey(uY(t).id))}function fY(t,e,n,r){t.isGroup||B([["cursor",vl.prototype.cursor],["zlevel",r||0],["z",n||0],["z2",0]],function(n){var r=n[0];wt(e,r)?t[r]=at(e[r],n[1]):null==t[r]&&(t[r]=n[1])}),B(U(e),function(n){if(0===n.indexOf("on")){var r=e[n];t[n]=Z(r)?r:null}}),wt(e,"draggable")&&(t.draggable=e.draggable),null!=e.name&&(t.name=e.name),null!=e.id&&(t.id=e.id)}var gY=["x","y","radius","angle","single"],mY=Qa(),vY=["cartesian2d","polar","singleAxis"];function yY(t){return ht(t),t+"Axis"}function _Y(t,e){var n,r=yt(),i=[],o=yt();t.eachComponent({mainType:"dataZoom",query:e},function(t){o.get(t.uid)||s(t)});do{n=!1,t.eachComponent("dataZoom",a)}while(n);function a(t){!o.get(t.uid)&&function(t){var e=!1;return t.eachTargetAxis(function(t,n){var i=r.get(t);i&&i[n]&&(e=!0)}),e}(t)&&(s(t),n=!0)}function s(t){o.set(t.uid,!0),i.push(t),t.eachTargetAxis(function(t,e){(r.get(t)||r.set(t,[]))[e]=!0})}return i}function xY(t){var e=t.ecModel,n={infoList:[],infoMap:yt()};return t.eachTargetAxis(function(t,r){var i=e.getComponent(yY(t),r);if(i){var o=i.getCoordSysModel();if(o){var a=o.uid,s=n.infoMap.get(a);s||(s={model:o,axisModels:[]},n.infoList.push(s),n.infoMap.set(a,s)),s.axisModels.push(i)}}}),n}function bY(t){var e=mY(cx(t));return e.axisProxyMap||(e.axisProxyMap=yt())}function wY(t){if(t)return ht(t.ecModel),bY(t.ecModel).get(t.uid)}function SY(t,e){var n=e.getAxisModel().axis.__alignTo;return n&&t.getAxisProxy(n.dim,n.model.componentIndex)?wY(n.model):null}var TY=function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(t){this.indexMap[t]||(this.indexList.push(t),this.indexMap[t]=!0)},t}(),MY=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._autoThrottle=!0,e._noTarget=!0,e._rangePropMode=["percent","percent"],e}return e(n,t),n.prototype.init=function(t,e,n){var r=CY(t);this.settledOption=r,this.mergeDefaultAndTheme(t,n),this._doInit(r)},n.prototype.mergeOption=function(t){var e=CY(t);A(this.option,t,!0),A(this.settledOption,e,!0),this._doInit(e)},n.prototype._doInit=function(t){var e=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var n=this.settledOption;B([["start","startValue"],["end","endValue"]],function(t,r){"value"===this._rangePropMode[r]&&(e[t[0]]=n[t[0]]=null)},this),this._resetTarget()},n.prototype._resetTarget=function(){var t=this.get("orient",!0),e=this._targetAxisInfoMap=yt();this._fillSpecifiedTargetAxis(e)?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(e,this._orient)),this._noTarget=!0,e.each(function(t){t.indexList.length&&(this._noTarget=!1)},this)},n.prototype._fillSpecifiedTargetAxis=function(t){var e=!1;return B(gY,function(n){var r=this.getReferringComponents(yY(n),rs);if(r.specified){e=!0;var i=new TY;B(r.models,function(t){i.add(t.componentIndex)}),t.set(n,i)}},this),e},n.prototype._fillAutoTargetAxisByOrient=function(t,e){var n=this.ecModel,r=!0;if(r){var i="vertical"===e?"y":"x";o(n.findComponents({mainType:i+"Axis"}),i)}r&&o(n.findComponents({mainType:"singleAxis",filter:function(t){return t.get("orient",!0)===e}}),"single");function o(e,n){var i=e[0];if(i){var o=new TY;if(o.add(i.componentIndex),t.set(n,o),r=!1,"x"===n||"y"===n){var a=i.getReferringComponents("grid",ns).models[0];a&&B(e,function(t){i.componentIndex!==t.componentIndex&&a===t.getReferringComponents("grid",ns).models[0]&&o.add(t.componentIndex)})}}}r&&B(gY,function(e){if(r){var i=n.findComponents({mainType:yY(e),filter:function(t){return"category"===t.get("type",!0)}});if(i[0]){var o=new TY;o.add(i[0].componentIndex),t.set(e,o),r=!1}}},this)},n.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(e){!t&&(t=e)},this),"y"===t?"vertical":"horizontal"},n.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var e=this.ecModel.option;this.option.throttle=e.animation&&e.animationDurationUpdate>0?100:20}},n.prototype._updateRangeUse=function(t){var e=this._rangePropMode,n=this.get("rangeMode");B([["start","startValue"],["end","endValue"]],function(r,i){var o=null!=t[r[0]],a=null!=t[r[1]];o&&!a?e[i]="percent":!o&&a?e[i]="value":n?e[i]=n[i]:o&&(e[i]="percent")})},n.prototype.noTarget=function(){return this._noTarget},n.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(e,n){null==t&&(t=this.ecModel.getComponent(yY(e),n))},this),t},n.prototype.eachTargetAxis=function(t,e){this._targetAxisInfoMap.each(function(n,r){B(n.indexList,function(n){t.call(e,r,n)})})},n.prototype.getAxisProxy=function(t,e){return wY(this.getAxisModel(t,e))},n.prototype.getAxisModel=function(t,e){ht(t&&null!=e);var n=this._targetAxisInfoMap.get(t);if(n&&n.indexMap[e])return this.ecModel.getComponent(yY(t),e)},n.prototype.setRawRange=function(t){var e=this.option,n=this.settledOption;B([["start","startValue"],["end","endValue"]],function(r){null==t[r[0]]&&null==t[r[1]]||(e[r[0]]=n[r[0]]=t[r[0]],e[r[1]]=n[r[1]]=t[r[1]])},this),this._updateRangeUse(t)},n.prototype.setCalculatedRange=function(t){var e=this.option;B(["start","startValue","end","endValue"],function(n){e[n]=t[n]})},n.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getWindow().percent},n.prototype.getValueRange=function(t,e){if(null!=t||null!=e)return this.getAxisProxy(t,e).getWindow().value;var n=this.findRepresentativeAxisProxy();return n?n.getWindow().value:void 0},n.prototype.findRepresentativeAxisProxy=function(t){if(t)return wY(t);for(var e,n=this._targetAxisInfoMap.keys(),r=0;r<n.length;r++)for(var i=n[r],o=this._targetAxisInfoMap.get(i),a=0;a<o.indexList.length;a++){var s=this.getAxisProxy(i,o.indexList[a]);if(s.hostedBy(this))return s;e||(e=s)}return e},n.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},n.prototype.getOrient=function(){return ht(this._orient),this._orient},n.type="dataZoom",n.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],n.defaultOption={z:4,filterMode:"filter",start:0,end:100},n}(tm);function CY(t){var e={};return B(["start","end","startValue","endValue","throttle"],function(n){t.hasOwnProperty(n)&&(e[n]=t[n])}),e}var IY=MY,AY=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.select",n}(IY),DY=AY,LY=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n,r){this.dataZoomModel=t,this.ecModel=e,this.api=n},n.type="dataZoom",n}(Qy),PY=LY,EY=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.select",n}(PY),OY=EY,NY=function(){function t(t,e,n,r){this._dimName=t,this._axisIndex=e,this.ecModel=r,this._dataZoomModel=n}return t.prototype.hostedBy=function(t){return this._dataZoomModel===t},t.prototype.getWindow=function(){return I(this._window)},t.prototype.getTargetSeriesModels=function(){var t=[];return this.ecModel.eachSeries(function(e){if(function(t){var e=t.get("coordinateSystem");return N(vY,e)>=0}(e)){var n=yY(this._dimName),r=e.getReferringComponents(n,ns).models[0];r&&this._axisIndex===r.componentIndex&&t.push(e)}},this),t},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return I(this._minMaxSpan)},t.prototype.calculateDataWindow=function(t){var e,n=this._extent,r=this.getAxisModel().axis,i=r.scale,o=this._dataZoomModel.getRangePropMode(),a=[0,100],s=[],l=[],u=[!1,!1];B(["start","end"],function(r,h){var c=t[r],d=t[r+"Value"];"percent"===o[h]?(null==c&&(c=a[h]),d=Jo(c,a,n),u[h]=!0):(e=!0,null==d?d=n[h]:(d=i.parse(d),i.sanitize&&(d=i.sanitize(d,n))),c=Jo(d,n,a)),l[h]=null==d||isNaN(d)?n[h]:d,s[h]=null==c||isNaN(c)?a[h]:c}),ra(l),ra(s);var h=this._minMaxSpan;function c(t,e,n,r,i){var o=i?"Span":"ValueSpan";JV(0,t,n,"all",h["min"+o],h["max"+o]);for(var a=0;a<2;a++)e[a]=Jo(t[a],n,r,!0),i&&(e[a]=e[a],u[a]=!0);vs(e)}e?c(l,s,n,a,!1):c(s,l,a,n,!0);var d=kS(i)||NS(i),p=r.getExtent(),f=Ho(p[1]-p[0]),g=d?0:aa(l,f,.5);B([[0,Xo],[1,Wo]],function(t){var e=t[0],r=t[1];u[e]&&isFinite(g)&&(l[e]=ea(l[e],g),l[e]=Fo(n[1],Go(n[0],l[e])),s[e]===a[e]&&(l[e]=n[e],d&&(l[e]=r(l[e]))))}),vs(l);var m=[Jo(l[0],n,a,!0),Jo(l[1],n,a,!0)];return vs(m),{value:l,percent:s,percentInverted:m,valuePrecision:g}},t.prototype.reset=function(t,e){if(this.hostedBy(t)){var n=this.getAxisModel().axis;$T(n,2);var r=n.scale.rawExtentInfo;this._extent=r.makeNoZoom(),this._updateMinMaxSpan();var i=t.settledOption;e&&(i=E({start:e[0],end:e[1]},i));var o=this._window=this.calculateDataWindow(i),a=o.percent,s=o.value;0!==a[0]&&r.setZoomMM(0,s[0]),100!==a[1]&&r.setZoomMM(1,s[1])}},t.prototype.filterData=function(t,e){if(this.hostedBy(t)){var n=this._dimName,r=this.getTargetSeriesModels(),i=t.get("filterMode"),o=this._window.value;"none"!==i&&B(r,function(t){var e=t.getData(),r=e.mapDimensionsAll(n);if(r.length){if("weakFilter"===i){var a=e.getStore(),s=V(r,function(t){return e.getDimensionIndex(t)},e);e.filterSelf(function(t){for(var e,n,i,l=0;l<r.length;l++){var u=a.get(s[l],t),h=!isNaN(u),c=u<o[0],d=u>o[1];if(h&&!c&&!d)return!0;h&&(i=!0),c&&(e=!0),d&&(n=!0)}return i&&e&&n})}else B(r,function(n){if("empty"===i)t.setData(e=e.map(n,function(t){return function(t){return t>=o[0]&&t<=o[1]}(t)?t:NaN}));else{var r={};r[n]=o,e.selectRange(r)}});B(r,function(t){e.setApproximateExtent(o,t)})}})}},t.prototype._updateMinMaxSpan=function(){var t=this._minMaxSpan={},e=this._dataZoomModel,n=this._extent;B(["min","max"],function(r){var i=e.get(r+"Span"),o=e.get(r+"ValueSpan");null!=o&&(o=this.getAxisModel().axis.scale.parse(o)),null!=o?i=Jo(n[0]+o,n,[0,100],!0):null!=i&&(o=Jo(i,[0,100],n,!0)-n[0]),t[r+"Span"]=i,t[r+"ValueSpan"]=o},this)},t}(),RY=NY,kY={dirtyOnOverallProgress:!0,getTargetSeries:function(t){var e,n=[];e=function(e,r,i,o){if(!wY(i)){var a=new RY(e,r,o,t);n.push(a),function(t,e){ht(t.ecModel),bY(t.ecModel).set(t.uid,e)}(i,a)}},t.eachComponent("dataZoom",function(n){n.eachTargetAxis(function(r,i){var o=t.getComponent(yY(r),i);e(r,i,o,n)})});var r=yt();return B(n,function(t){B(t.getTargetSeriesModels(),function(t){r.set(t.uid,t)})}),r},overallReset:function(t,e){t.eachComponent("dataZoom",function(t){var n=[];t.eachTargetAxis(function(e,r){var i=t.getAxisProxy(e,r),o=SY(t,i);o?n.push([i,o]):i.reset(t,null)}),B(n,function(e){e[0].reset(t,e[1].getWindow().percentInverted)}),t.eachTargetAxis(function(n,r){t.getAxisProxy(n,r).filterData(t,e)})}),t.eachComponent("dataZoom",function(t){var e=t.findRepresentativeAxisProxy();if(e){var n=e.getWindow(),r=n.percent,i=n.value;t.setCalculatedRange({start:r[0],end:r[1],startValue:i[0],endValue:i[1]})}})}},zY=kY;var BY=ys();function VY(t){BY(t,function(){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,zY),function(t){t.registerAction("dataZoom",function(t,e){B(_Y(e,t),function(e){e.setRawRange({start:t.start,end:t.end,startValue:t.startValue,endValue:t.endValue})})})}(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"})})}function FY(t){t.registerComponentModel(DY),t.registerComponentView(OY),VY(t)}var GY=function(){},HY={};function UY(t,e){HY[t]=e}function WY(t){return HY[t]}var XY=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(e,n,r){var i=r.getTheme().get("toolbox"),o=i?i.feature:null;o&&(this._themeFeatureOption=L({},o),i.feature={}),t.prototype.init.call(this,e,n,r),o&&(i.feature=o)},n.prototype.optionUpdated=function(){B(this.option.feature,function(t,e){var n=this._themeFeatureOption,r=WY(e);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(this.ecModel)),n&&n[e]&&(A(t,n[e]),n[e]=null),A(t,r.defaultOption))},this)},n.type="toolbox",n.layoutMode={type:"box",ignoreSize:!0},n.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:om.color.border,borderRadius:0,borderWidth:0,padding:om.size.m,itemSize:15,itemGap:om.size.s,showTitle:!0,iconStyle:{borderColor:om.color.accent50,color:"none"},emphasis:{iconStyle:{borderColor:om.color.accent70}},tooltip:{show:!1,position:"bottom"}},n}(tm),jY=XY;function ZY(t,e){var n=vg(e.get("padding")),r=e.getItemStyle(["color","opacity"]);return r.fill=e.get("backgroundColor"),new Ru({shape:{x:t.x-n[3],y:t.y-n[0],width:t.width+n[1]+n[3],height:t.height+n[0]+n[2],r:e.get("borderRadius")},style:r,silent:!0,z2:-1})}var YY=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,r){var i=this.group;if(i.removeAll(),t.get("show")){var o=+t.get("itemSize"),a="vertical"===t.get("orient"),s=t.get("feature")||{},l=this._features||(this._features=yt()),u=[];B(s,function(t,e){u.push(e)}),new Ow(this._featureNames||[],u).add(f).update(f).remove(X(f,null)).execute(),this._featureNames=G(u,function(t){return l.hasKey(t)});var h=jg(t,n).refContainer,c=t.getBoxLayoutParams(),d=t.get("padding"),p=Ug(c,h,d);Fg(t.get("orient"),i,t.get("itemGap"),p.width,p.height),Zg(i,c,h,d),i.add(ZY(i.getBoundingRect(),t)),a||i.eachChild(function(t){var e=t.__title,r=t.ensureState("emphasis"),a=r.textConfig||(r.textConfig={}),s=t.getTextContent(),l=s&&s.ensureState("emphasis");if(l&&!Z(l)&&e){var u=l.style||(l.style={}),h=ao(e,Qu.makeFont(u)),c=t.x+i.x,d=!1;t.y+i.y+o+h.height>n.getHeight()&&(a.position="top",d=!0);var p=d?-5-h.height:o+10;c+h.width/2>n.getWidth()?(a.position=["100%",p],u.align="right"):c-h.width/2<0&&(a.position=[0,p],u.align="left")}})}function f(h,c){var d,p=null!=h&&null==c,f=null!=h&&null!=c,g=null==h,m=p||f?u[h]:u[c],v=s[m],y=p||f?new xf(v,t,e):null,_=y&&y.get("show");if(p){if(!_)return;if(function(t){return 0===t.indexOf("my")}(m))d={onclick:y.option.onclick,featureName:m};else{var x=WY(m);if(!x)return;d=new x}l.set(m,d)}else d=l.get(m);if(g||!_)return qY(d)&&d.dispose&&d.dispose(e,n),void l.removeKey(m);r&&null!=r.newTitle&&r.featureName===m&&(v.title=r.newTitle),p&&(d.uid=wf("toolbox-feature")),d.model=y,d.ecModel=e,d.api=n,function(r,s,l){var u,h,c=r.getModel("iconStyle"),d=r.getModel(["emphasis","iconStyle"]),p=s instanceof GY&&s.getIcons?s.getIcons():r.get("icon"),f=r.get("title")||{};Y(p)?(u={})[l]=p:u=p;Y(f)?(h={})[l]=f:h=f;var g=r.iconPaths={};B(u,function(l,u){var p=xp(l,{},{x:-o/2,y:-o/2,width:o,height:o});p.setStyle(c.getItemStyle()),p.ensureState("emphasis").style=d.getItemStyle();var f=new Qu({style:{text:h[u],align:d.get("textAlign"),borderRadius:d.get("textBorderRadius"),padding:d.get("textPadding"),fill:null,font:tf({fontStyle:d.get("textFontStyle"),fontFamily:d.get("textFontFamily"),fontSize:d.get("textFontSize"),fontWeight:d.get("textFontWeight")},e)},ignore:!0});p.setTextContent(f),Ip({el:p,componentModel:t,itemName:u,formatterParamsExtra:{title:h[u]}}),p.__title=h[u],p.on("mouseover",function(){var e=d.getItemStyle(),r=a?null==t.get("right")&&"right"!==t.get("left")?"right":"left":null==t.get("bottom")&&"bottom"!==t.get("top")?"bottom":"top";f.setStyle({fill:d.get("textFill")||e.fill||e.stroke||om.color.neutral99,backgroundColor:d.get("textBackgroundColor")}),p.setTextConfig({position:d.get("textPosition")||r}),f.ignore=!t.get("showTitle"),n.enterEmphasis(this)}).on("mouseout",function(){"emphasis"!==r.get(["iconStatus",u])&&n.leaveEmphasis(this),f.hide()}),("emphasis"===r.get(["iconStatus",u])?Wh:Xh)(p),i.add(p),p.on("click",W(s.onclick,s,e,n,u)),g[u]=p})}(y,d,m),y.setIconStatus=function(t,e){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[t]=e,r[t]&&("emphasis"===e?Wh:Xh)(r[t])},qY(d)&&d.render&&d.render(y,e,n,r)}},n.prototype.updateView=function(t,e,n,r){B(this._features,function(t){t&&t instanceof GY&&t.updateView&&t.updateView(t.model,e,n,r)})},n.prototype.dispose=function(t,e){B(this._features,function(n){n&&n instanceof GY&&n.dispose&&n.dispose(t,e)})},n.type="toolbox",n}(Qy);function qY(t){return t instanceof GY}var KY=YY,JY=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){var n=this.model,r=n.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType(),a=o?"svg":n.get("type",!0)||"png",s=e.getConnectedDataURL({type:a,backgroundColor:n.get("backgroundColor",!0)||t.get("backgroundColor")||om.color.neutral00,connectedBackgroundColor:n.get("connectedBackgroundColor"),excludeComponents:n.get("excludeComponents"),pixelRatio:n.get("pixelRatio")}),l=i.browser;if("function"!=typeof MouseEvent||!l.newEdge&&(l.ie||l.edge))if(window.navigator.msSaveOrOpenBlob||o){var u=s.split(","),h=u[0].indexOf("base64")>-1,c=o?decodeURIComponent(u[1]):u[1];h&&(c=window.atob(c));var d=r+"."+a;if(window.navigator.msSaveOrOpenBlob){for(var p=c.length,f=new Uint8Array(p);p--;)f[p]=c.charCodeAt(p);var g=new Blob([f]);window.navigator.msSaveOrOpenBlob(g,d)}else{var m=document.createElement("iframe");document.body.appendChild(m);var v=m.contentWindow,y=v.document;y.open("image/svg+xml","replace"),y.write(c),y.close(),v.focus(),y.execCommand("SaveAs",!0,d),document.body.removeChild(m)}}else{var _=n.get("lang"),x='<body style="margin:0;"><img src="'+s+'" style="max-width:100%;" title="'+(_&&_[0]||"")+'" /></body>',b=window.open();b.document.write(x),b.document.title=r}else{var w=document.createElement("a");w.download=r+"."+a,w.target="_blank",w.href=s;var S=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});w.dispatchEvent(S)}},n.getDefaultOption=function(t){return{show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:om.color.neutral00,name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])}},n}(GY),QY=JY,$Y="__ec_magicType_stack__",tq=[["line","bar"],["stack"]],eq=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.getIcons=function(){var t=this.model,e=t.get("icon"),n={};return B(t.get("type"),function(t){e[t]&&(n[t]=e[t])}),n},n.getDefaultOption=function(t){return{show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}}},n.prototype.onclick=function(t,e,n){var r=this.model,i=r.get(["seriesIndex",n]);if(nq[n]){var o,a={series:[]};B(tq,function(t){N(t,n)>=0&&B(t,function(t){r.setIconStatus(t,"normal")})}),r.setIconStatus(n,"emphasis"),t.eachComponent({mainType:"series",query:null==i?null:{seriesIndex:i}},function(t){var e=t.subType,i=t.id,o=nq[n](e,i,t,r);o&&(E(o,t.option),a.series.push(o));var s=t.coordinateSystem;if(s&&"cartesian2d"===s.type&&("line"===n||"bar"===n)){var l=s.getAxesByScale("ordinal")[0];if(l){var u=l.dim+"Axis",h=t.getReferringComponents(u,ns).models[0].componentIndex;a[u]=a[u]||[];for(var c=0;c<=h;c++)a[u][h]=a[u][h]||{};a[u][h].boundaryGap="bar"===n}}});var s=n;"stack"===n&&(o=A({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),"emphasis"!==r.get(["iconStatus",n])&&(s="tiled")),e.dispatchAction({type:"changeMagicType",currentType:s,newOption:a,newTitle:o,featureName:"magicType"})}},n}(GY),nq={line:function(t,e,n,r){if("bar"===t)return A({id:e,type:"line",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","line"])||{},!0)},bar:function(t,e,n,r){if("line"===t)return A({id:e,type:"bar",data:n.get("data"),stack:n.get("stack"),markPoint:n.get("markPoint"),markLine:n.get("markLine")},r.get(["option","bar"])||{},!0)},stack:function(t,e,n,r){var i=n.get("stack")===$Y;if("line"===t||"bar"===t)return r.setIconStatus("stack",i?"normal":"emphasis"),A({id:e,stack:i?"":$Y},r.get(["option","stack"])||{},!0)}};gw({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)});var rq=eq,iq=new Array(60).join("-"),oq="\t";function aq(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var sq=new RegExp("[\t]+","g");function lq(t,e){var n=t.split(new RegExp("\n*"+iq+"\n*","g")),r={series:[]};return B(n,function(t,n){if(function(t){if(t.slice(0,t.indexOf("\n")).indexOf(oq)>=0)return!0}(t)){var i=function(t){for(var e=t.split(/\n+/g),n=[],r=V(aq(e.shift()).split(sq),function(t){return{name:t,data:[]}}),i=0;i<e.length;i++){var o=aq(e[i]).split(sq);n.push(o.shift());for(var a=0;a<o.length;a++)r[a]&&(r[a].data[i]=o[a])}return{series:r,categories:n}}(t),o=e[n],a=o.axisDim+"Axis";o&&(r[a]=r[a]||[],r[a][o.axisIndex]={data:i.categories},r.series=r.series.concat(i.series))}else{i=function(t){for(var e=t.split(/\n+/g),n=aq(e.shift()),r=[],i=0;i<e.length;i++){var o=aq(e[i]);if(o){var a=o.split(sq),s="",l=void 0,u=!1;isNaN(a[0])?(u=!0,s=a[0],a=a.slice(1),r[i]={name:s,value:[]},l=r[i].value):l=r[i]=[];for(var h=0;h<a.length;h++)l.push(+a[h]);1===l.length&&(u?r[i].value=l[0]:r[i]=l[0])}}return{name:n,data:r}}(t);r.series.push(i)}}),r}var uq=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){setTimeout(function(){e.dispatchAction({type:"hideTip"})});var n=e.getDom(),r=this.model;this._dom&&n.removeChild(this._dom);var i=document.createElement("div");i.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",i.style.backgroundColor=r.get("backgroundColor")||om.color.neutral00;var o=document.createElement("h4"),a=r.get("lang")||[];o.innerHTML=a[0]||r.get("title"),o.style.cssText="margin:10px 20px",o.style.color=r.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="overflow:auto";var u=r.get("optionToContent"),h=r.get("contentToOption"),c=function(t){var e,n,r,i=function(t){var e={},n=[],r=[];return t.eachRawSeries(function(t){var i,o=t.coordinateSystem;if(!o||"cartesian2d"!==o.type&&"polar"!==o.type)n.push(t);else{var a=o.getBaseAxis();if("category"===a.type){var s=(i=a).dim+"_"+i.index;e[s]||(e[s]={categoryAxis:a,valueAxis:o.getOtherAxis(a),series:[]},r.push({axisDim:a.dim,axisIndex:a.index})),e[s].series.push(t)}else n.push(t)}}),{seriesGroupByCategoryAxis:e,other:n,meta:r}}(t);return{value:G([(n=i.seriesGroupByCategoryAxis,r=[],B(n,function(t,e){var n=t.categoryAxis,i=t.valueAxis.dim,o=[" "].concat(V(t.series,function(t){return t.name})),a=[n.model.getCategories()];B(t.series,function(t){var e=t.getRawData();a.push(t.getRawData().mapArray(e.mapDimension(i),function(t){return t}))});for(var s=[o.join(oq)],l=0;l<a[0].length;l++){for(var u=[],h=0;h<a.length;h++)u.push(a[h][l]);s.push(u.join(oq))}r.push(s.join("\n"))}),r.join("\n\n"+iq+"\n\n")),(e=i.other,V(e,function(t){var e=t.getRawData(),n=[t.name],r=[];return e.each(e.dimensions,function(){for(var t=arguments.length,i=arguments[t-1],o=e.getName(i),a=0;a<t-1;a++)r[a]=arguments[a];n.push((o?o+oq:"")+r.join(oq))}),n.join("\n")}).join("\n\n"+iq+"\n\n"))],function(t){return!!t.replace(/[\n\t\s]/g,"")}).join("\n\n"+iq+"\n\n"),meta:i.meta}}(t);if(Z(u)){var d=u(e.getOption());Y(d)?s.innerHTML=d:tt(d)&&s.appendChild(d)}else{l.readOnly=r.get("readOnly");var p=l.style;p.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",p.color=r.get("textColor"),p.borderColor=r.get("textareaBorderColor"),p.backgroundColor=r.get("textareaColor"),l.value=c.value,s.appendChild(l)}var f=c.meta,g=document.createElement("div");g.style.cssText="position:absolute;bottom:5px;left:0;right:0";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",v=document.createElement("div"),y=document.createElement("div");m+=";background-color:"+r.get("buttonColor"),m+=";color:"+r.get("buttonTextColor");var _=this;function x(){n.removeChild(i),_._dom=null}ve(v,"click",x),ve(y,"click",function(){if(null==h&&null!=u||null!=h&&null==u)return Da("It seems you have just provided one of `contentToOption` and `optionToContent` functions but missed the other one. Data change is ignored."),void x();var t;try{t=Z(h)?h(s,e.getOption()):lq(l.value,f)}catch(t){throw x(),new Error("Data view format error "+t)}t&&e.dispatchAction({type:"changeDataView",newOption:t}),x()}),v.innerHTML=a[1],y.innerHTML=a[2],y.style.cssText=v.style.cssText=m,!r.get("readOnly")&&g.appendChild(y),g.appendChild(v),i.appendChild(o),i.appendChild(s),i.appendChild(g),s.style.height=n.clientHeight-80+"px",n.appendChild(i),this._dom=i},n.prototype.dispose=function(t,e){this._dom&&e.getDom().removeChild(this._dom)},n.getDefaultOption=function(t){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:om.color.background,textColor:om.color.primary,textareaColor:om.color.background,textareaBorderColor:om.color.border,buttonColor:om.color.accent50,buttonTextColor:om.color.neutral00}},n}(GY);function hq(t,e){return V(t,function(t,n){var r=e&&e[n];if(J(r)&&!j(r)){J(t)&&!j(t)||(t={value:t});var i=null!=r.name&&null==t.name;return t=E(t,r),i&&delete t.name,t}return t})}gw({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(t,e){var n=[];B(t.newOption.series,function(t){var r=e.getSeriesByName(t.name)[0];if(r){var i=r.get("data");n.push({name:t.name,data:hq(t.data,i)})}else n.push(L({type:"scatter"},t))}),e.mergeOption(E({series:n},t.newOption))});var cq=uq,dq=B,pq=Qa();function fq(t){var e=pq(t);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var gq=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.onclick=function(t,e){!function(t){pq(t).snapshots=null}(t),e.dispatchAction({type:"restore",from:this.uid})},n.getDefaultOption=function(t){return{show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])}},n}(GY);gw({type:"restore",event:"restore",update:"prepareAndUpdate"},function(t,e){e.resetOption("recreate")});var mq=gq,vq=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],yq=function(){function t(t,e,n){var r=this;this._targetInfoList=[];var i=xq(e,t);B(bq,function(t,e){(!n||!n.include||N(n.include,e)>=0)&&t(i,r._targetInfoList)})}return t.prototype.setOutputRanges=function(t,e){return this.matchOutputRanges(t,e,function(t,e,n){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var r=Tq[t.brushType](0,n,e);t.__rangeOffset={offset:Cq[t.brushType](r.values,t.range,[1,1]),xyMinMax:r.xyMinMax}}}),t},t.prototype.matchOutputRanges=function(t,e,n){B(t,function(t){var r=this.findTargetInfo(t,e);r&&!0!==r&&B(r.coordSyses,function(r){var i=Tq[t.brushType](1,r,t.range,!0);n(t,i.values,r,e)})},this)},t.prototype.setInputRanges=function(t,e){B(t,function(t){var n,r,i,o,a,s=this.findTargetInfo(t,e);if(ht(!s||!0===s||t.coordRange,"coordRange must be specified when coord index specified."),ht(!s||!0!==s||t.range,"range must be specified in global brush."),t.range=t.range||[],s&&!0!==s){t.panelId=s.panelId;var l=Tq[t.brushType](0,s.coordSys,t.coordRange),u=t.__rangeOffset;t.range=u?Cq[t.brushType](l.values,u.offset,(n=l.xyMinMax,r=u.xyMinMax,i=Aq(n),o=Aq(r),a=[i[0]/o[0],i[1]/o[1]],isNaN(a[0])&&(a[0]=1),isNaN(a[1])&&(a[1]=1),a)):l.values}},this)},t.prototype.makePanelOpts=function(t,e){return V(this._targetInfoList,function(n){var r=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:e?e(n):null,clipPath:qF(r),isTargetByCursor:JF(r,t,n.coordSysModel),getLinearBrushOtherExtent:KF(r)}})},t.prototype.controlSeries=function(t,e,n){var r=this.findTargetInfo(t,n);return!0===r||r&&N(r.coordSyses,e.coordinateSystem)>=0},t.prototype.findTargetInfo=function(t,e){for(var n=this._targetInfoList,r=xq(e,t),i=0;i<n.length;i++){var o=n[i],a=t.panelId;if(a){if(o.panelId===a)return o}else for(var s=0;s<wq.length;s++)if(wq[s](r,o))return o}return!0},t}();function _q(t){return t[0]>t[1]&&t.reverse(),t}function xq(t,e){return ts(t,e,{includeMainTypes:vq})}var bq={grid:function(t,e){var n=t.xAxisModels,r=t.yAxisModels,i=t.gridModels,o=yt(),a={},s={};(n||r||i)&&(B(n,function(t){var e=t.axis.grid.model;o.set(e.id,e),a[e.id]=!0}),B(r,function(t){var e=t.axis.grid.model;o.set(e.id,e),s[e.id]=!0}),B(i,function(t){o.set(t.id,t),a[t.id]=!0,s[t.id]=!0}),o.each(function(t){var i=t.coordinateSystem,o=[];B(i.getCartesians(),function(t,e){(N(n,t.getAxis("x").model)>=0||N(r,t.getAxis("y").model)>=0)&&o.push(t)}),e.push({panelId:"grid--"+t.id,gridModel:t,coordSysModel:t,coordSys:o[0],coordSyses:o,getPanelRect:Sq.grid,xAxisDeclared:a[t.id],yAxisDeclared:s[t.id]})}))},geo:function(t,e){B(t.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:Sq.geo})})}},wq=[function(t,e){var n=t.xAxisModel,r=t.yAxisModel,i=t.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===e.gridModel},function(t,e){var n=t.geoModel;return n&&n===e.geoModel}],Sq={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var t=this.coordSys.view,e=MN(null,t);return tn(e,e,SN(null,t)),e}},Tq={lineX:X(Mq,0),lineY:X(Mq,1),rect:function(t,e,n,r){var i=t?e.pointToData([n[0][0],n[1][0]],r):e.dataToPoint([n[0][0],n[1][0]],r),o=t?e.pointToData([n[0][1],n[1][1]],r):e.dataToPoint([n[0][1],n[1][1]],r),a=[_q([i[0],o[0]]),_q([i[1],o[1]])];return{values:a,xyMinMax:a}},polygon:function(t,e,n,r){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:V(n,function(n){var o=t?e.pointToData(n,r):e.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],o[0]),i[1][0]=Math.min(i[1][0],o[1]),i[0][1]=Math.max(i[0][1],o[0]),i[1][1]=Math.max(i[1][1],o[1]),o}),xyMinMax:i}}};function Mq(t,e,n,r){ht("cartesian2d"===n.type,"lineX/lineY brush is available only in cartesian2d.");var i=n.getAxis(["x","y"][t]),o=_q(V([0,1],function(t){return e?i.coordToData(i.toLocalCoord(r[t]),!0):i.toGlobalCoord(i.dataToCoord(r[t]))})),a=[];return a[t]=o,a[1-t]=[NaN,NaN],{values:o,xyMinMax:a}}var Cq={lineX:X(Iq,0),lineY:X(Iq,1),rect:function(t,e,n){return[[t[0][0]-n[0]*e[0][0],t[0][1]-n[0]*e[0][1]],[t[1][0]-n[1]*e[1][0],t[1][1]-n[1]*e[1][1]]]},polygon:function(t,e,n){return V(t,function(t,r){return[t[0]-n[0]*e[r][0],t[1]-n[1]*e[r][1]]})}};function Iq(t,e,n,r){return[e[0]-r[t]*n[0],e[1]-r[t]*n[1]]}function Aq(t){return t?[t[0][1]-t[0][0],t[1][1]-t[1][0]]:[NaN,NaN]}var Dq,Lq,Pq=yq,Eq=B,Oq=za+"toolbox-dataZoom_",Nq={x:"width",y:"height"},Rq=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n,r){this._brushController||(this._brushController=new YF(n.getZr()),this._brushController.on("brush",W(this._onBrush,this)).mount()),function(t,e,n,r,i){var o=n._isZoomActive;r&&"takeGlobalCursor"===r.type&&(o="dataZoomSelect"===r.key&&r.dataZoomSelectActive);n._isZoomActive=o,t.setIconStatus("zoom",o?"emphasis":"normal");var a=new Pq(zq(t),e,{include:["grid"]}),s=a.makePanelOpts(i,function(t){return t.xAxisDeclared&&!t.yAxisDeclared?"lineX":!t.xAxisDeclared&&t.yAxisDeclared?"lineY":"rect"});n._brushController.setPanels(s).enableBrush(!(!o||!s.length)&&{brushType:"auto",brushStyle:t.getModel("brushStyle").getItemStyle()})}(t,e,this,r,n),function(t,e){t.setIconStatus("back",function(t){return fq(t).length}(e)>1?"emphasis":"normal")}(t,e)},n.prototype.onclick=function(t,e,n){kq[n].call(this)},n.prototype.dispose=function(t,e){this._brushController&&this._brushController.dispose()},n.prototype._onBrush=function(t){var e=t.areas;if(t.isEnd&&e.length){var n={},r=this.ecModel;this._brushController.updateCovers([]),new Pq(zq(this.model),r,{include:["grid"]}).matchOutputRanges(e,r,function(t,e,n){if("cartesian2d"===n.type){var r=n.master.getRect().clone(),o=t.brushType;"rect"===o?(i("x",n,r,e[0]),i("y",n,r,e[1])):i({lineX:"x",lineY:"y"}[o],n,r,e)}}),function(t,e){var n=fq(t);dq(e,function(e,r){for(var i=n.length-1;i>=0&&!n[i][r];i--);if(i<0){var o=t.queryComponents({mainType:"dataZoom",subType:"select",id:r})[0];if(o){var a=o.getPercentRange();n[0][r]={dataZoomId:r,start:a[0],end:a[1]}}}}),n.push(e)}(r,n),this._dispatchZoomAction(n)}function i(t,e,i,o){var a=e.getAxis(t),s=a.model,l=function(t,e,n){var r;return n.eachComponent({mainType:"dataZoom",subType:"select"},function(n){n.getAxisModel(t,e.componentIndex)&&(r=n)}),r}(t,s,r),u=l.findRepresentativeAxisProxy(s).getMinMaxSpan(),h=a.scale.getExtent();null==u.minValueSpan&&null==u.maxValueSpan||(o=JV(0,o.slice(),h,0,u.minValueSpan,u.maxValueSpan));var c=aa(h,i[Nq[t]],.5);l&&(n[l.id]={dataZoomId:l.id,startValue:isFinite(c)?ea(o[0],c):o[0],endValue:isFinite(c)?ea(o[1],c):o[1]})}},n.prototype._dispatchZoomAction=function(t){var e=[];Eq(t,function(t,n){e.push(I(t))}),e.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:e})},n.getDefaultOption=function(t){return{show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:om.color.backgroundTint}}},n}(GY),kq={zoom:function(){var t=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:t})},back:function(){this._dispatchZoomAction(function(t){var e=fq(t),n=e[e.length-1];e.length>1&&e.pop();var r={};return dq(n,function(t,n){for(var i=e.length-1;i>=0;i--)if(t=e[i][n]){r[n]=t;break}}),r}(this.ecModel))}};function zq(t){var e={xAxisIndex:t.get("xAxisIndex",!0),yAxisIndex:t.get("yAxisIndex",!0),xAxisId:t.get("xAxisId",!0),yAxisId:t.get("yAxisId",!0)};return null==e.xAxisIndex&&null==e.xAxisId&&(e.xAxisIndex="all"),null==e.yAxisIndex&&null==e.yAxisId&&(e.yAxisIndex="all"),e}Dq="dataZoom",Lq=function(t){var e=t.getComponent("toolbox",0),n=["feature","dataZoom"];if(e&&null!=e.get(n)){var r=e.getModel(n),i=[],o=ts(t,zq(r));return Eq(o.xAxisModels,function(t){return a(t,"xAxis","xAxisIndex")}),Eq(o.yAxisModels,function(t){return a(t,"yAxis","yAxisIndex")}),i}function a(t,e,n){var o=t.componentIndex,a={type:"select",$fromToolbox:!0,filterMode:r.get("filterMode",!0)||"filter",id:Oq+e+o};a[n]=o,i.push(a)}},ht(null==xm.get(Dq)&&Lq),xm.set(Dq,Lq);var Bq=Rq;var Vq=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="tooltip",n.dependencies=["axisPointer"],n.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:om.color.neutral00,shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,defaultBorderColor:om.color.border,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:om.color.borderShade,width:1,type:"dashed",textStyle:{}}},textStyle:{color:om.color.tertiary,fontSize:14}},n}(tm),Fq=Vq;function Gq(t){var e=t.get("confine");return null!=e?!!e:"richText"===t.get("renderMode")}function Hq(t){if(i.domSupported)for(var e=document.documentElement.style,n=0,r=t.length;n<r;n++)if(t[n]in e)return t[n]}var Uq=Hq(["transform","webkitTransform","OTransform","MozTransform","msTransform"]);function Wq(t,e){if(!t)return e;e=mg(e,!0);var n=t.indexOf(e);return(t=-1===n?e:"-"+t.slice(0,n)+"-"+e).toLowerCase()}var Xq=Wq(Hq(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),"transition"),jq=Wq(Uq,"transform"),Zq="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(i.transform3dSupported?"will-change:transform;":"");function Yq(t,e,n){var r=t.toFixed(0)+"px",o=e.toFixed(0)+"px";if(!i.transformSupported)return n?"top:"+o+";left:"+r+";":[["top",o],["left",r]];var a=i.transform3dSupported,s="translate"+(a?"3d":"")+"("+r+","+o+(a?",0":"")+")";return n?"top:0;left:0;"+jq+":"+s+";":[["top",0],["left",0],[Uq,s]]}function qq(t,e,n,r){var o=[],a=t.get("transitionDuration"),s=t.get("backgroundColor"),l=t.get("shadowBlur"),u=t.get("shadowColor"),h=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),d=t.getModel("textStyle"),p=ky(t,"html"),f=h+"px "+c+"px "+l+"px "+u;return o.push("box-shadow:"+f),e&&a>0&&o.push(function(t,e,n){var r="cubic-bezier(0.23,1,0.32,1)",o="",a="";return n&&(a="opacity"+(o=" "+t/2+"s "+r)+",visibility"+o),e||(o=" "+t+"s "+r,a+=(a.length?",":"")+(i.transformSupported?""+jq+o:",left"+o+",top"+o)),Xq+":"+a}(a,n,r)),s&&o.push("background-color:"+s),B(["width","color","radius"],function(e){var n="border-"+e,r=mg(n),i=t.get(r);null!=i&&o.push(n+":"+i+("color"===e?"":"px"))}),o.push(function(t){var e=[],n=t.get("fontSize"),r=t.getTextColor();r&&e.push("color:"+r),e.push("font:"+t.getFont());var i=at(t.get("lineHeight"),Math.round(3*n/2));n&&e.push("line-height:"+i+"px");var o=t.get("textShadowColor"),a=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return o&&a&&e.push("text-shadow:"+s+"px "+l+"px "+a+"px "+o),B(["decoration","align"],function(n){var r=t.get(n);r&&e.push("text-"+n+":"+r)}),e.join(";")}(d)),null!=p&&o.push("padding:"+vg(p).join("px ")+"px"),o.join(";")+";"}function Kq(t,e,n,r,i){var o=e&&e.painter;if(n){var a=o&&o.getViewportRoot();a&&function(t,e,n,r,i){oe(ie,e,r,i,!0)&&oe(t,n,ie[0],ie[1])}(t,a,n,r,i)}else{t[0]=r,t[1]=i;var s=o&&o.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var Jq=function(){function t(t,e){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,i.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var r=this._zr=t.getZr(),o=e.appendTo,a=o&&(Y(o)?document.querySelector(o):tt(o)?o:Z(o)&&o(t.getDom()));Kq(this._styleCoord,r,a,t.getWidth()/2,t.getHeight()/2),(a||t.getDom()).appendChild(n),this._api=t,this._container=a;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(t){if(t=t||window.event,!s._enterable){var e=r.handler;me(r.painter.getViewportRoot(),t,!0),e.dispatch("mousemove",t)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(t){if(!this._container){var e=this._api.getDom(),n=(o="position",(a=(i=e).currentStyle||document.defaultView&&document.defaultView.getComputedStyle(i))?o?a[o]:a:null),r=e.style;"absolute"!==r.position&&"absolute"!==n&&(r.position="relative")}var i,o,a,s=t.get("alwaysShowContent");s&&this._moveIfResized(),this._alwaysShowContent=s,this._enableDisplayTransition=t.get("displayTransition")&&t.get("transitionDuration")>0,this.el.className=t.get("className")||""},t.prototype.show=function(t,e){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=Zq+qq(t,!this._firstShow,this._longHide,this._enableDisplayTransition)+Yq(i[0],i[1],!0)+"border-color:"+Mg(e)+";"+(t.get("extraCssText")||"")+";pointer-events:"+(this._enterable?"auto":"none"):r.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(t,e,n,r,i){var o=this.el;if(null!=t){var a="";if(Y(i)&&"item"===n.get("trigger")&&!Gq(n)&&(a=function(t,e,n){if(!Y(n)||"inside"===n)return"";var r=t.get("backgroundColor"),i=t.get("borderWidth");e=Mg(e);var o,a,s="left"===(o=n)?"right":"right"===o?"left":"top"===o?"bottom":"top",l=Math.max(1.5*Math.round(i),6),u="",h=jq+":";N(["left","right"],s)>-1?(u+="top:50%",h+="translateY(-50%) rotate("+(a="left"===s?-225:-45)+"deg)"):(u+="left:50%",h+="translateX(-50%) rotate("+(a="top"===s?225:45)+"deg)");var c=a*Math.PI/180,d=l+i,p=d*Math.abs(Math.cos(c))+d*Math.abs(Math.sin(c)),f=e+" solid "+i+"px;";return'<div style="'+["position:absolute;width:"+l+"px;height:"+l+"px;z-index:-1;",(u+=";"+s+":-"+Math.round(100*((p-Math.SQRT2*i)/2+Math.SQRT2*i-(p-d)/2))/100+"px")+";"+h+";","border-bottom:"+f,"border-right:"+f,"background-color:"+r+";"].join("")+'"></div>'}(n,r,i)),Y(t))o.innerHTML=t+a;else if(t){o.innerHTML="",j(t)||(t=[t]);for(var s=0;s<t.length;s++)tt(t[s])&&t[s].parentNode!==o&&o.appendChild(t[s]);if(a&&o.childNodes.length){var l=document.createElement("div");l.innerHTML=a,o.appendChild(l)}}}else o.innerHTML=""},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el;return t?[t.offsetWidth,t.offsetHeight]:[0,0]},t.prototype.moveTo=function(t,e){if(this.el){var n=this._styleCoord;if(Kq(n,this._zr,this._container,t,e),null!=n[0]&&null!=n[1]){var r=this.el.style;B(Yq(n[0],n[1]),function(t){r[t[0]]=t[1]})}}},t.prototype._moveIfResized=function(){var t=this._styleCoord[2],e=this._styleCoord[3];this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},t.prototype.hide=function(){var t=this,e=this.el.style;this._enableDisplayTransition?(e.visibility="hidden",e.opacity="0"):e.display="none",i.transform3dSupported&&(e.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return t._longHide=!0},500)},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(W(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var t=this._zr;!function(t,e){function n(t){var e=t[re];e&&(e.clearMarkers&&e.clearMarkers(),delete t[re])}t&&n(t),e&&n(e)}(t&&t.painter&&t.painter.getViewportRoot(),this._container);var e=this.el;if(e){e.onmouseenter=e.onmousemove=e.onmouseleave=null;var n=e.parentNode;n&&n.removeChild(e)}this.el=this._container=null},t}(),Qq=Jq,$q=function(){function t(t){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=t.getZr(),nK(this._styleCoord,this._zr,t.getWidth()/2,t.getHeight()/2)}return t.prototype.update=function(t){var e=t.get("alwaysShowContent");e&&this._moveIfResized(),this._alwaysShowContent=e},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(t,e,n,r,i){var o=this;J(t)&&Na("Passing DOM nodes as content is not supported in richText tooltip!"),this.el&&this._zr.remove(this.el);var a=n.getModel("textStyle");this.el=new Qu({style:{rich:e.richTextStyles,text:t,lineHeight:22,borderWidth:1,borderColor:r,textShadowColor:a.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:ky(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),B(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(t){o.el.style[t]=n.get(t)}),B(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(t){o.el.style[t]=a.get(t)||0}),this._zr.add(this.el);var s=this;this.el.on("mouseover",function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0}),this.el.on("mouseout",function(){s._enterable&&s._show&&s.hideLater(s._hideDelay),s._inContent=!1})},t.prototype.setEnterable=function(t){this._enterable=t},t.prototype.getSize=function(){var t=this.el,e=this.el.getBoundingRect(),n=eK(t.style);return[e.width+n.left+n.right,e.height+n.top+n.bottom]},t.prototype.moveTo=function(t,e){var n=this.el;if(n){var r=this._styleCoord;nK(r,this._zr,t,e),t=r[0],e=r[1];var i=n.style,o=tK(i.borderWidth||0),a=eK(i);n.x=t+o+a.left,n.y=e+o+a.top,n.markRedraw()}},t.prototype._moveIfResized=function(){var t=this._styleCoord[2],e=this._styleCoord[3];this.moveTo(t*this._zr.getWidth(),e*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(t){!this._show||this._inContent&&this._enterable||this._alwaysShowContent||(t?(this._hideDelay=t,this._show=!1,this._hideTimeout=setTimeout(W(this.hide,this),t)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t}();function tK(t){return Math.max(0,t)}function eK(t){var e=tK(t.shadowBlur||0),n=tK(t.shadowOffsetX||0),r=tK(t.shadowOffsetY||0);return{left:tK(e-n),right:tK(e+n),top:tK(e-r),bottom:tK(e+r)}}function nK(t,e,n,r){t[0]=n,t[1]=r,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var rK=$q,iK=new Ru({shape:{x:-1,y:-1,width:2,height:2}}),oK=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(t,e){if(!i.node&&e.getDom()){var n,r=t.getComponent("tooltip"),o=this._renderMode="auto"===(n=r.get("renderMode"))?i.domSupported?"html":"richText":n||"html";this._tooltipContent="richText"===o?new rK(e):new Qq(e,{appendTo:r.get("appendToBody",!0)?"body":r.get("appendTo",!0)})}},n.prototype.render=function(t,e,n){if(!i.node&&n.getDom()){this.group.removeAll(),this._tooltipModel=t,this._ecModel=e,this._api=n;var r=this._tooltipContent;r.update(t),r.setEnterable(t.get("enterable")),this._initGlobalListener(),this._keepShow(),"richText"!==this._renderMode&&t.get("transitionDuration")?p_(this,"_updatePosition",50,"fixRate"):f_(this,"_updatePosition")}},n.prototype._initGlobalListener=function(){var t=this._tooltipModel.get("triggerOn");TX("itemTooltip",this._api,W(function(e,n,r){"none"!==t&&(t.indexOf(e)>=0?this._tryShow(n,r):"leave"===e&&this._hide(r))},this))},n.prototype._keepShow=function(){var t=this._tooltipModel,e=this._ecModel,n=this._api,r=t.get("triggerOn");if("axis"!==t.get("trigger")&&(this._lastDataByCoordSys=null,this._cbParamsList=null),null!=this._lastX&&null!=this._lastY&&"none"!==r&&"click"!==r){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&i.manuallyShowTip(t,e,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})})}},n.prototype.manuallyShowTip=function(t,e,n,r){if(r.from!==this.uid&&!i.node&&n.getDom()){var o=sK(r,n);this._ticket="";var a=r.dataByCoordSys,s=function(t,e,n){var r=es(t).queryOptionMap,i=r.keys()[0];if(!i||"series"===i)return;var o=is(e,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),a=o.models[0];if(!a)return;var s,l=n.getViewOfComponentModel(a);if(l.group.traverse(function(e){var n=$u(e).tooltipConfig;if(n&&n.name===t.name)return s=e,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}(r,e,n);if(s){var l=s.el.getBoundingRect().clone();l.applyTransform(s.el.transform),this._tryShow({offsetX:l.x+l.width/2,offsetY:l.y+l.height/2,target:s.el,position:r.position,positionDefault:"bottom"},o)}else if(r.tooltip&&null!=r.x&&null!=r.y){var u=iK;u.x=r.x,u.y=r.y,u.update(),$u(u).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:u},o)}else if(a)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:a,tooltipOption:r.tooltipOption},o);else if(null!=r.seriesIndex){if(this._manuallyAxisShowTip(t,e,n,r))return;var h=LX(r,e),c=h.point[0],d=h.point[1];null!=c&&null!=d&&this._tryShow({offsetX:c,offsetY:d,target:h.el,position:r.position,positionDefault:"bottom"},o)}else null!=r.x&&null!=r.y&&(n.dispatchAction({type:"updateAxisPointer",x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},o))}},n.prototype.manuallyHideTip=function(t,e,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,this._cbParamsList=null,r.from!==this.uid&&this._hide(sK(r,n))},n.prototype._manuallyAxisShowTip=function(t,e,n,r){var i=r.seriesIndex,o=r.dataIndex,a=e.getComponent("axisPointer").coordSysAxesInfo;if(null!=i&&null!=o&&null!=a){var s=e.getSeriesByIndex(i);if(s)if("axis"===aK([s.getData().getItemModel(o),s,(s.coordinateSystem||{}).model],this._tooltipModel).get("trigger"))return n.dispatchAction({type:"updateAxisPointer",seriesIndex:i,dataIndex:o,position:r.position}),!0}},n.prototype._tryShow=function(t,e){var n=t.target;if(this._tooltipModel){this._lastX=t.offsetX,this._lastY=t.offsetY;var r=t.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,t);else if(n){var i,o;if("legend"===$u(n).ssrType)return;this._lastDataByCoordSys=null,this._cbParamsList=null,ix(n,function(t){if(t.tooltipDisabled)return i=o=null,!0;i||o||(null!=$u(t).dataIndex?i=t:null!=$u(t).tooltipConfig&&(o=t))},!0),i?this._showSeriesItemTooltip(t,i,e):o?this._showComponentItemTooltip(t,o,e):this._hide(e)}else this._lastDataByCoordSys=null,this._cbParamsList=null,this._hide(e)}},n.prototype._showOrMove=function(t,e){var n=t.get("showDelay");e=W(e,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(e,n):e()},n.prototype._showAxisTooltip=function(t,e){var n=this._ecModel,r=this._tooltipModel,i=[e.offsetX,e.offsetY],o=aK([e.tooltipOption],r),a=this._renderMode,s=[],l=Cy("section",{blocks:[],noHeader:!0}),u=[],h=new zy;B(t,function(t){B(t.dataByAxis,function(t){var e=n.getComponent(t.axisDim+"Axis",t.axisIndex),i=t.value,o=e.axis,c=o.scale.parse(i);if(e&&null!=i){var d=sX(i,o,n,t.seriesDataIndices,t.valueLabelOpt),p=Cy("section",{header:d,noHeader:!ct(d),sortBlocks:!0,blocks:[]});l.blocks.push(p),B(t.seriesDataIndices,function(i){var o=n.getSeriesByIndex(i.seriesIndex),l=i.dataIndexInside,f=o.getDataParams(l);if(!(f.dataIndex<0)){f.axisDim=t.axisDim,f.axisIndex=t.axisIndex,f.axisType=t.axisType,f.axisId=t.axisId,f.axisValue=yT(e.axis,{value:c}),f.axisValueLabel=d,f.marker=h.makeTooltipMarker("item",Mg(f.color),a);var g=Vv(o.formatTooltip(l,!0,null)),m=g.frag;if(m){var v=aK([o],r).get("valueFormatter");p.blocks.push(v?L({valueFormatter:v},m):m)}g.text&&u.push(g.text),s.push(f)}})}})}),l.blocks.reverse(),u.reverse();var c=e.position,d=o.get("order"),p=Ey(l,h,a,d,n.get("useUTC"),o.get("textStyle"));p&&u.unshift(p);var f="richText"===a?"\n\n":"<br/>",g=u.join(f);this._showOrMove(o,function(){this._updateContentNotChangedOnAxis(t,s)?this._updatePosition(o,c,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(o,g,s,Math.random()+"",i[0],i[1],c,null,h)})},n.prototype._showSeriesItemTooltip=function(t,e,n){var r=this._ecModel,i=$u(e),o=i.seriesIndex,a=r.getSeriesByIndex(o),s=i.dataModel||a,l=i.dataIndex,u=i.dataType,h=s.getData(u),c=this._renderMode,d=t.positionDefault,p=aK([h.getItemModel(l),s,a&&(a.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),f=p.get("trigger");if(null==f||"item"===f){var g=s.getDataParams(l,u),m=new zy;g.marker=m.makeTooltipMarker("item",Mg(g.color),c);var v=Vv(s.formatTooltip(l,!1,u)),y=p.get("order"),_=p.get("valueFormatter"),x=v.frag,b=x?Ey(_?L({valueFormatter:_},x):x,m,c,y,r.get("useUTC"),p.get("textStyle")):v.text,w="item_"+s.name+"_"+l;this._showOrMove(p,function(){this._showTooltipContent(p,b,g,w,t.offsetX,t.offsetY,t.position,t.target,m)}),n({type:"showTip",dataIndexInside:l,dataIndex:h.getRawIndex(l),seriesIndex:o,from:this.uid})}},n.prototype._showComponentItemTooltip=function(t,e,n){var r="html"===this._renderMode,i=$u(e),o=i.tooltipConfig.option||{},a=o.encodeHTMLContent;if(Y(o)){o={content:o,formatter:o},a=!0}a&&r&&o.content&&((o=I(o)).content=ue(o.content));var s=[o],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&s.push(l),s.push({formatter:o.content});var u=t.positionDefault,h=aK(s,this._tooltipModel,u?{position:u}:null),c=h.get("content"),d=Math.random()+"",p=new zy;this._showOrMove(h,function(){var n=I(h.get("formatterParams")||{});this._showTooltipContent(h,c,n,d,t.offsetX,t.offsetY,t.position,e,p)}),n({type:"showTip",from:this.uid})},n.prototype._showTooltipContent=function(t,e,n,r,i,o,a,s,l){if(this._ticket="",t.get("showContent")&&t.get("show")){var u=this._tooltipContent;u.setEnterable(t.get("enterable"));var h=t.get("formatter");a=a||t.get("position");var c=e,d=this._getNearestPoint([i,o],n,t.get("trigger"),t.get("borderColor"),t.get("defaultBorderColor",!0)).color;if(h)if(Y(h)){var p=t.ecModel.get("useUTC"),f=j(n)?n[0]:n;c=h,f&&f.axisType&&f.axisType.indexOf("time")>=0&&(c=Qf(f.axisValue,c,p)),c=bg(c,n,!0)}else if(Z(h)){var g=W(function(e,r){e===this._ticket&&(u.setContent(r,l,t,d,a),this._updatePosition(t,a,i,o,u,n,s))},this);this._ticket=r,c=h(n,r,g)}else c=h;u.setContent(c,l,t,d,a),u.show(t,d),this._updatePosition(t,a,i,o,u,n,s)}},n.prototype._getNearestPoint=function(t,e,n,r,i){return"axis"===n||j(e)?{color:r||i}:j(e)?void 0:{color:r||e.color||e.borderColor}},n.prototype._updatePosition=function(t,e,n,r,i,o,a){var s=this._api.getWidth(),l=this._api.getHeight();e=e||t.get("position");var u=i.getSize(),h=t.get("align"),c=t.get("verticalAlign"),d=a&&a.getBoundingRect().clone();if(a&&d.applyTransform(a.transform),Z(e)&&(e=e([n,r],o,i.el,d,{viewSize:[s,l],contentSize:u.slice()})),j(e))n=Qo(e[0],s),r=Qo(e[1],l);else if(J(e)){var p=e;p.width=u[0],p.height=u[1];var f=Ug(p,{width:s,height:l});n=f.x,r=f.y,h=null,c=null}else if(Y(e)&&a){var g=function(t,e,n,r){var i=n[0],o=n[1],a=Math.ceil(Math.SQRT2*r)+8,s=0,l=0,u=e.width,h=e.height;switch(t){case"inside":s=e.x+u/2-i/2,l=e.y+h/2-o/2;break;case"top":s=e.x+u/2-i/2,l=e.y-o-a;break;case"bottom":s=e.x+u/2-i/2,l=e.y+h+a;break;case"left":s=e.x-i-a,l=e.y+h/2-o/2;break;case"right":s=e.x+u+a,l=e.y+h/2-o/2}return[s,l]}(e,d,u,t.get("borderWidth"));n=g[0],r=g[1]}else{g=function(t,e,n,r,i,o,a){var s=n.getSize(),l=s[0],u=s[1];null!=o&&(t+l+o+2>r?t-=l+o:t+=o);null!=a&&(e+u+a>i?e-=u+a:e+=a);return[t,e]}(n,r,i,s,l,h?null:20,c?null:20);n=g[0],r=g[1]}if(h&&(n-=lK(h)?u[0]/2:"right"===h?u[0]:0),c&&(r-=lK(c)?u[1]/2:"bottom"===c?u[1]:0),Gq(t)){g=function(t,e,n,r,i){var o=n.getSize(),a=o[0],s=o[1];return t=Math.min(t+a,r)-a,e=Math.min(e+s,i)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}(n,r,i,s,l);n=g[0],r=g[1]}i.moveTo(n,r)},n.prototype._updateContentNotChangedOnAxis=function(t,e){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===t.length;return i&&B(n,function(n,o){var a=n.dataByAxis||[],s=(t[o]||{}).dataByAxis||[];(i=i&&a.length===s.length)&&B(a,function(t,n){var o=s[n]||{},a=t.seriesDataIndices||[],l=o.seriesDataIndices||[];(i=i&&t.value===o.value&&t.axisType===o.axisType&&t.axisId===o.axisId&&a.length===l.length)&&B(a,function(t,e){var n=l[e];i=i&&t.seriesIndex===n.seriesIndex&&t.dataIndex===n.dataIndex}),r&&B(t.seriesDataIndices,function(t){var n=t.seriesIndex,o=e[n],a=r[n];o&&a&&a.data!==o.data&&(i=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=e,!!i},n.prototype._hide=function(t){this._lastDataByCoordSys=null,this._cbParamsList=null,t({type:"hideTip",from:this.uid})},n.prototype.dispose=function(t,e){!i.node&&e.getDom()&&(f_(this,"_updatePosition"),this._tooltipContent.dispose(),IX("itemTooltip",e),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},n.type="tooltip",n}(Qy);function aK(t,e,n){var r,i=e.ecModel;n?(r=new xf(n,i,i),r=new xf(e.option,r,i)):r=e;for(var o=t.length-1;o>=0;o--){var a=t[o];a&&(a instanceof xf&&(a=a.get("tooltip",!0)),Y(a)&&(a={formatter:a}),a&&(r=new xf(a,r,i)))}return r}function sK(t,e){return t.dispatchAction||W(e.dispatchAction,e)}function lK(t){return"center"===t||"middle"===t}var uK=oK;var hK=["rect","polygon","keep","clear"];function cK(t,e){var n=Ba(t?t.brush:[]);if(n.length){var r=[];B(n,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(r=r.concat(e))});var i=t&&t.toolbox;j(i)&&(i=i[0]),i||(i={feature:{}},t.toolbox=[i]);var o=i.feature||(i.feature={}),a=o.brush||(o.brush={}),s=a.type||(a.type=[]);s.push.apply(s,r),xs(s,function(t){return t+""},null),e&&!s.length&&s.push.apply(s,hK)}}var dK=B;function pK(t){if(t)for(var e in t)if(t.hasOwnProperty(e))return!0}function fK(t,e,n){var r={};return dK(e,function(e){var i,o=r[e]=((i=function(){}).prototype.__hidden=i.prototype,new i);dK(t[e],function(t,r){if(zz.isValidType(r)){var i={type:r,visual:t};n&&n(i,e),o[r]=new zz(i),"opacity"===r&&((i=I(i)).type="colorAlpha",o.__hidden.__alphaForOpacity=new zz(i))}})}),r}function gK(t,e,n){var r;B(n,function(t){e.hasOwnProperty(t)&&pK(e[t])&&(r=!0)}),r&&B(n,function(n){e.hasOwnProperty(n)&&pK(e[n])?t[n]=I(e[n]):delete t[n]})}var mK={lineX:vK(0),lineY:vK(1),rect:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])},rect:function(t,e,n){return t&&n.boundingRect.intersect(t)}},polygon:{point:function(t,e,n){return t&&n.boundingRect.contain(t[0],t[1])&&_M(n.range,t[0],t[1])},rect:function(t,e,n){var r=n.range;if(!t||r.length<=1)return!1;var i=t.x,o=t.y,a=t.width,s=t.height,l=r[0];return!!(_M(r,i,o)||_M(r,i+a,o)||_M(r,i,o+s)||_M(r,i+a,o+s)||ln.create(t).contain(l[0],l[1])||bp(i,o,i+a,o,r)||bp(i,o,i,o+s,r)||bp(i+a,o,i+a,o+s,r)||bp(i,o+s,i+a,o+s,r))||void 0}}};function vK(t){var e=["x","y"],n=["width","height"];return{point:function(e,n,r){if(e){var i=r.range;return yK(e[t],i)}},rect:function(r,i,o){if(r){var a=o.range,s=[r[e[t]],r[e[t]]+r[n[t]]];return s[1]<s[0]&&s.reverse(),yK(s[0],a)||yK(s[1],a)||yK(a[0],s)||yK(a[1],s)}}}}function yK(t,e){return e[0]<=t&&t<=e[1]}var _K=["inBrush","outOfBrush"],xK="__ecBrushSelect",bK="__ecInBrushSelectEvent";function wK(t){t.eachComponent({mainType:"brush"},function(e){(e.brushTargetManager=new Pq(e.option,t)).setInputRanges(e.areas,t)})}var SK=Is(function(t,e,n){var r,i,o=[];t.eachComponent({mainType:"brush"},function(t){n&&"takeGlobalCursor"===n.type&&t.setBrushOption("brush"===n.key?n.brushOption:{brushType:!1})}),wK(t),t.eachComponent({mainType:"brush"},function(e,n){var a={brushId:e.id,brushIndex:n,brushName:e.name,areas:I(e.areas),selected:[]};o.push(a);var s=e.option,l=s.brushLink,u=[],h=[],c=[],d=!1;n||(r=s.throttleType,i=s.throttleDelay);var p=V(e.areas,function(t){var e=CK[t.brushType],n=E({boundingRect:e?e(t):void 0},t);return n.selectors=function(t){var e=t.brushType,n={point:function(r){return mK[e].point(r,n,t)},rect:function(r){return mK[e].rect(r,n,t)}};return n}(n),n}),f=fK(e.option,_K,function(t){t.mappingMethod="fixed"});function g(t){return"all"===l||!!u[t]}function m(t){return!!t.length}j(l)&&B(l,function(t){u[t]=1}),t.eachSeries(function(n,r){var i=c[r]=[];"parallel"===n.subType?function(t,e){var n=t.coordinateSystem;d=d||n.hasAxisBrushed(),g(e)&&n.eachActiveState(t.getData(),function(t,e){"active"===t&&(h[e]=1)})}(n,r):function(n,r,i){if(!n.brushSelector||function(t,e){var n=t.option.seriesIndex;return null!=n&&"all"!==n&&(j(n)?N(n,e)<0:e!==n)}(e,r))return;if(B(p,function(r){e.brushTargetManager.controlSeries(r,n,t)&&i.push(r),d=d||m(i)}),g(r)&&m(i)){var o=n.getData();o.each(function(t){MK(n,i,o,t)&&(h[t]=1)})}}(n,r,i)}),t.eachSeries(function(t,e){var n={seriesId:t.id,seriesIndex:e,seriesName:t.name,dataIndex:[]};a.selected.push(n);var r=c[e],i=t.getData(),o=g(e)?function(t){return h[t]?(n.dataIndex.push(i.getRawIndex(t)),"inBrush"):"outOfBrush"}:function(e){return MK(t,r,i,e)?(n.dataIndex.push(i.getRawIndex(e)),"inBrush"):"outOfBrush"};(g(e)?d:m(r))&&function(t,e,n,r,i,o){var a,s={};function l(t){return $_(n,a,t)}function u(t,e){ex(n,a,t,e)}function h(t,h){a=null==o?t:h;var c=n.getRawDataItem(a);if(!c||!1!==c.visualMap)for(var d=r.call(i,t),p=e[d],f=s[d],g=0,m=f.length;g<m;g++){var v=f[g];p[v]&&p[v].applyVisual(t,l,u)}}B(t,function(t){var n=zz.prepareVisualTypes(e[t]);s[t]=n}),null==o?n.each(h):n.each([o],h)}(_K,f,i,o)})}),function(t,e,n,r,i){if(!i)return;var o=t.getZr();if(o[bK])return;o[xK]||(o[xK]=TK);var a=p_(o,xK,n,e);a(t,r)}(e,r,i,o,n)});function TK(t,e){if(!t.isDisposed()){var n=t.getZr();n[bK]=!0,t.dispatchAction({type:"brushSelect",batch:e}),n[bK]=!1}}function MK(t,e,n,r){for(var i=0,o=e.length;i<o;i++){var a=e[i];if(t.brushSelector(r,n,a.selectors,a))return!0}}var CK={rect:function(t){return IK(t.range)},polygon:function(t){for(var e,n=t.range,r=0,i=n.length;r<i;r++){e=e||[cs(),cs()];var o=n[r];o[0]<e[0][0]&&(e[0][0]=o[0]),o[0]>e[0][1]&&(e[0][1]=o[0]),o[1]<e[1][0]&&(e[1][0]=o[1]),o[1]>e[1][1]&&(e[1][1]=o[1])}return e&&IK(e)}};function IK(t){return new ln(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var AK=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new YF(e.getZr())).on("brush",W(this._onBrush,this)).mount()},n.prototype.render=function(t,e,n,r){this.model=t,this._updateController(t,e,n,r)},n.prototype.updateTransform=function(t,e,n,r){wK(e),this._updateController(t,e,n,r)},n.prototype.updateVisual=function(t,e,n,r){this.updateTransform(t,e,n,r)},n.prototype.updateView=function(t,e,n,r){this._updateController(t,e,n,r)},n.prototype._updateController=function(t,e,n,r){(!r||r.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(n)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},n.prototype.dispose=function(){this._brushController.dispose()},n.prototype._onBrush=function(t){var e=this.model.id,n=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:e,areas:I(n),$from:e}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:e,areas:I(n),$from:e})},n.type="brush",n}(Qy),DK=AK,LK=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.areas=[],e.brushOption={},e}return e(n,t),n.prototype.optionUpdated=function(t,e){var n=this.option;!e&&gK(n,t,["inBrush","outOfBrush"]);var r=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:this.option.defaultOutOfBrushColor},r.hasOwnProperty("liftZ")||(r.liftZ=5)},n.prototype.setAreas=function(t){ht(j(t)),B(t,function(t){ht(t.brushType,"Illegal areas")}),t&&(this.areas=V(t,function(t){return PK(this.option,t)},this))},n.prototype.setBrushOption=function(t){this.brushOption=PK(this.option,t),this.brushType=this.brushOption.brushType},n.type="brush",n.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],n.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:om.color.backgroundTint,borderColor:om.color.borderTint},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:om.color.disabled},n}(tm);function PK(t,e){return A({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new xf(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}var EK=LK,OK=["rect","polygon","lineX","lineY","keep","clear"],NK=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.render=function(t,e,n){var r,i,o;e.eachComponent({mainType:"brush"},function(t){r=t.brushType,i=t.brushOption.brushMode||"single",o=o||!!t.areas.length}),this._brushType=r,this._brushMode=i,B(t.get("type",!0),function(e){t.setIconStatus(e,("keep"===e?"multiple"===i:"clear"===e?o:e===r)?"emphasis":"normal")})},n.prototype.updateView=function(t,e,n){this.render(t,e,n)},n.prototype.getIcons=function(){var t=this.model,e=t.get("icon",!0),n={};return B(t.get("type",!0),function(t){e[t]&&(n[t]=e[t])}),n},n.prototype.onclick=function(t,e,n){var r=this._brushType,i=this._brushMode;"clear"===n?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===n?r:r!==n&&n,brushMode:"keep"===n?"multiple"===i?"single":"multiple":i}})},n.getDefaultOption=function(t){return{show:!0,type:OK.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])}},n}(GY),RK=NK;var kK=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.type="title",n.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:"center",top:om.size.m,backgroundColor:om.color.transparent,borderColor:om.color.primary,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:om.color.primary},subtextStyle:{fontSize:12,color:om.color.quaternary}},n}(tm),zK=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){if(this.group.removeAll(),t.get("show")){var r=this.group,i=t.getModel("textStyle"),o=t.getModel("subtextStyle"),a=t.get("textAlign"),s=at(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Qu({style:Yp(i,{text:t.get("text"),fill:i.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Qu({style:Yp(o,{text:h,fill:o.getTextColor(),y:u.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),p=t.get("sublink"),f=t.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",function(){Cg(d,"_"+t.get("target"))}),p&&c.on("click",function(){Cg(p,"_"+t.get("subtarget"))}),$u(l).eventData=$u(c).eventData=f?{componentType:"title",componentIndex:t.componentIndex}:null,r.add(l),h&&r.add(c);var g=r.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=Ug(m,jg(t,n).refContainer,t.get("padding"));a||("middle"===(a=t.get("left")||t.get("right"))&&(a="center"),"right"===a?v.x+=v.width:"center"===a&&(v.x+=v.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),r.x=v.x,r.y=v.y,r.markRedraw();var y={align:a,verticalAlign:s};l.setStyle(y),c.setStyle(y),g=r.getBoundingRect();var _=v.margin,x=t.getItemStyle(["color","opacity"]);x.fill=t.get("backgroundColor");var b=new Ru({shape:{x:g.x-_[3],y:g.y-_[0],width:g.width+_[1]+_[3],height:g.height+_[0]+_[2],r:t.get("borderRadius")},style:x,subPixelOptimize:!0,silent:!0});r.add(b)}},n.type="title",n}(Qy);var BK=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode="box",e}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),this._initData()},n.prototype.mergeOption=function(e){t.prototype.mergeOption.apply(this,arguments),this._initData()},n.prototype.setCurrentIndex=function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(t>=e&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},n.prototype.getCurrentIndex=function(){return this.option.currentIndex},n.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},n.prototype.setPlayState=function(t){this.option.autoPlay=!!t},n.prototype.getPlayState=function(){return!!this.option.autoPlay},n.prototype._initData=function(){var t,e=this.option,n=e.data||[],r=e.axisType,i=this._names=[];"category"===r?(t=[],B(n,function(e,n){var r,o=ja(Ga(e),"");J(e)?(r=I(e)).value=n:r=n,t.push(r),i.push(o)})):t=n;var o={category:"ordinal",time:"time",value:"number"}[r]||"number";(this._data=new oS([{name:"value",type:o}],this)).initData(t,i)},n.prototype.getData=function(){return this._data},n.prototype.getCategories=function(){if("category"===this.get("axisType"))return this._names.slice()},n.type="timeline",n.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:om.size.m,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:om.color.secondary},data:[]},n}(tm),VK=BK,FK=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="timeline.slider",n.defaultOption=Sf(VK.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:om.color.border,borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:om.color.accent10},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:om.color.tertiary},itemStyle:{color:om.color.accent20,borderWidth:0},checkpointStyle:{symbol:"circle",symbolSize:15,color:om.color.accent50,borderColor:om.color.accent50,borderWidth:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0, 0, 0, 0)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z",stopIcon:"path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z",nextIcon:"path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z",prevIcon:"path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z",prevBtnSize:18,nextBtnSize:18,color:om.color.accent50,borderColor:om.color.accent50,borderWidth:0},emphasis:{label:{show:!0,color:om.color.accent60},itemStyle:{color:om.color.accent60,borderColor:om.color.accent60},controlStyle:{color:om.color.accent70,borderColor:om.color.accent70}},progress:{lineStyle:{color:om.color.accent30},itemStyle:{color:om.color.accent40}},data:[]}),n}(VK);k(FK,Bv.prototype);var GK=FK,HK=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="timeline",n}(Qy),UK=HK,WK=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r)||this;return o.type=i||"value",o}return e(n,t),n.prototype.getLabelModel=function(){return this.model.getModel("label")},n.prototype.isHorizontal=function(){return"horizontal"===this.model.get("orient")},n}(rC),XK=WK,jK=Math.PI,ZK=Qa(),YK=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(t,e){this.api=e},n.prototype.render=function(t,e,n){if(this.model=t,this.api=n,this.ecModel=e,this.group.removeAll(),t.get("show",!0)){var r=this._layout(t,n),i=this._createGroup("_mainGroup"),o=this._createGroup("_labelGroup"),a=this._axis=this._createAxis(r,t);t.formatTooltip=function(t){return Cy("nameValue",{noName:!0,value:a.scale.getLabel({value:t})})},B(["AxisLine","AxisTick","Control","CurrentPointer"],function(e){this["_render"+e](r,i,a,t)},this),this._renderAxisLabel(r,o,a,t),this._position(r,t)}this._doPlayStop(),this._updateTicksStatus()},n.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},n.prototype.dispose=function(){this._clearTimer()},n.prototype._layout=function(t,e){var n,r,i,o,a=t.get(["label","position"]),s=t.get("orient"),l=function(t,e){return Ug(t.getBoxLayoutParams(),jg(t,e).refContainer,t.get("padding"))}(t,e),u={horizontal:"center",vertical:(n=null==a||"auto"===a?"horizontal"===s?l.y+l.height/2<e.getHeight()/2?"-":"+":l.x+l.width/2<e.getWidth()/2?"+":"-":Y(a)?{horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[s][a]:a)>=0||"+"===n?"left":"right"},h={horizontal:n>=0||"+"===n?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:jK/2},d="vertical"===s?l.height:l.width,p=t.getModel("controlStyle"),f=p.get("show",!0),g=f?p.get("itemSize"):0,m=f?p.get("itemGap"):0,v=g+m,y=t.get(["label","rotate"])||0;y=y*jK/180;var _=p.get("position",!0),x=f&&p.get("showPlayBtn",!0),b=f&&p.get("showPrevBtn",!0),w=f&&p.get("showNextBtn",!0),S=0,T=d;"left"===_||"bottom"===_?(x&&(r=[0,0],S+=v),b&&(i=[S,0],S+=v),w&&(o=[T-g,0],T-=v)):(x&&(r=[T-g,0],T-=v),b&&(i=[0,0],S+=v),w&&(o=[T-g,0],T-=v));var M=[S,T];return t.get("inverse")&&M.reverse(),{viewRect:l,mainLength:d,orient:s,rotation:c[s],labelRotation:y,labelPosOpt:n,labelAlign:t.get(["label","align"])||u[s],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||h[s],playPosition:r,prevBtnPosition:i,nextBtnPosition:o,axisExtent:M,controlSize:g,controlGap:m}},n.prototype._position=function(t,e){var n=this._mainGroup,r=this._labelGroup,i=t.viewRect;if("vertical"===t.orient){var o=[1,0,0,1,0,0],a=i.x,s=i.y+i.height;Ae(o,o,[-a,-s]),De(o,o,-jK/2),Ae(o,o,[a,s]),(i=i.clone()).applyTransform(o)}var l=m(i),u=m(n.getBoundingRect()),h=m(r.getBoundingRect()),c=[n.x,n.y],d=[r.x,r.y];d[0]=c[0]=l[0][0];var p,f=t.labelPosOpt;null==f||Y(f)?(v(c,u,l,1,p="+"===f?0:1),v(d,h,l,1,1-p)):(v(c,u,l,1,p=f>=0?0:1),d[1]=c[1]+f);function g(t){t.originX=l[0][0]-t.x,t.originY=l[1][0]-t.y}function m(t){return[[t.x,t.x+t.width],[t.y,t.y+t.height]]}function v(t,e,n,r,i){t[r]+=n[r][i]-e[r][i]}n.setPosition(c),r.setPosition(d),n.rotation=r.rotation=t.rotation,g(n),g(r)},n.prototype._createAxis=function(t,e){var n=e.getData(),r=e.get("axisType")||e.get("type");"category"!==r&&"time"!==r&&(r="value");var i=pT(e,r,!1);i.getTicks=function(){return n.mapArray(["value"],function(t){return{value:t}})};var o=n.getDataExtent("value");i.setExtent(o[0],o[1]),lM(i,{fixMinMax:[!0,!0]});var a=new XK("value",i,t.axisExtent,r);return a.model=e,a},n.prototype._createGroup=function(t){var e=this[t]=new Do;return this.group.add(e),e},n.prototype._renderAxisLine=function(t,e,n,r){var i=n.getExtent();if(r.get(["lineStyle","show"])){var o=new fd({shape:{x1:i[0],y1:0,x2:i[1],y2:0},style:L({lineCap:"round"},r.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});e.add(o);var a=this._progressLine=new fd({shape:{x1:i[0],x2:this._currentPointer?this._currentPointer.x:i[0],y1:0,y2:0},style:E({lineCap:"round",lineWidth:o.style.lineWidth},r.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});e.add(a)}},n.prototype._renderAxisTick=function(t,e,n,r){var i=this,o=r.getData(),a=n.scale.getTicks();this._tickSymbols=[],B(a,function(t){var a=n.dataToCoord(t.value),s=o.getItemModel(t.value),l=s.getModel("itemStyle"),u=s.getModel(["emphasis","itemStyle"]),h=s.getModel(["progress","itemStyle"]),c={x:a,y:0,onclick:W(i._changeTimeline,i,t.value)},d=qK(s,l,e,c);d.ensureState("emphasis").style=u.getItemStyle(),d.ensureState("progress").style=h.getItemStyle(),rc(d);var p=$u(d);s.get("tooltip")?(p.dataIndex=t.value,p.dataModel=r):p.dataIndex=p.dataModel=null,i._tickSymbols.push(d)})},n.prototype._renderAxisLabel=function(t,e,n,r){var i=this;if(n.getLabelModel().get("show")){var o=r.getData(),a=n.getViewLabels();this._tickLabels=[],B(a,function(r){if(!r.tick.offInterval){var a=r.tick.value,s=o.getItemModel(a),l=s.getModel("label"),u=s.getModel(["emphasis","label"]),h=s.getModel(["progress","label"]),c=n.dataToCoord(a),d=new Qu({x:c,y:0,rotation:t.labelRotation-t.rotation,onclick:W(i._changeTimeline,i,a),silent:!1,style:Yp(l,{text:r.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});d.ensureState("emphasis").style=Yp(u),d.ensureState("progress").style=Yp(h),e.add(d),rc(d),ZK(d).dataIndex=a,i._tickLabels.push(d)}})}},n.prototype._renderControl=function(t,e,n,r){var i=t.controlSize,o=t.rotation,a=r.getModel("controlStyle").getItemStyle(),s=r.getModel(["emphasis","controlStyle"]).getItemStyle(),l=r.getPlayState(),u=r.get("inverse",!0);function h(t,n,l,u){if(t){var h=ho(at(r.get(["controlStyle",n+"BtnSize"]),i),i),c=function(t,e,n,r){var i=r.style,o=xp(t.get(["controlStyle",e]),r||{},new ln(n[0],n[1],n[2],n[3]));i&&o.setStyle(i);return o}(r,n+"Icon",[0,-h/2,h,h],{x:t[0],y:t[1],originX:i/2,originY:0,rotation:u?-o:0,rectHover:!0,style:a,onclick:l});c.ensureState("emphasis").style=s,e.add(c),rc(c)}}h(t.nextBtnPosition,"next",W(this._changeTimeline,this,u?"-":"+")),h(t.prevBtnPosition,"prev",W(this._changeTimeline,this,u?"+":"-")),h(t.playPosition,l?"stop":"play",W(this._handlePlayClick,this,!l),!0)},n.prototype._renderCurrentPointer=function(t,e,n,r){var i=r.getData(),o=r.getCurrentIndex(),a=i.getItemModel(o).getModel("checkpointStyle"),s=this,l={onCreate:function(t){t.draggable=!0,t.drift=W(s._handlePointerDrag,s),t.ondragend=W(s._handlePointerDragend,s),KK(t,s._progressLine,o,n,r,!0)},onUpdate:function(t){KK(t,s._progressLine,o,n,r)}};this._currentPointer=qK(a,a,this._mainGroup,{},this._currentPointer,l)},n.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},n.prototype._handlePointerDrag=function(t,e,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},n.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},n.prototype._pointerChangeTimeline=function(t,e){var n=this._toAxisCoord(t)[0],r=ra(this._axis.getExtent().slice());n>r[1]&&(n=r[1]),n<r[0]&&(n=r[0]),this._currentPointer.x=n,this._currentPointer.markRedraw();var i=this._progressLine;i&&(i.shape.x2=n,i.dirty());var o=this._findNearestTick(n),a=this.model;(e||o!==a.getCurrentIndex()&&a.get("realtime"))&&this._changeTimeline(o)},n.prototype._doPlayStop=function(){var t=this;this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(function(){var e=t.model;t._changeTimeline(e.getCurrentIndex()+(e.get("rewind",!0)?-1:1))},this.model.get("playInterval")))},n.prototype._toAxisCoord=function(t){return fp(t,this._mainGroup.getLocalTransform(),!0)},n.prototype._findNearestTick=function(t){var e,n=this.model.getData(),r=1/0,i=this._axis;return n.each(["value"],function(n,o){var a=i.dataToCoord(n),s=Math.abs(a-t);s<r&&(r=s,e=o)}),e},n.prototype._clearTimer=function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},n.prototype._changeTimeline=function(t){var e=this.model.getCurrentIndex();"+"===t?t=e+1:"-"===t&&(t=e-1),this.api.dispatchAction({type:"timelineChange",currentIndex:t,from:this.uid})},n.prototype._updateTicksStatus=function(){var t=this.model.getCurrentIndex(),e=this._tickSymbols,n=this._tickLabels;if(e)for(var r=0;r<e.length;r++)e&&e[r]&&e[r].toggleState("progress",r<t);if(n)for(r=0;r<n.length;r++)n&&n[r]&&n[r].toggleState("progress",ZK(n[r]).dataIndex<=t)},n.type="timeline.slider",n}(UK);function qK(t,e,n,r,i,o){var a=e.get("color");i?(i.setColor(a),n.add(i),o&&o.onUpdate(i)):((i=Cx(t.get("symbol"),-1,-1,2,2,a)).setStyle("strokeNoScale",!0),n.add(i),o&&o.onCreate(i));var s=e.getItemStyle(["color"]);i.setStyle(s),r=A({rectHover:!0,z2:100},r,!0);var l=Ix(t.get("symbolSize"));r.scaleX=l[0]/2,r.scaleY=l[1]/2;var u=Ax(t.get("symbolOffset"),l);u&&(r.x=(r.x||0)+u[0],r.y=(r.y||0)+u[1]);var h=t.get("symbolRotate");return r.rotation=(h||0)*Math.PI/180||0,i.attr(r),i.updateTransform(),i}function KK(t,e,n,r,i,o){if(!t.dragging){var a=i.getModel("checkpointStyle"),s=r.dataToCoord(i.getData().get("value",n));if(o||!a.get("animation",!0))t.attr({x:s,y:0}),e&&e.attr({shape:{x2:s}});else{var l={duration:a.get("animationDuration",!0),easing:a.get("animationEasing",!0)};t.stopAnimation(null,!0),t.animateTo({x:s,y:0},l),e&&e.animateTo({shape:{x2:s}},l)}}}var JK=YK;function QK(t){var e=t&&t.timeline;j(e)||(e=e?[e]:[]),B(e,function(t){t&&function(t){var e=t.type,n={number:"value",time:"time"};n[e]&&(t.axisType=n[e],delete t.type);if($K(t),tJ(t,"controlPosition")){var r=t.controlStyle||(t.controlStyle={});tJ(r,"position")||(r.position=t.controlPosition),"none"!==r.position||tJ(r,"show")||(r.show=!1,delete r.position),delete t.controlPosition}B(t.data||[],function(t){J(t)&&!j(t)&&(!tJ(t,"value")&&tJ(t,"name")&&(t.value=t.name),$K(t))})}(t)})}function $K(t){var e=t.itemStyle||(t.itemStyle={}),n=e.emphasis||(e.emphasis={}),r=t.label||t.label||{},i=r.normal||(r.normal={}),o={normal:1,emphasis:1};B(r,function(t,e){o[e]||tJ(i,e)||(i[e]=t)}),n.label&&!tJ(r,"emphasis")&&(r.emphasis=n.label,delete n.label)}function tJ(t,e){return t.hasOwnProperty(e)}function eJ(t,e){if(!t)return!1;for(var n=j(t)?t:[t],r=0;r<n.length;r++)if(n[r]&&n[r][e])return!0;return!1}function nJ(t){Va(t,"label",["show"])}var rJ=Qa(),iJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.createdBySelf=!1,e.preventAutoZ=!0,e}return e(n,t),n.prototype.init=function(t,e,n){if("marker"===this.type)throw new Error("Marker component is abstract component. Use markLine, markPoint, markArea instead.");this.mergeDefaultAndTheme(t,n),this._mergeOption(t,n,!1,!0)},n.prototype.isAnimationEnabled=function(){if(i.node)return!1;var t=this.__hostSeries;return this.getShallow("animation")&&t&&t.isAnimationEnabled()},n.prototype.mergeOption=function(t,e){this._mergeOption(t,e,!1,!1)},n.prototype._mergeOption=function(t,e,n,r){var i=this.mainType;n||e.eachSeries(function(t){var n=t.get(this.mainType,!0),o=rJ(t)[i];n&&n.data?(o?o._mergeOption(n,e,!0):(r&&nJ(n),B(n.data,function(t){t instanceof Array?(nJ(t[0]),nJ(t[1])):nJ(t)}),L(o=this.createMarkerModelFromSeries(n,this,e),{mainType:this.mainType,seriesIndex:t.seriesIndex,name:t.name,createdBySelf:!0}),o.__hostSeries=t),rJ(t)[i]=o):rJ(t)[i]=null},this)},n.prototype.formatTooltip=function(t,e,n){var r=this.getData(),i=this.getRawValue(t),o=r.getName(t);return Cy("section",{header:this.name,blocks:[Cy("nameValue",{name:o,value:i,noName:!o,noValue:null==i})]})},n.prototype.getData=function(){return this._data},n.prototype.setData=function(t){this._data=t},n.prototype.getDataParams=function(t,e){var n=Bv.prototype.getDataParams.call(this,t,e),r=this.__hostSeries;return r&&(n.seriesId=r.id,n.seriesName=r.name,n.seriesType=r.subType),n},n.getMarkerModelFromSeries=function(t,e){return rJ(t)[e]},n.type="marker",n.dependencies=["series","grid","polar","geo"],n}(tm);k(iJ,Bv.prototype);var oJ=iJ,aJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.createMarkerModelFromSeries=function(t,e,r){return new n(t,e,r)},n.type="markPoint",n.defaultOption={z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},n}(oJ),sJ=aJ;function lJ(t){return!(isNaN(parseFloat(t.x))&&isNaN(parseFloat(t.y)))}function uJ(t,e,n,r,i,o,a){var s=[],l=pS(e,i)?e.getCalculationInfo("stackResultDimension"):i,u=gJ(e,l,t),h=e.hostModel.indicesOfNearest(n,l,u)[0];s[o]=e.get(r,h),s[a]=e.get(l,h);var c=e.get(i,h),d=ia(e.get(i,h));return(d=Math.min(d,20))>=0&&(s[a]=+s[a].toFixed(d)),[s,c]}var hJ={min:X(uJ,"min"),max:X(uJ,"max"),average:X(uJ,"average"),median:X(uJ,"median")};function cJ(t,e){if(e){var n=t.getData(),r=t.coordinateSystem,i=r&&r.dimensions;if(!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!j(e.coord)&&j(i)){var o=dJ(e,n,r,t);if((e=I(e)).type&&hJ[e.type]&&o.baseAxis&&o.valueAxis){var a=N(i,o.baseAxis.dim),s=N(i,o.valueAxis.dim),l=hJ[e.type](n,o.valueAxis.dim,o.baseDataDim,o.valueDataDim,a,s);e.coord=l[0],e.value=l[1]}else e.coord=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis]}if(null!=e.coord&&j(i))for(var u=e.coord,h=0;h<2;h++)hJ[u[h]]&&(u[h]=gJ(n,n.mapDimension(i[h]),u[h]));else{e.coord=[];var c=t.getBaseAxis();if(c&&e.type&&hJ[e.type]){var d=r.getOtherAxis(c);d&&(e.value=gJ(n,n.mapDimension(d.dim),e.type))}}return e}}function dJ(t,e,n,r){var i={};return null!=t.valueIndex||null!=t.valueDim?(i.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,i.valueAxis=n.getAxis(function(t,e){var n=t.getData().getDimensionInfo(e);return n&&n.coordDim}(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function pJ(t,e){return!(t&&t.containData&&e.coord&&!lJ(e))||t.containData(e.coord)}function fJ(t,e){return t?function(t,n,r,i){return Uv(i<2?t.coord&&t.coord[i]:t.value,e[i])}:function(t,n,r,i){return Uv(t.value,e[i])}}function gJ(t,e,n){if("average"===n){var r=0,i=0;return t.each(e,function(t,e){isNaN(t)||(r+=t,i++)}),r/i}return"median"===n?t.getMedian(e):t.getDataExtent(e)["max"===n?1:0]}var mJ=Qa(),vJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.init=function(){this.markerGroupMap=yt()},n.prototype.render=function(t,e,n){var r=this,i=this.markerGroupMap;i.each(function(t){mJ(t).keep=!1}),e.eachSeries(function(t){var i=oJ.getMarkerModelFromSeries(t,r.type);i&&r.renderSeries(t,i,e,n)}),i.each(function(t){!mJ(t).keep&&r.group.remove(t.group)}),function(t,e,n){t.eachSeries(function(t){var r=oJ.getMarkerModelFromSeries(t,n),i=e.get(t.id);if(r&&i&&i.group){var o=Np(r),a=o.z,s=o.zlevel;kp(i.group,a,s)}})}(e,i,this.type)},n.prototype.markKeep=function(t){mJ(t).keep=!0},n.prototype.toggleBlurSeries=function(t,e){var n=this;B(t,function(t){var r=oJ.getMarkerModelFromSeries(t,n.type);r&&r.getData().eachItemGraphicEl(function(t){t&&(e?jh(t):Zh(t))})})},n.type="marker",n}(Qy);var yJ=vJ;function _J(t,e,n){var r=e.coordinateSystem,i=n.getWidth(),o=n.getHeight(),a=r&&r.getArea&&r.getArea();t.each(function(n){var s,l=t.getItemModel(n),u="coordinate"===l.get("relativeTo"),h=u?a?a.width:0:i,c=u?a?a.height:0:o,d=u&&a?a.x:0,p=u&&a?a.y:0,f=Qo(l.get("x"),h)+d,g=Qo(l.get("y"),c)+p;if(isNaN(f)||isNaN(g)){if(e.getMarkerPosition)s=e.getMarkerPosition(t.getValues(t.dimensions,n));else if(r){var m=t.get(r.dimensions[0],n),v=t.get(r.dimensions[1],n);s=r.dataToPoint([m,v])}}else s=[f,g];isNaN(f)||(s[0]=f),isNaN(g)||(s[1]=g),t.setItemLayout(n,s)})}var xJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.updateTransform=function(t,e,n){e.eachSeries(function(t){var e=oJ.getMarkerModelFromSeries(t,"markPoint");e&&(_J(e.getData(),t,n),this.markerGroupMap.get(t.id).updateLayout())},this)},n.prototype.renderSeries=function(t,e,n,r){var i=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new qA),u=function(t,e,n){var r;r=t?V(t&&t.dimensions,function(t){var n=e.getData();return L(L({},n.getDimensionInfo(n.mapDimension(t))||{}),{name:t,ordinalMeta:null})}):[{name:"value",type:"float"}];var i=new oS(r,n),o=V(n.get("data"),X(cJ,e));t&&(o=G(o,X(pJ,t)));var a=fJ(!!t,r);return i.initData(o,null,a),i}(i,t,e);e.setData(u),_J(e.getData(),t,r),u.each(function(t){var n=u.getItemModel(t),r=n.getShallow("symbol"),i=n.getShallow("symbolSize"),o=n.getShallow("symbolRotate"),s=n.getShallow("symbolOffset"),l=n.getShallow("symbolKeepAspect");if(Z(r)||Z(i)||Z(o)||Z(s)){var h=e.getRawValue(t),c=e.getDataParams(t);Z(r)&&(r=r(h,c)),Z(i)&&(i=i(h,c)),Z(o)&&(o=o(h,c)),Z(s)&&(s=s(h,c))}var d=n.getModel("itemStyle").getItemStyle(),p=n.get("z2"),f=tx(a,"color");d.fill||(d.fill=f),u.setItemVisual(t,{z2:at(p,0),symbol:r,symbolSize:i,symbolRotate:o,symbolOffset:s,symbolKeepAspect:l,style:d})}),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl(function(t){t.traverse(function(t){$u(t).dataModel=e})}),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},n.type="markPoint",n}(yJ);var bJ=xJ;var wJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.createMarkerModelFromSeries=function(t,e,r){return new n(t,e,r)},n.type="markLine",n.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},n}(oJ),SJ=wJ,TJ=Qa(),MJ=function(t,e,n,r){var i,o=t.getData();if(j(r))i=r;else{var a=r.type;if("min"===a||"max"===a||"average"===a||"median"===a||null!=r.xAxis||null!=r.yAxis){var s=void 0,l=void 0;if(null!=r.yAxis||null!=r.xAxis)s=e.getAxis(null!=r.yAxis?"y":"x"),l=ot(r.yAxis,r.xAxis);else{var u=dJ(r,o,e,t);s=u.valueAxis,l=gJ(o,fS(o,u.valueDataDim),a)}var h="x"===s.dim?0:1,c=1-h,d=I(r),p={coord:[]};d.type=null,d.coord=[],d.coord[c]=-1/0,p.coord[c]=1/0;var f=n.get("precision");f>=0&&K(l)&&(l=+l.toFixed(Math.min(f,20))),d.coord[h]=p.coord[h]=l,i=[d,p,{type:a,valueIndex:r.valueIndex,value:l}]}else C("Invalid markLine data."),i=[]}var g=[cJ(t,i[0]),cJ(t,i[1]),L({},i[2])];return g[2].type=g[2].type||null,A(g[2],g[0]),A(g[2],g[1]),g};function CJ(t){return!isNaN(t)&&!isFinite(t)}function IJ(t,e,n,r){var i=1-t,o=r.dimensions[t];return CJ(e[i])&&CJ(n[i])&&e[t]===n[t]&&r.getAxis(o).containData(e[t])}function AJ(t,e){if("cartesian2d"===t.type){var n=e[0].coord,r=e[1].coord;if(n&&r&&(IJ(1,n,r,t)||IJ(0,n,r,t)))return!0}return pJ(t,e[0])&&pJ(t,e[1])}function DJ(t,e,n,r,i){var o,a=r.coordinateSystem,s=t.getItemModel(e),l=Qo(s.get("x"),i.getWidth()),u=Qo(s.get("y"),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition)o=r.getMarkerPosition(t.getValues(t.dimensions,e));else{var h=a.dimensions,c=t.get(h[0],e),d=t.get(h[1],e);o=a.dataToPoint([c,d])}if(gD(a,"cartesian2d")){var p=a.getAxis("x"),f=a.getAxis("y");h=a.dimensions;CJ(t.get(h[0],e))?o[0]=p.toGlobalCoord(p.getExtent()[n?0:1]):CJ(t.get(h[1],e))&&(o[1]=f.toGlobalCoord(f.getExtent()[n?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];t.setItemLayout(e,o)}var LJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.updateTransform=function(t,e,n){e.eachSeries(function(t){var e=oJ.getMarkerModelFromSeries(t,"markLine");if(e){var r=e.getData(),i=TJ(e).from,o=TJ(e).to;i.each(function(e){DJ(i,e,!0,t,n),DJ(o,e,!1,t,n)}),r.each(function(t){r.setItemLayout(t,[i.getItemLayout(t),o.getItemLayout(t)])}),this.markerGroupMap.get(t.id).updateLayout()}},this)},n.prototype.renderSeries=function(t,e,n,r){var i=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,new BB);this.group.add(l.group);var u=function(t,e,n){var r;r=t?V(t&&t.dimensions,function(t){var n=e.getData();return L(L({},n.getDimensionInfo(n.mapDimension(t))||{}),{name:t,ordinalMeta:null})}):[{name:"value",type:"float"}];var i=new oS(r,n),o=new oS(r,n),a=new oS([],n),s=V(n.get("data"),X(MJ,e,t,n));t&&(s=G(s,X(AJ,t)));var l=fJ(!!t,r);return i.initData(V(s,function(t){return t[0]}),null,l),o.initData(V(s,function(t){return t[1]}),null,l),a.initData(V(s,function(t){return t[2]})),a.hasItemOption=!0,{from:i,to:o,line:a}}(i,t,e),h=u.from,c=u.to,d=u.line;TJ(e).from=h,TJ(e).to=c,e.setData(d);var p=e.get("symbol"),f=e.get("symbolSize"),g=e.get("symbolRotate"),m=e.get("symbolOffset");function v(e,n,i){var o=e.getItemModel(n);DJ(e,n,i,t,r);var s=o.getModel("itemStyle").getItemStyle();null==s.fill&&(s.fill=tx(a,"color")),e.setItemVisual(n,{symbolKeepAspect:o.get("symbolKeepAspect"),symbolOffset:at(o.get("symbolOffset",!0),m[i?0:1]),symbolRotate:at(o.get("symbolRotate",!0),g[i?0:1]),symbolSize:at(o.get("symbolSize"),f[i?0:1]),symbol:at(o.get("symbol",!0),p[i?0:1]),style:s})}j(p)||(p=[p,p]),j(f)||(f=[f,f]),j(g)||(g=[g,g]),j(m)||(m=[m,m]),u.from.each(function(t){v(h,t,!0),v(c,t,!1)}),d.each(function(t){var e=d.getItemModel(t),n=e.getModel("lineStyle").getLineStyle();d.setItemLayout(t,[h.getItemLayout(t),c.getItemLayout(t)]);var r=e.get("z2");null==n.stroke&&(n.stroke=h.getItemVisual(t,"style").fill),d.setItemVisual(t,{z2:at(r,0),fromSymbolKeepAspect:h.getItemVisual(t,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(t,"symbolOffset"),fromSymbolRotate:h.getItemVisual(t,"symbolRotate"),fromSymbolSize:h.getItemVisual(t,"symbolSize"),fromSymbol:h.getItemVisual(t,"symbol"),toSymbolKeepAspect:c.getItemVisual(t,"symbolKeepAspect"),toSymbolOffset:c.getItemVisual(t,"symbolOffset"),toSymbolRotate:c.getItemVisual(t,"symbolRotate"),toSymbolSize:c.getItemVisual(t,"symbolSize"),toSymbol:c.getItemVisual(t,"symbol"),style:n})}),l.updateData(d),u.line.eachItemGraphicEl(function(t){$u(t).dataModel=e,t.traverse(function(t){$u(t).dataModel=e})}),this.markKeep(l),l.group.silent=e.get("silent")||t.get("silent")},n.type="markLine",n}(yJ);var PJ=LJ;var EJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.createMarkerModelFromSeries=function(t,e,r){return new n(t,e,r)},n.type="markArea",n.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},n}(oJ),OJ=EJ,NJ=Qa(),RJ=function(t,e,n,r){var i=r[0],o=r[1];if(i&&o){var a=cJ(t,i),s=cJ(t,o),l=a.coord,u=s.coord;l[0]=ot(l[0],-1/0),l[1]=ot(l[1],-1/0),u[0]=ot(u[0],1/0),u[1]=ot(u[1],1/0);var h=D([{},a,s]);return h.coord=[a.coord,s.coord],h.x0=a.x,h.y0=a.y,h.x1=s.x,h.y1=s.y,h}};function kJ(t){return!isNaN(t)&&!isFinite(t)}function zJ(t,e,n,r){var i=1-t;return kJ(e[i])&&kJ(n[i])}function BJ(t,e){var n=e.coord[0],r=e.coord[1],i={coord:n,x:e.x0,y:e.y0},o={coord:r,x:e.x1,y:e.y1};return gD(t,"cartesian2d")?!(!n||!r||!zJ(1,n,r)&&!zJ(0,n,r))||function(t,e,n){return!(t&&t.containZone&&e.coord&&n.coord&&!lJ(e)&&!lJ(n))||t.containZone(e.coord,n.coord)}(t,i,o):pJ(t,i)||pJ(t,o)}function VJ(t,e,n,r,i){var o,a=r.coordinateSystem,s=t.getItemModel(e),l=Qo(s.get(n[0]),i.getWidth()),u=Qo(s.get(n[1]),i.getHeight());if(isNaN(l)||isNaN(u)){if(r.getMarkerPosition){var h=t.getValues(["x0","y0"],e),c=t.getValues(["x1","y1"],e),d=a.clampData(h),p=a.clampData(c),f=[];"x0"===n[0]?f[0]=d[0]>p[0]?c[0]:h[0]:f[0]=d[0]>p[0]?h[0]:c[0],"y0"===n[1]?f[1]=d[1]>p[1]?c[1]:h[1]:f[1]=d[1]>p[1]?h[1]:c[1],o=r.getMarkerPosition(f,n,!0)}else{var g=[y=t.get(n[0],e),_=t.get(n[1],e)];a.clampData&&a.clampData(g,g),o=a.dataToPoint(g,!0)}if(gD(a,"cartesian2d")){var m=a.getAxis("x"),v=a.getAxis("y"),y=t.get(n[0],e),_=t.get(n[1],e);kJ(y)?o[0]=m.toGlobalCoord(m.getExtent()["x0"===n[0]?0:1]):kJ(_)&&(o[1]=v.toGlobalCoord(v.getExtent()["y0"===n[1]?0:1]))}isNaN(l)||(o[0]=l),isNaN(u)||(o[1]=u)}else o=[l,u];return o}var FJ=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],GJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.updateTransform=function(t,e,n){e.eachSeries(function(t){var e=oJ.getMarkerModelFromSeries(t,"markArea");if(e){var r=e.getData();r.each(function(e){var i=V(FJ,function(i){return VJ(r,e,i,t,n)});r.setItemLayout(e,i),r.getItemGraphicEl(e).setShape("points",i)})}},this)},n.prototype.renderSeries=function(t,e,n,r){var i=t.coordinateSystem,o=t.id,a=t.getData(),s=this.markerGroupMap,l=s.get(o)||s.set(o,{group:new Do});this.group.add(l.group),this.markKeep(l);var u=function(t,e,n){var r,i,o=["x0","y0","x1","y1"];if(t){var a=V(t&&t.dimensions,function(t){var n=e.getData();return L(L({},n.getDimensionInfo(n.mapDimension(t))||{}),{name:t,ordinalMeta:null})});i=V(o,function(t,e){return{name:t,type:a[e%2].type}}),r=new oS(i,n)}else r=new oS(i=[{name:"value",type:"float"}],n);var s=V(n.get("data"),X(RJ,e,t,n));t&&(s=G(s,X(BJ,t)));var l=t?function(t,e,n,r){return Uv(t.coord[Math.floor(r/2)][r%2],i[r])}:function(t,e,n,r){return Uv(t.value,i[r])};return r.initData(s,null,l),r.hasItemOption=!0,r}(i,t,e);e.setData(u),u.each(function(e){var n=V(FJ,function(n){return VJ(u,e,n,t,r)}),o=i.getAxis("x").scale,s=i.getAxis("y").scale,l=o.getExtent(),h=s.getExtent(),c=[o.parse(u.get("x0",e)),o.parse(u.get("x1",e))],d=[s.parse(u.get("y0",e)),s.parse(u.get("y1",e))];ra(c),ra(d);var p=!!(l[0]>c[1]||l[1]<c[0]||h[0]>d[1]||h[1]<d[0]);u.setItemLayout(e,{points:n,allClipped:p});var f=u.getItemModel(e),g=f.getModel("itemStyle").getItemStyle(),m=f.get("z2"),v=tx(a,"color");g.fill||(g.fill=v,Y(g.fill)&&(g.fill=Pr(g.fill,.4))),g.stroke||(g.stroke=v),u.setItemVisual(e,"style",g),u.setItemVisual(e,"z2",at(m,0))}),u.diff(NJ(l).data).add(function(t){var e=u.getItemLayout(t),n=u.getItemVisual(t,"z2");if(!e.allClipped){var r=new sd({z2:at(n,0),shape:{points:e.points}});u.setItemGraphicEl(t,r),l.group.add(r)}}).update(function(t,n){var r=NJ(l).data.getItemGraphicEl(n),i=u.getItemLayout(t),o=u.getItemVisual(t,"z2");i.allClipped?r&&l.group.remove(r):(r?Xd(r,{z2:at(o,0),shape:{points:i.points}},e,t):r=new sd({shape:{points:i.points}}),u.setItemGraphicEl(t,r),l.group.add(r))}).remove(function(t){var e=NJ(l).data.getItemGraphicEl(t);l.group.remove(e)}).execute(),u.eachItemGraphicEl(function(t,n){var r=u.getItemModel(n),i=u.getItemVisual(n,"style");t.useStyle(u.getItemVisual(n,"style")),jp(t,Zp(r),{labelFetcher:e,labelDataIndex:n,defaultText:u.getName(n)||"",inheritColor:Y(i.fill)?Pr(i.fill,1):om.color.neutral99}),lc(t,r),ic(t,null,null,r.get(["emphasis","disabled"])),$u(t).dataModel=e}),NJ(l).data=u,l.group.silent=e.get("silent")||t.get("silent")},n.type="markArea",n}(yJ);var HJ=GJ;var UJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.layoutMode={type:"box",ignoreSize:!0},e}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n),t.selected=t.selected||{},this._updateSelector(t)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),this._updateSelector(e)},n.prototype._updateSelector=function(t){var e=t.selector,n=this.ecModel;!0===e&&(e=t.selector=["all","inverse"]),j(e)&&B(e,function(t,r){Y(t)&&(t={type:t}),e[r]=A(t,function(t,e){return"all"===e?{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])}:"inverse"===e?{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}:void 0}(n,t.type))})},n.prototype.optionUpdated=function(){this._updateData(this.ecModel);var t=this._data;if(t[0]&&"single"===this.get("selectedMode")){for(var e=!1,n=0;n<t.length;n++){var r=t[n].get("name");if(this.isSelected(r)){this.select(r),e=!0;break}}!e&&this.select(t[0].get("name"))}},n.prototype._updateData=function(t){var e=[],n=[];t.eachRawSeries(function(r){var i,o=r.name;if(n.push(o),r.legendVisualProvider){var a=r.legendVisualProvider.getAllNames();t.isSeriesFiltered(r)||(n=n.concat(a)),a.length?e=e.concat(a):i=!0}else i=!0;i&&qa(r)&&e.push(r.name)}),this._availableNames=n;var r=this.get("data")||e,i=yt(),o=V(r,function(t){return(Y(t)||K(t))&&(t={name:t}),i.get(t.name)?null:(i.set(t.name,!0),new xf(t,this,this.ecModel))},this);this._data=G(o,function(t){return!!t})},n.prototype.getData=function(){return this._data},n.prototype.select=function(t){var e=this.option.selected;"single"===this.get("selectedMode")&&B(this._data,function(t){e[t.get("name")]=!1});e[t]=!0},n.prototype.unSelect=function(t){"single"!==this.get("selectedMode")&&(this.option.selected[t]=!1)},n.prototype.toggleSelected=function(t){var e=this.option.selected;e.hasOwnProperty(t)||(e[t]=!0),this[e[t]?"unSelect":"select"](t)},n.prototype.allSelect=function(){var t=this._data,e=this.option.selected;B(t,function(t){e[t.get("name",!0)]=!0})},n.prototype.inverseSelect=function(){var t=this._data,e=this.option.selected;B(t,function(t){var n=t.get("name",!0);e.hasOwnProperty(n)||(e[n]=!0),e[n]=!e[n]})},n.prototype.isSelected=function(t){var e=this.option.selected;return!(e.hasOwnProperty(t)&&!e[t])&&N(this._availableNames,t)>=0},n.prototype.getOrient=function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},n.type="legend.plain",n.dependencies=["series"],n.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",bottom:om.size.m,align:"auto",backgroundColor:om.color.transparent,borderColor:om.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:om.color.disabled,inactiveBorderColor:om.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:om.color.disabled,inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:om.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:om.color.tertiary,borderWidth:1,borderColor:om.color.border},emphasis:{selectorLabel:{show:!0,color:om.color.quaternary}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},n}(tm),WJ=UJ,XJ=X,jJ=B,ZJ=Do,YJ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!1,e}return e(n,t),n.prototype.init=function(){this.group.add(this._contentGroup=new ZJ),this.group.add(this._selectorGroup=new ZJ),this._isFirstRender=!0},n.prototype.getContentGroup=function(){return this._contentGroup},n.prototype.getSelectorGroup=function(){return this._selectorGroup},n.prototype.render=function(t,e,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),t.get("show",!0)){var i=t.get("align"),o=t.get("orient");i&&"auto"!==i||(i="right"===t.get("left")&&"vertical"===o?"right":"left");var a=t.get("selector",!0),s=t.get("selectorPosition",!0);!a||s&&"auto"!==s||(s="horizontal"===o?"end":"start"),this.renderInner(i,t,e,n,a,o,s);var l=jg(t,n).refContainer,u=t.getBoxLayoutParams(),h=t.get("padding"),c=Ug(u,l,h),d=this.layoutInner(t,i,c,r,a,s),p=Ug(E({width:d.width,height:d.height},u),l,h);this.group.x=p.x-d.x,this.group.y=p.y-d.y,this.group.markRedraw(),this.group.add(this._backgroundEl=ZY(d,t))}},n.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},n.prototype.renderInner=function(t,e,n,r,i,o,a){var s=this.getContentGroup(),l=yt(),u=e.get("selectedMode"),h=e.get("triggerEvent"),c=[];n.eachRawSeries(function(t){!t.get("legendHoverLink")&&c.push(t.id)}),jJ(e.getData(),function(i,o){var a=this,d=i.get("name");if(!this.newlineDisabled&&(""===d||"\n"===d)){var p=new ZJ;return p.newline=!0,void s.add(p)}var f=n.getSeriesByName(d)[0];if(!l.get(d)){if(f){var g=f.getData(),m=g.getVisual("legendLineStyle")||{},v=g.getVisual("legendIcon"),y=g.getVisual("style"),_=this._createItem(f,d,o,i,e,t,m,y,v,u,r);_.on("click",XJ(qJ,d,null,r,c)).on("mouseover",XJ(KJ,f.name,null,r,c)).on("mouseout",XJ(JJ,f.name,null,r,c)),n.ssr&&_.eachChild(function(t){var e=$u(t);e.seriesIndex=f.seriesIndex,e.dataIndex=o,e.ssrType="legend"}),h&&_.eachChild(function(t){a.packEventData(t,e,f,o,d)}),l.set(d,!0)}else n.eachRawSeries(function(a){var s=this;if(!l.get(d)&&a.legendVisualProvider){var p=a.legendVisualProvider;if(!p.containName(d))return;var f=p.indexOfName(d),g=p.getItemVisual(f,"style"),m=p.getItemVisual(f,"legendIcon"),v=Sr(g.fill);v&&0===v[3]&&(v[3]=.2,g=L(L({},g),{fill:Er(v,"rgba")}));var y=this._createItem(a,d,o,i,e,t,{},g,m,u,r);y.on("click",XJ(qJ,null,d,r,c)).on("mouseover",XJ(KJ,null,d,r,c)).on("mouseout",XJ(JJ,null,d,r,c)),n.ssr&&y.eachChild(function(t){var e=$u(t);e.seriesIndex=a.seriesIndex,e.dataIndex=o,e.ssrType="legend"}),h&&y.eachChild(function(t){s.packEventData(t,e,a,o,d)}),l.set(d,!0)}},this);l.get(d)||console.warn(d+" series not exists. Legend data should be same with series name or data name.")}},this),i&&this._createSelector(i,e,r,o,a)},n.prototype.packEventData=function(t,e,n,r,i){var o={componentType:"legend",componentIndex:e.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};$u(t).eventData=o},n.prototype._createSelector=function(t,e,n,r,i){var o=this.getSelectorGroup();jJ(t,function(t){var r=t.type,i=new Qu({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:"all"===r?"legendAllSelect":"legendInverseSelect",legendId:e.id})}});o.add(i),jp(i,{normal:e.getModel("selectorLabel"),emphasis:e.getModel(["emphasis","selectorLabel"])},{defaultText:t.title}),rc(i)})},n.prototype._createItem=function(t,e,n,r,i,o,a,s,l,u,h){var c=t.visualDrawType,d=i.get("itemWidth"),p=i.get("itemHeight"),f=i.isSelected(e),g=r.get("symbolRotate"),m=r.get("symbolKeepAspect"),v=r.get("icon"),y=function(t,e,n,r,i,o,a){function s(t,e){"auto"===t.lineWidth&&(t.lineWidth=e.lineWidth>0?2:0),jJ(t,function(n,r){"inherit"===t[r]&&(t[r]=e[r])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),h=0===t.lastIndexOf("empty",0)?"fill":"stroke",c=l.getShallow("decal");u.decal=c&&"inherit"!==c?$x(c,a):r.decal,"inherit"===u.fill&&(u.fill=r[i]);"inherit"===u.stroke&&(u.stroke=r[h]);"inherit"===u.opacity&&(u.opacity=("fill"===i?r:n).opacity);s(u,r);var d=e.getModel("lineStyle"),p=d.getLineStyle();if(s(p,n),"auto"===u.fill&&(u.fill=r.fill),"auto"===u.stroke&&(u.stroke=r.fill),"auto"===p.stroke&&(p.stroke=r.fill),!o){var f=e.get("inactiveBorderWidth"),g=u[h];u.lineWidth="auto"===f?r.lineWidth>0&&g?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),p.stroke=d.get("inactiveColor"),p.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:p}}(l=v||l||"roundRect",r,a,s,c,f,h),_=new ZJ,x=r.getModel("textStyle");if(!Z(t.getLegendIcon)||v&&"inherit"!==v){var b="inherit"===v&&t.getData().getVisual("symbol")?"inherit"===g?t.getData().getVisual("symbolRotate"):g:0;_.add(function(t){var e=t.icon||"roundRect",n=Cx(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);n.setStyle(t.itemStyle),n.rotation=(t.iconRotate||0)*Math.PI/180,n.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(n.style.stroke=n.style.fill,n.style.fill=om.color.neutral00,n.style.lineWidth=2);return n}({itemWidth:d,itemHeight:p,icon:l,iconRotate:b,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}))}else _.add(t.getLegendIcon({itemWidth:d,itemHeight:p,icon:l,iconRotate:g,itemStyle:y.itemStyle,lineStyle:y.lineStyle,symbolKeepAspect:m}));var w="left"===o?d+5:-5,S=o,T=i.get("formatter"),M=e;Y(T)&&T?M=T.replace("{name}",null!=e?e:""):Z(T)&&(M=T(e));var C=f?x.getTextColor():r.get("inactiveColor");_.add(new Qu({style:Yp(x,{text:M,x:w,y:p/2,fill:C,align:S,verticalAlign:"middle"},{inheritColor:C})}));var I=new Ru({shape:_.getBoundingRect(),style:{fill:"transparent"}}),A=r.getModel("tooltip");return A.get("show")&&Ip({el:I,componentModel:i,itemName:e,itemTooltipOption:A.option}),_.add(I),_.eachChild(function(t){t.silent=!0}),I.silent=!u,this.getContentGroup().add(_),rc(_),_.__legendDataIndex=n,_},n.prototype.layoutInner=function(t,e,n,r,i,o){var a=this.getContentGroup(),s=this.getSelectorGroup();Fg(t.get("orient"),a,t.get("itemGap"),n.width,n.height);var l=a.getBoundingRect(),u=[-l.x,-l.y];if(s.markRedraw(),a.markRedraw(),i){Fg("horizontal",s,t.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===o?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.x=c[0],s.y=c[1],a.x=u[0],a.y=u[1];var v={x:0,y:0};return v[f]=l[f]+d+h[f],v[g]=Math.max(l[g],h[g]),v[m]=Math.min(0,h[m]+c[1-p]),v}return a.x=u[0],a.y=u[1],this.group.getBoundingRect()},n.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},n.type="legend.plain",n}(Qy);function qJ(t,e,n,r){JJ(t,e,n,r),n.dispatchAction({type:"legendToggleSelect",name:null!=t?t:e}),KJ(t,e,n,r)}function KJ(t,e,n,r){n.usingTHL()||n.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:r})}function JJ(t,e,n,r){n.usingTHL()||n.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:r})}var QJ=YJ;function $J(t,e,n){var r="allSelect"===t||"inverseSelect"===t,i={},o=[];n.eachComponent({mainType:"legend",query:e},function(n){r?n[t]():n[t](e.name),tQ(n,i),o.push(n.componentIndex)});var a={};return n.eachComponent("legend",function(t){B(i,function(e,n){t[e?"select":"unSelect"](n)}),tQ(t,a)}),r?{selected:a,legendIndex:o}:{name:e.name,selected:a}}function tQ(t,e){var n=e||{};return B(t.getData(),function(e){var r=e.get("name");if("\n"!==r&&""!==r){var i=t.isSelected(r);wt(n,r)?n[r]=n[r]&&i:n[r]=i}}),n}var eQ=Is(function(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(t){for(var n=0;n<e.length;n++)if(!e[n].isSelected(t.name))return!1;return!0})});function nQ(t){t.registerComponentModel(WJ),t.registerComponentView(QJ),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,eQ),t.registerSubTypeDefaulter("legend",function(){return"plain"}),function(t){t.registerAction("legendToggleSelect","legendselectchanged",X($J,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",X($J,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",X($J,"inverseSelect")),t.registerAction("legendSelect","legendselected",X($J,"select")),t.registerAction("legendUnSelect","legendunselected",X($J,"unSelect"))}(t)}var rQ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},n.prototype.init=function(e,n,r){var i=Kg(e);t.prototype.init.call(this,e,n,r),iQ(this,e,i)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),iQ(this,this.option,e)},n.type="legend.scroll",n.defaultOption=Sf(WJ.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:om.color.accent50,pageIconInactiveColor:om.color.accent10,pageIconSize:15,pageTextStyle:{color:om.color.tertiary},animationDurationUpdate:800}),n}(WJ);function iQ(t,e,n){var r=[1,1];r[t.getOrient().index]=0,qg(e,n,{type:"box",ignoreSize:!!r})}var oQ=rQ,aQ=Do,sQ=["width","height"],lQ=["x","y"],uQ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.newlineDisabled=!0,e._currentIndex=0,e}return e(n,t),n.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new aQ),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new aQ)},n.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},n.prototype.renderInner=function(e,n,r,i,o,a,s){var l=this;t.prototype.renderInner.call(this,e,n,r,i,o,a,s);var u=this._controllerGroup,h=n.get("pageIconSize",!0),c=j(h)?h:[h,h];p("pagePrev",0);var d=n.getModel("pageTextStyle");function p(t,e){var r=t+"DataIndex",o=xp(n.get("pageIcons",!0)[n.getOrient().name][e],{onclick:W(l._pageGo,l,r,n,i)},{x:-c[0]/2,y:-c[1]/2,width:c[0],height:c[1]});o.name=t,u.add(o)}u.add(new Qu({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1)},n.prototype.layoutInner=function(t,e,n,r,i,o){var a=this.getSelectorGroup(),s=t.getOrient().index,l=sQ[s],u=lQ[s],h=sQ[1-s],c=lQ[1-s];i&&Fg("horizontal",a,t.get("selectorItemGap",!0));var d=t.get("selectorButtonGap",!0),p=a.getBoundingRect(),f=[-p.x,-p.y],g=I(n);i&&(g[l]=n[l]-p[l]-d);var m=this._layoutContentAndController(t,r,g,s,l,h,c,u);if(i){if("end"===o)f[s]+=m[l]+d;else{var v=p[l]+d;f[s]-=v,m[u]-=v}m[l]+=p[l]+d,f[1-s]+=m[c]+m[h]/2-p[h]/2,m[h]=Math.max(m[h],p[h]),m[c]=Math.min(m[c],p[c]+f[1-s]),a.x=f[0],a.y=f[1],a.markRedraw()}return m},n.prototype._layoutContentAndController=function(t,e,n,r,i,o,a,s){var l=this.getContentGroup(),u=this._containerGroup,h=this._controllerGroup;Fg(t.get("orient"),l,t.get("itemGap"),r?n.width:null,r?null:n.height),Fg("horizontal",h,t.get("pageButtonItemGap",!0));var c=l.getBoundingRect(),d=h.getBoundingRect(),p=this._showController=c[i]>n[i],f=[-c.x,-c.y];e||(f[r]=l[s]);var g=[0,0],m=[-d.x,-d.y],v=at(t.get("pageButtonGap",!0),t.get("itemGap",!0));p&&("end"===t.get("pageButtonPosition",!0)?m[r]+=n[i]-d[i]:g[r]+=d[i]+v);m[1-r]+=c[o]/2-d[o]/2,l.setPosition(f),u.setPosition(g),h.setPosition(m);var y={x:0,y:0};if(y[i]=p?n[i]:c[i],y[o]=Math.max(c[o],d[o]),y[a]=Math.min(0,d[a]+m[1-r]),u.__rectSize=n[i],p){var _={x:0,y:0};_[i]=Math.max(n[i]-d[i]-v,0),_[o]=y[o],u.setClipPath(new Ru({shape:_})),u.__rectSize=_[i]}else h.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&Xd(l,{x:x.contentPosition[0],y:x.contentPosition[1]},p?t:null),this._updatePageInfoView(t,x),y},n.prototype._pageGo=function(t,e,n){var r=this._getPageInfo(e)[t];null!=r&&n.dispatchAction({type:"legendScroll",scrollDataIndex:r,legendId:e.id})},n.prototype._updatePageInfoView=function(t,e){var n=this._controllerGroup;B(["pagePrev","pageNext"],function(r){var i=null!=e[r+"DataIndex"],o=n.childOfName(r);o&&(o.setStyle("fill",i?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),o.cursor=i?"pointer":"default")});var r=n.childOfName("pageText"),i=t.get("pageFormatter"),o=e.pageIndex,a=null!=o?o+1:0,s=e.pageCount;r&&i&&r.setStyle("text",Y(i)?i.replace("{current}",null==a?"":a+"").replace("{total}",null==s?"":s+""):i({current:a,total:s}))},n.prototype._getPageInfo=function(t){var e=t.get("scrollDataIndex",!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=t.getOrient().index,o=sQ[i],a=lQ[i],s=this._findTargetItemIndex(e),l=n.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:[n.x,n.y],pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var p=y(u);d.contentPosition[i]=-p.s;for(var f=s+1,g=p,m=p,v=null;f<=h;++f)(!(v=y(l[f]))&&m.e>g.s+r||v&&!_(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(f=s-1,g=p,m=p,v=null;f>=-1;--f)(v=y(l[f]))&&_(m,v.s)||!(g.i<m.i)||(m=g,null==d.pagePrevDataIndex&&(d.pagePrevDataIndex=g.i),++d.pageCount,++d.pageIndex),g=v;return d;function y(t){if(t){var e=t.getBoundingRect(),n=e[a]+t[a];return{s:n,e:n+e[o],i:t.__legendDataIndex}}}function _(t,e){return t.e>=e&&t.s<=e+r}},n.prototype._findTargetItemIndex=function(t){return this._showController?(this.getContentGroup().eachChild(function(r,i){var o=r.__legendDataIndex;null==n&&null!=o&&(n=i),o===t&&(e=i)}),null!=e?e:n):0;var e,n},n.type="legend.scroll",n}(QJ),hQ=uQ;function cQ(t){vM(nQ),t.registerComponentModel(oQ),t.registerComponentView(hQ),function(t){t.registerAction("legendScroll","legendscroll",function(t,e){var n=t.scrollDataIndex;null!=n&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(n)})})}(t)}var dQ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.inside",n.defaultOption=Sf(IY.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),n}(IY),pQ=dQ,fQ=Qa();function gQ(t,e){if(e){t.removeKey(e.model.uid);var n=e.controller;n&&n.dispose()}}function mQ(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function vQ(t,e,n,r){return t.coordinateSystem.containPoint([n,r])}function yQ(t){t.registerUpdateLifecycle("coordsys:aftercreate",function(t,e){var n=fQ(e),r=n.coordSysRecordMap||(n.coordSysRecordMap=yt());r.each(function(t){t.dataZoomInfoMap=null}),t.eachComponent({mainType:"dataZoom",subType:"inside"},function(t){B(xY(t).infoList,function(n){var i=n.model.uid,o=r.get(i)||r.set(i,function(t,e){var n={model:e,containsPoint:X(vQ,e),dispatchAction:X(mQ,t),dataZoomInfoMap:null,controller:null},r=n.controller=new kO(t.getZr());return B(["pan","zoom","scrollMove"],function(t){r.on(t,function(e){var r=[];n.dataZoomInfoMap.each(function(i){if(e.isAvailableBehavior(i.model.option)){var o=(i.getRange||{})[t],a=o&&o(i.dzReferCoordSysInfo,n.model.mainType,n.controller,e);!i.model.get("disabled",!0)&&a&&r.push({dataZoomId:i.model.id,start:a[0],end:a[1]})}}),r.length&&n.dispatchAction(r)})}),n}(e,n.model));(o.dataZoomInfoMap||(o.dataZoomInfoMap=yt())).set(t.uid,{dzReferCoordSysInfo:n,model:t,getRange:null})})}),r.each(function(t){var n,i=t.controller,o=t.dataZoomInfoMap;if(o){var a=o.keys()[0];null!=a&&(n=o.get(a))}if(n){var s=function(t,e,n){var r,i,o,a="type_",s={type_true:2,type_move:1,type_false:0,type_undefined:-1},l=!0;return t.each(function(t){var e=t.model,n=!e.get("disabled",!0)&&(!e.get("zoomLock",!0)||"move");s[a+n]>s[a+r]&&(r=n),l=l&&e.get("preventDefaultMouseMove",!0),i=at(e.get("cursorGrab",!0),i),o=at(e.get("cursorGrabbing",!0),o)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!l,api:n,zInfo:{component:e.model},triggerInfo:{roamTrigger:null,isInSelf:e.containsPoint},cursorGrab:i,cursorGrabbing:o}}}(o,t,e);i.enable(s.controlType,s.opt),p_(t,"dispatchAction",n.model.get("throttle",!0),"fixRate")}else gQ(r,t)})})}var _Q=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataZoom.inside",e}return e(n,t),n.prototype.render=function(e,n,r){t.prototype.render.apply(this,arguments),e.noTarget()?this._clear():(this.range=e.getPercentRange(),function(t,e,n){fQ(t).coordSysRecordMap.each(function(t){var r=t.dataZoomInfoMap.get(e.uid);r&&(r.getRange=n)})}(r,e,{pan:W(xQ.pan,this),zoom:W(xQ.zoom,this),scrollMove:W(xQ.scrollMove,this)}))},n.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},n.prototype._clear=function(){!function(t,e){for(var n=fQ(t).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var o=r[i],a=n.get(o),s=a.dataZoomInfoMap;if(s){var l=e.uid;s.get(l)&&(s.removeKey(l),s.keys().length||gQ(n,a))}}}(this.api,this.dataZoomModel),this.range=null},n.type="dataZoom.inside",n}(PY),xQ={zoom:function(t,e,n,r){var i=this.range,o=i.slice(),a=t.axisModels[0];if(a){var s=wQ[e](null,[r.originX,r.originY],a,n,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(o[1]-o[0])+o[0],u=Math.max(1/r.scale,0);o[0]=(o[0]-l)*u+l,o[1]=(o[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return JV(0,o,[0,100],0,h.minSpan,h.maxSpan),this.range=o,i[0]!==o[0]||i[1]!==o[1]?o:void 0}},pan:bQ(function(t,e,n,r,i,o){var a=wQ[r]([o.oldX,o.oldY],[o.newX,o.newY],e,i,n);return a.signal*(t[1]-t[0])*a.pixel/a.pixelLength}),scrollMove:bQ(function(t,e,n,r,i,o){return wQ[r]([0,0],[o.scrollDelta,o.scrollDelta],e,i,n).signal*(t[1]-t[0])*o.scrollDelta})};function bQ(t){return function(e,n,r,i){var o=this.range,a=o.slice(),s=e.axisModels[0];if(s)return JV(t(a,s,e,n,r,i),a,[0,100],"all"),this.range=a,o[0]!==a[0]||o[1]!==a[1]?a:void 0}}var wQ={grid:function(t,e,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem.getRect();return t=t||[0,0],"x"===o.dim?(a.pixel=e[0]-t[0],a.pixelLength=s.width,a.pixelStart=s.x,a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=s.height,a.pixelStart=s.y,a.signal=o.inverse?-1:1),a},polar:function(t,e,n,r,i){var o=n.axis,a={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),"radiusAxis"===n.mainType?(a.pixel=e[0]-t[0],a.pixelLength=l[1]-l[0],a.pixelStart=l[0],a.signal=o.inverse?1:-1):(a.pixel=e[1]-t[1],a.pixelLength=u[1]-u[0],a.pixelStart=u[0],a.signal=o.inverse?-1:1),a},singleAxis:function(t,e,n,r,i){var o=n.axis,a=i.model.coordinateSystem.getRect(),s={};return t=t||[0,0],"horizontal"===o.orient?(s.pixel=e[0]-t[0],s.pixelLength=a.width,s.pixelStart=a.x,s.signal=o.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=a.height,s.pixelStart=a.y,s.signal=o.inverse?-1:1),s}},SQ=_Q;function TQ(t){VY(t),t.registerComponentModel(pQ),t.registerComponentView(SQ),yQ(t)}var MQ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.type="dataZoom.slider",n.layoutMode="box",n.defaultOption=Sf(IY.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:om.color.accent10,borderRadius:0,backgroundColor:om.color.transparent,dataBackground:{lineStyle:{color:om.color.accent30,width:.5},areaStyle:{color:om.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:om.color.accent40,width:.5},areaStyle:{color:om.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:om.color.neutral00,borderColor:om.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:om.color.accent40,opacity:.5},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:om.color.tertiary},brushSelect:!0,brushStyle:{color:om.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:om.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),n}(IY),CQ=MQ,IQ=Ru,AQ="horizontal",DQ="vertical",LQ=["line","bar","candlestick","scatter"],PQ={easing:"cubicOut",duration:100,delay:0},EQ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._displayables={},e}return e(n,t),n.prototype.init=function(t,e){this.api=e,this._onBrush=W(this._onBrush,this),this._onBrushEnd=W(this._onBrushEnd,this)},n.prototype.render=function(e,n,r,i){if(t.prototype.render.apply(this,arguments),p_(this,"_dispatchZoomAction",e.get("throttle"),"fixRate"),this._orient=e.getOrient(),!1!==e.get("show")){if(e.noTarget())return this._clear(),void this.group.removeAll();i&&"dataZoom"===i.type&&i.from===this.uid||this._buildView(),this._updateView()}else this.group.removeAll()},n.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},n.prototype._clear=function(){f_(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},n.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var e=this._displayables.sliderGroup=new Do;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},n.prototype._resetLocation=function(){var t=this.dataZoomModel,e=this.api,n=t.get("brushSelect")?7:0,r=jg(t,e).refContainer,i=this._findCoordRect(),o=t.get("defaultLocationEdgeGap",!0)||0,a=this._orient===AQ?{right:r.width-i.x-i.width,top:r.height-30-o-n,width:i.width,height:30}:{right:o,top:i.y,width:30,height:i.height},s=Kg(t.option);B(["right","top","width","height"],function(t){"ph"===s[t]&&(s[t]=a[t])});var l=Ug(s,r);this._location={x:l.x,y:l.y},this._size=[l.width,l.height],this._orient===DQ&&this._size.reverse()},n.prototype._positionGroup=function(){var t=this.group,e=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get("inverse"),o=this._displayables.sliderGroup,a=(this._dataShadowInfo||{}).otherAxisInverse;o.attr(n!==AQ||i?n===AQ&&i?{scaleY:a?1:-1,scaleX:-1}:n!==DQ||i?{scaleY:a?-1:1,scaleX:-1,rotation:Math.PI/2}:{scaleY:a?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:a?1:-1,scaleX:1});var s=t.getBoundingRect([o]),l=isNaN(s.x)?0:s.x,u=isNaN(s.y)?0:s.y;t.x=e.x-l,t.y=e.y-u,t.markRedraw()},n.prototype._getViewExtent=function(){return[0,this._size[0]]},n.prototype._renderBackground=function(){var t=this.dataZoomModel,e=this._size,n=this._displayables.sliderGroup,r=t.get("brushSelect");n.add(new IQ({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var i=new IQ({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:W(this._onClickPanel,this)}),o=this.api.getZr();r?(i.on("mousedown",this._onBrushStart,this),i.cursor="crosshair",o.on("mousemove",this._onBrush),o.on("mouseup",this._onBrushEnd)):(o.off("mousemove",this._onBrush),o.off("mouseup",this._onBrushEnd)),n.add(i)},n.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],t){var e=this._size,n=this._shadowSize||[],r=t.series,i=r.getRawData(),o=r.getShadowDim&&r.getShadowDim(),a=o&&i.getDimensionInfo(o)?r.getShadowDim():t.otherDim;if(null!=a){var s=this._shadowPolygonPts,l=this._shadowPolylinePts;if(i!==this._shadowData||a!==this._shadowDim||e[0]!==n[0]||e[1]!==n[1]){var u=i.getDataExtent(t.thisDim),h=i.getDataExtent(a),c=.3*(h[1]-h[0]);h=[h[0]-c,h[1]+c];var d,p=[0,e[1]],f=[0,e[0]],g=[[e[0],0],[0,0]],m=[],v=f[1]/Math.max(1,i.count()-1),y=e[0]/(u[1]-u[0]),_="time"===t.thisAxis.type,x=-v,b=Math.round(i.count()/e[0]);i.each([t.thisDim,a],function(t,e,n){if(b>0&&n%b)_||(x+=v);else{x=_?(+t-u[0])*y:x+v;var r=null==e||isNaN(e)||""===e,i=r?0:Jo(e,h,p,!0);r&&!d&&n?(g.push([g[g.length-1][0],0]),m.push([m[m.length-1][0],0])):!r&&d&&(g.push([x,0]),m.push([x,0])),r||(g.push([x,i]),m.push([x,i])),d=r}}),s=this._shadowPolygonPts=g,l=this._shadowPolylinePts=m}this._shadowData=i,this._shadowDim=a,this._shadowSize=[e[0],e[1]];for(var w=this.dataZoomModel,S=0;S<3;S++){var T=M(1===S);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}}}function M(t){var e=w.getModel(t?"selectedDataBackground":"dataBackground"),n=new Do,r=new sd({shape:{points:s},segmentIgnoreThreshold:1,style:e.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),i=new hd({shape:{points:l},segmentIgnoreThreshold:1,style:e.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}},n.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,e=t.get("showDataShadow");if(!1!==e){var n,r=this.ecModel;return t.eachTargetAxis(function(i,o){B(t.getAxisProxy(i,o).getTargetSeriesModels(),function(t){if(!(n||!0!==e&&N(LQ,t.get("type"))<0)){var a,s=r.getComponent(yY(i),o).axis,l=function(t){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[t]}(i),u=t.coordinateSystem;null!=l&&u.getOtherAxis&&(a=u.getOtherAxis(s).inverse),l=t.getData().mapDimension(l);var h=t.getData().mapDimension(i);n={thisAxis:s,series:t,thisDim:h,otherDim:l,otherAxisInverse:a}}},this)},this),n}},n.prototype._renderHandle=function(){var t=this.group,e=this._displayables,n=e.handles=[null,null],r=e.handleLabels=[null,null],i=this._displayables.sliderGroup,o=this._size,a=this.dataZoomModel,s=this.api,l=a.get("borderRadius")||0,u=a.get("brushSelect"),h=e.filler=new IQ({silent:u,style:{fill:a.get("fillerColor")},textConfig:{position:"inside"}});i.add(h),i.add(new IQ({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:o[0],height:o[1],r:l},style:{stroke:a.get("dataBackgroundColor")||a.get("borderColor"),lineWidth:1,fill:om.color.transparent}})),B([0,1],function(e){var o=a.get("handleIcon");!Sx[o]&&o.indexOf("path://")<0&&o.indexOf("image://")<0&&(o="path://"+o,Pa("handleIcon now needs 'path://' prefix when using a path string"));var s,l=Cx(o,-1,0,2,2,null,!0);l.attr({cursor:(s=this._orient,"vertical"===s?"ns-resize":"ew-resize"),draggable:!0,drift:W(this._onDragMove,this,e),ondragend:W(this._onDragEnd,this),onmouseover:W(this._onOverDataInfoTriggerArea,this,!0),onmouseout:W(this._onOverDataInfoTriggerArea,this,!1),z2:5});var u=l.getBoundingRect(),h=a.get("handleSize");this._handleHeight=Qo(h,this._size[1]),this._handleWidth=u.width/u.height*this._handleHeight,l.setStyle(a.getModel("handleStyle").getItemStyle()),l.style.strokeNoScale=!0,l.rectHover=!0,l.ensureState("emphasis").style=a.getModel(["emphasis","handleStyle"]).getItemStyle(),rc(l);var c=a.get("handleColor");null!=c&&(l.style.fill=c),i.add(n[e]=l);var d=a.getModel("textStyle"),p=(a.get("handleLabel")||{}).show||!1;t.add(r[e]=new Qu({silent:!0,invisible:!p,style:Yp(d,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:d.getTextColor(),font:d.getFont()}),z2:10}))},this);var c=h;if(u){var d=Qo(a.get("moveHandleSize"),o[1]),p=e.moveHandle=new Ru({style:a.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:o[1]-.5,height:d}}),f=.8*d,g=e.moveHandleIcon=Cx(a.get("moveHandleIcon"),-f/2,-f/2,f,f,om.color.neutral00,!0);g.silent=!0,g.y=o[1]+d/2-.5,p.ensureState("emphasis").style=a.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var m=Math.min(o[1]/2,Math.max(d,10));(c=e.moveZone=new Ru({invisible:!0,shape:{y:o[1]-m,height:d+m}})).on("mouseover",function(){s.enterEmphasis(p)}).on("mouseout",function(){s.leaveEmphasis(p)}),i.add(p),i.add(g),i.add(c)}c.attr({draggable:!0,cursor:"grab",drift:W(this._onActualMoveZoneDrift,this),ondragstart:W(this._onActualMoveZoneDragStart,this),ondragend:W(this._onActualMoveZoneDragEnd,this),onmouseover:W(this._onOverDataInfoTriggerArea,this,!0),onmouseout:W(this._onOverDataInfoTriggerArea,this,!1)})},n.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),e=this._getViewExtent();this._handleEnds=[Jo(t[0],[0,100],e,!0),Jo(t[1],[0,100],e,!0)]},n.prototype._updateInterval=function(t,e){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),o=n.findRepresentativeAxisProxy().getMinMaxSpan(),a=[0,100];JV(e,r,i,n.get("zoomLock")?"all":t,null!=o.minSpan?Jo(o.minSpan,a,i,!0):null,null!=o.maxSpan?Jo(o.maxSpan,a,i,!0):null);var s=this._range,l=this._range=ra([Jo(r[0],i,a,!0),Jo(r[1],i,a,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},n.prototype._updateView=function(t){var e=this._displayables,n=this._handleEnds,r=ra(n.slice()),i=this._size;B([0,1],function(t){var r=e.handles[t],o=this._handleHeight;r.attr({scaleX:o/2,scaleY:o/2,x:n[t]+(t?-1:1),y:i[1]/2-o/2})},this),e.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var o={x:r[0],width:r[1]-r[0]};e.moveHandle&&(e.moveHandle.setShape(o),e.moveZone.setShape(o),e.moveZone.getBoundingRect(),e.moveHandleIcon&&e.moveHandleIcon.attr("x",o.x+o.width/2));for(var a=e.dataShadowSegs,s=[0,r[0],r[1],i[0]],l=0;l<a.length;l++){var u=a[l],h=u.getClipPath();h||(h=new Ru,u.setClipPath(h)),h.setShape({x:s[l],y:0,width:s[l+1]-s[l],height:i[1]})}this._updateDataInfo(t)},n.prototype._updateDataInfo=function(t){var e=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,o=["",""];if(e.get("showDetail")){var a=e.findRepresentativeAxisProxy(),s=a.getAxisModel().axis.scale;if(a){var l,u=this._range;if(t){var h={start:u[0],end:u[1]},c=SY(e,a);if(c){var d=c.calculateDataWindow(h).percentInverted;h={start:d[0],end:d[1]}}l=a.calculateDataWindow(h)}else l=a.getWindow();o=[OQ(e,0,l,s),OQ(e,1,l,s)]}}var p=ra(this._handleEnds.slice());function f(t){var e=pp(n.handles[t].parent,this.group),a=gp(0===t?"right":"left",e),s=this._handleWidth/2+5,l=fp([p[t]+(0===t?-s:s),this._size[1]/2],e);r[t].setStyle({x:l[0],y:l[1],verticalAlign:i===AQ?"middle":a,align:i===AQ?a:"center",text:o[t]})}f.call(this,0),f.call(this,1)},n.prototype._onOverDataInfoTriggerArea=function(t){this._isOverDataInfoTriggerArea=t,this._showDataInfo(t)},n.prototype._showDataInfo=function(t){var e=(this.dataZoomModel.get("handleLabel")||{}).show||!1,n=this.dataZoomModel.getModel(["emphasis","handleLabel"]).get("show")||!1,r=t||this._dragging?n:e,i=this._displayables,o=i.handleLabels;o[0].attr("invisible",!r),o[1].attr("invisible",!r),i.moveHandle&&this.api[r?"enterEmphasis":"leaveEmphasis"](i.moveHandle,1)},n.prototype._onActualMoveZoneDrift=function(t,e,n){this.api.getZr().setCursorStyle("grabbing"),this._onDragMove("all",t,e,n)},n.prototype._onActualMoveZoneDragStart=function(t){t.target.attr("cursor","grabbing"),this._showDataInfo(!0)},n.prototype._onActualMoveZoneDragEnd=function(t){t.target.attr("cursor","grab"),this._onDragEnd()},n.prototype._onDragMove=function(t,e,n,r){this._dragging=!0,_e(r.event);var i=fp([e,n],this._displayables.sliderGroup.getLocalTransform(),!0),o=this._updateInterval(t,i[0]),a=this.dataZoomModel.get("realtime");this._updateView(!a),o&&a&&this._dispatchZoomAction(!0)},n.prototype._onDragEnd=function(){this._dragging=!1,this._isOverDataInfoTriggerArea||this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction(!1)},n.prototype._onClickPanel=function(t){var e=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(t.offsetX,t.offsetY);if(!(n[0]<0||n[0]>e[0]||n[1]<0||n[1]>e[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,o=this._updateInterval("all",n[0]-i);this._updateView(),o&&this._dispatchZoomAction(!1)}},n.prototype._onBrushStart=function(t){var e=t.offsetX,n=t.offsetY;this._brushStart=new Re(e,n),this._brushing=!0,this._brushStartTime=+new Date},n.prototype._onBrushEnd=function(t){if(this._brushing){var e=this._displayables.brushRect;if(this._brushing=!1,e){e.attr("ignore",!0);var n=e.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],o=this._handleEnds=[n.x,n.x+n.width],a=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();JV(0,o,r,0,null!=a.minSpan?Jo(a.minSpan,i,r,!0):null,null!=a.maxSpan?Jo(a.maxSpan,i,r,!0):null),this._range=ra([Jo(o[0],r,i,!0),Jo(o[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},n.prototype._onBrush=function(t){this._brushing&&(_e(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},n.prototype._updateBrushRect=function(t,e){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new IQ({silent:!0,style:r.getModel("brushStyle").getItemStyle()}),n.sliderGroup.add(i)),i.attr("ignore",!1);var o=this._brushStart,a=this._displayables.sliderGroup,s=a.transformCoordToLocal(t,e),l=a.transformCoordToLocal(o.x,o.y),u=this._size;s[0]=Math.max(Math.min(u[0],s[0]),0),i.setShape({x:l[0],y:0,width:s[0]-l[0],height:u[1]})},n.prototype._dispatchZoomAction=function(t){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?PQ:null,start:e[0],end:e[1]})},n.prototype._findCoordRect=function(){var t,e=xY(this.dataZoomModel).infoList;if(!t&&e.length){var n=e[0].model.coordinateSystem;t=n.getRect&&n.getRect()}if(!t){var r=this.api.getWidth(),i=this.api.getHeight();t={x:.2*r,y:.2*i,width:.6*r,height:.6*i}}return t},n.type="dataZoom.slider",n}(PY);function OQ(t,e,n,r){var i=t.get("labelFormatter"),o=t.get("labelPrecision");null!=o&&"auto"!==o||(o=n.valuePrecision);var a=n.value[e],s=null==a||isNaN(a)?"":kS(r)||NS(r)?r.getLabel({value:Math.round(a)}):isFinite(o)?ea(a,o,!0):a+"";return Z(i)?i(a,s):Y(i)?i.replace("{value}",s):s}var NQ=EQ;function RQ(t){t.registerComponentModel(CQ),t.registerComponentView(NQ),VY(t)}var kQ={get:function(t,e,n){var r=I((zQ[t]||{})[e]);return n&&j(r)?r[r.length-1]:r}},zQ={color:{active:["#006edd","#e0ffff"],inactive:[om.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},BQ=kQ,VQ=zz.mapVisual,FQ=zz.eachVisual,GQ=j,HQ=B,UQ=ra,WQ=Jo,XQ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.stateList=["inRange","outOfRange"],e.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],e.layoutMode={type:"box",ignoreSize:!0},e.dataBound=[-1/0,1/0],e.targetVisuals={},e.controllerVisuals={},e}return e(n,t),n.prototype.init=function(t,e,n){this.mergeDefaultAndTheme(t,n)},n.prototype.optionUpdated=function(t,e){var n=this.option;!e&&gK(n,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},n.prototype.resetVisual=function(t){var e=this.stateList;t=W(t,this),this.controllerVisuals=fK(this.option.controller,e,t),this.targetVisuals=fK(this.option.target,e,t)},n.prototype.getItemSymbol=function(){return null},n.prototype.getTargetSeriesIndices=function(){var t=this,e=this.option.seriesTargets;if(e){var n=[];return HQ(e,function(e){if(null!=e.seriesIndex)n.push(e.seriesIndex);else if(null!=e.seriesId){var r;t.ecModel.eachSeries(function(t){t.id===e.seriesId&&(r=t)}),r&&n.push(r.componentIndex)}}),n}var r=this.option.seriesId,i=this.option.seriesIndex;return null==i&&null==r&&(i="all"),V(is(this.ecModel,"series",{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models,function(t){return t.componentIndex})},n.prototype.eachTargetSeries=function(t,e){B(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&t.call(e,r)},this)},n.prototype.isTargetSeries=function(t){var e=!1;return this.eachTargetSeries(function(n){n===t&&(e=!0)}),e},n.prototype.formatValueText=function(t,e,n){var r,i=this.option,o=i.precision,a=this.dataBound,s=i.formatter;n=n||["<",">"],j(t)&&(t=t.slice(),r=!0);var l=e?t:r?[u(t[0]),u(t[1])]:u(t);return Y(s)?s.replace("{value}",r?l[0]:l).replace("{value2}",r?l[1]:l):Z(s)?r?s(t[0],t[1]):s(t):r?t[0]===a[0]?n[0]+" "+l[1]:t[1]===a[1]?n[1]+" "+l[0]:l[0]+" - "+l[1]:l;function u(t){return t===a[0]?"min":t===a[1]?"max":(+t).toFixed(Math.min(o,20))}},n.prototype.resetExtent=function(){var t=this.option,e=UQ([t.min,t.max]);this._dataExtent=e},n.prototype.getDimension=function(t){var e=this,n=this.option.seriesTargets;if(n){var r=H(n,function(n){return null!=n.seriesIndex&&n.seriesIndex===t||null!=n.seriesId&&n.seriesId===e.ecModel.getSeriesByIndex(t).id});if(r)return r.dimension}return this.option.dimension},n.prototype.getDataDimensionIndex=function(t){var e=t.hostModel.seriesIndex,n=this.getDimension(e);if(null!=n)return t.getDimensionIndex(n);for(var r=t.dimensions,i=r.length-1;i>=0;i--){var o=r[i],a=t.getDimensionInfo(o);if(!a.isCalculationCoord)return a.storeDimIndex}},n.prototype.getExtent=function(){return this._dataExtent.slice()},n.prototype.completeVisualOption=function(){var t=this.ecModel,e=this.option,n={inRange:e.inRange,outOfRange:e.outOfRange},r=e.target||(e.target={}),i=e.controller||(e.controller={});A(r,n),A(i,n);var o=this.isCategory();function a(n){GQ(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")}}a.call(this,r),a.call(this,i),function(t,e,n){var r=t[e],i=t[n];r&&!i&&(i=t[n]={},HQ(r,function(t,e){if(zz.isValidType(e)){var n=BQ.get(e,"inactive",o);null!=n&&(i[e]=n,"color"!==e||i.hasOwnProperty("opacity")||i.hasOwnProperty("colorAlpha")||(i.opacity=[0,0]))}}))}.call(this,r,"inRange","outOfRange"),function(t){var e=(t.inRange||{}).symbol||(t.outOfRange||{}).symbol,n=(t.inRange||{}).symbolSize||(t.outOfRange||{}).symbolSize,r=this.get("inactiveColor"),i=this.getItemSymbol()||"roundRect";HQ(this.stateList,function(a){var s=this.itemSize,l=t[a];l||(l=t[a]={color:o?r:[r]}),null==l.symbol&&(l.symbol=e&&I(e)||(o?i:[i])),null==l.symbolSize&&(l.symbolSize=n&&I(n)||(o?s[0]:[s[0],s[0]])),l.symbol=VQ(l.symbol,function(t){return"none"===t?i:t});var u=l.symbolSize;if(null!=u){var h=-1/0;FQ(u,function(t){t>h&&(h=t)}),l.symbolSize=VQ(u,function(t){return WQ(t,[0,h],[0,s[0]],!0)})}},this)}.call(this,i)},n.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},n.prototype.isCategory=function(){return!!this.option.categories},n.prototype.setSelected=function(t){},n.prototype.getSelected=function(){return null},n.prototype.getValueState=function(t){return null},n.prototype.getVisualMeta=function(t){return null},n.type="visualMap",n.dependencies=["series"],n.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:om.color.transparent,borderColor:om.color.borderTint,contentColor:om.color.theme[0],inactiveColor:om.color.disabled,borderWidth:0,padding:om.size.m,textGap:10,precision:0,textStyle:{color:om.color.secondary}},n}(tm),jQ=XQ,ZQ=[20,140],YQ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(t){t.mappingMethod="linear",t.dataExtent=this.getExtent()}),this._resetRange()},n.prototype.resetItemSize=function(){t.prototype.resetItemSize.apply(this,arguments);var e=this.itemSize;(null==e[0]||isNaN(e[0]))&&(e[0]=ZQ[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=ZQ[1])},n.prototype._resetRange=function(){var t=this.getExtent(),e=this.option.range;!e||e.auto?(t.auto=1,this.option.range=t):j(e)&&(e[0]>e[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},n.prototype.completeVisualOption=function(){t.prototype.completeVisualOption.apply(this,arguments),B(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=e[1]/3)},this)},n.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},n.prototype.getSelected=function(){var t=this.getExtent(),e=ra((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]<t[0]&&(e[0]=t[0]),e[1]<t[0]&&(e[1]=t[0]),e},n.prototype.getValueState=function(t){var e=this.option.range,n=this.getExtent(),r=at(this.option.unboundedRange,!0);return(r&&e[0]<=n[0]||e[0]<=t)&&(r&&e[1]>=n[1]||t<=e[1])?"inRange":"outOfRange"},n.prototype.findTargetDataIndices=function(t){var e=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(e,n){t[0]<=e&&e<=t[1]&&r.push(n)},this),e.push({seriesId:n.id,dataIndex:r})},this),e},n.prototype.getVisualMeta=function(t){var e=qQ(this,"outOfRange",this.getExtent()),n=qQ(this,"inRange",this.option.range.slice()),r=[];function i(e,n){r.push({value:e,color:t(e,n)})}for(var o=0,a=0,s=n.length,l=e.length;a<l&&(!n.length||e[a]<=n[0]);a++)e[a]<n[o]&&i(e[a],"outOfRange");for(var u=1;o<s;o++,u=0)u&&r.length&&i(n[o],"outOfRange"),i(n[o],"inRange");for(u=1;a<l;a++)(!n.length||n[n.length-1]<e[a])&&(u&&(r.length&&i(r[r.length-1].value,"outOfRange"),u=0),i(e[a],"outOfRange"));var h=r.length;return{stops:r,outerColors:[h?r[0].color:"transparent",h?r[h-1].color:"transparent"]}},n.type="visualMap.continuous",n.defaultOption=Sf(jQ.defaultOption,{align:"auto",calculable:!1,hoverLink:!0,realtime:!0,handleIcon:"path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",handleSize:"120%",handleStyle:{borderColor:om.color.neutral00,borderWidth:1},indicatorIcon:"circle",indicatorSize:"50%",indicatorStyle:{borderColor:om.color.neutral00,borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:om.color.shadow}}),n}(jQ);function qQ(t,e,n){if(n[0]===n[1])return n.slice();for(var r=(n[1]-n[0])/200,i=n[0],o=[],a=0;a<=200&&i<n[1];a++)o.push(i),i+=r;return o.push(n[1]),o}var KQ=YQ,JQ=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.autoPositionValues={left:1,right:1,top:1,bottom:1},e}return e(n,t),n.prototype.init=function(t,e){this.ecModel=t,this.api=e},n.prototype.render=function(t,e,n,r){this.visualMapModel=t,!1!==t.get("show")?this.doRender(t,e,n,r):this.group.removeAll()},n.prototype.renderBackground=function(t){var e=this.visualMapModel,n=vg(e.get("padding")||0),r=t.getBoundingRect();t.add(new Ru({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:e.get("backgroundColor"),stroke:e.get("borderColor"),lineWidth:e.get("borderWidth")}}))},n.prototype.getControllerVisual=function(t,e,n){var r=(n=n||{}).forceState,i=this.visualMapModel,o={};if("color"===e){var a=i.get("contentColor");o.color=a}function s(t){return o[t]}function l(t,e){o[t]=e}var u=i.controllerVisuals[r||i.getValueState(t)];return B(zz.prepareVisualTypes(u),function(r){var i=u[r];n.convertOpacityToAlpha&&"opacity"===r&&(r="colorAlpha",i=u.__alphaForOpacity),zz.dependsOn(r,e)&&i&&i.applyVisual(t,s,l)}),o[e]},n.prototype.positionGroup=function(t){var e=this.visualMapModel,n=jg(e,this.api).refContainer;Zg(t,e.getBoxLayoutParams(),n)},n.prototype.doRender=function(t,e,n,r){},n.type="visualMap",n}(Qy),QQ=JQ,$Q=[["left","right","width"],["top","bottom","height"]];function t$(t,e,n){var r=t.option,i=r.align;if(null!=i&&"auto"!==i)return i;for(var o={width:e.getWidth(),height:e.getHeight()},a="horizontal"===r.orient?1:0,s=$Q[a],l=[0,null,10],u={},h=0;h<3;h++)u[$Q[1-a][h]]=l[h],u[s[h]]=2===h?n[0]:r[s[h]];var c=[["x","width",3],["y","height",0]][a],d=Ug(u,o,r.padding);return s[(d.margin[c[2]]||0)+d[c[0]]+.5*d[c[1]]<.5*o[c[1]]?0:1]}function e$(t,e){return B(t||[],function(t){null!=t.dataIndex&&(t.dataIndexInside=t.dataIndex,t.dataIndex=null),t.highlightKey="visualMap"+(e?e.componentIndex:"")}),t}var n$=Jo,r$=B,i$=Math.min,o$=Math.max,a$=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._shapes={},e._dataInterval=[],e._handleEnds=[],e._hoverLinkDataIndices=[],e}return e(n,t),n.prototype.init=function(e,n){t.prototype.init.call(this,e,n),this._hoverLinkFromSeriesMouseOver=W(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=W(this._hideIndicator,this)},n.prototype.doRender=function(t,e,n,r){r&&"selectDataRange"===r.type&&r.from===this.uid||this._buildView()},n.prototype._buildView=function(){this.group.removeAll();var t=this.visualMapModel,e=this.group;this._orient=t.get("orient"),this._useHandle=t.get("calculable"),this._resetInterval(),this._renderBar(e);var n=t.get("text");this._renderEndsText(e,n,0),this._renderEndsText(e,n,1),this._updateView(!0),this.renderBackground(e),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(e)},n.prototype._renderEndsText=function(t,e,n){if(e){var r=e[1-n];r=null!=r?r+"":"";var i=this.visualMapModel,o=i.get("textGap"),a=i.itemSize,s=this._shapes.mainGroup,l=this._applyTransform([a[0]/2,0===n?-o:a[1]+o],s),u=this._applyTransform(0===n?"bottom":"top",s),h=this._orient,c=this.visualMapModel.textStyleModel;this.group.add(new Qu({style:Yp(c,{x:l[0],y:l[1],verticalAlign:c.get("verticalAlign")||("horizontal"===h?"middle":u),align:c.get("align")||("horizontal"===h?u:"center"),text:r})}))}},n.prototype._renderBar=function(t){var e=this.visualMapModel,n=this._shapes,r=e.itemSize,i=this._orient,o=this._useHandle,a=t$(e,this.api,r),s=n.mainGroup=this._createBarGroup(a),l=new Do;s.add(l),l.add(n.outOfRange=s$()),l.add(n.inRange=s$(null,o?u$(this._orient):null,W(this._dragHandle,this,"all",!1),W(this._dragHandle,this,"all",!0))),l.setClipPath(new Ru({shape:{x:0,y:0,width:r[0],height:r[1],r:3}}));var u=e.textStyleModel.getTextRect("国"),h=o$(u.width,u.height);o&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(e,s,0,r,h,i),this._createHandle(e,s,1,r,h,i)),this._createIndicator(e,s,r,h,i),t.add(s)},n.prototype._createHandle=function(t,e,n,r,i,o){var a=W(this._dragHandle,this,n,!1),s=W(this._dragHandle,this,n,!0),l=ho(t.get("handleSize"),r[0]),u=Cx(t.get("handleIcon"),-l/2,-l/2,l,l,null,!0),h=u$(this._orient);u.attr({cursor:h,draggable:!0,drift:a,ondragend:s,onmousemove:function(t){_e(t.event)}}),u.x=r[0]/2,u.useStyle(t.getModel("handleStyle").getItemStyle()),u.setStyle({strokeNoScale:!0,strokeFirst:!0}),u.style.lineWidth*=2,u.ensureState("emphasis").style=t.getModel(["emphasis","handleStyle"]).getItemStyle(),uc(u,!0),e.add(u);var c=this.visualMapModel.textStyleModel,d=new Qu({cursor:h,draggable:!0,drift:a,onmousemove:function(t){_e(t.event)},ondragend:s,style:Yp(c,{x:0,y:0,text:""})});d.ensureState("blur").style={opacity:.1},d.stateTransition={duration:200},this.group.add(d);var p=[l,0],f=this._shapes;f.handleThumbs[n]=u,f.handleLabelPoints[n]=p,f.handleLabels[n]=d},n.prototype._createIndicator=function(t,e,n,r,i){var o=ho(t.get("indicatorSize"),n[0]),a=Cx(t.get("indicatorIcon"),-o/2,-o/2,o,o,null,!0);a.attr({cursor:"move",invisible:!0,silent:!0,x:n[0]/2});var s=t.getModel("indicatorStyle").getItemStyle();if(a instanceof Iu){var l=a.style;a.useStyle(L({image:l.image,x:l.x,y:l.y,width:l.width,height:l.height},s))}else a.useStyle(s);e.add(a);var u=this.visualMapModel.textStyleModel,h=new Qu({silent:!0,invisible:!0,style:Yp(u,{x:0,y:0,text:""})});this.group.add(h);var c=[("horizontal"===i?r/2:6)+n[0]/2,0],d=this._shapes;d.indicator=a,d.indicatorLabel=h,d.indicatorLabelPoint=c,this._firstShowIndicator=!0},n.prototype._dragHandle=function(t,e,n,r){if(this._useHandle){if(this._dragging=!e,!e){var i=this._applyTransform([n,r],this._shapes.mainGroup,!0);this._updateInterval(t,i[1]),this._hideIndicator(),this._updateView()}e===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),e?!this._hovering&&this._clearHoverLinkToSeries():l$(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[t],!1)}},n.prototype._resetInterval=function(){var t=this.visualMapModel,e=this._dataInterval=t.getSelected(),n=t.getExtent(),r=[0,t.itemSize[1]];this._handleEnds=[n$(e[0],n,r,!0),n$(e[1],n,r,!0)]},n.prototype._updateInterval=function(t,e){e=e||0;var n=this.visualMapModel,r=this._handleEnds,i=[0,n.itemSize[1]];JV(e,r,i,t,0);var o=n.getExtent();this._dataInterval=[n$(r[0],i,o,!0),n$(r[1],i,o,!0)]},n.prototype._updateView=function(t){var e=this.visualMapModel,n=e.getExtent(),r=this._shapes,i=[0,e.itemSize[1]],o=t?i:this._handleEnds,a=this._createBarVisual(this._dataInterval,n,o,"inRange"),s=this._createBarVisual(n,n,i,"outOfRange");r.inRange.setStyle({fill:a.barColor}).setShape("points",a.barPoints),r.outOfRange.setStyle({fill:s.barColor}).setShape("points",s.barPoints),this._updateHandle(o,a)},n.prototype._createBarVisual=function(t,e,n,r){var i={forceState:r,convertOpacityToAlpha:!0},o=this._makeColorGradient(t,i),a=[this.getControllerVisual(t[0],"symbolSize",i),this.getControllerVisual(t[1],"symbolSize",i)],s=this._createBarPoints(n,a);return{barColor:new Id(0,0,0,1,o),barPoints:s,handlesColor:[o[0].color,o[o.length-1].color]}},n.prototype._makeColorGradient=function(t,e){var n=[],r=(t[1]-t[0])/100;n.push({color:this.getControllerVisual(t[0],"color",e),offset:0});for(var i=1;i<100;i++){var o=t[0]+r*i;if(o>t[1])break;n.push({color:this.getControllerVisual(o,"color",e),offset:i/100})}return n.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),n},n.prototype._createBarPoints=function(t,e){var n=this.visualMapModel.itemSize;return[[n[0]-e[0],t[0]],[n[0],t[0]],[n[0],t[1]],[n[0]-e[1],t[1]]]},n.prototype._createBarGroup=function(t){var e=this._orient,n=this.visualMapModel.get("inverse");return new Do("horizontal"!==e||n?"horizontal"===e&&n?{scaleX:"bottom"===t?-1:1,rotation:-Math.PI/2}:"vertical"!==e||n?{scaleX:"left"===t?1:-1}:{scaleX:"left"===t?1:-1,scaleY:-1}:{scaleX:"bottom"===t?1:-1,rotation:Math.PI/2})},n.prototype._updateHandle=function(t,e){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,o=n.handleLabels,a=r.itemSize,s=r.getExtent(),l=this._applyTransform("left",n.mainGroup);r$([0,1],function(u){var h=i[u];h.setStyle("fill",e.handlesColor[u]),h.y=t[u];var c=n$(t[u],[0,a[1]],s,!0),d=this.getControllerVisual(c,"symbolSize");h.scaleX=h.scaleY=d/a[0],h.x=a[0]-d/2;var p=fp(n.handleLabelPoints[u],pp(h,this.group));if("horizontal"===this._orient){var f="left"===l||"top"===l?(a[0]-d)/2:(a[0]-d)/-2;p[1]+=f}o[u].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[u]),verticalAlign:"middle",align:"vertical"===this._orient?this._applyTransform("left",n.mainGroup):"center"})},this)}},n.prototype._showIndicator=function(t,e,n,r){var i=this.visualMapModel,o=i.getExtent(),a=i.itemSize,s=[0,a[1]],l=this._shapes,u=l.indicator;if(u){u.attr("invisible",!1);var h=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0}),c=this.getControllerVisual(t,"symbolSize"),d=n$(t,o,s,!0),p=a[0]-c/2,f={x:u.x,y:u.y};u.y=d,u.x=p;var g=fp(l.indicatorLabelPoint,pp(u,this.group)),m=l.indicatorLabel;m.attr("invisible",!1);var v=this._applyTransform("left",l.mainGroup),y="horizontal"===this._orient;m.setStyle({text:(n||"")+i.formatValueText(e),verticalAlign:y?v:"middle",align:y?"center":v});var _={x:p,y:d,style:{fill:h}},x={style:{x:g[0],y:g[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var b={duration:100,easing:"cubicInOut",additive:!0};u.x=f.x,u.y=f.y,u.animateTo(_,b),m.animateTo(x,b)}else u.attr(_),m.attr(x);this._firstShowIndicator=!1;var w=this._shapes.handleLabels;if(w)for(var S=0;S<w.length;S++)this.api.enterBlur(w[S])}},n.prototype._enableHoverLinkToSeries=function(){var t=this;this._shapes.mainGroup.on("mousemove",function(e){if(t._hovering=!0,!t._dragging){var n=t.visualMapModel.itemSize,r=t._applyTransform([e.offsetX,e.offsetY],t._shapes.mainGroup,!0,!0);r[1]=i$(o$(0,r[1]),n[1]),t._doHoverLinkToSeries(r[1],0<=r[0]&&r[0]<=n[0])}}).on("mouseout",function(){t._hovering=!1,!t._dragging&&t._clearHoverLinkToSeries()})},n.prototype._enableHoverLinkFromSeries=function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},n.prototype._doHoverLinkToSeries=function(t,e){var n=this.visualMapModel,r=n.itemSize;if(n.option.hoverLink){var i=[0,r[1]],o=n.getExtent();t=i$(o$(i[0],t),i[1]);var a=function(t,e,n){var r=6,i=t.get("hoverLinkDataSize");i&&(r=n$(i,e,n,!0)/2);return r}(n,o,i),s=[t-a,t+a],l=n$(t,i,o,!0),u=[n$(s[0],i,o,!0),n$(s[1],i,o,!0)];s[0]<i[0]&&(u[0]=-1/0),s[1]>i[1]&&(u[1]=1/0),e&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",a):u[1]===1/0?this._showIndicator(l,u[0],"> ",a):this._showIndicator(l,l,"≈ ",a));var h=this._hoverLinkDataIndices,c=[];(e||l$(n))&&(c=this._hoverLinkDataIndices=n.findTargetDataIndices(u));var d=function(t,e){var n={},r={};return i(t||[],n),i(e||[],r,n),[o(n),o(r)];function i(t,e,n){for(var r=0,i=t.length;r<i;r++){var o=ja(t[r].seriesId,null);if(null==o)return;for(var a=Ba(t[r].dataIndex),s=n&&n[o],l=0,u=a.length;l<u;l++){var h=a[l];s&&s[h]?s[h]=null:(e[o]||(e[o]={}))[h]=1}}}function o(t,e){var n=[];for(var r in t)if(t.hasOwnProperty(r)&&null!=t[r])if(e)n.push(+r);else{var i=o(t[r],!0);i.length&&n.push({seriesId:r,dataIndex:i})}return n}}(h,c);this._dispatchHighDown("downplay",e$(d[0],n)),this._dispatchHighDown("highlight",e$(d[1],n))}},n.prototype._hoverLinkFromSeriesMouseOver=function(t){var e;if(ix(t.target,function(t){var n=$u(t);if(null!=n.dataIndex)return e=n,!0},!0),e){var n=this.ecModel.getSeriesByIndex(e.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(e.dataType),o=i.getStore().get(r.getDataDimensionIndex(i),e.dataIndex);isNaN(o)||this._showIndicator(o,o)}}},n.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var e=this._shapes.handleLabels;if(e)for(var n=0;n<e.length;n++)this.api.leaveBlur(e[n])},n.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var t=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",e$(t,this.visualMapModel)),t.length=0},n.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var t=this.api.getZr();t.off("mouseover",this._hoverLinkFromSeriesMouseOver),t.off("mouseout",this._hideIndicator)},n.prototype._applyTransform=function(t,e,n,r){var i=pp(e,r?null:this.group);return j(t)?fp(t,i,n):gp(t,i,n)},n.prototype._dispatchHighDown=function(t,e){e&&e.length&&this.api.dispatchAction({type:t,batch:e})},n.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},n.type="visualMap.continuous",n}(QQ);function s$(t,e,n,r){return new sd({shape:{points:t},draggable:!!n,cursor:e,drift:n,onmousemove:function(t){_e(t.event)},ondragend:r})}function l$(t){var e=t.get("hoverLinkOnHandle");return!!(null==e?t.get("realtime"):e)}function u$(t){return"vertical"===t?"ns-resize":"ew-resize"}var h$=a$,c$={type:"selectDataRange",event:"dataRangeSelected",update:"update"},d$=function(t,e){e.eachComponent({mainType:"visualMap",query:t},function(e){e.setSelected(t.selected)})},p$=[{createOnAllSeries:!0,reset:function(t,e){var n=[];return e.eachComponent("visualMap",function(e){var r,i,o,a,s,l=t.pipelineContext;!e.isTargetSeries(t)||l&&l.large||n.push((r=e.stateList,i=e.targetVisuals,o=W(e.getValueState,e),a=e.getDataDimensionIndex(t.getData()),s={},B(r,function(t){var e=zz.prepareVisualTypes(i[t]);s[t]=e}),{progress:function(t,e){var n,r;function l(t){return $_(e,r,t)}function u(t,n){ex(e,r,t,n)}null!=a&&(n=e.getDimensionIndex(a));for(var h=e.getStore();null!=(r=t.next());){var c=e.getRawDataItem(r);if(!c||!1!==c.visualMap)for(var d=null!=a?h.get(n,r):r,p=o(d),f=i[p],g=s[p],m=0,v=g.length;m<v;m++){var y=g[m];f[y]&&f[y].applyVisual(d,l,u)}}}}))}),n}},{createOnAllSeries:!0,reset:function(t,e){var n=t.getData(),r=[];e.eachComponent("visualMap",function(e){if(e.isTargetSeries(t)){var i=e.getVisualMeta(W(f$,null,t,e))||{stops:[],outerColors:[]},o=e.getDataDimensionIndex(n);o>=0&&(i.dimension=o,r.push(i))}}),t.getData().setVisual("visualMeta",r)}}];function f$(t,e,n,r){for(var i=e.targetVisuals[r],o=zz.prepareVisualTypes(i),a={color:tx(t.getData(),"color")},s=0,l=o.length;s<l;s++){var u=o[s],h=i["opacity"===u?"__alphaForOpacity":u];h&&h.applyVisual(n,c,d)}return a.color;function c(t){return a[t]}function d(t,e){a[t]=e}}var g$=B;function m$(t){var e=t&&t.visualMap;j(e)||(e=e?[e]:[]),g$(e,function(t){if(t){v$(t,"splitList")&&!v$(t,"pieces")&&(t.pieces=t.splitList,delete t.splitList);var e=t.pieces;e&&j(e)&&g$(e,function(t){J(t)&&(v$(t,"start")&&!v$(t,"min")&&(t.min=t.start),v$(t,"end")&&!v$(t,"max")&&(t.max=t.end))});var n=t.seriesTargets;n&&j(n)&&g$(n,function(t){J(t)&&null!=t.dimension||console.warn("Each seriesTarget should have a dimension property"),null==t.seriesIndex&&null==t.seriesId&&console.warn("Each seriesTarget should have either seriesIndex or seriesId")})}})}function v$(t,e){return t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var y$=!1;function _$(t){y$||(y$=!0,t.registerSubTypeDefaulter("visualMap",function(t){return t.categories||(t.pieces?t.pieces.length>0:t.splitNumber>0)&&!t.calculable?"piecewise":"continuous"}),t.registerAction(c$,d$),B(p$,function(e){t.registerVisual(t.PRIORITY.VISUAL.COMPONENT,e)}),t.registerPreprocessor(m$))}function x$(t){t.registerComponentModel(KQ),t.registerComponentView(h$),_$(t)}var b$=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e._pieceList=[],e}return e(n,t),n.prototype.optionUpdated=function(e,n){t.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],w$[this._mode].call(this,this._pieceList),this._resetSelected(e,n);var i=this.option.categories;this.resetVisual(function(t,e){"categories"===r?(t.mappingMethod="category",t.categories=I(i)):(t.dataExtent=this.getExtent(),t.mappingMethod="piecewise",t.pieceList=V(this._pieceList,function(t){return t=I(t),"inRange"!==e&&(t.visual=null),t}))})},n.prototype.completeVisualOption=function(){var e=this.option,n={},r=zz.listVisualTypes(),i=this.isCategory();function o(t,e,n){return t&&t[e]&&t[e].hasOwnProperty(n)}B(e.pieces,function(t){B(r,function(e){t.hasOwnProperty(e)&&(n[e]=1)})}),B(n,function(t,n){var r=!1;B(this.stateList,function(t){r=r||o(e,t,n)||o(e.target,t,n)},this),!r&&B(this.stateList,function(t){(e[t]||(e[t]={}))[n]=BQ.get(n,"inRange"===t?"active":"inactive",i)})},this),t.prototype.completeVisualOption.apply(this,arguments)},n.prototype._resetSelected=function(t,e){var n=this.option,r=this._pieceList,i=(e?n:t).selected||{};if(n.selected=i,B(r,function(t,e){var n=this.getSelectedMapKey(t);i.hasOwnProperty(n)||(i[n]=!0)},this),"single"===n.selectedMode){var o=!1;B(r,function(t,e){var n=this.getSelectedMapKey(t);i[n]&&(o?i[n]=!1:o=!0)},this)}},n.prototype.getItemSymbol=function(){return this.get("itemSymbol")},n.prototype.getSelectedMapKey=function(t){return"categories"===this._mode?t.value+"":t.index+""},n.prototype.getPieceList=function(){return this._pieceList},n.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},n.prototype.setSelected=function(t){this.option.selected=I(t)},n.prototype.getValueState=function(t){var e=zz.findPieceIndex(t,this._pieceList);return null!=e&&this.option.selected[this.getSelectedMapKey(this._pieceList[e])]?"inRange":"outOfRange"},n.prototype.findTargetDataIndices=function(t){var e=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],o=r.getData();o.each(this.getDataDimensionIndex(o),function(e,r){zz.findPieceIndex(e,n)===t&&i.push(r)},this),e.push({seriesId:r.id,dataIndex:i})},this),e},n.prototype.getRepresentValue=function(t){var e;if(this.isCategory())e=t.value;else if(null!=t.value)e=t.value;else{var n=t.interval||[];e=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return e},n.prototype.getVisualMeta=function(t){if(!this.isCategory()){var e=[],n=["",""],r=this,i=this._pieceList.slice();if(i.length){var o=i[0].interval[0];o!==-1/0&&i.unshift({interval:[-1/0,o]}),(o=i[i.length-1].interval[1])!==1/0&&i.push({interval:[o,1/0]})}else i.push({interval:[-1/0,1/0]});var a=-1/0;return B(i,function(t){var e=t.interval;e&&(e[0]>a&&s([a,e[0]],"outOfRange"),s(e.slice()),a=e[1])},this),{stops:e,outerColors:n}}function s(i,o){var a=r.getRepresentValue({interval:i});o||(o=r.getValueState(a));var s=t(a,o);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:e.push({value:i[0],color:s},{value:i[1],color:s})}},n.type="visualMap.piecewise",n.defaultOption=Sf(jQ.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),n}(jQ),w$={splitNumber:function(t){var e=this.option,n=Math.min(e.precision,20),r=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var o=(r[1]-r[0])/i;+o.toFixed(n)!==o&&n<5;)n++;e.precision=n,o=+o.toFixed(n),e.minOpen&&t.push({interval:[-1/0,r[0]],close:[0,0]});for(var a=0,s=r[0];a<i;s+=o,a++){var l=a===i-1?r[1]:s+o;t.push({interval:[s,l],close:[1,1]})}e.maxOpen&&t.push({interval:[r[1],1/0],close:[0,0]}),ya(t),B(t,function(t,e){t.index=e,t.text=this.formatValueText(t.interval)},this)},categories:function(t){var e=this.option;B(e.categories,function(e){t.push({text:this.formatValueText(e,!0),value:e})},this),S$(e,t)},pieces:function(t){var e=this.option;B(e.pieces,function(e,n){J(e)||(e={value:e});var r={text:"",index:n};if(null!=e.label&&(r.text=e.label),e.hasOwnProperty("value")){var i=r.value=e.value;r.interval=[i,i],r.close=[1,1]}else{for(var o=r.interval=[],a=r.close=[0,0],s=[1,0,1],l=[-1/0,1/0],u=[],h=0;h<2;h++){for(var c=[["gte","gt","min"],["lte","lt","max"]][h],d=0;d<3&&null==o[h];d++)o[h]=e[c[d]],a[h]=s[d],u[h]=2===d;null==o[h]&&(o[h]=l[h])}u[0]&&o[1]===1/0&&(a[0]=0),u[1]&&o[0]===-1/0&&(a[1]=0),o[0]>o[1]&&console.warn("Piece "+n+"is illegal: "+o+" lower bound should not greater then uppper bound."),o[0]===o[1]&&a[0]&&a[1]&&(r.value=o[0])}r.visual=zz.retrieveVisuals(e),t.push(r)},this),S$(e,t),ya(t),B(t,function(t){var e=t.close,n=[["<","≤"][e[1]],[">","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,n)},this)}};function S$(t,e){var n=t.inverse;("vertical"===t.orient?!n:n)&&e.reverse()}var T$=b$,M$=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.doRender=function(){var t=this.group;t.removeAll();var e=this.visualMapModel,n=e.get("textGap"),r=e.textStyleModel,i=this._getItemAlign(),o=e.itemSize,a=this._getViewData(),s=a.endsText,l=ot(e.get("showLabel",!0),!s),u=!e.get("selectedMode");s&&this._renderEndsText(t,s[0],o,l,i),B(a.viewPieceList,function(a){var s=a.piece,h=new Do;h.onclick=W(this._onItemClick,this,s),this._enableHoverLink(h,a.indexInModelPieceList);var c=e.getRepresentValue(s);if(this._createItemSymbol(h,c,[0,0,o[0],o[1]],u),l){var d=this.visualMapModel.getValueState(c),p=r.get("align")||i;h.add(new Qu({style:Yp(r,{x:"right"===p?-n:o[0]+n,y:o[1]/2,text:s.text,verticalAlign:r.get("verticalAlign")||"middle",align:p,opacity:at(r.get("opacity"),"outOfRange"===d?.5:1)}),silent:u}))}t.add(h)},this),s&&this._renderEndsText(t,s[1],o,l,i),Fg(e.get("orient"),t,e.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},n.prototype._enableHoverLink=function(t,e){var n=this;t.on("mouseover",function(){return r("highlight")}).on("mouseout",function(){return r("downplay")});var r=function(t){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:t,batch:e$(r.findTargetDataIndices(e),r)})}},n.prototype._getItemAlign=function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return t$(t,this.api,t.itemSize);var n=e.align;return n&&"auto"!==n||(n="left"),n},n.prototype._renderEndsText=function(t,e,n,r,i){if(e){var o=new Do,a=this.visualMapModel.textStyleModel;o.add(new Qu({style:Yp(a,{x:r?"right"===i?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:"middle",align:r?i:"center",text:e})})),t.add(o)}},n.prototype._getViewData=function(){var t=this.visualMapModel,e=V(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),n=t.get("text"),r=t.get("orient"),i=t.get("inverse");return("horizontal"===r?i:!i)?e.reverse():n&&(n=n.slice().reverse()),{viewPieceList:e,endsText:n}},n.prototype._createItemSymbol=function(t,e,n,r){var i=Cx(this.getControllerVisual(e,"symbol"),n[0],n[1],n[2],n[3],this.getControllerVisual(e,"color"));i.silent=r,t.add(i)},n.prototype._onItemClick=function(t){var e=this.visualMapModel,n=e.option,r=n.selectedMode;if(r){var i=I(n.selected),o=e.getSelectedMapKey(t);"single"===r||!0===r?(i[o]=!0,B(i,function(t,e){i[e]=e===o})):i[o]=!i[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},n.type="visualMap.piecewise",n}(QQ),C$=M$;function I$(t){t.registerComponentModel(T$),t.registerComponentView(C$),_$(t)}var A$=function(){function t(t){this._thumbnailModel=t}return t.prototype.reset=function(t){this._renderVersion=t.getECUpdateCycleVersion()},t.prototype.renderContent=function(t){var e=t.api.getViewOfComponentModel(this._thumbnailModel);e&&(t.group.silent=!0,e.renderContent({group:t.group,targetTrans:t.targetTrans,z2Range:Rp(t.group),roamType:t.roamType,viewportRect:t.viewportRect,renderVersion:this._renderVersion}))},t.prototype.updateWindow=function(t,e){var n=e.getViewOfComponentModel(this._thumbnailModel);n&&n.updateWindow({targetTrans:t,renderVersion:this._renderVersion})},t}(),D$=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e.preventAutoZ=!0,e}return e(n,t),n.prototype.optionUpdated=function(t,e){this._updateBridge()},n.prototype._updateBridge=function(){var t=this._birdge=this._birdge||new A$(this);(this._target=null,this.ecModel.eachSeries(function(t){YB(t,null)}),this.shouldShow())&&YB(this.getTarget().baseMapProvider,t)},n.prototype.shouldShow=function(){return this.getShallow("show",!0)},n.prototype.getBridge=function(){return this._birdge},n.prototype.getTarget=function(){if(this._target)return this._target;var t=this.getReferringComponents("series",{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];return t?"graph"!==t.subType&&La("series."+(t=null).subType+" is not supported in thumbnail.",!0):t=this.ecModel.queryComponents({mainType:"series",subType:"graph"})[0],this._target={baseMapProvider:t},this._target},n.type="thumbnail",n.layoutMode="box",n.dependencies=["series","geo"],n.defaultOption={show:!0,right:1,bottom:1,height:"25%",width:"25%",itemStyle:{borderColor:om.color.border,borderWidth:2},windowStyle:{borderWidth:1,color:om.color.neutral30,borderColor:om.color.neutral40,opacity:.3},z:10},n}(tm),L$=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=n.type,e}return e(n,t),n.prototype.render=function(t,e,n){if(this._api=n,this._model=t,this._coordSys||(this._coordSys=new aR),this._isEnabled()){this._renderVersion=n.getECUpdateCycleVersion();var r=this.group;r.removeAll();var i=t.getModel("itemStyle"),o=i.getItemStyle();null==o.fill&&(o.fill=e.get("backgroundColor")||om.color.neutral00);var a=jg(t,n).refContainer,s=Ug(Gg(t,!0),a),l=o.lineWidth||0,u=this._contentRect=Tp(s.clone(),l/2,!0,!0),h=new Do;r.add(h),h.setClipPath(new Ru({shape:u.plain()}));var c=this._targetGroup=new Do;h.add(c);var d=s.plain();d.r=i.getShallow("borderRadius",!0),r.add(this._bgRect=new Ru({style:o,shape:d,silent:!1,cursor:"grab"}));var p=t.getModel("windowStyle"),f=p.getShallow("borderRadius",!0);h.add(this._windowRect=new Ru({shape:{x:0,y:0,width:0,height:0,r:f},style:p.getItemStyle(),silent:!1,cursor:"grab"})),this._dealRenderContent(),this._dealUpdateWindow(),E$(t,this)}else this._clear()},n.prototype.renderContent=function(t){this._bridgeRendered=t,this._isEnabled()&&(this._dealRenderContent(),this._dealUpdateWindow(),E$(this._model,this))},n.prototype._dealRenderContent=function(){var t=this._bridgeRendered;if(t&&t.renderVersion===this._renderVersion){var e=this._targetGroup,n=this._coordSys,r=this._contentRect;if(e.removeAll(),t){var i=t.group,o=i.getBoundingRect();e.add(i),this._bgRect.z2=t.z2Range.min-10,EN(n,o.x,o.y,o.width,o.height);var a=Ug({left:"center",top:"center",aspect:o.width/o.height},r);ON(n,a.x,a.y,a.width,a.height),IN(i,n,0),i.dirty(),this._windowRect.z2=t.z2Range.max+10,this._resetRoamController(t.roamType)}}},n.prototype.updateWindow=function(t){var e=this._bridgeRendered;e&&e.renderVersion===t.renderVersion&&(e.targetTrans=t.targetTrans),this._isEnabled()&&this._dealUpdateWindow()},n.prototype._dealUpdateWindow=function(){var t=this._bridgeRendered;if(t&&t.renderVersion===this._renderVersion){var e=Pe([],t.targetTrans),n=Ie([],SN(null,this._coordSys),e);this._transThisToTarget=Pe([],n);var r=t.viewportRect;(r=r?r.clone():new ln(0,0,this._api.getWidth(),this._api.getHeight())).applyTransform(n);var i=this._windowRect,o=i.shape.r;i.setShape(E({r:o},r))}},n.prototype._resetRoamController=function(t){var e=this,n=this._api,r=this._roamController;r||(r=this._roamController=new kO(n.getZr())),t&&this._isEnabled()?(r.enable(t,{api:n,zInfo:{component:this._model},triggerInfo:{roamTrigger:null,isInSelf:function(t,n,r){return e._contentRect.contain(n,r)}}}),r.off("pan").off("zoom").on("pan",W(this._onPan,this)).on("zoom",W(this._onZoom,this))):r.disable()},n.prototype._onPan=function(t){var e=this._transThisToTarget;if(this._isEnabled()&&e){var n=Xt([],[t.oldX,t.oldY],e),r=Xt([],[t.oldX-t.dx,t.oldY-t.dy],e);this._api.dispatchAction(P$(this._model.getTarget().baseMapProvider,{dx:r[0]-n[0],dy:r[1]-n[1]}))}},n.prototype._onZoom=function(t){var e=this._transThisToTarget;if(this._isEnabled()&&e){var n=Xt([],[t.originX,t.originY],e);this._api.dispatchAction(P$(this._model.getTarget().baseMapProvider,{zoom:1/t.scale,originX:n[0],originY:n[1]}))}},n.prototype._isEnabled=function(){var t=this._model;return!(!t||!t.shouldShow())&&!!t.getTarget().baseMapProvider},n.prototype._clear=function(){this.group.removeAll(),this._bridgeRendered=null,this._roamController&&this._roamController.disable()},n.prototype.remove=function(){this._clear()},n.prototype.dispose=function(){this._clear()},n.type="thumbnail",n}(Qy);function P$(t,e){var n={type:"series"===t.mainType?t.subType+"Roam":t.mainType+"Roam"};return n[t.mainType+"Id"]=t.id,L(n,e),n}function E$(t,e){var n=Np(t);kp(e.group,n.z,n.zlevel)}var O$={label:{enabled:!0},decal:{show:!1}},N$=Qa(),R$=Qa(),k$=Is(function(t,e){var n=t.getModel("aria");if(!n.get("enabled"))return;var r=R$(t).scope||(R$(t).scope={}),i=I(O$);function o(t,e){if(!Y(t))return t;var n=t;return B(e,function(t,e){n=n.replace(new RegExp("\\{\\s*"+e+"\\s*\\}","g"),t)}),n}A(i.label,t.getLocaleModel().get("aria"),!1),A(n.option,i,!1),function(){if(n.getModel("decal").get("show")){var e=yt();t.eachSeries(function(t){t.isColorBySeries()||(N$(t).scope=e.get(t.type)||e.set(t.type,{}))}),t.eachSeries(function(e){if(Z(e.enableAriaDecal))e.enableAriaDecal();else{var n=e.getData();if(e.isColorBySeries()){var i=Im(e.ecModel,e.name,r,t.getSeriesCount()),o=n.getVisual("decal");n.setVisual("decal",h(o,i))}else{var a=e.getRawData(),s={},l=N$(e).scope;n.each(function(t){var e=n.getRawIndex(t);s[e]=t});var u=a.count();a.each(function(t){var r=s[t],i=a.getName(t)||t+"",o=Im(e.ecModel,i,l,u),c=n.getItemVisual(r,"decal");n.setItemVisual(r,"decal",h(c,o))})}}function h(t,e){var n=t?L(L({},e),t):e;return n.dirty=!0,n}})}}(),function(){var r=e.getZr().dom;if(r){var i=t.getLocaleModel().get("aria"),a=n.getModel("label");if(a.option=E(a.option,i),a.get("enabled"))if(r.setAttribute("role","img"),a.get("description"))r.setAttribute("aria-label",a.get("description"));else{var s,l=t.getSeriesCount(),u=a.get(["data","maxCount"])||10,h=a.get(["series","maxCount"])||10,c=Math.min(l,h);if(!(l<1)){var d=function(){var e=t.get("title");return e&&e.length&&(e=e[0]),e&&e.text}();s=d?o(a.get(["general","withTitle"]),{title:d}):a.get(["general","withoutTitle"]);var p=[];s+=o(l>1?a.get(["series","multiple","prefix"]):a.get(["series","single","prefix"]),{seriesCount:l}),t.eachSeries(function(e,n){if(n<c){var r=void 0,i=e.get("name")?"withName":"withoutName";r=o(r=l>1?a.get(["series","multiple",i]):a.get(["series","single",i]),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(x=e.subType,b=t.getLocaleModel().get(["series","typeNames"]),b[x]||b.chart)});var s=e.getData();s.count()>u?r+=o(a.get(["data","partialData"]),{displayCnt:u}):r+=a.get(["data","allData"]);for(var h=a.get(["data","separator","middle"]),d=a.get(["data","separator","end"]),f=a.get(["data","excludeDimensionId"]),g=[],m=0;m<s.count();m++)if(m<u){var v=s.getName(m),y=f?G(s.getValues(m),function(t,e){return-1===N(f,e)}):s.getValues(m),_=a.get(["data",v?"withName":"withoutName"]);g.push(o(_,{name:v,value:y.join(h)}))}r+=g.join(h)+d,p.push(r)}var x,b});var f=a.getModel(["series","multiple","separator"]),g=f.get("middle"),m=f.get("end");s+=p.join(g)+m,r.setAttribute("aria-label",s)}}}}()});function z$(t){if(t&&t.aria){var e=t.aria;null!=e.show&&(e.enabled=e.show),e.label=e.label||{},B(["description","general","series","data"],function(t){null!=e[t]&&(e.label[t]=e[t])})}}var B$={value:"eq","<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},V$=function(){function t(t){if(null==(this._condVal=Y(t)?new RegExp(t):rt(t)?t:null)){Na(Oa("Illegal regexp",t,"in"))}}return t.prototype.evaluate=function(t){var e=typeof t;return Y(e)?this._condVal.test(t):!!K(e)&&this._condVal.test(t+"")},t}(),F$=function(){function t(){}return t.prototype.evaluate=function(){return this.value},t}(),G$=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(!t[e].evaluate())return!1;return!0},t}(),H$=function(){function t(){}return t.prototype.evaluate=function(){for(var t=this.children,e=0;e<t.length;e++)if(t[e].evaluate())return!0;return!1},t}(),U$=function(){function t(){}return t.prototype.evaluate=function(){return!this.child.evaluate()},t}(),W$=function(){function t(){}return t.prototype.evaluate=function(){for(var t=!!this.valueParser,e=(0,this.getValue)(this.valueGetterParam),n=t?this.valueParser(e):null,r=0;r<this.subCondList.length;r++)if(!this.subCondList[r].evaluate(t?n:e))return!1;return!0},t}();function X$(t,e){if(!0===t||!1===t){var n=new F$;return n.value=t,n}return Z$(t)||Na(Oa("Illegal config. Expect a plain object but actually",t)),t.and?j$("and",t,e):t.or?j$("or",t,e):t.not?function(t,e){var n=t.not,r="";r=Oa('"not" condition should only be `not: {}`.',"Illegal condition:",t),Z$(n)||Na(r);var i=new U$;i.child=X$(n,e),i.child||Na(r);return i}(t,e):function(t,e){for(var n=e.prepareGetValue(t),r=[],i=U(t),o=t.parser,a=o?Xv(o):null,s=0;s<i.length;s++){var l=i[s];if("parser"!==l&&!e.valueGetterAttrMap.get(l)){var u=wt(B$,l)?B$[l]:l,h=t[l],c=a?a(h):h,d=Kv(u,c)||"reg"===u&&new V$(c);d||Na(Oa('Illegal relational operation: "'+l+'" in condition:',t)),r.push(d)}}r.length||Na(Oa("Relational condition must have at least one operator.","Illegal condition:",t));var p=new W$;return p.valueGetterParam=n,p.valueParser=a,p.getValue=e.getValue,p.subCondList=r,p}(t,e)}function j$(t,e,n){var r,i=e[t];r=Oa('"and"/"or" condition should only be `'+t+": [...]` and must not be empty array.","Illegal condition:",e),j(i)||Na(r),i.length||Na(r);var o="and"===t?new G$:new H$;return o.children=V(i,function(t){return X$(t,n)}),o.children.length||Na(r),o}function Z$(t){return J(t)&&!z(t)}var Y$=function(){function t(t,e){this._cond=X$(t,e)}return t.prototype.evaluate=function(){return this._cond.evaluate()},t}();var q$,K$={type:"echarts:filter",transform:function(t){for(var e,n,r,i=t.upstream,o=(n=t.config,r={valueGetterAttrMap:yt({dimension:!0}),prepareGetValue:function(t){var e=t.dimension;wt(t,"dimension")||Na(Oa('Relation condition must has prop "dimension" specified.',"Illegal condition:",t));var n=i.getDimensionInfo(e);return n||Na(Oa("Can not find dimension info via: "+e+".\n","Existing dimensions: ",i.cloneAllDimensionInfo(),".\n","Illegal condition:",t,".\n")),{dimIdx:n.index}},getValue:function(t){return i.retrieveValueFromItem(e,t.dimIdx)}},new Y$(n,r)),a=[],s=0,l=i.count();s<l;s++)e=i.getRawDataItem(s),o.evaluate()&&a.push(e);return{data:a}}};q$=["Valid config is like:",'{ dimension: "age", order: "asc" }','or [{ dimension: "age", order: "asc"], { dimension: "date", order: "desc" }]'].join(" ");var J$={type:"echarts:sort",transform:function(t){var e=t.upstream,n=t.config,r=Ba(n);r.length||Na("Empty `config` in sort transform.");var i=[];B(r,function(t){var n=t.dimension,r=t.order,o=t.parser,a=t.incomparable;if(null==n&&Na('Sort transform config must has "dimension" specified.'+q$),"asc"!==r&&"desc"!==r&&Na('Sort transform config must has "order" specified.'+q$),a&&"min"!==a&&"max"!==a){Na('incomparable must be "min" or "max" rather than "'+a+'".')}if("asc"!==r&&"desc"!==r){Na('order must be "asc" or "desc" rather than "'+r+'".')}var s=e.getDimensionInfo(n);s||Na(Oa("Can not find dimension info via: "+n+".\n","Existing dimensions: ",e.cloneAllDimensionInfo(),".\n","Illegal config:",t,".\n"));var l=o?Xv(o):null;o&&!l&&Na(Oa("Invalid parser name "+o+".\n","Illegal config:",t,".\n")),i.push({dimIdx:s.index,parser:l,comparator:new Yv(r,a)})});var o=e.sourceFormat;o!==oh&&o!==ah&&Na('sourceFormat "'+o+'" is not supported yet');for(var a=[],s=0,l=e.count();s<l;s++)a.push(e.getRawDataItem(s));return a.sort(function(t,n){for(var r=0;r<i.length;r++){var o=i[r],a=e.retrieveValueFromItem(t,o.dimIdx),s=e.retrieveValueFromItem(n,o.dimIdx);o.parser&&(a=o.parser(a),s=o.parser(s));var l=o.comparator.evaluate(a,s);if(0!==l)return l}return 0}),{data:a}}};var Q$=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return e(n,t),n.prototype.init=function(e,n,r){t.prototype.init.call(this,e,n,r),this._sourceManager=new yy(this),_y(this)},n.prototype.mergeOption=function(e,n){t.prototype.mergeOption.call(this,e,n),_y(this)},n.prototype.optionUpdated=function(){this._sourceManager.dirty()},n.prototype.getSourceManager=function(){return this._sourceManager},n.type="dataset",n.defaultOption={seriesLayoutBy:hh},n}(tm),$$=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dataset",e}return e(n,t),n.type="dataset",n}(Qy);function t0(t){t.registerComponentModel(Q$),t.registerComponentView($$)}var e0=Ql.CMD;function n0(t,e){return Math.abs(t-e)<1e-5}function r0(t){var e,n,r,i,o,a=t.data,s=t.len(),l=[],u=0,h=0,c=0,d=0;function p(t,n){e&&e.length>2&&l.push(e),e=[t,n]}function f(t,n,r,i){n0(t,r)&&n0(n,i)||e.push(t,n,r,i,r,i)}function g(t,n,r,i,o,a){var s=Math.abs(n-t),l=4*Math.tan(s/4)/3,u=n<t?-1:1,h=Math.cos(t),c=Math.sin(t),d=Math.cos(n),p=Math.sin(n),f=h*o+r,g=c*a+i,m=d*o+r,v=p*a+i,y=o*l*u,_=a*l*u;e.push(f-y*c,g+_*h,m+y*p,v-_*d,m,v)}for(var m=0;m<s;){var v=a[m++],y=1===m;switch(y&&(c=u=a[m],d=h=a[m+1],v!==e0.L&&v!==e0.C&&v!==e0.Q||(e=[c,d])),v){case e0.M:u=c=a[m++],h=d=a[m++],p(c,d);break;case e0.L:f(u,h,n=a[m++],r=a[m++]),u=n,h=r;break;case e0.C:e.push(a[m++],a[m++],a[m++],a[m++],u=a[m++],h=a[m++]);break;case e0.Q:n=a[m++],r=a[m++],i=a[m++],o=a[m++],e.push(u+2/3*(n-u),h+2/3*(r-h),i+2/3*(n-i),o+2/3*(r-o),i,o),u=i,h=o;break;case e0.A:var _=a[m++],x=a[m++],b=a[m++],w=a[m++],S=a[m++],T=a[m++]+S;m+=1;var M=!a[m++];n=Math.cos(S)*b+_,r=Math.sin(S)*w+x,y?p(c=n,d=r):f(u,h,n,r),u=Math.cos(T)*b+_,h=Math.sin(T)*w+x;for(var C=(M?-1:1)*Math.PI/2,I=S;M?I>T:I<T;I+=C){g(I,M?Math.max(I+C,T):Math.min(I+C,T),_,x,b,w)}break;case e0.R:c=u=a[m++],d=h=a[m++],n=c+a[m++],r=d+a[m++],p(n,d),f(n,d,n,r),f(n,r,c,r),f(c,r,c,d),f(c,d,n,d);break;case e0.Z:e&&f(u,h,c,d),u=c,h=d}}return e&&e.length>2&&l.push(e),l}function i0(t,e,n,r,i,o,a,s,l,u){if(n0(t,n)&&n0(e,r)&&n0(i,a)&&n0(o,s))l.push(a,s);else{var h=2/u,c=h*h,d=a-t,p=s-e,f=Math.sqrt(d*d+p*p);d/=f,p/=f;var g=n-t,m=r-e,v=i-a,y=o-s,_=g*g+m*m,x=v*v+y*y;if(_<c&&x<c)l.push(a,s);else{var b=d*g+p*m,w=-d*v-p*y;if(_-b*b<c&&b>=0&&x-w*w<c&&w>=0)l.push(a,s);else{var S=[],T=[];qn(t,n,i,a,.5,S),qn(e,r,o,s,.5,T),i0(S[0],T[0],S[1],T[1],S[2],T[2],S[3],T[3],l,u),i0(S[4],T[4],S[5],T[5],S[6],T[6],S[7],T[7],l,u)}}}}function o0(t,e,n){var r=t[e],i=t[1-e],o=Math.abs(r/i),a=Math.ceil(Math.sqrt(o*n)),s=Math.floor(n/a);0===s&&(s=1,a=n);for(var l=[],u=0;u<a;u++)l.push(s);var h=n-a*s;if(h>0)for(u=0;u<h;u++)l[u%a]+=1;return l}function a0(t,e,n){for(var r=t.r0,i=t.r,o=t.startAngle,a=t.endAngle,s=Math.abs(a-o),l=s*i,u=i-r,h=l>Math.abs(u),c=o0([l,u],h?0:1,e),d=(h?s:u)/c.length,p=0;p<c.length;p++)for(var f=(h?u:s)/c[p],g=0;g<c[p];g++){var m={};h?(m.startAngle=o+d*p,m.endAngle=o+d*(p+1),m.r0=r+f*g,m.r=r+f*(g+1)):(m.startAngle=o+f*g,m.endAngle=o+f*(g+1),m.r0=r+d*p,m.r=r+d*(p+1)),m.clockwise=t.clockwise,m.cx=t.cx,m.cy=t.cy,n.push(m)}}function s0(t,e,n,r){return t*r-n*e}function l0(t,e,n,r,i,o,a,s){var l=n-t,u=r-e,h=a-i,c=s-o,d=s0(h,c,l,u);if(Math.abs(d)<1e-6)return null;var p=s0(t-i,e-o,h,c)/d;return p<0||p>1?null:new Re(p*l+t,p*u+e)}function u0(t,e,n){var r=new Re;Re.sub(r,n,e),r.normalize();var i=new Re;return Re.sub(i,t,e),i.dot(r)}function h0(t,e){var n=t[t.length-1];n&&n[0]===e[0]&&n[1]===e[1]||t.push(e)}function c0(t){var e=t.points,n=[],r=[];Cl(e,n,r);var i=new ln(n[0],n[1],r[0]-n[0],r[1]-n[1]),o=i.width,a=i.height,s=i.x,l=i.y,u=new Re,h=new Re;return o>a?(u.x=h.x=s+o/2,u.y=l,h.y=l+a):(u.y=h.y=l+a/2,u.x=s,h.x=s+o),function(t,e,n){for(var r=t.length,i=[],o=0;o<r;o++){var a=t[o],s=t[(o+1)%r],l=l0(a[0],a[1],s[0],s[1],e.x,e.y,n.x,n.y);l&&i.push({projPt:u0(l,e,n),pt:l,idx:o})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(t,e){return t.projPt-e.projPt});var u=i[0],h=i[i.length-1];if(h.idx<u.idx){var c=u;u=h,h=c}var d=[u.pt.x,u.pt.y],p=[h.pt.x,h.pt.y],f=[d],g=[p];for(o=u.idx+1;o<=h.idx;o++)h0(f,t[o].slice());for(h0(f,p),h0(f,d),o=h.idx+1;o<=u.idx+r;o++)h0(g,t[o%r].slice());return h0(g,d),h0(g,p),[{points:f},{points:g}]}(e,u,h)}function d0(t,e,n,r){if(1===n)r.push(e);else{var i=Math.floor(n/2),o=t(e);d0(t,o[0],i,r),d0(t,o[1],n-i,r)}return r}function p0(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function f0(t,e){var n,r=[],i=t.shape;switch(t.type){case"rect":!function(t,e,n){for(var r=t.width,i=t.height,o=r>i,a=o0([r,i],o?0:1,e),s=o?"width":"height",l=o?"height":"width",u=o?"x":"y",h=o?"y":"x",c=t[s]/a.length,d=0;d<a.length;d++)for(var p=t[l]/a[d],f=0;f<a[d];f++){var g={};g[u]=d*c,g[h]=f*p,g[s]=c,g[l]=p,g.x+=t.x,g.y+=t.y,n.push(g)}}(i,e,r),n=Ru;break;case"sector":a0(i,e,r),n=td;break;case"circle":a0({r0:0,r:i.r,startAngle:0,endAngle:2*Math.PI,cx:i.cx,cy:i.cy},e,r),n=td;break;default:var o=t.getComputedTransform(),a=o?Math.sqrt(Math.max(o[0]*o[0]+o[1]*o[1],o[2]*o[2]+o[3]*o[3])):1,s=V(function(t,e){var n=r0(t),r=[];e=e||1;for(var i=0;i<n.length;i++){var o=n[i],a=[],s=o[0],l=o[1];a.push(s,l);for(var u=2;u<o.length;){var h=o[u++],c=o[u++],d=o[u++],p=o[u++],f=o[u++],g=o[u++];i0(s,l,h,c,d,p,f,g,a,e),s=f,l=g}r.push(a)}return r}(t.getUpdatedPathProxy(),a),function(t){return function(t){for(var e=[],n=0;n<t.length;)e.push([t[n++],t[n++]]);return e}(t)}),l=s.length;if(0===l)d0(c0,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var h=0,c=V(s,function(t){var e=[],n=[];Cl(t,e,n);var r=(n[1]-e[1])*(n[0]-e[0]);return h+=r,{poly:t,area:r}});c.sort(function(t,e){return e.area-t.area});var d=e;for(u=0;u<l;u++){var p=c[u];if(d<=0)break;var f=u===l-1?d:Math.ceil(p.area/h*e);f<0||(d0(c0,{points:p.poly},f,r),d-=f)}}n=sd}if(!n)return function(t,e){for(var n=[],r=0;r<e;r++)n.push(Ec(t));return n}(t,e);var g=[];for(u=0;u<r.length;u++){var m=new n;m.setShape(r[u]),p0(t,m),g.push(m)}return g}function g0(t,e){var n=t.length,r=e.length;if(n===r)return[t,e];for(var i=[],o=[],a=n<r?t:e,s=Math.min(n,r),l=Math.abs(r-n)/6,u=(s-2)/6,h=Math.ceil(l/u)+1,c=[a[0],a[1]],d=l,p=2;p<s;){var f=a[p-2],g=a[p-1],m=a[p++],v=a[p++],y=a[p++],_=a[p++],x=a[p++],b=a[p++];if(d<=0)c.push(m,v,y,_,x,b);else{for(var w=Math.min(d,h-1)+1,S=1;S<=w;S++){var T=S/w;qn(f,m,y,x,T,i),qn(g,v,_,b,T,o),f=i[3],g=o[3],c.push(i[1],o[1],i[2],o[2],f,g),m=i[5],v=o[5],y=i[6],_=o[6]}d-=w-1}}return a===t?[c,e]:[t,c]}function m0(t,e){for(var n=t.length,r=t[n-2],i=t[n-1],o=[],a=0;a<e.length;)o[a++]=r,o[a++]=i;return o}function v0(t){for(var e=0,n=0,r=0,i=t.length,o=0,a=i-2;o<i;a=o,o+=2){var s=t[a],l=t[a+1],u=t[o],h=t[o+1],c=s*h-u*l;e+=c,n+=(s+u)*c,r+=(l+h)*c}return 0===e?[t[0]||0,t[1]||0]:[n/e/3,r/e/3,e]}function y0(t,e,n,r){for(var i=(t.length-2)/6,o=1/0,a=0,s=t.length,l=s-2,u=0;u<i;u++){for(var h=6*u,c=0,d=0;d<s;d+=2){var p=0===d?h:(h+d-2)%l+2,f=t[p]-n[0],g=t[p+1]-n[1],m=e[d]-r[0]-f,v=e[d+1]-r[1]-g;c+=m*m+v*v}c<o&&(o=c,a=u)}return a}function _0(t){for(var e=[],n=t.length,r=0;r<n;r+=2)e[r]=t[n-r-2],e[r+1]=t[n-r-1];return e}function x0(t){return t.__isCombineMorphing}var b0="__mOriginal_";function w0(t,e,n){var r=b0+e,i=t[r]||t[e];t[r]||(t[r]=t[e]);var o=n.replace,a=n.after,s=n.before;t[e]=function(){var t,e=arguments;return s&&s.apply(this,e),t=o?o.apply(this,e):i.apply(this,e),a&&a.apply(this,e),t}}function S0(t,e){var n=b0+e;t[n]&&(t[e]=t[n],t[n]=null)}function T0(t,e){for(var n=0;n<t.length;n++)for(var r=t[n],i=0;i<r.length;){var o=r[i],a=r[i+1];r[i++]=e[0]*o+e[2]*a+e[4],r[i++]=e[1]*o+e[3]*a+e[5]}}function M0(t,e){var n=t.getUpdatedPathProxy(),r=e.getUpdatedPathProxy(),i=function(t,e){for(var n,r,i,o=[],a=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],h=void 0,c=void 0;l?u?(r=h=(n=g0(l,u))[0],i=c=n[1]):(c=m0(i||l,l),h=l):(h=m0(r||u,u),c=u),o.push(h),a.push(c)}return[o,a]}(r0(n),r0(r)),o=i[0],a=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();s&&T0(o,s),l&&T0(a,l),w0(e,"updateTransform",{replace:function(){this.transform=null}}),e.transform=null;var u=function(t,e,n,r){for(var i,o=[],a=0;a<t.length;a++){var s=t[a],l=e[a],u=v0(s),h=v0(l);null==i&&(i=u[2]<0!=h[2]<0);var c=[],d=[],p=0,f=1/0,g=[],m=s.length;i&&(s=_0(s));for(var v=6*y0(s,l,u,h),y=m-2,_=0;_<y;_+=2){var x=(v+_)%y+2;c[_+2]=s[x]-u[0],c[_+3]=s[x+1]-u[1]}if(c[0]=s[v]-u[0],c[1]=s[v+1]-u[1],n>0)for(var b=r/n,w=-r/2;w<=r/2;w+=b){var S=Math.sin(w),T=Math.cos(w),M=0;for(_=0;_<s.length;_+=2){var C=c[_],I=c[_+1],A=l[_]-h[0],D=l[_+1]-h[1],L=A*T-D*S,P=A*S+D*T;g[_]=L,g[_+1]=P;var E=L-C,O=P-I;M+=E*E+O*O}if(M<f){f=M,p=w;for(var N=0;N<g.length;N++)d[N]=g[N]}}else for(var R=0;R<m;R+=2)d[R]=l[R]-h[0],d[R+1]=l[R+1]-h[1];o.push({from:c,to:d,fromCp:u,toCp:h,rotation:-p})}return o}(o,a,10,Math.PI),h=[];w0(e,"buildPath",{replace:function(t){for(var n=e.__morphT,r=1-n,i=[],o=0;o<u.length;o++){var a=u[o],s=a.from,l=a.to,c=a.rotation*n,d=a.fromCp,p=a.toCp,f=Math.sin(c),g=Math.cos(c);Wt(i,d,p,n);for(var m=0;m<s.length;m+=2){var v=s[m],y=s[m+1],_=v*r+(S=l[m])*n,x=y*r+(T=l[m+1])*n;h[m]=_*g-x*f+i[0],h[m+1]=_*f+x*g+i[1]}var b=h[0],w=h[1];t.moveTo(b,w);for(m=2;m<s.length;){var S=h[m++],T=h[m++],M=h[m++],C=h[m++],I=h[m++],A=h[m++];b===S&&w===T&&M===I&&C===A?t.lineTo(I,A):t.bezierCurveTo(S,T,M,C,I,A),b=I,w=A}}}})}function C0(t,e,n){if(!t||!e)return e;var r=n.done,i=n.during;return M0(t,e),e.__morphT=0,e.animateTo({__morphT:1},E({during:function(t){e.dirtyShape(),i&&i(t)},done:function(){S0(e,"buildPath"),S0(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape(),r&&r()}},n)),e}function I0(t,e,n,r,i,o){t=i===n?0:Math.round(32767*(t-n)/(i-n)),e=o===r?0:Math.round(32767*(e-r)/(o-r));for(var a,s=0,l=32768;l>0;l/=2){var u=0,h=0;(t&l)>0&&(u=1),(e&l)>0&&(h=1),s+=l*l*(3*u^h),0===h&&(1===u&&(t=l-1-t,e=l-1-e),a=t,t=e,e=a)}return s}function A0(t){var e=1/0,n=1/0,r=-1/0,i=-1/0,o=V(t,function(t){var o=t.getBoundingRect(),a=t.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),l=o.y+o.height/2+(a?a[5]:0);return e=Math.min(s,e),n=Math.min(l,n),r=Math.max(s,r),i=Math.max(l,i),[s,l]});return V(o,function(o,a){return{cp:o,z:I0(o[0],o[1],e,n,r,i),path:t[a]}}).sort(function(t,e){return t.z-e.z}).map(function(t){return t.path})}function D0(t){return f0(t.path,t.count)}function L0(t){return j(t[0])}function P0(t,e){for(var n=[],r=t.length,i=0;i<r;i++)n.push({one:t[i],many:[]});for(i=0;i<e.length;i++){var o=e[i].length,a=void 0;for(a=0;a<o;a++)n[a%r].many.push(e[i][a])}var s=0;for(i=r-1;i>=0;i--)if(!n[i].many.length){var l=n[s].many;if(l.length<=1){if(!s)return n;s=0}o=l.length;var u=Math.ceil(o/2);n[i].many=l.slice(u,o),n[s].many=l.slice(0,u),s++}return n}var E0={clone:function(t){for(var e=[],n=1-Math.pow(1-t.path.style.opacity,1/t.count),r=0;r<t.count;r++){var i=Ec(t.path);i.setStyle("opacity",n),e.push(i)}return e},split:null};function O0(t,e,n,r,i,o){if(t.length&&e.length){var a=Ud("update",r,i);if(a&&a.duration>0){var s,l,u=r.getModel("universalTransition").get("delay"),h=L({setToFinal:!0},a);L0(t)&&(s=t,l=e),L0(e)&&(s=e,l=t);for(var c=s?s===t:t.length>e.length,d=s?P0(l,s):P0(c?e:t,[c?t:e]),p=0,f=0;f<d.length;f++)p+=d[f].many.length;var g=0;for(f=0;f<d.length;f++)m(d[f],c,g,p),g+=d[f].many.length}}function m(t,e,r,i,a){var s=t.many,l=t.one;if(1!==s.length||a)for(var c=E({dividePath:E0[n],individualDelay:u&&function(t,e,n,o){return u(t+r,i)}},h),d=e?function(t,e,n){var r=[];!function t(e){for(var n=0;n<e.length;n++){var i=e[n];x0(i)?t(i.childrenRef()):i instanceof xu&&r.push(i)}}(t);var i=r.length;if(!i)return{fromIndividuals:[],toIndividuals:[],count:0};var o=(n.dividePath||D0)({path:e,count:i});if(o.length!==i)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0};r=A0(r),o=A0(o);for(var a=n.done,s=n.during,l=n.individualDelay,u=new $i,h=0;h<i;h++){var c=r[h],d=o[h];d.parent=e,d.copyTransform(u),l||M0(c,d)}function p(t){for(var e=0;e<o.length;e++)o[e].addSelfToZr(t)}function f(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,S0(e,"addSelfToZr"),S0(e,"removeSelfFromZr")}e.__isCombineMorphing=!0,e.childrenRef=function(){return o},w0(e,"addSelfToZr",{after:function(t){p(t)}}),w0(e,"removeSelfFromZr",{after:function(t){for(var e=0;e<o.length;e++)o[e].removeSelfFromZr(t)}});var g=o.length;if(l){var m=g,v=function(){0===--m&&(f(),a&&a())};for(h=0;h<g;h++){var y=l?E({delay:(n.delay||0)+l(h,g,r[h],o[h]),done:v},n):n;C0(r[h],o[h],y)}}else e.__morphT=0,e.animateTo({__morphT:1},E({during:function(t){for(var n=0;n<g;n++){var r=o[n];r.__morphT=e.__morphT,r.dirtyShape()}s&&s(t)},done:function(){f();for(var e=0;e<t.length;e++)S0(t[e],"updateTransform");a&&a()}},n));return e.__zr&&p(e.__zr),{fromIndividuals:r,toIndividuals:o,count:g}}(s,l,c):function(t,e,n){var r=e.length,i=[],o=n.dividePath||D0;if(x0(t)){!function t(e){for(var n=0;n<e.length;n++){var r=e[n];x0(r)?t(r.childrenRef()):r instanceof xu&&i.push(r)}}(t.childrenRef());var a=i.length;if(a<r)for(var s=0,l=a;l<r;l++)i.push(Ec(i[s++%a]));i.length=r}else{i=o({path:t,count:r});var u=t.getComputedTransform();for(l=0;l<i.length;l++)i[l].setLocalTransform(u);if(i.length!==r)return console.error("Invalid morphing: unmatched splitted path"),{fromIndividuals:[],toIndividuals:[],count:0}}i=A0(i),e=A0(e);var h=n.individualDelay;for(l=0;l<r;l++){var c=h?E({delay:(n.delay||0)+h(l,r,i[l],e[l])},n):n;C0(i[l],e[l],c)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}(l,s,c),p=d.fromIndividuals,f=d.toIndividuals,g=p.length,v=0;v<g;v++){y=u?E({delay:u(v,g)},h):h;o(p[v],f[v],e?s[v]:t.one,e?t.one:s[v],y)}else{var y,_=e?s[0]:l,x=e?l:s[0];if(x0(_))m({many:[_],one:x},!0,r,i,!0);else C0(_,x,y=u?E({delay:u(r,i)},h):h),o(_,x,_,x,y)}}}function N0(t){if(!t)return[];if(j(t)){for(var e=[],n=0;n<t.length;n++)e.push(N0(t[n]));return e}var r=[];return t.traverse(function(t){t instanceof xu&&!t.disableMorphing&&!t.invisible&&!t.ignore&&r.push(t)}),r}var R0=Qa();function k0(t,e,n,r){var i=function(t,e){for(var n=t.dimensions,r=0;r<n.length;r++){var i=t.getDimensionInfo(n[r]);if(i&&0===i.otherDims[e])return n[r]}}(t,r?"itemChildGroupId":"itemGroupId");if(i){var o=function(t,e,n){var r=t.getDimensionInfo(n),i=r&&r.ordinalMeta;if(r){var o=t.get(r.name,e);return i&&i.categories[o]||o+""}}(t,e,i);return o}var a=t.getRawDataItem(e),s=r?"childGroupId":"groupId";return a&&a[s]?a[s]+"":r?void 0:n||t.getId(e)}function z0(t){var e=[];return B(t,function(t){var n=t.data,r=t.dataGroupId;if(n.count()>1e4)Da("Universal transition is disabled on large data > 10k.");else for(var i=n.getIndices(),o=0;o<i.length;o++)e.push({data:n,groupId:k0(n,o,r,!1),childGroupId:k0(n,o,r,!0),divide:t.divide,dataIndex:o})}),e}function B0(t,e,n){t.traverse(function(t){t instanceof xu&&jd(t,{style:{opacity:0}},e,{dataIndex:n,isFrom:!0})})}function V0(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function F0(t){t.stopAnimation(),t.isGroup&&t.traverse(function(t){t.stopAnimation()})}function G0(t,e,n){var r=Ud("update",n,e);r&&t.traverse(function(t){if(t instanceof vl){var e=function(t){return Hd(t).oldStyle}(t);e&&t.animateFrom({style:e},r)}})}function H0(t,e,n){var r=z0(t),i=z0(e);function o(t,e,n,r,i){(n||t)&&e.animateFrom({style:n&&n!==t?L(L({},n.style),t.style):t.style},i)}var a=!1,s=0,l=yt(),u=yt();B(r,function(t){t.groupId&&l.set(t.groupId,!0),t.childGroupId&&u.set(t.childGroupId,!0)});for(var h=0;h<i.length;h++){var c=i[h].groupId;if(u.get(c)){s=1;break}var d=i[h].childGroupId;if(d&&l.get(d)){s=2;break}}function p(t,e){return function(n){var r=n.data,i=n.dataIndex;return e?r.getId(i):t?1===s?n.childGroupId:n.groupId:2===s?n.childGroupId:n.groupId}}var f=function(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++){var i=t[r],o=e[r];if(i.data.getId(i.dataIndex)!==o.data.getId(o.dataIndex))return!1}return!0}(r,i),g={};if(!f)for(h=0;h<i.length;h++){var m=i[h],v=m.data.getItemGraphicEl(m.dataIndex);v&&(g[v.id]=!0)}function y(t,e){var n=r[e],s=i[t],l=s.data.hostModel,u=n.data.getItemGraphicEl(n.dataIndex),h=s.data.getItemGraphicEl(s.dataIndex);u!==h?u&&g[u.id]||h&&(F0(h),u?(F0(u),V0(u),a=!0,O0(N0(u),N0(h),s.divide,l,t,o)):B0(h,l,t)):h&&G0(h,s.dataIndex,l)}new Ow(r,i,p(!0,f),p(!1,f),null,"multiple").update(y).updateManyToOne(function(t,e){var n=i[t],s=n.data,l=s.hostModel,u=s.getItemGraphicEl(n.dataIndex),h=G(V(e,function(t){return r[t].data.getItemGraphicEl(r[t].dataIndex)}),function(t){return t&&t!==u&&!g[t.id]});u&&(F0(u),h.length?(B(h,function(t){F0(t),V0(t)}),a=!0,O0(N0(h),N0(u),n.divide,l,t,o)):B0(u,l,n.dataIndex))}).updateOneToMany(function(t,e){var n=r[e],s=n.data.getItemGraphicEl(n.dataIndex);if(!s||!g[s.id]){var l=G(V(t,function(t){return i[t].data.getItemGraphicEl(i[t].dataIndex)}),function(t){return t&&t!==s}),u=i[t[0]].data.hostModel;l.length&&(B(l,function(t){return F0(t)}),s?(F0(s),V0(s),a=!0,O0(N0(s),N0(l),n.divide,u,t[0],o)):B(l,function(e){return B0(e,u,t[0])}))}}).updateManyToMany(function(t,e){new Ow(e,t,function(t){return r[t].data.getId(r[t].dataIndex)},function(t){return i[t].data.getId(i[t].dataIndex)}).update(function(n,r){y(t[n],e[r])}).execute()}).execute(),a&&B(e,function(t){var e=t.data.hostModel,r=e&&n.getViewOfSeriesModel(e),i=Ud("update",e,0);r&&e.isAnimationEnabled()&&i&&i.duration>0&&r.group.traverse(function(t){t instanceof xu&&!t.animators.length&&t.animateFrom({style:{opacity:0}},i)})})}function U0(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function W0(t){return j(t)?t.sort().join(","):t}function X0(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function j0(t,e){for(var n=0;n<t.length;n++){if(null!=e.seriesIndex&&e.seriesIndex===t[n].seriesIndex||null!=e.seriesId&&e.seriesId===t[n].id)return n}}var Z0=function(){function t(e,n){TS(this,t.decoratedMethods),this._outOfBrk=DS(null,n),MS(this,this._linear=DS(null,n)),this.breaks=e&&e.breaks||[]}return t.prototype.hasBreaks=function(){return!!this.breaks.length},t.prototype.calcNiceTickMultiple=function(t,e){for(var n=0;n<this.breaks.length;n++){var r=this.breaks[n];if(r.vmin<t&&t<r.vmax){var i=e(t,r.vmax);return ht(i>=0&&Uo(i)===i),i}}return 0},t.decoratedMethods={needTransform:function(){return!this.breaks.length},getExtent:function(){return this._outOfBrk.getExtent()},getExtentUnsafe:function(t,e){return null==e||2===e?this._outOfBrk.getExtentUnsafe(t,null):this._linear.getExtentUnsafe(t,null)},setExtent:function(t,e){this.setExtent2(0,t,e)},setExtent2:function(t,e,n){ms(e,n)&&(0===t&&function(t,e){var n=0,r={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},o={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};B(t.breaks,function(t){var i=t.gapParsed;"tpPrct"===i.type&&(n+=i.val);var a=$0(t,e);if(a){var s=a.vmin!==t.vmin,l=a.vmax!==t.vmax,u=a.vmax-a.vmin;if(s&&l);else if(s||l){var h=s?"S":"E";o[h][i.type].has=!0,o[h][i.type].span=u,o[h][i.type].inExtFrac=u/(t.vmax-t.vmin),o[h][i.type].val=i.val}else r[i.type].span+=u,r[i.type].val+=i.val}});var a=n*(e[1]-e[0]+0+(r.tpAbs.val-r.tpAbs.span)+(o.S.tpAbs.has?(o.S.tpAbs.val-o.S.tpAbs.span)*o.S.tpAbs.inExtFrac:0)+(o.E.tpAbs.has?(o.E.tpAbs.val-o.E.tpAbs.span)*o.E.tpAbs.inExtFrac:0)-r.tpPrct.span-(o.S.tpPrct.has?o.S.tpPrct.span*o.S.tpPrct.inExtFrac:0)-(o.E.tpPrct.has?o.E.tpPrct.span*o.E.tpPrct.inExtFrac:0))/(1-r.tpPrct.val-(o.S.tpPrct.has?o.S.tpPrct.val*o.S.tpPrct.inExtFrac:0)-(o.E.tpPrct.has?o.E.tpPrct.val*o.E.tpPrct.inExtFrac:0));B(t.breaks,function(t){var e=t.gapParsed;"tpPrct"===e.type&&(t.gapReal=0!==n?Go(a,0)*e.val/n:0),"tpAbs"===e.type&&(t.gapReal=e.val),null==t.gapReal&&(t.gapReal=0)})}(this,[e,n]),this._outOfBrk.setExtent2(t,e,n),this._linear.setExtent2(t,this.transformIn(e,null),this.transformIn(n,null)))},normalize:function(t){return this._linear.normalize(this.transformIn(t,null))},scale:function(t){return this.transformOut(this._linear.scale(t),null)},contain:function(t){return this._outOfBrk.contain(t)},transformIn:function(t,e){if(e&&2===e.depth)return t;for(var n=q0,r=K0,i=!0,o=0;o<this.breaks.length;o++){var a=this.breaks[o];if(t<=a.vmax){t>a.vmin?n+=a.vmin-r+(t-a.vmin)/(a.vmax-a.vmin)*a.gapReal:n+=t-r,r=a.vmax,i=!1;break}n+=a.vmin-r+a.gapReal,r=a.vmax}return i&&(n+=t-r),n},transformOut:function(t,e){if(e&&2===e.depth)return t;for(var n=q0,r=K0,i=!0,o=0,a=0;a<this.breaks.length;a++){var s=this.breaks[a],l=n+s.vmin-r,u=l+s.gapReal;if(t<=u){o=t>l?s.vmin+(t-l)/(u-l)*(s.vmax-s.vmin):r+t-n,r=s.vmax,i=!1;break}n=u,r=s.vmax}return i&&(o=r+t-n),o}},t}();function Y0(t,e){return new Z0(t,e)}var q0=0,K0=0;function J0(t,e,n,r,i,o){"no"!==t&&B(n,function(n){var a=$0(n,o);if(a)for(var s=e.length-1;s>=0;s--){var l=e[s],u=r(l),h=3*i/4;u>a.vmin-h&&u<a.vmax+h&&("preserve_extent_bound"!==t||u!==o[0]&&u!==o[1])&&e.splice(s,1)}})}function Q0(t,e,n,r){B(e,function(e){var i=$0(e,n);i&&(t.push({value:i.vmin,break:{type:"vmin",parsedBreak:i},time:r?r(i):void 0}),t.push({value:i.vmax,break:{type:"vmax",parsedBreak:i},time:r?r(i):void 0}))}),e.length&&t.sort(function(t,e){return t.value-e.value})}function $0(t,e){var n=Go(t.vmin,e[0]),r=Fo(t.vmax,e[1]);return n<r||n===r&&n>e[0]&&n<e[1]?{vmin:n,vmax:r,breakOption:t.breakOption,gapParsed:t.gapParsed,gapReal:t.gapReal}:null}function t1(t,e,n){var r=[];if(!t)return{breaks:r};B(t,function(t){if(t&&null!=t.start&&null!=t.end){if(!t.isExpanded){var i={breakOption:I(t),vmin:e.parse(t.start),vmax:e.parse(t.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(null!=t.gap){var o=!1;if(Y(t.gap)){var a=ct(t.gap);if(a.match(/%$/)){var s=parseFloat(a)/100;(function(t,e){return t>=0&&t<.99999||(La(e+" must be >= 0 and < 1, rather than "+t+" ."),!1)})(s,"Percent gap")||(s=0),i.gapParsed.type="tpPrct",i.gapParsed.val=s,o=!0}}if(!o){var l=e.parse(t.gap);(!isFinite(l)||l<0)&&(La("Axis breaks gap must positive finite rather than ("+t.gap+")."),l=0),i.gapParsed.type="tpAbs",i.gapParsed.val=l}}if(i.vmin===i.vmax&&(i.gapParsed.type="tpAbs",i.gapParsed.val=0),n&&n.noNegative&&B(["vmin","vmax"],function(t){i[t]<0&&(La("Axis break."+t+" must not be negative."),i[t]=0)}),i.vmin>i.vmax){var u=i.vmax;i.vmax=i.vmin,i.vmin=u}r.push(i)}}else La("The input axis breaks start/end should not be empty.")}),r.sort(function(t,e){return t.vmin-e.vmin});var i=-1/0;return B(r,function(t,e){i>t.vmin&&(La("Axis breaks must not overlap."),r[e]=null),i=t.vmax}),{breaks:G(r,function(t){return!!t})}}function e1(t,e){return n1(e)===n1(t)}function n1(t){return t.start+"_\0_"+t.end}function r1(t,e,n){var r=[];B(t,function(t,n){var i=e(t);i&&"vmin"===i.type&&r.push([n])}),B(t,function(n,i){var o=e(n);if(o&&"vmax"===o.type){var a=H(r,function(n){return e1(e(t[n[0]]).parsedBreak.breakOption,o.parsedBreak.breakOption)});a&&a.push(i)}});var i=[];return B(r,function(e){2===e.length&&i.push(n?e:[t[e[0]],t[e[1]]])}),i}function i1(t,e,n,r){if(e.break){var i=e.break.parsedBreak,o=H(n,function(t){return e1(t.breakOption,e.break.parsedBreak.breakOption)}),a={lookup:r,depth:2},s={vmin:t.transformOut(i.vmin,a),vmax:t.transformOut(i.vmax,a),breakOption:i.breakOption,gapParsed:I(o.gapParsed),gapReal:i.gapReal};return{tickVal:s[e.break.type],vBreak:{type:e.break.type,parsedBreak:s}}}}function o1(t,e,n,r,i){i.original=t1(t,e,n);var o=i.transformed=t1(t,e,n),a=i.lookup;o.breaks=V(o.breaks,function(t,n){var i={depth:2},o=e.transformIn(t.vmin,i),s=e.transformIn(t.vmax,i),l={type:t.gapParsed.type,val:"tpAbs"===t.gapParsed.type?e.transformIn(t.vmin+t.gapParsed.val,i)-o:t.gapParsed.val};return a.from[r+n]=o,a.to[r+n]=t.vmin,a.from[r+n+1]=s,a.to[r+n+1]=t.vmax,{vmin:o,vmax:s,gapParsed:l,gapReal:t.gapReal,breakOption:t.breakOption}})}var a1={vmin:"start",vmax:"end"};function s1(t,e){return e&&((t=t||{}).break={type:a1[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function l1(){var t;t={createBreakScaleMapper:Y0,pruneTicksByBreak:J0,addBreaksToTicks:Q0,parseAxisBreakOption:t1,identifyAxisBreak:e1,serializeAxisBreakIdentifier:n1,retrieveAxisBreakPairs:r1,getTicksBreakOutwardTransform:i1,parseAxisBreakOptionInwardTransform:o1,makeAxisLabelFormatterParamBreak:s1},Ef||(Ef=t)}var u1=Qa();function h1(t,e,n,r,i){var o=n.axis;if(!o.scale.isBlank()&&Of()){var a=Of().retrieveAxisBreakPairs(o.scale.getTicks({breakTicks:"only_break"}),function(t){return t.break},!1);if(a.length){var s=n.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),h=s.get("zigzagMaxSpan");u=Math.max(2,u||0),h=Math.max(u,h||0);var c=s.get("expandOnClick"),d=s.get("zigzagZ"),p=s.getModel("itemStyle").getItemStyle(),f=p.stroke,g=p.lineWidth,m=p.lineDash,v=p.fill,y=new Do({ignoreModelZ:!0}),_=o.isHorizontal(),x=u1(e).visualList||(u1(e).visualList=[]);B(x,function(t){return t.shouldRemove=!0});for(var b=function(t){var e=a[t][0].break.parsedBreak,s=[];s[0]=o.toGlobalCoord(o.dataToCoord(e.vmin,!0)),s[1]=o.toGlobalCoord(o.dataToCoord(e.vmax,!0)),s[1]<s[0]&&s.reverse();var b=function(t,e){var n=H(t,function(t){return Of().identifyAxisBreak(t.parsedBreak.breakOption,e.breakOption)});return n||t.push(n={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),n}(x,e);b.shouldRemove=!1;var w=new Do;!function(t,e,n,i,o,a){var s={stroke:f,lineWidth:g,lineDash:m,fill:"none"},c=o?0:1,y=1-c,_=r[$d[y]]+r[tp[y]];function x(t){var e=[],n=[];e[c]=n[c]=t,e[y]=r[$d[y]],n[y]=_;var i={x1:e[0],y1:e[1],x2:n[0],y2:n[1]};return Du(i,i,{lineWidth:1}),e[0]=i.x1,e[1]=i.y1,e[c]}n=x(n),i=x(i);for(var b=[],w=[],S=!0,T=r[$d[y]],M=0;;M++){var C=T===r[$d[y]],I=T>=_;I&&(T=_);var A=[],D=[];A[c]=n,D[c]=i,C||I||(A[c]+=S?-l:l,D[c]-=S?l:-l),A[y]=T,D[y]=T,b.push(A),w.push(D);var L=void 0;if(M<t.length?L=t[M]:(L=Math.random(),t.push(L)),T+=L*(h-u)+u,S=!S,I)break}var P=Of().serializeAxisBreakIdentifier(a.breakOption);if(e.add(new hd({anid:"break_a_"+P,shape:{points:b},style:s,z:d})),0!==a.gapReal){e.add(new hd({anid:"break_b_"+P,shape:{points:w},style:s,z:d}));var E=w.slice();E.reverse();var O=b.concat(E);e.add(new sd({anid:"break_c_"+P,shape:{points:O},style:{fill:v,opacity:p.opacity},z:d}))}}(b.zigzagRandomList,w,s[0],s[1],_,e),c&&w.on("click",function(){var t={type:WD,breaks:[{start:e.breakOption.start,end:e.breakOption.end}]};t[o.dim+"AxisIndex"]=n.componentIndex,i.dispatchAction(t)}),w.silent=!c,y.add(w)},w=0;w<a.length;w++)b(w);t.add(y),function(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}(x)}}}function c1(t,e,n,r){var i=t.axis,o=n.transform;ht(r.style);var a=i.getExtent();i.inverse&&(a=a.slice()).reverse();var s=V(Of().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:"only_break"}),function(t){return t.break},!1),function(t){var e=t[0].break.parsedBreak,n=[i.dataToCoord(e.vmin,!0),i.dataToCoord(e.vmax,!0)];return n[0]>n[1]&&n.reverse(),{coordPair:n,brkId:Of().serializeAxisBreakIdentifier(e.breakOption)}});s.sort(function(t,e){return t.coordPair[0]-e.coordPair[0]});for(var l=a[0],u=null,h=0;h<s.length;h++){var c=s[h],d=Math.max(c.coordPair[0],a[0]),p=Math.min(c.coordPair[1],a[1]);l<=d&&f(l,d,u,c),l=p,u=c}function f(t,n,i,a){function s(t,e){o&&(Xt(t,t,o),Xt(e,e,o))}function l(t,e){var n={x1:t[0],y1:t[1],x2:e[0],y2:e[1]};Du(n,n,r.style),t[0]=n.x1,t[1]=n.y1,e[0]=n.x2,e[1]=n.y2}var u=[t,0],h=[n,0],c=[t,5],d=[n,5];s(u,c),l(u,c),s(h,d),l(h,d),l(u,h);var p=new fd(L({shape:{x1:u[0],y1:u[1],x2:h[0],y2:h[1]}},r));e.add(p),p.anid="breakLine_"+(i?i.brkId:"\0")+"_\0_"+(a?a.brkId:"\0")}l<=a[1]&&f(l,a[1],u,null)}function d1(t,e,n){if(!H(n,function(t){return!t})){var r=new Re;if(UC(n[0],n[1],r,{direction:-(t?e+Math.PI:e),touchThreshold:0,bidirectional:!1})){var i=[1,0,0,1,0,0];De(i,i,-e);var o=V(n,function(t){return t.transform?Ie([1,0,0,1,0,0],i,t.transform):i}),a=.5;if(g(0)||g(1)){var s=V(n,function(t,e){var n=t.localRect.clone();return n.applyTransform(o[e]),n}),l=new Re;l.copy(n[0].label).add(n[1].label).scale(.5),l.transform(i);var u=r.clone().transform(i),h=(s[0].x+s[1].x+(u.x>=0?s[0].width:s[1].width)+u.x)/2-l.x,c=Math.min(h,h-u.x),d=Math.max(h,h-u.x);a=(h-(d<0?d:c>0?c:0))/u.x}var p=new Re,f=new Re;Re.scale(p,r,-a),Re.scale(f,r,1-a),BC(n[0],p),BC(n[1],f)}}function g(t){var e=n[0].localRect,r=new Re(e[tp[t]]*o[0][0],e[tp[t]]*o[0][1]);return Math.abs(r.y)<1e-5}}function p1(t,e){var n={breaks:[]};return B(e.breaks,function(r){if(r){var i=H(t.get("breaks",!0),function(t){return Of().identifyAxisBreak(t,r)});if(i){var o=e.type,a={isExpanded:!!i.isExpanded};i.isExpanded=o===WD||o!==XD&&(o===jD?!i.isExpanded:i.isExpanded),n.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:a})}else Da("Can not find axis break by start: "+r.start+", end: "+r.end)}}),n}function f1(){var t;t={adjustBreakLabelPair:d1,buildAxisBreakLine:c1,rectCoordBuildBreakAxis:h1,updateModelAxisBreak:p1},HD||(HD=t)}function g1(t,e){B(t,function(t){if(!t.model.get(["axisLabel","inside"])){var n=function(t){var e,n,r=t.model,i=t.scale;if(!r.get(["axisLabel","show"])||i.isBlank())return;var o=i.getExtent();n=i instanceof XS?i.count():(e=i.getTicks()).length;var a,s=t.getLabelModel(),l=vT(t),u=1;n>40&&(u=Math.ceil(n/40));for(var h=0;h<n;h+=u){var c=l(e?e[h]:{value:o[0]+h},h),d=p(s.getTextRect(c),s.get("rotate")||0);a?a.union(d):a=d}return a;function p(t,e){var n=e*Math.PI/180,r=t.width,i=t.height,o=r*Math.abs(Math.cos(n))+Math.abs(i*Math.sin(n)),a=r*Math.abs(Math.sin(n))+Math.abs(i*Math.cos(n));return new ln(t.x,t.y,o,a)}}(t);if(n){var r=t.isHorizontal()?"height":"width",i=t.model.get(["axisLabel","margin"]);e[r]-=n[r]+i,"top"===t.position?e.y+=n.height+i:"left"===t.position&&(e.x+=n.width+i)}}})}vM([kA]),vM([function(t){t.registerPainter("svg",gA)}]),vM([function(t){t.registerChartView(RD),t.registerSeriesModel(BA),t.registerLayout(kD("line",!0)),t.registerVisual({seriesType:"line",reset:function(t){var e=t.getData(),n=t.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=e.getVisual("style").fill),e.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,VD("line"))},function(t){t.registerChartView(bP),t.registerSeriesModel(KL),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,UL(LL)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,WL(LL)),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,VD(LL)),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(t,e){var n=t.componentType||"series";e.eachComponent({mainType:n,query:t},function(e){t.sortInfo&&e.axis.setCategorySortInfo(t.sortInfo)})}),jL(t)},function(t){t.registerChartView(XP),t.registerSeriesModel(LP),nx(IP,t.registerAction),t.registerLayout(GP),t.registerProcessor(wP(IP)),t.registerProcessor(function(t){return{seriesType:t,reset:function(t,e){var n=t.getData();n.filterSelf(function(t){var e=n.mapDimension("value"),r=n.get(e,t);return!(K(r)&&!isNaN(r)&&r<0)})}}}(IP))},function(t){vM(UE),t.registerSeriesModel(ZP),t.registerChartView(tE),t.registerLayout(kD("scatter"))},function(t){vM(yO),t.registerChartView(iO),t.registerSeriesModel(nO),t.registerLayout(_O),t.registerProcessor(wP("radar")),t.registerPreprocessor($E)},function(t){vM(QR),t.registerChartView(BR),t.registerSeriesModel(kR),t.registerLayout($R),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,tk),nx("map",t.registerAction)},function(t){t.registerChartView(Bk),t.registerSeriesModel(Ak),t.registerLayout(Fk),t.registerVisual(Gk),function(t){t.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(t,e){e.eachComponent({mainType:nh,subType:Ck,query:t},function(e){var n=t.dataIndex,r=e.getData().tree.getNodeByDataIndex(n);r.isExpand=!r.isExpand})}),hR(t,nh,Ck)}(t)},function(t){t.registerSeriesModel(jk),t.registerChartView(bz),t.registerVisual(Vz),t.registerLayout(oz),function(t){for(var e=0;e<Hk.length;e++)t.registerAction({type:Hk[e],update:"updateView"},St);t.registerAction({type:"treemapRootToNode",update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"treemap",query:t},function(e,n){var r=wk(t,["treemapZoomToNode","treemapRootToNode"],e);if(r){var i=e.getViewRoot();i&&(t.direction=Tk(i,r.node)?"rollUp":"drillDown"),e.resetViewRoot(r.node)}})})}(t)},function(t){t.registerChartView(KB),t.registerSeriesModel(aB),t.registerProcessor(JB),t.registerVisual(QB),t.registerVisual(lB),t.registerLayout(cB),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,_B),t.registerLayout(bB),t.registerCoordinateSystem("graphView",{dimensions:aR.dimensions,create:wB}),t.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},St),t.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},St),hR(t,nh,iB)},function(t){t.registerChartView(lV),t.registerSeriesModel(eV),t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,hV),t.registerProcessor(wP("chord"))},function(t){t.registerChartView(mV),t.registerSeriesModel(yV)},function(t){t.registerChartView(MV),t.registerSeriesModel(bV),t.registerLayout(CV),t.registerProcessor(wP(_V))},function(t){vM(rG),t.registerChartView(NV),t.registerSeriesModel(zV),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,VV)},function(t){t.registerChartView(cG),t.registerSeriesModel(aG),t.registerLayout(dG),t.registerVisual(TG),t.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(t,e){e.eachComponent({mainType:nh,subType:iG,query:t},function(e){e.setNodePosition(t.dataIndex,[t.localX,t.localY])})}),hR(t,nh,iG)},function(t){t.registerSeriesModel(DG),t.registerChartView(kG),t.registerLayout(BG),t.registerTransform(VG),function(t){zG(t,function(){var e=IL(IG);XT(t,{key:e,seriesType:IG,getMetrics:DL}),eM(e,CL(e))})}(t)},function(t){t.registerChartView(hH),t.registerSeriesModel(HG),t.registerPreprocessor(cH),t.registerVisual(JG),t.registerLayout(pH),function(t){dH(t,function(){var e=IL(FG);XT(t,{key:e,seriesType:FG,getMetrics:DL}),eM(e,CL(e))})}(t)},function(t){t.registerChartView(xH),t.registerSeriesModel(wH),t.registerLayout(kD("effectScatter"))},function(t){t.registerChartView(RH),t.registerSeriesModel(FH),t.registerLayout(OH),t.registerVisual(HH)},function(t){t.registerChartView(jH),t.registerSeriesModel(YH)},function(t){t.registerChartView(mU),t.registerSeriesModel(yU),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,UL(PL)),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,WL(PL)),jL(t)},function(t){t.registerChartView(SU),t.registerSeriesModel(bU),t.registerLayout(TU),t.registerProcessor(wP(_U))},function(t){t.registerChartView(RU),t.registerSeriesModel(PU),t.registerLayout(BU),t.registerVisual(kU),function(t){t.registerAction({type:EU,update:"updateView"},function(t,e){e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e,n){var r=wk(t,[EU],e);if(r){var i=e.getViewRoot();i&&(t.direction=Tk(i,r.node)?"rollUp":"drillDown"),e.resetViewRoot(r.node)}})}),t.registerAction({type:OU,update:"none"},function(t,e,n){t=L({},t),e.eachComponent({mainType:"series",subType:"sunburst",query:t},function(e){var n=wk(t,[OU],e);n&&(t.dataIndex=n.node.dataIndex)}),Ea("sunburstHighlight","highlight"),n.dispatchAction(L(t,{type:"highlight"}))}),t.registerAction({type:"sunburstUnhighlight",update:"updateView"},function(t,e,n){t=L({},t),Ea("sunburstUnhighlight","downplay"),n.dispatchAction(L(t,{type:"downplay"}))})}(t)},function(t){t.registerChartView(PW),t.registerSeriesModel(WU)}]),vM(function(t){vM(UE),vM(BX)}),vM(function(t){vM(BX),EE.registerAxisPointerClass("PolarAxisPointer",GX),t.registerCoordinateSystem("polar",sj),t.registerComponentModel(XX),t.registerComponentView(Tj),aE(t,"angle",ZX,wj),aE(t,"radius",YX,Sj),t.registerComponentView(fj),t.registerComponentView(yj),t.registerLayout(bj),function(t,e){_j(t,function(){var n=AL(e,HX);EL(t,n,e,HX),eM(n,CL(n))})}(t,LL)}),vM(QR),vM(function(t){vM(BX),EE.registerAxisPointerClass("SingleAxisPointer",Hj),t.registerComponentView(Uj),t.registerComponentView(Dj),t.registerComponentModel(ZE),aE(t,"single",ZE,ZE.defaultOption),t.registerCoordinateSystem("single",Rj)}),vM(rG),vM(function(t){t.registerComponentModel(jj),t.registerComponentView(Yj),t.registerCoordinateSystem("calendar",Qj)}),vM(function(t){t.registerComponentModel(CZ),t.registerComponentView(BZ),t.registerCoordinateSystem("matrix",nY)}),vM(function(t){t.registerComponentModel(sY),t.registerComponentView(hY),t.registerPreprocessor(function(t){var e=t.graphic;j(e)?e[0]&&e[0].elements?t.graphic=[t.graphic[0]]:t.graphic=[{elements:e}]:e&&!e.elements&&(t.graphic=[{elements:[e]}])})}),vM(function(t){t.registerComponentModel(jY),t.registerComponentView(KY),UY("saveAsImage",QY),UY("magicType",rq),UY("dataView",cq),UY("dataZoom",Bq),UY("restore",mq),vM(FY)}),vM(function(t){vM(BX),t.registerComponentModel(Fq),t.registerComponentView(uK),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},St),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},St)}),vM(BX),vM(function(t){t.registerComponentView(DK),t.registerComponentModel(EK),t.registerPreprocessor(cK),t.registerVisual(t.PRIORITY.VISUAL.BRUSH,SK),t.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(t,e){e.eachComponent({mainType:"brush",query:t},function(e){e.setAreas(t.areas)})}),t.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},St),t.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},St),UY("brush",RK)}),vM(function(t){t.registerComponentModel(kK),t.registerComponentView(zK)}),vM(function(t){t.registerComponentModel(GK),t.registerComponentView(JK),t.registerSubTypeDefaulter("timeline",function(){return"slider"}),function(t){t.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e,n){var r=e.getComponent("timeline");return r&&null!=t.currentIndex&&(r.setCurrentIndex(t.currentIndex),!r.get("loop",!0)&&r.isIndexMax()&&r.getPlayState()&&(r.setPlayState(!1),n.dispatchAction({type:"timelinePlayChange",playState:!1,from:t.from}))),e.resetOption("timeline",{replaceMerge:r.get("replaceMerge",!0)}),E({currentIndex:r.option.currentIndex},t)}),t.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var n=e.getComponent("timeline");n&&null!=t.playState&&n.setPlayState(t.playState)})}(t),t.registerPreprocessor(QK)}),vM(function(t){t.registerComponentModel(sJ),t.registerComponentView(bJ),t.registerPreprocessor(function(t){eJ(t.series,"markPoint")&&(t.markPoint=t.markPoint||{})})}),vM(function(t){t.registerComponentModel(SJ),t.registerComponentView(PJ),t.registerPreprocessor(function(t){eJ(t.series,"markLine")&&(t.markLine=t.markLine||{})})}),vM(function(t){t.registerComponentModel(OJ),t.registerComponentView(HJ),t.registerPreprocessor(function(t){eJ(t.series,"markArea")&&(t.markArea=t.markArea||{})})}),vM(function(t){vM(nQ),vM(cQ)}),vM(function(t){vM(TQ),vM(RQ)}),vM(TQ),vM(RQ),vM(function(t){vM(x$),vM(I$)}),vM(x$),vM(I$),vM(function(t){t.registerComponentModel(D$),t.registerComponentView(L$)}),vM(function(t){t.registerPreprocessor(z$),t.registerVisual(t.PRIORITY.VISUAL.ARIA,k$)}),vM(function(t){t.registerTransform(K$),t.registerTransform(J$)}),vM(t0),vM(function(t){t.registerUpdateLifecycle("series:beforeupdate",function(t,e,n){B(Ba(n.seriesTransition),function(t){B(Ba(t.to),function(t){for(var e=n.updatedSeries,r=0;r<e.length;r++)(null!=t.seriesIndex&&t.seriesIndex===e[r].seriesIndex||null!=t.seriesId&&t.seriesId===e[r].id)&&(e[r][Gy]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(t,e,n){var r=R0(e);if(r.oldSeries&&n.updatedSeries&&n.optionChanged){var i=n.seriesTransition;if(i)B(Ba(i),function(t){!function(t,e,n,r){var i=[],o=[];B(Ba(t.from),function(t){var n=j0(e.oldSeries,t);n>=0&&i.push({dataGroupId:e.oldDataGroupIds[n],data:e.oldData[n],divide:X0(e.oldData[n]),groupIdDim:t.dimension})}),B(Ba(t.to),function(t){var r=j0(n.updatedSeries,t);if(r>=0){var i=n.updatedSeries[r].getData();o.push({dataGroupId:e.oldDataGroupIds[r],data:i,divide:X0(i),groupIdDim:t.dimension})}}),i.length>0&&o.length>0&&H0(i,o,r)}(t,r,n,e)});else{var o=function(t,e){var n=yt(),r=yt(),i=yt();function o(t){n.get(t)&&Da("Duplicated seriesKey in universalTransition "+t)}return B(t.oldSeries,function(e,n){var o=t.oldDataGroupIds[n],a=t.oldData[n],s=U0(e),l=W0(s);r.set(l,{dataGroupId:o,data:a}),j(s)&&B(s,function(t){i.set(t,{key:l,dataGroupId:o,data:a})})}),B(e.updatedSeries,function(t){if(t.isUniversalTransitionEnabled()&&t.isAnimationEnabled()){var e=t.get("dataGroupId"),a=t.getData(),s=U0(t),l=W0(s),u=r.get(l);if(u)o(l),n.set(l,{oldSeries:[{dataGroupId:u.dataGroupId,divide:X0(u.data),data:u.data}],newSeries:[{dataGroupId:e,divide:X0(a),data:a}]});else if(j(s)){o(l);var h=[];B(s,function(t){var e=r.get(t);e.data&&h.push({dataGroupId:e.dataGroupId,divide:X0(e.data),data:e.data})}),h.length&&n.set(l,{oldSeries:h,newSeries:[{dataGroupId:e,data:a,divide:X0(a)}]})}else{var c=i.get(s);if(c){var d=n.get(c.key);d||(d={oldSeries:[{dataGroupId:c.dataGroupId,data:c.data,divide:X0(c.data)}],newSeries:[]},n.set(c.key,d)),d.newSeries.push({dataGroupId:e,data:a,divide:X0(a)})}}}}),n}(r,n);B(o.keys(),function(t){var n=o.get(t);H0(n.oldSeries,n.newSeries,e)})}B(n.updatedSeries,function(t){t[Gy]&&(t[Gy]=!1)})}for(var a=t.getSeries(),s=r.oldSeries=[],l=r.oldDataGroupIds=[],u=r.oldData=[],h=0;h<a.length;h++){var c=a[h].getData();c.count()<1e4&&(s.push(a[h]),l.push(a[h].get("dataGroupId")),u.push(c))}})}),vM(eI),vM(function(t){!function(t){function e(t,e){var n=[],r=ts(e,t);function i(e,i){B(r[e],function(e){B(e.updateAxisBreaks(t).breaks,function(t){var r;n.push(E(((r={})[i]=e.componentIndex,r),t))})})}return i("xAxisModels","xAxisIndex"),i("yAxisModels","yAxisIndex"),i("singleAxisModels","singleAxisIndex"),{eventBreaks:n}}t.registerAction(YD,e),t.registerAction(qD,e),t.registerAction(KD,e)}(t),l1(),f1()}),vM(function(){pE=g1}),vM(function(t){t.registerLayout(t.PRIORITY.VISUAL.POST_CHART_LAYOUT,QE())});var m1=Object.freeze({__proto__:null,Axis:rC,ChartView:l_,ComponentModel:tm,ComponentView:Qy,List:oS,Model:xf,PRIORITY:lb,SeriesModel:Ky,color:kr,connect:rw,dataTool:Dw,dependencies:ob,disConnect:ow,disconnect:iw,dispose:aw,env:i,extendChartView:sC,extendComponentModel:iC,extendComponentView:oC,extendSeriesModel:aC,format:NM,getCoordinateSystemDimensions:vw,getInstanceByDom:sw,getInstanceById:lw,getMap:Cw,graphic:OM,helper:fM,init:nw,innerDrawElementOnCanvas:Zx,matrix:Oe,number:PM,parseGeoJSON:LM,parseGeoJson:LM,registerAction:gw,registerCoordinateSystem:mw,registerCustomSeries:yw,registerLayout:_w,registerLoading:Sw,registerLocale:Lf,registerMap:Mw,registerPostInit:dw,registerPostUpdate:pw,registerPreprocessor:hw,registerProcessor:cw,registerTheme:uw,registerTransform:Iw,registerUpdateLifecycle:fw,registerVisual:xw,setCanvasCreator:Tw,setPlatformAPI:c,throttle:d_,time:EM,use:vM,util:RM,vector:Yt,version:ib,zrUtil:Ct,zrender:Bo});vM([kA,t0]);var v1={init:function(){return console.error("\"import echarts from 'echarts/lib/echarts.js'\" is not supported anymore. Use \"import * as echarts from 'echarts/lib/echarts.js'\" instead;"),nw.apply(null,arguments)}};vM(eI);var y1=Object.freeze({__proto__:null,Axis:rC,ChartView:l_,ComponentModel:tm,ComponentView:Qy,List:oS,Model:xf,PRIORITY:lb,SeriesModel:Ky,color:kr,connect:rw,dataTool:Dw,default:v1,dependencies:ob,disConnect:ow,disconnect:iw,dispose:aw,env:i,extendChartView:sC,extendComponentModel:iC,extendComponentView:oC,extendSeriesModel:aC,format:NM,getCoordinateSystemDimensions:vw,getInstanceByDom:sw,getInstanceById:lw,getMap:Cw,graphic:OM,helper:fM,init:nw,innerDrawElementOnCanvas:Zx,matrix:Oe,number:PM,parseGeoJSON:LM,parseGeoJson:LM,registerAction:gw,registerCoordinateSystem:mw,registerCustomSeries:yw,registerLayout:_w,registerLoading:Sw,registerLocale:Lf,registerMap:Mw,registerPostInit:dw,registerPostUpdate:pw,registerPreprocessor:hw,registerProcessor:cw,registerTheme:uw,registerTransform:Iw,registerUpdateLifecycle:fw,registerVisual:xw,setCanvasCreator:Tw,setPlatformAPI:c,throttle:d_,time:EM,use:vM,util:RM,vector:Yt,version:ib,zrUtil:Ct,zrender:Bo});function _1(t,e,n){"object"==typeof e&&(n=e,e=null);var r,i=this;if(!(t instanceof Function))for(var o in r=[],t)t.hasOwnProperty(o)&&r.push(o);var a=function(e){if(i.apply(this,arguments),t instanceof Function?x1(this,t.call(this,e)):function(t,e,n){for(var r=0;r<n.length;r++){var i=n[r];t[i]=e[i]}}(this,t,r),this.constructor===a)for(var n=a.__initializers__,o=0;o<n.length;o++)n[o].apply(this,arguments)};a.__super__=i,i.__initializers__?a.__initializers__=i.__initializers__.slice():a.__initializers__=[],e&&a.__initializers__.push(e);var s=function(){};return s.prototype=i.prototype,a.prototype=new s,a.prototype.constructor=a,x1(a.prototype,n),a.extend=i.extend,a.derive=i.extend,a}function x1(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}var b1={extend:_1,derive:_1};function w1(t,e){this.action=t,this.context=e}var S1={trigger:function(t){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(t)){var e=this.__handlers__[t],n=e.length,r=-1,i=arguments;switch(i.length){case 1:for(;++r<n;)e[r].action.call(e[r].context);return;case 2:for(;++r<n;)e[r].action.call(e[r].context,i[1]);return;case 3:for(;++r<n;)e[r].action.call(e[r].context,i[1],i[2]);return;case 4:for(;++r<n;)e[r].action.call(e[r].context,i[1],i[2],i[3]);return;case 5:for(;++r<n;)e[r].action.call(e[r].context,i[1],i[2],i[3],i[4]);return;default:for(;++r<n;)e[r].action.apply(e[r].context,Array.prototype.slice.call(i,1));return}}},on:function(t,e,n){if(t&&e){var r=this.__handlers__||(this.__handlers__={});if(r[t]){if(this.has(t,e))return}else r[t]=[];var i=new w1(e,n||this);return r[t].push(i),this}},once:function(t,e,n){if(t&&e){var r=this;return this.on(t,function n(){r.off(t,n),e.apply(this,arguments)},n)}},before:function(t,e,n){if(t&&e)return t="before"+t,this.on(t,e,n)},after:function(t,e,n){if(t&&e)return t="after"+t,this.on(t,e,n)},success:function(t,e){return this.once("success",t,e)},error:function(t,e){return this.once("error",t,e)},off:function(t,e){var n=this.__handlers__||(this.__handlers__={});if(e){if(n[t]){for(var r=n[t],i=[],o=0;o<r.length;o++)e&&r[o].action!==e&&i.push(r[o]);n[t]=i}return this}n[t]=[]},has:function(t,e){var n=this.__handlers__;if(!n||!n[t])return!1;for(var r=n[t],i=0;i<r.length;i++)if(r[i].action===e)return!0}},T1=S1,M1=0,C1=Array.prototype.forEach,I1={genGUID:function(){return++M1},relative2absolute:function(t,e){if(!e||t.match(/^\//))return t;for(var n=t.split("/"),r=e.split("/"),i=n[0];"."===i||".."===i;)".."===i&&r.pop(),n.shift(),i=n[0];return r.join("/")+"/"+n.join("/")},extend:function(t,e){if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},defaults:function(t,e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t},extendWithPropList:function(t,e,n){if(e)for(var r=0;r<n.length;r++){var i=n[r];t[i]=e[i]}return t},defaultsWithPropList:function(t,e,n){if(e)for(var r=0;r<n.length;r++){var i=n[r];null==t[i]&&(t[i]=e[i])}return t},each:function(t,e,n){if(t&&e)if(t.forEach&&t.forEach===C1)t.forEach(e,n);else if(t.length===+t.length)for(var r=0,i=t.length;r<i;r++)e.call(n,t[r],r,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)},isObject:function(t){return t===Object(t)},isArray:function(t){return Array.isArray(t)},isArrayLike:function(t){return!!t&&t.length===+t.length},clone:function(t){if(I1.isObject(t)){if(I1.isArray(t))return t.slice();if(I1.isArrayLike(t)){for(var e=new t.constructor(t.length),n=0;n<t.length;n++)e[n]=t[n];return e}return I1.extend({},t)}return t}},A1=I1,D1=function(){this.__uid__=A1.genGUID()};D1.__initializers__=[function(t){A1.extend(this,t)}],A1.extend(D1,b1),A1.extend(D1.prototype,T1);var L1,P1=D1,E1=1e-6,O1=Array,N1=Math.random,R1={};R1.create=function(){var t=new O1(3);return t[0]=0,t[1]=0,t[2]=0,t},R1.clone=function(t){var e=new O1(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},R1.fromValues=function(t,e,n){var r=new O1(3);return r[0]=t,r[1]=e,r[2]=n,r},R1.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},R1.set=function(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t},R1.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t},R1.subtract=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},R1.sub=R1.subtract,R1.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t},R1.mul=R1.multiply,R1.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t},R1.div=R1.divide,R1.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},R1.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},R1.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t},R1.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t},R1.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(n*n+r*r+i*i)},R1.dist=R1.distance,R1.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i},R1.sqrDist=R1.squaredDistance,R1.length=function(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)},R1.len=R1.length,R1.squaredLength=function(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r},R1.sqrLen=R1.squaredLength,R1.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t},R1.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t},R1.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t},R1.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},R1.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2];return t[0]=i*l-o*s,t[1]=o*a-r*l,t[2]=r*s-i*a,t},R1.lerp=function(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t},R1.random=function(t,e){e=e||1;var n=2*N1()*Math.PI,r=2*N1()-1,i=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*i,t[1]=Math.sin(n)*i,t[2]=r*e,t},R1.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t},R1.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},R1.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2],u=n[3],h=u*r+s*o-l*i,c=u*i+l*r-a*o,d=u*o+a*i-s*r,p=-a*r-s*i-l*o;return t[0]=h*u+p*-a+c*-l-d*-s,t[1]=c*u+p*-s+d*-a-h*-l,t[2]=d*u+p*-l+h*-s-c*-a,t},R1.rotateX=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},R1.rotateY=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},R1.rotateZ=function(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t},R1.forEach=(L1=R1.create(),function(t,e,n,r,i,o){var a,s;for(e||(e=3),n||(n=0),s=r?Math.min(r*e+n,t.length):t.length,a=n;a<s;a+=e)L1[0]=t[a],L1[1]=t[a+1],L1[2]=t[a+2],i(L1,L1,o),t[a]=L1[0],t[a+1]=L1[1],t[a+2]=L1[2];return t}),R1.angle=function(t,e){var n=R1.fromValues(t[0],t[1],t[2]),r=R1.fromValues(e[0],e[1],e[2]);R1.normalize(n,n),R1.normalize(r,r);var i=R1.dot(n,r);return i>1?0:Math.acos(i)};var k1=R1,z1=function(t,e,n){t=t||0,e=e||0,n=n||0,this.array=k1.fromValues(t,e,n),this._dirty=!0};z1.prototype={constructor:z1,add:function(t){return k1.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e,n){return this.array[0]=t,this.array[1]=e,this.array[2]=n,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this._dirty=!0,this},clone:function(){return new z1(this.x,this.y,this.z)},copy:function(t){return k1.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return k1.cross(this.array,t.array,e.array),this._dirty=!0,this},dist:function(t){return k1.dist(this.array,t.array)},distance:function(t){return k1.distance(this.array,t.array)},div:function(t){return k1.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return k1.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return k1.dot(this.array,t.array)},len:function(){return k1.len(this.array)},length:function(){return k1.length(this.array)},lerp:function(t,e,n){return k1.lerp(this.array,t.array,e.array,n),this._dirty=!0,this},min:function(t){return k1.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return k1.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return k1.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return k1.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return k1.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return k1.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return k1.random(this.array,t),this._dirty=!0,this},scale:function(t){return k1.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return k1.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return k1.sqrDist(this.array,t.array)},squaredDistance:function(t){return k1.squaredDistance(this.array,t.array)},sqrLen:function(){return k1.sqrLen(this.array)},squaredLength:function(){return k1.squaredLength(this.array)},sub:function(t){return k1.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return k1.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return k1.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return k1.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return k1.transformQuat(this.array,this.array,t.array),this._dirty=!0,this},applyProjection:function(t){var e=this.array;if(0===(t=t.array)[15]){var n=-1/e[2];e[0]=t[0]*e[0]*n,e[1]=t[5]*e[1]*n,e[2]=(t[10]*e[2]+t[14])*n}else e[0]=t[0]*e[0]+t[12],e[1]=t[5]*e[1]+t[13],e[2]=t[10]*e[2]+t[14];return this._dirty=!0,this},eulerFromQuat:function(t,e){z1.eulerFromQuat(this,t,e)},eulerFromMat3:function(t,e){z1.eulerFromMat3(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var B1=Object.defineProperty;if(B1){var V1=z1.prototype;B1(V1,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),B1(V1,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),B1(V1,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}})}function F1(t,e,n){return t<e?e:t>n?n:t}z1.add=function(t,e,n){return k1.add(t.array,e.array,n.array),t._dirty=!0,t},z1.set=function(t,e,n,r){k1.set(t.array,e,n,r),t._dirty=!0},z1.copy=function(t,e){return k1.copy(t.array,e.array),t._dirty=!0,t},z1.cross=function(t,e,n){return k1.cross(t.array,e.array,n.array),t._dirty=!0,t},z1.distance=z1.dist=function(t,e){return k1.distance(t.array,e.array)},z1.div=function(t,e,n){return k1.divide(t.array,e.array,n.array),t._dirty=!0,t},z1.divide=z1.div,z1.dot=function(t,e){return k1.dot(t.array,e.array)},z1.len=function(t){return k1.length(t.array)},z1.lerp=function(t,e,n,r){return k1.lerp(t.array,e.array,n.array,r),t._dirty=!0,t},z1.min=function(t,e,n){return k1.min(t.array,e.array,n.array),t._dirty=!0,t},z1.max=function(t,e,n){return k1.max(t.array,e.array,n.array),t._dirty=!0,t},z1.mul=function(t,e,n){return k1.multiply(t.array,e.array,n.array),t._dirty=!0,t},z1.multiply=z1.mul,z1.negate=function(t,e){return k1.negate(t.array,e.array),t._dirty=!0,t},z1.normalize=function(t,e){return k1.normalize(t.array,e.array),t._dirty=!0,t},z1.random=function(t,e){return k1.random(t.array,e),t._dirty=!0,t},z1.scale=function(t,e,n){return k1.scale(t.array,e.array,n),t._dirty=!0,t},z1.scaleAndAdd=function(t,e,n,r){return k1.scaleAndAdd(t.array,e.array,n.array,r),t._dirty=!0,t},z1.squaredDistance=z1.sqrDist=function(t,e){return k1.sqrDist(t.array,e.array)},z1.squaredLength=z1.sqrLen=function(t){return k1.sqrLen(t.array)},z1.sub=function(t,e,n){return k1.subtract(t.array,e.array,n.array),t._dirty=!0,t},z1.subtract=z1.sub,z1.transformMat3=function(t,e,n){return k1.transformMat3(t.array,e.array,n.array),t._dirty=!0,t},z1.transformMat4=function(t,e,n){return k1.transformMat4(t.array,e.array,n.array),t._dirty=!0,t},z1.transformQuat=function(t,e,n){return k1.transformQuat(t.array,e.array,n.array),t._dirty=!0,t};var G1=Math.atan2,H1=Math.asin,U1=Math.abs;z1.eulerFromQuat=function(t,e,n){t._dirty=!0,e=e.array;var r=t.array,i=e[0],o=e[1],a=e[2],s=e[3],l=i*i,u=o*o,h=a*a,c=s*s;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":r[0]=G1(2*(i*s-o*a),c-l-u+h),r[1]=H1(F1(2*(i*a+o*s),-1,1)),r[2]=G1(2*(a*s-i*o),c+l-u-h);break;case"YXZ":r[0]=H1(F1(2*(i*s-o*a),-1,1)),r[1]=G1(2*(i*a+o*s),c-l-u+h),r[2]=G1(2*(i*o+a*s),c-l+u-h);break;case"ZXY":r[0]=H1(F1(2*(i*s+o*a),-1,1)),r[1]=G1(2*(o*s-a*i),c-l-u+h),r[2]=G1(2*(a*s-i*o),c-l+u-h);break;case"ZYX":r[0]=G1(2*(i*s+a*o),c-l-u+h),r[1]=H1(F1(2*(o*s-i*a),-1,1)),r[2]=G1(2*(i*o+a*s),c+l-u-h);break;case"YZX":r[0]=G1(2*(i*s-a*o),c-l+u-h),r[1]=G1(2*(o*s-i*a),c+l-u-h),r[2]=H1(F1(2*(i*o+a*s),-1,1));break;case"XZY":r[0]=G1(2*(i*s+o*a),c-l+u-h),r[1]=G1(2*(i*a+o*s),c+l-u-h),r[2]=H1(F1(2*(a*s-i*o),-1,1));break;default:console.warn("Unkown order: "+n)}return t},z1.eulerFromMat3=function(t,e,n){var r=e.array,i=r[0],o=r[3],a=r[6],s=r[1],l=r[4],u=r[7],h=r[2],c=r[5],d=r[8],p=t.array;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":p[1]=H1(F1(a,-1,1)),U1(a)<.99999?(p[0]=G1(-u,d),p[2]=G1(-o,i)):(p[0]=G1(c,l),p[2]=0);break;case"YXZ":p[0]=H1(-F1(u,-1,1)),U1(u)<.99999?(p[1]=G1(a,d),p[2]=G1(s,l)):(p[1]=G1(-h,i),p[2]=0);break;case"ZXY":p[0]=H1(F1(c,-1,1)),U1(c)<.99999?(p[1]=G1(-h,d),p[2]=G1(-o,l)):(p[1]=0,p[2]=G1(s,i));break;case"ZYX":p[1]=H1(-F1(h,-1,1)),U1(h)<.99999?(p[0]=G1(c,d),p[2]=G1(s,i)):(p[0]=0,p[2]=G1(-o,l));break;case"YZX":p[2]=H1(F1(s,-1,1)),U1(s)<.99999?(p[0]=G1(-u,l),p[1]=G1(-h,i)):(p[0]=0,p[1]=G1(a,d));break;case"XZY":p[2]=H1(-F1(o,-1,1)),U1(o)<.99999?(p[0]=G1(c,l),p[1]=G1(a,i)):(p[0]=G1(-u,d),p[1]=0);break;default:console.warn("Unkown order: "+n)}return t._dirty=!0,t},Object.defineProperties(z1,{POSITIVE_X:{get:function(){return new z1(1,0,0)}},NEGATIVE_X:{get:function(){return new z1(-1,0,0)}},POSITIVE_Y:{get:function(){return new z1(0,1,0)}},NEGATIVE_Y:{get:function(){return new z1(0,-1,0)}},POSITIVE_Z:{get:function(){return new z1(0,0,1)}},NEGATIVE_Z:{get:function(){return new z1(0,0,-1)}},UP:{get:function(){return new z1(0,1,0)}},ZERO:{get:function(){return new z1}}});var W1=z1,X1={create:function(){var t=new O1(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},clone:function(t){var e=new O1(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},fromValues:function(t,e,n,r){var i=new O1(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},set:function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},subtract:function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}};X1.sub=X1.subtract,X1.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},X1.mul=X1.multiply,X1.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t},X1.div=X1.divide,X1.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},X1.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},X1.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},X1.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t},X1.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.sqrt(n*n+r*r+i*i+o*o)},X1.dist=X1.distance,X1.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return n*n+r*r+i*i+o*o},X1.sqrDist=X1.squaredDistance,X1.length=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+n*n+r*r+i*i)},X1.len=X1.length,X1.squaredLength=function(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i},X1.sqrLen=X1.squaredLength,X1.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},X1.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},X1.normalize=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t[3]=e[3]*a),t},X1.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},X1.lerp=function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t},X1.random=function(t,e){return e=e||1,t[0]=N1(),t[1]=N1(),t[2]=N1(),t[3]=N1(),X1.normalize(t,t),X1.scale(t,t,e),t},X1.transformMat4=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t},X1.transformQuat=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],l=n[2],u=n[3],h=u*r+s*o-l*i,c=u*i+l*r-a*o,d=u*o+a*i-s*r,p=-a*r-s*i-l*o;return t[0]=h*u+p*-a+c*-l-d*-s,t[1]=c*u+p*-s+d*-a-h*-l,t[2]=d*u+p*-l+h*-s-c*-a,t},X1.forEach=function(){var t=X1.create();return function(e,n,r,i,o,a){var s,l;for(n||(n=4),r||(r=0),l=i?Math.min(i*n+r,e.length):e.length,s=r;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();var j1=X1,Z1={create:function(){var t=new O1(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromMat4:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},clone:function(t){var e=new O1(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},copy:function(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[6]=e[6],t[7]=e[7],t[8]=e[8],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},transpose:function(t,e){if(t===e){var n=e[1],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=h*a-s*u,d=-h*o+s*l,p=u*o-a*l,f=n*c+r*d+i*p;return f?(f=1/f,t[0]=c*f,t[1]=(-h*r+i*u)*f,t[2]=(s*r-i*a)*f,t[3]=d*f,t[4]=(h*n-i*l)*f,t[5]=(-s*n+i*o)*f,t[6]=p*f,t[7]=(-u*n+r*l)*f,t[8]=(a*n-r*o)*f,t):null},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],h=e[8];return t[0]=a*h-s*u,t[1]=i*u-r*h,t[2]=r*s-i*a,t[3]=s*l-o*h,t[4]=n*h-i*l,t[5]=i*o-n*s,t[6]=o*u-a*l,t[7]=r*l-n*u,t[8]=n*a-r*o,t},determinant:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8];return e*(u*o-a*l)+n*(-u*i+a*s)+r*(l*i-o*s)},multiply:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=n[0],p=n[1],f=n[2],g=n[3],m=n[4],v=n[5],y=n[6],_=n[7],x=n[8];return t[0]=d*r+p*a+f*u,t[1]=d*i+p*s+f*h,t[2]=d*o+p*l+f*c,t[3]=g*r+m*a+v*u,t[4]=g*i+m*s+v*h,t[5]=g*o+m*l+v*c,t[6]=y*r+_*a+x*u,t[7]=y*i+_*s+x*h,t[8]=y*o+_*l+x*c,t}};Z1.mul=Z1.multiply,Z1.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=n[0],p=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=d*r+p*a+u,t[7]=d*i+p*s+h,t[8]=d*o+p*l+c,t},Z1.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=Math.sin(n),p=Math.cos(n);return t[0]=p*r+d*a,t[1]=p*i+d*s,t[2]=p*o+d*l,t[3]=p*a-d*r,t[4]=p*s-d*i,t[5]=p*l-d*o,t[6]=u,t[7]=h,t[8]=c,t},Z1.scale=function(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},Z1.fromMat2d=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t},Z1.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,l=i+i,u=n*a,h=r*a,c=r*s,d=i*a,p=i*s,f=i*l,g=o*a,m=o*s,v=o*l;return t[0]=1-c-f,t[3]=h-v,t[6]=d+m,t[1]=h+v,t[4]=1-u-f,t[7]=p-g,t[2]=d-m,t[5]=p+g,t[8]=1-u-c,t},Z1.normalFromMat4=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=e[9],d=e[10],p=e[11],f=e[12],g=e[13],m=e[14],v=e[15],y=n*s-r*a,_=n*l-i*a,x=n*u-o*a,b=r*l-i*s,w=r*u-o*s,S=i*u-o*l,T=h*g-c*f,M=h*m-d*f,C=h*v-p*f,I=c*m-d*g,A=c*v-p*g,D=d*v-p*m,L=y*D-_*A+x*I+b*C-w*M+S*T;return L?(L=1/L,t[0]=(s*D-l*A+u*I)*L,t[1]=(l*C-a*D-u*M)*L,t[2]=(a*A-s*C+u*T)*L,t[3]=(i*A-r*D-o*I)*L,t[4]=(n*D-i*C+o*M)*L,t[5]=(r*C-n*A-o*T)*L,t[6]=(g*S-m*w+v*b)*L,t[7]=(m*x-f*S-v*_)*L,t[8]=(f*w-g*x+v*y)*L,t):null},Z1.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2))};var Y1,q1,K1,J1,Q1=Z1,$1={};$1.create=function(){var t=new O1(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},$1.rotationTo=(Y1=k1.create(),q1=k1.fromValues(1,0,0),K1=k1.fromValues(0,1,0),function(t,e,n){var r=k1.dot(e,n);return r<-.999999?(k1.cross(Y1,q1,e),k1.length(Y1)<1e-6&&k1.cross(Y1,K1,e),k1.normalize(Y1,Y1),$1.setAxisAngle(t,Y1,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(k1.cross(Y1,e,n),t[0]=Y1[0],t[1]=Y1[1],t[2]=Y1[2],t[3]=1+r,$1.normalize(t,t))}),$1.setAxes=(J1=Q1.create(),function(t,e,n,r){return J1[0]=n[0],J1[3]=n[1],J1[6]=n[2],J1[1]=r[0],J1[4]=r[1],J1[7]=r[2],J1[2]=-e[0],J1[5]=-e[1],J1[8]=-e[2],$1.normalize(t,$1.fromMat3(t,J1))}),$1.clone=j1.clone,$1.fromValues=j1.fromValues,$1.copy=j1.copy,$1.set=j1.set,$1.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},$1.setAxisAngle=function(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t},$1.add=j1.add,$1.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],l=n[1],u=n[2],h=n[3];return t[0]=r*h+a*s+i*u-o*l,t[1]=i*h+a*l+o*s-r*u,t[2]=o*h+a*u+r*l-i*s,t[3]=a*h-r*s-i*l-o*u,t},$1.mul=$1.multiply,$1.scale=j1.scale,$1.rotateX=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l+a*s,t[1]=i*l+o*s,t[2]=o*l-i*s,t[3]=a*l-r*s,t},$1.rotateY=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l-o*s,t[1]=i*l+a*s,t[2]=o*l+r*s,t[3]=a*l-i*s,t},$1.rotateZ=function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l+i*s,t[1]=i*l-r*s,t[2]=o*l+a*s,t[3]=a*l-o*s,t},$1.calculateW=function(t,e){var n=e[0],r=e[1],i=e[2];return t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i)),t},$1.dot=j1.dot,$1.lerp=j1.lerp,$1.slerp=function(t,e,n,r){var i,o,a,s,l,u=e[0],h=e[1],c=e[2],d=e[3],p=n[0],f=n[1],g=n[2],m=n[3];return(o=u*p+h*f+c*g+d*m)<0&&(o=-o,p=-p,f=-f,g=-g,m=-m),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,l=Math.sin(r*i)/a):(s=1-r,l=r),t[0]=s*u+l*p,t[1]=s*h+l*f,t[2]=s*c+l*g,t[3]=s*d+l*m,t},$1.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t},$1.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},$1.length=j1.length,$1.len=$1.length,$1.squaredLength=j1.squaredLength,$1.sqrLen=$1.squaredLength,$1.normalize=j1.normalize,$1.fromMat3=function(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t};var t2,e2=$1,n2=function(t,e,n,r){t=t||0,e=e||0,n=n||0,r=void 0===r?1:r,this.array=e2.fromValues(t,e,n,r),this._dirty=!0};n2.prototype={constructor:n2,add:function(t){return e2.add(this.array,this.array,t.array),this._dirty=!0,this},calculateW:function(){return e2.calculateW(this.array,this.array),this._dirty=!0,this},set:function(t,e,n,r){return this.array[0]=t,this.array[1]=e,this.array[2]=n,this.array[3]=r,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this.array[3]=t[3],this._dirty=!0,this},clone:function(){return new n2(this.x,this.y,this.z,this.w)},conjugate:function(){return e2.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(t){return e2.copy(this.array,t.array),this._dirty=!0,this},dot:function(t){return e2.dot(this.array,t.array)},fromMat3:function(t){return e2.fromMat3(this.array,t.array),this._dirty=!0,this},fromMat4:(t2=Q1.create(),function(t){return Q1.fromMat4(t2,t.array),Q1.transpose(t2,t2),e2.fromMat3(this.array,t2),this._dirty=!0,this}),identity:function(){return e2.identity(this.array),this._dirty=!0,this},invert:function(){return e2.invert(this.array,this.array),this._dirty=!0,this},len:function(){return e2.len(this.array)},length:function(){return e2.length(this.array)},lerp:function(t,e,n){return e2.lerp(this.array,t.array,e.array,n),this._dirty=!0,this},mul:function(t){return e2.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return e2.multiply(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return e2.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return e2.multiply(this.array,t.array,this.array),this._dirty=!0,this},normalize:function(){return e2.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(t){return e2.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return e2.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return e2.rotateZ(this.array,this.array,t),this._dirty=!0,this},rotationTo:function(t,e){return e2.rotationTo(this.array,t.array,e.array),this._dirty=!0,this},setAxes:function(t,e,n){return e2.setAxes(this.array,t.array,e.array,n.array),this._dirty=!0,this},setAxisAngle:function(t,e){return e2.setAxisAngle(this.array,t.array,e),this._dirty=!0,this},slerp:function(t,e,n){return e2.slerp(this.array,t.array,e.array,n),this._dirty=!0,this},sqrLen:function(){return e2.sqrLen(this.array)},squaredLength:function(){return e2.squaredLength(this.array)},fromEuler:function(t,e){return n2.fromEuler(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var r2=Object.defineProperty;if(r2){var i2=n2.prototype;r2(i2,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),r2(i2,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),r2(i2,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),r2(i2,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}n2.add=function(t,e,n){return e2.add(t.array,e.array,n.array),t._dirty=!0,t},n2.set=function(t,e,n,r,i){e2.set(t.array,e,n,r,i),t._dirty=!0},n2.copy=function(t,e){return e2.copy(t.array,e.array),t._dirty=!0,t},n2.calculateW=function(t,e){return e2.calculateW(t.array,e.array),t._dirty=!0,t},n2.conjugate=function(t,e){return e2.conjugate(t.array,e.array),t._dirty=!0,t},n2.identity=function(t){return e2.identity(t.array),t._dirty=!0,t},n2.invert=function(t,e){return e2.invert(t.array,e.array),t._dirty=!0,t},n2.dot=function(t,e){return e2.dot(t.array,e.array)},n2.len=function(t){return e2.length(t.array)},n2.lerp=function(t,e,n,r){return e2.lerp(t.array,e.array,n.array,r),t._dirty=!0,t},n2.slerp=function(t,e,n,r){return e2.slerp(t.array,e.array,n.array,r),t._dirty=!0,t},n2.mul=function(t,e,n){return e2.multiply(t.array,e.array,n.array),t._dirty=!0,t},n2.multiply=n2.mul,n2.rotateX=function(t,e,n){return e2.rotateX(t.array,e.array,n),t._dirty=!0,t},n2.rotateY=function(t,e,n){return e2.rotateY(t.array,e.array,n),t._dirty=!0,t},n2.rotateZ=function(t,e,n){return e2.rotateZ(t.array,e.array,n),t._dirty=!0,t},n2.setAxisAngle=function(t,e,n){return e2.setAxisAngle(t.array,e.array,n),t._dirty=!0,t},n2.normalize=function(t,e){return e2.normalize(t.array,e.array),t._dirty=!0,t},n2.squaredLength=n2.sqrLen=function(t){return e2.sqrLen(t.array)},n2.fromMat3=function(t,e){return e2.fromMat3(t.array,e.array),t._dirty=!0,t},n2.setAxes=function(t,e,n,r){return e2.setAxes(t.array,e.array,n.array,r.array),t._dirty=!0,t},n2.rotationTo=function(t,e,n){return e2.rotationTo(t.array,e.array,n.array),t._dirty=!0,t},n2.fromEuler=function(t,e,n){t._dirty=!0,e=e.array;var r=t.array,i=Math.cos(e[0]/2),o=Math.cos(e[1]/2),a=Math.cos(e[2]/2),s=Math.sin(e[0]/2),l=Math.sin(e[1]/2),u=Math.sin(e[2]/2);switch(n=(n||"XYZ").toUpperCase()){case"XYZ":r[0]=s*o*a+i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a-s*l*u;break;case"YXZ":r[0]=s*o*a+i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a+s*l*u;break;case"ZXY":r[0]=s*o*a-i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a-s*l*u;break;case"ZYX":r[0]=s*o*a-i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a+s*l*u;break;case"YZX":r[0]=s*o*a+i*l*u,r[1]=i*l*a+s*o*u,r[2]=i*o*u-s*l*a,r[3]=i*o*a-s*l*u;break;case"XZY":r[0]=s*o*a-i*l*u,r[1]=i*l*a-s*o*u,r[2]=i*o*u+s*l*a,r[3]=i*o*a+s*l*u}};var o2=n2,a2={create:function(){var t=new O1(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},clone:function(t){var e=new O1(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:function(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[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},transpose:function(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=e[9],d=e[10],p=e[11],f=e[12],g=e[13],m=e[14],v=e[15],y=n*s-r*a,_=n*l-i*a,x=n*u-o*a,b=r*l-i*s,w=r*u-o*s,S=i*u-o*l,T=h*g-c*f,M=h*m-d*f,C=h*v-p*f,I=c*m-d*g,A=c*v-p*g,D=d*v-p*m,L=y*D-_*A+x*I+b*C-w*M+S*T;return L?(L=1/L,t[0]=(s*D-l*A+u*I)*L,t[1]=(i*A-r*D-o*I)*L,t[2]=(g*S-m*w+v*b)*L,t[3]=(d*w-c*S-p*b)*L,t[4]=(l*C-a*D-u*M)*L,t[5]=(n*D-i*C+o*M)*L,t[6]=(m*x-f*S-v*_)*L,t[7]=(h*S-d*x+p*_)*L,t[8]=(a*A-s*C+u*T)*L,t[9]=(r*C-n*A-o*T)*L,t[10]=(f*w-g*x+v*y)*L,t[11]=(c*x-h*w-p*y)*L,t[12]=(s*M-a*I-l*T)*L,t[13]=(n*I-r*M+i*T)*L,t[14]=(g*_-f*b-m*y)*L,t[15]=(h*b-c*_+d*y)*L,t):null},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],h=e[8],c=e[9],d=e[10],p=e[11],f=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(d*v-p*m)-c*(l*v-u*m)+g*(l*p-u*d),t[1]=-(r*(d*v-p*m)-c*(i*v-o*m)+g*(i*p-o*d)),t[2]=r*(l*v-u*m)-s*(i*v-o*m)+g*(i*u-o*l),t[3]=-(r*(l*p-u*d)-s*(i*p-o*d)+c*(i*u-o*l)),t[4]=-(a*(d*v-p*m)-h*(l*v-u*m)+f*(l*p-u*d)),t[5]=n*(d*v-p*m)-h*(i*v-o*m)+f*(i*p-o*d),t[6]=-(n*(l*v-u*m)-a*(i*v-o*m)+f*(i*u-o*l)),t[7]=n*(l*p-u*d)-a*(i*p-o*d)+h*(i*u-o*l),t[8]=a*(c*v-p*g)-h*(s*v-u*g)+f*(s*p-u*c),t[9]=-(n*(c*v-p*g)-h*(r*v-o*g)+f*(r*p-o*c)),t[10]=n*(s*v-u*g)-a*(r*v-o*g)+f*(r*u-o*s),t[11]=-(n*(s*p-u*c)-a*(r*p-o*c)+h*(r*u-o*s)),t[12]=-(a*(c*m-d*g)-h*(s*m-l*g)+f*(s*d-l*c)),t[13]=n*(c*m-d*g)-h*(r*m-i*g)+f*(r*d-i*c),t[14]=-(n*(s*m-l*g)-a*(r*m-i*g)+f*(r*l-i*s)),t[15]=n*(s*d-l*c)-a*(r*d-i*c)+h*(r*l-i*s),t},determinant:function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],h=t[9],c=t[10],d=t[11],p=t[12],f=t[13],g=t[14],m=t[15];return(e*a-n*o)*(c*m-d*g)-(e*s-r*o)*(h*m-d*f)+(e*l-i*o)*(h*g-c*f)+(n*s-r*a)*(u*m-d*p)-(n*l-i*a)*(u*g-c*p)+(r*l-i*s)*(u*f-h*p)},multiply:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=e[9],p=e[10],f=e[11],g=e[12],m=e[13],v=e[14],y=e[15],_=n[0],x=n[1],b=n[2],w=n[3];return t[0]=_*r+x*s+b*c+w*g,t[1]=_*i+x*l+b*d+w*m,t[2]=_*o+x*u+b*p+w*v,t[3]=_*a+x*h+b*f+w*y,_=n[4],x=n[5],b=n[6],w=n[7],t[4]=_*r+x*s+b*c+w*g,t[5]=_*i+x*l+b*d+w*m,t[6]=_*o+x*u+b*p+w*v,t[7]=_*a+x*h+b*f+w*y,_=n[8],x=n[9],b=n[10],w=n[11],t[8]=_*r+x*s+b*c+w*g,t[9]=_*i+x*l+b*d+w*m,t[10]=_*o+x*u+b*p+w*v,t[11]=_*a+x*h+b*f+w*y,_=n[12],x=n[13],b=n[14],w=n[15],t[12]=_*r+x*s+b*c+w*g,t[13]=_*i+x*l+b*d+w*m,t[14]=_*o+x*u+b*p+w*v,t[15]=_*a+x*h+b*f+w*y,t},multiplyAffine:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],h=e[9],c=e[10],d=e[12],p=e[13],f=e[14],g=n[0],m=n[1],v=n[2];return t[0]=g*r+m*a+v*u,t[1]=g*i+m*s+v*h,t[2]=g*o+m*l+v*c,g=n[4],m=n[5],v=n[6],t[4]=g*r+m*a+v*u,t[5]=g*i+m*s+v*h,t[6]=g*o+m*l+v*c,g=n[8],m=n[9],v=n[10],t[8]=g*r+m*a+v*u,t[9]=g*i+m*s+v*h,t[10]=g*o+m*l+v*c,g=n[12],m=n[13],v=n[14],t[12]=g*r+m*a+v*u+d,t[13]=g*i+m*s+v*h+p,t[14]=g*o+m*l+v*c+f,t}};a2.mul=a2.multiply,a2.mulAffine=a2.multiplyAffine,a2.translate=function(t,e,n){var r,i,o,a,s,l,u,h,c,d,p,f,g=n[0],m=n[1],v=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],h=e[7],c=e[8],d=e[9],p=e[10],f=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=u,t[7]=h,t[8]=c,t[9]=d,t[10]=p,t[11]=f,t[12]=r*g+s*m+c*v+e[12],t[13]=i*g+l*m+d*v+e[13],t[14]=o*g+u*m+p*v+e[14],t[15]=a*g+h*m+f*v+e[15]),t},a2.scale=function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},a2.rotate=function(t,e,n,r){var i,o,a,s,l,u,h,c,d,p,f,g,m,v,y,_,x,b,w,S,T,M,C,I,A=r[0],D=r[1],L=r[2],P=Math.sqrt(A*A+D*D+L*L);return Math.abs(P)<E1?null:(A*=P=1/P,D*=P,L*=P,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],l=e[1],u=e[2],h=e[3],c=e[4],d=e[5],p=e[6],f=e[7],g=e[8],m=e[9],v=e[10],y=e[11],_=A*A*a+o,x=D*A*a+L*i,b=L*A*a-D*i,w=A*D*a-L*i,S=D*D*a+o,T=L*D*a+A*i,M=A*L*a+D*i,C=D*L*a-A*i,I=L*L*a+o,t[0]=s*_+c*x+g*b,t[1]=l*_+d*x+m*b,t[2]=u*_+p*x+v*b,t[3]=h*_+f*x+y*b,t[4]=s*w+c*S+g*T,t[5]=l*w+d*S+m*T,t[6]=u*w+p*S+v*T,t[7]=h*w+f*S+y*T,t[8]=s*M+c*C+g*I,t[9]=l*M+d*C+m*I,t[10]=u*M+p*C+v*I,t[11]=h*M+f*C+y*I,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},a2.rotateX=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],h=e[9],c=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+u*r,t[5]=a*i+h*r,t[6]=s*i+c*r,t[7]=l*i+d*r,t[8]=u*i-o*r,t[9]=h*i-a*r,t[10]=c*i-s*r,t[11]=d*i-l*r,t},a2.rotateY=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],u=e[8],h=e[9],c=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-u*r,t[1]=a*i-h*r,t[2]=s*i-c*r,t[3]=l*i-d*r,t[8]=o*r+u*i,t[9]=a*r+h*i,t[10]=s*r+c*i,t[11]=l*r+d*i,t},a2.rotateZ=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],l=e[3],u=e[4],h=e[5],c=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+u*r,t[1]=a*i+h*r,t[2]=s*i+c*r,t[3]=l*i+d*r,t[4]=u*i-o*r,t[5]=h*i-a*r,t[6]=c*i-s*r,t[7]=d*i-l*r,t},a2.fromRotationTranslation=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,l=i+i,u=o+o,h=r*s,c=r*l,d=r*u,p=i*l,f=i*u,g=o*u,m=a*s,v=a*l,y=a*u;return t[0]=1-(p+g),t[1]=c+y,t[2]=d-v,t[3]=0,t[4]=c-y,t[5]=1-(h+g),t[6]=f+m,t[7]=0,t[8]=d+v,t[9]=f-m,t[10]=1-(h+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},a2.fromQuat=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,l=i+i,u=n*a,h=r*a,c=r*s,d=i*a,p=i*s,f=i*l,g=o*a,m=o*s,v=o*l;return t[0]=1-c-f,t[1]=h+v,t[2]=d-m,t[3]=0,t[4]=h-v,t[5]=1-u-f,t[6]=p+g,t[7]=0,t[8]=d+m,t[9]=p-g,t[10]=1-u-c,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},a2.frustum=function(t,e,n,r,i,o,a){var s=1/(n-e),l=1/(i-r),u=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*l,t[10]=(a+o)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*u,t[15]=0,t},a2.perspective=function(t,e,n,r,i){var o=1/Math.tan(e/2),a=1/(r-i);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+r)*a,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*r*a,t[15]=0,t},a2.ortho=function(t,e,n,r,i,o,a){var s=1/(e-n),l=1/(r-i),u=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*l,t[14]=(a+o)*u,t[15]=1,t},a2.lookAt=function(t,e,n,r){var i,o,a,s,l,u,h,c,d,p,f=e[0],g=e[1],m=e[2],v=r[0],y=r[1],_=r[2],x=n[0],b=n[1],w=n[2];return Math.abs(f-x)<E1&&Math.abs(g-b)<E1&&Math.abs(m-w)<E1?a2.identity(t):(h=f-x,c=g-b,d=m-w,i=y*(d*=p=1/Math.sqrt(h*h+c*c+d*d))-_*(c*=p),o=_*(h*=p)-v*d,a=v*c-y*h,(p=Math.sqrt(i*i+o*o+a*a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=c*a-d*o,l=d*i-h*a,u=h*o-c*i,(p=Math.sqrt(s*s+l*l+u*u))?(s*=p=1/p,l*=p,u*=p):(s=0,l=0,u=0),t[0]=i,t[1]=s,t[2]=h,t[3]=0,t[4]=o,t[5]=l,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=d,t[11]=0,t[12]=-(i*f+o*g+a*m),t[13]=-(s*f+l*g+u*m),t[14]=-(h*f+c*g+d*m),t[15]=1,t)},a2.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+Math.pow(t[6],2)+Math.pow(t[7],2)+Math.pow(t[8],2)+Math.pow(t[9],2)+Math.pow(t[10],2)+Math.pow(t[11],2)+Math.pow(t[12],2)+Math.pow(t[13],2)+Math.pow(t[14],2)+Math.pow(t[15],2))};var s2=a2,l2=function(){this._axisX=new W1,this._axisY=new W1,this._axisZ=new W1,this.array=s2.create(),this._dirty=!0};l2.prototype={constructor:l2,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},adjoint:function(){return s2.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new l2).copy(this)},copy:function(t){return s2.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return s2.determinant(this.array)},fromQuat:function(t){return s2.fromQuat(this.array,t.array),this._dirty=!0,this},fromRotationTranslation:function(t,e){return s2.fromRotationTranslation(this.array,t.array,e.array),this._dirty=!0,this},fromMat2d:function(t){return l2.fromMat2d(this,t),this},frustum:function(t,e,n,r,i,o){return s2.frustum(this.array,t,e,n,r,i,o),this._dirty=!0,this},identity:function(){return s2.identity(this.array),this._dirty=!0,this},invert:function(){return s2.invert(this.array,this.array),this._dirty=!0,this},lookAt:function(t,e,n){return s2.lookAt(this.array,t.array,e.array,n.array),this._dirty=!0,this},mul:function(t){return s2.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return s2.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return s2.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return s2.multiply(this.array,t.array,this.array),this._dirty=!0,this},ortho:function(t,e,n,r,i,o){return s2.ortho(this.array,t,e,n,r,i,o),this._dirty=!0,this},perspective:function(t,e,n,r){return s2.perspective(this.array,t,e,n,r),this._dirty=!0,this},rotate:function(t,e){return s2.rotate(this.array,this.array,t,e.array),this._dirty=!0,this},rotateX:function(t){return s2.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return s2.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return s2.rotateZ(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return s2.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return s2.translate(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return s2.transpose(this.array,this.array),this._dirty=!0,this},decomposeMatrix:function(){var t=k1.create(),e=k1.create(),n=k1.create(),r=Q1.create();return function(i,o,a){var s=this.array;k1.set(t,s[0],s[1],s[2]),k1.set(e,s[4],s[5],s[6]),k1.set(n,s[8],s[9],s[10]);var l=k1.length(t),u=k1.length(e),h=k1.length(n);this.determinant()<0&&(l=-l),i&&i.set(l,u,h),a.set(s[12],s[13],s[14]),Q1.fromMat4(r,s),r[0]/=l,r[1]/=l,r[2]/=l,r[3]/=u,r[4]/=u,r[5]/=u,r[6]/=h,r[7]/=h,r[8]/=h,e2.fromMat3(o.array,r),e2.normalize(o.array,o.array),o._dirty=!0,a._dirty=!0}}(),toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var u2=Object.defineProperty;if(u2){var h2=l2.prototype;u2(h2,"z",{get:function(){var t=this.array;return this._axisZ.set(t[8],t[9],t[10]),this._axisZ},set:function(t){var e=this.array;t=t.array,e[8]=t[0],e[9]=t[1],e[10]=t[2],this._dirty=!0}}),u2(h2,"y",{get:function(){var t=this.array;return this._axisY.set(t[4],t[5],t[6]),this._axisY},set:function(t){var e=this.array;t=t.array,e[4]=t[0],e[5]=t[1],e[6]=t[2],this._dirty=!0}}),u2(h2,"x",{get:function(){var t=this.array;return this._axisX.set(t[0],t[1],t[2]),this._axisX},set:function(t){var e=this.array;t=t.array,e[0]=t[0],e[1]=t[1],e[2]=t[2],this._dirty=!0}})}l2.adjoint=function(t,e){return s2.adjoint(t.array,e.array),t._dirty=!0,t},l2.copy=function(t,e){return s2.copy(t.array,e.array),t._dirty=!0,t},l2.determinant=function(t){return s2.determinant(t.array)},l2.identity=function(t){return s2.identity(t.array),t._dirty=!0,t},l2.ortho=function(t,e,n,r,i,o,a){return s2.ortho(t.array,e,n,r,i,o,a),t._dirty=!0,t},l2.perspective=function(t,e,n,r,i){return s2.perspective(t.array,e,n,r,i),t._dirty=!0,t},l2.lookAt=function(t,e,n,r){return s2.lookAt(t.array,e.array,n.array,r.array),t._dirty=!0,t},l2.invert=function(t,e){return s2.invert(t.array,e.array),t._dirty=!0,t},l2.mul=function(t,e,n){return s2.mul(t.array,e.array,n.array),t._dirty=!0,t},l2.multiply=l2.mul,l2.fromQuat=function(t,e){return s2.fromQuat(t.array,e.array),t._dirty=!0,t},l2.fromRotationTranslation=function(t,e,n){return s2.fromRotationTranslation(t.array,e.array,n.array),t._dirty=!0,t},l2.fromMat2d=function(t,e){t._dirty=!0;e=e.array;return(t=t.array)[0]=e[0],t[4]=e[2],t[12]=e[4],t[1]=e[1],t[5]=e[3],t[13]=e[5],t},l2.rotate=function(t,e,n,r){return s2.rotate(t.array,e.array,n,r.array),t._dirty=!0,t},l2.rotateX=function(t,e,n){return s2.rotateX(t.array,e.array,n),t._dirty=!0,t},l2.rotateY=function(t,e,n){return s2.rotateY(t.array,e.array,n),t._dirty=!0,t},l2.rotateZ=function(t,e,n){return s2.rotateZ(t.array,e.array,n),t._dirty=!0,t},l2.scale=function(t,e,n){return s2.scale(t.array,e.array,n.array),t._dirty=!0,t},l2.transpose=function(t,e){return s2.transpose(t.array,e.array),t._dirty=!0,t},l2.translate=function(t,e,n){return s2.translate(t.array,e.array,n.array),t._dirty=!0,t};var c2,d2,p2,f2,g2,m2,v2=l2,y2=k1.set,_2=k1.copy,x2=function(t,e){this.min=t||new W1(1/0,1/0,1/0),this.max=e||new W1(-1/0,-1/0,-1/0),this.vertices=null};x2.prototype={constructor:x2,updateFromVertices:function(t){if(t.length>0){var e=this.min,n=this.max,r=e.array,i=n.array;_2(r,t[0]),_2(i,t[0]);for(var o=1;o<t.length;o++){var a=t[o];a[0]<r[0]&&(r[0]=a[0]),a[1]<r[1]&&(r[1]=a[1]),a[2]<r[2]&&(r[2]=a[2]),a[0]>i[0]&&(i[0]=a[0]),a[1]>i[1]&&(i[1]=a[1]),a[2]>i[2]&&(i[2]=a[2])}e._dirty=!0,n._dirty=!0}},union:function(t){var e=this.min,n=this.max;return k1.min(e.array,e.array,t.min.array),k1.max(n.array,n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},intersection:function(t){var e=this.min,n=this.max;return k1.max(e.array,e.array,t.min.array),k1.min(n.array,n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},intersectBoundingBox:function(t){var e=this.min.array,n=this.max.array,r=t.min.array,i=t.max.array;return!(e[0]>i[0]||e[1]>i[1]||e[2]>i[2]||n[0]<r[0]||n[1]<r[1]||n[2]<r[2])},containBoundingBox:function(t){var e=this.min.array,n=this.max.array,r=t.min.array,i=t.max.array;return e[0]<=r[0]&&e[1]<=r[1]&&e[2]<=r[2]&&n[0]>=i[0]&&n[1]>=i[1]&&n[2]>=i[2]},containPoint:function(t){var e=this.min.array,n=this.max.array,r=t.array;return e[0]<=r[0]&&e[1]<=r[1]&&e[2]<=r[2]&&n[0]>=r[0]&&n[1]>=r[1]&&n[2]>=r[2]},isFinite:function(){var t=this.min.array,e=this.max.array;return isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])},applyTransform:function(t){this.transformFrom(this,t)},transformFrom:(c2=k1.create(),d2=k1.create(),p2=k1.create(),f2=k1.create(),g2=k1.create(),m2=k1.create(),function(t,e){var n=t.min.array,r=t.max.array,i=e.array;return c2[0]=i[0]*n[0],c2[1]=i[1]*n[0],c2[2]=i[2]*n[0],d2[0]=i[0]*r[0],d2[1]=i[1]*r[0],d2[2]=i[2]*r[0],p2[0]=i[4]*n[1],p2[1]=i[5]*n[1],p2[2]=i[6]*n[1],f2[0]=i[4]*r[1],f2[1]=i[5]*r[1],f2[2]=i[6]*r[1],g2[0]=i[8]*n[2],g2[1]=i[9]*n[2],g2[2]=i[10]*n[2],m2[0]=i[8]*r[2],m2[1]=i[9]*r[2],m2[2]=i[10]*r[2],n=this.min.array,r=this.max.array,n[0]=Math.min(c2[0],d2[0])+Math.min(p2[0],f2[0])+Math.min(g2[0],m2[0])+i[12],n[1]=Math.min(c2[1],d2[1])+Math.min(p2[1],f2[1])+Math.min(g2[1],m2[1])+i[13],n[2]=Math.min(c2[2],d2[2])+Math.min(p2[2],f2[2])+Math.min(g2[2],m2[2])+i[14],r[0]=Math.max(c2[0],d2[0])+Math.max(p2[0],f2[0])+Math.max(g2[0],m2[0])+i[12],r[1]=Math.max(c2[1],d2[1])+Math.max(p2[1],f2[1])+Math.max(g2[1],m2[1])+i[13],r[2]=Math.max(c2[2],d2[2])+Math.max(p2[2],f2[2])+Math.max(g2[2],m2[2])+i[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(t){var e=this.min.array,n=this.max.array,r=t.array,i=e[0],o=e[1],a=e[2],s=n[0],l=n[1],u=e[2],h=n[0],c=n[1],d=n[2];if(1===r[15])e[0]=r[0]*i+r[12],e[1]=r[5]*o+r[13],n[2]=r[10]*a+r[14],n[0]=r[0]*h+r[12],n[1]=r[5]*c+r[13],e[2]=r[10]*d+r[14];else{var p=-1/a;e[0]=r[0]*i*p,e[1]=r[5]*o*p,n[2]=(r[10]*a+r[14])*p,p=-1/u,n[0]=r[0]*s*p,n[1]=r[5]*l*p,p=-1/d,e[2]=(r[10]*d+r[14])*p}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){var t=this.vertices;if(!t){t=[];for(var e=0;e<8;e++)t[e]=k1.fromValues(0,0,0);this.vertices=t}var n=this.min.array,r=this.max.array;return y2(t[0],n[0],n[1],n[2]),y2(t[1],n[0],r[1],n[2]),y2(t[2],r[0],n[1],n[2]),y2(t[3],r[0],r[1],n[2]),y2(t[4],n[0],n[1],r[2]),y2(t[5],n[0],r[1],r[2]),y2(t[6],r[0],n[1],r[2]),y2(t[7],r[0],r[1],r[2]),this},copy:function(t){var e=this.min,n=this.max;return _2(e.array,t.min.array),_2(n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},clone:function(){var t=new x2;return t.copy(this),t}};var b2,w2,S2,T2,M2=x2,C2=0,I2=P1.extend({name:"",position:null,rotation:null,scale:null,worldTransform:null,localTransform:null,autoUpdateLocalTransform:!0,_parent:null,_scene:null,_needsUpdateWorldTransform:!0,_inIterating:!1,__depth:0},function(){this.name||(this.name=(this.type||"NODE")+"_"+C2++),this.position||(this.position=new W1),this.rotation||(this.rotation=new o2),this.scale||(this.scale=new W1(1,1,1)),this.worldTransform=new v2,this.localTransform=new v2,this._children=[]},{target:null,invisible:!1,isSkinnedMesh:function(){return!1},isRenderable:function(){return!1},setName:function(t){var e=this._scene;if(e){var n=e._nodeRepository;delete n[this.name],n[t]=this}this.name=t},add:function(t){var e=t._parent;if(e!==this){e&&e.remove(t),t._parent=this,this._children.push(t);var n=this._scene;n&&n!==t.scene&&t.traverse(this._addSelfToScene,this),t._needsUpdateWorldTransform=!0}},remove:function(t){var e=this._children,n=e.indexOf(t);n<0||(e.splice(n,1),t._parent=null,this._scene&&t.traverse(this._removeSelfFromScene,this))},removeAll:function(){for(var t=this._children,e=0;e<t.length;e++)t[e]._parent=null,this._scene&&t[e].traverse(this._removeSelfFromScene,this);this._children=[]},getScene:function(){return this._scene},getParent:function(){return this._parent},_removeSelfFromScene:function(t){t._scene.removeFromScene(t),t._scene=null},_addSelfToScene:function(t){this._scene.addToScene(t),t._scene=this._scene},isAncestor:function(t){for(var e=t._parent;e;){if(e===this)return!0;e=e._parent}return!1},children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},getChildByName:function(t){for(var e=this._children,n=0;n<e.length;n++)if(e[n].name===t)return e[n]},getDescendantByName:function(t){for(var e=this._children,n=0;n<e.length;n++){var r=e[n];if(r.name===t)return r;var i=r.getDescendantByName(t);if(i)return i}},queryNode:function(t){if(t){for(var e=t.split("/"),n=this,r=0;r<e.length;r++){var i=e[r];if(i){for(var o=!1,a=n._children,s=0;s<a.length;s++){var l=a[s];if(l.name===i){n=l,o=!0;break}}if(!o)return}}return n}},getPath:function(t){if(!this._parent)return"/";for(var e=this._parent,n=this.name;e._parent&&(n=e.name+"/"+n,e._parent!=t);)e=e._parent;return!e._parent&&t?null:n},traverse:function(t,e){t.call(e,this);for(var n=this._children,r=0,i=n.length;r<i;r++)n[r].traverse(t,e)},eachChild:function(t,e){for(var n=this._children,r=0,i=n.length;r<i;r++){var o=n[r];t.call(e,o,r)}},setLocalTransform:function(t){s2.copy(this.localTransform.array,t.array),this.decomposeLocalTransform()},decomposeLocalTransform:function(t){var e=t?null:this.scale;this.localTransform.decomposeMatrix(e,this.rotation,this.position)},setWorldTransform:function(t){s2.copy(this.worldTransform.array,t.array),this.decomposeWorldTransform()},decomposeWorldTransform:(S2=s2.create(),function(t){var e=this.localTransform,n=this.worldTransform;this._parent?(s2.invert(S2,this._parent.worldTransform.array),s2.multiply(e.array,S2,n.array)):s2.copy(e.array,n.array);var r=t?null:this.scale;e.decomposeMatrix(r,this.rotation,this.position)}),transformNeedsUpdate:function(){return this.position._dirty||this.rotation._dirty||this.scale._dirty},updateLocalTransform:function(){var t=this.position,e=this.rotation,n=this.scale;if(this.transformNeedsUpdate()){var r=this.localTransform.array;s2.fromRotationTranslation(r,e.array,t.array),s2.scale(r,r,n.array),e._dirty=!1,n._dirty=!1,t._dirty=!1,this._needsUpdateWorldTransform=!0}},_updateWorldTransformTopDown:function(){var t=this.localTransform.array,e=this.worldTransform.array;this._parent?s2.multiplyAffine(e,this._parent.worldTransform.array,t):s2.copy(e,t)},updateWorldTransform:function(){for(var t=this;t&&t.getParent()&&t.getParent().transformNeedsUpdate();)t=t.getParent();t.update()},update:function(t){this.autoUpdateLocalTransform?this.updateLocalTransform():t=!0,(t||this._needsUpdateWorldTransform)&&(this._updateWorldTransformTopDown(),t=!0,this._needsUpdateWorldTransform=!1);for(var e=this._children,n=0,r=e.length;n<r;n++)e[n].update(t)},getBoundingBox:function(){function t(t){return!t.invisible&&t.geometry}var e=new M2,n=new v2,r=new v2;return function(i,o){return o=o||new M2,this._parent?v2.invert(r,this._parent.worldTransform):v2.identity(r),this.traverse(function(t){t.geometry&&t.geometry.boundingBox&&(e.copy(t.geometry.boundingBox),v2.multiply(n,r,t.worldTransform),e.applyTransform(n),o.union(e))},this,t),o}}(),getWorldPosition:function(t){this.transformNeedsUpdate()&&this.updateWorldTransform();var e=this.worldTransform.array;if(t){var n=t.array;return n[0]=e[12],n[1]=e[13],n[2]=e[14],t}return new W1(e[12],e[13],e[14])},clone:function(){var t=new this.constructor,e=this._children;t.setName(this.name),t.position.copy(this.position),t.rotation.copy(this.rotation),t.scale.copy(this.scale);for(var n=0;n<e.length;n++)t.add(e[n].clone());return t},rotateAround:(b2=new W1,w2=new v2,function(t,e,n){b2.copy(this.position).subtract(t);var r=this.localTransform;r.identity(),r.translate(t),r.rotate(n,e),w2.fromRotationTranslation(this.rotation,b2),r.multiply(w2),r.scale(this.scale),this.decomposeLocalTransform(),this._needsUpdateWorldTransform=!0}),lookAt:function(){var t=new v2;return function(e,n){t.lookAt(this.position,e,n||this.localTransform.y).invert(),this.setLocalTransform(t),this.target=e}}()}),A2=I2,D2=256,L2=1024,P2=16384,E2=0,O2=1,N2=2,R2=3,k2=4,z2=5,B2=6,V2=35040,F2=35044,G2=35048,H2=1028,U2=1029,W2=1032,X2=2304,j2=2305,Z2=5120,Y2=5121,q2=5122,K2=5123,J2=5124,Q2=5125,$2=5126,t3=6402,e3=6406,n3=6407,r3=6408,i3=6409,o3=6410,a3=9728,s3=9729,l3=9984,u3=9985,h3=9986,c3=9987,d3=3553,p3=34067,f3=10497,g3=33071,m3=33648,v3=36160,y3=36161,_3=34041,x3=36064,b3=36096,w3=36128,S3=33306,T3=A2.extend({material:null,geometry:null,mode:k2,_renderInfo:null},{__program:null,lightGroup:0,renderOrder:0,culling:!0,cullFace:U2,frontFace:j2,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(t){},afterRender:function(t,e){},getBoundingBox:function(t,e){return e=A2.prototype.getBoundingBox.call(this,t,e),this.geometry&&this.geometry.boundingBox&&e.union(this.geometry.boundingBox),e},clone:(T2=["castShadow","receiveShadow","mode","culling","cullFace","frontFace","frustumCulling","renderOrder","lineWidth","ignorePicking","ignorePreZ","ignoreGBuffer"],function(){var t=A2.prototype.clone.call(this);t.geometry=this.geometry,t.material=this.material;for(var e=0;e<T2.length;e++){var n=T2[e];t[n]!==this[n]&&(t[n]=this[n])}return t})});T3.POINTS=E2,T3.LINES=O2,T3.LINE_LOOP=N2,T3.LINE_STRIP=R2,T3.TRIANGLES=k2,T3.TRIANGLE_STRIP=z2,T3.TRIANGLE_FAN=B2,T3.BACK=U2,T3.FRONT=H2,T3.FRONT_AND_BACK=W2,T3.CW=X2,T3.CCW=j2;var M3=T3,C3=M3.extend({skeleton:null,joints:null},function(){this.joints||(this.joints=[])},{offsetMatrix:null,isInstancedMesh:function(){return!1},isSkinnedMesh:function(){return!!(this.skeleton&&this.joints&&this.joints.length>0)},clone:function(){var t=M3.prototype.clone.call(this);return t.skeleton=this.skeleton,this.joints&&(t.joints=this.joints.slice()),t}});C3.POINTS=E2,C3.LINES=O2,C3.LINE_LOOP=N2,C3.LINE_STRIP=R2,C3.TRIANGLES=k2,C3.TRIANGLE_STRIP=z2,C3.TRIANGLE_FAN=B2,C3.BACK=U2,C3.FRONT=H2,C3.FRONT_AND_BACK=W2,C3.CW=X2,C3.CCW=j2;var I3=C3,A3=["OES_texture_float","OES_texture_half_float","OES_texture_float_linear","OES_texture_half_float_linear","OES_standard_derivatives","OES_vertex_array_object","OES_element_index_uint","WEBGL_compressed_texture_s3tc","WEBGL_depth_texture","EXT_texture_filter_anisotropic","EXT_shader_texture_lod","WEBGL_draw_buffers","EXT_frag_depth","EXT_sRGB","ANGLE_instanced_arrays"],D3=["MAX_TEXTURE_SIZE","MAX_CUBE_MAP_TEXTURE_SIZE"];function L3(t){for(var e={},n={},r=0;r<A3.length;r++){o(A3[r])}for(r=0;r<D3.length;r++){var i=D3[r];n[i]=t.getParameter(t[i])}function o(n){if(t.getExtension){var r=t.getExtension(n);r||(r=t.getExtension("MOZ_"+n)),r||(r=t.getExtension("WEBKIT_"+n)),e[n]=r}}this.getExtension=function(t){return t in e||o(t),e[t]},this.getParameter=function(t){return n[t]}}var P3,E3={get:function(t){var e=new XMLHttpRequest;e.open("get",t.url),e.responseType=t.responseType||"text",t.onprogress&&(e.onprogress=function(e){if(e.lengthComputable){var n=e.loaded/e.total;t.onprogress(n,e.loaded,e.total)}else t.onprogress(null)}),e.onload=function(n){e.status>=400?t.onerror&&t.onerror():t.onload&&t.onload(e.response)},t.onerror&&(e.onerror=t.onerror),e.send(null)}},O3={supportWebGL:function(){if(null==P3)try{var t=document.createElement("canvas");if(!(t.getContext("webgl")||t.getContext("experimental-webgl")))throw new Error}catch(t){P3=!1}return P3}};O3.Int8Array="undefined"==typeof Int8Array?Array:Int8Array,O3.Uint8Array="undefined"==typeof Uint8Array?Array:Uint8Array,O3.Uint16Array="undefined"==typeof Uint16Array?Array:Uint16Array,O3.Uint32Array="undefined"==typeof Uint32Array?Array:Uint32Array,O3.Int16Array="undefined"==typeof Int16Array?Array:Int16Array,O3.Float32Array="undefined"==typeof Float32Array?Array:Float32Array,O3.Float64Array="undefined"==typeof Float64Array?Array:Float64Array;var N3={};"undefined"!=typeof window?N3=window:"undefined"!=typeof global&&(N3=global),O3.requestAnimationFrame=N3.requestAnimationFrame||N3.msRequestAnimationFrame||N3.mozRequestAnimationFrame||N3.webkitRequestAnimationFrame||function(t){setTimeout(t,16)},O3.createCanvas=function(){return document.createElement("canvas")},O3.createImage=function(){return new N3.Image},O3.request={get:E3.get},O3.addEventListener=function(t,e,n,r){t.addEventListener(e,n,r)},O3.removeEventListener=function(t,e,n){t.removeEventListener(e,n)};var R3=O3,k3=function(){this.head=null,this.tail=null,this._length=0};k3.prototype.insert=function(t){var e=new k3.Entry(t);return this.insertEntry(e),e},k3.prototype.insertAt=function(t,e){if(!(t<0)){for(var n=this.head,r=0;n&&r!=t;)n=n.next,r++;if(n){var i=new k3.Entry(e),o=n.prev;o?(o.next=i,i.prev=o):this.head=i,i.next=n,n.prev=i}else this.insert(e)}},k3.prototype.insertBeforeEntry=function(t,e){var n=new k3.Entry(t),r=e.prev;r?(r.next=n,n.prev=r):this.head=n,n.next=e,e.prev=n,this._length++},k3.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,this.tail=t):this.head=this.tail=t,this._length++},k3.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._length--},k3.prototype.removeAt=function(t){if(!(t<0)){for(var e=this.head,n=0;e&&n!=t;)e=e.next,n++;return e?(this.remove(e),e.value):void 0}},k3.prototype.getHead=function(){if(this.head)return this.head.value},k3.prototype.getTail=function(){if(this.tail)return this.tail.value},k3.prototype.getAt=function(t){if(!(t<0)){for(var e=this.head,n=0;e&&n!=t;)e=e.next,n++;return e.value}},k3.prototype.indexOf=function(t){for(var e=this.head,n=0;e;){if(e.value===t)return n;e=e.next,n++}},k3.prototype.length=function(){return this._length},k3.prototype.isEmpty=function(){return 0===this._length},k3.prototype.forEach=function(t,e){for(var n=this.head,r=0,i=void 0!==e;n;)i?t.call(e,n.value,r):t(n.value,r),n=n.next,r++},k3.prototype.clear=function(){this.tail=this.head=null,this._length=0},k3.Entry=function(t){this.value=t,this.next=null,this.prev=null};var z3=k3,B3=function(t){this._list=new z3,this._map={},this._maxSize=t||10};B3.prototype.setMaxSize=function(t){this._maxSize=t},B3.prototype.put=function(t,e){if(!this._map.hasOwnProperty(t)){var n=this._list.length();if(n>=this._maxSize&&n>0){var r=this._list.head;this._list.remove(r),delete this._map[r.key]}var i=this._list.insert(e);i.key=t,this._map[t]=i}},B3.prototype.get=function(t){var e=this._map[t];if(this._map.hasOwnProperty(t))return e!==this._list.tail&&(this._list.remove(e),this._list.insertEntry(e)),e.value},B3.prototype.remove=function(t){var e=this._map[t];void 0!==e&&(delete this._map[t],this._list.remove(e))},B3.prototype.clear=function(){this._list.clear(),this._map={}};var V3=B3,F3={},G3={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 H3(t){return(t=Math.round(t))<0?0:t>255?255:t}function U3(t){return t<0?0:t>1?1:t}function W3(t){return t.length&&"%"===t.charAt(t.length-1)?H3(parseFloat(t)/100*255):H3(parseInt(t,10))}function X3(t){return t.length&&"%"===t.charAt(t.length-1)?U3(parseFloat(t)/100):U3(parseFloat(t))}function j3(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function Z3(t,e,n){return t+(e-t)*n}function Y3(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function q3(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var K3=new V3(20),J3=null;function Q3(t,e){J3&&q3(J3,e),J3=K3.put(t,J3||e.slice())}function $3(t,e){var n=(parseFloat(t[0])%360+360)%360/360,r=X3(t[1]),i=X3(t[2]),o=i<=.5?i*(r+1):i+r-i*r,a=2*i-o;return Y3(e=e||[],H3(255*j3(a,o,n+1/3)),H3(255*j3(a,o,n)),H3(255*j3(a,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}F3.parse=function(t,e){if(t){e=e||[];var n=K3.get(t);if(n)return q3(e,n);var r,i=(t+="").replace(/ /g,"").toLowerCase();if(i in G3)return q3(e,G3[i]),Q3(t,e),e;if("#"===i.charAt(0))return 4===i.length?(r=parseInt(i.substr(1),16))>=0&&r<=4095?(Y3(e,(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1),Q3(t,e),e):void Y3(e,0,0,0,1):7===i.length?(r=parseInt(i.substr(1),16))>=0&&r<=16777215?(Y3(e,(16711680&r)>>16,(65280&r)>>8,255&r,1),Q3(t,e),e):void Y3(e,0,0,0,1):void 0;var o=i.indexOf("("),a=i.indexOf(")");if(-1!==o&&a+1===i.length){var s=i.substr(0,o),l=i.substr(o+1,a-(o+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Y3(e,0,0,0,1);u=X3(l.pop());case"rgb":return 3!==l.length?void Y3(e,0,0,0,1):(Y3(e,W3(l[0]),W3(l[1]),W3(l[2]),u),Q3(t,e),e);case"hsla":return 4!==l.length?void Y3(e,0,0,0,1):(l[3]=X3(l[3]),$3(l,e),Q3(t,e),e);case"hsl":return 3!==l.length?void Y3(e,0,0,0,1):($3(l,e),Q3(t,e),e);default:return}}Y3(e,0,0,0,1)}},F3.parseToFloat=function(t,e){if(e=F3.parse(t,e))return e[0]/=255,e[1]/=255,e[2]/=255,e},F3.lift=function(t,e){var n=F3.parse(t);if(n){for(var r=0;r<3;r++)n[r]=e<0?n[r]*(1-e)|0:(255-n[r])*e+n[r]|0;return F3.stringify(n,4===n.length?"rgba":"rgb")}},F3.toHex=function(t){var e=F3.parse(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},F3.fastLerp=function(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var r=t*(e.length-1),i=Math.floor(r),o=Math.ceil(r),a=e[i],s=e[o],l=r-i;return n[0]=H3(Z3(a[0],s[0],l)),n[1]=H3(Z3(a[1],s[1],l)),n[2]=H3(Z3(a[2],s[2],l)),n[3]=U3(Z3(a[3],s[3],l)),n}},F3.fastMapToColor=F3.fastLerp,F3.lerp=function(t,e,n){if(e&&e.length&&t>=0&&t<=1){var r=t*(e.length-1),i=Math.floor(r),o=Math.ceil(r),a=F3.parse(e[i]),s=F3.parse(e[o]),l=r-i,u=F3.stringify([H3(Z3(a[0],s[0],l)),H3(Z3(a[1],s[1],l)),H3(Z3(a[2],s[2],l)),U3(Z3(a[3],s[3],l))],"rgba");return n?{color:u,leftIndex:i,rightIndex:o,value:r}:u}},F3.mapToColor=F3.lerp,F3.modifyHSL=function(t,e,n,r){if(t=F3.parse(t))return t=function(t){if(t){var e,n,r=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(r,i,o),s=Math.max(r,i,o),l=s-a,u=(s+a)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+a):l/(2-s-a);var h=((s-r)/6+l/2)/l,c=((s-i)/6+l/2)/l,d=((s-o)/6+l/2)/l;r===s?e=d-c:i===s?e=1/3+h-d:o===s&&(e=2/3+c-h),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,n,u];return null!=t[3]&&p.push(t[3]),p}}(t),null!=e&&(t[0]=function(t){return(t=Math.round(t))<0?0:t>360?360:t}(e)),null!=n&&(t[1]=X3(n)),null!=r&&(t[2]=X3(r)),F3.stringify($3(t),"rgba")},F3.modifyAlpha=function(t,e){if((t=F3.parse(t))&&null!=e)return t[3]=U3(e),F3.stringify(t,"rgba")},F3.stringify=function(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}};var t5=F3.parseToFloat,e5={};function n5(t){var e=Object.keys(t);e.sort();for(var n=[],r=0;r<e.length;r++){var i=e[r],o=t[i];null===o?n.push(i):n.push(i+" "+o.toString())}return n.join("\n")}var r5=P1.extend(function(){return{name:"",depthTest:!0,depthMask:!0,transparent:!1,blend:null,autoUpdateTextureStatus:!0,uniforms:{},vertexDefines:{},fragmentDefines:{},_textureStatus:{},_enabledUniforms:null}},function(){this.name||(this.name="MATERIAL_"+this.__uid__),this.shader&&this.attachShader(this.shader,!0)},{precision:"highp",setUniform:function(t,e){void 0===e&&console.warn('Uniform value "'+t+'" is undefined');var n=this.uniforms[t];n&&("string"==typeof e&&(e=t5(e)||e),n.value=e,this.autoUpdateTextureStatus&&"t"===n.type&&(e?this.enableTexture(t):this.disableTexture(t)))},setUniforms:function(t){for(var e in t){var n=t[e];this.setUniform(e,n)}},isUniformEnabled:function(t){return this._enabledUniforms.indexOf(t)>=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(t,e){if("object"==typeof t)for(var n in t){var r=t[n];this.setUniform(n,r)}else this.setUniform(t,e)},get:function(t){var e=this.uniforms[t];if(e)return e.value},attachShader:function(t,e){var n=this.uniforms;this.uniforms=t.createUniforms(),this.shader=t;var r=this.uniforms;this._enabledUniforms=Object.keys(r),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter(function(t){var e=this.uniforms[t].type;return"t"===e||"tv"===e},this);var i=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=A1.clone(t.vertexDefines),this.fragmentDefines=A1.clone(t.fragmentDefines),e){for(var a in n)r[a]&&(r[a].value=n[a].value);A1.defaults(this.vertexDefines,i),A1.defaults(this.fragmentDefines,o)}var s={};for(var l in t.textures)s[l]={shaderType:t.textures[l].shaderType,type:t.textures[l].type,enabled:!(!e||!this._textureStatus[l])&&this._textureStatus[l].enabled};this._textureStatus=s,this._programKey=""},clone:function(){var t=new this.constructor({name:this.name,shader:this.shader});for(var e in this.uniforms)t.uniforms[e].value=this.uniforms[e].value;return t.depthTest=this.depthTest,t.depthMask=this.depthMask,t.transparent=this.transparent,t.blend=this.blend,t.vertexDefines=A1.clone(this.vertexDefines),t.fragmentDefines=A1.clone(this.fragmentDefines),t.enableTexture(this.getEnabledTextures()),t.precision=this.precision,t},define:function(t,e,n){var r=this.vertexDefines,i=this.fragmentDefines;"vertex"!==t&&"fragment"!==t&&"both"!==t&&arguments.length<3&&(n=e,e=t,t="both"),n=null!=n?n:null,"vertex"!==t&&"both"!==t||r[e]!==n&&(r[e]=n,this._programKey=""),"fragment"!==t&&"both"!==t||i[e]!==n&&(i[e]=n,"both"!==t&&(this._programKey=""))},undefine:function(t,e){"vertex"!==t&&"fragment"!==t&&"both"!==t&&arguments.length<2&&(e=t,t="both"),"vertex"!==t&&"both"!==t||this.isDefined("vertex",e)&&(delete this.vertexDefines[e],this._programKey=""),"fragment"!==t&&"both"!==t||this.isDefined("fragment",e)&&(delete this.fragmentDefines[e],"both"!==t&&(this._programKey=""))},isDefined:function(t,e){switch(t){case"vertex":return void 0!==this.vertexDefines[e];case"fragment":return void 0!==this.fragmentDefines[e]}},getDefine:function(t,e){switch(t){case"vertex":return this.vertexDefines[e];case"fragment":return this.fragmentDefines[e]}},enableTexture:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.enableTexture(t[e]);else{var n=this._textureStatus[t];if(n)n.enabled||(n.enabled=!0,this._programKey="")}},enableTexturesAll:function(){var t=this._textureStatus;for(var e in t)t[e].enabled=!0;this._programKey=""},disableTexture:function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this.disableTexture(t[e]);else{var n=this._textureStatus[t];if(n)!n.enabled||(n.enabled=!1,this._programKey="")}},disableTexturesAll:function(){var t=this._textureStatus;for(var e in t)t[e].enabled=!1;this._programKey=""},isTextureEnabled:function(t){var e=this._textureStatus;return!!e[t]&&e[t].enabled},getEnabledTextures:function(){var t=[],e=this._textureStatus;for(var n in e)e[n].enabled&&t.push(n);return t},dirtyDefines:function(){this._programKey=""},getProgramKey:function(){return this._programKey||(this._programKey=function(t,e,n){n.sort();for(var r=[],i=0;i<n.length;i++){var o=n[i];r.push(o)}var a=n5(t)+"\n"+n5(e)+"\n"+r.join("\n");if(e5[a])return e5[a];var s=A1.genGUID();return e5[a]=s,s}(this.vertexDefines,this.fragmentDefines,this.getEnabledTextures())),this._programKey}}),i5=r5,o5={create:function(){var t=new O1(2);return t[0]=0,t[1]=0,t},clone:function(t){var e=new O1(2);return e[0]=t[0],e[1]=t[1],e},fromValues:function(t,e){var n=new O1(2);return n[0]=t,n[1]=e,n},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},set:function(t,e,n){return t[0]=e,t[1]=n,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},subtract:function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}};o5.sub=o5.subtract,o5.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},o5.mul=o5.multiply,o5.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},o5.div=o5.divide,o5.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},o5.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t},o5.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},o5.scaleAndAdd=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},o5.distance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)},o5.dist=o5.distance,o5.squaredDistance=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r},o5.sqrDist=o5.squaredDistance,o5.length=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},o5.len=o5.length,o5.squaredLength=function(t){var e=t[0],n=t[1];return e*e+n*n},o5.sqrLen=o5.squaredLength,o5.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},o5.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},o5.normalize=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},o5.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},o5.cross=function(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t},o5.lerp=function(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t},o5.random=function(t,e){e=e||1;var n=2*GLMAT_RANDOM()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},o5.transformMat2=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t},o5.transformMat2d=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t},o5.transformMat3=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t},o5.transformMat4=function(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t},o5.forEach=function(){var t=o5.create();return function(e,n,r,i,o,a){var s,l;for(n||(n=2),r||(r=0),l=i?Math.min(i*n+r,e.length):e.length,s=r;s<l;s+=n)t[0]=e[s],t[1]=e[s+1],o(t,t,a),e[s]=t[0],e[s+1]=t[1];return e}}();var a5=o5,s5=function(t,e){t=t||0,e=e||0,this.array=a5.fromValues(t,e),this._dirty=!0};if(s5.prototype={constructor:s5,add:function(t){return a5.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e){return this.array[0]=t,this.array[1]=e,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this._dirty=!0,this},clone:function(){return new s5(this.x,this.y)},copy:function(t){return a5.copy(this.array,t.array),this._dirty=!0,this},cross:function(t,e){return a5.cross(t.array,this.array,e.array),t._dirty=!0,this},dist:function(t){return a5.dist(this.array,t.array)},distance:function(t){return a5.distance(this.array,t.array)},div:function(t){return a5.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return a5.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return a5.dot(this.array,t.array)},len:function(){return a5.len(this.array)},length:function(){return a5.length(this.array)},lerp:function(t,e,n){return a5.lerp(this.array,t.array,e.array,n),this._dirty=!0,this},min:function(t){return a5.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return a5.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return a5.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return a5.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return a5.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return a5.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return a5.random(this.array,t),this._dirty=!0,this},scale:function(t){return a5.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return a5.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return a5.sqrDist(this.array,t.array)},squaredDistance:function(t){return a5.squaredDistance(this.array,t.array)},sqrLen:function(){return a5.sqrLen(this.array)},squaredLength:function(){return a5.squaredLength(this.array)},sub:function(t){return a5.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return a5.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat2:function(t){return a5.transformMat2(this.array,this.array,t.array),this._dirty=!0,this},transformMat2d:function(t){return a5.transformMat2d(this.array,this.array,t.array),this._dirty=!0,this},transformMat3:function(t){return a5.transformMat3(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return a5.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Object.defineProperty){var l5=s5.prototype;Object.defineProperty(l5,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),Object.defineProperty(l5,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}})}s5.add=function(t,e,n){return a5.add(t.array,e.array,n.array),t._dirty=!0,t},s5.set=function(t,e,n){return a5.set(t.array,e,n),t._dirty=!0,t},s5.copy=function(t,e){return a5.copy(t.array,e.array),t._dirty=!0,t},s5.cross=function(t,e,n){return a5.cross(t.array,e.array,n.array),t._dirty=!0,t},s5.distance=s5.dist=function(t,e){return a5.distance(t.array,e.array)},s5.div=function(t,e,n){return a5.divide(t.array,e.array,n.array),t._dirty=!0,t},s5.divide=s5.div,s5.dot=function(t,e){return a5.dot(t.array,e.array)},s5.len=function(t){return a5.length(t.array)},s5.lerp=function(t,e,n,r){return a5.lerp(t.array,e.array,n.array,r),t._dirty=!0,t},s5.min=function(t,e,n){return a5.min(t.array,e.array,n.array),t._dirty=!0,t},s5.max=function(t,e,n){return a5.max(t.array,e.array,n.array),t._dirty=!0,t},s5.mul=function(t,e,n){return a5.multiply(t.array,e.array,n.array),t._dirty=!0,t},s5.multiply=s5.mul,s5.negate=function(t,e){return a5.negate(t.array,e.array),t._dirty=!0,t},s5.normalize=function(t,e){return a5.normalize(t.array,e.array),t._dirty=!0,t},s5.random=function(t,e){return a5.random(t.array,e),t._dirty=!0,t},s5.scale=function(t,e,n){return a5.scale(t.array,e.array,n),t._dirty=!0,t},s5.scaleAndAdd=function(t,e,n,r){return a5.scaleAndAdd(t.array,e.array,n.array,r),t._dirty=!0,t},s5.squaredDistance=s5.sqrDist=function(t,e){return a5.sqrDist(t.array,e.array)},s5.squaredLength=s5.sqrLen=function(t){return a5.sqrLen(t.array)},s5.sub=function(t,e,n){return a5.subtract(t.array,e.array,n.array),t._dirty=!0,t},s5.subtract=s5.sub,s5.transformMat2=function(t,e,n){return a5.transformMat2(t.array,e.array,n.array),t._dirty=!0,t},s5.transformMat2d=function(t,e,n){return a5.transformMat2d(t.array,e.array,n.array),t._dirty=!0,t},s5.transformMat3=function(t,e,n){return a5.transformMat3(t.array,e.array,n.array),t._dirty=!0,t},s5.transformMat4=function(t,e,n){return a5.transformMat4(t.array,e.array,n.array),t._dirty=!0,t};var u5=s5,h5={};function c5(t){for(var e=t.split("\n"),n=0,r=e.length;n<r;n++)e[n]=n+1+": "+e[n];return e.join("\n")}function d5(t,e,n){if(!t.getShaderParameter(e,t.COMPILE_STATUS))return[t.getShaderInfoLog(e),c5(n)].join("\n")}var p5=new R3.Float32Array(16),f5=P1.extend({uniformSemantics:{},attributes:{}},function(){this._locations={},this._textureSlot=0,this._program=null},{bind:function(t){this._textureSlot=0,t.gl.useProgram(this._program)},hasUniform:function(t){var e=this._locations[t];return null!=e},useTextureSlot:function(t,e,n){e&&(t.gl.activeTexture(t.gl.TEXTURE0+n),e.isRenderable()?e.bind(t):e.unbind(t))},currentTextureSlot:function(){return this._textureSlot},resetTextureSlot:function(t){this._textureSlot=t||0},takeCurrentTextureSlot:function(t,e){var n=this._textureSlot;return this.useTextureSlot(t,e,n),this._textureSlot++,n},setUniform:function(t,e,n,r){var i=this._locations[n];if(null==i)return!1;switch(e){case"m4":if(!(r instanceof Float32Array)){for(var o=0;o<r.length;o++)p5[o]=r[o];r=p5}t.uniformMatrix4fv(i,!1,r);break;case"2i":t.uniform2i(i,r[0],r[1]);break;case"2f":t.uniform2f(i,r[0],r[1]);break;case"3i":t.uniform3i(i,r[0],r[1],r[2]);break;case"3f":t.uniform3f(i,r[0],r[1],r[2]);break;case"4i":t.uniform4i(i,r[0],r[1],r[2],r[3]);break;case"4f":t.uniform4f(i,r[0],r[1],r[2],r[3]);break;case"1i":t.uniform1i(i,r);break;case"1f":t.uniform1f(i,r);break;case"1fv":t.uniform1fv(i,r);break;case"1iv":t.uniform1iv(i,r);break;case"2iv":t.uniform2iv(i,r);break;case"2fv":t.uniform2fv(i,r);break;case"3iv":t.uniform3iv(i,r);break;case"3fv":t.uniform3fv(i,r);break;case"4iv":t.uniform4iv(i,r);break;case"4fv":t.uniform4fv(i,r);break;case"m2":case"m2v":t.uniformMatrix2fv(i,!1,r);break;case"m3":case"m3v":t.uniformMatrix3fv(i,!1,r);break;case"m4v":if(Array.isArray(r)&&Array.isArray(r[0])){var a=new R3.Float32Array(16*r.length),s=0;for(o=0;o<r.length;o++)for(var l=r[o],u=0;u<16;u++)a[s++]=l[u];t.uniformMatrix4fv(i,!1,a)}else t.uniformMatrix4fv(i,!1,r)}return!0},setUniformOfSemantic:function(t,e,n){var r=this.uniformSemantics[e];return!!r&&this.setUniform(t,r.type,r.symbol,n)},enableAttributes:function(t,e,n){var r,i=t.gl,o=this._program,a=this._locations;(r=n?n.__enabledAttributeList:h5[t.__uid__])||(r=n?n.__enabledAttributeList=[]:h5[t.__uid__]=[]);for(var s=[],l=0;l<e.length;l++){var u=e[l];if(this.attributes[u]){var h=a[u];if(null==h){if(-1===(h=i.getAttribLocation(o,u))){s[l]=-1;continue}a[u]=h}s[l]=h,r[h]?r[h]=2:r[h]=1}else s[l]=-1}for(l=0;l<r.length;l++)switch(r[l]){case 1:i.enableVertexAttribArray(l),r[l]=3;break;case 2:r[l]=3;break;case 3:i.disableVertexAttribArray(l),r[l]=0}return s},getAttribLocation:function(t,e){var n=this._locations,r=n[e];return null==r&&(r=t.getAttribLocation(this._program,e),n[e]=r),r},buildProgram:function(t,e,n,r){var i=t.createShader(t.VERTEX_SHADER),o=t.createProgram();t.shaderSource(i,n),t.compileShader(i);var a=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(a,r),t.compileShader(a);var s=d5(t,i,n);if(s)return s;if(s=d5(t,a,r))return s;if(t.attachShader(o,i),t.attachShader(o,a),e.attributeSemantics.POSITION)t.bindAttribLocation(o,0,e.attributeSemantics.POSITION.symbol);else{var l=Object.keys(this.attributes);t.bindAttribLocation(o,0,l[0])}if(t.linkProgram(o),t.deleteShader(i),t.deleteShader(a),this._program=o,this.vertexCode=n,this.fragmentCode=r,!t.getProgramParameter(o,t.LINK_STATUS))return"Could not link program\n"+t.getProgramInfoLog(o);for(var u=0;u<e.uniforms.length;u++){var h=e.uniforms[u];this._locations[h]=t.getUniformLocation(o,h)}}}),g5=f5,m5=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function v5(t,e,n){var r={};for(var i in n)r[i+"_COUNT"]=n[i];return t.replace(m5,function(t,n,i,o){var a="";isNaN(n)&&(n=n in e?e[n]:r[n]),isNaN(i)&&(i=i in e?e[i]:r[i]);for(var s=parseInt(n);s<parseInt(i);s++)a+="{"+o.replace(/float\s*\(\s*_idx_\s*\)/g,s.toFixed(1)).replace(/_idx_/g,s)+"}";return a})}function y5(t,e,n){var r=[];if(e)for(var i in e){var o=e[i];o>0&&r.push("#define "+i.toUpperCase()+"_COUNT "+o)}if(n)for(var a=0;a<n.length;a++){var s=n[a];r.push("#define "+s.toUpperCase()+"_ENABLED")}for(var s in t){var l=t[s];null===l?r.push("#define "+s):r.push("#define "+s+" "+l.toString())}return r.join("\n")}function _5(t){this._renderer=t,this._cache={}}_5.prototype.getProgram=function(t,e,n){var r=this._cache,i=t.isSkinnedMesh&&t.isSkinnedMesh(),o=t.isInstancedMesh&&t.isInstancedMesh(),a="s"+e.shader.shaderID+"m"+e.getProgramKey();if(n&&(a+="se"+n.getProgramKey(t.lightGroup)),i&&(a+=",sk"+t.joints.length),o&&(a+=",is"),y=r[a])return y;var s=n?n.getLightsNumbers(t.lightGroup):{},l=this._renderer,u=l.gl,h=e.getEnabledTextures(),c="";if(i){var d={SKINNING:null,JOINT_COUNT:t.joints.length};t.joints.length>l.getMaxJointNumber()&&(d.USE_SKIN_MATRICES_TEXTURE=null),c+="\n"+y5(d)+"\n"}o&&(c+="\n#define INSTANCING\n");var p=c+y5(e.vertexDefines,s,h),f=c+y5(e.fragmentDefines,s,h),g=p+"\n"+e.shader.vertex,m=["OES_standard_derivatives","EXT_shader_texture_lod"].filter(function(t){return null!=l.getGLExtension(t)});m.indexOf("EXT_shader_texture_lod")>=0&&(f+="\n#define SUPPORT_TEXTURE_LOD"),m.indexOf("OES_standard_derivatives")>=0&&(f+="\n#define SUPPORT_STANDARD_DERIVATIVES");var v,y,_=function(t){for(var e=[],n=0;n<t.length;n++)e.push("#extension GL_"+t[n]+" : enable");return e.join("\n")}(m)+"\n"+(["precision",v=e.precision,"float"].join(" ")+";\n"+["precision",v,"int"].join(" ")+";\n"+["precision",v,"sampler2D"].join(" ")+";\n\n")+f+"\n"+e.shader.fragment,x=v5(g,e.vertexDefines,s),b=v5(_,e.fragmentDefines,s);(y=new g5).uniformSemantics=e.shader.uniformSemantics,y.attributes=e.shader.attributes;var w=y.buildProgram(u,e.shader,x,b);return y.__error=w,r[a]=y,y};var x5=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g,b5=/attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g,w5=/#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g,S5={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"};function T5(t){for(var e=[],n=0;n<t;n++)e[n]=0;return e}var M5={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return T5(2)},vec3:function(){return T5(3)},vec4:function(){return T5(4)},ivec2:function(){return T5(2)},ivec3:function(){return T5(3)},ivec4:function(){return T5(4)},mat2:function(){return T5(4)},mat3:function(){return T5(9)},mat4:function(){return T5(16)},array:function(){return[]}},C5=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],I5=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],A5=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],D5={vec4:4,vec3:3,vec2:2,float:1},L5={},P5={};function E5(t){return t.replace(/[ \t]*\/\/.*\n/g,"").replace(/[ \t]*\/\*[\s\S]*?\*\//g,"")}function O5(){console.error("Wrong uniform/attributes syntax")}function N5(t,e){for(var n=/[,=\(\):]/,r=e.replace(/:\s*\[\s*(.*)\s*\]/g,"="+t+"($1)").replace(/\s+/g,"").split(/(?=[,=\(\):])/g),i=[],o=0;o<r.length;o++)r[o].match(n)?i.push(r[o].charAt(0),r[o].slice(1)):i.push(r[o]);var a,s=0,l={},u=null;function h(t){t||O5();var e=t.match(/\[(.*?)\]/);a=t.replace(/\[(.*?)\]/,""),l[a]={},e&&(l[a].isArray=!0,l[a].arraySize=e[1])}h((r=i)[0]);for(o=1;o<r.length;o++){var c=r[o];if(c)if("="!==c)if(":"!==c)if(","!==c)if(")"!==c)if("("!==c)if(c.indexOf("vec")>=0){if(1!==s&&4!==s){O5();break}s=2,u=[]}else if(1!==s)if(4!==s)h(c),s=0;else{var d=c;C5.indexOf(d)>=0||I5.indexOf(d)>=0||A5.indexOf(d)>=0?l[a].semantic=d:"ignore"===d||"unconfigurable"===d?l[a].ignore=!0:l[a].value="bool"===t?"true"===d:parseFloat(d)}else l[a].value="bool"===t?"true"===c:parseFloat(c),u=null;else{if(2!==s){O5();break}if(!(u instanceof Array)){O5();break}u.push(+r[++o])}else l[a].value=new R3.Float32Array(u),u=null,s=5;else if(2===s){if(!(u instanceof Array)){O5();break}u.push(+r[++o])}else s=5;else s=4;else{if(0!==s&&3!==s){O5();break}s=1}}return l}function R5(t,e){"object"==typeof t&&(e=t.fragment,t=t.vertex),t=E5(t),e=E5(e),this._shaderID=function(t,e){var n="vertex:"+t+"fragment:"+e;if(L5[n])return L5[n];var r=A1.genGUID();return L5[n]=r,P5[r]={vertex:t,fragment:e},r}(t,e),this._vertexCode=R5.parseImport(t),this._fragmentCode=R5.parseImport(e),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}R5.prototype={constructor:R5,createUniforms:function(){var t={};for(var e in this.uniformTemplates){var n=this.uniformTemplates[e];t[e]={type:n.type,value:n.value()}}return t},_parseImport:function(){this._vertexCode=R5.parseImport(this.vertex),this._fragmentCode=R5.parseImport(this.fragment)},_addSemanticUniform:function(t,e,n){if(C5.indexOf(n)>=0)this.attributeSemantics[n]={symbol:t,type:e};else if(A5.indexOf(n)>=0){var r=!1,i=n;n.match(/TRANSPOSE$/)&&(r=!0,i=n.slice(0,-9)),this.matrixSemantics[n]={symbol:t,type:e,isTranspose:r,semanticNoTranspose:i}}else I5.indexOf(n)>=0&&(this.uniformSemantics[n]={symbol:t,type:e})},_addMaterialUniform:function(t,e,n,r,i,o){o[t]={type:n,value:i?M5.array:r||M5[e],semantic:null}},_parseUniforms:function(){var t={},e=this,n="vertex";function r(t){return null!=t?function(){return t}:null}function i(i,o,a){var s=N5(o,a),l=[];for(var u in s){var h=s[u],c=h.semantic,d=u,p=S5[o],f=r(s[u].value);s[u].isArray&&(d+="["+s[u].arraySize+"]",p+="v"),l.push(d),e._uniformList.push(u),h.ignore||("sampler2D"!==o&&"samplerCube"!==o||(e.textures[u]={shaderType:n,type:o}),c?e._addSemanticUniform(u,p,c):e._addMaterialUniform(u,o,p,f,s[u].isArray,t))}return l.length>0?"uniform "+o+" "+l.join(",")+";\n":""}this._uniformList=[],this._vertexCode=this._vertexCode.replace(x5,i),n="fragment",this._fragmentCode=this._fragmentCode.replace(x5,i),e.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=t},_parseAttributes:function(){var t={},e=this;this._vertexCode=this._vertexCode.replace(b5,function(n,r,i){var o=N5(r,i),a=D5[r]||1,s=[];for(var l in o){var u=o[l].semantic;if(t[l]={type:"float",size:a,semantic:u||null},u){if(C5.indexOf(u)<0)throw new Error('Unkown semantic "'+u+'"');e.attributeSemantics[u]={symbol:l,type:r}}s.push(l)}return"attribute "+r+" "+s.join(",")+";\n"}),this.attributes=t},_parseDefines:function(){var t=this,e="vertex";function n(n,r,i){var o="vertex"===e?t.vertexDefines:t.fragmentDefines;return o[r]||(o[r]="false"!==i&&("true"===i||(i?isNaN(parseFloat(i))?i.trim():parseFloat(i):null))),""}this._vertexCode=this._vertexCode.replace(w5,n),e="fragment",this._fragmentCode=this._fragmentCode.replace(w5,n)},clone:function(){var t=P5[this._shaderID];return new R5(t.vertex,t.fragment)}},Object.defineProperty&&(Object.defineProperty(R5.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(R5.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(R5.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(R5.prototype,"uniforms",{get:function(){return this._uniformList}}));var k5=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;R5.parseImport=function(t){return t=t.replace(k5,function(t,e,n){return(t=R5.source(n))?R5.parseImport(t):(console.error('Shader chunk "'+n+'" not existed in library'),"")})};var z5=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;R5.import=function(t){t.replace(z5,function(t,e,n,r){if(r=r.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var i,o=n.split("."),a=R5.codes,s=0;s<o.length-1;)a[i=o[s++]]||(a[i]={}),a=a[i];a[i=o[s]]=r}return r})},R5.codes={},R5.source=function(t){for(var e=t.split("."),n=R5.codes,r=0;n&&r<e.length;){n=n[e[r++]]}return"string"!=typeof n?(console.error('Shader "'+t+'" not existed in library'),""):n};var B5="@export clay.prez.vertex\nuniform mat4 WVP : WORLDVIEWPROJECTION;\nattribute vec3 pos : POSITION;\nattribute vec2 uv : TEXCOORD_0;\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\n@import clay.chunk.skinning_header\n@import clay.chunk.instancing_header\nvarying vec2 v_Texcoord;\nvoid main()\n{\n vec4 P = vec4(pos, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = WVP * P;\n v_Texcoord = uv * uvRepeat + uvOffset;\n}\n@end\n@export clay.prez.fragment\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n gl_FragColor = vec4(0.0,0.0,0.0,1.0);\n}\n@end";R5.import(B5);var V5=s2.create,F5={};function G5(t){return t.material}function H5(t,e,n){return e.uniforms[n].value}function U5(t,e,n,r){return n!==r}function W5(t){return!0}function X5(){}var j5={float:$2,byte:Z2,ubyte:Y2,short:q2,ushort:K2};function Z5(t,e,n){this.availableAttributes=t,this.availableAttributeSymbols=e,this.indicesBuffer=n,this.vao=null}function Y5(t){var e,n;this.bind=function(t){e||((e=R3.createCanvas()).width=e.height=1,e.getContext("2d"));var r=t.gl,i=!n;i&&(n=r.createTexture()),r.bindTexture(r.TEXTURE_2D,n),i&&r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)},this.unbind=function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,null)},this.isRenderable=function(){return!0}}var q5=P1.extend(function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},maxJointNumber:20,__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}},function(){this.canvas||(this.canvas=R3.createCanvas());var t=this.canvas;try{var e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!this.gl)throw new Error;this._glinfo=new L3(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(t){throw"Error creating WebGL Context "+t}this._programMgr=new _5(this),this._placeholderTexture=new Y5},{resize:function(t,e){var n=this.canvas,r=this.devicePixelRatio;null!=t?(n.style&&(n.style.width=t+"px",n.style.height=e+"px"),n.width=t*r,n.height=e*r,this._width=t,this._height=e):(this._width=n.width/r,this._height=n.height/r),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var t=this.viewport;return t.width/t.height},setDevicePixelRatio:function(t){this.devicePixelRatio=t,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(t){return this._glinfo.getExtension(t)},getGLParameter:function(t){return this._glinfo.getParameter(t)},setViewport:function(t,e,n,r,i){if("object"==typeof t){var o=t;t=o.x,e=o.y,n=o.width,r=o.height,i=o.devicePixelRatio}i=i||this.devicePixelRatio,this.gl.viewport(t*i,e*i,n*i,r*i),this.viewport={x:t,y:e,width:n,height:r,devicePixelRatio:i}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var t=this._clearStack.pop();this.clearColor=t.clearColor,this.clearBit=t.clearBit}},bindSceneRendering:function(t){this._sceneRendering=t},render:function(t,e,n,r){var i=this.gl,o=this.clearColor;if(this.clearBit){i.colorMask(!0,!0,!0,!0),i.depthMask(!0);var a=this.viewport,s=!1,l=a.devicePixelRatio;(a.width!==this._width||a.height!==this._height||l&&l!==this.devicePixelRatio||a.x||a.y)&&(s=!0,i.enable(i.SCISSOR_TEST),i.scissor(a.x*l,a.y*l,a.width*l,a.height*l)),i.clearColor(o[0],o[1],o[2],o[3]),i.clear(this.clearBit),s&&i.disable(i.SCISSOR_TEST)}if(n||t.update(!1),t.updateLights(),e=e||t.getMainCamera()){e.update();var u=t.updateRenderList(e,!0);this._sceneRendering=t;var h=u.opaque,c=u.transparent,d=t.material;t.trigger("beforerender",this,t,e,u),r?(this.renderPreZ(h,t,e),i.depthFunc(i.LEQUAL)):i.depthFunc(i.LESS);for(var p=V5(),f=k1.create(),g=0;g<c.length;g++){var m=c[g];s2.multiplyAffine(p,e.viewMatrix.array,m.worldTransform.array),k1.transformMat4(f,m.position.array,p),m.__depth=f[2]}this.renderPass(h,e,{getMaterial:function(t){return d||t.material},sortCompare:this.opaqueSortCompare}),this.renderPass(c,e,{getMaterial:function(t){return d||t.material},sortCompare:this.transparentSortCompare}),t.trigger("afterrender",this,t,e,u),this._sceneRendering=null}else console.error("Can't find camera in the scene.")},getProgram:function(t,e,n){return e=e||t.material,this._programMgr.getProgram(t,e,n)},validateProgram:function(t){if(t.__error){var e=t.__error;if(F5[t.__uid__])return;if(F5[t.__uid__]=!0,this.throwError)throw new Error(e);this.trigger("error",e)}},updatePrograms:function(t,e,n){var r=n&&n.getMaterial||G5;e=e||null;for(var i=0;i<t.length;i++){var o=t[i],a=r.call(this,o);if(i>0){var s=t[i-1],l=s.joints?s.joints.length:0;if((o.joints?o.joints.length:0)===l&&o.material===s.material&&o.lightGroup===s.lightGroup){o.__program=s.__program;continue}}var u=this._programMgr.getProgram(o,a,e);this.validateProgram(u),o.__program=u}},renderPass:function(t,e,n){this.trigger("beforerenderpass",this,t,e,n),(n=n||{}).getMaterial=n.getMaterial||G5,n.getUniform=n.getUniform||H5,n.isMaterialChanged=n.isMaterialChanged||U5,n.beforeRender=n.beforeRender||X5,n.afterRender=n.afterRender||X5;var r=n.ifRender||W5;this.updatePrograms(t,this._sceneRendering,n),n.sortCompare&&t.sort(n.sortCompare);var i=this.viewport,o=i.devicePixelRatio,a=[i.x*o,i.y*o,i.width*o,i.height*o],s=this.devicePixelRatio,l=this.__currentFrameBuffer?[this.__currentFrameBuffer.getTextureWidth(),this.__currentFrameBuffer.getTextureHeight()]:[this._width*s,this._height*s],u=[a[2],a[3]],h=Date.now();e?(s2.copy(K5.VIEW,e.viewMatrix.array),s2.copy(K5.PROJECTION,e.projectionMatrix.array),s2.copy(K5.VIEWINVERSE,e.worldTransform.array)):(s2.identity(K5.VIEW),s2.identity(K5.PROJECTION),s2.identity(K5.VIEWINVERSE)),s2.multiply(K5.VIEWPROJECTION,K5.PROJECTION,K5.VIEW),s2.invert(K5.PROJECTIONINVERSE,K5.PROJECTION),s2.invert(K5.VIEWPROJECTIONINVERSE,K5.VIEWPROJECTION);for(var c,d,p,f,g,m,v,y,_,x,b,w,S=this.gl,T=this._sceneRendering,M=null,C=0;C<t.length;C++){var I,A=t[C],D=null!=A.worldTransform;if(r(A)){D&&(I=A.isSkinnedMesh&&A.isSkinnedMesh()?A.offsetMatrix?A.offsetMatrix.array:K5.IDENTITY:A.worldTransform.array);var L=A.geometry,P=n.getMaterial.call(this,A),E=A.__program,O=P.shader,N=L.__uid__+"-"+E.__uid__,R=N!==x;x=N,D&&(s2.copy(K5.WORLD,I),s2.multiply(K5.WORLDVIEWPROJECTION,K5.VIEWPROJECTION,I),s2.multiplyAffine(K5.WORLDVIEW,K5.VIEW,I),(O.matrixSemantics.WORLDINVERSE||O.matrixSemantics.WORLDINVERSETRANSPOSE)&&s2.invert(K5.WORLDINVERSE,I),(O.matrixSemantics.WORLDVIEWINVERSE||O.matrixSemantics.WORLDVIEWINVERSETRANSPOSE)&&s2.invert(K5.WORLDVIEWINVERSE,K5.WORLDVIEW),(O.matrixSemantics.WORLDVIEWPROJECTIONINVERSE||O.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE)&&s2.invert(K5.WORLDVIEWPROJECTIONINVERSE,K5.WORLDVIEWPROJECTION)),A.beforeRender&&A.beforeRender(this),n.beforeRender.call(this,A,P,c);var k=E!==d;k?(E.bind(this),E.setUniformOfSemantic(S,"VIEWPORT",a),E.setUniformOfSemantic(S,"WINDOW_SIZE",l),e&&(E.setUniformOfSemantic(S,"NEAR",e.near),E.setUniformOfSemantic(S,"FAR",e.far)),E.setUniformOfSemantic(S,"DEVICEPIXELRATIO",o),E.setUniformOfSemantic(S,"TIME",h),E.setUniformOfSemantic(S,"VIEWPORT_SIZE",u),T&&T.setLightUniforms(E,A.lightGroup,this)):E=d,(k||n.isMaterialChanged(A,p,P,c))&&(P.depthTest!==f&&(P.depthTest?S.enable(S.DEPTH_TEST):S.disable(S.DEPTH_TEST),f=P.depthTest),P.depthMask!==g&&(S.depthMask(P.depthMask),g=P.depthMask),P.transparent!==_&&(P.transparent?S.enable(S.BLEND):S.disable(S.BLEND),_=P.transparent),P.transparent&&(P.blend?P.blend(S):(S.blendEquationSeparate(S.FUNC_ADD,S.FUNC_ADD),S.blendFuncSeparate(S.SRC_ALPHA,S.ONE_MINUS_SRC_ALPHA,S.ONE,S.ONE_MINUS_SRC_ALPHA))),w=this._bindMaterial(A,P,E,p||null,c||null,d||null,n.getUniform),c=P);var z=O.matrixSemanticKeys;if(D)for(var B=0;B<z.length;B++){var V=z[B],F=O.matrixSemantics[V],G=K5[V];if(F.isTranspose){var H=K5[F.semanticNoTranspose];s2.transpose(G,H)}E.setUniform(S,F.type,F.symbol,G)}A.cullFace!==v&&(v=A.cullFace,S.cullFace(v)),A.frontFace!==y&&(y=A.frontFace,S.frontFace(y)),A.culling!==m&&((m=A.culling)?S.enable(S.CULL_FACE):S.disable(S.CULL_FACE)),this._updateSkeleton(A,E,w),R&&(b=this._bindVAO(M,O,L,E)),this._renderObject(A,b,E),n.afterRender(this,A),A.afterRender&&A.afterRender(this),d=E,p=A}}this.trigger("afterrenderpass",this,t,e,n)},getMaxJointNumber:function(){return this.maxJointNumber},_updateSkeleton:function(t,e,n){var r=this.gl,i=t.skeleton;if(i)if(i.update(),t.joints.length>this.getMaxJointNumber()){var o=i.getSubSkinMatricesTexture(t.__uid__,t.joints);e.useTextureSlot(this,o,n),e.setUniform(r,"1i","skinMatricesTexture",n),e.setUniform(r,"1f","skinMatricesTextureSize",o.width)}else{var a=i.getSubSkinMatrices(t.__uid__,t.joints);e.setUniformOfSemantic(r,"SKIN_MATRIX",a)}},_renderObject:function(t,e,n){var r=this.gl,i=t.geometry,o=t.mode;null==o&&(o=4);var a=null,s=t.isInstancedMesh&&t.isInstancedMesh();if(!s||(a=this.getGLExtension("ANGLE_instanced_arrays"))){var l;if(s&&(l=this._bindInstancedAttributes(t,n,a)),e.indicesBuffer){var u=this.getGLExtension("OES_element_index_uint")&&i.indices instanceof Uint32Array?r.UNSIGNED_INT:r.UNSIGNED_SHORT;s?a.drawElementsInstancedANGLE(o,e.indicesBuffer.count,u,0,t.getInstanceCount()):r.drawElements(o,e.indicesBuffer.count,u,0)}else s?a.drawArraysInstancedANGLE(o,0,i.vertexCount,t.getInstanceCount()):r.drawArrays(o,0,i.vertexCount);if(s)for(var h=0;h<l.length;h++)r.disableVertexAttribArray(l[h])}else console.warn("Device not support ANGLE_instanced_arrays extension")},_bindInstancedAttributes:function(t,e,n){for(var r=this.gl,i=t.getInstancedAttributesBuffers(this),o=[],a=0;a<i.length;a++){var s=i[a],l=e.getAttribLocation(r,s.symbol);if(!(l<0)){var u=j5[s.type]||r.FLOAT;r.enableVertexAttribArray(l),r.bindBuffer(r.ARRAY_BUFFER,s.buffer),r.vertexAttribPointer(l,s.size,u,!1,0,0),n.vertexAttribDivisorANGLE(l,s.divisor),o.push(l)}}return o},_bindMaterial:function(t,e,n,r,i,o,a){for(var s=this.gl,l=o===n,u=n.currentTextureSlot(),h=e.getEnabledUniforms(),c=e.getTextureUniforms(),d=this._placeholderTexture,p=0;p<c.length;p++){var f=a(t,e,v=c[p]);if("t"===(m=e.uniforms[v].type)&&f)f.__slot=-1;else if("tv"===m)for(var g=0;g<f.length;g++)f[g]&&(f[g].__slot=-1)}d.__slot=-1;for(p=0;p<h.length;p++){var m,v=h[p],y=e.uniforms[v],_=(f=a(t,e,v),"t"===(m=y.type));if(_&&(f&&f.isRenderable()||(f=d)),i&&l){var x=a(r,i,v);if(_&&(x&&x.isRenderable()||(x=d)),x===f){if(_)n.takeCurrentTextureSlot(this,null);else if("tv"===m&&f)for(g=0;g<f.length;g++)n.takeCurrentTextureSlot(this,null);continue}}if(null!=f)if(_)if(f.__slot<0){var b=n.currentTextureSlot();n.setUniform(s,"1i",v,b)&&(n.takeCurrentTextureSlot(this,f),f.__slot=b)}else n.setUniform(s,"1i",v,f.__slot);else if(Array.isArray(f)){if(0===f.length)continue;if("tv"===m){if(!n.hasUniform(v))continue;var w=[];for(g=0;g<f.length;g++){var S=f[g];if(S.__slot<0){b=n.currentTextureSlot();w.push(b),n.takeCurrentTextureSlot(this,S),S.__slot=b}else w.push(S.__slot)}n.setUniform(s,"1iv",v,w)}else n.setUniform(s,y.type,v,f)}else n.setUniform(s,y.type,v,f)}var T=n.currentTextureSlot();return n.resetTextureSlot(u),T},_bindVAO:function(t,e,n,r){var i=!n.dynamic,o=this.gl,a=this.__uid__+"-"+r.__uid__,s=n.__vaoCache[a];if(!s){var l=n.getBufferChunks(this);if(!l||!l.length)return;for(var u=l[0],h=u.attributeBuffers,c=u.indicesBuffer,d=[],p=[],f=0;f<h.length;f++){var g,m=(w=h[f]).name,v=w.semantic;if(v){var y=e.attributeSemantics[v];g=y&&y.symbol}else g=m;g&&r.attributes[g]&&(d.push(w),p.push(g))}s=new Z5(d,p,c),i&&(n.__vaoCache[a]=s)}var _=!0;t&&i&&(null==s.vao?s.vao=t.createVertexArrayOES():_=!1,t.bindVertexArrayOES(s.vao));d=s.availableAttributes,c=s.indicesBuffer;if(_){var x=r.enableAttributes(this,s.availableAttributeSymbols,t&&i&&s);for(f=0;f<d.length;f++){var b=x[f];if(-1!==b){var w,S=(w=d[f]).buffer,T=w.size,M=j5[w.type]||o.FLOAT;o.bindBuffer(o.ARRAY_BUFFER,S),o.vertexAttribPointer(b,T,M,!1,0,0)}}n.isUseIndices()&&o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,c.buffer)}return s},renderPreZ:function(t,e,n){var r=this.gl,i=this._prezMaterial||new i5({shader:new R5(R5.source("clay.prez.vertex"),R5.source("clay.prez.fragment"))});this._prezMaterial=i,r.colorMask(!1,!1,!1,!1),r.depthMask(!0),this.renderPass(t,n,{ifRender:function(t){return!t.ignorePreZ},isMaterialChanged:function(t,e){var n=t.material,r=e.material;return n.get("diffuseMap")!==r.get("diffuseMap")||(n.get("alphaCutoff")||0)!==(r.get("alphaCutoff")||0)},getUniform:function(t,e,n){return"alphaMap"===n?t.material.get("diffuseMap"):"alphaCutoff"===n?t.material.isDefined("fragment","ALPHA_TEST")&&t.material.get("diffuseMap")&&t.material.get("alphaCutoff")||0:"uvRepeat"===n?t.material.get("uvRepeat"):"uvOffset"===n?t.material.get("uvOffset"):e.get(n)},getMaterial:function(){return i},sort:this.opaqueSortCompare}),r.colorMask(!0,!0,!0,!0),r.depthMask(!0)},disposeScene:function(t){this.disposeNode(t,!0,!0),t.dispose()},disposeNode:function(t,e,n){t.getParent()&&t.getParent().remove(t);var r={};t.traverse(function(t){var i=t.material;if(t.geometry&&e&&t.geometry.dispose(this),n&&i&&!r[i.__uid__]){for(var o=i.getTextureUniforms(),a=0;a<o.length;a++){var s=o[a],l=i.uniforms[s].value,u=i.uniforms[s].type;if(l)if("t"===u)l.dispose&&l.dispose(this);else if("tv"===u)for(var h=0;h<l.length;h++)l[h]&&l[h].dispose&&l[h].dispose(this)}r[i.__uid__]=!0}t.dispose&&t.dispose(this)},this)},disposeGeometry:function(t){t.dispose(this)},disposeTexture:function(t){t.dispose(this)},disposeFrameBuffer:function(t){t.dispose(this)},dispose:function(){},screenToNDC:function(t,e,n){n||(n=new u5),e=this._height-e;var r=this.viewport,i=n.array;return i[0]=(t-r.x)/r.width,i[0]=2*i[0]-1,i[1]=(e-r.y)/r.height,i[1]=2*i[1]-1,n}});q5.opaqueSortCompare=q5.prototype.opaqueSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.renderOrder-e.renderOrder},q5.transparentSortCompare=q5.prototype.transparentSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__depth===e.__depth?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.__depth-e.__depth:t.renderOrder-e.renderOrder};var K5={IDENTITY:V5(),WORLD:V5(),VIEW:V5(),PROJECTION:V5(),WORLDVIEW:V5(),VIEWPROJECTION:V5(),WORLDVIEWPROJECTION:V5(),WORLDINVERSE:V5(),VIEWINVERSE:V5(),PROJECTIONINVERSE:V5(),WORLDVIEWINVERSE:V5(),VIEWPROJECTIONINVERSE:V5(),WORLDVIEWPROJECTIONINVERSE:V5(),WORLDTRANSPOSE:V5(),VIEWTRANSPOSE:V5(),PROJECTIONTRANSPOSE:V5(),WORLDVIEWTRANSPOSE:V5(),VIEWPROJECTIONTRANSPOSE:V5(),WORLDVIEWPROJECTIONTRANSPOSE:V5(),WORLDINVERSETRANSPOSE:V5(),VIEWINVERSETRANSPOSE:V5(),PROJECTIONINVERSETRANSPOSE:V5(),WORLDVIEWINVERSETRANSPOSE:V5(),VIEWPROJECTIONINVERSETRANSPOSE:V5(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:V5()};q5.COLOR_BUFFER_BIT=P2,q5.DEPTH_BUFFER_BIT=D2,q5.STENCIL_BUFFER_BIT=L2;var J5=q5,Q5="__dt__",$5=function(){this._contextId=0,this._caches=[],this._context={}};$5.prototype={use:function(t,e){var n=this._caches;n[t]||(n[t]={},e&&(n[t]=e())),this._contextId=t,this._context=n[t]},put:function(t,e){this._context[t]=e},get:function(t){return this._context[t]},dirty:function(t){var e=Q5+(t=t||"");this.put(e,!0)},dirtyAll:function(t){for(var e=Q5+(t=t||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][e]=!0)},fresh:function(t){var e=Q5+(t=t||"");this.put(e,!1)},freshAll:function(t){for(var e=Q5+(t=t||""),n=this._caches,r=0;r<n.length;r++)n[r]&&(n[r][e]=!1)},isDirty:function(t){var e=Q5+(t=t||""),n=this._context;return!n.hasOwnProperty(e)||!0===n[e]},deleteContext:function(t){delete this._caches[t],this._context={}},delete:function(t){delete this._context[t]},clearAll:function(){this._caches={}},getContext:function(){return this._context},eachContext:function(t,e){Object.keys(this._caches).forEach(function(n){t&&t.call(e,n)})},miss:function(t){return!this._context.hasOwnProperty(t)}},$5.prototype.constructor=$5;var t4=$5,e4=P1.extend({width:512,height:512,type:Y2,format:r3,wrapS:f3,wrapT:f3,minFilter:c3,magFilter:s3,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1,__used:0},function(){this._cache=new t4},{getWebGLTexture:function(t){var e=t.gl,n=this._cache;return n.use(t.__uid__),n.miss("webgl_texture")&&n.put("webgl_texture",e.createTexture()),this.dynamic?this.update(t):n.isDirty()&&(this.update(t),n.fresh()),n.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(t){},updateCommon:function(t){var e=t.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,this.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===t3&&(this.useMipmap=!1);var n=t.getGLExtension("EXT_sRGB");this.format!==e4.SRGB||n||(this.format=e4.RGB),this.format!==e4.SRGB_ALPHA||n||(this.format=e4.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?g3:this.wrapS},getAvailableWrapT:function(){return this.NPOT?g3:this.wrapT},getAvailableMinFilter:function(){var t=this.minFilter;return this.NPOT||!this.useMipmap?t===l3||t===h3?a3:t===c3||t===u3?s3:t:t},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(t){--t;for(var e=1;e<32;e<<=1)t|=t>>e;return t+1},dispose:function(t){var e=this._cache;e.use(t.__uid__);var n=e.get("webgl_texture");n&&t.gl.deleteTexture(n),e.deleteContext(t.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(e4.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t}}),Object.defineProperty(e4.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t}}),e4.BYTE=Z2,e4.UNSIGNED_BYTE=Y2,e4.SHORT=q2,e4.UNSIGNED_SHORT=K2,e4.INT=J2,e4.UNSIGNED_INT=Q2,e4.FLOAT=$2,e4.HALF_FLOAT=36193,e4.UNSIGNED_INT_24_8_WEBGL=34042,e4.DEPTH_COMPONENT=t3,e4.DEPTH_STENCIL=_3,e4.ALPHA=e3,e4.RGB=n3,e4.RGBA=r3,e4.LUMINANCE=i3,e4.LUMINANCE_ALPHA=o3,e4.SRGB=35904,e4.SRGB_ALPHA=35906,e4.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,e4.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,e4.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,e4.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,e4.NEAREST=a3,e4.LINEAR=s3,e4.NEAREST_MIPMAP_NEAREST=l3,e4.LINEAR_MIPMAP_NEAREST=u3,e4.NEAREST_MIPMAP_LINEAR=h3,e4.LINEAR_MIPMAP_LINEAR=c3,e4.REPEAT=f3,e4.CLAMP_TO_EDGE=g3,e4.MIRRORED_REPEAT=m3;var n4=e4,r4={isPowerOfTwo:function(t){return!(t&t-1)},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}},i4=r4,o4=i4.isPowerOfTwo;function a4(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}var s4=n4.extend(function(){return{image:null,pixels:null,mipmaps:[],convertToPOT:!1}},{textureType:"texture2D",update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(t);var n=this.format,r=this.type,i=!(!this.convertToPOT||this.mipmaps.length||!this.image||this.wrapS!==n4.REPEAT&&this.wrapT!==n4.REPEAT||!this.NPOT);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i?this.wrapS:this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i?this.wrapT:this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i?this.magFilter:this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i?this.minFilter:this.getAvailableMinFilter());var o=t.getGLExtension("EXT_texture_filter_anisotropic");(o&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_2D,o.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===r)&&(t.getGLExtension("OES_texture_half_float")||(r=$2));if(this.mipmaps.length)for(var a=this.width,s=this.height,l=0;l<this.mipmaps.length;l++){var u=this.mipmaps[l];this._updateTextureData(e,u,l,a,s,n,r,!1),a/=2,s/=2}else this._updateTextureData(e,this,0,this.width,this.height,n,r,i),!this.useMipmap||this.NPOT&&!i||e.generateMipmap(e.TEXTURE_2D);e.bindTexture(e.TEXTURE_2D,null)},_updateTextureData:function(t,e,n,r,i,o,a,s){if(e.image){var l=e.image;s&&(this._potCanvas=function(t,e){var n=a4(t.width),r=a4(t.height);return(e=e||document.createElement("canvas")).width=n,e.height=r,e.getContext("2d").drawImage(t.image,0,0,n,r),e}(this,this._potCanvas),l=this._potCanvas),t.texImage2D(t.TEXTURE_2D,n,o,o,a,l)}else o<=n4.COMPRESSED_RGBA_S3TC_DXT5_EXT&&o>=n4.COMPRESSED_RGB_S3TC_DXT1_EXT?t.compressedTexImage2D(t.TEXTURE_2D,n,o,r,i,0,e.pixels):t.texImage2D(t.TEXTURE_2D,n,o,r,i,0,o,a,e.pixels)},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_2D))},isPowerOfTwo:function(){return o4(this.width)&&o4(this.height)},isRenderable:function(){return this.image?this.image.width>0&&this.image.height>0:!(!this.width||!this.height)},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,null)},load:function(t,e){var n=R3.createImage();e&&(n.crossOrigin=e);var r=this;return n.onload=function(){r.dirty(),r.trigger("success",r)},n.onerror=function(){r.trigger("error",r)},n.src=t,this.image=n,this}});Object.defineProperty(s4.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(t){this.image?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}}),Object.defineProperty(s4.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(t){this.image?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}});var l4=s4;function u4(t){return{byte:R3.Int8Array,ubyte:R3.Uint8Array,short:R3.Int16Array,ushort:R3.Uint16Array}[t]||R3.Float32Array}function h4(t){return"attr_"+t}function c4(t,e,n,r){switch(this.name=t,this.type=e,this.size=n,this.semantic=r||"",this.value=null,n){case 1:this.get=function(t){return this.value[t]},this.set=function(t,e){this.value[t]=e},this.copy=function(t,e){this.value[t]=this.value[t]};break;case 2:this.get=function(t,e){var n=this.value;return e[0]=n[2*t],e[1]=n[2*t+1],e},this.set=function(t,e){var n=this.value;n[2*t]=e[0],n[2*t+1]=e[1]},this.copy=function(t,e){var n=this.value;e*=2,n[t*=2]=n[e],n[t+1]=n[e+1]};break;case 3:this.get=function(t,e){var n=3*t,r=this.value;return e[0]=r[n],e[1]=r[n+1],e[2]=r[n+2],e},this.set=function(t,e){var n=3*t,r=this.value;r[n]=e[0],r[n+1]=e[1],r[n+2]=e[2]},this.copy=function(t,e){var n=this.value;e*=3,n[t*=3]=n[e],n[t+1]=n[e+1],n[t+2]=n[e+2]};break;case 4:this.get=function(t,e){var n=this.value,r=4*t;return e[0]=n[r],e[1]=n[r+1],e[2]=n[r+2],e[3]=n[r+3],e},this.set=function(t,e){var n=this.value,r=4*t;n[r]=e[0],n[r+1]=e[1],n[r+2]=e[2],n[r+3]=e[3]},this.copy=function(t,e){var n=this.value;e*=4,n[t*=4]=n[e],n[t+1]=n[e+1],n[t+2]=n[e+2],n[t+3]=n[e+3]}}}function d4(t,e,n,r,i){this.name=t,this.type=e,this.buffer=n,this.size=r,this.semantic=i,this.symbol="",this.needsRemove=!1}function p4(t){this.buffer=t,this.count=0}c4.prototype.init=function(t){if(!this.value||this.value.length!==t*this.size){var e=u4(this.type);this.value=new e(t*this.size)}},c4.prototype.fromArray=function(t){var e,n=u4(this.type);if(t[0]&&t[0].length){var r=0,i=this.size;e=new n(t.length*i);for(var o=0;o<t.length;o++)for(var a=0;a<i;a++)e[r++]=t[o][a]}else e=new n(t);this.value=e},c4.prototype.clone=function(t){var e=new c4(this.name,this.type,this.size,this.semantic);return t&&console.warn("todo"),e};var f4=P1.extend(function(){return{attributes:{},indices:null,dynamic:!0,_enabledAttributes:null,__used:0}},function(){this._cache=new t4,this._attributeList=Object.keys(this.attributes),this.__vaoCache={}},{mainAttribute:"",pick:null,pickByRay:null,dirty:function(){for(var t=this.getEnabledAttributes(),e=0;e<t.length;e++)this.dirtyAttribute(t[e]);this.dirtyIndices(),this._enabledAttributes=null,this._cache.dirty("any")},dirtyIndices:function(){this._cache.dirtyAll("indices")},dirtyAttribute:function(t){this._cache.dirtyAll(h4(t)),this._cache.dirtyAll("attributes")},getTriangleIndices:function(t,e){if(t<this.triangleCount&&t>=0){e||(e=[]);var n=this.indices;return e[0]=n[3*t],e[1]=n[3*t+1],e[2]=n[3*t+2],e}},setTriangleIndices:function(t,e){var n=this.indices;n[3*t]=e[0],n[3*t+1]=e[1],n[3*t+2]=e[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(t){var e,n=this.vertexCount>65535?R3.Uint32Array:R3.Uint16Array;if(t[0]&&t[0].length){var r=0;e=new n(3*t.length);for(var i=0;i<t.length;i++)for(var o=0;o<3;o++)e[r++]=t[i][o]}else e=new n(t);this.indices=e},createAttribute:function(t,e,n,r){var i=new c4(t,e,n,r);return this.attributes[t]&&this.removeAttribute(t),this.attributes[t]=i,this._attributeList.push(t),i},removeAttribute:function(t){var e=this._attributeList,n=e.indexOf(t);return n>=0&&(e.splice(n,1),delete this.attributes[t],!0)},getAttribute:function(t){return this.attributes[t]},getEnabledAttributes:function(){var t=this._enabledAttributes,e=this._attributeList;if(t)return t;for(var n=[],r=this.vertexCount,i=0;i<e.length;i++){var o=e[i],a=this.attributes[o];a.value&&a.value.length===r*a.size&&n.push(o)}return this._enabledAttributes=n,n},getBufferChunks:function(t){var e=this._cache;e.use(t.__uid__);var n=e.isDirty("attributes"),r=e.isDirty("indices");if(n||r){this._updateBuffer(t.gl,n,r);for(var i=this.getEnabledAttributes(),o=0;o<i.length;o++)e.fresh(h4(i[o]));e.fresh("attributes"),e.fresh("indices")}return e.fresh("any"),e.get("chunks")},_updateBuffer:function(t,e,n){var r=this._cache,i=r.get("chunks"),o=!1;i||((i=[])[0]={attributeBuffers:[],indicesBuffer:null},r.put("chunks",i),o=!0);var a=i[0],s=a.attributeBuffers,l=a.indicesBuffer;if(e||o){var u=this.getEnabledAttributes(),h={};if(!o)for(var c=0;c<s.length;c++)h[s[c].name]=s[c];for(var d=0;d<u.length;d++){var p,f,g=u[d],m=this.attributes[g];o||(p=h[g]),f=p?p.buffer:t.createBuffer(),r.isDirty(h4(g))&&(t.bindBuffer(t.ARRAY_BUFFER,f),t.bufferData(t.ARRAY_BUFFER,m.value,this.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW)),s[d]=new d4(g,m.type,f,m.size,m.semantic)}for(c=d;c<s.length;c++)t.deleteBuffer(s[c].buffer);s.length=d}this.isUseIndices()&&(n||o)&&(l||(l=new p4(t.createBuffer()),a.indicesBuffer=l),l.count=this.indices.length,t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,l.buffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,this.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW))},dispose:function(t){var e=this._cache;e.use(t.__uid__);var n=e.get("chunks");if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=0;o<i.attributeBuffers.length;o++){var a=i.attributeBuffers[o];t.gl.deleteBuffer(a.buffer)}i.indicesBuffer&&t.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s=t.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},e.deleteContext(t.__uid__)}});Object.defineProperty&&(Object.defineProperty(f4.prototype,"vertexCount",{enumerable:!1,get:function(){var t=this.attributes[this.mainAttribute];return t||(t=this.attributes[this._attributeList[0]]),t&&t.value?t.value.length/t.size:0}}),Object.defineProperty(f4.prototype,"triangleCount",{enumerable:!1,get:function(){var t=this.indices;return t?t.length/3:0}})),f4.STATIC_DRAW=F2,f4.DYNAMIC_DRAW=G2,f4.STREAM_DRAW=V2,f4.AttributeBuffer=d4,f4.IndicesBuffer=p4,f4.Attribute=c4;var g4=f4,m4=k1.create,v4=k1.add,y4=k1.set,_4=g4.Attribute,x4=g4.extend(function(){return{attributes:{position:new _4("position","float",3,"POSITION"),texcoord0:new _4("texcoord0","float",2,"TEXCOORD_0"),texcoord1:new _4("texcoord1","float",2,"TEXCOORD_1"),normal:new _4("normal","float",3,"NORMAL"),tangent:new _4("tangent","float",4,"TANGENT"),color:new _4("color","float",4,"COLOR"),weight:new _4("weight","float",3,"WEIGHT"),joint:new _4("joint","float",4,"JOINT"),barycentric:new _4("barycentric","float",3,null)},boundingBox:null}},{mainAttribute:"position",updateBoundingBox:function(){var t=this.boundingBox;t||(t=this.boundingBox=new M2);var e=this.attributes.position.value;if(e&&e.length){var n=t.min,r=t.max,i=n.array,o=r.array;k1.set(i,e[0],e[1],e[2]),k1.set(o,e[0],e[1],e[2]);for(var a=3;a<e.length;){var s=e[a++],l=e[a++],u=e[a++];s<i[0]&&(i[0]=s),l<i[1]&&(i[1]=l),u<i[2]&&(i[2]=u),s>o[0]&&(o[0]=s),l>o[1]&&(o[1]=l),u>o[2]&&(o[2]=u)}n._dirty=!0,r._dirty=!0}},generateVertexNormals:function(){if(this.vertexCount){var t=this.indices,e=this.attributes,n=e.position.value,r=e.normal.value;if(r&&r.length===n.length)for(var i=0;i<r.length;i++)r[i]=0;else r=e.normal.value=new R3.Float32Array(n.length);for(var o,a,s,l=m4(),u=m4(),h=m4(),c=m4(),d=m4(),p=m4(),f=t?t.length:this.vertexCount,g=0;g<f;){t?(o=t[g++],a=t[g++],s=t[g++]):(o=g++,a=g++,s=g++),y4(l,n[3*o],n[3*o+1],n[3*o+2]),y4(u,n[3*a],n[3*a+1],n[3*a+2]),y4(h,n[3*s],n[3*s+1],n[3*s+2]),k1.sub(c,l,u),k1.sub(d,u,h),k1.cross(p,c,d);for(i=0;i<3;i++)r[3*o+i]=r[3*o+i]+p[i],r[3*a+i]=r[3*a+i]+p[i],r[3*s+i]=r[3*s+i]+p[i]}for(i=0;i<r.length;)y4(p,r[i],r[i+1],r[i+2]),k1.normalize(p,p),r[i++]=p[0],r[i++]=p[1],r[i++]=p[2];this.dirty()}},generateFaceNormals:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var t=this.indices,e=this.attributes,n=e.position.value,r=e.normal.value,i=m4(),o=m4(),a=m4(),s=m4(),l=m4(),u=m4();r||(r=e.normal.value=new Float32Array(n.length));for(var h,c,d,p=t?t.length:this.vertexCount,f=0;f<p;){t?(h=t[f++],c=t[f++],d=t[f++]):(h=f++,c=f++,d=f++),y4(i,n[3*h],n[3*h+1],n[3*h+2]),y4(o,n[3*c],n[3*c+1],n[3*c+2]),y4(a,n[3*d],n[3*d+1],n[3*d+2]),k1.sub(s,i,o),k1.sub(l,o,a),k1.cross(u,s,l),k1.normalize(u,u);for(var g=0;g<3;g++)r[3*h+g]=u[g],r[3*c+g]=u[g],r[3*d+g]=u[g]}this.dirty()}},generateTangents:function(){if(this.vertexCount){var t=this.vertexCount,e=this.attributes;e.tangent.value||(e.tangent.value=new Float32Array(4*t));var n=e.texcoord0.value,r=e.position.value,i=e.tangent.value,o=e.normal.value;if(n){for(var a=[],s=[],l=0;l<t;l++)a[l]=[0,0,0],s[l]=[0,0,0];var u,h,c,d=[0,0,0],p=[0,0,0],f=this.indices,g=f?f.length:this.vertexCount;for(l=0;l<g;){f?(u=f[l++],h=f[l++],c=f[l++]):(u=l++,h=l++,c=l++);var m=n[2*u],v=n[2*h],y=n[2*c],_=n[2*u+1],x=n[2*h+1],b=n[2*c+1],w=r[3*u],S=r[3*h],T=r[3*c],M=r[3*u+1],C=r[3*h+1],I=r[3*c+1],A=r[3*u+2],D=S-w,L=T-w,P=C-M,E=I-M,O=r[3*h+2]-A,N=r[3*c+2]-A,R=v-m,k=y-m,z=x-_,B=b-_,V=1/(R*B-z*k);d[0]=(B*D-z*L)*V,d[1]=(B*P-z*E)*V,d[2]=(B*O-z*N)*V,p[0]=(R*L-k*D)*V,p[1]=(R*E-k*P)*V,p[2]=(R*N-k*O)*V,v4(a[u],a[u],d),v4(a[h],a[h],d),v4(a[c],a[c],d),v4(s[u],s[u],p),v4(s[h],s[h],p),v4(s[c],s[c],p)}var F=m4(),G=m4(),H=m4();for(l=0;l<t;l++){H[0]=o[3*l],H[1]=o[3*l+1],H[2]=o[3*l+2];var U=a[l];k1.scale(F,H,k1.dot(H,U)),k1.sub(F,U,F),k1.normalize(F,F),k1.cross(G,H,U),i[4*l]=F[0],i[4*l+1]=F[1],i[4*l+2]=F[2],i[4*l+3]=k1.dot(G,s[l])<0?-1:1}this.dirty()}else console.warn("Geometry without texcoords can't generate tangents.")}},isUniqueVertex:function(){return!this.isUseIndices()||this.vertexCount===this.indices.length},generateUniqueVertex:function(){if(this.vertexCount&&this.indices){this.indices.length>65535&&(this.indices=new R3.Uint32Array(this.indices));for(var t=this.attributes,e=this.indices,n=this.getEnabledAttributes(),r={},i=0;i<n.length;i++){r[l=n[i]]=t[l].value,t[l].init(this.indices.length)}for(var o=0,a=0;a<e.length;a++){var s=e[a];for(i=0;i<n.length;i++)for(var l,u=t[l=n[i]].value,h=t[l].size,c=0;c<h;c++)u[o*h+c]=r[l][s*h+c];e[a]=o,o++}this.dirty()}},generateBarycentric:function(){if(this.vertexCount){this.isUniqueVertex()||this.generateUniqueVertex();var t=this.attributes,e=t.barycentric.value,n=this.indices;if(!e||e.length!==3*n.length){e=t.barycentric.value=new Float32Array(3*n.length);for(var r=0;r<(n?n.length:this.vertexCount/3);)for(var i=0;i<3;i++){e[3*(n?n[r++]:3*r+i)+i]=1}this.dirty()}}},applyTransform:function(t){var e=this.attributes,n=e.position.value,r=e.normal.value,i=e.tangent.value;t=t.array;var o=s2.create();s2.invert(o,t),s2.transpose(o,o);var a=k1.transformMat4,s=k1.forEach;s(n,3,0,null,a,t),r&&s(r,3,0,null,a,o),i&&s(i,4,0,null,a,o),this.boundingBox&&this.updateBoundingBox()},dispose:function(t){var e=this._cache;e.use(t.__uid__);var n=e.get("chunks");if(n)for(var r=0;r<n.length;r++){for(var i=n[r],o=0;o<i.attributeBuffers.length;o++){var a=i.attributeBuffers[o];t.gl.deleteBuffer(a.buffer)}i.indicesBuffer&&t.gl.deleteBuffer(i.indicesBuffer.buffer)}if(this.__vaoCache){var s=t.getGLExtension("OES_vertex_array_object");for(var l in this.__vaoCache){var u=this.__vaoCache[l].vao;u&&s.deleteVertexArrayOES(u)}}this.__vaoCache={},e.deleteContext(t.__uid__)}});x4.STATIC_DRAW=g4.STATIC_DRAW,x4.DYNAMIC_DRAW=g4.DYNAMIC_DRAW,x4.STREAM_DRAW=g4.STREAM_DRAW,x4.AttributeBuffer=g4.AttributeBuffer,x4.IndicesBuffer=g4.IndicesBuffer,x4.Attribute=_4;var b4=x4,w4="uniform vec3 ",S4="uniform float ",T4="@export clay.header.",M4="@end",C4=":unconfigurable;",I4=[T4+"directional_light",w4+"directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]"+C4,w4+"directionalLightColor[DIRECTIONAL_LIGHT_COUNT]"+C4,M4,T4+"ambient_light",w4+"ambientLightColor[AMBIENT_LIGHT_COUNT]"+C4,M4,T4+"ambient_sh_light",w4+"ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]"+C4,w4+"ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]"+C4,"vec3 calcAmbientSHLight(int idx, vec3 N) {\n int offset = 9 * idx;\n return ambientSHLightCoefficients[0]\n + ambientSHLightCoefficients[1] * N.x\n + ambientSHLightCoefficients[2] * N.y\n + ambientSHLightCoefficients[3] * N.z\n + ambientSHLightCoefficients[4] * N.x * N.z\n + ambientSHLightCoefficients[5] * N.z * N.y\n + ambientSHLightCoefficients[6] * N.y * N.x\n + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)\n + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);\n}",M4,T4+"ambient_cubemap_light",w4+"ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]"+C4,"uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]"+C4,"uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]"+C4,M4,T4+"point_light",w4+"pointLightPosition[POINT_LIGHT_COUNT]"+C4,S4+"pointLightRange[POINT_LIGHT_COUNT]"+C4,w4+"pointLightColor[POINT_LIGHT_COUNT]"+C4,M4,T4+"spot_light",w4+"spotLightPosition[SPOT_LIGHT_COUNT]"+C4,w4+"spotLightDirection[SPOT_LIGHT_COUNT]"+C4,S4+"spotLightRange[SPOT_LIGHT_COUNT]"+C4,S4+"spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]"+C4,S4+"spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]"+C4,S4+"spotLightFalloffFactor[SPOT_LIGHT_COUNT]"+C4,w4+"spotLightColor[SPOT_LIGHT_COUNT]"+C4,M4].join("\n");R5.import(I4);var A4,D4,L4,P4,E4=A2.extend(function(){return{color:[1,1,1],intensity:1,castShadow:!0,shadowResolution:512,group:0}},{type:"",clone:function(){var t=A2.prototype.clone.call(this);return t.color=Array.prototype.slice.call(this.color),t.intensity=this.intensity,t.castShadow=this.castShadow,t.shadowResolution=this.shadowResolution,t}}),O4=function(t,e){this.normal=t||new W1(0,1,0),this.distance=e||0};O4.prototype={constructor:O4,distanceToPoint:function(t){return k1.dot(t.array,this.normal.array)-this.distance},projectPoint:function(t,e){e||(e=new W1);var n=this.distanceToPoint(t);return k1.scaleAndAdd(e.array,t.array,this.normal.array,-n),e._dirty=!0,e},normalize:function(){var t=1/k1.len(this.normal.array);k1.scale(this.normal.array,t),this.distance*=t},intersectFrustum:function(t){for(var e=t.vertices,n=this.normal.array,r=k1.dot(e[0].array,n)>this.distance,i=1;i<8;i++)if(k1.dot(e[i].array,n)>this.distance!=r)return!0},intersectLine:(P4=k1.create(),function(t,e,n){var r=this.distanceToPoint(t),i=this.distanceToPoint(e);if(r>0&&i>0||r<0&&i<0)return null;var o=this.normal.array,a=this.distance,s=t.array;k1.sub(P4,e.array,t.array),k1.normalize(P4,P4);var l=k1.dot(o,P4);if(0===l)return null;n||(n=new W1);var u=(k1.dot(o,s)-a)/l;return k1.scaleAndAdd(n.array,s,P4,-u),n._dirty=!0,n}),applyTransform:(A4=s2.create(),D4=j1.create(),L4=j1.create(),L4[3]=1,function(t){t=t.array,k1.scale(L4,this.normal.array,this.distance),j1.transformMat4(L4,L4,t),this.distance=k1.dot(L4,this.normal.array),s2.invert(A4,t),s2.transpose(A4,A4),D4[3]=0,k1.copy(D4,this.normal.array),j1.transformMat4(D4,D4,A4),k1.copy(this.normal.array,D4)}),copy:function(t){k1.copy(this.normal.array,t.normal.array),this.normal._dirty=!0,this.distance=t.distance},clone:function(){var t=new O4;return t.copy(this),t}};var N4,R4=O4,k4=k1.set,z4=k1.copy,B4=k1.transformMat4,V4=Math.min,F4=Math.max,G4=function(){this.planes=[];for(var t=0;t<6;t++)this.planes.push(new R4);this.boundingBox=new M2,this.vertices=[];for(t=0;t<8;t++)this.vertices[t]=k1.fromValues(0,0,0)};G4.prototype={setFromProjection:function(t){var e=this.planes,n=t.array,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],u=n[6],h=n[7],c=n[8],d=n[9],p=n[10],f=n[11],g=n[12],m=n[13],v=n[14],y=n[15];k4(e[0].normal.array,a-r,h-s,f-c),e[0].distance=-(y-g),e[0].normalize(),k4(e[1].normal.array,a+r,h+s,f+c),e[1].distance=-(y+g),e[1].normalize(),k4(e[2].normal.array,a+i,h+l,f+d),e[2].distance=-(y+m),e[2].normalize(),k4(e[3].normal.array,a-i,h-l,f-d),e[3].distance=-(y-m),e[3].normalize(),k4(e[4].normal.array,a-o,h-u,f-p),e[4].distance=-(y-v),e[4].normalize(),k4(e[5].normal.array,a+o,h+u,f+p),e[5].distance=-(y+v),e[5].normalize();var _=this.boundingBox,x=this.vertices;if(0===y){var b=l/r,w=-v/(p-1),S=-v/(p+1),T=-S/l,M=-w/l;_.min.set(-T*b,-T,S),_.max.set(T*b,T,w),k4(x[0],-T*b,-T,S),k4(x[1],-T*b,T,S),k4(x[2],T*b,-T,S),k4(x[3],T*b,T,S),k4(x[4],-M*b,-M,w),k4(x[5],-M*b,M,w),k4(x[6],M*b,-M,w),k4(x[7],M*b,M,w)}else{var C=(-1-g)/r,I=(1-g)/r,A=(1-m)/l,D=(-1-m)/l,L=(-1-v)/p,P=(1-v)/p;_.min.set(Math.min(C,I),Math.min(D,A),Math.min(P,L)),_.max.set(Math.max(I,C),Math.max(A,D),Math.max(L,P));var E=_.min.array,O=_.max.array;k4(x[0],E[0],E[1],E[2]),k4(x[1],E[0],O[1],E[2]),k4(x[2],O[0],E[1],E[2]),k4(x[3],O[0],O[1],E[2]),k4(x[4],E[0],E[1],O[2]),k4(x[5],E[0],O[1],O[2]),k4(x[6],O[0],E[1],O[2]),k4(x[7],O[0],O[1],O[2])}},getTransformedBoundingBox:(N4=k1.create(),function(t,e){var n=this.vertices,r=e.array,i=t.min,o=t.max,a=i.array,s=o.array,l=n[0];B4(N4,l,r),z4(a,N4),z4(s,N4);for(var u=1;u<8;u++)l=n[u],B4(N4,l,r),a[0]=V4(N4[0],a[0]),a[1]=V4(N4[1],a[1]),a[2]=V4(N4[2],a[2]),s[0]=F4(N4[0],s[0]),s[1]=F4(N4[1],s[1]),s[2]=F4(N4[2],s[2]);return i._dirty=!0,o._dirty=!0,t})};var H4,U4,W4,X4,j4=G4,Z4=1e-5,Y4=function(t,e){this.origin=t||new W1,this.direction=e||new W1};Y4.prototype={constructor:Y4,intersectPlane:function(t,e){var n=t.normal.array,r=t.distance,i=this.origin.array,o=this.direction.array,a=k1.dot(n,o);if(0===a)return null;e||(e=new W1);var s=(k1.dot(n,i)-r)/a;return k1.scaleAndAdd(e.array,i,o,-s),e._dirty=!0,e},mirrorAgainstPlane:function(t){var e=k1.dot(t.normal.array,this.direction.array);k1.scaleAndAdd(this.direction.array,this.direction.array,t.normal.array,2*-e),this.direction._dirty=!0},distanceToPoint:function(){var t=k1.create();return function(e){k1.sub(t,e,this.origin.array);var n=k1.dot(t,this.direction.array);if(n<0)return k1.distance(this.origin.array,e);var r=k1.lenSquared(t);return Math.sqrt(r-n*n)}}(),intersectSphere:function(){var t=k1.create();return function(e,n,r){var i=this.origin.array,o=this.direction.array;e=e.array,k1.sub(t,e,i);var a=k1.dot(t,o),s=k1.squaredLength(t)-a*a,l=n*n;if(!(s>l)){var u=Math.sqrt(l-s),h=a-u,c=a+u;return r||(r=new W1),h<0?c<0?null:(k1.scaleAndAdd(r.array,i,o,c),r):(k1.scaleAndAdd(r.array,i,o,h),r)}}}(),intersectBoundingBox:function(t,e){var n,r,i,o,a,s,l=this.direction.array,u=this.origin.array,h=t.min.array,c=t.max.array,d=1/l[0],p=1/l[1],f=1/l[2];if(d>=0?(n=(h[0]-u[0])*d,r=(c[0]-u[0])*d):(r=(h[0]-u[0])*d,n=(c[0]-u[0])*d),p>=0?(i=(h[1]-u[1])*p,o=(c[1]-u[1])*p):(o=(h[1]-u[1])*p,i=(c[1]-u[1])*p),n>o||i>r)return null;if((i>n||n!=n)&&(n=i),(o<r||r!=r)&&(r=o),f>=0?(a=(h[2]-u[2])*f,s=(c[2]-u[2])*f):(s=(h[2]-u[2])*f,a=(c[2]-u[2])*f),n>s||a>r)return null;if((a>n||n!=n)&&(n=a),(s<r||r!=r)&&(r=s),r<0)return null;var g=n>=0?n:r;return e||(e=new W1),k1.scaleAndAdd(e.array,u,l,g),e},intersectTriangle:(H4=k1.create(),U4=k1.create(),W4=k1.create(),X4=k1.create(),function(t,e,n,r,i,o){var a=this.direction.array,s=this.origin.array;t=t.array,e=e.array,n=n.array,k1.sub(H4,e,t),k1.sub(U4,n,t),k1.cross(X4,U4,a);var l=k1.dot(H4,X4);if(r){if(l>-1e-5)return null}else if(l>-1e-5&&l<Z4)return null;k1.sub(W4,s,t);var u=k1.dot(X4,W4)/l;if(u<0||u>1)return null;k1.cross(X4,H4,W4);var h=k1.dot(a,X4)/l;if(h<0||h>1||u+h>1)return null;k1.cross(X4,H4,U4);var c=-k1.dot(W4,X4)/l;return c<0?null:(i||(i=new W1),o&&W1.set(o,1-u-h,u,h),k1.scaleAndAdd(i.array,s,a,c),i)}),applyTransform:function(t){W1.add(this.direction,this.direction,this.origin),W1.transformMat4(this.origin,this.origin,t),W1.transformMat4(this.direction,this.direction,t),W1.sub(this.direction,this.direction,this.origin),W1.normalize(this.direction,this.direction)},copy:function(t){W1.copy(this.origin,t.origin),W1.copy(this.direction,t.direction)},clone:function(){var t=new Y4;return t.copy(this),t}};var q4,K4=Y4,J4=A2.extend(function(){return{projectionMatrix:new v2,invProjectionMatrix:new v2,viewMatrix:new v2,frustum:new j4}},function(){this.update(!0)},{update:function(t){A2.prototype.update.call(this,t),v2.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),v2.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(t){v2.copy(this.viewMatrix,t),v2.invert(this.worldTransform,t),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(t){v2.copy(this.projectionMatrix,t),v2.invert(this.invProjectionMatrix,t),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(q4=j1.create(),function(t,e){var n=void 0!==e?e:new K4,r=t.array[0],i=t.array[1];return j1.set(q4,r,i,-1,1),j1.transformMat4(q4,q4,this.invProjectionMatrix.array),j1.transformMat4(q4,q4,this.worldTransform.array),k1.scale(n.origin.array,q4,1/q4[3]),j1.set(q4,r,i,1,1),j1.transformMat4(q4,q4,this.invProjectionMatrix.array),j1.transformMat4(q4,q4,this.worldTransform.array),k1.scale(q4,q4,1/q4[3]),k1.sub(n.direction.array,q4,n.origin.array),k1.normalize(n.direction.array,n.direction.array),n.direction._dirty=!0,n.origin._dirty=!0,n})}),Q4=J4,$4=s2.create(),t6=s2.create(),e6={};function n6(t){var e=[],n=Object.keys(t);n.sort();for(var r=0;r<n.length;r++){var i=n[r];e.push(i+" "+t[i])}var o=e.join("\n");if(e6[o])return e6[o];var a=A1.genGUID();return e6[o]=a,a}function r6(){this.opaque=[],this.transparent=[],this._opaqueCount=0,this._transparentCount=0}r6.prototype.startCount=function(){this._opaqueCount=0,this._transparentCount=0},r6.prototype.add=function(t,e){e?this.transparent[this._transparentCount++]=t:this.opaque[this._opaqueCount++]=t},r6.prototype.endCount=function(){this.transparent.length=this._transparentCount,this.opaque.length=this._opaqueCount};var i6,o6,a6=A2.extend(function(){return{material:null,lights:[],viewBoundingBoxLastFrame:new M2,shadowUniforms:{},_cameraList:[],_lightUniforms:{},_previousLightNumber:{},_lightNumber:{},_lightProgramKeys:{},_nodeRepository:{},_renderLists:new V3(20)}},function(){this._scene=this},{addToScene:function(t){t instanceof Q4?(this._cameraList.length>0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(t)):t instanceof E4&&this.lights.push(t),t.name&&(this._nodeRepository[t.name]=t)},removeFromScene:function(t){var e;t instanceof Q4?(e=this._cameraList.indexOf(t))>=0&&this._cameraList.splice(e,1):t instanceof E4&&(e=this.lights.indexOf(t))>=0&&this.lights.splice(e,1),t.name&&delete this._nodeRepository[t.name]},getNode:function(t){return this._nodeRepository[t]},setMainCamera:function(t){var e=this._cameraList.indexOf(t);e>=0&&this._cameraList.splice(e,1),this._cameraList.unshift(t)},getMainCamera:function(){return this._cameraList[0]},getLights:function(){return this.lights},updateLights:function(){var t=this.lights;this._previousLightNumber=this._lightNumber;for(var e={},n=0;n<t.length;n++){var r=t[n];if(!r.invisible){var i=r.group;e[i]||(e[i]={}),e[i][r.type]=e[i][r.type]||0,e[i][r.type]++}}for(var o in this._lightNumber=e,e)this._lightProgramKeys[o]=n6(e[o]);this._updateLightUniforms()},cloneNode:function(t){var e=t.clone(),n={};return function t(e,r){n[e.__uid__]=r;for(var i=0;i<e._children.length;i++){t(e._children[i],r._children[i])}}(t,e),e.traverse(function(t){t.skeleton&&(t.skeleton=t.skeleton.clone(n)),t.material&&(t.material=t.material.clone())}),e},updateRenderList:function(t,e){var n=t.__uid__,r=this._renderLists.get(n);r||(r=new r6,this._renderLists.put(n,r)),r.startCount(),e&&(this.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),this.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0));var i=this.material&&this.material.transparent||!1;return this._doUpdateRenderList(this,t,i,r,e),r.endCount(),r},getRenderList:function(t){return this._renderLists.get(t.__uid__)},_doUpdateRenderList:function(t,e,n,r,i){if(!t.invisible)for(var o=0;o<t._children.length;o++){var a=t._children[o];if(a.isRenderable()){var s=a.isSkinnedMesh()?$4:a.worldTransform.array,l=a.geometry;s2.multiplyAffine(t6,e.viewMatrix.array,s),(i&&!l.boundingBox||!this.isFrustumCulled(a,e,t6))&&r.add(a,a.material.transparent||n)}a._children.length>0&&this._doUpdateRenderList(a,e,n,r,i)}},isFrustumCulled:(i6=new M2,o6=new v2,function(t,e,n){var r=t.boundingBox;if(r||(r=t.skeleton&&t.skeleton.boundingBox?t.skeleton.boundingBox:t.geometry.boundingBox),!r)return!1;if(o6.array=n,i6.transformFrom(r,o6),t.castShadow&&this.viewBoundingBoxLastFrame.union(i6),t.frustumCulling){if(!i6.intersectBoundingBox(e.frustum.boundingBox))return!0;o6.array=e.projectionMatrix.array,i6.max.array[2]>0&&i6.min.array[2]<0&&(i6.max.array[2]=-1e-20),i6.applyProjection(o6);var i=i6.min.array,o=i6.max.array;if(o[0]<-1||i[0]>1||o[1]<-1||i[1]>1||o[2]<-1||i[2]>1)return!0}return!1}),_updateLightUniforms:function(){var t=this.lights;t.sort(s6);var e=this._lightUniforms;for(var n in e)for(var r in e[n])e[n][r].value.length=0;for(var i=0;i<t.length;i++){var o=t[i];if(!o.invisible){n=o.group;for(var r in o.uniformTemplates){var a=o.uniformTemplates[r],s=a.value(o);if(null!=s){e[n]||(e[n]={}),e[n][r]||(e[n][r]={type:"",value:[]});var l=e[n][r];switch(l.type=a.type+"v",a.type){case"1i":case"1f":case"t":l.value.push(s);break;case"2f":case"3f":case"4f":for(var u=0;u<s.length;u++)l.value.push(s[u]);break;default:console.error("Unkown light uniform type "+a.type)}}}}}},getLightGroups:function(){var t=[];for(var e in this._lightNumber)t.push(e);return t},getNumberChangedLightGroups:function(){var t=[];for(var e in this._lightNumber)this.isLightNumberChanged(e)&&t.push(e);return t},isLightNumberChanged:function(t){var e=this._previousLightNumber,n=this._lightNumber;for(var r in n[t]){if(!e[t])return!0;if(n[t][r]!==e[t][r])return!0}for(var r in e[t]){if(!n[t])return!0;if(n[t][r]!==e[t][r])return!0}return!1},getLightsNumbers:function(t){return this._lightNumber[t]},getProgramKey:function(t){return this._lightProgramKeys[t]},setLightUniforms:function(){function t(t,e,n){for(var r in t){var i=t[r];if("tv"===i.type){if(!e.hasUniform(r))continue;for(var o=[],a=0;a<i.value.length;a++){var s=i.value[a],l=e.takeCurrentTextureSlot(n,s);o.push(l)}e.setUniform(n.gl,"1iv",r,o)}else e.setUniform(n.gl,i.type,r,i.value)}}return function(e,n,r){t(this._lightUniforms[n],e,r),t(this.shadowUniforms,e,r)}}(),dispose:function(){this.material=null,this._opaqueList=[],this._transparentList=[],this.lights=[],this._lightUniforms={},this._lightNumber={},this._nodeRepository={}}});function s6(t,e){if(e.castShadow&&!t.castShadow)return!0}var l6=a6,u6=i4.isPowerOfTwo,h6=["px","nx","py","ny","pz","nz"],c6=n4.extend(function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}},{textureType:"textureCube",update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(t);var n=this.format,r=this.type;e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_S,this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_T,this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var i=t.getGLExtension("EXT_texture_filter_anisotropic");(i&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_CUBE_MAP,i.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===r)&&(t.getGLExtension("OES_texture_half_float")||(r=$2));if(this.mipmaps.length)for(var o=this.width,a=this.height,s=0;s<this.mipmaps.length;s++){var l=this.mipmaps[s];this._updateTextureData(e,l,s,o,a,n,r),o/=2,a/=2}else this._updateTextureData(e,this,0,this.width,this.height,n,r),!this.NPOT&&this.useMipmap&&e.generateMipmap(e.TEXTURE_CUBE_MAP);e.bindTexture(e.TEXTURE_CUBE_MAP,null)},_updateTextureData:function(t,e,n,r,i,o,a){for(var s=0;s<6;s++){var l=h6[s],u=e.image&&e.image[l];u?t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+s,n,o,o,a,u):t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+s,n,o,r,i,0,o,a,e.pixels&&e.pixels[l])}},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_CUBE_MAP))},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_CUBE_MAP,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_CUBE_MAP,null)},isPowerOfTwo:function(){return this.image.px?u6(this.image.px.width)&&u6(this.image.px.height):u6(this.width)&&u6(this.height)},isRenderable:function(){return this.image.px?d6(this.image.px)&&d6(this.image.nx)&&d6(this.image.py)&&d6(this.image.ny)&&d6(this.image.pz)&&d6(this.image.nz):!(!this.width||!this.height)},load:function(t,e){var n=0,r=this;return A1.each(t,function(t,i){var o=R3.createImage();e&&(o.crossOrigin=e),o.onload=function(){0===--n&&(r.dirty(),r.trigger("success",r))},o.onerror=function(){n--},n++,o.src=t,r.image[i]=o}),this}});function d6(t){return t.width>0&&t.height>0}Object.defineProperty(c6.prototype,"width",{get:function(){return this.image&&this.image.px?this.image.px.width:this._width},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}}),Object.defineProperty(c6.prototype,"height",{get:function(){return this.image&&this.image.px?this.image.px.height:this._height},set:function(t){this.image&&this.image.px?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}});var p6=c6,f6=Q4.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var t=this.fov/180*Math.PI;this.projectionMatrix.perspective(t,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array,e=2*Math.atan(1/t[5]);this.fov=e/Math.PI*180,this.aspect=t[5]/t[0],this.near=t[14]/(t[10]-1),this.far=t[14]/(t[10]+1)},clone:function(){var t=Q4.prototype.clone.call(this);return t.fov=this.fov,t.aspect=this.aspect,t.near=this.near,t.far=this.far,t}}),g6=f6,m6="framebuffer",v6="renderbuffer",y6=v6+"_width",_6=v6+"_height",x6=v6+"_attached",b6="depthtexture_attached",w6=v3,S6=y3,T6=b3,M6=x3,C6=P1.extend({depthBuffer:!0,viewport:null,_width:0,_height:0,_textures:null,_boundRenderer:null},function(){this._cache=new t4,this._textures={}},{getTextureWidth:function(){return this._width},getTextureHeight:function(){return this._height},bind:function(t){if(t.__currentFrameBuffer){if(t.__currentFrameBuffer===this)return;console.warn("Renderer already bound with another framebuffer. Unbind it first")}t.__currentFrameBuffer=this;var e=t.gl;e.bindFramebuffer(w6,this._getFrameBufferGL(t)),this._boundRenderer=t;var n=this._cache;n.put("viewport",t.viewport);var r,i,o=!1;for(var a in this._textures){o=!0;var s=this._textures[a];s&&(r=s.texture.width,i=s.texture.height,this._doAttach(t,s.texture,a,s.target))}this._width=r,this._height=i,!o&&this.depthBuffer&&console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."),this.viewport?t.setViewport(this.viewport):t.setViewport(0,0,r,i,1);var l=n.get("attached_textures");if(l)for(var a in l)if(!this._textures[a]){var u=l[a];this._doDetach(e,a,u)}if(!n.get(b6)&&this.depthBuffer){n.miss(v6)&&n.put(v6,e.createRenderbuffer());var h=n.get(v6);r===n.get(y6)&&i===n.get(_6)||(e.bindRenderbuffer(S6,h),e.renderbufferStorage(S6,e.DEPTH_COMPONENT16,r,i),n.put(y6,r),n.put(_6,i),e.bindRenderbuffer(S6,null)),n.get(x6)||(e.framebufferRenderbuffer(w6,T6,S6,h),n.put(x6,!0))}},unbind:function(t){t.__currentFrameBuffer=null,t.gl.bindFramebuffer(w6,null),this._boundRenderer=null,this._cache.use(t.__uid__);var e=this._cache.get("viewport");e&&t.setViewport(e),this.updateMipmap(t)},updateMipmap:function(t){var e=t.gl;for(var n in this._textures){var r=this._textures[n];if(r){var i=r.texture;if(!i.NPOT&&i.useMipmap&&i.minFilter===n4.LINEAR_MIPMAP_LINEAR){var o="textureCube"===i.textureType?p3:d3;e.bindTexture(o,i.getWebGLTexture(t)),e.generateMipmap(o),e.bindTexture(o,null)}}}},checkStatus:function(t){return t.checkFramebufferStatus(w6)},_getFrameBufferGL:function(t){var e=this._cache;return e.use(t.__uid__),e.miss(m6)&&e.put(m6,t.gl.createFramebuffer()),e.get(m6)},attach:function(t,e,n){if(!t.width)throw new Error("The texture attached to color buffer is not a valid.");e=e||M6,n=n||d3;var r,i=this._boundRenderer;if(i&&i.gl){var o=this._cache;o.use(i.__uid__),r=o.get("attached_textures")}var a=this._textures[e];if(!a||a.target!==n||a.texture!==t||!r||null==r[e]){var s=!0;i&&(s=this._doAttach(i,t,e,n),this.viewport||i.setViewport(0,0,t.width,t.height,1)),s&&(this._textures[e]=this._textures[e]||{},this._textures[e].texture=t,this._textures[e].target=n)}},_doAttach:function(t,e,n,r){var i=t.gl,o=e.getWebGLTexture(t),a=this._cache.get("attached_textures");if(a&&a[n]){var s=a[n];if(s.texture===e&&s.target===r)return}var l=!0;if(((n=+n)===T6||n===S3)&&(t.getGLExtension("WEBGL_depth_texture")||(console.error("Depth texture is not supported by the browser"),l=!1),e.format!==t3&&e.format!==_3&&(console.error("The texture attached to depth buffer is not a valid."),l=!1),l)){var u=this._cache.get(v6);u&&(i.framebufferRenderbuffer(w6,T6,S6,null),i.deleteRenderbuffer(u),this._cache.put(v6,!1)),this._cache.put(x6,!1),this._cache.put(b6,!0)}return i.framebufferTexture2D(w6,n,r,o,0),a||(a={},this._cache.put("attached_textures",a)),a[n]=a[n]||{},a[n].texture=e,a[n].target=r,l},_doDetach:function(t,e,n){t.framebufferTexture2D(w6,e,n,null,0);var r=this._cache.get("attached_textures");r&&r[e]&&(r[e]=null),e!==T6&&e!==S3||this._cache.put(b6,!1)},detach:function(t,e){(this._textures[t]=null,this._boundRenderer)&&(this._cache.use(this._boundRenderer.__uid__),this._doDetach(this._boundRenderer.gl,t,e))},dispose:function(t){var e=t.gl,n=this._cache;n.use(t.__uid__);var r=n.get(v6);r&&e.deleteRenderbuffer(r);var i=n.get(m6);i&&e.deleteFramebuffer(i),n.deleteContext(t.__uid__),this._textures={}}});C6.DEPTH_ATTACHMENT=T6,C6.COLOR_ATTACHMENT0=M6,C6.STENCIL_ATTACHMENT=w3,C6.DEPTH_STENCIL_ATTACHMENT=S3;var I6=C6,A6=["px","nx","py","ny","pz","nz"],D6=P1.extend(function(){var t={position:new W1,far:1e3,near:.1,texture:null,shadowMapPass:null},e=t._cameras={px:new g6({fov:90}),nx:new g6({fov:90}),py:new g6({fov:90}),ny:new g6({fov:90}),pz:new g6({fov:90}),nz:new g6({fov:90})};return e.px.lookAt(W1.POSITIVE_X,W1.NEGATIVE_Y),e.nx.lookAt(W1.NEGATIVE_X,W1.NEGATIVE_Y),e.py.lookAt(W1.POSITIVE_Y,W1.POSITIVE_Z),e.ny.lookAt(W1.NEGATIVE_Y,W1.NEGATIVE_Z),e.pz.lookAt(W1.POSITIVE_Z,W1.NEGATIVE_Y),e.nz.lookAt(W1.NEGATIVE_Z,W1.NEGATIVE_Y),t._frameBuffer=new I6,t},{getCamera:function(t){return this._cameras[t]},render:function(t,e,n){var r=t.gl;n||e.update();for(var i=this.texture.width,o=2*Math.atan(i/(i-.5))/Math.PI*180,a=0;a<6;a++){var s=A6[a],l=this._cameras[s];if(W1.copy(l.position,this.position),l.far=this.far,l.near=this.near,l.fov=o,this.shadowMapPass){l.update();var u=e.getBoundingBox();u.applyTransform(l.viewMatrix),e.viewBoundingBoxLastFrame.copy(u),this.shadowMapPass.render(t,e,l,!0)}this._frameBuffer.attach(this.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+a),this._frameBuffer.bind(t),t.render(e,l,!0),this._frameBuffer.unbind(t)}},dispose:function(t){this._frameBuffer.dispose(t)}}),L6=D6,P6=b4.extend({dynamic:!1,widthSegments:1,heightSegments:1},function(){this.build()},{build:function(){for(var t=this.heightSegments,e=this.widthSegments,n=this.attributes,r=[],i=[],o=[],a=[],s=0;s<=t;s++)for(var l=s/t,u=0;u<=e;u++){var h=u/e;if(r.push([2*h-1,2*l-1,0]),i&&i.push([h,l]),o&&o.push([0,0,1]),u<e&&s<t){var c=u+s*(e+1);a.push([c,c+1,c+e+1]),a.push([c+e+1,c+1,c+e+2])}}n.position.fromArray(r),n.texcoord0.fromArray(i),n.normal.fromArray(o),this.initIndicesFromArray(a),this.boundingBox=new M2,this.boundingBox.min.set(-1,-1,0),this.boundingBox.max.set(1,1,0)}}),E6=P6,O6=new v2,N6=b4.extend({dynamic:!1,widthSegments:1,heightSegments:1,depthSegments:1,inside:!1},function(){this.build()},{build:function(){var t={px:R6("px",this.depthSegments,this.heightSegments),nx:R6("nx",this.depthSegments,this.heightSegments),py:R6("py",this.widthSegments,this.depthSegments),ny:R6("ny",this.widthSegments,this.depthSegments),pz:R6("pz",this.widthSegments,this.heightSegments),nz:R6("nz",this.widthSegments,this.heightSegments)},e=["position","texcoord0","normal"],n=0,r=0;for(var i in t)n+=t[i].vertexCount,r+=t[i].indices.length;for(var o=0;o<e.length;o++)this.attributes[e[o]].init(n);this.indices=new R3.Uint16Array(r);var a=0,s=0;for(var i in t){var l=t[i];for(o=0;o<e.length;o++)for(var u=e[o],h=l.attributes[u].value,c=l.attributes[u].size,d="normal"===u,p=0;p<h.length;p++){var f=h[p];this.inside&&d&&(f=-f),this.attributes[u].value[p+c*s]=f}var g=l.indices.length;for(p=0;p<l.indices.length;p++)this.indices[p+a]=s+l.indices[this.inside?g-p-1:p];a+=l.indices.length,s+=l.vertexCount}this.boundingBox=new M2,this.boundingBox.max.set(1,1,1),this.boundingBox.min.set(-1,-1,-1)}});function R6(t,e,n){O6.identity();var r=new E6({widthSegments:e,heightSegments:n});switch(t){case"px":v2.translate(O6,O6,W1.POSITIVE_X),v2.rotateY(O6,O6,Math.PI/2);break;case"nx":v2.translate(O6,O6,W1.NEGATIVE_X),v2.rotateY(O6,O6,-Math.PI/2);break;case"py":v2.translate(O6,O6,W1.POSITIVE_Y),v2.rotateX(O6,O6,-Math.PI/2);break;case"ny":v2.translate(O6,O6,W1.NEGATIVE_Y),v2.rotateX(O6,O6,Math.PI/2);break;case"pz":v2.translate(O6,O6,W1.POSITIVE_Z);break;case"nz":v2.translate(O6,O6,W1.NEGATIVE_Z),v2.rotateY(O6,O6,Math.PI)}return r.applyTransform(O6),r}var k6=N6;R5.import("@export clay.skybox.vertex\n#define SHADER_NAME skybox\nuniform mat4 world : WORLD;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nvarying vec3 v_WorldPosition;\nvoid main()\n{\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n@export clay.skybox.fragment\n#define PI 3.1415926\nuniform mat4 viewInverse : VIEWINVERSE;\n#ifdef EQUIRECTANGULAR\nuniform sampler2D environmentMap;\n#else\nuniform samplerCube environmentMap;\n#endif\nuniform float lod: 0.0;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n#ifdef EQUIRECTANGULAR\n float phi = acos(V.y);\n float theta = atan(-V.x, V.z) + PI * 0.5;\n vec2 uv = vec2(theta / 2.0 / PI, phi / PI);\n vec4 texel = decodeHDR(texture2D(environmentMap, fract(uv)));\n#else\n #if defined(LOD) || defined(SUPPORT_TEXTURE_LOD)\n vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, V, lod));\n #else\n vec4 texel = decodeHDR(textureCube(environmentMap, V));\n #endif\n#endif\n#ifdef SRGB_DECODE\n texel = sRGBToLinear(texel);\n#endif\n#ifdef TONEMAPPING\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n#ifdef SRGB_ENCODE\n texel = linearTosRGB(texel);\n#endif\n gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));\n}\n@end");var z6=I3.extend(function(){var t=new R5({vertex:R5.source("clay.skybox.vertex"),fragment:R5.source("clay.skybox.fragment")}),e=new i5({shader:t,depthMask:!1});return{scene:null,geometry:new k6,material:e,environmentMap:null,culling:!1,_dummyCamera:new g6}},function(){var t=this.scene;t&&this.attachScene(t),this.environmentMap&&this.setEnvironmentMap(this.environmentMap)},{attachScene:function(t){this.scene&&this.detachScene(),t.skybox=this,this.scene=t,t.on("beforerender",this._beforeRenderScene,this)},detachScene:function(){this.scene&&(this.scene.off("beforerender",this._beforeRenderScene),this.scene.skybox=null),this.scene=null},dispose:function(t){this.detachScene(),this.geometry.dispose(t)},setEnvironmentMap:function(t){"texture2D"===t.textureType?(this.material.define("EQUIRECTANGULAR"),t.minFilter=n4.LINEAR):this.material.undefine("EQUIRECTANGULAR"),this.material.set("environmentMap",t)},getEnvironmentMap:function(){return this.material.get("environmentMap")},_beforeRenderScene:function(t,e,n){this.renderSkybox(t,n)},renderSkybox:function(t,e){var n=this._dummyCamera;n.aspect=t.getViewportAspect(),n.fov=e.fov||50,n.updateProjectionMatrix(),v2.invert(n.invProjectionMatrix,n.projectionMatrix),n.worldTransform.copy(e.worldTransform),n.viewMatrix.copy(e.viewMatrix),this.position.copy(e.getWorldPosition()),this.update(),t.gl.disable(t.gl.BLEND),this.material.get("lod")>0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),t.renderPass([this],n)}}),B6=z6;function V6(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}var F6=V6("DXT1"),G6=V6("DXT3"),H6=V6("DXT5"),U6={parse:function(t,e){var n=new Int32Array(t,0,31);if(542327876!==n[0])return null;if(4&!n(20))return null;var r,i,o=n(21),a=n[4],s=n[3],l=512&n[28],u=131072&n[2];switch(o){case F6:r=8,i=n4.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case G6:r=16,i=n4.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case H6:r=16,i=n4.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var h=n[1]+4,c=l?6:1,d=1;u&&(d=Math.max(1,n[7]));for(var p=[],f=0;f<c;f++){var g=a,m=s;p[f]=new l4({width:g,height:m,format:i});for(var v=[],y=0;y<d;y++){var _=Math.max(4,g)/4*Math.max(4,m)/4*r,x=new Uint8Array(t,h,_);h+=_,g*=.5,m*=.5,v[y]=x}p[f].pixels=v[0],u&&(p[f].mipmaps=v)}if(!e)return p[0];e.width=p[0].width,e.height=p[0].height,e.format=p[0].format,e.pixels=p[0].pixels,e.mipmaps=p[0].mipmaps}},W6=U6,X6=String.fromCharCode;function j6(t,e,n,r){if(t[3]>0){var i=Math.pow(2,t[3]-128-8+r);e[n+0]=t[0]*i,e[n+1]=t[1]*i,e[n+2]=t[2]*i}else e[n+0]=0,e[n+1]=0,e[n+2]=0;return e[n+3]=1,e}function Z6(t,e){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]}function Y6(t,e,n,r){for(var i=0,o=0,a=r;a>0;)if(t[o][0]=e[n++],t[o][1]=e[n++],t[o][2]=e[n++],t[o][3]=e[n++],1===t[o][0]&&1===t[o][1]&&1===t[o][2]){for(var s=t[o][3]<<i>>>0;s>0;s--)Z6(t[o-1],t[o]),o++,a--;i+=8}else o++,a--,i=0;return n}function q6(t,e,n,r){if(r<8|r>32767)return Y6(t,e,n,r);if(2!=(i=e[n++]))return Y6(t,e,n-1,r);if(t[0][1]=e[n++],t[0][2]=e[n++],i=e[n++],(t[0][2]<<8>>>0|i)>>>0!==r)return null;for(var i=0;i<4;i++)for(var o=0;o<r;){var a=e[n++];if(a>128){a=(127&a)>>>0;for(var s=e[n++];a--;)t[o++][i]=s}else for(;a--;)t[o++][i]=e[n++]}return n}var K6={parseRGBE:function(t,e,n){null==n&&(n=0);var r=new Uint8Array(t),i=r.length;if("#?"===function(t,e,n){for(var r="",i=e;i<n;i++)r+=X6(t[i]);return r}(r,0,2)){for(var o=2;o<i&&("\n"!==X6(r[o])||"\n"!==X6(r[o+1]));o++);if(!(o>=i)){o+=2;for(var a="";o<i;o++){var s=X6(r[o]);if("\n"===s)break;a+=s}var l=a.split(" "),u=parseInt(l[1]),h=parseInt(l[3]);if(h&&u){for(var c=o+1,d=[],p=0;p<h;p++){d[p]=[];for(var f=0;f<4;f++)d[p][f]=0}for(var g=new Float32Array(h*u*4),m=0,v=0;v<u;v++){if(!(c=q6(d,r,c,h)))return null;for(p=0;p<h;p++)j6(d[p],g,m,n),m+=4}return e||(e=new l4),e.width=h,e.height=u,e.pixels=g,e.type=n4.FLOAT,e}}}},parseRGBEFromPNG:function(t){}},J6=K6,Q6={loadTexture:function(t,e,n,r){var i;if("function"==typeof e?(r=n=e,e={}):e=e||{},"string"==typeof t){if(t.match(/.hdr$/)||"hdr"===e.fileType)return i=new l4({width:0,height:0,sRGB:!1}),Q6._fetchTexture(t,function(t){J6.parseRGBE(t,i,e.exposure),i.dirty(),n&&n(i)},r),i;t.match(/.dds$/)||"dds"===e.fileType?(i=new l4({width:0,height:0}),Q6._fetchTexture(t,function(t){W6.parse(t,i),i.dirty(),n&&n(i)},r)):((i=new l4).load(t),i.success(n),i.error(r))}else"object"==typeof t&&void 0!==t.px&&((i=new p6).load(t),i.success(n),i.error(r));return i},loadPanorama:function(t,e,n,r,i,o){var a=this;"function"==typeof r?(o=i=r,r={}):r=r||{},Q6.loadTexture(e,r,function(e){e.flipY=r.flipY||!1,a.panoramaToCubeMap(t,e,n,r),e.dispose(t),i&&i(n)},o)},panoramaToCubeMap:function(t,e,n,r){var i=new L6,o=new B6({scene:new l6});return o.setEnvironmentMap(e),(r=r||{}).encodeRGBM&&o.material.define("fragment","RGBM_ENCODE"),n.sRGB=e.sRGB,i.texture=n,i.render(t,o.scene),i.texture=null,i.dispose(t),n},heightToNormal:function(t,e){var n=document.createElement("canvas"),r=n.width=t.width,i=n.height=t.height,o=n.getContext("2d");o.drawImage(t,0,0,r,i),e=e||!1;for(var a=o.getImageData(0,0,r,i),s=o.createImageData(r,i),l=0;l<a.data.length;l+=4){if(e){var u=a.data[l],h=a.data[l+1],c=a.data[l+2];if(Math.abs(u-h)+Math.abs(h-c)>20)return console.warn("Given image is not a height map"),t}var d,p,f,g;l%(4*r)==0?(d=a.data[l],f=a.data[l+4]):l%(4*r)==4*(r-1)?(d=a.data[l-4],f=a.data[l]):(d=a.data[l-4],f=a.data[l+4]),l<4*r?(p=a.data[l],g=a.data[l+4*r]):l>r*(i-1)*4?(p=a.data[l-4*r],g=a.data[l]):(p=a.data[l-4*r],g=a.data[l+4*r]),s.data[l]=d-f+127,s.data[l+1]=p-g+127,s.data[l+2]=255,s.data[l+3]=255}return o.putImageData(s,0,0),n},isHeightImage:function(t,e,n){if(!t||!t.width||!t.height)return!1;var r=document.createElement("canvas"),i=r.getContext("2d"),o=e||32;n=n||20,r.width=r.height=o,i.drawImage(t,0,0,o,o);for(var a=i.getImageData(0,0,o,o),s=0;s<a.data.length;s+=4){var l=a.data[s],u=a.data[s+1],h=a.data[s+2];if(Math.abs(l-u)+Math.abs(u-h)>n)return!1}return!0},_fetchTexture:function(t,e,n){R3.request.get({url:t,responseType:"arraybuffer",onload:e,onerror:n})},createChessboard:function(t,e,n,r){t=t||512,e=e||64,n=n||"black",r=r||"white";var i=Math.ceil(t/e),o=document.createElement("canvas");o.width=t,o.height=t;var a=o.getContext("2d");a.fillStyle=r,a.fillRect(0,0,t,t),a.fillStyle=n;for(var s=0;s<i;s++)for(var l=0;l<i;l++){(l%2?s%2:s%2-1)&&a.fillRect(s*e,l*e,e,e)}return new l4({image:o,anisotropic:8})},createBlank:function(t){var e=document.createElement("canvas");e.width=1,e.height=1;var n=e.getContext("2d");return n.fillStyle=t,n.fillRect(0,0,1,1),new l4({image:e})}},$6=Q6;function t8(t){return t&&"object"==typeof t&&!Array.isArray(t)&&"function"==typeof t.count&&"function"==typeof t.getItem&&"function"!=typeof t.getSource&&(t.getSource=function(){return{sourceFormat:"original",seriesLayoutBy:"column",startIndex:0,dimensionsDefine:null}},null==t.persistent&&(t.persistent=!0)),t}function e8(t,e){if(!t.__ECGLOnRefresh){t.__ECGLOnRefresh=!0;var n=t._refresh?"_refresh":"refreshImmediately",r=t[n];t[n]=function(){r.apply(this,arguments),e()}}}var n8=["mousedown","mouseup","mousemove","mouseover","mouseout","click","dblclick","contextmenu"];function r8(t){return"_on"+t}var i8=function(t){var e=this;this._texture=new l4({anisotropic:32,flipY:!1,surface:this,dispose:function(t){e.dispose(),l4.prototype.dispose.call(this,t)}}),n8.forEach(function(t){this[r8(t)]=function(e){e.triangle&&this._meshes.forEach(function(n){this.dispatchEvent(t,n,e.triangle,e.point)},this)}},this),this._meshes=[],t&&this.setECharts(t),this.onupdate=null};i8.prototype={constructor:i8,getTexture:function(){return this._texture},setECharts:function(t){this._chart=t;var e=t.getDom();if(e instanceof HTMLCanvasElement){var n=this;e8(t.getZr(),function(){n._texture.dirty(),n.onupdate&&n.onupdate()})}else console.error("ECharts must init on canvas if it is used as texture."),e=document.createElement("canvas");this._texture.image=e,this._texture.dirty(),this.onupdate&&this.onupdate()},dispatchEvent:function(){var t=new W1,e=new W1,n=new W1,r=new u5,i=new u5,o=new u5,a=new u5,s=new W1;return function(l,u,h,c){var d=u.geometry,p=d.attributes.position,f=d.attributes.texcoord0,g=W1.dot,m=W1.cross;p.get(h[0],t.array),p.get(h[1],e.array),p.get(h[2],n.array),f.get(h[0],r.array),f.get(h[1],i.array),f.get(h[2],o.array),m(s,e,n);var v=g(t,s),y=g(c,s)/v;m(s,n,t);var _=g(c,s)/v;m(s,t,e);var x=g(c,s)/v;u5.scale(a,r,y),u5.scaleAndAdd(a,a,i,_),u5.scaleAndAdd(a,a,o,x);var b=a.x*this._chart.getWidth(),w=a.y*this._chart.getHeight();this._chart.getZr().handler.dispatch(l,{zrX:b,zrY:w})}}(),attachToMesh:function(t){this._meshes.indexOf(t)>=0||(n8.forEach(function(e){t.on(e,this[r8(e)],this)},this),this._meshes.push(t))},detachFromMesh:function(t){var e=this._meshes.indexOf(t);e>=0&&this._meshes.splice(e,1),n8.forEach(function(e){t.off(e,this[r8(e)])},this)},dispose:function(){this._meshes.forEach(function(t){this.detachFromMesh(t)},this)}};var o8=i8,a8=Q4.extend({left:-1,right:1,near:-1,far:1,top:1,bottom:-1},{updateProjectionMatrix:function(){this.projectionMatrix.ortho(this.left,this.right,this.bottom,this.top,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array;this.left=(-1-t[12])/t[0],this.right=(1-t[12])/t[0],this.top=(1-t[13])/t[5],this.bottom=(-1-t[13])/t[5],this.near=-(-1-t[14])/t[10],this.far=-(1-t[14])/t[10]},clone:function(){var t=Q4.prototype.clone.call(this);return t.left=this.left,t.right=this.right,t.near=this.near,t.far=this.far,t.top=this.top,t.bottom=this.bottom,t}}),s8=a8;R5.import("\n@export clay.compositor.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nvarying vec2 v_Texcoord;\nvoid main()\n{\n v_Texcoord = texcoord;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end");var l8=new E6,u8=new I3({geometry:l8,frustumCulling:!1}),h8=new s8,c8=P1.extend(function(){return{fragment:"",outputs:null,material:null,blendWithPrevious:!1,clearColor:!1,clearDepth:!0}},function(){var t=new R5(R5.source("clay.compositor.vertex"),this.fragment),e=new i5({shader:t});e.enableTexturesAll(),this.material=e},{setUniform:function(t,e){this.material.setUniform(t,e)},getUniform:function(t){var e=this.material.uniforms[t];if(e)return e.value},attachOutput:function(t,e){this.outputs||(this.outputs={}),e=e||x3,this.outputs[e]=t},detachOutput:function(t){for(var e in this.outputs)this.outputs[e]===t&&(this.outputs[e]=null)},bind:function(t,e){if(this.outputs)for(var n in this.outputs){var r=this.outputs[n];r&&e.attach(r,n)}e&&e.bind(t)},unbind:function(t,e){e.unbind(t)},render:function(t,e){var n=t.gl;if(e){this.bind(t,e);var r=t.getGLExtension("EXT_draw_buffers");if(r&&this.outputs){var i=[];for(var o in this.outputs)(o=+o)>=n.COLOR_ATTACHMENT0&&o<=n.COLOR_ATTACHMENT0+8&&i.push(o);r.drawBuffersEXT(i)}}this.trigger("beforerender",this,t);var a=this.clearDepth?n.DEPTH_BUFFER_BIT:0;if(n.depthMask(!0),this.clearColor){a|=n.COLOR_BUFFER_BIT,n.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&n.clearColor(s[0],s[1],s[2],s[3])}n.clear(a),this.blendWithPrevious?(n.enable(n.BLEND),this.material.transparent=!0):(n.disable(n.BLEND),this.material.transparent=!1),this.renderQuad(t),this.trigger("afterrender",this,t),e&&this.unbind(t,e)},renderQuad:function(t){u8.material=this.material,t.renderPass([u8],h8)},dispose:function(t){}}),d8={},p8=["px","nx","py","ny","pz","nz"];d8.prefilterEnvironmentMap=function(t,e,n,r,i){i&&r||(r=d8.generateNormalDistribution(),i=d8.integrateBRDF(t,r));var o=(n=n||{}).width||64,a=n.height||64,s=n.type||e.type,l=new p6({width:o,height:a,type:s,flipY:!1,mipmaps:[]});l.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var u=Math.min(o,a),h=Math.log(u)/Math.log(2)+1,c=new i5({shader:new R5({vertex:R5.source("clay.skybox.vertex"),fragment:"#define SHADER_NAME prefilter\n#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform mat4 viewInverse : VIEWINVERSE;\nuniform samplerCube environmentMap;\nuniform sampler2D normalDistribution;\nuniform float roughness : 0.5;\nvarying vec2 v_Texcoord;\nvarying vec3 v_WorldPosition;\n@import clay.util.rgbm\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvoid main() {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(v_WorldPosition - eyePos);\n vec3 N = V;\n vec3 prefilteredColor = vec3(0.0);\n float totalWeight = 0.0;\n float fMaxSampleNumber = float(SAMPLE_NUMBER);\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(dot(N, L), 0.0, 1.0);\n if (NoL > 0.0) {\n prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;\n totalWeight += NoL;\n }\n }\n gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));\n}\n"})});c.set("normalDistribution",r),n.encodeRGBM&&c.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&c.define("fragment","RGBM_DECODE");var d,p=new l6;if("texture2D"===e.textureType){var f=new p6({width:o,height:a,type:s===n4.FLOAT?n4.HALF_FLOAT:s});$6.panoramaToCubeMap(t,e,f,{encodeRGBM:n.decodeRGBM}),e=f}(d=new B6({scene:p,material:c})).material.set("environmentMap",e);var g=new L6({texture:l});n.encodeRGBM&&(s=l.type=n4.UNSIGNED_BYTE);for(var m=new l4({width:o,height:a,type:s}),v=new I6({depthBuffer:!1}),y=R3[s===n4.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],_=0;_<h;_++){l.mipmaps[_]={pixels:{}},d.material.set("roughness",_/(h-1));for(var x=m.width,b=2*Math.atan(x/(x-.5))/Math.PI*180,w=0;w<p8.length;w++){var S=new y(m.width*m.height*4);v.attach(m),v.bind(t);var T=g.getCamera(p8[w]);T.fov=b,t.render(p,T),t.gl.readPixels(0,0,m.width,m.height,n4.RGBA,s,S),v.unbind(t),l.mipmaps[_].pixels[p8[w]]=S}m.width/=2,m.height/=2,m.dirty()}return v.dispose(t),m.dispose(t),d.dispose(t),r.dispose(t),{environmentMap:l,brdfLookup:i,normalDistribution:r,maxMipmapLevel:h}},d8.integrateBRDF=function(t,e){e=e||d8.generateNormalDistribution();var n=new I6({depthBuffer:!1}),r=new c8({fragment:"#define SAMPLE_NUMBER 1024\n#define PI 3.14159265358979\nuniform sampler2D normalDistribution;\nuniform vec2 viewportSize : [512, 256];\nconst vec3 N = vec3(0.0, 0.0, 1.0);\nconst float fSampleNumber = float(SAMPLE_NUMBER);\nvec3 importanceSampleNormal(float i, float roughness, vec3 N) {\n vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;\n vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nfloat G_Smith(float roughness, float NoV, float NoL) {\n float k = roughness * roughness / 2.0;\n float G1V = NoV / (NoV * (1.0 - k) + k);\n float G1L = NoL / (NoL * (1.0 - k) + k);\n return G1L * G1V;\n}\nvoid main() {\n vec2 uv = gl_FragCoord.xy / viewportSize;\n float NoV = uv.x;\n float roughness = uv.y;\n vec3 V;\n V.x = sqrt(1.0 - NoV * NoV);\n V.y = 0.0;\n V.z = NoV;\n float A = 0.0;\n float B = 0.0;\n for (int i = 0; i < SAMPLE_NUMBER; i++) {\n vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);\n vec3 L = reflect(-V, H);\n float NoL = clamp(L.z, 0.0, 1.0);\n float NoH = clamp(H.z, 0.0, 1.0);\n float VoH = clamp(dot(V, H), 0.0, 1.0);\n if (NoL > 0.0) {\n float G = G_Smith(roughness, NoV, NoL);\n float G_Vis = G * VoH / (NoH * NoV);\n float Fc = pow(1.0 - VoH, 5.0);\n A += (1.0 - Fc) * G_Vis;\n B += Fc * G_Vis;\n }\n }\n gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);\n}\n"}),i=new l4({width:512,height:256,type:n4.HALF_FLOAT,wrapS:n4.CLAMP_TO_EDGE,wrapT:n4.CLAMP_TO_EDGE,minFilter:n4.NEAREST,magFilter:n4.NEAREST,useMipmap:!1});return r.setUniform("normalDistribution",e),r.setUniform("viewportSize",[512,256]),r.attachOutput(i),r.render(t,n),n.dispose(t),i},d8.generateNormalDistribution=function(t,e){for(var n=new l4({width:t=t||256,height:e=e||1024,type:n4.FLOAT,minFilter:n4.NEAREST,magFilter:n4.NEAREST,wrapS:n4.CLAMP_TO_EDGE,wrapT:n4.CLAMP_TO_EDGE,useMipmap:!1}),r=new Float32Array(e*t*4),i=[],o=0;o<t;o++){for(var a=o/t,s=a*a,l=0;l<e;l++){var u=(l<<16|l>>>16)>>>0;u=(((16711935&(u=((252645135&(u=((858993459&(u=((1431655765&u)<<1|(2863311530&u)>>>1)>>>0))<<2|(3435973836&u)>>>2)>>>0))<<4|(4042322160&u)>>>4)>>>0))<<8|(4278255360&u)>>>8)>>>0)/4294967296;var h=Math.sqrt((1-u)/(1+(s*s-1)*u));i[l]=h}for(l=0;l<e;l++){var c=4*(l*t+o),d=(h=i[l],Math.sqrt(1-h*h)),p=l/e,f=2*Math.PI*p;r[c]=d*Math.cos(f),r[c+1]=h,r[c+2]=d*Math.sin(f),r[c+3]=1}}return n.pixels=r,n};var f8=d8,g8=E4.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(t,e){if(t.getGLExtension("EXT_shader_texture_lod")){this._brdfLookup||(this._normalDistribution=f8.generateNormalDistribution(),this._brdfLookup=f8.integrateBRDF(t,this._normalDistribution));var n=this.cubemap;if(!n.__prefiltered){var r=f8.prefilterEnvironmentMap(t,n,{encodeRGBM:!0,width:e,height:e},this._normalDistribution,this._brdfLookup);this.cubemap=r.environmentMap,this.cubemap.__prefiltered=!0,n.dispose(t)}}else console.warn("Device not support textureCubeLodEXT")},getBRDFLookup:function(){return this._brdfLookup},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}},ambientCubemapLightCubemap:{type:"t",value:function(t){return t.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(t){return t._brdfLookup}}}}),m8=g8,v8=E4.extend({castShadow:!1,coefficients:[]},function(){this._coefficientsTmpArr=new R3.Float32Array(27)},{type:"AMBIENT_SH_LIGHT",uniformTemplates:{ambientSHLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}},ambientSHLightCoefficients:{type:"3f",value:function(t){for(var e=t._coefficientsTmpArr,n=0;n<t.coefficients.length;n++)e[n]=t.coefficients[n];return e}}}}),y8=v8,_8={},x8=["px","nx","py","ny","pz","nz"];function b8(t,e){var n=t[0],r=t[1],i=t[2];return 0===e?1:1===e?n:2===e?r:3===e?i:4===e?n*i:5===e?r*i:6===e?n*r:7===e?3*i*i-1:n*n-r*r}var w8={px:[2,1,0,-1,-1,1],nx:[2,1,0,1,-1,-1],py:[0,2,1,1,-1,-1],ny:[0,2,1,1,1,1],pz:[0,1,2,-1,-1,-1],nz:[0,1,2,1,-1,1]};_8.projectEnvironmentMap=function(t,e,n){var r;(n=n||{}).lod=n.lod||0;var i=new l6,o=64;"texture2D"===e.textureType||(o=e.image&&e.image.px?e.image.px.width:e.width),r=new B6({scene:i,environmentMap:e});var a=Math.ceil(o/Math.pow(2,n.lod)),s=Math.ceil(o/Math.pow(2,n.lod)),l=new l4({width:a,height:s}),u=new I6;r.material.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&r.material.define("fragment","RGBM_DECODE"),r.material.set("lod",n.lod);for(var h=new L6({texture:l}),c={},d=0;d<x8.length;d++){c[x8[d]]=new Uint8Array(a*s*4);var p=h.getCamera(x8[d]);p.fov=90,u.attach(l),u.bind(t),t.render(i,p),t.gl.readPixels(0,0,a,s,n4.RGBA,n4.UNSIGNED_BYTE,c[x8[d]]),u.unbind(t)}return r.dispose(t),u.dispose(t),l.dispose(t),function(t,e,n,r){for(var i=new R3.Float32Array(27),o=k1.create(),a=k1.create(),s=k1.create(),l=0;l<9;l++){for(var u=k1.create(),h=0;h<x8.length;h++){for(var c=e[x8[h]],d=k1.create(),p=0,f=0,g=w8[x8[h]],m=0;m<r;m++)for(var v=0;v<n;v++){o[0]=v/(n-1)*2-1,o[1]=m/(r-1)*2-1,o[2]=-1,k1.normalize(o,o),s[0]=o[g[0]]*g[3],s[1]=o[g[1]]*g[4],s[2]=o[g[2]]*g[5],a[0]=c[f++]/255,a[1]=c[f++]/255,a[2]=c[f++]/255;var y=c[f++]/255*8.12;a[0]*=y,a[1]*=y,a[2]*=y,k1.scaleAndAdd(d,d,a,b8(s,l)*-o[2]),p+=-o[2]}k1.scaleAndAdd(u,u,d,1/p)}i[3*l]=u[0]/6,i[3*l+1]=u[1]/6,i[3*l+2]=u[2]/6}return i}(0,c,a,s)};var S8=_8,T8={firstNotNull:function(){for(var t=0,e=arguments.length;t<e;t++)if(null!=arguments[t])return arguments[t]},queryDataIndex:function(t,e){return null!=e.dataIndexInside?e.dataIndexInside:null!=e.dataIndex?j(e.dataIndex)?V(e.dataIndex,function(e){return t.indexOfRawIndex(e)}):t.indexOfRawIndex(e.dataIndex):null!=e.name?j(e.name)?V(e.name,function(e){return t.indexOfName(e)}):t.indexOfName(e.name):void 0}},M8=T8,C8=b4.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI,radius:1},function(){this.build()},{build:function(){var t=this.heightSegments,e=this.widthSegments,n=this.attributes.position,r=this.attributes.texcoord0,i=this.attributes.normal,o=(e+1)*(t+1);n.init(o),r.init(o),i.init(o);var a,s,l,u,h,c,d,p,f,g,m,v=o>65535?Uint32Array:Uint16Array,y=this.indices=new v(e*t*6),_=this.radius,x=this.phiStart,b=this.phiLength,w=this.thetaStart,S=this.thetaLength,T=[],M=[],C=0,I=1/(_=this.radius);for(d=0;d<=t;d++)for(c=0;c<=e;c++)u=c/e,h=d/t,a=-_*Math.cos(x+u*b)*Math.sin(w+h*S),s=_*Math.cos(w+h*S),l=_*Math.sin(x+u*b)*Math.sin(w+h*S),T[0]=a,T[1]=s,T[2]=l,M[0]=u,M[1]=h,n.set(C,T),r.set(C,M),T[0]*=I,T[1]*=I,T[2]*=I,i.set(C,T),C++;var A=e+1,D=0;for(d=0;d<t;d++)for(c=0;c<e;c++)f=d*A+c,p=d*A+c+1,m=(d+1)*A+c+1,g=(d+1)*A+c,y[D++]=p,y[D++]=f,y[D++]=m,y[D++]=f,y[D++]=g,y[D++]=m;this.boundingBox=new M2,this.boundingBox.max.set(_,_,_),this.boundingBox.min.set(-_,-_,-_)}}),I8=C8,A8=E4.extend({castShadow:!1},{type:"AMBIENT_LIGHT",uniformTemplates:{ambientLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}}}}),D8=A8,L8=E4.extend({shadowBias:.001,shadowSlopeScale:2,shadowCascade:1,cascadeSplitLogFactor:.2},{type:"DIRECTIONAL_LIGHT",uniformTemplates:{directionalLightDirection:{type:"3f",value:function(t){return t.__dir=t.__dir||new W1,t.__dir.copy(t.worldTransform.z).normalize().negate().array}},directionalLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}}},clone:function(){var t=E4.prototype.clone.call(this);return t.shadowBias=this.shadowBias,t.shadowSlopeScale=this.shadowSlopeScale,t}}),P8=L8,E8=E4.extend({range:100,castShadow:!1},{type:"POINT_LIGHT",uniformTemplates:{pointLightPosition:{type:"3f",value:function(t){return t.getWorldPosition().array}},pointLightRange:{type:"1f",value:function(t){return t.range}},pointLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}}},clone:function(){var t=E4.prototype.clone.call(this);return t.range=this.range,t}}),O8=E8,N8=E4.extend({range:20,umbraAngle:30,penumbraAngle:45,falloffFactor:2,shadowBias:.001,shadowSlopeScale:2},{type:"SPOT_LIGHT",uniformTemplates:{spotLightPosition:{type:"3f",value:function(t){return t.getWorldPosition().array}},spotLightRange:{type:"1f",value:function(t){return t.range}},spotLightUmbraAngleCosine:{type:"1f",value:function(t){return Math.cos(t.umbraAngle*Math.PI/180)}},spotLightPenumbraAngleCosine:{type:"1f",value:function(t){return Math.cos(t.penumbraAngle*Math.PI/180)}},spotLightFalloffFactor:{type:"1f",value:function(t){return t.falloffFactor}},spotLightDirection:{type:"3f",value:function(t){return t.__dir=t.__dir||new W1,t.__dir.copy(t.worldTransform.z).negate().array}},spotLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}}},clone:function(){var t=E4.prototype.clone.call(this);return t.range=this.range,t.umbraAngle=this.umbraAngle,t.penumbraAngle=this.penumbraAngle,t.falloffFactor=this.falloffFactor,t.shadowBias=this.shadowBias,t.shadowSlopeScale=this.shadowSlopeScale,t}}),R8=N8,k8=function(t,e,n,r){t=t||0,e=e||0,n=n||0,r=r||0,this.array=j1.fromValues(t,e,n,r),this._dirty=!0};k8.prototype={constructor:k8,add:function(t){return j1.add(this.array,this.array,t.array),this._dirty=!0,this},set:function(t,e,n,r){return this.array[0]=t,this.array[1]=e,this.array[2]=n,this.array[3]=r,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this.array[3]=t[3],this._dirty=!0,this},clone:function(){return new k8(this.x,this.y,this.z,this.w)},copy:function(t){return j1.copy(this.array,t.array),this._dirty=!0,this},dist:function(t){return j1.dist(this.array,t.array)},distance:function(t){return j1.distance(this.array,t.array)},div:function(t){return j1.div(this.array,this.array,t.array),this._dirty=!0,this},divide:function(t){return j1.divide(this.array,this.array,t.array),this._dirty=!0,this},dot:function(t){return j1.dot(this.array,t.array)},len:function(){return j1.len(this.array)},length:function(){return j1.length(this.array)},lerp:function(t,e,n){return j1.lerp(this.array,t.array,e.array,n),this._dirty=!0,this},min:function(t){return j1.min(this.array,this.array,t.array),this._dirty=!0,this},max:function(t){return j1.max(this.array,this.array,t.array),this._dirty=!0,this},mul:function(t){return j1.mul(this.array,this.array,t.array),this._dirty=!0,this},multiply:function(t){return j1.multiply(this.array,this.array,t.array),this._dirty=!0,this},negate:function(){return j1.negate(this.array,this.array),this._dirty=!0,this},normalize:function(){return j1.normalize(this.array,this.array),this._dirty=!0,this},random:function(t){return j1.random(this.array,t),this._dirty=!0,this},scale:function(t){return j1.scale(this.array,this.array,t),this._dirty=!0,this},scaleAndAdd:function(t,e){return j1.scaleAndAdd(this.array,this.array,t.array,e),this._dirty=!0,this},sqrDist:function(t){return j1.sqrDist(this.array,t.array)},squaredDistance:function(t){return j1.squaredDistance(this.array,t.array)},sqrLen:function(){return j1.sqrLen(this.array)},squaredLength:function(){return j1.squaredLength(this.array)},sub:function(t){return j1.sub(this.array,this.array,t.array),this._dirty=!0,this},subtract:function(t){return j1.subtract(this.array,this.array,t.array),this._dirty=!0,this},transformMat4:function(t){return j1.transformMat4(this.array,this.array,t.array),this._dirty=!0,this},transformQuat:function(t){return j1.transformQuat(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var z8=Object.defineProperty;if(z8){var B8=k8.prototype;z8(B8,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),z8(B8,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),z8(B8,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),z8(B8,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}k8.add=function(t,e,n){return j1.add(t.array,e.array,n.array),t._dirty=!0,t},k8.set=function(t,e,n,r,i){j1.set(t.array,e,n,r,i),t._dirty=!0},k8.copy=function(t,e){return j1.copy(t.array,e.array),t._dirty=!0,t},k8.distance=k8.dist=function(t,e){return j1.distance(t.array,e.array)},k8.div=function(t,e,n){return j1.divide(t.array,e.array,n.array),t._dirty=!0,t},k8.divide=k8.div,k8.dot=function(t,e){return j1.dot(t.array,e.array)},k8.len=function(t){return j1.length(t.array)},k8.lerp=function(t,e,n,r){return j1.lerp(t.array,e.array,n.array,r),t._dirty=!0,t},k8.min=function(t,e,n){return j1.min(t.array,e.array,n.array),t._dirty=!0,t},k8.max=function(t,e,n){return j1.max(t.array,e.array,n.array),t._dirty=!0,t},k8.mul=function(t,e,n){return j1.multiply(t.array,e.array,n.array),t._dirty=!0,t},k8.multiply=k8.mul,k8.negate=function(t,e){return j1.negate(t.array,e.array),t._dirty=!0,t},k8.normalize=function(t,e){return j1.normalize(t.array,e.array),t._dirty=!0,t},k8.random=function(t,e){return j1.random(t.array,e),t._dirty=!0,t},k8.scale=function(t,e,n){return j1.scale(t.array,e.array,n),t._dirty=!0,t},k8.scaleAndAdd=function(t,e,n,r){return j1.scaleAndAdd(t.array,e.array,n.array,r),t._dirty=!0,t},k8.squaredDistance=k8.sqrDist=function(t,e){return j1.sqrDist(t.array,e.array)},k8.squaredLength=k8.sqrLen=function(t){return j1.sqrLen(t.array)},k8.sub=function(t,e,n){return j1.subtract(t.array,e.array,n.array),t._dirty=!0,t},k8.subtract=k8.sub,k8.transformMat4=function(t,e,n){return j1.transformMat4(t.array,e.array,n.array),t._dirty=!0,t},k8.transformQuat=function(t,e,n){return j1.transformQuat(t.array,e.array,n.array),t._dirty=!0,t};var V8=k8,F8={create:function(){var t=new O1(4);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},clone:function(t){var e=new O1(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t},transpose:function(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*o-i*r;return a?(a=1/a,t[0]=o*a,t[1]=-r*a,t[2]=-i*a,t[3]=n*a,t):null},adjoint:function(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t},determinant:function(t){return t[0]*t[3]-t[2]*t[1]},multiply:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],l=n[1],u=n[2],h=n[3];return t[0]=r*s+o*l,t[1]=i*s+a*l,t[2]=r*u+o*h,t[3]=i*u+a*h,t}};F8.mul=F8.multiply,F8.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=r*l+o*s,t[1]=i*l+a*s,t[2]=r*-s+o*l,t[3]=i*-s+a*l,t},F8.scale=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],l=n[1];return t[0]=r*s,t[1]=i*s,t[2]=o*l,t[3]=a*l,t},F8.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2))},F8.LDU=function(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]};var G8=F8,H8=function(){this.array=G8.create(),this._dirty=!0};H8.prototype={constructor:H8,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},clone:function(){return(new H8).copy(this)},copy:function(t){return G8.copy(this.array,t.array),this._dirty=!0,this},adjoint:function(){return G8.adjoint(this.array,this.array),this._dirty=!0,this},determinant:function(){return G8.determinant(this.array)},identity:function(){return G8.identity(this.array),this._dirty=!0,this},invert:function(){return G8.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return G8.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return G8.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return G8.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return G8.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return G8.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return G8.scale(this.array,this.array,t.array),this._dirty=!0,this},transpose:function(){return G8.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},H8.adjoint=function(t,e){return G8.adjoint(t.array,e.array),t._dirty=!0,t},H8.copy=function(t,e){return G8.copy(t.array,e.array),t._dirty=!0,t},H8.determinant=function(t){return G8.determinant(t.array)},H8.identity=function(t){return G8.identity(t.array),t._dirty=!0,t},H8.invert=function(t,e){return G8.invert(t.array,e.array),t._dirty=!0,t},H8.mul=function(t,e,n){return G8.mul(t.array,e.array,n.array),t._dirty=!0,t},H8.multiply=H8.mul,H8.rotate=function(t,e,n){return G8.rotate(t.array,e.array,n),t._dirty=!0,t},H8.scale=function(t,e,n){return G8.scale(t.array,e.array,n.array),t._dirty=!0,t},H8.transpose=function(t,e){return G8.transpose(t.array,e.array),t._dirty=!0,t};var U8=H8,W8={create:function(){var t=new O1(6);return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},clone:function(t){var e=new O1(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},copy:function(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},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t},invert:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=n*o-r*i;return l?(l=1/l,t[0]=o*l,t[1]=-r*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-o*a)*l,t[5]=(r*a-n*s)*l,t):null},determinant:function(t){return t[0]*t[3]-t[1]*t[2]},multiply:function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=n[0],h=n[1],c=n[2],d=n[3],p=n[4],f=n[5];return t[0]=r*u+o*h,t[1]=i*u+a*h,t[2]=r*c+o*d,t[3]=i*c+a*d,t[4]=r*p+o*f+s,t[5]=i*p+a*f+l,t}};W8.mul=W8.multiply,W8.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=Math.sin(n),h=Math.cos(n);return t[0]=r*h+o*u,t[1]=i*h+a*u,t[2]=r*-u+o*h,t[3]=i*-u+a*h,t[4]=s,t[5]=l,t},W8.scale=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=n[0],h=n[1];return t[0]=r*u,t[1]=i*u,t[2]=o*h,t[3]=a*h,t[4]=s,t[5]=l,t},W8.translate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=n[0],h=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=r*u+o*h+s,t[5]=i*u+a*h+l,t},W8.frob=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2)+Math.pow(t[3],2)+Math.pow(t[4],2)+Math.pow(t[5],2)+1)};var X8=W8,j8=function(){this.array=X8.create(),this._dirty=!0};j8.prototype={constructor:j8,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},clone:function(){return(new j8).copy(this)},copy:function(t){return X8.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return X8.determinant(this.array)},identity:function(){return X8.identity(this.array),this._dirty=!0,this},invert:function(){return X8.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return X8.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return X8.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return X8.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return X8.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return X8.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return X8.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return X8.translate(this.array,this.array,t.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},j8.copy=function(t,e){return X8.copy(t.array,e.array),t._dirty=!0,t},j8.determinant=function(t){return X8.determinant(t.array)},j8.identity=function(t){return X8.identity(t.array),t._dirty=!0,t},j8.invert=function(t,e){return X8.invert(t.array,e.array),t._dirty=!0,t},j8.mul=function(t,e,n){return X8.mul(t.array,e.array,n.array),t._dirty=!0,t},j8.multiply=j8.mul,j8.rotate=function(t,e,n){return X8.rotate(t.array,e.array,n),t._dirty=!0,t},j8.scale=function(t,e,n){return X8.scale(t.array,e.array,n.array),t._dirty=!0,t},j8.translate=function(t,e,n){return X8.translate(t.array,e.array,n.array),t._dirty=!0,t};var Z8=j8,Y8=function(){this.array=Q1.create(),this._dirty=!0};Y8.prototype={constructor:Y8,setArray:function(t){for(var e=0;e<this.array.length;e++)this.array[e]=t[e];return this._dirty=!0,this},adjoint:function(){return Q1.adjoint(this.array,this.array),this._dirty=!0,this},clone:function(){return(new Y8).copy(this)},copy:function(t){return Q1.copy(this.array,t.array),this._dirty=!0,this},determinant:function(){return Q1.determinant(this.array)},fromMat2d:function(t){return Q1.fromMat2d(this.array,t.array),this._dirty=!0,this},fromMat4:function(t){return Q1.fromMat4(this.array,t.array),this._dirty=!0,this},fromQuat:function(t){return Q1.fromQuat(this.array,t.array),this._dirty=!0,this},identity:function(){return Q1.identity(this.array),this._dirty=!0,this},invert:function(){return Q1.invert(this.array,this.array),this._dirty=!0,this},mul:function(t){return Q1.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return Q1.mul(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return Q1.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return Q1.multiply(this.array,t.array,this.array),this._dirty=!0,this},rotate:function(t){return Q1.rotate(this.array,this.array,t),this._dirty=!0,this},scale:function(t){return Q1.scale(this.array,this.array,t.array),this._dirty=!0,this},translate:function(t){return Q1.translate(this.array,this.array,t.array),this._dirty=!0,this},normalFromMat4:function(t){return Q1.normalFromMat4(this.array,t.array),this._dirty=!0,this},transpose:function(){return Q1.transpose(this.array,this.array),this._dirty=!0,this},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}},Y8.adjoint=function(t,e){return Q1.adjoint(t.array,e.array),t._dirty=!0,t},Y8.copy=function(t,e){return Q1.copy(t.array,e.array),t._dirty=!0,t},Y8.determinant=function(t){return Q1.determinant(t.array)},Y8.identity=function(t){return Q1.identity(t.array),t._dirty=!0,t},Y8.invert=function(t,e){return Q1.invert(t.array,e.array),t},Y8.mul=function(t,e,n){return Q1.mul(t.array,e.array,n.array),t._dirty=!0,t},Y8.multiply=Y8.mul,Y8.fromMat2d=function(t,e){return Q1.fromMat2d(t.array,e.array),t._dirty=!0,t},Y8.fromMat4=function(t,e){return Q1.fromMat4(t.array,e.array),t._dirty=!0,t},Y8.fromQuat=function(t,e){return Q1.fromQuat(t.array,e.array),t._dirty=!0,t},Y8.normalFromMat4=function(t,e){return Q1.normalFromMat4(t.array,e.array),t._dirty=!0,t},Y8.rotate=function(t,e,n){return Q1.rotate(t.array,e.array,n),t._dirty=!0,t},Y8.scale=function(t,e,n){return Q1.scale(t.array,e.array,n.array),t._dirty=!0,t},Y8.transpose=function(t,e){return Q1.transpose(t.array,e.array),t._dirty=!0,t},Y8.translate=function(t,e,n){return Q1.translate(t.array,e.array,n.array),t._dirty=!0,t};var q8=Y8,K8={_animators:null,getAnimators:function(){return this._animators=this._animators||[],this._animators},animate:function(t,e){this._animators=this._animators||[];var n;if(t){for(var r=t.split("."),i=this,o=0,a=r.length;o<a;o++)i&&(i=i[r[o]]);i&&(n=i)}else n=this;if(null==n)throw new Error("Target "+t+" not exists");var s=this._animators,l=new pi(n,e),u=this;return l.during(function(){u.__zr&&u.__zr.refresh()}).done(function(){var t=s.indexOf(l);t>=0&&s.splice(t,1)}),s.push(l),this.__zr&&this.__zr.animation.addAnimator(l),l},stopAnimation:function(t){this._animators=this._animators||[];for(var e=this._animators,n=e.length,r=0;r<n;r++)e[r].stop(t);return e.length=0,this},addAnimatorsToZr:function(t){if(this._animators)for(var e=0;e<this._animators.length;e++)t.animation.addAnimator(this._animators[e])},removeAnimatorsFromZr:function(t){if(this._animators)for(var e=0;e<this._animators.length;e++)t.animation.removeAnimator(this._animators[e])}},J8=K8,Q8="\n@export clay.util.rand\nhighp float rand(vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);\n return fract(sin(sn) * c);\n}\n@end\n@export clay.util.calculate_attenuation\nuniform float attenuationFactor : 5.0;\nfloat lightAttenuation(float dist, float range)\n{\n float attenuation = 1.0;\n attenuation = dist*dist/(range*range+1.0);\n float att_s = attenuationFactor;\n attenuation = 1.0/(attenuation*att_s+1.0);\n att_s = 1.0/(att_s+1.0);\n attenuation = attenuation - att_s;\n attenuation /= 1.0 - att_s;\n return clamp(attenuation, 0.0, 1.0);\n}\n@end\n@export clay.util.edge_factor\n#ifdef SUPPORT_STANDARD_DERIVATIVES\nfloat edgeFactor(float width)\n{\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#else\nfloat edgeFactor(float width)\n{\n return 1.0;\n}\n#endif\n@end\n@export clay.util.encode_float\nvec4 encodeFloat(const in float depth)\n{\n const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(depth * bitShifts);\n res -= res.xxyz * bit_mask;\n return res;\n}\n@end\n@export clay.util.decode_float\nfloat decodeFloat(const in vec4 color)\n{\n const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);\n return dot(color, bitShifts);\n}\n@end\n@export clay.util.float\n@import clay.util.encode_float\n@import clay.util.decode_float\n@end\n@export clay.util.rgbm_decode\nvec3 RGBMDecode(vec4 rgbm, float range) {\n return range * rgbm.rgb * rgbm.a;\n}\n@end\n@export clay.util.rgbm_encode\nvec4 RGBMEncode(vec3 color, float range) {\n if (dot(color, color) == 0.0) {\n return vec4(0.0);\n }\n vec4 rgbm;\n color /= range;\n rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);\n rgbm.a = ceil(rgbm.a * 255.0) / 255.0;\n rgbm.rgb = color / rgbm.a;\n return rgbm;\n}\n@end\n@export clay.util.rgbm\n@import clay.util.rgbm_decode\n@import clay.util.rgbm_encode\nvec4 decodeHDR(vec4 color)\n{\n#if defined(RGBM_DECODE) || defined(RGBM)\n return vec4(RGBMDecode(color, 8.12), 1.0);\n#else\n return color;\n#endif\n}\nvec4 encodeHDR(vec4 color)\n{\n#if defined(RGBM_ENCODE) || defined(RGBM)\n return RGBMEncode(color.xyz, 8.12);\n#else\n return color;\n#endif\n}\n@end\n@export clay.util.srgb\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);\n}\nvec4 linearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);\n}\n@end\n@export clay.chunk.skinning_header\n#ifdef SKINNING\nattribute vec3 weight : WEIGHT;\nattribute vec4 joint : JOINT;\n#ifdef USE_SKIN_MATRICES_TEXTURE\nuniform sampler2D skinMatricesTexture : ignore;\nuniform float skinMatricesTextureSize: ignore;\nmat4 getSkinMatrix(sampler2D tex, float idx) {\n float j = idx * 4.0;\n float x = mod(j, skinMatricesTextureSize);\n float y = floor(j / skinMatricesTextureSize) + 0.5;\n vec2 scale = vec2(skinMatricesTextureSize);\n return mat4(\n texture2D(tex, vec2(x + 0.5, y) / scale),\n texture2D(tex, vec2(x + 1.5, y) / scale),\n texture2D(tex, vec2(x + 2.5, y) / scale),\n texture2D(tex, vec2(x + 3.5, y) / scale)\n );\n}\nmat4 getSkinMatrix(float idx) {\n return getSkinMatrix(skinMatricesTexture, idx);\n}\n#else\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\n#endif\n@end\n@export clay.chunk.skin_matrix\nmat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;\nif (weight.y > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.chunk.instancing_header\n#ifdef INSTANCING\nattribute vec4 instanceMat1;\nattribute vec4 instanceMat2;\nattribute vec4 instanceMat3;\n#endif\n@end\n@export clay.chunk.instancing_matrix\nmat4 instanceMat = mat4(\n vec4(instanceMat1.xyz, 0.0),\n vec4(instanceMat2.xyz, 0.0),\n vec4(instanceMat3.xyz, 0.0),\n vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)\n);\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end";function $8(t){return t instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof Image}Object.assign(A2.prototype,J8),R5.import(Q8),R5.import(B5),R5.import("\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"),R5.import("@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\nattribute vec3 normal: NORMAL;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nvarying vec3 v_Normal;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef ATMOSPHERE_ENABLED\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\nvarying vec3 v_Normal;\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"),R5.import("/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),R5.import("@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef ATMOSPHERE_ENABLED\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform vec3 glowColor;\nuniform float glowPower;\n#endif\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef ATMOSPHERE_ENABLED\n float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor.rgb += glowColor * atmoIntensity;\n#endif\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"),R5.import("@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"),R5.import("@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n v_Texcoord = texcoord;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end");var t9=l6.prototype.addToScene,e9=l6.prototype.removeFromScene;l6.prototype.addToScene=function(t){if(t9.call(this,t),this.__zr){var e=this.__zr;t.traverse(function(t){t.__zr=e,t.addAnimatorsToZr&&t.addAnimatorsToZr(e)})}},l6.prototype.removeFromScene=function(t){e9.call(this,t),t.traverse(function(t){var e=t.__zr;t.__zr=null,e&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(e)})},i5.prototype.setTextureImage=function(t,e,n,r){if(this.shader){var i,o,a=n.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(t),(o=e)&&"none"!==o&&(i=n9.loadTexture(e,n,r,function(e){s.enableTexture(t),a&&a.refresh()}),s.set(t,i)),i}};var n9={};n9.Renderer=J5,n9.Node=A2,n9.Mesh=I3,n9.Shader=R5,n9.Material=i5,n9.Texture=n4,n9.Texture2D=l4,n9.Geometry=b4,n9.SphereGeometry=I8,n9.PlaneGeometry=E6,n9.CubeGeometry=k6,n9.AmbientLight=D8,n9.DirectionalLight=P8,n9.PointLight=O8,n9.SpotLight=R8,n9.PerspectiveCamera=g6,n9.OrthographicCamera=s8,n9.Vector2=u5,n9.Vector3=W1,n9.Vector4=V8,n9.Quaternion=o2,n9.Matrix2=U8,n9.Matrix2d=Z8,n9.Matrix3=q8,n9.Matrix4=v2,n9.Plane=R4,n9.Ray=K4,n9.BoundingBox=M2,n9.Frustum=j4;var r9=null;function i9(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function o9(t){if((t.wrapS===n4.REPEAT||t.wrapT===n4.REPEAT)&&t.image){var e=i9(t.width),n=i9(t.height);if(e!==t.width||n!==t.height){var r=document.createElement("canvas");r.width=e,r.height=n,r.getContext("2d").drawImage(t.image,0,0,e,n),t.image=r}}}n9.loadTexture=function(t,e,n,r){"function"==typeof n&&(r=n,n={}),n=n||{};for(var i=Object.keys(n).sort(),o="",a=0;a<i.length;a++)o+=i[a]+"_"+n[i[a]]+"_";var s,l=e.__textureCache=e.__textureCache||new hr(20);if((s=t).getZr&&s.setOption){var u=t.__textureid__;if(c=l.get(o+u))c.texture.surface.setECharts(t),r&&r(c.texture);else{var h=new o8(t);h.onupdate=function(){e.getZr().refresh()},c={texture:h.getTexture()};for(a=0;a<i.length;a++)c.texture[i[a]]=n[i[a]];u=t.__textureid__||"__ecgl_ec__"+c.texture.__uid__,t.__textureid__=u,l.put(o+u,c),r&&r(c.texture)}return c.texture}if($8(t)){var c;u=t.__textureid__;if(!(c=l.get(o+u))){c={texture:new n9.Texture2D({image:t})};for(a=0;a<i.length;a++)c.texture[i[a]]=n[i[a]];u=t.__textureid__||"__ecgl_image__"+c.texture.__uid__,t.__textureid__=u,l.put(o+u,c),o9(c.texture),r&&r(c.texture)}return c.texture}if(c=l.get(o+t))c.callbacks?c.callbacks.push(r):r&&r(c.texture);else if(t.match(/.hdr$|^data:application\/octet-stream/)){c={callbacks:[r]};var d=$6.loadTexture(t,{exposure:n.exposure,fileType:"hdr"},function(){d.dirty(),c.callbacks.forEach(function(t){t&&t(d)}),c.callbacks=null});c.texture=d,l.put(o+t,c)}else{for(d=new n9.Texture2D({image:new Image}),a=0;a<i.length;a++)d[i[a]]=n[i[a]];c={texture:d,callbacks:[r]};var p=d.image;p.onload=function(){d.image=p,o9(d),d.dirty(),c.callbacks.forEach(function(t){t&&t(d)}),c.callbacks=null},p.crossOrigin="Anonymous",p.src=t,d.image=null!==r9?r9:r9=$6.createBlank("rgba(255,255,255,0)").image,l.put(o+t,c)}return c.texture},n9.createAmbientCubemap=function(t,e,n,r){var i=(t=t||{}).texture,o=M8.firstNotNull(t.exposure,1),a=new m8({intensity:M8.firstNotNull(t.specularIntensity,1)}),s=new y8({intensity:M8.firstNotNull(t.diffuseIntensity,1),coefficients:[.844,.712,.691,-.037,.083,.167,.343,.288,.299,-.041,-.021,-.009,-.003,-.041,-.064,-.011,-.007,-.004,-.031,.034,.081,-.06,-.049,-.06,.046,.056,.05]});return a.cubemap=n9.loadTexture(i,n,{exposure:o},function(){a.cubemap.flipY=!1;var t=Date.now();a.prefilter(e,32);var n=Date.now()-t;console.log("Prefilter environment map: "+n+"ms"),s.coefficients=S8.projectEnvironmentMap(e,a.cubemap,{lod:1}),r&&r()}),{specular:a,diffuse:s}},n9.createBlankTexture=$6.createBlank,n9.isImage=$8,n9.additiveBlend=function(t){t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)},n9.parseColor=function(t,e){return t instanceof Array?(e||(e=[]),e[0]=t[0],e[1]=t[1],e[2]=t[2],t.length>3?e[3]=t[3]:e[3]=1,e):((e=Sr(t||"#000",e)||[0,0,0,0])[0]/=255,e[1]/=255,e[2]/=255,e)},n9.directionFromAlphaBeta=function(t,e){var n=t/180*Math.PI+Math.PI/2,r=-e/180*Math.PI+Math.PI/2,i=[],o=Math.sin(n);return i[0]=o*Math.cos(r),i[1]=-Math.cos(n),i[2]=o*Math.sin(r),i},n9.getShadowResolution=function(t){var e=1024;switch(t){case"low":e=512;break;case"medium":break;case"high":e=2048;break;case"ultra":e=4096}return e},n9.COMMON_SHADERS=["lambert","color","realistic","hatching","shadow"],n9.createShader=function(t){"ecgl.shadow"===t&&(t="ecgl.displayShadow");var e=R5.source(t+".vertex"),n=R5.source(t+".fragment");e||console.error("Vertex shader of '%s' not exits",t),n||console.error("Fragment shader of '%s' not exits",t);var r=new R5(e,n);return r.name=t,r},n9.createMaterial=function(t,e){e instanceof Array||(e=[e]);var n=n9.createShader(t),r=new i5({shader:n});return e.forEach(function(t){"string"==typeof t&&r.define(t)}),r},n9.setMaterialFromModel=function(t,e,n,r){e.autoUpdateTextureStatus=!1;var i=n.getModel(t+"Material"),o=i.get("detailTexture"),a=M8.firstNotNull(i.get("textureTiling"),1),s=M8.firstNotNull(i.get("textureOffset"),0);"number"==typeof a&&(a=[a,a]),"number"==typeof s&&(s=[s,s]);var l=a[0]>1||a[1]>1?n9.Texture.REPEAT:n9.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===t){var h=i.get("roughness"),c=i.get("metalness");null!=c?isNaN(c)&&(e.setTextureImage("metalnessMap",c,r,u),c=M8.firstNotNull(i.get("metalnessAdjust"),.5)):c=0,null!=h?isNaN(h)&&(e.setTextureImage("roughnessMap",h,r,u),h=M8.firstNotNull(i.get("roughnessAdjust"),.5)):h=.5;var d=i.get("normalTexture");e.setTextureImage("detailMap",o,r,u),e.setTextureImage("normalMap",d,r,u),e.set({roughness:h,metalness:c,detailUvRepeat:a,detailUvOffset:s})}else if("lambert"===t)e.setTextureImage("detailMap",o,r,u),e.set({detailUvRepeat:a,detailUvOffset:s});else if("color"===t)e.setTextureImage("detailMap",o,r,u),e.set({detailUvRepeat:a,detailUvOffset:s});else if("hatching"===t){var p=i.get("hatchingTextures")||[];p.length<6&&console.error("Invalid hatchingTextures.");for(var f=0;f<6;f++)e.setTextureImage("hatch"+(f+1),p[f],r,{anisotropic:8,wrapS:n9.Texture.REPEAT,wrapT:n9.Texture.REPEAT});e.set({detailUvRepeat:a,detailUvOffset:s})}},n9.updateVertexAnimation=function(t,e,n,r){var i=r.get("animation"),o=r.get("animationDurationUpdate"),a=r.get("animationEasingUpdate"),s=n.shadowDepthMaterial;if(i&&e&&o>0&&e.geometry.vertexCount===n.geometry.vertexCount){n.material.define("vertex","VERTEX_ANIMATION"),n.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;l<t.length;l++)n.geometry.attributes[t[l][0]].value=e.geometry.attributes[t[l][1]].value;n.geometry.dirty(),n.__percent=0,n.material.set("percent",0),n.stopAnimation(),n.animate().when(o,{__percent:1}).during(function(){n.material.set("percent",n.__percent),s&&s.set("percent",n.__percent)}).done(function(){n.ignorePreZ=!1,n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")}).start(a)}else n.material.undefine("vertex","VERTEX_ANIMATION"),s&&s.undefine("vertex","VERTEX_ANIMATION")};var a9=n9,s9=P1.extend({scene:null,camera:null,renderer:null},function(){this._ray=new K4,this._ndc=new u5},{pick:function(t,e,n){return this.pickAll(t,e,[],n)[0]||null},pickAll:function(t,e,n,r){return this.renderer.screenToNDC(t,e,this._ndc),this.camera.castRay(this._ndc,this._ray),n=n||[],this._intersectNode(this.scene,n,r||!1),n.sort(this._intersectionCompareFunc),n},_intersectNode:function(t,e,n){t instanceof M3&&t.isRenderable()&&(t.ignorePicking&&!n||!(t.mode===k2&&t.geometry.isUseIndices()||t.geometry.pickByRay||t.geometry.pick)||this._intersectRenderable(t,e));for(var r=0;r<t._children.length;r++)this._intersectNode(t._children[r],e,n)},_intersectRenderable:function(){var t=new W1,e=new W1,n=new W1,r=new K4,i=new v2;return function(o,a){var s=o.isSkinnedMesh();r.copy(this._ray),v2.invert(i,o.worldTransform),s||r.applyTransform(i);var l=o.geometry,u=s?o.skeleton.boundingBox:l.boundingBox;if(!u||r.intersectBoundingBox(u))if(l.pick)l.pick(this._ndc.x,this._ndc.y,this.renderer,this.camera,o,a);else if(l.pickByRay)l.pickByRay(r,o,a);else{var h,c,d=o.cullFace===U2&&o.frontFace===j2||o.cullFace===H2&&o.frontFace===X2,p=l.indices,f=l.attributes.position,g=l.attributes.weight,m=l.attributes.joint,v=[];if(f&&f.value&&p){if(s){c=o.skeleton.getSubSkinMatrices(o.__uid__,o.joints);for(var y=0;y<o.joints.length;y++){v[y]=v[y]||[];for(var _=0;_<16;_++)v[y][_]=c[16*y+_]}var x=[],b=[],w=[],S=[],T=[],M=l.attributes.skinnedPosition;M&&M.value||(l.createAttribute("skinnedPosition","f",3),(M=l.attributes.skinnedPosition).init(l.vertexCount));for(y=0;y<l.vertexCount;y++){f.get(y,x),g.get(y,b),m.get(y,w),b[3]=1-b[0]-b[1]-b[2],k1.set(S,0,0,0);for(_=0;_<4;_++)w[_]>=0&&b[_]>1e-4&&(k1.transformMat4(T,x,v[w[_]]),k1.scaleAndAdd(S,S,T,b[_]));M.set(y,S)}}for(y=0;y<p.length;y+=3){var C=p[y],I=p[y+1],A=p[y+2],D=s?l.attributes.skinnedPosition:f;if(D.get(C,t.array),D.get(I,e.array),D.get(A,n.array),h=d?r.intersectTriangle(t,e,n,o.culling):r.intersectTriangle(t,n,e,o.culling)){var L=new W1;s?W1.copy(L,h):W1.transformMat4(L,h,o.worldTransform),a.push(new s9.Intersection(h,L,o,[C,I,A],y/3,W1.dist(L,this._ray.origin)))}}}}}}(),_intersectionCompareFunc:function(t,e){return t.distance-e.distance}});s9.Intersection=function(t,e,n,r,i,o){this.point=t,this.pointWorld=e,this.target=n,this.triangle=r,this.triangleIndex=i,this.distance=o};var l9=s9,u9=function(t,e){this.id=t,this.zr=e;try{this.renderer=new J5({clearBit:0,devicePixelRatio:e.painter.dpr,preserveDrawingBuffer:!0,premultipliedAlpha:!0}),this.renderer.resize(e.painter.getWidth(),e.painter.getHeight())}catch(t){return this.renderer=null,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute; left: 0; top: 0; right: 0; bottom: 0;",this.dom.className="ecgl-nowebgl",this.dom.innerHTML="Sorry, your browser does not support WebGL",void console.error(t)}this.onglobalout=this.onglobalout.bind(this),e.on("globalout",this.onglobalout),this.dom=this.renderer.canvas;var n=this.dom.style;n.position="absolute",n.left="0",n.top="0",this.views=[],this._picking=new l9({renderer:this.renderer}),this._viewsToDispose=[],this._accumulatingId=0,this._zrEventProxy=new Ru({shape:{x:-1,y:-1,width:2,height:2},__isGLToZRProxy:!0}),this._backgroundColor=null,this._disposed=!1};function h9(t){var e=t.__zr;t.__zr=null,e&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(e)}u9.prototype.setUnpainted=function(){},u9.prototype.addView=function(t){if(t.layer!==this){var e=this._viewsToDispose.indexOf(t);e>=0&&this._viewsToDispose.splice(e,1),this.views.push(t),t.layer=this;var n=this.zr;t.scene.traverse(function(t){t.__zr=n,t.addAnimatorsToZr&&t.addAnimatorsToZr(n)})}},u9.prototype.removeView=function(t){if(t.layer===this){var e=this.views.indexOf(t);e>=0&&(this.views.splice(e,1),t.scene.traverse(h9,this),t.layer=null,this._viewsToDispose.push(t))}},u9.prototype.removeViewsAll=function(){this.views.forEach(function(t){t.scene.traverse(h9,this),t.layer=null,this._viewsToDispose.push(t)},this),this.views.length=0},u9.prototype.resize=function(t,e){this.renderer.resize(t,e)},u9.prototype.clear=function(){var t=this.renderer.gl,e=this._backgroundColor||[0,0,0,0];t.clearColor(e[0],e[1],e[2],e[3]),t.depthMask(!0),t.colorMask(!0,!0,!0,!0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT)},u9.prototype.clearDepth=function(){var t=this.renderer.gl;t.clear(t.DEPTH_BUFFER_BIT)},u9.prototype.clearColor=function(){var t=this.renderer.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},u9.prototype.needsRefresh=function(){this.zr.refresh()},u9.prototype.refresh=function(t){this._backgroundColor=t?a9.parseColor(t):[0,0,0,0],this.renderer.clearColor=this._backgroundColor;for(var e=0;e<this.views.length;e++)this.views[e].prepareRender(this.renderer);this._doRender(!1),this._trackAndClean();for(e=0;e<this._viewsToDispose.length;e++)this._viewsToDispose[e].dispose(this.renderer);this._viewsToDispose.length=0,this._startAccumulating()},u9.prototype.renderToCanvas=function(t){this._startAccumulating(!0),t.drawImage(this.dom,0,0,t.canvas.width,t.canvas.height)},u9.prototype._doRender=function(t){this.clear(),this.renderer.saveViewport();for(var e=0;e<this.views.length;e++)this.views[e].render(this.renderer,t);this.renderer.restoreViewport()},u9.prototype._stopAccumulating=function(){this._accumulatingId=0,clearTimeout(this._accumulatingTimeout)};var c9=1;function d9(t){for(var e=0;e<t.length;e++)t[e].__used__=0}function p9(t,e){for(var n=0;n<e.length;n++)e[n].__used__||e[n].dispose(t)}function f9(t,e){t.__used__=t.__used__||0,t.__used__++,1===t.__used__&&e.push(t)}function g9(t,e,n){var r,i;t.traverse(function(t){if(t.isRenderable()){var o=t.geometry,a=t.material;if(a!==r)for(var s=a.getTextureUniforms(),l=0;l<s.length;l++){var u=s[l],h=a.uniforms[u].value;if(h)if(h instanceof n4)f9(h,e);else if(h instanceof Array)for(var c=0;c<h.length;c++)h[c]instanceof n4&&f9(h[c],e)}o!==i&&f9(o,n),r=a,i=o}});for(var o=0;o<t.lights.length;o++)t.lights[o].cubemap&&f9(t.lights[o].cubemap,e)}u9.prototype._startAccumulating=function(t){var e=this;this._stopAccumulating();for(var n=!1,r=0;r<this.views.length;r++)n=this.views[r].needsAccumulate()||n;function i(r){if(e._accumulatingId&&r===e._accumulatingId){for(var o=!0,a=0;a<e.views.length;a++)o=e.views[a].isAccumulateFinished()&&n;o||(e._doRender(!0),t?i(r):Pn(function(){i(r)}))}}n&&(this._accumulatingId=c9++,t?i(e._accumulatingId):this._accumulatingTimeout=setTimeout(function(){i(e._accumulatingId)},50))},u9.prototype._trackAndClean=function(){var t=[],e=[];this._textureList&&(d9(this._textureList),d9(this._geometriesList));for(var n=0;n<this.views.length;n++)g9(this.views[n].scene,t,e);this._textureList&&(p9(this.renderer,this._textureList),p9(this.renderer,this._geometriesList)),this._textureList=t,this._geometriesList=e},u9.prototype.dispose=function(){this._disposed||(this._stopAccumulating(),this._textureList&&(d9(this._textureList),d9(this._geometriesList),p9(this.renderer,this._textureList),p9(this.renderer,this._geometriesList)),this.zr.off("globalout",this.onglobalout),this._disposed=!0)},u9.prototype.onmousedown=function(t){if(!t.target||!t.target.__isGLToZRProxy){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY);e&&(this._dispatchEvent("mousedown",t,e),this._dispatchDataEvent("mousedown",t,e)),this._downX=t.offsetX,this._downY=t.offsetY}},u9.prototype.onmousemove=function(t){if(!t.target||!t.target.__isGLToZRProxy){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY),n=e&&e.target,r=this._hovered;this._hovered=e,r&&n!==r.target&&(r.relatedTarget=n,this._dispatchEvent("mouseout",t,r),this.zr.setCursorStyle("default")),this._dispatchEvent("mousemove",t,e),e&&(this.zr.setCursorStyle("pointer"),r&&n===r.target||this._dispatchEvent("mouseover",t,e)),this._dispatchDataEvent("mousemove",t,e)}},u9.prototype.onmouseup=function(t){if(!t.target||!t.target.__isGLToZRProxy){t=t.event;var e=this.pickObject(t.offsetX,t.offsetY);e&&(this._dispatchEvent("mouseup",t,e),this._dispatchDataEvent("mouseup",t,e)),this._upX=t.offsetX,this._upY=t.offsetY}},u9.prototype.onclick=u9.prototype.dblclick=function(t){if(!t.target||!t.target.__isGLToZRProxy){var e=this._upX-this._downX,n=this._upY-this._downY;if(!(Math.sqrt(e*e+n*n)>20)){t=t.event;var r=this.pickObject(t.offsetX,t.offsetY);r&&(this._dispatchEvent(t.type,t,r),this._dispatchDataEvent(t.type,t,r));var i=this._clickToSetFocusPoint(t);if(i)i.view.setDOFFocusOnPoint(i.distance)&&this.zr.refresh()}}},u9.prototype._clickToSetFocusPoint=function(t){for(var e=this.renderer,n=e.viewport,r=this.views.length-1;r>=0;r--){var i=this.views[r];if(i.hasDOF()&&i.containPoint(t.offsetX,t.offsetY)){this._picking.scene=i.scene,this._picking.camera=i.camera,e.viewport=i.viewport;var o=this._picking.pick(t.offsetX,t.offsetY,!0);if(o)return o.view=i,o}}e.viewport=n},u9.prototype.onglobalout=function(t){var e=this._hovered;e&&this._dispatchEvent("mouseout",t,{target:e.target})},u9.prototype.pickObject=function(t,e){for(var n=[],r=this.renderer,i=r.viewport,o=0;o<this.views.length;o++){var a=this.views[o];a.containPoint(t,e)&&(this._picking.scene=a.scene,this._picking.camera=a.camera,r.viewport=a.viewport,this._picking.pickAll(t,e,n))}return r.viewport=i,n.sort(function(t,e){return t.distance-e.distance}),n[0]},u9.prototype._dispatchEvent=function(t,e,n){n||(n={});var r=n.target;for(n.cancelBubble=!1,n.event=e,n.type=t,n.offsetX=e.offsetX,n.offsetY=e.offsetY;r&&(r.trigger(t,n),r=r.getParent(),!n.cancelBubble););this._dispatchToView(t,n)},u9.prototype._dispatchDataEvent=function(t,e,n){var r=n&&n.target,i=r&&r.dataIndex,o=r&&r.seriesIndex,a=r&&r.eventData,s=!1,l=this._zrEventProxy;l.x=e.offsetX,l.y=e.offsetY,l.update();var u={target:l};const h=$u(l);"mousemove"===t&&(null!=i?i!==this._lastDataIndex&&(parseInt(this._lastDataIndex,10)>=0&&(h.dataIndex=this._lastDataIndex,h.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0):null!=a&&a!==this._lastEventData&&(null!=this._lastEventData&&(h.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0),this._lastEventData=a,this._lastDataIndex=i,this._lastSeriesIndex=o),h.eventData=a,h.dataIndex=i,h.seriesIndex=o,(null!=a||parseInt(i,10)>=0&&parseInt(o,10)>=0)&&(this.zr.handler.dispatchToElement(u,t,e),s&&this.zr.handler.dispatchToElement(u,"mouseover",e))},u9.prototype._dispatchToView=function(t,e){for(var n=0;n<this.views.length;n++)this.views[n].containPoint(e.offsetX,e.offsetY)&&this.views[n].trigger(t,e)},Object.assign(u9.prototype,T1);var m9=u9,v9=["bar3D","line3D","map3D","scatter3D","surface","lines3D","scatterGL","scatter3D"];function y9(t,e){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var n=t[e].normal,r=t[e].emphasis;n&&(t[e]=n),r&&(t.emphasis=t.emphasis||{},t.emphasis[e]=r)}}function _9(t){t&&(t instanceof Array||(t=[t]),B(t,function(t){if(t.axisLabel){var e=t.axisLabel;Object.assign(e,e.textStyle),e.textStyle=null}}))}function x9(t,e,n){try{return Object.defineProperty(t,e,{value:n,configurable:!0,writable:!0}),!0}catch(t){}try{return Reflect.set(t,e,n)}catch(t){}return!1}var b9=y1;function w9(t){this._layers={},this._zr=t}x9(b9,"graphicGL",a9),w9.prototype.update=function(t,e){var n=this,r=e.getZr();if(r.getWidth()&&r.getHeight()){for(var i in this._layers)this._layers[i].removeViewsAll();t.eachComponent(function(n,r){if("series"!==n){var i=e.getViewOfComponentModel(r),s=r.coordinateSystem;if(i.__ecgl__){if(s){if(!s.viewGL)return void console.error("Can't find viewGL in coordinateSystem of component "+r.id);l=s.viewGL}else{if(!r.viewGL)return void console.error("Can't find viewGL of component "+r.id);l=s.viewGL}var l=s.viewGL,u=o(r);u.addView(l),i.afterRender&&i.afterRender(r,t,e,u),a(i.groupGL,r.get("silent"))}}}),t.eachSeries(function(n){var r=e.getViewOfSeriesModel(n),i=n.coordinateSystem;if(r.__ecgl__){if(i&&!i.viewGL&&!r.viewGL)return void console.error("Can't find viewGL of series "+r.id);var s=i&&i.viewGL||r.viewGL,l=o(n);l.addView(s),r.afterRender&&r.afterRender(n,t,e,l),a(r.groupGL,n.get("silent"))}})}else console.warn("Dom has no width or height");function o(t){var e;r.setSleepAfterStill(0),e=(t.coordinateSystem&&t.coordinateSystem.model,t.get("zlevel"));var i=n._layers,o=i[e];if(!o){if(o=i[e]=new m9("gl-"+e,r),r.painter.isSingleCanvas()){o.virtual=!0;var a=new b9.graphic.Image({z:1e4,style:{image:o.renderer.canvas},silent:!0});o.__hostImage=a,r.add(a)}r.painter.insertLayer(e,o)}return o.__hostImage&&o.__hostImage.setStyle({width:o.renderer.getWidth(),height:o.renderer.getHeight()}),o}function a(t,e){t&&t.traverse(function(t){t.isRenderable&&t.isRenderable()&&(t.ignorePicking=null!=t.$ignorePicking?t.$ignorePicking:e)})}},b9.registerPostInit(function(t){var e=t.getZr(),n=e.painter.dispose;e.painter.dispose=function(){"function"==typeof this.eachOtherLayer&&this.eachOtherLayer(function(t){t instanceof m9&&t.dispose()}),n.call(this)}}),b9.registerPostUpdate(function(t,e){var n=e.getZr();(n.__egl=n.__egl||new w9(n)).update(t,e)}),b9.registerPreprocessor(function(t){B(t.series,function(e){N(v9,e.type)>=0&&(!function(t){y9(t,"itemStyle"),y9(t,"lineStyle"),y9(t,"areaStyle"),y9(t,"label")}(e),"mapbox"===e.coordinateSystem&&(e.coordinateSystem="mapbox3D",t.mapbox3D=t.mapbox))}),_9(t.xAxis3D),_9(t.yAxis3D),_9(t.zAxis3D),_9(t.grid3D),y9(t.geo3D)});var S9={defaultOption:{viewControl:{projection:"perspective",autoRotate:!1,autoRotateDirection:"cw",autoRotateSpeed:10,autoRotateAfterStill:3,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",distance:150,minDistance:40,maxDistance:400,orthographicSize:150,maxOrthographicSize:400,minOrthographicSize:20,center:[0,0,0],alpha:0,beta:0,minAlpha:-90,maxAlpha:90}},setView:function(t){t=t||{},this.option.viewControl=this.option.viewControl||{},null!=t.alpha&&(this.option.viewControl.alpha=t.alpha),null!=t.beta&&(this.option.viewControl.beta=t.beta),null!=t.distance&&(this.option.viewControl.distance=t.distance),null!=t.center&&(this.option.viewControl.center=t.center)}},T9={defaultOption:{postEffect:{enable:!1,bloom:{enable:!0,intensity:.1},depthOfField:{enable:!1,focalRange:20,focalDistance:50,blurRadius:10,fstop:2.8,quality:"medium"},screenSpaceAmbientOcclusion:{enable:!1,radius:2,quality:"medium",intensity:1},screenSpaceReflection:{enable:!1,quality:"medium",maxRoughness:.8},colorCorrection:{enable:!0,exposure:0,brightness:0,contrast:1,saturation:1,lookupTexture:""},edge:{enable:!1},FXAA:{enable:!1}},temporalSuperSampling:{enable:"auto"}}},M9={defaultOption:{light:{main:{shadow:!1,shadowQuality:"high",color:"#fff",intensity:1,alpha:0,beta:0},ambient:{color:"#fff",intensity:.2},ambientCubemap:{texture:null,exposure:1,diffuseIntensity:.5,specularIntensity:.5}}}},C9=tm.extend({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});A(C9.prototype,S9),A(C9.prototype,T9),A(C9.prototype,M9);var I9=C9,A9=M8.firstNotNull,D9={left:0,middle:1,right:2};function L9(t){return t instanceof Array||(t=[t,t]),t}var P9=P1.extend(function(){return{zr:null,viewGL:null,_center:new W1,minDistance:.5,maxDistance:1.5,maxOrthographicSize:300,minOrthographicSize:30,minAlpha:-90,maxAlpha:90,minBeta:-1/0,maxBeta:1/0,autoRotateAfterStill:0,autoRotateDirection:"cw",autoRotateSpeed:60,damping:.8,rotateSensitivity:1,zoomSensitivity:1,panSensitivity:1,panMouseButton:"middle",rotateMouseButton:"left",_mode:"rotate",_camera:null,_needsUpdate:!1,_rotating:!1,_phi:0,_theta:0,_mouseX:0,_mouseY:0,_rotateVelocity:new u5,_panVelocity:new u5,_distance:500,_zoomSpeed:0,_stillTimeout:0,_animators:[]}},function(){["_mouseDownHandler","_mouseWheelHandler","_mouseMoveHandler","_mouseUpHandler","_pinchHandler","_contextMenuHandler","_update"].forEach(function(t){this[t]=this[t].bind(this)},this)},{init:function(){var t=this.zr;t&&(t.on("mousedown",this._mouseDownHandler),t.on("globalout",this._mouseUpHandler),t.on("mousewheel",this._mouseWheelHandler),t.on("pinch",this._pinchHandler),t.animation.on("frame",this._update),t.dom.addEventListener("contextmenu",this._contextMenuHandler))},dispose:function(){var t=this.zr;t&&(t.off("mousedown",this._mouseDownHandler),t.off("mousemove",this._mouseMoveHandler),t.off("mouseup",this._mouseUpHandler),t.off("mousewheel",this._mouseWheelHandler),t.off("pinch",this._pinchHandler),t.off("globalout",this._mouseUpHandler),t.dom.removeEventListener("contextmenu",this._contextMenuHandler),t.animation.off("frame",this._update)),this.stopAllAnimation()},getDistance:function(){return this._distance},setDistance:function(t){this._distance=t,this._needsUpdate=!0},getOrthographicSize:function(){return this._orthoSize},setOrthographicSize:function(t){this._orthoSize=t,this._needsUpdate=!0},getAlpha:function(){return this._theta/Math.PI*180},getBeta:function(){return-this._phi/Math.PI*180},getCenter:function(){return this._center.toArray()},setAlpha:function(t){t=Math.max(Math.min(this.maxAlpha,t),this.minAlpha),this._theta=t/180*Math.PI,this._needsUpdate=!0},setBeta:function(t){t=Math.max(Math.min(this.maxBeta,t),this.minBeta),this._phi=-t/180*Math.PI,this._needsUpdate=!0},setCenter:function(t){this._center.setArray(t)},setViewGL:function(t){this.viewGL=t},getCamera:function(){return this.viewGL.camera},setFromViewControlModel:function(t,e){var n=(e=e||{}).baseDistance||0,r=e.baseOrthoSize||1,i=t.get("projection");"perspective"!==i&&"orthographic"!==i&&"isometric"!==i&&(console.error("Unkown projection type %s, use perspective projection instead.",i),i="perspective"),this._projection=i,this.viewGL.setProjection(i);var o=t.get("distance")+n,a=t.get("orthographicSize")+r;[["damping",.8],["autoRotate",!1],["autoRotateAfterStill",3],["autoRotateDirection","cw"],["autoRotateSpeed",10],["minDistance",30],["maxDistance",400],["minOrthographicSize",30],["maxOrthographicSize",300],["minAlpha",-90],["maxAlpha",90],["minBeta",-1/0],["maxBeta",1/0],["rotateSensitivity",1],["zoomSensitivity",1],["panSensitivity",1],["panMouseButton","left"],["rotateMouseButton","middle"]].forEach(function(e){this[e[0]]=A9(t.get(e[0]),e[1])},this),this.minDistance+=n,this.maxDistance+=n,this.minOrthographicSize+=r,this.maxOrthographicSize+=r;var s=t.ecModel,l={};["animation","animationDurationUpdate","animationEasingUpdate"].forEach(function(e){l[e]=A9(t.get(e),s&&s.get(e))});var u=A9(e.alpha,t.get("alpha"))||0,h=A9(e.beta,t.get("beta"))||0,c=A9(e.center,t.get("center"))||[0,0,0];l.animation&&l.animationDurationUpdate>0&&this._notFirst?this.animateTo({alpha:u,beta:h,center:c,distance:o,orthographicSize:a,easing:l.animationEasingUpdate,duration:l.animationDurationUpdate}):(this.setDistance(o),this.setAlpha(u),this.setBeta(h),this.setCenter(c),this.setOrthographicSize(a)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){null==D9[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==D9[this.rotateMouseButton]&&console.error("Unkown rotateMouseButton %s. It should be left|middle|right",this.rotateMouseButton),"cw"!==this.autoRotateDirection&&"ccw"!==this.autoRotateDirection&&console.error("Unkown autoRotateDirection %s. It should be cw|ccw",this.autoRotateDirection)},animateTo:function(t){var e=this.zr,n=this,r={},i={};return null!=t.distance&&(r.distance=this.getDistance(),i.distance=t.distance),null!=t.orthographicSize&&(r.orthographicSize=this.getOrthographicSize(),i.orthographicSize=t.orthographicSize),null!=t.alpha&&(r.alpha=this.getAlpha(),i.alpha=t.alpha),null!=t.beta&&(r.beta=this.getBeta(),i.beta=t.beta),null!=t.center&&(r.center=this.getCenter(),i.center=t.center),this._addAnimator(e.animation.animate(r).when(t.duration||1e3,i).during(function(){null!=r.alpha&&n.setAlpha(r.alpha),null!=r.beta&&n.setBeta(r.beta),null!=r.distance&&n.setDistance(r.distance),null!=r.center&&n.setCenter(r.center),null!=r.orthographicSize&&n.setOrthographicSize(r.orthographicSize),n._needsUpdate=!0})).start(t.easing||"linear")},stopAllAnimation:function(){for(var t=0;t<this._animators.length;t++)this._animators[t].stop();this._animators.length=0},update:function(){this._needsUpdate=!0,this._update(20)},_isAnimating:function(){return this._animators.length>0},_update:function(t){if(this._rotating){var e=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=e*t/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(t=Math.min(t,50),this._updateDistanceOrSize(t),this._updatePan(t),this._updateRotate(t),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(t){var e=this._rotateVelocity;this._phi=e.y*t/20+this._phi,this._theta=e.x*t/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(e,Math.pow(this.damping,t/16))},_updateDistanceOrSize:function(t){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*t/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*t/20),this._zoomSpeed*=Math.pow(this.damping,t/16)},_setDistance:function(t){this._distance=Math.max(Math.min(t,this.maxDistance),this.minDistance)},_setOrthoSize:function(t){this._orthoSize=Math.max(Math.min(t,this.maxOrthographicSize),this.minOrthographicSize);var e=this.getCamera(),n=this._orthoSize,r=n/this.viewGL.viewport.height*this.viewGL.viewport.width;e.left=-r/2,e.right=r/2,e.top=n/2,e.bottom=-n/2},_updatePan:function(t){var e=this._panVelocity,n=this._distance,r=this.getCamera(),i=r.worldTransform.y,o=r.worldTransform.x;this._center.scaleAndAdd(o,-e.x*n/200).scaleAndAdd(i,-e.y*n/200),this._vectorDamping(e,0)},_updateTransform:function(){var t=this.getCamera(),e=new W1,n=this._theta+Math.PI/2,r=this._phi+Math.PI/2,i=Math.sin(n);e.x=i*Math.cos(r),e.y=-Math.cos(n),e.z=i*Math.sin(r),t.position.copy(this._center).scaleAndAdd(e,this._distance),t.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var t=this.autoRotateAfterStill,e=this;!isNaN(t)&&t>0&&(this._stillTimeout=setTimeout(function(){e._rotating=!0},1e3*t))},_vectorDamping:function(t,e){var n=t.len();(n*=e)<1e-4&&(n=0),t.normalize().scale(n)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var t=this.getCamera().worldTransform.z,e=Math.asin(t.y),n=Math.atan2(t.x,t.z);this._theta=e,this._phi=-n,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(t){if(!t.target&&!this._isAnimating()){var e=t.offsetX,n=t.offsetY;this.viewGL&&!this.viewGL.containPoint(e,n)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),t.event.targetTouches?1===t.event.targetTouches.length&&(this._mode="rotate"):t.event.button===D9[this.rotateMouseButton]?this._mode="rotate":t.event.button===D9[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=t.offsetX,this._mouseY=t.offsetY)}},_mouseMoveHandler:function(t){if(!(t.target&&t.target.__isGLToZRProxy||this._isAnimating())){var e=L9(this.panSensitivity),n=L9(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(t.offsetX-this._mouseX)/this.zr.getHeight()*2*n[0],this._rotateVelocity.x=(t.offsetY-this._mouseY)/this.zr.getWidth()*2*n[1]):"pan"===this._mode&&(this._panVelocity.x=(t.offsetX-this._mouseX)/this.zr.getWidth()*e[0]*400,this._panVelocity.y=(-t.offsetY+this._mouseY)/this.zr.getHeight()*e[1]*400),this._mouseX=t.offsetX,this._mouseY=t.offsetY,t.event.preventDefault()}},_mouseWheelHandler:function(t){if(!this._isAnimating()){var e=t.event.wheelDelta||-t.event.detail;this._zoomHandler(t,e)}},_pinchHandler:function(t){this._isAnimating()||(this._zoomHandler(t,t.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(t,e){if(0!==e){var n,r=t.offsetX,i=t.offsetY;if(!this.viewGL||this.viewGL.containPoint(r,i))n="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(e>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),t.event.preventDefault()}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(t){this._isRightMouseButtonUsed()&&t.preventDefault()},_addAnimator:function(t){var e=this._animators;return e.push(t),t.done(function(){var n=e.indexOf(t);n>=0&&e.splice(n,1)}),t}});Object.defineProperty(P9.prototype,"autoRotate",{get:function(t){return this._autoRotate},set:function(t){this._autoRotate=t,this._rotating=t}});var E9=P9,O9={convertToDynamicArray:function(t){t&&this.resetOffset();var e=this.attributes;for(var n in e)t||!e[n].value?e[n].value=[]:e[n].value=Array.prototype.slice.call(e[n].value);t||!this.indices?this.indices=[]:this.indices=Array.prototype.slice.call(this.indices)},convertToTypedArray:function(){var t=this.attributes;for(var e in t)t[e].value&&t[e].value.length>0?t[e].value=new Float32Array(t[e].value):t[e].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}},N9={vec2:a5,vec3:k1,vec4:j1,mat2:G8,mat2d:X8,mat3:Q1,mat4:s2,quat:e2},R9=N9.vec3,k9=[[0,0],[1,1]],z9=b4.extend(function(){return{segmentScale:1,dynamic:!0,useNativeLine:!0,attributes:{position:new b4.Attribute("position","float",3,"POSITION"),positionPrev:new b4.Attribute("positionPrev","float",3),positionNext:new b4.Attribute("positionNext","float",3),prevPositionPrev:new b4.Attribute("prevPositionPrev","float",3),prevPosition:new b4.Attribute("prevPosition","float",3),prevPositionNext:new b4.Attribute("prevPositionNext","float",3),offset:new b4.Attribute("offset","float",1),color:new b4.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(t){var e=this.attributes;this.vertexCount!==t&&(e.position.init(t),e.color.init(t),this.useNativeLine||(e.positionPrev.init(t),e.positionNext.init(t),e.offset.init(t)),t>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(this.indices=0===t?null:this.vertexCount>65535?new Uint32Array(3*t):new Uint16Array(3*t))},_getCubicCurveApproxStep:function(t,e,n,r){return 1/(R9.dist(t,e)+R9.dist(n,e)+R9.dist(r,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(t,e,n,r){var i=this._getCubicCurveApproxStep(t,e,n,r),o=Math.ceil(1/i);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(t,e,n,r){var i=this._getCubicCurveApproxStep(t,e,n,r),o=Math.ceil(1/i);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(k9)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(k9)},getPolylineVertexCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/3;return this.useNativeLine?2*(e-1):2*(e-1)+2},getPolylineTriangleCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/3;return this.useNativeLine?0:2*Math.max(e-1,0)},addCubicCurve:function(t,e,n,r,i,o){null==o&&(o=1);var a=t[0],s=t[1],l=t[2],u=e[0],h=e[1],c=e[2],d=n[0],p=n[1],f=n[2],g=r[0],m=r[1],v=r[2],y=this._getCubicCurveApproxStep(t,e,n,r),_=y*y,x=_*y,b=3*y,w=3*_,S=6*_,T=6*x,M=a-2*u+d,C=s-2*h+p,I=l-2*c+f,A=3*(u-d)-a+g,D=3*(h-p)-s+m,L=3*(c-f)-l+v,P=a,E=s,O=l,N=(u-a)*b+M*w+A*x,R=(h-s)*b+C*w+D*x,k=(c-l)*b+I*w+L*x,z=M*S+A*T,B=C*S+D*T,V=I*S+L*T,F=A*T,G=D*T,H=L*T,U=0,W=0,X=Math.ceil(1/y),j=new Float32Array(3*(X+1)),Z=(j=[],0);for(W=0;W<X+1;W++)j[Z++]=P,j[Z++]=E,j[Z++]=O,P+=N,E+=R,O+=k,N+=z,R+=B,k+=V,z+=F,B+=G,V+=H,(U+=y)>1&&(P=N>0?Math.min(P,g):Math.max(P,g),E=R>0?Math.min(E,m):Math.max(E,m),O=k>0?Math.min(O,v):Math.max(O,v));return this.addPolyline(j,i,o)},addLine:function(t,e,n,r){return this.addPolyline([t,e],n,r)},addPolyline:function(t,e,n,r,i){if(t.length){var o="number"!=typeof t[0];if(null==i&&(i=o?t.length:t.length/3),!(i<2)){null==r&&(r=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);var a,s,l=(o="number"!=typeof t[0])?"number"!=typeof e[0]:e.length/4===i,u=this.attributes.position,h=this.attributes.positionPrev,c=this.attributes.positionNext,d=this.attributes.color,p=this.attributes.offset,f=this.indices,g=this._vertexOffset;n=Math.max(n,.01);for(var m=r;m<i;m++){if(o)a=t[m],s=l?e[m]:e;else{var v=3*m;if((a=a||[])[0]=t[v],a[1]=t[v+1],a[2]=t[v+2],l){var y=4*m;(s=s||[])[0]=e[y],s[1]=e[y+1],s[2]=e[y+2],s[3]=e[y+3]}else s=e}if(this.useNativeLine?m>1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m<i-1&&(h.set(g+2,a),h.set(g+3,a)),m>0&&(c.set(g-2,a),c.set(g-1,a)),u.set(g,a),u.set(g+1,a),d.set(g,s),d.set(g+1,s),p.set(g,n/2),p.set(g+1,-n/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,a),g++;else if(m>0){var _=3*this._triangleOffset;(f=this.indices)[_]=g-4,f[_+1]=g-3,f[_+2]=g-2,f[_+3]=g-3,f[_+4]=g-1,f[_+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var x=this._vertexOffset,b=this._vertexOffset+2*i;h.copy(x,x+2),h.copy(x+1,x+3),c.copy(b-1,b-3),c.copy(b-2,b-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(t,e){for(var n=this._itemVertexOffsets[t],r=t<this._itemVertexOffsets.length-1?this._itemVertexOffsets[t+1]:this._vertexOffset,i=n;i<r;i++)this.attributes.color.set(i,e);this.dirty("color")},currentTriangleOffset:function(){return this._triangleOffset},currentVertexOffset:function(){return this._vertexOffset}});E(z9.prototype,O9);var B9=z9;function V9(t,e,n,r,i,o,a){this._zr=t,this._x=0,this._y=0,this._rowHeight=0,this.width=r,this.height=i,this.offsetX=e,this.offsetY=n,this.dpr=a,this.gap=o}function F9(t){(t=t||{}).width=t.width||512,t.height=t.height||512,t.devicePixelRatio=t.devicePixelRatio||1,t.gap=null==t.gap?2:t.gap;var e=document.createElement("canvas");e.width=t.width*t.devicePixelRatio,e.height=t.height*t.devicePixelRatio,this._canvas=e,this._texture=new l4({image:e,flipY:!1});var n=this;this._zr=No(e),e8(this._zr,function(){n._texture.dirty(),n.onupdate&&n.onupdate()}),this._dpr=t.devicePixelRatio,this._coords={},this.onupdate=t.onupdate,this._gap=t.gap,this._textureAtlasNodes=[new V9(this._zr,0,0,t.width,t.height,this._gap,this._dpr)],this._nodeWidth=t.width,this._nodeHeight=t.height,this._currentNodeIdx=0}function G9(){}V9.prototype={constructor:V9,clear:function(){this._x=0,this._y=0,this._rowHeight=0},add:function(t,e,n){var r=t.getBoundingRect();null==e&&(e=r.width),null==n&&(n=r.height),e*=this.dpr,n*=this.dpr,this._fitElement(t,e,n);var i=this._x,o=this._y,a=this.width*this.dpr,s=this.height*this.dpr,l=this.gap;if(i+e+l>a&&(i=this._x=0,o+=this._rowHeight+l,this._y=o,this._rowHeight=0),this._x+=e+l,this._rowHeight=Math.max(this._rowHeight,n),o+n+l>s)return null;t.x+=this.offsetX*this.dpr+i,t.y+=this.offsetY*this.dpr+o,this._zr.add(t);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[i/a+u[0],o/s+u[1]],[(i+e)/a+u[0],(o+n)/s+u[1]]]},_fitElement:function(t,e,n){var r=t.getBoundingRect(),i=e/r.width,o=n/r.height;t.x=-r.x*i,t.y=-r.y*o,t.scaleX=i,t.scaleY=o,t.update()}},F9.prototype={clear:function(){for(var t=0;t<this._textureAtlasNodes.length;t++)this._textureAtlasNodes[t].clear();this._currentNodeIdx=0,this._zr.clear(),this._coords={}},getWidth:function(){return this._width},getHeight:function(){return this._height},getTexture:function(){return this._texture},getDevicePixelRatio:function(){return this._dpr},getZr:function(){return this._zr},_getCurrentNode:function(){return this._textureAtlasNodes[this._currentNodeIdx]},_expand:function(){if(this._currentNodeIdx++,this._textureAtlasNodes[this._currentNodeIdx])return this._textureAtlasNodes[this._currentNodeIdx];var t=4096/this._dpr,e=this._textureAtlasNodes.length,n=e*this._nodeWidth%t,r=Math.floor(e*this._nodeWidth/t)*this._nodeHeight;if(!(r>=t)){var i=(n+this._nodeWidth)*this._dpr,o=(r+this._nodeHeight)*this._dpr;try{this._zr.resize({width:i,height:o})}catch(t){this._canvas.width=i,this._canvas.height=o}var a=new V9(this._zr,n,r,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(a),a}console.error("Too much labels. Some will be ignored.")},add:function(t,e,n){if(this._coords[t.id])return console.warn("Element already been add"),this._coords[t.id];var r=this._getCurrentNode().add(t,e,n);if(!r){var i=this._expand();if(!i)return;r=i.add(t,e,n)}return this._coords[t.id]=r,r},getCoordsScale:function(){var t=this._dpr;return[this._nodeWidth/this._canvas.width*t,this._nodeHeight/this._canvas.height*t]},getCoords:function(t){return this._coords[t]},dispose:function(){this._zr.dispose()}},G9.prototype={constructor:G9,setScene:function(t){this._scene=t,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(t){this._lightRoot=t,this.mainLight=new a9.DirectionalLight({shadowBias:.005}),this.ambientLight=new a9.AmbientLight,t.add(this.mainLight),t.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(t){var e=this.mainLight,n=this.ambientLight,r=t.getModel("light"),i=r.getModel("main"),o=r.getModel("ambient");e.intensity=i.get("intensity"),n.intensity=o.get("intensity"),e.color=a9.parseColor(i.get("color")).slice(0,3),n.color=a9.parseColor(o.get("color")).slice(0,3);var a=i.get("alpha")||0,s=i.get("beta")||0;e.position.setArray(a9.directionFromAlphaBeta(a,s)),e.lookAt(a9.Vector3.ZERO),e.castShadow=i.get("shadow"),e.shadowResolution=a9.getShadowResolution(i.get("shadowQuality"))},updateAmbientCubemap:function(t,e,n){var r=e.getModel("light.ambientCubemap"),i=r.get("texture");if(i){this._cubemapLightsCache=this._cubemapLightsCache||{};var o=this._cubemapLightsCache[i];if(!o){var a=this;o=this._cubemapLightsCache[i]=a9.createAmbientCubemap(r.option,t,n,function(){a._isSkyboxFromAmbientCubemap&&a._skybox.setEnvironmentMap(o.specular.cubemap),n.getZr().refresh()})}this._lightRoot.add(o.diffuse),this._lightRoot.add(o.specular),this._currentCubemapLights=o}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(t,e,n){var r=e.get("environment"),i=this;var o=(i._skybox=i._skybox||new B6,i._skybox);if(r&&"none"!==r)if("auto"===r)if(this._isSkyboxFromAmbientCubemap=!0,this._currentCubemapLights){var a=this._currentCubemapLights.specular.cubemap;o.setEnvironmentMap(a),this._scene&&o.attachScene(this._scene),o.material.set("lod",3)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof r&&r.colorStops||"string"==typeof r&&Sr(r)){this._isSkyboxFromAmbientCubemap=!1;var s=new a9.Texture2D({anisotropic:8,flipY:!1});o.setEnvironmentMap(s);var l=s.image=document.createElement("canvas");l.width=l.height=16,Zx(l.getContext("2d"),new Ru({shape:{x:0,y:0,width:16,height:16},style:{fill:r}})),o.attachScene(this._scene)}else{this._isSkyboxFromAmbientCubemap=!1;s=a9.loadTexture(r,n,{anisotropic:8,flipY:!1});o.setEnvironmentMap(s),o.attachScene(this._scene)}else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var u=e.coordinateSystem;if(this._skybox)if(!u||!u.viewGL||"auto"===r||r.match&&r.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var h=u.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[h]("fragment","SRGB_DECODE")}}};var H9=N9.vec3,U9=b4.extend(function(){return{segmentScale:1,useNativeLine:!0,attributes:{position:new b4.Attribute("position","float",3,"POSITION"),normal:new b4.Attribute("normal","float",3,"NORMAL"),color:new b4.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setQuadCount:function(t){var e=this.attributes,n=this.getQuadVertexCount()*t,r=this.getQuadTriangleCount()*t;this.vertexCount!==n&&(e.position.init(n),e.normal.init(n),e.color.init(n)),this.triangleCount!==r&&(this.indices=n>65535?new Uint32Array(3*r):new Uint16Array(3*r))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:function(){var t=H9.create(),e=H9.create(),n=H9.create(),r=[0,3,1,3,2,1];return function(i,o){var a=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;H9.sub(t,i[1],i[0]),H9.sub(e,i[2],i[1]),H9.cross(n,t,e),H9.normalize(n,n);for(var u=0;u<4;u++)a.set(this._vertexOffset+u,i[u]),l.set(this._vertexOffset+u,o),s.set(this._vertexOffset+u,n);var h=3*this._faceOffset;for(u=0;u<6;u++)this.indices[h+u]=r[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2}}()});E(U9.prototype,O9);var W9=U9,X9=M8.firstNotNull,j9={x:0,y:2,z:1};function Z9(t,e,n){this.rootNode=new a9.Node;var r=new a9.Mesh({geometry:new B9({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:1}),i=new a9.Mesh({geometry:new W9,material:n,castShadow:!1,culling:!1,ignorePicking:!0,$ignorePicking:!0,renderOrder:0});this.rootNode.add(i),this.rootNode.add(r),this.faceInfo=t,this.plane=new a9.Plane,this.linesMesh=r,this.quadsMesh=i}Z9.prototype.update=function(t,e,n){var r=t.coordinateSystem,i=[r.getAxis(this.faceInfo[0]),r.getAxis(this.faceInfo[1])],o=this.linesMesh.geometry,a=this.quadsMesh.geometry;o.convertToDynamicArray(!0),a.convertToDynamicArray(!0),this._updateSplitLines(o,i,t,n),this._udpateSplitAreas(a,i,t,n),o.convertToTypedArray(),a.convertToTypedArray();var s=r.getAxis(this.faceInfo[2]);!function(t,e,n,r){var i=[0,0,0],o=r<0?n.getExtentMin():n.getExtentMax();i[j9[n.dim]]=o,t.position.setArray(i),t.rotation.identity(),e.distance=-Math.abs(o),e.normal.set(0,0,0),"x"===n.dim?(t.rotation.rotateY(r*Math.PI/2),e.normal.x=-r):"z"===n.dim?(t.rotation.rotateX(-r*Math.PI/2),e.normal.y=-r):(r>0&&t.rotation.rotateY(Math.PI),e.normal.z=-r)}(this.rootNode,this.plane,s,this.faceInfo[3])},Z9.prototype._updateSplitLines=function(t,e,n,r){var i=r.getDevicePixelRatio();e.forEach(function(r,o){var a=r.model,s=e[1-o].getExtent();if(!r.scale.isBlank()){var l=a.getModel("splitLine",n.getModel("splitLine"));if(l.get("show")){var u=l.getModel("lineStyle"),h=u.get("color"),c=X9(u.get("opacity"),1),d=X9(u.get("width"),1);h=j(h)?h:[h];for(var p=r.getTicksCoords({tickModel:l}),f=0,g=0;g<p.length;g++){var m=p[g].coord,v=a9.parseColor(h[f%h.length]);v[3]*=c;var y=[0,0,0],_=[0,0,0];y[o]=_[o]=m,y[1-o]=s[0],_[1-o]=s[1],t.addLine(y,_,v,d*i),f++}}}})},Z9.prototype._udpateSplitAreas=function(t,e,n,r){e.forEach(function(r,i){var o=r.model,a=e[1-i].getExtent();if(!r.scale.isBlank()){var s=o.getModel("splitArea",n.getModel("splitArea"));if(s.get("show")){var l=s.getModel("areaStyle"),u=l.get("color"),h=X9(l.get("opacity"),1);u=j(u)?u:[u];for(var c=r.getTicksCoords({tickModel:s,clamp:!0}),d=0,p=[0,0,0],f=[0,0,0],g=0;g<c.length;g++){var m=c[g].coord,v=[0,0,0],y=[0,0,0];if(v[i]=y[i]=m,v[1-i]=a[0],y[1-i]=a[1],0!==g){var _=a9.parseColor(u[d%u.length]);_[3]*=h,t.addQuad([p,v,y,f],_),p=v,f=y,d++}else p=v,f=y}}}})};var Y9=[0,1,2,0,2,3],q9=b4.extend(function(){return{attributes:{position:new b4.Attribute("position","float",3,"POSITION"),texcoord:new b4.Attribute("texcoord","float",2,"TEXCOORD_0"),offset:new b4.Attribute("offset","float",2),color:new b4.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setSpriteCount:function(t){this._spriteCount=t;var e=4*t,n=2*t;this.vertexCount!==e&&(this.attributes.position.init(e),this.attributes.offset.init(e),this.attributes.color.init(e)),this.triangleCount!==n&&(this.indices=e>65535?new Uint32Array(3*n):new Uint16Array(3*n))},setSpriteAlign:function(t,e,n,r,i){var o,a,s,l;switch(null==n&&(n="left"),null==r&&(r="top"),i=i||0,n){case"left":o=i,s=e[0]+i;break;case"center":case"middle":o=-e[0]/2,s=e[0]/2;break;case"right":o=-e[0]-i,s=-i}switch(r){case"bottom":a=i,l=e[1]+i;break;case"middle":a=-e[1]/2,l=e[1]/2;break;case"top":a=-e[1]-i,l=-i}var u=4*t,h=this.attributes.offset;h.set(u,[o,l]),h.set(u+1,[s,l]),h.set(u+2,[s,a]),h.set(u+3,[o,a])},addSprite:function(t,e,n,r,i,o){var a=this._vertexOffset;this.setSprite(this._vertexOffset/4,t,e,n,r,i,o);for(var s=0;s<Y9.length;s++)this.indices[3*this._faceOffset+s]=Y9[s]+a;return this._faceOffset+=2,this._vertexOffset+=4,a/4},setSprite:function(t,e,n,r,i,o,a){for(var s=4*t,l=this.attributes,u=0;u<4;u++)l.position.set(s+u,e);var h=l.texcoord;h.set(s,[r[0][0],r[0][1]]),h.set(s+1,[r[1][0],r[0][1]]),h.set(s+2,[r[1][0],r[1][1]]),h.set(s+3,[r[0][0],r[1][1]]),this.setSpriteAlign(t,n,i,o,a)}});E(q9.prototype,O9);var K9=q9;a9.Shader.import("@export ecgl.labels.vertex\n\nattribute vec3 position: POSITION;\nattribute vec2 texcoord: TEXCOORD_0;\nattribute vec2 offset;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n vec4 proj = worldViewProjection * vec4(position, 1.0);\n\n vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;\n\n screen += offset;\n\n proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);\n gl_Position = proj;\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n v_Texcoord = texcoord;\n}\n@end\n\n\n@export ecgl.labels.fragment\n\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform float alpha : 1.0;\nuniform sampler2D textureAtlas;\nuniform vec2 uvScale: [1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nvarying float v_Miter;\n\nvarying vec2 v_Texcoord;\n\nvoid main()\n{\n gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n}\n\n@end");var J9=a9.Mesh.extend(function(){return{geometry:new K9({dynamic:!0}),material:new a9.Material({shader:a9.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}}),Q9=M8.firstNotNull,$9={x:0,y:2,z:1};function t7(t,e){var n=new a9.Mesh({geometry:new B9({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,renderOrder:2}),r=new J9;r.material.depthMask=!1;var i=new a9.Node;i.add(n),i.add(r),this.rootNode=i,this.dim=t,this.linesMesh=n,this.labelsMesh=r,this.axisLineCoords=null,this.labelElements=[]}var e7={x:"y",y:"x",z:"y"};t7.prototype.update=function(t,e,n){var r=t.coordinateSystem.getAxis(this.dim),i=this.linesMesh.geometry,o=this.labelsMesh.geometry;i.convertToDynamicArray(!0),o.convertToDynamicArray(!0);var a=r.model,s=r.getExtent(),l=n.getDevicePixelRatio(),u=a.getModel("axisLine",t.getModel("axisLine")),h=a.getModel("axisTick",t.getModel("axisTick")),c=a.getModel("axisLabel",t.getModel("axisLabel")),d=u.get("lineStyle.color");if(u.get("show")){var p=u.getModel("lineStyle"),f=[0,0,0];(T=[0,0,0])[M=$9[r.dim]]=s[0],f[M]=s[1],this.axisLineCoords=[T,f];var g=a9.parseColor(d),m=Q9(p.get("width"),1),v=Q9(p.get("opacity"),1);g[3]*=v,i.addLine(T,f,g,m*l)}if(h.get("show")){var y=h.getModel("lineStyle"),_=a9.parseColor(Q9(y.get("color"),d));m=Q9(y.get("width"),1);_[3]*=Q9(y.get("opacity"),1);for(var x=r.getTicksCoords(),b=h.get("length"),w=0;w<x.length;w++){var S=x[w].coord,T=[0,0,0],M=(f=[0,0,0],$9[r.dim]),C=$9[e7[r.dim]];T[M]=f[M]=S,f[C]=b,i.addLine(T,f,_,m*l)}}this.labelElements=[];l=n.getDevicePixelRatio();if(c.get("show")){x=r.getTicksCoords();var I=a.get("data"),A=c.get("margin"),D=r.getViewLabels();for(w=0;w<D.length;w++){var L=J(D[w].tick)?D[w].tick.value:D[w].tickValue,P=D[w].formattedLabel,E=D[w].rawLabel,O=(S=r.dataToCoord(L),[0,0,0]);M=$9[r.dim],C=$9[e7[r.dim]];O[M]=O[M]=S,O[C]=A;var N=c;I&&I[L]&&I[L].textStyle&&(N=new xf(I[L].textStyle,c,a.ecModel));var R=Q9(N.get("color"),d),k=new Qu({style:Yp(N,{text:P,fill:"function"==typeof R?R("category"===r.type?E:"value"===r.type?L+"":L,w):R,verticalAlign:"top",align:"left"})}),z=e.add(k),B=k.getBoundingRect();o.addSprite(O,[B.width*l,B.height*l],z),this.labelElements.push(k)}}if(a.get("name")){var V=a.getModel("nameTextStyle"),F=(O=[0,0,0],M=$9[r.dim],C=$9[e7[r.dim]],Q9(V.get("color"),d)),G=V.get("borderColor");m=V.get("borderWidth");O[M]=O[M]=(s[0]+s[1])/2,O[C]=a.get("nameGap");k=new Qu({style:Yp(V,{text:a.get("name"),fill:F,stroke:G,lineWidth:m})}),z=e.add(k),B=k.getBoundingRect();o.addSprite(O,[B.width*l,B.height*l],z),k.__idx=this.labelElements.length,this.nameLabelElement=k}this.labelsMesh.material.set("textureAtlas",e.getTexture()),this.labelsMesh.material.set("uvScale",e.getCoordsScale()),i.convertToTypedArray(),o.convertToTypedArray()},t7.prototype.setSpriteAlign=function(t,e,n){for(var r=n.getDevicePixelRatio(),i=this.labelsMesh.geometry,o=0;o<this.labelElements.length;o++){var a=this.labelElements[o].getBoundingRect();i.setSpriteAlign(o,[a.width*r,a.height*r],t,e)}var s=this.nameLabelElement;if(s){a=s.getBoundingRect();i.setSpriteAlign(s.__idx,[a.width*r,a.height*r],t,e),i.dirty()}this.textAlign=t,this.textVerticalAlign=e};var n7="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end",r7=M8.firstNotNull;a9.Shader.import(n7);var i7={x:0,y:2,z:1},o7=Qy.extend({type:"grid3D",__ecgl__:!0,init:function(t,e){var n=new a9.Material({shader:a9.createShader("ecgl.color"),depthMask:!1,transparent:!0}),r=new a9.Material({shader:a9.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new a9.Node,this._control=new E9({zr:e.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map(function(t){var e=new Z9(t,r,n);return this.groupGL.add(e.rootNode),e},this),this._axes=["x","y","z"].map(function(t){var e=new t7(t,r);return this.groupGL.add(e.rootNode),e},this);var i=e.getDevicePixelRatio();this._axisLabelSurface=new F9({width:256,height:256,devicePixelRatio:i}),this._axisLabelSurface.onupdate=function(){e.getZr().refresh()},this._axisPointerLineMesh=new a9.Mesh({geometry:new B9({useNativeLine:!1}),material:r,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new F9({width:128,height:128,devicePixelRatio:i}),this._axisPointerLabelsMesh=new J9({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new a9.Node,this._sceneHelper=new G9,this._sceneHelper.initLight(this._lightRoot)},render:function(t,e,n){this._model=t,this._api=n;var r=t.coordinateSystem;r.viewGL.add(this._lightRoot),t.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(r.viewGL);var o=t.getModel("viewControl");i.setFromViewControlModel(o,0),this._axisLabelSurface.clear(),i.off("update"),t.get("show")&&(this._faces.forEach(function(r){r.update(t,e,n)},this),this._axes.forEach(function(e){e.update(t,this._axisLabelSurface,n)},this)),i.on("update",this._onCameraChange.bind(this,t,n),this),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(t),r.viewGL.setPostEffect(t.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._initMouseHandler(t)},afterRender:function(t,e,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,t,n),this._sceneHelper.updateSkybox(i,t,n)},showAxisPointer:function(t,e,n,r){this._doShowAxisPointer(),this._updateAxisPointer(r.value)},hideAxisPointer:function(t,e,n,r){this._doHideAxisPointer()},_initMouseHandler:function(t){var e=t.coordinateSystem.viewGL;t.get("show")&&t.get("axisPointer.show")?e.on("mousemove",this._updateAxisPointerOnMousePosition,this):e.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(t){if(!t.target){for(var e,n=this._model.coordinateSystem,r=n.viewGL,i=r.castRay(t.offsetX,t.offsetY,new a9.Ray),o=0;o<this._faces.length;o++){var a=this._faces[o];if(!a.rootNode.invisible){a.plane.normal.dot(r.camera.worldTransform.z)<0&&a.plane.normal.negate();var s=i.intersectPlane(a.plane);if(s){var l=n.getAxis(a.faceInfo[0]),u=n.getAxis(a.faceInfo[1]),h=i7[a.faceInfo[0]],c=i7[a.faceInfo[1]];l.contain(s.array[h])&&u.contain(s.array[c])&&(e=s)}}}if(e){var d=n.pointToData(e.array,[],!0);this._updateAxisPointer(d),this._doShowAxisPointer()}else this._doHideAxisPointer()}},_onCameraChange:function(t,e){t.get("show")&&(this._updateFaceVisibility(),this._updateAxisLinePosition());var n=this._control;e.dispatchAction({type:"grid3DChangeCamera",alpha:n.getAlpha(),beta:n.getBeta(),distance:n.getDistance(),center:n.getCenter(),from:this.uid,grid3DId:t.id})},_updateFaceVisibility:function(){var t=this._control.getCamera(),e=new a9.Vector3;t.update();for(var n=0;n<this._faces.length/2;n++){for(var r=[],i=0;i<2;i++){this._faces[2*n+i].rootNode.getWorldPosition(e),e.transformMat4(t.viewMatrix),r[i]=e.z}var o=r[0]>r[1]?0:1,a=this._faces[2*n+o],s=this._faces[2*n+1-o];a.rootNode.invisible=!0,s.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var t=this._model.coordinateSystem,e=t.getAxis("x"),n=t.getAxis("y"),r=t.getAxis("z"),i=r.getExtentMax(),o=r.getExtentMin(),a=e.getExtentMin(),s=e.getExtentMax(),l=n.getExtentMax(),u=n.getExtentMin(),h=this._axes[0].rootNode,c=this._axes[1].rootNode,d=this._axes[2].rootNode,p=this._faces,f=p[4].rootNode.invisible?u:l,g=p[2].rootNode.invisible?i:o,m=p[0].rootNode.invisible?a:s,v=p[2].rootNode.invisible?i:o,y=p[0].rootNode.invisible?s:a,_=p[4].rootNode.invisible?u:l;h.rotation.identity(),c.rotation.identity(),d.rotation.identity(),p[4].rootNode.invisible&&(this._axes[0].flipped=!0,h.rotation.rotateX(Math.PI)),p[0].rootNode.invisible&&(this._axes[1].flipped=!0,c.rotation.rotateZ(Math.PI)),p[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),h.position.set(0,g,f),c.position.set(m,v,0),d.position.set(y,0,_),h.update(),c.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var t=this._control.getCamera(),e=[new a9.Vector4,new a9.Vector4],n=new a9.Vector4;this.groupGL.getWorldPosition(n),n.w=1,n.transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),n.x/=n.w,n.y/=n.w,this._axes.forEach(function(r){var i=r.axisLineCoords;r.labelsMesh.geometry;for(var o=0;o<e.length;o++)e[o].setArray(i[o]),e[o].w=1,e[o].transformMat4(r.rootNode.worldTransform).transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),e[o].x/=e[o].w,e[o].y/=e[o].w;var a,s,l=e[1].x-e[0].x,u=e[1].y-e[0].y,h=(e[1].x+e[0].x)/2,c=(e[1].y+e[0].y)/2;Math.abs(u/l)<.5?(a="center",s=c>n.y?"bottom":"top"):(s="middle",a=h>n.x?"left":"right"),r.setSpriteAlign(a,s,this._api)},this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(t){var e=this._model.coordinateSystem,n=e.dataToPoint(t),r=this._axisPointerLineMesh.geometry,i=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function a(t){return M8.firstNotNull(t.model.get("axisPointer.show"),i.get("show"))}function s(t){var e=t.model.getModel("axisPointer",i).getModel("lineStyle"),n=a9.parseColor(e.get("color")),r=r7(e.get("width"),1),o=r7(e.get("opacity"),1);return n[3]*=o,{color:n,lineWidth:r}}r.convertToDynamicArray(!0);for(var l=0;l<this._faces.length;l++){var u=this._faces[l];if(!u.rootNode.invisible){for(var h=u.faceInfo,c=h[3]<0?e.getAxis(h[2]).getExtentMin():e.getAxis(h[2]).getExtentMax(),d=i7[h[2]],p=0;p<2;p++){var f=h[p],g=h[1-p],m=e.getAxis(f),v=e.getAxis(g);if(a(m)){var y=i7[f],_=i7[g];(w=[0,0,0])[y]=(b=[0,0,0])[y]=n[y],w[d]=b[d]=c,w[_]=v.getExtentMin(),b[_]=v.getExtentMax();var x=s(m);r.addLine(w,b,x.color,x.lineWidth*o)}}if(a(e.getAxis(h[2]))){var b,w=n.slice();(b=n.slice())[d]=c;x=s(e.getAxis(h[2]));r.addLine(w,b,x.color,x.lineWidth*o)}}}r.convertToTypedArray(),this._updateAxisPointerLabelsMesh(t),this._api.getZr().refresh()},_updateAxisPointerLabelsMesh:function(t){var e=this._model,n=this._axisPointerLabelsMesh,r=this._axisPointerLabelsSurface,i=e.coordinateSystem,o=e.getModel("axisPointer");n.geometry.convertToDynamicArray(!0),r.clear();var a={x:"y",y:"x",z:"y"};this._axes.forEach(function(e,s){var l=i.getAxis(e.dim),u=l.model.getModel("axisPointer",o),h=u.getModel("label"),c=u.get("lineStyle.color");if(h.get("show")&&u.get("show")){var d=t[s],p=h.get("formatter"),f=l.scale.getLabel({value:d});if(null!=p)f=p(f,t);else if("interval"===l.scale.type||"log"===l.scale.type){var g=oa(l.scale.getTicks()[0]);f=d.toFixed(g+2)}var m=h.get("color"),v=new Qu({style:Yp(h,{text:f,fill:m||c,align:"left",verticalAlign:"top"})}),y=r.add(v),_=v.getBoundingRect(),x=this._api.getDevicePixelRatio(),b=e.rootNode.position.toArray();b[i7[a[e.dim]]]+=(e.flipped?-1:1)*h.get("margin"),b[i7[e.dim]]=l.dataToCoord(t[s]),n.geometry.addSprite(b,[_.width*x,_.height*x],y,e.textAlign,e.textVerticalAlign)}},this),r.getZr().refreshImmediately(),n.material.set("uvScale",r.getCoordsScale()),n.geometry.convertToTypedArray()},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._axisLabelSurface.dispose(),this._axisPointerLabelsSurface.dispose()}});function a7(t){lE.call(this,t),this.type="cartesian3D",this.dimensions=["x","y","z"],this.size=[0,0,0]}function s7(t,e,n){rC.call(this,t,e,n)}a7.prototype={constructor:a7,model:null,containPoint:function(t){return this.getAxis("x").contain(t[0])&&this.getAxis("y").contain(t[2])&&this.getAxis("z").contain(t[1])},containData:function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])&&this.getAxis("z").containData(t[2])},dataToPoint:function(t,e,n){return(e=e||[])[0]=this.getAxis("x").dataToCoord(t[0],n),e[2]=this.getAxis("y").dataToCoord(t[1],n),e[1]=this.getAxis("z").dataToCoord(t[2],n),e},pointToData:function(t,e,n){return(e=e||[])[0]=this.getAxis("x").coordToData(t[0],n),e[1]=this.getAxis("y").coordToData(t[2],n),e[2]=this.getAxis("z").coordToData(t[1],n),e}},R(a7,lE),s7.prototype={constructor:s7,getExtentMin:function(){var t=this._extent;return Math.min(t[0],t[1])},getExtentMax:function(){var t=this._extent;return Math.max(t[0],t[1])},calculateCategoryInterval:function(){return Math.floor(this.scale.count()/8)}},R(s7,rC);var l7=function(){this._pool={},this._allocatedTextures=[]};l7.prototype={constructor:l7,get:function(t){var e=c7(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]);var n=this._pool[e];if(!n.length){var r=new l4(t);return this._allocatedTextures.push(r),r}return n.pop()},put:function(t){var e=c7(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]),this._pool[e].push(t)},clear:function(t){for(var e=0;e<this._allocatedTextures.length;e++)this._allocatedTextures[e].dispose(t);this._pool={},this._allocatedTextures=[]}};var u7={width:512,height:512,type:Y2,format:r3,wrapS:g3,wrapT:g3,minFilter:c3,magFilter:s3,useMipmap:!0,anisotropic:1,flipY:!0,unpackAlignment:4,premultiplyAlpha:!1},h7=Object.keys(u7);function c7(t){A1.defaultsWithPropList(t,u7,h7),function(t){var e=(n=t.width,r=t.height,!(n&n-1||r&r-1));var n,r;t.format===t3&&(t.useMipmap=!1);e&&t.useMipmap||(t.minFilter==l3||t.minFilter==h3?t.minFilter=a3:t.minFilter!=c3&&t.minFilter!=u3||(t.minFilter=s3));e||(t.wrapS=g3,t.wrapT=g3)}(t);for(var e="",n=0;n<h7.length;n++){e+=t[h7[n]].toString()}return e}var d7=l7,p7=["px","nx","py","ny","pz","nz"];function f7(t,e,n){return"alphaMap"===n?t.material.get("diffuseMap"):"alphaCutoff"===n?t.material.isDefined("fragment","ALPHA_TEST")&&t.material.get("diffuseMap")&&t.material.get("alphaCutoff")||0:"uvRepeat"===n?t.material.get("uvRepeat"):"uvOffset"===n?t.material.get("uvOffset"):e.get(n)}function g7(t,e){var n=t.material,r=e.material;return n.get("diffuseMap")!==r.get("diffuseMap")||(n.get("alphaCutoff")||0)!==(r.get("alphaCutoff")||0)}R5.import("@export clay.sm.depth.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nuniform vec2 uvRepeat = vec2(1.0, 1.0);\nuniform vec2 uvOffset = vec2(0.0, 0.0);\n@import clay.chunk.skinning_header\n@import clay.chunk.instancing_header\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nvoid main(){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n v_ViewPosition = worldViewProjection * P;\n gl_Position = v_ViewPosition;\n v_Texcoord = texcoord * uvRepeat + uvOffset;\n}\n@end\n@export clay.sm.depth.fragment\nvarying vec4 v_ViewPosition;\nvarying vec2 v_Texcoord;\nuniform float bias : 0.001;\nuniform float slopeScale : 1.0;\nuniform sampler2D alphaMap;\nuniform float alphaCutoff: 0.0;\n@import clay.util.encode_float\nvoid main(){\n float depth = v_ViewPosition.z / v_ViewPosition.w;\n if (alphaCutoff > 0.0) {\n if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {\n discard;\n }\n }\n#ifdef USE_VSM\n depth = depth * 0.5 + 0.5;\n float moment1 = depth;\n float moment2 = depth * depth;\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n moment2 += 0.25*(dx*dx+dy*dy);\n #endif\n gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);\n#else\n #ifdef SUPPORT_STANDARD_DERIVATIVES\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;\n #else\n depth += bias;\n #endif\n gl_FragColor = encodeFloat(depth * 0.5 + 0.5);\n#endif\n}\n@end\n@export clay.sm.debug_depth\nuniform sampler2D depthMap;\nvarying vec2 v_Texcoord;\n@import clay.util.decode_float\nvoid main() {\n vec4 tex = texture2D(depthMap, v_Texcoord);\n#ifdef USE_VSM\n gl_FragColor = vec4(tex.rgb, 1.0);\n#else\n float depth = decodeFloat(tex);\n gl_FragColor = vec4(depth, depth, depth, 1.0);\n#endif\n}\n@end\n@export clay.sm.distance.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 world : WORLD;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvarying vec3 v_WorldPosition;\nvoid main (){\n vec4 P = vec4(position, 1.0);\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n P = skinMatrixWS * P;\n#endif\n#ifdef INSTANCING\n @import clay.chunk.instancing_matrix\n P = instanceMat * P;\n#endif\n gl_Position = worldViewProjection * P;\n v_WorldPosition = (world * P).xyz;\n}\n@end\n@export clay.sm.distance.fragment\nuniform vec3 lightPosition;\nuniform float range : 100;\nvarying vec3 v_WorldPosition;\n@import clay.util.encode_float\nvoid main(){\n float dist = distance(lightPosition, v_WorldPosition);\n#ifdef USE_VSM\n gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);\n#else\n dist = dist / range;\n gl_FragColor = encodeFloat(dist);\n#endif\n}\n@end\n@export clay.plugin.shadow_map_common\n@import clay.util.decode_float\nfloat tapShadowMap(sampler2D map, vec2 uv, float z){\n vec4 tex = texture2D(map, uv);\n return step(z, decodeFloat(tex) * 2.0 - 1.0);\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {\n float shadowContrib = tapShadowMap(map, uv, z);\n vec2 offset = vec2(1.0 / textureSize) * scale;\n#ifdef PCF_KERNEL_SIZE\n for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{\n shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);\n }}\n return shadowContrib / float(PCF_KERNEL_SIZE + 1);\n#else\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);\n shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);\n shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);\n return shadowContrib / 9.0;\n#endif\n}\nfloat pcf(sampler2D map, vec2 uv, float z, float textureSize) {\n return pcf(map, uv, z, textureSize, vec2(1.0));\n}\nfloat chebyshevUpperBound(vec2 moments, float z){\n float p = 0.0;\n z = z * 0.5 + 0.5;\n if (z <= moments.x) {\n p = 1.0;\n }\n float variance = moments.y - moments.x * moments.x;\n variance = max(variance, 0.0000001);\n float mD = moments.x - z;\n float pMax = variance / (variance + mD * mD);\n pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);\n return max(p, pMax);\n}\nfloat computeShadowContrib(\n sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset\n) {\n vec4 posInLightSpace = lightVPM * vec4(position, 1.0);\n posInLightSpace.xyz /= posInLightSpace.w;\n float z = posInLightSpace.z;\n if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&\n all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){\n vec2 uv = (posInLightSpace.xy+1.0) / 2.0;\n #ifdef USE_VSM\n vec2 moments = texture2D(map, uv * scale + offset).xy;\n return chebyshevUpperBound(moments, z);\n #else\n return pcf(map, uv * scale + offset, z, textureSize, scale);\n #endif\n }\n return 1.0;\n}\nfloat computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {\n return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));\n}\nfloat computeShadowContribOmni(samplerCube map, vec3 direction, float range)\n{\n float dist = length(direction);\n vec4 shadowTex = textureCube(map, direction);\n#ifdef USE_VSM\n vec2 moments = shadowTex.xy;\n float variance = moments.y - moments.x * moments.x;\n float mD = moments.x - dist;\n float p = variance / (variance + mD * mD);\n if(moments.x + 0.001 < dist){\n return clamp(p, 0.0, 1.0);\n }else{\n return 1.0;\n }\n#else\n return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);\n#endif\n}\n@end\n@export clay.plugin.compute_shadow_map\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)\n#ifdef SPOT_LIGHT_SHADOWMAP_COUNT\nuniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT\n#if defined(SHADOW_CASCADE)\nuniform sampler2D directionalLightShadowMaps[1]:unconfigurable;\nuniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;\nuniform float directionalLightShadowMapSizes[1]:unconfigurable;\nuniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;\nuniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;\n#else\nuniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\nuniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\n#endif\n#ifdef POINT_LIGHT_SHADOWMAP_COUNT\nuniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;\n#endif\nuniform bool shadowEnabled : true;\n#ifdef PCF_KERNEL_SIZE\nuniform vec2 pcfKernel[PCF_KERNEL_SIZE];\n#endif\n@import clay.plugin.shadow_map_common\n#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,\n spotLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n#ifdef SHADOW_CASCADE\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)\n / (gl_DepthRange.far - gl_DepthRange.near);\n float shadowContrib;\n shadowContribs[0] = 1.0;\n for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{\n if (\n depth >= shadowCascadeClipsNear[_idx_] &&\n depth <= shadowCascadeClipsFar[_idx_]\n ) {\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[0],\n vec2(1.0 / float(SHADOW_CASCADE), 1.0),\n vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)\n );\n shadowContribs[0] = shadowContrib;\n }\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#else\nvoid computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){\n float shadowContrib;\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n shadowContrib = computeShadowContrib(\n directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,\n directionalLightShadowMapSizes[_idx_]\n );\n shadowContribs[_idx_] = shadowContrib;\n }}\n for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n#if defined(POINT_LIGHT_SHADOWMAP_COUNT)\nvoid computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){\n vec3 lightPosition;\n vec3 direction;\n for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{\n lightPosition = pointLightPosition[_idx_];\n direction = position - lightPosition;\n shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);\n }}\n for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{\n shadowContribs[_idx_] = 1.0;\n }}\n}\n#endif\n#endif\n@end");var m7,v7,y7,_7,x7,b7,w7,S7=P1.extend(function(){return{softShadow:S7.PCF,shadowBlur:1,lightFrustumBias:"auto",kernelPCF:new Float32Array([1,0,1,1,-1,1,0,1,-1,0,-1,-1,1,-1,0,-1]),precision:"highp",_lastRenderNotCastShadow:!1,_frameBuffer:new I6,_textures:{},_shadowMapNumber:{POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},_depthMaterials:{},_distanceMaterials:{},_receivers:[],_lightsCastShadow:[],_lightCameras:{},_lightMaterials:{},_texturePool:new d7}},function(){this._gaussianPassH=new c8({fragment:R5.source("clay.compositor.gaussian_blur")}),this._gaussianPassV=new c8({fragment:R5.source("clay.compositor.gaussian_blur")}),this._gaussianPassH.setUniform("blurSize",this.shadowBlur),this._gaussianPassH.setUniform("blurDir",0),this._gaussianPassV.setUniform("blurSize",this.shadowBlur),this._gaussianPassV.setUniform("blurDir",1),this._outputDepthPass=new c8({fragment:R5.source("clay.sm.debug_depth")})},{render:function(t,e,n,r){n||(n=e.getMainCamera()),this.trigger("beforerender",this,t,e,n),this._renderShadowPass(t,e,n,r),this.trigger("afterrender",this,t,e,n)},renderDebug:function(t,e){t.saveClear();var n=t.viewport,r=0,i=e||n.width/4,o=i;for(var a in this.softShadow===S7.VSM?this._outputDepthPass.material.define("fragment","USE_VSM"):this._outputDepthPass.material.undefine("fragment","USE_VSM"),this._textures){var s=this._textures[a];t.setViewport(r,0,i*s.width/s.height,o),this._outputDepthPass.setUniform("depthMap",s),this._outputDepthPass.render(t),r+=i*s.width/s.height}t.setViewport(n),t.restoreClear()},_updateReceivers:function(t,e){if(e.receiveShadow?(this._receivers.push(e),e.material.set("shadowEnabled",1),e.material.set("pcfKernel",this.kernelPCF)):e.material.set("shadowEnabled",0),this.softShadow===S7.VSM)e.material.define("fragment","USE_VSM"),e.material.undefine("fragment","PCF_KERNEL_SIZE");else{e.material.undefine("fragment","USE_VSM");var n=this.kernelPCF;n&&n.length?e.material.define("fragment","PCF_KERNEL_SIZE",n.length/2):e.material.undefine("fragment","PCF_KERNEL_SIZE")}},_update:function(t,e){var n=this;e.traverse(function(e){e.isRenderable()&&n._updateReceivers(t,e)});for(var r=0;r<e.lights.length;r++){var i=e.lights[r];i.castShadow&&!i.invisible&&this._lightsCastShadow.push(i)}},_renderShadowPass:function(t,e,n,r){for(var i in this._shadowMapNumber)this._shadowMapNumber[i]=0;this._lightsCastShadow.length=0,this._receivers.length=0;var o=t.gl;if(r||e.update(),n&&n.update(),e.updateLights(),this._update(t,e),this._lightsCastShadow.length||!this._lastRenderNotCastShadow){this._lastRenderNotCastShadow=0===this._lightsCastShadow,o.enable(o.DEPTH_TEST),o.depthMask(!0),o.disable(o.BLEND),o.clearColor(1,1,1,1);for(var a,s=[],l=[],u=[],h=[],c=[],d=[],p=0;p<this._lightsCastShadow.length;p++){var f=this._lightsCastShadow[p];if("DIRECTIONAL_LIGHT"===f.type){if(a){console.warn("Only one direectional light supported with shadow cascade");continue}if(f.shadowCascade>4){console.warn("Support at most 4 cascade");continue}f.shadowCascade>1&&(a=f),this.renderDirectionalLightShadow(t,e,n,f,c,h,u)}else"SPOT_LIGHT"===f.type?this.renderSpotLightShadow(t,e,f,l,s):"POINT_LIGHT"===f.type&&this.renderPointLightShadow(t,e,f,d);this._shadowMapNumber[f.type]++}for(var g in this._shadowMapNumber){var m=this._shadowMapNumber[g],v=g+"_SHADOWMAP_COUNT";for(p=0;p<this._receivers.length;p++){(y=this._receivers[p].material).fragmentDefines[v]!==m&&(m>0?y.define("fragment",v,m):y.isDefined("fragment",v)&&y.undefine("fragment",v))}}for(p=0;p<this._receivers.length;p++){var y=this._receivers[p].material;a?y.define("fragment","SHADOW_CASCADE",a.shadowCascade):y.undefine("fragment","SHADOW_CASCADE")}var _=e.shadowUniforms;if(u.length>0){var x=u.map(T);if(_.directionalLightShadowMaps={value:u,type:"tv"},_.directionalLightMatrices={value:h,type:"m4v"},_.directionalLightShadowMapSizes={value:x,type:"1fv"},a){var b=c.slice(),w=c.slice();b.pop(),w.shift(),b.reverse(),w.reverse(),h.reverse(),_.shadowCascadeClipsNear={value:b,type:"1fv"},_.shadowCascadeClipsFar={value:w,type:"1fv"}}}if(s.length>0){var S=s.map(T);(_=e.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},_.spotLightMatrices={value:l,type:"m4v"},_.spotLightShadowMapSizes={value:S,type:"1fv"}}d.length>0&&(_.pointLightShadowMaps={value:d,type:"tv"})}function T(t){return t.height}},renderDirectionalLightShadow:(m7=new j4,v7=new v2,y7=new M2,_7=new v2,x7=new v2,b7=new v2,w7=new v2,function(t,e,n,r,i,o,a){var s=this._getDepthMaterial(r),l={getMaterial:function(t){return t.shadowDepthMaterial||s},isMaterialChanged:g7,getUniform:f7,ifRender:function(t){return t.castShadow},sortCompare:J5.opaqueSortCompare};if(!e.viewBoundingBoxLastFrame.isFinite()){var u=e.getBoundingBox();e.viewBoundingBoxLastFrame.copy(u).applyTransform(n.viewMatrix)}var h=Math.min(-e.viewBoundingBoxLastFrame.min.z,n.far),c=Math.max(-e.viewBoundingBoxLastFrame.max.z,n.near),d=this._getDirectionalLightCamera(r,e,n),p=b7.array;w7.copy(d.projectionMatrix),s2.invert(x7.array,d.worldTransform.array),s2.multiply(x7.array,x7.array,n.worldTransform.array),s2.multiply(p,w7.array,x7.array);for(var f=[],g=n instanceof g6,m=(n.near+n.far)/(n.near-n.far),v=2*n.near*n.far/(n.near-n.far),y=0;y<=r.shadowCascade;y++){var _=c*Math.pow(h/c,y/r.shadowCascade),x=c+(h-c)*y/r.shadowCascade,b=_*r.cascadeSplitLogFactor+x*(1-r.cascadeSplitLogFactor);f.push(b),i.push(-(-b*m+v)/-b)}var w=this._getTexture(r,r.shadowCascade);a.push(w);var S=t.viewport,T=t.gl;for(this._frameBuffer.attach(w),this._frameBuffer.bind(t),T.clear(T.COLOR_BUFFER_BIT|T.DEPTH_BUFFER_BIT),y=0;y<r.shadowCascade;y++){var M=f[y],C=f[y+1];g?s2.perspective(v7.array,n.fov/180*Math.PI,n.aspect,M,C):s2.ortho(v7.array,n.left,n.right,n.bottom,n.top,M,C),m7.setFromProjection(v7),m7.getTransformedBoundingBox(y7,x7),y7.applyProjection(w7);var I=y7.min.array,A=y7.max.array;I[0]=Math.max(I[0],-1),I[1]=Math.max(I[1],-1),A[0]=Math.min(A[0],1),A[1]=Math.min(A[1],1),_7.ortho(I[0],A[0],I[1],A[1],1,-1),d.projectionMatrix.multiplyLeft(_7);var D=r.shadowResolution||512;t.setViewport((r.shadowCascade-y-1)*D,0,D,D,1);var L=e.updateRenderList(d);t.renderPass(L.opaque,d,l),this.softShadow===S7.VSM&&this._gaussianFilter(t,w,w.width);var P=new v2;P.copy(d.viewMatrix).multiplyLeft(d.projectionMatrix),o.push(P.array),d.projectionMatrix.copy(w7)}this._frameBuffer.unbind(t),t.setViewport(S)}),renderSpotLightShadow:function(t,e,n,r,i){var o=this._getTexture(n),a=this._getSpotLightCamera(n),s=t.gl;this._frameBuffer.attach(o),this._frameBuffer.bind(t),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT);var l=this._getDepthMaterial(n),u={getMaterial:function(t){return t.shadowDepthMaterial||l},isMaterialChanged:g7,getUniform:f7,ifRender:function(t){return t.castShadow},sortCompare:J5.opaqueSortCompare},h=e.updateRenderList(a);t.renderPass(h.opaque,a,u),this._frameBuffer.unbind(t),this.softShadow===S7.VSM&&this._gaussianFilter(t,o,o.width);var c=new v2;c.copy(a.worldTransform).invert().multiplyLeft(a.projectionMatrix),i.push(o),r.push(c.array)},renderPointLightShadow:function(t,e,n,r){var i=this._getTexture(n),o=t.gl;r.push(i);var a=this._getDepthMaterial(n),s={getMaterial:function(t){return t.shadowDepthMaterial||a},getUniform:f7,sortCompare:J5.opaqueSortCompare},l={px:[],py:[],pz:[],nx:[],ny:[],nz:[]},u=new M2,h=n.getWorldPosition().array,c=new M2,d=n.range;c.min.setArray(h),c.max.setArray(h);var p=new W1(d,d,d);c.max.add(p),c.min.sub(p);var f={px:!1,py:!1,pz:!1,nx:!1,ny:!1,nz:!1};e.traverse(function(t){if(t.isRenderable()&&t.castShadow){var e=t.geometry;if(!e.boundingBox){for(var n=0;n<p7.length;n++)l[p7[n]].push(t);return}if(u.transformFrom(e.boundingBox,t.worldTransform),!u.intersectBoundingBox(c))return;u.updateVertices();for(n=0;n<p7.length;n++)f[p7[n]]=!1;for(n=0;n<8;n++){var r=u.vertices[n],i=r[0]-h[0],o=r[1]-h[1],a=r[2]-h[2],s=Math.abs(i),d=Math.abs(o),p=Math.abs(a);s>d?s>p?f[i>0?"px":"nx"]=!0:f[a>0?"pz":"nz"]=!0:d>p?f[o>0?"py":"ny"]=!0:f[a>0?"pz":"nz"]=!0}for(n=0;n<p7.length;n++)f[p7[n]]&&l[p7[n]].push(t)}});for(var g=0;g<6;g++){var m=p7[g],v=this._getPointLightCamera(n,m);this._frameBuffer.attach(i,o.COLOR_ATTACHMENT0,o.TEXTURE_CUBE_MAP_POSITIVE_X+g),this._frameBuffer.bind(t),o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT),t.renderPass(l[m],v,s)}this._frameBuffer.unbind(t)},_getDepthMaterial:function(t){var e=this._lightMaterials[t.__uid__],n="POINT_LIGHT"===t.type;if(!e){var r=n?"clay.sm.distance.":"clay.sm.depth.";e=new i5({precision:this.precision,shader:new R5(R5.source(r+"vertex"),R5.source(r+"fragment"))}),this._lightMaterials[t.__uid__]=e}return null!=t.shadowSlopeScale&&e.setUniform("slopeScale",t.shadowSlopeScale),null!=t.shadowBias&&e.setUniform("bias",t.shadowBias),this.softShadow===S7.VSM?e.define("fragment","USE_VSM"):e.undefine("fragment","USE_VSM"),n&&(e.set("lightPosition",t.getWorldPosition().array),e.set("range",t.range)),e},_gaussianFilter:function(t,e,n){var r={width:n,height:n,type:n4.FLOAT},i=this._texturePool.get(r);this._frameBuffer.attach(i),this._frameBuffer.bind(t),this._gaussianPassH.setUniform("texture",e),this._gaussianPassH.setUniform("textureWidth",n),this._gaussianPassH.render(t),this._frameBuffer.attach(e),this._gaussianPassV.setUniform("texture",i),this._gaussianPassV.setUniform("textureHeight",n),this._gaussianPassV.render(t),this._frameBuffer.unbind(t),this._texturePool.put(i)},_getTexture:function(t,e){var n=t.__uid__,r=this._textures[n],i=t.shadowResolution||512;return e=e||1,r||((r="POINT_LIGHT"===t.type?new p6:new l4).width=i*e,r.height=i,this.softShadow===S7.VSM?(r.type=n4.FLOAT,r.anisotropic=4):(r.minFilter=a3,r.magFilter=a3,r.useMipmap=!1),this._textures[n]=r),r},_getPointLightCamera:function(t,e){this._lightCameras.point||(this._lightCameras.point={px:new g6,nx:new g6,py:new g6,ny:new g6,pz:new g6,nz:new g6});var n=this._lightCameras.point[e];switch(n.far=t.range,n.fov=90,n.position.set(0,0,0),e){case"px":n.lookAt(W1.POSITIVE_X,W1.NEGATIVE_Y);break;case"nx":n.lookAt(W1.NEGATIVE_X,W1.NEGATIVE_Y);break;case"py":n.lookAt(W1.POSITIVE_Y,W1.POSITIVE_Z);break;case"ny":n.lookAt(W1.NEGATIVE_Y,W1.NEGATIVE_Z);break;case"pz":n.lookAt(W1.POSITIVE_Z,W1.NEGATIVE_Y);break;case"nz":n.lookAt(W1.NEGATIVE_Z,W1.NEGATIVE_Y)}return t.getWorldPosition(n.position),n.update(),n},_getDirectionalLightCamera:function(){var t=new v2,e=new M2,n=new M2;return function(r,i,o){this._lightCameras.directional||(this._lightCameras.directional=new s8);var a=this._lightCameras.directional;e.copy(i.viewBoundingBoxLastFrame),e.intersection(o.frustum.boundingBox),a.position.copy(e.min).add(e.max).scale(.5).transformMat4(o.worldTransform),a.rotation.copy(r.rotation),a.scale.copy(r.scale),a.updateWorldTransform(),v2.invert(t,a.worldTransform),v2.multiply(t,t,o.worldTransform),n.copy(e).applyTransform(t);var s=n.min.array,l=n.max.array;return a.position.set((s[0]+l[0])/2,(s[1]+l[1])/2,l[2]).transformMat4(a.worldTransform),a.near=0,a.far=-s[2]+l[2],isNaN(this.lightFrustumBias)?a.far*=4:a.far+=this.lightFrustumBias,a.left=s[0],a.right=l[0],a.top=l[1],a.bottom=s[1],a.update(!0),a}}(),_getSpotLightCamera:function(t){this._lightCameras.spot||(this._lightCameras.spot=new g6);var e=this._lightCameras.spot;return e.fov=2*t.penumbraAngle,e.far=t.range,e.worldTransform.copy(t.worldTransform),e.updateProjectionMatrix(),s2.invert(e.viewMatrix.array,e.worldTransform.array),e},dispose:function(t){var e=t.gl||t;for(var n in this._frameBuffer&&this._frameBuffer.dispose(e),this._textures)this._textures[n].dispose(e);this._texturePool.clear(t.gl),this._depthMaterials={},this._distanceMaterials={},this._textures={},this._lightCameras={},this._shadowMapNumber={POINT_LIGHT:0,DIRECTIONAL_LIGHT:0,SPOT_LIGHT:0},this._meshMaterials={};for(var r=0;r<this._receivers.length;r++){var i=this._receivers[r];if(i.material){var o=i.material;o.undefine("fragment","POINT_LIGHT_SHADOW_COUNT"),o.undefine("fragment","DIRECTIONAL_LIGHT_SHADOW_COUNT"),o.undefine("fragment","AMBIENT_LIGHT_SHADOW_COUNT"),o.set("shadowEnabled",0)}}this._receivers=[],this._lightsCastShadow=[]}});S7.VSM=1,S7.PCF=2;var T7=S7,M7=P1.extend(function(){return{name:"",inputLinks:{},outputLinks:{},_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},{updateParameter:function(t,e){var n,r,i=this.outputs[t],o=i.parameters,a=i._parametersCopy;if(a||(a=i._parametersCopy={}),o)for(var s in o)"width"!==s&&"height"!==s&&(a[s]=o[s]);return n=o.width instanceof Function?o.width.call(this,e):o.width,r=o.height instanceof Function?o.height.call(this,e):o.height,a.width===n&&a.height===r||this._outputTextures[t]&&this._outputTextures[t].dispose(e.gl),a.width=n,a.height=r,a},setParameter:function(t,e){},getParameter:function(t){},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},render:function(){},getOutput:function(t,e){if(null==e)return e=t,this._outputTextures[e];var n=this.outputs[e];return n?this._rendered?n.outputLastFrame?this._prevOutputTextures[e]:this._outputTextures[e]:this._rendering?(this._prevOutputTextures[e]||(this._prevOutputTextures[e]=this._compositor.allocateTexture(n.parameters||{})),this._prevOutputTextures[e]):(this.render(t),this._outputTextures[e]):void 0},removeReference:function(t){(this._outputReferences[t]--,0===this._outputReferences[t])&&(this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t]))},link:function(t,e,n){this.inputLinks[t]={node:e,pin:n},e.outputLinks[n]||(e.outputLinks[n]=[]),e.outputLinks[n].push({node:this,pin:t}),this.pass.material.enableTexture(t)},clear:function(){this.inputLinks={},this.outputLinks={}},updateReference:function(t){if(!this._rendering){for(var e in this._rendering=!0,this.inputLinks){var n=this.inputLinks[e];n.node.updateReference(n.pin)}this._rendering=!1}t&&this._outputReferences[t]++},beforeFrame:function(){for(var t in this._rendered=!1,this.outputLinks)this._outputReferences[t]=0},afterFrame:function(){for(var t in this.outputLinks){if(this._outputReferences[t]>0)this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t])}}}),C7=M7,I7=P1.extend(function(){return{nodes:[]}},{dirty:function(){this._dirty=!0},addNode:function(t){this.nodes.indexOf(t)>=0||(this.nodes.push(t),this._dirty=!0)},removeNode:function(t){"string"==typeof t&&(t=this.getNodeByName(t));var e=this.nodes.indexOf(t);e>=0&&(this.nodes.splice(e,1),this._dirty=!0)},getNodeByName:function(t){for(var e=0;e<this.nodes.length;e++)if(this.nodes[e].name===t)return this.nodes[e]},update:function(){for(var t=0;t<this.nodes.length;t++)this.nodes[t].clear();for(t=0;t<this.nodes.length;t++){var e=this.nodes[t];if(e.inputs)for(var n in e.inputs)if(e.inputs[n])if(!e.pass||e.pass.material.isUniformEnabled(n)){var r=e.inputs[n],i=this.findPin(r);i?e.link(n,i.node,i.pin):"string"==typeof r?console.warn("Node "+r+" not exist"):console.warn("Pin of "+r.node+"."+r.pin+" not exist")}else console.warn("Pin "+e.name+"."+n+" not used.")}},findPin:function(t){var e;if(("string"==typeof t||t instanceof C7)&&(t={node:t}),"string"==typeof t.node)for(var n=0;n<this.nodes.length;n++){var r=this.nodes[n];r.name===t.node&&(e=r)}else e=t.node;if(e){var i=t.pin;if(i||e.outputs&&(i=Object.keys(e.outputs)[0]),e.outputs[i])return{node:e,pin:i}}}}),A7=I7,D7=A7.extend(function(){return{_outputs:[],_texturePool:new d7,_frameBuffer:new I6({depthBuffer:!1})}},{addNode:function(t){A7.prototype.addNode.call(this,t),t._compositor=this},render:function(t,e){if(this._dirty){this.update(),this._dirty=!1,this._outputs.length=0;for(var n=0;n<this.nodes.length;n++)this.nodes[n].outputs||this._outputs.push(this.nodes[n])}for(n=0;n<this.nodes.length;n++)this.nodes[n].beforeFrame();for(n=0;n<this._outputs.length;n++)this._outputs[n].updateReference();for(n=0;n<this._outputs.length;n++)this._outputs[n].render(t,e);for(n=0;n<this.nodes.length;n++)this.nodes[n].afterFrame()},allocateTexture:function(t){return this._texturePool.get(t)},releaseTexture:function(t){this._texturePool.put(t)},getFrameBuffer:function(){return this._frameBuffer},dispose:function(t){this._texturePool.clear(t)}}),L7=D7,P7=C7.extend({name:"scene",scene:null,camera:null,autoUpdateScene:!0,preZ:!1},function(){this.frameBuffer=new I6},{render:function(t){this._rendering=!0;var e,n=t.gl;if(this.trigger("beforerender"),this.outputs){var r=this.frameBuffer;for(var i in this.outputs){var o=this.updateParameter(i,t),a=this.outputs[i],s=this._compositor.allocateTexture(o);this._outputTextures[i]=s,"string"==typeof(h=a.attachment||n.COLOR_ATTACHMENT0)&&(h=n[h]),r.attach(s,h)}r.bind(t);var l=t.getGLExtension("EXT_draw_buffers");if(l){var u=[];for(var h in this.outputs)(h=parseInt(h))>=n.COLOR_ATTACHMENT0&&h<=n.COLOR_ATTACHMENT0+8&&u.push(h);l.drawBuffersEXT(u)}t.saveClear(),t.clearBit=D2|P2,e=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),t.restoreClear(),r.unbind(t)}else e=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",e),this._rendering=!1,this._rendered=!0}}),E7=C7.extend(function(){return{texture:null,outputs:{color:{}}}},function(){},{getOutput:function(t,e){return this.texture},beforeFrame:function(){},afterFrame:function(){}}),O7=C7.extend(function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}},function(){var t=new c8({fragment:this.shader});this.pass=t},{render:function(t,e){this.trigger("beforerender",t),this._rendering=!0;var n=t.gl;for(var r in this.inputLinks){var i=(c=this.inputLinks[r]).node.getOutput(t,c.pin);this.pass.setUniform(r,i)}if(this.outputs){this.pass.outputs={};var o={};for(var a in this.outputs){var s=this.updateParameter(a,t);isNaN(s.width)&&this.updateParameter(a,t);var l=this.outputs[a],u=this._compositor.allocateTexture(s);this._outputTextures[a]=u,"string"==typeof(h=l.attachment||n.COLOR_ATTACHMENT0)&&(h=n[h]),o[h]=u}for(var h in this._compositor.getFrameBuffer().bind(t),o)this._compositor.getFrameBuffer().attach(o[h],h);this.pass.render(t),this._compositor.getFrameBuffer().updateMipmap(t)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(t),this.pass.render(t,e);for(var r in this.inputLinks){var c;(c=this.inputLinks[r]).node.removeReference(c.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",t)},updateParameter:function(t,e){var n,r,i=this.outputs[t],o=i.parameters,a=i._parametersCopy;if(a||(a=i._parametersCopy={}),o)for(var s in o)"width"!==s&&"height"!==s&&(a[s]=o[s]);return n="function"==typeof o.width?o.width.call(this,e):o.width,r="function"==typeof o.height?o.height.call(this,e):o.height,n=Math.ceil(n),r=Math.ceil(r),a.width===n&&a.height===r||this._outputTextures[t]&&this._outputTextures[t].dispose(e),a.width=n,a.height=r,a},setParameter:function(t,e){this.pass.setUniform(t,e)},getParameter:function(t){return this.pass.getUniform(t)},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},define:function(t,e){this.pass.material.define("fragment",t,e)},undefine:function(t){this.pass.material.undefine("fragment",t)},removeReference:function(t){(this._outputReferences[t]--,0===this._outputReferences[t])&&(this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t]))},clear:function(){C7.prototype.clear.call(this),this.pass.material.disableTexturesAll()}}),N7=O7,R7="@export clay.compositor.kernel.gaussian_9\nfloat gaussianKernel[9];\ngaussianKernel[0] = 0.07;\ngaussianKernel[1] = 0.09;\ngaussianKernel[2] = 0.12;\ngaussianKernel[3] = 0.14;\ngaussianKernel[4] = 0.16;\ngaussianKernel[5] = 0.14;\ngaussianKernel[6] = 0.12;\ngaussianKernel[7] = 0.09;\ngaussianKernel[8] = 0.07;\n@end\n@export clay.compositor.kernel.gaussian_13\nfloat gaussianKernel[13];\ngaussianKernel[0] = 0.02;\ngaussianKernel[1] = 0.03;\ngaussianKernel[2] = 0.06;\ngaussianKernel[3] = 0.08;\ngaussianKernel[4] = 0.11;\ngaussianKernel[5] = 0.13;\ngaussianKernel[6] = 0.14;\ngaussianKernel[7] = 0.13;\ngaussianKernel[8] = 0.11;\ngaussianKernel[9] = 0.08;\ngaussianKernel[10] = 0.06;\ngaussianKernel[11] = 0.03;\ngaussianKernel[12] = 0.02;\n@end\n@export clay.compositor.gaussian_blur\n#define SHADER_NAME gaussian_blur\nuniform sampler2D texture;varying vec2 v_Texcoord;\nuniform float blurSize : 2.0;\nuniform vec2 textureSize : [512.0, 512.0];\nuniform float blurDir : 0.0;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main (void)\n{\n @import clay.compositor.kernel.gaussian_9\n vec2 off = blurSize / textureSize;\n off *= vec2(1.0 - blurDir, blurDir);\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n for (int i = 0; i < 9; i++) {\n float w = gaussianKernel[i];\n vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));\n sum += texel * w;\n weightAll += w;\n }\n gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));\n}\n@end\n",k7="\n@export clay.compositor.lut\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform sampler2D lookup;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n float blueColor = tex.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);\n vec4 newColor1 = texture2D(lookup, texPos1);\n vec4 newColor2 = texture2D(lookup, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n gl_FragColor = vec4(newColor.rgb, tex.w);\n}\n@end",z7="@export clay.compositor.output\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = tex.rgb;\n#ifdef OUTPUT_ALPHA\n gl_FragColor.a = tex.a;\n#else\n gl_FragColor.a = 1.0;\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",B7="@export clay.compositor.bright\nuniform sampler2D texture;\nuniform float threshold : 1;\nuniform float scale : 1.0;\nuniform vec2 textureSize: [512, 512];\nvarying vec2 v_Texcoord;\nconst vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvec4 median(vec4 a, vec4 b, vec4 c)\n{\n return a + b + c - min(min(a, b), c) - max(max(a, b), c);\n}\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n#ifdef ANTI_FLICKER\n vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);\n vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));\n vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));\n vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));\n vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));\n texel = median(median(texel, s1, s2), s3, s4);\n#endif\n float lum = dot(texel.rgb , lumWeight);\n vec4 color;\n if (lum > threshold && texel.a > 0.0)\n {\n color = vec4(texel.rgb * scale, texel.a * scale);\n }\n else\n {\n color = vec4(0.0);\n }\n gl_FragColor = encodeHDR(color);\n}\n@end\n",V7="@export clay.compositor.downsample\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nfloat brightness(vec3 c)\n{\n return max(max(c.r, c.g), c.b);\n}\n@import clay.util.clamp_sample\nvoid main()\n{\n vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;\n#ifdef ANTI_FLICKER\n vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;\n vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;\n vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;\n vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;\n float s1w = 1.0 / (brightness(s1) + 1.0);\n float s2w = 1.0 / (brightness(s2) + 1.0);\n float s3w = 1.0 / (brightness(s3) + 1.0);\n float s4w = 1.0 / (brightness(s4) + 1.0);\n float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);\n vec4 color = vec4(\n (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,\n 1.0\n );\n#else\n vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n color *= 0.25;\n#endif\n gl_FragColor = encodeHDR(color);\n}\n@end",F7="\n@export clay.compositor.upsample\n#define HIGH_QUALITY\nuniform sampler2D texture;\nuniform vec2 textureSize : [512, 512];\nuniform float sampleScale: 0.5;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\n@import clay.util.clamp_sample\nvoid main()\n{\n#ifdef HIGH_QUALITY\n vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n gl_FragColor = encodeHDR(s / 16.0);\n#else\n vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;\n vec4 s;\n s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));\n s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));\n gl_FragColor = encodeHDR(s / 4.0);\n#endif\n}\n@end",G7="@export clay.compositor.hdr.composite\n#define TONEMAPPING\nuniform sampler2D texture;\n#ifdef BLOOM_ENABLED\nuniform sampler2D bloom;\n#endif\n#ifdef LENSFLARE_ENABLED\nuniform sampler2D lensflare;\nuniform sampler2D lensdirt;\n#endif\n#ifdef LUM_ENABLED\nuniform sampler2D lum;\n#endif\n#ifdef LUT_ENABLED\nuniform sampler2D lut;\n#endif\n#ifdef COLOR_CORRECTION\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float saturation : 1.0;\n#endif\n#ifdef VIGNETTE\nuniform float vignetteDarkness: 1.0;\nuniform float vignetteOffset: 1.0;\n#endif\nuniform float exposure : 1.0;\nuniform float bloomIntensity : 0.25;\nuniform float lensflareIntensity : 1;\nvarying vec2 v_Texcoord;\n@import clay.util.srgb\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\nfloat eyeAdaption(float fLum)\n{\n return mix(0.2, fLum, 0.5);\n}\n#ifdef LUT_ENABLED\nvec3 lutTransform(vec3 color) {\n float blueColor = color.b * 63.0;\n vec2 quad1;\n quad1.y = floor(floor(blueColor) / 8.0);\n quad1.x = floor(blueColor) - (quad1.y * 8.0);\n vec2 quad2;\n quad2.y = floor(ceil(blueColor) / 8.0);\n quad2.x = ceil(blueColor) - (quad2.y * 8.0);\n vec2 texPos1;\n texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec2 texPos2;\n texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);\n texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);\n vec4 newColor1 = texture2D(lut, texPos1);\n vec4 newColor2 = texture2D(lut, texPos2);\n vec4 newColor = mix(newColor1, newColor2, fract(blueColor));\n return newColor.rgb;\n}\n#endif\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = vec4(0.0);\n vec4 originalTexel = vec4(0.0);\n#ifdef TEXTURE_ENABLED\n texel = decodeHDR(texture2D(texture, v_Texcoord));\n originalTexel = texel;\n#endif\n#ifdef BLOOM_ENABLED\n vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));\n texel.rgb += bloomTexel.rgb * bloomIntensity;\n texel.a += bloomTexel.a * bloomIntensity;\n#endif\n#ifdef LENSFLARE_ENABLED\n texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;\n#endif\n texel.a = min(texel.a, 1.0);\n#ifdef LUM_ENABLED\n float fLum = texture2D(lum, vec2(0.5, 0.5)).r;\n float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));\n float exposureBias = adaptedLumDest * exposure;\n#else\n float exposureBias = exposure;\n#endif\n#ifdef TONEMAPPING\n texel.rgb *= exposureBias;\n texel.rgb = ACESToneMapping(texel.rgb);\n#endif\n texel = linearTosRGB(texel);\n#ifdef LUT_ENABLED\n texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));\n#endif\n#ifdef COLOR_CORRECTION\n texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);\n texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));\n texel.rgb = mix(vec3(lum), texel.rgb, saturation);\n#endif\n#ifdef VIGNETTE\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);\n texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\n#endif\n gl_FragColor = encodeHDR(texel);\n#ifdef DEBUG\n #if DEBUG == 1\n gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));\n #elif DEBUG == 2\n gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);\n #elif DEBUG == 3\n gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));\n #endif\n#endif\n if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {\n gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));\n }\n#ifdef PREMULTIPLY_ALPHA\n gl_FragColor.rgb *= gl_FragColor.a;\n#endif\n}\n@end",H7="@export clay.compositor.blend\n#define SHADER_NAME blend\n#ifdef TEXTURE1_ENABLED\nuniform sampler2D texture1;\nuniform float weight1 : 1.0;\n#endif\n#ifdef TEXTURE2_ENABLED\nuniform sampler2D texture2;\nuniform float weight2 : 1.0;\n#endif\n#ifdef TEXTURE3_ENABLED\nuniform sampler2D texture3;\nuniform float weight3 : 1.0;\n#endif\n#ifdef TEXTURE4_ENABLED\nuniform sampler2D texture4;\nuniform float weight4 : 1.0;\n#endif\n#ifdef TEXTURE5_ENABLED\nuniform sampler2D texture5;\nuniform float weight5 : 1.0;\n#endif\n#ifdef TEXTURE6_ENABLED\nuniform sampler2D texture6;\nuniform float weight6 : 1.0;\n#endif\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = vec4(0.0);\n#ifdef TEXTURE1_ENABLED\n tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;\n#endif\n#ifdef TEXTURE2_ENABLED\n tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;\n#endif\n#ifdef TEXTURE3_ENABLED\n tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;\n#endif\n#ifdef TEXTURE4_ENABLED\n tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;\n#endif\n#ifdef TEXTURE5_ENABLED\n tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;\n#endif\n#ifdef TEXTURE6_ENABLED\n tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;\n#endif\n gl_FragColor = encodeHDR(tex);\n}\n@end",U7="@export clay.compositor.fxaa\nuniform sampler2D texture;\nuniform vec4 viewport : VIEWPORT;\nvarying vec2 v_Texcoord;\n#define FXAA_REDUCE_MIN (1.0/128.0)\n#define FXAA_REDUCE_MUL (1.0/8.0)\n#define FXAA_SPAN_MAX 8.0\n@import clay.util.rgbm\nvoid main()\n{\n vec2 resolution = 1.0 / viewport.zw;\n vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;\n vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;\n vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );\n vec3 rgbM = rgbaM.xyz;\n float opacity = rgbaM.w;\n vec3 luma = vec3( 0.299, 0.587, 0.114 );\n float lumaNW = dot( rgbNW, luma );\n float lumaNE = dot( rgbNE, luma );\n float lumaSW = dot( rgbSW, luma );\n float lumaSE = dot( rgbSE, luma );\n float lumaM = dot( rgbM, luma );\n float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );\n float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );\n vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );\n float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );\n dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * resolution;\n vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;\n rgbA *= 0.5;\n vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;\n rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;\n rgbB *= 0.25;\n rgbB += rgbA * 0.5;\n float lumaB = dot( rgbB, luma );\n if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )\n {\n gl_FragColor = vec4( rgbA, opacity );\n }\n else {\n gl_FragColor = vec4( rgbB, opacity );\n }\n}\n@end";!function(t){t.import("@export clay.compositor.coloradjust\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nuniform float contrast : 1.0;\nuniform float exposure : 0.0;\nuniform float gamma : 1.0;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);\n color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);\n color = clamp( color * pow(2.0, exposure), 0.0, 1.0);\n color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);\n float luminance = dot( color, w );\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.brightness\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float brightness : 0.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = tex.rgb + vec3(brightness);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.contrast\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float contrast : 1.0;\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord);\n vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.exposure\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float exposure : 0.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb * pow(2.0, exposure);\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.gamma\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float gamma : 1.0;\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = pow(tex.rgb, vec3(gamma));\n gl_FragColor = vec4(color, tex.a);\n}\n@end\n@export clay.compositor.saturation\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float saturation : 1.0;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D(texture, v_Texcoord);\n vec3 color = tex.rgb;\n float luminance = dot(color, w);\n color = mix(vec3(luminance), color, saturation);\n gl_FragColor = vec4(color, tex.a);\n}\n@end"),t.import(R7),t.import("@export clay.compositor.hdr.log_lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n@import clay.util.rgbm\nvoid main()\n{\n vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));\n float luminance = dot(tex.rgb, w);\n luminance = log(luminance + 0.001);\n gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));\n}\n@end\n@export clay.compositor.hdr.lum_adaption\nvarying vec2 v_Texcoord;\nuniform sampler2D adaptedLum;\nuniform sampler2D currentLum;\nuniform float frameTime : 0.02;\n@import clay.util.rgbm\nvoid main()\n{\n float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;\n float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);\n fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));\n gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));\n}\n@end\n@export clay.compositor.lum\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\nvoid main()\n{\n vec4 tex = texture2D( texture, v_Texcoord );\n float luminance = dot(tex.rgb, w);\n gl_FragColor = vec4(vec3(luminance), 1.0);\n}\n@end"),t.import(k7),t.import("@export clay.compositor.vignette\n#define OUTPUT_ALPHA\nvarying vec2 v_Texcoord;\nuniform sampler2D texture;\nuniform float darkness: 1;\nuniform float offset: 1;\n@import clay.util.rgbm\nvoid main()\n{\n vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));\n gl_FragColor.rgb = texel.rgb;\n vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);\n gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));\n}\n@end"),t.import(z7),t.import(B7),t.import(V7),t.import(F7),t.import(G7),t.import("@export clay.compositor.lensflare\n#define SAMPLE_NUMBER 8\nuniform sampler2D texture;\nuniform sampler2D lenscolor;\nuniform vec2 textureSize : [512, 512];\nuniform float dispersal : 0.3;\nuniform float haloWidth : 0.4;\nuniform float distortion : 1.0;\nvarying vec2 v_Texcoord;\n@import clay.util.rgbm\nvec4 textureDistorted(\n in vec2 texcoord,\n in vec2 direction,\n in vec3 distortion\n) {\n return vec4(\n decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,\n decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,\n 1.0\n );\n}\nvoid main()\n{\n vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;\n vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;\n vec2 haloVec = normalize(ghostVec) * haloWidth;\n vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);\n vec4 result = vec4(0.0);\n for (int i = 0; i < SAMPLE_NUMBER; i++)\n {\n vec2 offset = fract(texcoord + ghostVec * float(i));\n float weight = length(vec2(0.5) - offset) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n }\n result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));\n float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));\n weight = pow(1.0 - weight, 10.0);\n vec2 offset = fract(texcoord + haloVec);\n result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;\n gl_FragColor = result;\n}\n@end"),t.import(H7),t.import(U7)}(R5);var W7=/^#source\((.*?)\)/;function X7(t,e){var n=new L7;e=e||{};var r={textures:{},parameters:{}};for(var i in t.parameters){var o=t.parameters[i];r.parameters[i]=q7(o)}return function(t,e,n,r){if(!t.textures)return void r({});var i={},o=0,a=!1,s=n.textureRootPath;A1.each(t.textures,function(t,e){var n,l=t.path,u=q7(t.parameters);if(Array.isArray(l)&&6===l.length)s&&(l=l.map(function(t){return A1.relative2absolute(t,s)})),n=new p6(u);else{if("string"!=typeof l)return;s&&(l=A1.relative2absolute(l,s)),n=new l4(u)}n.load(l),o++,n.once("success",function(){i[e]=n,0===--o&&(r(i),a=!0)})}),0!==o||a||r(i)}(t,0,e,function(i){r.textures=i,function(){for(var i=0;i<t.nodes.length;i++){var o=j7(t.nodes[i],r,e);o&&n.addNode(o)}}()}),n}function j7(t,e,n){var r,i,o,a,s=t.type||"filter";if("filter"===s){var l=t.shader.trim(),u=W7.exec(l);if(u?r=R5.source(u[1].trim()):"#"===l.charAt(0)&&(r=e.shaders[l.substr(1)]),r||(r=l),!r)return}if(t.inputs)for(var h in i={},t.inputs)"string"==typeof t.inputs[h]?i[h]=t.inputs[h]:i[h]={node:t.inputs[h].node,pin:t.inputs[h].pin};if(t.outputs)for(var h in o={},t.outputs){var c=t.outputs[h];o[h]={},null!=c.attachment&&(o[h].attachment=c.attachment),null!=c.keepLastFrame&&(o[h].keepLastFrame=c.keepLastFrame),null!=c.outputLastFrame&&(o[h].outputLastFrame=c.outputLastFrame),c.parameters&&(o[h].parameters=q7(c.parameters))}if(a="scene"===s?new P7({name:t.name,scene:n.scene,camera:n.camera,outputs:o}):"texture"===s?new E7({name:t.name,outputs:o}):new N7({name:t.name,shader:r,inputs:i,outputs:o})){if(t.parameters)for(var h in t.parameters){"string"==typeof(d=t.parameters[h])?"#"===(d=d.trim()).charAt(0)?d=e.textures[d.substr(1)]:a.on("beforerender",K7(h,J7(d))):"function"==typeof d&&a.on("beforerender",d),a.setParameter(h,d)}if(t.defines&&a.pass)for(var h in t.defines){var d=t.defines[h];a.pass.material.define("fragment",h,d)}}return a}function Z7(t,e){return t}function Y7(t,e){return e}function q7(t){var e={};if(!t)return e;["type","minFilter","magFilter","wrapS","wrapT","flipY","useMipmap"].forEach(function(n){var r=t[n];null!=r&&("string"==typeof r&&(r=n4[r]),e[n]=r)});var n=t.scale||1;return["width","height"].forEach(function(r){if(null!=t[r]){var i=t[r];"string"==typeof i?(i=i.trim(),e[r]=function(t,e,n){return n=n||1,function(t){var r=t.getDevicePixelRatio(),i=t.getWidth()*n,o=t.getHeight()*n;return e(i,o,r)}}(0,J7(i),n)):e[r]=i}}),e.width||(e.width=Z7),e.height||(e.height=Y7),null!=t.useMipmap&&(e.useMipmap=t.useMipmap),e}function K7(t,e){return function(n){var r=n.getDevicePixelRatio(),i=n.getWidth(),o=n.getHeight(),a=e(i,o,r);this.setParameter(t,a)}}function J7(t){var e=/^expr\((.*)\)$/.exec(t);if(e)try{var n=new Function("width","height","dpr","return "+e[1]);return n(1,1),n}catch(t){throw new Error("Invalid expression.")}}function Q7(t,e){for(var n=0,r=1/e,i=t;i>0;)n+=r*(i%e),i=Math.floor(i/e),r/=e;return n}function $7(t){for(var e=new Uint8Array(t*t*4),n=0,r=new W1,i=0;i<t;i++)for(var o=0;o<t;o++)r.set(2*Math.random()-1,2*Math.random()-1,0).normalize(),e[n++]=255*(.5*r.x+.5),e[n++]=255*(.5*r.y+.5),e[n++]=0,e[n++]=255;return e}function ttt(t){return new l4({pixels:$7(t),wrapS:n4.REPEAT,wrapT:n4.REPEAT,width:t,height:t})}function ett(t,e,n){var r=new Float32Array(3*t);e=e||0;for(var i=0;i<t;i++){var o=Q7(i+e,2)*(n?1:2)*Math.PI,a=Q7(i+e,3)*Math.PI,s=Math.random(),l=Math.cos(o)*Math.sin(a)*s,u=Math.cos(a)*s,h=Math.sin(o)*Math.sin(a)*s;r[3*i]=l,r[3*i+1]=u,r[3*i+2]=h}return r}function ntt(t){t=t||{},this._ssaoPass=new c8({fragment:R5.source("ecgl.ssao.estimate")}),this._blurPass=new c8({fragment:R5.source("ecgl.ssao.blur")}),this._framebuffer=new I6({depthBuffer:!1}),this._ssaoTexture=new l4,this._blurTexture=new l4,this._blurTexture2=new l4,this._depthTex=t.depthTexture,this._normalTex=t.normalTexture,this.setNoiseSize(4),this.setKernelSize(t.kernelSize||12),null!=t.radius&&this.setParameter("radius",t.radius),null!=t.power&&this.setParameter("power",t.power),this._normalTex||(this._ssaoPass.material.disableTexture("normalTex"),this._blurPass.material.disableTexture("normalTex")),this._depthTex||this._blurPass.material.disableTexture("depthTex"),this._blurPass.material.setUniform("normalTex",this._normalTex),this._blurPass.material.setUniform("depthTex",this._depthTex)}R5.import("@export ecgl.ssao.estimate\n\nuniform sampler2D depthTex;\n\nuniform sampler2D normalTex;\n\nuniform sampler2D noiseTex;\n\nuniform vec2 depthTexSize;\n\nuniform vec2 noiseTexSize;\n\nuniform mat4 projection;\n\nuniform mat4 projectionInv;\n\nuniform mat4 viewInverseTranspose;\n\nuniform vec3 kernel[KERNEL_SIZE];\n\nuniform float radius : 1;\n\nuniform float power : 1;\n\nuniform float bias: 1e-2;\n\nuniform float intensity: 1.0;\n\nvarying vec2 v_Texcoord;\n\nfloat ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {\n float occlusion = 0.0;\n\n for (int i = 0; i < KERNEL_SIZE; i++) {\n vec3 samplePos = kernel[i];\n#ifdef NORMALTEX_ENABLED\n samplePos = kernelBasis * samplePos;\n#endif\n samplePos = samplePos * radius + originPos;\n\n vec4 texCoord = projection * vec4(samplePos, 1.0);\n texCoord.xy /= texCoord.w;\n\n vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);\n\n float sampleDepth = depthTexel.r * 2.0 - 1.0;\n if (projection[3][3] == 0.0) {\n sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);\n }\n else {\n sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];\n }\n \n float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));\n occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);\n }\n#ifdef NORMALTEX_ENABLED\n occlusion = 1.0 - occlusion / float(KERNEL_SIZE);\n#else\n occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);\n#endif\n return pow(occlusion, power);\n}\n\nvoid main()\n{\n\n vec4 depthTexel = texture2D(depthTex, v_Texcoord);\n\n#ifdef NORMALTEX_ENABLED\n vec4 tex = texture2D(normalTex, v_Texcoord);\n if (dot(tex.rgb, tex.rgb) == 0.0) {\n gl_FragColor = vec4(1.0);\n return;\n }\n vec3 N = tex.rgb * 2.0 - 1.0;\n N = (viewInverseTranspose * vec4(N, 0.0)).xyz;\n\n vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;\n vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;\n vec3 T = normalize(rvec - N * dot(rvec, N));\n vec3 BT = normalize(cross(N, T));\n mat3 kernelBasis = mat3(T, BT, N);\n#else\n if (depthTexel.r > 0.99999) {\n gl_FragColor = vec4(1.0);\n return;\n }\n mat3 kernelBasis;\n#endif\n\n float z = depthTexel.r * 2.0 - 1.0;\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * projectedPos;\n\n vec3 position = p4.xyz / p4.w;\n\n float ao = ssaoEstimator(position, kernelBasis);\n ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);\n gl_FragColor = vec4(vec3(ao), 1.0);\n}\n\n@end\n\n\n@export ecgl.ssao.blur\n#define SHADER_NAME SSAO_BLUR\n\nuniform sampler2D ssaoTexture;\n\n#ifdef NORMALTEX_ENABLED\nuniform sampler2D normalTex;\n#endif\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\nuniform int direction: 0.0;\n\n#ifdef DEPTHTEX_ENABLED\nuniform sampler2D depthTex;\nuniform mat4 projection;\nuniform float depthRange : 0.5;\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n#endif\n\nvoid main()\n{\n float kernel[5];\n kernel[0] = 0.122581;\n kernel[1] = 0.233062;\n kernel[2] = 0.288713;\n kernel[3] = 0.233062;\n kernel[4] = 0.122581;\n\n vec2 off = vec2(0.0);\n if (direction == 0) {\n off[0] = blurSize / textureSize.x;\n }\n else {\n off[1] = blurSize / textureSize.y;\n }\n\n vec2 coord = v_Texcoord;\n\n float sum = 0.0;\n float weightAll = 0.0;\n\n#ifdef NORMALTEX_ENABLED\n vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;\n#endif\n#if defined(DEPTHTEX_ENABLED)\n float centerDepth = getLinearDepth(v_Texcoord);\n#endif\n\n for (int i = 0; i < 5; i++) {\n vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));\n\n float w = kernel[i];\n#ifdef NORMALTEX_ENABLED\n vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;\n w *= clamp(dot(normal, centerNormal), 0.0, 1.0);\n#endif\n#ifdef DEPTHTEX_ENABLED\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));\n#endif\n\n weightAll += w;\n sum += texture2D(ssaoTexture, coord).r * w;\n }\n\n gl_FragColor = vec4(vec3(sum / weightAll), 1.0);\n}\n\n@end\n"),ntt.prototype.setDepthTexture=function(t){this._depthTex=t},ntt.prototype.setNormalTexture=function(t){this._normalTex=t,this._ssaoPass.material[t?"enableTexture":"disableTexture"]("normalTex"),this.setKernelSize(this._kernelSize)},ntt.prototype.update=function(t,e,n){var r=t.getWidth(),i=t.getHeight(),o=this._ssaoPass,a=this._blurPass;o.setUniform("kernel",this._kernels[n%this._kernels.length]),o.setUniform("depthTex",this._depthTex),null!=this._normalTex&&o.setUniform("normalTex",this._normalTex),o.setUniform("depthTexSize",[this._depthTex.width,this._depthTex.height]);var s=new v2;v2.transpose(s,e.worldTransform),o.setUniform("projection",e.projectionMatrix.array),o.setUniform("projectionInv",e.invProjectionMatrix.array),o.setUniform("viewInverseTranspose",s.array);var l=this._ssaoTexture,u=this._blurTexture,h=this._blurTexture2;l.width=r/2,l.height=i/2,u.width=r,u.height=i,h.width=r,h.height=i,this._framebuffer.attach(l),this._framebuffer.bind(t),t.gl.clearColor(1,1,1,1),t.gl.clear(t.gl.COLOR_BUFFER_BIT),o.render(t),a.setUniform("textureSize",[r/2,i/2]),a.setUniform("projection",e.projectionMatrix.array),this._framebuffer.attach(u),a.setUniform("direction",0),a.setUniform("ssaoTexture",l),a.render(t),this._framebuffer.attach(h),a.setUniform("textureSize",[r,i]),a.setUniform("direction",1),a.setUniform("ssaoTexture",u),a.render(t),this._framebuffer.unbind(t);var c=t.clearColor;t.gl.clearColor(c[0],c[1],c[2],c[3])},ntt.prototype.getTargetTexture=function(){return this._blurTexture2},ntt.prototype.setParameter=function(t,e){"noiseTexSize"===t?this.setNoiseSize(e):"kernelSize"===t?this.setKernelSize(e):"intensity"===t?this._ssaoPass.material.set("intensity",e):this._ssaoPass.setUniform(t,e)},ntt.prototype.setKernelSize=function(t){this._kernelSize=t,this._ssaoPass.material.define("fragment","KERNEL_SIZE",t),this._kernels=this._kernels||[];for(var e=0;e<30;e++)this._kernels[e]=ett(t,e*t,!!this._normalTex)},ntt.prototype.setNoiseSize=function(t){var e=this._ssaoPass.getUniform("noiseTex");e?(e.data=$7(t),e.width=e.height=t,e.dirty()):(e=ttt(t),this._ssaoPass.setUniform("noiseTex",ttt(t))),this._ssaoPass.setUniform("noiseTexSize",[t,t])},ntt.prototype.dispose=function(t){this._blurTexture.dispose(t),this._ssaoTexture.dispose(t),this._blurTexture2.dispose(t)};function rtt(t){t=t||{},this._ssrPass=new c8({fragment:R5.source("ecgl.ssr.main"),clearColor:[0,0,0,0]}),this._blurPass1=new c8({fragment:R5.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blurPass2=new c8({fragment:R5.source("ecgl.ssr.blur"),clearColor:[0,0,0,0]}),this._blendPass=new c8({fragment:R5.source("clay.compositor.blend")}),this._blendPass.material.disableTexturesAll(),this._blendPass.material.enableTexture(["texture1","texture2"]),this._ssrPass.setUniform("gBufferTexture1",t.normalTexture),this._ssrPass.setUniform("gBufferTexture2",t.depthTexture),this._blurPass1.setUniform("gBufferTexture1",t.normalTexture),this._blurPass1.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.setUniform("gBufferTexture1",t.normalTexture),this._blurPass2.setUniform("gBufferTexture2",t.depthTexture),this._blurPass2.material.define("fragment","VERTICAL"),this._blurPass2.material.define("fragment","BLEND"),this._ssrTexture=new l4({type:n4.HALF_FLOAT}),this._texture2=new l4({type:n4.HALF_FLOAT}),this._texture3=new l4({type:n4.HALF_FLOAT}),this._prevTexture=new l4({type:n4.HALF_FLOAT}),this._currentTexture=new l4({type:n4.HALF_FLOAT}),this._frameBuffer=new I6({depthBuffer:!1}),this._normalDistribution=null,this._totalSamples=256,this._samplePerFrame=4,this._ssrPass.material.define("fragment","SAMPLE_PER_FRAME",this._samplePerFrame),this._ssrPass.material.define("fragment","TOTAL_SAMPLES",this._totalSamples),this._downScale=1}R5.import("@export ecgl.ssr.main\n\n#define SHADER_NAME SSR\n#define MAX_ITERATION 20;\n#define SAMPLE_PER_FRAME 5;\n#define TOTAL_SAMPLES 128;\n\nuniform sampler2D sourceTexture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform sampler2D gBufferTexture3;\nuniform samplerCube specularCubemap;\nuniform float specularIntensity: 1;\n\nuniform mat4 projection;\nuniform mat4 projectionInv;\nuniform mat4 toViewSpace;\nuniform mat4 toWorldSpace;\n\nuniform float maxRayDistance: 200;\n\nuniform float pixelStride: 16;\nuniform float pixelStrideZCutoff: 50; \nuniform float screenEdgeFadeStart: 0.9; \nuniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; \nuniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;\n\nuniform float nearZ;\nuniform vec2 viewportSize : VIEWPORT_SIZE;\n\nuniform float jitterOffset: 0;\n\nvarying vec2 v_Texcoord;\n\n#ifdef DEPTH_DECODE\n@import clay.util.decode_float\n#endif\n\n#ifdef PHYSICALLY_CORRECT\nuniform sampler2D normalDistribution;\nuniform float sampleOffset: 0;\nuniform vec2 normalDistributionSize;\n\nvec3 transformNormal(vec3 H, vec3 N) {\n vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);\n vec3 tangentX = normalize(cross(N, upVector));\n vec3 tangentZ = cross(N, tangentX);\n return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);\n}\nvec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {\n float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));\n vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;\n return transformNormal(H, N);\n}\nfloat G_Smith(float g, float ndv, float ndl) {\n float roughness = 1.0 - g;\n float k = roughness * roughness / 2.0;\n float G1V = ndv / (ndv * (1.0 - k) + k);\n float G1L = ndl / (ndl * (1.0 - k) + k);\n return G1L * G1V;\n}\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n#endif\n\nfloat fetchDepth(sampler2D depthTexture, vec2 uv)\n{\n vec4 depthTexel = texture2D(depthTexture, uv);\n return depthTexel.r * 2.0 - 1.0;\n}\n\nfloat linearDepth(float depth)\n{\n if (projection[3][3] == 0.0) {\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n }\n else {\n return (depth - projection[3][2]) / projection[2][2];\n }\n}\n\nbool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)\n{\n if (rayZFar > rayZNear)\n {\n float t = rayZFar; rayZFar = rayZNear; rayZNear = t;\n }\n float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));\n return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;\n}\n\n\nbool traceScreenSpaceRay(\n vec3 rayOrigin, vec3 rayDir, float jitter,\n out vec2 hitPixel, out vec3 hitPoint, out float iterationCount\n)\n{\n float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)\n ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;\n\n vec3 rayEnd = rayOrigin + rayDir * rayLength;\n\n vec4 H0 = projection * vec4(rayOrigin, 1.0);\n vec4 H1 = projection * vec4(rayEnd, 1.0);\n\n float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;\n\n vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;\n\n vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;\n vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;\n\n P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;\n vec2 delta = P1 - P0;\n\n bool permute = false;\n if (abs(delta.x) < abs(delta.y)) {\n permute = true;\n delta = delta.yx;\n P0 = P0.yx;\n P1 = P1.yx;\n }\n float stepDir = sign(delta.x);\n float invdx = stepDir / delta.x;\n\n vec3 dQ = (Q1 - Q0) * invdx;\n float dk = (k1 - k0) * invdx;\n\n vec2 dP = vec2(stepDir, delta.y * invdx);\n\n float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);\n float pixStride = 1.0 + strideScaler * pixelStride;\n\n dP *= pixStride; dQ *= pixStride; dk *= pixStride;\n\n vec4 pqk = vec4(P0, Q0.z, k0);\n vec4 dPQK = vec4(dP, dQ.z, dk);\n\n pqk += dPQK * jitter;\n float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n float rayZNear;\n\n bool intersect = false;\n\n vec2 texelSize = 1.0 / viewportSize;\n\n iterationCount = 0.0;\n\n for (int i = 0; i < MAX_ITERATION; i++)\n {\n pqk += dPQK;\n\n rayZNear = rayZFar;\n rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);\n\n hitPixel = permute ? pqk.yx : pqk.xy;\n hitPixel *= texelSize;\n\n intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);\n\n iterationCount += 1.0;\n\n dPQK *= 1.2;\n\n if (intersect) {\n break;\n }\n }\n\n Q0.xy += dQ.xy * iterationCount;\n Q0.z = pqk.z;\n hitPoint = Q0 / pqk.w;\n\n return intersect;\n}\n\nfloat calculateAlpha(\n float iterationCount, float reflectivity,\n vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir\n)\n{\n float alpha = clamp(reflectivity, 0.0, 1.0);\n alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));\n vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;\n float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));\n alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);\n\n float _eyeFadeStart = eyeFadeStart;\n float _eyeFadeEnd = eyeFadeEnd;\n if (_eyeFadeStart > _eyeFadeEnd) {\n float tmp = _eyeFadeEnd;\n _eyeFadeEnd = _eyeFadeStart;\n _eyeFadeStart = tmp;\n }\n\n float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);\n alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);\n\n alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);\n\n return alpha;\n}\n\n@import clay.util.rand\n\n@import clay.util.rgbm\n\nvoid main()\n{\n vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);\n\n if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {\n discard;\n }\n\n float g = normalAndGloss.a;\n#if !defined(PHYSICALLY_CORRECT)\n if (g <= minGlossiness) {\n discard;\n }\n#endif\n\n float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);\n\n vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);\n N = normalize((toViewSpace * vec4(N, 0.0)).xyz);\n\n vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);\n vec4 pos = projectionInv * projectedPos;\n vec3 rayOrigin = pos.xyz / pos.w;\n vec3 V = -normalize(rayOrigin);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n float iterationCount;\n float jitter = rand(fract(v_Texcoord + jitterOffset));\n\n#ifdef PHYSICALLY_CORRECT\n vec4 color = vec4(vec3(0.0), 1.0);\n vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);\n vec3 albedo = albedoMetalness.rgb;\n float m = albedoMetalness.a;\n vec3 diffuseColor = albedo * (1.0 - m);\n vec3 spec = mix(vec3(0.04), albedo, m);\n\n float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);\n\n for (int i = 0; i < SAMPLE_PER_FRAME; i++) {\n vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);\n vec3 rayDir = normalize(reflect(-V, H));\n#else\n vec3 rayDir = normalize(reflect(-V, N));\n#endif\n vec2 hitPixel;\n vec3 hitPoint;\n\n bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);\n\n float dist = distance(rayOrigin, hitPoint);\n\n vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;\n hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);\n#ifdef PHYSICALLY_CORRECT\n float ndl = clamp(dot(N, rayDir), 0.0, 1.0);\n float vdh = clamp(dot(V, H), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n vec3 litTexel = vec3(0.0);\n if (dot(hitNormal, rayDir) < 0.0 && intersect) {\n litTexel = texture2D(sourceTexture, hitPixel).rgb;\n litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);\n\n }\n else {\n #ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;\n#endif\n }\n color.rgb += ndl * litTexel * (\n F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)\n );\n }\n color.rgb /= float(SAMPLE_PER_FRAME);\n#else\n #if !defined(SPECULARCUBEMAP_ENABLED)\n if (dot(hitNormal, rayDir) >= 0.0) {\n discard;\n }\n if (!intersect) {\n discard;\n }\n#endif\n float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);\n vec4 color = texture2D(sourceTexture, hitPixel);\n color.rgb *= alpha;\n\n#ifdef SPECULARCUBEMAP_ENABLED\n vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;\n alpha = alpha * (intersect ? 1.0 : 0.0);\n float bias = (1.0 -g) * 5.0;\n color.rgb += (1.0 - alpha)\n * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb\n * specularIntensity;\n#endif\n\n#endif\n\n gl_FragColor = encodeHDR(color);\n}\n@end\n\n@export ecgl.ssr.blur\n\nuniform sampler2D texture;\nuniform sampler2D gBufferTexture1;\nuniform sampler2D gBufferTexture2;\nuniform mat4 projection;\nuniform float depthRange : 0.05;\n\nvarying vec2 v_Texcoord;\n\nuniform vec2 textureSize;\nuniform float blurSize : 1.0;\n\n#ifdef BLEND\n #ifdef SSAOTEX_ENABLED\nuniform sampler2D ssaoTex;\n #endif\nuniform sampler2D sourceTexture;\n#endif\n\nfloat getLinearDepth(vec2 coord)\n{\n float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;\n return projection[3][2] / (depth * projection[2][3] - projection[2][2]);\n}\n\n@import clay.util.rgbm\n\n\nvoid main()\n{\n @import clay.compositor.kernel.gaussian_9\n\n vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);\n float g = centerNTexel.a;\n float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;\n#ifdef VERTICAL\n vec2 off = vec2(0.0, maxBlurSize / textureSize.y);\n#else\n vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);\n#endif\n\n vec2 coord = v_Texcoord;\n\n vec4 sum = vec4(0.0);\n float weightAll = 0.0;\n\n vec3 cN = centerNTexel.rgb * 2.0 - 1.0;\n float cD = getLinearDepth(v_Texcoord);\n for (int i = 0; i < 9; i++) {\n vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));\n float w = gaussianKernel[i]\n * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);\n float d = getLinearDepth(coord);\n w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));\n\n weightAll += w;\n sum += decodeHDR(texture2D(texture, coord)) * w;\n }\n\n#ifdef BLEND\n float aoFactor = 1.0;\n #ifdef SSAOTEX_ENABLED\n aoFactor = texture2D(ssaoTex, v_Texcoord).r;\n #endif\n gl_FragColor = encodeHDR(\n sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))\n );\n#else\n gl_FragColor = encodeHDR(sum / weightAll);\n#endif\n}\n\n@end"),rtt.prototype.setAmbientCubemap=function(t,e){this._ssrPass.material.set("specularCubemap",t),this._ssrPass.material.set("specularIntensity",e);var n=t&&e;this._ssrPass.material[n?"enableTexture":"disableTexture"]("specularCubemap")},rtt.prototype.update=function(t,e,n,r){var i=t.getWidth(),o=t.getHeight(),a=this._ssrTexture,s=this._texture2,l=this._texture3;a.width=this._prevTexture.width=this._currentTexture.width=i/this._downScale,a.height=this._prevTexture.height=this._currentTexture.height=o/this._downScale,s.width=l.width=i,s.height=l.height=o;var u=this._frameBuffer,h=this._ssrPass,c=this._blurPass1,d=this._blurPass2,p=this._blendPass,f=new v2,g=new v2;v2.transpose(f,e.worldTransform),v2.transpose(g,e.viewMatrix),h.setUniform("sourceTexture",n),h.setUniform("projection",e.projectionMatrix.array),h.setUniform("projectionInv",e.invProjectionMatrix.array),h.setUniform("toViewSpace",f.array),h.setUniform("toWorldSpace",g.array),h.setUniform("nearZ",e.near);var m=r/this._totalSamples*this._samplePerFrame;if(h.setUniform("jitterOffset",m),h.setUniform("sampleOffset",r*this._samplePerFrame),c.setUniform("textureSize",[a.width,a.height]),d.setUniform("textureSize",[i,o]),d.setUniform("sourceTexture",n),c.setUniform("projection",e.projectionMatrix.array),d.setUniform("projection",e.projectionMatrix.array),u.attach(a),u.bind(t),h.render(t),this._physicallyCorrect&&(u.attach(this._currentTexture),p.setUniform("texture1",this._prevTexture),p.setUniform("texture2",a),p.material.set({weight1:r>=1?.95:0,weight2:r>=1?.05:1}),p.render(t)),u.attach(s),c.setUniform("texture",this._physicallyCorrect?this._currentTexture:a),c.render(t),u.attach(l),d.setUniform("texture",s),d.render(t),u.unbind(t),this._physicallyCorrect){var v=this._prevTexture;this._prevTexture=this._currentTexture,this._currentTexture=v}},rtt.prototype.getTargetTexture=function(){return this._texture3},rtt.prototype.setParameter=function(t,e){"maxIteration"===t?this._ssrPass.material.define("fragment","MAX_ITERATION",e):this._ssrPass.setUniform(t,e)},rtt.prototype.setPhysicallyCorrect=function(t){t?(this._normalDistribution||(this._normalDistribution=f8.generateNormalDistribution(64,this._totalSamples)),this._ssrPass.material.define("fragment","PHYSICALLY_CORRECT"),this._ssrPass.material.set("normalDistribution",this._normalDistribution),this._ssrPass.material.set("normalDistributionSize",[64,this._totalSamples])):this._ssrPass.material.undefine("fragment","PHYSICALLY_CORRECT"),this._physicallyCorrect=t},rtt.prototype.setSSAOTexture=function(t){var e=this._blurPass2;t?(e.material.enableTexture("ssaoTex"),e.material.set("ssaoTex",t)):e.material.disableTexture("ssaoTex")},rtt.prototype.isFinished=function(t){return!this._physicallyCorrect||t>this._totalSamples/this._samplePerFrame},rtt.prototype.dispose=function(t){this._ssrTexture.dispose(t),this._texture2.dispose(t),this._texture3.dispose(t),this._prevTexture.dispose(t),this._currentTexture.dispose(t),this._frameBuffer.dispose(t)};var itt=[0,0,-.321585265978,-.154972575841,.458126042375,.188473391593,.842080129861,.527766490688,.147304551086,-.659453822776,-.331943915203,-.940619700594,.0479226680259,.54812163202,.701581552186,-.709825561388,-.295436780218,.940589268233,-.901489676764,.237713156085,.973570876096,-.109899459384,-.866792314779,-.451805525005,.330975007087,.800048655954,-.344275183665,.381779221166,-.386139432542,-.437418421534,-.576478634965,-.0148463392551,.385798197415,-.262426961053,-.666302061145,.682427250835,-.628010632582,-.732836215494,.10163141741,-.987658134403,.711995289051,-.320024291314,.0296005138058,.950296523438,.0130612307608,-.351024443122,-.879596633704,-.10478487883,.435712737232,.504254490347,.779203817497,.206477676721,.388264289969,-.896736162545,-.153106280781,-.629203242522,-.245517550697,.657969239148,.126830499058,.26862328493,-.634888119007,-.302301223431,.617074219636,.779817204925];function ott(t,e,n,r,i){var o=t.gl;e.setUniform(o,"1i",n,i),o.activeTexture(o.TEXTURE0+i),r.isRenderable()?r.bind(t):r.unbind(t)}function att(t,e,n,r,i){var o,a,s,l,u=t.gl;return function(i,h,c){if(!l||l.material!==i.material){var d=i.material,p=i.__program,f=d.get("roughness");null==f&&(f=1);var g=d.get("normalMap")||e,m=d.get("roughnessMap"),v=d.get("bumpMap"),y=d.get("uvRepeat"),_=d.get("uvOffset"),x=d.get("detailUvRepeat"),b=d.get("detailUvOffset"),w=!!v&&d.isTextureEnabled("bumpMap"),S=!!m&&d.isTextureEnabled("roughnessMap"),T=d.isDefined("fragment","DOUBLE_SIDED");v=v||n,m=m||r,c!==h?(h.set("normalMap",g),h.set("bumpMap",v),h.set("roughnessMap",m),h.set("useBumpMap",w),h.set("useRoughnessMap",S),h.set("doubleSide",T),null!=y&&h.set("uvRepeat",y),null!=_&&h.set("uvOffset",_),null!=x&&h.set("detailUvRepeat",x),null!=b&&h.set("detailUvOffset",b),h.set("roughness",f)):(p.setUniform(u,"1f","roughness",f),o!==g&&ott(t,p,"normalMap",g,0),a!==v&&v&&ott(t,p,"bumpMap",v,1),s!==m&&m&&ott(t,p,"roughnessMap",m,2),null!=y&&p.setUniform(u,"2f","uvRepeat",y),null!=_&&p.setUniform(u,"2f","uvOffset",_),null!=x&&p.setUniform(u,"2f","detailUvRepeat",x),null!=b&&p.setUniform(u,"2f","detailUvOffset",b),p.setUniform(u,"1i","useBumpMap",+w),p.setUniform(u,"1i","useRoughnessMap",+S),p.setUniform(u,"1i","doubleSide",+T)),o=g,a=v,s=m,l=i}}}function stt(t){this._depthTex=new l4({format:n4.DEPTH_COMPONENT,type:n4.UNSIGNED_INT}),this._normalTex=new l4({type:n4.HALF_FLOAT}),this._framebuffer=new I6,this._framebuffer.attach(this._normalTex),this._framebuffer.attach(this._depthTex,I6.DEPTH_ATTACHMENT),this._normalMaterial=new i5({shader:new R5(R5.source("ecgl.normal.vertex"),R5.source("ecgl.normal.fragment"))}),this._normalMaterial.enableTexture(["normalMap","bumpMap","roughnessMap"]),this._defaultNormalMap=$6.createBlank("#000"),this._defaultBumpMap=$6.createBlank("#000"),this._defaultRoughessMap=$6.createBlank("#000"),this._debugPass=new c8({fragment:R5.source("clay.compositor.output")}),this._debugPass.setUniform("texture",this._normalTex),this._debugPass.material.undefine("fragment","OUTPUT_ALPHA")}function ltt(t){t=t||{},this._edgePass=new c8({fragment:R5.source("ecgl.edge")}),this._edgePass.setUniform("normalTexture",t.normalTexture),this._edgePass.setUniform("depthTexture",t.depthTexture),this._targetTexture=new l4({type:n4.HALF_FLOAT}),this._frameBuffer=new I6,this._frameBuffer.attach(this._targetTexture)}R5.import("@export ecgl.normal.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\n@import ecgl.common.normalMap.vertexHeader\n\n@import ecgl.common.vertexAnimation.header\n\nvoid main()\n{\n\n @import ecgl.common.vertexAnimation.main\n\n @import ecgl.common.uv.main\n\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n @import ecgl.common.normalMap.vertexMain\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n}\n\n\n@end\n\n\n@export ecgl.normal.fragment\n\n#define ROUGHNESS_CHANEL 0\n\nuniform bool useBumpMap;\nuniform bool useRoughnessMap;\nuniform bool doubleSide;\nuniform float roughness;\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n@import ecgl.common.normalMap.fragmentHeader\n@import ecgl.common.bumpMap.header\n\nuniform sampler2D roughnessMap;\n\nvoid main()\n{\n vec3 N = v_Normal;\n \n bool flipNormal = false;\n if (doubleSide) {\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n flipNormal = true;\n }\n }\n\n @import ecgl.common.normalMap.fragmentMain\n\n if (useBumpMap) {\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n }\n\n float g = 1.0 - roughness;\n\n if (useRoughnessMap) {\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n }\n\n if (flipNormal) {\n N = -N;\n }\n\n gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;\n gl_FragColor.a = g;\n}\n@end"),stt.prototype.getDepthTexture=function(){return this._depthTex},stt.prototype.getNormalTexture=function(){return this._normalTex},stt.prototype.update=function(t,e,n){var r=t.getWidth(),i=t.getHeight(),o=this._depthTex,a=this._normalTex,s=this._normalMaterial;o.width=r,o.height=i,a.width=r,a.height=i;var l=e.getRenderList(n).opaque;this._framebuffer.bind(t),t.gl.clearColor(0,0,0,0),t.gl.clear(t.gl.COLOR_BUFFER_BIT|t.gl.DEPTH_BUFFER_BIT),t.gl.disable(t.gl.BLEND),t.renderPass(l,n,{getMaterial:function(){return s},ifRender:function(t){return t.renderNormal},beforeRender:att(t,this._defaultNormalMap,this._defaultBumpMap,this._defaultRoughessMap,this._normalMaterial),sort:t.opaqueSortCompare}),this._framebuffer.unbind(t)},stt.prototype.renderDebug=function(t){this._debugPass.render(t)},stt.prototype.dispose=function(t){this._depthTex.dispose(t),this._normalTex.dispose(t)},ltt.prototype.update=function(t,e,n,r){var i=t.getWidth(),o=t.getHeight(),a=this._targetTexture;a.width=i,a.height=o;var s=this._frameBuffer;s.bind(t),this._edgePass.setUniform("projectionInv",e.invProjectionMatrix.array),this._edgePass.setUniform("textureSize",[i,o]),this._edgePass.setUniform("texture",n),this._edgePass.render(t),s.unbind(t)},ltt.prototype.getTargetTexture=function(){return this._targetTexture},ltt.prototype.setParameter=function(t,e){this._edgePass.setUniform(t,e)},ltt.prototype.dispose=function(t){this._targetTexture.dispose(t),this._frameBuffer.dispose(t)};var utt={type:"compositor",nodes:[{name:"source",type:"texture",outputs:{color:{}}},{name:"source_half",shader:"#source(clay.compositor.downsample)",inputs:{texture:"source"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bright",shader:"#source(clay.compositor.bright)",inputs:{texture:"source_half"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{threshold:2,scale:4,textureSize:"expr([width * 1.0 / 2, height / 2])"}},{name:"bright_downsample_4",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 2, height / 2] )"}},{name:"bright_downsample_8",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 4, height / 4] )"}},{name:"bright_downsample_16",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 8, height / 8] )"}},{name:"bright_downsample_32",shader:"#source(clay.compositor.downsample)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 32)",height:"expr(height * 1.0 / 32)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0 / 16, height / 16] )"}},{name:"bright_upsample_16_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_32"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 32, height / 32] )"}},{name:"bright_upsample_16_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_16_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 16)",height:"expr(height * 1.0 / 16)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_16"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 16, height * 1.0 / 16] )"}},{name:"bright_upsample_8_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_8_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_8_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_8_blur_v",texture2:"bright_upsample_16_blur_v"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 8)",height:"expr(height * 1.0 / 8)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_4_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_8"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 8, height * 1.0 / 8] )"}},{name:"bright_upsample_4_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_4_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_4_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_4_blur_v",texture2:"bright_upsample_8_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 4)",height:"expr(height * 1.0 / 4)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_2_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_downsample_4"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 4, height * 1.0 / 4] )"}},{name:"bright_upsample_2_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_2_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_2_blend",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_2_blur_v",texture2:"bright_upsample_4_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0 / 2)",height:"expr(height * 1.0 / 2)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"bright_upsample_full_blur_h",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:0,textureSize:"expr( [width * 1.0 / 2, height * 1.0 / 2] )"}},{name:"bright_upsample_full_blur_v",shader:"#source(clay.compositor.gaussian_blur)",inputs:{texture:"bright_upsample_full_blur_h"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{blurSize:1,blurDir:1,textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"bloom_composite",shader:"#source(clay.compositor.blend)",inputs:{texture1:"bright_upsample_full_blur_v",texture2:"bright_upsample_2_blend"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{weight1:.3,weight2:.7}},{name:"coc",shader:"#source(ecgl.dof.coc)",outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{focalDist:50,focalRange:30}},{name:"dof_far_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"}},{name:"dof_near_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"source",coc:"coc"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_NEARFIELD:null}},{name:"dof_coc_blur",shader:"#source(ecgl.dof.diskBlur)",inputs:{texture:"coc"},outputs:{color:{parameters:{minFilter:"NEAREST",magFilter:"NEAREST",width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},parameters:{textureSize:"expr( [width * 1.0, height * 1.0] )"},defines:{BLUR_COC:null}},{name:"dof_composite",shader:"#source(ecgl.dof.composite)",inputs:{original:"source",blurred:"dof_far_blur",nearfield:"dof_near_blur",coc:"coc",nearcoc:"dof_coc_blur"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)",type:"HALF_FLOAT"}}}},{name:"composite",shader:"#source(clay.compositor.hdr.composite)",inputs:{texture:"source",bloom:"bloom_composite"},outputs:{color:{parameters:{width:"expr(width * 1.0)",height:"expr(height * 1.0)"}}},defines:{}},{name:"FXAA",shader:"#source(clay.compositor.fxaa)",inputs:{texture:"composite"}}]};function htt(t,e){return{color:{parameters:{width:t,height:e}}}}R5.import(R7),R5.import(k7),R5.import(z7),R5.import(B7),R5.import(V7),R5.import(F7),R5.import(G7),R5.import(H7),R5.import(U7),R5.import("@export ecgl.dof.coc\n\nuniform sampler2D depth;\n\nuniform float zNear: 0.1;\nuniform float zFar: 2000;\n\nuniform float focalDistance: 3;\nuniform float focalRange: 1;\nuniform float focalLength: 30;\nuniform float fstop: 2.8;\n\nvarying vec2 v_Texcoord;\n\n@import clay.util.encode_float\n\nvoid main()\n{\n float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;\n\n float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));\n\n float aperture = focalLength / fstop;\n\n float coc;\n\n float uppper = focalDistance + focalRange;\n float lower = focalDistance - focalRange;\n if (dist <= uppper && dist >= lower) {\n coc = 0.5;\n }\n else {\n float focalAdjusted = dist > uppper ? uppper : lower;\n\n coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));\n coc = clamp(coc, 0.0, 2.0) / 2.00001;\n\n if (dist < lower) {\n coc = -coc;\n }\n coc = coc * 0.5 + 0.5;\n }\n\n gl_FragColor = encodeFloat(coc);\n}\n@end\n\n\n@export ecgl.dof.composite\n\n#define DEBUG 0\n\nuniform sampler2D original;\nuniform sampler2D blurred;\nuniform sampler2D nearfield;\nuniform sampler2D coc;\nuniform sampler2D nearcoc;\nvarying vec2 v_Texcoord;\n\n@import clay.util.rgbm\n@import clay.util.float\n\nvoid main()\n{\n vec4 blurredColor = texture2D(blurred, v_Texcoord);\n vec4 originalColor = texture2D(original, v_Texcoord);\n\n float fCoc = decodeFloat(texture2D(coc, v_Texcoord));\n\n fCoc = abs(fCoc * 2.0 - 1.0);\n\n float weight = smoothstep(0.0, 1.0, fCoc);\n \n#ifdef NEARFIELD_ENABLED\n vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);\n float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));\n fNearCoc = abs(fNearCoc * 2.0 - 1.0);\n\n gl_FragColor = encodeHDR(\n mix(\n nearfieldColor, mix(originalColor, blurredColor, weight),\n pow(1.0 - fNearCoc, 4.0)\n )\n );\n#else\n gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));\n#endif\n\n}\n\n@end\n\n\n\n@export ecgl.dof.diskBlur\n\n#define POISSON_KERNEL_SIZE 16;\n\nuniform sampler2D texture;\nuniform sampler2D coc;\nvarying vec2 v_Texcoord;\n\nuniform float blurRadius : 10.0;\nuniform vec2 textureSize : [512.0, 512.0];\n\nuniform vec2 poissonKernel[POISSON_KERNEL_SIZE];\n\nuniform float percent;\n\nfloat nrand(const in vec2 n) {\n return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\n@import clay.util.rgbm\n@import clay.util.float\n\n\nvoid main()\n{\n vec2 offset = blurRadius / textureSize;\n\n float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );\n float cosa = cos(rnd);\n float sina = sin(rnd);\n vec4 basis = vec4(cosa, -sina, sina, cosa);\n\n#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)\n offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);\n#endif\n\n#ifdef BLUR_COC\n float cocSum = 0.0;\n#else\n vec4 color = vec4(0.0);\n#endif\n\n\n float weightSum = 0.0;\n\n for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {\n vec2 ofs = poissonKernel[i];\n\n ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));\n\n vec2 uv = v_Texcoord + ofs * offset;\n vec4 texel = texture2D(texture, uv);\n\n float w = 1.0;\n#ifdef BLUR_COC\n float fCoc = decodeFloat(texel) * 2.0 - 1.0;\n cocSum += clamp(fCoc, -1.0, 0.0) * w;\n#else\n texel = texel;\n #if !defined(BLUR_NEARFIELD)\n float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;\n w *= abs(fCoc);\n #endif\n texel.rgb *= texel.a;\n color += texel * w;\n#endif\n\n weightSum += w;\n }\n\n#ifdef BLUR_COC\n gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);\n#else\n color /= weightSum;\n color.rgb /= (color.a + 0.0001);\n gl_FragColor = color;\n#endif\n}\n\n@end"),R5.import("@export ecgl.edge\n\nuniform sampler2D texture;\n\nuniform sampler2D normalTexture;\nuniform sampler2D depthTexture;\n\nuniform mat4 projectionInv;\n\nuniform vec2 textureSize;\n\nuniform vec4 edgeColor: [0,0,0,0.8];\n\nvarying vec2 v_Texcoord;\n\nvec3 packColor(vec2 coord) {\n float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;\n vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);\n vec4 p4 = projectionInv * p;\n\n return vec3(\n texture2D(normalTexture, coord).rg,\n -p4.z / p4.w / 5.0\n );\n}\n\nvoid main() {\n vec2 cc = v_Texcoord;\n vec3 center = packColor(cc);\n\n float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;\n float dx = size / textureSize.x;\n float dy = size / textureSize.y;\n\n vec2 coord;\n vec3 topLeft = packColor(cc+vec2(-dx, -dy));\n vec3 top = packColor(cc+vec2(0.0, -dy));\n vec3 topRight = packColor(cc+vec2(dx, -dy));\n vec3 left = packColor(cc+vec2(-dx, 0.0));\n vec3 right = packColor(cc+vec2(dx, 0.0));\n vec3 bottomLeft = packColor(cc+vec2(-dx, dy));\n vec3 bottom = packColor(cc+vec2(0.0, dy));\n vec3 bottomRight = packColor(cc+vec2(dx, dy));\n\n vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;\n vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;\n\n float edge = sqrt(dot(h, h) + dot(v, v));\n\n edge = smoothstep(0.8, 1.0, edge);\n\n gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);\n}\n@end");var ctt=["composite","FXAA"];function dtt(){this._width,this._height,this._dpr,this._sourceTexture=new l4({type:n4.HALF_FLOAT}),this._depthTexture=new l4({format:n4.DEPTH_COMPONENT,type:n4.UNSIGNED_INT}),this._framebuffer=new I6,this._framebuffer.attach(this._sourceTexture),this._framebuffer.attach(this._depthTexture,I6.DEPTH_ATTACHMENT),this._normalPass=new stt,this._compositor=X7(utt);var t=this._compositor.getNodeByName("source");t.texture=this._sourceTexture;var e=this._compositor.getNodeByName("coc");this._sourceNode=t,this._cocNode=e,this._compositeNode=this._compositor.getNodeByName("composite"),this._fxaaNode=this._compositor.getNodeByName("FXAA"),this._dofBlurNodes=["dof_far_blur","dof_near_blur","dof_coc_blur"].map(function(t){return this._compositor.getNodeByName(t)},this),this._dofBlurKernel=0,this._dofBlurKernelSize=new Float32Array(0),this._finalNodesChain=ctt.map(function(t){return this._compositor.getNodeByName(t)},this);var n={normalTexture:this._normalPass.getNormalTexture(),depthTexture:this._normalPass.getDepthTexture()};this._ssaoPass=new ntt(n),this._ssrPass=new rtt(n),this._edgePass=new ltt(n)}function ptt(t){for(var e=[],n=0;n<30;n++)e.push([Q7(n,2),Q7(n,3)]);this._haltonSequence=e,this._frame=0,this._sourceTex=new l4,this._sourceFb=new I6,this._sourceFb.attach(this._sourceTex),this._prevFrameTex=new l4,this._outputTex=new l4;var r=this._blendPass=new c8({fragment:R5.source("clay.compositor.blend")});r.material.disableTexturesAll(),r.material.enableTexture(["texture1","texture2"]),this._blendFb=new I6({depthBuffer:!1}),this._outputPass=new c8({fragment:R5.source("clay.compositor.output"),blendWithPrevious:!0}),this._outputPass.material.define("fragment","OUTPUT_ALPHA"),this._outputPass.material.blend=function(t){t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)}}function ftt(t){t=t||"perspective",this.layer=null,this.scene=new l6,this.rootNode=this.scene,this.viewport={x:0,y:0,width:0,height:0},this.setProjection(t),this._compositor=new dtt,this._temporalSS=new ptt,this._shadowMapPass=new T7;for(var e=[],n=0,r=0;r<30;r++){for(var i=[],o=0;o<6;o++)i.push(4*Q7(n,2)-2),i.push(4*Q7(n,3)-2),n++;e.push(i)}this._pcfKernels=e,this.scene.on("beforerender",function(t,e,n){this.needsTemporalSS()&&this._temporalSS.jitterProjection(t,n)},this)}dtt.prototype.resize=function(t,e,n){t*=n=n||1,e*=n;var r=this._sourceTexture,i=this._depthTexture;r.width=t,r.height=e,i.width=t,i.height=e;var o={getWidth:function(){return t},getHeight:function(){return e},getDevicePixelRatio:function(){return n}};function a(t,e){if("function"==typeof t[e]){var n=t[e].__original||t[e];t[e]=function(t){return n.call(this,o)},t[e].__original=n}}this._compositor.nodes.forEach(function(t){for(var e in t.outputs){var n=t.outputs[e].parameters;n&&(a(n,"width"),a(n,"height"))}for(var r in t.parameters)a(t.parameters,r)}),this._width=t,this._height=e,this._dpr=n},dtt.prototype.getWidth=function(){return this._width},dtt.prototype.getHeight=function(){return this._height},dtt.prototype._ifRenderNormalPass=function(){return this._enableSSAO||this._enableEdge||this._enableSSR},dtt.prototype._getPrevNode=function(t){for(var e=ctt.indexOf(t.name)-1,n=this._finalNodesChain[e];n&&!this._compositor.getNodeByName(n.name);)e-=1,n=this._finalNodesChain[e];return n},dtt.prototype._getNextNode=function(t){for(var e=ctt.indexOf(t.name)+1,n=this._finalNodesChain[e];n&&!this._compositor.getNodeByName(n.name);)e+=1,n=this._finalNodesChain[e];return n},dtt.prototype._addChainNode=function(t){var e=this._getPrevNode(t),n=this._getNextNode(t);e&&(t.inputs.texture=e.name,n?(t.outputs=htt(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=t.name):t.outputs=null,this._compositor.addNode(t))},dtt.prototype._removeChainNode=function(t){var e=this._getPrevNode(t),n=this._getNextNode(t);e&&(n?(e.outputs=htt(this.getWidth.bind(this),this.getHeight.bind(this)),n.inputs.texture=e.name):e.outputs=null,this._compositor.removeNode(t))},dtt.prototype.updateNormal=function(t,e,n,r){this._ifRenderNormalPass()&&this._normalPass.update(t,e,n)},dtt.prototype.updateSSAO=function(t,e,n,r){this._ssaoPass.update(t,n,r)},dtt.prototype.enableSSAO=function(){this._enableSSAO=!0},dtt.prototype.disableSSAO=function(){this._enableSSAO=!1},dtt.prototype.enableSSR=function(){this._enableSSR=!0},dtt.prototype.disableSSR=function(){this._enableSSR=!1},dtt.prototype.getSSAOTexture=function(){return this._ssaoPass.getTargetTexture()},dtt.prototype.getSourceFrameBuffer=function(){return this._framebuffer},dtt.prototype.getSourceTexture=function(){return this._sourceTexture},dtt.prototype.disableFXAA=function(){this._removeChainNode(this._fxaaNode)},dtt.prototype.enableFXAA=function(){this._addChainNode(this._fxaaNode)},dtt.prototype.enableBloom=function(){this._compositeNode.inputs.bloom="bloom_composite",this._compositor.dirty()},dtt.prototype.disableBloom=function(){this._compositeNode.inputs.bloom=null,this._compositor.dirty()},dtt.prototype.enableDOF=function(){this._compositeNode.inputs.texture="dof_composite",this._compositor.dirty()},dtt.prototype.disableDOF=function(){this._compositeNode.inputs.texture="source",this._compositor.dirty()},dtt.prototype.enableColorCorrection=function(){this._compositeNode.define("COLOR_CORRECTION"),this._enableColorCorrection=!0},dtt.prototype.disableColorCorrection=function(){this._compositeNode.undefine("COLOR_CORRECTION"),this._enableColorCorrection=!1},dtt.prototype.enableEdge=function(){this._enableEdge=!0},dtt.prototype.disableEdge=function(){this._enableEdge=!1},dtt.prototype.setBloomIntensity=function(t){this._compositeNode.setParameter("bloomIntensity",t)},dtt.prototype.setSSAOParameter=function(t,e){switch(t){case"quality":var n={low:6,medium:12,high:32,ultra:62}[e]||12;this._ssaoPass.setParameter("kernelSize",n);break;case"radius":this._ssaoPass.setParameter(t,e),this._ssaoPass.setParameter("bias",e/200);break;case"intensity":this._ssaoPass.setParameter(t,e);break;default:console.warn("Unkown SSAO parameter "+t)}},dtt.prototype.setDOFParameter=function(t,e){switch(t){case"focalDistance":case"focalRange":case"fstop":this._cocNode.setParameter(t,e);break;case"blurRadius":for(var n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].setParameter("blurRadius",e);break;case"quality":var r={low:4,medium:8,high:16,ultra:32}[e]||8;this._dofBlurKernelSize=r;for(n=0;n<this._dofBlurNodes.length;n++)this._dofBlurNodes[n].pass.material.define("POISSON_KERNEL_SIZE",r);this._dofBlurKernel=new Float32Array(2*r);break;default:console.warn("Unkown DOF parameter "+t)}},dtt.prototype.setSSRParameter=function(t,e){if(null!=e)switch(t){case"quality":var n={low:10,medium:15,high:30,ultra:80}[e]||20,r={low:32,medium:16,high:8,ultra:4}[e]||16;this._ssrPass.setParameter("maxIteration",n),this._ssrPass.setParameter("pixelStride",r);break;case"maxRoughness":this._ssrPass.setParameter("minGlossiness",Math.max(Math.min(1-e,1),0));break;case"physical":this.setPhysicallyCorrectSSR(e);break;default:console.warn("Unkown SSR parameter "+t)}},dtt.prototype.setPhysicallyCorrectSSR=function(t){this._ssrPass.setPhysicallyCorrect(t)},dtt.prototype.setEdgeColor=function(t){var e=a9.parseColor(t);this._edgePass.setParameter("edgeColor",e)},dtt.prototype.setExposure=function(t){this._compositeNode.setParameter("exposure",Math.pow(2,t))},dtt.prototype.setColorLookupTexture=function(t,e){this._compositeNode.pass.material.setTextureImage("lut",this._enableColorCorrection?t:"none",e,{minFilter:a9.Texture.NEAREST,magFilter:a9.Texture.NEAREST,flipY:!1})},dtt.prototype.setColorCorrection=function(t,e){this._compositeNode.setParameter(t,e)},dtt.prototype.isSSREnabled=function(){return this._enableSSR},dtt.prototype.composite=function(t,e,n,r,i){var o=this._sourceTexture,a=o;this._enableEdge&&(this._edgePass.update(t,n,o,i),o=a=this._edgePass.getTargetTexture()),this._enableSSR&&(this._ssrPass.update(t,n,o,i),a=this._ssrPass.getTargetTexture(),this._ssrPass.setSSAOTexture(this._enableSSAO?this._ssaoPass.getTargetTexture():null)),this._sourceNode.texture=a,this._cocNode.setParameter("depth",this._depthTexture);for(var s=this._dofBlurKernel,l=this._dofBlurKernelSize,u=i%Math.floor(itt.length/2/l),h=0;h<2*l;h++)s[h]=itt[h+u*l*2];for(h=0;h<this._dofBlurNodes.length;h++)this._dofBlurNodes[h].setParameter("percent",i/30),this._dofBlurNodes[h].setParameter("poissonKernel",s);this._cocNode.setParameter("zNear",n.near),this._cocNode.setParameter("zFar",n.far),this._compositor.render(t,r)},dtt.prototype.dispose=function(t){this._sourceTexture.dispose(t),this._depthTexture.dispose(t),this._framebuffer.dispose(t),this._compositor.dispose(t),this._normalPass.dispose(t),this._ssaoPass.dispose(t)},ptt.prototype={constructor:ptt,jitterProjection:function(t,e){var n=t.viewport,r=n.devicePixelRatio||t.getDevicePixelRatio(),i=n.width*r,o=n.height*r,a=this._haltonSequence[this._frame%this._haltonSequence.length],s=new v2;s.array[12]=(2*a[0]-1)/i,s.array[13]=(2*a[1]-1)/o,v2.mul(e.projectionMatrix,s,e.projectionMatrix),v2.invert(e.invProjectionMatrix,e.projectionMatrix)},resetFrame:function(){this._frame=0},getFrame:function(){return this._frame},getSourceFrameBuffer:function(){return this._sourceFb},getOutputTexture:function(){return this._outputTex},resize:function(t,e){this._prevFrameTex.width=t,this._prevFrameTex.height=e,this._outputTex.width=t,this._outputTex.height=e,this._sourceTex.width=t,this._sourceTex.height=e,this._prevFrameTex.dirty(),this._outputTex.dirty(),this._sourceTex.dirty()},isFinished:function(){return this._frame>=this._haltonSequence.length},render:function(t,e,n){var r=this._blendPass;0===this._frame?(r.setUniform("weight1",0),r.setUniform("weight2",1)):(r.setUniform("weight1",.9),r.setUniform("weight2",.1)),r.setUniform("texture1",this._prevFrameTex),r.setUniform("texture2",e||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(t),r.render(t),this._blendFb.unbind(t),n||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(t));var i=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=i,this._frame++},dispose:function(t){this._sourceFb.dispose(t),this._blendFb.dispose(t),this._prevFrameTex.dispose(t),this._outputTex.dispose(t),this._sourceTex.dispose(t),this._outputPass.dispose(t),this._blendPass.dispose(t)}},ftt.prototype.setProjection=function(t){var e=this.camera;e&&e.update(),"perspective"===t?this.camera instanceof g6||(this.camera=new g6,e&&this.camera.setLocalTransform(e.localTransform)):this.camera instanceof s8||(this.camera=new s8,e&&this.camera.setLocalTransform(e.localTransform)),this.camera.near=.1,this.camera.far=2e3},ftt.prototype.setViewport=function(t,e,n,r,i){this.camera instanceof g6&&(this.camera.aspect=n/r),i=i||1,this.viewport.x=t,this.viewport.y=e,this.viewport.width=n,this.viewport.height=r,this.viewport.devicePixelRatio=i,this._compositor.resize(n*i,r*i),this._temporalSS.resize(n*i,r*i)},ftt.prototype.containPoint=function(t,e){var n=this.viewport;return e=this.layer.renderer.getHeight()-e,t>=n.x&&e>=n.y&&t<=n.x+n.width&&e<=n.y+n.height};var gtt=new u5;function mtt(t,e){var n=Ug(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});n.y=e.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,e.getDevicePixelRatio());var r=t.get("boxWidth"),i=t.get("boxHeight"),o=t.get("boxDepth");["x","y","z"].forEach(function(e){if(!this.getAxis(e))throw new Error("Grid"+t.id+" don't have "+e+"Axis")},this),this.getAxis("x").setExtent(-r/2,r/2),this.getAxis("y").setExtent(o/2,-o/2),this.getAxis("z").setExtent(-i/2,i/2),this.size=[r,i,o]}function vtt(t,e){var n={};t.eachSeries(function(t){if(t.coordinateSystem===this){var e=t.getData();["x","y","z"].forEach(function(t){e.mapDimensionsAll(t,!0).forEach(function(r){var i,o;i=t,o=e.getDataExtent(r,!0),n[i]=n[i]||[1/0,-1/0],n[i][0]=Math.min(o[0],n[i][0]),n[i][1]=Math.max(o[1],n[i][1])})})}},this),["xAxis3D","yAxis3D","zAxis3D"].forEach(function(e){t.eachComponent(e,function(t){var r=e.charAt(0),i=t.getReferringComponents("grid3D").models[0],o=i.coordinateSystem;if(o===this){var a=o.getAxis(r);if(a)console.warn("Can't have two %s in one grid3D",e);else{(a=new s7(r,dM(n[r]||[1/0,-1/0],t))).type=t.get("type");var s="category"===a.type;a.onBand=s&&t.get("boundaryGap"),a.inverse=t.get("inverse"),t.axis=a,a.model=t,a.getLabelModel=function(){return t.getModel("axisLabel",i.getModel("axisLabel"))},a.getTickModel=function(){return t.getModel("axisTick",i.getModel("axisTick"))},o.addAxis(a)}}},this)},this),this.resize(this.model,e)}ftt.prototype.castRay=function(t,e,n){var r=this.layer.renderer,i=r.viewport;return r.viewport=this.viewport,r.screenToNDC(t,e,gtt),this.camera.castRay(gtt,n),r.viewport=i,n},ftt.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this.scene.updateLights();var t=this.scene.updateRenderList(this.camera);this._needsSortProgressively=!1;for(var e=0;e<t.transparent.length;e++){var n=t.transparent[e].geometry;n.needsSortVerticesProgressively&&n.needsSortVerticesProgressively()&&(this._needsSortProgressively=!0),n.needsSortTrianglesProgressively&&n.needsSortTrianglesProgressively()&&(this._needsSortProgressively=!0)}this._frame=0,this._temporalSS.resetFrame()},ftt.prototype.render=function(t,e){this._doRender(t,e,this._frame),this._frame++},ftt.prototype.needsAccumulate=function(){return this.needsTemporalSS()||this._needsSortProgressively},ftt.prototype.needsTemporalSS=function(){var t=this._enableTemporalSS;return"auto"===t&&(t=this._enablePostEffect),t},ftt.prototype.hasDOF=function(){return this._enableDOF},ftt.prototype.isAccumulateFinished=function(){return this.needsTemporalSS()?this._temporalSS.isFinished():this._frame>30},ftt.prototype._doRender=function(t,e,n){var r=this.scene,i=this.camera;n=n||0,this._updateTransparent(t,r,i,n),e||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(t,r,i,!0)),this._updateShadowPCFKernel(n);var o,a=t.clearColor;(t.gl.clearColor(a[0],a[1],a[2],a[3]),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(t,i),this._compositor.updateNormal(t,r,i,this._temporalSS.getFrame())),this._updateSSAO(t,r,i,this._temporalSS.getFrame()),this._enablePostEffect)?((o=this._compositor.getSourceFrameBuffer()).bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),t.render(r,i,!0,!0),o.unbind(t),this.needsTemporalSS()&&e?(this._compositor.composite(t,r,i,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),this._compositor.composite(t,r,i,null,0))):this.needsTemporalSS()&&e?((o=this._temporalSS.getSourceFrameBuffer()).bind(t),t.saveClear(),t.clearBit=t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT,t.render(r,i,!0,!0),t.restoreClear(),o.unbind(t),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),t.render(r,i,!0,!0))},ftt.prototype._updateTransparent=function(t,e,n,r){for(var i=new W1,o=new v2,a=n.getWorldPosition(),s=e.getRenderList(n).transparent,l=0;l<s.length;l++){var u=s[l],h=u.geometry;v2.invert(o,u.worldTransform),W1.transformMat4(i,a,o),h.needsSortTriangles&&h.needsSortTriangles()&&h.doSortTriangles(i,r),h.needsSortVertices&&h.needsSortVertices()&&h.doSortVertices(i,r)}},ftt.prototype._updateSSAO=function(t,e,n){var r=this._enableSSAO&&this._enablePostEffect;r&&this._compositor.updateSSAO(t,e,n,this._temporalSS.getFrame());for(var i=e.getRenderList(n),o=0;o<i.opaque.length;o++){var a=i.opaque[o];a.renderNormal&&a.material[r?"enableTexture":"disableTexture"]("ssaoMap"),r&&a.material.set("ssaoMap",this._compositor.getSSAOTexture())}},ftt.prototype._updateShadowPCFKernel=function(t){for(var e=this._pcfKernels[t%this._pcfKernels.length],n=this.scene.getRenderList(this.camera).opaque,r=0;r<n.length;r++)n[r].receiveShadow&&(n[r].material.set("pcfKernel",e),n[r].material.define("fragment","PCF_KERNEL_SIZE",e.length/2))},ftt.prototype.dispose=function(t){this._compositor.dispose(t.gl),this._temporalSS.dispose(t.gl),this._shadowMapPass.dispose(t)},ftt.prototype.setPostEffect=function(t,e){var n=this._compositor;this._enablePostEffect=t.get("enable");var r=t.getModel("bloom"),i=t.getModel("edge"),o=t.getModel("DOF",t.getModel("depthOfField")),a=t.getModel("SSAO",t.getModel("screenSpaceAmbientOcclusion")),s=t.getModel("SSR",t.getModel("screenSpaceReflection")),l=t.getModel("FXAA"),u=t.getModel("colorCorrection");r.get("enable")?n.enableBloom():n.disableBloom(),o.get("enable")?n.enableDOF():n.disableDOF(),s.get("enable")?n.enableSSR():n.disableSSR(),u.get("enable")?n.enableColorCorrection():n.disableColorCorrection(),i.get("enable")?n.enableEdge():n.disableEdge(),l.get("enable")?n.enableFXAA():n.disableFXAA(),this._enableDOF=o.get("enable"),this._enableSSAO=a.get("enable"),this._enableSSAO?n.enableSSAO():n.disableSSAO(),n.setBloomIntensity(r.get("intensity")),n.setEdgeColor(i.get("color")),n.setColorLookupTexture(u.get("lookupTexture"),e),n.setExposure(u.get("exposure")),["radius","quality","intensity"].forEach(function(t){n.setSSAOParameter(t,a.get(t))}),["quality","maxRoughness","physical"].forEach(function(t){n.setSSRParameter(t,s.get(t))}),["quality","focalDistance","focalRange","blurRadius","fstop"].forEach(function(t){n.setDOFParameter(t,o.get(t))}),["brightness","contrast","saturation"].forEach(function(t){n.setColorCorrection(t,u.get(t))})},ftt.prototype.setDOFFocusOnPoint=function(t){if(this._enablePostEffect){if(t>this.camera.far||t<this.camera.near)return;return this._compositor.setDOFParameter("focalDistance",t),!0}},ftt.prototype.setTemporalSuperSampling=function(t){this._enableTemporalSS=t.get("enable")},ftt.prototype.isLinearSpace=function(){return this._enablePostEffect},ftt.prototype.setRootNode=function(t){if(this.rootNode!==t){for(var e=this.rootNode.children(),n=0;n<e.length;n++)t.add(e[n]);t!==this.scene&&this.scene.add(t),this.rootNode=t}},ftt.prototype.add=function(t){this.rootNode.add(t)},ftt.prototype.remove=function(t){this.rootNode.remove(t)},ftt.prototype.removeAll=function(t){this.rootNode.removeAll(t)},Object.assign(ftt.prototype,T1);var ytt={dimensions:a7.prototype.dimensions,create:function(t,e){var n=[];t.eachComponent("grid3D",function(t){t.__viewGL=t.__viewGL||new ftt;var e=new a7;e.model=t,e.viewGL=t.__viewGL,t.coordinateSystem=e,n.push(e),e.resize=mtt,e.update=vtt});var r=["xAxis3D","yAxis3D","zAxis3D"];return t.eachSeries(function(e){if("cartesian3D"===e.get("coordinateSystem")){if(null==(i=e.getReferringComponents("grid3D").models[0])){var n=function(t,e){return r.map(function(n){var r=t.getReferringComponents(n).models[0];if(null==r&&(r=e.getComponent(n)),!r)throw new Error(n+' "'+M8.firstNotNull(t.get(n+"Index"),t.get(n+"Id"),0)+'" not found');return r})}(e,t),i=n[0].getCoordSysModel();n.forEach(function(t){var e=t.getCoordSysModel();if(!e)throw new Error('grid3D "'+M8.firstNotNull(t.get("gridIndex"),t.get("gridId"),0)+'" not found');if(e!==i)throw new Error("xAxis3D, yAxis3D, zAxis3D must use the same grid")})}var o=i.coordinateSystem;e.coordinateSystem=o}}),n}},_tt=tm.extend({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});pM(_tt);var xtt=_tt,btt={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},wtt=A({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},btt),Stt=A({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},btt),Ttt=E({scale:!0,min:"dataMin",max:"dataMax"},Stt),Mtt=E({logBase:10},Stt);Mtt.scale=!0;var Ctt={categoryAxis3D:wtt,valueAxis3D:Stt,timeAxis3D:Ttt,logAxis3D:Mtt},Itt=["value","category","time","log"];function Att(t,e){return e.type||(e.data?"category":"value")}vM(function(t){t.registerComponentModel(I9),t.registerComponentView(o7),t.registerCoordinateSystem("grid3D",ytt),["x","y","z"].forEach(function(e){!function(t,e,n,r,i){Itt.forEach(function(o){var a=n.extend({type:e+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(t,n){A(t,n.getTheme().get(o+"Axis3D")),A(t,this.getDefaultOption()),t.type=r(e,t)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=bS.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:A(I(Ctt[o+"Axis3D"]),i||{},!0)});t.registerComponentModel(a)}),t.registerSubTypeDefaulter(e+"Axis3D",X(r,e))}(t,e,xtt,Att,{name:e.toUpperCase()});const n=t.ComponentView.extend({type:e+"Axis3D"});t.registerComponentView(n)}),t.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},function(t,e){e.eachComponent({mainType:"grid3D",query:t},function(e){e.setView(t)})}),t.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},function(t,e){}),t.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},function(t,e){})});var Dtt={defaultOption:{shading:null,realisticMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},lambertMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},colorMaterial:{textureTiling:1,textureOffset:0,detailTexture:null},hatchingMaterial:{textureTiling:1,textureOffset:0,paperColor:"#fff"}}},Ltt={getFilledRegions:function(t,e){var n,r=(t||[]).slice();if("string"==typeof e?n=(e=Cw(e))&&e.geoJson:e&&e.features&&(n=e),!n)return console.error("Map "+e+" not exists. You can download map file on http://echarts.baidu.com/download-map.html"),n.features||console.error("Invalid GeoJSON for map3D"),[];for(var i={},o=n.features,a=0;a<r.length;a++)i[r[a].name]=r[a];for(a=0;a<o.length;a++){var s=o[a].properties.name;i[s]||r.push({name:s})}return r},defaultOption:{show:!0,zlevel:-10,map:"",left:0,top:0,width:"100%",height:"100%",boxWidth:100,boxHeight:10,boxDepth:"auto",regionHeight:3,environment:"auto",groundPlane:{show:!1,color:"#aaa"},shading:"lambert",light:{main:{alpha:40,beta:30}},viewControl:{alpha:40,beta:0,distance:100,orthographicSize:60,minAlpha:5,minBeta:-80,maxBeta:80},label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}},Ptt=tm.extend({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var t=this.option;t.regions=this.getFilledRegions(t.regions,t.map);var e=aS(t.data||[],{coordDimensions:["value"],encodeDefine:this.get("encode"),dimensionsDefine:this.get("dimensions")}),n=new oS(e,this);n.initData(t.regions);var r={};n.each(function(t){var e=n.getName(t),i=n.getItemModel(t);r[e]=i}),this._regionModelMap=r,this._data=n},getData:function(){return this._data},getRegionModel:function(t){var e=this.getData().getName(t);return this._regionModelMap[e]||new xf(null,this)},getRegionPolygonCoords:function(t){var e=this.getData().getName(t),n=this.coordinateSystem.getRegion(e);return n?n.geometries:[]},getFormattedLabel:function(t,e){var n=this._data.getName(t),r=this.getRegionModel(t),i=r.get("normal"===e?["label","formatter"]:["emphasis","label","formatter"]);null==i&&(i=r.get(["label","formatter"]));var o={name:n};if("function"==typeof i)return o.status=e,i(o);if("string"==typeof i){var a=o.seriesName;return i.replace("{a}",null!=a?a:"")}return n},defaultOption:{regions:[]}});A(Ptt.prototype,Ltt),A(Ptt.prototype,S9),A(Ptt.prototype,T9),A(Ptt.prototype,M9),A(Ptt.prototype,Dtt);var Ett=Ptt;function Ott(t,e,n){n=n||2;var r,i,o,a,s,l,u,h=e&&e.length,c=h?e[0]*n:t.length,d=Ntt(t,0,c,n,!0),p=[];if(!d)return p;if(h&&(d=function(t,e,n,r){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=Ntt(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),s.push(Wtt(a));for(s.sort(Gtt),i=0;i<s.length;i++)Htt(s[i],n),n=Rtt(n,n.next);return n}(t,e,d,n)),t.length>80*n){r=o=t[0],i=a=t[1];for(var f=n;f<c;f+=n)(s=t[f])<r&&(r=s),(l=t[f+1])<i&&(i=l),s>o&&(o=s),l>a&&(a=l);u=Math.max(o-r,a-i)}return ktt(d,p,n,r,i,u),p}function Ntt(t,e,n,r,i){var o,a;if(i===eet(t,e,n,r)>0)for(o=e;o<n;o+=r)a=Qtt(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=Qtt(o,t[o],t[o+1],a);return a&&Ytt(a,a.next)&&($tt(a),a=a.next),a}function Rtt(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Ytt(r,r.next)&&0!==Ztt(r.prev,r,r.next))r=r.next;else{if($tt(r),(r=e=r.prev)===r.next)return null;n=!0}}while(n||r!==e);return e}function ktt(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=Utt(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,l,u=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<u&&(s++,r=r.nextZ);e++);for(l=u;s>0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,u*=2}while(a>1)}(i)}(t,r,i,o);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?Btt(t,r,i,o):ztt(t))e.push(s.i/n),e.push(t.i/n),e.push(l.i/n),$tt(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?ktt(t=Vtt(t,e,n),e,n,r,i,o,2):2===a&&Ftt(t,e,n,r,i,o):ktt(Rtt(t),e,n,r,i,o,1);break}}}function ztt(t){var e=t.prev,n=t,r=t.next;if(Ztt(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Xtt(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ztt(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Btt(t,e,n,r){var i=t.prev,o=t,a=t.next;if(Ztt(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,l=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,u=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,h=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,c=Utt(s,l,e,n,r),d=Utt(u,h,e,n,r),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&Xtt(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ztt(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&Xtt(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&Ztt(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function Vtt(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Ytt(i,o)&&qtt(i,r,r.next,o)&&Ktt(i,o)&&Ktt(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),$tt(r),$tt(r.next),r=t=o),r=r.next}while(r!==t);return r}function Ftt(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&jtt(a,s)){var l=Jtt(a,s);return a=Rtt(a,a.next),l=Rtt(l,l.next),ktt(a,e,n,r,i,o),void ktt(l,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function Gtt(t,e){return t.x-e.x}function Htt(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n.prev;var l,u=n,h=n.x,c=n.y,d=1/0;r=n.next;for(;r!==u;)i>=r.x&&r.x>=h&&i!==r.x&&Xtt(o<c?i:a,o,h,c,o<c?a:i,o,r.x,r.y)&&((l=Math.abs(o-r.y)/(i-r.x))<d||l===d&&r.x>n.x)&&Ktt(r,t)&&(n=r,d=l),r=r.next;return n}(t,e),e){var n=Jtt(e,t);Rtt(n,n.next)}}function Utt(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)/i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Wtt(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function Xtt(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function jtt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&qtt(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&Ktt(t,e)&&Ktt(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)}function Ztt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ytt(t,e){return t.x===e.x&&t.y===e.y}function qtt(t,e,n,r){return!!(Ytt(t,e)&&Ytt(n,r)||Ytt(t,r)&&Ytt(n,e))||Ztt(t,e,n)>0!=Ztt(t,e,r)>0&&Ztt(n,r,t)>0!=Ztt(n,r,e)>0}function Ktt(t,e){return Ztt(t.prev,t,t.next)<0?Ztt(t,e,t.next)>=0&&Ztt(t,t.prev,e)>=0:Ztt(t,e,t.prev)<0||Ztt(t,t.next,e)<0}function Jtt(t,e){var n=new tet(t.i,t.x,t.y),r=new tet(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Qtt(t,e,n,r){var i=new tet(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function $tt(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function tet(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function eet(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}function net(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ret(t,e,n,r,i){var o=n,a=t[e];net(t,e,r);for(var s=n;s<r;s++)i(t[s],a)<0&&(net(t,s,o),o++);return net(t,r,o),o}function iet(t,e,n,r){if(n<r){var i=ret(t,Math.floor((n+r)/2),n,r,e);iet(t,e,n,i-1),iet(t,e,i+1,r)}}function oet(){this._parts=[]}Ott.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,a=Math.abs(eet(t,0,o,n));if(i)for(var s=0,l=e.length;s<l;s++){var u=e[s]*n,h=s<l-1?e[s+1]*n:t.length;a-=Math.abs(eet(t,u,h,n))}var c=0;for(s=0;s<r.length;s+=3){var d=r[s]*n,p=r[s+1]*n,f=r[s+2]*n;c+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===a&&0===c?0:Math.abs((c-a)/a)},oet.prototype.step=function(t,e,n){var r=t.length;if(0===n){this._parts=[],this._sorted=!1;var i=Math.floor(r/2);this._parts.push({pivot:i,left:0,right:r-1}),this._currentSortPartIdx=0}if(!this._sorted){var o=this._parts;if(0===o.length)return this._sorted=!0,!0;if(o.length<512){for(var a=0;a<o.length;a++)o[a].pivot=ret(t,o[a].pivot,o[a].left,o[a].right,e);var s=[];for(a=0;a<o.length;a++){var l=o[a].left;(u=o[a].pivot-1)>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u});var u;l=o[a].pivot+1;(u=o[a].right)>l&&s.push({pivot:Math.floor((u+l)/2),left:l,right:u})}o=this._parts=s}else for(a=0;a<Math.floor(o.length/10);a++){var h=o.length-1-this._currentSortPartIdx;if(iet(t,e,o[h].left,o[h].right),this._currentSortPartIdx++,this._currentSortPartIdx===o.length)return this._sorted=!0,!0}return!1}},oet.sort=iet;var aet=N9.vec3,set=aet.create(),uet=aet.create(),het=aet.create(),cet={needsSortTriangles:function(){return this.indices&&this.sortTriangles},needsSortTrianglesProgressively:function(){return this.needsSortTriangles()&&this.triangleCount>=2e4},doSortTriangles:function(t,e){var n=this.indices;if(0===e){var r=this.attributes.position;t=t.array;this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new n.constructor(n.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var i,o=0,a=0;a<n.length;){r.get(n[a++],set),r.get(n[a++],uet),r.get(n[a++],het);var s=aet.sqrDist(set,t),l=aet.sqrDist(uet,t),u=aet.sqrDist(het,t),h=Math.min(s,l);h=Math.min(h,u),3===a?(i=h,h=0):h-=i,this._triangleZList[o++]=h}}var c=this._sortedTriangleIndices;for(a=0;a<c.length;a++)c[a]=a;if(this.triangleCount<2e4)0===e&&this._simpleSort(!0);else for(a=0;a<3;a++)this._progressiveQuickSort(3*e+a);var d=this._indicesTmp,p=this._triangleZListTmp,f=this._triangleZList;for(a=0;a<this.triangleCount;a++){var g=3*c[a],m=3*a;d[m++]=n[g++],d[m++]=n[g++],d[m]=n[g],p[a]=f[c[a]]}var v=this._indicesTmp;this._indicesTmp=this.indices,this.indices=v;v=this._triangleZListTmp;this._triangleZListTmp=this._triangleZList,this._triangleZList=v,this.dirtyIndices()},_simpleSort:function(t){var e=this._triangleZList,n=this._sortedTriangleIndices;function r(t,n){return e[n]-e[t]}t?Array.prototype.sort.call(n,r):oet.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(t){var e=this._triangleZList,n=this._sortedTriangleIndices;this._quickSort=this._quickSort||new oet,this._quickSort.step(n,function(t,n){return e[n]-e[t]},t)}};function det(t,e){const n=t.getItemVisual(e,"style");if(n){return n[t.getVisual("drawType")]}}function pet(t,e){const n=t.getItemVisual(e,"style");return n&&n.opacity}function fet(t,e,n){this._labelsMesh=new J9,this._labelTextureSurface=new F9({width:512,height:512,devicePixelRatio:n.getDevicePixelRatio(),onupdate:function(){n.getZr().refresh()}}),this._api=n,this._labelsMesh.material.set("textureAtlas",this._labelTextureSurface.getTexture())}fet.prototype.getLabelPosition=function(t,e,n){return[0,0,0]},fet.prototype.getLabelDistance=function(t,e,n){return 0},fet.prototype.getMesh=function(){return this._labelsMesh},fet.prototype.updateData=function(t,e,n){null==e&&(e=0),null==n&&(n=t.count()),this._labelsVisibilitiesBits&&this._labelsVisibilitiesBits.length===n-e||(this._labelsVisibilitiesBits=new Uint8Array(n-e));for(var r=["label","show"],i=["emphasis","label","show"],o=e;o<n;o++){var a=t.getItemModel(o),s=a.get(r),l=a.get(i);null==l&&(l=s);var u=(s?1:0)|(l?2:0);this._labelsVisibilitiesBits[o-e]=u}this._start=e,this._end=n,this._data=t},fet.prototype.updateLabels=function(t){if(this._data){for(var e=(t=t||[]).length>0,n={},r=0;r<t.length;r++)n[t[r]]=!0;this._labelsMesh.geometry.convertToDynamicArray(!0),this._labelTextureSurface.clear();for(var i=["label"],o=["emphasis","label"],a=this._data.hostModel,s=this._data,l=a.getModel(i),u=a.getModel(o,l),h={left:"right",right:"left",top:"center",bottom:"center"},c={left:"middle",right:"middle",top:"bottom",bottom:"top"},d=this._start;d<this._end;d++){var p=!1;if(e&&n[d]&&(p=!0),this._labelsVisibilitiesBits[d-this._start]&(p?2:1)){var f=s.getItemModel(d).getModel(p?o:i,p?u:l),g=f.get("distance")||0,m=f.get("position"),v=this._api.getDevicePixelRatio(),y=a.getFormattedLabel(d,p?"emphasis":"normal");if(null==y||""===y)return;var _=new Qu({style:Yp(f,{text:y,fill:f.get("color")||det(s,d)||"#000",align:"left",verticalAlign:"top",opacity:M8.firstNotNull(f.get("opacity"),pet(s,d),1)})}),x=_.getBoundingRect();x.height*=1.2;var b=this._labelTextureSurface.add(_),w=h[m]||"center",S=c[m]||"bottom";this._labelsMesh.geometry.addSprite(this.getLabelPosition(d,m,g),[x.width*v,x.height*v],b,w,S,this.getLabelDistance(d,m,g)*v)}}this._labelsMesh.material.set("uvScale",this._labelTextureSurface.getCoordsScale()),this._labelTextureSurface.getZr().refreshImmediately(),this._labelsMesh.geometry.convertToTypedArray(),this._labelsMesh.geometry.dirty()}},fet.prototype.dispose=function(){this._labelTextureSurface.dispose()};var get=N9.vec3;function met(t){this.rootNode=new a9.Node,this._triangulationResults={},this._shadersMap=a9.COMMON_SHADERS.filter(function(t){return"shadow"!==t}).reduce(function(t,e){return t[e]=a9.createShader("ecgl."+e),t},{}),this._linesShader=a9.createShader("ecgl.meshLines3D");var e={};a9.COMMON_SHADERS.forEach(function(t){e[t]=new a9.Material({shader:a9.createShader("ecgl."+t)})}),this._groundMaterials=e,this._groundMesh=new a9.Mesh({geometry:new a9.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new fet(512,512,t),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=t}a9.Shader.import(n7),met.prototype={constructor:met,extrudeY:!0,update:function(t,e,n,r,i){var o=t.getData();null==r&&(r=0),null==i&&(i=o.count()),this._startIndex=r,this._endIndex=i-1,this._triangulation(t,r,i);var a=this._getShader(t.get("shading"));this._prepareMesh(t,a,n,r,i),this.rootNode.updateWorldTransform(),this._updateRegionMesh(t,n,r,i);var s=t.coordinateSystem;"geo3D"===s.type&&this._updateGroundPlane(t,s,n);var l=this;this._labelsBuilder.updateData(o,r,i),this._labelsBuilder.getLabelPosition=function(t,e,n){var r=o.getName(t),i=n;if("geo3D"===s.type){var a=s.getRegion(r);return a?(h=a.getCenter(),s.dataToPoint([h[0],h[1],i])):[NaN,NaN,NaN]}var u=l._triangulationResults[t-l._startIndex],h=l.extrudeY?[(u.max[0]+u.min[0])/2,u.max[1]+i,(u.max[2]+u.min[2])/2]:[(u.max[0]+u.min[0])/2,(u.max[1]+u.min[1])/2,u.max[2]+i]},this._data=o,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(t),this._lastHoverDataIndex=0},_initMeshes:function(){var t=this;var e=function(){var e=new a9.Mesh({name:"Polygon",material:new a9.Material({shader:t._shadersMap.lambert}),geometry:new a9.Geometry({sortTriangles:!0,dynamic:!0}),culling:!1,ignorePicking:!0,renderNormal:!0});return Object.assign(e.geometry,cet),e}(),n=new a9.Mesh({material:new a9.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new B9({useNativeLine:!1})});this.rootNode.add(e),this.rootNode.add(n),e.material.define("both","VERTEX_COLOR"),e.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=e,this._linesMesh=n,this.rootNode.add(this._groundMesh)},_getShader:function(t){var e=this._shadersMap[t];return e||(console.warn("Unkown shading "+t),e=this._shadersMap.lambert),e.__shading=t,e},_prepareMesh:function(t,e,n,r,i){for(var o=0,a=0,s=0,l=0,u=r;u<i;u++){var h=this._getRegionPolygonInfo(u),c=this._getRegionLinesInfo(u,t,this._linesMesh.geometry);o+=h.vertexCount,a+=h.triangleCount,s+=c.vertexCount,l+=c.triangleCount}var d=this._polygonMesh,p=d.geometry;["position","normal","texcoord0","color"].forEach(function(t){p.attributes[t].init(o)}),p.indices=o>65535?new Uint32Array(3*a):new Uint16Array(3*a),d.material.shader!==e&&d.material.attachShader(e,!0),a9.setMaterialFromModel(e.__shading,d.material,t,n),s>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(s),this._linesMesh.geometry.setTriangleCount(l)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(i-r))},_updateRegionMesh:function(t,e,n,r){for(var i=t.getData(),o=0,a=0,s=!1,l=this._polygonMesh,u=this._linesMesh,h=n;h<r;h++){var c=t.getRegionModel(h),d=c.getModel("itemStyle"),p=M8.firstNotNull(det(i,h),d.get("color"),"#fff"),f=M8.firstNotNull(pet(i,h),d.get("opacity"),1),g=a9.parseColor(p),m=a9.parseColor(d.get("borderColor"));g[3]*=f,m[3]*=f;var v=g[3]<.99;l.material.set("color",[1,1,1,1]),s=s||v;for(var y=M8.firstNotNull(c.get("height",!0),t.get("regionHeight")),_=this._updatePolygonGeometry(t,l.geometry,h,y,o,a,g),x=o;x<_.vertexOffset;x++)this._dataIndexOfVertex[x]=h;this._vertexRangeOfDataIndex[2*(h-n)]=o,this._vertexRangeOfDataIndex[2*(h-n)+1]=_.vertexOffset,o=_.vertexOffset,a=_.triangleOffset;var b=d.get("borderWidth"),w=b>0;w&&(b*=e.getDevicePixelRatio(),this._updateLinesGeometry(u.geometry,t,h,y,b,t.coordinateSystem.transform)),u.invisible=!w,u.material.set({color:m})}(l=this._polygonMesh).material.transparent=s,l.material.depthMask=!s,l.geometry.updateBoundingBox(),l.frontFace=this.extrudeY?a9.Mesh.CCW:a9.Mesh.CW,l.material.get("normalMap")&&l.geometry.generateTangents(),l.seriesIndex=t.seriesIndex,l.on("mousemove",this._onmousemove,this),l.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(t){var e=t.getModel("debug.wireframe");if(e.get("show")){var n=a9.parseColor(e.get("lineStyle.color")||"rgba(0,0,0,0.5)"),r=M8.firstNotNull(e.get("lineStyle.width"),1),i=this._polygonMesh;i.geometry.generateBarycentric(),i.material.define("both","WIREFRAME_TRIANGLE"),i.material.set("wireframeLineColor",n),i.material.set("wireframeLineWidth",r)}},_onmousemove:function(t){var e=this._dataIndexOfVertex[t.triangle[0]];null==e&&(e=-1),e!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(e),this._labelsBuilder.updateLabels([e])),this._lastHoverDataIndex=e,this._polygonMesh.dataIndex=e},_onmouseout:function(t){t.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1),this._labelsBuilder.updateLabels([])},_updateGroundPlane:function(t,e,n){var r=t.getModel("groundPlane",t);if(this._groundMesh.invisible=!r.get("show",!0),!this._groundMesh.invisible){var i=t.get("shading"),o=this._groundMaterials[i];o||(console.warn("Unkown shading "+i),o=this._groundMaterials.lambert),a9.setMaterialFromModel(i,o,r,n),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",a9.parseColor(r.get("color"))),this._groundMesh.scale.set(e.size[0],e.size[2],1)}},_triangulation:function(t,e,n){this._triangulationResults=[];for(var r=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0],o=t.coordinateSystem,a=e;a<n;a++){for(var s=[],l=t.getRegionPolygonCoords(a),u=0;u<l.length;u++){var h=l[u].exterior,c=l[u].interiors,d=[],p=[];if(!(h.length<3)){for(var f=0,g=0;g<h.length;g++){var m=h[g];d[f++]=m[0],d[f++]=m[1]}for(g=0;g<c.length;g++)if(!(c[g].length<3)){for(var v=d.length/2,y=0;y<c[g].length;y++){m=c[g][y];d.push(m[0]),d.push(m[1])}p.push(v)}var _=Ott(d,p),x=new Float64Array(d.length/2*3),b=[],w=[1/0,1/0,1/0],S=[-1/0,-1/0,-1/0],T=0;for(g=0;g<d.length;)get.set(b,d[g++],0,d[g++]),o&&o.transform&&get.transformMat4(b,b,o.transform),get.min(w,w,b),get.max(S,S,b),x[T++]=b[0],x[T++]=b[1],x[T++]=b[2];get.min(r,r,w),get.max(i,i,S),s.push({points:x,indices:_,min:w,max:S})}}this._triangulationResults.push(s)}this._geoBoundingBox=[r,i]},_getRegionPolygonInfo:function(t){for(var e=this._triangulationResults[t-this._startIndex],n=0,r=0,i=0;i<e.length;i++)n+=e[i].points.length/3,r+=e[i].indices.length/3;return{vertexCount:2*n+4*n,triangleCount:2*r+2*n}},_updatePolygonGeometry:function(t,e,n,r,i,o,a){var s=t.get("projectUVOnGround"),l=e.attributes.position,u=e.attributes.normal,h=e.attributes.texcoord0,c=e.attributes.color,d=this._triangulationResults[n-this._startIndex],p=c.value&&a,f=e.indices,g=this.extrudeY?1:2,m=this.extrudeY?2:1,v=[this.rootNode.worldTransform.x.len(),this.rootNode.worldTransform.y.len(),this.rootNode.worldTransform.z.len()],y=get.mul([],this._geoBoundingBox[0],v),_=get.mul([],this._geoBoundingBox[1],v),x=Math.max(_[0]-y[0],_[2]-y[2]);function b(t,e,n){var r=i;!function(t,e){for(var n=t.points,r=n.length,o=[],s=[],u=0;u<r;u+=3)o[0]=n[u],o[g]=e,o[m]=n[u+2],s[0]=(n[u]*v[0]-y[0])/x,s[1]=(n[u+2]*v[m]-y[2])/x,l.set(i,o),p&&c.set(i,a),h.set(i++,s)}(t,e);for(var s=t.indices.length,u=0;u<s;u++)f[3*o+u]=t.indices[u]+r;o+=t.indices.length/3}for(var w=this.extrudeY?[0,1,0]:[0,0,1],S=get.negate([],w),T=0;T<d.length;T++){var M=i,C=d[T];b(C,0),b(C,r);for(var I=C.points.length/3,A=0;A<I;A++)u.set(M+A,S),u.set(M+A+I,w);var D=[0,3,1,1,3,2],L=[[],[],[],[]],P=[],E=[],O=[],N=[],R=0;for(A=0;A<I;A++){for(var k=(A+1)%I,z=(C.points[3*k]-C.points[3*A])*v[0],B=(C.points[3*k+2]-C.points[3*A+2])*v[m],V=Math.sqrt(z*z+B*B),F=0;F<4;F++){var G=0===F||3===F,H=3*(G?A:k);L[F][0]=C.points[H],L[F][g]=F>1?r:0,L[F][m]=C.points[H+2],l.set(i+F,L[F]),s?(N[0]=(C.points[H]*v[0]-y[0])/x,N[1]=(C.points[H+2]*v[m]-y[m])/x):(N[0]=(G?R:R+V)/x,N[1]=(L[F][g]*v[g]-y[g])/x),h.set(i+F,N)}get.sub(P,L[1],L[0]),get.sub(E,L[3],L[0]),get.cross(O,P,E),get.normalize(O,O);for(F=0;F<4;F++)u.set(i+F,O),p&&c.set(i+F,a);for(F=0;F<6;F++)f[3*o+F]=D[F]+i;i+=4,o+=2,R+=V}}return e.dirty(),{vertexOffset:i,triangleOffset:o}},_getRegionLinesInfo:function(t,e,n){var r=0,i=0;e.getRegionModel(t).getModel("itemStyle").get("borderWidth")>0&&e.getRegionPolygonCoords(t).forEach(function(t){var e=t.exterior,o=t.interiors;r+=n.getPolylineVertexCount(e),i+=n.getPolylineTriangleCount(e);for(var a=0;a<o.length;a++)r+=n.getPolylineVertexCount(o[a]),i+=n.getPolylineTriangleCount(o[a])},this);return{vertexCount:r,triangleCount:i}},_updateLinesGeometry:function(t,e,n,r,i,o){function a(t){for(var e=new Float64Array(3*t.length),n=0,i=[],a=0;a<t.length;a++)i[0]=t[a][0],i[1]=r+.1,i[2]=t[a][1],o&&get.transformMat4(i,i,o),e[n++]=i[0],e[n++]=i[1],e[n++]=i[2];return e}var s=[1,1,1,1];e.getRegionPolygonCoords(n).forEach(function(e){var n=e.exterior,r=e.interiors;t.addPolyline(a(n),s,i);for(var o=0;o<r.length;o++)t.addPolyline(a(r[o]),s,i)})},highlight:function(t){var e=this._data;if(e){var n=e.getItemModel(t).getModel(["emphasis","itemStyle"]),r=n.get("color"),i=M8.firstNotNull(n.get("opacity"),pet(e,t),1);if(null==r)r=Mr(det(e,t),-.4);null==i&&(i=pet(e,t));var o=a9.parseColor(r);o[3]*=i,this._setColorOfDataIndex(e,t,o)}},downplay:function(t){var e=this._data;if(e){var n=e.getItemModel(t),r=M8.firstNotNull(det(e,t),n.get(["itemStyle","color"]),"#fff"),i=M8.firstNotNull(pet(e,t),n.get(["itemStyle","opacity"]),1),o=a9.parseColor(r);o[3]*=i,this._setColorOfDataIndex(e,t,o)}},dispose:function(){this._labelsBuilder.dispose()},_setColorOfDataIndex:function(t,e,n){if(!(e<this._startIndex&&e>this._endIndex)){e-=this._startIndex;for(var r=this._vertexRangeOfDataIndex[2*e];r<this._vertexRangeOfDataIndex[2*e+1];r++)this._polygonMesh.geometry.attributes.color.set(r,n);this._polygonMesh.geometry.dirty(),this._api.getZr().refresh()}}};var vet=Qy.extend({type:"geo3D",__ecgl__:!0,init:function(t,e){this._geo3DBuilder=new met(e),this.groupGL=new a9.Node,this._lightRoot=new a9.Node,this._sceneHelper=new G9(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new E9({zr:e.getZr()}),this._control.init()},render:function(t,e,n){this.groupGL.add(this._geo3DBuilder.rootNode);var r=t.coordinateSystem;if(r&&r.viewGL){r.viewGL.add(this._lightRoot),t.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL);var i=this._control;i.setViewGL(r.viewGL);var o=t.getModel("viewControl");i.setFromViewControlModel(o,0),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(t),r.viewGL.setPostEffect(t.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._geo3DBuilder.update(t,e,n,0,t.getData().count());var a=r.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse(function(t){t.material&&t.material[a]("fragment","SRGB_DECODE")}),i.off("update"),i.on("update",function(){n.dispatchAction({type:"geo3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),center:i.getCenter(),from:this.uid,geo3DId:t.id})}),i.update()}},afterRender:function(t,e,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,t,n),this._sceneHelper.updateSkybox(i,t,n)},dispose:function(){this._control.dispose(),this._geo3DBuilder.dispose()}}),yet={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};var _et=N9.vec3,xet=N9.mat4,bet=[dN,function(t,e){if("world"===t){var n=yet[e.name];if(n){var r=[n[0],n[1]];e.setCenter(r)}}}];function wet(t,e,n,r,i){this.name=t,this.map=e,this.regionHeight=0,this.regions=[],this._nameCoordMap={},this.loadGeoJson(n,r,i),this.transform=xet.identity(new Float64Array(16)),this.invTransform=xet.identity(new Float64Array(16)),this.extrudeY=!0,this.altitudeAxis}function Tet(t,e){var n=Ug(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});n.y=e.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,e.getDevicePixelRatio());var r=this.getGeoBoundingRect(),i=r.width/r.height*(t.get("aspectScale")||.75),o=t.get("boxWidth"),a=t.get("boxDepth"),s=t.get("boxHeight");null==s&&(s=5),isNaN(o)&&isNaN(a)&&(o=100),isNaN(a)?a=o/i:isNaN(o)&&(o=a/i),this.setSize(o,s,a),this.regionHeight=t.get("regionHeight"),this.altitudeAxis&&this.altitudeAxis.setExtent(0,Math.max(s-this.regionHeight,0))}function Met(t,e){var n=[1/0,-1/0];if(t.eachSeries(function(t){if(t.coordinateSystem===this&&"series.map3D"!==t.type){var e=t.getData(),r=t.coordDimToDataDim("alt"),i=r&&r[0];if(i){var o=e.getDataExtent(i,!0);n[0]=Math.min(n[0],o[0]),n[1]=Math.max(n[1],o[1])}}},this),n&&isFinite(n[1]-n[0])){var r=dM(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new rC("altitude",r),this.resize(this.model,e)}}wet.prototype={constructor:wet,type:"geo3D",dimensions:["lng","lat","alt"],containPoint:function(){},loadGeoJson:function(t,e,n){var r=LM||LM;try{this.regions=t?r(t):[]}catch(t){throw"Invalid geoJson format\n"+t}e=e||{},n=n||{};for(var i=this.regions,o={},a=0;a<i.length;a++){var s=i[a].name;s=n[s]||s,i[a].name=s,o[s]=i[a],this.addGeoCoord(s,i[a].getCenter());var l=e[s];l&&i[a].transformTo(l.left,l.top,l.width,l.height)}this._regionsMap=o,this._geoRect=null,bet.forEach(function(t){t(this)},this)},getGeoBoundingRect:function(){if(this._geoRect)return this._geoRect;for(var t,e=this.regions,n=0;n<e.length;n++){var r=e[n].getBoundingRect();(t=t||r.clone()).union(r)}return this._geoRect=t||new ln(0,0,0,0)},addGeoCoord:function(t,e){this._nameCoordMap[t]=e},getRegion:function(t){return this._regionsMap[t]},getRegionByCoord:function(t){for(var e=this.regions,n=0;n<e.length;n++)if(e[n].contain(t))return e[n]},setSize:function(t,e,n){this.size=[t,e,n];var r=this.getGeoBoundingRect(),i=t/r.width,o=-n/r.height,a=-t/2-r.x*i,s=n/2-r.y*o,l=this.extrudeY?[a,0,s]:[a,s,0],u=this.extrudeY?[i,1,o]:[i,o,1],h=this.transform;xet.identity(h),xet.translate(h,h,l),xet.scale(h,h,u),xet.invert(this.invTransform,h)},dataToPoint:function(t,e){e=e||[];var n=this.extrudeY?1:2,r=this.extrudeY?2:1,i=t[2];return isNaN(i)&&(i=0),e[0]=t[0],e[r]=t[1],this.altitudeAxis?e[n]=this.altitudeAxis.dataToCoord(i):e[n]=0,e[n]+=this.regionHeight,_et.transformMat4(e,e,this.transform),e},pointToData:function(t,e){}};var Cet=0,Iet={dimensions:wet.prototype.dimensions,create:function(t,e){var n=[];if(!Cw)throw new Error("geo3D component depends on geo component");function r(t,r){var i=Iet.createGeo3D(t);t.__viewGL=t.__viewGL||new ftt,i.viewGL=t.__viewGL,t.coordinateSystem=i,i.model=t,n.push(i),i.resize=Tet,i.resize(t,e),i.update=Met}return t.eachComponent("geo3D",function(t,e){r(t)}),t.eachSeriesByType("map3D",function(t,e){var n=t.get("coordinateSystem");null==n&&(n="geo3D"),"geo3D"===n&&r(t)}),t.eachSeries(function(e){if("geo3D"===e.get("coordinateSystem")){if("series.map3D"===e.type)return;var n=e.getReferringComponents("geo3D").models[0];if(n||(n=t.getComponent("geo3D")),!n)throw new Error('geo "'+M8.firstNotNull(e.get("geo3DIndex"),e.get("geo3DId"),0)+'" not found');e.coordinateSystem=n.coordinateSystem}}),n},createGeo3D:function(t){var e,n=t.get("map");if("string"==typeof n?(e=n,n=Cw(n)):n&&n.features&&(n={geoJson:n}),n||function(t){console.error("Map "+t+" not exists. You can download map file on http://echarts.baidu.com/download-map.html")}(n),!n.geoJson.features)throw new Error("Invalid GeoJSON for map3D");return null==e&&(e="GEO_ANONYMOUS_"+Cet++),new wet(e+Cet++,e,n&&n.geoJson,n&&n.specialAreas,t.get("nameMap"))}},Aet=Iet,Det="__ECGL_GEO3D_REGISTERED";function Let(t){t[Det]||(t[Det]=!0,t.registerComponentModel(Ett),t.registerComponentView(vet),t.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},function(t,e){e.eachComponent({mainType:"geo3D",query:t},function(e){e.setView(t)})}),t.registerCoordinateSystem("geo3D",Aet))}function Pet(t,e){t.id=t.id||t.name||e+""}vM(Let);var Eet=tm.extend({type:"globe",layoutMode:"box",coordinateSystem:null,init:function(){Eet.superApply(this,"init",arguments),B(this.option.layers,function(t,e){A(t,this.defaultLayerOption),Pet(t,e)},this)},mergeOption:function(t){var e=this.option.layers;function n(t){return F(t,function(t,e,n){return Pet(e,n),t[e.id]=e,t},{})}if(this.option.layers=null,Eet.superApply(this,"mergeOption",arguments),e&&e.length){var r=n(t.layers),i=n(e);for(var o in r)i[o]?A(i[o],r[o],!0):e.push(t.layers[o]);this.option.layers=e}B(this.option.layers,function(t){A(t,this.defaultLayerOption)},this)},optionUpdated:function(){this.updateDisplacementHash()},defaultLayerOption:{show:!0,type:"overlay"},defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",baseColor:"#fff",baseTexture:"",heightTexture:"",displacementTexture:"",displacementScale:0,displacementQuality:"medium",globeRadius:100,globeOuterRadius:150,shading:"lambert",light:{main:{time:""}},atmosphere:{show:!1,offset:5,color:"#ffffff",glowPower:6,innerGlowPower:2},viewControl:{autoRotate:!0,panSensitivity:0,targetCoord:null},layers:[]},setDisplacementData:function(t,e,n){this.displacementData=t,this.displacementWidth=e,this.displacementHeight=n},getDisplacementTexture:function(){return this.get("displacementTexture")||this.get("heightTexture")},getDisplacemenScale:function(){var t=this.getDisplacementTexture(),e=this.get("displacementScale");return t&&"none"!==t||(e=0),e},hasDisplacement:function(){return this.getDisplacemenScale()>0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var t=this.getDisplacementTexture(),e=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==t||this._displacementScale!==e,this._displacementTexture=t,this._displacementScale=e},isDisplacementChanged:function(){return this._displacementChanged}});A(Eet.prototype,S9),A(Eet.prototype,T9),A(Eet.prototype,M9),A(Eet.prototype,Dtt);var Oet=Eet,Net=Math.PI,Ret=Math.sin,ket=Math.cos,zet=Math.tan,Bet=Math.asin,Vet=Math.atan2,Fet=Net/180;var Get=23.4397*Fet;function Het(t,e){return Vet(Ret(t)*ket(Get)-zet(e)*Ret(Get),ket(t))}function Uet(t,e,n){return Vet(Ret(t),ket(t)*Ret(e)-zet(n)*ket(e))}function Wet(t,e,n){return Bet(Ret(e)*Ret(n)+ket(e)*ket(n)*ket(t))}function Xet(t){var e,n,r=function(t){return Fet*(357.5291+.98560028*t)}(t),i=function(t){return t+Fet*(1.9148*Ret(t)+.02*Ret(2*t)+3e-4*Ret(3*t))+102.9372*Fet+Net}(r);return{dec:(e=i,n=0,Bet(Ret(n)*ket(Get)+ket(n)*Ret(Get)*Ret(e))),ra:Het(i,0)}}var jet={};jet.getPosition=function(t,e,n){var r=Fet*-n,i=Fet*e,o=function(t){return function(t){return t.valueOf()/864e5-.5+2440588}(t)-2451545}(t),a=Xet(o),s=function(t,e){return Fet*(280.16+360.9856235*t)-e}(o,r)-a.ra;return{azimuth:Uet(s,i,a.dec),altitude:Wet(s,i,a.dec)}};var Zet=jet;a9.Shader.import(Q8),a9.Shader.import("@export ecgl.atmosphere.vertex\nattribute vec3 position: POSITION;\nattribute vec3 normal : NORMAL;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 normalMatrix : WORLDINVERSETRANSPOSE;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n v_Normal = normalize((normalMatrix * vec4(normal, 0.0)).xyz);\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n@end\n\n\n@export ecgl.atmosphere.fragment\nuniform mat4 viewTranspose: VIEWTRANSPOSE;\nuniform float glowPower;\nuniform vec3 glowColor;\n\nvarying vec3 v_Normal;\n\nvoid main() {\n float intensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);\n gl_FragColor = vec4(glowColor, intensity * intensity);\n}\n@end");var Yet=Qy.extend({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(t,e){this.groupGL=new a9.Node,this._sphereGeometry=new a9.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new a9.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new a9.PlaneGeometry,this._earthMesh=new a9.Mesh({renderNormal:!0}),this._atmosphereMesh=new a9.Mesh,this._atmosphereGeometry=new a9.SphereGeometry({widthSegments:80,heightSegments:40}),this._atmosphereMaterial=new a9.Material({shader:new a9.Shader(a9.Shader.source("ecgl.atmosphere.vertex"),a9.Shader.source("ecgl.atmosphere.fragment")),transparent:!0}),this._atmosphereMesh.geometry=this._atmosphereGeometry,this._atmosphereMesh.material=this._atmosphereMaterial,this._atmosphereMesh.frontFace=a9.Mesh.CW,this._lightRoot=new a9.Node,this._sceneHelper=new G9,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._atmosphereMesh),this.groupGL.add(this._earthMesh),this._control=new E9({zr:e.getZr()}),this._control.init(),this._layerMeshes={}},render:function(t,e,n){var r=t.coordinateSystem,i=t.get("shading");r.viewGL.add(this._lightRoot),t.get("show")?r.viewGL.add(this.groupGL):r.viewGL.remove(this.groupGL),this._sceneHelper.setScene(r.viewGL.scene),r.viewGL.setPostEffect(t.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var a="ecgl."+i;o.material&&o.material.shader.name===a||(o.material=a9.createMaterial(a)),a9.setMaterialFromModel(i,o.material,t,n),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach(function(t){var e=o.material.get(t);e&&(e.flipY=!1)}),o.material.set("color",a9.parseColor(t.get("baseColor")));var s=.99*r.radius;if(o.scale.set(s,s,s),t.get("atmosphere.show")){o.material.define("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!1,this._atmosphereMaterial.setUniforms({glowPower:t.get("atmosphere.glowPower")||6,glowColor:t.get("atmosphere.color")||"#ffffff"}),o.material.setUniforms({glowPower:t.get("atmosphere.innerGlowPower")||2,glowColor:t.get("atmosphere.color")||"#ffffff"});var l=t.get("atmosphere.offset")||5;this._atmosphereMesh.scale.set(s+l,s+l,s+l)}else o.material.undefine("both","ATMOSPHERE_ENABLED"),this._atmosphereMesh.invisible=!0;var u=o.material.setTextureImage("diffuseMap",t.get("baseTexture"),n,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var h=o.material.setTextureImage("bumpMap",t.get("heightTexture"),n,{flipY:!1,anisotropic:8});h&&h.surface&&h.surface.attachToMesh(o),o.material[t.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(t,n),this._displaceVertices(t,n),this._updateViewControl(t,n),this._updateLayers(t,n)},afterRender:function(t,e,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,t,n),this._sceneHelper.updateSkybox(i,t,n)},_updateLayers:function(t,e){var n=t.coordinateSystem,r=t.get("layers"),i=n.radius,o=[],a=[],s=[],l=[];B(r,function(t){var r=new xf(t),u=r.get("type"),h=a9.loadTexture(r.get("texture"),e,{flipY:!1,anisotropic:8});if(h.surface&&h.surface.attachToMesh(this._earthMesh),"blend"===u){var c=r.get("blendTo"),d=M8.firstNotNull(r.get("intensity"),1);"emission"===c?(s.push(h),l.push(d)):(o.push(h),a.push(d))}else{var p=r.get("id"),f=this._layerMeshes[p];f||(f=this._layerMeshes[p]=new a9.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===r.get("shading")?(f.material=f.__lambertMaterial||new a9.Material({autoUpdateTextureStatus:!1,shader:a9.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),f.__lambertMaterial=f.material):(f.material=f.__colorMaterial||new a9.Material({autoUpdateTextureStatus:!1,shader:a9.createShader("ecgl.color"),transparent:!0,depthMask:!1}),f.__colorMaterial=f.material),f.material.enableTexture("diffuseMap");var g=r.get("distance"),m=i+(null==g?n.radius/100:g);f.scale.set(m,m,m),i=m;var v=this._blankTexture||(this._blankTexture=a9.createBlankTexture("rgba(255, 255, 255, 0)"));f.material.set("diffuseMap",v),a9.loadTexture(r.get("texture"),e,{flipY:!1,anisotropic:8},function(t){t.surface&&t.surface.attachToMesh(f),f.material.set("diffuseMap",t),e.getZr().refresh()}),r.get("show")?this.groupGL.add(f):this.groupGL.remove(f)}},this);var u=this._earthMesh.material;u.define("fragment","LAYER_DIFFUSEMAP_COUNT",o.length),u.define("fragment","LAYER_EMISSIVEMAP_COUNT",s.length),u.set("layerDiffuseMap",o),u.set("layerDiffuseIntensity",a),u.set("layerEmissiveMap",s),u.set("layerEmissionIntensity",l);var h=t.getModel("debug.wireframe");if(h.get("show")){u.define("both","WIREFRAME_TRIANGLE");var c=a9.parseColor(h.get("lineStyle.color")||"rgba(0,0,0,0.5)"),d=M8.firstNotNull(h.get("lineStyle.width"),1);u.set("wireframeLineWidth",d),u.set("wireframeLineColor",c)}else u.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(t,e){var n=t.coordinateSystem,r=t.getModel("viewControl");n.viewGL.camera;var i=this;var o=this._control;o.setViewGL(n.viewGL);var a,s,l=r.get("targetCoord");null!=l&&(s=l[0]+90,a=l[1]),o.setFromViewControlModel(r,{baseDistance:n.radius,alpha:a,beta:s}),o.off("update"),o.on("update",function(){e.dispatchAction({type:"globeChangeCamera",alpha:o.getAlpha(),beta:o.getBeta(),distance:o.getDistance()-n.radius,center:o.getCenter(),from:i.uid,globeId:t.id})})},_displaceVertices:function(t,e){var n=t.get("displacementQuality"),r=t.get("debug.wireframe.show"),i=t.coordinateSystem;if(t.isDisplacementChanged()||n!==this._displacementQuality||r!==this._showDebugWireframe){this._displacementQuality=n,this._showDebugWireframe=r;var o=this._sphereGeometry,a={low:100,medium:200,high:400,ultra:800}[n]||200,s=a/2;(o.widthSegments!==a||r)&&(o.widthSegments=a,o.heightSegments=s,o.build()),this._doDisplaceVertices(o,i),r&&o.generateBarycentric()}},_doDisplaceVertices:function(t,e){var n=t.attributes.position.value,r=t.attributes.texcoord0.value,i=t.__originalPosition;i&&i.length===n.length||((i=new Float32Array(n.length)).set(n),t.__originalPosition=i);for(var o=e.displacementWidth,a=e.displacementHeight,s=e.displacementData,l=0;l<t.vertexCount;l++){var u=3*l,h=2*l,c=i[u+1],d=i[u+2],p=i[u+3],f=r[h++],g=r[h++],m=Math.round(f*(o-1)),v=Math.round(g*(a-1)),y=s?s[v*o+m]:0;n[u+1]=c+c*y,n[u+2]=d+d*y,n[u+3]=p+p*y}t.generateVertexNormals(),t.dirty(),t.updateBoundingBox()},_updateLight:function(t,e){var n=this._earthMesh;this._sceneHelper.updateLight(t);var r=this._sceneHelper.mainLight,i=t.get("light.main.time")||new Date,o=Zet.getPosition(pa(i),0,0),a=Math.cos(o.altitude);r.position.y=-a*Math.cos(o.azimuth),r.position.x=Math.sin(o.altitude),r.position.z=a*Math.sin(o.azimuth),r.lookAt(n.getWorldPosition())},dispose:function(t,e){this.groupGL.removeAll(),this._control.dispose()}}),qet=N9.vec3;function Ket(t){this.radius=t,this.viewGL=null,this.altitudeAxis,this.displacementData=null,this.displacementWidth,this.displacementHeight}function Jet(t,e){var n=Ug(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()});n.y=e.getHeight()-n.y-n.height,this.viewGL.setViewport(n.x,n.y,n.width,n.height,e.getDevicePixelRatio()),this.radius=t.get("globeRadius");var r=t.get("globeOuterRadius");this.altitudeAxis&&this.altitudeAxis.setExtent(0,r-this.radius)}function Qet(t,e){var n=[1/0,-1/0];if(t.eachSeries(function(t){if(t.coordinateSystem===this){var e=t.getData(),r=t.coordDimToDataDim("alt"),i=r&&r[0];if(i){var o=e.getDataExtent(i,!0);n[0]=Math.min(n[0],o[0]),n[1]=Math.max(n[1],o[1])}}},this),n&&isFinite(n[1]-n[0])){var r=dM(n,{type:"value",min:"dataMin",max:"dataMax"});this.altitudeAxis=new rC("altitude",r),this.resize(this.model,e)}}Ket.prototype={constructor:Ket,dimensions:["lng","lat","alt"],type:"globe",containPoint:function(){},setDisplacementData:function(t,e,n){this.displacementData=t,this.displacementWidth=e,this.displacementHeight=n},_getDisplacementScale:function(t,e){var n=(t+180)/360*(this.displacementWidth-1),r=(90-e)/180*(this.displacementHeight-1),i=Math.round(n)+Math.round(r)*this.displacementWidth;return this.displacementData[i]},dataToPoint:function(t,e){var n=t[0],r=t[1],i=t[2]||0,o=this.radius;this.displacementData&&(o*=1+this._getDisplacementScale(n,r)),this.altitudeAxis&&(o+=this.altitudeAxis.dataToCoord(i)),n=n*Math.PI/180,r=r*Math.PI/180;var a=Math.cos(r)*o;return(e=e||[])[0]=-a*Math.cos(n+Math.PI),e[1]=Math.sin(r)*o,e[2]=a*Math.sin(n+Math.PI),e},pointToData:function(t,e){var n=t[0],r=t[1],i=t[2],o=qet.len(t);n/=o,r/=o,i/=o;var a=Math.asin(r),s=Math.atan2(i,-n);s<0&&(s=2*Math.PI+s);var l=180*a/Math.PI,u=180*s/Math.PI-180;return(e=e||[])[0]=u,e[1]=l,e[2]=o-this.radius,this.altitudeAxis&&(e[2]=this.altitudeAxis.coordToData(e[2])),e}};var $et={dimensions:Ket.prototype.dimensions,create:function(t,e){var n=[];return t.eachComponent("globe",function(t){t.__viewGL=t.__viewGL||new ftt;var r=new Ket;r.viewGL=t.__viewGL,t.coordinateSystem=r,r.model=t,n.push(r),r.resize=Jet,r.resize(t,e),r.update=Qet}),t.eachSeries(function(e){if("globe"===e.get("coordinateSystem")){var n=e.getReferringComponents("globe").models[0];if(n||(n=t.getComponent("globe")),!n)throw new Error('globe "'+M8.firstNotNull(e.get("globe3DIndex"),e.get("globe3DId"),0)+'" not found');var r=n.coordinateSystem;e.coordinateSystem=r}}),t.eachComponent("globe",function(t,n){var r=t.coordinateSystem,i=t.getDisplacementTexture(),o=t.getDisplacemenScale();if(t.isDisplacementChanged()){if(t.hasDisplacement()){var a=!0;a9.loadTexture(i,e,function(n){var r=function(t,e){var n=document.createElement("canvas"),r=n.getContext("2d"),i=t.width,o=t.height;n.width=i,n.height=o,r.drawImage(t,0,0,i,o);for(var a=r.getImageData(0,0,i,o).data,s=new Float32Array(a.length/4),l=0;l<a.length/4;l++){var u=a[4*l];s[l]=u/255*e}return{data:s,width:i,height:o}}(n.image,o);t.setDisplacementData(r.data,r.width,r.height),a||e.dispatchAction({type:"globeUpdateDisplacment"})}),a=!1}else r.setDisplacementData(null,0,0);r.setDisplacementData(t.displacementData,t.displacementWidth,t.displacementHeight)}}),n}},tnt=$et;vM(function(t){t.registerComponentModel(Oet),t.registerComponentView(Yet),t.registerCoordinateSystem("globe",tnt),t.registerAction({type:"globeChangeCamera",event:"globecamerachanged",update:"series:updateCamera"},function(t,e){e.eachComponent({mainType:"globe",query:t},function(e){e.setView(t)})}),t.registerAction({type:"globeUpdateDisplacment",event:"globedisplacementupdated",update:"update"},function(t,e){})});var ent=["zoom","center","pitch","bearing"],nnt=tm.extend({type:"mapbox3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,style:"mapbox://styles/mapbox/light-v9",center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMapboxCameraOption:function(){var t=this;return ent.reduce(function(e,n){return e[n]=t.get(n),e},{})},setMapboxCameraOption:function(t){null!=t&&ent.forEach(function(e){null!=t[e]&&(this.option[e]=t[e])},this)},getMapbox:function(){return this._mapbox},setMapbox:function(t){this._mapbox=t}});A(nnt.prototype,T9),A(nnt.prototype,M9);var rnt=nnt;function int(t,e){if(this.id=t,this.zr=e,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!mapboxgl)throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");this._mapbox=new mapboxgl.Map({container:this.dom}),this._initEvents()}int.prototype.setUnpainted=function(){},int.prototype.resize=function(){this._mapbox.resize()},int.prototype.getMapbox=function(){return this._mapbox},int.prototype.clear=function(){},int.prototype.refresh=function(){this._mapbox.resize()};var ont=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","wheel","touchstart","touchend","touchmove","touchcancel"];int.prototype._initEvents=function(){var t=this._mapbox.getCanvasContainer();this._handlers=this._handlers||{contextmenu:function(t){return t.preventDefault(),!1}},ont.forEach(function(e){this._handlers[e]=function(e){var n={};for(var r in e)n[r]=e[r];n.bubbles=!1;var i=new e.constructor(e.type,n);t.dispatchEvent(i)},this.zr.dom.addEventListener(e,this._handlers[e])},this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},int.prototype.dispose=function(){ont.forEach(function(t){this.zr.dom.removeEventListener(t,this._handlers[t])},this)};var ant="\n@export ecgl.displayShadow.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\nvarying vec3 v_WorldPosition;\n\nvarying vec3 v_Normal;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);\n\n v_WorldPosition = (world * vec4(position, 1.0)).xyz;\n gl_Position = worldViewProjection * vec4(position, 1.0);\n}\n\n@end\n\n\n@export ecgl.displayShadow.fragment\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform float roughness: 0.2;\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.ssaoMap.header\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n float shadow = 1.0;\n\n @import ecgl.common.ssaoMap.main\n\n#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {\n shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);\n }\n#endif\n\n shadow *= 0.5 + ao * 0.5;\n shadow = clamp(shadow, 0.0, 1.0);\n\n gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);\n}\n\n@end";a9.Shader.import(ant);var snt=Qy.extend({type:"mapbox3D",__ecgl__:!0,init:function(t,e){var n=e.getZr();this._zrLayer=new int("mapbox3D",n),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new a9.Node,this._sceneHelper=new G9(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var r=this._zrLayer.getMapbox(),i=this._dispatchInteractAction.bind(this,e,r);["zoom","rotate","drag","pitch","rotate","move"].forEach(function(t){r.on(t,i)}),this._groundMesh=new a9.Mesh({geometry:new a9.PlaneGeometry,material:new a9.Material({shader:new a9.Shader({vertex:a9.Shader.source("ecgl.displayShadow.vertex"),fragment:a9.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},render:function(t,e,n){var r=this._zrLayer.getMapbox(),i=t.get("style"),o=JSON.stringify(i);o!==this._oldStyleStr&&i&&r.setStyle(i),this._oldStyleStr=o,r.setCenter(t.get("center")),r.setZoom(t.get("zoom")),r.setPitch(t.get("pitch")),r.setBearing(t.get("bearing")),t.setMapbox(r);var a=t.coordinateSystem;a.viewGL.scene.add(this._lightRoot),a.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(a.viewGL.scene),this._sceneHelper.updateLight(t),a.viewGL.setPostEffect(t.getModel("postEffect"),n),a.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._mapbox3DModel=t},afterRender:function(t,e,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,t,n),this._sceneHelper.updateSkybox(i,t,n),t.coordinateSystem.viewGL.scene.traverse(function(t){t.material&&(t.material.define("fragment","NORMAL_UP_AXIS",2),t.material.define("fragment","NORMAL_FRONT_AXIS",1))})},updateCamera:function(t,e,n,r){t.coordinateSystem.setCameraOption(r),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(t,e,n){t.dispatchAction({type:"mapbox3DChangeCamera",pitch:e.getPitch(),zoom:e.getZoom(),center:e.getCenter().toArray(),bearing:e.getBearing(),mapbox3DId:this._mapbox3DModel&&this._mapbox3DModel.id})},_updateGroundMesh:function(){if(this._mapbox3DModel){var t=this._mapbox3DModel.coordinateSystem,e=t.dataToPoint(t.center);this._groundMesh.position.set(e[0],e[1],-.001);var n=new a9.Plane(new a9.Vector3(0,0,1),0),r=t.viewGL.camera.castRay(new a9.Vector2(-1,-1)),i=t.viewGL.camera.castRay(new a9.Vector2(1,1)),o=r.intersectPlane(n),a=i.intersectPlane(n),s=o.dist(a)/t.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(t,e){this._zrLayer&&this._zrLayer.dispose(),e.getZr().painter.delLayer(-1e3)}}),lnt=N9.mat4,unt=512,hnt=.6435011087932844,cnt=Math.PI,dnt=.1;function pnt(){this.width=0,this.height=0,this.altitudeScale=1,this.boxHeight="auto",this.altitudeExtent,this.bearing=0,this.pitch=0,this.center=[0,0],this._origin,this.zoom=0,this._initialZoom,this.maxPitch=60,this.zoomOffset=0}function fnt(){pnt.apply(this,arguments)}function gnt(t,e,n){function r(t,e){var n=e.getWidth(),r=e.getHeight(),i=e.getDevicePixelRatio();this.viewGL.setViewport(0,0,n,r,i),this.width=n,this.height=r,this.altitudeScale=t.get("altitudeScale"),this.boxHeight=t.get("boxHeight")}function i(t,e){if("auto"!==this.model.get("boxHeight")){var n=[1/0,-1/0];t.eachSeries(function(t){if(t.coordinateSystem===this){var e=t.getData(),r=t.coordDimToDataDim("alt")[0];if(r){var i=e.getDataExtent(r,!0);n[0]=Math.min(n[0],i[0]),n[1]=Math.max(n[1],i[1])}}},this),n&&isFinite(n[1]-n[0])&&(this.altitudeExtent=n)}}return{dimensions:e.prototype.dimensions,create:function(o,a){var s=[];return o.eachComponent(t,function(t){var n=t.__viewGL;n||(n=t.__viewGL=new ftt).setRootNode(new a9.Node);var o=new e;o.viewGL=t.__viewGL,o.resize=r,o.resize(t,a),s.push(o),t.coordinateSystem=o,o.model=t,o.update=i}),o.eachSeries(function(e){if(e.get("coordinateSystem")===t){var n=e.getReferringComponents(t).models[0];if(n||(n=o.getComponent(t)),!n)throw new Error(t+' "'+M8.firstNotNull(e.get(t+"Index"),e.get(t+"Id"),0)+'" not found');e.coordinateSystem=n.coordinateSystem}}),n&&n(s,o,a),s}}}pnt.prototype={constructor:pnt,dimensions:["lng","lat","alt"],containPoint:function(){},setCameraOption:function(t){this.bearing=t.bearing,this.pitch=t.pitch,this.center=t.center,this.zoom=t.zoom,this._origin||(this._origin=this.projectOnTileWithScale(this.center,unt)),null==this._initialZoom&&(this._initialZoom=this.zoom),this.updateTransform()},updateTransform:function(){if(this.height){var t=.5/Math.tan(hnt/2)*this.height*dnt,e=Math.max(Math.min(this.pitch,this.maxPitch),0)/180*Math.PI,n=hnt/2,r=Math.PI/2+e,i=Math.sin(n)*t/Math.sin(Math.PI-r-n),o=1.1*(Math.cos(Math.PI/2-e)*i+t);this.pitch>50&&(o=1e3);var a=[];lnt.perspective(a,hnt,this.width/this.height,1,o),this.viewGL.camera.projectionMatrix.setArray(a),this.viewGL.camera.decomposeProjectionMatrix();a=lnt.identity([]);var s=this.dataToPoint(this.center);lnt.scale(a,a,[1,-1,1]),lnt.translate(a,a,[0,0,-t]),lnt.rotateX(a,a,e),lnt.rotateZ(a,a,-this.bearing/180*Math.PI),lnt.translate(a,a,[-s[0]*this.getScale()*dnt,-s[1]*this.getScale()*dnt,0]),this.viewGL.camera.viewMatrix.array=a;var l=[];lnt.invert(l,a),this.viewGL.camera.worldTransform.array=l,this.viewGL.camera.decomposeWorldTransform();var u,h=unt*this.getScale();if(this.altitudeExtent&&!isNaN(this.boxHeight)){var c=this.altitudeExtent[1]-this.altitudeExtent[0];u=this.boxHeight/c*this.getScale()/Math.pow(2,this._initialZoom-this.zoomOffset)}else u=h/(2*Math.PI*6378e3*Math.abs(Math.cos(this.center[1]*(Math.PI/180))))*this.altitudeScale*dnt;this.viewGL.rootNode.scale.set(this.getScale()*dnt,this.getScale()*dnt,u)}},getScale:function(){return Math.pow(2,this.zoom-this.zoomOffset)},projectOnTile:function(t,e){return this.projectOnTileWithScale(t,this.getScale()*unt,e)},projectOnTileWithScale:function(t,e,n){var r=t[0],i=t[1]*cnt/180,o=e*(r*cnt/180+cnt)/(2*cnt),a=e*(cnt-Math.log(Math.tan(cnt/4+.5*i)))/(2*cnt);return(n=n||[])[0]=o,n[1]=a,n},unprojectFromTile:function(t,e){return this.unprojectOnTileWithScale(t,this.getScale()*unt,e)},unprojectOnTileWithScale:function(t,e,n){var r=t[0],i=t[1],o=r/e*(2*cnt)-cnt,a=2*(Math.atan(Math.exp(cnt-i/e*(2*cnt)))-cnt/4);return(n=n||[])[0]=180*o/cnt,n[1]=180*a/cnt,n},dataToPoint:function(t,e){return(e=this.projectOnTileWithScale(t,unt,e))[0]-=this._origin[0],e[1]-=this._origin[1],e[2]=isNaN(t[2])?0:t[2],isNaN(t[2])||(e[2]=t[2],this.altitudeExtent&&(e[2]-=this.altitudeExtent[0])),e}},fnt.prototype=new pnt,fnt.prototype.constructor=fnt,fnt.prototype.type="mapbox3D";var mnt=gnt("mapbox3D",fnt,function(t){t.forEach(function(t){t.setCameraOption(t.model.getMapboxCameraOption())})});vM(function(t){t.registerComponentModel(rnt),t.registerComponentView(snt),t.registerCoordinateSystem("mapbox3D",mnt),t.registerAction({type:"mapbox3DChangeCamera",event:"mapbox3dcamerachanged",update:"mapbox3D:updateCamera"},function(t,e){e.eachComponent({mainType:"mapbox3D",query:t},function(e){e.setMapboxCameraOption(t)})})});var vnt=["zoom","center","pitch","bearing"],ynt=tm.extend({type:"maptalks3D",layoutMode:"box",coordinateSystem:null,defaultOption:{zlevel:-10,urlTemplate:"http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",attribution:'© <a href="http://osm.org">OpenStreetMap</a> contributors, © <a href="https://carto.com/">CARTO</a>',center:[0,0],zoom:0,pitch:0,bearing:0,light:{main:{alpha:20,beta:30}},altitudeScale:1,boxHeight:"auto"},getMaptalksCameraOption:function(){var t=this;return vnt.reduce(function(e,n){return e[n]=t.get(n),e},{})},setMaptalksCameraOption:function(t){null!=t&&vnt.forEach(function(e){null!=t[e]&&(this.option[e]=t[e])},this)},getMaptalks:function(){return this._maptalks},setMaptalks:function(t){this._maptalks=t}});A(ynt.prototype,T9),A(ynt.prototype,M9);var _nt=ynt;function xnt(t,e,n,r){if(this.id=t,this.zr=e,this.dom=document.createElement("div"),this.dom.style.cssText="position:absolute;left:0;right:0;top:0;bottom:0;",!maptalks)throw new Error("Maptalks library must be included. See https://maptalks.org");this._maptalks=new maptalks.Map(this.dom,{center:n,zoom:r,doubleClickZoom:!1,fog:!1}),this._initEvents()}xnt.prototype.setUnpainted=function(){},xnt.prototype.resize=function(){this._maptalks.checkSize()},xnt.prototype.getMaptalks=function(){return this._maptalks},xnt.prototype.clear=function(){},xnt.prototype.refresh=function(){this._maptalks.checkSize()};var bnt=["mousedown","mouseup","click","dblclick","mousemove","mousewheel","DOMMouseScroll","touchstart","touchend","touchmove","touchcancel"];xnt.prototype._initEvents=function(){var t=this.dom;this._handlers=this._handlers||{contextmenu:function(t){return t.preventDefault(),!1}},bnt.forEach(function(e){this._handlers[e]=function(n){var r={};for(var i in n)r[i]=n[i];r.bubbles=!1;var o=new n.constructor(n.type,r);"mousewheel"===e||"DOMMouseScroll"===e?t.dispatchEvent(o):t.firstElementChild.dispatchEvent(o)},this.zr.dom.addEventListener(e,this._handlers[e])},this),this.zr.dom.addEventListener("contextmenu",this._handlers.contextmenu)},xnt.prototype.dispose=function(){bnt.forEach(function(t){this.zr.dom.removeEventListener(t,this._handlers[t])},this),this._maptalks.remove()},a9.Shader.import(ant);var wnt=Qy.extend({type:"maptalks3D",__ecgl__:!0,init:function(t,e){this._groundMesh=new a9.Mesh({geometry:new a9.PlaneGeometry,material:new a9.Material({shader:new a9.Shader({vertex:a9.Shader.source("ecgl.displayShadow.vertex"),fragment:a9.Shader.source("ecgl.displayShadow.fragment")}),depthMask:!1}),renderOrder:-100,culling:!1,castShadow:!1,$ignorePicking:!0,renderNormal:!0})},_initMaptalksLayer:function(t,e){var n=e.getZr();this._zrLayer=new xnt("maptalks3D",n,t.get("center"),t.get("zoom")),n.painter.insertLayer(-1e3,this._zrLayer),this._lightRoot=new a9.Node,this._sceneHelper=new G9(this._lightRoot),this._sceneHelper.initLight(this._lightRoot);var r=this._zrLayer.getMaptalks(),i=this._dispatchInteractAction.bind(this,e,r);["zoomend","zooming","zoomstart","dragrotating","pitch","pitchend","movestart","moving","moveend","resize","touchstart","touchmove","touchend","animating"].forEach(function(t){r.on(t,i)})},render:function(t,e,n){this._zrLayer||this._initMaptalksLayer(t,n);var r=this._zrLayer.getMaptalks(),i=t.get("urlTemplate"),o=r.getBaseLayer();i!==this._oldUrlTemplate&&(o?o.setOptions({urlTemplate:i,attribution:t.get("attribution")}):(o=new maptalks.TileLayer("maptalks-echarts-gl-baselayer",{urlTemplate:i,subdomains:["a","b","c"],attribution:t.get("attribution")}),r.setBaseLayer(o))),this._oldUrlTemplate=i,r.setCenter(t.get("center")),r.setZoom(t.get("zoom"),{animation:!1}),r.setPitch(t.get("pitch")),r.setBearing(t.get("bearing")),t.setMaptalks(r);var a=t.coordinateSystem;a.viewGL.scene.add(this._lightRoot),a.viewGL.add(this._groundMesh),this._updateGroundMesh(),this._sceneHelper.setScene(a.viewGL.scene),this._sceneHelper.updateLight(t),a.viewGL.setPostEffect(t.getModel("postEffect"),n),a.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._maptalks3DModel=t},afterRender:function(t,e,n,r){var i=r.renderer;this._sceneHelper.updateAmbientCubemap(i,t,n),this._sceneHelper.updateSkybox(i,t,n),t.coordinateSystem.viewGL.scene.traverse(function(t){t.material&&(t.material.define("fragment","NORMAL_UP_AXIS",2),t.material.define("fragment","NORMAL_FRONT_AXIS",1))})},updateCamera:function(t,e,n,r){t.coordinateSystem.setCameraOption(r),this._updateGroundMesh(),n.getZr().refresh()},_dispatchInteractAction:function(t,e,n){var r;t.dispatchAction({type:"maptalks3DChangeCamera",pitch:e.getPitch(),zoom:(r=e.getResolution(),19-Math.log(r/Snt)/Math.LN2+1),center:e.getCenter().toArray(),bearing:e.getBearing(),maptalks3DId:this._maptalks3DModel&&this._maptalks3DModel.id})},_updateGroundMesh:function(){if(this._maptalks3DModel){var t=this._maptalks3DModel.coordinateSystem,e=t.dataToPoint(t.center);this._groundMesh.position.set(e[0],e[1],-.001);var n=new a9.Plane(new a9.Vector3(0,0,1),0),r=t.viewGL.camera.castRay(new a9.Vector2(-1,-1)),i=t.viewGL.camera.castRay(new a9.Vector2(1,1)),o=r.intersectPlane(n),a=i.intersectPlane(n),s=o.dist(a)/t.viewGL.rootNode.scale.x;this._groundMesh.scale.set(s,s,1)}},dispose:function(t,e){this._zrLayer&&this._zrLayer.dispose(),e.getZr().painter.delLayer(-1e3)}});const Snt=12756274*Math.PI/(256*Math.pow(2,20));function Tnt(){pnt.apply(this,arguments),this.maxPitch=85,this.zoomOffset=1}Tnt.prototype=new pnt,Tnt.prototype.constructor=Tnt,Tnt.prototype.type="maptalks3D";var Mnt=gnt("maptalks3D",Tnt,function(t){t.forEach(function(t){t.setCameraOption(t.model.getMaptalksCameraOption())})});vM(function(t){t.registerComponentModel(_nt),t.registerComponentView(wnt),t.registerCoordinateSystem("maptalks3D",Mnt),t.registerAction({type:"maptalks3DChangeCamera",event:"maptalks3dcamerachanged",update:"maptalks3D:updateCamera"},function(t,e){e.eachComponent({mainType:"maptalks3D",query:t},function(e){e.setMaptalksCameraOption(t)})})});var Cnt=N9.vec3,Int=cM.isDimensionStacked;function Ant(t,e,n){for(var r=t.getDataExtent(e),i=t.getDataExtent(n),o=r[1]-r[0]||r[0],a=i[1]-i[0]||i[0],s=new Uint8Array(2500),l=0;l<t.count();l++){var u=t.get(e,l),h=t.get(n,l),c=Math.floor((u-r[0])/o*49),d=50*Math.floor((h-i[0])/a*49)+c;s[d]=s[d]||1}var p=0;for(l=0;l<s.length;l++)s[l]&&p++;return p/s.length}var Dnt=N9.vec3,Lnt=cM.isDimensionStacked;function Pnt(t,e){var n=Lnt(t,e[2]);return{dimension:n?t.getCalculationInfo("stackResultDimension"):e[2],isStacked:n}}function Ent(t){t.registerLayout(function(t,e){t.eachSeriesByType("bar3D",function(t){var e=t.coordinateSystem,n=e&&e.type;if("globe"===n)!function(t,e){var n=t.getData(),r=t.get("minHeight")||0,i=t.get("barSize"),o=["lng","lat","alt"].map(function(e){return t.coordDimToDataDim(e)[0]});if(null==i){var a=e.radius*Math.PI,s=Ant(n,o[0],o[1]);i=[a/Math.sqrt(n.count()/s),a/Math.sqrt(n.count()/s)]}else j(i)||(i=[i,i]);var l=Pnt(n,o);n.each(o,function(t,o,a,s){var u=n.get(l.dimension,s),h=l.isStacked?u-a:e.altitudeAxis.scale.getExtent()[0],c=Math.max(e.altitudeAxis.dataToCoord(a),r),d=e.dataToPoint([t,o,h]),p=e.dataToPoint([t,o,u]),f=Dnt.sub([],p,d);Dnt.normalize(f,f);var g=[i[0],c,i[1]];n.setItemLayout(s,[d,f,g])}),n.setLayout("orient",W1.UP.array)}(t,e);else if("cartesian3D"===n)!function(t,e){var n=t.getData(),r=t.get("barSize");if(null==r){var i,o,a=e.size,s=e.getAxis("x"),l=e.getAxis("y");i="category"===s.type?.7*s.getBandWidth():.6*Math.round(a[0]/Math.sqrt(n.count())),o="category"===l.type?.7*l.getBandWidth():.6*Math.round(a[1]/Math.sqrt(n.count())),r=[i,o]}else j(r)||(r=[r,r]);var u=e.getAxis("z").scale.getExtent(),h=function(t){var e=t[0],n=t[1];return!(e>0&&n>0||e<0&&n<0)}(u),c=["x","y","z"].map(function(e){return t.coordDimToDataDim(e)[0]}),d=Int(n,c[2]),p=d?n.getCalculationInfo("stackResultDimension"):c[2];n.each(c,function(t,i,o,a){var s=n.get(p,a),l=d?s-o:h?0:u[0],c=e.dataToPoint([t,i,l]),f=e.dataToPoint([t,i,s]),g=Cnt.dist(c,f),m=[0,f[1]<c[1]?-1:1,0];0===Math.abs(g)&&(g=.1);var v=[r[0],g,r[1]];n.setItemLayout(a,[c,m,v])}),n.setLayout("orient",[1,0,0])}(t,e);else if("geo3D"===n)!function(t,e){var n=t.getData(),r=t.get("barSize"),i=t.get("minHeight")||0,o=["lng","lat","alt"].map(function(e){return t.coordDimToDataDim(e)[0]});if(null==r){var a=Math.min(e.size[0],e.size[2]),s=Ant(n,o[0],o[1]);r=[a/Math.sqrt(n.count()/s),a/Math.sqrt(n.count()/s)]}else j(r)||(r=[r,r]);var l=[0,1,0],u=Pnt(n,o);n.each(o,function(t,o,a,s){var h=n.get(u.dimension,s),c=u.isStacked?h-a:e.altitudeAxis.scale.getExtent()[0],d=Math.max(e.altitudeAxis.dataToCoord(a),i),p=e.dataToPoint([t,o,c]),f=[r[0],d,r[1]];n.setItemLayout(s,[p,l,f])}),n.setLayout("orient",[1,0,0])}(t,e);else{if("mapbox3D"!==n&&"maptalks3D"!==n)throw e?new Error("bar3D doesn't support coordinate system "+e.type):new Error("bar3D doesn't have coordinate system.");!function(t,e){var n=t.getData(),r=t.coordDimToDataDim("lng")[0],i=t.coordDimToDataDim("lat")[0],o=t.coordDimToDataDim("alt")[0],a=t.get("barSize"),s=t.get("minHeight")||0;if(null==a){var l=n.getDataExtent(r),u=n.getDataExtent(i),h=e.dataToPoint([l[0],u[0]]),c=e.dataToPoint([l[1],u[1]]),d=Math.min(Math.abs(h[0]-c[0]),Math.abs(h[1]-c[1]))||1,p=Ant(n,r,i);a=[d/Math.sqrt(n.count()/p),d/Math.sqrt(n.count()/p)]}else j(a)||(a=[a,a]),a[0]/=e.getScale()/16,a[1]/=e.getScale()/16;var f=[0,0,1],g=[r,i,o],m=Pnt(n,g);n.each(g,function(t,r,i,o){var l=n.get(m.dimension,o),u=m.isStacked?l-i:0,h=e.dataToPoint([t,r,u]),c=e.dataToPoint([t,r,l]),d=Math.max(c[2]-h[2],s),p=[a[0],d,a[1]];n.setItemLayout(o,[h,f,p])}),n.setLayout("orient",[1,0,0])}(t,e)}})})}var Ont={getFormattedLabel:function(t,e,n,r,i){n=n||"normal";var o=t.getData(r).getItemModel(e),a=t.getDataParams(e,r);null!=i&&a.value instanceof Array&&(a.value=a.value[i]);var s,l=o.get("normal"===n?["label","formatter"]:["emphasis","label","formatter"]);return null==l&&(l=o.get(["label","formatter"])),"function"==typeof l?(a.status=n,s=l(a)):"string"==typeof l&&(s=bg(l,a)),s},normalizeToArray:function(t){return t instanceof Array?t:null==t?[]:[t]}},Nnt=Ont;function Rnt(t,e,n){var r=t.getData(),i=t.getRawValue(e),o=j(i)?function(t){var i=[],o=function(t,e){var n=[];return B(t.dimensions,function(r){var i=t.getDimensionInfo(r),o=i.otherDims[e];null!=o&&!1!==o&&(n[o]=i.name)}),n}(r,"tooltip");function a(t,e){var o=r.getDimensionInfo(e);if(o&&!1!==o.otherDims.tooltip){var a=o.type,s="- "+(o.tooltipName||o.name)+": "+("ordinal"===a?t+"":"time"===a?n?"":Tg("yyyy/MM/dd hh:mm:ss",t):gg(t));s&&i.push(ue(s))}}return o.length?B(o,function(t){a(r.get(t,e),t)}):B(t,a),"<br/>"+i.join("<br/>")}(i):ue(gg(i)),a=r.getName(e),s=det(r,e);J(s)&&s.colorStops&&(s=(s.colorStops[0]||{}).color);var l=Sg(s=s||"transparent"),u=t.name;return"\0-"===u&&(u=""),u=u?ue(u)+(n?": ":"<br/>"):"",n?l+u+o:u+l+(a?ue(a)+": "+o:o)}function knt(t,e,n){n=n||t.getSource();var r=e||vw(t.get("coordinateSystem"))||["x","y","z"],i=aS(n,{dimensionsDefine:n.dimensionsDefine||t.get("dimensions"),encodeDefine:n.encodeDefine||t.get("encode"),coordDimensions:r.map(function(e){var n=t.getReferringComponents(e+"Axis3D").models[0];return{type:n&&"category"===n.get("type")?"ordinal":"float",name:e}})});"cartesian3D"===t.get("coordinateSystem")&&i.forEach(function(e){if(r.indexOf(e.coordDim)>=0){var n=t.getReferringComponents(e.coordDim+"Axis3D").models[0];n&&"category"===n.get("type")&&(e.ordinalMeta=n.getOrdinalMeta())}});var o=cM.enableDataStack(t,i,{byIndex:!0,stackedCoordDimension:"z"}),a=new oS(i,t);return a.setCalculationInfo(o),a.initData(n),a}var znt=Ky.extend({type:"series.bar3D",dependencies:["globe"],visualStyleAccessPathvisu:"itemStyle",getInitialData:function(t,e){return knt(this)},getFormattedLabel:function(t,e,n,r){var i=Nnt.getFormattedLabel(this,t,e,n,r);return null==i&&(i=this.getData().get("z",t)),i},formatTooltip:function(t){return Rnt(this,t)},defaultOption:{coordinateSystem:"cartesian3D",globeIndex:0,grid3DIndex:0,zlevel:-10,bevelSize:0,bevelSmoothness:2,onGridPlane:"xy",shading:"color",minHeight:0,itemStyle:{opacity:1},label:{show:!1,distance:2,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},emphasis:{label:{show:!0}},animationDurationUpdate:500}});A(znt.prototype,Dtt);var Bnt,Vnt,Fnt,Gnt,Hnt,Unt,Wnt,Xnt,jnt=znt,Znt=N9.vec3,Ynt=N9.mat3,qnt=b4.extend(function(){return{attributes:{position:new b4.Attribute("position","float",3,"POSITION"),normal:new b4.Attribute("normal","float",3,"NORMAL"),color:new b4.Attribute("color","float",4,"COLOR"),prevPosition:new b4.Attribute("prevPosition","float",3),prevNormal:new b4.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}},{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(t){var e=this.enableNormal,n=this.getBarVertexCount()*t,r=this.getBarTriangleCount()*t;this.vertexCount!==n&&(this.attributes.position.init(n),e?this.attributes.normal.init(n):this.attributes.normal.value=null,this.attributes.color.init(n)),this.triangleCount!==r&&(this.indices=n>65535?new Uint32Array(3*r):new Uint16Array(3*r),this._dataIndices=new Uint32Array(n))},getBarVertexCount:function(){var t=this.bevelSize>0?this.bevelSegments:0;return t>0?this._getBevelBarVertexCount(t):this.enableNormal?24:8},getBarTriangleCount:function(){var t=this.bevelSize>0?this.bevelSegments:0;return t>0?this._getBevelBarTriangleCount(t):12},_getBevelBarVertexCount:function(t){return 4*(t+1)*(t+1)*2},_getBevelBarTriangleCount:function(t){return(4*t+3+1)*(2*t+1)*2+4},setColor:function(t,e){for(var n=this.getBarVertexCount(),r=n*(t+1),i=n*t;i<r;i++)this.attributes.color.set(i,e);this.dirtyAttribute("color")},getDataIndexOfVertex:function(t){return this._dataIndices?this._dataIndices[t]:null},addBar:function(){for(var t=Znt.create,e=Znt.scaleAndAdd,n=t(),r=t(),i=t(),o=t(),a=t(),s=t(),l=t(),u=[],h=[],c=0;c<8;c++)u[c]=t();var d=[[0,1,5,4],[2,3,7,6],[4,5,6,7],[3,2,1,0],[0,4,7,3],[1,2,6,5]],p=[0,1,2,0,2,3],f=[];for(c=0;c<d.length;c++)for(var g=d[c],m=0;m<2;m++){for(var v=[],y=0;y<3;y++)v.push(g[p[3*m+y]]);f.push(v)}return function(t,c,g,m,v,y){var _=this._vertexOffset;if(this.bevelSize>0&&this.bevelSegments>0)this._addBevelBar(t,c,g,m,this.bevelSize,this.bevelSegments,v);else{Znt.copy(i,c),Znt.normalize(i,i),Znt.cross(o,g,i),Znt.normalize(o,o),Znt.cross(r,i,o),Znt.normalize(o,o),Znt.negate(a,r),Znt.negate(s,i),Znt.negate(l,o),e(u[0],t,r,m[0]/2),e(u[0],u[0],o,m[2]/2),e(u[1],t,r,m[0]/2),e(u[1],u[1],l,m[2]/2),e(u[2],t,a,m[0]/2),e(u[2],u[2],l,m[2]/2),e(u[3],t,a,m[0]/2),e(u[3],u[3],o,m[2]/2),e(n,t,i,m[1]),e(u[4],n,r,m[0]/2),e(u[4],u[4],o,m[2]/2),e(u[5],n,r,m[0]/2),e(u[5],u[5],l,m[2]/2),e(u[6],n,a,m[0]/2),e(u[6],u[6],l,m[2]/2),e(u[7],n,a,m[0]/2),e(u[7],u[7],o,m[2]/2);var x=this.attributes;if(this.enableNormal){h[0]=r,h[1]=a,h[2]=i,h[3]=s,h[4]=o,h[5]=l;for(var b=this._vertexOffset,w=0;w<d.length;w++){for(var S=3*this._triangleOffset,T=0;T<6;T++)this.indices[S++]=b+p[T];b+=4,this._triangleOffset+=2}for(w=0;w<d.length;w++){var M=h[w];for(T=0;T<4;T++){var C=d[w][T];x.position.set(this._vertexOffset,u[C]),x.normal.set(this._vertexOffset,M),x.color.set(this._vertexOffset++,v)}}}else{for(w=0;w<f.length;w++){for(S=3*this._triangleOffset,T=0;T<3;T++)this.indices[S+T]=f[w][T]+this._vertexOffset;this._triangleOffset++}for(w=0;w<u.length;w++)x.position.set(this._vertexOffset,u[w]),x.color.set(this._vertexOffset++,v)}}var I=this._vertexOffset;for(w=_;w<I;w++)this._dataIndices[w]=y}}(),_addBevelBar:(Bnt=Znt.create(),Vnt=Znt.create(),Fnt=Znt.create(),Gnt=Ynt.create(),Hnt=[],Unt=[1,-1,-1,1],Wnt=[1,1,-1,-1],Xnt=[2,0],function(t,e,n,r,i,o,a){Znt.copy(Vnt,e),Znt.normalize(Vnt,Vnt),Znt.cross(Fnt,n,Vnt),Znt.normalize(Fnt,Fnt),Znt.cross(Bnt,Vnt,Fnt),Znt.normalize(Fnt,Fnt),Gnt[0]=Bnt[0],Gnt[1]=Bnt[1],Gnt[2]=Bnt[2],Gnt[3]=Vnt[0],Gnt[4]=Vnt[1],Gnt[5]=Vnt[2],Gnt[6]=Fnt[0],Gnt[7]=Fnt[1],Gnt[8]=Fnt[2],i=Math.min(r[0],r[2])/2*i;for(var s=0;s<3;s++)Hnt[s]=Math.max(r[s]-2*i,0);var l=(r[0]-Hnt[0])/2,u=(r[1]-Hnt[1])/2,h=(r[2]-Hnt[2])/2,c=[],d=[],p=this._vertexOffset,f=[];for(s=0;s<2;s++){f[s]=f[s]=[];for(var g=0;g<=o;g++)for(var m=0;m<4;m++){(0===g&&0===s||1===s&&g===o)&&f[s].push(p);for(var v=0;v<=o;v++){var y=v/o*Math.PI/2+Math.PI/2*m,_=g/o*Math.PI/2+Math.PI/2*s;d[0]=l*Math.cos(y)*Math.sin(_),d[1]=u*Math.cos(_),d[2]=h*Math.sin(y)*Math.sin(_),c[0]=d[0]+Unt[m]*Hnt[0]/2,c[1]=d[1]+u+Xnt[s]*Hnt[1]/2,c[2]=d[2]+Wnt[m]*Hnt[2]/2,Math.abs(l-u)<1e-6&&Math.abs(u-h)<1e-6||(d[0]/=l*l,d[1]/=u*u,d[2]/=h*h),Znt.normalize(d,d),Znt.transformMat3(c,c,Gnt),Znt.transformMat3(d,d,Gnt),Znt.add(c,c,t),this.attributes.position.set(p,c),this.enableNormal&&this.attributes.normal.set(p,d),this.attributes.color.set(p,a),p++}}}var x=4*o+3,b=2*o+1,w=x+1;for(m=0;m<b;m++)for(s=0;s<=x;s++){var S=m*w+s+this._vertexOffset,T=m*w+(s+1)%w+this._vertexOffset,M=(m+1)*w+(s+1)%w+this._vertexOffset,C=(m+1)*w+s+this._vertexOffset;this.setTriangleIndices(this._triangleOffset++,[M,S,T]),this.setTriangleIndices(this._triangleOffset++,[M,C,S])}this.setTriangleIndices(this._triangleOffset++,[f[0][0],f[0][2],f[0][1]]),this.setTriangleIndices(this._triangleOffset++,[f[0][0],f[0][3],f[0][2]]),this.setTriangleIndices(this._triangleOffset++,[f[1][0],f[1][1],f[1][2]]),this.setTriangleIndices(this._triangleOffset++,[f[1][0],f[1][2],f[1][3]]),this._vertexOffset=p})});E(qnt.prototype,O9),E(qnt.prototype,cet);var Knt=qnt,Jnt=N9.vec3,Qnt=l_.extend({type:"bar3D",__ecgl__:!0,init:function(t,e){this.groupGL=new a9.Node,this._api=e,this._labelsBuilder=new fet(256,256,e);var n=this;this._labelsBuilder.getLabelPosition=function(t,e,r){if(n._data){var i=n._data.getItemLayout(t),o=i[0],a=i[1],s=i[2][1];return Jnt.scaleAndAdd([],o,a,r+s)}return[0,0]},this._labelsBuilder.getMesh().renderOrder=100},render:function(t,e,n){var r=this._prevBarMesh;this._prevBarMesh=this._barMesh,this._barMesh=r,this._barMesh||(this._barMesh=new a9.Mesh({geometry:new Knt,shadowDepthMaterial:new a9.Material({shader:new a9.Shader(a9.Shader.source("ecgl.sm.depth.vertex"),a9.Shader.source("ecgl.sm.depth.fragment"))}),culling:"cartesian3D"===t.coordinateSystem.type,renderOrder:10,renderNormal:!0})),this.groupGL.remove(this._prevBarMesh),this.groupGL.add(this._barMesh),this.groupGL.add(this._labelsBuilder.getMesh());var i=t.coordinateSystem;if(this._doRender(t,n),i&&i.viewGL){i.viewGL.add(this.groupGL);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._barMesh.material[o]("fragment","SRGB_DECODE")}this._data=t.getData(),this._labelsBuilder.updateData(this._data),this._labelsBuilder.updateLabels(),this._updateAnimation(t)},_updateAnimation:function(t){a9.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevBarMesh,this._barMesh,t)},_doRender:function(t,e){var n=t.getData(),r=t.get("shading"),i="color"!==r,o=this,a=this._barMesh,s="ecgl."+r;a.material&&a.material.shader.name===s||(a.material=a9.createMaterial(s,["VERTEX_COLOR"])),a9.setMaterialFromModel(r,a.material,t,e),a.geometry.enableNormal=i,a.geometry.resetOffset();var l=t.get("bevelSize"),u=t.get("bevelSmoothness");a.geometry.bevelSegments=u,a.geometry.bevelSize=l;var h=[],c=new Float32Array(4*n.count()),d=0,p=0,f=!1;n.each(function(t){if(n.hasValue(t)){var e=det(n,t),r=pet(n,t);null==r&&(r=1),a9.parseColor(e,h),h[3]*=r,c[d++]=h[0],c[d++]=h[1],c[d++]=h[2],c[d++]=h[3],h[3]>0&&(p++,h[3]<.99&&(f=!0))}}),a.geometry.setBarCount(p);var g=n.getLayout("orient"),m=this._barIndexOfData=new Int32Array(n.count());p=0;n.each(function(t){if(n.hasValue(t)){var e=n.getItemLayout(t),r=e[0],i=e[1],a=e[2],s=4*t;h[0]=c[s++],h[1]=c[s++],h[2]=c[s++],h[3]=c[s++],h[3]>0&&(o._barMesh.geometry.addBar(r,i,g,a,h,t),m[t]=p++)}else m[t]=-1}),a.geometry.dirty(),a.geometry.updateBoundingBox();var v=a.material;v.transparent=f,v.depthMask=!f,a.geometry.sortTriangles=f,this._initHandler(t,e)},_initHandler:function(t,e){var n=t.getData(),r=this._barMesh,i="cartesian3D"===t.coordinateSystem.type;r.seriesIndex=t.seriesIndex;var o=-1;r.off("mousemove"),r.off("mouseout"),r.on("mousemove",function(t){var a=r.geometry.getDataIndexOfVertex(t.triangle[0]);a!==o&&(this._downplay(o),this._highlight(a),this._labelsBuilder.updateLabels([a]),i&&e.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",a),n.get("y",a),n.get("z",a,!0)]})),o=a,r.dataIndex=a},this),r.on("mouseout",function(t){this._downplay(o),this._labelsBuilder.updateLabels(),o=-1,r.dataIndex=-1,i&&e.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_highlight:function(t){var e=this._data;if(e){var n=this._barIndexOfData[t];if(!(n<0)){var r=e.getItemModel(t).getModel("emphasis.itemStyle"),i=r.get("color"),o=r.get("opacity");if(null==i)i=Mr(det(e,t),-.4);null==o&&(o=pet(e,t));var a=a9.parseColor(i);a[3]*=o,this._barMesh.geometry.setColor(n,a),this._api.getZr().refresh()}}},_downplay:function(t){var e=this._data;if(e){var n=this._barIndexOfData[t];if(!(n<0)){var r=det(e,t),i=pet(e,t),o=a9.parseColor(r);o[3]*=i,this._barMesh.geometry.setColor(n,o),this._api.getZr().refresh()}}},highlight:function(t,e,n,r){this._toggleStatus("highlight",t,e,n,r)},downplay:function(t,e,n,r){this._toggleStatus("downplay",t,e,n,r)},_toggleStatus:function(t,e,n,r,i){var o=e.getData(),a=M8.queryDataIndex(o,i),s=this;null!=a?B(Nnt.normalizeToArray(a),function(e){"highlight"===t?this._highlight(e):this._downplay(e)},this):o.each(function(e){"highlight"===t?s._highlight(e):s._downplay(e)})},remove:function(){this.groupGL.removeAll()},dispose:function(){this._labelsBuilder.dispose(),this.groupGL.removeAll()}});vM(function(t){t.registerChartView(Qnt),t.registerSeriesModel(jnt),Ent(t),t.registerProcessor(function(t,e){t.eachSeriesByType("bar3d",function(t){var e=t.getData();e.filterSelf(function(t){return e.hasValue(t)})})})});var $nt=Ky.extend({type:"series.line3D",dependencies:["grid3D"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(t,e){return knt(this)},formatTooltip:function(t){return Rnt(this,t)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,lineStyle:{width:2},animationDurationUpdate:500}}),trt=N9.vec3;a9.Shader.import(n7);var ert=l_.extend({type:"line3D",__ecgl__:!0,init:function(t,e){this.groupGL=new a9.Node,this._api=e},render:function(t,e,n){var r=this._prevLine3DMesh;this._prevLine3DMesh=this._line3DMesh,this._line3DMesh=r,this._line3DMesh||(this._line3DMesh=new a9.Mesh({geometry:new B9({useNativeLine:!1,sortTriangles:!0}),material:new a9.Material({shader:a9.createShader("ecgl.meshLines3D")}),renderOrder:10}),this._line3DMesh.geometry.pick=this._pick.bind(this)),this.groupGL.remove(this._prevLine3DMesh),this.groupGL.add(this._line3DMesh);var i=t.coordinateSystem;if(i&&i.viewGL){i.viewGL.add(this.groupGL);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._line3DMesh.material[o]("fragment","SRGB_DECODE")}this._doRender(t,n),this._data=t.getData(),this._camera=i.viewGL.camera,this.updateCamera(),this._updateAnimation(t)},updateCamera:function(){this._updateNDCPosition()},_doRender:function(t,e){var n=t.getData(),r=this._line3DMesh;r.geometry.resetOffset();var i=n.getLayout("points"),o=[],a=new Float32Array(i.length/3*4),s=0,l=!1;n.each(function(t){var e=det(n,t),r=pet(n,t);null==r&&(r=1),a9.parseColor(e,o),o[3]*=r,a[s++]=o[0],a[s++]=o[1],a[s++]=o[2],a[s++]=o[3],o[3]<.99&&(l=!0)}),r.geometry.setVertexCount(r.geometry.getPolylineVertexCount(i)),r.geometry.setTriangleCount(r.geometry.getPolylineTriangleCount(i)),r.geometry.addPolyline(i,a,M8.firstNotNull(t.get("lineStyle.width"),1)),r.geometry.dirty(),r.geometry.updateBoundingBox();var u=r.material;u.transparent=l,u.depthMask=!l;var h=t.getModel("debug.wireframe");h.get("show")?(r.geometry.createAttribute("barycentric","float",3),r.geometry.generateBarycentric(),r.material.set("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",a9.parseColor(h.get("lineStyle.color")||"rgba(0,0,0,0.5)")),r.material.set("wireframeLineWidth",M8.firstNotNull(h.get("lineStyle.width"),1))):r.material.set("both","WIREFRAME_TRIANGLE"),this._points=i,this._initHandler(t,e)},_updateAnimation:function(t){a9.updateVertexAnimation([["prevPosition","position"],["prevPositionPrev","positionPrev"],["prevPositionNext","positionNext"]],this._prevLine3DMesh,this._line3DMesh,t)},_initHandler:function(t,e){var n=t.getData(),r=t.coordinateSystem,i=this._line3DMesh,o=-1;i.seriesIndex=t.seriesIndex,i.off("mousemove"),i.off("mouseout"),i.on("mousemove",function(a){var s,l=r.pointToData(a.point.array);(s=t.indicesOfNearest?t.indicesOfNearest("x","x",l[0])[0]:n.indicesOfNearest("x",l[0])[0])!==o&&(e.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",s),n.get("y",s),n.get("z",s)]}),i.dataIndex=s),o=s},this),i.on("mouseout",function(t){o=-1,i.dataIndex=-1,e.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_updateNDCPosition:function(){var t=new v2,e=this._camera;v2.multiply(t,e.projectionMatrix,e.viewMatrix);var n=this._positionNDC,r=this._points,i=r.length/3;n&&n.length/2===i||(n=this._positionNDC=new Float32Array(2*i));for(var o=[],a=0;a<i;a++){var s=3*a,l=2*a;o[0]=r[s],o[1]=r[s+1],o[2]=r[s+2],o[3]=1,trt.transformMat4(o,o,t.array),n[l]=o[0]/o[3],n[l+1]=o[1]/o[3]}},_pick:function(t,e,n,r,i,o){var a=this._positionNDC,s=this._data.hostModel.get("lineStyle.width"),l=-1,u=.5*n.viewport.width,h=.5*n.viewport.height;t=(t+1)*u,e=(e+1)*h;for(var c=1;c<a.length/2;c++){var d=(a[2*(c-1)]+1)*u,p=(a[2*(c-1)+1]+1)*h,f=(a[2*c]+1)*u,g=(a[2*c+1]+1)*h;if($l(d,p,f,g,s,t,e))l=(d-t)*(d-t)+(p-e)*(p-e)<(f-t)*(f-t)+(g-e)*(g-e)?c-1:c}if(l>=0){var m=3*l,v=new W1(this._points[m],this._points[m+1],this._points[m+2]);o.push({dataIndex:l,point:v,pointWorld:v.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(v)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});vM(function(t){t.registerChartView(ert),t.registerSeriesModel($nt),t.registerLayout(function(t,e){t.eachSeriesByType("line3D",function(t){var e=t.getData(),n=t.coordinateSystem;if(n){if("cartesian3D"!==n.type)return void console.error("line3D needs cartesian3D coordinateSystem");var r=new Float32Array(3*e.count()),i=[],o=[],a=n.dimensions.map(function(e){return t.coordDimToDataDim(e)[0]});n&&e.each(a,function(t,e,a,s){i[0]=t,i[1]=e,i[2]=a,n.dataToPoint(i,o),r[3*s]=o[0],r[3*s+1]=o[1],r[3*s+2]=o[2]}),e.setLayout("points",r)}})})});var nrt=Ky.extend({type:"series.scatter3D",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(t,e){return knt(this)},getFormattedLabel:function(t,e,n,r){var i=Nnt.getFormattedLabel(this,t,e,n,r);if(null==i){var o=this.getData(),a=o.dimensions[o.dimensions.length-1];i=o.get(a,t)}return i},formatTooltip:function(t){return Rnt(this,t)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,progressive:1e5,progressiveThreshold:1e5,grid3DIndex:0,globeIndex:0,symbol:"circle",symbolSize:10,blendMode:"source-over",label:{show:!1,position:"right",distance:5,textStyle:{fontSize:14,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:3}},itemStyle:{opacity:.8},emphasis:{label:{show:!0}},animationDurationUpdate:500}});function rrt(t,e,n){(e=e||document.createElement("canvas")).width=t,e.height=t;var r=e.getContext("2d");return n&&n(r),e}var irt={getMarginByStyle:function(t){var e=t.minMargin||0,n=0;t.stroke&&"none"!==t.stroke&&(n=null==t.lineWidth?1:t.lineWidth);var r=t.shadowBlur||0,i=t.shadowOffsetX||0,o=t.shadowOffsetY||0,a={};return a.left=Math.max(n/2,-i+r,e),a.right=Math.max(n/2,i+r,e),a.top=Math.max(n/2,-o+r,e),a.bottom=Math.max(n/2,o+r,e),a},createSymbolSprite:function(t,e,n,r){var i=function(t,e,n,r){j(e)||(e=[e,e]);var i=irt.getMarginByStyle(n,r),o=e[0]+i.left+i.right,a=e[1]+i.top+i.bottom,s=Cx(t,0,0,e[0],e[1]),l=Math.max(o,a);s.x=i.left,s.y=i.top,o>a?s.y+=(l-a)/2:s.x+=(l-o)/2;var u=s.getBoundingRect();return s.x-=u.x,s.y-=u.y,s.setStyle(n),s.update(),s.__size=l,s}(t,e,n),o=irt.getMarginByStyle(n);return{image:rrt(i.__size,r,function(t){Zx(t,i)}),margin:o}},createSDFFromCanvas:function(t,e,n,r){return rrt(e,r,function(e){var r=t.getContext("2d").getImageData(0,0,t.width,t.height);e.putImageData(function(t,e,n){var r=e.width,i=e.height,o=t.canvas.width,a=t.canvas.height,s=r/o,l=i/a;function u(t){return t<128?1:-1}function h(t,o){var a=1/0;t=Math.floor(t*s);for(var h=(o=Math.floor(o*l))*r+t,c=u(e.data[4*h]),d=Math.max(o-n,0);d<Math.min(o+n,i);d++)for(var p=Math.max(t-n,0);p<Math.min(t+n,r);p++){h=d*r+p;var f=p-t,g=d-o;if(c!==u(e.data[4*h])){var m=f*f+g*g;m<a&&(a=m)}}return c*Math.sqrt(a)}for(var c=t.createImageData(o,a),d=0;d<a;d++)for(var p=0;p<o;p++){var f=h(p,d)/n*.5+.5,g=4*(d*o+p);c.data[g++]=255*(1-f),c.data[g++]=255*(1-f),c.data[g++]=255*(1-f),c.data[g++]=255}return c}(e,r,n),0,0)})},createSimpleSprite:function(t,e){return rrt(t,e,function(e){var n=t/2;e.beginPath(),e.arc(n,n,60,0,2*Math.PI,!1),e.closePath();var r=e.createRadialGradient(n,n,0,n,n,n);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=r,e.fill()})}},ort=irt,art=N9.vec3,srt={needsSortVertices:function(){return this.sortVertices},needsSortVerticesProgressively:function(){return this.needsSortVertices()&&this.vertexCount>=2e4},doSortVertices:function(t,e){var n=this.indices,r=art.create();if(!n){n=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var i=0;i<n.length;i++)n[i]=i}if(0===e){var o,a=this.attributes.position,s=(t=t.array,0);this._zList&&this._zList.length===this.vertexCount||(this._zList=new Float32Array(this.vertexCount));for(i=0;i<this.vertexCount;i++){a.get(i,r);var l=art.sqrDist(r,t);isNaN(l)&&(l=1e7,s++),0===i?(o=l,l=0):l-=o,this._zList[i]=l}this._noneCount=s}if(this.vertexCount<2e4)0===e&&this._simpleSort(this._noneCount/this.vertexCount>.05);else for(i=0;i<3;i++)this._progressiveQuickSort(3*e+i);this.dirtyIndices()},_simpleSort:function(t){var e=this._zList,n=this.indices;function r(t,n){return e[n]-e[t]}t?Array.prototype.sort.call(n,r):oet.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(t){var e=this._zList,n=this.indices;this._quickSort=this._quickSort||new oet,this._quickSort.step(n,function(t,n){return e[n]-e[t]},t)}},lrt=N9.vec4;a9.Shader.import("@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end");var urt=a9.Mesh.extend(function(){var t=new a9.Geometry({dynamic:!0,attributes:{color:new a9.Geometry.Attribute("color","float",4,"COLOR"),position:new a9.Geometry.Attribute("position","float",3,"POSITION"),size:new a9.Geometry.Attribute("size","float",1),prevPosition:new a9.Geometry.Attribute("prevPosition","float",3),prevSize:new a9.Geometry.Attribute("prevSize","float",1)}});Object.assign(t,srt);var e=new a9.Material({shader:a9.createShader("ecgl.sdfSprite"),transparent:!0,depthMask:!1});e.enableTexture("sprite"),e.define("both","VERTEX_COLOR"),e.define("both","VERTEX_SIZE");var n=new a9.Texture2D({image:document.createElement("canvas"),flipY:!1});return e.set("sprite",n),t.pick=this._pick.bind(this),{geometry:t,material:e,mode:a9.Mesh.POINTS,sizeScale:1}},{_pick:function(t,e,n,r,i,o){var a=this._positionNDC;if(a)for(var s=n.viewport,l=2/s.width,u=2/s.height,h=this.geometry.vertexCount-1;h>=0;h--){var c,d=a[2*(c=this.geometry.indices?this.geometry.indices[h]:h)],p=a[2*c+1],f=this.geometry.attributes.size.get(c)/this.sizeScale/2;if(t>d-f*l&&t<d+f*l&&e>p-f*u&&e<p+f*u){var g=new a9.Vector3,m=new a9.Vector3;this.geometry.attributes.position.get(c,g.array),a9.Vector3.transformMat4(m,g,this.worldTransform),o.push({vertexIndex:c,point:g,pointWorld:m,target:this,distance:m.distance(r.getWorldPosition())})}}},updateNDCPosition:function(t,e,n){var r=this._positionNDC,i=this.geometry;r&&r.length/2===i.vertexCount||(r=this._positionNDC=new Float32Array(2*i.vertexCount));for(var o=lrt.create(),a=0;a<i.vertexCount;a++)i.attributes.position.get(a,o),o[3]=1,lrt.transformMat4(o,o,t.array),lrt.scale(o,o,1/o[3]),r[2*a]=o[0],r[2*a+1]=o[1]}}),hrt=urt;function crt(t,e){this.rootNode=new a9.Node,this.is2D=t,this._labelsBuilder=new fet(256,256,e),this._labelsBuilder.getMesh().renderOrder=100,this.rootNode.add(this._labelsBuilder.getMesh()),this._api=e,this._spriteImageCanvas=document.createElement("canvas"),this._startDataIndex=0,this._endDataIndex=0,this._sizeScale=1}crt.prototype={constructor:crt,highlightOnMouseover:!0,update:function(t,e,n,r,i){var o=this._prevMesh;this._prevMesh=this._mesh,this._mesh=o;var a=t.getData();if(null==r&&(r=0),null==i&&(i=a.count()),this._startDataIndex=r,this._endDataIndex=i-1,!this._mesh){var s=this._prevMesh&&this._prevMesh.material;this._mesh=new hrt({renderOrder:10,frustumCulling:!1}),s&&(this._mesh.material=s)}s=this._mesh.material;var l=this._mesh.geometry,u=l.attributes;this.rootNode.remove(this._prevMesh),this.rootNode.add(this._mesh),this._setPositionTextureToMesh(this._mesh,this._positionTexture);var h=this._getSymbolInfo(t,r,i),c=n.getDevicePixelRatio(),d=t.getModel("itemStyle").getItemStyle(),p=t.get("large"),f=1;h.maxSize>2?(f=this._updateSymbolSprite(t,d,h,c),s.enableTexture("sprite")):s.disableTexture("sprite"),u.position.init(i-r);var g=[];if(p){s.undefine("VERTEX_SIZE"),s.undefine("VERTEX_COLOR");var m=function(t){const e=t.getVisual("style");if(e)return e[t.getVisual("drawType")]}(a),v=function(t){return t.getVisual("style").opacity}(a);a9.parseColor(m,g),g[3]*=v,s.set({color:g,u_Size:h.maxSize*this._sizeScale})}else s.set({color:[1,1,1,1]}),s.define("VERTEX_SIZE"),s.define("VERTEX_COLOR"),u.size.init(i-r),u.color.init(i-r),this._originalOpacity=new Float32Array(i-r);for(var y=a.getLayout("points"),_=u.position.value,x=0;x<i-r;x++){var b=3*x,w=2*x;if(this.is2D?(_[b]=y[w],_[b+1]=y[w+1],_[b+2]=-10):(_[b]=y[b],_[b+1]=y[b+1],_[b+2]=y[b+2]),!p){m=det(a,x),v=pet(a,x);a9.parseColor(m,g),g[3]*=v,u.color.set(x,g),g[3];var S=a.getItemVisual(x,"symbolSize");S=S instanceof Array?Math.max(S[0],S[1]):S,isNaN(S)&&(S=0),u.size.value[x]=S*f*this._sizeScale,this._originalOpacity[x]=g[3]}}this._mesh.sizeScale=f,l.updateBoundingBox(),l.dirty(),this._updateMaterial(t,d);var T=t.coordinateSystem;T&&T.viewGL&&s[T.viewGL.isLinearSpace()?"define":"undefine"]("fragment","SRGB_DECODE");p||this._updateLabelBuilder(t,r,i),this._updateHandler(t,e,n),this._updateAnimation(t),this._api=n},getPointsMesh:function(){return this._mesh},updateLabels:function(t){this._labelsBuilder.updateLabels(t)},hideLabels:function(){this.rootNode.remove(this._labelsBuilder.getMesh())},showLabels:function(){this.rootNode.add(this._labelsBuilder.getMesh())},dispose:function(){this._labelsBuilder.dispose()},_updateSymbolSprite:function(t,e,n,r){n.maxSize=Math.min(2*n.maxSize,200);var i,o,a=[];return n.aspect>1?(a[0]=n.maxSize,a[1]=n.maxSize/n.aspect):(a[1]=n.maxSize,a[0]=n.maxSize*n.aspect),a[0]=a[0]||1,a[1]=a[1]||1,this._symbolType===n.type&&(i=this._symbolSize,o=a,i&&o&&i[0]===o[0]&&i[1]===o[1])&&this._lineWidth===e.lineWidth||(ort.createSymbolSprite(n.type,a,{fill:"#fff",lineWidth:e.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(a[0]/2,10)},this._spriteImageCanvas),ort.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=n.type,this._symbolSize=a,this._lineWidth=e.lineWidth),this._spriteImageCanvas.width/n.maxSize*r},_updateMaterial:function(t,e){var n="lighter"===t.get("blendMode")?a9.additiveBlend:null,r=this._mesh.material;r.blend=n,r.set("lineWidth",e.lineWidth/20);var i=a9.parseColor(e.stroke);r.set("strokeColor",i),r.transparent=!0,r.depthMask=!1,r.depthTest=!this.is2D,r.sortVertices=!this.is2D},_updateLabelBuilder:function(t,e,n){var r=t.getData(),i=this._mesh.geometry,o=i.attributes.position.value,a=(e=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(r,e,n),this._labelsBuilder.getLabelPosition=function(t,n,r){var i=3*(t-e);return[o[i],o[i+1],o[i+2]]},this._labelsBuilder.getLabelDistance=function(t,n,r){return i.attributes.size.get(t-e)/a/2+r},this._labelsBuilder.updateLabels()},_updateAnimation:function(t){a9.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,t)},_updateHandler:function(t,e,n){var r,i=t.getData(),o=this._mesh,a=this,s=-1,l=t.coordinateSystem&&"cartesian3D"===t.coordinateSystem.type;l&&(r=t.coordinateSystem.model),o.seriesIndex=t.seriesIndex,o.off("mousemove"),o.off("mouseout"),o.on("mousemove",function(e){var u=e.vertexIndex+a._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(i,s),this.highlight(i,u),this._labelsBuilder.updateLabels([u])),l&&n.dispatchAction({type:"grid3DShowAxisPointer",value:[i.get(t.coordDimToDataDim("x")[0],u),i.get(t.coordDimToDataDim("y")[0],u),i.get(t.coordDimToDataDim("z")[0],u)],grid3DIndex:r.componentIndex})),o.dataIndex=u,s=u},this),o.on("mouseout",function(t){var e=t.vertexIndex+a._startDataIndex;this.highlightOnMouseover&&(this.downplay(i,e),this._labelsBuilder.updateLabels()),s=-1,o.dataIndex=-1,l&&n.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:r.componentIndex})},this)},updateLayout:function(t,e,n){var r=t.getData();if(this._mesh){var i=this._mesh.geometry.attributes.position.value,o=r.getLayout("points");if(this.is2D)for(var a=0;a<o.length/2;a++){var s=3*a,l=2*a;i[s]=o[l],i[s+1]=o[l+1],i[s+2]=-10}else for(a=0;a<o.length;a++)i[a]=o[a];this._mesh.geometry.dirty(),n.getZr().refresh()}},updateView:function(t){if(this._mesh){var e=new v2;v2.mul(e,t.viewMatrix,this._mesh.worldTransform),v2.mul(e,t.projectionMatrix,e),this._mesh.updateNDCPosition(e,this.is2D,this._api)}},highlight:function(t,e){if(!(e>this._endDataIndex||e<this._startDataIndex)){var n=t.getItemModel(e).getModel("emphasis.itemStyle"),r=n.get("color"),i=n.get("opacity");if(null==r)r=Mr(det(t,e),-.4);null==i&&(i=pet(t,e));var o=a9.parseColor(r);o[3]*=i,this._mesh.geometry.attributes.color.set(e-this._startDataIndex,o),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},downplay:function(t,e){if(!(e>this._endDataIndex||e<this._startDataIndex)){var n=det(t,e),r=pet(t,e),i=a9.parseColor(n);i[3]*=r,this._mesh.geometry.attributes.color.set(e-this._startDataIndex,i),this._mesh.geometry.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeOutAll:function(t){if(this._originalOpacity){for(var e=this._mesh.geometry,n=0;n<e.vertexCount;n++){var r=this._originalOpacity[n]*t;e.attributes.color.value[4*n+3]=r}e.dirtyAttribute("color"),this._api.getZr().refresh()}},fadeInAll:function(){this.fadeOutAll(1)},setPositionTexture:function(t){this._mesh&&this._setPositionTextureToMesh(this._mesh,t),this._positionTexture=t},removePositionTexture:function(){this._positionTexture=null,this._mesh&&this._setPositionTextureToMesh(this._mesh,null)},setSizeScale:function(t){if(t!==this._sizeScale){if(this._mesh){var e=this._mesh.material.get("u_Size");this._mesh.material.set("u_Size",e/this._sizeScale*t);var n=this._mesh.geometry.attributes;if(n.size.value)for(var r=0;r<n.size.value.length;r++)n.size.value[r]=n.size.value[r]/this._sizeScale*t}this._sizeScale=t}},_setPositionTextureToMesh:function(t,e){e&&t.material.set("positionTexture",e),t.material[e?"enableTexture":"disableTexture"]("positionTexture")},_getSymbolInfo:function(t,e,n){if(t.get("large"))return(c=M8.firstNotNull(t.get("symbolSize"),1))instanceof Array?(l=Math.max(c[0],c[1]),r=c[0]/c[1]):(l=c,r=1),{maxSize:c,type:t.get("symbol"),aspect:r};for(var r,i=t.getData(),o=!1,a=i.getItemVisual(0,"symbol")||"circle",s=!1,l=0,u=e;u<n;u++){var h,c=i.getItemVisual(u,"symbolSize"),d=i.getItemVisual(u,"symbol");if(c instanceof Array)h=c[0]/c[1],l=Math.max(Math.max(c[0],c[1]),l);else{if(isNaN(c))continue;h=1,l=Math.max(c,l)}null!=r&&Math.abs(h-r)>.05&&(o=!0),d!==a&&(s=!0),a=d,r=h}return o&&console.warn("Different symbol width / height ratio will be ignored."),s&&console.warn("Different symbol type will be ignored."),{maxSize:l,type:a,aspect:r}}};var drt=l_.extend({type:"scatter3D",hasSymbolVisual:!0,__ecgl__:!0,init:function(t,e){this.groupGL=new a9.Node,this._pointsBuilderList=[],this._currentStep=0},render:function(t,e,n){if(this.groupGL.removeAll(),t.getData().count()){var r=t.coordinateSystem;if(!r||!r.viewGL)throw new Error("Invalid coordinate system");r.viewGL.add(this.groupGL),this._camera=r.viewGL.camera;var i=this._pointsBuilderList[0];i||(i=this._pointsBuilderList[0]=new crt(!1,n)),this._pointsBuilderList.length=1,this.groupGL.add(i.rootNode),i.update(t,e,n),i.updateView(r.viewGL.camera)}},incrementalPrepareRender:function(t,e,n){var r=t.coordinateSystem;if(!r||!r.viewGL)throw new Error("Invalid coordinate system");r.viewGL.add(this.groupGL),this._camera=r.viewGL.camera,this.groupGL.removeAll(),this._currentStep=0},incrementalRender:function(t,e,n,r){if(!(t.end<=t.start)){var i=this._pointsBuilderList[this._currentStep];i||(i=new crt(!1,r),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),i.update(e,n,r,t.start,t.end),i.updateView(e.coordinateSystem.viewGL.camera),this._currentStep++}},updateCamera:function(){this._pointsBuilderList.forEach(function(t){t.updateView(this._camera)},this)},highlight:function(t,e,n,r){this._toggleStatus("highlight",t,e,n,r)},downplay:function(t,e,n,r){this._toggleStatus("downplay",t,e,n,r)},_toggleStatus:function(t,e,n,r,i){var o=e.getData(),a=M8.queryDataIndex(o,i),s="highlight"===t;null!=a?B(Nnt.normalizeToArray(a),function(t){for(var e=0;e<this._pointsBuilderList.length;e++){var n=this._pointsBuilderList[e];s?n.highlight(o,t):n.downplay(o,t)}},this):o.each(function(t){for(var e=0;e<this._pointsBuilderList.length;e++){var n=this._pointsBuilderList[e];s?n.highlight(o,t):n.downplay(o,t)}})},dispose:function(){this._pointsBuilderList.forEach(function(t){t.dispose()}),this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});vM(function(t){t.registerChartView(drt),t.registerSeriesModel(nrt),t.registerLayout({seriesType:"scatter3D",reset:function(t){var e=t.coordinateSystem;if(e){var n=e.dimensions;if(n.length<3)return void console.error("scatter3D needs 3D coordinateSystem");var r=n.map(function(e){return t.coordDimToDataDim(e)[0]}),i=[],o=[];return{progress:function(t,n){for(var a=new Float32Array(3*(t.end-t.start)),s=t.start;s<t.end;s++){var l=3*(s-t.start);i[0]=n.get(r[0],s),i[1]=n.get(r[1],s),i[2]=n.get(r[2],s),e.dataToPoint(i,o),a[l]=o[0],a[l+1]=o[1],a[l+2]=o[2]}n.setLayout("points",a)}}}}})});var prt=N9.vec3,frt=N9.vec2,grt=prt.normalize,mrt=prt.cross,vrt=prt.sub,yrt=prt.add,_rt=prt.create,xrt=_rt(),brt=_rt(),wrt=_rt(),Srt=_rt(),Trt=[],Mrt=[];function Crt(t,e){frt.copy(Trt,t[0]),frt.copy(Mrt,t[1]);var n=[],r=n[0]=_rt(),i=n[1]=_rt(),o=n[2]=_rt(),a=n[3]=_rt();e.dataToPoint(Trt,r),e.dataToPoint(Mrt,a),grt(xrt,r),vrt(brt,a,r),grt(brt,brt),mrt(wrt,brt,xrt),grt(wrt,wrt),mrt(brt,xrt,wrt),yrt(i,xrt,brt),grt(i,i),grt(xrt,a),vrt(brt,r,a),grt(brt,brt),mrt(wrt,brt,xrt),grt(wrt,wrt),mrt(brt,xrt,wrt),yrt(o,xrt,brt),grt(o,o),yrt(Srt,r,a),grt(Srt,Srt);var s=prt.dot(r,Srt),l=prt.dot(Srt,i),u=(Math.max(prt.len(r),prt.len(a))-s)/l*2;return prt.scaleAndAdd(i,r,i,u),prt.scaleAndAdd(o,a,o,u),n}function Irt(t,e){for(var n=new Float32Array(3*t.length),r=0,i=[],o=0;o<t.length;o++)e.dataToPoint(t[o],i),n[r++]=i[0],n[r++]=i[1],n[r++]=i[2];return n}function Art(t){var e=[];return t.each(function(n){var r=t.getItemModel(n),i=r.option instanceof Array?r.option:r.getShallow("coords",!0);if(!(i instanceof Array&&i.length>0&&i[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(i)+". Lines must have 2d coords array in data item.");e.push(i)}),{coordsList:e}}function Drt(t,e,n){var r=t.getData(),i=t.get("polyline"),o=Art(r);r.setLayout("lineType",i?"polyline":"cubicBezier"),r.each(function(t){var a=o.coordsList[t],s=i?Irt(a,e):function(t,e,n){var r=[],i=r[0]=prt.create(),o=r[1]=prt.create(),a=r[2]=prt.create(),s=r[3]=prt.create();e.dataToPoint(t[0],i),e.dataToPoint(t[1],s);var l=prt.dist(i,s);return prt.lerp(o,i,s,.3),prt.lerp(a,i,s,.3),prt.scaleAndAdd(o,o,n,Math.min(.1*l,10)),prt.scaleAndAdd(a,a,n,Math.min(.1*l,10)),r}(a,e,n);r.setItemLayout(t,s)})}function Lrt(t,e){t.eachSeriesByType("lines3D",function(t){var e=t.coordinateSystem;"globe"===e.type?function(t,e){var n=t.getData(),r=t.get("polyline");n.setLayout("lineType",r?"polyline":"cubicBezier");var i=Art(n);n.each(function(t){var o=i.coordsList[t],a=r?Irt:Crt;n.setItemLayout(t,a(o,e))})}(t,e):"geo3D"===e.type?Drt(t,e,[0,1,0]):"mapbox3D"!==e.type&&"maptalks3D"!==e.type||Drt(t,e,[0,0,1])})}var Prt=Ky.extend({type:"series.lines3D",dependencies:["globe"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",getInitialData:function(t,e){var n=new oS(["value"],this);return n.hasItemOption=!1,n.initData(t8(t.data),[],function(t,e,r,i){if(t instanceof Array)return NaN;n.hasItemOption=!0;var o=t.value;return null!=o?o instanceof Array?o[i]:o:void 0}),n},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}}),Ert=N9.vec3;function Ort(t){return t>0?1:-1}a9.Shader.import("@export ecgl.trail2.vertex\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute float dist;\nattribute float distAll;\nattribute float start;\n\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nuniform float speed : 0;\nuniform float trailLength: 0.3;\nuniform float time;\nuniform float period: 1000;\n\nuniform float spotSize: 1;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n\n#ifdef CONSTANT_SPEED\n float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;\n#else\n float t = mod((time + start) / period, 1. + trailLength) - trailLength;\n#endif\n\n float trailLen = distAll * trailLength;\n\n v_Percent = (dist - t * distAll) / trailLen;\n\n v_SpotPercent = spotSize / distAll;\n\n }\n@end\n\n\n@export ecgl.trail2.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform float spotIntensity: 5;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n if (v_Percent > 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end");var Nrt=a9.Mesh.extend(function(){var t=new a9.Material({shader:new a9.Shader(a9.Shader.source("ecgl.trail2.vertex"),a9.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),e=new B9({dynamic:!0});return e.createAttribute("dist","float",1),e.createAttribute("distAll","float",1),e.createAttribute("start","float",1),{geometry:e,material:t,culling:!1,$ignorePicking:!0}},{updateData:function(t,e,n){var r=t.hostModel,i=this.geometry,o=r.getModel("effect"),a=o.get("trailWidth")*e.getDevicePixelRatio(),s=o.get("trailLength"),l=r.get("effect.constantSpeed"),u=1e3*r.get("effect.period"),h=null!=l;this.getScene()||console.error("TrailMesh must been add to scene before updateData"),h?this.material.set("speed",l/1e3):this.material.set("period",u),this.material[h?"define":"undefine"]("vertex","CONSTANT_SPEED");var c=r.get("polyline");i.trailLength=s,this.material.set("trailLength",s),i.resetOffset(),["position","positionPrev","positionNext"].forEach(function(t){i.attributes[t].value=n.attributes[t].value});["dist","distAll","start","offset","color"].forEach(function(t){i.attributes[t].init(i.vertexCount)}),i.indices=n.indices;var d=[],p=o.get("trailColor"),f=o.get("trailOpacity"),g=null!=p,m=null!=f;this.updateWorldTransform();var v=this.worldTransform.x.len(),y=this.worldTransform.y.len(),_=this.worldTransform.z.len(),x=0,b=0;t.each(function(e){var r=t.getItemLayout(e),o=m?f:pet(t,e),s=det(t,e);null==o&&(o=1),(d=a9.parseColor(g?p:s,d))[3]*=o;for(var l=c?n.getPolylineVertexCount(r):n.getCubicCurveVertexCount(r[0],r[1],r[2],r[3]),w=0,S=[],T=[],M=x;M<x+l;M++)i.attributes.position.get(M,S),S[0]*=v,S[1]*=y,S[2]*=_,M>x&&(w+=Ert.dist(S,T)),i.attributes.dist.set(M,w),Ert.copy(T,S);b=Math.max(b,w);var C=Math.random()*(h?w:u);for(M=x;M<x+l;M++)i.attributes.distAll.set(M,w),i.attributes.start.set(M,C),i.attributes.offset.set(M,Ort(n.attributes.offset.get(M))*a/2),i.attributes.color.set(M,d);x+=l}),this.material.set("spotSize",.1*b*s),this.material.set("spotIntensity",o.get("spotIntensity")),i.dirty()},setAnimationTime:function(t){this.material.set("time",t)}});a9.Shader.import(n7);var Rrt=l_.extend({type:"lines3D",__ecgl__:!0,init:function(t,e){this.groupGL=new a9.Node,this._meshLinesMaterial=new a9.Material({shader:a9.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new a9.Mesh({geometry:new B9,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new Nrt},render:function(t,e,n){this.groupGL.add(this._linesMesh);var r=t.coordinateSystem,i=t.getData();if(r&&r.viewGL){r.viewGL.add(this.groupGL),this._updateLines(t,e,n);var o=r.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var a=this._trailMesh;if(a.stopAnimation(),t.get("effect.show")){this.groupGL.add(a),a.updateData(i,n,this._linesMesh.geometry),a.__time=a.__time||0;var s=36e5;this._curveEffectsAnimator=a.animate("",{loop:!0}).when(s,{__time:s}).during(function(){a.setAnimationTime(a.__time)}).start()}else this.groupGL.remove(a),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===t.get("blendMode")?a9.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var t=this._curveEffectsAnimator;t&&(t.isPaused()?t.resume():t.pause())},_updateLines:function(t,e,n){var r=t.getData(),i=t.coordinateSystem,o=this._linesMesh.geometry,a=t.get("polyline");o.expandLine=!0;var s=function(t){return null!=t.radius?t.radius:null!=t.size?Math.max(t.size[0],t.size[1],t.size[2]):100}(i);o.segmentScale=s/20;var l="lineStyle.width".split("."),u=n.getDevicePixelRatio();r.each(function(t){var e=r.getItemModel(t).get(l);null==e&&(e=1),r.setItemVisual(t,"lineWidth",e)}),o.useNativeLine=!1;var h=0,c=0;r.each(function(t){var e=r.getItemLayout(t);a?(h+=o.getPolylineVertexCount(e),c+=o.getPolylineTriangleCount(e)):(h+=o.getCubicCurveVertexCount(e[0],e[1],e[2],e[3]),c+=o.getCubicCurveTriangleCount(e[0],e[1],e[2],e[3]))}),o.setVertexCount(h),o.setTriangleCount(c),o.resetOffset();var d=[];r.each(function(t){var e=r.getItemLayout(t),n=det(r,t),i=pet(r,t),s=r.getItemVisual(t,"lineWidth")*u;null==i&&(i=1),(d=a9.parseColor(n,d))[3]*=i,a?o.addPolyline(e,d,s):o.addCubicCurve(e[0],e[1],e[2],e[3],d,s)}),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}});function krt(t,e){for(var n=[],r=0;r<e.length;r++)n.push(t.dataToPoint(e[r]));return n}vM(function(t){t.registerChartView(Rrt),t.registerSeriesModel(Prt),t.registerLayout(Lrt),t.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},function(){}),t.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},function(){}),t.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},function(){})});var zrt=Ky.extend({type:"series.polygons3D",getRegionModel:function(t){return this.getData().getItemModel(t)},getRegionPolygonCoords:function(t){var e=this.coordinateSystem,n=this.getData().getItemModel(t),r=n.option instanceof Array?n.option:n.getShallow("coords");n.get("multiPolygon")||(r=[r]);for(var i=[],o=0;o<r.length;o++){for(var a=[],s=1;s<r[o].length;s++)a.push(krt(e,r[o][s]));i.push({exterior:krt(e,r[o][0]),interiors:a})}return i},getInitialData:function(t){var e=new oS(["value"],this);return e.hasItemOption=!1,e.initData(t8(t.data),[],function(t,n,r,i){if(t instanceof Array)return NaN;e.hasItemOption=!0;var o=t.value;return null!=o?o instanceof Array?o[i]:o:void 0}),e},defaultOption:{show:!0,data:null,multiPolygon:!1,progressiveThreshold:1e3,progressive:1e3,zlevel:-10,label:{show:!1,distance:2,textStyle:{fontSize:20,color:"#000",backgroundColor:"rgba(255,255,255,0.7)",padding:3,borderRadius:4}},itemStyle:{color:"#fff",borderWidth:0,borderColor:"#333"},emphasis:{itemStyle:{color:"#639fc0"},label:{show:!0}}}});A(zrt.prototype,Dtt);var Brt=zrt,Vrt=l_.extend({type:"polygons3D",__ecgl__:!0,init:function(t,e){this.groupGL=new a9.Node,this._geo3DBuilderList=[],this._currentStep=0},render:function(t,e,n){this.groupGL.removeAll();var r=t.coordinateSystem;r&&r.viewGL&&r.viewGL.add(this.groupGL);var i=this._geo3DBuilderList[0];i||((i=new met(n)).extrudeY="mapbox3D"!==r.type&&"maptalks3D"!==r.type,this._geo3DBuilderList[0]=i),this._updateShaderDefines(r,i),i.update(t,e,n),this._geo3DBuilderList.length=1,this.groupGL.add(i.rootNode)},incrementalPrepareRender:function(t,e,n){this.groupGL.removeAll();var r=t.coordinateSystem;r&&r.viewGL&&r.viewGL.add(this.groupGL),this._currentStep=0},incrementalRender:function(t,e,n,r){var i=this._geo3DBuilderList[this._currentStep],o=e.coordinateSystem;i||((i=new met(r)).extrudeY="mapbox3D"!==o.type&&"maptalks3D"!==o.type,this._geo3DBuilderList[this._currentStep]=i),i.update(e,n,r,t.start,t.end),this.groupGL.add(i.rootNode),this._updateShaderDefines(o,i),this._currentStep++},_updateShaderDefines:function(t,e){var n=t.viewGL.isLinearSpace()?"define":"undefine";e.rootNode.traverse(function(e){e.material&&(e.material[n]("fragment","SRGB_DECODE"),"mapbox3D"!==t.type&&"maptalks3D"!==t.type||(e.material.define("fragment","NORMAL_UP_AXIS",2),e.material.define("fragment","NORMAL_FRONT_AXIS",1)))})},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll(),this._geo3DBuilderList.forEach(function(t){t.dispose()})}});vM(function(t){t.registerChartView(Vrt),t.registerSeriesModel(Brt)});var Frt=Ky.extend({type:"series.surface",dependencies:["globe","grid3D","geo3D"],visualStyleAccessPath:"itemStyle",formatTooltip:function(t){return Rnt(this,t)},getInitialData:function(t,e){var n=t.data;function r(t){return!(isNaN(t.min)||isNaN(t.max)||isNaN(t.step))}function i(t){var e=oa;return Math.max(e(t.min),e(t.max),e(t.step))+1}if(!n)if(t.parametric){var o=t.parametricEquation||{},a=o.u||{},s=o.v||{};["u","v"].forEach(function(t){r(o[t])||console.error("Invalid parametricEquation.%s",t)}),["x","y","z"].forEach(function(t){"function"==typeof o[t]||console.error("parametricEquation.%s needs to be function",t)});var l=Math.floor((a.max+a.step-a.min)/a.step),u=Math.floor((s.max+s.step-s.min)/s.step);n=new Float32Array(l*u*5);var h=i(a),c=i(s);for(S=0,T=0;T<u;T++)for(M=0;M<l;M++){var d=M*a.step+a.min,p=T*s.step+s.min,f=na(Math.min(d,a.max),h),g=na(Math.min(p,s.max),c);C=o.x(f,g),I=o.y(f,g),L=o.z(f,g);n[S++]=C,n[S++]=I,n[S++]=L,n[S++]=f,n[S++]=g}}else{var m=t.equation||{},v=m.x||{},y=m.y||{};if(["x","y"].forEach(function(t){r(m[t])||console.error("Invalid equation.%s",t)}),"function"!=typeof m.z)return void console.error("equation.z needs to be function");var _=Math.floor((v.max+v.step-v.min)/v.step),x=Math.floor((y.max+y.step-y.min)/y.step);n=new Float32Array(_*x*3);for(var b=i(v),w=i(y),S=0,T=0;T<x;T++)for(var M=0;M<_;M++){var C=M*v.step+v.min,I=T*y.step+y.min,A=na(Math.min(C,v.max),b),D=na(Math.min(I,y.max),w),L=m.z(A,D);n[S++]=A,n[S++]=D,n[S++]=L}}var P=["x","y","z"];return t.parametric&&P.push("u","v"),knt(this,P,n)},defaultOption:{coordinateSystem:"cartesian3D",zlevel:-10,grid3DIndex:0,shading:"lambert",parametric:!1,wireframe:{show:!0,lineStyle:{color:"rgba(0,0,0,0.5)",width:1}},equation:{x:{min:-1,max:1,step:.1},y:{min:-1,max:1,step:.1},z:null},parametricEquation:{u:{min:-1,max:1,step:.1},v:{min:-1,max:1,step:.1},x:null,y:null,z:null},dataShape:null,itemStyle:{},animationDurationUpdate:500}});A(Frt.prototype,Dtt);var Grt=Frt,Hrt=N9.vec3;function Urt(t){return isNaN(t[0])||isNaN(t[1])||isNaN(t[2])}var Wrt=l_.extend({type:"surface",__ecgl__:!0,init:function(t,e){this.groupGL=new a9.Node},render:function(t,e,n){var r=this._prevSurfaceMesh;this._prevSurfaceMesh=this._surfaceMesh,this._surfaceMesh=r,this._surfaceMesh||(this._surfaceMesh=this._createSurfaceMesh()),this.groupGL.remove(this._prevSurfaceMesh),this.groupGL.add(this._surfaceMesh);var i=t.coordinateSystem,o=t.get("shading"),a=t.getData(),s="ecgl."+o;if(this._surfaceMesh.material&&this._surfaceMesh.material.shader.name===s||(this._surfaceMesh.material=a9.createMaterial(s,["VERTEX_COLOR","DOUBLE_SIDED"])),a9.setMaterialFromModel(o,this._surfaceMesh.material,t,n),i&&i.viewGL){i.viewGL.add(this.groupGL);var l=i.viewGL.isLinearSpace()?"define":"undefine";this._surfaceMesh.material[l]("fragment","SRGB_DECODE")}var u=t.get("parametric"),h=t.get("dataShape");h||(h=this._getDataShape(a,u),t.get("data")&&console.warn("dataShape is not provided. Guess it is ",h));var c=t.getModel("wireframe"),d=c.get("lineStyle.width"),p=c.get("show")&&d>0;this._updateSurfaceMesh(this._surfaceMesh,t,h,p);var f=this._surfaceMesh.material;p?(f.define("WIREFRAME_QUAD"),f.set("wireframeLineWidth",d),f.set("wireframeLineColor",a9.parseColor(c.get("lineStyle.color")))):f.undefine("WIREFRAME_QUAD"),this._initHandler(t,n),this._updateAnimation(t)},_updateAnimation:function(t){a9.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,t)},_createSurfaceMesh:function(){var t=new a9.Mesh({geometry:new a9.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new a9.Material({shader:new a9.Shader(a9.Shader.source("ecgl.sm.depth.vertex"),a9.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return t.geometry.createAttribute("barycentric","float",4),t.geometry.createAttribute("prevPosition","float",3),t.geometry.createAttribute("prevNormal","float",3),Object.assign(t.geometry,cet),t},_initHandler:function(t,e){var n=t.getData(),r=this._surfaceMesh,i=t.coordinateSystem;r.seriesIndex=t.seriesIndex;var o=-1;r.off("mousemove"),r.off("mouseout"),r.on("mousemove",function(t){var a=function(t,e){for(var n=1/0,i=-1,o=[],a=0;a<t.length;a++){r.geometry.attributes.position.get(t[a],o);var s=Hrt.dist(e.array,o);s<n&&(n=s,i=t[a])}return i}(t.triangle,t.point);if(a>=0){var s=[];r.geometry.attributes.position.get(a,s);for(var l=i.pointToData(s),u=1/0,h=-1,c=[],d=0;d<n.count();d++){c[0]=n.get("x",d),c[1]=n.get("y",d),c[2]=n.get("z",d);var p=Hrt.squaredDistance(c,l);p<u&&(h=d,u=p)}h!==o&&e.dispatchAction({type:"grid3DShowAxisPointer",value:l}),o=h,r.dataIndex=h}else r.dataIndex=-1},this),r.on("mouseout",function(t){o=-1,r.dataIndex=-1,e.dispatchAction({type:"grid3DHideAxisPointer"})},this)},_updateSurfaceMesh:function(t,e,n,r){var i=t.geometry,o=e.getData(),a=o.getLayout("points"),s=0;o.each(function(t){o.hasValue(t)||s++});var l=s||r,u=i.attributes.position,h=i.attributes.normal,c=i.attributes.texcoord0,d=i.attributes.barycentric,p=i.attributes.color,f=n[0],g=n[1],m="color"!==e.get("shading");if(l){var v=(f-1)*(g-1)*4;u.init(v),r&&d.init(v)}else u.value=new Float32Array(a);p.init(i.vertexCount),c.init(i.vertexCount);var y=[0,3,1,1,3,2],_=[[1,1,0,0],[0,1,0,1],[1,0,0,1],[1,0,1,0]],x=i.indices=new(i.vertexCount>65535?Uint32Array:Uint16Array)((f-1)*(g-1)*6),b=function(t,e,n){n[1]=t*g+e,n[0]=t*g+e+1,n[3]=(t+1)*g+e+1,n[2]=(t+1)*g+e},w=!1;if(l){var S=[],T=[],M=0;m?h.init(i.vertexCount):h.value=null;for(var C=[[],[],[]],I=[],A=[],D=Hrt.create(),L=function(t,e,n){var r=3*e;return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n},P=new Float32Array(a.length),E=new Float32Array(a.length/3*4),O=0;O<o.count();O++)if(o.hasValue(O)){var N=a9.parseColor(det(o,O));null!=(X=pet(o,O))&&(N[3]*=X),N[3]<.99&&(w=!0);for(var R=0;R<4;R++)E[4*O+R]=N[R]}var k=[1e7,1e7,1e7];for(O=0;O<f-1;O++)for(var z=0;z<g-1;z++){var B=4*(O*(g-1)+z);b(O,z,S);var V=!1;for(R=0;R<4;R++)L(a,S[R],T),Urt(T)&&(V=!0);for(R=0;R<4;R++)V?u.set(B+R,k):(L(a,S[R],T),u.set(B+R,T)),r&&d.set(B+R,_[R]);for(R=0;R<6;R++)x[M++]=y[R]+B;if(m&&!V)for(R=0;R<2;R++){for(var F=3*R,G=0;G<3;G++){L(a,W=S[y[F]+G],C[G])}Hrt.sub(I,C[0],C[1]),Hrt.sub(A,C[1],C[2]),Hrt.cross(D,I,A);for(G=0;G<3;G++){var H=3*S[y[F]+G];P[H]=P[H]+D[0],P[H+1]=P[H+1]+D[1],P[H+2]=P[H+2]+D[2]}}}if(m)for(O=0;O<P.length/3;O++)L(P,O,D),Hrt.normalize(D,D),P[3*O]=D[0],P[3*O+1]=D[1],P[3*O+2]=D[2];N=[];var U=[];for(O=0;O<f-1;O++)for(z=0;z<g-1;z++){B=4*(O*(g-1)+z);b(O,z,S);for(R=0;R<4;R++){for(G=0;G<4;G++)N[G]=E[4*S[R]+G];p.set(B+R,N),m&&(L(P,S[R],D),h.set(B+R,D));var W=S[R];U[0]=W%g/(g-1),U[1]=Math.floor(W/g)/(f-1),c.set(B+R,U)}0}}else{for(U=[],O=0;O<o.count();O++){U[0]=O%g/(g-1),U[1]=Math.floor(O/g)/(f-1);var X;N=a9.parseColor(det(o,O));null!=(X=pet(o,O))&&(N[3]*=X),N[3]<.99&&(w=!0),p.set(O,N),c.set(O,U)}S=[];var j=0;for(O=0;O<f-1;O++)for(z=0;z<g-1;z++){b(O,z,S);for(R=0;R<6;R++)x[j++]=S[y[R]]}m?i.generateVertexNormals():h.value=null}t.material.get("normalMap")&&i.generateTangents(),i.updateBoundingBox(),i.dirty(),t.material.transparent=w,t.material.depthMask=!w},_getDataShape:function(t,e){for(var n=-1/0,r=0,i=0,o=0,a=!1,s=e?"u":"x",l=t.count(),u=0;u<l;u++){var h=t.get(s,u);h<n&&(o&&o!==i&&(a=!0),o=i,i=0,r++),n=h,i++}if(r&&1!==i||(a=!0),!a)return[r+1,i];for(var c=Math.floor(Math.sqrt(l));c>0;){if(Math.floor(l/c)===l/c)return[c,l/c];c--}return[c=Math.floor(Math.sqrt(l)),c]},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});function Xrt(t,e){for(var n=[],r=0;r<e.length;r++)n.push(t.dataToPoint(e[r]));return n}vM(function(t){t.registerChartView(Wrt),t.registerSeriesModel(Grt),t.registerLayout(function(t,e){t.eachSeriesByType("surface",function(t){var e=t.coordinateSystem;e&&"cartesian3D"===e.type||console.error("Surface chart only support cartesian3D coordinateSystem");var n=t.getData(),r=new Float32Array(3*n.count()),i=[NaN,NaN,NaN];if(e&&"cartesian3D"===e.type){var o=e.dimensions.map(function(e){return t.coordDimToDataDim(e)[0]});n.each(o,function(t,o,a,s){var l;l=n.hasValue(s)?e.dataToPoint([t,o,a]):i,r[3*s]=l[0],r[3*s+1]=l[1],r[3*s+2]=l[2]})}n.setLayout("points",r)})})});var jrt=Ky.extend({type:"series.map3D",layoutMode:"box",coordinateSystem:null,visualStyleAccessPath:"itemStyle",optionUpdated:function(t){t=t||{};var e=this.get("coordinateSystem");if(null!=e&&"geo3D"!==e){var n=[];["left","top","width","height","boxWidth","boxDepth","boxHeight","light","viewControl","postEffect","temporalSuperSampling","environment","groundPlane"].forEach(function(e){null!=t[e]&&n.push(e)}),n.length&&console.warn("Property %s in map3D series will be ignored if coordinate system is %s",n.join(", "),e),this.get("groundPlane.show")&&(this.option.groundPlane.show=!1),this._geo=null}},getInitialData:function(t){t.data=this.getFilledRegions(t.data,t.map);var e=aS(t.data,{coordDimensions:["value"]}),n=new oS(e,this);n.initData(t8(t.data));var r={};return n.each(function(t){var e=n.getName(t),i=n.getItemModel(t);r[e]=i}),this._regionModelMap=r,n},formatTooltip:function(t){return Rnt(this,t)},getRegionModel:function(t){var e=this.getData().getName(t);return this._regionModelMap[e]||new xf(null,this)},getRegionPolygonCoords:function(t){var e=this.coordinateSystem,n=this.getData().getName(t);if(e.transform)return(r=e.getRegion(n))?r.geometries:[];this._geo||(this._geo=Aet.createGeo3D(this));for(var r=this._geo.getRegion(n),i=[],o=0;o<r.geometries.length;o++){var a=r.geometries[o],s=[],l=Xrt(e,a.exterior);if(s&&s.length)for(var u=0;u<a.interiors.length;u++)s.push(Xrt(e,s[u]));i.push({interiors:s,exterior:l})}return i},getFormattedLabel:function(t,e){var n=Nnt.getFormattedLabel(this,t,e);return null==n&&(n=this.getData().getName(t)),n},defaultOption:{coordinateSystem:"geo3D",data:null}});A(jrt.prototype,Ltt),A(jrt.prototype,S9),A(jrt.prototype,T9),A(jrt.prototype,M9),A(jrt.prototype,Dtt);var Zrt=jrt,Yrt=l_.extend({type:"map3D",__ecgl__:!0,init:function(t,e){this._geo3DBuilder=new met(e),this.groupGL=new a9.Node},render:function(t,e,n){var r=t.coordinateSystem;if(r&&r.viewGL){if(this.groupGL.add(this._geo3DBuilder.rootNode),r.viewGL.add(this.groupGL),"geo3D"===r.type){this._sceneHelper||(this._sceneHelper=new G9,this._sceneHelper.initLight(this.groupGL)),this._sceneHelper.setScene(r.viewGL.scene),this._sceneHelper.updateLight(t),r.viewGL.setPostEffect(t.getModel("postEffect"),n),r.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling"));var i=this._control;i||(i=this._control=new E9({zr:n.getZr()}),this._control.init());var o=t.getModel("viewControl");i.setViewGL(r.viewGL),i.setFromViewControlModel(o,0),i.off("update"),i.on("update",function(){n.dispatchAction({type:"map3DChangeCamera",alpha:i.getAlpha(),beta:i.getBeta(),distance:i.getDistance(),from:this.uid,map3DId:t.id})}),this._geo3DBuilder.extrudeY=!0}else this._control&&(this._control.dispose(),this._control=null),this._sceneHelper&&(this._sceneHelper.dispose(),this._sceneHelper=null),t.getData().getLayout("geo3D"),this._geo3DBuilder.extrudeY=!1;this._geo3DBuilder.update(t,e,n,0,t.getData().count());var a=r.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse(function(t){t.material&&t.material[a]("fragment","SRGB_DECODE")})}},afterRender:function(t,e,n,r){var i=r.renderer,o=t.coordinateSystem;o&&"geo3D"===o.type&&(this._sceneHelper.updateAmbientCubemap(i,t,n),this._sceneHelper.updateSkybox(i,t,n))},dispose:function(){this.groupGL.removeAll(),this._control.dispose(),this._geo3DBuilder.dispose()}});vM(function(t){Let(t),t.registerChartView(Yrt),t.registerSeriesModel(Zrt),t.registerAction({type:"map3DChangeCamera",event:"map3dcamerachanged",update:"series:updateCamera"},function(t,e){e.eachComponent({mainType:"series",subType:"map3D",query:t},function(e){e.setView(t)})})});var qrt=Ky.extend({type:"series.scatterGL",dependencies:["grid","polar","geo","singleAxis"],visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,getInitialData:function(){return hM(this)},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,progressive:1e5,progressiveThreshold:1e5,large:!1,symbol:"circle",symbolSize:10,zoomScale:0,blendMode:"source-over",itemStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}});function Krt(t){this.viewGL=t}Krt.prototype.reset=function(t,e){this._updateCamera(e.getWidth(),e.getHeight(),e.getDevicePixelRatio()),this._viewTransform=[1,0,0,1,0,0],this.updateTransform(t,e)},Krt.prototype.updateTransform=function(t,e){var n=t.coordinateSystem;n.getRoamTransform&&(Pe(this._viewTransform,n.getRoamTransform()),this._setCameraTransform(this._viewTransform),e.getZr().refresh())},Krt.prototype.dataToPoint=function(t,e,n){n=t.dataToPoint(e,null,n);var r=this._viewTransform;r&&Xt(n,n,r)},Krt.prototype.removeTransformInPoint=function(t){return this._viewTransform&&Xt(t,t,this._viewTransform),t},Krt.prototype.getZoom=function(){if(this._viewTransform){var t=this._viewTransform;return 1/Math.max(Math.sqrt(t[0]*t[0]+t[1]*t[1]),Math.sqrt(t[2]*t[2]+t[3]*t[3]))}return 1},Krt.prototype._setCameraTransform=function(t){var e=this.viewGL.camera;e.position.set(t[4],t[5],0),e.scale.set(Math.sqrt(t[0]*t[0]+t[1]*t[1]),Math.sqrt(t[2]*t[2]+t[3]*t[3]),1)},Krt.prototype._updateCamera=function(t,e,n){this.viewGL.setViewport(0,0,t,e,n);var r=this.viewGL.camera;r.left=r.top=0,r.bottom=e,r.right=t,r.near=0,r.far=100};var Jrt=l_.extend({type:"scatterGL",__ecgl__:!0,init:function(t,e){this.groupGL=new a9.Node,this.viewGL=new ftt("orthographic"),this.viewGL.add(this.groupGL),this._pointsBuilderList=[],this._currentStep=0,this._sizeScale=1,this._glViewHelper=new Krt(this.viewGL)},render:function(t,e,n){if(this.groupGL.removeAll(),this._glViewHelper.reset(t,n),t.getData().count()){var r=this._pointsBuilderList[0];r||(r=this._pointsBuilderList[0]=new crt(!0,n)),this._pointsBuilderList.length=1,this.groupGL.add(r.rootNode),this._removeTransformInPoints(t.getData().getLayout("points")),r.update(t,e,n),this.viewGL.setPostEffect(t.getModel("postEffect"),n)}},incrementalPrepareRender:function(t,e,n){this.groupGL.removeAll(),this._glViewHelper.reset(t,n),this._currentStep=0,this.viewGL.setPostEffect(t.getModel("postEffect"),n)},incrementalRender:function(t,e,n,r){if(!(t.end<=t.start)){var i=this._pointsBuilderList[this._currentStep];i||(i=new crt(!0,r),this._pointsBuilderList[this._currentStep]=i),this.groupGL.add(i.rootNode),this._removeTransformInPoints(e.getData().getLayout("points")),i.setSizeScale(this._sizeScale),i.update(e,n,r,t.start,t.end),r.getZr().refresh(),this._currentStep++}},updateTransform:function(t,e,n){if(t.coordinateSystem.getRoamTransform){this._glViewHelper.updateTransform(t,n);var r=this._glViewHelper.getZoom(),i=Math.max((t.get("zoomScale")||0)*(r-1)+1,0);this._sizeScale=i,this._pointsBuilderList.forEach(function(t){t.setSizeScale(i)})}},_removeTransformInPoints:function(t){if(t)for(var e=[],n=0;n<t.length;n+=2)e[0]=t[n],e[1]=t[n+1],this._glViewHelper.removeTransformInPoint(e),t[n]=e[0],t[n+1]=e[1]},dispose:function(){this.groupGL.removeAll(),this._pointsBuilderList.forEach(function(t){t.dispose()})},remove:function(){this.groupGL.removeAll()}});vM(function(t){t.registerChartView(Jrt),t.registerSeriesModel(qrt),t.registerLayout({seriesType:"scatterGL",reset:function(t){var e,n=t.coordinateSystem,r=t.getData();if(n){var i=n.dimensions.map(function(t){return r.mapDimension(t)}).slice(0,2),o=[];1===i.length?e=function(t){for(var e=new Float32Array(2*(t.end-t.start)),o=t.start;o<t.end;o++){var a=2*(o-t.start),s=r.get(i[0],o),l=n.dataToPoint(s);e[a]=l[0],e[a+1]=l[1]}r.setLayout("points",e)}:2===i.length&&(e=function(t){for(var e=new Float32Array(2*(t.end-t.start)),a=t.start;a<t.end;a++){var s=2*(a-t.start),l=r.get(i[0],a),u=r.get(i[1],a);o[0]=l,o[1]=u,o=n.dataToPoint(o),e[s]=o[0],e[s+1]=o[1]}r.setLayout("points",e)})}return{progress:e}}})});var Qrt=Ky.extend({type:"series.graphGL",visualStyleAccessPath:"itemStyle",hasSymbolVisual:!0,init:function(t){Qrt.superApply(this,"init",arguments),this.legendDataProvider=function(){return this._categoriesData},this._updateCategoriesData()},mergeOption:function(t){Qrt.superApply(this,"mergeOption",arguments),this._updateCategoriesData()},getFormattedLabel:function(t,e,n,r){var i=Nnt.getFormattedLabel(this,t,e,n,r);if(null==i){var o=this.getData(),a=o.dimensions[o.dimensions.length-1];i=o.get(a,t)}return i},getInitialData:function(t,e){var n=t.edges||t.links||[],r=t.data||t.nodes||[],i=this;if(r&&n)return function(t,e,n,r,i){for(var o=new qz(r),a=0;a<t.length;a++)o.addNode(M8.firstNotNull(t[a].id,t[a].name,a),a);var s,l=[],u=[],h=0;for(a=0;a<e.length;a++){var c=e[a],d=c.source,p=c.target;o.addEdge(d,p,h)&&(u.push(c),l.push(M8.firstNotNull(c.id,d+" > "+p)),h++)}var f=aS(t,{coordDimensions:["value"]});(s=new oS(f,n)).initData(t);var g=new oS(["value"],n);return g.initData(u,l),i&&i(s,g),ck({mainData:s,struct:o,structAttr:"graph",datas:{node:s,edge:g},datasAttr:{node:"data",edge:"edgeData"}}),o.update(),o}(r,n,this,!0,function(t,n){t.wrapMethod("getItemModel",function(t){const e=i._categoriesModels[t.getShallow("category")];return e&&(e.parentModel=t.parentModel,t.parentModel=e),t});const r=e.getModel([]).getModel;function o(t,e){const n=r.call(this,t,e);return n.resolveParentPath=a,n}function a(t){if(t&&("label"===t[0]||"label"===t[1])){const e=t.slice();return"label"===t[0]?e[0]="edgeLabel":"label"===t[1]&&(e[1]="edgeLabel"),e}return t}n.wrapMethod("getItemModel",function(t){return t.resolveParentPath=a,t.getModel=o,t})}).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(t,e,n){if("edge"===n){var r=this.getData(),i=this.getDataParams(t,n),o=r.graph.getEdgeByIndex(t),a=r.getName(o.node1.dataIndex),s=r.getName(o.node2.dataIndex),l=[];return null!=a&&l.push(a),null!=s&&l.push(s),l=ue(l.join(" > ")),i.value&&(l+=" : "+ue(i.value)),l}return Qrt.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var t=(this.option.categories||[]).map(function(t){return null!=t.value?t:Object.assign({value:0},t)}),e=new oS(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t,!0)})},setView:function(t){null!=t.zoom&&(this.option.zoom=t.zoom),null!=t.offset&&(this.option.offset=t.offset)},setNodePosition:function(t){for(var e=0;e<t.length/2;e++){var n=t[2*e],r=t[2*e+1],i=this.getData().getRawDataItem(e);i.x=n,i.y=r}},isAnimationEnabled:function(){return Qrt.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:10,z:2,legendHoverLink:!0,layout:"forceAtlas2",forceAtlas2:{initLayout:null,GPU:!0,steps:1,maxSteps:1e3,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,edgeWeightInfluence:1,edgeWeight:[1,4],nodeWeight:[1,4],preventOverlap:!1,gravityCenter:null},focusNodeAdjacency:!0,focusNodeAdjacencyOn:"mouseover",left:"center",top:"center",symbol:"circle",symbolSize:5,roam:!1,center:null,zoom:1,label:{show:!1,formatter:"{b}",position:"right",distance:5,textStyle:{fontSize:14}},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}},animation:!1}}),$rt=Qrt,tit=N9.vec2,eit=[[0,0],[1,1]],nit=b4.extend(function(){return{segmentScale:4,dynamic:!0,useNativeLine:!0,attributes:{position:new b4.Attribute("position","float",2,"POSITION"),normal:new b4.Attribute("normal","float",2),offset:new b4.Attribute("offset","float",1),color:new b4.Attribute("color","float",4,"COLOR")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0,this._itemVertexOffsets=[]},setVertexCount:function(t){var e=this.attributes;this.vertexCount!==t&&(e.position.init(t),e.color.init(t),this.useNativeLine||(e.offset.init(t),e.normal.init(t)),t>65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(this.indices=0===t?null:this.vertexCount>65535?new Uint32Array(3*t):new Uint16Array(3*t))},_getCubicCurveApproxStep:function(t,e,n,r){return 1/(tit.dist(t,e)+tit.dist(n,e)+tit.dist(r,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(t,e,n,r){var i=this._getCubicCurveApproxStep(t,e,n,r),o=Math.ceil(1/i);return this.useNativeLine?2*o:2*o+2},getCubicCurveTriangleCount:function(t,e,n,r){var i=this._getCubicCurveApproxStep(t,e,n,r),o=Math.ceil(1/i);return this.useNativeLine?0:2*o},getLineVertexCount:function(){return this.getPolylineVertexCount(eit)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(eit)},getPolylineVertexCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/2;return this.useNativeLine?2*(e-1):2*(e-1)+2},getPolylineTriangleCount:function(t){var e;"number"==typeof t?e=t:e="number"!=typeof t[0]?t.length:t.length/2;return this.useNativeLine?0:2*(e-1)},addCubicCurve:function(t,e,n,r,i,o){null==o&&(o=1);var a=t[0],s=t[1],l=e[0],u=e[1],h=n[0],c=n[1],d=r[0],p=r[1],f=this._getCubicCurveApproxStep(t,e,n,r),g=f*f,m=g*f,v=3*f,y=3*g,_=6*g,x=6*m,b=a-2*l+h,w=s-2*u+c,S=3*(l-h)-a+d,T=3*(u-c)-s+p,M=a,C=s,I=(l-a)*v+b*y+S*m,A=(u-s)*v+w*y+T*m,D=b*_+S*x,L=w*_+T*x,P=S*x,E=T*x,O=0,N=0,R=Math.ceil(1/f),k=new Float32Array(3*(R+1)),z=(k=[],0);for(N=0;N<R+1;N++)k[z++]=M,k[z++]=C,M+=I,C+=A,I+=D,A+=L,D+=P,L+=E,(O+=f)>1&&(M=I>0?Math.min(M,d):Math.max(M,d),C=A>0?Math.min(C,p):Math.max(C,p));this.addPolyline(k,i,o)},addLine:function(t,e,n,r){this.addPolyline([t,e],n,r)},addPolyline:function(){var t=tit.create(),e=tit.create(),n=tit.create(),r=tit.create(),i=[],o=[],a=[];return function(s,l,u,h,c){if(s.length){var d="number"!=typeof s[0];if(null==c&&(c=d?s.length:s.length/2),!(c<2)){null==h&&(h=0),null==u&&(u=1),this._itemVertexOffsets.push(this._vertexOffset);for(var p,f=d?"number"!=typeof l[0]:l.length/4===c,g=this.attributes.position,m=this.attributes.color,v=this.attributes.offset,y=this.attributes.normal,_=this.indices,x=this._vertexOffset,b=0;b<c;b++){if(d)i=s[b+h],p=f?l[b+h]:l;else{var w=2*b+h;if((i=i||[])[0]=s[w],i[1]=s[w+1],f){var S=4*b+h;(p=p||[])[0]=l[S],p[1]=l[S+1],p[2]=l[S+2],p[3]=l[S+3]}else p=l}if(this.useNativeLine)b>1&&(g.copy(x,x-1),m.copy(x,x-1),x++);else{var T;if(b<c-1){if(d)tit.copy(o,s[b+1]);else{w=2*(b+1)+h;(o=o||[])[0]=s[w],o[1]=s[w+1]}if(b>0){tit.sub(t,i,a),tit.sub(e,o,i),tit.normalize(t,t),tit.normalize(e,e),tit.add(r,t,e),tit.normalize(r,r);var M=u/2*Math.min(1/tit.dot(t,r),2);n[0]=-r[1],n[1]=r[0],T=M}else tit.sub(t,o,i),tit.normalize(t,t),n[0]=-t[1],n[1]=t[0],T=u/2}else tit.sub(t,i,a),tit.normalize(t,t),n[0]=-t[1],n[1]=t[0],T=u/2;y.set(x,n),y.set(x+1,n),v.set(x,T),v.set(x+1,-T),tit.copy(a,i),g.set(x,i),g.set(x+1,i),m.set(x,p),m.set(x+1,p),x+=2}if(this.useNativeLine)m.set(x,p),g.set(x,i),x++;else if(b>0){var C=3*this._faceOffset;(_=this.indices)[C]=x-4,_[C+1]=x-3,_[C+2]=x-2,_[C+3]=x-3,_[C+4]=x-1,_[C+5]=x-2,this._faceOffset+=2}}this._vertexOffset=x}}}}(),setItemColor:function(t,e){for(var n=this._itemVertexOffsets[t],r=t<this._itemVertexOffsets.length-1?this._itemVertexOffsets[t+1]:this._vertexOffset,i=n;i<r;i++)this.attributes.color.set(i,e);this.dirty("color")}});E(nit.prototype,O9);var rit=nit;a9.Shader.import("@export ecgl.forceAtlas2.updateNodeRepulsion\n\n#define NODE_COUNT 0\n\nuniform sampler2D positionTex;\n\nuniform vec2 textureSize;\nuniform float gravity;\nuniform float scaling;\nuniform vec2 gravityCenter;\n\nuniform bool strongGravityMode;\nuniform bool preventOverlap;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, v_Texcoord);\n\n vec2 force = vec2(0.0);\n for (int i = 0; i < NODE_COUNT; i++) {\n vec2 uv = vec2(\n mod(float(i), textureSize.x) / (textureSize.x - 1.0),\n floor(float(i) / textureSize.x) / (textureSize.y - 1.0)\n );\n vec4 n1 = texture2D(positionTex, uv);\n\n vec2 dir = n0.xy - n1.xy;\n float d2 = dot(dir, dir);\n\n if (d2 > 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end");var iit={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function oit(t){var e={type:a9.Texture.FLOAT,minFilter:a9.Texture.NEAREST,magFilter:a9.Texture.NEAREST};this._positionSourceTex=new a9.Texture2D(e),this._positionSourceTex.flipY=!1,this._positionTex=new a9.Texture2D(e),this._positionPrevTex=new a9.Texture2D(e),this._forceTex=new a9.Texture2D(e),this._forcePrevTex=new a9.Texture2D(e),this._weightedSumTex=new a9.Texture2D(e),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new a9.Texture2D(e),this._globalSpeedPrevTex=new a9.Texture2D(e),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new c8({fragment:a9.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new c8({fragment:a9.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new c8({fragment:a9.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new c8({fragment:a9.Shader.source("clay.compositor.output")});var n=function(t){t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE)};this._edgeForceMesh=new a9.Mesh({geometry:new a9.Geometry({attributes:{node1:new a9.Geometry.Attribute("node1","float",2),node2:new a9.Geometry.Attribute("node2","float",2),weight:new a9.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new a9.Material({transparent:!0,shader:a9.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:n,depthMask:!1,depthText:!1}),mode:a9.Mesh.POINTS}),this._weightedSumMesh=new a9.Mesh({geometry:new a9.Geometry({attributes:{node:new a9.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new a9.Material({transparent:!0,shader:a9.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:n,depthMask:!1,depthText:!1}),mode:a9.Mesh.POINTS}),this._framebuffer=new I6({depthBuffer:!1}),this._dummyCamera=new a9.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}oit.prototype.updateOption=function(t){for(var e in iit)this[e]=iit[e];var n=this._nodes.length;if(this.jitterTolerence=n>5e4?10:n>5e3?1:.1,this.scaling=n>100?2:10,t)for(var e in iit)null!=t[e]&&(this[e]=t[e]);if(this.repulsionByDegree)for(var r=this._positionSourceTex.pixels,i=0;i<this._nodes.length;i++)r[4*i+2]=(this._nodes[i].degree||0)+1},oit.prototype._updateGravityCenter=function(t){var e=this._nodes,n=this._edges;if(this.gravityCenter)this._gravityCenter=this.gravityCenter;else{for(var r=[1/0,1/0],i=[-1/0,-1/0],o=0;o<e.length;o++)r[0]=Math.min(e[o].x,r[0]),r[1]=Math.min(e[o].y,r[1]),i[0]=Math.max(e[o].x,i[0]),i[1]=Math.max(e[o].y,i[1]);this._gravityCenter=[.5*(r[0]+i[0]),.5*(r[1]+i[1])]}for(o=0;o<n.length;o++){var a=n[o].node1,s=n[o].node2;e[a].degree=(e[a].degree||0)+1,e[s].degree=(e[s].degree||0)+1}},oit.prototype.initData=function(t,e){this._nodes=t,this._edges=e,this._updateGravityCenter();var n=Math.ceil(Math.sqrt(t.length)),r=n,i=new Float32Array(n*r*4);this._resize(n,r);for(var o=0,a=0;a<t.length;a++){var s=t[a];i[o++]=s.x||0,i[o++]=s.y||0,i[o++]=s.mass||1,i[o++]=s.size||1}this._positionSourceTex.pixels=i;var l=this._edgeForceMesh.geometry,u=e.length;l.attributes.node1.init(2*u),l.attributes.node2.init(2*u),l.attributes.weight.init(2*u);var h=[];for(a=0;a<e.length;a++){var c=l.attributes,d=e[a].weight;null==d&&(d=1),c.node1.set(a,this.getNodeUV(e[a].node1,h)),c.node2.set(a,this.getNodeUV(e[a].node2,h)),c.weight.set(a,d),c.node1.set(a+u,this.getNodeUV(e[a].node2,h)),c.node2.set(a+u,this.getNodeUV(e[a].node1,h)),c.weight.set(a+u,d)}var p=this._weightedSumMesh.geometry;p.attributes.node.init(t.length);for(a=0;a<t.length;a++)p.attributes.node.set(a,this.getNodeUV(a,h));l.dirty(),p.dirty(),this._nodeRepulsionPass.material.define("fragment","NODE_COUNT",t.length),this._nodeRepulsionPass.material.setUniform("textureSize",[n,r]),this._inited=!1,this._frame=0},oit.prototype.getNodes=function(){return this._nodes},oit.prototype.getEdges=function(){return this._edges},oit.prototype.step=function(t){this._inited||(this._initFromSource(t),this._inited=!0),this._frame++,this._framebuffer.attach(this._forceTex),this._framebuffer.bind(t);var e=this._nodeRepulsionPass;e.setUniform("strongGravityMode",this.strongGravityMode),e.setUniform("gravity",this.gravity),e.setUniform("gravityCenter",this._gravityCenter),e.setUniform("scaling",this.scaling),e.setUniform("preventOverlap",this.preventOverlap),e.setUniform("positionTex",this._positionPrevTex),e.render(t);var n=this._edgeForceMesh;n.material.set("linLogMode",this.linLogMode),n.material.set("edgeWeightInfluence",this.edgeWeightInfluence),n.material.set("preventOverlap",this.preventOverlap),n.material.set("positionTex",this._positionPrevTex),t.gl.enable(t.gl.BLEND),t.renderPass([n],this._dummyCamera),this._framebuffer.attach(this._weightedSumTex),t.gl.clearColor(0,0,0,0),t.gl.clear(t.gl.COLOR_BUFFER_BIT),t.gl.enable(t.gl.BLEND);var r=this._weightedSumMesh;r.material.set("positionTex",this._positionPrevTex),r.material.set("forceTex",this._forceTex),r.material.set("forcePrevTex",this._forcePrevTex),t.renderPass([r],this._dummyCamera),this._framebuffer.attach(this._globalSpeedTex);var i=this._globalSpeedPass;i.setUniform("globalSpeedPrevTex",this._globalSpeedPrevTex),i.setUniform("weightedSumTex",this._weightedSumTex),i.setUniform("jitterTolerence",this.jitterTolerence),t.gl.disable(t.gl.BLEND),i.render(t);var o=this._positionPass;this._framebuffer.attach(this._positionTex),o.setUniform("globalSpeedTex",this._globalSpeedTex),o.setUniform("positionTex",this._positionPrevTex),o.setUniform("forceTex",this._forceTex),o.setUniform("forcePrevTex",this._forcePrevTex),o.render(t),this._framebuffer.unbind(t),this._swapTexture()},oit.prototype.update=function(t,e,n){null==e&&(e=1),e=Math.max(e,1);for(var r=0;r<e;r++)this.step(t);n&&n()},oit.prototype.getNodePositionTexture=function(){return this._inited?this._positionPrevTex:this._positionSourceTex},oit.prototype.getNodeUV=function(t,e){e=e||[];var n=this._positionTex.width,r=this._positionTex.height;return e[0]=t%n/(n-1),e[1]=Math.floor(t/n)/(r-1)||0,e},oit.prototype.getNodePosition=function(t,e){var n=this._positionArr,r=this._positionTex.width,i=this._positionTex.height,o=r*i;n&&n.length===4*o||(n=this._positionArr=new Float32Array(4*o)),this._framebuffer.bind(t),this._framebuffer.attach(this._positionPrevTex),t.gl.readPixels(0,0,r,i,t.gl.RGBA,t.gl.FLOAT,n),this._framebuffer.unbind(t),e||(e=new Float32Array(2*this._nodes.length));for(var a=0;a<this._nodes.length;a++)e[2*a]=n[4*a],e[2*a+1]=n[4*a+1];return e},oit.prototype.getTextureData=function(t,e){var n=this["_"+e+"Tex"],r=n.width,i=n.height;this._framebuffer.bind(t),this._framebuffer.attach(n);var o=new Float32Array(r*i*4);return t.gl.readPixels(0,0,r,i,t.gl.RGBA,t.gl.FLOAT,o),this._framebuffer.unbind(t),o},oit.prototype.getTextureSize=function(){return{width:this._positionTex.width,height:this._positionTex.height}},oit.prototype.isFinished=function(t){return this._frame>t},oit.prototype._swapTexture=function(){var t=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=t;t=this._forcePrevTex;this._forcePrevTex=this._forceTex,this._forceTex=t;t=this._globalSpeedPrevTex;this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=t},oit.prototype._initFromSource=function(t){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(t),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(t),t.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),t.gl.clear(t.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),t.gl.clear(t.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(t)},oit.prototype._resize=function(t,e){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach(function(n){this[n].width=t,this[n].height=e,this[n].dirty()},this)},oit.prototype.dispose=function(t){this._framebuffer.dispose(t),this._copyPass.dispose(t),this._nodeRepulsionPass.dispose(t),this._positionPass.dispose(t),this._globalSpeedPass.dispose(t),this._edgeForceMesh.geometry.dispose(t),this._weightedSumMesh.geometry.dispose(t),this._positionSourceTex.dispose(t),this._positionTex.dispose(t),this._positionPrevTex.dispose(t),this._forceTex.dispose(t),this._forcePrevTex.dispose(t),this._weightedSumTex.dispose(t),this._globalSpeedTex.dispose(t),this._globalSpeedPrevTex.dispose(t)};var ait=function(){var t=function(){return new Float32Array(2)},e=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)},n=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)},r=function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},i=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},o=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},a=function(t,e){return t[0]=e[0],t[1]=e[1],t},s=function(t,e,n){return t[0]=e,t[1]=n,t};function l(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new Float32Array(4),this.size=0}var u=l.prototype;function h(){this.position=new Float32Array(2),this.force=t(),this.forcePrev=t(),this.mass=1,this.inDegree=0,this.outDegree=0}function c(t,e){this.source=t,this.target=e,this.weight=1}function d(){this.autoSettings=!0,this.barnesHutOptimize=!0,this.barnesHutTheta=1.5,this.repulsionByDegree=!0,this.linLogMode=!1,this.strongGravityMode=!1,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.jitterTolerence=.1,this.preventOverlap=!1,this.dissuadeHubs=!1,this.rootRegion=new l,this.rootRegion.centerOfMass=t(),this.nodes=[],this.edges=[],this.bbox=new Float32Array(4),this.gravityCenter=null,this._massArr=null,this._swingingArr=null,this._sizeArr=null,this._globalSpeed=0}u.beforeUpdate=function(){for(var t=0;t<this.nSubRegions;t++)this.subRegions[t].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},u.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var t=0;t<this.nSubRegions;t++)this.subRegions[t].afterUpdate()},u.addNode=function(t){if(0===this.nSubRegions){if(null==this.node)return void(this.node=t);this._addNodeToSubRegion(this.node),this.node=null}this._addNodeToSubRegion(t),this._updateCenterOfMass(t)},u.findSubRegion=function(t,e){for(var n=0;n<this.nSubRegions;n++){var r=this.subRegions[n];if(r.contain(t,e))return r}},u.contain=function(t,e){return this.bbox[0]<=t&&this.bbox[2]>=t&&this.bbox[1]<=e&&this.bbox[3]>=e},u.setBBox=function(t,e,n,r){this.bbox[0]=t,this.bbox[1]=e,this.bbox[2]=n,this.bbox[3]=r,this.size=(n-t+r-e)/2},u._newSubRegion=function(){var t=this.subRegions[this.nSubRegions];return t||(t=new l,this.subRegions[this.nSubRegions]=t),this.nSubRegions++,t},u._addNodeToSubRegion=function(t){var e=this.findSubRegion(t.position[0],t.position[1]),n=this.bbox;if(!e){var r=(n[0]+n[2])/2,i=(n[1]+n[3])/2,o=(n[2]-n[0])/2,a=(n[3]-n[1])/2,s=t.position[0]>=r?1:0,l=t.position[1]>=i?1:0;(e=this._newSubRegion()).setBBox(s*o+n[0],l*a+n[1],(s+1)*o+n[0],(l+1)*a+n[1])}e.addNode(t)},u._updateCenterOfMass=function(t){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var e=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;e+=t.position[0]*t.mass,n+=t.position[1]*t.mass,this.mass+=t.mass,this.centerOfMass[0]=e/this.mass,this.centerOfMass[1]=n/this.mass};var p=d.prototype;p.initNodes=function(t,e,n){var r=e.length;this.nodes.length=0;for(var i=void 0!==n,o=0;o<r;o++){var a=new h;a.position[0]=t[2*o],a.position[1]=t[2*o+1],a.mass=e[o],i&&(a.size=n[o]),this.nodes.push(a)}this._massArr=e,this._swingingArr=new Float32Array(r),i&&(this._sizeArr=n)},p.initEdges=function(t,e){var n=t.length/2;this.edges.length=0;for(var r=0;r<n;r++){var i=t[2*r],o=t[2*r+1],a=this.nodes[i],s=this.nodes[o];if(!a||!s)return void console.error("Node not exists, try initNodes before initEdges");a.outDegree++,s.inDegree++;var l=new c(a,s);e&&(l.weight=e[r]),this.edges.push(l)}},p.updateSettings=function(){if(this.repulsionByDegree)for(var t=0;t<this.nodes.length;t++){(e=this.nodes[t]).mass=e.inDegree+e.outDegree+1}else for(t=0;t<this.nodes.length;t++){var e;(e=this.nodes[t]).mass=this._massArr[t]}},p.update=function(){var o=this.nodes.length;if(this.updateSettings(),this.updateBBox(),this.barnesHutOptimize){this.rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this.rootRegion.beforeUpdate();for(var l=0;l<o;l++)this.rootRegion.addNode(this.nodes[l]);this.rootRegion.afterUpdate()}for(l=0;l<o;l++){var u=this.nodes[l];a(u.forcePrev,u.force),s(u.force,0,0)}for(l=0;l<o;l++){var h=this.nodes[l];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this.rootRegion,h);else for(var c=l+1;c<o;c++){var d=this.nodes[c];this.applyNodeToNodeRepulsion(h,d,!1)}this.gravity>0&&(this.strongGravityMode?this.applyNodeStrongGravity(h):this.applyNodeGravity(h))}for(l=0;l<this.edges.length;l++)this.applyEdgeAttraction(this.edges[l]);var p=0,f=0,g=t();for(l=0;l<o;l++){u=this.nodes[l];p+=(v=e(u.force,u.forcePrev))*u.mass,i(g,u.force,u.forcePrev),f+=.5*n(g)*u.mass,this._swingingArr[l]=v}var m=this.jitterTolerence*this.jitterTolerence*f/p;this._globalSpeed>0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m;for(l=0;l<o;l++){u=this.nodes[l];var v=this._swingingArr[l],y=.1*m/(1+m*Math.sqrt(v)),_=n(u.force);_>0&&(y=Math.min(_*y,10)/_,r(u.position,u.position,u.force,y))}},p.applyRegionToNodeRepulsion=function(){var e=t();return function(t,n){if(t.node)this.applyNodeToNodeRepulsion(t.node,n,!0);else{o(e,n.position,t.centerOfMass);var i=e[0]*e[0]+e[1]*e[1];if(i>this.barnesHutTheta*t.size*t.size){var a=this.scaling*n.mass*t.mass/i;r(n.force,n.force,e,a)}else for(var s=0;s<t.nSubRegions;s++)this.applyRegionToNodeRepulsion(t.subRegions[s],n)}}}(),p.applyNodeToNodeRepulsion=function(){var e=t();return function(t,n,i){if(t!=n){o(e,t.position,n.position);var a=e[0]*e[0]+e[1]*e[1];if(0!==a){var s;if(this.preventOverlap){var l=Math.sqrt(a);if((l=l-t.size-n.size)>0)s=this.scaling*t.mass*n.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*t.mass*n.mass}}else s=this.scaling*t.mass*n.mass/a;r(t.force,t.force,e,s),r(n.force,n.force,e,-s)}}}}(),p.applyEdgeAttraction=function(){var e=t();return function(t){var i=t.source,a=t.target;o(e,i.position,a.position);var s,l,u=n(e);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?t.weight:Math.pow(t.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-i.size-a.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,r(i.force,i.force,e,l),r(a.force,a.force,e,-l))}}(),p.applyNodeGravity=function(){var e=t();return function(t){o(e,this.gravityCenter,t.position);var i=n(e);r(t.force,t.force,e,this.gravity*t.mass/(i+1))}}(),p.applyNodeStrongGravity=function(){var e=t();return function(t){o(e,this.gravityCenter,t.position),r(t.force,t.force,e,this.gravity*t.mass)}}(),p.updateBBox=function(){for(var t=1/0,e=1/0,n=-1/0,r=-1/0,i=0;i<this.nodes.length;i++){var o=this.nodes[i].position;t=Math.min(t,o[0]),e=Math.min(e,o[1]),n=Math.max(n,o[0]),r=Math.max(r,o[1])}this.bbox[0]=t,this.bbox[1]=e,this.bbox[2]=n,this.bbox[3]=r},p.getGlobalSpeed=function(){return this._globalSpeed};var f=null;self.onmessage=function(t){switch(t.data.cmd){case"init":(f=new d).initNodes(t.data.nodesPosition,t.data.nodesMass,t.data.nodesSize),f.initEdges(t.data.edges,t.data.edgesWeight);break;case"updateConfig":if(f)for(var e in t.data.config)f[e]=t.data.config[e];break;case"update":var n=t.data.steps;if(f){for(var r=0;r<n;r++)f.update();var i=f.nodes.length,o=new Float32Array(2*i);for(r=0;r<i;r++){var a=f.nodes[r];o[2*r]=a.position[0],o[2*r+1]=a.position[1]}self.postMessage({buffer:o.buffer,globalSpeed:f.getGlobalSpeed()},[o.buffer])}else{var s=new Float32Array;self.postMessage({buffer:s.buffer,globalSpeed:f.getGlobalSpeed()},[s.buffer])}}}}.toString();ait=ait.slice(ait.indexOf("{")+1,ait.lastIndexOf("}"));var sit={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null},lit=function(t){for(var e in sit)this[e]=sit[e];if(t)for(var e in t)this[e]=t[e];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new l4({type:n4.FLOAT,flipY:!1,minFilter:n4.NEAREST,magFilter:n4.NEAREST})};lit.prototype.initData=function(t,e){var n=new Blob([ait]),r=window.URL.createObjectURL(n);this._worker=new Worker(r),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=t,this._edges=e,this._frame=0;for(var i=t.length,o=e.length,a=new Float32Array(2*i),s=new Float32Array(i),l=new Float32Array(i),u=new Float32Array(2*o),h=new Float32Array(o),c=0;c<t.length;c++){var d=t[c];a[2*c]=d.x,a[2*c+1]=d.y,s[c]=null==d.mass?1:d.mass,l[c]=null==d.size?1:d.size}for(c=0;c<e.length;c++){var p=e[c],f=p.node1,g=p.node2;u[2*c]=f,u[2*c+1]=g,h[c]=null==p.weight?1:p.weight}var m=Math.ceil(Math.sqrt(t.length)),v=m,y=new Float32Array(m*v*4),_=this._positionTex;_.width=m,_.height=v,_.pixels=y,this._worker.postMessage({cmd:"init",nodesPosition:a,nodesMass:s,nodesSize:l,edges:u,edgesWeight:h}),this._globalSpeed=1/0},lit.prototype.updateOption=function(t){var e={};for(var n in sit)e[n]=sit[n];var r=this._nodes,i=this._edges,o=r.length;if(e.jitterTolerence=o>5e4?10:o>5e3?1:.1,e.scaling=o>100?2:10,e.barnesHutOptimize=o>1e3,t)for(var n in sit)null!=t[n]&&(e[n]=t[n]);if(!e.gravityCenter){for(var a=[1/0,1/0],s=[-1/0,-1/0],l=0;l<r.length;l++)a[0]=Math.min(r[l].x,a[0]),a[1]=Math.min(r[l].y,a[1]),s[0]=Math.max(r[l].x,s[0]),s[1]=Math.max(r[l].y,s[1]);e.gravityCenter=[.5*(a[0]+s[0]),.5*(a[1]+s[1])]}for(l=0;l<i.length;l++){var u=i[l].node1,h=i[l].node2;r[u].degree=(r[u].degree||0)+1,r[h].degree=(r[h].degree||0)+1}this._worker&&this._worker.postMessage({cmd:"updateConfig",config:e})},lit.prototype.update=function(t,e,n){null==e&&(e=1),e=Math.max(e,1),this._frame+=e,this._onupdate=n,this._worker&&this._worker.postMessage({cmd:"update",steps:Math.round(e)})},lit.prototype._$onupdate=function(t){if(!this._disposed){var e=new Float32Array(t.data.buffer);this._globalSpeed=t.data.globalSpeed,this._positionArr=e,this._updateTexture(e),this._onupdate&&this._onupdate()}},lit.prototype.getNodePositionTexture=function(){return this._positionTex},lit.prototype.getNodeUV=function(t,e){e=e||[];var n=this._positionTex.width,r=this._positionTex.height;return e[0]=t%n/(n-1),e[1]=Math.floor(t/n)/(r-1),e},lit.prototype.getNodes=function(){return this._nodes},lit.prototype.getEdges=function(){return this._edges},lit.prototype.isFinished=function(t){return this._frame>t},lit.prototype.getNodePosition=function(t,e){if(e||(e=new Float32Array(2*this._nodes.length)),this._positionArr)for(var n=0;n<this._positionArr.length;n++)e[n]=this._positionArr[n];return e},lit.prototype._updateTexture=function(t){for(var e=this._positionTex.pixels,n=0,r=0;r<t.length;)e[n++]=t[r++],e[n++]=t[r++],e[n++]=1,e[n++]=1;this._positionTex.dirty()},lit.prototype.dispose=function(t){this._disposed=!0,this._worker=null};var uit=lit,hit=P1.extend(function(){return{zr:null,viewGL:null,minZoom:.2,maxZoom:5,_needsUpdate:!1,_dx:0,_dy:0,_zoom:1}},function(){this._mouseDownHandler=this._mouseDownHandler.bind(this),this._mouseWheelHandler=this._mouseWheelHandler.bind(this),this._mouseMoveHandler=this._mouseMoveHandler.bind(this),this._mouseUpHandler=this._mouseUpHandler.bind(this),this._update=this._update.bind(this)},{init:function(){var t=this.zr;t.on("mousedown",this._mouseDownHandler),t.on("mousewheel",this._mouseWheelHandler),t.on("globalout",this._mouseUpHandler),t.animation.on("frame",this._update)},setTarget:function(t){this._target=t},setZoom:function(t){this._zoom=Math.max(Math.min(t,this.maxZoom),this.minZoom),this._needsUpdate=!0},setOffset:function(t){this._dx=t[0],this._dy=t[1],this._needsUpdate=!0},getZoom:function(){return this._zoom},getOffset:function(){return[this._dx,this._dy]},_update:function(){if(this._target&&this._needsUpdate){var t=this._target,e=this._zoom;t.position.x=this._dx,t.position.y=this._dy,t.scale.set(e,e,e),this.zr.refresh(),this._needsUpdate=!1,this.trigger("update")}},_mouseDownHandler:function(t){if(!t.target){var e=t.offsetX,n=t.offsetY;if(!this.viewGL||this.viewGL.containPoint(e,n)){this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler);var r=this._convertPos(e,n);this._x=r.x,this._y=r.y}}},_convertPos:function(t,e){var n=this.viewGL.camera,r=this.viewGL.viewport;return{x:(t-r.x)/r.width*(n.right-n.left)+n.left,y:(e-r.y)/r.height*(n.bottom-n.top)+n.top}},_mouseMoveHandler:function(t){var e=this._convertPos(t.offsetX,t.offsetY);this._dx+=e.x-this._x,this._dy+=e.y-this._y,this._x=e.x,this._y=e.y,this._needsUpdate=!0},_mouseUpHandler:function(t){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_mouseWheelHandler:function(t){var e=(t=t.event).wheelDelta||-t.detail;if(0!==e){var n=t.offsetX,r=t.offsetY;if(!this.viewGL||this.viewGL.containPoint(n,r)){var i=e>0?1.1:.9,o=Math.max(Math.min(this._zoom*i,this.maxZoom),this.minZoom);i=o/this._zoom;var a=this._convertPos(n,r),s=(a.x-this._dx)*(i-1),l=(a.y-this._dy)*(i-1);this._dx-=s,this._dy-=l,this._zoom=o,this._needsUpdate=!0}}},dispose:function(){var t=this.zr;t.off("mousedown",this._mouseDownHandler),t.off("mousemove",this._mouseMoveHandler),t.off("mouseup",this._mouseUpHandler),t.off("mousewheel",this._mouseWheelHandler),t.off("globalout",this._mouseUpHandler),t.animation.off("frame",this._update)}}),cit=hit,dit=N9.vec2;a9.Shader.import("@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end");var pit=1,fit=l_.extend({type:"graphGL",__ecgl__:!0,init:function(t,e){this.groupGL=new a9.Node,this.viewGL=new ftt("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new crt(!0,e),this._forceEdgesMesh=new a9.Mesh({material:new a9.Material({shader:a9.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new a9.Geometry({attributes:{node:new a9.Geometry.Attribute("node","float",2),color:new a9.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:a9.Mesh.LINES}),this._edgesMesh=new a9.Mesh({material:new a9.Material({shader:a9.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new rit({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new cit({zr:e.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(t,e,n){this.groupGL.add(this._pointsBuilder.rootNode),this._model=t,this._api=n,this._initLayout(t,e,n),this._pointsBuilder.update(t,e,n),this._forceLayoutInstance instanceof oit||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(t,n),this._control.off("update"),this._control.on("update",function(){n.dispatchAction({type:"graphGLRoam",seriesId:t.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)},this),this._control.setZoom(M8.firstNotNull(t.get("zoom"),1)),this._control.setOffset(t.get("offset")||[0,0]);var r=this._pointsBuilder.getPointsMesh();if(r.off("mousemove",this._mousemoveHandler),r.off("mouseout",this._mouseOutHandler,this),n.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,t.get("focusNodeAdjacency")){var i=t.get("focusNodeAdjacencyOn");"click"===i?n.getZr().on("click",this._clickHandler):"mouseover"===i?(r.on("mousemove",this._mousemoveHandler,this),r.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):console.warn("Unkown focusNodeAdjacencyOn value s"+i)}this._lastMouseOverDataIndex=-1},_clickHandler:function(t){if(!this._layouting){var e=this._pointsBuilder.getPointsMesh().dataIndex;e>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:e}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(t){if(!this._layouting){var e=this._pointsBuilder.getPointsMesh().dataIndex;e>=0?e!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:e}):this._mouseOutHandler(t),this._lastMouseOverDataIndex=e}},_mouseOutHandler:function(t){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(t,e){var n=this._forceEdgesMesh.geometry,r=e.getEdgeData(),i=0,o=this._forceLayoutInstance,a=2*r.count();n.attributes.node.init(a),n.attributes.color.init(a),r.each(function(e){var a=t[e];n.attributes.node.set(i,o.getNodeUV(a.node1)),n.attributes.node.set(i+1,o.getNodeUV(a.node2));var s=det(r,a.dataIndex),l=a9.parseColor(s);l[3]*=M8.firstNotNull(pet(r,a.dataIndex),1),n.attributes.color.set(i,l),n.attributes.color.set(i+1,l),i+=2}),n.dirty()},_updateMeshLinesGeometry:function(){var t=this._model.getEdgeData(),e=this._edgesMesh.geometry,n=(t=this._model.getEdgeData(),this._model.getData().getLayout("points"));e.resetOffset(),e.setVertexCount(t.count()*e.getLineVertexCount()),e.setTriangleCount(t.count()*e.getLineTriangleCount());var r=[],i=[],o=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*t.count()),this._edgeIndicesMap=new Float32Array(t.count()),t.each(function(a){var s=t.graph.getEdgeByIndex(a),l=2*s.node1.dataIndex,u=2*s.node2.dataIndex;r[0]=n[l],r[1]=n[l+1],i[0]=n[u],i[1]=n[u+1];var h=det(t,s.dataIndex),c=a9.parseColor(h);c[3]*=M8.firstNotNull(pet(t,s.dataIndex),1);var d=t.getItemModel(s.dataIndex),p=M8.firstNotNull(d.get(o),1)*this._api.getDevicePixelRatio();e.addLine(r,i,c,p);for(var f=0;f<4;f++)this._originalEdgeColors[4*s.dataIndex+f]=c[f];this._edgeIndicesMap[s.dataIndex]=a},this),e.dirty()},_updateForceNodesGeometry:function(t){for(var e=this._pointsBuilder.getPointsMesh(),n=[],r=0;r<t.count();r++)this._forceLayoutInstance.getNodeUV(r,n),e.geometry.attributes.position.set(r,n);e.geometry.dirty("position")},_initLayout:function(t,e,n){var r=t.get("layout"),i=t.getGraph(),o=Ug(t.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()});"force"===r&&(console.warn("Currently only forceAtlas2 layout supported."),r="forceAtlas2"),this.stopLayout(t,e,n,{beforeLayout:!0});var a=t.getData(),s=t.getData();if("forceAtlas2"===r){var l=t.getModel("forceAtlas2"),u=this._forceLayoutInstance,h=[],c=[],d=a.getDataExtent("value"),p=s.getDataExtent("value"),f=M8.firstNotNull(l.get("edgeWeight"),1),g=M8.firstNotNull(l.get("nodeWeight"),1);"number"==typeof f&&(f=[f,f]),"number"==typeof g&&(g=[g,g]);var m=0,v={},y=new Float32Array(2*a.count());if(i.eachNode(function(t){var e,n,r=t.dataIndex,i=a.get("value",r);if(a.hasItemOption){var s=a.getItemModel(r);e=s.get("x"),n=s.get("y")}null==e&&(e=o.x+Math.random()*o.width,n=o.y+Math.random()*o.height),y[2*m]=e,y[2*m+1]=n,v[t.id]=m++;var l=Jo(i,d,g);isNaN(l)&&(l=isNaN(g[0])?1:g[0]),h.push({x:e,y:n,mass:l,size:a.getItemVisual(r,"symbolSize")})}),a.setLayout("points",y),i.eachEdge(function(t){var e=t.dataIndex,n=Jo(a.get("value",e),p,f);isNaN(n)&&(n=isNaN(f[0])?1:f[0]),c.push({node1:v[t.node1.id],node2:v[t.node2.id],weight:n,dataIndex:e})}),!u){var _=l.get("GPU");this._forceLayoutInstance&&((!_||this._forceLayoutInstance instanceof oit)&&(_||this._forceLayoutInstance instanceof uit)||(this._forceLayoutInstanceToDispose=this._forceLayoutInstance)),u=this._forceLayoutInstance=_?new oit:new uit}u.initData(h,c),u.updateOption(l.option),this._updateForceEdgesGeometry(u.getEdges(),t),this._updatePositionTexture(),n.dispatchAction({type:"graphGLStartLayout",from:this.uid})}else{y=new Float32Array(2*a.count()),m=0;i.eachNode(function(t){var e,n,r=t.dataIndex;if(a.hasItemOption){var i=a.getItemModel(r);e=i.get("x"),n=i.get("y")}y[m++]=e,y[m++]=n}),a.setLayout("points",y),this._updateAfterLayout(t,e,n)}},_updatePositionTexture:function(){var t=this._forceLayoutInstance.getNodePositionTexture();this._pointsBuilder.setPositionTexture(t),this._forceEdgesMesh.material.set("positionTex",t)},startLayout:function(t,e,n,r){if(!r||null==r.from||r.from===this.uid){var i=this.viewGL,o=(n=this._api,this._forceLayoutInstance),a=this._model.getData(),s=this._model.getModel("forceAtlas2");if(o){if(this.groupGL.remove(this._edgesMesh),this.groupGL.add(this._forceEdgesMesh),this._forceLayoutInstance){this._updateForceNodesGeometry(t.getData()),this._pointsBuilder.hideLabels();var l=this,u=this._layoutId=pit++,h=s.getShallow("maxSteps"),c=s.getShallow("steps"),d=0,p=Math.max(2*c,20),f=function(e){if(e===l._layoutId)return o.isFinished(h)?(n.dispatchAction({type:"graphGLStopLayout",from:l.uid}),void n.dispatchAction({type:"graphGLFinishLayout",points:a.getLayout("points"),from:l.uid})):void o.update(i.layer.renderer,c,function(){l._updatePositionTexture(),(d+=c)>=p&&(l._syncNodePosition(t),d=0),n.getZr().refresh(),Pn(function(){f(e)})})};Pn(function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(i.layer.renderer),l._forceLayoutInstanceToDispose=null),f(u)}),this._layouting=!0}}else console.error("None layout don't have startLayout action")}},stopLayout:function(t,e,n,r){r&&null!=r.from&&r.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(r&&r.beforeLayout||(this._syncNodePosition(t),this._updateAfterLayout(t,e,n)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(t){var e=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);t.getData().setLayout("points",e),t.setNodePosition(e)},_updateAfterLayout:function(t,e,n){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(t,e,n),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(t,e,n,r){var i=this._model.getData();this._downplayAll();var o=r.dataIndex,a=i.graph,s=[],l=a.getNodeByIndex(o);s.push(l),l.edges.forEach(function(t){t.dataIndex<0||(t.node1!==l&&s.push(t.node1),t.node2!==l&&s.push(t.node2))},this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach(function(t){this._pointsBuilder.highlight(i,t.dataIndex)},this),this._pointsBuilder.updateLabels(s.map(function(t){return t.dataIndex}));var u=[];l.edges.forEach(function(t){t.dataIndex>=0&&(this._highlightEdge(t.dataIndex),u.push(t))},this),this._focusNodes=s,this._focusEdges=u},unfocusNodeAdjacency:function(t,e,n,r){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(t){var e=this._model.getEdgeData().getItemModel(t),n=a9.parseColor(e.get("emphasis.lineStyle.color")||e.get("lineStyle.color")),r=M8.firstNotNull(e.get("emphasis.lineStyle.opacity"),e.get("lineStyle.opacity"),1);n[3]*=r,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],n)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach(function(t){this._pointsBuilder.downplay(this._model.getData(),t.dataIndex)},this),this._focusEdges&&this._focusEdges.forEach(function(t){this._downplayEdge(t.dataIndex)},this)},_downplayEdge:function(t){var e=this._getColor(t,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)},_setEdgeFade:function(){var t=[];return function(e,n){this._getColor(e,t),t[3]*=n,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e],t)}}(),_getColor:function(t,e){for(var n=0;n<4;n++)e[n]=this._originalEdgeColors[4*t+n];return e},_fadeOutEdgesAll:function(t){this._model.getData().graph.eachEdge(function(e){this._setEdgeFade(e.dataIndex,t)},this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(t,e){this.viewGL.setViewport(0,0,e.getWidth(),e.getHeight(),e.getDevicePixelRatio());for(var n=this.viewGL.camera,r=t.getData().getLayout("points"),i=dit.create(1/0,1/0),o=dit.create(-1/0,-1/0),a=[],s=0;s<r.length;)a[0]=r[s++],a[1]=r[s++],dit.min(i,i,a),dit.max(o,o,a);var l=(o[1]+i[1])/2,u=(o[0]+i[0])/2;if(!(u>n.left&&u<n.right&&l<n.bottom&&l>n.top)){var h=Math.max(o[0]-i[0],10),c=h/e.getWidth()*e.getHeight();h*=1.4,c*=1.4,i[0]-=.2*h,n.left=i[0],n.top=l-c/2,n.bottom=l+c/2,n.right=h+i[0],n.near=0,n.far=100}},dispose:function(){var t=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(t),this.groupGL.removeAll(),this._layoutId=-1,this._pointsBuilder.dispose()},remove:function(){this.groupGL.removeAll(),this._control.dispose()}}),git=y1;function mit(t){return t instanceof Array||(t=[t,t]),t}vM(function(t){function e(){}x9(git,"ForceAtlas2",uit),x9(git,"ForceAtlas2GPU",oit),t.registerChartView(fit),t.registerSeriesModel($rt),t.registerVisual(function(t){const e={};t.eachSeriesByType("graphGL",function(t){var n=t.getCategoriesData(),r=t.getData(),i={};n.each(function(r){var o=n.getName(r);i["ec-"+o]=r;var a=n.getItemModel(r),s=a.getModel("itemStyle").getItemStyle();s.fill||(s.fill=t.getColorFromPalette(o,e)),n.setItemVisual(r,"style",s);var l=["symbol","symbolSize","symbolKeepAspect"];for(let t=0;t<l.length;t++){var u=a.getShallow(l[t],!0);null!=u&&n.setItemVisual(r,l[t],u)}}),n.count()&&r.each(function(t){let e=r.getItemModel(t).getShallow("category");if(null!=e){"string"==typeof e&&(e=i["ec-"+e]);var o=n.getItemVisual(e,"style"),a=r.ensureUniqueItemVisual(t,"style");git.util.extend(a,o);var s=["symbol","symbolSize","symbolKeepAspect"];for(let i=0;i<s.length;i++)r.setItemVisual(t,s[i],n.getItemVisual(e,s[i]))}})})}),t.registerVisual(function(t){t.eachSeriesByType("graphGL",function(t){var e=t.getGraph(),n=t.getEdgeData(),r=mit(t.get("edgeSymbol")),i=mit(t.get("edgeSymbolSize"));n.setVisual("drawType","stroke"),n.setVisual("fromSymbol",r&&r[0]),n.setVisual("toSymbol",r&&r[1]),n.setVisual("fromSymbolSize",i&&i[0]),n.setVisual("toSymbolSize",i&&i[1]),n.setVisual("style",t.getModel("lineStyle").getLineStyle()),n.each(function(t){var r=n.getItemModel(t),i=e.getEdgeByIndex(t),o=mit(r.getShallow("symbol",!0)),a=mit(r.getShallow("symbolSize",!0)),s=r.getModel("lineStyle").getLineStyle(),l=n.ensureUniqueItemVisual(t,"style");switch(git.util.extend(l,s),l.stroke){case"source":var u=i.node1.getVisual("style");l.stroke=u&&u.fill;break;case"target":u=i.node2.getVisual("style");l.stroke=u&&u.fill}o[0]&&i.setVisual("fromSymbol",o[0]),o[1]&&i.setVisual("toSymbol",o[1]),a[0]&&i.setVisual("fromSymbolSize",a[0]),a[1]&&i.setVisual("toSymbolSize",a[1])})})}),t.registerAction({type:"graphGLRoam",event:"graphglroam",update:"series.graphGL:roam"},function(t,e){e.eachComponent({mainType:"series",query:t},function(e){e.setView(t)})}),t.registerAction({type:"graphGLStartLayout",event:"graphgllayoutstarted",update:"series.graphGL:startLayout"},e),t.registerAction({type:"graphGLStopLayout",event:"graphgllayoutstopped",update:"series.graphGL:stopLayout"},e),t.registerAction({type:"graphGLFocusNodeAdjacency",event:"graphGLFocusNodeAdjacency",update:"series.graphGL:focusNodeAdjacency"},e),t.registerAction({type:"graphGLUnfocusNodeAdjacency",event:"graphGLUnfocusNodeAdjacency",update:"series.graphGL:unfocusNodeAdjacency"},e)});var vit=Ky.extend({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualStyleAccessPath:"itemStyle",getInitialData:function(t,e){var n=this.get("coordinateSystem"),r="geo"===n?["lng","lat"]:vw(n)||["x","y"];if(r.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");r.push("vx","vy");var i=aS(this.getSource(),{coordDimensions:r,encodeDefine:this.get("encode"),dimensionsDefine:this.get("dimensions")}),o=new oS(i,this);return o.initData(this.getSource()),o},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}}),yit=b4.extend(function(){return{dynamic:!0,attributes:{position:new b4.Attribute("position","float",3,"POSITION")}}},{resetOffset:function(){this._vertexOffset=0,this._faceOffset=0},setLineCount:function(t){var e=this.attributes,n=4*t,r=2*t;this.vertexCount!==n&&e.position.init(n),this.triangleCount!==r&&(this.indices=0===r?null:this.vertexCount>65535?new Uint32Array(3*r):new Uint16Array(3*r))},addLine:function(t){var e=this._vertexOffset;this.attributes.position.set(e,[t[0],t[1],1]),this.attributes.position.set(e+1,[t[0],t[1],-1]),this.attributes.position.set(e+2,[t[0],t[1],2]),this.attributes.position.set(e+3,[t[0],t[1],-2]),this.setTriangleIndices(this._faceOffset++,[e,e+1,e+2]),this.setTriangleIndices(this._faceOffset++,[e+1,e+2,e+3]),this._vertexOffset+=4}});R5.import("@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n");var _it=function(){this.motionBlurFactor=.99,this.vectorFieldTexture=new l4({type:n4.FLOAT,flipY:!1}),this.particleLife=[5,20],this._particleType="point",this._particleSize=1,this.particleColor=[1,1,1,1],this.particleSpeedScaling=1,this._thisFrameTexture=null,this._particlePass=null,this._spawnTexture=null,this._particleTexture0=null,this._particleTexture1=null,this._particlePointsMesh=null,this._surfaceFrameBuffer=null,this._elapsedTime=0,this._scene=null,this._camera=null,this._lastFrameTexture=null,this._supersampling=1,this._downsampleTextures=[],this._width=512,this._height=512,this.init()};_it.prototype={constructor:_it,init:function(){var t={type:n4.FLOAT,minFilter:n4.NEAREST,magFilter:n4.NEAREST,useMipmap:!1};this._spawnTexture=new l4(t),this._particleTexture0=new l4(t),this._particleTexture1=new l4(t),this._frameBuffer=new I6({depthBuffer:!1}),this._particlePass=new c8({fragment:R5.source("ecgl.vfParticle.particle.fragment")}),this._particlePass.setUniform("velocityTexture",this.vectorFieldTexture),this._particlePass.setUniform("spawnTexture",this._spawnTexture),this._downsamplePass=new c8({fragment:R5.source("clay.compositor.downsample")});var e=new I3({renderOrder:10,material:new i5({shader:new R5(R5.source("ecgl.vfParticle.renderPoints.vertex"),R5.source("ecgl.vfParticle.renderPoints.fragment"))}),mode:I3.POINTS,geometry:new b4({dynamic:!0,mainAttribute:"texcoord0"})}),n=new I3({renderOrder:10,material:new i5({shader:new R5(R5.source("ecgl.vfParticle.renderLines.vertex"),R5.source("ecgl.vfParticle.renderLines.fragment"))}),geometry:new yit,culling:!1}),r=new I3({material:new i5({shader:new R5(R5.source("ecgl.color.vertex"),R5.source("ecgl.color.fragment"))}),geometry:new E6});r.material.enableTexture("diffuseMap"),this._particlePointsMesh=e,this._particleLinesMesh=n,this._lastFrameFullQuadMesh=r,this._camera=new s8,this._thisFrameTexture=new l4,this._lastFrameTexture=new l4},setParticleDensity:function(t,e){for(var n=new Float32Array(4*(t*e)),r=0,i=this.particleLife,o=0;o<t;o++)for(var a=0;a<e;a++,r++){n[4*r]=Math.random(),n[4*r+1]=Math.random(),n[4*r+2]=Math.random();var s=(i[1]-i[0])*Math.random()+i[0];n[4*r+3]=s}"line"===this._particleType?this._setLineGeometry(t,e):this._setPointsGeometry(t,e),this._spawnTexture.width=t,this._spawnTexture.height=e,this._spawnTexture.pixels=n,this._particleTexture0.width=this._particleTexture1.width=t,this._particleTexture0.height=this._particleTexture1.height=e,this._particlePass.setUniform("textureSize",[t,e])},_setPointsGeometry:function(t,e){var n=t*e,r=this._particlePointsMesh.geometry,i=r.attributes;i.texcoord0.init(n);for(var o=0,a=0;a<t;a++)for(var s=0;s<e;s++,o++)i.texcoord0.value[2*o]=a/t,i.texcoord0.value[2*o+1]=s/e;r.dirty()},_setLineGeometry:function(t,e){var n=t*e,r=this._getParticleMesh().geometry;r.setLineCount(n),r.resetOffset();for(var i=0;i<t;i++)for(var o=0;o<e;o++)r.addLine([i/t,o/e]);r.dirty()},_getParticleMesh:function(){return"line"===this._particleType?this._particleLinesMesh:this._particlePointsMesh},update:function(t,e,n,r){var i=this._getParticleMesh(),o=this._frameBuffer,a=this._particlePass;r&&this._updateDownsampleTextures(t,e),i.material.set("size",this._particleSize*this._supersampling),i.material.set("color",this.particleColor),a.setUniform("speedScaling",this.particleSpeedScaling),o.attach(this._particleTexture1),a.setUniform("firstFrameTime",r?(this.particleLife[1]+this.particleLife[0])/2:0),a.setUniform("particleTexture",this._particleTexture0),a.setUniform("deltaTime",n),a.setUniform("elapsedTime",this._elapsedTime),a.render(t,o),i.material.set("particleTexture",this._particleTexture1),i.material.set("prevParticleTexture",this._particleTexture0),o.attach(this._thisFrameTexture),o.bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT);var s=this._lastFrameFullQuadMesh;s.material.set("diffuseMap",this._lastFrameTexture),s.material.set("color",[1,1,1,this.motionBlurFactor]),this._camera.update(!0),t.renderPass([s,i],this._camera),o.unbind(t),this._downsample(t),this._swapTexture(),this._elapsedTime+=n},_downsample:function(t){var e=this._downsampleTextures;if(0!==e.length)for(var n=0,r=this._thisFrameTexture,i=e[n];i;)this._frameBuffer.attach(i),this._downsamplePass.setUniform("texture",r),this._downsamplePass.setUniform("textureSize",[r.width,r.height]),this._downsamplePass.render(t,this._frameBuffer),r=i,i=e[++n]},getSurfaceTexture:function(){var t=this._downsampleTextures;return t.length>0?t[t.length-1]:this._lastFrameTexture},setRegion:function(t){this._particlePass.setUniform("region",t)},resize:function(t,e){this._lastFrameTexture.width=t*this._supersampling,this._lastFrameTexture.height=e*this._supersampling,this._thisFrameTexture.width=t*this._supersampling,this._thisFrameTexture.height=e*this._supersampling,this._width=t,this._height=e},setParticleSize:function(t){var e=this._getParticleMesh();if(t<=2)return e.material.disableTexture("spriteTexture"),void(e.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new l4),this._spriteTexture.image&&this._spriteTexture.image.width===t||(this._spriteTexture.image=function(t){var e=document.createElement("canvas");e.width=e.height=t;var n=e.getContext("2d");return n.fillStyle="#fff",n.arc(t/2,t/2,t/2,0,2*Math.PI),n.fill(),e}(t),this._spriteTexture.dirty()),e.material.transparent=!0,e.material.enableTexture("spriteTexture"),e.material.set("spriteTexture",this._spriteTexture),this._particleSize=t},setGradientTexture:function(t){var e=this._getParticleMesh().material;e[t?"enableTexture":"disableTexture"]("gradientTexture"),e.setUniform("gradientTexture",t)},setColorTextureImage:function(t,e){this._getParticleMesh().material.setTextureImage("colorTexture",t,e,{flipY:!0})},setParticleType:function(t){this._particleType=t},clearFrame:function(t){var e=this._frameBuffer;e.attach(this._lastFrameTexture),e.bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),e.unbind(t)},setSupersampling:function(t){this._supersampling=t,this.resize(this._width,this._height)},_updateDownsampleTextures:function(t,e){for(var n=this._downsampleTextures,r=Math.max(Math.floor(Math.log(this._supersampling/e.getDevicePixelRatio())/Math.log(2)),0),i=2,o=this._width*this._supersampling,a=this._height*this._supersampling,s=0;s<r;s++)n[s]=n[s]||new l4,n[s].width=o/i,n[s].height=a/i,i*=2;for(;s<n.length;s++)n[s].dispose(t);n.length=r},_swapTexture:function(){var t=this._particleTexture0;this._particleTexture0=this._particleTexture1,this._particleTexture1=t;t=this._thisFrameTexture;this._thisFrameTexture=this._lastFrameTexture,this._lastFrameTexture=t},dispose:function(t){t.disposeFrameBuffer(this._frameBuffer),t.disposeTexture(this.vectorFieldTexture),t.disposeTexture(this._spawnTexture),t.disposeTexture(this._particleTexture0),t.disposeTexture(this._particleTexture1),t.disposeTexture(this._thisFrameTexture),t.disposeTexture(this._lastFrameTexture),t.disposeGeometry(this._particleLinesMesh.geometry),t.disposeGeometry(this._particlePointsMesh.geometry),t.disposeGeometry(this._lastFrameFullQuadMesh.geometry),this._spriteTexture&&t.disposeTexture(this._spriteTexture),this._particlePass.dispose(t),this._downsamplePass.dispose(t),this._downsampleTextures.forEach(function(e){e.dispose(t)})}};var xit=_it,bit=l_.extend({type:"flowGL",__ecgl__:!0,init:function(t,e){this.viewGL=new ftt("orthographic"),this.groupGL=new a9.Node,this.viewGL.add(this.groupGL),this._particleSurface=new xit;var n=new a9.Mesh({geometry:new a9.PlaneGeometry,material:new a9.Material({shader:new a9.Shader({vertex:a9.Shader.source("ecgl.color.vertex"),fragment:a9.Shader.source("ecgl.color.fragment")}),transparent:!0})});n.material.enableTexture("diffuseMap"),this.groupGL.add(n),this._planeMesh=n},render:function(t,e,n){var r=this._particleSurface;r.setParticleType(t.get("particleType")),r.setSupersampling(t.get("supersampling")),this._updateData(t,n),this._updateCamera(n.getWidth(),n.getHeight(),n.getDevicePixelRatio());var i=M8.firstNotNull(t.get("particleDensity"),128);r.setParticleDensity(i,i);var o=this._planeMesh,a=+new Date,s=this,l=!0;o.__percent=0,o.stopAnimation(),o.animate("",{loop:!0}).when(1e5,{__percent:1}).during(function(){var t=+new Date,e=Math.min(t-a,20);a+=e,s._renderer&&(r.update(s._renderer,n,e/1e3,l),o.material.set("diffuseMap",r.getSurfaceTexture())),l=!1}).start();var u=t.getModel("itemStyle"),h=a9.parseColor(u.get("color"));h[3]*=M8.firstNotNull(u.get("opacity"),1),o.material.set("color",h),r.setColorTextureImage(t.get("colorTexture"),n),r.setParticleSize(t.get("particleSize")),r.particleSpeedScaling=t.get("particleSpeed"),r.motionBlurFactor=1-Math.pow(.1,t.get("particleTrail"))},updateTransform:function(t,e,n){this._updateData(t,n)},afterRender:function(t,e,n,r){var i=r.renderer;this._renderer=i},_updateData:function(t,e){var n=t.coordinateSystem,r=n.dimensions.map(function(e){return t.coordDimToDataDim(e)[0]}),i=t.getData(),o=i.getDataExtent(r[0]),a=i.getDataExtent(r[1]),s=t.get("gridWidth"),l=t.get("gridHeight");if(null==s||"auto"===s){var u=(o[1]-o[0])/(a[1]-a[0]);s=Math.round(Math.sqrt(u*i.count()))}null!=l&&"auto"!==l||(l=Math.ceil(i.count()/s));var h=this._particleSurface.vectorFieldTexture,c=h.pixels;if(c&&c.length===l*s*4)for(var d=0;d<c.length;d++)c[d]=0;else c=h.pixels=new Float32Array(s*l*4);var p=0,f=1/0,g=new Float32Array(2*i.count()),m=0,v=[[1/0,1/0],[-1/0,-1/0]];i.each([r[0],r[1],"vx","vy"],function(t,e,r,i){var o=n.dataToPoint([t,e]);g[m++]=o[0],g[m++]=o[1],v[0][0]=Math.min(o[0],v[0][0]),v[0][1]=Math.min(o[1],v[0][1]),v[1][0]=Math.max(o[0],v[1][0]),v[1][1]=Math.max(o[1],v[1][1]);var a=Math.sqrt(r*r+i*i);p=Math.max(p,a),f=Math.min(f,a)}),i.each(["vx","vy"],function(t,e,n){var r=Math.round((g[2*n]-v[0][0])/(v[1][0]-v[0][0])*(s-1)),i=4*((l-1-Math.round((g[2*n+1]-v[0][1])/(v[1][1]-v[0][1])*(l-1)))*s+r);c[i]=t/p*.5+.5,c[i+1]=e/p*.5+.5,c[i+3]=1}),h.width=s,h.height=l,"bmap"===t.get("coordinateSystem")&&this._fillEmptyPixels(h),h.dirty(),this._updatePlanePosition(v[0],v[1],t,e),this._updateGradientTexture(i.getVisual("visualMeta"),[f,p])},_fillEmptyPixels:function(t){var e=t.pixels,n=t.width,r=t.height;function i(t,i,o){t=Math.max(Math.min(t,n-1),0);var a=4*((i=Math.max(Math.min(i,r-1),0))*(n-1)+t);return 0!==e[a+3]&&(o[0]=e[a],o[1]=e[a+1],!0)}function o(t,e,n){n[0]=t[0]+e[0],n[1]=t[1]+e[1]}for(var a=[],s=[],l=[],u=[],h=[],c=0,d=0;d<r;d++)for(var p=0;p<n;p++){var f=4*(d*(n-1)+p);0===e[f+3]&&(c=a[0]=a[1]=0,i(p-1,d,s)&&(c++,o(s,a,a)),i(p+1,d,l)&&(c++,o(l,a,a)),i(p,d-1,u)&&(c++,o(u,a,a)),i(p,d+1,h)&&(c++,o(h,a,a)),a[0]/=c,a[1]/=c,e[f]=a[0],e[f+1]=a[1]),e[f+3]=1}},_updateGradientTexture:function(t,e){if(t&&t.length){this._gradientTexture=this._gradientTexture||new a9.Texture2D({image:document.createElement("canvas")});var n=this._gradientTexture,r=n.image;r.width=200,r.height=1;var i=r.getContext("2d"),o=i.createLinearGradient(0,.5,r.width,.5);t[0].stops.forEach(function(t){var n;e[1]===e[0]?n=0:(n=t.value/e[1],n=Math.min(Math.max(n,0),1)),o.addColorStop(n,t.color)}),i.fillStyle=o,i.fillRect(0,0,r.width,r.height),n.dirty(),this._particleSurface.setGradientTexture(this._gradientTexture)}else this._particleSurface.setGradientTexture(null)},_updatePlanePosition:function(t,e,n,r){var i=this._limitInViewportAndFullFill(t,e,n,r);t=i.leftTop,e=i.rightBottom,this._particleSurface.setRegion(i.region),this._planeMesh.position.set((t[0]+e[0])/2,r.getHeight()-(t[1]+e[1])/2,0);var o=e[0]-t[0],a=e[1]-t[1];this._planeMesh.scale.set(o/2,a/2,1),this._particleSurface.resize(Math.max(Math.min(o,2048),1),Math.max(Math.min(a,2048),1)),this._renderer&&this._particleSurface.clearFrame(this._renderer)},_limitInViewportAndFullFill:function(t,e,n,r){var i=[Math.max(t[0],0),Math.max(t[1],0)],o=[Math.min(e[0],r.getWidth()),Math.min(e[1],r.getHeight())];if("bmap"===n.get("coordinateSystem")){var a=n.getData().getDataExtent(n.coordDimToDataDim("lng")[0]);Math.floor(a[1]-a[0])>=359&&(i[0]>0&&(i[0]=0),o[0]<r.getWidth()&&(o[0]=r.getWidth()))}var s=e[0]-t[0],l=e[1]-t[1],u=o[0]-i[0],h=o[1]-i[1];return{leftTop:i,rightBottom:o,region:[(i[0]-t[0])/s,1-h/l-(i[1]-t[1])/l,u/s,h/l]}},_updateCamera:function(t,e,n){this.viewGL.setViewport(0,0,t,e,n);var r=this.viewGL.camera;r.left=r.bottom=0,r.top=e,r.right=t,r.near=0,r.far=100,r.position.z=10},remove:function(){this._planeMesh.stopAnimation(),this.groupGL.removeAll()},dispose:function(){this._renderer&&this._particleSurface.dispose(this._renderer),this.groupGL.removeAll()}});vM(function(t){t.registerChartView(bit),t.registerSeriesModel(vit)});var wit=Ky.extend({type:"series.linesGL",dependencies:["grid","geo"],visualStyleAccessPath:"lineStyle",visualDrawType:"stroke",streamEnabled:!0,init:function(t){var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count)),wit.superApply(this,"init",arguments)},mergeOption:function(t){var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count)),wit.superApply(this,"mergeOption",arguments)},appendData:function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=_t(this._flatCoords,e.flatCoords),this._flatCoordsOffset=_t(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},_getCoordsFromItemModel:function(t){var e=this.getData().getItemModel(t),n=e.option instanceof Array?e.option:e.getShallow("coords");if(!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},getLineCoordsCount:function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},getLineCoords:function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],r=this._flatCoordsOffset[2*t+1],i=0;i<r;i++)e[i]=e[i]||[],e[i][0]=this._flatCoords[n+2*i],e[i][1]=this._flatCoords[n+2*i+1];return r}var o=this._getCoordsFromItemModel(t);for(i=0;i<o.length;i++)e[i]=e[i]||[],e[i][0]=o[i][0],e[i][1]=o[i][1];return o.length},_processFlatCoordsArray:function(t){var e=0;if(this._flatCoords&&(e=this._flatCoords.length),"number"==typeof t[0]){for(var n=t.length,r=new Uint32Array(n),i=new Float64Array(n),o=0,a=0,s=0,l=0;l<n;){s++;var u=t[l++];r[a++]=o+e,r[a++]=u;for(var h=0;h<u;h++){var c=t[l++],d=t[l++];if(i[o++]=c,i[o++]=d,l>n)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(r.buffer,0,a),flatCoords:i,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},getInitialData:function(t,e){var n=new oS(["value"],this);return n.hasItemOption=!1,n.initData(t8(t.data),[],function(t,e,r,i){if(t instanceof Array)return NaN;n.hasItemOption=!0;var o=t.value;return null!=o?o instanceof Array?o[i]:o:void 0}),n},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}}),Sit=wit,Tit=l_.extend({type:"linesGL",__ecgl__:!0,init:function(t,e){this.groupGL=new a9.Node,this.viewGL=new ftt("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new Krt(this.viewGL),this._nativeLinesShader=a9.createShader("ecgl.lines3D"),this._meshLinesShader=a9.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(t,e,n){this.groupGL.removeAll(),this._glViewHelper.reset(t,n);var r=this._linesMeshes[0];r||(r=this._linesMeshes[0]=this._createLinesMesh(t)),this._linesMeshes.length=1,this.groupGL.add(r),this._updateLinesMesh(t,r,0,t.getData().count()),this.viewGL.setPostEffect(t.getModel("postEffect"),n)},incrementalPrepareRender:function(t,e,n){this.groupGL.removeAll(),this._glViewHelper.reset(t,n),this._currentStep=0,this.viewGL.setPostEffect(t.getModel("postEffect"),n)},incrementalRender:function(t,e,n,r){var i=this._linesMeshes[this._currentStep];i||(i=this._createLinesMesh(e),this._linesMeshes[this._currentStep]=i),this._updateLinesMesh(e,i,t.start,t.end),this.groupGL.add(i),r.getZr().refresh(),this._currentStep++},updateTransform:function(t,e,n){t.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(t,n)},_createLinesMesh:function(t){return new a9.Mesh({$ignorePicking:!0,material:new a9.Material({shader:a9.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new rit({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:a9.Mesh.LINES,culling:!1})},_updateLinesMesh:function(t,e,n,r){var i=t.getData();e.material.blend="lighter"===t.get("blendMode")?a9.additiveBlend:null;var o=t.get("lineStyle.curveness")||0,a=t.get("polyline"),s=e.geometry,l=t.coordinateSystem,u=M8.firstNotNull(t.get("lineStyle.width"),1);u>1?(e.material.shader!==this._meshLinesShader&&e.material.attachShader(this._meshLinesShader),e.mode=a9.Mesh.TRIANGLES):(e.material.shader!==this._nativeLinesShader&&e.material.attachShader(this._nativeLinesShader),e.mode=a9.Mesh.LINES),n=n||0,r=r||i.count(),s.resetOffset();var h=0,c=0,d=[],p=[],f=[],g=[],m=[],v=.3,y=.7;function _(){p[0]=d[0]*y+g[0]*v-(d[1]-g[1])*o,p[1]=d[1]*y+g[1]*v-(g[0]-d[0])*o,f[0]=d[0]*v+g[0]*y-(d[1]-g[1])*o,f[1]=d[1]*v+g[1]*y-(g[0]-d[0])*o}if(a||0!==o)for(var x=n;x<r;x++)if(a){var b=t.getLineCoordsCount(x);h+=s.getPolylineVertexCount(b),c+=s.getPolylineTriangleCount(b)}else t.getLineCoords(x,m),this._glViewHelper.dataToPoint(l,m[0],d),this._glViewHelper.dataToPoint(l,m[1],g),_(),h+=s.getCubicCurveVertexCount(d,p,f,g),c+=s.getCubicCurveTriangleCount(d,p,f,g);else{var w=r-n;h+=w*s.getLineVertexCount(),c+=w*s.getLineVertexCount()}s.setVertexCount(h),s.setTriangleCount(c);var S=n,T=[];for(x=n;x<r;x++){a9.parseColor(det(i,S),T);var M=M8.firstNotNull(pet(i,S),1);T[3]*=M;b=t.getLineCoords(x,m);for(var C=0;C<b;C++)this._glViewHelper.dataToPoint(l,m[C],m[C]);a?s.addPolyline(m,T,u,0,b):0!==o?(d=m[0],g=m[1],_(),s.addCubicCurve(d,p,f,g,T,u)):s.addPolyline(m,T,u,0,2),S++}},dispose:function(){this.groupGL.removeAll()},remove:function(){this.groupGL.removeAll()}});vM(function(t){t.registerChartView(Tit),t.registerSeriesModel(Sit)});let Mit=m1;var Cit={props:{options:{type:Object,default:()=>{}},theme:{type:[String,Object],default:()=>""},initOptions:{type:Object,default:()=>{}},updateOptions:{type:Object,default:()=>{}},group:{type:String,default:()=>""},manualUpdate:{type:Boolean,default:()=>!1},loading:{type:Boolean,default:()=>!1},loadingOptions:{type:Object,default:()=>{}},autoresize:{type:[Boolean,Object],default:()=>!0}},data:function(){return{}},mounted:function(){this.init()},beforeDestroy:function(){this.clear()},watch:{options:{deep:!0,handler:function(t,e){let n=this;n.manualUpdate||n.chart&&n.chart.setOption(t||{},{notMerge:t!==e,...n.updateOptions})}},theme:function(){this.reinit()},initOptions:{deep:!0,handler:function(){this.reinit()}},group:function(t){let e=this;e.chart&&(e.chart.group=t||"")},loading:function(){this.updateLoading()},loadingOptions:{deep:!0,handler:function(){this.updateLoading()}},autoresize:function(){this.clearResize(),this.bindResize()}},computed:{},methods:{init:function(){let t=this,e=t.$refs.$self;if(!e)return;let n=Mit.init(e,t.theme||null,t.initOptions||{});t.chart=n,t.group&&(n.group=t.group),n.setOption(t.options||{},t.updateOptions||{}),Object.keys(t.$listeners||{}).forEach(e=>{let r=e.replace(/^[~!&]+/,""),i=t.$listeners[e];0===r.indexOf("zr:")?n.getZr().on(r.slice(3),i):n.on(r,i)}),t.updateLoading(),t.bindResize()},reinit:function(){this.clear(),this.init()},updateLoading:function(){let t=this;t.chart&&(t.loading?t.chart.showLoading("default",t.loadingOptions||{}):t.chart.hideLoading())},bindResize:function(){let t=this;if(!t.autoresize||!t.chart)return;let e=t.$refs.$self;if(!e)return;let n=!0===t.autoresize?{}:t.autoresize,r=Number.isFinite(n.throttle)?n.throttle:100,i=n.onResize,o=()=>{t.chart&&(t.chart.resize(),"function"==typeof i&&i())};r>0&&(o=d_(o,r));let a=!0;t.resizeObserver=new ResizeObserver(()=>{a?a=!1:o()}),t.resizeObserver.observe(e)},clearResize:function(){let t=this;t.resizeObserver&&(t.resizeObserver.disconnect(),t.resizeObserver=null)},clear:function(){let t=this;t.clearResize(),t.chart&&(t.chart.dispose(),t.chart=null)},getChart:function(){return this.chart||null}}};function Iit(t,e,n,r,i,o,a,s,l,u){"boolean"!=typeof a&&(l=s,s=a,a=!1);const h="function"==typeof n?n.options:n;let c;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,i&&(h.functional=!0)),r&&(h._scopeId=r),o?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,l(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},h._ssrRegister=c):e&&(c=a?function(t){e.call(this,u(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,s(t))}),c)if(h.functional){const t=h.render;h.render=function(e,n){return c.call(n),t(e,n)}}else{const t=h.beforeCreate;h.beforeCreate=t?[].concat(t,c):[c]}return n}const Ait="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function Dit(t){return(t,e)=>function(t,e){const n=Ait?e.media||"default":t,r=Pit[n]||(Pit[n]={ids:new Set,styles:[]});if(!r.ids.has(t)){r.ids.add(t);let n=e.source;if(e.map&&(n+="\n/*# sourceURL="+e.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e.map))))+" */"),r.element||(r.element=document.createElement("style"),r.element.type="text/css",e.media&&r.element.setAttribute("media",e.media),void 0===Lit&&(Lit=document.head||document.getElementsByTagName("head")[0]),Lit.appendChild(r.element)),"styleSheet"in r.element)r.styles.push(n),r.element.styleSheet.cssText=r.styles.filter(Boolean).join("\n");else{const t=r.ids.size-1,e=document.createTextNode(n),i=r.element.childNodes;i[t]&&r.element.removeChild(i[t]),i.length?r.element.insertBefore(e,i[t]):r.element.appendChild(e)}}}(t,e)}let Lit;const Pit={};const Eit=Cit;var Oit=function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"$self",staticClass:"w-echarts-vue"})};Oit._withStripped=!0;return Iit({render:Oit,staticRenderFns:[]},function(t){t&&t("data-v-1d2d622a_0",{source:"\n.w-echarts-vue[data-v-1d2d622a] {\n display: block;\n}\n",map:{version:3,sources:["C:\\opensrc\\開源-JS-407-7-w-echarts-vue\\w-echarts-vue\\src\\components\\WEchartsVue.vue"],names:[],mappings:";AAwVA;IACA,cAAA;AACA",file:"WEchartsVue.vue",sourcesContent:["<template>\n \x3c!-- ref=$self為供外部存取繪圖容器之用; 寬高由外部以style給予 --\x3e\n <div ref=\"$self\" class=\"w-echarts-vue\"></div>\n</template>\n\n<script>\nimport { throttle } from 'echarts/core'\nimport iniEcharts from '../js/iniEcharts.mjs'\n\n\n//echarts, 直接引用echarts與echarts-gl不使用cdn\n//注意: 本組件直接以echarts原生API實作生命週期(init, setOption, resize, dispose)與事件轉發,\n//不使用vue-echarts, 因其runtime依賴vue-demi, 而vue-demi出廠為Vue3模式須靠postinstall切換,\n//npm>=12/pnpm>=10/bun預設封鎖依賴套件install scripts, 下游以src方式引用本套件時會靜默停在Vue3模式而壞掉;\n//直接實作後全依賴樹零install script, 下游任意套件管理器與打包器皆零設定可用\nlet echarts = iniEcharts()\n\n\n/**\n * echarts繪圖組件, 已內含echarts全量圖表與組件, 以及echarts-gl之3D圖表(bar3D, line3D, scatter3D, surface等), 不須自cdn額外引用\n *\n * 注意: 組件本身不帶預設高度, 須由外部給予寬高(例如style=\"width:620px; height:300px;\"), 否則因高度為0而看不見圖形\n *\n * @vue-prop {Object} [options={}] 輸入echarts設定物件,即echarts之option,預設{}。變更時自動重繪:給予新物件(參照改變)採整體置換(notMerge),原物件內變更(mutation)採合併更新,與vue-echarts語意一致\n * @vue-prop {String|Object} [theme=''] 輸入echarts主題字串或主題設定物件,字串為已使用echarts.registerTheme註冊之主題名稱,變更時會自動銷毀重建圖表,預設''\n * @vue-prop {Object} [initOptions={}] 輸入echarts初始化設定物件,即echarts.init之opts,可設定renderer('canvas'或'svg')、locale、devicePixelRatio等,變更時會自動銷毀重建圖表,預設{}\n * @vue-prop {Object} [updateOptions={}] 輸入echarts更新設定物件,即echarts之setOption之opts,可設定notMerge、replaceMerge、lazyUpdate等,預設{}\n * @vue-prop {String} [group=''] 輸入圖表群組名稱字串,供echarts.connect跨圖表連動使用,預設''\n * @vue-prop {Boolean} [manualUpdate=false] 輸入是否關閉options之深度監聽布林值,若為true則變更options不會自動重繪,須自行取得實例呼叫setOption更新,適用於資料量龐大時,預設false\n * @vue-prop {Boolean} [loading=false] 輸入是否顯示讀取中動畫布林值,預設false\n * @vue-prop {Object} [loadingOptions={}] 輸入讀取中動畫設定物件,即echarts之showLoading之opts,可設定text、color、maskColor等,預設{}\n * @vue-prop {Boolean|Object} [autoresize=true] 輸入是否於容器尺寸改變時自動重繪布林值,亦可給物件設定{throttle,onResize},throttle為節流毫秒數預設100,預設true\n * @vue-event {Object} * 對外轉發echarts之全部事件,例如click、mouseover、legendselectchanged、datazoom、finished等,回傳事件參數物件;zrender事件以zr:前綴綁定,例如@zr:click\n */\nexport default {\n props: {\n options: {\n type: Object,\n default: () => {},\n },\n theme: {\n type: [String, Object],\n default: () => '',\n },\n initOptions: {\n type: Object,\n default: () => {},\n },\n updateOptions: {\n type: Object,\n default: () => {},\n },\n group: {\n type: String,\n default: () => '',\n },\n manualUpdate: {\n type: Boolean,\n default: () => false,\n },\n loading: {\n type: Boolean,\n default: () => false,\n },\n loadingOptions: {\n type: Object,\n default: () => {},\n },\n autoresize: {\n type: [Boolean, Object],\n default: () => true,\n },\n },\n data: function() {\n //chart與resizeObserver為echarts實例與瀏覽器原生物件, 不可放入data,\n //否則Vue會對其深層響應化(遞迴defineProperty), 造成效能問題, 故於init時直接掛this成非響應式屬性\n return {\n }\n },\n mounted: function() {\n //console.log('mounted')\n\n let vo = this\n\n //init\n vo.init()\n\n },\n beforeDestroy: function() {\n //console.log('beforeDestroy')\n\n let vo = this\n\n //clear\n vo.clear()\n\n },\n watch: {\n\n options: {\n deep: true,\n handler: function(nv, ov) {\n let vo = this\n\n //manualUpdate, 關閉自動重繪\n if (vo.manualUpdate) {\n return\n }\n\n //check\n if (!vo.chart) {\n return\n }\n\n //setOption, 參照改變(給予新物件)採整體置換, 原物件內變更採合併更新, 與vue-echarts語意一致\n vo.chart.setOption(nv || {}, { notMerge: nv !== ov, ...vo.updateOptions })\n\n },\n },\n\n theme: function() {\n this.reinit()\n },\n\n initOptions: {\n deep: true,\n handler: function() {\n this.reinit()\n },\n },\n\n group: function(nv) {\n let vo = this\n if (vo.chart) {\n vo.chart.group = nv || ''\n }\n },\n\n loading: function() {\n this.updateLoading()\n },\n\n loadingOptions: {\n deep: true,\n handler: function() {\n this.updateLoading()\n },\n },\n\n autoresize: function() {\n let vo = this\n vo.clearResize()\n vo.bindResize()\n },\n\n },\n computed: {\n },\n methods: {\n\n /**\n * 初始化圖表, 建立echarts實例並綁定事件, 讀取中動畫與尺寸監聽(內部使用)\n */\n init: function() {\n let vo = this\n\n //el\n let el = vo.$refs['$self']\n if (!el) {\n return\n }\n\n //init\n let chart = echarts.init(el, vo.theme || null, vo.initOptions || {})\n\n //chart, 掛this成非響應式屬性\n vo.chart = chart\n\n //group\n if (vo.group) {\n chart.group = vo.group\n }\n\n //setOption\n chart.setOption(vo.options || {}, vo.updateOptions || {})\n\n //事件轉發, 由$listeners綁定echarts事件, zr:前綴綁定zrender事件\n Object.keys(vo.$listeners || {}).forEach((key) => {\n\n //k, 剝除Vue事件修飾前綴(~為once, &為passive, !為capture)\n let k = key.replace(/^[~!&]+/, '')\n\n //fn\n let fn = vo.$listeners[key]\n\n //on\n if (k.indexOf('zr:') === 0) {\n chart.getZr().on(k.slice(3), fn)\n }\n else {\n chart.on(k, fn)\n }\n\n })\n\n //updateLoading\n vo.updateLoading()\n\n //bindResize\n vo.bindResize()\n\n },\n\n /**\n * 銷毀並重建圖表, 供theme或initOptions變更時使用(內部使用)\n */\n reinit: function() {\n let vo = this\n\n //clear\n vo.clear()\n\n //init\n vo.init()\n\n },\n\n /**\n * 更新讀取中動畫(內部使用)\n */\n updateLoading: function() {\n let vo = this\n\n //check\n if (!vo.chart) {\n return\n }\n\n //showLoading, hideLoading\n if (vo.loading) {\n vo.chart.showLoading('default', vo.loadingOptions || {})\n }\n else {\n vo.chart.hideLoading()\n }\n\n },\n\n /**\n * 綁定容器尺寸監聽, 尺寸改變時自動重繪(內部使用)\n */\n bindResize: function() {\n let vo = this\n\n //check\n if (!vo.autoresize || !vo.chart) {\n return\n }\n\n //el\n let el = vo.$refs['$self']\n if (!el) {\n return\n }\n\n //wait, onResize\n let opt = (vo.autoresize === true) ? {} : vo.autoresize\n let wait = Number.isFinite(opt.throttle) ? opt.throttle : 100\n let onResize = opt.onResize\n\n //callback, 重繪並通知外部\n let callback = () => {\n if (!vo.chart) {\n return\n }\n vo.chart.resize()\n if (typeof onResize === 'function') {\n onResize()\n }\n }\n if (wait > 0) {\n callback = throttle(callback, wait)\n }\n\n //resizeObserver, 掛this成非響應式屬性, 首次observe必觸發一次callback故跳過\n let bFirst = true\n vo.resizeObserver = new ResizeObserver(() => {\n if (bFirst) {\n bFirst = false\n return\n }\n callback()\n })\n vo.resizeObserver.observe(el)\n\n },\n\n /**\n * 解除容器尺寸監聽(內部使用)\n */\n clearResize: function() {\n let vo = this\n\n //disconnect\n if (vo.resizeObserver) {\n vo.resizeObserver.disconnect()\n vo.resizeObserver = null\n }\n\n },\n\n /**\n * 銷毀圖表與監聽(內部使用)\n */\n clear: function() {\n let vo = this\n\n //clearResize\n vo.clearResize()\n\n //dispose\n if (vo.chart) {\n vo.chart.dispose()\n vo.chart = null\n }\n\n },\n\n /**\n * 取得內部echarts實例, 供外部呼叫echarts原生方法(setOption, resize, getDataURL, dispatchAction等)之用\n * 因echarts實例於組件掛載後才建立, 故初始化前呼叫會回傳null\n *\n * @returns {Object|null} 回傳echarts實例物件, 若尚未初始化則回傳null\n */\n getChart: function() {\n let vo = this\n return vo.chart || null\n },\n\n },\n}\n<\/script>\n\n<style scoped>\n.w-echarts-vue {\n display: block;\n}\n</style>\n"]},media:void 0})},Eit,"data-v-1d2d622a",false,void 0,!1,Dit,void 0,void 0)});
|
|
30
|
+
//# sourceMappingURL=w-echarts-vue.umd.js.map
|