import{_ as W}from"./tslib@2.3.0-BDyQ-Jie.js";var ss=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),fs=function(){function r(){this.browser=new ss,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=typeof window<"u"}return r}(),Y=new fs;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Y.wxa=!0,Y.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?Y.worker=!0:!Y.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(Y.node=!0,Y.svgSupported=!0):hs(navigator.userAgent,Y);function hs(r,t){var e=t.browser,i=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);i&&(e.firefox=!0,e.version=i[1]),n&&(e.ie=!0,e.version=n[1]),a&&(e.edge=!0,e.version=a[1],e.newEdge=+a[1].split(".")[0]>18),o&&(e.weChat=!0),t.svgSupported=typeof SVGRect<"u",t.touchEventsSupported="ontouchstart"in window&&!e.ie&&!e.edge,t.pointerEventsSupported="onpointerdown"in window&&(e.edge||e.ie&&+e.version>=11);var s=t.domSupported=typeof document<"u";if(s){var f=document.documentElement.style;t.transform3dSupported=(e.ie&&"transition"in f||e.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in f)&&!("OTransition"in f),t.transformSupported=t.transform3dSupported||e.ie&&+e.version>=9}}var xn=12,us="sans-serif",$t=xn+"px "+us,vs=20,ls=100,cs="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function ds(r){var t={};if(typeof JSON>"u")return t;for(var e=0;e=0)s=o*e.length;else for(var f=0;f>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[f]+":0",n[h]+":0",i[1-f]+":auto",n[1-h]+":auto",""].join("!important;"),r.appendChild(o),e.push(o)}return t.clearMarkers=function(){st(e,function(u){u.parentNode&&u.parentNode.removeChild(u)})},e}function ks(r,t,e){for(var i=e?"invTrans":"trans",n=t[i],a=t.srcCoords,o=[],s=[],f=!0,h=0;h<4;h++){var u=r[h].getBoundingClientRect(),v=2*h,l=u.left,c=u.top;o.push(l,c),f=f&&a&&l===a[v]&&c===a[v+1],s.push(r[h].offsetLeft,r[h].offsetTop)}return f&&n?n:(t.srcCoords=o,t[i]=e?Gn(s,o):Gn(o,s))}function lo(r){return r.nodeName.toUpperCase()==="CANVAS"}var Ns=/([&<>"'])/g,Ys={"&":"&","<":"<",">":">",'"':""","'":"'"};function dv(r){return r==null?"":(r+"").replace(Ns,function(t,e){return Ys[e]})}var Gs=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,pi=[],Xs=Y.browser.firefox&&+Y.browser.version.split(".")[0]<39;function en(r,t,e,i){return e=e||{},i?Xn(r,t,e):Xs&&t.layerX!=null&&t.layerX!==t.offsetX?(e.zrX=t.layerX,e.zrY=t.layerY):t.offsetX!=null?(e.zrX=t.offsetX,e.zrY=t.offsetY):Xn(r,t,e),e}function Xn(r,t,e){if(Y.domSupported&&r.getBoundingClientRect){var i=t.clientX,n=t.clientY;if(lo(r)){var a=r.getBoundingClientRect();e.zrX=i-a.left,e.zrY=n-a.top;return}else if(rn(pi,r,i,n)){e.zrX=pi[0],e.zrY=pi[1];return}}e.zrX=e.zrY=0}function En(r){return r||window.event}function _t(r,t,e){if(t=En(t),t.zrX!=null)return t;var i=t.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?t.targetTouches[0]:t.changedTouches[0];o&&en(r,o,t,e)}else{en(r,t,t,e);var a=qs(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&Gs.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function qs(r){var t=r.wheelDelta;if(t)return t;var e=r.deltaX,i=r.deltaY;if(e==null||i==null)return t;var n=Math.abs(i!==0?i:e),a=i>0?-1:i<0?1:e>0?-1:1;return 3*n*a}function $s(r,t,e,i){r.addEventListener(t,e,i)}function Zs(r,t,e,i){r.removeEventListener(t,e,i)}var Us=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0},Vs=function(){function r(){this._track=[]}return r.prototype.recognize=function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(t,e,i){var n=t.touches;if(n){for(var a={points:[],touches:[],target:e,event:t},o=0,s=n.length;o1&&i&&i.length>1){var a=qn(i)/qn(n);!isFinite(a)&&(a=1),t.pinchScale=a;var o=Qs(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:r[0].target,event:t}}}}};function ne(){return[1,0,0,1,0,0]}function Ks(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function Js(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r}function gi(r,t,e){var i=t[0]*e[0]+t[2]*e[1],n=t[1]*e[0]+t[3]*e[1],a=t[0]*e[2]+t[2]*e[3],o=t[1]*e[2]+t[3]*e[3],s=t[0]*e[4]+t[2]*e[5]+t[4],f=t[1]*e[4]+t[3]*e[5]+t[5];return r[0]=i,r[1]=n,r[2]=a,r[3]=o,r[4]=s,r[5]=f,r}function $n(r,t,e){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4]+e[0],r[5]=t[5]+e[1],r}function js(r,t,e,i){i===void 0&&(i=[0,0]);var n=t[0],a=t[2],o=t[4],s=t[1],f=t[3],h=t[5],u=Math.sin(e),v=Math.cos(e);return r[0]=n*v+s*u,r[1]=-n*u+s*v,r[2]=a*v+f*u,r[3]=-a*u+v*f,r[4]=v*(o-i[0])+u*(h-i[1])+i[0],r[5]=v*(h-i[1])-u*(o-i[0])+i[1],r}function tf(r,t,e){var i=e[0],n=e[1];return r[0]=t[0]*i,r[1]=t[1]*n,r[2]=t[2]*i,r[3]=t[3]*n,r[4]=t[4]*i,r[5]=t[5]*n,r}function co(r,t){var e=t[0],i=t[2],n=t[4],a=t[1],o=t[3],s=t[5],f=e*o-a*i;return f?(f=1/f,r[0]=o*f,r[1]=-a*f,r[2]=-i*f,r[3]=e*f,r[4]=(i*s-o*n)*f,r[5]=(a*n-e*s)*f,r):null}var z=function(){function r(t,e){this.x=t||0,this.y=e||0}return r.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(t,e){return this.x=t,this.y=e,this},r.prototype.equal=function(t){return t.x===this.x&&t.y===this.y},r.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},r.prototype.scale=function(t){this.x*=t,this.y*=t},r.prototype.scaleAndAdd=function(t,e){this.x+=t.x*e,this.y+=t.y*e},r.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var t=this.len();return this.x/=t,this.y/=t,this},r.prototype.distance=function(t){var e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)},r.prototype.distanceSquare=function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(t){if(t){var e=this.x,i=this.y;return this.x=t[0]*e+t[2]*i+t[4],this.y=t[1]*e+t[3]*i+t[5],this}},r.prototype.toArray=function(t){return t[0]=this.x,t[1]=this.y,t},r.prototype.fromArray=function(t){this.x=t[0],this.y=t[1]},r.set=function(t,e,i){t.x=e,t.y=i},r.copy=function(t,e){t.x=e.x,t.y=e.y},r.len=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},r.lenSquare=function(t){return t.x*t.x+t.y*t.y},r.dot=function(t,e){return t.x*e.x+t.y*e.y},r.add=function(t,e,i){t.x=e.x+i.x,t.y=e.y+i.y},r.sub=function(t,e,i){t.x=e.x-i.x,t.y=e.y-i.y},r.scale=function(t,e,i){t.x=e.x*i,t.y=e.y*i},r.scaleAndAdd=function(t,e,i,n){t.x=e.x+i.x*n,t.y=e.y+i.y*n},r.lerp=function(t,e,i,n){var a=1-n;t.x=a*e.x+n*i.x,t.y=a*e.y+n*i.y},r}(),vr=Math.min,xr=Math.max,nn=Math.abs,Zn=["x","y"],rf=["width","height"],Ut=new z,Vt=new z,Qt=new z,Kt=new z,ft=po(),Jr=ft.minTv,an=ft.maxTv,ae=[0,0],B=function(){function r(t,e,i,n){r.set(this,t,e,i,n)}return r.set=function(t,e,i,n,a){return n<0&&(e=e+n,n=-n),a<0&&(i=i+a,a=-a),t.x=e,t.y=i,t.width=n,t.height=a,t},r.prototype.union=function(t){var e=vr(t.x,this.x),i=vr(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=xr(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=xr(t.y+t.height,this.y+this.height)-i:this.height=t.height,this.x=e,this.y=i},r.prototype.applyTransform=function(t){r.applyTransform(this,this,t)},r.prototype.calculateTransform=function(t){var e=this,i=t.width/e.width,n=t.height/e.height,a=ne();return $n(a,a,[-e.x,-e.y]),tf(a,a,[i,n]),$n(a,a,[t.x,t.y]),a},r.prototype.intersect=function(t,e,i){return r.intersect(this,t,e,i)},r.intersect=function(t,e,i,n){i&&z.set(i,0,0);var a=n&&n.outIntersectRect||null,o=n&&n.clamp;if(a&&(a.x=a.y=a.width=a.height=NaN),!t||!e)return!1;t instanceof r||(t=r.set(ef,t.x,t.y,t.width,t.height)),e instanceof r||(e=r.set(nf,e.x,e.y,e.width,e.height));var s=!!i;ft.reset(n,s);var f=ft.touchThreshold,h=t.x+f,u=t.x+t.width-f,v=t.y+f,l=t.y+t.height-f,c=e.x+f,_=e.x+e.width-f,g=e.y+f,d=e.y+e.height-f;if(h>u||v>l||c>_||g>d)return!1;var p=!(u=t.x&&e<=t.x+t.width&&i>=t.y&&i<=t.y+t.height},r.prototype.contain=function(t,e){return r.contain(this,t,e)},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(t){r.copy(this,t)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(t){return new r(t.x,t.y,t.width,t.height)},r.copy=function(t,e){return t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t},r.applyTransform=function(t,e,i){if(!i){t!==e&&r.copy(t,e);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],a=i[3],o=i[4],s=i[5];t.x=e.x*n+o,t.y=e.y*a+s,t.width=e.width*n,t.height=e.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}Ut.x=Qt.x=e.x,Ut.y=Kt.y=e.y,Vt.x=Kt.x=e.x+e.width,Vt.y=Qt.y=e.y+e.height,Ut.transform(i),Kt.transform(i),Vt.transform(i),Qt.transform(i),t.x=vr(Ut.x,Vt.x,Qt.x,Kt.x),t.y=vr(Ut.y,Vt.y,Qt.y,Kt.y);var f=xr(Ut.x,Vt.x,Qt.x,Kt.x),h=xr(Ut.y,Vt.y,Qt.y,Kt.y);t.width=f-t.x,t.height=h-t.y},r}(),ef=new B(0,0,0,0),nf=new B(0,0,0,0);function Un(r,t,e,i,n,a,o,s){var f=nn(t-e),h=nn(i-r),u=vr(f,h),v=Zn[n],l=Zn[1-n],c=rf[n];t=h||!ft.bidirectional)&&(Jr[v]=-h,Jr[l]=0,ft.useDir&&ft.calcDirMTV())))}function po(){var r=0,t=new z,e=new z,i={minTv:new z,maxTv:new z,useDir:!1,dirMinTv:new z,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){i.touchThreshold=0,a&&a.touchThreshold!=null&&(i.touchThreshold=xr(0,a.touchThreshold)),i.negativeSize=!1,o&&(i.minTv.set(1/0,1/0),i.maxTv.set(0,0),i.useDir=!1,a&&a.direction!=null&&(i.useDir=!0,i.dirMinTv.copy(i.minTv),e.copy(i.minTv),r=a.direction,i.bidirectional=a.bidirectional==null||!!a.bidirectional,i.bidirectional||t.set(Math.cos(r),Math.sin(r))))},calcDirMTV:function(){var a=i.minTv,o=i.dirMinTv,s=a.y*a.y+a.x*a.x,f=Math.sin(r),h=Math.cos(r),u=f*a.y+h*a.x;if(n(u)){n(a.x)&&n(a.y)&&o.set(0,0);return}if(e.x=s*h/u,e.y=s*f/u,n(e.x)&&n(e.y)){o.set(0,0);return}(i.bidirectional||t.dot(e)>0)&&e.len()=0;v--){var l=a[v];l!==n&&!l.ignore&&!l.ignoreCoarsePointer&&(!l.parent||!l.parent.ignoreCoarsePointer)&&(yi.copy(l.getBoundingRect()),l.transform&&yi.applyTransform(l.transform),yi.intersect(u)&&s.push(l))}if(s.length)for(var c=4,_=Math.PI/12,g=Math.PI*2,d=0;d4)return;this._downPoint=null}this.dispatchToElement(a,r,t)}});function hf(r,t,e){if(r[r.rectHover?"rectContain":"contain"](t,e)){for(var i=r,n=void 0,a=!1;i;){if(i.ignoreClip&&(a=!0),!a){var o=i.getClipPath();if(o&&!o.contain(t,e))return!1}i.silent&&(n=!0);var s=i.__hostTarget;i=s?i.ignoreHostSilent?null:s:i.parent}return n?_o:!0}return!1}function Vn(r,t,e,i,n){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==n&&!o.ignore&&(s=hf(o,e,i))&&(!t.topTarget&&(t.topTarget=o),s!==_o)){t.target=o;break}}}function yo(r,t,e){var i=r.painter;return t<0||t>i.getWidth()||e<0||e>i.getHeight()}var mo=32,qr=7;function uf(r){for(var t=0;r>=mo;)t|=r&1,r>>=1;return r+t}function Qn(r,t,e,i){var n=t+1;if(n===e)return 1;if(i(r[n++],r[t])<0){for(;n=0;)n++;return n-t}function vf(r,t,e){for(e--;t>>1,n(a,r[f])<0?s=f:o=f+1;var h=i-o;switch(h){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;h>0;)r[o+h]=r[o+h-1],h--}r[o]=a}}function mi(r,t,e,i,n,a){var o=0,s=0,f=1;if(a(r,t[e+n])>0){for(s=i-n;f0;)o=f,f=(f<<1)+1,f<=0&&(f=s);f>s&&(f=s),o+=n,f+=n}else{for(s=n+1;fs&&(f=s);var h=o;o=n-f,f=n-h}for(o++;o>>1);a(r,t[e+u])>0?o=u+1:f=u}return f}function Ti(r,t,e,i,n,a){var o=0,s=0,f=1;if(a(r,t[e+n])<0){for(s=n+1;fs&&(f=s);var h=o;o=n-f,f=n-h}else{for(s=i-n;f=0;)o=f,f=(f<<1)+1,f<=0&&(f=s);f>s&&(f=s),o+=n,f+=n}for(o++;o>>1);a(r,t[e+u])<0?f=u:o=u+1}return f}function lf(r,t){var e=qr,i,n,a=0,o=[];i=[],n=[];function s(c,_){i[a]=c,n[a]=_,a+=1}function f(){for(;a>1;){var c=a-2;if(c>=1&&n[c-1]<=n[c]+n[c+1]||c>=2&&n[c-2]<=n[c]+n[c-1])n[c-1]n[c+1])break;u(c)}}function h(){for(;a>1;){var c=a-2;c>0&&n[c-1]=qr||L>=qr);if(C)break;b<0&&(b=0),b+=2}if(e=b,e<1&&(e=1),_===1){for(p=0;p=0;p--)r[w+p]=r[b+p];r[T]=o[m];return}for(var L=e;;){var C=0,M=0,P=!1;do if(t(o[m],r[y])<0){if(r[T--]=r[y--],C++,M=0,--_===0){P=!0;break}}else if(r[T--]=o[m--],M++,C=0,--d===1){P=!0;break}while((C|M)=0;p--)r[w+p]=r[b+p];if(_===0){P=!0;break}}if(r[T--]=o[m--],--d===1){P=!0;break}if(M=d-mi(r[y],o,0,d,d-1,t),M!==0){for(T-=M,m-=M,d-=M,w=T+1,b=m+1,p=0;p=qr||M>=qr);if(P)break;L<0&&(L=0),L+=2}if(e=L,e<1&&(e=1),d===1){for(T-=_,y-=_,w=T+1,b=y+1,p=_-1;p>=0;p--)r[w+p]=r[b+p];r[T]=o[m]}else{if(d===0)throw new Error;for(b=T-(d-1),p=0;ps&&(f=s),Kn(r,e,e+f,e+a,t),a=f}o.pushRun(e,a),o.mergeRuns(),n-=a,e+=a}while(n!==0);o.forceMergeRuns()}}var It=1,ke=2,jr=4,Jn=!1;function wi(){Jn||(Jn=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function jn(r,t){return r.zlevel===t.zlevel?r.z===t.z?r.z2-t.z2:r.z-t.z:r.zlevel-t.zlevel}var df=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=jn}return r.prototype.traverse=function(t,e){for(var i=0;i=0&&this._roots.splice(n,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}(),Ue;Ue=Y.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var oe={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),-(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)))},elasticOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*r)*Math.sin((r-t)*(2*Math.PI)/i)+1)},elasticInOut:function(r){var t,e=.1,i=.4;return r===0?0:r===1?1:(!e||e<1?(e=1,t=i/4):t=i*Math.asin(1/e)/(2*Math.PI),(r*=2)<1?-.5*(e*Math.pow(2,10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)):e*Math.pow(2,-10*(r-=1))*Math.sin((r-t)*(2*Math.PI)/i)*.5+1)},backIn:function(r){var t=1.70158;return r*r*((t+1)*r-t)},backOut:function(r){var t=1.70158;return--r*r*((t+1)*r+t)+1},backInOut:function(r){var t=2.5949095;return(r*=2)<1?.5*(r*r*((t+1)*r-t)):.5*((r-=2)*r*((t+1)*r+t)+2)},bounceIn:function(r){return 1-oe.bounceOut(1-r)},bounceOut:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},bounceInOut:function(r){return r<.5?oe.bounceIn(r*2)*.5:oe.bounceOut(r*2-1)*.5+.5}},_e=Math.pow,Xt=Math.sqrt,To=1e-8,wo=1e-4,ta=Xt(3),ge=1/3,Dt=Nr(),lt=Nr(),Hr=Nr();function Gt(r){return r>-1e-8&&rTo||r<-1e-8}function j(r,t,e,i,n){var a=1-n;return a*a*(a*r+3*n*t)+n*n*(n*i+3*a*e)}function ra(r,t,e,i,n){var a=1-n;return 3*(((t-r)*a+2*(e-t)*n)*a+(i-e)*n*n)}function Co(r,t,e,i,n,a){var o=i+3*(t-e)-r,s=3*(e-t*2+r),f=3*(t-r),h=r-n,u=s*s-3*o*f,v=s*f-9*o*h,l=f*f-3*s*h,c=0;if(Gt(u)&&Gt(v))if(Gt(s))a[0]=0;else{var _=-f/s;_>=0&&_<=1&&(a[c++]=_)}else{var g=v*v-4*u*l;if(Gt(g)){var d=v/u,_=-s/o+d,p=-d/2;_>=0&&_<=1&&(a[c++]=_),p>=0&&p<=1&&(a[c++]=p)}else if(g>0){var y=Xt(g),m=u*s+1.5*o*(-v+y),T=u*s+1.5*o*(-v-y);m<0?m=-_e(-m,ge):m=_e(m,ge),T<0?T=-_e(-T,ge):T=_e(T,ge);var _=(-s-(m+T))/(3*o);_>=0&&_<=1&&(a[c++]=_)}else{var b=(2*u*s-3*o*v)/(2*Xt(u*u*u)),w=Math.acos(b)/3,L=Xt(u),C=Math.cos(w),_=(-s-2*L*C)/(3*o),p=(-s+L*(C+ta*Math.sin(w)))/(3*o),M=(-s+L*(C-ta*Math.sin(w)))/(3*o);_>=0&&_<=1&&(a[c++]=_),p>=0&&p<=1&&(a[c++]=p),M>=0&&M<=1&&(a[c++]=M)}}return c}function Mo(r,t,e,i,n){var a=6*e-12*t+6*r,o=9*t+3*i-3*r-9*e,s=3*t-3*r,f=0;if(Gt(o)){if(bo(a)){var h=-s/a;h>=0&&h<=1&&(n[f++]=h)}}else{var u=a*a-4*o*s;if(Gt(u))n[0]=-a/(2*o);else if(u>0){var v=Xt(u),h=(-a+v)/(2*o),l=(-a-v)/(2*o);h>=0&&h<=1&&(n[f++]=h),l>=0&&l<=1&&(n[f++]=l)}}return f}function Zt(r,t,e,i,n,a){var o=(t-r)*n+r,s=(e-t)*n+t,f=(i-e)*n+e,h=(s-o)*n+o,u=(f-s)*n+s,v=(u-h)*n+h;a[0]=r,a[1]=o,a[2]=h,a[3]=v,a[4]=v,a[5]=u,a[6]=f,a[7]=i}function pf(r,t,e,i,n,a,o,s,f,h,u){var v,l=.005,c=1/0,_,g,d,p;Dt[0]=f,Dt[1]=h;for(var y=0;y<1;y+=.05)lt[0]=j(r,e,n,o,y),lt[1]=j(t,i,a,s,y),d=Or(Dt,lt),d=0&&d=0&&h<=1&&(n[f++]=h)}}else{var u=o*o-4*a*s;if(Gt(u)){var h=-o/(2*a);h>=0&&h<=1&&(n[f++]=h)}else if(u>0){var v=Xt(u),h=(-o+v)/(2*a),l=(-o-v)/(2*a);h>=0&&h<=1&&(n[f++]=h),l>=0&&l<=1&&(n[f++]=l)}}return f}function Lo(r,t,e){var i=r+e-2*t;return i===0?.5:(r-t)/i}function Ve(r,t,e,i,n){var a=(t-r)*i+r,o=(e-t)*i+t,s=(o-a)*i+a;n[0]=r,n[1]=a,n[2]=s,n[3]=s,n[4]=o,n[5]=e}function yf(r,t,e,i,n,a,o,s,f){var h,u=.005,v=1/0;Dt[0]=o,Dt[1]=s;for(var l=0;l<1;l+=.05){lt[0]=it(r,e,n,l),lt[1]=it(t,i,a,l);var c=Or(Dt,lt);c=0&&c=1?1:Co(0,i,a,1,f,s)&&j(0,n,o,1,s[0])}}}var wf=function(){function r(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||Fr,this.ondestroy=t.ondestroy||Fr,this.onrestart=t.onrestart||Fr,t.easing&&this.setEasing(t.easing)}return r.prototype.step=function(t,e){if(this._inited||(this._startTime=t+this._delay,this._inited=!0),this._paused){this._pausedTime+=e;return}var i=this._life,n=t-this._startTime-this._pausedTime,a=n/i;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var f=n%i;this._startTime=t-f,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(t){this.easing=t,this.easingFunc=zr(t)?t:oe[t]||Po(t)},r}(),So=function(){function r(t){this.value=t}return r}(),bf=function(){function r(){this._len=0}return r.prototype.insert=function(t){var e=new So(t);return this.insertEntry(e),e},r.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++},r.prototype.remove=function(t){var e=t.prev,i=t.next;e?e.next=i:this.head=i,i?i.prev=e:this.tail=e,t.next=t.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}(),ue=function(){function r(t){this._list=new bf,this._maxSize=10,this._map={},this._maxSize=t}return r.prototype.put=function(t,e){var i=this._list,n=this._map,a=null;if(n[t]==null){var o=i.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var f=i.head;i.remove(f),delete n[f.key],a=f.value,this._lastRemovedEntry=f}s?s.value=e:s=new So(e),s.key=t,i.insertEntry(s),n[t]=s}return a},r.prototype.get=function(t){var e=this._map[t],i=this._list;if(e!=null)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}(),ia={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 qt(r){return r=Math.round(r),r<0?0:r>255?255:r}function on(r){return r<0?0:r>1?1:r}function bi(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?qt(parseFloat(t)/100*255):qt(parseInt(t,10))}function dr(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?on(parseFloat(t)/100):on(parseFloat(t))}function Ci(r,t,e){return e<0?e+=1:e>1&&(e-=1),e*6<1?r+(t-r)*e*6:e*2<1?t:e*3<2?r+(t-r)*(2/3-e)*6:r}function ye(r,t,e){return r+(t-r)*e}function ut(r,t,e,i,n){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r}function sn(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}var Ro=new ue(20),me=null;function Tr(r,t){me&&sn(me,t),me=Ro.put(r,me||t.slice())}function zt(r,t){if(r){t=t||[];var e=Ro.get(r);if(e)return sn(t,e);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in ia)return sn(t,ia[i]),Tr(r,t),t;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var a=parseInt(i.slice(1,4),16);if(!(a>=0&&a<=4095)){ut(t,0,0,0,1);return}return ut(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),Tr(r,t),t}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){ut(t,0,0,0,1);return}return ut(t,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),Tr(r,t),t}return}var o=i.indexOf("("),s=i.indexOf(")");if(o!==-1&&s+1===n){var f=i.substr(0,o),h=i.substr(o+1,s-(o+1)).split(","),u=1;switch(f){case"rgba":if(h.length!==4)return h.length===3?ut(t,+h[0],+h[1],+h[2],1):ut(t,0,0,0,1);u=dr(h.pop());case"rgb":if(h.length>=3)return ut(t,bi(h[0]),bi(h[1]),bi(h[2]),h.length===3?u:dr(h[3])),Tr(r,t),t;ut(t,0,0,0,1);return;case"hsla":if(h.length!==4){ut(t,0,0,0,1);return}return h[3]=dr(h[3]),fn(h,t),Tr(r,t),t;case"hsl":if(h.length!==3){ut(t,0,0,0,1);return}return fn(h,t),Tr(r,t),t;default:return}}ut(t,0,0,0,1)}}function fn(r,t){var e=(parseFloat(r[0])%360+360)%360/360,i=dr(r[1]),n=dr(r[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return t=t||[],ut(t,qt(Ci(o,a,e+1/3)*255),qt(Ci(o,a,e)*255),qt(Ci(o,a,e-1/3)*255),1),r.length===4&&(t[3]=r[3]),t}function Cf(r){if(r){var t=r[0]/255,e=r[1]/255,i=r[2]/255,n=Math.min(t,e,i),a=Math.max(t,e,i),o=a-n,s=(a+n)/2,f,h;if(o===0)f=0,h=0;else{s<.5?h=o/(a+n):h=o/(2-a-n);var u=((a-t)/6+o/2)/o,v=((a-e)/6+o/2)/o,l=((a-i)/6+o/2)/o;t===a?f=l-v:e===a?f=1/3+u-l:i===a&&(f=2/3+v-u),f<0&&(f+=1),f>1&&(f-=1)}var c=[f*360,h,s];return r[3]!=null&&c.push(r[3]),c}}function na(r,t){var e=zt(r);if(e){for(var i=0;i<3;i++)e[i]=e[i]*(1-t)|0,e[i]>255?e[i]=255:e[i]<0&&(e[i]=0);return fi(e,e.length===4?"rgba":"rgb")}}function pv(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=zt(t[n]),s=zt(t[a]),f=i-n,h=fi([qt(ye(o[0],s[0],f)),qt(ye(o[1],s[1],f)),qt(ye(o[2],s[2],f)),on(ye(o[3],s[3],f))],"rgba");return e?{color:h,leftIndex:n,rightIndex:a,value:i}:h}}function _v(r,t,e,i){var n=zt(r);if(r)return n=Cf(n),e!=null&&(n[1]=dr(zr(e)?e(n[1]):e)),i!=null&&(n[2]=dr(zr(i)?i(n[2]):i)),fi(fn(n),"rgba")}function fi(r,t){if(!(!r||!r.length)){var e=r[0]+","+r[1]+","+r[2];return(t==="rgba"||t==="hsva"||t==="hsla")&&(e+=","+r[3]),t+"("+e+")"}}function Qe(r,t){var e=zt(r);return e?(.299*e[0]+.587*e[1]+.114*e[2])*e[3]/255+(1-e[3])*t:0}var aa=new ue(100);function gv(r){if($e(r)){var t=aa.get(r);return t||(t=na(r,-.1),aa.put(r,t)),t}else if(oi(r)){var e=N({},r);return e.colorStops=Ot(r.colorStops,function(i){return{offset:i.offset,color:na(i.color,-.1)}}),e}return r}function Mf(r){return r.type==="linear"}function Lf(r){return r.type==="radial"}(function(){return Y.hasGlobalWindow&&zr(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}})();var hn=Array.prototype.slice;function Bt(r,t,e){return(t-r)*e+r}function Mi(r,t,e,i){for(var n=t.length,a=0;ai?t:r,a=Math.min(e,i),o=n[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)i.length=o;else for(var f=a;f=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(t,e,i){this._needsSort=!0;var n=this.keyframes,a=n.length,o=!1,s=sa,f=e;if(Ft(e)){var h=xf(e);s=h,(h===1&&!ze(e[0])||h===2&&!ze(e[0][0]))&&(o=!0)}else if(ze(e)&&!Cs(e))s=we;else if($e(e))if(!isNaN(+e))s=we;else{var u=zt(e);u&&(f=u,s=te)}else if(oi(e)){var v=N({},f);v.colorStops=Ot(e.colorStops,function(c){return{offset:c.offset,color:zt(c.color)}}),Mf(e)?s=un:Lf(e)&&(s=vn),f=v}a===0?this.valType=s:(s!==this.valType||s===sa)&&(o=!0),this.discrete=this.discrete||o;var l={time:t,value:f,rawValue:e,percent:0};return i&&(l.easing=i,l.easingFunc=zr(i)?i:oe[i]||Po(i)),n.push(l),l},r.prototype.prepare=function(t,e){var i=this.keyframes;this._needsSort&&i.sort(function(g,d){return g.time-d.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,f=be(n),h=fa(n),u=0;u=0&&!(o[u].percent<=e);u--);u=l(u,s-2)}else{for(u=v;ue);u++);u=l(u-1,s-2)}_=o[u+1],c=o[u]}if(c&&_){this._lastFr=u,this._lastFrP=e;var d=_.percent-c.percent,p=d===0?1:l((e-c.percent)/d,1);_.easingFunc&&(p=_.easingFunc(p));var y=i?this._additiveValue:h?$r:t[f];if((be(a)||h)&&!y&&(y=this._additiveValue=[]),this.discrete)t[f]=p<1?c.rawValue:_.rawValue;else if(be(a))a===Ge?Mi(y,c[n],_[n],p):Pf(y,c[n],_[n],p);else if(fa(a)){var m=c[n],T=_[n],b=a===un;t[f]={type:b?"linear":"radial",x:Bt(m.x,T.x,p),y:Bt(m.y,T.y,p),colorStops:Ot(m.colorStops,function(L,C){var M=T.colorStops[C];return{offset:Bt(L.offset,M.offset,p),color:Ye(Mi([],L.color,M.color,p))}}),global:T.global},b?(t[f].x2=Bt(m.x2,T.x2,p),t[f].y2=Bt(m.y2,T.y2,p)):t[f].r=Bt(m.r,T.r,p)}else if(h)Mi(y,c[n],_[n],p),i||(t[f]=Ye(y));else{var w=Bt(c[n],_[n],p);i?this._additiveValue=w:t[f]=w}i&&this._addToTarget(t)}}},r.prototype._addToTarget=function(t){var e=this.valType,i=this.propName,n=this._additiveValue;e===we?t[i]=t[i]+n:e===te?(zt(t[i],$r),Te($r,$r,n,1),t[i]=Ye($r)):e===Ge?Te(t[i],t[i],n,1):e===xo&&oa(t[i],t[i],n,1)},r}(),Fn=function(){function r(t,e,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=t,this._loop=e,e&&n){An("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(t){this._target=t},r.prototype.when=function(t,e,i){return this.whenWithKeys(t,e,ht(e),i)},r.prototype.whenWithKeys=function(t,e,i,n){for(var a=this._tracks,o=0;o0&&f.addKeyframe(0,Ne(h),n),this._trackKeys.push(s)}f.addKeyframe(t,Ne(e[s]),n)}return this._maxTime=Math.max(this._maxTime,t),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(t){return this._maxTime=t,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var t=this._doneCbs;if(t)for(var e=t.length,i=0;i0)){this._started=1;for(var e=this,i=[],n=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,t[n]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}();function Dr(){return new Date().getTime()}var If=function(r){W(t,r);function t(e){var i=r.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,e=e||{},i.stage=e.stage||{},i}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var i=e.getClip();i&&this.addClip(i)},t.prototype.removeClip=function(e){if(e.animation){var i=e.prev,n=e.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var i=e.getClip();i&&this.removeClip(i),e.animation=null},t.prototype.update=function(e){for(var i=Dr()-this._pausedTime,n=i-this._time,a=this._head;a;){var o=a.next,s=a.step(i,n);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=i,e||(this.trigger("frame",n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function i(){e._running&&(Ue(i),!e._paused&&e.update())}Ue(i)},t.prototype.start=function(){this._running||(this._time=Dr(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||(this._pauseStart=Dr(),this._paused=!0)},t.prototype.resume=function(){this._paused&&(this._pausedTime+=Dr()-this._pauseStart,this._paused=!1)},t.prototype.clear=function(){for(var e=this._head;e;){var i=e.next;e.prev=e.next=e.animation=null,e=i}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,i){i=i||{},this.start();var n=new Fn(e,i.loop);return this.addAnimator(n),n},t}(Yr),Af=300,Li=Y.domSupported,Pi=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],t=["touchstart","touchend","touchmove"],e={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=Ot(r,function(n){var a=n.replace("mouse","pointer");return e.hasOwnProperty(a)?a:n});return{mouse:r,touch:t,pointer:i}}(),ha={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},ua=!1;function ln(r){var t=r.pointerType;return t==="pen"||t==="touch"}function Ef(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function Si(r){r&&(r.zrByTouch=!0)}function Ff(r,t){return _t(r.dom,new Of(r,t),!0)}function Do(r,t){for(var e=t,i=!1;e&&e.nodeType!==9&&!(i=e.domBelongToZr||e!==t&&e===r.painterRoot);)e=e.parentNode;return i}var Of=function(){function r(t,e){this.stopPropagation=Fr,this.stopImmediatePropagation=Fr,this.preventDefault=Fr,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return r}(),gt={mousedown:function(r){r=_t(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=_t(this.dom,r);var t=this.__mayPointerCapture;t&&(r.zrX!==t[0]||r.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=_t(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=_t(this.dom,r);var t=r.toElement||r.relatedTarget;Do(this,t)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){ua=!0,r=_t(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){ua||(r=_t(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=_t(this.dom,r),Si(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),gt.mousemove.call(this,r),gt.mousedown.call(this,r)},touchmove:function(r){r=_t(this.dom,r),Si(r),this.handler.processGesture(r,"change"),gt.mousemove.call(this,r)},touchend:function(r){r=_t(this.dom,r),Si(r),this.handler.processGesture(r,"end"),gt.mouseup.call(this,r),+new Date-+this.__lastTouchMomentkf||r<-5e-5}var jt=[],wr=[],xi=ne(),Di=Math.abs,On=function(){function r(){}return r.prototype.getLocalTransform=function(t){return r.getLocalTransform(this,t)},r.prototype.setPosition=function(t){this.x=t[0],this.y=t[1]},r.prototype.setScale=function(t){this.scaleX=t[0],this.scaleY=t[1]},r.prototype.setSkew=function(t){this.skewX=t[0],this.skewY=t[1]},r.prototype.setOrigin=function(t){this.originX=t[0],this.originY=t[1]},r.prototype.needLocalTransform=function(){return Jt(this.rotation)||Jt(this.x)||Jt(this.y)||Jt(this.scaleX-1)||Jt(this.scaleY-1)||Jt(this.skewX)||Jt(this.skewY)},r.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),i=this.transform;if(!(e||t)){i&&(la(i),this.invTransform=null);return}i=i||ne(),e?this.getLocalTransform(i):la(i),t&&(e?gi(i,t,i):Js(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i)},r.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(e!=null&&e!==1){this.getGlobalScale(jt);var i=jt[0]<0?-1:1,n=jt[1]<0?-1:1,a=((jt[0]-i)*e+i)/jt[0]||0,o=((jt[1]-n)*e+n)/jt[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}this.invTransform=this.invTransform||ne(),co(this.invTransform,t)},r.prototype.getComputedTransform=function(){for(var t=this,e=[];t;)e.push(t),t=t.parent;for(;t=e.pop();)t.updateTransform();return this.transform},r.prototype.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],n=Math.atan2(t[1],t[0]),a=Math.PI/2+n-Math.atan2(t[3],t[2]);i=Math.sqrt(i)*Math.cos(a),e=Math.sqrt(e),this.skewX=a,this.skewY=0,this.rotation=-n,this.x=+t[4],this.y=+t[5],this.scaleX=e,this.scaleY=i,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(t.invTransform=t.invTransform||ne(),gi(wr,t.invTransform,e),e=wr);var i=this.originX,n=this.originY;(i||n)&&(xi[4]=i,xi[5]=n,gi(wr,e,xi),wr[4]-=i,wr[5]-=n,e=wr),this.setLocalTransform(e)}},r.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)},r.prototype.transformCoordToLocal=function(t,e){var i=[t,e],n=this.invTransform;return n&&ie(i,i,n),i},r.prototype.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&ie(i,i,n),i},r.prototype.getLineScale=function(){var t=this.transform;return t&&Di(t[0]-1)>1e-10&&Di(t[3]-1)>1e-10?Math.sqrt(Di(t[0]*t[3]-t[2]*t[1])):1},r.prototype.copyTransform=function(t){Nf(this,t)},r.getLocalTransform=function(t,e){e=e||[];var i=t.originX||0,n=t.originY||0,a=t.scaleX,o=t.scaleY,s=t.anchorX,f=t.anchorY,h=t.rotation||0,u=t.x,v=t.y,l=t.skewX?Math.tan(t.skewX):0,c=t.skewY?Math.tan(-t.skewY):0;if(i||n||s||f){var _=i+s,g=n+f;e[4]=-_*a-l*g*o,e[5]=-g*o-c*_*a}else e[4]=e[5]=0;return e[0]=a,e[3]=o,e[1]=c*a,e[2]=l*o,h&&js(e,e,h),e[4]+=i+u,e[5]+=n+v,e},r.initDefaultProps=function(){var t=r.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0}(),r}(),ve=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Nf(r,t){for(var e=0;e=ca)){r=r||$t;for(var t=[],e=+new Date,i=0;i<=127;i++)t[i]=gr.measureText(String.fromCharCode(i),r).width;var n=+new Date-e;return n>16?Ii=ca:n>2&&Ii++,t}}var Ii=0,ca=5;function Ao(r,t){return r.asciiWidthMapTried||(r.asciiWidthMap=Yf(r.font),r.asciiWidthMapTried=!0),0<=t&&t<=127?r.asciiWidthMap!=null?r.asciiWidthMap[t]:r.asciiCharWidth:r.stWideCharWidth}function Et(r,t){var e=r.strWidthCache,i=e.get(t);return i==null&&(i=gr.measureText(t,r.font).width,e.put(t,i)),i}function da(r,t,e,i){var n=Et(At(t),r),a=hi(t),o=Wr(0,n,e),s=pr(0,a,i),f=new B(o,s,n,a);return f}function yv(r,t,e,i){var n=((r||"")+"").split(` `),a=n.length;if(a===1)return da(n[0],t,e,i);for(var o=new B(0,0,0,0),s=0;s=0?parseFloat(r)/100*t:parseFloat(r):r}function Gf(r,t,e){var i=t.position||"inside",n=t.distance!=null?t.distance:5,a=e.height,o=e.width,s=a/2,f=e.x,h=e.y,u="left",v="top";if(i instanceof Array)f+=le(i[0],e.width),h+=le(i[1],e.height),u=null,v=null;else switch(i){case"left":f-=n,h+=s,u="right",v="middle";break;case"right":f+=n+o,h+=s,v="middle";break;case"top":f+=o/2,h-=n,u="center",v="bottom";break;case"bottom":f+=o/2,h+=a+n,u="center";break;case"inside":f+=o/2,h+=s,u="center",v="middle";break;case"insideLeft":f+=n,h+=s,v="middle";break;case"insideRight":f+=o-n,h+=s,u="right",v="middle";break;case"insideTop":f+=o/2,h+=n,u="center";break;case"insideBottom":f+=o/2,h+=a-n,u="center",v="bottom";break;case"insideTopLeft":f+=n,h+=n;break;case"insideTopRight":f+=o-n,h+=n,u="right";break;case"insideBottomLeft":f+=n,h+=a-n,v="bottom";break;case"insideBottomRight":f+=o-n,h+=a-n,u="right",v="bottom";break}return r=r||{},r.x=f,r.y=h,r.align=u,r.verticalAlign=v,r}var Ai="__zr_normal__",Ei=ve.concat(["ignore"]),Xf=ai(ve,function(r,t){return r[t]=!0,r},{ignore:!1}),br={},qf=new B(0,0,0,0),Me=[],ui=function(){function r(t){this.id=oo(),this.animators=[],this.currentStates=[],this.states={},this._init(t)}return r.prototype._init=function(t){this.attr(t)},r.prototype.drift=function(t,e,i){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=t,n[5]+=e,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(t){var e=this._textContent;if(e&&(!e.ignore||t)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,a=e.innerTransformable,o=void 0,s=void 0,f=!1;a.parent=n?this:null;var h=!1;a.copyTransform(e);var u=i.position!=null,v=i.autoOverflowArea,l=void 0;if((v||u)&&(l=qf,i.layoutRect?l.copy(i.layoutRect):l.copy(this.getBoundingRect()),n||l.applyTransform(this.transform)),u){this.calculateTextPosition?this.calculateTextPosition(br,i,l):Gf(br,i,l),a.x=br.x,a.y=br.y,o=br.align,s=br.verticalAlign;var c=i.origin;if(c&&i.rotation!=null){var _=void 0,g=void 0;c==="center"?(_=l.width*.5,g=l.height*.5):(_=le(c[0],l.width),g=le(c[1],l.height)),h=!0,a.originX=-a.x+_+(n?0:l.x),a.originY=-a.y+g+(n?0:l.y)}}i.rotation!=null&&(a.rotation=i.rotation);var d=i.offset;d&&(a.x+=d[0],a.y+=d[1],h||(a.originX=-d[0],a.originY=-d[1]));var p=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(v){var y=p.overflowRect=p.overflowRect||new B(0,0,0,0);a.getLocalTransform(Me),co(Me,Me),B.copy(y,l),y.applyTransform(Me)}else p.overflowRect=null;var m=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,T=void 0,b=void 0,w=void 0;m&&this.canBeInsideText()?(T=i.insideFill,b=i.insideStroke,(T==null||T==="auto")&&(T=this.getInsideTextFill()),(b==null||b==="auto")&&(b=this.getInsideTextStroke(T),w=!0)):(T=i.outsideFill,b=i.outsideStroke,(T==null||T==="auto")&&(T=this.getOutsideFill()),(b==null||b==="auto")&&(b=this.getOutsideStroke(T),w=!0)),T=T||"#000",(T!==p.fill||b!==p.stroke||w!==p.autoStroke||o!==p.align||s!==p.verticalAlign)&&(f=!0,p.fill=T,p.stroke=b,p.autoStroke=w,p.align=o,p.verticalAlign=s,e.setDefaultTextStyle(p)),e.__dirty|=It,f&&e.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(t){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?_n:pn},r.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i=typeof e=="string"&&zt(e);i||(i=[255,255,255,1]);for(var n=i[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(a?0:255)*(1-n);return i[3]=1,fi(i,"rgba")},r.prototype.traverse=function(t,e){},r.prototype.attrKV=function(t,e){t==="textConfig"?this.setTextConfig(e):t==="textContent"?this.setTextContent(e):t==="clipPath"?this.setClipPath(e):t==="extra"?(this.extra=this.extra||{},N(this.extra,e)):this[t]=e},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(t,e){if(typeof t=="string")this.attrKV(t,e);else if(Yt(t))for(var i=t,n=ht(i),a=0;a0},r.prototype.getState=function(t){return this.states[t]},r.prototype.ensureState=function(t){var e=this.states;return e[t]||(e[t]={}),e[t]},r.prototype.clearStates=function(t){this.useState(Ai,!1,t)},r.prototype.useState=function(t,e,i,n){var a=t===Ai,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,f=this.stateTransition;if(!(xt(s,t)>=0&&(e||s.length===1))){var h;if(this.stateProxy&&!a&&(h=this.stateProxy(t)),h||(h=this.states&&this.states[t]),!h&&!a){An("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(h);var u=!!(h&&h.hoverLayer||n);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(t,h,this._normalState,e,!i&&!this.__inHover&&f&&f.duration>0,f);var v=this._textContent,l=this._textGuide;return v&&v.useState(t,e,i,u),l&&l.useState(t,e,i,u),a?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),h}}},r.prototype.useStates=function(t,e,i){if(!t.length)this.clearStates();else{var n=[],a=this.currentStates,o=t.length,s=o===a.length;if(s){for(var f=0;f0,_);var g=this._textContent,d=this._textGuide;g&&g.useStates(t,e,l),d&&d.useStates(t,e,l),this._updateAnimationTargets(),this.currentStates=t.slice(),this.markRedraw(),!l&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}},r.prototype.isSilent=function(){for(var t=this;t;){if(t.silent)return!0;var e=t.__hostTarget;t=e?t.ignoreHostSilent?null:e:t.parent}return!1},r.prototype._updateAnimationTargets=function(){for(var t=0;t=0){var i=this.currentStates.slice();i.splice(e,1),this.useStates(i)}},r.prototype.replaceState=function(t,e,i){var n=this.currentStates.slice(),a=xt(n,t),o=xt(n,e)>=0;a>=0?o?n.splice(a,1):n[a]=e:i&&!o&&n.push(e),this.useStates(n)},r.prototype.toggleState=function(t,e){e?this.useState(t,!0):this.removeState(t)},r.prototype._mergeStates=function(t){for(var e={},i,n=0;n=0&&a.splice(o,1)}),this.animators.push(t),i&&i.animation.addAnimator(t),i&&i.wakeUp()},r.prototype.updateDuringAnimation=function(t){this.markRedraw()},r.prototype.stopAnimation=function(t,e){for(var i=this.animators,n=i.length,a=[],o=0;o0&&e.during&&a[0].during(function(_,g){e.during(g)});for(var l=0;l0||n.force&&!o.length){var C=void 0,M=void 0,P=void 0;if(s){M={},l&&(C={});for(var T=0;T=0&&(n.splice(a,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,i){var n=xt(this._children,e);return n>=0&&this.replaceAt(i,n),this},t.prototype.replaceAt=function(e,i){var n=this._children,a=n[i];if(e&&e!==this&&e.parent!==this&&e!==a){n[i]=e,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var i=this.__zr;i&&i!==e.__zr&&e.addSelfToZr(i),i&&i.refresh()},t.prototype.remove=function(e){var i=this.__zr,n=this._children,a=xt(n,e);return a<0?this:(n.splice(a,1),e.parent=null,i&&e.removeSelfFromZr(i),i&&i.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,i=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(t){this._sleepAfterStill=t},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(t){this._disposed||(t=t||{},this.painter.resize(t.width,t.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(t){this._disposed||this.handler.setCursorStyle(t)},r.prototype.findHover=function(t,e){if(!this._disposed)return this.handler.findHover(t,e)},r.prototype.on=function(t,e,i){return this._disposed||this.handler.on(t,e,i),this},r.prototype.off=function(t,e){this._disposed||this.handler.off(t,e)},r.prototype.trigger=function(t,e){this._disposed||this.handler.trigger(t,e)},r.prototype.clear=function(){if(!this._disposed){for(var t=this.storage.getRoots(),e=0;e=s;h++)f-=s;var u=Et(o,e);return u>f&&(e="",u=0),f=r-u,n.ellipsis=e,n.ellipsisWidth=u,n.contentWidth=f,n.containerWidth=r,n}function zo(r,t,e){var i=e.containerWidth,n=e.contentWidth,a=e.fontMeasureInfo;if(!i){r.textLine="",r.isTruncated=!1;return}var o=Et(a,t);if(o<=i){r.textLine=t,r.isTruncated=!1;return}for(var s=0;;s++){if(o<=n||s>=e.maxIterations){t+=e.ellipsis;break}var f=s===0?rh(t,n,a):o>0?Math.floor(t.length*n/o):0;t=t.substr(0,f),o=Et(a,t)}t===""&&(t=e.placeholder),r.textLine=t,r.isTruncated=!0}function rh(r,t,e){for(var i=0,n=0,a=r.length;nd&&c){var m=Math.floor(d/l);_=_||p.length>m,p=p.slice(0,m),y=p.length*l}if(n&&u&&g!=null)for(var T=Bo(g,h,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),b={},w=0;w_&&Bi(a,o.substring(_,d),t,c),Bi(a,g[2],t,c,g[1]),_=Hi.lastIndex}_v){var tt=a.lines.length;D>0?(M.tokens=M.tokens.slice(0,D),L(M,R,P),a.lines=a.lines.slice(0,C+1)):a.lines=a.lines.slice(0,C),a.isTruncated=a.isTruncated||a.lines.length0&&_+i.accumWidth>i.width&&(u=t.split(` `),h=!0),i.accumWidth=_}else{var g=Wo(t,f,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+c,v=g.linesWidths,u=g.lines}}u||(u=t.split(` `));for(var d=At(f),p=0;p=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var sh=ai(",&?/;] ".split(""),function(r,t){return r[t]=!0,r},{});function fh(r){return oh(r)?!!sh[r]:!0}function Wo(r,t,e,i,n){for(var a=[],o=[],s="",f="",h=0,u=0,v=At(t),l=0;le:n+u+_>e){u?(s||f)&&(g?(s||(s=f,f="",h=0,u=h),a.push(s),o.push(u-h),f+=c,h+=_,s="",u=h):(f&&(s+=f,f="",h=0),a.push(s),o.push(u),s=c,u=_)):g?(a.push(f),o.push(h),f=c,h=_):(a.push(c),o.push(_));continue}u+=_,g?(f+=c,h+=_):(f&&(s+=f,f="",h=0),s+=c)}return f&&(s+=f),s&&(a.push(s),o.push(u)),a.length===1&&(u+=n),{accumWidth:u,lines:a,linesWidths:o}}function ga(r,t,e,i,n,a){if(r.baseX=e,r.baseY=i,r.outerWidth=r.outerHeight=null,!!t){var o=t.width*2,s=t.height*2;B.set(ya,Wr(e,o,n),pr(i,s,a),o,s),B.intersect(t,ya,null,ma);var f=ma.outIntersectRect;r.outerWidth=f.width,r.outerHeight=f.height,r.baseX=Wr(f.x,f.width,n,!0),r.baseY=pr(f.y,f.height,a,!0)}}var ya=new B(0,0,0,0),ma={outIntersectRect:{},clamp:!0};function Hn(r){return r!=null?r+="":r=""}function hh(r){var t=Hn(r.text),e=r.font,i=Et(At(e),t),n=hi(e);return yn(r,i,n,null)}function yn(r,t,e,i){var n=new B(Wr(r.x||0,t,r.textAlign),pr(r.y||0,e,r.textBaseline),t,e),a=i??(ko(r)?r.lineWidth:0);return a>0&&(n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a),n}function ko(r){var t=r.stroke;return t!=null&&t!=="none"&&r.lineWidth>0}var mn="__zr_style_"+Math.round(Math.random()*10),_r={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},li={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};_r[mn]=!0;var Ta=["z","z2","invisible"],uh=["invisible"],de=function(r){W(t,r);function t(e){return r.call(this,e)||this}return t.prototype._init=function(e){for(var i=ht(e),n=0;n1e-4){s[0]=r-e,s[1]=t-i,f[0]=r+e,f[1]=t+i;return}if(Le[0]=Ni(n)*e+r,Le[1]=ki(n)*i+t,Pe[0]=Ni(a)*e+r,Pe[1]=ki(a)*i+t,h(s,Le,Pe),u(f,Le,Pe),n=n%tr,n<0&&(n=n+tr),a=a%tr,a<0&&(a=a+tr),n>a&&!o?a+=tr:nn&&(Se[0]=Ni(c)*e+r,Se[1]=ki(c)*i+t,h(s,Se,s),u(f,Se,f))}var O={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},rr=[],er=[],Ct=[],Wt=[],Mt=[],Lt=[],Yi=Math.min,Gi=Math.max,ir=Math.cos,nr=Math.sin,Ht=Math.abs,Tn=Math.PI,Nt=Tn*2,Xi=typeof Float32Array<"u",Zr=[];function qi(r){var t=Math.round(r/Tn*1e8)/1e8;return t%2*Tn}function ph(r,t){var e=qi(r[0]);e<0&&(e+=Nt);var i=e-r[0],n=r[1];n+=i,!t&&n-e>=Nt?n=e+Nt:t&&e-n>=Nt?n=e-Nt:!t&&e>n?n=e+(Nt-qi(e-n)):t&&e0&&(this._ux=Ht(i/Ke/t)||0,this._uy=Ht(i/Ke/e)||0)},r.prototype.setDPR=function(t){this.dpr=t},r.prototype.setContext=function(t){this._ctx=t},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(t,e){return this._drawPendingPt(),this.addData(O.M,t,e),this._ctx&&this._ctx.moveTo(t,e),this._x0=t,this._y0=e,this._xi=t,this._yi=e,this},r.prototype.lineTo=function(t,e){var i=Ht(t-this._xi),n=Ht(e-this._yi),a=i>this._ux||n>this._uy;if(this.addData(O.L,t,e),this._ctx&&a&&this._ctx.lineTo(t,e),a)this._xi=t,this._yi=e,this._pendingPtDist=0;else{var o=i*i+n*n;o>this._pendingPtDist&&(this._pendingPtX=t,this._pendingPtY=e,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(t,e,i,n,a,o){return this._drawPendingPt(),this.addData(O.C,t,e,i,n,a,o),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(t,e,i,n){return this._drawPendingPt(),this.addData(O.Q,t,e,i,n),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this._xi=i,this._yi=n,this},r.prototype.arc=function(t,e,i,n,a,o){this._drawPendingPt(),Zr[0]=n,Zr[1]=a,ph(Zr,o),n=Zr[0],a=Zr[1];var s=a-n;return this.addData(O.A,t,e,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,n,a,o),this._xi=ir(a)*i+t,this._yi=nr(a)*i+e,this},r.prototype.arcTo=function(t,e,i,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(t,e,i,n,a),this},r.prototype.rect=function(t,e,i,n){return this._drawPendingPt(),this._ctx&&this._ctx.rect(t,e,i,n),this.addData(O.R,t,e,i,n),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(O.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&t.closePath(),this._xi=e,this._yi=i,this},r.prototype.fill=function(t){t&&t.fill(),this.toStatic()},r.prototype.stroke=function(t){t&&t.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(t){if(this._saveData){var e=t.length;!(this.data&&this.data.length===e)&&Xi&&(this.data=new Float32Array(e));for(var i=0;i0&&o))for(var s=0;su.length&&(this._expandData(),u=this.data);for(var v=0;v0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var t=[],e=0;e11&&(this.data=new Float32Array(t)))}},r.prototype.getBoundingRect=function(){Ct[0]=Ct[1]=Mt[0]=Mt[1]=Number.MAX_VALUE,Wt[0]=Wt[1]=Lt[0]=Lt[1]=-Number.MAX_VALUE;var t=this.data,e=0,i=0,n=0,a=0,o;for(o=0;oi||Ht(m)>n||l===e-1)&&(g=Math.sqrt(y*y+m*m),a=d,o=p);break}case O.C:{var T=t[l++],b=t[l++],d=t[l++],p=t[l++],w=t[l++],L=t[l++];g=_f(a,o,T,b,d,p,w,L,10),a=w,o=L;break}case O.Q:{var T=t[l++],b=t[l++],d=t[l++],p=t[l++];g=mf(a,o,T,b,d,p,10),a=d,o=p;break}case O.A:var C=t[l++],M=t[l++],P=t[l++],R=t[l++],D=t[l++],x=t[l++],S=x+D;l+=1,_&&(s=ir(D)*P+C,f=nr(D)*R+M),g=Gi(P,R)*Yi(Nt,Math.abs(x)),a=ir(S)*P+C,o=nr(S)*R+M;break;case O.R:{s=a=t[l++],f=o=t[l++];var A=t[l++],E=t[l++];g=A*2+E*2;break}case O.Z:{var y=s-a,m=f-o;g=Math.sqrt(y*y+m*m),a=s,o=f;break}}g>=0&&(h[v++]=g,u+=g)}return this._pathLen=u,u},r.prototype.rebuildPath=function(t,e){var i=this.data,n=this._ux,a=this._uy,o=this._len,s,f,h,u,v,l,c=e<1,_,g,d=0,p=0,y,m=0,T,b;if(!(c&&(this._pathSegLen||this._calculateLength(),_=this._pathSegLen,g=this._pathLen,y=e*g,!y)))t:for(var w=0;w0&&(t.lineTo(T,b),m=0),L){case O.M:s=h=i[w++],f=u=i[w++],t.moveTo(h,u);break;case O.L:{v=i[w++],l=i[w++];var M=Ht(v-h),P=Ht(l-u);if(M>n||P>a){if(c){var R=_[p++];if(d+R>y){var D=(y-d)/R;t.lineTo(h*(1-D)+v*D,u*(1-D)+l*D);break t}d+=R}t.lineTo(v,l),h=v,u=l,m=0}else{var x=M*M+P*P;x>m&&(T=v,b=l,m=x)}break}case O.C:{var S=i[w++],A=i[w++],E=i[w++],H=i[w++],k=i[w++],tt=i[w++];if(c){var R=_[p++];if(d+R>y){var D=(y-d)/R;Zt(h,S,E,k,D,rr),Zt(u,A,H,tt,D,er),t.bezierCurveTo(rr[1],er[1],rr[2],er[2],rr[3],er[3]);break t}d+=R}t.bezierCurveTo(S,A,E,H,k,tt),h=k,u=tt;break}case O.Q:{var S=i[w++],A=i[w++],E=i[w++],H=i[w++];if(c){var R=_[p++];if(d+R>y){var D=(y-d)/R;Ve(h,S,E,D,rr),Ve(u,A,H,D,er),t.quadraticCurveTo(rr[1],er[1],rr[2],er[2]);break t}d+=R}t.quadraticCurveTo(S,A,E,H),h=E,u=H;break}case O.A:var G=i[w++],q=i[w++],X=i[w++],$=i[w++],U=i[w++],dt=i[w++],mt=i[w++],Tt=!i[w++],wt=X>$?X:$,rt=Ht(X-$)>.001,V=U+dt,I=!1;if(c){var R=_[p++];d+R>y&&(V=U+dt*(y-d)/R,I=!0),d+=R}if(rt&&t.ellipse?t.ellipse(G,q,X,$,mt,U,V,Tt):t.arc(G,q,wt,U,V,Tt),I)break t;C&&(s=ir(U)*X+G,f=nr(U)*$+q),h=ir(V)*X+G,u=nr(V)*$+q;break;case O.R:s=h=i[w],f=u=i[w+1],v=i[w++],l=i[w++];var F=i[w++],Gr=i[w++];if(c){var R=_[p++];if(d+R>y){var bt=y-d;t.moveTo(v,l),t.lineTo(v+Yi(bt,F),l),bt-=F,bt>0&&t.lineTo(v+F,l+Yi(bt,Gr)),bt-=Gr,bt>0&&t.lineTo(v+Gi(F-bt,0),l+Gr),bt-=F,bt>0&&t.lineTo(v,l+Gi(Gr-bt,0));break t}d+=R}t.rect(v,l,F,Gr);break;case O.Z:if(c){var R=_[p++];if(d+R>y){var D=(y-d)/R;t.lineTo(h*(1-D)+s*D,u*(1-D)+f*D);break t}d+=R}t.closePath(),h=s,u=f}}},r.prototype.clone=function(){var t=new r,e=this.data;return t.data=e.slice?e.slice():Array.prototype.slice.call(e),t._len=this._len,t},r.prototype.canSave=function(){return!!this._saveData},r.CMD=O,r.initDefaultProps=function(){var t=r.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0}(),r}();function Cr(r,t,e,i,n,a,o){if(n===0)return!1;var s=n,f=0,h=r;if(o>t+s&&o>i+s||or+s&&a>e+s||at+v&&u>i+v&&u>a+v&&u>s+v||ur+v&&h>e+v&&h>n+v&&h>o+v||ht+h&&f>i+h&&f>a+h||fr+h&&s>e+h&&s>n+h||se||u+hn&&(n+=Ur);var l=Math.atan2(f,s);return l<0&&(l+=Ur),l>=i&&l<=n||l+Ur>=i&&l+Ur<=n}function ar(r,t,e,i,n,a){if(a>t&&a>i||an?s:0}var kt=yr.CMD,or=Math.PI*2,mh=1e-4;function Th(r,t){return Math.abs(r-t)t&&h>i&&h>a&&h>s||h1&&wh(),c=j(t,i,a,s,vt[0]),l>1&&(_=j(t,i,a,s,vt[1]))),l===2?dt&&s>i&&s>a||s=0&&h<=1){for(var u=0,v=it(t,i,a,h),l=0;le||s<-e)return 0;var f=Math.sqrt(e*e-s*s);J[0]=-f,J[1]=f;var h=Math.abs(i-n);if(h<1e-4)return 0;if(h>=or-1e-4){i=0,n=or;var u=a?1:-1;return o>=J[0]+r&&o<=J[1]+r?u:0}if(i>n){var v=i;i=n,n=v}i<0&&(i+=or,n+=or);for(var l=0,c=0;c<2;c++){var _=J[c];if(_+r>o){var g=Math.atan2(s,_),u=a?1:-1;g<0&&(g=or+g),(g>=i&&g<=n||g+or>=i&&g+or<=n)&&(g>Math.PI/2&&g1&&(e||(s+=ar(f,h,u,v,i,n))),d&&(f=a[_],h=a[_+1],u=f,v=h),g){case kt.M:u=a[_++],v=a[_++],f=u,h=v;break;case kt.L:if(e){if(Cr(f,h,a[_],a[_+1],t,i,n))return!0}else s+=ar(f,h,a[_],a[_+1],i,n)||0;f=a[_++],h=a[_++];break;case kt.C:if(e){if(_h(f,h,a[_++],a[_++],a[_++],a[_++],a[_],a[_+1],t,i,n))return!0}else s+=bh(f,h,a[_++],a[_++],a[_++],a[_++],a[_],a[_+1],i,n)||0;f=a[_++],h=a[_++];break;case kt.Q:if(e){if(gh(f,h,a[_++],a[_++],a[_],a[_+1],t,i,n))return!0}else s+=Ch(f,h,a[_++],a[_++],a[_],a[_+1],i,n)||0;f=a[_++],h=a[_++];break;case kt.A:var p=a[_++],y=a[_++],m=a[_++],T=a[_++],b=a[_++],w=a[_++];_+=1;var L=!!(1-a[_++]);l=Math.cos(b)*m+p,c=Math.sin(b)*T+y,d?(u=l,v=c):s+=ar(f,h,l,c,i,n);var C=(i-p)*T/m+p;if(e){if(yh(p,y,T,b,b+w,L,t,C,n))return!0}else s+=Mh(p,y,T,b,b+w,L,C,n);f=Math.cos(b+w)*m+p,h=Math.sin(b+w)*T+y;break;case kt.R:u=f=a[_++],v=h=a[_++];var M=a[_++],P=a[_++];if(l=u+M,c=v+P,e){if(Cr(u,v,l,v,t,i,n)||Cr(l,v,l,c,t,i,n)||Cr(l,c,u,c,t,i,n)||Cr(u,c,u,v,t,i,n))return!0}else s+=ar(l,v,l,c,i,n),s+=ar(u,c,u,v,i,n);break;case kt.Z:if(e){if(Cr(f,h,u,v,t,i,n))return!0}else s+=ar(f,h,u,v,i,n);f=u,h=v;break}}return!e&&!Th(h,v)&&(s+=ar(f,h,u,v,i,n)||0),s!==0}function Lh(r,t,e){return Yo(r,0,!1,t,e)}function Ph(r,t,e,i){return Yo(r,t,!0,e,i)}var Go=yt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},_r),Sh={style:yt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},li.style)},$i=ve.concat(["invisible","culling","z","z2","zlevel","parent"]),Z=function(r){W(t,r);function t(e){return r.call(this,e)||this}return t.prototype.update=function(){var e=this;r.prototype.update.call(this);var i=this.style;if(i.decal){var n=this._decalEl=this._decalEl||new t;n.buildPath===t.prototype.buildPath&&(n.buildPath=function(f){e.buildPath(f,e.shape)}),n.silent=!0;var a=n.style;for(var o in i)a[o]!==i[o]&&(a[o]=i[o]);a.fill=i.fill?i.decal:null,a.decal=null,a.shadowColor=null,i.strokeFirst&&(a.stroke=null);for(var s=0;s<$i.length;++s)n[$i[s]]=this[$i[s]];n.__dirty|=It}else this._decalEl&&(this._decalEl=null)},t.prototype.getDecalElement=function(){return this._decalEl},t.prototype._init=function(e){var i=ht(e);this.shape=this.getDefaultShape();var n=this.getDefaultStyle();n&&this.useStyle(n);for(var a=0;a.5?pn:i>.2?Wf:_n}else if(e)return _n}return pn},t.prototype.getInsideTextStroke=function(e){var i=this.style.fill;if($e(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Qe(e,0)0))},t.prototype.hasFill=function(){var e=this.style,i=e.fill;return i!=null&&i!=="none"},t.prototype.getBoundingRect=function(){var e=this._rect,i=this.style,n=!e;if(n){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&jr)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),e=o.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=e.clone());if(this.__dirty||n){s.copy(e);var f=i.strokeNoScale?this.getLineScale():1,h=i.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;h=Math.max(h,u??4)}f>1e-10&&(s.width+=h/f,s.height+=h/f,s.x-=h/f/2,s.y-=h/f/2)}return s}return e},t.prototype.contain=function(e,i){var n=this.transformCoordToLocal(e,i),a=this.getBoundingRect(),o=this.style;if(e=n[0],i=n[1],a.contain(e,i)){var s=this.path;if(this.hasStroke()){var f=o.lineWidth,h=o.strokeNoScale?this.getLineScale():1;if(h>1e-10&&(this.hasFill()||(f=Math.max(f,this.strokeContainThreshold)),Ph(s,f/h,e,i)))return!0}if(this.hasFill())return Lh(s,e,i)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=jr,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate("shape",e)},t.prototype.updateDuringAnimation=function(e){e==="style"?this.dirtyStyle():e==="shape"?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(e,i){e==="shape"?this.setShape(i):r.prototype.attrKV.call(this,e,i)},t.prototype.setShape=function(e,i){var n=this.shape;return n||(n=this.shape={}),typeof e=="string"?n[e]=i:N(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&jr)},t.prototype.createStyle=function(e){return si(Go,e)},t.prototype._innerSaveToNormal=function(e){r.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.shape&&!i.shape&&(i.shape=N({},this.shape))},t.prototype._applyStateObj=function(e,i,n,a,o,s){r.prototype._applyStateObj.call(this,e,i,n,a,o,s);var f=!(i&&a),h;if(i&&i.shape?o?a?h=i.shape:(h=N({},n.shape),N(h,i.shape)):(h=N({},a?this.shape:n.shape),N(h,i.shape)):f&&(h=n.shape),h)if(o){this.shape=N({},this.shape);for(var u={},v=ht(h),l=0;ln&&(v=s+f,s*=n/v,f*=n/v),h+u>n&&(v=h+u,h*=n/v,u*=n/v),f+h>a&&(v=f+h,f*=a/v,h*=a/v),s+u>a&&(v=s+u,s*=a/v,u*=a/v),r.moveTo(e+s,i),r.lineTo(e+n-f,i),f!==0&&r.arc(e+n-f,i+f,f,-Math.PI/2,0),r.lineTo(e+n,i+a-h),h!==0&&r.arc(e+n-h,i+a-h,h,0,Math.PI/2),r.lineTo(e+u,i+a),u!==0&&r.arc(e+u,i+a-u,u,Math.PI/2,Math.PI),r.lineTo(e,i+s),s!==0&&r.arc(e+s,i+s,s,Math.PI,Math.PI*1.5)}var Ir=Math.round;function Eh(r,t,e){if(t){var i=t.x1,n=t.x2,a=t.y1,o=t.y2;r.x1=i,r.x2=n,r.y1=a,r.y2=o;var s=e&&e.lineWidth;return s&&(Ir(i*2)===Ir(n*2)&&(r.x1=r.x2=Ar(i,s,!0)),Ir(a*2)===Ir(o*2)&&(r.y1=r.y2=Ar(a,s,!0))),r}}function Fh(r,t,e){if(t){var i=t.x,n=t.y,a=t.width,o=t.height;r.x=i,r.y=n,r.width=a,r.height=o;var s=e&&e.lineWidth;return s&&(r.x=Ar(i,s,!0),r.y=Ar(n,s,!0),r.width=Math.max(Ar(i+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(Ar(n+o,s,!1)-r.y,o===0?0:1)),r}}function Ar(r,t,e){if(!t)return r;var i=Ir(r*2);return(i+Ir(t))%2===0?i/2:(i+(e?1:-1))/2}var Oh=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}(),Hh={},zn=function(r){W(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Oh},t.prototype.buildPath=function(e,i){var n,a,o,s;if(this.subPixelOptimize){var f=Fh(Hh,i,this.style);n=f.x,a=f.y,o=f.width,s=f.height,f.r=i.r,i=f}else n=i.x,a=i.y,o=i.width,s=i.height;i.r?Ah(e,i):e.rect(n,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Z);zn.prototype.type="rect";var La={fill:"#000"},Pa=2,Pt={},Bh={style:yt({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},li.style)},zh=function(r){W(t,r);function t(e){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=La,i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var e=0;e0,D=0;D=0&&(S=w[x],S.align==="right");)this._placeToken(S,e,C,p,D,"right",m),M-=S.width,D-=S.width,x--;for(R+=(u-(R-d)-(y-D)-M)/2;P<=x;)S=w[P],this._placeToken(S,e,C,p,R+S.width/2,"center",m),R+=S.width,P++;p+=C}},t.prototype._placeToken=function(e,i,n,a,o,s,f){var h=i.rich[e.styleName]||{};h.text=e.text;var u=e.verticalAlign,v=a+n/2;u==="top"?v=a+e.height/2:u==="bottom"&&(v=a+n-e.height/2);var l=!e.isLineHolder&&Zi(h);l&&this._renderBackground(h,i,s==="right"?o-e.width:s==="center"?o-e.width/2:o,v-e.height/2,e.width,e.height);var c=!!h.backgroundColor,_=e.textPadding;_&&(o=Aa(o,s,_),v-=e.height/2-_[0]-e.innerHeight/2);var g=this._getOrCreateChild(Je),d=g.createStyle();g.useStyle(d);var p=this._defaultStyle,y=!1,m=0,T=!1,b=Ia("fill"in h?h.fill:"fill"in i?i.fill:(y=!0,p.fill)),w=Da("stroke"in h?h.stroke:"stroke"in i?i.stroke:!c&&!f&&(!p.autoStroke||y)?(m=Pa,T=!0,p.stroke):null),L=h.textShadowBlur>0||i.textShadowBlur>0;d.text=e.text,d.x=o,d.y=v,L&&(d.shadowBlur=h.textShadowBlur||i.textShadowBlur||0,d.shadowColor=h.textShadowColor||i.textShadowColor||"transparent",d.shadowOffsetX=h.textShadowOffsetX||i.textShadowOffsetX||0,d.shadowOffsetY=h.textShadowOffsetY||i.textShadowOffsetY||0),d.textAlign=s,d.textBaseline="middle",d.font=e.font||$t,d.opacity=We(h.opacity,i.opacity,1),Ra(d,h),w&&(d.lineWidth=We(h.lineWidth,i.lineWidth,m),d.lineDash=ct(h.lineDash,i.lineDash),d.lineDashOffset=i.lineDashOffset||0,d.stroke=w),b&&(d.fill=b),g.setBoundingRect(yn(d,e.contentWidth,e.contentHeight,T?0:null))},t.prototype._renderBackground=function(e,i,n,a,o,s){var f=e.backgroundColor,h=e.borderWidth,u=e.borderColor,v=f&&f.image,l=f&&!v,c=e.borderRadius,_=this,g,d;if(l||e.lineHeight||h&&u){g=this._getOrCreateChild(zn),g.useStyle(g.createStyle()),g.style.fill=null;var p=g.shape;p.x=n,p.y=a,p.width=o,p.height=s,p.r=c,g.dirtyShape()}if(l){var y=g.style;y.fill=f||null,y.fillOpacity=ct(e.fillOpacity,1)}else if(v){d=this._getOrCreateChild(Bn),d.onload=function(){_.dirtyStyle()};var m=d.style;m.image=f.image,m.x=n,m.y=a,m.width=o,m.height=s}if(h&&u){var y=g.style;y.lineWidth=h,y.stroke=u,y.strokeOpacity=ct(e.strokeOpacity,1),y.lineDash=e.borderDash,y.lineDashOffset=e.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var T=(g||d).style;T.shadowBlur=e.shadowBlur||0,T.shadowColor=e.shadowColor||"transparent",T.shadowOffsetX=e.shadowOffsetX||0,T.shadowOffsetY=e.shadowOffsetY||0,T.opacity=We(e.opacity,i.opacity,1)},t.makeFont=function(e){var i="";return Yh(e)&&(i=[e.fontStyle,e.fontWeight,Nh(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),i&&Kr(i)||e.textFont||e.font},t}(de),Wh={left:!0,right:1,center:1},kh={top:1,bottom:1,middle:1},Sa=["fontStyle","fontWeight","fontSize","fontFamily"];function Nh(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?xn+"px":r+"px"}function Ra(r,t){for(var e=0;e1&&(o*=Ui(_),s*=Ui(_));var g=(n===a?-1:1)*Ui((o*o*(s*s)-o*o*(c*c)-s*s*(l*l))/(o*o*(c*c)+s*s*(l*l)))||0,d=g*o*c/s,p=g*-s*l/o,y=(r+e)/2+De(v)*d-xe(v)*p,m=(t+i)/2+xe(v)*d+De(v)*p,T=Ha([1,0],[(l-d)/o,(c-p)/s]),b=[(l-d)/o,(c-p)/s],w=[(-1*l-d)/o,(-1*c-p)/s],L=Ha(b,w);if(wn(b,w)<=-1&&(L=Vr),wn(b,w)>=1&&(L=0),L<0){var C=Math.round(L/Vr*1e6)/1e6;L=Vr*2+C%2*Vr}u.addData(h,y,m,o,s,T,L,v,a)}var $h=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Zh=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Uh(r){var t=new yr;if(!r)return t;var e=0,i=0,n=e,a=i,o,s=yr.CMD,f=r.match($h);if(!f)return t;for(var h=0;hS*S+A*A&&(C=P,M=R),{cx:C,cy:M,x0:-u,y0:-v,x1:C*(n/b-1),y1:M*(n/b-1)}}function ru(r){var t;if(he(r)){var e=r.length;if(!e)return r;e===1?t=[r[0],r[0],0,0]:e===2?t=[r[0],r[0],r[1],r[1]]:e===3?t=r.concat(r[2]):t=r}else t=[r,r,r,r];return t}function eu(r,t){var e,i=re(t.r,0),n=re(t.r0||0,0),a=i>0,o=n>0;if(!(!a&&!o)){if(a||(i=n,n=0),n>i){var s=i;i=n,n=s}var f=t.startAngle,h=t.endAngle;if(!(isNaN(f)||isNaN(h))){var u=t.cx,v=t.cy,l=!!t.clockwise,c=za(h-f),_=c>Vi&&c%Vi;if(_>pt&&(c=_),!(i>pt))r.moveTo(u,v);else if(c>Vi-pt)r.moveTo(u+i*Lr(f),v+i*sr(f)),r.arc(u,v,i,f,h,!l),n>pt&&(r.moveTo(u+n*Lr(h),v+n*sr(h)),r.arc(u,v,n,h,f,l));else{var g=void 0,d=void 0,p=void 0,y=void 0,m=void 0,T=void 0,b=void 0,w=void 0,L=void 0,C=void 0,M=void 0,P=void 0,R=void 0,D=void 0,x=void 0,S=void 0,A=i*Lr(f),E=i*sr(f),H=n*Lr(h),k=n*sr(h),tt=c>pt;if(tt){var G=t.cornerRadius;G&&(e=ru(G),g=e[0],d=e[1],p=e[2],y=e[3]);var q=za(i-n)/2;if(m=St(q,p),T=St(q,y),b=St(q,g),w=St(q,d),M=L=re(m,T),P=C=re(b,w),(L>pt||C>pt)&&(R=i*Lr(h),D=i*sr(h),x=n*Lr(f),S=n*sr(f),cpt){var rt=St(p,M),V=St(y,M),I=Ie(x,S,A,E,i,rt,l),F=Ie(R,D,H,k,i,V,l);r.moveTo(u+I.cx+I.x0,v+I.cy+I.y0),M0&&r.arc(u+I.cx,v+I.cy,rt,K(I.y0,I.x0),K(I.y1,I.x1),!l),r.arc(u,v,i,K(I.cy+I.y1,I.cx+I.x1),K(F.cy+F.y1,F.cx+F.x1),!l),V>0&&r.arc(u+F.cx,v+F.cy,V,K(F.y1,F.x1),K(F.y0,F.x0),!l))}else r.moveTo(u+A,v+E),r.arc(u,v,i,f,h,!l);if(!(n>pt)||!tt)r.lineTo(u+H,v+k);else if(P>pt){var rt=St(g,P),V=St(d,P),I=Ie(H,k,R,D,n,-V,l),F=Ie(A,E,x,S,n,-rt,l);r.lineTo(u+I.cx+I.x0,v+I.cy+I.y0),P0&&r.arc(u+I.cx,v+I.cy,V,K(I.y0,I.x0),K(I.y1,I.x1),!l),r.arc(u,v,n,K(I.cy+I.y1,I.cx+I.x1),K(F.cy+F.y1,F.cx+F.x1),l),rt>0&&r.arc(u+F.cx,v+F.cy,rt,K(F.y1,F.x1),K(F.y0,F.x0),!l))}else r.lineTo(u+H,v+k),r.arc(u,v,n,h,f,l)}r.closePath()}}}var iu=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}(),bn=function(r){W(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new iu},t.prototype.buildPath=function(e,i){eu(e,i)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Z);bn.prototype.type="sector";var nu=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}(),au=function(r){W(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new nu},t.prototype.buildPath=function(e,i){var n=i.cx,a=i.cy,o=Math.PI*2;e.moveTo(n+i.r,a),e.arc(n,a,i.r,0,o,!1),e.moveTo(n+i.r0,a),e.arc(n,a,i.r0,0,o,!0)},t}(Z);au.prototype.type="ring";function ou(r,t,e,i){var n=[],a=[],o=[],s=[],f,h,u,v;if(i){u=[1/0,1/0],v=[-1/0,-1/0];for(var l=0,c=r.length;l=2){if(i){var a=ou(n,i,e,t.smoothConstraint);r.moveTo(n[0][0],n[0][1]);for(var o=n.length,s=0;s<(e?o:o-1);s++){var f=a[s*2],h=a[s*2+1],u=n[(s+1)%o];r.bezierCurveTo(f[0],f[1],h[0],h[1],u[0],u[1])}}else{r.moveTo(n[0][0],n[0][1]);for(var s=1,v=n.length;shr[1]){if(a=!1,Q.negativeSize||i)return a;var f=Ae(hr[0]-fr[1]),h=Ae(fr[0]-hr[1]);Qi(f,h)>Fe.len()&&(f=h||!Q.bidirectional)&&(z.scale(Ee,s,-h*n),Q.useDir&&Q.calcDirMTV()))}}return a},r.prototype._getProjMinMaxOnAxis=function(t,e,i){for(var n=this._axes[t],a=this._origin,o=e[0].dot(n)+a[t],s=o,f=o,h=1;h=0&&lr(f)?f:.5;var h=r.createRadialGradient(o,s,0,o,s,f);return h}function Cn(r,t,e){for(var i=t.type==="radial"?bu(r,t,e):wu(r,t,e),n=t.colorStops,a=0;a0)?null:r==="dashed"?[4*t,2*t]:r==="dotted"?[t]:ze(r)?[r]:he(r)?r:null}function jo(r){var t=r.style,e=t.lineDash&&t.lineWidth>0&&Mu(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(e){var n=t.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(e=Ot(e,function(a){return a/n}),i/=n)}return[e,i]}var Lu=new yr(!0);function je(r){var t=r.stroke;return!(t==null||t==="none"||!(r.lineWidth>0))}function ka(r){return typeof r=="string"&&r!=="none"}function ti(r){var t=r.fill;return t!=null&&t!=="none"}function Na(r,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.fillOpacity*t.opacity,r.fill(),r.globalAlpha=e}else r.fill()}function Ya(r,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var e=r.globalAlpha;r.globalAlpha=t.strokeOpacity*t.opacity,r.stroke(),r.globalAlpha=e}else r.stroke()}function Mn(r,t,e){var i=Ho(t.image,t.__image,e);if(vi(i)){var n=r.createPattern(i,t.repeat||"repeat");if(typeof DOMMatrix=="function"&&n&&n.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*Rs),a.scaleSelf(t.scaleX||1,t.scaleY||1),n.setTransform(a)}return n}}function Pu(r,t,e,i){var n,a=je(e),o=ti(e),s=e.strokePercent,f=s<1,h=!t.path;(!t.silent||f)&&h&&t.createPathProxy();var u=t.path||Lu,v=t.__dirty;if(!i){var l=e.fill,c=e.stroke,_=o&&!!l.colorStops,g=a&&!!c.colorStops,d=o&&!!l.image,p=a&&!!c.image,y=void 0,m=void 0,T=void 0,b=void 0,w=void 0;(_||g)&&(w=t.getBoundingRect()),_&&(y=v?Cn(r,l,w):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(m=v?Cn(r,c,w):t.__canvasStrokeGradient,t.__canvasStrokeGradient=m),d&&(T=v||!t.__canvasFillPattern?Mn(r,l,t):t.__canvasFillPattern,t.__canvasFillPattern=T),p&&(b=v||!t.__canvasStrokePattern?Mn(r,c,t):t.__canvasStrokePattern,t.__canvasStrokePattern=b),_?r.fillStyle=y:d&&(T?r.fillStyle=T:o=!1),g?r.strokeStyle=m:p&&(b?r.strokeStyle=b:a=!1)}var L=t.getGlobalScale();u.setScale(L[0],L[1],t.segmentIgnoreThreshold);var C,M;r.setLineDash&&e.lineDash&&(n=jo(t),C=n[0],M=n[1]);var P=!0;(h||v&jr)&&(u.setDPR(r.dpr),f?u.setContext(null):(u.setContext(r),P=!1),u.reset(),t.buildPath(u,t.shape,i),u.toStatic(),t.pathUpdated()),P&&u.rebuildPath(r,f?s:1),C&&(r.setLineDash(C),r.lineDashOffset=M),i||(e.strokeFirst?(a&&Ya(r,e),o&&Na(r,e)):(o&&Na(r,e),a&&Ya(r,e))),C&&r.setLineDash([])}function Su(r,t,e){var i=t.__image=Ho(e.image,t.__image,t,t.onload);if(!(!i||!vi(i))){var n=e.x||0,a=e.y||0,o=t.getWidth(),s=t.getHeight(),f=i.width/i.height;if(o==null&&s!=null?o=s*f:s==null&&o!=null?s=o/f:o==null&&s==null&&(o=i.width,s=i.height),e.sWidth&&e.sHeight){var h=e.sx||0,u=e.sy||0;r.drawImage(i,h,u,e.sWidth,e.sHeight,n,a,o,s)}else if(e.sx&&e.sy){var h=e.sx,u=e.sy,v=o-h,l=s-u;r.drawImage(i,h,u,v,l,n,a,o,s)}else r.drawImage(i,n,a,o,s)}}function Ru(r,t,e){var i,n=e.text;if(n!=null&&(n+=""),n){r.font=e.font||$t,r.textAlign=e.textAlign,r.textBaseline=e.textBaseline;var a=void 0,o=void 0;r.setLineDash&&e.lineDash&&(i=jo(t),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),e.strokeFirst?(je(e)&&r.strokeText(n,e.x,e.y),ti(e)&&r.fillText(n,e.x,e.y)):(ti(e)&&r.fillText(n,e.x,e.y),je(e)&&r.strokeText(n,e.x,e.y)),a&&r.setLineDash([])}}var Ga=["shadowBlur","shadowOffsetX","shadowOffsetY"],Xa=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function ts(r,t,e,i,n){var a=!1;if(!i&&(e=e||{},t===e))return!1;if(i||t.opacity!==e.opacity){ot(r,n),a=!0;var o=Math.max(Math.min(t.opacity,1),0);r.globalAlpha=isNaN(o)?_r.opacity:o}(i||t.blend!==e.blend)&&(a||(ot(r,n),a=!0),r.globalCompositeOperation=t.blend||_r.blend);for(var s=0;s2&&i.push(n),n=[x,S]}function u(x,S,A,E){Er(x,A)&&Er(S,E)||n.push(x,S,A,E,A,E)}function v(x,S,A,E,H,k){var tt=Math.abs(S-x),G=Math.tan(tt/4)*4/3,q=SC:R2&&i.push(n),i}function Pn(r,t,e,i,n,a,o,s,f,h){if(Er(r,e)&&Er(t,i)&&Er(n,o)&&Er(a,s)){f.push(o,s);return}var u=2/h,v=u*u,l=o-r,c=s-t,_=Math.sqrt(l*l+c*c);l/=_,c/=_;var g=e-r,d=i-t,p=n-o,y=a-s,m=g*g+d*d,T=p*p+y*y;if(m=0&&C=0){f.push(o,s);return}var M=[],P=[];Zt(r,e,n,o,.5,M),Zt(t,i,a,s,.5,P),Pn(M[0],P[0],M[1],P[1],M[2],P[2],M[3],P[3],f,h),Pn(M[4],P[4],M[5],P[5],M[6],P[6],M[7],P[7],f,h)}function Ou(r,t){var e=Ln(r),i=[];t=t||1;for(var n=0;n0)for(var h=0;hMath.abs(h),v=es([f,h],u?0:1,t),l=(u?s:h)/v.length,c=0;cn,o=es([i,n],a?0:1,t),s=a?"width":"height",f=a?"height":"width",h=a?"x":"y",u=a?"y":"x",v=r[s]/o.length,l=0;l1?null:new z(g*f+r,g*h+t)}function zu(r,t,e){var i=new z;z.sub(i,e,t),i.normalize();var n=new z;z.sub(n,r,t);var a=n.dot(i);return a}function Pr(r,t){var e=r[r.length-1];e&&e[0]===t[0]&&e[1]===t[1]||r.push(t)}function Wu(r,t,e){for(var i=r.length,n=[],a=0;ao?(h.x=u.x=s+a/2,h.y=f,u.y=f+o):(h.y=u.y=f+o/2,h.x=s,u.x=s+a),Wu(t,h,u)}function ri(r,t,e,i){if(e===1)i.push(t);else{var n=Math.floor(e/2),a=r(t);ri(r,a[0],n,i),ri(r,a[1],e-n,i)}return i}function ku(r,t){for(var e=[],i=0;i0;h/=2){var u=0,v=0;(r&h)>0&&(u=1),(t&h)>0&&(v=1),s+=h*h*(3*u^v),v===0&&(u===1&&(r=h-1-r,t=h-1-t),f=r,r=t,t=f)}return s}function ii(r){var t=1/0,e=1/0,i=-1/0,n=-1/0,a=Ot(r,function(s){var f=s.getBoundingRect(),h=s.getComputedTransform(),u=f.x+f.width/2+(h?h[4]:0),v=f.y+f.height/2+(h?h[5]:0);return t=Math.min(u,t),e=Math.min(v,e),i=Math.max(u,i),n=Math.max(v,n),[u,v]}),o=Ot(a,function(s,f){return{cp:s,z:Vu(s[0],s[1],t,e,i,n),path:r[f]}});return o.sort(function(s,f){return s.z-f.z}).map(function(s){return s.path})}function os(r){return Gu(r.path,r.count)}function Rn(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Dv(r,t,e){var i=[];function n(b){for(var w=0;w=s)}}for(var v=this.__startIndex;v15)break}}S.prevElClipPaths&&p.restore()};if(y)if(y.length===0)C=d.__endIndex;else for(var P=c.dpr,R=0;R0&&t>n[0]){for(f=0;ft);f++);s=i[n[f]]}if(n.splice(f+1,0,t),i[t]=e,!e.virtual)if(s){var h=s.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)}},r.prototype.eachLayer=function(t,e){for(var i=this._zlevelList,n=0;n0?Be:0),this._needsManuallyCompositing),u.__builtin__||An("ZLevel "+h+" has been used by unkown layer "+u.id),u!==a&&(u.__used=!0,u.__startIndex!==f&&(u.__dirty=!0),u.__startIndex=f,u.incremental?u.__drawIndex=-1:u.__drawIndex=f,e(f),a=u),n.__dirty&It&&!n.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=f))}e(f),this.eachBuiltinLayer(function(v,l){!v.__used&&v.getElementCount()>0&&(v.__dirty=!0,v.__startIndex=v.__endIndex=v.__drawIndex=0),v.__dirty&&v.__drawIndex<0&&(v.__drawIndex=v.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(t){t.clear()},r.prototype.setBackgroundColor=function(t){this._backgroundColor=t,st(this._layers,function(e){e.setUnpainted()})},r.prototype.configLayer=function(t,e){if(e){var i=this._layerConfig;i[t]?Qr(i[t],e,!0):i[t]=e;for(var n=0;n