You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
200 KiB
1 line
200 KiB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).zrender={})}(this,function(t){"use strict";var e=function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1},h=new function(){this.browser=new e,this.node=!1,this.wxa=!1,this.worker=!1,this.canvasSupported=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1};"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(h.wxa=!0,h.canvasSupported=!0,h.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?(h.worker=!0,h.canvasSupported=!0):"undefined"==typeof navigator?(h.node=!0,h.canvasSupported=!0,h.svgSupported=!0):function(t,e){var r=e.browser,i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge?\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(r.firefox=!0,r.version=i[1]);n&&(r.ie=!0,r.version=n[1]);o&&(r.edge=!0,r.version=o[1],r.newEdge=18<+o[1].split(".")[0]);a&&(r.weChat=!0);e.canvasSupported=!!document.createElement("canvas").getContext,e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&11<=+r.version),e.domSupported="undefined"!=typeof document}(navigator.userAgent,h);var s={"[object Function]":!0,"[object RegExp]":!0,"[object Date]":!0,"[object Error]":!0,"[object CanvasGradient]":!0,"[object CanvasPattern]":!0,"[object Image]":!0,"[object Canvas]":!0},l={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0},u=Object.prototype.toString,r=Array.prototype,a=r.forEach,p=r.filter,n=r.slice,c=r.map,i=function(){}.constructor,o=i?i.prototype:null,f={};var d=2311;function y(){return d++}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];"undefined"!=typeof console&&console.error.apply(console,t)}function v(t){if(null==t||"object"!=typeof t)return t;var e=t,r=u.call(t);if("[object Array]"===r){if(!q(t)){e=[];for(var i=0,n=t.length;i<n;i++)e[i]=v(t[i])}}else if(l[r]){if(!q(t)){var o=t.constructor;if(o.from)e=o.from(t);else{e=new o(t.length);for(i=0,n=t.length;i<n;i++)e[i]=v(t[i])}}}else if(!s[r]&&!q(t)&&!B(t))for(var a in e={},t)t.hasOwnProperty(a)&&(e[a]=v(t[a]));return e}function _(t,e,r){if(!z(e)||!z(t))return r?v(e):t;for(var i in e){var n,o;e.hasOwnProperty(i)&&(n=t[i],!z(o=e[i])||!z(n)||C(o)||C(n)||B(o)||B(n)||I(o)||I(n)||q(o)||q(n)?!r&&i in t||(t[i]=v(e[i])):_(n,o,r))}return t}function m(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function x(t,e,r){for(var i=L(e),n=0;n<i.length;n++){var o=i[n];(r?null!=e[o]:null==t[o])&&(t[o]=e[o])}return t}var w=function(){return f.createCanvas()};function D(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r}return-1}function b(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),n=0;n<i.length;n++){var o=i[n];"constructor"!==o&&(r?null!=e[o]:null==t[o])&&(t[o]=e[o])}else x(t,e,r)}function M(t){return!!t&&("string"!=typeof t&&"number"==typeof t.length)}function k(t,e,r){if(t&&e)if(t.forEach&&t.forEach===a)t.forEach(e,r);else if(t.length===+t.length)for(var i=0,n=t.length;i<n;i++)e.call(r,t[i],i,t);else for(var o in t)t.hasOwnProperty(o)&&e.call(r,t[o],o,t)}function W(t,e,r){if(!t)return[];if(!e)return X(t);if(t.map&&t.map===c)return t.map(e,r);for(var i=[],n=0,o=t.length;n<o;n++)i.push(e.call(r,t[n],n,t));return i}function S(t,e,r,i){if(t&&e){for(var n=0,o=t.length;n<o;n++)r=e.call(i,r,t[n],n,t);return r}}function L(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}f.createCanvas=function(){return document.createElement("canvas")};var T=o&&A(o.bind)?o.call.bind(o.bind):function(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return function(){return t.apply(e,r.concat(n.call(arguments)))}};function C(t){return Array.isArray?Array.isArray(t):"[object Array]"===u.call(t)}function A(t){return"function"==typeof t}function P(t){return"string"==typeof t}function R(t){return"number"==typeof t}function z(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function I(t){return!!s[u.call(t)]}function O(t){return!!l[u.call(t)]}function B(t){return"object"==typeof t&&"number"==typeof t.nodeType&&"object"==typeof t.ownerDocument}function E(t){return null!=t.colorStops}function F(t){return null!=t.image}function H(t,e){return null!=t?t:e}function N(t,e,r){return null!=t?t:null!=e?e:r}function X(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return n.apply(t,e)}function j(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 Y(t){return null==t?null:"function"==typeof t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var G="__ec_primitive__";function q(t){return t[G]}var U=(V.prototype.get=function(t){return this.data.hasOwnProperty(t)?this.data[t]:null},V.prototype.set=function(t,e){return this.data[t]=e},V.prototype.each=function(t,e){for(var r in this.data)this.data.hasOwnProperty(r)&&t.call(e,this.data[r],r)},V.prototype.keys=function(){return L(this.data)},V.prototype.removeKey=function(t){delete this.data[t]},V);function V(t){this.data={};var r=C(t);this.data={};var i=this;function e(t,e){r?i.set(t,e):i.set(e,t)}t instanceof V?t.each(e):t&&k(t,e)}function Z(t,e){var r,i=Object.create?Object.create(t):((r=function(){}).prototype=t,new r);return e&&m(i,e),i}function K(){}var Q=Object.freeze({__proto__:null,$override:function(t,e){f[t]=e},guid:y,logError:g,clone:v,merge:_,mergeAll:function(t,e){for(var r=t[0],i=1,n=t.length;i<n;i++)r=_(r,t[i],e);return r},extend:m,defaults:x,createCanvas:w,indexOf:D,inherits:function(t,e){var r=t.prototype;function i(){}for(var n in i.prototype=e.prototype,t.prototype=new i,r)r.hasOwnProperty(n)&&(t.prototype[n]=r[n]);(t.prototype.constructor=t).superClass=e},mixin:b,isArrayLike:M,each:k,map:W,reduce:S,filter:function(t,e,r){if(!t)return[];if(!e)return X(t);if(t.filter&&t.filter===p)return t.filter(e,r);for(var i=[],n=0,o=t.length;n<o;n++)e.call(r,t[n],n,t)&&i.push(t[n]);return i},find:function(t,e,r){if(t&&e)for(var i=0,n=t.length;i<n;i++)if(e.call(r,t[i],i,t))return t[i]},keys:L,bind:T,curry:function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(n.call(arguments)))}},isArray:C,isFunction:A,isString:P,isStringSafe:function(t){return"[object String]"===u.call(t)},isNumber:R,isObject:z,isBuiltInObject:I,isTypedArray:O,isDom:B,isGradientObject:E,isPatternObject:F,isRegExp:function(t){return"[object RegExp]"===u.call(t)},eqNaN:function(t){return t!=t},retrieve:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,i=t.length;r<i;r++)if(null!=t[r])return t[r]},retrieve2:H,retrieve3:N,slice:X,normalizeCssArray:j,assert:function(t,e){if(!t)throw new Error(e)},trim:Y,setAsPrimitive:function(t){t[G]=!0},isPrimitive:q,HashMap:U,createHashMap:function(t){return new U(t)},concatArray:function(t,e){for(var r=new t.constructor(t.length+e.length),i=0;i<t.length;i++)r[i]=t[i];for(var n=t.length,i=0;i<e.length;i++)r[i+n]=e[i];return r},createObject:Z,hasOwn:function(t,e){return t.hasOwnProperty(e)},noop:K}),$=function(t,e){return($=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function J(t,e){function r(){this.constructor=t}$(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function tt(t,e){return null==t&&(t=0),null==e&&(e=0),[t,e]}function et(t){return[t[0],t[1]]}function rt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function it(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function nt(t){return Math.sqrt(ot(t))}function ot(t){return t[0]*t[0]+t[1]*t[1]}function at(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function st(t,e){var r=nt(e);return 0===r?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function ht(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var lt=ht;function ut(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var pt=ut;function ct(t,e,r,i){return t[0]=e[0]+i*(r[0]-e[0]),t[1]=e[1]+i*(r[1]-e[1]),t}function ft(t,e,r){var i=e[0],n=e[1];return t[0]=r[0]*i+r[2]*n+r[4],t[1]=r[1]*i+r[3]*n+r[5],t}function dt(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function yt(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var gt=Object.freeze({__proto__:null,create:tt,copy:function(t,e){return t[0]=e[0],t[1]=e[1],t},clone:et,set:function(t,e,r){return t[0]=e,t[1]=r,t},add:rt,scaleAndAdd:function(t,e,r,i){return t[0]=e[0]+r[0]*i,t[1]=e[1]+r[1]*i,t},sub:it,len:nt,length:nt,lenSquare:ot,lengthSquare:ot,mul:function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},div:function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},dot:function(t,e){return t[0]*e[0]+t[1]*e[1]},scale:at,normalize:st,distance:ht,dist:lt,distanceSquare:ut,distSquare:pt,negate:function(t,e){return t[0]=-e[0],t[1]=-e[1],t},lerp:ct,applyTransform:ft,min:dt,max:yt}),vt=function(t,e){this.target=t,this.topTarget=e&&e.topTarget},_t=(mt.prototype._dragStart=function(t){for(var e=t.target;e&&!e.draggable;)e=e.parent;e&&((this._draggingTarget=e).dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.handler.dispatchToElement(new vt(e,t),"dragstart",t.event))},mt.prototype._drag=function(t){var e,r,i,n,o,a,s=this._draggingTarget;s&&(e=t.offsetX,r=t.offsetY,i=e-this._x,n=r-this._y,this._x=e,this._y=r,s.drift(i,n,t),this.handler.dispatchToElement(new vt(s,t),"drag",t.event),o=this.handler.findHover(e,r,s).target,a=this._dropTarget,s!==(this._dropTarget=o)&&(a&&o!==a&&this.handler.dispatchToElement(new vt(a,t),"dragleave",t.event),o&&o!==a&&this.handler.dispatchToElement(new vt(o,t),"dragenter",t.event)))},mt.prototype._dragEnd=function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.handler.dispatchToElement(new vt(e,t),"dragend",t.event),this._dropTarget&&this.handler.dispatchToElement(new vt(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null},mt);function mt(t){(this.handler=t).on("mousedown",this._dragStart,this),t.on("mousemove",this._drag,this),t.on("mouseup",this._dragEnd,this)}var xt=(wt.prototype.on=function(t,e,r,i){this._$handlers||(this._$handlers={});var n=this._$handlers;if("function"==typeof e&&(i=r,r=e,e=null),!r||!t)return this;var o=this._$eventProcessor;null!=e&&o&&o.normalizeQuery&&(e=o.normalizeQuery(e)),n[t]||(n[t]=[]);for(var a=0;a<n[t].length;a++)if(n[t][a].h===r)return this;var s={h:r,query:e,ctx:i||this,callAtLast:r.zrEventfulCallAtLast},h=n[t].length-1,l=n[t][h];return l&&l.callAtLast?n[t].splice(h,0,s):n[t].push(s),this},wt.prototype.isSilent=function(t){var e=this._$handlers;return!e||!e[t]||!e[t].length},wt.prototype.off=function(t,e){var r=this._$handlers;if(!r)return this;if(!t)return this._$handlers={},this;if(e){if(r[t]){for(var i=[],n=0,o=r[t].length;n<o;n++)r[t][n].h!==e&&i.push(r[t][n]);r[t]=i}r[t]&&0===r[t].length&&delete r[t]}else delete r[t];return this},wt.prototype.trigger=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(!this._$handlers)return this;var i=this._$handlers[t],n=this._$eventProcessor;if(i)for(var o=e.length,a=i.length,s=0;s<a;s++){var h=i[s];if(!n||!n.filter||null==h.query||n.filter(t,h.query))switch(o){case 0:h.h.call(h.ctx);break;case 1:h.h.call(h.ctx,e[0]);break;case 2:h.h.call(h.ctx,e[0],e[1]);break;default:h.h.apply(h.ctx,e)}}return n&&n.afterTrigger&&n.afterTrigger(t),this},wt.prototype.triggerWithContext=function(t){if(!this._$handlers)return this;var e=this._$handlers[t],r=this._$eventProcessor;if(e)for(var i=arguments,n=i.length,o=i[n-1],a=e.length,s=0;s<a;s++){var h=e[s];if(!r||!r.filter||null==h.query||r.filter(t,h.query))switch(n){case 0:h.h.call(o);break;case 1:h.h.call(o,i[0]);break;case 2:h.h.call(o,i[0],i[1]);break;default:h.h.apply(o,i.slice(1,n-1))}}return r&&r.afterTrigger&&r.afterTrigger(t),this},wt);function wt(t){t&&(this._$eventProcessor=t)}var bt=Math.log(2);function kt(t,e,r,i,n,o){var a=i+"-"+n,s=t.length;if(o.hasOwnProperty(a))return o[a];if(1===e){var h=Math.round(Math.log((1<<s)-1&~n)/bt);return t[r][h]}for(var l=i|1<<r,u=r+1;i&1<<u;)u++;for(var p=0,c=0,f=0;c<s;c++){var d=1<<c;d&n||(p+=(f%2?-1:1)*t[r][c]*kt(t,e-1,u,l,n|d,o),f++)}return o[a]=p}function St(t,e){var r=[[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]]],i={},n=kt(r,8,0,0,0,i);if(0!==n){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)*kt(r,7,0===a?1:0,1<<a,1<<s,i)/n*e[a];return function(t,e,r){var i=e*o[6]+r*o[7]+1;t[0]=(e*o[0]+r*o[1]+o[2])/i,t[1]=(e*o[3]+r*o[4]+o[5])/i}}}var Tt="___zrEVENTSAVED";function Ct(t,e,r,i,n){if(e.getBoundingClientRect&&h.domSupported&&!At(e)){var o=e[Tt]||(e[Tt]={}),a=function(t,e,r){for(var i=r?"invTrans":"trans",n=e[i],o=e.srcCoords,a=[],s=[],h=!0,l=0;l<4;l++){var u=t[l].getBoundingClientRect(),p=2*l,c=u.left,f=u.top;a.push(c,f),h=h&&o&&c===o[p]&&f===o[1+p],s.push(t[l].offsetLeft,t[l].offsetTop)}return h&&n?n:(e.srcCoords=a,e[i]=r?St(s,a):St(a,s))}(function(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var i=["left","right"],n=["top","bottom"],o=0;o<4;o++){var a=document.createElement("div"),s=a.style,h=o%2,l=(o>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[h]+":0",n[l]+":0",i[1-h]+":auto",n[1-l]+":auto",""].join("!important;"),t.appendChild(a),r.push(a)}return r}(e,o),o,n);if(a)return a(t,r,i),1}}function At(t){return"CANVAS"===t.nodeName.toUpperCase()}var Pt="undefined"!=typeof window&&!!window.addEventListener,Dt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Mt=[];function Lt(t,e,r,i){return r=r||{},i||!h.canvasSupported?Rt(t,e,r):h.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):null!=e.offsetX?(r.zrX=e.offsetX,r.zrY=e.offsetY):Rt(t,e,r),r}function Rt(t,e,r){if(h.domSupported&&t.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(At(t)){var o=t.getBoundingClientRect();return r.zrX=i-o.left,void(r.zrY=n-o.top)}if(Ct(Mt,t,i,n))return r.zrX=Mt[0],void(r.zrY=Mt[1])}r.zrX=r.zrY=0}function zt(t){return t||window.event}function It(t,e,r){if(null!=(e=zt(e)).zrX)return e;var i,n,o=e.type;o&&0<=o.indexOf("touch")?(i="touchend"!==o?e.targetTouches[0]:e.changedTouches[0])&&Lt(t,i,e,r):(Lt(t,e,e,r),n=function(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,i=t.deltaY;return null!=r&&null!=i?3*(0!==i?Math.abs(i):Math.abs(r))*(0<i||!(i<0)&&0<r?-1:1):e}(e),e.zrDelta=n?n/120:-(e.detail||0)/3);var a=e.button;return null==e.which&&void 0!==a&&Dt.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}var Ot=Pt?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},Bt=(Et.prototype.recognize=function(t,e,r){return this._doTrack(t,e,r),this._recognize(t)},Et.prototype.clear=function(){return this._track.length=0,this},Et.prototype._doTrack=function(t,e,r){var i=t.touches;if(i){for(var n={points:[],touches:[],target:e,event:t},o=0,a=i.length;o<a;o++){var s=i[o],h=Lt(r,s,{});n.points.push([h.zrX,h.zrY]),n.touches.push(s)}this._track.push(n)}},Et.prototype._recognize=function(t){for(var e in Ht)if(Ht.hasOwnProperty(e)){var r=Ht[e](this._track,t);if(r)return r}},Et);function Et(){this._track=[]}function Ft(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}var Ht={pinch:function(t,e){var r=t.length;if(r){var i,n=(t[r-1]||{}).points,o=(t[r-2]||{}).points||n;if(o&&1<o.length&&n&&1<n.length){var a=Ft(n)/Ft(o);isFinite(a)||(a=1),e.pinchScale=a;var s=[((i=n)[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2];return e.pinchX=s[0],e.pinchY=s[1],{type:"pinch",target:t[0].target,event:e}}}}},Nt="silent";function Wt(){Ot(this.event)}var Xt,jt=(J(Yt,Xt=xt),Yt.prototype.dispose=function(){},Yt.prototype.setCursor=function(){},Yt);function Yt(){var t=null!==Xt&&Xt.apply(this,arguments)||this;return t.handler=null,t}var Gt,qt=function(t,e){this.x=t,this.y=e},Ut=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Vt=(J(Zt,Gt=xt),Zt.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(k(Ut,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},Zt.prototype.mousemove=function(t){var e=t.zrX,r=t.zrY,i=Kt(this,e,r),n=this._hovered,o=n.target;o&&!o.__zr&&(o=(n=this.findHover(n.x,n.y)).target);var a=this._hovered=i?new qt(e,r):this.findHover(e,r),s=a.target,h=this.proxy;h.setCursor&&h.setCursor(s?s.cursor:"default"),o&&s!==o&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(a,"mousemove",t),s&&s!==o&&this.dispatchToElement(a,"mouseover",t)},Zt.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})},Zt.prototype.resize=function(){this._hovered=new qt(0,0)},Zt.prototype.dispatch=function(t,e){var r=this[t];r&&r.call(this,e)},Zt.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},Zt.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},Zt.prototype.dispatchToElement=function(t,e,r){var i=(t=t||{}).target;if(!i||!i.silent){for(var n,o,a="on"+e,s={type:e,event:o=r,target:(n=t).target,topTarget:n.topTarget,cancelBubble:!1,offsetX:o.zrX,offsetY:o.zrY,gestureEvent:o.gestureEvent,pinchX:o.pinchX,pinchY:o.pinchY,pinchScale:o.pinchScale,wheelDelta:o.zrDelta,zrByTouch:o.zrByTouch,which:o.which,stop:Wt};i&&(i[a]&&(s.cancelBubble=!!i[a].call(i,s)),i.trigger(e,s),i=i.__hostTarget?i.__hostTarget:i.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(e,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[a]&&t[a].call(t,s),t.trigger&&t.trigger(e,s)}))}},Zt.prototype.findHover=function(t,e,r){for(var i=this.storage.getDisplayList(),n=new qt(t,e),o=i.length-1;0<=o;o--){var a=void 0;if(i[o]!==r&&!i[o].ignore&&(a=function(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var i=t,n=void 0,o=!1;i;){if(i.ignoreClip&&(o=!0),!o){var a=i.getClipPath();if(a&&!a.contain(e,r))return!1;i.silent&&(n=!0)}var s=i.__hostTarget;i=s||i.parent}return!n||Nt}return!1}(i[o],t,e))&&(n.topTarget||(n.topTarget=i[o]),a!==Nt)){n.target=i[o];break}}return n},Zt.prototype.processGesture=function(t,e){this._gestureMgr||(this._gestureMgr=new Bt);var r=this._gestureMgr;"start"===e&&r.clear();var i,n,o=r.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);"end"===e&&r.clear(),o&&(i=o.type,t.gestureEvent=i,(n=new qt).target=o.target,this.dispatchToElement(n,i,o.event))},Zt);function Zt(t,e,r,i){var n=Gt.call(this)||this;return n._hovered=new qt(0,0),n.storage=t,n.painter=e,n.painterRoot=i,r=r||new jt,n.proxy=null,n.setHandlerProxy(r),n._draggingMgr=new _t(n),n}function Kt(t,e,r){var i=t.painter;return e<0||e>i.getWidth()||r<0||r>i.getHeight()}function Qt(){return[1,0,0,1,0,0]}function $t(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Jt(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 te(t,e,r){var i=e[0]*r[0]+e[2]*r[1],n=e[1]*r[0]+e[3]*r[1],o=e[0]*r[2]+e[2]*r[3],a=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],h=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=h,t}function ee(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function re(t,e,r){var i=e[0],n=e[2],o=e[4],a=e[1],s=e[3],h=e[5],l=Math.sin(r),u=Math.cos(r);return t[0]=i*u+a*l,t[1]=-i*l+a*u,t[2]=n*u+s*l,t[3]=-n*l+u*s,t[4]=u*o+l*h,t[5]=u*h-l*o,t}function ie(t,e,r){var i=r[0],n=r[1];return t[0]=e[0]*i,t[1]=e[1]*n,t[2]=e[2]*i,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*n,t}function ne(t,e){var r=e[0],i=e[2],n=e[4],o=e[1],a=e[3],s=e[5],h=r*a-o*i;return h?(h=1/h,t[0]=a*h,t[1]=-o*h,t[2]=-i*h,t[3]=r*h,t[4]=(i*s-a*n)*h,t[5]=(o*n-r*s)*h,t):null}k(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(a){Vt.prototype[a]=function(t){var e,r,i=t.zrX,n=t.zrY,o=Kt(this,i,n);if("mouseup"===a&&o||(r=(e=this.findHover(i,n)).target),"mousedown"===a)this._downEl=r,this._downPoint=[t.zrX,t.zrY],this._upEl=r;else if("mouseup"===a)this._upEl=r;else if("click"===a){if(this._downEl!==this._upEl||!this._downPoint||4<lt(this._downPoint,[t.zrX,t.zrY]))return;this._downPoint=null}this.dispatchToElement(e,a,t)}});var oe=Object.freeze({__proto__:null,create:Qt,identity:$t,copy:Jt,mul:te,translate:ee,rotate:re,scale:ie,invert:ne,clone:function(t){var e=Qt();return Jt(e,t),e}}),ae=$t;function se(t){return 5e-5<t||t<-5e-5}var he,le=[],ue=[],pe=Qt(),ce=Math.abs,fe=(de.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},de.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},de.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},de.prototype.needLocalTransform=function(){return se(this.rotation)||se(this.x)||se(this.y)||se(this.scaleX-1)||se(this.scaleY-1)},de.prototype.updateTransform=function(){var t=this.parent,e=t&&t.transform,r=this.needLocalTransform(),i=this.transform;r||e?(i=i||Qt(),r?this.getLocalTransform(i):ae(i),e&&(r?te(i,t.transform,i):Jt(i,t.transform)),this.transform=i,this._resolveGlobalScaleRatio(i)):i&&ae(i)},de.prototype._resolveGlobalScaleRatio=function(t){var e,r,i,n,o=this.globalScaleRatio;null!=o&&1!==o&&(this.getGlobalScale(le),i=((le[0]-(e=le[0]<0?-1:1))*o+e)/le[0]||0,n=((le[1]-(r=le[1]<0?-1:1))*o+r)/le[1]||0,t[0]*=i,t[1]*=i,t[2]*=n,t[3]*=n),this.invTransform=this.invTransform||Qt(),ne(this.invTransform,t)},de.prototype.getLocalTransform=function(t){return de.getLocalTransform(this,t)},de.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},de.prototype.setLocalTransform=function(t){var e,r;t&&(e=t[0]*t[0]+t[1]*t[1],r=t[2]*t[2]+t[3]*t[3],se(e-1)&&(e=Math.sqrt(e)),se(r-1)&&(r=Math.sqrt(r)),t[0]<0&&(e=-e),t[3]<0&&(r=-r),this.rotation=Math.atan2(-t[1]/r,t[0]/e),e<0&&r<0&&(this.rotation+=Math.PI,e=-e,r=-r),this.x=t[4],this.y=t[5],this.scaleX=e,this.scaleY=r)},de.prototype.decomposeTransform=function(){var t,e,r,i;this.transform&&(t=this.parent,e=this.transform,t&&t.transform&&(te(ue,t.invTransform,e),e=ue),r=this.originX,i=this.originY,(r||i)&&(pe[4]=r,pe[5]=i,te(ue,e,pe),ue[4]-=r,ue[5]-=i,e=ue),this.setLocalTransform(e))},de.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1])):(t[0]=1,t[1]=1),t},de.prototype.transformCoordToLocal=function(t,e){var r=[t,e],i=this.invTransform;return i&&ft(r,r,i),r},de.prototype.transformCoordToGlobal=function(t,e){var r=[t,e],i=this.transform;return i&&ft(r,r,i),r},de.prototype.getLineScale=function(){var t=this.transform;return t&&1e-10<ce(t[0]-1)&&1e-10<ce(t[3]-1)?Math.sqrt(ce(t[0]*t[3]-t[2]*t[1])):1},de.getLocalTransform=function(t,e){ae(e=e||[]);var r=t.originX||0,i=t.originY||0,n=t.scaleX,o=t.scaleY,a=t.rotation||0,s=t.x,h=t.y;return e[4]-=r,e[5]-=i,e[0]*=n,e[1]*=o,e[2]*=n,e[3]*=o,e[4]*=n,e[5]*=o,a&&re(e,e,a),e[4]+=r,e[5]+=i,e[4]+=s,e[5]+=h,e},de.initDefaultProps=((he=de.prototype).x=0,he.y=0,he.scaleX=1,he.scaleY=1,he.originX=0,he.originY=0,he.rotation=0,void(he.globalScaleRatio=1)),de);function de(){}var ye={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,r=.1;return 0===t?0:1===t?1:(e=!r||r<1?(r=1,.1):.4*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*--t)*Math.sin((t-e)*(2*Math.PI)/.4)))},elasticOut:function(t){var e,r=.1;return 0===t?0:1===t?1:(e=!r||r<1?(r=1,.1):.4*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)},elasticInOut:function(t){var e,r=.1;return 0===t?0:1===t?1:(e=!r||r<1?(r=1,.1):.4*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?r*Math.pow(2,10*--t)*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:r*Math.pow(2,-10*--t)*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)},backIn:function(t){return t*t*(2.70158*t-1.70158)},backOut:function(t){return--t*t*(2.70158*t+1.70158)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((1+e)*t-e)*.5:.5*((t-=2)*t*((1+e)*t+e)+2)},bounceIn:function(t){return 1-ye.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*ye.bounceIn(2*t):.5*ye.bounceOut(2*t-1)+.5}},ge=(ve.prototype.step=function(t,e){if(this._initialized||(this._startTime=t+this._delay,this._initialized=!0),!this._paused){var r=(t-this._startTime-this._pausedTime)/this._life;r<0&&(r=0),r=Math.min(r,1);var i=this.easing,n="string"==typeof i?ye[i]:i,o="function"==typeof n?n(r):r;if(this.onframe&&this.onframe(o),1===r){if(!this.loop)return!0;this._restart(t),this.onrestart&&this.onrestart()}return!1}this._pausedTime+=e},ve.prototype._restart=function(t){var e=(t-this._startTime-this._pausedTime)%this._life;this._startTime=t-e+this.gap,this._pausedTime=0},ve.prototype.pause=function(){this._paused=!0},ve.prototype.resume=function(){this._paused=!1},ve);function ve(t){this._initialized=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=null!=t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart}var _e=function(t){this.value=t},me=(xe.prototype.insert=function(t){var e=new _e(t);return this.insertEntry(e),e},xe.prototype.insertEntry=function(t){this.head?((this.tail.next=t).prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},xe.prototype.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._len--},xe.prototype.len=function(){return this._len},xe.prototype.clear=function(){this.head=this.tail=null,this._len=0},xe);function xe(){this._len=0}var we=(be.prototype.put=function(t,e){var r,i,n,o=this._list,a=this._map,s=null;return null==a[t]&&(r=o.len(),i=this._lastRemovedEntry,r>=this._maxSize&&0<r&&(n=o.head,o.remove(n),delete a[n.key],s=n.value,this._lastRemovedEntry=n),i?i.value=e:i=new _e(e),i.key=t,o.insertEntry(i),a[t]=i),s},be.prototype.get=function(t){var e=this._map[t],r=this._list;if(null!=e)return e!==r.tail&&(r.remove(e),r.insertEntry(e)),e.value},be.prototype.clear=function(){this._list.clear(),this._map={}},be.prototype.len=function(){return this._list.len()},be);function be(t){this._list=new me,this._maxSize=10,this._map={},this._maxSize=t}var ke={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 Se(t){return(t=Math.round(t))<0?0:255<t?255:t}function Te(t){return t<0?0:1<t?1:t}function Ce(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Se(parseFloat(e)/100*255):Se(parseInt(e,10))}function Ae(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Te(parseFloat(e)/100):Te(parseFloat(e))}function Pe(t,e,r){return r<0?r+=1:1<r&&--r,6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function De(t,e,r){return t+(e-t)*r}function Me(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function Le(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Re=new we(20),ze=null;function Ie(t,e){ze&&Le(ze,e),ze=Re.put(t,ze||e.slice())}function Oe(t,e){if(t){e=e||[];var r=Re.get(t);if(r)return Le(e,r);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in ke)return Le(e,ke[i]),Ie(t,e),e;var n,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?0<=(n=parseInt(i.slice(1,4),16))&&n<=4095?(Me(e,(3840&n)>>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,5===o?parseInt(i.slice(4),16)/15:1),Ie(t,e),e):void Me(e,0,0,0,1):7===o||9===o?0<=(n=parseInt(i.slice(1,7),16))&&n<=16777215?(Me(e,(16711680&n)>>16,(65280&n)>>8,255&n,9===o?parseInt(i.slice(7),16)/255:1),Ie(t,e),e):void Me(e,0,0,0,1):void 0;var a=i.indexOf("("),s=i.indexOf(")");if(-1!==a&&s+1===o){var h=i.substr(0,a),l=i.substr(a+1,s-(a+1)).split(","),u=1;switch(h){case"rgba":if(4!==l.length)return 3===l.length?Me(e,+l[0],+l[1],+l[2],1):Me(e,0,0,0,1);u=Ae(l.pop());case"rgb":return 3!==l.length?void Me(e,0,0,0,1):(Me(e,Ce(l[0]),Ce(l[1]),Ce(l[2]),u),Ie(t,e),e);case"hsla":return 4!==l.length?void Me(e,0,0,0,1):(l[3]=Ae(l[3]),Be(l,e),Ie(t,e),e);case"hsl":return 3!==l.length?void Me(e,0,0,0,1):(Be(l,e),Ie(t,e),e);default:return}}Me(e,0,0,0,1)}}function Be(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=Ae(t[1]),n=Ae(t[2]),o=n<=.5?n*(i+1):n+i-n*i,a=2*n-o;return Me(e=e||[],Se(255*Pe(a,o,r+1/3)),Se(255*Pe(a,o,r)),Se(255*Pe(a,o,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Ee(t){var e=Oe(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function Fe(t,e,r){if(e&&e.length&&0<=t&&t<=1){r=r||[];var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=e[n],s=e[o],h=i-n;return r[0]=Se(De(a[0],s[0],h)),r[1]=Se(De(a[1],s[1],h)),r[2]=Se(De(a[2],s[2],h)),r[3]=Te(De(a[3],s[3],h)),r}}function He(t,e,r){if(e&&e.length&&0<=t&&t<=1){var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=Oe(e[n]),s=Oe(e[o]),h=i-n,l=Ne([Se(De(a[0],s[0],h)),Se(De(a[1],s[1],h)),Se(De(a[2],s[2],h)),Te(De(a[3],s[3],h))],"rgba");return r?{color:l,leftIndex:n,rightIndex:o,value:i}:l}}function Ne(t,e){if(t&&t.length){var r=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(r+=","+t[3]),e+"("+r+")"}}function We(t,e){var r=Oe(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Xe=Object.freeze({__proto__:null,parse:Oe,lift:function(t,e){var r=Oe(t);if(r){for(var i=0;i<3;i++)r[i]=e<0?r[i]*(1-e)|0:(255-r[i])*e+r[i]|0,255<r[i]?r[i]=255:r[i]<0&&(r[i]=0);return Ne(r,4===r.length?"rgba":"rgb")}},toHex:Ee,fastLerp:Fe,fastMapToColor:Fe,lerp:He,mapToColor:He,modifyHSL:function(t,e,r,i){var n,o=Oe(t);if(t)return o=function(t){if(t){var e,r,i,n,o,a=t[0]/255,s=t[1]/255,h=t[2]/255,l=Math.min(a,s,h),u=Math.max(a,s,h),p=u-l,c=(u+l)/2;0==p?r=e=0:(r=c<.5?p/(u+l):p/(2-u-l),i=((u-a)/6+p/2)/p,n=((u-s)/6+p/2)/p,o=((u-h)/6+p/2)/p,a===u?e=o-n:s===u?e=1/3+i-o:h===u&&(e=2/3+n-i),e<0&&(e+=1),1<e&&--e);var f=[360*e,r,c];return null!=t[3]&&f.push(t[3]),f}}(o),null!=e&&(o[0]=(n=e,(n=Math.round(n))<0?0:360<n?360:n)),null!=r&&(o[1]=Ae(r)),null!=i&&(o[2]=Ae(i)),Ne(Be(o),"rgba")},modifyAlpha:function(t,e){var r=Oe(t);if(r&&null!=e)return r[3]=Te(e),Ne(r,"rgba")},stringify:Ne,lum:We,random:function(){return"rgb("+Math.round(255*Math.random())+","+Math.round(255*Math.random())+","+Math.round(255*Math.random())+")"}}),je=Array.prototype.slice;function Ye(t,e,r){return(e-t)*r+t}function Ge(t,e,r,i){for(var n=e.length,o=0;o<n;o++)t[o]=Ye(e[o],r[o],i)}function qe(t,e,r,i){for(var n=e.length,o=0;o<n;o++)t[o]=e[o]+r[o]*i;return t}function Ue(t,e,r,i){for(var n=e.length,o=n&&e[0].length,a=0;a<n;a++){t[a]||(t[a]=[]);for(var s=0;s<o;s++)t[a][s]=e[a][s]+r[a][s]*i}return t}function Ve(t,e){var r=t.length;if(r===e.length){for(var i=0;i<r;i++)if(t[i]!==e[i])return;return 1}}function Ze(t,e,r,i,n,o,a){var s=.5*(r-t),h=.5*(i-e);return(2*(e-r)+s+h)*a+(-3*(e-r)-2*s-h)*o+s*n+e}function Ke(t,e,r,i,n,o,a,s){for(var h=e.length,l=0;l<h;l++)t[l]=Ze(e[l],r[l],i[l],n[l],o,a,s)}function Qe(t){if(M(t)){var e=t.length;if(M(t[0])){for(var r=[],i=0;i<e;i++)r.push(je.call(t[i]));return r}return je.call(t)}return t}function $e(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}var Je=[0,0,0,0],tr=(er.prototype.isFinished=function(){return this._finished},er.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},er.prototype.needsAnimate=function(){return!this._isAllValueEqual&&2<=this.keyframes.length&&this.interpolable},er.prototype.getAdditiveTrack=function(){return this._additiveTrack},er.prototype.addKeyframe=function(t,e){t>=this.maxTime?this.maxTime=t:this._needsSort=!0;var r,i=this.keyframes,n=i.length;if(this.interpolable)if(M(e)){var o,a=M((r=e)&&r[0])?2:1;if(0<n&&this.arrDim!==a)return void(this.interpolable=!1);if(1==a&&"number"!=typeof e[0]||2==a&&"number"!=typeof e[0][0])return void(this.interpolable=!1);0<n&&(o=i[n-1],this._isAllValueEqual&&(1==a&&Ve(e,o.value)||(this._isAllValueEqual=!1))),this.arrDim=a}else{if(0<this.arrDim)return void(this.interpolable=!1);if("string"==typeof e){var s=Oe(e);s?(e=s,this.isValueColor=!0):this.interpolable=!1}else if("number"!=typeof e)return void(this.interpolable=!1);this._isAllValueEqual&&0<n&&(o=i[n-1],(this.isValueColor&&!Ve(o.value,e)||o.value!==e)&&(this._isAllValueEqual=!1))}var h={time:t,value:e,percent:0};return this.keyframes.push(h),h},er.prototype.prepare=function(t){var e=this.keyframes;this._needsSort&&e.sort(function(t,e){return t.time-e.time});for(var r=this.arrDim,i=e.length,n=e[i-1],o=0;o<i;o++)e[o].percent=e[o].time/this.maxTime,0<r&&o!==i-1&&function(t,e,r){var i=t,n=e;if(i.push&&n.push){var o=i.length,a=n.length;if(o!==a)if(a<o)i.length=a;else for(var s=o;s<a;s++)i.push(1===r?n[s]:je.call(n[s]));for(var h=i[0]&&i[0].length,s=0;s<i.length;s++)if(1===r)isNaN(i[s])&&(i[s]=n[s]);else for(var l=0;l<h;l++)isNaN(i[s][l])&&(i[s][l]=n[s][l])}}(e[o].value,n.value,r);if(t&&this.needsAnimate()&&t.needsAnimate()&&r===t.arrDim&&this.isValueColor===t.isValueColor&&!t._finished){this._additiveTrack=t;for(var a=e[0].value,o=0;o<i;o++)0===r?this.isValueColor?e[o].additiveValue=qe([],e[o].value,a,-1):e[o].additiveValue=e[o].value-a:1===r?e[o].additiveValue=qe([],e[o].value,a,-1):2===r&&(e[o].additiveValue=Ue([],e[o].value,a,-1))}},er.prototype.step=function(t,e){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var r=null!=this._additiveTrack,i=r?"additiveValue":"value",n=this.keyframes,o=this.keyframes.length,a=this.propName,s=this.arrDim,h=this.isValueColor;if(e<0)l=0;else if(e<this._lastFramePercent){for(var l=Math.min(this._lastFrame+1,o-1);0<=l&&!(n[l].percent<=e);l--);l=Math.min(l,o-2)}else{for(l=this._lastFrame;l<o&&!(n[l].percent>e);l++);l=Math.min(l-1,o-2)}var u,p,c,f,d,y,g,v,_,m,x=n[l+1],w=n[l];w&&x&&(this._lastFrame=l,this._lastFramePercent=e,0!=(u=x.percent-w.percent)&&(p=(e-w.percent)/u,c=r?this._additiveValue:h?Je:t[a],(0<s||h)&&!c&&(c=this._additiveValue=[]),this.useSpline?(f=n[l][i],d=n[0===l?l:l-1][i],y=n[o-2<l?o-1:l+1][i],g=n[o-3<l?o-1:l+2][i],0<s?(1===s?Ke:function(t,e,r,i,n,o,a,s){for(var h=e.length,l=e[0].length,u=0;u<h;u++){t[u]||(t[1]=[]);for(var p=0;p<l;p++)t[u][p]=Ze(e[u][p],r[u][p],i[u][p],n[u][p],o,a,s)}})(c,d,f,y,g,p,p*p,p*p*p):h?(Ke(c,d,f,y,g,p,p*p,p*p*p),r||(t[a]=$e(c))):(v=void 0,v=this.interpolable?Ze(d,f,y,g,p,p*p,p*p*p):y,r?this._additiveValue=v:t[a]=v)):0<s?(1===s?Ge:function(t,e,r,i){for(var n=e.length,o=n&&e[0].length,a=0;a<n;a++){t[a]||(t[a]=[]);for(var s=0;s<o;s++)t[a][s]=Ye(e[a][s],r[a][s],i)}})(c,w[i],x[i],p):h?(Ge(c,w[i],x[i],p),r||(t[a]=$e(c))):(v=void 0,v=this.interpolable?Ye(w[i],x[i],p):(_=w[i],m=x[i],.5<p?m:_),r?this._additiveValue=v:t[a]=v),r&&this._addToTarget(t)))}},er.prototype._addToTarget=function(t){var e=this.arrDim,r=this.propName,i=this._additiveValue;0===e?this.isValueColor?(Oe(t[r],Je),qe(Je,Je,i,1),t[r]=$e(Je)):t[r]=t[r]+i:1===e?qe(t[r],t[r],i,1):2===e&&Ue(t[r],t[r],i,1)},er);function er(t){this.keyframes=[],this.maxTime=0,this.arrDim=0,this.interpolable=!0,this._needsSort=!1,this._isAllValueEqual=!0,this._lastFrame=0,this._lastFramePercent=0,this.propName=t}var rr=(ir.prototype.getTarget=function(){return this._target},ir.prototype.changeTarget=function(t){this._target=t},ir.prototype.when=function(t,e){return this.whenWithKeys(t,e,L(e))},ir.prototype.whenWithKeys=function(t,e,r){for(var i=this._tracks,n=0;n<r.length;n++){var o=r[n],a=i[o];if(!a){a=i[o]=new tr(o);var s,h=void 0,l=this._getAdditiveTrack(o);if(l?(h=(s=l.keyframes[l.keyframes.length-1])&&s.value,l.isValueColor&&h&&(h=$e(h))):h=this._target[o],null==h)continue;0!==t&&a.addKeyframe(0,Qe(h)),this._trackKeys.push(o)}a.addKeyframe(t,Qe(e[o]))}return this._maxTime=Math.max(this._maxTime,t),this},ir.prototype.pause=function(){this._clip.pause(),this._paused=!0},ir.prototype.resume=function(){this._clip.resume(),this._paused=!1},ir.prototype.isPaused=function(){return!!this._paused},ir.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneList;if(t)for(var e=t.length,r=0;r<e;r++)t[r].call(this)},ir.prototype._abortedCallback=function(){this._setTracksFinished();var t=this.animation,e=this._abortedList;if(t&&t.removeClip(this._clip),this._clip=null,e)for(var r=0;r<e.length;r++)e[r].call(this)},ir.prototype._setTracksFinished=function(){for(var t=this._tracks,e=this._trackKeys,r=0;r<e.length;r++)t[e[r]].setFinished()},ir.prototype._getAdditiveTrack=function(t){var e,r=this._additiveAnimators;if(r)for(var i=0;i<r.length;i++){var n=r[i].getTrack(t);n&&(e=n)}return e},ir.prototype.start=function(t,e){if(!(0<this._started)){this._started=1;for(var r,o=this,a=[],i=0;i<this._trackKeys.length;i++){var n,s=this._trackKeys[i],h=this._tracks[s],l=this._getAdditiveTrack(s),u=h.keyframes;h.prepare(l),h.needsAnimate()?a.push(h):h.interpolable||(n=u[u.length-1])&&(o._target[h.propName]=n.value)}return a.length||e?(r=new ge({life:this._maxTime,loop:this._loop,delay:this._delay,onframe:function(t){o._started=2;var e=o._additiveAnimators;if(e){for(var r=!1,i=0;i<e.length;i++)if(e[i]._clip){r=!0;break}r||(o._additiveAnimators=null)}for(i=0;i<a.length;i++)a[i].step(o._target,t);var n=o._onframeList;if(n)for(i=0;i<n.length;i++)n[i](o._target,t)},ondestroy:function(){o._doneCallback()}}),this._clip=r,this.animation&&this.animation.addClip(r),t&&"spline"!==t&&(r.easing=t)):this._doneCallback(),this}},ir.prototype.stop=function(t){var e;this._clip&&(e=this._clip,t&&e.onframe(1),this._abortedCallback())},ir.prototype.delay=function(t){return this._delay=t,this},ir.prototype.during=function(t){return t&&(this._onframeList||(this._onframeList=[]),this._onframeList.push(t)),this},ir.prototype.done=function(t){return t&&(this._doneList||(this._doneList=[]),this._doneList.push(t)),this},ir.prototype.aborted=function(t){return t&&(this._abortedList||(this._abortedList=[]),this._abortedList.push(t)),this},ir.prototype.getClip=function(){return this._clip},ir.prototype.getTrack=function(t){return this._tracks[t]},ir.prototype.stopTracks=function(t,e){if(!t.length||!this._clip)return!0;for(var r=this._tracks,i=this._trackKeys,n=0;n<t.length;n++){var o=r[t[n]];o&&(e?o.step(this._target,1):1===this._started&&o.step(this._target,0),o.setFinished())}for(var a=!0,n=0;n<i.length;n++)if(!r[i[n]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},ir.prototype.saveFinalToTarget=function(t,e){if(t){e=e||this._trackKeys;for(var r=0;r<e.length;r++){var i,n,o,a=e[r],s=this._tracks[a];s&&!s.isFinished()&&(n=(i=s.keyframes)[i.length-1])&&(o=Qe(n.value),s.isValueColor&&(o=$e(o)),t[a]=o)}}},ir.prototype.__changeFinalValue=function(t,e){e=e||L(t);for(var r=0;r<e.length;r++){var i,n,o=e[r],a=this._tracks[o];a&&1<(i=a.keyframes).length&&(n=i.pop(),a.addKeyframe(n.time,t[o]),a.prepare(a.getAdditiveTrack()))}},ir);function ir(t,e,r){this._tracks={},this._trackKeys=[],this._delay=0,this._maxTime=0,this._paused=!1,this._started=0,this._clip=null,this._target=t,(this._loop=e)&&r?g("Can' use additive animation on looped animation."):this._additiveAnimators=r}var nr=(or.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},or.prototype.clone=function(){return new or(this.x,this.y)},or.prototype.set=function(t,e){return this.x=t,this.y=e,this},or.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},or.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},or.prototype.scale=function(t){this.x*=t,this.y*=t},or.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},or.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},or.prototype.dot=function(t){return this.x*t.x+this.y*t.y},or.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},or.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},or.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},or.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},or.prototype.distanceSquare=function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},or.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},or.prototype.transform=function(t){if(t){var e=this.x,r=this.y;return this.x=t[0]*e+t[2]*r+t[4],this.y=t[1]*e+t[3]*r+t[5],this}},or.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},or.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},or.set=function(t,e,r){t.x=e,t.y=r},or.copy=function(t,e){t.x=e.x,t.y=e.y},or.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},or.lenSquare=function(t){return t.x*t.x+t.y*t.y},or.dot=function(t,e){return t.x*e.x+t.y*e.y},or.add=function(t,e,r){t.x=e.x+r.x,t.y=e.y+r.y},or.sub=function(t,e,r){t.x=e.x-r.x,t.y=e.y-r.y},or.scale=function(t,e,r){t.x=e.x*r,t.y=e.y*r},or.scaleAndAdd=function(t,e,r,i){t.x=e.x+r.x*i,t.y=e.y+r.y*i},or.lerp=function(t,e,r,i){var n=1-i;t.x=n*e.x+i*r.x,t.y=n*e.y+i*r.y},or);function or(t,e){this.x=t||0,this.y=e||0}var ar=Math.min,sr=Math.max,hr=new nr,lr=new nr,ur=new nr,pr=new nr,cr=new nr,fr=new nr,dr=(yr.prototype.union=function(t){var e=ar(t.x,this.x),r=ar(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=sr(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=sr(t.y+t.height,this.y+this.height)-r:this.height=t.height,this.x=e,this.y=r},yr.prototype.applyTransform=function(t){yr.applyTransform(this,this,t)},yr.prototype.calculateTransform=function(t){var e=t.width/this.width,r=t.height/this.height,i=Qt();return ee(i,i,[-this.x,-this.y]),ie(i,i,[e,r]),ee(i,i,[t.x,t.y]),i},yr.prototype.intersect=function(t,e){if(!t)return!1;t instanceof yr||(t=yr.create(t));var r,i,n,o,a,s,h,l,u=this,p=u.x,c=u.x+u.width,f=u.y,d=u.y+u.height,y=t.x,g=t.x+t.width,v=t.y,_=t.y+t.height,m=!(c<y||g<p||d<v||_<f);return e&&(r=1/0,i=0,n=Math.abs(c-y),o=Math.abs(g-p),a=Math.abs(d-v),s=Math.abs(_-f),h=Math.min(n,o),l=Math.min(a,s),c<y||g<p?i<h&&(i=h,n<o?nr.set(fr,-n,0):nr.set(fr,o,0)):h<r&&(r=h,n<o?nr.set(cr,n,0):nr.set(cr,-o,0)),d<v||_<f?i<l&&(i=l,a<s?nr.set(fr,0,-a):nr.set(fr,0,s)):h<r&&(r=h,a<s?nr.set(cr,0,a):nr.set(cr,0,-s))),e&&nr.copy(e,m?cr:fr),m},yr.prototype.contain=function(t,e){var r=this;return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},yr.prototype.clone=function(){return new yr(this.x,this.y,this.width,this.height)},yr.prototype.copy=function(t){yr.copy(this,t)},yr.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},yr.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},yr.prototype.isZero=function(){return 0===this.width||0===this.height},yr.create=function(t){return new yr(t.x,t.y,t.width,t.height)},yr.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},yr.applyTransform=function(t,e,r){if(r){if(r[1]<1e-5&&-1e-5<r[1]&&r[2]<1e-5&&-1e-5<r[2]){var i=r[0],n=r[3],o=r[4],a=r[5];return t.x=e.x*i+o,t.y=e.y*n+a,t.width=e.width*i,t.height=e.height*n,t.width<0&&(t.x+=t.width,t.width=-t.width),void(t.height<0&&(t.y+=t.height,t.height=-t.height))}hr.x=ur.x=e.x,hr.y=pr.y=e.y,lr.x=pr.x=e.x+e.width,lr.y=ur.y=e.y+e.height,hr.transform(r),pr.transform(r),lr.transform(r),ur.transform(r),t.x=ar(hr.x,lr.x,ur.x,pr.x),t.y=ar(hr.y,lr.y,ur.y,pr.y);var s=sr(hr.x,lr.x,ur.x,pr.x),h=sr(hr.y,lr.y,ur.y,pr.y);t.width=s-t.x,t.height=h-t.y}else t!==e&&yr.copy(t,e)},yr);function yr(t,e,r,i){r<0&&isFinite(r)&&(t+=r,r=-r),i<0&&isFinite(i)&&(e+=i,i=-i),this.x=t,this.y=e,this.width=r,this.height=i}var gr,vr,_r={},mr="12px sans-serif";var xr={measureText:function(t,e){return gr=gr||w().getContext("2d"),vr!==e&&(vr=gr.font=e||mr),gr.measureText(t)}};function wr(t,e){var r=_r[e=e||mr],i=(r=r||(_r[e]=new we(500))).get(t);return null==i&&(i=xr.measureText(t,e).width,r.put(t,i)),i}function br(t,e,r,i){var n=wr(t,e),o=Tr(e),a=kr(0,n,r),s=Sr(0,o,i);return new dr(a,s,n,o)}function kr(t,e,r){return"right"===r?t-=e:"center"===r&&(t-=e/2),t}function Sr(t,e,r){return"middle"===r?t-=e/2:"bottom"===r&&(t-=e),t}function Tr(t){return wr("国",t)}function Cr(t,e){return"string"==typeof t?0<=t.lastIndexOf("%")?parseFloat(t)/100*e:parseFloat(t):t}var Ar=1;"undefined"!=typeof window&&(Ar=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Pr=Ar,Dr="#333",Mr="#ccc",Lr="__zr_normal__",Rr=["x","y","scaleX","scaleY","originX","originY","rotation","ignore"],zr={x:!0,y:!0,scaleX:!0,scaleY:!0,originX:!0,originY:!0,rotation:!0,ignore:!1},Ir={},Or=new dr(0,0,0,0),Br=(Er.prototype._init=function(t){this.attr(t)},Er.prototype.drift=function(t,e,r){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var i=this.transform;(i=i||(this.transform=[1,0,0,1,0,0]))[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},Er.prototype.beforeUpdate=function(){},Er.prototype.afterUpdate=function(){},Er.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},Er.prototype.updateInnerText=function(t){var e,r,i,n,o,a,s,h,l,u,p,c,f,d,y,g,v,_=this._textContent;!_||_.ignore&&!t||(this.textConfig||(this.textConfig={}),r=(e=this.textConfig).local,o=n=void 0,a=!1,(i=_.attachedTransform).parent=r?this:null,p=!1,i.x=_.x,i.y=_.y,i.originX=_.originX,i.originY=_.originY,i.rotation=_.rotation,i.scaleX=_.scaleX,i.scaleY=_.scaleY,null!=e.position&&(s=Or,e.layoutRect?s.copy(e.layoutRect):s.copy(this.getBoundingRect()),r||s.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Ir,e,s):function(t,e,r){var i=e.position||"inside",n=null!=e.distance?e.distance:5,o=r.height,a=r.width,s=o/2,h=r.x,l=r.y,u="left",p="top";if(i instanceof Array)h+=Cr(i[0],r.width),l+=Cr(i[1],r.height),p=u=null;else switch(i){case"left":h-=n,l+=s,u="right",p="middle";break;case"right":h+=n+a,l+=s,p="middle";break;case"top":h+=a/2,l-=n,u="center",p="bottom";break;case"bottom":h+=a/2,l+=o+n,u="center";break;case"inside":h+=a/2,l+=s,u="center",p="middle";break;case"insideLeft":h+=n,l+=s,p="middle";break;case"insideRight":h+=a-n,l+=s,u="right",p="middle";break;case"insideTop":h+=a/2,l+=n,u="center";break;case"insideBottom":h+=a/2,l+=o-n,u="center",p="bottom";break;case"insideTopLeft":h+=n,l+=n;break;case"insideTopRight":h+=a-n,l+=n,u="right";break;case"insideBottomLeft":h+=n,l+=o-n,p="bottom";break;case"insideBottomRight":h+=a-n,l+=o-n,u="right",p="bottom"}(t=t||{}).x=h,t.y=l,t.align=u,t.verticalAlign=p}(Ir,e,s),i.x=Ir.x,i.y=Ir.y,n=Ir.align,o=Ir.verticalAlign,(h=e.origin)&&null!=e.rotation&&(u=l=void 0,u="center"===h?(l=.5*s.width,.5*s.height):(l=Cr(h[0],s.width),Cr(h[1],s.height)),p=!0,i.originX=-i.x+l+(r?0:s.x),i.originY=-i.y+u+(r?0:s.y))),null!=e.rotation&&(i.rotation=e.rotation),(c=e.offset)&&(i.x+=c[0],i.y+=c[1],p||(i.originX=-c[0],i.originY=-c[1])),f=null==e.inside?"string"==typeof e.position&&0<=e.position.indexOf("inside"):e.inside,d=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=g=y=void 0,f&&this.canBeInsideText()?(y=e.insideFill,g=e.insideStroke,null!=y&&"auto"!==y||(y=this.getInsideTextFill()),null!=g&&"auto"!==g||(g=this.getInsideTextStroke(y),v=!0)):(y=e.outsideFill,g=e.outsideStroke,null!=y&&"auto"!==y||(y=this.getOutsideFill()),null!=g&&"auto"!==g||(g=this.getOutsideStroke(y),v=!0)),(y=y||"#000")===d.fill&&g===d.stroke&&v===d.autoStroke&&n===d.align&&o===d.verticalAlign||(a=!0,d.fill=y,d.stroke=g,d.autoStroke=v,d.align=n,d.verticalAlign=o,_.setDefaultTextStyle(d)),a&&_.dirtyStyle(),_.markRedraw())},Er.prototype.canBeInsideText=function(){return!0},Er.prototype.getInsideTextFill=function(){return"#fff"},Er.prototype.getInsideTextStroke=function(t){return"#000"},Er.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Mr:Dr},Er.prototype.getOutsideStroke=function(t){for(var e=this.__zr&&this.__zr.getBackgroundColor(),r="string"==typeof e&&Oe(e),i=(r=r||[255,255,255,1])[3],n=this.__zr.isDarkMode(),o=0;o<3;o++)r[o]=r[o]*i+(n?0:255)*(1-i);return r[3]=1,Ne(r,"rgba")},Er.prototype.traverse=function(t,e){},Er.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},m(this.extra,e)):this[t]=e},Er.prototype.hide=function(){this.ignore=!0,this.markRedraw()},Er.prototype.show=function(){this.ignore=!1,this.markRedraw()},Er.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(z(t))for(var r=L(t),i=0;i<r.length;i++){var n=r[i];this.attrKV(n,t[n])}return this.markRedraw(),this},Er.prototype.saveCurrentToNormalState=function(t){this._innerSaveToNormal(t);for(var e=this._normalState,r=0;r<this.animators.length;r++){var i,n,o=this.animators[r],a=o.__fromStateTransition;a&&a!==Lr||(n=(i=o.targetName)?e[i]:e,o.saveFinalToTarget(n))}},Er.prototype._innerSaveToNormal=function(t){var e=(e=this._normalState)||(this._normalState={});t.textConfig&&!e.textConfig&&(e.textConfig=this.textConfig),this._savePrimaryToNormal(t,e,Rr)},Er.prototype._savePrimaryToNormal=function(t,e,r){for(var i=0;i<r.length;i++){var n=r[i];null==t[n]||n in e||(e[n]=this[n])}},Er.prototype.hasState=function(){return 0<this.currentStates.length},Er.prototype.getState=function(t){return this.states[t]},Er.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},Er.prototype.clearStates=function(t){this.useState(Lr,!1,t)},Er.prototype.useState=function(t,e,r){var i=t===Lr;if(this.hasState()||!i){var n,o=this.currentStates,a=this.stateTransition;if(!(0<=D(o,t))||!e&&1!==o.length){if(this.stateProxy&&!i&&(n=this.stateProxy(t)),(n=n||this.states&&this.states[t])||i){i||this.saveCurrentToNormalState(n);var s=!(!n||!n.hoverLayer);return s&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,n,this._normalState,e,!r&&!this.__inHover&&a&&0<a.duration,a),this._textContent&&this._textContent.useState(t,e),this._textGuide&&this._textGuide.useState(t,e),i?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!s&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Er.REDARAW_BIT),n}g("State "+t+" not exists.")}}},Er.prototype.useStates=function(t,e){if(t.length){var r=[],i=this.currentStates,n=t.length,o=n===i.length;if(o)for(var a=0;a<n;a++)if(t[a]!==i[a]){o=!1;break}if(o)return;for(a=0;a<n;a++){var s=t[a],h=void 0;this.stateProxy&&(h=this.stateProxy(s,t)),(h=h||this.states[s])&&r.push(h)}var l=!(!r[n-1]||!r[n-1].hoverLayer);l&&this._toggleHoverLayerFlag(!0);var u=this._mergeStates(r),p=this.stateTransition;this.saveCurrentToNormalState(u),this._applyStateObj(t.join(","),u,this._normalState,!1,!e&&!this.__inHover&&p&&0<p.duration,p),this._textContent&&this._textContent.useStates(t),this._textGuide&&this._textGuide.useStates(t),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Er.REDARAW_BIT)}else this.clearStates()},Er.prototype._updateAnimationTargets=function(){for(var t=0;t<this.animators.length;t++){var e=this.animators[t];e.targetName&&e.changeTarget(this[e.targetName])}},Er.prototype.removeState=function(t){var e,r=D(this.currentStates,t);0<=r&&((e=this.currentStates.slice()).splice(r,1),this.useStates(e))},Er.prototype.replaceState=function(t,e,r){var i=this.currentStates.slice(),n=D(i,t),o=0<=D(i,e);0<=n?o?i.splice(n,1):i[n]=e:r&&!o&&i.push(e),this.useStates(i)},Er.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},Er.prototype._mergeStates=function(t){for(var e,r={},i=0;i<t.length;i++){var n=t[i];m(r,n),n.textConfig&&m(e=e||{},n.textConfig)}return e&&(r.textConfig=e),r},Er.prototype._applyStateObj=function(t,e,r,i,n,o){var a=!(e&&i);e&&e.textConfig?(this.textConfig=m({},i?this.textConfig:r.textConfig),m(this.textConfig,e.textConfig)):a&&r.textConfig&&(this.textConfig=r.textConfig);for(var s={},h=!1,l=0;l<Rr.length;l++){var u=Rr[l],p=n&&zr[u];e&&null!=e[u]?p?(h=!0,s[u]=e[u]):this[u]=e[u]:a&&null!=r[u]&&(p?(h=!0,s[u]=r[u]):this[u]=r[u])}if(!n)for(l=0;l<this.animators.length;l++){var c=this.animators[l],f=c.targetName;c.__changeFinalValue(f?(e||r)[f]:e||r)}h&&this._transitionState(t,s,o)},Er.prototype._attachComponent=function(t){if(t.__zr&&!t.__hostTarget)throw new Error("Text element has been added to zrender.");if(t===this)throw new Error("Recursive component attachment.");var e=this.__zr;e&&t.addSelfToZr(e),t.__zr=e,t.__hostTarget=this},Er.prototype._detachComponent=function(t){t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__hostTarget=null},Er.prototype.getClipPath=function(){return this._clipPath},Er.prototype.setClipPath=function(t){this._clipPath&&this._clipPath!==t&&this.removeClipPath(),this._attachComponent(t),this._clipPath=t,this.markRedraw()},Er.prototype.removeClipPath=function(){var t=this._clipPath;t&&(this._detachComponent(t),this._clipPath=null,this.markRedraw())},Er.prototype.getTextContent=function(){return this._textContent},Er.prototype.setTextContent=function(t){var e=this._textContent;if(e!==t){if(e&&e!==t&&this.removeTextContent(),t.__zr&&!t.__hostTarget)throw new Error("Text element has been added to zrender.");t.attachedTransform=new fe,this._attachComponent(t),this._textContent=t,this.markRedraw()}},Er.prototype.setTextConfig=function(t){this.textConfig||(this.textConfig={}),m(this.textConfig,t),this.markRedraw()},Er.prototype.removeTextContent=function(){var t=this._textContent;t&&(t.attachedTransform=null,this._detachComponent(t),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},Er.prototype.getTextGuideLine=function(){return this._textGuide},Er.prototype.setTextGuideLine=function(t){this._textGuide&&this._textGuide!==t&&this.removeTextGuideLine(),this._attachComponent(t),this._textGuide=t,this.markRedraw()},Er.prototype.removeTextGuideLine=function(){var t=this._textGuide;t&&(this._detachComponent(t),this._textGuide=null,this.markRedraw())},Er.prototype.markRedraw=function(){this.__dirty|=Er.REDARAW_BIT;var t=this.__zr;t&&(this.__inHover?t.refreshHover():t.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},Er.prototype.dirty=function(){this.markRedraw()},Er.prototype._toggleHoverLayerFlag=function(t){this.__inHover=t;var e=this._textContent,r=this._textGuide;e&&(e.__inHover=t),r&&(r.__inHover=t)},Er.prototype.addSelfToZr=function(t){this.__zr=t;var e=this.animators;if(e)for(var r=0;r<e.length;r++)t.animation.addAnimator(e[r]);this._clipPath&&this._clipPath.addSelfToZr(t),this._textContent&&this._textContent.addSelfToZr(t),this._textGuide&&this._textGuide.addSelfToZr(t)},Er.prototype.removeSelfFromZr=function(t){this.__zr=null;var e=this.animators;if(e)for(var r=0;r<e.length;r++)t.animation.removeAnimator(e[r]);this._clipPath&&this._clipPath.removeSelfFromZr(t),this._textContent&&this._textContent.removeSelfFromZr(t),this._textGuide&&this._textGuide.removeSelfFromZr(t)},Er.prototype.animate=function(t,e){var r=t?this[t]:this;if(r){var i=new rr(r,e);return this.addAnimator(i,t),i}g('Property "'+t+'" is not existed in element '+this.id)},Er.prototype.addAnimator=function(r,t){var e=this.__zr,i=this;r.during(function(){i.updateDuringAnimation(t)}).done(function(){var t=i.animators,e=D(t,r);0<=e&&t.splice(e,1)}),this.animators.push(r),e&&e.animation.addAnimator(r),e&&e.wakeUp()},Er.prototype.updateDuringAnimation=function(t){this.markRedraw()},Er.prototype.stopAnimation=function(t,e){for(var r=this.animators,i=r.length,n=[],o=0;o<i;o++){var a=r[o];t&&t!==a.scope?n.push(a):a.stop(e)}return this.animators=n,this},Er.prototype.animateTo=function(t,e,r){Fr(this,t,e,r)},Er.prototype.animateFrom=function(t,e,r){Fr(this,t,e,r,!0)},Er.prototype._transitionState=function(t,e,r,i){for(var n=Fr(this,e,r,i),o=0;o<n.length;o++)n[o].__fromStateTransition=t},Er.prototype.getBoundingRect=function(){return null},Er.prototype.getPaintRect=function(){return null},Er.REDARAW_BIT=1,Er.initDefaultProps=function(){var t=Er.prototype;t.type="element",t.name="",t.ignore=!1,t.silent=!1,t.isGroup=!1,t.draggable=!1,t.dragging=!1,t.ignoreClip=!1,t.__inHover=!1,t.__dirty=Er.REDARAW_BIT;var i={};function a(t,e,r){i[t+e+r]||(console.warn("DEPRECATED: '"+t+"' has been deprecated. use '"+e+"', '"+r+"' instead"),i[t+e+r]=!0)}function e(e,r,i,n){function o(e,t){Object.defineProperty(t,0,{get:function(){return e[i]},set:function(t){e[i]=t}}),Object.defineProperty(t,1,{get:function(){return e[n]},set:function(t){e[n]=t}})}Object.defineProperty(t,e,{get:function(){var t;return a(e,i,n),this[r]||(t=this[r]=[],o(this,t)),this[r]},set:function(t){a(e,i,n),this[i]=t[0],this[n]=t[1],this[r]=t,o(this,t)}})}Object.defineProperty&&(!h.browser.ie||8<h.browser.version)&&(e("position","_legacyPos","x","y"),e("scale","_legacyScale","scaleX","scaleY"),e("origin","_legacyOrigin","originX","originY"))}(),Er);function Er(t){this.id=y(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}function Fr(t,e,r,i,n){var o=[];!function t(e,r,i,n,o,a,s,h){var l=[];var u=[];var p=L(n);var c=o.duration;var f=o.delay;var d=o.additive;var y=o.setToFinal;var g=!z(a);for(var v=0;v<p.length;v++){var _=p[v];if(null!=i[_]&&null!=n[_]&&(g||a[_]))if(z(n[_])&&!M(n[_])){if(r){h||(i[_]=n[_],e.updateDuringAnimation(r));continue}t(e,_,i[_],n[_],o,a&&a[_],s,h)}else l.push(_),u.push(_);else h||(i[_]=n[_],e.updateDuringAnimation(r),u.push(_))}var m=l.length;if(0<m||o.force&&!s.length){for(var x=e.animators,w=[],b=0;b<x.length;b++)x[b].targetName===r&&w.push(x[b]);if(!d&&w.length)for(var b=0;b<w.length;b++){var k,S=w[b].stopTracks(u);S&&(k=D(x,w[b]),x.splice(k,1))}var T=void 0,C=void 0,A=void 0;if(h){C={},y&&(T={});for(var b=0;b<m;b++){var _=l[b];C[_]=i[_],y?T[_]=n[_]:i[_]=n[_]}}else if(y){A={};for(var b=0;b<m;b++){var _=l[b];A[_]=Qe(i[_]),Nr(i,n,_)}}var P=new rr(i,!1,d?w:null);P.targetName=r,o.scope&&(P.scope=o.scope),y&&T&&P.whenWithKeys(0,T,l),A&&P.whenWithKeys(0,A,l),P.whenWithKeys(null==c?500:c,h?C:n,l).delay(f||0),e.addAnimator(P,r),s.push(P)}}(t,"",t,e,r=r||{},i,o,n);function a(){l=!0,--h<=0&&(l?u&&u():p&&p())}function s(){--h<=0&&(l?u&&u():p&&p())}var h=o.length,l=!1,u=r.done,p=r.aborted;h||u&&u(),0<o.length&&r.during&&o[0].during(function(t,e){r.during(e)});for(var c=0;c<o.length;c++){var f=o[c];f.done(a),f.aborted(s),f.start(r.easing,r.force)}return o}function Hr(t,e,r){for(var i=0;i<r;i++)t[i]=e[i]}function Nr(t,e,r){if(M(e[r]))if(M(t[r])||(t[r]=[]),O(e[r])){var i=e[r].length;t[r].length!==i&&(t[r]=new e[r].constructor(i),Hr(t[r],e[r],i))}else{var n=e[r],o=t[r],a=n.length;if(M(n[0]))for(var s=n[0].length,h=0;h<a;h++)o[h]?Hr(o[h],n[h],s):o[h]=Array.prototype.slice.call(n[h]);else Hr(o,n,a);o.length=n.length}else t[r]=e[r]}b(Br,xt),b(Br,fe);var Wr=32,Xr=7;function jr(t,e,r,i){var n=e+1;if(n===r)return 1;if(i(t[n++],t[e])<0){for(;n<r&&i(t[n],t[n-1])<0;)n++;!function(t,e,r){r--;for(;e<r;){var i=t[e];t[e++]=t[r],t[r--]=i}}(t,e,n)}else for(;n<r&&0<=i(t[n],t[n-1]);)n++;return n-e}function Yr(t,e,r,i,n){for(i===e&&i++;i<r;i++){for(var o,a=t[i],s=e,h=i;s<h;)n(a,t[o=s+h>>>1])<0?h=o:s=1+o;var l=i-s;switch(l){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(;0<l;)t[s+l]=t[s+l-1],l--}t[s]=a}}function Gr(t,e,r,i,n,o){var a=0,s=0,h=1;if(0<o(t,e[r+n])){for(s=i-n;h<s&&0<o(t,e[r+n+h]);)(h=1+((a=h)<<1))<=0&&(h=s);s<h&&(h=s),a+=n,h+=n}else{for(s=n+1;h<s&&o(t,e[r+n-h])<=0;)(h=1+((a=h)<<1))<=0&&(h=s);s<h&&(h=s);var l=a,a=n-h,h=n-l}for(a++;a<h;){var u=a+(h-a>>>1);0<o(t,e[r+u])?a=u+1:h=u}return h}function qr(t,e,r,i,n,o){var a=0,s=0,h=1;if(o(t,e[r+n])<0){for(s=n+1;h<s&&o(t,e[r+n-h])<0;)(h=1+((a=h)<<1))<=0&&(h=s);s<h&&(h=s);var l=a,a=n-h,h=n-l}else{for(s=i-n;h<s&&0<=o(t,e[r+n+h]);)(h=1+((a=h)<<1))<=0&&(h=s);s<h&&(h=s),a+=n,h+=n}for(a++;a<h;){var u=a+(h-a>>>1);o(t,e[r+u])<0?h=u:a=u+1}return h}function Ur(d,y){var a,s,g=Xr,h=0,v=(d.length,[]);function e(t){var e=a[t],r=s[t],i=a[t+1],n=s[t+1];s[t]=r+n,t===h-3&&(a[t+1]=a[t+2],s[t+1]=s[t+2]),h--;var o=qr(d[i],d,e,r,0,y);e+=o,0!=(r-=o)&&0!==(n=Gr(d[e+r-1],d,i,n,n-1,y))&&(r<=n?function(t,e,r,i){var n=0;for(n=0;n<e;n++)v[n]=d[t+n];var o=0,a=r,s=t;if(d[s++]=d[a++],0==--i){for(n=0;n<e;n++)d[s+n]=v[o+n];return}if(1===e){for(n=0;n<i;n++)d[s+n]=d[a+n];return d[s+i]=v[o]}var h,l,u,p=g;for(;;){l=h=0,u=!1;do{if(y(d[a],v[o])<0){if(d[s++]=d[a++],l++,(h=0)==--i){u=!0;break}}else if(d[s++]=v[o++],h++,l=0,1==--e){u=!0;break}}while((h|l)<p);if(u)break;do{if(0!==(h=qr(d[a],v,o,e,0,y))){for(n=0;n<h;n++)d[s+n]=v[o+n];if(s+=h,o+=h,(e-=h)<=1){u=!0;break}}if(d[s++]=d[a++],0==--i){u=!0;break}if(0!==(l=Gr(v[o],d,a,i,0,y))){for(n=0;n<l;n++)d[s+n]=d[a+n];if(s+=l,a+=l,0===(i-=l)){u=!0;break}}if(d[s++]=v[o++],1==--e){u=!0;break}p--}while(Xr<=h||Xr<=l);if(u)break;p<0&&(p=0),p+=2}if((g=p)<1&&(g=1),1===e){for(n=0;n<i;n++)d[s+n]=d[a+n];d[s+i]=v[o]}else{if(0===e)throw new Error;for(n=0;n<e;n++)d[s+n]=v[o+n]}}:function(t,e,r,i){var n=0;for(n=0;n<i;n++)v[n]=d[r+n];var o=t+e-1,a=i-1,s=r+i-1,h=0,l=0;if(d[s--]=d[o--],0==--e){for(h=s-(i-1),n=0;n<i;n++)d[h+n]=v[n];return}if(1===i){for(l=(s-=e)+1,h=(o-=e)+1,n=e-1;0<=n;n--)d[l+n]=d[h+n];return d[s]=v[a]}var u=g;for(;;){var p=0,c=0,f=!1;do{if(y(v[a],d[o])<0){if(d[s--]=d[o--],p++,(c=0)==--e){f=!0;break}}else if(d[s--]=v[a--],c++,p=0,1==--i){f=!0;break}}while((p|c)<u);if(f)break;do{if(0!==(p=e-qr(v[a],d,t,e,e-1,y))){for(e-=p,l=(s-=p)+1,h=(o-=p)+1,n=p-1;0<=n;n--)d[l+n]=d[h+n];if(0===e){f=!0;break}}if(d[s--]=v[a--],1==--i){f=!0;break}if(0!==(c=i-Gr(d[o],v,0,i,i-1,y))){for(i-=c,l=(s-=c)+1,h=(a-=c)+1,n=0;n<c;n++)d[l+n]=v[h+n];if(i<=1){f=!0;break}}if(d[s--]=d[o--],0==--e){f=!0;break}u--}while(Xr<=p||Xr<=c);if(f)break;u<0&&(u=0),u+=2}(g=u)<1&&(g=1);if(1===i){for(l=(s-=e)+1,h=(o-=e)+1,n=e-1;0<=n;n--)d[l+n]=d[h+n];d[s]=v[a]}else{if(0===i)throw new Error;for(h=s-(i-1),n=0;n<i;n++)d[h+n]=v[n]}})(e,r,i,n)}return a=[],s=[],{mergeRuns:function(){for(;1<h;){var t=h-2;if(1<=t&&s[t-1]<=s[t]+s[t+1]||2<=t&&s[t-2]<=s[t]+s[t-1])s[t-1]<s[t+1]&&t--;else if(s[t]>s[t+1])break;e(t)}},forceMergeRuns:function(){for(;1<h;){var t=h-2;0<t&&s[t-1]<s[t+1]&&t--,e(t)}},pushRun:function(t,e){a[h]=t,s[h]=e,h+=1}}}function Vr(t,e,r,i){r=r||0;var n=(i=i||t.length)-r;if(!(n<2)){var o=0;if(n<Wr)Yr(t,r,i,r+(o=jr(t,r,i,e)),e);else{var a,s=Ur(t,e),h=function(t){for(var e=0;Wr<=t;)e|=1&t,t>>=1;return t+e}(n);do{(o=jr(t,r,i,e))<h&&(h<(a=n)&&(a=h),Yr(t,r,r+a,r+o,e),o=a),s.pushRun(r,o),s.mergeRuns(),n-=o,r+=o}while(0!==n);s.forceMergeRuns()}}}var Zr=!1;function Kr(){Zr||(Zr=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Qr(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var $r=(Jr.prototype.traverse=function(t,e){for(var r=0;r<this._roots.length;r++)this._roots[r].traverse(t,e)},Jr.prototype.getDisplayList=function(t,e){e=e||!1;var r=this._displayList;return!t&&r.length||this.updateDisplayList(e),r},Jr.prototype.updateDisplayList=function(t){this._displayListLen=0;for(var e=this._roots,r=this._displayList,i=0,n=e.length;i<n;i++)this._updateAndAddDisplayable(e[i],null,t);r.length=this._displayListLen,h.canvasSupported&&Vr(r,Qr)},Jr.prototype._updateAndAddDisplayable=function(t,e,r){if(!t.ignore||r){t.beforeUpdate(),t.update(),t.afterUpdate();var i=t.getClipPath();if(t.ignoreClip)e=null;else if(i){e=e?e.slice():[];for(var n=i,o=t;n;)n.parent=o,n.updateTransform(),e.push(n),n=(o=n).getClipPath()}if(t.childrenRef){for(var a=t.childrenRef(),s=0;s<a.length;s++){var h=a[s];t.__dirty&&(h.__dirty|=Br.REDARAW_BIT),this._updateAndAddDisplayable(h,e,r)}t.__dirty=0}else{var l=t;e&&e.length?l.__clipPaths=e:l.__clipPaths&&0<l.__clipPaths.length&&(l.__clipPaths=[]),isNaN(l.z)&&(Kr(),l.z=0),isNaN(l.z2)&&(Kr(),l.z2=0),isNaN(l.zlevel)&&(Kr(),l.zlevel=0),this._displayList[this._displayListLen++]=l}var u=t.getDecalElement&&t.getDecalElement();u&&this._updateAndAddDisplayable(u,e,r);var p=t.getTextGuideLine();p&&this._updateAndAddDisplayable(p,e,r);var c=t.getTextContent();c&&this._updateAndAddDisplayable(c,e,r)}},Jr.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},Jr.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,r=t.length;e<r;e++)this.delRoot(t[e]);else{var i=D(this._roots,t);0<=i&&this._roots.splice(i,1)}},Jr.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},Jr.prototype.getRoots=function(){return this._roots},Jr.prototype.dispose=function(){this._displayList=null,this._roots=null},Jr);function Jr(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Qr}var ti,ei="undefined"!=typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)},ri=(J(ii,ti=xt),ii.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._clipsHead?((this._clipsTail.next=t).prev=this._clipsTail,t.next=null,this._clipsTail=t):this._clipsHead=this._clipsTail=t,t.animation=this},ii.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},ii.prototype.removeClip=function(t){var e,r;t.animation&&(e=t.prev,r=t.next,e?e.next=r:this._clipsHead=r,r?r.prev=e:this._clipsTail=e,t.next=t.prev=t.animation=null)},ii.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},ii.prototype.update=function(t){for(var e=(new Date).getTime()-this._pausedTime,r=e-this._time,i=this._clipsHead;i;)var n=i.next,i=(i.step(e,r)&&(i.ondestroy&&i.ondestroy(),this.removeClip(i)),n);this._time=e,t||(this.onframe(r),this.trigger("frame",r),this.stage.update&&this.stage.update())},ii.prototype._startLoop=function(){var e=this;this._running=!0,ei(function t(){e._running&&(ei(t),e._paused||e.update())})},ii.prototype.start=function(){this._running||(this._time=(new Date).getTime(),this._pausedTime=0,this._startLoop())},ii.prototype.stop=function(){this._running=!1},ii.prototype.pause=function(){this._paused||(this._pauseStart=(new Date).getTime(),this._paused=!0)},ii.prototype.resume=function(){this._paused&&(this._pausedTime+=(new Date).getTime()-this._pauseStart,this._paused=!1)},ii.prototype.clear=function(){for(var t=this._clipsHead;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._clipsHead=this._clipsTail=null},ii.prototype.isFinished=function(){return null==this._clipsHead},ii.prototype.animate=function(t,e){e=e||{},this.start();var r=new rr(t,e.loop);return this.addAnimator(r),r},ii);function ii(t){var e=ti.call(this)||this;return e._running=!1,e._time=0,e._pausedTime=0,e._pauseStart=0,e._paused=!1,t=t||{},e.stage=t.stage||{},e.onframe=t.onframe||function(){},e}var ni,oi,ai=h.domSupported,si=(oi={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:ni=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:W(ni,function(t){var e=t.replace("mouse","pointer");return oi.hasOwnProperty(e)?e:t})}),hi=["mousemove","mouseup"],li=["pointermove","pointerup"],ui=!1;function pi(t){var e=t.pointerType;return"pen"===e||"touch"===e}function ci(t){t&&(t.zrByTouch=!0)}function fi(t,e){for(var r=e,i=!1;r&&9!==r.nodeType&&!(i=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return i}var di=function(t,e){this.stopPropagation=K,this.stopImmediatePropagation=K,this.preventDefault=K,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY},yi={mousedown:function(t){t=It(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=It(this.dom,t);var e=this.__mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=It(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){fi(this,(t=It(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){ui=!0,t=It(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){ui||(t=It(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){ci(t=It(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),yi.mousemove.call(this,t),yi.mousedown.call(this,t)},touchmove:function(t){ci(t=It(this.dom,t)),this.handler.processGesture(t,"change"),yi.mousemove.call(this,t)},touchend:function(t){ci(t=It(this.dom,t)),this.handler.processGesture(t,"end"),yi.mouseup.call(this,t),new Date-this.__lastTouchMoment<300&&yi.click.call(this,t)},pointerdown:function(t){yi.mousedown.call(this,t)},pointermove:function(t){pi(t)||yi.mousemove.call(this,t)},pointerup:function(t){yi.mouseup.call(this,t)},pointerout:function(t){pi(t)||yi.mouseout.call(this,t)}};k(["click","dblclick","contextmenu"],function(e){yi[e]=function(t){t=It(this.dom,t),this.trigger(e,t)}});var gi={pointermove:function(t){pi(t)||gi.mousemove.call(this,t)},pointerup:function(t){gi.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function vi(i,n){var o=n.domHandlers;h.pointerEventsSupported?k(si.pointer,function(e){mi(n,e,function(t){o[e].call(i,t)})}):(h.touchEventsSupported&&k(si.touch,function(r){mi(n,r,function(t){var e;o[r].call(i,t),(e=n).touching=!0,null!=e.touchTimer&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)})}),k(si.mouse,function(e){mi(n,e,function(t){t=zt(t),n.touching||o[e].call(i,t)})}))}function _i(n,o){function t(i){mi(o,i,function(t){var e,r;t=zt(t),fi(n,t.target)||(r=t,t=It((e=n).dom,new di(e,r),!0),o.domHandlers[i].call(n,t))},{capture:!0})}h.pointerEventsSupported?k(li,t):h.touchEventsSupported||k(hi,t)}function mi(t,e,r,i){var n,o,a,s;t.mounted[e]=r,t.listenerOpts[e]=i,n=t.domTarget,o=e,a=r,s=i,Pt?n.addEventListener(o,a,s):n.attachEvent("on"+o,a)}function xi(t){var e,r,i,n,o=t.mounted;for(var a in o)o.hasOwnProperty(a)&&(e=t.domTarget,i=o[r=a],n=t.listenerOpts[a],Pt?e.removeEventListener(r,i,n):e.detachEvent("on"+r,i));t.mounted={}}var wi,bi=function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e},ki=(J(Si,wi=xt),Si.prototype.dispose=function(){xi(this._localHandlerScope),ai&&xi(this._globalHandlerScope)},Si.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},Si.prototype.__togglePointerCapture=function(t){var e;this.__mayPointerCapture=null,ai&&+this.__pointerCapturing^+t&&(this.__pointerCapturing=t,e=this._globalHandlerScope,t?_i(this,e):xi(e))},Si);function Si(t,e){var r=wi.call(this)||this;return r.__pointerCapturing=!1,r.dom=t,r.painterRoot=e,r._localHandlerScope=new bi(t,yi),ai&&(r._globalHandlerScope=new bi(document,gi)),vi(r,r._localHandlerScope),r}var Ti,Ci=(J(Ai,Ti=Br),Ai.prototype.childrenRef=function(){return this._children},Ai.prototype.children=function(){return this._children.slice()},Ai.prototype.childAt=function(t){return this._children[t]},Ai.prototype.childOfName=function(t){for(var e=this._children,r=0;r<e.length;r++)if(e[r].name===t)return e[r]},Ai.prototype.childCount=function(){return this._children.length},Ai.prototype.add=function(t){if(t&&(t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),t.__hostTarget))throw"This elemenet has been used as an attachment";return this},Ai.prototype.addBefore=function(t,e){var r,i;return t&&t!==this&&t.parent!==this&&e&&e.parent===this&&0<=(i=(r=this._children).indexOf(e))&&(r.splice(i,0,t),this._doAdd(t)),this},Ai.prototype.replaceAt=function(t,e){var r,i=this._children,n=i[e];return t&&t!==this&&t.parent!==this&&t!==n&&(i[e]=t,n.parent=null,(r=this.__zr)&&n.removeSelfFromZr(r),this._doAdd(t)),this},Ai.prototype._doAdd=function(t){t.parent&&t.parent.remove(t);var e=(t.parent=this).__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},Ai.prototype.remove=function(t){var e=this.__zr,r=this._children,i=D(r,t);return i<0||(r.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},Ai.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,r=0;r<t.length;r++){var i=t[r];e&&i.removeSelfFromZr(e),i.parent=null}return t.length=0,this},Ai.prototype.eachChild=function(t,e){for(var r=this._children,i=0;i<r.length;i++){var n=r[i];t.call(e,n,i)}return this},Ai.prototype.traverse=function(t,e){for(var r=0;r<this._children.length;r++){var i=this._children[r],n=t.call(e,i);i.isGroup&&!n&&i.traverse(t,e)}return this},Ai.prototype.addSelfToZr=function(t){Ti.prototype.addSelfToZr.call(this,t);for(var e=0;e<this._children.length;e++)this._children[e].addSelfToZr(t)},Ai.prototype.removeSelfFromZr=function(t){Ti.prototype.removeSelfFromZr.call(this,t);for(var e=0;e<this._children.length;e++)this._children[e].removeSelfFromZr(t)},Ai.prototype.getBoundingRect=function(t){for(var e=new dr(0,0,0,0),r=t||this._children,i=[],n=null,o=0;o<r.length;o++){var a,s,h=r[o];h.ignore||h.invisible||(a=h.getBoundingRect(),(s=h.getLocalTransform(i))?(dr.applyTransform(e,a,s),(n=n||e.clone()).union(e)):(n=n||a.clone()).union(a))}return n||e},Ai);function Ai(t){var e=Ti.call(this)||this;return e.isGroup=!0,e._children=[],e.attr(t),e}Ci.prototype.type="group";var Pi=!h.canvasSupported,Di={},Mi={};var Li=(Ri.prototype.add=function(t){t&&(this.storage.addRoot(t),t.addSelfToZr(this),this.refresh())},Ri.prototype.remove=function(t){t&&(this.storage.delRoot(t),t.removeSelfFromZr(this),this.refresh())},Ri.prototype.configLayer=function(t,e){this.painter.configLayer&&this.painter.configLayer(t,e),this.refresh()},Ri.prototype.setBackgroundColor=function(t){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this.refresh(),this._backgroundColor=t,this._darkMode=function(t){if(!t)return!1;if("string"==typeof t)return We(t,1)<.4;if(t.colorStops){for(var e=t.colorStops,r=0,i=e.length,n=0;n<i;n++)r+=We(e[n].color,1);return(r/=i)<.4}return!1}(t)},Ri.prototype.getBackgroundColor=function(){return this._backgroundColor},Ri.prototype.setDarkMode=function(t){this._darkMode=t},Ri.prototype.isDarkMode=function(){return this._darkMode},Ri.prototype.refreshImmediately=function(t){t||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1},Ri.prototype.refresh=function(){this._needsRefresh=!0,this.animation.start()},Ri.prototype.flush=function(){this._flush(!1)},Ri.prototype._flush=function(t){var e,r=(new Date).getTime();this._needsRefresh&&(e=!0,this.refreshImmediately(t)),this._needsRefreshHover&&(e=!0,this.refreshHoverImmediately());var i=(new Date).getTime();e?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:i-r})):0<this._sleepAfterStill&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},Ri.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},Ri.prototype.wakeUp=function(){this.animation.start(),this._stillFrameAccum=0},Ri.prototype.addHover=function(t){},Ri.prototype.removeHover=function(t){},Ri.prototype.clearHover=function(){},Ri.prototype.refreshHover=function(){this._needsRefreshHover=!0},Ri.prototype.refreshHoverImmediately=function(){this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover()},Ri.prototype.resize=function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},Ri.prototype.clearAnimation=function(){this.animation.clear()},Ri.prototype.getWidth=function(){return this.painter.getWidth()},Ri.prototype.getHeight=function(){return this.painter.getHeight()},Ri.prototype.pathToImage=function(t,e){if(this.painter.pathToImage)return this.painter.pathToImage(t,e)},Ri.prototype.setCursorStyle=function(t){this.handler.setCursorStyle(t)},Ri.prototype.findHover=function(t,e){return this.handler.findHover(t,e)},Ri.prototype.on=function(t,e,r){return this.handler.on(t,e,r),this},Ri.prototype.off=function(t,e){this.handler.off(t,e)},Ri.prototype.trigger=function(t,e){this.handler.trigger(t,e)},Ri.prototype.clear=function(){for(var t=this.storage.getRoots(),e=0;e<t.length;e++)t[e]instanceof Ci&&t[e].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()},Ri.prototype.dispose=function(){var t;this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,t=this.id,delete Mi[t]},Ri);function Ri(t,e,r){var i=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,r=r||{},this.dom=e,this.id=t;var n=new $r,o=r.renderer||"canvas";if(Pi)throw new Error("IE8 support has been dropped since 5.0");if(Di[o]||(o=L(Di)[0]),!Di[o])throw new Error("Renderer '"+o+"' is not imported. Please import it first.");r.useDirtyRect=null!=r.useDirtyRect&&r.useDirtyRect;var a=new Di[o](e,n,r,t);this.storage=n,this.painter=a;var s=h.node||h.worker?null:new ki(a.getViewportRoot(),a.root);this.handler=new Vt(n,a,s,a.root),this.animation=new ri({stage:{update:function(){return i._flush(!0)}}}),this.animation.start()}function zi(t,e){Di[t]=e}var Ii="__zr_style_"+Math.round(10*Math.random()),Oi={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Bi={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Oi[Ii]=!0;var Ei,Fi,Hi=["z","z2","invisible"],Ni=(J(Wi,Ei=Br),Wi.prototype._init=function(t){for(var e=L(t),r=0;r<e.length;r++){var i=e[r];"style"===i?this.useStyle(t[i]):Ei.prototype.attrKV.call(this,i,t[i])}this.style||this.useStyle({})},Wi.prototype.beforeBrush=function(){},Wi.prototype.afterBrush=function(){},Wi.prototype.innerBeforeBrush=function(){},Wi.prototype.innerAfterBrush=function(){},Wi.prototype.shouldBePainted=function(t,e,r,i){var n=this.transform;if(this.ignore||this.invisible||0===this.style.opacity||this.culling&&function(t,e,r){return Xi.copy(t.getBoundingRect()),t.transform&&Xi.applyTransform(t.transform),ji.width=e,ji.height=r,!Xi.intersect(ji)}(this,t,e)||n&&!n[0]&&!n[3])return!1;if(r&&this.__clipPaths)for(var o=0;o<this.__clipPaths.length;++o)if(this.__clipPaths[o].isZeroArea())return!1;if(i&&this.parent)for(var a=this.parent;a;){if(a.ignore)return!1;a=a.parent}return!0},Wi.prototype.contain=function(t,e){return this.rectContain(t,e)},Wi.prototype.traverse=function(t,e){t.call(e,this)},Wi.prototype.rectContain=function(t,e){var r=this.transformCoordToLocal(t,e);return this.getBoundingRect().contain(r[0],r[1])},Wi.prototype.getPaintRect=function(){var t,e,r,i,n,o,a,s=this._paintRect;return this._paintRect&&!this.__dirty||(t=this.transform,e=this.getBoundingRect(),i=(r=this.style).shadowBlur||0,n=r.shadowOffsetX||0,o=r.shadowOffsetY||0,s=this._paintRect||(this._paintRect=new dr(0,0,0,0)),t?dr.applyTransform(s,e,t):s.copy(e),(i||n||o)&&(s.width+=2*i+Math.abs(n),s.height+=2*i+Math.abs(o),s.x=Math.min(s.x,s.x+n-i),s.y=Math.min(s.y,s.y+o-i)),a=this.dirtyRectTolerance,s.isZero()||(s.x=Math.floor(s.x-a),s.y=Math.floor(s.y-a),s.width=Math.ceil(s.width+1+2*a),s.height=Math.ceil(s.height+1+2*a))),s},Wi.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new dr(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},Wi.prototype.getPrevPaintRect=function(){return this._prevPaintRect},Wi.prototype.animateStyle=function(t){return this.animate("style",t)},Wi.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():this.markRedraw()},Wi.prototype.attrKV=function(t,e){"style"!==t?Ei.prototype.attrKV.call(this,t,e):this.style?this.setStyle(e):this.useStyle(e)},Wi.prototype.setStyle=function(t,e){return"string"==typeof t?this.style[t]=e:m(this.style,t),this.dirtyStyle(),this},Wi.prototype.dirtyStyle=function(){this.markRedraw(),this.__dirty|=Wi.STYLE_CHANGED_BIT,this._rect&&(this._rect=null)},Wi.prototype.dirty=function(){this.dirtyStyle()},Wi.prototype.styleChanged=function(){return!!(this.__dirty&Wi.STYLE_CHANGED_BIT)},Wi.prototype.styleUpdated=function(){this.__dirty&=~Wi.STYLE_CHANGED_BIT},Wi.prototype.createStyle=function(t){return Z(Oi,t)},Wi.prototype.useStyle=function(t){t[Ii]||(t=this.createStyle(t)),this.__inHover?this.__hoverStyle=t:this.style=t,this.dirtyStyle()},Wi.prototype.isStyleObject=function(t){return t[Ii]},Wi.prototype._innerSaveToNormal=function(t){Ei.prototype._innerSaveToNormal.call(this,t);var e=this._normalState;t.style&&!e.style&&(e.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(t,e,Hi)},Wi.prototype._applyStateObj=function(t,e,r,i,n,o){Ei.prototype._applyStateObj.call(this,t,e,r,i,n,o);var a,s=!(e&&i);if(e&&e.style?n?i?a=e.style:(a=this._mergeStyle(this.createStyle(),r.style),this._mergeStyle(a,e.style)):(a=this._mergeStyle(this.createStyle(),i?this.style:r.style),this._mergeStyle(a,e.style)):s&&(a=r.style),a)if(n){var h=this.style;if(this.style=this.createStyle(s?{}:h),s)for(var l=L(h),u=0;u<l.length;u++)(c=l[u])in a&&(a[c]=a[c],this.style[c]=h[c]);for(var p=L(a),u=0;u<p.length;u++){var c=p[u];this.style[c]=this.style[c]}this._transitionState(t,{style:a},o,this.getAnimationStyleProps())}else this.useStyle(a);for(u=0;u<Hi.length;u++)c=Hi[u],e&&null!=e[c]?this[c]=e[c]:s&&null!=r[c]&&(this[c]=r[c])},Wi.prototype._mergeStates=function(t){for(var e,r=Ei.prototype._mergeStates.call(this,t),i=0;i<t.length;i++){var n=t[i];n.style&&(e=e||{},this._mergeStyle(e,n.style))}return e&&(r.style=e),r},Wi.prototype._mergeStyle=function(t,e){return m(t,e),t},Wi.prototype.getAnimationStyleProps=function(){return Bi},Wi.STYLE_CHANGED_BIT=2,Wi.initDefaultProps=((Fi=Wi.prototype).type="displayable",Fi.invisible=!1,Fi.z=0,Fi.z2=0,Fi.zlevel=0,Fi.culling=!1,Fi.cursor="pointer",Fi.rectHover=!1,Fi.incremental=!1,Fi._rect=null,Fi.dirtyRectTolerance=0,void(Fi.__dirty=Br.REDARAW_BIT|Wi.STYLE_CHANGED_BIT)),Wi);function Wi(t){return Ei.call(this,t)||this}var Xi=new dr(0,0,0,0),ji=new dr(0,0,0,0);var Yi=Math.pow,Gi=Math.sqrt,qi=1e-8,Ui=1e-4,Vi=Gi(3),Zi=1/3,Ki=tt(),Qi=tt(),$i=tt();function Ji(t){return-qi<t&&t<qi}function tn(t){return qi<t||t<-qi}function en(t,e,r,i,n){var o=1-n;return o*o*(o*t+3*n*e)+n*n*(n*i+3*o*r)}function rn(t,e,r,i,n){var o=1-n;return 3*(((e-t)*o+2*(r-e)*n)*o+(i-r)*n*n)}function nn(t,e,r,i,n){var o,a,s,h,l=6*r-12*e+6*t,u=9*e+3*i-3*t-9*r,p=3*e-3*t,c=0;return Ji(u)?tn(l)&&0<=(s=-p/l)&&s<=1&&(n[c++]=s):Ji(o=l*l-4*u*p)?n[0]=-l/(2*u):0<o&&(h=(-l-(a=Gi(o)))/(2*u),0<=(s=(-l+a)/(2*u))&&s<=1&&(n[c++]=s),0<=h&&h<=1&&(n[c++]=h)),c}function on(t,e,r,i,n,o){var a=(e-t)*n+t,s=(r-e)*n+e,h=(i-r)*n+r,l=(s-a)*n+a,u=(h-s)*n+s,p=(u-l)*n+l;o[0]=t,o[1]=a,o[2]=l,o[3]=p,o[4]=p,o[5]=u,o[6]=h,o[7]=i}function an(t,e,r,i){var n=1-i;return n*(n*t+2*i*e)+i*i*r}function sn(t,e,r,i){return 2*((1-i)*(e-t)+i*(r-e))}function hn(t,e,r){var i=t+r-2*e;return 0==i?.5:(t-e)/i}function ln(t,e,r,i,n){var o=(e-t)*i+t,a=(r-e)*i+e,s=(a-o)*i+o;n[0]=t,n[1]=o,n[2]=s,n[3]=s,n[4]=a,n[5]=r}var un=Math.min,pn=Math.max,cn=Math.sin,fn=Math.cos,dn=2*Math.PI,yn=tt(),gn=tt(),vn=tt();function _n(t,e,r,i,n,o){n[0]=un(t,r),n[1]=un(e,i),o[0]=pn(t,r),o[1]=pn(e,i)}var mn=[],xn=[];var wn={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},bn=[],kn=[],Sn=[],Tn=[],Cn=[],An=[],Pn=Math.min,Dn=Math.max,Mn=Math.cos,Ln=Math.sin,Rn=Math.sqrt,zn=Math.abs,In=Math.PI,On=2*In,Bn="undefined"!=typeof Float32Array,En=[];function Fn(t){return Math.round(t/In*1e8)/1e8%2*In}function Hn(t,e){var r=Fn(t[0]);r<0&&(r+=On);var i=r-t[0],n=t[1];n+=i,!e&&On<=n-r?n=r+On:e&&On<=r-n?n=r-On:!e&&n<r?n=r+(On-Fn(r-n)):e&&r<n&&(n=r-(On-Fn(n-r))),t[0]=r,t[1]=n}var Nn,Wn=(Xn.prototype.increaseVersion=function(){this._version++},Xn.prototype.getVersion=function(){return this._version},Xn.prototype.setScale=function(t,e,r){0<(r=r||0)&&(this._ux=zn(r/Pr/t)||0,this._uy=zn(r/Pr/e)||0)},Xn.prototype.setDPR=function(t){this.dpr=t},Xn.prototype.setContext=function(t){this._ctx=t},Xn.prototype.getContext=function(){return this._ctx},Xn.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},Xn.prototype.reset=function(){this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},Xn.prototype.moveTo=function(t,e){return this.addData(wn.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},Xn.prototype.lineTo=function(t,e){var r=zn(t-this._xi)>this._ux||zn(e-this._yi)>this._uy||this._len<5;return this.addData(wn.L,t,e),this._ctx&&r&&(this._needsDash?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),r&&(this._xi=t,this._yi=e),this},Xn.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this.addData(wn.C,t,e,r,i,n,o),this._ctx&&(this._needsDash?this._dashedBezierTo(t,e,r,i,n,o):this._ctx.bezierCurveTo(t,e,r,i,n,o)),this._xi=n,this._yi=o,this},Xn.prototype.quadraticCurveTo=function(t,e,r,i){return this.addData(wn.Q,t,e,r,i),this._ctx&&(this._needsDash?this._dashedQuadraticTo(t,e,r,i):this._ctx.quadraticCurveTo(t,e,r,i)),this._xi=r,this._yi=i,this},Xn.prototype.arc=function(t,e,r,i,n,o){En[0]=i,En[1]=n,Hn(En,o),i=En[0];var a=(n=En[1])-i;return this.addData(wn.A,t,e,r,r,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,r,i,n,o),this._xi=Mn(n)*r+t,this._yi=Ln(n)*r+e,this},Xn.prototype.arcTo=function(t,e,r,i,n){return this._ctx&&this._ctx.arcTo(t,e,r,i,n),this},Xn.prototype.rect=function(t,e,r,i){return this._ctx&&this._ctx.rect(t,e,r,i),this.addData(wn.R,t,e,r,i),this},Xn.prototype.closePath=function(){this.addData(wn.Z);var t=this._ctx,e=this._x0,r=this._y0;return t&&(this._needsDash&&this._dashedLineTo(e,r),t.closePath()),this._xi=e,this._yi=r,this},Xn.prototype.fill=function(t){t&&t.fill(),this.toStatic()},Xn.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},Xn.prototype.setLineDash=function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,r=0;r<t.length;r++)e+=t[r];this._dashSum=e,this._needsDash=!0}else this._lineDash=null,this._needsDash=!1;return this},Xn.prototype.setLineDashOffset=function(t){return this._dashOffset=t,this},Xn.prototype.len=function(){return this._len},Xn.prototype.setData=function(t){var e=t.length;this.data&&this.data.length===e||!Bn||(this.data=new Float32Array(e));for(var r=0;r<e;r++)this.data[r]=t[r];this._len=e},Xn.prototype.appendPath=function(t){t instanceof Array||(t=[t]);for(var e=t.length,r=0,i=this._len,n=0;n<e;n++)r+=t[n].len();for(Bn&&this.data instanceof Float32Array&&(this.data=new Float32Array(i+r)),n=0;n<e;n++)for(var o=t[n].data,a=0;a<o.length;a++)this.data[i++]=o[a];this._len=i},Xn.prototype.addData=function(t,e,r,i,n,o,a,s,h){if(this._saveData){var l=this.data;this._len+arguments.length>l.length&&(this._expandData(),l=this.data);for(var u=0;u<arguments.length;u++)l[this._len++]=arguments[u]}},Xn.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e<this._len;e++)t[e]=this.data[e];this.data=t}},Xn.prototype._dashedLineTo=function(t,e){var r,i,n=this._dashSum,o=this._lineDash,a=this._ctx,s=this._dashOffset,h=this._xi,l=this._yi,u=t-h,p=e-l,c=Rn(u*u+p*p),f=h,d=l,y=o.length;for(s<0&&(s=n+s),f-=(s%=n)*(u/=c),d-=s*(p/=c);0<u&&f<=t||u<0&&t<=f||0===u&&(0<p&&d<=e||p<0&&e<=d);)f+=u*(r=o[i=this._dashIdx]),d+=p*r,this._dashIdx=(i+1)%y,0<u&&f<h||u<0&&h<f||0<p&&d<l||p<0&&l<d||a[i%2?"moveTo":"lineTo"]((0<=u?Pn:Dn)(f,t),(0<=p?Pn:Dn)(d,e));u=f-t,p=d-e,this._dashOffset=-Rn(u*u+p*p)},Xn.prototype._dashedBezierTo=function(t,e,r,i,n,o){var a,s,h,l,u,p=this._ctx,c=this._dashSum,f=this._dashOffset,d=this._lineDash,y=this._xi,g=this._yi,v=0,_=this._dashIdx,m=d.length,x=0;for(f<0&&(f=c+f),f%=c,a=0;a<1;a+=.1)s=en(y,t,r,n,a+.1)-en(y,t,r,n,a),h=en(g,e,i,o,a+.1)-en(g,e,i,o,a),v+=Rn(s*s+h*h);for(;_<m&&!(f<(x+=d[_]));_++);for(a=(x-f)/v;a<=1;)l=en(y,t,r,n,a),u=en(g,e,i,o,a),_%2?p.moveTo(l,u):p.lineTo(l,u),a+=d[_]/v,_=(_+1)%m;_%2!=0&&p.lineTo(n,o),s=n-l,h=o-u,this._dashOffset=-Rn(s*s+h*h)},Xn.prototype._dashedQuadraticTo=function(t,e,r,i){var n=r,o=i;r=(r+2*t)/3,i=(i+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,r,i,n,o)},Xn.prototype.toStatic=function(){var t;!this._saveData||(t=this.data)instanceof Array&&(t.length=this._len,Bn&&11<this._len&&(this.data=new Float32Array(t)))},Xn.prototype.getBoundingRect=function(){Sn[0]=Sn[1]=Cn[0]=Cn[1]=Number.MAX_VALUE,Tn[0]=Tn[1]=An[0]=An[1]=-Number.MAX_VALUE;for(var t,e,r,i,n,o,a,s,h,l,u,p,c,f,d=this.data,y=0,g=0,v=0,_=0,m=0;m<this._len;){var x=d[m++],w=1===m;switch(w&&(v=y=d[m],_=g=d[m+1]),x){case wn.M:y=v=d[m++],g=_=d[m++],Cn[0]=v,Cn[1]=_,An[0]=v,An[1]=_;break;case wn.L:_n(y,g,d[m],d[m+1],Cn,An),y=d[m++],g=d[m++];break;case wn.C:!function(t,e,r,i,n,o,a,s,h,l){var u=nn,p=en,c=u(t,r,n,a,mn);h[0]=1/0,h[1]=1/0,l[0]=-1/0,l[1]=-1/0;for(var f=0;f<c;f++){var d=p(t,r,n,a,mn[f]);h[0]=un(d,h[0]),l[0]=pn(d,l[0])}for(c=u(e,i,o,s,xn),f=0;f<c;f++){var y=p(e,i,o,s,xn[f]);h[1]=un(y,h[1]),l[1]=pn(y,l[1])}h[0]=un(t,h[0]),l[0]=pn(t,l[0]),h[0]=un(a,h[0]),l[0]=pn(a,l[0]),h[1]=un(e,h[1]),l[1]=pn(e,l[1]),h[1]=un(s,h[1]),l[1]=pn(s,l[1])}(y,g,d[m++],d[m++],d[m++],d[m++],d[m],d[m+1],Cn,An),y=d[m++],g=d[m++];break;case wn.Q:t=y,e=g,r=d[m++],i=d[m++],n=d[m],o=d[m+1],a=Cn,s=An,f=c=p=u=l=h=void 0,l=an,u=pn(un((h=hn)(t,r,n),1),0),p=pn(un(h(e,i,o),1),0),c=l(t,r,n,u),f=l(e,i,o,p),a[0]=un(t,n,c),a[1]=un(e,o,f),s[0]=pn(t,n,c),s[1]=pn(e,o,f),y=d[m++],g=d[m++];break;case wn.A:var b=d[m++],k=d[m++],S=d[m++],T=d[m++],C=d[m++],A=d[m++]+C;m+=1;var P=!d[m++];w&&(v=Mn(C)*S+b,_=Ln(C)*T+k),function(t,e,r,i,n,o,a,s,h){var l,u=dt,p=yt,c=Math.abs(n-o);if(c%dn<1e-4&&1e-4<c)return s[0]=t-r,s[1]=e-i,h[0]=t+r,h[1]=e+i;yn[0]=fn(n)*r+t,yn[1]=cn(n)*i+e,gn[0]=fn(o)*r+t,gn[1]=cn(o)*i+e,u(s,yn,gn),p(h,yn,gn),(n%=dn)<0&&(n+=dn),(o%=dn)<0&&(o+=dn),o<n&&!a?o+=dn:n<o&&a&&(n+=dn),a&&(l=o,o=n,n=l);for(var f=0;f<o;f+=Math.PI/2)n<f&&(vn[0]=fn(f)*r+t,vn[1]=cn(f)*i+e,u(s,vn,s),p(h,vn,h))}(b,k,S,T,C,A,P,Cn,An),y=Mn(A)*S+b,g=Ln(A)*T+k;break;case wn.R:_n(v=y=d[m++],_=g=d[m++],v+d[m++],_+d[m++],Cn,An);break;case wn.Z:y=v,g=_}dt(Sn,Sn,Cn),yt(Tn,Tn,An)}return 0===m&&(Sn[0]=Sn[1]=Tn[0]=Tn[1]=0),new dr(Sn[0],Sn[1],Tn[0]-Sn[0],Tn[1]-Sn[1])},Xn.prototype._calculateLength=function(){var t=this.data,e=this._len,r=this._ux,i=this._uy,n=0,o=0,a=0,s=0;this._pathSegLen||(this._pathSegLen=[]);for(var h=this._pathSegLen,l=0,u=0,p=0;p<e;){var c=t[p++],f=1===p;f&&(a=n=t[p],s=o=t[p+1]);var d=-1;switch(c){case wn.M:n=a=t[p++],o=s=t[p++];break;case wn.L:var y=t[p++],g=(m=t[p++])-o;(zn(D=y-n)>r||zn(g)>i||p===e-1)&&(d=Math.sqrt(D*D+g*g),n=y,o=m);break;case wn.C:var v=t[p++],_=t[p++],y=t[p++],m=t[p++],x=t[p++],w=t[p++],d=function(t,e,r,i,n,o,a,s,h){for(var l=t,u=e,p=0,c=1/h,f=1;f<=h;f++){var d=f*c,y=en(t,r,n,a,d),g=en(e,i,o,s,d),v=y-l,_=g-u;p+=Math.sqrt(v*v+_*_),l=y,u=g}return p}(n,o,v,_,y,m,x,w,10),n=x,o=w;break;case wn.Q:d=function(t,e,r,i,n,o,a){for(var s=t,h=e,l=0,u=1/a,p=1;p<=a;p++){var c=p*u,f=an(t,r,n,c),d=an(e,i,o,c),y=f-s,g=d-h;l+=Math.sqrt(y*y+g*g),s=f,h=d}return l}(n,o,v=t[p++],_=t[p++],y=t[p++],m=t[p++],10),n=y,o=m;break;case wn.A:var b=t[p++],k=t[p++],S=t[p++],T=t[p++],C=t[p++],A=t[p++],P=A+C;p+=1,t[p++],f&&(a=Mn(C)*S+b,s=Ln(C)*T+k),d=Dn(S,T)*Pn(On,Math.abs(A)),n=Mn(P)*S+b,o=Ln(P)*T+k;break;case wn.R:a=n=t[p++],s=o=t[p++],d=2*t[p++]+2*t[p++];break;case wn.Z:var D=a-n,g=s-o;d=Math.sqrt(D*D+g*g),n=a,o=s}0<=d&&(l+=h[u++]=d)}return this._pathLen=l},Xn.prototype.rebuildPath=function(t,e){var r,i,n,o,a,s,h,l,u=this.data,p=this._ux,c=this._uy,f=this._len,d=e<1,y=0,g=0;if(!d||(this._pathSegLen||this._calculateLength(),h=this._pathSegLen,l=e*this._pathLen))t:for(var v=0;v<f;){var _=u[v++],m=1===v;switch(m&&(r=n=u[v],i=o=u[v+1]),_){case wn.M:r=n=u[v++],i=o=u[v++],t.moveTo(n,o);break;case wn.L:if(a=u[v++],s=u[v++],zn(a-n)>p||zn(s-o)>c||v===f-1){if(d){if(l<y+(H=h[g++])){var x=(l-y)/H;t.lineTo(n*(1-x)+a*x,o*(1-x)+s*x);break t}y+=H}t.lineTo(a,s),n=a,o=s}break;case wn.C:var w=u[v++],b=u[v++],k=u[v++],S=u[v++],T=u[v++],C=u[v++];if(d){if(l<y+(H=h[g++])){on(n,w,k,T,x=(l-y)/H,bn),on(o,b,S,C,x,kn),t.bezierCurveTo(bn[1],kn[1],bn[2],kn[2],bn[3],kn[3]);break t}y+=H}t.bezierCurveTo(w,b,k,S,T,C),n=T,o=C;break;case wn.Q:if(w=u[v++],b=u[v++],k=u[v++],S=u[v++],d){if(l<y+(H=h[g++])){ln(n,w,k,x=(l-y)/H,bn),ln(o,b,S,x,kn),t.quadraticCurveTo(bn[1],kn[1],bn[2],kn[2]);break t}y+=H}t.quadraticCurveTo(w,b,k,S),n=k,o=S;break;case wn.A:var A=u[v++],P=u[v++],D=u[v++],M=u[v++],L=u[v++],R=u[v++],z=u[v++],I=!u[v++],O=M<D?D:M,B=.001<zn(D-M),E=L+R,F=!1;if(d&&(l<y+(H=h[g++])&&(E=L+R*(l-y)/H,F=!0),y+=H),B&&t.ellipse?t.ellipse(A,P,D,M,z,L,E,I):t.arc(A,P,O,L,E,I),F)break t;m&&(r=Mn(L)*D+A,i=Ln(L)*M+P),n=Mn(E)*D+A,o=Ln(E)*M+P;break;case wn.R:r=n=u[v],i=o=u[v+1],a=u[v++],s=u[v++];var H,N=u[v++],W=u[v++];if(d){if(l<y+(H=h[g++])){var X=l-y;t.moveTo(a,s),t.lineTo(a+Pn(X,N),s),0<(X-=N)&&t.lineTo(a+N,s+Pn(X,W)),0<(X-=W)&&t.lineTo(a+Dn(N-X,0),s+W),0<(X-=N)&&t.lineTo(a,s+Dn(W-X,0));break t}y+=H}t.rect(a,s,N,W);break;case wn.Z:if(d){if(l<y+(H=h[g++])){x=(l-y)/H,t.lineTo(n*(1-x)+r*x,o*(1-x)+i*x);break t}y+=H}t.closePath(),n=r,o=i}}},Xn.CMD=wn,Xn.initDefaultProps=((Nn=Xn.prototype)._saveData=!0,Nn._needsDash=!1,Nn._dashOffset=0,Nn._dashIdx=0,Nn._dashSum=0,Nn._ux=0,void(Nn._uy=0)),Xn);function Xn(t){this.dpr=1,this._version=0,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,t&&(this._saveData=!1),this._saveData&&(this.data=[])}function jn(t,e,r,i,n,o,a){if(0!==n){var s=n,h=0;if(!(e+s<a&&i+s<a||a<e-s&&a<i-s||t+s<o&&r+s<o||o<t-s&&o<r-s)){if(t===r)return Math.abs(o-t)<=s/2;var l=(h=(e-i)/(t-r))*o-a+(t*i-r*e)/(t-r);return l*l/(h*h+1)<=s/2*s/2}}}function Yn(t,e,r,i,n,o,a,s,h,l,u){if(0!==h){var p=h;if(!(e+p<u&&i+p<u&&o+p<u&&s+p<u||u<e-p&&u<i-p&&u<o-p&&u<s-p||t+p<l&&r+p<l&&n+p<l&&a+p<l||l<t-p&&l<r-p&&l<n-p&&l<a-p))return function(t,e,r,i,n,o,a,s,h,l,u){var p,c,f,d,y,g=.005,v=1/0;Ki[0]=h,Ki[1]=l;for(var _=0;_<1;_+=.05)Qi[0]=en(t,r,n,a,_),Qi[1]=en(e,i,o,s,_),(d=pt(Ki,Qi))<v&&(p=_,v=d);v=1/0;for(var m=0;m<32&&!(g<Ui);m++)c=p-g,f=p+g,Qi[0]=en(t,r,n,a,c),Qi[1]=en(e,i,o,s,c),d=pt(Qi,Ki),0<=c&&d<v?(p=c,v=d):($i[0]=en(t,r,n,a,f),$i[1]=en(e,i,o,s,f),y=pt($i,Ki),f<=1&&y<v?(p=f,v=y):g*=.5);return u&&(u[0]=en(t,r,n,a,p),u[1]=en(e,i,o,s,p)),Gi(v)}(t,e,r,i,n,o,a,s,l,u,null)<=p/2}}function Gn(t,e,r,i,n,o,a,s,h){if(0!==a){var l=a;if(!(e+l<h&&i+l<h&&o+l<h||h<e-l&&h<i-l&&h<o-l||t+l<s&&r+l<s&&n+l<s||s<t-l&&s<r-l&&s<n-l))return function(t,e,r,i,n,o,a,s,h){var l,u=.005,p=1/0;Ki[0]=a,Ki[1]=s;for(var c=0;c<1;c+=.05){Qi[0]=an(t,r,n,c),Qi[1]=an(e,i,o,c),(v=pt(Ki,Qi))<p&&(l=c,p=v)}p=1/0;for(var f=0;f<32&&!(u<Ui);f++){var d=l-u,y=l+u;Qi[0]=an(t,r,n,d),Qi[1]=an(e,i,o,d);var g,v=pt(Qi,Ki);0<=d&&v<p?(l=d,p=v):($i[0]=an(t,r,n,y),$i[1]=an(e,i,o,y),g=pt($i,Ki),y<=1&&g<p?(l=y,p=g):u*=.5)}return h&&(h[0]=an(t,r,n,l),h[1]=an(e,i,o,l)),Gi(p)}(t,e,r,i,n,o,s,h,null)<=l/2}}var qn=2*Math.PI;function Un(t){return(t%=qn)<0&&(t+=qn),t}var Vn=2*Math.PI;function Zn(t,e,r,i,n,o){if(e<o&&i<o||o<e&&o<i)return 0;if(i===e)return 0;var a=(o-e)/(i-e),s=i<e?1:-1;1!=a&&0!=a||(s=i<e?.5:-.5);var h=a*(r-t)+t;return h===n?1/0:n<h?s:0}var Kn=Wn.CMD,Qn=2*Math.PI,$n=1e-4;var Jn=[-1,-1,-1],to=[-1,-1];function eo(t,e,r,i,n,o,a,s,h,l){if(e<l&&i<l&&o<l&&s<l||l<e&&l<i&&l<o&&l<s)return 0;var u,p,c,f,d,y,g,v,_,m,x,w,b,k,S,T,C,A,P,D,M,L,R,z,I=(f=Jn,L=(A=3*((c=o)-2*(p=i)+(u=e)))*(P=3*(p-u))-9*(C=s+3*(p-c)-u)*(D=u-l),R=P*P-3*A*D,z=0,Ji(M=A*A-3*C*P)&&Ji(L)?Ji(A)?f[0]=0:0<=(k=-P/A)&&k<=1&&(f[z++]=k):Ji(d=L*L-4*M*R)?(S=-(y=L/M)/2,0<=(k=-A/C+y)&&k<=1&&(f[z++]=k),0<=S&&S<=1&&(f[z++]=S)):0<d?(_=M*A+1.5*C*(-L-(g=Gi(d))),0<=(k=(-A-((v=(v=M*A+1.5*C*(-L+g))<0?-Yi(-v,Zi):Yi(v,Zi))+(_=_<0?-Yi(-_,Zi):Yi(_,Zi))))/(3*C))&&k<=1&&(f[z++]=k)):(m=(2*M*A-3*C*L)/(2*Gi(M*M*M)),x=Math.acos(m)/3,k=(-A-2*(w=Gi(M))*(b=Math.cos(x)))/(3*C),S=(-A+w*(b+Vi*Math.sin(x)))/(3*C),T=(-A+w*(b-Vi*Math.sin(x)))/(3*C),0<=k&&k<=1&&(f[z++]=k),0<=S&&S<=1&&(f[z++]=S),0<=T&&T<=1&&(f[z++]=T)),z);if(0===I)return 0;for(var O,B=0,E=-1,F=void 0,H=void 0,N=0;N<I;N++){var W=Jn[N],X=0===W||1===W?.5:1;en(t,r,n,a,W)<h||(E<0&&(E=nn(e,i,o,s,to),to[1]<to[0]&&1<E&&(O=void 0,O=to[0],to[0]=to[1],to[1]=O),F=en(e,i,o,s,to[0]),1<E&&(H=en(e,i,o,s,to[1]))),2===E?W<to[0]?B+=F<e?X:-X:W<to[1]?B+=H<F?X:-X:B+=s<H?X:-X:W<to[0]?B+=F<e?X:-X:B+=s<F?X:-X)}return B}function ro(t,e,r,i,n,o,a,s){if(e<s&&i<s&&o<s||s<e&&s<i&&s<o)return 0;var h,l,u,p,c,f,d,y,g,v,_,m=(u=Jn,g=2*((l=i)-(h=e)),v=h-s,_=0,Ji(y=h-2*l+o)?tn(g)&&0<=(f=-v/g)&&f<=1&&(u[_++]=f):Ji(p=g*g-4*y*v)?0<=(f=-g/(2*y))&&f<=1&&(u[_++]=f):0<p&&(d=(-g-(c=Gi(p)))/(2*y),0<=(f=(-g+c)/(2*y))&&f<=1&&(u[_++]=f),0<=d&&d<=1&&(u[_++]=d)),_);if(0===m)return 0;var x=hn(e,i,o);if(0<=x&&x<=1){for(var w=0,b=an(e,i,o,x),k=0;k<m;k++){var S=0===Jn[k]||1===Jn[k]?.5:1;an(t,r,n,Jn[k])<a||(Jn[k]<x?w+=b<e?S:-S:w+=o<b?S:-S)}return w}S=0===Jn[0]||1===Jn[0]?.5:1;return an(t,r,n,Jn[0])<a?0:o<e?S:-S}function io(t,e,r,i,n){for(var o,a,s=t.data,h=t.len(),l=0,u=0,p=0,c=0,f=0,d=0;d<h;){var y=s[d++],g=1===d;switch(y===Kn.M&&1<d&&(r||(l+=Zn(u,p,c,f,i,n))),g&&(c=u=s[d],f=p=s[d+1]),y){case Kn.M:u=c=s[d++],p=f=s[d++];break;case Kn.L:if(r){if(jn(u,p,s[d],s[d+1],e,i,n))return!0}else l+=Zn(u,p,s[d],s[d+1],i,n)||0;u=s[d++],p=s[d++];break;case Kn.C:if(r){if(Yn(u,p,s[d++],s[d++],s[d++],s[d++],s[d],s[d+1],e,i,n))return!0}else l+=eo(u,p,s[d++],s[d++],s[d++],s[d++],s[d],s[d+1],i,n)||0;u=s[d++],p=s[d++];break;case Kn.Q:if(r){if(Gn(u,p,s[d++],s[d++],s[d],s[d+1],e,i,n))return!0}else l+=ro(u,p,s[d++],s[d++],s[d],s[d+1],i,n)||0;u=s[d++],p=s[d++];break;case Kn.A:var v=s[d++],_=s[d++],m=s[d++],x=s[d++],w=s[d++],b=s[d++];d+=1;var k=!!(1-s[d++]),S=Math.cos(w)*m+v,T=Math.sin(w)*x+_;g?(c=S,f=T):l+=Zn(u,p,S,T,i,n);var C=(i-v)*x/m+v;if(r){if(function(t,e,r,i,n,o,a,s,h){if(0!==a){var l=a;s-=t,h-=e;var u,p=Math.sqrt(s*s+h*h);if(!(r<p-l||p+l<r)){if(Math.abs(i-n)%Vn<1e-4)return 1;(n=o?(u=i,i=Un(n),Un(u)):(i=Un(i),Un(n)))<i&&(n+=Vn);var c=Math.atan2(h,s);return c<0&&(c+=Vn),i<=c&&c<=n||i<=c+Vn&&c+Vn<=n}}}(v,_,x,w,w+b,k,e,C,n))return!0}else l+=function(t,e,r,i,n,o,a,s){if(r<(s-=e)||s<-r)return 0;var h=Math.sqrt(r*r-s*s);Jn[0]=-h,Jn[1]=h;var l,u=Math.abs(i-n);if(u<1e-4)return 0;if(Qn-1e-4<=u){n=Qn;var p=o?1:-1;return a>=Jn[i=0]+t&&a<=Jn[1]+t?p:0}n<i&&(l=i,i=n,n=l),i<0&&(i+=Qn,n+=Qn);for(var c=0,f=0;f<2;f++){var d,y=Jn[f];a<y+t&&(p=o?1:-1,(d=Math.atan2(s,y))<0&&(d=Qn+d),(i<=d&&d<=n||i<=d+Qn&&d+Qn<=n)&&(d>Math.PI/2&&d<1.5*Math.PI&&(p=-p),c+=p))}return c}(v,_,x,w,w+b,k,C,n);u=Math.cos(w+b)*m+v,p=Math.sin(w+b)*x+_;break;case Kn.R:c=u=s[d++],f=p=s[d++];if(S=c+s[d++],T=f+s[d++],r){if(jn(c,f,S,f,e,i,n)||jn(S,f,S,T,e,i,n)||jn(S,T,c,T,e,i,n)||jn(c,T,c,f,e,i,n))return!0}else l+=Zn(S,f,S,T,i,n),l+=Zn(c,T,c,f,i,n);break;case Kn.Z:if(r){if(jn(u,p,c,f,e,i,n))return!0}else l+=Zn(u,p,c,f,i,n);u=c,p=f}}return r||(o=p,a=f,Math.abs(o-a)<$n)||(l+=Zn(u,p,c,f,i,n)||0),0!==l}var no,oo,ao=x({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Oi),so={style:x({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Bi.style)},ho=["x","y","rotation","scaleX","scaleY","originX","originY","invisible","culling","z","z2","zlevel","parent"],lo=(J(uo,no=Ni),uo.prototype.update=function(){var e=this;no.prototype.update.call(this);var t=this.style;if(t.decal){var r=this._decalEl=this._decalEl||new uo;r.buildPath===uo.prototype.buildPath&&(r.buildPath=function(t){e.buildPath(t,e.shape)}),r.silent=!0;var i=r.style;for(var n in t)i[n]!==t[n]&&(i[n]=t[n]);i.fill=t.fill?t.decal:null,i.decal=null,i.shadowColor=null,t.strokeFirst&&(i.stroke=null);for(var o=0;o<ho.length;++o)r[ho[o]]=this[ho[o]];r.__dirty|=Br.REDARAW_BIT}else this._decalEl&&(this._decalEl=null)},uo.prototype.getDecalElement=function(){return this._decalEl},uo.prototype._init=function(t){var e=L(t);this.shape=this.getDefaultShape();var r=this.getDefaultStyle();r&&this.useStyle(r);for(var i=0;i<e.length;i++){var n=e[i],o=t[n];"style"===n?this.style?m(this.style,o):this.useStyle(o):"shape"===n?m(this.shape,o):no.prototype.attrKV.call(this,n,o)}this.style||this.useStyle({})},uo.prototype.getDefaultStyle=function(){return null},uo.prototype.getDefaultShape=function(){return{}},uo.prototype.canBeInsideText=function(){return this.hasFill()},uo.prototype.getInsideTextFill=function(){var t=this.style.fill;if("none"!==t){if(P(t)){var e=We(t,0);return.5<e?Dr:.2<e?"#eee":Mr}if(t)return Mr}return Dr},uo.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(P(e)){var r=this.__zr;if(!(!r||!r.isDarkMode())==We(t,0)<.4)return e}},uo.prototype.buildPath=function(t,e,r){},uo.prototype.pathUpdated=function(){this.__dirty&=~uo.SHAPE_CHANGED_BIT},uo.prototype.createPathProxy=function(){this.path=new Wn(!1)},uo.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(0<t.lineWidth))},uo.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},uo.prototype.getBoundingRect=function(){var t,e,r=this._rect,i=this.style,n=!r;if(n&&(t=!1,this.path||(t=!0,this.createPathProxy()),e=this.path,(t||this.__dirty&uo.SHAPE_CHANGED_BIT)&&(e.beginPath(),this.buildPath(e,this.shape,!1),this.pathUpdated()),r=e.getBoundingRect()),this._rect=r,this.hasStroke()&&this.path&&0<this.path.len()){var o,a,s,h=this._rectWithStroke||(this._rectWithStroke=r.clone());return(this.__dirty||n)&&(h.copy(r),o=i.strokeNoScale?this.getLineScale():1,s=i.lineWidth,this.hasFill()||(a=this.strokeContainThreshold,s=Math.max(s,null==a?4:a)),1e-10<o&&(h.width+=s/o,h.height+=s/o,h.x-=s/o/2,h.y-=s/o/2)),h}return r},uo.prototype.contain=function(t,e){var r=this.transformCoordToLocal(t,e),i=this.getBoundingRect(),n=this.style;if(t=r[0],e=r[1],i.contain(t,e)){var o=this.path;if(this.hasStroke()){var a=n.lineWidth,s=n.strokeNoScale?this.getLineScale():1;if(1e-10<s&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),io(o,a/s,!0,t,e)))return!0}if(this.hasFill())return io(o,0,!1,t,e)}return!1},uo.prototype.dirtyShape=function(){this.__dirty|=uo.SHAPE_CHANGED_BIT,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},uo.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},uo.prototype.animateShape=function(t){return this.animate("shape",t)},uo.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},uo.prototype.attrKV=function(t,e){"shape"===t?this.setShape(e):no.prototype.attrKV.call(this,t,e)},uo.prototype.setShape=function(t,e){var r=(r=this.shape)||(this.shape={});return"string"==typeof t?r[t]=e:m(r,t),this.dirtyShape(),this},uo.prototype.shapeChanged=function(){return!!(this.__dirty&uo.SHAPE_CHANGED_BIT)},uo.prototype.createStyle=function(t){return Z(ao,t)},uo.prototype._innerSaveToNormal=function(t){no.prototype._innerSaveToNormal.call(this,t);var e=this._normalState;t.shape&&!e.shape&&(e.shape=m({},this.shape))},uo.prototype._applyStateObj=function(t,e,r,i,n,o){no.prototype._applyStateObj.call(this,t,e,r,i,n,o);var a,s=!(e&&i);if(e&&e.shape?n?i?a=e.shape:(a=m({},r.shape),m(a,e.shape)):(a=m({},i?this.shape:r.shape),m(a,e.shape)):s&&(a=r.shape),a)if(n){this.shape=m({},this.shape);for(var h={},l=L(a),u=0;u<l.length;u++){var p=l[u];"object"==typeof a[p]?this.shape[p]=a[p]:h[p]=a[p]}this._transitionState(t,{shape:h},o)}else this.shape=a,this.dirtyShape()},uo.prototype._mergeStates=function(t){for(var e,r=no.prototype._mergeStates.call(this,t),i=0;i<t.length;i++){var n=t[i];n.shape&&(e=e||{},this._mergeStyle(e,n.shape))}return e&&(r.shape=e),r},uo.prototype.getAnimationStyleProps=function(){return so},uo.prototype.isZeroArea=function(){return!1},uo.extend=function(r){var i,t=(J(e,i=uo),e.prototype.getDefaultStyle=function(){return v(r.style)},e.prototype.getDefaultShape=function(){return v(r.shape)},e);function e(t){var e=i.call(this,t)||this;return r.init&&r.init.call(e,t),e}for(var n in r)"function"==typeof r[n]&&(t.prototype[n]=r[n]);return t},uo.SHAPE_CHANGED_BIT=4,uo.initDefaultProps=((oo=uo.prototype).type="path",oo.strokeContainThreshold=5,oo.segmentIgnoreThreshold=0,oo.subPixelOptimize=!1,oo.autoBatch=!1,void(oo.__dirty=Br.REDARAW_BIT|Ni.STYLE_CHANGED_BIT|uo.SHAPE_CHANGED_BIT)),uo);function uo(t){return no.call(this,t)||this}var po=Wn.CMD,co=[[],[],[]],fo=Math.sqrt,yo=Math.atan2;var go=Math.sqrt,vo=Math.sin,_o=Math.cos,mo=Math.PI;function xo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function wo(t,e){return(t[0]*e[0]+t[1]*e[1])/(xo(t)*xo(e))}function bo(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(wo(t,e))}function ko(t,e,r,i,n,o,a,s,h,l,u){var p=h*(mo/180),c=_o(p)*(t-r)/2+vo(p)*(e-i)/2,f=-1*vo(p)*(t-r)/2+_o(p)*(e-i)/2,d=c*c/(a*a)+f*f/(s*s);1<d&&(a*=go(d),s*=go(d));var y,g=(n===o?-1:1)*go((a*a*(s*s)-a*a*(f*f)-s*s*(c*c))/(a*a*(f*f)+s*s*(c*c)))||0,v=g*a*f/s,_=g*-s*c/a,m=(t+r)/2+_o(p)*v-vo(p)*_,x=(e+i)/2+vo(p)*v+_o(p)*_,w=bo([1,0],[(c-v)/a,(f-_)/s]),b=[(c-v)/a,(f-_)/s],k=[(-1*c-v)/a,(-1*f-_)/s],S=bo(b,k);wo(b,k)<=-1&&(S=mo),1<=wo(b,k)&&(S=0),S<0&&(y=Math.round(S/mo*1e6)/1e6,S=2*mo+y%2*mo),u.addData(l,m,x,a,s,w,S,p,o)}var So=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,To=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var Co,Ao=(J(Po,Co=lo),Po.prototype.applyTransform=function(t){},Po);function Po(){return null!==Co&&Co.apply(this,arguments)||this}function Do(t){return null!=t.setData}function Mo(t,e){var r=function(t){var e=new Wn;if(!t)return e;var r,i=0,n=0,o=i,a=n,s=Wn.CMD,h=t.match(So);if(!h)return e;for(var l=0;l<h.length;l++){for(var u=h[l],p=u.charAt(0),c=void 0,f=u.match(To)||[],d=f.length,y=0;y<d;y++)f[y]=parseFloat(f[y]);for(var g=0;g<d;){var v=void 0,_=void 0,m=void 0,x=void 0,w=void 0,b=void 0,k=void 0,S=i,T=n,C=void 0,A=void 0;switch(p){case"l":i+=f[g++],n+=f[g++],c=s.L,e.addData(c,i,n);break;case"L":i=f[g++],n=f[g++],c=s.L,e.addData(c,i,n);break;case"m":i+=f[g++],n+=f[g++],c=s.M,e.addData(c,i,n),o=i,a=n,p="l";break;case"M":i=f[g++],n=f[g++],c=s.M,e.addData(c,i,n),o=i,a=n,p="L";break;case"h":i+=f[g++],c=s.L,e.addData(c,i,n);break;case"H":i=f[g++],c=s.L,e.addData(c,i,n);break;case"v":n+=f[g++],c=s.L,e.addData(c,i,n);break;case"V":n=f[g++],c=s.L,e.addData(c,i,n);break;case"C":c=s.C,e.addData(c,f[g++],f[g++],f[g++],f[g++],f[g++],f[g++]),i=f[g-2],n=f[g-1];break;case"c":c=s.C,e.addData(c,f[g++]+i,f[g++]+n,f[g++]+i,f[g++]+n,f[g++]+i,f[g++]+n),i+=f[g-2],n+=f[g-1];break;case"S":v=i,_=n,C=e.len(),A=e.data,r===s.C&&(v+=i-A[C-4],_+=n-A[C-3]),c=s.C,S=f[g++],T=f[g++],i=f[g++],n=f[g++],e.addData(c,v,_,S,T,i,n);break;case"s":v=i,_=n,C=e.len(),A=e.data,r===s.C&&(v+=i-A[C-4],_+=n-A[C-3]),c=s.C,S=i+f[g++],T=n+f[g++],i+=f[g++],n+=f[g++],e.addData(c,v,_,S,T,i,n);break;case"Q":S=f[g++],T=f[g++],i=f[g++],n=f[g++],c=s.Q,e.addData(c,S,T,i,n);break;case"q":S=f[g++]+i,T=f[g++]+n,i+=f[g++],n+=f[g++],c=s.Q,e.addData(c,S,T,i,n);break;case"T":v=i,_=n,C=e.len(),A=e.data,r===s.Q&&(v+=i-A[C-4],_+=n-A[C-3]),i=f[g++],n=f[g++],c=s.Q,e.addData(c,v,_,i,n);break;case"t":v=i,_=n,C=e.len(),A=e.data,r===s.Q&&(v+=i-A[C-4],_+=n-A[C-3]),i+=f[g++],n+=f[g++],c=s.Q,e.addData(c,v,_,i,n);break;case"A":m=f[g++],x=f[g++],w=f[g++],b=f[g++],k=f[g++],ko(S=i,T=n,i=f[g++],n=f[g++],b,k,m,x,w,c=s.A,e);break;case"a":m=f[g++],x=f[g++],w=f[g++],b=f[g++],k=f[g++],ko(S=i,T=n,i+=f[g++],n+=f[g++],b,k,m,x,w,c=s.A,e)}}"z"!==p&&"Z"!==p||(c=s.Z,e.addData(c),i=o,n=a),r=c}return e.toStatic(),e}(t),i=m({},e);return i.buildPath=function(t){var e;Do(t)?(t.setData(r.data),(e=t.getContext())&&t.rebuildPath(e,1)):(e=t,r.rebuildPath(e,1))},i.applyTransform=function(t){!function(t,e){for(var r,i,n,o,a=t.data,s=t.len(),h=po.M,l=po.C,u=po.L,p=po.R,c=po.A,f=po.Q,d=0,y=0;d<s;){switch(r=a[d++],y=d,i=0,r){case h:case u:i=1;break;case l:i=3;break;case f:i=2;break;case c:var g=e[4],v=e[5],_=fo(e[0]*e[0]+e[1]*e[1]),m=fo(e[2]*e[2]+e[3]*e[3]),x=yo(-e[1]/m,e[0]/_);a[d]*=_,a[d++]+=g,a[d]*=m,a[d++]+=v,a[d++]*=_,a[d++]*=m,a[d++]+=x,a[d++]+=x,y=d+=2;break;case p:o[0]=a[d++],o[1]=a[d++],ft(o,o,e),a[y++]=o[0],a[y++]=o[1],o[0]+=a[d++],o[1]+=a[d++],ft(o,o,e),a[y++]=o[0],a[y++]=o[1]}for(n=0;n<i;n++){var w=co[n];w[0]=a[d++],w[1]=a[d++],ft(w,w,e),a[y++]=w[0],a[y++]=w[1]}}t.increaseVersion()}(r,t),this.dirtyShape()},i}function Lo(t,e){return new Ao(Mo(t,e))}var Ro=Object.freeze({__proto__:null,createFromString:Lo,extendFromString:function(t,e){var r,i=Mo(t,e);function n(t){var e=r.call(this,t)||this;return e.applyTransform=i.applyTransform,e.buildPath=i.buildPath,e}return J(n,r=Ao),n},mergePath:function(t,e){for(var r=[],i=t.length,n=0;n<i;n++){var o=t[n];o.path||o.createPathProxy(),o.shapeChanged()&&o.buildPath(o.path,o.shape,!0),r.push(o.path)}var a=new lo(e);return a.createPathProxy(),a.buildPath=function(t){var e;Do(t)&&(t.appendPath(r),(e=t.getContext())&&t.rebuildPath(e,1))},a}}),zo=x({x:0,y:0},Oi),Io={style:x({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Bi.style)};var Oo,Bo=(J(Eo,Oo=Ni),Eo.prototype.createStyle=function(t){return Z(zo,t)},Eo.prototype._getSize=function(t){var e=this.style,r=e[t];if(null!=r)return r;var i,n=(i=e.image)&&"string"!=typeof i&&i.width&&i.height?e.image:this.__image;if(!n)return 0;var o="width"===t?"height":"width",a=e[o];return null==a?n[t]:n[t]/n[o]*a},Eo.prototype.getWidth=function(){return this._getSize("width")},Eo.prototype.getHeight=function(){return this._getSize("height")},Eo.prototype.getAnimationStyleProps=function(){return Io},Eo.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new dr(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},Eo);function Eo(){return null!==Oo&&Oo.apply(this,arguments)||this}Bo.prototype.type="image";var Fo,Ho=function(){this.cx=0,this.cy=0,this.r=0},No=(J(Wo,Fo=lo),Wo.prototype.getDefaultShape=function(){return new Ho},Wo.prototype.buildPath=function(t,e,r){r&&t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI)},Wo);function Wo(t){return Fo.call(this,t)||this}No.prototype.type="circle";var Xo=Math.round;function jo(t,e,r){if(!e)return t;var i=Xo(2*t);return(i+Xo(e))%2==0?i/2:(i+(r?1:-1))/2}var Yo,Go=function(){this.x=0,this.y=0,this.width=0,this.height=0},qo={},Uo=(J(Vo,Yo=lo),Vo.prototype.getDefaultShape=function(){return new Go},Vo.prototype.buildPath=function(t,e){var r,i,n,o,a,s,h,l,u,p,c,f,d,y,g,v,_;this.subPixelOptimize?(i=(r=function(t,e,r){if(e){var i=e.x,n=e.y,o=e.width,a=e.height;t.x=i,t.y=n,t.width=o,t.height=a;var s=r&&r.lineWidth;return s&&(t.x=jo(i,s,!0),t.y=jo(n,s,!0),t.width=Math.max(jo(i+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(jo(n+a,s,!1)-t.y,0===a?0:1)),t}}(qo,e,this.style)).x,n=r.y,o=r.width,a=r.height,r.r=e.r,e=r):(i=e.x,n=e.y,o=e.width,a=e.height),e.r?(s=t,d=(h=e).x,y=h.y,g=h.width,v=h.height,_=h.r,g<0&&(d+=g,g=-g),v<0&&(y+=v,v=-v),"number"==typeof _?l=u=p=c=_:_ instanceof Array?1===_.length?l=u=p=c=_[0]:2===_.length?(l=p=_[0],u=c=_[1]):3===_.length?(l=_[0],u=c=_[1],p=_[2]):(l=_[0],u=_[1],p=_[2],c=_[3]):l=u=p=c=0,g<l+u&&(l*=g/(f=l+u),u*=g/f),g<p+c&&(p*=g/(f=p+c),c*=g/f),v<u+p&&(u*=v/(f=u+p),p*=v/f),v<l+c&&(l*=v/(f=l+c),c*=v/f),s.moveTo(d+l,y),s.lineTo(d+g-u,y),0!==u&&s.arc(d+g-u,y+u,u,-Math.PI/2,0),s.lineTo(d+g,y+v-p),0!==p&&s.arc(d+g-p,y+v-p,p,0,Math.PI/2),s.lineTo(d+c,y+v),0!==c&&s.arc(d+c,y+v-c,c,Math.PI/2,Math.PI),s.lineTo(d,y+l),0!==l&&s.arc(d+l,y+l,l,Math.PI,1.5*Math.PI)):t.rect(i,n,o,a)},Vo.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},Vo);function Vo(t){return Yo.call(this,t)||this}Uo.prototype.type="rect";var Zo,Ko=function(){this.cx=0,this.cy=0,this.rx=0,this.ry=0},Qo=(J($o,Zo=lo),$o.prototype.getDefaultShape=function(){return new Ko},$o.prototype.buildPath=function(t,e){var r=e.cx,i=e.cy,n=e.rx,o=e.ry,a=.5522848*n,s=.5522848*o;t.moveTo(r-n,i),t.bezierCurveTo(r-n,i-s,r-a,i-o,r,i-o),t.bezierCurveTo(r+a,i-o,r+n,i-s,r+n,i),t.bezierCurveTo(r+n,i+s,r+a,i+o,r,i+o),t.bezierCurveTo(r-a,i+o,r-n,i+s,r-n,i),t.closePath()},$o);function $o(t){return Zo.call(this,t)||this}Qo.prototype.type="ellipse";var Jo,ta={},ea=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1},ra=(J(ia,Jo=lo),ia.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},ia.prototype.getDefaultShape=function(){return new ea},ia.prototype.buildPath=function(t,e){var r,i,n,o,a;a=this.subPixelOptimize?(i=(r=function(t,e,r){if(e){var i=e.x1,n=e.x2,o=e.y1,a=e.y2;t.x1=i,t.x2=n,t.y1=o,t.y2=a;var s=r&&r.lineWidth;return s&&(Xo(2*i)===Xo(2*n)&&(t.x1=t.x2=jo(i,s,!0)),Xo(2*o)===Xo(2*a)&&(t.y1=t.y2=jo(o,s,!0))),t}}(ta,e,this.style)).x1,n=r.y1,o=r.x2,r.y2):(i=e.x1,n=e.y1,o=e.x2,e.y2);var s=e.percent;0!==s&&(t.moveTo(i,n),s<1&&(o=i*(1-s)+o*s,a=n*(1-s)+a*s),t.lineTo(o,a))},ia.prototype.pointAt=function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]},ia);function ia(t){return Jo.call(this,t)||this}function na(t,e,r,i,n,o,a){var s=.5*(r-t),h=.5*(i-e);return(2*(e-r)+s+h)*a+(-3*(e-r)-2*s-h)*o+s*n+e}function oa(t,e,r){var i=e.smooth,n=e.points;if(n&&2<=n.length){if(i&&"spline"!==i){var o=function(t,e,r,i){var n,o,a,s,h=[],l=[],u=[],p=[];if(i){a=[1/0,1/0],s=[-1/0,-1/0];for(var c=0,f=t.length;c<f;c++)dt(a,a,t[c]),yt(s,s,t[c]);dt(a,a,i[0]),yt(s,s,i[1])}for(c=0,f=t.length;c<f;c++){var d=t[c];if(r)n=t[c?c-1:f-1],o=t[(c+1)%f];else{if(0===c||c===f-1){h.push(et(t[c]));continue}n=t[c-1],o=t[c+1]}it(l,o,n),at(l,l,e);var y=ht(d,n),g=ht(d,o),v=y+g;0!==v&&(y/=v,g/=v),at(u,l,-y),at(p,l,g);var _=rt([],d,u),m=rt([],d,p);i&&(yt(_,_,a),dt(_,_,s),yt(m,m,a),dt(m,m,s)),h.push(_),h.push(m)}return r&&h.push(h.shift()),h}(n,i,r,e.smoothConstraint);t.moveTo(n[0][0],n[0][1]);for(var a=n.length,s=0;s<(r?a:a-1);s++){var h=o[2*s],l=o[2*s+1],u=n[(s+1)%a];t.bezierCurveTo(h[0],h[1],l[0],l[1],u[0],u[1])}}else{"spline"===i&&(n=function(t,e){for(var r=t.length,i=[],n=0,o=1;o<r;o++)n+=ht(t[o-1],t[o]);for(var a=(a=n/2)<r?r:a,o=0;o<a;o++){var s=o/(a-1)*(e?r:r-1),h=Math.floor(s),l=s-h,u=void 0,p=t[h%r],c=void 0,f=void 0,f=e?(u=t[(h-1+r)%r],c=t[(h+1)%r],t[(h+2)%r]):(u=t[0===h?h:h-1],c=t[r-2<h?r-1:h+1],t[r-3<h?r-1:h+2]),d=l*l,y=l*d;i.push([na(u[0],p[0],c[0],f[0],l,d,y),na(u[1],p[1],c[1],f[1],l,d,y)])}return i}(n,r)),t.moveTo(n[0][0],n[0][1]);for(var s=1,p=n.length;s<p;s++)t.lineTo(n[s][0],n[s][1])}r&&t.closePath()}}ra.prototype.type="line";var aa,sa=function(){this.points=null,this.smooth=0,this.smoothConstraint=null},ha=(J(la,aa=lo),la.prototype.getDefaultShape=function(){return new sa},la.prototype.buildPath=function(t,e){oa(t,e,!0)},la);function la(t){return aa.call(this,t)||this}ha.prototype.type="polygon";var ua,pa=function(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null},ca=(J(fa,ua=lo),fa.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},fa.prototype.getDefaultShape=function(){return new pa},fa.prototype.buildPath=function(t,e){oa(t,e,!1)},fa);function fa(t){return ua.call(this,t)||this}ca.prototype.type="polyline";var da=(ya.prototype.addColorStop=function(t,e){this.colorStops.push({offset:t,color:e})},ya);function ya(t){this.colorStops=t||[]}var ga,va=(J(_a,ga=da),_a);function _a(t,e,r,i,n,o){var a=ga.call(this,n)||this;return a.x=null==t?0:t,a.y=null==e?0:e,a.x2=null==r?1:r,a.y2=null==i?0:i,a.type="linear",a.global=o||!1,a}var ma,xa=x({strokeFirst:!0,font:mr,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},ao),wa=(J(ba,ma=Ni),ba.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return null!=e&&"none"!==e&&0<t.lineWidth},ba.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},ba.prototype.createStyle=function(t){return Z(xa,t)},ba.prototype.setBoundingRect=function(t){this._rect=t},ba.prototype.getBoundingRect=function(){var t,e,r,i=this.style;return this._rect||(null!=(t=i.text)?t+="":t="",(e=function(t,e,r,i){var n=((t||"")+"").split("\n");if(1===n.length)return br(n[0],e,r,i);for(var o=new dr(0,0,0,0),a=0;a<n.length;a++){var s=br(n[a],e,r,i);0===a?o.copy(s):o.union(s)}return o}(t,i.font,i.textAlign,i.textBaseline)).x+=i.x||0,e.y+=i.y||0,this.hasStroke()&&(r=i.lineWidth,e.x-=r/2,e.y-=r/2,e.width+=r,e.height+=r),this._rect=e),this._rect},ba.initDefaultProps=void(ba.prototype.dirtyRectTolerance=10),ba);function ba(){return null!==ma&&ma.apply(this,arguments)||this}wa.prototype.type="tspan";var ka,Sa=/[\s,]+/,Ta=(Ca.prototype.parse=function(t,e){e=e||{};var r=function(t){P(t)&&(t=(new DOMParser).parseFromString(t,"text/xml"));var e=t;for(9===e.nodeType&&(e=e.firstChild);"svg"!==e.nodeName.toLowerCase()||1!==e.nodeType;)e=e.nextSibling;return e}(t);if(!r)throw new Error("Illegal svg");var i=new Ci;this._root=i;var n=r.getAttribute("viewBox")||"",o=parseFloat(r.getAttribute("width")||e.width),a=parseFloat(r.getAttribute("height")||e.height);isNaN(o)&&(o=null),isNaN(a)&&(a=null),La(r,i,null,!0);for(var s,h,l,u,p,c,f,d,y,g,v=r.firstChild;v;)this._parseNode(v,i),v=v.nextSibling;return!n||4<=(l=Y(n).split(Sa)).length&&(s={x:parseFloat(l[0]||0),y:parseFloat(l[1]||0),width:parseFloat(l[2]),height:parseFloat(l[3])}),s&&null!=o&&null!=a&&(f=a,d=(c=o)/(p=s).width,y=f/p.height,h={scale:g=Math.min(d,y),x:-(p.x+p.width/2)*g+c/2,y:-(p.y+p.height/2)*g+f/2},e.ignoreViewBox||(u=i,(i=new Ci).add(u),u.scaleX=u.scaleY=h.scale,u.x=h.x,u.y=h.y)),e.ignoreRootClip||null==o||null==a||i.setClipPath(new Uo({shape:{x:0,y:0,width:o,height:a}})),{root:i,width:o,height:a,viewBoxRect:s,viewBoxTransform:h}},Ca.prototype._parseNode=function(t,e){var r,i,n,o,a=t.nodeName.toLowerCase();if("defs"===a?this._isDefine=!0:"text"===a&&(this._isText=!0),this._isDefine?(o=Aa[a])&&(i=o.call(this,t),(n=t.getAttribute("id"))&&(this._defs[n]=i)):(o=ka[a])&&(r=o.call(this,t,e),e.add(r)),r)for(var s=t.firstChild;s;)1===s.nodeType&&this._parseNode(s,r),3===s.nodeType&&this._isText&&this._parseText(s,r),s=s.nextSibling;"defs"===a?this._isDefine=!1:"text"===a&&(this._isText=!1)},Ca.prototype._parseText=function(t,e){var r,i;1===t.nodeType&&(r=t.getAttribute("dx")||0,i=t.getAttribute("dy")||0,this._textX+=parseFloat(r),this._textY+=parseFloat(i));var n=new wa({style:{text:t.textContent},x:this._textX||0,y:this._textY||0});Pa(e,n),La(t,n,this._defs);var o=n.style,a=o.fontSize;a&&a<9&&(o.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var s=(o.fontSize||o.fontFamily)&&[o.fontStyle,o.fontWeight,(o.fontSize||12)+"px",o.fontFamily||"sans-serif"].join(" ");o.font=s;var h=n.getBoundingRect();return this._textX+=h.width,e.add(n),n},Ca.internalField=void(ka={g:function(t,e){var r=new Ci;return Pa(e,r),La(t,r,this._defs),r},rect:function(t,e){var r=new Uo;return Pa(e,r),La(t,r,this._defs),r.setShape({x:parseFloat(t.getAttribute("x")||"0"),y:parseFloat(t.getAttribute("y")||"0"),width:parseFloat(t.getAttribute("width")||"0"),height:parseFloat(t.getAttribute("height")||"0")}),r},circle:function(t,e){var r=new No;return Pa(e,r),La(t,r,this._defs),r.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),r},line:function(t,e){var r=new ra;return Pa(e,r),La(t,r,this._defs),r.setShape({x1:parseFloat(t.getAttribute("x1")||"0"),y1:parseFloat(t.getAttribute("y1")||"0"),x2:parseFloat(t.getAttribute("x2")||"0"),y2:parseFloat(t.getAttribute("y2")||"0")}),r},ellipse:function(t,e){var r=new Qo;return Pa(e,r),La(t,r,this._defs),r.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),rx:parseFloat(t.getAttribute("rx")||"0"),ry:parseFloat(t.getAttribute("ry")||"0")}),r},polygon:function(t,e){var r,i=t.getAttribute("points");i&&(r=Da(i));var n=new ha({shape:{points:r||[]}});return Pa(e,n),La(t,n,this._defs),n},polyline:function(t,e){var r=new lo;Pa(e,r),La(t,r,this._defs);var i,n=t.getAttribute("points");return n&&(i=Da(n)),new ca({shape:{points:i||[]}})},image:function(t,e){var r=new Bo;return Pa(e,r),La(t,r,this._defs),r.setStyle({image:t.getAttribute("xlink:href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),r},text:function(t,e){var r=t.getAttribute("x")||"0",i=t.getAttribute("y")||"0",n=t.getAttribute("dx")||"0",o=t.getAttribute("dy")||"0";this._textX=parseFloat(r)+parseFloat(n),this._textY=parseFloat(i)+parseFloat(o);var a=new Ci;return Pa(e,a),La(t,a,this._defs),a},tspan:function(t,e){var r=t.getAttribute("x"),i=t.getAttribute("y");null!=r&&(this._textX=parseFloat(r)),null!=i&&(this._textY=parseFloat(i));var n=t.getAttribute("dx")||0,o=t.getAttribute("dy")||0,a=new Ci;return Pa(e,a),La(t,a,this._defs),this._textX+=n,this._textY+=o,a},path:function(t,e){var r=Lo(t.getAttribute("d")||"");return Pa(e,r),La(t,r,this._defs),r}}),Ca);function Ca(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}var Aa={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||"0",10),r=parseInt(t.getAttribute("y1")||"0",10),i=parseInt(t.getAttribute("x2")||"10",10),n=parseInt(t.getAttribute("y2")||"0",10),o=new va(e,r,i,n);return function(t,e){var r=t.firstChild;for(;r;){var i,n,o;1===r.nodeType&&(i=r.getAttribute("offset"),n=void 0,n=0<i.indexOf("%")?parseInt(i,10)/100:i?parseFloat(i):0,o=r.getAttribute("stop-color")||"#000000",e.colorStops.push({offset:n,color:o})),r=r.nextSibling}}(t,o),o}};function Pa(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),x(e.__inheritedStyle,t.__inheritedStyle))}function Da(t){for(var e=Y(t).split(Sa),r=[],i=0;i<e.length;i+=2){var n=parseFloat(e[i]),o=parseFloat(e[i+1]);r.push([n,o])}return r}var Ma={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 La(t,e,r,i){var n,o=e,a=o.__inheritedStyle||{};if(1===t.nodeType&&(function(t,e){var r=t.getAttribute("transform");if(r){r=r.replace(/,/g," ");var i=[],n=null;r.replace(Ia,function(t,e,r){return i.push(e,r),""});for(var o=i.length-1;0<o;o-=2){var a=i[o],s=i[o-1],h=void 0;switch(n=n||Qt(),s){case"translate":h=Y(a).split(Sa),ee(n,n,[parseFloat(h[0]),parseFloat(h[1]||"0")]);break;case"scale":h=Y(a).split(Sa),ie(n,n,[parseFloat(h[0]),parseFloat(h[1]||h[0])]);break;case"rotate":h=Y(a).split(Sa),re(n,n,parseFloat(h[0]));break;case"skew":h=Y(a).split(Sa),console.warn("Skew transform is not supported yet");break;case"matrix":h=Y(a).split(Sa),n[0]=parseFloat(h[0]),n[1]=parseFloat(h[1]),n[2]=parseFloat(h[2]),n[3]=parseFloat(h[3]),n[4]=parseFloat(h[4]),n[5]=parseFloat(h[5])}}e.setLocalTransform(n)}}(t,e),m(a,function(t){var e=t.getAttribute("style"),r={};if(!e)return r;var i,n={};Oa.lastIndex=0;for(;null!=(i=Oa.exec(e));)n[i[1]]=i[2];for(var o in Ma)Ma.hasOwnProperty(o)&&null!=n[o]&&(r[Ma[o]]=n[o]);return r}(t)),!i))for(var s in Ma){!Ma.hasOwnProperty(s)||null!=(n=t.getAttribute(s))&&(a[Ma[s]]=n)}o.style=o.style||{},null!=a.fill&&(o.style.fill=za(a.fill,r)),null!=a.stroke&&(o.style.stroke=za(a.stroke,r)),k(["lineWidth","opacity","fillOpacity","strokeOpacity","miterLimit","fontSize"],function(t){null!=a[t]&&(o.style[t]=parseFloat(a[t]))}),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"),k(["lineDashOffset","lineCap","lineJoin","fontWeight","fontFamily","fontStyle","textAlign","textBaseline"],function(t){null!=a[t]&&(o.style[t]=a[t])}),a.lineDash&&(o.style.lineDash=W(Y(a.lineDash).split(Sa),function(t){return parseFloat(t)})),o.__inheritedStyle=a}var Ra=/url\(\s*#(.*?)\)/;function za(t,e){var r=e&&t&&t.match(Ra);return r?e[Y(r[1])]:t}var Ia=/(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g;var Oa=/([^\s:;]+)\s*:\s*([^:;]+)/g;var Ba=Math.PI,Ea=2*Ba,Fa=Math.sin,Ha=Math.cos,Na=Math.acos,Wa=Math.atan2,Xa=Math.abs,ja=Math.sqrt,Ya=Math.max,Ga=Math.min,qa=1e-4;function Ua(t,e,r,i,n,o,a){var s=t-r,h=e-i,l=(a?o:-o)/ja(s*s+h*h),u=l*h,p=-l*s,c=t+u,f=e+p,d=r+u,y=i+p,g=(c+d)/2,v=(f+y)/2,_=d-c,m=y-f,x=_*_+m*m,w=n-o,b=c*y-d*f,k=(m<0?-1:1)*ja(Ya(0,w*w*x-b*b)),S=(b*m-_*k)/x,T=(-b*_-m*k)/x,C=(b*m+_*k)/x,A=(-b*_+m*k)/x,P=S-g,D=T-v,M=C-g,L=A-v;return M*M+L*L<P*P+D*D&&(S=C,T=A),{cx:S,cy:T,x01:-u,y01:-p,x11:S*(n/w-1),y11:T*(n/w-1)}}function Va(t,e){var r,i,n,o,a,s,h,l,u,p,c,f,d,y,g,v,_,m,x,w,b,k,S,T,C,A,P,D,M,L,R,z,I=Ya(e.r,0),O=Ya(e.r0||0,0),B=0<I;(B||0<O)&&(B||(I=O,O=0),I<O&&(r=I,I=O,O=r),i=!!e.clockwise,s=(n=e.startAngle)===(o=e.endAngle)?0:(Hn(a=[n,o],!i),Xa(a[0]-a[1])),h=e.cx,l=e.cy,u=e.cornerRadius||0,p=e.innerCornerRadius||0,qa<I?Ea-qa<s?(t.moveTo(h+I*Ha(n),l+I*Fa(n)),t.arc(h,l,I,n,o,!i),qa<O&&(t.moveTo(h+O*Ha(o),l+O*Fa(o)),t.arc(h,l,O,o,n,i))):(c=Xa(I-O)/2,f=Ga(c,u),C=d=Ga(c,p),A=f,y=I*Ha(n),g=I*Fa(n),v=O*Ha(o),_=O*Fa(o),L=M=D=P=void 0,(qa<f||qa<d)&&(P=I*Ha(o),D=I*Fa(o),M=O*Ha(n),L=O*Fa(n),s<Ba&&((m=function(t,e,r,i,n,o,a,s){var h=r-t,l=i-e,u=a-n,p=s-o,c=p*h-u*l;if(!(c*c<qa))return[t+(c=(u*(e-o)-p*(t-n))/c)*h,e+c*l]}(y,g,M,L,P,D,v,_))&&(x=y-m[0],w=g-m[1],b=P-m[0],k=D-m[1],S=1/Fa(Na((x*b+w*k)/(ja(x*x+w*w)*ja(b*b+k*k)))/2),T=ja(m[0]*m[0]+m[1]*m[1]),C=Ga(d,(O-T)/(S-1)),A=Ga(f,(I-T)/(1+S))))),qa<s?qa<A?(R=Ua(M,L,y,g,I,A,i),z=Ua(P,D,v,_,I,A,i),t.moveTo(h+R.cx+R.x01,l+R.cy+R.y01),A<f?t.arc(h+R.cx,l+R.cy,A,Wa(R.y01,R.x01),Wa(z.y01,z.x01),!i):(t.arc(h+R.cx,l+R.cy,A,Wa(R.y01,R.x01),Wa(R.y11,R.x11),!i),t.arc(h,l,I,Wa(R.cy+R.y11,R.cx+R.x11),Wa(z.cy+z.y11,z.cx+z.x11),!i),t.arc(h+z.cx,l+z.cy,A,Wa(z.y11,z.x11),Wa(z.y01,z.x01),!i))):(t.moveTo(h+y,l+g),t.arc(h,l,I,n,o,!i)):t.moveTo(h+y,l+g),qa<O&&qa<s?qa<C?(R=Ua(v,_,P,D,O,-C,i),z=Ua(y,g,M,L,O,-C,i),t.lineTo(h+R.cx+R.x01,l+R.cy+R.y01),C<d?t.arc(h+R.cx,l+R.cy,C,Wa(R.y01,R.x01),Wa(z.y01,z.x01),!i):(t.arc(h+R.cx,l+R.cy,C,Wa(R.y01,R.x01),Wa(R.y11,R.x11),!i),t.arc(h,l,O,Wa(R.cy+R.y11,R.cx+R.x11),Wa(z.cy+z.y11,z.cx+z.x11),i),t.arc(h+z.cx,l+z.cy,C,Wa(z.y11,z.x11),Wa(z.y01,z.x01),!i))):(t.lineTo(h+v,l+_),t.arc(h,l,O,o,n,i)):t.lineTo(h+v,l+_)):t.moveTo(h,l),t.closePath())}var Za,Ka=function(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0,this.cornerRadius=0,this.innerCornerRadius=0},Qa=(J($a,Za=lo),$a.prototype.getDefaultShape=function(){return new Ka},$a.prototype.buildPath=function(t,e){Va(t,e)},$a.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},$a);function $a(t){return Za.call(this,t)||this}Qa.prototype.type="sector";var Ja=Wn.CMD,ts=[];function es(t,e){return Math.abs(t-e)<1e-5}function rs(t){var n,e,r,i=t.data,o=t.len(),a=[],s=0,h=0,l=0,u=0;function p(t,e){n&&2<n.length&&a.push(n),n=[t,e]}function c(t,e,r,i){es(t,r)&&es(e,i)||n.push(t,e,r,i,r,i)}for(var f,d,y,g,v,_,m,x,w,b,k,S,T,C,A,P,D,M,L,R=0;R<o;){var z=i[R++],I=1===R;switch(I&&(l=s=i[R],u=h=i[R+1],z!==Ja.L&&z!==Ja.C&&z!==Ja.Q||(n=[l,u])),z){case Ja.M:s=l=i[R++],h=u=i[R++],p(l,u);break;case Ja.L:c(s,h,X=i[R++],j=i[R++]),s=X,h=j;break;case Ja.C:n.push(i[R++],i[R++],i[R++],i[R++],s=i[R++],h=i[R++]);break;case Ja.Q:X=i[R++],j=i[R++],e=i[R++],r=i[R++],n.push(s+2/3*(X-s),h+2/3*(j-h),e+2/3*(X-e),r+2/3*(j-r),e,r),s=e,h=r;break;case Ja.A:var O=i[R++],B=i[R++],E=i[R++],F=i[R++],H=i[R++],N=i[R++]+H;R+=1;var W=!i[R++],X=Math.cos(H)*E+O,j=Math.sin(H)*F+B;I?p(l=X,u=j):c(s,h,X,j),s=Math.cos(N)*E+O,h=Math.sin(N)*F+B;for(var Y=(W?-1:1)*Math.PI/2,G=H;W?N<G:G<N;G+=Y){var q=W?Math.max(G+Y,N):Math.min(G+Y,N);f=G,d=q,y=O,g=B,v=E,_=F,L=M=D=P=A=C=T=S=k=b=w=x=m=void 0,m=Math.abs(d-f),x=4*Math.tan(m/4)/3,w=d<f?-1:1,b=Math.cos(f),k=Math.sin(f),S=Math.cos(d),T=Math.sin(d),C=b*v+y,A=k*_+g,P=S*v+y,D=T*_+g,M=v*x*w,L=_*x*w,n.push(C-M*k,A+L*b,P+M*T,D-L*S,P,D)}break;case Ja.R:l=s=i[R++],u=h=i[R++],X=l+i[R++],j=u+i[R++],p(X,u),c(X,u,X,j),c(X,j,l,j),c(l,j,l,u),c(l,u,X,u);break;case Ja.Z:n&&c(s,h,l,u),s=l,h=u}}return n&&2<n.length&&a.push(n),a}function is(t,e){for(var r=t.length,i=t[r-2],n=t[r-1],o=[],a=0;a<e.length;)o[a++]=i,o[a++]=n;return o}function ns(t,e){for(var r,i,n,o=[],a=[],s=0;s<Math.max(t.length,e.length);s++){var h=t[s],l=e[s],u=void 0,p=void 0;h?l?(i=u=(r=function(t,e){var r=t.length,i=e.length;if(r===i)return[t,e];for(var n=r<i?t:e,o=Math.min(r,i),a=Math.abs(i-r)/6,s=(o-2)/6,h=Math.ceil(a/s)+1,l=[n[0],n[1]],u=a,p=[],c=[],f=2;f<o;){var d=n[f-2],y=n[f-1],g=n[f++],v=n[f++],_=n[f++],m=n[f++],x=n[f++],w=n[f++];if(u<=0)l.push(g,v,_,m,x,w);else{for(var b=Math.min(u,h-1)+1,k=1;k<=b;k++){var S=k/b;on(d,g,_,x,S,p),on(y,v,m,w,S,c),d=p[3],y=c[3],l.push(p[1],c[1],p[2],c[2],d,y),g=p[5],v=c[5],_=p[6],m=c[6]}u-=b-1}}return n===t?[l,e]:[t,l]}(h,l))[0],n=p=r[1]):(p=is(n||h,h),u=h):(u=is(i||l,l),p=l),o.push(u),a.push(p)}return[o,a]}function os(t){for(var e=0,r=0,i=0,n=t.length,o=0,a=n-2;o<n;a=o,o+=2){var s=t[a],h=t[a+1],l=t[o],u=t[o+1],p=s*u-l*h;e+=p,r+=(s+l)*p,i+=(h+u)*p}return 0===e?[t[0]||0,t[1]||0]:[r/e/3,i/e/3,e]}function as(t,e,r,i){for(var n,o=[],a=0;a<t.length;a++){var s=t[a],h=e[a],l=os(s),u=os(h);null==n&&(n=l[2]<0!=u[2]<0);var p=[],c=[],f=0,d=1/0,y=[],g=s.length;n&&(s=function(t){for(var e=[],r=t.length,i=0;i<r;i+=2)e[i]=t[r-i-2],e[i+1]=t[r-i-1];return e}(s));for(var v=6*function(t,e,r,i){for(var n=(t.length-2)/6,o=1/0,a=0,s=t.length,h=s-2,l=0;l<n;l++){for(var u=6*l,p=0,c=0;c<s;c+=2){var f=0===c?u:(u+c-2)%h+2,d=t[f]-r[0],y=t[1+f]-r[1],g=e[c]-i[0]-d,v=e[c+1]-i[1]-y;p+=g*g+v*v}p<o&&(o=p,a=l)}return a}(s,h,l,u),_=g-2,m=0;m<_;m+=2){var x=(v+m)%_+2;p[m+2]=s[x]-l[0],p[m+3]=s[1+x]-l[1]}if(p[0]=s[v]-l[0],p[1]=s[1+v]-l[1],0<r)for(var w=i/r,b=-i/2;b<=i/2;b+=w){for(var k=Math.sin(b),S=Math.cos(b),T=0,m=0;m<s.length;m+=2){var C=p[m],A=p[m+1],P=h[m]-u[0],D=h[m+1]-u[1],M=P*S-D*k,L=P*k+D*S,R=(y[m]=M)-C,z=(y[m+1]=L)-A;T+=R*R+z*z}if(T<d){d=T,f=b;for(var I=0;I<y.length;I++)c[I]=y[I]}}else for(var O=0;O<g;O+=2)c[O]=h[O]-u[0],c[O+1]=h[O+1]-u[1];o.push({from:p,to:c,fromCp:l,toCp:u,rotation:-f})}return o}function ss(t){for(var e=this.__morphingData,r=this.__morphT,i=1-r,n=[],o=0;o<e.length;o++){var a=e[o],s=a.from,h=a.to,l=a.rotation*r,u=a.fromCp,p=a.toCp,c=Math.sin(l),f=Math.cos(l);ct(n,u,p,r);for(var d=0;d<s.length;d+=2){var y=s[d],g=s[d+1],v=y*i+h[d]*r,_=g*i+h[d+1]*r;ts[d]=v*f-_*c+n[0],ts[d+1]=v*c+_*f+n[1]}for(d=0;d<s.length;)0===d&&t.moveTo(ts[d++],ts[d++]),t.bezierCurveTo(ts[d++],ts[d++],ts[d++],ts[d++],ts[d++],ts[d++])}}function hs(t,e,r){t.__morphingData=e,t.__morphT=r}function ls(t){return null!=t.__oldBuildPath}var us,ps=(J(cs,us=lo),cs.prototype._updatePathDirty=function(){for(var t=this.shape.paths,e=this.shapeChanged(),r=0;r<t.length;r++)e=e||t[r].shapeChanged();e&&this.dirtyShape()},cs.prototype.beforeBrush=function(){this._updatePathDirty();for(var t=this.shape.paths||[],e=this.getGlobalScale(),r=0;r<t.length;r++)t[r].path||t[r].createPathProxy(),t[r].path.setScale(e[0],e[1],t[r].segmentIgnoreThreshold)},cs.prototype.buildPath=function(t,e){for(var r=e.paths||[],i=0;i<r.length;i++)r[i].buildPath(t,r[i].shape,!0)},cs.prototype.afterBrush=function(){for(var t=this.shape.paths||[],e=0;e<t.length;e++)t[e].pathUpdated()},cs.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),lo.prototype.getBoundingRect.call(this)},cs);function cs(){var t=null!==us&&us.apply(this,arguments)||this;return t.type="compound",t}var fs,ds=[],ys=(J(gs,fs=Ni),gs.prototype.traverse=function(t,e){t.call(e,this)},gs.prototype.useStyle=function(){this.style={}},gs.prototype.getCursor=function(){return this._cursor},gs.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},gs.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},gs.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},gs.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.markRedraw()},gs.prototype.addDisplayables=function(t,e){e=e||!1;for(var r=0;r<t.length;r++)this.addDisplayable(t[r],e)},gs.prototype.getDisplayables=function(){return this._displayables},gs.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},gs.prototype.eachPendingDisplayable=function(t){for(var e=this._cursor;e<this._displayables.length;e++)t&&t(this._displayables[e]);for(e=0;e<this._temporaryDisplayables.length;e++)t&&t(this._temporaryDisplayables[e])},gs.prototype.update=function(){this.updateTransform();for(var t=this._cursor;t<this._displayables.length;t++)(e=this._displayables[t]).parent=this,e.update(),e.parent=null;for(var e,t=0;t<this._temporaryDisplayables.length;t++)(e=this._temporaryDisplayables[t]).parent=this,e.update(),e.parent=null},gs.prototype.getBoundingRect=function(){if(!this._rect){for(var t=new dr(1/0,1/0,-1/0,-1/0),e=0;e<this._displayables.length;e++){var r=this._displayables[e],i=r.getBoundingRect().clone();r.needLocalTransform()&&i.applyTransform(r.getLocalTransform(ds)),t.union(i)}this._rect=t}return this._rect},gs.prototype.contain=function(t,e){var r=this.transformCoordToLocal(t,e);if(this.getBoundingRect().contain(r[0],r[1]))for(var i=0;i<this._displayables.length;i++)if(this._displayables[i].contain(t,e))return!0;return!1},gs);function gs(){var t=null!==fs&&fs.apply(this,arguments)||this;return t.notClear=!0,t.incremental=!0,t._displayables=[],t._temporaryDisplayables=[],t._cursor=0,t}var vs=new we(50);function _s(t,e,r,i,n){if(t){if("string"!=typeof t)return t;if(e&&e.__zrImageSrc===t||!r)return e;var o=vs.get(t),a={hostEl:r,cb:i,cbPayload:n};return o?xs(e=o.image)||o.pending.push(a):((e=new Image).onload=e.onerror=ms,vs.put(t,e.__cachedImgObj={image:e,pending:[a]}),e.src=e.__zrImageSrc=t),e}return e}function ms(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var r=t.pending[e],i=r.cb;i&&i(this,r.cbPayload),r.hostEl.dirty()}t.pending.length=0}function xs(t){return t&&t.width&&t.height}var ws=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function bs(t,e,r,i){var n=m({},i=i||{});n.font=e,r=H(r,"..."),n.maxIterations=H(i.maxIterations,2);var o=n.minChar=H(i.minChar,0);n.cnCharWidth=wr("国",e);var a=n.ascCharWidth=wr("a",e);n.placeholder=H(i.placeholder,"");for(var s=t=Math.max(0,t-1),h=0;h<o&&a<=s;h++)s-=a;var l=wr(r,e);return s<l&&(r="",l=0),s=t-l,n.ellipsis=r,n.ellipsisWidth=l,n.contentWidth=s,n.containerWidth=t,n}function ks(t,e){var r=e.containerWidth,i=e.font,n=e.contentWidth;if(!r)return"";if((s=wr(t,i))<=r)return t;for(var o=0;;o++){if(s<=n||o>=e.maxIterations){t+=e.ellipsis;break}var a=0===o?function(t,e,r,i){for(var n=0,o=0,a=t.length;o<a&&n<e;o++){var s=t.charCodeAt(o);n+=0<=s&&s<=127?r:i}return o}(t,n,e.ascCharWidth,e.cnCharWidth):0<s?Math.floor(t.length*n/s):0,s=wr(t=t.substr(0,a),i)}return""===t&&(t=e.placeholder),t}var Ss=function(){},Ts=function(t){this.tokens=[],t&&(this.tokens=t)},Cs=function(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[]};function As(t,e){var r=new Cs;if(null!=t&&(t+=""),!t)return r;for(var i,n=e.width,o=e.height,a=e.overflow,s="break"!==a&&"breakAll"!==a||null==n?null:{width:n,accumWidth:0,breakAll:"breakAll"===a},h=ws.lastIndex=0;null!=(i=ws.exec(t));){var l=i.index;h<l&&Ps(r,t.substring(h,l),e,s),Ps(r,i[2],e,s,i[1]),h=ws.lastIndex}h<t.length&&Ps(r,t.substring(h,t.length),e,s);var u=[],p=0,c=0,f=e.padding,d="truncate"===a,y="truncate"===e.lineOverflow;function g(t,e,r){t.width=e,t.lineHeight=r,p+=r,c=Math.max(c,e)}t:for(var v=0;v<r.lines.length;v++){for(var _=r.lines[v],m=0,x=0,w=0;w<_.tokens.length;w++){var b=(R=_.tokens[w]).styleName&&e.rich[R.styleName]||{},k=R.textPadding=b.padding,S=k?k[1]+k[3]:0,T=R.font=b.font||e.font;R.contentHeight=Tr(T);var C=H(b.height,R.contentHeight);if(R.innerHeight=C,k&&(C+=k[0]+k[2]),R.height=C,R.lineHeight=N(b.lineHeight,e.lineHeight,C),R.align=b&&b.align||e.align,R.verticalAlign=b&&b.verticalAlign||"middle",y&&null!=o&&p+R.lineHeight>o){0<w?(_.tokens=_.tokens.slice(0,w),g(_,x,m),r.lines=r.lines.slice(0,v+1)):r.lines=r.lines.slice(0,v);break t}var A,P,D,M=b.width,L=null==M||"auto"===M;"string"==typeof M&&"%"===M.charAt(M.length-1)?(R.percentWidth=M,u.push(R),R.contentWidth=wr(R.text,T)):(!L||(P=(A=b.backgroundColor)&&A.image)&&xs(P=function(t){if("string"!=typeof t)return t;var e=vs.get(t);return e&&e.image}(P))&&(R.width=Math.max(R.width,P.width*C/P.height)),null!=(D=d&&null!=n?n-x:null)&&D<R.width?!L||D<S?(R.text="",R.width=R.contentWidth=0):(R.text=function(t,e,r,i,n){if(!e)return"";var o=(t+"").split("\n");n=bs(e,r,i,n);for(var a=0,s=o.length;a<s;a++)o[a]=ks(o[a],n);return o.join("\n")}(R.text,D-S,T,e.ellipsis,{minChar:e.truncateMinChar}),R.width=R.contentWidth=wr(R.text,T)):R.contentWidth=wr(R.text,T)),R.width+=S,x+=R.width,b&&(m=Math.max(m,R.lineHeight))}g(_,x,m)}r.outerWidth=r.width=H(n,c),r.outerHeight=r.height=H(o,p),r.contentHeight=p,r.contentWidth=c,f&&(r.outerWidth+=f[1]+f[3],r.outerHeight+=f[0]+f[2]);for(v=0;v<u.length;v++){var R,z=(R=u[v]).percentWidth;R.width=parseInt(z,10)/100*r.width}return r}function Ps(t,e,r,i,n){var o,a,s,h,l,u,p=""===e,c=n&&r.rich[n]||{},f=t.lines,d=c.font||r.font,y=!1;i?(h=(s=c.padding)?s[1]+s[3]:0,null!=c.width&&"auto"!==c.width?(l=function(t,e){if("string"!=typeof t)return t;if(0<=t.lastIndexOf("%"))return parseFloat(t)/100*e;return parseFloat(t)}(c.width,i.width)+h,0<f.length&&l+i.accumWidth>i.width&&(o=e.split("\n"),y=!0),i.accumWidth=l):(u=Ms(e,d,i.width,i.breakAll,i.accumWidth),i.accumWidth=u.accumWidth+h,a=u.linesWidths,o=u.lines)):o=e.split("\n");for(var g=0;g<o.length;g++){var v,_,m=o[g],x=new Ss;x.styleName=n,x.text=m,x.isLineHolder=!m&&!p,x.width="number"==typeof c.width?c.width:a?a[g]:wr(m,d),g||y?f.push(new Ts([x])):1===(_=(v=(f[f.length-1]||(f[0]=new Ts)).tokens).length)&&v[0].isLineHolder?v[0]=x:!m&&_&&!p||v.push(x)}}var Ds=S(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function Ms(t,e,r,i,n){for(var o,a,s=[],h=[],l="",u="",p=0,c=0,f=0;f<t.length;f++){var d,y,g=t.charAt(f);"\n"!==g?(d=wr(g,e),y=!i&&(a=void 0,!(!(33<=(a=(o=g).charCodeAt(0))&&a<=255)||Ds[o])),(s.length?r<c+d:r<n+c+d)?c?(l||u)&&(c=y?(l||(l=u,u="",c=p=0),s.push(l),h.push(c-p),u+=g,l="",p+=d):(u&&(l+=u,c+=p,u="",p=0),s.push(l),h.push(c),l=g,d)):y?(s.push(u),h.push(p),u=g,p=d):(s.push(g),h.push(d)):(c+=d,y?(u+=g,p+=d):(u&&(l+=u,u="",p=0),l+=g))):(u&&(l+=u,c+=p),s.push(l),h.push(c),u=l="",c=p=0)}return s.length||l||(l=t,u="",p=0),u&&(l+=u),l&&(s.push(l),h.push(c)),1===s.length&&(c+=n),{accumWidth:c,lines:s,linesWidths:h}}var Ls,Rs={fill:"#000"},zs={style:x({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Bi.style)},Is=(J(Os,Ls=Ni),Os.prototype.childrenRef=function(){return this._children},Os.prototype.update=function(){this.styleChanged()&&this._updateSubTexts();for(var t=0;t<this._children.length;t++){var e=this._children[t];e.zlevel=this.zlevel,e.z=this.z,e.z2=this.z2,e.culling=this.culling,e.cursor=this.cursor,e.invisible=this.invisible}var r,i=this.attachedTransform;i?(i.updateTransform(),(r=i.transform)?(this.transform=this.transform||[],Jt(this.transform,r)):this.transform=null):Ls.prototype.update.call(this)},Os.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),this.attachedTransform?this.attachedTransform.getComputedTransform():Ls.prototype.getComputedTransform.call(this)},Os.prototype._updateSubTexts=function(){var t;this._childCursor=0,Fs(t=this.style),k(t.rich,Fs),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},Os.prototype.addSelfToZr=function(t){Ls.prototype.addSelfToZr.call(this,t);for(var e=0;e<this._children.length;e++)this._children[e].__zr=t},Os.prototype.removeSelfFromZr=function(t){Ls.prototype.removeSelfFromZr.call(this,t);for(var e=0;e<this._children.length;e++)this._children[e].__zr=null},Os.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var t=new dr(0,0,0,0),e=this._children,r=[],i=null,n=0;n<e.length;n++){var o=e[n],a=o.getBoundingRect(),s=o.getLocalTransform(r);s?(t.copy(a),t.applyTransform(s),(i=i||t.clone()).union(t)):(i=i||a.clone()).union(a)}this._rect=i||t}return this._rect},Os.prototype.setDefaultTextStyle=function(t){this._defaultStyle=t||Rs},Os.prototype.setTextContent=function(t){throw new Error("Can't attach text on another text")},Os.prototype._mergeStyle=function(t,e){if(!e)return t;var r=e.rich,i=t.rich||r&&{};return m(t,e),r&&i?(this._mergeRich(i,r),t.rich=i):i&&(t.rich=i),t},Os.prototype._mergeRich=function(t,e){for(var r=L(e),i=0;i<r.length;i++){var n=r[i];t[n]=t[n]||{},m(t[n],e[n])}},Os.prototype.getAnimationStyleProps=function(){return zs},Os.prototype._getOrCreateChild=function(t){var e=this._children[this._childCursor];return e&&e instanceof t||(e=new t),(this._children[this._childCursor++]=e).__zr=this.__zr,e.parent=this,e},Os.prototype._updatePlainTexts=function(){var t,e,r,i=this.style,n=i.font||mr,o=i.padding,a=function(t,e){null!=t&&(t+="");var r,i,n=e.overflow,o=e.padding,a=e.font,s="truncate"===n,h=Tr(a),l=H(e.lineHeight,h),u="truncate"===e.lineOverflow,p=e.width,c=(i=null!=p&&"break"===n||"breakAll"===n?t?Ms(t,e.font,p,"breakAll"===n,0).lines:[]:t?t.split("\n"):[]).length*l,f=H(e.height,c);f<c&&u&&(r=Math.floor(f/l),i=i.slice(0,r));var d=f,y=p;if(o&&(d+=o[0]+o[2],null!=y&&(y+=o[1]+o[3])),t&&s&&null!=y)for(var g=bs(p,a,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),v=0;v<i.length;v++)i[v]=ks(i[v],g);if(null==p){for(var _=0,v=0;v<i.length;v++)_=Math.max(wr(i[v],a),_);p=_}return{lines:i,height:f,outerHeight:d,lineHeight:l,calculatedLineHeight:h,contentHeight:c,width:p}}(Ws(i),i),s=Xs(i),h=!!i.backgroundColor,l=a.outerHeight,u=a.lines,p=a.lineHeight,c=this._defaultStyle,f=i.x||0,d=i.y||0,y=i.align||c.align||"left",g=i.verticalAlign||c.verticalAlign||"top",v=f,_=Sr(d,a.contentHeight,g);(s||o)&&(t=a.width,o&&(t+=o[1]+o[3]),e=kr(f,t,y),r=Sr(d,l,g),s&&this._renderBackground(i,i,e,r,t,l)),_+=p/2,o&&(v=Ns(f,y,o),"top"===g?_+=o[0]:"bottom"===g&&(_-=o[2]));for(var m,x=0,w=!1,b=(null==(m="fill"in i?i.fill:(w=!0,c.fill))||"none"===m?null:m.image||m.colorStops?"#000":m),k=(Hs("stroke"in i?i.stroke:h||c.autoStroke&&!w?null:(x=2,c.stroke))),S=0<i.textShadowBlur,T=null!=i.width&&("truncate"===i.overflow||"break"===i.overflow||"breakAll"===i.overflow),C=a.calculatedLineHeight,A=0;A<u.length;A++){var P=this._getOrCreateChild(wa),D=P.createStyle();P.useStyle(D),D.text=u[A],D.x=v,D.y=_,y&&(D.textAlign=y),D.textBaseline="middle",D.opacity=i.opacity,D.strokeFirst=!0,S&&(D.shadowBlur=i.textShadowBlur||0,D.shadowColor=i.textShadowColor||"transparent",D.shadowOffsetX=i.textShadowOffsetX||0,D.shadowOffsetY=i.textShadowOffsetY||0),k&&(D.stroke=k,D.lineWidth=i.lineWidth||x,D.lineDash=i.lineDash,D.lineDashOffset=i.lineDashOffset||0),b&&(D.fill=b),D.font=n,_+=p,T&&P.setBoundingRect(new dr(kr(D.x,i.width,D.textAlign),Sr(D.y,C,D.textBaseline),i.width,C))}},Os.prototype._updateRichTexts=function(){var t=this.style,e=As(Ws(t),t),r=e.width,i=e.outerWidth,n=e.outerHeight,o=t.padding,a=t.x||0,s=t.y||0,h=this._defaultStyle,l=t.align||h.align,u=t.verticalAlign||h.verticalAlign,p=kr(a,i,l),c=Sr(s,n,u),f=p,d=c;o&&(f+=o[3],d+=o[0]);var y=f+r;Xs(t)&&this._renderBackground(t,t,p,c,i,n);for(var g=!!t.backgroundColor,v=0;v<e.lines.length;v++){for(var _=e.lines[v],m=_.tokens,x=m.length,w=_.lineHeight,b=_.width,k=0,S=f,T=y,C=x-1,A=void 0;k<x&&(!(A=m[k]).align||"left"===A.align);)this._placeToken(A,t,w,d,S,"left",g),b-=A.width,S+=A.width,k++;for(;0<=C&&"right"===(A=m[C]).align;)this._placeToken(A,t,w,d,T,"right",g),b-=A.width,T-=A.width,C--;for(S+=(r-(S-f)-(y-T)-b)/2;k<=C;)A=m[k],this._placeToken(A,t,w,d,S+A.width/2,"center",g),S+=A.width,k++;d+=w}},Os.prototype._placeToken=function(t,e,r,i,n,o,a){var s=e.rich[t.styleName]||{};s.text=t.text;var h=t.verticalAlign,l=i+r/2;"top"===h?l=i+t.height/2:"bottom"===h&&(l=i+r-t.height/2),!t.isLineHolder&&Xs(s)&&this._renderBackground(s,e,"right"===o?n-t.width:"center"===o?n-t.width/2:n,l-t.height/2,t.width,t.height);var u=!!s.backgroundColor,p=t.textPadding;p&&(n=Ns(n,o,p),l-=t.height/2-p[0]-t.innerHeight/2);var c=this._getOrCreateChild(wa),f=c.createStyle();c.useStyle(f);var d=this._defaultStyle,y=!1,g=0,v=Hs("fill"in s?s.fill:"fill"in e?e.fill:(y=!0,d.fill)),_=Hs("stroke"in s?s.stroke:"stroke"in e?e.stroke:u||a||d.autoStroke&&!y?null:(g=2,d.stroke)),m=0<s.textShadowBlur||0<e.textShadowBlur;f.text=t.text,f.x=n,f.y=l,m&&(f.shadowBlur=s.textShadowBlur||e.textShadowBlur||0,f.shadowColor=s.textShadowColor||e.textShadowColor||"transparent",f.shadowOffsetX=s.textShadowOffsetX||e.textShadowOffsetX||0,f.shadowOffsetY=s.textShadowOffsetY||e.textShadowOffsetY||0),f.textAlign=o,f.textBaseline="middle",f.font=t.font||mr,f.opacity=N(s.opacity,e.opacity,1),_&&(f.lineWidth=N(s.lineWidth,e.lineWidth,g),f.lineDash=H(s.lineDash,e.lineDash),f.lineDashOffset=e.lineDashOffset||0,f.stroke=_),v&&(f.fill=v);var x=t.contentWidth,w=t.contentHeight;c.setBoundingRect(new dr(kr(f.x,x,f.textAlign),Sr(f.y,w,f.textBaseline),x,w))},Os.prototype._renderBackground=function(t,e,r,i,n,o){var a,s,h,l,u,p=t.backgroundColor,c=t.borderWidth,f=t.borderColor,d=P(p),y=t.borderRadius,g=this;(d||c&&f)&&((a=this._getOrCreateChild(Uo)).useStyle(a.createStyle()),a.style.fill=null,(h=a.shape).x=r,h.y=i,h.width=n,h.height=o,h.r=y,a.dirtyShape()),d?((u=a.style).fill=p||null,u.fillOpacity=H(t.fillOpacity,1)):p&&p.image&&((s=this._getOrCreateChild(Bo)).onload=function(){g.dirtyStyle()},(l=s.style).image=p.image,l.x=r,l.y=i,l.width=n,l.height=o),c&&f&&((u=a.style).lineWidth=c,u.stroke=f,u.strokeOpacity=H(t.strokeOpacity,1),u.lineDash=t.borderDash,u.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(u.strokeFirst=!0,u.lineWidth*=2));var v=(a||s).style;v.shadowBlur=t.shadowBlur||0,v.shadowColor=t.shadowColor||"transparent",v.shadowOffsetX=t.shadowOffsetX||0,v.shadowOffsetY=t.shadowOffsetY||0,v.opacity=N(t.opacity,e.opacity,1)},Os.makeFont=function(t){var e,r="";return(t.fontSize||t.fontFamily||t.fontWeight)&&(e="",e="string"!=typeof t.fontSize||-1===t.fontSize.indexOf("px")&&-1===t.fontSize.indexOf("rem")&&-1===t.fontSize.indexOf("em")?isNaN(+t.fontSize)?"12px":t.fontSize+"px":t.fontSize,r=[t.fontStyle,t.fontWeight,e,t.fontFamily||"sans-serif"].join(" ")),r&&Y(r)||t.textFont||t.font},Os);function Os(t){var e=Ls.call(this)||this;return e.type="text",e._children=[],e._defaultStyle=Rs,e.attr(t),e}var Bs={left:!0,right:1,center:1},Es={top:1,bottom:1,middle:1};function Fs(t){var e,r;t&&(t.font=Is.makeFont(t),"middle"===(e=t.align)&&(e="center"),t.align=null==e||Bs[e]?e:"left","center"===(r=t.verticalAlign)&&(r="middle"),t.verticalAlign=null==r||Es[r]?r:"top",t.padding&&(t.padding=j(t.padding)))}function Hs(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function Ns(t,e,r){return"right"===e?t-r[1]:"center"===e?t+r[3]/2-r[1]/2:t+r[3]}function Ws(t){var e=t.text;return null!=e&&(e+=""),e}function Xs(t){return!!(t.backgroundColor||t.borderWidth&&t.borderColor)}var js,Ys=function(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=2*Math.PI,this.clockwise=!0},Gs=(J(qs,js=lo),qs.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},qs.prototype.getDefaultShape=function(){return new Ys},qs.prototype.buildPath=function(t,e){var r=e.cx,i=e.cy,n=Math.max(e.r,0),o=e.startAngle,a=e.endAngle,s=e.clockwise,h=Math.cos(o),l=Math.sin(o);t.moveTo(h*n+r,l*n+i),t.arc(r,i,n,o,a,!s)},qs);function qs(t){return js.call(this,t)||this}Gs.prototype.type="arc";var Us=[],Vs=function(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1};function Zs(t,e,r){var i=t.cpx2,n=t.cpy2;return null===i||null===n?[(r?rn:en)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?rn:en)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?sn:an)(t.x1,t.cpx1,t.x2,e),(r?sn:an)(t.y1,t.cpy1,t.y2,e)]}var Ks,Qs=(J($s,Ks=lo),$s.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},$s.prototype.getDefaultShape=function(){return new Vs},$s.prototype.buildPath=function(t,e){var r=e.x1,i=e.y1,n=e.x2,o=e.y2,a=e.cpx1,s=e.cpy1,h=e.cpx2,l=e.cpy2,u=e.percent;0!==u&&(t.moveTo(r,i),null==h||null==l?(u<1&&(ln(r,a,n,u,Us),a=Us[1],n=Us[2],ln(i,s,o,u,Us),s=Us[1],o=Us[2]),t.quadraticCurveTo(a,s,n,o)):(u<1&&(on(r,a,h,n,u,Us),a=Us[1],h=Us[2],n=Us[3],on(i,s,l,o,u,Us),s=Us[1],l=Us[2],o=Us[3]),t.bezierCurveTo(a,s,h,l,n,o)))},$s.prototype.pointAt=function(t){return Zs(this.shape,t,!1)},$s.prototype.tangentAt=function(t){var e=Zs(this.shape,t,!0);return st(e,e)},$s);function $s(t){return Ks.call(this,t)||this}Qs.prototype.type="bezier-curve";var Js,th=function(){this.cx=0,this.cy=0,this.width=0,this.height=0},eh=(J(rh,Js=lo),rh.prototype.getDefaultShape=function(){return new th},rh.prototype.buildPath=function(t,e){var r=e.cx,i=e.cy,n=e.width,o=e.height;t.moveTo(r,i+n),t.bezierCurveTo(r+n,i+n,r+3*n/2,i-n/3,r,i-o),t.bezierCurveTo(r-3*n/2,i-n/3,r-n,i+n,r,i+n),t.closePath()},rh);function rh(t){return Js.call(this,t)||this}eh.prototype.type="droplet";var ih,nh=function(){this.cx=0,this.cy=0,this.width=0,this.height=0},oh=(J(ah,ih=lo),ah.prototype.getDefaultShape=function(){return new nh},ah.prototype.buildPath=function(t,e){var r=e.cx,i=e.cy,n=e.width,o=e.height;t.moveTo(r,i),t.bezierCurveTo(r+n/2,i-2*o/3,r+2*n,i+o/3,r,i+o),t.bezierCurveTo(r-2*n,i+o/3,r-n/2,i-2*o/3,r,i)},ah);function ah(t){return ih.call(this,t)||this}oh.prototype.type="heart";var sh,hh=Math.PI,lh=Math.sin,uh=Math.cos,ph=function(){this.x=0,this.y=0,this.r=0,this.n=0},ch=(J(fh,sh=lo),fh.prototype.getDefaultShape=function(){return new ph},fh.prototype.buildPath=function(t,e){var r=e.n;if(r&&!(r<2)){var i=e.x,n=e.y,o=e.r,a=2*hh/r,s=-hh/2;t.moveTo(i+o*uh(s),n+o*lh(s));for(var h=0,l=r-1;h<l;h++)s+=a,t.lineTo(i+o*uh(s),n+o*lh(s));t.closePath()}},fh);function fh(t){return sh.call(this,t)||this}ch.prototype.type="isogon";var dh,yh=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0},gh=(J(vh,dh=lo),vh.prototype.getDefaultShape=function(){return new yh},vh.prototype.buildPath=function(t,e){var r=e.cx,i=e.cy,n=2*Math.PI;t.moveTo(r+e.r,i),t.arc(r,i,e.r,0,n,!1),t.moveTo(r+e.r0,i),t.arc(r,i,e.r0,0,n,!0)},vh);function vh(t){return dh.call(this,t)||this}gh.prototype.type="ring";var _h,mh=Math.sin,xh=Math.cos,wh=Math.PI/180,bh=function(){this.cx=0,this.cy=0,this.r=[],this.k=0,this.n=1},kh=(J(Sh,_h=lo),Sh.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},Sh.prototype.getDefaultShape=function(){return new bh},Sh.prototype.buildPath=function(t,e){var r,i,n,o=e.r,a=e.k,s=e.n,h=e.cx,l=e.cy;t.moveTo(h,l);for(var u=0,p=o.length;u<p;u++){n=o[u];for(var c=0;c<=360*s;c++)r=n*mh(a/s*c%360*wh)*xh(c*wh)+h,i=n*mh(a/s*c%360*wh)*mh(c*wh)+l,t.lineTo(r,i)}},Sh);function Sh(t){return _h.call(this,t)||this}kh.prototype.type="rose";var Th,Ch=Math.PI,Ah=Math.cos,Ph=Math.sin,Dh=function(){this.cx=0,this.cy=0,this.n=3,this.r=0},Mh=(J(Lh,Th=lo),Lh.prototype.getDefaultShape=function(){return new Dh},Lh.prototype.buildPath=function(t,e){var r=e.n;if(r&&!(r<2)){var i=e.cx,n=e.cy,o=e.r,a=e.r0;null==a&&(a=4<r?o*Ah(2*Ch/r)/Ah(Ch/r):o/3);var s=Ch/r,h=-Ch/2,l=i+o*Ah(h),u=n+o*Ph(h);h+=s,t.moveTo(l,u);for(var p,c=0,f=2*r-1;c<f;c++)p=c%2==0?a:o,t.lineTo(i+p*Ah(h),n+p*Ph(h)),h+=s;t.closePath()}},Lh);function Lh(t){return Th.call(this,t)||this}Mh.prototype.type="star";var Rh,zh=Math.cos,Ih=Math.sin,Oh=function(){this.cx=0,this.cy=0,this.r=0,this.r0=0,this.d=0,this.location="out"},Bh=(J(Eh,Rh=lo),Eh.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},Eh.prototype.getDefaultShape=function(){return new Oh},Eh.prototype.buildPath=function(t,e){var r,i,n=e.r,o=e.r0,a=e.d,s=e.cx,h=e.cy,l="out"===e.location?1:-1;if(!(e.location&&n<=o)){var u,p=0,c=1,f=(n+l*o)*zh(0)-l*a*zh(0)+s,d=(n+l*o)*Ih(0)-a*Ih(0)+h;for(t.moveTo(f,d);o*++p%(n+l*o)!=0;);for(;u=Math.PI/180*c,r=(n+l*o)*zh(u)-l*a*zh((n/o+l)*u)+s,i=(n+l*o)*Ih(u)-a*Ih((n/o+l)*u)+h,t.lineTo(r,i),++c<=o*p/(n+l*o)*360;);}},Eh);function Eh(t){return Rh.call(this,t)||this}Bh.prototype.type="trochoid";var Fh,Hh=(J(Nh,Fh=da),Nh);function Nh(t,e,r,i,n){var o=Fh.call(this,i)||this;return o.x=null==t?.5:t,o.y=null==e?.5:e,o.r=null==r?.5:r,o.type="radial",o.global=n||!1,o}function Wh(t,e){this.image=t,this.repeat=e,this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1}var Xh=[0,0],jh=[0,0],Yh=new nr,Gh=new nr,qh=(Uh.prototype.fromBoundingRect=function(t,e){var r=this._corners,i=this._axes,n=t.x,o=t.y,a=n+t.width,s=o+t.height;if(r[0].set(n,o),r[1].set(a,o),r[2].set(a,s),r[3].set(n,s),e)for(var h=0;h<4;h++)r[h].transform(e);for(nr.sub(i[0],r[1],r[0]),nr.sub(i[1],r[3],r[0]),i[0].normalize(),i[1].normalize(),h=0;h<2;h++)this._origin[h]=i[h].dot(r[0])},Uh.prototype.intersect=function(t,e){var r=!0,i=!e;return Yh.set(1/0,1/0),Gh.set(0,0),!this._intersectCheckOneSide(this,t,Yh,Gh,i,1)&&(r=!1,i)||!this._intersectCheckOneSide(t,this,Yh,Gh,i,-1)&&(r=!1,i)||i||nr.copy(e,r?Yh:Gh),r},Uh.prototype._intersectCheckOneSide=function(t,e,r,i,n,o){for(var a=!0,s=0;s<2;s++){var h=this._axes[s];if(this._getProjMinMaxOnAxis(s,t._corners,Xh),this._getProjMinMaxOnAxis(s,e._corners,jh),Xh[1]<jh[0]||jh[1]<Xh[0]){if(a=!1,n)return a;var l=Math.abs(jh[0]-Xh[1]),u=Math.abs(Xh[0]-jh[1]);Math.min(l,u)>i.len()&&(l<u?nr.scale(i,h,-l*o):nr.scale(i,h,u*o))}else r&&(l=Math.abs(jh[0]-Xh[1]),u=Math.abs(Xh[0]-jh[1]),Math.min(l,u)<r.len()&&(l<u?nr.scale(r,h,l*o):nr.scale(r,h,-u*o)))}return a},Uh.prototype._getProjMinMaxOnAxis=function(t,e,r){for(var i=this._axes[t],n=this._origin,o=e[0].dot(i)+n[t],a=o,s=o,h=1;h<e.length;h++)var l=e[h].dot(i)+n[t],a=Math.min(l,a),s=Math.max(l,s);r[0]=a,r[1]=s},Uh);function Uh(t,e){this._corners=[],this._axes=[],this._origin=[0,0];for(var r=0;r<4;r++)this._corners[r]=new nr;for(r=0;r<2;r++)this._axes[r]=new nr;t&&this.fromBoundingRect(t,e)}var Vh=(Zh.prototype.update=function(t){var e=this.dom.style;e.width=t.width+"px",e.height=t.height+"px",e.left=t.x+"px",e.top=t.y+"px"},Zh.prototype.hide=function(){this.dom.style.opacity="0"},Zh.prototype.show=function(t){var e=this;clearTimeout(this._hideTimeout),this.dom.style.opacity="1",this._hideTimeout=setTimeout(function(){e.hide()},t||1e3)},Zh);function Zh(t){var e=this.dom=document.createElement("div");for(var r in e.className="ec-debug-dirty-rect",t=m({},t),m(t,{backgroundColor:"rgba(0, 0, 255, 0.2)",border:"1px solid #00f"}),e.style.cssText="\nposition: absolute;\nopacity: 0;\ntransition: opacity 0.5s linear;\npointer-events: none;\n",t)t.hasOwnProperty(r)&&(e.style[r]=t[r])}function Kh(t,e,r){for(var i,n,o,a,s,h,l,u,p,c,f,d,y,g,v,_,m="radial"===e.type?(u=t,p=e,f=(c=r).width,d=c.height,y=Math.min(f,d),g=null==p.x?.5:p.x,v=null==p.y?.5:p.y,_=null==p.r?.5:p.r,p.global||(g=g*f+c.x,v=v*d+c.y,_*=y),u.createRadialGradient(g,v,0,g,v,_)):(i=t,o=r,a=null==(n=e).x?0:n.x,s=null==n.x2?1:n.x2,h=null==n.y?0:n.y,l=null==n.y2?0:n.y2,n.global||(a=a*o.width+o.x,s=s*o.width+o.x,h=h*o.height+o.y,l=l*o.height+o.y),a=isNaN(a)?0:a,s=isNaN(s)?1:s,h=isNaN(h)?0:h,l=isNaN(l)?0:l,i.createLinearGradient(a,h,s,l)),x=e.colorStops,w=0;w<x.length;w++)m.addColorStop(x[w].offset,x[w].color);return m}function Qh(t,e){if(t!==e&&(t||e)){if(!t||!e||t.length!==e.length)return 1;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return 1}}function $h(t,e){return t&&"solid"!==t&&0<e?(e=e||1,"dashed"===t?[4*e,2*e]:"dotted"===t?[e]:R(t)?[t]:C(t)?t:null):null}var Jh=new Wn(!0);function tl(t){var e=t.stroke;return!(null==e||"none"===e||!(0<t.lineWidth))}function el(t){var e=t.fill;return null!=e&&"none"!==e}function rl(t,e){var r;null!=e.fillOpacity&&1!==e.fillOpacity?(r=t.globalAlpha,t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r):t.fill()}function il(t,e){var r;null!=e.strokeOpacity&&1!==e.strokeOpacity?(r=t.globalAlpha,t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r):t.stroke()}function nl(t,e,r){var i=_s(e.image,e.__image,r);if(xs(i)){var n,o=t.createPattern(i,e.repeat||"repeat");return"function"==typeof DOMMatrix&&((n=new DOMMatrix).rotateSelf(0,0,(e.rotation||0)/Math.PI*180),n.scaleSelf(e.scaleX||1,e.scaleY||1),n.translateSelf(e.x||0,e.y||0),o.setTransform(n)),o}}var ol=["shadowBlur","shadowOffsetX","shadowOffsetY"],al=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function sl(t,e,r,i,n){var o=!1;if(!i&&e===(r=r||{}))return!1;!i&&e.opacity===r.opacity||(o||(dl(t,n),o=!0),t.globalAlpha=null==e.opacity?Oi.opacity:e.opacity),!i&&e.blend===r.blend||(o||(dl(t,n),o=!0),t.globalCompositeOperation=e.blend||Oi.blend);for(var a=0;a<ol.length;a++){var s=ol[a];!i&&e[s]===r[s]||(o||(dl(t,n),o=!0),t[s]=t.dpr*(e[s]||0))}return!i&&e.shadowColor===r.shadowColor||(o||(dl(t,n),o=!0),t.shadowColor=e.shadowColor||Oi.shadowColor),o}function hl(t,e,r,i,n){var o=yl(e,n.inHover),a=i?null:r&&yl(r,n.inHover)||{};if(o!==a){var s,h=sl(t,o,a,i,n);!i&&o.fill===a.fill||(h||(dl(t,n),h=!0),t.fillStyle=o.fill),!i&&o.stroke===a.stroke||(h||(dl(t,n),h=!0),t.strokeStyle=o.stroke),!i&&o.opacity===a.opacity||(h||(dl(t,n),h=!0),t.globalAlpha=null==o.opacity?1:o.opacity),e.hasStroke()&&(s=o.lineWidth/(o.strokeNoScale&&e&&e.getLineScale?e.getLineScale():1),t.lineWidth!==s&&(h||(dl(t,n),h=!0),t.lineWidth=s));for(var l=0;l<al.length;l++){var u=al[l],p=u[0];!i&&o[p]===a[p]||(h||(dl(t,n),h=!0),t[p]=o[p]||u[1])}return h}}function ll(t,e){var r=e.transform,i=t.dpr||1;r?t.setTransform(i*r[0],i*r[1],i*r[2],i*r[3],i*r[4],i*r[5]):t.setTransform(i,0,0,i,0,0)}var ul=1,pl=2,cl=3,fl=4;function dl(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function yl(t,e){return e&&t.__hoverStyle||t.style}function gl(t,e,r,i){var n=e.transform;if(!e.shouldBePainted(r.viewWidth,r.viewHeight,!1,!1))return e.__dirty&=~Br.REDARAW_BIT,void(e.__isRendered=!1);var o,a,s,h,l,u,p,c,f,d,y,g,v,_,m,x,w,b,k,S,T,C,A,P,D,M,L,R,z,I,O,B,E=e.__clipPaths,F=r.prevElClipPaths,H=!1,N=!1;F&&!Qh(E,F)||(F&&F.length&&(dl(t,r),t.restore(),N=H=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),E&&E.length&&(dl(t,r),t.save(),function(t,e,r){for(var i=!1,n=0;n<t.length;n++){var o=t[n],i=i||o.isZeroArea();ll(e,o),e.beginPath(),o.buildPath(e,o.shape),e.clip()}r.allClipped=i}(E,t,r),H=!0),r.prevElClipPaths=E),r.allClipped?e.__isRendered=!1:(e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush(),(o=r.prevEl)||(N=H=!0),a=e instanceof lo&&e.autoBatch&&(s=e.style,h=el(s),l=tl(s),!(s.lineDash||!(+h^+l)||h&&"string"!=typeof s.fill||l&&"string"!=typeof s.stroke||s.strokePercent<1||s.strokeOpacity<1||s.fillOpacity<1)),H||(u=n,p=o.transform,u&&p?u[0]!==p[0]||u[1]!==p[1]||u[2]!==p[2]||u[3]!==p[3]||u[4]!==p[4]||u[5]!==p[5]:u||p)?(dl(t,r),ll(t,e)):a||dl(t,r),c=yl(e,r.inHover),e instanceof lo?(r.lastDrawType!==ul&&(N=!0,r.lastDrawType=ul),hl(t,e,o,N,r),a&&(r.batchFill||r.batchStroke)||t.beginPath(),function(t,e,r,i){var n=tl(r),o=el(r),a=r.strokePercent,s=a<1,h=!e.path;e.silent&&!s||!h||e.createPathProxy();var l,u,p,c,f,d,y,g,v,_,m,x=e.path||Jh;i||(l=r.fill,u=r.stroke,p=o&&!!l.colorStops,c=n&&!!u.colorStops,f=o&&!!l.image,d=n&&!!u.image,m=_=v=g=y=void 0,(p||c)&&(m=e.getBoundingRect()),p&&(y=e.__dirty?Kh(t,l,m):e.__canvasFillGradient,e.__canvasFillGradient=y),c&&(g=e.__dirty?Kh(t,u,m):e.__canvasStrokeGradient,e.__canvasStrokeGradient=g),f&&(v=e.__dirty||!e.__canvasFillPattern?nl(t,l,e):e.__canvasFillPattern,e.__canvasFillPattern=v),d&&(_=e.__dirty||!e.__canvasStrokePattern?nl(t,u,e):e.__canvasStrokePattern,e.__canvasStrokePattern=v),p?t.fillStyle=y:f&&(v?t.fillStyle=v:o=!1),c?t.strokeStyle=g:d&&(_?t.strokeStyle=_:n=!1));var w,b=r.lineDash&&0<r.lineWidth&&$h(r.lineDash,r.lineWidth),k=r.lineDashOffset,S=!!t.setLineDash,T=e.getGlobalScale();x.setScale(T[0],T[1],e.segmentIgnoreThreshold),!b||(w=r.strokeNoScale&&e.getLineScale?e.getLineScale():1)&&1!==w&&(b=W(b,function(t){return t/w}),k/=w);var C=!0;(h||e.__dirty&lo.SHAPE_CHANGED_BIT||b&&!S&&n)&&(x.setDPR(t.dpr),s?x.setContext(null):(x.setContext(t),C=!1),x.reset(),b&&!S&&(x.setLineDash(b),x.setLineDashOffset(k)),e.buildPath(x,e.shape,i),x.toStatic(),e.pathUpdated()),C&&x.rebuildPath(t,s?a:1),b&&S&&(t.setLineDash(b),t.lineDashOffset=k),i||(r.strokeFirst?(n&&il(t,r),o&&rl(t,r)):(o&&rl(t,r),n&&il(t,r))),b&&S&&t.setLineDash([])}(t,e,c,a),a&&(r.batchFill=c.fill||"",r.batchStroke=c.stroke||"")):e instanceof wa?(r.lastDrawType!==cl&&(N=!0,r.lastDrawType=cl),hl(t,e,o,N,r),D=t,M=e,null!=(B=(L=c).text)&&(B+=""),B&&(D.font=L.font||mr,D.textAlign=L.textAlign,D.textBaseline=L.textBaseline,R=void 0,D.setLineDash&&(z=L.lineDash&&0<L.lineWidth&&$h(L.lineDash,L.lineWidth),I=L.lineDashOffset,z&&((O=L.strokeNoScale&&M.getLineScale?M.getLineScale():1)&&1!==O&&(z=W(z,function(t){return t/O}),I/=O),D.setLineDash(z),D.lineDashOffset=I,R=!0)),L.strokeFirst?(tl(L)&&D.strokeText(B,L.x,L.y),el(L)&&D.fillText(B,L.x,L.y)):(el(L)&&D.fillText(B,L.x,L.y),tl(L)&&D.strokeText(B,L.x,L.y)),R&&D.setLineDash([]))):e instanceof Bo?(r.lastDrawType!==pl&&(N=!0,r.lastDrawType=pl),C=o,A=N,sl(t,yl(e,(P=r).inHover),C&&yl(C,P.inHover),A,P),f=t,y=c,(T=(d=e).__image=_s(y.image,d.__image,d,d.onload))&&xs(T)&&(g=y.x||0,v=y.y||0,_=d.getWidth(),m=d.getHeight(),x=T.width/T.height,null==_&&null!=m?_=m*x:null==m&&null!=_?m=_/x:null==_&&null==m&&(_=T.width,m=T.height),y.sWidth&&y.sHeight?(w=y.sx||0,b=y.sy||0,f.drawImage(T,w,b,y.sWidth,y.sHeight,g,v,_,m)):y.sx&&y.sy?(k=_-(w=y.sx),S=m-(b=y.sy),f.drawImage(T,w,b,k,S,g,v,_,m)):f.drawImage(T,g,v,_,m))):e instanceof ys&&(r.lastDrawType!==fl&&(N=!0,r.lastDrawType=fl),function(t,e,r){var i=e.getDisplayables(),n=e.getTemporalDisplayables();t.save();var o,a,s={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:r.viewWidth,viewHeight:r.viewHeight,inHover:r.inHover};for(o=e.getCursor(),a=i.length;o<a;o++){(u=i[o]).beforeBrush&&u.beforeBrush(),u.innerBeforeBrush(),gl(t,u,s,o===a-1),u.innerAfterBrush(),u.afterBrush&&u.afterBrush(),s.prevEl=u}for(var h=0,l=n.length;h<l;h++){var u;(u=n[h]).beforeBrush&&u.beforeBrush(),u.innerBeforeBrush(),gl(t,u,s,h===l-1),u.innerAfterBrush(),u.afterBrush&&u.afterBrush(),s.prevEl=u}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}(t,e,r)),a&&i&&dl(t,r),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),(r.prevEl=e).__dirty=0,e.__isRendered=!0)}function vl(){return!1}function _l(t,e,r){var i=w(),n=e.getWidth(),o=e.getHeight(),a=i.style;return a&&(a.position="absolute",a.left="0",a.top="0",a.width=n+"px",a.height=o+"px",i.setAttribute("data-zr-dom-id",t)),i.width=n*r,i.height=o*r,i}var ml,xl=(J(wl,ml=xt),wl.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},wl.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},wl.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},wl.prototype.setUnpainted=function(){this.__firstTimePaint=!0},wl.prototype.createBackBuffer=function(){var t=this.dpr;this.domBack=_l("back-"+this.id,this.painter,t),this.ctxBack=this.domBack.getContext("2d"),1!==t&&this.ctxBack.scale(t,t)},wl.prototype.createRepaintRects=function(t,e,r,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var p=[],c=this.maxRepaintRectCount,f=!1,d=new dr(0,0,0,0);function n(t){if(t.isFinite()&&!t.isZero())if(0===p.length)(e=new dr(0,0,0,0)).copy(t),p.push(e);else{for(var e,r=!1,i=1/0,n=0,o=0;o<p.length;++o){var a,s,h,l=p[o];if(l.intersect(t)){var u=new dr(0,0,0,0);u.copy(l),u.union(t),p[o]=u,r=!0;break}f&&(d.copy(t),d.union(l),a=t.width*t.height,s=l.width*l.height,(h=d.width*d.height-a-s)<i&&(i=h,n=o))}f&&(p[n].union(t),r=!0),r||((e=new dr(0,0,0,0)).copy(t),p.push(e)),f=f||p.length>=c}}for(var o,a=this.__startIndex;a<this.__endIndex;++a)(h=t[a])&&(u=h.shouldBePainted(r,i,!0,!0),(l=h.__isRendered&&(h.__dirty&Br.REDARAW_BIT||!u)?h.getPrevPaintRect():null)&&n(l),(o=u&&(h.__dirty&Br.REDARAW_BIT||!h.__isRendered)?h.getPaintRect():null)&&n(o));for(var s,a=this.__prevStartIndex;a<this.__prevEndIndex;++a){var h,l,u=(h=e[a]).shouldBePainted(r,i,!0,!0);!h||u&&h.__zr||!h.__isRendered||(l=h.getPrevPaintRect())&&n(l)}do{for(s=!1,a=0;a<p.length;)if(p[a].isZero())p.splice(a,1);else{for(var y=a+1;y<p.length;)p[a].intersect(p[y])?(s=!0,p[a].union(p[y]),p.splice(y,1)):y++;a++}}while(s);return this._paintRects=p},wl.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},wl.prototype.resize=function(t,e){var r=this.dpr,i=this.dom,n=i.style,o=this.domBack;n&&(n.width=t+"px",n.height=e+"px"),i.width=t*r,i.height=e*r,o&&(o.width=t*r,o.height=e*r,1!==r&&this.ctxBack.scale(r,r))},wl.prototype.clear=function(t,o,e){var r=this.dom,a=this.ctx,i=r.width,n=r.height;o=o||this.clearColor;var s=this.motionBlur&&!t,h=this.lastFrameAlpha,l=this.dpr,u=this;s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(r,0,0,i/l,n/l));var p=this.domBack;function c(t,e,r,i){var n;a.clearRect(t,e,r,i),o&&"transparent"!==o&&(n=void 0,E(o)?(n=o.__canvasGradient||Kh(a,o,{x:0,y:0,width:r,height:i}),o.__canvasGradient=n):F(o)&&(n=nl(a,o,{dirty:function(){u.setUnpainted(),u.__painter.refresh()}})),a.save(),a.fillStyle=n||o,a.fillRect(t,e,r,i),a.restore()),s&&(a.save(),a.globalAlpha=h,a.drawImage(p,t,e,r,i),a.restore())}!e||s?c(0,0,i,n):e.length&&k(e,function(t){c(t.x*l,t.y*l,t.width*l,t.height*l)})},wl);function wl(t,e,r){var i,n=ml.call(this)||this;n.motionBlur=!1,n.lastFrameAlpha=.7,n.dpr=1,n.virtual=!1,n.config={},n.incremental=!1,n.zlevel=0,n.maxRepaintRectCount=5,n.__dirty=!0,n.__firstTimePaint=!0,n.__used=!1,n.__drawIndex=0,n.__startIndex=0,n.__endIndex=0,n.__prevStartIndex=null,n.__prevEndIndex=null,r=r||Pr,"string"==typeof t?i=_l(t,e,r):z(t)&&(t=(i=t).id),n.id=t;var o=(n.dom=i).style;return o&&(i.onselectstart=vl,o.webkitUserSelect="none",o.userSelect="none",o.webkitTapHighlightColor="rgba(0,0,0,0)",o["-webkit-touch-callout"]="none",o.padding="0",o.margin="0",o.borderWidth="0"),n.domBack=null,n.ctxBack=null,n.painter=e,n.config=null,n.dpr=r,n}var bl=314159;function kl(t){return parseInt(t,10)}var Sl=(Tl.prototype.getType=function(){return"canvas"},Tl.prototype.isSingleCanvas=function(){return this._singleCanvas},Tl.prototype.getViewportRoot=function(){return this._domRoot},Tl.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},Tl.prototype.refresh=function(t){var e=this.storage.getDisplayList(!0),r=this._prevDisplayList,i=this._zlevelList;this._redrawId=Math.random(),this._paintList(e,r,t,this._redrawId);for(var n=0;n<i.length;n++){var o,a=i[n],s=this._layers[a];!s.__builtin__&&s.refresh&&(o=0===n?this._backgroundColor:null,s.refresh(o))}return this._opts.useDirtyRect&&(this._prevDisplayList=e.slice()),this},Tl.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},Tl.prototype._paintHoverList=function(t){var e=t.length,r=this._hoverlayer;if(r&&r.clear(),e){for(var i,n={inHover:!0,viewWidth:this._width,viewHeight:this._height},o=0;o<e;o++){var a=t[o];a.__inHover&&(r=r||(this._hoverlayer=this.getLayer(1e5)),i||(i=r.ctx).save(),gl(i,a,n,o===e-1))}i&&i.restore()}},Tl.prototype.getHoverLayer=function(){return this.getLayer(1e5)},Tl.prototype.paintOne=function(t,e){gl(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)},Tl.prototype._paintList=function(t,e,r,i){var n,o,a,s;this._redrawId===i&&(r=r||!1,this._updateLayerStatus(t),o=(n=this._doPaintList(t,e,r)).finished,a=n.needsRefreshHover,this._needsManuallyCompositing&&this._compositeManually(),a&&this._paintHoverList(t),o?this.eachLayer(function(t){t.afterBrush&&t.afterBrush()}):(s=this,ei(function(){s._paintList(t,e,r,i)})))},Tl.prototype._compositeManually=function(){var e=this.getLayer(bl).ctx,r=this._domRoot.width,i=this._domRoot.height;e.clearRect(0,0,r,i),this.eachBuiltinLayer(function(t){t.virtual&&e.drawImage(t.dom,0,0,r,i)})},Tl.prototype._doPaintList=function(d,y,g){for(var v=this,_=[],m=this._opts.useDirtyRect,t=0;t<this._zlevelList.length;t++){var e=this._zlevelList[t],r=this._layers[e];r.__builtin__&&r!==this._hoverlayer&&(r.__dirty||g)&&_.push(r)}for(var x=!0,w=!1,b=this,i=0;i<_.length;i++)!function(t){var i=_[t],n=i.ctx,e=m&&i.createRepaintRects(d,y,b._width,b._height);n.save();var r,o,a=g?i.__startIndex:i.__drawIndex,s=!g&&i.incremental&&Date.now,h=s&&Date.now(),l=i.zlevel===b._zlevelList[0]?b._backgroundColor:null;function u(t){var e={inHover:!1,allClipped:!1,prevEl:null,viewWidth:v._width,viewHeight:v._height};for(o=a;o<i.__endIndex;o++){var r=d[o];if(r.__inHover&&(w=!0),v._doPaintEl(r,i,m,t,e,o===i.__endIndex-1),s&&15<Date.now()-h)break}e.prevElClipPaths&&n.restore()}if(i.__startIndex===i.__endIndex?i.clear(!1,l,e):a===i.__startIndex&&((r=d[a]).incremental&&r.notClear&&!g||i.clear(!1,l,e)),-1===a&&(console.error("For some unknown reason. drawIndex is -1"),a=i.__startIndex),e)if(0===e.length)o=i.__endIndex;else for(var p=b.dpr,c=0;c<e.length;++c){var f=e[c];n.save(),n.beginPath(),n.rect(f.x*p,f.y*p,f.width*p,f.height*p),n.clip(),u(f),n.restore()}else n.save(),u(),n.restore();i.__drawIndex=o,i.__drawIndex<i.__endIndex&&(x=!1)}(i);return h.wxa&&k(this._layers,function(t){t&&t.ctx&&t.ctx.draw&&t.ctx.draw()}),{finished:x,needsRefreshHover:w}},Tl.prototype._doPaintEl=function(t,e,r,i,n,o){var a,s=e.ctx;r?(a=t.getPaintRect(),(!i||a&&a.intersect(i))&&(gl(s,t,n,o),t.setPrevPaintRect(a))):gl(s,t,n,o)},Tl.prototype.getLayer=function(t,e){this._singleCanvas&&!this._needsManuallyCompositing&&(t=bl);var r=this._layers[t];return r||((r=new xl("zr_"+t,this,this.dpr)).zlevel=t,r.__builtin__=!0,this._layerConfig[t]?_(r,this._layerConfig[t],!0):this._layerConfig[t-.01]&&_(r,this._layerConfig[t-.01],!0),e&&(r.virtual=e),this.insertLayer(t,r),r.initContext()),r},Tl.prototype.insertLayer=function(t,e){var r,i=this._layers,n=this._zlevelList,o=n.length,a=this._domRoot,s=null,h=-1;if(i[t])g("ZLevel "+t+" has been used already");else if(function(t){if(t){if(t.__builtin__)return 1;if("function"==typeof t.resize&&"function"==typeof t.refresh)return 1}}(e)){if(0<o&&t>n[0]){for(h=0;h<o-1&&!(n[h]<t&&n[h+1]>t);h++);s=i[n[h]]}n.splice(h+1,0,t),(i[t]=e).virtual||(s?(r=s.dom).nextSibling?a.insertBefore(e.dom,r.nextSibling):a.appendChild(e.dom):a.firstChild?a.insertBefore(e.dom,a.firstChild):a.appendChild(e.dom)),e.__painter=this}else g("Layer of zlevel "+t+" is not valid")},Tl.prototype.eachLayer=function(t,e){for(var r=this._zlevelList,i=0;i<r.length;i++){var n=r[i];t.call(e,this._layers[n],n)}},Tl.prototype.eachBuiltinLayer=function(t,e){for(var r=this._zlevelList,i=0;i<r.length;i++){var n=r[i],o=this._layers[n];o.__builtin__&&t.call(e,o,n)}},Tl.prototype.eachOtherLayer=function(t,e){for(var r=this._zlevelList,i=0;i<r.length;i++){var n=r[i],o=this._layers[n];o.__builtin__||t.call(e,o,n)}},Tl.prototype.getLayers=function(){return this._layers},Tl.prototype._updateLayerStatus=function(t){function e(t){n&&(n.__endIndex!==t&&(n.__dirty=!0),n.__endIndex=t)}if(this.eachBuiltinLayer(function(t,e){t.__dirty=t.__used=!1}),this._singleCanvas)for(var r=1;r<t.length;r++)if((s=t[r]).zlevel!==t[r-1].zlevel||s.incremental){this._needsManuallyCompositing=!0;break}for(var i,n=null,o=0,a=0;a<t.length;a++){var s,h=(s=t[a]).zlevel,l=void 0;i!==h&&(i=h,o=0),s.incremental?((l=this.getLayer(h+.001,this._needsManuallyCompositing)).incremental=!0,o=1):l=this.getLayer(h+(0<o?.01:0),this._needsManuallyCompositing),l.__builtin__||g("ZLevel "+h+" has been used by unkown layer "+l.id),l!==n&&(l.__used=!0,l.__startIndex!==a&&(l.__dirty=!0),l.__startIndex=a,l.incremental?l.__drawIndex=-1:l.__drawIndex=a,e(a),n=l),s.__dirty&Br.REDARAW_BIT&&!s.__inHover&&(l.__dirty=!0,l.incremental&&l.__drawIndex<0&&(l.__drawIndex=a))}e(a),this.eachBuiltinLayer(function(t,e){!t.__used&&0<t.getElementCount()&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},Tl.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},Tl.prototype._clearLayer=function(t){t.clear()},Tl.prototype.setBackgroundColor=function(t){this._backgroundColor=t,k(this._layers,function(t){t.setUnpainted()})},Tl.prototype.configLayer=function(t,e){if(e){var r=this._layerConfig;r[t]?_(r[t],e,!0):r[t]=e;for(var i=0;i<this._zlevelList.length;i++){var n=this._zlevelList[i];n!==t&&n!==t+.01||_(this._layers[n],r[t],!0)}}},Tl.prototype.delLayer=function(t){var e=this._layers,r=this._zlevelList,i=e[t];i&&(i.dom.parentNode.removeChild(i.dom),delete e[t],r.splice(D(r,t),1))},Tl.prototype.resize=function(t,e){if(this._domRoot.style){var r=this._domRoot;r.style.display="none";var i=this._opts;if(null!=t&&(i.width=t),null!=e&&(i.height=e),t=this._getSize(0),e=this._getSize(1),r.style.display="",this._width!==t||e!==this._height){for(var n in r.style.width=t+"px",r.style.height=e+"px",this._layers)this._layers.hasOwnProperty(n)&&this._layers[n].resize(t,e);this.refresh(!0)}this._width=t,this._height=e}else{if(null==t||null==e)return;this._width=t,this._height=e,this.getLayer(bl).resize(t,e)}return this},Tl.prototype.clearLayer=function(t){var e=this._layers[t];e&&e.clear()},Tl.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},Tl.prototype.getRenderedCanvas=function(t){if(t=t||{},this._singleCanvas&&!this._compositeManually)return this._layers[bl].dom;var e=new xl("image",this,t.pixelRatio||this.dpr);e.initContext(),e.clear(!1,t.backgroundColor||this._backgroundColor);var r=e.ctx;if(t.pixelRatio<=this.dpr){this.refresh();var i=e.dom.width,n=e.dom.height;this.eachLayer(function(t){t.__builtin__?r.drawImage(t.dom,0,0,i,n):t.renderToCanvas&&(r.save(),t.renderToCanvas(r),r.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},a=this.storage.getDisplayList(!0),s=0,h=a.length;s<h;s++){var l=a[s];gl(r,l,o,s===h-1)}return e.dom},Tl.prototype.getWidth=function(){return this._width},Tl.prototype.getHeight=function(){return this._height},Tl.prototype._getSize=function(t){var e=this._opts,r=["width","height"][t],i=["clientWidth","clientHeight"][t],n=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(null!=e[r]&&"auto"!==e[r])return parseFloat(e[r]);var a=this.root,s=document.defaultView.getComputedStyle(a);return(a[i]||kl(s[r])||kl(a.style[r]))-(kl(s[n])||0)-(kl(s[o])||0)|0},Tl.prototype.pathToImage=function(t,e){e=e||this.dpr;var r=document.createElement("canvas"),i=r.getContext("2d"),n=t.getBoundingRect(),o=t.style,a=o.shadowBlur*e,s=o.shadowOffsetX*e,h=o.shadowOffsetY*e,l=t.hasStroke()?o.lineWidth:0,u=Math.max(l/2,a-s),p=Math.max(l/2,s+a),c=Math.max(l/2,a-h),f=Math.max(l/2,h+a),d=n.width+u+p,y=n.height+c+f;r.width=d*e,r.height=y*e,i.scale(e,e),i.clearRect(0,0,d,y),i.dpr=e;var g={x:t.x,y:t.y,scaleX:t.scaleX,scaleY:t.scaleY,rotation:t.rotation,originX:t.originX,originY:t.originY};t.x=u-n.x,t.y=c-n.y,t.rotation=0,t.scaleX=1,t.scaleY=1,t.updateTransform(),t&&gl(i,t,{inHover:!1,viewWidth:this._width,viewHeight:this._height},!0);var v=new Bo({style:{x:0,y:0,image:r}});return m(t,g),v},Tl);function Tl(t,e,r,i){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var n=!t.nodeName||"CANVAS"===t.nodeName.toUpperCase();this._opts=r=m({},r||{}),this.dpr=r.devicePixelRatio||Pr,this._singleCanvas=n;var o=(this.root=t).style;o&&(o.webkitTapHighlightColor="transparent",o.webkitUserSelect="none",o.userSelect="none",o["-webkit-touch-callout"]="none",t.innerHTML=""),this.storage=e;var a=this._zlevelList;this._prevDisplayList=[];var s,h,l,u,p,c,f,d,y=this._layers;n?(h=(s=t).width,l=s.height,null!=r.width&&(h=r.width),null!=r.height&&(l=r.height),this.dpr=r.devicePixelRatio||1,s.width=h*this.dpr,s.height=l*this.dpr,this._width=h,this._height=l,(u=new xl(s,this,this.dpr)).__builtin__=!0,u.initContext(),(y[bl]=u).zlevel=bl,a.push(bl),this._domRoot=t):(this._width=this._getSize(0),this._height=this._getSize(1),p=this._domRoot=(c=this._width,f=this._height,(d=document.createElement("div")).style.cssText=["position:relative","width:"+c+"px","height:"+f+"px","padding:0","margin:0","border-width:0"].join(";")+";",d),t.appendChild(p))}function Cl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Al(h,l,u){u=u||function(t,e){return t===e},h=h.slice();var p=(l=l.slice()).length,c=h.length,f=1,t=p+c,d=[{newPos:-1,components:[]}],e=Pl(d[0],l,h,0,u);if(d[0].newPos+1>=p&&c<=e+1){for(var r=[],i=0;i<l.length;i++)r.push(i);return[{indices:r,count:l.length,added:!1,removed:!1}]}for(;f<=t;){var n=function(){for(var t,e=-1*f;e<=f;e+=2){var r,i=d[e-1],n=d[e+1],o=(n?n.newPos:0)-e;i&&(d[e-1]=void 0);var a=i&&i.newPos+1<p,s=n&&0<=o&&o<c;if(a||s){if(!a||s&&i.newPos<n.newPos?Dl((r={newPos:(t=n).newPos,components:t.components.slice(0)}).components,!1,!0):((r=i).newPos++,Dl(r.components,!0,!1)),o=Pl(r,l,h,e,u),r.newPos+1>=p&&c<=o+1)return function(t){for(var e=0,r=t.length,i=0,n=0;e<r;e++){var o=t[e];if(o.removed){for(s=n;s<n+o.count;s++)o.indices.push(s);n+=o.count}else{for(var a=[],s=i;s<i+o.count;s++)a.push(s);o.indices=a,i+=o.count,o.added||(n+=o.count)}}return t}(r.components);d[e]=r}else d[e]=void 0}f++}();if(n)return n}}function Pl(t,e,r,i,n){for(var o=e.length,a=r.length,s=t.newPos,h=s-i,l=0;s+1<o&&h+1<a&&n(e[s+1],r[h+1]);)s++,h++,l++;return l&&t.components.push({count:l,added:!1,removed:!1,indices:[]}),t.newPos=s,h}function Dl(t,e,r){var i=t[t.length-1];i&&i.added===e&&i.removed===r?t[t.length-1]={count:i.count+1,added:e,removed:r,indices:[]}:t.push({count:1,added:e,removed:r,indices:[]})}var Ml="none",Ll=Math.round,Rl=Math.sin,zl=Math.cos,Il=Math.PI,Ol=2*Math.PI,Bl=180/Il;function El(t){return Ll(1e3*t)/1e3}function Fl(t){return Ll(1e4*t)/1e4}function Hl(t){return t<1e-4&&-1e-4<t}function Nl(t,e){e&&Wl(t,"transform","matrix("+El(e[0])+","+El(e[1])+","+El(e[2])+","+El(e[3])+","+Fl(e[4])+","+Fl(e[5])+")")}function Wl(t,e,r){r&&("linear"===r.type||"radial"===r.type)||t.setAttribute(e,r)}function Xl(t,e,r){var i,n,o,a,s,h,l,u,p=null==e.opacity?1:e.opacity;r instanceof Bo?t.style.opacity=p+"":(null!=(n=e.fill)&&n!==Ml?(Wl(t,"fill",i="transparent"===(i=e.fill)?Ml:i),Wl(t,"fill-opacity",(null!=e.fillOpacity?e.fillOpacity*p:p)+"")):Wl(t,"fill",Ml),null!=(u=e.stroke)&&u!==Ml?(Wl(t,"stroke",o="transparent"===(o=e.stroke)?Ml:o),a=e.lineWidth,Wl(t,"stroke-width",((s=e.strokeNoScale?r.getLineScale():1)?a/s:0)+""),Wl(t,"paint-order",e.strokeFirst?"stroke":"fill"),Wl(t,"stroke-opacity",(null!=e.strokeOpacity?e.strokeOpacity*p:p)+""),(h=e.lineDash&&0<a&&$h(e.lineDash,a))?(l=e.lineDashOffset,s&&1!==s&&(h=W(h,function(t){return t/s}),l=l&&Ll(l/=s)),Wl(t,"stroke-dasharray",h.join(",")),Wl(t,"stroke-dashoffset",(l||0)+"")):Wl(t,"stroke-dasharray",""),e.lineCap&&Wl(t,"stroke-linecap",e.lineCap),e.lineJoin&&Wl(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&Wl(t,"stroke-miterlimit",e.miterLimit+"")):Wl(t,"stroke",Ml))}var jl=(Yl.prototype.reset=function(){this._d=[],this._str=""},Yl.prototype.moveTo=function(t,e){this._add("M",t,e)},Yl.prototype.lineTo=function(t,e){this._add("L",t,e)},Yl.prototype.bezierCurveTo=function(t,e,r,i,n,o){this._add("C",t,e,r,i,n,o)},Yl.prototype.quadraticCurveTo=function(t,e,r,i){this._add("Q",t,e,r,i)},Yl.prototype.arc=function(t,e,r,i,n,o){this.ellipse(t,e,r,r,0,i,n,o)},Yl.prototype.ellipse=function(t,e,r,i,n,o,a,s){var h=0===this._d.length,l=a-o,u=!s,p=Math.abs(l),c=Hl(p-Ol)||(u?Ol<=l:Ol<=-l),f=!1,f=!!c||!Hl(p)&&Il<=(0<l?l%Ol:l%Ol+Ol)==!!u,d=Fl(t+r*zl(o)),y=Fl(e+i*Rl(o));c&&(l=u?Ol-1e-4:1e-4-Ol,f=!0,h&&this._d.push("M",d,y));var g=Fl(t+r*zl(o+l)),v=Fl(e+i*Rl(o+l));if(isNaN(d)||isNaN(y)||isNaN(r)||isNaN(i)||isNaN(n)||isNaN(Bl)||isNaN(g)||isNaN(v))return"";this._d.push("A",Fl(r),Fl(i),Ll(n*Bl),+f,+u,g,v)},Yl.prototype.rect=function(t,e,r,i){this._add("M",t,e),this._add("L",t+r,e),this._add("L",t+r,e+i),this._add("L",t,e+i),this._add("L",t,e)},Yl.prototype.closePath=function(){0<this._d.length&&this._add("Z")},Yl.prototype._add=function(t,e,r,i,n,o,a,s,h){this._d.push(t);for(var l=1;l<arguments.length;l++){var u=arguments[l];if(isNaN(u))return void(this._invalid=!0);this._d.push(Fl(u))}},Yl.prototype.generateStr=function(){this._str=this._invalid?"":this._d.join(" "),this._d=[]},Yl.prototype.getStr=function(){return this._str},Yl);function Yl(){}var Gl={brush:function(t){var e=t.style,r=t.__svgEl;r||(r=Cl("path"),t.__svgEl=r),t.path||t.createPathProxy();var i=t.path;t.shapeChanged()&&(i.beginPath(),t.buildPath(i,t.shape),t.pathUpdated());var n=i.getVersion(),o=t,a=o.__svgPathBuilder;(o.__svgPathVersion!==n||!a||t.style.strokePercent<1)&&((a=a||(o.__svgPathBuilder=new jl)).reset(),i.rebuildPath(a,t.style.strokePercent),a.generateStr(),o.__svgPathVersion=n),Wl(r,"d",a.getStr()),Xl(r,e,t),Nl(r,t.transform)}},ql={brush:function(t){var e,r,i,n,o,a,s,h=t.style,l=h.image;l instanceof HTMLImageElement?l=l.src:l instanceof HTMLCanvasElement&&(l=l.toDataURL()),l&&(e=h.x||0,r=h.y||0,i=h.width,n=h.height,(o=t.__svgEl)||(o=Cl("image"),t.__svgEl=o),l!==t.__imageSrc&&(a="href",s=l,o.setAttributeNS("http://www.w3.org/1999/xlink",a,s),t.__imageSrc=l),Wl(o,"width",i+""),Wl(o,"height",n+""),Wl(o,"x",e+""),Wl(o,"y",r+""),Xl(o,h,t),Nl(o,t.transform))}},Ul={left:"start",right:"end",center:"middle",middle:"middle"};var Vl={brush:function(t){var e,r,i,n,o,a,s,h,l,u,p=t.style,c=p.text;null!=c&&(c+=""),!c||isNaN(p.x)||isNaN(p.y)||((e=t.__svgEl)||(e=Cl("text"),r="xml:space",i="preserve",e.setAttributeNS("http://www.w3.org/XML/1998/namespace",r,i),t.__svgEl=e),n=p.font||mr,e.style.font=n,e.textContent=c,Xl(e,p,t),Nl(e,t.transform),o=p.x||0,s=p.y||0,h=Tr(n),"top"===(l=p.textBaseline)?s+=h/2:"bottom"===l&&(s-=h/2),a=s,u=Ul[p.textAlign]||p.textAlign,Wl(e,"dominant-baseline","central"),Wl(e,"text-anchor",u),Wl(e,"x",o+""),Wl(e,"y",a+""))}},Zl=(Kl.prototype.getDefs=function(t){var e=this._svgRoot,r=this._svgRoot.getElementsByTagName("defs");if(0!==r.length)return r[0];if(t){var i=e.insertBefore(this.createElement("defs"),e.firstChild);return i.contains||(i.contains=function(t){var e=i.children;if(!e)return!1;for(var r=e.length-1;0<=r;--r)if(e[r]===t)return!0;return!1}),i}return null},Kl.prototype.doUpdate=function(t,e){var r,i;t&&(r=this.getDefs(!1),t[this._domName]&&r.contains(t[this._domName])?"function"==typeof e&&e(t):(i=this.add(t))&&(t[this._domName]=i))},Kl.prototype.add=function(t){return null},Kl.prototype.addDom=function(t){var e=this.getDefs(!0);t.parentNode!==e&&e.appendChild(t)},Kl.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},Kl.prototype.getDoms=function(){var i=this.getDefs(!1);if(!i)return[];var n=[];return k(this._tagNames,function(t){for(var e=i.getElementsByTagName(t),r=0;r<e.length;r++)n.push(e[r])}),n},Kl.prototype.markAllUnused=function(){var t=this.getDoms(),e=this;k(t,function(t){t[e._markLabel]="0"})},Kl.prototype.markDomUsed=function(t){t&&(t[this._markLabel]="1")},Kl.prototype.markDomUnused=function(t){t&&(t[this._markLabel]="0")},Kl.prototype.isDomUnused=function(t){return t&&"1"!==t[this._markLabel]},Kl.prototype.removeUnused=function(){var e=this,r=this.getDefs(!1);r&&k(this.getDoms(),function(t){e.isDomUnused(t)&&r.removeChild(t)})},Kl.prototype.getSvgProxy=function(t){return t instanceof lo?Gl:t instanceof Bo?ql:t instanceof wa?Vl:Gl},Kl.prototype.getSvgElement=function(t){return t.__svgEl},Kl);function Kl(t,e,r,i,n){this.nextId=0,this._domName="_dom",this.createElement=Cl,this._zrId=t,this._svgRoot=e,this._tagNames="string"==typeof r?[r]:r,this._markLabel=i,n&&(this._domName=n)}function Ql(t){return"linear"===t.type}function $l(t){return"radial"===t.type}function Jl(t){return t&&("linear"===t.type||"radial"===t.type)}var tu,eu=(J(ru,tu=Zl),ru.prototype.addWithoutUpdate=function(a,s){var h;s&&s.style&&(h=this,k(["fill","stroke"],function(t){var e,r,i,n,o=s.style[t];Jl(o)&&(e=o,r=h.getDefs(!0),i=void 0,e.__dom?(i=e.__dom,r.contains(e.__dom)||h.addDom(i)):i=h.add(e),h.markUsed(s),n=i.getAttribute("id"),a.setAttribute(t,"url(#"+n+")"))}))},ru.prototype.add=function(t){var e;if(Ql(t))e=this.createElement("linearGradient");else{if(!$l(t))return g("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},ru.prototype.update=function(i){var n;Jl(i)&&(n=this).doUpdate(i,function(){var t,e,r=i.__dom;r&&(t=r.tagName,"linear"===(e=i.type)&&"linearGradient"===t||"radial"===e&&"radialGradient"===t?n.updateDom(i,i.__dom):(n.removeDom(i),n.add(i)))})},ru.prototype.updateDom=function(t,e){if(Ql(t))e.setAttribute("x1",t.x+""),e.setAttribute("y1",t.y+""),e.setAttribute("x2",t.x2+""),e.setAttribute("y2",t.y2+"");else{if(!$l(t))return void g("Illegal gradient type.");e.setAttribute("cx",t.x+""),e.setAttribute("cy",t.y+""),e.setAttribute("r",t.r+"")}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var r=t.colorStops,i=0,n=r.length;i<n;++i){var o=this.createElement("stop");o.setAttribute("offset",100*r[i].offset+"%");var a,s,h=r[i].color;-1<h.indexOf("rgba")?(a=Oe(h)[3],s=Ee(h),o.setAttribute("stop-color","#"+s),o.setAttribute("stop-opacity",a+"")):o.setAttribute("stop-color",r[i].color),e.appendChild(o)}t.__dom=e},ru.prototype.markUsed=function(t){var e;t.style&&((e=t.style.fill)&&e.__dom&&tu.prototype.markDomUsed.call(this,e.__dom),(e=t.style.stroke)&&e.__dom&&tu.prototype.markDomUsed.call(this,e.__dom))},ru);function ru(t,e){return tu.call(this,t,e,["linearGradient","radialGradient"],"__gradient_in_use__")||this}var iu=Math.round(9*Math.random());function nu(){this._id="__ec_inner_"+iu++}function ou(t){return t&&(t.image||t.svgElement)}var au,su=new(nu.prototype.get=function(t){return this._guard(t)[this._id]},nu.prototype.set=function(t,e){var r=this._guard(t);return"function"==typeof Object.defineProperty?Object.defineProperty(r,this._id,{value:e,enumerable:!1,configurable:!0}):r[this._id]=e,this},nu.prototype.delete=function(t){return!!this.has(t)&&(delete this._guard(t)[this._id],!0)},nu.prototype.has=function(t){return!!this._guard(t)[this._id]},nu.prototype._guard=function(t){if(t!==Object(t))throw TypeError("Value of WeakMap is not a non-null object.");return t},nu),hu=(J(lu,au=Zl),lu.prototype.addWithoutUpdate=function(o,a){var s;a&&a.style&&(s=this,k(["fill","stroke"],function(t){var e,r,i,n=a.style[t];ou(n)&&(e=s.getDefs(!0),(r=su.get(n))?e.contains(r)||s.addDom(r):r=s.add(n),s.markUsed(a),i=r.getAttribute("id"),o.setAttribute(t,"url(#"+i+")"))}))},lu.prototype.add=function(t){if(ou(t)){var e=this.createElement("pattern");return t.id=null==t.id?this.nextId++:t.id,e.setAttribute("id","zr"+this._zrId+"-pattern-"+t.id),e.setAttribute("x","0"),e.setAttribute("y","0"),e.setAttribute("patternUnits","userSpaceOnUse"),this.updateDom(t,e),this.addDom(e),e}},lu.prototype.update=function(e){var r;ou(e)&&(r=this).doUpdate(e,function(){var t=su.get(e);r.updateDom(e,t)})},lu.prototype.updateDom=function(t,e){var r=t.svgElement;if(r instanceof SVGElement)r.parentNode!==e&&(e.innerHTML="",e.appendChild(r),e.setAttribute("width",t.svgWidth+""),e.setAttribute("height",t.svgHeight+""));else{var i,n,o=void 0,a=e.getElementsByTagName("image");if(a.length){if(!t.image)return void e.removeChild(a[0]);o=a[0]}else t.image&&(o=this.createElement("image"));o&&(i=void 0,"string"==typeof t.image?i=t.image:t.image instanceof HTMLImageElement?i=t.image.src:t.image instanceof HTMLCanvasElement&&(i=t.image.toDataURL()),i&&(o.setAttribute("href",i),o.setAttribute("x","0"),o.setAttribute("y","0"),(n=_s(i,o,{dirty:function(){}},function(t){e.setAttribute("width",t.width+""),e.setAttribute("height",t.height+"")}))&&n.width&&n.height&&(e.setAttribute("width",n.width+""),e.setAttribute("height",n.height+"")),e.appendChild(o)))}var s="translate("+(t.x||0)+", "+(t.y||0)+") rotate("+(t.rotation||0)/Math.PI*180+") scale("+(t.scaleX||1)+", "+(t.scaleY||1)+")";e.setAttribute("patternTransform",s),su.set(t,e)},lu.prototype.markUsed=function(t){t.style&&(ou(t.style.fill)&&au.prototype.markDomUsed.call(this,su.get(t.style.fill)),ou(t.style.stroke)&&au.prototype.markDomUsed.call(this,su.get(t.style.stroke)))},lu);function lu(t,e){return au.call(this,t,e,["pattern"],"__pattern_in_use__")||this}function uu(t){var e=t.__clipPaths;return e&&0<e.length}var pu,cu=(J(fu,pu=Zl),fu.prototype.markAllUnused=function(){for(var t in pu.prototype.markAllUnused.call(this),this._refGroups)this.markDomUnused(this._refGroups[t]);this._keyDuplicateCount={}},fu.prototype._getClipPathGroup=function(t,e){if(uu(t)){var r=t.__clipPaths,i=this._keyDuplicateCount,n=function(t){var e=[];if(t)for(var r=0;r<t.length;r++){var i=t[r];e.push(i.id)}return e.join(",")}(r);return Qh(r,e&&e.__clipPaths)&&(i[n]=i[n]||0,i[n]&&(n+="-"+i[n]),i[n]++),this._refGroups[n]||(this._refGroups[n]=this.createElement("g"))}},fu.prototype.update=function(t,e){var r=this._getClipPathGroup(t,e);return r&&(this.markDomUsed(r),this.updateDom(r,t.__clipPaths)),r},fu.prototype.updateDom=function(t,e){var r,i,n,o,a;e&&0<e.length?(r=this.getDefs(!0),o=n=void 0,(i=e[0])._dom?(o=i._dom.getAttribute("id"),n=i._dom,r.contains(n)||r.appendChild(n)):(o="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,(n=this.createElement("clipPath")).setAttribute("id",o),r.appendChild(n),i._dom=n),this.getSvgProxy(i).brush(i),a=this.getSvgElement(i),n.innerHTML="",n.appendChild(a),t.setAttribute("clip-path","url(#"+o+")"),1<e.length&&this.updateDom(n,e.slice(1))):t&&t.setAttribute("clip-path","none")},fu.prototype.markUsed=function(t){var e=this;t.__clipPaths&&k(t.__clipPaths,function(t){t._dom&&pu.prototype.markDomUsed.call(e,t._dom)})},fu.prototype.removeUnused=function(){pu.prototype.removeUnused.call(this);var t={};for(var e in this._refGroups){var r=this._refGroups[e];this.isDomUnused(r)?r.parentNode&&r.parentNode.removeChild(r):t[e]=r}this._refGroups=t},fu);function fu(t,e){var r=pu.call(this,t,e,"clipPath","__clippath_in_use__")||this;return r._refGroups={},r._keyDuplicateCount={},r}var du,yu=(J(gu,du=Zl),gu.prototype._getFromPool=function(){var t,e=this._shadowDomPool.pop();return e||((e=this.createElement("filter")).setAttribute("id","zr"+this._zrId+"-shadow-"+this.nextId++),t=this.createElement("feDropShadow"),e.appendChild(t),this.addDom(e)),e},gu.prototype.update=function(t,e){var r,i,n,o,a,s,h=e.style;(s=h)&&(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)?(o=(n=e).style,a=n.getGlobalScale(),r=[o.shadowColor,(o.shadowBlur||0).toFixed(2),(o.shadowOffsetX||0).toFixed(2),(o.shadowOffsetY||0).toFixed(2),a[0],a[1]].join(","),(i=e._shadowDom=this._shadowDomMap[r])||(i=this._getFromPool(),this._shadowDomMap[r]=i),this.updateDom(t,e,i)):this.remove(t,e)},gu.prototype.remove=function(t,e){null!=e._shadowDom&&(e._shadowDom=null,t.style.filter="")},gu.prototype.updateDom=function(t,e,r){var i,n,o,a,s,h,l=r.children[0],u=e.style,p=e.getGlobalScale(),c=p[0],f=p[1];c&&f&&(i=u.shadowOffsetX||0,n=u.shadowOffsetY||0,o=u.shadowBlur,a=u.shadowColor,l.setAttribute("dx",i/c+""),l.setAttribute("dy",n/f+""),l.setAttribute("flood-color",a),s=o/2/c+" "+o/2/f,l.setAttribute("stdDeviation",s),r.setAttribute("x","-100%"),r.setAttribute("y","-100%"),r.setAttribute("width","300%"),r.setAttribute("height","300%"),h=(e._shadowDom=r).getAttribute("id"),t.style.filter="url(#"+h+")")},gu.prototype.removeUnused=function(){if(this.getDefs(!1)){var t=this._shadowDomPool;for(var e in this._shadowDomMap){var r=this._shadowDomMap[e];t.push(r)}this._shadowDomMap={}}},gu);function gu(t,e){var r=du.call(this,t,e,["filter"],"__filter_in_use__","_shadowDom")||this;return r._shadowDomMap={},r._shadowDomPool=[],r}function vu(t){return parseInt(t,10)}function _u(t){return t instanceof lo?Gl:t instanceof Bo?ql:t instanceof wa?Vl:Gl}function mu(t,e){return e&&t&&e.parentNode!==t}function xu(t,e,r){var i;mu(t,e)&&r&&((i=r.nextSibling)?t.insertBefore(e,i):t.appendChild(e))}function wu(t,e){var r;mu(t,e)&&((r=t.firstChild)?t.insertBefore(e,r):t.appendChild(e))}function bu(t){return t.__svgEl}var ku=(Su.prototype.getType=function(){return"svg"},Su.prototype.getViewportRoot=function(){return this._viewport},Su.prototype.getSvgDom=function(){return this._svgDom},Su.prototype.getSvgRoot=function(){return this._svgRoot},Su.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},Su.prototype.refresh=function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},Su.prototype.setBackgroundColor=function(t){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var e=Cl("rect");e.setAttribute("width",this.getWidth()),e.setAttribute("height",this.getHeight()),e.setAttribute("x",0),e.setAttribute("y",0),e.setAttribute("id",0),e.style.fill=t,this._backgroundRoot.appendChild(e),this._backgroundNode=e},Su.prototype.createSVGElement=Cl,Su.prototype.paintOne=function(t){var e=_u(t);return e&&e.brush(t),bu(t)},Su.prototype._paintList=function(t){var e=this._gradientManager,r=this._patternManager,i=this._clipPathManager,n=this._shadowManager;e.markAllUnused(),r.markAllUnused(),i.markAllUnused(),n.markAllUnused();for(var o=this._svgRoot,a=this._visibleList,s=t.length,h=[],l=0;l<s;l++){var u=_u(b=t[l]),p=bu(b);b.invisible||(!b.__dirty&&p||(u&&u.brush(b),(p=bu(b))&&b.style&&(e.update(b.style.fill),e.update(b.style.stroke),r.update(b.style.fill),r.update(b.style.stroke),n.update(p,b)),b.__dirty=0),p&&h.push(b))}for(var c,f,d,y,g,v,_,m=Al(a,h),l=0;l<m.length;l++)if((w=m[l]).removed)for(var x=0;x<w.count;x++)p=bu(b=a[w.indices[x]]),uu(b)?(g=p)&&g.parentNode&&g.parentNode.removeChild(g):(d=o,(y=p)&&d&&y.parentNode===d&&d.removeChild(y));for(var w,l=0;l<m.length;l++)if(!(w=m[l]).removed)for(x=0;x<w.count;x++){var b=h[w.indices[x]],k=i.update(b,v);k!==_&&(c=f,k&&(c?xu(o,k,c):wu(o,k),f=k,c=null),_=k),p=bu(b),c?xu(_||o,p,c):wu(_||o,p),c=p||c,_||(f=c),e.markUsed(b),e.addWithoutUpdate(p,b),r.markUsed(b),r.addWithoutUpdate(p,b),i.markUsed(b),v=b}e.removeUnused(),r.removeUnused(),i.removeUnused(),n.removeUnused(),this._visibleList=h},Su.prototype._getDefs=function(t){var e=this._svgDom,r=e.getElementsByTagName("defs");if(0!==r.length)return r[0];if(t){var i=e.insertBefore(Cl("defs"),e.firstChild);return i.contains||(i.contains=function(t){var e=i.children;if(!e)return!1;for(var r=e.length-1;0<=r;--r)if(e[r]===t)return!0;return!1}),i}return null},Su.prototype.resize=function(t,e){var r=this._viewport;r.style.display="none";var i,n,o=this._opts;null!=t&&(o.width=t),null!=e&&(o.height=e),t=this._getSize(0),e=this._getSize(1),r.style.display="",this._width===t&&this._height===e||(this._width=t,this._height=e,(i=r.style).width=t+"px",i.height=e+"px",(n=this._svgDom).setAttribute("width",t+""),n.setAttribute("height",e+"")),this._backgroundNode&&(this._backgroundNode.setAttribute("width",t),this._backgroundNode.setAttribute("height",e))},Su.prototype.getWidth=function(){return this._width},Su.prototype.getHeight=function(){return this._height},Su.prototype._getSize=function(t){var e=this._opts,r=["width","height"][t],i=["clientWidth","clientHeight"][t],n=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(null!=e[r]&&"auto"!==e[r])return parseFloat(e[r]);var a=this.root,s=document.defaultView.getComputedStyle(a);return(a[i]||vu(s[r])||vu(a.style[r]))-(vu(s[n])||0)-(vu(s[o])||0)|0},Su.prototype.dispose=function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},Su.prototype.clear=function(){var t=this._viewport;t&&t.parentNode&&t.parentNode.removeChild(t)},Su.prototype.toDataURL=function(){this.refresh();var t=this._svgDom,e=t.outerHTML||(t.parentNode&&t.parentNode).innerHTML;return"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(e.replace(/></g,">\n\r<"))},Su);function Su(t,e,r,i){this.type="svg",this.refreshHover=Tu("refreshHover"),this.pathToImage=Tu("pathToImage"),this.configLayer=Tu("configLayer"),this.root=t,this.storage=e,this._opts=r=m({},r||{});var n=Cl("svg");n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),n.setAttribute("version","1.1"),n.setAttribute("baseProfile","full"),n.style.cssText="user-select:none;position:absolute;left:0;top:0;";var o=Cl("g");n.appendChild(o);var a=Cl("g");n.appendChild(a),this._gradientManager=new eu(i,a),this._patternManager=new hu(i,a),this._clipPathManager=new cu(i,a),this._shadowManager=new yu(i,a);var s=document.createElement("div");s.style.cssText="overflow:hidden;position:relative",this._svgDom=n,this._svgRoot=a,this._backgroundRoot=o,this._viewport=s,t.appendChild(s),s.appendChild(n),this.resize(r.width,r.height),this._visibleList=[]}function Tu(t){return function(){g('In SVG mode painter not support method "'+t+'"')}}zi("canvas",Sl),zi("svg",ku),t.Arc=Gs,t.BezierCurve=Qs,t.BoundingRect=dr,t.Circle=No,t.CompoundPath=ps,t.Droplet=eh,t.Element=Br,t.Ellipse=Qo,t.Group=Ci,t.Heart=oh,t.Image=Bo,t.IncrementalDisplayable=ys,t.Isogon=ch,t.Line=ra,t.LinearGradient=va,t.OrientedBoundingRect=qh,t.Path=lo,t.Pattern=Wh,t.Point=nr,t.Polygon=ha,t.Polyline=ca,t.RadialGradient=Hh,t.Rect=Uo,t.Ring=gh,t.Rose=kh,t.Sector=Qa,t.Star=Mh,t.TSpan=wa,t.Text=Is,t.Trochoid=Bh,t.color=Xe,t.dispose=function(t){t.dispose()},t.disposeAll=function(){for(var t in Mi)Mi.hasOwnProperty(t)&&Mi[t].dispose();Mi={}},t.getInstance=function(t){return Mi[t]},t.init=function(t,e){var r=new Li(y(),t,e);return Mi[r.id]=r},t.matrix=oe,t.morphPath=function(t,e,r){var i,n;if(!t||!e)return e;t.path||t.createPathProxy(),(i=t.path).beginPath(),t.buildPath(i,t.shape),e.path||e.createPathProxy(),(n=e.path)===i&&(n=new Wn(!1)),n.beginPath(),ls(e)?e.__oldBuildPath(n,e.shape):e.buildPath(n,e.shape);var o=ns(rs(i),rs(n)),a=as(o[0],o[1],10,Math.PI);!function(t,e,r){if(ls(t))return hs(t,e,r);var i=t;i.__oldBuildPath=i.buildPath,i.buildPath=ss,hs(i,e,r)}(e,a,0);var s=r&&r.done,h=r&&r.aborted,l=r&&r.during;return e.animateTo({__morphT:1},x({during:function(t){e.dirtyShape(),l&&l(t)},done:function(){var t;ls(t=e)&&(t.buildPath=t.__oldBuildPath,t.__oldBuildPath=t.__morphingData=null),e.createPathProxy(),e.dirtyShape(),s&&s()},aborted:function(){h&&h()}},r)),e},t.parseSVG=function(t,e){return(new Ta).parse(t,e)},t.path=Ro,t.registerPainter=zi,t.showDebugDirtyRect=function(t,n){n=n||{};var e=t.painter;if(!e.getLayers)throw new Error("Debug dirty rect can only been used on canvas renderer.");if(e.isSingleCanvas())throw new Error("Debug dirty rect can only been used on zrender inited with container.");var o=document.createElement("div");o.style.cssText="\nposition:absolute;\nleft:0;\ntop:0;\nright:0;\nbottom:0;\npointer-events:none;\n",o.className="ec-debug-dirty-rect-container";var a=[],r=t.dom;r.appendChild(o),"static"===getComputedStyle(r).position&&(r.style.position="relative"),t.on("rendered",function(){if(e.getLayers){var i=0;e.eachBuiltinLayer(function(t){if(t.debugGetPaintRects)for(var e=t.debugGetPaintRects(),r=0;r<e.length;r++)e[r].width&&e[r].height&&(a[i]||(a[i]=new Vh(n.style),o.appendChild(a[i].dom)),a[i].show(n.autoHideDelay),a[i].update(e[r]),i++)});for(var t=i;t<a.length;t++)a[t].hide()}})},t.util=Q,t.vector=gt,t.version="5.0.4",Object.defineProperty(t,"__esModule",{value:!0})}); |