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="index-module_main__WSFNB",c="index-module_chart__RJBRM",d="index-module_name__7vlXo";r.default(".index-module_main__WSFNB {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  width: 100%;\n  height: 100%; }\n  .index-module_main__WSFNB .index-module_chart__RJBRM {\n    width: 60vw;\n    height: 60vw;\n    overflow: hidden; }\n  .index-module_main__WSFNB .index-module_name__7vlXo {\n    margin-top: 7vh;\n    line-height: 7vh;\n    font-size: 7vh;\n    color: #cde0ff; }\n");var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g(e){var t={exports:{}};return e(t,t.exports),t.exports}var m=g((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()}));class v{constructor({baseURL:e="",timeout:t=6e4,headers:i={}}){this.passenger=m.create({baseURL:e,timeout:t,headers:Object.assign({"Content-Type":"application/x-www-form-urlencoded; chartset=UTF-8"},i)}),this.passenger.interceptors.response.use((e=>e),(e=>Promise.reject(e)))}call({method:e,params:t={}}){var i,n;return u(this,void 0,void 0,(function*(){const a=yield this.passenger.post("",{jsonrpc:"2.0",method:e,id:1,params:t instanceof Array?t:[t]});return(null===(i=a.data)||void 0===i?void 0:i.result)?a.data.result:null===(n=a.data)||void 0===n?void 0:n.error}))}sendObject({method:e,params:t={}}){var i,n;return u(this,void 0,void 0,(function*(){const a=yield this.passenger.post("",{jsonrpc:"2.0",method:e,id:1,params:t});return(null===(i=a.data)||void 0===i?void 0:i.result)?a.data.result:null===(n=a.data)||void 0===n?void 0:n.error}))}get({method:e,params:t={},path:i={}}){return u(this,void 0,void 0,(function*(){let n=e;if(Object.keys(i).length&&e)for(const e in i)n=n.replace(`:${e}`,i[e]);const a=yield this.passenger.get(n,{params:t});return a.data?a.data:a.data.error}))}}if(!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 y(){return y=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},y.apply(this,arguments)}function x(){var e=t.useState(0)[1];return t.useCallback((function(){e((function(e){return e+1}))}),[])}function _(e){return i.getDependencyTree(e)}var b,w=1e4,S=1e4,M=new Set;function I(){void 0===b&&(b=setTimeout(A,S))}function A(){b=void 0;var e=Date.now();M.forEach((function(t){var i=t.current;i&&e>=i.cleanAt&&(i.reaction.dispose(),t.current=null,M.delete(t))})),M.size>0&&I()}var T={};function C(e){return"observer"+e}function D(e,t,n){void 0===t&&(t="observed"),void 0===n&&(n=T);var a,r=(n.useForceUpdate||x)(),s=o.default.useRef(null);if(!s.current){var l=new i.Reaction(C(t),(function(){u.mounted?r():(l.dispose(),s.current=null)})),u=function(e){return{cleanAt:Date.now()+w,reaction:e}}(l);s.current=u,a=s,M.add(a),I()}var h,c,d=s.current.reaction;if(o.default.useDebugValue(d,_),o.default.useEffect((function(){var e;return e=s,M.delete(e),s.current?s.current.mounted=!0:(s.current={reaction:new i.Reaction(C(t),(function(){r()})),cleanAt:1/0},r()),function(){s.current.reaction.dispose(),s.current=null}}),[]),d.track((function(){try{h=e()}catch(e){c=e}})),c)throw c;return h}function L(e,i){var n,a=y({forwardRef:!1},i),r=e.displayName||e.name,o=function(t,i){return D((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){P[i]||Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}))}(e,n),n.displayName=r,n}var P={$$typeof:!0,render:!0,compare:!0,type:!0};function k(e){var t=e.children,i=e.render,n=t||i;return"function"!=typeof n?null:D(n)}function O(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`.")}k.propTypes={children:O,render:O},k.displayName="Observer";var R=0;var E={};function N(e){return E[e]||(E[e]=function(e){if("function"==typeof Symbol)return Symbol(e);var t="__$mobx-react "+e+" ("+R+")";return R++,t}(e)),E[e]}function z(e,t){if(B(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])||!B(e[i[a]],t[i[a]]))return!1;return!0}function B(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function V(e,t,i){Object.hasOwnProperty.call(e,t)?e[t]=i:Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:i})}var G=N("patchMixins"),F=N("patchedDefinition");function H(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 W(e,t){return function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];H.call.apply(H,[this,e,t].concat(n))}}function U(e,t,i){var n=function(e,t){var i=e[G]=e[G]||{},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[F]){var r=e[t],o=j(e,t,a?a.enumerable:void 0,n,r);Object.defineProperty(e,t,o)}}function j(e,t,i,n,a){var r,o=W(a,n);return(r={})[F]=!0,r.get=function(){return o},r.set=function(a){if(this===e)o=W(a,n);else{var r=j(this,t,i,n,a);Object.defineProperty(this,t,r)}},r.configurable=!0,r.enumerable=i,r}var Z=i.$mobx||"$mobx",Y=N("isUnmounted"),X=N("skipRender"),q=N("isForcingUpdate");function $(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;Q(i,"props"),Q(i,"state");var n=i.render;return i.render=function(){return K.call(this,n)},U(i,"componentWillUnmount",(function(){this.render[Z]&&this.render[Z].dispose(),this[Y]=!0})),e}function K(e){var n=this;V(this,X,!1),V(this,q,!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[Y])){var e=!0;try{V(n,q,!0),n[X]||t.Component.prototype.forceUpdate.call(n),e=!1}finally{V(n,q,!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[Z]=l,this.render=u,u.call(this)}function J(e,t){return this.state!==t||!z(this.props,e)}function Q(e,t){var n=N("reactProp_"+t+"_valueHolder"),a=N("reactProp_"+t+"_atomHolder");function r(){return this[a]||V(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[q]||z(this[n],e)?V(this,n,e):(V(this,n,e),V(this,X,!0),r.call(this).reportChanged(),V(this,X,!1))}})}var ee="function"==typeof Symbol&&Symbol.for,te=ee?Symbol.for("react.forward_ref"):"function"==typeof t.forwardRef&&t.forwardRef((function(e){return null})).$$typeof,ie=ee?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");"undefined"!=typeof window||void 0!==p&&p.__DEV__;var ne=2311;var ae=function(){return ne++};var re="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),oe={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},se={"[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},le=Object.prototype.toString,ue=Array.prototype,he=ue.forEach,ce=ue.filter,de=ue.slice,pe=ue.map,fe=ue.reduce,ge={};function me(e){if(null==e||"object"!=typeof e)return e;var t=e,i=le.call(e);if("[object Array]"===i){if(!Ce(e)){t=[];for(var n=0,a=e.length;n<a;n++)t[n]=me(e[n])}}else if(se[i]){if(!Ce(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]=me(e[n])}}}else if(!oe[i]&&!Ce(e)&&!Ae(e))for(var o in t={},e)e.hasOwnProperty(o)&&(t[o]=me(e[o]));return t}function ve(e,t,i){if(!Me(t)||!Me(e))return i?me(t):e;for(var n in t)if(t.hasOwnProperty(n)){var a=e[n],r=t[n];!Me(r)||!Me(a)||Se(r)||Se(a)||Ae(r)||Ae(a)||Ie(r)||Ie(a)||Ce(r)||Ce(a)?!i&&n in e||(e[n]=me(t[n])):ve(a,r,i)}return e}function ye(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 xe,_e=function(){return ge.createCanvas()};function be(e,t,i){if(e&&t)if(e.forEach&&e.forEach===he)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 we(e,t){var i=de.call(arguments,2);return function(){return e.apply(t,i.concat(de.call(arguments)))}}function Se(e){return"[object Array]"===le.call(e)}function Me(e){var t=typeof e;return"function"===t||!!e&&"object"===t}function Ie(e){return!!oe[le.call(e)]}function Ae(e){return"object"==typeof e&&"number"==typeof e.nodeType&&"object"==typeof e.ownerDocument}ge.createCanvas=function(){return document.createElement("canvas")};var Te="__ec_primitive__";function Ce(e){return e[Te]}function De(e){var t=Se(e);this.data={};var i=this;function n(e,n){t?i.set(e,n):i.set(n,e)}e instanceof De?e.each(n):e&&be(e,n)}De.prototype={constructor:De,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=we(e,t)),this.data)this.data.hasOwnProperty(i)&&e(this.data[i],i)},removeKey:function(e){delete this.data[e]}};var Le=function(e,t){for(var i=e[0],n=1,a=e.length;n<a;n++)i=ve(i,e[n],t);return i},Pe=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},ke=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},Oe=function(e,t,i){if(e&&t){if(e.map&&e.map===pe)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}},Re=function(e,t,i,n){if(e&&t){if(e.reduce&&e.reduce===fe)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}},Ee=function(e,t,i){if(e&&t){if(e.filter&&e.filter===ce)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}},Ne=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]},ze=function(e){var t=de.call(arguments,1);return function(){return e.apply(this,t.concat(de.call(arguments)))}},Be=function(e){for(var t=0,i=arguments.length;t<i;t++)if(null!=arguments[t])return arguments[t]},Ve=function(){return Function.call.apply(de,arguments)},Ge=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},Fe=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},He={$override:function(e,t){"createCanvas"===e&&(xe=null),ge[e]=t},clone:me,merge:ve,mergeAll:Le,extend:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},defaults:ye,createCanvas:_e,getContext:function(){return xe||(xe=_e().getContext("2d")),xe},indexOf:Pe,inherits:ke,mixin:function(e,t,i){ye(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:be,map:Oe,reduce:Re,filter:Ee,find:Ne,bind:we,curry:ze,isArray:Se,isFunction:function(e){return"function"==typeof e},isString:function(e){return"[object String]"===le.call(e)},isObject:Me,isBuiltInObject:Ie,isTypedArray:function(e){return!!se[le.call(e)]},isDom:Ae,eqNaN:function(e){return e!=e},retrieve:Be,retrieve2:function(e,t){return null!=e?e:t},retrieve3:function(e,t,i){return null!=e?e:null!=t?t:i},slice:Ve,normalizeCssArray:Ge,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[Te]=!0},isPrimitive:Ce,createHashMap:function(e){return new De(e)},concatArray:Fe,noop:function(){}},We="undefined"==typeof Float32Array?Array:Float32Array;function Ue(e){return Math.sqrt(je(e))}function je(e){return e[0]*e[0]+e[1]*e[1]}function Ze(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}function Ye(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}var Xe=function(e,t){var i=new We(2);return null==e&&(e=0),null==t&&(t=0),i[0]=e,i[1]=t,i},qe=function(e,t){return e[0]=t[0],e[1]=t[1],e},$e=function(e){var t=new We(2);return t[0]=e[0],t[1]=e[1],t},Ke=function(e,t,i){return e[0]=t,e[1]=i,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,n){return e[0]=t[0]+i[0]*n,e[1]=t[1]+i[1]*n,e},et=function(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e},tt=function(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e},it=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e},nt=function(e,t){return e[0]*t[0]+e[1]*t[1]},at=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},rt=function(e,t){var i=Ue(t);return 0===i?(e[0]=0,e[1]=0):(e[0]=t[0]/i,e[1]=t[1]/i),e},ot=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},st=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},lt=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},ut=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},ht=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e},ct={create:Xe,copy:qe,clone:$e,set:Ke,add:Je,scaleAndAdd:Qe,sub:et,len:Ue,length:Ue,lenSquare:je,lengthSquare:je,mul:tt,div:it,dot:nt,scale:at,normalize:rt,distance:Ze,dist:Ze,distanceSquare:Ye,distSquare:Ye,negate:ot,lerp:st,applyTransform:lt,min:ut,max:ht};function dt(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}function pt(e,t){return{target:e,topTarget:t&&t.topTarget}}dt.prototype={constructor:dt,_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(pt(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(pt(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(pt(s,e),"dragleave",e.event),o&&o!==s&&this.dispatchToElement(pt(o,e),"dragenter",e.event))}},_dragEnd:function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.dispatchToElement(pt(t,e),"dragend",e.event),this._dropTarget&&this.dispatchToElement(pt(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null}};var ft=dt,gt=Array.prototype.slice,mt=function(e){this._$handlers={},this._$eventProcessor=e};function vt(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}mt.prototype={constructor:mt,one:function(e,t,i,n){return vt(this,e,t,i,n,!0)},on:function(e,t,i,n){return vt(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=gt.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=gt.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 yt=mt,xt=Math.log(2);function _t(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)/xt);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]*_t(e,t-1,h,u,a|f,r),p++)}return r[o]=c,c}var bt=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=_t(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)*_t(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}}},wt={buildTransformer:bt}.buildTransformer,St="___zrEVENTSAVED",Mt=[];function It(e,t,i,n,a){if(t.getBoundingClientRect&&re.domSupported&&!At(t)){var r=t[St]||(t[St]={}),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?wt(l,s):wt(s,l))}(o,r,a);if(s)return s(e,i,n),!0}return!1}function At(e){return"CANVAS"===e.nodeName.toUpperCase()}var Tt=function(e,t,i,n,a){return It(Mt,t,n,a,!0)&&It(e,i,Mt[0],Mt[1])},Ct={transformLocalCoord:Tt,transformCoordWithViewport:It,isCanvasEl:At},Dt=yt,Lt=Ct.isCanvasEl,Pt=Ct.transformCoordWithViewport,kt="undefined"!=typeof window&&!!window.addEventListener,Ot=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Rt=[];function Et(e,t,i,n){return i=i||{},n||!re.canvasSupported?Nt(e,t,i):re.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):Nt(e,t,i),i}function Nt(e,t,i){if(re.domSupported&&e.getBoundingClientRect){var n=t.clientX,a=t.clientY;if(Lt(e)){var r=e.getBoundingClientRect();return i.zrX=n-r.left,void(i.zrY=a-r.top)}if(Pt(Rt,e,n,a))return i.zrX=Rt[0],void(i.zrY=Rt[1])}i.zrX=i.zrY=0}function zt(e){return e||window.event}var Bt={Dispatcher:Dt,clientToLocal:Et,getNativeEvent:zt,normalizeEvent:function(e,t,i){if(null!=(t=zt(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&&Et(e,a,t,i)}else Et(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&&Ot.test(t.type)&&(t.which=1&r?1:2&r?3:4&r?2:0),t},addEventListener:function(e,t,i,n){kt?e.addEventListener(t,i,n):e.attachEvent("on"+t,i)},removeEventListener:function(e,t,i,n){kt?e.removeEventListener(t,i,n):e.detachEvent("on"+t,i)},stop:kt?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}},Vt=function(){this._track=[]};function Gt(e){var t=e[1][0]-e[0][0],i=e[1][1]-e[0][1];return Math.sqrt(t*t+i*i)}Vt.prototype={constructor:Vt,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=Bt.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 Ft)if(Ft.hasOwnProperty(t)){var i=Ft[t](this._track,e);if(i)return i}}};var Ft={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=Gt(a)/Gt(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}}}}},Ht=Vt,Wt="silent";function Ut(){Bt.stop(this.event)}function jt(){}jt.prototype.dispose=function(){};var Zt=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Yt=function(e,t,i,n){yt.call(this),this.storage=e,this.painter=t,this.painterRoot=n,i=i||new jt,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,ft.call(this),this.setHandlerProxy(i)};function Xt(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||Wt}return!1}function qt(e,t,i){var n=e.painter;return t<0||t>n.getWidth()||i<0||i>n.getHeight()}Yt.prototype={constructor:Yt,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(He.each(Zt,(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=qt(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:Ut}}(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=Xt(n[r],e,t))&&(!a.topTarget&&(a.topTarget=n[r]),o!==Wt)){a.target=n[r];break}}return a},processGesture:function(e,t){this._gestureMgr||(this._gestureMgr=new Ht);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)}}},He.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(e){Yt.prototype[e]=function(t){var i,n,a=t.zrX,r=t.zrY,o=qt(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||ct.dist(this._downPoint,[t.zrX,t.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,e,t)}})),He.mixin(Yt,yt),He.mixin(Yt,ft);var $t=Yt,Kt="undefined"==typeof Float32Array?Array:Float32Array;function Jt(){var e=new Kt(6);return Qt(e),e}function Qt(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function ei(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 ti=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},ii=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},ni=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},ai=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},ri=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},oi={create:Jt,identity:Qt,copy:ei,mul:ti,translate:ii,rotate:ni,scale:ai,invert:ri,clone:function(e){var t=Jt();return ei(t,e),t}},si=oi.identity,li=5e-5;function ui(e){return e>li||e<-5e-5}var hi=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},ci=hi.prototype;ci.transform=null,ci.needLocalTransform=function(){return ui(this.rotation)||ui(this.position[0])||ui(this.position[1])||ui(this.scale[0]-1)||ui(this.scale[1]-1)};var di=[];ci.updateTransform=function(){var e=this.parent,t=e&&e.transform,i=this.needLocalTransform(),n=this.transform;if(i||t){n=n||oi.create(),i?this.getLocalTransform(n):si(n),t&&(i?oi.mul(n,e.transform,n):oi.copy(n,e.transform)),this.transform=n;var a=this.globalScaleRatio;if(null!=a&&1!==a){this.getGlobalScale(di);var r=di[0]<0?-1:1,o=di[1]<0?-1:1,s=((di[0]-r)*a+r)/di[0]||0,l=((di[1]-o)*a+o)/di[1]||0;n[0]*=s,n[1]*=s,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||oi.create(),oi.invert(this.invTransform,n)}else n&&si(n)},ci.getLocalTransform=function(e){return hi.getLocalTransform(this,e)},ci.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)},ci.restoreTransform=function(e){var t=e.dpr||1;e.setTransform(t,0,0,t,0,0)};var pi=[],fi=oi.create();ci.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;ui(t-1)&&(t=Math.sqrt(t)),ui(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)}},ci.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(oi.mul(pi,e.invTransform,t),t=pi);var i=this.origin;i&&(i[0]||i[1])&&(fi[4]=i[0],fi[5]=i[1],oi.mul(pi,t,fi),pi[4]-=i[0],pi[5]-=i[1],t=pi),this.setLocalTransform(t)}},ci.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)},ci.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&ct.applyTransform(i,i,n),i},ci.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&ct.applyTransform(i,i,n),i},hi.getLocalTransform=function(e,t){si(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]),oi.scale(t,t,n),a&&oi.rotate(t,t,a),i&&(t[4]+=i[0],t[5]+=i[1]),t[4]+=r[0],t[5]+=r[1],t};var gi=hi,mi={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-mi.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*mi.bounceIn(2*e):.5*mi.bounceOut(2*e-1)+.5}},vi=mi;function yi(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}yi.prototype={constructor:yi,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?vi[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 xi=yi,_i=function(){this.head=null,this.tail=null,this._len=0},bi=_i.prototype;bi.insert=function(e){var t=new wi(e);return this.insertEntry(t),t},bi.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++},bi.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--},bi.len=function(){return this._len},bi.clear=function(){this.head=this.tail=null,this._len=0};var wi=function(e){this.value=e,this.next,this.prev},Si=function(e){this._list=new _i,this._map={},this._maxSize=e||10,this._lastRemovedEntry=null},Mi=Si.prototype;Mi.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 wi(t),o.key=e,i.insertEntry(o),n[e]=o}return a},Mi.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},Mi.clear=function(){this._list.clear(),this._map={}};var Ii=Si,Ai={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 Ti(e){return(e=Math.round(e))<0?0:e>255?255:e}function Ci(e){return e<0?0:e>1?1:e}function Di(e){return e.length&&"%"===e.charAt(e.length-1)?Ti(parseFloat(e)/100*255):Ti(parseInt(e,10))}function Li(e){return e.length&&"%"===e.charAt(e.length-1)?Ci(parseFloat(e)/100):Ci(parseFloat(e))}function Pi(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 ki(e,t,i){return e+(t-e)*i}function Oi(e,t,i,n,a){return e[0]=t,e[1]=i,e[2]=n,e[3]=a,e}function Ri(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var Ei=new Ii(20),Ni=null;function zi(e,t){Ni&&Ri(Ni,t),Ni=Ei.put(e,Ni||t.slice())}function Bi(e,t){if(e){t=t||[];var i=Ei.get(e);if(i)return Ri(t,i);var n,a=(e+="").replace(/ /g,"").toLowerCase();if(a in Ai)return Ri(t,Ai[a]),zi(e,t),t;if("#"===a.charAt(0))return 4===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=4095?(Oi(t,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),zi(e,t),t):void Oi(t,0,0,0,1):7===a.length?(n=parseInt(a.substr(1),16))>=0&&n<=16777215?(Oi(t,(16711680&n)>>16,(65280&n)>>8,255&n,1),zi(e,t),t):void Oi(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 Oi(t,0,0,0,1);u=Li(l.pop());case"rgb":return 3!==l.length?void Oi(t,0,0,0,1):(Oi(t,Di(l[0]),Di(l[1]),Di(l[2]),u),zi(e,t),t);case"hsla":return 4!==l.length?void Oi(t,0,0,0,1):(l[3]=Li(l[3]),Vi(l,t),zi(e,t),t);case"hsl":return 3!==l.length?void Oi(t,0,0,0,1):(Vi(l,t),zi(e,t),t);default:return}}Oi(t,0,0,0,1)}}function Vi(e,t){var i=(parseFloat(e[0])%360+360)%360/360,n=Li(e[1]),a=Li(e[2]),r=a<=.5?a*(n+1):a+n-a*n,o=2*a-r;return Oi(t=t||[],Ti(255*Pi(o,r,i+1/3)),Ti(255*Pi(o,r,i)),Ti(255*Pi(o,r,i-1/3)),1),4===e.length&&(t[3]=e[3]),t}function Gi(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]=Ti(ki(o[0],s[0],l)),i[1]=Ti(ki(o[1],s[1],l)),i[2]=Ti(ki(o[2],s[2],l)),i[3]=Ci(ki(o[3],s[3],l)),i}}function Fi(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=Bi(t[a]),s=Bi(t[r]),l=n-a,u=Hi([Ti(ki(o[0],s[0],l)),Ti(ki(o[1],s[1],l)),Ti(ki(o[2],s[2],l)),Ci(ki(o[3],s[3],l))],"rgba");return i?{color:u,leftIndex:a,rightIndex:r,value:n}:u}}function Hi(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 Wi=function(e,t){var i=Bi(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 Hi(i,4===i.length?"rgba":"rgb")}},Ui=function(e){var t=Bi(e);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)},ji=function(e,t,i,n){if(e=Bi(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]=Li(i)),null!=n&&(e[2]=Li(n)),Hi(Vi(e),"rgba")},Zi=function(e,t){if((e=Bi(e))&&null!=t)return e[3]=Ci(t),Hi(e,"rgba")},Yi={parse:Bi,lift:Wi,toHex:Ui,fastLerp:Gi,fastMapToColor:Gi,lerp:Fi,mapToColor:Fi,modifyHSL:ji,modifyAlpha:Zi,stringify:Hi},Xi=He.isArrayLike,qi=Array.prototype.slice;function $i(e,t){return e[t]}function Ki(e,t,i){e[t]=i}function Ji(e,t,i){return(t-e)*i+e}function Qi(e,t,i){return i>.5?t:e}function en(e,t,i,n,a){var r=e.length;if(1===a)for(var o=0;o<r;o++)n[o]=Ji(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]=Ji(e[o][l],t[o][l],i)}}function tn(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]:qi.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 nn(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 an(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]=rn(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]=rn(e[h][d],t[h][d],i[h][d],n[h][d],a,r,o)}}function rn(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 on(e){if(Xi(e)){var t=e.length;if(Xi(e[0])){for(var i=[],n=0;n<t;n++)i.push(qi.call(e[n]));return i}return qi.call(e)}return e}function sn(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}function ln(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=Xi(c),p=!1,f=!1,g=d?function(e){var t=e[e.length-1].value;return Xi(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&&nn(b,y,g)||!d&&b===y||(x=!1),y=b,"string"==typeof b){var w=Yi.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?tn(v[_],S,g):!isNaN(v[_])||isNaN(S)||f||p||(v[_]=S);d&&tn(o(e._target,a),S,g);var M,I,A,T,C,D=0,L=0;if(p)var P=[0,0,0,0];var k=new xi({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(A=v[i],I=v[0===i?i:i-1],T=v[i>u-2?u-1:i+1],C=v[i>u-3?u-1:i+2],d)an(I,A,T,C,M,M*M,M*M*M,o(e,a),g);else{if(p)r=an(I,A,T,C,M,M*M,M*M*M,P,1),r=sn(P);else{if(f)return Qi(A,T,M);r=rn(I,A,T,C,M,M*M,M*M*M)}s(e,a,r)}else if(d)en(v[i],v[i+1],M,o(e,a),g);else{var r;if(p)en(v[i],v[i+1],M,P,1),r=sn(P);else{if(f)return Qi(v[i],v[i+1],M);r=Ji(v[i],v[i+1],M)}s(e,a,r)}},ondestroy:i});return t&&"spline"!==t&&(k.easing=t),k}}}var un=function(e,t,i,n){this._tracks={},this._target=e,this._loop=t||!1,this._getter=i||$i,this._setter=n||Ki,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};un.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:on(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=ln(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 hn=un,cn=1;"undefined"!=typeof window&&(cn=Math.max(window.devicePixelRatio||1,1));var dn={debugMode:0,devicePixelRatio:cn},pn=function(){},fn=He.isString,gn=He.isFunction,mn=He.isObject,vn=He.isArrayLike,yn=He.indexOf,xn=function(){this.animators=[]};function _n(e,t,i,n,a,r,o,s){fn(n)?(r=a,a=n,n=0):gn(a)?(r=a,a="linear",n=0):gn(n)?(r=n,n=0):gn(i)?(r=i,i=500):i||(i=500),e.stopAnimation(),bn(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 bn(e,t,i,n,a,r,o){var s={},l=0;for(var u in n)n.hasOwnProperty(u)&&(null!=i[u]?mn(n[u])&&!vn(n[u])?bn(e,t?t+"."+u:u,i[u],n[u],a,r,o):(o?(s[u]=i[u],wn(e,t,u,n[u])):s[u]=n[u],l++):null==n[u]||o||wn(e,t,u,n[u]));l>0&&e.animate(t,!1).when(null==a?500:a,s).delay(r||0)}function wn(e,t,i,n){if(t){var a={};a[t]={},a[t][i]=n,e.attr(a)}else e.attr(i,n)}xn.prototype={constructor:xn,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 hn(i,t);return c.during((function(e){a.dirty(n)})).done((function(){h.splice(yn(h,c),1)})),h.push(c),r&&r.animation.addAnimator(c),c}pn('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){_n(this,e,t,i,n,a,r)},animateFrom:function(e,t,i,n,a,r){_n(this,e,t,i,n,a,r,!0)}};var Sn=xn,Mn=function(e){gi.call(this,e),yt.call(this,e),Sn.call(this,e),this.id=e.id||ae()};Mn.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(He.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)}},He.mixin(Mn,Sn),He.mixin(Mn,gi),He.mixin(Mn,yt);var In,An,Tn,Cn,Dn=Mn,Ln=ct.applyTransform,Pn=Math.min,kn=Math.max;function On(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}On.prototype={constructor:On,union:function(e){var t=Pn(e.x,this.x),i=Pn(e.y,this.y);this.width=kn(e.x+e.width,this.x+this.width)-t,this.height=kn(e.y+e.height,this.y+this.height)-i,this.x=t,this.y=i},applyTransform:(In=[],An=[],Tn=[],Cn=[],function(e){if(e){In[0]=Tn[0]=this.x,In[1]=Cn[1]=this.y,An[0]=Cn[0]=this.x+this.width,An[1]=Tn[1]=this.y+this.height,Ln(In,In,e),Ln(An,An,e),Ln(Tn,Tn,e),Ln(Cn,Cn,e),this.x=Pn(In[0],An[0],Tn[0],Cn[0]),this.y=Pn(In[1],An[1],Tn[1],Cn[1]);var t=kn(In[0],An[0],Tn[0],Cn[0]),i=kn(In[1],An[1],Tn[1],Cn[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=oi.create();return oi.translate(a,a,[-t.x,-t.y]),oi.scale(a,a,[i,n]),oi.translate(a,a,[e.x,e.y]),a},intersect:function(e){if(!e)return!1;e instanceof On||(e=On.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 On(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}}},On.create=function(e){return new On(e.x,e.y,e.width,e.height)};var Rn=On,En=function(e){for(var t in e=e||{},Dn.call(this,e),e)e.hasOwnProperty(t)&&(this[t]=e[t]);this._children=[],this.__storage=null,this.__dirty=!0};En.prototype={constructor:En,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 En&&e.addChildrenToStorage(t)),i&&i.refresh()},remove:function(e){var t=this.__zr,i=this.__storage,n=this._children,a=He.indexOf(n,e);return a<0||(n.splice(a,1),e.parent=null,i&&(i.delFromStorage(e),e instanceof En&&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 En&&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 En&&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 En&&i.delChildrenFromStorage(e)}},dirty:function(){return this.__dirty=!0,this.__zr&&this.__zr.refresh(),this},getBoundingRect:function(e){for(var t=null,i=new Rn(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}},He.inherits(En,Dn);var Nn=En,zn=32,Bn=7;function Vn(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 Gn(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 Fn(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 Hn(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 Wn(e,t){var i,n,a=Bn,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=Hn(e[h],e,l,u,0,t);l+=d,0!==(u-=d)&&0!==(c=Fn(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=Hn(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=Fn(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>=Bn||p>=Bn);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-Hn(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-Fn(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>=Bn||m>=Bn);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 Un=function(e,t,i,n){i||(i=0),n||(n=e.length);var a=n-i;if(!(a<2)){var r=0;if(a<zn)Gn(e,i,n,i+(r=Vn(e,i,n,t)),t);else{var o=new Wn(e,t),s=function(e){for(var t=0;e>=zn;)t|=1&e,e>>=1;return e+t}(a);do{if((r=Vn(e,i,n,t))<s){var l=a;l>s&&(l=s),Gn(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 jn(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var Zn=function(){this._roots=[],this._displayList=[],this._displayListLen=0};Zn.prototype={constructor:Zn,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,re.canvasSupported&&Un(i,jn)},_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 Nn&&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 Nn&&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=He.indexOf(this._roots,e);a>=0&&(this.delFromStorage(e),this._roots.splice(a,1),e instanceof Nn&&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:jn};var Yn=Zn,Xn={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};var qn=function(e,t,i){return Xn.hasOwnProperty(t)?i*e.dpr:i},$n={ContextCachedBy:{NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},WILL_BE_RESTORED:9},Kn=$n.ContextCachedBy,Jn=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],Qn=function(e){this.extendFrom(e,!1)};function ea(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 ta(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)}Qn.prototype={constructor:Qn,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!==Kn.STYLE_BIND;e.__attrCachedBy=Kn.STYLE_BIND;for(var o=0;o<Jn.length;o++){var s=Jn[o],l=s[0];(r||n[l]!==a[l])&&(e[l]=qn(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?ta:ea)(e,t,i),a=t.colorStops,r=0;r<a.length;r++)n.addColorStop(a[r].offset,a[r].color);return n}};for(var ia=Qn.prototype,na=0;na<Jn.length;na++){var aa=Jn[na];aa[0]in ia||(ia[aa[0]]=aa[1])}Qn.getGradient=ia.getGradient;var ra=Qn,oa=function(e,t){this.image=e,this.repeat=t,this.type="pattern"};oa.prototype.getCanvasPattern=function(e){return e.createPattern(this.image,this.repeat||"repeat")};var sa=oa,la=dn.devicePixelRatio;function ua(){return!1}function ha(e,t,i){var n=He.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 ca=function(e,t,i){var n;i=i||la,"string"==typeof e?n=ha(e,t,i):He.isObject(e)&&(e=(n=e).id),this.id=e,this.dom=n;var a=n.style;a&&(n.onselectstart=ua,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};ca.prototype={constructor:ca,__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=ha("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||ra.getGradient(a,t,{x:0,y:0,width:r,height:o}),t.__canvasGradient=i):t.image&&(i=sa.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 da=ca,pa="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){setTimeout(e,16)},fa=new Ii(50);function ga(){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 ma(e){return e&&e.width&&e.height}var va=function(e,t,i,n,a){if(e){if("string"==typeof e){if(t&&t.__zrImageSrc===e||!i)return t;var r=fa.get(e),o={hostEl:i,cb:n,cbPayload:a};return r?!ma(t=r.image)&&r.pending.push(o):((t=new Image).onload=t.onerror=ga,fa.put(e,t.__cachedImgObj={image:t,pending:[o]}),t.src=t.__zrImageSrc=e),t}return e}return t},ya={findExistImage:function(e){if("string"==typeof e){var t=fa.get(e);return t&&t.image}return e},createOrUpdateImage:va,isImageReady:ma},xa=He.getContext,_a=He.extend,ba=He.retrieve2,wa=He.retrieve3,Sa=He.trim,Ma={},Ia=0,Aa=5e3,Ta=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,Ca="12px sans-serif",Da={};function La(e,t){var i=e+":"+(t=t||Ca);if(Ma[i])return Ma[i];for(var n=(e+"").split("\n"),a=0,r=0,o=n.length;r<o;r++)a=Math.max(Va(n[r],t).width,a);return Ia>Aa&&(Ia=0,Ma={}),Ia++,Ma[i]=a,a}function Pa(e,t,i){return"right"===i?e-=t:"center"===i&&(e-=t/2),e}function ka(e,t,i){return"middle"===i?e-=t/2:"bottom"===i&&(e-=t),e}function Oa(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 Ra(e,t,i,n,a){if(!t)return"";var r=(e+"").split("\n");a=Ea(t,i,n,a);for(var o=0,s=r.length;o<s;o++)r[o]=Na(r[o],a);return r.join("\n")}function Ea(e,t,i,n){(n=_a({},n)).font=t;i=ba(i,"...");n.maxIterations=ba(n.maxIterations,2);var a=n.minChar=ba(n.minChar,0);n.cnCharWidth=La("国",t);var r=n.ascCharWidth=La("a",t);n.placeholder=ba(n.placeholder,"");for(var o=e=Math.max(0,e-1),s=0;s<a&&o>=r;s++)o-=r;var l=La(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 Na(e,t){var i=t.containerWidth,n=t.font,a=t.contentWidth;if(!i)return"";var r=La(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?za(e,a,t.ascCharWidth,t.cnCharWidth):r>0?Math.floor(e.length*a/r):0;r=La(e=e.substr(0,s),n)}return""===e&&(e=t.placeholder),e}function za(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 Ba(e){return La("国",e)}function Va(e,t){return Da.measureText(e,t)}function Ga(e,t,i,n,a){null!=e&&(e+="");var r=ba(n,Ba(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=Ea(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]=Na(o[p],d)}return{lines:o,height:s,outerHeight:l,lineHeight:r,canCacheByTextString:u}}function Fa(e,t){var i={lines:[],width:0,height:0};if(null!=e&&(e+=""),!e)return i;for(var n,a=Ta.lastIndex=0;null!=(n=Ta.exec(e));){var r=n.index;r>a&&Ha(i,e.substring(a,r)),Ha(i,n[2],n[1]),a=Ta.lastIndex}a<e.length&&Ha(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=ba(x.textHeight,Ba(b));if(_&&(w+=_[0]+_[2]),D.height=w,D.lineHeight=wa(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=La(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,A=I&&I.image;A&&(A=ya.findExistImage(A),ya.isImageReady(A)&&(S=Math.max(S,A.width*w/A.height)))}var T=_?_[1]+_[3]:0;S+=T;var C=null!=d?d-v:null;null!=C&&C<S&&(!M||C<T?(D.text="",D.textWidth=S=0):(D.text=Ra(D.text,C-T,b,c.ellipsis,{minChar:c.minChar}),D.textWidth=La(D.text,b),S=D.textWidth+T))}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=ba(t.textWidth,l),i.outerHeight=i.height=ba(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 Ha(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)}}}Da.measureText=function(e,t){var i=xa();return i.font=t||Ca,i.measureText(e)};var Wa=function(e,t,i,n,a,r,o,s){return o?function(e,t,i,n,a,r,o,s){var l=Fa(e,{rich:o,truncate:s,font:t,textAlign:i,textPadding:a,textLineHeight:r}),u=l.outerWidth,h=l.outerHeight,c=Pa(0,u,i),d=ka(0,h,n);return new Rn(c,d,u,h)}(e,t,i,n,a,r,o,s):function(e,t,i,n,a,r,o){var s=Ga(e,t,a,r,o),l=La(e,t);a&&(l+=a[1]+a[3]);var u=s.outerHeight,h=Pa(0,l,i),c=ka(0,u,n),d=new Rn(h,c,l,u);return d.lineHeight=s.lineHeight,d}(e,t,i,n,a,r,s)},Ua=function(e,t,i){return Oa({},{textPosition:e,textDistance:i},t)},ja=function(e){var t=(e.fontSize||e.fontFamily)&&[e.fontStyle,e.fontWeight,(e.fontSize||12)+"px",e.fontFamily||"sans-serif"].join(" ");return t&&Sa(t)||e.textFont||e.font},Za={DEFAULT_FONT:Ca,$override:function(e,t){Da[e]=t},getWidth:La,getBoundingRect:Wa,adjustTextX:Pa,adjustTextY:ka,calculateTextPosition:Oa,adjustTextPositionOnRect:Ua,truncateText:Ra,getLineHeight:Ba,measureText:Va,parsePlainText:Ga,parseRichText:Fa,makeFont:ja};var Ya={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)}},Xa=He.retrieve2,qa=He.retrieve3,$a=He.each,Ka=He.normalizeCssArray,Ja=He.isString,Qa=He.isObject,er=$n.ContextCachedBy,tr=$n.WILL_BE_RESTORED,ir=Za.DEFAULT_FONT,nr={left:1,right:1,center:1},ar={top:1,bottom:1,middle:1},rr=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],or={},sr={};function lr(e){if(e){e.font=Za.makeFont(e);var t=e.textAlign;"middle"===t&&(t="center"),e.textAlign=null==t||nr[t]?t:"left";var i=e.textVerticalAlign||e.textBaseline;"center"===i&&(i="middle"),e.textVerticalAlign=null==i||ar[i]?i:"top",e.textPadding&&(e.textPadding=Ka(e.textPadding))}}function ur(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 hr(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&&cr(l)&&dr(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=xr(o,s,c),h-=i.height/2-c[2]-i.textHeight/2),gr(t,"shadowBlur",qa(l.textShadowBlur,n.textShadowBlur,0)),gr(t,"shadowColor",l.textShadowColor||n.textShadowColor||"transparent"),gr(t,"shadowOffsetX",qa(l.textShadowOffsetX,n.textShadowOffsetX,0)),gr(t,"shadowOffsetY",qa(l.textShadowOffsetY,n.textShadowOffsetY,0)),gr(t,"textAlign",s),gr(t,"textBaseline","middle"),gr(t,"font",i.font||ir);var d=mr(l.textStroke||n.textStroke,f),p=vr(l.textFill||n.textFill),f=Xa(l.textStrokeWidth,n.textStrokeWidth);d&&(gr(t,"lineWidth",f),gr(t,"strokeStyle",d),t.strokeText(i.text,o,h)),p&&(gr(t,"fillStyle",p),t.fillText(i.text,o,h))}function cr(e){return!!(e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor)}function dr(e,t,i,n,a,r,o){var s=i.textBackgroundColor,l=i.textBorderWidth,u=i.textBorderColor,h=Ja(s);if(gr(t,"shadowBlur",i.textBoxShadowBlur||0),gr(t,"shadowColor",i.textBoxShadowColor||"transparent"),gr(t,"shadowOffsetX",i.textBoxShadowOffsetX||0),gr(t,"shadowOffsetY",i.textBoxShadowOffsetY||0),h||l&&u){t.beginPath();var c=i.textBorderRadius;c?Ya.buildPath(t,{x:n,y:a,width:r,height:o,r:c}):t.rect(n,a,r,o),t.closePath()}if(h)if(gr(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(Qa(s)){var p=s.image;(p=ya.createOrUpdateImage(p,null,e,pr,s))&&ya.isImageReady(p)&&t.drawImage(p,n,a,r,o)}if(l&&u)if(gr(t,"lineWidth",l),gr(t,"strokeStyle",u),null!=i.strokeOpacity){d=t.globalAlpha;t.globalAlpha=i.strokeOpacity*i.opacity,t.stroke(),t.globalAlpha=d}else t.stroke()}function pr(e,t){t.image=e}function fr(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+yr(l[0],n.width),r=n.y+yr(l[1],n.height);else{var u=t&&t.calculateTextPosition?t.calculateTextPosition(or,i,n):Za.calculateTextPosition(or,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 gr(e,t,i){return e[t]=qn(e,t,i),e[t]}function mr(e,t){return null==e||t<=0||"transparent"===e||"none"===e?null:e.image||e.colorStops?"#000":e}function vr(e){return null==e||"none"===e?null:e.image||e.colorStops?"#000":e}function yr(e,t){return"string"==typeof e?e.lastIndexOf("%")>=0?parseFloat(e)/100*t:parseFloat(e):e}function xr(e,t,i){return"right"===t?e-i[1]:"center"===t?e+i[3]/2-i[1]/2:e+i[3]}var _r=function(e){return lr(e),$a(e.rich,lr),e},br=function(e,t,i,n,a,r){n.rich?function(e,t,i,n,a,r){r!==tr&&(t.__attrCachedBy=er.NONE);var o=e.__textCotentBlock;o&&!e.__dirtyText||(o=e.__textCotentBlock=Za.parseRichText(i,n));!function(e,t,i,n,a){var r=i.width,o=i.outerWidth,s=i.outerHeight,l=n.textPadding,u=fr(sr,e,n,a),h=u.baseX,c=u.baseY,d=u.textAlign,p=u.textVerticalAlign;ur(t,n,a,h,c);var f=Za.adjustTextX(h,o,d),g=Za.adjustTextY(c,s,p),m=f,v=g;l&&(m+=l[3],v+=l[0]);var y=m+r;cr(n)&&dr(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,A=0,T=m,C=y,D=S-1;A<S&&(!(_=w[A]).textAlign||"left"===_.textAlign);)hr(e,t,_,n,M,v,T,"left"),I-=_.width,T+=_.width,A++;for(;D>=0&&"right"===(_=w[D]).textAlign;)hr(e,t,_,n,M,v,C,"right"),I-=_.width,C-=_.width,D--;for(T+=(r-(T-m)-(y-C)-I)/2;A<=D;)hr(e,t,_=w[A],n,M,v,T+_.width/2,"center"),T+=_.width,A++;v+=M}}(e,t,o,n,a)}(e,t,i,n,a,r):function(e,t,i,n,a,r){var o,s=cr(n),l=!1,u=t.__attrCachedBy===er.PLAIN_TEXT;r!==tr?(r&&(o=r.style,l=!s&&u&&o),t.__attrCachedBy=s?er.NONE:er.PLAIN_TEXT):u&&(t.__attrCachedBy=er.NONE);var h=n.font||ir;l&&h===(o.font||ir)||(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=Za.parsePlainText(i,c,d,p,n.truncate));var g=f.outerHeight,m=f.lines,v=f.lineHeight,y=fr(sr,e,n,a),x=y.baseX,_=y.baseY,b=y.textAlign||"left",w=y.textVerticalAlign;ur(t,n,a,x,_);var S=Za.adjustTextY(_,g,w),M=x,I=S;if(s||d){var A=Za.getWidth(i,c);d&&(A+=d[1]+d[3]);var T=Za.adjustTextX(x,A,b);s&&dr(e,t,n,T,S,A,g),d&&(M=xr(x,b,d),I+=d[0])}t.textAlign=b,t.textBaseline="middle",t.globalAlpha=n.opacity||1;for(var C=0;C<rr.length;C++){var D=rr[C],L=D[0],P=D[1],k=n[L];l&&k===o[L]||(t[P]=qn(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=mr(n.textStroke,O),B=vr(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)},wr=function(e,t){return null!=e&&(e||t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor||t.textPadding)},Sr={normalizeTextStyle:_r,renderText:br,getBoxPosition:fr,getStroke:mr,getFill:vr,parsePercent:yr,needDrawText:wr},Mr=$n.WILL_BE_RESTORED,Ir=new Rn,Ar=function(){};Ar.prototype={constructor:Ar,drawRectText:function(e,t){var i=this.style;t=i.textRect||t,this.__dirty&&Sr.normalizeTextStyle(i,!0);var n=i.text;if(null!=n&&(n+=""),Sr.needDrawText(n,i)){e.save();var a=this.transform;i.transformText?this.setTransform(e):a&&(Ir.copy(t),Ir.applyTransform(a),t=Ir),Sr.renderText(this,e,n,i,t,Mr),e.restore()}}};var Tr=Ar;function Cr(e){for(var t in e=e||{},Dn.call(this,e),e)e.hasOwnProperty(t)&&"style"!==t&&(this[t]=e[t]);this.style=new ra(e.style),this._rect=null,this.__clipPaths=null}Cr.prototype={constructor:Cr,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?Dn.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 ra(e),this.dirty(!1),this},calculateTextPosition:null},He.inherits(Cr,Dn),He.mixin(Cr,Tr);var Dr=Cr;function Lr(e){Dr.call(this,e)}Lr.prototype={constructor:Lr,type:"image",brush:function(e,t){var i=this.style,n=i.image;i.bind(e,this,t);var a=this._image=ya.createOrUpdateImage(n,this._image,this,this.onload);if(a&&ya.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 Rn(e.x||0,e.y||0,e.width||0,e.height||0)),this._rect}},He.inherits(Lr,Dr);var Pr=Lr,kr=dn.devicePixelRatio,Or=1e5,Rr=314159,Er=.01;function Nr(e){return parseInt(e,10)}var zr=new Rn(0,0,0,0),Br=new Rn(0,0,0,0);var Vr=function(e,t,i){this.type="canvas";var n=!e.nodeName||"CANVAS"===e.nodeName.toUpperCase();this._opts=i=He.extend({},i||{}),this.dpr=i.devicePixelRatio||kr,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 da(e,this,this.dpr);u.__builtin__=!0,u.initContext(),o[314159]=u,u.zlevel=Rr,r.push(Rr),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=[]};Vr.prototype={constructor:Vr,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=He.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){Un(e,this.storage.displayableSortFunc),i||(i=this._hoverlayer=this.getLayer(Or));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(Or)},_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;pa((function(){a._paintList(e,t,i)}))}}},_compositeManually:function(){var e=this.getLayer(Rr).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 re.wxa&&He.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 zr.copy(e.getBoundingRect()),e.transform&&zr.applyTransform(e.transform),Br.width=t,Br.height=i,!zr.intersect(Br)}(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=Rr);var i=this._layers[e];return i||((i=new da("zr_"+e,this,this.dpr)).zlevel=e,i.__builtin__=!0,this._layerConfig[e]?He.merge(i,this._layerConfig[e],!0):this._layerConfig[e-Er]&&He.merge(i,this._layerConfig[e-Er],!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?Er:0),this._needsManuallyCompositing),s.__builtin__||pn("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]?He.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+Er){var r=this._layers[a];He.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(He.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);He.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(Rr).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 da("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]||Nr(s[i])||Nr(o.style[i]))-(Nr(s[a])||0)-(Nr(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 Pr({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 Gr=Vr,Fr=Bt.Dispatcher,Hr=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,Fr.call(this)};Hr.prototype={constructor:Hr,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=He.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,pa((function t(){e._running&&(pa(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 hn(e,(t=t||{}).loop,t.getter,t.setter);return this.addAnimator(i),i}},He.mixin(Hr,Fr);var Wr,Ur,jr=Hr,Zr=Bt.addEventListener,Yr=Bt.removeEventListener,Xr=Bt.normalizeEvent,qr=Bt.getNativeEvent,$r=re.domSupported,Kr=(Ur={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Wr=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:He.map(Wr,(function(e){var t=e.replace("mouse","pointer");return Ur.hasOwnProperty(t)?t:e}))}),Jr={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]};function Qr(e){return"mousewheel"===e&&re.browser.firefox?"DOMMouseScroll":e}function eo(e){var t=e.pointerType;return"pen"===t||"touch"===t}function to(e){e&&(e.zrByTouch=!0)}function io(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 no(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 ao=no.prototype;ao.stopPropagation=ao.stopImmediatePropagation=ao.preventDefault=He.noop;var ro={mousedown:function(e){e=Xr(this.dom,e),this._mayPointerCapture=[e.zrX,e.zrY],this.trigger("mousedown",e)},mousemove:function(e){e=Xr(this.dom,e);var t=this._mayPointerCapture;!t||e.zrX===t[0]&&e.zrY===t[1]||co(this,!0),this.trigger("mousemove",e)},mouseup:function(e){e=Xr(this.dom,e),co(this,!1),this.trigger("mouseup",e)},mouseout:function(e){e=Xr(this.dom,e),this._pointerCapturing&&(e.zrEventControl="no_globalout");var t=e.toElement||e.relatedTarget;e.zrIsToLocalDOM=io(this,t),this.trigger("mouseout",e)},touchstart:function(e){to(e=Xr(this.dom,e)),this._lastTouchMoment=new Date,this.handler.processGesture(e,"start"),ro.mousemove.call(this,e),ro.mousedown.call(this,e)},touchmove:function(e){to(e=Xr(this.dom,e)),this.handler.processGesture(e,"change"),ro.mousemove.call(this,e)},touchend:function(e){to(e=Xr(this.dom,e)),this.handler.processGesture(e,"end"),ro.mouseup.call(this,e),+new Date-this._lastTouchMoment<300&&ro.click.call(this,e)},pointerdown:function(e){ro.mousedown.call(this,e)},pointermove:function(e){eo(e)||ro.mousemove.call(this,e)},pointerup:function(e){ro.mouseup.call(this,e)},pointerout:function(e){eo(e)||ro.mouseout.call(this,e)}};He.each(["click","mousewheel","dblclick","contextmenu"],(function(e){ro[e]=function(t){t=Xr(this.dom,t),this.trigger(e,t)}}));var oo={pointermove:function(e){eo(e)||oo.mousemove.call(this,e)},pointerup:function(e){oo.mouseup.call(this,e)},mousemove:function(e){this.trigger("mousemove",e)},mouseup:function(e){var t=this._pointerCapturing;co(this,!1),this.trigger("mouseup",e),t&&(e.zrEventControl="only_globalout",this.trigger("mouseout",e))}};function so(e,t){var i=t.domHandlers;re.pointerEventsSupported?He.each(Kr.pointer,(function(n){uo(t,n,(function(t){i[n].call(e,t)}))})):(re.touchEventsSupported&&He.each(Kr.touch,(function(n){uo(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)}))})),He.each(Kr.mouse,(function(n){uo(t,n,(function(a){a=qr(a),t.touching||i[n].call(e,a)}))})))}function lo(e,t){function i(i){uo(t,i,(function(n){n=qr(n),io(e,n.target)||(n=function(e,t){return Xr(e.dom,new no(e,t),!0)}(e,n),t.domHandlers[i].call(e,n))}),{capture:!0})}re.pointerEventsSupported?He.each(Jr.pointer,i):re.touchEventsSupported||He.each(Jr.mouse,i)}function uo(e,t,i,n){e.mounted[t]=i,e.listenerOpts[t]=n,Zr(e.domTarget,Qr(t),i,n)}function ho(e){var t=e.mounted;for(var i in t)t.hasOwnProperty(i)&&Yr(e.domTarget,Qr(i),t[i],e.listenerOpts[i]);e.mounted={}}function co(e,t){if(e._mayPointerCapture=null,$r&&e._pointerCapturing^t){e._pointerCapturing=t;var i=e._globalHandlerScope;t?lo(e,i):ho(i)}}function po(e,t){this.domTarget=e,this.domHandlers=t,this.mounted={},this.listenerOpts={},this.touchTimer=null,this.touching=!1}function fo(e,t){yt.call(this),this.dom=e,this.painterRoot=t,this._localHandlerScope=new po(e,ro),$r&&(this._globalHandlerScope=new po(document,oo)),this._pointerCapturing=!1,this._mayPointerCapture=null,so(this,this._localHandlerScope)}var go=fo.prototype;go.dispose=function(){ho(this._localHandlerScope),$r&&ho(this._globalHandlerScope)},go.setCursor=function(e){this.dom.style&&(this.dom.style.cursor=e||"default")},He.mixin(fo,yt);var mo=fo,vo=!re.canvasSupported,yo={canvas:Gr},xo={};var _o=function(e,t,i){i=i||{},this.dom=t,this.id=e;var n=this,a=new Yn,r=i.renderer;if(vo){if(!yo.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");r="vml"}else r&&yo[r]||(r="canvas");var o=new yo[r](t,a,i,e);this.storage=a,this.painter=o;var s=re.node||re.worker?null:new mo(o.getViewportRoot(),o.root);this.handler=new $t(a,o,s,o.root),this.animation=new jr({stage:{update:He.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)}};_o.prototype={constructor:_o,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 xo[e]}};var bo=function(e,t){var i=new _o(ae(),e,t);return xo[i.id]=i,i},wo={version:"4.3.1",init:bo,dispose:function(e){if(e)e.dispose();else{for(var t in xo)xo.hasOwnProperty(t)&&xo[t].dispose();xo={}}return this},getInstance:function(e){return xo[e]},registerPainter:function(e,t){yo[e]=t}},So=He.each,Mo=He.isObject,Io=He.isArray,Ao="series\0";function To(e){return e instanceof Array?e:null==e?[]:[e]}function Co(e){return Mo(e)&&e.id&&0===(e.id+"").indexOf("\0_ec_\0")}var Do=0;function Lo(e,t){return e&&e.hasOwnProperty(t)}var Po=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])}}},ko=function(e,t){t=(t||[]).slice();var i=He.map(e||[],(function(e,t){return{exist:e}}));return So(t,(function(e,n){if(Mo(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||Co(e)||Co(r)||r.name!==e.name+""))return i[a].option=e,void(t[n]=null)}}})),So(t,(function(e,t){if(Mo(e)){for(var n=0;n<i.length;n++){var a=i[n].exist;if(!i[n].option&&!Co(a)&&null==e.id){i[n].option=e;break}}n>=i.length&&i.push({option:e})}})),i},Oo=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=To(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}},Ro=function(e,t,i){e.setAttribute?e.setAttribute(t,i):e[t]=i},Eo=function(e,t){return e.getAttribute?e.getAttribute(t):e[t]},No=function(e,t){var i=He.createHashMap(),n=[];return He.each(e,(function(e){var a=t(e);(i.get(a)||(n.push(a),i.set(a,[]))).push(e)})),{keys:n,buckets:i}},zo={normalizeToArray:To,defaultEmphasis:Po,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!Mo(e)||Io(e)||e instanceof Date?e:e.value},isDataItemOption:function(e){return Mo(e)&&!(e instanceof Array)},mappingToExists:ko,makeIdAndName:function(e){var t=He.createHashMap();So(e,(function(e,i){var n=e.exist;n&&t.set(n.id,e)})),So(e,(function(e,i){var n=e.option;He.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={})})),So(e,(function(e,i){var n=e.exist,a=e.option,r=e.keyInfo;if(Mo(a)){if(r.name=null!=a.name?a.name+"":n?n.name:Ao+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(Ao))},isIdInner:Co,compressBatches:Oo,queryDataIndex:function(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?He.isArray(t.dataIndex)?He.map(t.dataIndex,(function(t){return e.indexOfRawIndex(t)})):e.indexOfRawIndex(t.dataIndex):null!=t.name?He.isArray(t.name)?He.map(t.name,(function(t){return e.indexOfName(t)})):e.indexOfName(t.name):void 0},makeInner:function(){var e="__\0ec_inner_"+Do+++"_"+Math.random().toFixed(5);return function(t){return t[e]||(t[e]={})}},parseFinder:function(e,t,i){if(He.isString(t)){var n={};n[t+"Index"]=0,t=n}var a=i&&i.defaultMainType;!a||Lo(t,a+"Index")||Lo(t,a+"Id")||Lo(t,a+"Name")||(t[a+"Index"]=0);var r={};return So(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&&He.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:Ro,getAttribute:Eo,getTooltipRenderMode:function(e){return"auto"===e?re.domSupported?"html":"richText":e||"html"},groupData:No},Bo=".",Vo="___EC__COMPONENT__CONTAINER___";function Go(e){var t={main:"",sub:""};return e&&(e=e.split(Bo),t.main=e[0]||"",t.sub=e[1]||""),t}var Fo=0;function Ho(e,t){var i=He.slice(arguments,2);return this.superClass.prototype[t].apply(e,i)}function Wo(e,t,i){return this.superClass.prototype[t].apply(e,i)}var Uo=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 He.extend(i.prototype,e),i.extend=this.extend,i.superCall=Ho,i.superApply=Wo,He.inherits(i,this),i.superClass=t,i}},jo=function(e,t){t=t||{};var i={};if(e.registerClass=function(e,t){if(t)if(function(e){He.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),'componentType "'+e+'" illegal')}(t),(t=Go(t)).sub){if(t.sub!==Vo){var n=function(e){var t=i[e.main];t&&t[Vo]||((t=i[e.main]={})[Vo]=!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[Vo]&&(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=Go(e);var t=[],n=i[e.main];return n&&n[Vo]?He.each(n,(function(e,i){i!==Vo&&t.push(e)})):t.push(n),t},e.hasClass=function(e){return e=Go(e),!!i[e.main]},e.getAllClassMainTypes=function(){var e=[];return He.each(i,(function(t,i){e.push(i)})),e},e.hasSubTypes=function(e){e=Go(e);var t=i[e.main];return t&&t[Vo]},e.parseClassType=Go,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},Zo={parseClassType:Go,enableClassExtend:Uo,enableClassCheck:function(e){var t=["__\0is_clz",Fo++,Math.random().toFixed(3)].join("_");e.prototype[t]=!0,e.isInstance=function(e){return!(!e||!e[t])}},enableClassManagement:jo,setReadOnly:function(e,t){}};var Yo=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&&He.indexOf(i,o)>=0||n&&He.indexOf(n,o)<0)){var s=t.getShallow(o);null!=s&&(a[e[r][0]]=s)}}return a}},Xo=Yo([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),qo={getLineStyle:function(e){var t=Xo(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])}},$o=qo,Ko=Yo([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),Jo={getAreaStyle:function(e,t){return Ko(this,e,t)}},Qo=ct.create,es=ct.distSquare,ts=Math.pow,is=Math.sqrt,ns=1e-8,as=1e-4,rs=is(3),os=1/3,ss=Qo(),ls=Qo(),us=Qo();function hs(e){return e>-ns&&e<ns}function cs(e){return e>ns||e<-ns}function ds(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 ps(e,t,i,n){var a=1-n;return a*(a*e+2*n*t)+n*n*i}var fs=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(hs(h)&&hs(c)){if(hs(s))r[0]=0;else(M=-l/s)>=0&&M<=1&&(r[p++]=M)}else{var f=c*c-4*h*d;if(hs(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=is(f),y=h*s+1.5*o*(-c+v),x=h*s+1.5*o*(-c-v);(M=(-s-((y=y<0?-ts(-y,os):ts(y,os))+(x=x<0?-ts(-x,os):ts(x,os))))/(3*o))>=0&&M<=1&&(r[p++]=M)}else{var _=(2*h*s-3*o*c)/(2*is(h*h*h)),b=Math.acos(_)/3,w=is(h),S=Math.cos(b),M=(-s-2*w*S)/(3*o),I=(m=(-s+w*(S+rs*Math.sin(b)))/(3*o),(-s+w*(S-rs*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},gs=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(hs(o)){if(cs(r))(h=-s/r)>=0&&h<=1&&(a[l++]=h)}else{var u=r*r-4*o*s;if(hs(u))a[0]=-r/(2*o);else if(u>0){var h,c=is(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},ms=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},vs=function(e,t,i,n,a,r,o,s,l,u,h){var c,d,p,f,g,m=.005,v=1/0;ss[0]=l,ss[1]=u;for(var y=0;y<1;y+=.05)ls[0]=ds(e,i,a,o,y),ls[1]=ds(t,n,r,s,y),(f=es(ss,ls))<v&&(c=y,v=f);v=1/0;for(var x=0;x<32&&!(m<as);x++)d=c-m,p=c+m,ls[0]=ds(e,i,a,o,d),ls[1]=ds(t,n,r,s,d),f=es(ls,ss),d>=0&&f<v?(c=d,v=f):(us[0]=ds(e,i,a,o,p),us[1]=ds(t,n,r,s,p),g=es(us,ss),p<=1&&g<v?(c=p,v=g):m*=.5);return h&&(h[0]=ds(e,i,a,o,c),h[1]=ds(t,n,r,s,c)),is(v)},ys=function(e,t,i,n,a){var r=e-2*t+i,o=2*(t-e),s=e-n,l=0;if(hs(r)){if(cs(o))(h=-s/o)>=0&&h<=1&&(a[l++]=h)}else{var u=o*o-4*r*s;if(hs(u))(h=-o/(2*r))>=0&&h<=1&&(a[l++]=h);else if(u>0){var h,c=is(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},xs=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},_s=function(e,t,i,n,a,r,o,s,l){var u,h=.005,c=1/0;ss[0]=o,ss[1]=s;for(var d=0;d<1;d+=.05){ls[0]=ps(e,i,a,d),ls[1]=ps(t,n,r,d),(m=es(ss,ls))<c&&(u=d,c=m)}c=1/0;for(var p=0;p<32&&!(h<as);p++){var f=u-h,g=u+h;ls[0]=ps(e,i,a,f),ls[1]=ps(t,n,r,f);var m=es(ls,ss);if(f>=0&&m<c)u=f,c=m;else{us[0]=ps(e,i,a,g),us[1]=ps(t,n,r,g);var v=es(us,ss);g<=1&&v<c?(u=g,c=v):h*=.5}}return l&&(l[0]=ps(e,i,a,u),l[1]=ps(t,n,r,u)),is(c)},bs={cubicAt:ds,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:fs,cubicExtrema:gs,cubicSubdivide:ms,cubicProjectPoint:vs,quadraticAt:ps,quadraticDerivativeAt:function(e,t,i,n){return 2*((1-n)*(t-e)+n*(i-t))},quadraticRootAt:ys,quadraticExtremum:function(e,t,i){var n=e+i-2*t;return 0===n?.5:(e-t)/n},quadraticSubdivide:xs,quadraticProjectPoint:_s},ws=Math.min,Ss=Math.max,Ms=Math.sin,Is=Math.cos,As=2*Math.PI,Ts=ct.create(),Cs=ct.create(),Ds=ct.create();var Ls=[],Ps=[];var ks=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=ws(r,a[0]),o=Ss(o,a[0]),s=ws(s,a[1]),l=Ss(l,a[1]);t[0]=r,t[1]=s,i[0]=o,i[1]=l}},Os=function(e,t,i,n,a,r){a[0]=ws(e,i),a[1]=ws(t,n),r[0]=Ss(e,i),r[1]=Ss(t,n)},Rs=function(e,t,i,n,a,r,o,s,l,u){var h,c=bs.cubicExtrema,d=bs.cubicAt,p=c(e,i,a,o,Ls);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,Ls[h]);l[0]=ws(f,l[0]),u[0]=Ss(f,u[0])}for(p=c(t,n,r,s,Ps),h=0;h<p;h++){var g=d(t,n,r,s,Ps[h]);l[1]=ws(g,l[1]),u[1]=Ss(g,u[1])}l[0]=ws(e,l[0]),u[0]=Ss(e,u[0]),l[0]=ws(o,l[0]),u[0]=Ss(o,u[0]),l[1]=ws(t,l[1]),u[1]=Ss(t,u[1]),l[1]=ws(s,l[1]),u[1]=Ss(s,u[1])},Es=function(e,t,i,n,a,r,o,s){var l=bs.quadraticExtremum,u=bs.quadraticAt,h=Ss(ws(l(e,i,a),1),0),c=Ss(ws(l(t,n,r),1),0),d=u(e,i,a,h),p=u(t,n,r,c);o[0]=ws(e,a,d),o[1]=ws(t,r,p),s[0]=Ss(e,a,d),s[1]=Ss(t,r,p)},Ns=function(e,t,i,n,a,r,o,s,l){var u=ct.min,h=ct.max,c=Math.abs(a-r);if(c%As<1e-4&&c>1e-4)return s[0]=e-i,s[1]=t-n,l[0]=e+i,void(l[1]=t+n);if(Ts[0]=Is(a)*i+e,Ts[1]=Ms(a)*n+t,Cs[0]=Is(r)*i+e,Cs[1]=Ms(r)*n+t,u(s,Ts,Cs),h(l,Ts,Cs),(a%=As)<0&&(a+=As),(r%=As)<0&&(r+=As),a>r&&!o?r+=As:a<r&&o&&(a+=As),o){var d=r;r=a,a=d}for(var p=0;p<r;p+=Math.PI/2)p>a&&(Ds[0]=Is(p)*i+e,Ds[1]=Ms(p)*n+t,u(s,Ds,s),h(l,Ds,l))},zs={fromPoints:ks,fromLine:Os,fromCubic:Rs,fromQuadratic:Es,fromArc:Ns},Bs=dn.devicePixelRatio,Vs={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Gs=[],Fs=[],Hs=[],Ws=[],Us=Math.min,js=Math.max,Zs=Math.cos,Ys=Math.sin,Xs=Math.sqrt,qs=Math.abs,$s="undefined"!=typeof Float32Array,Ks=function(e){this._saveData=!e,this._saveData&&(this.data=[]),this._ctx=null};Ks.prototype={constructor:Ks,_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=qs(i/Bs/e)||0,this._uy=qs(i/Bs/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(Vs.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=qs(e-this._xi)>this._ux||qs(t-this._yi)>this._uy||this._len<5;return this.addData(Vs.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(Vs.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(Vs.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(Vs.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=Zs(a)*i+e,this._yi=Ys(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(Vs.R,e,t,i,n),this},closePath:function(){this.addData(Vs.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||!$s||(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();$s&&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=Xs(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?Us(p,e):js(p,e),c>=0?Us(f,t):js(f,t));h=p-e,c=f-t,this._dashOffset=-Xs(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=bs.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+=Xs(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=-Xs(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,$s&&(this.data=new Float32Array(e)))},getBoundingRect:function(){Gs[0]=Gs[1]=Hs[0]=Hs[1]=Number.MAX_VALUE,Fs[0]=Fs[1]=Ws[0]=Ws[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 Vs.M:t=n=e[r++],i=a=e[r++],Hs[0]=n,Hs[1]=a,Ws[0]=n,Ws[1]=a;break;case Vs.L:zs.fromLine(t,i,e[r],e[r+1],Hs,Ws),t=e[r++],i=e[r++];break;case Vs.C:zs.fromCubic(t,i,e[r++],e[r++],e[r++],e[r++],e[r],e[r+1],Hs,Ws),t=e[r++],i=e[r++];break;case Vs.Q:zs.fromQuadratic(t,i,e[r++],e[r++],e[r],e[r+1],Hs,Ws),t=e[r++],i=e[r++];break;case Vs.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=Zs(c)*u+s,a=Ys(c)*h+l),zs.fromArc(s,l,u,h,c,d,p,Hs,Ws),t=Zs(d)*u+s,i=Ys(d)*h+l;break;case Vs.R:n=t=e[r++],a=i=e[r++];var f=e[r++],g=e[r++];zs.fromLine(n,a,n+f,a+g,Hs,Ws);break;case Vs.Z:t=n,i=a}ct.min(Gs,Gs,Hs),ct.max(Fs,Fs,Ws)}return 0===r&&(Gs[0]=Gs[1]=Fs[0]=Fs[1]=0),new Rn(Gs[0],Gs[1],Fs[0]-Gs[0],Fs[1]-Gs[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 Vs.M:t=n=s[c++],i=a=s[c++],e.moveTo(n,a);break;case Vs.L:r=s[c++],o=s[c++],(qs(r-n)>l||qs(o-a)>u||c===h-1)&&(e.lineTo(r,o),n=r,a=o);break;case Vs.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 Vs.Q:e.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],a=s[c-1];break;case Vs.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=Zs(v)*g+p,i=Ys(v)*m+f),n=Zs(M)*g+p,a=Ys(M)*m+f;break;case Vs.R:t=n=s[c],i=a=s[c+1],e.rect(s[c++],s[c++],s[c++],s[c++]);break;case Vs.Z:e.closePath(),n=t,a=i}}}},Ks.CMD=Vs;var Js=Ks;var Qs={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 el={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)&&bs.cubicProjectPoint(e,t,i,n,a,r,o,s,u,h,null)<=c/2}},tl=bs.quadraticProjectPoint;var il={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)&&tl(e,t,i,n,a,r,s,l,null)<=u/2}},nl=2*Math.PI;var al={normalizeRadian:function(e){return(e%=nl)<0&&(e+=nl),e}},rl=al.normalizeRadian,ol=2*Math.PI;var sl={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)%ol<1e-4)return!0;if(r){var c=n;n=rl(a),a=rl(c)}else n=rl(n),a=rl(a);n>a&&(a+=ol);var d=Math.atan2(l,s);return d<0&&(d+=ol),d>=n&&d<=a||d+ol>=n&&d+ol<=a}};var ll=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},ul=al.normalizeRadian,hl=Js.CMD,cl=2*Math.PI,dl=1e-4;var pl=[-1,-1,-1],fl=[-1,-1];function gl(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=bs.cubicRootAt(t,n,r,s,u,pl);if(0===c)return 0;for(var d,p,f=0,g=-1,m=0;m<c;m++){var v=pl[m],y=0===v||1===v?.5:1;bs.cubicAt(e,i,a,o,v)<l||(g<0&&(g=bs.cubicExtrema(t,n,r,s,fl),fl[1]<fl[0]&&g>1&&(h=void 0,h=fl[0],fl[0]=fl[1],fl[1]=h),d=bs.cubicAt(t,n,r,s,fl[0]),g>1&&(p=bs.cubicAt(t,n,r,s,fl[1]))),2===g?v<fl[0]?f+=d<t?y:-y:v<fl[1]?f+=p<d?y:-y:f+=s<p?y:-y:v<fl[0]?f+=d<t?y:-y:f+=s<d?y:-y)}return f}function ml(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=bs.quadraticRootAt(t,n,r,s,pl);if(0===l)return 0;var u=bs.quadraticExtremum(t,n,r);if(u>=0&&u<=1){for(var h=0,c=bs.quadraticAt(t,n,r,u),d=0;d<l;d++){var p=0===pl[d]||1===pl[d]?.5:1;bs.quadraticAt(e,i,a,pl[d])<o||(pl[d]<u?h+=c<t?p:-p:h+=r<c?p:-p)}return h}p=0===pl[0]||1===pl[0]?.5:1;return bs.quadraticAt(e,i,a,pl[0])<o?0:r<t?p:-p}function vl(e,t,i,n,a,r,o,s){if((s-=t)>i||s<-i)return 0;var l=Math.sqrt(i*i-s*s);pl[0]=-l,pl[1]=l;var u=Math.abs(n-a);if(u<1e-4)return 0;if(u%cl<1e-4){n=0,a=cl;var h=r?1:-1;return o>=pl[0]+e&&o<=pl[1]+e?h:0}if(r){l=n;n=ul(a),a=ul(l)}else n=ul(n),a=ul(a);n>a&&(a+=cl);for(var c=0,d=0;d<2;d++){var p=pl[d];if(p+e>o){var f=Math.atan2(s,p);h=r?1:-1;f<0&&(f=cl+f),(f>=n&&f<=a||f+cl>=n&&f+cl<=a)&&(f>Math.PI/2&&f<1.5*Math.PI&&(h=-h),c+=h)}}return c}function yl(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===hl.M&&d>1&&(i||(s+=ll(l,u,h,c,n,a))),1===d&&(h=l=e[d],c=u=e[d+1]),p){case hl.M:l=h=e[d++],u=c=e[d++];break;case hl.L:if(i){if(Qs.containStroke(l,u,e[d],e[d+1],t,n,a))return!0}else s+=ll(l,u,e[d],e[d+1],n,a)||0;l=e[d++],u=e[d++];break;case hl.C:if(i){if(el.containStroke(l,u,e[d++],e[d++],e[d++],e[d++],e[d],e[d+1],t,n,a))return!0}else s+=gl(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 hl.Q:if(i){if(il.containStroke(l,u,e[d++],e[d++],e[d],e[d+1],t,n,a))return!0}else s+=ml(l,u,e[d++],e[d++],e[d],e[d+1],n,a)||0;l=e[d++],u=e[d++];break;case hl.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+=ll(l,u,b,w,n,a):(h=b,c=w);var S=(n-f)*v/m+f;if(i){if(sl.containStroke(f,g,v,y,y+x,_,t,S,a))return!0}else s+=vl(f,g,v,y,y+x,_,S,a);l=Math.cos(y+x)*m+f,u=Math.sin(y+x)*v+g;break;case hl.R:h=l=e[d++],c=u=e[d++];b=h+e[d++],w=c+e[d++];if(i){if(Qs.containStroke(h,c,b,c,t,n,a)||Qs.containStroke(b,c,b,w,t,n,a)||Qs.containStroke(b,w,h,w,t,n,a)||Qs.containStroke(h,w,h,c,t,n,a))return!0}else s+=ll(b,c,b,w,n,a),s+=ll(h,w,h,c,n,a);break;case hl.Z:if(i){if(Qs.containStroke(l,u,h,c,t,n,a))return!0}else s+=ll(l,u,h,c,n,a);l=h,u=c}}return i||(r=u,o=c,Math.abs(r-o)<dl)||(s+=ll(l,u,h,c,n,a)||0),0!==s}var xl={contain:function(e,t,i){return yl(e,0,!1,t,i)},containStroke:function(e,t,i,n){return yl(e,t,!0,i,n)}},_l=sa.prototype.getCanvasPattern,bl=Math.abs,wl=new Js(!0);function Sl(e){Dr.call(this,e),this.path=null}Sl.prototype={constructor:Sl,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(e,t){var i,n=this.style,a=this.path||wl,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=_l.call(s,e)),h?e.strokeStyle=this._strokeGradient:d&&(e.strokeStyle=_l.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 Js},getBoundingRect:function(){var e=this._rect,t=this.style,i=!e;if(i){var n=this.path;n||(n=this.path=new Js),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)),xl.containStroke(r,o/s,e,t)))return!0}if(a.hasFill())return xl.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):Dr.prototype.attrKV.call(this,e,t)},setShape:function(e,t){var i=this.shape;if(i){if(He.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&&bl(e[0]-1)>1e-10&&bl(e[3]-1)>1e-10?Math.sqrt(bl(e[0]*e[3]-e[2]*e[1])):1}},Sl.extend=function(e){var t=function(t){Sl.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 He.inherits(t,Sl),e)"style"!==i&&"shape"!==i&&(t.prototype[i]=e[i]);return t},He.inherits(Sl,Dr);var Ml=Sl,Il=ct.applyTransform,Al=Js.CMD,Tl=[[],[],[]],Cl=Math.sqrt,Dl=Math.atan2;var Ll=function(e,t){var i,n,a,r,o,s=e.data,l=Al.M,u=Al.C,h=Al.L,c=Al.R,d=Al.A,p=Al.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=Cl(t[0]*t[0]+t[1]*t[1]),v=Cl(t[2]*t[2]+t[3]*t[3]),y=Dl(-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++],Il(x,x,t),s[r++]=x[0],s[r++]=x[1],x[0]+=s[a++],x[1]+=s[a++],Il(x,x,t),s[r++]=x[0],s[r++]=x[1]}for(o=0;o<n;o++){var x;(x=Tl[o])[0]=s[a++],x[1]=s[a++],Il(x,x,t),s[r++]=x[0],s[r++]=x[1]}}},Pl=Math.sqrt,kl=Math.sin,Ol=Math.cos,Rl=Math.PI,El=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},Nl=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(El(e)*El(t))},zl=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Nl(e,t))};function Bl(e,t,i,n,a,r,o,s,l,u,h){var c=l*(Rl/180),d=Ol(c)*(e-i)/2+kl(c)*(t-n)/2,p=-1*kl(c)*(e-i)/2+Ol(c)*(t-n)/2,f=d*d/(o*o)+p*p/(s*s);f>1&&(o*=Pl(f),s*=Pl(f));var g=(a===r?-1:1)*Pl((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+Ol(c)*m-kl(c)*v,x=(t+n)/2+kl(c)*m+Ol(c)*v,_=zl([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=zl(b,w);Nl(b,w)<=-1&&(S=Rl),Nl(b,w)>=1&&(S=0),0===r&&S>0&&(S-=2*Rl),1===r&&S<0&&(S+=2*Rl),h.addData(u,y,x,o,s,_,S,c,r)}var Vl=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Gl=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Fl(e,t){var i=function(e){if(!e)return new Js;for(var t,i=0,n=0,a=i,r=n,o=new Js,s=Js.CMD,l=e.match(Vl),u=0;u<l.length;u++){for(var h,c=l[u],d=c.charAt(0),p=c.match(Gl)||[],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 A=o.len(),T=o.data;t===s.C&&(v+=i-T[A-4],y+=n-T[A-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,A=o.len(),T=o.data,t===s.C&&(v+=i-T[A-4],y+=n-T[A-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,A=o.len(),T=o.data,t===s.Q&&(v+=i-T[A-4],y+=n-T[A-3]),i=p[m++],n=p[m++],h=s.Q,o.addData(h,v,y,i,n);break;case"t":v=i,y=n,A=o.len(),T=o.data,t===s.Q&&(v+=i-T[A-4],y+=n-T[A-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++],Bl(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++],Bl(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){Ll(i,e),this.dirty(!0)},t}var Hl=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 Ml(t);return o.createPathProxy(),o.buildPath=function(e){e.appendPath(i);var t=e.getContext();t&&e.rebuildPath(t)},o},Wl={createFromString:function(e,t){return new Ml(Fl(e,t))},extendFromString:function(e,t){return Ml.extend(Fl(e,t))},mergePath:Hl},Ul=$n.ContextCachedBy,jl=function(e){Dr.call(this,e)};jl.prototype={constructor:jl,type:"text",brush:function(e,t){var i=this.style;this.__dirty&&Sr.normalizeTextStyle(i,!0),i.fill=i.stroke=i.shadowBlur=i.shadowColor=i.shadowOffsetX=i.shadowOffsetY=null;var n=i.text;null!=n&&(n+=""),Sr.needDrawText(n,i)?(this.setTransform(e),Sr.renderText(this,e,n,i,null,t),this.restoreTransform(e)):e.__attrCachedBy=Ul.NONE},getBoundingRect:function(){var e=this.style;if(this.__dirty&&Sr.normalizeTextStyle(e,!0),!this._rect){e.text;var t=Za.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,Sr.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}},He.inherits(jl,Dr);var Zl=jl,Yl=Ml.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)}}),Xl=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]];var ql=function(e){return re.browser.ie&&re.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<Xl.length;l++)Xl[l][2]=n[Xl[l][0]],n[Xl[l][0]]=Xl[l][1];t=!0;break}}if(e.apply(this,arguments),t)for(l=0;l<Xl.length;l++)n[Xl[l][0]]=Xl[l][2]}:e},$l=Ml.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},brush:ql(Ml.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()}}),Kl=Ml.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)}}),Jl=Kl,Ql=ct.distance;function eu(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 tu=function(e,t){for(var i=e.length,n=[],a=0,r=1;r<i;r++)a+=Ql(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([eu(s[0],p[0],l[0],u[0],d,f,g),eu(s[1],p[1],l[1],u[1],d,f,g)])}return n},iu=ct.min,nu=ct.max,au=ct.scale,ru=ct.distance,ou=ct.add,su=ct.clone,lu=ct.sub;var uu=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++)iu(o,o,e[d]),nu(s,s,e[d]);iu(o,o,n[0]),nu(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(su(e[d]));continue}a=e[d-1],r=e[d+1]}lu(u,r,a),au(u,u,t);var g=ru(f,a),m=ru(f,r),v=g+m;0!==v&&(g/=v,m/=v),au(h,u,-g),au(c,u,m);var y=ou([],f,h),x=ou([],f,c);n&&(nu(y,y,o),iu(y,y,s),nu(x,x,o),iu(x,x,s)),l.push(y),l.push(x)}return i&&l.push(l.shift()),l};var hu=function(e,t,i){var n=t.points,a=t.smooth;if(n&&n.length>=2){if(a&&"spline"!==a){var r=uu(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=tu(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()}},cu={buildPath:hu},du=Ml.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(e,t){cu.buildPath(e,t,!0)}}),pu=Ml.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(e,t){cu.buildPath(e,t,!1)}}),fu=Math.round;function gu(e,t,i){if(!t)return e;var n=fu(2*e);return(n+fu(t))%2==0?n/2:(n+(i?1:-1))/2}var mu=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&&(fu(2*n)===fu(2*a)&&(e.x1=e.x2=gu(n,s,!0)),fu(2*r)===fu(2*o)&&(e.y1=e.y2=gu(r,s,!0)))}},vu=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=gu(n,s,!0),e.y=gu(a,s,!0),e.width=Math.max(gu(n+r,s,!1)-e.x,0===r?0:1),e.height=Math.max(gu(a+o,s,!1)-e.y,0===o?0:1))}},yu={subPixelOptimizeLine:mu,subPixelOptimizeRect:vu,subPixelOptimize:gu},xu=yu.subPixelOptimizeRect,_u={},bu=Ml.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?(xu(_u,t,this.style),i=_u.x,n=_u.y,a=_u.width,r=_u.height,_u.r=t.r,t=_u):(i=t.x,n=t.y,a=t.width,r=t.height),t.r?Ya.buildPath(e,t):e.rect(i,n,a,r),e.closePath()}}),wu=yu.subPixelOptimizeLine,Su={},Mu=Ml.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?(wu(Su,t,this.style),i=Su.x1,n=Su.y1,a=Su.x2,r=Su.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]}}),Iu=bs.quadraticSubdivide,Au=bs.cubicSubdivide,Tu=bs.quadraticAt,Cu=bs.cubicAt,Du=bs.quadraticDerivativeAt,Lu=bs.cubicDerivativeAt,Pu=[];function ku(e,t,i){var n=e.cpx2,a=e.cpy2;return null===n||null===a?[(i?Lu:Cu)(e.x1,e.cpx1,e.cpx2,e.x2,t),(i?Lu:Cu)(e.y1,e.cpy1,e.cpy2,e.y2,t)]:[(i?Du:Tu)(e.x1,e.cpx1,e.x2,t),(i?Du:Tu)(e.y1,e.cpy1,e.y2,t)]}var Ou=Ml.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&&(Iu(i,o,a,h,Pu),o=Pu[1],a=Pu[2],Iu(n,s,r,h,Pu),s=Pu[1],r=Pu[2]),e.quadraticCurveTo(o,s,a,r)):(h<1&&(Au(i,o,l,a,h,Pu),o=Pu[1],l=Pu[2],a=Pu[3],Au(n,s,u,r,h,Pu),s=Pu[1],u=Pu[2],r=Pu[3]),e.bezierCurveTo(o,s,l,u,a,r)))},pointAt:function(e){return ku(this.shape,e,!1)},tangentAt:function(e){var t=ku(this.shape,e,!0);return ct.normalize(t,t)}}),Ru=Ml.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)}}),Eu=Ml.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(),Ml.prototype.getBoundingRect.call(this)}}),Nu=Eu,zu=function(e){this.colorStops=e||[]};zu.prototype={constructor:zu,addColorStop:function(e,t){this.colorStops.push({offset:e,color:t})}};var Bu=zu,Vu=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,Bu.call(this,a)};Vu.prototype={constructor:Vu},He.inherits(Vu,Bu);var Gu=Vu,Fu=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,Bu.call(this,n)};Fu.prototype={constructor:Fu},He.inherits(Fu,Bu);var Hu=Fu,Wu=He.inherits;function Uu(e){Dr.call(this,e),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}Uu.prototype.incremental=!0,Uu.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},Uu.prototype.addDisplayable=function(e,t){t?this._temporaryDisplayables.push(e):this._displayables.push(e),this.dirty()},Uu.prototype.addDisplayables=function(e,t){t=t||!1;for(var i=0;i<e.length;i++)this.addDisplayable(e[i],t)},Uu.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])},Uu.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}},Uu.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 ju=[];Uu.prototype.getBoundingRect=function(){if(!this._rect){for(var e=new Rn(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(ju)),e.union(n)}this._rect=e}return this._rect},Uu.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},Wu(Uu,Dr);var Zu=Uu,Yu=Pr,Xu=Nn,qu=Zl,$u=Yl,Ku=$l,Ju=Jl,Qu=du,eh=pu,th=bu,ih=Mu,nh=Ou,ah=Ru,rh=Nu,oh=Gu,sh=Hu,lh=Rn,uh=Zu,hh=Math.max,ch=Math.min,dh={},ph=1,fh="emphasis",gh="normal",mh=1,vh={},yh={};function xh(e,t){yh[e]=t}function _h(e,t,i,n){var a=Wl.createFromString(e,t);return i&&("center"===n&&(i=bh(i,a.getBoundingRect())),Sh(a,i)),a}function bh(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 wh=Wl.mergePath;function Sh(e,t){if(e.applyTransform){var i=e.getBoundingRect().calculateTransform(t);e.applyTransform(i)}}var Mh=yu.subPixelOptimize;function Ih(e){return null!=e&&"none"!==e}var Ah=He.createHashMap(),Th=0;function Ch(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),Uh(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),Dh(r,t,"fill"),Dh(r,t,"stroke"),Wh(r),n||(e.dirty(!1),e.z2+=ph)}}}function Dh(e,t,i){!Ih(t[i])&&Ih(e[i])&&(e[i]=function(e){if("string"!=typeof e)return e;var t=Ah.get(e);return t||(t=Yi.lift(e,-.1),Th<1e4&&(Ah.set(e,t),Th++)),t}(e[i]))}function Lh(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&&(Uh(i),e.setStyle(n),Wh(i));var a=e.__cachedNormalZ2;null!=a&&e.z2-a===ph&&(e.z2=a)}}function Ph(e,t,i){var n,a=gh,r=gh;e.__highlighted&&(a=fh,n=!0),t(e,i),e.__highlighted&&(r=fh,n=!0),e.isGroup&&e.traverse((function(e){!e.isGroup&&t(e,i)})),n&&e.__highDownOnUpdate&&e.__highDownOnUpdate(a,r)}function kh(e,t){t=e.__hoverStl=!1!==t&&(e.hoverStyle||t||{}),e.__hoverStlDirty=!0,e.__highlighted&&(e.__cachedNormalStl=null,Lh(e),Ch(e))}function Oh(e){!zh(this,e)&&!this.__highByOuter&&Ph(this,Ch)}function Rh(e){!zh(this,e)&&!this.__highByOuter&&Ph(this,Lh)}function Eh(e){this.__highByOuter|=1<<(e||0),Ph(this,Ch)}function Nh(e){!(this.__highByOuter&=~(1<<(e||0)))&&Ph(this,Lh)}function zh(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Bh(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",Oh)[n]("mouseout",Rh),e[n]("emphasis",Eh)[n]("normal",Nh),e.__highByOuter=e.__highByOuter||0,e.__highDownDispatcher=!i}}function Vh(e,t,i,n,a){return Gh(e,t,n,a),i&&He.extend(e,i),e}function Gh(e,t,i,n){if((i=i||dh).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=He.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||dh).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]);Fh(o[h]={},c,l,i,n)}return e.rich=o,Fh(e,t,l,i,n,!0),i.forceRich&&!i.textStyle&&(i.textStyle={}),e}function Fh(e,t,i,n,a,r){i=!a&&i||dh,e.textFill=Hh(t.getShallow("color"),n)||i.color,e.textStroke=Hh(t.getShallow("textBorderColor"),n)||i.textBorderColor,e.textStrokeWidth=He.retrieve2(t.getShallow("textBorderWidth"),i.textBorderWidth),a||(r&&(e.insideRollbackOpt=n,Wh(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=Hh(t.getShallow("backgroundColor"),n),e.textPadding=t.getShallow("padding"),e.textBorderColor=Hh(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 Hh(e,t){return"auto"!==e?e:t&&t.autoColor?t.autoColor:null}function Wh(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 Uh(e){var t=e.insideRollback;t&&(e.textFill=t.textFill,e.textStroke=t.textStroke,e.textStrokeWidth=t.textStrokeWidth,e.insideRollback=null)}function jh(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 Zh(e,t,i,n,a){jh(!0,e,t,i,n,a)}function Yh(e,t,i){return t&&!He.isArrayLike(t)&&(t=gi.getLocalTransform(t)),i&&(t=oi.invert([],t)),ct.applyTransform([],e,t)}function Xh(e,t,i,n,a,r,o,s){var l,u=i-e,h=n-t,c=o-a,d=s-r,p=qh(c,d,u,h);if((l=p)<=1e-6&&l>=-1e-6)return!1;var f=e-a,g=t-r,m=qh(f,g,u,h)/p;if(m<0||m>1)return!1;var v=qh(f,g,c,d)/p;return!(v<0||v>1)}function qh(e,t,i,n){return e*n-i*t}xh("circle",Yl),xh("sector",$l),xh("ring",Jl),xh("polygon",du),xh("polyline",pu),xh("rect",bu),xh("line",Mu),xh("bezierCurve",Ou),xh("arc",Ru);var $h=function(e,t,i){var n=new Pr({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(bh(t,a))}}});return n},Kh=function(e){return yu.subPixelOptimizeLine(e.shape,e.shape,e.style),e},Jh=function(e){return yu.subPixelOptimizeRect(e.shape,e.shape,e.style),e},Qh=function(e,t,i){var n,a={isRectText:!0};!1===i?n=!0:a.autoColor=i,Gh(e,t,a,n)},ec=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=Yh(r,t,i),Math.abs(r[0])>Math.abs(r[1])?r[0]>0?"right":"left":r[1]>0?"bottom":"top"},tc=function(e,t){return He.map(e,(function(e){var i=e[0];i=hh(i,t.x),i=ch(i,t.x+t.width);var n=e[1];return n=hh(n,t.y),[i,n=ch(n,t.y+t.height)]}))},ic=function(e,t,i){var n=(t=He.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),He.defaults(n,i),new Pr(t)):_h(e.replace("path://",""),t,i,"center")},nc=function(e,t,i,n,a){for(var r=0,o=a[a.length-1];r<a.length;r++){var s=a[r];if(Xh(e,t,i,n,s[0],s[1],o[0],o[1]))return!0;o=s}},ac={Image:Yu,Group:Xu,Text:qu,Circle:$u,Sector:Ku,Ring:Ju,Polygon:Qu,Polyline:eh,Rect:th,Line:ih,BezierCurve:nh,Arc:ah,CompoundPath:rh,LinearGradient:oh,RadialGradient:sh,BoundingRect:lh,IncrementalDisplayable:uh,Z2_EMPHASIS_LIFT:ph,CACHED_LABEL_STYLE_PROPERTIES:{color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},extendShape:function(e){return Ml.extend(e)},extendPath:function(e,t){return Wl.extendFromString(e,t)},registerShape:xh,getShapeClass:function(e){if(yh.hasOwnProperty(e))return yh[e]},makePath:_h,makeImage:$h,mergePath:wh,resizePath:Sh,subPixelOptimizeLine:Kh,subPixelOptimizeRect:Jh,subPixelOptimize:Mh,setElementHoverStyle:kh,setHoverStyle:function(e,t){Bh(e,!0),Ph(e,kh,t)},setAsHighDownDispatcher:Bh,isHighDownDispatcher:function(e){return!(!e||!e.__highDownDispatcher)},getHighlightDigit:function(e){var t=vh[e];return null==t&&mh<=32&&(t=vh[e]=mh++),t},setLabelStyle:function(e,t,i,n,a,r,o){var s,l=(a=a||dh).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=He.isFunction(a.defaultText)?a.defaultText(u,a):a.defaultText));var f=d?s:null,g=p?He.retrieve2(l?l.getFormattedLabel(u,"emphasis",null,h,c):null,s):null;null==f&&null==g||(Vh(e,i,r,a),Vh(t,n,o,a,!0)),e.text=f,t.text=g},modifyLabelStyle:function(e,t,i){var n=e.style;t&&(Uh(n),e.setStyle(t),Wh(n)),n=e.__hoverStl,i&&n&&(Uh(n),He.extend(n,i),Wh(n))},setTextStyle:Vh,setText:Qh,getFont:function(e,t){var i=t&&t.getModel("textStyle");return He.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:Zh,initProps:function(e,t,i,n,a){jh(!1,e,t,i,n,a)},getTransform:function(e,t){for(var i=oi.identity([]);e&&e!==t;)oi.mul(i,e.getLocalTransform(),i),e=e.parent;return i},applyTransform:Yh,transformDirection:ec,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)),Zh(e,n,i,e.dataIndex)}}}))}function o(e){var t={position:ct.clone(e.position),rotation:e.rotation};return e.shape&&(t.shape=He.extend({},e.shape)),t}},clipPointsByRect:tc,clipRectByRect:function(e,t){var i=hh(e.x,t.x),n=ch(e.x+e.width,t.x+t.width),a=hh(e.y,t.y),r=ch(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:ic,linePolygonIntersect:nc,lineLineIntersect:Xh},rc=["textStyle","color"],oc={getTextColor:function(e){var t=this.ecModel;return this.getShallow("color")||(!e&&t?t.get(rc):null)},getFont:function(){return ac.getFont({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(e){return Za.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"))}},sc=oc,lc=Yo([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),uc={getItemStyle:function(e,t){var i=lc(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]}},hc=uc,cc=zo.makeInner,dc=Zo.enableClassExtend,pc=Zo.enableClassCheck,fc=He.mixin,gc=cc();function mc(e,t,i){this.parentModel=t,this.ecModel=i,this.option=e}function vc(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 yc(e,t){var i=gc(e).getParent;return i?i.call(e,t):e.parentModel}mc.prototype={constructor:mc,init:null,mergeOption:function(e){He.merge(this.option,e,!0)},get:function(e,t){return null==e?this.option:vc(this.option,this.parsePath(e),!t&&yc(this,e))},getShallow:function(e,t){var i=this.option,n=null==i?i:i[e],a=!t&&yc(this,e);return null==n&&a&&(n=a.getShallow(e)),n},getModel:function(e,t){var i;return new mc(null==e?this.option:vc(this.option,e=this.parsePath(e)),t=t||(i=yc(this,e))&&i.getModel(e),this.ecModel)},isEmpty:function(){return null==this.option},restoreData:function(){},clone:function(){return new(0,this.constructor)(He.clone(this.option))},setReadOnly:function(e){},parsePath:function(e){return"string"==typeof e&&(e=e.split(".")),e},customizeGetParent:function(e){gc(this).getParent=e},isAnimationEnabled:function(){if(!re.node){if(null!=this.option.animation)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}},dc(mc),pc(mc),fc(mc,$o),fc(mc,Jo),fc(mc,sc),fc(mc,hc);var xc=mc,_c=Zo.parseClassType,bc=0;var wc={getUID:function(e){return[e||"",bc++,Math.random().toFixed(5)].join("_")},enableSubTypeDefaulter:function(e){var t={};return e.registerSubTypeDefaulter=function(e,i){e=_c(e),t[e.main]=i},e.determineSubType=function(i,n){var a=n.type;if(!a){var r=_c(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 He.each(e,(function(r){var o=i(n,r),s=function(e,t){var i=[];return He.each(e,(function(e){He.indexOf(t,e)>=0&&i.push(e)})),i}(o.originalDeps=t(r),e);o.entryCount=s.length,0===o.entryCount&&a.push(r),He.each(s,(function(e){He.indexOf(o.predecessor,e)<0&&o.predecessor.push(e);var t=i(n,e);He.indexOf(t.successor,e)<0&&t.successor.push(r)}))})),{graph:n,noEntryList:a}}(n),s=o.graph,l=o.noEntryList,u={};for(He.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]),He.each(c.successor,d?f:p)}He.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)}}}},Sc=1e-4;var Mc=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Ic(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 Ac=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]},Tc=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},Cc=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},Dc=function(e,t,i){if(!e[t])return 0;var n=He.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=He.map(e,(function(e){return(isNaN(e)?0:e)/n*a*100})),o=100*a,s=He.map(r,(function(e){return Math.floor(e)})),l=He.reduce(s,(function(e,t){return e+t}),0),u=He.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},Lc=function(e,t){var i=Ic(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},Pc=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},kc=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))}},Oc=function(e){return e-parseFloat(e)>=0},Rc={linearMap:Ac,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:Tc,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:Cc,getPercentWithPrecision:Dc,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<Sc},parseDate:function(e){if(e instanceof Date)return e;if("string"==typeof e){var t=Mc.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,Ic(e))},quantityExponent:Ic,nice:Lc,quantile:Pc,reformIntervals:kc,isNumeric:Oc};var Ec=He.normalizeCssArray,Nc=/([&<>"'])/g,zc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Bc(e){return null==e?"":(e+"").replace(Nc,(function(e,t){return zc[t]}))}var Vc=["a","b","c","d","e","f","g"],Gc=function(e,t){return"{"+e+(null==t?"":t)+"}"};function Fc(e,t){return"0000".substr(0,t-(e+="").length)+e}var Hc=function(e,t,i){He.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=Vc[r];e=e.replace(Gc(o),Gc(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(Gc(Vc[l],s),i?Bc(u):u)}return e},Wc=function(e,t,i){return He.each(t,(function(t,n){e=e.replace("{"+n+"}",i?Bc(t):t)})),e},Uc=function(e,t){var i=(e=He.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:'+Bc(i)+";"+(t||"")+'"></span>':'<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:'+Bc(i)+";"+(t||"")+'"></span>':{renderMode:a,content:"{marker"+r+"|}  ",style:{color:i}}:""},jc=function(e,t,i){"week"!==e&&"month"!==e&&"quarter"!==e&&"half-year"!==e&&"year"!==e||(e="MM-dd\nyyyy");var n=Rc.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",Fc(o,2)).replace("M",o).replace("yyyy",r).replace("yy",r%100).replace("dd",Fc(s,2)).replace("d",s).replace("hh",Fc(l,2)).replace("h",l).replace("mm",Fc(u,2)).replace("m",u).replace("ss",Fc(h,2)).replace("s",h).replace("SSS",Fc(c,3))},Zc=function(e,t,i,n,a,r,o,s){return Za.getBoundingRect(e,t,i,n,a,s,r,o)},Yc={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:Ec,encodeHTML:Bc,formatTpl:Hc,formatTplSimple:Wc,getTooltipMarker:Uc,formatTime:jc,capitalFirst:function(e){return e?e.charAt(0).toUpperCase()+e.substr(1):e},truncateText:Za.truncateText,getTextBoundingRect:function(e){return Za.getBoundingRect(e.text,e.font,e.textAlign,e.textVerticalAlign,e.textPadding,e.textLineHeight,e.rich,e.truncate)},getTextRect:Zc,windowOpen:function(e,t){if("_blank"===t||"blank"===t){var i=window.open();i.opener=null,i.location=e}else window.open(e,t)}},Xc=Rc.parsePercent,qc=He.each,$c=["left","right","top","bottom","width","height"],Kc=[["width","left","right"],["height","top","bottom"]];function Jc(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 Qc=Jc,ed=He.curry(Jc,"vertical"),td=He.curry(Jc,"horizontal");function id(e,t,i){i=Yc.normalizeCssArray(i||0);var n=t.width,a=t.height,r=Xc(e.left,n),o=Xc(e.top,a),s=Xc(e.right,n),l=Xc(e.bottom,a),u=Xc(e.width,n),h=Xc(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 Rn(r+i[3],o+i[0],u,h);return f.margin=i,f}function nd(e,t){return t&&e&&qc($c,(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e}var ad=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 Rn(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=id(He.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])}},rd=function(e,t,i){!He.isObject(i)&&(i={});var n=i.ignoreSize;!He.isArray(n)&&(n=[n,n]);var a=o(Kc[0],0),r=o(Kc[1],1);function o(i,a){var r={},o=0,u={},h=0;if(qc(i,(function(t){u[t]=e[t]})),qc(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){qc(e,(function(e){t[e]=i[e]}))}u(Kc[0],e,a),u(Kc[1],e,r)},od={LOCATION_PARAMS:$c,HV_NAMES:Kc,box:Qc,vbox:ed,hbox:td,getAvailableSize:function(e,t,i){var n=t.width,a=t.height,r=Xc(e.x,n),o=Xc(e.y,a),s=Xc(e.x2,n),l=Xc(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=Yc.normalizeCssArray(i||0),{width:Math.max(s-r-i[1]-i[3],0),height:Math.max(l-o-i[0]-i[2],0)}},getLayoutRect:id,positionElement:ad,sizeCalculable:function(e,t){return null!=e[Kc[t][0]]||null!=e[Kc[t][1]]&&null!=e[Kc[t][2]]},mergeLayoutParam:rd,getLayoutParams:function(e){return nd({},e)},copyLayoutParams:nd},sd={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")}}},ld=Zo.enableClassManagement,ud=Zo.parseClassType,hd=(0,zo.makeInner)(),cd=xc.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(e,t,i,n){xc.call(this,e,t,i,n),this.uid=wc.getUID("ec_cpt_model")},init:function(e,t,i,n){this.mergeDefaultAndTheme(e,i)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?od.getLayoutParams(e):{},a=t.getTheme();He.merge(e,a.get(this.mainType)),He.merge(e,this.getDefaultOption()),i&&od.mergeLayoutParam(e,n,i)},mergeOption:function(e,t){He.merge(this.option,e,!0);var i=this.layoutMode;i&&od.mergeLayoutParam(this.option,e,i)},optionUpdated:function(e,t){},getDefaultOption:function(){var e=hd(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=He.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)})}});ld(cd,{registerWhenExtend:!0}),wc.enableSubTypeDefaulter(cd),wc.enableTopologicalTravel(cd,(function(e){var t=[];He.each(cd.getClassesByMainType(e),(function(e){t=t.concat(e.prototype.dependencies||[])})),t=He.map(t,(function(e){return ud(e).main})),"dataset"!==e&&He.indexOf(t,"dataset")<=0&&t.unshift("dataset");return t})),He.mixin(cd,sd);var dd=cd,pd="";"undefined"!=typeof navigator&&(pd=navigator.platform||"");var fd={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:pd.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},gd=zo.makeInner,md=zo.normalizeToArray,vd=gd();var yd={clearColorPalette:function(){vd(this).colorIdx=0,vd(this).colorNameMap={}},getColorFromPalette:function(e,t,i){var n=vd(t=t||this),a=n.colorIdx||0,r=n.colorNameMap=n.colorNameMap||{};if(r.hasOwnProperty(e))return r[e];var o=md(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}}},xd=yd,_d={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"},bd=He.createHashMap,wd=He.isTypedArray,Sd=Zo.enableClassCheck,Md=_d.SOURCE_FORMAT_ORIGINAL,Id=_d.SERIES_LAYOUT_BY_COLUMN,Ad=_d.SOURCE_FORMAT_UNKNOWN,Td=_d.SOURCE_FORMAT_TYPED_ARRAY,Cd=_d.SOURCE_FORMAT_KEYED_COLUMNS;function Dd(e){this.fromDataset=e.fromDataset,this.data=e.data||(e.sourceFormat===Cd?{}:[]),this.sourceFormat=e.sourceFormat||Ad,this.seriesLayoutBy=e.seriesLayoutBy||Id,this.dimensionsDefine=e.dimensionsDefine,this.encodeDefine=e.encodeDefine&&bd(e.encodeDefine),this.startIndex=e.startIndex||0,this.dimensionsDetectCount=e.dimensionsDetectCount}Dd.seriesDataToSource=function(e){return new Dd({data:e,sourceFormat:wd(e)?Td:Md,fromDataset:!1})},Sd(Dd);var Ld=Dd,Pd=zo.makeInner,kd=zo.getDataItemValue,Od=He.createHashMap,Rd=He.each,Ed=He.map,Nd=He.isArray,zd=He.isString,Bd=He.isObject,Vd=He.isTypedArray,Gd=He.isArrayLike,Fd=He.extend,Hd=_d.SOURCE_FORMAT_ORIGINAL,Wd=_d.SOURCE_FORMAT_ARRAY_ROWS,Ud=_d.SOURCE_FORMAT_OBJECT_ROWS,jd=_d.SOURCE_FORMAT_KEYED_COLUMNS,Zd=_d.SOURCE_FORMAT_UNKNOWN,Yd=_d.SOURCE_FORMAT_TYPED_ARRAY,Xd=_d.SERIES_LAYOUT_BY_ROW,qd={Must:1,Might:2,Not:3},$d=Pd();function Kd(e){if(e){var t=Od();return Ed(e,(function(e,i){if(null==(e=Fd({},Bd(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 Jd(e,t,i,n){if(null==n&&(n=1/0),t===Xd)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 Qd(e){var t=e.option;if(!t.data)return e.ecModel.getComponent("dataset",t.datasetIndex||0)}function ep(e,t,i,n,a,r){var o,s,l;if(Vd(e))return qd.Not;if(n){var u=n[r];Bd(u)?(s=u.name,l=u.type):zd(u)&&(s=u)}if(null!=l)return"ordinal"===l?qd.Must:qd.Not;if(t===Wd)if(i===Xd){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===Ud){if(!s)return qd.Not;for(c=0;c<e.length&&c<5;c++){if((p=e[c])&&null!=(o=g(p[s])))return o}}else if(t===jd){if(!s)return qd.Not;if(!(h=e[s])||Vd(h))return qd.Not;for(c=0;c<h.length&&c<5;c++)if(null!=(o=g(h[c])))return o}else if(t===Hd)for(c=0;c<e.length&&c<5;c++){var p=e[c],f=kd(p);if(!Nd(f))return qd.Not;if(null!=(o=g(f[r])))return o}function g(e){var t=zd(e);return null!=e&&isFinite(e)&&""!==e?t?qd.Might:qd.Not:t&&"-"!==e?qd.Must:void 0}return qd.Not}var tp=function(e){var t=e.option.source,i=Zd;if(Vd(t))i=Yd;else if(Nd(t)){0===t.length&&(i=Wd);for(var n=0,a=t.length;n<a;n++){var r=t[n];if(null!=r){if(Nd(r)){i=Wd;break}if(Bd(r)){i=Ud;break}}}}else if(Bd(t)){for(var o in t)if(t.hasOwnProperty(o)&&Gd(t[o])){i=jd;break}}else if(null!=t)throw new Error("Invalid data");$d(e).sourceFormat=i},ip=function(e,t,i){var n={},a=Qd(t);if(!a||!e)return n;var r,o,s=[],l=[],u=t.ecModel,h=$d(u).datasetMap,c=a.uid+"_"+i.seriesLayoutBy;e=e.slice(),Rd(e,(function(t,i){!Bd(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 Rd(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},np=function(e,t,i){var n={};if(!Qd(e))return n;var a,r=t.sourceFormat,o=t.dimensionsDefine;r!==Ud&&r!==jd||Rd(o,(function(e,t){"name"===(Bd(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=ep(t.data,r,t.seriesLayoutBy,o,t.startIndex,l);s.push(h);var c=h===qd.Not;if(c&&null==e.v&&l!==a&&(e.v=l),(null==e.n||e.n===e.v||!c&&s[e.n]===qd.Not)&&(e.n=l),d(e)&&s[e.n]!==qd.Not)return e;c||(h===qd.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},ap={BE_ORDINAL:qd,detectSourceFormat:tp,getSource:function(e){return $d(e).source},resetSourceDefaulter:function(e){$d(e).datasetMap=Od()},prepareSource:function(e){var t=e.option,i=t.data,n=Vd(i)?Yd:Hd,a=!1,r=t.seriesLayoutBy,o=t.sourceHeader,s=t.dimensions,l=Qd(e);if(l){var u=l.option;i=u.source,n=$d(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:Kd(a)};var r,o;if(t===Wd)"auto"===n||null==n?Jd((function(e){null!=e&&"-"!==e&&(zd(e)?null==o&&(o=1):o=0)}),i,e,10):o=n?1:0,a||1!==o||(a=[],Jd((function(e,t){a[t]=null!=e?e:""}),i,e)),r=a?a.length:i===Xd?e.length:e[0]?e[0].length:null;else if(t===Ud)a||(a=function(e){var t,i=0;for(;i<e.length&&!(t=e[i++]););if(t){var n=[];return Rd(t,(function(e,t){n.push(t)})),n}}(e));else if(t===jd)a||(a=[],Rd(e,(function(e,t){a.push(t)})));else if(t===Hd){var s=kd(e[0]);r=Nd(s)&&s.length||1}return{startIndex:o,dimensionsDefine:Kd(a),dimensionsDetectCount:r}}(i,n,r,o,s);$d(e).source=new Ld({data:i,fromDataset:a,seriesLayoutBy:r,sourceFormat:n,dimensionsDefine:h.dimensionsDefine,startIndex:h.startIndex,dimensionsDetectCount:h.dimensionsDetectCount,encodeDefine:t.encode})},makeSeriesEncodeForAxisCoordSys:ip,makeSeriesEncodeForNameBased:np,guessOrdinal:function(e,t){return ep(e.data,e.sourceFormat,e.seriesLayoutBy,e.dimensionsDefine,e.startIndex,t)}},rp=He.each,op=He.filter,sp=He.map,lp=He.isArray,up=He.indexOf,hp=He.isObject,cp=He.isString,dp=He.createHashMap,pp=He.assert,fp=He.clone,gp=He.merge,mp=He.extend,vp=He.mixin,yp=ap.resetSourceDefaulter,xp="\0_ec_inner",_p=xc.extend({init:function(e,t,i,n){i=i||{},this.option=null,this._theme=new xc(i),this._optionManager=n},setOption:function(e,t){pp(!(xp 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)):bp.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&&rp(r,(function(e){this.mergeOption(e,t=!0)}),this)}return t},mergeOption:function(e){var t=this.option,i=this._componentsMap,n=[];yp(this),rp(e,(function(e,i){null!=e&&(dd.hasClass(i)?i&&n.push(i):t[i]=null==t[i]?fp(e):gp(t[i],e,!0))})),dd.topologicalTravel(n,dd.getAllClassMainTypes(),(function(n,a){var r=zo.normalizeToArray(e[n]),o=zo.mappingToExists(i.get(n),r);zo.makeIdAndName(o),rp(o,(function(e,t){var i=e.option;hp(i)&&(e.keyInfo.mainType=n,e.keyInfo.subType=function(e,t,i){var n=t.type?t.type:i?i.subType:dd.determineSubType(e,t);return n}(n,i,e.exist))}));var s=function(e,t){lp(t)||(t=t?[t]:[]);var i={};return rp(t,(function(t){i[t]=(e.get(t)||[]).slice()})),i}(i,a);t[n]=[],i.set(n,[]),rp(o,(function(e,a){var r=e.exist,o=e.option;if(pp(hp(o)||r,"Empty component definition"),o){var l=dd.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=mp({dependentModels:s,componentIndex:a},e.keyInfo);r=new l(o,this,this,u),mp(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&&wp(this,i.get("series"))}),this),this._seriesIndicesMap=dp(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var e=fp(this.option);return rp(e,(function(t,i){if(dd.hasClass(i)){for(var n=(t=zo.normalizeToArray(t)).length-1;n>=0;n--)zo.isIdInner(t[n])&&t.splice(n,1);e[i]=t}})),delete e[xp],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)lp(n)||(n=[n]),i=op(sp(n,(function(e){return o[e]})),(function(e){return!!e}));else if(null!=a){var s=lp(a);i=op(o,(function(e){return s&&up(a,e.id)>=0||!s&&e.id===a}))}else if(null!=r){var l=lp(r);i=op(o,(function(e){return l&&up(r,e.name)>=0||!l&&e.name===r}))}else i=o.slice();return Sp(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=Sp(u,e),e.filter?op(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){rp(e,(function(e,a){t.call(i,n,e,a)}))}));else if(cp(e))rp(n.get(e),t,i);else if(hp(e)){var a=this.findComponents(e);rp(a,t,i)}},getSeriesByName:function(e){var t=this._componentsMap.get("series");return op(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 op(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){rp(this._seriesIndices,(function(i){var n=this._componentsMap.get("series")[i];e.call(t,n,i)}),this)},eachRawSeries:function(e,t){rp(this._componentsMap.get("series"),e,t)},eachSeriesByType:function(e,t,i){rp(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 rp(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){wp(this,op(this._componentsMap.get("series"),e,t))},restoreData:function(e){var t=this._componentsMap;wp(this,t.get("series"));var i=[];t.each((function(e,t){i.push(t)})),dd.topologicalTravel(i,dd.getAllClassMainTypes(),(function(i,n){rp(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 bp(e){this.option={},this.option[xp]=1,this._componentsMap=dp({series:[]}),this._seriesIndices,this._seriesIndicesMap,function(e,t){var i=e.color&&!e.colorLayer;rp(t,(function(t,n){"colorLayer"===n&&i||dd.hasClass(n)||("object"==typeof t?e[n]=e[n]?gp(e[n],t,!1):fp(t):null==e[n]&&(e[n]=t))}))}(e,this._theme.option),gp(e,fd,!1),this.mergeOption(e)}function wp(e,t){e._seriesIndicesMap=dp(e._seriesIndices=sp(t,(function(e){return e.componentIndex}))||[])}function Sp(e,t){return t.hasOwnProperty("subType")?op(e,(function(e){return e.subType===t.subType})):e}vp(_p,xd);var Mp=_p,Ip=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"];var Ap=function(e){He.each(Ip,(function(t){this[t]=He.bind(e[t],e)}),this)},Tp={};function Cp(){this._coordinateSystems=[]}Cp.prototype={constructor:Cp,create:function(e,t){var i=[];He.each(Tp,(function(n,a){var r=n.create(e,t);i=i.concat(r||[])})),this._coordinateSystems=i},update:function(e,t){He.each(this._coordinateSystems,(function(i){i.update&&i.update(e,t)}))},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},Cp.register=function(e,t){Tp[e]=t},Cp.get=function(e){return Tp[e]};var Dp=Cp,Lp=He.each,Pp=He.clone,kp=He.map,Op=He.merge,Rp=/^(min|max)?(.+)$/;function Ep(e){this._api=e,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}function Np(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;Lp(l,(function(e){e&&e.option&&(e.query?o.push(e):n||(n=e))}))}return a||(a=e),a.timeline||(a.timeline=s),Lp([a].concat(r).concat(He.map(o,(function(e){return e.option}))),(function(e){Lp(t,(function(t){t(e,i)}))})),{baseOption:a,timelineOptions:r,mediaDefault:n,mediaList:o}}function zp(e,t,i){var n={width:t,height:i,aspectratio:t/i},a=!0;return He.each(e,(function(e,t){var i=t.match(Rp);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}Ep.prototype={constructor:Ep,setOption:function(e,t){e&&He.each(zo.normalizeToArray(e.series),(function(e){e&&e.data&&He.isTypedArray(e.data)&&He.setAsPrimitive(e.data)})),e=Pp(e);var i,n,a=this._optionBackup,r=Np.call(this,e,t,!a);this._newBaseOption=r.baseOption,a?(i=a.baseOption,n=r.baseOption,Lp(n=n||{},(function(e,t){if(null!=e){var n=i[t];if(dd.hasClass(t)){e=zo.normalizeToArray(e),n=zo.normalizeToArray(n);var a=zo.mappingToExists(n,e);i[t]=kp(a,(function(e){return e.option&&e.exist?Op(e.exist,e.option,!0):e.exist||e.option}))}else i[t]=Op(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=kp(t.timelineOptions,Pp),this._mediaList=kp(t.mediaList,Pp),this._mediaDefault=Pp(t.mediaDefault),this._currentMediaIndices=[],Pp(e?t.baseOption:this._newBaseOption)},getTimelineOption:function(e){var t,i=this._timelineOptions;if(i.length){var n=e.getComponent("timeline");n&&(t=Pp(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++)zp(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=kp(s,(function(e){return Pp(-1===e?o.option:r[e].option)}))),this._currentMediaIndices=s,l}};var Bp=Ep,Vp=He.each,Gp=He.isObject,Fp=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Hp(e){var t=e&&e.itemStyle;if(t)for(var i=0,n=Fp.length;i<n;i++){var a=Fp[i],r=t.normal,o=t.emphasis;r&&r[a]&&(e[a]=e[a]||{},e[a].normal?He.merge(e[a].normal,r[a]):e[a].normal=r[a],r[a]=null),o&&o[a]&&(e[a]=e[a]||{},e[a].emphasis?He.merge(e[a].emphasis,o[a]):e[a].emphasis=o[a],o[a]=null)}}function Wp(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,He.defaults(e[t],n)):e[t]=n),a&&(e.emphasis=e.emphasis||{},e.emphasis[t]=a)}}function Up(e){Wp(e,"itemStyle"),Wp(e,"lineStyle"),Wp(e,"areaStyle"),Wp(e,"label"),Wp(e,"labelLine"),Wp(e,"upperLabel"),Wp(e,"edgeLabel")}function jp(e,t){var i=Gp(e)&&e[t],n=Gp(i)&&i.textStyle;if(n)for(var a=0,r=zo.TEXT_STYLE_OPTIONS.length;a<r;a++){t=zo.TEXT_STYLE_OPTIONS[a];n.hasOwnProperty(t)&&(i[t]=n[t])}}function Zp(e){e&&(Up(e),jp(e,"label"),e.emphasis&&jp(e.emphasis,"label"))}function Yp(e){return He.isArray(e)?e:e?[e]:[]}function Xp(e){return(He.isArray(e)?e[0]:e)||{}}var qp=function(e,t){Vp(Yp(e.series),(function(e){Gp(e)&&function(e){if(Gp(e)){Hp(e),Up(e),jp(e,"label"),jp(e,"upperLabel"),jp(e,"edgeLabel"),e.emphasis&&(jp(e.emphasis,"label"),jp(e.emphasis,"upperLabel"),jp(e.emphasis,"edgeLabel")),(i=e.markPoint)&&(Hp(i),Zp(i)),(n=e.markLine)&&(Hp(n),Zp(n));var t=e.markArea;t&&Zp(t);var i,n,a=e.data;if("graph"===e.type){a=a||e.nodes;var r=e.links||e.edges;if(r&&!He.isTypedArray(r))for(var o=0;o<r.length;o++)Zp(r[o]);He.each(e.categories,(function(e){Up(e)}))}if(a&&!He.isTypedArray(a))for(o=0;o<a.length;o++)Zp(a[o]);if((i=e.markPoint)&&i.data){var s=i.data;for(o=0;o<s.length;o++)Zp(s[o])}if((n=e.markLine)&&n.data){var l=n.data;for(o=0;o<l.length;o++)He.isArray(l[o])?(Zp(l[o][0]),Zp(l[o][1])):Zp(l[o])}"gauge"===e.type?(jp(e,"axisLabel"),jp(e,"title"),jp(e,"detail")):"treemap"===e.type?(Wp(e.breadcrumb,"itemStyle"),He.each(e.levels,(function(e){Up(e)}))):"tree"===e.type&&Up(e.leaves)}}(e)}));var i=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];t&&i.push("valueAxis","categoryAxis","logAxis","timeAxis"),Vp(i,(function(t){Vp(Yp(e[t]),(function(e){e&&(jp(e,"axisLabel"),jp(e.axisPointer,"label"))}))})),Vp(Yp(e.parallel),(function(e){var t=e&&e.parallelAxisDefault;jp(t,"axisLabel"),jp(t&&t.axisPointer,"label")})),Vp(Yp(e.calendar),(function(e){Wp(e,"itemStyle"),jp(e,"dayLabel"),jp(e,"monthLabel"),jp(e,"yearLabel")})),Vp(Yp(e.radar),(function(e){jp(e,"name")})),Vp(Yp(e.geo),(function(e){Gp(e)&&(Zp(e),Vp(Yp(e.regions),(function(e){Zp(e)})))})),Vp(Yp(e.timeline),(function(e){Zp(e),Wp(e,"label"),Wp(e,"itemStyle"),Wp(e,"controlStyle",!0);var t=e.data;He.isArray(t)&&He.each(t,(function(e){He.isObject(e)&&(Wp(e,"label"),Wp(e,"itemStyle"))}))})),Vp(Yp(e.toolbox),(function(e){Wp(e,"iconStyle"),Vp(e.feature,(function(e){Wp(e,"iconStyle")}))})),jp(Xp(e.axisPointer),"label"),jp(Xp(e.tooltip).axisPointer,"label")},$p=He.each,Kp=He.isArray,Jp=He.isObject,Qp=zo.normalizeToArray;function ef(e){$p(tf,(function(t){t[0]in e&&!(t[1]in e)&&(e[t[1]]=e[t[0]])}))}var tf=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],nf=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"];var af=function(e,t){qp(e,t),e.series=Qp(e.series),$p(e.series,(function(e){if(Jp(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)}ef(e)}})),e.dataRange&&(e.visualMap=e.dataRange),$p(nf,(function(t){var i=e[t];i&&(Kp(i)||(i=[i]),$p(i,(function(e){ef(e)})))}))},rf=He.createHashMap,of=He.each;function sf(e){of(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 lf=function(e){var t=rf();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(sf)},uf=He.extend,hf=He.each,cf=He.isObject,df=zo.getDataItemValue,pf=zo.isDataItemOption,ff=Rc.parseDate,gf=_d.SOURCE_FORMAT_TYPED_ARRAY,mf=_d.SOURCE_FORMAT_ARRAY_ROWS,vf=_d.SOURCE_FORMAT_ORIGINAL,yf=_d.SOURCE_FORMAT_OBJECT_ROWS;function xf(e,t){Ld.isInstance(e)||(e=Ld.seriesDataToSource(e)),this._source=e;var i=this._data=e.data,n=e.sourceFormat;n===gf&&(this._offset=0,this._dimSize=t,this._data=i);var a=bf[n===mf?n+"_"+e.seriesLayoutBy:n];uf(this,a)}var _f=xf.prototype;_f.pure=!1,_f.persistent=!0,_f.getSource=function(){return this._source};var bf={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:Mf},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:wf,getItem:Sf,appendData:Mf},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;hf(e,(function(e,i){for(var n=t[i]||(t[i]=[]),a=0;a<(e||[]).length;a++)n.push(e[a])}))}},original:{count:wf,getItem:Sf,appendData:Mf},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 wf(){return this._data.length}function Sf(e){return this._data[e]}function Mf(e){for(var t=0;t<e.length;t++)this._data.push(e[t])}var If={arrayRows:Af,objectRows:function(e,t,i,n){return null!=i?e[n]:e},keyedColumns:Af,original:function(e,t,i,n){var a=df(e);return null!=i&&a instanceof Array?a[i]:a},typedArray:Af};function Af(e,t,i,n){return null!=i?e[i]:e}function Tf(e,t,i,n){return Cf(e[n],this._dimensionInfos[t])}function Cf(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=+ff(e)),null==e||""===e?NaN:+e}var Df=function(e,t,i){if(e){var n=e.getProvider().getSource().sourceFormat;if(n===vf||n===yf){var a=e.getRawDataItem(t);return n!==vf||cf(a)||(a=null),a?a[i]:void 0}}},Lf={DefaultDataProvider:xf,defaultDimValueGetters:{arrayRows:Tf,objectRows:function(e,t,i,n){return Cf(e[t],this._dimensionInfos[t])},keyedColumns:Tf,original:function(e,t,i,n){var a=e&&(null==e.value?e:e.value);return!this._rawData.pure&&pf(e)&&(this.hasItemOption=!0),Cf(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),If[o](n,t,r,a)}}},retrieveRawAttr:Df},Pf=Lf.retrieveRawValue,kf=Yc.getTooltipMarker,Of=Yc.formatTpl,Rf=zo.getTooltipRenderMode,Ef=/\{@(.+?)\}/g,Nf={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=Rf(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:kf({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?Of(l,s).replace(Ef,(function(t,i){var n=i.length;return"["===i.charAt(0)&&"]"===i.charAt(n-1)&&(i=+i.slice(1,n-1)),Pf(r,e,i)})):void 0},getRawValue:function(e,t){return Pf(this.getData(t),e)},formatTooltip:function(){}},zf=Nf,Bf=He.isArray;function Vf(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 Gf=Vf.prototype;Gf.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),Bf(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(Bf(f))for(var g=0;g<f.length;g++)Hf(this,f[g],d,p,l,u);else Hf(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 Ff=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 Hf(e,t,i,n,a,r){Ff.reset(i,n,a,r),e._callingProgress=t,e._callingProgress({start:i,end:n,count:n-i,next:Ff.next},e.context)}Gf.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},Gf.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},Gf.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},Gf.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},Gf.getUpstream=function(){return this._upstream},Gf.getDownstream=function(){return this._downstream},Gf.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e};var Wf={createTask:function(e){return new Vf(e)}},Uf=Yc.formatTime,jf=Yc.encodeHTML,Zf=Yc.addCommas,Yf=Yc.getTooltipMarker,Xf=od.getLayoutParams,qf=od.mergeLayoutParam,$f=Wf.createTask,Kf=ap.prepareSource,Jf=ap.getSource,Qf=Lf.retrieveRawValue,eg=zo.makeInner(),tg=dd.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=$f({count:ng,reset:ag}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,i),Kf(this);var a=this.getInitialData(e,i);og(a,this),this.dataTask.context.data=a,eg(this).dataBeforeProcessed=a,ig(this)},mergeDefaultAndTheme:function(e,t){var i=this.layoutMode,n=i?Xf(e):{},a=this.subType;dd.hasClass(a)&&(a+="Series"),He.merge(e,t.getTheme().get(this.subType)),He.merge(e,this.getDefaultOption()),zo.defaultEmphasis(e,"label",["show"]),this.fillDataTextStyle(e.data),i&&qf(e,n,i)},mergeOption:function(e,t){e=He.merge(this.option,e,!0),this.fillDataTextStyle(e.data);var i=this.layoutMode;i&&qf(this.option,e,i),Kf(this);var n=this.getInitialData(e,t);og(n,this),this.dataTask.dirty(),this.dataTask.context.data=n,eg(this).dataBeforeProcessed=n,ig(this)},fillDataTextStyle:function(e){if(e&&!He.isTypedArray(e))for(var t=["show"],i=0;i<e.length;i++)e[i]&&e[i].label&&zo.defaultEmphasis(e[i],"label",t)},getInitialData:function(){},appendData:function(e){this.getRawData().appendData(e.data)},getData:function(e){var t=lg(this);if(t){var i=t.context.data;return null==e?i:i.getLinkedData(e)}return eg(this).data},setData:function(e){var t=lg(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)}eg(this).data=e},getSource:function(){return Jf(this)},getRawData:function(){return eg(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:jf(Zf(e)),style:s}}var h=this.getData(),c=h.mapDimension("defaultedTooltip",!0),d=c.length,p=this.getRawValue(e),f=He.isArray(p),g=h.getItemVisual(e,"color");He.isObject(g)&&g.colorStops&&(g=(g.colorStops[0]||{}).color),g=g||"transparent";var m=d>1||f&&!d?function(i){var r=He.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=Yf({color:g,type:"subItem",renderMode:n,markerId:p}),m="string"==typeof f?f:f.content,v=(r?m+jf(c.displayName||"-")+": ":"")+jf("ordinal"===d?e+"":"time"===d?t?"":Uf("yyyy/MM/dd hh:mm:ss",e):Zf(e));v&&u.push(v),o&&(s[p]=g,++l)}}c.length?He.each(c,(function(t){d(Qf(h,e,t),t)})):He.each(i,d);var p=r?o?"\n":"<br/>":"",f=p+u.join(p||", ");return{renderMode:n,content:f,style:s}}(p):u(d?Qf(h,e,c[0]):f?p[0]:p),v=m.content,y=a.seriesIndex+"at"+l,x=Yf({color:g,type:"item",renderMode:n,markerId:y});s[y]=g,++l;var _=h.getName(e),b=this.name;zo.isNameSpecified(this)||(b=""),b=b?jf(b)+(t?": ":r):"";var w="string"==typeof x?x:x.content;return{html:t?w+b+v:b+w+(_?jf(_)+": "+v:v),markers:s}},isAnimationEnabled:function(){if(re.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=xd.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 ig(e){var t=e.name;zo.isNameSpecified(e)||(e.name=function(e){var t=e.getRawData(),i=t.mapDimension("seriesName",!0),n=[];return He.each(i,(function(e){var i=t.getDimensionInfo(e);i.displayName&&n.push(i.displayName)})),n.join(" ")}(e)||t)}function ng(e){return e.model.getRawData().count()}function ag(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),rg}function rg(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function og(e,t){He.each(e.CHANGABLE_METHODS,(function(i){e.wrapMethod(i,He.curry(sg,t))}))}function sg(e){var t=lg(e);t&&t.setOutputEnd(this.count())}function lg(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}}He.mixin(tg,zf),He.mixin(tg,xd);var ug=tg,hg=function(){this.group=new Nn,this.uid=wc.getUID("viewComponent")},cg=hg.prototype={constructor:hg,init:function(e,t){},render:function(e,t,i,n){},dispose:function(){},filterForExposedEvent:null};cg.updateView=cg.updateLayout=cg.updateVisual=function(e,t,i,n){},Zo.enableClassExtend(hg),Zo.enableClassManagement(hg,{registerWhenExtend:!0});var dg=hg,pg=zo.makeInner;var fg=function(){var e=pg();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"}},gg=He.each,mg=Wf.createTask,vg=zo.makeInner(),yg=fg();function xg(){this.group=new Nn,this.uid=wc.getUID("viewChart"),this.renderTask=mg({plan:Sg,reset:Mg}),this.renderTask.context={view:this}}xg.prototype={type:"chart",init:function(e,t){},render:function(e,t,i,n){},highlight:function(e,t,i,n){wg(e.getData(),n,"emphasis")},downplay:function(e,t,i,n){wg(e.getData(),n,"normal")},remove:function(e,t){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var _g=xg.prototype;function bg(e,t,i){if(e&&(e.trigger(t,i),e.isGroup&&!ac.isHighDownDispatcher(e)))for(var n=0,a=e.childCount();n<a;n++)bg(e.childAt(n),t,i)}function wg(e,t,i){var n=zo.queryDataIndex(e,t),a=t&&null!=t.highlightKey?ac.getHighlightDigit(t.highlightKey):null;null!=n?gg(zo.normalizeToArray(n),(function(t){bg(e.getItemGraphicEl(t),i,a)})):e.eachItemGraphicEl((function(e){bg(e,i,a)}))}function Sg(e){return yg(e.model)}function Mg(e){var t=e.model,i=e.ecModel,n=e.api,a=e.payload,r=t.pipelineContext.progressiveRender,o=e.view,s=a&&vg(a).updateMethod,l=r?"incrementalPrepareRender":s&&o[s]?s:"render";return"render"!==l&&o[l](t,i,n,a),Ig[l]}_g.updateView=_g.updateLayout=_g.updateVisual=function(e,t,i,n){this.render(e,t,i,n)},Zo.enableClassExtend(xg,["dispose"]),Zo.enableClassManagement(xg,{registerWhenExtend:!0}),xg.markUpdateMethod=function(e,t){vg(e).updateMethod=t};var Ig={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)}}},Ag=xg,Tg="\0__throttleOriginMethod",Cg="\0__throttleRate",Dg="\0__throttleType";function Lg(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 Pg={throttle:Lg,createOrUpdate:function(e,t,i,n){var a=e[t];if(a){var r=a[Tg]||a,o=a[Dg];if(a[Cg]!==i||o!==n){if(null==i||!n)return e[t]=r;(a=e[t]=Lg(r,i,"debounce"===n))[Tg]=r,a[Dg]=n,a[Cg]=i}return a}},clear:function(e,t){var i=e[t];i&&i[Tg]&&(e[t]=i[Tg])}},kg=He.isFunction,Og={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var i=e.getData(),n=(e.visualColorAccessPath||"itemStyle.color").split("."),a=e.get(n),r=!kg(a)||a instanceof Bu?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}}}},Rg=Og,Eg={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:""}}}},Ng=Lf.retrieveRawValue;var zg=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,Eg.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=Ng(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 He.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=Eg.aria,r=0;r<n.length;++r)a=a[n[r]];return a}return t}},Bg=Math.PI;var Vg=function(e,t){t=t||{},He.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 ac.Group,n=new ac.Rect({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});i.add(n);var a=t.fontSize+" sans-serif",r=new ac.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 ac.Arc({shape:{startAngle:-Bg/2,endAngle:-Bg/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*Bg/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:3*Bg/2}).delay(300).start("circularInOut"),i.add(o)}return i.resize=function(){var i=Za.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},Gg=He.each,Fg=He.map,Hg=He.isFunction,Wg=He.createHashMap,Ug=He.noop,jg=Wf.createTask,Zg=wc.getUID,Yg=zo.normalizeToArray;function Xg(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=Wg()}var qg=Xg.prototype;function $g(e,t,i,n,a){var r;function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}a=a||{},Gg(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(),Kg(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),Kg(s,n),r|=s.perform(u)}))}})),e.unfinished|=r}qg.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each((function(e){var t=e.overallTask;t&&t.dirty()}))},qg.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}}},qg.getPipeline=function(e){return this._pipelineMap.get(e)},qg.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}},qg.restorePipelines=function(e){var t=this,i=t._pipelineMap=Wg();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}),sm(t,e,e.dataTask)}))},qg.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.ecInstance.getModel(),i=this.api;Gg(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=Wg()),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,jg({plan:im,reset:nm,count:om}));s.context={model:i,ecModel:n,api:a,useClearVisual:t.isVisual&&!t.isLayout,plan:t.plan,reset:t.reset,scheduler:e},sm(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||jg({reset:Jg});r.context={ecModel:n,api:a,overallReset:t.overallReset,scheduler:e};var o=r.agentStubMap=r.agentStubMap||Wg(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;s?n.eachRawSeriesByType(s,c):l?l(n,a).each(c):(u=!1,Gg(n.getSeries(),c));function c(t){var i=t.uid,n=o.get(i);n||(n=o.set(i,jg({reset:Qg,onDirty:tm})),r.dirty()),n.context={model:t,overallProgress:u,modifyOutputEnd:h},n.agent=r,n.__block=u,sm(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)},qg.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,sm(this,t,a)},qg.performDataProcessorTasks=function(e,t){$g(this,this._dataProcessorHandlers,e,t,{block:!0})},qg.performVisualTasks=function(e,t,i){$g(this,this._visualHandlers,e,t,i)},qg.performSeriesTasks=function(e){var t;e.eachSeries((function(e){t|=e.dataTask.perform()})),this.unfinished|=t},qg.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 Kg=qg.updatePayload=function(e,t){"remain"!==t&&(e.context.payload=t)};function Jg(e){e.overallReset(e.ecModel,e.api,e.payload)}function Qg(e,t){return e.overallProgress&&em}function em(){this.agent.dirty(),this.getDownstream().dirty()}function tm(){this.agent&&this.agent.dirty()}function im(e){return e.plan&&e.plan(e.model,e.ecModel,e.api,e.payload)}function nm(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=Yg(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?Fg(t,(function(e,t){return rm(t)})):am}var am=rm(0);function rm(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 om(e){return e.data.count()}function sm(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 lm(e){um=null;try{e(hm,cm)}catch(e){}return um}Xg.wrapStageHandler=function(e,t){return Hg(e)&&(e={overallReset:e,seriesType:lm(e)}),e.uid=Zg("stageHandler"),t&&(e.visualType=t),e};var um,hm={},cm={};function dm(e,t){for(var i in t.prototype)e[i]=Ug}dm(hm,Mp),dm(cm,Ap),hm.eachSeriesByType=hm.eachRawSeriesByType=function(e){um=e},hm.eachComponent=function(e){"series"===e.mainType&&e.subType&&(um=e.subType)};var pm=Xg,fm=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],gm={color:fm,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],fm]},mm="#eee",vm=function(){return{axisLine:{lineStyle:{color:mm}},axisTick:{lineStyle:{color:mm}},axisLabel:{textStyle:{color:mm}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:mm}}}},ym=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],xm={color:ym,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:mm},crossStyle:{color:mm},label:{color:"#000"}}},legend:{textStyle:{color:mm}},textStyle:{color:mm},title:{textStyle:{color:mm}},toolbox:{iconStyle:{normal:{borderColor:mm}}},dataZoom:{textStyle:{color:mm}},visualMap:{textStyle:{color:mm}},timeline:{lineStyle:{color:mm},itemStyle:{normal:{color:ym[1]}},label:{normal:{textStyle:{color:mm}}},controlStyle:{normal:{color:mm,borderColor:mm}}},timeAxis:vm(),logAxis:vm(),valueAxis:vm(),categoryAxis:vm(),line:{symbol:"circle"},graph:{color:ym},gauge:{title:{textStyle:{color:mm}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};xm.categoryAxis.splitLine.show=!1;var _m=xm,bm=ap.detectSourceFormat,wm=_d.SERIES_LAYOUT_BY_COLUMN;dd.extend({type:"dataset",defaultOption:{seriesLayoutBy:wm,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){bm(this)}}),dg.extend({type:"dataset"});var Sm=Ml.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()}}),Mm=Sm,Im=Wl.createFromString,Am=He.isString,Tm=He.extend,Cm=He.defaults,Dm=He.trim,Lm=He.each,Pm=/[\s,]+/;function km(e){Am(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 Om(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}Om.prototype.parse=function(e,t){t=t||{};var i=km(e);if(!i)throw new Error("Illegal svg");var n=new Nn;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),Vm(i,n,null,!0);for(var s,l,u=i.firstChild;u;)this._parseNode(u,n),u=u.nextSibling;if(a){var h=Dm(a).split(Pm);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=Um(s,r,o),!t.ignoreViewBox)){var c=n;(n=new Nn).add(c),c.scale=l.scale.slice(),c.position=l.position.slice()}return t.ignoreRootClip||null==r||null==o||n.setClipPath(new bu({shape:{x:0,y:0,width:r,height:o}})),{root:n,width:r,height:o,viewBoxRect:s,viewBoxTransform:l}},Om.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=Em[a]){var r=n.call(this,e),o=e.getAttribute("id");o&&(this._defs[o]=r)}}else(n=Rm[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)},Om.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 Zl({style:{text:e.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});Nm(t,a),Vm(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 Rm={g:function(e,t){var i=new Nn;return Nm(t,i),Vm(e,i,this._defs),i},rect:function(e,t){var i=new bu;return Nm(t,i),Vm(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 Yl;return Nm(t,i),Vm(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 Mu;return Nm(t,i),Vm(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 Mm;return Nm(t,i),Vm(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=zm(i));var n=new du({shape:{points:i||[]}});return Nm(t,n),Vm(e,n,this._defs),n},polyline:function(e,t){var i=new Ml;Nm(t,i),Vm(e,i,this._defs);var n=e.getAttribute("points");return n&&(n=zm(n)),new pu({shape:{points:n||[]}})},image:function(e,t){var i=new Pr;return Nm(t,i),Vm(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 Nn;return Nm(t,o),Vm(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 Nn;return Nm(t,o),Vm(e,o,this._defs),this._textX+=a,this._textY+=r,o},path:function(e,t){var i=e.getAttribute("d")||"",n=Im(i);return Nm(t,n),Vm(e,n,this._defs),n}},Em={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 Gu(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 Nm(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||(t.__inheritedStyle={}),Cm(t.__inheritedStyle,e.__inheritedStyle))}function zm(e){for(var t=Dm(e).split(Pm),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 Bm={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 Vm(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(Hm,(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||oi.create(),s){case"translate":o=Dm(o).split(Pm),oi.translate(n,n,[parseFloat(o[0]),parseFloat(o[1]||0)]);break;case"scale":o=Dm(o).split(Pm),oi.scale(n,n,[parseFloat(o[0]),parseFloat(o[1]||o[0])]);break;case"rotate":o=Dm(o).split(Pm),oi.rotate(n,n,parseFloat(o[0]));break;case"skew":o=Dm(o).split(Pm),console.warn("Skew transform is not supported yet");break;case"matrix":o=Dm(o).split(Pm);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),Tm(a,function(e){var t=e.getAttribute("style"),i={};if(!t)return i;var n,a={};Wm.lastIndex=0;for(;null!=(n=Wm.exec(t));)a[n[1]]=n[2];for(var r in Bm)Bm.hasOwnProperty(r)&&null!=a[r]&&(i[Bm[r]]=a[r]);return i}(e)),!n))for(var o in Bm)if(Bm.hasOwnProperty(o)){var s=e.getAttribute(o);null!=s&&(a[Bm[o]]=s)}var l=r?"textFill":"fill",u=r?"textStroke":"stroke";t.style=t.style||new ra;var h=t.style;null!=a.fill&&h.set(l,Fm(a.fill,i)),null!=a.stroke&&h.set(u,Fm(a.stroke,i)),Lm(["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"),Lm(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],(function(e){null!=a[e]&&h.set(e,a[e])})),a.lineDash&&(t.style.lineDash=Dm(a.lineDash).split(Pm)),h[u]&&"none"!==h[u]&&(t[u]=!0),t.__inheritedStyle=a}var Gm=/url\(\s*#(.*?)\)/;function Fm(e,t){var i=t&&e&&e.match(Gm);return i?t[Dm(i[1])]:e}var Hm=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;var Wm=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Um(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 jm={parseXML:km,makeViewBoxTransform:Um,parseSVG:function(e,t){return(new Om).parse(e,t)}},Zm=He.createHashMap,Ym=He.isString,Xm=He.isArray,qm=He.each,$m=jm.parseXML,Km=Zm(),Jm={registerMap:function(e,t,i){var n;return Xm(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}]),qm(n,(function(e){var t=e.type;"geoJson"===t&&(t=e.type="geoJSON"),(0,Qm[t])(e)})),Km.set(e,n)},retrieveMap:function(e){return Km.get(e)}},Qm={geoJSON:function(e){var t=e.source;e.geoJSON=Ym(t)?"undefined"!=typeof JSON&&JSON.parse?JSON.parse(t):new Function("return ("+t+");")():t},svg:function(e){e.svgXML=$m(e.source)}},ev=Jm;function tv(e){return e}function iv(e,t,i,n,a){this._old=e,this._new=t,this._oldKeyGetter=i||tv,this._newKeyGetter=n||tv,this.context=a}function nv(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))}}iv.prototype={constructor:iv,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(nv(e,{},n,"_oldKeyGetter",this),nv(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 av=iv,rv=He.each,ov=He.createHashMap,sv=ov(["tooltip","label","itemName","itemId","seriesName"]);function lv(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}var uv={OTHER_DIMENSIONS:sv,summarizeDimensions:function(e){var t={},i=t.encode={},n=ov(),a=[],r=[],o=t.userOutput={dimensionNames:e.dimensions.slice(),encode:{}};rv(e.dimensions,(function(t){var s,l=e.getDimensionInfo(t),u=l.coordDim;if(u){var h=l.coordDimIndex;lv(i,u)[h]=t,l.isExtraCoord||(n.set(u,1),"ordinal"!==(s=l.type)&&"time"!==s&&(a[0]=t),lv(o.encode,u)[h]=l.index),l.defaultTooltip&&r.push(t)}sv.each((function(e,t){var n=lv(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 hv=function(e){null!=e&&He.extend(this,e),this.otherDims={}},cv=Lf.defaultDimValueGetters,dv=Lf.DefaultDataProvider,pv=uv.summarizeDimensions,fv=He.isObject,gv="undefined",mv={float:typeof Float64Array===gv?Array:Float64Array,int:typeof Int32Array===gv?Array:Int32Array,ordinal:Array,number:Array,time:Array},vv=typeof Uint32Array===gv?Array:Uint32Array,yv=typeof Int32Array===gv?Array:Int32Array,xv=typeof Uint16Array===gv?Array:Uint16Array;function _v(e){return e._rawCount>65535?vv:xv}var bv=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],wv=["_extent","_approximateExtent","_rawExtent"];function Sv(e,t){He.each(bv.concat(t.__wrappedMethods||[]),(function(i){t.hasOwnProperty(i)&&(e[i]=t[i])})),e.__wrappedMethods=t.__wrappedMethods,He.each(wv,(function(i){e[i]=He.clone(t[i])})),e._calculationInfo=He.extend(t._calculationInfo)}var Mv=function(e,t){e=e||["x","y"];for(var i={},n=[],a={},r=0;r<e.length;r++){var o=e[r];He.isString(o)?o=new hv({name:o}):o instanceof hv||(o=new hv(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=pv(this),this._invertedIndicesMap=a,this._calculationInfo={},this.userOutput=this._dimensionsSummary.userOutput},Iv=Mv.prototype;function Av(e,t,i,n,a){var r=mv[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 Tv(e){var t=e._invertedIndicesMap;He.each(t,(function(i,n){var a=e._dimensionInfos[n].ordinalMeta;if(a){i=t[n]=new yv(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 Cv(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 Dv(e){return e}function Lv(e){return e<this._count&&e>=0?this._indices[e]:-1}function Pv(e,t){var i=e._idList[t];return null==i&&(i=Cv(e,e._idDimIdx,t)),null==i&&(i="e\0\0"+t),i}function kv(e){return He.isArray(e)||(e=[e]),e}function Ov(e,t){var i=e.dimensions,n=new Mv(He.map(i,e.getDimensionInfo,e),e.hostModel);Sv(n,e);for(var a=n._storage={},r=e._storage,o=0;o<i.length;o++){var s=i[o];r[s]&&(He.indexOf(t,s)>=0?(a[s]=Rv(r[s]),n._rawExtent[s]=Ev(),n._extent[s]=null):a[s]=r[s])}return n}function Rv(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 Ev(){return[1/0,-1/0]}Iv.type="list",Iv.hasItemOption=!0,Iv.getDimension=function(e){return"number"!=typeof e&&(isNaN(e)||this._dimensionInfos.hasOwnProperty(e))||(e=this.dimensions[e]),e},Iv.getDimensionInfo=function(e){return this._dimensionInfos[this.getDimension(e)]},Iv.getDimensionsOnCoord=function(){return this._dimensionsSummary.dataDimsOnCoord.slice()},Iv.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]},Iv.initData=function(e,t,i){(Ld.isInstance(e)||He.isArrayLike(e))&&(e=new dv(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=cv[this._rawData.getSource().sourceFormat],this._dimValueGetter=i=i||this.defaultDimValueGetter,this._dimValueGetterArrayRows=cv.arrayRows,this._rawExtent={},this._initDataFromProvider(0,e.count()),e.pure&&(this.hasItemOption=!1)},Iv.getProvider=function(){return this._rawData},Iv.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)},Iv.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]=Ev()),n[v]||(n[v]=[]),Av(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={},Tv(this)},Iv._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]=Ev());var g=l[b];0===g.otherDims.itemName&&(i=this._nameDimIdx=f),0===g.otherDims.itemId&&(this._idDimIdx=f),r[b]||(r[b]=[]),Av(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 A=o[i],T=r[A][y];if(T){I=T[x];var C=l[A].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={},Tv(this)}},Iv.count=function(){return this._count},Iv.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=_v(this))(this.count());for(n=0;n<a.length;n++)a[n]=n}return a},Iv.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]},Iv.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]},Iv._getFast=function(e,t){var i=Math.floor(t/this._chunkSize),n=t%this._chunkSize;return this._storage[e][i][n]},Iv.getValues=function(e,t){var i=[];He.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},Iv.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},Iv.getDataExtent=function(e){e=this.getDimension(e);var t=this._storage[e],i=Ev();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},Iv.getApproximateExtent=function(e){return e=this.getDimension(e),this._approximateExtent[e]||this.getDataExtent(e)},Iv.setApproximateExtent=function(e,t){t=this.getDimension(t),this._approximateExtent[t]=e.slice()},Iv.getCalculationInfo=function(e){return this._calculationInfo[e]},Iv.setCalculationInfo=function(e,t){fv(e)?He.extend(this._calculationInfo,e):this._calculationInfo[e]=t},Iv.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},Iv.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},Iv.rawIndexOf=function(e,t){var i=(e&&this._invertedIndicesMap[e])[t];return null==i||isNaN(i)?-1:i},Iv.indexOfName=function(e){for(var t=0,i=this.count();t<i;t++)if(this.getName(t)===e)return t;return-1},Iv.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},Iv.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},Iv.getRawIndex=Dv,Iv.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},Iv.getName=function(e){var t=this.getRawIndex(e);return this._nameList[t]||Cv(this,this._nameDimIdx,t)||""},Iv.getId=function(e){return Pv(this,this.getRawIndex(e))},Iv.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=He.map(kv(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)}}},Iv.filterSelf=function(e,t,i,n){if(this._count){"function"==typeof e&&(n=i,i=t,t=e,e=[]),i=i||n||this,e=He.map(kv(e),this.getDimension,this);for(var a=this.count(),r=new(_v(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?Lv:Dv,this}},Iv.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(_v(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?Lv:Dv,this}}},Iv.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},Iv.map=function(e,t,i,n){i=i||n||this;var a=Ov(this,e=He.map(kv(e),this.getDimension,this));a._indices=this._indices,a.getRawIndex=a._indices?Lv:Dv;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},Iv.downSample=function(e,t,i,n){for(var a=Ov(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(_v(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=Lv,a},Iv.getItemModel=function(e){var t=this.hostModel;return new xc(this.getRawDataItem(e),t,t&&t.ecModel)},Iv.diff=function(e){var t=this;return new av(e?e.getIndices():[],this.getIndices(),(function(t){return Pv(e,t)}),(function(e){return Pv(t,e)}))},Iv.getVisual=function(e){var t=this._visual;return t&&t[e]},Iv.setVisual=function(e,t){if(fv(e))for(var i in e)e.hasOwnProperty(i)&&this.setVisual(i,e[i]);else this._visual=this._visual||{},this._visual[e]=t},Iv.setLayout=function(e,t){if(fv(e))for(var i in e)e.hasOwnProperty(i)&&this.setLayout(i,e[i]);else this._layout[e]=t},Iv.getLayout=function(e){return this._layout[e]},Iv.getItemLayout=function(e){return this._itemLayouts[e]},Iv.setItemLayout=function(e,t,i){this._itemLayouts[e]=i?He.extend(this._itemLayouts[e]||{},t):t},Iv.clearItemLayouts=function(){this._itemLayouts.length=0},Iv.getItemVisual=function(e,t,i){var n=this._itemVisuals[e],a=n&&n[t];return null!=a||i?a:this.getVisual(t)},Iv.setItemVisual=function(e,t,i){var n=this._itemVisuals[e]||{},a=this.hasItemVisual;if(this._itemVisuals[e]=n,fv(t))for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r],a[r]=!0);else n[t]=i,a[t]=!0},Iv.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var Nv=function(e){e.seriesIndex=this.seriesIndex,e.dataIndex=this.dataIndex,e.dataType=this.dataType};Iv.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(Nv,t)),this._graphicEls[e]=t},Iv.getItemGraphicEl=function(e){return this._graphicEls[e]},Iv.eachItemGraphicEl=function(e,t){He.each(this._graphicEls,(function(i,n){i&&e&&e.call(t,i,n)}))},Iv.cloneShallow=function(e){if(!e){var t=He.map(this.dimensions,this.getDimensionInfo,this);e=new Mv(t,this.hostModel)}if(e._storage=this._storage,Sv(e,this),this._indices){var i=this._indices.constructor;e._indices=new i(this._indices)}else e._indices=null;return e.getRawIndex=e._indices?Lv:Dv,e},Iv.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(He.slice(arguments)))})},Iv.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],Iv.CHANGABLE_METHODS=["filterSelf","selectRange"];var zv=Mv,Bv=He.createHashMap,Vv=He.each,Gv=He.isString,Fv=He.defaults,Hv=He.extend,Wv=He.isObject,Uv=He.clone,jv=zo.normalizeToArray,Zv=ap.guessOrdinal,Yv=ap.BE_ORDINAL,Xv=uv.OTHER_DIMENSIONS;function qv(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 $v=function(e,t,i){Ld.isInstance(t)||(t=Ld.seriesDataToSource(t)),i=i||{},e=(e||[]).slice();for(var n=(i.dimsDef||[]).slice(),a=Bv(),r=Bv(),o=[],s=function(e,t,i,n){var a=Math.max(e.dimensionsDetectCount||1,t.length,i.length,n||0);return Vv(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]=Hv({},Wv(n[l])?n[l]:{name:n[l]}),h=u.name,c=o[l]=new hv;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=Bv(d)).each((function(e,t){if(1===(e=jv(e).slice()).length&&!Gv(e[0])&&e[0]<0)d.set(t,!1);else{var i=d.set(t,[]);Vv(e,(function(e,n){Gv(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!=Xv.get(t)?e.otherDims[t]=i:(e.coordDim=t,e.coordDimIndex=i,r.set(t,!0))}Vv(e,(function(e,t){var i,n,a;if(Gv(e))i=e,e={};else{i=e.name;var r=e.ordinalMeta;e.ordinalMeta=null,(e=Uv(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=jv(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++)}Vv(s,(function(t,r){var s=o[t];if(f(Fv(s,e),i,r),null==s.name&&n){var l=n[r];!Wv(l)&&(l={name:l}),s.name=s.displayName=l.name,s.defaultTooltip=l.defaultTooltip}a&&Fv(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 hv).coordDim&&(c.coordDim=qv(y,r,v),c.coordDimIndex=0,(!g||m<=0)&&(c.isExtraCoord=!0),m--),null==c.name&&(c.name=qv(c.coordDim,a)),null!=c.type||Zv(t,x,c.name)!==Yv.Must&&(!c.isExtraCoord||null==c.otherDims.itemName&&null==c.otherDims.seriesName)||(c.type="ordinal")}return o},Kv=$v;var Jv=function(e,t){return Kv((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})},Qv=He.createHashMap,ey=He.each;function ty(e){this.coordSysName=e,this.coordSysDims=[],this.axisMap=Qv(),this.categoryAxisMap=Qv(),this.firstCategoryDimIndex=null}var iy={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),ny(a)&&(n.set("x",a),t.firstCategoryDimIndex=0),ny(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),ny(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),ny(r)&&(n.set("radius",r),t.firstCategoryDimIndex=0),ny(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();ey(r.parallelAxisIndex,(function(e,r){var s=a.getComponent("parallelAxis",e),l=o[r];i.set(l,s),ny(s)&&null==t.firstCategoryDimIndex&&(n.set(l,s),t.firstCategoryDimIndex=r)}))}};function ny(e){return"category"===e.get("type")}var ay={getCoordSysInfoBySeries:function(e){var t=e.get("coordinateSystem"),i=new ty(t),n=iy[t];if(n)return n(e,i,i.axisMap,i.categoryAxisMap),i}},ry=He.each,oy=He.isString;function sy(e,t){return!!t&&t===e.getCalculationInfo("stackedDimension")}var ly={enableDataStack:function(e,t,i){var n,a,r,o,s=(i=i||{}).byIndex,l=i.stackedCoordDimension,u=!(!e||!e.get("stack"));if(ry(t,(function(e,i){oy(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;ry(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:sy,getStackedDimension:function(e,t){return sy(e,t)?e.getCalculationInfo("stackResultDimension"):t}},uy=_d.SOURCE_FORMAT_ORIGINAL,hy=uv.getDimensionTypeByAxis,cy=zo.getDataItemValue,dy=ay.getCoordSysInfoBySeries,py=ly.enableDataStack,fy=ap.makeSeriesEncodeForAxisCoordSys;var gy=function(e,t,i){i=i||{},Ld.isInstance(e)||(e=Ld.seriesDataToSource(e));var n,a=t.get("coordinateSystem"),r=Dp.get(a),o=dy(t);o&&(n=He.map(o.coordSysDims,(function(e){var t={name:e},i=o.axisMap.get(e);if(i){var n=i.get("type");t.type=hy(n)}return t}))),n||(n=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||["x","y"]);var s,l,u=Jv(e,{coordDimensions:n,generateCoord:i.generateCoord,encodeDefaulter:i.useEncodeDefaulter?He.curry(fy,n,t):null});o&&He.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=py(t,u),c=new zv(u,t);c.setCalculationInfo(h);var d=null!=s&&function(e){if(e.sourceFormat===uy){var t=function(e){var t=0;for(;t<e.length&&null==e[t];)t++;return e[t]}(e.data||[]);return null!=t&&!He.isArray(cy(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},my=gy;function vy(e){this._setting=e||{},this._extent=[1/0,-1/0],this._interval=0,this.init&&this.init.apply(this,arguments)}vy.prototype.parse=function(e){return e},vy.prototype.getSetting=function(e){return this._setting[e]},vy.prototype.contain=function(e){var t=this._extent;return e>=t[0]&&e<=t[1]},vy.prototype.normalize=function(e){var t=this._extent;return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},vy.prototype.scale=function(e){var t=this._extent;return e*(t[1]-t[0])+t[0]},vy.prototype.unionExtent=function(e){var t=this._extent;e[0]<t[0]&&(t[0]=e[0]),e[1]>t[1]&&(t[1]=e[1])},vy.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},vy.prototype.getExtent=function(){return this._extent.slice()},vy.prototype.setExtent=function(e,t){var i=this._extent;isNaN(e)||(i[0]=e),isNaN(t)||(i[1]=t)},vy.prototype.isBlank=function(){return this._isBlank},vy.prototype.setBlank=function(e){this._isBlank=e},vy.prototype.getLabel=null,Zo.enableClassExtend(vy),Zo.enableClassManagement(vy,{registerWhenExtend:!0});var yy=vy,xy=He.createHashMap,_y=He.isObject,by=He.map;function wy(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this._map}wy.createByAxisModel=function(e){var t=e.option,i=t.data,n=i&&by(i,Iy);return new wy({categories:n,needCollect:!n,deduplication:!1!==t.dedplication})};var Sy=wy.prototype;function My(e){return e._map||(e._map=xy(e.categories))}function Iy(e){return _y(e)&&null!=e.value?e.value:e+""}Sy.getOrdinal=function(e){return My(this).get(e)},Sy.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=My(this);return null==(t=n.get(e))&&(i?(t=this.categories.length,this.categories[t]=e,n.set(e,t)):t=NaN),t};var Ay=wy,Ty=yy.prototype,Cy=yy.extend({type:"ordinal",init:function(e,t){e&&!He.isArray(e)||(e=new Ay({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),Ty.contain.call(this,e)&&null!=this._ordinalMeta.categories[e]},normalize:function(e){return Ty.normalize.call(this,this.parse(e))},scale:function(e){return Math.round(Ty.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:He.noop,niceExtent:He.noop});Cy.create=function(){return new Cy};var Dy=Cy,Ly=Rc.round;function Py(e){return Rc.getPrecisionSafe(e)+2}function ky(e,t,i){e[t]=Math.max(Math.min(e[t],i[1]),i[0])}function Oy(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),ky(e,0,t),ky(e,1,t),e[0]>e[1]&&(e[0]=e[1])}var Ry={intervalScaleNiceTicks:function(e,t,i,n){var a={},r=e[1]-e[0],o=a.interval=Rc.nice(r/t,!0);null!=i&&o<i&&(o=a.interval=i),null!=n&&o>n&&(o=a.interval=n);var s=a.intervalPrecision=Py(o);return Oy(a.niceTickExtent=[Ly(Math.ceil(e[0]/o)*o,s),Ly(Math.floor(e[1]/o)*o,s)],e),a},getIntervalPrecision:Py,fixExtent:Oy},Ey=Rc.round,Ny=yy.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]),Ny.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=Ry.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(Ey(n[0]-t,a)):r.push(i[0]));for(var o=n[0];o<=n[1]&&(r.push(o),(o=Ey(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(Ey(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=Rc.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=Rc.getPrecisionSafe(e)||0:"auto"===i&&(i=this._intervalPrecision),e=Ey(e,i,!0),Yc.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=Ry.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]=Ey(Math.floor(t[0]/a)*a)),e.fixMax||(t[1]=Ey(Math.ceil(t[1]/a)*a))}});Ny.create=function(){return new Ny};var zy=Ny,By=Rc.parsePercent,Vy=ly.isDimensionStacked,Gy="__ec_stack_",Fy="undefined"!=typeof Float32Array?Float32Array:Array;function Hy(e){return e.get("stack")||Gy+e.seriesIndex}function Wy(e){return e.dim+e.index}function Uy(e,t){var i=[];return t.eachSeriesByType(e,(function(e){qy(e)&&!$y(e)&&i.push(e)})),i}function jy(e){var t=function(e){var t={};He.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 He.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=By(e.get("barWidth"),n),p=By(e.get("barMaxWidth"),n),f=By(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:Wy(a),stackId:Hy(e)})})),Zy(i)}function Zy(e){var t={};He.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 He.each(t,(function(e,t){i[t]={};var n=e.stacks,a=e.bandWidth,r=By(e.categoryGap,a),o=By(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-r)/(l+(l-1)*o);u=Math.max(u,0),He.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;He.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;He.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 Yy(e,t,i){if(e&&t){var n=e[Wy(t)];return null!=n&&null!=i&&(n=n[Hy(i)]),n}}var Xy={seriesType:"bar",plan:fg(),reset:function(e){if(qy(e)&&$y(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=Yy(jy([e]),a,e).width;return h>.5||(h=.5),{progress:function(e,t){var c,d=e.count,p=new Fy(2*d),f=new Fy(2*d),g=new Fy(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:Ky(a,r),backgroundStart:l?n.x:n.y,valueAxisHorizontal:l})}}}}};function qy(e){return e.coordinateSystem&&"cartesian2d"===e.coordinateSystem.type}function $y(e){return e.pipelineContext&&e.pipelineContext.large}function Ky(e,t,i){return t.toGlobalCoord(t.dataToCoord("log"===t.type?1:0))}var Jy=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(He.defaults({bandWidth:a,axisKey:n,stackId:Gy+r},e));var o=Zy(t),s=[];for(r=0;r<e.count;r++){var l=o[n][Gy+r];l.offsetCenter=l.offset+l.width/2,s.push(l)}return s}},Qy=function(e,t){var i=Uy(e,t),n=jy(i),a={};He.each(i,(function(e){var t=e.getData(),i=e.coordinateSystem,r=i.getBaseAxis(),o=Hy(e),s=n[Wy(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=Vy(t,d),g=h.isHorizontal(),m=Ky(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),A=M>=0?"p":"n",T=m;if(f&&(a[o][I]||(a[o][I]={p:m,n:m}),T=a[o][I][A]),g)x=T,_=(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][A]+=b);else x=(S=i.dataToPoint([I,M]))[0]+l,_=T,b=u,w=S[1]-m,Math.abs(w)<c&&(w=(w<=0?-1:1)*c),isNaN(w)||f&&(a[o][I][A]+=w);t.setItemLayout(v,{x:x,y:_,width:b,height:w})}}),this)},ex={getLayoutOnAxis:Jy,prepareLayoutBarSeries:Uy,makeColumnLayout:jy,retrieveColumnLayout:Yy,layout:Qy,largeLayout:Xy},tx=zy.prototype,ix=Math.ceil,nx=Math.floor,ax=1e3,rx=6e4,ox=36e5,sx=864e5,lx=zy.extend({type:"time",getLabel:function(e){var t=this._stepLvl,i=new Date(e);return Yc.formatTime(t[0],i,this.getSetting("useUTC"))},niceExtent:function(e){var t=this._extent;if(t[0]===t[1]&&(t[0]-=sx,t[1]+=sx),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]-sx}this.niceTicks(e.splitNumber,e.minInterval,e.maxInterval);var n=this._interval;e.fixMin||(t[0]=Rc.round(nx(t[0]/n)*n)),e.fixMax||(t[1]=Rc.round(ix(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=ux.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}(ux,r,0,o),l=ux[Math.min(s,o-1)],u=l[1];if("year"===l[0]){var h=a/u;u*=Rc.nice(h/e,!0)}var c=this.getSetting("useUTC")?0:60*new Date(+n[0]||+n[1]).getTimezoneOffset()*1e3,d=[Math.round(ix((n[0]-c)/u)*u+c),Math.round(nx((n[1]-c)/u)*u+c)];Ry.fixExtent(d,n),this._stepLvl=l,this._interval=u,this._niceExtent=d},parse:function(e){return+Rc.parseDate(e)}});He.each(["contain","normalize"],(function(e){lx.prototype[e]=function(t){return tx[e].call(this,this.parse(t))}}));var ux=[["hh:mm:ss",ax],["hh:mm:ss",5e3],["hh:mm:ss",1e4],["hh:mm:ss",15e3],["hh:mm:ss",3e4],["hh:mm\nMM-dd",rx],["hh:mm\nMM-dd",3e5],["hh:mm\nMM-dd",6e5],["hh:mm\nMM-dd",9e5],["hh:mm\nMM-dd",18e5],["hh:mm\nMM-dd",ox],["hh:mm\nMM-dd",72e5],["hh:mm\nMM-dd",216e5],["hh:mm\nMM-dd",432e5],["MM-dd\nyyyy",sx],["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]];lx.create=function(e){return new lx({useUTC:e.ecModel.get("useUTC")})};var hx=yy.prototype,cx=zy.prototype,dx=Rc.getPrecisionSafe,px=Rc.round,fx=Math.floor,gx=Math.ceil,mx=Math.pow,vx=Math.log,yx=yy.extend({type:"log",base:10,$constructor:function(){yy.apply(this,arguments),this._originalScale=new zy},getTicks:function(e){var t=this._originalScale,i=this._extent,n=t.getExtent();return He.map(cx.getTicks.call(this,e),(function(e){var a=Rc.round(mx(this.base,e));return a=e===i[0]&&t.__fixMin?xx(a,n[0]):a,a=e===i[1]&&t.__fixMax?xx(a,n[1]):a}),this)},getMinorTicks:cx.getMinorTicks,getLabel:cx.getLabel,scale:function(e){return e=hx.scale.call(this,e),mx(this.base,e)},setExtent:function(e,t){var i=this.base;e=vx(e)/vx(i),t=vx(t)/vx(i),cx.setExtent.call(this,e,t)},getExtent:function(){var e=this.base,t=hx.getExtent.call(this);t[0]=mx(e,t[0]),t[1]=mx(e,t[1]);var i=this._originalScale,n=i.getExtent();return i.__fixMin&&(t[0]=xx(t[0],n[0])),i.__fixMax&&(t[1]=xx(t[1],n[1])),t},unionExtent:function(e){this._originalScale.unionExtent(e);var t=this.base;e[0]=vx(e[0])/vx(t),e[1]=vx(e[1])/vx(t),hx.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=Rc.quantity(i);for(e/i*n<=.5&&(n*=10);!isNaN(n)&&Math.abs(n)<1&&Math.abs(n)>0;)n*=10;var a=[Rc.round(gx(t[0]/n)*n),Rc.round(fx(t[1]/n)*n)];this._interval=n,this._niceExtent=a}},niceExtent:function(e){cx.niceExtent.call(this,e);var t=this._originalScale;t.__fixMin=e.fixMin,t.__fixMax=e.fixMax}});function xx(e,t){return px(e,dx(t))}He.each(["contain","normalize"],(function(e){yx.prototype[e]=function(t){return t=vx(t)/vx(this.base),hx[e].call(this,t)}})),yx.create=function(){return new yx};var _x=yx,bx=ex.prepareLayoutBarSeries,Sx=ex.makeColumnLayout,Mx=ex.retrieveColumnLayout;function Ix(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"),He.isArray(n)||(n=[n||0,n||0]),"boolean"==typeof n[0]&&(n=[0,0]),n[0]=Rc.parsePercent(n[0],1),n[1]=Rc.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(He.eqNaN(o)||He.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=bx("bar",c);if(He.each(p,(function(e){d|=e.getBaseAxis()===t.axis})),d){var f=Sx(p),g=function(e,t,i,n){var a=i.axis.getExtent(),r=a[1]-a[0],o=Mx(n,i.axis);if(void 0===o)return{min:e,max:t};var s=1/0;He.each(o,(function(e){s=Math.min(e.offset,s)}));var l=-1/0;He.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 Ax(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(Tx(e,t),a)}:function(t){return e.scale.getLabel(t)}}function Tx(e,t){return"category"===e.type?e.scale.getLabel(t):t}function Cx(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 Rn(n.x,n.y,o,s)}function Dx(e){var t=e.get("interval");return null==t?"auto":t}var Lx=function(e,t){var i=Ix(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)},Px=function(e,t){if(t=t||e.get("type"))switch(t){case"category":return new Dy(e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),[1/0,-1/0]);case"value":return new zy;default:return(yy.getClass(t)||zy).create(e)}},kx=function(e){var t=e.scale.getExtent(),i=t[0],n=t[1];return!(i>0&&n>0||i<0&&n<0)},Ox=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=Ax(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=Cx(l.getTextRect(d),l.get("rotate")||0);s?s.union(p):s=p}return s}},Rx={getScaleExtent:Ix,niceScaleExtent:Lx,createScaleByModel:Px,ifAxisCrossZero:kx,makeLabelFormatter:Ax,getAxisRawValue:Tx,estimateLabelUnionRect:Ox,getOptionCategoryInterval:Dx,shouldShowAllLabels:function(e){return"category"===e.type&&0===Dx(e.getLabelModel())}},Ex={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&&!He.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&&!He.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:He.noop,setRange:function(e,t){this.option.rangeStart=e,this.option.rangeEnd=t},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}},Nx=Ex,zx=Za.calculateTextPosition,Bx=ac.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()}}),Vx=ac.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()}}),Gx=ac.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()}}),Fx=ac.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()}}),Hx={line:ac.Line,rect:ac.Rect,roundRect:ac.Rect,square:ac.Rect,circle:ac.Circle,diamond:Vx,pin:Gx,arrow:Fx,triangle:Bx},Wx={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}},Ux={};He.each(Hx,(function(e,t){Ux[t]=new e}));var jx=ac.extendShape({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,i){var n=zx(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=Ux[n];a||(a=Ux[n="rect"]),Wx[n](t.x,t.y,t.width,t.height,a.shape),a.buildPath(e,a.shape,i)}}});function Zx(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 Yx=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://")?ac.makeImage(e.slice(8),new Rn(t,i,n,a),o?"center":"cover"):0===e.indexOf("path://")?ac.makePath(e.slice(7),{},new Rn(t,i,n,a),o?"center":"cover"):new jx({shape:{symbolType:e,x:t,y:i,width:n,height:a}})).__isEmptyBrush=l,s.setColor=Zx,s.setColor(r),s},Xx={createSymbol:Yx},qx=od.getLayoutRect,$x=ly.enableDataStack,Kx=ly.isDimensionStacked,Jx=ly.getStackedDimension;var Qx=function(e,t){var i=t;xc.isInstance(t)||(i=new xc(t),He.mixin(i,Nx));var n=Rx.createScaleByModel(i);return n.setExtent(e[0],e[1]),Rx.niceScaleExtent(n,i),n},e_=function(e){He.mixin(e,Nx)},t_={getLayoutRect:qx,completeDimensions:Kv,createDimensions:Jv,createSymbol:Xx.createSymbol,createList:function(e){return my(e.getSource(),e)},dataStack:{isDimensionStacked:Kx,enableDataStack:$x,getStackedDimension:Jx},createScale:Qx,mixinAxisModelCommonMethods:e_},i_=1e-8;function n_(e,t){return Math.abs(e-t)<i_}var a_=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+=ll(a[0],a[1],o[0],o[1],t,i),a=o}var s=e[0];return n_(a[0],s[0])&&n_(a[1],s[1])||(n+=ll(a[0],a[1],s[0],s[1],t,i)),0!==n},r_={contain:a_};function o_(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}o_.prototype={constructor:o_,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;zs.fromPoints(l,a,r),ct.min(i,i,a),ct.max(n,n,r)}return 0===s&&(i[0]=i[1]=n[0]=n[1]=0),this._rect=new Rn(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(r_.contain(r,e[0],e[1])){for(var s=0;s<(o?o.length:0);s++)if(r_.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 Rn(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++)ct.applyTransform(h[d],h[d],s);for(var p=0;p<(c?c.length:0);p++)for(d=0;d<c[p].length;d++)ct.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 o_(e,this.geometries,this.center);return t._rect=this._rect,t.transformTo=null,t}};var s_=o_;function l_(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 u_=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]=l_(l,o[s],t);else if("MultiPolygon"===a.type)for(var u=0;u<l.length;u++){var h=l[u];l[u]=l_(h,o[s][u],t)}}e.UTF8Encoding=!1}(e),He.map(He.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&&He.each(a,(function(e){e[0]&&r.push({type:"polygon",exterior:e[0],interiors:e.slice(1)})}));var o=new s_(i[t||"name"],r,i.cp);return o.properties=i,o}))},h_=zo.makeInner,c_=Rx.makeLabelFormatter,d_=Rx.getOptionCategoryInterval,p_=Rx.shouldShowAllLabels,f_=h_();function g_(e,t){var i,n,a=m_(e,"labels"),r=d_(t),o=v_(a,r);return o||(He.isFunction(r)?i=__(e,r):(n="auto"===r?function(e){var t=f_(e).autoInterval;return null!=t?t:f_(e).autoInterval=e.calculateCategoryInterval()}(e):r,i=x_(e,n)),y_(a,r,{labels:i,labelCategoryInterval:n}))}function m_(e,t){return f_(e)[t]||(f_(e)[t]=[])}function v_(e,t){for(var i=0;i<e.length;i++)if(e[i].key===t)return e[i].value}function y_(e,t,i){return e.push({key:t,value:i}),i}function x_(e,t,i){var n=c_(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=p_(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 __(e,t,i){var n=e.scale,a=c_(e),r=[];return He.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 b_={createAxisLabels:function(e){return"category"===e.type?function(e){var t=e.getLabelModel(),i=g_(e,t);return!t.get("show")||e.scale.isBlank()?{labels:[],labelCategoryInterval:i.labelCategoryInterval}:i}(e):function(e){var t=e.scale.getTicks(),i=c_(e);return{labels:He.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=m_(e,"ticks"),r=d_(t),o=v_(a,r);if(o)return o;t.get("show")&&!e.scale.isBlank()||(i=[]);if(He.isFunction(r))i=__(e,r,!0);else if("auto"===r){var s=g_(e,e.getLabelModel());n=s.labelCategoryInterval,i=He.map(s.labels,(function(e){return e.tickValue}))}else i=x_(e,n=r,!0);return y_(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=c_(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=Za.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))),_=f_(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}},w_=He.each,S_=He.map,M_=Rc.linearMap,I_=Rc.getPixelPrecision,A_=Rc.round,T_=b_.createAxisTicks,C_=b_.createAxisLabels,D_=b_.calculateCategoryInterval,L_=[0,1],P_=function(e,t,i){this.dim=e,this.scale=t,this._extent=i||[0,0],this.inverse=!1,this.onBand=!1};function k_(e,t){var i=(e[1]-e[0])/t/2;e[0]+=i,e[1]-=i}P_.prototype={constructor:P_,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 I_(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&&k_(i=i.slice(),n.count()),M_(e,L_,i,t)},coordToData:function(e,t){var i=this._extent,n=this.scale;this.onBand&&"ordinal"===n.type&&k_(i=i.slice(),n.count());var a=M_(e,i,L_,t);return this.scale.scale(a)},pointToData:function(e,t){},getTicksCoords:function(e){var t=(e=e||{}).tickModel||this.getTickModel(),i=T_(this,t).ticks,n=S_(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;w_(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=A_(e),t=A_(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 S_(t,(function(e){return S_(e,(function(e){return{coord:this.dataToCoord(e),tickValue:e}}),this)}),this)},getViewLabels:function(){return C_(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 D_(this)}};var O_=P_,R_=wo,E_=oi,N_=ct,z_=Yi,B_=Rc,V_=Yc,G_=Pg.throttle,F_=t_,H_=u_,W_=zv,U_=xc,j_=O_,Z_=re,Y_=u_,X_={};He.each(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],(function(e){X_[e]=He[e]}));var q_={};He.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){q_[e]=ac[e]}));var $_={zrender:R_,matrix:E_,vector:N_,color:z_,number:B_,format:V_,throttle:G_,helper:F_,parseGeoJSON:H_,List:W_,Model:U_,Axis:j_,env:Z_,parseGeoJson:Y_,util:X_,graphic:q_},K_=g((function(e,t){var i=Pg.throttle,n=He.assert,a=He.each,r=He.isFunction,o=He.isObject,s=dd.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(),yt.prototype[e].call(this,i,n,a)):this.id}}function p(){yt.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=wo.init(e,{renderer:n.renderer||"canvas",devicePixelRatio:n.devicePixelRatio,width:n.width,height:n.height});this._throttledZrFlush=i(He.bind(a.flush,a),17),(t=He.clone(t))&&af(t,!0),this._theme=t,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new Dp;var r,o,s=this._api=(o=(r=this)._coordSysMgr,He.extend(new Ap(r),{getCoordinateSystems:He.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}Un(z,l),Un(R,l),this._scheduler=new pm(this,s,R,z),yt.call(this,this._ecEventProcessor=new P),this._messageCenter=new p,this._initEvents(),this.resize=He.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),He.setAsPrimitive(this)}p.prototype.on=d("on",!0),p.prototype.off=d("off",!0),p.prototype.one=d("one",!0),He.mixin(p,yt);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=zo.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),T(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 Bp(this._api),r=this._theme,s=this._model=new Mp;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(re.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(re.svgSupported){var e=this._zr,t=e.storage.getDisplayList();return He.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(re.canvasSupported){var t="svg"===e.type,i=this.group,n=Math.min,r=Math.max,o=1/0;if(F[i]){var s=o,l=o,u=-1/0,h=-1/0,c=[],d=e&&e.pixelRatio||1;He.each(G,(function(a,o){if(a.group===i){var d=t?a.getZr().painter.getSvgDom().innerHTML:a.getRenderedCanvas(He.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=He.createCanvas(),m=wo.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 ac.Rect({shape:{x:0,y:0,width:p,height:f},style:{fill:e.connectedBackgroundColor}})),a(c,(function(e){var t=new ac.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=He.curry(m,"convertToPixel"),g.convertFromPixel=He.curry(m,"convertFromPixel"),g.containPixel=function(e,t){if(!this._disposed){var i,n=this._model;return e=zo.parseFinder(n,e),He.each(e,(function(e,n){n.indexOf("Models")>=0&&He.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=zo.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),A(this,t,i,e);var o=t.get("backgroundColor")||"transparent";if(re.canvasSupported)n.setBackgroundColor(o);else{var s=Yi.parse(o);o=Yi.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=He.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}),T(i,t,n,e,r),C(t,this._api)}},updateView:function(e){var t=this._model;t&&(Ag.markUpdateMethod(e,"updateView"),I(t),this._scheduler.performVisualTasks(t,e,{setDirty:!0}),A(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=He.createHashMap(zo.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=He.map(e.batch,(function(t){return(t=He.defaults(He.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))||He.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?dg.getClass(c.main,c.sub):Ag.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 A(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})),T(e,t,i,n),a(e._chartsViews,(function(e){e.__alive||e.remove(t,i)}))}function T(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")&&!re.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),zg(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=He.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&&re.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=He.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,zo.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 G[this.id]}},He.mixin(f,yt),P.prototype={constructor:P,normalizeQuery:function(e){var t={},i={},n={};if(He.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};He.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={},G={},F={},H=new Date-0,W=new Date-0,U="_echarts_instance_";function j(e){F[e]=!1}var Z=j;function Y(e){return G[zo.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=pm.wrapStageHandler(i,a);return s.__prio=t,s.__raw=i,e.push(s),s}function ee(e,t){V[e]=t}J(2e3,Rg),q(af),$(900,lf),ee("default",Vg),K({type:"highlight",event:"highlight",update:"highlight"},He.noop),K({type:"downplay",event:"downplay",update:"downplay"},He.noop),X("light",gm),X("dark",_m);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++,G[r.id]=r,zo.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(F[e.group]&&0!==e[t]){if(n&&n.escapeConnect)return;var r=e.makeActionFromEvent(n),o=[];a(G,(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(He.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 F[e]=!0,e},t.disConnect=j,t.disconnect=Z,t.dispose=function(e){"string"==typeof e?e=G[e]:e instanceof f||(e=Y(e)),e instanceof f&&!e.isDisposed()&&e.dispose()},t.getInstanceByDom=Y,t.getInstanceById=function(e){return G[e]},t.registerTheme=X,t.registerPreprocessor=q,t.registerProcessor=$,t.registerPostUpdate=function(e){N.push(e)},t.registerAction=K,t.registerCoordinateSystem=function(e,t){Dp.register(e,t)},t.getCoordinateSystemDimensions=function(e){var t=Dp.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 dd.extend(e)},t.extendComponentView=function(e){return dg.extend(e)},t.extendSeriesModel=function(e){return ug.extend(e)},t.extendChartView=function(e){return Ag.extend(e)},t.setCanvasCreator=function(e){He.$override("createCanvas",e)},t.registerMap=function(e,t,i){ev.registerMap(e,t,i)},t.getMap=function(e){var t=ev.retrieveMap(e);return t&&t[0]&&{geoJson:t[0].geoJSON,specialAreas:t[0].specialAreas}},t.dataTool={},function(){for(var e in $_)$_.hasOwnProperty(e)&&(t[e]=$_[e])}()}));ug.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(e,t){return my(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 J_=Lf.retrieveRawValue;var Q_=function(e,t){var i=e.mapDimension("defaultedLabel",!0),n=i.length;if(1===n)return J_(e,t,i[0]);if(n){for(var a=[],r=0;r<i.length;r++){var o=J_(e,t,i[r]);a.push(o)}return a.join(" ")}},eb={getDefaultLabel:Q_},tb=Xx.createSymbol,ib=Rc.parsePercent,nb=eb.getDefaultLabel;function ab(e,t,i){ac.Group.call(this),this.updateData(e,t,i)}var rb=ab.prototype,ob=ab.getSymbolSize=function(e,t){var i=e.getItemVisual(t,"symbolSize");return i instanceof Array?i.slice():[+i,+i]};function sb(e){return[e[0]/2,e[1]/2]}function lb(e,t){this.parent.drift(e,t)}rb._createSymbol=function(e,t,i,n,a){this.removeAll();var r=t.getItemVisual(i,"color"),o=tb(e,-1,-1,2,2,r,a);o.attr({z2:100,culling:!0,scale:sb(n)}),o.drift=lb,this._symbolType=e,this.add(o)},rb.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(e)},rb.getSymbolPath=function(){return this.childAt(0)},rb.getScale=function(){return this.childAt(0).scale},rb.highlight=function(){this.childAt(0).trigger("emphasis")},rb.downplay=function(){this.childAt(0).trigger("normal")},rb.setZ=function(e,t){var i=this.childAt(0);i.zlevel=e,i.z=t},rb.setDraggable=function(e){var t=this.childAt(0);t.draggable=e,t.cursor=e?"move":t.cursor},rb.updateData=function(e,t,i){this.silent=!1;var n=e.getItemVisual(t,"symbol")||"circle",a=e.hostModel,r=ob(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,ac.updateProps(l,{scale:sb(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),ac.initProps(l,h,a,t)}this._seriesModel=a};var ub=["itemStyle"],hb=["emphasis","itemStyle"],cb=["label"],db=["emphasis","label"];function pb(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")}rb._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(ub).getItemStyle(["color"]),l=f.getModel(hb).getItemStyle(),u=f.getShallow("symbolOffset"),h=f.getModel(cb),c=f.getModel(db),d=f.getShallow("hoverAnimation"),p=f.getShallow("cursor")}else l=He.extend({},l);var g=a.style,m=e.getItemVisual(t,"symbolRotate");a.attr("rotation",(m||0)*Math.PI/180||0),u&&a.attr("position",[ib(u[0],i[0]),ib(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;ac.setLabelStyle(g,l,h,c,{labelFetcher:r,labelDataIndex:t,defaultText:function(t,i){return _?e.getName(t):nb(e,t)},isRectText:!0,autoColor:o}),a.__symbolOriginalScale=sb(i),a.hoverStyle=l,a.highDownOnUpdate=d&&r.isAnimationEnabled()?pb:null,ac.setHoverStyle(a)},rb.fadeOut=function(e,t){var i=this.childAt(0);this.silent=i.silent=!0,(!t||!t.keepLabel)&&(i.style.text=null),ac.updateProps(i,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,e)},He.inherits(ab,ac.Group);var fb=ab,gb=He.isObject;function mb(e){this.group=new ac.Group,this._symbolCtor=e||fb}var vb=mb.prototype;function yb(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 xb(e){return null==e||gb(e)||(e={isIgnore:e}),e||{}}function _b(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")}}vb.updateData=function(e,t){t=xb(t);var i=this.group,n=e.hostModel,a=this._data,r=this._symbolCtor,o=_b(e);a||i.removeAll(),e.diff(a).add((function(n){var a=e.getItemLayout(n);if(yb(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);yb(e,h,s,t)?(u?(u.updateData(e,s,o),ac.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},vb.isPersistent=function(){return!0},vb.updateLayout=function(){var e=this._data;e&&e.eachItemGraphicEl((function(t,i){var n=e.getItemLayout(i);t.attr("position",n)}))},vb.incrementalPrepareUpdate=function(e){this._seriesScope=_b(e),this._data=null,this.group.removeAll()},vb.incrementalUpdate=function(e,t,i){function n(e){e.isGroup||(e.incremental=e.useHoverLayer=!0)}i=xb(i);for(var a=e.start;a<e.end;a++){var r=t.getItemLayout(a);if(yb(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)}}},vb.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 bb=mb,wb=ly.isDimensionStacked,Sb=He.map;var Mb={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=Sb(e.dimensions,(function(e){return t.mapDimension(e)})),p=t.getCalculationInfo("stackResultDimension");return(n|=wb(t,d[0]))&&(d[0]=p),(n|=wb(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)}},Ib=Mb.prepareDataCoordInfo,Ab=Mb.getStackedOnPoint;var Tb=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=Ib(a,t,o),v=Ib(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(Ab(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(Ab(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=[],A=[],T=[],C=[],D=[];for(y=0;y<f.length;y++){S=f[y];I[y]=u[S],A[y]=h[S],T[y]=c[S],C[y]=d[S],D[y]=p[S]}return{current:I,next:A,stackedOnCurrent:T,stackedOnNext:C,status:D}},Cb=ct.min,Db=ct.max,Lb=ct.scaleAndAdd,Pb=ct.copy,kb=[],Ob=[],Rb=[];function Eb(e){return isNaN(e[0])||isNaN(e[1])}function Nb(e,t,i,n,a,r,o,s,l,u,h){return"none"!==u&&u?zb.apply(this,arguments):Bb.apply(this,arguments)}function zb(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(Eb(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;Pb(Ob,g),Ob[m]=g[m]+v,Pb(Rb,f),Rb[m]=f[m]-v,e.bezierCurveTo(Ob[0],Ob[1],Rb[0],Rb[1],f[0],f[1])}else e.lineTo(f[0],f[1]);c=d,d+=r}return p}function Bb(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(Eb(f)){if(h){d+=r;continue}break}if(d===i)e[r>0?"moveTo":"lineTo"](f[0],f[1]),Pb(Ob,f);else if(l>0){var g=d+r,m=t[g];if(h)for(;m&&Eb(t[g]);)m=t[g+=r];var v=.5,y=t[c];if(!(m=t[g])||Eb(m))Pb(Rb,f);else{var x,_;if(Eb(m)&&!h&&(m=f),ct.sub(kb,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=ct.dist(f,y),_=ct.dist(f,m);Lb(Rb,f,kb,-l*(1-(v=_/(_+x))))}Cb(Ob,Ob,s),Db(Ob,Ob,o),Cb(Rb,Rb,s),Db(Rb,Rb,o),e.bezierCurveTo(Ob[0],Ob[1],Rb[0],Rb[1],f[0],f[1]),Lb(Ob,f,kb,l*v)}else e.lineTo(f[0],f[1]);c=d,d+=r}return p}function Vb(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 Gb=Ml.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:ql(Ml.prototype.brush),buildPath:function(e,t){var i=t.points,n=0,a=i.length,r=Vb(i,t.smoothConstraint);if(t.connectNulls){for(;a>0&&Eb(i[a-1]);a--);for(;n<a&&Eb(i[n]);n++);}for(;n<a;)n+=Nb(e,i,n,a,a,1,r.min,r.max,t.smooth,t.smoothMonotone,t.connectNulls)+1}}),Fb=Ml.extend({type:"ec-polygon",shape:{points:[],stackedOnPoints:[],smooth:0,stackedOnSmooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},brush:ql(Ml.prototype.brush),buildPath:function(e,t){var i=t.points,n=t.stackedOnPoints,a=0,r=i.length,o=t.smoothMonotone,s=Vb(i,t.smoothConstraint),l=Vb(n,t.smoothConstraint);if(t.connectNulls){for(;r>0&&Eb(i[r-1]);r--);for(;a<r&&Eb(i[a]);a++);}for(;a<r;){var u=Nb(e,i,a,r,r,1,s.min,s.max,t.smooth,o,t.connectNulls);Nb(e,n,a+u-1,u,r,-1,l.min,l.max,t.stackedOnSmooth,o,t.connectNulls),a+=u+1,e.closePath()}}}),Hb={Polyline:Gb,Polygon:Fb},Wb=Rc.round;function Ub(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 ac.Rect({shape:{x:r,y:o,width:s,height:l}});return t&&(h.shape[a?"width":"height"]=0,ac.initProps(h,{shape:{width:s,height:l}},i)),h}function jb(e,t,i){var n=e.getArea(),a=new ac.Sector({shape:{cx:Wb(e.cx,1),cy:Wb(e.cy,1),r0:Wb(n.r0,1),r:Wb(n.r,1),startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});return t&&(a.shape.endAngle=n.startAngle,ac.initProps(a,{shape:{endAngle:n.endAngle}},i)),a}var Zb={createGridClipPath:Ub,createPolarClipPath:jb,createClipPath:function(e,t,i){return e?"polar"===e.type?jb(e,t,i):"cartesian2d"===e.type?Ub(e,t,i):null:null}},Yb=zs.fromPoints,Xb=Hb.Polyline,qb=Hb.Polygon,$b=Mb.prepareDataCoordInfo,Kb=Mb.getStackedOnPoint,Jb=Zb.createGridClipPath,Qb=Zb.createPolarClipPath;function ew(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 tw(e,t){var i=[],n=[],a=[],r=[];return Yb(e,i,n),Yb(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 iw(e){return"number"==typeof e?e:e?.5:0}function nw(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 aw(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*fb.getSymbolSize(t,o)[e.isHorizontal()?1:0]>n)return!1;return!0}(r,t))){var o=t.mapDimension(r.dim),s={};return He.each(r.getViewLabels(),(function(e){s[e.tickValue]=1})),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function rw(e,t,i){if("cartesian2d"===e.type){var n=e.getBaseAxis().isHorizontal(),a=Jb(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 Qb(e,t,i)}Ag.extend({type:"line",init:function(){var e=new ac.Group,t=new bb;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(Kb(i,e,t,a));return n}(n,r,$b(n,r,v)),x=e.get("showSymbol"),_=x&&!u&&aw(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(rw(n,!1,e)),x&&c.updateData(r,{isIgnore:_,clipShape:w}),r.eachItemGraphicEl((function(e){e.stopAnimation(!0)})),ew(this._stackedOnPoints,y)&&ew(this._points,l)||(g?this._updateAnimation(r,y,n,i,S,v):(S&&(l=nw(l,n,S),y=nw(y,n,S)),d.setShape({points:l}),p&&p.setShape({points:l,stackedOnPoints:y})))):(x&&c.updateData(r,{isIgnore:_,clipShape:w}),S&&(l=nw(l,n,S),y=nw(y,n,S)),d=this._newPolyline(l,n,g),m&&(p=this._newPolygon(l,y,n,g)),f.setClipPath(rw(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=He.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";He.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 ac.LinearGradient(0,0,0,0,h,!0);return m[n]=p,m[n+"2"]=f,m}}}(r,n)||r.getVisual("color");d.useStyle(He.defaults(o.getLineStyle(),{fill:"none",stroke:M,lineJoin:"bevel"}));var I=e.get("smooth");if(I=iw(e.get("smooth")),d.setShape({smooth:I,smoothMonotone:e.get("smoothMonotone"),connectNulls:e.get("connectNulls")}),p){var A=r.getCalculationInfo("stackedOnSeries"),T=0;p.useStyle(He.defaults(s.getAreaStyle(),{fill:M,opacity:.7,lineJoin:"bevel"})),A&&(T=iw(A.get("smooth"))),p.setShape({smooth:I,stackedOnSmooth:T,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=zo.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 fb(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 Ag.prototype.highlight.call(this,e,t,i,n)},downplay:function(e,t,i,n){var a=e.getData(),r=zo.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 Ag.prototype.downplay.call(this,e,t,i,n)},_newPolyline:function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new Xb({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 qb({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=Tb(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=nw(u.current,i,a),c=nw(u.stackedOnCurrent,i,a),d=nw(u.next,i,a),p=nw(u.stackedOnNext,i,a)),tw(h,d)>3e3||s&&tw(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,ac.updateProps(o,{shape:{points:d}},l),s&&(s.setShape({points:h,stackedOnPoints:c}),ac.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 ow=He.isFunction;var sw=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=ow(o),c=ow(s),d=ow(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}}}},lw=He.map,uw=ly.isDimensionStacked;var hw=function(e){return{seriesType:e,plan:fg(),reset:function(e){var t=e.getData(),i=e.coordinateSystem,n=e.pipelineContext.large;if(i){var a=lw(i.dimensions,(function(e){return t.mapDimension(e)})).slice(0,2),r=a.length,o=t.getCalculationInfo("stackResultDimension");return uw(t,a[0])&&(a[0]=o),uw(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)}}}}}},cw={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]}},dw=function(e,t){return Math.round(e.length/2)};var pw=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=cw[a]:"function"==typeof a&&(o=a),o&&e.setData(n.downSample(n.mapDimension(l.dim),1/c,o,dw))}}}};function fw(e){return this._axes[e]}var gw=function(e){this._axes={},this._dimList=[],this.name=e||""};gw.prototype={constructor:gw,type:"cartesian",getAxis:function(e){return this._axes[e]},getAxes:function(){return He.map(this._dimList,fw,this)},getAxesByScale:function(e){return e=e.toLowerCase(),He.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 mw=gw;function vw(e){mw.call(this,e)}vw.prototype={constructor:vw,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 Rn(i,n,a,r)}},He.inherits(vw,mw);var yw=vw,xw=function(e,t,i,n,a){O_.call(this,e,t,i),this.type=n||"value",this.position=a||"bottom"};xw.prototype={constructor:xw,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},He.inherits(xw,O_);var _w=xw,bw={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)"]}}},ww={};ww.categoryAxis=He.merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},bw),ww.valueAxis=He.merge({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},bw),ww.timeAxis=He.defaults({scale:!0,min:"dataMin",max:"dataMax"},ww.valueAxis),ww.logAxis=He.defaults({scale:!0,logBase:10},ww.valueAxis);var Sw=ww,Mw=od.getLayoutParams,Iw=od.mergeLayoutParam,Aw=["value","category","time","log"];var Tw=function(e,t,i,n){He.each(Aw,(function(a){t.extend({type:e+"Axis."+a,mergeDefaultAndTheme:function(t,n){var r=this.layoutMode,o=r?Mw(t):{},s=n.getTheme();He.merge(t,s.get(a+"Axis")),He.merge(t,this.getDefaultOption()),t.type=i(e,t),r&&Iw(t,o,r)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=Ay.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:He.mergeAll([{},Sw[a+"Axis"],n],!0)})})),dd.registerSubTypeDefaulter(e+"Axis",He.curry(i,e))},Cw=dd.extend({type:"cartesian2dAxis",axis:null,init:function(){Cw.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){Cw.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){Cw.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function Dw(e,t){return t.type||(t.data?"category":"value")}He.merge(Cw.prototype,Nx);var Lw={offset:0};Tw("x",Cw,Dw,Lw),Tw("y",Cw,Dw,Lw),dd.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 Pw=He.isObject,kw=He.each,Ow=He.map,Rw=He.indexOf,Ew=od.getLayoutRect,Nw=Rx.createScaleByModel,zw=Rx.ifAxisCrossZero,Bw=Rx.niceScaleExtent,Vw=Rx.estimateLabelUnionRect,Gw=ly.getStackedDimension;function Fw(e,t,i){return e.getCoordSysModel()===t}function Hw(e,t,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(e,t,i),this.model=e}var Ww=Hw.prototype;function Uw(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)jw(r[l])&&(a=r[l]);else for(var u in r)if(r.hasOwnProperty(u)&&jw(r[u])&&!n[h(r[u])]){a=r[u];break}a&&(n[h(a)]=!0)}function h(e){return e.dim+"_"+e.index}}function jw(e){return e&&"category"!==e.type&&"time"!==e.type&&zw(e)}Ww.type="grid",Ww.axisPointerEnabled=!0,Ww.getRect=function(){return this._rect},Ww.update=function(e,t){var i=this._axesMap;this._updateScale(e,this.model),kw(i.x,(function(e){Bw(e.scale,e.model)})),kw(i.y,(function(e){Bw(e.scale,e.model)}));var n={};kw(i.x,(function(e){Uw(i,"y",e,n)})),kw(i.y,(function(e){Uw(i,"x",e,n)})),this.resize(this.model,t)},Ww.resize=function(e,t,i){var n=Ew(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()});this._rect=n;var a=this._axesList;function r(){kw(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")&&(kw(a,(function(e){if(!e.model.get("axisLabel.inside")){var t=Vw(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())},Ww.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]}},Ww.getAxes=function(){return this._axesList.slice()},Ww.getCartesian=function(e,t){if(null!=e&&null!=t){var i="x"+e+"y"+t;return this._coordsMap[i]}Pw(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]},Ww.getCartesians=function(){return this._coordsList.slice()},Ww.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},Ww.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},Ww._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,Rw(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}},Ww.containPoint=function(e){var t=this._coordsList[0];if(t)return t.containPoint(e)},Ww._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(Fw(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 _w(t,Nw(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,kw(a.x,(function(t,i){kw(a.y,(function(n,a){var r="x"+i+"y"+a,o=new yw(r);o.grid=this,o.model=e,this._coordsMap[r]=o,this._coordsList.push(o),o.addAxis(t),o.addAxis(n)}),this)}),this)},Ww._updateScale=function(e,t){function i(e,t,i){kw(e.mapDimension(t.dim,!0),(function(i){t.scale.unionExtentFromData(e,Gw(e,i))}))}kw(this._axesList,(function(e){e.scale.setExtent(1/0,-1/0)})),e.eachSeries((function(e){if(Xw(e)){var n=Yw(e),a=n[0],r=n[1];if(!Fw(a,t)||!Fw(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)},Ww.getTooltipAxes=function(e){var t=[],i=[];return kw(this.getCartesians(),(function(n){var a=null!=e&&"auto"!==e?n.getAxis(e):n.getBaseAxis(),r=n.getOtherAxis(a);Rw(t,a)<0&&t.push(a),Rw(i,r)<0&&i.push(r)})),{baseAxes:t,otherAxes:i}};var Zw=["xAxis","yAxis"];function Yw(e,t){return Ow(Zw,(function(t){return e.getReferringComponents(t)[0]}))}function Xw(e){return"cartesian2d"===e.get("coordinateSystem")}Hw.create=function(e,t){var i=[];return e.eachComponent("grid",(function(n,a){var r=new Hw(n,e,t);r.name="grid_"+a,r.resize(n,t,!0),n.coordinateSystem=r,i.push(r)})),e.eachSeries((function(e){if(Xw(e)){var t=Yw(e),i=t[0],n=t[1],a=i.getCoordSysModel().coordinateSystem;e.coordinateSystem=a.getCartesian(i.componentIndex,n.componentIndex)}})),i},Hw.dimensions=Hw.prototype.dimensions=yw.prototype.dimensions,Dp.register("cartesian2d",Hw);var qw=He.retrieve,$w=He.defaults,Kw=He.extend,Jw=He.each,Qw=Rc.isRadianAroundZero,eS=Rc.remRadian,tS=Xx.createSymbol,iS=ct.applyTransform,nS=Rx.shouldShowAllLabels,aS=Math.PI,rS=function(e,t){this.opt=t,this.axisModel=e,$w(t,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0}),this.group=new ac.Group;var i=new ac.Group({position:t.position.slice(),rotation:t.rotation});i.updateTransform(),this._transform=i.transform,this._dumbGroup=i};rS.prototype={constructor:rS,hasBuilder:function(e){return!!oS[e]},add:function(e){oS[e].call(this)},getGroup:function(){return this.group}};var oS={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&&(iS(a,a,n),iS(r,r,n));var o=Kw({lineCap:"round"},t.getModel("axisLine.lineStyle").getLineStyle());this.group.add(new ac.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];Jw([{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=tS(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=pS(n.getTicksCoords(),e._transform,o,$w(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=qw(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=(qw(i.labelRotate,r.get("rotate"))||0)*aS/180,u=lS(i.rotation,l,i.labelDirection),h=t.getCategories&&t.getCategories(!0),c=[],d=uS(t),p=t.get("triggerEvent");return Jw(s,(function(a,s){var l=a.tickValue,f=a.formattedLabel,g=a.rawLabel,m=r;h&&h[l]&&h[l].textStyle&&(m=new xc(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 ac.Text({anid:"label_"+l,position:y,rotation:u.rotation,silent:d,z2:10});ac.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=sS(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(nS(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?(hS(r),hS(u)):cS(r,o)&&(n?(hS(o),hS(h)):(hS(r),hS(u)));!1===a?(hS(s),hS(c)):cS(l,s)&&(a?(hS(l),hS(d)):(hS(s),hS(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=$w(o.getLineStyle(),$w(t.getModel("axisTick").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})),u=0;u<r.length;u++)for(var h=pS(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=qw(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,dS(r)?e.labelOffset+o*l:0],d=t.get("nameRotate");null!=d&&(d=d*aS/180),dS(r)?n=lS(e.rotation,null!=d?d:e.rotation,o):(n=function(e,t,i,n){var a,r,o=eS(i-e.rotation),s=n[0]>n[1],l="start"===t&&!s||"start"!==t&&s;Qw(o-aS/2)?(r=l?"bottom":"top",a="center"):Qw(o-1.5*aS)?(r=l?"top":"bottom",a="center"):(r="middle",a=o<1.5*aS&&o>aS/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=qw(e.nameTruncateMaxWidth,f.maxWidth,a),v=null!=g&&null!=m?Yc.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 ac.Text({anid:"name",__fullText:i,__truncatedText:v,position:c,rotation:n.rotation,silent:uS(t),z2:1,tooltip:y&&y.show?Kw({content:i,formatter:function(){return i},formatterParams:_},y):null});ac.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=sS(t),b.eventData.targetType="axisName",b.eventData.name=i),this._dumbGroup.add(b),b.updateTransform(),this.group.add(b),b.decomposeTransform()}}},sS=rS.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},lS=rS.innerTextLayout=function(e,t,i){var n,a,r=eS(t-e);return Qw(r)?(a=i>0?"top":"bottom",n="center"):Qw(r-aS)?(a=i>0?"bottom":"top",n="center"):(a="middle",n=r>0&&r<aS?i>0?"right":"left":i>0?"left":"right"),{rotation:r,textAlign:n,textVerticalAlign:a}};var uS=rS.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)};function hS(e){e&&(e.ignore=!0)}function cS(e,t,i){var n=e&&e.getBoundingRect().clone(),a=t&&t.getBoundingRect().clone();if(n&&a){var r=oi.identity([]);return oi.rotate(r,r,-e.rotation),n.applyTransform(oi.mul([],r,e.getLocalTransform())),a.applyTransform(oi.mul([],r,t.getLocalTransform())),n.intersect(a)}}function dS(e){return"middle"===e||"center"===e}function pS(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&&(iS(o,o,t),iS(s,s,t));var h=new ac.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 fS=rS,gS=He.each,mS=He.curry;function vS(e,t){return"all"===e||He.isArray(e)&&He.indexOf(e,t)>=0||e===t}function yS(e){var t=(e.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return t&&t.axesInfo[_S(e)]}function xS(e){return!!e.get("handle.show")}function _S(e){return e.type+"||"+e.id}var bS=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=[];gS(i.getCoordinateSystems(),(function(i){if(i.axisPointerEnabled){var s=_S(i.model),l=e.coordSysAxesInfo[s]={};e.coordSysMap[s]=i;var u=i.model.getModel("tooltip",n);if(gS(i.getAxes(),mS(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)&&gS(d.baseAxes,mS(p,!c||"cross",h)),c&&gS(d.otherAxes,mS(p,"cross",!1))}}function p(n,s,h){var c=h.model.getModel("axisPointer",a),d=c.get("show");if(d&&("auto"!==d||n||xS(c))){null==s&&(s=c.get("triggerTooltip")),c=n?function(e,t,i,n,a,r){var o=t.getModel("axisPointer"),s={};gS(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],(function(e){s[e]=He.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&&He.defaults(l,h.textStyle)}}return e.model.getModel("axisPointer",new xc(s,i,n))}(h,u,a,t,n,s):c;var p=c.get("snap"),f=_S(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:xS(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(vS(r[n+"AxisId"],i.id)||vS(r[n+"AxisIndex"],i.componentIndex)||vS(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)&&gS(e.coordSysAxesInfo[_S(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},wS=function(e){var t=yS(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=xS(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")}},SS={collect:bS,fixValue:wS,getAxisInfo:yS,getAxisPointerModel:function(e){var t=yS(e);return t&&t.axisPointerModel},makeKey:_S},MS=K_.extendComponentView({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(e,t,i,n){this.axisPointerClass&&SS.fixValue(e),MS.superApply(this,"render",arguments),IS(this,e,t,i,n,!0)},updateAxisPointer:function(e,t,i,n,a){IS(this,e,t,i,n,!1)},remove:function(e,t){var i=this._axisPointer;i&&i.remove(t),MS.superApply(this,"remove",arguments)},dispose:function(e,t){AS(this,t),MS.superApply(this,"dispose",arguments)}});function IS(e,t,i,n,a,r){var o=MS.getAxisPointerClass(e.axisPointerClass);if(o){var s=SS.getAxisPointerModel(t);s?(e._axisPointer||(e._axisPointer=new o)).render(t,s,n,r):AS(e,n)}}function AS(e,t,i){var n=e._axisPointer;n&&n.dispose(t,i),e._axisPointer=null}var TS=[];MS.registerAxisPointerClass=function(e,t){TS[e]=t},MS.getAxisPointerClass=function(e){return e&&TS[e]};var CS=MS;var DS=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),He.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},LS={layout:DS};var PS=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=He.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=He.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 ac.Rect({anid:null!=S?"area_"+S:null,shape:{x:y,y:x,width:_,height:b},style:He.defaults({fill:s[p]},v),silent:!0})),p=(p+1)%h}e.__splitAreaColors=d}}},kS={rectCoordAxisBuildSplitArea:PS,rectCoordAxisHandleRemove:function(e){e.__splitAreaColors=null}},OS=kS.rectCoordAxisBuildSplitArea,RS=kS.rectCoordAxisHandleRemove,ES=["axisLine","axisTickLabel","axisName"],NS=["splitArea","splitLine","minorSplitLine"],zS=CS.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(e,t,i,n){this.group.removeAll();var a=this._axisGroup;if(this._axisGroup=new ac.Group,this.group.add(this._axisGroup),e.get("show")){var r=e.getCoordSysModel(),o=LS.layout(r,e),s=new fS(e,o);He.each(ES,s.add,s),this._axisGroup.add(s.getGroup()),He.each(NS,(function(t){e.get(t+".show")&&this["_"+t](e,r)}),this),ac.groupTransition(a,this._axisGroup,e),zS.superCall(this,"render",e,t,i,n)}},remove:function(){RS(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=He.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 ac.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:He.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 ac.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){OS(this,this._axisGroup,e,t)}});zS.extend({type:"xAxis"}),zS.extend({type:"yAxis"}),K_.extendComponentView({type:"grid",render:function(e,t){this.group.removeAll(),e.get("show")&&this.group.add(new ac.Rect({shape:e.coordinateSystem.getRect(),style:He.defaults({fill:e.get("backgroundColor")},e.getItemStyle()),silent:!0,z2:-1}))}}),K_.registerPreprocessor((function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})),K_.registerVisual(sw("line","circle","line")),K_.registerLayout(hw("line")),K_.registerProcessor(K_.PRIORITY.PROCESSOR.STATISTIC,pw("line"));var BS=ug.extend({type:"series.__base_bar__",getInitialData:function(e,t){return my(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:{}}});BS.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 VS=eb.getDefaultLabel;function GS(e,t){"outside"===e.textPosition&&(e.textPosition=t)}var FS=function(e,t,i,n,a,r,o){var s=i.getModel("label"),l=i.getModel("emphasis.label");ac.setLabelStyle(e,t,s,l,{labelFetcher:a,labelDataIndex:r,defaultText:VS(a.getData(),r),isRectText:!0,autoColor:n}),GS(e),GS(t)},HS={setLabel:FS},WS=Yo([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),US={getBarItemStyle:function(e){var t=WS(this,e);if(this.getBorderLineDash){var i=this.getBorderLineDash();i&&(t.lineDash=i)}return t}},jS=US,ZS=(0,ac.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()}}),YS=HS.setLabel,XS=Pg.throttle,qS=Zb.createClipPath,$S=["itemStyle","barBorderWidth"],KS=[0,0];He.extend(xc.prototype,jS),K_.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=aM[s.type](r,t,i);if(p){var l=aM[s.type](r,t),v=function(e,t,i){var n="polar"===e.type?ac.Sector:ac.Rect;return new n({shape:hM(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(eM[s.type](c,o))return void a.remove(y);var y=tM[s.type](t,o,n,u,!1,d);r.setItemGraphicEl(t,y),a.add(y),oM(y,r,t,i,o,e,n,"polar"===s.type)}})).update((function(t,i){var l=r.getItemModel(t),y=aM[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 _=aM[s.type](r,t),b=hM(n,_,s);ac.updateProps(x,{shape:b},u,t)}var w=o.getItemGraphicEl(i);if(r.hasValue(t)){if(h)if(eM[s.type](c,y))return void a.remove(w);w?ac.updateProps(w,{shape:y},u,t):w=tM[s.type](t,y,n,u,!0,d),r.setItemGraphicEl(t,w),a.add(w),oM(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&&iM(e,u,t):t&&nM(e,u,t)})).execute();var y=this._backgroundGroup||(this._backgroundGroup=new Nn);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(),lM(e,this.group);var n=e.get("clip",!0)?qS(e.coordinateSystem,!1,e):null;n?this.group.setClipPath(n):this.group.removeClipPath()},_incrementalRenderLarge:function(e,t){this._removeBackground(),lM(t,this.group,!0)},dispose:He.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?nM(t.dataIndex,e,t):iM(t.dataIndex,e,t)}))):t.removeAll(),this._data=null},_removeBackground:function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null}});var JS=Math.max,QS=Math.min,eM={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=JS(t.x,e.x),r=QS(t.x+t.width,e.x+e.width),o=JS(t.y,e.y),s=QS(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}},tM={cartesian2d:function(e,t,i,n,a){var r=new ac.Rect({shape:He.extend({},t),z2:1});if(r.name="item",n){var o=i?"height":"width",s={};r.shape[o]=0,s[o]=t[o],ac[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?ZS:ac.Sector)({shape:He.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],ac[a?"updateProps":"initProps"](s,{shape:u},n,e)}return s}};function iM(e,t,i){i.style.text=null,ac.updateProps(i,{shape:{width:0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}function nM(e,t,i){i.style.text=null,ac.updateProps(i,{shape:{r:i.shape.r0}},t,e,(function(){i.parent&&i.parent.remove(i)}))}var aM={cartesian2d:function(e,t,i){var n=e.getItemLayout(t),a=i?function(e,t){var i=e.get($S)||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 rM(e){return null!=e.startAngle&&null!=e.endAngle&&e.startAngle===e.endAngle}function oM(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(He.defaults({stroke:rM(a)?"none":h,fill:rM(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||YS(e.style,d,n,l,r,i,f),rM(a)&&(d.fill=d.stroke="none"),ac.setHoverStyle(e,d)}var sM=Ml.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 lM(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 sM({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 sM({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",uM),d.on("mousemove",uM))}var uM=XS((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];KS[0]=t,KS[1]=i;for(var u=KS[n],h=KS[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 hM(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 cM=ex.layout,dM=ex.largeLayout;K_.registerLayout(K_.PRIORITY.VISUAL.LAYOUT,He.curry(cM,"bar")),K_.registerLayout(K_.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,dM),K_.registerVisual({seriesType:"bar",reset:function(e){e.getData().setVisual("legendSymbol","roundRect")}});var pM=He.extend,fM=He.isArray;var gM=function(e,t,i){t=fM(t)&&{coordDimensions:t}||pM({},t);var n=e.getSource(),a=Jv(n,t),r=new zv(a,e);return r.initData(n,i),r},mM={updateSelectedMap:function(e){this._targetList=He.isArray(e)?e.slice():[],this._selectTargetMap=He.reduce(e||[],(function(e,t){return e.set(t.name,t),e}),He.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 vM=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)}},yM=Rc.getPercentWithPrecision,xM=Lf.retrieveRawAttr,_M=ap.makeSeriesEncodeForNameBased,bM=K_.extendSeriesModel({type:"series.pie",init:function(e){bM.superApply(this,"init",arguments),this.legendVisualProvider=new vM(He.bind(this.getData,this),He.bind(this.getRawData,this)),this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(e)},mergeOption:function(e){bM.superCall(this,"mergeOption",e),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(e,t){return gM(this,{coordDimensions:["value"],encodeDefaulter:He.curry(_M,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:xM(e,n,"selected")});return i},getDataParams:function(e){var t=this.getData(),i=bM.superCall(this,"getDataParams",e),n=[];return t.each(t.mapDimension("value"),(function(e){n.push(e)})),i.percent=yM(n,e,t.hostModel.get("percentPrecision")),i.$vars.push("percent"),i},_defaultLabelLine:function(e){zo.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 wM(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){SM(a.getItemGraphicEl(e),a.getItemLayout(e),t.isSelected(a.getName(e)),s,i)}))}function SM(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 MM(e,t){ac.Group.call(this);var i=new ac.Sector({z2:2}),n=new ac.Polyline,a=new ac.Text;this.add(i),this.add(n),this.add(a),this.updateData(e,t,!0)}He.mixin(bM,mM);var IM=MM.prototype;IM.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=He.extend({},l);u.label=null;var h=o.getShallow("animationTypeUpdate");i?(n.setShape(u),"scale"===o.getShallow("animationType")?(n.shape.r=l.r0,ac.initProps(n,{shape:{r:l.r}},o,t)):(n.shape.endAngle=l.startAngle,ac.updateProps(n,{shape:{endAngle:l.endAngle}},o,t))):"expansion"===h?n.setShape(u):ac.updateProps(n,{shape:u},o,t);var c=e.getItemVisual(t,"color");n.useStyle(He.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),SM(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")))},ac.setHoverStyle(this)},IM._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?(ac.updateProps(n,{shape:u},r,t),ac.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");ac.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})}},He.inherits(MM,ac.Group),Ag.extend({type:"pie",init:function(){var e=new ac.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=He.curry(wM,this.uid,e,s,i),d=e.get("selectedMode");if(a.diff(r).add((function(e){var t=new MM(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=He.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 ac.Sector({shape:{cx:e,cy:t,r0:0,r:i,startAngle:n,endAngle:n,clockwise:a}});return(s?ac.initProps:ac.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 AM=function(e,t){He.each(t,(function(t){t.update="updateView",K_.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}}))}))},TM=He.createHashMap;var CM=function(e){return{getTargetSeries:function(t){var i={},n=TM();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)}}))}}},DM=Rc.parsePercent,LM=Math.PI/180;function PM(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 kM(e){return"center"===e.position}var OM=function(e,t,i,n,a,r){var o,s,l=e.getData(),u=[],h=!1,c=(e.get("minShowLabelAngle")||0)*LM;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=DM(p.get("margin"),i),y=p.get("bleedMargin"),x=p.getFont(),_=d.getModel("labelLine"),b=_.get("length");b=DM(b,i);var w=_.get("length2");if(w=DM(w,i),!(r.angle<c)){var S,M,I,A,T=(r.startAngle+r.endAngle)/2,C=Math.cos(T),D=Math.sin(T);o=r.cx,s=r.cy;var L,P=e.getFormattedLabel(n,"normal")||l.getName(n),k=Za.getBoundingRect(P,x,A,"top"),O="inside"===f||"inner"===f;if("center"===f)S=r.cx,M=r.cy,A="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]]}A=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?-T+Math.PI:-T:0,h=!!L,r.label={x:S,y:M,position:f,height:k.height,len:b,len2:w,linePoints:I,textAlign:A,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++)kM(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(PM(u,t,i,n,1,0,r,0,s,c),PM(l,t,i,n,-1,0,r,0,s,h),d=0;d<e.length;d++){var p=e[d];if(!kM(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=Za.truncateText(p.text,g,p.font),"edge"===p.labelAlignTo&&(v=Za.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)},RM=Rc.parsePercent,EM=Rc.linearMap,NM=2*Math.PI,zM=Math.PI/180;var BM=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.getData(),n=t.mapDimension("value"),a=function(e,t){return od.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}(e,i),r=e.get("center"),o=e.get("radius");He.isArray(o)||(o=[0,o]),He.isArray(r)||(r=[r,r]);var s=RM(a.width,i.getWidth()),l=RM(a.height,i.getHeight()),u=Math.min(s,l),h=RM(r[0],s)+a.x,c=RM(r[1],l)+a.y,d=RM(o[0],u/2),p=RM(o[1],u/2),f=-e.get("startAngle")*zM,g=e.get("minAngle")*zM,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=NM,M=0,I=f,A=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:NM/m)<g?(n=g,S-=g):M+=e;var r=I+A*n;t.setItemLayout(i,{angle:n,startAngle:I,endAngle:r,clockwise:x,cx:h,cy:c,r0:d,r:_?EM(e,w,[d,p]):p,viewRect:a}),I=r}})),S<NM&&m)if(S<=.001){var T=NM/m;t.each(n,(function(e,i){if(!isNaN(e)){var n=t.getItemLayout(i);n.angle=T,n.startAngle=f+A*i*T,n.endAngle=f+A*(i+1)*T}}))}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+A*a,I+=A*a}}));OM(e,p,a.width,a.height,a.x,a.y)}))};var VM=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}))}}}};AM("pie",[{type:"pieToggleSelect",event:"pieselectchanged",method:"toggleSelected"},{type:"pieSelect",event:"pieselected",method:"select"},{type:"pieUnSelect",event:"pieunselected",method:"unSelect"}]),K_.registerVisual(CM("pie")),K_.registerLayout(He.curry(BM,"pie")),K_.registerProcessor(VM("pie")),ug.extend({type:"series.scatter",dependencies:["grid","polar","geo","singleAxis","calendar"],getInitialData:function(e,t){return my(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 GM=Xx.createSymbol,FM=ac.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 HM(){this.group=new ac.Group}var WM=HM.prototype;WM.isPersistent=function(){return!this._incremental},WM.updateData=function(e,t){this.group.removeAll();var i=new FM({rectHover:!0,cursor:"default"});i.setShape({points:e.getLayout("symbolPoints")}),this._setCommon(i,e,!1,t),this.group.add(i),this._incremental=null},WM.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)}))}},WM.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>2e6?(this._incremental||(this._incremental=new Zu({silent:!0})),this.group.add(this._incremental)):this._incremental=null},WM.incrementalUpdate=function(e,t,i){var n;this._incremental?(n=new FM,this._incremental.addDisplayable(n,!0)):((n=new FM({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)},WM._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=GM(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))})))},WM.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},WM._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var UM=HM;function jM(e,t,i){O_.call(this,e,t,i),this.type="value",this.angle=0,this.name="",this.model}K_.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=hw().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 UM:new bb,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(){}}),K_.registerVisual(sw("scatter","circle")),K_.registerLayout(hw("scatter")),He.inherits(jM,O_);var ZM=jM,YM=Rx.getScaleExtent,XM=Rx.niceScaleExtent;function qM(e,t,i){this._model=e,this.dimensions=[],this._indicatorAxes=He.map(e.getIndicatorModels(),(function(e,t){var i="indicator_"+t,n=new ZM(i,"log"===e.get("axisType")?new _x:new zy);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}qM.prototype.getIndicatorAxes=function(){return this._indicatorAxes},qM.prototype.dataToPoint=function(e,t){var i=this._indicatorAxes[t];return this.coordToPoint(i.dataToCoord(e),t)},qM.prototype.coordToPoint=function(e,t){var i=this._indicatorAxes[t].angle;return[this.cx+e*Math.cos(i),this.cy-e*Math.sin(i)]},qM.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))]},qM.prototype.resize=function(e,t){var i=e.get("center"),n=t.getWidth(),a=t.getHeight(),r=Math.min(n,a)/2;this.cx=Rc.parsePercent(i[0],n),this.cy=Rc.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=Rc.parsePercent(o[0],r),this.r=Rc.parsePercent(o[1],r),He.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)},qM.prototype.update=function(e,t){var i=this._indicatorAxes,n=this._model;He.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();He.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}He.each(i,(function(e,t){var i=YM(e.scale,e.model).extent;XM(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=Rc.round(h-u*a);o.setExtent(c,h),o.setInterval(u)}}))},qM.dimensions=[],qM.create=function(e,t){var i=[];return e.eachComponent("radar",(function(n){var a=new qM(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},Dp.register("radar",qM);var $M=Sw.valueAxis;function KM(e,t){return He.defaults({show:t},e)}K_.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=He.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=He.defaults({color:d.color},s)),d=He.merge(He.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=He.extend(new xc(d,null,this.ecModel),Nx);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:He.merge({lineStyle:{color:"#bbb"}},$M.axisLine),axisLabel:KM($M.axisLabel,!1),axisTick:KM($M.axisTick,!1),axisType:"interval",splitLine:KM($M.splitLine,!0),splitArea:KM($M.splitArea,!0),indicator:[]}});var JM=["axisLine","axisTickLabel","axisName"];K_.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=He.map(i,(function(e){return new fS(e.model,{position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}));He.each(n,(function(e){He.each(JM,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=He.isArray(h)?h:[h],c=He.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 ac.Circle({shape:{cx:g,cy:m,r:f[v].coord}}));if(u&&v<f.length-1)p[I(p,c,v)].push(new ac.Ring({shape:{cx:g,cy:m,r0:f[v].coord,r:f[v+1].coord}}))}else{var y,x=He.map(i,(function(e,i){var n=e.getTicksCoords();return y=null==y?n.length-1:Math.min(n.length-1,y),He.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 ac.Polyline({shape:{points:b}}));if(u&&_)p[I(p,c,v-1)].push(new ac.Polygon({shape:{points:b.concat(_)}}));_=b.slice().reverse()}}var S=o.getLineStyle(),M=s.getAreaStyle();He.each(p,(function(e,t){this.group.add(ac.mergePath(e,{style:He.defaults({stroke:"none",fill:c[t%c.length]},M),silent:!0}))}),this),He.each(d,(function(e,t){this.group.add(ac.mergePath(e,{style:He.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 QM=Yc.encodeHTML,eI=ug.extend({type:"series.radar",dependencies:["radar"],init:function(e){eI.superApply(this,"init",arguments),this.legendVisualProvider=new vM(He.bind(this.getData,this),He.bind(this.getRawData,this))},getInitialData:function(e,t){return gM(this,{generateCoord:"indicator_",generateCoordCount:1/0})},formatTooltip:function(e){var t=this.getData(),i=this.coordinateSystem.getIndicatorAxes(),n=this.getData().getName(e);return QM(""===n?this.name:n)+"<br/>"+He.map(i,(function(i,n){var a=t.get(t.mapDimension(i.dim),e);return QM(i.name+" : "+a)})).join("<br />")},getTooltipPosition:function(e){if(null!=e)for(var t=this.getData(),i=this.coordinateSystem,n=t.getValues(He.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 tI(e){return!isNaN(e[0])&&!isNaN(e[1])}function iI(e){return[e.cx,e.cy]}K_.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 He.isArray(e)||(e=[+e,+e]),e}(e.getItemVisual(t,"symbolSize")),r=Xx.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]),ac[o?"initProps":"updateProps"](u,{position:i[l]},e,r)):u.attr("position",i[l]),n.add(u))}}function u(e){return He.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 ac.Polygon,a=new ac.Polyline,o={shape:{points:i}};n.shape.points=u(i),a.shape.points=u(i),ac.initProps(n,o,e,t),ac.initProps(a,o,e,t);var s=new ac.Group,h=new ac.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),ac.updateProps(a,h,e),ac.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(He.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(He.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=He.clone(f);var i=r.get(r.dimensions[e.__dimIdx],t);(null==i||isNaN(i))&&(i=""),ac.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)},ac.setHoverStyle(e)})),this._data=r},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}});var nI=function(e){e.eachSeriesByType("radar",(function(e){var t=e.getData(),i=[],n=e.coordinateSystem;if(n){var a=n.getIndicatorAxes();He.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]=tI(a)?a:iI(n)}))})),t.each((function(e){var a=He.find(i[e],(function(e){return tI(e)}))||iI(n);i[e].push(a.slice()),t.setItemLayout(e,i[e])}))}}))};var aI=function(e){var t=e.polar;if(t){He.isArray(t)||(t=[t]);var i=[];He.each(t,(function(t,n){t.indicator?(t.type&&!t.shape&&(t.shape=t.type),e.radar=e.radar||[],He.isArray(e.radar)||(e.radar=[e.radar]),e.radar.push(t)):i.push(t)})),e.polar=i}He.each(e.series,(function(e){e&&"radar"===e.type&&e.polarIndex&&(e.radarIndex=e.polarIndex)}))};K_.registerVisual(CM("radar")),K_.registerVisual(sw("radar","circle")),K_.registerLayout(nI),K_.registerProcessor(VM("radar")),K_.registerPreprocessor(aI);for(var rI=[126,25],oI=[[[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]]],sI=0;sI<oI.length;sI++)for(var lI=0;lI<oI[sI].length;lI++)oI[sI][lI][0]/=10.5,oI[sI][lI][1]/=-14,oI[sI][lI][0]+=rI[0],oI[sI][lI][1]+=rI[1];var uI=function(e,t){"china"===e&&t.push(new s_("南海诸岛",He.map(oI,(function(e){return{type:"polygon",exterior:e}})),rI))},hI={"南海诸岛":[32,80],"广东":[0,-10],"香港":[10,5],"澳门":[-10,10],"天津":[5,5]};var cI=function(e,t){if("china"===e){var i=hI[t.name];if(i){var n=t.center;n[0]+=i[0]/10.5,n[1]+=-i[1]/14}}},dI={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};var pI=function(e,t){if("world"===e){var i=dI[t.name];if(i){var n=t.center;n[0]=i[0],n[1]=i[1]}}},fI=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];var gI=function(e,t){"china"===e&&"台湾"===t.name&&t.geometries.push({type:"polygon",exterior:fI[0]})},mI=He.each,vI=(0,zo.makeInner)();function yI(e){for(var t,i=0;i<e.length;i++){var n=e[i].getBoundingRect();(t=t||n.clone()).union(n)}return t}var xI={load:function(e,t,i){var n=vI(t).parsed;if(n)return n;var a,r=t.specialAreas||{},o=t.geoJSON;try{a=o?u_(o,i):[]}catch(e){throw new Error("Invalid geoJson format\n"+e.message)}return uI(e,a),mI(a,(function(t){var i=t.name;cI(e,t),pI(e,t),gI(e,t);var n=r[i];n&&t.transformTo(n.left,n.top,n.width,n.height)})),vI(t).parsed={regions:a,boundingRect:yI(a)}}},_I=jm.parseSVG,bI=jm.makeViewBoxTransform,wI=He.assert,SI=He.createHashMap,MI=(0,zo.makeInner)(),II={load:function(e,t){var i=MI(t).originRoot;if(i)return{root:i,boundingRect:MI(t).boundingRect};var n=AI(t);return MI(t).originRoot=n.root,MI(t).boundingRect=n.boundingRect,n},makeGraphic:function(e,t,i){var n=MI(t),a=n.rootMap||(n.rootMap=SI()),r=a.get(i);if(r)return r;var o=n.originRoot,s=n.boundingRect;return n.originRootHostKey?r=AI(t,s).root:(n.originRootHostKey=i,r=o),a.set(i,r)},removeGraphic:function(e,t,i){var n=MI(t),a=n.rootMap;a&&a.removeKey(i),i===n.originRootHostKey&&(n.originRootHostKey=null)}};function AI(e,t){var i,n,a=e.svgXML;try{n=(i=a&&_I(a,{ignoreViewBox:!0,ignoreRootClip:!0})||{}).root,wI(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 Rn(0,0,0,0),null!=r&&(t.width=r),null!=o&&(t.height=o)),s){var l=bI(s,t.width,t.height),u=n;(n=new Nn).add(u),u.scale=l.scale,u.position=l.position}return n.setClipPath(new bu({shape:t.plain()})),{root:n,boundingRect:t}}var TI=II,CI=He.each,DI=He.createHashMap,LI={geoJSON:xI,svg:TI};function PI(e){return function(t,i){var n=kI(t),a=[];return CI(n,(function(n){var r=LI[n.type][e];r&&a.push(r(t,n,i))})),a}}function kI(e){return ev.retrieveMap(e)||[]}var OI={load:function(e,t,i){var n,a=[],r=DI(),o=DI(),s=kI(e);return CI(s,(function(s){var l=LI[s.type].load(e,s,i);CI(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 Rn(0,0,0,0)}},makeGraphic:PI("makeGraphic"),removeGraphic:PI("removeGraphic")},RI=Yc.encodeHTML,EI=Yc.addCommas,NI=Lf.retrieveRawAttr,zI=ap.makeSeriesEncodeForNameBased,BI=ug.extend({type:"series.map",dependencies:["geo"],layoutMode:"box",needsDrawMap:!1,seriesGroup:[],getInitialData:function(e){for(var t=gM(this,{coordDimensions:["value"],encodeDefaulter:He.curry(zI,this)}),i=t.mapDimension("value"),n=He.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:NI(t,o,"selected")})}var u=OI.load(this.getMapType(),this.option.nameMap,this.option.nameProperty);return He.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=EI(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(RI(a[o].name))}return r.join(", ")+"<br />"+RI(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"}});He.mixin(BI,mM);var VI="\0_ec_interaction_mutex";function GI(e){return e[VI]||(e[VI]={})}K_.registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},(function(){}));var FI={take:function(e,t,i){GI(e)[t]=i},release:function(e,t,i){var n=GI(e);n[t]===i&&(n[t]=null)},isTaken:function(e,t){return!!GI(e)[t]}};function HI(e){this.pointerChecker,this._zr=e,this._opt={};var t=He.bind,i=t(WI,this),n=t(UI,this),a=t(jI,this),r=t(ZI,this),o=t(YI,this);yt.call(this),this.setPointerChecker=function(e){this.pointerChecker=e},this.enable=function(t,s){this.disable(),this._opt=He.defaults(He.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 WI(e){if(!(Bt.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 UI(e){if(this._dragging&&$I("moveOnMouseMove",e,this._opt)&&"pinch"!==e.gestureEvent&&!FI.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&&Bt.stop(e.event),qI(this,"pan","moveOnMouseMove",e,{dx:r,dy:o,oldX:n,oldY:a,newX:t,newY:i})}}function jI(e){Bt.isMiddleOrRightButtonOnMouseUpDown(e)||(this._dragging=!1)}function ZI(e){var t=$I("zoomOnMouseWheel",e,this._opt),i=$I("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;XI(this,"zoom","zoomOnMouseWheel",e,{scale:n>0?s:1/s,originX:r,originY:o})}if(i){var l=Math.abs(n);XI(this,"scrollMove","moveOnMouseWheel",e,{scrollDelta:(n>0?1:-1)*(l>3?.4:l>1?.15:.05),originX:r,originY:o})}}}function YI(e){FI.isTaken(this._zr,"globalPan")||XI(this,"zoom",null,e,{scale:e.pinchScale>1?1.1:1/1.1,originX:e.pinchX,originY:e.pinchY})}function XI(e,t,i,n,a){e.pointerChecker&&e.pointerChecker(n,a.originX,a.originY)&&(Bt.stop(n.event),qI(e,t,i,n,a))}function qI(e,t,i,n,a){a.isAvailableBehavior=He.bind($I,null,i,n),e.trigger(t,a)}function $I(e,t,i){var n=i[e];return!e||n&&(!He.isString(n)||t.event[n+"Key"])}He.mixin(HI,yt);var KI=HI;var JI=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()},QI={updateViewOnPan:function(e,t,i){var n=e.target,a=n.position;a[0]+=t,a[1]+=i,n.dirty()},updateViewOnZoom:JI},eA={axisPointer:1,tooltip:1,brush:1};var tA=function(e,t,i){var n=t.getComponentByElement(e.topTarget),a=n&&n.coordinateSystem;return n&&n!==i&&!eA[n.mainType]&&a&&a.model!==i},iA={onIrrelevantElement:tA},nA=iA.onIrrelevantElement,aA=wc.getUID;function rA(e){var t=e.getItemStyle(),i=e.get("areaColor");return null!=i&&(t.fill=i),t}function oA(e,t){t.eachChild((function(t){He.each(t.__regions,(function(i){t.trigger(e.isSelected(i.name)?"emphasis":"normal")}))}))}function sA(e,t){var i=new ac.Group;this.uid=aA("ec_map_draw"),this._controller=new KI(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 ac.Group),i.add(this._backgroundGroup=new ac.Group)}sA.prototype={constructor:sA,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 gi;p.transform=c.roamTransform,p.decomposeTransform();var f={scale:p.scale,position:p.position};l=p.scale,ac.updateProps(h,f,e)}var g=c.rawScale,m=c.rawPosition;u.removeAll();var v=["itemStyle"],y=["emphasis","itemStyle"],x=["label"],_=["emphasis","label"],b=He.createHashMap();He.each(s.regions,(function(t){var i=b.get(t.name)||b.set(t.name,new ac.Group),n=new ac.CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});i.add(n);var a,s=(R=e.getRegionModel(t.name)||e).getModel(v),c=R.getModel(y),p=rA(s),f=rA(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]]};He.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 ac.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 ac.Polygon({segmentIgnoreThreshold:1,shape:{points:t}}))}}})),n.setStyle(p),n.style.strokeNoScale=!0,n.culling=!0;var A=w.get("show"),T=S.get("show"),C=o&&isNaN(o.get(o.mapDimension("value"),a)),D=o&&o.getItemLayout(a);if(r||C&&(A||T)||D&&D.showLabel){var L,P=r?t.name:a;(!o||a>=0)&&(L=e);var k=new ac.Text({position:I(t.center.slice()),scale:[1/h.scale[0],1/h.scale[1]],z2:10,silent:!0});if(ac.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]];ac.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"),ac.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:He.map(o.__regions,(function(e){return{name:e.name,from:a.uid}}))};s[t.mainType+"Id"]=t.id,n.dispatchAction(s),oA(t,i)}}})))}(this,e,u,i,n),oA(e,u)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&OI.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(e){var t=e.map;this._mapName!==t&&He.each(OI.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,QI.updateViewOnPan(r,e.dx,e.dy),i.dispatchAction(He.extend(s(),{dx:e.dx,dy:e.dy}))}),this),a.off("zoom").on("zoom",(function(e){if(this._mouseDownFlag=!1,QI.updateViewOnZoom(r,e.scale,e.originX,e.originY),i.dispatchAction(He.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)&&!nA(t,i,e)}))}};var lA=sA,uA="__seriesMapHighDown",hA="__seriesMapCallKey";function cA(e){var t=this[uA];t&&t.recordVersion===this[hA]&&dA(t,e)}function dA(e,t){var i=e.circle,n=e.labelModel,a=e.hoverLabelModel,r=e.emphasisText,o=e.normalText;t?(i.style.extendFrom(ac.setTextStyle({},a,{text:a.get("show")?r:null},{isRectText:!0,useInsideStyle:!1},!0)),i.__mapOriginalZ2=i.z2,i.z2+=ac.Z2_EMPHASIS_LIFT):(ac.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))}K_.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 lA(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 ac.Circle({style:{fill:e.getData().getVisual("color")},shape:{cx:o[0]+9*s,cy:o[1],r:3},silent:!0,z2:8+(s?0:ac.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=He.retrieve2(e.getFormattedLabel(c,"normal"),h),v=He.retrieve2(e.getFormattedLabel(c,"emphasis"),m),y=g[uA],x=Math.random();if(!y){y=g[uA]={};var _=He.curry(cA,!0),b=He.curry(cA,!1);g.on("mouseover",_).on("mouseout",b).on("emphasis",_).on("normal",b)}g[hA]=x,He.extend(y,{recordVersion:x,circle:l,labelModel:p,hoverLabelModel:f,emphasisText:v,normalText:m}),dA(y,!1)}a.add(l)}}}))}});var pA=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()}},fA={updateCenterAndZoom:pA},gA=fA.updateCenterAndZoom;K_.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=gA(n,e,t.get("scaleLimit"));t.setCenter&&t.setCenter(a.center),t.setZoom&&t.setZoom(a.zoom),"series"===i&&He.each(t.seriesGroup,(function(e){e.setCenter(a.center),e.setZoom(a.zoom)}))}}))}));var mA=ct.applyTransform;function vA(){gi.call(this)}function yA(e){this.name=e,this.zoomLimit,gi.call(this),this._roamTransformable=new vA,this._rawTransformable=new vA,this._center,this._zoom}function xA(e,t,i,n){var a=i.seriesModel,r=a?a.coordinateSystem:null;return r===this?r[e](n):null}He.mixin(vA,gi),yA.prototype={constructor:yA,type:"view",dimensions:["x","y"],setBoundingRect:function(e,t,i,n){return this._rect=new Rn(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 Rn(e,t,i,n)},transformTo:function(e,t,i,n){var a=this.getBoundingRect(),r=this._rawTransformable;r.transform=a.calculateTransform(new Rn(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=ct.applyTransform([],n,e),i=ct.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(),oi.copy(this.transform||(this.transform=[]),t.transform||oi.create()),this._rawTransform=t.getLocalTransform(),this.invTransform=this.invTransform||[],oi.invert(this.invTransform,this.transform),this.decomposeTransform()},getTransformInfo:function(){var e=this._roamTransformable.transform,t=this._rawTransformable;return{roamTransform:e?He.slice(e):oi.create(),rawScale:He.slice(t.scale),rawPosition:He.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?mA(i,e,n):ct.copy(i,e)},pointToData:function(e){var t=this.invTransform;return t?mA([],e,t):[e[0],e[1]]},convertToPixel:He.curry(xA,"dataToPoint"),convertFromPixel:He.curry(xA,"pointToData"),containPoint:function(e){return this.getViewRectAfterRoam().contain(e[0],e[1])}},He.mixin(yA,gi);var _A=yA;function bA(e,t,i,n){_A.call(this,e),this.map=t;var a=OI.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 wA(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}bA.prototype={constructor:bA,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 Rn(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 _A.prototype.dataToPoint.call(this,e,t,i)},convertToPixel:He.curry(wA,"dataToPoint"),convertFromPixel:He.curry(wA,"pointToData")},He.mixin(bA,_A);var SA=bA;function MA(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=[Rc.parsePercent(s[0],u),Rc.parsePercent(s[1],h)],l=Rc.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=od.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 IA(e,t){He.each(t.get("geoCoord"),(function(t,i){e.addGeoCoord(i,t)}))}var AA={dimensions:SA.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=ev.retrieveMap(a);s&&s[0]&&"svg"===s[0].type?(null==r&&(r=1),o=!1):null==r&&(r=.75);var l=new SA(a+n,a,e.get("nameMap"),o);l.aspectScale=r,l.zoomLimit=e.get("scaleLimit"),i.push(l),IA(l,e),e.coordinateSystem=l,l.model=e,l.resize=MA,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)}})),He.each(n,(function(e,n){var a=He.map(e,(function(e){return e.get("nameMap")})),r=new SA(n,n,He.mergeAll(a));r.zoomLimit=He.retrieve.apply(null,He.map(e,(function(e){return e.get("scaleLimit")}))),i.push(r),r.resize=MA,r.aspectScale=e[0].get("aspectScale"),r.resize(e[0],t),He.each(e,(function(e){e.coordinateSystem=r,IA(r,e)}))})),i},getFilledRegions:function(e,t,i){for(var n=(e||[]).slice(),a=He.createHashMap(),r=0;r<n.length;r++)a.set(n[r].name,n[r]);var o=OI.load(t,i);return He.each(o.regions,(function(e){var t=e.name;!a.get(t)&&n.push({name:t})})),n}};K_.registerCoordinateSystem("geo",AA);var TA=AA;var CA=function(e){var t={};e.eachSeriesByType("map",(function(i){var n=i.getMapType();if(!i.getHostGeoModel()&&!t[n]){var a={};He.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 DA=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 LA=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)})),He.each(t,(function(e,t){for(var i,n,a,r=(i=He.map(e,(function(e){return e.getData()})),n=e[0].get("mapValueCalculation"),a={},He.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 PA=function(e){He.each(e.series,(function(e){e&&"map"===e.type&&(e.map=e.map||e.mapType,He.defaults(e,e.mapLocation))}))};K_.registerLayout(CA),K_.registerVisual(DA),K_.registerProcessor(K_.PRIORITY.PROCESSOR.STATISTIC,LA),K_.registerPreprocessor(PA),AM("map",[{type:"mapToggleSelect",event:"mapselectchanged",method:"toggleSelected"},{type:"mapSelect",event:"mapselected",method:"select"},{type:"mapUnSelect",event:"mapunselected",method:"unSelect"}]);var kA=He.each,OA="\0__link_datas",RA="\0__link_mainData";function EA(e,t){if((n=this)[RA]===n){var i=He.extend({},this[OA]);i[this.dataType]=t,VA(t,i,e)}else GA(t,this.dataType,this[RA],e);var n;return t}function NA(e,t){return e.struct&&e.struct.update(this),t}function zA(e,t){return kA(t[OA],(function(i,n){i!==t&&GA(i.cloneShallow(),n,t,e)})),t}function BA(e){var t=this[RA];return null==e||null==t?t:t[OA][e]}function VA(e,t,i){e[OA]={},kA(t,(function(t,n){GA(t,n,e,i)}))}function GA(e,t,i,n){i[OA][t]=e,e[RA]=i,e.dataType=t,n.struct&&(e[n.structAttr]=n.struct,n.struct[n.datasAttr[t]]=e),e.getLinkedData=BA}var FA=function(e){var t=e.mainData,i=e.datas;i||(i={main:t},e.datasAttr={main:"data"}),e.datas=e.mainData=null,VA(t,i,e),kA(i,(function(i){kA(t.TRANSFERABLE_METHODS,(function(t){i.wrapMethod(t,He.curry(EA,e))}))})),t.wrapMethod("cloneShallow",He.curry(zA,e)),kA(t.CHANGABLE_METHODS,(function(i){t.wrapMethod(i,He.curry(NA,e))})),He.assert(i[t.dataType]===t)},HA=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 WA(e,t){this.root,this.data,this._nodes=[],this.hostModel=e,this.levelModels=He.map(t||[],(function(t){return new xc(t,e,e.ecModel)}))}HA.prototype={constructor:HA,isRemoved:function(){return this.dataIndex<0},eachNode:function(e,t,i){"function"==typeof e&&(i=t,t=e,e=null),e=e||{},He.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)}},WA.prototype={constructor:WA,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()}},WA.createTree=function(e,t,i,n){var a=new WA(t,i&&i.levels),r=[],o=1;!function e(t,i){var n=t.value;o=Math.max(o,He.isArray(n)?n.length:1),r.push(t);var s=new HA(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=Jv(r,{coordDimensions:["value"],dimensionsCount:o}),l=new zv(s,t);return l.initData(r),n&&n(l),FA({mainData:l,struct:a,structAttr:"tree"}),a.update(),a};var UA=WA,jA=Yc.encodeHTML;function ZA(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function YA(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function XA(e,t,i){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:i}function qA(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 $A(e,t){return e.parentNode===t.parentNode?1:2}ug.extend({type:"series.tree",layoutInfo:null,layoutMode:"box",getInitialData:function(e){var t={name:e.name,children:e.data},i=e.leaves||{},n=new xc(i,this,this.ecModel),a=UA.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 jA(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 KA=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)}},JA=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=ZA(s),r=YA(r),s&&r;){a=ZA(a),o=YA(o),a.hierNode.ancestor=e;var d=s.hierNode.prelim+c-r.hierNode.prelim-u+n(s,r);d>0&&(qA(XA(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&&!ZA(a)&&(a.hierNode.thread=s,a.hierNode.modifier+=c-l),r&&!YA(o)&&(o.hierNode.thread=r,o.hierNode.modifier+=u-h,i=e)}return i}(e,a,e.parentNode.hierNode.defaultAncestor||n[0],t)},QA=function(e){return arguments.length?e:$A},eT={init:KA,firstWalk:JA,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:QA,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 od.getLayoutRect(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}},tT=eT.radialCoordinate,iT=iA.onIrrelevantElement,nT=Rc.parsePercent,aT=ac.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=nT(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 rT(e,t){var i=e.getItemLayout(t);return i&&!isNaN(i.x)&&!isNaN(i.y)&&"none"!==e.getItemVisual(t,"symbol")}function oT(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 sT(e,t,i,n,a,r){var o=!i,s=e.tree.getNodeByDataIndex(t),l=s.getModel(),u=(r=oT(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 fb(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),ac.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 ac.BezierCurve({shape:uT(l,a,a),style:He.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),ac.updateProps(h,{shape:uT(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 aT({shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]],orient:l.orient,forkPosition:l.edgeForkPosition},style:He.defaults({opacity:0,strokeNoScale:!0},l.lineStyle)})),ac.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 lT(e,t,i,n,a,r){for(var o,s=e.tree.getNodeByDataIndex(t),l=e.tree.root,u=s.getModel(),h=(r=oT(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;ac.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?ac.updateProps(p,{shape:uT(r,o,o),style:{opacity:0}},a,(function(){n.remove(p)})):"polyline"===c&&"orthogonal"===r.layout&&ac.updateProps(p,{shape:{parentPoint:[o.x,o.y],childPoints:[[o.x,o.y]]},style:{opacity:0}},a,(function(){n.remove(p)})))}function uT(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=tT(s,u),p=tT(s,u+(h-u)*e.curvature),f=tT(l,h+(u-h)*e.curvature),g=tT(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}}K_.extendChartView({type:"tree",init:function(e,t){this._oldTree,this._mainGroup=new ac.Group,this._controller=new KI(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){rT(a,t)&&sT(a,t,null,o,e,u)})).update((function(t,i){var n=l.getItemGraphicEl(i);rT(a,t)?sT(a,t,n,o,e,u):n&&lT(l,i,n,o,e,u)})).remove((function(t){var i=l.getItemGraphicEl(t);i&&lT(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=[];zs.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 _A;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)&&!iT(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){QI.updateViewOnPan(a,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"treeRoam",dx:t.dx,dy:t.dy})}),this).on("zoom",(function(t){QI.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 hT=fA.updateCenterAndZoom;K_.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}))})),K_.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=hT(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var cT=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)},dT=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])}},pT={eachAfter:cT,eachBefore:dT},fT=pT.eachAfter,gT=pT.eachBefore,mT=eT.init,vT=eT.firstWalk,yT=eT.secondWalk,xT=eT.separation,_T=eT.radialCoordinate,bT=eT.getViewRect;var wT=function(e,t){e.eachSeriesByType("tree",(function(e){!function(e,t){var i=bT(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=xT((function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth}))):(a=i.width,r=i.height,o=xT());var s=e.getData().tree.root,l=s.children[0];if(l){mT(s),fT(l,vT,o),s.hierNode.modifier=-l.hierNode.prelim,gT(l,yT);var u=l,h=l,c=l;gT(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),gT(l,(function(e){m=(e.getLayout().x+p)*f,v=(e.depth-1)*g;var t=_T(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),gT(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),gT(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 ST(e){for(var t=[];e;)(e=e.parentNode)&&t.push(e);return t.reverse()}K_.registerVisual(sw("tree","circle")),K_.registerLayout(wT);var MT={retrieveTargetInfo:function(e,t,i){if(e&&He.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:ST,aboveViewRoot:function(e,t){var i=ST(e);return He.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}},IT=Yc.encodeHTML,AT=Yc.addCommas,TT=MT.wrapTreePathInfo;function CT(e){var t=0;He.each(e.children,(function(e){CT(e);var i=e.value;He.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;He.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),He.isArray(e.value)?e.value[0]=i:e.value=i}ug.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};CT(i);var n=e.levels||[];n=e.levels=function(e,t){var i,n=t.get("color");if(!n)return;if(e=e||[],He.each(e,(function(e){var t=new xc(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=He.map(n||[],(function(e){return new xc(e,this,t)}),this),r=UA.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=He.isArray(i)?AT(i[0]):AT(i),a=t.getName(e);return IT(a+": "+n)},getDataParams:function(e){var t=ug.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=TT(i,this),t},setLayoutInfo:function(e){this.layoutInfo=this.layoutInfo||{},He.extend(this.layoutInfo,e)},mapIdToIndex:function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=He.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 DT=MT.wrapTreePathInfo;function LT(e){this.group=new ac.Group,e.add(this.group)}function PT(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 kT(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&&DT(i,t)}}LT.prototype={constructor:LT,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),od.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=od.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 ac.Polygon({shape:{points:PT(r,0,f,s,c===h.length-1,0===c)},style:He.defaults(i.getItemStyle(),{lineJoin:"bevel",text:g,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:He.curry(a,p)});this.group.add(m),kT(m,e,p),r+=f+8}},remove:function(){this.group.removeAll()}};var OT=LT;var RT=function(){var e,t=[],i={};return{add:function(e,n,a,r,o){return He.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())}}}},ET={createWrap:RT},NT=Yc.windowOpen,zT=He.bind,BT=ac.Group,VT=ac.Rect,GT=He.each,FT=["label"],HT=["emphasis","label"],WT=["upperLabel"],UT=["emphasis","upperLabel"],jT=10,ZT=Yo([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),YT=function(e){var t=ZT(e);return t.stroke=t.fill=t.lineWidth=null,t};function XT(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",BT);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",VT,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)T(i);else{i.invisible=!1;var a=o.getVisual("borderColor",!0),r=w.get("borderColor"),s=YT(b);s.fill=a;var l=ZT(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),ac.setElementHoverStyle(i,l)}t.add(i)}(S,I,_&&h.upperLabelHeight),_)ac.isHighDownDispatcher(S)&&ac.setAsHighDownDispatcher(S,!1),I&&(ac.setAsHighDownDispatcher(I,!0),c.setItemGraphicEl(o.dataIndex,I));else{var A=L("content",VT,u,2);A&&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)T(i);else{i.invisible=!1;var r=o.getVisual("color",!0),s=YT(b);s.fill=r;var l=ZT(w);C(s,l,r,n,a),i.setStyle(s),ac.setElementHoverStyle(i,l)}t.add(i)}(S,A),I&&ac.isHighDownDispatcher(I)&&ac.setAsHighDownDispatcher(I,!1),ac.setAsHighDownDispatcher(S,!0),c.setItemGraphicEl(o.dataIndex,S)}return S}}}function T(e){!e.invisible&&r.push(e)}function C(t,i,n,a,r,s){var l=M.get("name"),u=M.getModel(s?WT:FT),c=M.getModel(s?UT:HT),d=u.getShallow("show");ac.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=He.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():He.extend({},t.shape)}(h,u,e)):g||((u=new r({z:qT(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 qT(e,t){var i=e*jT+t;return(i-1)/i}K_.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(!(He.indexOf(a,e)<0)){this.seriesModel=e,this.api=i,this.ecModel=t;var r=MT.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 BT,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=He.curry(XT,t,o,s,i,r,l);!function e(t,i,n,a,r){a?(i=t,GT(t,(function(e,t){!e.isRemoved()&&s(t,t)}))):new av(i,t,o,o).add(s).update(s).remove(He.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&&GT(e,(function(e,i){var n=t[i];GT(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(){GT(h,(function(e){GT(e,(function(e){e.parent&&e.parent.remove(e)}))})),GT(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=ET.createWrap();GT(t.willDeleteEls,(function(e,t){GT(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)}}))})),GT(this._storage,(function(e,i){GT(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=He.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(zT((function(){this._state="ready",t.renderFinally()}),this)).start()}},_resetController:function(e){var t=this._controller;t||((t=this._controller=new KI(e.getZr())).enable(this.seriesModel.get("roam")),t.on("pan",zT(this._onPan,this)),t.on("zoom",zT(this._onZoom,this)));var i=new Rn(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 Rn(a.x,a.y,a.width,a.height),o=this.seriesModel.layoutInfo;t-=o.x,i-=o.y;var s=oi.create();oi.translate(s,s,[-t,-i]),oi.scale(s,s,[e.scale,e.scale]),oi.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&&NT(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 OT(this.group))).render(e,t,i.node,zT((function(t){"animating"!==this._state&&(MT.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 $T=function(){},KT=["treemapZoomToNode","treemapRender","treemapMove"],JT=0;JT<KT.length;JT++)K_.registerAction({type:KT[JT],update:"updateView"},$T);K_.registerAction({type:"treemapRootToNode",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"treemap",query:e},(function(t,i){var n=MT.retrieveTargetInfo(e,["treemapZoomToNode","treemapRootToNode"],t);if(n){var a=t.getViewRoot();a&&(e.direction=MT.aboveViewRoot(a,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var QT=Rc.linearMap,eC=He.each,tC=He.isObject,iC=-1,nC=function(e){var t=e.mappingMethod,i=e.type,n=this.option=He.clone(e);this.type=i,this.mappingMethod=t,this._normalizeData=fC[t];var a=aC[i];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._doMap=a._doMap[t],"piecewise"===t?(rC(n),function(e){var t=e.pieceList;e.hasSpecialVisual=!1,He.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(eC(t,(function(e,t){n[e]=t})),!He.isArray(i)){var a=[];He.isObject(i)?eC(i,(function(e,t){var i=n[t];a[null!=i?i:iC]=e})):a[iC]=i,i=pC(e,a)}for(var r=t.length-1;r>=0;r--)null==i[r]&&(delete n[t[r]],t.pop())}(n):rC(n,!0):(He.assert("linear"!==t||n.dataExtent),rC(n))};nC.prototype={constructor:nC,mapValueToVisual:function(e){var t=this._normalizeData(e);return this._doMap(t,e)},getNormalizer:function(){return He.bind(this._normalizeData,this)}};var aC=nC.visualHandlers={color:{applyVisual:lC("color"),getColorMapper:function(){var e=this.option;return He.bind("category"===e.mappingMethod?function(e,t){return!t&&(e=this._normalizeData(e)),uC.call(this,e)}:function(t,i,n){var a=!!n;return!i&&(t=this._normalizeData(t)),n=Yi.fastLerp(t,e.parsedVisual,n),a?n:Yi.stringify(n,"rgba")},this)},_doMap:{linear:function(e){return Yi.stringify(Yi.fastLerp(e,this.option.parsedVisual),"rgba")},category:uC,piecewise:function(e,t){var i=dC.call(this,t);return null==i&&(i=Yi.stringify(Yi.fastLerp(e,this.option.parsedVisual),"rgba")),i},fixed:hC}},colorHue:oC((function(e,t){return Yi.modifyHSL(e,t)})),colorSaturation:oC((function(e,t){return Yi.modifyHSL(e,null,t)})),colorLightness:oC((function(e,t){return Yi.modifyHSL(e,null,null,t)})),colorAlpha:oC((function(e,t){return Yi.modifyAlpha(e,t)})),opacity:{applyVisual:lC("opacity"),_doMap:cC([0,1])},liftZ:{applyVisual:lC("liftZ"),_doMap:{linear:hC,category:hC,piecewise:hC,fixed:hC}},symbol:{applyVisual:function(e,t,i){var n=this.mapValueToVisual(e);if(He.isString(n))i("symbol",n);else if(tC(n))for(var a in n)n.hasOwnProperty(a)&&i(a,n[a])},_doMap:{linear:sC,category:uC,piecewise:function(e,t){var i=dC.call(this,t);return null==i&&(i=sC.call(this,e)),i},fixed:hC}},symbolSize:{applyVisual:lC("symbolSize"),_doMap:cC([0,1])}};function rC(e,t){var i=e.visual,n=[];He.isObject(i)?eC(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]),pC(e,n)}function oC(e){return{applyVisual:function(t,i,n){t=this.mapValueToVisual(t),n("color",e(i("color"),t))},_doMap:cC([0,1])}}function sC(e){var t=this.option.visual;return t[Math.round(QT(e,[0,1],[0,t.length-1],!0))]||{}}function lC(e){return function(t,i,n){n(e,this.mapValueToVisual(t))}}function uC(e){var t=this.option.visual;return t[this.option.loop&&e!==iC?e%t.length:e]}function hC(){return this.option.visual[0]}function cC(e){return{linear:function(t){return QT(t,e,this.option.visual,!0)},category:uC,piecewise:function(t,i){var n=dC.call(this,i);return null==n&&(n=QT(t,e,this.option.visual,!0)),n},fixed:hC}}function dC(e){var t=this.option,i=t.pieceList;if(t.hasSpecialVisual){var n=i[nC.findPieceIndex(e,i)];if(n&&n.visual)return n.visual[this.type]}}function pC(e,t){return e.visual=t,"color"===e.type&&(e.parsedVisual=He.map(t,(function(e){return Yi.parse(e)}))),t}var fC={linear:function(e){return QT(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,i=nC.findPieceIndex(e,t,!0);if(null!=i)return QT(i,[0,t.length-1],[0,1],!0)},category:function(e){var t=this.option.categories?this.option.categoryMap[e]:e;return null==t?iC:t},fixed:He.noop};function gC(e,t,i){return e?t<=i:t<i}nC.listVisualTypes=function(){var e=[];return He.each(aC,(function(t,i){e.push(i)})),e},nC.addVisualHandler=function(e,t){aC[e]=t},nC.isValidType=function(e){return aC.hasOwnProperty(e)},nC.eachVisual=function(e,t,i){He.isObject(e)?He.each(e,t,i):t.call(i,e)},nC.mapVisual=function(e,t,i){var n,a=He.isArray(e)?[]:He.isObject(e)?{}:(n=!0,null);return nC.eachVisual(e,(function(e,r){var o=t.call(i,e,r);n?a=o:a[r]=o})),a},nC.retrieveVisuals=function(e){var t,i={};return e&&eC(aC,(function(n,a){e.hasOwnProperty(a)&&(i[a]=e[a],t=!0)})),t?i:null},nC.prepareVisualTypes=function(e){if(tC(e)){var t=[];eC(e,(function(e,i){t.push(i)})),e=t}else{if(!He.isArray(e))return[];e=e.slice()}return e.sort((function(e,t){return"color"===t&&"color"!==e&&0===e.indexOf("color")?1:-1})),e},nC.dependsOn=function(e,t){return"color"===t?!(!e||0!==e.indexOf(t)):e===t},nC.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(gC(h[1],e,u[1]))return r}else if(u[1]===1/0){if(gC(h[0],u[0],e))return r}else if(gC(h[0],u[0],e)&&gC(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 mC=nC,vC=He.isArray,yC="itemStyle";function xC(e,t,i,n,a,r){var o=e.getModel(),s=e.getLayout();if(s&&!s.invisible&&s.isInView){var l,u=e.getModel(yC),h=function(e,t,i,n){var a=He.extend({},t);return He.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?Yi.modifyHSL(t,null,null,e):null}(d,l=_C(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=wC(t,"color")||null!=a.color&&"none"!==a.color&&(wC(t,"colorAlpha")||wC(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 mC(c);return d.__drColorMappingBy=h,d}(0,o,s,0,h,p);He.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=He.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);xC(e,s,i,n,a,r)}}))}else l=_C(h),e.setVisual("color",l)}}function _C(e){var t=bC(e,"color");if(t){var i=bC(e,"colorAlpha"),n=bC(e,"colorSaturation");return n&&(t=Yi.modifyHSL(t,null,null,n)),i&&(t=Yi.modifyAlpha(t,i)),t}}function bC(e,t){var i=e[t];if(null!=i&&"none"!==i)return i}function wC(e,t){var i=e.get(t);return vC(i)&&i.length?{name:t,range:i}:null}var SC={seriesType:"treemap",reset:function(e,t,i,n){var a=e.getData().tree,r=a.root,o=e.getModel(yC);r.isRemoved()||xC(r,{},He.map(a.levelModels,(function(e){return e?e.get(yC):null})),o,e.getViewRoot().getAncestors(),e)}},MC=Rc.parsePercent,IC=Rc.MAX_SAFE_INTEGER,AC=Math.max,TC=Math.min,CC=He.retrieve,DC=He.each,LC=["itemStyle","borderWidth"],PC=["itemStyle","gapWidth"],kC=["upperLabel","show"],OC=["upperLabel","height"],RC={seriesType:"treemap",reset:function(e,t,i,n){var a=i.getWidth(),r=i.getHeight(),o=e.option,s=od.getLayoutRect(e.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=o.size||[],u=MC(CC(s.width,l[0]),a),h=MC(CC(s.height,l[1]),r),c=n&&n.type,d=MT.retrieveTargetInfo(n,["treemapZoomToNode","treemapRootToNode"],e),p="treemapRender"===c||"treemapMove"===c?n.rootRect:null,f=e.getViewRoot(),g=MT.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(LC);(u+=4*m*m+(3*m+Math.max(m,VC(g)))*Math.pow(u,.5))>IC&&(u=IC),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),EC(f,y,!1,0);x=f.getLayout();DC(g,(function(e,t){var i=(g[t+1]||f).getValue();e.setLayout(He.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),BC(_,new Rn(-s.x,-s.y,a,r),g,f,0)}};function EC(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(LC),l=p.get(PC)/2,u=VC(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=AC(a-2*c,0))*(r=AC(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=He.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];DC(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=TC(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=NC(x,v,t.squareRatio);S<=y?(_++,y=S):(x.area-=x.pop().getLayout().area,zC(x,v,m,l,!1),v=TC(m.width,m.height),x.length=x.area=0,y=1/0)}if(x.length&&zC(x,v,m,l,!0),!i){var M=p.get("childrenVisibleMin");null!=M&&f<M&&(i=!0)}for(_=0,b=g.length;_<b;_++)EC(g[_],t,i,n+1)}}}function NC(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?AC(u*a/l,l/(u*r)):1/0}function zC(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]]=AC(h-2*n,0),v=i[s[r]]+i[l[r]]-u,y=c===d-1||v<g?v:g,x=f[l[r]]=AC(y-2*n,0);f[s[o]]=i[s[o]]+TC(n,m/2),f[s[r]]=u+TC(n,x/2),u+=y,p.setLayout(f,!0)}i[s[o]]+=h,i[l[o]]-=h}function BC(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 Rn(t.x-r.x,t.y-r.y,t.width,t.height);DC(e.viewChildren||[],(function(e){BC(e,l,i,n,a+1)}))}}function VC(e){return e.get(kC)?e.get(OC):0}var GC=RC;K_.registerVisual(SC),K_.registerLayout(GC);var FC=Zo.enableClassCheck;function HC(e){return"_EC_"+e}var WC=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},UC=WC.prototype;function jC(e,t){this.id=null==e?"":e,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==t?-1:t}function ZC(e,t,i){this.node1=e,this.node2=t,this.dataIndex=null==i?-1:i}UC.type="graph",UC.isDirected=function(){return this._directed},UC.addNode=function(e,t){e=null==e?""+t:""+e;var i=this._nodesMap;if(!i[HC(e)]){var n=new jC(e,t);return n.hostGraph=this,this.nodes.push(n),i[HC(e)]=n,n}},UC.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},UC.getNodeById=function(e){return this._nodesMap[HC(e)]},UC.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]),jC.isInstance(e)||(e=n[HC(e)]),jC.isInstance(t)||(t=n[HC(t)]),e&&t){var r=e.id+"-"+t.id;if(!a[r]){var o=new ZC(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}}},UC.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},UC.getEdge=function(e,t){jC.isInstance(e)&&(e=e.id),jC.isInstance(t)&&(t=t.id);var i=this._edgesMap;return this._directed?i[e+"-"+t]:i[e+"-"+t]||i[t+"-"+e]},UC.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)},UC.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)},UC.breadthFirstTraverse=function(e,t,i,n){if(jC.isInstance(t)||(t=this._nodesMap[HC(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}}}}},UC.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},UC.clone=function(){for(var e=new WC(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},jC.prototype={constructor:jC,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)}},ZC.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)};var YC=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)}}};He.mixin(jC,YC("hostGraph","data")),He.mixin(ZC,YC("hostGraph","edgeData")),WC.Node=jC,WC.Edge=ZC,FC(jC),FC(ZC);var XC=WC;var qC=function(e,t,i,n,a){for(var r=new XC(n),o=0;o<e.length;o++)r.addNode(He.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(He.retrieve(h.id,c+" > "+d)),u++)}var p,f=i.get("coordinateSystem");if("cartesian2d"===f||"polar"===f)p=my(e,i);else{var g=Dp.get(f),m=g&&"view"!==g.type&&g.dimensions||[];He.indexOf(m,"value")<0&&m.concat(["value"]);var v=Jv(e,{coordDimensions:m});(p=new zv(v,i)).initData(e)}var y=new zv(["value"],i);return y.initData(l,s),a&&a(p,y),FA({mainData:p,struct:r,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),r.update(),r},$C=zo.defaultEmphasis,KC=Yc.encodeHTML,JC=K_.extendSeriesModel({type:"series.graph",init:function(e){JC.superApply(this,"init",arguments);var t=this;function i(){return t._categoriesData}this.legendVisualProvider=new vM(i,i),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeOption:function(e){JC.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(e.edges||e.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(e){JC.superApply(this,"mergeDefaultAndTheme",arguments),$C(e,["edgeLabel"],["show"])},getInitialData:function(e,t){var i=e.edges||e.links||[],n=e.data||e.nodes||[],a=this;if(n&&i)return qC(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 xc({label:n.option},n.parentModel,t),o=a.getModel("emphasis.edgeLabel"),s=new xc({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=KC(l.join(" > ")),a.value&&(l+=" : "+KC(a.value)),l}return JC.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var e=He.map(this.option.categories||[],(function(e){return null!=e.value?e:He.extend({value:0},e)})),t=new zv(["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 JC.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}}}}),QC=ac.Line.prototype,eD=ac.BezierCurve.prototype;function tD(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var iD=ac.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[tD(t)?"_buildPathLine":"_buildPathCurve"](e,t)},_buildPathLine:QC.buildPath,_buildPathCurve:eD.buildPath,pointAt:function(e){return this[tD(this.shape)?"_pointAtLine":"_pointAtCurve"](e)},_pointAtLine:QC.pointAt,_pointAtCurve:eD.pointAt,tangentAt:function(e){var t=this.shape,i=tD(t)?[t.x2-t.x1,t.y2-t.y1]:this._tangentAtCurve(e);return ct.normalize(i,i)},_tangentAtCurve:eD.tangentAt}),nD=Rc.round,aD=["fromSymbol","toSymbol"];function rD(e){return"_"+e+"Type"}function oD(e,t,i){var n=t.getItemVisual(i,"color"),a=t.getItemVisual(i,e),r=t.getItemVisual(i,e+"Size");if(a&&"none"!==a){He.isArray(r)||(r=[r,r]);var o=Xx.createSymbol(a,-r[0]/2,-r[1]/2,r[0],r[1],n);return o.name=e,o}}function sD(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 lD(e,t,i){ac.Group.call(this),this._createLine(e,t,i)}var uD=lD.prototype;uD.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=ct.sub([],u,l);if(ct.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})}}}},uD._createLine=function(e,t,i){var n=e.hostModel,a=function(e){var t=new iD({name:"line",subPixelOptimize:!0});return sD(t.shape,e),t}(e.getItemLayout(t));a.shape.percent=0,ac.initProps(a,{shape:{percent:1}},n,t),this.add(a);var r=new ac.Text({name:"label",lineLabelOriginalOpacity:1});this.add(r),He.each(aD,(function(i){var n=oD(i,e,t);this.add(n),this[rD(i)]=e.getItemVisual(t,i)}),this),this._updateCommonStl(e,t,i)},uD.updateData=function(e,t,i){var n=e.hostModel,a=this.childOfName("line"),r=e.getItemLayout(t),o={shape:{}};sD(o.shape,r),ac.updateProps(a,o,n,t),He.each(aD,(function(i){var n=e.getItemVisual(t,i),a=rD(i);if(this[a]!==n){this.remove(this.childOfName(i));var r=oD(i,e,t);this.add(r)}this[a]=n}),this),this._updateCommonStl(e,t,i)},uD._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=He.retrieve3(e.getItemVisual(t,"opacity"),r.opacity,1);a.useStyle(He.defaults({strokeNoScale:!0,fill:"none",stroke:h,opacity:c},r)),a.hoverStyle=o,He.each(aD,(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)?nD(v):v}var y=f?p:null,x=g?He.retrieve2(n.getFormattedLabel(t,"emphasis",e.dataType),p):null,_=m.style;if(null!=y||null!=x){ac.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");He.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,ac.setHoverStyle(this)},uD.highlight=function(){this.trigger("emphasis")},uD.downplay=function(){this.trigger("normal")},uD.updateLayout=function(e,t){this.setLinePoints(e.getItemLayout(t))},uD.setLinePoints=function(e){var t=this.childOfName("line");sD(t.shape,e),t.dirty()},He.inherits(lD,ac.Group);var hD=lD;function cD(e){this._ctor=e||hD,this.group=new ac.Group}var dD=cD.prototype;function pD(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 fD(e){return isNaN(e[0])||isNaN(e[1])}function gD(e){return!fD(e[0])&&!fD(e[1])}dD.isPersistent=function(){return!0},dD.updateData=function(e){var t=this,i=t.group,n=t._lineData;t._lineData=e,n||i.removeAll();var a=pD(e);e.diff(n).add((function(i){!function(e,t,i,n){var a=t.getItemLayout(i);if(!gD(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(!gD(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()},dD.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl((function(t,i){t.updateLayout(e,i)}),this)},dD.incrementalPrepareUpdate=function(e){this._seriesScope=pD(e),this._lineData=null,this.group.removeAll()},dD.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(gD(t.getItemLayout(n))){var a=new this._ctor(t,n,this._seriesScope);a.traverse(i),this.group.add(a),t.setItemGraphicEl(n,a)}}},dD.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},dD._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var mD=cD;var vD={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}},yD=vD.getSymbolSize,xD=[],_D=[],bD=[],wD=bs.quadraticAt,SD=ct.distSquare,MD=Math.abs;function ID(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){xD[0]=wD(a[0],r[0],o[0],h),xD[1]=wD(a[1],r[1],o[1],h),(p=MD(SD(xD,t)-l))<s&&(s=p,n=h)}for(var c=0;c<32;c++){var d=n+u;_D[0]=wD(a[0],r[0],o[0],n),_D[1]=wD(a[1],r[1],o[1],n),bD[0]=wD(a[0],r[0],o[0],d),bD[1]=wD(a[1],r[1],o[1],d);var p=SD(_D,t)-l;if(MD(p)<.01)break;var f=SD(bD,t)-l;u/=2,p<0?f>=0?n+=u:n-=u:f>=0?n-=u:n+=u}return n}var AD=function(e,t){var i=[],n=bs.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=[ct.clone(l[0]),ct.clone(l[1])],l[2]&&l.__original.push(ct.clone(l[2])));var c=l.__original;if(null!=l[2]){if(ct.copy(a[0],c[0]),ct.copy(a[1],c[2]),ct.copy(a[2],c[1]),u&&"none"!==u){var d=yD(e.node1),p=ID(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=yD(e.node2),p=ID(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]}ct.copy(l[0],a[0]),ct.copy(l[1],a[2]),ct.copy(l[2],a[1])}else{if(ct.copy(r[0],c[0]),ct.copy(r[1],c[1]),ct.sub(o,r[1],r[0]),ct.normalize(o,o),u&&"none"!==u){d=yD(e.node1);ct.scaleAndAdd(r[0],r[0],o,d*t)}if(h&&"none"!==h){d=yD(e.node2);ct.scaleAndAdd(r[1],r[1],o,-d*t)}ct.copy(l[0],r[0]),ct.copy(l[1],r[1])}}))},TD=iA.onIrrelevantElement,CD=vD.getNodeGlobalScale,DD="__focusNodeAdjacency",LD="__unfocusNodeAdjacency",PD=["itemStyle","opacity"],kD=["lineStyle","opacity"];function OD(e,t){var i=e.getVisual("opacity");return null!=i?i:e.getModel().get(t)}function RD(e,t,i){var n=e.getGraphicEl(),a=OD(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 ED(e,t){var i=OD(e,t),n=e.getGraphicEl();n.traverse((function(e){!e.isGroup&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}K_.extendChartView({type:"graph",init:function(e,t){var i=new bb,n=new mD,a=this.group;this._controller=new KI(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):ac.updateProps(s,l,e)}AD(e.getGraph(),CD(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[DD]&&t.off("mouseover",t[DD]),t[LD]&&t.off("mouseout",t[LD]),r.get("focusNodeAdjacency")&&(t.on("mouseover",t[DD]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,dataIndex:t.dataIndex})}),t.on("mouseout",t[LD]=function(){n._dispatchUnfocus(i)}))}),this),u.graph.eachEdge((function(t){var a=t.getGraphicEl();a[DD]&&a.off("mouseover",a[DD]),a[LD]&&a.off("mouseout",a[LD]),t.getModel().get("focusNodeAdjacency")&&(a.on("mouseover",a[DD]=function(){n._clearTimer(),i.dispatchAction({type:"focusNodeAdjacency",seriesId:e.id,edgeDataIndex:t.dataIndex})}),a.on("mouseout",a[LD]=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";ac.modifyLabelStyle(n,{textRotation:-r,textPosition:s,textOrigin:"center"},{textPosition:s})}else ac.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){RD(e,PD,.1)})),a.eachEdge((function(e){RD(e,kD,.1)})),s&&(ED(s,PD),He.each(s.edges,(function(e){e.dataIndex<0||(ED(e,kD),ED(e.node1,PD),ED(e.node2,PD))}))),l&&(ED(l,kD),ED(l.node1,PD),ED(l.node2,PD)))},unfocusNodeAdjacency:function(e,t,i,n){var a=e.getData().graph;a.eachNode((function(e){RD(e,PD)})),a.eachEdge((function(e){RD(e,kD)}))},_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)&&!TD(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){QI.updateViewOnPan(a,t.dx,t.dy),i.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){QI.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(),AD(e.getGraph(),CD(e)),this._lineDraw.updateLayout()}),this)):n.disable()},_updateNodeAndLinkScale:function(){var e=this._model,t=e.getData(),i=CD(e),n=[i,i];t.eachItemGraphicEl((function(e,t){e.attr("scale",n)}))},updateLayout:function(e){AD(e.getGraph(),CD(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()}}),K_.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},(function(){})),K_.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},(function(){}));var ND=fA.updateCenterAndZoom;K_.registerAction({type:"graphRoam",event:"graphRoam",update:"none"},(function(e,t){t.eachComponent({mainType:"series",query:e},(function(t){var i=t.coordinateSystem,n=ND(i,e);t.setCenter&&t.setCenter(n.center),t.setZoom&&t.setZoom(n.zoom)}))}));var zD=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 BD=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 VD(e){return e instanceof Array||(e=[e,e]),e}var GD=function(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),i=e.getEdgeData(),n=VD(e.get("edgeSymbol")),a=VD(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=VD(n.getShallow("symbol",!0)),l=VD(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 FD(e){e.eachEdge((function(e){var t=e.getModel().get("lineStyle.curveness")||0,i=ct.clone(e.node1.getLayout()),n=ct.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 HD=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")])})),FD(i)}},WD={simpleLayout:HD,simpleLayoutEdge:FD},UD=He.each,jD=WD.simpleLayout,ZD=WD.simpleLayoutEdge;var YD=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=[];UD(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])}ZD(n.graph)}else t&&"none"!==t||jD(e)}))},XD=vD.getSymbolSize,qD=vD.getNodeGlobalScale,$D=Math.PI,KD=[];var JD={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;KD.length=s;var u=qD(e);i.eachNode((function(e){var t=XD(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=u;var i=Math.asin(t/2/a);isNaN(i)&&(i=$D/2),KD[e.dataIndex]=i,l+=2*i}));var h=(2*$D-l)/s/2,c=0;i.eachNode((function(e){var t=h+KD[e.dataIndex];c+=t,e.setLayout([a*Math.cos(c)+r,a*Math.sin(c)+o]),c+=t}))}},QD=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&&(JD[t](e,i,r,a,l,o,s,u),r.eachEdge((function(e){var t,i=e.getModel().get("lineStyle.curveness")||0,n=ct.clone(e.node1.getLayout()),a=ct.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])})))}},eL={circularLayout:QD},tL=eL.circularLayout;var iL=function(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&tL(e,"symbolSize")}))},nL=ct.scaleAndAdd;var aL=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=ct.create(a*(Math.random()-.5)+o[0],r*(Math.random()-.5)+o[1])),u.pp=ct.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;ct.sub(n,h.p,u.p);var d=ct.len(n)-l.d,p=h.w/(u.w+h.w);isNaN(p)&&(p=0),ct.normalize(n,n),!u.fixed&&nL(u.p,u.p,n,p*d*c),!h.fixed&&nL(h.p,h.p,n,-(1-p)*d*c)}}for(r=0;r<a;r++){(v=e[r]).fixed||(ct.sub(n,o,v.p),nL(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];ct.sub(n,h.p,u.p),0===(d=ct.len(n))&&(ct.set(n,Math.random()-.5,Math.random()-.5),d=1);var g=(u.rep+h.rep)/d/d;!u.fixed&&nL(u.pp,u.pp,n,g),!h.fixed&&nL(h.pp,h.pp,n,-g)}}var m=[];for(r=0;r<a;r++){var v;(v=e[r]).fixed||(ct.sub(m,v.p,v.pp),nL(v.p,v.p,m,c),ct.copy(v.pp,v.p))}c*=.992,i&&i(e,t,c<.01)}}},rL={forceLayout:aL}.forceLayout,oL=WD.simpleLayout,sL=eL.circularLayout,lL=Rc.linearMap;var uL=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&&sL(e,"value"):oL(e);var s=n.getDataExtent("value"),l=a.getDataExtent("value"),u=r.get("repulsion"),h=r.get("edgeLength");He.isArray(u)||(u=[u,u]),He.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=lL(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=lL(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=rL(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&&ct.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]||[],ct.copy(p[0],c),ct.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}))},hL=od.getLayoutRect;var cL=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=[];zs.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,hL(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 _A;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};K_.registerProcessor(zD),K_.registerVisual(sw("graph","circle",null)),K_.registerVisual(BD),K_.registerVisual(GD),K_.registerLayout(YD),K_.registerLayout(K_.PRIORITY.VISUAL.POST_CHART_LAYOUT,iL),K_.registerLayout(uL),K_.registerCoordinateSystem("graphView",{create:cL}),ug.extend({type:"series.gauge",getInitialData:function(e,t){return gM(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 dL=Ml.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)}}),pL=dL,fL=Rc.parsePercent,gL=Rc.round,mL=Rc.linearMap;function vL(e,t){return t&&("string"==typeof t?e=t.replace("{value}",null!=e?e:""):"function"==typeof t&&(e=t(e))),e}var yL=2*Math.PI;Ag.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:fL(i[0],t.getWidth()),cy:fL(i[1],t.getHeight()),r:fL(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)%yL,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 ac.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=fL(f.get("length"),c),_=fL(g.get("length"),c),b=r,w=(o-r)/v,S=w/y,M=f.getModel("lineStyle").getLineStyle(),I=g.getModel("lineStyle").getLineStyle(),A=0;A<=v;A++){var T=Math.cos(b),C=Math.sin(b);if(f.get("show")){var D=new ac.Line({shape:{x1:T*c+u,y1:C*c+h,x2:T*(c-x)+u,y2:C*(c-x)+h},style:M,silent:!0});"auto"===M.stroke&&D.setStyle({stroke:n(A/v)}),l.add(D)}if(m.get("show")){var L=vL(gL(A/v*(p-d)+d),m.get("formatter")),P=m.get("distance"),k=n(A/v);l.add(new ac.Text({style:ac.setTextStyle({},m,{text:L,x:T*(c-x-P)+u,y:C*(c-x-P)+h,textVerticalAlign:C<-.4?"top":C>.4?"bottom":"middle",textAlign:T<-.4?"left":T>.4?"right":"center"},{autoColor:k}),silent:!0}))}if(g.get("show")&&A!==v){for(var O=0;O<=y;O++){T=Math.cos(b),C=Math.sin(b);var R=new ac.Line({shape:{x1:T*c+u,y1:C*c+h,x2:T*(c-_)+u,y2:C*(c-_)+h},silent:!0,style:I});"auto"===I.stroke&&R.setStyle({stroke:n((A+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 pL({shape:{angle:r}});ac.initProps(i,{shape:{angle:mL(d.get(p,t),h,c,!0)}},e),l.add(i),d.setItemGraphicEl(t,i)})).update((function(t,i){var n=u.getItemGraphicEl(i);ac.updateProps(n,{shape:{angle:mL(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:fL(r.get("width"),a.r),r:fL(r.get("length"),a.r)}),e.useStyle(i.getModel("itemStyle").getItemStyle()),"auto"===e.style.fill&&e.setStyle("fill",n(mL(d.get(p,t),h,[0,1],!0))),ac.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+fL(l[0],a.r),h=a.cy+fL(l[1],a.r),c=+e.get("min"),d=+e.get("max"),p=e.getData().get(o,0),f=n(mL(p,[c,d],[0,1],!0));this.group.add(new ac.Text({silent:!0,style:ac.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+fL(l[0],a.r),h=a.cy+fL(l[1],a.r),c=fL(r.get("width"),a.r),d=fL(r.get("height"),a.r),p=e.getData(),f=p.get(p.mapDimension("value"),0),g=n(mL(f,[o,s],[0,1],!0));this.group.add(new ac.Text({silent:!0,style:ac.setTextStyle({},r,{x:u,y:h,text:vL(f,r.get("formatter")),textWidth:isNaN(c)?null:c,textHeight:isNaN(d)?null:d,textAlign:"center",textVerticalAlign:"middle"},{autoColor:g,forceRich:!0})}))}}});var xL=zo.defaultEmphasis,_L=ap.makeSeriesEncodeForNameBased,bL=K_.extendSeriesModel({type:"series.funnel",init:function(e){bL.superApply(this,"init",arguments),this.legendVisualProvider=new vM(He.bind(this.getData,this),He.bind(this.getRawData,this)),this._defaultLabelLine(e)},getInitialData:function(e,t){return gM(this,{coordDimensions:["value"],encodeDefaulter:He.curry(_L,this)})},_defaultLabelLine:function(e){xL(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=bL.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 wL(e,t){ac.Group.call(this);var i=new ac.Polygon,n=new ac.Polyline,a=new ac.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 SL=wL.prototype,ML=["itemStyle","opacity"];SL.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(ML);s=null==s?1:s,n.useStyle({}),i?(n.setShape({points:o.points}),n.setStyle({opacity:0}),ac.initProps(n,{style:{opacity:s}},a,t)):ac.updateProps(n,{style:{opacity:s},shape:{points:o.points}},a,t);var l=r.getModel("itemStyle"),u=e.getItemVisual(t,"color");n.setStyle(He.defaults({lineJoin:"round",fill:u},l.getItemStyle(["opacity"]))),n.hoverStyle=l.getModel("emphasis").getItemStyle(),this._updateLabel(e,t),ac.setHoverStyle(this)},SL._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");ac.updateProps(i,{shape:{points:o.linePoints||o.linePoints}},a,t),ac.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");ac.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()},He.inherits(wL,ac.Group),Ag.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 wL(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 IL=Rc.parsePercent,AL=Rc.linearMap;var TL=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 od.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=[IL(e.get("minSize"),r.width),IL(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=AL(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=IL(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)}))};K_.registerVisual(CM("funnel")),K_.registerLayout(TL),K_.registerProcessor(VM("funnel"));var CL=function(e){!function(e){if(e.parallel)return;var t=!1;He.each(e.series,(function(e){e&&"parallel"===e.type&&(t=!0)})),t&&(e.parallel=[{}])}(e),function(e){var t=zo.normalizeToArray(e.parallelAxis);He.each(t,(function(t){if(He.isObject(t)){var i=t.parallelIndex||0,n=zo.normalizeToArray(e.parallel)[i];n&&n.parallelAxisDefault&&He.merge(t,n.parallelAxisDefault,!1)}}))}(e)},DL=function(e,t,i,n,a){O_.call(this,e,t,i),this.type=n||"value",this.axisIndex=a};DL.prototype={constructor:DL,model:null,isHorizontal:function(){return"horizontal"!==this.coordinateSystem.getModel().get("layout")}},He.inherits(DL,O_);var LL=DL;function PL(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 kL(e,t){return Math.min(null!=t[1]?t[1]:1/0,Math.max(null!=t[0]?t[0]:-1/0,e))}var OL=function(e,t,i,n,a,r){e=e||0;var o=i[1]-i[0];if(null!=a&&(a=kL(a,[0,o])),null!=r&&(r=Math.max(r,null!=a?a:0)),"all"===n){var s=Math.abs(t[1]-t[0]);s=kL(s,[0,o]),a=r=kL(s,[a,r]),n=0}t[0]=kL(t[0],i),t[1]=kL(t[1],i);var l=PL(t,n);t[n]+=e;var u=a||0,h=i.slice();l.sign<0?h[0]+=u:h[1]-=u,t[n]=kL(t[n],h);var c=PL(t,n);return null!=a&&(c.sign!==l.sign||c.span<a)&&(t[1-n]=t[n]+l.sign*a),c=PL(t,n),null!=r&&c.span>r&&(t[1-n]=t[n]+c.sign*r),t},RL=He.each,EL=Math.min,NL=Math.max,zL=Math.floor,BL=Math.ceil,VL=Rc.round,GL=Math.PI;function FL(e,t,i){this._axesMap=He.createHashMap(),this._axesLayout={},this.dimensions=e.dimensions,this._rect,this._model=e,this._init(e,t,i)}function HL(e,t){return EL(NL(e,t[0]),t[1])}function WL(e,t){var i=t.layoutLength/(t.axisCount-1);return{position:i*e,axisNameAvailableWidth:i,axisLabelShow:!0}}function UL(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}}FL.prototype={type:"parallel",constructor:FL,_init:function(e,t,i){var n=e.dimensions,a=e.parallelAxisIndex;RL(n,(function(e,i){var n=a[i],r=t.getComponent("parallelAxis",n),o=this._axesMap.set(e,new LL(e,Rx.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();RL(this.dimensions,(function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(n,n.mapDimension(e)),Rx.niceScaleExtent(t.scale,t.model)}),this)}}),this)},resize:function(e,t){this._rect=od.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=HL(t.get("axisExpandWidth"),l),c=HL(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=HL(p[1]-p[0],l),p[1]=p[0]+e):(e=HL(h*(c-1),l),(p=[h*(t.get("axisExpandCenter")||zL(u/2))-e/2])[1]=p[0]+e);var f=(s-e)/(u-c);f<3&&(f=0);var g=[zL(VL(p[0]/h,1))+1,BL(VL(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])})),RL(i,(function(t,i){var r=(n.axisExpandable?UL:WL)(i,n),o={horizontal:{x:r.position,y:n.axisLength},vertical:{x:0,y:r.position}},s={horizontal:GL/2,vertical:0},l=[o[a].x+e.x,o[a].y+e.y],u=s[a],h=oi.create();oi.rotate(h,h,u),oi.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=[];He.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 ac.applyTransform([e,0],i.transform)},getAxisLayout:function(e){return He.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)?OL(o,n,r,"all"):l="none";else{a=n[1]-n[0];(n=[NL(0,r[1]*s/a-a/2)])[1]=EL(r[1],n[0]+a),n[0]=n[1]-a}return{axisExpandWindow:n,behavior:l}}};var jL=FL;Dp.register("parallel",{create:function(e,t){var i=[];return e.eachComponent("parallel",(function(n,a){var r=new jL(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 ZL=dd.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return Yo([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(e){var t=this.activeIntervals=He.clone(e);if(t)for(var i=t.length-1;i>=0;i--)Rc.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"}});He.merge(ZL.prototype,Nx),Tw("parallel",ZL,(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}),dd.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(){dd.prototype.init.apply(this,arguments),this.mergeOption({})},mergeOption:function(e){var t=this.option;e&&He.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){He.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=He.filter(this.dependentModels.parallelAxis,(function(e){return(e.get("parallelIndex")||0)===this.componentIndex}),this);He.each(i,(function(i){e.push("dim"+i.get("dim")),t.push(i.componentIndex)}))}});K_.registerAction({type:"axisAreaSelect",event:"axisAreaSelected"},(function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},(function(t){t.axis.model.setActiveIntervals(e.intervals)}))})),K_.registerAction("parallelAxisExpand",(function(e,t){t.eachComponent({mainType:"parallel",query:e},(function(t){t.setAxisExpand(e)}))}));var YL=He.curry,XL=He.each,qL=He.map,$L=Math.min,KL=Math.max,JL=Math.pow,QL=1e4,eP=6,tP=6,iP="globalPan",nP={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},aP={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},rP={brushStyle:{lineWidth:2,stroke:"rgba(0,0,0,0.3)",fill:"rgba(0,0,0,0.1)"},transformable:!0,brushMode:"single",removeOnClick:!1},oP=0;function sP(e){yt.call(this),this._zr=e,this.group=new ac.Group,this._brushType,this._brushOption,this._panels,this._track=[],this._dragging,this._covers=[],this._creatingCover,this._creatingPanel,this._enableGlobalPan,this._uid="brushController_"+oP++,this._handlers={},XL(RP,(function(e,t){this._handlers[t]=He.bind(e,this)}),this)}function lP(e,t){var i=NP[t.brushType].createCover(e,t);return i.__brushOption=t,cP(i,t),e.group.add(i),i}function uP(e,t){var i=pP(t);return i.endCreating&&(i.endCreating(e,t),cP(t,t.__brushOption)),t}function hP(e,t){var i=t.__brushOption;pP(t).updateCoverShape(e,t,i.range,i)}function cP(e,t){var i=t.z;null==i&&(i=QL),e.traverse((function(e){e.z=i,e.z2=i}))}function dP(e,t){pP(t).updateCommon(e,t),hP(e,t)}function pP(e){return NP[e.__brushOption.brushType]}function fP(e,t,i){var n,a=e._panels;if(!a)return!0;var r=e._transform;return XL(a,(function(e){e.isTargetByCursor(t,i,r)&&(n=e)})),n}function gP(e,t){var i=e._panels;if(!i)return!0;var n=t.__brushOption.panelId;return null==n||i[n]}function mP(e){var t=e._covers,i=t.length;return XL(t,(function(t){e.group.remove(t)}),e),t.length=0,!!i}function vP(e,t){var i=qL(e._covers,(function(e){var t=e.__brushOption,i=He.clone(t.range);return{brushType:t.brushType,panelId:t.panelId,range:i}}));e.trigger("brush",i,{isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function yP(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function xP(e,t,i,n){var a=new ac.Group;return a.add(new ac.Rect({name:"main",style:SP(i),silent:!0,draggable:!0,cursor:"move",drift:YL(e,t,a,"nswe"),ondragend:YL(vP,t,{isEnd:!0})})),XL(n,(function(i){a.add(new ac.Rect({name:i,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:YL(e,t,a,i),ondragend:YL(vP,t,{isEnd:!0})}))})),a}function _P(e,t,i,n){var a=n.brushStyle.lineWidth||0,r=KL(a,tP),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;wP(e,t,"main",o,s,f,g),n.transformable&&(wP(e,t,"w",l,u,r,v),wP(e,t,"e",d,u,r,v),wP(e,t,"n",l,u,m,r),wP(e,t,"s",l,p,m,r),wP(e,t,"nw",l,u,r,r),wP(e,t,"ne",d,u,r,r),wP(e,t,"sw",l,p,r,r),wP(e,t,"se",d,p,r,r))}function bP(e,t){var i=t.__brushOption,n=i.transformable,a=t.childAt(0);a.useStyle(SP(i)),a.attr({silent:!n,cursor:n?"move":"default"}),XL(["w","e","n","s","se","sw","ne","nw"],(function(i){var a=t.childOfName(i),r=IP(e,i);a&&a.attr({silent:!n,invisible:!n,cursor:n?aP[r]+"-resize":null})}))}function wP(e,t,i,n,a,r,o){var s=t.childOfName(i);s&&s.setShape(function(e){var t=$L(e[0][0],e[1][0]),i=$L(e[0][1],e[1][1]),n=KL(e[0][0],e[1][0]),a=KL(e[0][1],e[1][1]);return{x:t,y:i,width:n-t,height:a-i}}(DP(e,t,[[n,a],[n+r,a+o]])))}function SP(e){return He.defaults({strokeNoScale:!0},e.brushStyle)}function MP(e,t,i,n){var a=[$L(e,i),$L(t,n)],r=[KL(e,i),KL(t,n)];return[[a[0],r[0]],[a[1],r[1]]]}function IP(e,t){if(t.length>1)return("e"===(i=[IP(e,(t=t.split(""))[0]),IP(e,t[1])])[0]||"w"===i[0])&&i.reverse(),i.join("");var i=ac.transformDirection({w:"left",e:"right",n:"top",s:"bottom"}[t],function(e){return ac.getTransform(e.group)}(e));return{left:"w",right:"e",top:"n",bottom:"s"}[i]}function AP(e,t,i,n,a,r,o,s){var l=n.__brushOption,u=e(l.range),h=CP(i,r,o);XL(a.split(""),(function(e){var t=nP[e];u[t[0]][t[1]]+=h[t[0]]})),l.range=t(MP(u[0][0],u[1][0],u[0][1],u[1][1])),dP(i,n),vP(i,{isEnd:!1})}function TP(e,t,i,n,a){var r=t.__brushOption.range,o=CP(e,i,n);XL(r,(function(e){e[0]+=o[0],e[1]+=o[1]})),dP(e,t),vP(e,{isEnd:!1})}function CP(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 DP(e,t,i){var n=gP(e,t);return n&&!0!==n?n.clipPath(i,e._transform):He.clone(i)}function LP(e){var t=e.event;t.preventDefault&&t.preventDefault()}function PP(e,t,i){return e.childOfName("main").contain(t,i)}function kP(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 JL(a*a+r*r,.5)>eP}(e)||r){if(o&&!r){"single"===s.brushMode&&mP(e);var l=He.clone(s);l.brushType=OP(l.brushType,o),l.panelId=!0===o?null:o.panelId,r=e._creatingCover=lP(e,l),e._covers.push(r)}if(r){var u=NP[OP(e._brushType,o)];r.__brushOption.range=u.getCreatingRange(DP(e,r,e._track)),n&&(uP(e,r),u.updateCommon(e,r)),hP(e,r),a={isEnd:n}}}else n&&"single"===s.brushMode&&s.removeOnClick&&fP(e,t,i)&&mP(e)&&(a={isEnd:n,removeOnClick:!0});return a}function OP(e,t){return"auto"===e?t.defaultBrushType:e}sP.prototype={constructor:sP,enableBrush:function(e){var t,i;return this._brushType&&(i=(t=this)._zr,FI.release(i,iP,t._uid),function(e,t){XL(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||FI.take(i,iP,e._uid);(function(e,t){XL(t,(function(t,i){e.on(i,t)}))})(i,e._handlers),e._brushType=t.brushType,e._brushOption=He.merge(He.clone(rP),t,!0)}(this,e),this},setPanels:function(e){if(e&&e.length){var t=this._panels={};He.each(e,(function(e){t[e.panelId]=He.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){XL(this._covers,e,t)},updateCovers:function(e){e=He.map(e,(function(e){return He.merge(He.clone(rP),e,!0)}));var t="\0-brush-index-",i=this._covers,n=this._covers=[],a=this,r=this._creatingCover;return new av(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]):uP(a,lP(a,s));dP(a,l)}}},unmount:function(){return this.enableBrush(!1),mP(this),this._zr.remove(this.group),this},dispose:function(){this.unmount(),this.off()}},He.mixin(sP,yt);var RP={mousedown:function(e){if(this._dragging)EP(this,e);else if(!e.target||!e.target.draggable){LP(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=fP(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=fP(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)&&NP[s.brushType].contain(a[o],i[0],i[1]))return}r&&n.setCursorStyle("crosshair")}}(this,e,n),this._dragging){LP(e);var a=kP(this,e,n,!1);a&&vP(this,a)}},mouseup:function(e){EP(this,e)}};function EP(e,t){if(e._dragging){LP(t);var i=t.offsetX,n=t.offsetY,a=e.group.transformCoordToLocal(i,n),r=kP(e,t,a,!0);e._dragging=!1,e._track=[],e._creatingCover=null,r&&vP(e,r)}}var NP={lineX:zP(0),lineY:zP(1),rect:{createCover:function(e,t){return xP(YL(AP,(function(e){return e}),(function(e){return e})),e,t,["w","e","n","s","se","sw","ne","nw"])},getCreatingRange:function(e){var t=yP(e);return MP(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,i,n){_P(e,t,i,n)},updateCommon:bP,contain:PP},polygon:{createCover:function(e,t){var i=new ac.Group;return i.add(new ac.Polyline({name:"main",style:SP(t),silent:!0})),i},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new ac.Polygon({name:"main",draggable:!0,drift:YL(TP,e,t),ondragend:YL(vP,e,{isEnd:!0})}))},updateCoverShape:function(e,t,i,n){t.childAt(0).setShape({points:DP(e,t,i)})},updateCommon:bP,contain:PP}};function zP(e){return{createCover:function(t,i){return xP(YL(AP,(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=yP(t);return[$L(i[0][e],i[1][e]),KL(i[0][e],i[1][e])]},updateCoverShape:function(t,i,n,a){var r,o=gP(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(),_P(t,i,l,a)},updateCommon:bP,contain:PP}}var BP=sP,VP=iA.onIrrelevantElement;function GP(e){return Rn.create(e)}var FP=function(e,t){return e=GP(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)]}},HP={makeRectPanelClipPath:function(e){return e=GP(e),function(t,i){return ac.clipPointsByRect(t,e)}},makeLinearBrushOtherExtent:FP,makeRectIsTargetByCursor:function(e,t,i){return e=GP(e),function(n,a,r){return e.contain(a[0],a[1])&&!VP(n,t,i)}}},WP=["axisLine","axisTickLabel","axisName"],UP=K_.extendComponentView({type:"parallelAxis",init:function(e,t){UP.superApply(this,"init",arguments),(this._brushController=new BP(t.getZr())).on("brush",He.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 ac.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=He.extend({strokeContainThreshold:l},h),d=new fS(e,c);He.each(WP,d.add,d),this._axisGroup.add(d.getGroup()),this._refreshBrushController(c,s,e,r,l,i);var p=n&&!1===n.animation?null:e;ac.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=ac.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:HP.makeRectPanelClipPath(u),isTargetByCursor:HP.makeRectIsTargetByCursor(u,r,n),getLinearBrushOtherExtent:HP.makeLinearBrushOtherExtent(u,0)}]).enableBrush({brushType:"lineX",brushStyle:t,removeOnClick:!0}).updateCovers(function(e){var t=e.axis;return He.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=He.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()}});K_.extendComponentView({type:"parallel",render:function(e,t,i){this._model=e,this._api=i,this._handlers||(this._handlers={},He.each(jP,(function(e,t){i.getZr().on(t,this._handlers[t]=He.bind(e,this))}),this)),Pg.createOrUpdate(this,"_throttledDispatchExpand",e.get("axisExpandRate"),"fixRate")},dispose:function(e,t){He.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(He.extend({type:"parallelAxisExpand"},e))}});var jP={mousedown:function(e){ZP(this,"click")&&(this._mouseDownPoint=[e.offsetX,e.offsetY])},mouseup:function(e){var t=this._mouseDownPoint;if(ZP(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&&ZP(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 ZP(e,t){var i=e._model;return i.get("axisExpandable")&&i.get("axisExpandTriggerOn")===t}K_.registerPreprocessor(CL);var YP=He.each,XP=He.createHashMap;ug.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=XP();YP(i.dimensions,(function(e){var t=+e.replace("dim","");n.set(e,t)}))}(i,this),my(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 qP(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 $P(e,t,i,n,a){var r=qP(e,i,n,a),o=new ac.Polyline({shape:{points:r},silent:!0,z2:10});return t.add(o),e.setItemGraphicEl(i,o),o}function KP(e){var t=e.get("smooth",!0);return!0===t&&(t=.3),{lineStyle:e.getModel("lineStyle").getLineStyle(),smooth:null!=t?t:.3}}function JP(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)}Ag.extend({type:"parallel",init:function(){this._dataGroup=new ac.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=KP(e);if(r.diff(o).add((function(e){var t=$P(r,a,e,l,s);JP(t,r,e,u)})).update((function(t,i){var a=o.getItemGraphicEl(i),h=qP(r,t,l,s);r.setItemGraphicEl(t,a);var c=n&&!1===n.animation?null:e;ac.updateProps(a,{shape:{points:h}},c,t),JP(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 ac.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),ac.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=KP(t),s=e.start;s<e.end;s++){var l=$P(n,this._dataGroup,s,r,a);l.incremental=!0,JP(l,n,s,o)}},dispose:function(){},remove:function(){this._dataGroup&&this._dataGroup.removeAll(),this._data=null}});var QP=["lineStyle","normal","opacity"],ek={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(QP,!0);null!=a&&(n=a)}t.setItemVisual(i,"opacity",n)}),e.start,e.end)}}}},tk=ek;K_.registerVisual(tk);var ik=Yc.encodeHTML,nk=ug.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 xc(a[o],this,t));if(n&&i){var s=qC(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),ik(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 ik(r)}return nk.superCall(this,"formatTooltip",e,t)},optionUpdated:function(){var e=this.option;!0===e.focusNodeAdjacency&&(e.focusNodeAdjacency="allEdges")},getDataParams:function(e,t){var i=nk.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}}),ak=["itemStyle","opacity"],rk=["emphasis","itemStyle","opacity"],ok=["lineStyle","opacity"],sk=["emphasis","lineStyle","opacity"];function lk(e,t){return e.getVisual("opacity")||e.getModel().get(t)}function uk(e,t,i){var n=e.getGraphicEl(),a=lk(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 hk(e,t){var i=lk(e,t),n=e.getGraphicEl();n.traverse((function(e){"group"!==e.type&&e.setStyle("opacity",i)})),n.highlight&&n.highlight()}var ck=ac.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")}});K_.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 ck;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"),A=t.getLayout();switch(i.shape.extent=Math.max(1,A.dy),i.shape.orient=c,"vertical"===c?(n=(null!=_?_*s:y.x)+A.sy,a=(null!=b?b*l:y.y)+y.dy,o=(null!=M?M*s:w.x)+A.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)+A.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)+A.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")}ac.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 ac.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();ac.setLabelStyle(d.style,p,h,c,{labelFetcher:e,labelDataIndex:t.dataIndex,defaultText:t.id,isRectText:!0}),d.setStyle("fill",t.getVisual("color")),ac.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 ac.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return ac.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){uk(e,ak,.1)})),r.eachEdge((function(e){uk(e,ok,.1)})),u){hk(u,rk);var c=s.get("focusNodeAdjacency");"outEdges"===c?He.each(u.outEdges,(function(e){e.dataIndex<0||(hk(e,sk),hk(e.node2,rk))})):"inEdges"===c?He.each(u.inEdges,(function(e){e.dataIndex<0||(hk(e,sk),hk(e.node1,rk))})):"allEdges"===c&&He.each(u.edges,(function(e){e.dataIndex<0||(hk(e,sk),e.node1!==u&&hk(e.node1,rk),e.node2!==u&&hk(e.node2,rk))}))}h&&(hk(h,sk),hk(h.node1,rk),hk(h.node2,rk))}},unfocusNodeAdjacency:function(e,t,i,n){var a=e.getGraph();a.eachNode((function(e){uk(e,ak)})),a.eachEdge((function(e){uk(e,ok)}))}}),K_.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 dk=zo.groupData;function pk(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return null!=t.depth&&t.depth>=0}function fk(e,t,i,n,a){var r="vertical"===a?"x":"y";He.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 gk(e,t,i){He.each(e.slice().reverse(),(function(e){He.each(e,(function(e){if(e.outEdges.length){var n=wk(e.outEdges,mk,i)/wk(e.outEdges,bk,i);if(isNaN(n)){var a=e.outEdges.length;n=a?wk(e.outEdges,vk,i)/a:0}if("vertical"===i){var r=e.getLayout().x+(n-_k(e,i))*t;e.setLayout({x:r},!0)}else{var o=e.getLayout().y+(n-_k(e,i))*t;e.setLayout({y:o},!0)}}}))}))}function mk(e,t){return _k(e.node2,t)*e.getValue()}function vk(e,t){return _k(e.node2,t)}function yk(e,t){return _k(e.node1,t)*e.getValue()}function xk(e,t){return _k(e.node1,t)}function _k(e,t){return"vertical"===t?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function bk(e){return e.getValue()}function wk(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 Sk(e,t,i){He.each(e,(function(e){He.each(e,(function(e){if(e.inEdges.length){var n=wk(e.inEdges,yk,i)/wk(e.inEdges,bk,i);if(isNaN(n)){var a=e.inEdges.length;n=a?wk(e.inEdges,xk,i)/a:0}if("vertical"===i){var r=e.getLayout().x+(n-_k(e,i))*t;e.setLayout({x:r},!0)}else{var o=e.getLayout().y+(n-_k(e,i))*t;e.setLayout({y:o},!0)}}}))}))}var Mk=function(e,t,i){e.eachSeriesByType("sankey",(function(e){var i=e.get("nodeWidth"),n=e.get("nodeGap"),a=function(e,t){return od.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){He.each(e,(function(e){var t=wk(e.outEdges,bk),i=wk(e.inEdges,bk),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}He.each(e,(function(e){pk(e)||e.setLayout({depth:Math.max(0,n-e.getLayout().skNodeHeight)},!0)}))}else"justify"===t&&function(e,t){He.each(e,(function(e){pk(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){He.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=dk(e,(function(e){return e.getLayout()[n]}));return a.keys.sort((function(e,t){return e-t})),He.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;He.each(e,(function(e){var t=e.length,s=0;He.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)})),He.each(e,(function(e){He.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))}))})),He.each(t,(function(e){var t=+e.getValue()*o;e.setLayout({dy:t},!0)}))})(s,t,i,n,a,o),fk(s,a,i,n,o);for(var l=1;r>0;r--)gk(s,l*=.99,o),fk(s,a,i,n,o),Sk(s,l,o),fk(s,a,i,n,o)}(e,t,r,a,n,o,s),function(e,t){var i="vertical"===t?"x":"y";He.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]}))})),He.each(e,(function(e){var t=0,i=0;He.each(e.outEdges,(function(e){e.setLayout({sy:t},!0),t+=e.getLayout().dy})),He.each(e.inEdges,(function(e){e.setLayout({ty:i},!0),i+=e.getLayout().dy}))}))}(e,s)}(l,u,i,n,r,o,0!==He.filter(l,(function(e){return 0===e.getLayout().value})).length?0:e.get("layoutIterations"),e.get("orient"),e.get("nodeAlign"))}))};var Ik=function(e,t){e.eachSeriesByType("sankey",(function(e){var t=e.getGraph().nodes;if(t.length){var i=1/0,n=-1/0;He.each(t,(function(e){var t=e.getLayout().value;t<i&&(i=t),t>n&&(n=t)})),He.each(t,(function(t){var a=new mC({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)}))}}))};K_.registerLayout(Mk),K_.registerVisual(Ik);var Ak=uv.getDimensionTypeByAxis,Tk=ap.makeSeriesEncodeForAxisCoordSys,Ck={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=[];He.each(g,(function(e,t){var i;e.value&&He.isArray(e.value)?(i=e.value.slice(),e.value.unshift(t)):He.isArray(e)?(i=e.slice(),e.unshift(t)):i=e,m.push(i)})),e.data=m}var v=this.defaultValueDimensions,y=[{name:h,type:Ak(p),ordinalMeta:i,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:c,type:Ak(f),dimsDef:v.slice()}];return gM(this,{coordDimensions:y,dimensionsCount:v.length+1,encodeDefaulter:He.curry(Tk,y,this)})},getBaseAxis:function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis}}},Dk=Ck.seriesModelMixin,Lk=ug.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}});He.mixin(Lk,Dk,!0);var Pk=["itemStyle"],kk=["emphasis","itemStyle"];Ag.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=Rk(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?Ek(s,i,n,e):i=Rk(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:He.noop});var Ok=Ml.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 Rk(e,t,i,n,a){var r=e.ends,o=new Ok({shape:{points:a?Nk(r,n,e):r}});return Ek(e,o,t,i,a),o}function Ek(e,t,i,n,a){var r=i.hostModel;(0,ac[a?"initProps":"updateProps"])(t,{shape:{points:e.ends}},r,n);var o=i.getItemModel(n),s=o.getModel(Pk),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(kk).getItemStyle();ac.setHoverStyle(t,h)}function Nk(e,t,i){return He.map(e,(function(e){return(e=e.slice())[t]=i.initBaseline,e}))}var zk=["itemStyle","borderColor"];var Bk=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(zk)||n}),e.isSeriesFiltered(t)||a.each((function(e){var t=a.getItemModel(e);a.setItemVisual(e,{color:t.get(zk,!0)})}))}))},Vk=Rc.parsePercent,Gk=He.each;var Fk=function(e){var t=function(e){var t=[],i=[];return e.eachSeriesByType("boxplot",(function(e){var n=e.getBaseAxis(),a=He.indexOf(i,n);a<0&&(a=i.length,i[a]=n,t[a]={axis:n,seriesModels:[]}),t[a].seriesModels.push(e)})),t}(e);Gk(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;Gk(a,(function(e){u=Math.max(u,e.getData().count())})),t=n.getExtent(),Math.abs(t[1]-t[0])}Gk(a,(function(e){var t=e.get("boxWidth");He.isArray(t)||(t=[t,t]),l.push([Vk(t[0],i)||0,Vk(t[1],i)||0])}));var h=.8*i-2,c=h/r*.3,d=(h-c*(r-1))/r,p=d/2-h/2;Gk(a,(function(e,t){s.push(p),p+=c+d,o.push(Math.min(Math.max(d,l[t][0]),l[t][1]))}))}(e),Gk(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])})))}))};K_.registerVisual(Bk),K_.registerLayout(Fk);var Hk=Ck.seriesModelMixin,Wk=ug.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)}});He.mixin(Wk,Hk,!0);var Uk=Zb.createClipPath,jk=["itemStyle"],Zk=["emphasis","itemStyle"],Yk=["color","color0","borderColor","borderColor0"];Ag.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&&$k(s,l))return;o=qk(l,i,!0),ac.initProps(o,{shape:{points:l.ends}},e,i),Kk(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&&$k(s,h)?n.remove(u):(u?ac.updateProps(u,{shape:{points:h.ends}},e,o):u=qk(h),Kk(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(),eO(e,this.group);var t=e.get("clip",!0)?Uk(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;Kk(r=qk(n.getItemLayout(i)),n,i,a),r.incremental=!0,this.group.add(r)}},_incrementalRenderLarge:function(e,t){eO(t,this.group,!0)},remove:function(e){this._clear()},_clear:function(){this.group.removeAll(),this._data=null},dispose:He.noop});var Xk=Ml.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 qk(e,t,i){var n=e.ends;return new Xk({shape:{points:i?Jk(n,e):n},z2:100})}function $k(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 Kk(e,t,i,n){var a=t.getItemModel(i),r=a.getModel(jk),o=t.getItemVisual(i,"color"),s=t.getItemVisual(i,"borderColor")||o,l=r.getItemStyle(Yk);e.useStyle(l),e.style.strokeNoScale=!0,e.style.fill=o,e.style.stroke=s,e.__simpleBox=n;var u=a.getModel(Zk).getItemStyle();ac.setHoverStyle(e,u)}function Jk(e,t){return He.map(e,(function(e){return(e=e.slice())[1]=t.initBaseline,e}))}var Qk=Ml.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 eO(e,t,i){var n=e.getData(),a=n.getLayout("largePoints"),r=new Qk({shape:{points:a},__sign:1});t.add(r);var o=new Qk({shape:{points:a},__sign:-1});t.add(o),tO(1,r,e,n),tO(-1,o,e,n),i&&(r.incremental=!0,o.incremental=!0)}function tO(e,t,i,n){var a=e>0?"P":"N",r=n.getVisual("borderColor"+a)||n.getVisual("color"+a),o=i.getModel(jk).getItemStyle(Yk);t.useStyle(o),t.style.fill=null,t.style.stroke=r}var iO=function(e){e&&He.isArray(e.series)&&He.each(e.series,(function(e){He.isObject(e)&&"k"===e.type&&(e.type="candlestick")}))},nO=["itemStyle","borderColor"],aO=["itemStyle","borderColor0"],rO=["itemStyle","color"],oO=["itemStyle","color0"],sO={seriesType:"candlestick",plan:fg(),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?rO:oO)}function n(e,t){return t.get(e>0?nO:aO)}}},lO=sO,uO=ac.subPixelOptimize,hO=Rc.parsePercent,cO=He.retrieve2,dO="undefined"!=typeof Float32Array?Float32Array:Array,pO={seriesType:"candlestick",plan:fg(),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=hO(cO(e.get("barMaxWidth"),a),a),o=hO(cO(e.get("barMinWidth"),1),a),s=e.get("barWidth");return null!=s?hO(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 dO(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++]=fO(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:fO(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]=uO(a[0]+n/2,1,!1),r[0]=uO(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]=uO(e[0],1),e}}}}};function fO(e,t,i,n,a){return i>n?-1:i<n?1:t>0?e.get(a,t-1)<=n?1:-1:1}var gO=pO;K_.registerPreprocessor(iO),K_.registerVisual(lO),K_.registerLayout(gO),ug.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(e,t){return my(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 mO=Xx.createSymbol,vO=ac.Group,yO=Rc.parsePercent;function xO(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 _O(e,t){vO.call(this);var i=new fb(e,t),n=new vO;this.add(i),this.add(n),n.beforeUpdate=function(){this.attr(i.getScale())},this.updateData(e,t)}var bO=_O.prototype;bO.stopEffectAnimation=function(){this.childAt(1).removeAll()},bO.startEffectAnimation=function(e){for(var t=e.symbolType,i=e.color,n=this.childAt(1),a=0;a<3;a++){var r=mO(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)}xO(n,e)},bO.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)}xO(i,e)},bO.highlight=function(){this.trigger("emphasis")},bO.downplay=function(){this.trigger("normal")},bO.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 He.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]=yO(l[0],o[0]),u[1]=yO(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},bO.fadeOut=function(e){this.off("mouseover").off("mouseout").off("emphasis").off("normal"),e&&e()},He.inherits(_O,vO);var wO=_O;K_.extendChartView({type:"effectScatter",init:function(){this._symbolDraw=new bb(wO)},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=hw().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=oi.clone(t.getRoamTransform()),this.group.decomposeTransform())},remove:function(e,t){this._symbolDraw&&this._symbolDraw.remove(t)},dispose:function(){}}),K_.registerVisual(sw("effectScatter","circle")),K_.registerLayout(hw("effectScatter"));var SO=He.concatArray,MO=He.mergeAll,IO=He.map,AO=Yc.encodeHTML,TO="undefined"==typeof Uint32Array?Array:Uint32Array,CO="undefined"==typeof Float64Array?Array:Float64Array;function DO(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=IO(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),MO([t,e[0],e[1]])})))}var LO=ug.extend({type:"series.lines",dependencies:["grid","polar"],visualColorAccessPath:"lineStyle.color",init:function(e){e.data=e.data||[],DO(e);var t=this._processFlatCoordsArray(e.data);this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset,t.flatCoords&&(e.data=new Float32Array(t.count)),LO.superApply(this,"init",arguments)},mergeOption:function(e){if(e.data=e.data||[],DO(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))}LO.superApply(this,"mergeOption",arguments)},appendData:function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=SO(this._flatCoords,t.flatCoords),this._flatCoordsOffset=SO(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 TO(i),a=new CO(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 zv(["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),AO(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}}}),PO=Xx.createSymbol;function kO(e,t,i){ac.Group.call(this),this.add(this.createLine(e,t,i)),this._updateEffectSymbol(e,t)}var OO=kO.prototype;OO.createLine=function(e,t,i){return new hD(e,t,i)},OO._updateEffectSymbol=function(e,t){var i=e.getItemModel(t).getModel("effect"),n=i.get("symbolSize"),a=i.get("symbol");He.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=PO(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))},OO._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=He.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}},OO.getLineLength=function(e){return ct.dist(e.__p1,e.__cp1)+ct.dist(e.__cp1,e.__p2)},OO.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]},OO.updateData=function(e,t,i){this.childAt(0).updateData(e,t,i),this._updateEffectSymbol(e,t)},OO.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=bs.quadraticAt,l=bs.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*ct.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*ct.dist(t,r);e.attr("scale",[e.scale[0],c])}else e.attr("scale",this._symbolScale);e.__lastT=e.__t,e.ignore=!1},OO.updateLayout=function(e,t){this.childAt(0).updateLayout(e,t);var i=e.getItemModel(t).getModel("effect");this._updateEffectAnimation(e,i,t)},He.inherits(kO,ac.Group);var RO=kO;function EO(e,t,i){ac.Group.call(this),this._createPolyline(e,t,i)}var NO=EO.prototype;NO._createPolyline=function(e,t,i){var n=e.getItemLayout(t),a=new ac.Polyline({shape:{points:n}});this.add(a),this._updateCommonStl(e,t,i)},NO.updateData=function(e,t,i){var n=e.hostModel,a=this.childAt(0),r={shape:{points:e.getItemLayout(t)}};ac.updateProps(a,r,n,t),this._updateCommonStl(e,t,i)},NO._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(He.defaults({strokeNoScale:!0,fill:"none",stroke:r},o)),n.hoverStyle=s,ac.setHoverStyle(this)},NO.updateLayout=function(e,t){this.childAt(0).setShape("points",e.getItemLayout(t))},He.inherits(EO,ac.Group);var zO=EO;function BO(e,t,i){RO.call(this,e,t,i),this._lastFrame=0,this._lastFramePercent=0}var VO=BO.prototype;VO.createLine=function(e,t,i){return new zO(e,t,i)},VO.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+=ct.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}},VO.getLineLength=function(e){return this._length},VO.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)}ct.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}},He.inherits(BO,RO);var GO=BO,FO=ac.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(Qs.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(il.containStroke(l,u,p,f,c,d))return r}else if(Qs.containStroke(l,u,c,d))return r;r++}return-1}});function HO(){this.group=new ac.Group}var WO=HO.prototype;WO.isPersistent=function(){return!this._incremental},WO.updateData=function(e){this.group.removeAll();var t=new FO({rectHover:!0,cursor:"default"});t.setShape({segs:e.getLayout("linesPoints")}),this._setCommon(t,e),this.group.add(t),this._incremental=null},WO.incrementalPrepareUpdate=function(e){this.group.removeAll(),this._clearIncremental(),e.count()>5e5?(this._incremental||(this._incremental=new Zu({silent:!0})),this.group.add(this._incremental)):this._incremental=null},WO.incrementalUpdate=function(e,t){var i=new FO;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))},WO.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},WO._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)})))},WO._clearIncremental=function(){var e=this._incremental;e&&e.clearDisplaybles()};var UO=HO,jO={seriesType:"lines",plan:fg(),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)}}}}},ZO=jO,YO=Zb.createClipPath;function XO(e){return e instanceof Array||(e=[e,e]),e}K_.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)&&YO(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=ZO.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 UO:new mD(a?n?GO:zO:n?RO:hD),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 qO="lineStyle.opacity".split("."),$O={seriesType:"lines",reset:function(e,t,i){var n=XO(e.get("symbol")),a=XO(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(qO)),{dataEach:r.hasItemOption?function(e,t){var i=e.getItemModel(t),n=XO(i.getShallow("symbol",!0)),a=XO(i.getShallow("symbolSize",!0)),r=i.get(qO);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}}};K_.registerLayout(ZO),K_.registerVisual($O),ug.extend({type:"series.heatmap",getInitialData:function(e,t){return my(this.getSource(),this,{generateCoord:"value"})},preventIncremental:function(){var e=Dp.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 KO(){var e=He.createCanvas();this.canvas=e,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}KO.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=He.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 JO=KO;K_.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 ac.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 ac.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 A=e.getRawValue(w),T="-";A&&null!=A[2]&&(T=A[2]),ac.setLabelStyle(m,v,y,x,{labelFetcher:e,labelDataIndex:w,defaultText:T,isRectText:!0}),S.setStyle(m),ac.setHoverStyle(S,c.hasItemOption?v:He.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 JO;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=He.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 ac.Image({style:{width:f,height:g,x:h,y:c,image:s.canvas},silent:!0});this.group.add(_)},dispose:function(){}});var QO=BS.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,QO.superApply(this,"getInitialData",arguments)}}),eR=Xx.createSymbol,tR=Rc.parsePercent,iR=Rc.isNumeric,nR=HS.setLabel,aR=["itemStyle","borderWidth"],rR=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],oR=new ac.Circle;function sR(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(He.isArray(s)){var c=[lR(l,s[0])-u,lR(l,s[1])-u];c[1]<c[0]&&c.reverse(),r=c[h]}else r=null!=s?lR(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");He.isArray(p)?p=p.slice():(null==p&&(p="100%"),p=[p,p]);p[c.index]=tR(p[c.index],d),p[h.index]=tR(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(aR)||0;r&&(oR.attr({scale:t.slice(),rotation:i}),oR.updateTransform(),r/=oR.getLineScale(),r*=t[n.valueDim.index]);a.valueLineWidth=r}(i,c.symbolScale,l,n,c);var d=c.symbolSize,p=i.get("symbolOffset");return He.isArray(p)&&(p=[tR(p[0],d[0]),tR(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=He.retrieve(e.get("symbolMargin"),"15%")+"",x=!1;y.lastIndexOf("!")===y.length-1&&(x=!0,y=y.slice(0,y.length-1)),y=tR(y,t[p.index]);var _=Math.max(g+2*y,0),b=x?0:2*y,w=iR(n),S=w?n:MR((v+b)/_);_=g+2*(y=(v-S*g)/2/(x?S:S-1)),b=x?0:2*y,w||"fixed"===n||(S=u?MR((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 A=c.bundlePosition=[];A[d.index]=i[d.xy],A[p.index]=i[p.xy];var T=c.barRectShape=He.extend({},i);T[p.wh]=f*Math.max(Math.abs(i[p.wh]),Math.abs(I[p.index]+M)),T[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 lR(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function uR(e){var t=e.symbolPatternSize,i=eR(e.symbolType,-t/2,-t/2,t,t,e.color);return i.attr({culling:!0}),"image"!==i.type&&i.setStyle({strokeNoScale:!0}),i}function hR(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(bR(e,(function(e){e.__pictorialAnimationIndex=h,e.__pictorialRepeatTimes=u,h<u?wR(e,null,f(h),i,n):wR(e,null,{scale:[0,0]},i,n,(function(){a.remove(e)})),vR(e,i),h++}));h<u;h++){var d=uR(i);d.__pictorialAnimationIndex=h,d.__pictorialRepeatTimes=u,a.add(d);var p=f(h);wR(d,{position:p.position,scale:[0,0]},{scale:p.scale,rotation:p.rotation},i,n),d.on("mouseover",g).on("mouseout",m),vR(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(){bR(e,(function(e){e.trigger("emphasis")}))}function m(){bR(e,(function(e){e.trigger("normal")}))}}function cR(e,t,i,n){var a=e.__pictorialBundle,r=e.__pictorialMainPath;r?wR(r,null,{position:i.pathPosition.slice(),scale:i.symbolScale.slice(),rotation:i.rotation},i,n):(r=e.__pictorialMainPath=uR(i),a.add(r),wR(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")}))),vR(r,i)}function dR(e,t,i){var n=He.extend({},t.barRectShape),a=e.__pictorialBarRect;a?wR(a,null,{shape:n},t,i):(a=e.__pictorialBarRect=new ac.Rect({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),e.add(a))}function pR(e,t,i,n){if(i.symbolClip){var a=e.__pictorialClipPath,r=He.extend({},i.clipShape),o=t.valueDim,s=i.animationModel,l=i.dataIndex;if(a)ac.updateProps(a,{shape:r},s,l);else{r[o.wh]=0,a=new ac.Rect({shape:r}),e.__pictorialBundle.setClipPath(a),e.__pictorialClipPath=a;var u={};u[o.wh]=i.clipShape[o.wh],ac[n?"updateProps":"initProps"](a,{shape:u},s,l)}}}function fR(e,t){var i=e.getItemModel(t);return i.getAnimationDelayParams=gR,i.isAnimationEnabled=mR,i}function gR(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function mR(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function vR(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 yR(e,t,i,n){var a=new ac.Group,r=new ac.Group;return a.add(r),a.__pictorialBundle=r,r.attr("position",i.bundlePosition.slice()),i.symbolRepeat?hR(a,t,i):cR(a,0,i),dR(a,i,n),pR(a,t,i,n),a.__pictorialShapeStr=_R(e,i),a.__pictorialSymbolMeta=i,a}function xR(e,t,i,n){var a=n.__pictorialBarRect;a&&(a.style.text=null);var r=[];bR(n,(function(e){r.push(e)})),n.__pictorialMainPath&&r.push(n.__pictorialMainPath),n.__pictorialClipPath&&(i=null),He.each(r,(function(e){ac.updateProps(e,{scale:[0,0]},i,t,(function(){n.parent&&n.parent.remove(n)}))})),e.setItemGraphicEl(t,null)}function _R(e,t){return[e.getItemVisual(t.dataIndex,"symbol")||"none",!!t.symbolRepeat,!!t.symbolClip].join(":")}function bR(e,t,i){He.each(e.__pictorialBundle.children(),(function(n){n!==e.__pictorialBarRect&&t.call(i,n)}))}function wR(e,t,i,n,a,r){t&&e.attr(t),n.symbolClip&&!a?i&&e.attr(i):i&&ac[a?"updateProps":"initProps"](e,i,n.animationModel,n.dataIndex,r)}function SR(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");bR(e,(function(e){e.setColor(n),e.setStyle(He.defaults({fill:n,opacity:i.opacity},o)),ac.setHoverStyle(e,s),l&&(e.cursor=l),e.z2=i.z2}));var u={},h=t.valueDim.posDesc[+(i.boundingLength>0)],c=e.__pictorialBarRect;nR(c.style,u,r,n,t.seriesModel,a,h),ac.setHoverStyle(c,u)}function MR(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}K_.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:rR[+s],categoryDim:rR[1-s]};return a.diff(r).add((function(e){if(a.hasValue(e)){var t=fR(a,e),i=sR(a,e,t,u),r=yR(a,u,i);a.setItemGraphicEl(e,r),n.add(r),SR(r,u,i)}})).update((function(e,t){var i=r.getItemGraphicEl(t);if(a.hasValue(e)){var o=fR(a,e),s=sR(a,e,o,u),l=_R(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;ac.updateProps(r,{position:i.bundlePosition.slice()},n,a),i.symbolRepeat?hR(e,t,i,!0):cR(e,t,i,!0);dR(e,i,!0),pR(e,t,i,!0)}(i,u,s):i=yR(a,u,s,!0),a.setItemGraphicEl(e,i),i.__pictorialSymbolMeta=s,n.add(i),SR(i,u,s)}else n.remove(i)})).remove((function(e){var t=r.getItemGraphicEl(e);t&&xR(r,e,t.__pictorialSymbolMeta.animationModel,t)})).execute(),this._data=a,this.group},dispose:He.noop,remove:function(e,t){var i=this.group,n=this._data;e.get("animation")?n&&n.eachItemGraphicEl((function(t){xR(n,t.dataIndex,e,t)})):i.removeAll()}});var IR=ex.layout;K_.registerLayout(He.curry(IR,"pictorialBar")),K_.registerVisual(sw("pictorialBar","roundRect"));var AR=function(e,t,i,n,a){O_.call(this,e,t,i),this.type=n||"value",this.position=a||"bottom",this.orient=null};AR.prototype={constructor:AR,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},He.inherits(AR,O_);var TR=AR,CR=od.getLayoutRect,DR=He.each;function LR(e,t,i){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(e,t,i),this.model=e}LR.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:LR,_init:function(e,t,i){var n=this.dimension,a=new TR(n,Rx.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();DR(t.mapDimension(this.dimension,!0),(function(e){this._axis.scale.unionExtentFromData(t,e)}),this),Rx.niceScaleExtent(this._axis.scale,this._axis.model)}}),this)},resize:function(e,t){this._rect=CR({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 PR=LR;Dp.register("single",{create:function(e,t){var i=[];return e.eachComponent("singleAxis",(function(n,a){var r=new PR(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:PR.prototype.dimensions});var kR=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),He.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},OR={layout:kR},RR=kS.rectCoordAxisBuildSplitArea,ER=kS.rectCoordAxisHandleRemove,NR=["axisLine","axisTickLabel","axisName"],zR=["splitArea","splitLine"],BR=CS.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(e,t,i,n){var a=this.group;a.removeAll();var r=this._axisGroup;this._axisGroup=new ac.Group;var o=OR.layout(e),s=new fS(e,o);He.each(NR,s.add,s),a.add(this._axisGroup),a.add(s.getGroup()),He.each(zR,(function(t){e.get(t+".show")&&this["_"+t](e)}),this),ac.groupTransition(r,this._axisGroup,e),BR.superCall(this,"render",e,t,i,n)},remove:function(){ER(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 ac.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(ac.mergePath(l[p],{style:{stroke:r[p%r.length],lineDash:n.getLineDash(a),lineWidth:a},silent:!0}))}},_splitArea:function(e){RR(this,this._axisGroup,e,e)}}),VR=dd.extend({type:"singleAxis",layoutMode:"box",axis:null,coordinateSystem:null,getCoordSysModel:function(){return this}});He.merge(VR.prototype,Nx),Tw("single",VR,(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 GR=function(e,t){var i,n=[],a=e.seriesIndex;if(null==a||!(i=t.getSeriesByIndex(a)))return{point:[]};var r=i.getData(),o=zo.queryDataIndex(r,e);if(null==o||o<0||He.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(He.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}},FR=zo.makeInner,HR=He.each,WR=He.curry,UR=FR();function jR(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 HR(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),HR(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&&He.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 ZR(e,t,i,n){e[t.key]={value:i,payloadBatch:n}}function YR(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=SS.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 XR(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 qR(e){return!e||null==e[0]||isNaN(e[0])||null==e[1]||isNaN(e[1])}var $R=function(e,t,i){var n=e.currTrigger,a=[e.x,e.y],r=e,o=e.dispatchAction||He.bind(i.dispatchAction,i),s=t.getComponent("axisPointer").coordSysAxesInfo;if(s){qR(a)&&(a=GR({seriesIndex:r.seriesIndex,dataIndex:r.dataIndex},t).point);var l=qR(a),u=r.axesInfo,h=s.axesInfo,c="leave"===n||qR(a),d={},p={},f={list:[],map:{}},g={showPointer:WR(ZR,p),showTooltip:WR(YR,f)};HR(s.coordSysMap,(function(e,t){var i=l||e.containPoint(a);HR(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&&jR(e,o,g,!1,d)}}))}));var m={};return HR(h,(function(e,t){var i=e.linkGroup;i&&!p[t]&&HR(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,XR(t),XR(e)))),m[e.key]=r}}))})),HR(m,(function(e,t){jR(h[t],e,g,!0,d)})),function(e,t,i){var n=i.axesInfo=[];HR(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(qR(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=UR(n)[a]||{},o=UR(n)[a]={};HR(e,(function(e,t){var i=e.axisPointerModel.option;"show"===i.status&&HR(i.seriesDataIndices,(function(e){var t=e.seriesIndex+" | "+e.dataIndex;o[t]=e}))}));var s=[],l=[];He.each(r,(function(e,t){!o[t]&&l.push(e)})),He.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}};K_.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 KR=(0,zo.makeInner)(),JR=He.each;function QR(e,t,i){e.handler("leave",null,i)}function eE(e,t,i,n){t.handler(e,i,n)}var tE=function(e,t,i){if(!re.node){var n=t.getZr();KR(n).records||(KR(n).records={}),function(e,t){if(KR(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);JR(KR(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)}))}KR(e).initialized=!0,i("click",He.curry(eE,"click")),i("mousemove",He.curry(eE,"mousemove")),i("globalout",QR)}(n,t),(KR(n).records[e]||(KR(n).records[e]={})).handler=i}},iE={register:tE,unregister:function(e,t){if(!re.node){var i=t.getZr();(KR(i).records||{})[e]&&(KR(i).records[e]=null)}}},nE=K_.extendComponentView({type:"axisPointer",render:function(e,t,i){var n=t.getComponent("tooltip"),a=e.get("triggerOn")||n&&n.get("triggerOn")||"mousemove|click";iE.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){iE.unregister(t.getZr(),"axisPointer"),nE.superApply(this._model,"remove",arguments)},dispose:function(e,t){iE.unregister("axisPointer",t),nE.superApply(this._model,"dispose",arguments)}}),aE=(0,zo.makeInner)(),rE=He.clone,oE=He.bind;function sE(){}function lE(e,t,i,n){uE(aE(i).lastProp,n)||(aE(i).lastProp=n,t?ac.updateProps(i,n,e):(i.stopAnimation(),i.attr(n)))}function uE(e,t){if(He.isObject(e)&&He.isObject(t)){var i=!0;return He.each(t,(function(t,n){i=i&&uE(e[n],t)})),!!i}return e===t}function hE(e,t){e[t.get("label.show")?"show":"hide"]()}function cE(e){return{position:e.position.slice(),rotation:e.rotation||0}}function dE(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)}))}sE.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=He.curry(lE,t,h);this.updatePointerEl(o,l,c,t),this.updateLabelEl(o,l,c,t)}else o=this._group=new ac.Group,this.createPointerEl(o,l,e,t),this.createLabelEl(o,l,e,t),i.getZr().add(o);dE(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=SS.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=aE(e).pointerEl=new ac[a.type](rE(t.pointer));e.add(r)}},createLabelEl:function(e,t,i,n){if(t.label){var a=aE(e).labelEl=new ac.Rect(rE(t.label));e.add(a),hE(a,n)}},updatePointerEl:function(e,t,i){var n=aE(e).pointerEl;n&&t.pointer&&(n.setStyle(t.pointer.style),i(n,{shape:t.pointer.shape}))},updateLabelEl:function(e,t,i,n){var a=aE(e).labelEl;a&&(a.setStyle(t.label.style),i(a,{shape:t.label.shape,position:t.label.position}),hE(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=ac.createIcon(r.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(e){Bt.stop(e.event)},onmousedown:oE(this._onHandleDragMove,this,0,0),drift:oE(this._onHandleDragMove,this),ondragend:oE(this._onHandleDragEnd,this)}),n.add(a)),dE(a,i,!1);a.setStyle(r.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=r.get("size");He.isArray(s)||(s=[s,s]),a.attr("scale",[s[0]/2,s[1]/2]),Pg.createOrUpdate(this,"_doDispatchAxisPointer",r.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,t)}},_moveHandleToValue:function(e,t){lE(this._axisPointerModel,!t&&this._moveAnimation,this._handle,cE(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(e,t){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(cE(i),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(cE(n)),aE(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]}}},sE.prototype.constructor=sE,Zo.enableClassExtend(sE);var pE=sE;function fE(e,t,i,n,a){var r=gE(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=Yc.normalizeCssArray(o.get("padding")||0),l=o.getFont(),u=Za.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 gE(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:Rx.getAxisRawValue(t,e),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};He.each(n,(function(e){var t=i.getSeriesByIndex(e.seriesIndex),n=e.dataIndexInside,a=t&&t.getDataParams(n);a&&s.seriesData.push(a)})),He.isString(o)?r=o.replace("{value}",r):He.isFunction(o)&&(r=o(s))}return r}function mE(e,t,i){var n=oi.create();return oi.rotate(n,n,i.rotation),oi.translate(n,n,i.position),ac.applyTransform([e.dataToCoord(t),(i.labelOffset||0)+(i.labelDirection||1)*(i.labelMargin||0)],n)}var vE=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},yE={buildElStyle:vE,buildLabelElOption:fE,getValueLabel:gE,getTransformedPosition:mE,buildCartesianSingleLabelElOption:function(e,t,i,n,a,r){var o=fS.innerTextLayout(i.rotation,0,i.labelDirection);i.labelMargin=a.get("label.margin"),fE(t,n,a,r,{position:mE(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}}},xE=pE.extend({makeElOption:function(e,t,i,n,a){var r=i.axis,o=r.grid,s=n.get("type"),l=_E(o,r).getOtherAxis(r).getGlobalExtent(),u=r.toGlobalCoord(r.dataToCoord(t,!0));if(s&&"none"!==s){var h=yE.buildElStyle(n),c=bE[s](r,u,l);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=LS.layout(o.model,i);yE.buildCartesianSingleLabelElOption(t,e,d,i,n,a)},getHandleTransform:function(e,t,i){var n=LS.layout(t.axis.grid.model,t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:yE.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=_E(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 _E(e,t){var i={};return i[t.dim+"AxisIndex"]=t.index,e.getCartesian(i)}var bE={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:yE.makeLineShape([t,i[0]],[t,i[1]],wE(e))}},shadow:function(e,t,i){var n=Math.max(1,e.getBandWidth()),a=i[1]-i[0];return{type:"Rect",shape:yE.makeRectShape([t-n/2,i[0]],[n,a],wE(e))}}};function wE(e){return"x"===e.dim?0:1}CS.registerAxisPointerClass("CartesianAxisPointer",xE),K_.registerPreprocessor((function(e){if(e){(!e.axisPointer||0===e.axisPointer.length)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!He.isArray(t)&&(e.axisPointer.link=[t])}})),K_.registerProcessor(K_.PRIORITY.PROCESSOR.STATISTIC,(function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=SS.collect(e,t)})),K_.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},$R);var SE=["x","y"],ME=["width","height"],IE=pE.extend({makeElOption:function(e,t,i,n,a){var r=i.axis,o=r.coordinateSystem,s=CE(o,1-TE(r)),l=o.dataToPoint(t)[0],u=n.get("type");if(u&&"none"!==u){var h=yE.buildElStyle(n),c=AE[u](r,l,s);c.style=h,e.graphicKey=c.type,e.pointer=c}var d=OR.layout(i);yE.buildCartesianSingleLabelElOption(t,e,d,i,n,a)},getHandleTransform:function(e,t,i){var n=OR.layout(t,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:yE.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=TE(a),s=CE(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=CE(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"}}}}),AE={line:function(e,t,i){return{type:"Line",subPixelOptimize:!0,shape:yE.makeLineShape([t,i[0]],[t,i[1]],TE(e))}},shadow:function(e,t,i){var n=e.getBandWidth(),a=i[1]-i[0];return{type:"Rect",shape:yE.makeRectShape([t-n/2,i[0]],[n,a],TE(e))}}};function TE(e){return e.isHorizontal()?0:1}function CE(e,t){var i=e.getRect();return[i[SE[t]],i[SE[t]]+i[ME[t]]]}CS.registerAxisPointerClass("SingleAxisPointer",IE),K_.extendComponentView({type:"single"});var DE=uv.getDimensionTypeByAxis,LE=zo.groupData,PE=Yc.encodeHTML,kE=ug.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(e){kE.superApply(this,"init",arguments),this.legendVisualProvider=new vM(He.bind(this.getData,this),He.bind(this.getRawData,this))},fixData:function(e){var t=e.length,i=LE(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=He.filter(e.data,(function(e){return void 0!==e[2]})),a=this.fixData(n||[]),r=[],o=this.nameMap=He.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=Jv(a,{coordDimensions:["single"],dimensionsDefine:[{name:"time",type:DE(i)},{name:"value",type:"float"},{name:"name",type:"ordinal"}],encodeDefine:{single:0,value:1,itemName:2}}),h=new zv(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=LE(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){He.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="-"),PE(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}}}}),OE=Hb.Polygon,RE=He.bind,EE=He.extend;function NE(e,t,i){if(e.count())for(var n,a=t.coordinateSystem,r=t.getLayerSeries(),o=e.mapDimension("single"),s=e.mapDimension("value"),l=He.map(r,(function(t){return He.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})}}K_.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 av(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 ac.Group;u=new OE({shape:{points:d,stackedOnPoints:p,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),h=new ac.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 ac.Rect({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return ac.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,ac.updateProps(u,{shape:{points:d,stackedOnPoints:p}},e),ac.updateProps(h,{style:{x:_.x-S,y:_.y0+_.y/2}},e)}var I=b.getModel("emphasis.itemStyle"),A=b.getModel("itemStyle");ac.setTextStyle(h.style,w,{text:w.get("show")?e.getFormattedLabel(f[g-1],"normal")||n.getName(f[g-1]):null,textVerticalAlign:"middle"}),u.setStyle(EE({fill:l},A.getItemStyle(["color"]))),ac.setHoverStyle(u,I.getItemStyle())}else a.remove(s[i])}h.add(RE(d,this,"add")).update(RE(d,this,"update")).remove(RE(d,this,"remove")).execute(),this._layersSeries=r,this._layers=c},dispose:function(){}});var zE=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]=Rc.parsePercent(r[0],a.height),r[1]=Rc.parsePercent(r[1],a.height),NE(t,e,a.height-r[0]-r[1])):(r[0]=Rc.parsePercent(r[0],a.width),r[1]=Rc.parsePercent(r[1],a.width),NE(t,e,a.width-r[0]-r[1]));t.setLayout("layoutInfo",n)}))},BE=He.createHashMap;var VE=function(e){e.eachSeriesByType("themeRiver",(function(e){var t=e.getData(),i=e.getRawData(),n=e.get("color"),a=BE();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)}))}))};K_.registerLayout(zE),K_.registerVisual(VE),K_.registerProcessor(VM("themeRiver"));var GE=MT.wrapTreePathInfo;function FE(e){var t=0;He.each(e.children,(function(e){FE(e);var i=e.value;He.isArray(i)&&(i=i[0]),t+=i}));var i=e.value;He.isArray(i)&&(i=i[0]),(null==i||isNaN(i))&&(i=t),i<0&&(i=0),He.isArray(e.value)?e.value[0]=i:e.value=i}ug.extend({type:"series.sunburst",_viewRoot:null,getInitialData:function(e,t){var i={name:e.name,children:e.data};FE(i);var n=e.levels||[],a={};return a.levels=n,UA.createTree(i,this,a).data},optionUpdated:function(){this.resetViewRoot()},getDataParams:function(e){var t=ug.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(e);return t.treePathInfo=GE(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 HE="none",WE="ancestor",UE="self";function jE(e,t,i){ac.Group.call(this);var n=new ac.Sector({z2:2});n.seriesIndex=t.seriesIndex;var a=new ac.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 ZE=jE.prototype;ZE.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=He.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 He.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=He.merge(d,c)}h=He.defaults({lineJoin:"bevel",fill:h.fill||u},h),e?(r.setShape(l),r.shape.r=s.r0,ac.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?(ac.updateProps(r,{shape:l},n),r.useStyle(h)):ac.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,ac.setHoverStyle(this)},ZE.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)!==HE&&(r===UE?n===a:r===WE?n===a||n.isAncestorOf(a):n===a||n.isDescendantOf(a))?i.piece.childAt(0).trigger("highlight"):e!==HE&&i.piece.childAt(0).trigger("downplay")))}))},ZE.onNormal=function(){this.node.hostTree.root.eachNode((function(e){e.piece&&e.piece.updateData(!1,e,"normal")}))},ZE.onHighlight=function(){this.updateData(!1,this.node,"highlight")},ZE.onDownplay=function(){this.updateData(!1,this.node,"downplay")},ZE._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=He.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);ac.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)},ZE._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()}))},He.inherits(jE,ac.Group);var YE=jE,XE=Yc.windowOpen;Ag.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 YE(i,e,t);l.add(a),r.setItemGraphicEl(i.dataIndex,a)}}(null==a?null:i[a],null==s?null:n[s])}new av(n,i,a,a).add(s).update(s).remove(He.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 YE(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";XE(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 qE="sunburstRootToNode";K_.registerAction({type:qE,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=MT.retrieveTargetInfo(e,[qE],t);if(n){var a=t.getViewRoot();a&&(e.direction=MT.aboveViewRoot(a,n.node)?"rollUp":"drillDown"),t.resetViewRoot(n.node)}}))}));var $E="sunburstHighlight";K_.registerAction({type:$E,update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){var n=MT.retrieveTargetInfo(e,[$E],t);n&&(e.highlight=n.node)}))}));K_.registerAction({type:"sunburstUnhighlight",update:"updateView"},(function(e,t){t.eachComponent({mainType:"series",subType:"sunburst",query:e},(function(t,i){e.unhighlight=!0}))}));var KE=Rc.parsePercent,JE=Math.PI/180;function QE(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&&He.each(e.children,(function(e){QE(e,t)}))}var eN=function(e,t,i,n){t.eachSeriesByType(e,(function(e){var t=e.get("center"),n=e.get("radius");He.isArray(n)||(n=[0,n]),He.isArray(t)||(t=[t,t]);var a=i.getWidth(),r=i.getHeight(),o=Math.min(a,r),s=KE(t[0],a),l=KE(t[1],r),u=KE(n[0],o/2),h=KE(n[1],o/2),c=-e.get("startAngle")*JE,d=e.get("minAngle")*JE,p=e.getData().tree.root,f=e.getViewRoot(),g=f.depth,m=e.get("sort");null!=m&&QE(f,m);var v=0;He.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,A=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=KE(f.get("r0"),o/2)),null!=f.get("r")&&(c=KE(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;He.each(e.children,(function(e){m+=A(e,t+m)}))}return i-t}};if(_){var T=u,C=u+w,D=2*Math.PI;p.setLayout({angle:D,startAngle:c,endAngle:c+D,clockwise:S,cx:s,cy:l,r0:T,r:C})}A(f,c)}))};function tN(e,t){return t=t||[0,0],He.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)}K_.registerVisual(He.curry(CM,"sunburst")),K_.registerLayout(He.curry(eN,"sunburst")),K_.registerProcessor(He.curry(VM,"sunburst"));var iN=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:He.bind(tN,e)}}};function nN(e,t){return t=t||[0,0],He.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 aN=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:He.bind(nN,e)}}};function rN(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 oN=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:He.bind(rN,e)}}};function sN(e,t){return He.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 lN=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:He.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:He.bind(sN,e)}}};var uN=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)}}}},hN=eb.getDefaultLabel,cN=ex.getLayoutOnAxis,dN=Zb.createClipPath,pN=ac.CACHED_LABEL_STYLE_PROPERTIES,fN=["itemStyle"],gN=["emphasis","itemStyle"],mN=["label"],vN=["emphasis","label"],yN="e\0\0",xN={cartesian2d:iN,geo:aN,singleAxis:oN,polar:lN,calendar:uN};function _N(e,t,i,n,a){null==i[e]||a||(t[e]=i[e],i[e]=n[e])}function bN(e,t,i,n){var a=e.get("renderItem"),r=e.coordinateSystem,o={};r&&(o=r.prepareCustoms?r.prepareCustoms():xN[r.type](r));var s,l,u,h,c,d=He.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(fN).getItemStyle();null!=c&&(a.fill=c);var r=t.getItemVisual(n,"opacity");null!=r&&(a.opacity=r);var o=i?TN(i,u):u;return ac.setTextStyle(a,o,null,{autoColor:c,isRectText:!0}),a.text=o.getShallow("show")?He.retrieve2(e.getFormattedLabel(n,"normal"),hN(t,n)):null,i&&CN(a,i),a},styleEmphasis:function(i,n){null==n&&(n=s),g(n);var a=l.getModel(gN).getItemStyle(),r=i?TN(i,h):h;return ac.setTextStyle(a,r,null,{isRectText:!0},!0),a.text=r.getShallow("show")?He.retrieve3(e.getFormattedLabel(n,"emphasis"),e.getFormattedLabel(n,"normal"),hN(t,n)):null,i&&CN(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 cN(He.defaults({axis:t},e),n)}},currentSeriesIndices:function(){return i.getCurrentSeriesIndices()},font:function(e){return ac.getFont(e,i)}},o.api||{}),p={context:{},seriesId:e.id,seriesName:e.name,seriesIndex:e.seriesIndex,coordSys:o.coordSys,dataInsideLength:t.count(),encode:wN(e.getData())},f=!0;return function(e,i){return s=e,f=!0,a&&a(He.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(mN),h=l.getModel(vN),c=t.getItemVisual(e,"color"),f=!1)}}function wN(e){var t={};return He.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 SN(e,t,i,n,a,r){return(e=MN(e,t,i,n,a,r,!0))&&r.setItemGraphicEl(t,e),e}function MN(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")))&&LN(h)!==e.__customPathData||"image"===u&&PN(c,"image")&&c.image!==e.__customImagePath||"text"===u&&PN(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=LN(n);(t=ac.makePath(r,null,a,n.layout||"center")).__customPathData=r}else if("image"===i)(t=new ac.Image({})).__customImagePath=e.style.image;else if("text"===i)(t=new ac.Text({})).__customText=e.style.text;else if("group"===i)t=new ac.Group;else{if("compoundPath"===i)throw new Error('"compoundPath" is not supported yet.');t=new(ac.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=He.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={};He.each(["x","y","width","height"],(function(t){_N(t,u,l,e.style,r)}))}"text"===e.type&&i.style&&(u=s.style={},He.each(["x","y"],(function(t){_N(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),ac.initProps(e,{style:{opacity:h}},n,t)}r?e.attr(s):ac.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;ac.setElementHoverStyle(e,c),o&&ac.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 av(h.oldChildren,h.newChildren,IN,IN,h).add(AN).update(AN).remove(DN).execute();var h;u&&e.removeAll();for(var c=0;c<o;c++)r[c]&&MN(e.childAt(c),t,r[c],n,e,a)}(e,t,i,n,r),a.add(e),e}}function IN(e,t){var i=e&&e.name;return null!=i?i:yN+t}function AN(e,t){var i=this.context,n=null!=e?i.newChildren[e]:null;MN(null!=t?i.oldChildren[t]:null,i.dataIndex,n,i.animatableModel,i.group,i.data)}function TN(e,t){var i=new xc({},t);return He.each(pN,(function(t,n){e.hasOwnProperty(t)&&(i.option[n]=e[t])})),i}function CN(e,t){for(var i in t)!t.hasOwnProperty(i)&&pN.hasOwnProperty(i)||(e[i]=t[i])}function DN(e){var t=this.context,i=t.oldChildren[e];i&&t.group.remove(i)}function LN(e){return e&&(e.pathData||e.d)}function PN(e,t){return e&&e.hasOwnProperty(t)}ug.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 my(this.getSource(),this)},getDataParams:function(e,t,i){var n=ug.prototype.getDataParams.apply(this,arguments);return i&&(n.info=i.info),n}}),Ag.extend({type:"custom",_data:null,render:function(e,t,i,n){var a=this._data,r=e.getData(),o=this.group,s=bN(e,r,t,i);r.diff(a).add((function(t){SN(null,t,s(t,n),e,o,r)})).update((function(t,i){SN(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)?dN(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=bN(t,r,i,n);function s(e){e.isGroup||(e.incremental=!0,e.useHoverLayer=!0)}for(var l=e.start;l<e.end;l++){SN(null,l,o(l,a),t,this.group,r).traverse(s)}},dispose:He.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 kN=Rc.parsePercent,ON=ly.isDimensionStacked;function RN(e){return e.get("stack")||"__ec_stack_"+e.seriesIndex}function EN(e,t){return t.dim+e.model.componentIndex}var NN=function(e,t,i){var n={},a=function(e,t){var i={};He.each(e,(function(e,t){var n=e.getData(),a=e.coordinateSystem,r=a.getBaseAxis(),o=EN(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=RN(e);h[c]||u.autoWidthCount++,h[c]=h[c]||{width:0,maxWidth:0};var d=kN(e.get("barWidth"),l),p=kN(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 He.each(i,(function(e,t){n[t]={};var i=e.stacks,a=e.bandWidth,r=kN(e.categoryGap,a),o=kN(e.gap,1),s=e.remainedWidth,l=e.autoWidthCount,u=(s-r)/(l+(l-1)*o);u=Math.max(u,0),He.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;He.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;He.each(i,(function(e,i){n[t][i]=n[t][i]||{offset:d,width:e.width},d+=e.width*(1+o)}))})),n}(He.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=EN(i,r),s=RN(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=ON(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,A,T=t.get(m,b),C=t.get(v,b),D=T>=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(T)-_,k=r.dataToAngle(C);Math.abs(P)<f&&(P=(P<0?-1:1)*f),S=L,M=L+P,A=(I=k-u)-h,y&&(n[s][C][D]=M)}else{var O=c.dataToAngle(T,x)-_,R=r.dataToRadius(C);Math.abs(O)<g&&(O=(O<0?-1:1)*g),M=(S=R+u)+h,I=L,A=L+O,y&&(n[s][C][D]=A)}t.setItemLayout(b,{cx:d,cy:p,r0:S,r:M,startAngle:-I*Math.PI/180,endAngle:-A*Math.PI/180})}}}),this)},zN=NN;function BN(e,t){O_.call(this,"radius",e,t),this.type="category"}BN.prototype={constructor:BN,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToRadius:O_.prototype.dataToCoord,radiusToData:O_.prototype.coordToData},He.inherits(BN,O_);var VN=BN,GN=(0,zo.makeInner)();function FN(e,t){t=t||[0,360],O_.call(this,"angle",e,t),this.type="category"}FN.prototype={constructor:FN,pointToData:function(e,t){return this.polar.pointToData(e,t)["radius"===this.dim?0:1]},dataToAngle:O_.prototype.dataToCoord,angleToData:O_.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=Za.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=GN(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}},He.inherits(FN,O_);var HN=FN,WN=function(e){this.name=e||"",this.cx=0,this.cy=0,this._radiusAxis=new VN,this._angleAxis=new HN,this._radiusAxis.polar=this._angleAxis.polar=this};WN.prototype={type:"polar",axisPointerEnabled:!0,constructor:WN,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 UN=WN,jN=dd.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});He.merge(jN.prototype,Nx);var ZN={splitNumber:5};function YN(e,t){return t.type||(t.data?"category":"value")}Tw("angle",jN,YN,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),Tw("radius",jN,YN,ZN),K_.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 XN=Rc.parsePercent,qN=Rx.createScaleByModel,$N=Rx.niceScaleExtent,KN=ly.getStackedDimension;function JN(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();He.each(t.mapDimension("radius",!0),(function(e){a.scale.unionExtentFromData(t,KN(t,e))})),He.each(t.mapDimension("angle",!0),(function(e){n.scale.unionExtentFromData(t,KN(t,e))}))}})),$N(n.scale,n.model),$N(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 QN(e,t){if(e.type=t.get("type"),e.scale=qN(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 ez={dimensions:UN.prototype.dimensions,create:function(e,t){var i=[];return e.eachComponent("polar",(function(e,n){var a=new UN(n);a.update=JN;var r=a.getRadiusAxis(),o=a.getAngleAxis(),s=e.findAxisModel("radiusAxis"),l=e.findAxisModel("angleAxis");QN(r,s),QN(o,l),function(e,t,i){var n=t.get("center"),a=i.getWidth(),r=i.getHeight();e.cx=XN(n[0],a),e.cy=XN(n[1],r);var o=e.getRadiusAxis(),s=Math.min(a,r)/2,l=t.get("radius");null==l?l=[0,"100%"]:He.isArray(l)||(l=[0,l]),l=[XN(l[0],s),XN(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}};Dp.register("polar",ez);var tz=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function iz(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 nz(e){return e.getRadiusAxis().inverse?0:1}function az(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()}CS.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=He.map(i.getViewLabels(),(function(e){return(e=He.clone(e)).coord=i.dataToCoord(e.tickValue),e}));az(s),az(r),He.each(tz,(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=nz(t),l=s?0:1;(r=0===a[l]?new ac.Circle({shape:{cx:t.cx,cy:t.cy,r:a[s]},style:o.getLineStyle(),z2:1,silent:!0}):new ac.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[nz(t)],l=He.map(i,(function(e){return new ac.Line({shape:iz(t,[s,s+o],e.coord)})}));this.group.add(ac.mergePath(l,{style:He.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[nz(t)],u=[],h=0;h<n.length;h++)for(var c=0;c<n[h].length;c++)u.push(new ac.Line({shape:iz(t,[l,l+s],n[h][c].coord)}));this.group.add(ac.mergePath(u,{style:He.defaults(o.getModel("lineStyle").getLineStyle(),He.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");He.each(r,(function(i,n){var r=s,h=i.tickValue,c=a[nz(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 xc(o[h].textStyle,s,s.ecModel));var v=new ac.Text({silent:fS.isLabelSilent(e)});this.group.add(v),ac.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=fS.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 ac.Line({shape:iz(t,a,i[u].coord)}))}for(u=0;u<l.length;u++)this.group.add(ac.mergePath(l[u],{style:He.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 ac.Line({shape:iz(t,a,n[s][l].coord)}));this.group.add(ac.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 ac.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(ac.mergePath(l[f],{style:He.defaults({fill:o[f%o.length]},r.getAreaStyle()),silent:!0}))}}});var rz=["axisLine","axisTickLabel","axisName"],oz=["splitLine","splitArea","minorSplitLine"];CS.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 fS(e,u);He.each(rz,h.add,h),this.group.add(h.getGroup()),He.each(oz,(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 ac.Circle({shape:{cx:t.cx,cy:t.cy,r:a[u].coord}}))}for(u=0;u<l.length;u++)this.group.add(ac.mergePath(l[u],{style:He.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 ac.Circle({shape:{cx:t.cx,cy:t.cy,r:r[l][u].coord}}));this.group.add(ac.mergePath(s,{style:He.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 ac.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(ac.mergePath(l[h],{style:He.defaults({fill:o[h%o.length]},r.getAreaStyle()),silent:!0}))}}});var sz=pE.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"+Yc.capitalFirst(r.dim)](t);var u=n.get("type");if(u&&"none"!==u){var h=yE.buildElStyle(n),c=lz[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=oi.create();oi.rotate(d,d,s),oi.translate(d,d,[n.cx,n.cy]),l=ac.applyTransform([o,-a],d);var p=t.getModel("axisLabel").get("rotate")||0,f=fS.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"));yE.buildLabelElOption(e,i,n,a,d)}});var lz={line:function(e,t,i,n,a){return"angle"===e.dim?{type:"Line",shape:yE.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:yE.makeSectorShape(t.cx,t.cy,n[0],n[1],(-i-r/2)*o,(r/2-i)*o)}:{type:"Sector",shape:yE.makeSectorShape(t.cx,t.cy,i-r/2,i+r/2,0,2*Math.PI)}}};CS.registerAxisPointerClass("PolarAxisPointer",sz),K_.registerLayout(He.curry(zN,"bar")),K_.extendComponentView({type:"polar"});var uz=dd.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(e){dd.prototype.init.apply(this,arguments),zo.defaultEmphasis(e,"label",["show"])},optionUpdated:function(){var e=this.option,t=this;e.regions=TA.getFilledRegions(e.regions,e.map,e.nameMap),this._optionModelMap=He.reduce(e.regions||[],(function(e,i){return i.name&&e.set(i.name,new xc(i,t)),e}),He.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 xc(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 hz(e,t){t.update="updateView",K_.registerAction(t,(function(t,i){var n={};return i.eachComponent({mainType:"geo",query:t},(function(i){i[e](t.name);var a=i.coordinateSystem;He.each(a.regions,(function(e){n[e.name]=i.isSelected(e.name)||!1}))})),{selected:n,name:t.name}}))}He.mixin(uz,mM),K_.extendComponentView({type:"geo",init:function(e,t){var i=new lA(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()}}),hz("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),hz("select",{type:"geoSelect",event:"geoselected"}),hz("unSelect",{type:"geoUnSelect",event:"geounselected"});var cz=864e5;function dz(e,t,i){this._model=e}function pz(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}dz.prototype={constructor:dz,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=Rc.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];He.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=od.getLayoutRect(r,s);function u(e,t){return null!=e[t]&&"auto"!==e[t]}He.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){He.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+cz))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:He.curry(pz,"dataToPoint"),convertFromPixel:He.curry(pz,"pointToData"),_initRangeOption:function(){var e=this._model.get("range"),t=e;if(He.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/cz)-Math.floor(e[0].time/cz)+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)}},dz.dimensions=dz.prototype.dimensions,dz.getDimensionsInfo=dz.prototype.getDimensionsInfo,dz.create=function(e,t){var i=[];return e.eachComponent("calendar",(function(e){var t=new dz(e);i.push(t),e.coordinateSystem=t})),e.eachSeries((function(e){"calendar"===e.get("coordinateSystem")&&(e.coordinateSystem=i[e.get("calendarIndex")||0])})),i},Dp.register("calendar",dz);var fz=od.getLayoutParams,gz=od.sizeCalculable,mz=od.mergeLayoutParam,vz=dd.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=fz(e);vz.superApply(this,"init",arguments),yz(e,a)},mergeOption:function(e,t){vz.superApply(this,"mergeOption",arguments),yz(this.option,e)}});function yz(e,t){var i=e.cellSize;He.isArray(i)?1===i.length&&(i[1]=i[0]):i=e.cellSize=[i,i];var n=He.map([0,1],(function(e){return gz(t,e)&&(i[e]="auto"),null!=i[e]&&"auto"!==i[e]}));mz(e,t,{type:"box",ignoreSize:n})}var xz={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},_z={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};K_.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 ac.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 ac.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?Yc.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 ac.Text({z2:30});ac.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];He.isString(a)&&(a=xz[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 ac.Text({z2:30});He.extend(ac.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();He.isString(s)&&(s=_z[s.toUpperCase()]||[]);var h=r.getNextNDay(t.end.time,7-t.lweek).time,c=[r.getCellWidth(),r.getCellHeight()];l=Rc.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 ac.Text({z2:30});He.extend(ac.setTextStyle(m.style,a,{text:s[p]}),this._weekTextPositionControl(g,i,o,l,c)),n.add(m)}}}});var bz=Rc.parsePercent,wz={path:null,compoundPath:null,group:ac.Group,image:ac.Image,text:ac.Text};K_.registerPreprocessor((function(e){var t=e.graphic;He.isArray(t)?t[0]&&t[0].elements?e.graphic=[e.graphic[0]]:e.graphic=[{elements:t}]:t&&!t.elements&&(e.graphic=[{elements:[t]}])}));var Sz=K_.extendComponentModel({type:"graphic",defaultOption:{elements:[],parentId:null},_elOptionsToUpdate:null,mergeOption:function(e){var t=this.option.elements;this.option.elements=null,Sz.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=zo.mappingToExists(a,r);zo.makeIdAndName(o);var s=this._elOptionsToUpdate=[];He.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=He.extend({},i),a=e[t],r=i.$action||"merge";"merge"===r?a?(He.merge(a,n,!0),od.mergeLayoutParam(a,n,{ignoreSize:!0}),od.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=[Az(t,["left","right"]),Az(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){He.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 Mz(e,t,i,n){var a=i.type,r=new(wz.hasOwnProperty(a)?wz[a]:ac.getShapeClass(a))(i);t.add(r),n.set(e,r),r.__ecGraphicId=e}function Iz(e,t){var i=e&&e.parent;i&&("group"===e.type&&e.traverse((function(e){Iz(e,t)})),t.removeKey(e.__ecGraphicId),i.remove(e))}function Az(e,t){var i;return He.each(t,(function(t){null!=e[t]&&"auto"!==e[t]&&(i=!0)})),i}K_.extendComponentView({type:"graphic",init:function(e,t){this._elMap=He.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;He.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=He.extend({},e),He.each(["id","parentId","$action","hv","bounding"].concat(od.LOCATION_PARAMS),(function(t){delete e[t]})),e}(t);a&&"merge"!==a?"replace"===a?(Iz(o,i),Mz(r,l,h,i)):"remove"===a&&Iz(o,i):o?o.attr(h):Mz(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=bz(h.__ecGraphicWidthOption,u?r:c.__ecGraphicWidth)||0,h.__ecGraphicHeight=bz(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};od.positionElement(h,l,d,null,{hv:l.hv,boundingMode:l.bounding})}}},_clear:function(){var e=this._elMap;e.each((function(t){Iz(t,e)})),this._elMap=He.createHashMap()},dispose:function(){this._clear()}});var Tz={};var Cz={register:function(e,t){Tz[e]=t},get:function(e){return Tz[e]}},Dz=K_.extendComponentModel({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},optionUpdated:function(){Dz.superApply(this,"optionUpdated",arguments),He.each(this.option.feature,(function(e,t){var i=Cz.get(t);i&&He.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}}}),Lz=od.getLayoutRect,Pz=od.box,kz=od.positionElement;var Oz=function(e,t){var i=Yc.normalizeCssArray(t.get("padding")),n=t.getItemStyle(["color","opacity"]);return n.fill=t.get("backgroundColor"),e=new ac.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})},Rz={layout:function(e,t,i){var n=t.getBoxLayoutParams(),a=t.get("padding"),r={width:i.getWidth(),height:i.getHeight()},o=Lz(n,r,a);Pz(t.get("orient"),e,t.get("itemGap"),o.width,o.height),kz(e,n,r,a)},makeBackground:Oz};K_.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=[];He.each(o,(function(e,t){l.push(t)})),new av(this._featureNames||[],l).add(u).update(u).remove(He.curry(u,null)).execute(),this._featureNames=l,Rz.layout(a,e,i),a.add(Rz.makeBackground(a.getBoundingRect(),e)),a.eachChild((function(e){var t=e.__title,n=e.hoverStyle;if(n&&t){var o=Za.getBoundingRect(t,Za.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 xc(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=Cz.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={};He.each(h,(function(s,h){var d=ac.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",He.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)),ac.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",He.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){He.each(this._features,(function(e){e.updateView&&e.updateView(e.model,t,i,n)}))},remove:function(e,t){He.each(this._features,(function(i){i.remove&&i.remove(e,t)})),this.group.removeAll()},dispose:function(e,t){He.each(this._features,(function(i){i.dispose&&i.dispose(e,t)}))}});var Ez=Eg.toolbox.saveAsImage;function Nz(e){this.model=e}Nz.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:Ez.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:Ez.lang.slice()},Nz.prototype.unusable=!re.canvasSupported,Nz.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||re.browser.ie||re.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)}},Cz.register("saveAsImage",Nz);var zz=Eg.toolbox.magicType,Bz="__ec_magicType_stack__";function Vz(e){this.model=e}Vz.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:He.clone(zz.title),option:{},seriesIndex:{}};var Gz=Vz.prototype;Gz.getIcons=function(){var e=this.model,t=e.get("icon"),i={};return He.each(e.get("type"),(function(e){t[e]&&(i[e]=t[e])})),i};var Fz={line:function(e,t,i,n){if("bar"===e)return He.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 He.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")===Bz;if("line"===e||"bar"===e)return n.setIconStatus("stack",a?"normal":"emphasis"),He.merge({id:t,stack:a?"":Bz},n.get("option.stack")||{},!0)}},Hz=[["line","bar"],["stack"]];Gz.onclick=function(e,t,i){var n=this.model,a=n.get("seriesIndex."+i);if(Fz[i]){var r,o={series:[]};if(He.each(Hz,(function(e){He.indexOf(e,i)>=0&&He.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=Fz[i](a,r,t,n);s&&(He.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===Bz?He.merge({stack:zz.title.tiled},zz.title):He.clone(zz.title);t.dispatchAction({type:"changeMagicType",currentType:i,newOption:o,newTitle:r,featureName:"magicType"})}},K_.registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},(function(e,t){t.mergeOption(e.newOption)})),Cz.register("magicType",Vz);var Wz=Eg.toolbox.dataView,Uz=new Array(60).join("-"),jz="\t";function Zz(e){return He.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+jz:"")+n.join(jz))})),i.join("\n")})).join("\n\n"+Uz+"\n\n")}function Yz(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}var Xz=new RegExp("["+jz+"]+","g");function qz(e,t){var i=e.split(new RegExp("\n*"+Uz+"\n*","g")),n={series:[]};return He.each(i,(function(e,i){if(function(e){if(e.slice(0,e.indexOf("\n")).indexOf(jz)>=0)return!0}(e)){var a=function(e){for(var t=e.split(/\n+/g),i=Yz(t.shift()).split(Xz),n=[],a=He.map(i,(function(e){return{name:e,data:[]}})),r=0;r<t.length;r++){var o=Yz(t[r]).split(Xz);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=Yz(t.shift()),n=[],a=0;a<t.length;a++){var r,o=Yz(t[a]).split(Xz),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 $z(e){this._dom=null,this.model=e}function Kz(e,t){return He.map(e,(function(e,i){var n=t&&t[i];return He.isObject(n)&&!He.isArray(n)?(He.isObject(e)&&!He.isArray(e)&&(e=e.value),He.defaults({value:e},n)):e}))}$z.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:He.clone(Wz.title),lang:He.clone(Wz.lang),backgroundColor:"#fff",textColor:"#000",textareaColor:"#fff",textareaBorderColor:"#333",buttonColor:"#c23531",buttonTextColor:"#fff"},$z.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:He.filter([(t=n.seriesGroupByCategoryAxis,i=[],He.each(t,(function(e,t){var n=e.categoryAxis,a=e.valueAxis.dim,r=[" "].concat(He.map(e.series,(function(e){return e.name}))),o=[n.model.getCategories()];He.each(e.series,(function(e){o.push(e.getRawData().mapArray(a,(function(e){return e})))}));for(var s=[r.join(jz)],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(jz))}i.push(s.join("\n"))})),i.join("\n\n"+Uz+"\n\n")),Zz(n.other)],(function(e){return e.replace(/[\n\t\s]/g,"")})).join("\n\n"+Uz+"\n\n"),meta:n.meta}}(e);if("function"==typeof u){var d=u(t.getOption());"string"==typeof d?s.innerHTML=d:He.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}Bt.addEventListener(m,"click",x),Bt.addEventListener(v,"click",(function(){var e;try{e="function"==typeof h?h(s,t.getOption()):qz(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},$z.prototype.remove=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},$z.prototype.dispose=function(e,t){this.remove(e,t)},Cz.register("dataView",$z),K_.registerAction({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},(function(e,t){var i=[];He.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:Kz(e.data,a)})}else i.push(He.extend({type:"scatter"},e))})),t.mergeOption(He.defaults({series:i},e.newOption))}));var Jz=He.each,Qz=He.indexOf,eB=He.curry,tB=["dataToPoint","pointToData"],iB=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"];function nB(e,t,i){var n=this._targetInfoList=[],a={},r=oB(t,e);Jz(sB,(function(e,t){(!i||!i.include||Qz(i.include,t)>=0)&&e(r,n,a)}))}var aB=nB.prototype;function rB(e){return e[0]>e[1]&&e.reverse(),e}function oB(e,t){return zo.parseFinder(e,t,{includeMainTypes:iB})}aB.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=hB[e.brushType](0,i,t);e.__rangeOffset={offset:dB[e.brushType](n.values,e.range,[1,1]),xyMinMax:n.xyMinMax}}}))},aB.matchOutputRanges=function(e,t,i){Jz(e,(function(e){var n=this.findTargetInfo(e,t);n&&!0!==n&&He.each(n.coordSyses,(function(n){var a=hB[e.brushType](1,n,e.range);i(e,a.values,n,t)}))}),this)},aB.setInputRanges=function(e,t){Jz(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=hB[e.brushType](0,s.coordSys,e.coordRange),u=e.__rangeOffset;e.range=u?dB[e.brushType](l.values,u.offset,(i=l.xyMinMax,n=u.xyMinMax,a=fB(i),r=fB(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)},aB.makePanelOpts=function(e,t){return He.map(this._targetInfoList,(function(i){var n=i.getPanelRect();return{panelId:i.panelId,defaultBrushType:t&&t(i),clipPath:HP.makeRectPanelClipPath(n),isTargetByCursor:HP.makeRectIsTargetByCursor(n,e,i.coordSysModel),getLinearBrushOtherExtent:HP.makeLinearBrushOtherExtent(n)}}))},aB.controlSeries=function(e,t,i){var n=this.findTargetInfo(e,i);return!0===n||n&&Qz(n.coordSyses,t.coordinateSystem)>=0},aB.findTargetInfo=function(e,t){for(var i=this._targetInfoList,n=oB(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<lB.length;a++)if(lB[a](n,r))return r}return!0};var sB={grid:function(e,t){var i=e.xAxisModels,n=e.yAxisModels,a=e.gridModels,r=He.createHashMap(),o={},s={};(i||n||a)&&(Jz(i,(function(e){var t=e.axis.grid.model;r.set(t.id,t),o[t.id]=!0})),Jz(n,(function(e){var t=e.axis.grid.model;r.set(t.id,t),s[t.id]=!0})),Jz(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=[];Jz(a.getCartesians(),(function(e,t){(Qz(i,e.getAxis("x").model)>=0||Qz(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:uB.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})})))},geo:function(e,t){Jz(e.geoModels,(function(e){var i=e.coordinateSystem;t.push({panelId:"geo--"+e.id,geoModel:e,coordSysModel:e,coordSys:i,coordSyses:[i],getPanelRect:uB.geo})}))}},lB=[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}],uB={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(ac.getTransform(e)),t}},hB={lineX:eB(cB,0),lineY:eB(cB,1),rect:function(e,t,i){var n=t[tB[e]]([i[0][0],i[1][0]]),a=t[tB[e]]([i[0][1],i[1][1]]),r=[rB([n[0],a[0]]),rB([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:He.map(i,(function(i){var a=t[tB[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 cB(e,t,i,n){var a=i.getAxis(["x","y"][e]),r=rB(He.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 dB={lineX:eB(pB,0),lineY:eB(pB,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 He.map(e,(function(e,n){return[e[0]-i[0]*t[n][0],e[1]-i[1]*t[n][1]]}))}};function pB(e,t,i,n){return[t[0]-n[e]*i[0],t[1]-n[e]*i[1]]}function fB(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var gB=nB,mB=He.each,vB="\0_ec_hist_store";function yB(e){var t=e[vB];return t||(t=e[vB]=[{}]),t}var xB=function(e,t){var i=yB(e);mB(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)},_B=function(e){var t=yB(e),i=t[t.length-1];t.length>1&&t.pop();var n={};return mB(i,(function(e,i){for(var a=t.length-1;a>=0;a--){if(e=t[a][i]){n[i]=e;break}}})),n},bB={push:xB,pop:_B,clear:function(e){e[vB]=null},count:function(e){return yB(e).length}};dd.registerSubTypeDefaulter("dataZoom",(function(){return"slider"}));var wB=["cartesian2d","polar","singleAxis"];function SB(e,t){e=e.slice();var i=He.map(e,Yc.capitalFirst);t=(t||[]).slice();var n=He.map(t,Yc.capitalFirst);return function(a,r){He.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 MB=SB(["x","y","z","radius","angle","single"],["axisIndex","axis","index","id"]);var IB={isCoordSupported:function(e){return He.indexOf(wB,e)>=0},createNameEach:SB,eachAxisDim:MB,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 He.indexOf(t.nodes,e)>=0}(e,o)&&function(e,n){var a=!1;return t((function(t){He.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){He.each(i(e,t)||[],(function(e){n.records[t.name][e]=!0}))}))}}},AB=He.each,TB=Rc.asc,CB=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 DB(e,t){var i=e.getAxisModel(),n=e._percentWindow,a=e._valueWindow;if(n){var r=Rc.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))}}CB.prototype={constructor:CB,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(IB.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 He.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=[];AB(["start","end"],(function(l,u){var h=e[l],c=e[l+"Value"];"percent"===a[u]?(null==h&&(h=r[u]),c=n.parse(Rc.linearMap(h,r,i))):(t=!0,c=null==c?i[u]:n.parse(c),h=Rc.linearMap(c,i,r)),s[u]=c,o[u]=h})),TB(s),TB(o);var l=this._minMaxSpan;function u(e,t,i,a,r){var o=r?"Span":"ValueSpan";OL(0,e,i,"all",l["min"+o],l["max"+o]);for(var s=0;s<2;s++)t[s]=Rc.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];AB(i,(function(e){var i=e.getData();i&&AB(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;AB(["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=Rc.linearMap(n[0]+o,n,[0,100],!0):null!=r&&(o=Rc.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,DB(this)}},restore:function(e){e===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,DB(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&&AB(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})):AB(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)}})),AB(n,(function(e){t.setApproximateExtent(r,e)})))}))}}};var LB=CB,PB=He.each,kB=IB.eachAxisDim,OB=K_.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=RB(e);this.settledOption=n,this.mergeDefaultAndTheme(e,i),this.doInit(n)},mergeOption:function(e){var t=RB(e);He.merge(this.option,e,!0),He.merge(this.settledOption,t,!0),this.doInit(t)},doInit:function(e){var t=this.option;re.canvasSupported||(t.realtime=!1),this._setDefaultThrottle(e),EB(this,e);var i=this.settledOption;PB([["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 LB(t.name,i,this,a));e[t.name+"_"+i]=o}),this)},_resetTarget:function(){var e=this.option,t=this._judgeAutoMode();kB((function(t){var i=t.axisIndex;e[i]=zo.normalizeToArray(e[i])}),this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,t=!1;kB((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):PB(n.singleAxis,(function(n){e&&n.get("orient",!0)===t&&(i.singleAxisIndex=[n.componentIndex],e=!1)}))}e&&kB((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")&&kB((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,He.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 kB((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 kB((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;kB((function(n){PB(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;PB([["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),EB(this,e)},setCalculatedRange:function(e){var t=this.option;PB(["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 RB(e){var t={};return PB(["start","end","startValue","endValue","throttle"],(function(i){e.hasOwnProperty(i)&&(t[i]=e[i])})),t}function EB(e,t){var i=e._rangePropMode,n=e.get("rangeMode");PB([["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 NB=OB,zB=dg.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}}),BB=zB;NB.extend({type:"dataZoom.select"}),BB.extend({type:"dataZoom.select"});var VB=He.createHashMap,GB=He.each;K_.registerProcessor({getTargetSeries:function(e){var t=VB();return e.eachComponent("dataZoom",(function(e){e.eachTargetAxis((function(e,i,n){var a=n.getAxisProxy(e.name,i);GB(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]})}))}}),K_.registerAction("dataZoom",(function(e,t){var i=IB.createLinkedNodesFinder(He.bind(t.eachComponent,t,"dataZoom"),IB.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)})),He.each(n,(function(t,i){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})}))}));var FB=Eg.toolbox.dataZoom,HB=He.each;function WB(e,t,i){(this._brushController=new BP(i.getZr())).on("brush",He.bind(this._onBrush,this)).mount(),this._isZoomActive}WB.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:He.clone(FB.title)};var UB=WB.prototype;UB.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 gB(ZB(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",bB.count(t)>1?"emphasis":"normal")}(e,t)},UB.onclick=function(e,t,i){jB[i].call(this)},UB.remove=function(e,t){this._brushController.unmount()},UB.dispose=function(e,t){this._brushController.dispose()};var jB={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(bB.pop(this.ecModel))}};function ZB(e){var t={};return He.each(["xAxisIndex","yAxisIndex"],(function(i){t[i]=e[i],null==t[i]&&(t[i]="all"),(!1===t[i]||"none"===t[i])&&(t[i]=[])})),t}UB._onBrush=function(e,t){if(t.isEnd&&e.length){var i={},n=this.ecModel;this._brushController.updateCovers([]),new gB(ZB(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)}})),bB.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=OL(0,a.slice(),r.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),s&&(i[s.id]={dataZoomId:s.id,startValue:a[0],endValue:a[1]})}},UB._dispatchZoomAction=function(e){var t=[];HB(e,(function(e,i){t.push(He.clone(e))})),t.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:t})},Cz.register("dataZoom",WB),K_.registerPreprocessor((function(e){if(e){var t=e.dataZoom||(e.dataZoom=[]);He.isArray(t)||(e.dataZoom=t=[t]);var i=e.toolbox;if(i&&(He.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||He.isArray(r)||(r=!1===r||"none"===r?[]:[r]),function(t,i){var n=e[t];He.isArray(n)||(n=n?[n]:[]);HB(n,i)}(i,(function(e,o){if(null==r||"all"===r||-1!==He.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 YB=Eg.toolbox.restore;function XB(e){this.model=e}XB.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:YB.title},XB.prototype.onclick=function(e,t,i){bB.clear(e),t.dispatchAction({type:"restore",from:this.uid})},Cz.register("restore",XB),K_.registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},(function(e,t){t.resetOption("recreate")})),K_.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 qB=He.each,$B=Yc.toCamelCase,KB=["","-webkit-","-moz-","-o-"];function JB(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,He.map(KB,(function(e){return e+"transition:"+n})).join(";"))),o&&(re.canvasSupported?a.push("background-Color:"+o):(a.push("background-Color:#"+Yi.toHex(o)),a.push("filter:alpha(opacity=70)"))),qB(["width","color","radius"],(function(t){var i="border-"+t,n=$B(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"),qB(["decoration","align"],(function(i){var n=e.get(i);n&&t.push("text-"+i+":"+n)})),t.join(";")}(s)),null!=l&&a.push("padding:"+Yc.normalizeCssArray(l).join("px ")+"px"),a.join(";")+";"}function QB(e,t,i,n,a){var r=t&&t.painter;if(i){var o=r&&r.getViewportRoot();o&&Ct.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 eV(e,t,i){if(re.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],QB(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();Bt.normalizeEvent(i,e,!0),t.dispatch("mousemove",e)}},n.onmouseleave=function(){o._enterable&&o._show&&o.hideLater(o._hideDelay),o._inContent=!1}}eV.prototype={constructor:eV,_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;"+JB(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;QB(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(He.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 tV=eV;function iV(e){this._zr=e.getZr(),this._show=!1,this._hideTimeout}iV.prototype={constructor:iV,_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 Zl({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(He.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 nV=iV,aV=zo.getTooltipRenderMode,rV=He.bind,oV=He.each,sV=Rc.parsePercent,lV=new ac.Rect({shape:{x:-1,y:-1,width:2,height:2}});function uV(e){for(var t=e.pop();e.length;){var i=e.pop();i&&(xc.isInstance(i)&&(i=i.get("tooltip",!0)),"string"==typeof i&&(i={formatter:i}),t=new xc(i,t,t.ecModel))}return t}function hV(e,t){return e.dispatchAction||He.bind(t.dispatchAction,t)}function cV(e){return"center"===e||"middle"===e}K_.extendComponentView({type:"tooltip",init:function(e,t){if(!re.node){var i,n=e.getComponent("tooltip"),a=n.get("renderMode");this._renderMode=aV(a),"html"===this._renderMode?(i=new tV(t.getDom(),t,{appendToBody:n.get("appendToBody",!0)}),this._newLine="<br/>"):(i=new nV(t),this._newLine="\n"),this._tooltipContent=i}},render:function(e,t,i){if(!re.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");iE.register("itemTooltip",this._api,rV((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&&!re.node){var a=hV(n,i);this._ticket="";var r=n.dataByCoordSys;if(n.tooltip&&null!=n.x&&null!=n.y){var o=lV;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=GR(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(hV(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=uV([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=He.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=uV([t.tooltipOption,n]),l=this._renderMode,u=this._newLine,h={};oV(e,(function(e){oV(e.dataByAxis,(function(e){var t=i.getComponent(e.axisDim+"Axis",e.axisIndex),n=e.value,a=[];if(t&&null!=n){var s=yE.getValueLabel(n,t.axis,i,e.seriesDataIndices,e.valueLabelOpt);He.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=Rx.getAxisRawValue(t.axis,n),d.axisValueLabel=s,d){o.push(d);var p,f=u.formatTooltip(c,!0,null,l);if(He.isObject(f)){p=f.html;var g=f.markers;He.merge(h,g)}else p=f;a.push(p)}}));var c=s;"html"!==l?r.push(a.join(u)):r.push((c?Yc.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=uV([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);He.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 xc(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=Yc.formatTpl(h,i,!0);else if("function"==typeof h){var d=rV((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()})),He.isArray(t))i=sV(t[0],s),n=sV(t[1],l);else if(He.isObject(t)){t.width=u[0],t.height=u[1];var p=od.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-=cV(h)?u[0]/2:"right"===h?u[0]:0),c&&(n-=cV(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&&oV(t,(function(t,n){var a=t.dataByAxis||{},r=(e[n]||{}).dataByAxis||[];(i&=a.length===r.length)&&oV(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)&&oV(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){re.node||(this._tooltipContent.dispose(),iE.unregister("itemTooltip",t))}}),K_.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},(function(){})),K_.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},(function(){}));var dV=["rect","polygon","keep","clear"];var pV=function(e,t){var i=e&&e.brush;if(He.isArray(i)||(i=i?[i]:[]),i.length){var n=[];He.each(i,(function(e){var t=e.hasOwnProperty("toolbox")?e.toolbox:[];t instanceof Array&&(n=n.concat(t))}));var a=e&&e.toolbox;He.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={};He.each(e,(function(e){t[e]=1})),e.length=0,He.each(t,(function(t,i){e.push(i)}))}(s),t&&!s.length&&s.push.apply(s,dV)}},fV=He.each;function gV(e){if(e)for(var t in e)if(e.hasOwnProperty(t))return!0}var mV=function(e,t,i){var n;He.each(i,(function(e){t.hasOwnProperty(e)&&gV(t[e])&&(n=!0)})),n&&He.each(i,(function(i){t.hasOwnProperty(i)&&gV(t[i])?e[i]=He.clone(t[i]):delete e[i]}))},vV=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)}}He.each(e,(function(e){var i=mC.prepareVisualTypes(t[e]);s[e]=i})),null==r?i.each(h):i.each([r],h)},yV=function(e,t,i,n){var a={};return He.each(e,(function(e){var i=mC.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)}}}}},xV={createVisualMappings:function(e,t,i){var n={};return fV(t,(function(t){var a,r=n[t]=((a=function(){}).prototype.__hidden=a.prototype,new a);fV(e[t],(function(e,n){if(mC.isValidType(n)){var a={type:n,visual:e};i&&i(a,t),r[n]=new mC(a),"opacity"===n&&((a=He.clone(a)).type="colorAlpha",r.__hidden.__alphaForOpacity=new mC(a))}}))})),n},replaceVisualOption:mV,applyVisual:vV,incrementalApplyVisual:yV},_V=ac.linePolygonIntersect,bV={lineX:wV(0),lineY:wV(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])&&r_.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!!(r_.contain(n,a,r)||r_.contain(n,a+o,r)||r_.contain(n,a,r+s)||r_.contain(n,a+o,r+s)||Rn.create(e).contain(l[0],l[1])||_V(a,r,a+o,r,n)||_V(a,r,a,r+s,n)||_V(a+o,r,a+o,r+s,n)||_V(a,r+s,a+o,r+s,n))||void 0}}};function wV(e){var t=["x","y"],i=["width","height"];return{point:function(t,i,n){if(t){var a=n.range;return SV(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(),SV(s[0],o)||SV(s[1],o)||SV(o[0],s)||SV(o[1],s)}}}}function SV(e,t){return t[0]<=e&&e<=t[1]}var MV=bV,IV=["inBrush","outOfBrush"],AV="__ecBrushSelect",TV="__ecInBrushSelectEvent",CV=K_.PRIORITY.VISUAL.BRUSH;function DV(e){e.eachComponent({mainType:"brush"},(function(t){(t.brushTargetManager=new gB(t.option,e)).setInputRanges(t.areas,e)}))}function LV(e,t){if(!e.isDisposed()){var i=e.getZr();i[TV]=!0,e.dispatchAction({type:"brushSelect",batch:t}),i[TV]=!1}}function PV(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 kV(e){var t=e.brushSelector;if(He.isString(t)){var i=[];return He.each(MV,(function(e,n){i[n]=function(i,n,a,r){var o=n.getItemLayout(i);return e[t](o,a,r)}})),i}if(He.isFunction(t)){var n={};return He.each(MV,(function(e,i){n[i]=t})),n}return t}K_.registerLayout(CV,(function(e,t,i){e.eachComponent({mainType:"brush"},(function(e){i&&"takeGlobalCursor"===i.type&&e.setBrushOption("brush"===i.key?i.brushOption:{brushType:!1})})),DV(e)})),K_.registerVisual(CV,(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:He.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=He.map(t.areas,(function(e){return function(e){var t=e.selectors={};return He.each(MV[e.brushType],(function(i,n){t[n]=function(n){return i(n,t,e)}})),e}(He.defaults({boundingRect:OV[e.brushType](e)},e))})),f=xV.createVisualMappings(t.option,IV,(function(e){e.mappingMethod="fixed"}));function g(e){return"all"===l||u[e]}function m(e){return!!e.length}He.isArray(l)&&He.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=kV(i);if(!r||function(e,t){var i=e.option.seriesIndex;return null!=i&&"all"!==i&&(He.isArray(i)?He.indexOf(i,t)<0:t!==i)}(t,n))return;if(He.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){PV(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=kV(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 PV(n,a,r,e)?(i.dataIndex.push(r.getRawIndex(e)),"inBrush"):"outOfBrush"};(g(t)?d:m(a))&&xV.applyVisual(IV,f,r,s)}))})),function(e,t,i,n,a){if(!a)return;var r=e.getZr();if(r[TV])return;r[AV]||(r[AV]=LV);var o=Pg.createOrUpdate(r,AV,i,t);o(e,n)}(t,n,a,r,i)}));var OV={lineX:He.noop,lineY:He.noop,rect:function(e){return RV(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&&RV(t)}};function RV(e){return new Rn(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var EV={layoutCovers:DV},NV=["#ddd"];function zV(e,t){return He.merge({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new xc(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}K_.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&&xV.replaceVisualOption(i,e,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:NV},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(e){e&&(this.areas=He.map(e,(function(e){return zV(this.option,e)}),this))},setBrushOption:function(e){this.brushOption=zV(this.option,e),this.brushType=this.brushOption.brushType}});var BV=EV.layoutCovers;function VV(e,t,i,n){(!n||n.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice())}K_.extendComponentView({type:"brush",init:function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new BP(t.getZr())).on("brush",He.bind(this._onBrush,this)).mount()},render:function(e){return this.model=e,VV.apply(this,arguments)},updateTransform:function(e,t){return BV(t),VV.apply(this,arguments)},updateView:VV,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:He.clone(e),$from:i}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:He.clone(e),$from:i})}}),K_.registerAction({type:"brush",event:"brush"},(function(e,t){t.eachComponent({mainType:"brush",query:e},(function(t){t.setAreas(e.areas)}))})),K_.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},(function(){})),K_.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},(function(){}));var GV=Eg.toolbox.brush;function FV(e,t,i){this.model=e,this.ecModel=t,this.api=i,this._brushType,this._brushMode}FV.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:He.clone(GV.title)};var HV=FV.prototype;HV.render=HV.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,He.each(e.get("type",!0),(function(t){e.setIconStatus(t,("keep"===t?"multiple"===a:"clear"===t?r:t===n)?"emphasis":"normal")}))},HV.getIcons=function(){var e=this.model,t=e.get("icon",!0),i={};return He.each(e.get("type",!0),(function(e){t[e]&&(i[e]=t[e])})),i},HV.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}})},Cz.register("brush",FV),K_.registerPreprocessor(pV);var WV=od.getLayoutRect,UV=Yc.windowOpen;function jV(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};He.each(n,(function(e,t){r[t]||ZV(a,t)||(a[t]=e)})),i.label&&!ZV(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function ZV(e,t){return e.hasOwnProperty(t)}K_.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"}}}),K_.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=He.retrieve2(e.get("textBaseline"),e.get("textVerticalAlign")),l=new ac.Text({style:ac.setTextStyle({},a,{text:e.get("text"),textFill:a.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=e.get("subtext"),c=new ac.Text({style:ac.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(){UV(d,"_"+e.get("target"))})),p&&c.on("click",(function(){UV(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=WV(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 ac.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 YV=function(e){var t=e&&e.timeline;He.isArray(t)||(t=t?[t]:[]),He.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(jV(e),ZV(e,"controlPosition")){var n=e.controlStyle||(e.controlStyle={});ZV(n,"position")||(n.position=e.controlPosition),"none"!==n.position||ZV(n,"show")||(n.show=!1,delete n.position),delete e.controlPosition}He.each(e.data||[],(function(e){He.isObject(e)&&!He.isArray(e)&&(!ZV(e,"value")&&ZV(e,"name")&&(e.value=e.name),jV(e))}))}(e)}))};dd.registerSubTypeDefaulter("timeline",(function(){return"slider"})),K_.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"),He.defaults({currentIndex:i.option.currentIndex},e)})),K_.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},(function(e,t){var i=t.getComponent("timeline");i&&null!=e.playState&&i.setPlayState(e.playState)}));var XV=dd.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){XV.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=[];He.each(t,(function(e,t){var i,r=zo.getDataItemValue(e);He.isObject(e)?(i=He.clone(e)).value=t:i=t,a.push(i),He.isString(r)||null!=r&&!isNaN(r)||(r=""),n.push(r+"")})),t=a}var r={category:"ordinal",time:"time"}[i]||"number";(this._data=new zv([{name:"value",type:r}],this)).initData(t,n)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}}),qV=XV.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:[]}});He.mixin(qV,zf);var $V=dg.extend({type:"timeline"}),KV=function(e,t,i,n){O_.call(this,e,t,i),this.type=n||"value",this.model=null};KV.prototype={constructor:KV,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},He.inherits(KV,O_);var JV=KV,QV=Xx.createSymbol,eG=Yc.encodeHTML,tG=He.bind,iG=He.each,nG=Math.PI;function aG(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=QV(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=He.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]+=Rc.parsePercent(h[0],u[0]),c[1]+=Rc.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 rG(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)))}}$V.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 eG(s.scale.getLabel(e))},iG(["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 od.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:nG/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*nG/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=oi.create(),o=a.x,s=a.y+a.height;oi.translate(r,r,[-o,-s]),oi.rotate(r,r,-nG/2),oi.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=Rx.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 JV("value",a,e.axisExtent,n);return o.model=t,o},_createGroup:function(e){var t=this["_"+e]=new ac.Group;return this.group.add(t),t},_renderAxisLine:function(e,t,i,n){var a=i.getExtent();n.get("lineStyle.show")&&t.add(new ac.Line({shape:{x1:a[0],y1:0,x2:a[1],y2:0},style:He.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();iG(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:tG(this._changeTimeline,this,e)},h=aG(o,s,t,u);ac.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();iG(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 ac.Text({position:[u,0],rotation:e.labelRotation-e.rotation,onclick:tG(this._changeTimeline,this,r),silent:!1});ac.setTextStyle(h.style,s,{text:n.formattedLabel,textAlign:e.labelAlign,textVerticalAlign:e.labelBaseline}),t.add(h),ac.setHoverStyle(h,ac.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=ac.makePath(e.get(t).replace(/^path:\/\//,""),He.clone(n||{}),new Rn(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),ac.setHoverStyle(c,s)}}c(e.nextBtnPosition,"controlStyle.nextIcon",tG(this._changeTimeline,this,h?"-":"+")),c(e.prevBtnPosition,"controlStyle.prevIcon",tG(this._changeTimeline,this,h?"+":"-")),c(e.playPosition,"controlStyle."+(u?"stopIcon":"playIcon"),tG(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=tG(s._handlePointerDrag,s),e.ondragend=tG(s._handlePointerDragend,s),rG(e,r,i,n,!0)},onUpdate:function(e){rG(e,r,i,n)}};this._currentPointer=aG(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=Rc.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(tG((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 ac.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})}}),K_.registerPreprocessor(YV);var oG=Yc.addCommas,sG=Yc.encodeHTML;function lG(e){zo.defaultEmphasis(e,"label",["show"])}var uG=K_.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(re.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&&lG(i),He.each(i.data,(function(e){e instanceof Array?(lG(e[0]),lG(e[1])):lG(e)})),o=new a(i,this,t),He.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=He.isArray(i)?He.map(i,oG).join(", "):oG(i),a=t.getName(e),r=sG(this.name);return(null!=i||a)&&(r+="<br />"),a&&(r+=sG(a),null!=i&&(r+=" : ")),null!=i&&(r+=sG(n)),r},getData:function(){return this._data},setData:function(e){this._data=e}});He.mixin(uG,zf);var hG=uG;hG.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 cG=ly.isDimensionStacked,dG=He.indexOf;function pG(e,t,i,n,a,r){var o=[],s=cG(t,n)?t.getCalculationInfo("stackResultDimension"):n,l=vG(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=Rc.getPrecision(t.get(n,u));return(c=Math.min(c,20))>=0&&(o[r]=+o[r].toFixed(c)),[o,h]}var fG=He.curry,gG={min:fG(pG,"min"),max:fG(pG,"max"),average:fG(pG,"average")};function mG(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 vG(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 yG=function(e,t){var i=e.getData(),n=e.coordinateSystem;if(t&&!function(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}(t)&&!He.isArray(t.coord)&&n){var a=n.dimensions,r=mG(t,i,n,e);if((t=He.clone(t)).type&&gG[t.type]&&r.baseAxis&&r.valueAxis){var o=dG(a,r.baseAxis.dim),s=dG(a,r.valueAxis.dim),l=gG[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++)gG[u[h]]&&(u[h]=vG(i,i.mapDimension(a[h]),u[h]));t.coord=u}}return t},xG={dataTransform:yG,getAxisInfo:mG,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:vG},_G=K_.extendComponentView({type:"marker",init:function(){this.markerGroupMap=He.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 bG(e,t,i){var n=t.coordinateSystem;e.each((function(a){var r,o=e.getItemModel(a),s=Rc.parsePercent(o.get("x"),i.getWidth()),l=Rc.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)}))}_G.extend({type:"markPoint",updateTransform:function(e,t,i){t.eachSeries((function(e){var t=e.markPointModel;t&&(bG(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 bb),u=function(e,t,i){var n;n=e?He.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return He.defaults({name:e},i)})):[{name:"value",type:"float"}];var a=new zv(n,i),r=He.map(i.get("data"),He.curry(xG.dataTransform,t));e&&(r=He.filter(r,He.curry(xG.dataFilter,e)));return a.initData(r,null,e?xG.dimValueGetter:function(e){return e.value}),a}(a,e,t);t.setData(u),bG(t.getData(),e,n),u.each((function(e){var i=u.getItemModel(e),n=i.getShallow("symbol"),a=i.getShallow("symbolSize"),r=He.isFunction(n),s=He.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")}}),K_.registerPreprocessor((function(e){e.markPoint=e.markPoint||{}})),hG.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 wG=ly.getStackedDimension,SG=function(e,t,i,n){var a=e.getData(),r=n.type;if(!He.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=He.retrieve(n.yAxis,n.xAxis);else{var l=xG.getAxisInfo(n,a,t,e);o=l.valueAxis;var u=wG(a,l.valueDataDim);s=xG.numCalculate(a,u,r)}var h="x"===o.dim?0:1,c=1-h,d=He.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=[xG.dataTransform(e,n[0]),xG.dataTransform(e,n[1]),He.extend({},n[2])])[2].type=n[2].type||"",He.merge(n[2],n[0]),He.merge(n[2],n[1]),n};function MG(e){return!isNaN(e)&&!isFinite(e)}function IG(e,t,i,n){var a=1-e,r=n.dimensions[e];return MG(t[a])&&MG(i[a])&&t[e]===i[e]&&n.getAxis(r).containData(t[e])}function AG(e,t){if("cartesian2d"===e.type){var i=t[0].coord,n=t[1].coord;if(i&&n&&(IG(1,i,n,e)||IG(0,i,n,e)))return!0}return xG.dataFilter(e,t[0])&&xG.dataFilter(e,t[1])}function TG(e,t,i,n,a){var r,o=n.coordinateSystem,s=e.getItemModel(t),l=Rc.parsePercent(s.get("x"),a.getWidth()),u=Rc.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;MG(e.get(h[0],t))?r[0]=p.toGlobalCoord(p.getExtent()[i?0:1]):MG(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)}_G.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){TG(a,t,!0,e,i),TG(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 mD);this.group.add(l.group);var u=function(e,t,i){var n;n=e?He.map(e&&e.dimensions,(function(e){var i=t.getData().getDimensionInfo(t.getData().mapDimension(e))||{};return He.defaults({name:e},i)})):[{name:"value",type:"float"}];var a=new zv(n,i),r=new zv(n,i),o=new zv([],i),s=He.map(i.get("data"),He.curry(SG,t,e,i));e&&(s=He.filter(s,He.curry(AG,e)));var l=e?xG.dimValueGetter:function(e){return e.value};return a.initData(He.map(s,(function(e){return e[0]})),null,l),r.initData(He.map(s,(function(e){return e[1]})),null,l),o.initData(He.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);TG(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")})}He.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")}}),K_.registerPreprocessor((function(e){e.markLine=e.markLine||{}})),hG.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 CG=function(e,t,i,n){var a=xG.dataTransform(e,n[0]),r=xG.dataTransform(e,n[1]),o=He.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=He.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 DG(e){return!isNaN(e)&&!isFinite(e)}function LG(e,t,i,n){var a=1-e;return DG(t[a])&&DG(i[a])}function PG(e,t){var i=t.coord[0],n=t.coord[1];return!("cartesian2d"!==e.type||!i||!n||!LG(1,i,n)&&!LG(0,i,n))||(xG.dataFilter(e,{coord:i,x:t.x0,y:t.y0})||xG.dataFilter(e,{coord:n,x:t.x1,y:t.y1}))}function kG(e,t,i,n,a){var r,o=n.coordinateSystem,s=e.getItemModel(t),l=Rc.parsePercent(s.get(i[0]),a.getWidth()),u=Rc.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);DG(p)?r[0]=c.toGlobalCoord(c.getExtent()["x0"===i[0]?0:1]):DG(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 OG=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];_G.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=He.map(OG,(function(a){return kG(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 ac.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=He.map(e&&e.dimensions,(function(e){var i=t.getData(),n=i.getDimensionInfo(i.mapDimension(e))||{};return He.defaults({name:e},n)})),a=new zv(He.map(r,(function(e,t){return{name:e,type:n[t%2].type}})),i)):a=new zv(n=[{name:"value",type:"float"}],i);var o=He.map(i.get("data"),He.curry(CG,t,e,i));e&&(o=He.filter(o,He.curry(PG,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,He.map(OG,(function(i){return kG(u,t,i,e,n)}))),u.setItemVisual(t,{color:o.getVisual("color")})})),u.diff(l.__data).add((function(e){var t=new ac.Polygon({shape:{points:u.getItemLayout(e)}});u.setItemGraphicEl(e,t),l.group.add(t)})).update((function(e,i){var n=l.__data.getItemGraphicEl(i);ac.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(He.defaults(n.getModel("itemStyle").getItemStyle(),{fill:Yi.modifyAlpha(o,.4),stroke:o})),e.hoverStyle=n.getModel("emphasis.itemStyle").getItemStyle(),ac.setLabelStyle(e.style,e.hoverStyle,a,r,{labelFetcher:t,labelDataIndex:i,defaultText:u.getName(i)||"",isRectText:!0,autoColor:o}),ac.setHoverStyle(e,{}),e.dataModel=t})),l.__data=u,l.group.silent=t.get("silent")||e.get("silent")}}),K_.registerPreprocessor((function(e){e.markArea=e.markArea||{}}));var RG=zo.isNameSpecified,EG=Eg.legend.selector,NG={all:{type:"all",title:He.clone(EG.all)},inverse:{type:"inverse",title:He.clone(EG.inverse)}},zG=K_.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){zG.superCall(this,"mergeOption",e),this._updateSelector(e)},_updateSelector:function(e){var t=e.selector;!0===t&&(t=e.selector=["all","inverse"]),He.isArray(t)&&He.each(t,(function(e,i){He.isString(e)&&(e={type:e}),t[i]=He.merge(e,NG[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&&RG(n)&&t.push(n.name)})),this._availableNames=i;var n=this.get("data")||t,a=He.map(n,(function(e){return"string"!=typeof e&&"number"!=typeof e||(e={name:e}),new xc(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;He.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;He.each(e,(function(e){t[e.get("name",!0)]=!0}))},inverseSelect:function(){var e=this._data,t=this.option.selected;He.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])&&He.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}}}),BG=zG;function VG(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();He.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}}K_.registerAction("legendToggleSelect","legendselectchanged",He.curry(VG,"toggleSelected")),K_.registerAction("legendAllSelect","legendselectall",He.curry(VG,"allSelect")),K_.registerAction("legendInverseSelect","legendinverseselect",He.curry(VG,"inverseSelect")),K_.registerAction("legendSelect","legendselected",He.curry(VG,"select")),K_.registerAction("legendUnSelect","legendunselected",He.curry(VG,"unSelect"));var GG=Xx.createSymbol,FG=Rz.makeBackground,HG=He.curry,WG=He.each,UG=ac.Group,jG=K_.extendComponentView({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new UG),this._backgroundEl,this.group.add(this._selectorGroup=new UG),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=od.getLayoutRect(l,u,h),d=this.layoutInner(e,a,c,n,o,s),p=od.getLayoutRect(He.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=FG(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=He.createHashMap(),u=t.get("selectedMode"),h=[];i.eachRawSeries((function(e){!e.get("legendHoverLink")&&h.push(e.id)})),WG(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",HG(YG,o,null,n,h)).on("mouseover",HG(XG,c.name,null,n,h)).on("mouseout",HG(qG,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",HG(YG,null,o,n,h)).on("mouseover",HG(XG,null,o,n,h)).on("mouseout",HG(qG,null,o,n,h)),l.set(o,!0)}}),this)}else s.add(new UG({newline:!0}))}),this),a&&this._createSelector(a,t,n,r,o)},_createSelector:function(e,t,i,n,a){var r=this.getSelectorGroup();WG(e,(function(e){!function(e){var n=e.type,a=new ac.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");ac.setLabelStyle(a.style,a.hoverStyle={},o,s,{defaultText:e.title,isRectText:!1}),ac.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 UG,y=i.getModel("textStyle"),x=i.get("icon"),_=i.getModel("tooltip"),b=_.parentModel,w=GG(a=x||a,0,0,h,c,m?s:d,null==f||f);if(v.add(ZG(w,a,g,l,p,m)),!x&&r&&(r!==a||"none"===r)){var S=.8*c;"none"===r&&(r="circle");var M=GG(r,(h-S)/2,(c-S)/2,S,S,m?s:d,null==f||f);v.add(ZG(M,r,g,l,p,m))}var I="left"===o?h+5:-5,A=o,T=n.get("formatter"),C=e;"string"==typeof T&&T?C=T.replace("{name}",null!=e?e:""):"function"==typeof T&&(C=T(e)),v.add(new ac.Text({style:ac.setTextStyle({},y,{text:C,x:I,y:c/2,textFill:m?y.getTextColor():d,textAlign:A,textVerticalAlign:"middle"})}));var D=new ac.Rect({shape:v.getBoundingRect(),invisible:!0,tooltip:_.get("show")?He.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),ac.setHoverStyle(v),v.__legendDataIndex=t,v},layoutInner:function(e,t,i,n,a,r){var o=this.getContentGroup(),s=this.getSelectorGroup();od.box(e.get("orient"),o,e.get("itemGap"),i.width,i.height);var l=o.getBoundingRect(),u=[-l.x,-l.y];if(a){od.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 ZG(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 YG(e,t,i,n){qG(e,t,i,n),i.dispatchAction({type:"legendToggleSelect",name:null!=e?e:t}),XG(e,t,i,n)}function XG(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 qG(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 $G=jG;var KG=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}))};K_.registerProcessor(K_.PRIORITY.PROCESSOR.SERIES_FILTER,KG),dd.registerSubTypeDefaulter("legend",(function(){return"plain"}));var JG=od.mergeLayoutParam,QG=od.getLayoutParams,eF=BG.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=QG(e);eF.superCall(this,"init",e,t,i,n),tF(this,e,a)},mergeOption:function(e,t){eF.superCall(this,"mergeOption",e,t),tF(this,this.option,e)}});function tF(e,t,i){var n=[1,1];n[e.getOrient().index]=0,JG(t,i,{type:"box",ignoreSize:n})}var iF=ac.Group,nF=["width","height"],aF=["x","y"],rF=$G.extend({type:"legend.scroll",newlineDisabled:!0,init:function(){rF.superCall(this,"init"),this._currentIndex=0,this.group.add(this._containerGroup=new iF),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new iF),this._showController},resetInner:function(){rF.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;rF.superCall(this,"renderInner",e,t,i,n,a,r,o);var l=this._controllerGroup,u=t.get("pageIconSize",!0);He.isArray(u)||(u=[u,u]),c("pagePrev",0);var h=t.getModel("pageTextStyle");function c(e,i){var a=e+"DataIndex",r=ac.createIcon(t.get("pageIcons",!0)[t.getOrient().name][i],{onclick:He.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 ac.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=nF[s],u=aF[s],h=nF[1-s],c=aF[1-s];a&&od.box("horizontal",o,e.get("selectorItemGap",!0));var d=e.get("selectorButtonGap",!0),p=o.getBoundingRect(),f=[-p.x,-p.y],g=He.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;od.box(e.get("orient"),s,e.get("itemGap"),n?i.width:null,n?null:i.height),od.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=He.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 ac.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&&ac.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;He.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",He.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=nF[a],o=aF[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}});K_.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)}))})),NB.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 oF=ac.Rect,sF=Rc.linearMap,lF=Rc.asc,uF=He.bind,hF=He.each,cF="horizontal",dF="vertical",pF=["line","bar","candlestick","scatter"],fF=BB.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){fF.superApply(this,"render",arguments),Pg.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(){fF.superApply(this,"remove",arguments),Pg.clear(this,"_dispatchZoomAction")},dispose:function(){fF.superApply(this,"dispose",arguments),Pg.clear(this,"_dispatchZoomAction")},_buildView:function(){var e=this.group;e.removeAll(),this._resetLocation(),this._resetInterval();var t=this._displayables.barGroup=new ac.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===cF?{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=od.getLayoutParams(e.option);He.each(["right","top","width","height"],(function(e){"ph"===r[e]&&(r[e]=a[e])}));var o=od.getLayoutRect(r,n,e.padding);this._location={x:o.x,y:o.y},this._size=[o.width,o.height],this._orient===dF&&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!==cF||a?i===cF&&a?{scale:o?[-1,1]:[-1,-1]}:i!==dF||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 oF({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get("backgroundColor")},z2:-40})),i.add(new oF({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:"transparent"},z2:0,onclick:He.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:sF(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 ac.Polygon({shape:{points:h},style:He.defaults({fill:g.get("dataBackgroundColor")},g.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new ac.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();He.each(o,(function(e){if(!(i||!0!==t&&He.indexOf(pF,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 oF({draggable:!0,cursor:gF(this._orient),drift:uF(this._onDragMove,this,"all"),ondragstart:uF(this._showDataInfo,this,!0),ondragend:uF(this._onDragEnd,this),onmouseover:uF(this._showDataInfo,this,!0),onmouseout:uF(this._showDataInfo,this,!1),style:{fill:r.get("fillerColor"),textPosition:"inside"}})),n.add(new oF({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)"}})),hF([0,1],(function(e){var a=ac.createIcon(r.get("handleIcon"),{cursor:gF(this._orient),draggable:!0,drift:uF(this._onDragMove,this,e),ondragend:uF(this._onDragEnd,this),onmouseover:uF(this._showDataInfo,this,!0),onmouseout:uF(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),o=a.getBoundingRect();this._handleHeight=Rc.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 ac.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=[sF(e[0],[0,100],t,!0),sF(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];OL(t,n,a,i.get("zoomLock")?"all":e,null!=r.minSpan?sF(r.minSpan,o,a,!0):null,null!=r.maxSpan?sF(r.maxSpan,o,a,!0):null);var s=this._range,l=this._range=lF([sF(n[0],a,o,!0),sF(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=lF(i.slice()),a=this._size;hF([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=lF(this._handleEnds.slice());function c(e){var t=ac.getTransform(i.handles[e].parent,this.group),o=ac.transformDirection(0===e?"right":"left",t),s=this._handleWidth/2+5,l=ac.applyTransform([h[e]+(0===e?-s:s),this._size[1]/2],t);n[e].setStyle({x:l[0],y:l[1],textVerticalAlign:a===cF?"middle":o,textAlign:a===cF?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 He.isFunction(n)?n(e,r):He.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,Bt.stop(n.event);var a=this._displayables.barGroup.getLocalTransform(),r=ac.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(hF(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 gF(e){return"vertical"===e?"ns-resize":"ew-resize"}NB.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var mF="\0_ec_dataZoom_roams";function vF(e){var t=e.getZr();return t[mF]||(t[mF]={})}function yF(e){He.each(e,(function(t,i){t.count||(t.controller.dispose(),delete e[i])}))}function xF(e,t){e.dispatchAction({type:"dataZoom",batch:t})}var _F=function(e,t){var i=vF(e),n=t.dataZoomId,a=t.coordId;He.each(i,(function(e,i){var r=e.dataZoomInfos;r[n]&&He.indexOf(t.allCoordIds,a)<0&&(delete r[n],e.count--)})),yF(i);var r=i[a];r||((r=i[a]={coordId:a,dataZoomInfos:{},count:0}).controller=function(e,t){var i=new KI(e.getZr());return He.each(["pan","zoom","scrollMove"],(function(e){i.on(e,(function(i){var n=[];He.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=He.curry(xF,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,He.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),Pg.createOrUpdate(r,"dispatchAction",t.dataZoomModel.get("throttle",!0),"fixRate")},bF={register:_F,unregister:function(e,t){var i=vF(e);He.each(i,(function(e){e.controller.dispose();var i=e.dataZoomInfos;i[t]&&(delete i[t],e.count--)})),yF(i)},generateCoordId:function(e){return e.type+"\0_"+e.id}},wF=He.bind,SF=BB.extend({type:"dataZoom.inside",init:function(e,t){this._range},render:function(e,t,i,n){SF.superApply(this,"render",arguments),this._range=e.getPercentRange(),He.each(this.getTargetCoordInfo(),(function(t,n){var a=He.map(t,(function(e){return bF.generateCoordId(e.model)}));He.each(t,(function(t){var r=t.model,o={};He.each(["pan","zoom","scrollMove"],(function(e){o[e]=wF(MF[e],this,t,n)}),this),bF.register(i,{coordId:bF.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(){bF.unregister(this.api,this.dataZoomModel.id),SF.superApply(this,"dispose",arguments),this._range=null}}),MF={zoom:function(e,t,i,n){var a=this._range,r=a.slice(),o=e.axisModels[0];if(o){var s=AF[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 OL(0,r,[0,100],0,h.minSpan,h.maxSpan),this._range=r,a[0]!==r[0]||a[1]!==r[1]?r:void 0}},pan:IF((function(e,t,i,n,a,r){var o=AF[n]([r.oldX,r.oldY],[r.newX,r.newY],t,a,i);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength})),scrollMove:IF((function(e,t,i,n,a,r){return AF[n]([0,0],[r.scrollDelta,r.scrollDelta],t,a,i).signal*(e[1]-e[0])*r.scrollDelta}))};function IF(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 OL(l,o,[0,100],"all"),this._range=o,r[0]!==o[0]||r[1]!==o[1]?o:void 0}}}var AF={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}},TF=He.each;function CF(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var DF=function(e){var t=e&&e.visualMap;He.isArray(t)||(t=t?[t]:[]),TF(t,(function(e){if(e){CF(e,"splitList")&&!CF(e,"pieces")&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&He.isArray(t)&&TF(t,(function(e){He.isObject(e)&&(CF(e,"start")&&!CF(e,"min")&&(e.min=e.start),CF(e,"end")&&!CF(e,"max")&&(e.max=e.end))}))}}))};dd.registerSubTypeDefaulter("visualMap",(function(e){return e.categories||(e.pieces?e.pieces.length>0:e.splitNumber>0)&&!e.calculable?"piecewise":"continuous"}));var LF=K_.PRIORITY.VISUAL.COMPONENT;function PF(e,t,i,n){for(var a=t.targetVisuals[n],r=mC.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}}K_.registerVisual(LF,{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(xV.incrementalApplyVisual(t.stateList,t.targetVisuals,He.bind(t.getValueState,t),t.getDataDimension(e.getData())))})),i}}),K_.registerVisual(LF,{createOnAllSeries:!0,reset:function(e,t){var i=e.getData(),n=[];t.eachComponent("visualMap",(function(t){if(t.isTargetSeries(e)){var a=t.getVisualMeta(He.bind(PF,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 kF={get:function(e,t,i){var n=He.clone((OF[e]||{})[t]);return i&&He.isArray(n)?n[n.length-1]:n}},OF={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]}},RF=kF,EF=mC.mapVisual,NF=mC.eachVisual,zF=He.isArray,BF=He.each,VF=Rc.asc,GF=Rc.linearMap,FF=He.noop,HF=K_.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;re.canvasSupported||(i.realtime=!1),!t&&xV.replaceVisualOption(i,e,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(e){var t=this.stateList;e=He.bind(e,this),this.controllerVisuals=xV.createVisualMappings(this.option.controller,t,e),this.targetVisuals=xV.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=zo.normalizeToArray(e),t},eachTargetSeries:function(e,t){He.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||["<",">"],He.isArray(e)&&(e=e.slice(),n=!0),a=t?e:n?[u(e[0]),u(e[1])]:u(e),He.isString(l)?l.replace("{value}",n?a[0]:a).replace("{value2}",n?a[1]:a):He.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=VF([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={});He.merge(n,i),He.merge(a,i);var r=this.isCategory();function o(i){zF(t.color)&&!i.inRange&&(i.inRange={color:t.color.slice().reverse()}),i.inRange=i.inRange||{color:e.get("gradientColor")},BF(this.stateList,(function(e){var t=i[e];if(He.isString(t)){var n=RF.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]={},BF(n,(function(e,t){if(mC.isValidType(t)){var i=RF.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");BF(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&&He.clone(t)||(r?"roundRect":["roundRect"])),null==s.symbolSize&&(s.symbolSize=i&&He.clone(i)||(r?o[0]:[o[0],o[0]])),s.symbol=EF(s.symbol,(function(e){return"none"===e||"square"===e?"roundRect":e}));var l=s.symbolSize;if(null!=l){var u=-1/0;NF(l,(function(e){e>u&&(u=e)})),s.symbolSize=EF(l,(function(e){return GF(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:FF,getValueState:FF,getVisualMeta:FF}),WF=HF,UF=[20,140],jF=WF.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){jF.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual((function(e){e.mappingMethod="linear",e.dataExtent=this.getExtent()})),this._resetRange()},resetItemSize:function(){jF.superApply(this,"resetItemSize",arguments);var e=this.itemSize;"horizontal"===this._orient&&e.reverse(),(null==e[0]||isNaN(e[0]))&&(e[0]=UF[0]),(null==e[1]||isNaN(e[1]))&&(e[1]=UF[1])},_resetRange:function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):He.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(){WF.prototype.completeVisualOption.apply(this,arguments),He.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=Rc.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=ZF(this,"outOfRange",this.getExtent()),i=ZF(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 ZF(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 YF=K_.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=Yc.normalizeCssArray(t.get("padding")||0),n=e.getBoundingRect();e.add(new ac.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=mC.prepareVisualTypes(u);return He.each(h,(function(n){var a=u[n];i.convertOpacityToAlpha&&"opacity"===n&&(n="colorAlpha",a=u.__alphaForOpacity),mC.dependsOn(n,t)&&a&&a.applyVisual(e,s,l)})),r[t]},positionGroup:function(e){var t=this.visualMapModel,i=this.api;od.positionElement(e,t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()})},doRender:He.noop}),XF=YF,qF=od.getLayoutRect;var $F=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=qF(h,r,n.padding);return l[(p.margin[d[2]]||0)+p[d[0]]+.5*p[d[1]]<.5*r[d[1]]?0:1]},KF={getItemAlign:$F,makeHighDownBatch:function(e,t){return He.each(e||[],(function(e){null!=e.dataIndex&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey="visualMap"+(t?t.componentIndex:"")})),e}},JF=Rc.linearMap,QF=He.each,eH=Math.min,tH=Math.max,iH=XF.extend({type:"visualMap.continuous",init:function(){iH.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 ac.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=KF.getItemAlign(t,this.api,n),s=i.barGroup=this._createBarGroup(o);s.add(i.outOfRange=nH()),s.add(i.inRange=nH(null,r?rH(this._orient):null,He.bind(this._dragHandle,this,"all",!1),He.bind(this._dragHandle,this,"all",!0)));var l=t.textStyleModel.getTextRect("国"),u=tH(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=He.bind(this._dragHandle,this,t,!1),o=He.bind(this._dragHandle,this,t,!0),s=nH(function(e,t){return 0===e?[[0,0],[t,0],[t,-t]]:[[0,0],[t,0],[t,t]]}(t,n),rH(this._orient),r,o);s.position[0]=i[0],e.add(s);var l=this.visualMapModel.textStyleModel,u=new ac.Text({draggable:!0,drift:r,onmousemove:function(e){Bt.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=nH([[0,0]],"move");a.position[0]=t[0],a.attr({invisible:!0,silent:!0}),e.add(a);var r=this.visualMapModel.textStyleModel,o=new ac.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():aH(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=[JF(t[0],i,n,!0),JF(t[1],i,n,!0)]},_updateInterval:function(e,t){t=t||0;var i=this.visualMapModel,n=this._handleEnds,a=[0,i.itemSize[1]];OL(t,n,a,e,0);var r=i.getExtent();this._dataInterval=[JF(n[0],a,r,!0),JF(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 Gu(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 ac.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;QF([0,1],(function(o){var s=a[o];s.setStyle("fill",t.handlesColor[o]),s.position[1]=e[o];var l=ac.applyTransform(i.handleLabelPoints[o],ac.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=JF(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,-eH(t,tH(i,0))],[6,0],[0,eH(t,tH(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=ac.applyTransform(u.indicatorLabelPoint,ac.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]=eH(tH(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=eH(tH(a[0],e),a[1]);var o=function(e,t,i){var n=6,a=e.get("hoverLinkDataSize");a&&(n=JF(a,t,i,!0)/2);return n}(i,r,a),s=[e-o,e+o],l=JF(e,a,r,!0),u=[JF(s[0],a,r,!0),JF(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||aH(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=zo.compressBatches(h,c);this._dispatchHighDown("downplay",KF.makeHighDownBatch(d[0],i)),this._dispatchHighDown("highlight",KF.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",KF.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=ac.getTransform(t,n?null:this.group);return ac[He.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 nH(e,t,i,n){return new ac.Polygon({shape:{points:e},draggable:!!i,cursor:t,drift:i,onmousemove:function(e){Bt.stop(e.event)},ondragend:n})}function aH(e){var t=e.get("hoverLinkOnHandle");return!!(null==t?e.get("realtime"):t)}function rH(e){return"vertical"===e?"ns-resize":"ew-resize"}K_.registerAction({type:"selectDataRange",event:"dataRangeSelected",update:"update"},(function(e,t){t.eachComponent({mainType:"visualMap",query:e},(function(t){t.setSelected(e.selected)}))})),K_.registerPreprocessor(DF);var oH=Rc.reformIntervals,sH=WF.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){sH.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var i=this._mode=this._determineMode();lH[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=He.clone(n)):(e.dataExtent=this.getExtent(),e.mappingMethod="piecewise",e.pieceList=He.map(this._pieceList,(function(e){e=He.clone(e);return"inRange"!==t&&(e.visual=null),e})))}))},completeVisualOption:function(){var e=this.option,t={},i=mC.listVisualTypes(),n=this.isCategory();function a(e,t,i){return e&&e[t]&&(He.isObject(e[t])?e[t].hasOwnProperty(i):e[t]===i)}He.each(e.pieces,(function(e){He.each(i,(function(i){e.hasOwnProperty(i)&&(t[i]=1)}))})),He.each(t,(function(t,i){var r=0;He.each(this.stateList,(function(t){r|=a(e,t,i)||a(e.target,t,i)}),this),!r&&He.each(this.stateList,(function(t){(e[t]||(e[t]={}))[i]=RF.get(i,"inRange"===t?"active":"inactive",n)}))}),this),WF.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,He.each(n,(function(e,t){var i=this.getSelectedMapKey(e);a.hasOwnProperty(i)||(a[i]=!0)}),this),"single"===i.selectedMode){var r=!1;He.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=He.clone(e)},getValueState:function(e){var t=mC.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){mC.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 He.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})}}}),lH={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]}),oH(t),He.each(t,(function(e,t){e.index=t,e.text=this.formatValueText(e.interval)}),this)},categories:function(){var e=this.option;He.each(e.categories,(function(e){this._pieceList.push({text:this.formatValueText(e,!0),value:e})}),this),uH(e,this._pieceList)},pieces:function(){var e=this.option,t=this._pieceList;He.each(e.pieces,(function(e,i){He.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=mC.retrieveVisuals(e),t.push(n)}),this),uH(e,t),oH(t),He.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 uH(e,t){var i=e.inverse;("vertical"===e.orient?!i:i)&&t.reverse()}var hH=Xx.createSymbol;XF.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=He.retrieve(t.get("showLabel",!0),!u);u&&this._renderEndsText(e,u[0],s,h,o),He.each(l.viewPieceList,(function(n){var l=n.piece,u=new ac.Group;u.onclick=He.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 ac.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),od.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:KF.makeHighDownBatch(i.findTargetDataIndices(t),i)})}e.on("mouseover",He.bind(i,this,"highlight")).on("mouseout",He.bind(i,this,"downplay"))},_getItemAlign:function(){var e=this.visualMapModel,t=e.option;if("vertical"===t.orient)return KF.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 ac.Group,o=this.visualMapModel.textStyleModel;r.add(new ac.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=He.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(hH(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=He.clone(i.selected),a=t.getSelectedMapKey(e);"single"===i.selectedMode?(n[a]=!0,He.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})}}),K_.registerPreprocessor(DF);var cH,dH="urn:schemas-microsoft-com:vml",pH="undefined"==typeof window?null:window,fH=!1,gH=pH&&pH.document;if(gH&&!re.canvasSupported)try{!gH.namespaces.zrvml&&gH.namespaces.add("zrvml",dH),cH=function(e){return gH.createElement("<zrvml:"+e+' class="zrvml">')}}catch(e){cH=function(e){return gH.createElement("<"+e+' xmlns="'+dH+'" class="zrvml">')}}var mH={doc:gH,createNode:function(e){return cH(e)},initVML:function(){if(!fH&&gH){fH=!0;var e=gH.styleSheets;e.length<31?gH.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):e[0].addRule(".zrvml","behavior:url(#default#VML)")}}},vH=ct.applyTransform,yH=Js.CMD,xH=Math.round,_H=Math.sqrt,bH=Math.abs,wH=Math.cos,SH=Math.sin,MH=Math.max;if(!re.canvasSupported){var IH=",",AH="progid:DXImageTransform.Microsoft",TH=21600,CH=TH/2,DH=function(e){e.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",e.coordsize=TH+","+TH,e.coordorigin="0,0"},LH=function(e,t,i){return"rgb("+[e,t,i].join(",")+")"},PH=function(e,t){t&&e&&t.parentNode!==e&&e.appendChild(t)},kH=function(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)},OH=function(e,t,i){return 1e5*(parseFloat(e)||0)+1e3*(parseFloat(t)||0)+i},RH=Sr.parsePercent,EH=function(e,t,i){var n=Yi.parse(t);i=+i,isNaN(i)&&(i=1),n&&(e.color=LH(n[0],n[1],n[2]),e.opacity=i*n[3])},NH=function(e){var t=Yi.parse(e);return[LH(t[0],t[1],t[2]),t[3]]},zH=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 Bu&&kH(e,r),r||(r=mH.createNode(t)),a?function(e,t,i){var n=t.fill;if(null!=n)if(n instanceof Bu){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&&(vH(p,p,d),vH(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&&vH(p,p,d),y/=v[0]*TH,x/=v[1]*TH;var _=MH(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 A=b[I],T=NH(A.color);M.push(A.offset*l+s+" "+T[0]),0!==I&&I!==w-1||S.push(T)}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 EH(e,n,t.opacity)}(r,i,n):function(e,t){t.lineDash&&(e.dashstyle=t.lineDash.join(" ")),null==t.stroke||t.stroke instanceof Bu||EH(e,t.stroke,t.opacity)}(r,i),PH(e,r)):(e[a?"filled":"stroked"]="false",kH(e,r))},BH=[[],[],[]];Ml.prototype.brushVML=function(e){var t=this.style,i=this._vmlEl;i||(i=mH.createNode("shape"),DH(i),this._vmlEl=i),zH(i,"fill",t,this),zH(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*=_H(bH(s))}r.weight=o+"px"}var l=this.path||(this.path=new Js);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=yH.M,u=yH.C,h=yH.L,c=yH.A,d=yH.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++],BH[0][0]=o,BH[0][1]=s;break;case h:n=" l ",i=1,o=f[r++],s=f[r++],BH[0][0]=o,BH[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++]),BH[0][0]=y,BH[0][1]=x,BH[1][0]=_,BH[1][1]=b,BH[2][0]=m,BH[2][1]=v,o=m,s=v;break;case c:var w=0,S=0,M=1,I=1,A=0;t&&(w=t[4],S=t[5],M=_H(t[0]*t[0]+t[1]*t[1]),I=_H(t[2]*t[2]+t[3]*t[3]),A=Math.atan2(-t[1]/I,t[0]/M));var T=f[r++],C=f[r++],D=f[r++],L=f[r++],P=f[r++]+A,k=f[r++]+P+A;r++;var O=f[r++],R=T+wH(P)*D,E=C+SH(P)*L,N=(y=T+wH(k)*D,x=C+SH(k)*L,O?" wa ":" at ");Math.abs(R-y)<1e-4&&(Math.abs(k-P)>.01?O&&(R+=270/TH):Math.abs(E-C)<1e-4?O&&R<T||!O&&R>T?x-=270/TH:x+=270/TH:O&&E<C||!O&&E>C?y+=270/TH:y-=270/TH),p.push(N,xH(((T-D)*M+w)*TH-CH),IH,xH(((C-L)*I+S)*TH-CH),IH,xH(((T+D)*M+w)*TH-CH),IH,xH(((C+L)*I+S)*TH-CH),IH,xH((R*M+w)*TH-CH),IH,xH((E*I+S)*TH-CH),IH,xH((y*M+w)*TH-CH),IH,xH((x*I+S)*TH-CH)),o=y,s=x;break;case yH.R:var z=BH[0],B=BH[1];z[0]=f[r++],z[1]=f[r++],B[0]=z[0]+f[r++],B[1]=z[1]+f[r++],t&&(vH(z,z,t),vH(B,B,t)),z[0]=xH(z[0]*TH-CH),B[0]=xH(B[0]*TH-CH),z[1]=xH(z[1]*TH-CH),B[1]=xH(B[1]*TH-CH),p.push(" m ",z[0],IH,z[1]," l ",B[0],IH,z[1]," l ",B[0],IH,B[1]," l ",z[0],IH,B[1]);break;case yH.Z:p.push(" x ")}if(i>0){p.push(n);for(var V=0;V<i;V++){var G=BH[V];t&&vH(G,G,t),p.push(xH(G[0]*TH-CH),IH,xH(G[1]*TH-CH),V<i-1?IH:"")}}}return p.join("")}(l,this.transform),i.style.zIndex=OH(this.zlevel,this.z,this.z2),PH(e,i),null!=t.text?this.drawRectText(e,this.getBoundingRect()):this.removeRectText(e)},Ml.prototype.onRemove=function(e){kH(e,this._vmlEl),this.removeRectText(e)},Ml.prototype.onAdd=function(e){PH(e,this._vmlEl),this.appendRectText(e)};Pr.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=mH.doc.createElement("div"),DH(x),this._vmlEl=x);var _,b=x.style,w=!1,S=1,M=1;if(this.transform&&(_=this.transform,S=_H(_[0]*_[0]+_[1]*_[1]),M=_H(_[2]*_[2]+_[3]*_[3]),w=_[1]||_[2]),w){var I=[h,c],A=[h+d,c],T=[h,c+p],C=[h+d,c+p];vH(I,I,_),vH(A,A,_),vH(T,T,_),vH(C,C,_);var D=MH(I[0],A[0],T[0],C[0]),L=MH(I[1],A[1],T[1],C[1]),P=[];P.push("M11=",_[0]/S,IH,"M12=",_[2]/M,IH,"M21=",_[1]/S,IH,"M22=",_[3]/M,IH,"Dx=",xH(h*S+_[4]),IH,"Dy=",xH(c*M+_[5])),b.padding="0 "+xH(D)+"px "+xH(L)+"px 0",b.filter=AH+".Matrix("+P.join("")+", SizingMethod=clip)"}else _&&(h=h*S+_[4],c=c*M+_[5]),b.filter="",b.left=xH(h)+"px",b.top=xH(c)+"px";var k=this._imageEl,O=this._cropEl;k||(k=mH.doc.createElement("div"),this._imageEl=k);var R=k.style;if(y){if(t&&i)R.width=xH(S*t*d/f)+"px",R.height=xH(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=xH(S*t*d/f)+"px",R.height=xH(M*i*p/g)+"px",N._imageWidth=t,N._imageHeight=i,N._imageSrc=r},E.src=r}O||((O=mH.doc.createElement("div")).style.overflow="hidden",this._cropEl=O);var z=O.style;z.width=xH((d+m*d/f)*S),z.height=xH((p+v*p/g)*M),z.filter=AH+".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=xH(S*d)+"px",R.height=xH(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="+xH(100*V)+") "),B+=AH+".AlphaImageLoader(src="+r+", SizingMethod=scale)",R.filter=B,x.style.zIndex=OH(this.zlevel,this.z,this.z2),PH(e,x),null!=a.text&&this.drawRectText(e,this.getBoundingRect())}},Pr.prototype.onRemove=function(e){kH(e,this._vmlEl),this._vmlEl=null,this._cropEl=null,this._imageEl=null,this.removeRectText(e)},Pr.prototype.onAdd=function(e){PH(e,this._vmlEl),this.appendRectText(e)};var VH,GH="normal",FH={},HH=0,WH=document.createElement("div");Za.$override("measureText",(function(e,t){var i=mH.doc;VH||((VH=i.createElement("div")).style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",mH.doc.body.appendChild(VH));try{VH.style.font=t}catch(e){}return VH.innerHTML="",VH.appendChild(i.createTextNode(e)),{width:VH.offsetWidth}}));for(var UH=new Rn,jH=function(e,t,i,n){var a=this.style;this.__dirty&&Sr.normalizeTextStyle(a,!0);var r=a.text;if(null!=r&&(r+=""),r){if(a.rich){var o=Za.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=FH[e];if(!t){HH>100&&(HH=0,FH={});var i,n=WH.style;try{n.font=e,i=n.fontFamily.split(",")[0]}catch(e){}t={style:n.fontStyle||GH,variant:n.fontVariant||GH,weight:n.fontWeight||GH,size:0|parseFloat(n.fontSize||12),family:i||"Microsoft YaHei"},FH[e]=t,HH++}return t}(a.font),m=g.style+" "+g.variant+" "+g.weight+" "+g.size+'px "'+g.family+'"';i=i||Za.getBoundingRect(r,m,p,f,a.textPadding,a.textLineHeight);var v=this.transform;if(v&&!n&&(UH.copy(t),UH.applyTransform(v),t=UH),n)c=t.x,d=t.y;else{var y=a.textPosition;if(y instanceof Array)c=t.x+RH(y[0],t.width),d=t.y+RH(y[1],t.height),p=p||"left";else{var x=this.calculateTextPosition?this.calculateTextPosition({},a,t):Za.calculateTextPosition({},a,t);c=x.x,d=x.y,p=p||x.textAlign,f=f||x.textVerticalAlign}}c=Za.adjustTextX(c,i.width,p),d=Za.adjustTextY(d,i.height,f),d+=i.height/2;var _,b,w,S=mH.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",DH(M),_.textpathok=!0,b.on=!0,M.from="0 0",M.to="1000 0.05",PH(M,w),PH(M,_),PH(M,b),this._textVmlEl=M);var I=[c,d],A=M.style;v&&n?(vH(I,I,v),w.on=!0,w.matrix=v[0].toFixed(3)+IH+v[2].toFixed(3)+IH+v[1].toFixed(3)+IH+v[3].toFixed(3)+",0,0",w.offset=(xH(I[0])||0)+","+(xH(I[1])||0),w.origin="0 0",A.left="0px",A.top="0px"):(w.on=!1,A.left=xH(c)+"px",A.top=xH(d)+"px"),b.string=String(r).replace(/&/g,"&amp;").replace(/"/g,"&quot;");try{b.style.font=m}catch(e){}zH(M,"fill",{fill:a.textFill,opacity:a.opacity},this),zH(M,"stroke",{stroke:a.textStroke,opacity:a.opacity,lineDash:a.lineDash||null},this),M.style.zIndex=OH(this.zlevel,this.z,this.z2),PH(e,M)}},ZH=function(e){kH(e,this._textVmlEl),this._textVmlEl=null},YH=function(e){PH(e,this._textVmlEl)},XH=[Tr,Dr,Pr,Ml,Zl],qH=0;qH<XH.length;qH++){var $H=XH[qH].prototype;$H.drawRectText=jH,$H.removeRectText=ZH,$H.appendRectText=YH}Zl.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)},Zl.prototype.onRemove=function(e){this.removeRectText(e)},Zl.prototype.onAdd=function(e){this.appendRectText(e)}}var KH=He.each;function JH(e){return parseInt(e,10)}function QH(e,t){mH.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}QH.prototype={constructor:QH,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||JH(t.width))-JH(t.paddingLeft)-JH(t.paddingRight)|0},_getHeight:function(){var e=this.root,t=e.currentStyle;return(e.clientHeight||JH(t.height))-JH(t.paddingTop)-JH(t.paddingBottom)|0}},KH(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","toDataURL","pathToImage"],(function(e){QH.prototype[e]=function(){}}));var eW=QH;(0,wo.registerPainter)("vml",eW);var tW={createElement:function(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}},iW=tW.createElement,nW=Js.CMD,aW=Array.prototype.join,rW="none",oW=Math.round,sW=Math.sin,lW=Math.cos,uW=Math.PI,hW=2*Math.PI,cW=180/uW,dW=1e-4;function pW(e){return oW(1e4*e)/1e4}function fW(e){return e<dW&&e>-dW}function gW(e,t){t&&mW(e,"transform","matrix("+aW.call(t,",")+")")}function mW(e,t,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&e.setAttribute(t,i)}function vW(e,t,i,n){if(function(e,t){var i=t?e.textFill:e.fill;return null!=i&&i!==rW}(t,i)){var a=i?t.textFill:t.fill;mW(e,"fill",a="transparent"===a?rW:a),mW(e,"fill-opacity",null!=t.fillOpacity?t.fillOpacity*t.opacity:t.opacity)}else mW(e,"fill",rW);if(function(e,t){var i=t?e.textStroke:e.stroke;return null!=i&&i!==rW}(t,i)){var r=i?t.textStroke:t.stroke;mW(e,"stroke",r="transparent"===r?rW:r),mW(e,"stroke-width",(i?t.textStrokeWidth:t.lineWidth)/(!i&&t.strokeNoScale?n.getLineScale():1)),mW(e,"paint-order",i?"stroke":"fill"),mW(e,"stroke-opacity",null!=t.strokeOpacity?t.strokeOpacity:t.opacity),t.lineDash?(mW(e,"stroke-dasharray",t.lineDash.join(",")),mW(e,"stroke-dashoffset",oW(t.lineDashOffset||0))):mW(e,"stroke-dasharray",""),t.lineCap&&mW(e,"stroke-linecap",t.lineCap),t.lineJoin&&mW(e,"stroke-linejoin",t.lineJoin),t.miterLimit&&mW(e,"stroke-miterlimit",t.miterLimit)}else mW(e,"stroke",rW)}var yW={};yW.brush=function(e){var t=e.style,i=e.__svgEl;i||(i=iW("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 nW.M:r="M",o=2;break;case nW.L:r="L",o=2;break;case nW.Q:r="Q",o=4;break;case nW.C:r="C",o=6;break;case nW.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=fW(g-hW)||(f?d>=hW:-d>=hW),v=d>0?d%hW:d%hW+hW,y=!1;y=!!m||!fW(g)&&v>=uW==!!f;var x=pW(s+u*lW(c)),_=pW(l+h*sW(c));m&&(d=f?hW-1e-4:1e-4-hW,y=!0,9===a&&t.push("M",x,_));var b=pW(s+u*lW(c+d)),w=pW(l+h*sW(c+d));t.push("A",pW(u),pW(h),oW(p*cW),+y,+f,b,w);break;case nW.Z:r="Z";break;case nW.R:b=pW(i[a++]),w=pW(i[a++]);var S=pW(i[a++]),M=pW(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(pW(i[a++]))}return t.join(" ")}(n);a.indexOf("NaN")<0&&mW(i,"d",a)}vW(i,t,!1,e),gW(i,e.transform),null!=t.text?IW(e,e.getBoundingRect()):TW(e)};var xW={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=iW("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),mW(s,"width",r),mW(s,"height",o),mW(s,"x",n),mW(s,"y",a),gW(s,e.transform),null!=t.text?IW(e,e.getBoundingRect()):TW(e)}}},_W={},bW=new Rn,wW={},SW=[],MW={left:"start",right:"end",center:"middle",middle:"middle"},IW=function(e,t){var i=e.style,n=e.transform,a=e instanceof Zl||i.transformText;e.__dirty&&Sr.normalizeTextStyle(i,!0);var r=i.text;if(null!=r&&(r+=""),Sr.needDrawText(r,i)){null==r&&(r=""),!a&&n&&(bW.copy(t),bW.applyTransform(n),t=bW);var o=e.__textSvgEl;o||(o=iW("text"),e.__textSvgEl=o);var s=o.style,l=i.font||Za.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=Za.parsePlainText(r,u,h,c,i.truncate));var p=d.outerHeight,f=d.lineHeight;Sr.getBoxPosition(wW,e,i,t);var g=wW.baseX,m=wW.baseY,v=wW.textAlign||"left",y=wW.textVerticalAlign;!function(e,t,i,n,a,r,o){oi.identity(SW),t&&i&&oi.copy(SW,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),SW[4]-=r,SW[5]-=o,oi.rotate(SW,SW,s),SW[4]+=r,SW[5]+=o}gW(e,SW)}(o,a,n,i,t,g,m);var x=g,_=Za.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,vW(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)AW(w[M],v,x,_+M*f)}else{e.__text=r,e.__canCacheByTextString=b;var I=d.lines,A=I.length;for(M=0;M<A;M++){var T=w[M],C=I[M];T?T.__zrText!==C&&(T.innerHTML="",T.appendChild(document.createTextNode(C))):(T=w[M]=iW("tspan"),o.appendChild(T),T.appendChild(document.createTextNode(C))),AW(T,v,x,_+M*f)}if(S>A){for(;M<S;M++)o.removeChild(w[M]);w.length=A}}}};function AW(e,t,i,n){mW(e,"dominant-baseline","middle"),mW(e,"text-anchor",MW[t]),mW(e,"x",i),mW(e,"y",n)}function TW(e){e&&e.__textSvgEl&&(e.__textSvgEl.parentNode&&e.__textSvgEl.parentNode.removeChild(e.__textSvgEl),e.__textSvgEl=null,e.__tspanList=[],e.__text=null)}_W.drawRectText=IW,_W.brush=function(e){null!=e.style.text?IW(e,!1):TW(e)};var CW={path:yW,image:xW,text:_W};function DW(){}function LW(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 PW(e){return{newPos:e.newPos,components:e.components.slice(0)}}DW.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=PW(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 LW(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 kW=new DW;var OW=function(e,t,i){return kW.diff(e,t,i)},RW=tW.createElement,EW=CW.path,NW=CW.image,zW=CW.text;function BW(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}BW.prototype.createElement=RW,BW.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]},BW.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)}}},BW.prototype.addDom=function(e){this.getDefs(!0).appendChild(e)},BW.prototype.removeDom=function(e){var t=this.getDefs(!1);t&&e[this._domName]&&(t.removeChild(e[this._domName]),e[this._domName]=null)},BW.prototype.getDoms=function(){var e=this.getDefs(!1);if(!e)return[];var t=[];return He.each(this._tagNames,(function(i){var n=e.getElementsByTagName(i);t=t.concat([].slice.call(n))})),t},BW.prototype.markAllUnused=function(){var e=this.getDoms(),t=this;He.each(e,(function(e){e[t._markLabel]="0"}))},BW.prototype.markUsed=function(e){e&&(e[this._markLabel]="1")},BW.prototype.removeUnused=function(){var e=this.getDefs(!1);if(e){var t=this.getDoms(),i=this;He.each(t,(function(t){"1"!==t[i._markLabel]&&e.removeChild(t)}))}},BW.prototype.getSvgProxy=function(e){return e instanceof Ml?EW:e instanceof Pr?NW:e instanceof Zl?zW:EW},BW.prototype.getTextSvgElement=function(e){return e.__textSvgEl},BW.prototype.getSvgElement=function(e){return e.__svgEl};var VW=BW;function GW(e,t){VW.call(this,e,t,["linearGradient","radialGradient"],"__gradient_in_use__")}He.inherits(GW,VW),GW.prototype.addWithoutUpdate=function(e,t){if(t&&t.style){var i=this;He.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+")")}}))}},GW.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},GW.prototype.update=function(e){var t=this;VW.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))}))},GW.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=Yi.parse(o)[3],l=Yi.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},GW.prototype.markUsed=function(e){if(e.style){var t=e.style.fill;t&&t._dom&&VW.prototype.markUsed.call(this,t._dom),(t=e.style.stroke)&&t._dom&&VW.prototype.markUsed.call(this,t._dom)}};var FW=GW;function HW(e,t){VW.call(this,e,t,"clipPath","__clippath_in_use__")}He.inherits(HW,VW),HW.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)},HW.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);oi.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")},HW.prototype.markUsed=function(e){var t=this;e.__clipPaths&&He.each(e.__clipPaths,(function(e){e._dom&&VW.prototype.markUsed.call(t,e._dom),e._textDom&&VW.prototype.markUsed.call(t,e._textDom)}))};var WW=HW;function UW(e,t){VW.call(this,e,t,["filter"],"__filter_in_use__","_shadowDom")}function jW(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY||e.textShadowBlur||e.textShadowOffsetX||e.textShadowOffsetY)}He.inherits(UW,VW),UW.prototype.addWithoutUpdate=function(e,t){if(t&&jW(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+")"}},UW.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},UW.prototype.update=function(e,t){if(jW(t.style)){var i=this;VW.prototype.update.call(this,t,(function(){i.updateDom(t,t._shadowDom)}))}else this.remove(e,t)},UW.prototype.remove=function(e,t){null!=t._shadowDomId&&(this.removeDom(e),e.style.filter="")},UW.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},UW.prototype.markUsed=function(e){e._shadowDom&&VW.prototype.markUsed.call(this,e._shadowDom)};var ZW=UW,YW=tW.createElement,XW=CW.path,qW=CW.image,$W=CW.text;function KW(e){return parseInt(e,10)}function JW(e,t){return t&&e&&t.parentNode!==e}function QW(e,t,i){if(JW(e,t)&&i){var n=i.nextSibling;n?e.insertBefore(t,n):e.appendChild(t)}}function eU(e,t){if(JW(e,t)){var i=e.firstChild;i?e.insertBefore(t,i):e.appendChild(t)}}function tU(e,t){t&&e&&t.parentNode===e&&e.removeChild(t)}function iU(e){return e.__textSvgEl}function nU(e){return e.__svgEl}var aU=function(e,t,i,n){this.root=e,this.storage=t,this._opts=i=He.extend({},i||{});var a=YW("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=YW("g");a.appendChild(r);var o=YW("g");a.appendChild(o),this.gradientManager=new FW(n,o),this.clipPathManager=new WW(n,o),this.shadowManager=new ZW(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=[]};aU.prototype={constructor:aU,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=YW("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 Ml?XW:i instanceof Pr?qW:i instanceof Zl?$W:XW,u=nU(s)||iU(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=OW(a,o);for(t=0;t<c.length;t++){if((f=c[t]).removed)for(var d=0;d<f.count;d++){u=nU(s=a[f.indices[d]]);var p=iU(s);tU(n,u),tU(n,p)}}for(t=0;t<c.length;t++){var f;if((f=c[t]).added)for(d=0;d<f.count;d++){u=nU(s=o[f.indices[d]]),p=iU(s);h?QW(n,u,h):eU(n,u),u?QW(n,p,u):h?QW(n,p,h):eU(n,p),QW(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=nU(s=o[f.indices[d]]),p=iU(s),u=nU(s),p=iU(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&&QW(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(YW("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]||KW(s[i])||KW(o.style[i]))-(KW(s[a])||0)-(KW(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<"))}},He.each(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],(function(e){aU.prototype[e]=function(){}}));var rU=aU;(0,wo.registerPainter)("svg",rU);var oU=f(g((function(e,t){!function(){for(var e in K_){if(null==K_||!K_.hasOwnProperty(e)||"default"===e||"__esModule"===e)return;t[e]=K_[e]}}(),function(){for(var e in $_){if(null==$_||!$_.hasOwnProperty(e)||"default"===e||"__esModule"===e)return;t[e]=$_[e]}}()})));K_.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=Kv(["value"],e.data),n=new K_.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 sU=K_.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=lU(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 lU(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 uU=K_.number.parsePercent;K_.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=uU(e.get("outline.itemStyle.borderWidth"),h));var f,g,m,v=uU(o[0],l),y=uU(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=[uU(c,l),uU(c,u)],s=[Math.max(g[0]-m[0],0),Math.max(g[1]-m[1],0)]):(g=(f=uU(s,h)/2)-d/2,m=uU(c,h),s=Math.max(g-m,0)),p)&&(T().style.lineWidth=d,n.add(T()));var b=x?0:v-s,w=x?0:y-s,S=null;n.add(function(){var t=A(s);t.setStyle(e.getModel("backgroundStyle").getItemStyle()),t.style.fill=null,t.z2=5;var i=A(s);i.setStyle(e.getModel("backgroundStyle").getItemStyle()),i.style.stroke=null;var n=new K_.graphic.Group;return n.add(t),n.add(i),n}());var M=this._data,I=[];function A(e,t){if(_){if(0===_.indexOf("path://")){var i=K_.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=K_.graphic.makePath(_.slice(7),{},new K_.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 Xx.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),Xx.createSymbol(_,l,u,2*e,2*e)}return new K_.graphic.Circle({shape:{cx:t?0:v,cy:t?0:y,r:e}})}function T(){var t=A(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=uU(l.get("amplitude"),2*o),p=uU(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 sU({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,K_.graphic.setHoverStyle(b,w);var S=A(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,K_.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),K_.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 K_.graphic.Rect(o),u=i.get("color");K_.graphic.setText(l.style,i,u);var h=new K_.graphic.Rect(o),c=i.get("insideColor");K_.graphic.setText(h.style,i,c),h.style.textFill=c;var d=new K_.graphic.Group;d.add(l),d.add(h);var p=A(s,!0);return S=new K_.graphic.CompoundPath({shape:{paths:t},position:[v,y]}),S.setClipPath(p),h.setClipPath(S),d}(I)),this._data=a},dispose:function(){}}),K_.registerVisual(K_.util.curry(CM,"liquidFill"));let hU=class extends s.Component{constructor(e){super(e),this.chartRef=s.createRef(),this.padding="7vh 2vh 2vh",this.startColor="#0096ff",this.endColor="#00d8ff",this.state={data:0,ratio:0},this.renderChart=()=>{const e={title:{text:`${parseInt((100*this.state.ratio).toFixed(0))}{a|%}`,textStyle:{fontSize:14,lineHeight:14,color:"#cde0ff",rich:{a:{fontSize:10,verticalAlign:"bottom"}}},subtext:`${this.state.data}{a|人}`,subtextStyle:{fontSize:18,lineHeight:18,color:"#cde0ff",rich:{a:{fontSize:12,verticalAlign:"bottom"}}},left:"center",top:"18%"},series:[{type:"liquidFill",radius:"90%",center:["50%","50%"],data:Array.from({length:3}).fill(this.state.ratio),backgroundStyle:{color:"transparent"},outline:{borderDistance:2,itemStyle:{borderWidth:2,borderColor:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:this.startColor},{offset:1,color:this.endColor}],globalCoord:!1}}},itemStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:1,color:this.startColor},{offset:0,color:this.endColor}],globalCoord:!1}},label:{normal:{formatter:""}}}]};this.chart.setOption(e,{notMerge:!0})},i.reaction((()=>e.gpui.params.padding),(e=>{this.padding=e||"7vh 2vh 2vh"}),{fireImmediately:!0}),i.reaction((()=>({startColor:e.gpui.params.startColor,endColor:e.gpui.params.endColor})),(({startColor:e,endColor:t})=>{this.startColor=e||"#0096ff",this.endColor=t||"#00d8ff"}),{fireImmediately:!0})}componentDidMount(){this.chart=this.chart||oU.init(this.chartRef.current),window.addEventListener("resize",(()=>{this.chart.resize()})),i.reaction((()=>this.props.gpui.params),(({equipment_base_url:e,name:t,key:i,lims_gpui_headers:n})=>u(this,void 0,void 0,(function*(){if(console.log(this.props.gpui.params),e&&t){try{const t=new v({baseURL:e,headers:n}),a=yield t.call({method:"gpui/user/stat"}),r=yield t.call({method:"gpui/training/getStat"}),o=yield t.call({method:"gpui/equipment/getStat"});switch(i){case"trainingTotal":this.setState({data:r.totalCount,ratio:1});break;case"trainingPassRate":this.setState({data:r.passCount,ratio:r.passCount/r.totalCount});break;case"autoOptRate":this.setState({data:r.passCount,ratio:r.passCount/a.inner});break;case"equipmentAuxRate":this.setState({data:o.inchargeCount,ratio:o.inchargeEqs/o.totalCount})}}catch(e){console.error(e)}this.renderChart()}}))),{fireImmediately:!0})}render(){return s.createElement("div",{className:"g__index",style:{padding:this.padding}},s.createElement("div",{className:h},s.createElement("div",{ref:this.chartRef,className:c}),s.createElement("div",{className:d},this.props.gpui.params.name)))}};return l([i.observable],hU.prototype,"padding",void 0),l([i.observable],hU.prototype,"startColor",void 0),l([i.observable],hU.prototype,"endColor",void 0),hU=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'"),ie&&e.$$typeof===ie)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(te&&e.$$typeof===te){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(k,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)?$(e):L(e)}],hU),hU}));
