var yi=function(r,t){return yi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},yi(r,t)};function k(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yi(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var To=(function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r})(),bo=(function(){function r(){this.browser=new To,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})(),F=new bo;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(F.wxa=!0,F.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?F.worker=!0:!F.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(F.node=!0,F.svgSupported=!0):So(navigator.userAgent,F);function So(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 $i=12,Co="sans-serif",xt=$i+"px "+Co,Mo=20,Po=100,Lo="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Ro(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=Ao&&(ze=0),ze++}function Ji(){for(var r=[],t=0;t>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(){j(e,function(u){u.parentNode&&u.parentNode.removeChild(u)})},e}function gs(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(),l=2*h,c=u.left,d=u.top;o.push(c,d),f=f&&a&&c===a[l]&&d===a[l+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 za(r){return r.nodeName.toUpperCase()==="CANVAS"}var ms=/([&<>"'])/g,ys={"&":"&","<":"<",">":">",'"':""","'":"'"};function tu(r){return r==null?"":(r+"").replace(ms,function(t,e){return ys[e]})}var ws=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,We=[],Ts=F.browser.firefox&&+F.browser.version.split(".")[0]<39;function Mi(r,t,e,i){return e=e||{},i?mn(r,t,e):Ts&&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):mn(r,t,e),e}function mn(r,t,e){if(F.domSupported&&r.getBoundingClientRect){var i=t.clientX,n=t.clientY;if(za(r)){var a=r.getBoundingClientRect();e.zrX=i-a.left,e.zrY=n-a.top;return}else if(Ci(We,r,i,n)){e.zrX=We[0],e.zrY=We[1];return}}e.zrX=e.zrY=0}function sn(r){return r||window.event}function et(r,t,e){if(t=sn(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&&Mi(r,o,t,e)}else{Mi(r,t,t,e);var a=bs(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var s=t.button;return t.which==null&&s!==void 0&&ws.test(t.type)&&(t.which=s&1?1:s&2?3:s&4?2:0),t}function bs(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 Ss(r,t,e,i){r.addEventListener(t,e,i)}function Cs(r,t,e,i){r.removeEventListener(t,e,i)}var Ms=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0};function ru(r){return r.which===2||r.which===3}var Ps=(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=yn(i)/yn(n);!isFinite(a)&&(a=1),t.pinchScale=a;var o=Ls(i);return t.pinchX=o[0],t.pinchY=o[1],{type:"pinch",target:r[0].target,event:t}}}}};function Jt(){return[1,0,0,1,0,0]}function fn(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function hn(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 ce(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 Pi(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 Na(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),l=Math.cos(e);return r[0]=n*l+s*u,r[1]=-n*u+s*l,r[2]=a*l+f*u,r[3]=-a*u+l*f,r[4]=l*(o-i[0])+u*(h-i[1])+i[0],r[5]=l*(h-i[1])-u*(o-i[0])+i[1],r}function Wa(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 un(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}function Rs(r){var t=Jt();return hn(t,r),t}const eu=Object.freeze(Object.defineProperty({__proto__:null,clone:Rs,copy:hn,create:Jt,identity:fn,invert:un,mul:ce,rotate:Na,scale:Wa,translate:Pi},Symbol.toStringTag,{value:"Module"}));var nt=(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})(),kt=Math.min,cr=Math.max,Li=Math.abs,wn=["x","y"],Ds=["width","height"],At=new nt,Ft=new nt,It=new nt,Ht=new nt,G=As(),xr=G.minTv,Ri=G.maxTv,Hr=[0,0],O=(function(){function r(t,e,i,n){Xe(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=kt(t.x,this.x),i=kt(t.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=cr(t.x+t.width,this.x+this.width)-e:this.width=t.width,isFinite(this.y)&&isFinite(this.height)?this.height=cr(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){return xs(Jt(),this,t)},r.prototype.intersect=function(t,e,i){return r.intersect(this,t,e,i)},r.intersect=function(t,e,i,n){i&&nt.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=Xe(Es,t.x,t.y,t.width,t.height)),e instanceof r||(e=Xe(Os,e.x,e.y,e.width,e.height));var s=!!i;G.reset(n,s);var f=G.touchThreshold,h=t.x+f,u=t.x+t.width-f,l=t.y+f,c=t.y+t.height-f,d=e.x+f,v=e.x+e.width-f,g=e.y+f,_=e.y+e.height-f;if(h>u||l>c||d>v||g>_)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){Tn(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?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},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&&Tn(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}At.x=It.x=e.x,At.y=Ht.y=e.y,Ft.x=Ht.x=e.x+e.width,Ft.y=It.y=e.y+e.height,At.transform(i),Ht.transform(i),Ft.transform(i),It.transform(i),t.x=kt(At.x,Ft.x,It.x,Ht.x),t.y=kt(At.y,Ft.y,It.y,Ht.y);var f=cr(At.x,Ft.x,It.x,Ht.x),h=cr(At.y,Ft.y,It.y,Ht.y);t.width=f-t.x,t.height=h-t.y},r.calculateTransform=function(t,e,i){var n=i.width/e.width,a=i.height/e.height;return t=fn(t||[]),Pi(t,t,ve(Ge,-e.x,-e.y)),Wa(t,t,ve(Ge,n,a)),Pi(t,t,ve(Ge,i.x,i.y)),t},r})(),iu=O.create,Xe=O.set,Tn=O.copy,xs=O.calculateTransform,nu=O.applyTransform,au=O.contain,Es=new O(0,0,0,0),Os=new O(0,0,0,0),Ge=[];function bn(r,t,e,i,n,a,o,s){var f=Li(t-e),h=Li(i-r),u=kt(f,h),l=wn[n],c=wn[1-n],d=Ds[n];t=h||!G.bidirectional)&&(xr[l]=-h,xr[c]=0,G.useDir&&G.calcDirMTV())))}function As(){var r=0,t=new nt,e=new nt,i={minTv:new nt,maxTv:new nt,useDir:!1,dirMinTv:new nt,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(a,o){i.touchThreshold=0,a&&a.touchThreshold!=null&&(i.touchThreshold=cr(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;l--){var c=a[l];c!==n&&!c.ignore&&!c.ignoreCoarsePointer&&(!c.parent||!c.parent.ignoreCoarsePointer)&&(qe.copy(c.getBoundingRect()),c.transform&&qe.applyTransform(c.transform),qe.intersect(u)&&s.push(c))}if(s.length)for(var d=4,v=Math.PI/12,g=Math.PI*2,_=0;_4)return;this._downPoint=null}this.dispatchToElement(a,r,t)}});function zs(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?Ya:!0}return!1}function Sn(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=zs(o,e,i))&&(!t.topTarget&&(t.topTarget=o),s!==Ya)){t.target=o;break}}}function Ga(r,t,e){var i=r.painter;return t<0||t>i.getWidth()||e<0||e>i.getHeight()}var qa=32,Pr=7;function Ns(r){for(var t=0;r>=qa;)t|=r&1,r>>=1;return r+t}function Cn(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 Ws(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 Ue(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 ke(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 Ys(r,t){var e=Pr,i,n,a=0,o=[];i=[],n=[];function s(d,v){i[a]=d,n[a]=v,a+=1}function f(){for(;a>1;){var d=a-2;if(d>=1&&n[d-1]<=n[d]+n[d+1]||d>=2&&n[d-2]<=n[d]+n[d-1])n[d-1]n[d+1])break;u(d)}}function h(){for(;a>1;){var d=a-2;d>0&&n[d-1]=Pr||M>=Pr);if(S)break;b<0&&(b=0),b+=2}if(e=b,e<1&&(e=1),v===1){for(p=0;p<_;p++)r[y+p]=r[T+p];r[y+_]=o[m]}else{if(v===0)throw new Error;for(p=0;p=0;p--)r[w+p]=r[b+p];r[y]=o[T];return}for(var M=e;;){var S=0,P=0,D=!1;do if(t(o[T],r[m])<0){if(r[y--]=r[m--],S++,P=0,--v===0){D=!0;break}}else if(r[y--]=o[T--],P++,S=0,--_===1){D=!0;break}while((S|P)=0;p--)r[w+p]=r[b+p];if(v===0){D=!0;break}}if(r[y--]=o[T--],--_===1){D=!0;break}if(P=_-Ue(r[m],o,0,_,_-1,t),P!==0){for(y-=P,T-=P,_-=P,w=y+1,b=T+1,p=0;p=Pr||P>=Pr);if(D)break;M<0&&(M=0),M+=2}if(e=M,e<1&&(e=1),_===1){for(y-=v,m-=v,w=y+1,b=m+1,p=v-1;p>=0;p--)r[w+p]=r[b+p];r[y]=o[T]}else{if(_===0)throw new Error;for(b=y-(_-1),p=0;p<_;p++)r[b+p]=o[p]}}return{mergeRuns:f,forceMergeRuns:h,pushRun:s}}function Xs(r,t,e,i){e||(e=0),i||(i=r.length);var n=i-e;if(!(n<2)){var a=0;if(ns&&(f=s),Mn(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 at=1,Er=2,lr=4,Pn=!1;function Ze(){Pn||(Pn=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function Ln(r,t){return r.zlevel===t.zlevel?r.z===t.z?r.z2-t.z2:r.z-t.z:r.zlevel-t.zlevel}var Gs=(function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=Ln}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})(),Di;Di=F.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var Br={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-Br.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?Br.bounceIn(r*2)*.5:Br.bounceOut(r*2-1)*.5+.5}},Jr=Math.pow,Rt=Math.sqrt,Se=1e-8,Ua=1e-4,Rn=Rt(3),jr=1/3,dt=ir(),Q=ir(),mr=ir();function Pt(r){return r>-Se&&rSe||r<-Se}function q(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 ou(r,t,e,i,n){var a=1-n;return 3*(((t-r)*a+2*(e-t)*n)*a+(i-e)*n*n)}function Za(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,l=s*f-9*o*h,c=f*f-3*s*h,d=0;if(Pt(u)&&Pt(l))if(Pt(s))a[0]=0;else{var v=-f/s;v>=0&&v<=1&&(a[d++]=v)}else{var g=l*l-4*u*c;if(Pt(g)){var _=l/u,v=-s/o+_,p=-_/2;v>=0&&v<=1&&(a[d++]=v),p>=0&&p<=1&&(a[d++]=p)}else if(g>0){var m=Rt(g),T=u*s+1.5*o*(-l+m),y=u*s+1.5*o*(-l-m);T<0?T=-Jr(-T,jr):T=Jr(T,jr),y<0?y=-Jr(-y,jr):y=Jr(y,jr);var v=(-s-(T+y))/(3*o);v>=0&&v<=1&&(a[d++]=v)}else{var b=(2*u*s-3*o*l)/(2*Rt(u*u*u)),w=Math.acos(b)/3,M=Rt(u),S=Math.cos(w),v=(-s-2*M*S)/(3*o),p=(-s+M*(S+Rn*Math.sin(w)))/(3*o),P=(-s+M*(S-Rn*Math.sin(w)))/(3*o);v>=0&&v<=1&&(a[d++]=v),p>=0&&p<=1&&(a[d++]=p),P>=0&&P<=1&&(a[d++]=P)}}return d}function $a(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(Pt(o)){if(ka(a)){var h=-s/a;h>=0&&h<=1&&(n[f++]=h)}}else{var u=a*a-4*o*s;if(Pt(u))n[0]=-a/(2*o);else if(u>0){var l=Rt(u),h=(-a+l)/(2*o),c=(-a-l)/(2*o);h>=0&&h<=1&&(n[f++]=h),c>=0&&c<=1&&(n[f++]=c)}}return f}function Dn(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,l=(u-h)*n+h;a[0]=r,a[1]=o,a[2]=h,a[3]=l,a[4]=l,a[5]=u,a[6]=f,a[7]=i}function qs(r,t,e,i,n,a,o,s,f,h,u){var l,c=.005,d=1/0,v,g,_,p;dt[0]=f,dt[1]=h;for(var m=0;m<1;m+=.05)Q[0]=q(r,e,n,o,m),Q[1]=q(t,i,a,s,m),_=Qt(dt,Q),_=0&&_=0&&h<=1&&(n[f++]=h)}}else{var u=o*o-4*a*s;if(Pt(u)){var h=-o/(2*a);h>=0&&h<=1&&(n[f++]=h)}else if(u>0){var l=Rt(u),h=(-o+l)/(2*a),c=(-o-l)/(2*a);h>=0&&h<=1&&(n[f++]=h),c>=0&&c<=1&&(n[f++]=c)}}return f}function Va(r,t,e){var i=r+e-2*t;return i===0?.5:(r-t)/i}function xn(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 Zs(r,t,e,i,n,a,o,s,f){var h,u=.005,l=1/0;dt[0]=o,dt[1]=s;for(var c=0;c<1;c+=.05){Q[0]=J(r,e,n,c),Q[1]=J(t,i,a,c);var d=Qt(dt,Q);d=0&&d=1?1:Za(0,i,a,1,f,s)&&q(0,n,o,1,s[0])}}}var Ks=(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||Kt,this.ondestroy=t.ondestroy||Kt,this.onrestart=t.onrestart||Kt,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=Vt(t)?t:Br[t]||Ka(t)},r})(),Qa=(function(){function r(t){this.value=t}return r})(),Qs=(function(){function r(){this._len=0}return r.prototype.insert=function(t){var e=new Qa(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})(),Wr=(function(){function r(t){this._list=new Qs,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 Qa(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})(),En={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 ot(r){return r=Math.round(r),r<0?0:r>255?255:r}function Js(r){return r=Math.round(r),r<0?0:r>360?360:r}function Yr(r){return r<0?0:r>1?1:r}function de(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?ot(parseFloat(t)/100*255):ot(parseInt(t,10))}function Dt(r){var t=r;return t.length&&t.charAt(t.length-1)==="%"?Yr(parseFloat(t)/100):Yr(parseFloat(t))}function $e(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 Lt(r,t,e){return r+(t-r)*e}function V(r,t,e,i,n){return r[0]=t,r[1]=e,r[2]=i,r[3]=n,r}function xi(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r}var Ja=new Wr(20),te=null;function sr(r,t){te&&xi(te,t),te=Ja.put(r,te||t.slice())}function U(r,t){if(r){t=t||[];var e=Ja.get(r);if(e)return xi(t,e);r=r+"";var i=r.replace(/ /g,"").toLowerCase();if(i in En)return xi(t,En[i]),sr(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)){V(t,0,0,0,1);return}return V(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),sr(r,t),t}else if(n===7||n===9){var a=parseInt(i.slice(1,7),16);if(!(a>=0&&a<=16777215)){V(t,0,0,0,1);return}return V(t,(a&16711680)>>16,(a&65280)>>8,a&255,n===9?parseInt(i.slice(7),16)/255:1),sr(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?V(t,+h[0],+h[1],+h[2],1):V(t,0,0,0,1);u=Dt(h.pop());case"rgb":if(h.length>=3)return V(t,de(h[0]),de(h[1]),de(h[2]),h.length===3?u:Dt(h[3])),sr(r,t),t;V(t,0,0,0,1);return;case"hsla":if(h.length!==4){V(t,0,0,0,1);return}return h[3]=Dt(h[3]),Ei(h,t),sr(r,t),t;case"hsl":if(h.length!==3){V(t,0,0,0,1);return}return Ei(h,t),sr(r,t),t;default:return}}V(t,0,0,0,1)}}function Ei(r,t){var e=(parseFloat(r[0])%360+360)%360/360,i=Dt(r[1]),n=Dt(r[2]),a=n<=.5?n*(i+1):n+i-n*i,o=n*2-a;return t=t||[],V(t,ot($e(o,a,e+1/3)*255),ot($e(o,a,e)*255),ot($e(o,a,e-1/3)*255),1),r.length===4&&(t[3]=r[3]),t}function js(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,l=((a-e)/6+o/2)/o,c=((a-i)/6+o/2)/o;t===a?f=c-l:e===a?f=1/3+u-c:i===a&&(f=2/3+l-u),f<0&&(f+=1),f>1&&(f-=1)}var d=[f*360,h,s];return r[3]!=null&&d.push(r[3]),d}}function Oi(r,t){var e=U(r);if(e){for(var i=0;i<3;i++)t<0?e[i]=e[i]*(1-t)|0:e[i]=(255-e[i])*t+e[i]|0,e[i]>255?e[i]=255:e[i]<0&&(e[i]=0);return nr(e,e.length===4?"rgba":"rgb")}}function tf(r){var t=U(r);if(t)return((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1)}function ja(r,t,e){if(!(!(t&&t.length)||!(r>=0&&r<=1))){e=e||[];var i=r*(t.length-1),n=Math.floor(i),a=Math.ceil(i),o=t[n],s=t[a],f=i-n;return e[0]=ot(Lt(o[0],s[0],f)),e[1]=ot(Lt(o[1],s[1],f)),e[2]=ot(Lt(o[2],s[2],f)),e[3]=Yr(Lt(o[3],s[3],f)),e}}var rf=ja;function to(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=U(t[n]),s=U(t[a]),f=i-n,h=nr([ot(Lt(o[0],s[0],f)),ot(Lt(o[1],s[1],f)),ot(Lt(o[2],s[2],f)),Yr(Lt(o[3],s[3],f))],"rgba");return e?{color:h,leftIndex:n,rightIndex:a,value:i}:h}}var ef=to;function nf(r,t,e,i){var n=U(r);if(r)return n=js(n),t!=null&&(n[0]=Js(Vt(t)?t(n[0]):t)),e!=null&&(n[1]=Dt(Vt(e)?e(n[1]):e)),i!=null&&(n[2]=Dt(Vt(i)?i(n[2]):i)),nr(Ei(n),"rgba")}function af(r,t){var e=U(r);if(e&&t!=null)return e[3]=Yr(t),nr(e,"rgba")}function nr(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 Xr(r,t){var e=U(r);return e?(.299*e[0]+.587*e[1]+.114*e[2])*e[3]/255+(1-e[3])*t:0}function of(){return nr([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var On=new Wr(100);function sf(r){if(Nr(r)){var t=On.get(r);return t||(t=Oi(r,-.1),On.put(r,t)),t}else if(De(r)){var e=A({},r);return e.colorStops=er(r.colorStops,function(i){return{offset:i.offset,color:Oi(i.color,-.1)}}),e}return r}const fu=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:ja,fastMapToColor:rf,lerp:to,lift:Oi,liftColor:sf,lum:Xr,mapToColor:ef,modifyAlpha:af,modifyHSL:nf,parse:U,parseCssFloat:Dt,parseCssInt:de,random:of,stringify:nr,toHex:tf},Symbol.toStringTag,{value:"Module"}));var Ce=Math.round;function hu(r){var t;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var e=U(r);e&&(r="rgb("+e[0]+","+e[1]+","+e[2]+")",t=e[3])}return{color:r,opacity:t??1}}var An=1e-4;function uu(r){return r-An}function re(r){return Ce(r*1e3)/1e3}function Fn(r){return Ce(r*1e4)/1e4}function lu(r){return"matrix("+re(r[0])+","+re(r[1])+","+re(r[2])+","+re(r[3])+","+Fn(r[4])+","+Fn(r[5])+")"}var vu={left:"start",right:"end",center:"middle",middle:"middle"};function cu(r,t,e){return e==="top"?r+=t/2:e==="bottom"&&(r-=t/2),r}function du(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function pu(r){var t=r.style,e=r.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),e[0],e[1]].join(",")}function ff(r){return r&&!!r.image}function hf(r){return r&&!!r.svgElement}function _u(r){return ff(r)||hf(r)}function uf(r){return r.type==="linear"}function lf(r){return r.type==="radial"}function gu(r){return r&&(r.type==="linear"||r.type==="radial")}function mu(r){return"url(#"+r+")"}function yu(r){var t=r.getGlobalScale(),e=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(e)/Math.log(10)),1)}function wu(r){var t=r.x||0,e=r.y||0,i=(r.rotation||0)*Ir,n=B(r.scaleX,1),a=B(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,f=[];return(t||e)&&f.push("translate("+t+"px,"+e+"px)"),i&&f.push("rotate("+i+")"),(n!==1||a!==1)&&f.push("scale("+n+","+a+")"),(o||s)&&f.push("skew("+Ce(o*Ir)+"deg, "+Ce(s*Ir)+"deg)"),f.join(" ")}var Tu=(function(){return typeof Buffer<"u"&&typeof Buffer.from=="function"?function(r){return Buffer.from(r).toString("base64")}:typeof btoa=="function"&&typeof unescape=="function"&&typeof encodeURIComponent=="function"?function(r){return btoa(unescape(encodeURIComponent(r)))}:function(r){return null}})(),Ai=Array.prototype.slice;function Tt(r,t,e){return(t-r)*e+r}function Ve(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=Hn,f=e;if(st(e)){var h=pf(e);s=h,(h===1&&!Ar(e[0])||h===2&&!Ar(e[0][0]))&&(o=!0)}else if(Ar(e)&&!xa(e))s=ie;else if(Nr(e))if(!isNaN(+e))s=ie;else{var u=U(e);u&&(f=u,s=Or)}else if(De(e)){var l=A({},f);l.colorStops=er(e.colorStops,function(d){return{offset:d.offset,color:U(d.color)}}),uf(e)?s=Fi:lf(e)&&(s=Ii),f=l}a===0?this.valType=s:(s!==this.valType||s===Hn)&&(o=!0),this.discrete=this.discrete||o;var c={time:t,value:f,rawValue:e,percent:0};return i&&(c.easing=i,c.easingFunc=Vt(i)?i:Br[i]||Ka(i)),n.push(c),c},r.prototype.prepare=function(t,e){var i=this.keyframes;this._needsSort&&i.sort(function(g,_){return g.time-_.time});for(var n=this.valType,a=i.length,o=i[a-1],s=this.discrete,f=ne(n),h=Bn(n),u=0;u=0&&!(o[u].percent<=e);u--);u=c(u,s-2)}else{for(u=l;ue);u++);u=c(u-1,s-2)}v=o[u+1],d=o[u]}if(d&&v){this._lastFr=u,this._lastFrP=e;var _=v.percent-d.percent,p=_===0?1:c((e-d.percent)/_,1);v.easingFunc&&(p=v.easingFunc(p));var m=i?this._additiveValue:h?Lr:t[f];if((ne(a)||h)&&!m&&(m=this._additiveValue=[]),this.discrete)t[f]=p<1?d.rawValue:v.rawValue;else if(ne(a))a===ge?Ve(m,d[n],v[n],p):vf(m,d[n],v[n],p);else if(Bn(a)){var T=d[n],y=v[n],b=a===Fi;t[f]={type:b?"linear":"radial",x:Tt(T.x,y.x,p),y:Tt(T.y,y.y,p),colorStops:er(T.colorStops,function(M,S){var P=y.colorStops[S];return{offset:Tt(M.offset,P.offset,p),color:_e(Ve([],M.color,P.color,p))}}),global:y.global},b?(t[f].x2=Tt(T.x2,y.x2,p),t[f].y2=Tt(T.y2,y.y2,p)):t[f].r=Tt(T.r,y.r,p)}else if(h)Ve(m,d[n],v[n],p),i||(t[f]=_e(m));else{var w=Tt(d[n],v[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===ie?t[i]=t[i]+n:e===Or?(U(t[i],Lr),ee(Lr,Lr,n,1),t[i]=_e(Lr)):e===ge?ee(t[i],t[i],n,1):e===ro&&In(t[i],t[i],n,1)},r})(),ln=(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){Ji("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,Y(e),i)},r.prototype.whenWithKeys=function(t,e,i,n){for(var a=this._tracks,o=0;o0&&f.addKeyframe(0,pe(h),n),this._trackKeys.push(s)}f.addKeyframe(t,pe(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 gf=(function(r){k(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&&(Di(i),!e._paused&&e.update())}Di(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 ln(e,i.loop);return this.addAnimator(n),n},t})(Zr),mf=300,Ke=F.domSupported,Qe=(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=er(r,function(n){var a=n.replace("mouse","pointer");return e.hasOwnProperty(a)?a:n});return{mouse:r,touch:t,pointer:i}})(),zn={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},Nn=!1;function Hi(r){var t=r.pointerType;return t==="pen"||t==="touch"}function yf(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 Je(r){r&&(r.zrByTouch=!0)}function wf(r,t){return et(r.dom,new Tf(r,t),!0)}function eo(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 Tf=(function(){function r(t,e){this.stopPropagation=Kt,this.stopImmediatePropagation=Kt,this.preventDefault=Kt,this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}return r})(),it={mousedown:function(r){r=et(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=et(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=et(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=et(this.dom,r);var t=r.toElement||r.relatedTarget;eo(this,t)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){Nn=!0,r=et(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){Nn||(r=et(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=et(this.dom,r),Je(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),it.mousemove.call(this,r),it.mousedown.call(this,r)},touchmove:function(r){r=et(this.dom,r),Je(r),this.handler.processGesture(r,"change"),it.mousemove.call(this,r)},touchend:function(r){r=et(this.dom,r),Je(r),this.handler.processGesture(r,"end"),it.mouseup.call(this,r),+new Date-+this.__lastTouchMomentGn||r<-Gn}var zt=[],fr=[],ti=Jt(),ri=Math.abs,xe=(function(){function r(){}return r.prototype.getLocalTransform=function(t){return Pf(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 Bt(this.rotation)||Bt(this.x)||Bt(this.y)||Bt(this.scaleX-1)||Bt(this.scaleY-1)||Bt(this.skewX)||Bt(this.skewY)},r.prototype.updateTransform=function(){var t=this.parent&&this.parent.transform,e=this.needLocalTransform(),i=this.transform;if(!(e||t)){i&&(Xn(i),this.invTransform=null);return}i=i||Jt(),e?this.getLocalTransform(i):Xn(i),t&&(e?ce(i,t,i):hn(i,t)),this.transform=i,this._resolveGlobalScaleRatio(i),this.invTransform=this.invTransform||Jt(),un(this.invTransform,i)},r.prototype._resolveGlobalScaleRatio=function(t){var e=this.globalScaleRatio;if(e!=null&&e!==1){this.getGlobalScale(zt);var i=zt[0]<0?-1:1,n=zt[1]<0?-1:1,a=((zt[0]-i)*e+i)/zt[0]||0,o=((zt[1]-n)*e+n)/zt[1]||0;t[0]*=a,t[1]*=a,t[2]*=o,t[3]*=o}},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||Jt(),ce(fr,t.invTransform,e),e=fr);var i=this.originX,n=this.originY;(i||n)&&(ti[4]=i,ti[5]=n,ce(fr,e,ti),fr[4]-=i,fr[5]-=n,e=fr),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&&bi(i,i,n),i},r.prototype.transformCoordToGlobal=function(t,e){var i=[t,e],n=this.transform;return n&&bi(i,i,n),i},r.prototype.getLineScale=function(){var t=this.transform;return t&&ri(t[0]-1)>1e-10&&ri(t[3]-1)>1e-10?Math.sqrt(ri(t[0]*t[3]-t[2]*t[1])):1},r.prototype.copyTransform=function(t){Lf(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,l=t.y,c=t.skewX?Math.tan(t.skewX):0,d=t.skewY?Math.tan(-t.skewY):0;if(i||n||s||f){var v=i+s,g=n+f;e[4]=-v*a-c*g*o,e[5]=-g*o-d*v*a}else e[4]=e[5]=0;return e[0]=a,e[3]=o,e[1]=d*a,e[2]=c*o,h&&Na(e,e,h),e[4]+=i+u,e[5]+=n+l,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})(),Pf=xe.getLocalTransform;function bu(){return new xe}var Ee=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Lf(r,t){return Ra(r,t,Ee)}function _t(r){ae||(ae=new Wr(100)),r=r||xt;var t=ae.get(r);return t||(t={font:r,strWidthCache:new Wr(500),asciiWidthMap:null,asciiWidthMapTried:!1,stWideCharWidth:pt.measureText("国",r).width,asciiCharWidth:pt.measureText("a",r).width},ae.put(r,t)),t}var ae;function Rf(r){if(!(ei>=qn)){r=r||xt;for(var t=[],e=+new Date,i=0;i<=127;i++)t[i]=pt.measureText(String.fromCharCode(i),r).width;var n=+new Date-e;return n>16?ei=qn:n>2&&ei++,t}}var ei=0,qn=5;function no(r,t){return r.asciiWidthMapTried||(r.asciiWidthMap=Rf(r.font),r.asciiWidthMapTried=!0),0<=t&&t<=127?r.asciiWidthMap!=null?r.asciiWidthMap[t]:r.asciiCharWidth:r.stWideCharWidth}function gt(r,t){var e=r.strWidthCache,i=e.get(t);return i==null&&(i=pt.measureText(t,r.font).width,e.put(t,i)),i}function Un(r,t,e,i){var n=gt(_t(t),r),a=Oe(t),o=yr(0,n,e),s=jt(0,a,i),f=new O(o,s,n,a);return f}function Su(r,t,e,i){var n=((r||"")+"").split(` `),a=n.length;if(a===1)return Un(n[0],t,e,i);for(var o=new O(0,0,0,0),s=0;s=0?parseFloat(r)/100*t:parseFloat(r):r}function Df(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",l="top";if(i instanceof Array)f+=Gr(i[0],e.width),h+=Gr(i[1],e.height),u=null,l=null;else switch(i){case"left":f-=n,h+=s,u="right",l="middle";break;case"right":f+=n+o,h+=s,l="middle";break;case"top":f+=o/2,h-=n,u="center",l="bottom";break;case"bottom":f+=o/2,h+=a+n,u="center";break;case"inside":f+=o/2,h+=s,u="center",l="middle";break;case"insideLeft":f+=n,h+=s,l="middle";break;case"insideRight":f+=o-n,h+=s,u="right",l="middle";break;case"insideTop":f+=o/2,h+=n,u="center";break;case"insideBottom":f+=o/2,h+=a-n,u="center",l="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,l="bottom";break;case"insideBottomRight":f+=o-n,h+=a-n,u="right",l="bottom";break}return r=r||{},r.x=f,r.y=h,r.align=u,r.verticalAlign=l,r}var ii="__zr_normal__",ni=Ee.concat(["ignore"]),xf=Ur(Ee,function(r,t){return r[t]=!0,r},{ignore:!1}),hr={},Ef=new O(0,0,0,0),oe=[],ye=0,Ae=1,Fe=(function(){function r(t){this.id=Qi(),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,l=i.autoOverflowArea,c=void 0;if((l||u)&&(c=Ef,i.layoutRect?c.copy(i.layoutRect):c.copy(this.getBoundingRect()),n||c.applyTransform(this.transform)),u){this.calculateTextPosition?this.calculateTextPosition(hr,i,c):Df(hr,i,c),a.x=hr.x,a.y=hr.y,o=hr.align,s=hr.verticalAlign;var d=i.origin;if(d&&i.rotation!=null){var v=void 0,g=void 0;d==="center"?(v=c.width*.5,g=c.height*.5):(v=Gr(d[0],c.width),g=Gr(d[1],c.height)),h=!0,a.originX=-a.x+v+(n?0:c.x),a.originY=-a.y+g+(n?0:c.y)}}i.rotation!=null&&(a.rotation=i.rotation);var _=i.offset;_&&(a.x+=_[0],a.y+=_[1],h||(a.originX=-_[0],a.originY=-_[1]));var p=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(l){var m=p.overflowRect=p.overflowRect||new O(0,0,0,0);a.getLocalTransform(oe),un(oe,oe),O.copy(m,c),m.applyTransform(oe)}else p.overflowRect=null;var T=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,y=void 0,b=void 0,w=void 0;T&&this.canBeInsideText()?(y=i.insideFill,b=i.insideStroke,(y==null||y==="auto")&&(y=this.getInsideTextFill()),(b==null||b==="auto")&&(b=this.getInsideTextStroke(y),w=!0)):(y=i.outsideFill,b=i.outsideStroke,(y==null||y==="auto")&&(y=this.getOutsideFill()),(b==null||b==="auto")&&(b=this.getOutsideStroke(y),w=!0)),y=y||"#000",(y!==p.fill||b!==p.stroke||w!==p.autoStroke||o!==p.align||s!==p.verticalAlign)&&(f=!0,p.fill=y,p.stroke=b,p.autoStroke=w,p.align=o,p.verticalAlign=s,e.setDefaultTextStyle(p)),e.__dirty|=at,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()?Wi:Ni},r.prototype.getOutsideStroke=function(t){var e=this.__zr&&this.__zr.getBackgroundColor(),i=typeof e=="string"&&U(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,nr(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||{},A(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(Mt(t))for(var i=t,n=Y(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(ii,!1,t)},r.prototype.useState=function(t,e,i,n){var a=t===ii,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,f=this.stateTransition;if(!(ct(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){Ji("State "+t+" not exists.");return}a||this.saveCurrentToNormalState(h);var u=this._textContent,l=kn(this,u,h,n);l&&!this.__inHover&&(this.__inHover=l),this._applyStateObj(t,h,this._normalState,e,$n(this,i,f),f);var c=this._textGuide;return u&&u.useState(t,e,i,!!l),c&&c.useState(t,e,i,!!l),a?(this.currentStates=[],this._normalState={}):e?this.currentStates.push(t):this.currentStates=[t],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this.__inHover=ye,this.__dirty&=~at),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;f=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=ct(n,t),o=ct(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(v,g){e.during(g)});for(var c=0;c0||n.force&&!o.length){var S=void 0,P=void 0,D=void 0;if(s){P={},c&&(S={});for(var y=0;y0}var oo=(function(r){k(t,r);function t(e){var i=r.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(e),i}return t.prototype.childrenRef=function(){return this._children},t.prototype.children=function(){return this._children.slice()},t.prototype.childAt=function(e){return this._children[e]},t.prototype.childOfName=function(e){for(var i=this._children,n=0;n=0&&(n.splice(a,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,i){var n=ct(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=ct(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._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},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=gt(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 uo(r,t,e){var i=e.containerWidth,n=e.contentWidth,a=e.fontMeasureInfo;if(!i){r.textLine="",r.isTruncated=!1;return}var o=gt(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?$f(t,n,a):o>0?Math.floor(t.length*n/o):0;t=t.substr(0,f),o=gt(a,t)}t===""&&(t=e.placeholder),r.textLine=t,r.isTruncated=!0}function $f(r,t,e){for(var i=0,n=0,a=r.length;n_&&d){var T=Math.floor(_/c);v=v||p.length>T,p=p.slice(0,T),m=p.length*c}if(n&&u&&g!=null)for(var y=ho(g,h,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),b={},w=0;wv&&fi(a,o.substring(v,_),t,d),fi(a,g[2],t,d,g[1]),v=si.lastIndex}vl){var Tr=a.lines.length;x>0?(P.tokens=P.tokens.slice(0,x),M(P,R,D),a.lines=a.lines.slice(0,S+1)):a.lines=a.lines.slice(0,S),a.isTruncated=a.isTruncated||a.lines.length0&&v+i.accumWidth>i.width&&(u=t.split(` `),h=!0),i.accumWidth=v}else{var g=lo(t,f,i.width,i.breakAll,i.accumWidth);i.accumWidth=g.accumWidth+d,l=g.linesWidths,u=g.lines}}u||(u=t.split(` `));for(var _=_t(f),p=0;p=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var th=Ur(",&?/;] ".split(""),function(r,t){return r[t]=!0,r},{});function rh(r){return jf(r)?!!th[r]:!0}function lo(r,t,e,i,n){for(var a=[],o=[],s="",f="",h=0,u=0,l=_t(t),c=0;ce:n+u+v>e){u?(s||f)&&(g?(s||(s=f,f="",h=0,u=h),a.push(s),o.push(u-h),f+=d,h+=v,s="",u=h):(f&&(s+=f,f="",h=0),a.push(s),o.push(u),s=d,u=v)):g?(a.push(f),o.push(h),f=d,h=v):(a.push(d),o.push(v));continue}u+=v,g?(f+=d,h+=v):(f&&(s+=f,f="",h=0),s+=d)}return f&&(s+=f),s&&(a.push(s),o.push(u)),a.length===1&&(u+=n),{accumWidth:u,lines:a,linesWidths:o}}function Qn(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;O.set(Jn,yr(e,o,n),jt(i,s,a),o,s),O.intersect(t,Jn,null,jn);var f=jn.outIntersectRect;r.outerWidth=f.width,r.outerHeight=f.height,r.baseX=yr(f.x,f.width,n,!0),r.baseY=jt(f.y,f.height,a,!0)}}var Jn=new O(0,0,0,0),jn={outIntersectRect:{},clamp:!0};function vn(r){return r!=null?r+="":r=""}function eh(r){var t=vn(r.text),e=r.font,i=gt(_t(e),t),n=Oe(e);return Gi(r,i,n,null)}function Gi(r,t,e,i){var n=new O(yr(r.x||0,t,r.textAlign),jt(r.y||0,e,r.textBaseline),t,e),a=i??(vo(r)?r.lineWidth:0);return a>0&&(n.x-=a/2,n.y-=a/2,n.width+=a,n.height+=a),n}function vo(r){var t=r.stroke;return t!=null&&t!=="none"&&r.lineWidth>0}var qi="__zr_style_"+Math.round(Math.random()*10),tr={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},He={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};tr[qi]=!0;var ta=["z","z2","invisible"],ih=["invisible"],Be=(function(r){k(t,r);function t(e){return r.call(this,e)||this}return t.prototype._init=function(e){for(var i=Y(e),n=0;n1e-4){s[0]=r-e,s[1]=t-i,f[0]=r+e,f[1]=t+i;return}if(se[0]=vi(n)*e+r,se[1]=li(n)*i+t,fe[0]=vi(a)*e+r,fe[1]=li(a)*i+t,h(s,se,fe),u(f,se,fe),n=n%Nt,n<0&&(n=n+Nt),a=a%Nt,a<0&&(a=a+Nt),n>a&&!o?a+=Nt:nn&&(he[0]=vi(d)*e+r,he[1]=li(d)*i+t,h(s,he,s),u(f,he,f))}var E={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Wt=[],Yt=[],ht=[],bt=[],ut=[],lt=[],ci=Math.min,di=Math.max,Xt=Math.cos,Gt=Math.sin,wt=Math.abs,Ui=Math.PI,Ct=Ui*2,pi=typeof Float32Array<"u",Rr=[];function _i(r){var t=Math.round(r/Ui*1e8)/1e8;return t%2*Ui}function fh(r,t){var e=_i(r[0]);e<0&&(e+=Ct);var i=e-r[0],n=r[1];n+=i,!t&&n-e>=Ct?n=e+Ct:t&&e-n>=Ct?n=e-Ct:!t&&e>n?n=e+(Ct-_i(e-n)):t&&e0&&(this._ux=wt(i/Yn/t)||0,this._uy=wt(i/Yn/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(E.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=wt(t-this._xi),n=wt(e-this._yi),a=i>this._ux||n>this._uy;if(this.addData(E.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(E.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(E.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(),Rr[0]=n,Rr[1]=a,fh(Rr,o),n=Rr[0],a=Rr[1];var s=a-n;return this.addData(E.A,t,e,i,i,n,s,0,o?0:1),this._ctx&&this._ctx.arc(t,e,i,n,a,o),this._xi=Xt(a)*i+t,this._yi=Gt(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(E.R,t,e,i,n),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(E.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)&&pi&&(this.data=new Float32Array(e));for(var i=0;i0&&o))for(var s=0;su.length&&(this._expandData(),u=this.data);for(var l=0;l0&&(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(){ht[0]=ht[1]=ut[0]=ut[1]=Number.MAX_VALUE,bt[0]=bt[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||wt(T)>n||c===e-1)&&(g=Math.sqrt(m*m+T*T),a=_,o=p);break}case E.C:{var y=t[c++],b=t[c++],_=t[c++],p=t[c++],w=t[c++],M=t[c++];g=Us(a,o,y,b,_,p,w,M,10),a=w,o=M;break}case E.Q:{var y=t[c++],b=t[c++],_=t[c++],p=t[c++];g=$s(a,o,y,b,_,p,10),a=_,o=p;break}case E.A:var S=t[c++],P=t[c++],D=t[c++],R=t[c++],x=t[c++],L=t[c++],C=L+x;c+=1,v&&(s=Xt(x)*D+S,f=Gt(x)*R+P),g=di(D,R)*ci(Ct,Math.abs(L)),a=Xt(C)*D+S,o=Gt(C)*R+P;break;case E.R:{s=a=t[c++],f=o=t[c++];var z=t[c++],Z=t[c++];g=z*2+Z*2;break}case E.Z:{var m=s-a,T=f-o;g=Math.sqrt(m*m+T*T),a=s,o=f;break}}g>=0&&(h[l++]=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,l,c,d=e<1,v,g,_=0,p=0,m,T=0,y,b;if(!(d&&(this._pathSegLen||this._calculateLength(),v=this._pathSegLen,g=this._pathLen,m=e*g,!m)))t:for(var w=0;w0&&(t.lineTo(y,b),T=0),M){case E.M:s=h=i[w++],f=u=i[w++],t.moveTo(h,u);break;case E.L:{l=i[w++],c=i[w++];var P=wt(l-h),D=wt(c-u);if(P>n||D>a){if(d){var R=v[p++];if(_+R>m){var x=(m-_)/R;t.lineTo(h*(1-x)+l*x,u*(1-x)+c*x);break t}_+=R}t.lineTo(l,c),h=l,u=c,T=0}else{var L=P*P+D*D;L>T&&(y=l,b=c,T=L)}break}case E.C:{var C=i[w++],z=i[w++],Z=i[w++],$=i[w++],mt=i[w++],Tr=i[w++];if(d){var R=v[p++];if(_+R>m){var x=(m-_)/R;Dn(h,C,Z,mt,x,Wt),Dn(u,z,$,Tr,x,Yt),t.bezierCurveTo(Wt[1],Yt[1],Wt[2],Yt[2],Wt[3],Yt[3]);break t}_+=R}t.bezierCurveTo(C,z,Z,$,mt,Tr),h=mt,u=Tr;break}case E.Q:{var C=i[w++],z=i[w++],Z=i[w++],$=i[w++];if(d){var R=v[p++];if(_+R>m){var x=(m-_)/R;xn(h,C,Z,x,Wt),xn(u,z,$,x,Yt),t.quadraticCurveTo(Wt[1],Yt[1],Wt[2],Yt[2]);break t}_+=R}t.quadraticCurveTo(C,z,Z,$),h=Z,u=$;break}case E.A:var tt=i[w++],Ot=i[w++],yt=i[w++],X=i[w++],rt=i[w++],$r=i[w++],Vr=i[w++],br=!i[w++],Kr=yt>X?yt:X,wo=wt(yt-X)>.001,Sr=rt+$r,pn=!1;if(d){var R=v[p++];_+R>m&&(Sr=rt+$r*(m-_)/R,pn=!0),_+=R}if(wo&&t.ellipse?t.ellipse(tt,Ot,yt,X,Vr,rt,Sr,br):t.arc(tt,Ot,Kr,rt,Sr,br),pn)break t;S&&(s=Xt(rt)*yt+tt,f=Gt(rt)*X+Ot),h=Xt(Sr)*yt+tt,u=Gt(Sr)*X+Ot;break;case E.R:s=h=i[w],f=u=i[w+1],l=i[w++],c=i[w++];var ar=i[w++],Cr=i[w++];if(d){var R=v[p++];if(_+R>m){var ft=m-_;t.moveTo(l,c),t.lineTo(l+ci(ft,ar),c),ft-=ar,ft>0&&t.lineTo(l+ar,c+ci(ft,Cr)),ft-=Cr,ft>0&&t.lineTo(l+di(ar-ft,0),c+Cr),ft-=ar,ft>0&&t.lineTo(l,c+di(Cr-ft,0));break t}_+=R}t.rect(l,c,ar,Cr);break;case E.Z:if(d){var R=v[p++];if(_+R>m){var x=(m-_)/R;t.lineTo(h*(1-x)+s*x,u*(1-x)+f*x);break t}_+=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=E,r.initDefaultProps=(function(){var t=r.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),r})();function ur(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+l&&u>i+l&&u>a+l&&u>s+l||ur+l&&h>e+l&&h>n+l&&h>o+l||ht+h&&f>i+h&&f>a+h||fr+h&&s>e+h&&s>n+h||se||u+hn&&(n+=Dr);var c=Math.atan2(f,s);return c<0&&(c+=Dr),c>=i&&c<=n||c+Dr>=i&&c+Dr<=n}function qt(r,t,e,i,n,a){if(a>t&&a>i||an?s:0}var St=cn.CMD,Ut=Math.PI*2,vh=1e-4;function ch(r,t){return Math.abs(r-t)t&&h>i&&h>a&&h>s||h1&&dh(),d=q(t,i,a,s,K[0]),c>1&&(v=q(t,i,a,s,K[1]))),c===2?_t&&s>i&&s>a||s=0&&h<=1){for(var u=0,l=J(t,i,a,h),c=0;ce||s<-e)return 0;var f=Math.sqrt(e*e-s*s);I[0]=-f,I[1]=f;var h=Math.abs(i-n);if(h<1e-4)return 0;if(h>=Ut-1e-4){i=0,n=Ut;var u=a?1:-1;return o>=I[0]+r&&o<=I[1]+r?u:0}if(i>n){var l=i;i=n,n=l}i<0&&(i+=Ut,n+=Ut);for(var c=0,d=0;d<2;d++){var v=I[d];if(v+r>o){var g=Math.atan2(s,v),u=a?1:-1;g<0&&(g=Ut+g),(g>=i&&g<=n||g+Ut>=i&&g+Ut<=n)&&(g>Math.PI/2&&g1&&(e||(s+=qt(f,h,u,l,i,n))),_&&(f=a[v],h=a[v+1],u=f,l=h),g){case St.M:u=a[v++],l=a[v++],f=u,h=l;break;case St.L:if(e){if(ur(f,h,a[v],a[v+1],t,i,n))return!0}else s+=qt(f,h,a[v],a[v+1],i,n)||0;f=a[v++],h=a[v++];break;case St.C:if(e){if(hh(f,h,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],t,i,n))return!0}else s+=ph(f,h,a[v++],a[v++],a[v++],a[v++],a[v],a[v+1],i,n)||0;f=a[v++],h=a[v++];break;case St.Q:if(e){if(uh(f,h,a[v++],a[v++],a[v],a[v+1],t,i,n))return!0}else s+=_h(f,h,a[v++],a[v++],a[v],a[v+1],i,n)||0;f=a[v++],h=a[v++];break;case St.A:var p=a[v++],m=a[v++],T=a[v++],y=a[v++],b=a[v++],w=a[v++];v+=1;var M=!!(1-a[v++]);c=Math.cos(b)*T+p,d=Math.sin(b)*y+m,_?(u=c,l=d):s+=qt(f,h,c,d,i,n);var S=(i-p)*y/T+p;if(e){if(lh(p,m,y,b,b+w,M,t,S,n))return!0}else s+=gh(p,m,y,b,b+w,M,S,n);f=Math.cos(b+w)*T+p,h=Math.sin(b+w)*y+m;break;case St.R:u=f=a[v++],l=h=a[v++];var P=a[v++],D=a[v++];if(c=u+P,d=l+D,e){if(ur(u,l,c,l,t,i,n)||ur(c,l,c,d,t,i,n)||ur(c,d,u,d,t,i,n)||ur(u,d,u,l,t,i,n))return!0}else s+=qt(c,l,c,d,i,n),s+=qt(u,d,u,l,i,n);break;case St.Z:if(e){if(ur(f,h,u,l,t,i,n))return!0}else s+=qt(f,h,u,l,i,n);f=u,h=l;break}}return!e&&!ch(h,l)&&(s+=qt(f,h,u,l,i,n)||0),s!==0}function mh(r,t,e){return co(r,0,!1,t,e)}function yh(r,t,e,i){return co(r,t,!0,e,i)}var po=Et({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},tr),wh={style:Et({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},He.style)},gi=Ee.concat(["invisible","culling","z","z2","zlevel","parent"]),qr=(function(r){k(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.5?Ni:i>.2?Mf:Wi}else if(e)return Wi}return Ni},t.prototype.getInsideTextStroke=function(e){var i=this.style.fill;if(Nr(i)){var n=this.__zr,a=!!(n&&n.isDarkMode()),o=Xr(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&lr)&&(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)),yh(s,f/h,e,i)))return!0}if(this.hasFill())return mh(s,e,i)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=lr,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:A(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&lr)},t.prototype.createStyle=function(e){return kr(po,e)},t.prototype._innerSaveToNormal=function(e){r.prototype._innerSaveToNormal.call(this,e);var i=this._normalState;e.shape&&!i.shape&&(i.shape=A({},this.shape))},t.prototype._applyStateObj=function(e,i,n,a,o,s){if(r.prototype._applyStateObj.call(this,e,i,n,a,o,s),this.__inHover!==Ae){var f=!(i&&a),h;if(i&&i.shape?o?a?h=i.shape:(h=A({},n.shape),A(h,i.shape)):(h=A({},a?this.shape:n.shape),A(h,i.shape)):f&&(h=n.shape),h)if(o){this.shape=A({},this.shape);for(var u={},l=Y(h),c=0;cn&&(l=s+f,s*=n/l,f*=n/l),h+u>n&&(l=h+u,h*=n/l,u*=n/l),f+h>a&&(l=f+h,f*=a/l,h*=a/l),s+u>a&&(l=s+u,s*=a/l,u*=a/l),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),r.closePath()}var pr=Math.round;function Lu(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&&(pr(i*2)===pr(n*2)&&(r.x1=r.x2=_r(i,s,!0)),pr(a*2)===pr(o*2)&&(r.y1=r.y2=_r(a,s,!0))),r}}function Ph(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=_r(i,s,!0),r.y=_r(n,s,!0),r.width=Math.max(_r(i+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(_r(n+o,s,!1)-r.y,o===0?0:1)),r}}function _r(r,t,e){if(!t)return r;var i=pr(r*2);return(i+pr(t))%2===0?i/2:(i+(e?1:-1))/2}var Lh=(function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r})(),Rh={},_o=(function(r){k(t,r);function t(e){return r.call(this,e)||this}return t.prototype.getDefaultShape=function(){return new Lh},t.prototype.buildPath=function(e,i){var n,a,o,s;if(this.subPixelOptimize){var f=Ph(Rh,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?Mh(e,i):e.rect(n,a,o,s)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t})(qr);_o.prototype.type="rect";var aa={fill:"#000"},oa=2,vt={},Dh={style:Et({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},He.style)},xh=(function(r){k(t,r);function t(e){var i=r.call(this)||this;return i.type="text",i._children=[],i._defaultStyle=aa,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,x=0;x<_.length;x++){var L=this._getOrCreateChild(Me),C=L.createStyle();L.useStyle(C),C.text=_[x],C.x=m,C.y=T,C.textAlign=f,C.textBaseline="middle",C.opacity=e.opacity,C.strokeFirst=!0,R&&(C.shadowBlur=e.textShadowBlur||0,C.shadowColor=e.textShadowColor||"transparent",C.shadowOffsetX=e.textShadowOffsetX||0,C.shadowOffsetY=e.textShadowOffsetY||0),C.stroke=D,C.fill=P,D&&(C.lineWidth=e.lineWidth||w,C.lineDash=e.lineDash,C.lineDashOffset=e.lineDashOffset||0),C.font=i,fa(C,e),T+=p,L.setBoundingRect(Gi(C,l.contentWidth,l.calculatedLineHeight,M?0:null))}},t.prototype._updateRichTexts=function(){var e=this.style,i=this._defaultStyle,n=e.align||i.align,a=e.verticalAlign||i.verticalAlign,o=e.x||0,s=e.y||0;Qn(vt,i.overflowRect,o,s,n,a),o=vt.baseX,s=vt.baseY;var f=ca(e),h=Jf(f,e,vt.outerWidth,vt.outerHeight,n),u=h.width,l=h.outerWidth,c=h.outerHeight,d=e.padding;this.isTruncated=!!h.isTruncated;var v=yr(o,l,n),g=jt(s,c,a),_=v,p=g;d&&(_+=d[3],p+=d[0]);var m=_+u;mi(e)&&this._renderBackground(e,e,v,g,l,c);for(var T=!!e.backgroundColor,y=0;y=0&&(C=w[L],C.align==="right");)this._placeToken(C,e,S,p,x,"right",T),P-=C.width,x-=C.width,L--;for(R+=(u-(R-_)-(m-x)-P)/2;D<=L;)C=w[D],this._placeToken(C,e,S,p,R+C.width/2,"center",T),R+=C.width,D++;p+=S}},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,l=a+n/2;u==="top"?l=a+e.height/2:u==="bottom"&&(l=a+n-e.height/2);var c=!e.isLineHolder&&mi(h);c&&this._renderBackground(h,i,s==="right"?o-e.width:s==="center"?o-e.width/2:o,l-e.height/2,e.width,e.height);var d=!!h.backgroundColor,v=e.textPadding;v&&(o=va(o,s,v),l-=e.height/2-v[0]-e.innerHeight/2);var g=this._getOrCreateChild(Me),_=g.createStyle();g.useStyle(_);var p=this._defaultStyle,m=!1,T=0,y=!1,b=la("fill"in h?h.fill:"fill"in i?i.fill:(m=!0,p.fill)),w=ua("stroke"in h?h.stroke:"stroke"in i?i.stroke:!d&&!f&&(!p.autoStroke||m)?(T=oa,y=!0,p.stroke):null),M=h.textShadowBlur>0||i.textShadowBlur>0;_.text=e.text,_.x=o,_.y=l,M&&(_.shadowBlur=h.textShadowBlur||i.textShadowBlur||0,_.shadowColor=h.textShadowColor||i.textShadowColor||"transparent",_.shadowOffsetX=h.textShadowOffsetX||i.textShadowOffsetX||0,_.shadowOffsetY=h.textShadowOffsetY||i.textShadowOffsetY||0),_.textAlign=s,_.textBaseline="middle",_.font=e.font||xt,_.opacity=Fr(h.opacity,i.opacity,1),fa(_,h),w&&(_.lineWidth=Fr(h.lineWidth,i.lineWidth,T),_.lineDash=B(h.lineDash,i.lineDash),_.lineDashOffset=i.lineDashOffset||0,_.stroke=w),b&&(_.fill=b),g.setBoundingRect(Gi(_,e.contentWidth,e.contentHeight,y?0:null))},t.prototype._renderBackground=function(e,i,n,a,o,s){var f=e.backgroundColor,h=e.borderWidth,u=e.borderColor,l=f&&f.image,c=f&&!l,d=e.borderRadius,v=this,g,_;if(c||e.lineHeight||h&&u){g=this._getOrCreateChild(_o),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=d,g.dirtyShape()}if(c){var m=g.style;m.fill=f||null,m.fillOpacity=B(e.fillOpacity,1)}else if(l){_=this._getOrCreateChild(dn),_.onload=function(){v.dirtyStyle()};var T=_.style;T.image=f.image,T.x=n,T.y=a,T.width=o,T.height=s}if(h&&u){var m=g.style;m.lineWidth=h,m.stroke=u,m.strokeOpacity=B(e.strokeOpacity,1),m.lineDash=e.borderDash,m.lineDashOffset=e.borderDashOffset||0,g.strokeContainThreshold=0,g.hasFill()&&g.hasStroke()&&(m.strokeFirst=!0,m.lineWidth*=2)}var y=(g||_).style;y.shadowBlur=e.shadowBlur||0,y.shadowColor=e.shadowColor||"transparent",y.shadowOffsetX=e.shadowOffsetX||0,y.shadowOffsetY=e.shadowOffsetY||0,y.opacity=Fr(e.opacity,i.opacity,1)},t.makeFont=function(e){var i="";return Fh(e)&&(i=[e.fontStyle,e.fontWeight,Ah(e.fontSize),e.fontFamily||"sans-serif"].join(" ")),i&&vr(i)||e.textFont||e.font},t})(Be),Eh={left:!0,right:1,center:1},Oh={top:1,bottom:1,middle:1},sa=["fontStyle","fontWeight","fontSize","fontFamily"];function Ah(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?$i+"px":r+"px"}function fa(r,t){for(var e=0;e=0&&$t(f)?f:.5;var h=r.createRadialGradient(o,s,0,o,s,f);return h}function da(r,t,e){for(var i=t.type==="radial"?Bh(r,t,e):Hh(r,t,e),n=t.colorStops,a=0;a0)?null:r==="dashed"?[4*t,2*t]:r==="dotted"?[t]:Ar(r)?[r]:zr(r)?r:null}function go(r){var t=r.style,e=t.lineDash&&t.lineWidth>0&&Nh(t.lineDash,t.lineWidth),i=t.lineDashOffset;if(e){var n=t.strokeNoScale&&r.getLineScale?r.getLineScale():1;n&&n!==1&&(e=er(e,function(a){return a/n}),i/=n)}return[e,i]}var Wh=new cn(!0);function Pe(r){var t=r.stroke;return!(t==null||t==="none"||!(r.lineWidth>0))}function pa(r){return typeof r=="string"&&r!=="none"}function Le(r){var t=r.fill;return t!=null&&t!=="none"}function _a(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 ga(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 ma(r,t,e){var i=so(t.image,t.__image,e);if(Ie(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)*Ir),a.scaleSelf(t.scaleX||1,t.scaleY||1),n.setTransform(a)}return n}}function Yh(r,t,e,i,n){var a,o=Pe(e),s=Le(e),f=e.strokePercent,h=f<1,u=!t.path;(!t.silent||h)&&u&&t.createPathProxy();var l=t.path||Wh,c=t.__dirty;if(!i){var d=e.fill,v=e.stroke,g=s&&!!d.colorStops,_=o&&!!v.colorStops,p=s&&!!d.image,m=o&&!!v.image,T=void 0,y=void 0,b=void 0,w=void 0,M=void 0;(g||_)&&(M=t.getBoundingRect()),g&&(T=c?da(r,d,M):t.__canvasFillGradient,t.__canvasFillGradient=T),_&&(y=c?da(r,v,M):t.__canvasStrokeGradient,t.__canvasStrokeGradient=y),p&&(b=c||!t.__canvasFillPattern?ma(r,d,t):t.__canvasFillPattern,t.__canvasFillPattern=b),m&&(w=c||!t.__canvasStrokePattern?ma(r,v,t):t.__canvasStrokePattern,t.__canvasStrokePattern=w),g?r.fillStyle=T:p&&(b?r.fillStyle=b:s=!1),_?r.strokeStyle=y:m&&(w?r.strokeStyle=w:o=!1)}var S=t.getGlobalScale();l.setScale(S[0],S[1],t.segmentIgnoreThreshold);var P,D;r.setLineDash&&e.lineDash&&(a=go(t),P=a[0],D=a[1]);var R=!0;(u||c&lr)&&(l.setDPR(r.dpr),h?l.setContext(null):(l.setContext(r),R=!1),l.reset(),t.buildPath(l,t.shape,i),l.toStatic(),t.pathUpdated()),R&&l.rebuildPath(r,h?f:1),P&&(r.setLineDash(P),r.lineDashOffset=D),i?(n.batchFill=s,n.batchStroke=o):e.strokeFirst?(o&&ga(r,e),s&&_a(r,e)):(s&&_a(r,e),o&&ga(r,e)),P&&r.setLineDash([])}function Xh(r,t,e){var i=t.__image=so(e.image,t.__image,t,t.onload);if(!(!i||!Ie(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,l=o-h,c=s-u;r.drawImage(i,h,u,l,c,n,a,o,s)}else r.drawImage(i,n,a,o,s)}}function Gh(r,t,e){var i,n=e.text;if(n!=null&&(n+=""),n){r.font=e.font||xt,r.textAlign=e.textAlign,r.textBaseline=e.textBaseline;var a=void 0,o=void 0;r.setLineDash&&e.lineDash&&(i=go(t),a=i[0],o=i[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),e.strokeFirst?(Pe(e)&&r.strokeText(n,e.x,e.y),Le(e)&&r.fillText(n,e.x,e.y)):(Le(e)&&r.fillText(n,e.x,e.y),Pe(e)&&r.strokeText(n,e.x,e.y)),a&&r.setLineDash([])}}var ya=["shadowBlur","shadowOffsetX","shadowOffsetY"],wa=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function mo(r,t,e,i,n){var a=!1;if(!i&&(e=e||{},t===e))return!1;if(i||t.opacity!==e.opacity){H(r,n),a=!0;var o=Math.max(Math.min(t.opacity,1),0);r.globalAlpha=isNaN(o)?tr.opacity:o}(i||t.blend!==e.blend)&&(a||(H(r,n),a=!0),r.globalCompositeOperation=t.blend||tr.blend);for(var s=0;s