echarts
Version:
Apache ECharts is a powerful, interactive charting and data visualization library for browser
35 lines (31 loc) • 500 kB
JavaScript
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).echarts={})}(this,function(t){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},i=new function(){this.browser=new r,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(i.wxa=!0,i.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?i.worker=!0:!i.hasGlobalWindow||"Deno"in window||"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Node.js")>-1?(i.node=!0,i.svgSupported=!0):function(t,e){var n=e.browser,r=t.match(/Firefox\/([\d.]+)/),i=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);r&&(n.firefox=!0,n.version=r[1]);i&&(n.ie=!0,n.version=i[1]);o&&(n.edge=!0,n.version=o[1],n.newEdge=+o[1].split(".")[0]>18);a&&(n.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!n.ie&&!n.edge,e.pointerEventsSupported="onpointerdown"in window&&(n.edge||n.ie&&+n.version>=11);var s=e.domSupported="undefined"!=typeof document;if(s){var l=document.documentElement.style;e.transform3dSupported=(n.ie&&"transition"in l||n.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),e.transformSupported=e.transform3dSupported||n.ie&&+n.version>=9}}(navigator.userAgent,i);var o="12px sans-serif";var a,s,l=function(t){var e={};if("undefined"==typeof JSON)return e;for(var n=0;n<t.length;n++){var r=String.fromCharCode(n+32),i=(t.charCodeAt(n)-20)/100;e[r]=i}return e}("007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N"),u={createCanvas:function(){return"undefined"!=typeof document&&document.createElement("canvas")},measureText:function(t,e){if(!a){var n=u.createCanvas();a=n&&n.getContext("2d")}if(a)return s!==e&&(s=a.font=e||o),a.measureText(t);t=t||"";var r=/((?:\d+)?\.?\d*)px/.exec(e=e||o),i=r&&+r[1]||12,c=0;if(e.indexOf("mono")>=0)c=i*t.length;else for(var h=0;h<t.length;h++){var f=l[t[h]];c+=null==f?i:f*i}return{width:c}},loadImage:function(t,e,n){var r=new Image;return r.onload=e,r.onerror=n,r.src=t,r},getTime:function(){return Date.now?Date.now():+new Date}};function c(t){for(var e in u)u.hasOwnProperty(e)&&t[e]&&(u[e]=t[e])}var h=z(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),f=z(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),p=Object.prototype.toString,d=Array.prototype,g=d.forEach,v=d.filter,y=d.slice,m=d.map,_=function(){}.constructor,x=_?_.prototype:null,b="__proto__",w=2311,S=Math.pow(2,53)-1;function M(){return w>=S&&(w=0),w++}function T(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];"undefined"!=typeof console&&console.error.apply(console,t)}function k(t){if(null==t||"object"!=typeof t)return t;var e=t,n=p.call(t);if("[object Array]"===n){if(!ft(t)){e=[];for(var r=0,i=t.length;r<i;r++)e[r]=k(t[r])}}else if(f[n]){if(!ft(t)){var o=t.constructor;if(o.from)e=o.from(t);else{e=new o(t.length);for(r=0,i=t.length;r<i;r++)e[r]=t[r]}}}else if(!h[n]&&!ft(t)&&!Q(t))for(var a in e={},t)t.hasOwnProperty(a)&&a!==b&&(e[a]=k(t[a]));return e}function C(t,e,n){if(!j(e)||!j(t))return n?k(e):t;for(var r in e)if(e.hasOwnProperty(r)&&r!==b){var i=t[r],o=e[r];!j(o)||!j(i)||U(o)||U(i)||Q(o)||Q(i)||K(o)||K(i)||ft(o)||ft(i)?!n&&r in t||(t[r]=k(e[r])):C(i,o,n)}return t}function I(t,e){if(Object.assign)Object.assign(t,e);else for(var n in e)e.hasOwnProperty(n)&&n!==b&&(t[n]=e[n]);return t}function D(t,e,n){t=t||{};for(var r=0;r<n.length;r++){var i=n[r];t[i]=e[i]}return t}function A(t,e,n){for(var r=H(e),i=0,o=r.length;i<o;i++){var a=r[i];(n?null!=e[a]:null==t[a])&&(t[a]=e[a])}return t}var L=u.createCanvas;function P(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n}return-1}function O(t,e){var n=t.prototype;function r(){}for(var i in r.prototype=e.prototype,t.prototype=new r,n)n.hasOwnProperty(i)&&(t.prototype[i]=n[i]);t.prototype.constructor=t,t.superClass=e}function R(t,e,n){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var r=Object.getOwnPropertyNames(e),i=0;i<r.length;i++){var o=r[i];"constructor"!==o&&(n?null!=e[o]:null==t[o])&&(t[o]=e[o])}else A(t,e,n)}function N(t){return!!t&&("string"!=typeof t&&"number"==typeof t.length)}function E(t,e,n){if(t&&e)if(t.forEach&&t.forEach===g)t.forEach(e,n);else if(t.length===+t.length)for(var r=0,i=t.length;r<i;r++)e.call(n,t[r],r,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)}function B(t,e,n){if(!t)return[];if(!e)return at(t);if(t.map&&t.map===m)return t.map(e,n);for(var r=[],i=0,o=t.length;i<o;i++)r.push(e.call(n,t[i],i,t));return r}function z(t,e,n,r){if(t&&e){for(var i=0,o=t.length;i<o;i++)n=e.call(r,n,t[i],i,t);return n}}function F(t,e,n){if(!t)return[];if(!e)return at(t);if(t.filter&&t.filter===v)return t.filter(e,n);for(var r=[],i=0,o=t.length;i<o;i++)e.call(n,t[i],i,t)&&r.push(t[i]);return r}function V(t,e,n){if(t&&e)for(var r=0,i=t.length;r<i;r++)if(e.call(n,t[r],r,t))return t[r]}function H(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e}var W=x&&X(x.bind)?x.call.bind(x.bind):function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return function(){return t.apply(e,n.concat(y.call(arguments)))}};function G(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return function(){return t.apply(this,e.concat(y.call(arguments)))}}function U(t){return Array.isArray?Array.isArray(t):"[object Array]"===p.call(t)}function X(t){return"function"==typeof t}function Y(t){return"string"==typeof t}function q(t){return"[object String]"===p.call(t)}function Z(t){return"number"==typeof t}function j(t){var e=typeof t;return"function"===e||!!t&&"object"===e}function K(t){return!!h[p.call(t)]}function $(t){return!!f[p.call(t)]}function Q(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function J(t){return null!=t.colorStops}function tt(t){return null!=t.image}function et(t){return"[object RegExp]"===p.call(t)}function nt(t){return t!=t}function rt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0,r=t.length;n<r;n++)if(null!=t[n])return t[n]}function it(t,e){return null!=t?t:e}function ot(t,e,n){return null!=t?t:null!=e?e:n}function at(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return y.apply(t,e)}function st(t){if("number"==typeof t)return[t,t,t,t];var e=t.length;return 2===e?[t[0],t[1],t[0],t[1]]:3===e?[t[0],t[1],t[2],t[1]]:t}function lt(t,e){if(!t)throw new Error(e)}function ut(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var ct="__ec_primitive__";function ht(t){t[ct]=!0}function ft(t){return t[ct]}var pt=function(){function t(){this.data={}}return t.prototype.delete=function(t){var e=this.has(t);return e&&delete this.data[t],e},t.prototype.has=function(t){return this.data.hasOwnProperty(t)},t.prototype.get=function(t){return this.data[t]},t.prototype.set=function(t,e){return this.data[t]=e,this},t.prototype.keys=function(){return H(this.data)},t.prototype.forEach=function(t){var e=this.data;for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)},t}(),dt="function"==typeof Map;var gt=function(){function t(e){var n=U(e);this.data=dt?new Map:new pt;var r=this;function i(t,e){n?r.set(t,e):r.set(e,t)}e instanceof t?e.each(i):e&&E(e,i)}return t.prototype.hasKey=function(t){return this.data.has(t)},t.prototype.get=function(t){return this.data.get(t)},t.prototype.set=function(t,e){return this.data.set(t,e),e},t.prototype.each=function(t,e){this.data.forEach(function(n,r){t.call(e,n,r)})},t.prototype.keys=function(){var t=this.data.keys();return dt?Array.from(t):t},t.prototype.removeKey=function(t){this.data.delete(t)},t}();function vt(t){return new gt(t)}function yt(t,e){for(var n=new t.constructor(t.length+e.length),r=0;r<t.length;r++)n[r]=t[r];var i=t.length;for(r=0;r<e.length;r++)n[r+i]=e[r];return n}function mt(t,e){var n;if(Object.create)n=Object.create(t);else{var r=function(){};r.prototype=t,n=new r}return e&&I(n,e),n}function _t(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function xt(t,e){return t.hasOwnProperty(e)}function bt(){}var wt=180/Math.PI,St=Number.EPSILON||Math.pow(2,-52),Mt=Object.freeze({__proto__:null,guid:M,logError:T,clone:k,merge:C,mergeAll:function(t,e){for(var n=t[0],r=1,i=t.length;r<i;r++)n=C(n,t[r],e);return n},extend:I,assignProps:D,defaults:A,createCanvas:L,indexOf:P,inherits:O,mixin:R,isArrayLike:N,each:E,map:B,reduce:z,filter:F,find:V,keys:H,bind:W,curry:G,isArray:U,isFunction:X,isString:Y,isStringSafe:q,isNumber:Z,isObject:j,isBuiltInObject:K,isTypedArray:$,isDom:Q,isGradientObject:J,isImagePatternObject:tt,isRegExp:et,eqNaN:nt,retrieve:rt,retrieve2:it,retrieve3:ot,slice:at,normalizeCssArray:st,assert:lt,trim:ut,setAsPrimitive:ht,isPrimitive:ft,HashMap:gt,createHashMap:vt,concatArray:yt,createObject:mt,disableUserSelect:_t,hasOwn:xt,noop:bt,RADIAN_TO_DEGREE:wt,EPSILON:St});function Tt(t,e){return null==t&&(t=0),null==e&&(e=0),[t,e]}function kt(t){return[t[0],t[1]]}function Ct(t,e,n){return t[0]=e,t[1]=n,t}function It(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function Dt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function At(t){return Math.sqrt(Pt(t))}var Lt=At;function Pt(t){return t[0]*t[0]+t[1]*t[1]}var Ot=Pt;function Rt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function Nt(t,e){var n=At(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t}function Et(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Bt=Et;function zt(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var Ft=zt;function Vt(t,e,n,r){return t[0]=e[0]+r*(n[0]-e[0]),t[1]=e[1]+r*(n[1]-e[1]),t}function Ht(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function Wt(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function Gt(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}var Ut=Object.freeze({__proto__:null,create:Tt,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},clone:kt,set:Ct,add:It,scaleAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t},sub:Dt,len:At,length:Lt,lenSquare:Pt,lengthSquare:Ot,mul:function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},div:function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},scale:Rt,normalize:Nt,distance:Et,dist:Bt,distanceSquare:zt,distSquare:Ft,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},lerp:Vt,applyTransform:Ht,min:Wt,max:Gt}),Xt=function(t,e){this.target=t,this.topTarget=e&&e.topTarget},Yt=function(){function t(t){this.handler=t,t.on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent||e.__hostTarget;e&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new Xt(e,t),"dragstart",t.event))},t.prototype._drag=function(t){var e=this._draggingTarget;if(e){var n=t.offsetX,r=t.offsetY,i=n-this._x,o=r-this._y;this._x=n,this._y=r,e.drift(i,o,t),this.handler.dispatchToElement(new Xt(e,t),"drag",t.event);var a=this.handler.findHover(n,r,e).target,s=this._dropTarget;this._dropTarget=a,e!==a&&(s&&a!==s&&this.handler.dispatchToElement(new Xt(s,t),"dragleave",t.event),a&&a!==s&&this.handler.dispatchToElement(new Xt(a,t),"dragenter",t.event))}},t.prototype._dragEnd=function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.handler.dispatchToElement(new Xt(e,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new Xt(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},t}(),qt=function(){function t(t){t&&(this._$eventProcessor=t)}return t.prototype.on=function(t,e,n,r){this._$handlers||(this._$handlers={});var i=this._$handlers;if("function"==typeof e&&(r=n,n=e,e=null),!n||!t)return this;var o=this._$eventProcessor;null!=e&&o&&o.normalizeQuery&&(e=o.normalizeQuery(e)),i[t]||(i[t]=[]);for(var a=0;a<i[t].length;a++)if(i[t][a].h===n)return this;var s={h:n,query:e,ctx:r||this,callAtLast:n.zrEventfulCallAtLast},l=i[t].length-1,u=i[t][l];return u&&u.callAtLast?i[t].splice(l,0,s):i[t].push(s),this},t.prototype.isSilent=function(t){var e=this._$handlers;return!e||!e[t]||!e[t].length},t.prototype.off=function(t,e){var n=this._$handlers;if(!n)return this;if(!t)return this._$handlers={},this;if(e){if(n[t]){for(var r=[],i=0,o=n[t].length;i<o;i++)n[t][i].h!==e&&r.push(n[t][i]);n[t]=r}n[t]&&0===n[t].length&&delete n[t]}else delete n[t];return this},t.prototype.trigger=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[t],i=this._$eventProcessor;if(r)for(var o=e.length,a=r.length,s=0;s<a;s++){var l=r[s];if(!i||!i.filter||null==l.query||i.filter(t,l.query))switch(o){case 0:l.h.call(l.ctx);break;case 1:l.h.call(l.ctx,e[0]);break;case 2:l.h.call(l.ctx,e[0],e[1]);break;default:l.h.apply(l.ctx,e)}}return i&&i.afterTrigger&&i.afterTrigger(t),this},t.prototype.triggerWithContext=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(!this._$handlers)return this;var r=this._$handlers[t],i=this._$eventProcessor;if(r)for(var o=e.length,a=e[o-1],s=r.length,l=0;l<s;l++){var u=r[l];if(!i||!i.filter||null==u.query||i.filter(t,u.query))switch(o){case 0:u.h.call(a);break;case 1:u.h.call(a,e[0]);break;case 2:u.h.call(a,e[0],e[1]);break;default:u.h.apply(a,e.slice(1,o-1))}}return i&&i.afterTrigger&&i.afterTrigger(t),this},t}(),Zt=Math.log(2);function jt(t,e,n,r,i,o){var a=r+"-"+i,s=t.length;if(o.hasOwnProperty(a))return o[a];if(1===e){var l=Math.round(Math.log((1<<s)-1&~i)/Zt);return t[n][l]}for(var u=r|1<<n,c=n+1;r&1<<c;)c++;for(var h=0,f=0,p=0;f<s;f++){var d=1<<f;d&i||(h+=(p%2?-1:1)*t[n][f]*jt(t,e-1,c,u,i|d,o),p++)}return o[a]=h,h}function Kt(t,e){var n=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],r={},i=jt(n,8,0,0,0,r);if(0!==i){for(var o=[],a=0;a<8;a++)for(var s=0;s<8;s++)null==o[s]&&(o[s]=0),o[s]+=((a+s)%2?-1:1)*jt(n,7,0===a?1:0,1<<a,1<<s,r)/i*e[a];return function(t,e,n){var r=e*o[6]+n*o[7]+1;t[0]=(e*o[0]+n*o[1]+o[2])/r,t[1]=(e*o[3]+n*o[4]+o[5])/r}}}var $t="___zrEVENTSAVED";function Qt(t,e,n,r,o){if(e.getBoundingClientRect&&i.domSupported&&!Jt(e)){var a=e[$t]||(e[$t]={}),s=function(t,e){var n=e.markers;if(n)return n;n=e.markers=[];for(var r=["left","right"],i=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=o%2,l=(o>>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[s]+":0",i[l]+":0",r[1-s]+":auto",i[1-l]+":auto",""].join("!important;"),t.appendChild(a),n.push(a)}return e.clearMarkers=function(){E(n,function(t){t.parentNode&&t.parentNode.removeChild(t)})},n}(e,a),l=function(t,e,n){for(var r=n?"invTrans":"trans",i=e[r],o=e.srcCoords,a=[],s=[],l=!0,u=0;u<4;u++){var c=t[u].getBoundingClientRect(),h=2*u,f=c.left,p=c.top;a.push(f,p),l=l&&o&&f===o[h]&&p===o[h+1],s.push(t[u].offsetLeft,t[u].offsetTop)}return l&&i?i:(e.srcCoords=a,e[r]=n?Kt(s,a):Kt(a,s))}(s,a,o);if(l)return l(t,n,r),!0}return!1}function Jt(t){return"CANVAS"===t.nodeName.toUpperCase()}var te=/([&<>"'])/g,ee={"&":"&","<":"<",">":">",'"':""","'":"'"};function ne(t){return null==t?"":(t+"").replace(te,function(t,e){return ee[e]})}var re=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ie=[],oe=i.browser.firefox&&+i.browser.version.split(".")[0]<39;function ae(t,e,n,r){return n=n||{},r?se(t,e,n):oe&&null!=e.layerX&&e.layerX!==e.offsetX?(n.zrX=e.layerX,n.zrY=e.layerY):null!=e.offsetX?(n.zrX=e.offsetX,n.zrY=e.offsetY):se(t,e,n),n}function se(t,e,n){if(i.domSupported&&t.getBoundingClientRect){var r=e.clientX,o=e.clientY;if(Jt(t)){var a=t.getBoundingClientRect();return n.zrX=r-a.left,void(n.zrY=o-a.top)}if(Qt(ie,t,r,o))return n.zrX=ie[0],void(n.zrY=ie[1])}n.zrX=n.zrY=0}function le(t){return t||window.event}function ue(t,e,n){if(null!=(e=le(e)).zrX)return e;var r=e.type;if(r&&r.indexOf("touch")>=0){var i="touchend"!==r?e.targetTouches[0]:e.changedTouches[0];i&&ae(t,i,e,n)}else{ae(t,e,e,n);var o=function(t){var e=t.wheelDelta;if(e)return e;var n=t.deltaX,r=t.deltaY;if(null==n||null==r)return e;return 3*(0!==r?Math.abs(r):Math.abs(n))*(r>0?-1:r<0?1:n>0?-1:1)}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&re.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function ce(t,e,n,r){t.removeEventListener(e,n,r)}var he=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,n){return this._doTrack(t,e,n),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(t,e,n){var r=t.touches;if(r){for(var i={points:[],touches:[],target:e,event:t},o=0,a=r.length;o<a;o++){var s=r[o],l=ae(n,s,{});i.points.push([l.zrX,l.zrY]),i.touches.push(s)}this._track.push(i)}},t.prototype._recognize=function(t){for(var e in pe)if(pe.hasOwnProperty(e)){var n=pe[e](this._track,t);if(n)return n}},t}();function fe(t){var e=t[1][0]-t[0][0],n=t[1][1]-t[0][1];return Math.sqrt(e*e+n*n)}var pe={pinch:function(t,e){var n=t.length;if(n){var r,i=(t[n-1]||{}).points,o=(t[n-2]||{}).points||i;if(o&&o.length>1&&i&&i.length>1){var a=fe(i)/fe(o);!isFinite(a)&&(a=1),e.pinchScale=a;var s=[((r=i)[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}};function de(){return[1,0,0,1,0,0]}function ge(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function ve(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function ye(t,e,n){var r=e[0]*n[0]+e[2]*n[1],i=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t}function me(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t}function _e(t,e,n,r){void 0===r&&(r=[0,0]);var i=e[0],o=e[2],a=e[4],s=e[1],l=e[3],u=e[5],c=Math.sin(n),h=Math.cos(n);return t[0]=i*h+s*c,t[1]=-i*c+s*h,t[2]=o*h+l*c,t[3]=-o*c+h*l,t[4]=h*(a-r[0])+c*(u-r[1])+r[0],t[5]=h*(u-r[1])-c*(a-r[0])+r[1],t}function xe(t,e,n){var r=n[0],i=n[1];return t[0]=e[0]*r,t[1]=e[1]*i,t[2]=e[2]*r,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*i,t}function be(t,e){var n=e[0],r=e[2],i=e[4],o=e[1],a=e[3],s=e[5],l=n*a-o*r;return l?(l=1/l,t[0]=a*l,t[1]=-o*l,t[2]=-r*l,t[3]=n*l,t[4]=(r*s-a*i)*l,t[5]=(o*i-n*s)*l,t):null}var we=Object.freeze({__proto__:null,create:de,identity:ge,copy:ve,mul:ye,translate:me,rotate:_e,scale:xe,invert:be,clone:function(t){var e=[1,0,0,1,0,0];return ve(e,t),e}}),Se=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,n=this.y;return this.x=t[0]*e+t[2]*n+t[4],this.y=t[1]*e+t[3]*n+t[5],this}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,n){t.x=e,t.y=n},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,n){t.x=e.x+n.x,t.y=e.y+n.y},t.sub=function(t,e,n){t.x=e.x-n.x,t.y=e.y-n.y},t.scale=function(t,e,n){t.x=e.x*n,t.y=e.y*n},t.scaleAndAdd=function(t,e,n,r){t.x=e.x+n.x*r,t.y=e.y+n.y*r},t.lerp=function(t,e,n,r){var i=1-r;t.x=i*e.x+r*n.x,t.y=i*e.y+r*n.y},t}(),Me=Math.min,Te=Math.max,ke=Math.abs,Ce=["x","y"],Ie=["width","height"],De=new Se,Ae=new Se,Le=new Se,Pe=new Se,Oe=Xe(),Re=Oe.minTv,Ne=Oe.maxTv,Ee=[0,0],Be=function(){function t(t,e,n,r){ze(this,t,e,n,r)}return t.set=function(t,e,n,r,i){return r<0&&(e+=r,r=-r),i<0&&(n+=i,i=-i),t.x=e,t.y=n,t.width=r,t.height=i,t},t.prototype.union=function(t){var e=Me(t.x,this.x),n=Me(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Te(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=Te(t.y+t.height,this.y+this.height)-n:this.height=t.height,this.x=e,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){return Ve([1,0,0,1,0,0],this,t)},t.prototype.intersect=function(e,n,r){return t.intersect(this,e,n,r)},t.intersect=function(e,n,r,i){r&&Se.set(r,0,0);var o=i&&i.outIntersectRect||null,a=i&&i.clamp;if(o&&(o.x=o.y=o.width=o.height=NaN),!e||!n)return!1;e instanceof t||(e=ze(He,e.x,e.y,e.width,e.height)),n instanceof t||(n=ze(We,n.x,n.y,n.width,n.height));var s=!!r;Oe.reset(i,s);var l=Oe.touchThreshold,u=e.x+l,c=e.x+e.width-l,h=e.y+l,f=e.y+e.height-l,p=n.x+l,d=n.x+n.width-l,g=n.y+l,v=n.y+n.height-l;if(u>c||h>f||p>d||g>v)return!1;var y=!(c<p||d<u||f<g||v<h);return(s||o)&&(Ee[0]=1/0,Ee[1]=0,Ue(u,c,p,d,0,s,o,a),Ue(h,f,g,v,1,s,o,a),s&&Se.copy(r,y?Oe.useDir?Oe.dirMinTv:Re:Ne)),y},t.contain=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},t.prototype.contain=function(e,n){return t.contain(this,e,n)},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(t){Fe(this,t)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e?e.x:0,e?e.y:0,e?e.width:0,e?e.height:0)},t.copy=function(t,e){return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t},t.applyTransform=function(t,e,n){if(n){if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],i=n[3],o=n[4],a=n[5];return t.x=e.x*r+o,t.y=e.y*i+a,t.width=e.width*r,t.height=e.height*i,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}De.x=Le.x=e.x,De.y=Pe.y=e.y,Ae.x=Pe.x=e.x+e.width,Ae.y=Le.y=e.y+e.height,De.transform(n),Pe.transform(n),Ae.transform(n),Le.transform(n),t.x=Me(De.x,Ae.x,Le.x,Pe.x),t.y=Me(De.y,Ae.y,Le.y,Pe.y);var s=Te(De.x,Ae.x,Le.x,Pe.x),l=Te(De.y,Ae.y,Le.y,Pe.y);t.width=s-t.x,t.height=l-t.y}else t!==e&&Fe(t,e)},t.calculateTransform=function(t,e,n){var r=n.width/e.width,i=n.height/e.height;return me(t=ge(t||[]),t,Ct(Ge,-e.x,-e.y)),xe(t,t,Ct(Ge,r,i)),me(t,t,Ct(Ge,n.x,n.y)),t},t}(),ze=Be.set,Fe=Be.copy,Ve=Be.calculateTransform,He=new Be(0,0,0,0),We=new Be(0,0,0,0),Ge=[];function Ue(t,e,n,r,i,o,a,s){var l=ke(e-n),u=ke(r-t),c=Me(l,u),h=Ce[i],f=Ce[1-i],p=Ie[i];e<n||r<t?l<u?(o&&(Ne[h]=-l),s&&(a[h]=e,a[p]=0)):(o&&(Ne[h]=u),s&&(a[h]=t,a[p]=0)):(a&&(a[h]=Te(t,n),a[p]=Me(e,r)-a[h]),o&&(c<Ee[0]||Oe.useDir)&&(Ee[0]=Me(c,Ee[0]),(l<u||!Oe.bidirectional)&&(Re[h]=l,Re[f]=0,Oe.useDir&&Oe.calcDirMTV()),(l>=u||!Oe.bidirectional)&&(Re[h]=-u,Re[f]=0,Oe.useDir&&Oe.calcDirMTV())))}function Xe(){var t=0,e=new Se,n=new Se,r={minTv:new Se,maxTv:new Se,useDir:!1,dirMinTv:new Se,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(i,o){r.touchThreshold=0,i&&null!=i.touchThreshold&&(r.touchThreshold=Te(0,i.touchThreshold)),r.negativeSize=!1,o&&(r.minTv.set(1/0,1/0),r.maxTv.set(0,0),r.useDir=!1,i&&null!=i.direction&&(r.useDir=!0,r.dirMinTv.copy(r.minTv),n.copy(r.minTv),t=i.direction,r.bidirectional=null==i.bidirectional||!!i.bidirectional,r.bidirectional||e.set(Math.cos(t),Math.sin(t))))},calcDirMTV:function(){var o=r.minTv,a=r.dirMinTv,s=o.y*o.y+o.x*o.x,l=Math.sin(t),u=Math.cos(t),c=l*o.y+u*o.x;i(c)?i(o.x)&&i(o.y)&&a.set(0,0):(n.x=s*u/c,n.y=s*l/c,i(n.x)&&i(n.y)?a.set(0,0):(r.bidirectional||e.dot(n)>0)&&n.len()<a.len()&&a.copy(n))}};function i(t){return ke(t)<1e-10}return r}var Ye="silent";function qe(){!function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}(this.event)}var Ze=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handler=null,e}return n(e,t),e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(qt),je=function(t,e){this.x=t,this.y=e},Ke=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],$e=new Be(0,0,0,0),Qe=function(t){function e(e,n,r,i,o){var a=t.call(this)||this;return a._hovered=new je(0,0),a.storage=e,a.painter=n,a.painterRoot=i,a._pointerSize=o,r=r||new Ze,a.proxy=null,a.setHandlerProxy(r),a._draggingMgr=new Yt(a),a}return n(e,t),e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(E(Ke,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var e=t.zrX,n=t.zrY,r=en(this,e,n),i=this._hovered,o=i.target;o&&!o.__zr&&(o=(i=this.findHover(i.x,i.y)).target);var a=this._hovered=r?new je(e,n):this.findHover(e,n),s=a.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(i,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},e.prototype.mouseout=function(t){var e=t.zrEventControl;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new je(0,0)},e.prototype.dispatch=function(t,e){var n=this[t];n&&n.call(this,e)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},e.prototype.dispatchToElement=function(t,e,n){var r=(t=t||{}).target;if(!r||!r.silent){for(var i="on"+e,o=function(t,e,n){return{type:t,event:n,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:qe}}(e,t,n);r&&(r[i]&&(o.cancelBubble=!!r[i].call(r,o)),r.trigger(e,o),r=r.__hostTarget?r.__hostTarget:r.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[i]&&t[i].call(t,o),t.trigger&&t.trigger(e,o)}))}},e.prototype.findHover=function(t,e,n){var r=this.storage.getDisplayList(),i=new je(t,e);if(tn(r,i,t,e,n),this._pointerSize&&!i.target){for(var o=[],a=this._pointerSize,s=a/2,l=new Be(t-s,e-s,a,a),u=r.length-1;u>=0;u--){var c=r[u];c===n||c.ignore||c.ignoreCoarsePointer||c.parent&&c.parent.ignoreCoarsePointer||($e.copy(c.getBoundingRect()),c.transform&&$e.applyTransform(c.transform),$e.intersect(l)&&o.push(c))}if(o.length)for(var h=Math.PI/12,f=2*Math.PI,p=0;p<s;p+=4)for(var d=0;d<f;d+=h){if(tn(o,i,t+p*Math.cos(d),e+p*Math.sin(d),n),i.target)return i}}return i},e.prototype.processGesture=function(t,e){this._gestureMgr||(this._gestureMgr=new he);var n=this._gestureMgr;"start"===e&&n.clear();var r=n.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&n.clear(),r){var i=r.type;t.gestureEvent=i;var o=new je;o.target=r.target,this.dispatchToElement(o,i,r.event)}},e}(qt);function Je(t,e,n){if(t[t.rectHover?"rectContain":"contain"](e,n)){for(var r=t,i=void 0,o=!1;r;){if(r.ignoreClip&&(o=!0),!o){var a=r.getClipPath();if(a&&!a.contain(e,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s?r.ignoreHostSilent?null:s:r.parent}return!i||Ye}return!1}function tn(t,e,n,r,i){for(var o=t.length-1;o>=0;o--){var a=t[o],s=void 0;if(a!==i&&!a.ignore&&(s=Je(a,n,r))&&(!e.topTarget&&(e.topTarget=a),s!==Ye)){e.target=a;break}}}function en(t,e,n){var r=t.painter;return e<0||e>r.getWidth()||n<0||n>r.getHeight()}E(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){Qe.prototype[t]=function(e){var n,r,i=e.zrX,o=e.zrY,a=en(this,i,o);if("mouseup"===t&&a||(r=(n=this.findHover(i,o)).target),"mousedown"===t)this._downEl=r,this._downPoint=[e.zrX,e.zrY],this._upEl=r;else if("mouseup"===t)this._upEl=r;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Bt(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(n,t,e)}});function nn(t,e,n,r){var i=e+1;if(i===n)return 1;if(r(t[i++],t[e])<0){for(;i<n&&r(t[i],t[i-1])<0;)i++;!function(t,e,n){n--;for(;e<n;){var r=t[e];t[e++]=t[n],t[n--]=r}}(t,e,i)}else for(;i<n&&r(t[i],t[i-1])>=0;)i++;return i-e}function rn(t,e,n,r,i){for(r===e&&r++;r<n;r++){for(var o,a=t[r],s=e,l=r;s<l;)i(a,t[o=s+l>>>1])<0?l=o:s=o+1;var u=r-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;u>0;)t[s+u]=t[s+u-1],u--}t[s]=a}}function on(t,e,n,r,i,o){var a=0,s=0,l=1;if(o(t,e[n+i])>0){for(s=r-i;l<s&&o(t,e[n+i+l])>0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}else{for(s=i+1;l<s&&o(t,e[n+i-l])<=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}for(a++;a<l;){var c=a+(l-a>>>1);o(t,e[n+c])>0?a=c+1:l=c}return l}function an(t,e,n,r,i,o){var a=0,s=0,l=1;if(o(t,e[n+i])<0){for(s=i+1;l<s&&o(t,e[n+i-l])<0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s);var u=a;a=i-l,l=i-u}else{for(s=r-i;l<s&&o(t,e[n+i+l])>=0;)a=l,(l=1+(l<<1))<=0&&(l=s);l>s&&(l=s),a+=i,l+=i}for(a++;a<l;){var c=a+(l-a>>>1);o(t,e[n+c])<0?l=c:a=c+1}return l}function sn(t,e){var n,r,i=7,o=0,a=[];function s(s){var l=n[s],u=r[s],c=n[s+1],h=r[s+1];r[s]=u+h,s===o-3&&(n[s+1]=n[s+2],r[s+1]=r[s+2]),o--;var f=an(t[c],t,l,u,0,e);l+=f,0!==(u-=f)&&0!==(h=on(t[l+u-1],t,c,h,h-1,e))&&(u<=h?function(n,r,o,s){var l=0;for(l=0;l<r;l++)a[l]=t[n+l];var u=0,c=o,h=n;if(t[h++]=t[c++],0===--s){for(l=0;l<r;l++)t[h+l]=a[u+l];return}if(1===r){for(l=0;l<s;l++)t[h+l]=t[c+l];return void(t[h+s]=a[u])}var f,p,d,g=i;for(;;){f=0,p=0,d=!1;do{if(e(t[c],a[u])<0){if(t[h++]=t[c++],p++,f=0,0===--s){d=!0;break}}else if(t[h++]=a[u++],f++,p=0,1===--r){d=!0;break}}while((f|p)<g);if(d)break;do{if(0!==(f=an(t[c],a,u,r,0,e))){for(l=0;l<f;l++)t[h+l]=a[u+l];if(h+=f,u+=f,(r-=f)<=1){d=!0;break}}if(t[h++]=t[c++],0===--s){d=!0;break}if(0!==(p=on(a[u],t,c,s,0,e))){for(l=0;l<p;l++)t[h+l]=t[c+l];if(h+=p,c+=p,0===(s-=p)){d=!0;break}}if(t[h++]=a[u++],1===--r){d=!0;break}g--}while(f>=7||p>=7);if(d)break;g<0&&(g=0),g+=2}if((i=g)<1&&(i=1),1===r){for(l=0;l<s;l++)t[h+l]=t[c+l];t[h+s]=a[u]}else{if(0===r)throw new Error;for(l=0;l<r;l++)t[h+l]=a[u+l]}}(l,u,c,h):function(n,r,o,s){var l=0;for(l=0;l<s;l++)a[l]=t[o+l];var u=n+r-1,c=s-1,h=o+s-1,f=0,p=0;if(t[h--]=t[u--],0===--r){for(f=h-(s-1),l=0;l<s;l++)t[f+l]=a[l];return}if(1===s){for(p=(h-=r)+1,f=(u-=r)+1,l=r-1;l>=0;l--)t[p+l]=t[f+l];return void(t[h]=a[c])}var d=i;for(;;){var g=0,v=0,y=!1;do{if(e(a[c],t[u])<0){if(t[h--]=t[u--],g++,v=0,0===--r){y=!0;break}}else if(t[h--]=a[c--],v++,g=0,1===--s){y=!0;break}}while((g|v)<d);if(y)break;do{if(0!==(g=r-an(a[c],t,n,r,r-1,e))){for(r-=g,p=(h-=g)+1,f=(u-=g)+1,l=g-1;l>=0;l--)t[p+l]=t[f+l];if(0===r){y=!0;break}}if(t[h--]=a[c--],1===--s){y=!0;break}if(0!==(v=s-on(t[u],a,0,s,s-1,e))){for(s-=v,p=(h-=v)+1,f=(c-=v)+1,l=0;l<v;l++)t[p+l]=a[f+l];if(s<=1){y=!0;break}}if(t[h--]=t[u--],0===--r){y=!0;break}d--}while(g>=7||v>=7);if(y)break;d<0&&(d=0),d+=2}(i=d)<1&&(i=1);if(1===s){for(p=(h-=r)+1,f=(u-=r)+1,l=r-1;l>=0;l--)t[p+l]=t[f+l];t[h]=a[c]}else{if(0===s)throw new Error;for(f=h-(s-1),l=0;l<s;l++)t[f+l]=a[l]}}(l,u,c,h))}return n=[],r=[],{mergeRuns:function(){for(;o>1;){var t=o-2;if(t>=1&&r[t-1]<=r[t]+r[t+1]||t>=2&&r[t-2]<=r[t]+r[t-1])r[t-1]<r[t+1]&&t--;else if(r[t]>r[t+1])break;s(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&r[t-1]<r[t+1]&&t--,s(t)}},pushRun:function(t,e){n[o]=t,r[o]=e,o+=1}}}function ln(t,e,n,r){n||(n=0),r||(r=t.length);var i=r-n;if(!(i<2)){var o=0;if(i<32)rn(t,n,r,n+(o=nn(t,n,r,e)),e);else{var a=sn(t,e),s=function(t){for(var e=0;t>=32;)e|=1&t,t>>=1;return t+e}(i);do{if((o=nn(t,n,r,e))<s){var l=i;l>s&&(l=s),rn(t,n,n+l,n+o,e),o=l}a.pushRun(n,o),a.mergeRuns(),i-=o,n+=o}while(0!==i);a.forceMergeRuns()}}}var un=!1;function cn(){un||(un=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function hn(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var fn=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=hn}return t.prototype.traverse=function(t,e){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(t,e)},t.prototype.getDisplayList=function(t,e){e=e||!1;var n=this._displayList;return!t&&n.length||this.updateDisplayList(e),n},t.prototype.updateDisplayList=function(t){this._displayListLen=0;for(var e=this._roots,n=this._displayList,r=0,i=e.length;r<i;r++)this._updateAndAddDisplayable(e[r],null,t);n.length=this._displayListLen,ln(n,hn)},t.prototype._updateAndAddDisplayable=function(t,e,n){if(!t.ignore||n){t.beforeUpdate(),t.update(),t.afterUpdate();var r=t.getClipPath(),i=e&&e.length,o=0,a=t.__clipPaths;if(!t.ignoreClip&&(i||r)){if(a||(a=t.__clipPaths=[]),i)for(var s=0;s<e.length;s++)a[o++]=e[s];for(var l=r,u=t;l;)l.parent=u,l.updateTransform(),a[o++]=l,u=l,l=l.getClipPath()}if(a&&(a.length=o),t.childrenRef){for(var c=t.childrenRef(),h=0;h<c.length;h++){var f=c[h];t.__dirty&&(f.__dirty|=1),this._updateAndAddDisplayable(f,a,n)}t.__dirty=0}else{var p=t;isNaN(p.z)&&(cn(),p.z=0),isNaN(p.z2)&&(cn(),p.z2=0),isNaN(p.zlevel)&&(cn(),p.zlevel=0),this._displayList[this._displayListLen++]=p}var d=t.getDecalElement&&t.getDecalElement();d&&this._updateAndAddDisplayable(d,a,n);var g=t.getTextGuideLine();g&&this._updateAndAddDisplayable(g,a,n);var v=t.getTextContent();v&&this._updateAndAddDisplayable(v,a,n)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,n=t.length;e<n;e++)this.delRoot(t[e]);else{var r=P(this._roots,t);r>=0&&this._roots.splice(r,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}(),pn=i.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)},dn={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,n=.1;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=.4*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,n=.1,r=.4;return 0===t?0:1===t?1:(!n||n<1?(n=1,e=.1):e=r*Math.asin(1/n)/(2*Math.PI),(t*=2)<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-dn.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*dn.bounceIn(2*t):.5*dn.bounceOut(2*t-1)+.5}},gn=Math.pow,vn=Math.sqrt,yn=1e-8,mn=1e-4,_n=vn(3),xn=1/3,bn=Tt(),wn=Tt(),Sn=Tt();function Mn(t){return t>-1e-8&&t<yn}function Tn(t){return t>yn||t<-1e-8}function kn(t,e,n,r,i){var o=1-i;return o*o*(o*t+3*i*e)+i*i*(i*r+3*o*n)}function Cn(t,e,n,r,i){var o=1-i;return 3*(((e-t)*o+2*(n-e)*i)*o+(r-n)*i*i)}function In(t,e,n,r,i,o){var a=r+3*(e-n)-t,s=3*(n-2*e+t),l=3*(e-t),u=t-i,c=s*s-3*a*l,h=s*l-9*a*u,f=l*l-3*s*u,p=0;if(Mn(c)&&Mn(h)){if(Mn(s))o[0]=0;else(M=-l/s)>=0&&M<=1&&(o[p++]=M)}else{var d=h*h-4*c*f;if(Mn(d)){var g=h/c,v=-g/2;(M=-s/a+g)>=0&&M<=1&&(o[p++]=M),v>=0&&v<=1&&(o[p++]=v)}else if(d>0){var y=vn(d),m=c*s+1.5*a*(-h+y),_=c*s+1.5*a*(-h-y);(M=(-s-((m=m<0?-gn(-m,xn):gn(m,xn))+(_=_<0?-gn(-_,xn):gn(_,xn))))/(3*a))>=0&&M<=1&&(o[p++]=M)}else{var x=(2*c*s-3*a*h)/(2*vn(c*c*c)),b=Math.acos(x)/3,w=vn(c),S=Math.cos(b),M=(-s-2*w*S)/(3*a),T=(v=(-s+w*(S+_n*Math.sin(b)))/(3*a),(-s+w*(S-_n*Math.sin(b)))/(3*a));M>=0&&M<=1&&(o[p++]=M),v>=0&&v<=1&&(o[p++]=v),T>=0&&T<=1&&(o[p++]=T)}}return p}function Dn(t,e,n,r,i){var o=6*n-12*e+6*t,a=9*e+3*r-3*t-9*n,s=3*e-3*t,l=0;if(Mn(a)){if(Tn(o))(c=-s/o)>=0&&c<=1&&(i[l++]=c)}else{var u=o*o-4*a*s;if(Mn(u))i[0]=-o/(2*a);else if(u>0){var c,h=vn(u),f=(-o-h)/(2*a);(c=(-o+h)/(2*a))>=0&&c<=1&&(i[l++]=c),f>=0&&f<=1&&(i[l++]=f)}}return l}function An(t,e,n,r,i,o){var a=(e-t)*i+t,s=(n-e)*i+e,l=(r-n)*i+n,u=(s-a)*i+a,c=(l-s)*i+s,h=(c-u)*i+u;o[0]=t,o[1]=a,o[2]=u,o[3]=h,o[4]=h,o[5]=c,o[6]=l,o[7]=r}function Ln(t,e,n,r,i,o,a,s,l){for(var u=t,c=e,h=0,f=1/l,p=1;p<=l;p++){var d=p*f,g=kn(t,n,i,a,d),v=kn(e,r,o,s,d),y=g-u,m=v-c;h+=Math.sqrt(y*y+m*m),u=g,c=v}return h}function Pn(t,e,n,r){var i=1-r;return i*(i*t+2*r*e)+r*r*n}function On(t,e,n,r){return 2*((1-r)*(e-t)+r*(n-e))}function Rn(t,e,n){var r=t+n-2*e;return 0===r?.5:(t-e)/r}function Nn(t,e,n,r,i){var o=(e-t)*r+t,a=(n-e)*r+e,s=(a-o)*r+o;i[0]=t,i[1]=o,i[2]=s,i[3]=s,i[4]=a,i[5]=n}function En(t,e,n,r,i,o,a){for(var s=t,l=e,u=0,c=1/a,h=1;h<=a;h++){var f=h*c,p=Pn(t,n,i,f),d=Pn(e,r,o,f),g=p-s,v=d-l;u+=Math.sqrt(g*g+v*v),s=p,l=d}return u}var Bn=/cubic-bezier\(([0-9,\.e ]+)\)/;function zn(t){var e=t&&Bn.exec(t);if(e){var n=e[1].split(","),r=+ut(n[0]),i=+ut(n[1]),o=+ut(n[2]),a=+ut(n[3]);if(isNaN(r+i+o+a))return;var s=[];return function(t){return t<=0?0:t>=1?1:In(0,r,o,1,t,s)&&kn(0,i,a,1,s[0])}}}var Fn=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||bt,this.ondestroy=t.ondestroy||bt,this.onrestart=t.onrestart||bt,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var n=this._life,r=t-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,a=o?o(i):i;if(this.onframe(a),1===i){if(!this.loop)return!0;var s=r%n;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=X(t)?t:dn[t]||zn(t)},t}(),Vn=function(t){this.value=t},Hn=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new Vn(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),Wn=function(){function t(t){this._list=new Hn,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var n=this._list,r=this._map,i=null;if(null==r[t]){var o=n.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new Vn(e),a.key=t,n.insertEntry(a),r[t]=a}return i},t.prototype.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),Gn={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 Un(t){return(t=Math.round(t))<0?0:t>255?255:t}function Xn(t){return t<0?0:t>1?1:t}function Yn(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Un(parseFloat(e)/100*255):Un(parseInt(e,10))}function qn(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Xn(parseFloat(e)/100):Xn(parseFloat(e))}function Zn(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function jn(t,e,n){return t+(e-t)*n}function Kn(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function $n(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Qn=new Wn(20),Jn=null;function tr(t,e){Jn&&$n(Jn,e),Jn=Qn.put(t,Jn||e.slice())}function er(t,e){if(t){e=e||[];var n=Qn.get(t);if(n)return $n(e,n);var r=(t+="").replace(/ /g,"").toLowerCase();if(r in Gn)return $n(e,Gn[r]),tr(t,e),e;var i,o=r.length;if("#"===r.charAt(0))return 4===o||5===o?(i=parseInt(r.slice(1,4),16))>=0&&i<=4095?(Kn(e,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,5===o?parseInt(r.slice(4),16)/15:1),tr(t,e),e):void Kn(e,0,0,0,1):7===o||9===o?(i=parseInt(r.slice(1,7),16))>=0&&i<=16777215?(Kn(e,(16711680&i)>>16,(65280&i)>>8,255&i,9===o?parseInt(r.slice(7),16)/255:1),tr(t,e),e):void Kn(e,0,0,0,1):void 0;var a=r.indexOf("("),s=r.indexOf(")");if(-1!==a&