define(["gpui-style-inject","react","mobx"],(function(e,t,i){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var r=n(e),o=n(t),s=a(t);
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
function l(e,t,i,n){var a,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o);return r>3&&o&&Object.defineProperty(t,i,o),o}function u(e,t,i,n){return new(i||(i=Promise))((function(a,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function s(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))}r.default("html, body, #root {\n  width: 100%;\n  height: 100%;\n  margin: 0;\n  padding: 0;\n  overflow: hidden; }\n\n.g__index {\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  height: 100%; }\n");var h={content:"index-module_content__X-CgT",arrow:"index-module_arrow__OcRHH",line:"index-module_line__rOH59",mark:"index-module_mark__1VFHk",chart:"index-module_chart__PsaG3",chart__name:"index-module_chart__name__AHoju",chart__name__wrapper:"index-module_chart__name__wrapper__82yaz",total:"index-module_total__JzlgD",total__wrapper:"index-module_total__wrapper__ET66W",unit:"index-module_unit__IJg-D"};if(r.default(".index-module_content__X-CgT {\n  display: flex;\n  justify-content: space-around;\n  align-items: center;\n  box-sizing: border-box;\n  padding: 0 2%;\n  width: 100%;\n  height: 100%; }\n  .index-module_content__X-CgT .index-module_arrow__OcRHH {\n    margin-bottom: 14vh;\n    display: flex;\n    align-items: center;\n    width: 20vh; }\n    .index-module_content__X-CgT .index-module_arrow__OcRHH .index-module_line__rOH59 {\n      flex: 1;\n      height: 1vh; }\n    .index-module_content__X-CgT .index-module_arrow__OcRHH .index-module_mark__1VFHk {\n      border: 2vh solid transparent;\n      width: 0;\n      height: 0; }\n  .index-module_content__X-CgT .index-module_chart__PsaG3 {\n    width: 15vw;\n    height: 15vw;\n    overflow: hidden; }\n    .index-module_content__X-CgT .index-module_chart__name__AHoju {\n      margin-bottom: 4vh;\n      font-size: 4vh;\n      font-weight: 500; }\n      .index-module_content__X-CgT .index-module_chart__name__wrapper__82yaz {\n        text-align: center;\n        color: #cde0ff;\n        margin-top: 2vh; }\n        .index-module_content__X-CgT .index-module_chart__name__wrapper__82yaz .index-module_total__JzlgD {\n          position: relative;\n          bottom: -0.5vh;\n          padding-left: 2vh;\n          line-height: 5.5vh;\n          font-size: 5.5vh;\n          -webkit-text-fill-color: transparent;\n          -webkit-background-clip: text; }\n          .index-module_content__X-CgT .index-module_chart__name__wrapper__82yaz .index-module_total__wrapper__ET66W {\n            font-weight: 400;\n            font-size: 4vh; }\n        .index-module_content__X-CgT .index-module_chart__name__wrapper__82yaz .index-module_unit__IJg-D {\n          padding-left: 2vh;\n          font-size: 3.5vh;\n          -webkit-text-fill-color: transparent;\n          -webkit-background-clip: text; }\n"),!t.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!i.spy)throw new Error("mobx-react-lite requires mobx at least version 4 to be available");function c(){return c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},c.apply(this,arguments)}function d(){var e=t.useState(0)[1];return t.useCallback((function(){e((function(e){return e+1}))}),[])}function p(e){return i.getDependencyTree(e)}var f,g=1e4,m=1e4,v=new Set;function y(){void 0===f&&(f=setTimeout(x,m))}function x(){f=void 0;var e=Date.now();v.forEach((function(t){var i=t.current;i&&e>=i.cleanAt&&(i.reaction.dispose(),t.current=null,v.delete(t))})),v.size>0&&y()}var _={};function b(e){return"observer"+e}function w(e,t,n){void 0===t&&(t="observed"),void 0===n&&(n=_);var a,r=(n.useForceUpdate||d)(),s=o.default.useRef(null);if(!s.current){var l=new i.Reaction(b(t),(function(){u.mounted?r():(l.dispose(),s.current=null)})),u=function(e){return{cleanAt:Date.now()+g,reaction:e}}(l);s.current=u,a=s,v.add(a),y()}var h,c,f=s.current.reaction;if(o.default.useDebugValue(f,p),o.default.useEffect((function(){var e;return e=s,v.delete(e),s.current?s.current.mounted=!0:(s.current={reaction:new i.Reaction(b(t),(function(){r()})),cleanAt:1/0},r()),function(){s.current.reaction.dispose(),s.current=null}}),[]),f.track((function(){try{h=e()}catch(e){c=e}})),c)throw c;return h}function S(e,i){var n,a=c({forwardRef:!1},i),r=e.displayName||e.name,o=function(t,i){return w((function(){return e(t,i)}),r)};return o.displayName=r,n=a.forwardRef?t.memo(t.forwardRef(o)):t.memo(o),function(e,t){Object.keys(e).forEach((function(i){M[i]||Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}))}(e,n),n.displayName=r,n}var M={$$typeof:!0,render:!0,compare:!0,type:!0};function I(e){var t=e.children,i=e.render,n=t||i;return"function"!=typeof n?null:w(n)}function T(e,t,i,n,a){var r="children"===t?"render":"children",o="function"==typeof e[t],s="function"==typeof e[r];return o&&s?new Error("MobX Observer: Do not use children and render in the same time in`"+i):o||s?null:new Error("Invalid prop `"+a+"` of type `"+typeof e[t]+"` supplied to `"+i+"`, expected `function`.")}I.propTypes={children:T,render:T},I.displayName="Observer";var A=0;var C={};function D(e){return C[e]||(C[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+A+")";return A++,t}(e)),C[e]}function L(e,t){if(P(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(var a=0;a<i.length;a++)if(!Object.hasOwnProperty.call(t,i[a])||!P(e[i[a]],t[i[a]]))return!1;return!0}function P(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function k(e,t,i){Object.hasOwnProperty.call(e,t)?e[t]=i:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:i})}var O=D("patchMixins"),R=D("patchedDefinition");function E(e,t){for(var i=this,n=arguments.length,a=new Array(n>2?n-2:0),r=2;r<n;r++)a[r-2]=arguments[r];t.locks++;try{var o;return null!=e&&(o=e.apply(this,a)),o}finally{t.locks--,0===t.locks&&t.methods.forEach((function(e){e.apply(i,a)}))}}function N(e,t){return function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];E.call.apply(E,[this,e,t].concat(n))}}function z(e,t,i){var n=function(e,t){var i=e[O]=e[O]||{},n=i[t]=i[t]||{};return n.locks=n.locks||0,n.methods=n.methods||[],n}(e,t);n.methods.indexOf(i)<0&&n.methods.push(i);var a=Object.getOwnPropertyDescriptor(e,t);if(!a||!a[R]){var r=e[t],o=B(e,t,a?a.enumerable:void 0,n,r);Object.defineProperty(e,t,o)}}function B(e,t,i,n,a){var r,o=N(a,n);return(r={})[R]=!0,r.get=function(){return o},r.set=function(a){if(this===e)o=N(a,n);else{var r=B(this,t,i,n,a);Object.defineProperty(this,t,r)}},r.configurable=!0,r.enumerable=i,r}var V=i.$mobx||"$mobx",F=D("isUnmounted"),G=D("skipRender"),H=D("isForcingUpdate");function W(e){var i=e.prototype;if(i.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(e.__proto__!==t.PureComponent)if(i.shouldComponentUpdate){if(i.shouldComponentUpdate!==j)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}else i.shouldComponentUpdate=j;Z(i,"props"),Z(i,"state");var n=i.render;return i.render=function(){return U.call(this,n)},z(i,"componentWillUnmount",(function(){this.render[V]&&this.render[V].dispose(),this[F]=!0})),e}function U(e){var n=this;k(this,G,!1),k(this,H,!1);var a,r=(a=this).displayName||a.name||a.constructor&&(a.constructor.displayName||a.constructor.name)||"<component>",o=e.bind(this),s=!1,l=new i.Reaction(r+".render()",(function(){if(!s&&(s=!0,!0!==n[F])){var e=!0;try{k(n,H,!0),n[G]||t.Component.prototype.forceUpdate.call(n),e=!1}finally{k(n,H,!1),e&&l.dispose()}}}));function u(){s=!1;var e=void 0,t=void 0;if(l.track((function(){try{t=i._allowStateChanges(!1,o)}catch(t){e=t}})),e)throw e;return t}return l.reactComponent=this,u[V]=l,this.render=u,u.call(this)}function j(e,t){return this.state!==t||!L(this.props,e)}function Z(e,t){var n=D("reactProp_"+t+"_valueHolder"),a=D("reactProp_"+t+"_atomHolder");function r(){return this[a]||k(this,a,i.createAtom("reactive "+t)),this[a]}Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var e=!1;return i._allowStateReadsStart&&i._allowStateReadsEnd&&(e=i._allowStateReadsStart(!0)),r.call(this).reportObserved(),i._allowStateReadsStart&&i._allowStateReadsEnd&&i._allowStateReadsEnd(e),this[n]},set:function(e){this[H]||L(this[n],e)?k(this,n,e):(k(this,n,e),k(this,G,!0),r.call(this).reportChanged(),k(this,G,!1))}})}var Y="function"==typeof Symbol&&Symbol.for,X=Y?Symbol.for("react.forward_ref"):"function"==typeof t.forwardRef&&t.forwardRef((function(e){return null})).$$typeof,q=Y?Symbol.for("react.memo"):"function"==typeof t.memo&&t.memo((function(e){return null})).$$typeof;if(!t.Component)throw new Error("mobx-react requires React to be available");if(!i.observable)throw new Error("mobx-react requires mobx to be available");var $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function K(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function J(e){var t={exports:{}};return e(t,t.exports),t.exports}var Q=J((function(e,t){var i;i=function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var a=t[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}return i.m=e,i.c=t,i.p="",i(0)}([function(e,t,i){e.exports=i(1)},function(e,t,i){var n=i(2),a=i(3),r=i(4),o=i(22);function s(e){var t=new r(e),i=a(r.prototype.request,t);return n.extend(i,r.prototype,t),n.extend(i,t),i}var l=s(i(10));l.Axios=r,l.create=function(e){return s(o(l.defaults,e))},l.Cancel=i(23),l.CancelToken=i(24),l.isCancel=i(9),l.all=function(e){return Promise.all(e)},l.spread=i(25),e.exports=l,e.exports.default=l},function(e,t,i){var n=i(3),a=Object.prototype.toString;function r(e){return"[object Array]"===a.call(e)}function o(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function l(e){return"[object Function]"===a.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),r(e))for(var i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.call(null,e[a],a,e)}e.exports={isArray:r,isArrayBuffer:function(e){return"[object ArrayBuffer]"===a.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isUndefined:o,isDate:function(e){return"[object Date]"===a.call(e)},isFile:function(e){return"[object File]"===a.call(e)},isBlob:function(e){return"[object Blob]"===a.call(e)},isFunction:l,isStream:function(e){return s(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function i(i,n){"object"==typeof t[n]&&"object"==typeof i?t[n]=e(t[n],i):t[n]=i}for(var n=0,a=arguments.length;n<a;n++)u(arguments[n],i);return t},deepMerge:function e(){var t={};function i(i,n){"object"==typeof t[n]&&"object"==typeof i?t[n]=e(t[n],i):t[n]="object"==typeof i?e({},i):i}for(var n=0,a=arguments.length;n<a;n++)u(arguments[n],i);return t},extend:function(e,t,i){return u(t,(function(t,a){e[a]=i&&"function"==typeof t?n(t,i):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t){e.exports=function(e,t){return function(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];return e.apply(t,i)}}},function(e,t,i){var n=i(2),a=i(5),r=i(6),o=i(7),s=i(22);function l(e){this.defaults=e,this.interceptors={request:new r,response:new r}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[o,void 0],i=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)i=i.then(t.shift(),t.shift());return i},l.prototype.getUri=function(e){return e=s(this.defaults,e),a(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,i){return this.request(n.merge(i||{},{method:e,url:t}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,i,a){return this.request(n.merge(a||{},{method:e,url:t,data:i}))}})),e.exports=l},function(e,t,i){var n=i(2);function a(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,i){if(!t)return e;var r;if(i)r=i(t);else if(n.isURLSearchParams(t))r=t.toString();else{var o=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(a(t)+"="+a(e))})))})),r=o.join("&")}if(r){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}},function(e,t,i){var n=i(2);function a(){this.handlers=[]}a.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},a.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},a.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=a},function(e,t,i){var n=i(2),a=i(8),r=i(9),o=i(10);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=a(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return s(e),t.data=a(t.data,t.headers,e.transformResponse),t}),(function(t){return r(t)||(s(e),t&&t.response&&(t.response.data=a(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,i){var n=i(2);e.exports=function(e,t,i){return n.forEach(i,(function(i){e=i(e,t)})),e}},function(e,t){e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,i){var n=i(2),a=i(11),r={"Content-Type":"application/x-www-form-urlencoded"};function o(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,l={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(s=i(12)),s),transformRequest:[function(e,t){return a(t,"Accept"),a(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(o(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(o(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){l.headers[e]=n.merge(r)})),e.exports=l},function(e,t,i){var n=i(2);e.exports=function(e,t){n.forEach(e,(function(i,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[n])}))}},function(e,t,i){var n=i(2),a=i(13),r=i(5),o=i(16),s=i(19),l=i(20),u=i(14);e.exports=function(e){return new Promise((function(t,h){var c=e.data,d=e.headers;n.isFormData(c)&&delete d["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var f=e.auth.username||"",g=e.auth.password||"";d.Authorization="Basic "+btoa(f+":"+g)}var m=o(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),r(m,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var i="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:i,config:e,request:p};a(t,h,n),p=null}},p.onabort=function(){p&&(h(u("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){h(u("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),h(u(t,e,"ECONNABORTED",p)),p=null},n.isStandardBrowserEnv()){var v=i(21),y=(e.withCredentials||l(m))&&e.xsrfCookieName?v.read(e.xsrfCookieName):void 0;y&&(d[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&n.forEach(d,(function(e,t){void 0===c&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),h(e),p=null)})),void 0===c&&(c=null),p.send(c)}))}},function(e,t,i){var n=i(14);e.exports=function(e,t,i){var a=i.config.validateStatus;!a||a(i.status)?e(i):t(n("Request failed with status code "+i.status,i.config,null,i.request,i))}},function(e,t,i){var n=i(15);e.exports=function(e,t,i,a,r){var o=new Error(e);return n(o,t,i,a,r)}},function(e,t){e.exports=function(e,t,i,n,a){return e.config=t,i&&(e.code=i),e.request=n,e.response=a,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,i){var n=i(17),a=i(18);e.exports=function(e,t){return e&&!n(t)?a(e,t):t}},function(e,t){e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,i){var n=i(2),a=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,i,r,o={};return e?(n.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=n.trim(e.substr(0,r)).toLowerCase(),i=n.trim(e.substr(r+1)),t){if(o[t]&&a.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([i]):o[t]?o[t]+", "+i:i}})),o):o}},function(e,t,i){var n=i(2);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function a(e){var n=e;return t&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return e=a(window.location.href),function(t){var i=n.isString(t)?a(t):t;return i.protocol===e.protocol&&i.host===e.host}}():function(){return!0}},function(e,t,i){var n=i(2);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,i,a,r,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),n.isString(a)&&s.push("path="+a),n.isString(r)&&s.push("domain="+r),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,i){var n=i(2);e.exports=function(e,t){t=t||{};var i={},a=["url","method","params","data"],r=["headers","auth","proxy"],o=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];n.forEach(a,(function(e){void 0!==t[e]&&(i[e]=t[e])})),n.forEach(r,(function(a){n.isObject(t[a])?i[a]=n.deepMerge(e[a],t[a]):void 0!==t[a]?i[a]=t[a]:n.isObject(e[a])?i[a]=n.deepMerge(e[a]):void 0!==e[a]&&(i[a]=e[a])})),n.forEach(o,(function(n){void 0!==t[n]?i[n]=t[n]:void 0!==e[n]&&(i[n]=e[n])}));var s=a.concat(r).concat(o),l=Object.keys(t).filter((function(e){return-1===s.indexOf(e)}));return n.forEach(l,(function(n){void 0!==t[n]?i[n]=t[n]:void 0!==e[n]&&(i[n]=e[n])})),i}},function(e,t){function i(e){this.message=e}i.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},i.prototype.__CANCEL__=!0,e.exports=i},function(e,t,i){var n=i(23);function a(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var i=this;e((function(e){i.reason||(i.reason=new n(e),t(i.reason))}))}a.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},a.source=function(){var e;return{token:new a((function(t){e=t})),cancel:e}},e.exports=a},function(e,t){e.exports=function(e){return function(t){return e.apply(null,t)}}}])},e.exports=i()}));"undefined"!=typeof window||void 0!==$&&$.__DEV__;var ee=2311;var te=function(){return ee++};var ie="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(e){var t={},i={},n=e.match(/Firefox\/([\d.]+)/),a=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),r=e.match(/Edge\/([\d.]+)/),o=/micromessenger/i.test(e);n&&(i.firefox=!0,i.version=n[1]);a&&(i.ie=!0,i.version=a[1]);r&&(i.edge=!0,i.version=r[1]);o&&(i.weChat=!0);return{browser:i,os:t,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!i.ie&&!i.edge,pointerEventsSupported:"onpointerdown"in window&&(i.edge||i.ie&&i.version>=11),domSupported:"undefined"!=typeof document}}(navigator.userAgent),ne={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},ae={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},re=Object.prototype.toString,oe=Array.prototype,se=oe.forEach,le=oe.filter,ue=oe.slice,he=oe.map,ce=oe.reduce,de={};function pe(e){if(null==e||"object"!=typeof e)return e;var t=e,i=re.call(e);if("[object Array]"===i){if(!Ie(e)){t=[];for(var n=0,a=e.length;n<a;n++)t[n]=pe(e[n])}}else if(ae[i]){if(!Ie(e)){var r=e.constructor;if(e.constructor.from)t=r.from(e);else{t=new r(e.length);for(n=0,a=e.length;n<a;n++)t[n]=pe(e[n])}}}else if(!ne[i]&&!Ie(e)&&!Se(e))for(var o in t={},e)e.hasOwnProperty(o)&&(t[o]=pe(e[o]));return t}function fe(e,t,i){if(!be(t)||!be(e))return i?pe(t):e;for(var n in t)if(t.hasOwnProperty(n)){var a=e[n],r=t[n];!be(r)||!be(a)||_e(r)||_e(a)||Se(r)||Se(a)||we(r)||we(a)||Ie(r)||Ie(a)?!i&&n in e||(e[n]=pe(t[n])):fe(a,r,i)}return e}function ge(e,t,i){for(var n in t)t.hasOwnProperty(n)&&(i?null!=t[n]:null==e[n])&&(e[n]=t[n]);return e}var me,ve=function(){return de.createCanvas()};function ye(e,t,i){if(e&&t)if(e.forEach&&e.forEach===se)e.forEach(t,i);else if(e.length===+e.length)for(var n=0,a=e.length;n<a;n++)t.call(i,e[n],n,e);else for(var r in e)e.hasOwnProperty(r)&&t.call(i,e[r],r,e)}function xe(e,t){var i=ue.call(arguments,2);return function(){return e.apply(t,i.concat(ue.call(arguments)))}}function _e(e){return"[object Array]"===re.call(e)}function be(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function we(e){return!!ne[re.call(e)]}function Se(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}de.createCanvas=function(){return document.createElement("canvas")};var Me="__ec_primitive__";function Ie(e){return e[Me]}function Te(e){var t=_e(e);this.data={};var i=this;function n(e,n){t?i.set(e,n):i.set(n,e)}e instanceof Te?e.each(n):e&&ye(e,n)}Te.prototype={constructor:Te,get:function(e){return this.data.hasOwnProperty(e)?this.data[e]:null},set:function(e,t){return this.data[e]=t},each:function(e,t){for(var i in void 0!==t&&(e=xe(e,t)),this.data)this.data.hasOwnProperty(i)&&e(this.data[i],i)},removeKey:function(e){delete this.data[e]}};var Ae=function(e,t){for(var i=e[0],n=1,a=e.length;n<a;n++)i=fe(i,e[n],t);return i},Ce=function(e,t){if(e){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i}return-1},De=function(e,t){var i=e.prototype;function n(){}for(var a in n.prototype=t.prototype,e.prototype=new n,i)i.hasOwnProperty(a)&&(e.prototype[a]=i[a]);e.prototype.constructor=e,e.superClass=t},Le=function(e,t,i){if(e&&t){if(e.map&&e.map===he)return e.map(t,i);for(var n=[],a=0,r=e.length;a<r;a++)n.push(t.call(i,e[a],a,e));return n}},Pe=function(e,t,i,n){if(e&&t){if(e.reduce&&e.reduce===ce)return e.reduce(t,i,n);for(var a=0,r=e.length;a<r;a++)i=t.call(n,i,e[a],a,e);return i}},ke=function(e,t,i){if(e&&t){if(e.filter&&e.filter===le)return e.filter(t,i);for(var n=[],a=0,r=e.length;a<r;a++)t.call(i,e[a],a,e)&&n.push(e[a]);return n}},Oe=function(e,t,i){if(e&&t)for(var n=0,a=e.length;n<a;n++)if(t.call(i,e[n],n,e))return e[n]},Re=function(e){var t=ue.call(arguments,1);return function(){return e.apply(this,t.concat(ue.call(arguments)))}},Ee=function(e){for(var t=0,i=arguments.length;t<i;t++)if(null!=arguments[t])return arguments[t]},Ne=function(){return Function.call.apply(ue,arguments)},ze=function(e){if("number"==typeof e)return[e,e,e,e];var t=e.length;return 2===t?[e[0],e[1],e[0],e[1]]:3===t?[e[0],e[1],e[2],e[1]]:e},Be=function(e,t){for(var i=new e.constructor(e.length+t.length),n=0;n<e.length;n++)i[n]=e[n];var a=e.length;for(n=0;n<t.length;n++)i[n+a]=t[n];return i},Ve={$override:function(e,t){"createCanvas"===e&&(me=null),de[e]=t},clone:pe,merge:fe,mergeAll:Ae,extend:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},defaults:ge,createCanvas:ve,getContext:function(){return me||(me=ve().getContext("2d")),me},indexOf:Ce,inherits:De,mixin:function(e,t,i){ge(e="prototype"in e?e.prototype:e,t="prototype"in t?t.prototype:t,i)},isArrayLike:function(e){if(e)return"string"!=typeof e&&"number"==typeof e.length},each:ye,map:Le,reduce:Pe,filter:ke,find:Oe,bind:xe,curry:Re,isArray:_e,isFunction:function(e){return"function"==typeof e},isString:function(e){return"[object String]"===re.call(e)},isObject:be,isBuiltInObject:we,isTypedArray:function(e){return!!ae[re.call(e)]},isDom:Se,eqNaN:function(e){return e!=e},retrieve:Ee,retrieve2:function(e,t){return null!=e?e:t},retrieve3:function(e,t,i){return null!=e?e:null!=t?t:i},slice:Ne,normalizeCssArray:ze,assert:function(e,t){if(!e)throw new Error(t)},trim:function(e){return null==e?null:"function"==typeof e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},setAsPrimitive:function(e){e[Me]=!0},isPrimitive:Ie,createHashMap:function(e){return new Te(e)},concatArray:Be,noop:function(){}},Fe="undefined"==typeof Float32Array?Array:Float32Array;function Ge(e){return Math.sqrt(He(e))}function He(e){return e[0]*e[0]+e[1]*e[1]}function We(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}function Ue(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var je=function(e,t){var i=new Fe(2);return null==e&&(e=0),null==t&&(t=0),i[0]=e,i[1]=t,i},Ze=function(e,t){return e[0]=t[0],e[1]=t[1],e},Ye=function(e){var t=new Fe(2);return t[0]=e[0],t[1]=e[1],t},Xe=function(e,t,i){return e[0]=t,e[1]=i,e},qe=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},$e=function(e,t,i,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},Ke=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},Je=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},Qe=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},et=function(e,t){return e[0]*t[0]+e[1]*t[1]},tt=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},it=function(e,t){var i=Ge(t);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e},nt=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},at=function(e,t,i,n){return e[0]=t[0]+n*(i[0]-t[0]),e[1]=t[1]+n*(i[1]-t[1]),e},rt=function(e,t,i){var n=t[0],a=t[1];return e[0]=i[0]*n+i[2]*a+i[4],e[1]=i[1]*n+i[3]*a+i[5],e},ot=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},st=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e},lt={create:je,copy:Ze,clone:Ye,set:Xe,add:qe,scaleAndAdd:$e,sub:Ke,len:Ge,length:Ge,lenSquare:He,lengthSquare:He,mul:Je,div:Qe,dot:et,scale:tt,normalize:it,distance:We,dist:We,distanceSquare:Ue,distSquare:Ue,negate:nt,lerp:at,applyTransform:rt,min:ot,max:st};function ut(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}function ht(e,t){return{target:e,topTarget:t&&t.topTarget}}ut.prototype={constructor:ut,_dragStart:function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.dispatchToElement(ht(t,e),"dragstart",e.event))},_drag:function(e){var t=this._draggingTarget;if(t){var i=e.offsetX,n=e.offsetY,a=i-this._x,r=n-this._y;this._x=i,this._y=n,t.drift(a,r,e),this.dispatchToElement(ht(t,e),"drag",e.event);var o=this.findHover(i,n,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.dispatchToElement(ht(s,e),"dragleave",e.event),o&&o!==s&&this.dispatchToElement(ht(o,e),"dragenter",e.event))}},_dragEnd:function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.dispatchToElement(ht(t,e),"dragend",e.event),this._dropTarget&&this.dispatchToElement(ht(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null}};var ct=ut,dt=Array.prototype.slice,pt=function(e){this._$handlers={},this._$eventProcessor=e};function ft(e,t,i,n,a,r){var o=e._$handlers;if("function"==typeof i&&(a=n,n=i,i=null),!n||!t)return e;i=function(e,t){var i=e._$eventProcessor;return null!=t&&i&&i.normalizeQuery&&(t=i.normalizeQuery(t)),t}(e,i),o[t]||(o[t]=[]);for(var s=0;s<o[t].length;s++)if(o[t][s].h===n)return e;var l={h:n,one:r,query:i,ctx:a||e,callAtLast:n.zrEventfulCallAtLast},u=o[t].length-1,h=o[t][u];return h&&h.callAtLast?o[t].splice(u,0,l):o[t].push(l),e}pt.prototype={constructor:pt,one:function(e,t,i,n){return ft(this,e,t,i,n,!0)},on:function(e,t,i,n){return ft(this,e,t,i,n,!1)},isSilent:function(e){var t=this._$handlers;return!t[e]||!t[e].length},off:function(e,t){var i=this._$handlers;if(!e)return this._$handlers={},this;if(t){if(i[e]){for(var n=[],a=0,r=i[e].length;a<r;a++)i[e][a].h!==t&&n.push(i[e][a]);i[e]=n}i[e]&&0===i[e].length&&delete i[e]}else delete i[e];return this},trigger:function(e){var t=this._$handlers[e],i=this._$eventProcessor;if(t){var n=arguments,a=n.length;a>3&&(n=dt.call(n,1));for(var r=t.length,o=0;o<r;){var s=t[o];if(i&&i.filter&&null!=s.query&&!i.filter(e,s.query))o++;else{switch(a){case 1:s.h.call(s.ctx);break;case 2:s.h.call(s.ctx,n[1]);break;case 3:s.h.call(s.ctx,n[1],n[2]);break;default:s.h.apply(s.ctx,n)}s.one?(t.splice(o,1),r--):o++}}}return i&&i.afterTrigger&&i.afterTrigger(e),this},triggerWithContext:function(e){var t=this._$handlers[e],i=this._$eventProcessor;if(t){var n=arguments,a=n.length;a>4&&(n=dt.call(n,1,n.length-1));for(var r=n[n.length-1],o=t.length,s=0;s<o;){var l=t[s];if(i&&i.filter&&null!=l.query&&!i.filter(e,l.query))s++;else{switch(a){case 1:l.h.call(r);break;case 2:l.h.call(r,n[1]);break;case 3:l.h.call(r,n[1],n[2]);break;default:l.h.apply(r,n)}l.one?(t.splice(s,1),o--):s++}}}return i&&i.afterTrigger&&i.afterTrigger(e),this}};var gt=pt,mt=Math.log(2);function vt(e,t,i,n,a,r){var o=n+"-"+a,s=e.length;if(r.hasOwnProperty(o))return r[o];if(1===t){var l=Math.round(Math.log((1<<s)-1&~a)/mt);return e[i][l]}for(var u=n|1<<i,h=i+1;n&1<<h;)h++;for(var c=0,d=0,p=0;d<s;d++){var f=1<<d;f&a||(c+=(p%2?-1:1)*e[i][d]*vt(e,t-1,h,u,a|f,r),p++)}return r[o]=c,c}var yt=function(e,t){var i=[[e[0],e[1],1,0,0,0,-t[0]*e[0],-t[0]*e[1]],[0,0,0,e[0],e[1],1,-t[1]*e[0],-t[1]*e[1]],[e[2],e[3],1,0,0,0,-t[2]*e[2],-t[2]*e[3]],[0,0,0,e[2],e[3],1,-t[3]*e[2],-t[3]*e[3]],[e[4],e[5],1,0,0,0,-t[4]*e[4],-t[4]*e[5]],[0,0,0,e[4],e[5],1,-t[5]*e[4],-t[5]*e[5]],[e[6],e[7],1,0,0,0,-t[6]*e[6],-t[6]*e[7]],[0,0,0,e[6],e[7],1,-t[7]*e[6],-t[7]*e[7]]],n={},a=vt(i,8,0,0,0,n);if(0!==a){for(var r=[],o=0;o<8;o++)for(var s=0;s<8;s++)null==r[s]&&(r[s]=0),r[s]+=((o+s)%2?-1:1)*vt(i,7,0===o?1:0,1<<o,1<<s,n)/a*t[o];return function(e,t,i){var n=t*r[6]+i*r[7]+1;e[0]=(t*r[0]+i*r[1]+r[2])/n,e[1]=(t*r[3]+i*r[4]+r[5])/n}}},xt={buildTransformer:yt}.buildTransformer,_t="___zrEVENTSAVED",bt=[];function wt(e,t,i,n,a){if(t.getBoundingClientRect&&ie.domSupported&&!St(t)){var r=t[_t]||(t[_t]={}),o=function(e,t){var i=t.markers;if(i)return i;i=t.markers=[];for(var n=["left","right"],a=["top","bottom"],r=0;r<4;r++){var o=document.createElement("div"),s=r%2,l=(r>>1)%2;o.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[s]+":0",a[l]+":0",n[1-s]+":auto",a[1-l]+":auto",""].join("!important;"),e.appendChild(o),i.push(o)}return i}(t,r),s=function(e,t,i){for(var n=i?"invTrans":"trans",a=t[n],r=t.srcCoords,o=!0,s=[],l=[],u=0;u<4;u++){var h=e[u].getBoundingClientRect(),c=2*u,d=h.left,p=h.top;s.push(d,p),o=o&&r&&d===r[c]&&p===r[c+1],l.push(e[u].offsetLeft,e[u].offsetTop)}return o&&a?a:(t.srcCoords=s,t[n]=i?xt(l,s):xt(s,l))}(o,r,a);if(s)return s(e,i,n),!0}return!1}function St(e){return"CANVAS"===e.nodeName.toUpperCase()}var Mt=function(e,t,i,n,a){return wt(bt,t,n,a,!0)&&wt(e,i,bt[0],bt[1])},It={transformLocalCoord:Mt,transformCoordWithViewport:wt,isCanvasEl:St},Tt=gt,At=It.isCanvasEl,Ct=It.transformCoordWithViewport,Dt="undefined"!=typeof window&&!!window.addEventListener,Lt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Pt=[];function kt(e,t,i,n){return i=i||{},n||!ie.canvasSupported?Ot(e,t,i):ie.browser.firefox&&null!=t.layerX&&t.layerX!==t.offsetX?(i.zrX=t.layerX,i.zrY=t.layerY):null!=t.offsetX?(i.zrX=t.offsetX,i.zrY=t.offsetY):Ot(e,t,i),i}function Ot(e,t,i){if(ie.domSupported&&e.getBoundingClientRect){var n=t.clientX,a=t.clientY;if(At(e)){var r=e.getBoundingClientRect();return i.zrX=n-r.left,void(i.zrY=a-r.top)}if(Ct(Pt,e,n,a))return i.zrX=Pt[0],void(i.zrY=Pt[1])}i.zrX=i.zrY=0}function Rt(e){return e||window.event}var Et={Dispatcher:Tt,clientToLocal:kt,getNativeEvent:Rt,normalizeEvent:function(e,t,i){if(null!=(t=Rt(t)).zrX)return t;var n=t.type;if(n&&n.indexOf("touch")>=0){var a="touchend"!==n?t.targetTouches[0]:t.changedTouches[0];a&&kt(e,a,t,i)}else kt(e,t,t,i),t.zrDelta=t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3;var r=t.button;return null==t.which&&void 0!==r&&Lt.test(t.type)&&(t.which=1&r?1:2&r?3:4&r?2:0),t},addEventListener:function(e,t,i,n){Dt?e.addEventListener(t,i,n):e.attachEvent("on"+t,i)},removeEventListener:function(e,t,i,n){Dt?e.removeEventListener(t,i,n):e.detachEvent("on"+t,i)},stop:Dt?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0},isMiddleOrRightButtonOnMouseUpDown:function(e){return 2===e.which||3===e.which},notLeftMouse:function(e){return e.which>1}},Nt=function(){this._track=[]};function zt(e){var t=e[1][0]-e[0][0],i=e[1][1]-e[0][1];return Math.sqrt(t*t+i*i)}Nt.prototype={constructor:Nt,recognize:function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},clear:function(){return this._track.length=0,this},_doTrack:function(e,t,i){var n=e.touches;if(n){for(var a={points:[],touches:[],target:t,event:e},r=0,o=n.length;r<o;r++){var s=n[r],l=Et.clientToLocal(i,s,{});a.points.push([l.zrX,l.zrY]),a.touches.push(s)}this._track.push(a)}},_recognize:function(e){for(var t in Bt)if(Bt.hasOwnProperty(t)){var i=Bt[t](this._track,e);if(i)return i}}};var Bt={pinch:function(e,t){var i=e.length;if(i){var n,a=(e[i-1]||{}).points,r=(e[i-2]||{}).points||a;if(r&&r.length>1&&a&&a.length>1){var o=zt(a)/zt(r);!isFinite(o)&&(o=1),t.pinchScale=o;var s=[((n=a)[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2];return t.pinchX=s[0],t.pinchY=s[1],{type:"pinch",target:e[0].target,event:t}}}}},Vt=Nt,Ft="silent";function Gt(){Et.stop(this.event)}function Ht(){}Ht.prototype.dispose=function(){};var Wt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Ut=function(e,t,i,n){gt.call(this),this.storage=e,this.painter=t,this.painterRoot=n,i=i||new Ht,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,ct.call(this),this.setHandlerProxy(i)};function jt(e,t,i){if(e[e.rectHover?"rectContain":"contain"](t,i)){for(var n,a=e;a;){if(a.clipPath&&!a.clipPath.contain(t,i))return!1;a.silent&&(n=!0),a=a.parent}return!n||Ft}return!1}function Zt(e,t,i){var n=e.painter;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}Ut.prototype={constructor:Ut,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(Ve.each(Wt,(function(t){e.on&&e.on(t,this[t],this)}),this),e.handler=this),this.proxy=e},mousemove:function(e){var t=e.zrX,i=e.zrY,n=Zt(this,t,i),a=this._hovered,r=a.target;r&&!r.__zr&&(r=(a=this.findHover(a.x,a.y)).target);var o=this._hovered=n?{x:t,y:i}:this.findHover(t,i),s=o.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),r&&s!==r&&this.dispatchToElement(a,"mouseout",e),this.dispatchToElement(o,"mousemove",e),s&&s!==r&&this.dispatchToElement(o,"mouseover",e)},mouseout:function(e){var t=e.zrEventControl,i=e.zrIsToLocalDOM;"only_globalout"!==t&&this.dispatchToElement(this._hovered,"mouseout",e),"no_globalout"!==t&&!i&&this.trigger("globalout",{type:"globalout",event:e})},resize:function(e){this._hovered={}},dispatch:function(e,t){var i=this[e];i&&i.call(this,t)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},dispatchToElement:function(e,t,i){var n=(e=e||{}).target;if(!n||!n.silent){for(var a="on"+t,r=function(e,t,i){return{type:e,event:i,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:Gt}}(t,e,i);n&&(n[a]&&(r.cancelBubble=n[a].call(n,r)),n.trigger(t,r),n=n.parent,!r.cancelBubble););r.cancelBubble||(this.trigger(t,r),this.painter&&this.painter.eachOtherLayer((function(e){"function"==typeof e[a]&&e[a].call(e,r),e.trigger&&e.trigger(t,r)})))}},findHover:function(e,t,i){for(var n=this.storage.getDisplayList(),a={x:e,y:t},r=n.length-1;r>=0;r--){var o;if(n[r]!==i&&!n[r].ignore&&(o=jt(n[r],e,t))&&(!a.topTarget&&(a.topTarget=n[r]),o!==Ft)){a.target=n[r];break}}return a},processGesture:function(e,t){this._gestureMgr||(this._gestureMgr=new Vt);var i=this._gestureMgr;"start"===t&&i.clear();var n=i.recognize(e,this.findHover(e.zrX,e.zrY,null).target,this.proxy.dom);if("end"===t&&i.clear(),n){var a=n.type;e.gestureEvent=a,this.dispatchToElement({target:n.target},a,n.event)}}},Ve.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Ut.prototype[e]=function(t){var i,n,a=t.zrX,r=t.zrY,o=Zt(this,a,r);if("mouseup"===e&&o||(n=(i=this.findHover(a,r)).target),"mousedown"===e)this._downEl=n,this._downPoint=[t.zrX,t.zrY],this._upEl=n;else if("mouseup"===e)this._upEl=n;else if("click"===e){if(this._downEl!==this._upEl||!this._downPoint||lt.dist(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,e,t)}})),Ve.mixin(Ut,gt),Ve.mixin(Ut,ct);var Yt=Ut,Xt="undefined"==typeof Float32Array?Array:Float32Array;function qt(){var e=new Xt(6);return $t(e),e}function $t(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function Kt(e,t){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}var Jt=function(e,t,i){var n=t[0]*i[0]+t[2]*i[1],a=t[1]*i[0]+t[3]*i[1],r=t[0]*i[2]+t[2]*i[3],o=t[1]*i[2]+t[3]*i[3],s=t[0]*i[4]+t[2]*i[5]+t[4],l=t[1]*i[4]+t[3]*i[5]+t[5];return e[0]=n,e[1]=a,e[2]=r,e[3]=o,e[4]=s,e[5]=l,e},Qt=function(e,t,i){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+i[0],e[5]=t[5]+i[1],e},ei=function(e,t,i){var n=t[0],a=t[2],r=t[4],o=t[1],s=t[3],l=t[5],u=Math.sin(i),h=Math.cos(i);return e[0]=n*h+o*u,e[1]=-n*u+o*h,e[2]=a*h+s*u,e[3]=-a*u+h*s,e[4]=h*r+u*l,e[5]=h*l-u*r,e},ti=function(e,t,i){var n=i[0],a=i[1];return e[0]=t[0]*n,e[1]=t[1]*a,e[2]=t[2]*n,e[3]=t[3]*a,e[4]=t[4]*n,e[5]=t[5]*a,e},ii=function(e,t){var i=t[0],n=t[2],a=t[4],r=t[1],o=t[3],s=t[5],l=i*o-r*n;return l?(l=1/l,e[0]=o*l,e[1]=-r*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*s-o*a)*l,e[5]=(r*a-i*s)*l,e):null},ni={create:qt,identity:$t,copy:Kt,mul:Jt,translate:Qt,rotate:ei,scale:ti,invert:ii,clone:function(e){var t=qt();return Kt(t,e),t}},ai=ni.identity,ri=5e-5;function oi(e){return e>ri||e<-5e-5}var si=function(e){(e=e||{}).position||(this.position=[0,0]),null==e.rotation&&(this.rotation=0),e.scale||(this.scale=[1,1]),this.origin=this.origin||null},li=si.prototype;li.transform=null,li.needLocalTransform=function(){return oi(this.rotation)||oi(this.position[0])||oi(this.position[1])||oi(this.scale[0]-1)||oi(this.scale[1]-1)};var ui=[];li.updateTransform=function(){var e=this.parent,t=e&&e.transform,i=this.needLocalTransform(),n=this.transform;if(i||t){n=n||ni.create(),i?this.getLocalTransform(n):ai(n),t&&(i?ni.mul(n,e.transform,n):ni.copy(n,e.transform)),this.transform=n;var a=this.globalScaleRatio;if(null!=a&&1!==a){this.getGlobalScale(ui);var r=ui[0]<0?-1:1,o=ui[1]<0?-1:1,s=((ui[0]-r)*a+r)/ui[0]||0,l=((ui[1]-o)*a+o)/ui[1]||0;n[0]*=s,n[1]*=s,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||ni.create(),ni.invert(this.invTransform,n)}else n&&ai(n)},li.getLocalTransform=function(e){return si.getLocalTransform(this,e)},li.setTransform=function(e){var t=this.transform,i=e.dpr||1;t?e.setTransform(i*t[0],i*t[1],i*t[2],i*t[3],i*t[4],i*t[5]):e.setTransform(i,0,0,i,0,0)},li.restoreTransform=function(e){var t=e.dpr||1;e.setTransform(t,0,0,t,0,0)};var hi=[],ci=ni.create();li.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=this.position,a=this.scale;oi(t-1)&&(t=Math.sqrt(t)),oi(i-1)&&(i=Math.sqrt(i)),e[0]<0&&(t=-t),e[3]<0&&(i=-i),n[0]=e[4],n[1]=e[5],a[0]=t,a[1]=i,this.rotation=Math.atan2(-e[1]/i,e[0]/t)}},li.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(ni.mul(hi,e.invTransform,t),t=hi);var i=this.origin;i&&(i[0]||i[1])&&(ci[4]=i[0],ci[5]=i[1],ni.mul(hi,t,ci),hi[4]-=i[0],hi[5]-=i[1],t=hi),this.setLocalTransform(t)}},li.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},li.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&lt.applyTransform(i,i,n),i},li.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&lt.applyTransform(i,i,n),i},si.getLocalTransform=function(e,t){ai(t=t||[]);var i=e.origin,n=e.scale||[1,1],a=e.rotation||0,r=e.position||[0,0];return i&&(t[4]-=i[0],t[5]-=i[1]),ni.scale(t,t,n),a&&ni.rotate(t,t,a),i&&(t[4]+=i[0],t[5]+=i[1]),t[4]+=r[0],t[5]+=r[1],t};var di=si,pi={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},exponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},exponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/.4))},elasticOut:function(e){var t,i=.1;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/.4)+1)},elasticInOut:function(e){var t,i=.1,n=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=.1):t=n*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-pi.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?.5*pi.bounceIn(2*e):.5*pi.bounceOut(2*e-1)+.5}},fi=pi;function gi(e){this._target=e.target,this._life=e.life||1e3,this._delay=e.delay||0,this._initialized=!1,this.loop=null!=e.loop&&e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart,this._pausedTime=0,this._paused=!1}gi.prototype={constructor:gi,step:function(e,t){if(this._initialized||(this._startTime=e+this._delay,this._initialized=!0),this._paused)this._pausedTime+=t;else{var i=(e-this._startTime-this._pausedTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n=this.easing,a="string"==typeof n?fi[n]:n,r="function"==typeof a?a(i):i;return this.fire("frame",r),1===i?this.loop?(this.restart(e),"restart"):(this._needsRemove=!0,"destroy"):null}}},restart:function(e){var t=(e-this._startTime-this._pausedTime)%this._life;this._startTime=e-t+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(e,t){this[e="on"+e]&&this[e](this._target,t)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var mi=gi,vi=function(){this.head=null,this.tail=null,this._len=0},yi=vi.prototype;yi.insert=function(e){var t=new xi(e);return this.insertEntry(t),t},yi.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},yi.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},yi.len=function(){return this._len},yi.clear=function(){this.head=this.tail=null,this._len=0};var xi=function(e){this.value=e,this.next,this.prev},_i=function(e){this._list=new vi,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null},bi=_i.prototype;bi.put=function(e,t){var i=this._list,n=this._map,a=null;if(null==n[e]){var r=i.len(),o=this._lastRemovedEntry;if(r>=this._maxSize&&r>0){var s=i.head;i.remove(s),delete n[s.key],a=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new xi(t),o.key=e,i.insertEntry(o),n[e]=o}return a},bi.get=function(e){var t=this._map[e],i=this._list;if(null!=t)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},bi.clear=function(){this._list.clear(),this._map={}};var wi=_i,Si={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 Mi(e){return(e=Math.round(e))<0?0:e>255?255:e}function Ii(e){return e<0?0:e>1?1:e}function Ti(e){return e.length&&"%"===e.charAt(e.length-1)?Mi(parseFloat(e)/100*255):Mi(parseInt(e,10))}function Ai(e){return e.length&&"%"===e.charAt(e.length-1)?Ii(parseFloat(e)/100):Ii(parseFloat(e))}function Ci(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function Di(e,t,i){return e+(t-e)*i}function Li(e,t,i,n,a){return e[0]=t,e[1]=i,e[2]=n,e[3]=a,e}function Pi(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var ki=new wi(20),Oi=null;function Ri(e,t){Oi&&Pi(Oi,t),Oi=ki.put(e,Oi||t.slice())}function Ei(e,t){if(e){t=t||[];var i=ki.get(e);if(i)return Pi(t,i);var n,a=(e+="").replace(/ /g,"").toLowerCase();if(a in Si)return Pi(t,Si[a]),Ri(e,t),t;if("#"===a.charAt(0))return 4===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=4095?(Li(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),Ri(e,t),t):void Li(t,0,0,0,1):7===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=16777215?(Li(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),Ri(e,t),t):void Li(t,0,0,0,1):void 0;var r=a.indexOf("("),o=a.indexOf(")");if(-1!==r&&o+1===a.length){var s=a.substr(0,r),l=a.substr(r+1,o-(r+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Li(t,0,0,0,1);u=Ai(l.pop());case"rgb":return 3!==l.length?void Li(t,0,0,0,1):(Li(t,Ti(l[0]),Ti(l[1]),Ti(l[2]),u),Ri(e,t),t);case"hsla":return 4!==l.length?void Li(t,0,0,0,1):(l[3]=Ai(l[3]),Ni(l,t),Ri(e,t),t);case"hsl":return 3!==l.length?void Li(t,0,0,0,1):(Ni(l,t),Ri(e,t),t);default:return}}Li(t,0,0,0,1)}}function Ni(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=Ai(e[1]),a=Ai(e[2]),r=a<=.5?a*(n+1):a+n-a*n,o=2*a-r;return Li(t=t||[],Mi(255*Ci(o,r,i+1/3)),Mi(255*Ci(o,r,i)),Mi(255*Ci(o,r,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function zi(e,t,i){if(t&&t.length&&e>=0&&e<=1){i=i||[];var n=e*(t.length-1),a=Math.floor(n),r=Math.ceil(n),o=t[a],s=t[r],l=n-a;return i[0]=Mi(Di(o[0],s[0],l)),i[1]=Mi(Di(o[1],s[1],l)),i[2]=Mi(Di(o[2],s[2],l)),i[3]=Ii(Di(o[3],s[3],l)),i}}function Bi(e,t,i){if(t&&t.length&&e>=0&&e<=1){var n=e*(t.length-1),a=Math.floor(n),r=Math.ceil(n),o=Ei(t[a]),s=Ei(t[r]),l=n-a,u=Vi([Mi(Di(o[0],s[0],l)),Mi(Di(o[1],s[1],l)),Mi(Di(o[2],s[2],l)),Ii(Di(o[3],s[3],l))],"rgba");return i?{color:u,leftIndex:a,rightIndex:r,value:n}:u}}function Vi(e,t){if(e&&e.length){var i=e[0]+","+e[1]+","+e[2];return"rgba"!==t&&"hsva"!==t&&"hsla"!==t||(i+=","+e[3]),t+"("+i+")"}}var Fi=function(e,t){var i=Ei(e);if(i){for(var n=0;n<3;n++)i[n]=t<0?i[n]*(1-t)|0:(255-i[n])*t+i[n]|0,i[n]>255?i[n]=255:e[n]<0&&(i[n]=0);return Vi(i,4===i.length?"rgba":"rgb")}},Gi=function(e){var t=Ei(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},Hi=function(e,t,i,n){if(e=Ei(e))return e=function(e){if(e){var t,i,n=e[0]/255,a=e[1]/255,r=e[2]/255,o=Math.min(n,a,r),s=Math.max(n,a,r),l=s-o,u=(s+o)/2;if(0===l)t=0,i=0;else{i=u<.5?l/(s+o):l/(2-s-o);var h=((s-n)/6+l/2)/l,c=((s-a)/6+l/2)/l,d=((s-r)/6+l/2)/l;n===s?t=d-c:a===s?t=1/3+h-d:r===s&&(t=2/3+c-h),t<0&&(t+=1),t>1&&(t-=1)}var p=[360*t,i,u];return null!=e[3]&&p.push(e[3]),p}}(e),null!=t&&(e[0]=function(e){return(e=Math.round(e))<0?0:e>360?360:e}(t)),null!=i&&(e[1]=Ai(i)),null!=n&&(e[2]=Ai(n)),Vi(Ni(e),"rgba")},Wi=function(e,t){if((e=Ei(e))&&null!=t)return e[3]=Ii(t),Vi(e,"rgba")},Ui={parse:Ei,lift:Fi,toHex:Gi,fastLerp:zi,fastMapToColor:zi,lerp:Bi,mapToColor:Bi,modifyHSL:Hi,modifyAlpha:Wi,stringify:Vi},ji=Ve.isArrayLike,Zi=Array.prototype.slice;function Yi(e,t){return e[t]}function Xi(e,t,i){e[t]=i}function qi(e,t,i){return(t-e)*i+e}function $i(e,t,i){return i>.5?t:e}function Ki(e,t,i,n,a){var r=e.length;if(1===a)for(var o=0;o<r;o++)n[o]=qi(e[o],t[o],i);else{var s=r&&e[0].length;for(o=0;o<r;o++)for(var l=0;l<s;l++)n[o][l]=qi(e[o][l],t[o][l],i)}}function Ji(e,t,i){var n=e.length,a=t.length;if(n!==a)if(n>a)e.length=a;else for(var r=n;r<a;r++)e.push(1===i?t[r]:Zi.call(t[r]));var o=e[0]&&e[0].length;for(r=0;r<e.length;r++)if(1===i)isNaN(e[r])&&(e[r]=t[r]);else for(var s=0;s<o;s++)isNaN(e[r][s])&&(e[r][s]=t[r][s])}function Qi(e,t,i){if(e===t)return!0;var n=e.length;if(n!==t.length)return!1;if(1===i){for(var a=0;a<n;a++)if(e[a]!==t[a])return!1}else{var r=e[0].length;for(a=0;a<n;a++)for(var o=0;o<r;o++)if(e[a][o]!==t[a][o])return!1}return!0}function en(e,t,i,n,a,r,o,s,l){var u=e.length;if(1===l)for(var h=0;h<u;h++)s[h]=tn(e[h],t[h],i[h],n[h],a,r,o);else{var c=e[0].length;for(h=0;h<u;h++)for(var d=0;d<c;d++)s[h][d]=tn(e[h][d],t[h][d],i[h][d],n[h][d],a,r,o)}}function tn(e,t,i,n,a,r,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*r+s*a+t}function nn(e){if(ji(e)){var t=e.length;if(ji(e[0])){for(var i=[],n=0;n<t;n++)i.push(Zi.call(e[n]));return i}return Zi.call(e)}return e}function an(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function rn(e,t,i,n,a,r){var o=e._getter,s=e._setter,l="spline"===t,u=n.length;if(u){var h,c=n[0].value,d=ji(c),p=!1,f=!1,g=d?function(e){var t=e[e.length-1].value;return ji(t&&t[0])?2:1}(n):0;n.sort((function(e,t){return e.time-t.time})),h=n[u-1].time;for(var m=[],v=[],y=n[0].value,x=!0,_=0;_<u;_++){m.push(n[_].time/h);var b=n[_].value;if(d&&Qi(b,y,g)||!d&&b===y||(x=!1),y=b,"string"==typeof b){var w=Ui.parse(b);w?(b=w,p=!0):f=!0}v.push(b)}if(r||!x){var S=v[u-1];for(_=0;_<u-1;_++)d?Ji(v[_],S,g):!isNaN(v[_])||isNaN(S)||f||p||(v[_]=S);d&&Ji(o(e._target,a),S,g);var M,I,T,A,C,D=0,L=0;if(p)var P=[0,0,0,0];var k=new mi({target:e._target,life:h,loop:e._loop,delay:e._delay,onframe:function(e,t){var i;if(t<0)i=0;else if(t<L){for(i=Math.min(D+1,u-1);i>=0&&!(m[i]<=t);i--);i=Math.min(i,u-2)}else{for(i=D;i<u&&!(m[i]>t);i++);i=Math.min(i-1,u-2)}D=i,L=t;var n=m[i+1]-m[i];if(0!==n)if(M=(t-m[i])/n,l)if(T=v[i],I=v[0===i?i:i-1],A=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)en(I,T,A,C,M,M*M,M*M*M,o(e,a),g);else{if(p)r=en(I,T,A,C,M,M*M,M*M*M,P,1),r=an(P);else{if(f)return $i(T,A,M);r=tn(I,T,A,C,M,M*M,M*M*M)}s(e,a,r)}else if(d)Ki(v[i],v[i+1],M,o(e,a),g);else{var r;if(p)Ki(v[i],v[i+1],M,P,1),r=an(P);else{if(f)return $i(v[i],v[i+1],M);r=qi(v[i],v[i+1],M)}s(e,a,r)}},ondestroy:i});return t&&"spline"!==t&&(k.easing=t),k}}}var on=function(e,t,i,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||Yi,this._setter=n||Xi,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};on.prototype={when:function(e,t){var i=this._tracks;for(var n in t)if(t.hasOwnProperty(n)){if(!i[n]){i[n]=[];var a=this._getter(this._target,n);if(null==a)continue;0!==e&&i[n].push({time:0,value:nn(a)})}i[n].push({time:e,value:t[n]})}return this},during:function(e){return this._onframeList.push(e),this},pause:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].pause();this._paused=!0},resume:function(){for(var e=0;e<this._clipList.length;e++)this._clipList[e].resume();this._paused=!1},isPaused:function(){return!!this._paused},_doneCallback:function(){this._tracks={},this._clipList.length=0;for(var e=this._doneList,t=e.length,i=0;i<t;i++)e[i].call(this)},start:function(e,t){var i,n=this,a=0,r=function(){--a||n._doneCallback()};for(var o in this._tracks)if(this._tracks.hasOwnProperty(o)){var s=rn(this,e,r,this._tracks[o],o,t);s&&(this._clipList.push(s),a++,this.animation&&this.animation.addClip(s),i=s)}if(i){var l=i.onframe;i.onframe=function(e,t){l(e,t);for(var i=0;i<n._onframeList.length;i++)n._onframeList[i](e,t)}}return a||this._doneCallback(),this},stop:function(e){for(var t=this._clipList,i=this.animation,n=0;n<t.length;n++){var a=t[n];e&&a.onframe(this._target,1),i&&i.removeClip(a)}t.length=0},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this},getClips:function(){return this._clipList}};var sn=on,ln=1;"undefined"!=typeof window&&(ln=Math.max(window.devicePixelRatio||1,1));var un={debugMode:0,devicePixelRatio:ln},hn=function(){},cn=Ve.isString,dn=Ve.isFunction,pn=Ve.isObject,fn=Ve.isArrayLike,gn=Ve.indexOf,mn=function(){this.animators=[]};function vn(e,t,i,n,a,r,o,s){cn(n)?(r=a,a=n,n=0):dn(a)?(r=a,a="linear",n=0):dn(n)?(r=n,n=0):dn(i)?(r=i,i=500):i||(i=500),e.stopAnimation(),yn(e,"",e,t,i,n,s);var l=e.animators.slice(),u=l.length;function h(){--u||r&&r()}u||r&&r();for(var c=0;c<l.length;c++)l[c].done(h).start(a,o)}function yn(e,t,i,n,a,r,o){var s={},l=0;for(var u in n)n.hasOwnProperty(u)&&(null!=i[u]?pn(n[u])&&!fn(n[u])?yn(e,t?t+"."+u:u,i[u],n[u],a,r,o):(o?(s[u]=i[u],xn(e,t,u,n[u])):s[u]=n[u],l++):null==n[u]||o||xn(e,t,u,n[u]));l>0&&e.animate(t,!1).when(null==a?500:a,s).delay(r||0)}function xn(e,t,i,n){if(t){var a={};a[t]={},a[t][i]=n,e.attr(a)}else e.attr(i,n)}mn.prototype={constructor:mn,animate:function(e,t){var i,n=!1,a=this,r=this.__zr;if(e){var o=e.split("."),s=a;n="shape"===o[0];for(var l=0,u=o.length;l<u;l++)s&&(s=s[o[l]]);s&&(i=s)}else i=a;if(i){var h=a.animators,c=new sn(i,t);return c.during((function(e){a.dirty(n)})).done((function(){h.splice(gn(h,c),1)})),h.push(c),r&&r.animation.addAnimator(c),c}hn('Property "'+e+'" is not existed in element '+a.id)},stopAnimation:function(e){for(var t=this.animators,i=t.length,n=0;n<i;n++)t[n].stop(e);return t.length=0,this},animateTo:function(e,t,i,n,a,r){vn(this,e,t,i,n,a,r)},animateFrom:function(e,t,i,n,a,r){vn(this,e,t,i,n,a,r,!0)}};var _n=mn,bn=function(e){di.call(this,e),gt.call(this,e),_n.call(this,e),this.id=e.id||te()};bn.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(e,t){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(e,t){},attrKV:function(e,t){if("position"===e||"scale"===e||"origin"===e){if(t){var i=this[e];i||(i=this[e]=[]),i[0]=t[0],i[1]=t[1]}}else this[e]=t},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(e,t){if("string"==typeof e)this.attrKV(e,t);else if(Ve.isObject(e))for(var i in e)e.hasOwnProperty(i)&&this.attrKV(i,e[i]);return this.dirty(!1),this},setClipPath:function(e){var t=this.__zr;t&&e.addSelfToZr(t),this.clipPath&&this.clipPath!==e&&this.removeClipPath(),this.clipPath=e,e.__zr=t,e.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var e=this.clipPath;e&&(e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(e){this.__zr=e;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.addAnimator(t[i]);this.clipPath&&this.clipPath.addSelfToZr(e)},removeSelfFromZr:function(e){this.__zr=null;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.removeAnimator(t[i]);this.clipPath&&this.clipPath.removeSelfFromZr(e)}},Ve.mixin(bn,_n),Ve.mixin(bn,di),Ve.mixin(bn,gt);var wn,Sn,Mn,In,Tn=bn,An=lt.applyTransform,Cn=Math.min,Dn=Math.max;function Ln(e,t,i,n){i<0&&(e+=i,i=-i),n<0&&(t+=n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}Ln.prototype={constructor:Ln,union:function(e){var t=Cn(e.x,this.x),i=Cn(e.y,this.y);this.width=Dn(e.x+e.width,this.x+this.width)-t,this.height=Dn(e.y+e.height,this.y+this.height)-i,this.x=t,this.y=i},applyTransform:(wn=[],Sn=[],Mn=[],In=[],function(e){if(e){wn[0]=Mn[0]=this.x,wn[1]=In[1]=this.y,Sn[0]=In[0]=this.x+this.width,Sn[1]=Mn[1]=this.y+this.height,An(wn,wn,e),An(Sn,Sn,e),An(Mn,Mn,e),An(In,In,e),this.x=Cn(wn[0],Sn[0],Mn[0],In[0]),this.y=Cn(wn[1],Sn[1],Mn[1],In[1]);var t=Dn(wn[0],Sn[0],Mn[0],In[0]),i=Dn(wn[1],Sn[1],Mn[1],In[1]);this.width=t-this.x,this.height=i-this.y}}),calculateTransform:function(e){var t=this,i=e.width/t.width,n=e.height/t.height,a=ni.create();return ni.translate(a,a,[-t.x,-t.y]),ni.scale(a,a,[i,n]),ni.translate(a,a,[e.x,e.y]),a},intersect:function(e){if(!e)return!1;e instanceof Ln||(e=Ln.create(e));var t=this,i=t.x,n=t.x+t.width,a=t.y,r=t.y+t.height,o=e.x,s=e.x+e.width,l=e.y,u=e.y+e.height;return!(n<o||s<i||r<l||u<a)},contain:function(e,t){var i=this;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},clone:function(){return new Ln(this.x,this.y,this.width,this.height)},copy:function(e){this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Ln.create=function(e){return new Ln(e.x,e.y,e.width,e.height)};var Pn=Ln,kn=function(e){for(var t in e=e||{},Tn.call(this,e),e)e.hasOwnProperty(t)&&(this[t]=e[t]);this._children=[],this.__storage=null,this.__dirty=!0};kn.prototype={constructor:kn,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(e){return this._children[e]},childOfName:function(e){for(var t=this._children,i=0;i<t.length;i++)if(t[i].name===e)return t[i]},childCount:function(){return this._children.length},add:function(e){return e&&e!==this&&e.parent!==this&&(this._children.push(e),this._doAdd(e)),this},addBefore:function(e,t){if(e&&e!==this&&e.parent!==this&&t&&t.parent===this){var i=this._children,n=i.indexOf(t);n>=0&&(i.splice(n,0,e),this._doAdd(e))}return this},_doAdd:function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__storage,i=this.__zr;t&&t!==e.__storage&&(t.addToStorage(e),e instanceof kn&&e.addChildrenToStorage(t)),i&&i.refresh()},remove:function(e){var t=this.__zr,i=this.__storage,n=this._children,a=Ve.indexOf(n,e);return a<0||(n.splice(a,1),e.parent=null,i&&(i.delFromStorage(e),e instanceof kn&&e.delChildrenFromStorage(i)),t&&t.refresh()),this},removeAll:function(){var e,t,i=this._children,n=this.__storage;for(t=0;t<i.length;t++)e=i[t],n&&(n.delFromStorage(e),e instanceof kn&&e.delChildrenFromStorage(n)),e.parent=null;return i.length=0,this},eachChild:function(e,t){for(var i=this._children,n=0;n<i.length;n++){var a=i[n];e.call(t,a,n)}return this},traverse:function(e,t){for(var i=0;i<this._children.length;i++){var n=this._children[i];e.call(t,n),"group"===n.type&&n.traverse(e,t)}return this},addChildrenToStorage:function(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.addToStorage(i),i instanceof kn&&i.addChildrenToStorage(e)}},delChildrenFromStorage:function(e){for(var t=0;t<this._children.length;t++){var i=this._children[t];e.delFromStorage(i),i instanceof kn&&i.delChildrenFromStorage(e)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(e){for(var t=null,i=new Pn(0,0,0,0),n=e||this._children,a=[],r=0;r<n.length;r++){var o=n[r];if(!o.ignore&&!o.invisible){var s=o.getBoundingRect(),l=o.getLocalTransform(a);l?(i.copy(s),i.applyTransform(l),(t=t||i.clone()).union(i)):(t=t||s.clone()).union(s)}}return t||i}},Ve.inherits(kn,Tn);var On=kn,Rn=32,En=7;function Nn(e,t,i,n){var a=t+1;if(a===i)return 1;if(n(e[a++],e[t])<0){for(;a<i&&n(e[a],e[a-1])<0;)a++;!function(e,t,i){i--;for(;t<i;){var n=e[t];e[t++]=e[i],e[i--]=n}}(e,t,a)}else for(;a<i&&n(e[a],e[a-1])>=0;)a++;return a-t}function zn(e,t,i,n,a){for(n===t&&n++;n<i;n++){for(var r,o=e[n],s=t,l=n;s<l;)a(o,e[r=s+l>>>1])<0?l=r:s=r+1;var u=n-s;switch(u){case 3:e[s+3]=e[s+2];case 2:e[s+2]=e[s+1];case 1:e[s+1]=e[s];break;default:for(;u>0;)e[s+u]=e[s+u-1],u--}e[s]=o}}function Bn(e,t,i,n,a,r){var o=0,s=0,l=1;if(r(e,t[i+a])>0){for(s=n-a;l<s&&r(e,t[i+a+l])>0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}else{for(s=a+1;l<s&&r(e,t[i+a-l])<=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=a-l,l=a-u}for(o++;o<l;){var h=o+(l-o>>>1);r(e,t[i+h])>0?o=h+1:l=h}return l}function Vn(e,t,i,n,a,r){var o=0,s=0,l=1;if(r(e,t[i+a])<0){for(s=a+1;l<s&&r(e,t[i+a-l])<0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=o;o=a-l,l=a-u}else{for(s=n-a;l<s&&r(e,t[i+a+l])>=0;)o=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}for(o++;o<l;){var h=o+(l-o>>>1);r(e,t[i+h])<0?l=h:o=h+1}return l}function Fn(e,t){var i,n,a=En,r=0;e.length;var o=[];function s(s){var l=i[s],u=n[s],h=i[s+1],c=n[s+1];n[s]=u+c,s===r-3&&(i[s+1]=i[s+2],n[s+1]=n[s+2]),r--;var d=Vn(e[h],e,l,u,0,t);l+=d,0!==(u-=d)&&0!==(c=Bn(e[l+u-1],e,h,c,c-1,t))&&(u<=c?function(i,n,r,s){var l=0;for(l=0;l<n;l++)o[l]=e[i+l];var u=0,h=r,c=i;if(e[c++]=e[h++],0==--s){for(l=0;l<n;l++)e[c+l]=o[u+l];return}if(1===n){for(l=0;l<s;l++)e[c+l]=e[h+l];return void(e[c+s]=o[u])}var d,p,f,g=a;for(;;){d=0,p=0,f=!1;do{if(t(e[h],o[u])<0){if(e[c++]=e[h++],p++,d=0,0==--s){f=!0;break}}else if(e[c++]=o[u++],d++,p=0,1==--n){f=!0;break}}while((d|p)<g);if(f)break;do{if(0!==(d=Vn(e[h],o,u,n,0,t))){for(l=0;l<d;l++)e[c+l]=o[u+l];if(c+=d,u+=d,(n-=d)<=1){f=!0;break}}if(e[c++]=e[h++],0==--s){f=!0;break}if(0!==(p=Bn(o[u],e,h,s,0,t))){for(l=0;l<p;l++)e[c+l]=e[h+l];if(c+=p,h+=p,0===(s-=p)){f=!0;break}}if(e[c++]=o[u++],1==--n){f=!0;break}g--}while(d>=En||p>=En);if(f)break;g<0&&(g=0),g+=2}if((a=g)<1&&(a=1),1===n){for(l=0;l<s;l++)e[c+l]=e[h+l];e[c+s]=o[u]}else{if(0===n)throw new Error;for(l=0;l<n;l++)e[c+l]=o[u+l]}}(l,u,h,c):function(i,n,r,s){var l=0;for(l=0;l<s;l++)o[l]=e[r+l];var u=i+n-1,h=s-1,c=r+s-1,d=0,p=0;if(e[c--]=e[u--],0==--n){for(d=c-(s-1),l=0;l<s;l++)e[d+l]=o[l];return}if(1===s){for(p=(c-=n)+1,d=(u-=n)+1,l=n-1;l>=0;l--)e[p+l]=e[d+l];return void(e[c]=o[h])}var f=a;for(;;){var g=0,m=0,v=!1;do{if(t(o[h],e[u])<0){if(e[c--]=e[u--],g++,m=0,0==--n){v=!0;break}}else if(e[c--]=o[h--],m++,g=0,1==--s){v=!0;break}}while((g|m)<f);if(v)break;do{if(0!==(g=n-Vn(o[h],e,i,n,n-1,t))){for(n-=g,p=(c-=g)+1,d=(u-=g)+1,l=g-1;l>=0;l--)e[p+l]=e[d+l];if(0===n){v=!0;break}}if(e[c--]=o[h--],1==--s){v=!0;break}if(0!==(m=s-Bn(e[u],o,0,s,s-1,t))){for(s-=m,p=(c-=m)+1,d=(h-=m)+1,l=0;l<m;l++)e[p+l]=o[d+l];if(s<=1){v=!0;break}}if(e[c--]=e[u--],0==--n){v=!0;break}f--}while(g>=En||m>=En);if(v)break;f<0&&(f=0),f+=2}(a=f)<1&&(a=1);if(1===s){for(p=(c-=n)+1,d=(u-=n)+1,l=n-1;l>=0;l--)e[p+l]=e[d+l];e[c]=o[h]}else{if(0===s)throw new Error;for(d=c-(s-1),l=0;l<s;l++)e[d+l]=o[l]}}(l,u,h,c))}i=[],n=[],this.mergeRuns=function(){for(;r>1;){var e=r-2;if(e>=1&&n[e-1]<=n[e]+n[e+1]||e>=2&&n[e-2]<=n[e]+n[e-1])n[e-1]<n[e+1]&&e--;else if(n[e]>n[e+1])break;s(e)}},this.forceMergeRuns=function(){for(;r>1;){var e=r-2;e>0&&n[e-1]<n[e+1]&&e--,s(e)}},this.pushRun=function(e,t){i[r]=e,n[r]=t,r+=1}}var Gn=function(e,t,i,n){i||(i=0),n||(n=e.length);var a=n-i;if(!(a<2)){var r=0;if(a<Rn)zn(e,i,n,i+(r=Nn(e,i,n,t)),t);else{var o=new Fn(e,t),s=function(e){for(var t=0;e>=Rn;)t|=1&e,e>>=1;return e+t}(a);do{if((r=Nn(e,i,n,t))<s){var l=a;l>s&&(l=s),zn(e,i,i+l,i+r,t),r=l}o.pushRun(i,r),o.mergeRuns(),a-=r,i+=r}while(0!==a);o.forceMergeRuns()}}};function Hn(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Wn=function(){this._roots=[],this._displayList=[],this._displayListLen=0};Wn.prototype={constructor:Wn,traverse:function(e,t){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(e,t)},getDisplayList:function(e,t){return t=t||!1,e&&this.updateDisplayList(t),this._displayList},updateDisplayList:function(e){this._displayListLen=0;for(var t=this._roots,i=this._displayList,n=0,a=t.length;n<a;n++)this._updateAndAddDisplayable(t[n],null,e);i.length=this._displayListLen,ie.canvasSupported&&Gn(i,Hn)},_updateAndAddDisplayable:function(e,t,i){if(!e.ignore||i){e.beforeUpdate(),e.__dirty&&e.update(),e.afterUpdate();var n=e.clipPath;if(n){t=t?t.slice():[];for(var a=n,r=e;a;)a.parent=r,a.updateTransform(),t.push(a),r=a,a=a.clipPath}if(e.isGroup){for(var o=e._children,s=0;s<o.length;s++){var l=o[s];e.__dirty&&(l.__dirty=!0),this._updateAndAddDisplayable(l,t,i)}e.__dirty=!1}else e.__clipPaths=t,this._displayList[this._displayListLen++]=e}},addRoot:function(e){e.__storage!==this&&(e instanceof On&&e.addChildrenToStorage(this),this.addToStorage(e),this._roots.push(e))},delRoot:function(e){if(null==e){for(var t=0;t<this._roots.length;t++){var i=this._roots[t];i instanceof On&&i.delChildrenFromStorage(this)}return this._roots=[],this._displayList=[],void(this._displayListLen=0)}if(e instanceof Array){t=0;for(var n=e.length;t<n;t++)this.delRoot(e[t])}else{var a=Ve.indexOf(this._roots,e);a>=0&&(this.delFromStorage(e),this._roots.splice(a,1),e instanceof On&&e.delChildrenFromStorage(this))}},addToStorage:function(e){return e&&(e.__storage=this,e.dirty(!1)),this},delFromStorage:function(e){return e&&(e.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:Hn};var Un=Wn,jn={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};var Zn=function(e,t,i){return jn.hasOwnProperty(t)?i*e.dpr:i},Yn={ContextCachedBy:{NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},WILL_BE_RESTORED:9},Xn=Yn.ContextCachedBy,qn=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],$n=function(e){this.extendFrom(e,!1)};function Kn(e,t,i){var n=null==t.x?0:t.x,a=null==t.x2?1:t.x2,r=null==t.y?0:t.y,o=null==t.y2?0:t.y2;return t.global||(n=n*i.width+i.x,a=a*i.width+i.x,r=r*i.height+i.y,o=o*i.height+i.y),n=isNaN(n)?0:n,a=isNaN(a)?1:a,r=isNaN(r)?0:r,o=isNaN(o)?0:o,e.createLinearGradient(n,r,a,o)}function Jn(e,t,i){var n=i.width,a=i.height,r=Math.min(n,a),o=null==t.x?.5:t.x,s=null==t.y?.5:t.y,l=null==t.r?.5:t.r;return t.global||(o=o*n+i.x,s=s*a+i.y,l*=r),e.createRadialGradient(o,s,0,o,s,l)}$n.prototype={constructor:$n,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(e,t,i){var n=this,a=i&&i.style,r=!a||e.__attrCachedBy!==Xn.STYLE_BIND;e.__attrCachedBy=Xn.STYLE_BIND;for(var o=0;o<qn.length;o++){var s=qn[o],l=s[0];(r||n[l]!==a[l])&&(e[l]=Zn(e,l,n[l]||s[1]))}if((r||n.fill!==a.fill)&&(e.fillStyle=n.fill),(r||n.stroke!==a.stroke)&&(e.strokeStyle=n.stroke),(r||n.opacity!==a.opacity)&&(e.globalAlpha=null==n.opacity?1:n.opacity),(r||n.blend!==a.blend)&&(e.globalCompositeOperation=n.blend||"source-over"),this.hasStroke()){var u=n.lineWidth;e.lineWidth=u/(this.strokeNoScale&&t&&t.getLineScale?t.getLineScale():1)}},hasFill:function(){var e=this.fill;return null!=e&&"none"!==e},hasStroke:function(){var e=this.stroke;return null!=e&&"none"!==e&&this.lineWidth>0},extendFrom:function(e,t){if(e)for(var i in e)!e.hasOwnProperty(i)||!0!==t&&(!1===t?this.hasOwnProperty(i):null==e[i])||(this[i]=e[i])},set:function(e,t){"string"==typeof e?this[e]=t:this.extendFrom(e,!0)},clone:function(){var e=new this.constructor;return e.extendFrom(this,!0),e},getGradient:function(e,t,i){for(var n=("radial"===t.type?Jn:Kn)(e,t,i),a=t.colorStops,r=0;r<a.length;r++)n.addColorStop(a[r].offset,a[r].color);return n}};for(var Qn=$n.prototype,ea=0;ea<qn.length;ea++){var ta=qn[ea];ta[0]in Qn||(Qn[ta[0]]=ta[1])}$n.getGradient=Qn.getGradient;var ia=$n,na=function(e,t){this.image=e,this.repeat=t,this.type="pattern"};na.prototype.getCanvasPattern=function(e){return e.createPattern(this.image,this.repeat||"repeat")};var aa=na,ra=un.devicePixelRatio;function oa(){return!1}function sa(e,t,i){var n=Ve.createCanvas(),a=t.getWidth(),r=t.getHeight(),o=n.style;return o&&(o.position="absolute",o.left=0,o.top=0,o.width=a+"px",o.height=r+"px",n.setAttribute("data-zr-dom-id",e)),n.width=a*i,n.height=r*i,n}var la=function(e,t,i){var n;i=i||ra,"string"==typeof e?n=sa(e,t,i):Ve.isObject(e)&&(e=(n=e).id),this.id=e,this.dom=n;var a=n.style;a&&(n.onselectstart=oa,a["-webkit-user-select"]="none",a["user-select"]="none",a["-webkit-touch-callout"]="none",a["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",a.padding=0,a.margin=0,a["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=t,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=i};la.prototype={constructor:la,__dirty:!0,__used:!1,__drawIndex:0,__startIndex:0,__endIndex:0,incremental:!1,getElementCount:function(){return this.__endIndex-this.__startIndex},initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var e=this.dpr;this.domBack=sa("back-"+this.id,this.painter,e),this.ctxBack=this.domBack.getContext("2d"),1!==e&&this.ctxBack.scale(e,e)},resize:function(e,t){var i=this.dpr,n=this.dom,a=n.style,r=this.domBack;a&&(a.width=e+"px",a.height=t+"px"),n.width=e*i,n.height=t*i,r&&(r.width=e*i,r.height=t*i,1!==i&&this.ctxBack.scale(i,i))},clear:function(e,t){var i,n=this.dom,a=this.ctx,r=n.width,o=n.height,s=(t=t||this.clearColor,this.motionBlur&&!e),l=this.lastFrameAlpha,u=this.dpr;(s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(n,0,0,r/u,o/u)),a.clearRect(0,0,r,o),t&&"transparent"!==t)&&(t.colorStops?(i=t.__canvasGradient||ia.getGradient(a,t,{x:0,y:0,width:r,height:o}),t.__canvasGradient=i):t.image&&(i=aa.prototype.getCanvasPattern.call(t,a)),a.save(),a.fillStyle=i||t,a.fillRect(0,0,r,o),a.restore());if(s){var h=this.domBack;a.save(),a.globalAlpha=l,a.drawImage(h,0,0,r,o),a.restore()}}};var ua=la,ha="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){setTimeout(e,16)},ca=new wi(50);function da(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t<e.pending.length;t++){var i=e.pending[t],n=i.cb;n&&n(this,i.cbPayload),i.hostEl.dirty()}e.pending.length=0}function pa(e){return e&&e.width&&e.height}var fa=function(e,t,i,n,a){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!i)return t;var r=ca.get(e),o={hostEl:i,cb:n,cbPayload:a};return r?!pa(t=r.image)&&r.pending.push(o):((t=new Image).onload=t.onerror=da,ca.put(e,t.__cachedImgObj={image:t,pending:[o]}),t.src=t.__zrImageSrc=e),t}return e}return t},ga={findExistImage:function(e){if("string"==typeof e){var t=ca.get(e);return t&&t.image}return e},createOrUpdateImage:fa,isImageReady:pa},ma=Ve.getContext,va=Ve.extend,ya=Ve.retrieve2,xa=Ve.retrieve3,_a=Ve.trim,ba={},wa=0,Sa=5e3,Ma=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,Ia="12px sans-serif",Ta={};function Aa(e,t){var i=e+":"+(t=t||Ia);if(ba[i])return ba[i];for(var n=(e+"").split("\n"),a=0,r=0,o=n.length;r<o;r++)a=Math.max(Na(n[r],t).width,a);return wa>Sa&&(wa=0,ba={}),wa++,ba[i]=a,a}function Ca(e,t,i){return"right"===i?e-=t:"center"===i&&(e-=t/2),e}function Da(e,t,i){return"middle"===i?e-=t/2:"bottom"===i&&(e-=t),e}function La(e,t,i){var n=t.textPosition,a=t.textDistance,r=i.x,o=i.y;a=a||0;var s=i.height,l=i.width,u=s/2,h="left",c="top";switch(n){case"left":r-=a,o+=u,h="right",c="middle";break;case"right":r+=a+l,o+=u,c="middle";break;case"top":r+=l/2,o-=a,h="center",c="bottom";break;case"bottom":r+=l/2,o+=s+a,h="center";break;case"inside":r+=l/2,o+=u,h="center",c="middle";break;case"insideLeft":r+=a,o+=u,c="middle";break;case"insideRight":r+=l-a,o+=u,h="right",c="middle";break;case"insideTop":r+=l/2,o+=a,h="center";break;case"insideBottom":r+=l/2,o+=s-a,h="center",c="bottom";break;case"insideTopLeft":r+=a,o+=a;break;case"insideTopRight":r+=l-a,o+=a,h="right";break;case"insideBottomLeft":r+=a,o+=s-a,c="bottom";break;case"insideBottomRight":r+=l-a,o+=s-a,h="right",c="bottom"}return(e=e||{}).x=r,e.y=o,e.textAlign=h,e.textVerticalAlign=c,e}function Pa(e,t,i,n,a){if(!t)return"";var r=(e+"").split("\n");a=ka(t,i,n,a);for(var o=0,s=r.length;o<s;o++)r[o]=Oa(r[o],a);return r.join("\n")}function ka(e,t,i,n){(n=va({},n)).font=t;i=ya(i,"...");n.maxIterations=ya(n.maxIterations,2);var a=n.minChar=ya(n.minChar,0);n.cnCharWidth=Aa("国",t);var r=n.ascCharWidth=Aa("a",t);n.placeholder=ya(n.placeholder,"");for(var o=e=Math.max(0,e-1),s=0;s<a&&o>=r;s++)o-=r;var l=Aa(i,t);return l>o&&(i="",l=0),o=e-l,n.ellipsis=i,n.ellipsisWidth=l,n.contentWidth=o,n.containerWidth=e,n}function Oa(e,t){var i=t.containerWidth,n=t.font,a=t.contentWidth;if(!i)return"";var r=Aa(e,n);if(r<=i)return e;for(var o=0;;o++){if(r<=a||o>=t.maxIterations){e+=t.ellipsis;break}var s=0===o?Ra(e,a,t.ascCharWidth,t.cnCharWidth):r>0?Math.floor(e.length*a/r):0;r=Aa(e=e.substr(0,s),n)}return""===e&&(e=t.placeholder),e}function Ra(e,t,i,n){for(var a=0,r=0,o=e.length;r<o&&a<t;r++){var s=e.charCodeAt(r);a+=0<=s&&s<=127?i:n}return r}function Ea(e){return Aa("国",e)}function Na(e,t){return Ta.measureText(e,t)}function za(e,t,i,n,a){null!=e&&(e+="");var r=ya(n,Ea(t)),o=e?e.split("\n"):[],s=o.length*r,l=s,u=!0;if(i&&(l+=i[0]+i[2]),e&&a){u=!1;var h=a.outerHeight,c=a.outerWidth;if(null!=h&&l>h)e="",o=[];else if(null!=c)for(var d=ka(c-(i?i[1]+i[3]:0),t,a.ellipsis,{minChar:a.minChar,placeholder:a.placeholder}),p=0,f=o.length;p<f;p++)o[p]=Oa(o[p],d)}return{lines:o,height:s,outerHeight:l,lineHeight:r,canCacheByTextString:u}}function Ba(e,t){var i={lines:[],width:0,height:0};if(null!=e&&(e+=""),!e)return i;for(var n,a=Ma.lastIndex=0;null!=(n=Ma.exec(e));){var r=n.index;r>a&&Va(i,e.substring(a,r)),Va(i,n[2],n[1]),a=Ma.lastIndex}a<e.length&&Va(i,e.substring(a,e.length));var o=i.lines,s=0,l=0,u=[],h=t.textPadding,c=t.truncate,d=c&&c.outerWidth,p=c&&c.outerHeight;h&&(null!=d&&(d-=h[1]+h[3]),null!=p&&(p-=h[0]+h[2]));for(var f=0;f<o.length;f++){for(var g=o[f],m=0,v=0,y=0;y<g.tokens.length;y++){var x=(D=g.tokens[y]).styleName&&t.rich[D.styleName]||{},_=D.textPadding=x.textPadding,b=D.font=x.font||t.font,w=D.textHeight=ya(x.textHeight,Ea(b));if(_&&(w+=_[0]+_[2]),D.height=w,D.lineHeight=xa(x.textLineHeight,t.textLineHeight,w),D.textAlign=x&&x.textAlign||t.textAlign,D.textVerticalAlign=x&&x.textVerticalAlign||"middle",null!=p&&s+D.lineHeight>p)return{lines:[],width:0,height:0};D.textWidth=Aa(D.text,b);var S=x.textWidth,M=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))D.percentWidth=S,u.push(D),S=0;else{if(M){S=D.textWidth;var I=x.textBackgroundColor,T=I&&I.image;T&&(T=ga.findExistImage(T),ga.isImageReady(T)&&(S=Math.max(S,T.width*w/T.height)))}var A=_?_[1]+_[3]:0;S+=A;var C=null!=d?d-v:null;null!=C&&C<S&&(!M||C<A?(D.text="",D.textWidth=S=0):(D.text=Pa(D.text,C-A,b,c.ellipsis,{minChar:c.minChar}),D.textWidth=Aa(D.text,b),S=D.textWidth+A))}v+=D.width=S,x&&(m=Math.max(m,D.lineHeight))}g.width=v,g.lineHeight=m,s+=m,l=Math.max(l,v)}i.outerWidth=i.width=ya(t.textWidth,l),i.outerHeight=i.height=ya(t.textHeight,s),h&&(i.outerWidth+=h[1]+h[3],i.outerHeight+=h[0]+h[2]);for(f=0;f<u.length;f++){var D,L=(D=u[f]).percentWidth;D.width=parseInt(L,10)/100*l}return i}function Va(e,t,i){for(var n=""===t,a=t.split("\n"),r=e.lines,o=0;o<a.length;o++){var s=a[o],l={styleName:i,text:s,isLineHolder:!s&&!n};if(o)r.push({tokens:[l]});else{var u=(r[r.length-1]||(r[0]={tokens:[]})).tokens,h=u.length;1===h&&u[0].isLineHolder?u[0]=l:(s||!h||n)&&u.push(l)}}}Ta.measureText=function(e,t){var i=ma();return i.font=t||Ia,i.measureText(e)};var Fa=function(e,t,i,n,a,r,o,s){return o?function(e,t,i,n,a,r,o,s){var l=Ba(e,{rich:o,truncate:s,font:t,textAlign:i,textPadding:a,textLineHeight:r}),u=l.outerWidth,h=l.outerHeight,c=Ca(0,u,i),d=Da(0,h,n);return new Pn(c,d,u,h)}(e,t,i,n,a,r,o,s):function(e,t,i,n,a,r,o){var s=za(e,t,a,r,o),l=Aa(e,t);a&&(l+=a[1]+a[3]);var u=s.outerHeight,h=Ca(0,l,i),c=Da(0,u,n),d=new Pn(h,c,l,u);return d.lineHeight=s.lineHeight,d}(e,t,i,n,a,r,s)},Ga=function(e,t,i){return La({},{textPosition:e,textDistance:i},t)},Ha=function(e){var t=(e.fontSize||e.fontFamily)&&[e.fontStyle,e.fontWeight,(e.fontSize||12)+"px",e.fontFamily||"sans-serif"].join(" ");return t&&_a(t)||e.textFont||e.font},Wa={DEFAULT_FONT:Ia,$override:function(e,t){Ta[e]=t},getWidth:Aa,getBoundingRect:Fa,adjustTextX:Ca,adjustTextY:Da,calculateTextPosition:La,adjustTextPositionOnRect:Ga,truncateText:Pa,getLineHeight:Ea,measureText:Na,parsePlainText:za,parseRichText:Ba,makeFont:Ha};var Ua={buildPath:function(e,t){var i,n,a,r,o,s=t.x,l=t.y,u=t.width,h=t.height,c=t.r;u<0&&(s+=u,u=-u),h<0&&(l+=h,h=-h),"number"==typeof c?i=n=a=r=c:c instanceof Array?1===c.length?i=n=a=r=c[0]:2===c.length?(i=a=c[0],n=r=c[1]):3===c.length?(i=c[0],n=r=c[1],a=c[2]):(i=c[0],n=c[1],a=c[2],r=c[3]):i=n=a=r=0,i+n>u&&(i*=u/(o=i+n),n*=u/o),a+r>u&&(a*=u/(o=a+r),r*=u/o),n+a>h&&(n*=h/(o=n+a),a*=h/o),i+r>h&&(i*=h/(o=i+r),r*=h/o),e.moveTo(s+i,l),e.lineTo(s+u-n,l),0!==n&&e.arc(s+u-n,l+n,n,-Math.PI/2,0),e.lineTo(s+u,l+h-a),0!==a&&e.arc(s+u-a,l+h-a,a,0,Math.PI/2),e.lineTo(s+r,l+h),0!==r&&e.arc(s+r,l+h-r,r,Math.PI/2,Math.PI),e.lineTo(s,l+i),0!==i&&e.arc(s+i,l+i,i,Math.PI,1.5*Math.PI)}},ja=Ve.retrieve2,Za=Ve.retrieve3,Ya=Ve.each,Xa=Ve.normalizeCssArray,qa=Ve.isString,$a=Ve.isObject,Ka=Yn.ContextCachedBy,Ja=Yn.WILL_BE_RESTORED,Qa=Wa.DEFAULT_FONT,er={left:1,right:1,center:1},tr={top:1,bottom:1,middle:1},ir=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],nr={},ar={};function rr(e){if(e){e.font=Wa.makeFont(e);var t=e.textAlign;"middle"===t&&(t="center"),e.textAlign=null==t||er[t]?t:"left";var i=e.textVerticalAlign||e.textBaseline;"center"===i&&(i="middle"),e.textVerticalAlign=null==i||tr[i]?i:"top",e.textPadding&&(e.textPadding=Xa(e.textPadding))}}function or(e,t,i,n,a){if(i&&t.textRotation){var r=t.textOrigin;"center"===r?(n=i.width/2+i.x,a=i.height/2+i.y):r&&(n=r[0]+i.x,a=r[1]+i.y),e.translate(n,a),e.rotate(-t.textRotation),e.translate(-n,-a)}}function sr(e,t,i,n,a,r,o,s){var l=n.rich[i.styleName]||{};l.text=i.text;var u=i.textVerticalAlign,h=r+a/2;"top"===u?h=r+i.height/2:"bottom"===u&&(h=r+a-i.height/2),!i.isLineHolder&&lr(l)&&ur(e,t,l,"right"===s?o-i.width:"center"===s?o-i.width/2:o,h-i.height/2,i.width,i.height);var c=i.textPadding;c&&(o=mr(o,s,c),h-=i.height/2-c[2]-i.textHeight/2),dr(t,"shadowBlur",Za(l.textShadowBlur,n.textShadowBlur,0)),dr(t,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),dr(t,"shadowOffsetX",Za(l.textShadowOffsetX,n.textShadowOffsetX,0)),dr(t,"shadowOffsetY",Za(l.textShadowOffsetY,n.textShadowOffsetY,0)),dr(t,"textAlign",s),dr(t,"textBaseline","middle"),dr(t,"font",i.font||Qa);var d=pr(l.textStroke||n.textStroke,f),p=fr(l.textFill||n.textFill),f=ja(l.textStrokeWidth,n.textStrokeWidth);d&&(dr(t,"lineWidth",f),dr(t,"strokeStyle",d),t.strokeText(i.text,o,h)),p&&(dr(t,"fillStyle",p),t.fillText(i.text,o,h))}function lr(e){return!!(e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor)}function ur(e,t,i,n,a,r,o){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=qa(s);if(dr(t,"shadowBlur",i.textBoxShadowBlur||0),dr(t,"shadowColor",i.textBoxShadowColor||"transparent"),dr(t,"shadowOffsetX",i.textBoxShadowOffsetX||0),dr(t,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){t.beginPath();var c=i.textBorderRadius;c?Ua.buildPath(t,{x:n,y:a,width:r,height:o,r:c}):t.rect(n,a,r,o),t.closePath()}if(h)if(dr(t,"fillStyle",s),null!=i.fillOpacity){var d=t.globalAlpha;t.globalAlpha=i.fillOpacity*i.opacity,t.fill(),t.globalAlpha=d}else t.fill();else if($a(s)){var p=s.image;(p=ga.createOrUpdateImage(p,null,e,hr,s))&&ga.isImageReady(p)&&t.drawImage(p,n,a,r,o)}if(l&&u)if(dr(t,"lineWidth",l),dr(t,"strokeStyle",u),null!=i.strokeOpacity){d=t.globalAlpha;t.globalAlpha=i.strokeOpacity*i.opacity,t.stroke(),t.globalAlpha=d}else t.stroke()}function hr(e,t){t.image=e}function cr(e,t,i,n){var a=i.x||0,r=i.y||0,o=i.textAlign,s=i.textVerticalAlign;if(n){var l=i.textPosition;if(l instanceof Array)a=n.x+gr(l[0],n.width),r=n.y+gr(l[1],n.height);else{var u=t&&t.calculateTextPosition?t.calculateTextPosition(nr,i,n):Wa.calculateTextPosition(nr,i,n);a=u.x,r=u.y,o=o||u.textAlign,s=s||u.textVerticalAlign}var h=i.textOffset;h&&(a+=h[0],r+=h[1])}return(e=e||{}).baseX=a,e.baseY=r,e.textAlign=o,e.textVerticalAlign=s,e}function dr(e,t,i){return e[t]=Zn(e,t,i),e[t]}function pr(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function fr(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function gr(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function mr(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}var vr=function(e){return rr(e),Ya(e.rich,rr),e},yr=function(e,t,i,n,a,r){n.rich?function(e,t,i,n,a,r){r!==Ja&&(t.__attrCachedBy=Ka.NONE);var o=e.__textCotentBlock;o&&!e.__dirtyText||(o=e.__textCotentBlock=Wa.parseRichText(i,n));!function(e,t,i,n,a){var r=i.width,o=i.outerWidth,s=i.outerHeight,l=n.textPadding,u=cr(ar,e,n,a),h=u.baseX,c=u.baseY,d=u.textAlign,p=u.textVerticalAlign;or(t,n,a,h,c);var f=Wa.adjustTextX(h,o,d),g=Wa.adjustTextY(c,s,p),m=f,v=g;l&&(m+=l[3],v+=l[0]);var y=m+r;lr(n)&&ur(e,t,n,f,g,o,s);for(var x=0;x<i.lines.length;x++){for(var _,b=i.lines[x],w=b.tokens,S=w.length,M=b.lineHeight,I=b.width,T=0,A=m,C=y,D=S-1;T<S&&(!(_=w[T]).textAlign||"left"===_.textAlign);)sr(e,t,_,n,M,v,A,"left"),I-=_.width,A+=_.width,T++;for(;D>=0&&"right"===(_=w[D]).textAlign;)sr(e,t,_,n,M,v,C,"right"),I-=_.width,C-=_.width,D--;for(A+=(r-(A-m)-(y-C)-I)/2;T<=D;)sr(e,t,_=w[T],n,M,v,A+_.width/2,"center"),A+=_.width,T++;v+=M}}(e,t,o,n,a)}(e,t,i,n,a,r):function(e,t,i,n,a,r){var o,s=lr(n),l=!1,u=t.__attrCachedBy===Ka.PLAIN_TEXT;r!==Ja?(r&&(o=r.style,l=!s&&u&&o),t.__attrCachedBy=s?Ka.NONE:Ka.PLAIN_TEXT):u&&(t.__attrCachedBy=Ka.NONE);var h=n.font||Qa;l&&h===(o.font||Qa)||(t.font=h);var c=e.__computedFont;e.__styleFont!==h&&(e.__styleFont=h,c=e.__computedFont=t.font);var d=n.textPadding,p=n.textLineHeight,f=e.__textCotentBlock;f&&!e.__dirtyText||(f=e.__textCotentBlock=Wa.parsePlainText(i,c,d,p,n.truncate));var g=f.outerHeight,m=f.lines,v=f.lineHeight,y=cr(ar,e,n,a),x=y.baseX,_=y.baseY,b=y.textAlign||"left",w=y.textVerticalAlign;or(t,n,a,x,_);var S=Wa.adjustTextY(_,g,w),M=x,I=S;if(s||d){var T=Wa.getWidth(i,c);d&&(T+=d[1]+d[3]);var A=Wa.adjustTextX(x,T,b);s&&ur(e,t,n,A,S,T,g),d&&(M=mr(x,b,d),I+=d[0])}t.textAlign=b,t.textBaseline="middle",t.globalAlpha=n.opacity||1;for(var C=0;C<ir.length;C++){var D=ir[C],L=D[0],P=D[1],k=n[L];l&&k===o[L]||(t[P]=Zn(t,P,k||D[2]))}I+=v/2;var O=n.textStrokeWidth,R=l?o.textStrokeWidth:null,E=!l||O!==R,N=!l||E||n.textStroke!==o.textStroke,z=pr(n.textStroke,O),B=fr(n.textFill);z&&(E&&(t.lineWidth=O),N&&(t.strokeStyle=z));B&&(l&&n.textFill===o.textFill||(t.fillStyle=B));if(1===m.length)z&&t.strokeText(m[0],M,I),B&&t.fillText(m[0],M,I);else for(C=0;C<m.length;C++)z&&t.strokeText(m[C],M,I),B&&t.fillText(m[C],M,I),I+=v}(e,t,i,n,a,r)},xr=function(e,t){return null!=e&&(e||t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor||t.textPadding)},_r={normalizeTextStyle:vr,renderText:yr,getBoxPosition:cr,getStroke:pr,getFill:fr,parsePercent:gr,needDrawText:xr},br=Yn.WILL_BE_RESTORED,wr=new Pn,Sr=function(){};Sr.prototype={constructor:Sr,drawRectText:function(e,t){var i=this.style;t=i.textRect||t,this.__dirty&&_r.normalizeTextStyle(i,!0);var n=i.text;if(null!=n&&(n+=""),_r.needDrawText(n,i)){e.save();var a=this.transform;i.transformText?this.setTransform(e):a&&(wr.copy(t),wr.applyTransform(a),t=wr),_r.renderText(this,e,n,i,t,br),e.restore()}}};var Mr=Sr;function Ir(e){for(var t in e=e||{},Tn.call(this,e),e)e.hasOwnProperty(t)&&"style"!==t&&(this[t]=e[t]);this.style=new ia(e.style),this._rect=null,this.__clipPaths=null}Ir.prototype={constructor:Ir,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(e){},afterBrush:function(e){},brush:function(e,t){},getBoundingRect:function(){},contain:function(e,t){return this.rectContain(e,t)},traverse:function(e,t){e.call(t,this)},rectContain:function(e,t){var i=this.transformCoordToLocal(e,t);return this.getBoundingRect().contain(i[0],i[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(e){return this.animate("style",e)},attrKV:function(e,t){"style"!==e?Tn.prototype.attrKV.call(this,e,t):this.style.set(t)},setStyle:function(e,t){return this.style.set(e,t),this.dirty(!1),this},useStyle:function(e){return this.style=new ia(e),this.dirty(!1),this},calculateTextPosition:null},Ve.inherits(Ir,Tn),Ve.mixin(Ir,Mr);var Tr=Ir;function Ar(e){Tr.call(this,e)}Ar.prototype={constructor:Ar,type:"image",brush:function(e,t){var i=this.style,n=i.image;i.bind(e,this,t);var a=this._image=ga.createOrUpdateImage(n,this._image,this,this.onload);if(a&&ga.isImageReady(a)){var r=i.x||0,o=i.y||0,s=i.width,l=i.height,u=a.width/a.height;if(null==s&&null!=l?s=l*u:null==l&&null!=s?l=s/u:null==s&&null==l&&(s=a.width,l=a.height),this.setTransform(e),i.sWidth&&i.sHeight){var h=i.sx||0,c=i.sy||0;e.drawImage(a,h,c,i.sWidth,i.sHeight,r,o,s,l)}else if(i.sx&&i.sy){var d=s-(h=i.sx),p=l-(c=i.sy);e.drawImage(a,h,c,d,p,r,o,s,l)}else e.drawImage(a,r,o,s,l);null!=i.text&&(this.restoreTransform(e),this.drawRectText(e,this.getBoundingRect()))}},getBoundingRect:function(){var e=this.style;return this._rect||(this._rect=new Pn(e.x||0,e.y||0,e.width||0,e.height||0)),this._rect}},Ve.inherits(Ar,Tr);var Cr=Ar,Dr=un.devicePixelRatio,Lr=1e5,Pr=314159,kr=.01;function Or(e){return parseInt(e,10)}var Rr=new Pn(0,0,0,0),Er=new Pn(0,0,0,0);var Nr=function(e,t,i){this.type="canvas";var n=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=i=Ve.extend({},i||{}),this.dpr=i.devicePixelRatio||Dr,this._singleCanvas=n,this.root=e;var a=e.style;a&&(a["-webkit-tap-highlight-color"]="transparent",a["-webkit-user-select"]=a["user-select"]=a["-webkit-touch-callout"]="none",e.innerHTML=""),this.storage=t;var r=this._zlevelList=[],o=this._layers={};if(this._layerConfig={},this._needsManuallyCompositing=!1,n){var s=e.width,l=e.height;null!=i.width&&(s=i.width),null!=i.height&&(l=i.height),this.dpr=i.devicePixelRatio||1,e.width=s*this.dpr,e.height=l*this.dpr,this._width=s,this._height=l;var u=new ua(e,this,this.dpr);u.__builtin__=!0,u.initContext(),o[314159]=u,u.zlevel=Pr,r.push(Pr),this._domRoot=e}else{this._width=this._getSize(0),this._height=this._getSize(1);var h=this._domRoot=function(e,t){var i=document.createElement("div");return i.style.cssText=["position:relative","width:"+e+"px","height:"+t+"px","padding:0","margin:0","border-width:0"].join(";")+";",i}(this._width,this._height);e.appendChild(h)}this._hoverlayer=null,this._hoverElements=[]};Nr.prototype={constructor:Nr,getType:function(){return"canvas"},isSingleCanvas:function(){return this._singleCanvas},getViewportRoot:function(){return this._domRoot},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(e){var t=this.storage.getDisplayList(!0),i=this._zlevelList;this._redrawId=Math.random(),this._paintList(t,e,this._redrawId);for(var n=0;n<i.length;n++){var a=i[n],r=this._layers[a];if(!r.__builtin__&&r.refresh){var o=0===n?this._backgroundColor:null;r.refresh(o)}}return this.refreshHover(),this},addHover:function(e,t){if(!e.__hoverMir){var i=new e.constructor({style:e.style,shape:e.shape,z:e.z,z2:e.z2,silent:e.silent});return i.__from=e,e.__hoverMir=i,t&&i.setStyle(t),this._hoverElements.push(i),i}},removeHover:function(e){var t=e.__hoverMir,i=this._hoverElements,n=Ve.indexOf(i,t);n>=0&&i.splice(n,1),e.__hoverMir=null},clearHover:function(e){for(var t=this._hoverElements,i=0;i<t.length;i++){var n=t[i].__from;n&&(n.__hoverMir=null)}t.length=0},refreshHover:function(){var e=this._hoverElements,t=e.length,i=this._hoverlayer;if(i&&i.clear(),t){Gn(e,this.storage.displayableSortFunc),i||(i=this._hoverlayer=this.getLayer(Lr));var n={};i.ctx.save();for(var a=0;a<t;){var r=e[a],o=r.__from;o&&o.__zr?(a++,o.invisible||(r.transform=o.transform,r.invTransform=o.invTransform,r.__clipPaths=o.__clipPaths,this._doPaintEl(r,i,!0,n))):(e.splice(a,1),o.__hoverMir=null,t--)}i.ctx.restore()}},getHoverLayer:function(){return this.getLayer(Lr)},_paintList:function(e,t,i){if(this._redrawId===i){t=t||!1,this._updateLayerStatus(e);var n=this._doPaintList(e,t);if(this._needsManuallyCompositing&&this._compositeManually(),!n){var a=this;ha((function(){a._paintList(e,t,i)}))}}},_compositeManually:function(){var e=this.getLayer(Pr).ctx,t=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,t,i),this.eachBuiltinLayer((function(n){n.virtual&&e.drawImage(n.dom,0,0,t,i)}))},_doPaintList:function(e,t){for(var i=[],n=0;n<this._zlevelList.length;n++){var a=this._zlevelList[n];(s=this._layers[a]).__builtin__&&s!==this._hoverlayer&&(s.__dirty||t)&&i.push(s)}for(var r=!0,o=0;o<i.length;o++){var s,l=(s=i[o]).ctx,u={};l.save();var h=t?s.__startIndex:s.__drawIndex,c=!t&&s.incremental&&Date.now,d=c&&Date.now(),p=s.zlevel===this._zlevelList[0]?this._backgroundColor:null;if(s.__startIndex===s.__endIndex)s.clear(!1,p);else if(h===s.__startIndex){var f=e[h];f.incremental&&f.notClear&&!t||s.clear(!1,p)}-1===h&&(console.error("For some unknown reason. drawIndex is -1"),h=s.__startIndex);for(var g=h;g<s.__endIndex;g++){var m=e[g];if(this._doPaintEl(m,s,t,u),m.__dirty=m.__dirtyText=!1,c)if(Date.now()-d>15)break}s.__drawIndex=g,s.__drawIndex<s.__endIndex&&(r=!1),u.prevElClipPaths&&l.restore(),l.restore()}return ie.wxa&&Ve.each(this._layers,(function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()})),r},_doPaintEl:function(e,t,i,n){var a=t.ctx,r=e.transform;if((t.__dirty||i)&&!e.invisible&&0!==e.style.opacity&&(!r||r[0]||r[3])&&(!e.culling||!function(e,t,i){return Rr.copy(e.getBoundingRect()),e.transform&&Rr.applyTransform(e.transform),Er.width=t,Er.height=i,!Rr.intersect(Er)}(e,this._width,this._height))){var o=e.__clipPaths,s=n.prevElClipPaths;s&&!function(e,t){if(e===t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!0;return!1}(o,s)||(s&&(a.restore(),n.prevElClipPaths=null,n.prevEl=null),o&&(a.save(),function(e,t){for(var i=0;i<e.length;i++){var n=e[i];n.setTransform(t),t.beginPath(),n.buildPath(t,n.shape),t.clip(),n.restoreTransform(t)}}(o,a),n.prevElClipPaths=o)),e.beforeBrush&&e.beforeBrush(a),e.brush(a,n.prevEl||null),n.prevEl=e,e.afterBrush&&e.afterBrush(a)}},getLayer:function(e,t){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Pr);var i=this._layers[e];return i||((i=new ua("zr_"+e,this,this.dpr)).zlevel=e,i.__builtin__=!0,this._layerConfig[e]?Ve.merge(i,this._layerConfig[e],!0):this._layerConfig[e-kr]&&Ve.merge(i,this._layerConfig[e-kr],!0),t&&(i.virtual=t),this.insertLayer(e,i),i.initContext()),i},insertLayer:function(e,t){var i=this._layers,n=this._zlevelList,a=n.length,r=null,o=-1,s=this._domRoot;if(!i[e]&&function(e){return!!e&&(!!e.__builtin__||"function"==typeof e.resize&&"function"==typeof e.refresh)}(t)){if(a>0&&e>n[0]){for(o=0;o<a-1&&!(n[o]<e&&n[o+1]>e);o++);r=i[n[o]]}if(n.splice(o+1,0,e),i[e]=t,!t.virtual)if(r){var l=r.dom;l.nextSibling?s.insertBefore(t.dom,l.nextSibling):s.appendChild(t.dom)}else s.firstChild?s.insertBefore(t.dom,s.firstChild):s.appendChild(t.dom)}},eachLayer:function(e,t){var i,n,a=this._zlevelList;for(n=0;n<a.length;n++)i=a[n],e.call(t,this._layers[i],i)},eachBuiltinLayer:function(e,t){var i,n,a,r=this._zlevelList;for(a=0;a<r.length;a++)n=r[a],(i=this._layers[n]).__builtin__&&e.call(t,i,n)},eachOtherLayer:function(e,t){var i,n,a,r=this._zlevelList;for(a=0;a<r.length;a++)n=r[a],(i=this._layers[n]).__builtin__||e.call(t,i,n)},getLayers:function(){return this._layers},_updateLayerStatus:function(e){function t(e){a&&(a.__endIndex!==e&&(a.__dirty=!0),a.__endIndex=e)}if(this.eachBuiltinLayer((function(e,t){e.__dirty=e.__used=!1})),this._singleCanvas)for(var i=1;i<e.length;i++){if((o=e[i]).zlevel!==e[i-1].zlevel||o.incremental){this._needsManuallyCompositing=!0;break}}var n,a=null,r=0;for(i=0;i<e.length;i++){var o,s,l=(o=e[i]).zlevel;n!==l&&(n=l,r=0),o.incremental?((s=this.getLayer(l+.001,this._needsManuallyCompositing)).incremental=!0,r=1):s=this.getLayer(l+(r>0?kr:0),this._needsManuallyCompositing),s.__builtin__||hn("ZLevel "+l+" has been used by unkown layer "+s.id),s!==a&&(s.__used=!0,s.__startIndex!==i&&(s.__dirty=!0),s.__startIndex=i,s.incremental?s.__drawIndex=-1:s.__drawIndex=i,t(i),a=s),o.__dirty&&(s.__dirty=!0,s.incremental&&s.__drawIndex<0&&(s.__drawIndex=i))}t(i),this.eachBuiltinLayer((function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)}))},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(e){e.clear()},setBackgroundColor:function(e){this._backgroundColor=e},configLayer:function(e,t){if(t){var i=this._layerConfig;i[e]?Ve.merge(i[e],t,!0):i[e]=t;for(var n=0;n<this._zlevelList.length;n++){var a=this._zlevelList[n];if(a===e||a===e+kr){var r=this._layers[a];Ve.merge(r,i[e],!0)}}}},delLayer:function(e){var t=this._layers,i=this._zlevelList,n=t[e];n&&(n.dom.parentNode.removeChild(n.dom),delete t[e],i.splice(Ve.indexOf(i,e),1))},resize:function(e,t){if(this._domRoot.style){var i=this._domRoot;i.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=t&&(n.height=t),e=this._getSize(0),t=this._getSize(1),i.style.display="",this._width!==e||t!==this._height){for(var a in i.style.width=e+"px",i.style.height=t+"px",this._layers)this._layers.hasOwnProperty(a)&&this._layers[a].resize(e,t);Ve.each(this._progressiveLayers,(function(i){i.resize(e,t)})),this.refresh(!0)}this._width=e,this._height=t}else{if(null==e||null==t)return;this._width=e,this._height=t,this.getLayer(Pr).resize(e,t)}return this},clearLayer:function(e){var t=this._layers[e];t&&t.clear()},dispose:function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},getRenderedCanvas:function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[314159].dom;var t=new ua("image",this,e.pixelRatio||this.dpr);if(t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor),e.pixelRatio<=this.dpr){this.refresh();var i=t.dom.width,n=t.dom.height,a=t.ctx;this.eachLayer((function(e){e.__builtin__?a.drawImage(e.dom,0,0,i,n):e.renderToCanvas&&(t.ctx.save(),e.renderToCanvas(t.ctx),t.ctx.restore())}))}else for(var r={},o=this.storage.getDisplayList(!0),s=0;s<o.length;s++){var l=o[s];this._doPaintEl(l,t,!0,r)}return t.dom},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(e){var t=this._opts,i=["width","height"][e],n=["clientWidth","clientHeight"][e],a=["paddingLeft","paddingTop"][e],r=["paddingRight","paddingBottom"][e];if(null!=t[i]&&"auto"!==t[i])return parseFloat(t[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[n]||Or(s[i])||Or(o.style[i]))-(Or(s[a])||0)-(Or(s[r])||0)|0},pathToImage:function(e,t){t=t||this.dpr;var i=document.createElement("canvas"),n=i.getContext("2d"),a=e.getBoundingRect(),r=e.style,o=r.shadowBlur*t,s=r.shadowOffsetX*t,l=r.shadowOffsetY*t,u=r.hasStroke()?r.lineWidth:0,h=Math.max(u/2,-s+o),c=Math.max(u/2,s+o),d=Math.max(u/2,-l+o),p=Math.max(u/2,l+o),f=a.width+h+c,g=a.height+d+p;i.width=f*t,i.height=g*t,n.scale(t,t),n.clearRect(0,0,f,g),n.dpr=t;var m={position:e.position,rotation:e.rotation,scale:e.scale};e.position=[h-a.x,d-a.y],e.rotation=0,e.scale=[1,1],e.updateTransform(),e&&e.brush(n);var v=new Cr({style:{x:0,y:0,image:i}});return null!=m.position&&(v.position=e.position=m.position),null!=m.rotation&&(v.rotation=e.rotation=m.rotation),null!=m.scale&&(v.scale=e.scale=m.scale),v}};var zr=Nr,Br=Et.Dispatcher,Vr=function(e){e=e||{},this.stage=e.stage||{},this.onframe=e.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,Br.call(this)};Vr.prototype={constructor:Vr,addClip:function(e){this._clips.push(e)},addAnimator:function(e){e.animation=this;for(var t=e.getClips(),i=0;i<t.length;i++)this.addClip(t[i])},removeClip:function(e){var t=Ve.indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)},removeAnimator:function(e){for(var t=e.getClips(),i=0;i<t.length;i++)this.removeClip(t[i]);e.animation=null},_update:function(){for(var e=(new Date).getTime()-this._pausedTime,t=e-this._time,i=this._clips,n=i.length,a=[],r=[],o=0;o<n;o++){var s=i[o],l=s.step(e,t);l&&(a.push(l),r.push(s))}for(o=0;o<n;)i[o]._needsRemove?(i[o]=i[n-1],i.pop(),n--):o++;n=a.length;for(o=0;o<n;o++)r[o].fire(a[o]);this._time=e,this.onframe(t),this.trigger("frame",t),this.stage.update&&this.stage.update()},_startLoop:function(){var e=this;this._running=!0,ha((function t(){e._running&&(ha(t),!e._paused&&e._update())}))},start:function(){this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop()},stop:function(){this._running=!1},pause:function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},resume:function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},clear:function(){this._clips=[]},isFinished:function(){return!this._clips.length},animate:function(e,t){var i=new sn(e,(t=t||{}).loop,t.getter,t.setter);return this.addAnimator(i),i}},Ve.mixin(Vr,Br);var Fr,Gr,Hr=Vr,Wr=Et.addEventListener,Ur=Et.removeEventListener,jr=Et.normalizeEvent,Zr=Et.getNativeEvent,Yr=ie.domSupported,Xr=(Gr={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Fr=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:Ve.map(Fr,(function(e){var t=e.replace("mouse","pointer");return Gr.hasOwnProperty(t)?t:e}))}),qr={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]};function $r(e){return"mousewheel"===e&&ie.browser.firefox?"DOMMouseScroll":e}function Kr(e){var t=e.pointerType;return"pen"===t||"touch"===t}function Jr(e){e&&(e.zrByTouch=!0)}function Qr(e,t){for(var i=t,n=!1;i&&9!==i.nodeType&&!(n=i.domBelongToZr||i!==t&&i===e.painterRoot);)i=i.parentNode;return n}function eo(e,t){this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}var to=eo.prototype;to.stopPropagation=to.stopImmediatePropagation=to.preventDefault=Ve.noop;var io={mousedown:function(e){e=jr(this.dom,e),this._mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=jr(this.dom,e);var t=this._mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||lo(this,!0),this.trigger("mousemove",e)},mouseup:function(e){e=jr(this.dom,e),lo(this,!1),this.trigger("mouseup",e)},mouseout:function(e){e=jr(this.dom,e),this._pointerCapturing&&(e.zrEventControl="no_globalout");var t=e.toElement||e.relatedTarget;e.zrIsToLocalDOM=Qr(this,t),this.trigger("mouseout",e)},touchstart:function(e){Jr(e=jr(this.dom,e)),this._lastTouchMoment=new Date,this.handler.processGesture(e,"start"),io.mousemove.call(this,e),io.mousedown.call(this,e)},touchmove:function(e){Jr(e=jr(this.dom,e)),this.handler.processGesture(e,"change"),io.mousemove.call(this,e)},touchend:function(e){Jr(e=jr(this.dom,e)),this.handler.processGesture(e,"end"),io.mouseup.call(this,e),+new Date-this._lastTouchMoment<300&&io.click.call(this,e)},pointerdown:function(e){io.mousedown.call(this,e)},pointermove:function(e){Kr(e)||io.mousemove.call(this,e)},pointerup:function(e){io.mouseup.call(this,e)},pointerout:function(e){Kr(e)||io.mouseout.call(this,e)}};Ve.each(["click","mousewheel","dblclick","contextmenu"],(function(e){io[e]=function(t){t=jr(this.dom,t),this.trigger(e,t)}}));var no={pointermove:function(e){Kr(e)||no.mousemove.call(this,e)},pointerup:function(e){no.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this._pointerCapturing;lo(this,!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function ao(e,t){var i=t.domHandlers;ie.pointerEventsSupported?Ve.each(Xr.pointer,(function(n){oo(t,n,(function(t){i[n].call(e,t)}))})):(ie.touchEventsSupported&&Ve.each(Xr.touch,(function(n){oo(t,n,(function(a){i[n].call(e,a),function(e){e.touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout((function(){e.touching=!1,e.touchTimer=null}),700)}(t)}))})),Ve.each(Xr.mouse,(function(n){oo(t,n,(function(a){a=Zr(a),t.touching||i[n].call(e,a)}))})))}function ro(e,t){function i(i){oo(t,i,(function(n){n=Zr(n),Qr(e,n.target)||(n=function(e,t){return jr(e.dom,new eo(e,t),!0)}(e,n),t.domHandlers[i].call(e,n))}),{capture:!0})}ie.pointerEventsSupported?Ve.each(qr.pointer,i):ie.touchEventsSupported||Ve.each(qr.mouse,i)}function oo(e,t,i,n){e.mounted[t]=i,e.listenerOpts[t]=n,Wr(e.domTarget,$r(t),i,n)}function so(e){var t=e.mounted;for(var i in t)t.hasOwnProperty(i)&&Ur(e.domTarget,$r(i),t[i],e.listenerOpts[i]);e.mounted={}}function lo(e,t){if(e._mayPointerCapture=null,Yr&&e._pointerCapturing^t){e._pointerCapturing=t;var i=e._globalHandlerScope;t?ro(e,i):so(i)}}function uo(e,t){this.domTarget=e,this.domHandlers=t,this.mounted={},this.listenerOpts={},this.touchTimer=null,this.touching=!1}function ho(e,t){gt.call(this),this.dom=e,this.painterRoot=t,this._localHandlerScope=new uo(e,io),Yr&&(this._globalHandlerScope=new uo(document,no)),this._pointerCapturing=!1,this._mayPointerCapture=null,ao(this,this._localHandlerScope)}var co=ho.prototype;co.dispose=function(){so(this._localHandlerScope),Yr&&so(this._globalHandlerScope)},co.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},Ve.mixin(ho,gt);var po=ho,fo=!ie.canvasSupported,go={canvas:zr},mo={};var vo=function(e,t,i){i=i||{},this.dom=t,this.id=e;var n=this,a=new Un,r=i.renderer;if(fo){if(!go.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");r="vml"}else r&&go[r]||(r="canvas");var o=new go[r](t,a,i,e);this.storage=a,this.painter=o;var s=ie.node||ie.worker?null:new po(o.getViewportRoot(),o.root);this.handler=new Yt(a,o,s,o.root),this.animation=new Hr({stage:{update:Ve.bind(this.flush,this)}}),this.animation.start(),this._needsRefresh;var l=a.delFromStorage,u=a.addToStorage;a.delFromStorage=function(e){l.call(a,e),e&&e.removeSelfFromZr(n)},a.addToStorage=function(e){u.call(a,e),e.addSelfToZr(n)}};vo.prototype={constructor:vo,getId:function(){return this.id},add:function(e){this.storage.addRoot(e),this._needsRefresh=!0},remove:function(e){this.storage.delRoot(e),this._needsRefresh=!0},configLayer:function(e,t){this.painter.configLayer&&this.painter.configLayer(e,t),this._needsRefresh=!0},setBackgroundColor:function(e){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var e;this._needsRefresh&&(e=!0,this.refreshImmediately()),this._needsRefreshHover&&(e=!0,this.refreshHoverImmediately()),e&&this.trigger("rendered")},addHover:function(e,t){if(this.painter.addHover){var i=this.painter.addHover(e,t);return this.refreshHover(),i}},removeHover:function(e){this.painter.removeHover&&(this.painter.removeHover(e),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(e){e=e||{},this.painter.resize(e.width,e.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(e,t){return this.painter.pathToImage(e,t)},setCursorStyle:function(e){this.handler.setCursorStyle(e)},findHover:function(e,t){return this.handler.findHover(e,t)},on:function(e,t,i){this.handler.on(e,t,i)},off:function(e,t){this.handler.off(e,t)},trigger:function(e,t){this.handler.trigger(e,t)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){var e;this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,e=this.id,delete mo[e]}};var yo=function(e,t){var i=new vo(te(),e,t);return mo[i.id]=i,i},xo={version:"4.3.1",init:yo,dispose:function(e){if(e)e.dispose();else{for(var t in mo)mo.hasOwnProperty(t)&&mo[t].dispose();mo={}}return this},getInstance:function(e){return mo[e]},registerPainter:function(e,t){go[e]=t}},_o=Ve.each,bo=Ve.isObject,wo=Ve.isArray,So="series\0";function Mo(e){return e instanceof Array?e:null==e?[]:[e]}function Io(e){return bo(e)&&e.id&&0===(e.id+"").indexOf("\0_ec_\0")}var To=0;function Ao(e,t){return e&&e.hasOwnProperty(t)}var Co=function(e,t,i){if(e){e[t]=e[t]||{},e.emphasis=e.emphasis||{},e.emphasis[t]=e.emphasis[t]||{};for(var n=0,a=i.length;n<a;n++){var r=i[n];!e.emphasis[t].hasOwnProperty(r)&&e[t].hasOwnProperty(r)&&(e.emphasis[t][r]=e[t][r])}}},Do=function(e,t){t=(t||[]).slice();var i=Ve.map(e||[],(function(e,t){return{exist:e}}));return _o(t,(function(e,n){if(bo(e)){for(var a=0;a<i.length;a++)if(!i[a].option&&null!=e.id&&i[a].exist.id===e.id+"")return i[a].option=e,void(t[n]=null);for(a=0;a<i.length;a++){var r=i[a].exist;if(!(i[a].option||null!=r.id&&null!=e.id||null==e.name||Io(e)||Io(r)||r.name!==e.name+""))return i[a].option=e,void(t[n]=null)}}})),_o(t,(function(e,t){if(bo(e)){for(var n=0;n<i.length;n++){var a=i[n].exist;if(!i[n].option&&!Io(a)&&null==e.id){i[n].option=e;break}}n>=i.length&&i.push({option:e})}})),i},Lo=function(e,t){var i={},n={};return a(e||[],i),a(t||[],n,i),[r(i),r(n)];function a(e,t,i){for(var n=0,a=e.length;n<a;n++)for(var r=e[n].seriesId,o=Mo(e[n].dataIndex),s=i&&i[r],l=0,u=o.length;l<u;l++){var h=o[l];s&&s[h]?s[h]=null:(t[r]||(t[r]={}))[h]=1}}function r(e,t){var i=[];for(var n in e)if(e.hasOwnProperty(n)&&null!=e[n])if(t)i.push(+n);else{var a=r(e[n],!0);a.length&&i.push({seriesId:n,dataIndex:a})}return i}},Po=function(e,t,i){e.setAttribute?e.setAttribute(t,i):e[t]=i},ko=function(e,t){return e.getAttribute?e.getAttribute(t):e[t]},Oo=function(e,t){var i=Ve.createHashMap(),n=[];return Ve.each(e,(function(e){var a=t(e);(i.get(a)||(n.push(a),i.set(a,[]))).push(e)})),{keys:n,buckets:i}},Ro={normalizeToArray:Mo,defaultEmphasis:Co,TEXT_STYLE_OPTIONS:["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"],getDataItemValue:function(e){return!bo(e)||wo(e)||e instanceof Date?e:e.value},isDataItemOption:function(e){return bo(e)&&!(e instanceof Array)},mappingToExists:Do,makeIdAndName:function(e){var t=Ve.createHashMap();_o(e,(function(e,i){var n=e.exist;n&&t.set(n.id,e)})),_o(e,(function(e,i){var n=e.option;Ve.assert(!n||null==n.id||!t.get(n.id)||t.get(n.id)===e,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&t.set(n.id,e),!e.keyInfo&&(e.keyInfo={})})),_o(e,(function(e,i){var n=e.exist,a=e.option,r=e.keyInfo;if(bo(a)){if(r.name=null!=a.name?a.name+"":n?n.name:So+i,n)r.id=n.id;else if(null!=a.id)r.id=a.id+"";else{var o=0;do{r.id="\0"+r.name+"\0"+o++}while(t.get(r.id))}t.set(r.id,e)}}))},isNameSpecified:function(e){var t=e.name;return!(!t||!t.indexOf(So))},isIdInner:Io,compressBatches:Lo,queryDataIndex:function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?Ve.isArray(t.dataIndex)?Ve.map(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?Ve.isArray(t.name)?Ve.map(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0},makeInner:function(){var e="__\0ec_inner_"+To+++"_"+Math.random().toFixed(5);return function(t){return t[e]||(t[e]={})}},parseFinder:function(e,t,i){if(Ve.isString(t)){var n={};n[t+"Index"]=0,t=n}var a=i&&i.defaultMainType;!a||Ao(t,a+"Index")||Ao(t,a+"Id")||Ao(t,a+"Name")||(t[a+"Index"]=0);var r={};return _o(t,(function(n,a){n=t[a];if("dataIndex"!==a&&"dataIndexInside"!==a){var o=a.match(/^(\w+)(Index|Id|Name)$/)||[],s=o[1],l=(o[2]||"").toLowerCase();if(!(!s||!l||null==n||"index"===l&&"none"===n||i&&i.includeMainTypes&&Ve.indexOf(i.includeMainTypes,s)<0)){var u={mainType:s};"index"===l&&"all"===n||(u[l]=n);var h=e.queryComponents(u);r[s+"Models"]=h,r[s+"Model"]=h[0]}}else r[a]=n})),r},setAttribute:Po,getAttribute:ko,getTooltipRenderMode:function(e){return"auto"===e?ie.domSupported?"html":"richText":e||"html"},groupData:Oo},Eo=".",No="___EC__COMPONENT__CONTAINER___";function zo(e){var t={main:"",sub:""};return e&&(e=e.split(Eo),t.main=e[0]||"",t.sub=e[1]||""),t}var Bo=0;function Vo(e,t){var i=Ve.slice(arguments,2);return this.superClass.prototype[t].apply(e,i)}function Fo(e,t,i){return this.superClass.prototype[t].apply(e,i)}var Go=function(e,t){e.$constructor=e,e.extend=function(e){var t=this,i=function(){e.$constructor?e.$constructor.apply(this,arguments):t.apply(this,arguments)};return Ve.extend(i.prototype,e),i.extend=this.extend,i.superCall=Vo,i.superApply=Fo,Ve.inherits(i,this),i.superClass=t,i}},Ho=function(e,t){t=t||{};var i={};if(e.registerClass=function(e,t){if(t)if(function(e){Ve.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=zo(t)).sub){if(t.sub!==No){var n=function(e){var t=i[e.main];t&&t[No]||((t=i[e.main]={})[No]=!0);return t}(t);n[t.sub]=e}}else i[t.main]=e;return e},e.getClass=function(e,t,n){var a=i[e];if(a&&a[No]&&(a=t?a[t]:null),n&&!a)throw new Error(t?"Component "+e+"."+(t||"")+" not exists. Load it first.":e+".type should be specified.");return a},e.getClassesByMainType=function(e){e=zo(e);var t=[],n=i[e.main];return n&&n[No]?Ve.each(n,(function(e,i){i!==No&&t.push(e)})):t.push(n),t},e.hasClass=function(e){return e=zo(e),!!i[e.main]},e.getAllClassMainTypes=function(){var e=[];return Ve.each(i,(function(t,i){e.push(i)})),e},e.hasSubTypes=function(e){e=zo(e);var t=i[e.main];return t&&t[No]},e.parseClassType=zo,t.registerWhenExtend){var n=e.extend;n&&(e.extend=function(t){var i=n.call(this,t);return e.registerClass(i,t.type)})}return e},Wo={parseClassType:zo,enableClassExtend:Go,enableClassCheck:function(e){var t=["__\0is_clz",Bo++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}},enableClassManagement:Ho,setReadOnly:function(e,t){}};var Uo=function(e){for(var t=0;t<e.length;t++)e[t][1]||(e[t][1]=e[t][0]);return function(t,i,n){for(var a={},r=0;r<e.length;r++){var o=e[r][1];if(!(i&&Ve.indexOf(i,o)>=0||n&&Ve.indexOf(n,o)<0)){var s=t.getShallow(o);null!=s&&(a[e[r][0]]=s)}}return a}},jo=Uo([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),Zo={getLineStyle:function(e){var t=jo(this,e);return t.lineDash=this.getLineDash(t.lineWidth),t},getLineDash:function(e){null==e&&(e=1);var t=this.get("type"),i=Math.max(e,2),n=4*e;return"solid"!==t&&null!=t&&("dashed"===t?[n,n]:[i,i])}},Yo=Zo,Xo=Uo([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),qo={getAreaStyle:function(e,t){return Xo(this,e,t)}},$o=lt.create,Ko=lt.distSquare,Jo=Math.pow,Qo=Math.sqrt,es=1e-8,ts=1e-4,is=Qo(3),ns=1/3,as=$o(),rs=$o(),os=$o();function ss(e){return e>-es&&e<es}function ls(e){return e>es||e<-es}function us(e,t,i,n,a){var r=1-a;return r*r*(r*e+3*a*t)+a*a*(a*n+3*r*i)}function hs(e,t,i,n){var a=1-n;return a*(a*e+2*n*t)+n*n*i}var cs=function(e,t,i,n,a,r){var o=n+3*(t-i)-e,s=3*(i-2*t+e),l=3*(t-e),u=e-a,h=s*s-3*o*l,c=s*l-9*o*u,d=l*l-3*s*u,p=0;if(ss(h)&&ss(c)){if(ss(s))r[0]=0;else(M=-l/s)>=0&&M<=1&&(r[p++]=M)}else{var f=c*c-4*h*d;if(ss(f)){var g=c/h,m=-g/2;(M=-s/o+g)>=0&&M<=1&&(r[p++]=M),m>=0&&m<=1&&(r[p++]=m)}else if(f>0){var v=Qo(f),y=h*s+1.5*o*(-c+v),x=h*s+1.5*o*(-c-v);(M=(-s-((y=y<0?-Jo(-y,ns):Jo(y,ns))+(x=x<0?-Jo(-x,ns):Jo(x,ns))))/(3*o))>=0&&M<=1&&(r[p++]=M)}else{var _=(2*h*s-3*o*c)/(2*Qo(h*h*h)),b=Math.acos(_)/3,w=Qo(h),S=Math.cos(b),M=(-s-2*w*S)/(3*o),I=(m=(-s+w*(S+is*Math.sin(b)))/(3*o),(-s+w*(S-is*Math.sin(b)))/(3*o));M>=0&&M<=1&&(r[p++]=M),m>=0&&m<=1&&(r[p++]=m),I>=0&&I<=1&&(r[p++]=I)}}return p},ds=function(e,t,i,n,a){var r=6*i-12*t+6*e,o=9*t+3*n-3*e-9*i,s=3*t-3*e,l=0;if(ss(o)){if(ls(r))(h=-s/r)>=0&&h<=1&&(a[l++]=h)}else{var u=r*r-4*o*s;if(ss(u))a[0]=-r/(2*o);else if(u>0){var h,c=Qo(u),d=(-r-c)/(2*o);(h=(-r+c)/(2*o))>=0&&h<=1&&(a[l++]=h),d>=0&&d<=1&&(a[l++]=d)}}return l},ps=function(e,t,i,n,a,r){var o=(t-e)*a+e,s=(i-t)*a+t,l=(n-i)*a+i,u=(s-o)*a+o,h=(l-s)*a+s,c=(h-u)*a+u;r[0]=e,r[1]=o,r[2]=u,r[3]=c,r[4]=c,r[5]=h,r[6]=l,r[7]=n},fs=function(e,t,i,n,a,r,o,s,l,u,h){var c,d,p,f,g,m=.005,v=1/0;as[0]=l,as[1]=u;for(var y=0;y<1;y+=.05)rs[0]=us(e,i,a,o,y),rs[1]=us(t,n,r,s,y),(f=Ko(as,rs))<v&&(c=y,v=f);v=1/0;for(var x=0;x<32&&!(m<ts);x++)d=c-m,p=c+m,rs[0]=us(e,i,a,o,d),rs[1]=us(t,n,r,s,d),f=Ko(rs,as),d>=0&&f<v?(c=d,v=f):(os[0]=us(e,i,a,o,p),os[1]=us(t,n,r,s,p),g=Ko(os,as),p<=1&&g<v?(c=p,v=g):m*=.5);return h&&(h[0]=us(e,i,a,o,c),h[1]=us(t,n,r,s,c)),Qo(v)},gs=function(e,t,i,n,a){var r=e-2*t+i,o=2*(t-e),s=e-n,l=0;if(ss(r)){if(ls(o))(h=-s/o)>=0&&h<=1&&(a[l++]=h)}else{var u=o*o-4*r*s;if(ss(u))(h=-o/(2*r))>=0&&h<=1&&(a[l++]=h);else if(u>0){var h,c=Qo(u),d=(-o-c)/(2*r);(h=(-o+c)/(2*r))>=0&&h<=1&&(a[l++]=h),d>=0&&d<=1&&(a[l++]=d)}}return l},ms=function(e,t,i,n,a){var r=(t-e)*n+e,o=(i-t)*n+t,s=(o-r)*n+r;a[0]=e,a[1]=r,a[2]=s,a[3]=s,a[4]=o,a[5]=i},vs=function(e,t,i,n,a,r,o,s,l){var u,h=.005,c=1/0;as[0]=o,as[1]=s;for(var d=0;d<1;d+=.05){rs[0]=hs(e,i,a,d),rs[1]=hs(t,n,r,d),(m=Ko(as,rs))<c&&(u=d,c=m)}c=1/0;for(var p=0;p<32&&!(h<ts);p++){var f=u-h,g=u+h;rs[0]=hs(e,i,a,f),rs[1]=hs(t,n,r,f);var m=Ko(rs,as);if(f>=0&&m<c)u=f,c=m;else{os[0]=hs(e,i,a,g),os[1]=hs(t,n,r,g);var v=Ko(os,as);g<=1&&v<c?(u=g,c=v):h*=.5}}return l&&(l[0]=hs(e,i,a,u),l[1]=hs(t,n,r,u)),Qo(c)},ys={cubicAt:us,cubicDerivativeAt:function(e,t,i,n,a){var r=1-a;return 3*(((t-e)*r+2*(i-t)*a)*r+(n-i)*a*a)},cubicRootAt:cs,cubicExtrema:ds,cubicSubdivide:ps,cubicProjectPoint:fs,quadraticAt:hs,quadraticDerivativeAt:function(e,t,i,n){return 2*((1-n)*(t-e)+n*(i-t))},quadraticRootAt:gs,quadraticExtremum:function(e,t,i){var n=e+i-2*t;return 0===n?.5:(e-t)/n},quadraticSubdivide:ms,quadraticProjectPoint:vs},xs=Math.min,_s=Math.max,bs=Math.sin,ws=Math.cos,Ss=2*Math.PI,Ms=lt.create(),Is=lt.create(),Ts=lt.create();var As=[],Cs=[];var Ds=function(e,t,i){if(0!==e.length){var n,a=e[0],r=a[0],o=a[0],s=a[1],l=a[1];for(n=1;n<e.length;n++)a=e[n],r=xs(r,a[0]),o=_s(o,a[0]),s=xs(s,a[1]),l=_s(l,a[1]);t[0]=r,t[1]=s,i[0]=o,i[1]=l}},Ls=function(e,t,i,n,a,r){a[0]=xs(e,i),a[1]=xs(t,n),r[0]=_s(e,i),r[1]=_s(t,n)},Ps=function(e,t,i,n,a,r,o,s,l,u){var h,c=ys.cubicExtrema,d=ys.cubicAt,p=c(e,i,a,o,As);for(l[0]=1/0,l[1]=1/0,u[0]=-1/0,u[1]=-1/0,h=0;h<p;h++){var f=d(e,i,a,o,As[h]);l[0]=xs(f,l[0]),u[0]=_s(f,u[0])}for(p=c(t,n,r,s,Cs),h=0;h<p;h++){var g=d(t,n,r,s,Cs[h]);l[1]=xs(g,l[1]),u[1]=_s(g,u[1])}l[0]=xs(e,l[0]),u[0]=_s(e,u[0]),l[0]=xs(o,l[0]),u[0]=_s(o,u[0]),l[1]=xs(t,l[1]),u[1]=_s(t,u[1]),l[1]=xs(s,l[1]),u[1]=_s(s,u[1])},ks=function(e,t,i,n,a,r,o,s){var l=ys.quadraticExtremum,u=ys.quadraticAt,h=_s(xs(l(e,i,a),1),0),c=_s(xs(l(t,n,r),1),0),d=u(e,i,a,h),p=u(t,n,r,c);o[0]=xs(e,a,d),o[1]=xs(t,r,p),s[0]=_s(e,a,d),s[1]=_s(t,r,p)},Os=function(e,t,i,n,a,r,o,s,l){var u=lt.min,h=lt.max,c=Math.abs(a-r);if(c%Ss<1e-4&&c>1e-4)return s[0]=e-i,s[1]=t-n,l[0]=e+i,void(l[1]=t+n);if(Ms[0]=ws(a)*i+e,Ms[1]=bs(a)*n+t,Is[0]=ws(r)*i+e,Is[1]=bs(r)*n+t,u(s,Ms,Is),h(l,Ms,Is),(a%=Ss)<0&&(a+=Ss),(r%=Ss)<0&&(r+=Ss),a>r&&!o?r+=Ss:a<r&&o&&(a+=Ss),o){var d=r;r=a,a=d}for(var p=0;p<r;p+=Math.PI/2)p>a&&(Ts[0]=ws(p)*i+e,Ts[1]=bs(p)*n+t,u(s,Ts,s),h(l,Ts,l))},Rs={fromPoints:Ds,fromLine:Ls,fromCubic:Ps,fromQuadratic:ks,fromArc:Os},Es=un.devicePixelRatio,Ns={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},zs=[],Bs=[],Vs=[],Fs=[],Gs=Math.min,Hs=Math.max,Ws=Math.cos,Us=Math.sin,js=Math.sqrt,Zs=Math.abs,Ys="undefined"!=typeof Float32Array,Xs=function(e){this._saveData=!e,this._saveData&&(this.data=[]),this._ctx=null};Xs.prototype={constructor:Xs,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(e,t,i){i=i||0,this._ux=Zs(i/Es/e)||0,this._uy=Zs(i/Es/t)||0},getContext:function(){return this._ctx},beginPath:function(e){return this._ctx=e,e&&e.beginPath(),e&&(this.dpr=e.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(e,t){return this.addData(Ns.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},lineTo:function(e,t){var i=Zs(e-this._xi)>this._ux||Zs(t-this._yi)>this._uy||this._len<5;return this.addData(Ns.L,e,t),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(e,t):this._ctx.lineTo(e,t)),i&&(this._xi=e,this._yi=t),this},bezierCurveTo:function(e,t,i,n,a,r){return this.addData(Ns.C,e,t,i,n,a,r),this._ctx&&(this._needsDash()?this._dashedBezierTo(e,t,i,n,a,r):this._ctx.bezierCurveTo(e,t,i,n,a,r)),this._xi=a,this._yi=r,this},quadraticCurveTo:function(e,t,i,n){return this.addData(Ns.Q,e,t,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(e,t,i,n):this._ctx.quadraticCurveTo(e,t,i,n)),this._xi=i,this._yi=n,this},arc:function(e,t,i,n,a,r){return this.addData(Ns.A,e,t,i,i,n,a-n,0,r?0:1),this._ctx&&this._ctx.arc(e,t,i,n,a,r),this._xi=Ws(a)*i+e,this._yi=Us(a)*i+t,this},arcTo:function(e,t,i,n,a){return this._ctx&&this._ctx.arcTo(e,t,i,n,a),this},rect:function(e,t,i,n){return this._ctx&&this._ctx.rect(e,t,i,n),this.addData(Ns.R,e,t,i,n),this},closePath:function(){this.addData(Ns.Z);var e=this._ctx,t=this._x0,i=this._y0;return e&&(this._needsDash()&&this._dashedLineTo(t,i),e.closePath()),this._xi=t,this._yi=i,this},fill:function(e){e&&e.fill(),this.toStatic()},stroke:function(e){e&&e.stroke(),this.toStatic()},setLineDash:function(e){if(e instanceof Array){this._lineDash=e,this._dashIdx=0;for(var t=0,i=0;i<e.length;i++)t+=e[i];this._dashSum=t}return this},setLineDashOffset:function(e){return this._dashOffset=e,this},len:function(){return this._len},setData:function(e){var t=e.length;this.data&&this.data.length===t||!Ys||(this.data=new Float32Array(t));for(var i=0;i<t;i++)this.data[i]=e[i];this._len=t},appendPath:function(e){e instanceof Array||(e=[e]);for(var t=e.length,i=0,n=this._len,a=0;a<t;a++)i+=e[a].len();Ys&&this.data instanceof Float32Array&&(this.data=new Float32Array(n+i));for(a=0;a<t;a++)for(var r=e[a].data,o=0;o<r.length;o++)this.data[n++]=r[o];this._len=n},addData:function(e){if(this._saveData){var t=this.data;this._len+arguments.length>t.length&&(this._expandData(),t=this.data);for(var i=0;i<arguments.length;i++)t[this._len++]=arguments[i];this._prevCmd=e}},_expandData:function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t<this._len;t++)e[t]=this.data[t];this.data=e}},_needsDash:function(){return this._lineDash},_dashedLineTo:function(e,t){var i,n,a=this._dashSum,r=this._dashOffset,o=this._lineDash,s=this._ctx,l=this._xi,u=this._yi,h=e-l,c=t-u,d=js(h*h+c*c),p=l,f=u,g=o.length;for(r<0&&(r=a+r),p-=(r%=a)*(h/=d),f-=r*(c/=d);h>0&&p<=e||h<0&&p>=e||0===h&&(c>0&&f<=t||c<0&&f>=t);)p+=h*(i=o[n=this._dashIdx]),f+=c*i,this._dashIdx=(n+1)%g,h>0&&p<l||h<0&&p>l||c>0&&f<u||c<0&&f>u||s[n%2?"moveTo":"lineTo"](h>=0?Gs(p,e):Hs(p,e),c>=0?Gs(f,t):Hs(f,t));h=p-e,c=f-t,this._dashOffset=-js(h*h+c*c)},_dashedBezierTo:function(e,t,i,n,a,r){var o,s,l,u,h,c=this._dashSum,d=this._dashOffset,p=this._lineDash,f=this._ctx,g=this._xi,m=this._yi,v=ys.cubicAt,y=0,x=this._dashIdx,_=p.length,b=0;for(d<0&&(d=c+d),d%=c,o=0;o<1;o+=.1)s=v(g,e,i,a,o+.1)-v(g,e,i,a,o),l=v(m,t,n,r,o+.1)-v(m,t,n,r,o),y+=js(s*s+l*l);for(;x<_&&!((b+=p[x])>d);x++);for(o=(b-d)/y;o<=1;)u=v(g,e,i,a,o),h=v(m,t,n,r,o),x%2?f.moveTo(u,h):f.lineTo(u,h),o+=p[x]/y,x=(x+1)%_;x%2!=0&&f.lineTo(a,r),s=a-u,l=r-h,this._dashOffset=-js(s*s+l*l)},_dashedQuadraticTo:function(e,t,i,n){var a=i,r=n;i=(i+2*e)/3,n=(n+2*t)/3,e=(this._xi+2*e)/3,t=(this._yi+2*t)/3,this._dashedBezierTo(e,t,i,n,a,r)},toStatic:function(){var e=this.data;e instanceof Array&&(e.length=this._len,Ys&&(this.data=new Float32Array(e)))},getBoundingRect:function(){zs[0]=zs[1]=Vs[0]=Vs[1]=Number.MAX_VALUE,Bs[0]=Bs[1]=Fs[0]=Fs[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,i=0,n=0,a=0,r=0;r<e.length;){var o=e[r++];switch(1===r&&(n=t=e[r],a=i=e[r+1]),o){case Ns.M:t=n=e[r++],i=a=e[r++],Vs[0]=n,Vs[1]=a,Fs[0]=n,Fs[1]=a;break;case Ns.L:Rs.fromLine(t,i,e[r],e[r+1],Vs,Fs),t=e[r++],i=e[r++];break;case Ns.C:Rs.fromCubic(t,i,e[r++],e[r++],e[r++],e[r++],e[r],e[r+1],Vs,Fs),t=e[r++],i=e[r++];break;case Ns.Q:Rs.fromQuadratic(t,i,e[r++],e[r++],e[r],e[r+1],Vs,Fs),t=e[r++],i=e[r++];break;case Ns.A:var s=e[r++],l=e[r++],u=e[r++],h=e[r++],c=e[r++],d=e[r++]+c;r+=1;var p=1-e[r++];1===r&&(n=Ws(c)*u+s,a=Us(c)*h+l),Rs.fromArc(s,l,u,h,c,d,p,Vs,Fs),t=Ws(d)*u+s,i=Us(d)*h+l;break;case Ns.R:n=t=e[r++],a=i=e[r++];var f=e[r++],g=e[r++];Rs.fromLine(n,a,n+f,a+g,Vs,Fs);break;case Ns.Z:t=n,i=a}lt.min(zs,zs,Vs),lt.max(Bs,Bs,Fs)}return 0===r&&(zs[0]=zs[1]=Bs[0]=Bs[1]=0),new Pn(zs[0],zs[1],Bs[0]-zs[0],Bs[1]-zs[1])},rebuildPath:function(e){for(var t,i,n,a,r,o,s=this.data,l=this._ux,u=this._uy,h=this._len,c=0;c<h;){var d=s[c++];switch(1===c&&(t=n=s[c],i=a=s[c+1]),d){case Ns.M:t=n=s[c++],i=a=s[c++],e.moveTo(n,a);break;case Ns.L:r=s[c++],o=s[c++],(Zs(r-n)>l||Zs(o-a)>u||c===h-1)&&(e.lineTo(r,o),n=r,a=o);break;case Ns.C:e.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],a=s[c-1];break;case Ns.Q:e.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],a=s[c-1];break;case Ns.A:var p=s[c++],f=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],x=s[c++],_=s[c++],b=g>m?g:m,w=g>m?1:g/m,S=g>m?m/g:1,M=v+y;Math.abs(g-m)>.001?(e.translate(p,f),e.rotate(x),e.scale(w,S),e.arc(0,0,b,v,M,1-_),e.scale(1/w,1/S),e.rotate(-x),e.translate(-p,-f)):e.arc(p,f,b,v,M,1-_),1===c&&(t=Ws(v)*g+p,i=Us(v)*m+f),n=Ws(M)*g+p,a=Us(M)*m+f;break;case Ns.R:t=n=s[c],i=a=s[c+1],e.rect(s[c++],s[c++],s[c++],s[c++]);break;case Ns.Z:e.closePath(),n=t,a=i}}}},Xs.CMD=Ns;var qs=Xs;var $s={containStroke:function(e,t,i,n,a,r,o){if(0===a)return!1;var s=a,l=0;if(o>t+s&&o>n+s||o<t-s&&o<n-s||r>e+s&&r>i+s||r<e-s&&r<i-s)return!1;if(e===i)return Math.abs(r-e)<=s/2;var u=(l=(t-n)/(e-i))*r-o+(e*n-i*t)/(e-i);return u*u/(l*l+1)<=s/2*s/2}};var Ks={containStroke:function(e,t,i,n,a,r,o,s,l,u,h){if(0===l)return!1;var c=l;return!(h>t+c&&h>n+c&&h>r+c&&h>s+c||h<t-c&&h<n-c&&h<r-c&&h<s-c||u>e+c&&u>i+c&&u>a+c&&u>o+c||u<e-c&&u<i-c&&u<a-c&&u<o-c)&&ys.cubicProjectPoint(e,t,i,n,a,r,o,s,u,h,null)<=c/2}},Js=ys.quadraticProjectPoint;var Qs={containStroke:function(e,t,i,n,a,r,o,s,l){if(0===o)return!1;var u=o;return!(l>t+u&&l>n+u&&l>r+u||l<t-u&&l<n-u&&l<r-u||s>e+u&&s>i+u&&s>a+u||s<e-u&&s<i-u&&s<a-u)&&Js(e,t,i,n,a,r,s,l,null)<=u/2}},el=2*Math.PI;var tl={normalizeRadian:function(e){return(e%=el)<0&&(e+=el),e}},il=tl.normalizeRadian,nl=2*Math.PI;var al={containStroke:function(e,t,i,n,a,r,o,s,l){if(0===o)return!1;var u=o;s-=e,l-=t;var h=Math.sqrt(s*s+l*l);if(h-u>i||h+u<i)return!1;if(Math.abs(n-a)%nl<1e-4)return!0;if(r){var c=n;n=il(a),a=il(c)}else n=il(n),a=il(a);n>a&&(a+=nl);var d=Math.atan2(l,s);return d<0&&(d+=nl),d>=n&&d<=a||d+nl>=n&&d+nl<=a}};var rl=function(e,t,i,n,a,r){if(r>t&&r>n||r<t&&r<n)return 0;if(n===t)return 0;var o=n<t?1:-1,s=(r-t)/(n-t);1!==s&&0!==s||(o=n<t?.5:-.5);var l=s*(i-e)+e;return l===a?1/0:l>a?o:0},ol=tl.normalizeRadian,sl=qs.CMD,ll=2*Math.PI,ul=1e-4;var hl=[-1,-1,-1],cl=[-1,-1];function dl(e,t,i,n,a,r,o,s,l,u){if(u>t&&u>n&&u>r&&u>s||u<t&&u<n&&u<r&&u<s)return 0;var h,c=ys.cubicRootAt(t,n,r,s,u,hl);if(0===c)return 0;for(var d,p,f=0,g=-1,m=0;m<c;m++){var v=hl[m],y=0===v||1===v?.5:1;ys.cubicAt(e,i,a,o,v)<l||(g<0&&(g=ys.cubicExtrema(t,n,r,s,cl),cl[1]<cl[0]&&g>1&&(h=void 0,h=cl[0],cl[0]=cl[1],cl[1]=h),d=ys.cubicAt(t,n,r,s,cl[0]),g>1&&(p=ys.cubicAt(t,n,r,s,cl[1]))),2===g?v<cl[0]?f+=d<t?y:-y:v<cl[1]?f+=p<d?y:-y:f+=s<p?y:-y:v<cl[0]?f+=d<t?y:-y:f+=s<d?y:-y)}return f}function pl(e,t,i,n,a,r,o,s){if(s>t&&s>n&&s>r||s<t&&s<n&&s<r)return 0;var l=ys.quadraticRootAt(t,n,r,s,hl);if(0===l)return 0;var u=ys.quadraticExtremum(t,n,r);if(u>=0&&u<=1){for(var h=0,c=ys.quadraticAt(t,n,r,u),d=0;d<l;d++){var p=0===hl[d]||1===hl[d]?.5:1;ys.quadraticAt(e,i,a,hl[d])<o||(hl[d]<u?h+=c<t?p:-p:h+=r<c?p:-p)}return h}p=0===hl[0]||1===hl[0]?.5:1;return ys.quadraticAt(e,i,a,hl[0])<o?0:r<t?p:-p}function fl(e,t,i,n,a,r,o,s){if((s-=t)>i||s<-i)return 0;var l=Math.sqrt(i*i-s*s);hl[0]=-l,hl[1]=l;var u=Math.abs(n-a);if(u<1e-4)return 0;if(u%ll<1e-4){n=0,a=ll;var h=r?1:-1;return o>=hl[0]+e&&o<=hl[1]+e?h:0}if(r){l=n;n=ol(a),a=ol(l)}else n=ol(n),a=ol(a);n>a&&(a+=ll);for(var c=0,d=0;d<2;d++){var p=hl[d];if(p+e>o){var f=Math.atan2(s,p);h=r?1:-1;f<0&&(f=ll+f),(f>=n&&f<=a||f+ll>=n&&f+ll<=a)&&(f>Math.PI/2&&f<1.5*Math.PI&&(h=-h),c+=h)}}return c}function gl(e,t,i,n,a){for(var r,o,s=0,l=0,u=0,h=0,c=0,d=0;d<e.length;){var p=e[d++];switch(p===sl.M&&d>1&&(i||(s+=rl(l,u,h,c,n,a))),1===d&&(h=l=e[d],c=u=e[d+1]),p){case sl.M:l=h=e[d++],u=c=e[d++];break;case sl.L:if(i){if($s.containStroke(l,u,e[d],e[d+1],t,n,a))return!0}else s+=rl(l,u,e[d],e[d+1],n,a)||0;l=e[d++],u=e[d++];break;case sl.C:if(i){if(Ks.containStroke(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],t,n,a))return!0}else s+=dl(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],n,a)||0;l=e[d++],u=e[d++];break;case sl.Q:if(i){if(Qs.containStroke(l,u,e[d++],e[d++],e[d],e[d+1],t,n,a))return!0}else s+=pl(l,u,e[d++],e[d++],e[d],e[d+1],n,a)||0;l=e[d++],u=e[d++];break;case sl.A:var f=e[d++],g=e[d++],m=e[d++],v=e[d++],y=e[d++],x=e[d++];d+=1;var _=1-e[d++],b=Math.cos(y)*m+f,w=Math.sin(y)*v+g;d>1?s+=rl(l,u,b,w,n,a):(h=b,c=w);var S=(n-f)*v/m+f;if(i){if(al.containStroke(f,g,v,y,y+x,_,t,S,a))return!0}else s+=fl(f,g,v,y,y+x,_,S,a);l=Math.cos(y+x)*m+f,u=Math.sin(y+x)*v+g;break;case sl.R:h=l=e[d++],c=u=e[d++];b=h+e[d++],w=c+e[d++];if(i){if($s.containStroke(h,c,b,c,t,n,a)||$s.containStroke(b,c,b,w,t,n,a)||$s.containStroke(b,w,h,w,t,n,a)||$s.containStroke(h,w,h,c,t,n,a))return!0}else s+=rl(b,c,b,w,n,a),s+=rl(h,w,h,c,n,a);break;case sl.Z:if(i){if($s.containStroke(l,u,h,c,t,n,a))return!0}else s+=rl(l,u,h,c,n,a);l=h,u=c}}return i||(r=u,o=c,Math.abs(r-o)<ul)||(s+=rl(l,u,h,c,n,a)||0),0!==s}var ml={contain:function(e,t,i){return gl(e,0,!1,t,i)},containStroke:function(e,t,i,n){return gl(e,t,!0,i,n)}},vl=aa.prototype.getCanvasPattern,yl=Math.abs,xl=new qs(!0);function _l(e){Tr.call(this,e),this.path=null}_l.prototype={constructor:_l,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(e,t){var i,n=this.style,a=this.path||xl,r=n.hasStroke(),o=n.hasFill(),s=n.fill,l=n.stroke,u=o&&!!s.colorStops,h=r&&!!l.colorStops,c=o&&!!s.image,d=r&&!!l.image;(n.bind(e,this,t),this.setTransform(e),this.__dirty)&&(u&&(i=i||this.getBoundingRect(),this._fillGradient=n.getGradient(e,s,i)),h&&(i=i||this.getBoundingRect(),this._strokeGradient=n.getGradient(e,l,i)));u?e.fillStyle=this._fillGradient:c&&(e.fillStyle=vl.call(s,e)),h?e.strokeStyle=this._strokeGradient:d&&(e.strokeStyle=vl.call(l,e));var p=n.lineDash,f=n.lineDashOffset,g=!!e.setLineDash,m=this.getGlobalScale();if(a.setScale(m[0],m[1],this.segmentIgnoreThreshold),this.__dirtyPath||p&&!g&&r?(a.beginPath(e),p&&!g&&(a.setLineDash(p),a.setLineDashOffset(f)),this.buildPath(a,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(e.beginPath(),this.path.rebuildPath(e)),o)if(null!=n.fillOpacity){var v=e.globalAlpha;e.globalAlpha=n.fillOpacity*n.opacity,a.fill(e),e.globalAlpha=v}else a.fill(e);if(p&&g&&(e.setLineDash(p),e.lineDashOffset=f),r)if(null!=n.strokeOpacity){v=e.globalAlpha;e.globalAlpha=n.strokeOpacity*n.opacity,a.stroke(e),e.globalAlpha=v}else a.stroke(e);p&&g&&e.setLineDash([]),null!=n.text&&(this.restoreTransform(e),this.drawRectText(e,this.getBoundingRect()))},buildPath:function(e,t,i){},createPathProxy:function(){this.path=new qs},getBoundingRect:function(){var e=this._rect,t=this.style,i=!e;if(i){var n=this.path;n||(n=this.path=new qs),this.__dirtyPath&&(n.beginPath(),this.buildPath(n,this.shape,!1)),e=n.getBoundingRect()}if(this._rect=e,t.hasStroke()){var a=this._rectWithStroke||(this._rectWithStroke=e.clone());if(this.__dirty||i){a.copy(e);var r=t.lineWidth,o=t.strokeNoScale?this.getLineScale():1;t.hasFill()||(r=Math.max(r,this.strokeContainThreshold||4)),o>1e-10&&(a.width+=r/o,a.height+=r/o,a.x-=r/o/2,a.y-=r/o/2)}return a}return e},contain:function(e,t){var i=this.transformCoordToLocal(e,t),n=this.getBoundingRect(),a=this.style;if(e=i[0],t=i[1],n.contain(e,t)){var r=this.path.data;if(a.hasStroke()){var o=a.lineWidth,s=a.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(a.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),ml.containStroke(r,o/s,e,t)))return!0}if(a.hasFill())return ml.contain(r,e,t)}return!1},dirty:function(e){null==e&&(e=!0),e&&(this.__dirtyPath=e,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(e){return this.animate("shape",e)},attrKV:function(e,t){"shape"===e?(this.setShape(t),this.__dirtyPath=!0,this._rect=null):Tr.prototype.attrKV.call(this,e,t)},setShape:function(e,t){var i=this.shape;if(i){if(Ve.isObject(e))for(var n in e)e.hasOwnProperty(n)&&(i[n]=e[n]);else i[e]=t;this.dirty(!0)}return this},getLineScale:function(){var e=this.transform;return e&&yl(e[0]-1)>1e-10&&yl(e[3]-1)>1e-10?Math.sqrt(yl(e[0]*e[3]-e[2]*e[1])):1}},_l.extend=function(e){var t=function(t){_l.call(this,t),e.style&&this.style.extendFrom(e.style,!1);var i=e.shape;if(i){this.shape=this.shape||{};var n=this.shape;for(var a in i)!n.hasOwnProperty(a)&&i.hasOwnProperty(a)&&(n[a]=i[a])}e.init&&e.init.call(this,t)};for(var i in Ve.inherits(t,_l),e)"style"!==i&&"shape"!==i&&(t.prototype[i]=e[i]);return t},Ve.inherits(_l,Tr);var bl=_l,wl=lt.applyTransform,Sl=qs.CMD,Ml=[[],[],[]],Il=Math.sqrt,Tl=Math.atan2;var Al=function(e,t){var i,n,a,r,o,s=e.data,l=Sl.M,u=Sl.C,h=Sl.L,c=Sl.R,d=Sl.A,p=Sl.Q;for(a=0,r=0;a<s.length;){switch(i=s[a++],r=a,n=0,i){case l:case h:n=1;break;case u:n=3;break;case p:n=2;break;case d:var f=t[4],g=t[5],m=Il(t[0]*t[0]+t[1]*t[1]),v=Il(t[2]*t[2]+t[3]*t[3]),y=Tl(-t[1]/v,t[0]/m);s[a]*=m,s[a++]+=f,s[a]*=v,s[a++]+=g,s[a++]*=m,s[a++]*=v,s[a++]+=y,s[a++]+=y,r=a+=2;break;case c:x[0]=s[a++],x[1]=s[a++],wl(x,x,t),s[r++]=x[0],s[r++]=x[1],x[0]+=s[a++],x[1]+=s[a++],wl(x,x,t),s[r++]=x[0],s[r++]=x[1]}for(o=0;o<n;o++){var x;(x=Ml[o])[0]=s[a++],x[1]=s[a++],wl(x,x,t),s[r++]=x[0],s[r++]=x[1]}}},Cl=Math.sqrt,Dl=Math.sin,Ll=Math.cos,Pl=Math.PI,kl=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},Ol=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(kl(e)*kl(t))},Rl=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Ol(e,t))};function El(e,t,i,n,a,r,o,s,l,u,h){var c=l*(Pl/180),d=Ll(c)*(e-i)/2+Dl(c)*(t-n)/2,p=-1*Dl(c)*(e-i)/2+Ll(c)*(t-n)/2,f=d*d/(o*o)+p*p/(s*s);f>1&&(o*=Cl(f),s*=Cl(f));var g=(a===r?-1:1)*Cl((o*o*(s*s)-o*o*(p*p)-s*s*(d*d))/(o*o*(p*p)+s*s*(d*d)))||0,m=g*o*p/s,v=g*-s*d/o,y=(e+i)/2+Ll(c)*m-Dl(c)*v,x=(t+n)/2+Dl(c)*m+Ll(c)*v,_=Rl([1,0],[(d-m)/o,(p-v)/s]),b=[(d-m)/o,(p-v)/s],w=[(-1*d-m)/o,(-1*p-v)/s],S=Rl(b,w);Ol(b,w)<=-1&&(S=Pl),Ol(b,w)>=1&&(S=0),0===r&&S>0&&(S-=2*Pl),1===r&&S<0&&(S+=2*Pl),h.addData(u,y,x,o,s,_,S,c,r)}var Nl=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,zl=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Bl(e,t){var i=function(e){if(!e)return new qs;for(var t,i=0,n=0,a=i,r=n,o=new qs,s=qs.CMD,l=e.match(Nl),u=0;u<l.length;u++){for(var h,c=l[u],d=c.charAt(0),p=c.match(zl)||[],f=p.length,g=0;g<f;g++)p[g]=parseFloat(p[g]);for(var m=0;m<f;){var v,y,x,_,b,w,S,M=i,I=n;switch(d){case"l":i+=p[m++],n+=p[m++],h=s.L,o.addData(h,i,n);break;case"L":i=p[m++],n=p[m++],h=s.L,o.addData(h,i,n);break;case"m":i+=p[m++],n+=p[m++],h=s.M,o.addData(h,i,n),a=i,r=n,d="l";break;case"M":i=p[m++],n=p[m++],h=s.M,o.addData(h,i,n),a=i,r=n,d="L";break;case"h":i+=p[m++],h=s.L,o.addData(h,i,n);break;case"H":i=p[m++],h=s.L,o.addData(h,i,n);break;case"v":n+=p[m++],h=s.L,o.addData(h,i,n);break;case"V":n=p[m++],h=s.L,o.addData(h,i,n);break;case"C":h=s.C,o.addData(h,p[m++],p[m++],p[m++],p[m++],p[m++],p[m++]),i=p[m-2],n=p[m-1];break;case"c":h=s.C,o.addData(h,p[m++]+i,p[m++]+n,p[m++]+i,p[m++]+n,p[m++]+i,p[m++]+n),i+=p[m-2],n+=p[m-1];break;case"S":v=i,y=n;var T=o.len(),A=o.data;t===s.C&&(v+=i-A[T-4],y+=n-A[T-3]),h=s.C,M=p[m++],I=p[m++],i=p[m++],n=p[m++],o.addData(h,v,y,M,I,i,n);break;case"s":v=i,y=n,T=o.len(),A=o.data,t===s.C&&(v+=i-A[T-4],y+=n-A[T-3]),h=s.C,M=i+p[m++],I=n+p[m++],i+=p[m++],n+=p[m++],o.addData(h,v,y,M,I,i,n);break;case"Q":M=p[m++],I=p[m++],i=p[m++],n=p[m++],h=s.Q,o.addData(h,M,I,i,n);break;case"q":M=p[m++]+i,I=p[m++]+n,i+=p[m++],n+=p[m++],h=s.Q,o.addData(h,M,I,i,n);break;case"T":v=i,y=n,T=o.len(),A=o.data,t===s.Q&&(v+=i-A[T-4],y+=n-A[T-3]),i=p[m++],n=p[m++],h=s.Q,o.addData(h,v,y,i,n);break;case"t":v=i,y=n,T=o.len(),A=o.data,t===s.Q&&(v+=i-A[T-4],y+=n-A[T-3]),i+=p[m++],n+=p[m++],h=s.Q,o.addData(h,v,y,i,n);break;case"A":x=p[m++],_=p[m++],b=p[m++],w=p[m++],S=p[m++],El(M=i,I=n,i=p[m++],n=p[m++],w,S,x,_,b,h=s.A,o);break;case"a":x=p[m++],_=p[m++],b=p[m++],w=p[m++],S=p[m++],El(M=i,I=n,i+=p[m++],n+=p[m++],w,S,x,_,b,h=s.A,o)}}"z"!==d&&"Z"!==d||(h=s.Z,o.addData(h),i=a,n=r),t=h}return o.toStatic(),o}(e);return(t=t||{}).buildPath=function(e){if(e.setData){e.setData(i.data),(t=e.getContext())&&e.rebuildPath(t)}else{var t=e;i.rebuildPath(t)}},t.applyTransform=function(e){Al(i,e),this.dirty(!0)},t}var Vl=function(e,t){for(var i=[],n=e.length,a=0;a<n;a++){var r=e[a];r.path||r.createPathProxy(),r.__dirtyPath&&r.buildPath(r.path,r.shape,!0),i.push(r.path)}var o=new bl(t);return o.createPathProxy(),o.buildPath=function(e){e.appendPath(i);var t=e.getContext();t&&e.rebuildPath(t)},o},Fl={createFromString:function(e,t){return new bl(Bl(e,t))},extendFromString:function(e,t){return bl.extend(Bl(e,t))},mergePath:Vl},Gl=Yn.ContextCachedBy,Hl=function(e){Tr.call(this,e)};Hl.prototype={constructor:Hl,type:"text",brush:function(e,t){var i=this.style;this.__dirty&&_r.normalizeTextStyle(i,!0),i.fill=i.stroke=i.shadowBlur=i.shadowColor=i.shadowOffsetX=i.shadowOffsetY=null;var n=i.text;null!=n&&(n+=""),_r.needDrawText(n,i)?(this.setTransform(e),_r.renderText(this,e,n,i,null,t),this.restoreTransform(e)):e.__attrCachedBy=Gl.NONE},getBoundingRect:function(){var e=this.style;if(this.__dirty&&_r.normalizeTextStyle(e,!0),!this._rect){e.text;var t=Wa.getBoundingRect(e.text+"",e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich);if(t.x+=e.x||0,t.y+=e.y||0,_r.getStroke(e.textStroke,e.textStrokeWidth)){var i=e.textStrokeWidth;t.x-=i/2,t.y-=i/2,t.width+=i,t.height+=i}this._rect=t}return this._rect}},Ve.inherits(Hl,Tr);var Wl=Hl,Ul=bl.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(e,t,i){i&&e.moveTo(t.cx+t.r,t.cy),e.arc(t.cx,t.cy,t.r,0,2*Math.PI,!0)}}),jl=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]];var Zl=function(e){return ie.browser.ie&&ie.browser.version>=11?function(){var t,i=this.__clipPaths,n=this.style;if(i)for(var a=0;a<i.length;a++){var r=i[a],o=r&&r.shape,s=r&&r.type;if(o&&("sector"===s&&o.startAngle===o.endAngle||"rect"===s&&(!o.width||!o.height))){for(var l=0;l<jl.length;l++)jl[l][2]=n[jl[l][0]],n[jl[l][0]]=jl[l][1];t=!0;break}}if(e.apply(this,arguments),t)for(l=0;l<jl.length;l++)n[jl[l][0]]=jl[l][2]}:e},Yl=bl.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},brush:Zl(bl.prototype.brush),buildPath:function(e,t){var i=t.cx,n=t.cy,a=Math.max(t.r0||0,0),r=Math.max(t.r,0),o=t.startAngle,s=t.endAngle,l=t.clockwise,u=Math.cos(o),h=Math.sin(o);e.moveTo(u*a+i,h*a+n),e.lineTo(u*r+i,h*r+n),e.arc(i,n,r,o,s,!l),e.lineTo(Math.cos(s)*a+i,Math.sin(s)*a+n),0!==a&&e.arc(i,n,a,s,o,l),e.closePath()}}),Xl=bl.extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(e,t){var i=t.cx,n=t.cy,a=2*Math.PI;e.moveTo(i+t.r,n),e.arc(i,n,t.r,0,a,!1),e.moveTo(i+t.r0,n),e.arc(i,n,t.r0,0,a,!0)}}),ql=Xl,$l=lt.distance;function Kl(e,t,i,n,a,r,o){var s=.5*(i-e),l=.5*(n-t);return(2*(t-i)+s+l)*o+(-3*(t-i)-2*s-l)*r+s*a+t}var Jl=function(e,t){for(var i=e.length,n=[],a=0,r=1;r<i;r++)a+=$l(e[r-1],e[r]);var o=a/2;for(o=o<i?i:o,r=0;r<o;r++){var s,l,u,h=r/(o-1)*(t?i:i-1),c=Math.floor(h),d=h-c,p=e[c%i];t?(s=e[(c-1+i)%i],l=e[(c+1)%i],u=e[(c+2)%i]):(s=e[0===c?c:c-1],l=e[c>i-2?i-1:c+1],u=e[c>i-3?i-1:c+2]);var f=d*d,g=d*f;n.push([Kl(s[0],p[0],l[0],u[0],d,f,g),Kl(s[1],p[1],l[1],u[1],d,f,g)])}return n},Ql=lt.min,eu=lt.max,tu=lt.scale,iu=lt.distance,nu=lt.add,au=lt.clone,ru=lt.sub;var ou=function(e,t,i,n){var a,r,o,s,l=[],u=[],h=[],c=[];if(n){o=[1/0,1/0],s=[-1/0,-1/0];for(var d=0,p=e.length;d<p;d++)Ql(o,o,e[d]),eu(s,s,e[d]);Ql(o,o,n[0]),eu(s,s,n[1])}for(d=0,p=e.length;d<p;d++){var f=e[d];if(i)a=e[d?d-1:p-1],r=e[(d+1)%p];else{if(0===d||d===p-1){l.push(au(e[d]));continue}a=e[d-1],r=e[d+1]}ru(u,r,a),tu(u,u,t);var g=iu(f,a),m=iu(f,r),v=g+m;0!==v&&(g/=v,m/=v),tu(h,u,-g),tu(c,u,m);var y=nu([],f,h),x=nu([],f,c);n&&(eu(y,y,o),Ql(y,y,s),eu(x,x,o),Ql(x,x,s)),l.push(y),l.push(x)}return i&&l.push(l.shift()),l};var su=function(e,t,i){var n=t.points,a=t.smooth;if(n&&n.length>=2){if(a&&"spline"!==a){var r=ou(n,a,i,t.smoothConstraint);e.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(i?o:o-1);s++){var l=r[2*s],u=r[2*s+1],h=n[(s+1)%o];e.bezierCurveTo(l[0],l[1],u[0],u[1],h[0],h[1])}}else{"spline"===a&&(n=Jl(n,i)),e.moveTo(n[0][0],n[0][1]);s=1;for(var c=n.length;s<c;s++)e.lineTo(n[s][0],n[s][1])}i&&e.closePath()}},lu={buildPath:su},uu=bl.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(e,t){lu.buildPath(e,t,!0)}}),hu=bl.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(e,t){lu.buildPath(e,t,!1)}}),cu=Math.round;function du(e,t,i){if(!t)return e;var n=cu(2*e);return(n+cu(t))%2==0?n/2:(n+(i?1:-1))/2}var pu=function(e,t,i){if(t){var n=t.x1,a=t.x2,r=t.y1,o=t.y2;e.x1=n,e.x2=a,e.y1=r,e.y2=o;var s=i&&i.lineWidth;s&&(cu(2*n)===cu(2*a)&&(e.x1=e.x2=du(n,s,!0)),cu(2*r)===cu(2*o)&&(e.y1=e.y2=du(r,s,!0)))}},fu=function(e,t,i){if(t){var n=t.x,a=t.y,r=t.width,o=t.height;e.x=n,e.y=a,e.width=r,e.height=o;var s=i&&i.lineWidth;s&&(e.x=du(n,s,!0),e.y=du(a,s,!0),e.width=Math.max(du(n+r,s,!1)-e.x,0===r?0:1),e.height=Math.max(du(a+o,s,!1)-e.y,0===o?0:1))}},gu={subPixelOptimizeLine:pu,subPixelOptimizeRect:fu,subPixelOptimize:du},mu=gu.subPixelOptimizeRect,vu={},yu=bl.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(e,t){var i,n,a,r;this.subPixelOptimize?(mu(vu,t,this.style),i=vu.x,n=vu.y,a=vu.width,r=vu.height,vu.r=t.r,t=vu):(i=t.x,n=t.y,a=t.width,r=t.height),t.r?Ua.buildPath(e,t):e.rect(i,n,a,r),e.closePath()}}),xu=gu.subPixelOptimizeLine,_u={},bu=bl.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i,n,a,r;this.subPixelOptimize?(xu(_u,t,this.style),i=_u.x1,n=_u.y1,a=_u.x2,r=_u.y2):(i=t.x1,n=t.y1,a=t.x2,r=t.y2);var o=t.percent;0!==o&&(e.moveTo(i,n),o<1&&(a=i*(1-o)+a*o,r=n*(1-o)+r*o),e.lineTo(a,r))},pointAt:function(e){var t=this.shape;return[t.x1*(1-e)+t.x2*e,t.y1*(1-e)+t.y2*e]}}),wu=ys.quadraticSubdivide,Su=ys.cubicSubdivide,Mu=ys.quadraticAt,Iu=ys.cubicAt,Tu=ys.quadraticDerivativeAt,Au=ys.cubicDerivativeAt,Cu=[];function Du(e,t,i){var n=e.cpx2,a=e.cpy2;return null===n||null===a?[(i?Au:Iu)(e.x1,e.cpx1,e.cpx2,e.x2,t),(i?Au:Iu)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(i?Tu:Mu)(e.x1,e.cpx1,e.x2,t),(i?Tu:Mu)(e.y1,e.cpy1,e.y2,t)]}var Lu=bl.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.x1,n=t.y1,a=t.x2,r=t.y2,o=t.cpx1,s=t.cpy1,l=t.cpx2,u=t.cpy2,h=t.percent;0!==h&&(e.moveTo(i,n),null==l||null==u?(h<1&&(wu(i,o,a,h,Cu),o=Cu[1],a=Cu[2],wu(n,s,r,h,Cu),s=Cu[1],r=Cu[2]),e.quadraticCurveTo(o,s,a,r)):(h<1&&(Su(i,o,l,a,h,Cu),o=Cu[1],l=Cu[2],a=Cu[3],Su(n,s,u,r,h,Cu),s=Cu[1],u=Cu[2],r=Cu[3]),e.bezierCurveTo(o,s,l,u,a,r)))},pointAt:function(e){return Du(this.shape,e,!1)},tangentAt:function(e){var t=Du(this.shape,e,!0);return lt.normalize(t,t)}}),Pu=bl.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.cx,n=t.cy,a=Math.max(t.r,0),r=t.startAngle,o=t.endAngle,s=t.clockwise,l=Math.cos(r),u=Math.sin(r);e.moveTo(l*a+i,u*a+n),e.arc(i,n,a,r,o,!s)}}),ku=bl.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var e=this.__dirtyPath,t=this.shape.paths,i=0;i<t.length;i++)e=e||t[i].__dirtyPath;this.__dirtyPath=e,this.__dirty=this.__dirty||e},beforeBrush:function(){this._updatePathDirty();for(var e=this.shape.paths||[],t=this.getGlobalScale(),i=0;i<e.length;i++)e[i].path||e[i].createPathProxy(),e[i].path.setScale(t[0],t[1],e[i].segmentIgnoreThreshold)},buildPath:function(e,t){for(var i=t.paths||[],n=0;n<i.length;n++)i[n].buildPath(e,i[n].shape,!0)},afterBrush:function(){for(var e=this.shape.paths||[],t=0;t<e.length;t++)e[t].__dirtyPath=!1},getBoundingRect:function(){return this._updatePathDirty(),bl.prototype.getBoundingRect.call(this)}}),Ou=ku,Ru=function(e){this.colorStops=e||[]};Ru.prototype={constructor:Ru,addColorStop:function(e,t){this.colorStops.push({offset:e,color:t})}};var Eu=Ru,Nu=function(e,t,i,n,a,r){this.x=null==e?0:e,this.y=null==t?0:t,this.x2=null==i?1:i,this.y2=null==n?0:n,this.type="linear",this.global=r||!1,Eu.call(this,a)};Nu.prototype={constructor:Nu},Ve.inherits(Nu,Eu);var zu=Nu,Bu=function(e,t,i,n,a){this.x=null==e?.5:e,this.y=null==t?.5:t,this.r=null==i?.5:i,this.type="radial",this.global=a||!1,Eu.call(this,n)};Bu.prototype={constructor:Bu},Ve.inherits(Bu,Eu);var Vu=Bu,Fu=Ve.inherits;function Gu(e){Tr.call(this,e),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}Gu.prototype.incremental=!0,Gu.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},Gu.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.dirty()},Gu.prototype.addDisplayables=function(e,t){t=t||!1;for(var i=0;i<e.length;i++)this.addDisplayable(e[i],t)},Gu.prototype.eachPendingDisplayable=function(e){for(var t=this._cursor;t<this._displayables.length;t++)e&&e(this._displayables[t]);for(t=0;t<this._temporaryDisplayables.length;t++)e&&e(this._temporaryDisplayables[t])},Gu.prototype.update=function(){this.updateTransform();for(var e=this._cursor;e<this._displayables.length;e++){(t=this._displayables[e]).parent=this,t.update(),t.parent=null}for(e=0;e<this._temporaryDisplayables.length;e++){var t;(t=this._temporaryDisplayables[e]).parent=this,t.update(),t.parent=null}},Gu.prototype.brush=function(e,t){for(var i=this._cursor;i<this._displayables.length;i++){(n=this._displayables[i]).beforeBrush&&n.beforeBrush(e),n.brush(e,i===this._cursor?null:this._displayables[i-1]),n.afterBrush&&n.afterBrush(e)}this._cursor=i;for(i=0;i<this._temporaryDisplayables.length;i++){var n;(n=this._temporaryDisplayables[i]).beforeBrush&&n.beforeBrush(e),n.brush(e,0===i?null:this._temporaryDisplayables[i-1]),n.afterBrush&&n.afterBrush(e)}this._temporaryDisplayables=[],this.notClear=!0};var Hu=[];Gu.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new Pn(1/0,1/0,-1/0,-1/0),t=0;t<this._displayables.length;t++){var i=this._displayables[t],n=i.getBoundingRect().clone();i.needLocalTransform()&&n.applyTransform(i.getLocalTransform(Hu)),e.union(n)}this._rect=e}return this._rect},Gu.prototype.contain=function(e,t){var i=this.transformCoordToLocal(e,t);if(this.getBoundingRect().contain(i[0],i[1]))for(var n=0;n<this._displayables.length;n++){if(this._displayables[n].contain(e,t))return!0}return!1},Fu(Gu,Tr);var Wu=Gu,Uu=Cr,ju=On,Zu=Wl,Yu=Ul,Xu=Yl,qu=ql,$u=uu,Ku=hu,Ju=yu,Qu=bu,eh=Lu,th=Pu,ih=Ou,nh=zu,ah=Vu,rh=Pn,oh=Wu,sh=Math.max,lh=Math.min,uh={},hh=1,ch="emphasis",dh="normal",ph=1,fh={},gh={};function mh(e,t){gh[e]=t}function vh(e,t,i,n){var a=Fl.createFromString(e,t);return i&&("center"===n&&(i=yh(i,a.getBoundingRect())),_h(a,i)),a}function yh(e,t){var i,n=t.width/t.height,a=e.height*n;return i=a<=e.width?e.height:(a=e.width)/n,{x:e.x+e.width/2-a/2,y:e.y+e.height/2-i/2,width:a,height:i}}var xh=Fl.mergePath;function _h(e,t){if(e.applyTransform){var i=e.getBoundingRect().calculateTransform(t);e.applyTransform(i)}}var bh=gu.subPixelOptimize;function wh(e){return null!=e&&"none"!==e}var Sh=Ve.createHashMap(),Mh=0;function Ih(e){var t=e.__hoverStl;if(t&&!e.__highlighted){var i=e.__zr,n=e.useHoverLayer&&i&&"canvas"===i.painter.type;if(e.__highlighted=n?"layer":"plain",!(e.isGroup||!i&&e.useHoverLayer)){var a=e,r=e.style;n&&(r=(a=i.addHover(e)).style),Gh(r),n||function(e){if(e.__hoverStlDirty){e.__hoverStlDirty=!1;var t=e.__hoverStl;if(t){var i=e.__cachedNormalStl={};e.__cachedNormalZ2=e.z2;var n=e.style;for(var a in t)null!=t[a]&&(i[a]=n[a]);i.fill=n.fill,i.stroke=n.stroke}else e.__cachedNormalStl=e.__cachedNormalZ2=null}}(a),r.extendFrom(t),Th(r,t,"fill"),Th(r,t,"stroke"),Fh(r),n||(e.dirty(!1),e.z2+=hh)}}}function Th(e,t,i){!wh(t[i])&&wh(e[i])&&(e[i]=function(e){if("string"!=typeof e)return e;var t=Sh.get(e);return t||(t=Ui.lift(e,-.1),Mh<1e4&&(Sh.set(e,t),Mh++)),t}(e[i]))}function Ah(e){var t=e.__highlighted;if(t&&(e.__highlighted=!1,!e.isGroup))if("layer"===t)e.__zr&&e.__zr.removeHover(e);else{var i=e.style,n=e.__cachedNormalStl;n&&(Gh(i),e.setStyle(n),Fh(i));var a=e.__cachedNormalZ2;null!=a&&e.z2-a===hh&&(e.z2=a)}}function Ch(e,t,i){var n,a=dh,r=dh;e.__highlighted&&(a=ch,n=!0),t(e,i),e.__highlighted&&(r=ch,n=!0),e.isGroup&&e.traverse((function(e){!e.isGroup&&t(e,i)})),n&&e.__highDownOnUpdate&&e.__highDownOnUpdate(a,r)}function Dh(e,t){t=e.__hoverStl=!1!==t&&(e.hoverStyle||t||{}),e.__hoverStlDirty=!0,e.__highlighted&&(e.__cachedNormalStl=null,Ah(e),Ih(e))}function Lh(e){!Rh(this,e)&&!this.__highByOuter&&Ch(this,Ih)}function Ph(e){!Rh(this,e)&&!this.__highByOuter&&Ch(this,Ah)}function kh(e){this.__highByOuter|=1<<(e||0),Ch(this,Ih)}function Oh(e){!(this.__highByOuter&=~(1<<(e||0)))&&Ch(this,Ah)}function Rh(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Eh(e,t){var i=!1===t;if(e.__highDownSilentOnTouch=e.highDownSilentOnTouch,e.__highDownOnUpdate=e.highDownOnUpdate,!i||e.__highDownDispatcher){var n=i?"off":"on";e[n]("mouseover",Lh)[n]("mouseout",Ph),e[n]("emphasis",kh)[n]("normal",Oh),e.__highByOuter=e.__highByOuter||0,e.__highDownDispatcher=!i}}function Nh(e,t,i,n,a){return zh(e,t,n,a),i&&Ve.extend(e,i),e}function zh(e,t,i,n){if((i=i||uh).isRectText){var a;i.getTextPosition?a=i.getTextPosition(t,n):"outside"===(a=t.getShallow("position")||(n?null:"inside"))&&(a="top"),e.textPosition=a,e.textOffset=t.getShallow("offset");var r=t.getShallow("rotate");null!=r&&(r*=Math.PI/180),e.textRotation=r,e.textDistance=Ve.retrieve2(t.getShallow("distance"),n?null:5)}var o,s=t.ecModel,l=s&&s.option.textStyle,u=function(e){var t;for(;e&&e!==e.ecModel;){var i=(e.option||uh).rich;if(i)for(var n in t=t||{},i)i.hasOwnProperty(n)&&(t[n]=1);e=e.parentModel}return t}(t);if(u)for(var h in o={},u)if(u.hasOwnProperty(h)){var c=t.getModel(["rich",h]);Bh(o[h]={},c,l,i,n)}return e.rich=o,Bh(e,t,l,i,n,!0),i.forceRich&&!i.textStyle&&(i.textStyle={}),e}function Bh(e,t,i,n,a,r){i=!a&&i||uh,e.textFill=Vh(t.getShallow("color"),n)||i.color,e.textStroke=Vh(t.getShallow("textBorderColor"),n)||i.textBorderColor,e.textStrokeWidth=Ve.retrieve2(t.getShallow("textBorderWidth"),i.textBorderWidth),a||(r&&(e.insideRollbackOpt=n,Fh(e)),null==e.textFill&&(e.textFill=n.autoColor)),e.fontStyle=t.getShallow("fontStyle")||i.fontStyle,e.fontWeight=t.getShallow("fontWeight")||i.fontWeight,e.fontSize=t.getShallow("fontSize")||i.fontSize,e.fontFamily=t.getShallow("fontFamily")||i.fontFamily,e.textAlign=t.getShallow("align"),e.textVerticalAlign=t.getShallow("verticalAlign")||t.getShallow("baseline"),e.textLineHeight=t.getShallow("lineHeight"),e.textWidth=t.getShallow("width"),e.textHeight=t.getShallow("height"),e.textTag=t.getShallow("tag"),r&&n.disableBox||(e.textBackgroundColor=Vh(t.getShallow("backgroundColor"),n),e.textPadding=t.getShallow("padding"),e.textBorderColor=Vh(t.getShallow("borderColor"),n),e.textBorderWidth=t.getShallow("borderWidth"),e.textBorderRadius=t.getShallow("borderRadius"),e.textBoxShadowColor=t.getShallow("shadowColor"),e.textBoxShadowBlur=t.getShallow("shadowBlur"),e.textBoxShadowOffsetX=t.getShallow("shadowOffsetX"),e.textBoxShadowOffsetY=t.getShallow("shadowOffsetY")),e.textShadowColor=t.getShallow("textShadowColor")||i.textShadowColor,e.textShadowBlur=t.getShallow("textShadowBlur")||i.textShadowBlur,e.textShadowOffsetX=t.getShallow("textShadowOffsetX")||i.textShadowOffsetX,e.textShadowOffsetY=t.getShallow("textShadowOffsetY")||i.textShadowOffsetY}function Vh(e,t){return"auto"!==e?e:t&&t.autoColor?t.autoColor:null}function Fh(e){var t,i=e.textPosition,n=e.insideRollbackOpt;if(n&&null==e.textFill){var a=n.autoColor,r=n.isRectText,o=n.useInsideStyle,s=!1!==o&&(!0===o||r&&i&&"string"==typeof i&&i.indexOf("inside")>=0),l=!s&&null!=a;(s||l)&&(t={textFill:e.textFill,textStroke:e.textStroke,textStrokeWidth:e.textStrokeWidth}),s&&(e.textFill="#fff",null==e.textStroke&&(e.textStroke=a,null==e.textStrokeWidth&&(e.textStrokeWidth=2))),l&&(e.textFill=a)}e.insideRollback=t}function Gh(e){var t=e.insideRollback;t&&(e.textFill=t.textFill,e.textStroke=t.textStroke,e.textStrokeWidth=t.textStrokeWidth,e.insideRollback=null)}function Hh(e,t,i,n,a,r){if("function"==typeof a&&(r=a,a=null),n&&n.isAnimationEnabled()){var o=e?"Update":"",s=n.getShallow("animationDuration"+o),l=n.getShallow("animationEasing"+o),u=n.getShallow("animationDelay"+o);"function"==typeof u&&(u=u(a,n.getAnimationDelayParams?n.getAnimationDelayParams(t,a):null)),"function"==typeof s&&(s=s(a)),s>0?t.animateTo(i,s,u||0,l,r,!!r):(t.stopAnimation(),t.attr(i),r&&r())}else t.stopAnimation(),t.attr(i),r&&r()}function Wh(e,t,i,n,a){Hh(!0,e,t,i,n,a)}function Uh(e,t,i){return t&&!Ve.isArrayLike(t)&&(t=di.getLocalTransform(t)),i&&(t=ni.invert([],t)),lt.applyTransform([],e,t)}function jh(e,t,i,n,a,r,o,s){var l,u=i-e,h=n-t,c=o-a,d=s-r,p=Zh(c,d,u,h);if((l=p)<=1e-6&&l>=-1e-6)return!1;var f=e-a,g=t-r,m=Zh(f,g,u,h)/p;if(m<0||m>1)return!1;var v=Zh(f,g,c,d)/p;return!(v<0||v>1)}function Zh(e,t,i,n){return e*n-i*t}mh("circle",Ul),mh("sector",Yl),mh("ring",ql),mh("polygon",uu),mh("polyline",hu),mh("rect",yu),mh("line",bu),mh("bezierCurve",Lu),mh("arc",Pu);var Yh=function(e,t,i){var n=new Cr({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if("center"===i){var a={width:e.width,height:e.height};n.setStyle(yh(t,a))}}});return n},Xh=function(e){return gu.subPixelOptimizeLine(e.shape,e.shape,e.style),e},qh=function(e){return gu.subPixelOptimizeRect(e.shape,e.shape,e.style),e},$h=function(e,t,i){var n,a={isRectText:!0};!1===i?n=!0:a.autoColor=i,zh(e,t,a,n)},Kh=function(e,t,i){var n=0===t[4]||0===t[5]||0===t[0]?1:Math.abs(2*t[4]/t[0]),a=0===t[4]||0===t[5]||0===t[2]?1:Math.abs(2*t[4]/t[2]),r=["left"===e?-n:"right"===e?n:0,"top"===e?-a:"bottom"===e?a:0];return r=Uh(r,t,i),Math.abs(r[0])>Math.abs(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"},Jh=function(e,t){return Ve.map(e,(function(e){var i=e[0];i=sh(i,t.x),i=lh(i,t.x+t.width);var n=e[1];return n=sh(n,t.y),[i,n=lh(n,t.y+t.height)]}))},Qh=function(e,t,i){var n=(t=Ve.extend({rectHover:!0},t)).style={strokeNoScale:!0};if(i=i||{x:-1,y:-1,width:2,height:2},e)return 0===e.indexOf("image://")?(n.image=e.slice(8),Ve.defaults(n,i),new Cr(t)):vh(e.replace("path://",""),t,i,"center")},ec=function(e,t,i,n,a){for(var r=0,o=a[a.length-1];r<a.length;r++){var s=a[r];if(jh(e,t,i,n,s[0],s[1],o[0],o[1]))return!0;o=s}},tc={Image:Uu,Group:ju,Text:Zu,Circle:Yu,Sector:Xu,Ring:qu,Polygon:$u,Polyline:Ku,Rect:Ju,Line:Qu,BezierCurve:eh,Arc:th,CompoundPath:ih,LinearGradient:nh,RadialGradient:ah,BoundingRect:rh,IncrementalDisplayable:oh,Z2_EMPHASIS_LIFT:hh,CACHED_LABEL_STYLE_PROPERTIES:{color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},extendShape:function(e){return bl.extend(e)},extendPath:function(e,t){return Fl.extendFromString(e,t)},registerShape:mh,getShapeClass:function(e){if(gh.hasOwnProperty(e))return gh[e]},makePath:vh,makeImage:Yh,mergePath:xh,resizePath:_h,subPixelOptimizeLine:Xh,subPixelOptimizeRect:qh,subPixelOptimize:bh,setElementHoverStyle:Dh,setHoverStyle:function(e,t){Eh(e,!0),Ch(e,Dh,t)},setAsHighDownDispatcher:Eh,isHighDownDispatcher:function(e){return!(!e||!e.__highDownDispatcher)},getHighlightDigit:function(e){var t=fh[e];return null==t&&ph<=32&&(t=fh[e]=ph++),t},setLabelStyle:function(e,t,i,n,a,r,o){var s,l=(a=a||uh).labelFetcher,u=a.labelDataIndex,h=a.labelDimIndex,c=a.labelProp,d=i.getShallow("show"),p=n.getShallow("show");(d||p)&&(l&&(s=l.getFormattedLabel(u,"normal",null,h,c)),null==s&&(s=Ve.isFunction(a.defaultText)?a.defaultText(u,a):a.defaultText));var f=d?s:null,g=p?Ve.retrieve2(l?l.getFormattedLabel(u,"emphasis",null,h,c):null,s):null;null==f&&null==g||(Nh(e,i,r,a),Nh(t,n,o,a,!0)),e.text=f,t.text=g},modifyLabelStyle:function(e,t,i){var n=e.style;t&&(Gh(n),e.setStyle(t),Fh(n)),n=e.__hoverStl,i&&n&&(Gh(n),Ve.extend(n,i),Fh(n))},setTextStyle:Nh,setText:$h,getFont:function(e,t){var i=t&&t.getModel("textStyle");return Ve.trim([e.fontStyle||i&&i.getShallow("fontStyle")||"",e.fontWeight||i&&i.getShallow("fontWeight")||"",(e.fontSize||i&&i.getShallow("fontSize")||12)+"px",e.fontFamily||i&&i.getShallow("fontFamily")||"sans-serif"].join(" "))},updateProps:Wh,initProps:function(e,t,i,n,a){Hh(!1,e,t,i,n,a)},getTransform:function(e,t){for(var i=ni.identity([]);e&&e!==t;)ni.mul(i,e.getLocalTransform(),i),e=e.parent;return i},applyTransform:Uh,transformDirection:Kh,groupTransition:function(e,t,i,n){if(e&&t){var a,r=(a={},e.traverse((function(e){!e.isGroup&&e.anid&&(a[e.anid]=e)})),a);t.traverse((function(e){if(!e.isGroup&&e.anid){var t=r[e.anid];if(t){var n=o(e);e.attr(o(t)),Wh(e,n,i,e.dataIndex)}}}))}function o(e){var t={position:lt.clone(e.position),rotation:e.rotation};return e.shape&&(t.shape=Ve.extend({},e.shape)),t}},clipPointsByRect:Jh,clipRectByRect:function(e,t){var i=sh(e.x,t.x),n=lh(e.x+e.width,t.x+t.width),a=sh(e.y,t.y),r=lh(e.y+e.height,t.y+t.height);if(n>=i&&r>=a)return{x:i,y:a,width:n-i,height:r-a}},createIcon:Qh,linePolygonIntersect:ec,lineLineIntersect:jh},ic=["textStyle","color"],nc={getTextColor:function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(ic):null)},getFont:function(){return tc.getFont({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(e){return Wa.getBoundingRect(e,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("lineHeight"),this.getShallow("rich"),this.getShallow("truncateText"))}},ac=nc,rc=Uo([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),oc={getItemStyle:function(e,t){var i=rc(this,e,t),n=this.getBorderLineDash();return n&&(i.lineDash=n),i},getBorderLineDash:function(){var e=this.get("borderType");return"solid"===e||null==e?null:"dashed"===e?[5,5]:[1,1]}},sc=oc,lc=Ro.makeInner,uc=Wo.enableClassExtend,hc=Wo.enableClassCheck,cc=Ve.mixin,dc=lc();function pc(e,t,i){this.parentModel=t,this.ecModel=i,this.option=e}function fc(e,t,i){for(var n=0;n<t.length&&(!t[n]||null!=(e=e&&"object"==typeof e?e[t[n]]:null));n++);return null==e&&i&&(e=i.get(t)),e}function gc(e,t){var i=dc(e).getParent;return i?i.call(e,t):e.parentModel}pc.prototype={constructor:pc,init:null,mergeOption:function(e){Ve.merge(this.option,e,!0)},get:function(e,t){return null==e?this.option:fc(this.option,this.parsePath(e),!t&&gc(this,e))},getShallow:function(e,t){var i=this.option,n=null==i?i:i[e],a=!t&&gc(this,e);return null==n&&a&&(n=a.getShallow(e)),n},getModel:function(e,t){var i;return new pc(null==e?this.option:fc(this.option,e=this.parsePath(e)),t=t||(i=gc(this,e))&&i.getModel(e),this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new(0,this.constructor)(Ve.clone(this.option))},setReadOnly:function(e){},parsePath:function(e){return"string"==typeof e&&(e=e.split(".")),e},customizeGetParent:function(e){dc(this).getParent=e},isAnimationEnabled:function(){if(!ie.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},uc(pc),hc(pc),cc(pc,Yo),cc(pc,qo),cc(pc,ac),cc(pc,sc);var mc=pc,vc=Wo.parseClassType,yc=0;var xc={getUID:function(e){return[e||"",yc++,Math.random().toFixed(5)].join("_")},enableSubTypeDefaulter:function(e){var t={};return e.registerSubTypeDefaulter=function(e,i){e=vc(e),t[e.main]=i},e.determineSubType=function(i,n){var a=n.type;if(!a){var r=vc(i).main;e.hasSubTypes(i)&&t[r]&&(a=t[r](n))}return a},e},enableTopologicalTravel:function(e,t){function i(e,t){return e[t]||(e[t]={predecessor:[],successor:[]}),e[t]}e.topologicalTravel=function(e,n,a,r){if(e.length){var o=function(e){var n={},a=[];return Ve.each(e,(function(r){var o=i(n,r),s=function(e,t){var i=[];return Ve.each(e,(function(e){Ve.indexOf(t,e)>=0&&i.push(e)})),i}(o.originalDeps=t(r),e);o.entryCount=s.length,0===o.entryCount&&a.push(r),Ve.each(s,(function(e){Ve.indexOf(o.predecessor,e)<0&&o.predecessor.push(e);var t=i(n,e);Ve.indexOf(t.successor,e)<0&&t.successor.push(r)}))})),{graph:n,noEntryList:a}}(n),s=o.graph,l=o.noEntryList,u={};for(Ve.each(e,(function(e){u[e]=!0}));l.length;){var h=l.pop(),c=s[h],d=!!u[h];d&&(a.call(r,h,c.originalDeps.slice()),delete u[h]),Ve.each(c.successor,d?f:p)}Ve.each(u,(function(){throw new Error("Circle dependency may exists")}))}function p(e){s[e].entryCount--,0===s[e].entryCount&&l.push(e)}function f(e){u[e]=!0,p(e)}}}},_c=1e-4;var bc=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function wc(e){if(0===e)return 0;var t=Math.floor(Math.log(e)/Math.LN10);return e/Math.pow(10,t)>=10&&t++,t}var Sc=function(e,t,i,n){var a=t[1]-t[0],r=i[1]-i[0];if(0===a)return 0===r?i[0]:(i[0]+i[1])/2;if(n)if(a>0){if(e<=t[0])return i[0];if(e>=t[1])return i[1]}else{if(e>=t[0])return i[0];if(e<=t[1])return i[1]}else{if(e===t[0])return i[0];if(e===t[1])return i[1]}return(e-t[0])/a*r+i[0]},Mc=function(e){if(e=+e,isNaN(e))return 0;for(var t=1,i=0;Math.round(e*t)/t!==e;)t*=10,i++;return i},Ic=function(e,t){var i=Math.log,n=Math.LN10,a=Math.floor(i(e[1]-e[0])/n),r=Math.round(i(Math.abs(t[1]-t[0]))/n),o=Math.min(Math.max(-a+r,0),20);return isFinite(o)?o:20},Tc=function(e,t,i){if(!e[t])return 0;var n=Ve.reduce(e,(function(e,t){return e+(isNaN(t)?0:t)}),0);if(0===n)return 0;for(var a=Math.pow(10,i),r=Ve.map(e,(function(e){return(isNaN(e)?0:e)/n*a*100})),o=100*a,s=Ve.map(r,(function(e){return Math.floor(e)})),l=Ve.reduce(s,(function(e,t){return e+t}),0),u=Ve.map(r,(function(e,t){return e-s[t]}));l<o;){for(var h=Number.NEGATIVE_INFINITY,c=null,d=0,p=u.length;d<p;++d)u[d]>h&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[t]/a},Ac=function(e,t){var i=wc(e),n=Math.pow(10,i),a=e/n;return e=(t?a<1.5?1:a<2.5?2:a<4?3:a<7?5:10:a<1?1:a<2?2:a<3?3:a<5?5:10)*n,i>=-20?+e.toFixed(i<0?-i:0):e},Cc=function(e,t){var i=(e.length-1)*t+1,n=Math.floor(i),a=+e[n-1],r=i-n;return r?a+r*(e[n]-a):a},Dc=function(e){e.sort((function(e,t){return s(e,t,0)?-1:1}));for(var t=-1/0,i=1,n=0;n<e.length;){for(var a=e[n].interval,r=e[n].close,o=0;o<2;o++)a[o]<=t&&(a[o]=t,r[o]=o?1:1-i),t=a[o],i=r[o];a[0]===a[1]&&r[0]*r[1]!=1?e.splice(n,1):n++}return e;function s(e,t,i){return e.interval[i]<t.interval[i]||e.interval[i]===t.interval[i]&&(e.close[i]-t.close[i]==(i?-1:1)||!i&&s(e,t,1))}},Lc=function(e){return e-parseFloat(e)>=0},Pc={linearMap:Sc,parsePercent:function(e,t){switch(e){case"center":case"middle":e="50%";break;case"left":case"top":e="0%";break;case"right":case"bottom":e="100%"}return"string"==typeof e?(i=e,i.replace(/^\s+|\s+$/g,"")).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):null==e?NaN:+e;var i},round:function(e,t,i){return null==t&&(t=10),t=Math.min(Math.max(0,t),20),e=(+e).toFixed(t),i?e:+e},asc:function(e){return e.sort((function(e,t){return e-t})),e},getPrecision:Mc,getPrecisionSafe:function(e){var t=e.toString(),i=t.indexOf("e");if(i>0){var n=+t.slice(i+1);return n<0?-n:0}var a=t.indexOf(".");return a<0?0:t.length-1-a},getPixelPrecision:Ic,getPercentWithPrecision:Tc,MAX_SAFE_INTEGER:9007199254740991,remRadian:function(e){var t=2*Math.PI;return(e%t+t)%t},isRadianAroundZero:function(e){return e>-1e-4&&e<_c},parseDate:function(e){if(e instanceof Date)return e;if("string"==typeof e){var t=bc.exec(e);if(!t)return new Date(NaN);if(t[8]){var i=+t[4]||0;return"Z"!==t[8].toUpperCase()&&(i-=t[8].slice(0,3)),new Date(Date.UTC(+t[1],+(t[2]||1)-1,+t[3]||1,i,+(t[5]||0),+t[6]||0,+t[7]||0))}return new Date(+t[1],+(t[2]||1)-1,+t[3]||1,+t[4]||0,+(t[5]||0),+t[6]||0,+t[7]||0)}return null==e?new Date(NaN):new Date(Math.round(e))},quantity:function(e){return Math.pow(10,wc(e))},quantityExponent:wc,nice:Ac,quantile:Cc,reformIntervals:Dc,isNumeric:Lc};var kc=Ve.normalizeCssArray,Oc=/([&<>"'])/g,Rc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ec(e){return null==e?"":(e+"").replace(Oc,(function(e,t){return Rc[t]}))}var Nc=["a","b","c","d","e","f","g"],zc=function(e,t){return"{"+e+(null==t?"":t)+"}"};function Bc(e,t){return"0000".substr(0,t-(e+="").length)+e}var Vc=function(e,t,i){Ve.isArray(t)||(t=[t]);var n=t.length;if(!n)return"";for(var a=t[0].$vars||[],r=0;r<a.length;r++){var o=Nc[r];e=e.replace(zc(o),zc(o,0))}for(var s=0;s<n;s++)for(var l=0;l<a.length;l++){var u=t[s][a[l]];e=e.replace(zc(Nc[l],s),i?Ec(u):u)}return e},Fc=function(e,t,i){return Ve.each(t,(function(t,n){e=e.replace("{"+n+"}",i?Ec(t):t)})),e},Gc=function(e,t){var i=(e=Ve.isString(e)?{color:e,extraCssText:t}:e||{}).color,n=e.type,a=(t=e.extraCssText,e.renderMode||"html"),r=e.markerId||"X";return i?"html"===a?"subItem"===n?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Ec(i)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+Ec(i)+";"+(t||"")+'"></span>':{renderMode:a,content:"{marker"+r+"|}  ",style:{color:i}}:""},Hc=function(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=Pc.parseDate(t),a=i?"UTC":"",r=n["get"+a+"FullYear"](),o=n["get"+a+"Month"]()+1,s=n["get"+a+"Date"](),l=n["get"+a+"Hours"](),u=n["get"+a+"Minutes"](),h=n["get"+a+"Seconds"](),c=n["get"+a+"Milliseconds"]();return e=e.replace("MM",Bc(o,2)).replace("M",o).replace("yyyy",r).replace("yy",r%100).replace("dd",Bc(s,2)).replace("d",s).replace("hh",Bc(l,2)).replace("h",l).replace("mm",Bc(u,2)).replace("m",u).replace("ss",Bc(h,2)).replace("s",h).replace("SSS",Bc(c,3))},Wc=function(e,t,i,n,a,r,o,s){return Wa.getBoundingRect(e,t,i,n,a,s,r,o)},Uc={addCommas:function(e){return isNaN(e)?"-":(e=(e+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")},toCamelCase:function(e,t){return e=(e||"").toLowerCase().replace(/-(.)/g,(function(e,t){return t.toUpperCase()})),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e},normalizeCssArray:kc,encodeHTML:Ec,formatTpl:Vc,formatTplSimple:Fc,getTooltipMarker:Gc,formatTime:Hc,capitalFirst:function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},truncateText:Wa.truncateText,getTextBoundingRect:function(e){return Wa.getBoundingRect(e.text,e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich,e.truncate)},getTextRect:Wc,windowOpen:function(e,t){if("_blank"===t||"blank"===t){var i=window.open();i.opener=null,i.location=e}else window.open(e,t)}},jc=Pc.parsePercent,Zc=Ve.each,Yc=["left","right","top","bottom","width","height"],Xc=[["width","left","right"],["height","top","bottom"]];function qc(e,t,i,n,a){var r=0,o=0;null==n&&(n=1/0),null==a&&(a=1/0);var s=0;t.eachChild((function(l,u){var h,c,d=l.position,p=l.getBoundingRect(),f=t.childAt(u+1),g=f&&f.getBoundingRect();if("horizontal"===e){var m=p.width+(g?-g.x+p.x:0);(h=r+m)>n||l.newline?(r=0,h=m,o+=s+i,s=p.height):s=Math.max(s,p.height)}else{var v=p.height+(g?-g.y+p.y:0);(c=o+v)>a||l.newline?(r+=s+i,o=0,c=v,s=p.width):s=Math.max(s,p.width)}l.newline||(d[0]=r,d[1]=o,"horizontal"===e?r=h+i:o=c+i)}))}var $c=qc,Kc=Ve.curry(qc,"vertical"),Jc=Ve.curry(qc,"horizontal");function Qc(e,t,i){i=Uc.normalizeCssArray(i||0);var n=t.width,a=t.height,r=jc(e.left,n),o=jc(e.top,a),s=jc(e.right,n),l=jc(e.bottom,a),u=jc(e.width,n),h=jc(e.height,a),c=i[2]+i[0],d=i[1]+i[3],p=e.aspect;switch(isNaN(u)&&(u=n-s-d-r),isNaN(h)&&(h=a-l-c-o),null!=p&&(isNaN(u)&&isNaN(h)&&(p>n/a?u=.8*n:h=.8*a),isNaN(u)&&(u=p*h),isNaN(h)&&(h=u/p)),isNaN(r)&&(r=n-s-u-d),isNaN(o)&&(o=a-l-h-c),e.left||e.right){case"center":r=n/2-u/2-i[3];break;case"right":r=n-u-d}switch(e.top||e.bottom){case"middle":case"center":o=a/2-h/2-i[0];break;case"bottom":o=a-h-c}r=r||0,o=o||0,isNaN(u)&&(u=n-d-r-(s||0)),isNaN(h)&&(h=a-c-o-(l||0));var f=new Pn(r+i[3],o+i[0],u,h);return f.margin=i,f}function ed(e,t){return t&&e&&Zc(Yc,(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}var td=function(e,t,i,n,a){var r=!a||!a.hv||a.hv[0],o=!a||!a.hv||a.hv[1],s=a&&a.boundingMode||"all";if(r||o){var l;if("raw"===s)l="group"===e.type?new Pn(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();(l=l.clone()).applyTransform(u)}t=Qc(Ve.defaults({width:l.width,height:l.height},t),i,n);var h=e.position,c=r?t.x-l.x:0,d=o?t.y-l.y:0;e.attr("position","raw"===s?[c,d]:[h[0]+c,h[1]+d])}},id=function(e,t,i){!Ve.isObject(i)&&(i={});var n=i.ignoreSize;!Ve.isArray(n)&&(n=[n,n]);var a=o(Xc[0],0),r=o(Xc[1],1);function o(i,a){var r={},o=0,u={},h=0;if(Zc(i,(function(t){u[t]=e[t]})),Zc(i,(function(e){s(t,e)&&(r[e]=u[e]=t[e]),l(r,e)&&o++,l(u,e)&&h++})),n[a])return l(t,i[1])?u[i[2]]=null:l(t,i[2])&&(u[i[1]]=null),u;if(2!==h&&o){if(o>=2)return r;for(var c=0;c<i.length;c++){var d=i[c];if(!s(r,d)&&s(e,d)){r[d]=e[d];break}}return r}return u}function s(e,t){return e.hasOwnProperty(t)}function l(e,t){return null!=e[t]&&"auto"!==e[t]}function u(e,t,i){Zc(e,(function(e){t[e]=i[e]}))}u(Xc[0],e,a),u(Xc[1],e,r)},nd={LOCATION_PARAMS:Yc,HV_NAMES:Xc,box:$c,vbox:Kc,hbox:Jc,getAvailableSize:function(e,t,i){var n=t.width,a=t.height,r=jc(e.x,n),o=jc(e.y,a),s=jc(e.x2,n),l=jc(e.y2,a);return(isNaN(r)||isNaN(parseFloat(e.x)))&&(r=0),(isNaN(s)||isNaN(parseFloat(e.x2)))&&(s=n),(isNaN(o)||isNaN(parseFloat(e.y)))&&(o=0),(isNaN(l)||isNaN(parseFloat(e.y2)))&&(l=a),i=Uc.normalizeCssArray(i||0),{width:Math.max(s-r-i[1]-i[3],0),height:Math.max(l-o-i[0]-i[2],0)}},getLayoutRect:Qc,positionElement:td,sizeCalculable:function(e,t){return null!=e[Xc[t][0]]||null!=e[Xc[t][1]]&&null!=e[Xc[t][2]]},mergeLayoutParam:id,getLayoutParams:function(e){return ed({},e)},copyLayoutParams:ed},ad={getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}},rd=Wo.enableClassManagement,od=Wo.parseClassType,sd=(0,Ro.makeInner)(),ld=mc.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(e,t,i,n){mc.call(this,e,t,i,n),this.uid=xc.getUID("ec_cpt_model")},init:function(e,t,i,n){this.mergeDefaultAndTheme(e,i)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?nd.getLayoutParams(e):{},a=t.getTheme();Ve.merge(e,a.get(this.mainType)),Ve.merge(e,this.getDefaultOption()),i&&nd.mergeLayoutParam(e,n,i)},mergeOption:function(e,t){Ve.merge(this.option,e,!0);var i=this.layoutMode;i&&nd.mergeLayoutParam(this.option,e,i)},optionUpdated:function(e,t){},getDefaultOption:function(){var e=sd(this);if(!e.defaultOption){for(var t=[],i=this.constructor;i;){var n=i.prototype.defaultOption;n&&t.push(n),i=i.superClass}for(var a={},r=t.length-1;r>=0;r--)a=Ve.merge(a,t[r],!0);e.defaultOption=a}return e.defaultOption},getReferringComponents:function(e){return this.ecModel.queryComponents({mainType:e,index:this.get(e+"Index",!0),id:this.get(e+"Id",!0)})}});rd(ld,{registerWhenExtend:!0}),xc.enableSubTypeDefaulter(ld),xc.enableTopologicalTravel(ld,(function(e){var t=[];Ve.each(ld.getClassesByMainType(e),(function(e){t=t.concat(e.prototype.dependencies||[])})),t=Ve.map(t,(function(e){return od(e).main})),"dataset"!==e&&Ve.indexOf(t,"dataset")<=0&&t.unshift("dataset");return t})),Ve.mixin(ld,ad);var ud=ld,hd="";"undefined"!=typeof navigator&&(hd=navigator.platform||"");var cd={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:hd.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},dd=Ro.makeInner,pd=Ro.normalizeToArray,fd=dd();var gd={clearColorPalette:function(){fd(this).colorIdx=0,fd(this).colorNameMap={}},getColorFromPalette:function(e,t,i){var n=fd(t=t||this),a=n.colorIdx||0,r=n.colorNameMap=n.colorNameMap||{};if(r.hasOwnProperty(e))return r[e];var o=pd(this.get("color",!0)),s=this.get("colorLayer",!0),l=null!=i&&s?function(e,t){for(var i=e.length,n=0;n<i;n++)if(e[n].length>t)return e[n];return e[i-1]}(s,i):o;if((l=l||o)&&l.length){var u=l[a];return e&&(r[e]=u),n.colorIdx=(a+1)%l.length,u}}},md=gd,vd={SOURCE_FORMAT_ORIGINAL:"original",SOURCE_FORMAT_ARRAY_ROWS:"arrayRows",SOURCE_FORMAT_OBJECT_ROWS:"objectRows",SOURCE_FORMAT_KEYED_COLUMNS:"keyedColumns",SOURCE_FORMAT_UNKNOWN:"unknown",SOURCE_FORMAT_TYPED_ARRAY:"typedArray",SERIES_LAYOUT_BY_COLUMN:"column",SERIES_LAYOUT_BY_ROW:"row"},yd=Ve.createHashMap,xd=Ve.isTypedArray,_d=Wo.enableClassCheck,bd=vd.SOURCE_FORMAT_ORIGINAL,wd=vd.SERIES_LAYOUT_BY_COLUMN,Sd=vd.SOURCE_FORMAT_UNKNOWN,Md=vd.SOURCE_FORMAT_TYPED_ARRAY,Id=vd.SOURCE_FORMAT_KEYED_COLUMNS;function Td(e){this.fromDataset=e.fromDataset,this.data=e.data||(e.sourceFormat===Id?{}:[]),this.sourceFormat=e.sourceFormat||Sd,this.seriesLayoutBy=e.seriesLayoutBy||wd,this.dimensionsDefine=e.dimensionsDefine,this.encodeDefine=e.encodeDefine&&yd(e.encodeDefine),this.startIndex=e.startIndex||0,this.dimensionsDetectCount=e.dimensionsDetectCount}Td.seriesDataToSource=function(e){return new Td({data:e,sourceFormat:xd(e)?Md:bd,fromDataset:!1})},_d(Td);var Ad=Td,Cd=Ro.makeInner,Dd=Ro.getDataItemValue,Ld=Ve.createHashMap,Pd=Ve.each,kd=Ve.map,Od=Ve.isArray,Rd=Ve.isString,Ed=Ve.isObject,Nd=Ve.isTypedArray,zd=Ve.isArrayLike,Bd=Ve.extend,Vd=vd.SOURCE_FORMAT_ORIGINAL,Fd=vd.SOURCE_FORMAT_ARRAY_ROWS,Gd=vd.SOURCE_FORMAT_OBJECT_ROWS,Hd=vd.SOURCE_FORMAT_KEYED_COLUMNS,Wd=vd.SOURCE_FORMAT_UNKNOWN,Ud=vd.SOURCE_FORMAT_TYPED_ARRAY,jd=vd.SERIES_LAYOUT_BY_ROW,Zd={Must:1,Might:2,Not:3},Yd=Cd();function Xd(e){if(e){var t=Ld();return kd(e,(function(e,i){if(null==(e=Bd({},Ed(e)?e:{name:e})).name)return e;e.name+="",null==e.displayName&&(e.displayName=e.name);var n=t.get(e.name);return n?e.name+="-"+n.count++:t.set(e.name,{count:1}),e}))}}function qd(e,t,i,n){if(null==n&&(n=1/0),t===jd)for(var a=0;a<i.length&&a<n;a++)e(i[a]?i[a][0]:null,a);else{var r=i[0]||[];for(a=0;a<r.length&&a<n;a++)e(r[a],a)}}function $d(e){var t=e.option;if(!t.data)return e.ecModel.getComponent("dataset",t.datasetIndex||0)}function Kd(e,t,i,n,a,r){var o,s,l;if(Nd(e))return Zd.Not;if(n){var u=n[r];Ed(u)?(s=u.name,l=u.type):Rd(u)&&(s=u)}if(null!=l)return"ordinal"===l?Zd.Must:Zd.Not;if(t===Fd)if(i===jd){for(var h=e[r],c=0;c<(h||[]).length&&c<5;c++)if(null!=(o=g(h[a+c])))return o}else for(c=0;c<e.length&&c<5;c++){var d=e[a+c];if(d&&null!=(o=g(d[r])))return o}else if(t===Gd){if(!s)return Zd.Not;for(c=0;c<e.length&&c<5;c++){if((p=e[c])&&null!=(o=g(p[s])))return o}}else if(t===Hd){if(!s)return Zd.Not;if(!(h=e[s])||Nd(h))return Zd.Not;for(c=0;c<h.length&&c<5;c++)if(null!=(o=g(h[c])))return o}else if(t===Vd)for(c=0;c<e.length&&c<5;c++){var p=e[c],f=Dd(p);if(!Od(f))return Zd.Not;if(null!=(o=g(f[r])))return o}function g(e){var t=Rd(e);return null!=e&&isFinite(e)&&""!==e?t?Zd.Might:Zd.Not:t&&"-"!==e?Zd.Must:void 0}return Zd.Not}var Jd=function(e){var t=e.option.source,i=Wd;if(Nd(t))i=Ud;else if(Od(t)){0===t.length&&(i=Fd);for(var n=0,a=t.length;n<a;n++){var r=t[n];if(null!=r){if(Od(r)){i=Fd;break}if(Ed(r)){i=Gd;break}}}}else if(Ed(t)){for(var o in t)if(t.hasOwnProperty(o)&&zd(t[o])){i=Hd;break}}else if(null!=t)throw new Error("Invalid data");Yd(e).sourceFormat=i},Qd=function(e,t,i){var n={},a=$d(t);if(!a||!e)return n;var r,o,s=[],l=[],u=t.ecModel,h=Yd(u).datasetMap,c=a.uid+"_"+i.seriesLayoutBy;e=e.slice(),Pd(e,(function(t,i){!Ed(t)&&(e[i]={name:t}),"ordinal"===t.type&&null==r&&(r=i,o=f(e[i])),n[t.name]=[]}));var d=h.get(c)||h.set(c,{categoryWayDim:o,valueWayDim:0});function p(e,t,i){for(var n=0;n<i;n++)e.push(t+n)}function f(e){var t=e.dimsDef;return t?t.length:1}return Pd(e,(function(e,t){var i=e.name,a=f(e);if(null==r){var o=d.valueWayDim;p(n[i],o,a),p(l,o,a),d.valueWayDim+=a}else if(r===t)p(n[i],0,a),p(s,0,a);else{o=d.categoryWayDim;p(n[i],o,a),p(l,o,a),d.categoryWayDim+=a}})),s.length&&(n.itemName=s),l.length&&(n.seriesName=l),n},ep=function(e,t,i){var n={};if(!$d(e))return n;var a,r=t.sourceFormat,o=t.dimensionsDefine;r!==Gd&&r!==Hd||Pd(o,(function(e,t){"name"===(Ed(e)?e.name:e)&&(a=t)}));var s=function(){for(var e={},n={},s=[],l=0,u=Math.min(5,i);l<u;l++){var h=Kd(t.data,r,t.seriesLayoutBy,o,t.startIndex,l);s.push(h);var c=h===Zd.Not;if(c&&null==e.v&&l!==a&&(e.v=l),(null==e.n||e.n===e.v||!c&&s[e.n]===Zd.Not)&&(e.n=l),d(e)&&s[e.n]!==Zd.Not)return e;c||(h===Zd.Might&&null==n.v&&l!==a&&(n.v=l),null!=n.n&&n.n!==n.v||(n.n=l))}function d(e){return null!=e.v&&null!=e.n}return d(e)?e:d(n)?n:null}();if(s){n.value=s.v;var l=null!=a?a:s.n;n.itemName=[l],n.seriesName=[l]}return n},tp={BE_ORDINAL:Zd,detectSourceFormat:Jd,getSource:function(e){return Yd(e).source},resetSourceDefaulter:function(e){Yd(e).datasetMap=Ld()},prepareSource:function(e){var t=e.option,i=t.data,n=Nd(i)?Ud:Vd,a=!1,r=t.seriesLayoutBy,o=t.sourceHeader,s=t.dimensions,l=$d(e);if(l){var u=l.option;i=u.source,n=Yd(l).sourceFormat,a=!0,r=r||u.seriesLayoutBy,null==o&&(o=u.sourceHeader),s=s||u.dimensions}var h=function(e,t,i,n,a){if(!e)return{dimensionsDefine:Xd(a)};var r,o;if(t===Fd)"auto"===n||null==n?qd((function(e){null!=e&&"-"!==e&&(Rd(e)?null==o&&(o=1):o=0)}),i,e,10):o=n?1:0,a||1!==o||(a=[],qd((function(e,t){a[t]=null!=e?e:""}),i,e)),r=a?a.length:i===jd?e.length:e[0]?e[0].length:null;else if(t===Gd)a||(a=function(e){var t,i=0;for(;i<e.length&&!(t=e[i++]););if(t){var n=[];return Pd(t,(function(e,t){n.push(t)})),n}}(e));else if(t===Hd)a||(a=[],Pd(e,(function(e,t){a.push(t)})));else if(t===Vd){var s=Dd(e[0]);r=Od(s)&&s.length||1}return{startIndex:o,dimensionsDefine:Xd(a),dimensionsDetectCount:r}}(i,n,r,o,s);Yd(e).source=new Ad({data:i,fromDataset:a,seriesLayoutBy:r,sourceFormat:n,dimensionsDefine:h.dimensionsDefine,startIndex:h.startIndex,dimensionsDetectCount:h.dimensionsDetectCount,encodeDefine:t.encode})},makeSeriesEncodeForAxisCoordSys:Qd,makeSeriesEncodeForNameBased:ep,guessOrdinal:function(e,t){return Kd(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}},ip=Ve.each,np=Ve.filter,ap=Ve.map,rp=Ve.isArray,op=Ve.indexOf,sp=Ve.isObject,lp=Ve.isString,up=Ve.createHashMap,hp=Ve.assert,cp=Ve.clone,dp=Ve.merge,pp=Ve.extend,fp=Ve.mixin,gp=tp.resetSourceDefaulter,mp="\0_ec_inner",vp=mc.extend({init:function(e,t,i,n){i=i||{},this.option=null,this._theme=new mc(i),this._optionManager=n},setOption:function(e,t){hp(!(mp in e),"please use chart.getOption()"),this._optionManager.setOption(e,t),this.resetOption(null)},resetOption:function(e){var t=!1,i=this._optionManager;if(!e||"recreate"===e){var n=i.mountOption("recreate"===e);this.option&&"recreate"!==e?(this.restoreData(),this.mergeOption(n)):yp.call(this,n),t=!0}if("timeline"!==e&&"media"!==e||this.restoreData(),!e||"recreate"===e||"timeline"===e){var a=i.getTimelineOption(this);a&&(this.mergeOption(a),t=!0)}if(!e||"recreate"===e||"media"===e){var r=i.getMediaOption(this,this._api);r.length&&ip(r,(function(e){this.mergeOption(e,t=!0)}),this)}return t},mergeOption:function(e){var t=this.option,i=this._componentsMap,n=[];gp(this),ip(e,(function(e,i){null!=e&&(ud.hasClass(i)?i&&n.push(i):t[i]=null==t[i]?cp(e):dp(t[i],e,!0))})),ud.topologicalTravel(n,ud.getAllClassMainTypes(),(function(n,a){var r=Ro.normalizeToArray(e[n]),o=Ro.mappingToExists(i.get(n),r);Ro.makeIdAndName(o),ip(o,(function(e,t){var i=e.option;sp(i)&&(e.keyInfo.mainType=n,e.keyInfo.subType=function(e,t,i){var n=t.type?t.type:i?i.subType:ud.determineSubType(e,t);return n}(n,i,e.exist))}));var s=function(e,t){rp(t)||(t=t?[t]:[]);var i={};return ip(t,(function(t){i[t]=(e.get(t)||[]).slice()})),i}(i,a);t[n]=[],i.set(n,[]),ip(o,(function(e,a){var r=e.exist,o=e.option;if(hp(sp(o)||r,"Empty component definition"),o){var l=ud.getClass(n,e.keyInfo.subType,!0);if(r&&r.constructor===l)r.name=e.keyInfo.name,r.mergeOption(o,this),r.optionUpdated(o,!1);else{var u=pp({dependentModels:s,componentIndex:a},e.keyInfo);r=new l(o,this,this,u),pp(r,u),r.init(o,this,this,u),r.optionUpdated(null,!0)}}else r.mergeOption({},this),r.optionUpdated({},!1);i.get(n)[a]=r,t[n][a]=r.option}),this),"series"===n&&xp(this,i.get("series"))}),this),this._seriesIndicesMap=up(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var e=cp(this.option);return ip(e,(function(t,i){if(ud.hasClass(i)){for(var n=(t=Ro.normalizeToArray(t)).length-1;n>=0;n--)Ro.isIdInner(t[n])&&t.splice(n,1);e[i]=t}})),delete e[mp],e},getTheme:function(){return this._theme},getComponent:function(e,t){var i=this._componentsMap.get(e);if(i)return i[t||0]},queryComponents:function(e){var t=e.mainType;if(!t)return[];var i,n=e.index,a=e.id,r=e.name,o=this._componentsMap.get(t);if(!o||!o.length)return[];if(null!=n)rp(n)||(n=[n]),i=np(ap(n,(function(e){return o[e]})),(function(e){return!!e}));else if(null!=a){var s=rp(a);i=np(o,(function(e){return s&&op(a,e.id)>=0||!s&&e.id===a}))}else if(null!=r){var l=rp(r);i=np(o,(function(e){return l&&op(r,e.name)>=0||!l&&e.name===r}))}else i=o.slice();return _p(i,e)},findComponents:function(e){var t,i,n,a,r,o=e.query,s=e.mainType,l=(i=s+"Index",n=s+"Id",a=s+"Name",!(t=o)||null==t[i]&&null==t[n]&&null==t[a]?null:{mainType:s,index:t[i],id:t[n],name:t[a]}),u=l?this.queryComponents(l):this._componentsMap.get(s);return r=_p(u,e),e.filter?np(r,e.filter):r},eachComponent:function(e,t,i){var n=this._componentsMap;if("function"==typeof e)i=t,t=e,n.each((function(e,n){ip(e,(function(e,a){t.call(i,n,e,a)}))}));else if(lp(e))ip(n.get(e),t,i);else if(sp(e)){var a=this.findComponents(e);ip(a,t,i)}},getSeriesByName:function(e){var t=this._componentsMap.get("series");return np(t,(function(t){return t.name===e}))},getSeriesByIndex:function(e){return this._componentsMap.get("series")[e]},getSeriesByType:function(e){var t=this._componentsMap.get("series");return np(t,(function(t){return t.subType===e}))},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(e,t){ip(this._seriesIndices,(function(i){var n=this._componentsMap.get("series")[i];e.call(t,n,i)}),this)},eachRawSeries:function(e,t){ip(this._componentsMap.get("series"),e,t)},eachSeriesByType:function(e,t,i){ip(this._seriesIndices,(function(n){var a=this._componentsMap.get("series")[n];a.subType===e&&t.call(i,a,n)}),this)},eachRawSeriesByType:function(e,t,i){return ip(this.getSeriesByType(e),t,i)},isSeriesFiltered:function(e){return null==this._seriesIndicesMap.get(e.componentIndex)},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(e,t){xp(this,np(this._componentsMap.get("series"),e,t))},restoreData:function(e){var t=this._componentsMap;xp(this,t.get("series"));var i=[];t.each((function(e,t){i.push(t)})),ud.topologicalTravel(i,ud.getAllClassMainTypes(),(function(i,n){ip(t.get(i),(function(t){("series"!==i||!function(e,t){if(t){var i=t.seiresIndex,n=t.seriesId,a=t.seriesName;return null!=i&&e.componentIndex!==i||null!=n&&e.id!==n||null!=a&&e.name!==a}}(t,e))&&t.restoreData()}))}))}});function yp(e){this.option={},this.option[mp]=1,this._componentsMap=up({series:[]}),this._seriesIndices,this._seriesIndicesMap,function(e,t){var i=e.color&&!e.colorLayer;ip(t,(function(t,n){"colorLayer"===n&&i||ud.hasClass(n)||("object"==typeof t?e[n]=e[n]?dp(e[n],t,!1):cp(t):null==e[n]&&(e[n]=t))}))}(e,this._theme.option),dp(e,cd,!1),this.mergeOption(e)}function xp(e,t){e._seriesIndicesMap=up(e._seriesIndices=ap(t,(function(e){return e.componentIndex}))||[])}function _p(e,t){return t.hasOwnProperty("subType")?np(e,(function(e){return e.subType===t.subType})):e}fp(vp,md);var bp=vp,wp=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"];var Sp=function(e){Ve.each(wp,(function(t){this[t]=Ve.bind(e[t],e)}),this)},Mp={};function Ip(){this._coordinateSystems=[]}Ip.prototype={constructor:Ip,create:function(e,t){var i=[];Ve.each(Mp,(function(n,a){var r=n.create(e,t);i=i.concat(r||[])})),this._coordinateSystems=i},update:function(e,t){Ve.each(this._coordinateSystems,(function(i){i.update&&i.update(e,t)}))},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},Ip.register=function(e,t){Mp[e]=t},Ip.get=function(e){return Mp[e]};var Tp=Ip,Ap=Ve.each,Cp=Ve.clone,Dp=Ve.map,Lp=Ve.merge,Pp=/^(min|max)?(.+)$/;function kp(e){this._api=e,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function Op(e,t,i){var n,a,r=[],o=[],s=e.timeline;if(e.baseOption&&(a=e.baseOption),(s||e.options)&&(a=a||{},r=(e.options||[]).slice()),e.media){a=a||{};var l=e.media;Ap(l,(function(e){e&&e.option&&(e.query?o.push(e):n||(n=e))}))}return a||(a=e),a.timeline||(a.timeline=s),Ap([a].concat(r).concat(Ve.map(o,(function(e){return e.option}))),(function(e){Ap(t,(function(t){t(e,i)}))})),{baseOption:a,timelineOptions:r,mediaDefault:n,mediaList:o}}function Rp(e,t,i){var n={width:t,height:i,aspectratio:t/i},a=!0;return Ve.each(e,(function(e,t){var i=t.match(Pp);if(i&&i[1]&&i[2]){var r=i[1],o=i[2].toLowerCase();(function(e,t,i){return"min"===i?e>=t:"max"===i?e<=t:e===t})(n[o],e,r)||(a=!1)}})),a}kp.prototype={constructor:kp,setOption:function(e,t){e&&Ve.each(Ro.normalizeToArray(e.series),(function(e){e&&e.data&&Ve.isTypedArray(e.data)&&Ve.setAsPrimitive(e.data)})),e=Cp(e);var i,n,a=this._optionBackup,r=Op.call(this,e,t,!a);this._newBaseOption=r.baseOption,a?(i=a.baseOption,n=r.baseOption,Ap(n=n||{},(function(e,t){if(null!=e){var n=i[t];if(ud.hasClass(t)){e=Ro.normalizeToArray(e),n=Ro.normalizeToArray(n);var a=Ro.mappingToExists(n,e);i[t]=Dp(a,(function(e){return e.option&&e.exist?Lp(e.exist,e.option,!0):e.exist||e.option}))}else i[t]=Lp(n,e,!0)}})),r.timelineOptions.length&&(a.timelineOptions=r.timelineOptions),r.mediaList.length&&(a.mediaList=r.mediaList),r.mediaDefault&&(a.mediaDefault=r.mediaDefault)):this._optionBackup=r},mountOption:function(e){var t=this._optionBackup;return this._timelineOptions=Dp(t.timelineOptions,Cp),this._mediaList=Dp(t.mediaList,Cp),this._mediaDefault=Cp(t.mediaDefault),this._currentMediaIndices=[],Cp(e?t.baseOption:this._newBaseOption)},getTimelineOption:function(e){var t,i=this._timelineOptions;if(i.length){var n=e.getComponent("timeline");n&&(t=Cp(i[n.getCurrentIndex()],!0))}return t},getMediaOption:function(e){var t,i,n=this._api.getWidth(),a=this._api.getHeight(),r=this._mediaList,o=this._mediaDefault,s=[],l=[];if(!r.length&&!o)return l;for(var u=0,h=r.length;u<h;u++)Rp(r[u].query,n,a)&&s.push(u);return!s.length&&o&&(s=[-1]),s.length&&(t=s,i=this._currentMediaIndices,t.join(",")!==i.join(","))&&(l=Dp(s,(function(e){return Cp(-1===e?o.option:r[e].option)}))),this._currentMediaIndices=s,l}};var Ep=kp,Np=Ve.each,zp=Ve.isObject,Bp=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Vp(e){var t=e&&e.itemStyle;if(t)for(var i=0,n=Bp.length;i<n;i++){var a=Bp[i],r=t.normal,o=t.emphasis;r&&r[a]&&(e[a]=e[a]||{},e[a].normal?Ve.merge(e[a].normal,r[a]):e[a].normal=r[a],r[a]=null),o&&o[a]&&(e[a]=e[a]||{},e[a].emphasis?Ve.merge(e[a].emphasis,o[a]):e[a].emphasis=o[a],o[a]=null)}}function Fp(e,t,i){if(e&&e[t]&&(e[t].normal||e[t].emphasis)){var n=e[t].normal,a=e[t].emphasis;n&&(i?(e[t].normal=e[t].emphasis=null,Ve.defaults(e[t],n)):e[t]=n),a&&(e.emphasis=e.emphasis||{},e.emphasis[t]=a)}}function Gp(e){Fp(e,"itemStyle"),Fp(e,"lineStyle"),Fp(e,"areaStyle"),Fp(e,"label"),Fp(e,"labelLine"),Fp(e,"upperLabel"),Fp(e,"edgeLabel")}function Hp(e,t){var i=zp(e)&&e[t],n=zp(i)&&i.textStyle;if(n)for(var a=0,r=Ro.TEXT_STYLE_OPTIONS.length;a<r;a++){t=Ro.TEXT_STYLE_OPTIONS[a];n.hasOwnProperty(t)&&(i[t]=n[t])}}function Wp(e){e&&(Gp(e),Hp(e,"label"),e.emphasis&&Hp(e.emphasis,"label"))}function Up(e){return Ve.isArray(e)?e:e?[e]:[]}function jp(e){return(Ve.isArray(e)?e[0]:e)||{}}var Zp=function(e,t){Np(Up(e.series),(function(e){zp(e)&&function(e){if(zp(e)){Vp(e),Gp(e),Hp(e,"label"),Hp(e,"upperLabel"),Hp(e,"edgeLabel"),e.emphasis&&(Hp(e.emphasis,"label"),Hp(e.emphasis,"upperLabel"),Hp(e.emphasis,"edgeLabel")),(i=e.markPoint)&&(Vp(i),Wp(i)),(n=e.markLine)&&(Vp(n),Wp(n));var t=e.markArea;t&&Wp(t);var i,n,a=e.data;if("graph"===e.type){a=a||e.nodes;var r=e.links||e.edges;if(r&&!Ve.isTypedArray(r))for(var o=0;o<r.length;o++)Wp(r[o]);Ve.each(e.categories,(function(e){Gp(e)}))}if(a&&!Ve.isTypedArray(a))for(o=0;o<a.length;o++)Wp(a[o]);if((i=e.markPoint)&&i.data){var s=i.data;for(o=0;o<s.length;o++)Wp(s[o])}if((n=e.markLine)&&n.data){var l=n.data;for(o=0;o<l.length;o++)Ve.isArray(l[o])?(Wp(l[o][0]),Wp(l[o][1])):Wp(l[o])}"gauge"===e.type?(Hp(e,"axisLabel"),Hp(e,"title"),Hp(e,"detail")):"treemap"===e.type?(Fp(e.breadcrumb,"itemStyle"),Ve.each(e.levels,(function(e){Gp(e)}))):"tree"===e.type&&Gp(e.leaves)}}(e)}));var i=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&i.push("valueAxis","categoryAxis","logAxis","timeAxis"),Np(i,(function(t){Np(Up(e[t]),(function(e){e&&(Hp(e,"axisLabel"),Hp(e.axisPointer,"label"))}))})),Np(Up(e.parallel),(function(e){var t=e&&e.parallelAxisDefault;Hp(t,"axisLabel"),Hp(t&&t.axisPointer,"label")})),Np(Up(e.calendar),(function(e){Fp(e,"itemStyle"),Hp(e,"dayLabel"),Hp(e,"monthLabel"),Hp(e,"yearLabel")})),Np(Up(e.radar),(function(e){Hp(e,"name")})),Np(Up(e.geo),(function(e){zp(e)&&(Wp(e),Np(Up(e.regions),(function(e){Wp(e)})))})),Np(Up(e.timeline),(function(e){Wp(e),Fp(e,"label"),Fp(e,"itemStyle"),Fp(e,"controlStyle",!0);var t=e.data;Ve.isArray(t)&&Ve.each(t,(function(e){Ve.isObject(e)&&(Fp(e,"label"),Fp(e,"itemStyle"))}))})),Np(Up(e.toolbox),(function(e){Fp(e,"iconStyle"),Np(e.feature,(function(e){Fp(e,"iconStyle")}))})),Hp(jp(e.axisPointer),"label"),Hp(jp(e.tooltip).axisPointer,"label")},Yp=Ve.each,Xp=Ve.isArray,qp=Ve.isObject,$p=Ro.normalizeToArray;function Kp(e){Yp(Jp,(function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])}))}var Jp=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],Qp=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"];var ef=function(e,t){Zp(e,t),e.series=$p(e.series),Yp(e.series,(function(e){if(qp(e)){var t=e.type;if("line"===t)null!=e.clipOverflow&&(e.clip=e.clipOverflow);else if("pie"===t||"gauge"===t)null!=e.clockWise&&(e.clockwise=e.clockWise);else if("gauge"===t){var i=function(e,t){t=t.split(",");for(var i=e,n=0;n<t.length&&null!=(i=i&&i[t[n]]);n++);return i}(e,"pointer.color");null!=i&&function(e,t,i,n){t=t.split(",");for(var a,r=e,o=0;o<t.length-1;o++)null==r[a=t[o]]&&(r[a]={}),r=r[a];(n||null==r[t[o]])&&(r[t[o]]=i)}(e,"itemStyle.color",i)}Kp(e)}})),e.dataRange&&(e.visualMap=e.dataRange),Yp(Qp,(function(t){var i=e[t];i&&(Xp(i)||(i=[i]),Yp(i,(function(e){Kp(e)})))}))},tf=Ve.createHashMap,nf=Ve.each;function af(e){nf(e,(function(t,i){var n=[],a=[NaN,NaN],r=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,l=o.map(r,(function(r,l,u){var h,c,d=o.get(t.stackedDimension,u);if(isNaN(d))return a;s?c=o.getRawIndex(u):h=o.get(t.stackedByDimension,u);for(var p=NaN,f=i-1;f>=0;f--){var g=e[f];if(s||(c=g.data.rawIndexOf(g.stackedByDimension,h)),c>=0){var m=g.data.getByRawIndex(g.stackResultDimension,c);if(d>=0&&m>0||d<=0&&m<0){d+=m,p=m;break}}}return n[0]=d,n[1]=p,n}));o.hostModel.setData(l),t.data=l}))}var rf=function(e){var t=tf();e.eachSeries((function(e){var i=e.get("stack");if(i){var n=t.get(i)||t.set(i,[]),a=e.getData(),r={stackResultDimension:a.getCalculationInfo("stackResultDimension"),stackedOverDimension:a.getCalculationInfo("stackedOverDimension"),stackedDimension:a.getCalculationInfo("stackedDimension"),stackedByDimension:a.getCalculationInfo("stackedByDimension"),isStackedByIndex:a.getCalculationInfo("isStackedByIndex"),data:a,seriesModel:e};if(!r.stackedDimension||!r.isStackedByIndex&&!r.stackedByDimension)return;n.length&&a.setCalculationInfo("stackedOnSeries",n[n.length-1].seriesModel),n.push(r)}})),t.each(af)},of=Ve.extend,sf=Ve.each,lf=Ve.isObject,uf=Ro.getDataItemValue,hf=Ro.isDataItemOption,cf=Pc.parseDate,df=vd.SOURCE_FORMAT_TYPED_ARRAY,pf=vd.SOURCE_FORMAT_ARRAY_ROWS,ff=vd.SOURCE_FORMAT_ORIGINAL,gf=vd.SOURCE_FORMAT_OBJECT_ROWS;function mf(e,t){Ad.isInstance(e)||(e=Ad.seriesDataToSource(e)),this._source=e;var i=this._data=e.data,n=e.sourceFormat;n===df&&(this._offset=0,this._dimSize=t,this._data=i);var a=yf[n===pf?n+"_"+e.seriesLayoutBy:n];of(this,a)}var vf=mf.prototype;vf.pure=!1,vf.persistent=!0,vf.getSource=function(){return this._source};var yf={arrayRows_column:{pure:!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(e){return this._data[e+this._source.startIndex]},appendData:bf},arrayRows_row:{pure:!0,count:function(){var e=this._data[0];return e?Math.max(0,e.length-this._source.startIndex):0},getItem:function(e){e+=this._source.startIndex;for(var t=[],i=this._data,n=0;n<i.length;n++){var a=i[n];t.push(a?a[e]:null)}return t},appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},objectRows:{pure:!0,count:xf,getItem:_f,appendData:bf},keyedColumns:{pure:!0,count:function(){var e=this._source.dimensionsDefine[0].name,t=this._data[e];return t?t.length:0},getItem:function(e){for(var t=[],i=this._source.dimensionsDefine,n=0;n<i.length;n++){var a=this._data[i[n].name];t.push(a?a[e]:null)}return t},appendData:function(e){var t=this._data;sf(e,(function(e,i){for(var n=t[i]||(t[i]=[]),a=0;a<(e||[]).length;a++)n.push(e[a])}))}},original:{count:xf,getItem:_f,appendData:bf},typedArray:{persistent:!1,pure:!0,count:function(){return this._data?this._data.length/this._dimSize:0},getItem:function(e,t){e-=this._offset,t=t||[];for(var i=this._dimSize*e,n=0;n<this._dimSize;n++)t[n]=this._data[i+n];return t},appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}}};function xf(){return this._data.length}function _f(e){return this._data[e]}function bf(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}var wf={arrayRows:Sf,objectRows:function(e,t,i,n){return null!=i?e[n]:e},keyedColumns:Sf,original:function(e,t,i,n){var a=uf(e);return null!=i&&a instanceof Array?a[i]:a},typedArray:Sf};function Sf(e,t,i,n){return null!=i?e[i]:e}function Mf(e,t,i,n){return If(e[n],this._dimensionInfos[t])}function If(e,t){var i=t&&t.type;if("ordinal"===i){var n=t&&t.ordinalMeta;return n?n.parseAndCollect(e):e}return"time"===i&&"number"!=typeof e&&null!=e&&"-"!==e&&(e=+cf(e)),null==e||""===e?NaN:+e}var Tf=function(e,t,i){if(e){var n=e.getProvider().getSource().sourceFormat;if(n===ff||n===gf){var a=e.getRawDataItem(t);return n!==ff||lf(a)||(a=null),a?a[i]:void 0}}},Af={DefaultDataProvider:mf,defaultDimValueGetters:{arrayRows:Mf,objectRows:function(e,t,i,n){return If(e[t],this._dimensionInfos[t])},keyedColumns:Mf,original:function(e,t,i,n){var a=e&&(null==e.value?e:e.value);return!this._rawData.pure&&hf(e)&&(this.hasItemOption=!0),If(a instanceof Array?a[n]:a,this._dimensionInfos[t])},typedArray:function(e,t,i,n){return e[n]}},retrieveRawValue:function(e,t,i){if(e){var n=e.getRawDataItem(t);if(null!=n){var a,r,o=e.getProvider().getSource().sourceFormat,s=e.getDimensionInfo(i);return s&&(a=s.name,r=s.index),wf[o](n,t,r,a)}}},retrieveRawAttr:Tf},Cf=Af.retrieveRawValue,Df=Uc.getTooltipMarker,Lf=Uc.formatTpl,Pf=Ro.getTooltipRenderMode,kf=/\{@(.+?)\}/g,Of={getDataParams:function(e,t){var i=this.getData(t),n=this.getRawValue(e,t),a=i.getRawIndex(e),r=i.getName(e),o=i.getRawDataItem(e),s=i.getItemVisual(e,"color"),l=i.getItemVisual(e,"borderColor"),u=this.ecModel.getComponent("tooltip"),h=u&&u.get("renderMode"),c=Pf(h),d=this.mainType,p="series"===d,f=i.userOutput;return{componentType:d,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:p?this.subType:null,seriesIndex:this.seriesIndex,seriesId:p?this.id:null,seriesName:p?this.name:null,name:r,dataIndex:a,data:o,dataType:t,value:n,color:s,borderColor:l,dimensionNames:f?f.dimensionNames:null,encode:f?f.encode:null,marker:Df({color:s,renderMode:c}),$vars:["seriesName","name","value"]}},getFormattedLabel:function(e,t,i,n,a){t=t||"normal";var r=this.getData(i),o=r.getItemModel(e),s=this.getDataParams(e,i);null!=n&&s.value instanceof Array&&(s.value=s.value[n]);var l=o.get("normal"===t?[a||"label","formatter"]:[t,a||"label","formatter"]);return"function"==typeof l?(s.status=t,s.dimensionIndex=n,l(s)):"string"==typeof l?Lf(l,s).replace(kf,(function(t,i){var n=i.length;return"["===i.charAt(0)&&"]"===i.charAt(n-1)&&(i=+i.slice(1,n-1)),Cf(r,e,i)})):void 0},getRawValue:function(e,t){return Cf(this.getData(t),e)},formatTooltip:function(){}},Rf=Of,Ef=Ve.isArray;function Nf(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0,this.context}var zf=Nf.prototype;zf.perform=function(e){var t,i=this._upstream,n=e&&e.skip;if(this._dirty&&i){var a=this.context;a.data=a.outputData=i.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this),this._plan&&!n&&(t=this._plan(this.context));var r,o=h(this._modBy),s=this._modDataCount||0,l=h(e&&e.modBy),u=e&&e.modDataCount||0;function h(e){return!(e>=1)&&(e=1),e}o===l&&s===u||(t="reset"),(this._dirty||"reset"===t)&&(this._dirty=!1,r=function(e,t){var i,n;e._dueIndex=e._outputDueEnd=e._dueEnd=0,e._settedOutputEnd=null,!t&&e._reset&&((i=e._reset(e.context))&&i.progress&&(n=i.forceFirstProgress,i=i.progress),Ef(i)&&!i.length&&(i=null));e._progress=i,e._modBy=e._modDataCount=null;var a=e._downstream;return a&&a.dirty(),n}(this,n)),this._modBy=l,this._modDataCount=u;var c=e&&e.step;if(this._dueEnd=i?i._outputDueEnd: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(!n&&(r||d<p)){var f=this._progress;if(Ef(f))for(var g=0;g<f.length;g++)Vf(this,f[g],d,p,l,u);else Vf(this,f,d,p,l,u)}this._dueIndex=p;var m=null!=this._settedOutputEnd?this._settedOutputEnd:p;this._outputDueEnd=m}else this._dueIndex=this._outputDueEnd=null!=this._settedOutputEnd?this._settedOutputEnd:this._dueEnd;return this.unfinished()};var Bf=function(){var e,t,i,n,a,r={reset:function(l,u,h,c){t=l,e=u,i=h,n=c,a=Math.ceil(n/i),r.next=i>1&&n>0?s:o}};return r;function o(){return t<e?t++:null}function s(){var r=t%a*i+Math.ceil(t/a),o=t>=e?null:r<n?r:t;return t++,o}}();function Vf(e,t,i,n,a,r){Bf.reset(i,n,a,r),e._callingProgress=t,e._callingProgress({start:i,end:n,count:n-i,next:Bf.next},e.context)}zf.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},zf.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},zf.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},zf.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},zf.getUpstream=function(){return this._upstream},zf.getDownstream=function(){return this._downstream},zf.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e};var Ff={createTask:function(e){return new Nf(e)}},Gf=Uc.formatTime,Hf=Uc.encodeHTML,Wf=Uc.addCommas,Uf=Uc.getTooltipMarker,jf=nd.getLayoutParams,Zf=nd.mergeLayoutParam,Yf=Ff.createTask,Xf=tp.prepareSource,qf=tp.getSource,$f=Af.retrieveRawValue,Kf=Ro.makeInner(),Jf=ud.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendVisualProvider:null,visualColorAccessPath:"itemStyle.color",visualBorderColorAccessPath:"itemStyle.borderColor",layoutMode:null,init:function(e,t,i,n){this.seriesIndex=this.componentIndex,this.dataTask=Yf({count:eg,reset:tg}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,i),Xf(this);var a=this.getInitialData(e,i);ng(a,this),this.dataTask.context.data=a,Kf(this).dataBeforeProcessed=a,Qf(this)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?jf(e):{},a=this.subType;ud.hasClass(a)&&(a+="Series"),Ve.merge(e,t.getTheme().get(this.subType)),Ve.merge(e,this.getDefaultOption()),Ro.defaultEmphasis(e,"label",["show"]),this.fillDataTextStyle(e.data),i&&Zf(e,n,i)},mergeOption:function(e,t){e=Ve.merge(this.option,e,!0),this.fillDataTextStyle(e.data);var i=this.layoutMode;i&&Zf(this.option,e,i),Xf(this);var n=this.getInitialData(e,t);ng(n,this),this.dataTask.dirty(),this.dataTask.context.data=n,Kf(this).dataBeforeProcessed=n,Qf(this)},fillDataTextStyle:function(e){if(e&&!Ve.isTypedArray(e))for(var t=["show"],i=0;i<e.length;i++)e[i]&&e[i].label&&Ro.defaultEmphasis(e[i],"label",t)},getInitialData:function(){},appendData:function(e){this.getRawData().appendData(e.data)},getData:function(e){var t=rg(this);if(t){var i=t.context.data;return null==e?i:i.getLinkedData(e)}return Kf(this).data},setData:function(e){var t=rg(this);if(t){var i=t.context;i.data!==e&&t.modifyOutputEnd&&t.setOutputEnd(e.count()),i.outputData=e,t!==this.dataTask&&(i.data=e)}Kf(this).data=e},getSource:function(){return qf(this)},getRawData:function(){return Kf(this).dataBeforeProcessed},getBaseAxis:function(){var e=this.coordinateSystem;return e&&e.getBaseAxis&&e.getBaseAxis()},formatTooltip:function(e,t,i,n){var a=this,r="html"===(n=n||"html")?"<br/>":"\n",o="richText"===n,s={},l=0;function u(e){return{renderMode:n,content:Hf(Wf(e)),style:s}}var h=this.getData(),c=h.mapDimension("defaultedTooltip",!0),d=c.length,p=this.getRawValue(e),f=Ve.isArray(p),g=h.getItemVisual(e,"color");Ve.isObject(g)&&g.colorStops&&(g=(g.colorStops[0]||{}).color),g=g||"transparent";var m=d>1||f&&!d?function(i){var r=Ve.reduce(i,(function(e,t,i){var n=h.getDimensionInfo(i);return e|(n&&!1!==n.tooltip&&null!=n.displayName)}),0),u=[];function d(e,i){var c=h.getDimensionInfo(i);if(c&&!1!==c.otherDims.tooltip){var d=c.type,p="sub"+a.seriesIndex+"at"+l,f=Uf({color:g,type:"subItem",renderMode:n,markerId:p}),m="string"==typeof f?f:f.content,v=(r?m+Hf(c.displayName||"-")+": ":"")+Hf("ordinal"===d?e+"":"time"===d?t?"":Gf("yyyy/MM/dd hh:mm:ss",e):Wf(e));v&&u.push(v),o&&(s[p]=g,++l)}}c.length?Ve.each(c,(function(t){d($f(h,e,t),t)})):Ve.each(i,d);var p=r?o?"\n":"<br/>":"",f=p+u.join(p||", ");return{renderMode:n,content:f,style:s}}(p):u(d?$f(h,e,c[0]):f?p[0]:p),v=m.content,y=a.seriesIndex+"at"+l,x=Uf({color:g,type:"item",renderMode:n,markerId:y});s[y]=g,++l;var _=h.getName(e),b=this.name;Ro.isNameSpecified(this)||(b=""),b=b?Hf(b)+(t?": ":r):"";var w="string"==typeof x?x:x.content;return{html:t?w+b+v:b+w+(_?Hf(_)+": "+v:v),markers:s}},isAnimationEnabled:function(){if(ie.node)return!1;var e=this.getShallow("animation");return e&&this.getData().count()>this.getShallow("animationThreshold")&&(e=!1),e},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(e,t,i){var n=this.ecModel,a=md.getColorFromPalette.call(this,e,t,i);return a||(a=n.getColorFromPalette(e,t,i)),a},coordDimToDataDim:function(e){return this.getRawData().mapDimension(e,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function Qf(e){var t=e.name;Ro.isNameSpecified(e)||(e.name=function(e){var t=e.getRawData(),i=t.mapDimension("seriesName",!0),n=[];return Ve.each(i,(function(e){var i=t.getDimensionInfo(e);i.displayName&&n.push(i.displayName)})),n.join(" ")}(e)||t)}function eg(e){return e.model.getRawData().count()}function tg(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),ig}function ig(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function ng(e,t){Ve.each(e.CHANGABLE_METHODS,(function(i){e.wrapMethod(i,Ve.curry(ag,t))}))}function ag(e){var t=rg(e);t&&t.setOutputEnd(this.count())}function rg(e){var t=(e.ecModel||{}).scheduler,i=t&&t.getPipeline(e.uid);if(i){var n=i.currentTask;if(n){var a=n.agentStubMap;a&&(n=a.get(e.uid))}return n}}Ve.mixin(Jf,Rf),Ve.mixin(Jf,md);var og=Jf,sg=function(){this.group=new On,this.uid=xc.getUID("viewComponent")},lg=sg.prototype={constructor:sg,init:function(e,t){},render:function(e,t,i,n){},dispose:function(){},filterForExposedEvent:null};lg.updateView=lg.updateLayout=lg.updateVisual=function(e,t,i,n){},Wo.enableClassExtend(sg),Wo.enableClassManagement(sg,{registerWhenExtend:!0});var ug=sg,hg=Ro.makeInner;var cg=function(){var e=hg();return function(t){var i=e(t),n=t.pipelineContext,a=i.large,r=i.progressiveRender,o=i.large=n&&n.large,s=i.progressiveRender=n&&n.progressiveRender;return!!(a^o||r^s)&&"reset"}},dg=Ve.each,pg=Ff.createTask,fg=Ro.makeInner(),gg=cg();function mg(){this.group=new On,this.uid=xc.getUID("viewChart"),this.renderTask=pg({plan:_g,reset:bg}),this.renderTask.context={view:this}}mg.prototype={type:"chart",init:function(e,t){},render:function(e,t,i,n){},highlight:function(e,t,i,n){xg(e.getData(),n,"emphasis")},downplay:function(e,t,i,n){xg(e.getData(),n,"normal")},remove:function(e,t){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var vg=mg.prototype;function yg(e,t,i){if(e&&(e.trigger(t,i),e.isGroup&&!tc.isHighDownDispatcher(e)))for(var n=0,a=e.childCount();n<a;n++)yg(e.childAt(n),t,i)}function xg(e,t,i){var n=Ro.queryDataIndex(e,t),a=t&&null!=t.highlightKey?tc.getHighlightDigit(t.highlightKey):null;null!=n?dg(Ro.normalizeToArray(n),(function(t){yg(e.getItemGraphicEl(t),i,a)})):e.eachItemGraphicEl((function(e){yg(e,i,a)}))}function _g(e){return gg(e.model)}function bg(e){var t=e.model,i=e.ecModel,n=e.api,a=e.payload,r=t.pipelineContext.progressiveRender,o=e.view,s=a&&fg(a).updateMethod,l=r?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,i,n,a),wg[l]}vg.updateView=vg.updateLayout=vg.updateVisual=function(e,t,i,n){this.render(e,t,i,n)},Wo.enableClassExtend(mg,["dispose"]),Wo.enableClassManagement(mg,{registerWhenExtend:!0}),mg.markUpdateMethod=function(e,t){fg(e).updateMethod=t};var wg={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},Sg=mg,Mg="\0__throttleOriginMethod",Ig="\0__throttleRate",Tg="\0__throttleType";function Ag(e,t,i){var n,a,r,o,s,l=0,u=0,h=null;function c(){u=(new Date).getTime(),h=null,e.apply(r,o||[])}t=t||0;var d=function(){n=(new Date).getTime(),r=this,o=arguments;var e=s||t,d=s||i;s=null,a=n-(d?l:u)-e,clearTimeout(h),d?h=setTimeout(c,e):a>=0?c():h=setTimeout(c,-a),l=n};return d.clear=function(){h&&(clearTimeout(h),h=null)},d.debounceNextCall=function(e){s=e},d}var Cg={throttle:Ag,createOrUpdate:function(e,t,i,n){var a=e[t];if(a){var r=a[Mg]||a,o=a[Tg];if(a[Ig]!==i||o!==n){if(null==i||!n)return e[t]=r;(a=e[t]=Ag(r,i,"debounce"===n))[Mg]=r,a[Tg]=n,a[Ig]=i}return a}},clear:function(e,t){var i=e[t];i&&i[Mg]&&(e[t]=i[Mg])}},Dg=Ve.isFunction,Lg={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var i=e.getData(),n=(e.visualColorAccessPath||"itemStyle.color").split("."),a=e.get(n),r=!Dg(a)||a instanceof Eu?null:a;a&&!r||(a=e.getColorFromPalette(e.name,null,t.getSeriesCount())),i.setVisual("color",a);var o=(e.visualBorderColorAccessPath||"itemStyle.borderColor").split("."),s=e.get(o);if(i.setVisual("borderColor",s),!t.isSeriesFiltered(e)){r&&i.each((function(t){i.setItemVisual(t,"color",r(e.getDataParams(t)))}));return{dataEach:i.hasItemOption?function(e,t){var i=e.getItemModel(t),a=i.get(n,!0),r=i.get(o,!0);null!=a&&e.setItemVisual(t,"color",a),null!=r&&e.setItemVisual(t,"borderColor",r)}:null}}}},Pg=Lg,kg={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:"旭日图"}},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:""}}}},Og=Af.retrieveRawValue;var Rg=function(e,t){var i=t.getModel("aria");if(i.get("show"))if(i.get("description"))e.setAttribute("aria-label",i.get("description"));else{var n=0;t.eachSeries((function(e,t){++n}),this);var a,r=i.get("data.maxCount")||10,o=i.get("series.maxCount")||10,s=Math.min(n,o);if(!(n<1)){var l=function(){var e=t.getModel("title").option;e&&e.length&&(e=e[0]);return e&&e.text}();a=l?h(c("general.withTitle"),{title:l}):c("general.withoutTitle");var u=[];a+=h(c(n>1?"series.multiple.prefix":"series.single.prefix"),{seriesCount:n}),t.eachSeries((function(e,t){if(t<s){var i,a=e.get("name"),o="series."+(n>1?"multiple":"single")+".";i=h(i=c(a?o+"withName":o+"withoutName"),{seriesId:e.seriesIndex,seriesName:e.get("name"),seriesType:(m=e.subType,kg.series.typeNames[m]||"自定义图")});var l=e.getData();window.data=l,l.count()>r?i+=h(c("data.partialData"),{displayCnt:r}):i+=c("data.allData");for(var d=[],p=0;p<l.count();p++)if(p<r){var f=l.getName(p),g=Og(l,p);d.push(h(c(f?"data.withName":"data.withoutName"),{name:f,value:g}))}i+=d.join(c("data.separator.middle"))+c("data.separator.end"),u.push(i)}var m})),a+=u.join(c("series.multiple.separator.middle"))+c("series.multiple.separator.end"),e.setAttribute("aria-label",a)}}function h(e,t){if("string"!=typeof e)return e;var i=e;return Ve.each(t,(function(e,t){i=i.replace(new RegExp("\\{\\s*"+t+"\\s*\\}","g"),e)})),i}function c(e){var t=i.get(e);if(null==t){for(var n=e.split("."),a=kg.aria,r=0;r<n.length;++r)a=a[n[r]];return a}return t}},Eg=Math.PI;var Ng=function(e,t){t=t||{},Ve.defaults(t,{text:"loading",textColor:"#000",fontSize:"12px",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#c23531",spinnerRadius:10,lineWidth:5,zlevel:0});var i=new tc.Group,n=new tc.Rect({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});i.add(n);var a=t.fontSize+" sans-serif",r=new tc.Rect({style:{fill:"none",text:t.text,font:a,textPosition:"right",textDistance:10,textFill:t.textColor},zlevel:t.zlevel,z:10001});if(i.add(r),t.showSpinner){var o=new tc.Arc({shape:{startAngle:-Eg/2,endAngle:-Eg/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:"round",lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001});o.animateShape(!0).when(1e3,{endAngle:3*Eg/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*Eg/2}).delay(300).start("circularInOut"),i.add(o)}return i.resize=function(){var i=Wa.getWidth(t.text,a),s=t.showSpinner?t.spinnerRadius:0,l=(e.getWidth()-2*s-(t.showSpinner&&i?10:0)-i)/2-(t.showSpinner?0:i/2),u=e.getHeight()/2;t.showSpinner&&o.setShape({cx:l,cy:u}),r.setShape({x:l-s,y:u-s,width:2*s,height:2*s}),n.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},i.resize(),i},zg=Ve.each,Bg=Ve.map,Vg=Ve.isFunction,Fg=Ve.createHashMap,Gg=Ve.noop,Hg=Ff.createTask,Wg=xc.getUID,Ug=Ro.normalizeToArray;function jg(e,t,i,n){this.ecInstance=e,this.api=t,this.unfinished;i=this._dataProcessorHandlers=i.slice(),n=this._visualHandlers=n.slice();this._allHandlers=i.concat(n),this._stageTaskMap=Fg()}var Zg=jg.prototype;function Yg(e,t,i,n,a){var r;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}a=a||{},zg(t,(function(t,s){if(!a.visualType||a.visualType===t.visualType){var l=e._stageTaskMap.get(t.uid),u=l.seriesTaskMap,h=l.overallTask;if(h){var c,d=h.agentStubMap;d.each((function(e){o(a,e)&&(e.dirty(),c=!0)})),c&&h.dirty(),Xg(h,n);var p=e.getPerformArgs(h,a.block);d.each((function(e){e.perform(p)})),r|=h.perform(p)}else u&&u.each((function(s,l){o(a,s)&&s.dirty();var u=e.getPerformArgs(s,a.block);u.skip=!t.performRawSeries&&i.isSeriesFiltered(s.context.model),Xg(s,n),r|=s.perform(u)}))}})),e.unfinished|=r}Zg.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},Zg.getPerformArgs=function(e,t){if(e.__pipeline){var i=this._pipelineMap.get(e.__pipeline.id),n=i.context,a=!t&&i.progressiveEnabled&&(!n||n.progressiveRender)&&e.__idxInPipeline>i.blockIndex?i.step:null,r=n&&n.modDataCount;return{step:a,modBy:null!=r?Math.ceil(r/a):null,modDataCount:r}}},Zg.getPipeline=function(e){return this._pipelineMap.get(e)},Zg.updateStreamModes=function(e,t){var i=this._pipelineMap.get(e.uid),n=e.getData().count(),a=i.progressiveEnabled&&t.incrementalPrepareRender&&n>=i.threshold,r=e.get("large")&&n>=e.get("largeThreshold"),o="mod"===e.get("progressiveChunkMode")?n:null;e.pipelineContext=i.context={progressiveRender:a,modDataCount:o,large:r}},Zg.restorePipelines=function(e){var t=this,i=t._pipelineMap=Fg();e.eachSeries((function(e){var n=e.getProgressive(),a=e.uid;i.set(a,{id:a,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:n&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(n||700),count:0}),am(t,e,e.dataTask)}))},Zg.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.ecInstance.getModel(),i=this.api;zg(this._allHandlers,(function(n){var a=e.get(n.uid)||e.set(n.uid,[]);n.reset&&function(e,t,i,n,a){var r=i.seriesTaskMap||(i.seriesTaskMap=Fg()),o=t.seriesType,s=t.getTargetSeries;t.createOnAllSeries?n.eachRawSeries(l):o?n.eachRawSeriesByType(o,l):s&&s(n,a).each(l);function l(i){var o=i.uid,s=r.get(o)||r.set(o,Hg({plan:Qg,reset:em,count:nm}));s.context={model:i,ecModel:n,api:a,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:e},am(e,i,s)}var u=e._pipelineMap;r.each((function(e,t){u.get(t)||(e.dispose(),r.removeKey(t))}))}(this,n,a,t,i),n.overallReset&&function(e,t,i,n,a){var r=i.overallTask=i.overallTask||Hg({reset:qg});r.context={ecModel:n,api:a,overallReset:t.overallReset,scheduler:e};var o=r.agentStubMap=r.agentStubMap||Fg(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;s?n.eachRawSeriesByType(s,c):l?l(n,a).each(c):(u=!1,zg(n.getSeries(),c));function c(t){var i=t.uid,n=o.get(i);n||(n=o.set(i,Hg({reset:$g,onDirty:Jg})),r.dirty()),n.context={model:t,overallProgress:u,modifyOutputEnd:h},n.agent=r,n.__block=u,am(e,t,n)}var d=e._pipelineMap;o.each((function(e,t){d.get(t)||(e.dispose(),r.dirty(),o.removeKey(t))}))}(this,n,a,t,i)}),this)},Zg.prepareView=function(e,t,i,n){var a=e.renderTask,r=a.context;r.model=t,r.ecModel=i,r.api=n,a.__block=!e.incrementalPrepareRender,am(this,t,a)},Zg.performDataProcessorTasks=function(e,t){Yg(this,this._dataProcessorHandlers,e,t,{block:!0})},Zg.performVisualTasks=function(e,t,i){Yg(this,this._visualHandlers,e,t,i)},Zg.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t|=e.dataTask.perform()})),this.unfinished|=t},Zg.plan=function(){this._pipelineMap.each((function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)}))};var Xg=Zg.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)};function qg(e){e.overallReset(e.ecModel,e.api,e.payload)}function $g(e,t){return e.overallProgress&&Kg}function Kg(){this.agent.dirty(),this.getDownstream().dirty()}function Jg(){this.agent&&this.agent.dirty()}function Qg(e){return e.plan&&e.plan(e.model,e.ecModel,e.api,e.payload)}function em(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Ug(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?Bg(t,(function(e,t){return im(t)})):tm}var tm=im(0);function im(e){return function(t,i){var n=i.data,a=i.resetDefines[e];if(a&&a.dataEach)for(var r=t.start;r<t.end;r++)a.dataEach(n,r);else a&&a.progress&&a.progress(t,n)}}function nm(e){return e.data.count()}function am(e,t,i){var n=t.uid,a=e._pipelineMap.get(n);!a.head&&(a.head=i),a.tail&&a.tail.pipe(i),a.tail=i,i.__idxInPipeline=a.count++,i.__pipeline=a}function rm(e){om=null;try{e(sm,lm)}catch(e){}return om}jg.wrapStageHandler=function(e,t){return Vg(e)&&(e={overallReset:e,seriesType:rm(e)}),e.uid=Wg("stageHandler"),t&&(e.visualType=t),e};var om,sm={},lm={};function um(e,t){for(var i in t.prototype)e[i]=Gg}um(sm,bp),um(lm,Sp),sm.eachSeriesByType=sm.eachRawSeriesByType=function(e){om=e},sm.eachComponent=function(e){"series"===e.mainType&&e.subType&&(om=e.subType)};var hm=jg,cm=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],dm={color:cm,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],cm]},pm="#eee",fm=function(){return{axisLine:{lineStyle:{color:pm}},axisTick:{lineStyle:{color:pm}},axisLabel:{textStyle:{color:pm}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:pm}}}},gm=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],mm={color:gm,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:pm},crossStyle:{color:pm},label:{color:"#000"}}},legend:{textStyle:{color:pm}},textStyle:{color:pm},title:{textStyle:{color:pm}},toolbox:{iconStyle:{normal:{borderColor:pm}}},dataZoom:{textStyle:{color:pm}},visualMap:{textStyle:{color:pm}},timeline:{lineStyle:{color:pm},itemStyle:{normal:{color:gm[1]}},label:{normal:{textStyle:{color:pm}}},controlStyle:{normal:{color:pm,borderColor:pm}}},timeAxis:fm(),logAxis:fm(),valueAxis:fm(),categoryAxis:fm(),line:{symbol:"circle"},graph:{color:gm},gauge:{title:{textStyle:{color:pm}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};mm.categoryAxis.splitLine.show=!1;var vm=mm,ym=tp.detectSourceFormat,xm=vd.SERIES_LAYOUT_BY_COLUMN;ud.extend({type:"dataset",defaultOption:{seriesLayoutBy:xm,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){ym(this)}}),ug.extend({type:"dataset"});var _m=bl.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(e,t){var i=.5522848,n=t.cx,a=t.cy,r=t.rx,o=t.ry,s=r*i,l=o*i;e.moveTo(n-r,a),e.bezierCurveTo(n-r,a-l,n-s,a-o,n,a-o),e.bezierCurveTo(n+s,a-o,n+r,a-l,n+r,a),e.bezierCurveTo(n+r,a+l,n+s,a+o,n,a+o),e.bezierCurveTo(n-s,a+o,n-r,a+l,n-r,a),e.closePath()}}),bm=_m,wm=Fl.createFromString,Sm=Ve.isString,Mm=Ve.extend,Im=Ve.defaults,Tm=Ve.trim,Am=Ve.each,Cm=/[\s,]+/;function Dm(e){Sm(e)&&(e=(new DOMParser).parseFromString(e,"text/xml"));for(9===e.nodeType&&(e=e.firstChild);"svg"!==e.nodeName.toLowerCase()||1!==e.nodeType;)e=e.nextSibling;return e}function Lm(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}Lm.prototype.parse=function(e,t){t=t||{};var i=Dm(e);if(!i)throw new Error("Illegal svg");var n=new On;this._root=n;var a=i.getAttribute("viewBox")||"",r=parseFloat(i.getAttribute("width")||t.width),o=parseFloat(i.getAttribute("height")||t.height);isNaN(r)&&(r=null),isNaN(o)&&(o=null),Nm(i,n,null,!0);for(var s,l,u=i.firstChild;u;)this._parseNode(u,n),u=u.nextSibling;if(a){var h=Tm(a).split(Cm);h.length>=4&&(s={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(s&&null!=r&&null!=o&&(l=Gm(s,r,o),!t.ignoreViewBox)){var c=n;(n=new On).add(c),c.scale=l.scale.slice(),c.position=l.position.slice()}return t.ignoreRootClip||null==r||null==o||n.setClipPath(new yu({shape:{x:0,y:0,width:r,height:o}})),{root:n,width:r,height:o,viewBoxRect:s,viewBoxTransform:l}},Lm.prototype._parseNode=function(e,t){var i,n,a=e.nodeName.toLowerCase();if("defs"===a?this._isDefine=!0:"text"===a&&(this._isText=!0),this._isDefine){if(n=km[a]){var r=n.call(this,e),o=e.getAttribute("id");o&&(this._defs[o]=r)}}else(n=Pm[a])&&(i=n.call(this,e,t),t.add(i));for(var s=e.firstChild;s;)1===s.nodeType&&this._parseNode(s,i),3===s.nodeType&&this._isText&&this._parseText(s,i),s=s.nextSibling;"defs"===a?this._isDefine=!1:"text"===a&&(this._isText=!1)},Lm.prototype._parseText=function(e,t){if(1===e.nodeType){var i=e.getAttribute("dx")||0,n=e.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(n)}var a=new Wl({style:{text:e.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});Om(t,a),Nm(e,a,this._defs);var r=a.style.fontSize;r&&r<9&&(a.style.fontSize=9,a.scale=a.scale||[1,1],a.scale[0]*=r/9,a.scale[1]*=r/9);var o=a.getBoundingRect();return this._textX+=o.width,t.add(a),a};var Pm={g:function(e,t){var i=new On;return Om(t,i),Nm(e,i,this._defs),i},rect:function(e,t){var i=new yu;return Om(t,i),Nm(e,i,this._defs),i.setShape({x:parseFloat(e.getAttribute("x")||0),y:parseFloat(e.getAttribute("y")||0),width:parseFloat(e.getAttribute("width")||0),height:parseFloat(e.getAttribute("height")||0)}),i},circle:function(e,t){var i=new Ul;return Om(t,i),Nm(e,i,this._defs),i.setShape({cx:parseFloat(e.getAttribute("cx")||0),cy:parseFloat(e.getAttribute("cy")||0),r:parseFloat(e.getAttribute("r")||0)}),i},line:function(e,t){var i=new bu;return Om(t,i),Nm(e,i,this._defs),i.setShape({x1:parseFloat(e.getAttribute("x1")||0),y1:parseFloat(e.getAttribute("y1")||0),x2:parseFloat(e.getAttribute("x2")||0),y2:parseFloat(e.getAttribute("y2")||0)}),i},ellipse:function(e,t){var i=new bm;return Om(t,i),Nm(e,i,this._defs),i.setShape({cx:parseFloat(e.getAttribute("cx")||0),cy:parseFloat(e.getAttribute("cy")||0),rx:parseFloat(e.getAttribute("rx")||0),ry:parseFloat(e.getAttribute("ry")||0)}),i},polygon:function(e,t){var i=e.getAttribute("points");i&&(i=Rm(i));var n=new uu({shape:{points:i||[]}});return Om(t,n),Nm(e,n,this._defs),n},polyline:function(e,t){var i=new bl;Om(t,i),Nm(e,i,this._defs);var n=e.getAttribute("points");return n&&(n=Rm(n)),new hu({shape:{points:n||[]}})},image:function(e,t){var i=new Cr;return Om(t,i),Nm(e,i,this._defs),i.setStyle({image:e.getAttribute("xlink:href"),x:e.getAttribute("x"),y:e.getAttribute("y"),width:e.getAttribute("width"),height:e.getAttribute("height")}),i},text:function(e,t){var i=e.getAttribute("x")||0,n=e.getAttribute("y")||0,a=e.getAttribute("dx")||0,r=e.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(a),this._textY=parseFloat(n)+parseFloat(r);var o=new On;return Om(t,o),Nm(e,o,this._defs),o},tspan:function(e,t){var i=e.getAttribute("x"),n=e.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var a=e.getAttribute("dx")||0,r=e.getAttribute("dy")||0,o=new On;return Om(t,o),Nm(e,o,this._defs),this._textX+=a,this._textY+=r,o},path:function(e,t){var i=e.getAttribute("d")||"",n=wm(i);return Om(t,n),Nm(e,n,this._defs),n}},km={lineargradient:function(e){var t=parseInt(e.getAttribute("x1")||0,10),i=parseInt(e.getAttribute("y1")||0,10),n=parseInt(e.getAttribute("x2")||10,10),a=parseInt(e.getAttribute("y2")||0,10),r=new zu(t,i,n,a);return function(e,t){var i=e.firstChild;for(;i;){if(1===i.nodeType){var n=i.getAttribute("offset");n=n.indexOf("%")>0?parseInt(n,10)/100:n?parseFloat(n):0;var a=i.getAttribute("stop-color")||"#000000";t.addColorStop(n,a)}i=i.nextSibling}}(e,r),r},radialgradient:function(e){}};function Om(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Im(t.__inheritedStyle,e.__inheritedStyle))}function Rm(e){for(var t=Tm(e).split(Cm),i=[],n=0;n<t.length;n+=2){var a=parseFloat(t[n]),r=parseFloat(t[n+1]);i.push([a,r])}return i}var Em={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-align":"textAlign","alignment-baseline":"textBaseline"};function Nm(e,t,i,n){var a=t.__inheritedStyle||{},r="text"===t.type;if(1===e.nodeType&&(function(e,t){var i=e.getAttribute("transform");if(i){i=i.replace(/,/g," ");var n=null,a=[];i.replace(Vm,(function(e,t,i){a.push(t,i)}));for(var r=a.length-1;r>0;r-=2){var o=a[r],s=a[r-1];switch(n=n||ni.create(),s){case"translate":o=Tm(o).split(Cm),ni.translate(n,n,[parseFloat(o[0]),parseFloat(o[1]||0)]);break;case"scale":o=Tm(o).split(Cm),ni.scale(n,n,[parseFloat(o[0]),parseFloat(o[1]||o[0])]);break;case"rotate":o=Tm(o).split(Cm),ni.rotate(n,n,parseFloat(o[0]));break;case"skew":o=Tm(o).split(Cm),console.warn("Skew transform is not supported yet");break;case"matrix":o=Tm(o).split(Cm);n[0]=parseFloat(o[0]),n[1]=parseFloat(o[1]),n[2]=parseFloat(o[2]),n[3]=parseFloat(o[3]),n[4]=parseFloat(o[4]),n[5]=parseFloat(o[5])}}t.setLocalTransform(n)}}(e,t),Mm(a,function(e){var t=e.getAttribute("style"),i={};if(!t)return i;var n,a={};Fm.lastIndex=0;for(;null!=(n=Fm.exec(t));)a[n[1]]=n[2];for(var r in Em)Em.hasOwnProperty(r)&&null!=a[r]&&(i[Em[r]]=a[r]);return i}(e)),!n))for(var o in Em)if(Em.hasOwnProperty(o)){var s=e.getAttribute(o);null!=s&&(a[Em[o]]=s)}var l=r?"textFill":"fill",u=r?"textStroke":"stroke";t.style=t.style||new ia;var h=t.style;null!=a.fill&&h.set(l,Bm(a.fill,i)),null!=a.stroke&&h.set(u,Bm(a.stroke,i)),Am(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],(function(e){var t="lineWidth"===e&&r?"textStrokeWidth":e;null!=a[e]&&h.set(t,parseFloat(a[e]))})),a.textBaseline&&"auto"!==a.textBaseline||(a.textBaseline="alphabetic"),"alphabetic"===a.textBaseline&&(a.textBaseline="bottom"),"start"===a.textAlign&&(a.textAlign="left"),"end"===a.textAlign&&(a.textAlign="right"),Am(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],(function(e){null!=a[e]&&h.set(e,a[e])})),a.lineDash&&(t.style.lineDash=Tm(a.lineDash).split(Cm)),h[u]&&"none"!==h[u]&&(t[u]=!0),t.__inheritedStyle=a}var zm=/url\(\s*#(.*?)\)/;function Bm(e,t){var i=t&&e&&e.match(zm);return i?t[Tm(i[1])]:e}var Vm=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;var Fm=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Gm(e,t,i){var n=t/e.width,a=i/e.height,r=Math.min(n,a);return{scale:[r,r],position:[-(e.x+e.width/2)*r+t/2,-(e.y+e.height/2)*r+i/2]}}var Hm={parseXML:Dm,makeViewBoxTransform:Gm,parseSVG:function(e,t){return(new Lm).parse(e,t)}},Wm=Ve.createHashMap,Um=Ve.isString,jm=Ve.isArray,Zm=Ve.each,Ym=Hm.parseXML,Xm=Wm(),qm={registerMap:function(e,t,i){var n;return jm(t)?n=t:t.svg?n=[{type:"svg",source:t.svg,specialAreas:t.specialAreas}]:(t.geoJson&&!t.features&&(i=t.specialAreas,t=t.geoJson),n=[{type:"geoJSON",source:t,specialAreas:i}]),Zm(n,(function(e){var t=e.type;"geoJson"===t&&(t=e.type="geoJSON"),(0,$m[t])(e)})),Xm.set(e,n)},retrieveMap:function(e){return Xm.get(e)}},$m={geoJSON:function(e){var t=e.source;e.geoJSON=Um(t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(t):new Function("return ("+t+");")():t},svg:function(e){e.svgXML=Ym(e.source)}},Km=qm;function Jm(e){return e}function Qm(e,t,i,n,a){this._old=e,this._new=t,this._oldKeyGetter=i||Jm,this._newKeyGetter=n||Jm,this.context=a}function ev(e,t,i,n,a){for(var r=0;r<e.length;r++){var o="_ec_"+a[n](e[r],r),s=t[o];null==s?(i.push(o),t[o]=r):(s.length||(t[o]=s=[s]),s.push(r))}}Qm.prototype={constructor:Qm,add:function(e){return this._add=e,this},update:function(e){return this._update=e,this},remove:function(e){return this._remove=e,this},execute:function(){var e=this._old,t=this._new,i={},n=[],a=[];for(ev(e,{},n,"_oldKeyGetter",this),ev(t,i,a,"_newKeyGetter",this),r=0;r<e.length;r++){if(null!=(s=i[o=n[r]]))(u=s.length)?(1===u&&(i[o]=null),s=s.shift()):i[o]=null,this._update&&this._update(s,r);else this._remove&&this._remove(r)}for(var r=0;r<a.length;r++){var o=a[r];if(i.hasOwnProperty(o)){var s;if(null==(s=i[o]))continue;if(s.length)for(var l=0,u=s.length;l<u;l++)this._add&&this._add(s[l]);else this._add&&this._add(s)}}}};var tv=Qm,iv=Ve.each,nv=Ve.createHashMap,av=nv(["tooltip","label","itemName","itemId","seriesName"]);function rv(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}var ov={OTHER_DIMENSIONS:av,summarizeDimensions:function(e){var t={},i=t.encode={},n=nv(),a=[],r=[],o=t.userOutput={dimensionNames:e.dimensions.slice(),encode:{}};iv(e.dimensions,(function(t){var s,l=e.getDimensionInfo(t),u=l.coordDim;if(u){var h=l.coordDimIndex;rv(i,u)[h]=t,l.isExtraCoord||(n.set(u,1),"ordinal"!==(s=l.type)&&"time"!==s&&(a[0]=t),rv(o.encode,u)[h]=l.index),l.defaultTooltip&&r.push(t)}av.each((function(e,t){var n=rv(i,t),a=l.otherDims[t];null!=a&&!1!==a&&(n[a]=l.name)}))}));var s=[],l={};n.each((function(e,t){var n=i[t];l[t]=n[0],s=s.concat(n)})),t.dataDimsOnCoord=s,t.encodeFirstDimNotExtra=l;var u=i.label;u&&u.length&&(a=u.slice());var h=i.tooltip;return h&&h.length?r=h.slice():r.length||(r=a.slice()),i.defaultedLabel=a,i.defaultedTooltip=r,t},getDimensionTypeByAxis:function(e){return"category"===e?"ordinal":"time"===e?"time":"float"}};var sv=function(e){null!=e&&Ve.extend(this,e),this.otherDims={}},lv=Af.defaultDimValueGetters,uv=Af.DefaultDataProvider,hv=ov.summarizeDimensions,cv=Ve.isObject,dv="undefined",pv={float:typeof Float64Array===dv?Array:Float64Array,int:typeof Int32Array===dv?Array:Int32Array,ordinal:Array,number:Array,time:Array},fv=typeof Uint32Array===dv?Array:Uint32Array,gv=typeof Int32Array===dv?Array:Int32Array,mv=typeof Uint16Array===dv?Array:Uint16Array;function vv(e){return e._rawCount>65535?fv:mv}var yv=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],xv=["_extent","_approximateExtent","_rawExtent"];function _v(e,t){Ve.each(yv.concat(t.__wrappedMethods||[]),(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e.__wrappedMethods=t.__wrappedMethods,Ve.each(xv,(function(i){e[i]=Ve.clone(t[i])})),e._calculationInfo=Ve.extend(t._calculationInfo)}var bv=function(e,t){e=e||["x","y"];for(var i={},n=[],a={},r=0;r<e.length;r++){var o=e[r];Ve.isString(o)?o=new sv({name:o}):o instanceof sv||(o=new sv(o));var s=o.name;o.type=o.type||"float",o.coordDim||(o.coordDim=s,o.coordDimIndex=0),o.otherDims=o.otherDims||{},n.push(s),i[s]=o,o.index=r,o.createInvertedIndices&&(a[s]=[])}this.dimensions=n,this._dimensionInfos=i,this.hostModel=t,this.dataType,this._indices=null,this._count=0,this._rawCount=0,this._storage={},this._nameList=[],this._idList=[],this._optionModels=[],this._visual={},this._layout={},this._itemVisuals=[],this.hasItemVisual={},this._itemLayouts=[],this._graphicEls=[],this._chunkSize=1e5,this._chunkCount=0,this._rawData,this._rawExtent={},this._extent={},this._approximateExtent={},this._dimensionsSummary=hv(this),this._invertedIndicesMap=a,this._calculationInfo={},this.userOutput=this._dimensionsSummary.userOutput},wv=bv.prototype;function Sv(e,t,i,n,a){var r=pv[t.type],o=n-1,s=t.name,l=e[s][o];if(l&&l.length<i){for(var u=new r(Math.min(a-o*i,i)),h=0;h<l.length;h++)u[h]=l[h];e[s][o]=u}for(var c=n*i;c<a;c+=i)e[s].push(new r(Math.min(a-c,i)))}function Mv(e){var t=e._invertedIndicesMap;Ve.each(t,(function(i,n){var a=e._dimensionInfos[n].ordinalMeta;if(a){i=t[n]=new gv(a.categories.length);for(var r=0;r<i.length;r++)i[r]=-1;for(r=0;r<e._count;r++)i[e.get(n,r)]=r}}))}function Iv(e,t,i){var n;if(null!=t){var a=e._chunkSize,r=Math.floor(i/a),o=i%a,s=e.dimensions[t],l=e._storage[s][r];if(l){n=l[o];var u=e._dimensionInfos[s].ordinalMeta;u&&u.categories.length&&(n=u.categories[n])}}return n}function Tv(e){return e}function Av(e){return e<this._count&&e>=0?this._indices[e]:-1}function Cv(e,t){var i=e._idList[t];return null==i&&(i=Iv(e,e._idDimIdx,t)),null==i&&(i="e\0\0"+t),i}function Dv(e){return Ve.isArray(e)||(e=[e]),e}function Lv(e,t){var i=e.dimensions,n=new bv(Ve.map(i,e.getDimensionInfo,e),e.hostModel);_v(n,e);for(var a=n._storage={},r=e._storage,o=0;o<i.length;o++){var s=i[o];r[s]&&(Ve.indexOf(t,s)>=0?(a[s]=Pv(r[s]),n._rawExtent[s]=kv(),n._extent[s]=null):a[s]=r[s])}return n}function Pv(e){for(var t,i,n=new Array(e.length),a=0;a<e.length;a++)n[a]=(t=e[a],i=void 0,(i=t.constructor)===Array?t.slice():new i(t));return n}function kv(){return[1/0,-1/0]}wv.type="list",wv.hasItemOption=!0,wv.getDimension=function(e){return"number"!=typeof e&&(isNaN(e)||this._dimensionInfos.hasOwnProperty(e))||(e=this.dimensions[e]),e},wv.getDimensionInfo=function(e){return this._dimensionInfos[this.getDimension(e)]},wv.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice()},wv.mapDimension=function(e,t){var i=this._dimensionsSummary;if(null==t)return i.encodeFirstDimNotExtra[e];var n=i.encode[e];return!0===t?(n||[]).slice():n&&n[t]},wv.initData=function(e,t,i){(Ad.isInstance(e)||Ve.isArrayLike(e))&&(e=new uv(e,this.dimensions.length)),this._rawData=e,this._storage={},this._indices=null,this._nameList=t||[],this._idList=[],this._nameRepeatCount={},i||(this.hasItemOption=!1),this.defaultDimValueGetter=lv[this._rawData.getSource().sourceFormat],this._dimValueGetter=i=i||this.defaultDimValueGetter,this._dimValueGetterArrayRows=lv.arrayRows,this._rawExtent={},this._initDataFromProvider(0,e.count()),e.pure&&(this.hasItemOption=!1)},wv.getProvider=function(){return this._rawData},wv.appendData=function(e){var t=this._rawData,i=this.count();t.appendData(e);var n=t.count();t.persistent||(n+=i),this._initDataFromProvider(i,n)},wv.appendValues=function(e,t){for(var i=this._chunkSize,n=this._storage,a=this.dimensions,r=a.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,t?t.length:0),u=this._chunkCount,h=0;h<r;h++){o[v=a[h]]||(o[v]=kv()),n[v]||(n[v]=[]),Sv(n,this._dimensionInfos[v],i,u,l),this._chunkCount=n[v].length}for(var c=new Array(r),d=s;d<l;d++){for(var p=d-s,f=Math.floor(d/i),g=d%i,m=0;m<r;m++){var v=a[m],y=this._dimValueGetterArrayRows(e[p]||c,v,p,m);n[v][f][g]=y;var x=o[v];y<x[0]&&(x[0]=y),y>x[1]&&(x[1]=y)}t&&(this._nameList[d]=t[p])}this._rawCount=this._count=l,this._extent={},Mv(this)},wv._initDataFromProvider=function(e,t){if(!(e>=t)){for(var i,n=this._chunkSize,a=this._rawData,r=this._storage,o=this.dimensions,s=o.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},p=this._chunkCount,f=0;f<s;f++){c[b=o[f]]||(c[b]=kv());var g=l[b];0===g.otherDims.itemName&&(i=this._nameDimIdx=f),0===g.otherDims.itemId&&(this._idDimIdx=f),r[b]||(r[b]=[]),Sv(r,g,n,p,t),this._chunkCount=r[b].length}for(var m=new Array(s),v=e;v<t;v++){m=a.getItem(v,m);for(var y=Math.floor(v/n),x=v%n,_=0;_<s;_++){var b,w=r[b=o[_]][y],S=this._dimValueGetter(m,b,v,_);w[x]=S;var M=c[b];S<M[0]&&(M[0]=S),S>M[1]&&(M[1]=S)}if(!a.pure){var I=u[v];if(m&&null==I)if(null!=m.name)u[v]=I=m.name;else if(null!=i){var T=o[i],A=r[T][y];if(A){I=A[x];var C=l[T].ordinalMeta;C&&C.categories.length&&(I=C.categories[I])}}var D=null==m?null:m.id;null==D&&null!=I&&(d[I]=d[I]||0,D=I,d[I]>0&&(D+="__ec__"+d[I]),d[I]++),null!=D&&(h[v]=D)}}!a.persistent&&a.clean&&a.clean(),this._rawCount=this._count=t,this._extent={},Mv(this)}},wv.count=function(){return this._count},wv.getIndices=function(){var e=this._indices;if(e){var t=e.constructor,i=this._count;if(t===Array){a=new t(i);for(var n=0;n<i;n++)a[n]=e[n]}else a=new t(e.buffer,0,i)}else{var a=new(t=vv(this))(this.count());for(n=0;n<a.length;n++)a[n]=n}return a},wv.get=function(e,t){if(!(t>=0&&t<this._count))return NaN;var i=this._storage;if(!i[e])return NaN;t=this.getRawIndex(t);var n=Math.floor(t/this._chunkSize),a=t%this._chunkSize;return i[e][n][a]},wv.getByRawIndex=function(e,t){if(!(t>=0&&t<this._rawCount))return NaN;var i=this._storage[e];if(!i)return NaN;var n=Math.floor(t/this._chunkSize),a=t%this._chunkSize;return i[n][a]},wv._getFast=function(e,t){var i=Math.floor(t/this._chunkSize),n=t%this._chunkSize;return this._storage[e][i][n]},wv.getValues=function(e,t){var i=[];Ve.isArray(e)||(t=e,e=this.dimensions);for(var n=0,a=e.length;n<a;n++)i.push(this.get(e[n],t));return i},wv.hasValue=function(e){for(var t=this._dimensionsSummary.dataDimsOnCoord,i=0,n=t.length;i<n;i++)if(isNaN(this.get(t[i],e)))return!1;return!0},wv.getDataExtent=function(e){e=this.getDimension(e);var t=this._storage[e],i=kv();if(!t)return i;var n,a=this.count();if(!this._indices)return this._rawExtent[e].slice();if(n=this._extent[e])return n.slice();for(var r=(n=i)[0],o=n[1],s=0;s<a;s++){var l=this._getFast(e,this.getRawIndex(s));l<r&&(r=l),l>o&&(o=l)}return n=[r,o],this._extent[e]=n,n},wv.getApproximateExtent=function(e){return e=this.getDimension(e),this._approximateExtent[e]||this.getDataExtent(e)},wv.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},wv.getCalculationInfo=function(e){return this._calculationInfo[e]},wv.setCalculationInfo=function(e,t){cv(e)?Ve.extend(this._calculationInfo,e):this._calculationInfo[e]=t},wv.getSum=function(e){var t=0;if(this._storage[e])for(var i=0,n=this.count();i<n;i++){var a=this.get(e,i);isNaN(a)||(t+=a)}return t},wv.getMedian=function(e){var t=[];this.each(e,(function(e,i){isNaN(e)||t.push(e)}));var i=[].concat(t).sort((function(e,t){return e-t})),n=this.count();return 0===n?0:n%2==1?i[(n-1)/2]:(i[n/2]+i[n/2-1])/2},wv.rawIndexOf=function(e,t){var i=(e&&this._invertedIndicesMap[e])[t];return null==i||isNaN(i)?-1:i},wv.indexOfName=function(e){for(var t=0,i=this.count();t<i;t++)if(this.getName(t)===e)return t;return-1},wv.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,i=t[e];if(null!=i&&i<this._count&&i===e)return e;for(var n=0,a=this._count-1;n<=a;){var r=(n+a)/2|0;if(t[r]<e)n=r+1;else{if(!(t[r]>e))return r;a=r-1}}return-1},wv.indicesOfNearest=function(e,t,i){var n=[];if(!this._storage[e])return n;null==i&&(i=1/0);for(var a=1/0,r=-1,o=0,s=0,l=this.count();s<l;s++){var u=t-this.get(e,s),h=Math.abs(u);h<=i&&((h<a||h===a&&u>=0&&r<0)&&(a=h,r=u,o=0),u===r&&(n[o++]=s))}return n.length=o,n},wv.getRawIndex=Tv,wv.getRawDataItem=function(e){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(e));for(var t=[],i=0;i<this.dimensions.length;i++){var n=this.dimensions[i];t.push(this.get(n,e))}return t},wv.getName=function(e){var t=this.getRawIndex(e);return this._nameList[t]||Iv(this,this._nameDimIdx,t)||""},wv.getId=function(e){return Cv(this,this.getRawIndex(e))},wv.each=function(e,t,i,n){if(this._count){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this;for(var a=(e=Ve.map(Dv(e),this.getDimension,this)).length,r=0;r<this.count();r++)switch(a){case 0:t.call(i,r);break;case 1:t.call(i,this.get(e[0],r),r);break;case 2:t.call(i,this.get(e[0],r),this.get(e[1],r),r);break;default:for(var o=0,s=[];o<a;o++)s[o]=this.get(e[o],r);s[o]=r,t.apply(i,s)}}},wv.filterSelf=function(e,t,i,n){if(this._count){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this,e=Ve.map(Dv(e),this.getDimension,this);for(var a=this.count(),r=new(vv(this))(a),o=[],s=e.length,l=0,u=e[0],h=0;h<a;h++){var c,d=this.getRawIndex(h);if(0===s)c=t.call(i,h);else if(1===s){var p=this._getFast(u,d);c=t.call(i,p,h)}else{for(var f=0;f<s;f++)o[f]=this._getFast(u,d);o[f]=h,c=t.apply(i,o)}c&&(r[l++]=d)}return l<a&&(this._indices=r),this._count=l,this._extent={},this.getRawIndex=this._indices?Av:Tv,this}},wv.selectRange=function(e){if(this._count){var t=[];for(var i in e)e.hasOwnProperty(i)&&t.push(i);var n=t.length;if(n){var a=this.count(),r=new(vv(this))(a),o=0,s=t[0],l=e[s][0],u=e[s][1],h=!1;if(!this._indices){var c=0;if(1===n){for(var d=this._storage[t[0]],p=0;p<this._chunkCount;p++)for(var f=d[p],g=Math.min(this._count-p*this._chunkSize,this._chunkSize),m=0;m<g;m++){((b=f[m])>=l&&b<=u||isNaN(b))&&(r[o++]=c),c++}h=!0}else if(2===n){d=this._storage[s];var v=this._storage[t[1]],y=e[t[1]][0],x=e[t[1]][1];for(p=0;p<this._chunkCount;p++){f=d[p];var _=v[p];for(g=Math.min(this._count-p*this._chunkSize,this._chunkSize),m=0;m<g;m++){var b=f[m],w=_[m];(b>=l&&b<=u||isNaN(b))&&(w>=y&&w<=x||isNaN(w))&&(r[o++]=c),c++}}h=!0}}if(!h)if(1===n)for(m=0;m<a;m++){var S=this.getRawIndex(m);((b=this._getFast(s,S))>=l&&b<=u||isNaN(b))&&(r[o++]=S)}else for(m=0;m<a;m++){var M=!0;for(S=this.getRawIndex(m),p=0;p<n;p++){var I=t[p];((b=this._getFast(i,S))<e[I][0]||b>e[I][1])&&(M=!1)}M&&(r[o++]=this.getRawIndex(m))}return o<a&&(this._indices=r),this._count=o,this._extent={},this.getRawIndex=this._indices?Av:Tv,this}}},wv.mapArray=function(e,t,i,n){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this;var a=[];return this.each(e,(function(){a.push(t&&t.apply(this,arguments))}),i),a},wv.map=function(e,t,i,n){i=i||n||this;var a=Lv(this,e=Ve.map(Dv(e),this.getDimension,this));a._indices=this._indices,a.getRawIndex=a._indices?Av:Tv;for(var r=a._storage,o=[],s=this._chunkSize,l=e.length,u=this.count(),h=[],c=a._rawExtent,d=0;d<u;d++){for(var p=0;p<l;p++)h[p]=this.get(e[p],d);h[l]=d;var f=t&&t.apply(i,h);if(null!=f){"object"!=typeof f&&(o[0]=f,f=o);for(var g=this.getRawIndex(d),m=Math.floor(g/s),v=g%s,y=0;y<f.length;y++){var x=e[y],_=f[y],b=c[x],w=r[x];w&&(w[m][v]=_),_<b[0]&&(b[0]=_),_>b[1]&&(b[1]=_)}}}return a},wv.downSample=function(e,t,i,n){for(var a=Lv(this,[e]),r=a._storage,o=[],s=Math.floor(1/t),l=r[e],u=this.count(),h=this._chunkSize,c=a._rawExtent[e],d=new(vv(this))(u),p=0,f=0;f<u;f+=s){s>u-f&&(s=u-f,o.length=s);for(var g=0;g<s;g++){var m=this.getRawIndex(f+g),v=Math.floor(m/h),y=m%h;o[g]=l[v][y]}var x=i(o),_=this.getRawIndex(Math.min(f+n(o,x)||0,u-1)),b=_%h;l[Math.floor(_/h)][b]=x,x<c[0]&&(c[0]=x),x>c[1]&&(c[1]=x),d[p++]=_}return a._count=p,a._indices=d,a.getRawIndex=Av,a},wv.getItemModel=function(e){var t=this.hostModel;return new mc(this.getRawDataItem(e),t,t&&t.ecModel)},wv.diff=function(e){var t=this;return new tv(e?e.getIndices():[],this.getIndices(),(function(t){return Cv(e,t)}),(function(e){return Cv(t,e)}))},wv.getVisual=function(e){var t=this._visual;return t&&t[e]},wv.setVisual=function(e,t){if(cv(e))for(var i in e)e.hasOwnProperty(i)&&this.setVisual(i,e[i]);else this._visual=this._visual||{},this._visual[e]=t},wv.setLayout=function(e,t){if(cv(e))for(var i in e)e.hasOwnProperty(i)&&this.setLayout(i,e[i]);else this._layout[e]=t},wv.getLayout=function(e){return this._layout[e]},wv.getItemLayout=function(e){return this._itemLayouts[e]},wv.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?Ve.extend(this._itemLayouts[e]||{},t):t},wv.clearItemLayouts=function(){this._itemLayouts.length=0},wv.getItemVisual=function(e,t,i){var n=this._itemVisuals[e],a=n&&n[t];return null!=a||i?a:this.getVisual(t)},wv.setItemVisual=function(e,t,i){var n=this._itemVisuals[e]||{},a=this.hasItemVisual;if(this._itemVisuals[e]=n,cv(t))for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r],a[r]=!0);else n[t]=i,a[t]=!0},wv.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var Ov=function(e){e.seriesIndex=this.seriesIndex,e.dataIndex=this.dataIndex,e.dataType=this.dataType};wv.setItemGraphicEl=function(e,t){var i=this.hostModel;t&&(t.dataIndex=e,t.dataType=this.dataType,t.seriesIndex=i&&i.seriesIndex,"group"===t.type&&t.traverse(Ov,t)),this._graphicEls[e]=t},wv.getItemGraphicEl=function(e){return this._graphicEls[e]},wv.eachItemGraphicEl=function(e,t){Ve.each(this._graphicEls,(function(i,n){i&&e&&e.call(t,i,n)}))},wv.cloneShallow=function(e){if(!e){var t=Ve.map(this.dimensions,this.getDimensionInfo,this);e=new bv(t,this.hostModel)}if(e._storage=this._storage,_v(e,this),this._indices){var i=this._indices.constructor;e._indices=new i(this._indices)}else e._indices=null;return e.getRawIndex=e._indices?Av:Tv,e},wv.wrapMethod=function(e,t){var i=this[e];"function"==typeof i&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=i.apply(this,arguments);return t.apply(this,[e].concat(Ve.slice(arguments)))})},wv.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],wv.CHANGABLE_METHODS=["filterSelf","selectRange"];var Rv=bv,Ev=Ve.createHashMap,Nv=Ve.each,zv=Ve.isString,Bv=Ve.defaults,Vv=Ve.extend,Fv=Ve.isObject,Gv=Ve.clone,Hv=Ro.normalizeToArray,Wv=tp.guessOrdinal,Uv=tp.BE_ORDINAL,jv=ov.OTHER_DIMENSIONS;function Zv(e,t,i){if(i||null!=t.get(e)){for(var n=0;null!=t.get(e+n);)n++;e+=n}return t.set(e,!0),e}var Yv=function(e,t,i){Ad.isInstance(t)||(t=Ad.seriesDataToSource(t)),i=i||{},e=(e||[]).slice();for(var n=(i.dimsDef||[]).slice(),a=Ev(),r=Ev(),o=[],s=function(e,t,i,n){var a=Math.max(e.dimensionsDetectCount||1,t.length,i.length,n||0);return Nv(t,(function(e){var t=e.dimsDef;t&&(a=Math.max(a,t.length))})),a}(t,e,n,i.dimCount),l=0;l<s;l++){var u=n[l]=Vv({},Fv(n[l])?n[l]:{name:n[l]}),h=u.name,c=o[l]=new sv;null!=h&&null==a.get(h)&&(c.name=c.displayName=h,a.set(h,l)),null!=u.type&&(c.type=u.type),null!=u.displayName&&(c.displayName=u.displayName)}var d=i.encodeDef;!d&&i.encodeDefaulter&&(d=i.encodeDefaulter(t,s)),(d=Ev(d)).each((function(e,t){if(1===(e=Hv(e).slice()).length&&!zv(e[0])&&e[0]<0)d.set(t,!1);else{var i=d.set(t,[]);Nv(e,(function(e,n){zv(e)&&(e=a.get(e)),null!=e&&e<s&&(i[n]=e,f(o[e],t,n))}))}}));var p=0;function f(e,t,i){null!=jv.get(t)?e.otherDims[t]=i:(e.coordDim=t,e.coordDimIndex=i,r.set(t,!0))}Nv(e,(function(e,t){var i,n,a;if(zv(e))i=e,e={};else{i=e.name;var r=e.ordinalMeta;e.ordinalMeta=null,(e=Gv(e)).ordinalMeta=r,n=e.dimsDef,a=e.otherDims,e.name=e.coordDim=e.coordDimIndex=e.dimsDef=e.otherDims=null}if(!1!==(s=d.get(i))){var s;if(!(s=Hv(s)).length)for(var l=0;l<(n&&n.length||1);l++){for(;p<o.length&&null!=o[p].coordDim;)p++;p<o.length&&s.push(p++)}Nv(s,(function(t,r){var s=o[t];if(f(Bv(s,e),i,r),null==s.name&&n){var l=n[r];!Fv(l)&&(l={name:l}),s.name=s.displayName=l.name,s.defaultTooltip=l.defaultTooltip}a&&Bv(s.otherDims,a)}))}}));var g=i.generateCoord,m=i.generateCoordCount,v=null!=m;m=g?m||1:0;for(var y=g||"value",x=0;x<s;x++){null==(c=o[x]=o[x]||new sv).coordDim&&(c.coordDim=Zv(y,r,v),c.coordDimIndex=0,(!g||m<=0)&&(c.isExtraCoord=!0),m--),null==c.name&&(c.name=Zv(c.coordDim,a)),null!=c.type||Wv(t,x,c.name)!==Uv.Must&&(!c.isExtraCoord||null==c.otherDims.itemName&&null==c.otherDims.seriesName)||(c.type="ordinal")}return o},Xv=Yv;var qv=function(e,t){return Xv((t=t||{}).coordDimensions||[],e,{dimsDef:t.dimensionsDefine||e.dimensionsDefine,encodeDef:t.encodeDefine||e.encodeDefine,dimCount:t.dimensionsCount,encodeDefaulter:t.encodeDefaulter,generateCoord:t.generateCoord,generateCoordCount:t.generateCoordCount})},$v=Ve.createHashMap,Kv=Ve.each;function Jv(e){this.coordSysName=e,this.coordSysDims=[],this.axisMap=$v(),this.categoryAxisMap=$v(),this.firstCategoryDimIndex=null}var Qv={cartesian2d:function(e,t,i,n){var a=e.getReferringComponents("xAxis")[0],r=e.getReferringComponents("yAxis")[0];t.coordSysDims=["x","y"],i.set("x",a),i.set("y",r),ey(a)&&(n.set("x",a),t.firstCategoryDimIndex=0),ey(r)&&(n.set("y",r),t.firstCategoryDimIndex,t.firstCategoryDimIndex=1)},singleAxis:function(e,t,i,n){var a=e.getReferringComponents("singleAxis")[0];t.coordSysDims=["single"],i.set("single",a),ey(a)&&(n.set("single",a),t.firstCategoryDimIndex=0)},polar:function(e,t,i,n){var a=e.getReferringComponents("polar")[0],r=a.findAxisModel("radiusAxis"),o=a.findAxisModel("angleAxis");t.coordSysDims=["radius","angle"],i.set("radius",r),i.set("angle",o),ey(r)&&(n.set("radius",r),t.firstCategoryDimIndex=0),ey(o)&&(n.set("angle",o),null==t.firstCategoryDimIndex&&(t.firstCategoryDimIndex=1))},geo:function(e,t,i,n){t.coordSysDims=["lng","lat"]},parallel:function(e,t,i,n){var a=e.ecModel,r=a.getComponent("parallel",e.get("parallelIndex")),o=t.coordSysDims=r.dimensions.slice();Kv(r.parallelAxisIndex,(function(e,r){var s=a.getComponent("parallelAxis",e),l=o[r];i.set(l,s),ey(s)&&null==t.firstCategoryDimIndex&&(n.set(l,s),t.firstCategoryDimIndex=r)}))}};function ey(e){return"category"===e.get("type")}var ty={getCoordSysInfoBySeries:function(e){var t=e.get("coordinateSystem"),i=new Jv(t),n=Qv[t];if(n)return n(e,i,i.axisMap,i.categoryAxisMap),i}},iy=Ve.each,ny=Ve.isString;function ay(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}var ry={enableDataStack:function(e,t,i){var n,a,r,o,s=(i=i||{}).byIndex,l=i.stackedCoordDimension,u=!(!e||!e.get("stack"));if(iy(t,(function(e,i){ny(e)&&(t[i]=e={name:e}),u&&!e.isExtraCoord&&(s||n||!e.ordinalMeta||(n=e),a||"ordinal"===e.type||"time"===e.type||l&&l!==e.coordDim||(a=e))})),!a||s||n||(s=!0),a){r="__\0ecstackresult",o="__\0ecstackedover",n&&(n.createInvertedIndices=!0);var h=a.coordDim,c=a.type,d=0;iy(t,(function(e){e.coordDim===h&&d++})),t.push({name:r,coordDim:h,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0}),d++,t.push({name:o,coordDim:o,coordDimIndex:d,type:c,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:a&&a.name,stackedByDimension:n&&n.name,isStackedByIndex:s,stackedOverDimension:o,stackResultDimension:r}},isDimensionStacked:ay,getStackedDimension:function(e,t){return ay(e,t)?e.getCalculationInfo("stackResultDimension"):t}},oy=vd.SOURCE_FORMAT_ORIGINAL,sy=ov.getDimensionTypeByAxis,ly=Ro.getDataItemValue,uy=ty.getCoordSysInfoBySeries,hy=ry.enableDataStack,cy=tp.makeSeriesEncodeForAxisCoordSys;var dy=function(e,t,i){i=i||{},Ad.isInstance(e)||(e=Ad.seriesDataToSource(e));var n,a=t.get("coordinateSystem"),r=Tp.get(a),o=uy(t);o&&(n=Ve.map(o.coordSysDims,(function(e){var t={name:e},i=o.axisMap.get(e);if(i){var n=i.get("type");t.type=sy(n)}return t}))),n||(n=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]);var s,l,u=qv(e,{coordDimensions:n,generateCoord:i.generateCoord,encodeDefaulter:i.useEncodeDefaulter?Ve.curry(cy,n,t):null});o&&Ve.each(u,(function(e,t){var i=e.coordDim,n=o.categoryAxisMap.get(i);n&&(null==s&&(s=t),e.ordinalMeta=n.getOrdinalMeta()),null!=e.otherDims.itemName&&(l=!0)})),l||null==s||(u[s].otherDims.itemName=0);var h=hy(t,u),c=new Rv(u,t);c.setCalculationInfo(h);var d=null!=s&&function(e){if(e.sourceFormat===oy){var t=function(e){var t=0;for(;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[]);return null!=t&&!Ve.isArray(ly(t))}}(e)?function(e,t,i,n){return n===s?i:this.defaultDimValueGetter(e,t,i,n)}:null;return c.hasItemOption=!1,c.initData(e,null,d),c},py=dy;function fy(e){this._setting=e||{},this._extent=[1/0,-1/0],this._interval=0,this.init&&this.init.apply(this,arguments)}fy.prototype.parse=function(e){return e},fy.prototype.getSetting=function(e){return this._setting[e]},fy.prototype.contain=function(e){var t=this._extent;return e>=t[0]&&e<=t[1]},fy.prototype.normalize=function(e){var t=this._extent;return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},fy.prototype.scale=function(e){var t=this._extent;return e*(t[1]-t[0])+t[0]},fy.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},fy.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},fy.prototype.getExtent=function(){return this._extent.slice()},fy.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},fy.prototype.isBlank=function(){return this._isBlank},fy.prototype.setBlank=function(e){this._isBlank=e},fy.prototype.getLabel=null,Wo.enableClassExtend(fy),Wo.enableClassManagement(fy,{registerWhenExtend:!0});var gy=fy,my=Ve.createHashMap,vy=Ve.isObject,yy=Ve.map;function xy(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}xy.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&yy(i,wy);return new xy({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var _y=xy.prototype;function by(e){return e._map||(e._map=my(e.categories))}function wy(e){return vy(e)&&null!=e.value?e.value:e+""}_y.getOrdinal=function(e){return by(this).get(e)},_y.parseAndCollect=function(e){var t,i=this._needCollect;if("string"!=typeof e&&!i)return e;if(i&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var n=by(this);return null==(t=n.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t};var Sy=xy,My=gy.prototype,Iy=gy.extend({type:"ordinal",init:function(e,t){e&&!Ve.isArray(e)||(e=new Sy({categories:e})),this._ordinalMeta=e,this._extent=t||[0,e.categories.length-1]},parse:function(e){return"string"==typeof e?this._ordinalMeta.getOrdinal(e):Math.round(e)},contain:function(e){return e=this.parse(e),My.contain.call(this,e)&&null!=this._ordinalMeta.categories[e]},normalize:function(e){return My.normalize.call(this,this.parse(e))},scale:function(e){return Math.round(My.scale.call(this,e))},getTicks:function(){for(var e=[],t=this._extent,i=t[0];i<=t[1];)e.push(i),i++;return e},getLabel:function(e){if(!this.isBlank())return this._ordinalMeta.categories[e]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:Ve.noop,niceExtent:Ve.noop});Iy.create=function(){return new Iy};var Ty=Iy,Ay=Pc.round;function Cy(e){return Pc.getPrecisionSafe(e)+2}function Dy(e,t,i){e[t]=Math.max(Math.min(e[t],i[1]),i[0])}function Ly(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),Dy(e,0,t),Dy(e,1,t),e[0]>e[1]&&(e[0]=e[1])}var Py={intervalScaleNiceTicks:function(e,t,i,n){var a={},r=e[1]-e[0],o=a.interval=Pc.nice(r/t,!0);null!=i&&o<i&&(o=a.interval=i),null!=n&&o>n&&(o=a.interval=n);var s=a.intervalPrecision=Cy(o);return Ly(a.niceTickExtent=[Ay(Math.ceil(e[0]/o)*o,s),Ay(Math.floor(e[1]/o)*o,s)],e),a},getIntervalPrecision:Cy,fixExtent:Ly},ky=Pc.round,Oy=gy.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(e,t){var i=this._extent;isNaN(e)||(i[0]=parseFloat(e)),isNaN(t)||(i[1]=parseFloat(t))},unionExtent:function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1]),Oy.prototype.setExtent.call(this,t[0],t[1])},getInterval:function(){return this._interval},setInterval:function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=Py.getIntervalPrecision(e)},getTicks:function(e){var t=this._interval,i=this._extent,n=this._niceExtent,a=this._intervalPrecision,r=[];if(!t)return r;i[0]<n[0]&&(e?r.push(ky(n[0]-t,a)):r.push(i[0]));for(var o=n[0];o<=n[1]&&(r.push(o),(o=ky(o+t,a))!==r[r.length-1]);)if(r.length>1e4)return[];var s=r.length?r[r.length-1]:n[1];return i[1]>s&&(e?r.push(ky(s+t,a)):r.push(i[1])),r},getMinorTicks:function(e){for(var t=this.getTicks(!0),i=[],n=this.getExtent(),a=1;a<t.length;a++){for(var r=t[a],o=t[a-1],s=0,l=[],u=(r-o)/e;s<e-1;){var h=Pc.round(o+(s+1)*u);h>n[0]&&h<n[1]&&l.push(h),s++}i.push(l)}return i},getLabel:function(e,t){if(null==e)return"";var i=t&&t.precision;return null==i?i=Pc.getPrecisionSafe(e)||0:"auto"===i&&(i=this._intervalPrecision),e=ky(e,i,!0),Uc.addCommas(e)},niceTicks:function(e,t,i){e=e||5;var n=this._extent,a=n[1]-n[0];if(isFinite(a)){a<0&&(a=-a,n.reverse());var r=Py.intervalScaleNiceTicks(n,e,t,i);this._intervalPrecision=r.intervalPrecision,this._interval=r.interval,this._niceExtent=r.niceTickExtent}},niceExtent:function(e){var t=this._extent;if(t[0]===t[1])if(0!==t[0]){var i=t[0];e.fixMax||(t[1]+=i/2),t[0]-=i/2}else t[1]=1;var n=t[1]-t[0];isFinite(n)||(t[0]=0,t[1]=1),this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var a=this._interval;e.fixMin||(t[0]=ky(Math.floor(t[0]/a)*a)),e.fixMax||(t[1]=ky(Math.ceil(t[1]/a)*a))}});Oy.create=function(){return new Oy};var Ry=Oy,Ey=Pc.parsePercent,Ny=ry.isDimensionStacked,zy="__ec_stack_",By="undefined"!=typeof Float32Array?Float32Array:Array;function Vy(e){return e.get("stack")||zy+e.seriesIndex}function Fy(e){return e.dim+e.index}function Gy(e,t){var i=[];return t.eachSeriesByType(e,(function(e){Zy(e)&&!Yy(e)&&i.push(e)})),i}function Hy(e){var t=function(e){var t={};Ve.each(e,(function(e){var i=e.coordinateSystem.getBaseAxis();if("time"===i.type||"value"===i.type)for(var n=e.getData(),a=i.dim+"_"+i.index,r=n.mapDimension(i.dim),o=0,s=n.count();o<s;++o){var l=n.get(r,o);t[a]?t[a].push(l):t[a]=[l]}}));var i=[];for(var n in t)if(t.hasOwnProperty(n)){var a=t[n];if(a){a.sort((function(e,t){return e-t}));for(var r=null,o=1;o<a.length;++o){var s=a[o]-a[o-1];s>0&&(r=null===r?s:Math.min(r,s))}i[n]=r}}return i}(e),i=[];return Ve.each(e,(function(e){var n,a=e.coordinateSystem.getBaseAxis(),r=a.getExtent();if("category"===a.type)n=a.getBandWidth();else if("value"===a.type||"time"===a.type){var o=a.dim+"_"+a.index,s=t[o],l=Math.abs(r[1]-r[0]),u=a.scale.getExtent(),h=Math.abs(u[1]-u[0]);n=s?l/h*s:l}else{var c=e.getData();n=Math.abs(r[1]-r[0])/c.count()}var d=Ey(e.get("barWidth"),n),p=Ey(e.get("barMaxWidth"),n),f=Ey(e.get("barMinWidth")||1,n),g=e.get("barGap"),m=e.get("barCategoryGap");i.push({bandWidth:n,barWidth:d,barMaxWidth:p,barMinWidth:f,barGap:g,barCategoryGap:m,axisKey:Fy(a),stackId:Vy(e)})})),Wy(i)}function Wy(e){var t={};Ve.each(e,(function(e,i){var n=e.axisKey,a=e.bandWidth,r=t[n]||{bandWidth:a,remainedWidth:a,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},o=r.stacks;t[n]=r;var s=e.stackId;o[s]||r.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var l=e.barWidth;l&&!o[s].width&&(o[s].width=l,l=Math.min(r.remainedWidth,l),r.remainedWidth-=l);var u=e.barMaxWidth;u&&(o[s].maxWidth=u);var h=e.barMinWidth;h&&(o[s].minWidth=h);var c=e.barGap;null!=c&&(r.gap=c);var d=e.barCategoryGap;null!=d&&(r.categoryGap=d)}));var i={};return Ve.each(t,(function(e,t){i[t]={};var n=e.stacks,a=e.bandWidth,r=Ey(e.categoryGap,a),o=Ey(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-r)/(l+(l-1)*o);u=Math.max(u,0),Ve.each(n,(function(e){var t=e.maxWidth,i=e.minWidth;if(e.width){n=e.width;t&&(n=Math.min(n,t)),i&&(n=Math.max(n,i)),e.width=n,s-=n+o*n,l--}else{var n=u;t&&t<n&&(n=Math.min(t,s)),i&&i>n&&(n=i),n!==u&&(e.width=n,s-=n+o*n,l--)}})),u=(s-r)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;Ve.each(n,(function(e,t){e.width||(e.width=u),h=e,c+=e.width*(1+o)})),h&&(c-=h.width*o);var d=-c/2;Ve.each(n,(function(e,n){i[t][n]=i[t][n]||{bandWidth:a,offset:d,width:e.width},d+=e.width*(1+o)}))})),i}function Uy(e,t,i){if(e&&t){var n=e[Fy(t)];return null!=n&&null!=i&&(n=n[Vy(i)]),n}}var jy={seriesType:"bar",plan:cg(),reset:function(e){if(Zy(e)&&Yy(e)){var t=e.getData(),i=e.coordinateSystem,n=i.grid.getRect(),a=i.getBaseAxis(),r=i.getOtherAxis(a),o=t.mapDimension(r.dim),s=t.mapDimension(a.dim),l=r.isHorizontal(),u=l?0:1,h=Uy(Hy([e]),a,e).width;return h>.5||(h=.5),{progress:function(e,t){var c,d=e.count,p=new By(2*d),f=new By(2*d),g=new By(d),m=[],v=[],y=0,x=0;for(;null!=(c=e.next());)v[u]=t.get(o,c),v[1-u]=t.get(s,c),m=i.dataToPoint(v,null,m),f[y]=l?n.x+n.width:m[0],p[y++]=m[0],f[y]=l?m[1]:n.y+n.height,p[y++]=m[1],g[x++]=c;t.setLayout({largePoints:p,largeDataIndices:g,largeBackgroundPoints:f,barWidth:h,valueAxisStart:Xy(a,r),backgroundStart:l?n.x:n.y,valueAxisHorizontal:l})}}}}};function Zy(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function Yy(e){return e.pipelineContext&&e.pipelineContext.large}function Xy(e,t,i){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}var qy=function(e){var t=[],i=e.axis,n="axis0";if("category"===i.type){for(var a=i.getBandWidth(),r=0;r<e.count;r++)t.push(Ve.defaults({bandWidth:a,axisKey:n,stackId:zy+r},e));var o=Wy(t),s=[];for(r=0;r<e.count;r++){var l=o[n][zy+r];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}},$y=function(e,t){var i=Gy(e,t),n=Hy(i),a={};Ve.each(i,(function(e){var t=e.getData(),i=e.coordinateSystem,r=i.getBaseAxis(),o=Vy(e),s=n[Fy(r)][o],l=s.offset,u=s.width,h=i.getOtherAxis(r),c=e.get("barMinHeight")||0;a[o]=a[o]||[],t.setLayout({bandWidth:s.bandWidth,offset:l,size:u});for(var d=t.mapDimension(h.dim),p=t.mapDimension(r.dim),f=Ny(t,d),g=h.isHorizontal(),m=Xy(r,h),v=0,y=t.count();v<y;v++){var x,_,b,w,S,M=t.get(d,v),I=t.get(p,v),T=M>=0?"p":"n",A=m;if(f&&(a[o][I]||(a[o][I]={p:m,n:m}),A=a[o][I][T]),g)x=A,_=(S=i.dataToPoint([M,I]))[1]+l,b=S[0]-m,w=u,Math.abs(b)<c&&(b=(b<0?-1:1)*c),isNaN(b)||f&&(a[o][I][T]+=b);else x=(S=i.dataToPoint([I,M]))[0]+l,_=A,b=u,w=S[1]-m,Math.abs(w)<c&&(w=(w<=0?-1:1)*c),isNaN(w)||f&&(a[o][I][T]+=w);t.setItemLayout(v,{x:x,y:_,width:b,height:w})}}),this)},Ky={getLayoutOnAxis:qy,prepareLayoutBarSeries:Gy,makeColumnLayout:Hy,retrieveColumnLayout:Uy,layout:$y,largeLayout:jy},Jy=Ry.prototype,Qy=Math.ceil,ex=Math.floor,tx=1e3,ix=6e4,nx=36e5,ax=864e5,rx=Ry.extend({type:"time",getLabel:function(e){var t=this._stepLvl,i=new Date(e);return Uc.formatTime(t[0],i,this.getSetting("useUTC"))},niceExtent:function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=ax,t[1]+=ax),t[1]===-1/0&&t[0]===1/0){var i=new Date;t[1]=+new Date(i.getFullYear(),i.getMonth(),i.getDate()),t[0]=t[1]-ax}this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var n=this._interval;e.fixMin||(t[0]=Pc.round(ex(t[0]/n)*n)),e.fixMax||(t[1]=Pc.round(Qy(t[1]/n)*n))},niceTicks:function(e,t,i){e=e||10;var n=this._extent,a=n[1]-n[0],r=a/e;null!=t&&r<t&&(r=t),null!=i&&r>i&&(r=i);var o=ox.length,s=function(e,t,i,n){for(;i<n;){var a=i+n>>>1;e[a][1]<t?i=a+1:n=a}return i}(ox,r,0,o),l=ox[Math.min(s,o-1)],u=l[1];if("year"===l[0]){var h=a/u;u*=Pc.nice(h/e,!0)}var c=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,d=[Math.round(Qy((n[0]-c)/u)*u+c),Math.round(ex((n[1]-c)/u)*u+c)];Py.fixExtent(d,n),this._stepLvl=l,this._interval=u,this._niceExtent=d},parse:function(e){return+Pc.parseDate(e)}});Ve.each(["contain","normalize"],(function(e){rx.prototype[e]=function(t){return Jy[e].call(this,this.parse(t))}}));var ox=[["hh:mm:ss",tx],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",ix],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",nx],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",216e5],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",ax],["MM-dd\nyyyy",1728e5],["MM-dd\nyyyy",2592e5],["MM-dd\nyyyy",3456e5],["MM-dd\nyyyy",432e6],["MM-dd\nyyyy",5184e5],["week",6048e5],["MM-dd\nyyyy",864e6],["week",12096e5],["week",18144e5],["month",26784e5],["week",36288e5],["month",53568e5],["week",6048e6],["quarter",8208e6],["month",107136e5],["month",13392e6],["half-year",16416e6],["month",214272e5],["month",26784e6],["year",32832e6]];rx.create=function(e){return new rx({useUTC:e.ecModel.get("useUTC")})};var sx=gy.prototype,lx=Ry.prototype,ux=Pc.getPrecisionSafe,hx=Pc.round,cx=Math.floor,dx=Math.ceil,px=Math.pow,fx=Math.log,gx=gy.extend({type:"log",base:10,$constructor:function(){gy.apply(this,arguments),this._originalScale=new Ry},getTicks:function(e){var t=this._originalScale,i=this._extent,n=t.getExtent();return Ve.map(lx.getTicks.call(this,e),(function(e){var a=Pc.round(px(this.base,e));return a=e===i[0]&&t.__fixMin?mx(a,n[0]):a,a=e===i[1]&&t.__fixMax?mx(a,n[1]):a}),this)},getMinorTicks:lx.getMinorTicks,getLabel:lx.getLabel,scale:function(e){return e=sx.scale.call(this,e),px(this.base,e)},setExtent:function(e,t){var i=this.base;e=fx(e)/fx(i),t=fx(t)/fx(i),lx.setExtent.call(this,e,t)},getExtent:function(){var e=this.base,t=sx.getExtent.call(this);t[0]=px(e,t[0]),t[1]=px(e,t[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(t[0]=mx(t[0],n[0])),i.__fixMax&&(t[1]=mx(t[1],n[1])),t},unionExtent:function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=fx(e[0])/fx(t),e[1]=fx(e[1])/fx(t),sx.unionExtent.call(this,e)},unionExtentFromData:function(e,t){this.unionExtent(e.getApproximateExtent(t))},niceTicks:function(e){e=e||10;var t=this._extent,i=t[1]-t[0];if(!(i===1/0||i<=0)){var n=Pc.quantity(i);for(e/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var a=[Pc.round(dx(t[0]/n)*n),Pc.round(cx(t[1]/n)*n)];this._interval=n,this._niceExtent=a}},niceExtent:function(e){lx.niceExtent.call(this,e);var t=this._originalScale;t.__fixMin=e.fixMin,t.__fixMax=e.fixMax}});function mx(e,t){return hx(e,ux(t))}Ve.each(["contain","normalize"],(function(e){gx.prototype[e]=function(t){return t=fx(t)/fx(this.base),sx[e].call(this,t)}})),gx.create=function(){return new gx};var vx=gx,yx=Ky.prepareLayoutBarSeries,xx=Ky.makeColumnLayout,_x=Ky.retrieveColumnLayout;function bx(e,t){var i,n,a,r=e.type,o=t.getMin(),s=t.getMax(),l=e.getExtent();"ordinal"===r?i=t.getCategories().length:(n=t.get("boundaryGap"),Ve.isArray(n)||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=Pc.parsePercent(n[0],1),n[1]=Pc.parsePercent(n[1],1),a=l[1]-l[0]||Math.abs(l[0])),"dataMin"===o?o=l[0]:"function"==typeof o&&(o=o({min:l[0],max:l[1]})),"dataMax"===s?s=l[1]:"function"==typeof s&&(s=s({min:l[0],max:l[1]}));var u=null!=o,h=null!=s;null==o&&(o="ordinal"===r?i?0:NaN:l[0]-n[0]*a),null==s&&(s="ordinal"===r?i?i-1:NaN:l[1]+n[1]*a),(null==o||!isFinite(o))&&(o=NaN),(null==s||!isFinite(s))&&(s=NaN),e.setBlank(Ve.eqNaN(o)||Ve.eqNaN(s)||"ordinal"===r&&!e.getOrdinalMeta().categories.length),t.getNeedCrossZero()&&(o>0&&s>0&&!u&&(o=0),o<0&&s<0&&!h&&(s=0));var c=t.ecModel;if(c&&"time"===r){var d,p=yx("bar",c);if(Ve.each(p,(function(e){d|=e.getBaseAxis()===t.axis})),d){var f=xx(p),g=function(e,t,i,n){var a=i.axis.getExtent(),r=a[1]-a[0],o=_x(n,i.axis);if(void 0===o)return{min:e,max:t};var s=1/0;Ve.each(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;Ve.each(o,(function(e){l=Math.max(e.offset+e.width,l)})),s=Math.abs(s),l=Math.abs(l);var u=s+l,h=t-e,c=h/(1-(s+l)/r)-h;return t+=c*(l/u),e-=c*(s/u),{min:e,max:t}}(o,s,t,f);o=g.min,s=g.max}}return{extent:[o,s],fixMin:u,fixMax:h}}function Sx(e){var t,i=e.getLabelModel().get("formatter"),n="category"===e.type?e.scale.getExtent()[0]:null;return"string"==typeof i?(t=i,i=function(i){return i=e.scale.getLabel(i),t.replace("{value}",null!=i?i:"")}):"function"==typeof i?function(t,a){return null!=n&&(a=t-n),i(Mx(e,t),a)}:function(t){return e.scale.getLabel(t)}}function Mx(e,t){return"category"===e.type?e.scale.getLabel(t):t}function Ix(e,t){var i=t*Math.PI/180,n=e.plain(),a=n.width,r=n.height,o=a*Math.cos(i)+r*Math.sin(i),s=a*Math.sin(i)+r*Math.cos(i);return new Pn(n.x,n.y,o,s)}function Tx(e){var t=e.get("interval");return null==t?"auto":t}var Ax=function(e,t){var i=bx(e,t),n=i.extent,a=t.get("splitNumber");"log"===e.type&&(e.base=t.get("logBase"));var r=e.type;e.setExtent(n[0],n[1]),e.niceExtent({splitNumber:a,fixMin:i.fixMin,fixMax:i.fixMax,minInterval:"interval"===r||"time"===r?t.get("minInterval"):null,maxInterval:"interval"===r||"time"===r?t.get("maxInterval"):null});var o=t.get("interval");null!=o&&e.setInterval&&e.setInterval(o)},Cx=function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new Ty(e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),[1/0,-1/0]);case"value":return new Ry;default:return(gy.getClass(t)||Ry).create(e)}},Dx=function(e){var t=e.scale.getExtent(),i=t[0],n=t[1];return!(i>0&&n>0||i<0&&n<0)},Lx=function(e){var t=e.model,i=e.scale;if(t.get("axisLabel.show")&&!i.isBlank()){var n,a,r="category"===e.type,o=i.getExtent();a=r?i.count():(n=i.getTicks()).length;var s,l=e.getLabelModel(),u=Sx(e),h=1;a>40&&(h=Math.ceil(a/40));for(var c=0;c<a;c+=h){var d=u(n?n[c]:o[0]+c),p=Ix(l.getTextRect(d),l.get("rotate")||0);s?s.union(p):s=p}return s}},Px={getScaleExtent:bx,niceScaleExtent:Ax,createScaleByModel:Cx,ifAxisCrossZero:Dx,makeLabelFormatter:Sx,getAxisRawValue:Mx,estimateLabelUnionRect:Lx,getOptionCategoryInterval:Tx,shouldShowAllLabels:function(e){return"category"===e.type&&0===Tx(e.getLabelModel())}},kx={getMin:function(e){var t=this.option,i=e||null==t.rangeStart?t.min:t.rangeStart;return this.axis&&null!=i&&"dataMin"!==i&&"function"!=typeof i&&!Ve.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getMax:function(e){var t=this.option,i=e||null==t.rangeEnd?t.max:t.rangeEnd;return this.axis&&null!=i&&"dataMax"!==i&&"function"!=typeof i&&!Ve.eqNaN(i)&&(i=this.axis.scale.parse(i)),i},getNeedCrossZero:function(){var e=this.option;return null==e.rangeStart&&null==e.rangeEnd&&!e.scale},getCoordSysModel:Ve.noop,setRange:function(e,t){this.option.rangeStart=e,this.option.rangeEnd=t},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},Ox=kx,Rx=Wa.calculateTextPosition,Ex=tc.extendShape({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var i=t.cx,n=t.cy,a=t.width/2,r=t.height/2;e.moveTo(i,n-r),e.lineTo(i+a,n+r),e.lineTo(i-a,n+r),e.closePath()}}),Nx=tc.extendShape({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var i=t.cx,n=t.cy,a=t.width/2,r=t.height/2;e.moveTo(i,n-r),e.lineTo(i+a,n),e.lineTo(i,n+r),e.lineTo(i-a,n),e.closePath()}}),zx=tc.extendShape({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var i=t.x,n=t.y,a=t.width/5*3,r=Math.max(a,t.height),o=a/2,s=o*o/(r-o),l=n-r+o+s,u=Math.asin(s/o),h=Math.cos(u)*o,c=Math.sin(u),d=Math.cos(u),p=.6*o,f=.7*o;e.moveTo(i-h,l+s),e.arc(i,l,o,Math.PI-u,2*Math.PI+u),e.bezierCurveTo(i+h-c*p,l+s+d*p,i,n-f,i,n),e.bezierCurveTo(i,n-f,i-h+c*p,l+s+d*p,i-h,l+s),e.closePath()}}),Bx=tc.extendShape({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var i=t.height,n=t.width,a=t.x,r=t.y,o=n/3*2;e.moveTo(a,r),e.lineTo(a+o,r+i),e.lineTo(a,r+i/4*3),e.lineTo(a-o,r+i),e.lineTo(a,r),e.closePath()}}),Vx={line:tc.Line,rect:tc.Rect,roundRect:tc.Rect,square:tc.Rect,circle:tc.Circle,diamond:Nx,pin:zx,arrow:Bx,triangle:Ex},Fx={line:function(e,t,i,n,a){a.x1=e,a.y1=t+n/2,a.x2=e+i,a.y2=t+n/2},rect:function(e,t,i,n,a){a.x=e,a.y=t,a.width=i,a.height=n},roundRect:function(e,t,i,n,a){a.x=e,a.y=t,a.width=i,a.height=n,a.r=Math.min(i,n)/4},square:function(e,t,i,n,a){var r=Math.min(i,n);a.x=e,a.y=t,a.width=r,a.height=r},circle:function(e,t,i,n,a){a.cx=e+i/2,a.cy=t+n/2,a.r=Math.min(i,n)/2},diamond:function(e,t,i,n,a){a.cx=e+i/2,a.cy=t+n/2,a.width=i,a.height=n},pin:function(e,t,i,n,a){a.x=e+i/2,a.y=t+n/2,a.width=i,a.height=n},arrow:function(e,t,i,n,a){a.x=e+i/2,a.y=t+n/2,a.width=i,a.height=n},triangle:function(e,t,i,n,a){a.cx=e+i/2,a.cy=t+n/2,a.width=i,a.height=n}},Gx={};Ve.each(Vx,(function(e,t){Gx[t]=new e}));var Hx=tc.extendShape({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,i){var n=Rx(e,t,i),a=this.shape;return a&&"pin"===a.symbolType&&"inside"===t.textPosition&&(n.y=i.y+.4*i.height),n},buildPath:function(e,t,i){var n=t.symbolType;if("none"!==n){var a=Gx[n];a||(a=Gx[n="rect"]),Fx[n](t.x,t.y,t.width,t.height,a.shape),a.buildPath(e,a.shape,i)}}});function Wx(e,t){if("image"!==this.type){var i=this.style,n=this.shape;n&&"line"===n.symbolType?i.stroke=e:this.__isEmptyBrush?(i.stroke=e,i.fill=t||"#fff"):(i.fill&&(i.fill=e),i.stroke&&(i.stroke=e)),this.dirty(!1)}}var Ux=function(e,t,i,n,a,r,o){var s,l=0===e.indexOf("empty");return l&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(s=0===e.indexOf("image://")?tc.makeImage(e.slice(8),new Pn(t,i,n,a),o?"center":"cover"):0===e.indexOf("path://")?tc.makePath(e.slice(7),{},new Pn(t,i,n,a),o?"center":"cover"):new Hx({shape:{symbolType:e,x:t,y:i,width:n,height:a}})).__isEmptyBrush=l,s.setColor=Wx,s.setColor(r),s},jx={createSymbol:Ux},Zx=nd.getLayoutRect,Yx=ry.enableDataStack,Xx=ry.isDimensionStacked,qx=ry.getStackedDimension;var $x=function(e,t){var i=t;mc.isInstance(t)||(i=new mc(t),Ve.mixin(i,Ox));var n=Px.createScaleByModel(i);return n.setExtent(e[0],e[1]),Px.niceScaleExtent(n,i),n},Kx=function(e){Ve.mixin(e,Ox)},Jx={getLayoutRect:Zx,completeDimensions:Xv,createDimensions:qv,createSymbol:jx.createSymbol,createList:function(e){return py(e.getSource(),e)},dataStack:{isDimensionStacked:Xx,enableDataStack:Yx,getStackedDimension:qx},createScale:$x,mixinAxisModelCommonMethods:Kx},Qx=1e-8;function e_(e,t){return Math.abs(e-t)<Qx}var t_=function(e,t,i){var n=0,a=e[0];if(!a)return!1;for(var r=1;r<e.length;r++){var o=e[r];n+=rl(a[0],a[1],o[0],o[1],t,i),a=o}var s=e[0];return e_(a[0],s[0])&&e_(a[1],s[1])||(n+=rl(a[0],a[1],s[0],s[1],t,i)),0!==n},i_={contain:t_};function n_(e,t,i){if(this.name=e,this.geometries=t,i)i=[i[0],i[1]];else{var n=this.getBoundingRect();i=[n.x+n.width/2,n.y+n.height/2]}this.center=i}n_.prototype={constructor:n_,properties:null,getBoundingRect:function(){var e=this._rect;if(e)return e;for(var t=Number.MAX_VALUE,i=[t,t],n=[-t,-t],a=[],r=[],o=this.geometries,s=0;s<o.length;s++)if("polygon"===o[s].type){var l=o[s].exterior;Rs.fromPoints(l,a,r),lt.min(i,i,a),lt.max(n,n,r)}return 0===s&&(i[0]=i[1]=n[0]=n[1]=0),this._rect=new Pn(i[0],i[1],n[0]-i[0],n[1]-i[1])},contain:function(e){var t=this.getBoundingRect(),i=this.geometries;if(!t.contain(e[0],e[1]))return!1;e:for(var n=0,a=i.length;n<a;n++)if("polygon"===i[n].type){var r=i[n].exterior,o=i[n].interiors;if(i_.contain(r,e[0],e[1])){for(var s=0;s<(o?o.length:0);s++)if(i_.contain(o[s]))continue e;return!0}}return!1},transformTo:function(e,t,i,n){var a=this.getBoundingRect(),r=a.width/a.height;i?n||(n=i/r):i=r*n;for(var o=new Pn(e,t,i,n),s=a.calculateTransform(o),l=this.geometries,u=0;u<l.length;u++)if("polygon"===l[u].type){for(var h=l[u].exterior,c=l[u].interiors,d=0;d<h.length;d++)lt.applyTransform(h[d],h[d],s);for(var p=0;p<(c?c.length:0);p++)for(d=0;d<c[p].length;d++)lt.applyTransform(c[p][d],c[p][d],s)}(a=this._rect).copy(o),this.center=[a.x+a.width/2,a.y+a.height/2]},cloneShallow:function(e){null==e&&(e=this.name);var t=new n_(e,this.geometries,this.center);return t._rect=this._rect,t.transformTo=null,t}};var a_=n_;function r_(e,t,i){for(var n=[],a=t[0],r=t[1],o=0;o<e.length;o+=2){var s=e.charCodeAt(o)-64,l=e.charCodeAt(o+1)-64;s=s>>1^-(1&s),l=l>>1^-(1&l),a=s+=a,r=l+=r,n.push([s/i,l/i])}return n}var o_=function(e,t){return function(e){if(!e.UTF8Encoding)return e;var t=e.UTF8Scale;null==t&&(t=1024);for(var i=e.features,n=0;n<i.length;n++)for(var a=i[n].geometry,r=a.coordinates,o=a.encodeOffsets,s=0;s<r.length;s++){var l=r[s];if("Polygon"===a.type)r[s]=r_(l,o[s],t);else if("MultiPolygon"===a.type)for(var u=0;u<l.length;u++){var h=l[u];l[u]=r_(h,o[s][u],t)}}e.UTF8Encoding=!1}(e),Ve.map(Ve.filter(e.features,(function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0})),(function(e){var i=e.properties,n=e.geometry,a=n.coordinates,r=[];"Polygon"===n.type&&r.push({type:"polygon",exterior:a[0],interiors:a.slice(1)}),"MultiPolygon"===n.type&&Ve.each(a,(function(e){e[0]&&r.push({type:"polygon",exterior:e[0],interiors:e.slice(1)})}));var o=new a_(i[t||"name"],r,i.cp);return o.properties=i,o}))},s_=Ro.makeInner,l_=Px.makeLabelFormatter,u_=Px.getOptionCategoryInterval,h_=Px.shouldShowAllLabels,c_=s_();function d_(e,t){var i,n,a=p_(e,"labels"),r=u_(t),o=f_(a,r);return o||(Ve.isFunction(r)?i=v_(e,r):(n="auto"===r?function(e){var t=c_(e).autoInterval;return null!=t?t:c_(e).autoInterval=e.calculateCategoryInterval()}(e):r,i=m_(e,n)),g_(a,r,{labels:i,labelCategoryInterval:n}))}function p_(e,t){return c_(e)[t]||(c_(e)[t]=[])}function f_(e,t){for(var i=0;i<e.length;i++)if(e[i].key===t)return e[i].value}function g_(e,t,i){return e.push({key:t,value:i}),i}function m_(e,t,i){var n=l_(e),a=e.scale,r=a.getExtent(),o=e.getLabelModel(),s=[],l=Math.max((t||0)+1,1),u=r[0],h=a.count();0!==u&&l>1&&h/l>2&&(u=Math.round(Math.ceil(u/l)*l));var c=h_(e),d=o.get("showMinLabel")||c,p=o.get("showMaxLabel")||c;d&&u!==r[0]&&g(r[0]);for(var f=u;f<=r[1];f+=l)g(f);function g(e){s.push(i?e:{formattedLabel:n(e),rawLabel:a.getLabel(e),tickValue:e})}return p&&f-l!==r[1]&&g(r[1]),s}function v_(e,t,i){var n=e.scale,a=l_(e),r=[];return Ve.each(n.getTicks(),(function(e){var o=n.getLabel(e);t(e,o)&&r.push(i?e:{formattedLabel:a(e),rawLabel:o,tickValue:e})})),r}var y_={createAxisLabels:function(e){return"category"===e.type?function(e){var t=e.getLabelModel(),i=d_(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(e):function(e){var t=e.scale.getTicks(),i=l_(e);return{labels:Ve.map(t,(function(t,n){return{formattedLabel:i(t,n),rawLabel:e.scale.getLabel(t),tickValue:t}}))}}(e)},createAxisTicks:function(e,t){return"category"===e.type?function(e,t){var i,n,a=p_(e,"ticks"),r=u_(t),o=f_(a,r);if(o)return o;t.get("show")&&!e.scale.isBlank()||(i=[]);if(Ve.isFunction(r))i=v_(e,r,!0);else if("auto"===r){var s=d_(e,e.getLabelModel());n=s.labelCategoryInterval,i=Ve.map(s.labels,(function(e){return e.tickValue}))}else i=m_(e,n=r,!0);return g_(a,r,{ticks:i,tickCategoryInterval:n})}(e,t):{ticks:e.scale.getTicks()}},calculateCategoryInterval:function(e){var t=function(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get("rotate")||0,font:t.getFont()}}(e),i=l_(e),n=(t.axisRotate-t.labelRotate)/180*Math.PI,a=e.scale,r=a.getExtent(),o=a.count();if(r[1]-r[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=r[0],u=e.dataToCoord(l+1)-e.dataToCoord(l),h=Math.abs(u*Math.cos(n)),c=Math.abs(u*Math.sin(n)),d=0,p=0;l<=r[1];l+=s){var f,g,m=Wa.getBoundingRect(i(l),t.font,"center","top");f=1.3*m.width,g=1.3*m.height,d=Math.max(d,f,7),p=Math.max(p,g,7)}var v=d/h,y=p/c;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var x=Math.max(0,Math.floor(Math.min(v,y))),_=c_(e.model),b=e.getExtent(),w=_.lastAutoInterval,S=_.lastTickCount;return null!=w&&null!=S&&Math.abs(w-x)<=1&&Math.abs(S-o)<=1&&w>x&&_.axisExtend0===b[0]&&_.axisExtend1===b[1]?x=w:(_.lastTickCount=o,_.lastAutoInterval=x,_.axisExtend0=b[0],_.axisExtend1=b[1]),x}},x_=Ve.each,__=Ve.map,b_=Pc.linearMap,w_=Pc.getPixelPrecision,S_=Pc.round,M_=y_.createAxisTicks,I_=y_.createAxisLabels,T_=y_.calculateCategoryInterval,A_=[0,1],C_=function(e,t,i){this.dim=e,this.scale=t,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1};function D_(e,t){var i=(e[1]-e[0])/t/2;e[0]+=i,e[1]-=i}C_.prototype={constructor:C_,contain:function(e){var t=this._extent,i=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return e>=i&&e<=n},containData:function(e){return this.scale.contain(e)},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(e){return w_(e||this.scale.getExtent(),this._extent)},setExtent:function(e,t){var i=this._extent;i[0]=e,i[1]=t},dataToCoord:function(e,t){var i=this._extent,n=this.scale;return e=n.normalize(e),this.onBand&&"ordinal"===n.type&&D_(i=i.slice(),n.count()),b_(e,A_,i,t)},coordToData:function(e,t){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&D_(i=i.slice(),n.count());var a=b_(e,i,A_,t);return this.scale.scale(a)},pointToData:function(e,t){},getTicksCoords:function(e){var t=(e=e||{}).tickModel||this.getTickModel(),i=M_(this,t).ticks,n=__(i,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this);return function(e,t,i,n){var a=t.length;if(!e.onBand||i||!a)return;var r,o,s=e.getExtent();if(1===a)t[0].coord=s[0],r=t[1]={coord:s[0]};else{var l=t[a-1].tickValue-t[0].tickValue,u=(t[a-1].coord-t[0].coord)/l;x_(t,(function(e){e.coord-=u/2})),o=1+e.scale.getExtent()[1]-t[a-1].tickValue,r={coord:t[a-1].coord+u*o},t.push(r)}var h=s[0]>s[1];c(t[0].coord,s[0])&&(n?t[0].coord=s[0]:t.shift());n&&c(s[0],t[0].coord)&&t.unshift({coord:s[0]});c(s[1],r.coord)&&(n?r.coord=s[1]:t.pop());n&&c(r.coord,s[1])&&t.push({coord:s[1]});function c(e,t){return e=S_(e),t=S_(t),h?e>t:e<t}}(this,n,t.get("alignWithLabel"),e.clamp),n},getMinorTicksCoords:function(){if("ordinal"===this.scale.type)return[];var e=this.model.getModel("minorTick").get("splitNumber");e>0&&e<100||(e=5);var t=this.scale.getMinorTicks(e);return __(t,(function(e){return __(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},getViewLabels:function(){return I_(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var e=this._extent,t=this.scale.getExtent(),i=t[1]-t[0]+(this.onBand?1:0);0===i&&(i=1);var n=Math.abs(e[1]-e[0]);return Math.abs(n)/i},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return T_(this)}};var L_=C_,P_=xo,k_=ni,O_=lt,R_=Ui,E_=Pc,N_=Uc,z_=Cg.throttle,B_=Jx,V_=o_,F_=Rv,G_=mc,H_=L_,W_=ie,U_=o_,j_={};Ve.each(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],(function(e){j_[e]=Ve[e]}));var Z_={};Ve.each(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","registerShape","getShapeClass","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],(function(e){Z_[e]=tc[e]}));var Y_={zrender:P_,matrix:k_,vector:O_,color:R_,number:E_,format:N_,throttle:z_,helper:B_,parseGeoJSON:V_,List:F_,Model:G_,Axis:H_,env:W_,parseGeoJson:U_,util:j_,graphic:Z_},X_=J((function(e,t){var i=Cg.throttle,n=Ve.assert,a=Ve.each,r=Ve.isFunction,o=Ve.isObject,s=ud.parseClassType,l={PROCESSOR:{FILTER:1e3,SERIES_FILTER:800,STATISTIC:5e3},VISUAL:{LAYOUT:1e3,PROGRESSIVE_LAYOUT:1100,GLOBAL:2e3,CHART:3e3,POST_CHART_LAYOUT:3500,COMPONENT:4e3,BRUSH:5e3}},u="__flagInMainProcess",h="__optionUpdated",c=/^[a-zA-Z0-9_]+$/;function d(e,t){return function(i,n,a){t||!this._disposed?(i=i&&i.toLowerCase(),gt.prototype[e].call(this,i,n,a)):this.id}}function p(){gt.call(this)}function f(e,t,n){n=n||{},"string"==typeof t&&(t=B[t]),this.id,this.group,this._dom=e;var a=this._zr=xo.init(e,{renderer:n.renderer||"canvas",devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height});this._throttledZrFlush=i(Ve.bind(a.flush,a),17),(t=Ve.clone(t))&&ef(t,!0),this._theme=t,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new Tp;var r,o,s=this._api=(o=(r=this)._coordSysMgr,Ve.extend(new Sp(r),{getCoordinateSystems:Ve.bind(o.getCoordinateSystems,o),getComponentByElement:function(e){for(;e;){var t=e.__ecComponentInfo;if(null!=t)return r._model.getComponent(t.mainType,t.index);e=e.parent}}}));function l(e,t){return e.__prio-t.__prio}Gn(z,l),Gn(R,l),this._scheduler=new hm(this,s,R,z),gt.call(this,this._ecEventProcessor=new P),this._messageCenter=new p,this._initEvents(),this.resize=Ve.bind(this.resize,this),this._pendingActions=[],a.animation.on("frame",this._onframe,this),function(e,t){e.on("rendered",(function(){t.trigger("rendered"),!e.animation.isFinished()||t[h]||t._scheduler.unfinished||t._pendingActions.length||t.trigger("finished")}))}(a,this),Ve.setAsPrimitive(this)}p.prototype.on=d("on",!0),p.prototype.off=d("off",!0),p.prototype.one=d("one",!0),Ve.mixin(p,gt);var g=f.prototype;function m(e,t,i){if(this._disposed)this.id;else{var n,a=this._model,r=this._coordSysMgr.getCoordinateSystems();t=Ro.parseFinder(a,t);for(var o=0;o<r.length;o++){var s=r[o];if(s[e]&&null!=(n=s[e](a,t,i)))return n}}}g._onframe=function(){if(!this._disposed){var e=this._scheduler;if(this[h]){var t=this[h].silent;this[u]=!0,y(this),v.update.call(this),this[u]=!1,this[h]=!1,w.call(this,t),S.call(this,t)}else if(e.unfinished){var i=1,n=this._model,a=this._api;e.unfinished=!1;do{var r=+new Date;e.performSeriesTasks(n),e.performDataProcessorTasks(n),_(this,n),e.performVisualTasks(n),A(this,this._model,a,"remain"),i-=+new Date-r}while(i>0&&e.unfinished);e.unfinished||this._zr.flush()}}},g.getDom=function(){return this._dom},g.getZr=function(){return this._zr},g.setOption=function(e,t,i){if(this._disposed)this.id;else{var n;if(o(t)&&(i=t.lazyUpdate,n=t.silent,t=t.notMerge),this[u]=!0,!this._model||t){var a=new Ep(this._api),r=this._theme,s=this._model=new bp;s.scheduler=this._scheduler,s.init(null,null,r,a)}this._model.setOption(e,E),i?(this[h]={silent:n},this[u]=!1):(y(this),v.update.call(this),this._zr.flush(),this[h]=!1,this[u]=!1,w.call(this,n),S.call(this,n))}},g.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},g.getModel=function(){return this._model},g.getOption=function(){return this._model&&this._model.getOption()},g.getWidth=function(){return this._zr.getWidth()},g.getHeight=function(){return this._zr.getHeight()},g.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},g.getRenderedCanvas=function(e){if(ie.canvasSupported)return(e=e||{}).pixelRatio=e.pixelRatio||1,e.backgroundColor=e.backgroundColor||this._model.get("backgroundColor"),this._zr.painter.getRenderedCanvas(e)},g.getSvgDataURL=function(){if(ie.svgSupported){var e=this._zr,t=e.storage.getDisplayList();return Ve.each(t,(function(e){e.stopAnimation(!0)})),e.painter.toDataURL()}},g.getDataURL=function(e){if(!this._disposed){var t=(e=e||{}).excludeComponents,i=this._model,n=[],r=this;a(t,(function(e){i.eachComponent({mainType:e},(function(e){var t=r._componentsMap[e.__viewId];t.group.ignore||(n.push(t),t.group.ignore=!0)}))}));var o="svg"===this._zr.painter.getType()?this.getSvgDataURL():this.getRenderedCanvas(e).toDataURL("image/"+(e&&e.type||"png"));return a(n,(function(e){e.group.ignore=!1})),o}this.id},g.getConnectedDataURL=function(e){if(this._disposed)this.id;else if(ie.canvasSupported){var t="svg"===e.type,i=this.group,n=Math.min,r=Math.max,o=1/0;if(G[i]){var s=o,l=o,u=-1/0,h=-1/0,c=[],d=e&&e.pixelRatio||1;Ve.each(F,(function(a,o){if(a.group===i){var d=t?a.getZr().painter.getSvgDom().innerHTML:a.getRenderedCanvas(Ve.clone(e)),p=a.getDom().getBoundingClientRect();s=n(p.left,s),l=n(p.top,l),u=r(p.right,u),h=r(p.bottom,h),c.push({dom:d,left:p.left,top:p.top})}}));var p=(u*=d)-(s*=d),f=(h*=d)-(l*=d),g=Ve.createCanvas(),m=xo.init(g,{renderer:t?"svg":"canvas"});if(m.resize({width:p,height:f}),t){var v="";return a(c,(function(e){var t=e.left-s,i=e.top-l;v+='<g transform="translate('+t+","+i+')">'+e.dom+"</g>"})),m.painter.getSvgRoot().innerHTML=v,e.connectedBackgroundColor&&m.painter.setBackgroundColor(e.connectedBackgroundColor),m.refreshImmediately(),m.painter.toDataURL()}return e.connectedBackgroundColor&&m.add(new tc.Rect({shape:{x:0,y:0,width:p,height:f},style:{fill:e.connectedBackgroundColor}})),a(c,(function(e){var t=new tc.Image({style:{x:e.left*d-s,y:e.top*d-l,image:e.dom}});m.add(t)})),m.refreshImmediately(),g.toDataURL("image/"+(e&&e.type||"png"))}return this.getDataURL(e)}},g.convertToPixel=Ve.curry(m,"convertToPixel"),g.convertFromPixel=Ve.curry(m,"convertFromPixel"),g.containPixel=function(e,t){if(!this._disposed){var i,n=this._model;return e=Ro.parseFinder(n,e),Ve.each(e,(function(e,n){n.indexOf("Models")>=0&&Ve.each(e,(function(e){var a=e.coordinateSystem;if(a&&a.containPoint)i|=!!a.containPoint(t);else if("seriesModels"===n){var r=this._chartsMap[e.__viewId];r&&r.containPoint&&(i|=r.containPoint(t,e))}}),this)}),this),!!i}this.id},g.getVisual=function(e,t){var i=this._model,n=(e=Ro.parseFinder(i,e,{defaultMainType:"series"})).seriesModel.getData(),a=e.hasOwnProperty("dataIndexInside")?e.dataIndexInside:e.hasOwnProperty("dataIndex")?n.indexOfRawIndex(e.dataIndex):null;return null!=a?n.getItemVisual(a,t):n.getVisual(t)},g.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},g.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]};var v={prepareAndUpdate:function(e){y(this),v.update.call(this,e)},update:function(e){var t=this._model,i=this._api,n=this._zr,a=this._coordSysMgr,r=this._scheduler;if(t){r.restoreData(t,e),r.performSeriesTasks(t),a.create(t,i),r.performDataProcessorTasks(t,e),_(this,t),a.update(t,i),I(t),r.performVisualTasks(t,e),T(this,t,i,e);var o=t.get("backgroundColor")||"transparent";if(ie.canvasSupported)n.setBackgroundColor(o);else{var s=Ui.parse(o);o=Ui.stringify(s,"rgb"),0===s[3]&&(o="transparent")}C(t,i)}},updateTransform:function(e){var t=this._model,i=this,n=this._api;if(t){var a=[];t.eachComponent((function(r,o){var s=i.getViewOfComponentModel(o);if(s&&s.__alive)if(s.updateTransform){var l=s.updateTransform(o,t,n,e);l&&l.update&&a.push(s)}else a.push(s)}));var r=Ve.createHashMap();t.eachSeries((function(a){var o=i._chartsMap[a.__viewId];if(o.updateTransform){var s=o.updateTransform(a,t,n,e);s&&s.update&&r.set(a.uid,1)}else r.set(a.uid,1)})),I(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0,dirtyMap:r}),A(i,t,n,e,r),C(t,this._api)}},updateView:function(e){var t=this._model;t&&(Sg.markUpdateMethod(e,"updateView"),I(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0}),T(this,this._model,this._api,e),C(t,this._api))},updateVisual:function(e){v.update.call(this,e)},updateLayout:function(e){v.update.call(this,e)}};function y(e){var t=e._model,i=e._scheduler;i.restorePipelines(t),i.prepareStageTasks(),M(e,"component",t,i),M(e,"chart",t,i),i.plan()}function x(e,t,i,n,r){var o=e._model;if(n){var s={};s[n+"Id"]=i[n+"Id"],s[n+"Index"]=i[n+"Index"],s[n+"Name"]=i[n+"Name"];var l={mainType:n,query:s};r&&(l.subType=r);var u=i.excludeSeriesId;null!=u&&(u=Ve.createHashMap(Ro.normalizeToArray(u))),o&&o.eachComponent(l,(function(t){u&&null!=u.get(t.id)||h(e["series"===n?"_chartsMap":"_componentsMap"][t.__viewId])}),e)}else a(e._componentsViews.concat(e._chartsViews),h);function h(n){n&&n.__alive&&n[t]&&n[t](n.__model,o,e._api,i)}}function _(e,t){var i=e._chartsMap,n=e._scheduler;t.eachSeries((function(e){n.updateStreamModes(e,i[e.__viewId])}))}function b(e,t){var i=e.type,n=e.escapeConnect,r=k[i],o=r.actionInfo,l=(o.update||"update").split(":"),c=l.pop();l=null!=l[0]&&s(l[0]),this[u]=!0;var d=[e],p=!1;e.batch&&(p=!0,d=Ve.map(e.batch,(function(t){return(t=Ve.defaults(Ve.extend({},t),e)).batch=null,t})));var f,g=[],m="highlight"===i||"downplay"===i;a(d,(function(e){(f=(f=r.action(e,this._model,this._api))||Ve.extend({},e)).type=o.event||f.type,g.push(f),m?x(this,c,e,"series"):l&&x(this,c,e,l.main,l.sub)}),this),"none"===c||m||l||(this[h]?(y(this),v.update.call(this,e),this[h]=!1):v[c].call(this,e)),f=p?{type:o.event||i,escapeConnect:n,batch:g}:g[0],this[u]=!1,!t&&this._messageCenter.trigger(f.type,f)}function w(e){for(var t=this._pendingActions;t.length;){var i=t.shift();b.call(this,i,e)}}function S(e){!e&&this.trigger("updated")}function M(e,t,i,n){for(var a="component"===t,r=a?e._componentsViews:e._chartsViews,o=a?e._componentsMap:e._chartsMap,l=e._zr,u=e._api,h=0;h<r.length;h++)r[h].__alive=!1;function c(e){var t="_ec_"+e.id+"_"+e.type,h=o[t];if(!h){var c=s(e.type);(h=new(a?ug.getClass(c.main,c.sub):Sg.getClass(c.sub))).init(i,u),o[t]=h,r.push(h),l.add(h.group)}e.__viewId=h.__id=t,h.__alive=!0,h.__model=e,h.group.__ecComponentInfo={mainType:e.mainType,index:e.componentIndex},!a&&n.prepareView(h,e,i,u)}a?i.eachComponent((function(e,t){"series"!==e&&c(t)})):i.eachSeries(c);for(h=0;h<r.length;){var d=r[h];d.__alive?h++:(!a&&d.renderTask.dispose(),l.remove(d.group),d.dispose(i,u),r.splice(h,1),delete o[d.__id],d.__id=d.group.__ecComponentInfo=null)}}function I(e){e.clearColorPalette(),e.eachSeries((function(e){e.clearColorPalette()}))}function T(e,t,i,n){!function(e,t,i,n,r){a(r||e._componentsViews,(function(e){var a=e.__model;e.render(a,t,i,n),L(a,e)}))}(e,t,i,n),a(e._chartsViews,(function(e){e.__alive=!1})),A(e,t,i,n),a(e._chartsViews,(function(e){e.__alive||e.remove(t,i)}))}function A(e,t,i,n,a){var r,o=e._scheduler;t.eachSeries((function(t){var i=e._chartsMap[t.__viewId];i.__alive=!0;var s=i.renderTask;o.updatePayload(s,n),a&&a.get(t.uid)&&s.dirty(),r|=s.perform(o.getPerformArgs(s)),i.group.silent=!!t.get("silent"),L(t,i),function(e,t){var i=e.get("blendMode")||null;t.group.traverse((function(e){e.isGroup||e.style.blend!==i&&e.setStyle("blend",i),e.eachPendingDisplayable&&e.eachPendingDisplayable((function(e){e.setStyle("blend",i)}))}))}(t,i)})),o.unfinished|=r,function(e,t){var i=e._zr,n=i.storage,a=0;n.traverse((function(e){a++})),a>t.get("hoverLayerThreshold")&&!ie.node&&t.eachSeries((function(t){if(!t.preventUsingHoverLayer){var i=e._chartsMap[t.__viewId];i.__alive&&i.group.traverse((function(e){e.useHoverLayer=!0}))}}))}(e,t),Rg(e._zr.dom,t)}function C(e,t){a(N,(function(i){i(e,t)}))}g.resize=function(e){if(this._disposed)this.id;else{this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var i=t.resetOption("media"),n=e&&e.silent;this[u]=!0,i&&y(this),v.update.call(this),this[u]=!1,w.call(this,n),S.call(this,n)}}},g.showLoading=function(e,t){if(this._disposed)this.id;else if(o(e)&&(t=e,e=""),e=e||"default",this.hideLoading(),V[e]){var i=V[e](this._api,t),n=this._zr;this._loadingFX=i,n.add(i)}},g.hideLoading=function(){this._disposed?this.id:(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},g.makeActionFromEvent=function(e){var t=Ve.extend({},e);return t.type=O[e.type],t},g.dispatchAction=function(e,t){this._disposed?this.id:(o(t)||(t={silent:!!t}),k[e.type]&&this._model&&(this[u]?this._pendingActions.push(e):(b.call(this,e,t.silent),t.flush?this._zr.flush(!0):!1!==t.flush&&ie.browser.weChat&&this._throttledZrFlush(),w.call(this,t.silent),S.call(this,t.silent))))},g.appendData=function(e){if(this._disposed)this.id;else{var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0}},g.on=d("on",!1),g.off=d("off",!1),g.one=d("one",!1);var D=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function L(e,t){var i=e.get("z"),n=e.get("zlevel");t.group.traverse((function(e){"group"!==e.type&&(null!=i&&(e.z=i),null!=n&&(e.zlevel=n))}))}function P(){this.eventInfo}g._initEvents=function(){a(D,(function(e){var t=function(t){var i,n=this.getModel(),a=t.target;if("globalout"===e)i={};else if(a&&null!=a.dataIndex){var r=a.dataModel||n.getSeriesByIndex(a.seriesIndex);i=r&&r.getDataParams(a.dataIndex,a.dataType,a)||{}}else a&&a.eventData&&(i=Ve.extend({},a.eventData));if(i){var o=i.componentType,s=i.componentIndex;"markLine"!==o&&"markPoint"!==o&&"markArea"!==o||(o="series",s=i.seriesIndex);var l=o&&null!=s&&n.getComponent(o,s),u=l&&this["series"===l.mainType?"_chartsMap":"_componentsMap"][l.__viewId];i.event=t,i.type=e,this._ecEventProcessor.eventInfo={targetEl:a,packedEvent:i,model:l,view:u},this.trigger(e,i)}};t.zrEventfulCallAtLast=!0,this._zr.on(e,t,this)}),this),a(O,(function(e,t){this._messageCenter.on(t,(function(e){this.trigger(t,e)}),this)}),this)},g.isDisposed=function(){return this._disposed},g.clear=function(){this._disposed?this.id:this.setOption({series:[]},!0)},g.dispose=function(){if(this._disposed)this.id;else{this._disposed=!0,Ro.setAttribute(this.getDom(),U,"");var e=this._api,t=this._model;a(this._componentsViews,(function(i){i.dispose(t,e)})),a(this._chartsViews,(function(i){i.dispose(t,e)})),this._zr.dispose(),delete F[this.id]}},Ve.mixin(f,gt),P.prototype={constructor:P,normalizeQuery:function(e){var t={},i={},n={};if(Ve.isString(e)){var a=s(e);t.mainType=a.main||null,t.subType=a.sub||null}else{var r=["Index","Name","Id"],o={name:1,dataIndex:1,dataType:1};Ve.each(e,(function(e,a){for(var s=!1,l=0;l<r.length;l++){var u=r[l],h=a.lastIndexOf(u);if(h>0&&h===a.length-u.length){var c=a.slice(0,h);"data"!==c&&(t.mainType=c,t[u.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(a)&&(i[a]=e,s=!0),s||(n[a]=e)}))}return{cptQuery:t,dataQuery:i,otherQuery:n}},filter:function(e,t,i){var n=this.eventInfo;if(!n)return!0;var a=n.targetEl,r=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return h(l,o,"mainType")&&h(l,o,"subType")&&h(l,o,"index","componentIndex")&&h(l,o,"name")&&h(l,o,"id")&&h(u,r,"name")&&h(u,r,"dataIndex")&&h(u,r,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,a,r));function h(e,t,i,n){return null==e[i]||t[n||i]===e[i]}},afterTrigger:function(){this.eventInfo=null}};var k={},O={},R=[],E=[],N=[],z=[],B={},V={},F={},G={},H=new Date-0,W=new Date-0,U="_echarts_instance_";function j(e){G[e]=!1}var Z=j;function Y(e){return F[Ro.getAttribute(e,U)]}function X(e,t){B[e]=t}function q(e){E.push(e)}function $(e,t){Q(R,e,t,1e3)}function K(e,t,i){"function"==typeof t&&(i=t,t="");var a=o(e)?e.type:[e,e={event:t}][0];e.event=(e.event||a).toLowerCase(),t=e.event,n(c.test(a)&&c.test(t)),k[a]||(k[a]={action:i,actionInfo:e}),O[t]=a}function J(e,t){Q(z,e,t,3e3,"visual")}function Q(e,t,i,n,a){(r(t)||o(t))&&(i=t,t=n);var s=hm.wrapStageHandler(i,a);return s.__prio=t,s.__raw=i,e.push(s),s}function ee(e,t){V[e]=t}J(2e3,Pg),q(ef),$(900,rf),ee("default",Ng),K({type:"highlight",event:"highlight",update:"highlight"},Ve.noop),K({type:"downplay",event:"downplay",update:"downplay"},Ve.noop),X("light",dm),X("dark",vm);t.version="4.8.0",t.dependencies={zrender:"4.3.1"},t.PRIORITY=l,t.init=function(e,t,i){var n=Y(e);if(n)return n;var r=new f(e,t,i);return r.id="ec_"+H++,F[r.id]=r,Ro.setAttribute(e,U,r.id),function(e){var t="__connectUpdateStatus";function i(e,i){for(var n=0;n<e.length;n++)e[n][t]=i}a(O,(function(n,r){e._messageCenter.on(r,(function(n){if(G[e.group]&&0!==e[t]){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),o=[];a(F,(function(t){t!==e&&t.group===e.group&&o.push(t)})),i(o,0),a(o,(function(e){1!==e[t]&&e.dispatchAction(r)})),i(o,2)}}))}))}(r),r},t.connect=function(e){if(Ve.isArray(e)){var t=e;e=null,a(t,(function(t){null!=t.group&&(e=t.group)})),e=e||"g_"+W++,a(t,(function(t){t.group=e}))}return G[e]=!0,e},t.disConnect=j,t.disconnect=Z,t.dispose=function(e){"string"==typeof e?e=F[e]:e instanceof f||(e=Y(e)),e instanceof f&&!e.isDisposed()&&e.dispose()},t.getInstanceByDom=Y,t.getInstanceById=function(e){return F[e]},t.registerTheme=X,t.registerPreprocessor=q,t.registerProcessor=$,t.registerPostUpdate=function(e){N.push(e)},t.registerAction=K,t.registerCoordinateSystem=function(e,t){Tp.register(e,t)},t.getCoordinateSystemDimensions=function(e){var t=Tp.get(e);if(t)return t.getDimensionsInfo?t.getDimensionsInfo():t.dimensions.slice()},t.registerLayout=function(e,t){Q(z,e,t,1e3,"layout")},t.registerVisual=J,t.registerLoading=ee,t.extendComponentModel=function(e){return ud.extend(e)},t.extendComponentView=function(e){return ug.extend(e)},t.extendSeriesModel=function(e){return og.extend(e)},t.extendChartView=function(e){return Sg.extend(e)},t.setCanvasCreator=function(e){Ve.$override("createCanvas",e)},t.registerMap=function(e,t,i){Km.registerMap(e,t,i)},t.getMap=function(e){var t=Km.retrieveMap(e);return t&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}},t.dataTool={},function(){for(var e in Y_)Y_.hasOwnProperty(e)&&(t[e]=Y_[e])}()}));og.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(e,t){return py(this.getSource(),this,{useEncodeDefaulter:!0})},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clip:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0}});var q_=Af.retrieveRawValue;var $_=function(e,t){var i=e.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return q_(e,t,i[0]);if(n){for(var a=[],r=0;r<i.length;r++){var o=q_(e,t,i[r]);a.push(o)}return a.join(" ")}},K_={getDefaultLabel:$_},J_=jx.createSymbol,Q_=Pc.parsePercent,eb=K_.getDefaultLabel;function tb(e,t,i){tc.Group.call(this),this.updateData(e,t,i)}var ib=tb.prototype,nb=tb.getSymbolSize=function(e,t){var i=e.getItemVisual(t,"symbolSize");return i instanceof Array?i.slice():[+i,+i]};function ab(e){return[e[0]/2,e[1]/2]}function rb(e,t){this.parent.drift(e,t)}ib._createSymbol=function(e,t,i,n,a){this.removeAll();var r=t.getItemVisual(i,"color"),o=J_(e,-1,-1,2,2,r,a);o.attr({z2:100,culling:!0,scale:ab(n)}),o.drift=rb,this._symbolType=e,this.add(o)},ib.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(e)},ib.getSymbolPath=function(){return this.childAt(0)},ib.getScale=function(){return this.childAt(0).scale},ib.highlight=function(){this.childAt(0).trigger("emphasis")},ib.downplay=function(){this.childAt(0).trigger("normal")},ib.setZ=function(e,t){var i=this.childAt(0);i.zlevel=e,i.z=t},ib.setDraggable=function(e){var t=this.childAt(0);t.draggable=e,t.cursor=e?"move":t.cursor},ib.updateData=function(e,t,i){this.silent=!1;var n=e.getItemVisual(t,"symbol")||"circle",a=e.hostModel,r=nb(e,t),o=n!==this._symbolType;if(o){var s=e.getItemVisual(t,"symbolKeepAspect");this._createSymbol(n,e,t,r,s)}else{(l=this.childAt(0)).silent=!1,tc.updateProps(l,{scale:ab(r)},a,t)}if(this._updateCommon(e,t,r,i),o){var l=this.childAt(0),u=i&&i.fadeIn,h={scale:l.scale.slice()};u&&(h.style={opacity:l.style.opacity}),l.scale=[0,0],u&&(l.style.opacity=0),tc.initProps(l,h,a,t)}this._seriesModel=a};var ob=["itemStyle"],sb=["emphasis","itemStyle"],lb=["label"],ub=["emphasis","label"];function hb(e,t){if(!this.incremental&&!this.useHoverLayer)if("emphasis"===t){var i=this.__symbolOriginalScale,n=i[1]/i[0],a={scale:[Math.max(1.1*i[0],i[0]+3),Math.max(1.1*i[1],i[1]+3*n)]};this.animateTo(a,400,"elasticOut")}else"normal"===t&&this.animateTo({scale:this.__symbolOriginalScale},400,"elasticOut")}ib._updateCommon=function(e,t,i,n){var a=this.childAt(0),r=e.hostModel,o=e.getItemVisual(t,"color");"image"!==a.type?a.useStyle({strokeNoScale:!0}):a.setStyle({opacity:null,shadowBlur:null,shadowOffsetX:null,shadowOffsetY:null,shadowColor:null});var s=n&&n.itemStyle,l=n&&n.hoverItemStyle,u=n&&n.symbolOffset,h=n&&n.labelModel,c=n&&n.hoverLabelModel,d=n&&n.hoverAnimation,p=n&&n.cursorStyle;if(!n||e.hasItemOption){var f=n&&n.itemModel?n.itemModel:e.getItemModel(t);s=f.getModel(ob).getItemStyle(["color"]),l=f.getModel(sb).getItemStyle(),u=f.getShallow("symbolOffset"),h=f.getModel(lb),c=f.getModel(ub),d=f.getShallow("hoverAnimation"),p=f.getShallow("cursor")}else l=Ve.extend({},l);var g=a.style,m=e.getItemVisual(t,"symbolRotate");a.attr("rotation",(m||0)*Math.PI/180||0),u&&a.attr("position",[Q_(u[0],i[0]),Q_(u[1],i[1])]),p&&a.attr("cursor",p),a.setColor(o,n&&n.symbolInnerColor),a.setStyle(s);var v=e.getItemVisual(t,"opacity");null!=v&&(g.opacity=v);var y=e.getItemVisual(t,"liftZ"),x=a.__z2Origin;null!=y?null==x&&(a.__z2Origin=a.z2,a.z2+=y):null!=x&&(a.z2=x,a.__z2Origin=null);var _=n&&n.useNameLabel;tc.setLabelStyle(g,l,h,c,{labelFetcher:r,labelDataIndex:t,defaultText:function(t,i){return _?e.getName(t):eb(e,t)},isRectText:!0,autoColor:o}),a.__symbolOriginalScale=ab(i),a.hoverStyle=l,a.highDownOnUpdate=d&&r.isAnimationEnabled()?hb:null,tc.setHoverStyle(a)},ib.fadeOut=function(e,t){var i=this.childAt(0);this.silent=i.silent=!0,(!t||!t.keepLabel)&&(i.style.text=null),tc.updateProps(i,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,e)},Ve.inherits(tb,tc.Group);var cb=tb,db=Ve.isObject;function pb(e){this.group=new tc.Group,this._symbolCtor=e||cb}var fb=pb.prototype;function gb(e,t,i,n){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(n.isIgnore&&n.isIgnore(i))&&!(n.clipShape&&!n.clipShape.contain(t[0],t[1]))&&"none"!==e.getItemVisual(i,"symbol")}function mb(e){return null==e||db(e)||(e={isIgnore:e}),e||{}}function vb(e){var t=e.hostModel;return{itemStyle:t.getModel("itemStyle").getItemStyle(["color"]),hoverItemStyle:t.getModel("emphasis.itemStyle").getItemStyle(),symbolRotate:t.get("symbolRotate"),symbolOffset:t.get("symbolOffset"),hoverAnimation:t.get("hoverAnimation"),labelModel:t.getModel("label"),hoverLabelModel:t.getModel("emphasis.label"),cursorStyle:t.get("cursor")}}fb.updateData=function(e,t){t=mb(t);var i=this.group,n=e.hostModel,a=this._data,r=this._symbolCtor,o=vb(e);a||i.removeAll(),e.diff(a).add((function(n){var a=e.getItemLayout(n);if(gb(e,a,n,t)){var s=new r(e,n,o);s.attr("position",a),e.setItemGraphicEl(n,s),i.add(s)}})).update((function(s,l){var u=a.getItemGraphicEl(l),h=e.getItemLayout(s);gb(e,h,s,t)?(u?(u.updateData(e,s,o),tc.updateProps(u,{position:h},n)):(u=new r(e,s)).attr("position",h),i.add(u),e.setItemGraphicEl(s,u)):i.remove(u)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&t.fadeOut((function(){i.remove(t)}))})).execute(),this._data=e},fb.isPersistent=function(){return!0},fb.updateLayout=function(){var e=this._data;e&&e.eachItemGraphicEl((function(t,i){var n=e.getItemLayout(i);t.attr("position",n)}))},fb.incrementalPrepareUpdate=function(e){this._seriesScope=vb(e),this._data=null,this.group.removeAll()},fb.incrementalUpdate=function(e,t,i){function n(e){e.isGroup||(e.incremental=e.useHoverLayer=!0)}i=mb(i);for(var a=e.start;a<e.end;a++){var r=t.getItemLayout(a);if(gb(t,r,a,i)){var o=new this._symbolCtor(t,a,this._seriesScope);o.traverse(n),o.attr("position",r),this.group.add(o),t.setItemGraphicEl(a,o)}}},fb.remove=function(e){var t=this.group,i=this._data;i&&e?i.eachItemGraphicEl((function(e){e.fadeOut((function(){t.remove(e)}))})):t.removeAll()};var yb=pb,xb=ry.isDimensionStacked,_b=Ve.map;var bb={prepareDataCoordInfo:function(e,t,i){var n,a=e.getBaseAxis(),r=e.getOtherAxis(a),o=function(e,t){var i=0,n=e.scale.getExtent();"start"===t?i=n[0]:"end"===t?i=n[1]:n[0]>0?i=n[0]:n[1]<0&&(i=n[1]);return i}(r,i),s=a.dim,l=r.dim,u=t.mapDimension(l),h=t.mapDimension(s),c="x"===l||"radius"===l?1:0,d=_b(e.dimensions,(function(e){return t.mapDimension(e)})),p=t.getCalculationInfo("stackResultDimension");return(n|=xb(t,d[0]))&&(d[0]=p),(n|=xb(t,d[1]))&&(d[1]=p),{dataDimsForPoint:d,valueStart:o,valueAxisDim:l,baseAxisDim:s,stacked:!!n,valueDim:u,baseDim:h,baseDataOffset:c,stackedOverDimension:t.getCalculationInfo("stackedOverDimension")}},getStackedOnPoint:function(e,t,i,n){var a=NaN;e.stacked&&(a=i.get(i.getCalculationInfo("stackedOverDimension"),n)),isNaN(a)&&(a=e.valueStart);var r=e.baseDataOffset,o=[];return o[r]=i.get(e.baseDim,n),o[1-r]=a,t.dataToPoint(o)}},wb=bb.prepareDataCoordInfo,Sb=bb.getStackedOnPoint;var Mb=function(e,t,i,n,a,r,o,s){for(var l=function(e,t){var i=[];return t.diff(e).add((function(e){i.push({cmd:"+",idx:e})})).update((function(e,t){i.push({cmd:"=",idx:t,idx1:e})})).remove((function(e){i.push({cmd:"-",idx:e})})).execute(),i}(e,t),u=[],h=[],c=[],d=[],p=[],f=[],g=[],m=wb(a,t,o),v=wb(r,e,s),y=0;y<l.length;y++){var x=l[y],_=!0;switch(x.cmd){case"=":var b=e.getItemLayout(x.idx),w=t.getItemLayout(x.idx1);(isNaN(b[0])||isNaN(b[1]))&&(b=w.slice()),u.push(b),h.push(w),c.push(i[x.idx]),d.push(n[x.idx1]),g.push(t.getRawIndex(x.idx1));break;case"+":var S=x.idx;u.push(a.dataToPoint([t.get(m.dataDimsForPoint[0],S),t.get(m.dataDimsForPoint[1],S)])),h.push(t.getItemLayout(S).slice()),c.push(Sb(m,a,t,S)),d.push(n[S]),g.push(t.getRawIndex(S));break;case"-":S=x.idx;var M=e.getRawIndex(S);M!==S?(u.push(e.getItemLayout(S)),h.push(r.dataToPoint([e.get(v.dataDimsForPoint[0],S),e.get(v.dataDimsForPoint[1],S)])),c.push(i[S]),d.push(Sb(v,r,e,S)),g.push(M)):_=!1}_&&(p.push(x),f.push(f.length))}f.sort((function(e,t){return g[e]-g[t]}));var I=[],T=[],A=[],C=[],D=[];for(y=0;y<f.length;y++){S=f[y];I[y]=u[S],T[y]=h[S],A[y]=c[S],C[y]=d[S],D[y]=p[S]}return{current:I,next:T,stackedOnCurrent:A,stackedOnNext:C,status:D}},Ib=lt.min,Tb=lt.max,Ab=lt.scaleAndAdd,Cb=lt.copy,Db=[],Lb=[],Pb=[];function kb(e){return isNaN(e[0])||isNaN(e[1])}function Ob(e,t,i,n,a,r,o,s,l,u,h){return"none"!==u&&u?Rb.apply(this,arguments):Eb.apply(this,arguments)}function Rb(e,t,i,n,a,r,o,s,l,u,h){for(var c=0,d=i,p=0;p<n;p++){var f=t[d];if(d>=a||d<0)break;if(kb(f)){if(h){d+=r;continue}break}if(d===i)e[r>0?"moveTo":"lineTo"](f[0],f[1]);else if(l>0){var g=t[c],m="y"===u?1:0,v=(f[m]-g[m])*l;Cb(Lb,g),Lb[m]=g[m]+v,Cb(Pb,f),Pb[m]=f[m]-v,e.bezierCurveTo(Lb[0],Lb[1],Pb[0],Pb[1],f[0],f[1])}else e.lineTo(f[0],f[1]);c=d,d+=r}return p}function Eb(e,t,i,n,a,r,o,s,l,u,h){for(var c=0,d=i,p=0;p<n;p++){var f=t[d];if(d>=a||d<0)break;if(kb(f)){if(h){d+=r;continue}break}if(d===i)e[r>0?"moveTo":"lineTo"](f[0],f[1]),Cb(Lb,f);else if(l>0){var g=d+r,m=t[g];if(h)for(;m&&kb(t[g]);)m=t[g+=r];var v=.5,y=t[c];if(!(m=t[g])||kb(m))Cb(Pb,f);else{var x,_;if(kb(m)&&!h&&(m=f),lt.sub(Db,m,y),"x"===u||"y"===u){var b="x"===u?0:1;x=Math.abs(f[b]-y[b]),_=Math.abs(f[b]-m[b])}else x=lt.dist(f,y),_=lt.dist(f,m);Ab(Pb,f,Db,-l*(1-(v=_/(_+x))))}Ib(Lb,Lb,s),Tb(Lb,Lb,o),Ib(Pb,Pb,s),Tb(Pb,Pb,o),e.bezierCurveTo(Lb[0],Lb[1],Pb[0],Pb[1],f[0],f[1]),Ab(Lb,f,Db,l*v)}else e.lineTo(f[0],f[1]);c=d,d+=r}return p}function Nb(e,t){var i=[1/0,1/0],n=[-1/0,-1/0];if(t)for(var a=0;a<e.length;a++){var r=e[a];r[0]<i[0]&&(i[0]=r[0]),r[1]<i[1]&&(i[1]=r[1]),r[0]>n[0]&&(n[0]=r[0]),r[1]>n[1]&&(n[1]=r[1])}return{min:t?i:n,max:t?n:i}}var zb=bl.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:Zl(bl.prototype.brush),buildPath:function(e,t){var i=t.points,n=0,a=i.length,r=Nb(i,t.smoothConstraint);if(t.connectNulls){for(;a>0&&kb(i[a-1]);a--);for(;n<a&&kb(i[n]);n++);}for(;n<a;)n+=Ob(e,i,n,a,a,1,r.min,r.max,t.smooth,t.smoothMonotone,t.connectNulls)+1}}),Bb=bl.extend({type:"ec-polygon",shape:{points:[],stackedOnPoints:[],smooth:0,stackedOnSmooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},brush:Zl(bl.prototype.brush),buildPath:function(e,t){var i=t.points,n=t.stackedOnPoints,a=0,r=i.length,o=t.smoothMonotone,s=Nb(i,t.smoothConstraint),l=Nb(n,t.smoothConstraint);if(t.connectNulls){for(;r>0&&kb(i[r-1]);r--);for(;a<r&&kb(i[a]);a++);}for(;a<r;){var u=Ob(e,i,a,r,r,1,s.min,s.max,t.smooth,o,t.connectNulls);Ob(e,n,a+u-1,u,r,-1,l.min,l.max,t.stackedOnSmooth,o,t.connectNulls),a+=u+1,e.closePath()}}}),Vb={Polyline:zb,Polygon:Bb},Fb=Pc.round;function Gb(e,t,i){var n=e.getArea(),a=e.getBaseAxis().isHorizontal(),r=n.x,o=n.y,s=n.width,l=n.height,u=i.get("lineStyle.width")||2;r-=u/2,o-=u/2,s+=u,l+=u,r=Math.floor(r),s=Math.round(s);var h=new tc.Rect({shape:{x:r,y:o,width:s,height:l}});return t&&(h.shape[a?"width":"height"]=0,tc.initProps(h,{shape:{width:s,height:l}},i)),h}function Hb(e,t,i){var n=e.getArea(),a=new tc.Sector({shape:{cx:Fb(e.cx,1),cy:Fb(e.cy,1),r0:Fb(n.r0,1),r:Fb(n.r,1),startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});return t&&(a.shape.endAngle=n.startAngle,tc.initProps(a,{shape:{endAngle:n.endAngle}},i)),a}var Wb={createGridClipPath:Gb,createPolarClipPath:Hb,createClipPath:function(e,t,i){return e?"polar"===e.type?Hb(e,t,i):"cartesian2d"===e.type?Gb(e,t,i):null:null}},Ub=Rs.fromPoints,jb=Vb.Polyline,Zb=Vb.Polygon,Yb=bb.prepareDataCoordInfo,Xb=bb.getStackedOnPoint,qb=Wb.createGridClipPath,$b=Wb.createPolarClipPath;function Kb(e,t){if(e.length===t.length){for(var i=0;i<e.length;i++){var n=e[i],a=t[i];if(n[0]!==a[0]||n[1]!==a[1])return}return!0}}function Jb(e,t){var i=[],n=[],a=[],r=[];return Ub(e,i,n),Ub(t,a,r),Math.max(Math.abs(i[0]-a[0]),Math.abs(i[1]-a[1]),Math.abs(n[0]-r[0]),Math.abs(n[1]-r[1]))}function Qb(e){return"number"==typeof e?e:e?.5:0}function ew(e,t,i){for(var n=t.getBaseAxis(),a="x"===n.dim||"radius"===n.dim?0:1,r=[],o=0;o<e.length-1;o++){var s=e[o+1],l=e[o];r.push(l);var u=[];switch(i){case"end":u[a]=s[a],u[1-a]=l[1-a],r.push(u);break;case"middle":var h=(l[a]+s[a])/2,c=[];u[a]=c[a]=h,u[1-a]=l[1-a],c[1-a]=s[1-a],r.push(u),r.push(c);break;default:u[a]=l[a],u[1-a]=s[1-a],r.push(u)}}return e[o]&&r.push(e[o]),r}function tw(e,t,i){var n=e.get("showAllSymbol"),a="auto"===n;if(!n||a){var r=i.getAxesByScale("ordinal")[0];if(r&&(!a||!function(e,t){var i=e.getExtent(),n=Math.abs(i[1]-i[0])/e.scale.count();isNaN(n)&&(n=0);for(var a=t.count(),r=Math.max(1,Math.round(a/5)),o=0;o<a;o+=r)if(1.5*cb.getSymbolSize(t,o)[e.isHorizontal()?1:0]>n)return!1;return!0}(r,t))){var o=t.mapDimension(r.dim),s={};return Ve.each(r.getViewLabels(),(function(e){s[e.tickValue]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function iw(e,t,i){if("cartesian2d"===e.type){var n=e.getBaseAxis().isHorizontal(),a=qb(e,t,i);if(!i.get("clip",!0)){var r=a.shape,o=Math.max(r.width,r.height);n?(r.y-=o,r.height+=2*o):(r.x-=o,r.width+=2*o)}return a}return $b(e,t,i)}Sg.extend({type:"line",init:function(){var e=new tc.Group,t=new yb;this.group.add(t.group),this._symbolDraw=t,this._lineGroup=e},render:function(e,t,i){var n=e.coordinateSystem,a=this.group,r=e.getData(),o=e.getModel("lineStyle"),s=e.getModel("areaStyle"),l=r.mapArray(r.getItemLayout),u="polar"===n.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,p=this._polygon,f=this._lineGroup,g=e.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=function(e,t,i){if(!i.valueDim)return[];for(var n=[],a=0,r=t.count();a<r;a++)n.push(Xb(i,e,t,a));return n}(n,r,Yb(n,r,v)),x=e.get("showSymbol"),_=x&&!u&&tw(e,r,n),b=this._data;b&&b.eachItemGraphicEl((function(e,t){e.__temp&&(a.remove(e),b.setItemGraphicEl(t,null))})),x||c.remove(),a.add(f);var w,S=!u&&e.get("step");n&&n.getArea&&e.get("clip",!0)&&(null!=(w=n.getArea()).width?(w.x-=.1,w.y-=.1,w.width+=.2,w.height+=.2):w.r0&&(w.r0-=.5,w.r1+=.5)),this._clipShapeForSymbol=w,d&&h.type===n.type&&S===this._step?(m&&!p?p=this._newPolygon(l,y,n,g):p&&!m&&(f.remove(p),p=this._polygon=null),f.setClipPath(iw(n,!1,e)),x&&c.updateData(r,{isIgnore:_,clipShape:w}),r.eachItemGraphicEl((function(e){e.stopAnimation(!0)})),Kb(this._stackedOnPoints,y)&&Kb(this._points,l)||(g?this._updateAnimation(r,y,n,i,S,v):(S&&(l=ew(l,n,S),y=ew(y,n,S)),d.setShape({points:l}),p&&p.setShape({points:l,stackedOnPoints:y})))):(x&&c.updateData(r,{isIgnore:_,clipShape:w}),S&&(l=ew(l,n,S),y=ew(y,n,S)),d=this._newPolyline(l,n,g),m&&(p=this._newPolygon(l,y,n,g)),f.setClipPath(iw(n,!0,e)));var M=function(e,t){var i=e.getVisual("visualMeta");if(i&&i.length&&e.count()&&"cartesian2d"===t.type){for(var n,a,r=i.length-1;r>=0;r--){var o=i[r].dimension,s=e.dimensions[o],l=e.getDimensionInfo(s);if("x"===(n=l&&l.coordDim)||"y"===n){a=i[r];break}}if(a){var u=t.getAxis(n),h=Ve.map(a.stops,(function(e){return{coord:u.toGlobalCoord(u.dataToCoord(e.value)),color:e.color}})),c=h.length,d=a.outerColors.slice();c&&h[0].coord>h[c-1].coord&&(h.reverse(),d.reverse());var p=h[0].coord-10,f=h[c-1].coord+10,g=f-p;if(g<.001)return"transparent";Ve.each(h,(function(e){e.offset=(e.coord-p)/g})),h.push({offset:c?h[c-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:d[0]||"transparent"});var m=new tc.LinearGradient(0,0,0,0,h,!0);return m[n]=p,m[n+"2"]=f,m}}}(r,n)||r.getVisual("color");d.useStyle(Ve.defaults(o.getLineStyle(),{fill:"none",stroke:M,lineJoin:"bevel"}));var I=e.get("smooth");if(I=Qb(e.get("smooth")),d.setShape({smooth:I,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")}),p){var T=r.getCalculationInfo("stackedOnSeries"),A=0;p.useStyle(Ve.defaults(s.getAreaStyle(),{fill:M,opacity:.7,lineJoin:"bevel"})),T&&(A=Qb(T.get("smooth"))),p.setShape({smooth:I,stackedOnSmooth:A,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")})}this._data=r,this._coordSys=n,this._stackedOnPoints=y,this._points=l,this._step=S,this._valueOrigin=v},dispose:function(){},highlight:function(e,t,i,n){var a=e.getData(),r=Ro.queryDataIndex(a,n);if(!(r instanceof Array)&&null!=r&&r>=0){var o=a.getItemGraphicEl(r);if(!o){var s=a.getItemLayout(r);if(!s)return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(s[0],s[1]))return;(o=new cb(a,r)).position=s,o.setZ(e.get("zlevel"),e.get("z")),o.ignore=isNaN(s[0])||isNaN(s[1]),o.__temp=!0,a.setItemGraphicEl(r,o),o.stopSymbolAnimation(!0),this.group.add(o)}o.highlight()}else Sg.prototype.highlight.call(this,e,t,i,n)},downplay:function(e,t,i,n){var a=e.getData(),r=Ro.queryDataIndex(a,n);if(null!=r&&r>=0){var o=a.getItemGraphicEl(r);o&&(o.__temp?(a.setItemGraphicEl(r,null),this.group.remove(o)):o.downplay())}else Sg.prototype.downplay.call(this,e,t,i,n)},_newPolyline:function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new jb({shape:{points:e},silent:!0,z2:10}),this._lineGroup.add(t),this._polyline=t,t},_newPolygon:function(e,t){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new Zb({shape:{points:e,stackedOnPoints:t},silent:!0}),this._lineGroup.add(i),this._polygon=i,i},_updateAnimation:function(e,t,i,n,a,r){var o=this._polyline,s=this._polygon,l=e.hostModel,u=Mb(this._data,e,this._stackedOnPoints,t,this._coordSys,i,this._valueOrigin,r),h=u.current,c=u.stackedOnCurrent,d=u.next,p=u.stackedOnNext;if(a&&(h=ew(u.current,i,a),c=ew(u.stackedOnCurrent,i,a),d=ew(u.next,i,a),p=ew(u.stackedOnNext,i,a)),Jb(h,d)>3e3||s&&Jb(c,p)>3e3)return o.setShape({points:d}),void(s&&s.setShape({points:d,stackedOnPoints:p}));o.shape.__points=u.current,o.shape.points=h,tc.updateProps(o,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),tc.updateProps(s,{shape:{points:d,stackedOnPoints:p}},l));for(var f=[],g=u.status,m=0;m<g.length;m++){if("="===g[m].cmd){var v=e.getItemGraphicEl(g[m].idx1);v&&f.push({el:v,ptIdx:m})}}o.animators&&o.animators.length&&o.animators[0].during((function(){for(var e=0;e<f.length;e++){f[e].el.attr("position",o.shape.__points[f[e].ptIdx])}}))},remove:function(e){var t=this.group,i=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),i&&i.eachItemGraphicEl((function(e,n){e.__temp&&(t.remove(e),i.setItemGraphicEl(n,null))})),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._data=null}});var nw=Ve.isFunction;var aw=function(e,t,i){return{seriesType:e,performRawSeries:!0,reset:function(e,n,a){var r=e.getData(),o=e.get("symbol"),s=e.get("symbolSize"),l=e.get("symbolKeepAspect"),u=e.get("symbolRotate"),h=nw(o),c=nw(s),d=nw(u),p=h||c||d,f=!h&&o?o:t,g=c?null:s;if(r.setVisual({legendSymbol:i||f,symbol:f,symbolSize:g,symbolKeepAspect:l,symbolRotate:u}),!n.isSeriesFiltered(e))return{dataEach:r.hasItemOption||p?function(t,i){if(p){var n=e.getRawValue(i),a=e.getDataParams(i);h&&t.setItemVisual(i,"symbol",o(n,a)),c&&t.setItemVisual(i,"symbolSize",s(n,a)),d&&t.setItemVisual(i,"symbolRotate",u(n,a))}if(t.hasItemOption){var r=t.getItemModel(i),l=r.getShallow("symbol",!0),f=r.getShallow("symbolSize",!0),g=r.getShallow("symbolRotate",!0),m=r.getShallow("symbolKeepAspect",!0);null!=l&&t.setItemVisual(i,"symbol",l),null!=f&&t.setItemVisual(i,"symbolSize",f),null!=g&&t.setItemVisual(i,"symbolRotate",g),null!=m&&t.setItemVisual(i,"symbolKeepAspect",m)}}:null}}}},rw=Ve.map,ow=ry.isDimensionStacked;var sw=function(e){return{seriesType:e,plan:cg(),reset:function(e){var t=e.getData(),i=e.coordinateSystem,n=e.pipelineContext.large;if(i){var a=rw(i.dimensions,(function(e){return t.mapDimension(e)})).slice(0,2),r=a.length,o=t.getCalculationInfo("stackResultDimension");return ow(t,a[0])&&(a[0]=o),ow(t,a[1])&&(a[1]=o),r&&{progress:function(e,t){for(var o=e.end-e.start,s=n&&new Float32Array(o*r),l=e.start,u=0,h=[],c=[];l<e.end;l++){var d;if(1===r){var p=t.get(a[0],l);d=!isNaN(p)&&i.dataToPoint(p,null,c)}else{p=h[0]=t.get(a[0],l);var f=h[1]=t.get(a[1],l);d=!isNaN(p)&&!isNaN(f)&&i.dataToPoint(h,null,c)}n?(s[u++]=d?d[0]:NaN,s[u++]=d?d[1]:NaN):t.setItemLayout(l,d&&d.slice()||[NaN,NaN])}n&&t.setLayout("symbolPoints",s)}}}}}},lw={average:function(e){for(var t=0,i=0,n=0;n<e.length;n++)isNaN(e[n])||(t+=e[n],i++);return 0===i?NaN:t/i},sum:function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i]||0;return t},max:function(e){for(var t=-1/0,i=0;i<e.length;i++)e[i]>t&&(t=e[i]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,i=0;i<e.length;i++)e[i]<t&&(t=e[i]);return isFinite(t)?t:NaN},nearest:function(e){return e[0]}},uw=function(e,t){return Math.round(e.length/2)};var hw=function(e){return{seriesType:e,modifyOutputEnd:!0,reset:function(e,t,i){var n=e.getData(),a=e.get("sampling"),r=e.coordinateSystem;if("cartesian2d"===r.type&&a){var o,s=r.getBaseAxis(),l=r.getOtherAxis(s),u=s.getExtent(),h=u[1]-u[0],c=Math.round(n.count()/h);if(c>1)"string"==typeof a?o=lw[a]:"function"==typeof a&&(o=a),o&&e.setData(n.downSample(n.mapDimension(l.dim),1/c,o,uw))}}}};function cw(e){return this._axes[e]}var dw=function(e){this._axes={},this._dimList=[],this.name=e||""};dw.prototype={constructor:dw,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return Ve.map(this._dimList,cw,this)},getAxesByScale:function(e){return e=e.toLowerCase(),Ve.filter(this.getAxes(),(function(t){return t.scale.type===e}))},addAxis:function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},dataToCoord:function(e){return this._dataCoordConvert(e,"dataToCoord")},coordToData:function(e){return this._dataCoordConvert(e,"coordToData")},_dataCoordConvert:function(e,t){for(var i=this._dimList,n=e instanceof Array?[]:{},a=0;a<i.length;a++){var r=i[a],o=this._axes[r];n[r]=o[t](e[r])}return n}};var pw=dw;function fw(e){pw.call(this,e)}fw.prototype={constructor:fw,type:"cartesian2d",dimensions:["x","y"],getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},containPoint:function(e){var t=this.getAxis("x"),i=this.getAxis("y");return t.contain(t.toLocalCoord(e[0]))&&i.contain(i.toLocalCoord(e[1]))},containData:function(e){return this.getAxis("x").containData(e[0])&&this.getAxis("y").containData(e[1])},dataToPoint:function(e,t,i){var n=this.getAxis("x"),a=this.getAxis("y");return(i=i||[])[0]=n.toGlobalCoord(n.dataToCoord(e[0])),i[1]=a.toGlobalCoord(a.dataToCoord(e[1])),i},clampData:function(e,t){var i=this.getAxis("x").scale,n=this.getAxis("y").scale,a=i.getExtent(),r=n.getExtent(),o=i.parse(e[0]),s=n.parse(e[1]);return(t=t||[])[0]=Math.min(Math.max(Math.min(a[0],a[1]),o),Math.max(a[0],a[1])),t[1]=Math.min(Math.max(Math.min(r[0],r[1]),s),Math.max(r[0],r[1])),t},pointToData:function(e,t){var i=this.getAxis("x"),n=this.getAxis("y");return(t=t||[])[0]=i.coordToData(i.toLocalCoord(e[0])),t[1]=n.coordToData(n.toLocalCoord(e[1])),t},getOtherAxis:function(e){return this.getAxis("x"===e.dim?"y":"x")},getArea:function(){var e=this.getAxis("x").getGlobalExtent(),t=this.getAxis("y").getGlobalExtent(),i=Math.min(e[0],e[1]),n=Math.min(t[0],t[1]),a=Math.max(e[0],e[1])-i,r=Math.max(t[0],t[1])-n;return new Pn(i,n,a,r)}},Ve.inherits(fw,pw);var gw=fw,mw=function(e,t,i,n,a){L_.call(this,e,t,i),this.type=n||"value",this.position=a||"bottom"};mw.prototype={constructor:mw,index:0,getAxesOnZeroOf:null,model:null,isHorizontal:function(){var e=this.position;return"top"===e||"bottom"===e},getGlobalExtent:function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(e,t){return this.coordToData(this.toLocalCoord(e["x"===this.dim?0:1]),t)},toLocalCoord:null,toGlobalCoord:null},Ve.inherits(mw,L_);var vw=mw,yw={show:!0,zlevel: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:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},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},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)"]}}},xw={};xw.categoryAxis=Ve.merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},yw),xw.valueAxis=Ve.merge({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},yw),xw.timeAxis=Ve.defaults({scale:!0,min:"dataMin",max:"dataMax"},xw.valueAxis),xw.logAxis=Ve.defaults({scale:!0,logBase:10},xw.valueAxis);var _w=xw,bw=nd.getLayoutParams,ww=nd.mergeLayoutParam,Sw=["value","category","time","log"];var Mw=function(e,t,i,n){Ve.each(Sw,(function(a){t.extend({type:e+"Axis."+a,mergeDefaultAndTheme:function(t,n){var r=this.layoutMode,o=r?bw(t):{},s=n.getTheme();Ve.merge(t,s.get(a+"Axis")),Ve.merge(t,this.getDefaultOption()),t.type=i(e,t),r&&ww(t,o,r)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=Sy.createByAxisModel(this))},getCategories:function(e){var t=this.option;if("category"===t.type)return e?t.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:Ve.mergeAll([{},_w[a+"Axis"],n],!0)})})),ud.registerSubTypeDefaulter(e+"Axis",Ve.curry(i,e))},Iw=ud.extend({type:"cartesian2dAxis",axis:null,init:function(){Iw.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){Iw.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){Iw.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function Tw(e,t){return t.type||(t.data?"category":"value")}Ve.merge(Iw.prototype,Ox);var Aw={offset:0};Mw("x",Iw,Tw,Aw),Mw("y",Iw,Tw,Aw),ud.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var Cw=Ve.isObject,Dw=Ve.each,Lw=Ve.map,Pw=Ve.indexOf,kw=nd.getLayoutRect,Ow=Px.createScaleByModel,Rw=Px.ifAxisCrossZero,Ew=Px.niceScaleExtent,Nw=Px.estimateLabelUnionRect,zw=ry.getStackedDimension;function Bw(e,t,i){return e.getCoordSysModel()===t}function Vw(e,t,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(e,t,i),this.model=e}var Fw=Vw.prototype;function Gw(e,t,i,n){i.getAxesOnZeroOf=function(){return a?[a]:[]};var a,r=e[t],o=i.model,s=o.get("axisLine.onZero"),l=o.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)Hw(r[l])&&(a=r[l]);else for(var u in r)if(r.hasOwnProperty(u)&&Hw(r[u])&&!n[h(r[u])]){a=r[u];break}a&&(n[h(a)]=!0)}function h(e){return e.dim+"_"+e.index}}function Hw(e){return e&&"category"!==e.type&&"time"!==e.type&&Rw(e)}Fw.type="grid",Fw.axisPointerEnabled=!0,Fw.getRect=function(){return this._rect},Fw.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model),Dw(i.x,(function(e){Ew(e.scale,e.model)})),Dw(i.y,(function(e){Ew(e.scale,e.model)}));var n={};Dw(i.x,(function(e){Gw(i,"y",e,n)})),Dw(i.y,(function(e){Gw(i,"x",e,n)})),this.resize(this.model,t)},Fw.resize=function(e,t,i){var n=kw(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});this._rect=n;var a=this._axesList;function r(){Dw(a,(function(e){var t=e.isHorizontal(),i=t?[0,n.width]:[0,n.height],a=e.inverse?1:0;e.setExtent(i[a],i[1-a]),function(e,t){var i=e.getExtent(),n=i[0]+i[1];e.toGlobalCoord="x"===e.dim?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord="x"===e.dim?function(e){return e-t}:function(e){return n-e+t}}(e,t?n.x:n.y)}))}r(),!i&&e.get("containLabel")&&(Dw(a,(function(e){if(!e.model.get("axisLabel.inside")){var t=Nw(e);if(t){var i=e.isHorizontal()?"height":"width",a=e.model.get("axisLabel.margin");n[i]-=t[i]+a,"top"===e.position?n.y+=t.height+a:"left"===e.position&&(n.x+=t.width+a)}}})),r())},Fw.getAxis=function(e,t){var i=this._axesMap[e];if(null!=i){if(null==t)for(var n in i)if(i.hasOwnProperty(n))return i[n];return i[t]}},Fw.getAxes=function(){return this._axesList.slice()},Fw.getCartesian=function(e,t){if(null!=e&&null!=t){var i="x"+e+"y"+t;return this._coordsMap[i]}Cw(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var n=0,a=this._coordsList;n<a.length;n++)if(a[n].getAxis("x").index===e||a[n].getAxis("y").index===t)return a[n]},Fw.getCartesians=function(){return this._coordsList.slice()},Fw.convertToPixel=function(e,t,i){var n=this._findConvertTarget(e,t);return n.cartesian?n.cartesian.dataToPoint(i):n.axis?n.axis.toGlobalCoord(n.axis.dataToCoord(i)):null},Fw.convertFromPixel=function(e,t,i){var n=this._findConvertTarget(e,t);return n.cartesian?n.cartesian.pointToData(i):n.axis?n.axis.coordToData(n.axis.toLocalCoord(i)):null},Fw._findConvertTarget=function(e,t){var i,n,a=t.seriesModel,r=t.xAxisModel||a&&a.getReferringComponents("xAxis")[0],o=t.yAxisModel||a&&a.getReferringComponents("yAxis")[0],s=t.gridModel,l=this._coordsList;if(a)i=a.coordinateSystem,Pw(l,i)<0&&(i=null);else if(r&&o)i=this.getCartesian(r.componentIndex,o.componentIndex);else if(r)n=this.getAxis("x",r.componentIndex);else if(o)n=this.getAxis("y",o.componentIndex);else if(s){s.coordinateSystem===this&&(i=this._coordsList[0])}return{cartesian:i,axis:n}},Fw.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},Fw._initCartesian=function(e,t,i){var n={left:!1,right:!1,top:!1,bottom:!1},a={x:{},y:{}},r={x:0,y:0};if(t.eachComponent("xAxis",o("x"),this),t.eachComponent("yAxis",o("y"),this),!r.x||!r.y)return this._axesMap={},void(this._axesList=[]);function o(t){return function(i,o){if(Bw(i,e)){var s=i.get("position");"x"===t?"top"!==s&&"bottom"!==s&&(s=n.bottom?"top":"bottom"):"left"!==s&&"right"!==s&&(s=n.left?"right":"left"),n[s]=!0;var l=new vw(t,Ow(i),[0,0],i.get("type"),s),u="category"===l.type;l.onBand=u&&i.get("boundaryGap"),l.inverse=i.get("inverse"),i.axis=l,l.model=i,l.grid=this,l.index=o,this._axesList.push(l),a[t][o]=l,r[t]++}}}this._axesMap=a,Dw(a.x,(function(t,i){Dw(a.y,(function(n,a){var r="x"+i+"y"+a,o=new gw(r);o.grid=this,o.model=e,this._coordsMap[r]=o,this._coordsList.push(o),o.addAxis(t),o.addAxis(n)}),this)}),this)},Fw._updateScale=function(e,t){function i(e,t,i){Dw(e.mapDimension(t.dim,!0),(function(i){t.scale.unionExtentFromData(e,zw(e,i))}))}Dw(this._axesList,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeries((function(e){if(jw(e)){var n=Uw(e),a=n[0],r=n[1];if(!Bw(a,t)||!Bw(r,t))return;var o=this.getCartesian(a.componentIndex,r.componentIndex),s=e.getData(),l=o.getAxis("x"),u=o.getAxis("y");"list"===s.type&&(i(s,l),i(s,u))}}),this)},Fw.getTooltipAxes=function(e){var t=[],i=[];return Dw(this.getCartesians(),(function(n){var a=null!=e&&"auto"!==e?n.getAxis(e):n.getBaseAxis(),r=n.getOtherAxis(a);Pw(t,a)<0&&t.push(a),Pw(i,r)<0&&i.push(r)})),{baseAxes:t,otherAxes:i}};var Ww=["xAxis","yAxis"];function Uw(e,t){return Lw(Ww,(function(t){return e.getReferringComponents(t)[0]}))}function jw(e){return"cartesian2d"===e.get("coordinateSystem")}Vw.create=function(e,t){var i=[];return e.eachComponent("grid",(function(n,a){var r=new Vw(n,e,t);r.name="grid_"+a,r.resize(n,t,!0),n.coordinateSystem=r,i.push(r)})),e.eachSeries((function(e){if(jw(e)){var t=Uw(e),i=t[0],n=t[1],a=i.getCoordSysModel().coordinateSystem;e.coordinateSystem=a.getCartesian(i.componentIndex,n.componentIndex)}})),i},Vw.dimensions=Vw.prototype.dimensions=gw.prototype.dimensions,Tp.register("cartesian2d",Vw);var Zw=Ve.retrieve,Yw=Ve.defaults,Xw=Ve.extend,qw=Ve.each,$w=Pc.isRadianAroundZero,Kw=Pc.remRadian,Jw=jx.createSymbol,Qw=lt.applyTransform,eS=Px.shouldShowAllLabels,tS=Math.PI,iS=function(e,t){this.opt=t,this.axisModel=e,Yw(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0}),this.group=new tc.Group;var i=new tc.Group({position:t.position.slice(),rotation:t.rotation});i.updateTransform(),this._transform=i.transform,this._dumbGroup=i};iS.prototype={constructor:iS,hasBuilder:function(e){return!!nS[e]},add:function(e){nS[e].call(this)},getGroup:function(){return this.group}};var nS={axisLine:function(){var e=this.opt,t=this.axisModel;if(t.get("axisLine.show")){var i=this.axisModel.axis.getExtent(),n=this._transform,a=[i[0],0],r=[i[1],0];n&&(Qw(a,a,n),Qw(r,r,n));var o=Xw({lineCap:"round"},t.getModel("axisLine.lineStyle").getLineStyle());this.group.add(new tc.Line({anid:"line",subPixelOptimize:!0,shape:{x1:a[0],y1:a[1],x2:r[0],y2:r[1]},style:o,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1}));var s=t.get("axisLine.symbol"),l=t.get("axisLine.symbolSize"),u=t.get("axisLine.symbolOffset")||0;if("number"==typeof u&&(u=[u,u]),null!=s){"string"==typeof s&&(s=[s,s]),"string"!=typeof l&&"number"!=typeof l||(l=[l,l]);var h=l[0],c=l[1];qw([{rotate:e.rotation+Math.PI/2,offset:u[0],r:0},{rotate:e.rotation-Math.PI/2,offset:u[1],r:Math.sqrt((a[0]-r[0])*(a[0]-r[0])+(a[1]-r[1])*(a[1]-r[1]))}],(function(t,i){if("none"!==s[i]&&null!=s[i]){var n=Jw(s[i],-h/2,-c/2,h,c,o.stroke,!0),r=t.r+t.offset,l=[a[0]+r*Math.cos(e.rotation),a[1]-r*Math.sin(e.rotation)];n.attr({rotation:t.rotate,position:l,silent:!0,z2:11}),this.group.add(n)}}),this)}}},axisTickLabel:function(){var e=this.axisModel,t=this.opt,i=function(e,t,i){var n=t.axis,a=t.getModel("axisTick");if(!a.get("show")||n.scale.isBlank())return;for(var r=a.getModel("lineStyle"),o=i.tickDirection*a.get("length"),s=hS(n.getTicksCoords(),e._transform,o,Yw(r.getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")}),"ticks"),l=0;l<s.length;l++)e.group.add(s[l]);return s}(this,e,t),n=function(e,t,i){var n=t.axis,a=Zw(i.axisLabelShow,t.get("axisLabel.show"));if(!a||n.scale.isBlank())return;var r=t.getModel("axisLabel"),o=r.get("margin"),s=n.getViewLabels(),l=(Zw(i.labelRotate,r.get("rotate"))||0)*tS/180,u=rS(i.rotation,l,i.labelDirection),h=t.getCategories&&t.getCategories(!0),c=[],d=oS(t),p=t.get("triggerEvent");return qw(s,(function(a,s){var l=a.tickValue,f=a.formattedLabel,g=a.rawLabel,m=r;h&&h[l]&&h[l].textStyle&&(m=new mc(h[l].textStyle,r,t.ecModel));var v=m.getTextColor()||t.get("axisLine.lineStyle.color"),y=[n.dataToCoord(l),i.labelOffset+i.labelDirection*o],x=new tc.Text({anid:"label_"+l,position:y,rotation:u.rotation,silent:d,z2:10});tc.setTextStyle(x.style,m,{text:f,textAlign:m.getShallow("align",!0)||u.textAlign,textVerticalAlign:m.getShallow("verticalAlign",!0)||m.getShallow("baseline",!0)||u.textVerticalAlign,textFill:"function"==typeof v?v("category"===n.type?g:"value"===n.type?l+"":l,s):v}),p&&(x.eventData=aS(t),x.eventData.targetType="axisLabel",x.eventData.value=g),e._dumbGroup.add(x),x.updateTransform(),c.push(x),e.group.add(x),x.decomposeTransform()})),c}(this,e,t);!function(e,t,i){if(eS(e.axis))return;var n=e.get("axisLabel.showMinLabel"),a=e.get("axisLabel.showMaxLabel");t=t||[],i=i||[];var r=t[0],o=t[1],s=t[t.length-1],l=t[t.length-2],u=i[0],h=i[1],c=i[i.length-1],d=i[i.length-2];!1===n?(sS(r),sS(u)):lS(r,o)&&(n?(sS(o),sS(h)):(sS(r),sS(u)));!1===a?(sS(s),sS(c)):lS(l,s)&&(a?(sS(l),sS(d)):(sS(s),sS(c)))}(e,n,i),function(e,t,i){var n=t.axis,a=t.getModel("minorTick");if(!a.get("show")||n.scale.isBlank())return;var r=n.getMinorTicksCoords();if(!r.length)return;for(var o=a.getModel("lineStyle"),s=i.tickDirection*a.get("length"),l=Yw(o.getLineStyle(),Yw(t.getModel("axisTick").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})),u=0;u<r.length;u++)for(var h=hS(r[u],e._transform,s,l,"minorticks_"+u),c=0;c<h.length;c++)e.group.add(h[c])}(this,e,t)},axisName:function(){var e=this.opt,t=this.axisModel,i=Zw(e.axisName,t.get("name"));if(i){var n,a,r=t.get("nameLocation"),o=e.nameDirection,s=t.getModel("nameTextStyle"),l=t.get("nameGap")||0,u=this.axisModel.axis.getExtent(),h=u[0]>u[1]?-1:1,c=["start"===r?u[0]-h*l:"end"===r?u[1]+h*l:(u[0]+u[1])/2,uS(r)?e.labelOffset+o*l:0],d=t.get("nameRotate");null!=d&&(d=d*tS/180),uS(r)?n=rS(e.rotation,null!=d?d:e.rotation,o):(n=function(e,t,i,n){var a,r,o=Kw(i-e.rotation),s=n[0]>n[1],l="start"===t&&!s||"start"!==t&&s;$w(o-tS/2)?(r=l?"bottom":"top",a="center"):$w(o-1.5*tS)?(r=l?"top":"bottom",a="center"):(r="middle",a=o<1.5*tS&&o>tS/2?l?"left":"right":l?"right":"left");return{rotation:o,textAlign:a,textVerticalAlign:r}}(e,r,d||0,u),null!=(a=e.axisNameAvailableWidth)&&(a=Math.abs(a/Math.sin(n.rotation)),!isFinite(a)&&(a=null)));var p=s.getFont(),f=t.get("nameTruncate",!0)||{},g=f.ellipsis,m=Zw(e.nameTruncateMaxWidth,f.maxWidth,a),v=null!=g&&null!=m?Uc.truncateText(i,m,p,g,{minChar:2,placeholder:f.placeholder}):i,y=t.get("tooltip",!0),x=t.mainType,_={componentType:x,name:i,$vars:["name"]};_[x+"Index"]=t.componentIndex;var b=new tc.Text({anid:"name",__fullText:i,__truncatedText:v,position:c,rotation:n.rotation,silent:oS(t),z2:1,tooltip:y&&y.show?Xw({content:i,formatter:function(){return i},formatterParams:_},y):null});tc.setTextStyle(b.style,s,{text:v,textFont:p,textFill:s.getTextColor()||t.get("axisLine.lineStyle.color"),textAlign:s.get("align")||n.textAlign,textVerticalAlign:s.get("verticalAlign")||n.textVerticalAlign}),t.get("triggerEvent")&&(b.eventData=aS(t),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},aS=iS.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},rS=iS.innerTextLayout=function(e,t,i){var n,a,r=Kw(t-e);return $w(r)?(a=i>0?"top":"bottom",n="center"):$w(r-tS)?(a=i>0?"bottom":"top",n="center"):(a="middle",n=r>0&&r<tS?i>0?"right":"left":i>0?"left":"right"),{rotation:r,textAlign:n,textVerticalAlign:a}};var oS=iS.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)};function sS(e){e&&(e.ignore=!0)}function lS(e,t,i){var n=e&&e.getBoundingRect().clone(),a=t&&t.getBoundingRect().clone();if(n&&a){var r=ni.identity([]);return ni.rotate(r,r,-e.rotation),n.applyTransform(ni.mul([],r,e.getLocalTransform())),a.applyTransform(ni.mul([],r,t.getLocalTransform())),n.intersect(a)}}function uS(e){return"middle"===e||"center"===e}function hS(e,t,i,n,a){for(var r=[],o=[],s=[],l=0;l<e.length;l++){var u=e[l].coord;o[0]=u,o[1]=0,s[0]=u,s[1]=i,t&&(Qw(o,o,t),Qw(s,s,t));var h=new tc.Line({anid:a+"_"+e[l].tickValue,subPixelOptimize:!0,shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:n,z2:2,silent:!0});r.push(h)}return r}var cS=iS,dS=Ve.each,pS=Ve.curry;function fS(e,t){return"all"===e||Ve.isArray(e)&&Ve.indexOf(e,t)>=0||e===t}function gS(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[vS(e)]}function mS(e){return!!e.get("handle.show")}function vS(e){return e.type+"||"+e.id}var yS=function(e,t){var i={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return function(e,t,i){var n=t.getComponent("tooltip"),a=t.getComponent("axisPointer"),r=a.get("link",!0)||[],o=[];dS(i.getCoordinateSystems(),(function(i){if(i.axisPointerEnabled){var s=vS(i.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=i;var u=i.model.getModel("tooltip",n);if(dS(i.getAxes(),pS(p,!1,null)),i.getTooltipAxes&&n&&u.get("show")){var h="axis"===u.get("trigger"),c="cross"===u.get("axisPointer.type"),d=i.getTooltipAxes(u.get("axisPointer.axis"));(h||c)&&dS(d.baseAxes,pS(p,!c||"cross",h)),c&&dS(d.otherAxes,pS(p,"cross",!1))}}function p(n,s,h){var c=h.model.getModel("axisPointer",a),d=c.get("show");if(d&&("auto"!==d||n||mS(c))){null==s&&(s=c.get("triggerTooltip")),c=n?function(e,t,i,n,a,r){var o=t.getModel("axisPointer"),s={};dS(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=Ve.clone(o.get(e))})),s.snap="category"!==e.type&&!!r,"cross"===o.get("type")&&(s.type="line");var l=s.label||(s.label={});if(null==l.show&&(l.show=!1),"cross"===a){var u=o.get("label.show");if(l.show=null==u||u,!r){var h=s.lineStyle=o.get("crossStyle");h&&Ve.defaults(l,h.textStyle)}}return e.model.getModel("axisPointer",new mc(s,i,n))}(h,u,a,t,n,s):c;var p=c.get("snap"),f=vS(h.model),g=s||p||"category"===h.type,m=e.axesInfo[f]={key:f,axis:h,coordSys:i,axisPointerModel:c,triggerTooltip:s,involveSeries:g,snap:p,useHandle:mS(c),seriesModels:[]};l[f]=m,e.seriesInvolved|=g;var v=function(e,t){for(var i=t.model,n=t.dim,a=0;a<e.length;a++){var r=e[a]||{};if(fS(r[n+"AxisId"],i.id)||fS(r[n+"AxisIndex"],i.componentIndex)||fS(r[n+"AxisName"],i.name))return a}}(r,h);if(null!=v){var y=o[v]||(o[v]={axesInfo:{}});y.axesInfo[f]=m,y.mapper=r[v].mapper,m.linkGroup=y}}}}))}(i,e,t),i.seriesInvolved&&function(e,t){t.eachSeries((function(t){var i=t.coordinateSystem,n=t.get("tooltip.trigger",!0),a=t.get("tooltip.show",!0);i&&"none"!==n&&!1!==n&&"item"!==n&&!1!==a&&!1!==t.get("axisPointer.show",!0)&&dS(e.coordSysAxesInfo[vS(i.model)],(function(e){var n=e.axis;i.getAxis(n.dim)===n&&(e.seriesModels.push(t),null==e.seriesDataCount&&(e.seriesDataCount=0),e.seriesDataCount+=t.getData().count())}))}),this)}(i,e),i},xS=function(e){var t=gS(e);if(t){var i=t.axisPointerModel,n=t.axis.scale,a=i.option,r=i.get("status"),o=i.get("value");null!=o&&(o=n.parse(o));var s=mS(i);null==r&&(a.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(null==o||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),a.value=o,s&&(a.status=t.axis.scale.isBlank()?"hide":"show")}},_S={collect:yS,fixValue:xS,getAxisInfo:gS,getAxisPointerModel:function(e){var t=gS(e);return t&&t.axisPointerModel},makeKey:vS},bS=X_.extendComponentView({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(e,t,i,n){this.axisPointerClass&&_S.fixValue(e),bS.superApply(this,"render",arguments),wS(this,e,t,i,n,!0)},updateAxisPointer:function(e,t,i,n,a){wS(this,e,t,i,n,!1)},remove:function(e,t){var i=this._axisPointer;i&&i.remove(t),bS.superApply(this,"remove",arguments)},dispose:function(e,t){SS(this,t),bS.superApply(this,"dispose",arguments)}});function wS(e,t,i,n,a,r){var o=bS.getAxisPointerClass(e.axisPointerClass);if(o){var s=_S.getAxisPointerModel(t);s?(e._axisPointer||(e._axisPointer=new o)).render(t,s,n,r):SS(e,n)}}function SS(e,t,i){var n=e._axisPointer;n&&n.dispose(t,i),e._axisPointer=null}var MS=[];bS.registerAxisPointerClass=function(e,t){MS[e]=t},bS.getAxisPointerClass=function(e){return e&&MS[e]};var IS=bS;var TS=function(e,t,i){i=i||{};var n=e.coordinateSystem,a=t.axis,r={},o=a.getAxesOnZeroOf()[0],s=a.position,l=o?"onZero":s,u=a.dim,h=n.getRect(),c=[h.x,h.x+h.width,h.y,h.y+h.height],d={left:0,right:1,top:0,bottom:1,onZero:2},p=t.get("offset")||0,f="x"===u?[c[2]-p,c[3]+p]:[c[0]-p,c[1]+p];if(o){var g=o.toGlobalCoord(o.dataToCoord(0));f[d.onZero]=Math.max(Math.min(g,f[1]),f[0])}r.position=["y"===u?f[d[l]]:c[0],"x"===u?f[d[l]]:c[3]],r.rotation=Math.PI/2*("x"===u?0:1),r.labelDirection=r.tickDirection=r.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],r.labelOffset=o?f[d[s]]-f[d.onZero]:0,t.get("axisTick.inside")&&(r.tickDirection=-r.tickDirection),Ve.retrieve(i.labelInside,t.get("axisLabel.inside"))&&(r.labelDirection=-r.labelDirection);var m=t.get("axisLabel.rotate");return r.labelRotate="top"===l?-m:m,r.z2=1,r},AS={layout:TS};var CS=function(e,t,i,n){var a=i.axis;if(!a.scale.isBlank()){var r=i.getModel("splitArea"),o=r.getModel("areaStyle"),s=o.get("color"),l=n.coordinateSystem.getRect(),u=a.getTicksCoords({tickModel:r,clamp:!0});if(u.length){var h=s.length,c=e.__splitAreaColors,d=Ve.createHashMap(),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=a.toGlobalCoord(u[0].coord),v=o.getAreaStyle();s=Ve.isArray(s)?s:[s];for(f=1;f<u.length;f++){var y,x,_,b,w=a.toGlobalCoord(u[f].coord);a.isHorizontal()?(y=m,x=l.y,_=w-y,b=l.height,m=y+_):(y=l.x,x=m,_=l.width,m=x+(b=w-x));var S=u[f-1].tickValue;null!=S&&d.set(S,p),t.add(new tc.Rect({anid:null!=S?"area_"+S:null,shape:{x:y,y:x,width:_,height:b},style:Ve.defaults({fill:s[p]},v),silent:!0})),p=(p+1)%h}e.__splitAreaColors=d}}},DS={rectCoordAxisBuildSplitArea:CS,rectCoordAxisHandleRemove:function(e){e.__splitAreaColors=null}},LS=DS.rectCoordAxisBuildSplitArea,PS=DS.rectCoordAxisHandleRemove,kS=["axisLine","axisTickLabel","axisName"],OS=["splitArea","splitLine","minorSplitLine"],RS=IS.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(e,t,i,n){this.group.removeAll();var a=this._axisGroup;if(this._axisGroup=new tc.Group,this.group.add(this._axisGroup),e.get("show")){var r=e.getCoordSysModel(),o=AS.layout(r,e),s=new cS(e,o);Ve.each(kS,s.add,s),this._axisGroup.add(s.getGroup()),Ve.each(OS,(function(t){e.get(t+".show")&&this["_"+t](e,r)}),this),tc.groupTransition(a,this._axisGroup,e),RS.superCall(this,"render",e,t,i,n)}},remove:function(){PS(this)},_splitLine:function(e,t){var i=e.axis;if(!i.scale.isBlank()){var n=e.getModel("splitLine"),a=n.getModel("lineStyle"),r=a.get("color");r=Ve.isArray(r)?r:[r];for(var o=t.coordinateSystem.getRect(),s=i.isHorizontal(),l=0,u=i.getTicksCoords({tickModel:n}),h=[],c=[],d=a.getLineStyle(),p=0;p<u.length;p++){var f=i.toGlobalCoord(u[p].coord);s?(h[0]=f,h[1]=o.y,c[0]=f,c[1]=o.y+o.height):(h[0]=o.x,h[1]=f,c[0]=o.x+o.width,c[1]=f);var g=l++%r.length,m=u[p].tickValue;this._axisGroup.add(new tc.Line({anid:null!=m?"line_"+u[p].tickValue:null,subPixelOptimize:!0,shape:{x1:h[0],y1:h[1],x2:c[0],y2:c[1]},style:Ve.defaults({stroke:r[g]},d),silent:!0}))}}},_minorSplitLine:function(e,t){var i=e.axis,n=e.getModel("minorSplitLine").getModel("lineStyle"),a=t.coordinateSystem.getRect(),r=i.isHorizontal(),o=i.getMinorTicksCoords();if(o.length)for(var s=[],l=[],u=n.getLineStyle(),h=0;h<o.length;h++)for(var c=0;c<o[h].length;c++){var d=i.toGlobalCoord(o[h][c].coord);r?(s[0]=d,s[1]=a.y,l[0]=d,l[1]=a.y+a.height):(s[0]=a.x,s[1]=d,l[0]=a.x+a.width,l[1]=d),this._axisGroup.add(new tc.Line({anid:"minor_line_"+o[h][c].tickValue,subPixelOptimize:!0,shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,silent:!0}))}},_splitArea:function(e,t){LS(this,this._axisGroup,e,t)}});RS.extend({type:"xAxis"}),RS.extend({type:"yAxis"}),X_.extendComponentView({type:"grid",render:function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new tc.Rect({shape:e.coordinateSystem.getRect(),style:Ve.defaults({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))}}),X_.registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})),X_.registerVisual(aw("line","circle","line")),X_.registerLayout(sw("line")),X_.registerProcessor(X_.PRIORITY.PROCESSOR.STATISTIC,hw("line"));var ES=og.extend({type:"series.__base_bar__",getInitialData:function(e,t){return py(this.getSource(),this,{useEncodeDefaulter:!0})},getMarkerPosition:function(e){var t=this.coordinateSystem;if(t){var i=t.dataToPoint(t.clampData(e)),n=this.getData(),a=n.getLayout("offset"),r=n.getLayout("size");return i[t.getBaseAxis().isHorizontal()?0:1]+=a+r/2,i}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});ES.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return!!this.get("large")&&this.get("progressive")},getProgressiveThreshold:function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},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}}});var NS=K_.getDefaultLabel;function zS(e,t){"outside"===e.textPosition&&(e.textPosition=t)}var BS=function(e,t,i,n,a,r,o){var s=i.getModel("label"),l=i.getModel("emphasis.label");tc.setLabelStyle(e,t,s,l,{labelFetcher:a,labelDataIndex:r,defaultText:NS(a.getData(),r),isRectText:!0,autoColor:n}),zS(e),zS(t)},VS={setLabel:BS},FS=Uo([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),GS={getBarItemStyle:function(e){var t=FS(this,e);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(t.lineDash=i)}return t}},HS=GS,WS=(0,tc.extendShape)({type:"sausage",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},buildPath:function(e,t){var i=t.cx,n=t.cy,a=Math.max(t.r0||0,0),r=Math.max(t.r,0),o=.5*(r-a),s=a+o,l=t.startAngle,u=t.endAngle,h=t.clockwise,c=Math.cos(l),d=Math.sin(l),p=Math.cos(u),f=Math.sin(u);(h?u-l<2*Math.PI:l-u<2*Math.PI)&&(e.moveTo(c*a+i,d*a+n),e.arc(c*s+i,d*s+n,o,-Math.PI+l,l,!h)),e.arc(i,n,r,l,u,!h),e.moveTo(p*r+i,f*r+n),e.arc(p*s+i,f*s+n,o,u-2*Math.PI,u-Math.PI,!h),0!==a&&(e.arc(i,n,a,u,l,h),e.moveTo(c*a+i,f*a+n)),e.closePath()}}),US=VS.setLabel,jS=Cg.throttle,ZS=Wb.createClipPath,YS=["itemStyle","barBorderWidth"],XS=[0,0];Ve.extend(mc.prototype,HS),X_.extendChartView({type:"bar",render:function(e,t,i){this._updateDrawMode(e);var n=e.get("coordinateSystem");return"cartesian2d"!==n&&"polar"!==n||(this._isLargeDraw?this._renderLarge(e,t,i):this._renderNormal(e,t,i)),this.group},incrementalPrepareRender:function(e,t,i){this._clear(),this._updateDrawMode(e)},incrementalRender:function(e,t,i,n){this._incrementalRenderLarge(e,t)},_updateDrawMode:function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t^this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},_renderNormal:function(e,t,i){var n,a=this.group,r=e.getData(),o=this._data,s=e.coordinateSystem,l=s.getBaseAxis();"cartesian2d"===s.type?n=l.isHorizontal():"polar"===s.type&&(n="angle"===l.dim);var u=e.isAnimationEnabled()?e:null,h=e.get("clip",!0),c=function(e,t){var i=e.getArea&&e.getArea();if("cartesian2d"===e.type){var n=e.getBaseAxis();if("category"!==n.type||!n.onBand){var a=t.getLayout("bandWidth");n.isHorizontal()?(i.x-=a,i.width+=2*a):(i.y-=a,i.height+=2*a)}}return i}(s,r);a.removeClipPath();var d=e.get("roundCap",!0),p=e.get("showBackground",!0),f=e.getModel("backgroundStyle"),g=f.get("barBorderRadius")||0,m=[],v=this._backgroundEls||[];r.diff(o).add((function(t){var i=r.getItemModel(t),o=tM[s.type](r,t,i);if(p){var l=tM[s.type](r,t),v=function(e,t,i){var n="polar"===e.type?tc.Sector:tc.Rect;return new n({shape:sM(t,i,e),silent:!0,z2:0})}(s,n,l);v.useStyle(f.getBarItemStyle()),"cartesian2d"===s.type&&v.setShape("r",g),m[t]=v}if(r.hasValue(t)){if(h)if(KS[s.type](c,o))return void a.remove(y);var y=JS[s.type](t,o,n,u,!1,d);r.setItemGraphicEl(t,y),a.add(y),nM(y,r,t,i,o,e,n,"polar"===s.type)}})).update((function(t,i){var l=r.getItemModel(t),y=tM[s.type](r,t,l);if(p){var x=v[i];x.useStyle(f.getBarItemStyle()),"cartesian2d"===s.type&&x.setShape("r",g),m[t]=x;var _=tM[s.type](r,t),b=sM(n,_,s);tc.updateProps(x,{shape:b},u,t)}var w=o.getItemGraphicEl(i);if(r.hasValue(t)){if(h)if(KS[s.type](c,y))return void a.remove(w);w?tc.updateProps(w,{shape:y},u,t):w=JS[s.type](t,y,n,u,!0,d),r.setItemGraphicEl(t,w),a.add(w),nM(w,r,t,l,y,e,n,"polar"===s.type)}else a.remove(w)})).remove((function(e){var t=o.getItemGraphicEl(e);"cartesian2d"===s.type?t&&QS(e,u,t):t&&eM(e,u,t)})).execute();var y=this._backgroundGroup||(this._backgroundGroup=new On);y.removeAll();for(var x=0;x<m.length;++x)y.add(m[x]);a.add(y),this._backgroundEls=m,this._data=r},_renderLarge:function(e,t,i){this._clear(),rM(e,this.group);var n=e.get("clip",!0)?ZS(e.coordinateSystem,!1,e):null;n?this.group.setClipPath(n):this.group.removeClipPath()},_incrementalRenderLarge:function(e,t){this._removeBackground(),rM(t,this.group,!0)},dispose:Ve.noop,remove:function(e){this._clear(e)},_clear:function(e){var t=this.group,i=this._data;e&&e.get("animation")&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl((function(t){"sector"===t.type?eM(t.dataIndex,e,t):QS(t.dataIndex,e,t)}))):t.removeAll(),this._data=null},_removeBackground:function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null}});var qS=Math.max,$S=Math.min,KS={cartesian2d:function(e,t){var i=t.width<0?-1:1,n=t.height<0?-1:1;i<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height);var a=qS(t.x,e.x),r=$S(t.x+t.width,e.x+e.width),o=qS(t.y,e.y),s=$S(t.y+t.height,e.y+e.height);t.x=a,t.y=o,t.width=r-a,t.height=s-o;var l=t.width<0||t.height<0;return i<0&&(t.x+=t.width,t.width=-t.width),n<0&&(t.y+=t.height,t.height=-t.height),l},polar:function(e){return!1}},JS={cartesian2d:function(e,t,i,n,a){var r=new tc.Rect({shape:Ve.extend({},t),z2:1});if(r.name="item",n){var o=i?"height":"width",s={};r.shape[o]=0,s[o]=t[o],tc[a?"updateProps":"initProps"](r,{shape:s},n,e)}return r},polar:function(e,t,i,n,a,r){var o=t.startAngle<t.endAngle,s=new(!i&&r?WS:tc.Sector)({shape:Ve.defaults({clockwise:o},t),z2:1});if(s.name="item",n){var l=i?"r":"endAngle",u={};s.shape[l]=i?0:t.startAngle,u[l]=t[l],tc[a?"updateProps":"initProps"](s,{shape:u},n,e)}return s}};function QS(e,t,i){i.style.text=null,tc.updateProps(i,{shape:{width:0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}function eM(e,t,i){i.style.text=null,tc.updateProps(i,{shape:{r:i.shape.r0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}var tM={cartesian2d:function(e,t,i){var n=e.getItemLayout(t),a=i?function(e,t){var i=e.get(YS)||0,n=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(i,n,a)}(i,n):0,r=n.width>0?1:-1,o=n.height>0?1:-1;return{x:n.x+r*a/2,y:n.y+o*a/2,width:n.width-r*a,height:n.height-o*a}},polar:function(e,t,i){var n=e.getItemLayout(t);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle}}};function iM(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}function nM(e,t,i,n,a,r,o,s){var l=t.getItemVisual(i,"color"),u=t.getItemVisual(i,"opacity"),h=t.getVisual("borderColor"),c=n.getModel("itemStyle"),d=n.getModel("emphasis.itemStyle").getBarItemStyle();s||e.setShape("r",c.get("barBorderRadius")||0),e.useStyle(Ve.defaults({stroke:iM(a)?"none":h,fill:iM(a)?"none":l,opacity:u},c.getBarItemStyle()));var p=n.getShallow("cursor");p&&e.attr("cursor",p);var f=o?a.height>0?"bottom":"top":a.width>0?"left":"right";s||US(e.style,d,n,l,r,i,f),iM(a)&&(d.fill=d.stroke="none"),tc.setHoverStyle(e,d)}var aM=bl.extend({type:"largeBar",shape:{points:[]},buildPath:function(e,t){for(var i=t.points,n=this.__startPoint,a=this.__baseDimIdx,r=0;r<i.length;r+=2)n[a]=i[r+a],e.moveTo(n[0],n[1]),e.lineTo(i[r],i[r+1])}});function rM(e,t,i){var n=e.getData(),a=[],r=n.getLayout("valueAxisHorizontal")?1:0;a[1-r]=n.getLayout("valueAxisStart");var o=n.getLayout("largeDataIndices"),s=n.getLayout("barWidth"),l=e.getModel("backgroundStyle");if(e.get("showBackground",!0)){var u=n.getLayout("largeBackgroundPoints"),h=[];h[1-r]=n.getLayout("backgroundStart");var c=new aM({shape:{points:u},incremental:!!i,__startPoint:h,__baseDimIdx:r,__largeDataIndices:o,__barWidth:s,silent:!0,z2:0});!function(e,t,i){var n=t.get("borderColor")||t.get("color"),a=t.getItemStyle(["color","borderColor"]);e.useStyle(a),e.style.fill=null,e.style.stroke=n,e.style.lineWidth=i.getLayout("barWidth")}(c,l,n),t.add(c)}var d=new aM({shape:{points:n.getLayout("largePoints")},incremental:!!i,__startPoint:a,__baseDimIdx:r,__largeDataIndices:o,__barWidth:s});t.add(d),function(e,t,i){var n=i.getVisual("borderColor")||i.getVisual("color"),a=t.getModel("itemStyle").getItemStyle(["color","borderColor"]);e.useStyle(a),e.style.fill=null,e.style.stroke=n,e.style.lineWidth=i.getLayout("barWidth")}(d,e,n),d.seriesIndex=e.seriesIndex,e.get("silent")||(d.on("mousedown",oM),d.on("mousemove",oM))}var oM=jS((function(e){var t=function(e,t,i){var n=e.__baseDimIdx,a=1-n,r=e.shape.points,o=e.__largeDataIndices,s=Math.abs(e.__barWidth/2),l=e.__startPoint[a];XS[0]=t,XS[1]=i;for(var u=XS[n],h=XS[1-n],c=u-s,d=u+s,p=0,f=r.length/2;p<f;p++){var g=2*p,m=r[g+n],v=r[g+a];if(m>=c&&m<=d&&(l<=v?h>=l&&h<=v:h>=v&&h<=l))return o[p]}return-1}(this,e.offsetX,e.offsetY);this.dataIndex=t>=0?t:null}),30,!1);function sM(e,t,i){var n,a="polar"===i.type;return n=a?i.getArea():i.grid.getRect(),a?{cx:n.cx,cy:n.cy,r0:e?n.r0:t.r0,r:e?n.r:t.r,startAngle:e?t.startAngle:0,endAngle:e?t.endAngle:2*Math.PI}:{x:e?t.x:n.x,y:e?n.y:t.y,width:e?t.width:n.width,height:e?n.height:t.height}}var lM=Ky.layout,uM=Ky.largeLayout;X_.registerLayout(X_.PRIORITY.VISUAL.LAYOUT,Ve.curry(lM,"bar")),X_.registerLayout(X_.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,uM),X_.registerVisual({seriesType:"bar",reset:function(e){e.getData().setVisual("legendSymbol","roundRect")}});var hM=Ve.extend,cM=Ve.isArray;var dM=function(e,t,i){t=cM(t)&&{coordDimensions:t}||hM({},t);var n=e.getSource(),a=qv(n,t),r=new Rv(a,e);return r.initData(n,i),r},pM={updateSelectedMap:function(e){this._targetList=Ve.isArray(e)?e.slice():[],this._selectTargetMap=Ve.reduce(e||[],(function(e,t){return e.set(t.name,t),e}),Ve.createHashMap())},select:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);"single"===this.get("selectedMode")&&this._selectTargetMap.each((function(e){e.selected=!1})),i&&(i.selected=!0)},unSelect:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);i&&(i.selected=!1)},toggleSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);if(null!=i)return this[i.selected?"unSelect":"select"](e,t),i.selected},isSelected:function(e,t){var i=null!=t?this._targetList[t]:this._selectTargetMap.get(e);return i&&i.selected}};var fM=function(e,t){this.getAllNames=function(){var e=t();return e.mapArray(e.getName)},this.containName=function(e){return t().indexOfName(e)>=0},this.indexOfName=function(t){return e().indexOfName(t)},this.getItemVisual=function(t,i){return e().getItemVisual(t,i)}},gM=Pc.getPercentWithPrecision,mM=Af.retrieveRawAttr,vM=tp.makeSeriesEncodeForNameBased,yM=X_.extendSeriesModel({type:"series.pie",init:function(e){yM.superApply(this,"init",arguments),this.legendVisualProvider=new fM(Ve.bind(this.getData,this),Ve.bind(this.getRawData,this)),this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(e)},mergeOption:function(e){yM.superCall(this,"mergeOption",e),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(e,t){return dM(this,{coordDimensions:["value"],encodeDefaulter:Ve.curry(vM,this)})},_createSelectableList:function(){for(var e=this.getRawData(),t=e.mapDimension("value"),i=[],n=0,a=e.count();n<a;n++)i.push({name:e.getName(n),value:e.get(t,n),selected:mM(e,n,"selected")});return i},getDataParams:function(e){var t=this.getData(),i=yM.superCall(this,"getDataParams",e),n=[];return t.each(t.mapDimension("value"),(function(e){n.push(e)})),i.percent=gM(n,e,t.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},_defaultLabelLine:function(e){Ro.defaultEmphasis(e,"labelLine",["show"]);var t=e.labelLine,i=e.emphasis.labelLine;t.show=t.show&&e.label.show,i.show=i.show&&e.emphasis.label.show},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,minShowLabelAngle:0,selectedOffset:10,hoverOffset:10,avoidLabelOverlap:!0,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:!1,show:!0,position:"outer",alignTo:"none",margin:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1},animationType:"expansion",animationTypeUpdate:"transition",animationEasing:"cubicOut"}});function xM(e,t,i,n){var a=t.getData(),r=this.dataIndex,o=a.getName(r),s=t.get("selectedOffset");n.dispatchAction({type:"pieToggleSelect",from:e,name:o,seriesId:t.id}),a.each((function(e){_M(a.getItemGraphicEl(e),a.getItemLayout(e),t.isSelected(a.getName(e)),s,i)}))}function _M(e,t,i,n,a){var r=(t.startAngle+t.endAngle)/2,o=i?n:0,s=[Math.cos(r)*o,Math.sin(r)*o];a?e.animate().when(200,{position:s}).start("bounceOut"):e.attr("position",s)}function bM(e,t){tc.Group.call(this);var i=new tc.Sector({z2:2}),n=new tc.Polyline,a=new tc.Text;this.add(i),this.add(n),this.add(a),this.updateData(e,t,!0)}Ve.mixin(yM,pM);var wM=bM.prototype;wM.updateData=function(e,t,i){var n=this.childAt(0),a=this.childAt(1),r=this.childAt(2),o=e.hostModel,s=e.getItemModel(t),l=e.getItemLayout(t),u=Ve.extend({},l);u.label=null;var h=o.getShallow("animationTypeUpdate");i?(n.setShape(u),"scale"===o.getShallow("animationType")?(n.shape.r=l.r0,tc.initProps(n,{shape:{r:l.r}},o,t)):(n.shape.endAngle=l.startAngle,tc.updateProps(n,{shape:{endAngle:l.endAngle}},o,t))):"expansion"===h?n.setShape(u):tc.updateProps(n,{shape:u},o,t);var c=e.getItemVisual(t,"color");n.useStyle(Ve.defaults({lineJoin:"bevel",fill:c},s.getModel("itemStyle").getItemStyle())),n.hoverStyle=s.getModel("emphasis.itemStyle").getItemStyle();var d=s.getShallow("cursor");d&&n.attr("cursor",d),_M(this,e.getItemLayout(t),o.isSelected(e.getName(t)),o.get("selectedOffset"),o.get("animation"));var p=!i&&"transition"===h;this._updateLabel(e,t,p),this.highDownOnUpdate=o.get("silent")?null:function(e,t){var i=o.isAnimationEnabled()&&s.get("hoverAnimation");"emphasis"===t?(a.ignore=a.hoverIgnore,r.ignore=r.hoverIgnore,i&&(n.stopAnimation(!0),n.animateTo({shape:{r:l.r+o.get("hoverOffset")}},300,"elasticOut"))):(a.ignore=a.normalIgnore,r.ignore=r.normalIgnore,i&&(n.stopAnimation(!0),n.animateTo({shape:{r:l.r}},300,"elasticOut")))},tc.setHoverStyle(this)},wM._updateLabel=function(e,t,i){var n=this.childAt(1),a=this.childAt(2),r=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,l=e.getItemVisual(t,"color");if(!s||isNaN(s.x)||isNaN(s.y))a.ignore=a.normalIgnore=a.hoverIgnore=n.ignore=n.normalIgnore=n.hoverIgnore=!0;else{var u={points:s.linePoints||[[s.x,s.y],[s.x,s.y],[s.x,s.y]]},h={x:s.x,y:s.y};i?(tc.updateProps(n,{shape:u},r,t),tc.updateProps(a,{style:h},r,t)):(n.attr({shape:u}),a.attr({style:h})),a.attr({rotation:s.rotation,origin:[s.x,s.y],z2:10});var c=o.getModel("label"),d=o.getModel("emphasis.label"),p=o.getModel("labelLine"),f=o.getModel("emphasis.labelLine");l=e.getItemVisual(t,"color");tc.setLabelStyle(a.style,a.hoverStyle={},c,d,{labelFetcher:e.hostModel,labelDataIndex:t,defaultText:s.text,autoColor:l,useInsideStyle:!!s.inside},{textAlign:s.textAlign,textVerticalAlign:s.verticalAlign,opacity:e.getItemVisual(t,"opacity")}),a.ignore=a.normalIgnore=!c.get("show"),a.hoverIgnore=!d.get("show"),n.ignore=n.normalIgnore=!p.get("show"),n.hoverIgnore=!f.get("show"),n.setStyle({stroke:l,opacity:e.getItemVisual(t,"opacity")}),n.setStyle(p.getModel("lineStyle").getLineStyle()),n.hoverStyle=f.getModel("lineStyle").getLineStyle();var g=p.get("smooth");g&&!0===g&&(g=.4),n.setShape({smooth:g})}},Ve.inherits(bM,tc.Group),Sg.extend({type:"pie",init:function(){var e=new tc.Group;this._sectorGroup=e},render:function(e,t,i,n){if(!n||n.from!==this.uid){var a=e.getData(),r=this._data,o=this.group,s=t.get("animation"),l=!r,u=e.get("animationType"),h=e.get("animationTypeUpdate"),c=Ve.curry(xM,this.uid,e,s,i),d=e.get("selectedMode");if(a.diff(r).add((function(e){var t=new bM(a,e);l&&"scale"!==u&&t.eachChild((function(e){e.stopAnimation(!0)})),d&&t.on("click",c),a.setItemGraphicEl(e,t),o.add(t)})).update((function(e,t){var i=r.getItemGraphicEl(t);l||"transition"===h||i.eachChild((function(e){e.stopAnimation(!0)})),i.updateData(a,e),i.off("click"),d&&i.on("click",c),o.add(i),a.setItemGraphicEl(e,i)})).remove((function(e){var t=r.getItemGraphicEl(e);o.remove(t)})).execute(),s&&a.count()>0&&(l?"scale"!==u:"transition"!==h)){for(var p=a.getItemLayout(0),f=1;isNaN(p.startAngle)&&f<a.count();++f)p=a.getItemLayout(f);var g=Math.max(i.getWidth(),i.getHeight())/2,m=Ve.bind(o.removeClipPath,o);o.setClipPath(this._createClipPath(p.cx,p.cy,g,p.startAngle,p.clockwise,m,e,l))}else o.removeClipPath();this._data=a}},dispose:function(){},_createClipPath:function(e,t,i,n,a,r,o,s){var l=new tc.Sector({shape:{cx:e,cy:t,r0:0,r:i,startAngle:n,endAngle:n,clockwise:a}});return(s?tc.initProps:tc.updateProps)(l,{shape:{endAngle:n+(a?1:-1)*Math.PI*2}},o,r),l},containPoint:function(e,t){var i=t.getData().getItemLayout(0);if(i){var n=e[0]-i.cx,a=e[1]-i.cy,r=Math.sqrt(n*n+a*a);return r<=i.r&&r>=i.r0}}});var SM=function(e,t){Ve.each(t,(function(t){t.update="updateView",X_.registerAction(t,(function(i,n){var a={};return n.eachComponent({mainType:"series",subType:e,query:i},(function(e){e[t.method]&&e[t.method](i.name,i.dataIndex);var n=e.getData();n.each((function(t){var i=n.getName(t);a[i]=e.isSelected(i)||!1}))})),{name:i.name,selected:a,seriesId:i.seriesId}}))}))},MM=Ve.createHashMap;var IM=function(e){return{getTargetSeries:function(t){var i={},n=MM();return t.eachSeriesByType(e,(function(e){e.__paletteScope=i,n.set(e.uid,e)})),n},reset:function(e,t){var i=e.getRawData(),n={},a=e.getData();a.each((function(e){var t=a.getRawIndex(e);n[t]=e})),i.each((function(t){var r,o=n[t],s=null!=o&&a.getItemVisual(o,"color",!0),l=null!=o&&a.getItemVisual(o,"borderColor",!0);if(s&&l||(r=i.getItemModel(t)),!s){var u=r.get("itemStyle.color")||e.getColorFromPalette(i.getName(t)||t+"",e.__paletteScope,i.count());null!=o&&a.setItemVisual(o,"color",u)}if(!l){var h=r.get("itemStyle.borderColor");null!=o&&a.setItemVisual(o,"borderColor",h)}}))}}},TM=Pc.parsePercent,AM=Math.PI/180;function CM(e,t,i,n,a,r,o,s,l,u){function h(t,i,n,a){for(var r=t;r<i&&!(e[r].y+n>l+o);r++)if(e[r].y+=n,r>t&&r+1<i&&e[r+1].y>e[r].y+e[r].height)return void c(r,n/2);c(i-1,n/2)}function c(t,i){for(var n=t;n>=0&&!(e[n].y-i<l)&&(e[n].y-=i,!(n>0&&e[n].y>e[n-1].y+e[n-1].height));n--);}function d(e,t,i,n,a,r){for(var o=t?Number.MAX_VALUE:0,s=0,l=e.length;s<l;s++)if("none"===e[s].labelAlignTo){var u=Math.abs(e[s].y-n),h=e[s].len,c=e[s].len2,d=u<a+h?Math.sqrt((a+h+c)*(a+h+c)-u*u):Math.abs(e[s].x-i);t&&d>=o&&(d=o-10),!t&&d<=o&&(d=o+10),e[s].x=i+d*r,o=d}}e.sort((function(e,t){return e.y-t.y}));for(var p,f=0,g=e.length,m=[],v=[],y=0;y<g;y++){if("outer"===e[y].position&&"labelLine"===e[y].labelAlignTo){var x=e[y].x-u;e[y].linePoints[1][0]+=x,e[y].x=u}(p=e[y].y-f)<0&&h(y,g,-p),f=e[y].y+e[y].height}o-f<0&&c(g-1,f-o);for(y=0;y<g;y++)e[y].y>=i?v.push(e[y]):m.push(e[y]);d(m,!1,t,i,n,a),d(v,!0,t,i,n,a)}function DM(e){return"center"===e.position}var LM=function(e,t,i,n,a,r){var o,s,l=e.getData(),u=[],h=!1,c=(e.get("minShowLabelAngle")||0)*AM;l.each((function(n){var r=l.getItemLayout(n),d=l.getItemModel(n),p=d.getModel("label"),f=p.get("position")||d.get("emphasis.label.position"),g=p.get("distanceToLabelLine"),m=p.get("alignTo"),v=TM(p.get("margin"),i),y=p.get("bleedMargin"),x=p.getFont(),_=d.getModel("labelLine"),b=_.get("length");b=TM(b,i);var w=_.get("length2");if(w=TM(w,i),!(r.angle<c)){var S,M,I,T,A=(r.startAngle+r.endAngle)/2,C=Math.cos(A),D=Math.sin(A);o=r.cx,s=r.cy;var L,P=e.getFormattedLabel(n,"normal")||l.getName(n),k=Wa.getBoundingRect(P,x,T,"top"),O="inside"===f||"inner"===f;if("center"===f)S=r.cx,M=r.cy,T="center";else{var R=(O?(r.r+r.r0)/2*C:r.r*C)+o,E=(O?(r.r+r.r0)/2*D:r.r*D)+s;if(S=R+3*C,M=E+3*D,!O){var N=R+C*(b+t-r.r),z=E+D*(b+t-r.r),B=N+(C<0?-1:1)*w;S="edge"===m?C<0?a+v:a+i-v:B+(C<0?-g:g),M=z,I=[[R,E],[N,z],[B,z]]}T=O?"center":"edge"===m?C>0?"right":"left":C>0?"left":"right"}var V=p.get("rotate");L="number"==typeof V?V*(Math.PI/180):V?C<0?-A+Math.PI:-A:0,h=!!L,r.label={x:S,y:M,position:f,height:k.height,len:b,len2:w,linePoints:I,textAlign:T,verticalAlign:"middle",rotation:L,inside:O,labelDistance:g,labelAlignTo:m,labelMargin:v,bleedMargin:y,textRect:k,text:P,font:x},O||u.push(r.label)}})),!h&&e.get("avoidLabelOverlap")&&function(e,t,i,n,a,r,o,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0;d<e.length;d++)DM(e[d])||(e[d].x<t?(h=Math.min(h,e[d].x),l.push(e[d])):(c=Math.max(c,e[d].x),u.push(e[d])));for(CM(u,t,i,n,1,0,r,0,s,c),CM(l,t,i,n,-1,0,r,0,s,h),d=0;d<e.length;d++){var p=e[d];if(!DM(p)){var f=p.linePoints;if(f){var g,m="edge"===p.labelAlignTo,v=p.textRect.width;(g=m?p.x<t?f[2][0]-p.labelDistance-o-p.labelMargin:o+a-p.labelMargin-f[2][0]-p.labelDistance:p.x<t?p.x-o-p.bleedMargin:o+a-p.x-p.bleedMargin)<p.textRect.width&&(p.text=Wa.truncateText(p.text,g,p.font),"edge"===p.labelAlignTo&&(v=Wa.getWidth(p.text,p.font)));var y=f[1][0]-f[2][0];m?p.x<t?f[2][0]=o+p.labelMargin+v+p.labelDistance:f[2][0]=o+a-p.labelMargin-v-p.labelDistance:(p.x<t?f[2][0]=p.x+p.labelDistance:f[2][0]=p.x-p.labelDistance,f[1][0]=f[2][0]+y),f[1][1]=f[2][1]=p.y}}}}(u,o,s,t,i,n,a,r)},PM=Pc.parsePercent,kM=Pc.linearMap,OM=2*Math.PI,RM=Math.PI/180;var EM=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),n=t.mapDimension("value"),a=function(e,t){return nd.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,i),r=e.get("center"),o=e.get("radius");Ve.isArray(o)||(o=[0,o]),Ve.isArray(r)||(r=[r,r]);var s=PM(a.width,i.getWidth()),l=PM(a.height,i.getHeight()),u=Math.min(s,l),h=PM(r[0],s)+a.x,c=PM(r[1],l)+a.y,d=PM(o[0],u/2),p=PM(o[1],u/2),f=-e.get("startAngle")*RM,g=e.get("minAngle")*RM,m=0;t.each(n,(function(e){!isNaN(e)&&m++}));var v=t.getSum(n),y=Math.PI/(v||m)*2,x=e.get("clockwise"),_=e.get("roseType"),b=e.get("stillShowZeroSum"),w=t.getDataExtent(n);w[0]=0;var S=OM,M=0,I=f,T=x?1:-1;if(t.each(n,(function(e,i){var n;if(isNaN(e))t.setItemLayout(i,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:x,cx:h,cy:c,r0:d,r:_?NaN:p,viewRect:a});else{(n="area"!==_?0===v&&b?y:e*y:OM/m)<g?(n=g,S-=g):M+=e;var r=I+T*n;t.setItemLayout(i,{angle:n,startAngle:I,endAngle:r,clockwise:x,cx:h,cy:c,r0:d,r:_?kM(e,w,[d,p]):p,viewRect:a}),I=r}})),S<OM&&m)if(S<=.001){var A=OM/m;t.each(n,(function(e,i){if(!isNaN(e)){var n=t.getItemLayout(i);n.angle=A,n.startAngle=f+T*i*A,n.endAngle=f+T*(i+1)*A}}))}else y=S/M,I=f,t.each(n,(function(e,i){if(!isNaN(e)){var n=t.getItemLayout(i),a=n.angle===g?g:e*y;n.startAngle=I,n.endAngle=I+T*a,I+=T*a}}));LM(e,p,a.width,a.height,a.x,a.y)}))};var NM=function(e){return{seriesType:e,reset:function(e,t){var i=t.findComponents({mainType:"legend"});if(i&&i.length){var n=e.getData();n.filterSelf((function(e){for(var t=n.getName(e),a=0;a<i.length;a++)if(!i[a].isSelected(t))return!1;return!0}))}}}};SM("pie",[{type:"pieToggleSelect",event:"pieselectchanged",method:"toggleSelected"},{type:"pieSelect",event:"pieselected",method:"select"},{type:"pieUnSelect",event:"pieunselected",method:"unSelect"}]),X_.registerVisual(IM("pie")),X_.registerLayout(Ve.curry(EM,"pie")),X_.registerProcessor(NM("pie")),og.extend({type:"series.scatter",dependencies:["grid","polar","geo","singleAxis","calendar"],getInitialData:function(e,t){return py(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?5e3:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?1e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},clip:!0}});var zM=jx.createSymbol,BM=tc.extendShape({shape:{points:null},symbolProxy:null,softClipShape:null,buildPath:function(e,t){var i=t.points,n=t.size,a=this.symbolProxy,r=a.shape;if(!((e.getContext?e.getContext():e)&&n[0]<4))for(var o=0;o<i.length;){var s=i[o++],l=i[o++];isNaN(s)||isNaN(l)||(this.softClipShape&&!this.softClipShape.contain(s,l)||(r.x=s-n[0]/2,r.y=l-n[1]/2,r.width=n[0],r.height=n[1],a.buildPath(e,r,!0)))}},afterBrush:function(e){var t=this.shape,i=t.points,n=t.size;if(n[0]<4){this.setTransform(e);for(var a=0;a<i.length;){var r=i[a++],o=i[a++];isNaN(r)||isNaN(o)||(this.softClipShape&&!this.softClipShape.contain(r,o)||e.fillRect(r-n[0]/2,o-n[1]/2,n[0],n[1]))}this.restoreTransform(e)}},findDataIndex:function(e,t){for(var i=this.shape,n=i.points,a=i.size,r=Math.max(a[0],4),o=Math.max(a[1],4),s=n.length/2-1;s>=0;s--){var l=2*s,u=n[l]-r/2,h=n[l+1]-o/2;if(e>=u&&t>=h&&e<=u+r&&t<=h+o)return s}return-1}});function VM(){this.group=new tc.Group}var FM=VM.prototype;FM.isPersistent=function(){return!this._incremental},FM.updateData=function(e,t){this.group.removeAll();var i=new BM({rectHover:!0,cursor:"default"});i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!1,t),this.group.add(i),this._incremental=null},FM.updateLayout=function(e){if(!this._incremental){var t=e.getLayout("symbolPoints");this.group.eachChild((function(e){if(null!=e.startIndex){var i=2*(e.endIndex-e.startIndex),n=4*e.startIndex*2;t=new Float32Array(t.buffer,n,i)}e.setShape("points",t)}))}},FM.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new Wu({silent:!0})),this.group.add(this._incremental)):this._incremental=null},FM.incrementalUpdate=function(e,t,i){var n;this._incremental?(n=new BM,this._incremental.addDisplayable(n,!0)):((n=new BM({rectHover:!0,cursor:"default",startIndex:e.start,endIndex:e.end})).incremental=!0,this.group.add(n)),n.setShape({points:t.getLayout("symbolPoints")}),this._setCommon(n,t,!!this._incremental,i)},FM._setCommon=function(e,t,i,n){var a=t.hostModel;n=n||{};var r=t.getVisual("symbolSize");e.setShape("size",r instanceof Array?r:[r,r]),e.softClipShape=n.clipShape||null,e.symbolProxy=zM(t.getVisual("symbol"),0,0,0,0),e.setColor=e.symbolProxy.setColor;var o=e.shape.size[0]<4;e.useStyle(a.getModel("itemStyle").getItemStyle(o?["color","shadowBlur","shadowColor"]:["color"]));var s=t.getVisual("color");s&&e.setColor(s),i||(e.seriesIndex=a.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>=0&&(e.dataIndex=i+(e.startIndex||0))})))},FM.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},FM._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var GM=VM;function HM(e,t,i){L_.call(this,e,t,i),this.type="value",this.angle=0,this.name="",this.model}X_.extendChartView({type:"scatter",render:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).updateData(n,{clipShape:this._getClipShape(e)}),this._finished=!0},incrementalPrepareRender:function(e,t,i){var n=e.getData();this._updateSymbolDraw(n,e).incrementalPrepareUpdate(n),this._finished=!1},incrementalRender:function(e,t,i){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},updateTransform:function(e,t,i){var n=e.getData();if(this.group.dirty(),!this._finished||n.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var a=sw().reset(e);a.progress&&a.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_getClipShape:function(e){var t=e.coordinateSystem,i=t&&t.getArea&&t.getArea();return e.get("clip",!0)?i:null},_updateSymbolDraw:function(e,t){var i=this._symbolDraw,n=t.pipelineContext.large;return i&&n===this._isLargeDraw||(i&&i.remove(),i=this._symbolDraw=n?new GM:new yb,this._isLargeDraw=n,this.group.removeAll()),this.group.add(i.group),i},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}}),X_.registerVisual(aw("scatter","circle")),X_.registerLayout(sw("scatter")),Ve.inherits(HM,L_);var WM=HM,UM=Px.getScaleExtent,jM=Px.niceScaleExtent;function ZM(e,t,i){this._model=e,this.dimensions=[],this._indicatorAxes=Ve.map(e.getIndicatorModels(),(function(e,t){var i="indicator_"+t,n=new WM(i,"log"===e.get("axisType")?new vx:new Ry);return n.name=e.get("name"),n.model=e,e.axis=n,this.dimensions.push(i),n}),this),this.resize(e,i),this.cx,this.cy,this.r,this.r0,this.startAngle}ZM.prototype.getIndicatorAxes=function(){return this._indicatorAxes},ZM.prototype.dataToPoint=function(e,t){var i=this._indicatorAxes[t];return this.coordToPoint(i.dataToCoord(e),t)},ZM.prototype.coordToPoint=function(e,t){var i=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(i),this.cy-e*Math.sin(i)]},ZM.prototype.pointToData=function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=Math.sqrt(t*t+i*i);t/=n,i/=n;for(var a,r=Math.atan2(-i,t),o=1/0,s=-1,l=0;l<this._indicatorAxes.length;l++){var u=this._indicatorAxes[l],h=Math.abs(r-u.angle);h<o&&(a=u,s=l,o=h)}return[s,+(a&&a.coordToData(n))]},ZM.prototype.resize=function(e,t){var i=e.get("center"),n=t.getWidth(),a=t.getHeight(),r=Math.min(n,a)/2;this.cx=Pc.parsePercent(i[0],n),this.cy=Pc.parsePercent(i[1],a),this.startAngle=e.get("startAngle")*Math.PI/180;var o=e.get("radius");"string"!=typeof o&&"number"!=typeof o||(o=[0,o]),this.r0=Pc.parsePercent(o[0],r),this.r=Pc.parsePercent(o[1],r),Ve.each(this._indicatorAxes,(function(e,t){e.setExtent(this.r0,this.r);var i=this.startAngle+t*Math.PI*2/this._indicatorAxes.length;i=Math.atan2(Math.sin(i),Math.cos(i)),e.angle=i}),this)},ZM.prototype.update=function(e,t){var i=this._indicatorAxes,n=this._model;Ve.each(i,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeriesByType("radar",(function(t,a){if("radar"===t.get("coordinateSystem")&&e.getComponent("radar",t.get("radarIndex"))===n){var r=t.getData();Ve.each(i,(function(e){e.scale.unionExtentFromData(r,r.mapDimension(e.dim))}))}}),this);var a=n.get("splitNumber");function r(e){var t=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),i=e/t;return 2===i?i=5:i*=2,i*t}Ve.each(i,(function(e,t){var i=UM(e.scale,e.model).extent;jM(e.scale,e.model);var n=e.model,o=e.scale,s=n.getMin(),l=n.getMax(),u=o.getInterval();if(null!=s&&null!=l)o.setExtent(+s,+l),o.setInterval((l-s)/a);else if(null!=s){do{h=s+u*a,o.setExtent(+s,h),o.setInterval(u),u=r(u)}while(h<i[1]&&isFinite(h)&&isFinite(i[1]))}else if(null!=l){do{c=l-u*a,o.setExtent(c,+l),o.setInterval(u),u=r(u)}while(c>i[0]&&isFinite(c)&&isFinite(i[0]))}else{o.getTicks().length-1>a&&(u=r(u));var h=Math.ceil(i[1]/u)*u,c=Pc.round(h-u*a);o.setExtent(c,h),o.setInterval(u)}}))},ZM.dimensions=[],ZM.create=function(e,t){var i=[];return e.eachComponent("radar",(function(n){var a=new ZM(n,e,t);i.push(a),n.coordinateSystem=a})),e.eachSeriesByType("radar",(function(e){"radar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("radarIndex")||0])})),i},Tp.register("radar",ZM);var YM=_w.valueAxis;function XM(e,t){return Ve.defaults({show:t},e)}X_.extendComponentModel({type:"radar",optionUpdated:function(){var e=this.get("boundaryGap"),t=this.get("splitNumber"),i=this.get("scale"),n=this.get("axisLine"),a=this.get("axisTick"),r=this.get("axisType"),o=this.get("axisLabel"),s=this.get("name"),l=this.get("name.show"),u=this.get("name.formatter"),h=this.get("nameGap"),c=this.get("triggerEvent"),d=Ve.map(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;if(null!=d.color&&(p=Ve.defaults({color:d.color},s)),d=Ve.merge(Ve.clone(d),{boundaryGap:e,splitNumber:t,scale:i,axisLine:n,axisTick:a,axisType:r,axisLabel:o,name:d.text,nameLocation:"end",nameGap:h,nameTextStyle:p,triggerEvent:c},!1),l||(d.name=""),"string"==typeof u){var f=d.name;d.name=u.replace("{value}",null!=f?f:"")}else"function"==typeof u&&(d.name=u(d.name,d));var g=Ve.extend(new mc(d,null,this.ecModel),Ox);return g.mainType="radar",g.componentIndex=this.componentIndex,g}),this);this.getIndicatorModels=function(){return d}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:Ve.merge({lineStyle:{color:"#bbb"}},YM.axisLine),axisLabel:XM(YM.axisLabel,!1),axisTick:XM(YM.axisTick,!1),axisType:"interval",splitLine:XM(YM.splitLine,!0),splitArea:XM(YM.splitArea,!0),indicator:[]}});var qM=["axisLine","axisTickLabel","axisName"];X_.extendComponentView({type:"radar",render:function(e,t,i){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},_buildAxes:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes(),n=Ve.map(i,(function(e){return new cS(e.model,{position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}));Ve.each(n,(function(e){Ve.each(qM,e.add,e),this.group.add(e.getGroup())}),this)},_buildSplitLineAndArea:function(e){var t=e.coordinateSystem,i=t.getIndicatorAxes();if(i.length){var n=e.get("shape"),a=e.getModel("splitLine"),r=e.getModel("splitArea"),o=a.getModel("lineStyle"),s=r.getModel("areaStyle"),l=a.get("show"),u=r.get("show"),h=o.get("color"),c=s.get("color");h=Ve.isArray(h)?h:[h],c=Ve.isArray(c)?c:[c];var d=[],p=[];if("circle"===n)for(var f=i[0].getTicksCoords(),g=t.cx,m=t.cy,v=0;v<f.length;v++){if(l)d[I(d,h,v)].push(new tc.Circle({shape:{cx:g,cy:m,r:f[v].coord}}));if(u&&v<f.length-1)p[I(p,c,v)].push(new tc.Ring({shape:{cx:g,cy:m,r0:f[v].coord,r:f[v+1].coord}}))}else{var y,x=Ve.map(i,(function(e,i){var n=e.getTicksCoords();return y=null==y?n.length-1:Math.min(n.length-1,y),Ve.map(n,(function(e){return t.coordToPoint(e.coord,i)}))})),_=[];for(v=0;v<=y;v++){for(var b=[],w=0;w<i.length;w++)b.push(x[w][v]);if(b[0]&&b.push(b[0].slice()),l)d[I(d,h,v)].push(new tc.Polyline({shape:{points:b}}));if(u&&_)p[I(p,c,v-1)].push(new tc.Polygon({shape:{points:b.concat(_)}}));_=b.slice().reverse()}}var S=o.getLineStyle(),M=s.getAreaStyle();Ve.each(p,(function(e,t){this.group.add(tc.mergePath(e,{style:Ve.defaults({stroke:"none",fill:c[t%c.length]},M),silent:!0}))}),this),Ve.each(d,(function(e,t){this.group.add(tc.mergePath(e,{style:Ve.defaults({fill:"none",stroke:h[t%h.length]},S),silent:!0}))}),this)}function I(e,t,i){var n=i%t.length;return e[n]=e[n]||[],n}}});var $M=Uc.encodeHTML,KM=og.extend({type:"series.radar",dependencies:["radar"],init:function(e){KM.superApply(this,"init",arguments),this.legendVisualProvider=new fM(Ve.bind(this.getData,this),Ve.bind(this.getRawData,this))},getInitialData:function(e,t){return dM(this,{generateCoord:"indicator_",generateCoordCount:1/0})},formatTooltip:function(e){var t=this.getData(),i=this.coordinateSystem.getIndicatorAxes(),n=this.getData().getName(e);return $M(""===n?this.name:n)+"<br/>"+Ve.map(i,(function(i,n){var a=t.get(t.mapDimension(i.dim),e);return $M(i.name+" : "+a)})).join("<br />")},getTooltipPosition:function(e){if(null!=e)for(var t=this.getData(),i=this.coordinateSystem,n=t.getValues(Ve.map(i.dimensions,(function(e){return t.mapDimension(e)})),e,!0),a=0,r=n.length;a<r;a++)if(!isNaN(n[a])){var o=i.getIndicatorAxes();return i.coordToPoint(o[a].dataToCoord(n[a]),a)}},defaultOption:{zlevel:0,z:2,coordinateSystem:"radar",legendHoverLink:!0,radarIndex:0,lineStyle:{width:2,type:"solid"},label:{position:"top"},symbol:"emptyCircle",symbolSize:4}});function JM(e){return!isNaN(e[0])&&!isNaN(e[1])}function QM(e){return[e.cx,e.cy]}X_.extendChartView({type:"radar",render:function(e,t,i){var n=e.coordinateSystem,a=this.group,r=e.getData(),o=this._data;function s(e,t){var i=e.getItemVisual(t,"symbol")||"circle",n=e.getItemVisual(t,"color");if("none"!==i){var a=function(e){return Ve.isArray(e)||(e=[+e,+e]),e}(e.getItemVisual(t,"symbolSize")),r=jx.createSymbol(i,-1,-1,2,2,n);return r.attr({style:{strokeNoScale:!0},z2:100,scale:[a[0]/2,a[1]/2]}),r}}function l(t,i,n,a,r,o){n.removeAll();for(var l=0;l<i.length-1;l++){var u=s(a,r);u&&(u.__dimIdx=l,t[l]?(u.attr("position",t[l]),tc[o?"initProps":"updateProps"](u,{position:i[l]},e,r)):u.attr("position",i[l]),n.add(u))}}function u(e){return Ve.map(e,(function(e){return[n.cx,n.cy]}))}r.diff(o).add((function(t){var i=r.getItemLayout(t);if(i){var n=new tc.Polygon,a=new tc.Polyline,o={shape:{points:i}};n.shape.points=u(i),a.shape.points=u(i),tc.initProps(n,o,e,t),tc.initProps(a,o,e,t);var s=new tc.Group,h=new tc.Group;s.add(a),s.add(n),s.add(h),l(a.shape.points,i,h,r,t,!0),r.setItemGraphicEl(t,s)}})).update((function(t,i){var n=o.getItemGraphicEl(i),a=n.childAt(0),s=n.childAt(1),u=n.childAt(2),h={shape:{points:r.getItemLayout(t)}};h.shape.points&&(l(a.shape.points,h.shape.points,u,r,t,!1),tc.updateProps(a,h,e),tc.updateProps(s,h,e),r.setItemGraphicEl(t,n))})).remove((function(e){a.remove(o.getItemGraphicEl(e))})).execute(),r.eachItemGraphicEl((function(e,t){var i=r.getItemModel(t),n=e.childAt(0),o=e.childAt(1),s=e.childAt(2),l=r.getItemVisual(t,"color");a.add(e),n.useStyle(Ve.defaults(i.getModel("lineStyle").getLineStyle(),{fill:"none",stroke:l})),n.hoverStyle=i.getModel("emphasis.lineStyle").getLineStyle();var u=i.getModel("areaStyle"),h=i.getModel("emphasis.areaStyle"),c=u.isEmpty()&&u.parentModel.isEmpty(),d=h.isEmpty()&&h.parentModel.isEmpty();d=d&&c,o.ignore=c,o.useStyle(Ve.defaults(u.getAreaStyle(),{fill:l,opacity:.7})),o.hoverStyle=h.getAreaStyle();var p=i.getModel("itemStyle").getItemStyle(["color"]),f=i.getModel("emphasis.itemStyle").getItemStyle(),g=i.getModel("label"),m=i.getModel("emphasis.label");s.eachChild((function(e){e.setStyle(p),e.hoverStyle=Ve.clone(f);var i=r.get(r.dimensions[e.__dimIdx],t);(null==i||isNaN(i))&&(i=""),tc.setLabelStyle(e.style,e.hoverStyle,g,m,{labelFetcher:r.hostModel,labelDataIndex:t,labelDimIndex:e.__dimIdx,defaultText:i,autoColor:l,isRectText:!0})})),e.highDownOnUpdate=function(e,t){o.attr("ignore","emphasis"===t?d:c)},tc.setHoverStyle(e)})),this._data=r},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var eI=function(e){e.eachSeriesByType("radar",(function(e){var t=e.getData(),i=[],n=e.coordinateSystem;if(n){var a=n.getIndicatorAxes();Ve.each(a,(function(e,r){t.each(t.mapDimension(a[r].dim),(function(e,t){i[t]=i[t]||[];var a=n.dataToPoint(e,r);i[t][r]=JM(a)?a:QM(n)}))})),t.each((function(e){var a=Ve.find(i[e],(function(e){return JM(e)}))||QM(n);i[e].push(a.slice()),t.setItemLayout(e,i[e])}))}}))};var tI=function(e){var t=e.polar;if(t){Ve.isArray(t)||(t=[t]);var i=[];Ve.each(t,(function(t,n){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],Ve.isArray(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):i.push(t)})),e.polar=i}Ve.each(e.series,(function(e){e&&"radar"===e.type&&e.polarIndex&&(e.radarIndex=e.polarIndex)}))};X_.registerVisual(IM("radar")),X_.registerVisual(aw("radar","circle")),X_.registerLayout(eI),X_.registerProcessor(NM("radar")),X_.registerPreprocessor(tI);for(var iI=[126,25],nI=[[[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]]],aI=0;aI<nI.length;aI++)for(var rI=0;rI<nI[aI].length;rI++)nI[aI][rI][0]/=10.5,nI[aI][rI][1]/=-14,nI[aI][rI][0]+=iI[0],nI[aI][rI][1]+=iI[1];var oI=function(e,t){"china"===e&&t.push(new a_("南海诸岛",Ve.map(nI,(function(e){return{type:"polygon",exterior:e}})),iI))},sI={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};var lI=function(e,t){if("china"===e){var i=sI[t.name];if(i){var n=t.center;n[0]+=i[0]/10.5,n[1]+=-i[1]/14}}},uI={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};var hI=function(e,t){if("world"===e){var i=uI[t.name];if(i){var n=t.center;n[0]=i[0],n[1]=i[1]}}},cI=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var dI=function(e,t){"china"===e&&"台湾"===t.name&&t.geometries.push({type:"polygon",exterior:cI[0]})},pI=Ve.each,fI=(0,Ro.makeInner)();function gI(e){for(var t,i=0;i<e.length;i++){var n=e[i].getBoundingRect();(t=t||n.clone()).union(n)}return t}var mI={load:function(e,t,i){var n=fI(t).parsed;if(n)return n;var a,r=t.specialAreas||{},o=t.geoJSON;try{a=o?o_(o,i):[]}catch(e){throw new Error("Invalid geoJson format\n"+e.message)}return oI(e,a),pI(a,(function(t){var i=t.name;lI(e,t),hI(e,t),dI(e,t);var n=r[i];n&&t.transformTo(n.left,n.top,n.width,n.height)})),fI(t).parsed={regions:a,boundingRect:gI(a)}}},vI=Hm.parseSVG,yI=Hm.makeViewBoxTransform,xI=Ve.assert,_I=Ve.createHashMap,bI=(0,Ro.makeInner)(),wI={load:function(e,t){var i=bI(t).originRoot;if(i)return{root:i,boundingRect:bI(t).boundingRect};var n=SI(t);return bI(t).originRoot=n.root,bI(t).boundingRect=n.boundingRect,n},makeGraphic:function(e,t,i){var n=bI(t),a=n.rootMap||(n.rootMap=_I()),r=a.get(i);if(r)return r;var o=n.originRoot,s=n.boundingRect;return n.originRootHostKey?r=SI(t,s).root:(n.originRootHostKey=i,r=o),a.set(i,r)},removeGraphic:function(e,t,i){var n=bI(t),a=n.rootMap;a&&a.removeKey(i),i===n.originRootHostKey&&(n.originRootHostKey=null)}};function SI(e,t){var i,n,a=e.svgXML;try{n=(i=a&&vI(a,{ignoreViewBox:!0,ignoreRootClip:!0})||{}).root,xI(null!=n)}catch(e){throw new Error("Invalid svg format\n"+e.message)}var r=i.width,o=i.height,s=i.viewBoxRect;if(t||(t=null==r||null==o?n.getBoundingRect():new Pn(0,0,0,0),null!=r&&(t.width=r),null!=o&&(t.height=o)),s){var l=yI(s,t.width,t.height),u=n;(n=new On).add(u),u.scale=l.scale,u.position=l.position}return n.setClipPath(new yu({shape:t.plain()})),{root:n,boundingRect:t}}var MI=wI,II=Ve.each,TI=Ve.createHashMap,AI={geoJSON:mI,svg:MI};function CI(e){return function(t,i){var n=DI(t),a=[];return II(n,(function(n){var r=AI[n.type][e];r&&a.push(r(t,n,i))})),a}}function DI(e){return Km.retrieveMap(e)||[]}var LI={load:function(e,t,i){var n,a=[],r=TI(),o=TI(),s=DI(e);return II(s,(function(s){var l=AI[s.type].load(e,s,i);II(l.regions,(function(e){var i=e.name;t&&t.hasOwnProperty(i)&&(e=e.cloneShallow(i=t[i])),a.push(e),r.set(i,e),o.set(i,e.center)}));var u=l.boundingRect;u&&(n?n.union(u):n=u.clone())})),{regions:a,regionsMap:r,nameCoordMap:o,boundingRect:n||new Pn(0,0,0,0)}},makeGraphic:CI("makeGraphic"),removeGraphic:CI("removeGraphic")},PI=Uc.encodeHTML,kI=Uc.addCommas,OI=Af.retrieveRawAttr,RI=tp.makeSeriesEncodeForNameBased,EI=og.extend({type:"series.map",dependencies:["geo"],layoutMode:"box",needsDrawMap:!1,seriesGroup:[],getInitialData:function(e){for(var t=dM(this,{coordDimensions:["value"],encodeDefaulter:Ve.curry(RI,this)}),i=t.mapDimension("value"),n=Ve.createHashMap(),a=[],r=[],o=0,s=t.count();o<s;o++){var l=t.getName(o);n.set(l,!0),a.push({name:l,value:t.get(i,o),selected:OI(t,o,"selected")})}var u=LI.load(this.getMapType(),this.option.nameMap,this.option.nameProperty);return Ve.each(u.regions,(function(e){var t=e.name;n.get(t)||(a.push({name:t}),r.push(t))})),this.updateSelectedMap(a),t.appendValues([],r),t},getHostGeoModel:function(){var e=this.option.geoIndex;return null!=e?this.dependentModels.geo[e]:null},getMapType:function(){return(this.getHostGeoModel()||this).option.map},getRawValue:function(e){var t=this.getData();return t.get(t.mapDimension("value"),e)},getRegionModel:function(e){var t=this.getData();return t.getItemModel(t.indexOfName(e))},formatTooltip:function(e){for(var t=this.getData(),i=kI(this.getRawValue(e)),n=t.getName(e),a=this.seriesGroup,r=[],o=0;o<a.length;o++){var s=a[o].originalData.indexOfName(n),l=t.mapDimension("value");isNaN(a[o].originalData.get(l,s))||r.push(PI(a[o].name))}return r.join(", ")+"<br />"+PI(n+" : "+i)},getTooltipPosition:function(e){if(null!=e){var t=this.getData().getName(e),i=this.coordinateSystem,n=i.getRegion(t);return n&&i.dataToPoint(n.center)}},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},nameProperty:"name"}});Ve.mixin(EI,pM);var NI="\0_ec_interaction_mutex";function zI(e){return e[NI]||(e[NI]={})}X_.registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},(function(){}));var BI={take:function(e,t,i){zI(e)[t]=i},release:function(e,t,i){var n=zI(e);n[t]===i&&(n[t]=null)},isTaken:function(e,t){return!!zI(e)[t]}};function VI(e){this.pointerChecker,this._zr=e,this._opt={};var t=Ve.bind,i=t(FI,this),n=t(GI,this),a=t(HI,this),r=t(WI,this),o=t(UI,this);gt.call(this),this.setPointerChecker=function(e){this.pointerChecker=e},this.enable=function(t,s){this.disable(),this._opt=Ve.defaults(Ve.clone(s)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(e.on("mousedown",i),e.on("mousemove",n),e.on("mouseup",a)),!0!==t&&"scale"!==t&&"zoom"!==t||(e.on("mousewheel",r),e.on("pinch",o))},this.disable=function(){e.off("mousedown",i),e.off("mousemove",n),e.off("mouseup",a),e.off("mousewheel",r),e.off("pinch",o)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function FI(e){if(!(Et.isMiddleOrRightButtonOnMouseUpDown(e)||e.target&&e.target.draggable)){var t=e.offsetX,i=e.offsetY;this.pointerChecker&&this.pointerChecker(e,t,i)&&(this._x=t,this._y=i,this._dragging=!0)}}function GI(e){if(this._dragging&&YI("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!BI.isTaken(this._zr,"globalPan")){var t=e.offsetX,i=e.offsetY,n=this._x,a=this._y,r=t-n,o=i-a;this._x=t,this._y=i,this._opt.preventDefaultMouseMove&&Et.stop(e.event),ZI(this,"pan","moveOnMouseMove",e,{dx:r,dy:o,oldX:n,oldY:a,newX:t,newY:i})}}function HI(e){Et.isMiddleOrRightButtonOnMouseUpDown(e)||(this._dragging=!1)}function WI(e){var t=YI("zoomOnMouseWheel",e,this._opt),i=YI("moveOnMouseWheel",e,this._opt),n=e.wheelDelta,a=Math.abs(n),r=e.offsetX,o=e.offsetY;if(0!==n&&(t||i)){if(t){var s=a>3?1.4:a>1?1.2:1.1;jI(this,"zoom","zoomOnMouseWheel",e,{scale:n>0?s:1/s,originX:r,originY:o})}if(i){var l=Math.abs(n);jI(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(n>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:o})}}}function UI(e){BI.isTaken(this._zr,"globalPan")||jI(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY})}function jI(e,t,i,n,a){e.pointerChecker&&e.pointerChecker(n,a.originX,a.originY)&&(Et.stop(n.event),ZI(e,t,i,n,a))}function ZI(e,t,i,n,a){a.isAvailableBehavior=Ve.bind(YI,null,i,n),e.trigger(t,a)}function YI(e,t,i){var n=i[e];return!e||n&&(!Ve.isString(n)||t.event[n+"Key"])}Ve.mixin(VI,gt);var XI=VI;var qI=function(e,t,i,n){var a=e.target,r=e.zoomLimit,o=a.position,s=a.scale,l=e.zoom=e.zoom||1;if(l*=t,r){var u=r.min||0,h=r.max||1/0;l=Math.max(Math.min(h,l),u)}var c=l/e.zoom;e.zoom=l,o[0]-=(i-o[0])*(c-1),o[1]-=(n-o[1])*(c-1),s[0]*=c,s[1]*=c,a.dirty()},$I={updateViewOnPan:function(e,t,i){var n=e.target,a=n.position;a[0]+=t,a[1]+=i,n.dirty()},updateViewOnZoom:qI},KI={axisPointer:1,tooltip:1,brush:1};var JI=function(e,t,i){var n=t.getComponentByElement(e.topTarget),a=n&&n.coordinateSystem;return n&&n!==i&&!KI[n.mainType]&&a&&a.model!==i},QI={onIrrelevantElement:JI},eT=QI.onIrrelevantElement,tT=xc.getUID;function iT(e){var t=e.getItemStyle(),i=e.get("areaColor");return null!=i&&(t.fill=i),t}function nT(e,t){t.eachChild((function(t){Ve.each(t.__regions,(function(i){t.trigger(e.isSelected(i.name)?"emphasis":"normal")}))}))}function aT(e,t){var i=new tc.Group;this.uid=tT("ec_map_draw"),this._controller=new XI(e.getZr()),this._controllerHost={target:t?i:null},this.group=i,this._updateGroup=t,this._mouseDownFlag,this._mapName,this._initialized,i.add(this._regionsGroup=new tc.Group),i.add(this._backgroundGroup=new tc.Group)}aT.prototype={constructor:aT,draw:function(e,t,i,n,a){var r="geo"===e.mainType,o=e.getData&&e.getData();r&&t.eachComponent({mainType:"series",subType:"map"},(function(t){o||t.getHostGeoModel()!==e||(o=t.getData())}));var s=e.coordinateSystem;this._updateBackground(s);var l,u=this._regionsGroup,h=this.group,c=s.getTransformInfo(),d=!u.childAt(0)||a;if(d)h.transform=c.roamTransform,h.decomposeTransform(),h.dirty();else{var p=new di;p.transform=c.roamTransform,p.decomposeTransform();var f={scale:p.scale,position:p.position};l=p.scale,tc.updateProps(h,f,e)}var g=c.rawScale,m=c.rawPosition;u.removeAll();var v=["itemStyle"],y=["emphasis","itemStyle"],x=["label"],_=["emphasis","label"],b=Ve.createHashMap();Ve.each(s.regions,(function(t){var i=b.get(t.name)||b.set(t.name,new tc.Group),n=new tc.CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});i.add(n);var a,s=(R=e.getRegionModel(t.name)||e).getModel(v),c=R.getModel(y),p=iT(s),f=iT(c),w=R.getModel(x),S=R.getModel(_);if(o){a=o.indexOfName(t.name);var M=o.getItemVisual(a,"color",!0);M&&(p.fill=M)}var I=function(e){return[e[0]*g[0]+m[0],e[1]*g[1]+m[1]]};Ve.each(t.geometries,(function(e){if("polygon"===e.type){for(var t=[],i=0;i<e.exterior.length;++i)t.push(I(e.exterior[i]));n.shape.paths.push(new tc.Polygon({segmentIgnoreThreshold:1,shape:{points:t}}));for(i=0;i<(e.interiors?e.interiors.length:0);++i){for(var a=e.interiors[i],r=(t=[],0);r<a.length;++r)t.push(I(a[r]));n.shape.paths.push(new tc.Polygon({segmentIgnoreThreshold:1,shape:{points:t}}))}}})),n.setStyle(p),n.style.strokeNoScale=!0,n.culling=!0;var T=w.get("show"),A=S.get("show"),C=o&&isNaN(o.get(o.mapDimension("value"),a)),D=o&&o.getItemLayout(a);if(r||C&&(T||A)||D&&D.showLabel){var L,P=r?t.name:a;(!o||a>=0)&&(L=e);var k=new tc.Text({position:I(t.center.slice()),scale:[1/h.scale[0],1/h.scale[1]],z2:10,silent:!0});if(tc.setLabelStyle(k.style,k.hoverStyle={},w,S,{labelFetcher:L,labelDataIndex:P,defaultText:t.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),!d){var O=[1/l[0],1/l[1]];tc.updateProps(k,{scale:O},e)}i.add(k)}if(o)o.setItemGraphicEl(a,i);else{var R=e.getRegionModel(t.name);n.eventData={componentType:"geo",componentIndex:e.componentIndex,geoIndex:e.componentIndex,name:t.name,region:R&&R.option||{}}}(i.__regions||(i.__regions=[])).push(t),i.highDownSilentOnTouch=!!e.get("selectedMode"),tc.setHoverStyle(i,f),u.add(i)})),this._updateController(e,t,i),function(e,t,i,n,a){i.off("click"),i.off("mousedown"),t.get("selectedMode")&&(i.on("mousedown",(function(){e._mouseDownFlag=!0})),i.on("click",(function(r){if(e._mouseDownFlag){e._mouseDownFlag=!1;for(var o=r.target;!o.__regions;)o=o.parent;if(o){var s={type:("geo"===t.mainType?"geo":"map")+"ToggleSelect",batch:Ve.map(o.__regions,(function(e){return{name:e.name,from:a.uid}}))};s[t.mainType+"Id"]=t.id,n.dispatchAction(s),nT(t,i)}}})))}(this,e,u,i,n),nT(e,u)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&LI.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(e){var t=e.map;this._mapName!==t&&Ve.each(LI.makeGraphic(t,this.uid),(function(e){this._backgroundGroup.add(e)}),this),this._mapName=t},_updateController:function(e,t,i){var n=e.coordinateSystem,a=this._controller,r=this._controllerHost;r.zoomLimit=e.get("scaleLimit"),r.zoom=n.getZoom(),a.enable(e.get("roam")||!1);var o=e.mainType;function s(){var t={type:"geoRoam",componentType:o};return t[o+"Id"]=e.id,t}a.off("pan").on("pan",(function(e){this._mouseDownFlag=!1,$I.updateViewOnPan(r,e.dx,e.dy),i.dispatchAction(Ve.extend(s(),{dx:e.dx,dy:e.dy}))}),this),a.off("zoom").on("zoom",(function(e){if(this._mouseDownFlag=!1,$I.updateViewOnZoom(r,e.scale,e.originX,e.originY),i.dispatchAction(Ve.extend(s(),{zoom:e.scale,originX:e.originX,originY:e.originY})),this._updateGroup){var t=this.group.scale;this._regionsGroup.traverse((function(e){"text"===e.type&&e.attr("scale",[1/t[0],1/t[1]])}))}}),this),a.setPointerChecker((function(t,a,r){return n.getViewRectAfterRoam().contain(a,r)&&!eT(t,i,e)}))}};var rT=aT,oT="__seriesMapHighDown",sT="__seriesMapCallKey";function lT(e){var t=this[oT];t&&t.recordVersion===this[sT]&&uT(t,e)}function uT(e,t){var i=e.circle,n=e.labelModel,a=e.hoverLabelModel,r=e.emphasisText,o=e.normalText;t?(i.style.extendFrom(tc.setTextStyle({},a,{text:a.get("show")?r:null},{isRectText:!0,useInsideStyle:!1},!0)),i.__mapOriginalZ2=i.z2,i.z2+=tc.Z2_EMPHASIS_LIFT):(tc.setTextStyle(i.style,n,{text:n.get("show")?o:null,textPosition:n.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),i.dirty(!1),null!=i.__mapOriginalZ2&&(i.z2=i.__mapOriginalZ2,i.__mapOriginalZ2=null))}X_.extendChartView({type:"map",render:function(e,t,i,n){if(!n||"mapToggleSelect"!==n.type||n.from!==this.uid){var a=this.group;if(a.removeAll(),!e.getHostGeoModel()){if(n&&"geoRoam"===n.type&&"series"===n.componentType&&n.seriesId===e.id)(r=this._mapDraw)&&a.add(r.group);else if(e.needsDrawMap){var r=this._mapDraw||new rT(i,!0);a.add(r.group),r.draw(e,t,i,this,n),this._mapDraw=r}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;e.get("showLegendSymbol")&&t.getComponent("legend")&&this._renderSymbols(e,t,i)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(e,t,i){var n=e.originalData,a=this.group;n.each(n.mapDimension("value"),(function(t,i){if(!isNaN(t)){var r=n.getItemLayout(i);if(r&&r.point){var o=r.point,s=r.offset,l=new tc.Circle({style:{fill:e.getData().getVisual("color")},shape:{cx:o[0]+9*s,cy:o[1],r:3},silent:!0,z2:8+(s?0:tc.Z2_EMPHASIS_LIFT+1)});if(!s){var u=e.mainSeries.getData(),h=n.getName(i),c=u.indexOfName(h),d=n.getItemModel(i),p=d.getModel("label"),f=d.getModel("emphasis.label"),g=u.getItemGraphicEl(c),m=Ve.retrieve2(e.getFormattedLabel(c,"normal"),h),v=Ve.retrieve2(e.getFormattedLabel(c,"emphasis"),m),y=g[oT],x=Math.random();if(!y){y=g[oT]={};var _=Ve.curry(lT,!0),b=Ve.curry(lT,!1);g.on("mouseover",_).on("mouseout",b).on("emphasis",_).on("normal",b)}g[sT]=x,Ve.extend(y,{recordVersion:x,circle:l,labelModel:p,hoverLabelModel:f,emphasisText:v,normalText:m}),uT(y,!1)}a.add(l)}}}))}});var hT=function(e,t,i){var n=e.getZoom(),a=e.getCenter(),r=t.zoom,o=e.dataToPoint(a);if(null!=t.dx&&null!=t.dy){o[0]-=t.dx,o[1]-=t.dy;a=e.pointToData(o);e.setCenter(a)}if(null!=r){if(i){var s=i.min||0,l=i.max||1/0;r=Math.max(Math.min(n*r,l),s)/n}e.scale[0]*=r,e.scale[1]*=r;var u=e.position,h=(t.originX-u[0])*(r-1),c=(t.originY-u[1])*(r-1);u[0]-=h,u[1]-=c,e.updateTransform();a=e.pointToData(o);e.setCenter(a),e.setZoom(r*n)}return{center:e.getCenter(),zoom:e.getZoom()}},cT={updateCenterAndZoom:hT},dT=cT.updateCenterAndZoom;X_.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},(function(e,t){var i=e.componentType||"series";t.eachComponent({mainType:i,query:e},(function(t){var n=t.coordinateSystem;if("geo"===n.type){var a=dT(n,e,t.get("scaleLimit"));t.setCenter&&t.setCenter(a.center),t.setZoom&&t.setZoom(a.zoom),"series"===i&&Ve.each(t.seriesGroup,(function(e){e.setCenter(a.center),e.setZoom(a.zoom)}))}}))}));var pT=lt.applyTransform;function fT(){di.call(this)}function gT(e){this.name=e,this.zoomLimit,di.call(this),this._roamTransformable=new fT,this._rawTransformable=new fT,this._center,this._zoom}function mT(e,t,i,n){var a=i.seriesModel,r=a?a.coordinateSystem:null;return r===this?r[e](n):null}Ve.mixin(fT,di),gT.prototype={constructor:gT,type:"view",dimensions:["x","y"],setBoundingRect:function(e,t,i,n){return this._rect=new Pn(e,t,i,n),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(e,t,i,n){this.transformTo(e,t,i,n),this._viewRect=new Pn(e,t,i,n)},transformTo:function(e,t,i,n){var a=this.getBoundingRect(),r=this._rawTransformable;r.transform=a.calculateTransform(new Pn(e,t,i,n)),r.decomposeTransform(),this._updateTransform()},setCenter:function(e){e&&(this._center=e,this._updateCenterAndZoom())},setZoom:function(e){e=e||1;var t=this.zoomLimit;t&&(null!=t.max&&(e=Math.min(t.max,e)),null!=t.min&&(e=Math.max(t.min,e))),this._zoom=e,this._updateCenterAndZoom()},getDefaultCenter:function(){var e=this.getBoundingRect();return[e.x+e.width/2,e.y+e.height/2]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var e=this._rawTransformable.getLocalTransform(),t=this._roamTransformable,i=this.getDefaultCenter(),n=this.getCenter(),a=this.getZoom();n=lt.applyTransform([],n,e),i=lt.applyTransform([],i,e),t.origin=n,t.position=[i[0]-n[0],i[1]-n[1]],t.scale=[a,a],this._updateTransform()},_updateTransform:function(){var e=this._roamTransformable,t=this._rawTransformable;t.parent=e,e.updateTransform(),t.updateTransform(),ni.copy(this.transform||(this.transform=[]),t.transform||ni.create()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],ni.invert(this.invTransform,this.transform),this.decomposeTransform()},getTransformInfo:function(){var e=this._roamTransformable.transform,t=this._rawTransformable;return{roamTransform:e?Ve.slice(e):ni.create(),rawScale:Ve.slice(t.scale),rawPosition:Ve.slice(t.position)}},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var e=this.getBoundingRect().clone();return e.applyTransform(this.transform),e},dataToPoint:function(e,t,i){var n=t?this._rawTransform:this.transform;return i=i||[],n?pT(i,e,n):lt.copy(i,e)},pointToData:function(e){var t=this.invTransform;return t?pT([],e,t):[e[0],e[1]]},convertToPixel:Ve.curry(mT,"dataToPoint"),convertFromPixel:Ve.curry(mT,"pointToData"),containPoint:function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])}},Ve.mixin(gT,di);var vT=gT;function yT(e,t,i,n){vT.call(this,e),this.map=t;var a=LI.load(t,i);this._nameCoordMap=a.nameCoordMap,this._regionsMap=a.regionsMap,this._invertLongitute=null==n||n,this.regions=a.regions,this._rect=a.boundingRect}function xT(e,t,i,n){var a=i.geoModel,r=i.seriesModel,o=a?a.coordinateSystem:r?r.coordinateSystem||(r.getReferringComponents("geo")[0]||{}).coordinateSystem:null;return o===this?o[e](n):null}yT.prototype={constructor:yT,type:"geo",dimensions:["lng","lat"],containCoord:function(e){for(var t=this.regions,i=0;i<t.length;i++)if(t[i].contain(e))return!0;return!1},transformTo:function(e,t,i,n){var a=this.getBoundingRect(),r=this._invertLongitute;a=a.clone(),r&&(a.y=-a.y-a.height);var o=this._rawTransformable;if(o.transform=a.calculateTransform(new Pn(e,t,i,n)),o.decomposeTransform(),r){var s=o.scale;s[1]=-s[1]}o.updateTransform(),this._updateTransform()},getRegion:function(e){return this._regionsMap.get(e)},getRegionByCoord:function(e){for(var t=this.regions,i=0;i<t.length;i++)if(t[i].contain(e))return t[i]},addGeoCoord:function(e,t){this._nameCoordMap.set(e,t)},getGeoCoord:function(e){return this._nameCoordMap.get(e)},getBoundingRect:function(){return this._rect},dataToPoint:function(e,t,i){if("string"==typeof e&&(e=this.getGeoCoord(e)),e)return vT.prototype.dataToPoint.call(this,e,t,i)},convertToPixel:Ve.curry(xT,"dataToPoint"),convertFromPixel:Ve.curry(xT,"pointToData")},Ve.mixin(yT,vT);var _T=yT;function bT(e,t){var i=e.get("boundingCoords");if(null!=i){var n=i[0],a=i[1];isNaN(n[0])||isNaN(n[1])||isNaN(a[0])||isNaN(a[1])||this.setBoundingRect(n[0],n[1],a[0]-n[0],a[1]-n[1])}var r,o=this.getBoundingRect(),s=e.get("layoutCenter"),l=e.get("layoutSize"),u=t.getWidth(),h=t.getHeight(),c=o.width/o.height*this.aspectScale,d=!1;if(s&&l&&(s=[Pc.parsePercent(s[0],u),Pc.parsePercent(s[1],h)],l=Pc.parsePercent(l,Math.min(u,h)),isNaN(s[0])||isNaN(s[1])||isNaN(l)||(d=!0)),d){var p={};c>1?(p.width=l,p.height=l/c):(p.height=l,p.width=l*c),p.y=s[1]-p.height/2,p.x=s[0]-p.width/2}else(r=e.getBoxLayoutParams()).aspect=c,p=nd.getLayoutRect(r,{width:u,height:h});this.setViewRect(p.x,p.y,p.width,p.height),this.setCenter(e.get("center")),this.setZoom(e.get("zoom"))}function wT(e,t){Ve.each(t.get("geoCoord"),(function(t,i){e.addGeoCoord(i,t)}))}var ST={dimensions:_T.prototype.dimensions,create:function(e,t){var i=[];e.eachComponent("geo",(function(e,n){var a=e.get("map"),r=e.get("aspectScale"),o=!0,s=Km.retrieveMap(a);s&&s[0]&&"svg"===s[0].type?(null==r&&(r=1),o=!1):null==r&&(r=.75);var l=new _T(a+n,a,e.get("nameMap"),o);l.aspectScale=r,l.zoomLimit=e.get("scaleLimit"),i.push(l),wT(l,e),e.coordinateSystem=l,l.model=e,l.resize=bT,l.resize(e,t)})),e.eachSeries((function(e){if("geo"===e.get("coordinateSystem")){var t=e.get("geoIndex")||0;e.coordinateSystem=i[t]}}));var n={};return e.eachSeriesByType("map",(function(e){if(!e.getHostGeoModel()){var t=e.getMapType();n[t]=n[t]||[],n[t].push(e)}})),Ve.each(n,(function(e,n){var a=Ve.map(e,(function(e){return e.get("nameMap")})),r=new _T(n,n,Ve.mergeAll(a));r.zoomLimit=Ve.retrieve.apply(null,Ve.map(e,(function(e){return e.get("scaleLimit")}))),i.push(r),r.resize=bT,r.aspectScale=e[0].get("aspectScale"),r.resize(e[0],t),Ve.each(e,(function(e){e.coordinateSystem=r,wT(r,e)}))})),i},getFilledRegions:function(e,t,i){for(var n=(e||[]).slice(),a=Ve.createHashMap(),r=0;r<n.length;r++)a.set(n[r].name,n[r]);var o=LI.load(t,i);return Ve.each(o.regions,(function(e){var t=e.name;!a.get(t)&&n.push({name:t})})),n}};X_.registerCoordinateSystem("geo",ST);var MT=ST;var IT=function(e){var t={};e.eachSeriesByType("map",(function(i){var n=i.getMapType();if(!i.getHostGeoModel()&&!t[n]){var a={};Ve.each(i.seriesGroup,(function(t){var i=t.coordinateSystem,n=t.originalData;t.get("showLegendSymbol")&&e.getComponent("legend")&&n.each(n.mapDimension("value"),(function(e,t){var r=n.getName(t),o=i.getRegion(r);if(o&&!isNaN(e)){var s=a[r]||0,l=i.dataToPoint(o.center);a[r]=s+1,n.setItemLayout(t,{point:l,offset:s})}}))}));var r=i.getData();r.each((function(e){var t=r.getName(e),i=r.getItemLayout(e)||{};i.showLabel=!a[t],r.setItemLayout(e,i)})),t[n]=!0}}))};var TT=function(e){e.eachSeriesByType("map",(function(e){var t=e.get("color"),i=e.getModel("itemStyle"),n=i.get("areaColor"),a=i.get("color")||t[e.seriesIndex%t.length];e.getData().setVisual({areaColor:n,color:a})}))};var AT=function(e){var t={};e.eachSeriesByType("map",(function(e){var i=e.getHostGeoModel(),n=i?"o"+i.id:"i"+e.getMapType();(t[n]=t[n]||[]).push(e)})),Ve.each(t,(function(e,t){for(var i,n,a,r=(i=Ve.map(e,(function(e){return e.getData()})),n=e[0].get("mapValueCalculation"),a={},Ve.each(i,(function(e){e.each(e.mapDimension("value"),(function(t,i){var n="ec-"+e.getName(i);a[n]=a[n]||[],isNaN(t)||a[n].push(t)}))})),i[0].map(i[0].mapDimension("value"),(function(e,t){for(var r="ec-"+i[0].getName(t),o=0,s=1/0,l=-1/0,u=a[r].length,h=0;h<u;h++)s=Math.min(s,a[r][h]),l=Math.max(l,a[r][h]),o+=a[r][h];return 0===u?NaN:"min"===n?s:"max"===n?l:"average"===n?o/u:o}))),o=0;o<e.length;o++)e[o].originalData=e[o].getData();for(o=0;o<e.length;o++)e[o].seriesGroup=e,e[o].needsDrawMap=0===o&&!e[o].getHostGeoModel(),e[o].setData(r.cloneShallow()),e[o].mainSeries=e[0]}))};var CT=function(e){Ve.each(e.series,(function(e){e&&"map"===e.type&&(e.map=e.map||e.mapType,Ve.defaults(e,e.mapLocation))}))};X_.registerLayout(IT),X_.registerVisual(TT),X_.registerProcessor(X_.PRIORITY.PROCESSOR.STATISTIC,AT),X_.registerPreprocessor(CT),SM("map",[{type:"mapToggleSelect",event:"mapselectchanged",method:"toggleSelected"},{type:"mapSelect",event:"mapselected",method:"select"},{type:"mapUnSelect",event:"mapunselected",method:"unSelect"}]);var DT=Ve.each,LT="\0__link_datas",PT="\0__link_mainData";function kT(e,t){if((n=this)[PT]===n){var i=Ve.extend({},this[LT]);i[this.dataType]=t,NT(t,i,e)}else zT(t,this.dataType,this[PT],e);var n;return t}function OT(e,t){return e.struct&&e.struct.update(this),t}function RT(e,t){return DT(t[LT],(function(i,n){i!==t&&zT(i.cloneShallow(),n,t,e)})),t}function ET(e){var t=this[PT];return null==e||null==t?t:t[LT][e]}function NT(e,t,i){e[LT]={},DT(t,(function(t,n){zT(t,n,e,i)}))}function zT(e,t,i,n){i[LT][t]=e,e[PT]=i,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=ET}var BT=function(e){var t=e.mainData,i=e.datas;i||(i={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,NT(t,i,e),DT(i,(function(i){DT(t.TRANSFERABLE_METHODS,(function(t){i.wrapMethod(t,Ve.curry(kT,e))}))})),t.wrapMethod("cloneShallow",Ve.curry(RT,e)),DT(t.CHANGABLE_METHODS,(function(i){t.wrapMethod(i,Ve.curry(OT,e))})),Ve.assert(i[t.dataType]===t)},VT=function(e,t){this.name=e||"",this.depth=0,this.height=0,this.parentNode=null,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.hostTree=t};function FT(e,t){this.root,this.data,this._nodes=[],this.hostModel=e,this.levelModels=Ve.map(t||[],(function(t){return new mc(t,e,e.ecModel)}))}VT.prototype={constructor:VT,isRemoved:function(){return this.dataIndex<0},eachNode:function(e,t,i){"function"==typeof e&&(i=t,t=e,e=null),e=e||{},Ve.isString(e)&&(e={order:e});var n,a=e.order||"preorder",r=this[e.attr||"children"];"preorder"===a&&(n=t.call(i,this));for(var o=0;!n&&o<r.length;o++)r[o].eachNode(e,t,i);"postorder"===a&&t.call(i,this)},updateDepthAndHeight:function(e){var t=0;this.depth=e;for(var i=0;i<this.children.length;i++){var n=this.children[i];n.updateDepthAndHeight(e+1),n.height>t&&(t=n.height)}this.height=t+1},getNodeById:function(e){if(this.getId()===e)return this;for(var t=0,i=this.children,n=i.length;t<n;t++){var a=i[t].getNodeById(e);if(a)return a}},contains:function(e){if(e===this)return!0;for(var t=0,i=this.children,n=i.length;t<n;t++){var a=i[t].contains(e);if(a)return a}},getAncestors:function(e){for(var t=[],i=e?this:this.parentNode;i;)t.push(i),i=i.parentNode;return t.reverse(),t},getValue:function(e){var t=this.hostTree.data;return t.get(t.getDimension(e||"value"),this.dataIndex)},setLayout:function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(e){if(!(this.dataIndex<0)){var t=this.hostTree.data.getItemModel(this.dataIndex),i=this.getLevelModel();return i?t.getModel(e,i.getModel(e)):t.getModel(e)}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},setVisual:function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},getVisual:function(e,t){return this.hostTree.data.getItemVisual(this.dataIndex,e,t)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(e){for(var t=e.parentNode;t;){if(t===this)return!0;t=t.parentNode}return!1},isDescendantOf:function(e){return e!==this&&e.isAncestorOf(this)}},FT.prototype={constructor:FT,type:"tree",eachNode:function(e,t,i){this.root.eachNode(e,t,i)},getNodeByDataIndex:function(e){var t=this.data.getRawIndex(e);return this._nodes[t]},getNodeByName:function(e){return this.root.getNodeByName(e)},update:function(){for(var e=this.data,t=this._nodes,i=0,n=t.length;i<n;i++)t[i].dataIndex=-1;for(i=0,n=e.count();i<n;i++)t[e.getRawIndex(i)].dataIndex=i},clearLayouts:function(){this.data.clearItemLayouts()}},FT.createTree=function(e,t,i,n){var a=new FT(t,i&&i.levels),r=[],o=1;!function e(t,i){var n=t.value;o=Math.max(o,Ve.isArray(n)?n.length:1),r.push(t);var s=new VT(t.name,a);i?function(e,t){var i=t.children;if(e.parentNode===t)return;i.push(e),e.parentNode=t}(s,i):a.root=s,a._nodes.push(s);var l=t.children;if(l)for(var u=0;u<l.length;u++)e(l[u],s)}(e),a.root.updateDepthAndHeight(0);var s=qv(r,{coordDimensions:["value"],dimensionsCount:o}),l=new Rv(s,t);return l.initData(r),n&&n(l),BT({mainData:l,struct:a,structAttr:"tree"}),a.update(),a};var GT=FT,HT=Uc.encodeHTML;function WT(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function UT(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function jT(e,t,i){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:i}function ZT(e,t,i){var n=i/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=n,t.hierNode.shift+=i,t.hierNode.modifier+=i,t.hierNode.prelim+=i,e.hierNode.change+=n}function YT(e,t){return e.parentNode===t.parentNode?1:2}og.extend({type:"series.tree",layoutInfo:null,layoutMode:"box",getInitialData:function(e){var t={name:e.name,children:e.data},i=e.leaves||{},n=new mc(i,this,this.ecModel),a=GT.createTree(t,this,{},(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=a.getNodeByDataIndex(t);return i.children.length&&i.isExpand||(e.parentModel=n),e}))}));var r=0;a.eachNode("preorder",(function(e){e.depth>r&&(r=e.depth)}));var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:r;return a.root.eachNode("preorder",(function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&null!=t.collapsed?!t.collapsed:e.depth<=o})),a.data},getOrient:function(){var e=this.get("orient");return"horizontal"===e?e="LR":"vertical"===e&&(e="TB"),e},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},formatTooltip:function(e){for(var t=this.getData().tree,i=t.root.children[0],n=t.getNodeByDataIndex(e),a=n.getValue(),r=n.name;n&&n!==i;)r=n.parentNode.name+"."+r,n=n.parentNode;return HT(r+(isNaN(a)||null==a?"":" : "+a))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}});var XT=function(e){e.hierNode={defaultAncestor:null,ancestor:e,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var t,i,n=[e];t=n.pop();)if(i=t.children,t.isExpand&&i.length)for(var a=i.length-1;a>=0;a--){var r=i[a];r.hierNode={defaultAncestor:null,ancestor:r,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},n.push(r)}},qT=function(e,t){var i=e.isExpand?e.children:[],n=e.parentNode.children,a=e.hierNode.i?n[e.hierNode.i-1]:null;if(i.length){!function(e){var t=e.children,i=t.length,n=0,a=0;for(;--i>=0;){var r=t[i];r.hierNode.prelim+=n,r.hierNode.modifier+=n,a+=r.hierNode.change,n+=r.hierNode.shift+a}}(e);var r=(i[0].hierNode.prelim+i[i.length-1].hierNode.prelim)/2;a?(e.hierNode.prelim=a.hierNode.prelim+t(e,a),e.hierNode.modifier=e.hierNode.prelim-r):e.hierNode.prelim=r}else a&&(e.hierNode.prelim=a.hierNode.prelim+t(e,a));e.parentNode.hierNode.defaultAncestor=function(e,t,i,n){if(t){for(var a=e,r=e,o=r.parentNode.children[0],s=t,l=a.hierNode.modifier,u=r.hierNode.modifier,h=o.hierNode.modifier,c=s.hierNode.modifier;s=WT(s),r=UT(r),s&&r;){a=WT(a),o=UT(o),a.hierNode.ancestor=e;var d=s.hierNode.prelim+c-r.hierNode.prelim-u+n(s,r);d>0&&(ZT(jT(s,e,i),e,d),u+=d,l+=d),c+=s.hierNode.modifier,u+=r.hierNode.modifier,l+=a.hierNode.modifier,h+=o.hierNode.modifier}s&&!WT(a)&&(a.hierNode.thread=s,a.hierNode.modifier+=c-l),r&&!UT(o)&&(o.hierNode.thread=r,o.hierNode.modifier+=u-h,i=e)}return i}(e,a,e.parentNode.hierNode.defaultAncestor||n[0],t)},$T=function(e){return arguments.length?e:YT},KT={init:XT,firstWalk:qT,secondWalk:function(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier},separation:$T,radialCoordinate:function(e,t){var i={};return e-=Math.PI/2,i.x=t*Math.cos(e),i.y=t*Math.sin(e),i},getViewRect:function(e,t){return nd.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}},JT=KT.radialCoordinate,QT=QI.onIrrelevantElement,eA=Pc.parsePercent,tA=tc.extendShape({shape:{parentPoint:[],childPoints:[],orient:"",forkPosition:""},style:{stroke:"#000",fill:null},buildPath:function(e,t){var i=t.childPoints,n=i.length,a=t.parentPoint,r=i[0],o=i[n-1];if(1===n)return e.moveTo(a[0],a[1]),void e.lineTo(r[0],r[1]);var s=t.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=eA(t.forkPosition,1),c=[];c[l]=a[l],c[u]=a[u]+(o[u]-a[u])*h,e.moveTo(a[0],a[1]),e.lineTo(c[0],c[1]),e.moveTo(r[0],r[1]),c[l]=r[l],e.lineTo(c[0],c[1]),c[l]=o[l],e.lineTo(c[0],c[1]),e.lineTo(o[0],o[1]);for(var d=1;d<n-1;d++){var p=i[d];e.moveTo(p[0],p[1]),c[l]=p[l],e.lineTo(c[0],c[1])}}});function iA(e,t){var i=e.getItemLayout(t);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==e.getItemVisual(t,"symbol")}function nA(e,t,i){return i.itemModel=t,i.itemStyle=t.getModel("itemStyle").getItemStyle(),i.hoverItemStyle=t.getModel("emphasis.itemStyle").getItemStyle(),i.lineStyle=t.getModel("lineStyle").getLineStyle(),i.labelModel=t.getModel("label"),i.hoverLabelModel=t.getModel("emphasis.label"),!1===e.isExpand&&0!==e.children.length?i.symbolInnerColor=i.itemStyle.fill:i.symbolInnerColor="#fff",i}function aA(e,t,i,n,a,r){var o=!i,s=e.tree.getNodeByDataIndex(t),l=s.getModel(),u=(r=nA(s,l,r),e.tree.root),h=s.parentNode===u?s:s.parentNode||s,c=e.getItemGraphicEl(h.dataIndex),d=h.getLayout(),p=c?{x:c.position[0],y:c.position[1],rawX:c.__radialOldRawX,rawY:c.__radialOldRawY}:d,f=s.getLayout();o?(i=new cb(e,t,r)).attr("position",[p.x,p.y]):i.updateData(e,t,r),i.__radialOldRawX=i.__radialRawX,i.__radialOldRawY=i.__radialRawY,i.__radialRawX=f.rawX,i.__radialRawY=f.rawY,n.add(i),e.setItemGraphicEl(t,i),tc.updateProps(i,{position:[f.x,f.y]},a);var g=i.getSymbolPath();if("radial"===r.layout){var m,v,y=u.children[0],x=y.getLayout(),_=y.children.length;if(f.x===x.x&&!0===s.isExpand){var b={};b.x=(y.children[0].getLayout().x+y.children[_-1].getLayout().x)/2,b.y=(y.children[0].getLayout().y+y.children[_-1].getLayout().y)/2,(m=Math.atan2(b.y-x.y,b.x-x.x))<0&&(m=2*Math.PI+m),(v=b.x<x.x)&&(m-=Math.PI)}else(m=Math.atan2(f.y-x.y,f.x-x.x))<0&&(m=2*Math.PI+m),0===s.children.length||0!==s.children.length&&!1===s.isExpand?(v=f.x<x.x)&&(m-=Math.PI):(v=f.x>x.x)||(m-=Math.PI);var w=v?"left":"right",S=r.labelModel.get("rotate"),M=S*(Math.PI/180);g.setStyle({textPosition:r.labelModel.get("position")||w,textRotation:null==S?-m:M,textOrigin:"center",verticalAlign:"middle"})}!function(e,t,i,n,a,r,o,s,l){var u=l.edgeShape,h=n.__edge;if("curve"===u)t.parentNode&&t.parentNode!==i&&(h||(h=n.__edge=new tc.BezierCurve({shape:oA(l,a,a),style:Ve.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),tc.updateProps(h,{shape:oA(l,r,o),style:{opacity:1}},e));else if("polyline"===u&&"orthogonal"===l.layout&&t!==i&&t.children&&0!==t.children.length&&!0===t.isExpand){for(var c=t.children,d=[],p=0;p<c.length;p++){var f=c[p].getLayout();d.push([f.x,f.y])}h||(h=n.__edge=new tA({shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]],orient:l.orient,forkPosition:l.edgeForkPosition},style:Ve.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),tc.updateProps(h,{shape:{parentPoint:[o.x,o.y],childPoints:d},style:{opacity:1}},e)}s.add(h)}(a,s,u,i,p,d,f,n,r)}function rA(e,t,i,n,a,r){for(var o,s=e.tree.getNodeByDataIndex(t),l=e.tree.root,u=s.getModel(),h=(r=nA(s,u,r),s.parentNode===l?s:s.parentNode||s),c=r.edgeShape;null==(o=h.getLayout());)h=h.parentNode===l?h:h.parentNode||h;tc.updateProps(i,{position:[o.x+1,o.y+1]},a,(function(){n.remove(i),e.setItemGraphicEl(t,null)})),i.fadeOut(null,{keepLabel:!0});var d=e.getItemGraphicEl(h.dataIndex).__edge,p=i.__edge||(!1===h.isExpand||1===h.children.length?d:void 0);c=r.edgeShape;p&&("curve"===c?tc.updateProps(p,{shape:oA(r,o,o),style:{opacity:0}},a,(function(){n.remove(p)})):"polyline"===c&&"orthogonal"===r.layout&&tc.updateProps(p,{shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]]},style:{opacity:0}},a,(function(){n.remove(p)})))}function oA(e,t,i){var n,a,r,o,s,l,u,h,c=e.orient;if("radial"===e.layout){s=t.rawX,u=t.rawY,l=i.rawX,h=i.rawY;var d=JT(s,u),p=JT(s,u+(h-u)*e.curvature),f=JT(l,h+(u-h)*e.curvature),g=JT(l,h);return{x1:d.x,y1:d.y,x2:g.x,y2:g.y,cpx1:p.x,cpy1:p.y,cpx2:f.x,cpy2:f.y}}return s=t.x,u=t.y,l=i.x,h=i.y,"LR"!==c&&"RL"!==c||(n=s+(l-s)*e.curvature,a=u,r=l+(s-l)*e.curvature,o=h),"TB"!==c&&"BT"!==c||(n=s,a=u+(h-u)*e.curvature,r=l,o=h+(u-h)*e.curvature),{x1:s,y1:u,x2:l,y2:h,cpx1:n,cpy1:a,cpx2:r,cpy2:o}}X_.extendChartView({type:"tree",init:function(e,t){this._oldTree,this._mainGroup=new tc.Group,this._controller=new XI(t.getZr()),this._controllerHost={target:this.group},this.group.add(this._mainGroup)},render:function(e,t,i,n){var a=e.getData(),r=e.layoutInfo,o=this._mainGroup,s=e.get("layout");"radial"===s?o.attr("position",[r.x+r.width/2,r.y+r.height/2]):o.attr("position",[r.x,r.y]),this._updateViewCoordSys(e,r,s),this._updateController(e,t,i);var l=this._data,u={expandAndCollapse:e.get("expandAndCollapse"),layout:s,edgeShape:e.get("edgeShape"),edgeForkPosition:e.get("edgeForkPosition"),orient:e.getOrient(),curvature:e.get("lineStyle.curveness"),symbolRotate:e.get("symbolRotate"),symbolOffset:e.get("symbolOffset"),hoverAnimation:e.get("hoverAnimation"),useNameLabel:!0,fadeIn:!0};a.diff(l).add((function(t){iA(a,t)&&aA(a,t,null,o,e,u)})).update((function(t,i){var n=l.getItemGraphicEl(i);iA(a,t)?aA(a,t,n,o,e,u):n&&rA(l,i,n,o,e,u)})).remove((function(t){var i=l.getItemGraphicEl(t);i&&rA(l,t,i,o,e,u)})).execute(),this._nodeScaleRatio=e.get("nodeScaleRatio"),this._updateNodeAndLinkScale(e),!0===u.expandAndCollapse&&a.eachItemGraphicEl((function(t,n){t.off("click").on("click",(function(){i.dispatchAction({type:"treeExpandAndCollapse",seriesId:e.id,dataIndex:n})}))})),this._data=a},_updateViewCoordSys:function(e){var t=e.getData(),i=[];t.each((function(e){var n=t.getItemLayout(e);!n||isNaN(n.x)||isNaN(n.y)||i.push([+n.x,+n.y])}));var n=[],a=[];Rs.fromPoints(i,n,a);var r=this._min,o=this._max;a[0]-n[0]==0&&(n[0]=r?r[0]:n[0]-1,a[0]=o?o[0]:a[0]+1),a[1]-n[1]==0&&(n[1]=r?r[1]:n[1]-1,a[1]=o?o[1]:a[1]+1);var s=e.coordinateSystem=new vT;s.zoomLimit=e.get("scaleLimit"),s.setBoundingRect(n[0],n[1],a[0]-n[0],a[1]-n[1]),s.setCenter(e.get("center")),s.setZoom(e.get("zoom")),this.group.attr({position:s.position,scale:s.scale}),this._viewCoordSys=s,this._min=n,this._max=a},_updateController:function(e,t,i){var n=this._controller,a=this._controllerHost,r=this.group;n.setPointerChecker((function(t,n,a){var o=r.getBoundingRect();return o.applyTransform(r.transform),o.contain(n,a)&&!QT(t,i,e)})),n.enable(e.get("roam")),a.zoomLimit=e.get("scaleLimit"),a.zoom=e.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",(function(t){$I.updateViewOnPan(a,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"treeRoam",dx:t.dx,dy:t.dy})}),this).on("zoom",(function(t){$I.updateViewOnZoom(a,t.scale,t.originX,t.originY),i.dispatchAction({seriesId:e.id,type:"treeRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(e)}),this)},_updateNodeAndLinkScale:function(e){var t=e.getData(),i=this._getNodeGlobalScale(e),n=[i,i];t.eachItemGraphicEl((function(e,t){e.attr("scale",n)}))},_getNodeGlobalScale:function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var i=this._nodeScaleRatio,n=t.scale,a=n&&n[0]||1;return((t.getZoom()-1)*i+1)/a},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={}},remove:function(){this._mainGroup.removeAll(),this._data=null}});var sA=cT.updateCenterAndZoom;X_.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var i=e.dataIndex,n=t.getData().tree.getNodeByDataIndex(i);n.isExpand=!n.isExpand}))})),X_.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},(function(t){var i=t.coordinateSystem,n=sA(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var lA=function(e,t,i){for(var n,a=[e],r=[];n=a.pop();)if(r.push(n),n.isExpand){var o=n.children;if(o.length)for(var s=0;s<o.length;s++)a.push(o[s])}for(;n=r.pop();)t(n,i)},uA=function(e,t){for(var i,n=[e];i=n.pop();)if(t(i),i.isExpand){var a=i.children;if(a.length)for(var r=a.length-1;r>=0;r--)n.push(a[r])}},hA={eachAfter:lA,eachBefore:uA},cA=hA.eachAfter,dA=hA.eachBefore,pA=KT.init,fA=KT.firstWalk,gA=KT.secondWalk,mA=KT.separation,vA=KT.radialCoordinate,yA=KT.getViewRect;var xA=function(e,t){e.eachSeriesByType("tree",(function(e){!function(e,t){var i=yA(e,t);e.layoutInfo=i;var n=e.get("layout"),a=0,r=0,o=null;"radial"===n?(a=2*Math.PI,r=Math.min(i.height,i.width)/2,o=mA((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(a=i.width,r=i.height,o=mA());var s=e.getData().tree.root,l=s.children[0];if(l){pA(s),cA(l,fA,o),s.hierNode.modifier=-l.hierNode.prelim,dA(l,gA);var u=l,h=l,c=l;dA(l,(function(e){var t=e.getLayout().x;t<u.getLayout().x&&(u=e),t>h.getLayout().x&&(h=e),e.depth>c.depth&&(c=e)}));var d=u===h?1:o(u,h)/2,p=d-u.getLayout().x,f=0,g=0,m=0,v=0;if("radial"===n)f=a/(h.getLayout().x+d+p),g=r/(c.depth-1||1),dA(l,(function(e){m=(e.getLayout().x+p)*f,v=(e.depth-1)*g;var t=vA(m,v);e.setLayout({x:t.x,y:t.y,rawX:m,rawY:v},!0)}));else{var y=e.getOrient();"RL"===y||"LR"===y?(g=r/(h.getLayout().x+d+p),f=a/(c.depth-1||1),dA(l,(function(e){v=(e.getLayout().x+p)*g,m="LR"===y?(e.depth-1)*f:a-(e.depth-1)*f,e.setLayout({x:m,y:v},!0)}))):"TB"!==y&&"BT"!==y||(f=a/(h.getLayout().x+d+p),g=r/(c.depth-1||1),dA(l,(function(e){m=(e.getLayout().x+p)*f,v="TB"===y?(e.depth-1)*g:r-(e.depth-1)*g,e.setLayout({x:m,y:v},!0)})))}}}(e,t)}))};function _A(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}X_.registerVisual(aw("tree","circle")),X_.registerLayout(xA);var bA={retrieveTargetInfo:function(e,t,i){if(e&&Ve.indexOf(t,e.type)>=0){var n=i.getData().tree.root,a=e.targetNode;if("string"==typeof a&&(a=n.getNodeById(a)),a&&n.contains(a))return{node:a};var r=e.targetNodeId;if(null!=r&&(a=n.getNodeById(r)))return{node:a}}},getPathToRoot:_A,aboveViewRoot:function(e,t){var i=_A(e);return Ve.indexOf(i,t)>=0},wrapTreePathInfo:function(e,t){for(var i=[];e;){var n=e.dataIndex;i.push({name:e.name,dataIndex:n,value:t.getRawValue(n)}),e=e.parentNode}return i.reverse(),i}},wA=Uc.encodeHTML,SA=Uc.addCommas,MA=bA.wrapTreePathInfo;function IA(e){var t=0;Ve.each(e.children,(function(e){IA(e);var i=e.value;Ve.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;Ve.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),Ve.isArray(e.value)?e.value[0]=i:e.value=i}og.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(e,t){var i={name:e.name,children:e.data};IA(i);var n=e.levels||[];n=e.levels=function(e,t){var i,n=t.get("color");if(!n)return;if(e=e||[],Ve.each(e,(function(e){var t=new mc(e),n=t.get("color");(t.get("itemStyle.color")||n&&"none"!==n)&&(i=!0)})),!i){(e[0]||(e[0]={})).color=n.slice()}return e}(n,t);var a=Ve.map(n||[],(function(e){return new mc(e,this,t)}),this),r=GT.createTree(i,this,null,(function(e){e.wrapMethod("getItemModel",(function(e,t){var i=r.getNodeByDataIndex(t),n=a[i.depth];return n&&(e.parentModel=n),e}))}));return r.data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(e){var t=this.getData(),i=this.getRawValue(e),n=Ve.isArray(i)?SA(i[0]):SA(i),a=t.getName(e);return wA(a+": "+n)},getDataParams:function(e){var t=og.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=MA(i,this),t},setLayoutInfo:function(e){this.layoutInfo=this.layoutInfo||{},Ve.extend(this.layoutInfo,e)},mapIdToIndex:function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=Ve.createHashMap(),this._idIndexMapCount=0);var i=t.get(e);return null==i&&t.set(e,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)}});var TA=bA.wrapTreePathInfo;function AA(e){this.group=new tc.Group,e.add(this.group)}function CA(e,t,i,n,a,r){var o=[[a?e:e-5,t],[e+i,t],[e+i,t+n],[a?e:e-5,t+n]];return!r&&o.splice(2,0,[e+i+5,t+n/2]),!a&&o.push([e,t+n/2]),o}function DA(e,t,i){e.eventData={componentType:"series",componentSubType:"treemap",componentIndex:t.componentIndex,seriesIndex:t.componentIndex,seriesName:t.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:i&&i.dataIndex,name:i&&i.name},treePathInfo:i&&TA(i,t)}}AA.prototype={constructor:AA,render:function(e,t,i,n){var a=e.getModel("breadcrumb"),r=this.group;if(r.removeAll(),a.get("show")&&i){var o=a.getModel("itemStyle"),s=o.getModel("textStyle"),l={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(e,l,o,s,n),nd.positionElement(r,l.pos,l.box)}},_prepare:function(e,t,i){for(var n=e;n;n=n.parentNode){var a=n.getModel().get("name"),r=i.getTextRect(a),o=Math.max(r.width+16,t.emptyItemWidth);t.totalWidth+=o+8,t.renderList.push({node:n,text:a,width:o})}},_renderContent:function(e,t,i,n,a){for(var r=0,o=t.emptyItemWidth,s=e.get("breadcrumb.height"),l=nd.getAvailableSize(t.pos,t.box),u=t.totalWidth,h=t.renderList,c=h.length-1;c>=0;c--){var d=h[c],p=d.node,f=d.width,g=d.text;u>l.width&&(u-=f-o,f=o,g=null);var m=new tc.Polygon({shape:{points:CA(r,0,f,s,c===h.length-1,0===c)},style:Ve.defaults(i.getItemStyle(),{lineJoin:"bevel",text:g,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:Ve.curry(a,p)});this.group.add(m),DA(m,e,p),r+=f+8}},remove:function(){this.group.removeAll()}};var LA=AA;var PA=function(){var e,t=[],i={};return{add:function(e,n,a,r,o){return Ve.isString(r)&&(o=r,r=0),!i[e.id]&&(i[e.id]=1,t.push({el:e,target:n,time:a,delay:r,easing:o}),!0)},done:function(t){return e=t,this},start:function(){for(var n=t.length,a=0,r=t.length;a<r;a++){var o=t[a];o.el.animateTo(o.target,o.time,o.delay,o.easing,s)}return this;function s(){--n||(t.length=0,i={},e&&e())}}}},kA={createWrap:PA},OA=Uc.windowOpen,RA=Ve.bind,EA=tc.Group,NA=tc.Rect,zA=Ve.each,BA=["label"],VA=["emphasis","label"],FA=["upperLabel"],GA=["emphasis","upperLabel"],HA=10,WA=Uo([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),UA=function(e){var t=WA(e);return t.stroke=t.fill=t.lineWidth=null,t};function jA(e,t,i,n,a,r,o,s,l,u){if(o){var h=o.getLayout(),c=e.getData();if(c.setItemGraphicEl(o.dataIndex,null),h&&h.isInView){var d=h.width,p=h.height,f=h.borderWidth,g=h.invisible,m=o.getRawIndex(),v=s&&s.getRawIndex(),y=o.viewChildren,x=h.upperHeight,_=y&&y.length,b=o.getModel("itemStyle"),w=o.getModel("emphasis.itemStyle"),S=L("nodeGroup",EA);if(S){if(l.add(S),S.attr("position",[h.x||0,h.y||0]),S.__tmNodeWidth=d,S.__tmNodeHeight=p,h.isAboveViewRoot)return S;var M=o.getModel(),I=L("background",NA,u,1);if(I&&function(t,i,n){if(i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex,i.setShape({x:0,y:0,width:d,height:p}),g)A(i);else{i.invisible=!1;var a=o.getVisual("borderColor",!0),r=w.get("borderColor"),s=UA(b);s.fill=a;var l=WA(w);if(l.fill=r,n){var u=d-2*f;C(s,l,a,u,x,{x:f,y:0,width:u,height:x})}else s.text=l.text=null;i.setStyle(s),tc.setElementHoverStyle(i,l)}t.add(i)}(S,I,_&&h.upperLabelHeight),_)tc.isHighDownDispatcher(S)&&tc.setAsHighDownDispatcher(S,!1),I&&(tc.setAsHighDownDispatcher(I,!0),c.setItemGraphicEl(o.dataIndex,I));else{var T=L("content",NA,u,2);T&&function(t,i){i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex;var n=Math.max(d-2*f,0),a=Math.max(p-2*f,0);if(i.culling=!0,i.setShape({x:f,y:f,width:n,height:a}),g)A(i);else{i.invisible=!1;var r=o.getVisual("color",!0),s=UA(b);s.fill=r;var l=WA(w);C(s,l,r,n,a),i.setStyle(s),tc.setElementHoverStyle(i,l)}t.add(i)}(S,T),I&&tc.isHighDownDispatcher(I)&&tc.setAsHighDownDispatcher(I,!1),tc.setAsHighDownDispatcher(S,!0),c.setItemGraphicEl(o.dataIndex,S)}return S}}}function A(e){!e.invisible&&r.push(e)}function C(t,i,n,a,r,s){var l=M.get("name"),u=M.getModel(s?FA:BA),c=M.getModel(s?GA:VA),d=u.getShallow("show");tc.setLabelStyle(t,i,u,c,{defaultText:d?l:null,autoColor:n,isRectText:!0,labelFetcher:e,labelDataIndex:o.dataIndex,labelProp:s?"upperLabel":"label"}),D(t,s,h),D(i,s,h),s&&(t.textRect=Ve.clone(s)),t.truncate=d&&u.get("ellipsis")?{outerWidth:a,outerHeight:r,minChar:2}:null}function D(t,i,n){var a=t.text;if(!i&&n.isLeafRoot&&null!=a){var r=e.get("drillDownIcon",!0);t.text=r?r+" "+a:a}}function L(e,r,s,l){var u=null!=v&&i[e][v],h=a[e];return u?(i[e][v]=null,function(e,t,i){var n=e[m]={};n.old="nodeGroup"===i?t.position.slice():Ve.extend({},t.shape)}(h,u,e)):g||((u=new r({z:ZA(s,l)})).__tmDepth=s,u.__tmStorageName=e,function(e,t,i){var r=e[m]={},s=o.parentNode;if(s&&(!n||"drillDown"===n.direction)){var l=0,u=0,h=a.background[s.getRawIndex()];!n&&h&&h.old&&(l=h.old.width,u=h.old.height),r.old="nodeGroup"===i?[0,u]:{x:l,y:u,width:0,height:0}}r.fadein="nodeGroup"!==i}(h,0,e)),t[e][m]=u}}function ZA(e,t){var i=e*HA+t;return(i-1)/i}X_.extendChartView({type:"treemap",init:function(e,t){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(e,t,i,n){var a=t.findComponents({mainType:"series",subType:"treemap",query:n});if(!(Ve.indexOf(a,e)<0)){this.seriesModel=e,this.api=i,this.ecModel=t;var r=bA.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),o=n&&n.type,s=e.layoutInfo,l=!this._oldTree,u=this._storage,h="treemapRootToNode"===o&&r&&u?{rootNodeGroup:u.nodeGroup[r.node.getRawIndex()],direction:n.direction}:null,c=this._giveContainerGroup(s),d=this._doRender(c,e,h);l||o&&"treemapZoomToNode"!==o&&"treemapRootToNode"!==o?d.renderFinally():this._doAnimation(c,d,e,h),this._resetController(i),this._renderBreadcrumb(e,i,r)}},_giveContainerGroup:function(e){var t=this._containerGroup;return t||(t=this._containerGroup=new EA,this._initEvents(t),this.group.add(t)),t.attr("position",[e.x,e.y]),t},_doRender:function(e,t,i){var n=t.getData().tree,a=this._oldTree,r={nodeGroup:[],background:[],content:[]},o={nodeGroup:[],background:[],content:[]},s=this._storage,l=[],u=Ve.curry(jA,t,o,s,i,r,l);!function e(t,i,n,a,r){a?(i=t,zA(t,(function(e,t){!e.isRemoved()&&s(t,t)}))):new tv(i,t,o,o).add(s).update(s).remove(Ve.curry(s,null)).execute();function o(e){return e.getId()}function s(o,s){var l=null!=o?t[o]:null,h=null!=s?i[s]:null,c=u(l,h,n,r);c&&e(l&&l.viewChildren||[],h&&h.viewChildren||[],c,a,r+1)}}(n.root?[n.root]:[],a&&a.root?[a.root]:[],e,n===a||!a,0);var h=function(e){var t={nodeGroup:[],background:[],content:[]};return e&&zA(e,(function(e,i){var n=t[i];zA(e,(function(e){e&&(n.push(e),e.__tmWillDelete=1)}))})),t}(s);return this._oldTree=n,this._storage=o,{lastsForAnimation:r,willDeleteEls:h,renderFinally:function(){zA(h,(function(e){zA(e,(function(e){e.parent&&e.parent.remove(e)}))})),zA(l,(function(e){e.invisible=!0,e.dirty()}))}}},_doAnimation:function(e,t,i,n){if(i.get("animation")){var a=i.get("animationDurationUpdate"),r=i.get("animationEasing"),o=kA.createWrap();zA(t.willDeleteEls,(function(e,t){zA(e,(function(e,i){if(!e.invisible){var s,l=e.parent;if(n&&"drillDown"===n.direction)s=l===n.rootNodeGroup?{shape:{x:0,y:0,width:l.__tmNodeWidth,height:l.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var u=0,h=0;l.__tmWillDelete||(u=l.__tmNodeWidth/2,h=l.__tmNodeHeight/2),s="nodeGroup"===t?{position:[u,h],style:{opacity:0}}:{shape:{x:u,y:h,width:0,height:0},style:{opacity:0}}}s&&o.add(e,s,a,r)}}))})),zA(this._storage,(function(e,i){zA(e,(function(e,n){var s=t.lastsForAnimation[i][n],l={};s&&("nodeGroup"===i?s.old&&(l.position=e.position.slice(),e.attr("position",s.old)):(s.old&&(l.shape=Ve.extend({},e.shape),e.setShape(s.old)),s.fadein?(e.setStyle("opacity",0),l.style={opacity:1}):1!==e.style.opacity&&(l.style={opacity:1})),o.add(e,l,a,r))}))}),this),this._state="animating",o.done(RA((function(){this._state="ready",t.renderFinally()}),this)).start()}},_resetController:function(e){var t=this._controller;t||((t=this._controller=new XI(e.getZr())).enable(this.seriesModel.get("roam")),t.on("pan",RA(this._onPan,this)),t.on("zoom",RA(this._onZoom,this)));var i=new Pn(0,0,e.getWidth(),e.getHeight());t.setPointerChecker((function(e,t,n){return i.contain(t,n)}))},_clearController:function(){var e=this._controller;e&&(e.dispose(),e=null)},_onPan:function(e){if("animating"!==this._state&&(Math.abs(e.dx)>3||Math.abs(e.dy)>3)){var t=this.seriesModel.getData().tree.root;if(!t)return;var i=t.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+e.dx,y:i.y+e.dy,width:i.width,height:i.height}})}},_onZoom:function(e){var t=e.originX,i=e.originY;if("animating"!==this._state){var n=this.seriesModel.getData().tree.root;if(!n)return;var a=n.getLayout();if(!a)return;var r=new Pn(a.x,a.y,a.width,a.height),o=this.seriesModel.layoutInfo;t-=o.x,i-=o.y;var s=ni.create();ni.translate(s,s,[-t,-i]),ni.scale(s,s,[e.scale,e.scale]),ni.translate(s,s,[t,i]),r.applyTransform(s),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:r.x,y:r.y,width:r.width,height:r.height}})}},_initEvents:function(e){e.on("click",(function(e){if("ready"===this._state){var t=this.seriesModel.get("nodeClick",!0);if(t){var i=this.findTarget(e.offsetX,e.offsetY);if(i){var n=i.node;if(n.getLayout().isLeafRoot)this._rootToNode(i);else if("zoomToNode"===t)this._zoomToNode(i);else if("link"===t){var a=n.hostTree.data.getItemModel(n.dataIndex),r=a.get("link",!0),o=a.get("target",!0)||"blank";r&&OA(r,o)}}}}}),this)},_renderBreadcrumb:function(e,t,i){i||(i=null!=e.get("leafDepth",!0)?{node:e.getViewRoot()}:this.findTarget(t.getWidth()/2,t.getHeight()/2))||(i={node:e.getData().tree.root}),(this._breadcrumb||(this._breadcrumb=new LA(this.group))).render(e,t,i.node,RA((function(t){"animating"!==this._state&&(bA.aboveViewRoot(e.getViewRoot(),t)?this._rootToNode({node:t}):this._zoomToNode({node:t}))}),this))},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage={nodeGroup:[],background:[],content:[]},this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(e){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},_rootToNode:function(e){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},findTarget:function(e,t){var i;return this.seriesModel.getViewRoot().eachNode({attr:"viewChildren",order:"preorder"},(function(n){var a=this._storage.background[n.getRawIndex()];if(a){var r=a.transformCoordToLocal(e,t),o=a.shape;if(!(o.x<=r[0]&&r[0]<=o.x+o.width&&o.y<=r[1]&&r[1]<=o.y+o.height))return!1;i={node:n,offsetX:r[0],offsetY:r[1]}}}),this),i}});for(var YA=function(){},XA=["treemapZoomToNode","treemapRender","treemapMove"],qA=0;qA<XA.length;qA++)X_.registerAction({type:XA[qA],update:"updateView"},YA);X_.registerAction({type:"treemapRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"treemap",query:e},(function(t,i){var n=bA.retrieveTargetInfo(e,["treemapZoomToNode","treemapRootToNode"],t);if(n){var a=t.getViewRoot();a&&(e.direction=bA.aboveViewRoot(a,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var $A=Pc.linearMap,KA=Ve.each,JA=Ve.isObject,QA=-1,eC=function(e){var t=e.mappingMethod,i=e.type,n=this.option=Ve.clone(e);this.type=i,this.mappingMethod=t,this._normalizeData=cC[t];var a=tC[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._doMap=a._doMap[t],"piecewise"===t?(iC(n),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,Ve.each(t,(function(t,i){t.originIndex=i,null!=t.visual&&(e.hasSpecialVisual=!0)}))}(n)):"category"===t?n.categories?function(e){var t=e.categories,i=e.visual,n=e.categoryMap={};if(KA(t,(function(e,t){n[e]=t})),!Ve.isArray(i)){var a=[];Ve.isObject(i)?KA(i,(function(e,t){var i=n[t];a[null!=i?i:QA]=e})):a[QA]=i,i=hC(e,a)}for(var r=t.length-1;r>=0;r--)null==i[r]&&(delete n[t[r]],t.pop())}(n):iC(n,!0):(Ve.assert("linear"!==t||n.dataExtent),iC(n))};eC.prototype={constructor:eC,mapValueToVisual:function(e){var t=this._normalizeData(e);return this._doMap(t,e)},getNormalizer:function(){return Ve.bind(this._normalizeData,this)}};var tC=eC.visualHandlers={color:{applyVisual:rC("color"),getColorMapper:function(){var e=this.option;return Ve.bind("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),oC.call(this,e)}:function(t,i,n){var a=!!n;return!i&&(t=this._normalizeData(t)),n=Ui.fastLerp(t,e.parsedVisual,n),a?n:Ui.stringify(n,"rgba")},this)},_doMap:{linear:function(e){return Ui.stringify(Ui.fastLerp(e,this.option.parsedVisual),"rgba")},category:oC,piecewise:function(e,t){var i=uC.call(this,t);return null==i&&(i=Ui.stringify(Ui.fastLerp(e,this.option.parsedVisual),"rgba")),i},fixed:sC}},colorHue:nC((function(e,t){return Ui.modifyHSL(e,t)})),colorSaturation:nC((function(e,t){return Ui.modifyHSL(e,null,t)})),colorLightness:nC((function(e,t){return Ui.modifyHSL(e,null,null,t)})),colorAlpha:nC((function(e,t){return Ui.modifyAlpha(e,t)})),opacity:{applyVisual:rC("opacity"),_doMap:lC([0,1])},liftZ:{applyVisual:rC("liftZ"),_doMap:{linear:sC,category:sC,piecewise:sC,fixed:sC}},symbol:{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);if(Ve.isString(n))i("symbol",n);else if(JA(n))for(var a in n)n.hasOwnProperty(a)&&i(a,n[a])},_doMap:{linear:aC,category:oC,piecewise:function(e,t){var i=uC.call(this,t);return null==i&&(i=aC.call(this,e)),i},fixed:sC}},symbolSize:{applyVisual:rC("symbolSize"),_doMap:lC([0,1])}};function iC(e,t){var i=e.visual,n=[];Ve.isObject(i)?KA(i,(function(e){n.push(e)})):null!=i&&n.push(i);t||1!==n.length||{color:1,symbol:1}.hasOwnProperty(e.type)||(n[1]=n[0]),hC(e,n)}function nC(e){return{applyVisual:function(t,i,n){t=this.mapValueToVisual(t),n("color",e(i("color"),t))},_doMap:lC([0,1])}}function aC(e){var t=this.option.visual;return t[Math.round($A(e,[0,1],[0,t.length-1],!0))]||{}}function rC(e){return function(t,i,n){n(e,this.mapValueToVisual(t))}}function oC(e){var t=this.option.visual;return t[this.option.loop&&e!==QA?e%t.length:e]}function sC(){return this.option.visual[0]}function lC(e){return{linear:function(t){return $A(t,e,this.option.visual,!0)},category:oC,piecewise:function(t,i){var n=uC.call(this,i);return null==n&&(n=$A(t,e,this.option.visual,!0)),n},fixed:sC}}function uC(e){var t=this.option,i=t.pieceList;if(t.hasSpecialVisual){var n=i[eC.findPieceIndex(e,i)];if(n&&n.visual)return n.visual[this.type]}}function hC(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=Ve.map(t,(function(e){return Ui.parse(e)}))),t}var cC={linear:function(e){return $A(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,i=eC.findPieceIndex(e,t,!0);if(null!=i)return $A(i,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?QA:t},fixed:Ve.noop};function dC(e,t,i){return e?t<=i:t<i}eC.listVisualTypes=function(){var e=[];return Ve.each(tC,(function(t,i){e.push(i)})),e},eC.addVisualHandler=function(e,t){tC[e]=t},eC.isValidType=function(e){return tC.hasOwnProperty(e)},eC.eachVisual=function(e,t,i){Ve.isObject(e)?Ve.each(e,t,i):t.call(i,e)},eC.mapVisual=function(e,t,i){var n,a=Ve.isArray(e)?[]:Ve.isObject(e)?{}:(n=!0,null);return eC.eachVisual(e,(function(e,r){var o=t.call(i,e,r);n?a=o:a[r]=o})),a},eC.retrieveVisuals=function(e){var t,i={};return e&&KA(tC,(function(n,a){e.hasOwnProperty(a)&&(i[a]=e[a],t=!0)})),t?i:null},eC.prepareVisualTypes=function(e){if(JA(e)){var t=[];KA(e,(function(e,i){t.push(i)})),e=t}else{if(!Ve.isArray(e))return[];e=e.slice()}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},eC.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},eC.findPieceIndex=function(e,t,i){for(var n,a=1/0,r=0,o=t.length;r<o;r++){var s=t[r].value;if(null!=s){if(s===e||"string"==typeof s&&s===e+"")return r;i&&c(s,r)}}for(r=0,o=t.length;r<o;r++){var l=t[r],u=l.interval,h=l.close;if(u){if(u[0]===-1/0){if(dC(h[1],e,u[1]))return r}else if(u[1]===1/0){if(dC(h[0],u[0],e))return r}else if(dC(h[0],u[0],e)&&dC(h[1],e,u[1]))return r;i&&c(u[0],r),i&&c(u[1],r)}}if(i)return e===1/0?t.length-1:e===-1/0?0:n;function c(t,i){var r=Math.abs(t-e);r<a&&(a=r,n=i)}};var pC=eC,fC=Ve.isArray,gC="itemStyle";function mC(e,t,i,n,a,r){var o=e.getModel(),s=e.getLayout();if(s&&!s.invisible&&s.isInView){var l,u=e.getModel(gC),h=function(e,t,i,n){var a=Ve.extend({},t);return Ve.each(["color","colorAlpha","colorSaturation"],(function(r){var o=e.get(r,!0);null==o&&i&&(o=i[r]),null==o&&(o=t[r]),null==o&&(o=n.get(r)),null!=o&&(a[r]=o)})),a}(u,t,i[e.depth],n),c=u.get("borderColor"),d=u.get("borderColorSaturation");null!=d&&(c=function(e,t){return null!=t?Ui.modifyHSL(t,null,null,e):null}(d,l=vC(h))),e.setVisual("borderColor",c);var p=e.viewChildren;if(p&&p.length){var f=function(e,t,i,n,a,r){if(!r||!r.length)return;var o=xC(t,"color")||null!=a.color&&"none"!==a.color&&(xC(t,"colorAlpha")||xC(t,"colorSaturation"));if(!o)return;var s=t.get("visualMin"),l=t.get("visualMax"),u=i.dataExtent.slice();null!=s&&s<u[0]&&(u[0]=s),null!=l&&l>u[1]&&(u[1]=l);var h=t.get("colorMappingBy"),c={type:o.name,dataExtent:u,visual:o.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new pC(c);return d.__drColorMappingBy=h,d}(0,o,s,0,h,p);Ve.each(p,(function(e,t){if(e.depth>=a.length||e===a[e.depth]){var s=function(e,t,i,n,a,r){var o=Ve.extend({},t);if(a){var s=a.type,l="color"===s&&a.__drColorMappingBy,u="index"===l?n:"id"===l?r.mapIdToIndex(i.getId()):i.getValue(e.get("visualDimension"));o[s]=a.mapValueToVisual(u)}return o}(o,h,e,t,f,r);mC(e,s,i,n,a,r)}}))}else l=vC(h),e.setVisual("color",l)}}function vC(e){var t=yC(e,"color");if(t){var i=yC(e,"colorAlpha"),n=yC(e,"colorSaturation");return n&&(t=Ui.modifyHSL(t,null,null,n)),i&&(t=Ui.modifyAlpha(t,i)),t}}function yC(e,t){var i=e[t];if(null!=i&&"none"!==i)return i}function xC(e,t){var i=e.get(t);return fC(i)&&i.length?{name:t,range:i}:null}var _C={seriesType:"treemap",reset:function(e,t,i,n){var a=e.getData().tree,r=a.root,o=e.getModel(gC);r.isRemoved()||mC(r,{},Ve.map(a.levelModels,(function(e){return e?e.get(gC):null})),o,e.getViewRoot().getAncestors(),e)}},bC=Pc.parsePercent,wC=Pc.MAX_SAFE_INTEGER,SC=Math.max,MC=Math.min,IC=Ve.retrieve,TC=Ve.each,AC=["itemStyle","borderWidth"],CC=["itemStyle","gapWidth"],DC=["upperLabel","show"],LC=["upperLabel","height"],PC={seriesType:"treemap",reset:function(e,t,i,n){var a=i.getWidth(),r=i.getHeight(),o=e.option,s=nd.getLayoutRect(e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=o.size||[],u=bC(IC(s.width,l[0]),a),h=bC(IC(s.height,l[1]),r),c=n&&n.type,d=bA.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),p="treemapRender"===c||"treemapMove"===c?n.rootRect:null,f=e.getViewRoot(),g=bA.getPathToRoot(f);if("treemapMove"!==c){var m="treemapZoomToNode"===c?function(e,t,i,n,a){var r,o=(t||{}).node,s=[n,a];if(!o||o===i)return s;var l=n*a,u=l*e.option.zoomToNodeRatio;for(;r=o.parentNode;){for(var h=0,c=r.children,d=0,p=c.length;d<p;d++)h+=c[d].getValue();var f=o.getValue();if(0===f)return s;u*=h/f;var g=r.getModel(),m=g.get(AC);(u+=4*m*m+(3*m+Math.max(m,NC(g)))*Math.pow(u,.5))>wC&&(u=wC),o=r}u<l&&(u=l);var v=Math.pow(u/l,.5);return[n*v,a*v]}(e,d,f,u,h):p?[p.width,p.height]:[u,h],v=o.sort;v&&"asc"!==v&&"desc"!==v&&(v="desc");var y={squareRatio:o.squareRatio,sort:v,leafDepth:o.leafDepth};f.hostTree.clearLayouts();var x={x:0,y:0,width:m[0],height:m[1],area:m[0]*m[1]};f.setLayout(x),kC(f,y,!1,0);x=f.getLayout();TC(g,(function(e,t){var i=(g[t+1]||f).getValue();e.setLayout(Ve.extend({dataExtent:[i,i],borderWidth:0,upperHeight:0},x))}))}var _=e.getData().tree.root;_.setLayout(function(e,t,i){if(t)return{x:t.x,y:t.y};var n={x:0,y:0};if(!i)return n;var a=i.node,r=a.getLayout();if(!r)return n;var o=[r.width/2,r.height/2],s=a;for(;s;){var l=s.getLayout();o[0]+=l.x,o[1]+=l.y,s=s.parentNode}return{x:e.width/2-o[0],y:e.height/2-o[1]}}(s,p,d),!0),e.setLayoutInfo(s),EC(_,new Pn(-s.x,-s.y,a,r),g,f,0)}};function kC(e,t,i,n){var a,r;if(!e.isRemoved()){var o=e.getLayout();a=o.width,r=o.height;var s=(p=e.getModel()).get(AC),l=p.get(CC)/2,u=NC(p),h=Math.max(s,u),c=s-l,d=h-l,p=e.getModel();e.setLayout({borderWidth:s,upperHeight:h,upperLabelHeight:u},!0);var f=(a=SC(a-2*c,0))*(r=SC(r-c-d,0)),g=function(e,t,i,n,a,r){var o=e.children||[],s=n.sort;"asc"!==s&&"desc"!==s&&(s=null);var l=null!=n.leafDepth&&n.leafDepth<=r;if(a&&!l)return e.viewChildren=[];o=Ve.filter(o,(function(e){return!e.isRemoved()})),function(e,t){t&&e.sort((function(e,i){var n="asc"===t?e.getValue()-i.getValue():i.getValue()-e.getValue();return 0===n?"asc"===t?e.dataIndex-i.dataIndex:i.dataIndex-e.dataIndex:n}))}(o,s);var u=function(e,t,i){for(var n=0,a=0,r=t.length;a<r;a++)n+=t[a].getValue();var o=e.get("visualDimension");if(t&&t.length)if("value"===o&&i)s=[t[t.length-1].getValue(),t[0].getValue()],"asc"===i&&s.reverse();else{var s=[1/0,-1/0];TC(t,(function(e){var t=e.getValue(o);t<s[0]&&(s[0]=t),t>s[1]&&(s[1]=t)}))}else s=[NaN,NaN];return{sum:n,dataExtent:s}}(t,o,s);if(0===u.sum)return e.viewChildren=[];if(u.sum=function(e,t,i,n,a){if(!n)return i;for(var r=e.get("visibleMin"),o=a.length,s=o,l=o-1;l>=0;l--){var u=a["asc"===n?o-l-1:l].getValue();u/i*t<r&&(s=l,i-=u)}return"asc"===n?a.splice(0,o-s):a.splice(s,o-s),i}(t,i,u.sum,s,o),0===u.sum)return e.viewChildren=[];for(var h=0,c=o.length;h<c;h++){var d=o[h].getValue()/u.sum*i;o[h].setLayout({area:d})}l&&(o.length&&e.setLayout({isLeafRoot:!0},!0),o.length=0);return e.viewChildren=o,e.setLayout({dataExtent:u.dataExtent},!0),o}(e,p,f,t,i,n);if(g.length){var m={x:c,y:d,width:a,height:r},v=MC(a,r),y=1/0,x=[];x.area=0;for(var _=0,b=g.length;_<b;){var w=g[_];x.push(w),x.area+=w.getLayout().area;var S=OC(x,v,t.squareRatio);S<=y?(_++,y=S):(x.area-=x.pop().getLayout().area,RC(x,v,m,l,!1),v=MC(m.width,m.height),x.length=x.area=0,y=1/0)}if(x.length&&RC(x,v,m,l,!0),!i){var M=p.get("childrenVisibleMin");null!=M&&f<M&&(i=!0)}for(_=0,b=g.length;_<b;_++)kC(g[_],t,i,n+1)}}}function OC(e,t,i){for(var n,a=0,r=1/0,o=0,s=e.length;o<s;o++)(n=e[o].getLayout().area)&&(n<r&&(r=n),n>a&&(a=n));var l=e.area*e.area,u=t*t*i;return l?SC(u*a/l,l/(u*r)):1/0}function RC(e,t,i,n,a){var r=t===i.width?0:1,o=1-r,s=["x","y"],l=["width","height"],u=i[s[r]],h=t?e.area/t:0;(a||h>i[l[o]])&&(h=i[l[o]]);for(var c=0,d=e.length;c<d;c++){var p=e[c],f={},g=h?p.getLayout().area/h:0,m=f[l[o]]=SC(h-2*n,0),v=i[s[r]]+i[l[r]]-u,y=c===d-1||v<g?v:g,x=f[l[r]]=SC(y-2*n,0);f[s[o]]=i[s[o]]+MC(n,m/2),f[s[r]]=u+MC(n,x/2),u+=y,p.setLayout(f,!0)}i[s[o]]+=h,i[l[o]]-=h}function EC(e,t,i,n,a){var r=e.getLayout(),o=i[a],s=o&&o===e;if(!(o&&!s||a===i.length&&e!==n)){e.setLayout({isInView:!0,invisible:!s&&!t.intersect(r),isAboveViewRoot:s},!0);var l=new Pn(t.x-r.x,t.y-r.y,t.width,t.height);TC(e.viewChildren||[],(function(e){EC(e,l,i,n,a+1)}))}}function NC(e){return e.get(DC)?e.get(LC):0}var zC=PC;X_.registerVisual(_C),X_.registerLayout(zC);var BC=Wo.enableClassCheck;function VC(e){return"_EC_"+e}var FC=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},GC=FC.prototype;function HC(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function WC(e,t,i){this.node1=e,this.node2=t,this.dataIndex=null==i?-1:i}GC.type="graph",GC.isDirected=function(){return this._directed},GC.addNode=function(e,t){e=null==e?""+t:""+e;var i=this._nodesMap;if(!i[VC(e)]){var n=new HC(e,t);return n.hostGraph=this,this.nodes.push(n),i[VC(e)]=n,n}},GC.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},GC.getNodeById=function(e){return this._nodesMap[VC(e)]},GC.addEdge=function(e,t,i){var n=this._nodesMap,a=this._edgesMap;if("number"==typeof e&&(e=this.nodes[e]),"number"==typeof t&&(t=this.nodes[t]),HC.isInstance(e)||(e=n[VC(e)]),HC.isInstance(t)||(t=n[VC(t)]),e&&t){var r=e.id+"-"+t.id;if(!a[r]){var o=new WC(e,t,i);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),a[r]=o,o}}},GC.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},GC.getEdge=function(e,t){HC.isInstance(e)&&(e=e.id),HC.isInstance(t)&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},GC.eachNode=function(e,t){for(var i=this.nodes,n=i.length,a=0;a<n;a++)i[a].dataIndex>=0&&e.call(t,i[a],a)},GC.eachEdge=function(e,t){for(var i=this.edges,n=i.length,a=0;a<n;a++)i[a].dataIndex>=0&&i[a].node1.dataIndex>=0&&i[a].node2.dataIndex>=0&&e.call(t,i[a],a)},GC.breadthFirstTraverse=function(e,t,i,n){if(HC.isInstance(t)||(t=this._nodesMap[VC(t)]),t){for(var a="out"===i?"outEdges":"in"===i?"inEdges":"edges",r=0;r<this.nodes.length;r++)this.nodes[r].__visited=!1;if(!e.call(n,t,null))for(var o=[t];o.length;){var s=o.shift(),l=s[a];for(r=0;r<l.length;r++){var u=l[r],h=u.node1===s?u.node2:u.node1;if(!h.__visited){if(e.call(n,h,s))return;o.push(h),h.__visited=!0}}}}},GC.update=function(){for(var e=this.data,t=this.edgeData,i=this.nodes,n=this.edges,a=0,r=i.length;a<r;a++)i[a].dataIndex=-1;for(a=0,r=e.count();a<r;a++)i[e.getRawIndex(a)].dataIndex=a;t.filterSelf((function(e){var i=n[t.getRawIndex(e)];return i.node1.dataIndex>=0&&i.node2.dataIndex>=0}));for(a=0,r=n.length;a<r;a++)n[a].dataIndex=-1;for(a=0,r=t.count();a<r;a++)n[t.getRawIndex(a)].dataIndex=a},GC.clone=function(){for(var e=new FC(this._directed),t=this.nodes,i=this.edges,n=0;n<t.length;n++)e.addNode(t[n].id,t[n].dataIndex);for(n=0;n<i.length;n++){var a=i[n];e.addEdge(a.node1.id,a.node2.id,a.dataIndex)}return e},HC.prototype={constructor:HC,degree:function(){return this.edges.length},inDegree:function(){return this.inEdges.length},outDegree:function(){return this.outEdges.length},getModel:function(e){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)}},WC.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)};var UC=function(e,t){return{getValue:function(i){var n=this[e][t];return n.get(n.getDimension(i||"value"),this.dataIndex)},setVisual:function(i,n){this.dataIndex>=0&&this[e][t].setItemVisual(this.dataIndex,i,n)},getVisual:function(i,n){return this[e][t].getItemVisual(this.dataIndex,i,n)},setLayout:function(i,n){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,i,n)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}};Ve.mixin(HC,UC("hostGraph","data")),Ve.mixin(WC,UC("hostGraph","edgeData")),FC.Node=HC,FC.Edge=WC,BC(HC),BC(WC);var jC=FC;var ZC=function(e,t,i,n,a){for(var r=new jC(n),o=0;o<e.length;o++)r.addNode(Ve.retrieve(e[o].id,e[o].name,o),o);var s=[],l=[],u=0;for(o=0;o<t.length;o++){var h=t[o],c=h.source,d=h.target;r.addEdge(c,d,u)&&(l.push(h),s.push(Ve.retrieve(h.id,c+" > "+d)),u++)}var p,f=i.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=py(e,i);else{var g=Tp.get(f),m=g&&"view"!==g.type&&g.dimensions||[];Ve.indexOf(m,"value")<0&&m.concat(["value"]);var v=qv(e,{coordDimensions:m});(p=new Rv(v,i)).initData(e)}var y=new Rv(["value"],i);return y.initData(l,s),a&&a(p,y),BT({mainData:p,struct:r,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),r.update(),r},YC=Ro.defaultEmphasis,XC=Uc.encodeHTML,qC=X_.extendSeriesModel({type:"series.graph",init:function(e){qC.superApply(this,"init",arguments);var t=this;function i(){return t._categoriesData}this.legendVisualProvider=new fM(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeOption:function(e){qC.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(e){qC.superApply(this,"mergeDefaultAndTheme",arguments),YC(e,["edgeLabel"],["show"])},getInitialData:function(e,t){var i=e.edges||e.links||[],n=e.data||e.nodes||[],a=this;if(n&&i)return ZC(n,i,this,!0,(function(e,i){e.wrapMethod("getItemModel",(function(e){var t=a._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var n=a.getModel("edgeLabel"),r=new mc({label:n.option},n.parentModel,t),o=a.getModel("emphasis.edgeLabel"),s=new mc({emphasis:{label:o.option}},o.parentModel,t);function l(e){return(e=this.parsePath(e))&&"label"===e[0]?r:e&&"emphasis"===e[0]&&"label"===e[1]?s:this.parentModel}i.wrapMethod("getItemModel",(function(e){return e.customizeGetParent(l),e}))})).data},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getData(),a=this.getDataParams(e,i),r=n.graph.getEdgeByIndex(e),o=n.getName(r.node1.dataIndex),s=n.getName(r.node2.dataIndex),l=[];return null!=o&&l.push(o),null!=s&&l.push(s),l=XC(l.join(" > ")),a.value&&(l+=" : "+XC(a.value)),l}return qC.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=Ve.map(this.option.categories||[],(function(e){return null!=e.value?e:Ve.extend({value:0},e)})),t=new Rv(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e,!0)}))},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e},isAnimationEnabled:function(){return qC.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,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:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),$C=tc.Line.prototype,KC=tc.BezierCurve.prototype;function JC(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var QC=tc.extendShape({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(e,t){this[JC(t)?"_buildPathLine":"_buildPathCurve"](e,t)},_buildPathLine:$C.buildPath,_buildPathCurve:KC.buildPath,pointAt:function(e){return this[JC(this.shape)?"_pointAtLine":"_pointAtCurve"](e)},_pointAtLine:$C.pointAt,_pointAtCurve:KC.pointAt,tangentAt:function(e){var t=this.shape,i=JC(t)?[t.x2-t.x1,t.y2-t.y1]:this._tangentAtCurve(e);return lt.normalize(i,i)},_tangentAtCurve:KC.tangentAt}),eD=Pc.round,tD=["fromSymbol","toSymbol"];function iD(e){return"_"+e+"Type"}function nD(e,t,i){var n=t.getItemVisual(i,"color"),a=t.getItemVisual(i,e),r=t.getItemVisual(i,e+"Size");if(a&&"none"!==a){Ve.isArray(r)||(r=[r,r]);var o=jx.createSymbol(a,-r[0]/2,-r[1]/2,r[0],r[1],n);return o.name=e,o}}function aD(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var i=t[2];i?(e.cpx1=i[0],e.cpy1=i[1]):(e.cpx1=NaN,e.cpy1=NaN)}function rD(e,t,i){tc.Group.call(this),this._createLine(e,t,i)}var oD=rD.prototype;oD.beforeUpdate=function(){var e=this,t=e.childOfName("fromSymbol"),i=e.childOfName("toSymbol"),n=e.childOfName("label");if(t||i||!n.ignore){for(var a=1,r=this.parent;r;)r.scale&&(a/=r.scale[0]),r=r.parent;var o=e.childOfName("line");if(this.__dirty||o.__dirty){var s=o.shape.percent,l=o.pointAt(0),u=o.pointAt(s),h=lt.sub([],u,l);if(lt.normalize(h,h),t){t.attr("position",l);var c=o.tangentAt(0);t.attr("rotation",Math.PI/2-Math.atan2(c[1],c[0])),t.attr("scale",[a*s,a*s])}if(i){i.attr("position",u);c=o.tangentAt(1);i.attr("rotation",-Math.PI/2-Math.atan2(c[1],c[0])),i.attr("scale",[a*s,a*s])}if(!n.ignore){var d,p,f,g;n.attr("position",u);var m=n.__labelDistance,v=m[0]*a,y=m[1]*a,x=s/2,_=[(c=o.tangentAt(x))[1],-c[0]],b=o.pointAt(x);_[1]>0&&(_[0]=-_[0],_[1]=-_[1]);var w,S=c[0]<0?-1:1;if("start"!==n.__position&&"end"!==n.__position){var M=-Math.atan2(c[1],c[0]);u[0]<l[0]&&(M=Math.PI+M),n.attr("rotation",M)}switch(n.__position){case"insideStartTop":case"insideMiddleTop":case"insideEndTop":case"middle":w=-y,f="bottom";break;case"insideStartBottom":case"insideMiddleBottom":case"insideEndBottom":w=y,f="top";break;default:w=0,f="middle"}switch(n.__position){case"end":d=[h[0]*v+u[0],h[1]*y+u[1]],p=h[0]>.8?"left":h[0]<-.8?"right":"center",f=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":d=[-h[0]*v+l[0],-h[1]*y+l[1]],p=h[0]>.8?"right":h[0]<-.8?"left":"center",f=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":d=[v*S+l[0],l[1]+w],p=c[0]<0?"right":"left",g=[-v*S,-w];break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":d=[b[0],b[1]+w],p="center",g=[0,-w];break;case"insideEndTop":case"insideEnd":case"insideEndBottom":d=[-v*S+u[0],u[1]+w],p=c[0]>=0?"right":"left",g=[v*S,-w]}n.attr({style:{textVerticalAlign:n.__verticalAlign||f,textAlign:n.__textAlign||p},position:d,scale:[a,a],origin:g})}}}},oD._createLine=function(e,t,i){var n=e.hostModel,a=function(e){var t=new QC({name:"line",subPixelOptimize:!0});return aD(t.shape,e),t}(e.getItemLayout(t));a.shape.percent=0,tc.initProps(a,{shape:{percent:1}},n,t),this.add(a);var r=new tc.Text({name:"label",lineLabelOriginalOpacity:1});this.add(r),Ve.each(tD,(function(i){var n=nD(i,e,t);this.add(n),this[iD(i)]=e.getItemVisual(t,i)}),this),this._updateCommonStl(e,t,i)},oD.updateData=function(e,t,i){var n=e.hostModel,a=this.childOfName("line"),r=e.getItemLayout(t),o={shape:{}};aD(o.shape,r),tc.updateProps(a,o,n,t),Ve.each(tD,(function(i){var n=e.getItemVisual(t,i),a=iD(i);if(this[a]!==n){this.remove(this.childOfName(i));var r=nD(i,e,t);this.add(r)}this[a]=n}),this),this._updateCommonStl(e,t,i)},oD._updateCommonStl=function(e,t,i){var n=e.hostModel,a=this.childOfName("line"),r=i&&i.lineStyle,o=i&&i.hoverLineStyle,s=i&&i.labelModel,l=i&&i.hoverLabelModel;if(!i||e.hasItemOption){var u=e.getItemModel(t);r=u.getModel("lineStyle").getLineStyle(),o=u.getModel("emphasis.lineStyle").getLineStyle(),s=u.getModel("label"),l=u.getModel("emphasis.label")}var h=e.getItemVisual(t,"color"),c=Ve.retrieve3(e.getItemVisual(t,"opacity"),r.opacity,1);a.useStyle(Ve.defaults({strokeNoScale:!0,fill:"none",stroke:h,opacity:c},r)),a.hoverStyle=o,Ve.each(tD,(function(e){var t=this.childOfName(e);t&&(t.setColor(h),t.setStyle({opacity:c}))}),this);var d,p,f=s.getShallow("show"),g=l.getShallow("show"),m=this.childOfName("label");if((f||g)&&(d=h||"#000",null==(p=n.getFormattedLabel(t,"normal",e.dataType)))){var v=n.getRawValue(t);p=null==v?e.getName(t):isFinite(v)?eD(v):v}var y=f?p:null,x=g?Ve.retrieve2(n.getFormattedLabel(t,"emphasis",e.dataType),p):null,_=m.style;if(null!=y||null!=x){tc.setTextStyle(m.style,s,{text:y},{autoColor:d}),m.__textAlign=_.textAlign,m.__verticalAlign=_.textVerticalAlign,m.__position=s.get("position")||"middle";var b=s.get("distance");Ve.isArray(b)||(b=[b,b]),m.__labelDistance=b}m.hoverStyle=null!=x?{text:x,textFill:l.getTextColor(!0),fontStyle:l.getShallow("fontStyle"),fontWeight:l.getShallow("fontWeight"),fontSize:l.getShallow("fontSize"),fontFamily:l.getShallow("fontFamily")}:{text:null},m.ignore=!f&&!g,tc.setHoverStyle(this)},oD.highlight=function(){this.trigger("emphasis")},oD.downplay=function(){this.trigger("normal")},oD.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},oD.setLinePoints=function(e){var t=this.childOfName("line");aD(t.shape,e),t.dirty()},Ve.inherits(rD,tc.Group);var sD=rD;function lD(e){this._ctor=e||sD,this.group=new tc.Group}var uD=lD.prototype;function hD(e){var t=e.hostModel;return{lineStyle:t.getModel("lineStyle").getLineStyle(),hoverLineStyle:t.getModel("emphasis.lineStyle").getLineStyle(),labelModel:t.getModel("label"),hoverLabelModel:t.getModel("emphasis.label")}}function cD(e){return isNaN(e[0])||isNaN(e[1])}function dD(e){return!cD(e[0])&&!cD(e[1])}uD.isPersistent=function(){return!0},uD.updateData=function(e){var t=this,i=t.group,n=t._lineData;t._lineData=e,n||i.removeAll();var a=hD(e);e.diff(n).add((function(i){!function(e,t,i,n){var a=t.getItemLayout(i);if(!dD(a))return;var r=new e._ctor(t,i,n);t.setItemGraphicEl(i,r),e.group.add(r)}(t,e,i,a)})).update((function(i,r){!function(e,t,i,n,a,r){var o=t.getItemGraphicEl(n);if(!dD(i.getItemLayout(a)))return void e.group.remove(o);o?o.updateData(i,a,r):o=new e._ctor(i,a,r);i.setItemGraphicEl(a,o),e.group.add(o)}(t,n,e,r,i,a)})).remove((function(e){i.remove(n.getItemGraphicEl(e))})).execute()},uD.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,i){t.updateLayout(e,i)}),this)},uD.incrementalPrepareUpdate=function(e){this._seriesScope=hD(e),this._lineData=null,this.group.removeAll()},uD.incrementalUpdate=function(e,t){function i(e){e.isGroup||function(e){return e.animators&&e.animators.length>0}(e)||(e.incremental=e.useHoverLayer=!0)}for(var n=e.start;n<e.end;n++){if(dD(t.getItemLayout(n))){var a=new this._ctor(t,n,this._seriesScope);a.traverse(i),this.group.add(a),t.setItemGraphicEl(n,a)}}},uD.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},uD._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var pD=lD;var fD={getNodeGlobalScale:function(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var i=e.option.nodeScaleRatio,n=t.scale,a=n&&n[0]||1;return((t.getZoom()-1)*i+1)/a},getSymbolSize:function(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}},gD=fD.getSymbolSize,mD=[],vD=[],yD=[],xD=ys.quadraticAt,_D=lt.distSquare,bD=Math.abs;function wD(e,t,i){for(var n,a=e[0],r=e[1],o=e[2],s=1/0,l=i*i,u=.1,h=.1;h<=.9;h+=.1){mD[0]=xD(a[0],r[0],o[0],h),mD[1]=xD(a[1],r[1],o[1],h),(p=bD(_D(mD,t)-l))<s&&(s=p,n=h)}for(var c=0;c<32;c++){var d=n+u;vD[0]=xD(a[0],r[0],o[0],n),vD[1]=xD(a[1],r[1],o[1],n),yD[0]=xD(a[0],r[0],o[0],d),yD[1]=xD(a[1],r[1],o[1],d);var p=_D(vD,t)-l;if(bD(p)<.01)break;var f=_D(yD,t)-l;u/=2,p<0?f>=0?n+=u:n-=u:f>=0?n-=u:n+=u}return n}var SD=function(e,t){var i=[],n=ys.quadraticSubdivide,a=[[],[],[]],r=[[],[]],o=[];t/=2,e.eachEdge((function(e,s){var l=e.getLayout(),u=e.getVisual("fromSymbol"),h=e.getVisual("toSymbol");l.__original||(l.__original=[lt.clone(l[0]),lt.clone(l[1])],l[2]&&l.__original.push(lt.clone(l[2])));var c=l.__original;if(null!=l[2]){if(lt.copy(a[0],c[0]),lt.copy(a[1],c[2]),lt.copy(a[2],c[1]),u&&"none"!==u){var d=gD(e.node1),p=wD(a,c[0],d*t);n(a[0][0],a[1][0],a[2][0],p,i),a[0][0]=i[3],a[1][0]=i[4],n(a[0][1],a[1][1],a[2][1],p,i),a[0][1]=i[3],a[1][1]=i[4]}if(h&&"none"!==h){d=gD(e.node2),p=wD(a,c[1],d*t);n(a[0][0],a[1][0],a[2][0],p,i),a[1][0]=i[1],a[2][0]=i[2],n(a[0][1],a[1][1],a[2][1],p,i),a[1][1]=i[1],a[2][1]=i[2]}lt.copy(l[0],a[0]),lt.copy(l[1],a[2]),lt.copy(l[2],a[1])}else{if(lt.copy(r[0],c[0]),lt.copy(r[1],c[1]),lt.sub(o,r[1],r[0]),lt.normalize(o,o),u&&"none"!==u){d=gD(e.node1);lt.scaleAndAdd(r[0],r[0],o,d*t)}if(h&&"none"!==h){d=gD(e.node2);lt.scaleAndAdd(r[1],r[1],o,-d*t)}lt.copy(l[0],r[0]),lt.copy(l[1],r[1])}}))},MD=QI.onIrrelevantElement,ID=fD.getNodeGlobalScale,TD="__focusNodeAdjacency",AD="__unfocusNodeAdjacency",CD=["itemStyle","opacity"],DD=["lineStyle","opacity"];function LD(e,t){var i=e.getVisual("opacity");return null!=i?i:e.getModel().get(t)}function PD(e,t,i){var n=e.getGraphicEl(),a=LD(e,t);null!=i&&(null==a&&(a=1),a*=i),n.downplay&&n.downplay(),n.traverse((function(e){if(!e.isGroup){var t=e.lineLabelOriginalOpacity;null!=t&&null==i||(t=a),e.setStyle("opacity",t)}}))}function kD(e,t){var i=LD(e,t),n=e.getGraphicEl();n.traverse((function(e){!e.isGroup&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}X_.extendChartView({type:"graph",init:function(e,t){var i=new yb,n=new pD,a=this.group;this._controller=new XI(t.getZr()),this._controllerHost={target:a},a.add(i.group),a.add(n.group),this._symbolDraw=i,this._lineDraw=n,this._firstRender=!0},render:function(e,t,i){var n=this,a=e.coordinateSystem;this._model=e;var r=this._symbolDraw,o=this._lineDraw,s=this.group;if("view"===a.type){var l={position:a.position,scale:a.scale};this._firstRender?s.attr(l):tc.updateProps(s,l,e)}SD(e.getGraph(),ID(e));var u=e.getData();r.updateData(u);var h=e.getEdgeData();o.updateData(h),this._updateNodeAndLinkScale(),this._updateController(e,t,i),clearTimeout(this._layoutTimeout);var c=e.forceLayout,d=e.get("force.layoutAnimation");c&&this._startForceLayoutIteration(c,d),u.eachItemGraphicEl((function(t,a){var r=u.getItemModel(a);t.off("drag").off("dragend");var o=r.get("draggable");o&&t.on("drag",(function(){c&&(c.warmUp(),!this._layouting&&this._startForceLayoutIteration(c,d),c.setFixed(a),u.setItemLayout(a,t.position))}),this).on("dragend",(function(){c&&c.setUnfixed(a)}),this),t.setDraggable(o&&c),t[TD]&&t.off("mouseover",t[TD]),t[AD]&&t.off("mouseout",t[AD]),r.get("focusNodeAdjacency")&&(t.on("mouseover",t[TD]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex})}),t.on("mouseout",t[AD]=function(){n._dispatchUnfocus(i)}))}),this),u.graph.eachEdge((function(t){var a=t.getGraphicEl();a[TD]&&a.off("mouseover",a[TD]),a[AD]&&a.off("mouseout",a[AD]),t.getModel().get("focusNodeAdjacency")&&(a.on("mouseover",a[TD]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex})}),a.on("mouseout",a[AD]=function(){n._dispatchUnfocus(i)}))}));var p="circular"===e.get("layout")&&e.get("circular.rotateLabel"),f=u.getLayout("cx"),g=u.getLayout("cy");u.eachItemGraphicEl((function(e,t){var i=u.getItemModel(t).get("label.rotate")||0,n=e.getSymbolPath();if(p){var a=u.getItemLayout(t),r=Math.atan2(a[1]-g,a[0]-f);r<0&&(r=2*Math.PI+r);var o=a[0]<f;o&&(r-=Math.PI);var s=o?"left":"right";tc.modifyLabelStyle(n,{textRotation:-r,textPosition:s,textOrigin:"center"},{textPosition:s})}else tc.modifyLabelStyle(n,{textRotation:i*=Math.PI/180})})),this._firstRender=!1},dispose:function(){this._controller&&this._controller.dispose(),this._controllerHost={},this._clearTimer()},_dispatchUnfocus:function(e,t){var i=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout((function(){i._unfocusDelayTimer=null,e.dispatchAction({type:"unfocusNodeAdjacency",seriesId:i._model.id})}),500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(e,t,i,n){var a=e.getData().graph,r=n.dataIndex,o=n.edgeDataIndex,s=a.getNodeByIndex(r),l=a.getEdgeByIndex(o);(s||l)&&(a.eachNode((function(e){PD(e,CD,.1)})),a.eachEdge((function(e){PD(e,DD,.1)})),s&&(kD(s,CD),Ve.each(s.edges,(function(e){e.dataIndex<0||(kD(e,DD),kD(e.node1,CD),kD(e.node2,CD))}))),l&&(kD(l,DD),kD(l.node1,CD),kD(l.node2,CD)))},unfocusNodeAdjacency:function(e,t,i,n){var a=e.getData().graph;a.eachNode((function(e){PD(e,CD)})),a.eachEdge((function(e){PD(e,DD)}))},_startForceLayoutIteration:function(e,t){var i=this;!function n(){e.step((function(e){i.updateLayout(i._model),(i._layouting=!e)&&(t?i._layoutTimeout=setTimeout(n,16):n())}))}()},_updateController:function(e,t,i){var n=this._controller,a=this._controllerHost,r=this.group;n.setPointerChecker((function(t,n,a){var o=r.getBoundingRect();return o.applyTransform(r.transform),o.contain(n,a)&&!MD(t,i,e)})),"view"===e.coordinateSystem.type?(n.enable(e.get("roam")),a.zoomLimit=e.get("scaleLimit"),a.zoom=e.coordinateSystem.getZoom(),n.off("pan").off("zoom").on("pan",(function(t){$I.updateViewOnPan(a,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){$I.updateViewOnZoom(a,t.scale,t.originX,t.originY),i.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),this._updateNodeAndLinkScale(),SD(e.getGraph(),ID(e)),this._lineDraw.updateLayout()}),this)):n.disable()},_updateNodeAndLinkScale:function(){var e=this._model,t=e.getData(),i=ID(e),n=[i,i];t.eachItemGraphicEl((function(e,t){e.attr("scale",n)}))},updateLayout:function(e){SD(e.getGraph(),ID(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()}}),X_.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},(function(){})),X_.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},(function(){}));var OD=cT.updateCenterAndZoom;X_.registerAction({type:"graphRoam",event:"graphRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){var i=t.coordinateSystem,n=OD(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var RD=function(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),n=e.getGraph().data,a=i.mapArray(i.getName);n.filterSelf((function(e){var i=n.getItemModel(e).getShallow("category");if(null!=i){"number"==typeof i&&(i=a[i]);for(var r=0;r<t.length;r++)if(!t[r].isSelected(i))return!1}return!0}))}),this)};var ED=function(e){var t={};e.eachSeriesByType("graph",(function(e){var i=e.getCategoriesData(),n=e.getData(),a={};i.each((function(n){var r=i.getName(n);a["ec-"+r]=n;var o=i.getItemModel(n),s=o.get("itemStyle.color")||e.getColorFromPalette(r,t);i.setItemVisual(n,"color",s);for(var l=["opacity","symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var h=o.getShallow(l[u],!0);null!=h&&i.setItemVisual(n,l[u],h)}})),i.count()&&n.each((function(e){var t=n.getItemModel(e).getShallow("category");if(null!=t){"string"==typeof t&&(t=a["ec-"+t]);for(var r=["color","opacity","symbol","symbolSize","symbolKeepAspect"],o=0;o<r.length;o++)null==n.getItemVisual(e,r[o],!0)&&n.setItemVisual(e,r[o],i.getItemVisual(t,r[o]))}}))}))};function ND(e){return e instanceof Array||(e=[e,e]),e}var zD=function(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),i=e.getEdgeData(),n=ND(e.get("edgeSymbol")),a=ND(e.get("edgeSymbolSize")),r="lineStyle.color".split("."),o="lineStyle.opacity".split(".");i.setVisual("fromSymbol",n&&n[0]),i.setVisual("toSymbol",n&&n[1]),i.setVisual("fromSymbolSize",a&&a[0]),i.setVisual("toSymbolSize",a&&a[1]),i.setVisual("color",e.get(r)),i.setVisual("opacity",e.get(o)),i.each((function(e){var n=i.getItemModel(e),a=t.getEdgeByIndex(e),s=ND(n.getShallow("symbol",!0)),l=ND(n.getShallow("symbolSize",!0)),u=n.get(r),h=n.get(o);switch(u){case"source":u=a.node1.getVisual("color");break;case"target":u=a.node2.getVisual("color")}s[0]&&a.setVisual("fromSymbol",s[0]),s[1]&&a.setVisual("toSymbol",s[1]),l[0]&&a.setVisual("fromSymbolSize",l[0]),l[1]&&a.setVisual("toSymbolSize",l[1]),a.setVisual("color",u),a.setVisual("opacity",h)}))}))};function BD(e){e.eachEdge((function(e){var t=e.getModel().get("lineStyle.curveness")||0,i=lt.clone(e.node1.getLayout()),n=lt.clone(e.node2.getLayout()),a=[i,n];+t&&a.push([(i[0]+n[0])/2-(i[1]-n[1])*t,(i[1]+n[1])/2-(n[0]-i[0])*t]),e.setLayout(a)}))}var VD=function(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var i=e.getGraph();i.eachNode((function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])})),BD(i)}},FD={simpleLayout:VD,simpleLayoutEdge:BD},GD=Ve.each,HD=FD.simpleLayout,WD=FD.simpleLayoutEdge;var UD=function(e,t){e.eachSeriesByType("graph",(function(e){var t=e.get("layout"),i=e.coordinateSystem;if(i&&"view"!==i.type){var n=e.getData(),a=[];GD(i.dimensions,(function(e){a=a.concat(n.mapDimension(e,!0))}));for(var r=0;r<n.count();r++){for(var o=[],s=!1,l=0;l<a.length;l++){var u=n.get(a[l],r);isNaN(u)||(s=!0),o.push(u)}s?n.setItemLayout(r,i.dataToPoint(o)):n.setItemLayout(r,[NaN,NaN])}WD(n.graph)}else t&&"none"!==t||HD(e)}))},jD=fD.getSymbolSize,ZD=fD.getNodeGlobalScale,YD=Math.PI,XD=[];var qD={value:function(e,t,i,n,a,r,o,s){var l=0,u=n.getSum("value"),h=2*Math.PI/(u||s);i.eachNode((function(e){var t=e.getValue("value"),i=h*(u?t:1)/2;l+=i,e.setLayout([a*Math.cos(l)+r,a*Math.sin(l)+o]),l+=i}))},symbolSize:function(e,t,i,n,a,r,o,s){var l=0;XD.length=s;var u=ZD(e);i.eachNode((function(e){var t=jD(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=u;var i=Math.asin(t/2/a);isNaN(i)&&(i=YD/2),XD[e.dataIndex]=i,l+=2*i}));var h=(2*YD-l)/s/2,c=0;i.eachNode((function(e){var t=h+XD[e.dataIndex];c+=t,e.setLayout([a*Math.cos(c)+r,a*Math.sin(c)+o]),c+=t}))}},$D=function(e,t){var i=e.coordinateSystem;if(!i||"view"===i.type){var n=i.getBoundingRect(),a=e.getData(),r=a.graph,o=n.width/2+n.x,s=n.height/2+n.y,l=Math.min(n.width,n.height)/2,u=a.count();a.setLayout({cx:o,cy:s}),u&&(qD[t](e,i,r,a,l,o,s,u),r.eachEdge((function(e){var t,i=e.getModel().get("lineStyle.curveness")||0,n=lt.clone(e.node1.getLayout()),a=lt.clone(e.node2.getLayout()),r=(n[0]+a[0])/2,l=(n[1]+a[1])/2;+i&&(t=[o*(i*=3)+r*(1-i),s*i+l*(1-i)]),e.setLayout([n,a,t])})))}},KD={circularLayout:$D},JD=KD.circularLayout;var QD=function(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&JD(e,"symbolSize")}))},eL=lt.scaleAndAdd;var tL=function(e,t,i){for(var n=i.rect,a=n.width,r=n.height,o=[n.x+a/2,n.y+r/2],s=null==i.gravity?.1:i.gravity,l=0;l<e.length;l++){var u=e[l];u.p||(u.p=lt.create(a*(Math.random()-.5)+o[0],r*(Math.random()-.5)+o[1])),u.pp=lt.clone(u.p),u.edges=null}var h=null==i.friction?.6:i.friction,c=h;return{warmUp:function(){c=.8*h},setFixed:function(t){e[t].fixed=!0},setUnfixed:function(t){e[t].fixed=!1},step:function(i){for(var n=[],a=e.length,r=0;r<t.length;r++){var l=t[r];if(!l.ignoreForceLayout){var u=l.n1,h=l.n2;lt.sub(n,h.p,u.p);var d=lt.len(n)-l.d,p=h.w/(u.w+h.w);isNaN(p)&&(p=0),lt.normalize(n,n),!u.fixed&&eL(u.p,u.p,n,p*d*c),!h.fixed&&eL(h.p,h.p,n,-(1-p)*d*c)}}for(r=0;r<a;r++){(v=e[r]).fixed||(lt.sub(n,o,v.p),eL(v.p,v.p,n,s*c))}for(r=0;r<a;r++){u=e[r];for(var f=r+1;f<a;f++){h=e[f];lt.sub(n,h.p,u.p),0===(d=lt.len(n))&&(lt.set(n,Math.random()-.5,Math.random()-.5),d=1);var g=(u.rep+h.rep)/d/d;!u.fixed&&eL(u.pp,u.pp,n,g),!h.fixed&&eL(h.pp,h.pp,n,-g)}}var m=[];for(r=0;r<a;r++){var v;(v=e[r]).fixed||(lt.sub(m,v.p,v.pp),eL(v.p,v.p,m,c),lt.copy(v.pp,v.p))}c*=.992,i&&i(e,t,c<.01)}}},iL={forceLayout:tL}.forceLayout,nL=FD.simpleLayout,aL=KD.circularLayout,rL=Pc.linearMap;var oL=function(e){e.eachSeriesByType("graph",(function(e){if(!(c=e.coordinateSystem)||"view"===c.type)if("force"===e.get("layout")){var t=e.preservedPoints||{},i=e.getGraph(),n=i.data,a=i.edgeData,r=e.getModel("force"),o=r.get("initLayout");e.preservedPoints?n.each((function(e){var i=n.getId(e);n.setItemLayout(e,t[i]||[NaN,NaN])})):o&&"none"!==o?"circular"===o&&aL(e,"value"):nL(e);var s=n.getDataExtent("value"),l=a.getDataExtent("value"),u=r.get("repulsion"),h=r.get("edgeLength");Ve.isArray(u)||(u=[u,u]),Ve.isArray(h)||(h=[h,h]),h=[h[1],h[0]];var c,d=n.mapArray("value",(function(e,t){var i=n.getItemLayout(t),a=rL(e,s,u);return isNaN(a)&&(a=(u[0]+u[1])/2),{w:a,rep:a,fixed:n.getItemModel(t).get("fixed"),p:!i||isNaN(i[0])||isNaN(i[1])?null:i}})),p=a.mapArray("value",(function(e,t){var n=i.getEdgeByIndex(t),a=rL(e,l,h);isNaN(a)&&(a=(h[0]+h[1])/2);var r=n.getModel();return{n1:d[n.node1.dataIndex],n2:d[n.node2.dataIndex],d:a,curveness:r.get("lineStyle.curveness")||0,ignoreForceLayout:r.get("ignoreForceLayout")}})),f=(c=e.coordinateSystem).getBoundingRect(),g=iL(d,p,{rect:f,gravity:r.get("gravity"),friction:r.get("friction")}),m=g.step;g.step=function(e){for(var a=0,r=d.length;a<r;a++)d[a].fixed&&lt.copy(d[a].p,i.getNodeByIndex(a).getLayout());m((function(a,r,o){for(var s=0,l=a.length;s<l;s++)a[s].fixed||i.getNodeByIndex(s).setLayout(a[s].p),t[n.getId(s)]=a[s].p;for(s=0,l=r.length;s<l;s++){var u=r[s],h=i.getEdgeByIndex(s),c=u.n1.p,d=u.n2.p,p=h.getLayout();(p=p?p.slice():[])[0]=p[0]||[],p[1]=p[1]||[],lt.copy(p[0],c),lt.copy(p[1],d),+u.curveness&&(p[2]=[(c[0]+d[0])/2-(c[1]-d[1])*u.curveness,(c[1]+d[1])/2-(d[0]-c[0])*u.curveness]),h.setLayout(p)}e&&e(o)}))},e.forceLayout=g,e.preservedPoints=t,g.step()}else e.forceLayout=null}))},sL=nd.getLayoutRect;var lL=function(e,t){var i=[];return e.eachSeriesByType("graph",(function(e){var n=e.get("coordinateSystem");if(!n||"view"===n){var a=e.getData(),r=a.mapArray((function(e){var t=a.getItemModel(e);return[+t.get("x"),+t.get("y")]})),o=[],s=[];Rs.fromPoints(r,o,s),s[0]-o[0]==0&&(s[0]+=1,o[0]-=1),s[1]-o[1]==0&&(s[1]+=1,o[1]-=1);var l=(s[0]-o[0])/(s[1]-o[1]),u=function(e,t,i){var n=e.getBoxLayoutParams();return n.aspect=i,sL(n,{width:t.getWidth(),height:t.getHeight()})}(e,t,l);isNaN(l)&&(o=[u.x,u.y],s=[u.x+u.width,u.y+u.height]);var h=s[0]-o[0],c=s[1]-o[1],d=u.width,p=u.height,f=e.coordinateSystem=new vT;f.zoomLimit=e.get("scaleLimit"),f.setBoundingRect(o[0],o[1],h,c),f.setViewRect(u.x,u.y,d,p),f.setCenter(e.get("center")),f.setZoom(e.get("zoom")),i.push(f)}})),i};X_.registerProcessor(RD),X_.registerVisual(aw("graph","circle",null)),X_.registerVisual(ED),X_.registerVisual(zD),X_.registerLayout(UD),X_.registerLayout(X_.PRIORITY.VISUAL.POST_CHART_LAYOUT,QD),X_.registerLayout(oL),X_.registerCoordinateSystem("graphView",{create:lL}),og.extend({type:"series.gauge",getInitialData:function(e,t){return dM(this,["value"])},defaultOption:{zlevel:0,z:2,center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#91c7ae"],[.8,"#63869e"],[1,"#c23531"]],width:30}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,distance:5,color:"auto"},pointer:{show:!0,length:"80%",width:8},itemStyle:{color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],color:"#333",fontSize:15},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"auto",fontSize:30}}});var uL=bl.extend({type:"echartsGaugePointer",shape:{angle:0,width:10,r:10,x:0,y:0},buildPath:function(e,t){var i=Math.cos,n=Math.sin,a=t.r,r=t.width,o=t.angle,s=t.x-i(o)*r*(r>=a/3?1:2),l=t.y-n(o)*r*(r>=a/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,l),e.lineTo(t.x+i(o)*r,t.y+n(o)*r),e.lineTo(t.x+i(t.angle)*a,t.y+n(t.angle)*a),e.lineTo(t.x-i(o)*r,t.y-n(o)*r),e.lineTo(s,l)}}),hL=uL,cL=Pc.parsePercent,dL=Pc.round,pL=Pc.linearMap;function fL(e,t){return t&&("string"==typeof t?e=t.replace("{value}",null!=e?e:""):"function"==typeof t&&(e=t(e))),e}var gL=2*Math.PI;Sg.extend({type:"gauge",render:function(e,t,i){this.group.removeAll();var n=e.get("axisLine.lineStyle.color"),a=function(e,t){var i=e.get("center"),n=t.getWidth(),a=t.getHeight(),r=Math.min(n,a);return{cx:cL(i[0],t.getWidth()),cy:cL(i[1],t.getHeight()),r:cL(e.get("radius"),r/2)}}(e,i);this._renderMain(e,t,i,n,a)},dispose:function(){},_renderMain:function(e,t,i,n,a){for(var r=this.group,o=e.getModel("axisLine"),s=o.getModel("lineStyle"),l=e.get("clockwise"),u=-e.get("startAngle")/180*Math.PI,h=((g=-e.get("endAngle")/180*Math.PI)-u)%gL,c=u,d=s.get("width"),p=o.get("show"),f=0;p&&f<n.length;f++){var g=u+h*Math.min(Math.max(n[f][0],0),1),m=new tc.Sector({shape:{startAngle:c,endAngle:g,cx:a.cx,cy:a.cy,clockwise:l,r0:a.r-d,r:a.r},silent:!0});m.setStyle({fill:n[f][1]}),m.setStyle(s.getLineStyle(["color","borderWidth","borderColor"])),r.add(m),c=g}var v=function(e){if(e<=0)return n[0][1];for(var t=0;t<n.length;t++)if(n[t][0]>=e&&(0===t?0:n[t-1][0])<e)return n[t][1];return n[t-1][1]};if(!l){var y=u;u=g,g=y}this._renderTicks(e,t,i,v,a,u,g,l),this._renderPointer(e,t,i,v,a,u,g,l),this._renderTitle(e,t,i,v,a),this._renderDetail(e,t,i,v,a)},_renderTicks:function(e,t,i,n,a,r,o,s){for(var l=this.group,u=a.cx,h=a.cy,c=a.r,d=+e.get("min"),p=+e.get("max"),f=e.getModel("splitLine"),g=e.getModel("axisTick"),m=e.getModel("axisLabel"),v=e.get("splitNumber"),y=g.get("splitNumber"),x=cL(f.get("length"),c),_=cL(g.get("length"),c),b=r,w=(o-r)/v,S=w/y,M=f.getModel("lineStyle").getLineStyle(),I=g.getModel("lineStyle").getLineStyle(),T=0;T<=v;T++){var A=Math.cos(b),C=Math.sin(b);if(f.get("show")){var D=new tc.Line({shape:{x1:A*c+u,y1:C*c+h,x2:A*(c-x)+u,y2:C*(c-x)+h},style:M,silent:!0});"auto"===M.stroke&&D.setStyle({stroke:n(T/v)}),l.add(D)}if(m.get("show")){var L=fL(dL(T/v*(p-d)+d),m.get("formatter")),P=m.get("distance"),k=n(T/v);l.add(new tc.Text({style:tc.setTextStyle({},m,{text:L,x:A*(c-x-P)+u,y:C*(c-x-P)+h,textVerticalAlign:C<-.4?"top":C>.4?"bottom":"middle",textAlign:A<-.4?"left":A>.4?"right":"center"},{autoColor:k}),silent:!0}))}if(g.get("show")&&T!==v){for(var O=0;O<=y;O++){A=Math.cos(b),C=Math.sin(b);var R=new tc.Line({shape:{x1:A*c+u,y1:C*c+h,x2:A*(c-_)+u,y2:C*(c-_)+h},silent:!0,style:I});"auto"===I.stroke&&R.setStyle({stroke:n((T+O/y)/v)}),l.add(R),b+=S}b-=S}else b+=w}},_renderPointer:function(e,t,i,n,a,r,o,s){var l=this.group,u=this._data;if(e.get("pointer.show")){var h=[+e.get("min"),+e.get("max")],c=[r,o],d=e.getData(),p=d.mapDimension("value");d.diff(u).add((function(t){var i=new hL({shape:{angle:r}});tc.initProps(i,{shape:{angle:pL(d.get(p,t),h,c,!0)}},e),l.add(i),d.setItemGraphicEl(t,i)})).update((function(t,i){var n=u.getItemGraphicEl(i);tc.updateProps(n,{shape:{angle:pL(d.get(p,t),h,c,!0)}},e),l.add(n),d.setItemGraphicEl(t,n)})).remove((function(e){var t=u.getItemGraphicEl(e);l.remove(t)})).execute(),d.eachItemGraphicEl((function(e,t){var i=d.getItemModel(t),r=i.getModel("pointer");e.setShape({x:a.cx,y:a.cy,width:cL(r.get("width"),a.r),r:cL(r.get("length"),a.r)}),e.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===e.style.fill&&e.setStyle("fill",n(pL(d.get(p,t),h,[0,1],!0))),tc.setHoverStyle(e,i.getModel("emphasis.itemStyle").getItemStyle())})),this._data=d}else u&&u.eachItemGraphicEl((function(e){l.remove(e)}))},_renderTitle:function(e,t,i,n,a){var r=e.getData(),o=r.mapDimension("value"),s=e.getModel("title");if(s.get("show")){var l=s.get("offsetCenter"),u=a.cx+cL(l[0],a.r),h=a.cy+cL(l[1],a.r),c=+e.get("min"),d=+e.get("max"),p=e.getData().get(o,0),f=n(pL(p,[c,d],[0,1],!0));this.group.add(new tc.Text({silent:!0,style:tc.setTextStyle({},s,{x:u,y:h,text:r.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:f,forceRich:!0})}))}},_renderDetail:function(e,t,i,n,a){var r=e.getModel("detail"),o=+e.get("min"),s=+e.get("max");if(r.get("show")){var l=r.get("offsetCenter"),u=a.cx+cL(l[0],a.r),h=a.cy+cL(l[1],a.r),c=cL(r.get("width"),a.r),d=cL(r.get("height"),a.r),p=e.getData(),f=p.get(p.mapDimension("value"),0),g=n(pL(f,[o,s],[0,1],!0));this.group.add(new tc.Text({silent:!0,style:tc.setTextStyle({},r,{x:u,y:h,text:fL(f,r.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}});var mL=Ro.defaultEmphasis,vL=tp.makeSeriesEncodeForNameBased,yL=X_.extendSeriesModel({type:"series.funnel",init:function(e){yL.superApply(this,"init",arguments),this.legendVisualProvider=new fM(Ve.bind(this.getData,this),Ve.bind(this.getRawData,this)),this._defaultLabelLine(e)},getInitialData:function(e,t){return dM(this,{coordDimensions:["value"],encodeDefaulter:Ve.curry(vL,this)})},_defaultLabelLine:function(e){mL(e,"labelLine",["show"]);var t=e.labelLine,i=e.emphasis.labelLine;t.show=t.show&&e.label.show,i.show=i.show&&e.emphasis.label.show},getDataParams:function(e){var t=this.getData(),i=yL.superCall(this,"getDataParams",e),n=t.mapDimension("value"),a=t.getSum(n);return i.percent=a?+(t.get(n,e)/a*100).toFixed(2):0,i.$vars.push("percent"),i},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}});function xL(e,t){tc.Group.call(this);var i=new tc.Polygon,n=new tc.Polyline,a=new tc.Text;this.add(i),this.add(n),this.add(a),this.highDownOnUpdate=function(e,t){"emphasis"===t?(n.ignore=n.hoverIgnore,a.ignore=a.hoverIgnore):(n.ignore=n.normalIgnore,a.ignore=a.normalIgnore)},this.updateData(e,t,!0)}var _L=xL.prototype,bL=["itemStyle","opacity"];_L.updateData=function(e,t,i){var n=this.childAt(0),a=e.hostModel,r=e.getItemModel(t),o=e.getItemLayout(t),s=e.getItemModel(t).get(bL);s=null==s?1:s,n.useStyle({}),i?(n.setShape({points:o.points}),n.setStyle({opacity:0}),tc.initProps(n,{style:{opacity:s}},a,t)):tc.updateProps(n,{style:{opacity:s},shape:{points:o.points}},a,t);var l=r.getModel("itemStyle"),u=e.getItemVisual(t,"color");n.setStyle(Ve.defaults({lineJoin:"round",fill:u},l.getItemStyle(["opacity"]))),n.hoverStyle=l.getModel("emphasis").getItemStyle(),this._updateLabel(e,t),tc.setHoverStyle(this)},_L._updateLabel=function(e,t){var i=this.childAt(1),n=this.childAt(2),a=e.hostModel,r=e.getItemModel(t),o=e.getItemLayout(t).label,s=e.getItemVisual(t,"color");tc.updateProps(i,{shape:{points:o.linePoints||o.linePoints}},a,t),tc.updateProps(n,{style:{x:o.x,y:o.y}},a,t),n.attr({rotation:o.rotation,origin:[o.x,o.y],z2:10});var l=r.getModel("label"),u=r.getModel("emphasis.label"),h=r.getModel("labelLine"),c=r.getModel("emphasis.labelLine");s=e.getItemVisual(t,"color");tc.setLabelStyle(n.style,n.hoverStyle={},l,u,{labelFetcher:e.hostModel,labelDataIndex:t,defaultText:e.getName(t),autoColor:s,useInsideStyle:!!o.inside},{textAlign:o.textAlign,textVerticalAlign:o.verticalAlign}),n.ignore=n.normalIgnore=!l.get("show"),n.hoverIgnore=!u.get("show"),i.ignore=i.normalIgnore=!h.get("show"),i.hoverIgnore=!c.get("show"),i.setStyle({stroke:s}),i.setStyle(h.getModel("lineStyle").getLineStyle()),i.hoverStyle=c.getModel("lineStyle").getLineStyle()},Ve.inherits(xL,tc.Group),Sg.extend({type:"funnel",render:function(e,t,i){var n=e.getData(),a=this._data,r=this.group;n.diff(a).add((function(e){var t=new xL(n,e);n.setItemGraphicEl(e,t),r.add(t)})).update((function(e,t){var i=a.getItemGraphicEl(t);i.updateData(n,e),r.add(i),n.setItemGraphicEl(e,i)})).remove((function(e){var t=a.getItemGraphicEl(e);r.remove(t)})).execute(),this._data=n},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var wL=Pc.parsePercent,SL=Pc.linearMap;var ML=function(e,t,i){e.eachSeriesByType("funnel",(function(e){var i=e.getData(),n=i.mapDimension("value"),a=e.get("sort"),r=function(e,t){return nd.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t),o=function(e,t){for(var i=e.mapDimension("value"),n=e.mapArray(i,(function(e){return e})),a=[],r="ascending"===t,o=0,s=e.count();o<s;o++)a[o]=o;return"function"==typeof t?a.sort(t):"none"!==t&&a.sort((function(e,t){return r?n[e]-n[t]:n[t]-n[e]})),a}(i,a),s=[wL(e.get("minSize"),r.width),wL(e.get("maxSize"),r.width)],l=i.getDataExtent(n),u=e.get("min"),h=e.get("max");null==u&&(u=Math.min(l[0],0)),null==h&&(h=l[1]);var c=e.get("funnelAlign"),d=e.get("gap"),p=(r.height-d*(i.count()-1))/i.count(),f=r.y,g=function(e,t){var a,o=i.get(n,e)||0,l=SL(o,[u,h],s,!0);switch(c){case"left":a=r.x;break;case"center":a=r.x+(r.width-l)/2;break;case"right":a=r.x+r.width-l}return[[a,t],[a+l,t]]};"ascending"===a&&(p=-p,d=-d,f+=r.height,o=o.reverse());for(var m=0;m<o.length;m++){var v=o[m],y=o[m+1],x=i.getItemModel(v).get("itemStyle.height");null==x?x=p:(x=wL(x,r.height),"ascending"===a&&(x=-x));var _=g(v,f),b=g(y,f+x);f+=x+d,i.setItemLayout(v,{points:_.concat(b.slice().reverse())})}!function(e){e.each((function(t){var i,n,a,r,o=e.getItemModel(t),s=o.getModel("label").get("position"),l=o.getModel("labelLine"),u=e.getItemLayout(t),h=u.points,c="inner"===s||"inside"===s||"center"===s||"insideLeft"===s||"insideRight"===s;if(c)"insideLeft"===s?(n=(h[0][0]+h[3][0])/2+5,a=(h[0][1]+h[3][1])/2,i="left"):"insideRight"===s?(n=(h[1][0]+h[2][0])/2-5,a=(h[1][1]+h[2][1])/2,i="right"):(n=(h[0][0]+h[1][0]+h[2][0]+h[3][0])/4,a=(h[0][1]+h[1][1]+h[2][1]+h[3][1])/4,i="center"),r=[[n,a],[n,a]];else{var d,p,f,g=l.get("length");"left"===s?(d=(h[3][0]+h[0][0])/2,p=(h[3][1]+h[0][1])/2,n=(f=d-g)-5,i="right"):"right"===s?(d=(h[1][0]+h[2][0])/2,p=(h[1][1]+h[2][1])/2,n=(f=d+g)+5,i="left"):"rightTop"===s?(d=h[1][0],p=h[1][1],n=(f=d+g)+5,i="top"):"rightBottom"===s?(d=h[2][0],p=h[2][1],n=(f=d+g)+5,i="bottom"):"leftTop"===s?(d=h[0][0],p=h[1][1],n=(f=d-g)-5,i="right"):"leftBottom"===s?(d=h[3][0],p=h[2][1],n=(f=d-g)-5,i="right"):(d=(h[1][0]+h[2][0])/2,p=(h[1][1]+h[2][1])/2,n=(f=d+g)+5,i="left"),r=[[d,p],[f,p]],a=p}u.label={linePoints:r,x:n,y:a,verticalAlign:"middle",textAlign:i,inside:c}}))}(i)}))};X_.registerVisual(IM("funnel")),X_.registerLayout(ML),X_.registerProcessor(NM("funnel"));var IL=function(e){!function(e){if(e.parallel)return;var t=!1;Ve.each(e.series,(function(e){e&&"parallel"===e.type&&(t=!0)})),t&&(e.parallel=[{}])}(e),function(e){var t=Ro.normalizeToArray(e.parallelAxis);Ve.each(t,(function(t){if(Ve.isObject(t)){var i=t.parallelIndex||0,n=Ro.normalizeToArray(e.parallel)[i];n&&n.parallelAxisDefault&&Ve.merge(t,n.parallelAxisDefault,!1)}}))}(e)},TL=function(e,t,i,n,a){L_.call(this,e,t,i),this.type=n||"value",this.axisIndex=a};TL.prototype={constructor:TL,model:null,isHorizontal:function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")}},Ve.inherits(TL,L_);var AL=TL;function CL(e,t){var i=e[t]-e[1-t];return{span:Math.abs(i),sign:i>0?-1:i<0?1:t?-1:1}}function DL(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var LL=function(e,t,i,n,a,r){e=e||0;var o=i[1]-i[0];if(null!=a&&(a=DL(a,[0,o])),null!=r&&(r=Math.max(r,null!=a?a:0)),"all"===n){var s=Math.abs(t[1]-t[0]);s=DL(s,[0,o]),a=r=DL(s,[a,r]),n=0}t[0]=DL(t[0],i),t[1]=DL(t[1],i);var l=CL(t,n);t[n]+=e;var u=a||0,h=i.slice();l.sign<0?h[0]+=u:h[1]-=u,t[n]=DL(t[n],h);var c=CL(t,n);return null!=a&&(c.sign!==l.sign||c.span<a)&&(t[1-n]=t[n]+l.sign*a),c=CL(t,n),null!=r&&c.span>r&&(t[1-n]=t[n]+c.sign*r),t},PL=Ve.each,kL=Math.min,OL=Math.max,RL=Math.floor,EL=Math.ceil,NL=Pc.round,zL=Math.PI;function BL(e,t,i){this._axesMap=Ve.createHashMap(),this._axesLayout={},this.dimensions=e.dimensions,this._rect,this._model=e,this._init(e,t,i)}function VL(e,t){return kL(OL(e,t[0]),t[1])}function FL(e,t){var i=t.layoutLength/(t.axisCount-1);return{position:i*e,axisNameAvailableWidth:i,axisLabelShow:!0}}function GL(e,t){var i,n,a=t.layoutLength,r=t.axisExpandWidth,o=t.axisCount,s=t.axisCollapseWidth,l=t.winInnerIndices,u=s,h=!1;return e<l[0]?(i=e*s,n=s):e<=l[1]?(i=t.axisExpandWindow0Pos+e*r-t.axisExpandWindow[0],u=r,h=!0):(i=a-(o-1-e)*s,n=s),{position:i,axisNameAvailableWidth:u,axisLabelShow:h,nameTruncateMaxWidth:n}}BL.prototype={type:"parallel",constructor:BL,_init:function(e,t,i){var n=e.dimensions,a=e.parallelAxisIndex;PL(n,(function(e,i){var n=a[i],r=t.getComponent("parallelAxis",n),o=this._axesMap.set(e,new AL(e,Px.createScaleByModel(r),[0,0],r.get("type"),n)),s="category"===o.type;o.onBand=s&&r.get("boundaryGap"),o.inverse=r.get("inverse"),r.axis=o,o.model=r,o.coordinateSystem=r.coordinateSystem=this}),this)},update:function(e,t){this._updateAxesFromSeries(this._model,e)},containPoint:function(e){var t=this._makeLayoutInfo(),i=t.axisBase,n=t.layoutBase,a=t.pixelDimIndex,r=e[1-a],o=e[a];return r>=i&&r<=i+t.axisLength&&o>=n&&o<=n+t.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(e,t){t.eachSeries((function(i){if(e.contains(i,t)){var n=i.getData();PL(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(n,n.mapDimension(e)),Px.niceScaleExtent(t.scale,t.model)}),this)}}),this)},resize:function(e,t){this._rect=nd.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var e,t=this._model,i=this._rect,n=["x","y"],a=["width","height"],r=t.get("layout"),o="horizontal"===r?0:1,s=i[a[o]],l=[0,s],u=this.dimensions.length,h=VL(t.get("axisExpandWidth"),l),c=VL(t.get("axisExpandCount")||0,[0,u]),d=t.get("axisExpandable")&&u>3&&u>c&&c>1&&h>0&&s>0,p=t.get("axisExpandWindow");p?(e=VL(p[1]-p[0],l),p[1]=p[0]+e):(e=VL(h*(c-1),l),(p=[h*(t.get("axisExpandCenter")||RL(u/2))-e/2])[1]=p[0]+e);var f=(s-e)/(u-c);f<3&&(f=0);var g=[RL(NL(p[0]/h,1))+1,EL(NL(p[1]/h,1))-1],m=f/h*p[0];return{layout:r,pixelDimIndex:o,layoutBase:i[n[o]],layoutLength:s,axisBase:i[n[1-o]],axisLength:i[a[1-o]],axisExpandable:d,axisExpandWidth:h,axisCollapseWidth:f,axisExpandWindow:p,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:m}},_layoutAxes:function(){var e=this._rect,t=this._axesMap,i=this.dimensions,n=this._makeLayoutInfo(),a=n.layout;t.each((function(e){var t=[0,n.axisLength],i=e.inverse?1:0;e.setExtent(t[i],t[1-i])})),PL(i,(function(t,i){var r=(n.axisExpandable?GL:FL)(i,n),o={horizontal:{x:r.position,y:n.axisLength},vertical:{x:0,y:r.position}},s={horizontal:zL/2,vertical:0},l=[o[a].x+e.x,o[a].y+e.y],u=s[a],h=ni.create();ni.rotate(h,h,u),ni.translate(h,h,l),this._axesLayout[t]={position:l,rotation:u,transform:h,axisNameAvailableWidth:r.axisNameAvailableWidth,axisLabelShow:r.axisLabelShow,nameTruncateMaxWidth:r.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}}),this)},getAxis:function(e){return this._axesMap.get(e)},dataToPoint:function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},eachActiveState:function(e,t,i,n){null==i&&(i=0),null==n&&(n=e.count());var a=this._axesMap,r=this.dimensions,o=[],s=[];Ve.each(r,(function(t){o.push(e.mapDimension(t)),s.push(a.get(t).model)}));for(var l=this.hasAxisBrushed(),u=i;u<n;u++){var h;if(l){h="active";for(var c=e.getValues(o,u),d=0,p=r.length;d<p;d++){if("inactive"===s[d].getActiveState(c[d])){h="inactive";break}}}else h="normal";t(h,u)}},hasAxisBrushed:function(){for(var e=this.dimensions,t=this._axesMap,i=!1,n=0,a=e.length;n<a;n++)"normal"!==t.get(e[n]).model.getActiveState()&&(i=!0);return i},axisCoordToPoint:function(e,t){var i=this._axesLayout[t];return tc.applyTransform([e,0],i.transform)},getAxisLayout:function(e){return Ve.clone(this._axesLayout[e])},getSlidedAxisExpandWindow:function(e){var t=this._makeLayoutInfo(),i=t.pixelDimIndex,n=t.axisExpandWindow.slice(),a=n[1]-n[0],r=[0,t.axisExpandWidth*(t.axisCount-1)];if(!this.containPoint(e))return{behavior:"none",axisExpandWindow:n};var o,s=e[i]-t.layoutBase-t.axisExpandWindow0Pos,l="slide",u=t.axisCollapseWidth,h=this._model.get("axisExpandSlideTriggerArea"),c=null!=h[0];if(u)c&&u&&s<a*h[0]?(l="jump",o=s-a*h[2]):c&&u&&s>a*(1-h[0])?(l="jump",o=s-a*(1-h[2])):(o=s-a*h[1])>=0&&(o=s-a*(1-h[1]))<=0&&(o=0),(o*=t.axisExpandWidth/u)?LL(o,n,r,"all"):l="none";else{a=n[1]-n[0];(n=[OL(0,r[1]*s/a-a/2)])[1]=kL(r[1],n[0]+a),n[0]=n[1]-a}return{axisExpandWindow:n,behavior:l}}};var HL=BL;Tp.register("parallel",{create:function(e,t){var i=[];return e.eachComponent("parallel",(function(n,a){var r=new HL(n,e,t);r.name="parallel_"+a,r.resize(n,t),n.coordinateSystem=r,r.model=n,i.push(r)})),e.eachSeries((function(t){if("parallel"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}});var WL=ud.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return Uo([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(e){var t=this.activeIntervals=Ve.clone(e);if(t)for(var i=t.length-1;i>=0;i--)Pc.asc(t[i])},getActiveState:function(e){var t=this.activeIntervals;if(!t.length)return"normal";if(null==e||isNaN(e))return"inactive";if(1===t.length){var i=t[0];if(i[0]<=e&&e<=i[1])return"active"}else for(var n=0,a=t.length;n<a;n++)if(t[n][0]<=e&&e<=t[n][1])return"active";return"inactive"}});Ve.merge(WL.prototype,Ox),Mw("parallel",WL,(function(e,t){return t.type||(t.data?"category":"value")}),{type:"value",dim:null,areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10}),ud.extend({type:"parallel",dependencies:["parallelAxis"],coordinateSystem:null,dimensions:null,parallelAxisIndex:null,layoutMode:"box",defaultOption:{zlevel:0,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},init:function(){ud.prototype.init.apply(this,arguments),this.mergeOption({})},mergeOption:function(e){var t=this.option;e&&Ve.merge(t,e,!0),this._initDimensions()},contains:function(e,t){var i=e.get("parallelIndex");return null!=i&&t.getComponent("parallel",i)===this},setAxisExpand:function(e){Ve.each(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],(function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])}),this)},_initDimensions:function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[],i=Ve.filter(this.dependentModels.parallelAxis,(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this);Ve.each(i,(function(i){e.push("dim"+i.get("dim")),t.push(i.componentIndex)}))}});X_.registerAction({type:"axisAreaSelect",event:"axisAreaSelected"},(function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},(function(t){t.axis.model.setActiveIntervals(e.intervals)}))})),X_.registerAction("parallelAxisExpand",(function(e,t){t.eachComponent({mainType:"parallel",query:e},(function(t){t.setAxisExpand(e)}))}));var UL=Ve.curry,jL=Ve.each,ZL=Ve.map,YL=Math.min,XL=Math.max,qL=Math.pow,$L=1e4,KL=6,JL=6,QL="globalPan",eP={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},tP={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},iP={brushStyle:{lineWidth:2,stroke:"rgba(0,0,0,0.3)",fill:"rgba(0,0,0,0.1)"},transformable:!0,brushMode:"single",removeOnClick:!1},nP=0;function aP(e){gt.call(this),this._zr=e,this.group=new tc.Group,this._brushType,this._brushOption,this._panels,this._track=[],this._dragging,this._covers=[],this._creatingCover,this._creatingPanel,this._enableGlobalPan,this._uid="brushController_"+nP++,this._handlers={},jL(PP,(function(e,t){this._handlers[t]=Ve.bind(e,this)}),this)}function rP(e,t){var i=OP[t.brushType].createCover(e,t);return i.__brushOption=t,lP(i,t),e.group.add(i),i}function oP(e,t){var i=hP(t);return i.endCreating&&(i.endCreating(e,t),lP(t,t.__brushOption)),t}function sP(e,t){var i=t.__brushOption;hP(t).updateCoverShape(e,t,i.range,i)}function lP(e,t){var i=t.z;null==i&&(i=$L),e.traverse((function(e){e.z=i,e.z2=i}))}function uP(e,t){hP(t).updateCommon(e,t),sP(e,t)}function hP(e){return OP[e.__brushOption.brushType]}function cP(e,t,i){var n,a=e._panels;if(!a)return!0;var r=e._transform;return jL(a,(function(e){e.isTargetByCursor(t,i,r)&&(n=e)})),n}function dP(e,t){var i=e._panels;if(!i)return!0;var n=t.__brushOption.panelId;return null==n||i[n]}function pP(e){var t=e._covers,i=t.length;return jL(t,(function(t){e.group.remove(t)}),e),t.length=0,!!i}function fP(e,t){var i=ZL(e._covers,(function(e){var t=e.__brushOption,i=Ve.clone(t.range);return{brushType:t.brushType,panelId:t.panelId,range:i}}));e.trigger("brush",i,{isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function gP(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function mP(e,t,i,n){var a=new tc.Group;return a.add(new tc.Rect({name:"main",style:_P(i),silent:!0,draggable:!0,cursor:"move",drift:UL(e,t,a,"nswe"),ondragend:UL(fP,t,{isEnd:!0})})),jL(n,(function(i){a.add(new tc.Rect({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:UL(e,t,a,i),ondragend:UL(fP,t,{isEnd:!0})}))})),a}function vP(e,t,i,n){var a=n.brushStyle.lineWidth||0,r=XL(a,JL),o=i[0][0],s=i[1][0],l=o-a/2,u=s-a/2,h=i[0][1],c=i[1][1],d=h-r+a/2,p=c-r+a/2,f=h-o,g=c-s,m=f+a,v=g+a;xP(e,t,"main",o,s,f,g),n.transformable&&(xP(e,t,"w",l,u,r,v),xP(e,t,"e",d,u,r,v),xP(e,t,"n",l,u,m,r),xP(e,t,"s",l,p,m,r),xP(e,t,"nw",l,u,r,r),xP(e,t,"ne",d,u,r,r),xP(e,t,"sw",l,p,r,r),xP(e,t,"se",d,p,r,r))}function yP(e,t){var i=t.__brushOption,n=i.transformable,a=t.childAt(0);a.useStyle(_P(i)),a.attr({silent:!n,cursor:n?"move":"default"}),jL(["w","e","n","s","se","sw","ne","nw"],(function(i){var a=t.childOfName(i),r=wP(e,i);a&&a.attr({silent:!n,invisible:!n,cursor:n?tP[r]+"-resize":null})}))}function xP(e,t,i,n,a,r,o){var s=t.childOfName(i);s&&s.setShape(function(e){var t=YL(e[0][0],e[1][0]),i=YL(e[0][1],e[1][1]),n=XL(e[0][0],e[1][0]),a=XL(e[0][1],e[1][1]);return{x:t,y:i,width:n-t,height:a-i}}(TP(e,t,[[n,a],[n+r,a+o]])))}function _P(e){return Ve.defaults({strokeNoScale:!0},e.brushStyle)}function bP(e,t,i,n){var a=[YL(e,i),YL(t,n)],r=[XL(e,i),XL(t,n)];return[[a[0],r[0]],[a[1],r[1]]]}function wP(e,t){if(t.length>1)return("e"===(i=[wP(e,(t=t.split(""))[0]),wP(e,t[1])])[0]||"w"===i[0])&&i.reverse(),i.join("");var i=tc.transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],function(e){return tc.getTransform(e.group)}(e));return{left:"w",right:"e",top:"n",bottom:"s"}[i]}function SP(e,t,i,n,a,r,o,s){var l=n.__brushOption,u=e(l.range),h=IP(i,r,o);jL(a.split(""),(function(e){var t=eP[e];u[t[0]][t[1]]+=h[t[0]]})),l.range=t(bP(u[0][0],u[1][0],u[0][1],u[1][1])),uP(i,n),fP(i,{isEnd:!1})}function MP(e,t,i,n,a){var r=t.__brushOption.range,o=IP(e,i,n);jL(r,(function(e){e[0]+=o[0],e[1]+=o[1]})),uP(e,t),fP(e,{isEnd:!1})}function IP(e,t,i){var n=e.group,a=n.transformCoordToLocal(t,i),r=n.transformCoordToLocal(0,0);return[a[0]-r[0],a[1]-r[1]]}function TP(e,t,i){var n=dP(e,t);return n&&!0!==n?n.clipPath(i,e._transform):Ve.clone(i)}function AP(e){var t=e.event;t.preventDefault&&t.preventDefault()}function CP(e,t,i){return e.childOfName("main").contain(t,i)}function DP(e,t,i,n){var a,r=e._creatingCover,o=e._creatingPanel,s=e._brushOption;if(e._track.push(i.slice()),function(e){var t=e._track;if(!t.length)return!1;var i=t[t.length-1],n=t[0],a=i[0]-n[0],r=i[1]-n[1];return qL(a*a+r*r,.5)>KL}(e)||r){if(o&&!r){"single"===s.brushMode&&pP(e);var l=Ve.clone(s);l.brushType=LP(l.brushType,o),l.panelId=!0===o?null:o.panelId,r=e._creatingCover=rP(e,l),e._covers.push(r)}if(r){var u=OP[LP(e._brushType,o)];r.__brushOption.range=u.getCreatingRange(TP(e,r,e._track)),n&&(oP(e,r),u.updateCommon(e,r)),sP(e,r),a={isEnd:n}}}else n&&"single"===s.brushMode&&s.removeOnClick&&cP(e,t,i)&&pP(e)&&(a={isEnd:n,removeOnClick:!0});return a}function LP(e,t){return"auto"===e?t.defaultBrushType:e}aP.prototype={constructor:aP,enableBrush:function(e){var t,i;return this._brushType&&(i=(t=this)._zr,BI.release(i,QL,t._uid),function(e,t){jL(t,(function(t,i){e.off(i,t)}))}(i,t._handlers),t._brushType=t._brushOption=null),e.brushType&&function(e,t){var i=e._zr;e._enableGlobalPan||BI.take(i,QL,e._uid);(function(e,t){jL(t,(function(t,i){e.on(i,t)}))})(i,e._handlers),e._brushType=t.brushType,e._brushOption=Ve.merge(Ve.clone(iP),t,!0)}(this,e),this},setPanels:function(e){if(e&&e.length){var t=this._panels={};Ve.each(e,(function(e){t[e.panelId]=Ve.clone(e)}))}else this._panels=null;return this},mount:function(e){e=e||{},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({position:e.position||[0,0],rotation:e.rotation||0,scale:e.scale||[1,1]}),this._transform=t.getLocalTransform(),this},eachCover:function(e,t){jL(this._covers,e,t)},updateCovers:function(e){e=Ve.map(e,(function(e){return Ve.merge(Ve.clone(iP),e,!0)}));var t="\0-brush-index-",i=this._covers,n=this._covers=[],a=this,r=this._creatingCover;return new tv(i,e,(function(e,t){return o(e.__brushOption,t)}),o).add(s).update(s).remove((function(e){i[e]!==r&&a.group.remove(i[e])})).execute(),this;function o(e,i){return(null!=e.id?e.id:t+i)+"-"+e.brushType}function s(t,o){var s=e[t];if(null!=o&&i[o]===r)n[t]=i[o];else{var l=n[t]=null!=o?(i[o].__brushOption=s,i[o]):oP(a,rP(a,s));uP(a,l)}}},unmount:function(){return this.enableBrush(!1),pP(this),this._zr.remove(this.group),this},dispose:function(){this.unmount(),this.off()}},Ve.mixin(aP,gt);var PP={mousedown:function(e){if(this._dragging)kP(this,e);else if(!e.target||!e.target.draggable){AP(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=cP(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,i=e.offsetY,n=this.group.transformCoordToLocal(t,i);if(function(e,t,i){if(e._brushType&&!function(e,t,i){var n=e._zr;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}(e,t)){var n=e._zr,a=e._covers,r=cP(e,t,i);if(!e._dragging)for(var o=0;o<a.length;o++){var s=a[o].__brushOption;if(r&&(!0===r||s.panelId===r.panelId)&&OP[s.brushType].contain(a[o],i[0],i[1]))return}r&&n.setCursorStyle("crosshair")}}(this,e,n),this._dragging){AP(e);var a=DP(this,e,n,!1);a&&fP(this,a)}},mouseup:function(e){kP(this,e)}};function kP(e,t){if(e._dragging){AP(t);var i=t.offsetX,n=t.offsetY,a=e.group.transformCoordToLocal(i,n),r=DP(e,t,a,!0);e._dragging=!1,e._track=[],e._creatingCover=null,r&&fP(e,r)}}var OP={lineX:RP(0),lineY:RP(1),rect:{createCover:function(e,t){return mP(UL(SP,(function(e){return e}),(function(e){return e})),e,t,["w","e","n","s","se","sw","ne","nw"])},getCreatingRange:function(e){var t=gP(e);return bP(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,i,n){vP(e,t,i,n)},updateCommon:yP,contain:CP},polygon:{createCover:function(e,t){var i=new tc.Group;return i.add(new tc.Polyline({name:"main",style:_P(t),silent:!0})),i},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new tc.Polygon({name:"main",draggable:!0,drift:UL(MP,e,t),ondragend:UL(fP,e,{isEnd:!0})}))},updateCoverShape:function(e,t,i,n){t.childAt(0).setShape({points:TP(e,t,i)})},updateCommon:yP,contain:CP}};function RP(e){return{createCover:function(t,i){return mP(UL(SP,(function(t){var i=[t,[0,100]];return e&&i.reverse(),i}),(function(t){return t[e]})),t,i,[["w","e"],["n","s"]][e])},getCreatingRange:function(t){var i=gP(t);return[YL(i[0][e],i[1][e]),XL(i[0][e],i[1][e])]},updateCoverShape:function(t,i,n,a){var r,o=dP(t,i);if(!0!==o&&o.getLinearBrushOtherExtent)r=o.getLinearBrushOtherExtent(e,t._transform);else{var s=t._zr;r=[0,[s.getWidth(),s.getHeight()][1-e]]}var l=[n,r];e&&l.reverse(),vP(t,i,l,a)},updateCommon:yP,contain:CP}}var EP=aP,NP=QI.onIrrelevantElement;function zP(e){return Pn.create(e)}var BP=function(e,t){return e=zP(e),function(i){var n=null!=t?t:i,a=n?e.width:e.height,r=n?e.x:e.y;return[r,r+(a||0)]}},VP={makeRectPanelClipPath:function(e){return e=zP(e),function(t,i){return tc.clipPointsByRect(t,e)}},makeLinearBrushOtherExtent:BP,makeRectIsTargetByCursor:function(e,t,i){return e=zP(e),function(n,a,r){return e.contain(a[0],a[1])&&!NP(n,t,i)}}},FP=["axisLine","axisTickLabel","axisName"],GP=X_.extendComponentView({type:"parallelAxis",init:function(e,t){GP.superApply(this,"init",arguments),(this._brushController=new EP(t.getZr())).on("brush",Ve.bind(this._onBrush,this))},render:function(e,t,i,n){if(!function(e,t,i){return i&&"axisAreaSelect"===i.type&&t.findComponents({mainType:"parallelAxis",query:i})[0]===e}(e,t,n)){this.axisModel=e,this.api=i,this.group.removeAll();var a=this._axisGroup;if(this._axisGroup=new tc.Group,this.group.add(this._axisGroup),e.get("show")){var r=function(e,t){return t.getComponent("parallel",e.get("parallelIndex"))}(e,t),o=r.coordinateSystem,s=e.getAreaSelectStyle(),l=s.width,u=e.axis.dim,h=o.getAxisLayout(u),c=Ve.extend({strokeContainThreshold:l},h),d=new cS(e,c);Ve.each(FP,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(c,s,e,r,l,i);var p=n&&!1===n.animation?null:e;tc.groupTransition(a,this._axisGroup,p)}}},_refreshBrushController:function(e,t,i,n,a,r){var o=i.axis.getExtent(),s=o[1]-o[0],l=Math.min(30,.1*Math.abs(s)),u=tc.BoundingRect.create({x:o[0],y:-a/2,width:s,height:a});u.x-=l,u.width+=2*l,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,position:e.position}).setPanels([{panelId:"pl",clipPath:VP.makeRectPanelClipPath(u),isTargetByCursor:VP.makeRectIsTargetByCursor(u,r,n),getLinearBrushOtherExtent:VP.makeLinearBrushOtherExtent(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(function(e){var t=e.axis;return Ve.map(e.activeIntervals,(function(e){return{brushType:"lineX",panelId:"pl",range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}}))}(i))},_onBrush:function(e,t){var i=this.axisModel,n=i.axis,a=Ve.map(e,(function(e){return[n.coordToData(e.range[0],!0),n.coordToData(e.range[1],!0)]}));(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:a})},dispose:function(){this._brushController.dispose()}});X_.extendComponentView({type:"parallel",render:function(e,t,i){this._model=e,this._api=i,this._handlers||(this._handlers={},Ve.each(HP,(function(e,t){i.getZr().on(t,this._handlers[t]=Ve.bind(e,this))}),this)),Cg.createOrUpdate(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},dispose:function(e,t){Ve.each(this._handlers,(function(e,i){t.getZr().off(i,e)})),this._handlers=null},_throttledDispatchExpand:function(e){this._dispatchExpand(e)},_dispatchExpand:function(e){e&&this._api.dispatchAction(Ve.extend({type:"parallelAxisExpand"},e))}});var HP={mousedown:function(e){WP(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(WP(this,"click")&&t){var i=[e.offsetX,e.offsetY];if(Math.pow(t[0]-i[0],2)+Math.pow(t[1]-i[1],2)>5)return;var n=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);"none"!==n.behavior&&this._dispatchExpand({axisExpandWindow:n.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!this._mouseDownPoint&&WP(this,"mousemove")){var t=this._model,i=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),n=i.behavior;"jump"===n&&this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")),this._throttledDispatchExpand("none"===n?null:{axisExpandWindow:i.axisExpandWindow,animation:"jump"===n&&null})}}};function WP(e,t){var i=e._model;return i.get("axisExpandable")&&i.get("axisExpandTriggerOn")===t}X_.registerPreprocessor(IL);var UP=Ve.each,jP=Ve.createHashMap;og.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(e,t){var i=this.getSource();return function(e,t){if(e.encodeDefine)return;var i=t.ecModel.getComponent("parallel",t.get("parallelIndex"));if(!i)return;var n=e.encodeDefine=jP();UP(i.dimensions,(function(e){var t=+e.replace("dim","");n.set(e,t)}))}(i,this),py(i,this)},getRawIndicesByActiveState:function(e){var t=this.coordinateSystem,i=this.getData(),n=[];return t.eachActiveState(i,(function(t,a){e===t&&n.push(i.getRawIndex(a))})),n},defaultOption:{zlevel:0,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:500,smooth:!1,animationEasing:"linear"}});function ZP(e,t,i,n){for(var a,r=[],o=0;o<i.length;o++){var s=i[o],l=e.get(e.mapDimension(s),t);a=l,("category"===n.getAxis(s).type?null==a:null==a||isNaN(a))||r.push(n.dataToPoint(l,s))}return r}function YP(e,t,i,n,a){var r=ZP(e,i,n,a),o=new tc.Polyline({shape:{points:r},silent:!0,z2:10});return t.add(o),e.setItemGraphicEl(i,o),o}function XP(e){var t=e.get("smooth",!0);return!0===t&&(t=.3),{lineStyle:e.getModel("lineStyle").getLineStyle(),smooth:null!=t?t:.3}}function qP(e,t,i,n){var a=n.lineStyle;t.hasItemOption&&(a=t.getItemModel(i).getModel("lineStyle").getLineStyle());e.useStyle(a);var r=e.style;r.fill=null,r.stroke=t.getItemVisual(i,"color"),r.opacity=t.getItemVisual(i,"opacity"),n.smooth&&(e.shape.smooth=n.smooth)}Sg.extend({type:"parallel",init:function(){this._dataGroup=new tc.Group,this.group.add(this._dataGroup),this._data,this._initialized},render:function(e,t,i,n){var a=this._dataGroup,r=e.getData(),o=this._data,s=e.coordinateSystem,l=s.dimensions,u=XP(e);if(r.diff(o).add((function(e){var t=YP(r,a,e,l,s);qP(t,r,e,u)})).update((function(t,i){var a=o.getItemGraphicEl(i),h=ZP(r,t,l,s);r.setItemGraphicEl(t,a);var c=n&&!1===n.animation?null:e;tc.updateProps(a,{shape:{points:h}},c,t),qP(a,r,t,u)})).remove((function(e){var t=o.getItemGraphicEl(e);a.remove(t)})).execute(),!this._initialized){this._initialized=!0;var h=function(e,t,i){var n=e.model,a=e.getRect(),r=new tc.Rect({shape:{x:a.x,y:a.y,width:a.width,height:a.height}}),o="horizontal"===n.get("layout")?"width":"height";return r.setShape(o,0),tc.initProps(r,{shape:{width:a.width,height:a.height}},t,i),r}(s,e,(function(){setTimeout((function(){a.removeClipPath()}))}));a.setClipPath(h)}this._data=r},incrementalPrepareRender:function(e,t,i){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},incrementalRender:function(e,t,i){for(var n=t.getData(),a=t.coordinateSystem,r=a.dimensions,o=XP(t),s=e.start;s<e.end;s++){var l=YP(n,this._dataGroup,s,r,a);l.incremental=!0,qP(l,n,s,o)}},dispose:function(){},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}});var $P=["lineStyle","normal","opacity"],KP={seriesType:"parallel",reset:function(e,t,i){var n=e.getModel("itemStyle"),a=e.getModel("lineStyle"),r=t.get("color"),o=a.get("color")||n.get("color")||r[e.seriesIndex%r.length],s=e.get("inactiveOpacity"),l=e.get("activeOpacity"),u=e.getModel("lineStyle").getLineStyle(),h=e.coordinateSystem,c=e.getData(),d={normal:u.opacity,active:l,inactive:s};return c.setVisual("color",o),{progress:function(e,t){h.eachActiveState(t,(function(e,i){var n=d[e];if("normal"===e&&t.hasItemOption){var a=t.getItemModel(i).get($P,!0);null!=a&&(n=a)}t.setItemVisual(i,"opacity",n)}),e.start,e.end)}}}},JP=KP;X_.registerVisual(JP);var QP=Uc.encodeHTML,ek=og.extend({type:"series.sankey",layoutInfo:null,levelModels:null,getInitialData:function(e,t){for(var i=e.edges||e.links,n=e.data||e.nodes,a=e.levels,r=this.levelModels={},o=0;o<a.length;o++)null!=a[o].depth&&a[o].depth>=0&&(r[a[o].depth]=new mc(a[o],this,t));if(n&&i){var s=ZC(n,i,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getData().getItemLayout(t).depth;return i.levelModels[n]||this.parentModel})),e})),t.wrapMethod("getItemModel",(function(e,t){return e.customizeGetParent((function(e){var i=this.parentModel,n=i.getGraph().getEdgeByIndex(t).node1.getLayout().depth;return i.levelModels[n]||this.parentModel})),e}))}));return s.data}},setNodePosition:function(e,t){var i=this.option.data[e];i.localX=t[0],i.localY=t[1]},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(e,t,i){if("edge"===i){var n=this.getDataParams(e,i),a=n.data,r=a.source+" -- "+a.target;return n.value&&(r+=" : "+n.value),QP(r)}if("node"===i){var o=this.getGraph().getNodeByIndex(e).getLayout().value,s=this.getDataParams(e,i).data.name;if(o)r=s+" : "+o;return QP(r)}return ek.superCall(this,"formatTooltip",e,t)},optionUpdated:function(){var e=this.option;!0===e.focusNodeAdjacency&&(e.focusNodeAdjacency="allEdges")},getDataParams:function(e,t){var i=ek.superCall(this,"getDataParams",e,t);if(null==i.value&&"node"===t){var n=this.getGraph().getNodeByIndex(e).getLayout().value;i.value=n}return i},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,focusNodeAdjacency:!1,layoutIterations:32,label:{show:!0,position:"right",color:"#000",fontSize:12},levels:[],nodeAlign:"justify",itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},animationEasing:"linear",animationDuration:1e3}}),tk=["itemStyle","opacity"],ik=["emphasis","itemStyle","opacity"],nk=["lineStyle","opacity"],ak=["emphasis","lineStyle","opacity"];function rk(e,t){return e.getVisual("opacity")||e.getModel().get(t)}function ok(e,t,i){var n=e.getGraphicEl(),a=rk(e,t);null!=i&&(null==a&&(a=1),a*=i),n.downplay&&n.downplay(),n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",a)}))}function sk(e,t){var i=rk(e,t),n=e.getGraphicEl();n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}var lk=tc.extendShape({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0,orient:""},buildPath:function(e,t){var i=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),"vertical"===t.orient?(e.lineTo(t.x2+i,t.y2),e.bezierCurveTo(t.cpx2+i,t.cpy2,t.cpx1+i,t.cpy1,t.x1+i,t.y1)):(e.lineTo(t.x2,t.y2+i),e.bezierCurveTo(t.cpx2,t.cpy2+i,t.cpx1,t.cpy1+i,t.x1,t.y1+i)),e.closePath()},highlight:function(){this.trigger("emphasis")},downplay:function(){this.trigger("normal")}});X_.extendChartView({type:"sankey",_model:null,_focusAdjacencyDisabled:!1,render:function(e,t,i){var n=this,a=e.getGraph(),r=this.group,o=e.layoutInfo,s=o.width,l=o.height,u=e.getData(),h=e.getData("edge"),c=e.get("orient");this._model=e,r.removeAll(),r.attr("position",[o.x,o.y]),a.eachEdge((function(t){var i=new lk;i.dataIndex=t.dataIndex,i.seriesIndex=e.seriesIndex,i.dataType="edge";var n,a,o,u,d,p,f,g,m=t.getModel("lineStyle"),v=m.get("curveness"),y=t.node1.getLayout(),x=t.node1.getModel(),_=x.get("localX"),b=x.get("localY"),w=t.node2.getLayout(),S=t.node2.getModel(),M=S.get("localX"),I=S.get("localY"),T=t.getLayout();switch(i.shape.extent=Math.max(1,T.dy),i.shape.orient=c,"vertical"===c?(n=(null!=_?_*s:y.x)+T.sy,a=(null!=b?b*l:y.y)+y.dy,o=(null!=M?M*s:w.x)+T.ty,d=n,p=a*(1-v)+(u=null!=I?I*l:w.y)*v,f=o,g=a*v+u*(1-v)):(n=(null!=_?_*s:y.x)+y.dx,a=(null!=b?b*l:y.y)+T.sy,d=n*(1-v)+(o=null!=M?M*s:w.x)*v,p=a,f=n*v+o*(1-v),g=u=(null!=I?I*l:w.y)+T.ty),i.setShape({x1:n,y1:a,x2:o,y2:u,cpx1:d,cpy1:p,cpx2:f,cpy2:g}),i.setStyle(m.getItemStyle()),i.style.fill){case"source":i.style.fill=t.node1.getVisual("color");break;case"target":i.style.fill=t.node2.getVisual("color")}tc.setHoverStyle(i,t.getModel("emphasis.lineStyle").getItemStyle()),r.add(i),h.setItemGraphicEl(t.dataIndex,i)})),a.eachNode((function(t){var i=t.getLayout(),n=t.getModel(),a=n.get("localX"),o=n.get("localY"),h=n.getModel("label"),c=n.getModel("emphasis.label"),d=new tc.Rect({shape:{x:null!=a?a*s:i.x,y:null!=o?o*l:i.y,width:i.dx,height:i.dy},style:n.getModel("itemStyle").getItemStyle()}),p=t.getModel("emphasis.itemStyle").getItemStyle();tc.setLabelStyle(d.style,p,h,c,{labelFetcher:e,labelDataIndex:t.dataIndex,defaultText:t.id,isRectText:!0}),d.setStyle("fill",t.getVisual("color")),tc.setHoverStyle(d,p),r.add(d),u.setItemGraphicEl(t.dataIndex,d),d.dataType="node"})),u.eachItemGraphicEl((function(t,a){var r=u.getItemModel(a);r.get("draggable")&&(t.drift=function(t,r){n._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=r,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:e.id,dataIndex:u.getRawIndex(a),localX:this.shape.x/s,localY:this.shape.y/l})},t.ondragend=function(){n._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor="move"),t.highlight=function(){this.trigger("emphasis")},t.downplay=function(){this.trigger("normal")},t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),r.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),h.eachItemGraphicEl((function(t,a){var r=h.getItemModel(a);t.focusNodeAdjHandler&&t.off("mouseover",t.focusNodeAdjHandler),t.unfocusNodeAdjHandler&&t.off("mouseout",t.unfocusNodeAdjHandler),r.get("focusNodeAdjacency")&&(t.on("mouseover",t.focusNodeAdjHandler=function(){n._focusAdjacencyDisabled||(n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex}))}),t.on("mouseout",t.unfocusNodeAdjHandler=function(){n._focusAdjacencyDisabled||n._dispatchUnfocus(i)}))})),!this._data&&e.get("animation")&&r.setClipPath(function(e,t,i){var n=new tc.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return tc.initProps(n,{shape:{width:e.width+20}},t,i),n}(r.getBoundingRect(),e,(function(){r.removeClipPath()}))),this._data=e.getData()},dispose:function(){this._clearTimer()},_dispatchUnfocus:function(e){var t=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout((function(){t._unfocusDelayTimer=null,e.dispatchAction({type:"unfocusNodeAdjacency",seriesId:t._model.id})}),500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(e,t,i,n){var a=e.getData(),r=a.graph,o=n.dataIndex,s=a.getItemModel(o),l=n.edgeDataIndex;if(null!=o||null!=l){var u=r.getNodeByIndex(o),h=r.getEdgeByIndex(l);if(r.eachNode((function(e){ok(e,tk,.1)})),r.eachEdge((function(e){ok(e,nk,.1)})),u){sk(u,ik);var c=s.get("focusNodeAdjacency");"outEdges"===c?Ve.each(u.outEdges,(function(e){e.dataIndex<0||(sk(e,ak),sk(e.node2,ik))})):"inEdges"===c?Ve.each(u.inEdges,(function(e){e.dataIndex<0||(sk(e,ak),sk(e.node1,ik))})):"allEdges"===c&&Ve.each(u.edges,(function(e){e.dataIndex<0||(sk(e,ak),e.node1!==u&&sk(e.node1,ik),e.node2!==u&&sk(e.node2,ik))}))}h&&(sk(h,ak),sk(h.node1,ik),sk(h.node2,ik))}},unfocusNodeAdjacency:function(e,t,i,n){var a=e.getGraph();a.eachNode((function(e){ok(e,tk)})),a.eachEdge((function(e){ok(e,nk)}))}}),X_.registerAction({type:"dragNode",event:"dragnode",update:"update"},(function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},(function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])}))}));var uk=Ro.groupData;function hk(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function ck(e,t,i,n,a){var r="vertical"===a?"x":"y";Ve.each(e,(function(e){var o,s,l;e.sort((function(e,t){return e.getLayout()[r]-t.getLayout()[r]}));for(var u=0,h=e.length,c="vertical"===a?"dx":"dy",d=0;d<h;d++)(l=u-(s=e[d]).getLayout()[r])>0&&(o=s.getLayout()[r]+l,"vertical"===a?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[r]+s.getLayout()[c]+t;if((l=u-t-("vertical"===a?n:i))>0)for(o=s.getLayout()[r]-l,"vertical"===a?s.setLayout({x:o},!0):s.setLayout({y:o},!0),u=o,d=h-2;d>=0;--d)(l=(s=e[d]).getLayout()[r]+s.getLayout()[c]+t-u)>0&&(o=s.getLayout()[r]-l,"vertical"===a?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),u=s.getLayout()[r]}))}function dk(e,t,i){Ve.each(e.slice().reverse(),(function(e){Ve.each(e,(function(e){if(e.outEdges.length){var n=xk(e.outEdges,pk,i)/xk(e.outEdges,yk,i);if(isNaN(n)){var a=e.outEdges.length;n=a?xk(e.outEdges,fk,i)/a:0}if("vertical"===i){var r=e.getLayout().x+(n-vk(e,i))*t;e.setLayout({x:r},!0)}else{var o=e.getLayout().y+(n-vk(e,i))*t;e.setLayout({y:o},!0)}}}))}))}function pk(e,t){return vk(e.node2,t)*e.getValue()}function fk(e,t){return vk(e.node2,t)}function gk(e,t){return vk(e.node1,t)*e.getValue()}function mk(e,t){return vk(e.node1,t)}function vk(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function yk(e){return e.getValue()}function xk(e,t,i){for(var n=0,a=e.length,r=-1;++r<a;){var o=+t.call(e,e[r],i);isNaN(o)||(n+=o)}return n}function _k(e,t,i){Ve.each(e,(function(e){Ve.each(e,(function(e){if(e.inEdges.length){var n=xk(e.inEdges,gk,i)/xk(e.inEdges,yk,i);if(isNaN(n)){var a=e.inEdges.length;n=a?xk(e.inEdges,mk,i)/a:0}if("vertical"===i){var r=e.getLayout().x+(n-vk(e,i))*t;e.setLayout({x:r},!0)}else{var o=e.getLayout().y+(n-vk(e,i))*t;e.setLayout({y:o},!0)}}}))}))}var bk=function(e,t,i){e.eachSeriesByType("sankey",(function(e){var i=e.get("nodeWidth"),n=e.get("nodeGap"),a=function(e,t){return nd.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,t);e.layoutInfo=a;var r=a.width,o=a.height,s=e.getGraph(),l=s.nodes,u=s.edges;!function(e){Ve.each(e,(function(e){var t=xk(e.outEdges,yk),i=xk(e.inEdges,yk),n=e.getValue()||0,a=Math.max(t,i,n);e.setLayout({value:a},!0)}))}(l),function(e,t,i,n,a,r,o,s,l){(function(e,t,i,n,a,r,o){for(var s=[],l=[],u=[],h=[],c=0,d=0,p=0;p<t.length;p++)s[p]=1;for(p=0;p<e.length;p++)l[p]=e[p].inEdges.length,0===l[p]&&u.push(e[p]);var f=-1;for(;u.length;){for(var g=0;g<u.length;g++){var m=u[g],v=m.hostGraph.data.getRawDataItem(m.dataIndex),y=null!=v.depth&&v.depth>=0;y&&v.depth>f&&(f=v.depth),m.setLayout({depth:y?v.depth:c},!0),"vertical"===r?m.setLayout({dy:i},!0):m.setLayout({dx:i},!0);for(var x=0;x<m.outEdges.length;x++){var _=m.outEdges[x];s[t.indexOf(_)]=0;var b=_.node2;0==--l[e.indexOf(b)]&&h.indexOf(b)<0&&h.push(b)}}++c,u=h,h=[]}for(p=0;p<s.length;p++)if(1===s[p])throw new Error("Sankey is a DAG, the original data has cycle!");var w=f>c-1?f:c-1;o&&"left"!==o&&function(e,t,i,n){if("right"===t){for(var a=[],r=e,o=0;r.length;){for(var s=0;s<r.length;s++){var l=r[s];l.setLayout({skNodeHeight:o},!0);for(var u=0;u<l.inEdges.length;u++){var h=l.inEdges[u];a.indexOf(h.node1)<0&&a.push(h.node1)}}r=a,a=[],++o}Ve.each(e,(function(e){hk(e)||e.setLayout({depth:Math.max(0,n-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&function(e,t){Ve.each(e,(function(e){hk(e)||e.outEdges.length||e.setLayout({depth:t},!0)}))}(e,n)}(e,o,0,w);d="vertical"===r?(a-i)/w:(n-i)/w;!function(e,t,i){Ve.each(e,(function(e){var n=e.getLayout().depth*t;"vertical"===i?e.setLayout({y:n},!0):e.setLayout({x:n},!0)}))}(e,d,r)})(e,t,i,a,r,s,l),function(e,t,i,n,a,r,o){var s=function(e,t){var i=[],n="vertical"===t?"y":"x",a=uk(e,(function(e){return e.getLayout()[n]}));return a.keys.sort((function(e,t){return e-t})),Ve.each(a.keys,(function(e){i.push(a.buckets.get(e))})),i}(e,o);(function(e,t,i,n,a,r){var o=1/0;Ve.each(e,(function(e){var t=e.length,s=0;Ve.each(e,(function(e){s+=e.getLayout().value}));var l="vertical"===r?(n-(t-1)*a)/s:(i-(t-1)*a)/s;l<o&&(o=l)})),Ve.each(e,(function(e){Ve.each(e,(function(e,t){var i=e.getLayout().value*o;"vertical"===r?(e.setLayout({x:t},!0),e.setLayout({dx:i},!0)):(e.setLayout({y:t},!0),e.setLayout({dy:i},!0))}))})),Ve.each(t,(function(e){var t=+e.getValue()*o;e.setLayout({dy:t},!0)}))})(s,t,i,n,a,o),ck(s,a,i,n,o);for(var l=1;r>0;r--)dk(s,l*=.99,o),ck(s,a,i,n,o),_k(s,l,o),ck(s,a,i,n,o)}(e,t,r,a,n,o,s),function(e,t){var i="vertical"===t?"x":"y";Ve.each(e,(function(e){e.outEdges.sort((function(e,t){return e.node2.getLayout()[i]-t.node2.getLayout()[i]})),e.inEdges.sort((function(e,t){return e.node1.getLayout()[i]-t.node1.getLayout()[i]}))})),Ve.each(e,(function(e){var t=0,i=0;Ve.each(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),Ve.each(e.inEdges,(function(e){e.setLayout({ty:i},!0),i+=e.getLayout().dy}))}))}(e,s)}(l,u,i,n,r,o,0!==Ve.filter(l,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))};var wk=function(e,t){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph().nodes;if(t.length){var i=1/0,n=-1/0;Ve.each(t,(function(e){var t=e.getLayout().value;t<i&&(i=t),t>n&&(n=t)})),Ve.each(t,(function(t){var a=new pC({type:"color",mappingMethod:"linear",dataExtent:[i,n],visual:e.get("color")}).mapValueToVisual(t.getLayout().value),r=t.getModel().get("itemStyle.color");null!=r?t.setVisual("color",r):t.setVisual("color",a)}))}}))};X_.registerLayout(bk),X_.registerVisual(wk);var Sk=ov.getDimensionTypeByAxis,Mk=tp.makeSeriesEncodeForAxisCoordSys,Ik={seriesModelMixin:{_baseAxisDim:null,getInitialData:function(e,t){var i,n,a=t.getComponent("xAxis",this.get("xAxisIndex")),r=t.getComponent("yAxis",this.get("yAxisIndex")),o=a.get("type"),s=r.get("type");"category"===o?(e.layout="horizontal",i=a.getOrdinalMeta(),n=!0):"category"===s?(e.layout="vertical",i=r.getOrdinalMeta(),n=!0):e.layout=e.layout||"horizontal";var l=["x","y"],u="horizontal"===e.layout?0:1,h=this._baseAxisDim=l[u],c=l[1-u],d=[a,r],p=d[u].get("type"),f=d[1-u].get("type"),g=e.data;if(g&&n){var m=[];Ve.each(g,(function(e,t){var i;e.value&&Ve.isArray(e.value)?(i=e.value.slice(),e.value.unshift(t)):Ve.isArray(e)?(i=e.slice(),e.unshift(t)):i=e,m.push(i)})),e.data=m}var v=this.defaultValueDimensions,y=[{name:h,type:Sk(p),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:Sk(f),dimsDef:v.slice()}];return dM(this,{coordDimensions:y,dimensionsCount:v.length+1,encodeDefaulter:Ve.curry(Mk,y,this)})},getBaseAxis:function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis}}},Tk=Ik.seriesModelMixin,Ak=og.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}});Ve.mixin(Ak,Tk,!0);var Ck=["itemStyle"],Dk=["emphasis","itemStyle"];Sg.extend({type:"boxplot",render:function(e,t,i){var n=e.getData(),a=this.group,r=this._data;this._data||a.removeAll();var o="horizontal"===e.get("layout")?1:0;n.diff(r).add((function(e){if(n.hasValue(e)){var t=Pk(n.getItemLayout(e),n,e,o,!0);n.setItemGraphicEl(e,t),a.add(t)}})).update((function(e,t){var i=r.getItemGraphicEl(t);if(n.hasValue(e)){var s=n.getItemLayout(e);i?kk(s,i,n,e):i=Pk(s,n,e,o),a.add(i),n.setItemGraphicEl(e,i)}else a.remove(i)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&a.remove(t)})).execute(),this._data=n},remove:function(e){var t=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl((function(e){e&&t.remove(e)}))},dispose:Ve.noop});var Lk=bl.extend({type:"boxplotBoxPath",shape:{},buildPath:function(e,t){var i=t.points,n=0;for(e.moveTo(i[n][0],i[n][1]),n++;n<4;n++)e.lineTo(i[n][0],i[n][1]);for(e.closePath();n<i.length;n++)e.moveTo(i[n][0],i[n][1]),n++,e.lineTo(i[n][0],i[n][1])}});function Pk(e,t,i,n,a){var r=e.ends,o=new Lk({shape:{points:a?Ok(r,n,e):r}});return kk(e,o,t,i,a),o}function kk(e,t,i,n,a){var r=i.hostModel;(0,tc[a?"initProps":"updateProps"])(t,{shape:{points:e.ends}},r,n);var o=i.getItemModel(n),s=o.getModel(Ck),l=i.getItemVisual(n,"color"),u=s.getItemStyle(["borderColor"]);u.stroke=l,u.strokeNoScale=!0,t.useStyle(u),t.z2=100;var h=o.getModel(Dk).getItemStyle();tc.setHoverStyle(t,h)}function Ok(e,t,i){return Ve.map(e,(function(e){return(e=e.slice())[t]=i.initBaseline,e}))}var Rk=["itemStyle","borderColor"];var Ek=function(e,t){var i=e.get("color");e.eachRawSeriesByType("boxplot",(function(t){var n=i[t.seriesIndex%i.length],a=t.getData();a.setVisual({legendSymbol:"roundRect",color:t.get(Rk)||n}),e.isSeriesFiltered(t)||a.each((function(e){var t=a.getItemModel(e);a.setItemVisual(e,{color:t.get(Rk,!0)})}))}))},Nk=Pc.parsePercent,zk=Ve.each;var Bk=function(e){var t=function(e){var t=[],i=[];return e.eachSeriesByType("boxplot",(function(e){var n=e.getBaseAxis(),a=Ve.indexOf(i,n);a<0&&(a=i.length,i[a]=n,t[a]={axis:n,seriesModels:[]}),t[a].seriesModels.push(e)})),t}(e);zk(t,(function(e){var t=e.seriesModels;t.length&&(!function(e){var t,i,n=e.axis,a=e.seriesModels,r=a.length,o=e.boxWidthList=[],s=e.boxOffsetList=[],l=[];if("category"===n.type)i=n.getBandWidth();else{var u=0;zk(a,(function(e){u=Math.max(u,e.getData().count())})),t=n.getExtent(),Math.abs(t[1]-t[0])}zk(a,(function(e){var t=e.get("boxWidth");Ve.isArray(t)||(t=[t,t]),l.push([Nk(t[0],i)||0,Nk(t[1],i)||0])}));var h=.8*i-2,c=h/r*.3,d=(h-c*(r-1))/r,p=d/2-h/2;zk(a,(function(e,t){s.push(p),p+=c+d,o.push(Math.min(Math.max(d,l[t][0]),l[t][1]))}))}(e),zk(t,(function(t,i){!function(e,t,i){var n=e.coordinateSystem,a=e.getData(),r=i/2,o="horizontal"===e.get("layout")?0:1,s=1-o,l=["x","y"],u=a.mapDimension(l[o]),h=a.mapDimension(l[s],!0);if(null==u||h.length<5)return;for(var c=0;c<a.count();c++){var d=a.get(u,c),p=x(d,h[2],c),f=x(d,h[0],c),g=x(d,h[1],c),m=x(d,h[3],c),v=x(d,h[4],c),y=[];_(y,g,0),_(y,m,1),y.push(f,g,v,m),b(y,f),b(y,v),b(y,p),a.setItemLayout(c,{initBaseline:p[s],ends:y})}function x(e,i,r){var l,u=a.get(i,r),h=[];return h[o]=e,h[s]=u,isNaN(e)||isNaN(u)?l=[NaN,NaN]:(l=n.dataToPoint(h))[o]+=t,l}function _(e,t,i){var n=t.slice(),a=t.slice();n[o]+=r,a[o]-=r,i?e.push(n,a):e.push(a,n)}function b(e,t){var i=t.slice(),n=t.slice();i[o]-=r,n[o]+=r,e.push(i,n)}}(t,e.boxOffsetList[i],e.boxWidthList[i])})))}))};X_.registerVisual(Ek),X_.registerLayout(Bk);var Vk=Ik.seriesModelMixin,Fk=og.extend({type:"series.candlestick",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,clip:!0,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationUpdate:!1,animationEasing:"linear",animationDuration:300},getShadowDim:function(){return"open"},brushSelector:function(e,t,i){var n=t.getItemLayout(e);return n&&i.rect(n.brushRect)}});Ve.mixin(Fk,Vk,!0);var Gk=Wb.createClipPath,Hk=["itemStyle"],Wk=["emphasis","itemStyle"],Uk=["color","color0","borderColor","borderColor0"];Sg.extend({type:"candlestick",render:function(e,t,i){this.group.removeClipPath(),this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},incrementalPrepareRender:function(e,t,i){this._clear(),this._updateDrawMode(e)},incrementalRender:function(e,t,i,n){this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},_updateDrawMode:function(e){var t=e.pipelineContext.large;(null==this._isLargeDraw||t^this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},_renderNormal:function(e){var t=e.getData(),i=this._data,n=this.group,a=t.getLayout("isSimpleBox"),r=e.get("clip",!0),o=e.coordinateSystem,s=o.getArea&&o.getArea();this._data||n.removeAll(),t.diff(i).add((function(i){if(t.hasValue(i)){var o,l=t.getItemLayout(i);if(r&&Yk(s,l))return;o=Zk(l,i,!0),tc.initProps(o,{shape:{points:l.ends}},e,i),Xk(o,t,i,a),n.add(o),t.setItemGraphicEl(i,o)}})).update((function(o,l){var u=i.getItemGraphicEl(l);if(t.hasValue(o)){var h=t.getItemLayout(o);r&&Yk(s,h)?n.remove(u):(u?tc.updateProps(u,{shape:{points:h.ends}},e,o):u=Zk(h),Xk(u,t,o,a),n.add(u),t.setItemGraphicEl(o,u))}else n.remove(u)})).remove((function(e){var t=i.getItemGraphicEl(e);t&&n.remove(t)})).execute(),this._data=t},_renderLarge:function(e){this._clear(),Kk(e,this.group);var t=e.get("clip",!0)?Gk(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},_incrementalRenderNormal:function(e,t){for(var i,n=t.getData(),a=n.getLayout("isSimpleBox");null!=(i=e.next());){var r;Xk(r=Zk(n.getItemLayout(i)),n,i,a),r.incremental=!0,this.group.add(r)}},_incrementalRenderLarge:function(e,t){Kk(t,this.group,!0)},remove:function(e){this._clear()},_clear:function(){this.group.removeAll(),this._data=null},dispose:Ve.noop});var jk=bl.extend({type:"normalCandlestickBox",shape:{},buildPath:function(e,t){var i=t.points;this.__simpleBox?(e.moveTo(i[4][0],i[4][1]),e.lineTo(i[6][0],i[6][1])):(e.moveTo(i[0][0],i[0][1]),e.lineTo(i[1][0],i[1][1]),e.lineTo(i[2][0],i[2][1]),e.lineTo(i[3][0],i[3][1]),e.closePath(),e.moveTo(i[4][0],i[4][1]),e.lineTo(i[5][0],i[5][1]),e.moveTo(i[6][0],i[6][1]),e.lineTo(i[7][0],i[7][1]))}});function Zk(e,t,i){var n=e.ends;return new jk({shape:{points:i?qk(n,e):n},z2:100})}function Yk(e,t){for(var i=!0,n=0;n<t.ends.length;n++)if(e.contain(t.ends[n][0],t.ends[n][1])){i=!1;break}return i}function Xk(e,t,i,n){var a=t.getItemModel(i),r=a.getModel(Hk),o=t.getItemVisual(i,"color"),s=t.getItemVisual(i,"borderColor")||o,l=r.getItemStyle(Uk);e.useStyle(l),e.style.strokeNoScale=!0,e.style.fill=o,e.style.stroke=s,e.__simpleBox=n;var u=a.getModel(Wk).getItemStyle();tc.setHoverStyle(e,u)}function qk(e,t){return Ve.map(e,(function(e){return(e=e.slice())[1]=t.initBaseline,e}))}var $k=bl.extend({type:"largeCandlestickBox",shape:{},buildPath:function(e,t){for(var i=t.points,n=0;n<i.length;)if(this.__sign===i[n++]){var a=i[n++];e.moveTo(a,i[n++]),e.lineTo(a,i[n++])}else n+=3}});function Kk(e,t,i){var n=e.getData(),a=n.getLayout("largePoints"),r=new $k({shape:{points:a},__sign:1});t.add(r);var o=new $k({shape:{points:a},__sign:-1});t.add(o),Jk(1,r,e,n),Jk(-1,o,e,n),i&&(r.incremental=!0,o.incremental=!0)}function Jk(e,t,i,n){var a=e>0?"P":"N",r=n.getVisual("borderColor"+a)||n.getVisual("color"+a),o=i.getModel(Hk).getItemStyle(Uk);t.useStyle(o),t.style.fill=null,t.style.stroke=r}var Qk=function(e){e&&Ve.isArray(e.series)&&Ve.each(e.series,(function(e){Ve.isObject(e)&&"k"===e.type&&(e.type="candlestick")}))},eO=["itemStyle","borderColor"],tO=["itemStyle","borderColor0"],iO=["itemStyle","color"],nO=["itemStyle","color0"],aO={seriesType:"candlestick",plan:cg(),performRawSeries:!0,reset:function(e,t){if(e.getData().setVisual({legendSymbol:"roundRect",colorP:i(1,e),colorN:i(-1,e),borderColorP:n(1,e),borderColorN:n(-1,e)}),!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){var a;for(;null!=(a=e.next());){var r=t.getItemModel(a),o=t.getItemLayout(a).sign;t.setItemVisual(a,{color:i(o,r),borderColor:n(o,r)})}}};function i(e,t){return t.get(e>0?iO:nO)}function n(e,t){return t.get(e>0?eO:tO)}}},rO=aO,oO=tc.subPixelOptimize,sO=Pc.parsePercent,lO=Ve.retrieve2,uO="undefined"!=typeof Float32Array?Float32Array:Array,hO={seriesType:"candlestick",plan:cg(),reset:function(e){var t=e.coordinateSystem,i=e.getData(),n=function(e,t){var i,n=e.getBaseAxis(),a="category"===n.type?n.getBandWidth():(i=n.getExtent(),Math.abs(i[1]-i[0])/t.count()),r=sO(lO(e.get("barMaxWidth"),a),a),o=sO(lO(e.get("barMinWidth"),1),a),s=e.get("barWidth");return null!=s?sO(s,a):Math.max(Math.min(a/2,r),o)}(e,i),a=["x","y"],r=i.mapDimension(a[0]),o=i.mapDimension(a[1],!0),s=o[0],l=o[1],u=o[2],h=o[3];if(i.setLayout({candleWidth:n,isSimpleBox:n<=1.3}),!(null==r||o.length<4))return{progress:e.pipelineContext.large?function(e,i){var n,a,o=new uO(4*e.count),c=0,d=[],p=[];for(;null!=(a=e.next());){var f=i.get(r,a),g=i.get(s,a),m=i.get(l,a),v=i.get(u,a),y=i.get(h,a);isNaN(f)||isNaN(v)||isNaN(y)?(o[c++]=NaN,c+=3):(o[c++]=cO(i,a,g,m,l),d[0]=f,d[1]=v,n=t.dataToPoint(d,null,p),o[c++]=n?n[0]:NaN,o[c++]=n?n[1]:NaN,d[1]=y,n=t.dataToPoint(d,null,p),o[c++]=n?n[1]:NaN)}i.setLayout("largePoints",o)}:function(e,i){var a;for(;null!=(a=e.next());){var o=i.get(r,a),c=i.get(s,a),d=i.get(l,a),p=i.get(u,a),f=i.get(h,a),g=Math.min(c,d),m=Math.max(c,d),v=w(g,o),y=w(m,o),x=w(p,o),_=w(f,o),b=[];S(b,y,0),S(b,v,1),b.push(I(_),I(y),I(x),I(v)),i.setItemLayout(a,{sign:cO(i,a,c,d,l),initBaseline:c>d?y[1]:v[1],ends:b,brushRect:M(p,f,o)})}function w(e,i){var n=[];return n[0]=i,n[1]=e,isNaN(i)||isNaN(e)?[NaN,NaN]:t.dataToPoint(n)}function S(e,t,i){var a=t.slice(),r=t.slice();a[0]=oO(a[0]+n/2,1,!1),r[0]=oO(r[0]-n/2,1,!0),i?e.push(a,r):e.push(r,a)}function M(e,t,i){var a=w(e,i),r=w(t,i);return a[0]-=n/2,r[0]-=n/2,{x:a[0],y:a[1],width:n,height:r[1]-a[1]}}function I(e){return e[0]=oO(e[0],1),e}}}}};function cO(e,t,i,n,a){return i>n?-1:i<n?1:t>0?e.get(a,t-1)<=n?1:-1:1}var dO=hO;X_.registerPreprocessor(Qk),X_.registerVisual(rO),X_.registerLayout(dO),og.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(e,t){return py(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});var pO=jx.createSymbol,fO=tc.Group,gO=Pc.parsePercent;function mO(e,t){var i=t.rippleEffectColor||t.color;e.eachChild((function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:"stroke"===t.brushType?i:null,fill:"fill"===t.brushType?i:null}})}))}function vO(e,t){fO.call(this);var i=new cb(e,t),n=new fO;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(e,t)}var yO=vO.prototype;yO.stopEffectAnimation=function(){this.childAt(1).removeAll()},yO.startEffectAnimation=function(e){for(var t=e.symbolType,i=e.color,n=this.childAt(1),a=0;a<3;a++){var r=pO(t,-1,-1,2,2,i);r.attr({style:{strokeNoScale:!0},z2:99,silent:!0,scale:[.5,.5]});var o=-a/3*e.period+e.effectOffset;r.animate("",!0).when(e.period,{scale:[e.rippleScale/2,e.rippleScale/2]}).delay(o).start(),r.animateStyle(!0).when(e.period,{opacity:0}).delay(o).start(),n.add(r)}mO(n,e)},yO.updateEffectAnimation=function(e){for(var t=this._effectCfg,i=this.childAt(1),n=["symbolType","period","rippleScale"],a=0;a<n.length;a++){var r=n[a];if(t[r]!==e[r])return this.stopEffectAnimation(),void this.startEffectAnimation(e)}mO(i,e)},yO.highlight=function(){this.trigger("emphasis")},yO.downplay=function(){this.trigger("normal")},yO.updateData=function(e,t){var i=e.hostModel;this.childAt(0).updateData(e,t);var n=this.childAt(1),a=e.getItemModel(t),r=e.getItemVisual(t,"symbol"),o=function(e){return Ve.isArray(e)||(e=[+e,+e]),e}(e.getItemVisual(t,"symbolSize")),s=e.getItemVisual(t,"color");n.attr("scale",o),n.traverse((function(e){e.attr({fill:s})}));var l=a.getShallow("symbolOffset");if(l){var u=n.position;u[0]=gO(l[0],o[0]),u[1]=gO(l[1],o[1])}var h=e.getItemVisual(t,"symbolRotate");n.rotation=(h||0)*Math.PI/180||0;var c={};if(c.showEffectOn=i.get("showEffectOn"),c.rippleScale=a.get("rippleEffect.scale"),c.brushType=a.get("rippleEffect.brushType"),c.period=1e3*a.get("rippleEffect.period"),c.effectOffset=t/e.count(),c.z=a.getShallow("z")||0,c.zlevel=a.getShallow("zlevel")||0,c.symbolType=r,c.color=s,c.rippleEffectColor=a.get("rippleEffect.color"),this.off("mouseover").off("mouseout").off("emphasis").off("normal"),"render"===c.showEffectOn)this._effectCfg?this.updateEffectAnimation(c):this.startEffectAnimation(c),this._effectCfg=c;else{this._effectCfg=null,this.stopEffectAnimation();var d=this.childAt(0),p=function(){d.highlight(),"render"!==c.showEffectOn&&this.startEffectAnimation(c)},f=function(){d.downplay(),"render"!==c.showEffectOn&&this.stopEffectAnimation()};this.on("mouseover",p,this).on("mouseout",f,this).on("emphasis",p,this).on("normal",f,this)}this._effectCfg=c},yO.fadeOut=function(e){this.off("mouseover").off("mouseout").off("emphasis").off("normal"),e&&e()},Ve.inherits(vO,fO);var xO=vO;X_.extendChartView({type:"effectScatter",init:function(){this._symbolDraw=new yb(xO)},render:function(e,t,i){var n=e.getData(),a=this._symbolDraw;a.updateData(n),this.group.add(a.group)},updateTransform:function(e,t,i){var n=e.getData();this.group.dirty();var a=sw().reset(e);a.progress&&a.progress({start:0,end:n.count()},n),this._symbolDraw.updateLayout(n)},_updateGroupTransform:function(e){var t=e.coordinateSystem;t&&t.getRoamTransform&&(this.group.transform=ni.clone(t.getRoamTransform()),this.group.decomposeTransform())},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(t)},dispose:function(){}}),X_.registerVisual(aw("effectScatter","circle")),X_.registerLayout(sw("effectScatter"));var _O=Ve.concatArray,bO=Ve.mergeAll,wO=Ve.map,SO=Uc.encodeHTML,MO="undefined"==typeof Uint32Array?Array:Uint32Array,IO="undefined"==typeof Float64Array?Array:Float64Array;function TO(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=wO(t,(function(e){var t={coords:[e[0].coord,e[1].coord]};return e[0].name&&(t.fromName=e[0].name),e[1].name&&(t.toName=e[1].name),bO([t,e[0],e[1]])})))}var AO=og.extend({type:"series.lines",dependencies:["grid","polar"],visualColorAccessPath:"lineStyle.color",init:function(e){e.data=e.data||[],TO(e);var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),AO.superApply(this,"init",arguments)},mergeOption:function(e){if(e.data=e.data||[],TO(e),e.data){var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count))}AO.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=_O(this._flatCoords,t.flatCoords),this._flatCoordsOffset=_O(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},_getCoordsFromItemModel:function(e){var t=this.getData().getItemModel(e);return t.option instanceof Array?t.option:t.getShallow("coords")},getLineCoordsCount:function(e){return this._flatCoordsOffset?this._flatCoordsOffset[2*e+1]:this._getCoordsFromItemModel(e).length},getLineCoords:function(e,t){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[2*e],n=this._flatCoordsOffset[2*e+1],a=0;a<n;a++)t[a]=t[a]||[],t[a][0]=this._flatCoords[i+2*a],t[a][1]=this._flatCoords[i+2*a+1];return n}var r=this._getCoordsFromItemModel(e);for(a=0;a<r.length;a++)t[a]=t[a]||[],t[a][0]=r[a][0],t[a][1]=r[a][1];return r.length},_processFlatCoordsArray:function(e){var t=0;if(this._flatCoords&&(t=this._flatCoords.length),"number"==typeof e[0]){for(var i=e.length,n=new MO(i),a=new IO(i),r=0,o=0,s=0,l=0;l<i;){s++;var u=e[l++];n[o++]=r+t,n[o++]=u;for(var h=0;h<u;h++){var c=e[l++],d=e[l++];a[r++]=c,a[r++]=d}}return{flatCoordsOffset:new Uint32Array(n.buffer,0,o),flatCoords:a,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:e.length}},getInitialData:function(e,t){var i=new Rv(["value"],this);return i.hasItemOption=!1,i.initData(e.data,[],(function(e,t,n,a){if(e instanceof Array)return NaN;i.hasItemOption=!0;var r=e.value;return null!=r?r instanceof Array?r[a]:r:void 0})),i},formatTooltip:function(e){var t=this.getData().getItemModel(e),i=t.get("name");if(i)return i;var n=t.get("fromName"),a=t.get("toName"),r=[];return null!=n&&r.push(n),null!=a&&r.push(a),SO(r.join(" > "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var e=this.option.progressive;return null==e?this.option.large?1e4:this.get("progressive"):e},getProgressiveThreshold:function(){var e=this.option.progressiveThreshold;return null==e?this.option.large?2e4:this.get("progressiveThreshold"):e},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!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}}}),CO=jx.createSymbol;function DO(e,t,i){tc.Group.call(this),this.add(this.createLine(e,t,i)),this._updateEffectSymbol(e,t)}var LO=DO.prototype;LO.createLine=function(e,t,i){return new sD(e,t,i)},LO._updateEffectSymbol=function(e,t){var i=e.getItemModel(t).getModel("effect"),n=i.get("symbolSize"),a=i.get("symbol");Ve.isArray(n)||(n=[n,n]);var r=i.get("color")||e.getItemVisual(t,"color"),o=this.childAt(1);this._symbolType!==a&&(this.remove(o),(o=CO(a,-.5,-.5,1,1,r)).z2=100,o.culling=!0,this.add(o)),o&&(o.setStyle("shadowColor",r),o.setStyle(i.getItemStyle(["color"])),o.attr("scale",n),o.setColor(r),o.attr("scale",n),this._symbolType=a,this._symbolScale=n,this._updateEffectAnimation(e,i,t))},LO._updateEffectAnimation=function(e,t,i){var n=this.childAt(1);if(n){var a=this,r=e.getItemLayout(i),o=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=Ve.retrieve(t.get("delay"),(function(t){return t/e.count()*o/3})),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,r),l>0&&(o=this.getLineLength(n)/l*1e3),o!==this._period||s!==this._loop){n.stopAnimation();var c=u;h&&(c=u(i)),n.__t>0&&(c=-o*n.__t),n.__t=0;var d=n.animate("",s).when(o,{__t:1}).delay(c).during((function(){a.updateSymbolPosition(n)}));s||d.done((function(){a.remove(n)})),d.start()}this._period=o,this._loop=s}},LO.getLineLength=function(e){return lt.dist(e.__p1,e.__cp1)+lt.dist(e.__cp1,e.__p2)},LO.updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},LO.updateData=function(e,t,i){this.childAt(0).updateData(e,t,i),this._updateEffectSymbol(e,t)},LO.updateSymbolPosition=function(e){var t=e.__p1,i=e.__p2,n=e.__cp1,a=e.__t,r=e.position,o=[r[0],r[1]],s=ys.quadraticAt,l=ys.quadraticDerivativeAt;r[0]=s(t[0],n[0],i[0],a),r[1]=s(t[1],n[1],i[1],a);var u=l(t[0],n[0],i[0],a),h=l(t[1],n[1],i[1],a);if(e.rotation=-Math.atan2(h,u)-Math.PI/2,"line"===this._symbolType||"rect"===this._symbolType||"roundRect"===this._symbolType)if(void 0!==e.__lastT&&e.__lastT<e.__t){var c=1.05*lt.dist(o,r);e.attr("scale",[e.scale[0],c]),1===a&&(r[0]=o[0]+(r[0]-o[0])/2,r[1]=o[1]+(r[1]-o[1])/2)}else if(1===e.__lastT){c=2*lt.dist(t,r);e.attr("scale",[e.scale[0],c])}else e.attr("scale",this._symbolScale);e.__lastT=e.__t,e.ignore=!1},LO.updateLayout=function(e,t){this.childAt(0).updateLayout(e,t);var i=e.getItemModel(t).getModel("effect");this._updateEffectAnimation(e,i,t)},Ve.inherits(DO,tc.Group);var PO=DO;function kO(e,t,i){tc.Group.call(this),this._createPolyline(e,t,i)}var OO=kO.prototype;OO._createPolyline=function(e,t,i){var n=e.getItemLayout(t),a=new tc.Polyline({shape:{points:n}});this.add(a),this._updateCommonStl(e,t,i)},OO.updateData=function(e,t,i){var n=e.hostModel,a=this.childAt(0),r={shape:{points:e.getItemLayout(t)}};tc.updateProps(a,r,n,t),this._updateCommonStl(e,t,i)},OO._updateCommonStl=function(e,t,i){var n=this.childAt(0),a=e.getItemModel(t),r=e.getItemVisual(t,"color"),o=i&&i.lineStyle,s=i&&i.hoverLineStyle;i&&!e.hasItemOption||(o=a.getModel("lineStyle").getLineStyle(),s=a.getModel("emphasis.lineStyle").getLineStyle()),n.useStyle(Ve.defaults({strokeNoScale:!0,fill:"none",stroke:r},o)),n.hoverStyle=s,tc.setHoverStyle(this)},OO.updateLayout=function(e,t){this.childAt(0).setShape("points",e.getItemLayout(t))},Ve.inherits(kO,tc.Group);var RO=kO;function EO(e,t,i){PO.call(this,e,t,i),this._lastFrame=0,this._lastFramePercent=0}var NO=EO.prototype;NO.createLine=function(e,t,i){return new RO(e,t,i)},NO.updateAnimationPoints=function(e,t){this._points=t;for(var i=[0],n=0,a=1;a<t.length;a++){var r=t[a-1],o=t[a];n+=lt.dist(r,o),i.push(n)}if(0!==n){for(a=0;a<i.length;a++)i[a]/=n;this._offsets=i,this._length=n}},NO.getLineLength=function(e){return this._length},NO.updateSymbolPosition=function(e){var t=e.__t,i=this._points,n=this._offsets,a=i.length;if(n){var r=this._lastFrame;if(t<this._lastFramePercent){for(o=Math.min(r+1,a-1);o>=0&&!(n[o]<=t);o--);o=Math.min(o,a-2)}else{for(var o=r;o<a&&!(n[o]>t);o++);o=Math.min(o-1,a-2)}lt.lerp(e.position,i[o],i[o+1],(t-n[o])/(n[o+1]-n[o]));var s=i[o+1][0]-i[o][0],l=i[o+1][1]-i[o][1];e.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},Ve.inherits(EO,PO);var zO=EO,BO=tc.extendShape({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(e,t){var i=t.segs,n=t.curveness;if(t.polyline)for(var a=0;a<i.length;){var r=i[a++];if(r>0){e.moveTo(i[a++],i[a++]);for(var o=1;o<r;o++)e.lineTo(i[a++],i[a++])}}else for(a=0;a<i.length;){var s=i[a++],l=i[a++],u=i[a++],h=i[a++];if(e.moveTo(s,l),n>0){var c=(s+u)/2-(l-h)*n,d=(l+h)/2-(u-s)*n;e.quadraticCurveTo(c,d,u,h)}else e.lineTo(u,h)}},findDataIndex:function(e,t){var i=this.shape,n=i.segs,a=i.curveness;if(i.polyline)for(var r=0,o=0;o<n.length;){var s=n[o++];if(s>0)for(var l=n[o++],u=n[o++],h=1;h<s;h++){var c=n[o++],d=n[o++];if($s.containStroke(l,u,c,d))return r}r++}else for(r=0,o=0;o<n.length;){l=n[o++],u=n[o++],c=n[o++],d=n[o++];if(a>0){var p=(l+c)/2-(u-d)*a,f=(u+d)/2-(c-l)*a;if(Qs.containStroke(l,u,p,f,c,d))return r}else if($s.containStroke(l,u,c,d))return r;r++}return-1}});function VO(){this.group=new tc.Group}var FO=VO.prototype;FO.isPersistent=function(){return!this._incremental},FO.updateData=function(e){this.group.removeAll();var t=new BO({rectHover:!0,cursor:"default"});t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e),this.group.add(t),this._incremental=null},FO.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new Wu({silent:!0})),this.group.add(this._incremental)):this._incremental=null},FO.incrementalUpdate=function(e,t){var i=new BO;i.setShape({segs:t.getLayout("linesPoints")}),this._setCommon(i,t,!!this._incremental),this._incremental?this._incremental.addDisplayable(i,!0):(i.rectHover=!0,i.cursor="default",i.__startIndex=e.start,this.group.add(i))},FO.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},FO._setCommon=function(e,t,i){var n=t.hostModel;e.setShape({polyline:n.get("polyline"),curveness:n.get("lineStyle.curveness")}),e.useStyle(n.getModel("lineStyle").getLineStyle()),e.style.strokeNoScale=!0;var a=t.getVisual("color");a&&e.setStyle("stroke",a),e.setStyle("fill"),i||(e.seriesIndex=n.seriesIndex,e.on("mousemove",(function(t){e.dataIndex=null;var i=e.findDataIndex(t.offsetX,t.offsetY);i>0&&(e.dataIndex=i+e.__startIndex)})))},FO._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var GO=VO,HO={seriesType:"lines",plan:cg(),reset:function(e){var t=e.coordinateSystem,i=e.get("polyline"),n=e.pipelineContext.large;return{progress:function(a,r){var o=[];if(n){var s,l=a.end-a.start;if(i){for(var u=0,h=a.start;h<a.end;h++)u+=e.getLineCoordsCount(h);s=new Float32Array(l+2*u)}else s=new Float32Array(4*l);var c=0,d=[];for(h=a.start;h<a.end;h++){var p=e.getLineCoords(h,o);i&&(s[c++]=p);for(var f=0;f<p;f++)d=t.dataToPoint(o[f],!1,d),s[c++]=d[0],s[c++]=d[1]}r.setLayout("linesPoints",s)}else for(h=a.start;h<a.end;h++){var g=r.getItemModel(h),m=(p=e.getLineCoords(h,o),[]);if(i)for(var v=0;v<p;v++)m.push(t.dataToPoint(o[v]));else{m[0]=t.dataToPoint(o[0]),m[1]=t.dataToPoint(o[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])}r.setItemLayout(h,m)}}}}},WO=HO,UO=Wb.createClipPath;function jO(e){return e instanceof Array||(e=[e,e]),e}X_.extendChartView({type:"lines",init:function(){},render:function(e,t,i){var n=e.getData(),a=this._updateLineDraw(n,e),r=e.get("zlevel"),o=e.get("effect.trailLength"),s=i.getZr(),l="svg"===s.painter.getType();l||s.painter.getLayer(r).clear(!0),null==this._lastZlevel||l||s.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(e)&&o&&(l||s.configLayer(r,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(o/10+.9,1),0)})),a.updateData(n);var u=e.get("clip",!0)&&UO(e.coordinateSystem,!1,e);u?this.group.setClipPath(u):this.group.removeClipPath(),this._lastZlevel=r,this._finished=!0},incrementalPrepareRender:function(e,t,i){var n=e.getData();this._updateLineDraw(n,e).incrementalPrepareUpdate(n),this._clearLayer(i),this._finished=!1},incrementalRender:function(e,t,i){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},updateTransform:function(e,t,i){var n=e.getData(),a=e.pipelineContext;if(!this._finished||a.large||a.progressiveRender)return{update:!0};var r=WO.reset(e);r.progress&&r.progress({start:0,end:n.count()},n),this._lineDraw.updateLayout(),this._clearLayer(i)},_updateLineDraw:function(e,t){var i=this._lineDraw,n=this._showEffect(t),a=!!t.get("polyline"),r=t.pipelineContext.large;return i&&n===this._hasEffet&&a===this._isPolyline&&r===this._isLargeDraw||(i&&i.remove(),i=this._lineDraw=r?new GO:new pD(a?n?zO:RO:n?PO:sD),this._hasEffet=n,this._isPolyline=a,this._isLargeDraw=r,this.group.removeAll()),this.group.add(i.group),i},_showEffect:function(e){return!!e.get("effect.show")},_clearLayer:function(e){var t=e.getZr();"svg"===t.painter.getType()||null==this._lastZlevel||t.painter.getLayer(this._lastZlevel).clear(!0)},remove:function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},dispose:function(){}});var ZO="lineStyle.opacity".split("."),YO={seriesType:"lines",reset:function(e,t,i){var n=jO(e.get("symbol")),a=jO(e.get("symbolSize")),r=e.getData();return r.setVisual("fromSymbol",n&&n[0]),r.setVisual("toSymbol",n&&n[1]),r.setVisual("fromSymbolSize",a&&a[0]),r.setVisual("toSymbolSize",a&&a[1]),r.setVisual("opacity",e.get(ZO)),{dataEach:r.hasItemOption?function(e,t){var i=e.getItemModel(t),n=jO(i.getShallow("symbol",!0)),a=jO(i.getShallow("symbolSize",!0)),r=i.get(ZO);n[0]&&e.setItemVisual(t,"fromSymbol",n[0]),n[1]&&e.setItemVisual(t,"toSymbol",n[1]),a[0]&&e.setItemVisual(t,"fromSymbolSize",a[0]),a[1]&&e.setItemVisual(t,"toSymbolSize",a[1]),e.setItemVisual(t,"opacity",r)}:null}}};X_.registerLayout(WO),X_.registerVisual(YO),og.extend({type:"series.heatmap",getInitialData:function(e,t){return py(this.getSource(),this,{generateCoord:"value"})},preventIncremental:function(){var e=Tp.get(this.get("coordinateSystem"));if(e&&e.dimensions)return"lng"===e.dimensions[0]&&"lat"===e.dimensions[1]},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0}});function XO(){var e=Ve.createCanvas();this.canvas=e,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}XO.prototype={update:function(e,t,i,n,a,r){var o=this._getBrush(),s=this._getGradient(e,a,"inRange"),l=this._getGradient(e,a,"outOfRange"),u=this.pointSize+this.blurSize,h=this.canvas,c=h.getContext("2d"),d=e.length;h.width=t,h.height=i;for(var p=0;p<d;++p){var f=e[p],g=f[0],m=f[1],v=n(f[2]);c.globalAlpha=v,c.drawImage(o,g-u,m-u)}if(!h.width||!h.height)return h;for(var y=c.getImageData(0,0,h.width,h.height),x=y.data,_=0,b=x.length,w=this.minOpacity,S=this.maxOpacity-w;_<b;){v=x[_+3]/256;var M=4*Math.floor(255*v);if(v>0){var I=r(v)?s:l;v>0&&(v=v*S+w),x[_++]=I[M],x[_++]=I[M+1],x[_++]=I[M+2],x[_++]=I[M+3]*v*256}else _+=4}return c.putImageData(y,0,0),h},_getBrush:function(){var e=this._brushCanvas||(this._brushCanvas=Ve.createCanvas()),t=this.pointSize+this.blurSize,i=2*t;e.width=i,e.height=i;var n=e.getContext("2d");return n.clearRect(0,0,i,i),n.shadowOffsetX=i,n.shadowBlur=this.blurSize,n.shadowColor="#000",n.beginPath(),n.arc(-t,t,this.pointSize,0,2*Math.PI,!0),n.closePath(),n.fill(),e},_getGradient:function(e,t,i){for(var n=this._gradientPixels,a=n[i]||(n[i]=new Uint8ClampedArray(1024)),r=[0,0,0,0],o=0,s=0;s<256;s++)t[i](s/255,!0,r),a[o++]=r[0],a[o++]=r[1],a[o++]=r[2],a[o++]=r[3];return a}};var qO=XO;X_.extendChartView({type:"heatmap",render:function(e,t,i){var n;t.eachComponent("visualMap",(function(t){t.eachTargetSeries((function(i){i===e&&(n=t)}))})),this.group.removeAll(),this._incrementalDisplayable=null;var a=e.coordinateSystem;"cartesian2d"===a.type||"calendar"===a.type?this._renderOnCartesianAndCalendar(e,i,0,e.getData().count()):function(e){var t=e.dimensions;return"lng"===t[0]&&"lat"===t[1]}(a)&&this._renderOnGeo(a,e,n,i)},incrementalPrepareRender:function(e,t,i){this.group.removeAll()},incrementalRender:function(e,t,i,n){t.coordinateSystem&&this._renderOnCartesianAndCalendar(t,n,e.start,e.end,!0)},_renderOnCartesianAndCalendar:function(e,t,i,n,a){var r,o,s=e.coordinateSystem;if("cartesian2d"===s.type){var l=s.getAxis("x"),u=s.getAxis("y");r=l.getBandWidth(),o=u.getBandWidth()}for(var h=this.group,c=e.getData(),d="itemStyle",p="emphasis.itemStyle",f="label",g="emphasis.label",m=e.getModel(d).getItemStyle(["color"]),v=e.getModel(p).getItemStyle(),y=e.getModel(f),x=e.getModel(g),_=s.type,b="cartesian2d"===_?[c.mapDimension("x"),c.mapDimension("y"),c.mapDimension("value")]:[c.mapDimension("time"),c.mapDimension("value")],w=i;w<n;w++){var S;if("cartesian2d"===_){if(isNaN(c.get(b[2],w)))continue;var M=s.dataToPoint([c.get(b[0],w),c.get(b[1],w)]);S=new tc.Rect({shape:{x:Math.floor(Math.round(M[0])-r/2),y:Math.floor(Math.round(M[1])-o/2),width:Math.ceil(r),height:Math.ceil(o)},style:{fill:c.getItemVisual(w,"color"),opacity:c.getItemVisual(w,"opacity")}})}else{if(isNaN(c.get(b[1],w)))continue;S=new tc.Rect({z2:1,shape:s.dataToRect([c.get(b[0],w)]).contentShape,style:{fill:c.getItemVisual(w,"color"),opacity:c.getItemVisual(w,"opacity")}})}var I=c.getItemModel(w);c.hasItemOption&&(m=I.getModel(d).getItemStyle(["color"]),v=I.getModel(p).getItemStyle(),y=I.getModel(f),x=I.getModel(g));var T=e.getRawValue(w),A="-";T&&null!=T[2]&&(A=T[2]),tc.setLabelStyle(m,v,y,x,{labelFetcher:e,labelDataIndex:w,defaultText:A,isRectText:!0}),S.setStyle(m),tc.setHoverStyle(S,c.hasItemOption?v:Ve.extend({},v)),S.incremental=a,a&&(S.useHoverLayer=!0),h.add(S),c.setItemGraphicEl(w,S)}},_renderOnGeo:function(e,t,i,n){var a=i.targetVisuals.inRange,r=i.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new qO;s.blurSize=t.get("blurSize"),s.pointSize=t.get("pointSize"),s.minOpacity=t.get("minOpacity"),s.maxOpacity=t.get("maxOpacity");var l=e.getViewRect().clone(),u=e.getRoamTransform();l.applyTransform(u);var h=Math.max(l.x,0),c=Math.max(l.y,0),d=Math.min(l.width+l.x,n.getWidth()),p=Math.min(l.height+l.y,n.getHeight()),f=d-h,g=p-c,m=[o.mapDimension("lng"),o.mapDimension("lat"),o.mapDimension("value")],v=o.mapArray(m,(function(t,i,n){var a=e.dataToPoint([t,i]);return a[0]-=h,a[1]-=c,a.push(n),a})),y=i.getExtent(),x="visualMap.continuous"===i.type?function(e,t){var i=e[1]-e[0];return t=[(t[0]-e[0])/i,(t[1]-e[0])/i],function(e){return e>=t[0]&&e<=t[1]}}(y,i.option.range):function(e,t,i){var n=e[1]-e[0],a=(t=Ve.map(t,(function(t){return{interval:[(t.interval[0]-e[0])/n,(t.interval[1]-e[0])/n]}}))).length,r=0;return function(e){for(var n=r;n<a;n++)if((o=t[n].interval)[0]<=e&&e<=o[1]){r=n;break}if(n===a)for(n=r-1;n>=0;n--){var o;if((o=t[n].interval)[0]<=e&&e<=o[1]){r=n;break}}return n>=0&&n<a&&i[n]}}(y,i.getPieceList(),i.option.selected);s.update(v,f,g,a.color.getNormalizer(),{inRange:a.color.getColorMapper(),outOfRange:r.color.getColorMapper()},x);var _=new tc.Image({style:{width:f,height:g,x:h,y:c,image:s.canvas},silent:!0});this.group.add(_)},dispose:function(){}});var $O=ES.extend({type:"series.pictorialBar",dependencies:["grid"],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%",progressive:0,hoverAnimation:!1},getInitialData:function(e){return e.stack=null,$O.superApply(this,"getInitialData",arguments)}}),KO=jx.createSymbol,JO=Pc.parsePercent,QO=Pc.isNumeric,eR=VS.setLabel,tR=["itemStyle","borderWidth"],iR=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],nR=new tc.Circle;function aR(e,t,i,n){var a=e.getItemLayout(t),r=i.get("symbolRepeat"),o=i.get("symbolClip"),s=i.get("symbolPosition")||"start",l=(i.get("symbolRotate")||0)*Math.PI/180||0,u=i.get("symbolPatternSize")||2,h=i.isAnimationEnabled(),c={dataIndex:t,layout:a,itemModel:i,symbolType:e.getItemVisual(t,"symbol")||"circle",color:e.getItemVisual(t,"color"),symbolClip:o,symbolRepeat:r,symbolRepeatDirection:i.get("symbolRepeatDirection"),symbolPatternSize:u,rotation:l,animationModel:h?i:null,hoverAnimation:h&&i.get("hoverAnimation"),z2:i.getShallow("z",!0)||0};!function(e,t,i,n,a){var r,o=n.valueDim,s=e.get("symbolBoundingData"),l=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),u=l.toGlobalCoord(l.dataToCoord(0)),h=1-+(i[o.wh]<=0);if(Ve.isArray(s)){var c=[rR(l,s[0])-u,rR(l,s[1])-u];c[1]<c[0]&&c.reverse(),r=c[h]}else r=null!=s?rR(l,s)-u:t?n.coordSysExtent[o.index][h]-u:i[o.wh];a.boundingLength=r,t&&(a.repeatCutLength=i[o.wh]);a.pxSign=r>0?1:r<0?-1:0}(i,r,a,n,c),function(e,t,i,n,a,r,o,s,l,u){var h=l.valueDim,c=l.categoryDim,d=Math.abs(i[c.wh]),p=e.getItemVisual(t,"symbolSize");Ve.isArray(p)?p=p.slice():(null==p&&(p="100%"),p=[p,p]);p[c.index]=JO(p[c.index],d),p[h.index]=JO(p[h.index],n?d:Math.abs(r)),u.symbolSize=p;var f=u.symbolScale=[p[0]/s,p[1]/s];f[h.index]*=(l.isHorizontal?-1:1)*o}(e,t,a,r,0,c.boundingLength,c.pxSign,u,n,c),function(e,t,i,n,a){var r=e.get(tR)||0;r&&(nR.attr({scale:t.slice(),rotation:i}),nR.updateTransform(),r/=nR.getLineScale(),r*=t[n.valueDim.index]);a.valueLineWidth=r}(i,c.symbolScale,l,n,c);var d=c.symbolSize,p=i.get("symbolOffset");return Ve.isArray(p)&&(p=[JO(p[0],d[0]),JO(p[1],d[1])]),function(e,t,i,n,a,r,o,s,l,u,h,c){var d=h.categoryDim,p=h.valueDim,f=c.pxSign,g=Math.max(t[p.index]+s,0),m=g;if(n){var v=Math.abs(l),y=Ve.retrieve(e.get("symbolMargin"),"15%")+"",x=!1;y.lastIndexOf("!")===y.length-1&&(x=!0,y=y.slice(0,y.length-1)),y=JO(y,t[p.index]);var _=Math.max(g+2*y,0),b=x?0:2*y,w=QO(n),S=w?n:bR((v+b)/_);_=g+2*(y=(v-S*g)/2/(x?S:S-1)),b=x?0:2*y,w||"fixed"===n||(S=u?bR((Math.abs(u)+b)/_):0),m=S*_-b,c.repeatTimes=S,c.symbolMargin=y}var M=f*(m/2),I=c.pathPosition=[];I[d.index]=i[d.wh]/2,I[p.index]="start"===o?M:"end"===o?l-M:l/2,r&&(I[0]+=r[0],I[1]+=r[1]);var T=c.bundlePosition=[];T[d.index]=i[d.xy],T[p.index]=i[p.xy];var A=c.barRectShape=Ve.extend({},i);A[p.wh]=f*Math.max(Math.abs(i[p.wh]),Math.abs(I[p.index]+M)),A[d.wh]=i[d.wh];var C=c.clipShape={};C[d.xy]=-i[d.xy],C[d.wh]=h.ecSize[d.wh],C[p.xy]=0,C[p.wh]=i[p.wh]}(i,d,a,r,0,p,s,c.valueLineWidth,c.boundingLength,c.repeatCutLength,n,c),c}function rR(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function oR(e){var t=e.symbolPatternSize,i=KO(e.symbolType,-t/2,-t/2,t,t,e.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function sR(e,t,i,n){var a=e.__pictorialBundle,r=i.symbolSize,o=i.valueLineWidth,s=i.pathPosition,l=t.valueDim,u=i.repeatTimes||0,h=0,c=r[t.valueDim.index]+o+2*i.symbolMargin;for(yR(e,(function(e){e.__pictorialAnimationIndex=h,e.__pictorialRepeatTimes=u,h<u?xR(e,null,f(h),i,n):xR(e,null,{scale:[0,0]},i,n,(function(){a.remove(e)})),fR(e,i),h++}));h<u;h++){var d=oR(i);d.__pictorialAnimationIndex=h,d.__pictorialRepeatTimes=u,a.add(d);var p=f(h);xR(d,{position:p.position,scale:[0,0]},{scale:p.scale,rotation:p.rotation},i,n),d.on("mouseover",g).on("mouseout",m),fR(d,i)}function f(e){var t=s.slice(),n=i.pxSign,a=e;return("start"===i.symbolRepeatDirection?n>0:n<0)&&(a=u-1-e),t[l.index]=c*(a-u/2+.5)+s[l.index],{position:t,scale:i.symbolScale.slice(),rotation:i.rotation}}function g(){yR(e,(function(e){e.trigger("emphasis")}))}function m(){yR(e,(function(e){e.trigger("normal")}))}}function lR(e,t,i,n){var a=e.__pictorialBundle,r=e.__pictorialMainPath;r?xR(r,null,{position:i.pathPosition.slice(),scale:i.symbolScale.slice(),rotation:i.rotation},i,n):(r=e.__pictorialMainPath=oR(i),a.add(r),xR(r,{position:i.pathPosition.slice(),scale:[0,0],rotation:i.rotation},{scale:i.symbolScale.slice()},i,n),r.on("mouseover",(function(){this.trigger("emphasis")})).on("mouseout",(function(){this.trigger("normal")}))),fR(r,i)}function uR(e,t,i){var n=Ve.extend({},t.barRectShape),a=e.__pictorialBarRect;a?xR(a,null,{shape:n},t,i):(a=e.__pictorialBarRect=new tc.Rect({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),e.add(a))}function hR(e,t,i,n){if(i.symbolClip){var a=e.__pictorialClipPath,r=Ve.extend({},i.clipShape),o=t.valueDim,s=i.animationModel,l=i.dataIndex;if(a)tc.updateProps(a,{shape:r},s,l);else{r[o.wh]=0,a=new tc.Rect({shape:r}),e.__pictorialBundle.setClipPath(a),e.__pictorialClipPath=a;var u={};u[o.wh]=i.clipShape[o.wh],tc[n?"updateProps":"initProps"](a,{shape:u},s,l)}}}function cR(e,t){var i=e.getItemModel(t);return i.getAnimationDelayParams=dR,i.isAnimationEnabled=pR,i}function dR(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function pR(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function fR(e,t){e.off("emphasis").off("normal");var i=t.symbolScale.slice();t.hoverAnimation&&e.on("emphasis",(function(){this.animateTo({scale:[1.1*i[0],1.1*i[1]]},400,"elasticOut")})).on("normal",(function(){this.animateTo({scale:i.slice()},400,"elasticOut")}))}function gR(e,t,i,n){var a=new tc.Group,r=new tc.Group;return a.add(r),a.__pictorialBundle=r,r.attr("position",i.bundlePosition.slice()),i.symbolRepeat?sR(a,t,i):lR(a,0,i),uR(a,i,n),hR(a,t,i,n),a.__pictorialShapeStr=vR(e,i),a.__pictorialSymbolMeta=i,a}function mR(e,t,i,n){var a=n.__pictorialBarRect;a&&(a.style.text=null);var r=[];yR(n,(function(e){r.push(e)})),n.__pictorialMainPath&&r.push(n.__pictorialMainPath),n.__pictorialClipPath&&(i=null),Ve.each(r,(function(e){tc.updateProps(e,{scale:[0,0]},i,t,(function(){n.parent&&n.parent.remove(n)}))})),e.setItemGraphicEl(t,null)}function vR(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function yR(e,t,i){Ve.each(e.__pictorialBundle.children(),(function(n){n!==e.__pictorialBarRect&&t.call(i,n)}))}function xR(e,t,i,n,a,r){t&&e.attr(t),n.symbolClip&&!a?i&&e.attr(i):i&&tc[a?"updateProps":"initProps"](e,i,n.animationModel,n.dataIndex,r)}function _R(e,t,i){var n=i.color,a=i.dataIndex,r=i.itemModel,o=r.getModel("itemStyle").getItemStyle(["color"]),s=r.getModel("emphasis.itemStyle").getItemStyle(),l=r.getShallow("cursor");yR(e,(function(e){e.setColor(n),e.setStyle(Ve.defaults({fill:n,opacity:i.opacity},o)),tc.setHoverStyle(e,s),l&&(e.cursor=l),e.z2=i.z2}));var u={},h=t.valueDim.posDesc[+(i.boundingLength>0)],c=e.__pictorialBarRect;eR(c.style,u,r,n,t.seriesModel,a,h),tc.setHoverStyle(c,u)}function bR(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}X_.extendChartView({type:"pictorialBar",render:function(e,t,i){var n=this.group,a=e.getData(),r=this._data,o=e.coordinateSystem,s=!!o.getBaseAxis().isHorizontal(),l=o.grid.getRect(),u={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[l.x,l.x+l.width],[l.y,l.y+l.height]],isHorizontal:s,valueDim:iR[+s],categoryDim:iR[1-s]};return a.diff(r).add((function(e){if(a.hasValue(e)){var t=cR(a,e),i=aR(a,e,t,u),r=gR(a,u,i);a.setItemGraphicEl(e,r),n.add(r),_R(r,u,i)}})).update((function(e,t){var i=r.getItemGraphicEl(t);if(a.hasValue(e)){var o=cR(a,e),s=aR(a,e,o,u),l=vR(a,s);i&&l!==i.__pictorialShapeStr&&(n.remove(i),a.setItemGraphicEl(e,null),i=null),i?function(e,t,i){var n=i.animationModel,a=i.dataIndex,r=e.__pictorialBundle;tc.updateProps(r,{position:i.bundlePosition.slice()},n,a),i.symbolRepeat?sR(e,t,i,!0):lR(e,t,i,!0);uR(e,i,!0),hR(e,t,i,!0)}(i,u,s):i=gR(a,u,s,!0),a.setItemGraphicEl(e,i),i.__pictorialSymbolMeta=s,n.add(i),_R(i,u,s)}else n.remove(i)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&mR(r,e,t.__pictorialSymbolMeta.animationModel,t)})).execute(),this._data=a,this.group},dispose:Ve.noop,remove:function(e,t){var i=this.group,n=this._data;e.get("animation")?n&&n.eachItemGraphicEl((function(t){mR(n,t.dataIndex,e,t)})):i.removeAll()}});var wR=Ky.layout;X_.registerLayout(Ve.curry(wR,"pictorialBar")),X_.registerVisual(aw("pictorialBar","roundRect"));var SR=function(e,t,i,n,a){L_.call(this,e,t,i),this.type=n||"value",this.position=a||"bottom",this.orient=null};SR.prototype={constructor:SR,model:null,isHorizontal:function(){var e=this.position;return"top"===e||"bottom"===e},pointToData:function(e,t){return this.coordinateSystem.pointToData(e,t)[0]},toGlobalCoord:null,toLocalCoord:null},Ve.inherits(SR,L_);var MR=SR,IR=nd.getLayoutRect,TR=Ve.each;function AR(e,t,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(e,t,i),this.model=e}AR.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:AR,_init:function(e,t,i){var n=this.dimension,a=new MR(n,Px.createScaleByModel(e),[0,0],e.get("type"),e.get("position")),r="category"===a.type;a.onBand=r&&e.get("boundaryGap"),a.inverse=e.get("inverse"),a.orient=e.get("orient"),e.axis=a,a.model=e,a.coordinateSystem=this,this._axis=a},update:function(e,t){e.eachSeries((function(e){if(e.coordinateSystem===this){var t=e.getData();TR(t.mapDimension(this.dimension,!0),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),Px.niceScaleExtent(this._axis.scale,this._axis.model)}}),this)},resize:function(e,t){this._rect=IR({left:e.get("left"),top:e.get("top"),right:e.get("right"),bottom:e.get("bottom"),width:e.get("width"),height:e.get("height")},{width:t.getWidth(),height:t.getHeight()}),this._adjustAxis()},getRect:function(){return this._rect},_adjustAxis:function(){var e=this._rect,t=this._axis,i=t.isHorizontal(),n=i?[0,e.width]:[0,e.height],a=t.reverse?1:0;t.setExtent(n[a],n[1-a]),this._updateAxisTransform(t,i?e.x:e.y)},_updateAxisTransform:function(e,t){var i=e.getExtent(),n=i[0]+i[1],a=e.isHorizontal();e.toGlobalCoord=a?function(e){return e+t}:function(e){return n-e+t},e.toLocalCoord=a?function(e){return e-t}:function(e){return n-e+t}},getAxis:function(){return this._axis},getBaseAxis:function(){return this._axis},getAxes:function(){return[this._axis]},getTooltipAxes:function(){return{baseAxes:[this.getAxis()]}},containPoint:function(e){var t=this.getRect(),i=this.getAxis();return"horizontal"===i.orient?i.contain(i.toLocalCoord(e[0]))&&e[1]>=t.y&&e[1]<=t.y+t.height:i.contain(i.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},pointToData:function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e["horizontal"===t.orient?0:1]))]},dataToPoint:function(e){var t=this.getAxis(),i=this.getRect(),n=[],a="horizontal"===t.orient?0:1;return e instanceof Array&&(e=e[0]),n[a]=t.toGlobalCoord(t.dataToCoord(+e)),n[1-a]=0===a?i.y+i.height/2:i.x+i.width/2,n}};var CR=AR;Tp.register("single",{create:function(e,t){var i=[];return e.eachComponent("singleAxis",(function(n,a){var r=new CR(n,e,t);r.name="single_"+a,r.resize(n,t),n.coordinateSystem=r,i.push(r)})),e.eachSeries((function(t){if("singleAxis"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"singleAxis",index:t.get("singleAxisIndex"),id:t.get("singleAxisId")})[0];t.coordinateSystem=i&&i.coordinateSystem}})),i},dimensions:CR.prototype.dimensions});var DR=function(e,t){t=t||{};var i=e.coordinateSystem,n=e.axis,a={},r=n.position,o=n.orient,s=i.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]}};a.position=["vertical"===o?u.vertical[r]:l[0],"horizontal"===o?u.horizontal[r]:l[3]],a.rotation=Math.PI/2*{horizontal:0,vertical:1}[o],a.labelDirection=a.tickDirection=a.nameDirection={top:-1,bottom:1,right:1,left:-1}[r],e.get("axisTick.inside")&&(a.tickDirection=-a.tickDirection),Ve.retrieve(t.labelInside,e.get("axisLabel.inside"))&&(a.labelDirection=-a.labelDirection);var h=t.rotate;return null==h&&(h=e.get("axisLabel.rotate")),a.labelRotation="top"===r?-h:h,a.z2=1,a},LR={layout:DR},PR=DS.rectCoordAxisBuildSplitArea,kR=DS.rectCoordAxisHandleRemove,OR=["axisLine","axisTickLabel","axisName"],RR=["splitArea","splitLine"],ER=IS.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(e,t,i,n){var a=this.group;a.removeAll();var r=this._axisGroup;this._axisGroup=new tc.Group;var o=LR.layout(e),s=new cS(e,o);Ve.each(OR,s.add,s),a.add(this._axisGroup),a.add(s.getGroup()),Ve.each(RR,(function(t){e.get(t+".show")&&this["_"+t](e)}),this),tc.groupTransition(r,this._axisGroup,e),ER.superCall(this,"render",e,t,i,n)},remove:function(){kR(this)},_splitLine:function(e){var t=e.axis;if(!t.scale.isBlank()){var i=e.getModel("splitLine"),n=i.getModel("lineStyle"),a=n.get("width"),r=n.get("color");r=r instanceof Array?r:[r];for(var o=e.coordinateSystem.getRect(),s=t.isHorizontal(),l=[],u=0,h=t.getTicksCoords({tickModel:i}),c=[],d=[],p=0;p<h.length;++p){var f=t.toGlobalCoord(h[p].coord);s?(c[0]=f,c[1]=o.y,d[0]=f,d[1]=o.y+o.height):(c[0]=o.x,c[1]=f,d[0]=o.x+o.width,d[1]=f);var g=u++%r.length;l[g]=l[g]||[],l[g].push(new tc.Line({subPixelOptimize:!0,shape:{x1:c[0],y1:c[1],x2:d[0],y2:d[1]},style:{lineWidth:a},silent:!0}))}for(p=0;p<l.length;++p)this.group.add(tc.mergePath(l[p],{style:{stroke:r[p%r.length],lineDash:n.getLineDash(a),lineWidth:a},silent:!0}))}},_splitArea:function(e){PR(this,this._axisGroup,e,e)}}),NR=ud.extend({type:"singleAxis",layoutMode:"box",axis:null,coordinateSystem:null,getCoordSysModel:function(){return this}});Ve.merge(NR.prototype,Ox),Mw("single",NR,(function(e,t){return t.type||(t.data?"category":"value")}),{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}}});var zR=function(e,t){var i,n=[],a=e.seriesIndex;if(null==a||!(i=t.getSeriesByIndex(a)))return{point:[]};var r=i.getData(),o=Ro.queryDataIndex(r,e);if(null==o||o<0||Ve.isArray(o))return{point:[]};var s=r.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)n=l.dataToPoint(r.getValues(Ve.map(l.dimensions,(function(e){return r.mapDimension(e)})),o,!0))||[];else if(s){var u=s.getBoundingRect().clone();u.applyTransform(s.transform),n=[u.x+u.width/2,u.y+u.height/2]}return{point:n,el:s}},BR=Ro.makeInner,VR=Ve.each,FR=Ve.curry,GR=BR();function HR(e,t,i,n,a){var r=e.axis;if(!r.scale.isBlank()&&r.containData(t))if(e.involveSeries){var o=function(e,t){var i=t.axis,n=i.dim,a=e,r=[],o=Number.MAX_VALUE,s=-1;return VR(t.seriesModels,(function(t,l){var u,h,c=t.getData().mapDimension(n,!0);if(t.getAxisTooltipData){var d=t.getAxisTooltipData(c,e,i);h=d.dataIndices,u=d.nestestValue}else{if(!(h=t.getData().indicesOfNearest(c[0],e,"category"===i.type?.5:null)).length)return;u=t.getData().get(c[0],h[0])}if(null!=u&&isFinite(u)){var p=e-u,f=Math.abs(p);f<=o&&((f<o||p>=0&&s<0)&&(o=f,s=p,a=u,r.length=0),VR(h,(function(e){r.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})})))}})),{payloadBatch:r,snapToValue:a}}(t,e),s=o.payloadBatch,l=o.snapToValue;s[0]&&null==a.seriesIndex&&Ve.extend(a,s[0]),!n&&e.snap&&r.containData(l)&&null!=l&&(t=l),i.showPointer(e,t,s,a),i.showTooltip(e,o,l)}else i.showPointer(e,t)}function WR(e,t,i,n){e[t.key]={value:i,payloadBatch:n}}function UR(e,t,i,n){var a=i.payloadBatch,r=t.axis,o=r.model,s=t.axisPointerModel;if(t.triggerTooltip&&a.length){var l=t.coordSys.model,u=_S.makeKey(l),h=e.map[u];h||(h=e.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},e.list.push(h)),h.dataByAxis.push({axisDim:r.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get("label.precision"),formatter:s.get("label.formatter")},seriesDataIndices:a.slice()})}}function jR(e){var t=e.axis.model,i={},n=i.axisDim=e.axis.dim;return i.axisIndex=i[n+"AxisIndex"]=t.componentIndex,i.axisName=i[n+"AxisName"]=t.name,i.axisId=i[n+"AxisId"]=t.id,i}function ZR(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}var YR=function(e,t,i){var n=e.currTrigger,a=[e.x,e.y],r=e,o=e.dispatchAction||Ve.bind(i.dispatchAction,i),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){ZR(a)&&(a=zR({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},t).point);var l=ZR(a),u=r.axesInfo,h=s.axesInfo,c="leave"===n||ZR(a),d={},p={},f={list:[],map:{}},g={showPointer:FR(WR,p),showTooltip:FR(UR,f)};VR(s.coordSysMap,(function(e,t){var i=l||e.containPoint(a);VR(s.coordSysAxesInfo[t],(function(e,t){var n=e.axis,r=function(e,t){for(var i=0;i<(e||[]).length;i++){var n=e[i];if(t.axis.dim===n.axisDim&&t.axis.model.componentIndex===n.axisIndex)return n}}(u,e);if(!c&&i&&(!u||r)){var o=r&&r.value;null!=o||l||(o=n.pointToData(a)),null!=o&&HR(e,o,g,!1,d)}}))}));var m={};return VR(h,(function(e,t){var i=e.linkGroup;i&&!p[t]&&VR(i.axesInfo,(function(t,n){var a=p[n];if(t!==e&&a){var r=a.value;i.mapper&&(r=e.axis.scale.parse(i.mapper(r,jR(t),jR(e)))),m[e.key]=r}}))})),VR(m,(function(e,t){HR(h[t],e,g,!0,d)})),function(e,t,i){var n=i.axesInfo=[];VR(t,(function(t,i){var a=t.axisPointerModel.option,r=e[i];r?(!t.useHandle&&(a.status="show"),a.value=r.value,a.seriesDataIndices=(r.payloadBatch||[]).slice()):!t.useHandle&&(a.status="hide"),"show"===a.status&&n.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:a.value})}))}(p,h,d),function(e,t,i,n){if(ZR(t)||!e.list.length)return void n({type:"hideTip"});var a=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:t[0],y:t[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:a.dataIndexInside,dataIndex:a.dataIndex,seriesIndex:a.seriesIndex,dataByCoordSys:e.list})}(f,a,e,o),function(e,t,i){var n=i.getZr(),a="axisPointerLastHighlights",r=GR(n)[a]||{},o=GR(n)[a]={};VR(e,(function(e,t){var i=e.axisPointerModel.option;"show"===i.status&&VR(i.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];Ve.each(r,(function(e,t){!o[t]&&l.push(e)})),Ve.each(o,(function(e,t){!r[t]&&s.push(e)})),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}(h,0,i),d}};X_.extendComponentModel({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},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:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}}});var XR=(0,Ro.makeInner)(),qR=Ve.each;function $R(e,t,i){e.handler("leave",null,i)}function KR(e,t,i,n){t.handler(e,i,n)}var JR=function(e,t,i){if(!ie.node){var n=t.getZr();XR(n).records||(XR(n).records={}),function(e,t){if(XR(e).initialized)return;function i(i,n){e.on(i,(function(i){var a=function(e){var t={showTip:[],hideTip:[]},i=function(n){var a=t[n.type];a?a.push(n):(n.dispatchAction=i,e.dispatchAction(n))};return{dispatchAction:i,pendings:t}}(t);qR(XR(e).records,(function(e){e&&n(e,i,a.dispatchAction)})),function(e,t){var i,n=e.showTip.length,a=e.hideTip.length;n?i=e.showTip[n-1]:a&&(i=e.hideTip[a-1]);i&&(i.dispatchAction=null,t.dispatchAction(i))}(a.pendings,t)}))}XR(e).initialized=!0,i("click",Ve.curry(KR,"click")),i("mousemove",Ve.curry(KR,"mousemove")),i("globalout",$R)}(n,t),(XR(n).records[e]||(XR(n).records[e]={})).handler=i}},QR={register:JR,unregister:function(e,t){if(!ie.node){var i=t.getZr();(XR(i).records||{})[e]&&(XR(i).records[e]=null)}}},eE=X_.extendComponentView({type:"axisPointer",render:function(e,t,i){var n=t.getComponent("tooltip"),a=e.get("triggerOn")||n&&n.get("triggerOn")||"mousemove|click";QR.register("axisPointer",i,(function(e,t,i){"none"!==a&&("leave"===e||a.indexOf(e)>=0)&&i({type:"updateAxisPointer",currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})}))},remove:function(e,t){QR.unregister(t.getZr(),"axisPointer"),eE.superApply(this._model,"remove",arguments)},dispose:function(e,t){QR.unregister("axisPointer",t),eE.superApply(this._model,"dispose",arguments)}}),tE=(0,Ro.makeInner)(),iE=Ve.clone,nE=Ve.bind;function aE(){}function rE(e,t,i,n){oE(tE(i).lastProp,n)||(tE(i).lastProp=n,t?tc.updateProps(i,n,e):(i.stopAnimation(),i.attr(n)))}function oE(e,t){if(Ve.isObject(e)&&Ve.isObject(t)){var i=!0;return Ve.each(t,(function(t,n){i=i&&oE(e[n],t)})),!!i}return e===t}function sE(e,t){e[t.get("label.show")?"show":"hide"]()}function lE(e){return{position:e.position.slice(),rotation:e.rotation||0}}function uE(e,t,i){var n=t.get("z"),a=t.get("zlevel");e&&e.traverse((function(e){"group"!==e.type&&(null!=n&&(e.z=n),null!=a&&(e.zlevel=a),e.silent=i)}))}aE.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(e,t,i,n){var a=t.get("value"),r=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=i,n||this._lastValue!==a||this._lastStatus!==r){this._lastValue=a,this._lastStatus=r;var o=this._group,s=this._handle;if(!r||"hide"===r)return o&&o.hide(),void(s&&s.hide());o&&o.show(),s&&s.show();var l={};this.makeElOption(l,a,e,t,i);var u=l.graphicKey;u!==this._lastGraphicKey&&this.clear(i),this._lastGraphicKey=u;var h=this._moveAnimation=this.determineAnimation(e,t);if(o){var c=Ve.curry(rE,t,h);this.updatePointerEl(o,l,c,t),this.updateLabelEl(o,l,c,t)}else o=this._group=new tc.Group,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),i.getZr().add(o);uE(o,t,!0),this._renderHandle(a)}},remove:function(e){this.clear(e)},dispose:function(e){this.clear(e)},determineAnimation:function(e,t){var i=t.get("animation"),n=e.axis,a="category"===n.type,r=t.get("snap");if(!r&&!a)return!1;if("auto"===i||null==i){var o=this.animationThreshold;if(a&&n.getBandWidth()>o)return!0;if(r){var s=_S.getAxisInfo(e).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>o}return!1}return!0===i},makeElOption:function(e,t,i,n,a){},createPointerEl:function(e,t,i,n){var a=t.pointer;if(a){var r=tE(e).pointerEl=new tc[a.type](iE(t.pointer));e.add(r)}},createLabelEl:function(e,t,i,n){if(t.label){var a=tE(e).labelEl=new tc.Rect(iE(t.label));e.add(a),sE(a,n)}},updatePointerEl:function(e,t,i){var n=tE(e).pointerEl;n&&t.pointer&&(n.setStyle(t.pointer.style),i(n,{shape:t.pointer.shape}))},updateLabelEl:function(e,t,i,n){var a=tE(e).labelEl;a&&(a.setStyle(t.label.style),i(a,{shape:t.label.shape,position:t.label.position}),sE(a,n))},_renderHandle:function(e){if(!this._dragging&&this.updateHandleTransform){var t,i=this._axisPointerModel,n=this._api.getZr(),a=this._handle,r=i.getModel("handle"),o=i.get("status");if(!r.get("show")||!o||"hide"===o)return a&&n.remove(a),void(this._handle=null);this._handle||(t=!0,a=this._handle=tc.createIcon(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){Et.stop(e.event)},onmousedown:nE(this._onHandleDragMove,this,0,0),drift:nE(this._onHandleDragMove,this),ondragend:nE(this._onHandleDragEnd,this)}),n.add(a)),uE(a,i,!1);a.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");Ve.isArray(s)||(s=[s,s]),a.attr("scale",[s[0]/2,s[1]/2]),Cg.createOrUpdate(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},_moveHandleToValue:function(e,t){rE(this._axisPointerModel,!t&&this._moveAnimation,this._handle,lE(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(e,t){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(lE(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(lE(n)),tE(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},_onHandleDragEnd:function(e){if(this._dragging=!1,this._handle){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),i=this._group,n=this._handle;t&&i&&(this._lastGraphicKey=null,i&&t.remove(i),n&&t.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}}},aE.prototype.constructor=aE,Wo.enableClassExtend(aE);var hE=aE;function cE(e,t,i,n,a){var r=dE(i.get("value"),t.axis,t.ecModel,i.get("seriesDataIndices"),{precision:i.get("label.precision"),formatter:i.get("label.formatter")}),o=i.getModel("label"),s=Uc.normalizeCssArray(o.get("padding")||0),l=o.getFont(),u=Wa.getBoundingRect(r,l),h=a.position,c=u.width+s[1]+s[3],d=u.height+s[0]+s[2],p=a.align;"right"===p&&(h[0]-=c),"center"===p&&(h[0]-=c/2);var f=a.verticalAlign;"bottom"===f&&(h[1]-=d),"middle"===f&&(h[1]-=d/2),function(e,t,i,n){var a=n.getWidth(),r=n.getHeight();e[0]=Math.min(e[0]+t,a)-t,e[1]=Math.min(e[1]+i,r)-i,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}(h,c,d,n);var g=o.get("backgroundColor");g&&"auto"!==g||(g=t.get("axisLine.lineStyle.color")),e.label={shape:{x:0,y:0,width:c,height:d,r:o.get("borderRadius")},position:h.slice(),style:{text:r,textFont:l,textFill:o.getTextColor(),textPosition:"inside",textPadding:s,fill:g,stroke:o.get("borderColor")||"transparent",lineWidth:o.get("borderWidth")||0,shadowBlur:o.get("shadowBlur"),shadowColor:o.get("shadowColor"),shadowOffsetX:o.get("shadowOffsetX"),shadowOffsetY:o.get("shadowOffsetY")},z2:10}}function dE(e,t,i,n,a){e=t.scale.parse(e);var r=t.scale.getLabel(e,{precision:a.precision}),o=a.formatter;if(o){var s={value:Px.getAxisRawValue(t,e),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};Ve.each(n,(function(e){var t=i.getSeriesByIndex(e.seriesIndex),n=e.dataIndexInside,a=t&&t.getDataParams(n);a&&s.seriesData.push(a)})),Ve.isString(o)?r=o.replace("{value}",r):Ve.isFunction(o)&&(r=o(s))}return r}function pE(e,t,i){var n=ni.create();return ni.rotate(n,n,i.rotation),ni.translate(n,n,i.position),tc.applyTransform([e.dataToCoord(t),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}var fE=function(e){var t,i=e.get("type"),n=e.getModel(i+"Style");return"line"===i?(t=n.getLineStyle()).fill=null:"shadow"===i&&((t=n.getAreaStyle()).stroke=null),t},gE={buildElStyle:fE,buildLabelElOption:cE,getValueLabel:dE,getTransformedPosition:pE,buildCartesianSingleLabelElOption:function(e,t,i,n,a,r){var o=cS.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=a.get("label.margin"),cE(t,n,a,r,{position:pE(n.axis,e,i),align:o.textAlign,verticalAlign:o.textVerticalAlign})},makeLineShape:function(e,t,i){return{x1:e[i=i||0],y1:e[1-i],x2:t[i],y2:t[1-i]}},makeRectShape:function(e,t,i){return{x:e[i=i||0],y:e[1-i],width:t[i],height:t[1-i]}},makeSectorShape:function(e,t,i,n,a,r){return{cx:e,cy:t,r0:i,r:n,startAngle:a,endAngle:r,clockwise:!0}}},mE=hE.extend({makeElOption:function(e,t,i,n,a){var r=i.axis,o=r.grid,s=n.get("type"),l=vE(o,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(t,!0));if(s&&"none"!==s){var h=gE.buildElStyle(n),c=yE[s](r,u,l);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=AS.layout(o.model,i);gE.buildCartesianSingleLabelElOption(t,e,d,i,n,a)},getHandleTransform:function(e,t,i){var n=AS.layout(t.axis.grid.model,t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:gE.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var a=i.axis,r=a.grid,o=a.getGlobalExtent(!0),s=vE(r,a).getOtherAxis(a).getGlobalExtent(),l="x"===a.dim?0:1,u=e.position;u[l]+=t[l],u[l]=Math.min(o[1],u[l]),u[l]=Math.max(o[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{position:u,rotation:e.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function vE(e,t){var i={};return i[t.dim+"AxisIndex"]=t.index,e.getCartesian(i)}var yE={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:gE.makeLineShape([t,i[0]],[t,i[1]],xE(e))}},shadow:function(e,t,i){var n=Math.max(1,e.getBandWidth()),a=i[1]-i[0];return{type:"Rect",shape:gE.makeRectShape([t-n/2,i[0]],[n,a],xE(e))}}};function xE(e){return"x"===e.dim?0:1}IS.registerAxisPointerClass("CartesianAxisPointer",mE),X_.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!Ve.isArray(t)&&(e.axisPointer.link=[t])}})),X_.registerProcessor(X_.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=_S.collect(e,t)})),X_.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},YR);var _E=["x","y"],bE=["width","height"],wE=hE.extend({makeElOption:function(e,t,i,n,a){var r=i.axis,o=r.coordinateSystem,s=IE(o,1-ME(r)),l=o.dataToPoint(t)[0],u=n.get("type");if(u&&"none"!==u){var h=gE.buildElStyle(n),c=SE[u](r,l,s);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=LR.layout(i);gE.buildCartesianSingleLabelElOption(t,e,d,i,n,a)},getHandleTransform:function(e,t,i){var n=LR.layout(t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:gE.getTransformedPosition(t.axis,e,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(e,t,i,n){var a=i.axis,r=a.coordinateSystem,o=ME(a),s=IE(r,o),l=e.position;l[o]+=t[o],l[o]=Math.min(s[1],l[o]),l[o]=Math.max(s[0],l[o]);var u=IE(r,1-o),h=(u[1]+u[0])/2,c=[h,h];return c[o]=l[o],{position:l,rotation:e.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),SE={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:gE.makeLineShape([t,i[0]],[t,i[1]],ME(e))}},shadow:function(e,t,i){var n=e.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:gE.makeRectShape([t-n/2,i[0]],[n,a],ME(e))}}};function ME(e){return e.isHorizontal()?0:1}function IE(e,t){var i=e.getRect();return[i[_E[t]],i[_E[t]]+i[bE[t]]]}IS.registerAxisPointerClass("SingleAxisPointer",wE),X_.extendComponentView({type:"single"});var TE=ov.getDimensionTypeByAxis,AE=Ro.groupData,CE=Uc.encodeHTML,DE=og.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(e){DE.superApply(this,"init",arguments),this.legendVisualProvider=new fM(Ve.bind(this.getData,this),Ve.bind(this.getRawData,this))},fixData:function(e){var t=e.length,i=AE(e,(function(e){return e[2]})),n=[];i.buckets.each((function(e,t){n.push({name:t,dataList:e})}));for(var a=n.length,r=-1,o=-1,s=0;s<a;++s){var l=n[s].dataList.length;l>r&&(r=l,o=s)}for(var u=0;u<a;++u)if(u!==o)for(var h=n[u].name,c=0;c<r;++c){for(var d=n[o].dataList[c][0],p=n[u].dataList.length,f=-1,g=0;g<p;++g){if(n[u].dataList[g][0]===d){f=g;break}}-1===f&&(e[t]=[],e[t][0]=d,e[t][1]=0,e[t][2]=h,t++)}return e},getInitialData:function(e,t){for(var i=t.queryComponents({mainType:"singleAxis",index:this.get("singleAxisIndex"),id:this.get("singleAxisId")})[0].get("type"),n=Ve.filter(e.data,(function(e){return void 0!==e[2]})),a=this.fixData(n||[]),r=[],o=this.nameMap=Ve.createHashMap(),s=0,l=0;l<a.length;++l)r.push(a[l][2]),o.get(a[l][2])||(o.set(a[l][2],s),s++);var u=qv(a,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:TE(i)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}),h=new Rv(u,this);return h.initData(a),h},getLayerSeries:function(){for(var e=this.getData(),t=e.count(),i=[],n=0;n<t;++n)i[n]=n;var a=e.mapDimension("single"),r=AE(i,(function(t){return e.get("name",t)})),o=[];return r.buckets.each((function(t,i){t.sort((function(t,i){return e.get(a,t)-e.get(a,i)})),o.push({name:i,indices:t})})),o},getAxisTooltipData:function(e,t,i){Ve.isArray(e)||(e=e?[e]:[]);for(var n,a=this.getData(),r=this.getLayerSeries(),o=[],s=r.length,l=0;l<s;++l){for(var u=Number.MAX_VALUE,h=-1,c=r[l].indices.length,d=0;d<c;++d){var p=a.get(e[0],r[l].indices[d]),f=Math.abs(p-t);f<=u&&(n=p,u=f,h=r[l].indices[d])}o.push(h)}return{dataIndices:o,nestestValue:n}},formatTooltip:function(e){var t=this.getData(),i=t.getName(e),n=t.get(t.mapDimension("value"),e);return(isNaN(n)||null==n)&&(n="-"),CE(i+" : "+n)},defaultOption:{zlevel:0,z:2,coordinateSystem:"singleAxis",boundaryGap:["10%","10%"],singleAxisIndex:0,animationEasing:"linear",label:{margin:4,show:!0,position:"left",color:"#000",fontSize:11},emphasis:{label:{show:!0}}}}),LE=Vb.Polygon,PE=Ve.bind,kE=Ve.extend;function OE(e,t,i){if(e.count())for(var n,a=t.coordinateSystem,r=t.getLayerSeries(),o=e.mapDimension("single"),s=e.mapDimension("value"),l=Ve.map(r,(function(t){return Ve.map(t.indices,(function(t){var i=a.dataToPoint(e.get(o,t));return i[1]=e.get(s,t),i}))})),u=function(e){for(var t=e.length,i=e[0].length,n=[],a=[],r=0,o={},s=0;s<i;++s){for(var l=0,u=0;l<t;++l)u+=e[l][s][1];u>r&&(r=u),n.push(u)}for(var h=0;h<i;++h)a[h]=(r-n[h])/2;r=0;for(var c=0;c<i;++c){var d=n[c]+a[c];d>r&&(r=d)}return o.y0=a,o.max=r,o}(l),h=u.y0,c=i/u.max,d=r.length,p=r[0].indices.length,f=0;f<p;++f){n=h[f]*c,e.setItemLayout(r[0].indices[f],{layerIndex:0,x:l[0][f][0],y0:n,y:l[0][f][1]*c});for(var g=1;g<d;++g)n+=l[g-1][f][1]*c,e.setItemLayout(r[g].indices[f],{layerIndex:g,x:l[g][f][0],y0:n,y:l[g][f][1]*c})}}X_.extendChartView({type:"themeRiver",init:function(){this._layers=[]},render:function(e,t,i){var n=e.getData(),a=this.group,r=e.getLayerSeries(),o=n.getLayout("layoutInfo"),s=o.rect,l=o.boundaryGap;function u(e){return e.name}a.attr("position",[0,s.y+l[0]]);var h=new tv(this._layersSeries||[],r,u,u),c={};function d(t,i,o){var s=this._layers;if("remove"!==t){for(var l,u,h,d=[],p=[],f=r[i].indices,g=0;g<f.length;g++){var m=n.getItemLayout(f[g]),v=m.x,y=m.y0,x=m.y;d.push([v,y]),p.push([v,y+x]),l=n.getItemVisual(f[g],"color")}var _=n.getItemLayout(f[0]),b=n.getItemModel(f[g-1]),w=b.getModel("label"),S=w.get("margin");if("add"===t){var M=c[i]=new tc.Group;u=new LE({shape:{points:d,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),h=new tc.Text({style:{x:_.x-S,y:_.y0+_.y/2}}),M.add(u),M.add(h),a.add(M),u.setClipPath(function(e,t,i){var n=new tc.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return tc.initProps(n,{shape:{width:e.width+20,height:e.height+20}},t,i),n}(u.getBoundingRect(),e,(function(){u.removeClipPath()})))}else{M=s[o];u=M.childAt(0),h=M.childAt(1),a.add(M),c[i]=M,tc.updateProps(u,{shape:{points:d,stackedOnPoints:p}},e),tc.updateProps(h,{style:{x:_.x-S,y:_.y0+_.y/2}},e)}var I=b.getModel("emphasis.itemStyle"),T=b.getModel("itemStyle");tc.setTextStyle(h.style,w,{text:w.get("show")?e.getFormattedLabel(f[g-1],"normal")||n.getName(f[g-1]):null,textVerticalAlign:"middle"}),u.setStyle(kE({fill:l},T.getItemStyle(["color"]))),tc.setHoverStyle(u,I.getItemStyle())}else a.remove(s[i])}h.add(PE(d,this,"add")).update(PE(d,this,"update")).remove(PE(d,this,"remove")).execute(),this._layersSeries=r,this._layers=c},dispose:function(){}});var RE=function(e,t){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),i=e.coordinateSystem,n={},a=i.getRect();n.rect=a;var r=e.get("boundaryGap"),o=i.getAxis();(n.boundaryGap=r,"horizontal"===o.orient)?(r[0]=Pc.parsePercent(r[0],a.height),r[1]=Pc.parsePercent(r[1],a.height),OE(t,e,a.height-r[0]-r[1])):(r[0]=Pc.parsePercent(r[0],a.width),r[1]=Pc.parsePercent(r[1],a.width),OE(t,e,a.width-r[0]-r[1]));t.setLayout("layoutInfo",n)}))},EE=Ve.createHashMap;var NE=function(e){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),i=e.getRawData(),n=e.get("color"),a=EE();t.each((function(e){a.set(t.getRawIndex(e),e)})),i.each((function(r){var o=i.getName(r),s=n[(e.nameMap.get(o)-1)%n.length];i.setItemVisual(r,"color",s);var l=a.get(r);null!=l&&t.setItemVisual(l,"color",s)}))}))};X_.registerLayout(RE),X_.registerVisual(NE),X_.registerProcessor(NM("themeRiver"));var zE=bA.wrapTreePathInfo;function BE(e){var t=0;Ve.each(e.children,(function(e){BE(e);var i=e.value;Ve.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;Ve.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),Ve.isArray(e.value)?e.value[0]=i:e.value=i}og.extend({type:"series.sunburst",_viewRoot:null,getInitialData:function(e,t){var i={name:e.name,children:e.data};BE(i);var n=e.levels||[],a={};return a.levels=n,GT.createTree(i,this,a).data},optionUpdated:function(){this.resetViewRoot()},getDataParams:function(e){var t=og.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=zE(i,this),t},defaultOption:{zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,percentPrecision:2,stillShowZeroSum:!0,highlightPolicy:"descendant",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},highlight:{itemStyle:{opacity:1}},downplay:{itemStyle:{opacity:.5},label:{opacity:.6}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicOut",data:[],levels:[],sort:"desc"},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;e&&(e===t||t.contains(e))||(this._viewRoot=t)}});var VE="none",FE="ancestor",GE="self";function HE(e,t,i){tc.Group.call(this);var n=new tc.Sector({z2:2});n.seriesIndex=t.seriesIndex;var a=new tc.Text({z2:4,silent:e.getModel("label").get("silent")});function r(){a.ignore=a.hoverIgnore}function o(){a.ignore=a.normalIgnore}this.add(n),this.add(a),this.updateData(!0,e,"normal",t,i),this.on("emphasis",r).on("normal",o).on("mouseover",r).on("mouseout",o)}var WE=HE.prototype;WE.updateData=function(e,t,i,n,a){this.node=t,t.piece=this,n=n||this._seriesModel,a=a||this._ecModel;var r=this.childAt(0);r.dataIndex=t.dataIndex;var o=t.getModel(),s=t.getLayout(),l=Ve.extend({},s);l.label=null;var u=function(e,t,i){var n=e.getVisual("color"),a=e.getVisual("visualMeta");a&&0!==a.length||(n=null);var r=e.getModel("itemStyle").get("color");if(r)return r;if(n)return n;if(0===e.depth)return i.option.color[0];var o=i.option.color.length;r=i.option.color[function(e){var t=e;for(;t.depth>1;)t=t.parentNode;var i=e.getAncestors()[0];return Ve.indexOf(i.children,t)}(e)%o];return r}(t,0,a);!function(e,t,i){var n=t.getData();n.setItemVisual(e.dataIndex,"color",i)}(t,n,u);var h,c=o.getModel("itemStyle").getItemStyle();if("normal"===i)h=c;else{var d=o.getModel(i+".itemStyle").getItemStyle();h=Ve.merge(d,c)}h=Ve.defaults({lineJoin:"bevel",fill:h.fill||u},h),e?(r.setShape(l),r.shape.r=s.r0,tc.updateProps(r,{shape:{r:s.r}},n,t.dataIndex),r.useStyle(h)):"object"==typeof h.fill&&h.fill.type||"object"==typeof r.style.fill&&r.style.fill.type?(tc.updateProps(r,{shape:l},n),r.useStyle(h)):tc.updateProps(r,{shape:l,style:h},n),this._updateLabel(n,u,i);var p=o.getShallow("cursor");if(p&&r.attr("cursor",p),e){var f=n.getShallow("highlightPolicy");this._initEvents(r,t,n,f)}this._seriesModel=n||this._seriesModel,this._ecModel=a||this._ecModel,tc.setHoverStyle(this)},WE.onEmphasis=function(e){var t=this;this.node.hostTree.root.eachNode((function(i){var n,a,r;i.piece&&(t.node===i?i.piece.updateData(!1,i,"emphasis"):(n=i,a=t.node,(r=e)!==VE&&(r===GE?n===a:r===FE?n===a||n.isAncestorOf(a):n===a||n.isDescendantOf(a))?i.piece.childAt(0).trigger("highlight"):e!==VE&&i.piece.childAt(0).trigger("downplay")))}))},WE.onNormal=function(){this.node.hostTree.root.eachNode((function(e){e.piece&&e.piece.updateData(!1,e,"normal")}))},WE.onHighlight=function(){this.updateData(!1,this.node,"highlight")},WE.onDownplay=function(){this.updateData(!1,this.node,"downplay")},WE._updateLabel=function(e,t,i){var n=this.node.getModel(),a=n.getModel("label"),r="normal"===i||"emphasis"===i?a:n.getModel(i+".label"),o=n.getModel("emphasis.label"),s=Ve.retrieve(e.getFormattedLabel(this.node.dataIndex,i,null,null,"label"),this.node.name);!1===S("show")&&(s="");var l=this.node.getLayout(),u=r.get("minAngle");null==u&&(u=a.get("minAngle")),u=u/180*Math.PI;var h=l.endAngle-l.startAngle;null!=u&&Math.abs(h)<u&&(s="");var c=this.childAt(1);tc.setLabelStyle(c.style,c.hoverStyle||{},a,o,{defaultText:r.getShallow("show")?s:null,autoColor:t,useInsideStyle:!0});var d,p=(l.startAngle+l.endAngle)/2,f=Math.cos(p),g=Math.sin(p),m=S("position"),v=S("distance")||0,y=S("align");"outside"===m?(d=l.r+v,y=p>Math.PI/2?"right":"left"):y&&"center"!==y?"left"===y?(d=l.r0+v,p>Math.PI/2&&(y="right")):"right"===y&&(d=l.r-v,p>Math.PI/2&&(y="left")):(d=(l.r+l.r0)/2,y="center"),c.attr("style",{text:s,textAlign:y,textVerticalAlign:S("verticalAlign")||"middle",opacity:S("opacity")});var x=d*f+l.cx,_=d*g+l.cy;c.attr("position",[x,_]);var b=S("rotate"),w=0;function S(e){var t=r.get(e);return null==t?a.get(e):t}"radial"===b?(w=-p)<-Math.PI/2&&(w+=Math.PI):"tangential"===b?(w=Math.PI/2-p)>Math.PI/2?w-=Math.PI:w<-Math.PI/2&&(w+=Math.PI):"number"==typeof b&&(w=b*Math.PI/180),c.attr("rotation",w)},WE._initEvents=function(e,t,i,n){e.off("mouseover").off("mouseout").off("emphasis").off("normal");var a=this,r=function(){a.onEmphasis(n)},o=function(){a.onNormal()};i.isAnimationEnabled()&&e.on("mouseover",r).on("mouseout",o).on("emphasis",r).on("normal",o).on("downplay",(function(){a.onDownplay()})).on("highlight",(function(){a.onHighlight()}))},Ve.inherits(HE,tc.Group);var UE=HE,jE=Uc.windowOpen;Sg.extend({type:"sunburst",init:function(){},render:function(e,t,i,n){var a=this;this.seriesModel=e,this.api=i,this.ecModel=t;var r=e.getData(),o=r.tree.root,s=e.getViewRoot(),l=this.group,u=e.get("renderLabelForZeroData"),h=[];s.eachNode((function(e){h.push(e)}));var c=this._oldChildren||[];if(function(i,n){if(0===i.length&&0===n.length)return;function a(e){return e.getId()}function s(a,s){!function(i,n){u||!i||i.getValue()||(i=null);if(i!==o&&n!==o)if(n&&n.piece)i?(n.piece.updateData(!1,i,"normal",e,t),r.setItemGraphicEl(i.dataIndex,n.piece)):function(e){if(!e)return;e.piece&&(l.remove(e.piece),e.piece=null)}(n);else if(i){var a=new UE(i,e,t);l.add(a),r.setItemGraphicEl(i.dataIndex,a)}}(null==a?null:i[a],null==s?null:n[s])}new tv(n,i,a,a).add(s).update(s).remove(Ve.curry(s,null)).execute()}(h,c),function(i,n){if(n.depth>0){a.virtualPiece?a.virtualPiece.updateData(!1,i,"normal",e,t):(a.virtualPiece=new UE(i,e,t),l.add(a.virtualPiece)),n.piece._onclickEvent&&n.piece.off("click",n.piece._onclickEvent);var r=function(e){a._rootToNode(n.parentNode)};n.piece._onclickEvent=r,a.virtualPiece.on("click",r)}else a.virtualPiece&&(l.remove(a.virtualPiece),a.virtualPiece=null)}(o,s),n&&n.highlight&&n.highlight.piece){var d=e.getShallow("highlightPolicy");n.highlight.piece.onEmphasis(d)}else if(n&&n.unhighlight){var p=this.virtualPiece;!p&&o.children.length&&(p=o.children[0].piece),p&&p.onNormal()}this._initEvents(),this._oldChildren=h},dispose:function(){},_initEvents:function(){var e=this,t=function(t){var i=!1;e.seriesModel.getViewRoot().eachNode((function(n){if(!i&&n.piece&&n.piece.childAt(0)===t.target){var a=n.getModel().get("nodeClick");if("rootToNode"===a)e._rootToNode(n);else if("link"===a){var r=n.getModel(),o=r.get("link");if(o){var s=r.get("target",!0)||"_blank";jE(o,s)}}i=!0}}))};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",t),this.group._onclickEvent=t},_rootToNode:function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:"sunburstRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},containPoint:function(e,t){var i=t.getData().getItemLayout(0);if(i){var n=e[0]-i.cx,a=e[1]-i.cy,r=Math.sqrt(n*n+a*a);return r<=i.r&&r>=i.r0}}});var ZE="sunburstRootToNode";X_.registerAction({type:ZE,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=bA.retrieveTargetInfo(e,[ZE],t);if(n){var a=t.getViewRoot();a&&(e.direction=bA.aboveViewRoot(a,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var YE="sunburstHighlight";X_.registerAction({type:YE,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=bA.retrieveTargetInfo(e,[YE],t);n&&(e.highlight=n.node)}))}));X_.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){e.unhighlight=!0}))}));var XE=Pc.parsePercent,qE=Math.PI/180;function $E(e,t){var i=e.children||[];e.children=function(e,t){if("function"==typeof t)return e.sort(t);var i="asc"===t;return e.sort((function(e,t){var n=(e.getValue()-t.getValue())*(i?1:-1);return 0===n?(e.dataIndex-t.dataIndex)*(i?-1:1):n}))}(i,t),i.length&&Ve.each(e.children,(function(e){$E(e,t)}))}var KE=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),n=e.get("radius");Ve.isArray(n)||(n=[0,n]),Ve.isArray(t)||(t=[t,t]);var a=i.getWidth(),r=i.getHeight(),o=Math.min(a,r),s=XE(t[0],a),l=XE(t[1],r),u=XE(n[0],o/2),h=XE(n[1],o/2),c=-e.get("startAngle")*qE,d=e.get("minAngle")*qE,p=e.getData().tree.root,f=e.getViewRoot(),g=f.depth,m=e.get("sort");null!=m&&$E(f,m);var v=0;Ve.each(f.children,(function(e){!isNaN(e.getValue())&&v++}));var y=f.getValue(),x=Math.PI/(y||v)*2,_=f.depth>0,b=f.height-(_?-1:1),w=(h-u)/(b||1),S=e.get("clockwise"),M=e.get("stillShowZeroSum"),I=S?1:-1,T=function(e,t){if(e){var i=t;if(e!==p){var n=e.getValue(),a=0===y&&M?x:n*x;a<d&&(a=d),i=t+I*a;var r=e.depth-g-(_?-1:1),h=u+w*r,c=u+w*(r+1),f=e.getModel();null!=f.get("r0")&&(h=XE(f.get("r0"),o/2)),null!=f.get("r")&&(c=XE(f.get("r"),o/2)),e.setLayout({angle:a,startAngle:t,endAngle:i,clockwise:S,cx:s,cy:l,r0:h,r:c})}if(e.children&&e.children.length){var m=0;Ve.each(e.children,(function(e){m+=T(e,t+m)}))}return i-t}};if(_){var A=u,C=u+w,D=2*Math.PI;p.setLayout({angle:D,startAngle:c,endAngle:c+D,clockwise:S,cx:s,cy:l,r0:A,r:C})}T(f,c)}))};function JE(e,t){return t=t||[0,0],Ve.map(["x","y"],(function(i,n){var a=this.getAxis(i),r=t[n],o=e[n]/2;return"category"===a.type?a.getBandWidth():Math.abs(a.dataToCoord(r-o)-a.dataToCoord(r+o))}),this)}X_.registerVisual(Ve.curry(IM,"sunburst")),X_.registerLayout(Ve.curry(KE,"sunburst")),X_.registerProcessor(Ve.curry(NM,"sunburst"));var QE=function(e){var t=e.grid.getRect();return{coordSys:{type:"cartesian2d",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:Ve.bind(JE,e)}}};function eN(e,t){return t=t||[0,0],Ve.map([0,1],(function(i){var n=t[i],a=e[i]/2,r=[],o=[];return r[i]=n-a,o[i]=n+a,r[1-i]=o[1-i]=t[1-i],Math.abs(this.dataToPoint(r)[i]-this.dataToPoint(o)[i])}),this)}var tN=function(e){var t=e.getBoundingRect();return{coordSys:{type:"geo",x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:Ve.bind(eN,e)}}};function iN(e,t){var i=this.getAxis(),n=t instanceof Array?t[0]:t,a=(e instanceof Array?e[0]:e)/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-a)-i.dataToCoord(n+a))}var nN=function(e){var t=e.getRect();return{coordSys:{type:"singleAxis",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:Ve.bind(iN,e)}}};function aN(e,t){return Ve.map(["Radius","Angle"],(function(i,n){var a=this["get"+i+"Axis"](),r=t[n],o=e[n]/2,s="dataTo"+i,l="category"===a.type?a.getBandWidth():Math.abs(a[s](r-o)-a[s](r+o));return"Angle"===i&&(l=l*Math.PI/180),l}),this)}var rN=function(e){var t=e.getRadiusAxis(),i=e.getAngleAxis(),n=t.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:e.cx,cy:e.cy,r:n[1],r0:n[0]},api:{coord:Ve.bind((function(n){var a=t.dataToRadius(n[0]),r=i.dataToAngle(n[1]),o=e.coordToPoint([a,r]);return o.push(a,r*Math.PI/180),o})),size:Ve.bind(aN,e)}}};var oN=function(e){var t=e.getRect(),i=e.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:i.start,end:i.end,weeks:i.weeks,dayCount:i.allDay}},api:{coord:function(t,i){return e.dataToPoint(t,i)}}}},sN=K_.getDefaultLabel,lN=Ky.getLayoutOnAxis,uN=Wb.createClipPath,hN=tc.CACHED_LABEL_STYLE_PROPERTIES,cN=["itemStyle"],dN=["emphasis","itemStyle"],pN=["label"],fN=["emphasis","label"],gN="e\0\0",mN={cartesian2d:QE,geo:tN,singleAxis:nN,polar:rN,calendar:oN};function vN(e,t,i,n,a){null==i[e]||a||(t[e]=i[e],i[e]=n[e])}function yN(e,t,i,n){var a=e.get("renderItem"),r=e.coordinateSystem,o={};r&&(o=r.prepareCustoms?r.prepareCustoms():mN[r.type](r));var s,l,u,h,c,d=Ve.defaults({getWidth:n.getWidth,getHeight:n.getHeight,getZr:n.getZr,getDevicePixelRatio:n.getDevicePixelRatio,value:function(e,i){return null==i&&(i=s),t.get(t.getDimension(e||0),i)},style:function(i,n){null==n&&(n=s),g(n);var a=l.getModel(cN).getItemStyle();null!=c&&(a.fill=c);var r=t.getItemVisual(n,"opacity");null!=r&&(a.opacity=r);var o=i?MN(i,u):u;return tc.setTextStyle(a,o,null,{autoColor:c,isRectText:!0}),a.text=o.getShallow("show")?Ve.retrieve2(e.getFormattedLabel(n,"normal"),sN(t,n)):null,i&&IN(a,i),a},styleEmphasis:function(i,n){null==n&&(n=s),g(n);var a=l.getModel(dN).getItemStyle(),r=i?MN(i,h):h;return tc.setTextStyle(a,r,null,{isRectText:!0},!0),a.text=r.getShallow("show")?Ve.retrieve3(e.getFormattedLabel(n,"emphasis"),e.getFormattedLabel(n,"normal"),sN(t,n)):null,i&&IN(a,i),a},visual:function(e,i){return null==i&&(i=s),t.getItemVisual(i,e)},barLayout:function(e){if(r.getBaseAxis){var t=r.getBaseAxis();return lN(Ve.defaults({axis:t},e),n)}},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(e){return tc.getFont(e,i)}},o.api||{}),p={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:o.coordSys,dataInsideLength:t.count(),encode:xN(e.getData())},f=!0;return function(e,i){return s=e,f=!0,a&&a(Ve.defaults({dataIndexInside:e,dataIndex:t.getRawIndex(e),actionType:i?i.type:null},p),d)};function g(e){null==e&&(e=s),f&&(l=t.getItemModel(e),u=l.getModel(pN),h=l.getModel(fN),c=t.getItemVisual(e,"color"),f=!1)}}function xN(e){var t={};return Ve.each(e.dimensions,(function(i,n){var a=e.getDimensionInfo(i);if(!a.isExtraCoord){var r=a.coordDim;(t[r]=t[r]||[])[a.coordDimIndex]=n}})),t}function _N(e,t,i,n,a,r){return(e=bN(e,t,i,n,a,r,!0))&&r.setItemGraphicEl(t,e),e}function bN(e,t,i,n,a,r,o){var s,l=!i,u=(i=i||{}).type,h=i.shape,c=i.style;if(e&&(l||null!=u&&u!==e.__customGraphicType||"path"===u&&((s=h)&&(s.hasOwnProperty("pathData")||s.hasOwnProperty("d")))&&AN(h)!==e.__customPathData||"image"===u&&CN(c,"image")&&c.image!==e.__customImagePath||"text"===u&&CN(h,"text")&&c.text!==e.__customText)&&(a.remove(e),e=null),!l){var d=!e;return!e&&(e=function(e){var t,i=e.type;if("path"===i){var n=e.shape,a=null!=n.width&&null!=n.height?{x:n.x||0,y:n.y||0,width:n.width,height:n.height}:null,r=AN(n);(t=tc.makePath(r,null,a,n.layout||"center")).__customPathData=r}else if("image"===i)(t=new tc.Image({})).__customImagePath=e.style.image;else if("text"===i)(t=new tc.Text({})).__customText=e.style.text;else if("group"===i)t=new tc.Group;else{if("compoundPath"===i)throw new Error('"compoundPath" is not supported yet.');t=new(tc.getShapeClass(i))}return t.__customGraphicType=i,t.name=e.name,t}(i)),function(e,t,i,n,a,r,o){var s={},l=i.style||{};if(i.shape&&(s.shape=Ve.clone(i.shape)),i.position&&(s.position=i.position.slice()),i.scale&&(s.scale=i.scale.slice()),i.origin&&(s.origin=i.origin.slice()),i.rotation&&(s.rotation=i.rotation),"image"===e.type&&i.style){var u=s.style={};Ve.each(["x","y","width","height"],(function(t){vN(t,u,l,e.style,r)}))}"text"===e.type&&i.style&&(u=s.style={},Ve.each(["x","y"],(function(t){vN(t,u,l,e.style,r)})),!l.hasOwnProperty("textFill")&&l.fill&&(l.textFill=l.fill),!l.hasOwnProperty("textStroke")&&l.stroke&&(l.textStroke=l.stroke));if("group"!==e.type&&(e.useStyle(l),r)){e.style.opacity=0;var h=l.opacity;null==h&&(h=1),tc.initProps(e,{style:{opacity:h}},n,t)}r?e.attr(s):tc.updateProps(e,s,n,t),i.hasOwnProperty("z2")&&e.attr("z2",i.z2||0),i.hasOwnProperty("silent")&&e.attr("silent",i.silent),i.hasOwnProperty("invisible")&&e.attr("invisible",i.invisible),i.hasOwnProperty("ignore")&&e.attr("ignore",i.ignore),i.hasOwnProperty("info")&&e.attr("info",i.info);var c=i.styleEmphasis;tc.setElementHoverStyle(e,c),o&&tc.setAsHighDownDispatcher(e,!1!==c)}(e,t,i,n,0,d,o),"group"===u&&function(e,t,i,n,a){var r=i.children,o=r?r.length:0,s=i.$mergeChildren,l="byName"===s||i.diffChildrenByName,u=!1===s;if(!o&&!l&&!u)return;if(l)return h={oldChildren:e.children()||[],newChildren:r||[],dataIndex:t,animatableModel:n,group:e,data:a},void new tv(h.oldChildren,h.newChildren,wN,wN,h).add(SN).update(SN).remove(TN).execute();var h;u&&e.removeAll();for(var c=0;c<o;c++)r[c]&&bN(e.childAt(c),t,r[c],n,e,a)}(e,t,i,n,r),a.add(e),e}}function wN(e,t){var i=e&&e.name;return null!=i?i:gN+t}function SN(e,t){var i=this.context,n=null!=e?i.newChildren[e]:null;bN(null!=t?i.oldChildren[t]:null,i.dataIndex,n,i.animatableModel,i.group,i.data)}function MN(e,t){var i=new mc({},t);return Ve.each(hN,(function(t,n){e.hasOwnProperty(t)&&(i.option[n]=e[t])})),i}function IN(e,t){for(var i in t)!t.hasOwnProperty(i)&&hN.hasOwnProperty(i)||(e[i]=t[i])}function TN(e){var t=this.context,i=t.oldChildren[e];i&&t.group.remove(i)}function AN(e){return e&&(e.pathData||e.d)}function CN(e,t){return e&&e.hasOwnProperty(t)}og.extend({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,useTransform:!0,clip:!1},getInitialData:function(e,t){return py(this.getSource(),this)},getDataParams:function(e,t,i){var n=og.prototype.getDataParams.apply(this,arguments);return i&&(n.info=i.info),n}}),Sg.extend({type:"custom",_data:null,render:function(e,t,i,n){var a=this._data,r=e.getData(),o=this.group,s=yN(e,r,t,i);r.diff(a).add((function(t){_N(null,t,s(t,n),e,o,r)})).update((function(t,i){_N(a.getItemGraphicEl(i),t,s(t,n),e,o,r)})).remove((function(e){var t=a.getItemGraphicEl(e);t&&o.remove(t)})).execute();var l=e.get("clip",!0)?uN(e.coordinateSystem,!1,e):null;l?o.setClipPath(l):o.removeClipPath(),this._data=r},incrementalPrepareRender:function(e,t,i){this.group.removeAll(),this._data=null},incrementalRender:function(e,t,i,n,a){var r=t.getData(),o=yN(t,r,i,n);function s(e){e.isGroup||(e.incremental=!0,e.useHoverLayer=!0)}for(var l=e.start;l<e.end;l++){_N(null,l,o(l,a),t,this.group,r).traverse(s)}},dispose:Ve.noop,filterForExposedEvent:function(e,t,i,n){var a=t.element;if(null==a||i.name===a)return!0;for(;(i=i.parent)&&i!==this.group;)if(i.name===a)return!0;return!1}});var DN=Pc.parsePercent,LN=ry.isDimensionStacked;function PN(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function kN(e,t){return t.dim+e.model.componentIndex}var ON=function(e,t,i){var n={},a=function(e,t){var i={};Ve.each(e,(function(e,t){var n=e.getData(),a=e.coordinateSystem,r=a.getBaseAxis(),o=kN(a,r),s=r.getExtent(),l="category"===r.type?r.getBandWidth():Math.abs(s[1]-s[0])/n.count(),u=i[o]||{bandWidth:l,remainedWidth:l,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=u.stacks;i[o]=u;var c=PN(e);h[c]||u.autoWidthCount++,h[c]=h[c]||{width:0,maxWidth:0};var d=DN(e.get("barWidth"),l),p=DN(e.get("barMaxWidth"),l),f=e.get("barGap"),g=e.get("barCategoryGap");d&&!h[c].width&&(d=Math.min(u.remainedWidth,d),h[c].width=d,u.remainedWidth-=d),p&&(h[c].maxWidth=p),null!=f&&(u.gap=f),null!=g&&(u.categoryGap=g)}));var n={};return Ve.each(i,(function(e,t){n[t]={};var i=e.stacks,a=e.bandWidth,r=DN(e.categoryGap,a),o=DN(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-r)/(l+(l-1)*o);u=Math.max(u,0),Ve.each(i,(function(e,t){var i=e.maxWidth;i&&i<u&&(i=Math.min(i,s),e.width&&(i=Math.min(i,e.width)),s-=i,e.width=i,l--)})),u=(s-r)/(l+(l-1)*o),u=Math.max(u,0);var h,c=0;Ve.each(i,(function(e,t){e.width||(e.width=u),h=e,c+=e.width*(1+o)})),h&&(c-=h.width*o);var d=-c/2;Ve.each(i,(function(e,i){n[t][i]=n[t][i]||{offset:d,width:e.width},d+=e.width*(1+o)}))})),n}(Ve.filter(t.getSeriesByType(e),(function(e){return!t.isSeriesFiltered(e)&&e.coordinateSystem&&"polar"===e.coordinateSystem.type})));t.eachSeriesByType(e,(function(e){if("polar"===e.coordinateSystem.type){var t=e.getData(),i=e.coordinateSystem,r=i.getBaseAxis(),o=kN(i,r),s=PN(e),l=a[o][s],u=l.offset,h=l.width,c=i.getOtherAxis(r),d=e.coordinateSystem.cx,p=e.coordinateSystem.cy,f=e.get("barMinHeight")||0,g=e.get("barMinAngle")||0;n[s]=n[s]||[];for(var m=t.mapDimension(c.dim),v=t.mapDimension(r.dim),y=LN(t,m),x="radius"!==r.dim||!e.get("roundCap",!0),_=c.getExtent()[0],b=0,w=t.count();b<w;b++){var S,M,I,T,A=t.get(m,b),C=t.get(v,b),D=A>=0?"p":"n",L=_;if(y&&(n[s][C]||(n[s][C]={p:_,n:_}),L=n[s][C][D]),"radius"===c.dim){var P=c.dataToRadius(A)-_,k=r.dataToAngle(C);Math.abs(P)<f&&(P=(P<0?-1:1)*f),S=L,M=L+P,T=(I=k-u)-h,y&&(n[s][C][D]=M)}else{var O=c.dataToAngle(A,x)-_,R=r.dataToRadius(C);Math.abs(O)<g&&(O=(O<0?-1:1)*g),M=(S=R+u)+h,I=L,T=L+O,y&&(n[s][C][D]=T)}t.setItemLayout(b,{cx:d,cy:p,r0:S,r:M,startAngle:-I*Math.PI/180,endAngle:-T*Math.PI/180})}}}),this)},RN=ON;function EN(e,t){L_.call(this,"radius",e,t),this.type="category"}EN.prototype={constructor:EN,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToRadius:L_.prototype.dataToCoord,radiusToData:L_.prototype.coordToData},Ve.inherits(EN,L_);var NN=EN,zN=(0,Ro.makeInner)();function BN(e,t){t=t||[0,360],L_.call(this,"angle",e,t),this.type="category"}BN.prototype={constructor:BN,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToAngle:L_.prototype.dataToCoord,angleToData:L_.prototype.coordToData,calculateCategoryInterval:function(){var e=this,t=e.getLabelModel(),i=e.scale,n=i.getExtent(),a=i.count();if(n[1]-n[0]<1)return 0;var r=n[0],o=e.dataToCoord(r+1)-e.dataToCoord(r),s=Math.abs(o),l=Wa.getBoundingRect(r,t.getFont(),"center","top"),u=Math.max(l.height,7)/s;isNaN(u)&&(u=1/0);var h=Math.max(0,Math.floor(u)),c=zN(e.model),d=c.lastAutoInterval,p=c.lastTickCount;return null!=d&&null!=p&&Math.abs(d-h)<=1&&Math.abs(p-a)<=1&&d>h?h=d:(c.lastTickCount=a,c.lastAutoInterval=h),h}},Ve.inherits(BN,L_);var VN=BN,FN=function(e){this.name=e||"",this.cx=0,this.cy=0,this._radiusAxis=new NN,this._angleAxis=new VN,this._radiusAxis.polar=this._angleAxis.polar=this};FN.prototype={type:"polar",axisPointerEnabled:!0,constructor:FN,dimensions:["radius","angle"],model:null,containPoint:function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},containData:function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},getAxis:function(e){return this["_"+e+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(e){var t=[],i=this._angleAxis,n=this._radiusAxis;return i.scale.type===e&&t.push(i),n.scale.type===e&&t.push(n),t},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(e){var t=null!=e&&"auto"!==e?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},dataToPoint:function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},pointToData:function(e,t){var i=this.pointToCoord(e);return[this._radiusAxis.radiusToData(i[0],t),this._angleAxis.angleToData(i[1],t)]},pointToCoord:function(e){var t=e[0]-this.cx,i=e[1]-this.cy,n=this.getAngleAxis(),a=n.getExtent(),r=Math.min(a[0],a[1]),o=Math.max(a[0],a[1]);n.inverse?r=o-360:o=r+360;var s=Math.sqrt(t*t+i*i);t/=s,i/=s;for(var l=Math.atan2(-i,t)/Math.PI*180,u=l<r?1:-1;l<r||l>o;)l+=360*u;return[s,l]},coordToPoint:function(e){var t=e[0],i=e[1]/180*Math.PI;return[Math.cos(i)*t+this.cx,-Math.sin(i)*t+this.cy]},getArea:function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var i=e.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:e.inverse,contain:function(e,t){var i=e-this.cx,n=t-this.cy,a=i*i+n*n,r=this.r,o=this.r0;return a<=r*r&&a>=o*o}}}};var GN=FN,HN=ud.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});Ve.merge(HN.prototype,Ox);var WN={splitNumber:5};function UN(e,t){return t.type||(t.data?"category":"value")}Mw("angle",HN,UN,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),Mw("radius",HN,UN,WN),X_.extendComponentModel({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(e){var t;return this.ecModel.eachComponent(e,(function(e){e.getCoordSysModel()===this&&(t=e)}),this),t},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}});var jN=Pc.parsePercent,ZN=Px.createScaleByModel,YN=Px.niceScaleExtent,XN=ry.getStackedDimension;function qN(e,t){var i=this,n=i.getAngleAxis(),a=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),a.scale.setExtent(1/0,-1/0),e.eachSeries((function(e){if(e.coordinateSystem===i){var t=e.getData();Ve.each(t.mapDimension("radius",!0),(function(e){a.scale.unionExtentFromData(t,XN(t,e))})),Ve.each(t.mapDimension("angle",!0),(function(e){n.scale.unionExtentFromData(t,XN(t,e))}))}})),YN(n.scale,n.model),YN(a.scale,a.model),"category"===n.type&&!n.onBand){var r=n.getExtent(),o=360/n.scale.count();n.inverse?r[1]+=o:r[1]-=o,n.setExtent(r[0],r[1])}}function $N(e,t){if(e.type=t.get("type"),e.scale=ZN(t),e.onBand=t.get("boundaryGap")&&"category"===e.type,e.inverse=t.get("inverse"),"angleAxis"===t.mainType){e.inverse^=t.get("clockwise");var i=t.get("startAngle");e.setExtent(i,i+(e.inverse?-360:360))}t.axis=e,e.model=t}var KN={dimensions:GN.prototype.dimensions,create:function(e,t){var i=[];return e.eachComponent("polar",(function(e,n){var a=new GN(n);a.update=qN;var r=a.getRadiusAxis(),o=a.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");$N(r,s),$N(o,l),function(e,t,i){var n=t.get("center"),a=i.getWidth(),r=i.getHeight();e.cx=jN(n[0],a),e.cy=jN(n[1],r);var o=e.getRadiusAxis(),s=Math.min(a,r)/2,l=t.get("radius");null==l?l=[0,"100%"]:Ve.isArray(l)||(l=[0,l]),l=[jN(l[0],s),jN(l[1],s)],o.inverse?o.setExtent(l[1],l[0]):o.setExtent(l[0],l[1])}(a,e,t),i.push(a),e.coordinateSystem=a,a.model=e})),e.eachSeries((function(t){if("polar"===t.get("coordinateSystem")){var i=e.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];t.coordinateSystem=i.coordinateSystem}})),i}};Tp.register("polar",KN);var JN=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function QN(e,t,i){t[1]>t[0]&&(t=t.slice().reverse());var n=e.coordToPoint([t[0],i]),a=e.coordToPoint([t[1],i]);return{x1:n[0],y1:n[1],x2:a[0],y2:a[1]}}function ez(e){return e.getRadiusAxis().inverse?0:1}function tz(e){var t=e[0],i=e[e.length-1];t&&i&&Math.abs(Math.abs(t.coord-i.coord)-360)<1e-4&&e.pop()}IS.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,a=n.getRadiusAxis().getExtent(),r=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=Ve.map(i.getViewLabels(),(function(e){return(e=Ve.clone(e)).coord=i.dataToCoord(e.tickValue),e}));tz(s),tz(r),Ve.each(JN,(function(t){!e.get(t+".show")||i.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,n,r,o,a,s)}),this)}},_axisLine:function(e,t,i,n,a){var r,o=e.getModel("axisLine.lineStyle"),s=ez(t),l=s?0:1;(r=0===a[l]?new tc.Circle({shape:{cx:t.cx,cy:t.cy,r:a[s]},style:o.getLineStyle(),z2:1,silent:!0}):new tc.Ring({shape:{cx:t.cx,cy:t.cy,r:a[s],r0:a[l]},style:o.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(r)},_axisTick:function(e,t,i,n,a){var r=e.getModel("axisTick"),o=(r.get("inside")?-1:1)*r.get("length"),s=a[ez(t)],l=Ve.map(i,(function(e){return new tc.Line({shape:QN(t,[s,s+o],e.coord)})}));this.group.add(tc.mergePath(l,{style:Ve.defaults(r.getModel("lineStyle").getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")})}))},_minorTick:function(e,t,i,n,a){if(n.length){for(var r=e.getModel("axisTick"),o=e.getModel("minorTick"),s=(r.get("inside")?-1:1)*o.get("length"),l=a[ez(t)],u=[],h=0;h<n.length;h++)for(var c=0;c<n[h].length;c++)u.push(new tc.Line({shape:QN(t,[l,l+s],n[h][c].coord)}));this.group.add(tc.mergePath(u,{style:Ve.defaults(o.getModel("lineStyle").getLineStyle(),Ve.defaults(r.getLineStyle(),{stroke:e.get("axisLine.lineStyle.color")}))}))}},_axisLabel:function(e,t,i,n,a,r){var o=e.getCategories(!0),s=e.getModel("axisLabel"),l=s.get("margin"),u=e.get("triggerEvent");Ve.each(r,(function(i,n){var r=s,h=i.tickValue,c=a[ez(t)],d=t.coordToPoint([c+l,i.coord]),p=t.cx,f=t.cy,g=Math.abs(d[0]-p)/c<.3?"center":d[0]>p?"left":"right",m=Math.abs(d[1]-f)/c<.3?"middle":d[1]>f?"top":"bottom";o&&o[h]&&o[h].textStyle&&(r=new mc(o[h].textStyle,s,s.ecModel));var v=new tc.Text({silent:cS.isLabelSilent(e)});this.group.add(v),tc.setTextStyle(v.style,r,{x:d[0],y:d[1],textFill:r.getTextColor()||e.get("axisLine.lineStyle.color"),text:i.formattedLabel,textAlign:g,textVerticalAlign:m}),u&&(v.eventData=cS.makeAxisEventDataBase(e),v.eventData.targetType="axisLabel",v.eventData.value=i.rawLabel)}),this)},_splitLine:function(e,t,i,n,a){var r=e.getModel("splitLine").getModel("lineStyle"),o=r.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=0;u<i.length;u++){var h=s++%o.length;l[h]=l[h]||[],l[h].push(new tc.Line({shape:QN(t,a,i[u].coord)}))}for(u=0;u<l.length;u++)this.group.add(tc.mergePath(l[u],{style:Ve.defaults({stroke:o[u%o.length]},r.getLineStyle()),silent:!0,z:e.get("z")}))},_minorSplitLine:function(e,t,i,n,a){if(n.length){for(var r=e.getModel("minorSplitLine").getModel("lineStyle"),o=[],s=0;s<n.length;s++)for(var l=0;l<n[s].length;l++)o.push(new tc.Line({shape:QN(t,a,n[s][l].coord)}));this.group.add(tc.mergePath(o,{style:r.getLineStyle(),silent:!0,z:e.get("z")}))}},_splitArea:function(e,t,i,n,a){if(i.length){var r=e.getModel("splitArea").getModel("areaStyle"),o=r.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=Math.PI/180,h=-i[0].coord*u,c=Math.min(a[0],a[1]),d=Math.max(a[0],a[1]),p=e.get("clockwise"),f=1;f<i.length;f++){var g=s++%o.length;l[g]=l[g]||[],l[g].push(new tc.Sector({shape:{cx:t.cx,cy:t.cy,r0:c,r:d,startAngle:h,endAngle:-i[f].coord*u,clockwise:p},silent:!0})),h=-i[f].coord*u}for(f=0;f<l.length;f++)this.group.add(tc.mergePath(l[f],{style:Ve.defaults({fill:o[f%o.length]},r.getAreaStyle()),silent:!0}))}}});var iz=["axisLine","axisTickLabel","axisName"],nz=["splitLine","splitArea","minorSplitLine"];IS.extend({type:"radiusAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,a=n.getAngleAxis(),r=i.getTicksCoords(),o=i.getMinorTicksCoords(),s=a.getExtent()[0],l=i.getExtent(),u=function(e,t,i){return{position:[e.cx,e.cy],rotation:i/180*Math.PI,labelDirection:-1,tickDirection:-1,nameDirection:1,labelRotate:t.getModel("axisLabel").get("rotate"),z2:1}}(n,e,s),h=new cS(e,u);Ve.each(iz,h.add,h),this.group.add(h.getGroup()),Ve.each(nz,(function(t){e.get(t+".show")&&!i.scale.isBlank()&&this["_"+t](e,n,s,l,r,o)}),this)}},_splitLine:function(e,t,i,n,a){var r=e.getModel("splitLine").getModel("lineStyle"),o=r.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=0;u<a.length;u++){var h=s++%o.length;l[h]=l[h]||[],l[h].push(new tc.Circle({shape:{cx:t.cx,cy:t.cy,r:a[u].coord}}))}for(u=0;u<l.length;u++)this.group.add(tc.mergePath(l[u],{style:Ve.defaults({stroke:o[u%o.length],fill:null},r.getLineStyle()),silent:!0}))},_minorSplitLine:function(e,t,i,n,a,r){if(r.length){for(var o=e.getModel("minorSplitLine").getModel("lineStyle"),s=[],l=0;l<r.length;l++)for(var u=0;u<r[l].length;u++)s.push(new tc.Circle({shape:{cx:t.cx,cy:t.cy,r:r[l][u].coord}}));this.group.add(tc.mergePath(s,{style:Ve.defaults({fill:null},o.getLineStyle()),silent:!0}))}},_splitArea:function(e,t,i,n,a){if(a.length){var r=e.getModel("splitArea").getModel("areaStyle"),o=r.get("color"),s=0;o=o instanceof Array?o:[o];for(var l=[],u=a[0].coord,h=1;h<a.length;h++){var c=s++%o.length;l[c]=l[c]||[],l[c].push(new tc.Sector({shape:{cx:t.cx,cy:t.cy,r0:u,r:a[h].coord,startAngle:0,endAngle:2*Math.PI},silent:!0})),u=a[h].coord}for(h=0;h<l.length;h++)this.group.add(tc.mergePath(l[h],{style:Ve.defaults({fill:o[h%o.length]},r.getAreaStyle()),silent:!0}))}}});var az=hE.extend({makeElOption:function(e,t,i,n,a){var r=i.axis;"angle"===r.dim&&(this.animationThreshold=Math.PI/18);var o,s=r.polar,l=s.getOtherAxis(r).getExtent();o=r["dataTo"+Uc.capitalFirst(r.dim)](t);var u=n.get("type");if(u&&"none"!==u){var h=gE.buildElStyle(n),c=rz[u](r,s,o,l,h);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=function(e,t,i,n,a){var r=t.axis,o=r.dataToCoord(e),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l,u,h,c=n.getRadiusAxis().getExtent();if("radius"===r.dim){var d=ni.create();ni.rotate(d,d,s),ni.translate(d,d,[n.cx,n.cy]),l=tc.applyTransform([o,-a],d);var p=t.getModel("axisLabel").get("rotate")||0,f=cS.innerTextLayout(s,p*Math.PI/180,-1);u=f.textAlign,h=f.textVerticalAlign}else{var g=c[1];l=n.coordToPoint([g+a,o]);var m=n.cx,v=n.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}}(t,i,0,s,n.get("label.margin"));gE.buildLabelElOption(e,i,n,a,d)}});var rz={line:function(e,t,i,n,a){return"angle"===e.dim?{type:"Line",shape:gE.makeLineShape(t.coordToPoint([n[0],i]),t.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:t.cx,cy:t.cy,r:i}}},shadow:function(e,t,i,n,a){var r=Math.max(1,e.getBandWidth()),o=Math.PI/180;return"angle"===e.dim?{type:"Sector",shape:gE.makeSectorShape(t.cx,t.cy,n[0],n[1],(-i-r/2)*o,(r/2-i)*o)}:{type:"Sector",shape:gE.makeSectorShape(t.cx,t.cy,i-r/2,i+r/2,0,2*Math.PI)}}};IS.registerAxisPointerClass("PolarAxisPointer",az),X_.registerLayout(Ve.curry(RN,"bar")),X_.extendComponentView({type:"polar"});var oz=ud.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(e){ud.prototype.init.apply(this,arguments),Ro.defaultEmphasis(e,"label",["show"])},optionUpdated:function(){var e=this.option,t=this;e.regions=MT.getFilledRegions(e.regions,e.map,e.nameMap),this._optionModelMap=Ve.reduce(e.regions||[],(function(e,i){return i.name&&e.set(i.name,new mc(i,t)),e}),Ve.createHashMap()),this.updateSelectedMap(e.regions)},defaultOption:{zlevel:0,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:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",color:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},getRegionModel:function(e){return this._optionModelMap.get(e)||new mc(null,this,this.ecModel)},getFormattedLabel:function(e,t){var i=this.getRegionModel(e).get("label"+("normal"===t?".":t+".")+"formatter"),n={name:e};return"function"==typeof i?(n.status=t,i(n)):"string"==typeof i?i.replace("{a}",null!=e?e:""):void 0},setZoom:function(e){this.option.zoom=e},setCenter:function(e){this.option.center=e}});function sz(e,t){t.update="updateView",X_.registerAction(t,(function(t,i){var n={};return i.eachComponent({mainType:"geo",query:t},(function(i){i[e](t.name);var a=i.coordinateSystem;Ve.each(a.regions,(function(e){n[e.name]=i.isSelected(e.name)||!1}))})),{selected:n,name:t.name}}))}Ve.mixin(oz,pM),X_.extendComponentView({type:"geo",init:function(e,t){var i=new rT(t,!0);this._mapDraw=i,this.group.add(i.group)},render:function(e,t,i,n){if(!n||"geoToggleSelect"!==n.type||n.from!==this.uid){var a=this._mapDraw;e.get("show")?a.draw(e,t,i,this,n):this._mapDraw.group.removeAll(),this.group.silent=e.get("silent")}},dispose:function(){this._mapDraw&&this._mapDraw.remove()}}),sz("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),sz("select",{type:"geoSelect",event:"geoselected"}),sz("unSelect",{type:"geoUnSelect",event:"geounselected"});var lz=864e5;function uz(e,t,i){this._model=e}function hz(e,t,i,n){var a=i.calendarModel,r=i.seriesModel,o=a?a.coordinateSystem:r?r.coordinateSystem:null;return o===this?o[e](n):null}uz.prototype={constructor:uz,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(e){var t=(e=Pc.parseDate(e)).getFullYear(),i=e.getMonth()+1;i=i<10?"0"+i:i;var n=e.getDate();n=n<10?"0"+n:n;var a=e.getDay();return{y:t,m:i,d:n,day:a=Math.abs((a+7-this.getFirstDayOfWeek())%7),time:e.getTime(),formatedDate:t+"-"+i+"-"+n,date:e}},getNextNDay:function(e,t){return 0===(t=t||0)||(e=new Date(this.getDateInfo(e).time)).setDate(e.getDate()+t),this.getDateInfo(e)},update:function(e,t){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 i=this._rangeInfo.weeks||1,n=["width","height"],a=this._model.get("cellSize").slice(),r=this._model.getBoxLayoutParams(),o="horizontal"===this._orient?[i,7]:[7,i];Ve.each([0,1],(function(e){u(a,e)&&(r[n[e]]=a[e]*o[e])}));var s={width:t.getWidth(),height:t.getHeight()},l=this._rect=nd.getLayoutRect(r,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}Ve.each([0,1],(function(e){u(a,e)||(a[e]=l[n[e]]/o[e])})),this._sw=a[0],this._sh=a[1]},dataToPoint:function(e,t){Ve.isArray(e)&&(e=e[0]),null==t&&(t=!0);var i=this.getDateInfo(e),n=this._rangeInfo,a=i.formatedDate;if(t&&!(i.time>=n.start.time&&i.time<n.end.time+lz))return[NaN,NaN];var r=i.day,o=this._getRangeInfo([n.start.time,a]).nthWeek;return"vertical"===this._orient?[this._rect.x+r*this._sw+this._sw/2,this._rect.y+o*this._sh+this._sh/2]:[this._rect.x+o*this._sw+this._sw/2,this._rect.y+r*this._sh+this._sh/2]},pointToData:function(e){var t=this.pointToDate(e);return t&&t.time},dataToRect:function(e,t){var i=this.dataToPoint(e,t);return{contentShape:{x:i[0]-(this._sw-this._lineWidth)/2,y:i[1]-(this._sh-this._lineWidth)/2,width:this._sw-this._lineWidth,height:this._sh-this._lineWidth},center:i,tl:[i[0]-this._sw/2,i[1]-this._sh/2],tr:[i[0]+this._sw/2,i[1]-this._sh/2],br:[i[0]+this._sw/2,i[1]+this._sh/2],bl:[i[0]-this._sw/2,i[1]+this._sh/2]}},pointToDate:function(e){var t=Math.floor((e[0]-this._rect.x)/this._sw)+1,i=Math.floor((e[1]-this._rect.y)/this._sh)+1,n=this._rangeInfo.range;return"vertical"===this._orient?this._getDateByWeeksAndDay(i,t-1,n):this._getDateByWeeksAndDay(t,i-1,n)},convertToPixel:Ve.curry(hz,"dataToPoint"),convertFromPixel:Ve.curry(hz,"pointToData"),_initRangeOption:function(){var e=this._model.get("range"),t=e;if(Ve.isArray(t)&&1===t.length&&(t=t[0]),/^\d{4}$/.test(t)&&(e=[t+"-01-01",t+"-12-31"]),/^\d{4}[\/|-]\d{1,2}$/.test(t)){var i=this.getDateInfo(t),n=i.date;n.setMonth(n.getMonth()+1);var a=this.getNextNDay(n,-1);e=[i.formatedDate,a.formatedDate]}/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(t)&&(e=[t,t]);var r=this._getRangeInfo(e);return r.start.time>r.end.time&&e.reverse(),e},_getRangeInfo:function(e){var t;(e=[this.getDateInfo(e[0]),this.getDateInfo(e[1])])[0].time>e[1].time&&(t=!0,e.reverse());var i=Math.floor(e[1].time/lz)-Math.floor(e[0].time/lz)+1,n=new Date(e[0].time),a=n.getDate(),r=e[1].date.getDate();n.setDate(a+i-1);var o=n.getDate();if(o!==r)for(var s=n.getTime()-e[1].time>0?1:-1;(o=n.getDate())!==r&&(n.getTime()-e[1].time)*s>0;)i-=s,n.setDate(o-s);var l=Math.floor((i+e[0].day+6)/7),u=t?1-l:l-1;return t&&e.reverse(),{range:[e[0].formatedDate,e[1].formatedDate],start:e[0],end:e[1],allDay:i,weeks:l,nthWeek:u,fweek:e[0].day,lweek:e[1].day}},_getDateByWeeksAndDay:function(e,t,i){var n=this._getRangeInfo(i);if(e>n.weeks||0===e&&t<n.fweek||e===n.weeks&&t>n.lweek)return!1;var a=7*(e-1)-n.fweek+t,r=new Date(n.start.time);return r.setDate(n.start.d+a),this.getDateInfo(r)}},uz.dimensions=uz.prototype.dimensions,uz.getDimensionsInfo=uz.prototype.getDimensionsInfo,uz.create=function(e,t){var i=[];return e.eachComponent("calendar",(function(e){var t=new uz(e);i.push(t),e.coordinateSystem=t})),e.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},Tp.register("calendar",uz);var cz=nd.getLayoutParams,dz=nd.sizeCalculable,pz=nd.mergeLayoutParam,fz=ud.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(e,t,i,n){var a=cz(e);fz.superApply(this,"init",arguments),gz(e,a)},mergeOption:function(e,t){fz.superApply(this,"mergeOption",arguments),gz(this.option,e)}});function gz(e,t){var i=e.cellSize;Ve.isArray(i)?1===i.length&&(i[1]=i[0]):i=e.cellSize=[i,i];var n=Ve.map([0,1],(function(e){return dz(t,e)&&(i[e]="auto"),null!=i[e]&&"auto"!==i[e]}));pz(e,t,{type:"box",ignoreSize:n})}var mz={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},vz={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};X_.extendComponentView({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(e,t,i){var n=this.group;n.removeAll();var a=e.coordinateSystem,r=a.getRangeInfo(),o=a.getOrient();this._renderDayRect(e,r,n),this._renderLines(e,r,o,n),this._renderYearText(e,r,o,n),this._renderMonthText(e,o,n),this._renderWeekText(e,r,o,n)},_renderDayRect:function(e,t,i){for(var n=e.coordinateSystem,a=e.getModel("itemStyle").getItemStyle(),r=n.getCellWidth(),o=n.getCellHeight(),s=t.start.time;s<=t.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new tc.Rect({shape:{x:l[0],y:l[1],width:r,height:o},cursor:"default",style:a});i.add(u)}},_renderLines:function(e,t,i,n){var a=this,r=e.coordinateSystem,o=e.getModel("splitLine.lineStyle").getLineStyle(),s=e.get("splitLine.show"),l=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){d(u.formatedDate),0===h&&(u=r.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=r.getDateInfo(c)}function d(t){a._firstDayOfMonth.push(r.getDateInfo(t)),a._firstDayPoints.push(r.dataToRect([t],!1).tl);var l=a._getLinePointsOfOneWeek(e,t,i);a._tlpoints.push(l[0]),a._blpoints.push(l[l.length-1]),s&&a._drawSplitline(l,o,n)}d(r.getNextNDay(t.end.time,1).formatedDate),s&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,l,i),o,n),s&&this._drawSplitline(a._getEdgesPoints(a._blpoints,l,i),o,n)},_getEdgesPoints:function(e,t,i){var n=[e[0].slice(),e[e.length-1].slice()],a="horizontal"===i?0:1;return n[0][a]=n[0][a]-t/2,n[1][a]=n[1][a]+t/2,n},_drawSplitline:function(e,t,i){var n=new tc.Polyline({z2:20,shape:{points:e},style:t});i.add(n)},_getLinePointsOfOneWeek:function(e,t,i){var n=e.coordinateSystem;t=n.getDateInfo(t);for(var a=[],r=0;r<7;r++){var o=n.getNextNDay(t.time,r),s=n.dataToRect([o.time],!1);a[2*o.day]=s.tl,a[2*o.day+1]=s["horizontal"===i?"bl":"tr"]}return a},_formatterLabel:function(e,t){return"string"==typeof e&&e?Uc.formatTplSimple(e,t):"function"==typeof e?e(t):t.nameMap},_yearTextPositionControl:function(e,t,i,n,a){t=t.slice();var r=["center","bottom"];"bottom"===n?(t[1]+=a,r=["center","top"]):"left"===n?t[0]-=a:"right"===n?(t[0]+=a,r=["center","top"]):t[1]-=a;var o=0;return"left"!==n&&"right"!==n||(o=Math.PI/2),{rotation:o,position:t,style:{textAlign:r[0],textVerticalAlign:r[1]}}},_renderYearText:function(e,t,i,n){var a=e.getModel("yearLabel");if(a.get("show")){var r=a.get("margin"),o=a.get("position");o||(o="horizontal"!==i?"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"===i?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=t.start.y;+t.end.y>+t.start.y&&(d=d+"-"+t.end.y);var p=a.get("formatter"),f={start:t.start.y,end:t.end.y,nameMap:d},g=this._formatterLabel(p,f),m=new tc.Text({z2:30});tc.setTextStyle(m.style,a,{text:g}),m.attr(this._yearTextPositionControl(m,c[o],i,o,r)),n.add(m)}},_monthTextPositionControl:function(e,t,i,n,a){var r="left",o="top",s=e[0],l=e[1];return"horizontal"===i?(l+=a,t&&(r="center"),"start"===n&&(o="bottom")):(s+=a,t&&(o="middle"),"start"===n&&(r="right")),{x:s,y:l,textAlign:r,textVerticalAlign:o}},_renderMonthText:function(e,t,i){var n=e.getModel("monthLabel");if(n.get("show")){var a=n.get("nameMap"),r=n.get("margin"),o=n.get("position"),s=n.get("align"),l=[this._tlpoints,this._blpoints];Ve.isString(a)&&(a=mz[a.toUpperCase()]||[]);var u="start"===o?0:1,h="horizontal"===t?0:1;r="start"===o?-r:r;for(var c="center"===s,d=0;d<l[u].length-1;d++){var p=l[u][d].slice(),f=this._firstDayOfMonth[d];if(c){var g=this._firstDayPoints[d];p[h]=(g[h]+l[0][d+1][h])/2}var m=n.get("formatter"),v=a[+f.m-1],y={yyyy:f.y,yy:(f.y+"").slice(2),MM:f.m,M:+f.m,nameMap:v},x=this._formatterLabel(m,y),_=new tc.Text({z2:30});Ve.extend(tc.setTextStyle(_.style,n,{text:x}),this._monthTextPositionControl(p,c,t,o,r)),i.add(_)}}},_weekTextPositionControl:function(e,t,i,n,a){var r="center",o="middle",s=e[0],l=e[1],u="start"===i;return"horizontal"===t?(s=s+n+(u?1:-1)*a[0]/2,r=u?"right":"left"):(l=l+n+(u?1:-1)*a[1]/2,o=u?"bottom":"top"),{x:s,y:l,textAlign:r,textVerticalAlign:o}},_renderWeekText:function(e,t,i,n){var a=e.getModel("dayLabel");if(a.get("show")){var r=e.coordinateSystem,o=a.get("position"),s=a.get("nameMap"),l=a.get("margin"),u=r.getFirstDayOfWeek();Ve.isString(s)&&(s=vz[s.toUpperCase()]||[]);var h=r.getNextNDay(t.end.time,7-t.lweek).time,c=[r.getCellWidth(),r.getCellHeight()];l=Pc.parsePercent(l,c["horizontal"===i?0:1]),"start"===o&&(h=r.getNextNDay(t.start.time,-(7+t.fweek)).time,l=-l);for(var d=0;d<7;d++){var p,f=r.getNextNDay(h,d),g=r.dataToRect([f.time],!1).center;p=Math.abs((d+u)%7);var m=new tc.Text({z2:30});Ve.extend(tc.setTextStyle(m.style,a,{text:s[p]}),this._weekTextPositionControl(g,i,o,l,c)),n.add(m)}}}});var yz=Pc.parsePercent,xz={path:null,compoundPath:null,group:tc.Group,image:tc.Image,text:tc.Text};X_.registerPreprocessor((function(e){var t=e.graphic;Ve.isArray(t)?t[0]&&t[0].elements?e.graphic=[e.graphic[0]]:e.graphic=[{elements:t}]:t&&!t.elements&&(e.graphic=[{elements:[t]}])}));var _z=X_.extendComponentModel({type:"graphic",defaultOption:{elements:[],parentId:null},_elOptionsToUpdate:null,mergeOption:function(e){var t=this.option.elements;this.option.elements=null,_z.superApply(this,"mergeOption",arguments),this.option.elements=t},optionUpdated:function(e,t){var i=this.option,n=(t?i:e).elements,a=i.elements=t?[]:i.elements,r=[];this._flatten(n,r);var o=Ro.mappingToExists(a,r);Ro.makeIdAndName(o);var s=this._elOptionsToUpdate=[];Ve.each(o,(function(e,t){var i=e.option;i&&(s.push(i),function(e,t){var i=e.exist;if(t.id=e.keyInfo.id,!t.type&&i&&(t.type=i.type),null==t.parentId){var n=t.parentOption;n?t.parentId=n.id:i&&(t.parentId=i.parentId)}t.parentOption=null}(e,i),function(e,t,i){var n=Ve.extend({},i),a=e[t],r=i.$action||"merge";"merge"===r?a?(Ve.merge(a,n,!0),nd.mergeLayoutParam(a,n,{ignoreSize:!0}),nd.copyLayoutParams(i,a)):e[t]=n:"replace"===r?e[t]=n:"remove"===r&&a&&(e[t]=null)}(a,t,i),function(e,t){if(!e)return;e.hv=t.hv=[Sz(t,["left","right"]),Sz(t,["top","bottom"])],"group"===e.type&&(null==e.width&&(e.width=t.width=0),null==e.height&&(e.height=t.height=0))}(a[t],i))}),this);for(var l=a.length-1;l>=0;l--)null==a[l]?a.splice(l,1):delete a[l].$action},_flatten:function(e,t,i){Ve.each(e,(function(e){if(e){i&&(e.parentOption=i),t.push(e);var n=e.children;"group"===e.type&&n&&this._flatten(n,t,e),delete e.children}}),this)},useElOptionsToUpdate:function(){var e=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,e}});function bz(e,t,i,n){var a=i.type,r=new(xz.hasOwnProperty(a)?xz[a]:tc.getShapeClass(a))(i);t.add(r),n.set(e,r),r.__ecGraphicId=e}function wz(e,t){var i=e&&e.parent;i&&("group"===e.type&&e.traverse((function(e){wz(e,t)})),t.removeKey(e.__ecGraphicId),i.remove(e))}function Sz(e,t){var i;return Ve.each(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(i=!0)})),i}X_.extendComponentView({type:"graphic",init:function(e,t){this._elMap=Ve.createHashMap(),this._lastGraphicModel},render:function(e,t,i){e!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=e,this._updateElements(e),this._relocate(e,i)},_updateElements:function(e){var t=e.useElOptionsToUpdate();if(t){var i=this._elMap,n=this.group;Ve.each(t,(function(t){var a=t.$action,r=t.id,o=i.get(r),s=t.parentId,l=null!=s?i.get(s):n,u=t.style;"text"===t.type&&u&&(t.hv&&t.hv[1]&&(u.textVerticalAlign=u.textBaseline=null),!u.hasOwnProperty("textFill")&&u.fill&&(u.textFill=u.fill),!u.hasOwnProperty("textStroke")&&u.stroke&&(u.textStroke=u.stroke));var h=function(e){return e=Ve.extend({},e),Ve.each(["id","parentId","$action","hv","bounding"].concat(nd.LOCATION_PARAMS),(function(t){delete e[t]})),e}(t);a&&"merge"!==a?"replace"===a?(wz(o,i),bz(r,l,h,i)):"remove"===a&&wz(o,i):o?o.attr(h):bz(r,l,h,i);var c=i.get(r);c&&(c.__ecGraphicWidthOption=t.width,c.__ecGraphicHeightOption=t.height,function(e,t,i){var n=e.eventData;e.silent||e.ignore||n||(n=e.eventData={componentType:"graphic",componentIndex:t.componentIndex,name:e.name});n&&(n.info=e.info)}(c,e))}))}},_relocate:function(e,t){for(var i=e.option.elements,n=this.group,a=this._elMap,r=t.getWidth(),o=t.getHeight(),s=0;s<i.length;s++){var l=i[s];if((h=a.get(l.id))&&h.isGroup){var u=(c=h.parent)===n;h.__ecGraphicWidth=yz(h.__ecGraphicWidthOption,u?r:c.__ecGraphicWidth)||0,h.__ecGraphicHeight=yz(h.__ecGraphicHeightOption,u?o:c.__ecGraphicHeight)||0}}for(s=i.length-1;s>=0;s--){var h;l=i[s];if(h=a.get(l.id)){var c,d=(c=h.parent)===n?{width:r,height:o}:{width:c.__ecGraphicWidth,height:c.__ecGraphicHeight};nd.positionElement(h,l,d,null,{hv:l.hv,boundingMode:l.bounding})}}},_clear:function(){var e=this._elMap;e.each((function(t){wz(t,e)})),this._elMap=Ve.createHashMap()},dispose:function(){this._clear()}});var Mz={};var Iz={register:function(e,t){Mz[e]=t},get:function(e){return Mz[e]}},Tz=X_.extendComponentModel({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},optionUpdated:function(){Tz.superApply(this,"optionUpdated",arguments),Ve.each(this.option.feature,(function(e,t){var i=Iz.get(t);i&&Ve.merge(e,i.defaultOption)}))},defaultOption:{show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1}}}),Az=nd.getLayoutRect,Cz=nd.box,Dz=nd.positionElement;var Lz=function(e,t){var i=Uc.normalizeCssArray(t.get("padding")),n=t.getItemStyle(["color","opacity"]);return n.fill=t.get("backgroundColor"),e=new tc.Rect({shape:{x:e.x-i[3],y:e.y-i[0],width:e.width+i[1]+i[3],height:e.height+i[0]+i[2],r:t.get("borderRadius")},style:n,silent:!0,z2:-1})},Pz={layout:function(e,t,i){var n=t.getBoxLayoutParams(),a=t.get("padding"),r={width:i.getWidth(),height:i.getHeight()},o=Az(n,r,a);Cz(t.get("orient"),e,t.get("itemGap"),o.width,o.height),Dz(e,n,r,a)},makeBackground:Lz};X_.extendComponentView({type:"toolbox",render:function(e,t,i,n){var a=this.group;if(a.removeAll(),e.get("show")){var r=+e.get("itemSize"),o=e.get("feature")||{},s=this._features||(this._features={}),l=[];Ve.each(o,(function(e,t){l.push(t)})),new tv(this._featureNames||[],l).add(u).update(u).remove(Ve.curry(u,null)).execute(),this._featureNames=l,Pz.layout(a,e,i),a.add(Pz.makeBackground(a.getBoundingRect(),e)),a.eachChild((function(e){var t=e.__title,n=e.hoverStyle;if(n&&t){var o=Wa.getBoundingRect(t,Wa.makeFont(n)),s=e.position[0]+a.position[0],l=!1;e.position[1]+a.position[1]+r+o.height>i.getHeight()&&(n.textPosition="top",l=!0);var u=l?-5-o.height:r+8;s+o.width/2>i.getWidth()?(n.textPosition=["100%",u],n.textAlign="right"):s-o.width/2<0&&(n.textPosition=[0,u],n.textAlign="left")}}))}function u(u,h){var c,d=l[u],p=l[h],f=o[d],g=new mc(f,e,e.ecModel);if(n&&null!=n.newTitle&&n.featureName===d&&(f.title=n.newTitle),d&&!p){if(function(e){return 0===e.indexOf("my")}(d))c={model:g,onclick:g.option.onclick,featureName:d};else{var m=Iz.get(d);if(!m)return;c=new m(g,t,i)}s[d]=c}else{if(!(c=s[p]))return;c.model=g,c.ecModel=t,c.api=i}d||!p?g.get("show")&&!c.unusable?(!function(n,o,s){var l=n.getModel("iconStyle"),u=n.getModel("emphasis.iconStyle"),h=o.getIcons?o.getIcons():n.get("icon"),c=n.get("title")||{};if("string"==typeof h){var d=h,p=c;c={},(h={})[s]=d,c[s]=p}var f=n.iconPaths={};Ve.each(h,(function(s,h){var d=tc.createIcon(s,{},{x:-r/2,y:-r/2,width:r,height:r});d.setStyle(l.getItemStyle()),d.hoverStyle=u.getItemStyle(),d.setStyle({text:c[h],textAlign:u.get("textAlign"),textBorderRadius:u.get("textBorderRadius"),textPadding:u.get("textPadding"),textFill:null});var p=e.getModel("tooltip");p&&p.get("show")&&d.attr("tooltip",Ve.extend({content:c[h],formatter:p.get("formatter",!0)||function(){return c[h]},formatterParams:{componentType:"toolbox",name:h,title:c[h],$vars:["name","title"]},position:p.get("position",!0)||"bottom"},p.option)),tc.setHoverStyle(d),e.get("showTitle")&&(d.__title=c[h],d.on("mouseover",(function(){var t=u.getItemStyle(),i="vertical"===e.get("orient")?null==e.get("right")?"right":"left":null==e.get("bottom")?"bottom":"top";d.setStyle({textFill:u.get("textFill")||t.fill||t.stroke||"#000",textBackgroundColor:u.get("textBackgroundColor"),textPosition:u.get("textPosition")||i})})).on("mouseout",(function(){d.setStyle({textFill:null,textBackgroundColor:null})}))),d.trigger(n.get("iconStatus."+h)||"normal"),a.add(d),d.on("click",Ve.bind(o.onclick,o,t,i,h)),f[h]=d}))}(g,c,d),g.setIconStatus=function(e,t){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[e]=t,n[e]&&n[e].trigger(t)},c.render&&c.render(g,t,i,n)):c.remove&&c.remove(t,i):c.dispose&&c.dispose(t,i)}},updateView:function(e,t,i,n){Ve.each(this._features,(function(e){e.updateView&&e.updateView(e.model,t,i,n)}))},remove:function(e,t){Ve.each(this._features,(function(i){i.remove&&i.remove(e,t)})),this.group.removeAll()},dispose:function(e,t){Ve.each(this._features,(function(i){i.dispose&&i.dispose(e,t)}))}});var kz=kg.toolbox.saveAsImage;function Oz(e){this.model=e}Oz.defaultOption={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:kz.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:kz.lang.slice()},Oz.prototype.unusable=!ie.canvasSupported,Oz.prototype.onclick=function(e,t){var i=this.model,n=i.get("name")||e.get("title.0.text")||"echarts",a="svg"===t.getZr().painter.getType()?"svg":i.get("type",!0)||"png",r=t.getConnectedDataURL({type:a,backgroundColor:i.get("backgroundColor",!0)||e.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||ie.browser.ie||ie.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var o=atob(r.split(",")[1]),s=o.length,l=new Uint8Array(s);s--;)l[s]=o.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,n+"."+a)}else{var h=i.get("lang"),c='<body style="margin:0;"><img src="'+r+'" style="max-width:100%;" title="'+(h&&h[0]||"")+'" /></body>';window.open().document.write(c)}else{var d=document.createElement("a");d.download=n+"."+a,d.target="_blank",d.href=r;var p=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});d.dispatchEvent(p)}},Iz.register("saveAsImage",Oz);var Rz=kg.toolbox.magicType,Ez="__ec_magicType_stack__";function Nz(e){this.model=e}Nz.defaultOption={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:Ve.clone(Rz.title),option:{},seriesIndex:{}};var zz=Nz.prototype;zz.getIcons=function(){var e=this.model,t=e.get("icon"),i={};return Ve.each(e.get("type"),(function(e){t[e]&&(i[e]=t[e])})),i};var Bz={line:function(e,t,i,n){if("bar"===e)return Ve.merge({id:t,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(e,t,i,n){if("line"===e)return Ve.merge({id:t,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(e,t,i,n){var a=i.get("stack")===Ez;if("line"===e||"bar"===e)return n.setIconStatus("stack",a?"normal":"emphasis"),Ve.merge({id:t,stack:a?"":Ez},n.get("option.stack")||{},!0)}},Vz=[["line","bar"],["stack"]];zz.onclick=function(e,t,i){var n=this.model,a=n.get("seriesIndex."+i);if(Bz[i]){var r,o={series:[]};if(Ve.each(Vz,(function(e){Ve.indexOf(e,i)>=0&&Ve.each(e,(function(e){n.setIconStatus(e,"normal")}))})),n.setIconStatus(i,"emphasis"),e.eachComponent({mainType:"series",query:null==a?null:{seriesIndex:a}},(function(t){var a=t.subType,r=t.id,s=Bz[i](a,r,t,n);s&&(Ve.defaults(s,t.option),o.series.push(s));var l=t.coordinateSystem;if(l&&"cartesian2d"===l.type&&("line"===i||"bar"===i)){var u=l.getAxesByScale("ordinal")[0];if(u){var h=u.dim+"Axis",c=e.queryComponents({mainType:h,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;o[h]=o[h]||[];for(var d=0;d<=c;d++)o[h][c]=o[h][c]||{};o[h][c].boundaryGap="bar"===i}}})),"stack"===i)r=o.series&&o.series[0]&&o.series[0].stack===Ez?Ve.merge({stack:Rz.title.tiled},Rz.title):Ve.clone(Rz.title);t.dispatchAction({type:"changeMagicType",currentType:i,newOption:o,newTitle:r,featureName:"magicType"})}},X_.registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)})),Iz.register("magicType",Nz);var Fz=kg.toolbox.dataView,Gz=new Array(60).join("-"),Hz="\t";function Wz(e){return Ve.map(e,(function(e){var t=e.getRawData(),i=[e.name],n=[];return t.each(t.dimensions,(function(){for(var e=arguments.length,a=arguments[e-1],r=t.getName(a),o=0;o<e-1;o++)n[o]=arguments[o];i.push((r?r+Hz:"")+n.join(Hz))})),i.join("\n")})).join("\n\n"+Gz+"\n\n")}function Uz(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var jz=new RegExp("["+Hz+"]+","g");function Zz(e,t){var i=e.split(new RegExp("\n*"+Gz+"\n*","g")),n={series:[]};return Ve.each(i,(function(e,i){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(Hz)>=0)return!0}(e)){var a=function(e){for(var t=e.split(/\n+/g),i=Uz(t.shift()).split(jz),n=[],a=Ve.map(i,(function(e){return{name:e,data:[]}})),r=0;r<t.length;r++){var o=Uz(t[r]).split(jz);n.push(o.shift());for(var s=0;s<o.length;s++)a[s]&&(a[s].data[r]=o[s])}return{series:a,categories:n}}(e),r=t[i],o=r.axisDim+"Axis";r&&(n[o]=n[o]||[],n[o][r.axisIndex]={data:a.categories},n.series=n.series.concat(a.series))}else{a=function(e){for(var t=e.split(/\n+/g),i=Uz(t.shift()),n=[],a=0;a<t.length;a++){var r,o=Uz(t[a]).split(jz),s="",l=!1;isNaN(o[0])?(l=!0,s=o[0],o=o.slice(1),n[a]={name:s,value:[]},r=n[a].value):r=n[a]=[];for(var u=0;u<o.length;u++)r.push(+o[u]);1===r.length&&(l?n[a].value=r[0]:n[a]=r[0])}return{name:i,data:n}}(e);n.series.push(a)}})),n}function Yz(e){this._dom=null,this.model=e}function Xz(e,t){return Ve.map(e,(function(e,i){var n=t&&t[i];return Ve.isObject(n)&&!Ve.isArray(n)?(Ve.isObject(e)&&!Ve.isArray(e)&&(e=e.value),Ve.defaults({value:e},n)):e}))}Yz.defaultOption={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:Ve.clone(Fz.title),lang:Ve.clone(Fz.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},Yz.prototype.onclick=function(e,t){var i=t.getDom(),n=this.model;this._dom&&i.removeChild(this._dom);var a=document.createElement("div");a.style.cssText="position:absolute;left:5px;top:5px;bottom:5px;right:5px;",a.style.backgroundColor=n.get("backgroundColor")||"#fff";var r=document.createElement("h4"),o=n.get("lang")||[];r.innerHTML=o[0]||n.get("title"),r.style.cssText="margin: 10px 20px;",r.style.color=n.get("textColor");var s=document.createElement("div"),l=document.createElement("textarea");s.style.cssText="display:block;width:100%;overflow:auto;";var u=n.get("optionToContent"),h=n.get("contentToOption"),c=function(e){var t,i,n=function(e){var t={},i=[],n=[];return e.eachRawSeries((function(e){var a=e.coordinateSystem;if(!a||"cartesian2d"!==a.type&&"polar"!==a.type)i.push(e);else{var r=a.getBaseAxis();if("category"===r.type){var o=r.dim+"_"+r.index;t[o]||(t[o]={categoryAxis:r,valueAxis:a.getOtherAxis(r),series:[]},n.push({axisDim:r.dim,axisIndex:r.index})),t[o].series.push(e)}else i.push(e)}})),{seriesGroupByCategoryAxis:t,other:i,meta:n}}(e);return{value:Ve.filter([(t=n.seriesGroupByCategoryAxis,i=[],Ve.each(t,(function(e,t){var n=e.categoryAxis,a=e.valueAxis.dim,r=[" "].concat(Ve.map(e.series,(function(e){return e.name}))),o=[n.model.getCategories()];Ve.each(e.series,(function(e){o.push(e.getRawData().mapArray(a,(function(e){return e})))}));for(var s=[r.join(Hz)],l=0;l<o[0].length;l++){for(var u=[],h=0;h<o.length;h++)u.push(o[h][l]);s.push(u.join(Hz))}i.push(s.join("\n"))})),i.join("\n\n"+Gz+"\n\n")),Wz(n.other)],(function(e){return e.replace(/[\n\t\s]/g,"")})).join("\n\n"+Gz+"\n\n"),meta:n.meta}}(e);if("function"==typeof u){var d=u(t.getOption());"string"==typeof d?s.innerHTML=d:Ve.isDom(d)&&s.appendChild(d)}else s.appendChild(l),l.readOnly=n.get("readOnly"),l.style.cssText="width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;",l.style.color=n.get("textColor"),l.style.borderColor=n.get("textareaBorderColor"),l.style.backgroundColor=n.get("textareaColor"),l.value=c.value;var p=c.meta,f=document.createElement("div");f.style.cssText="position:absolute;bottom:0;left:0;right:0;";var g="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",m=document.createElement("div"),v=document.createElement("div");g+=";background-color:"+n.get("buttonColor"),g+=";color:"+n.get("buttonTextColor");var y=this;function x(){i.removeChild(a),y._dom=null}Et.addEventListener(m,"click",x),Et.addEventListener(v,"click",(function(){var e;try{e="function"==typeof h?h(s,t.getOption()):Zz(l.value,p)}catch(e){throw x(),new Error("Data view format error "+e)}e&&t.dispatchAction({type:"changeDataView",newOption:e}),x()})),m.innerHTML=o[1],v.innerHTML=o[2],v.style.cssText=g,m.style.cssText=g,!n.get("readOnly")&&f.appendChild(v),f.appendChild(m),a.appendChild(r),a.appendChild(s),a.appendChild(f),s.style.height=i.clientHeight-80+"px",i.appendChild(a),this._dom=a},Yz.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},Yz.prototype.dispose=function(e,t){this.remove(e,t)},Iz.register("dataView",Yz),X_.registerAction({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(e,t){var i=[];Ve.each(e.newOption.series,(function(e){var n=t.getSeriesByName(e.name)[0];if(n){var a=n.get("data");i.push({name:e.name,data:Xz(e.data,a)})}else i.push(Ve.extend({type:"scatter"},e))})),t.mergeOption(Ve.defaults({series:i},e.newOption))}));var qz=Ve.each,$z=Ve.indexOf,Kz=Ve.curry,Jz=["dataToPoint","pointToData"],Qz=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"];function eB(e,t,i){var n=this._targetInfoList=[],a={},r=nB(t,e);qz(aB,(function(e,t){(!i||!i.include||$z(i.include,t)>=0)&&e(r,n,a)}))}var tB=eB.prototype;function iB(e){return e[0]>e[1]&&e.reverse(),e}function nB(e,t){return Ro.parseFinder(e,t,{includeMainTypes:Qz})}tB.setOutputRanges=function(e,t){this.matchOutputRanges(e,t,(function(e,t,i){if((e.coordRanges||(e.coordRanges=[])).push(t),!e.coordRange){e.coordRange=t;var n=sB[e.brushType](0,i,t);e.__rangeOffset={offset:uB[e.brushType](n.values,e.range,[1,1]),xyMinMax:n.xyMinMax}}}))},tB.matchOutputRanges=function(e,t,i){qz(e,(function(e){var n=this.findTargetInfo(e,t);n&&!0!==n&&Ve.each(n.coordSyses,(function(n){var a=sB[e.brushType](1,n,e.range);i(e,a.values,n,t)}))}),this)},tB.setInputRanges=function(e,t){qz(e,(function(e){var i,n,a,r,o,s=this.findTargetInfo(e,t);if(e.range=e.range||[],s&&!0!==s){e.panelId=s.panelId;var l=sB[e.brushType](0,s.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?uB[e.brushType](l.values,u.offset,(i=l.xyMinMax,n=u.xyMinMax,a=cB(i),r=cB(n),o=[a[0]/r[0],a[1]/r[1]],isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o)):l.values}}),this)},tB.makePanelOpts=function(e,t){return Ve.map(this._targetInfoList,(function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t&&t(i),clipPath:VP.makeRectPanelClipPath(n),isTargetByCursor:VP.makeRectIsTargetByCursor(n,e,i.coordSysModel),getLinearBrushOtherExtent:VP.makeLinearBrushOtherExtent(n)}}))},tB.controlSeries=function(e,t,i){var n=this.findTargetInfo(e,i);return!0===n||n&&$z(n.coordSyses,t.coordinateSystem)>=0},tB.findTargetInfo=function(e,t){for(var i=this._targetInfoList,n=nB(t,e),a=0;a<i.length;a++){var r=i[a],o=e.panelId;if(o){if(r.panelId===o)return r}else for(a=0;a<rB.length;a++)if(rB[a](n,r))return r}return!0};var aB={grid:function(e,t){var i=e.xAxisModels,n=e.yAxisModels,a=e.gridModels,r=Ve.createHashMap(),o={},s={};(i||n||a)&&(qz(i,(function(e){var t=e.axis.grid.model;r.set(t.id,t),o[t.id]=!0})),qz(n,(function(e){var t=e.axis.grid.model;r.set(t.id,t),s[t.id]=!0})),qz(a,(function(e){r.set(e.id,e),o[e.id]=!0,s[e.id]=!0})),r.each((function(e){var a=e.coordinateSystem,r=[];qz(a.getCartesians(),(function(e,t){($z(i,e.getAxis("x").model)>=0||$z(n,e.getAxis("y").model)>=0)&&r.push(e)})),t.push({panelId:"grid--"+e.id,gridModel:e,coordSysModel:e,coordSys:r[0],coordSyses:r,getPanelRect:oB.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){qz(e.geoModels,(function(e){var i=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:i,coordSyses:[i],getPanelRect:oB.geo})}))}},rB=[function(e,t){var i=e.xAxisModel,n=e.yAxisModel,a=e.gridModel;return!a&&i&&(a=i.axis.grid.model),!a&&n&&(a=n.axis.grid.model),a&&a===t.gridModel},function(e,t){var i=e.geoModel;return i&&i===t.geoModel}],oB={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(tc.getTransform(e)),t}},sB={lineX:Kz(lB,0),lineY:Kz(lB,1),rect:function(e,t,i){var n=t[Jz[e]]([i[0][0],i[1][0]]),a=t[Jz[e]]([i[0][1],i[1][1]]),r=[iB([n[0],a[0]]),iB([n[1],a[1]])];return{values:r,xyMinMax:r}},polygon:function(e,t,i){var n=[[1/0,-1/0],[1/0,-1/0]];return{values:Ve.map(i,(function(i){var a=t[Jz[e]](i);return n[0][0]=Math.min(n[0][0],a[0]),n[1][0]=Math.min(n[1][0],a[1]),n[0][1]=Math.max(n[0][1],a[0]),n[1][1]=Math.max(n[1][1],a[1]),a})),xyMinMax:n}}};function lB(e,t,i,n){var a=i.getAxis(["x","y"][e]),r=iB(Ve.map([0,1],(function(e){return t?a.coordToData(a.toLocalCoord(n[e])):a.toGlobalCoord(a.dataToCoord(n[e]))}))),o=[];return o[e]=r,o[1-e]=[NaN,NaN],{values:r,xyMinMax:o}}var uB={lineX:Kz(hB,0),lineY:Kz(hB,1),rect:function(e,t,i){return[[e[0][0]-i[0]*t[0][0],e[0][1]-i[0]*t[0][1]],[e[1][0]-i[1]*t[1][0],e[1][1]-i[1]*t[1][1]]]},polygon:function(e,t,i){return Ve.map(e,(function(e,n){return[e[0]-i[0]*t[n][0],e[1]-i[1]*t[n][1]]}))}};function hB(e,t,i,n){return[t[0]-n[e]*i[0],t[1]-n[e]*i[1]]}function cB(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var dB=eB,pB=Ve.each,fB="\0_ec_hist_store";function gB(e){var t=e[fB];return t||(t=e[fB]=[{}]),t}var mB=function(e,t){var i=gB(e);pB(t,(function(t,n){for(var a=i.length-1;a>=0;a--){if(i[a][n])break}if(a<0){var r=e.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(r){var o=r.getPercentRange();i[0][n]={dataZoomId:n,start:o[0],end:o[1]}}}})),i.push(t)},vB=function(e){var t=gB(e),i=t[t.length-1];t.length>1&&t.pop();var n={};return pB(i,(function(e,i){for(var a=t.length-1;a>=0;a--){if(e=t[a][i]){n[i]=e;break}}})),n},yB={push:mB,pop:vB,clear:function(e){e[fB]=null},count:function(e){return gB(e).length}};ud.registerSubTypeDefaulter("dataZoom",(function(){return"slider"}));var xB=["cartesian2d","polar","singleAxis"];function _B(e,t){e=e.slice();var i=Ve.map(e,Uc.capitalFirst);t=(t||[]).slice();var n=Ve.map(t,Uc.capitalFirst);return function(a,r){Ve.each(e,(function(e,o){for(var s={name:e,capital:i[o]},l=0;l<t.length;l++)s[t[l]]=e+n[l];a.call(r,s)}))}}var bB=_B(["x","y","z","radius","angle","single"],["axisIndex","axis","index","id"]);var wB={isCoordSupported:function(e){return Ve.indexOf(xB,e)>=0},createNameEach:_B,eachAxisDim:bB,createLinkedNodesFinder:function(e,t,i){return function(a){var r,o={nodes:[],records:{}};if(t((function(e){o.records[e.name]={}})),!a)return o;n(a,o);do{r=!1,e(s)}while(r);function s(e){!function(e,t){return Ve.indexOf(t.nodes,e)>=0}(e,o)&&function(e,n){var a=!1;return t((function(t){Ve.each(i(e,t)||[],(function(e){n.records[t.name][e]&&(a=!0)}))})),a}(e,o)&&(n(e,o),r=!0)}return o};function n(e,n){n.nodes.push(e),t((function(t){Ve.each(i(e,t)||[],(function(e){n.records[t.name][e]=!0}))}))}}},SB=Ve.each,MB=Pc.asc,IB=function(e,t,i,n){this._dimName=e,this._axisIndex=t,this._valueWindow,this._percentWindow,this._dataExtent,this._minMaxSpan,this.ecModel=n,this._dataZoomModel=i};function TB(e,t){var i=e.getAxisModel(),n=e._percentWindow,a=e._valueWindow;if(n){var r=Pc.getPixelPrecision(a,[0,500]);r=Math.min(r,20);var o=t||0===n[0]&&100===n[1];i.setRange(o?null:+a[0].toFixed(r),o?null:+a[1].toFixed(r))}}IB.prototype={constructor:IB,hostedBy:function(e){return this._dataZoomModel===e},getDataValueWindow:function(){return this._valueWindow.slice()},getDataPercentWindow:function(){return this._percentWindow.slice()},getTargetSeriesModels:function(){var e=[],t=this.ecModel;return t.eachSeries((function(i){if(wB.isCoordSupported(i.get("coordinateSystem"))){var n=this._dimName,a=t.queryComponents({mainType:n+"Axis",index:i.get(n+"AxisIndex"),id:i.get(n+"AxisId")})[0];this._axisIndex===(a&&a.componentIndex)&&e.push(i)}}),this),e},getAxisModel:function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},getOtherAxisModel:function(){var e,t,i,n=this._dimName,a=this.ecModel,r=this.getAxisModel();return"x"===n||"y"===n?(t="gridIndex",e="x"===n?"y":"x"):(t="polarIndex",e="angle"===n?"radius":"angle"),a.eachComponent(e+"Axis",(function(e){(e.get(t)||0)===(r.get(t)||0)&&(i=e)})),i},getMinMaxSpan:function(){return Ve.clone(this._minMaxSpan)},calculateDataWindow:function(e){var t,i=this._dataExtent,n=this.getAxisModel().axis.scale,a=this._dataZoomModel.getRangePropMode(),r=[0,100],o=[],s=[];SB(["start","end"],(function(l,u){var h=e[l],c=e[l+"Value"];"percent"===a[u]?(null==h&&(h=r[u]),c=n.parse(Pc.linearMap(h,r,i))):(t=!0,c=null==c?i[u]:n.parse(c),h=Pc.linearMap(c,i,r)),s[u]=c,o[u]=h})),MB(s),MB(o);var l=this._minMaxSpan;function u(e,t,i,a,r){var o=r?"Span":"ValueSpan";LL(0,e,i,"all",l["min"+o],l["max"+o]);for(var s=0;s<2;s++)t[s]=Pc.linearMap(e[s],i,a,!0),r&&(t[s]=n.parse(t[s]))}return t?u(s,o,i,r,!1):u(o,s,r,i,!0),{valueWindow:s,percentWindow:o}},reset:function(e){if(e===this._dataZoomModel){var t=this.getTargetSeriesModels();this._dataExtent=function(e,t,i){var n=[1/0,-1/0];SB(i,(function(e){var i=e.getData();i&&SB(i.mapDimension(t,!0),(function(e){var t=i.getApproximateExtent(e);t[0]<n[0]&&(n[0]=t[0]),t[1]>n[1]&&(n[1]=t[1])}))})),n[1]<n[0]&&(n=[NaN,NaN]);return function(e,t){var i=e.getAxisModel(),n=i.getMin(!0),a="category"===i.get("type"),r=a&&i.getCategories().length;null!=n&&"dataMin"!==n&&"function"!=typeof n?t[0]=n:a&&(t[0]=r>0?0:NaN);var o=i.getMax(!0);null!=o&&"dataMax"!==o&&"function"!=typeof o?t[1]=o:a&&(t[1]=r>0?r-1:NaN);i.get("scale",!0)||(t[0]>0&&(t[0]=0),t[1]<0&&(t[1]=0))}(e,n),n}(this,this._dimName,t),function(e){var t=e._minMaxSpan={},i=e._dataZoomModel,n=e._dataExtent;SB(["min","max"],(function(a){var r=i.get(a+"Span"),o=i.get(a+"ValueSpan");null!=o&&(o=e.getAxisModel().axis.scale.parse(o)),null!=o?r=Pc.linearMap(n[0]+o,n,[0,100],!0):null!=r&&(o=Pc.linearMap(r,[0,100],n,!0)-n[0]),t[a+"Span"]=r,t[a+"ValueSpan"]=o}))}(this);var i=this.calculateDataWindow(e.settledOption);this._valueWindow=i.valueWindow,this._percentWindow=i.percentWindow,TB(this)}},restore:function(e){e===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,TB(this,!0))},filterData:function(e,t){if(e===this._dataZoomModel){var i=this._dimName,n=this.getTargetSeriesModels(),a=e.get("filterMode"),r=this._valueWindow;"none"!==a&&SB(n,(function(e){var t=e.getData(),n=t.mapDimension(i,!0);n.length&&("weakFilter"===a?t.filterSelf((function(e){for(var i,a,o,s=0;s<n.length;s++){var l=t.get(n[s],e),u=!isNaN(l),h=l<r[0],c=l>r[1];if(u&&!h&&!c)return!0;u&&(o=!0),h&&(i=!0),c&&(a=!0)}return o&&i&&a})):SB(n,(function(i){if("empty"===a)e.setData(t=t.map(i,(function(e){return function(e){return e>=r[0]&&e<=r[1]}(e)?e:NaN})));else{var n={};n[i]=r,t.selectRange(n)}})),SB(n,(function(e){t.setApproximateExtent(r,e)})))}))}}};var AB=IB,CB=Ve.each,DB=wB.eachAxisDim,LB=X_.extendComponentModel({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(e,t,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=PB(e);this.settledOption=n,this.mergeDefaultAndTheme(e,i),this.doInit(n)},mergeOption:function(e){var t=PB(e);Ve.merge(this.option,e,!0),Ve.merge(this.settledOption,t,!0),this.doInit(t)},doInit:function(e){var t=this.option;ie.canvasSupported||(t.realtime=!1),this._setDefaultThrottle(e),kB(this,e);var i=this.settledOption;CB([["start","startValue"],["end","endValue"]],(function(e,n){"value"===this._rangePropMode[n]&&(t[e[0]]=i[e[0]]=null)}),this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var e=this._axisProxies;this.eachTargetAxis((function(t,i,n,a){var r=this.dependentModels[t.axis][i],o=r.__dzAxisProxy||(r.__dzAxisProxy=new AB(t.name,i,this,a));e[t.name+"_"+i]=o}),this)},_resetTarget:function(){var e=this.option,t=this._judgeAutoMode();DB((function(t){var i=t.axisIndex;e[i]=Ro.normalizeToArray(e[i])}),this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,t=!1;DB((function(i){null!=e[i.axisIndex]&&(t=!0)}),this);var i=e.orient;return null==i&&t?"orient":t?void 0:(null==i&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var e=!0,t=this.get("orient",!0),i=this.option,n=this.dependentModels;if(e){var a="vertical"===t?"y":"x";n[a+"Axis"].length?(i[a+"AxisIndex"]=[0],e=!1):CB(n.singleAxis,(function(n){e&&n.get("orient",!0)===t&&(i.singleAxisIndex=[n.componentIndex],e=!1)}))}e&&DB((function(t){if(e){var n=[],a=this.dependentModels[t.axis];if(a.length&&!n.length)for(var r=0,o=a.length;r<o;r++)"category"===a[r].get("type")&&n.push(r);i[t.axisIndex]=n,n.length&&(e=!1)}}),this),e&&this.ecModel.eachSeries((function(e){this._isSeriesHasAllAxesTypeOf(e,"value")&&DB((function(t){var n=i[t.axisIndex],a=e.get(t.axisIndex),r=e.get(t.axisId);a=e.ecModel.queryComponents({mainType:t.axis,index:a,id:r})[0].componentIndex,Ve.indexOf(n,a)<0&&n.push(a)}))}),this)},_autoSetOrient:function(){var e;this.eachTargetAxis((function(t){!e&&(e=t.name)}),this),this.option.orient="y"===e?"vertical":"horizontal"},_isSeriesHasAllAxesTypeOf:function(e,t){var i=!0;return DB((function(n){var a=e.get(n.axisIndex),r=this.dependentModels[n.axis][a];r&&r.get("type")===t||(i=!1)}),this),i},_setDefaultThrottle:function(e){if(e.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},getFirstTargetAxisModel:function(){var e;return DB((function(t){if(null==e){var i=this.get(t.axisIndex);i.length&&(e=this.dependentModels[t.axis][i[0]])}}),this),e},eachTargetAxis:function(e,t){var i=this.ecModel;DB((function(n){CB(this.get(n.axisIndex),(function(a){e.call(t,n,a,this,i)}),this)}),this)},getAxisProxy:function(e,t){return this._axisProxies[e+"_"+t]},getAxisModel:function(e,t){var i=this.getAxisProxy(e,t);return i&&i.getAxisModel()},setRawRange:function(e){var t=this.option,i=this.settledOption;CB([["start","startValue"],["end","endValue"]],(function(n){null==e[n[0]]&&null==e[n[1]]||(t[n[0]]=i[n[0]]=e[n[0]],t[n[1]]=i[n[1]]=e[n[1]])}),this),kB(this,e)},setCalculatedRange:function(e){var t=this.option;CB(["start","startValue","end","endValue"],(function(i){t[i]=e[i]}))},getPercentRange:function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},getValueRange:function(e,t){if(null!=e||null!=t)return this.getAxisProxy(e,t).getDataValueWindow();var i=this.findRepresentativeAxisProxy();return i?i.getDataValueWindow():void 0},findRepresentativeAxisProxy:function(e){if(e)return e.__dzAxisProxy;var t=this._axisProxies;for(var i in t)if(t.hasOwnProperty(i)&&t[i].hostedBy(this))return t[i];for(var i in t)if(t.hasOwnProperty(i)&&!t[i].hostedBy(this))return t[i]},getRangePropMode:function(){return this._rangePropMode.slice()}});function PB(e){var t={};return CB(["start","end","startValue","endValue","throttle"],(function(i){e.hasOwnProperty(i)&&(t[i]=e[i])})),t}function kB(e,t){var i=e._rangePropMode,n=e.get("rangeMode");CB([["start","startValue"],["end","endValue"]],(function(e,a){var r=null!=t[e[0]],o=null!=t[e[1]];r&&!o?i[a]="percent":!r&&o?i[a]="value":n?i[a]=n[a]:r&&(i[a]="percent")}))}var OB=LB,RB=ug.extend({type:"dataZoom",render:function(e,t,i,n){this.dataZoomModel=e,this.ecModel=t,this.api=i},getTargetCoordInfo:function(){var e=this.dataZoomModel,t=this.ecModel,i={};return e.eachTargetAxis((function(e,n){var a=t.getComponent(e.axis,n);if(a){var r=a.getCoordSysModel();r&&function(e,t,i,n){for(var a,r=0;r<i.length;r++)if(i[r].model===e){a=i[r];break}a||i.push(a={model:e,axisModels:[],coordIndex:n});a.axisModels.push(t)}(r,a,i[r.mainType]||(i[r.mainType]=[]),r.componentIndex)}}),this),i}}),EB=RB;OB.extend({type:"dataZoom.select"}),EB.extend({type:"dataZoom.select"});var NB=Ve.createHashMap,zB=Ve.each;X_.registerProcessor({getTargetSeries:function(e){var t=NB();return e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(e,i,n){var a=n.getAxisProxy(e.name,i);zB(a.getTargetSeriesModels(),(function(e){t.set(e.uid,e)}))}))})),t},modifyOutputEnd:!0,overallReset:function(e,t){e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(e,i,n){n.getAxisProxy(e.name,i).reset(n,t)})),e.eachTargetAxis((function(e,i,n){n.getAxisProxy(e.name,i).filterData(n,t)}))})),e.eachComponent("dataZoom",(function(e){var t=e.findRepresentativeAxisProxy(),i=t.getDataPercentWindow(),n=t.getDataValueWindow();e.setCalculatedRange({start:i[0],end:i[1],startValue:n[0],endValue:n[1]})}))}}),X_.registerAction("dataZoom",(function(e,t){var i=wB.createLinkedNodesFinder(Ve.bind(t.eachComponent,t,"dataZoom"),wB.eachAxisDim,(function(e,t){return e.get(t.axisIndex)})),n=[];t.eachComponent({mainType:"dataZoom",query:e},(function(e,t){n.push.apply(n,i(e).nodes)})),Ve.each(n,(function(t,i){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}));var BB=kg.toolbox.dataZoom,VB=Ve.each;function FB(e,t,i){(this._brushController=new EP(i.getZr())).on("brush",Ve.bind(this._onBrush,this)).mount(),this._isZoomActive}FB.defaultOption={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:Ve.clone(BB.title)};var GB=FB.prototype;GB.render=function(e,t,i,n){this.model=e,this.ecModel=t,this.api=i,function(e,t,i,n,a){var r=i._isZoomActive;n&&"takeGlobalCursor"===n.type&&(r="dataZoomSelect"===n.key&&n.dataZoomSelectActive);i._isZoomActive=r,e.setIconStatus("zoom",r?"emphasis":"normal");var o=new dB(WB(e.option),t,{include:["grid"]});i._brushController.setPanels(o.makePanelOpts(a,(function(e){return e.xAxisDeclared&&!e.yAxisDeclared?"lineX":!e.xAxisDeclared&&e.yAxisDeclared?"lineY":"rect"}))).enableBrush(!!r&&{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}})}(e,t,this,n,i),function(e,t){e.setIconStatus("back",yB.count(t)>1?"emphasis":"normal")}(e,t)},GB.onclick=function(e,t,i){HB[i].call(this)},GB.remove=function(e,t){this._brushController.unmount()},GB.dispose=function(e,t){this._brushController.dispose()};var HB={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(yB.pop(this.ecModel))}};function WB(e){var t={};return Ve.each(["xAxisIndex","yAxisIndex"],(function(i){t[i]=e[i],null==t[i]&&(t[i]="all"),(!1===t[i]||"none"===t[i])&&(t[i]=[])})),t}GB._onBrush=function(e,t){if(t.isEnd&&e.length){var i={},n=this.ecModel;this._brushController.updateCovers([]),new dB(WB(this.model.option),n,{include:["grid"]}).matchOutputRanges(e,n,(function(e,t,i){if("cartesian2d"===i.type){var n=e.brushType;"rect"===n?(a("x",i,t[0]),a("y",i,t[1])):a({lineX:"x",lineY:"y"}[n],i,t)}})),yB.push(n,i),this._dispatchZoomAction(i)}function a(e,t,a){var r=t.getAxis(e),o=r.model,s=function(e,t,i){var n;return i.eachComponent({mainType:"dataZoom",subType:"select"},(function(i){i.getAxisModel(e,t.componentIndex)&&(n=i)})),n}(e,o,n),l=s.findRepresentativeAxisProxy(o).getMinMaxSpan();null==l.minValueSpan&&null==l.maxValueSpan||(a=LL(0,a.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:a[0],endValue:a[1]})}},GB._dispatchZoomAction=function(e){var t=[];VB(e,(function(e,i){t.push(Ve.clone(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},Iz.register("dataZoom",FB),X_.registerPreprocessor((function(e){if(e){var t=e.dataZoom||(e.dataZoom=[]);Ve.isArray(t)||(e.dataZoom=t=[t]);var i=e.toolbox;if(i&&(Ve.isArray(i)&&(i=i[0]),i&&i.feature)){var n=i.feature.dataZoom;a("xAxis",n),a("yAxis",n)}}function a(i,n){if(n){var a=i+"Index",r=n[a];null==r||"all"===r||Ve.isArray(r)||(r=!1===r||"none"===r?[]:[r]),function(t,i){var n=e[t];Ve.isArray(n)||(n=n?[n]:[]);VB(n,i)}(i,(function(e,o){if(null==r||"all"===r||-1!==Ve.indexOf(r,o)){var s={type:"select",$fromToolbox:!0,filterMode:n.filterMode||"filter",id:"\0_ec_\0toolbox-dataZoom_"+i+o};s[a]=o,t.push(s)}}))}}}));var UB=kg.toolbox.restore;function jB(e){this.model=e}jB.defaultOption={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:UB.title},jB.prototype.onclick=function(e,t,i){yB.clear(e),t.dispatchAction({type:"restore",from:this.uid})},Iz.register("restore",jB),X_.registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")})),X_.extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});var ZB=Ve.each,YB=Uc.toCamelCase,XB=["","-webkit-","-moz-","-o-"];function qB(e){var t,i,n,a=[],r=e.get("transitionDuration"),o=e.get("backgroundColor"),s=e.getModel("textStyle"),l=e.get("padding");return r&&a.push((n="left "+(t=r)+"s "+(i="cubic-bezier(0.23, 1, 0.32, 1)")+",top "+t+"s "+i,Ve.map(XB,(function(e){return e+"transition:"+n})).join(";"))),o&&(ie.canvasSupported?a.push("background-Color:"+o):(a.push("background-Color:#"+Ui.toHex(o)),a.push("filter:alpha(opacity=70)"))),ZB(["width","color","radius"],(function(t){var i="border-"+t,n=YB(i),r=e.get(n);null!=r&&a.push(i+":"+r+("color"===t?"":"px"))})),a.push(function(e){var t=[],i=e.get("fontSize"),n=e.getTextColor();return n&&t.push("color:"+n),t.push("font:"+e.getFont()),i&&t.push("line-height:"+Math.round(3*i/2)+"px"),ZB(["decoration","align"],(function(i){var n=e.get(i);n&&t.push("text-"+i+":"+n)})),t.join(";")}(s)),null!=l&&a.push("padding:"+Uc.normalizeCssArray(l).join("px ")+"px"),a.join(";")+";"}function $B(e,t,i,n,a){var r=t&&t.painter;if(i){var o=r&&r.getViewportRoot();o&&It.transformLocalCoord(e,o,document.body,n,a)}else{e[0]=n,e[1]=a;var s=r&&r.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}}function KB(e,t,i){if(ie.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var a=this._zr=t.getZr(),r=this._appendToBody=i&&i.appendToBody;this._styleCoord=[0,0],$B(this._styleCoord,a,r,t.getWidth()/2,t.getHeight()/2),r?document.body.appendChild(n):e.appendChild(n),this._container=e,this._show=!1,this._hideTimeout;var o=this;n.onmouseenter=function(){o._enterable&&(clearTimeout(o._hideTimeout),o._show=!0),o._inContent=!0},n.onmousemove=function(e){if(e=e||window.event,!o._enterable){var t=a.handler,i=a.painter.getViewportRoot();Et.normalizeEvent(i,e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){o._enterable&&o._show&&o.hideLater(o._hideDelay),o._inContent=!1}}KB.prototype={constructor:KB,_enterable:!0,update:function(){var e=this._container,t=e.currentStyle||document.defaultView.getComputedStyle(e),i=e.style;"absolute"!==i.position&&"absolute"!==t.position&&(i.position="relative")},show:function(e){clearTimeout(this._hideTimeout);var t=this.el,i=this._styleCoord;t.style.cssText="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+qB(e)+";left:"+i[0]+"px;top:"+i[1]+"px;"+(e.get("extraCssText")||""),t.style.display=t.innerHTML?"block":"none",t.style.pointerEvents=this._enterable?"auto":"none",this._show=!0},setContent:function(e){this.el.innerHTML=null==e?"":e},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el;return[e.clientWidth,e.clientHeight]},moveTo:function(e,t){var i=this._styleCoord;$B(i,this._zr,this._appendToBody,e,t);var n=this.el.style;n.left=i[0]+"px",n.top=i[1]+"px"},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Ve.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},dispose:function(){this.el.parentNode.removeChild(this.el)},getOuterSize:function(){var e=this.el.clientWidth,t=this.el.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var i=document.defaultView.getComputedStyle(this.el);i&&(e+=parseInt(i.borderLeftWidth,10)+parseInt(i.borderRightWidth,10),t+=parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10))}return{width:e,height:t}}};var JB=KB;function QB(e){this._zr=e.getZr(),this._show=!1,this._hideTimeout}QB.prototype={constructor:QB,_enterable:!0,update:function(){},show:function(e){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.attr("show",!0),this._show=!0},setContent:function(e,t,i){this.el&&this._zr.remove(this.el);for(var n={},a=e,r="{marker",o=a.indexOf(r);o>=0;){var s=a.indexOf("|}"),l=a.substr(o+7,s-o-7);l.indexOf("sub")>-1?n["marker"+l]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:t[l],textOffset:[3,0]}:n["marker"+l]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:t[l]},o=(a=a.substr(s+1)).indexOf("{marker")}this.el=new Wl({style:{rich:n,text:e,textLineHeight:20,textBackgroundColor:i.get("backgroundColor"),textBorderRadius:i.get("borderRadius"),textFill:i.get("textStyle.color"),textPadding:i.get("padding")},z:i.get("z")}),this._zr.add(this.el);var u=this;this.el.on("mouseover",(function(){u._enterable&&(clearTimeout(u._hideTimeout),u._show=!0),u._inContent=!0})),this.el.on("mouseout",(function(){u._enterable&&u._show&&u.hideLater(u._hideDelay),u._inContent=!1}))},setEnterable:function(e){this._enterable=e},getSize:function(){var e=this.el.getBoundingRect();return[e.width,e.height]},moveTo:function(e,t){this.el&&this.el.attr("position",[e,t])},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(e){!this._show||this._inContent&&this._enterable||(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Ve.bind(this.hide,this),e)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){var e=this.getSize();return{width:e[0],height:e[1]}}};var eV=QB,tV=Ro.getTooltipRenderMode,iV=Ve.bind,nV=Ve.each,aV=Pc.parsePercent,rV=new tc.Rect({shape:{x:-1,y:-1,width:2,height:2}});function oV(e){for(var t=e.pop();e.length;){var i=e.pop();i&&(mc.isInstance(i)&&(i=i.get("tooltip",!0)),"string"==typeof i&&(i={formatter:i}),t=new mc(i,t,t.ecModel))}return t}function sV(e,t){return e.dispatchAction||Ve.bind(t.dispatchAction,t)}function lV(e){return"center"===e||"middle"===e}X_.extendComponentView({type:"tooltip",init:function(e,t){if(!ie.node){var i,n=e.getComponent("tooltip"),a=n.get("renderMode");this._renderMode=tV(a),"html"===this._renderMode?(i=new JB(t.getDom(),t,{appendToBody:n.get("appendToBody",!0)}),this._newLine="<br/>"):(i=new eV(t),this._newLine="\n"),this._tooltipContent=i}},render:function(e,t,i){if(!ie.node){this.group.removeAll(),this._tooltipModel=e,this._ecModel=t,this._api=i,this._lastDataByCoordSys=null,this._alwaysShowContent=e.get("alwaysShowContent");var n=this._tooltipContent;n.update(),n.setEnterable(e.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var e=this._tooltipModel.get("triggerOn");QR.register("itemTooltip",this._api,iV((function(t,i,n){"none"!==e&&(e.indexOf(t)>=0?this._tryShow(i,n):"leave"===t&&this._hide(n))}),this))},_keepShow:function(){var e=this._tooltipModel,t=this._ecModel,i=this._api;if(null!=this._lastX&&null!=this._lastY&&"none"!==e.get("triggerOn")){var n=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout((function(){!i.isDisposed()&&n.manuallyShowTip(e,t,i,{x:n._lastX,y:n._lastY})}))}},manuallyShowTip:function(e,t,i,n){if(n.from!==this.uid&&!ie.node){var a=sV(n,i);this._ticket="";var r=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var o=rV;o.position=[n.x,n.y],o.update(),o.tooltip=n.tooltip,this._tryShow({offsetX:n.x,offsetY:n.y,target:o},a)}else if(r)this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,dataByCoordSys:n.dataByCoordSys,tooltipOption:n.tooltipOption},a);else if(null!=n.seriesIndex){if(this._manuallyAxisShowTip(e,t,i,n))return;var s=zR(n,t),l=s.point[0],u=s.point[1];null!=l&&null!=u&&this._tryShow({offsetX:l,offsetY:u,position:n.position,target:s.el},a)}else null!=n.x&&null!=n.y&&(i.dispatchAction({type:"updateAxisPointer",x:n.x,y:n.y}),this._tryShow({offsetX:n.x,offsetY:n.y,position:n.position,target:i.getZr().findHover(n.x,n.y).target},a))}},manuallyHideTip:function(e,t,i,n){var a=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&a.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,n.from!==this.uid&&this._hide(sV(n,i))},_manuallyAxisShowTip:function(e,t,i,n){var a=n.seriesIndex,r=n.dataIndex,o=t.getComponent("axisPointer").coordSysAxesInfo;if(null!=a&&null!=r&&null!=o){var s=t.getSeriesByIndex(a);if(s)if("axis"===(e=oV([s.getData().getItemModel(r),s,(s.coordinateSystem||{}).model,e])).get("trigger"))return i.dispatchAction({type:"updateAxisPointer",seriesIndex:a,dataIndex:r,position:n.position}),!0}},_tryShow:function(e,t){var i=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var n=e.dataByCoordSys;n&&n.length?this._showAxisTooltip(n,e):i&&null!=i.dataIndex?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(e,i,t)):i&&i.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(e,i,t)):(this._lastDataByCoordSys=null,this._hide(t))}},_showOrMove:function(e,t){var i=e.get("showDelay");t=Ve.bind(t,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(t,i):t()},_showAxisTooltip:function(e,t){var i=this._ecModel,n=this._tooltipModel,a=[t.offsetX,t.offsetY],r=[],o=[],s=oV([t.tooltipOption,n]),l=this._renderMode,u=this._newLine,h={};nV(e,(function(e){nV(e.dataByAxis,(function(e){var t=i.getComponent(e.axisDim+"Axis",e.axisIndex),n=e.value,a=[];if(t&&null!=n){var s=gE.getValueLabel(n,t.axis,i,e.seriesDataIndices,e.valueLabelOpt);Ve.each(e.seriesDataIndices,(function(r){var u=i.getSeriesByIndex(r.seriesIndex),c=r.dataIndexInside,d=u&&u.getDataParams(c);if(d.axisDim=e.axisDim,d.axisIndex=e.axisIndex,d.axisType=e.axisType,d.axisId=e.axisId,d.axisValue=Px.getAxisRawValue(t.axis,n),d.axisValueLabel=s,d){o.push(d);var p,f=u.formatTooltip(c,!0,null,l);if(Ve.isObject(f)){p=f.html;var g=f.markers;Ve.merge(h,g)}else p=f;a.push(p)}}));var c=s;"html"!==l?r.push(a.join(u)):r.push((c?Uc.encodeHTML(c)+u:"")+a.join(u))}}))}),this),r.reverse(),r=r.join(this._newLine+this._newLine);var c=t.position;this._showOrMove(s,(function(){this._updateContentNotChangedOnAxis(e)?this._updatePosition(s,c,a[0],a[1],this._tooltipContent,o):this._showTooltipContent(s,r,o,Math.random(),a[0],a[1],c,void 0,h)}))},_showSeriesItemTooltip:function(e,t,i){var n=this._ecModel,a=t.seriesIndex,r=n.getSeriesByIndex(a),o=t.dataModel||r,s=t.dataIndex,l=t.dataType,u=o.getData(l),h=oV([u.getItemModel(s),o,r&&(r.coordinateSystem||{}).model,this._tooltipModel]),c=h.get("trigger");if(null==c||"item"===c){var d,p,f=o.getDataParams(s,l),g=o.formatTooltip(s,!1,l,this._renderMode);Ve.isObject(g)?(d=g.html,p=g.markers):(d=g,p=null);var m="item_"+o.name+"_"+s;this._showOrMove(h,(function(){this._showTooltipContent(h,d,f,m,e.offsetX,e.offsetY,e.position,e.target,p)})),i({type:"showTip",dataIndexInside:s,dataIndex:u.getRawIndex(s),seriesIndex:a,from:this.uid})}},_showComponentItemTooltip:function(e,t,i){var n=t.tooltip;if("string"==typeof n){n={content:n,formatter:n}}var a=new mc(n,this._tooltipModel,this._ecModel),r=a.get("content"),o=Math.random();this._showOrMove(a,(function(){this._showTooltipContent(a,r,a.get("formatterParams")||{},o,e.offsetX,e.offsetY,e.position,t)})),i({type:"showTip",from:this.uid})},_showTooltipContent:function(e,t,i,n,a,r,o,s,l){if(this._ticket="",e.get("showContent")&&e.get("show")){var u=this._tooltipContent,h=e.get("formatter");o=o||e.get("position");var c=t;if(h&&"string"==typeof h)c=Uc.formatTpl(h,i,!0);else if("function"==typeof h){var d=iV((function(t,n){t===this._ticket&&(u.setContent(n,l,e),this._updatePosition(e,o,a,r,u,i,s))}),this);this._ticket=n,c=h(i,n,d)}u.setContent(c,l,e),u.show(e),this._updatePosition(e,o,a,r,u,i,s)}},_updatePosition:function(e,t,i,n,a,r,o){var s=this._api.getWidth(),l=this._api.getHeight();t=t||e.get("position");var u=a.getSize(),h=e.get("align"),c=e.get("verticalAlign"),d=o&&o.getBoundingRect().clone();if(o&&d.applyTransform(o.transform),"function"==typeof t&&(t=t([i,n],r,a.el,d,{viewSize:[s,l],contentSize:u.slice()})),Ve.isArray(t))i=aV(t[0],s),n=aV(t[1],l);else if(Ve.isObject(t)){t.width=u[0],t.height=u[1];var p=nd.getLayoutRect(t,{width:s,height:l});i=p.x,n=p.y,h=null,c=null}else if("string"==typeof t&&o){var f=function(e,t,i){var n=i[0],a=i[1],r=5,o=0,s=0,l=t.width,u=t.height;switch(e){case"inside":o=t.x+l/2-n/2,s=t.y+u/2-a/2;break;case"top":o=t.x+l/2-n/2,s=t.y-a-r;break;case"bottom":o=t.x+l/2-n/2,s=t.y+u+r;break;case"left":o=t.x-n-r,s=t.y+u/2-a/2;break;case"right":o=t.x+l+r,s=t.y+u/2-a/2}return[o,s]}(t,d,u);i=f[0],n=f[1]}else{f=function(e,t,i,n,a,r,o){var s=i.getOuterSize(),l=s.width,u=s.height;null!=r&&(e+l+r>n?e-=l+r:e+=r);null!=o&&(t+u+o>a?t-=u+o:t+=o);return[e,t]}(i,n,a,s,l,h?null:20,c?null:20);i=f[0],n=f[1]}if(h&&(i-=lV(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=lV(c)?u[1]/2:"bottom"===c?u[1]:0),e.get("confine")){f=function(e,t,i,n,a){var r=i.getOuterSize(),o=r.width,s=r.height;return e=Math.min(e+o,n)-o,t=Math.min(t+s,a)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}(i,n,a,s,l);i=f[0],n=f[1]}a.moveTo(i,n)},_updateContentNotChangedOnAxis:function(e){var t=this._lastDataByCoordSys,i=!!t&&t.length===e.length;return i&&nV(t,(function(t,n){var a=t.dataByAxis||{},r=(e[n]||{}).dataByAxis||[];(i&=a.length===r.length)&&nV(a,(function(e,t){var n=r[t]||{},a=e.seriesDataIndices||[],o=n.seriesDataIndices||[];(i&=e.value===n.value&&e.axisType===n.axisType&&e.axisId===n.axisId&&a.length===o.length)&&nV(a,(function(e,t){var n=o[t];i&=e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}))}))})),this._lastDataByCoordSys=e,!!i},_hide:function(e){this._lastDataByCoordSys=null,e({type:"hideTip",from:this.uid})},dispose:function(e,t){ie.node||(this._tooltipContent.dispose(),QR.unregister("itemTooltip",t))}}),X_.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),X_.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}));var uV=["rect","polygon","keep","clear"];var hV=function(e,t){var i=e&&e.brush;if(Ve.isArray(i)||(i=i?[i]:[]),i.length){var n=[];Ve.each(i,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(n=n.concat(t))}));var a=e&&e.toolbox;Ve.isArray(a)&&(a=a[0]),a||(a={feature:{}},e.toolbox=[a]);var r=a.feature||(a.feature={}),o=r.brush||(r.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),function(e){var t={};Ve.each(e,(function(e){t[e]=1})),e.length=0,Ve.each(t,(function(t,i){e.push(i)}))}(s),t&&!s.length&&s.push.apply(s,uV)}},cV=Ve.each;function dV(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}var pV=function(e,t,i){var n;Ve.each(i,(function(e){t.hasOwnProperty(e)&&dV(t[e])&&(n=!0)})),n&&Ve.each(i,(function(i){t.hasOwnProperty(i)&&dV(t[i])?e[i]=Ve.clone(t[i]):delete e[i]}))},fV=function(e,t,i,n,a,r){var o,s={};function l(e){return i.getItemVisual(o,e)}function u(e,t){i.setItemVisual(o,e,t)}function h(e,h){o=null==r?e:h;var c=i.getRawDataItem(o);if(!c||!1!==c.visualMap)for(var d=n.call(a,e),p=t[d],f=s[d],g=0,m=f.length;g<m;g++){var v=f[g];p[v]&&p[v].applyVisual(e,l,u)}}Ve.each(e,(function(e){var i=pC.prepareVisualTypes(t[e]);s[e]=i})),null==r?i.each(h):i.each([r],h)},gV=function(e,t,i,n){var a={};return Ve.each(e,(function(e){var i=pC.prepareVisualTypes(t[e]);a[e]=i})),{progress:function(e,r){function o(e){return r.getItemVisual(l,e)}function s(e,t){r.setItemVisual(l,e,t)}var l;for(null!=n&&(n=r.getDimension(n));null!=(l=e.next());){var u=r.getRawDataItem(l);if(!u||!1!==u.visualMap)for(var h=null!=n?r.get(n,l,!0):l,c=i(h),d=t[c],p=a[c],f=0,g=p.length;f<g;f++){var m=p[f];d[m]&&d[m].applyVisual(h,o,s)}}}}},mV={createVisualMappings:function(e,t,i){var n={};return cV(t,(function(t){var a,r=n[t]=((a=function(){}).prototype.__hidden=a.prototype,new a);cV(e[t],(function(e,n){if(pC.isValidType(n)){var a={type:n,visual:e};i&&i(a,t),r[n]=new pC(a),"opacity"===n&&((a=Ve.clone(a)).type="colorAlpha",r.__hidden.__alphaForOpacity=new pC(a))}}))})),n},replaceVisualOption:pV,applyVisual:fV,incrementalApplyVisual:gV},vV=tc.linePolygonIntersect,yV={lineX:xV(0),lineY:xV(1),rect:{point:function(e,t,i){return e&&i.boundingRect.contain(e[0],e[1])},rect:function(e,t,i){return e&&i.boundingRect.intersect(e)}},polygon:{point:function(e,t,i){return e&&i.boundingRect.contain(e[0],e[1])&&i_.contain(i.range,e[0],e[1])},rect:function(e,t,i){var n=i.range;if(!e||n.length<=1)return!1;var a=e.x,r=e.y,o=e.width,s=e.height,l=n[0];return!!(i_.contain(n,a,r)||i_.contain(n,a+o,r)||i_.contain(n,a,r+s)||i_.contain(n,a+o,r+s)||Pn.create(e).contain(l[0],l[1])||vV(a,r,a+o,r,n)||vV(a,r,a,r+s,n)||vV(a+o,r,a+o,r+s,n)||vV(a,r+s,a+o,r+s,n))||void 0}}};function xV(e){var t=["x","y"],i=["width","height"];return{point:function(t,i,n){if(t){var a=n.range;return _V(t[e],a)}},rect:function(n,a,r){if(n){var o=r.range,s=[n[t[e]],n[t[e]]+n[i[e]]];return s[1]<s[0]&&s.reverse(),_V(s[0],o)||_V(s[1],o)||_V(o[0],s)||_V(o[1],s)}}}}function _V(e,t){return t[0]<=e&&e<=t[1]}var bV=yV,wV=["inBrush","outOfBrush"],SV="__ecBrushSelect",MV="__ecInBrushSelectEvent",IV=X_.PRIORITY.VISUAL.BRUSH;function TV(e){e.eachComponent({mainType:"brush"},(function(t){(t.brushTargetManager=new dB(t.option,e)).setInputRanges(t.areas,e)}))}function AV(e,t){if(!e.isDisposed()){var i=e.getZr();i[MV]=!0,e.dispatchAction({type:"brushSelect",batch:t}),i[MV]=!1}}function CV(e,t,i,n){for(var a=0,r=t.length;a<r;a++){var o=t[a];if(e[o.brushType](n,i,o.selectors,o))return!0}}function DV(e){var t=e.brushSelector;if(Ve.isString(t)){var i=[];return Ve.each(bV,(function(e,n){i[n]=function(i,n,a,r){var o=n.getItemLayout(i);return e[t](o,a,r)}})),i}if(Ve.isFunction(t)){var n={};return Ve.each(bV,(function(e,i){n[i]=t})),n}return t}X_.registerLayout(IV,(function(e,t,i){e.eachComponent({mainType:"brush"},(function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1})})),TV(e)})),X_.registerVisual(IV,(function(e,t,i){var n,a,r=[];e.eachComponent({mainType:"brush"},(function(t,i){var o={brushId:t.id,brushIndex:i,brushName:t.name,areas:Ve.clone(t.areas),selected:[]};r.push(o);var s=t.option,l=s.brushLink,u=[],h=[],c=[],d=0;i||(n=s.throttleType,a=s.throttleDelay);var p=Ve.map(t.areas,(function(e){return function(e){var t=e.selectors={};return Ve.each(bV[e.brushType],(function(i,n){t[n]=function(n){return i(n,t,e)}})),e}(Ve.defaults({boundingRect:LV[e.brushType](e)},e))})),f=mV.createVisualMappings(t.option,wV,(function(e){e.mappingMethod="fixed"}));function g(e){return"all"===l||u[e]}function m(e){return!!e.length}Ve.isArray(l)&&Ve.each(l,(function(e){u[e]=1})),e.eachSeries((function(i,n){var a=c[n]=[];"parallel"===i.subType?function(e,t){var i=e.coordinateSystem;d|=i.hasAxisBrushed(),g(t)&&i.eachActiveState(e.getData(),(function(e,t){"active"===e&&(h[t]=1)}))}(i,n):function(i,n,a){var r=DV(i);if(!r||function(e,t){var i=e.option.seriesIndex;return null!=i&&"all"!==i&&(Ve.isArray(i)?Ve.indexOf(i,t)<0:t!==i)}(t,n))return;if(Ve.each(p,(function(n){r[n.brushType]&&t.brushTargetManager.controlSeries(n,i,e)&&a.push(n),d|=m(a)})),g(n)&&m(a)){var o=i.getData();o.each((function(e){CV(r,a,o,e)&&(h[e]=1)}))}}(i,n,a)})),e.eachSeries((function(e,t){var i={seriesId:e.id,seriesIndex:t,seriesName:e.name,dataIndex:[]};o.selected.push(i);var n=DV(e),a=c[t],r=e.getData(),s=g(t)?function(e){return h[e]?(i.dataIndex.push(r.getRawIndex(e)),"inBrush"):"outOfBrush"}:function(e){return CV(n,a,r,e)?(i.dataIndex.push(r.getRawIndex(e)),"inBrush"):"outOfBrush"};(g(t)?d:m(a))&&mV.applyVisual(wV,f,r,s)}))})),function(e,t,i,n,a){if(!a)return;var r=e.getZr();if(r[MV])return;r[SV]||(r[SV]=AV);var o=Cg.createOrUpdate(r,SV,i,t);o(e,n)}(t,n,a,r,i)}));var LV={lineX:Ve.noop,lineY:Ve.noop,rect:function(e){return PV(e.range)},polygon:function(e){for(var t,i=e.range,n=0,a=i.length;n<a;n++){t=t||[[1/0,-1/0],[1/0,-1/0]];var r=i[n];r[0]<t[0][0]&&(t[0][0]=r[0]),r[0]>t[0][1]&&(t[0][1]=r[0]),r[1]<t[1][0]&&(t[1][0]=r[1]),r[1]>t[1][1]&&(t[1][1]=r[1])}return t&&PV(t)}};function PV(e){return new Pn(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var kV={layoutCovers:TV},OV=["#ddd"];function RV(e,t){return Ve.merge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new mc(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}X_.extendComponentModel({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(e,t){var i=this.option;!t&&mV.replaceVisualOption(i,e,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:OV},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(e){e&&(this.areas=Ve.map(e,(function(e){return RV(this.option,e)}),this))},setBrushOption:function(e){this.brushOption=RV(this.option,e),this.brushType=this.brushOption.brushType}});var EV=kV.layoutCovers;function NV(e,t,i,n){(!n||n.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice())}X_.extendComponentView({type:"brush",init:function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new EP(t.getZr())).on("brush",Ve.bind(this._onBrush,this)).mount()},render:function(e){return this.model=e,NV.apply(this,arguments)},updateTransform:function(e,t){return EV(t),NV.apply(this,arguments)},updateView:NV,dispose:function(){this._brushController.dispose()},_onBrush:function(e,t){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(e,this.ecModel),(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:i,areas:Ve.clone(e),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:Ve.clone(e),$from:i})}}),X_.registerAction({type:"brush",event:"brush"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),X_.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),X_.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){}));var zV=kg.toolbox.brush;function BV(e,t,i){this.model=e,this.ecModel=t,this.api=i,this._brushType,this._brushMode}BV.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],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:Ve.clone(zV.title)};var VV=BV.prototype;VV.render=VV.updateView=function(e,t,i){var n,a,r;t.eachComponent({mainType:"brush"},(function(e){n=e.brushType,a=e.brushOption.brushMode||"single",r|=e.areas.length})),this._brushType=n,this._brushMode=a,Ve.each(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===a:"clear"===t?r:t===n)?"emphasis":"normal")}))},VV.getIcons=function(){var e=this.model,t=e.get("icon",!0),i={};return Ve.each(e.get("type",!0),(function(e){t[e]&&(i[e]=t[e])})),i},VV.onclick=function(e,t,i){var n=this._brushType,a=this._brushMode;"clear"===i?(t.dispatchAction({type:"axisAreaSelect",intervals:[]}),t.dispatchAction({type:"brush",command:"clear",areas:[]})):t.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===a?"single":"multiple":a}})},Iz.register("brush",BV),X_.registerPreprocessor(hV);var FV=nd.getLayoutRect,GV=Uc.windowOpen;function HV(e){var t=e.itemStyle||(e.itemStyle={}),i=t.emphasis||(t.emphasis={}),n=e.label||e.label||{},a=n.normal||(n.normal={}),r={normal:1,emphasis:1};Ve.each(n,(function(e,t){r[t]||WV(a,t)||(a[t]=e)})),i.label&&!WV(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function WV(e,t){return e.hasOwnProperty(t)}X_.extendComponentModel({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),X_.extendComponentView({type:"title",render:function(e,t,i){if(this.group.removeAll(),e.get("show")){var n=this.group,a=e.getModel("textStyle"),r=e.getModel("subtextStyle"),o=e.get("textAlign"),s=Ve.retrieve2(e.get("textBaseline"),e.get("textVerticalAlign")),l=new tc.Text({style:tc.setTextStyle({},a,{text:e.get("text"),textFill:a.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=e.get("subtext"),c=new tc.Text({style:tc.setTextStyle({},r,{text:h,textFill:r.getTextColor(),y:u.height+e.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=e.get("link"),p=e.get("sublink"),f=e.get("triggerEvent",!0);l.silent=!d&&!f,c.silent=!p&&!f,d&&l.on("click",(function(){GV(d,"_"+e.get("target"))})),p&&c.on("click",(function(){GV(d,"_"+e.get("subtarget"))})),l.eventData=c.eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,n.add(l),h&&n.add(c);var g=n.getBoundingRect(),m=e.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=FV(m,{width:i.getWidth(),height:i.getHeight()},e.get("padding"));o||("middle"===(o=e.get("left")||e.get("right"))&&(o="center"),"right"===o?v.x+=v.width:"center"===o&&(v.x+=v.width/2)),s||("center"===(s=e.get("top")||e.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),n.attr("position",[v.x,v.y]);var y={textAlign:o,textVerticalAlign:s};l.setStyle(y),c.setStyle(y),g=n.getBoundingRect();var x=v.margin,_=e.getItemStyle(["color","opacity"]);_.fill=e.get("backgroundColor");var b=new tc.Rect({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:e.get("borderRadius")},style:_,subPixelOptimize:!0,silent:!0});n.add(b)}}});var UV=function(e){var t=e&&e.timeline;Ve.isArray(t)||(t=t?[t]:[]),Ve.each(t,(function(e){e&&function(e){var t=e.type,i={number:"value",time:"time"};i[t]&&(e.axisType=i[t],delete e.type);if(HV(e),WV(e,"controlPosition")){var n=e.controlStyle||(e.controlStyle={});WV(n,"position")||(n.position=e.controlPosition),"none"!==n.position||WV(n,"show")||(n.show=!1,delete n.position),delete e.controlPosition}Ve.each(e.data||[],(function(e){Ve.isObject(e)&&!Ve.isArray(e)&&(!WV(e,"value")&&WV(e,"name")&&(e.value=e.name),HV(e))}))}(e)}))};ud.registerSubTypeDefaulter("timeline",(function(){return"slider"})),X_.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},(function(e,t){var i=t.getComponent("timeline");return i&&null!=e.currentIndex&&(i.setCurrentIndex(e.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),t.resetOption("timeline"),Ve.defaults({currentIndex:i.option.currentIndex},e)})),X_.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var i=t.getComponent("timeline");i&&null!=e.playState&&i.setPlayState(e.playState)}));var jV=ud.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(e,t,i){this._data,this._names,this.mergeDefaultAndTheme(e,i),this._initData()},mergeOption:function(e){jV.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(e){null==e&&(e=this.option.currentIndex);var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(e){this.option.autoPlay=!!e},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var e=this.option,t=e.data||[],i=e.axisType,n=this._names=[];if("category"===i){var a=[];Ve.each(t,(function(e,t){var i,r=Ro.getDataItemValue(e);Ve.isObject(e)?(i=Ve.clone(e)).value=t:i=t,a.push(i),Ve.isString(r)||null!=r&&!isNaN(r)||(r=""),n.push(r+"")})),t=a}var r={category:"ordinal",time:"time"}[i]||"number";(this._data=new Rv([{name:"value",type:r}],this)).initData(t,n)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}}),ZV=jV.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}});Ve.mixin(ZV,Rf);var YV=ug.extend({type:"timeline"}),XV=function(e,t,i,n){L_.call(this,e,t,i),this.type=n||"value",this.model=null};XV.prototype={constructor:XV,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},Ve.inherits(XV,L_);var qV=XV,$V=jx.createSymbol,KV=Uc.encodeHTML,JV=Ve.bind,QV=Ve.each,eF=Math.PI;function tF(e,t,i,n,a,r){var o=t.get("color");if(a)a.setColor(o),i.add(a),r&&r.onUpdate(a);else{var s=e.get("symbol");(a=$V(s,-1,-1,2,2,o)).setStyle("strokeNoScale",!0),i.add(a),r&&r.onCreate(a)}var l=t.getItemStyle(["color","symbol","symbolSize"]);a.setStyle(l),n=Ve.merge({rectHover:!0,z2:100},n,!0);var u=e.get("symbolSize");(u=u instanceof Array?u.slice():[+u,+u])[0]/=2,u[1]/=2,n.scale=u;var h=e.get("symbolOffset");if(h){var c=n.position=n.position||[0,0];c[0]+=Pc.parsePercent(h[0],u[0]),c[1]+=Pc.parsePercent(h[1],u[1])}var d=e.get("symbolRotate");return n.rotation=(d||0)*Math.PI/180||0,a.attr(n),a.updateTransform(),a}function iF(e,t,i,n,a){if(!e.dragging){var r=n.getModel("checkpointStyle"),o=i.dataToCoord(n.getData().get(["value"],t));a||!r.get("animation",!0)?e.attr({position:[o,0]}):(e.stopAnimation(!0),e.animateTo({position:[o,0]},r.get("animationDuration",!0),r.get("animationEasing",!0)))}}YV.extend({type:"timeline.slider",init:function(e,t){this.api=t,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,i,n){if(this.model=e,this.api=i,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var a=this._layout(e,i),r=this._createGroup("mainGroup"),o=this._createGroup("labelGroup"),s=this._axis=this._createAxis(a,e);e.formatTooltip=function(e){return KV(s.scale.getLabel(e))},QV(["AxisLine","AxisTick","Control","CurrentPointer"],(function(t){this["_render"+t](a,r,s,e)}),this),this._renderAxisLabel(a,o,s,e),this._position(a,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(e,t){var i=e.get("label.position"),n=e.get("orient"),a=function(e,t){return nd.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()},e.get("padding"))}(e,t);null==i||"auto"===i?i="horizontal"===n?a.y+a.height/2<t.getHeight()/2?"-":"+":a.x+a.width/2<t.getWidth()/2?"+":"-":isNaN(i)&&(i={horizontal:{top:"-",bottom:"+"},vertical:{left:"-",right:"+"}}[n][i]);var r,o,s,l,u={horizontal:"center",vertical:i>=0||"+"===i?"left":"right"},h={horizontal:i>=0||"+"===i?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:eF/2},d="vertical"===n?a.height:a.width,p=e.getModel("controlStyle"),f=p.get("show",!0),g=f?p.get("itemSize"):0,m=f?p.get("itemGap"):0,v=g+m,y=e.get("label.rotate")||0;y=y*eF/180;var x=p.get("position",!0),_=f&&p.get("showPlayBtn",!0),b=f&&p.get("showPrevBtn",!0),w=f&&p.get("showNextBtn",!0),S=0,M=d;return"left"===x||"bottom"===x?(_&&(r=[0,0],S+=v),b&&(o=[S,0],S+=v),w&&(s=[M-g,0],M-=v)):(_&&(r=[M-g,0],M-=v),b&&(o=[0,0],S+=v),w&&(s=[M-g,0],M-=v)),l=[S,M],e.get("inverse")&&l.reverse(),{viewRect:a,mainLength:d,orient:n,rotation:c[n],labelRotation:y,labelPosOpt:i,labelAlign:e.get("label.align")||u[n],labelBaseline:e.get("label.verticalAlign")||e.get("label.baseline")||h[n],playPosition:r,prevBtnPosition:o,nextBtnPosition:s,axisExtent:l,controlSize:g,controlGap:m}},_position:function(e,t){var i=this._mainGroup,n=this._labelGroup,a=e.viewRect;if("vertical"===e.orient){var r=ni.create(),o=a.x,s=a.y+a.height;ni.translate(r,r,[-o,-s]),ni.rotate(r,r,-eF/2),ni.translate(r,r,[o,s]),(a=a.clone()).applyTransform(r)}var l=m(a),u=m(i.getBoundingRect()),h=m(n.getBoundingRect()),c=i.position,d=n.position;d[0]=c[0]=l[0][0];var p,f=e.labelPosOpt;isNaN(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(e){var t=e.position;e.origin=[l[0][0]-t[0],l[1][0]-t[1]]}function m(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function v(e,t,i,n,a){e[n]+=i[n][a]-t[n][a]}i.attr("position",c),n.attr("position",d),i.rotation=n.rotation=e.rotation,g(i),g(n)},_createAxis:function(e,t){var i=t.getData(),n=t.get("axisType"),a=Px.createScaleByModel(t,n);a.getTicks=function(){return i.mapArray(["value"],(function(e){return e}))};var r=i.getDataExtent("value");a.setExtent(r[0],r[1]),a.niceTicks();var o=new qV("value",a,e.axisExtent,n);return o.model=t,o},_createGroup:function(e){var t=this["_"+e]=new tc.Group;return this.group.add(t),t},_renderAxisLine:function(e,t,i,n){var a=i.getExtent();n.get("lineStyle.show")&&t.add(new tc.Line({shape:{x1:a[0],y1:0,x2:a[1],y2:0},style:Ve.extend({lineCap:"round"},n.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(e,t,i,n){var a=n.getData(),r=i.scale.getTicks();QV(r,(function(e){var r=i.dataToCoord(e),o=a.getItemModel(e),s=o.getModel("itemStyle"),l=o.getModel("emphasis.itemStyle"),u={position:[r,0],onclick:JV(this._changeTimeline,this,e)},h=tF(o,s,t,u);tc.setHoverStyle(h,l.getItemStyle()),o.get("tooltip")?(h.dataIndex=e,h.dataModel=n):h.dataIndex=h.dataModel=null}),this)},_renderAxisLabel:function(e,t,i,n){if(i.getLabelModel().get("show")){var a=n.getData(),r=i.getViewLabels();QV(r,(function(n){var r=n.tickValue,o=a.getItemModel(r),s=o.getModel("label"),l=o.getModel("emphasis.label"),u=i.dataToCoord(n.tickValue),h=new tc.Text({position:[u,0],rotation:e.labelRotation-e.rotation,onclick:JV(this._changeTimeline,this,r),silent:!1});tc.setTextStyle(h.style,s,{text:n.formattedLabel,textAlign:e.labelAlign,textVerticalAlign:e.labelBaseline}),t.add(h),tc.setHoverStyle(h,tc.setTextStyle({},l))}),this)}},_renderControl:function(e,t,i,n){var a=e.controlSize,r=e.rotation,o=n.getModel("controlStyle").getItemStyle(),s=n.getModel("emphasis.controlStyle").getItemStyle(),l=[0,-a/2,a,a],u=n.getPlayState(),h=n.get("inverse",!0);function c(e,i,u,h){if(e){var c=function(e,t,i,n){var a=tc.makePath(e.get(t).replace(/^path:\/\//,""),Ve.clone(n||{}),new Pn(i[0],i[1],i[2],i[3]),"center");return a}(n,i,l,{position:e,origin:[a/2,0],rotation:h?-r:0,rectHover:!0,style:o,onclick:u});t.add(c),tc.setHoverStyle(c,s)}}c(e.nextBtnPosition,"controlStyle.nextIcon",JV(this._changeTimeline,this,h?"-":"+")),c(e.prevBtnPosition,"controlStyle.prevIcon",JV(this._changeTimeline,this,h?"+":"-")),c(e.playPosition,"controlStyle."+(u?"stopIcon":"playIcon"),JV(this._handlePlayClick,this,!u),!0)},_renderCurrentPointer:function(e,t,i,n){var a=n.getData(),r=n.getCurrentIndex(),o=a.getItemModel(r).getModel("checkpointStyle"),s=this,l={onCreate:function(e){e.draggable=!0,e.drift=JV(s._handlePointerDrag,s),e.ondragend=JV(s._handlePointerDragend,s),iF(e,r,i,n,!0)},onUpdate:function(e){iF(e,r,i,n)}};this._currentPointer=tF(o,o,this._mainGroup,{},this._currentPointer,l)},_handlePlayClick:function(e){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:e,from:this.uid})},_handlePointerDrag:function(e,t,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},_handlePointerDragend:function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},_pointerChangeTimeline:function(e,t){var i=this._toAxisCoord(e)[0],n=this._axis,a=Pc.asc(n.getExtent().slice());i>a[1]&&(i=a[1]),i<a[0]&&(i=a[0]),this._currentPointer.position[0]=i,this._currentPointer.dirty();var r=this._findNearestTick(i),o=this.model;(t||r!==o.getCurrentIndex()&&o.get("realtime"))&&this._changeTimeline(r)},_doPlayStop:function(){this._clearTimer(),this.model.getPlayState()&&(this._timer=setTimeout(JV((function(){var e=this.model;this._changeTimeline(e.getCurrentIndex()+(e.get("rewind",!0)?-1:1))}),this),this.model.get("playInterval")))},_toAxisCoord:function(e){var t=this._mainGroup.getLocalTransform();return tc.applyTransform(e,t,!0)},_findNearestTick:function(e){var t,i=this.model.getData(),n=1/0,a=this._axis;return i.each(["value"],(function(i,r){var o=a.dataToCoord(i),s=Math.abs(o-e);s<n&&(n=s,t=r)})),t},_clearTimer:function(){this._timer&&(clearTimeout(this._timer),this._timer=null)},_changeTimeline:function(e){var t=this.model.getCurrentIndex();"+"===e?e=t+1:"-"===e&&(e=t-1),this.api.dispatchAction({type:"timelineChange",currentIndex:e,from:this.uid})}}),X_.registerPreprocessor(UV);var nF=Uc.addCommas,aF=Uc.encodeHTML;function rF(e){Ro.defaultEmphasis(e,"label",["show"])}var oF=X_.extendComponentModel({type:"marker",dependencies:["series","grid","polar","geo"],init:function(e,t,i){this.mergeDefaultAndTheme(e,i),this._mergeOption(e,i,!1,!0)},isAnimationEnabled:function(){if(ie.node)return!1;var e=this.__hostSeries;return this.getShallow("animation")&&e&&e.isAnimationEnabled()},mergeOption:function(e,t){this._mergeOption(e,t,!1,!1)},_mergeOption:function(e,t,i,n){var a=this.constructor,r=this.mainType+"Model";i||t.eachSeries((function(e){var i=e.get(this.mainType,!0),o=e[r];i&&i.data?(o?o._mergeOption(i,t,!0):(n&&rF(i),Ve.each(i.data,(function(e){e instanceof Array?(rF(e[0]),rF(e[1])):rF(e)})),o=new a(i,this,t),Ve.extend(o,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),o.__hostSeries=e),e[r]=o):e[r]=null}),this)},formatTooltip:function(e){var t=this.getData(),i=this.getRawValue(e),n=Ve.isArray(i)?Ve.map(i,nF).join(", "):nF(i),a=t.getName(e),r=aF(this.name);return(null!=i||a)&&(r+="<br />"),a&&(r+=aF(a),null!=i&&(r+=" : ")),null!=i&&(r+=aF(n)),r},getData:function(){return this._data},setData:function(e){this._data=e}});Ve.mixin(oF,Rf);var sF=oF;sF.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var lF=ry.isDimensionStacked,uF=Ve.indexOf;function hF(e,t,i,n,a,r){var o=[],s=lF(t,n)?t.getCalculationInfo("stackResultDimension"):n,l=fF(t,s,e),u=t.indicesOfNearest(s,l)[0];o[a]=t.get(i,u),o[r]=t.get(s,u);var h=t.get(n,u),c=Pc.getPrecision(t.get(n,u));return(c=Math.min(c,20))>=0&&(o[r]=+o[r].toFixed(c)),[o,h]}var cF=Ve.curry,dF={min:cF(hF,"min"),max:cF(hF,"max"),average:cF(hF,"average")};function pF(e,t,i,n){var a={};return null!=e.valueIndex||null!=e.valueDim?(a.valueDataDim=null!=e.valueIndex?t.getDimension(e.valueIndex):e.valueDim,a.valueAxis=i.getAxis(function(e,t){var i=e.getData(),n=i.dimensions;t=i.getDimension(t);for(var a=0;a<n.length;a++){var r=i.getDimensionInfo(n[a]);if(r.name===t)return r.coordDim}}(n,a.valueDataDim)),a.baseAxis=i.getOtherAxis(a.valueAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim)):(a.baseAxis=n.getBaseAxis(),a.valueAxis=i.getOtherAxis(a.baseAxis),a.baseDataDim=t.mapDimension(a.baseAxis.dim),a.valueDataDim=t.mapDimension(a.valueAxis.dim)),a}function fF(e,t,i){if("average"===i){var n=0,a=0;return e.each(t,(function(e,t){isNaN(e)||(n+=e,a++)})),n/a}return"median"===i?e.getMedian(t):e.getDataExtent(t,!0)["max"===i?1:0]}var gF=function(e,t){var i=e.getData(),n=e.coordinateSystem;if(t&&!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!Ve.isArray(t.coord)&&n){var a=n.dimensions,r=pF(t,i,n,e);if((t=Ve.clone(t)).type&&dF[t.type]&&r.baseAxis&&r.valueAxis){var o=uF(a,r.baseAxis.dim),s=uF(a,r.valueAxis.dim),l=dF[t.type](i,r.baseDataDim,r.valueDataDim,o,s);t.coord=l[0],t.value=l[1]}else{for(var u=[null!=t.xAxis?t.xAxis:t.radiusAxis,null!=t.yAxis?t.yAxis:t.angleAxis],h=0;h<2;h++)dF[u[h]]&&(u[h]=fF(i,i.mapDimension(a[h]),u[h]));t.coord=u}}return t},mF={dataTransform:gF,getAxisInfo:pF,dataFilter:function(e,t){return!(e&&e.containData&&t.coord&&!function(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}(t))||e.containData(t.coord)},dimValueGetter:function(e,t,i,n){return n<2?e.coord&&e.coord[n]:e.value},numCalculate:fF},vF=X_.extendComponentView({type:"marker",init:function(){this.markerGroupMap=Ve.createHashMap()},render:function(e,t,i){var n=this.markerGroupMap;n.each((function(e){e.__keep=!1}));var a=this.type+"Model";t.eachSeries((function(e){var n=e[a];n&&this.renderSeries(e,n,t,i)}),this),n.each((function(e){!e.__keep&&this.group.remove(e.group)}),this)},renderSeries:function(){}});function yF(e,t,i){var n=t.coordinateSystem;e.each((function(a){var r,o=e.getItemModel(a),s=Pc.parsePercent(o.get("x"),i.getWidth()),l=Pc.parsePercent(o.get("y"),i.getHeight());if(isNaN(s)||isNaN(l)){if(t.getMarkerPosition)r=t.getMarkerPosition(e.getValues(e.dimensions,a));else if(n){var u=e.get(n.dimensions[0],a),h=e.get(n.dimensions[1],a);r=n.dataToPoint([u,h])}}else r=[s,l];isNaN(s)||(r[0]=s),isNaN(l)||(r[1]=l),e.setItemLayout(a,r)}))}vF.extend({type:"markPoint",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markPointModel;t&&(yF(t.getData(),e,i),this.markerGroupMap.get(e.id).updateLayout(t))}),this)},renderSeries:function(e,t,i,n){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,new yb),u=function(e,t,i){var n;n=e?Ve.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return Ve.defaults({name:e},i)})):[{name:"value",type:"float"}];var a=new Rv(n,i),r=Ve.map(i.get("data"),Ve.curry(mF.dataTransform,t));e&&(r=Ve.filter(r,Ve.curry(mF.dataFilter,e)));return a.initData(r,null,e?mF.dimValueGetter:function(e){return e.value}),a}(a,e,t);t.setData(u),yF(t.getData(),e,n),u.each((function(e){var i=u.getItemModel(e),n=i.getShallow("symbol"),a=i.getShallow("symbolSize"),r=Ve.isFunction(n),s=Ve.isFunction(a);if(r||s){var l=t.getRawValue(e),h=t.getDataParams(e);r&&(n=n(l,h)),s&&(a=a(l,h))}u.setItemVisual(e,{symbol:n,symbolSize:a,color:i.get("itemStyle.color")||o.getVisual("color")})})),l.updateData(u),this.group.add(l.group),u.eachItemGraphicEl((function(e){e.traverse((function(e){e.dataModel=t}))})),l.__keep=!0,l.group.silent=t.get("silent")||e.get("silent")}}),X_.registerPreprocessor((function(e){e.markPoint=e.markPoint||{}})),sF.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});var xF=ry.getStackedDimension,_F=function(e,t,i,n){var a=e.getData(),r=n.type;if(!Ve.isArray(n)&&("min"===r||"max"===r||"average"===r||"median"===r||null!=n.xAxis||null!=n.yAxis)){var o,s;if(null!=n.yAxis||null!=n.xAxis)o=t.getAxis(null!=n.yAxis?"y":"x"),s=Ve.retrieve(n.yAxis,n.xAxis);else{var l=mF.getAxisInfo(n,a,t,e);o=l.valueAxis;var u=xF(a,l.valueDataDim);s=mF.numCalculate(a,u,r)}var h="x"===o.dim?0:1,c=1-h,d=Ve.clone(n),p={};d.type=null,d.coord=[],p.coord=[],d.coord[c]=-1/0,p.coord[c]=1/0;var f=i.get("precision");f>=0&&"number"==typeof s&&(s=+s.toFixed(Math.min(f,20))),d.coord[h]=p.coord[h]=s,n=[d,p,{type:r,valueIndex:n.valueIndex,value:s}]}return(n=[mF.dataTransform(e,n[0]),mF.dataTransform(e,n[1]),Ve.extend({},n[2])])[2].type=n[2].type||"",Ve.merge(n[2],n[0]),Ve.merge(n[2],n[1]),n};function bF(e){return!isNaN(e)&&!isFinite(e)}function wF(e,t,i,n){var a=1-e,r=n.dimensions[e];return bF(t[a])&&bF(i[a])&&t[e]===i[e]&&n.getAxis(r).containData(t[e])}function SF(e,t){if("cartesian2d"===e.type){var i=t[0].coord,n=t[1].coord;if(i&&n&&(wF(1,i,n,e)||wF(0,i,n,e)))return!0}return mF.dataFilter(e,t[0])&&mF.dataFilter(e,t[1])}function MF(e,t,i,n,a){var r,o=n.coordinateSystem,s=e.getItemModel(t),l=Pc.parsePercent(s.get("x"),a.getWidth()),u=Pc.parsePercent(s.get("y"),a.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)r=n.getMarkerPosition(e.getValues(e.dimensions,t));else{var h=o.dimensions,c=e.get(h[0],t),d=e.get(h[1],t);r=o.dataToPoint([c,d])}if("cartesian2d"===o.type){var p=o.getAxis("x"),f=o.getAxis("y");h=o.dimensions;bF(e.get(h[0],t))?r[0]=p.toGlobalCoord(p.getExtent()[i?0:1]):bF(e.get(h[1],t))&&(r[1]=f.toGlobalCoord(f.getExtent()[i?0:1]))}isNaN(l)||(r[0]=l),isNaN(u)||(r[1]=u)}else r=[l,u];e.setItemLayout(t,r)}vF.extend({type:"markLine",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markLineModel;if(t){var n=t.getData(),a=t.__from,r=t.__to;a.each((function(t){MF(a,t,!0,e,i),MF(r,t,!1,e,i)})),n.each((function(e){n.setItemLayout(e,[a.getItemLayout(e),r.getItemLayout(e)])})),this.markerGroupMap.get(e.id).updateLayout()}}),this)},renderSeries:function(e,t,i,n){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,new pD);this.group.add(l.group);var u=function(e,t,i){var n;n=e?Ve.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return Ve.defaults({name:e},i)})):[{name:"value",type:"float"}];var a=new Rv(n,i),r=new Rv(n,i),o=new Rv([],i),s=Ve.map(i.get("data"),Ve.curry(_F,t,e,i));e&&(s=Ve.filter(s,Ve.curry(SF,e)));var l=e?mF.dimValueGetter:function(e){return e.value};return a.initData(Ve.map(s,(function(e){return e[0]})),null,l),r.initData(Ve.map(s,(function(e){return e[1]})),null,l),o.initData(Ve.map(s,(function(e){return e[2]}))),o.hasItemOption=!0,{from:a,to:r,line:o}}(a,e,t),h=u.from,c=u.to,d=u.line;t.__from=h,t.__to=c,t.setData(d);var p=t.get("symbol"),f=t.get("symbolSize");function g(t,i,a){var r=t.getItemModel(i);MF(t,i,a,e,n),t.setItemVisual(i,{symbolSize:r.get("symbolSize")||f[a?0:1],symbol:r.get("symbol",!0)||p[a?0:1],color:r.get("itemStyle.color")||o.getVisual("color")})}Ve.isArray(p)||(p=[p,p]),"number"==typeof f&&(f=[f,f]),u.from.each((function(e){g(h,e,!0),g(c,e,!1)})),d.each((function(e){var t=d.getItemModel(e).get("lineStyle.color");d.setItemVisual(e,{color:t||h.getItemVisual(e,"color")}),d.setItemLayout(e,[h.getItemLayout(e),c.getItemLayout(e)]),d.setItemVisual(e,{fromSymbolSize:h.getItemVisual(e,"symbolSize"),fromSymbol:h.getItemVisual(e,"symbol"),toSymbolSize:c.getItemVisual(e,"symbolSize"),toSymbol:c.getItemVisual(e,"symbol")})})),l.updateData(d),u.line.eachItemGraphicEl((function(e,i){e.traverse((function(e){e.dataModel=t}))})),l.__keep=!0,l.group.silent=t.get("silent")||e.get("silent")}}),X_.registerPreprocessor((function(e){e.markLine=e.markLine||{}})),sF.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});var IF=function(e,t,i,n){var a=mF.dataTransform(e,n[0]),r=mF.dataTransform(e,n[1]),o=Ve.retrieve,s=a.coord,l=r.coord;s[0]=o(s[0],-1/0),s[1]=o(s[1],-1/0),l[0]=o(l[0],1/0),l[1]=o(l[1],1/0);var u=Ve.mergeAll([{},a,r]);return u.coord=[a.coord,r.coord],u.x0=a.x,u.y0=a.y,u.x1=r.x,u.y1=r.y,u};function TF(e){return!isNaN(e)&&!isFinite(e)}function AF(e,t,i,n){var a=1-e;return TF(t[a])&&TF(i[a])}function CF(e,t){var i=t.coord[0],n=t.coord[1];return!("cartesian2d"!==e.type||!i||!n||!AF(1,i,n)&&!AF(0,i,n))||(mF.dataFilter(e,{coord:i,x:t.x0,y:t.y0})||mF.dataFilter(e,{coord:n,x:t.x1,y:t.y1}))}function DF(e,t,i,n,a){var r,o=n.coordinateSystem,s=e.getItemModel(t),l=Pc.parsePercent(s.get(i[0]),a.getWidth()),u=Pc.parsePercent(s.get(i[1]),a.getHeight());if(isNaN(l)||isNaN(u)){if(n.getMarkerPosition)r=n.getMarkerPosition(e.getValues(i,t));else{var h=[p=e.get(i[0],t),f=e.get(i[1],t)];o.clampData&&o.clampData(h,h),r=o.dataToPoint(h,!0)}if("cartesian2d"===o.type){var c=o.getAxis("x"),d=o.getAxis("y"),p=e.get(i[0],t),f=e.get(i[1],t);TF(p)?r[0]=c.toGlobalCoord(c.getExtent()["x0"===i[0]?0:1]):TF(f)&&(r[1]=d.toGlobalCoord(d.getExtent()["y0"===i[1]?0:1]))}isNaN(l)||(r[0]=l),isNaN(u)||(r[1]=u)}else r=[l,u];return r}var LF=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];vF.extend({type:"markArea",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markAreaModel;if(t){var n=t.getData();n.each((function(t){var a=Ve.map(LF,(function(a){return DF(n,t,a,e,i)}));n.setItemLayout(t,a),n.getItemGraphicEl(t).setShape("points",a)}))}}),this)},renderSeries:function(e,t,i,n){var a=e.coordinateSystem,r=e.id,o=e.getData(),s=this.markerGroupMap,l=s.get(r)||s.set(r,{group:new tc.Group});this.group.add(l.group),l.__keep=!0;var u=function(e,t,i){var n,a,r=["x0","y0","x1","y1"];e?(n=Ve.map(e&&e.dimensions,(function(e){var i=t.getData(),n=i.getDimensionInfo(i.mapDimension(e))||{};return Ve.defaults({name:e},n)})),a=new Rv(Ve.map(r,(function(e,t){return{name:e,type:n[t%2].type}})),i)):a=new Rv(n=[{name:"value",type:"float"}],i);var o=Ve.map(i.get("data"),Ve.curry(IF,t,e,i));e&&(o=Ve.filter(o,Ve.curry(CF,e)));var s=e?function(e,t,i,n){return e.coord[Math.floor(n/2)][n%2]}:function(e){return e.value};return a.initData(o,null,s),a.hasItemOption=!0,a}(a,e,t);t.setData(u),u.each((function(t){u.setItemLayout(t,Ve.map(LF,(function(i){return DF(u,t,i,e,n)}))),u.setItemVisual(t,{color:o.getVisual("color")})})),u.diff(l.__data).add((function(e){var t=new tc.Polygon({shape:{points:u.getItemLayout(e)}});u.setItemGraphicEl(e,t),l.group.add(t)})).update((function(e,i){var n=l.__data.getItemGraphicEl(i);tc.updateProps(n,{shape:{points:u.getItemLayout(e)}},t,e),l.group.add(n),u.setItemGraphicEl(e,n)})).remove((function(e){var t=l.__data.getItemGraphicEl(e);l.group.remove(t)})).execute(),u.eachItemGraphicEl((function(e,i){var n=u.getItemModel(i),a=n.getModel("label"),r=n.getModel("emphasis.label"),o=u.getItemVisual(i,"color");e.useStyle(Ve.defaults(n.getModel("itemStyle").getItemStyle(),{fill:Ui.modifyAlpha(o,.4),stroke:o})),e.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),tc.setLabelStyle(e.style,e.hoverStyle,a,r,{labelFetcher:t,labelDataIndex:i,defaultText:u.getName(i)||"",isRectText:!0,autoColor:o}),tc.setHoverStyle(e,{}),e.dataModel=t})),l.__data=u,l.group.silent=t.get("silent")||e.get("silent")}}),X_.registerPreprocessor((function(e){e.markArea=e.markArea||{}}));var PF=Ro.isNameSpecified,kF=kg.legend.selector,OF={all:{type:"all",title:Ve.clone(kF.all)},inverse:{type:"inverse",title:Ve.clone(kF.inverse)}},RF=X_.extendComponentModel({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(e,t,i){this.mergeDefaultAndTheme(e,i),e.selected=e.selected||{},this._updateSelector(e)},mergeOption:function(e){RF.superCall(this,"mergeOption",e),this._updateSelector(e)},_updateSelector:function(e){var t=e.selector;!0===t&&(t=e.selector=["all","inverse"]),Ve.isArray(t)&&Ve.each(t,(function(e,i){Ve.isString(e)&&(e={type:e}),t[i]=Ve.merge(e,OF[e.type])}))},optionUpdated:function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&"single"===this.get("selectedMode")){for(var t=!1,i=0;i<e.length;i++){var n=e[i].get("name");if(this.isSelected(n)){this.select(n),t=!0;break}}!t&&this.select(e[0].get("name"))}},_updateData:function(e){var t=[],i=[];e.eachRawSeries((function(n){var a,r=n.name;if(i.push(r),n.legendVisualProvider){var o=n.legendVisualProvider.getAllNames();e.isSeriesFiltered(n)||(i=i.concat(o)),o.length?t=t.concat(o):a=!0}else a=!0;a&&PF(n)&&t.push(n.name)})),this._availableNames=i;var n=this.get("data")||t,a=Ve.map(n,(function(e){return"string"!=typeof e&&"number"!=typeof e||(e={name:e}),new mc(e,this,this.ecModel)}),this);this._data=a},getData:function(){return this._data},select:function(e){var t=this.option.selected;if("single"===this.get("selectedMode")){var i=this._data;Ve.each(i,(function(e){t[e.get("name")]=!1}))}t[e]=!0},unSelect:function(e){"single"!==this.get("selectedMode")&&(this.option.selected[e]=!1)},toggleSelected:function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},allSelect:function(){var e=this._data,t=this.option.selected;Ve.each(e,(function(e){t[e.get("name",!0)]=!0}))},inverseSelect:function(){var e=this._data,t=this.option.selected;Ve.each(e,(function(e){var i=e.get("name",!0);t.hasOwnProperty(i)||(t[i]=!0),t[i]=!t[i]}))},isSelected:function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&Ve.indexOf(this._availableNames,e)>=0},getOrient:function(){return"vertical"===this.get("orient")?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:" sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}}}),EF=RF;function NF(e,t,i){var n,a={},r="toggleSelected"===e;return i.eachComponent("legend",(function(i){r&&null!=n?i[n?"select":"unSelect"](t.name):"allSelect"===e||"inverseSelect"===e?i[e]():(i[e](t.name),n=i.isSelected(t.name));var o=i.getData();Ve.each(o,(function(e){var t=e.get("name");if("\n"!==t&&""!==t){var n=i.isSelected(t);a.hasOwnProperty(t)?a[t]=a[t]&&n:a[t]=n}}))})),"allSelect"===e||"inverseSelect"===e?{selected:a}:{name:t.name,selected:a}}X_.registerAction("legendToggleSelect","legendselectchanged",Ve.curry(NF,"toggleSelected")),X_.registerAction("legendAllSelect","legendselectall",Ve.curry(NF,"allSelect")),X_.registerAction("legendInverseSelect","legendinverseselect",Ve.curry(NF,"inverseSelect")),X_.registerAction("legendSelect","legendselected",Ve.curry(NF,"select")),X_.registerAction("legendUnSelect","legendunselected",Ve.curry(NF,"unSelect"));var zF=jx.createSymbol,BF=Pz.makeBackground,VF=Ve.curry,FF=Ve.each,GF=tc.Group,HF=X_.extendComponentView({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new GF),this._backgroundEl,this.group.add(this._selectorGroup=new GF),this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},getSelectorGroup:function(){return this._selectorGroup},render:function(e,t,i){var n=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get("show",!0)){var a=e.get("align"),r=e.get("orient");a&&"auto"!==a||(a="right"===e.get("left")&&"vertical"===r?"right":"left");var o=e.get("selector",!0),s=e.get("selectorPosition",!0);!o||s&&"auto"!==s||(s="horizontal"===r?"end":"start"),this.renderInner(a,e,t,i,o,r,s);var l=e.getBoxLayoutParams(),u={width:i.getWidth(),height:i.getHeight()},h=e.get("padding"),c=nd.getLayoutRect(l,u,h),d=this.layoutInner(e,a,c,n,o,s),p=nd.getLayoutRect(Ve.defaults({width:d.width,height:d.height},l),u,h);this.group.attr("position",[p.x-d.x,p.y-d.y]),this.group.add(this._backgroundEl=BF(d,e))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},renderInner:function(e,t,i,n,a,r,o){var s=this.getContentGroup(),l=Ve.createHashMap(),u=t.get("selectedMode"),h=[];i.eachRawSeries((function(e){!e.get("legendHoverLink")&&h.push(e.id)})),FF(t.getData(),(function(a,r){var o=a.get("name");if(this.newlineDisabled||""!==o&&"\n"!==o){var c=i.getSeriesByName(o)[0];if(!l.get(o))if(c){var d=c.getData(),p=d.getVisual("color"),f=d.getVisual("borderColor");"function"==typeof p&&(p=p(c.getDataParams(0))),"function"==typeof f&&(f=f(c.getDataParams(0)));var g=d.getVisual("legendSymbol")||"roundRect",m=d.getVisual("symbol");this._createItem(o,r,a,t,g,m,e,p,f,u).on("click",VF(UF,o,null,n,h)).on("mouseover",VF(jF,c.name,null,n,h)).on("mouseout",VF(ZF,c.name,null,n,h)),l.set(o,!0)}else i.eachRawSeries((function(i){if(!l.get(o)&&i.legendVisualProvider){var s=i.legendVisualProvider;if(!s.containName(o))return;var c=s.indexOfName(o),d=s.getItemVisual(c,"color"),p=s.getItemVisual(c,"borderColor");this._createItem(o,r,a,t,"roundRect",null,e,d,p,u).on("click",VF(UF,null,o,n,h)).on("mouseover",VF(jF,null,o,n,h)).on("mouseout",VF(ZF,null,o,n,h)),l.set(o,!0)}}),this)}else s.add(new GF({newline:!0}))}),this),a&&this._createSelector(a,t,n,r,o)},_createSelector:function(e,t,i,n,a){var r=this.getSelectorGroup();FF(e,(function(e){!function(e){var n=e.type,a=new tc.Text({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:"all"===n?"legendAllSelect":"legendInverseSelect"})}});r.add(a);var o=t.getModel("selectorLabel"),s=t.getModel("emphasis.selectorLabel");tc.setLabelStyle(a.style,a.hoverStyle={},o,s,{defaultText:e.title,isRectText:!1}),tc.setHoverStyle(a)}(e)}))},_createItem:function(e,t,i,n,a,r,o,s,l,u){var h=n.get("itemWidth"),c=n.get("itemHeight"),d=n.get("inactiveColor"),p=n.get("inactiveBorderColor"),f=n.get("symbolKeepAspect"),g=n.getModel("itemStyle"),m=n.isSelected(e),v=new GF,y=i.getModel("textStyle"),x=i.get("icon"),_=i.getModel("tooltip"),b=_.parentModel,w=zF(a=x||a,0,0,h,c,m?s:d,null==f||f);if(v.add(WF(w,a,g,l,p,m)),!x&&r&&(r!==a||"none"===r)){var S=.8*c;"none"===r&&(r="circle");var M=zF(r,(h-S)/2,(c-S)/2,S,S,m?s:d,null==f||f);v.add(WF(M,r,g,l,p,m))}var I="left"===o?h+5:-5,T=o,A=n.get("formatter"),C=e;"string"==typeof A&&A?C=A.replace("{name}",null!=e?e:""):"function"==typeof A&&(C=A(e)),v.add(new tc.Text({style:tc.setTextStyle({},y,{text:C,x:I,y:c/2,textFill:m?y.getTextColor():d,textAlign:T,textVerticalAlign:"middle"})}));var D=new tc.Rect({shape:v.getBoundingRect(),invisible:!0,tooltip:_.get("show")?Ve.extend({content:e,formatter:b.get("formatter",!0)||function(){return e},formatterParams:{componentType:"legend",legendIndex:n.componentIndex,name:e,$vars:["name"]}},_.option):null});return v.add(D),v.eachChild((function(e){e.silent=!0})),D.silent=!u,this.getContentGroup().add(v),tc.setHoverStyle(v),v.__legendDataIndex=t,v},layoutInner:function(e,t,i,n,a,r){var o=this.getContentGroup(),s=this.getSelectorGroup();nd.box(e.get("orient"),o,e.get("itemGap"),i.width,i.height);var l=o.getBoundingRect(),u=[-l.x,-l.y];if(a){nd.box("horizontal",s,e.get("selectorItemGap",!0));var h=s.getBoundingRect(),c=[-h.x,-h.y],d=e.get("selectorButtonGap",!0),p=e.getOrient().index,f=0===p?"width":"height",g=0===p?"height":"width",m=0===p?"y":"x";"end"===r?c[p]+=l[f]+d:u[p]+=h[f]+d,c[1-p]+=l[g]/2-h[g]/2,s.attr("position",c),o.attr("position",u);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 o.attr("position",u),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});function WF(e,t,i,n,a,r){var o;return"line"!==t&&t.indexOf("empty")<0?(o=i.getItemStyle(),e.style.stroke=n,r||(o.stroke=a)):o=i.getItemStyle(["borderWidth","borderColor"]),e.setStyle(o)}function UF(e,t,i,n){ZF(e,t,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),jF(e,t,i,n)}function jF(e,t,i,n){var a=i.getZr().storage.getDisplayList()[0];a&&a.useHoverLayer||i.dispatchAction({type:"highlight",seriesName:e,name:t,excludeSeriesId:n})}function ZF(e,t,i,n){var a=i.getZr().storage.getDisplayList()[0];a&&a.useHoverLayer||i.dispatchAction({type:"downplay",seriesName:e,name:t,excludeSeriesId:n})}var YF=HF;var XF=function(e){var t=e.findComponents({mainType:"legend"});t&&t.length&&e.filterSeries((function(e){for(var i=0;i<t.length;i++)if(!t[i].isSelected(e.name))return!1;return!0}))};X_.registerProcessor(X_.PRIORITY.PROCESSOR.SERIES_FILTER,XF),ud.registerSubTypeDefaulter("legend",(function(){return"plain"}));var qF=nd.mergeLayoutParam,$F=nd.getLayoutParams,KF=EF.extend({type:"legend.scroll",setScrollDataIndex:function(e){this.option.scrollDataIndex=e},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:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800},init:function(e,t,i,n){var a=$F(e);KF.superCall(this,"init",e,t,i,n),JF(this,e,a)},mergeOption:function(e,t){KF.superCall(this,"mergeOption",e,t),JF(this,this.option,e)}});function JF(e,t,i){var n=[1,1];n[e.getOrient().index]=0,qF(t,i,{type:"box",ignoreSize:n})}var QF=tc.Group,eG=["width","height"],tG=["x","y"],iG=YF.extend({type:"legend.scroll",newlineDisabled:!0,init:function(){iG.superCall(this,"init"),this._currentIndex=0,this.group.add(this._containerGroup=new QF),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new QF),this._showController},resetInner:function(){iG.superCall(this,"resetInner"),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},renderInner:function(e,t,i,n,a,r,o){var s=this;iG.superCall(this,"renderInner",e,t,i,n,a,r,o);var l=this._controllerGroup,u=t.get("pageIconSize",!0);Ve.isArray(u)||(u=[u,u]),c("pagePrev",0);var h=t.getModel("pageTextStyle");function c(e,i){var a=e+"DataIndex",r=tc.createIcon(t.get("pageIcons",!0)[t.getOrient().name][i],{onclick:Ve.bind(s._pageGo,s,a,t,n)},{x:-u[0]/2,y:-u[1]/2,width:u[0],height:u[1]});r.name=e,l.add(r)}l.add(new tc.Text({name:"pageText",style:{textFill:h.getTextColor(),font:h.getFont(),textVerticalAlign:"middle",textAlign:"center"},silent:!0})),c("pageNext",1)},layoutInner:function(e,t,i,n,a,r){var o=this.getSelectorGroup(),s=e.getOrient().index,l=eG[s],u=tG[s],h=eG[1-s],c=tG[1-s];a&&nd.box("horizontal",o,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),p=o.getBoundingRect(),f=[-p.x,-p.y],g=Ve.clone(i);a&&(g[l]=i[l]-p[l]-d);var m=this._layoutContentAndController(e,n,g,s,l,h,c);if(a){if("end"===r)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]),o.attr("position",f)}return m},_layoutContentAndController:function(e,t,i,n,a,r,o){var s=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;nd.box(e.get("orient"),s,e.get("itemGap"),n?i.width:null,n?null:i.height),nd.box("horizontal",u,e.get("pageButtonItemGap",!0));var h=s.getBoundingRect(),c=u.getBoundingRect(),d=this._showController=h[a]>i[a],p=[-h.x,-h.y];t||(p[n]=s.position[n]);var f=[0,0],g=[-c.x,-c.y],m=Ve.retrieve2(e.get("pageButtonGap",!0),e.get("itemGap",!0));d&&("end"===e.get("pageButtonPosition",!0)?g[n]+=i[a]-c[a]:f[n]+=c[a]+m);g[1-n]+=h[r]/2-c[r]/2,s.attr("position",p),l.attr("position",f),u.attr("position",g);var v={x:0,y:0};if(v[a]=d?i[a]:h[a],v[r]=Math.max(h[r],c[r]),v[o]=Math.min(0,c[o]+g[1-n]),l.__rectSize=i[a],d){var y={x:0,y:0};y[a]=Math.max(i[a]-c[a]-m,0),y[r]=v[r],l.setClipPath(new tc.Rect({shape:y})),l.__rectSize=y[a]}else u.eachChild((function(e){e.attr({invisible:!0,silent:!0})}));var x=this._getPageInfo(e);return null!=x.pageIndex&&tc.updateProps(s,{position:x.contentPosition},!!d&&e),this._updatePageInfoView(e,x),v},_pageGo:function(e,t,i){var n=this._getPageInfo(t)[e];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:t.id})},_updatePageInfoView:function(e,t){var i=this._controllerGroup;Ve.each(["pagePrev","pageNext"],(function(n){var a=null!=t[n+"DataIndex"],r=i.childOfName(n);r&&(r.setStyle("fill",a?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),r.cursor=a?"pointer":"default")}));var n=i.childOfName("pageText"),a=e.get("pageFormatter"),r=t.pageIndex,o=null!=r?r+1:0,s=t.pageCount;n&&a&&n.setStyle("text",Ve.isString(a)?a.replace("{current}",o).replace("{total}",s):a({current:o,total:s}))},_getPageInfo:function(e){var t=e.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,a=e.getOrient().index,r=eG[a],o=tG[a],s=this._findTargetItemIndex(t),l=i.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:i.position.slice(),pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var p=y(u);d.contentPosition[a]=-p.s;for(var f=s+1,g=p,m=p,v=null;f<=h;++f)(!(v=y(l[f]))&&m.e>g.s+n||v&&!x(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]))&&x(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(e){if(e){var t=e.getBoundingRect(),i=t[o]+e.position[a];return{s:i,e:i+t[r],i:e.__legendDataIndex}}}function x(e,t){return e.e>=t&&e.s<=t+n}},_findTargetItemIndex:function(e){return this._showController?(this.getContentGroup().eachChild((function(n,a){var r=n.__legendDataIndex;null==i&&null!=r&&(i=a),r===e&&(t=a)})),null!=t?t:i):0;var t,i}});X_.registerAction("legendScroll","legendscroll",(function(e,t){var i=e.scrollDataIndex;null!=i&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},(function(e){e.setScrollDataIndex(i)}))})),OB.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var nG=tc.Rect,aG=Pc.linearMap,rG=Pc.asc,oG=Ve.bind,sG=Ve.each,lG="horizontal",uG="vertical",hG=["line","bar","candlestick","scatter"],cG=EB.extend({type:"dataZoom.slider",init:function(e,t){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=t},render:function(e,t,i,n){cG.superApply(this,"render",arguments),Cg.createOrUpdate(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=e.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){cG.superApply(this,"remove",arguments),Cg.clear(this,"_dispatchZoomAction")},dispose:function(){cG.superApply(this,"dispose",arguments),Cg.clear(this,"_dispatchZoomAction")},_buildView:function(){var e=this.group;e.removeAll(),this._resetLocation(),this._resetInterval();var t=this._displayables.barGroup=new tc.Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},_resetLocation:function(){var e=this.dataZoomModel,t=this.api,i=this._findCoordRect(),n={width:t.getWidth(),height:t.getHeight()},a=this._orient===lG?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},r=nd.getLayoutParams(e.option);Ve.each(["right","top","width","height"],(function(e){"ph"===r[e]&&(r[e]=a[e])}));var o=nd.getLayoutRect(r,n,e.padding);this._location={x:o.x,y:o.y},this._size=[o.width,o.height],this._orient===uG&&this._size.reverse()},_positionGroup:function(){var e=this.group,t=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),a=n&&n.get("inverse"),r=this._displayables.barGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;r.attr(i!==lG||a?i===lG&&a?{scale:o?[-1,1]:[-1,-1]}:i!==uG||a?{scale:o?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:o?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:o?[1,1]:[1,-1]});var s=e.getBoundingRect([r]);e.attr("position",[t.x-s.x,t.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var e=this.dataZoomModel,t=this._size,i=this._displayables.barGroup;i.add(new nG({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40})),i.add(new nG({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:Ve.bind(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(e){var t=this._size,i=e.series,n=i.getRawData(),a=i.getShadowDim?i.getShadowDim():e.otherDim;if(null!=a){var r=n.getDataExtent(a),o=.3*(r[1]-r[0]);r=[r[0]-o,r[1]+o];var s,l=[0,t[1]],u=[0,t[0]],h=[[t[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),p=0,f=Math.round(n.count()/t[0]);n.each([a],(function(e,t){if(f>0&&t%f)p+=d;else{var i=null==e||isNaN(e)||""===e,n=i?0:aG(e,r,l,!0);i&&!s&&t?(h.push([h[h.length-1][0],0]),c.push([c[c.length-1][0],0])):!i&&s&&(h.push([p,0]),c.push([p,0])),h.push([p,n]),c.push([p,n]),p+=d,s=i}}));var g=this.dataZoomModel;this._displayables.barGroup.add(new tc.Polygon({shape:{points:h},style:Ve.defaults({fill:g.get("dataBackgroundColor")},g.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new tc.Polyline({shape:{points:c},style:g.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var e=this.dataZoomModel,t=e.get("showDataShadow");if(!1!==t){var i,n=this.ecModel;return e.eachTargetAxis((function(a,r){var o=e.getAxisProxy(a.name,r).getTargetSeriesModels();Ve.each(o,(function(e){if(!(i||!0!==t&&Ve.indexOf(hG,e.get("type"))<0)){var o,s=n.getComponent(a.axis,r).axis,l=function(e){var t={x:"y",y:"x",radius:"angle",angle:"radius"};return t[e]}(a.name),u=e.coordinateSystem;null!=l&&u.getOtherAxis&&(o=u.getOtherAxis(s).inverse),l=e.getData().mapDimension(l),i={thisAxis:s,series:e,thisDim:a.name,otherDim:l,otherAxisInverse:o}}}),this)}),this),i}},_renderHandle:function(){var e=this._displayables,t=e.handles=[],i=e.handleLabels=[],n=this._displayables.barGroup,a=this._size,r=this.dataZoomModel;n.add(e.filler=new nG({draggable:!0,cursor:dG(this._orient),drift:oG(this._onDragMove,this,"all"),ondragstart:oG(this._showDataInfo,this,!0),ondragend:oG(this._onDragEnd,this),onmouseover:oG(this._showDataInfo,this,!0),onmouseout:oG(this._showDataInfo,this,!1),style:{fill:r.get("fillerColor"),textPosition:"inside"}})),n.add(new nG({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1]},style:{stroke:r.get("dataBackgroundColor")||r.get("borderColor"),lineWidth:1,fill:"rgba(0,0,0,0)"}})),sG([0,1],(function(e){var a=tc.createIcon(r.get("handleIcon"),{cursor:dG(this._orient),draggable:!0,drift:oG(this._onDragMove,this,e),ondragend:oG(this._onDragEnd,this),onmouseover:oG(this._showDataInfo,this,!0),onmouseout:oG(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),o=a.getBoundingRect();this._handleHeight=Pc.parsePercent(r.get("handleSize"),this._size[1]),this._handleWidth=o.width/o.height*this._handleHeight,a.setStyle(r.getModel("handleStyle").getItemStyle());var s=r.get("handleColor");null!=s&&(a.style.fill=s),n.add(t[e]=a);var l=r.textStyleModel;this.group.add(i[e]=new tc.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:l.getTextColor(),textFont:l.getFont()},z2:10}))}),this)},_resetInterval:function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[aG(e[0],[0,100],t,!0),aG(e[1],[0,100],t,!0)]},_updateInterval:function(e,t){var i=this.dataZoomModel,n=this._handleEnds,a=this._getViewExtent(),r=i.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];LL(t,n,a,i.get("zoomLock")?"all":e,null!=r.minSpan?aG(r.minSpan,o,a,!0):null,null!=r.maxSpan?aG(r.maxSpan,o,a,!0):null);var s=this._range,l=this._range=rG([aG(n[0],a,o,!0),aG(n[1],a,o,!0)]);return!s||s[0]!==l[0]||s[1]!==l[1]},_updateView:function(e){var t=this._displayables,i=this._handleEnds,n=rG(i.slice()),a=this._size;sG([0,1],(function(e){var n=t.handles[e],r=this._handleHeight;n.attr({scale:[r/2,r/2],position:[i[e],a[1]/2-r/2]})}),this),t.filler.setShape({x:n[0],y:0,width:n[1]-n[0],height:a[1]}),this._updateDataInfo(e)},_updateDataInfo:function(e){var t=this.dataZoomModel,i=this._displayables,n=i.handleLabels,a=this._orient,r=["",""];if(t.get("showDetail")){var o=t.findRepresentativeAxisProxy();if(o){var s=o.getAxisModel().axis,l=this._range,u=e?o.calculateDataWindow({start:l[0],end:l[1]}).valueWindow:o.getDataValueWindow();r=[this._formatLabel(u[0],s),this._formatLabel(u[1],s)]}}var h=rG(this._handleEnds.slice());function c(e){var t=tc.getTransform(i.handles[e].parent,this.group),o=tc.transformDirection(0===e?"right":"left",t),s=this._handleWidth/2+5,l=tc.applyTransform([h[e]+(0===e?-s:s),this._size[1]/2],t);n[e].setStyle({x:l[0],y:l[1],textVerticalAlign:a===lG?"middle":o,textAlign:a===lG?o:"center",text:r[e]})}c.call(this,0),c.call(this,1)},_formatLabel:function(e,t){var i=this.dataZoomModel,n=i.get("labelFormatter"),a=i.get("labelPrecision");null!=a&&"auto"!==a||(a=t.getPixelPrecision());var r=null==e||isNaN(e)?"":"category"===t.type||"time"===t.type?t.scale.getLabel(Math.round(e)):e.toFixed(Math.min(a,20));return Ve.isFunction(n)?n(e,r):Ve.isString(n)?n.replace("{value}",r):r},_showDataInfo:function(e){e=this._dragging||e;var t=this._displayables.handleLabels;t[0].attr("invisible",!e),t[1].attr("invisible",!e)},_onDragMove:function(e,t,i,n){this._dragging=!0,Et.stop(n.event);var a=this._displayables.barGroup.getLocalTransform(),r=tc.applyTransform([t,i],a,!0),o=this._updateInterval(e,r[0]),s=this.dataZoomModel.get("realtime");this._updateView(!s),o&&s&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get("realtime")&&this._dispatchZoomAction()},_onClickPanelClick:function(e){var t=this._size,i=this._displayables.barGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(i[0]<0||i[0]>t[0]||i[1]<0||i[1]>t[1])){var n=this._handleEnds,a=(n[0]+n[1])/2,r=this._updateInterval("all",i[0]-a);this._updateView(),r&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var e=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:e[0],end:e[1]})},_findCoordRect:function(){var e;if(sG(this.getTargetCoordInfo(),(function(t){if(!e&&t.length){var i=t[0].model.coordinateSystem;e=i.getRect&&i.getRect()}})),!e){var t=this.api.getWidth(),i=this.api.getHeight();e={x:.2*t,y:.2*i,width:.6*t,height:.6*i}}return e}});function dG(e){return"vertical"===e?"ns-resize":"ew-resize"}OB.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var pG="\0_ec_dataZoom_roams";function fG(e){var t=e.getZr();return t[pG]||(t[pG]={})}function gG(e){Ve.each(e,(function(t,i){t.count||(t.controller.dispose(),delete e[i])}))}function mG(e,t){e.dispatchAction({type:"dataZoom",batch:t})}var vG=function(e,t){var i=fG(e),n=t.dataZoomId,a=t.coordId;Ve.each(i,(function(e,i){var r=e.dataZoomInfos;r[n]&&Ve.indexOf(t.allCoordIds,a)<0&&(delete r[n],e.count--)})),gG(i);var r=i[a];r||((r=i[a]={coordId:a,dataZoomInfos:{},count:0}).controller=function(e,t){var i=new XI(e.getZr());return Ve.each(["pan","zoom","scrollMove"],(function(e){i.on(e,(function(i){var n=[];Ve.each(t.dataZoomInfos,(function(a){if(i.isAvailableBehavior(a.dataZoomModel.option)){var r=(a.getRange||{})[e],o=r&&r(t.controller,i);!a.dataZoomModel.get("disabled",!0)&&o&&n.push({dataZoomId:a.dataZoomId,start:o[0],end:o[1]})}})),n.length&&t.dispatchAction(n)}))})),i}(e,r),r.dispatchAction=Ve.curry(mG,e)),!r.dataZoomInfos[n]&&r.count++,r.dataZoomInfos[n]=t;var o,s,l,u,h,c=(o=r.dataZoomInfos,l="type_",u={type_true:2,type_move:1,type_false:0,type_undefined:-1},h=!0,Ve.each(o,(function(e){var t=e.dataZoomModel,i=!t.get("disabled",!0)&&(!t.get("zoomLock",!0)||"move");u[l+i]>u[l+s]&&(s=i),h&=t.get("preventDefaultMouseMove",!0)})),{controlType:s,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!h}});r.controller.enable(c.controlType,c.opt),r.controller.setPointerChecker(t.containsPoint),Cg.createOrUpdate(r,"dispatchAction",t.dataZoomModel.get("throttle",!0),"fixRate")},yG={register:vG,unregister:function(e,t){var i=fG(e);Ve.each(i,(function(e){e.controller.dispose();var i=e.dataZoomInfos;i[t]&&(delete i[t],e.count--)})),gG(i)},generateCoordId:function(e){return e.type+"\0_"+e.id}},xG=Ve.bind,_G=EB.extend({type:"dataZoom.inside",init:function(e,t){this._range},render:function(e,t,i,n){_G.superApply(this,"render",arguments),this._range=e.getPercentRange(),Ve.each(this.getTargetCoordInfo(),(function(t,n){var a=Ve.map(t,(function(e){return yG.generateCoordId(e.model)}));Ve.each(t,(function(t){var r=t.model,o={};Ve.each(["pan","zoom","scrollMove"],(function(e){o[e]=xG(bG[e],this,t,n)}),this),yG.register(i,{coordId:yG.generateCoordId(r),allCoordIds:a,containsPoint:function(e,t,i){return r.coordinateSystem.containPoint([t,i])},dataZoomId:e.id,dataZoomModel:e,getRange:o})}),this)}),this)},dispose:function(){yG.unregister(this.api,this.dataZoomModel.id),_G.superApply(this,"dispose",arguments),this._range=null}}),bG={zoom:function(e,t,i,n){var a=this._range,r=a.slice(),o=e.axisModels[0];if(o){var s=SG[t](null,[n.originX,n.originY],o,i,e),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(r[1]-r[0])+r[0],u=Math.max(1/n.scale,0);r[0]=(r[0]-l)*u+l,r[1]=(r[1]-l)*u+l;var h=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();return LL(0,r,[0,100],0,h.minSpan,h.maxSpan),this._range=r,a[0]!==r[0]||a[1]!==r[1]?r:void 0}},pan:wG((function(e,t,i,n,a,r){var o=SG[n]([r.oldX,r.oldY],[r.newX,r.newY],t,a,i);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:wG((function(e,t,i,n,a,r){return SG[n]([0,0],[r.scrollDelta,r.scrollDelta],t,a,i).signal*(e[1]-e[0])*r.scrollDelta}))};function wG(e){return function(t,i,n,a){var r=this._range,o=r.slice(),s=t.axisModels[0];if(s){var l=e(o,s,t,i,n,a);return LL(l,o,[0,100],"all"),this._range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}}}var SG={grid:function(e,t,i,n,a){var r=i.axis,o={},s=a.model.coordinateSystem.getRect();return e=e||[0,0],"x"===r.dim?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=r.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=r.inverse?-1:1),o},polar:function(e,t,i,n,a){var r=i.axis,o={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),"radiusAxis"===i.mainType?(o.pixel=t[0]-e[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=r.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=r.inverse?-1:1),o},singleAxis:function(e,t,i,n,a){var r=i.axis,o=a.model.coordinateSystem.getRect(),s={};return e=e||[0,0],"horizontal"===r.orient?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=r.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=r.inverse?-1:1),s}},MG=Ve.each;function IG(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var TG=function(e){var t=e&&e.visualMap;Ve.isArray(t)||(t=t?[t]:[]),MG(t,(function(e){if(e){IG(e,"splitList")&&!IG(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&Ve.isArray(t)&&MG(t,(function(e){Ve.isObject(e)&&(IG(e,"start")&&!IG(e,"min")&&(e.min=e.start),IG(e,"end")&&!IG(e,"max")&&(e.max=e.end))}))}}))};ud.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}));var AG=X_.PRIORITY.VISUAL.COMPONENT;function CG(e,t,i,n){for(var a=t.targetVisuals[n],r=pC.prepareVisualTypes(a),o={color:e.getData().getVisual("color")},s=0,l=r.length;s<l;s++){var u=r[s],h=a["opacity"===u?"__alphaForOpacity":u];h&&h.applyVisual(i,c,d)}return o.color;function c(e){return o[e]}function d(e,t){o[e]=t}}X_.registerVisual(AG,{createOnAllSeries:!0,reset:function(e,t){var i=[];return t.eachComponent("visualMap",(function(t){var n=e.pipelineContext;!t.isTargetSeries(e)||n&&n.large||i.push(mV.incrementalApplyVisual(t.stateList,t.targetVisuals,Ve.bind(t.getValueState,t),t.getDataDimension(e.getData())))})),i}}),X_.registerVisual(AG,{createOnAllSeries:!0,reset:function(e,t){var i=e.getData(),n=[];t.eachComponent("visualMap",(function(t){if(t.isTargetSeries(e)){var a=t.getVisualMeta(Ve.bind(CG,null,e,t))||{stops:[],outerColors:[]},r=t.getDataDimension(i),o=i.getDimensionInfo(r);null!=o&&(a.dimension=o.index,n.push(a))}})),e.getData().setVisual("visualMeta",n)}});var DG={get:function(e,t,i){var n=Ve.clone((LG[e]||{})[t]);return i&&Ve.isArray(n)?n[n.length-1]:n}},LG={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},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]}},PG=DG,kG=pC.mapVisual,OG=pC.eachVisual,RG=Ve.isArray,EG=Ve.each,NG=Pc.asc,zG=Pc.linearMap,BG=Ve.noop,VG=X_.extendComponentModel({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(e,t,i){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(e,i)},optionUpdated:function(e,t){var i=this.option;ie.canvasSupported||(i.realtime=!1),!t&&mV.replaceVisualOption(i,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(e){var t=this.stateList;e=Ve.bind(e,this),this.controllerVisuals=mV.createVisualMappings(this.option.controller,t,e),this.targetVisuals=mV.createVisualMappings(this.option.target,t,e)},getTargetSeriesIndices:function(){var e=this.option.seriesIndex,t=[];return null==e||"all"===e?this.ecModel.eachSeries((function(e,i){t.push(i)})):t=Ro.normalizeToArray(e),t},eachTargetSeries:function(e,t){Ve.each(this.getTargetSeriesIndices(),(function(i){e.call(t,this.ecModel.getSeriesByIndex(i))}),this)},isTargetSeries:function(e){var t=!1;return this.eachTargetSeries((function(i){i===e&&(t=!0)})),t},formatValueText:function(e,t,i){var n,a,r=this.option,o=r.precision,s=this.dataBound,l=r.formatter;return i=i||["<",">"],Ve.isArray(e)&&(e=e.slice(),n=!0),a=t?e:n?[u(e[0]),u(e[1])]:u(e),Ve.isString(l)?l.replace("{value}",n?a[0]:a).replace("{value2}",n?a[1]:a):Ve.isFunction(l)?n?l(e[0],e[1]):l(e):n?e[0]===s[0]?i[0]+" "+a[1]:e[1]===s[1]?i[1]+" "+a[0]:a[0]+" - "+a[1]:a;function u(e){return e===s[0]?"min":e===s[1]?"max":(+e).toFixed(Math.min(o,20))}},resetExtent:function(){var e=this.option,t=NG([e.min,e.max]);this._dataExtent=t},getDataDimension:function(e){var t=this.option.dimension,i=e.dimensions;if(null!=t||i.length){if(null!=t)return e.getDimension(t);for(var n=e.dimensions,a=n.length-1;a>=0;a--){var r=n[a];if(!e.getDimensionInfo(r).isCalculationCoord)return r}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var e=this.ecModel,t=this.option,i={inRange:t.inRange,outOfRange:t.outOfRange},n=t.target||(t.target={}),a=t.controller||(t.controller={});Ve.merge(n,i),Ve.merge(a,i);var r=this.isCategory();function o(i){RG(t.color)&&!i.inRange&&(i.inRange={color:t.color.slice().reverse()}),i.inRange=i.inRange||{color:e.get("gradientColor")},EG(this.stateList,(function(e){var t=i[e];if(Ve.isString(t)){var n=PG.get(t,"active",r);n?(i[e]={},i[e][t]=n):delete i[e]}}),this)}o.call(this,n),o.call(this,a),function(e,t,i){var n=e[t],a=e[i];n&&!a&&(a=e[i]={},EG(n,(function(e,t){if(pC.isValidType(t)){var i=PG.get(t,"inactive",r);null!=i&&(a[t]=i,"color"!==t||a.hasOwnProperty("opacity")||a.hasOwnProperty("colorAlpha")||(a.opacity=[0,0]))}})))}.call(this,n,"inRange","outOfRange"),function(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,i=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,n=this.get("inactiveColor");EG(this.stateList,(function(a){var o=this.itemSize,s=e[a];s||(s=e[a]={color:r?n:[n]}),null==s.symbol&&(s.symbol=t&&Ve.clone(t)||(r?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=i&&Ve.clone(i)||(r?o[0]:[o[0],o[0]])),s.symbol=kG(s.symbol,(function(e){return"none"===e||"square"===e?"roundRect":e}));var l=s.symbolSize;if(null!=l){var u=-1/0;OG(l,(function(e){e>u&&(u=e)})),s.symbolSize=kG(l,(function(e){return zG(e,[0,u],[0,o[0]],!0)}))}}),this)}.call(this,a)},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:BG,getValueState:BG,getVisualMeta:BG}),FG=VG,GG=[20,140],HG=FG.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(e,t){HG.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},resetItemSize:function(){HG.superApply(this,"resetItemSize",arguments);var e=this.itemSize;"horizontal"===this._orient&&e.reverse(),(null==e[0]||isNaN(e[0]))&&(e[0]=GG[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=GG[1])},_resetRange:function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):Ve.isArray(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},completeVisualOption:function(){FG.prototype.completeVisualOption.apply(this,arguments),Ve.each(this.stateList,(function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=0)}),this)},setSelected:function(e){this.option.range=e.slice(),this._resetRange()},getSelected:function(){var e=this.getExtent(),t=Pc.asc((this.get("range")||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},getValueState:function(e){var t=this.option.range,i=this.getExtent();return(t[0]<=i[0]||t[0]<=e)&&(t[1]>=i[1]||e<=t[1])?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],a=i.getData();a.each(this.getDataDimension(a),(function(t,i){e[0]<=t&&t<=e[1]&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getVisualMeta:function(e){var t=WG(this,"outOfRange",this.getExtent()),i=WG(this,"inRange",this.option.range.slice()),n=[];function a(t,i){n.push({value:t,color:e(t,i)})}for(var r=0,o=0,s=i.length,l=t.length;o<l&&(!i.length||t[o]<=i[0]);o++)t[o]<i[r]&&a(t[o],"outOfRange");for(var u=1;r<s;r++,u=0)u&&n.length&&a(i[r],"outOfRange"),a(i[r],"inRange");for(u=1;o<l;o++)(!i.length||i[i.length-1]<t[o])&&(u&&(n.length&&a(n[n.length-1].value,"outOfRange"),u=0),a(t[o],"outOfRange"));var h=n.length;return{stops:n,outerColors:[h?n[0].color:"transparent",h?n[h-1].color:"transparent"]}}});function WG(e,t,i){if(i[0]===i[1])return i.slice();for(var n=(i[1]-i[0])/200,a=i[0],r=[],o=0;o<=200&&a<i[1];o++)r.push(a),a+=n;return r.push(i[1]),r}var UG=X_.extendComponentView({type:"visualMap",autoPositionValues:{left:1,right:1,top:1,bottom:1},init:function(e,t){this.ecModel=e,this.api=t,this.visualMapModel},render:function(e,t,i,n){this.visualMapModel=e,!1!==e.get("show")?this.doRender.apply(this,arguments):this.group.removeAll()},renderBackground:function(e){var t=this.visualMapModel,i=Uc.normalizeCssArray(t.get("padding")||0),n=e.getBoundingRect();e.add(new tc.Rect({z2:-1,silent:!0,shape:{x:n.x-i[3],y:n.y-i[0],width:n.width+i[3]+i[1],height:n.height+i[0]+i[2]},style:{fill:t.get("backgroundColor"),stroke:t.get("borderColor"),lineWidth:t.get("borderWidth")}}))},getControllerVisual:function(e,t,i){var n=(i=i||{}).forceState,a=this.visualMapModel,r={};if("symbol"===t&&(r.symbol=a.get("itemSymbol")),"color"===t){var o=a.get("contentColor");r.color=o}function s(e){return r[e]}function l(e,t){r[e]=t}var u=a.controllerVisuals[n||a.getValueState(e)],h=pC.prepareVisualTypes(u);return Ve.each(h,(function(n){var a=u[n];i.convertOpacityToAlpha&&"opacity"===n&&(n="colorAlpha",a=u.__alphaForOpacity),pC.dependsOn(n,t)&&a&&a.applyVisual(e,s,l)})),r[t]},positionGroup:function(e){var t=this.visualMapModel,i=this.api;nd.positionElement(e,t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},doRender:Ve.noop}),jG=UG,ZG=nd.getLayoutRect;var YG=function(e,t,i){var n=e.option,a=n.align;if(null!=a&&"auto"!==a)return a;for(var r={width:t.getWidth(),height:t.getHeight()},o="horizontal"===n.orient?1:0,s=[["left","right","width"],["top","bottom","height"]],l=s[o],u=[0,null,10],h={},c=0;c<3;c++)h[s[1-o][c]]=u[c],h[l[c]]=2===c?i[0]:n[l[c]];var d=[["x","width",3],["y","height",0]][o],p=ZG(h,r,n.padding);return l[(p.margin[d[2]]||0)+p[d[0]]+.5*p[d[1]]<.5*r[d[1]]?0:1]},XG={getItemAlign:YG,makeHighDownBatch:function(e,t){return Ve.each(e||[],(function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")})),e}},qG=Pc.linearMap,$G=Ve.each,KG=Math.min,JG=Math.max,QG=jG.extend({type:"visualMap.continuous",init:function(){QG.superApply(this,"init",arguments),this._shapes={},this._dataInterval=[],this._handleEnds=[],this._orient,this._useHandle,this._hoverLinkDataIndices=[],this._dragging,this._hovering},doRender:function(e,t,i,n){n&&"selectDataRange"===n.type&&n.from===this.uid||this._buildView()},_buildView:function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get("orient"),this._useHandle=e.get("calculable"),this._resetInterval(),this._renderBar(t);var i=e.get("text");this._renderEndsText(t,i,0),this._renderEndsText(t,i,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},_renderEndsText:function(e,t,i){if(t){var n=t[1-i];n=null!=n?n+"":"";var a=this.visualMapModel,r=a.get("textGap"),o=a.itemSize,s=this._shapes.barGroup,l=this._applyTransform([o[0]/2,0===i?-r:o[1]+r],s),u=this._applyTransform(0===i?"bottom":"top",s),h=this._orient,c=this.visualMapModel.textStyleModel;this.group.add(new tc.Text({style:{x:l[0],y:l[1],textVerticalAlign:"horizontal"===h?"middle":u,textAlign:"horizontal"===h?u:"center",text:n,textFont:c.getFont(),textFill:c.getTextColor()}}))}},_renderBar:function(e){var t=this.visualMapModel,i=this._shapes,n=t.itemSize,a=this._orient,r=this._useHandle,o=XG.getItemAlign(t,this.api,n),s=i.barGroup=this._createBarGroup(o);s.add(i.outOfRange=eH()),s.add(i.inRange=eH(null,r?iH(this._orient):null,Ve.bind(this._dragHandle,this,"all",!1),Ve.bind(this._dragHandle,this,"all",!0)));var l=t.textStyleModel.getTextRect("国"),u=JG(l.width,l.height);r&&(i.handleThumbs=[],i.handleLabels=[],i.handleLabelPoints=[],this._createHandle(s,0,n,u,a,o),this._createHandle(s,1,n,u,a,o)),this._createIndicator(s,n,u,a),e.add(s)},_createHandle:function(e,t,i,n,a){var r=Ve.bind(this._dragHandle,this,t,!1),o=Ve.bind(this._dragHandle,this,t,!0),s=eH(function(e,t){return 0===e?[[0,0],[t,0],[t,-t]]:[[0,0],[t,0],[t,t]]}(t,n),iH(this._orient),r,o);s.position[0]=i[0],e.add(s);var l=this.visualMapModel.textStyleModel,u=new tc.Text({draggable:!0,drift:r,onmousemove:function(e){Et.stop(e.event)},ondragend:o,style:{x:0,y:0,text:"",textFont:l.getFont(),textFill:l.getTextColor()}});this.group.add(u);var h=["horizontal"===a?n/2:1.5*n,"horizontal"===a?0===t?-1.5*n:1.5*n:0===t?-n/2:n/2],c=this._shapes;c.handleThumbs[t]=s,c.handleLabelPoints[t]=h,c.handleLabels[t]=u},_createIndicator:function(e,t,i,n){var a=eH([[0,0]],"move");a.position[0]=t[0],a.attr({invisible:!0,silent:!0}),e.add(a);var r=this.visualMapModel.textStyleModel,o=new tc.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textFont:r.getFont(),textFill:r.getTextColor()}});this.group.add(o);var s=["horizontal"===n?i/2:9,0],l=this._shapes;l.indicator=a,l.indicatorLabel=o,l.indicatorLabelPoint=s},_dragHandle:function(e,t,i,n){if(this._useHandle){if(this._dragging=!t,!t){var a=this._applyTransform([i,n],this._shapes.barGroup,!0);this._updateInterval(e,a[1]),this._updateView()}t===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?!this._hovering&&this._clearHoverLinkToSeries():tH(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},_resetInterval:function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),i=e.getExtent(),n=[0,e.itemSize[1]];this._handleEnds=[qG(t[0],i,n,!0),qG(t[1],i,n,!0)]},_updateInterval:function(e,t){t=t||0;var i=this.visualMapModel,n=this._handleEnds,a=[0,i.itemSize[1]];LL(t,n,a,e,0);var r=i.getExtent();this._dataInterval=[qG(n[0],a,r,!0),qG(n[1],a,r,!0)]},_updateView:function(e){var t=this.visualMapModel,i=t.getExtent(),n=this._shapes,a=[0,t.itemSize[1]],r=e?a:this._handleEnds,o=this._createBarVisual(this._dataInterval,i,r,"inRange"),s=this._createBarVisual(i,i,a,"outOfRange");n.inRange.setStyle({fill:o.barColor,opacity:o.opacity}).setShape("points",o.barPoints),n.outOfRange.setStyle({fill:s.barColor,opacity:s.opacity}).setShape("points",s.barPoints),this._updateHandle(r,o)},_createBarVisual:function(e,t,i,n){var a={forceState:n,convertOpacityToAlpha:!0},r=this._makeColorGradient(e,a),o=[this.getControllerVisual(e[0],"symbolSize",a),this.getControllerVisual(e[1],"symbolSize",a)],s=this._createBarPoints(i,o);return{barColor:new zu(0,0,0,1,r),barPoints:s,handlesColor:[r[0].color,r[r.length-1].color]}},_makeColorGradient:function(e,t){var i=[],n=(e[1]-e[0])/100;i.push({color:this.getControllerVisual(e[0],"color",t),offset:0});for(var a=1;a<100;a++){var r=e[0]+n*a;if(r>e[1])break;i.push({color:this.getControllerVisual(r,"color",t),offset:a/100})}return i.push({color:this.getControllerVisual(e[1],"color",t),offset:1}),i},_createBarPoints:function(e,t){var i=this.visualMapModel.itemSize;return[[i[0]-t[0],e[0]],[i[0],e[0]],[i[0],e[1]],[i[0]-t[1],e[1]]]},_createBarGroup:function(e){var t=this._orient,i=this.visualMapModel.get("inverse");return new tc.Group("horizontal"!==t||i?"horizontal"===t&&i?{scale:"bottom"===e?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==t||i?{scale:"left"===e?[1,1]:[-1,1]}:{scale:"left"===e?[1,-1]:[-1,-1]}:{scale:"bottom"===e?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(e,t){if(this._useHandle){var i=this._shapes,n=this.visualMapModel,a=i.handleThumbs,r=i.handleLabels;$G([0,1],(function(o){var s=a[o];s.setStyle("fill",t.handlesColor[o]),s.position[1]=e[o];var l=tc.applyTransform(i.handleLabelPoints[o],tc.getTransform(s,this.group));r[o].setStyle({x:l[0],y:l[1],text:n.formatValueText(this._dataInterval[o]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===o?"bottom":"top":"left",i.barGroup)})}),this)}},_showIndicator:function(e,t,i,n){var a=this.visualMapModel,r=a.getExtent(),o=a.itemSize,s=[0,o[1]],l=qG(e,r,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(e,t,i,n){return e?[[0,-KG(t,JG(i,0))],[6,0],[0,KG(t,JG(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,o[1]));var c=this.getControllerVisual(e,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=tc.applyTransform(u.indicatorLabelPoint,tc.getTransform(h,this.group)),p=u.indicatorLabel;p.attr("invisible",!1);var f=this._applyTransform("left",u.barGroup),g=this._orient;p.setStyle({text:(i||"")+a.formatValueText(t),textVerticalAlign:"horizontal"===g?f:"middle",textAlign:"horizontal"===g?"center":f,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var e=this;this._shapes.barGroup.on("mousemove",(function(t){if(e._hovering=!0,!e._dragging){var i=e.visualMapModel.itemSize,n=e._applyTransform([t.offsetX,t.offsetY],e._shapes.barGroup,!0,!0);n[1]=KG(JG(0,n[1]),i[1]),e._doHoverLinkToSeries(n[1],0<=n[0]&&n[0]<=i[0])}})).on("mouseout",(function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()}))},_enableHoverLinkFromSeries:function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),e.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(e,t){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var a=[0,n[1]],r=i.getExtent();e=KG(JG(a[0],e),a[1]);var o=function(e,t,i){var n=6,a=e.get("hoverLinkDataSize");a&&(n=qG(a,t,i,!0)/2);return n}(i,r,a),s=[e-o,e+o],l=qG(e,a,r,!0),u=[qG(s[0],a,r,!0),qG(s[1],a,r,!0)];s[0]<a[0]&&(u[0]=-1/0),s[1]>a[1]&&(u[1]=1/0),t&&(u[0]===-1/0?this._showIndicator(l,u[1],"< ",o):u[1]===1/0?this._showIndicator(l,u[0],"> ",o):this._showIndicator(l,l,"≈ ",o));var h=this._hoverLinkDataIndices,c=[];(t||tH(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=Ro.compressBatches(h,c);this._dispatchHighDown("downplay",XG.makeHighDownBatch(d[0],i)),this._dispatchHighDown("highlight",XG.makeHighDownBatch(d[1],i))}},_hoverLinkFromSeriesMouseOver:function(e){var t=e.target,i=this.visualMapModel;if(t&&null!=t.dataIndex){var n=this.ecModel.getSeriesByIndex(t.seriesIndex);if(i.isTargetSeries(n)){var a=n.getData(t.dataType),r=a.get(i.getDataDimension(a),t.dataIndex,!0);isNaN(r)||this._showIndicator(r,r)}}},_hideIndicator:function(){var e=this._shapes;e.indicator&&e.indicator.attr("invisible",!0),e.indicatorLabel&&e.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",XG.makeHighDownBatch(e,this.visualMapModel)),e.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var e=this.api.getZr();e.off("mouseover",this._hoverLinkFromSeriesMouseOver),e.off("mouseout",this._hideIndicator)},_applyTransform:function(e,t,i,n){var a=tc.getTransform(t,n?null:this.group);return tc[Ve.isArray(e)?"applyTransform":"transformDirection"](e,a,i)},_dispatchHighDown:function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});function eH(e,t,i,n){return new tc.Polygon({shape:{points:e},draggable:!!i,cursor:t,drift:i,onmousemove:function(e){Et.stop(e.event)},ondragend:n})}function tH(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function iH(e){return"vertical"===e?"ns-resize":"ew-resize"}X_.registerAction({type:"selectDataRange",event:"dataRangeSelected",update:"update"},(function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))})),X_.registerPreprocessor(TG);var nH=Pc.reformIntervals,aH=FG.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(e,t){aH.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var i=this._mode=this._determineMode();rH[this._mode].call(this),this._resetSelected(e,t);var n=this.option.categories;this.resetVisual((function(e,t){"categories"===i?(e.mappingMethod="category",e.categories=Ve.clone(n)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=Ve.map(this._pieceList,(function(e){e=Ve.clone(e);return"inRange"!==t&&(e.visual=null),e})))}))},completeVisualOption:function(){var e=this.option,t={},i=pC.listVisualTypes(),n=this.isCategory();function a(e,t,i){return e&&e[t]&&(Ve.isObject(e[t])?e[t].hasOwnProperty(i):e[t]===i)}Ve.each(e.pieces,(function(e){Ve.each(i,(function(i){e.hasOwnProperty(i)&&(t[i]=1)}))})),Ve.each(t,(function(t,i){var r=0;Ve.each(this.stateList,(function(t){r|=a(e,t,i)||a(e.target,t,i)}),this),!r&&Ve.each(this.stateList,(function(t){(e[t]||(e[t]={}))[i]=PG.get(i,"inRange"===t?"active":"inactive",n)}))}),this),FG.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(e,t){var i=this.option,n=this._pieceList,a=(t?i:e).selected||{};if(i.selected=a,Ve.each(n,(function(e,t){var i=this.getSelectedMapKey(e);a.hasOwnProperty(i)||(a[i]=!0)}),this),"single"===i.selectedMode){var r=!1;Ve.each(n,(function(e,t){var i=this.getSelectedMapKey(e);a[i]&&(r?a[i]=!1:r=!0)}),this)}},getSelectedMapKey:function(e){return"categories"===this._mode?e.value+"":e.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var e=this.option;return e.pieces&&e.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(e){this.option.selected=Ve.clone(e)},getValueState:function(e){var t=pC.findPieceIndex(e,this._pieceList);return null!=t&&this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?"inRange":"outOfRange"},findTargetDataIndices:function(e){var t=[];return this.eachTargetSeries((function(i){var n=[],a=i.getData();a.each(this.getDataDimension(a),(function(t,i){pC.findPieceIndex(t,this._pieceList)===e&&n.push(i)}),this),t.push({seriesId:i.id,dataIndex:n})}),this),t},getRepresentValue:function(e){var t;if(this.isCategory())t=e.value;else if(null!=e.value)t=e.value;else{var i=e.interval||[];t=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return t},getVisualMeta:function(e){if(!this.isCategory()){var t=[],i=[],n=this,a=this._pieceList.slice();if(a.length){var r=a[0].interval[0];r!==-1/0&&a.unshift({interval:[-1/0,r]}),(r=a[a.length-1].interval[1])!==1/0&&a.push({interval:[r,1/0]})}else a.push({interval:[-1/0,1/0]});var o=-1/0;return Ve.each(a,(function(e){var t=e.interval;t&&(t[0]>o&&s([o,t[0]],"outOfRange"),s(t.slice()),o=t[1])}),this),{stops:t,outerColors:i}}function s(a,r){var o=n.getRepresentValue({interval:a});r||(r=n.getValueState(o));var s=e(o,r);a[0]===-1/0?i[0]=s:a[1]===1/0?i[1]=s:t.push({value:a[0],color:s},{value:a[1],color:s})}}}),rH={splitNumber:function(){var e=this.option,t=this._pieceList,i=Math.min(e.precision,20),n=this.getExtent(),a=e.splitNumber;a=Math.max(parseInt(a,10),1),e.splitNumber=a;for(var r=(n[1]-n[0])/a;+r.toFixed(i)!==r&&i<5;)i++;e.precision=i,r=+r.toFixed(i),e.minOpen&&t.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o<a;s+=r,o++){var l=o===a-1?n[1]:s+r;t.push({interval:[s,l],close:[1,1]})}e.maxOpen&&t.push({interval:[n[1],1/0],close:[0,0]}),nH(t),Ve.each(t,(function(e,t){e.index=t,e.text=this.formatValueText(e.interval)}),this)},categories:function(){var e=this.option;Ve.each(e.categories,(function(e){this._pieceList.push({text:this.formatValueText(e,!0),value:e})}),this),oH(e,this._pieceList)},pieces:function(){var e=this.option,t=this._pieceList;Ve.each(e.pieces,(function(e,i){Ve.isObject(e)||(e={value:e});var n={text:"",index:i};if(null!=e.label&&(n.text=e.label),e.hasOwnProperty("value")){var a=n.value=e.value;n.interval=[a,a],n.close=[1,1]}else{for(var r=n.interval=[],o=n.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==r[h];d++)r[h]=e[c[d]],o[h]=s[d],u[h]=2===d;null==r[h]&&(r[h]=l[h])}u[0]&&r[1]===1/0&&(o[0]=0),u[1]&&r[0]===-1/0&&(o[1]=0),r[0]===r[1]&&o[0]&&o[1]&&(n.value=r[0])}n.visual=pC.retrieveVisuals(e),t.push(n)}),this),oH(e,t),nH(t),Ve.each(t,(function(e){var t=e.close,i=[["<","≤"][t[1]],[">","≥"][t[0]]];e.text=e.text||this.formatValueText(null!=e.value?e.value:e.interval,!1,i)}),this)}};function oH(e,t){var i=e.inverse;("vertical"===e.orient?!i:i)&&t.reverse()}var sH=jx.createSymbol;jG.extend({type:"visualMap.piecewise",doRender:function(){var e=this.group;e.removeAll();var t=this.visualMapModel,i=t.get("textGap"),n=t.textStyleModel,a=n.getFont(),r=n.getTextColor(),o=this._getItemAlign(),s=t.itemSize,l=this._getViewData(),u=l.endsText,h=Ve.retrieve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,h,o),Ve.each(l.viewPieceList,(function(n){var l=n.piece,u=new tc.Group;u.onclick=Ve.bind(this._onItemClick,this,l),this._enableHoverLink(u,n.indexInModelPieceList);var c=t.getRepresentValue(l);if(this._createItemSymbol(u,c,[0,0,s[0],s[1]]),h){var d=this.visualMapModel.getValueState(c);u.add(new tc.Text({style:{x:"right"===o?-i:s[0]+i,y:s[1]/2,text:l.text,textVerticalAlign:"middle",textAlign:o,textFont:a,textFill:r,opacity:"outOfRange"===d?.5:1}}))}e.add(u)}),this),u&&this._renderEndsText(e,u[1],s,h,o),nd.box(t.get("orient"),e,t.get("itemGap")),this.renderBackground(e),this.positionGroup(e)},_enableHoverLink:function(e,t){function i(e){var i=this.visualMapModel;i.option.hoverLink&&this.api.dispatchAction({type:e,batch:XG.makeHighDownBatch(i.findTargetDataIndices(t),i)})}e.on("mouseover",Ve.bind(i,this,"highlight")).on("mouseout",Ve.bind(i,this,"downplay"))},_getItemAlign:function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return XG.getItemAlign(e,this.api,e.itemSize);var i=t.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(e,t,i,n,a){if(t){var r=new tc.Group,o=this.visualMapModel.textStyleModel;r.add(new tc.Text({style:{x:n?"right"===a?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?a:"center",text:t,textFont:o.getFont(),textFill:o.getTextColor()}})),e.add(r)}},_getViewData:function(){var e=this.visualMapModel,t=Ve.map(e.getPieceList(),(function(e,t){return{piece:e,indexInModelPieceList:t}})),i=e.get("text"),n=e.get("orient"),a=e.get("inverse");return("horizontal"===n?a:!a)?t.reverse():i&&(i=i.slice().reverse()),{viewPieceList:t,endsText:i}},_createItemSymbol:function(e,t,i){e.add(sH(this.getControllerVisual(t,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(t,"color")))},_onItemClick:function(e){var t=this.visualMapModel,i=t.option,n=Ve.clone(i.selected),a=t.getSelectedMapKey(e);"single"===i.selectedMode?(n[a]=!0,Ve.each(n,(function(e,t){n[t]=t===a}))):n[a]=!n[a],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}}),X_.registerPreprocessor(TG);var lH,uH="urn:schemas-microsoft-com:vml",hH="undefined"==typeof window?null:window,cH=!1,dH=hH&&hH.document;if(dH&&!ie.canvasSupported)try{!dH.namespaces.zrvml&&dH.namespaces.add("zrvml",uH),lH=function(e){return dH.createElement("<zrvml:"+e+' class="zrvml">')}}catch(e){lH=function(e){return dH.createElement("<"+e+' xmlns="'+uH+'" class="zrvml">')}}var pH={doc:dH,createNode:function(e){return lH(e)},initVML:function(){if(!cH&&dH){cH=!0;var e=dH.styleSheets;e.length<31?dH.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):e[0].addRule(".zrvml","behavior:url(#default#VML)")}}},fH=lt.applyTransform,gH=qs.CMD,mH=Math.round,vH=Math.sqrt,yH=Math.abs,xH=Math.cos,_H=Math.sin,bH=Math.max;if(!ie.canvasSupported){var wH=",",SH="progid:DXImageTransform.Microsoft",MH=21600,IH=MH/2,TH=function(e){e.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",e.coordsize=MH+","+MH,e.coordorigin="0,0"},AH=function(e,t,i){return"rgb("+[e,t,i].join(",")+")"},CH=function(e,t){t&&e&&t.parentNode!==e&&e.appendChild(t)},DH=function(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)},LH=function(e,t,i){return 1e5*(parseFloat(e)||0)+1e3*(parseFloat(t)||0)+i},PH=_r.parsePercent,kH=function(e,t,i){var n=Ui.parse(t);i=+i,isNaN(i)&&(i=1),n&&(e.color=AH(n[0],n[1],n[2]),e.opacity=i*n[3])},OH=function(e){var t=Ui.parse(e);return[AH(t[0],t[1],t[2]),t[3]]},RH=function(e,t,i,n){var a="fill"===t,r=e.getElementsByTagName(t)[0];null!=i[t]&&"none"!==i[t]&&(a||!a&&i.lineWidth)?(e[a?"filled":"stroked"]="true",i[t]instanceof Eu&&DH(e,r),r||(r=pH.createNode(t)),a?function(e,t,i){var n=t.fill;if(null!=n)if(n instanceof Eu){var a,r=0,o=[0,0],s=0,l=1,u=i.getBoundingRect(),h=u.width,c=u.height;if("linear"===n.type){a="gradient";var d=i.transform,p=[n.x*h,n.y*c],f=[n.x2*h,n.y2*c];d&&(fH(p,p,d),fH(f,f,d));var g=f[0]-p[0],m=f[1]-p[1];(r=180*Math.atan2(g,m)/Math.PI)<0&&(r+=360),r<1e-6&&(r=0)}else{a="gradientradial",p=[n.x*h,n.y*c],d=i.transform;var v=i.scale,y=h,x=c;o=[(p[0]-u.x)/y,(p[1]-u.y)/x],d&&fH(p,p,d),y/=v[0]*MH,x/=v[1]*MH;var _=bH(y,x);s=0/_,l=2*n.r/_-s}var b=n.colorStops.slice();b.sort((function(e,t){return e.offset-t.offset}));for(var w=b.length,S=[],M=[],I=0;I<w;I++){var T=b[I],A=OH(T.color);M.push(T.offset*l+s+" "+A[0]),0!==I&&I!==w-1||S.push(A)}if(w>=2){var C=S[0][0],D=S[1][0],L=S[0][1]*t.opacity,P=S[1][1]*t.opacity;e.type=a,e.method="none",e.focus="100%",e.angle=r,e.color=C,e.color2=D,e.colors=M.join(","),e.opacity=P,e.opacity2=L}"radial"===a&&(e.focusposition=o.join(","))}else kH(e,n,t.opacity)}(r,i,n):function(e,t){t.lineDash&&(e.dashstyle=t.lineDash.join(" ")),null==t.stroke||t.stroke instanceof Eu||kH(e,t.stroke,t.opacity)}(r,i),CH(e,r)):(e[a?"filled":"stroked"]="false",DH(e,r))},EH=[[],[],[]];bl.prototype.brushVML=function(e){var t=this.style,i=this._vmlEl;i||(i=pH.createNode("shape"),TH(i),this._vmlEl=i),RH(i,"fill",t,this),RH(i,"stroke",t,this);var n=this.transform,a=null!=n,r=i.getElementsByTagName("stroke")[0];if(r){var o=t.lineWidth;if(a&&!t.strokeNoScale){var s=n[0]*n[3]-n[1]*n[2];o*=vH(yH(s))}r.weight=o+"px"}var l=this.path||(this.path=new qs);this.__dirtyPath&&(l.beginPath(),l.subPixelOptimize=!1,this.buildPath(l,this.shape),l.toStatic(),this.__dirtyPath=!1),i.path=function(e,t){var i,n,a,r,o,s,l=gH.M,u=gH.C,h=gH.L,c=gH.A,d=gH.Q,p=[],f=e.data,g=e.len();for(r=0;r<g;){switch(n="",i=0,a=f[r++]){case l:n=" m ",i=1,o=f[r++],s=f[r++],EH[0][0]=o,EH[0][1]=s;break;case h:n=" l ",i=1,o=f[r++],s=f[r++],EH[0][0]=o,EH[0][1]=s;break;case d:case u:n=" c ",i=3;var m,v,y=f[r++],x=f[r++],_=f[r++],b=f[r++];a===d?(m=_,v=b,_=(_+2*y)/3,b=(b+2*x)/3,y=(o+2*y)/3,x=(s+2*x)/3):(m=f[r++],v=f[r++]),EH[0][0]=y,EH[0][1]=x,EH[1][0]=_,EH[1][1]=b,EH[2][0]=m,EH[2][1]=v,o=m,s=v;break;case c:var w=0,S=0,M=1,I=1,T=0;t&&(w=t[4],S=t[5],M=vH(t[0]*t[0]+t[1]*t[1]),I=vH(t[2]*t[2]+t[3]*t[3]),T=Math.atan2(-t[1]/I,t[0]/M));var A=f[r++],C=f[r++],D=f[r++],L=f[r++],P=f[r++]+T,k=f[r++]+P+T;r++;var O=f[r++],R=A+xH(P)*D,E=C+_H(P)*L,N=(y=A+xH(k)*D,x=C+_H(k)*L,O?" wa ":" at ");Math.abs(R-y)<1e-4&&(Math.abs(k-P)>.01?O&&(R+=270/MH):Math.abs(E-C)<1e-4?O&&R<A||!O&&R>A?x-=270/MH:x+=270/MH:O&&E<C||!O&&E>C?y+=270/MH:y-=270/MH),p.push(N,mH(((A-D)*M+w)*MH-IH),wH,mH(((C-L)*I+S)*MH-IH),wH,mH(((A+D)*M+w)*MH-IH),wH,mH(((C+L)*I+S)*MH-IH),wH,mH((R*M+w)*MH-IH),wH,mH((E*I+S)*MH-IH),wH,mH((y*M+w)*MH-IH),wH,mH((x*I+S)*MH-IH)),o=y,s=x;break;case gH.R:var z=EH[0],B=EH[1];z[0]=f[r++],z[1]=f[r++],B[0]=z[0]+f[r++],B[1]=z[1]+f[r++],t&&(fH(z,z,t),fH(B,B,t)),z[0]=mH(z[0]*MH-IH),B[0]=mH(B[0]*MH-IH),z[1]=mH(z[1]*MH-IH),B[1]=mH(B[1]*MH-IH),p.push(" m ",z[0],wH,z[1]," l ",B[0],wH,z[1]," l ",B[0],wH,B[1]," l ",z[0],wH,B[1]);break;case gH.Z:p.push(" x ")}if(i>0){p.push(n);for(var V=0;V<i;V++){var F=EH[V];t&&fH(F,F,t),p.push(mH(F[0]*MH-IH),wH,mH(F[1]*MH-IH),V<i-1?wH:"")}}}return p.join("")}(l,this.transform),i.style.zIndex=LH(this.zlevel,this.z,this.z2),CH(e,i),null!=t.text?this.drawRectText(e,this.getBoundingRect()):this.removeRectText(e)},bl.prototype.onRemove=function(e){DH(e,this._vmlEl),this.removeRectText(e)},bl.prototype.onAdd=function(e){CH(e,this._vmlEl),this.appendRectText(e)};Cr.prototype.brushVML=function(e){var t,i,n,a=this.style,r=a.image;if("object"==typeof(n=r)&&n.tagName&&"IMG"===n.tagName.toUpperCase()){var o=r.src;if(o===this._imageSrc)t=this._imageWidth,i=this._imageHeight;else{var s=r.runtimeStyle,l=s.width,u=s.height;s.width="auto",s.height="auto",t=r.width,i=r.height,s.width=l,s.height=u,this._imageSrc=o,this._imageWidth=t,this._imageHeight=i}r=o}else r===this._imageSrc&&(t=this._imageWidth,i=this._imageHeight);if(r){var h=a.x||0,c=a.y||0,d=a.width,p=a.height,f=a.sWidth,g=a.sHeight,m=a.sx||0,v=a.sy||0,y=f&&g,x=this._vmlEl;x||(x=pH.doc.createElement("div"),TH(x),this._vmlEl=x);var _,b=x.style,w=!1,S=1,M=1;if(this.transform&&(_=this.transform,S=vH(_[0]*_[0]+_[1]*_[1]),M=vH(_[2]*_[2]+_[3]*_[3]),w=_[1]||_[2]),w){var I=[h,c],T=[h+d,c],A=[h,c+p],C=[h+d,c+p];fH(I,I,_),fH(T,T,_),fH(A,A,_),fH(C,C,_);var D=bH(I[0],T[0],A[0],C[0]),L=bH(I[1],T[1],A[1],C[1]),P=[];P.push("M11=",_[0]/S,wH,"M12=",_[2]/M,wH,"M21=",_[1]/S,wH,"M22=",_[3]/M,wH,"Dx=",mH(h*S+_[4]),wH,"Dy=",mH(c*M+_[5])),b.padding="0 "+mH(D)+"px "+mH(L)+"px 0",b.filter=SH+".Matrix("+P.join("")+", SizingMethod=clip)"}else _&&(h=h*S+_[4],c=c*M+_[5]),b.filter="",b.left=mH(h)+"px",b.top=mH(c)+"px";var k=this._imageEl,O=this._cropEl;k||(k=pH.doc.createElement("div"),this._imageEl=k);var R=k.style;if(y){if(t&&i)R.width=mH(S*t*d/f)+"px",R.height=mH(M*i*p/g)+"px";else{var E=new Image,N=this;E.onload=function(){E.onload=null,t=E.width,i=E.height,R.width=mH(S*t*d/f)+"px",R.height=mH(M*i*p/g)+"px",N._imageWidth=t,N._imageHeight=i,N._imageSrc=r},E.src=r}O||((O=pH.doc.createElement("div")).style.overflow="hidden",this._cropEl=O);var z=O.style;z.width=mH((d+m*d/f)*S),z.height=mH((p+v*p/g)*M),z.filter=SH+".Matrix(Dx="+-m*d/f*S+",Dy="+-v*p/g*M+")",O.parentNode||x.appendChild(O),k.parentNode!==O&&O.appendChild(k)}else R.width=mH(S*d)+"px",R.height=mH(M*p)+"px",x.appendChild(k),O&&O.parentNode&&(x.removeChild(O),this._cropEl=null);var B="",V=a.opacity;V<1&&(B+=".Alpha(opacity="+mH(100*V)+") "),B+=SH+".AlphaImageLoader(src="+r+", SizingMethod=scale)",R.filter=B,x.style.zIndex=LH(this.zlevel,this.z,this.z2),CH(e,x),null!=a.text&&this.drawRectText(e,this.getBoundingRect())}},Cr.prototype.onRemove=function(e){DH(e,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(e)},Cr.prototype.onAdd=function(e){CH(e,this._vmlEl),this.appendRectText(e)};var NH,zH="normal",BH={},VH=0,FH=document.createElement("div");Wa.$override("measureText",(function(e,t){var i=pH.doc;NH||((NH=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",pH.doc.body.appendChild(NH));try{NH.style.font=t}catch(e){}return NH.innerHTML="",NH.appendChild(i.createTextNode(e)),{width:NH.offsetWidth}}));for(var GH=new Pn,HH=function(e,t,i,n){var a=this.style;this.__dirty&&_r.normalizeTextStyle(a,!0);var r=a.text;if(null!=r&&(r+=""),r){if(a.rich){var o=Wa.parseRichText(r,a);r=[];for(var s=0;s<o.lines.length;s++){for(var l=o.lines[s].tokens,u=[],h=0;h<l.length;h++)u.push(l[h].text);r.push(u.join(""))}r=r.join("\n")}var c,d,p=a.textAlign,f=a.textVerticalAlign,g=function(e){var t=BH[e];if(!t){VH>100&&(VH=0,BH={});var i,n=FH.style;try{n.font=e,i=n.fontFamily.split(",")[0]}catch(e){}t={style:n.fontStyle||zH,variant:n.fontVariant||zH,weight:n.fontWeight||zH,size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},BH[e]=t,VH++}return t}(a.font),m=g.style+" "+g.variant+" "+g.weight+" "+g.size+'px "'+g.family+'"';i=i||Wa.getBoundingRect(r,m,p,f,a.textPadding,a.textLineHeight);var v=this.transform;if(v&&!n&&(GH.copy(t),GH.applyTransform(v),t=GH),n)c=t.x,d=t.y;else{var y=a.textPosition;if(y instanceof Array)c=t.x+PH(y[0],t.width),d=t.y+PH(y[1],t.height),p=p||"left";else{var x=this.calculateTextPosition?this.calculateTextPosition({},a,t):Wa.calculateTextPosition({},a,t);c=x.x,d=x.y,p=p||x.textAlign,f=f||x.textVerticalAlign}}c=Wa.adjustTextX(c,i.width,p),d=Wa.adjustTextY(d,i.height,f),d+=i.height/2;var _,b,w,S=pH.createNode,M=this._textVmlEl;M?b=(_=(w=M.firstChild).nextSibling).nextSibling:(M=S("line"),_=S("path"),b=S("textpath"),w=S("skew"),b.style["v-text-align"]="left",TH(M),_.textpathok=!0,b.on=!0,M.from="0 0",M.to="1000 0.05",CH(M,w),CH(M,_),CH(M,b),this._textVmlEl=M);var I=[c,d],T=M.style;v&&n?(fH(I,I,v),w.on=!0,w.matrix=v[0].toFixed(3)+wH+v[2].toFixed(3)+wH+v[1].toFixed(3)+wH+v[3].toFixed(3)+",0,0",w.offset=(mH(I[0])||0)+","+(mH(I[1])||0),w.origin="0 0",T.left="0px",T.top="0px"):(w.on=!1,T.left=mH(c)+"px",T.top=mH(d)+"px"),b.string=String(r).replace(/&/g,"&amp;").replace(/"/g,"&quot;");try{b.style.font=m}catch(e){}RH(M,"fill",{fill:a.textFill,opacity:a.opacity},this),RH(M,"stroke",{stroke:a.textStroke,opacity:a.opacity,lineDash:a.lineDash||null},this),M.style.zIndex=LH(this.zlevel,this.z,this.z2),CH(e,M)}},WH=function(e){DH(e,this._textVmlEl),this._textVmlEl=null},UH=function(e){CH(e,this._textVmlEl)},jH=[Mr,Tr,Cr,bl,Wl],ZH=0;ZH<jH.length;ZH++){var YH=jH[ZH].prototype;YH.drawRectText=HH,YH.removeRectText=WH,YH.appendRectText=UH}Wl.prototype.brushVML=function(e){var t=this.style;null!=t.text?this.drawRectText(e,{x:t.x||0,y:t.y||0,width:0,height:0},this.getBoundingRect(),!0):this.removeRectText(e)},Wl.prototype.onRemove=function(e){this.removeRectText(e)},Wl.prototype.onAdd=function(e){this.appendRectText(e)}}var XH=Ve.each;function qH(e){return parseInt(e,10)}function $H(e,t){pH.initVML(),this.root=e,this.storage=t;var i=document.createElement("div"),n=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",n.style.cssText="position:absolute;left:0;top:0;",e.appendChild(i),this._vmlRoot=n,this._vmlViewport=i,this.resize();var a=t.delFromStorage,r=t.addToStorage;t.delFromStorage=function(e){a.call(t,e),e&&e.onRemove&&e.onRemove(n)},t.addToStorage=function(e){e.onAdd&&e.onAdd(n),r.call(t,e)},this._firstPaint=!0}$H.prototype={constructor:$H,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0,!0);this._paintList(e)},_paintList:function(e){for(var t=this._vmlRoot,i=0;i<e.length;i++){var n=e[i];n.invisible||n.ignore?(n.__alreadyNotVisible||n.onRemove(t),n.__alreadyNotVisible=!0):(n.__alreadyNotVisible&&n.onAdd(t),n.__alreadyNotVisible=!1,n.__dirty&&(n.beforeBrush&&n.beforeBrush(),(n.brushVML||n.brush).call(n,t),n.afterBrush&&n.afterBrush())),n.__dirty=!1}this._firstPaint&&(this._vmlViewport.appendChild(t),this._firstPaint=!1)},resize:function(e,t){e=null==e?this._getWidth():e,t=null==t?this._getHeight():t;if(this._width!==e||this._height!==t){this._width=e,this._height=t;var i=this._vmlViewport.style;i.width=e+"px",i.height=t+"px"}},dispose:function(){this.root.innerHTML="",this._vmlRoot=this._vmlViewport=this.storage=null},getWidth:function(){return this._width},getHeight:function(){return this._height},clear:function(){this._vmlViewport&&this.root.removeChild(this._vmlViewport)},_getWidth:function(){var e=this.root,t=e.currentStyle;return(e.clientWidth||qH(t.width))-qH(t.paddingLeft)-qH(t.paddingRight)|0},_getHeight:function(){var e=this.root,t=e.currentStyle;return(e.clientHeight||qH(t.height))-qH(t.paddingTop)-qH(t.paddingBottom)|0}},XH(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],(function(e){$H.prototype[e]=function(){}}));var KH=$H;(0,xo.registerPainter)("vml",KH);var JH={createElement:function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}},QH=JH.createElement,eW=qs.CMD,tW=Array.prototype.join,iW="none",nW=Math.round,aW=Math.sin,rW=Math.cos,oW=Math.PI,sW=2*Math.PI,lW=180/oW,uW=1e-4;function hW(e){return nW(1e4*e)/1e4}function cW(e){return e<uW&&e>-uW}function dW(e,t){t&&pW(e,"transform","matrix("+tW.call(t,",")+")")}function pW(e,t,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&e.setAttribute(t,i)}function fW(e,t,i,n){if(function(e,t){var i=t?e.textFill:e.fill;return null!=i&&i!==iW}(t,i)){var a=i?t.textFill:t.fill;pW(e,"fill",a="transparent"===a?iW:a),pW(e,"fill-opacity",null!=t.fillOpacity?t.fillOpacity*t.opacity:t.opacity)}else pW(e,"fill",iW);if(function(e,t){var i=t?e.textStroke:e.stroke;return null!=i&&i!==iW}(t,i)){var r=i?t.textStroke:t.stroke;pW(e,"stroke",r="transparent"===r?iW:r),pW(e,"stroke-width",(i?t.textStrokeWidth:t.lineWidth)/(!i&&t.strokeNoScale?n.getLineScale():1)),pW(e,"paint-order",i?"stroke":"fill"),pW(e,"stroke-opacity",null!=t.strokeOpacity?t.strokeOpacity:t.opacity),t.lineDash?(pW(e,"stroke-dasharray",t.lineDash.join(",")),pW(e,"stroke-dashoffset",nW(t.lineDashOffset||0))):pW(e,"stroke-dasharray",""),t.lineCap&&pW(e,"stroke-linecap",t.lineCap),t.lineJoin&&pW(e,"stroke-linejoin",t.lineJoin),t.miterLimit&&pW(e,"stroke-miterlimit",t.miterLimit)}else pW(e,"stroke",iW)}var gW={};gW.brush=function(e){var t=e.style,i=e.__svgEl;i||(i=QH("path"),e.__svgEl=i),e.path||e.createPathProxy();var n=e.path;if(e.__dirtyPath){n.beginPath(),n.subPixelOptimize=!1,e.buildPath(n,e.shape),e.__dirtyPath=!1;var a=function(e){for(var t=[],i=e.data,n=e.len(),a=0;a<n;){var r="",o=0;switch(i[a++]){case eW.M:r="M",o=2;break;case eW.L:r="L",o=2;break;case eW.Q:r="Q",o=4;break;case eW.C:r="C",o=6;break;case eW.A:var s=i[a++],l=i[a++],u=i[a++],h=i[a++],c=i[a++],d=i[a++],p=i[a++],f=i[a++],g=Math.abs(d),m=cW(g-sW)||(f?d>=sW:-d>=sW),v=d>0?d%sW:d%sW+sW,y=!1;y=!!m||!cW(g)&&v>=oW==!!f;var x=hW(s+u*rW(c)),_=hW(l+h*aW(c));m&&(d=f?sW-1e-4:1e-4-sW,y=!0,9===a&&t.push("M",x,_));var b=hW(s+u*rW(c+d)),w=hW(l+h*aW(c+d));t.push("A",hW(u),hW(h),nW(p*lW),+y,+f,b,w);break;case eW.Z:r="Z";break;case eW.R:b=hW(i[a++]),w=hW(i[a++]);var S=hW(i[a++]),M=hW(i[a++]);t.push("M",b,w,"L",b+S,w,"L",b+S,w+M,"L",b,w+M,"L",b,w)}r&&t.push(r);for(var I=0;I<o;I++)t.push(hW(i[a++]))}return t.join(" ")}(n);a.indexOf("NaN")<0&&pW(i,"d",a)}fW(i,t,!1,e),dW(i,e.transform),null!=t.text?wW(e,e.getBoundingRect()):MW(e)};var mW={brush:function(e){var t=e.style,i=t.image;i instanceof HTMLImageElement&&(i=i.src);if(i){var n=t.x||0,a=t.y||0,r=t.width,o=t.height,s=e.__svgEl;s||(s=QH("image"),e.__svgEl=s),i!==e.__imageSrc&&(!function(e,t,i){e.setAttributeNS("http://www.w3.org/1999/xlink",t,i)}(s,"href",i),e.__imageSrc=i),pW(s,"width",r),pW(s,"height",o),pW(s,"x",n),pW(s,"y",a),dW(s,e.transform),null!=t.text?wW(e,e.getBoundingRect()):MW(e)}}},vW={},yW=new Pn,xW={},_W=[],bW={left:"start",right:"end",center:"middle",middle:"middle"},wW=function(e,t){var i=e.style,n=e.transform,a=e instanceof Wl||i.transformText;e.__dirty&&_r.normalizeTextStyle(i,!0);var r=i.text;if(null!=r&&(r+=""),_r.needDrawText(r,i)){null==r&&(r=""),!a&&n&&(yW.copy(t),yW.applyTransform(n),t=yW);var o=e.__textSvgEl;o||(o=QH("text"),e.__textSvgEl=o);var s=o.style,l=i.font||Wa.DEFAULT_FONT,u=o.__computedFont;l!==o.__styleFont&&(s.font=o.__styleFont=l,u=o.__computedFont=s.font);var h=i.textPadding,c=i.textLineHeight,d=e.__textCotentBlock;d&&!e.__dirtyText||(d=e.__textCotentBlock=Wa.parsePlainText(r,u,h,c,i.truncate));var p=d.outerHeight,f=d.lineHeight;_r.getBoxPosition(xW,e,i,t);var g=xW.baseX,m=xW.baseY,v=xW.textAlign||"left",y=xW.textVerticalAlign;!function(e,t,i,n,a,r,o){ni.identity(_W),t&&i&&ni.copy(_W,i);var s=n.textRotation;if(a&&s){var l=n.textOrigin;"center"===l?(r=a.width/2+a.x,o=a.height/2+a.y):l&&(r=l[0]+a.x,o=l[1]+a.y),_W[4]-=r,_W[5]-=o,ni.rotate(_W,_W,s),_W[4]+=r,_W[5]+=o}dW(e,_W)}(o,a,n,i,t,g,m);var x=g,_=Wa.adjustTextY(m,p,y);h&&(x=function(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}(g,v,h),_+=h[0]),_+=f/2,fW(o,i,!0,e);var b=d.canCacheByTextString,w=e.__tspanList||(e.__tspanList=[]),S=w.length;if(b&&e.__canCacheByTextString&&e.__text===r){if(e.__dirtyText&&S)for(var M=0;M<S;++M)SW(w[M],v,x,_+M*f)}else{e.__text=r,e.__canCacheByTextString=b;var I=d.lines,T=I.length;for(M=0;M<T;M++){var A=w[M],C=I[M];A?A.__zrText!==C&&(A.innerHTML="",A.appendChild(document.createTextNode(C))):(A=w[M]=QH("tspan"),o.appendChild(A),A.appendChild(document.createTextNode(C))),SW(A,v,x,_+M*f)}if(S>T){for(;M<S;M++)o.removeChild(w[M]);w.length=T}}}};function SW(e,t,i,n){pW(e,"dominant-baseline","middle"),pW(e,"text-anchor",bW[t]),pW(e,"x",i),pW(e,"y",n)}function MW(e){e&&e.__textSvgEl&&(e.__textSvgEl.parentNode&&e.__textSvgEl.parentNode.removeChild(e.__textSvgEl),e.__textSvgEl=null,e.__tspanList=[],e.__text=null)}vW.drawRectText=wW,vW.brush=function(e){null!=e.style.text?wW(e,!1):MW(e)};var IW={path:gW,image:mW,text:vW};function TW(){}function AW(e,t,i,n){for(var a=0,r=t.length,o=0,s=0;a<r;a++){var l=t[a];if(l.removed){for(u=[],h=s;h<s+l.count;h++)u.push(h);l.indices=u,s+=l.count}else{for(var u=[],h=o;h<o+l.count;h++)u.push(h);l.indices=u,o+=l.count,l.added||(s+=l.count)}}return t}function CW(e){return{newPos:e.newPos,components:e.components.slice(0)}}TW.prototype={diff:function(e,t,i){i||(i=function(e,t){return e===t}),this.equals=i;var n=this;e=e.slice();var a=(t=t.slice()).length,r=e.length,o=1,s=a+r,l=[{newPos:-1,components:[]}],u=this.extractCommon(l[0],t,e,0);if(l[0].newPos+1>=a&&u+1>=r){for(var h=[],c=0;c<t.length;c++)h.push(c);return[{indices:h,count:t.length}]}function d(){for(var i=-1*o;i<=o;i+=2){var s,u=l[i-1],h=l[i+1],c=(h?h.newPos:0)-i;u&&(l[i-1]=void 0);var d=u&&u.newPos+1<a,p=h&&0<=c&&c<r;if(d||p){if(!d||p&&u.newPos<h.newPos?(s=CW(h),n.pushComponent(s.components,void 0,!0)):((s=u).newPos++,n.pushComponent(s.components,!0,void 0)),c=n.extractCommon(s,t,e,i),s.newPos+1>=a&&c+1>=r)return AW(n,s.components);l[i]=s}else l[i]=void 0}o++}for(;o<=s;){var p=d();if(p)return p}},pushComponent:function(e,t,i){var n=e[e.length-1];n&&n.added===t&&n.removed===i?e[e.length-1]={count:n.count+1,added:t,removed:i}:e.push({count:1,added:t,removed:i})},extractCommon:function(e,t,i,n){for(var a=t.length,r=i.length,o=e.newPos,s=o-n,l=0;o+1<a&&s+1<r&&this.equals(t[o+1],i[s+1]);)o++,s++,l++;return l&&e.components.push({count:l}),e.newPos=o,s},tokenize:function(e){return e.slice()},join:function(e){return e.slice()}};var DW=new TW;var LW=function(e,t,i){return DW.diff(e,t,i)},PW=JH.createElement,kW=IW.path,OW=IW.image,RW=IW.text;function EW(e,t,i,n,a){this._zrId=e,this._svgRoot=t,this._tagNames="string"==typeof i?[i]:i,this._markLabel=n,this._domName=a||"_dom",this.nextId=0}EW.prototype.createElement=PW,EW.prototype.getDefs=function(e){var t=this._svgRoot,i=this._svgRoot.getElementsByTagName("defs");return 0===i.length?e?((i=t.insertBefore(this.createElement("defs"),t.firstChild)).contains||(i.contains=function(e){var t=i.children;if(!t)return!1;for(var n=t.length-1;n>=0;--n)if(t[n]===e)return!0;return!1}),i):null:i[0]},EW.prototype.update=function(e,t){if(e){var i=this.getDefs(!1);if(e[this._domName]&&i.contains(e[this._domName]))"function"==typeof t&&t(e);else{var n=this.add(e);n&&(e[this._domName]=n)}}},EW.prototype.addDom=function(e){this.getDefs(!0).appendChild(e)},EW.prototype.removeDom=function(e){var t=this.getDefs(!1);t&&e[this._domName]&&(t.removeChild(e[this._domName]),e[this._domName]=null)},EW.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var t=[];return Ve.each(this._tagNames,(function(i){var n=e.getElementsByTagName(i);t=t.concat([].slice.call(n))})),t},EW.prototype.markAllUnused=function(){var e=this.getDoms(),t=this;Ve.each(e,(function(e){e[t._markLabel]="0"}))},EW.prototype.markUsed=function(e){e&&(e[this._markLabel]="1")},EW.prototype.removeUnused=function(){var e=this.getDefs(!1);if(e){var t=this.getDoms(),i=this;Ve.each(t,(function(t){"1"!==t[i._markLabel]&&e.removeChild(t)}))}},EW.prototype.getSvgProxy=function(e){return e instanceof bl?kW:e instanceof Cr?OW:e instanceof Wl?RW:kW},EW.prototype.getTextSvgElement=function(e){return e.__textSvgEl},EW.prototype.getSvgElement=function(e){return e.__svgEl};var NW=EW;function zW(e,t){NW.call(this,e,t,["linearGradient","radialGradient"],"__gradient_in_use__")}Ve.inherits(zW,NW),zW.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var i=this;Ve.each(["fill","stroke"],(function(n){if(t.style[n]&&("linear"===t.style[n].type||"radial"===t.style[n].type)){var a,r=t.style[n],o=i.getDefs(!0);r._dom?(a=r._dom,o.contains(r._dom)||i.addDom(a)):a=i.add(r),i.markUsed(t);var s=a.getAttribute("id");e.setAttribute(n,"url(#"+s+")")}}))}},zW.prototype.add=function(e){var t;if("linear"===e.type)t=this.createElement("linearGradient");else{if("radial"!==e.type)return null;t=this.createElement("radialGradient")}return e.id=e.id||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-gradient-"+e.id),this.updateDom(e,t),this.addDom(t),t},zW.prototype.update=function(e){var t=this;NW.prototype.update.call(this,e,(function(){var i=e.type,n=e._dom.tagName;"linear"===i&&"linearGradient"===n||"radial"===i&&"radialGradient"===n?t.updateDom(e,e._dom):(t.removeDom(e),t.add(e))}))},zW.prototype.updateDom=function(e,t){if("linear"===e.type)t.setAttribute("x1",e.x),t.setAttribute("y1",e.y),t.setAttribute("x2",e.x2),t.setAttribute("y2",e.y2);else{if("radial"!==e.type)return;t.setAttribute("cx",e.x),t.setAttribute("cy",e.y),t.setAttribute("r",e.r)}e.global?t.setAttribute("gradientUnits","userSpaceOnUse"):t.setAttribute("gradientUnits","objectBoundingBox"),t.innerHTML="";for(var i=e.colorStops,n=0,a=i.length;n<a;++n){var r=this.createElement("stop");r.setAttribute("offset",100*i[n].offset+"%");var o=i[n].color;if(o.indexOf(!1)){var s=Ui.parse(o)[3],l=Ui.toHex(o);r.setAttribute("stop-color","#"+l),r.setAttribute("stop-opacity",s)}else r.setAttribute("stop-color",i[n].color);t.appendChild(r)}e._dom=t},zW.prototype.markUsed=function(e){if(e.style){var t=e.style.fill;t&&t._dom&&NW.prototype.markUsed.call(this,t._dom),(t=e.style.stroke)&&t._dom&&NW.prototype.markUsed.call(this,t._dom)}};var BW=zW;function VW(e,t){NW.call(this,e,t,"clipPath","__clippath_in_use__")}Ve.inherits(VW,NW),VW.prototype.update=function(e){var t=this.getSvgElement(e);t&&this.updateDom(t,e.__clipPaths,!1);var i=this.getTextSvgElement(e);i&&this.updateDom(i,e.__clipPaths,!0),this.markUsed(e)},VW.prototype.updateDom=function(e,t,i){if(t&&t.length>0){var n,a,r=this.getDefs(!0),o=t[0],s=i?"_textDom":"_dom";o[s]?(a=o[s].getAttribute("id"),n=o[s],r.contains(n)||r.appendChild(n)):(a="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",a),r.appendChild(n),o[s]=n);var l=this.getSvgProxy(o);if(o.transform&&o.parent.invTransform&&!i){var u=Array.prototype.slice.call(o.transform);ni.mul(o.transform,o.parent.invTransform,o.transform),l.brush(o),o.transform=u}else l.brush(o);var h=this.getSvgElement(o);n.innerHTML="",n.appendChild(h.cloneNode()),e.setAttribute("clip-path","url(#"+a+")"),t.length>1&&this.updateDom(n,t.slice(1),i)}else e&&e.setAttribute("clip-path","none")},VW.prototype.markUsed=function(e){var t=this;e.__clipPaths&&Ve.each(e.__clipPaths,(function(e){e._dom&&NW.prototype.markUsed.call(t,e._dom),e._textDom&&NW.prototype.markUsed.call(t,e._textDom)}))};var FW=VW;function GW(e,t){NW.call(this,e,t,["filter"],"__filter_in_use__","_shadowDom")}function HW(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY||e.textShadowBlur||e.textShadowOffsetX||e.textShadowOffsetY)}Ve.inherits(GW,NW),GW.prototype.addWithoutUpdate=function(e,t){if(t&&HW(t.style)){var i;if(t._shadowDom)i=t._shadowDom,this.getDefs(!0).contains(t._shadowDom)||this.addDom(i);else i=this.add(t);this.markUsed(t);var n=i.getAttribute("id");e.style.filter="url(#"+n+")"}},GW.prototype.add=function(e){var t=this.createElement("filter");return e._shadowDomId=e._shadowDomId||this.nextId++,t.setAttribute("id","zr"+this._zrId+"-shadow-"+e._shadowDomId),this.updateDom(e,t),this.addDom(t),t},GW.prototype.update=function(e,t){if(HW(t.style)){var i=this;NW.prototype.update.call(this,t,(function(){i.updateDom(t,t._shadowDom)}))}else this.remove(e,t)},GW.prototype.remove=function(e,t){null!=t._shadowDomId&&(this.removeDom(e),e.style.filter="")},GW.prototype.updateDom=function(e,t){var i=t.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var n,a,r,o,s=e.style,l=e.scale&&e.scale[0]||1,u=e.scale&&e.scale[1]||1;if(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)n=s.shadowOffsetX||0,a=s.shadowOffsetY||0,r=s.shadowBlur,o=s.shadowColor;else{if(!s.textShadowBlur)return void this.removeDom(t,s);n=s.textShadowOffsetX||0,a=s.textShadowOffsetY||0,r=s.textShadowBlur,o=s.textShadowColor}i.setAttribute("dx",n/l),i.setAttribute("dy",a/u),i.setAttribute("flood-color",o);var h=r/2/l+" "+r/2/u;i.setAttribute("stdDeviation",h),t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width",Math.ceil(r/2*200)+"%"),t.setAttribute("height",Math.ceil(r/2*200)+"%"),t.appendChild(i),e._shadowDom=t},GW.prototype.markUsed=function(e){e._shadowDom&&NW.prototype.markUsed.call(this,e._shadowDom)};var WW=GW,UW=JH.createElement,jW=IW.path,ZW=IW.image,YW=IW.text;function XW(e){return parseInt(e,10)}function qW(e,t){return t&&e&&t.parentNode!==e}function $W(e,t,i){if(qW(e,t)&&i){var n=i.nextSibling;n?e.insertBefore(t,n):e.appendChild(t)}}function KW(e,t){if(qW(e,t)){var i=e.firstChild;i?e.insertBefore(t,i):e.appendChild(t)}}function JW(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)}function QW(e){return e.__textSvgEl}function eU(e){return e.__svgEl}var tU=function(e,t,i,n){this.root=e,this.storage=t,this._opts=i=Ve.extend({},i||{});var a=UW("svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("version","1.1"),a.setAttribute("baseProfile","full"),a.style.cssText="user-select:none;position:absolute;left:0;top:0;";var r=UW("g");a.appendChild(r);var o=UW("g");a.appendChild(o),this.gradientManager=new BW(n,o),this.clipPathManager=new FW(n,o),this.shadowManager=new WW(n,o);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=a,this._svgRoot=o,this._backgroundRoot=r,this._viewport=s,e.appendChild(s),s.appendChild(a),this.resize(i.width,i.height),this._visibleList=[]};tU.prototype={constructor:tU,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getSvgDom:function(){return this._svgDom},getSvgRoot:function(){return this._svgRoot},getViewportRootOffset:function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},refresh:function(){var e=this.storage.getDisplayList(!0);this._paintList(e)},setBackgroundColor:function(e){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var t=UW("rect");t.setAttribute("width",this.getWidth()),t.setAttribute("height",this.getHeight()),t.setAttribute("x",0),t.setAttribute("y",0),t.setAttribute("id",0),t.style.fill=e,this._backgroundRoot.appendChild(t),this._backgroundNode=t},_paintList:function(e){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var t,i,n=this._svgRoot,a=this._visibleList,r=e.length,o=[];for(t=0;t<r;t++){var s=e[t],l=(i=s)instanceof bl?jW:i instanceof Cr?ZW:i instanceof Wl?YW:jW,u=eU(s)||QW(s);s.invisible||(s.__dirty&&(l&&l.brush(s),this.clipPathManager.update(s),s.style&&(this.gradientManager.update(s.style.fill),this.gradientManager.update(s.style.stroke),this.shadowManager.update(u,s)),s.__dirty=!1),o.push(s))}var h,c=LW(a,o);for(t=0;t<c.length;t++){if((f=c[t]).removed)for(var d=0;d<f.count;d++){u=eU(s=a[f.indices[d]]);var p=QW(s);JW(n,u),JW(n,p)}}for(t=0;t<c.length;t++){var f;if((f=c[t]).added)for(d=0;d<f.count;d++){u=eU(s=o[f.indices[d]]),p=QW(s);h?$W(n,u,h):KW(n,u),u?$W(n,p,u):h?$W(n,p,h):KW(n,p),$W(n,p,u),h=p||u||h,this.gradientManager.addWithoutUpdate(u||p,s),this.shadowManager.addWithoutUpdate(u||p,s),this.clipPathManager.markUsed(s)}else if(!f.removed)for(d=0;d<f.count;d++){u=eU(s=o[f.indices[d]]),p=QW(s),u=eU(s),p=QW(s);this.gradientManager.markUsed(s),this.gradientManager.addWithoutUpdate(u||p,s),this.shadowManager.markUsed(s),this.shadowManager.addWithoutUpdate(u||p,s),this.clipPathManager.markUsed(s),p&&$W(n,p,u),h=u||p||h}}this.gradientManager.removeUnused(),this.clipPathManager.removeUnused(),this.shadowManager.removeUnused(),this._visibleList=o},_getDefs:function(e){var t,i=this._svgDom;return 0===(t=i.getElementsByTagName("defs")).length?e?((t=i.insertBefore(UW("defs"),i.firstChild)).contains||(t.contains=function(e){var i=t.children;if(!i)return!1;for(var n=i.length-1;n>=0;--n)if(i[n]===e)return!0;return!1}),t):null:t[0]},resize:function(e,t){var i=this._viewport;i.style.display="none";var n=this._opts;if(null!=e&&(n.width=e),null!=t&&(n.height=t),e=this._getSize(0),t=this._getSize(1),i.style.display="",this._width!==e||this._height!==t){this._width=e,this._height=t;var a=i.style;a.width=e+"px",a.height=t+"px";var r=this._svgDom;r.setAttribute("width",e),r.setAttribute("height",t)}this._backgroundNode&&(this._backgroundNode.setAttribute("width",e),this._backgroundNode.setAttribute("height",t))},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(e){var t=this._opts,i=["width","height"][e],n=["clientWidth","clientHeight"][e],a=["paddingLeft","paddingTop"][e],r=["paddingRight","paddingBottom"][e];if(null!=t[i]&&"auto"!==t[i])return parseFloat(t[i]);var o=this.root,s=document.defaultView.getComputedStyle(o);return(o[n]||XW(s[i])||XW(o.style[i]))-(XW(s[a])||0)-(XW(s[r])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},toDataURL:function(){return this.refresh(),"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(this._svgDom.outerHTML.replace(/></g,">\n\r<"))}},Ve.each(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],(function(e){tU.prototype[e]=function(){}}));var iU=tU;(0,xo.registerPainter)("svg",iU);var nU=K(J((function(e,t){!function(){for(var e in X_){if(null==X_||!X_.hasOwnProperty(e)||"default"===e||"__esModule"===e)return;t[e]=X_[e]}}(),function(){for(var e in Y_){if(null==Y_||!Y_.hasOwnProperty(e)||"default"===e||"__esModule"===e)return;t[e]=Y_[e]}}()})));X_.extendSeriesModel({type:"series.liquidFill",visualColorAccessPath:"textStyle.normal.color",optionUpdated:function(){var e=this.option;e.gridSize=Math.max(Math.floor(e.gridSize),4)},getInitialData:function(e,t){var i=Xv(["value"],e.data),n=new X_.List(i,this);return n.initData(e.data),n},defaultOption:{color:["#294D99","#156ACF","#1598ED","#45BDFF"],center:["50%","50%"],radius:"50%",amplitude:"8%",waveLength:"80%",phase:"auto",period:"auto",direction:"right",shape:"circle",waveAnimation:!0,animationEasing:"linear",animationEasingUpdate:"linear",animationDuration:2e3,animationDurationUpdate:1e3,outline:{show:!0,borderDistance:8,itemStyle:{color:"none",borderColor:"#294D99",borderWidth:8,shadowBlur:20,shadowColor:"rgba(0, 0, 0, 0.25)"}},backgroundStyle:{color:"#E3F7FF"},itemStyle:{opacity:.95,shadowBlur:50,shadowColor:"rgba(0, 0, 0, 0.4)"},label:{show:!0,color:"#294D99",insideColor:"#fff",fontSize:50,fontWeight:"bold",align:"center",baseline:"middle",position:"inside"},emphasis:{itemStyle:{opacity:.8}}}});var aU=X_.graphic.extendShape({type:"ec-liquid-fill",shape:{waveLength:0,radius:0,radiusY:0,cx:0,cy:0,waterLevel:0,amplitude:0,phase:0,inverse:!1},buildPath:function(e,t){null==t.radiusY&&(t.radiusY=t.radius);for(var i=Math.max(2*Math.ceil(2*t.radius/t.waveLength*4),8);t.phase<2*-Math.PI;)t.phase+=2*Math.PI;for(;t.phase>0;)t.phase-=2*Math.PI;var n=t.phase/Math.PI/2*t.waveLength,a=t.cx-t.radius+n-2*t.radius;e.moveTo(a,t.waterLevel);for(var r=0,o=0;o<i;++o){var s=o%4,l=rU(o*t.waveLength/4,s,t.waveLength,t.amplitude);e.bezierCurveTo(l[0][0]+a,-l[0][1]+t.waterLevel,l[1][0]+a,-l[1][1]+t.waterLevel,l[2][0]+a,-l[2][1]+t.waterLevel),o===i-1&&(r=l[2][0])}t.inverse?(e.lineTo(r+a,t.cy-t.radiusY),e.lineTo(a,t.cy-t.radiusY),e.lineTo(a,t.waterLevel)):(e.lineTo(r+a,t.cy+t.radiusY),e.lineTo(a,t.cy+t.radiusY),e.lineTo(a,t.waterLevel)),e.closePath()}});function rU(e,t,i,n){return 0===t?[[e+.5*i/Math.PI/2,n/2],[e+.5*i/Math.PI,n],[e+i/4,n]]:1===t?[[e+.5*i/Math.PI/2*(Math.PI-2),n],[e+.5*i/Math.PI/2*(Math.PI-1),n/2],[e+i/4,0]]:2===t?[[e+.5*i/Math.PI/2,-n/2],[e+.5*i/Math.PI,-n],[e+i/4,-n]]:[[e+.5*i/Math.PI/2*(Math.PI-2),-n],[e+.5*i/Math.PI/2*(Math.PI-1),-n/2],[e+i/4,0]]}var oU=X_.number.parsePercent;X_.extendChartView({type:"liquidFill",render:function(e,t,i){var n=this.group;n.removeAll();var a=e.getData(),r=a.getItemModel(0),o=r.get("center"),s=r.get("radius"),l=i.getWidth(),u=i.getHeight(),h=Math.min(l,u),c=0,d=0,p=e.get("outline.show");p&&(c=e.get("outline.borderDistance"),d=oU(e.get("outline.itemStyle.borderWidth"),h));var f,g,m,v=oU(o[0],l),y=oU(o[1],u),x=!1,_=e.get("shape");("container"===_?(x=!0,g=[(f=[l/2,u/2])[0]-d/2,f[1]-d/2],m=[oU(c,l),oU(c,u)],s=[Math.max(g[0]-m[0],0),Math.max(g[1]-m[1],0)]):(g=(f=oU(s,h)/2)-d/2,m=oU(c,h),s=Math.max(g-m,0)),p)&&(A().style.lineWidth=d,n.add(A()));var b=x?0:v-s,w=x?0:y-s,S=null;n.add(function(){var t=T(s);t.setStyle(e.getModel("backgroundStyle").getItemStyle()),t.style.fill=null,t.z2=5;var i=T(s);i.setStyle(e.getModel("backgroundStyle").getItemStyle()),i.style.stroke=null;var n=new X_.graphic.Group;return n.add(t),n.add(i),n}());var M=this._data,I=[];function T(e,t){if(_){if(0===_.indexOf("path://")){var i=X_.graphic.makePath(_.slice(7),{}),n=i.getBoundingRect(),a=n.width,r=n.height;a>r?(r*=2*e/a,a=2*e):(a*=2*e/r,r=2*e);var o=t?0:v-a/2,s=t?0:y-r/2;return i=X_.graphic.makePath(_.slice(7),{},new X_.graphic.BoundingRect(o,s,a,r)),t&&(i.position=[-a/2,-r/2]),i}if(x){var l=t?-e[0]:v-e[0],u=t?-e[1]:y-e[1];return jx.createSymbol("rect",l,u,2*e[0],2*e[1])}l=t?-e:v-e,u=t?-e:y-e;return"pin"===_?u+=e:"arrow"===_&&(u-=e),jx.createSymbol(_,l,u,2*e,2*e)}return new X_.graphic.Circle({shape:{cx:t?0:v,cy:t?0:y,r:e}})}function A(){var t=T(f);return t.style.fill=null,t.setStyle(e.getModel("outline.itemStyle").getItemStyle()),t}function C(t,i,n){var r=x?s[0]:s,o=x?u/2:s,l=a.getItemModel(t),h=l.getModel("itemStyle"),c=l.get("phase"),d=oU(l.get("amplitude"),2*o),p=oU(l.get("waveLength"),2*r),f=o-a.get("value",t)*o*2;c=n?n.shape.phase:"auto"===c?t*Math.PI/4:c;var g=h.getItemStyle();if(!g.fill){var m=e.get("color"),_=t%m.length;g.fill=m[_]}var b=new aU({shape:{waveLength:p,radius:r,radiusY:o,cx:2*r,cy:0,waterLevel:f,amplitude:d,phase:c,inverse:i},style:g,position:[v,y]});b.shape._waterLevel=f;var w=l.getModel("emphasis.itemStyle").getItemStyle();w.lineWidth=0,X_.graphic.setHoverStyle(b,w);var S=T(s,!0);return S.setStyle({fill:"white"}),b.setClipPath(S),b}function D(e,t,i){var n=a.getItemModel(e),r=n.get("period"),o=n.get("direction"),s=a.get("value",e),l=n.get("phase");l=i?i.shape.phase:"auto"===l?e*Math.PI/4:l;var u=0;u="auto"===r?function(t){var i=a.count();return 0===i?t:t*(.2+(i-e)/i*.8)}(5e3):"function"==typeof r?r(s,e):r;var h=0;"right"===o||null==o?h=Math.PI:"left"===o?h=-Math.PI:"none"===o?h=0:console.error("Illegal direction value for liquid fill."),"none"!==o&&n.get("waveAnimation")&&t.animate("shape",!0).when(0,{phase:l}).when(u/2,{phase:h+l}).when(u,{phase:2*h+l}).during((function(){S&&S.dirty(!0)})).start()}a.diff(M).add((function(t){var i=C(t,!1),r=i.shape.waterLevel;i.shape.waterLevel=x?u/2:s,X_.graphic.initProps(i,{shape:{waterLevel:r}},e),i.z2=2,D(t,i,null),n.add(i),a.setItemGraphicEl(t,i),I.push(i)})).update((function(t,i){for(var r=M.getItemGraphicEl(i),o=C(t,!1,r),s={},l=["amplitude","cx","cy","phase","radius","radiusY","waterLevel","waveLength"],h=0;h<l.length;++h){var c=l[h];o.shape.hasOwnProperty(c)&&(s[c]=o.shape[c])}var d={},p=["fill","opacity","shadowBlur","shadowColor"];for(h=0;h<p.length;++h){c=p[h];o.style.hasOwnProperty(c)&&(d[c]=o.style[c])}x&&(s.radiusY=u/2),X_.graphic.updateProps(r,{shape:s},e),r.useStyle(d),r.position=o.position,r.setClipPath(o.clipPath),r.shape.inverse=o.inverse,D(t,r,r),n.add(r),a.setItemGraphicEl(t,r),I.push(r)})).remove((function(e){var t=M.getItemGraphicEl(e);n.remove(t)})).execute(),r.get("label.show")&&n.add(function(t){var i=r.getModel("label");function n(){var t=e.getFormattedLabel(0,"normal"),i=100*a.get("value",0),n=a.getName(0)||e.name;return isNaN(i)||(n=i.toFixed(0)+"%"),null==t?n:t}var o={z2:10,shape:{x:b,y:w,width:2*(x?s[0]:s),height:2*(x?s[1]:s)},style:{fill:"transparent",text:n(),textAlign:i.get("align"),textVerticalAlign:i.get("baseline")},silent:!0},l=new X_.graphic.Rect(o),u=i.get("color");X_.graphic.setText(l.style,i,u);var h=new X_.graphic.Rect(o),c=i.get("insideColor");X_.graphic.setText(h.style,i,c),h.style.textFill=c;var d=new X_.graphic.Group;d.add(l),d.add(h);var p=T(s,!0);return S=new X_.graphic.CompoundPath({shape:{paths:t},position:[v,y]}),S.setClipPath(p),h.setClipPath(S),d}(I)),this._data=a},dispose:function(){}}),X_.registerVisual(X_.util.curry(IM,"liquidFill"));class sU extends s.Component{constructor(e){super(e),this.chartRef=s.createRef(),this.renderChart=()=>{const{label:e,value:t,total:i}=this.props,n={title:{text:`{a| ${(t/i*100).toFixed(1)}} %`,textStyle:{fontSize:16,fontWeight:500,lineHeight:16,color:"#ECF3FF",rich:{a:{fontSize:30,fontWeight:700,verticalAlign:"bottom"}}},subtext:`{a|${e}${t}}`,subtextStyle:{fontSize:16,lineHeight:16,color:"#CDE0FF",rich:{a:{fontSize:16,fontWeight:500,verticalAlign:"bottom"}}},left:"center",top:"40%"},series:[{type:"liquidFill",radius:"90%",center:["50%","50%"],data:[t/i],backgroundStyle:{color:"transparent"},outline:{borderDistance:4,itemStyle:{borderWidth:4,borderColor:this.props.endColor}},itemStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:1,color:this.props.startColor},{offset:0,color:this.props.endColor}],globalCoord:!1}},label:{normal:{formatter:""}}}]};this.chart.setOption(n,{notMerge:!0})}}componentDidMount(){this.chart=this.chart||nU.init(this.chartRef.current),window.addEventListener("resize",(()=>{this.chart.resize()})),this.renderChart()}componentDidUpdate(){this.renderChart()}render(){const{name:e,prefix:t,total:i,unit:n,startColor:a,endColor:r}=this.props;return s.createElement("div",{className:h.chart__wrapper},s.createElement("div",{ref:this.chartRef,className:h.chart}),s.createElement("div",{className:h.chart__name__wrapper},s.createElement("div",{className:h.chart__name},e),s.createElement("div",{className:h.total__wrapper},s.createElement("span",null,t),s.createElement("span",{className:h.total,style:{backgroundImage:`linear-gradient(0deg, ${a}, ${r})`}},i),s.createElement("span",{className:h.unit,style:{backgroundImage:`linear-gradient(0deg, ${a}, ${r})`}},n))))}}let lU=class extends s.Component{constructor(e){super(e),this.renderArr=[],this.padding="10vh 4vh 4vh",this.renderChart=()=>u(this,void 0,void 0,(function*(){const{base_url:e,steps:t,deviceToken:i}=this.props.gpui.params;if(e&&t&&i){this.timer&&(clearTimeout(this.timer),this.timer=null);try{const n=[{name:"用户预约情况",total:0,value:0,startColor:"#0096FF",endColor:"#00D8FF",label:"已批准：",prefix:"总次数",unit:"次"},{name:"用户测试情况",total:0,value:0,startColor:"#00AE93",endColor:"#65E89B",label:"已完成：",prefix:"总次数",unit:"次"},{name:"测试费用情况",total:0,value:0,startColor:"#EFA85E",endColor:"#F0BE58",label:"已确认：",prefix:"总条数",unit:"条"},{name:"费用结算情况",total:0,value:0,startColor:"#828AF5",endColor:"#BC92F6",label:"已结算：",prefix:"总条数",unit:"条"}];yield Promise.all(t.map(((t,a)=>Promise.all(t.map(((t,r)=>Q.get(`${e}/set/data/${t}`,{headers:{"X-Gini-Token":i}}).then((({data:e})=>{if(0===a){if(0===r){const t=e[0].data[0].data["预约编号"];n[a].total+=t,n[a].value+=t}else if(1===r){const t=e[0].data[0].data["送样条数"];n[a].total+=t}else if(2===r){const t=e[0].data[0].data["“已批准”&“已测试”送样条数"];n[a].value+=t}}else if(1===a){if(0===r){const t=e[0].data[0].data["送样条数"];n[a].total+=t}else if(1===r){const t=e[0].data[0].data["非机主使用记录条数"];n[a].total+=t,n[a].value+=t}else if(2===r){const t=e[0].data[0].data["“已测试”送样记录条数"];n[a].value+=t}}else if(2===a){if(0===r){const t=e[0].data[0].data["已确认-收费条数"];n[a].value+=t}else if(1===r){const t=e[0].data[0].data["使用收费总条数"];n[a].total+=t}}else if(3===a)if(0===r){const t=e[0].data[0].data["使用收费总条数"];n[a].total+=t}else if(1===r){const t=e[0].data[0].data["“已报销”的收费条数"];n[a].value+=t}}))))))));const a=[];n.forEach(((e,t)=>{t>0&&a.push({type:"arrow",item:e}),a.push({type:"board",item:e})})),this.renderArr=a}catch(e){console.error("@components:wall-iharbour/training-business-funnel-model: 组件渲染时发生错误",e)}this.props.gpui.params.interval>0&&(this.timer=setTimeout(this.renderChart,this.props.gpui.params.interval))}})),this.renderBoard=(e,t)=>s.createElement(sU,Object.assign({key:t},e)),this.renderArrow=(e,t)=>s.createElement("div",{key:t,className:h.arrow},s.createElement("div",{className:h.line,style:{backgroundColor:e.startColor}}),s.createElement("div",{className:h.mark,style:{borderLeftColor:e.startColor}})),i.reaction((()=>e.gpui.params.padding),(e=>{this.padding=e||"10vh 4vh 4vh"}),{fireImmediately:!0})}componentDidMount(){i.reaction((()=>({baseURL:this.props.gpui.params.base_url,steps:this.props.gpui.params.steps,deviceToken:this.props.gpui.params.deviceToken,interval:this.props.gpui.params.interval})),(()=>{this.renderChart()}),{fireImmediately:!0})}render(){return s.createElement("div",{className:"g__index",style:{padding:this.padding}},s.createElement("div",{className:h.content},this.renderArr.map((({type:e,item:t},i)=>"board"===e?this.renderBoard(t,i):this.renderArrow(t,i)))))}};return l([i.observable],lU.prototype,"renderArr",void 0),l([i.observable],lU.prototype,"padding",void 0),lU=l([function(e){if(!0===e.isMobxInjector&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),q&&e.$$typeof===q)throw new Error("Mobx observer: You are trying to use 'observer' on a function component wrapped in either another observer or 'React.memo'. The observer already applies 'React.memo' for you.");if(X&&e.$$typeof===X){var i=e.render;if("function"!=typeof i)throw new Error("render property of ForwardRef was not a function");return t.forwardRef((function(){var e=arguments;return t.createElement(I,null,(function(){return i.apply(void 0,e)}))}))}return"function"!=typeof e||e.prototype&&e.prototype.render||e.isReactClass||Object.prototype.isPrototypeOf.call(t.Component,e)?W(e):S(e)}],lU),lU}));
