import{_ as t}from"./tslib.ZseNXxlj.js";var e=function(){return function(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}}(),r=new(function(){return function(){this.browser=new e,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow="undefined"!=typeof window}}());"object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?(r.wxa=!0,r.touchEventsSupported=!0):"undefined"==typeof document&&"undefined"!=typeof self?r.worker=!0:!r.hasGlobalWindow||"Deno"in window?(r.node=!0,r.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=+o[1].split(".")[0]>18);a&&(r.weChat=!0);e.svgSupported="undefined"!=typeof SVGRect,e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported="undefined"!=typeof document;var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}(navigator.userAgent,r);var i="sans-serif",n="12px "+i;var o=function(t){var e={};if("undefined"==typeof JSON)return e;for(var r=0;r=0)u=l*r.length;else for(var f=0;f>1)%2;a.style.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[s]+":0",n[h]+":0",i[1-s]+":auto",n[1-h]+":auto",""].join("!important;"),t.appendChild(a),r.push(a)}return r}(e,a),h=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(),f=2*l,c=u.left,p=u.top;a.push(c,p),h=h&&o&&c===o[f]&&p===o[f+1],s.push(t[l].offsetLeft,t[l].offsetTop)}return h&&n?n:(e.srcCoords=a,e[i]=r?Nt(s,a):Nt(a,s))}(s,a,o);if(h)return h(t,i,n),!0}return!1}function Yt(t){return"CANVAS"===t.nodeName.toUpperCase()}var qt=/([&<>"'])/g,jt={"&":"&","<":"<",">":">",'"':""","'":"'"};function Vt(t){return null==t?"":(t+"").replace(qt,function(t,e){return jt[e]})}var Ut=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Zt=[],Gt=r.browser.firefox&&+r.browser.version.split(".")[0]<39;function Kt(t,e,r,i){return r=r||{},i?Qt(t,e,r):Gt&&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):Qt(t,e,r),r}function Qt(t,e,i){if(r.domSupported&&t.getBoundingClientRect){var n=e.clientX,o=e.clientY;if(Yt(t)){var a=t.getBoundingClientRect();return i.zrX=n-a.left,void(i.zrY=o-a.top)}if(Xt(Zt,t,n,o))return i.zrX=Zt[0],void(i.zrY=Zt[1])}i.zrX=i.zrY=0}function $t(t){return t||window.event}function Jt(t,e,r){if(null!=(e=$t(e)).zrX)return e;var i=e.type;if(i&&i.indexOf("touch")>=0){var n="touchend"!==i?e.targetTouches[0]:e.changedTouches[0];n&&Kt(t,n,e,r)}else{Kt(t,e,e,r);var o=function(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,i=t.deltaY;if(null==r||null==i)return e;return 3*(0!==i?Math.abs(i):Math.abs(r))*(i>0?-1:i<0?1:r>0?-1:1)}(e);e.zrDelta=o?o/120:-(e.detail||0)/3}var a=e.button;return null==e.which&&void 0!==a&&Ut.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function te(t,e,r,i){t.addEventListener(e,r,i)}function ee(t,e,r,i){t.removeEventListener(e,r,i)}var re=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function ie(t){return 2===t.which||3===t.which}var ne=function(){function t(){this._track=[]}return t.prototype.recognize=function(t,e,r){return this._doTrack(t,e,r),this._recognize(t)},t.prototype.clear=function(){return this._track.length=0,this},t.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;o1&&n&&n.length>1){var a=oe(n)/oe(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}}}}};function se(){return[1,0,0,1,0,0]}function he(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function le(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 ue(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 fe(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 ce(t,e,r,i){void 0===i&&(i=[0,0]);var n=e[0],o=e[2],a=e[4],s=e[1],h=e[3],l=e[5],u=Math.sin(r),f=Math.cos(r);return t[0]=n*f+s*u,t[1]=-n*u+s*f,t[2]=o*f+h*u,t[3]=-o*u+f*h,t[4]=f*(a-i[0])+u*(l-i[1])+i[0],t[5]=f*(l-i[1])-u*(a-i[0])+i[1],t}function pe(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 de(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}function ve(t){var e=[1,0,0,1,0,0];return le(e,t),e}var ye=function(){function t(t,e){this.x=t||0,this.y=e||0}return t.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},t.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.scale=function(t){this.x*=t,this.y*=t},t.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},t.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},t.prototype.distance=function(t){var e=this.x-t.x,r=this.y-t.y;return Math.sqrt(e*e+r*r)},t.prototype.distanceSquare=function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(t){if(t){var e=this.x,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}},t.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},t.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},t.set=function(t,e,r){t.x=e,t.y=r},t.copy=function(t,e){t.x=e.x,t.y=e.y},t.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.lenSquare=function(t){return t.x*t.x+t.y*t.y},t.dot=function(t,e){return t.x*e.x+t.y*e.y},t.add=function(t,e,r){t.x=e.x+r.x,t.y=e.y+r.y},t.sub=function(t,e,r){t.x=e.x-r.x,t.y=e.y-r.y},t.scale=function(t,e,r){t.x=e.x*r,t.y=e.y*r},t.scaleAndAdd=function(t,e,r,i){t.x=e.x+r.x*i,t.y=e.y+r.y*i},t.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},t}(),ge=Math.min,_e=Math.max,me=new ye,xe=new ye,we=new ye,be=new ye,ke=new ye,Se=new ye,Te=function(){function t(t,e,r,i){r<0&&(t+=r,r=-r),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=r,this.height=i}return t.prototype.union=function(t){var e=ge(t.x,this.x),r=ge(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=_e(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=_e(t.y+t.height,this.y+this.height)-r:this.height=t.height,this.x=e,this.y=r},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(t){var e=this,r=t.width/e.width,i=t.height/e.height,n=[1,0,0,1,0,0];return fe(n,n,[-e.x,-e.y]),pe(n,n,[r,i]),fe(n,n,[t.x,t.y]),n},t.prototype.intersect=function(e,r){if(!e)return!1;e instanceof t||(e=t.create(e));var i=this,n=i.x,o=i.x+i.width,a=i.y,s=i.y+i.height,h=e.x,l=e.x+e.width,u=e.y,f=e.y+e.height,c=!(od&&(d=m,vd&&(d=x,g<_?ye.set(Se,0,-g):ye.set(Se,0,_)):m=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return 0===this.width||0===this.height},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},t.applyTransform=function(e,r,i){if(i){if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],o=i[3],a=i[4],s=i[5];return e.x=r.x*n+a,e.y=r.y*o+s,e.width=r.width*n,e.height=r.height*o,e.width<0&&(e.x+=e.width,e.width=-e.width),void(e.height<0&&(e.y+=e.height,e.height=-e.height))}me.x=we.x=r.x,me.y=be.y=r.y,xe.x=be.x=r.x+r.width,xe.y=we.y=r.y+r.height,me.transform(i),be.transform(i),xe.transform(i),we.transform(i),e.x=ge(me.x,xe.x,we.x,be.x),e.y=ge(me.y,xe.y,we.y,be.y);var h=_e(me.x,xe.x,we.x,be.x),l=_e(me.y,xe.y,we.y,be.y);e.width=h-e.x,e.height=l-e.y}else e!==r&&t.copy(e,r)},t}(),Ce="silent";function Pe(){re(this.event)}var Me=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.handler=null,t}return t(r,e),r.prototype.dispose=function(){},r.prototype.setCursor=function(){},r}(Ot),Ae=function(){return function(t,e){this.x=t,this.y=e}}(),Le=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Ie=new Te(0,0,0,0),De=function(e){function r(t,r,i,n,o){var a=e.call(this)||this;return a._hovered=new Ae(0,0),a.storage=t,a.painter=r,a.painterRoot=n,a._pointerSize=o,i=i||new Me,a.proxy=null,a.setHandlerProxy(i),a._draggingMgr=new Rt(a),a}return t(r,e),r.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(L(Le,function(e){t.on&&t.on(e,this[e],this)},this),t.handler=this),this.proxy=t},r.prototype.mousemove=function(t){var e=t.zrX,r=t.zrY,i=Oe(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 Ae(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)},r.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})},r.prototype.resize=function(){this._hovered=new Ae(0,0)},r.prototype.dispatch=function(t,e){var r=this[t];r&&r.call(this,e)},r.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},r.prototype.setCursorStyle=function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},r.prototype.dispatchToElement=function(t,e,r){var i=(t=t||{}).target;if(!i||!i.silent){for(var n="on"+e,o=function(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:Pe}}(e,t,r);i&&(i[n]&&(o.cancelBubble=!!i[n].call(i,o)),i.trigger(e,o),i=i.__hostTarget?i.__hostTarget:i.parent,!o.cancelBubble););o.cancelBubble||(this.trigger(e,o),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(t){"function"==typeof t[n]&&t[n].call(t,o),t.trigger&&t.trigger(e,o)}))}},r.prototype.findHover=function(t,e,r){var i=this.storage.getDisplayList(),n=new Ae(t,e);if(Re(i,n,t,e,r),this._pointerSize&&!n.target){for(var o=[],a=this._pointerSize,s=a/2,h=new Te(t-s,e-s,a,a),l=i.length-1;l>=0;l--){var u=i[l];u===r||u.ignore||u.ignoreCoarsePointer||u.parent&&u.parent.ignoreCoarsePointer||(Ie.copy(u.getBoundingRect()),u.transform&&Ie.applyTransform(u.transform),Ie.intersect(h)&&o.push(u))}if(o.length)for(var f=Math.PI/12,c=2*Math.PI,p=0;p=0;o--){var a=t[o],s=void 0;if(a!==n&&!a.ignore&&(s=ze(a,r,i))&&(!e.topTarget&&(e.topTarget=a),s!==Ce)){e.target=a;break}}}function Oe(t,e,r){var i=t.painter;return e<0||e>i.getWidth()||r<0||r>i.getHeight()}L(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){De.prototype[t]=function(e){var r,i,n=e.zrX,o=e.zrY,a=Oe(this,n,o);if("mouseup"===t&&a||(i=(r=this.findHover(n,o)).target),"mousedown"===t)this._downEl=i,this._downPoint=[e.zrX,e.zrY],this._upEl=i;else if("mouseup"===t)this._upEl=i;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||Pt(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(r,t,e)}});function Fe(t,e,r,i){var n=e+1;if(n===r)return 1;if(i(t[n++],t[e])<0){for(;n=0;)n++;return n-e}function Be(t,e,r,i,n){for(i===e&&i++;i>>1])<0?h=o:s=o+1;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(;l>0;)t[s+l]=t[s+l-1],l--}t[s]=a}}function Ne(t,e,r,i,n,o){var a=0,s=0,h=1;if(o(t,e[r+n])>0){for(s=i-n;h0;)a=h,(h=1+(h<<1))<=0&&(h=s);h>s&&(h=s),a+=n,h+=n}else{for(s=n+1;hs&&(h=s);var l=a;a=n-h,h=n-l}for(a++;a>>1);o(t,e[r+u])>0?a=u+1:h=u}return h}function He(t,e,r,i,n,o){var a=0,s=0,h=1;if(o(t,e[r+n])<0){for(s=n+1;hs&&(h=s);var l=a;a=n-h,h=n-l}else{for(s=i-n;h=0;)a=h,(h=1+(h<<1))<=0&&(h=s);h>s&&(h=s),a+=n,h+=n}for(a++;a>>1);o(t,e[r+u])<0?h=u:a=u+1}return h}function We(t,e){var r,i,n=7,o=0,a=[];function s(s){var h=r[s],l=i[s],u=r[s+1],f=i[s+1];i[s]=l+f,s===o-3&&(r[s+1]=r[s+2],i[s+1]=i[s+2]),o--;var c=He(t[u],t,h,l,0,e);h+=c,0!==(l-=c)&&0!==(f=Ne(t[h+l-1],t,u,f,f-1,e))&&(l<=f?function(r,i,o,s){var h=0;for(h=0;h=7||p>=7);if(d)break;v<0&&(v=0),v+=2}if((n=v)<1&&(n=1),1===i){for(h=0;h=0;h--)t[p+h]=t[c+h];return void(t[f]=a[u])}var d=n;for(;;){var v=0,y=0,g=!1;do{if(e(a[u],t[l])<0){if(t[f--]=t[l--],v++,y=0,0===--i){g=!0;break}}else if(t[f--]=a[u--],y++,v=0,1===--s){g=!0;break}}while((v|y)=0;h--)t[p+h]=t[c+h];if(0===i){g=!0;break}}if(t[f--]=a[u--],1===--s){g=!0;break}if(0!==(y=s-Ne(t[l],a,0,s,s-1,e))){for(s-=y,p=(f-=y)+1,c=(u-=y)+1,h=0;h=7||y>=7);if(g)break;d<0&&(d=0),d+=2}(n=d)<1&&(n=1);if(1===s){for(p=(f-=i)+1,c=(l-=i)+1,h=i-1;h>=0;h--)t[p+h]=t[c+h];t[f]=a[u]}else{if(0===s)throw new Error;for(c=f-(s-1),h=0;h1;){var t=o-2;if(t>=1&&i[t-1]<=i[t]+i[t+1]||t>=2&&i[t-2]<=i[t]+i[t-1])i[t-1]i[t+1])break;s(t)}},forceMergeRuns:function(){for(;o>1;){var t=o-2;t>0&&i[t-1]=32;)e|=1&t,t>>=1;return t+e}(n);do{if((o=Fe(t,r,i,e))s&&(h=s),Be(t,r,r+h,r+o,e),o=h}a.pushRun(r,o),a.mergeRuns(),n-=o,r+=o}while(0!==n);a.forceMergeRuns()}}}var Xe=!1;function Ye(){Xe||(Xe=!0)}function qe(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var je,Ve=function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=qe}return t.prototype.traverse=function(t,e){for(var r=0;r0&&(l.__clipPaths=[]),isNaN(l.z)&&(Ye(),l.z=0),isNaN(l.z2)&&(Ye(),l.z2=0),isNaN(l.zlevel)&&(Ye(),l.zlevel=0),this._displayList[this._displayListLen++]=l}var u=t.getDecalElement&&t.getDecalElement();u&&this._updateAndAddDisplayable(u,e,r);var f=t.getTextGuideLine();f&&this._updateAndAddDisplayable(f,e,r);var c=t.getTextContent();c&&this._updateAndAddDisplayable(c,e,r)}},t.prototype.addRoot=function(t){t.__zr&&t.__zr.storage===this||this._roots.push(t)},t.prototype.delRoot=function(t){if(t instanceof Array)for(var e=0,r=t.length;e=0&&this._roots.splice(i,1)}},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t}();je=r.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};var Ue={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:(!r||r<1?(r=1,e=.1):e=.4*Math.asin(1/r)/(2*Math.PI),-r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))},elasticOut:function(t){var e,r=.1;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=.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,i=.4;return 0===t?0:1===t?1:(!r||r<1?(r=1,e=.1):e=i*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-Ue.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*Ue.bounceIn(2*t):.5*Ue.bounceOut(2*t-1)+.5}},Ze=Math.pow,Ge=Math.sqrt,Ke=1e-8,Qe=1e-4,$e=Ge(3),Je=1/3,tr=yt(),er=yt(),rr=yt();function ir(t){return t>-1e-8&&tKe||t<-1e-8}function or(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 ar(t,e,r,i,n){var o=1-n;return 3*(((e-t)*o+2*(r-e)*n)*o+(i-r)*n*n)}function sr(t,e,r,i,n,o){var a=i+3*(e-r)-t,s=3*(r-2*e+t),h=3*(e-t),l=t-n,u=s*s-3*a*h,f=s*h-9*a*l,c=h*h-3*s*l,p=0;if(ir(u)&&ir(f)){if(ir(s))o[0]=0;else(S=-h/s)>=0&&S<=1&&(o[p++]=S)}else{var d=f*f-4*u*c;if(ir(d)){var v=f/u,y=-v/2;(S=-s/a+v)>=0&&S<=1&&(o[p++]=S),y>=0&&y<=1&&(o[p++]=y)}else if(d>0){var g=Ge(d),_=u*s+1.5*a*(-f+g),m=u*s+1.5*a*(-f-g);(S=(-s-((_=_<0?-Ze(-_,Je):Ze(_,Je))+(m=m<0?-Ze(-m,Je):Ze(m,Je))))/(3*a))>=0&&S<=1&&(o[p++]=S)}else{var x=(2*u*s-3*a*f)/(2*Ge(u*u*u)),w=Math.acos(x)/3,b=Ge(u),k=Math.cos(w),S=(-s-2*b*k)/(3*a),T=(y=(-s+b*(k+$e*Math.sin(w)))/(3*a),(-s+b*(k-$e*Math.sin(w)))/(3*a));S>=0&&S<=1&&(o[p++]=S),y>=0&&y<=1&&(o[p++]=y),T>=0&&T<=1&&(o[p++]=T)}}return p}function hr(t,e,r,i,n){var o=6*r-12*e+6*t,a=9*e+3*i-3*t-9*r,s=3*e-3*t,h=0;if(ir(a)){if(nr(o))(u=-s/o)>=0&&u<=1&&(n[h++]=u)}else{var l=o*o-4*a*s;if(ir(l))n[0]=-o/(2*a);else if(l>0){var u,f=Ge(l),c=(-o-f)/(2*a);(u=(-o+f)/(2*a))>=0&&u<=1&&(n[h++]=u),c>=0&&c<=1&&(n[h++]=c)}}return h}function lr(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,f=(u-l)*n+l;o[0]=t,o[1]=a,o[2]=l,o[3]=f,o[4]=f,o[5]=u,o[6]=h,o[7]=i}function ur(t,e,r,i,n,o,a,s,h,l,u){var f,c,p,d,v,y=.005,g=Infinity;tr[0]=h,tr[1]=l;for(var _=0;_<1;_+=.05)er[0]=or(t,r,n,a,_),er[1]=or(e,i,o,s,_),(d=Mt(tr,er))=0&&d=0&&y=1?1:sr(0,i,o,1,t,s)&&or(0,n,a,1,s[0])}}}var xr=function(){function t(t){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=t.life||1e3,this._delay=t.delay||0,this.loop=t.loop||!1,this.onframe=t.onframe||dt,this.ondestroy=t.ondestroy||dt,this.onrestart=t.onrestart||dt,t.easing&&this.setEasing(t.easing)}return t.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),!this._paused){var r=this._life,i=t-this._startTime-this._pausedTime,n=i/r;n<0&&(n=0),n=Math.min(n,1);var o=this.easingFunc,a=o?o(n):n;if(this.onframe(a),1===n){if(!this.loop)return!0;var s=i%r;this._startTime=t-s,this._pausedTime=0,this.onrestart()}return!1}this._pausedTime+=e},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(t){this.easing=t,this.easingFunc=H(t)?t:Ue[t]||mr(t)},t}(),wr=function(){return function(t){this.value=t}}(),br=function(){function t(){this._len=0}return t.prototype.insert=function(t){var e=new wr(t);return this.insertEntry(e),e},t.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},t.prototype.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t}(),kr=function(){function t(t){this._list=new br,this._maxSize=10,this._map={},this._maxSize=t}return t.prototype.put=function(t,e){var r=this._list,i=this._map,n=null;if(null==i[t]){var o=r.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var s=r.head;r.remove(s),delete i[s.key],n=s.value,this._lastRemovedEntry=s}a?a.value=e:a=new wr(e),a.key=t,r.insertEntry(a),i[t]=a}return n},t.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},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t}(),Sr={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 Tr(t){return(t=Math.round(t))<0?0:t>255?255:t}function Cr(t){return t<0?0:t>1?1:t}function Pr(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Tr(parseFloat(e)/100*255):Tr(parseInt(e,10))}function Mr(t){var e=t;return e.length&&"%"===e.charAt(e.length-1)?Cr(parseFloat(e)/100):Cr(parseFloat(e))}function Ar(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function Lr(t,e,r){return t+(e-t)*r}function Ir(t,e,r,i,n){return t[0]=e,t[1]=r,t[2]=i,t[3]=n,t}function Dr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var zr=new kr(20),Rr=null;function Or(t,e){Rr&&Dr(Rr,e),Rr=zr.put(t,Rr||e.slice())}function Fr(t,e){if(t){e=e||[];var r=zr.get(t);if(r)return Dr(e,r);var i=(t+="").replace(/ /g,"").toLowerCase();if(i in Sr)return Dr(e,Sr[i]),Or(t,e),e;var n,o=i.length;if("#"===i.charAt(0))return 4===o||5===o?(n=parseInt(i.slice(1,4),16))>=0&&n<=4095?(Ir(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),Or(t,e),e):void Ir(e,0,0,0,1):7===o||9===o?(n=parseInt(i.slice(1,7),16))>=0&&n<=16777215?(Ir(e,(16711680&n)>>16,(65280&n)>>8,255&n,9===o?parseInt(i.slice(7),16)/255:1),Or(t,e),e):void Ir(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?Ir(e,+l[0],+l[1],+l[2],1):Ir(e,0,0,0,1);u=Mr(l.pop());case"rgb":return l.length>=3?(Ir(e,Pr(l[0]),Pr(l[1]),Pr(l[2]),3===l.length?u:Mr(l[3])),Or(t,e),e):void Ir(e,0,0,0,1);case"hsla":return 4!==l.length?void Ir(e,0,0,0,1):(l[3]=Mr(l[3]),Br(l,e),Or(t,e),e);case"hsl":return 3!==l.length?void Ir(e,0,0,0,1):(Br(l,e),Or(t,e),e);default:return}}Ir(e,0,0,0,1)}}function Br(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=Mr(t[1]),n=Mr(t[2]),o=n<=.5?n*(i+1):n+i-n*i,a=2*n-o;return Ir(e=e||[],Tr(255*Ar(a,o,r+1/3)),Tr(255*Ar(a,o,r)),Tr(255*Ar(a,o,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function Nr(t,e){var r=Fr(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,r[i]>255?r[i]=255:r[i]<0&&(r[i]=0);return Yr(r,4===r.length?"rgba":"rgb")}}function Hr(t,e,r){if(e&&e.length&&t>=0&&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]=Tr(Lr(a[0],s[0],h)),r[1]=Tr(Lr(a[1],s[1],h)),r[2]=Tr(Lr(a[2],s[2],h)),r[3]=Cr(Lr(a[3],s[3],h)),r}}function Wr(t,e,r){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),n=Math.floor(i),o=Math.ceil(i),a=Fr(e[n]),s=Fr(e[o]),h=i-n,l=Yr([Tr(Lr(a[0],s[0],h)),Tr(Lr(a[1],s[1],h)),Tr(Lr(a[2],s[2],h)),Cr(Lr(a[3],s[3],h))],"rgba");return r?{color:l,leftIndex:n,rightIndex:o,value:i}:l}}function Er(t,e,r,i){var n,o=Fr(t);if(t)return o=function(t){if(t){var e,r,i=t[0]/255,n=t[1]/255,o=t[2]/255,a=Math.min(i,n,o),s=Math.max(i,n,o),h=s-a,l=(s+a)/2;if(0===h)e=0,r=0;else{r=l<.5?h/(s+a):h/(2-s-a);var u=((s-i)/6+h/2)/h,f=((s-n)/6+h/2)/h,c=((s-o)/6+h/2)/h;i===s?e=c-f:n===s?e=1/3+u-c:o===s&&(e=2/3+f-u),e<0&&(e+=1),e>1&&(e-=1)}var p=[360*e,r,l];return null!=t[3]&&p.push(t[3]),p}}(o),null!=e&&(o[0]=(n=e,(n=Math.round(n))<0?0:n>360?360:n)),null!=r&&(o[1]=Mr(r)),null!=i&&(o[2]=Mr(i)),Yr(Br(o),"rgba")}function Xr(t,e){var r=Fr(t);if(r&&null!=e)return r[3]=Cr(e),Yr(r,"rgba")}function Yr(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 qr(t,e){var r=Fr(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var jr=new kr(100);function Vr(t){if(W(t)){var e=jr.get(t);return e||(e=Nr(t,-.1),jr.put(t,e)),e}if(U(t)){var r=S({},t);return r.colorStops=I(t.colorStops,function(t){return{offset:t.offset,color:Nr(t.color,-.1)}}),r}return t}var Ur=Math.round;function Zr(t){var e;if(t&&"transparent"!==t){if("string"==typeof t&&t.indexOf("rgba")>-1){var r=Fr(t);r&&(t="rgb("+r[0]+","+r[1]+","+r[2]+")",e=r[3])}}else t="none";return{color:t,opacity:null==e?1:e}}var Gr=1e-4;function Kr(t){return t-1e-4}function Qr(t){return Ur(1e3*t)/1e3}function $r(t){return Ur(1e4*t)/1e4}var Jr={left:"start",right:"end",center:"middle",middle:"middle"};function ti(t){return t&&!!t.image}function ei(t){return ti(t)||function(t){return t&&!!t.svgElement}(t)}function ri(t){return"linear"===t.type}function ii(t){return"radial"===t.type}function ni(t){return t&&("linear"===t.type||"radial"===t.type)}function oi(t){return"url(#"+t+")"}function ai(t){var e=t.getGlobalScale(),r=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(r)/Math.log(10)),1)}function si(t){var e=t.x||0,r=t.y||0,i=(t.rotation||0)*vt,n=Q(t.scaleX,1),o=Q(t.scaleY,1),a=t.skewX||0,s=t.skewY||0,h=[];return(e||r)&&h.push("translate("+e+"px,"+r+"px)"),i&&h.push("rotate("+i+")"),1===n&&1===o||h.push("scale("+n+","+o+")"),(a||s)&&h.push("skew("+Ur(a*vt)+"deg, "+Ur(s*vt)+"deg)"),h.join(" ")}var hi=r.hasGlobalWindow&&H(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:"undefined"!=typeof Buffer?function(t){return Buffer.from(t).toString("base64")}:function(t){return null},li=Array.prototype.slice;function ui(t,e,r){return(e-t)*r+t}function fi(t,e,r,i){for(var n=e.length,o=0;oi?e:t,o=Math.min(r,i),a=n[o-1]||{color:[0,0,0,0],offset:0},s=o;sa)i.length=a;else for(var s=o;s=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(t,e,r){this._needsSort=!0;var i=this.keyframes,n=i.length,o=!1,a=6,s=e;if(A(e)){var h=function(t){return A(t&&t[0])?2:1}(e);a=h,(1===h&&!X(e[0])||2===h&&!X(e[0][0]))&&(o=!0)}else if(X(e)&&!G(e))a=0;else if(W(e))if(isNaN(+e)){var l=Fr(e);l&&(s=l,a=3)}else a=0;else if(U(e)){var u=S({},s);u.colorStops=I(e.colorStops,function(t){return{offset:t.offset,color:Fr(t.color)}}),ri(e)?a=4:ii(e)&&(a=5),s=u}0===n?this.valType=a:a===this.valType&&6!==a||(o=!0),this.discrete=this.discrete||o;var f={time:t,value:s,rawValue:e,percent:0};return r&&(f.easing=r,f.easingFunc=H(r)?r:Ue[r]||mr(r)),i.push(f),f},t.prototype.prepare=function(t,e){var r=this.keyframes;this._needsSort&&r.sort(function(t,e){return t.time-e.time});for(var i=this.valType,n=r.length,o=r[n-1],a=this.discrete,s=mi(i),h=_i(i),l=0;l=0&&!(h[r].percent<=e);r--);r=p(r,l-2)}else{for(r=c;re);r++);r=p(r-1,l-2)}n=h[r+1],i=h[r]}if(i&&n){this._lastFr=r,this._lastFrP=e;var d=n.percent-i.percent,v=0===d?1:p((e-i.percent)/d,1);n.easingFunc&&(v=n.easingFunc(v));var y=o?this._additiveValue:f?xi:t[u];if(!mi(s)&&!f||y||(y=this._additiveValue=[]),this.discrete)t[u]=v<1?i.rawValue:n.rawValue;else if(mi(s))1===s?fi(y,i[a],n[a],v):function(t,e,r,i){for(var n=e.length,o=n&&e[0].length,a=0;a0&&s.addKeyframe(0,yi(h),i),this._trackKeys.push(a)}s.addKeyframe(t,yi(e[a]),i)}return this._maxTime=Math.max(this._maxTime,t),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,r=0;r0)){this._started=1;for(var e=this,r=[],i=this._maxTime||0,n=0;n1){var a=o.pop();n.addKeyframe(a.time,t[i]),n.prepare(this._maxTime,n.getAdditiveTrack())}}}},t}();function ki(){ return(new Date).getTime()}var Si,Ti,Ci=function(e){function r(t){var r=e.call(this)||this;return r._running=!1,r._time=0,r._pausedTime=0,r._pauseStart=0,r._paused=!1,t=t||{},r.stage=t.stage||{},r}return t(r,e),r.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},r.prototype.addAnimator=function(t){t.animation=this;var e=t.getClip();e&&this.addClip(e)},r.prototype.removeClip=function(t){if(t.animation){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=t.animation=null}},r.prototype.removeAnimator=function(t){var e=t.getClip();e&&this.removeClip(e),t.animation=null},r.prototype.update=function(t){for(var e=ki()-this._pausedTime,r=e-this._time,i=this._head;i;){var n=i.next;i.step(e,r)?(i.ondestroy(),this.removeClip(i),i=n):i=n}this._time=e,t||(this.trigger("frame",r),this.stage.update&&this.stage.update())},r.prototype._startLoop=function(){var t=this;this._running=!0,je(function e(){t._running&&(je(e),!t._paused&&t.update())})},r.prototype.start=function(){this._running||(this._time=ki(),this._pausedTime=0,this._startLoop())},r.prototype.stop=function(){this._running=!1},r.prototype.pause=function(){this._paused||(this._pauseStart=ki(),this._paused=!0)},r.prototype.resume=function(){this._paused&&(this._pausedTime+=ki()-this._pauseStart,this._paused=!1)},r.prototype.clear=function(){for(var t=this._head;t;){var e=t.next;t.prev=t.next=t.animation=null,t=e}this._head=this._tail=null},r.prototype.isFinished=function(){return null==this._head},r.prototype.animate=function(t,e){e=e||{},this.start();var r=new bi(t,e.loop);return this.addAnimator(r),r},r}(Ot),Pi=r.domSupported,Mi=(Ti={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},{mouse:Si=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],touch:["touchstart","touchend","touchmove"],pointer:I(Si,function(t){var e=t.replace("mouse","pointer");return Ti.hasOwnProperty(e)?e:t})}),Ai=["mousemove","mouseup"],Li=["pointermove","pointerup"],Ii=!1;function Di(t){var e=t.pointerType;return"pen"===e||"touch"===e}function zi(t){t&&(t.zrByTouch=!0)}function Ri(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 Oi=function(){return function(t,e){this.stopPropagation=dt,this.stopImmediatePropagation=dt,this.preventDefault=dt,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}}(),Fi={mousedown:function(t){t=Jt(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=Jt(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=Jt(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){Ri(this,(t=Jt(this.dom,t)).toElement||t.relatedTarget)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){Ii=!0,t=Jt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){Ii||(t=Jt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){zi(t=Jt(this.dom,t)),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),Fi.mousemove.call(this,t),Fi.mousedown.call(this,t)},touchmove:function(t){zi(t=Jt(this.dom,t)),this.handler.processGesture(t,"change"),Fi.mousemove.call(this,t)},touchend:function(t){zi(t=Jt(this.dom,t)),this.handler.processGesture(t,"end"),Fi.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<300&&Fi.click.call(this,t)},pointerdown:function(t){Fi.mousedown.call(this,t)},pointermove:function(t){Di(t)||Fi.mousemove.call(this,t)},pointerup:function(t){Fi.mouseup.call(this,t)},pointerout:function(t){Di(t)||Fi.mouseout.call(this,t)}};L(["click","dblclick","contextmenu"],function(t){Fi[t]=function(e){e=Jt(this.dom,e),this.trigger(t,e)}});var Bi={pointermove:function(t){Di(t)||Bi.mousemove.call(this,t)},pointerup:function(t){Bi.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 Ni(t,e){var i=e.domHandlers;r.pointerEventsSupported?L(Mi.pointer,function(r){Wi(e,r,function(e){i[r].call(t,e)})}):(r.touchEventsSupported&&L(Mi.touch,function(r){Wi(e,r,function(n){i[r].call(t,n),function(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}(e)})}),L(Mi.mouse,function(r){Wi(e,r,function(n){n=$t(n),e.touching||i[r].call(t,n)})}))}function Hi(t,e){function i(r){Wi(e,r,function(i){i=$t(i),Ri(t,i.target)||(i=function(t,e){return Jt(t.dom,new Oi(t,e),!0)}(t,i),e.domHandlers[r].call(t,i))},{capture:!0})}r.pointerEventsSupported?L(Li,i):r.touchEventsSupported||L(Ai,i)}function Wi(t,e,r,i){t.mounted[e]=r,t.listenerOpts[e]=i,te(t.domTarget,e,r,i)}function Ei(t){var e=t.mounted;for(var r in e)e.hasOwnProperty(r)&&ee(t.domTarget,r,e[r],t.listenerOpts[r]);t.mounted={}}var Xi=function(){return function(t,e){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=t,this.domHandlers=e}}(),Yi=function(e){function r(t,r){var i=e.call(this)||this;return i.__pointerCapturing=!1,i.dom=t,i.painterRoot=r,i._localHandlerScope=new Xi(t,Fi),Pi&&(i._globalHandlerScope=new Xi(document,Bi)),Ni(i,i._localHandlerScope),i}return t(r,e),r.prototype.dispose=function(){Ei(this._localHandlerScope),Pi&&Ei(this._globalHandlerScope)},r.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},r.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,Pi&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var e=this._globalHandlerScope;t?Hi(this,e):Ei(e)}},r}(Ot),qi=1;r.hasGlobalWindow&&(qi=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var ji=qi,Vi="#333",Ui="#ccc",Zi=he,Gi=5e-5;function Ki(t){return t>Gi||t<-5e-5}var Qi=[],$i=[],Ji=[1,0,0,1,0,0],tn=Math.abs,en=function(){function t(){}var e;return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},t.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},t.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},t.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},t.prototype.needLocalTransform=function(){return Ki(this.rotation)||Ki(this.x)||Ki(this.y)||Ki(this.scaleX-1)||Ki(this.scaleY-1)||Ki(this.skewX)||Ki(this.skewY)},t.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),r=this.transform;e||t?(r=r||[1,0,0,1,0,0],e?this.getLocalTransform(r):Zi(r),t&&(e?ue(r,t,r):le(r,t)),this.transform=r,this._resolveGlobalScaleRatio(r)):r&&(Zi(r),this.invTransform=null)},t.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(null!=e&&1!==e){this.getGlobalScale(Qi);var r=Qi[0]<0?-1:1,i=Qi[1]<0?-1:1,n=((Qi[0]-r)*e+r)/Qi[0]||0,o=((Qi[1]-i)*e+i)/Qi[1]||0;t[0]*=n,t[1]*=n,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||[1,0,0,1,0,0],de(this.invTransform,t)},t.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},t.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],r=t[2]*t[2]+t[3]*t[3],i=Math.atan2(t[1],t[0]),n=Math.PI/2+i-Math.atan2(t[3],t[2]);r=Math.sqrt(r)*Math.cos(n),e=Math.sqrt(e),this.skewX=n,this.skewY=0,this.rotation=-i,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=r,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||[1,0,0,1,0,0],ue($i,t.invTransform,e),e=$i);var r=this.originX,i=this.originY;(r||i)&&(Ji[4]=r,Ji[5]=i,ue($i,e,Ji),$i[4]-=r,$i[5]-=i,e=$i),this.setLocalTransform(e)}},t.prototype.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},t.prototype.transformCoordToLocal=function(t,e){var r=[t,e],i=this.invTransform;return i&&Lt(r,r,i),r},t.prototype.transformCoordToGlobal=function(t,e){var r=[t,e],i=this.transform;return i&&Lt(r,r,i),r},t.prototype.getLineScale=function(){var t=this.transform;return t&&tn(t[0]-1)>1e-10&&tn(t[3]-1)>1e-10?Math.sqrt(tn(t[0]*t[3]-t[2]*t[1])):1},t.prototype.copyTransform=function(t){nn(this,t)},t.getLocalTransform=function(t,e){e=e||[];var r=t.originX||0,i=t.originY||0,n=t.scaleX,o=t.scaleY,a=t.anchorX,s=t.anchorY,h=t.rotation||0,l=t.x,u=t.y,f=t.skewX?Math.tan(t.skewX):0,c=t.skewY?Math.tan(-t.skewY):0;if(r||i||a||s){var p=r+a,d=i+s;e[4]=-p*n-f*d*o,e[5]=-d*o-c*p*n}else e[4]=e[5]=0;return e[0]=n,e[3]=o,e[1]=c*n,e[2]=f*o,h&&ce(e,e,h),e[4]+=r+l,e[5]+=i+u,e},t.initDefaultProps=((e=t.prototype).scaleX=e.scaleY=e.globalScaleRatio=1,void(e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0)),t}(),rn=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function nn(t,e){for(var r=0;r=0?parseFloat(t)/100*e:parseFloat(t):t}function pn(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",f="top";if(i instanceof Array)h+=cn(i[0],r.width),l+=cn(i[1],r.height),u=null,f=null;else switch(i){case"left":h-=n,l+=s,u="right",f="middle";break;case"right":h+=n+a,l+=s,f="middle";break;case"top":h+=a/2,l-=n,u="center",f="bottom";break;case"bottom":h+=a/2,l+=o+n,u="center";break;case"inside":h+=a/2,l+=s,u="center",f="middle";break;case"insideLeft":h+=n,l+=s,f="middle";break;case"insideRight":h+=a-n,l+=s,u="right",f="middle";break;case"insideTop":h+=a/2,l+=n,u="center";break;case"insideBottom":h+=a/2,l+=o-n,u="center",f="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,f="bottom";break;case"insideBottomRight":h+=a-n,l+=o-n,u="right",f="bottom"}return(t=t||{}).x=h,t.y=l,t.align=u,t.verticalAlign=f,t}var dn="__zr_normal__",vn=rn.concat(["ignore"]),yn=D(rn,function(t,e){return t[e]=!0,t},{ignore:!1}),gn={},_n=new Te(0,0,0,0),mn=function(){function t(t){this.id=m(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return t.prototype._init=function(t){this.attr(t)},t.prototype.drift=function(t,e,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]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var r=this.textConfig,i=r.local,n=e.innerTransformable,o=void 0,a=void 0,s=!1;n.parent=i?this:null;var h=!1;if(n.copyTransform(e),null!=r.position){var l=_n;r.layoutRect?l.copy(r.layoutRect):l.copy(this.getBoundingRect()),i||l.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(gn,r,l):pn(gn,r,l),n.x=gn.x,n.y=gn.y,o=gn.align,a=gn.verticalAlign;var u=r.origin;if(u&&null!=r.rotation){var f=void 0,c=void 0;"center"===u?(f=.5*l.width,c=.5*l.height):(f=cn(u[0],l.width),c=cn(u[1],l.height)),h=!0,n.originX=-n.x+f+(i?0:l.x),n.originY=-n.y+c+(i?0:l.y)}}null!=r.rotation&&(n.rotation=r.rotation);var p=r.offset;p&&(n.x+=p[0],n.y+=p[1],h||(n.originX=-p[0],n.originY=-p[1]));var d=null==r.inside?"string"==typeof r.position&&r.position.indexOf("inside")>=0:r.inside,v=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),y=void 0,g=void 0,_=void 0;d&&this.canBeInsideText()?(y=r.insideFill,g=r.insideStroke,null!=y&&"auto"!==y||(y=this.getInsideTextFill()),null!=g&&"auto"!==g||(g=this.getInsideTextStroke(y),_=!0)):(y=r.outsideFill,g=r.outsideStroke,null!=y&&"auto"!==y||(y=this.getOutsideFill()),null!=g&&"auto"!==g||(g=this.getOutsideStroke(y),_=!0)),(y=y||"#000")===v.fill&&g===v.stroke&&_===v.autoStroke&&o===v.align&&a===v.verticalAlign||(s=!0,v.fill=y,v.stroke=g,v.autoStroke=_,v.align=o,v.verticalAlign=a,e.setDefaultTextStyle(v)),e.__dirty|=1,s&&e.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(t){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Ui:Vi},t.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),r="string"==typeof e&&Fr(e);r||(r=[255,255,255,1]);for(var i=r[3],n=this.__zr.isDarkMode(),o=0;o<3;o++)r[o]=r[o]*i+(n?0:255)*(1-i);return r[3]=1,Yr(r,"rgba")},t.prototype.traverse=function(t,e){},t.prototype.attrKV=function(t,e){"textConfig"===t?this.setTextConfig(e):"textContent"===t?this.setTextContent(e):"clipPath"===t?this.setClipPath(e):"extra"===t?(this.extra=this.extra||{},S(this.extra,e)):this[t]=e},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(Y(t))for(var r=O(t),i=0;i0},t.prototype.getState=function(t){return this.states[t]},t.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},t.prototype.clearStates=function(t){this.useState(dn,!1,t)},t.prototype.useState=function(t,e,r,i){var n=t===dn;if(this.hasState()||!n){var o=this.currentStates,a=this.stateTransition;if(!(C(o,t)>=0)||!e&&1!==o.length){var s;if(this.stateProxy&&!n&&(s=this.stateProxy(t)),s||(s=this.states&&this.states[t]),s||n){n||this.saveCurrentToNormalState(s);var h=!!(s&&s.hoverLayer||i);h&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,s,this._normalState,e,!r&&!this.__inHover&&a&&a.duration>0,a);var l=this._textContent,u=this._textGuide;return l&&l.useState(t,e,r,h),u&&u.useState(t,e,r,h),n?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}x("State "+t+" not exists.")}}},t.prototype.useStates=function(t,e,r){if(t.length){var i=[],n=this.currentStates,o=t.length,a=o===n.length;if(a)for(var s=0;s0,p);var d=this._textContent,v=this._textGuide;d&&d.useStates(t,e,f),v&&v.useStates(t,e,f),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!f&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}else this.clearStates()},t.prototype.isSilent=function(){for(var t=this.silent,e=this.parent;!t&&e;){if(e.silent){t=!0;break}e=e.parent}return t},t.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var r=this.currentStates.slice();r.splice(e,1),this.useStates(r)}},t.prototype.replaceState=function(t,e,r){var i=this.currentStates.slice(),n=C(i,t),o=C(i,e)>=0;n>=0?o?i.splice(n,1):i[n]=e:r&&!o&&i.push(e),this.useStates(i)},t.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},t.prototype._mergeStates=function(t){for(var e,r={},i=0;i=0&&e.splice(r,1)}),this.animators.push(t),r&&r.animation.addAnimator(t),r&&r.wakeUp()},t.prototype.updateDuringAnimation=function(t){this.markRedraw()},t.prototype.stopAnimation=function(t,e){for(var r=this.animators,i=r.length,n=[],o=0;o0&&r.during&&o[0].during(function(t,e){r.during(e)});for(var c=0;c0||n.force&&!a.length){var b,k=void 0,S=void 0,T=void 0;if(s){S={},c&&(k={});for(x=0;x=0&&(r.splice(i,0,t),this._doAdd(t))}return this},r.prototype.replace=function(t,e){var r=C(this._children,t);return r>=0&&this.replaceAt(e,r),this},r.prototype.replaceAt=function(t,e){var r=this._children,i=r[e];if(t&&t!==this&&t.parent!==this&&t!==i){r[e]=t,i.parent=null;var n=this.__zr;n&&i.removeSelfFromZr(n),this._doAdd(t)}return this},r.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__zr;e&&e!==t.__zr&&t.addSelfToZr(e),e&&e.refresh()},r.prototype.remove=function(t){var e=this.__zr,r=this._children,i=C(r,t);return i<0||(r.splice(i,1),t.parent=null,e&&t.removeSelfFromZr(e),e&&e.refresh()),this},r.prototype.removeAll=function(){for(var t=this._children,e=this.__zr,r=0;r0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&"canvas"===this.painter.getType()&&this.painter.refreshHover())},t.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},t.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},t.prototype.on=function(t,e,r){return this._disposed||this.handler.on(t,e,r),this},t.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},t.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},t.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e=a;h++)s-=a;var l=an(r,e);return l>s&&(r="",l=0),s=t-l,n.ellipsis=r,n.ellipsisWidth=l,n.contentWidth=s,n.containerWidth=t,n}function Wn(t,e,r){var i=r.containerWidth,n=r.font,o=r.contentWidth;if(!i)return t.textLine="",void(t.isTruncated=!1);var a=an(e,n);if(a<=i)return t.textLine=e,void(t.isTruncated=!1);for(var s=0;;s++){if(a<=o||s>=r.maxIterations){e+=r.ellipsis;break}var h=0===s?En(e,o,r.ascCharWidth,r.cnCharWidth):a>0?Math.floor(e.length*o/a):0;a=an(e=e.substr(0,h),n)}""===e&&(e=r.placeholder),t.textLine=e,t.isTruncated=!0}function En(t,e,r,i){for(var n=0,o=0,a=t.length;o0&&d+i.accumWidth>i.width&&(o=e.split("\n"),f=!0),i.accumWidth=d}else{var v=Zn(e,u,i.width,i.breakAll,i.accumWidth);i.accumWidth=v.accumWidth+p,a=v.linesWidths,o=v.lines}}else o=e.split("\n");for(var y=0;y=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}(t)||!!Vn[t]}function Zn(t,e,r,i,n){for(var o=[],a=[],s="",h="",l=0,u=0,f=0;fr:n+u+p>r)?u?(s||h)&&(d?(s||(s=h,h="",u=l=0),o.push(s),a.push(u-l),h+=c,s="",u=l+=p):(h&&(s+=h,h="",l=0),o.push(s),a.push(u),s=c,u=p)):d?(o.push(h),a.push(l),h=c,l=p):(o.push(c),a.push(p)):(u+=p,d?(h+=c,l+=p):(h&&(s+=h,h="",l=0),s+=c))}else h&&(s+=h,u+=l),o.push(s),a.push(u),s="",h="",l=0,u=0}return o.length||s||(s=t,h="",l=0),h&&(s+=h),s&&(o.push(s),a.push(u)),1===o.length&&(u+=n),{accumWidth:u,lines:o,linesWidths:a}}var Gn="__zr_style_"+Math.round(10*Math.random()),Kn={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Qn={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Kn[Gn]=!0;var $n=["z","z2","invisible"],Jn=["invisible"],to=function(e){function r(t){return e.call(this,t)||this}var i;return t(r,e),r.prototype._init=function(t){for(var r=O(t),i=0;i1e-4)return s[0]=t-r,s[1]=e-i,h[0]=t+r,void(h[1]=e+i);if(ho[0]=ao(n)*r+t,ho[1]=oo(n)*i+e,lo[0]=ao(o)*r+t,lo[1]=oo(o)*i+e,l(s,ho,lo),u(h,ho,lo),(n%=so)<0&&(n+=so),(o%=so)<0&&(o+=so),n>o&&!a?o+=so:nn&&(uo[0]=ao(p)*r+t,uo[1]=oo(p)*i+e,l(s,uo,s),u(h,uo,h))}var mo={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},xo=[],wo=[],bo=[],ko=[],So=[],To=[],Co=Math.min,Po=Math.max,Mo=Math.cos,Ao=Math.sin,Lo=Math.abs,Io=Math.PI,Do=2*Io,zo="undefined"!=typeof Float32Array,Ro=[];function Oo(t){return Math.round(t/Io*1e8)/1e8%2*Io}function Fo(t,e){var r=Oo(t[0]);r<0&&(r+=Do);var i=r-t[0],n=t[1];n+=i,!e&&n-r>=Do?n=r+Do:e&&r-n>=Do?n=r-Do:!e&&r>n?n=r+(Do-Oo(r-n)):e&&r0&&(this._ux=Lo(r/ji/t)||0,this._uy=Lo(r/ji/e)||0)},t.prototype.setDPR=function(t){this.dpr=t},t.prototype.setContext=function(t){this._ctx=t},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(mo.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},t.prototype.lineTo=function(t,e){var r=Lo(t-this._xi),i=Lo(e-this._yi),n=r>this._ux||i>this._uy;if(this.addData(mo.L,t,e),this._ctx&&n&&this._ctx.lineTo(t,e),n)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=r*r+i*i;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(t,e,r,i,n,o){return this._drawPendingPt(),this.addData(mo.C,t,e,r,i,n,o),this._ctx&&this._ctx.bezierCurveTo(t,e,r,i,n,o),this._xi=n,this._yi=o,this},t.prototype.quadraticCurveTo=function(t,e,r,i){return this._drawPendingPt(),this.addData(mo.Q,t,e,r,i),this._ctx&&this._ctx.quadraticCurveTo(t,e,r,i),this._xi=r,this._yi=i,this},t.prototype.arc=function(t,e,r,i,n,o){this._drawPendingPt(),Ro[0]=i,Ro[1]=n,Fo(Ro,o),i=Ro[0];var a=(n=Ro[1])-i;return this.addData(mo.A,t,e,r,r,i,a,0,o?0:1),this._ctx&&this._ctx.arc(t,e,r,i,n,o),this._xi=Mo(n)*r+t,this._yi=Ao(n)*r+e,this},t.prototype.arcTo=function(t,e,r,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,r,i,n),this},t.prototype.rect=function(t,e,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,r,i),this.addData(mo.R,t,e,r,i),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(mo.Z);var t=this._ctx,e=this._x0,r=this._y0;return t&&t.closePath(),this._xi=e,this._yi=r,this},t.prototype.fill=function(t){t&&t.fill(),this.toStatic()},t.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(t){var e=t.length;this.data&&this.data.length===e||!zo||(this.data=new Float32Array(e));for(var r=0;rl.length&&(this._expandData(),l=this.data);for(var u=0;u0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},t.prototype.getBoundingRect=function(){bo[0]=bo[1]=So[0]=So[1]=Number.MAX_VALUE,ko[0]=ko[1]=To[0]=To[1]=-Number.MAX_VALUE;var t,e=this.data,r=0,i=0,n=0,o=0;for(t=0;tr||Lo(y)>i||f===e-1)&&(d=Math.sqrt(A*A+y*y),n=v,o=m);break;case mo.C:var g=t[f++],_=t[f++],m=(v=t[f++],t[f++]),x=t[f++],w=t[f++];d=fr(n,o,g,_,v,m,x,w,10),n=x,o=w;break;case mo.Q:d=gr(n,o,g=t[f++],_=t[f++],v=t[f++],m=t[f++],10),n=v,o=m;break;case mo.A:var b=t[f++],k=t[f++],S=t[f++],T=t[f++],C=t[f++],P=t[f++],M=P+C;f+=1,p&&(a=Mo(C)*S+b,s=Ao(C)*T+k),d=Po(S,T)*Co(Do,Math.abs(P)),n=Mo(M)*S+b,o=Ao(M)*T+k;break;case mo.R:a=n=t[f++],s=o=t[f++],d=2*t[f++]+2*t[f++];break;case mo.Z:var A=a-n;y=s-o;d=Math.sqrt(A*A+y*y),n=a,o=s}d>=0&&(h[u++]=d,l+=d)}return this._pathLen=l,l},t.prototype.rebuildPath=function(t,e){var r,i,n,o,a,s,h,l,u,f,c=this.data,p=this._ux,d=this._uy,v=this._len,y=e<1,g=0,_=0,m=0;if(!y||(this._pathSegLen||this._calculateLength(),h=this._pathSegLen,l=e*this._pathLen))t:for(var x=0;x0&&(t.lineTo(u,f),m=0),w){case mo.M:r=n=c[x++],i=o=c[x++],t.moveTo(n,o);break;case mo.L:a=c[x++],s=c[x++];var k=Lo(a-n),S=Lo(s-o);if(k>p||S>d){if(y){if(g+(Z=h[_++])>l){var T=(l-g)/Z;t.lineTo(n*(1-T)+a*T,o*(1-T)+s*T);break t}g+=Z}t.lineTo(a,s),n=a,o=s,m=0}else{var C=k*k+S*S;C>m&&(u=a,f=s,m=C)}break;case mo.C:var P=c[x++],M=c[x++],A=c[x++],L=c[x++],I=c[x++],D=c[x++];if(y){if(g+(Z=h[_++])>l){lr(n,P,A,I,T=(l-g)/Z,xo),lr(o,M,L,D,T,wo),t.bezierCurveTo(xo[1],wo[1],xo[2],wo[2],xo[3],wo[3]);break t}g+=Z}t.bezierCurveTo(P,M,A,L,I,D),n=I,o=D;break;case mo.Q:P=c[x++],M=c[x++],A=c[x++],L=c[x++];if(y){if(g+(Z=h[_++])>l){vr(n,P,A,T=(l-g)/Z,xo),vr(o,M,L,T,wo),t.quadraticCurveTo(xo[1],wo[1],xo[2],wo[2]);break t}g+=Z}t.quadraticCurveTo(P,M,A,L),n=A,o=L;break;case mo.A:var z=c[x++],R=c[x++],O=c[x++],F=c[x++],B=c[x++],N=c[x++],H=c[x++],W=!c[x++],E=O>F?O:F,X=Lo(O-F)>.001,Y=B+N,q=!1;if(y)g+(Z=h[_++])>l&&(Y=B+N*(l-g)/Z,q=!0),g+=Z;if(X&&t.ellipse?t.ellipse(z,R,O,F,H,B,Y,W):t.arc(z,R,E,B,Y,W),q)break t;b&&(r=Mo(B)*O+z,i=Ao(B)*F+R),n=Mo(Y)*O+z,o=Ao(Y)*F+R;break;case mo.R:r=n=c[x],i=o=c[x+1],a=c[x++],s=c[x++];var j=c[x++],V=c[x++];if(y){if(g+(Z=h[_++])>l){var U=l-g;t.moveTo(a,s),t.lineTo(a+Co(U,j),s),(U-=j)>0&&t.lineTo(a+j,s+Co(U,V)),(U-=V)>0&&t.lineTo(a+Po(j-U,0),s+V),(U-=j)>0&&t.lineTo(a,s+Po(V-U,0));break t}g+=Z}t.rect(a,s,j,V);break;case mo.Z:if(y){var Z;if(g+(Z=h[_++])>l){T=(l-g)/Z;t.lineTo(n*(1-T)+r*T,o*(1-T)+i*T);break t}g+=Z}t.closePath(),n=r,o=i}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.CMD=mo,t.initDefaultProps=((e=t.prototype)._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,void(e._version=0)),t}();function No(t,e,r,i,n,o,a){if(0===n)return!1;var s=n,h=0;if(a>e+s&&a>i+s||at+s&&o>r+s||oe+f&&u>i+f&&u>o+f&&u>s+f||ut+f&&l>r+f&&l>n+f&&l>a+f||le+l&&h>i+l&&h>o+l||ht+l&&s>r+l&&s>n+l||sr||u+ln&&(n+=Yo);var c=Math.atan2(h,s);return c<0&&(c+=Yo),c>=i&&c<=n||c+Yo>=i&&c+Yo<=n}function jo(t,e,r,i,n,o){if(o>e&&o>i||on?s:0}var Vo=Bo.CMD,Uo=2*Math.PI;var Zo=[-1,-1,-1],Go=[-1,-1];function Ko(){var t=Go[0];Go[0]=Go[1],Go[1]=t}function Qo(t,e,r,i,n,o,a,s,h,l){if(l>e&&l>i&&l>o&&l>s||l1&&Ko(),p=or(e,i,o,s,Go[0]),c>1&&(d=or(e,i,o,s,Go[1]))),2===c?ye&&s>i&&s>o||s=0&&u<=1&&(n[h++]=u);else{var l=a*a-4*o*s;if(ir(l))(u=-a/(2*o))>=0&&u<=1&&(n[h++]=u);else if(l>0){var u,f=Ge(l),c=(-a-f)/(2*o);(u=(-a+f)/(2*o))>=0&&u<=1&&(n[h++]=u),c>=0&&c<=1&&(n[h++]=c)}}return h}(e,i,o,s,Zo);if(0===h)return 0;var l=dr(e,i,o);if(l>=0&&l<=1){for(var u=0,f=cr(e,i,o,l),c=0;cr||s<-r)return 0;var h=Math.sqrt(r*r-s*s);Zo[0]=-h,Zo[1]=h;var l=Math.abs(i-n);if(l<1e-4)return 0;if(l>=Uo-1e-4){i=0,n=Uo;var u=o?1:-1;return a>=Zo[0]+t&&a<=Zo[1]+t?u:0}if(i>n){var f=i;i=n,n=f}i<0&&(i+=Uo,n+=Uo);for(var c=0,p=0;p<2;p++){var d=Zo[p];if(d+t>a){var v=Math.atan2(s,d);u=o?1:-1;v<0&&(v=Uo+v),(v>=i&&v<=n||v+Uo>=i&&v+Uo<=n)&&(v>Math.PI/2&&v<1.5*Math.PI&&(u=-u),c+=u)}}return c}function ta(t,e,r,i,n){for(var o,a,s,h,l=t.data,u=t.len(),f=0,c=0,p=0,d=0,v=0,y=0;y1&&(r||(f+=jo(c,p,d,v,i,n))),_&&(d=c=l[y],v=p=l[y+1]),g){case Vo.M:c=d=l[y++],p=v=l[y++];break;case Vo.L:if(r){if(No(c,p,l[y],l[y+1],e,i,n))return!0}else f+=jo(c,p,l[y],l[y+1],i,n)||0;c=l[y++],p=l[y++];break;case Vo.C:if(r){if(Ho(c,p,l[y++],l[y++],l[y++],l[y++],l[y],l[y+1],e,i,n))return!0}else f+=Qo(c,p,l[y++],l[y++],l[y++],l[y++],l[y],l[y+1],i,n)||0;c=l[y++],p=l[y++];break;case Vo.Q:if(r){if(Wo(c,p,l[y++],l[y++],l[y],l[y+1],e,i,n))return!0}else f+=$o(c,p,l[y++],l[y++],l[y],l[y+1],i,n)||0;c=l[y++],p=l[y++];break;case Vo.A:var m=l[y++],x=l[y++],w=l[y++],b=l[y++],k=l[y++],S=l[y++];y+=1;var T=!!(1-l[y++]);o=Math.cos(k)*w+m,a=Math.sin(k)*b+x,_?(d=o,v=a):f+=jo(c,p,o,a,i,n);var C=(i-m)*b/w+m;if(r){if(qo(m,x,b,k,k+S,T,e,C,n))return!0}else f+=Jo(m,x,b,k,k+S,T,C,n);c=Math.cos(k+S)*w+m,p=Math.sin(k+S)*b+x;break;case Vo.R:if(d=c=l[y++],v=p=l[y++],o=d+l[y++],a=v+l[y++],r){if(No(d,v,o,v,e,i,n)||No(o,v,o,a,e,i,n)||No(o,a,d,a,e,i,n)||No(d,a,d,v,e,i,n))return!0}else f+=jo(o,v,o,a,i,n),f+=jo(d,a,d,v,i,n);break;case Vo.Z:if(r){if(No(c,p,d,v,e,i,n))return!0}else f+=jo(c,p,d,v,i,n);c=d,p=v}}return r||(s=p,h=v,Math.abs(s-h)<1e-4)||(f+=jo(c,p,d,v,i,n)||0),0!==f}var ea=T({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Kn),ra={style:T({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Qn.style)},ia=rn.concat(["invisible","culling","z","z2","zlevel","parent"]),na=function(e){function r(t){return e.call(this,t)||this}var i;return t(r,e),r.prototype.update=function(){var t=this;e.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new r;n.buildPath===r.prototype.buildPath&&(n.buildPath=function(e){t.buildPath(e,t.shape)}),n.silent=!0;var o=n.style;for(var a in i)o[a]!==i[a]&&(o[a]=i[a]);o.fill=i.fill?i.decal:null,o.decal=null,o.shadowColor=null,i.strokeFirst&&(o.stroke=null);for(var s=0;s.5?Vi:e>.2?"#eee":Ui}if(t)return Ui}return Vi},r.prototype.getInsideTextStroke=function(t){var e=this.style.fill;if(W(e)){var r=this.__zr;if(!(!r||!r.isDarkMode())===qr(t,0)<.4)return e}},r.prototype.buildPath=function(t,e,r){},r.prototype.pathUpdated=function(){this.__dirty&=-5},r.prototype.getUpdatedPathProxy=function(t){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,t),this.path},r.prototype.createPathProxy=function(){this.path=new Bo(!1)},r.prototype.hasStroke=function(){var t=this.style,e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))},r.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},r.prototype.getBoundingRect=function(){var t=this._rect,e=this.style,r=!t;if(r){var i=!1;this.path||(i=!0,this.createPathProxy());var n=this.path;(i||4&this.__dirty)&&(n.beginPath(),this.buildPath(n,this.shape,!1),this.pathUpdated()),t=n.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var o=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||r){o.copy(t);var a=e.strokeNoScale?this.getLineScale():1,s=e.lineWidth;if(!this.hasFill()){var h=this.strokeContainThreshold;s=Math.max(s,null==h?4:h)}a>1e-10&&(o.width+=s/a,o.height+=s/a,o.x-=s/a/2,o.y-=s/a/2)}return o}return t},r.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(s>1e-10&&(this.hasFill()||(a=Math.max(a,this.strokeContainThreshold)),function(t,e,r,i){return ta(t,e,!0,r,i)}(o,a/s,t,e)))return!0}if(this.hasFill())return function(t,e,r){return ta(t,0,!1,e,r)}(o,t,e)}return!1},r.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},r.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},r.prototype.animateShape=function(t){return this.animate("shape",t)},r.prototype.updateDuringAnimation=function(t){"style"===t?this.dirtyStyle():"shape"===t?this.dirtyShape():this.markRedraw()},r.prototype.attrKV=function(t,r){"shape"===t?this.setShape(r):e.prototype.attrKV.call(this,t,r)},r.prototype.setShape=function(t,e){var r=this.shape;return r||(r=this.shape={}),"string"==typeof t?r[t]=e:S(r,t),this.dirtyShape(),this},r.prototype.shapeChanged=function(){return!!(4&this.__dirty)},r.prototype.createStyle=function(t){return ft(ea,t)},r.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var r=this._normalState;t.shape&&!r.shape&&(r.shape=S({},this.shape))},r.prototype._applyStateObj=function(t,r,i,n,o,a){e.prototype._applyStateObj.call(this,t,r,i,n,o,a);var s,h=!(r&&n);if(r&&r.shape?o?n?s=r.shape:(s=S({},i.shape),S(s,r.shape)):(s=S({},n?this.shape:i.shape),S(s,r.shape)):h&&(s=i.shape),s)if(o){this.shape=S({},this.shape);for(var l={},u=O(s),f=0;f0},r.prototype.hasFill=function(){var t=this.style.fill;return null!=t&&"none"!==t},r.prototype.createStyle=function(t){return ft(oa,t)},r.prototype.setBoundingRect=function(t){this._rect=t},r.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var e=t.text;null!=e?e+="":e="";var r=hn(e,t.font,t.textAlign,t.textBaseline);if(r.x+=t.x||0,r.y+=t.y||0,this.hasStroke()){var i=t.lineWidth;r.x-=i/2,r.y-=i/2,r.width+=i,r.height+=i}this._rect=r}return this._rect},r.initDefaultProps=void(r.prototype.dirtyRectTolerance=10),r}(to);aa.prototype.type="tspan";var sa=T({x:0,y:0},Kn),ha={style:T({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Qn.style)};var la=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),r.prototype.createStyle=function(t){return ft(sa,t)},r.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},r.prototype.getWidth=function(){return this._getSize("width")},r.prototype.getHeight=function(){return this._getSize("height")},r.prototype.getAnimationStyleProps=function(){return ha},r.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new Te(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},r}(to);la.prototype.type="image";var ua=Math.round;function fa(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?(ua(2*i)===ua(2*n)&&(t.x1=t.x2=pa(i,s,!0)),ua(2*o)===ua(2*a)&&(t.y1=t.y2=pa(o,s,!0)),t):t}}function ca(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=pa(i,s,!0),t.y=pa(n,s,!0),t.width=Math.max(pa(i+o,s,!1)-t.x,0===o?0:1),t.height=Math.max(pa(n+a,s,!1)-t.y,0===a?0:1),t):t}}function pa(t,e,r){if(!e)return t;var i=ua(2*t);return(i+ua(e))%2==0?i/2:(i+(r?1:-1))/2}var da=function(){return function(){this.x=0,this.y=0,this.width=0,this.height=0}}(),va={},ya=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r.prototype.getDefaultShape=function(){return new da},r.prototype.buildPath=function(t,e){var r,i,n,o;if(this.subPixelOptimize){var a=ca(va,e,this.style);r=a.x,i=a.y,n=a.width,o=a.height,a.r=e.r,e=a}else r=e.x,i=e.y,n=e.width,o=e.height;e.r?function(t,e){var r,i,n,o,a,s=e.x,h=e.y,l=e.width,u=e.height,f=e.r;l<0&&(s+=l,l=-l),u<0&&(h+=u,u=-u),"number"==typeof f?r=i=n=o=f:f instanceof Array?1===f.length?r=i=n=o=f[0]:2===f.length?(r=n=f[0],i=o=f[1]):3===f.length?(r=f[0],i=o=f[1],n=f[2]):(r=f[0],i=f[1],n=f[2],o=f[3]):r=i=n=o=0,r+i>l&&(r*=l/(a=r+i),i*=l/a),n+o>l&&(n*=l/(a=n+o),o*=l/a),i+n>u&&(i*=u/(a=i+n),n*=u/a),r+o>u&&(r*=u/(a=r+o),o*=u/a),t.moveTo(s+r,h),t.lineTo(s+l-i,h),0!==i&&t.arc(s+l-i,h+i,i,-Math.PI/2,0),t.lineTo(s+l,h+u-n),0!==n&&t.arc(s+l-n,h+u-n,n,0,Math.PI/2),t.lineTo(s+o,h+u),0!==o&&t.arc(s+o,h+u-o,o,Math.PI/2,Math.PI),t.lineTo(s,h+r),0!==r&&t.arc(s+r,h+r,r,Math.PI,1.5*Math.PI)}(t,e):t.rect(r,i,n,o)},r.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},r}(na);ya.prototype.type="rect";var ga={fill:"#000"},_a={style:T({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},Qn.style)},ma=function(e){function r(t){var r=e.call(this)||this;return r.type="text",r._children=[],r._defaultStyle=ga,r.attr(t),r}return t(r,e),r.prototype.childrenRef=function(){return this._children},r.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;td&&u){var v=Math.floor(d/h);f=f||r.length>v,r=r.slice(0,v)}if(t&&a&&null!=c)for(var y=Hn(c,o,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),g={},_=0;_0,C=null!=t.width&&("truncate"===t.overflow||"break"===t.overflow||"breakAll"===t.overflow),P=i.calculatedLineHeight,M=0;Mh&&jn(r,t.substring(h,l),e,s),jn(r,i[2],e,s,i[1]),h=Bn.lastIndex}ho){var M=r.lines.length;b>0?(m.tokens=m.tokens.slice(0,b),g(m,w,x),r.lines=r.lines.slice(0,_+1)):r.lines=r.lines.slice(0,_),r.isTruncated=r.isTruncated||r.lines.length=0&&"right"===(P=m[C]).align;)this._placeToken(P,t,w,d,T,"right",y),b-=P.width,T-=P.width,C--;for(S+=(r-(S-p)-(v-T)-b)/2;k<=C;)P=m[k],this._placeToken(P,t,w,d,S+P.width/2,"center",y),S+=P.width,k++;d+=w}},r.prototype._placeToken=function(t,e,r,i,o,a,s){var h=e.rich[t.styleName]||{};h.text=t.text;var l=t.verticalAlign,u=i+r/2;"top"===l?u=i+t.height/2:"bottom"===l&&(u=i+r-t.height/2),!t.isLineHolder&&Ia(h)&&this._renderBackground(h,e,"right"===a?o-t.width:"center"===a?o-t.width/2:o,u-t.height/2,t.width,t.height);var f=!!h.backgroundColor,c=t.textPadding;c&&(o=Aa(o,a,c),u-=t.height/2-c[0]-t.innerHeight/2);var p=this._getOrCreateChild(aa),d=p.createStyle();p.useStyle(d);var v=this._defaultStyle,y=!1,g=0,_=Ma("fill"in h?h.fill:"fill"in e?e.fill:(y=!0,v.fill)),m=Pa("stroke"in h?h.stroke:"stroke"in e?e.stroke:f||s||v.autoStroke&&!y?null:(g=2,v.stroke)),x=h.textShadowBlur>0||e.textShadowBlur>0;d.text=t.text,d.x=o,d.y=u,x&&(d.shadowBlur=h.textShadowBlur||e.textShadowBlur||0,d.shadowColor=h.textShadowColor||e.textShadowColor||"transparent",d.shadowOffsetX=h.textShadowOffsetX||e.textShadowOffsetX||0,d.shadowOffsetY=h.textShadowOffsetY||e.textShadowOffsetY||0),d.textAlign=a,d.textBaseline="middle",d.font=t.font||n,d.opacity=$(h.opacity,e.opacity,1),Sa(d,h),m&&(d.lineWidth=$(h.lineWidth,e.lineWidth,g),d.lineDash=Q(h.lineDash,e.lineDash),d.lineDashOffset=e.lineDashOffset||0,d.stroke=m),_&&(d.fill=_);var w=t.contentWidth,b=t.contentHeight;p.setBoundingRect(new Te(ln(d.x,w,d.textAlign),un(d.y,b,d.textBaseline),w,b))},r.prototype._renderBackground=function(t,e,r,i,n,o){var a,s,h,l=t.backgroundColor,u=t.borderWidth,f=t.borderColor,c=l&&l.image,p=l&&!c,d=t.borderRadius,v=this;if(p||t.lineHeight||u&&f){(a=this._getOrCreateChild(ya)).useStyle(a.createStyle()),a.style.fill=null;var y=a.shape;y.x=r,y.y=i,y.width=n,y.height=o,y.r=d,a.dirtyShape()}if(p)(h=a.style).fill=l||null,h.fillOpacity=Q(t.fillOpacity,1);else if(c){(s=this._getOrCreateChild(la)).onload=function(){v.dirtyStyle()};var g=s.style;g.image=l.image,g.x=r,g.y=i,g.width=n,g.height=o}u&&f&&((h=a.style).lineWidth=u,h.stroke=f,h.strokeOpacity=Q(t.strokeOpacity,1),h.lineDash=t.borderDash,h.lineDashOffset=t.borderDashOffset||0,a.strokeContainThreshold=0,a.hasFill()&&a.hasStroke()&&(h.strokeFirst=!0,h.lineWidth*=2));var _=(a||s).style;_.shadowBlur=t.shadowBlur||0,_.shadowColor=t.shadowColor||"transparent",_.shadowOffsetX=t.shadowOffsetX||0,_.shadowOffsetY=t.shadowOffsetY||0,_.opacity=$(t.opacity,e.opacity,1)},r.makeFont=function(t){var e="";return Ta(t)&&(e=[t.fontStyle,t.fontWeight,ka(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),e&&rt(e)||t.textFont||t.font},r}(to),xa={left:!0,right:1,center:1},wa={top:1,bottom:1,middle:1},ba=["fontStyle","fontWeight","fontSize","fontFamily"];function ka(t){return"string"!=typeof t||-1===t.indexOf("px")&&-1===t.indexOf("rem")&&-1===t.indexOf("em")?isNaN(+t)?"12px":t+"px":t}function Sa(t,e){for(var r=0;r1&&(a*=Ba(d),s*=Ba(d));var v=(n===o?-1:1)*Ba((a*a*(s*s)-a*a*(p*p)-s*s*(c*c))/(a*a*(p*p)+s*s*(c*c)))||0,y=v*a*p/s,g=v*-s*c/a,_=(t+r)/2+Ha(f)*y-Na(f)*g,m=(e+i)/2+Na(f)*y+Ha(f)*g,x=Ya([1,0],[(c-y)/a,(p-g)/s]),w=[(c-y)/a,(p-g)/s],b=[(-1*c-y)/a,(-1*p-g)/s],k=Ya(w,b);if(Xa(w,b)<=-1&&(k=Wa),Xa(w,b)>=1&&(k=0),k<0){var S=Math.round(k/Wa*1e6)/1e6;k=2*Wa+S%2*Wa}u.addData(l,_,m,a,s,x,k,f,o)}var ja=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Va=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;var Ua=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return t(r,e),r.prototype.applyTransform=function(t){},r}(na);function Za(t){return null!=t.setData}function Ga(t,e){var r=function(t){var e=new Bo;if(!t)return e;var r,i=0,n=0,o=i,a=n,s=Bo.CMD,h=t.match(ja);if(!h)return e;for(var l=0;lL*L+I*I&&(S=C,T=P),{cx:S,cy:T,x0:-u,y0:-f,x1:S*(n/w-1),y1:T*(n/w-1)}}function ys(t,e){var r,i=cs(e.r,0),n=cs(e.r0||0,0),o=i>0;if(o||n>0){if(o||(i=n,n=0),n>i){var a=i;i=n,n=a}var s=e.startAngle,h=e.endAngle;if(!isNaN(s)&&!isNaN(h)){var l=e.cx,u=e.cy,f=!!e.clockwise,c=us(h-s),p=c>os&&c%os;if(p>ds&&(c=p),i>ds)if(c>os-ds)t.moveTo(l+i*ss(s),u+i*as(s)),t.arc(l,u,i,s,h,!f),n>ds&&(t.moveTo(l+n*ss(h),u+n*as(h)),t.arc(l,u,n,h,s,f));else{var d=void 0,v=void 0,y=void 0,g=void 0,_=void 0,m=void 0,x=void 0,w=void 0,b=void 0,k=void 0,S=void 0,T=void 0,C=void 0,P=void 0,M=void 0,A=void 0,L=i*ss(s),I=i*as(s),D=n*ss(h),z=n*as(h),R=c>ds;if(R){var O=e.cornerRadius;O&&(d=(r=function(t){var e;if(N(t)){var r=t.length;if(!r)return t;e=1===r?[t[0],t[0],0,0]:2===r?[t[0],t[0],t[1],t[1]]:3===r?t.concat(t[2]):t}else e=[t,t,t,t];return e}(O))[0],v=r[1],y=r[2],g=r[3]);var F=us(i-n)/2;if(_=ps(F,y),m=ps(F,g),x=ps(F,d),w=ps(F,v),S=b=cs(_,m),T=k=cs(x,w),(b>ds||k>ds)&&(C=i*ss(h),P=i*as(h),M=n*ss(s),A=n*as(s),cds){var j=ps(y,S),V=ps(g,S),U=vs(M,A,L,I,i,j,f),Z=vs(C,P,D,z,i,V,f);t.moveTo(l+U.cx+U.x0,u+U.cy+U.y0),S0&&t.arc(l+U.cx,u+U.cy,j,ls(U.y0,U.x0),ls(U.y1,U.x1),!f),t.arc(l,u,i,ls(U.cy+U.y1,U.cx+U.x1),ls(Z.cy+Z.y1,Z.cx+Z.x1),!f),V>0&&t.arc(l+Z.cx,u+Z.cy,V,ls(Z.y1,Z.x1),ls(Z.y0,Z.x0),!f))}else t.moveTo(l+L,u+I),t.arc(l,u,i,s,h,!f);else t.moveTo(l+L,u+I);if(n>ds&&R)if(T>ds){j=ps(d,T),U=vs(D,z,C,P,n,-(V=ps(v,T)),f),Z=vs(L,I,M,A,n,-j,f);t.lineTo(l+U.cx+U.x0,u+U.cy+U.y0),T0&&t.arc(l+U.cx,u+U.cy,V,ls(U.y0,U.x0),ls(U.y1,U.x1),!f),t.arc(l,u,n,ls(U.cy+U.y1,U.cx+U.x1),ls(Z.cy+Z.y1,Z.cx+Z.x1),f),j>0&&t.arc(l+Z.cx,u+Z.cy,j,ls(Z.y1,Z.x1),ls(Z.y0,Z.x0),!f))}else t.lineTo(l+D,u+z),t.arc(l,u,n,h,s,f);else t.lineTo(l+D,u+z)}else t.moveTo(l,u);t.closePath()}}}var gs=function(){return 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}}(),_s=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r.prototype.getDefaultShape=function(){return new gs},r.prototype.buildPath=function(t,e){ys(t,e)},r.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},r}(na);_s.prototype.type="sector";var ms=function(){return function(){this.cx=0,this.cy=0,this.r=0,this.r0=0}}(),xs=function(e){function r(t){return e.call(this,t)||this}return t(r,e),r.prototype.getDefaultShape=function(){return new ms},r.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)},r}(na);function ws(t,e,r){var i=e.smooth,n=e.points;if(n&&n.length>=2){if(i){var o=function(t,e,r,i){var n,o,a,s,h=[],l=[],u=[],f=[];if(i){a=[Infinity,Infinity],s=[-Infinity,-Infinity];for(var c=0,p=t.length;cWs[1]){if(a=!1,n)return a;var l=Math.abs(Ws[0]-Hs[1]),u=Math.abs(Hs[0]-Ws[1]);Math.min(l,u)>i.len()&&(l=0&&Gs(h)?h:.5,t.createRadialGradient(a,s,0,a,s,h)}(t,e,r):function(t,e,r){var i=null==e.x?0:e.x,n=null==e.x2?1:e.x2,o=null==e.y?0:e.y,a=null==e.y2?0:e.y2;return e.global||(i=i*r.width+r.x,n=n*r.width+r.x,o=o*r.height+r.y,a=a*r.height+r.y),i=Gs(i)?i:0,n=Gs(n)?n:1,o=Gs(o)?o:0,a=Gs(a)?a:0,t.createLinearGradient(i,o,n,a)}(t,e,r),n=e.colorStops,o=0;o0&&(e=i.lineDash,r=i.lineWidth,e&&"solid"!==e&&r>0?"dashed"===e?[4*r,2*r]:"dotted"===e?[r]:X(e)?[e]:N(e)?e:null:null),o=i.lineDashOffset;if(n){var a=i.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&1!==a&&(n=I(n,function(t){return t/a}),o/=a)}return[n,o]}var th=new Bo(!0);function eh(t){var e=t.stroke;return!(null==e||"none"===e||!(t.lineWidth>0))}function rh(t){return"string"==typeof t&&"none"!==t}function ih(t){var e=t.fill;return null!=e&&"none"!==e}function nh(t,e){if(null!=e.fillOpacity&&1!==e.fillOpacity){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function oh(t,e){if(null!=e.strokeOpacity&&1!==e.strokeOpacity){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function ah(t,e,r){var i=Rn(e.image,e.__image,r);if(Fn(i)){var n=t.createPattern(i,e.repeat||"repeat");if("function"==typeof DOMMatrix&&n&&n.setTransform){var o=new DOMMatrix;o.translateSelf(e.x||0,e.y||0),o.rotateSelf(0,0,(e.rotation||0)*vt),o.scaleSelf(e.scaleX||1,e.scaleY||1),n.setTransform(o)}return n}}var sh=["shadowBlur","shadowOffsetX","shadowOffsetY"],hh=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function lh(t,e,r,i,n){var o=!1;if(!i&&e===(r=r||{}))return!1;if(i||e.opacity!==r.opacity){ch(t,n),o=!0;var a=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(a)?Kn.opacity:a}(i||e.blend!==r.blend)&&(o||(ch(t,n),o=!0),t.globalCompositeOperation=e.blend||Kn.blend);for(var s=0;s=4&&(h={x:parseFloat(f[0]||0),y:parseFloat(f[1]||0),width:parseFloat(f[2]),height:parseFloat(f[3])})}if(h&&null!=a&&null!=s&&(l=Hh(h,{x:0,y:0,width:a,height:s}),!e.ignoreViewBox)){var c=i;(i=new Sn).add(c),c.scaleX=c.scaleY=l.scale,c.x=l.x,c.y=l.y}return e.ignoreRootClip||null==a||null==s||i.setClipPath(new ya({shape:{x:0,y:0,width:a,height:s}})),{root:i,width:a,height:s,viewBoxRect:h,viewBoxTransform:l,named:n}},t.prototype._parseNode=function(t,e,r,i,n,o){var a,s=t.nodeName.toLowerCase(),h=i;if("defs"===s&&(n=!0),"text"===s&&(o=!0),"defs"===s||"switch"===s)a=e;else{if(!n){var l=yh[s];if(l&&pt(yh,s)){a=l.call(this,t,e);var u=t.getAttribute("name");if(u){var f={name:u,namedFrom:null,svgNodeTagLower:s,el:a};r.push(f),"g"===s&&(h=f)}else i&&r.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:a});e.add(a)}}var c=Th[s];if(c&&pt(Th,s)){var p=c.call(this,t),d=t.getAttribute("id");d&&(this._defs[d]=p)}}if(a&&a.isGroup)for(var v=t.firstChild;v;)1===v.nodeType?this._parseNode(v,a,r,h,n,o):3===v.nodeType&&o&&this._parseText(v,a),v=v.nextSibling},t.prototype._parseText=function(t,e){var r=new aa({style:{text:t.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Mh(e,r),Lh(t,r,this._defsUsePending,!1,!1),function(t,e){var r=e.__selfStyle;if(r){var i=r.textBaseline,n=i;i&&"auto"!==i?"baseline"===i?n="alphabetic":"before-edge"===i||"text-before-edge"===i?n="top":"after-edge"===i||"text-after-edge"===i?n="bottom":"central"!==i&&"mathematical"!==i||(n="middle"):n="alphabetic",t.style.textBaseline=n}var o=e.__inheritedStyle;if(o){var a=o.textAlign,s=a;a&&("middle"===a&&(s="center"),t.style.textAlign=s)}}(r,e);var i=r.style,n=i.fontSize;n&&n<9&&(i.fontSize=9,r.scaleX*=n/9,r.scaleY*=n/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var a=r.getBoundingRect();return this._textX+=a.width,e.add(r),r},t.internalField=void(yh={g:function(t,e){var r=new Sn;return Mh(e,r),Lh(t,r,this._defsUsePending,!1,!1),r},rect:function(t,e){var r=new ya;return Mh(e,r),Lh(t,r,this._defsUsePending,!1,!1),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.silent=!0,r},circle:function(t,e){var r=new es;return Mh(e,r),Lh(t,r,this._defsUsePending,!1,!1),r.setShape({cx:parseFloat(t.getAttribute("cx")||"0"),cy:parseFloat(t.getAttribute("cy")||"0"),r:parseFloat(t.getAttribute("r")||"0")}),r.silent=!0,r},line:function(t,e){var r=new Ms;return Mh(e,r),Lh(t,r,this._defsUsePending,!1,!1),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.silent=!0,r},ellipse:function(t,e){var r=new is;return Mh(e,r),Lh(t,r,this._defsUsePending,!1,!1),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.silent=!0,r},polygon:function(t,e){var r,i=t.getAttribute("points");i&&(r=Ah(i));var n=new ks({shape:{points:r||[]},silent:!0});return Mh(e,n),Lh(t,n,this._defsUsePending,!1,!1),n},polyline:function(t,e){var r,i=t.getAttribute("points");i&&(r=Ah(i));var n=new Ts({shape:{points:r||[]},silent:!0});return Mh(e,n),Lh(t,n,this._defsUsePending,!1,!1),n},image:function(t,e){var r=new la;return Mh(e,r),Lh(t,r,this._defsUsePending,!1,!1),r.setStyle({image:t.getAttribute("xlink:href")||t.getAttribute("href"),x:+t.getAttribute("x"),y:+t.getAttribute("y"),width:+t.getAttribute("width"),height:+t.getAttribute("height")}),r.silent=!0,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 Sn;return Mh(e,a),Lh(t,a,this._defsUsePending,!1,!0),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 Sn;return Mh(e,a),Lh(t,a,this._defsUsePending,!1,!0),this._textX+=parseFloat(n),this._textY+=parseFloat(o),a},path:function(t,e){var r=Ka(t.getAttribute("d")||"");return Mh(e,r),Lh(t,r,this._defsUsePending,!1,!1),r.silent=!0,r}}),t}(),Th={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 Bs(e,r,i,n);return Ch(t,o),Ph(t,o),o},radialgradient:function(t){var e=parseInt(t.getAttribute("cx")||"0",10),r=parseInt(t.getAttribute("cy")||"0",10),i=parseInt(t.getAttribute("r")||"0",10),n=new Ns(e,r,i);return Ch(t,n),Ph(t,n),n}};function Ch(t,e){"userSpaceOnUse"===t.getAttribute("gradientUnits")&&(e.global=!0)}function Ph(t,e){for(var r=t.firstChild;r;){if(1===r.nodeType&&"stop"===r.nodeName.toLocaleLowerCase()){var i=r.getAttribute("offset"),n=void 0;n=i&&i.indexOf("%")>0?parseInt(i,10)/100:i?parseFloat(i):0;var o={};Nh(r,o,o);var a=o.stopColor||r.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:n,color:a})}r=r.nextSibling}}function Mh(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),T(e.__inheritedStyle,t.__inheritedStyle))}function Ah(t){for(var e=Rh(t),r=[],i=0;i0;o-=2){var a=i[o],s=i[o-1],h=Rh(a);switch(n=n||se(),s){case"translate":fe(n,n,[parseFloat(h[0]),parseFloat(h[1]||"0")]);break;case"scale":pe(n,n,[parseFloat(h[0]),parseFloat(h[1]||h[0])]);break;case"rotate":ce(n,n,-parseFloat(h[0])*Fh,[parseFloat(h[1]||"0"),parseFloat(h[2]||"0")]);break;case"skewX":ue(n,[1,0,Math.tan(parseFloat(h[0])*Fh),1,0,0],n);break;case"skewY":ue(n,[1,Math.tan(parseFloat(h[0])*Fh),0,1,0,0],n);break;case"matrix":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),Nh(t,a,s),i||function(t,e,r){for(var i=0;i=qh:-h>=qh),c=h>0?h%qh:h%qh+qh,p=!1;p=!!f||!Kr(u)&&c>=Yh==!!l;var d=t+r*Xh(o),v=e+i*Eh(o);this._start&&this._add("M",d,v);var y=Math.round(n*jh);if(f){var g=1/this._p,_=(l?1:-1)*(qh-g);this._add("A",r,i,y,1,+l,t+r*Xh(o+_),e+i*Eh(o+_)),g>.01&&this._add("A",r,i,y,0,+l,d,v)}else{var m=t+r*Xh(a),x=e+i*Eh(a);this._add("A",r,i,y,+p,+l,m,x)}},t.prototype.rect=function(t,e,r,i){this._add("M",t,e),this._add("l",r,0),this._add("l",0,i),this._add("l",-r,0),this._add("Z")},t.prototype.closePath=function(){this._d.length>0&&this._add("Z")},t.prototype._add=function(t,e,r,i,n,o,a,s,h){for(var l=[],u=this._p,f=1;f"}(n,o)+("style"!==n?Vt(a):a||"")+(i?""+r+I(i,function(e){return t(e)}).join(r)+r:"")+("")}(t)}function nl(t){return{zrId:t,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function ol(t,e,r,i){return rl("svg","root",{width:t,height:e,xmlns:$h,"xmlns:xlink":Jh,version:"1.1",baseProfile:"full",viewBox:!!i&&"0 0 "+t+" "+e},r)}var al=0;function sl(){return al++}var hl={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},ll="transform-origin";function ul(t,e,r){var i=S({},t.shape);S(i,e),t.buildPath(r,i);var n=new Vh;return n.reset(ai(t)),r.rebuildPath(n,1),n.generateStr(),n.getStr()}function fl(t,e){var r=e.originX,i=e.originY;(r||i)&&(t[ll]=r+"px "+i+"px")}var cl={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function pl(t,e){var r=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[r]=t,r}function dl(t){return W(t)?hl[t]?"cubic-bezier("+hl[t]+")":mr(t)?t:"":""}function vl(t,e,r,i){var n=t.animators,o=n.length,a=[];if(t instanceof Os){var s=function(t,e,r){var i,n,o=t.shape.paths,a={};if(L(o,function(t){var e=nl(r.zrId);e.animation=!0,vl(t,{},e,!0);var o=e.cssAnims,s=e.cssNodes,h=O(o),l=h.length;if(l){var u=o[n=h[l-1]];for(var f in u){var c=u[f];a[f]=a[f]||{d:""},a[f].d+=c.d||""}for(var p in s){var d=s[p].animation;d.indexOf(n)>=0&&(i=d)}}}),i){e.d=!1;var s=pl(a,r);return i.replace(n,s)}}(t,e,r);if(s)a.push(s);else if(!o)return}else if(!o)return;for(var h={},l=0;l0}).length)return pl(u,r)+" "+n[0]+" both"}for(var y in h){(s=v(h[y]))&&a.push(s)}if(a.length){var g=r.zrId+"-cls-"+sl();r.cssNodes["."+g]={animation:a.join(",")},e.class=g}}function yl(t,e,r,i){var n=JSON.stringify(t),o=r.cssStyleCache[n];o||(o=r.zrId+"-cls-"+sl(),r.cssStyleCache[n]=o,r.cssNodes["."+o+":hover"]=t),e.class=e.class?e.class+" "+o:o}var gl=Math.round;function _l(t){return t&&W(t.src)}function ml(t){return t&&H(t.toDataURL)}function xl(t,e,r,i){Qh(function(n,o){var a="fill"===n||"stroke"===n;a&&ni(o)?Il(e,t,n,i):a&&ei(o)?Dl(r,t,n,i):t[n]=o,a&&i.ssr&&"none"===o&&(t["pointer-events"]="visible")},e,r,!1),function(t,e,r){var i=t.style;if(function(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY)}(i)){var n=function(t){var e=t.style,r=t.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),r[0],r[1]].join(",")}(t),o=r.shadowCache,a=o[n];if(!a){var s=t.getGlobalScale(),h=s[0],l=s[1];if(!h||!l)return;var u=i.shadowOffsetX||0,f=i.shadowOffsetY||0,c=i.shadowBlur,p=Zr(i.shadowColor),d=p.opacity,v=p.color,y=c/2/h+" "+c/2/l;a=r.zrId+"-s"+r.shadowIdx++,r.defs[a]=rl("filter",a,{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},[rl("feDropShadow","",{dx:u/h,dy:f/l,stdDeviation:y,"flood-color":v,"flood-opacity":d})]),o[n]=a}e.filter=oi(a)}}(r,t,i)}function wl(t,e){var r=function(t){if("function"==typeof Pn)return Pn(t)}(e);r&&(r.each(function(e,r){null!=e&&(t[(tl+r).toLowerCase()]=e+"")}),e.isSilent()&&(t[tl+"silent"]="true"))}function bl(t){return Kr(t[0]-1)&&Kr(t[1])&&Kr(t[2])&&Kr(t[3]-1)}function kl(t,e,r){if(e&&(!function(t){return Kr(t[4])&&Kr(t[5])}(e)||!bl(e))){var i=1e4;t.transform=bl(e)?"translate("+gl(e[4]*i)/i+" "+gl(e[5]*i)/i+")":function(t){return"matrix("+Qr(t[0])+","+Qr(t[1])+","+Qr(t[2])+","+Qr(t[3])+","+$r(t[4])+","+$r(t[5])+")"}(e)}}function Sl(t,e,r){for(var i=t.points,n=[],o=0;o=0&&a||o;s&&(n=Vr(s))}var h=i.lineWidth;h&&(h/=!i.strokeNoScale&&t.transform?t.transform[0]:1);var l={cursor:"pointer"};n&&(l.fill=n),i.stroke&&(l.stroke=i.stroke),h&&(l["stroke-width"]=h),yl(l,e,r)}}(t,o,e),rl(s,t.id+"",o)}function Ll(t,e){return t instanceof na?Al(t,e):t instanceof la?function(t,e){var r=t.style,i=r.image;if(i&&!W(i)&&(_l(i)?i=i.src:ml(i)&&(i=i.toDataURL())),i){var n=r.x||0,o=r.y||0,a={href:i,width:r.width,height:r.height};return n&&(a.x=n),o&&(a.y=o),kl(a,t.transform),xl(a,r,t,e),wl(a,t),e.animation&&vl(t,a,e),rl("image",t.id+"",a)}}(t,e):t instanceof aa?function(t,e){var r=t.style,o=r.text;if(null!=o&&(o+=""),o&&!isNaN(r.x)&&!isNaN(r.y)){var a=r.font||n,s=r.x||0,h=function(t,e,r){return"top"===r?t+=e/2:"bottom"===r&&(t-=e/2),t}(r.y||0,fn(a),r.textBaseline),l={"dominant-baseline":"central","text-anchor":Jr[r.textAlign]||r.textAlign};if(Ta(r)){var u="",f=r.fontStyle,c=ka(r.fontSize);if(!parseFloat(c))return;var p=r.fontFamily||i,d=r.fontWeight;u+="font-size:"+c+";font-family:"+p+";",f&&"normal"!==f&&(u+="font-style:"+f+";"),d&&"normal"!==d&&(u+="font-weight:"+d+";"),l.style=u}else l.style="font: "+a;return o.match(/\s/)&&(l["xml:space"]="preserve"),s&&(l.x=s),h&&(l.y=h),kl(l,t.transform),xl(l,r,t,e),wl(l,t),e.animation&&vl(t,l,e),rl("text",t.id+"",l,void 0,o)}}(t,e):void 0}function Il(t,e,r,i){var n,o=t[r],a={gradientUnits:o.global?"userSpaceOnUse":"objectBoundingBox"};if(ri(o))n="linearGradient",a.x1=o.x,a.y1=o.y,a.x2=o.x2,a.y2=o.y2;else{if(!ii(o))return;n="radialGradient",a.cx=Q(o.x,.5),a.cy=Q(o.y,.5),a.r=Q(o.r,.5)}for(var s=o.colorStops,h=[],l=0,u=s.length;lh?Ul(t,null==r[f+1]?null:r[f+1].elm,r,s,f):Zl(t,e,a,h))}(r,i,n):Yl(n)?(Yl(t.text)&&Wl(r,""),Ul(r,null,n,0,n.length-1)):Yl(i)?Zl(r,i,0,i.length-1):Yl(t.text)&&Wl(r,""):t.text!==e.text&&(Yl(i)&&Zl(r,i,0,i.length-1),Wl(r,e.text)))}var Ql=0,$l=function(){function t(t,e,r){if(this.type="svg",this.refreshHover=function(){},this.configLayer=function(){},this.storage=e,this._opts=r=S({},r),this.root=t,this._id="zr"+Ql++,this._oldVNode=ol(r.width,r.height),t&&!r.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var n=this._svgDom=this._oldVNode.elm=el("svg");Gl(null,this._oldVNode),i.appendChild(n),t.appendChild(i)}this.resize(r.width,r.height)}return t.prototype.getType=function(){return this.type},t.prototype.getViewportRoot=function(){return this._viewport},t.prototype.getViewportRootOffset=function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},t.prototype.getSvgDom=function(){return this._svgDom},t.prototype.refresh=function(){if(this.root){var t=this.renderToVNode({willUpdate:!0});t.attrs.style="position:absolute;left:0;top:0;user-select:none",function(t,e){if(jl(t,e))Kl(t,e);else{var r=t.elm,i=Nl(r);Vl(e),null!==i&&(Ol(i,e.elm,Hl(r)),Zl(i,[t],0,0))}}(this._oldVNode,t),this._oldVNode=t}},t.prototype.renderOneToVNode=function(t){return Ll(t,nl(this._id))},t.prototype.renderToVNode=function(t){t=t||{};var e=this.storage.getDisplayList(!0),r=this._width,i=this._height,n=nl(this._id);n.animation=t.animation,n.willUpdate=t.willUpdate,n.compress=t.compress,n.emphasis=t.emphasis,n.ssr=this._opts.ssr;var o=[],a=this._bgVNode=function(t,e,r,i){var n;if(r&&"none"!==r)if(n=rl("rect","bg",{width:t,height:e,x:"0",y:"0"}),ni(r))Il({fill:r},n.attrs,"fill",i);else if(ei(r))Dl({style:{fill:r},dirty:dt,getBoundingRect:function(){return{width:t,height:e}}},n.attrs,"fill",i);else{var o=Zr(r),a=o.color,s=o.opacity;n.attrs.fill=a,s<1&&(n.attrs["fill-opacity"]=s)}return n}(r,i,this._backgroundColor,n);a&&o.push(a);var s=t.compress?null:this._mainVNode=rl("g","main",{},[]);this._paintList(e,n,s?s.children:o),s&&o.push(s);var h=I(O(n.defs),function(t){return n.defs[t]});if(h.length&&o.push(rl("defs","defs",{},h)),t.animation){var l=function(t,e,r){var i=(r=r||{}).newline?"\n":"",n=" {"+i,o=i+"}",a=I(O(t),function(e){return e+n+I(O(t[e]),function(r){return r+":"+t[e][r]+";"}).join(i)+o}).join(i),s=I(O(e),function(t){return"@keyframes "+t+n+I(O(e[t]),function(r){return r+n+I(O(e[t][r]),function(i){var n=e[t][r][i];return"d"===i&&(n='path("'+n+'")'),i+":"+n+";"}).join(i)+o}).join(i)+o}).join(i);return a||s?[""].join(i):""}(n.cssNodes,n.cssAnims,{newline:!0});if(l){var u=rl("style","stl",{},[],l);o.push(u)}}return ol(r,i,o,t.useViewBox)},t.prototype.renderToString=function(t){return t=t||{},il(this.renderToVNode({animation:Q(t.cssAnimation,!0),emphasis:Q(t.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Q(t.useViewBox,!0)}),{newline:!0})},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t},t.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},t.prototype._paintList=function(t,e,r){for(var i,n,o=t.length,a=[],s=0,h=0,l=0;l=0&&(!f||!n||f[d]!==n[d]);d--);for(var v=p-1;v>d;v--)i=a[--s-1];for(var y=d+1;y=a)}}for(var u=this.__startIndex;u15)break}r.prevElClipPaths&&l.restore()};if(c)if(0===c.length)s=h.__endIndex;else for(var x=p.dpr,w=0;w0&&t>i[0]){for(s=0;st);s++);a=r[i[s]]}if(i.splice(s+1,0,t),r[t]=e,!e.virtual)if(a){var h=a.dom;h.nextSibling?o.insertBefore(e.dom,h.nextSibling):o.appendChild(e.dom)}else o.firstChild?o.insertBefore(e.dom,o.firstChild):o.appendChild(e.dom);e.painter||(e.painter=this)}},t.prototype.eachLayer=function(t,e){for(var r=this._zlevelList,i=0;i0?iu:0),this._needsManuallyCompositing),l.__builtin__||x("ZLevel "+h+" has been used by unkown layer "+l.id),l!==o&&(l.__used=!0,l.__startIndex!==n&&(l.__dirty=!0),l.__startIndex=n,l.incremental?l.__drawIndex=-1:l.__drawIndex=n,e(n),o=l),1&s.__dirty&&!s.__inHover&&(l.__dirty=!0,l.incremental&&l.__drawIndex<0&&(l.__drawIndex=n))}e(n),this.eachBuiltinLayer(function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(t){t.clear()},t.prototype.setBackgroundColor=function(t){this._backgroundColor=t,L(this._layers,function(t){t.setUnpainted()})},t.prototype.configLayer=function(t,e){if(e){var r=this._layerConfig;r[t]?b(r[t],e,!0):r[t]=e;for(var i=0;i2&&h.push(e),e=[t,r]}function d(t,r,i,n){au(t,i)&&au(r,n)||e.push(t,r,i,n,i,n)}function v(t,r,i,n,o,a){var s=Math.abs(r-t),h=4*Math.tan(s/4)/3,l=rS:P2&&h.push(e),h}function hu(t,e,r,i,n,o,a,s,h,l){if(au(t,r)&&au(e,i)&&au(n,a)&&au(o,s))h.push(a,s);else{var u=2/l,f=u*u,c=a-t,p=s-e,d=Math.sqrt(c*c+p*p);c/=d,p/=d;var v=r-t,y=i-e,g=n-a,_=o-s,m=v*v+y*y,x=g*g+_*_;if(m=0&&x-b*b=0)h.push(a,s);else{var k=[],S=[];lr(t,r,n,a,.5,k),lr(e,i,o,s,.5,S),hu(k[0],S[0],k[1],S[1],k[2],S[2],k[3],S[3],h,l),hu(k[4],S[4],k[5],S[5],k[6],S[6],k[7],S[7],h,l)}}}}function lu(t,e,r){var i=t[e],n=t[1-e],o=Math.abs(i/n),a=Math.ceil(Math.sqrt(o*r)),s=Math.floor(r/a);0===s&&(s=1,a=r);for(var h=[],l=0;l0)for(l=0;lMath.abs(l),f=lu([h,l],u?0:1,e),c=(u?s:l)/f.length,p=0;p1?null:new ye(p*h+t,p*l+e)}function pu(t,e,r){var i=new ye;ye.sub(i,r,e),i.normalize();var n=new ye;return ye.sub(n,t,e),n.dot(i)}function du(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function vu(t){var e=t.points,r=[],i=[];fo(e,r,i);var n=new Te(r[0],r[1],i[0]-r[0],i[1]-r[1]),o=n.width,a=n.height,s=n.x,h=n.y,l=new ye,u=new ye;return o>a?(l.x=u.x=s+o/2,l.y=h,u.y=h+a):(l.y=u.y=h+a/2,l.x=s,u.x=s+o),function(t,e,r){for(var i=t.length,n=[],o=0;on,a=lu([i,n],o?0:1,e),s=o?"width":"height",h=o?"height":"width",l=o?"x":"y",u=o?"y":"x",f=t[s]/a.length,c=0;c0;h/=2){var l=0,u=0;(t&h)>0&&(l=1),(e&h)>0&&(u=1),s+=h*h*(3*l^u),0===u&&(1===l&&(t=h-1-t,e=h-1-e),a=t,t=e,e=a)}return s}function Du(t){var e=Infinity,r=Infinity,i=-Infinity,n=-Infinity,o=I(t,function(t){var o=t.getBoundingRect(),a=t.getComputedTransform(),s=o.x+o.width/2+(a?a[4]:0),h=o.y+o.height/2+(a?a[5]:0);return e=Math.min(s,e),r=Math.min(h,r),i=Math.max(s,i),n=Math.max(h,n),[s,h]});return I(o,function(o,a){return{cp:o,z:Iu(o[0],o[1],e,r,i,n),path:t[a]}}).sort(function(t,e){return t.z-e.z}).map(function(t){return t.path})}function zu(t){return _u(t.path,t.count)}function Ru(t,e,r){var i=[];!function t(e){for(var r=0;r