import{B as Kn,r as E,C as Ql,D as Vx,n as np,d as Yx,F as $t,G as Ht,e as vi,H as ee,I as Ji,a as Ue,v as m,J as Jn,y as Z,s as $x,K as $i,L as Hx,z as yt,u as ht,_ as U,w as ta,x as ea}from"./vec2-DjBoYTHr.js";import{b3 as Xx}from"./antd-B7v2hwFR.js";import{H as Wx}from"./index-CL6hUm94.js";const os=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return He},get Circle(){return jF},get Ellipse(){return ZF},get Image(){return QF},get Line(){return KF},get Marker(){return tT},get Path(){return Hc},get Polygon(){return sT},get Polyline(){return lT},get Rect(){return hT},get Text(){return fT}},Symbol.toStringTag,{value:"Module"})),ss=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return De},get Circle(){return xT},get Dom(){return wT},get Ellipse(){return bT},get Image(){return ST},get Line(){return CT},get Marker(){return MT},get Path(){return AT},get Polygon(){return FT},get Polyline(){return TT},get Rect(){return kT},get Text(){return DT}},Symbol.toStringTag,{value:"Module"}));var xe=function(r){return r!==null&&typeof r!="function"&&isFinite(r.length)},ai=function(r,e){return xe(r)?r.indexOf(e)>-1:!1},qt=function(r,e){if(!xe(r))return r;for(var t=[],i=0;ia[s])return 1;if(n[s]t?t:r},ll=function(r,e){var t=e.toString(),i=t.indexOf(".");if(i===-1)return Math.round(r);var n=t.substr(i+1).length;return n>20&&(n=20),parseFloat(r.toFixed(n))},rt=function(r){return jr(r,"Number")},ew=1e-5;function Xt(r,e,t){return t===void 0&&(t=ew),Math.abs(r-e)i&&(t=a,i=o)}return t}},rw=function(r,e){if(R(r)){for(var t,i=1/0,n=0;ne?(i&&(clearTimeout(i),i=null),s=c,o=r.apply(n,a),i||(n=a=null)):!i&&t.trailing!==!1&&(i=setTimeout(l,h)),o};return u.cancel=function(){clearTimeout(i),s=0,i=n=a=null},u},gw=function(r){return xe(r)?Array.prototype.slice.call(r):[]};var $a={};const Zr=function(r){return r=r||"g",$a[r]?$a[r]+=1:$a[r]=1,r+$a[r]},Pr=function(){};function Vt(r){return B(r)?0:xe(r)?r.length:Object.keys(r).length}var Ha;const Xa=dn(function(r,e){e===void 0&&(e={});var t=e.fontSize,i=e.fontFamily,n=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return Ha||(Ha=document.createElement("canvas").getContext("2d")),Ha.font=[a,o,n,t+"px",i].join(" "),Ha.measureText(Q(r)?r:"").width},function(r,e){return e===void 0&&(e={}),Kn([r],us(e)).join("")}),yw=function(r,e,t,i){var n=16,a=Xa(i,t),o=Q(r)?r:Fa(r),s=e,l=[],u,c;if(Xa(r,t)<=e)return r;for(;u=o.substr(0,n),c=Xa(u,t),!(c+a>s&&c>s);)if(l.push(u),s-=c,o=o.substr(n),!o)return l.join("");for(;u=o.substr(0,1),c=Xa(u,t),!(c+a>s);)if(l.push(u),s-=c,o=o.substr(1),!o)return l.join("");return""+l.join("")+i};var mw=function(){function r(){this.map={}}return r.prototype.has=function(e){return this.map[e]!==void 0},r.prototype.get=function(e,t){var i=this.map[e];return i===void 0?t:i},r.prototype.set=function(e,t){this.map[e]=t},r.prototype.clear=function(){this.map={}},r.prototype.delete=function(e){delete this.map[e]},r.prototype.size=function(){return Object.keys(this.map).length},r}(),It;(function(r){r.FORE="fore",r.MID="mid",r.BG="bg"})(It||(It={}));var G;(function(r){r.TOP="top",r.TOP_LEFT="top-left",r.TOP_RIGHT="top-right",r.RIGHT="right",r.RIGHT_TOP="right-top",r.RIGHT_BOTTOM="right-bottom",r.LEFT="left",r.LEFT_TOP="left-top",r.LEFT_BOTTOM="left-bottom",r.BOTTOM="bottom",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_RIGHT="bottom-right",r.RADIUS="radius",r.CIRCLE="circle",r.NONE="none"})(G||(G={}));var Gt;(function(r){r.AXIS="axis",r.GRID="grid",r.LEGEND="legend",r.TOOLTIP="tooltip",r.ANNOTATION="annotation",r.SLIDER="slider",r.SCROLLBAR="scrollbar",r.OTHER="other"})(Gt||(Gt={}));var _i={FORE:3,MID:2,BG:1},ot;(function(r){r.BEFORE_RENDER="beforerender",r.AFTER_RENDER="afterrender",r.BEFORE_PAINT="beforepaint",r.AFTER_PAINT="afterpaint",r.BEFORE_CHANGE_DATA="beforechangedata",r.AFTER_CHANGE_DATA="afterchangedata",r.BEFORE_CLEAR="beforeclear",r.AFTER_CLEAR="afterclear",r.BEFORE_DESTROY="beforedestroy",r.BEFORE_CHANGE_SIZE="beforechangesize",r.AFTER_CHANGE_SIZE="afterchangesize"})(ot||(ot={}));var Br;(function(r){r.BEFORE_DRAW_ANIMATE="beforeanimate",r.AFTER_DRAW_ANIMATE="afteranimate",r.BEFORE_RENDER_LABEL="beforerenderlabel",r.AFTER_RENDER_LABEL="afterrenderlabel"})(Br||(Br={}));var ae;(function(r){r.MOUSE_ENTER="plot:mouseenter",r.MOUSE_DOWN="plot:mousedown",r.MOUSE_MOVE="plot:mousemove",r.MOUSE_UP="plot:mouseup",r.MOUSE_LEAVE="plot:mouseleave",r.TOUCH_START="plot:touchstart",r.TOUCH_MOVE="plot:touchmove",r.TOUCH_END="plot:touchend",r.TOUCH_CANCEL="plot:touchcancel",r.CLICK="plot:click",r.DBLCLICK="plot:dblclick",r.CONTEXTMENU="plot:contextmenu",r.LEAVE="plot:leave",r.ENTER="plot:enter"})(ae||(ae={}));var Ro;(function(r){r.ACTIVE="active",r.INACTIVE="inactive",r.SELECTED="selected",r.DEFAULT="default"})(Ro||(Ro={}));var Hi=["color","shape","size"],bt="_origin",Nh=1,Gh=1,Vh=.25,gp={};function xw(r){var e=gp[r];if(!e)throw new Error("G engine '".concat(r,"' is not exist, please register it at first."));return e}function yp(r,e){gp[r]=e}function Bi(r,e,t){if(r){if(typeof r.addEventListener=="function")return r.addEventListener(e,t,!1),{remove:function(){r.removeEventListener(e,t,!1)}};if(typeof r.attachEvent=="function")return r.attachEvent("on"+e,t),{remove:function(){r.detachEvent("on"+e,t)}}}}var On,cl,mp,Jl;function ww(){On=document.createElement("table"),cl=document.createElement("tr"),mp=/^\s*<(\w+|!)[^>]*>/,Jl={tr:document.createElement("tbody"),tbody:On,thead:On,tfoot:On,td:cl,th:cl,"*":document.createElement("div")}}function Rr(r){On||ww();var e=mp.test(r)&&RegExp.$1;(!e||!(e in Jl))&&(e="*");var t=Jl[e];r=typeof r=="string"?r.replace(/(^\s*)|(\s*$)/g,""):r,t.innerHTML=""+r;var i=t.childNodes[0];return i&&t.contains(i)&&t.removeChild(i),i}function ue(r,e,t){var i;try{i=window.getComputedStyle?window.getComputedStyle(r,null)[e]:r.style[e]}catch{}finally{i=i===void 0?t:i}return i}function bw(r,e){var t=ue(r,"height",e);return t==="auto"&&(t=r.offsetHeight),parseFloat(t)}function Sw(r,e){var t=bw(r,e),i=parseFloat(ue(r,"borderTopWidth"))||0,n=parseFloat(ue(r,"paddingTop"))||0,a=parseFloat(ue(r,"paddingBottom"))||0,o=parseFloat(ue(r,"borderBottomWidth"))||0,s=parseFloat(ue(r,"marginTop"))||0,l=parseFloat(ue(r,"marginBottom"))||0;return t+i+o+n+a+s+l}function Cw(r,e){var t=ue(r,"width",e);return t==="auto"&&(t=r.offsetWidth),parseFloat(t)}function Mw(r,e){var t=Cw(r,e),i=parseFloat(ue(r,"borderLeftWidth"))||0,n=parseFloat(ue(r,"paddingLeft"))||0,a=parseFloat(ue(r,"paddingRight"))||0,o=parseFloat(ue(r,"borderRightWidth"))||0,s=parseFloat(ue(r,"marginRight"))||0,l=parseFloat(ue(r,"marginLeft"))||0;return t+i+o+n+a+l+s}function Kt(r,e){if(r)for(var t in e)e.hasOwnProperty(t)&&(r.style[t]=e[t]);return r}function Aw(r){var e=getComputedStyle(r);return{width:(r.clientWidth||parseInt(e.width,10))-parseInt(e.paddingLeft,10)-parseInt(e.paddingRight,10),height:(r.clientHeight||parseInt(e.height,10))-parseInt(e.paddingTop,10)-parseInt(e.paddingBottom,10)}}function Yh(r){return typeof r=="number"&&!isNaN(r)}function $h(r,e,t,i){var n=t,a=i;if(e){var o=Aw(r);n=o.width?o.width:n,a=o.height?o.height:a}return{width:Math.max(Yh(n)?n:Nh,Nh),height:Math.max(Yh(a)?a:Gh,Gh)}}function Fw(r){var e=r.parentNode;e&&e.removeChild(r)}var Tw="*",rc=function(){function r(){this._events={}}return r.prototype.on=function(e,t,i){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!i}),this},r.prototype.once=function(e,t){return this.on(e,t,!0)},r.prototype.emit=function(e){for(var t=this,i=[],n=1;n2&&(t.push([n].concat(o.splice(0,2))),s="l",n=n==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([n,o[0]]),s==="r")t.push([n].concat(o));else for(;o.length>=e[s]&&(t.push([n].concat(o.splice(0,e[s]))),!!e[s]););return r}),t},tu=function(r,e){for(var t=[],i=0,n=r.length;n-2*!e>i;i+=2){var a=[{x:+r[i-2],y:+r[i-1]},{x:+r[i],y:+r[i+1]},{x:+r[i+2],y:+r[i+3]},{x:+r[i+4],y:+r[i+5]}];e?i?n-4===i?a[3]={x:+r[0],y:+r[1]}:n-2===i&&(a[2]={x:+r[0],y:+r[1]},a[3]={x:+r[2],y:+r[3]}):a[0]={x:+r[n-2],y:+r[n-1]}:n-4===i?a[3]=a[2]:i||(a[0]={x:+r[i],y:+r[i+1]}),t.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return t},Wa=function(r,e,t,i,n){var a=[];if(n===null&&i===null&&(i=t),r=+r,e=+e,t=+t,i=+i,n!==null){var o=Math.PI/180,s=r+t*Math.cos(-i*o),l=r+t*Math.cos(-n*o),u=e+t*Math.sin(-i*o),c=e+t*Math.sin(-n*o);a=[["M",s,u],["A",t,t,0,+(n-i>180),0,l,c]]}else a=[["M",r,e],["m",0,-i],["a",t,i,0,1,1,0,2*i],["a",t,i,0,1,1,0,-2*i],["z"]];return a},eu=function(r){if(r=Xi(r),!r||!r.length)return[["M",0,0]];var e=[],t=0,i=0,n=0,a=0,o=0,s,l;r[0][0]==="M"&&(t=+r[0][1],i=+r[0][2],n=t,a=i,o++,e[0]=["M",t,i]);for(var u=r.length===3&&r[0][0]==="M"&&r[1][0].toUpperCase()==="R"&&r[2][0].toUpperCase()==="Z",c=void 0,h=void 0,f=o,v=r.length;f1&&(S=Math.sqrt(S),t=S*t,i=S*i);var M=t*t,F=i*i,T=(a===o?-1:1)*Math.sqrt(Math.abs((M*F-M*b*b-F*w*w)/(M*b*b+F*w*w)));g=T*t*b/i+(r+s)/2,y=T*-i*w/t+(e+l)/2,d=Math.asin(((e-y)/i).toFixed(9)),p=Math.asin(((l-y)/i).toFixed(9)),d=rp&&(d=d-Math.PI*2),!o&&p>d&&(p=p-Math.PI*2)}var L=p-d;if(Math.abs(L)>c){var k=p,I=s,O=l;p=d+c*(o&&p>d?1:-1),s=g+t*Math.cos(p),l=y+i*Math.sin(p),f=xp(s,l,t,i,n,0,o,I,O,[p,k,g,y])}L=p-d;var z=Math.cos(d),Y=Math.sin(d),q=Math.cos(p),D=Math.sin(p),N=Math.tan(L/4),W=4/3*t*N,$=4/3*i*N,V=[r,e],_=[r+W*Y,e-$*z],et=[s+W*D,l-$*q],at=[s,l];if(_[0]=2*V[0]-_[0],_[1]=2*V[1]-_[1],u)return[_,et,at].concat(f);f=[_,et,at].concat(f).join().split(",");for(var K=[],tt=0,gt=f.length;tt7){w[b].shift();for(var S=w[b];S.length;)o[b]="A",i&&(s[b]="A"),w.splice(b++,0,["C"].concat(S.splice(0,6)));w.splice(b,1),c=Math.max(t.length,i&&i.length||0)}},v=function(w,b,S,M,F){w&&b&&w[F][0]==="M"&&b[F][0]!=="M"&&(b.splice(F,0,["M",M.x,M.y]),S.bx=0,S.by=0,S.x=w[F][1],S.y=w[F][2],c=Math.max(t.length,i&&i.length||0))};c=Math.max(t.length,i&&i.length||0);for(var d=0;d1?1:l<0?0:l;for(var u=l/2,c=12,h=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],v=0,d=0;d0&&v<1&&l.push(v);continue}var p=h*h-4*f*c,g=Math.sqrt(p);if(!(p<0)){var y=(-h+g)/(2*c);y>0&&y<1&&l.push(y);var x=(-h-g)/(2*c);x>0&&x<1&&l.push(x)}}for(var w=l.length,b=w,S;w--;)v=l[w],S=1-v,u[0][w]=S*S*S*r+3*S*S*v*t+3*S*v*v*n+v*v*v*o,u[1][w]=S*S*S*e+3*S*S*v*i+3*S*v*v*a+v*v*v*s;return u[0][b]=r,u[1][b]=e,u[0][b+1]=o,u[1][b+1]=s,u[0].length=u[1].length=b+2,{min:{x:Math.min.apply(0,u[0]),y:Math.min.apply(0,u[1])},max:{x:Math.max.apply(0,u[0]),y:Math.max.apply(0,u[1])}}},Pw=function(r,e,t,i,n,a,o,s){if(!(Math.max(r,t)Math.max(n,o)||Math.max(e,i)Math.max(a,s))){var l=(r*i-e*t)*(n-o)-(r-t)*(n*s-a*o),u=(r*i-e*t)*(a-s)-(e-i)*(n*s-a*o),c=(r-t)*(a-s)-(e-i)*(n-o);if(c){var h=l/c,f=u/c,v=+h.toFixed(2),d=+f.toFixed(2);if(!(v<+Math.min(r,t).toFixed(2)||v>+Math.max(r,t).toFixed(2)||v<+Math.min(n,o).toFixed(2)||v>+Math.max(n,o).toFixed(2)||d<+Math.min(e,i).toFixed(2)||d>+Math.max(e,i).toFixed(2)||d<+Math.min(a,s).toFixed(2)||d>+Math.max(a,s).toFixed(2)))return{x:h,y:f}}}},Cr=function(r,e,t){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},bp=function(r,e,t,i,n){if(n)return[["M",+r+ +n,e],["l",t-n*2,0],["a",n,n,0,0,1,n,n],["l",0,i-n*2],["a",n,n,0,0,1,-n,n],["l",n*2-t,0],["a",n,n,0,0,1,-n,-n],["l",0,n*2-i],["a",n,n,0,0,1,n,-n],["z"]];var a=[["M",r,e],["l",t,0],["l",0,i],["l",-t,0],["z"]];return a.parsePathArray=wp,a},iu=function(r,e,t,i){return r===null&&(r=e=t=i=0),e===null&&(e=r.y,t=r.width,i=r.height,r=r.x),{x:r,y:e,width:t,w:t,height:i,h:i,x2:r+t,y2:e+i,cx:r+t/2,cy:e+i/2,r1:Math.min(t,i)/2,r2:Math.max(t,i)/2,r0:Math.sqrt(t*t+i*i)/2,path:bp(r,e,t,i),vb:[r,e,t,i].join(" ")}},Dw=function(r,e){return r=iu(r),e=iu(e),Cr(e,r.x,r.y)||Cr(e,r.x2,r.y)||Cr(e,r.x,r.y2)||Cr(e,r.x2,r.y2)||Cr(r,e.x,e.y)||Cr(r,e.x2,e.y)||Cr(r,e.x,e.y2)||Cr(r,e.x2,e.y2)||(r.xe.x||e.xr.x)&&(r.ye.y||e.yr.y)},_h=function(r,e,t,i,n,a,o,s){R(r)||(r=[r,e,t,i,n,a,o,s]);var l=Iw.apply(null,r);return iu(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},qh=function(r,e,t,i,n,a,o,s,l){var u=1-l,c=Math.pow(u,3),h=Math.pow(u,2),f=l*l,v=f*l,d=c*r+h*3*l*t+u*3*l*l*n+v*o,p=c*e+h*3*l*i+u*3*l*l*a+v*s,g=r+2*l*(t-r)+f*(n-2*t+r),y=e+2*l*(i-e)+f*(a-2*i+e),x=t+2*l*(n-t)+f*(o-2*n+t),w=i+2*l*(a-i)+f*(s-2*a+i),b=u*r+l*t,S=u*e+l*i,M=u*n+l*o,F=u*a+l*s,T=90-Math.atan2(g-x,y-w)*180/Math.PI;return{x:d,y:p,m:{x:g,y},n:{x,y:w},start:{x:b,y:S},end:{x:M,y:F},alpha:T}},Ow=function(r,e,t){var i=_h(r),n=_h(e);if(!Dw(i,n))return[];for(var a=Wh.apply(0,r),o=Wh.apply(0,e),s=~~(a/8),l=~~(o/8),u=[],c=[],h={},f=[],v=0;v=0&&F<=1&&T>=0&&T<=1&&f.push({x:M.x,y:M.y,t1:F,t2:T})}}return f},Bw=function(r,e,t){r=ru(r),e=ru(e);for(var i,n,a,o,s,l,u,c,h,f,v=t?0:[],d=0,p=r.length;d=3&&(h.length===3&&f.push("Q"),f=f.concat(h[1])),h.length===2&&f.push("L"),f=f.concat(h[h.length-1]),f});return c}var Gw=function(r,e,t){if(t===1)return[[].concat(r)];var i=[];if(e[0]==="L"||e[0]==="C"||e[0]==="Q")i=i.concat(Nw(r,e,t));else{var n=[].concat(r);n[0]==="M"&&(n[0]="L");for(var a=0;a<=t-1;a++)i.push(n)}return i},Vw=function(r,e){if(r.length===1)return r;var t=r.length-1,i=e.length-1,n=t/i,a=[];if(r.length===1&&r[0][0]==="M"){for(var o=0;o=0;l--)o=a[l].index,a[l].type==="add"?r.splice(o,0,[].concat(r[o])):r.splice(o,1)}i=r.length;var h=n-i;if(i0)t=hl(t,r[i-1],1);else{r[i]=e[i];break}r[i]=["Q"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"T":r[i]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(i>0)t=hl(t,r[i-1],2);else{r[i]=e[i];break}r[i]=["C"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"S":if(t.length<2)if(i>0)t=hl(t,r[i-1],1);else{r[i]=e[i];break}r[i]=["S"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;default:r[i]=e[i]}return r};const nc=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:tu,fillPath:Vw,fillPathByDiff:Sp,formatPath:nu,intersection:Rw,parsePathArray:wp,parsePathString:Xi,pathToAbsolute:eu,pathToCurve:ru,rectPath:bp},Symbol.toStringTag,{value:"Module"}));var Ta=function(){function r(e,t){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=e,this.name=e,this.originalEvent=t,this.timeStamp=t.timeStamp}return r.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},r.prototype.stopPropagation=function(){this.propagationStopped=!0},r.prototype.toString=function(){var e=this.type;return"[Event (type="+e+")]"},r.prototype.save=function(){},r.prototype.restore=function(){},r}();function Mp(r,e){var t=r.indexOf(e);t!==-1&&r.splice(t,1)}var Uh=typeof window<"u"&&typeof window.document<"u";function Ap(r,e){if(r.isCanvas())return!0;for(var t=e.getParent(),i=!1;t;){if(t===r){i=!0;break}t=t.getParent()}return i}function ra(r){return r.cfg.visible&&r.cfg.capture}var hs=function(r){E(e,r);function e(t){var i=r.call(this)||this;i.destroyed=!1;var n=i.getDefaultCfg();return i.cfg=mt(n,t),i}return e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,i){this.cfg[t]=i},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(rc),jh=function(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,a;i"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Uw:typeof navigator<"u"?Jw(navigator.userAgent):e1()}function Kw(r){return r!==""&&Qw.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var a=n.exec(r);return!!a&&[i,a]},!1)}function Jw(r){var e=Kw(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new qw;var n=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);n?n.length=0;return t?n?Math.PI*2-i:i:n?i:Math.PI*2-i}function Kh(r,e){var t=[],i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],l=r[5],u=r[6],c=r[7],h=r[8],f=e[0],v=e[1],d=e[2],p=e[3],g=e[4],y=e[5],x=e[6],w=e[7],b=e[8];return t[0]=f*i+v*o+d*u,t[1]=f*n+v*s+d*c,t[2]=f*a+v*l+d*h,t[3]=p*i+g*o+y*u,t[4]=p*n+g*s+y*c,t[5]=p*a+g*l+y*h,t[6]=x*i+w*o+b*u,t[7]=x*n+w*s+b*c,t[8]=x*a+w*l+b*h,t}function hr(r,e){var t=[],i=e[0],n=e[1];return t[0]=r[0]*i+r[3]*n+r[6],t[1]=r[1]*i+r[4]*n+r[7],t}function vs(r){var e=[],t=r[0],i=r[1],n=r[2],a=r[3],o=r[4],s=r[5],l=r[6],u=r[7],c=r[8],h=c*o-s*u,f=-c*a+s*l,v=u*a-o*l,d=t*h+i*f+n*v;return d?(d=1/d,e[0]=h*d,e[1]=(-c*i+n*u)*d,e[2]=(s*i-n*o)*d,e[3]=f*d,e[4]=(c*t-n*l)*d,e[5]=(-s*t+n*a)*d,e[6]=v*d,e[7]=(-u*t+i*l)*d,e[8]=(o*t-i*a)*d,e):null}var An=Rt,fl="matrix",u1=["zIndex","capture","visible","type"],c1=["repeat"],h1=":",f1="*";function v1(r){for(var e=[],t=0;to.delay&&C(e.toAttrs,function(s,l){a.call(o.toAttrs,l)&&(delete o.toAttrs[l],delete o.fromAttrs[l])})}),r}var Ep=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;i.attrs={};var n=i.getDefaultAttrs();return mt(n,t.attrs),i.attrs=n,i.initAttrs(n),i.initAnimate(),i}return e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,i=[],n=0;n0?a=g1(a,b):n.addAnimator(this),a.push(b),this.set("animations",a),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var i=this;t===void 0&&(t=!0);var n=this.get("animations");C(n,function(a){t&&(a.onFrame?i.attr(a.onFrame(1)):i.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),i=this.get("animations"),n=t.getTime();return C(i,function(a){a._paused=!0,a._pauseTime=n,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline"),i=t.getTime(),n=this.get("animations"),a=this.get("_pause").pauseTime;return C(n,function(o){o.startTime=o.startTime+(i-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",n),this},e.prototype.emitDelegation=function(t,i){var n=this,a=i.propagationPath;this.getEvents();var o;t==="mouseenter"?o=i.fromShape:t==="mouseleave"&&(o=i.toShape);for(var s=function(h){var f=a[h],v=f.get("name");if(v){if((f.isGroup()||f.isCanvas&&f.isCanvas())&&o&&Ap(f,o))return"break";R(v)?C(v,function(d){n.emitDelegateEvent(f,d,i)}):l.emitDelegateEvent(f,v,i)}},l=this,u=0;u0)});o.length>0?C(o,function(l){var u=l.getBBox(),c=u.minX,h=u.maxX,f=u.minY,v=u.maxY;ci&&(i=h),fa&&(a=v)}):(t=0,i=0,n=0,a=0);var s={x:t,y:n,minX:t,minY:n,maxX:i,maxY:a,width:i-t,height:a-n};return s},e.prototype.getCanvasBBox=function(){var t=1/0,i=-1/0,n=1/0,a=-1/0,o=this.getChildren().filter(function(l){return l.get("visible")&&(!l.isGroup()||l.isGroup()&&l.getChildren().length>0)});o.length>0?C(o,function(l){var u=l.getCanvasBBox(),c=u.minX,h=u.maxX,f=u.minY,v=u.maxY;ci&&(i=h),fa&&(a=v)}):(t=0,i=0,n=0,a=0);var s={x:t,y:n,minX:t,minY:n,maxX:i,maxY:a,width:i-t,height:a-n};return s},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.children=[],t},e.prototype.onAttrChange=function(t,i,n){if(r.prototype.onAttrChange.call(this,t,i,n),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},e.prototype.applyMatrix=function(t){var i=this.getTotalMatrix();r.prototype.applyMatrix.call(this,t);var n=this.getTotalMatrix();n!==i&&this._applyChildrenMarix(n)},e.prototype._applyChildrenMarix=function(t){var i=this.getChildren();C(i,function(n){n.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],i=0;i=0;s--){var l=t[s];if(ra(l)&&(l.isGroup()?o=l.getShape(i,n,a):l.isHit(i,n)&&(o=l)),o)break}return o},e.prototype.add=function(t){var i=this.getCanvas(),n=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&y1(o,t),t.set("parent",this),i&&kp(t,i),a&&Lp(t,a),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var i=this.getTotalMatrix();i&&t.applyMatrix(i)},e.prototype.getChildren=function(){return this.get("children")||[]},e.prototype.sort=function(){var t=this.getChildren();C(t,function(i,n){return i[au]=n,i}),t.sort(m1(function(i,n){return i.get("zIndex")-n.get("zIndex")})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),i=t.length-1;i>=0;i--)t[i].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),r.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){var i=this.getChildren();return i[t]},e.prototype.getCount=function(){var t=this.getChildren();return t.length},e.prototype.contain=function(t){var i=this.getChildren();return i.indexOf(t)>-1},e.prototype.removeChild=function(t,i){i===void 0&&(i=!0),this.contain(t)&&t.remove(i)},e.prototype.findAll=function(t){var i=[],n=this.getChildren();return C(n,function(a){t(a)&&i.push(a),a.isGroup()&&(i=i.concat(a.findAll(t)))}),i},e.prototype.find=function(t){var i=null,n=this.getChildren();return C(n,function(a){if(t(a)?i=a:a.isGroup()&&(i=a.find(t)),i)return!1}),i},e.prototype.findById=function(t){return this.find(function(i){return i.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(i){return i.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(i){return i.get("name")===t})},e}(Ep),en=0,Bn=0,Fn=0,Pp=1e3,zo,Rn,No=0,Si=0,ds=0,ia=typeof performance=="object"&&performance.now?performance:Date,Dp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function Op(){return Si||(Dp(x1),Si=ia.now()+ds)}function x1(){Si=0}function ou(){this._call=this._time=this._next=null}ou.prototype=Bp.prototype={constructor:ou,restart:function(r,e,t){if(typeof r!="function")throw new TypeError("callback is not a function");t=(t==null?Op():+t)+(e==null?0:+e),!this._next&&Rn!==this&&(Rn?Rn._next=this:zo=this,Rn=this),this._call=r,this._time=t,su()},stop:function(){this._call&&(this._call=null,this._time=1/0,su())}};function Bp(r,e,t){var i=new ou;return i.restart(r,e,t),i}function w1(){Op(),++en;for(var r=zo,e;r;)(e=Si-r._time)>=0&&r._call.call(null,e),r=r._next;--en}function tf(){Si=(No=ia.now())+ds,en=Bn=0;try{w1()}finally{en=0,S1(),Si=0}}function b1(){var r=ia.now(),e=r-No;e>Pp&&(ds-=e,No=r)}function S1(){for(var r,e=zo,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),r=e,e=e._next):(t=e._next,e._next=null,e=r?r._next=t:zo=t);Rn=r,su(i)}function su(r){if(!en){Bn&&(Bn=clearTimeout(Bn));var e=r-Si;e>24?(r<1/0&&(Bn=setTimeout(tf,r-ia.now()-ds)),Fn&&(Fn=clearInterval(Fn))):(Fn||(No=ia.now(),Fn=setInterval(b1,Pp)),en=1,Dp(tf))}}function sc(r,e,t){r.prototype=e.prototype=t,t.constructor=r}function Rp(r,e){var t=Object.create(r.prototype);for(var i in e)t[i]=e[i];return t}function Ea(){}var na=.7,Go=1/na,qi="\\s*([+-]?\\d+)\\s*",aa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",C1=/^#([0-9a-f]{3,8})$/,M1=new RegExp(`^rgb\\(${qi},${qi},${qi}\\)$`),A1=new RegExp(`^rgb\\(${Qe},${Qe},${Qe}\\)$`),F1=new RegExp(`^rgba\\(${qi},${qi},${qi},${aa}\\)$`),T1=new RegExp(`^rgba\\(${Qe},${Qe},${Qe},${aa}\\)$`),E1=new RegExp(`^hsl\\(${aa},${Qe},${Qe}\\)$`),k1=new RegExp(`^hsla\\(${aa},${Qe},${Qe},${aa}\\)$`),ef={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};sc(Ea,oa,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:rf,formatHex:rf,formatHex8:L1,formatHsl:I1,formatRgb:nf,toString:nf});function rf(){return this.rgb().formatHex()}function L1(){return this.rgb().formatHex8()}function I1(){return zp(this).formatHsl()}function nf(){return this.rgb().formatRgb()}function oa(r){var e,t;return r=(r+"").trim().toLowerCase(),(e=C1.exec(r))?(t=e[1].length,e=parseInt(e[1],16),t===6?af(e):t===3?new he(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?qa(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?qa(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=M1.exec(r))?new he(e[1],e[2],e[3],1):(e=A1.exec(r))?new he(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=F1.exec(r))?qa(e[1],e[2],e[3],e[4]):(e=T1.exec(r))?qa(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=E1.exec(r))?lf(e[1],e[2]/100,e[3]/100,1):(e=k1.exec(r))?lf(e[1],e[2]/100,e[3]/100,e[4]):ef.hasOwnProperty(r)?af(ef[r]):r==="transparent"?new he(NaN,NaN,NaN,0):null}function af(r){return new he(r>>16&255,r>>8&255,r&255,1)}function qa(r,e,t,i){return i<=0&&(r=e=t=NaN),new he(r,e,t,i)}function P1(r){return r instanceof Ea||(r=oa(r)),r?(r=r.rgb(),new he(r.r,r.g,r.b,r.opacity)):new he}function lu(r,e,t,i){return arguments.length===1?P1(r):new he(r,e,t,i??1)}function he(r,e,t,i){this.r=+r,this.g=+e,this.b=+t,this.opacity=+i}sc(he,lu,Rp(Ea,{brighter(r){return r=r==null?Go:Math.pow(Go,r),new he(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?na:Math.pow(na,r),new he(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new he(di(this.r),di(this.g),di(this.b),Vo(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:of,formatHex:of,formatHex8:D1,formatRgb:sf,toString:sf}));function of(){return`#${li(this.r)}${li(this.g)}${li(this.b)}`}function D1(){return`#${li(this.r)}${li(this.g)}${li(this.b)}${li((isNaN(this.opacity)?1:this.opacity)*255)}`}function sf(){const r=Vo(this.opacity);return`${r===1?"rgb(":"rgba("}${di(this.r)}, ${di(this.g)}, ${di(this.b)}${r===1?")":`, ${r})`}`}function Vo(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function di(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function li(r){return r=di(r),(r<16?"0":"")+r.toString(16)}function lf(r,e,t,i){return i<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new ze(r,e,t,i)}function zp(r){if(r instanceof ze)return new ze(r.h,r.s,r.l,r.opacity);if(r instanceof Ea||(r=oa(r)),!r)return new ze;if(r instanceof ze)return r;r=r.rgb();var e=r.r/255,t=r.g/255,i=r.b/255,n=Math.min(e,t,i),a=Math.max(e,t,i),o=NaN,s=a-n,l=(a+n)/2;return s?(e===a?o=(t-i)/s+(t0&&l<1?0:o,new ze(o,s,l,r.opacity)}function O1(r,e,t,i){return arguments.length===1?zp(r):new ze(r,e,t,i??1)}function ze(r,e,t,i){this.h=+r,this.s=+e,this.l=+t,this.opacity=+i}sc(ze,O1,Rp(Ea,{brighter(r){return r=r==null?Go:Math.pow(Go,r),new ze(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?na:Math.pow(na,r),new ze(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,e=isNaN(r)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,n=2*t-i;return new he(vl(r>=240?r-240:r+120,n,i),vl(r,n,i),vl(r<120?r+240:r-120,n,i),this.opacity)},clamp(){return new ze(uf(this.h),Ua(this.s),Ua(this.l),Vo(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Vo(this.opacity);return`${r===1?"hsl(":"hsla("}${uf(this.h)}, ${Ua(this.s)*100}%, ${Ua(this.l)*100}%${r===1?")":`, ${r})`}`}}));function uf(r){return r=(r||0)%360,r<0?r+360:r}function Ua(r){return Math.max(0,Math.min(1,r||0))}function vl(r,e,t){return(r<60?e+(t-e)*r/60:r<180?t:r<240?e+(t-e)*(240-r)/60:e)*255}const lc=r=>()=>r;function B1(r,e){return function(t){return r+t*e}}function R1(r,e,t){return r=Math.pow(r,t),e=Math.pow(e,t)-r,t=1/t,function(i){return Math.pow(r+i*e,t)}}function z1(r){return(r=+r)==1?Np:function(e,t){return t-e?R1(e,t,r):lc(isNaN(e)?t:e)}}function Np(r,e){var t=e-r;return t?B1(r,t):lc(isNaN(r)?e:r)}const cf=function r(e){var t=z1(e);function i(n,a){var o=t((n=lu(n)).r,(a=lu(a)).r),s=t(n.g,a.g),l=t(n.b,a.b),u=Np(n.opacity,a.opacity);return function(c){return n.r=o(c),n.g=s(c),n.b=l(c),n.opacity=u(c),n+""}}return i.gamma=r,i}(1);function Gp(r,e){e||(e=[]);var t=r?Math.min(e.length,r.length):0,i=e.slice(),n;return function(a){for(n=0;nt&&(a=e.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(i=i[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:uu(i,n)})),t=dl.lastIndex;return tu.length?(l=Xi(a[s]),u=Xi(n[s]),u=Sp(u,l),u=nu(u,l),e.fromAttrs.path=u,e.toAttrs.path=l):e.pathFormatted||(l=Xi(a[s]),u=Xi(n[s]),u=nu(u,l),e.fromAttrs.path=u,e.toAttrs.path=l,e.pathFormatted=!0),i[s]=[];for(var c=0;c0){for(var s=e.animators.length-1;s>=0;s--){if(i=e.animators[s],i.destroyed){e.removeAnimator(s);continue}if(!i.isAnimatePaused()){n=i.get("animations");for(var l=n.length-1;l>=0;l--)a=n[l],t=Sb(i,a,o),t&&(n.splice(l,1),t=!1,a.callback&&a.callback())}n.length===0&&e.removeAnimator(s)}var u=e.canvas.get("autoDraw");u||e.canvas.draw()}})},r.prototype.addAnimator=function(e){this.animators.push(e)},r.prototype.removeAnimator=function(e){this.animators.splice(e,1)},r.prototype.isAnimating=function(){return!!this.animators.length},r.prototype.stop=function(){this.timer&&this.timer.stop()},r.prototype.stopAllAnimations=function(e){e===void 0&&(e=!0),this.animators.forEach(function(t){t.stopAnimate(e)}),this.animators=[],this.canvas.draw()},r.prototype.getTime=function(){return this.current},r}(),Mb=40,wf=0,bf=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function Sf(r,e,t){t.name=e,t.target=r,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}function Ab(r,e,t){if(t.bubbles){var i=void 0,n=!1;if(e==="mouseenter"?(i=t.fromShape,n=!0):e==="mouseleave"&&(n=!0,i=t.toShape),r.isCanvas()&&n)return;if(i&&Ap(r,i)){t.bubbles=!1;return}t.name=e,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}}var Fb=function(){function r(e){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(i){var n=i.type;t._triggerEvent(n,i)},this._onDocumentMove=function(i){var n=t.canvas,a=n.get("el");if(a!==i.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(i);t.dragging&&t._emitEvent("drag",i,o,t.draggingShape)}},this._onDocumentMouseUp=function(i){var n=t.canvas,a=n.get("el");if(a!==i.target&&t.dragging){var o=t._getPointInfo(i);t.draggingShape&&t._emitEvent("drop",i,o,null),t._emitEvent("dragend",i,o,t.draggingShape),t._afterDrag(t.draggingShape,o,i)}},this.canvas=e.canvas}return r.prototype.init=function(){this._bindEvents()},r.prototype._bindEvents=function(){var e=this,t=this.canvas.get("el");C(bf,function(i){t.addEventListener(i,e._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._clearEvents=function(){var e=this,t=this.canvas.get("el");C(bf,function(i){t.removeEventListener(i,e._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},r.prototype._getEventObj=function(e,t,i,n,a,o){var s=new Ta(e,t);return s.fromShape=a,s.toShape=o,s.x=i.x,s.y=i.y,s.clientX=i.clientX,s.clientY=i.clientY,s.propagationPath.push(n),s},r.prototype._getShape=function(e,t){return this.canvas.getShape(e.x,e.y,t)},r.prototype._getPointInfo=function(e){var t=this.canvas,i=t.getClientByEvent(e),n=t.getPointByEvent(e);return{x:n.x,y:n.y,clientX:i.x,clientY:i.y}},r.prototype._triggerEvent=function(e,t){var i=this._getPointInfo(t),n=this._getShape(i,t),a=this["_on"+e],o=!1;if(a)a.call(this,i,n,t);else{var s=this.currentShape;e==="mouseenter"||e==="dragenter"||e==="mouseover"?(this._emitEvent(e,t,i,null,null,n),n&&this._emitEvent(e,t,i,n,null,n),e==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,i,null)):e==="mouseleave"||e==="dragleave"||e==="mouseout"?(o=!0,s&&this._emitEvent(e,t,i,s,s,null),this._emitEvent(e,t,i,null,s,null),e==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,i,null)):this._emitEvent(e,t,i,n,null,null)}if(o||(this.currentShape=n),n&&!n.get("destroyed")){var l=this.canvas,u=l.get("el");u.style.cursor=n.attr("cursor")||l.get("cursor")}},r.prototype._onmousedown=function(e,t,i){i.button===wf&&(this.mousedownShape=t,this.mousedownPoint=e,this.mousedownTimeStamp=i.timeStamp),this._emitEvent("mousedown",i,e,t,null,null)},r.prototype._emitMouseoverEvents=function(e,t,i,n){var a=this.canvas.get("el");i!==n&&(i&&(this._emitEvent("mouseout",e,t,i,i,n),this._emitEvent("mouseleave",e,t,i,i,n),(!n||n.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),n&&(this._emitEvent("mouseover",e,t,n,i,n),this._emitEvent("mouseenter",e,t,n,i,n)))},r.prototype._emitDragoverEvents=function(e,t,i,n,a){n?(n!==i&&(i&&this._emitEvent("dragleave",e,t,i,i,n),this._emitEvent("dragenter",e,t,n,i,n)),a||this._emitEvent("dragover",e,t,n)):i&&this._emitEvent("dragleave",e,t,i,i,n),a&&this._emitEvent("dragover",e,t,n)},r.prototype._afterDrag=function(e,t,i){e&&(e.set("capture",!0),this.draggingShape=null),this.dragging=!1;var n=this._getShape(t,i);n!==e&&this._emitMouseoverEvents(i,t,e,n),this.currentShape=n},r.prototype._onmouseup=function(e,t,i){if(i.button===wf){var n=this.draggingShape;this.dragging?(n&&this._emitEvent("drop",i,e,t),this._emitEvent("dragend",i,e,n),this._afterDrag(n,e,i)):(this._emitEvent("mouseup",i,e,t),t===this.mousedownShape&&this._emitEvent("click",i,e,t),this.mousedownShape=null,this.mousedownPoint=null)}},r.prototype._ondragover=function(e,t,i){i.preventDefault();var n=this.currentShape;this._emitDragoverEvents(i,e,n,t,!0)},r.prototype._onmousemove=function(e,t,i){var n=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(i,e,a,t,!1),this._emitEvent("drag",i,e,o);else{var s=this.mousedownPoint;if(s){var l=this.mousedownShape,u=i.timeStamp,c=u-this.mousedownTimeStamp,h=s.clientX-e.clientX,f=s.clientY-e.clientY,v=h*h+f*f;c>120||v>Mb?l&&l.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",i,e,o),this.mousedownShape=null,this.mousedownPoint=null):!l&&n.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",i,e,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(i,e,a,t),this._emitEvent("mousemove",i,e,t)):(this._emitMouseoverEvents(i,e,a,t),this._emitEvent("mousemove",i,e,t))}else this._emitMouseoverEvents(i,e,a,t),this._emitEvent("mousemove",i,e,t)}},r.prototype._emitEvent=function(e,t,i,n,a,o){var s=this._getEventObj(e,t,i,n,a,o);if(n){s.shape=n,Sf(n,e,s);for(var l=n.getParent();l;)l.emitDelegation(e,s),s.propagationStopped||Ab(l,e,s),s.propagationPath.push(l),l=l.getParent()}else{var u=this.canvas;Sf(u,e,s)}},r.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},r}(),Cf="px",Mf=Fp(),Tb=Mf&&Mf.name==="firefox",ps=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.initContainer(),i.initDom(),i.initEvents(),i.initTimeline(),i}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},e.prototype.initContainer=function(){var t=this.get("container");Q(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var i=this.get("container");i.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new Fb({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new Cb(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,i){var n=this.get("el");Uh&&(n.style.width=t+Cf,n.style.height=i+Cf)},e.prototype.changeSize=function(t,i){this.setDOMSize(t,i),this.set("width",t),this.set("height",i),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var i=this.get("el");Uh&&i&&(i.style.cursor=t)},e.prototype.getPointByEvent=function(t){var i=this.get("supportCSSTransform");if(i){if(Tb&&!B(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!B(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var n=this.getClientByEvent(t),a=n.x,o=n.y;return this.getPointByClient(a,o)},e.prototype.getClientByEvent=function(t){var i=t;return t.touches&&(t.type==="touchend"?i=t.changedTouches[0]:i=t.touches[0]),{x:i.clientX,y:i.clientY}},e.prototype.getPointByClient=function(t,i){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t-a.left,y:i-a.top}},e.prototype.getClientByPoint=function(t,i){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t+a.left,y:i+a.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),r.prototype.destroy.call(this))},e}(Ip),gs=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var t=r.prototype.clone.call(this),i=this.getChildren(),n=0;n=t&&n.minY<=i&&n.maxY>=i},e.prototype.afterAttrsChange=function(t){r.prototype.afterAttrsChange.call(this,t),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(t){r.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),i=this.getTotalMatrix(),n=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(i){var l=hr(i,[t.minX,t.minY]),u=hr(i,[t.maxX,t.minY]),c=hr(i,[t.minX,t.maxY]),h=hr(i,[t.maxX,t.maxY]);n=Math.min(l[0],u[0],c[0],h[0]),o=Math.max(l[0],u[0],c[0],h[0]),a=Math.min(l[1],u[1],c[1],h[1]),s=Math.max(l[1],u[1],c[1],h[1])}var f=this.attrs;if(f.shadowColor){var v=f.shadowBlur,d=v===void 0?0:v,p=f.shadowOffsetX,g=p===void 0?0:p,y=f.shadowOffsetY,x=y===void 0?0:y,w=n-d+g,b=o+d+g,S=a-d+x,M=s+d+x;n=Math.min(n,w),o=Math.max(o,b),a=Math.min(a,S),s=Math.max(s,M)}return{x:n,y:a,minX:n,minY:a,maxX:o,maxY:s,width:o-n,height:s-a}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,i){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,i){var n=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,i,1];o=this.invertFromMatrix(o);var s=o[0],l=o[1],u=this._isInBBox(s,l);return this.isOnlyHitBox()?u:!!(u&&!this.isClipped(s,l)&&(this.isInShape(s,l)||n&&n.isHit(s,l)||a&&a.isHit(s,l)))},e}(Ep),_p=new Map;function Pe(r,e){_p.set(r,e)}function ms(r){return _p.get(r)}function qp(r){var e=r.attr(),t=e.x,i=e.y,n=e.width,a=e.height;return{x:t,y:i,width:n,height:a}}function Up(r){var e=r.attr(),t=e.x,i=e.y,n=e.r;return{x:t-n,y:i-n,width:n*2,height:n*2}}function te(r,e,t,i){var n=r-t,a=e-i;return Math.sqrt(n*n+a*a)}function Ao(r,e){return Math.abs(r-e)<.001}function pn(r,e){var t=Le(r),i=Le(e),n=be(r),a=be(e);return{x:t,y:i,width:n-t,height:a-i}}function xs(r){return(r+Math.PI*2)%(Math.PI*2)}const Wt={box:function(r,e,t,i){return pn([r,t],[e,i])},length:function(r,e,t,i){return te(r,e,t,i)},pointAt:function(r,e,t,i,n){return{x:(1-n)*r+n*t,y:(1-n)*e+n*i}},pointDistance:function(r,e,t,i,n,a){var o=(t-r)*(n-r)+(i-e)*(a-e);if(o<0)return te(r,e,n,a);var s=(t-r)*(t-r)+(i-e)*(i-e);return o>s?te(t,i,n,a):this.pointToLine(r,e,t,i,n,a)},pointToLine:function(r,e,t,i,n,a){var o=[t-r,i-e];if(Vx(o,[0,0]))return Math.sqrt((n-r)*(n-r)+(a-e)*(a-e));var s=[-o[1],o[0]];np(s,s);var l=[n-r,a-e];return Math.abs(Yx(l,s))},tangentAngle:function(r,e,t,i){return Math.atan2(i-e,t-r)}};var Eb=1e-4;function jp(r,e,t,i,n,a){var o,s=1/0,l=[t,i],u=20;a&&a>200&&(u=a/10);for(var c=1/u,h=c/10,f=0;f<=u;f++){var v=f*c,d=[n.apply(null,r.concat([v])),n.apply(null,e.concat([v]))],p=te(l[0],l[1],d[0],d[1]);p=0&&p=0?[n]:[]}function Ff(r,e,t,i){return 2*(1-i)*(e-r)+2*i*(t-e)}function Zp(r,e,t,i,n,a,o){var s=Er(r,t,n,o),l=Er(e,i,a,o),u=Wt.pointAt(r,e,t,i,o),c=Wt.pointAt(t,i,n,a,o);return[[r,e,u.x,u.y,s,l],[s,l,c.x,c.y,n,a]]}function fu(r,e,t,i,n,a,o){if(o===0)return(te(r,e,t,i)+te(t,i,n,a)+te(r,e,n,a))/2;var s=Zp(r,e,t,i,n,a,.5),l=s[0],u=s[1];return l.push(o-1),u.push(o-1),fu.apply(null,l)+fu.apply(null,u)}const Qp={box:function(r,e,t,i,n,a){var o=Af(r,t,n)[0],s=Af(e,i,a)[0],l=[r,n],u=[e,a];return o!==void 0&&l.push(Er(r,t,n,o)),s!==void 0&&u.push(Er(e,i,a,s)),pn(l,u)},length:function(r,e,t,i,n,a){return fu(r,e,t,i,n,a,3)},nearestPoint:function(r,e,t,i,n,a,o,s){return jp([r,t,n],[e,i,a],o,s,Er)},pointDistance:function(r,e,t,i,n,a,o,s){var l=this.nearestPoint(r,e,t,i,n,a,o,s);return te(l.x,l.y,o,s)},interpolationAt:Er,pointAt:function(r,e,t,i,n,a,o){return{x:Er(r,t,n,o),y:Er(e,i,a,o)}},divide:function(r,e,t,i,n,a,o){return Zp(r,e,t,i,n,a,o)},tangentAngle:function(r,e,t,i,n,a,o){var s=Ff(r,t,n,o),l=Ff(e,i,a,o),u=Math.atan2(l,s);return xs(u)}};function kr(r,e,t,i,n){var a=1-n;return a*a*a*r+3*e*n*a*a+3*t*n*n*a+i*n*n*n}function Tf(r,e,t,i,n){var a=1-n;return 3*(a*a*(e-r)+2*a*n*(t-e)+n*n*(i-t))}function pl(r,e,t,i){var n=-3*r+9*e-9*t+3*i,a=6*r-12*e+6*t,o=3*e-3*r,s=[],l,u,c;if(Ao(n,0))Ao(a,0)||(l=-o/a,l>=0&&l<=1&&s.push(l));else{var h=a*a-4*n*o;Ao(h,0)?s.push(-a/(2*n)):h>0&&(c=Math.sqrt(h),l=(-a+c)/(2*n),u=(-a-c)/(2*n),l>=0&&l<=1&&s.push(l),u>=0&&u<=1&&s.push(u))}return s}function Kp(r,e,t,i,n,a,o,s,l){var u=kr(r,t,n,o,l),c=kr(e,i,a,s,l),h=Wt.pointAt(r,e,t,i,l),f=Wt.pointAt(t,i,n,a,l),v=Wt.pointAt(n,a,o,s,l),d=Wt.pointAt(h.x,h.y,f.x,f.y,l),p=Wt.pointAt(f.x,f.y,v.x,v.y,l);return[[r,e,h.x,h.y,d.x,d.y,u,c],[u,c,p.x,p.y,v.x,v.y,o,s]]}function vu(r,e,t,i,n,a,o,s,l){if(l===0)return kb([r,t,n,o],[e,i,a,s]);var u=Kp(r,e,t,i,n,a,o,s,.5),c=u[0],h=u[1];return c.push(l-1),h.push(l-1),vu.apply(null,c)+vu.apply(null,h)}const Hn={extrema:pl,box:function(r,e,t,i,n,a,o,s){for(var l=[r,o],u=[e,s],c=pl(r,t,n,o),h=pl(e,i,a,s),f=0;f0?t:t*-1}const Lb={box:function(r,e,t,i){return{x:r-t,y:e-i,width:t*2,height:i*2}},length:function(r,e,t,i){return Math.PI*(3*(t+i)-Math.sqrt((3*t+i)*(t+3*i)))},nearestPoint:function(r,e,t,i,n,a){var o=t,s=i;if(o===0||s===0)return{x:r,y:e};for(var l=n-r,u=a-e,c=Math.abs(l),h=Math.abs(u),f=o*o,v=s*s,d=Math.PI/4,p,g,y=0;y<4;y++){p=o*Math.cos(d),g=s*Math.sin(d);var x=(f-v)*Math.pow(Math.cos(d),3)/o,w=(v-f)*Math.pow(Math.sin(d),3)/s,b=p-x,S=g-w,M=c-x,F=h-w,T=Math.hypot(S,b),L=Math.hypot(F,M),k=T*Math.asin((b*F-S*M)/(T*L)),I=k/Math.sqrt(f+v-p*p-g*g);d+=I,d=Math.min(Math.PI/2,Math.max(0,d))}return{x:r+Ef(p,l),y:e+Ef(g,u)}},pointDistance:function(r,e,t,i,n,a){var o=this.nearestPoint(r,e,t,i,n,a);return te(o.x,o.y,n,a)},pointAt:function(r,e,t,i,n){var a=2*Math.PI*n;return{x:r+t*Math.cos(a),y:e+i*Math.sin(a)}},tangentAngle:function(r,e,t,i,n){var a=2*Math.PI*n,o=Math.atan2(i*Math.cos(a),-t*Math.sin(a));return xs(o)}};function Ib(r,e,t,i,n,a,o,s){return-1*t*Math.cos(n)*Math.sin(s)-i*Math.sin(n)*Math.cos(s)}function Pb(r,e,t,i,n,a,o,s){return-1*t*Math.sin(n)*Math.sin(s)+i*Math.cos(n)*Math.cos(s)}function Db(r,e,t){return Math.atan(-e/r*Math.tan(t))}function Ob(r,e,t){return Math.atan(e/(r*Math.tan(t)))}function kf(r,e,t,i,n,a){return t*Math.cos(n)*Math.cos(a)-i*Math.sin(n)*Math.sin(a)+r}function Lf(r,e,t,i,n,a){return t*Math.sin(n)*Math.cos(a)+i*Math.cos(n)*Math.sin(a)+e}function Bb(r,e,t,i){var n=Math.atan2(i*r,t*e);return(n+Math.PI*2)%(Math.PI*2)}function If(r,e,t){return{x:r*Math.cos(t),y:e*Math.sin(t)}}function Pf(r,e,t){var i=Math.cos(t),n=Math.sin(t);return[r*i-e*n,r*n+e*i]}const Rb={box:function(r,e,t,i,n,a,o){for(var s=Db(t,i,n),l=1/0,u=-1/0,c=[a,o],h=-Math.PI*2;h<=Math.PI*2;h+=Math.PI){var f=s+h;au&&(u=v)}for(var d=Ob(t,i,n),p=1/0,g=-1/0,y=[a,o],h=-Math.PI*2;h<=Math.PI*2;h+=Math.PI){var x=d+h;ag&&(g=w)}return{x:l,y:p,width:u-l,height:g-p}},length:function(r,e,t,i,n,a,o){},nearestPoint:function(r,e,t,i,n,a,o,s,l){var u=Pf(s-r,l-e,-n),c=u[0],h=u[1],f=Lb.nearestPoint(0,0,t,i,c,h),v=Bb(t,i,f.x,f.y);vo&&(f=If(t,i,o));var d=Pf(f.x,f.y,n);return{x:d[0]+r,y:d[1]+e}},pointDistance:function(r,e,t,i,n,a,o,s,l){var u=this.nearestPoint(r,e,t,i,s,l);return te(u.x,u.y,s,l)},pointAt:function(r,e,t,i,n,a,o,s){var l=(o-a)*s+a;return{x:kf(r,e,t,i,n,l),y:Lf(r,e,t,i,n,l)}},tangentAngle:function(r,e,t,i,n,a,o,s){var l=(o-a)*s+a,u=Ib(r,e,t,i,n,a,o,l),c=Pb(r,e,t,i,n,a,o,l);return xs(Math.atan2(c,u))}};function Jp(r){for(var e=0,t=[],i=0;i1||e<0||r.length<2)return null;var t=Jp(r),i=t.segments,n=t.totalLength;if(n===0)return{x:r[0][0],y:r[0][1]};for(var a=0,o=null,s=0;s=a&&e<=a+h){var f=(e-a)/h;o=Wt.pointAt(u[0],u[1],c[0],c[1],f);break}a+=h}return o}function Gb(r,e){if(e>1||e<0||r.length<2)return 0;for(var t=Jp(r),i=t.segments,n=t.totalLength,a=0,o=0,s=0;s=a&&e<=a+h){o=Math.atan2(c[1]-u[1],c[0]-u[0]);break}a+=h}return o}function Vb(r,e,t){for(var i=1/0,n=0;n1){var n=Hb(e,t);return e*i+n*(i-1)}return e}function Hb(r,e){return e?e-r:r*.14}function Xb(r,e){var t=ws(),i=0;if(B(r)||r==="")return i;if(t.save(),t.font=e,Q(r)&&r.includes(` `)){var n=r.split(` `);C(n,function(a){var o=t.measureText(a).width;i1){var n=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=n}C(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[i]=t}),e}function jb(r,e,t,i){var n=[],a=!!i,o,s,l,u,c,h,f;if(a){l=i[0],u=i[1];for(var v=0,d=r.length;v2&&(t.push([n].concat(o.splice(0,2))),s="l",n=n==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([n,o[0]]),s==="r")t.push([n].concat(o));else for(;o.length>=e[s]&&(t.push([n].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}var Jb=/[a-z]/;function Of(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function rg(r){var e=eg(r);if(!e||!e.length)return[["M",0,0]];for(var t=!1,i=0;i=0){t=!0;break}}if(!t)return e;var a=[],o=0,s=0,l=0,u=0,c=0,h=e[0];(h[0]==="M"||h[0]==="m")&&(o=+h[1],s=+h[2],l=o,u=s,c++,a[0]=["M",o,s]);for(var i=c,f=e.length;i1&&(t*=Math.sqrt(v),i*=Math.sqrt(v));var d=t*t*(f*f)+i*i*(h*h),p=d?Math.sqrt((t*t*(i*i)-d)/d):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var g=i?p*t*f/i:0,y=t?p*-i*h/t:0,x=(s+u)/2+Math.cos(n)*g-Math.sin(n)*y,w=(l+c)/2+Math.sin(n)*g+Math.cos(n)*y,b=[(h-g)/t,(f-y)/i],S=[(-1*h-g)/t,(-1*f-y)/i],M=Bf([1,0],b),F=Bf(b,S);return du(b,S)<=-1&&(F=Math.PI),du(b,S)>=1&&(F=0),o===0&&F>0&&(F=F-2*Math.PI),o===1&&F<0&&(F=F+2*Math.PI),{cx:x,cy:w,rx:pu(r,[u,c])?0:t,ry:pu(r,[u,c])?0:i,startAngle:M,endAngle:M+F,xRotation:n,arcFlag:a,sweepFlag:o}}function Rf(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function ig(r){r=Ub(r);for(var e=[],t=null,i=null,n=null,a=0,o=r.length,s=0;s=e&&r<=t};function eS(r,e,t,i){var n=.001,a={x:t.x-r.x,y:t.y-r.y},o={x:e.x-r.x,y:e.y-r.y},s={x:i.x-t.x,y:i.y-t.y},l=o.x*s.y-o.y*s.x,u=l*l,c=o.x*o.x+o.y*o.y,h=s.x*s.x+s.y*s.y,f=null;if(u>n*c*h){var v=(a.x*s.y-a.y*s.x)/l,d=(a.x*o.y-a.y*o.x)/l;zf(v,0,1)&&zf(d,0,1)&&(f={x:r.x+v*o.x,y:r.y+v*o.y})}return f}var rS=1e-6;function yl(r){return Math.abs(r)0!=yl(s[1]-t)>0&&yl(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(i=!i)}return i}function Gf(r){for(var e=[],t=r.length,i=0;i1){var o=r[0],s=r[t-1];e.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return e}function nS(r,e){var t=!1;return C(r,function(i){if(eS(i.from,i.to,e.from,e.to))return t=!0,!1}),t}function Vf(r){var e=r.map(function(i){return i[0]}),t=r.map(function(i){return i[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}function aS(r,e){return!(e.minX>r.maxX||e.maxXr.maxY||e.maxYMath.PI/2?Math.PI-u:u,c=c>Math.PI/2?Math.PI-c:c;var h={xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(c-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0};return h}function lS(r){var e=r.attr(),t=e.path,i=e.stroke,n=i?e.lineWidth:0,a=r.get("segments")||ig(t),o=sS(a,n),s=o.x,l=o.y,u=o.width,c=o.height,h={minX:s,minY:l,maxX:s+u,maxY:l+c};return h=vc(r,h),{x:h.minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}}function uS(r){var e=r.attr(),t=e.x1,i=e.y1,n=e.x2,a=e.y2,o=Math.min(t,n),s=Math.max(t,n),l=Math.min(i,a),u=Math.max(i,a),c={minX:o,maxX:s,minY:l,maxY:u};return c=vc(r,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function cS(r){var e=r.attr(),t=e.x,i=e.y,n=e.rx,a=e.ry;return{x:t-n,y:i-a,width:n*2,height:a*2}}Pe("rect",qp);Pe("image",qp);Pe("circle",Up);Pe("marker",Up);Pe("polyline",Yb);Pe("polygon",$b);Pe("text",Wb);Pe("path",lS);Pe("line",uS);Pe("ellipse",cS);var Yf=0,hS=1/2,fS=1/2,vS=.05,Cs=function(){function r(e){var t=e.xField,i=e.yField,n=e.adjustNames,a=n===void 0?["x","y"]:n,o=e.dimValuesMap;this.adjustNames=a,this.xField=t,this.yField=i,this.dimValuesMap=o}return r.prototype.isAdjust=function(e){return this.adjustNames.indexOf(e)>=0},r.prototype.getAdjustRange=function(e,t,i){var n=this.yField,a=i.indexOf(t),o=i.length,s,l;return!n&&this.isAdjust("y")?(s=0,l=1):o>1?(s=i[a===0?0:a-1],l=i[a===o-1?o-1:a+1],a!==0?s+=(t-s)/2:s-=(l-t)/2,a!==o-1?l-=(l-t)/2:l+=(t-i[o-2])/2):(s=t===0?0:t-.5,l=t===0?1:t+.5),{pre:s,next:l}},r.prototype.adjustData=function(e,t){var i=this,n=this.getDimValues(t);C(e,function(a,o){C(n,function(s,l){i.adjustDim(l,s,a,o)})})},r.prototype.groupData=function(e,t){return C(e,function(i){i[t]===void 0&&(i[t]=Yf)}),me(e,t)},r.prototype.adjustDim=function(e,t,i,n){},r.prototype.getDimValues=function(e){var t=this,i=t.xField,n=t.yField,a=mt({},this.dimValuesMap),o=[];if(i&&this.isAdjust("x")&&o.push(i),n&&this.isAdjust("y")&&o.push(n),o.forEach(function(l){a&&a[l]||(a[l]=Ve(e,l).sort(function(u,c){return u-c}))}),!n&&this.isAdjust("y")){var s="y";a[s]=[Yf,1]}return a},r}(),ng={},ag=function(r){return ng[r.toLowerCase()]},Ms=function(r,e){if(ag(r))throw new Error("Adjust type '"+r+"' existed.");ng[r.toLowerCase()]=e};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var gu=function(r,e){return gu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},gu(r,e)};function As(r,e){gu(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var je=function(){return je=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=0){var d=this.getIntervalOnlyOffset(n,i);v=c+d}else if(!B(u)&&B(l)&&u>=0){var d=this.getDodgeOnlyOffset(n,i);v=c+d}else if(!B(l)&&!B(u)&&l>=0&&u>=0){var d=this.getIntervalAndDodgeOffset(n,i);v=c+d}else{var p=f*o/n,g=s*p,d=1/2*(f-n*p-(n-1)*g)+((i+1)*p+i*g)-1/2*p-1/2*f;v=(c+h)/2+d}return v},e.prototype.getIntervalOnlyOffset=function(t,i){var n=this,a=n.defaultSize,o=n.intervalPadding,s=n.xDimensionLegenth,l=n.groupNum,u=n.dodgeRatio,c=n.maxColumnWidth,h=n.minColumnWidth,f=n.columnWidthRatio,v=o/s,d=(1-(l-1)*v)/l*u/(t-1),p=((1-v*(l-1))/l-d*(t-1))/t;if(p=B(f)?p:1/l/t*f,!B(c)){var g=c/s;p=Math.min(p,g)}if(!B(h)){var y=h/s;p=Math.max(p,y)}p=a?a/s:p,d=((1-(l-1)*v)/l-t*p)/(t-1);var x=((1/2+i)*p+i*d+1/2*v)*l-v/2;return x},e.prototype.getDodgeOnlyOffset=function(t,i){var n=this,a=n.defaultSize,o=n.dodgePadding,s=n.xDimensionLegenth,l=n.groupNum,u=n.marginRatio,c=n.maxColumnWidth,h=n.minColumnWidth,f=n.columnWidthRatio,v=o/s,d=1*u/(l-1),p=((1-d*(l-1))/l-v*(t-1))/t;if(p=f?1/l/t*f:p,!B(c)){var g=c/s;p=Math.min(p,g)}if(!B(h)){var y=h/s;p=Math.max(p,y)}p=a?a/s:p,d=(1-(p*t+v*(t-1))*l)/(l-1);var x=((1/2+i)*p+i*v+1/2*d)*l-d/2;return x},e.prototype.getIntervalAndDodgeOffset=function(t,i){var n=this,a=n.intervalPadding,o=n.dodgePadding,s=n.xDimensionLegenth,l=n.groupNum,u=a/s,c=o/s,h=((1-u*(l-1))/l-c*(t-1))/t,f=((1/2+i)*h+i*c+1/2*u)*l-u/2;return f},e.prototype.getDistribution=function(t){var i=this.adjustDataArray,n=this.cacheMap,a=n[t];return a||(a={},C(i,function(o,s){var l=Ve(o,t);l.length||l.push(0),C(l,function(u){a[u]||(a[u]=[]),a[u].push(s)})}),n[t]=a),a},e}(Cs);function pS(r,e){return(e-r)*Math.random()+r}var gS=function(r){As(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var i=re(t),n=we(i);return this.adjustData(i,n),i},e.prototype.adjustDim=function(t,i,n){var a=this,o=this.groupData(n,t);return C(o,function(s,l){return a.adjustGroup(s,t,parseFloat(l),i)})},e.prototype.getAdjustOffset=function(t){var i=t.pre,n=t.next,a=(n-i)*vS;return pS(i+a,n-a)},e.prototype.adjustGroup=function(t,i,n,a){var o=this,s=this.getAdjustRange(i,n,a);return C(t,function(l){l[i]=o.getAdjustOffset(s)}),t},e}(Cs),ml=mw,yS=function(r){As(e,r);function e(t){var i=r.call(this,t)||this,n=t.adjustNames,a=n===void 0?["y"]:n,o=t.height,s=o===void 0?NaN:o,l=t.size,u=l===void 0?10:l,c=t.reverseOrder,h=c===void 0?!1:c;return i.adjustNames=a,i.height=s,i.size=u,i.reverseOrder=h,i}return e.prototype.process=function(t){var i=this,n=i.yField,a=i.reverseOrder,o=n?this.processStack(t):this.processOneDimStack(t);return a?this.reverse(o):o},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var i=this,n=i.xField,a=i.yField,o=i.reverseOrder,s=o?this.reverse(t):t,l=new ml,u=new ml;return s.map(function(c){return c.map(function(h){var f,v=A(h,n,0),d=A(h,[a]),p=v.toString();if(d=R(d)?d[1]:d,!B(d)){var g=d>=0?l:u;g.has(p)||g.set(p,0);var y=g.get(p),x=d+y;return g.set(p,x),je(je({},h),(f={},f[a]=[y,x],f))}return h})})},e.prototype.processOneDimStack=function(t){var i=this,n=this,a=n.xField,o=n.height,s=n.reverseOrder,l="y",u=s?this.reverse(t):t,c=new ml;return u.map(function(h){return h.map(function(f){var v,d=i.size,p=f[a],g=d*2/o;c.has(p)||c.set(p,g/2);var y=c.get(p);return c.set(p,y+g),je(je({},f),(v={},v[l]=y,v))})})},e}(Cs),mS=function(r){As(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var i=we(t),n=this,a=n.xField,o=n.yField,s=this.getXValuesMaxMap(i),l=Math.max.apply(Math,Object.keys(s).map(function(u){return s[u]}));return Mt(t,function(u){return Mt(u,function(c){var h,f,v=c[o],d=c[a];if(R(v)){var p=(l-s[d])/2;return je(je({},c),(h={},h[o]=Mt(v,function(y){return p+y}),h))}var g=(l-v)/2;return je(je({},c),(f={},f[o]=[g,v+g],f))})})},e.prototype.getXValuesMaxMap=function(t){var i=this,n=this,a=n.xField,o=n.yField,s=me(t,function(l){return l[a]});return dw(s,function(l){return i.getDimMaxValue(l,o)})},e.prototype.getDimMaxValue=function(t,i){var n=Mt(t,function(o){return A(o,i,[])}),a=we(n);return Math.max.apply(Math,a)},e}(Cs);Ms("Dodge",dS);Ms("Jitter",gS);Ms("Stack",yS);Ms("Symmetric",mS);var $f=function(r,e){return Q(e)?e:r.invert(r.scale(e))},ka=function(){function r(e){this.names=[],this.scales=[],this.linear=!1,this.values=[],this.callback=function(){return[]},this._parseCfg(e)}return r.prototype.mapping=function(){for(var e=this,t=[],i=0;i1?1:Number(e),i=r.length-1,n=Math.floor(i*t),a=i*t-n,o=r[n],s=n===i?o:r[n+1];return og([xl(o,s,a,0),xl(o,s,a,1),xl(o,s,a,2)])},Ka,lg=function(r){if(r[0]==="#"&&r.length===7)return r;Ka||(Ka=MS()),Ka.style.color=r;var e=document.defaultView.getComputedStyle(Ka,"").getPropertyValue("color"),t=xS.exec(e),i=t[1].split(/\s*,\s*/).map(function(n){return Number(n)});return e=og(i),e},FS=function(r){var e=Q(r)?r.split("-"):r,t=Mt(e,function(i){return sg(i.indexOf("#")===-1?lg(i):i)});return function(i){return AS(t,i)}},TS=function(r){if(CS(r)){var e,t=void 0;if(r[0]==="l"){var i=wS.exec(r),n=+i[1]+90;t=i[2],e="linear-gradient("+n+"deg, "}else if(r[0]==="r"){e="radial-gradient(";var i=bS.exec(r);t=i[4]}var a=t.match(SS);return C(a,function(o,s){var l=o.split(":");e+=l[1]+" "+l[0]*100+"%",s!==a.length-1&&(e+=", ")}),e+=")",e}return r};const zr={rgb2arr:sg,gradient:FS,toRGB:dn(lg),toCSSGradient:TS};var ES=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.type="color",i.names=["color"],Q(i.values)&&(i.linear=!0),i.gradient=zr.gradient(i.values),i}return e.prototype.getLinearValue=function(t){return this.gradient(t)},e}(ka),kS=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.type="opacity",i.names=["opacity"],i}return e}(ka),LS=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.names=["x","y"],i.type="position",i}return e.prototype.mapping=function(t,i){var n=this.scales,a=n[0],o=n[1];return B(t)||B(i)?[]:[R(t)?t.map(function(s){return a.scale(s)}):a.scale(t),R(i)?i.map(function(s){return o.scale(s)}):o.scale(i)]},e}(ka),IS=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.type="shape",i.names=["shape"],i}return e.prototype.getLinearValue=function(t){var i=Math.round((this.values.length-1)*t);return this.values[i]},e}(ka),PS=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.type="size",i.names=["size"],i}return e}(ka),ug={};function DS(r){return ug[r]}function rr(r,e){ug[r]=e}var dc=function(){function r(e){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=e,this.initCfg(),this.init()}return r.prototype.translate=function(e){return e},r.prototype.change=function(e){mt(this.__cfg__,e),this.init()},r.prototype.clone=function(){return this.constructor(this.__cfg__)},r.prototype.getTicks=function(){var e=this;return Mt(this.ticks,function(t,i){return pt(t)?t:{text:e.getText(t,i),tickValue:t,value:e.scale(t)}})},r.prototype.getText=function(e,t){var i=this.formatter,n=i?i(e,t):e;return B(n)||!X(n.toString)?"":n.toString()},r.prototype.getConfig=function(e){return this.__cfg__[e]},r.prototype.init=function(){mt(this,this.__cfg__),this.setDomain(),fe(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},r.prototype.initCfg=function(){},r.prototype.setDomain=function(){},r.prototype.calculateTicks=function(){var e=this.tickMethod,t=[];if(Q(e)){var i=DS(e);if(!i)throw new Error("There is no method to to calculate ticks!");t=i(this)}else X(e)&&(t=e(this));return t},r.prototype.rangeMin=function(){return this.range[0]},r.prototype.rangeMax=function(){return this.range[1]},r.prototype.calcPercent=function(e,t,i){return rt(e)?(e-t)/(i-t):NaN},r.prototype.calcValue=function(e,t,i){return t+e*(i-t)},r}(),Fs=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cat",t.isCategory=!0,t}return e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;tthis.max?NaN:this.values[a]},e.prototype.getText=function(t){for(var i=[],n=1;n1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(dc),cg=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Tr="\\d\\d?",Mr="\\d\\d",OS="\\d{3}",BS="\\d{4}",Wn="[^\\s]+",hg=/\[([^]*?)\]/gm;function fg(r,e){for(var t=[],i=0,n=r.length;i-1?n:null}};function $r(r){for(var e=[],t=1;t3?0:(r-r%10!==10?1:0)*r%10]}},$o=$r({},pc),pg=function(r){return $o=$r($o,r)},Xf=function(r){return r.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},ne=function(r,e){for(e===void 0&&(e=2),r=String(r);r.length0?"-":"+")+ne(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(r){var e=r.getTimezoneOffset();return(e>0?"-":"+")+ne(Math.floor(Math.abs(e)/60),2)+":"+ne(Math.abs(e)%60,2)}},Wf=function(r){return+r-1},_f=[null,Tr],qf=[null,Wn],Uf=["isPm",Wn,function(r,e){var t=r.toLowerCase();return t===e.amPm[0]?0:t===e.amPm[1]?1:null}],jf=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(r){var e=(r+"").match(/([+-]|\d\d)/gi);if(e){var t=+e[1]*60+parseInt(e[2],10);return e[0]==="+"?t:-t}return 0}],GS={D:["day",Tr],DD:["day",Mr],Do:["day",Tr+Wn,function(r){return parseInt(r,10)}],M:["month",Tr,Wf],MM:["month",Mr,Wf],YY:["year",Mr,function(r){var e=new Date,t=+(""+e.getFullYear()).substr(0,2);return+(""+(+r>68?t-1:t)+r)}],h:["hour",Tr,void 0,"isPm"],hh:["hour",Mr,void 0,"isPm"],H:["hour",Tr],HH:["hour",Mr],m:["minute",Tr],mm:["minute",Mr],s:["second",Tr],ss:["second",Mr],YYYY:["year",BS],S:["millisecond","\\d",function(r){return+r*100}],SS:["millisecond",Mr,function(r){return+r*10}],SSS:["millisecond",OS],d:_f,dd:_f,ddd:qf,dddd:qf,MMM:["month",Wn,Hf("monthNamesShort")],MMMM:["month",Wn,Hf("monthNames")],a:Uf,A:Uf,ZZ:jf,Z:jf},Ho={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},gg=function(r){return $r(Ho,r)},yg=function(r,e,t){if(e===void 0&&(e=Ho.default),t===void 0&&(t={}),typeof r=="number"&&(r=new Date(r)),Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))throw new Error("Invalid Date pass to format");e=Ho[e]||e;var i=[];e=e.replace(hg,function(a,o){return i.push(o),"@@@"});var n=$r($r({},$o),t);return e=e.replace(cg,function(a){return NS[a](r,n)}),e.replace(/@@@/g,function(){return i.shift()})};function mg(r,e,t){if(t===void 0&&(t={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=Ho[e]||e,r.length>1e3)return null;var i=new Date,n={year:i.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=e.replace(hg,function(b,S){return o.push(Xf(S)),"@@@"}),l={},u={};s=Xf(s).replace(cg,function(b){var S=GS[b],M=S[0],F=S[1],T=S[3];if(l[M])throw new Error("Invalid format. "+M+" specified twice in format");return l[M]=!0,T&&(u[T]=!0),a.push(S),"("+F+")"}),Object.keys(u).forEach(function(b){if(!l[b])throw new Error("Invalid format. "+b+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var c=r.match(new RegExp(s,"i"));if(!c)return null;for(var h=$r($r({},$o),t),f=1;f11||n.month<0||n.day>31||n.day<1||n.hour>23||n.hour<0||n.minute>59||n.minute<0||n.second>59||n.second<0)return null;return y}var xg={format:yg,parse:mg,defaultI18n:pc,setGlobalDateI18n:pg,setGlobalDateMasks:gg};const VS=Object.freeze(Object.defineProperty({__proto__:null,assign:$r,default:xg,defaultI18n:pc,format:yg,parse:mg,setGlobalDateI18n:pg,setGlobalDateMasks:gg},Symbol.toStringTag,{value:"Module"}));function YS(r){return function(e,t,i,n){for(var a=B(i)?0:i,o=B(n)?e.length:n;a>>1;r(e[s])>t?o=s:a=s+1}return a}}var Zf="format";function wg(r,e){var t=VS[Zf]||xg[Zf];return t(r,e)}function Xo(r){return Q(r)&&(r.indexOf("T")>0?r=new Date(r).getTime():r=new Date(r.replace(/-/gi,"/")).getTime()),hp(r)&&(r=r.getTime()),r}var Re=1e3,pi=60*Re,gi=60*pi,fr=24*gi,_n=fr*31,Qf=fr*365,Tn=[["HH:mm:ss",Re],["HH:mm:ss",Re*10],["HH:mm:ss",Re*30],["HH:mm",pi],["HH:mm",pi*10],["HH:mm",pi*30],["HH",gi],["HH",gi*6],["HH",gi*12],["YYYY-MM-DD",fr],["YYYY-MM-DD",fr*4],["YYYY-WW",fr*7],["YYYY-MM",_n],["YYYY-MM",_n*4],["YYYY-MM",_n*6],["YYYY",fr*380]];function $S(r,e,t){var i=(e-r)/t,n=YS(function(o){return o[1]})(Tn,i)-1,a=Tn[n];return n<0?a=Tn[0]:n>=Tn.length&&(a=zt(Tn)),a}var HS=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="timeCat",t}return e.prototype.translate=function(t){t=Xo(t);var i=this.values.indexOf(t);return i===-1&&(rt(t)&&t-1){var a=this.values[n],o=this.formatter;return a=o?o(a,i):wg(a,this.mask),a}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var t=this.values;C(t,function(i,n){t[n]=Xo(i)}),t.sort(function(i,n){return i-n}),r.prototype.setDomain.call(this)},e}(Fs),Ts=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.isContinuous=!0,t}return e.prototype.scale=function(t){if(B(t))return NaN;var i=this.rangeMin(),n=this.rangeMax(),a=this.max,o=this.min;if(a===o)return i;var s=this.getScalePercent(t);return i+s*(n-i)},e.prototype.init=function(){r.prototype.init.call(this);var t=this.ticks,i=ye(t),n=zt(t);ithis.max&&(this.max=n),B(this.minLimit)||(this.min=i),B(this.maxLimit)||(this.max=n)},e.prototype.setDomain=function(){var t=sp(this.values),i=t.min,n=t.max;B(this.min)&&(this.min=i),B(this.max)&&(this.max=n),this.min>this.max&&(this.min=i,this.max=n)},e.prototype.calculateTicks=function(){var t=this,i=r.prototype.calculateTicks.call(this);return this.nice||(i=qt(i,function(n){return n>=t.min&&n<=t.max})),i},e.prototype.getScalePercent=function(t){var i=this.max,n=this.min;return(t-n)/(i-n)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(dc),Es=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="linear",t.isLinear=!0,t}return e.prototype.invert=function(t){var i=this.getInvertPercent(t);return this.min+i*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(Ts);function Lr(r,e){var t=Math.E,i;return e>=0?i=Math.pow(t,Math.log(e)/r):i=Math.pow(t,Math.log(-e)/r)*-1,i}function Te(r,e){return r===1?1:Math.log(e)/Math.log(r)}function bg(r,e,t){B(t)&&(t=Math.max.apply(null,r));var i=t;return C(r,function(n){n>0&&n1&&(i=1),i}var XS=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="log",t}return e.prototype.invert=function(t){var i=this.base,n=Te(i,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,l=this.positiveMin;if(l){if(t===0)return 0;s=Te(i,l/i);var u=1/(n-s)*o;if(t=0?1:-1;return Math.pow(s,n)*l},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var i=this.max,n=this.min;if(i===n)return 0;var a=this.exponent,o=(Lr(a,t)-Lr(a,n))/(Lr(a,i)-Lr(a,n));return o},e}(Ts),_S=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="time",t}return e.prototype.getText=function(t,i){var n=this.translate(t),a=this.formatter;return a?a(n,i):wg(n,this.mask)},e.prototype.scale=function(t){var i=t;return(Q(i)||hp(i))&&(i=this.translate(i)),r.prototype.scale.call(this,i)},e.prototype.translate=function(t){return Xo(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,i=this.getConfig("min"),n=this.getConfig("max");if((!B(i)||!rt(i))&&(this.min=this.translate(this.min)),(!B(n)||!rt(n))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,l=0;C(t,function(u){var c=Xo(u);if(isNaN(c))throw new TypeError("Invalid Time: "+u+" in time scale!");o>c?(s=o,o=c):s>c&&(s=c),l1&&(this.minTickInterval=s-o),B(i)&&(this.min=o),B(n)&&(this.max=l)}},e}(Es),Sg=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="quantize",t}return e.prototype.invert=function(t){var i=this.ticks,n=i.length,a=this.getInvertPercent(t),o=Math.floor(a*(n-1));if(o>=n-1)return zt(i);if(o<0)return ye(i);var s=i[o],l=i[o+1],u=o/(n-1),c=(o+1)/(n-1);return s+(a-u)/(c-u)*(l-s)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var t=r.prototype.calculateTicks.call(this);return this.nice||(zt(t)!==this.max&&t.push(this.max),ye(t)!==this.min&&t.unshift(this.min)),t},e.prototype.getScalePercent=function(t){var i=this.ticks;if(tzt(i))return 1;var n=0;return C(i,function(a,o){if(t>=a)n=o;else return!1}),n/(i.length-1)},e}(Ts),qS=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="quantile",t}return e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(Sg),Cg={};function yu(r){return Cg[r]}function ir(r,e){if(yu(r))throw new Error("type '"+r+"' existed.");Cg[r]=e}var US=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&rt(t)?t:this.range[0]},e.prototype.invert=function(t){var i=this.range;return ti[1]?NaN:this.values[0]},e}(dc);function Mg(r){var e=r.values,t=r.tickInterval,i=r.tickCount,n=r.showLast;if(rt(t)){var a=qt(e,function(d,p){return p%t===0}),o=zt(e);return n&&zt(a)!==o&&a.push(o),a}var s=e.length,l=r.min,u=r.max;if(B(l)&&(l=0),B(u)&&(u=e.length-1),!rt(i)||i>=s)return e.slice(l,u+1);if(i<=0||u<=0)return[];for(var c=i===1?s:Math.floor(s/(i-1)),h=[],f=l,v=0;v=u);v++)f=Math.min(l+v*c,u),v===i-1&&n?h.push(e[u]):h.push(e[f]);return h}function jS(r){var e=r.min,t=r.max,i=r.nice,n=r.tickCount,a=new ZS;return a.domain([e,t]),i&&a.nice(n),a.ticks(n)}var bl=5,Kf=Math.sqrt(50),Jf=Math.sqrt(10),tv=Math.sqrt(2),ZS=function(){function r(){this._domain=[0,1]}return r.prototype.domain=function(e){return e?(this._domain=Array.from(e,Number),this):this._domain.slice()},r.prototype.nice=function(e){var t,i;e===void 0&&(e=bl);var n=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],l=this._domain[o],u;return l0?(s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u,u=Fo(s,l,e)):u<0&&(s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u,u=Fo(s,l,e)),u>0?(n[a]=Math.floor(s/u)*u,n[o]=Math.ceil(l/u)*u,this.domain(n)):u<0&&(n[a]=Math.ceil(s*u)/u,n[o]=Math.floor(l*u)/u,this.domain(n)),this},r.prototype.ticks=function(e){return e===void 0&&(e=bl),QS(this._domain[0],this._domain[this._domain.length-1],e||bl)},r}();function QS(r,e,t){var i,n=-1,a,o,s;if(e=+e,r=+r,t=+t,r===e&&t>0)return[r];if((i=e0)for(r=Math.ceil(r/s),e=Math.floor(e/s),o=new Array(a=Math.ceil(e-r+1));++n=0?(a>=Kf?10:a>=Jf?5:a>=tv?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=Kf?10:a>=Jf?5:a>=tv?2:1)}function ev(r,e,t){var i;return t==="ceil"?i=Math.ceil(r/e):t==="floor"?i=Math.floor(r/e):i=Math.round(r/e),i*e}function gc(r,e,t){var i=ev(r,t,"floor"),n=ev(e,t,"ceil");i=ll(i,t),n=ll(n,t);for(var a=[],o=Math.max((n-i)/(Math.pow(2,12)-1),t),s=i;s<=n;s=s+o){var l=ll(s,o);a.push(l)}return{min:i,max:n,ticks:a}}function yc(r,e,t){var i,n=r.minLimit,a=r.maxLimit,o=r.min,s=r.max,l=r.tickCount,u=l===void 0?5:l,c=B(n)?B(e)?o:e:n,h=B(a)?B(t)?s:t:a;if(c>h&&(i=[c,h],h=i[0],c=i[1]),u<=2)return[c,h];for(var f=(h-c)/(u-1),v=[],d=0;d=0&&(l=1),1-s/(o-1)-t+l}function iC(r,e,t){var i=Vt(e),n=pp(e,r),a=1;return 1-n/(i-1)-t+a}function nC(r,e,t,i,n,a){var o=(r-1)/(a-n),s=(e-1)/(Math.max(a,i)-Math.min(t,n));return 2-Math.max(o/s,s/o)}function aC(r,e){return r>=e?2-(r-1)/(e-1):1}function oC(r,e,t,i){var n=e-r;return 1-.5*(Math.pow(e-i,2)+Math.pow(r-t,2))/Math.pow(.1*n,2)}function sC(r,e,t){var i=e-r;if(t>i){var n=(t-i)/2;return 1-Math.pow(n,2)/Math.pow(.1*i,2)}return 1}function lC(){return 1}function uC(r,e,t,i,n,a){t===void 0&&(t=5),i===void 0&&(i=!0),n===void 0&&(n=JS),a===void 0&&(a=[.25,.2,.5,.05]);var o=t<0?0:Math.round(t);if(Number.isNaN(r)||Number.isNaN(e)||typeof r!="number"||typeof e!="number"||!o)return{min:0,max:0,ticks:[]};if(e-r<1e-15||o===1)return{min:r,max:e,ticks:[r]};if(e-r>1e148){var s=t||5,l=(e-r)/s;return{min:r,max:e,ticks:Array(s).fill(null).map(function(_,et){return ii(r+l*et)})}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},c=1;c<1/0;){for(var h=0;hu.score&&(!i||T<=r&&L>=e)&&(u.lmin=T,u.lmax=L,u.lstep=k,u.score=q)}y+=1}d+=1}}c+=1}var D=ii(u.lmax),N=ii(u.lmin),W=ii(u.lstep),$=Math.floor(eC((D-N)/W))+1,V=new Array($);V[0]=ii(N);for(var h=1;h<$;h++)V[h]=ii(V[h-1]+W);return{min:Math.min(r,ye(V)),max:Math.max(e,zt(V)),ticks:V}}function cC(r){var e=r.min,t=r.max,i=r.tickCount,n=r.nice,a=r.tickInterval,o=r.minLimit,s=r.maxLimit,l=uC(e,t,i,n).ticks;return!B(o)||!B(s)?yc(r,ye(l),zt(l)):a?gc(e,t,a).ticks:l}function hC(r){var e=r.base,t=r.tickCount,i=r.min,n=r.max,a=r.values,o,s=Te(e,n);if(i>0)o=Math.floor(Te(e,i));else{var l=bg(a,e,n);o=Math.floor(Te(e,l))}for(var u=s-o,c=Math.ceil(u/t),h=[],f=o;f=0?1:-1;return Math.pow(o,e)*s})}function vC(r,e){var t=r.length*e;return e===1?r[r.length-1]:e===0?r[0]:t%1!==0?r[Math.ceil(t)-1]:r.length%2===0?(r[t-1]+r[t])/2:r[t]}function dC(r){var e=r.tickCount,t=r.values;if(!t||!t.length)return[];for(var i=t.slice().sort(function(s,l){return s-l}),n=[],a=0;a1&&(n=n*Math.ceil(s)),i&&nQf)for(var l=Wo(t),u=Math.ceil(a/Qf),c=s;c<=l+u;c=c+u)o.push(mC(c));else if(a>_n)for(var h=Math.ceil(a/_n),f=mu(e),v=xC(e,t),c=0;c<=v+h;c=c+h)o.push(wC(s,c+f));else if(a>fr)for(var d=new Date(e),p=d.getFullYear(),g=d.getMonth(),y=d.getDate(),x=Math.ceil(a/fr),w=bC(e,t),c=0;cgi)for(var d=new Date(e),p=d.getFullYear(),g=d.getMonth(),x=d.getDate(),b=d.getHours(),S=Math.ceil(a/gi),M=SC(e,t),c=0;c<=M+S;c=c+S)o.push(new Date(p,g,x,b+c).getTime());else if(a>pi)for(var F=CC(e,t),T=Math.ceil(a/pi),c=0;c<=F+T;c=c+T)o.push(e+c*pi);else{var L=a;L=512&&console.warn("Notice: current ticks length("+o.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+a+") is too small, increase the value to solve the problem!"),o}rr("cat",Mg);rr("time-cat",yC);rr("wilkinson-extended",cC);rr("r-pretty",pC);rr("time",gC);rr("time-pretty",MC);rr("log",hC);rr("pow",fC);rr("quantile",dC);rr("d3-linear",KS);ir("cat",Fs);ir("category",Fs);ir("identity",US);ir("linear",Es);ir("log",XS);ir("pow",WS);ir("time",_S);ir("timeCat",HS);ir("quantize",Sg);ir("quantile",qS);var Fg={},Tg=function(r){return Fg[r.toLowerCase()]},La=function(r,e){if(Tg(r))throw new Error("Attribute type '".concat(r,"' existed."));Fg[r.toLowerCase()]=e};La("Color",ES);La("Opacity",kS);La("Position",LS);La("Shape",IS);La("Size",PS);var mc=function(){function r(e){this.type="coordinate",this.isRect=!1,this.isHelix=!1,this.isPolar=!1,this.isReflectX=!1,this.isReflectY=!1;var t=e.start,i=e.end,n=e.matrix,a=n===void 0?[1,0,0,0,1,0,0,0,1]:n,o=e.isTransposed,s=o===void 0?!1:o;this.start=t,this.end=i,this.matrix=a,this.originalMatrix=Z([],a),this.isTransposed=s}return r.prototype.initial=function(){this.center={x:(this.start.x+this.end.x)/2,y:(this.start.y+this.end.y)/2},this.width=Math.abs(this.end.x-this.start.x),this.height=Math.abs(this.end.y-this.start.y)},r.prototype.update=function(e){mt(this,e),this.initial()},r.prototype.convertDim=function(e,t){var i,n=this[t],a=n.start,o=n.end;return this.isReflect(t)&&(i=[o,a],a=i[0],o=i[1]),a+e*(o-a)},r.prototype.invertDim=function(e,t){var i,n=this[t],a=n.start,o=n.end;return this.isReflect(t)&&(i=[o,a],a=i[0],o=i[1]),(e-a)/(o-a)},r.prototype.applyMatrix=function(e,t,i){i===void 0&&(i=0);var n=this.matrix,a=[e,t,i];return Jn(a,a,n),a},r.prototype.invertMatrix=function(e,t,i){i===void 0&&(i=0);var n=this.matrix,a=i1([0,0,0,0,0,0,0,0,0],n),o=[e,t,i];return a&&Jn(o,o,a),o},r.prototype.convert=function(e){var t=this.convertPoint(e),i=t.x,n=t.y,a=this.applyMatrix(i,n,1);return{x:a[0],y:a[1]}},r.prototype.invert=function(e){var t=this.invertMatrix(e.x,e.y,1);return this.invertPoint({x:t[0],y:t[1]})},r.prototype.rotate=function(e){var t=this.matrix,i=this.center;return Gi(t,t,[-i.x,-i.y]),ac(t,t,e),Gi(t,t,[i.x,i.y]),this},r.prototype.reflect=function(e){return e==="x"?this.isReflectX=!this.isReflectX:this.isReflectY=!this.isReflectY,this},r.prototype.scale=function(e,t){var i=this.matrix,n=this.center;return Gi(i,i,[-n.x,-n.y]),Tp(i,i,[e,t]),Gi(i,i,[n.x,n.y]),this},r.prototype.translate=function(e,t){var i=this.matrix;return Gi(i,i,[e,t]),this},r.prototype.transpose=function(){return this.isTransposed=!this.isTransposed,this},r.prototype.getCenter=function(){return this.center},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRadius=function(){return this.radius},r.prototype.isReflect=function(e){return e==="x"?this.isReflectX:this.isReflectY},r.prototype.resetMatrix=function(e){this.matrix=e||Z([],this.originalMatrix)},r}(),Eg=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.isRect=!0,i.type="cartesian",i.initial(),i}return e.prototype.initial=function(){r.prototype.initial.call(this);var t=this.start,i=this.end;this.x={start:t.x,end:i.x},this.y={start:t.y,end:i.y}},e.prototype.convertPoint=function(t){var i,n=t.x,a=t.y;return this.isTransposed&&(i=[a,n],n=i[0],a=i[1]),{x:this.convertDim(n,"x"),y:this.convertDim(a,"y")}},e.prototype.invertPoint=function(t){var i,n=this.invertDim(t.x,"x"),a=this.invertDim(t.y,"y");return this.isTransposed&&(i=[a,n],n=i[0],a=i[1]),{x:n,y:a}},e}(mc),AC=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;i.isHelix=!0,i.type="helix";var n=t.startAngle,a=n===void 0?1.25*Math.PI:n,o=t.endAngle,s=o===void 0?7.25*Math.PI:o,l=t.innerRadius,u=l===void 0?0:l,c=t.radius;return i.startAngle=a,i.endAngle=s,i.innerRadius=u,i.radius=c,i.initial(),i}return e.prototype.initial=function(){r.prototype.initial.call(this);var t=(this.endAngle-this.startAngle)/(2*Math.PI)+1,i=Math.min(this.width,this.height)/2;this.radius&&this.radius>=0&&this.radius<=1&&(i=i*this.radius),this.d=Math.floor(i*(1-this.innerRadius)/t),this.a=this.d/(Math.PI*2),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*i,end:this.innerRadius*i+this.d*.99}},e.prototype.convertPoint=function(t){var i,n=t.x,a=t.y;this.isTransposed&&(i=[a,n],n=i[0],a=i[1]);var o=this.convertDim(n,"x"),s=this.a*o,l=this.convertDim(a,"y");return{x:this.center.x+Math.cos(o)*(s+l),y:this.center.y+Math.sin(o)*(s+l)}},e.prototype.invertPoint=function(t){var i,n=this.d+this.y.start,a=$x([0,0],[t.x,t.y],[this.center.x,this.center.y]),o=oc(a,[1,0],!0),s=o*this.a;$i(a)this.width/i?(s=this.width/i,this.circleCenter={x:this.center.x-(.5-a)*this.width,y:this.center.y-(.5-o)*s*n}):(s=this.height/n,this.circleCenter={x:this.center.x-(.5-a)*s*i,y:this.center.y-(.5-o)*this.height}),this.polarRadius=this.radius,this.radius?this.radius>0&&this.radius<=1?this.polarRadius=s*this.radius:(this.radius<=0||this.radius>s)&&(this.polarRadius=s):this.polarRadius=s,this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*this.polarRadius,end:this.polarRadius}},e.prototype.getRadius=function(){return this.polarRadius},e.prototype.convertPoint=function(t){var i,n=this.getCenter(),a=t.x,o=t.y;return this.isTransposed&&(i=[o,a],a=i[0],o=i[1]),a=this.convertDim(a,"x"),o=this.convertDim(o,"y"),{x:n.x+Math.cos(a)*o,y:n.y+Math.sin(a)*o}},e.prototype.invertPoint=function(t){var i,n=this.getCenter(),a=[t.x-n.x,t.y-n.y],o=this,s=o.startAngle,l=o.endAngle;this.isReflect("x")&&(i=[l,s],s=i[0],l=i[1]);var u=[1,0,0,0,1,0,0,0,1];ac(u,u,s);var c=[1,0,0];Jn(c,c,u);var h=[c[0],c[1]],f=oc(h,a,l0?d:-d;var p=this.invertDim(v,"y"),g={x:0,y:0};return g.x=this.isTransposed?p:d,g.y=this.isTransposed?d:p,g},e.prototype.getCenter=function(){return this.circleCenter},e.prototype.getOneBox=function(){var t=this.startAngle,i=this.endAngle;if(Math.abs(i-t)>=Math.PI*2)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var n=[0,Math.cos(t),Math.cos(i)],a=[0,Math.sin(t),Math.sin(i)],o=Math.min(t,i);o=0;i--)r.removeChild(e[i])}function LC(r,e){return!!r.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function la(r){var e=r.start,t=r.end,i=Math.min(e.x,t.x),n=Math.min(e.y,t.y),a=Math.max(e.x,t.x),o=Math.max(e.y,t.y);return{x:i,y:n,minX:i,minY:n,maxX:a,maxY:o,width:a-i,height:o-n}}function IC(r){var e=r.map(function(s){return s.x}),t=r.map(function(s){return s.y}),i=Math.min.apply(Math,e),n=Math.min.apply(Math,t),a=Math.max.apply(Math,e),o=Math.max.apply(Math,t);return{x:i,y:n,minX:i,minY:n,maxX:a,maxY:o,width:a-i,height:o-n}}function Ls(r,e,t,i){var n=r+t,a=e+i;return{x:r,y:e,width:t,height:i,minX:r,minY:e,maxX:isNaN(n)?0:n,maxY:isNaN(a)?0:a}}function yi(r,e,t){return(1-t)*r+e*t}function Ui(r,e,t){return{x:r.x+Math.cos(t)*e,y:r.y+Math.sin(t)*e}}function PC(r,e){var t=e.x-r.x,i=e.y-r.y;return Math.sqrt(t*t+i*i)}var qo=function(r,e,t){return t===void 0&&(t=Math.pow(Number.EPSILON,.5)),[r,e].includes(1/0)?Math.abs(r)===Math.abs(e):Math.abs(r-e)0?C(l,function(u){if(u.get("visible")){if(u.isGroup()&&u.get("children").length===0)return!0;var c=Dg(u),h=u.applyToMatrix([c.minX,c.minY,1]),f=u.applyToMatrix([c.minX,c.maxY,1]),v=u.applyToMatrix([c.maxX,c.minY,1]),d=u.applyToMatrix([c.maxX,c.maxY,1]),p=Math.min(h[0],f[0],v[0],d[0]),g=Math.max(h[0],f[0],v[0],d[0]),y=Math.min(h[1],f[1],v[1],d[1]),x=Math.max(h[1],f[1],v[1],d[1]);pa&&(a=g),ys&&(s=x)}}):(n=0,a=0,o=0,s=0),i=Ls(n,o,a-n,s-o)}return t?DC(i,t):i}function OC(r,e){if(!(!r.getClip()&&!e.getClip())){var t=e.getClip();if(!t){r.setClip(null);return}var i={type:t.get("type"),attrs:t.attr()};r.setClip(i)}}function se(r){return r+"px"}function Og(r,e,t,i){var n=PC(r,e),a=i/n,o=0;return t==="start"?o=0-a:t==="end"&&(o=1+a),{x:yi(r.x,e.x,o),y:yi(r.y,e.y,o)}}var BC={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},Bg=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.initCfg(),i}return e.prototype.getDefaultCfg=function(){return{id:"",name:"",type:"",locationType:"none",offsetX:0,offsetY:0,animate:!1,capture:!0,updateAutoRender:!1,animateOption:{appear:null,update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},events:null,defaultCfg:{},visible:!0}},e.prototype.clear=function(){},e.prototype.update=function(t){var i=this,n=this.get("defaultCfg")||{};C(t,function(a,o){var s=i.get(o),l=a;s!==a&&(pt(a)&&n[o]&&(l=H({},n[o],a)),i.set(o,l))}),this.updateInner(t),this.afterUpdate(t)},e.prototype.updateInner=function(t){},e.prototype.afterUpdate=function(t){Vr(t,"visible")&&(t.visible?this.show():this.hide()),Vr(t,"capture")&&this.setCapture(t.capture)},e.prototype.getLayoutBBox=function(){return this.getBBox()},e.prototype.getLocationType=function(){return this.get("locationType")},e.prototype.getOffset=function(){return{offsetX:this.get("offsetX"),offsetY:this.get("offsetY")}},e.prototype.setOffset=function(t,i){this.update({offsetX:t,offsetY:i})},e.prototype.setLocation=function(t){var i=m({},t);this.update(i)},e.prototype.getLocation=function(){var t=this,i={},n=this.get("locationType"),a=BC[n];return C(a,function(o){i[o]=t.get(o)}),i},e.prototype.isList=function(){return!1},e.prototype.isSlider=function(){return!1},e.prototype.init=function(){},e.prototype.initCfg=function(){var t=this,i=this.get("defaultCfg");C(i,function(n,a){var o=t.get(a);if(pt(o)){var s=H({},n,o);t.set(a,s)}})},e}(hs),ei="update_status",RC=["visible","tip","delegateObject"],zC=["container","group","shapesMap","isRegister","isUpdating","destroyed"],Qt=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},e.prototype.remove=function(){this.clear();var t=this.get("group");t.remove()},e.prototype.clear=function(){var t=this.get("group");t.clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},e.prototype.getChildComponentById=function(t){var i=this.getElementById(t),n=i&&i.get("component");return n},e.prototype.getElementById=function(t){return this.get("shapesMap")[t]},e.prototype.getElementByLocalId=function(t){var i=this.getElementId(t);return this.getElementById(i)},e.prototype.getElementsByName=function(t){var i=[];return C(this.get("shapesMap"),function(n){n.get("name")===t&&i.push(n)}),i},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},e.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var i=this.get("group");this.updateElements(t,i),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},e.prototype.show=function(){var t=this.get("group");t.show(),this.set("visible",!0)},e.prototype.hide=function(){var t=this.get("group");t.hide(),this.set("visible",!1)},e.prototype.setCapture=function(t){var i=this.get("group");i.set("capture",t),this.set("capture",t)},e.prototype.destroy=function(){this.removeEvent(),this.remove(),r.prototype.destroy.call(this)},e.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},e.prototype.getLayoutBBox=function(){var t=this.get("group"),i=this.getInnerLayoutBBox(),n=t.getTotalMatrix();return n&&(i=kC(n,i)),i},e.prototype.on=function(t,i,n){var a=this.get("group");return a.on(t,i,n),this},e.prototype.off=function(t,i){var n=this.get("group");return n&&n.off(t,i),this},e.prototype.emit=function(t,i){var n=this.get("group");n.emit(t,i)},e.prototype.init=function(){r.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},e.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},e.prototype.delegateEmit=function(t,i){var n=this.get("group");i.target=n,n.emit(t,i),Lg(n,t,i)},e.prototype.createOffScreenGroup=function(){var t=this.get("group"),i=t.getGroupBase(),n=new i({delegateObject:this.getDelegateObject()});return n},e.prototype.applyOffset=function(){var t=this.get("offsetX"),i=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:i})},e.prototype.initGroup=function(){var t=this.get("container");this.set("group",t.addGroup({id:this.get("id"),name:this.get("name"),capture:this.get("capture"),visible:this.get("visible"),isComponent:!0,component:this,delegateObject:this.getDelegateObject()}))},e.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",Dg(t)),t},e.prototype.addGroup=function(t,i){this.appendDelegateObject(t,i);var n=t.addGroup(i);return this.get("isRegister")&&this.registerElement(n),n},e.prototype.addShape=function(t,i){this.appendDelegateObject(t,i);var n=t.addShape(i);return this.get("isRegister")&&this.registerElement(n),n},e.prototype.addComponent=function(t,i){var n=i.id,a=i.component,o=yt(i,["id","component"]),s=new a(m(m({},o),{id:n,container:t,updateAutoRender:this.get("updateAutoRender")}));return s.init(),s.render(),this.get("isRegister")&&this.registerElement(s.get("group")),s},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){var t=this.get("group");t.off()},e.prototype.getElementId=function(t){var i=this.get("id"),n=this.get("name");return i+"-"+n+"-"+t},e.prototype.registerElement=function(t){var i=t.get("id");this.get("shapesMap")[i]=t},e.prototype.unregisterElement=function(t){var i=t.get("id");delete this.get("shapesMap")[i]},e.prototype.moveElementTo=function(t,i){var n=xc(i);t.attr("matrix",n)},e.prototype.addAnimation=function(t,i,n){var a=i.attr("opacity");B(a)&&(a=1),i.attr("opacity",0),i.animate({opacity:a},n)},e.prototype.removeAnimation=function(t,i,n){i.animate({opacity:0},n)},e.prototype.updateAnimation=function(t,i,n,a){i.animate(n,a)},e.prototype.updateElements=function(t,i){var n=this,a=this.get("animate"),o=this.get("animateOption"),s=t.getChildren().slice(0),l;C(s,function(u){var c=u.get("id"),h=n.getElementById(c),f=u.get("name");if(h)if(u.get("isComponent")){var v=u.get("component"),d=h.get("component"),p=tc(v.cfg,_x(fn(v.cfg),zC));d.update(p),h.set(ei,"update")}else{var g=n.getReplaceAttrs(h,u);a&&o.update?n.updateAnimation(f,h,g,o.update):h.attr(g),u.isGroup()&&n.updateElements(u,h),C(RC,function(b){h.set(b,u.get(b))}),OC(h,u),l=h,h.set(ei,"update")}else{i.add(u);var y=i.getChildren();if(y.splice(y.length-1,1),l){var x=y.indexOf(l);y.splice(x+1,0,u)}else y.unshift(u);if(n.registerElement(u),u.set(ei,"add"),u.get("isComponent")){var v=u.get("component");v.set("container",i)}else u.isGroup()&&n.registerNewGroup(u);if(l=u,a){var w=n.get("isInit")?o.appear:o.enter;w&&n.addAnimation(f,u,w)}}})},e.prototype.clearUpdateStatus=function(t){var i=t.getChildren();C(i,function(n){n.set(ei,null)})},e.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},e.prototype.getDelegateObject=function(){var t,i=this.get("name"),n=(t={},t[i]=this,t.component=this,t);return n},e.prototype.appendDelegateObject=function(t,i){var n=t.get("delegateObject");i.delegateObject||(i.delegateObject={}),mt(i.delegateObject,n)},e.prototype.getReplaceAttrs=function(t,i){var n=t.attr(),a=i.attr();return C(n,function(o,s){a[s]===void 0&&(a[s]=void 0)}),a},e.prototype.registerNewGroup=function(t){var i=this,n=t.getChildren();C(n,function(a){i.registerElement(a),a.set(ei,"add"),a.isGroup()&&i.registerNewGroup(a)})},e.prototype.deleteElements=function(){var t=this,i=this.get("shapesMap"),n=[];C(i,function(s,l){!s.get(ei)||s.destroyed?n.push([l,s]):s.set(ei,null)});var a=this.get("animate"),o=this.get("animateOption");C(n,function(s){var l=s[0],u=s[1];if(!u.destroyed){var c=u.get("name");if(a&&o.leave){var h=mt({callback:function(){t.removeElement(u)}},o.leave);t.removeAnimation(c,u,h)}else t.removeElement(u)}delete i[l]})},e.prototype.removeElement=function(t){if(t.get("isGroup")){var i=t.get("component");i&&i.destroy()}t.remove()},e}(Bg),Sl="…";function NC(r){for(var e=0,t=0;t0&&r.charCodeAt(e)<128?1:2}function GC(r,e,t){t===void 0&&(t="tail");var i=r.length,n="";if(t==="tail"){for(var a=0,o=0;a=19968&&s<=40869?a+=2:a+=1}a>t&&(t=a,i=n)}return r[i].getBBox().width}function xu(r){if(r.length>$C)return HC(r);var e=0;return C(r,function(t){var i=t.getBBox(),n=i.width;e=0?f=GC(a,h,i):f=VC,f&&(e.attr("text",f),c=!0)}return c?e.set("tip",a):e.set("tip",null),c}function Is(r,e){var t=e.x,i=e.y,n=e.content,a=e.style,o=e.id,s=e.name,l=e.rotate,u=e.maxLength,c=e.autoEllipsis,h=e.isVertical,f=e.ellipsisPosition,v=e.background,d=r.addGroup({id:o+"-group",name:s+"-group",attrs:{x:t,y:i}}),p=d.addShape({type:"text",id:o,name:s,attrs:m({x:0,y:0,text:n},a)}),g=_o(A(v,"padding",0));if(u&&c){var y=u-(g[1]+g[3]);qn(!h,p,y,f)}if(v){var x=A(v,"style",{}),w=p.getCanvasBBox(),b=w.minX,S=w.minY,M=w.width,F=w.height,T=d.addShape("rect",{id:o+"-bg",name:o+"-bg",attrs:m({x:b-g[3],y:S-g[0],width:M+g[1]+g[3],height:F+g[0]+g[2]},x)});T.toBack()}wc(d,t,i),Pg(d,l,t,i)}const lt={fontFamily:` BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimSun, "sans-serif"`,textColor:"#2C3542",uncheckedColor:"#D8D8D8",lineColor:"#416180",regionColor:"#CCD7EB",verticalAxisRotate:-Math.PI/4,horizontalAxisRotate:Math.PI/4,descriptionIconStroke:"#fff",descriptionIconFill:"rgba(58, 73, 101, .25)"};var WC=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"line",locationType:"region",start:null,end:null,style:{},text:null,defaultCfg:{style:{fill:lt.textColor,fontSize:12,textAlign:"center",textBaseline:"bottom",fontFamily:lt.fontFamily},text:{position:"center",autoRotate:!0,content:null,offsetX:0,offsetY:0,style:{stroke:lt.lineColor,lineWidth:1}}}})},e.prototype.renderInner=function(t){this.renderLine(t),this.get("text")&&this.renderLabel(t)},e.prototype.renderLine=function(t){var i=this.get("start"),n=this.get("end"),a=this.get("style");this.addShape(t,{type:"line",id:this.getElementId("line"),name:"annotation-line",attrs:m({x1:i.x,y1:i.y,x2:n.x,y2:n.y},a)})},e.prototype.getLabelPoint=function(t,i,n){var a;return n==="start"?a=0:n==="center"?a=.5:Q(n)&&n.indexOf("%")!==-1?a=parseInt(n,10)/100:rt(n)?a=n:a=1,(a>1||a<0)&&(a=1),{x:yi(t.x,i.x,a),y:yi(t.y,i.y,a)}},e.prototype.renderLabel=function(t){var i=this.get("text"),n=this.get("start"),a=this.get("end"),o=i.position,s=i.content,l=i.style,u=i.offsetX,c=i.offsetY,h=i.autoRotate,f=i.maxLength,v=i.autoEllipsis,d=i.ellipsisPosition,p=i.background,g=i.isVertical,y=g===void 0?!1:g,x=this.getLabelPoint(n,a,o),w=x.x+u,b=x.y+c,S={id:this.getElementId("line-text"),name:"annotation-line-text",x:w,y:b,content:s,style:l,maxLength:f,autoEllipsis:v,ellipsisPosition:d,background:p,isVertical:y};if(h){var M=[a.x-n.x,a.y-n.y];S.rotate=Math.atan2(M[1],M[0])}Is(t,S)},e}(Qt),_C=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"text",locationType:"point",x:0,y:0,content:"",rotate:null,style:{},background:null,maxLength:null,autoEllipsis:!0,isVertical:!1,ellipsisPosition:"tail",defaultCfg:{style:{fill:lt.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:lt.fontFamily}}})},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.renderInner=function(t){var i=this.getLocation(),n=i.x,a=i.y,o=this.get("content"),s=this.get("style"),l=this.getElementId("text"),u=this.get("name")+"-text",c=this.get("maxLength"),h=this.get("autoEllipsis"),f=this.get("isVertical"),v=this.get("ellipsisPosition"),d=this.get("background"),p=this.get("rotate"),g={id:l,name:u,x:n,y:a,content:o,style:s,maxLength:c,autoEllipsis:h,isVertical:f,ellipsisPosition:v,background:d,rotate:p};Is(t,g)},e.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var i=this.getLocation(),n=i.x,a=i.y,o=this.get("rotate");wc(t,n,a),Pg(t,o,n,a)}},e}(Qt),qC=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"arc",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2,style:{stroke:"#999",lineWidth:1}})},e.prototype.renderInner=function(t){this.renderArc(t)},e.prototype.getArcPath=function(){var t=this.getLocation(),i=t.center,n=t.radius,a=t.startAngle,o=t.endAngle,s=Ui(i,n,a),l=Ui(i,n,o),u=o-a>Math.PI?1:0,c=[["M",s.x,s.y]];if(o-a===Math.PI*2){var h=Ui(i,n,a+Math.PI);c.push(["A",n,n,0,u,1,h.x,h.y]),c.push(["A",n,n,0,u,1,l.x,l.y])}else c.push(["A",n,n,0,u,1,l.x,l.y]);return c},e.prototype.renderArc=function(t){var i=this.getArcPath(),n=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:m({path:i},n)})},e}(Qt),UC=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:lt.regionColor,opacity:.4}}})},e.prototype.renderInner=function(t){this.renderRegion(t)},e.prototype.renderRegion=function(t){var i=this.get("start"),n=this.get("end"),a=this.get("style"),o=la({start:i,end:n});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:m({x:o.x,y:o.y,width:o.width,height:o.height},a)})},e}(Qt),jC=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},e.prototype.renderInner=function(t){this.renderImage(t)},e.prototype.getImageAttrs=function(){var t=this.get("start"),i=this.get("end"),n=this.get("style"),a=la({start:t,end:i}),o=this.get("src");return m({x:a.x,y:a.y,img:o,width:a.width,height:a.height},n)},e.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},e}(Qt),ZC=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"dataMarker",locationType:"point",x:0,y:0,point:{},line:{},text:{},direction:"upward",autoAdjust:!0,coordinateBBox:null,defaultCfg:{point:{display:!0,style:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2}},line:{display:!0,length:20,style:{stroke:lt.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:lt.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:lt.fontFamily}}}})},e.prototype.renderInner=function(t){A(this.get("line"),"display")&&this.renderLine(t),A(this.get("text"),"display")&&this.renderText(t),A(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},e.prototype.renderPoint=function(t){var i=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:i})},e.prototype.renderLine=function(t){var i=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:i})},e.prototype.renderText=function(t){var i=this.getShapeAttrs().text,n=i.x,a=i.y,o=i.text,s=yt(i,["x","y","text"]),l=this.get("text"),u=l.background,c=l.maxLength,h=l.autoEllipsis;l.isVertival;var f=l.ellipsisPosition,v={x:n,y:a,id:this.getElementId("text"),name:"annotation-text",content:o,style:s,background:u,maxLength:c,autoEllipsis:h,ellipsisPosition:f};Is(t,v)},e.prototype.autoAdjust=function(t){var i=this.get("direction"),n=this.get("x"),a=this.get("y"),o=A(this.get("line"),"length",0),s=this.get("coordinateBBox"),l=t.getBBox(),u=l.minX,c=l.maxX,h=l.minY,f=l.maxY,v=t.findById(this.getElementId("text-group")),d=t.findById(this.getElementId("text")),p=t.findById(this.getElementId("line"));if(s&&v){var g=v.attr("x"),y=v.attr("y"),x=d.getCanvasBBox(),w=x.width,b=x.height,S=0,M=0;if(n+u<=s.minX)if(i==="leftward")S=1;else{var F=s.minX-(n+u);g=v.attr("x")+F}else if(n+c>=s.maxX)if(i==="rightward")S=-1;else{var F=n+c-s.maxX;g=v.attr("x")-F}if(S&&(p&&p.attr("path",[["M",0,0],["L",o*S,0]]),g=(o+2+w)*S),a+h<=s.minY)if(i==="upward")M=1;else{var F=s.minY-(a+h);y=v.attr("y")+F}else if(a+f>=s.maxY)if(i==="downward")M=-1;else{var F=a+f-s.maxY;y=v.attr("y")-F}M&&(p&&p.attr("path",[["M",0,0],["L",0,o*M]]),y=(o+2+b)*M),(g!==v.attr("x")||y!==v.attr("y"))&&wc(v,g,y)}},e.prototype.getShapeAttrs=function(){var t=A(this.get("line"),"display"),i=A(this.get("point"),"style",{}),n=A(this.get("line"),"style",{}),a=A(this.get("text"),"style",{}),o=this.get("direction"),s=t?A(this.get("line"),"length",0):0,l=0,u=0,c="top",h="start";switch(o){case"upward":u=-1,c="bottom";break;case"downward":u=1,c="top";break;case"leftward":l=-1,h="end";break;case"rightward":l=1,h="start";break}return{point:m({x:0,y:0},i),line:m({path:[["M",0,0],["L",s*l,s*u]]},n),text:m({x:(s+2)*l,y:(s+2)*u,text:A(this.get("text"),"content",""),textBaseline:c,textAlign:h},a)}},e}(Qt),QC=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:lt.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:lt.textColor,fontFamily:lt.fontFamily}}}})},e.prototype.renderInner=function(t){var i=A(this.get("region"),"style",{});A(this.get("text"),"style",{});var n=this.get("lineLength")||0,a=this.get("points");if(a.length){var o=IC(a),s=[];s.push(["M",a[0].x,o.minY-n]),a.forEach(function(u){s.push(["L",u.x,u.y])}),s.push(["L",a[a.length-1].x,a[a.length-1].y-n]),this.addShape(t,{type:"path",id:this.getElementId("region"),name:"annotation-region",attrs:m({path:s},i)});var l=m({id:this.getElementId("text"),name:"annotation-text",x:(o.minX+o.maxX)/2,y:o.minY-n},this.get("text"));Is(t,l)}},e}(Qt),KC=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},e.prototype.renderInner=function(t){var i=this,n=this.get("start"),a=this.get("end"),o=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});C(this.get("shapes"),function(l,u){var c=l.get("type"),h=re(l.attr());i.adjustShapeAttrs(h),i.addShape(o,{id:i.getElementId("shape-"+c+"-"+u),capture:!1,type:c,attrs:h})});var s=la({start:n,end:a});o.setClip({type:"rect",attrs:{x:s.minX,y:s.minY,width:s.width,height:s.height}})},e.prototype.adjustShapeAttrs=function(t){var i=this.get("color");t.fill&&(t.fill=t.fillStyle=i),t.stroke=t.strokeStyle=i},e}(Qt),JC=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"shape",draw:Pr})},e.prototype.renderInner=function(t){var i=this.get("render");X(i)&&i(t)},e}(Qt),Sc=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{container:null,containerTpl:"
",updateAutoRender:!0,containerClassName:"",parent:null})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.show=function(){var t=this.get("container");t.style.display="",this.set("visible",!0)},e.prototype.hide=function(){var t=this.get("container");t.style.display="none",this.set("visible",!1)},e.prototype.setCapture=function(t){var i=this.getContainer(),n=t?"auto":"none";i.style.pointerEvents=n,this.set("capture",t)},e.prototype.getBBox=function(){var t=this.getContainer(),i=parseFloat(t.style.left)||0,n=parseFloat(t.style.top)||0;return Ls(i,n,t.clientWidth,t.clientHeight)},e.prototype.clear=function(){var t=this.get("container");bc(t)},e.prototype.destroy=function(){this.removeEvent(),this.removeDom(),r.prototype.destroy.call(this)},e.prototype.init=function(){r.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},e.prototype.initCapture=function(){this.setCapture(this.get("capture"))},e.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},e.prototype.initDom=function(){},e.prototype.initContainer=function(){var t=this.get("container");if(B(t)){t=this.createDom();var i=this.get("parent");Q(i)&&(i=document.getElementById(i),this.set("parent",i)),i.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else Q(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},e.prototype.resetStyles=function(){var t=this.get("domStyles"),i=this.get("defaultStyles");t?t=H({},i,t):t=i,this.set("domStyles",t)},e.prototype.applyStyles=function(){var t=this.get("domStyles");if(t){var i=this.getContainer();this.applyChildrenStyles(i,t);var n=this.get("containerClassName");if(n&&LC(i,n)){var a=t[n];Kt(i,a)}}},e.prototype.applyChildrenStyles=function(t,i){C(i,function(n,a){var o=t.getElementsByClassName(a);C(o,function(s){Kt(s,n)})})},e.prototype.applyStyle=function(t,i){var n=this.get("domStyles");Kt(i,n[t])},e.prototype.createDom=function(){var t=this.get("containerTpl");return Rr(t)},e.prototype.initEvent=function(){},e.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},e.prototype.removeEvent=function(){},e.prototype.updateInner=function(t){Vr(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},e.prototype.resetPosition=function(){},e}(Bg),tM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'
',alignX:"left",alignY:"top",html:"",zIndex:7})},e.prototype.render=function(){var t=this.getContainer(),i=this.get("html");bc(t);var n=X(i)?i(t):i;if(fp(n))t.appendChild(n);else if(Q(n)||rt(n)){var a=Rr(""+n);a&&t.appendChild(a)}this.resetPosition()},e.prototype.resetPosition=function(){var t=this.getContainer(),i=this.getLocation(),n=i.x,a=i.y,o=this.get("alignX"),s=this.get("alignY"),l=this.get("offsetX"),u=this.get("offsetY"),c=Mw(t),h=Sw(t),f={x:n,y:a};o==="middle"?f.x-=Math.round(c/2):o==="right"&&(f.x-=Math.round(c)),s==="middle"?f.y-=Math.round(h/2):s==="bottom"&&(f.y-=Math.round(h)),l&&(f.x+=l),u&&(f.y+=u),Kt(t,{position:"absolute",left:f.x+"px",top:f.y+"px",zIndex:this.get("zIndex")})},e}(Sc);const eM=Object.freeze(Object.defineProperty({__proto__:null,Arc:qC,DataMarker:ZC,DataRegion:QC,Html:tM,Image:jC,Line:WC,Region:UC,RegionFilter:KC,Shape:JC,Text:_C},Symbol.toStringTag,{value:"Module"}));function zn(r,e,t){var i=e+"Style",n=null;return C(t,function(a,o){r[o]&&a[i]&&(n||(n={}),mt(n,a[i]))}),n}var Rg=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"axis",ticks:[],line:{},tickLine:{},subTickLine:null,title:null,label:{},verticalFactor:1,verticalLimitLength:null,overlapOrder:["autoRotate","autoEllipsis","autoHide"],tickStates:{},optimize:{},defaultCfg:{line:{style:{lineWidth:1,stroke:lt.lineColor}},tickLine:{style:{lineWidth:1,stroke:lt.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:lt.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:lt.textColor,fontFamily:lt.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:lt.textColor,textBaseline:"middle",fontFamily:lt.fontFamily,textAlign:"center"},iconStyle:{fill:lt.descriptionIconFill,stroke:lt.descriptionIconStroke},description:""},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:lt.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},e.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("ticks")},e.prototype.setItems=function(t){this.update({ticks:t})},e.prototype.updateItem=function(t,i){mt(t,i),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},e.prototype.setItemState=function(t,i,n){t[i]=n,this.updateTickStates(t)},e.prototype.hasState=function(t,i){return!!t[i]},e.prototype.getItemStates=function(t){var i=this.get("tickStates"),n=[];return C(i,function(a,o){t[o]&&n.push(o)}),n},e.prototype.clearItemsState=function(t){var i=this,n=this.getItemsByState(t);C(n,function(a){i.setItemState(a,t,!1)})},e.prototype.getItemsByState=function(t){var i=this,n=this.getItems();return qt(n,function(a){return i.hasState(a,t)})},e.prototype.getSidePoint=function(t,i){var n=this,a=n.getSideVector(i,t);return{x:t.x+a[0],y:t.y+a[1]}},e.prototype.getTextAnchor=function(t){var i;return Xt(t[0],0)?i="center":t[0]>0?i="start":t[0]<0&&(i="end"),i},e.prototype.getTextBaseline=function(t){var i;return Xt(t[1],0)?i="middle":t[1]>0?i="top":t[1]<0&&(i="bottom"),i},e.prototype.processOverlap=function(t){},e.prototype.drawLine=function(t){var i=this.getLinePath(),n=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:mt({path:i},n.style)})},e.prototype.getTickLineItems=function(t){var i=this,n=[],a=this.get("tickLine"),o=a.alignTick,s=a.length,l=1,u=t.length;return u>=2&&(l=t[1].value-t[0].value),C(t,function(c){var h=c.point;o||(h=i.getTickPoint(c.value-l/2));var f=i.getSidePoint(h,s);n.push({startPoint:h,tickValue:c.value,endPoint:f,tickId:c.id,id:"tickline-"+c.id})}),n},e.prototype.getSubTickLineItems=function(t){var i=[],n=this.get("subTickLine"),a=n.count,o=t.length;if(o>=2)for(var s=0;s0){var n=Vt(i);if(n>t.threshold){var a=Math.ceil(n/t.threshold),o=i.filter(function(s,l){return l%a===0});this.set("ticks",o),this.set("originalTicks",i)}}},e.prototype.getLabelAttrs=function(t,i,n){var a=this.get("label"),o=a.offset,s=a.offsetX,l=a.offsetY,u=a.rotate,c=a.formatter,h=this.getSidePoint(t.point,o),f=this.getSideVector(o,h),v=c?c(t.name,t,i):t.name,d=a.style;d=X(d)?A(this.get("theme"),["label","style"],{}):d;var p=mt({x:h.x+s,y:h.y+l,text:v,textAlign:this.getTextAnchor(f),textBaseline:this.getTextBaseline(f)},d);return u&&(p.matrix=Ci(h,u)),p},e.prototype.drawLabels=function(t){var i=this,n=this.get("ticks"),a=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});C(n,function(f,v){i.addShape(a,{type:"text",name:"axis-label",id:i.getElementId("label-"+f.id),attrs:i.getLabelAttrs(f,v,n),delegateObject:{tick:f,item:f,index:v}})}),this.processOverlap(a);var o=a.getChildren(),s=A(this.get("theme"),["label","style"],{}),l=this.get("label"),u=l.style,c=l.formatter;if(X(u)){var h=o.map(function(f){return A(f.get("delegateObject"),"tick")});C(o,function(f,v){var d=f.get("delegateObject").tick,p=c?c(d.name,d,v):d.name,g=mt({},s,u(p,v,h));f.attr(g)})}},e.prototype.getTitleAttrs=function(){var t=this.get("title"),i=t.style,n=t.position,a=t.offset,o=t.spacing,s=o===void 0?0:o,l=t.autoRotate,u=i.fontSize,c=.5;n==="start"?c=0:n==="end"&&(c=1);var h=this.getTickPoint(c),f=this.getSidePoint(h,a||s+u/2),v=mt({x:f.x,y:f.y,text:t.text},i),d=t.rotate,p=d;if(B(d)&&l){var g=this.getAxisVector(h),y=[1,0];p=oc(g,y,!0)}if(p){var x=Ci(f,p);v.matrix=x}return v},e.prototype.drawTitle=function(t){var i,n=this.getTitleAttrs(),a=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:n});!((i=this.get("title"))===null||i===void 0)&&i.description&&this.drawDescriptionIcon(t,a,n.matrix)},e.prototype.drawDescriptionIcon=function(t,i,n){var a=this.addGroup(t,{name:"axis-description",id:this.getElementById("description")}),o=i.getBBox(),s=o.maxX,l=o.maxY,u=o.height,c=this.get("title").iconStyle,h=4,f=u/2,v=f/6,d=s+h,p=l-u/2,g=[d+f,p-f],y=g[0],x=g[1],w=[y+f,x+f],b=w[0],S=w[1],M=[y,S+f],F=M[0],T=M[1],L=[d,x+f],k=L[0],I=L[1],O=[d+f,p-u/4],z=O[0],Y=O[1],q=[z,Y+v],D=q[0],N=q[1],W=[D,N+v],$=W[0],V=W[1],_=[$,V+f*3/4],et=_[0],at=_[1];this.addShape(a,{type:"path",id:this.getElementId("title-description-icon"),name:"axis-title-description-icon",attrs:m({path:[["M",y,x],["A",f,f,0,0,1,b,S],["A",f,f,0,0,1,F,T],["A",f,f,0,0,1,k,I],["A",f,f,0,0,1,y,x],["M",z,Y],["L",D,N],["M",$,V],["L",et,at]],lineWidth:v,matrix:n},c)}),this.addShape(a,{type:"rect",id:this.getElementId("title-description-rect"),name:"axis-title-description-rect",attrs:{x:d,y:p-u/2,width:u,height:u,stroke:"#000",fill:"#000",opacity:0,matrix:n,cursor:"pointer"}})},e.prototype.applyTickStates=function(t,i){var n=this.getItemStates(t);if(n.length){var a=this.get("tickStates"),o=this.getElementId("label-"+t.id),s=i.findById(o);if(s){var l=zn(t,"label",a);l&&s.attr(l)}var u=this.getElementId("tickline-"+t.id),c=i.findById(u);if(c){var h=zn(t,"tickLine",a);h&&c.attr(h)}}},e.prototype.updateTickStates=function(t){var i=this.getItemStates(t),n=this.get("tickStates"),a=this.get("label"),o=this.getElementByLocalId("label-"+t.id),s=this.get("tickLine"),l=this.getElementByLocalId("tickline-"+t.id);if(i.length){if(o){var u=zn(t,"label",n);u&&o.attr(u)}if(l){var c=zn(t,"tickLine",n);c&&l.attr(c)}}else o&&o.attr(a.style),l&&l.attr(s.style)},e}(Qt);function Cc(r,e,t,i){var n=e.getChildren(),a=!1;return C(n,function(o){var s=qn(r,o,t,i);a=a||s}),a}function rM(){return zg}function iM(r,e,t){return Cc(r,e,t,"head")}function zg(r,e,t){return Cc(r,e,t,"tail")}function nM(r,e,t){return Cc(r,e,t,"middle")}const aM=Object.freeze(Object.defineProperty({__proto__:null,ellipsisHead:iM,ellipsisMiddle:nM,ellipsisTail:zg,getDefault:rM},Symbol.toStringTag,{value:"Module"}));function oM(r){var e=r.attr("matrix");return e&&e[0]!==1}function Ng(r){var e=oM(r)?EC(r.attr("matrix")):0;return e%360}function wu(r,e,t,i){var n=!1,a=Ng(e),o=Math.abs(r?t.attr("y")-e.attr("y"):t.attr("x")-e.attr("x")),s=(r?t.attr("y")>e.attr("y"):t.attr("x")>e.attr("x"))?e.getBBox():t.getBBox();if(r){var l=Math.abs(Math.cos(a));qo(l,0,Math.PI/180)?n=s.width+i>o:n=s.height/l+i>o}else{var l=Math.abs(Math.sin(a));qo(l,0,Math.PI/180)?n=s.width+i>o:n=s.height/l+i>o}return n}function ua(r,e,t,i){var n=(i==null?void 0:i.minGap)||0,a=e.getChildren().slice().filter(function(v){return v.get("visible")});if(!a.length)return!1;var o=!1;t&&a.reverse();for(var s=a.length,l=a[0],u=l,c=1;c1){f=Math.ceil(f);for(var p=0;p2){var o=n[0],s=n[n.length-1];o.get("visible")||(o.show(),ua(r,e,!1,i)&&(a=!0)),s.get("visible")||(s.show(),ua(r,e,!0,i)&&(a=!0))}return a}const fM=Object.freeze(Object.defineProperty({__proto__:null,equidistance:Vg,equidistanceWithReverseBoth:hM,getDefault:sM,reserveBoth:cM,reserveFirst:lM,reserveLast:uM},Symbol.toStringTag,{value:"Module"}));function vM(r,e){C(r,function(t){var i=t.attr("x"),n=t.attr("y"),a=Ci({x:i,y:n},e);t.attr("matrix",a)})}function Yg(r,e,t,i){var n=e.getChildren();if(!n.length||!r&&n.length<2)return!1;var a=xu(n),o=!1;if(r)o=!!t&&a>t;else{var s=Math.abs(n[1].attr("x")-n[0].attr("x"));o=a>s}if(o){var l=i(t,a);vM(n,l)}return o}function dM(){return $g}function $g(r,e,t,i){return Yg(r,e,t,function(){return rt(i)?i:r?lt.verticalAxisRotate:lt.horizontalAxisRotate})}function pM(r,e,t){return Yg(r,e,t,function(i,n){if(!i)return r?lt.verticalAxisRotate:lt.horizontalAxisRotate;if(r)return-Math.acos(i/n);var a=0;return i>n?a=Math.PI/4:(a=Math.asin(i/n),a>Math.PI/4&&(a=Math.PI/4)),a})}const gM=Object.freeze(Object.defineProperty({__proto__:null,fixedAngle:$g,getDefault:dM,unfixedAngle:pM},Symbol.toStringTag,{value:"Module"})),Hg=Object.freeze(Object.defineProperty({__proto__:null,autoEllipsis:aM,autoHide:fM,autoRotate:gM},Symbol.toStringTag,{value:"Module"}));var yM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getLinePath=function(){var t=this.get("start"),i=this.get("end"),n=[];return n.push(["M",t.x,t.y]),n.push(["L",i.x,i.y]),n},e.prototype.getInnerLayoutBBox=function(){var t=this.get("start"),i=this.get("end"),n=r.prototype.getInnerLayoutBBox.call(this),a=Math.min(t.x,i.x,n.x),o=Math.min(t.y,i.y,n.y),s=Math.max(t.x,i.x,n.maxX),l=Math.max(t.y,i.y,n.maxY);return{x:a,y:o,minX:a,minY:o,maxX:s,maxY:l,width:s-a,height:l-o}},e.prototype.isVertical=function(){var t=this.get("start"),i=this.get("end");return Xt(t.x,i.x)},e.prototype.isHorizontal=function(){var t=this.get("start"),i=this.get("end");return Xt(t.y,i.y)},e.prototype.getTickPoint=function(t){var i=this,n=i.get("start"),a=i.get("end"),o=a.x-n.x,s=a.y-n.y;return{x:n.x+o*t,y:n.y+s*t}},e.prototype.getSideVector=function(t){var i=this.getAxisVector(),n=np([0,0],i),a=this.get("verticalFactor"),o=[n[1],n[0]*-1];return ee([0,0],o,t*a)},e.prototype.getAxisVector=function(){var t=this.get("start"),i=this.get("end");return[i.x-t.x,i.y-t.y]},e.prototype.processOverlap=function(t){var i=this,n=this.isVertical(),a=this.isHorizontal();if(!(!n&&!a)){var o=this.get("label"),s=this.get("title"),l=this.get("verticalLimitLength"),u=o.offset,c=l,h=0,f=0;s&&(h=s.style.fontSize,f=s.spacing),c&&(c=c-u-f-h);var v=this.get("overlapOrder");if(C(v,function(g){o[g]&&i.canProcessOverlap(g)&&i.autoProcessOverlap(g,o[g],t,c)}),s&&B(s.offset)){var d=t.getCanvasBBox(),p=n?d.width:d.height;s.offset=u+p+f+h/2}}},e.prototype.canProcessOverlap=function(t){var i=this.get("label");return t==="autoRotate"?B(i.rotate):!0},e.prototype.autoProcessOverlap=function(t,i,n,a){var o=this,s=this.isVertical(),l=!1,u=Hg[t];if(i===!0)this.get("label"),l=u.getDefault()(s,n,a);else if(X(i))l=i(s,n,a);else if(pt(i)){var c=i;u[c.type]&&(l=u[c.type](s,n,a,c.cfg))}else u[i]&&(l=u[i](s,n,a));if(t==="autoRotate"){if(l){var h=n.getChildren(),f=this.get("verticalFactor");C(h,function(d){var p=d.attr("textAlign");if(p==="center"){var g=f>0?"end":"start";d.attr("textAlign",g)}})}}else if(t==="autoHide"){var v=n.getChildren().slice(0);C(v,function(d){d.get("visible")||(o.get("isRegister")&&o.unregisterElement(d),d.remove())})}},e}(Rg),mM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},e.prototype.getLinePath=function(){var t=this.get("center"),i=t.x,n=t.y,a=this.get("radius"),o=a,s=this.get("startAngle"),l=this.get("endAngle"),u=[];if(Math.abs(l-s)===Math.PI*2)u=[["M",i,n-o],["A",a,o,0,1,1,i,n+o],["A",a,o,0,1,1,i,n-o],["Z"]];else{var c=this.getCirclePoint(s),h=this.getCirclePoint(l),f=Math.abs(l-s)>Math.PI?1:0,v=s>l?0:1;u=[["M",i,n],["L",c.x,c.y],["A",a,o,0,f,v,h.x,h.y],["L",i,n]]}return u},e.prototype.getTickPoint=function(t){var i=this.get("startAngle"),n=this.get("endAngle"),a=i+(n-i)*t;return this.getCirclePoint(a)},e.prototype.getSideVector=function(t,i){var n=this.get("center"),a=[i.x-n.x,i.y-n.y],o=this.get("verticalFactor"),s=$i(a);return ee(a,a,o*t/s),a},e.prototype.getAxisVector=function(t){var i=this.get("center"),n=[t.x-i.x,t.y-i.y];return[n[1],-1*n[0]]},e.prototype.getCirclePoint=function(t,i){var n=this.get("center");return i=i||this.get("radius"),{x:n.x+Math.cos(t)*i,y:n.y+Math.sin(t)*i}},e.prototype.canProcessOverlap=function(t){var i=this.get("label");return t==="autoRotate"?B(i.rotate):!0},e.prototype.processOverlap=function(t){var i=this,n=this.get("label"),a=this.get("title"),o=this.get("verticalLimitLength"),s=n.offset,l=o,u=0,c=0;a&&(u=a.style.fontSize,c=a.spacing),l&&(l=l-s-c-u);var h=this.get("overlapOrder");if(C(h,function(v){n[v]&&i.canProcessOverlap(v)&&i.autoProcessOverlap(v,n[v],t,l)}),a&&B(a.offset)){var f=t.getCanvasBBox().height;a.offset=s+f+c+u/2}},e.prototype.autoProcessOverlap=function(t,i,n,a){var o=this,s=!1,l=Hg[t];if(a>0)if(i===!0)s=l.getDefault()(!1,n,a);else if(X(i))s=i(!1,n,a);else if(pt(i)){var u=i;l[u.type]&&(s=l[u.type](!1,n,a,u.cfg))}else l[i]&&(s=l[i](!1,n,a));if(t==="autoRotate"){if(s){var c=n.getChildren(),h=this.get("verticalFactor");C(c,function(v){var d=v.attr("textAlign");if(d==="center"){var p=h>0?"end":"start";v.attr("textAlign",p)}})}}else if(t==="autoHide"){var f=n.getChildren().slice(0);C(f,function(v){v.get("visible")||(o.get("isRegister")&&o.unregisterElement(v),v.remove())})}},e}(Rg),Mc=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:lt.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:lt.textColor,textAlign:"center",textBaseline:"middle",fontFamily:lt.fontFamily}},textBackground:{padding:5,style:{stroke:lt.lineColor}}}})},e.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},e.prototype.renderText=function(t){var i=this.get("text"),n=i.style,a=i.autoRotate,o=i.content;if(!B(o)){var s=this.getTextPoint(),l=null;if(a){var u=this.getRotateAngle();l=Ci(s,u)}this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:m(m(m({},s),{text:o,matrix:l}),n)})}},e.prototype.renderLine=function(t){var i=this.getLinePath(),n=this.get("line"),a=n.style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:m({path:i},a)})},e.prototype.renderBackground=function(t){var i=this.getElementId("text"),n=t.findById(i),a=this.get("textBackground");if(a&&n){var o=n.getBBox(),s=_o(a.padding),l=a.style,u=this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:m({x:o.x-s[3],y:o.y-s[0],width:o.width+s[1]+s[3],height:o.height+s[0]+s[2],matrix:n.attr("matrix")},l)});u.toBack()}},e}(Qt),Xg=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),i=t.start,n=t.end,a=this.get("text").position,o=Math.atan2(n.y-i.y,n.x-i.x),s=a==="start"?o-Math.PI/2:o+Math.PI/2;return s},e.prototype.getTextPoint=function(){var t=this.getLocation(),i=t.start,n=t.end,a=this.get("text"),o=a.position,s=a.offset;return Og(i,n,o,s)},e.prototype.getLinePath=function(){var t=this.getLocation(),i=t.start,n=t.end;return[["M",i.x,i.y],["L",n.x,n.y]]},e}(Mc),xM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),i=t.startAngle,n=t.endAngle,a=this.get("text").position,o=a==="start"?i+Math.PI/2:n-Math.PI/2;return o},e.prototype.getTextPoint=function(){var t=this.get("text"),i=t.position,n=t.offset,a=this.getLocation(),o=a.center,s=a.radius,l=a.startAngle,u=a.endAngle,c=i==="start"?l:u,h=this.getRotateAngle()-Math.PI,f=Ui(o,s,c),v=Math.cos(h)*n,d=Math.sin(h)*n;return{x:f.x+v,y:f.y+d}},e.prototype.getLinePath=function(){var t=this.getLocation(),i=t.center,n=t.radius,a=t.startAngle,o=t.endAngle,s=null;if(o-a===Math.PI*2){var l=i.x,u=i.y;s=[["M",l,u-n],["A",n,n,0,1,1,l,u+n],["A",n,n,0,1,1,l,u-n],["Z"]]}else{var c=Ui(i,n,a),h=Ui(i,n,o),f=Math.abs(o-a)>Math.PI?1:0,v=a>o?0:1;s=[["M",c.x,c.y],["A",n,n,0,f,v,h.x,h.y]]}return s},e}(Mc),ca="g2-crosshair",bu=ca+"-line",Su=ca+"-text",En;const wM=(En={},En[""+ca]={position:"relative"},En[""+bu]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},En[""+Su]={position:"absolute",color:lt.textColor,fontFamily:lt.fontFamily},En);var bM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'
',crosshairTpl:'
',textTpl:'{content}',domStyles:null,containerClassName:ca,defaultStyles:wM,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},e.prototype.render=function(){this.resetText(),this.resetPosition()},e.prototype.initCrossHair=function(){var t=this.getContainer(),i=this.get("crosshairTpl"),n=Rr(i);t.appendChild(n),this.applyStyle(bu,n),this.set("crosshairEl",n)},e.prototype.getTextPoint=function(){var t=this.getLocation(),i=t.start,n=t.end,a=this.get("text"),o=a.position,s=a.offset;return Og(i,n,o,s)},e.prototype.resetText=function(){var t=this.get("text"),i=this.get("textEl");if(t){var n=t.content;if(!i){var a=this.getContainer(),o=cp(this.get("textTpl"),t);i=Rr(o),a.appendChild(i),this.applyStyle(Su,i),this.set("textEl",i)}i.innerHTML=n}else i&&i.remove()},e.prototype.isVertical=function(t,i){return t.x===i.x},e.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var i=this.get("start"),n=this.get("end"),a=Math.min(i.x,n.x),o=Math.min(i.y,n.y);this.isVertical(i,n)?Kt(t,{width:"1px",height:se(Math.abs(n.y-i.y))}):Kt(t,{height:"1px",width:se(Math.abs(n.x-i.x))}),Kt(t,{top:se(o),left:se(a)}),this.alignText()},e.prototype.alignText=function(){var t=this.get("textEl");if(t){var i=this.get("text").align,n=t.clientWidth,a=this.getTextPoint();switch(i){case"center":a.x=a.x-n/2;break;case"right":a.x=a.x-n}Kt(t,{top:se(a.y),left:se(a.x)})}},e.prototype.updateInner=function(t){Vr(t,"text")&&this.resetText(),r.prototype.updateInner.call(this,t)},e}(Sc);const iv=Object.freeze(Object.defineProperty({__proto__:null,Base:Mc,Circle:xM,Html:bM,Line:Xg},Symbol.toStringTag,{value:"Module"}));var Wg=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:lt.lineColor}}}})},e.prototype.getLineType=function(){var t=this.get("line")||this.get("defaultCfg").line;return t.type},e.prototype.renderInner=function(t){this.drawGrid(t)},e.prototype.getAlternatePath=function(t,i){var n=this.getGridPath(t),a=i.slice(0).reverse(),o=this.getGridPath(a,!0),s=this.get("closed");return s?n=n.concat(o):(o[0][0]="L",n=n.concat(o),n.push(["Z"])),n},e.prototype.getPathStyle=function(){return this.get("line").style},e.prototype.drawGrid=function(t){var i=this,n=this.get("line"),a=this.get("items"),o=this.get("alternateColor"),s=null;C(a,function(l,u){var c=l.id||u;if(n){var h=i.getPathStyle();h=X(h)?h(l,u,a):h;var f=i.getElementId("line-"+c),v=i.getGridPath(l.points);i.addShape(t,{type:"path",name:"grid-line",id:f,attrs:mt({path:v},h)})}if(o&&u>0){var d=i.getElementId("region-"+c),p=u%2===0;if(Q(o))p&&i.drawAlternateRegion(d,t,s.points,l.points,o);else{var g=p?o[1]:o[0];i.drawAlternateRegion(d,t,s.points,l.points,g)}}s=l})},e.prototype.drawAlternateRegion=function(t,i,n,a,o){var s=this.getAlternatePath(n,a);this.addShape(i,{type:"path",id:t,name:"grid-region",attrs:{path:s,fill:o}})},e}(Qt);function SM(r,e,t,i){var n=t-r,a=i-e;return Math.sqrt(n*n+a*a)}var CM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{type:"circle",center:null,closed:!0})},e.prototype.getGridPath=function(t,i){var n=this.getLineType(),a=this.get("closed"),o=[];if(t.length)if(n==="circle"){var s=this.get("center"),l=t[0],u=SM(s.x,s.y,l.x,l.y),c=i?0:1;a?(o.push(["M",s.x,s.y-u]),o.push(["A",u,u,0,0,c,s.x,s.y+u]),o.push(["A",u,u,0,0,c,s.x,s.y-u]),o.push(["Z"])):C(t,function(h,f){f===0?o.push(["M",h.x,h.y]):o.push(["A",u,u,0,0,c,h.x,h.y])})}else C(t,function(h,f){f===0?o.push(["M",h.x,h.y]):o.push(["L",h.x,h.y])}),a&&o.push(["Z"]);return o},e}(Wg),MM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{type:"line"})},e.prototype.getGridPath=function(t){var i=[];return C(t,function(n,a){a===0?i.push(["M",n.x,n.y]):i.push(["L",n.x,n.y])}),i},e}(Wg),_g=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},e.prototype.getLayoutBBox=function(){var t=r.prototype.getLayoutBBox.call(this),i=this.get("maxWidth"),n=this.get("maxHeight"),a=t.width,o=t.height;return i&&(a=Math.min(a,i)),n&&(o=Math.min(o,n)),Ls(t.minX,t.minY,a,o)},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.resetLocation=function(){var t=this.get("x"),i=this.get("y"),n=this.get("offsetX"),a=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+n,y:i+a})},e.prototype.applyOffset=function(){this.resetLocation()},e.prototype.getDrawPoint=function(){return this.get("currentPoint")},e.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},e.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},e.prototype.drawBackground=function(t){var i=this.get("background"),n=t.getBBox(),a=_o(i.padding),o=m({x:0,y:0,width:n.width+a[1]+a[3],height:n.height+a[0]+a[2]},i.style),s=this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:o});s.toBack()},e.prototype.drawTitle=function(t){var i=this.get("currentPoint"),n=this.get("title"),a=n.spacing,o=n.style,s=n.text,l=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"legend-title",attrs:m({text:s,x:i.x,y:i.y},o)}),u=l.getBBox();this.set("currentPoint",{x:i.x,y:u.maxY+a})},e.prototype.resetDraw=function(){var t=this.get("background"),i={x:0,y:0};if(t){var n=_o(t.padding);i.x=n[3],i.y=n[0]}this.set("currentPoint",i)},e}(Qt),Cl={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},to={fill:lt.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:lt.fontFamily,fontWeight:"normal",lineHeight:12},Ml="navigation-arrow-right",Al="navigation-arrow-left",nv={right:90*Math.PI/180,left:270*Math.PI/180,up:0,down:180*Math.PI/180},AM=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.currentPageIndex=1,t.totalPagesCnt=1,t.pageWidth=0,t.pageHeight=0,t.startX=0,t.startY=0,t.onNavigationBack=function(){var i=t.getElementByLocalId("item-group");if(t.currentPageIndex>1){t.currentPageIndex-=1,t.updateNavigation();var n=t.getCurrentNavigationMatrix();t.get("animate")?i.animate({matrix:n},100):i.attr({matrix:n})}},t.onNavigationAfter=function(){var i=t.getElementByLocalId("item-group");if(t.currentPageIndexg&&(g=F),v==="horizontal"?(y&&yu}if(s==="horizontal"){var T=this.get("maxRow")||1,L=v+(T===1?0:M),k=u-f-g.width-g.minX;this.pageHeight=L*T,this.pageWidth=k,C(l,function(O){var z=O.getBBox(),Y=h||z.width;(w&&wb&&(b=z.width)}),S=b,b+=f,u&&(b=Math.min(u,b),S=Math.min(u,S)),this.pageWidth=b,this.pageHeight=c-Math.max(g.height,v+M);var I=Math.floor(this.pageHeight/(v+M));C(l,function(O,z){z!==0&&z%I===0&&(x+=1,y.x+=b,y.y=o),n.moveElementTo(O,y),O.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:b,height:v}}),y.y+=v+M}),this.totalPagesCnt=x,this.moveElementTo(p,{x:a+S/2-g.width/2-g.minX,y:c-g.height-g.minY})}this.pageHeight&&this.pageWidth&&i.getParent().setClip({type:"rect",attrs:{x:this.startX,y:this.startY,width:this.pageWidth,height:this.pageHeight}}),s==="horizontal"&&this.get("maxRow")?this.totalPagesCnt=Math.ceil(x/this.get("maxRow")):this.totalPagesCnt=x,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(p),i.attr("matrix",this.getCurrentNavigationMatrix())},e.prototype.drawNavigation=function(t,i,n,a){var o={x:0,y:0},s=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),l=A(a.marker,"style",{}),u=l.size,c=u===void 0?12:u,h=yt(l,["size"]),f=this.drawArrow(s,o,Al,i==="horizontal"?"up":"left",c,h);f.on("click",this.onNavigationBack);var v=f.getBBox();o.x+=v.width+2;var d=this.addShape(s,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:m({x:o.x,y:o.y+c/2,text:n,textBaseline:"middle"},A(a.text,"style"))}),p=d.getBBox();o.x+=p.width+2;var g=this.drawArrow(s,o,Ml,i==="horizontal"?"down":"right",c,h);return g.on("click",this.onNavigationAfter),s},e.prototype.updateNavigation=function(t){var i=H({},Cl,this.get("pageNavigator")),n=i.marker.style,a=n.fill,o=n.opacity,s=n.inactiveFill,l=n.inactiveOpacity,u=this.currentPageIndex+"/"+this.totalPagesCnt,c=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),h=t?t.findById(this.getElementId(Al)):this.getElementByLocalId(Al),f=t?t.findById(this.getElementId(Ml)):this.getElementByLocalId(Ml);c.attr("text",u),h.attr("opacity",this.currentPageIndex===1?l:o),h.attr("fill",this.currentPageIndex===1?s:a),h.attr("cursor",this.currentPageIndex===1?"not-allowed":"pointer"),f.attr("opacity",this.currentPageIndex===this.totalPagesCnt?l:o),f.attr("fill",this.currentPageIndex===this.totalPagesCnt?s:a),f.attr("cursor",this.currentPageIndex===this.totalPagesCnt?"not-allowed":"pointer");var v=h.getBBox().maxX+2;c.attr("x",v),v+=c.getBBox().width+2,this.updateArrowPath(f,{x:v,y:0})},e.prototype.drawArrow=function(t,i,n,a,o,s){var l=i.x,u=i.y,c=this.addShape(t,{type:"path",id:this.getElementId(n),name:n,attrs:m({size:o,direction:a,path:[["M",l+o/2,u],["L",l,u+o],["L",l+o,u+o],["Z"]],cursor:"pointer"},s)});return c.attr("matrix",Ci({x:l+o/2,y:u+o/2},nv[a])),c},e.prototype.updateArrowPath=function(t,i){var n=i.x,a=i.y,o=t.attr(),s=o.size,l=o.direction,u=Ci({x:n+s/2,y:a+s/2},nv[l]);t.attr("path",[["M",n+s/2,a],["L",n,a+s],["L",n+s,a+s],["Z"]]),t.attr("matrix",u)},e.prototype.getCurrentNavigationMatrix=function(){var t=this,i=t.currentPageIndex,n=t.pageWidth,a=t.pageHeight,o=this.get("layout"),s=o==="horizontal"?{x:0,y:a*(1-i)}:{x:n*(1-i),y:0};return xc(s)},e.prototype.applyItemStates=function(t,i){var n=this.getItemStates(t),a=n.length>0;if(a){var o=i.getChildren(),s=this.get("itemStates");C(o,function(l){var u=l.get("name"),c=u.split("-")[2],h=zn(t,c,s);h&&(l.attr(h),c==="marker"&&!(l.get("isStroke")&&l.get("isFill"))&&(l.get("isStroke")&&l.attr("fill",null),l.get("isFill")&&l.attr("stroke",null)))})}},e.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),i=this.get("maxItemWidth");return i?t&&(i=t<=i?t:i):t&&(i=t),i},e}(_g),FM=1.4,av=.4,TM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{type:"continue",min:0,max:100,value:null,colors:[],track:{},rail:{},label:{},handler:{},slidable:!0,tip:null,step:null,maxWidth:null,maxHeight:null,defaultCfg:{label:{align:"rail",spacing:5,formatter:null,style:{fontSize:12,fill:lt.textColor,textBaseline:"middle",fontFamily:lt.fontFamily}},handler:{size:10,style:{fill:"#fff",stroke:"#333"}},track:{},rail:{type:"color",size:20,defaultLength:100,style:{fill:"#DCDEE2"}},title:{spacing:5,style:{fill:lt.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},e.prototype.isSlider=function(){return!0},e.prototype.getValue=function(){return this.getCurrentValue()},e.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},e.prototype.setRange=function(t,i){this.update({min:t,max:i})},e.prototype.setValue=function(t){var i=this.getValue();this.set("value",t);var n=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(n),this.delegateEmit("valuechanged",{originValue:i,value:t})},e.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},e.prototype.drawLegendContent=function(t){this.drawRail(t),this.drawLabels(t),this.fixedElements(t),this.resetTrack(t),this.resetTrackClip(t),this.get("slidable")&&this.resetHandlers(t)},e.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},e.prototype.bindHandlersEvent=function(t){var i=this;t.on("legend-handler-min:drag",function(n){var a=i.getValueByCanvasPoint(n.x,n.y),o=i.getCurrentValue(),s=o[1];sa&&(s=a),i.setValue([s,a])})},e.prototype.bindRailEvent=function(t){},e.prototype.bindTrackEvent=function(t){var i=this,n=null;t.on("legend-track:dragstart",function(a){n={x:a.x,y:a.y}}),t.on("legend-track:drag",function(a){if(n){var o=i.getValueByCanvasPoint(n.x,n.y),s=i.getValueByCanvasPoint(a.x,a.y),l=i.getCurrentValue(),u=l[1]-l[0],c=i.getRange(),h=s-o;h<0?l[0]+h>c.min?i.setValue([l[0]+h,l[1]+h]):i.setValue([c.min,c.min+u]):h>0&&(h>0&&l[1]+ho&&(h=o),h0&&this.changeRailLength(a,s,n[s]-v)}},e.prototype.changeRailLength=function(t,i,n){var a=t.getBBox(),o;i==="height"?o=this.getRailPath(a.x,a.y,a.width,n):o=this.getRailPath(a.x,a.y,n,a.height),t.attr("path",o)},e.prototype.changeRailPosition=function(t,i,n){var a=t.getBBox(),o=this.getRailPath(i,n,a.width,a.height);t.attr("path",o)},e.prototype.fixedHorizontal=function(t,i,n,a){var o=this.get("label"),s=o.align,l=o.spacing,u=n.getBBox(),c=t.getBBox(),h=i.getBBox(),f=u.height;this.fitRailLength(c,h,u,n),u=n.getBBox(),s==="rail"?(t.attr({x:a.x,y:a.y+f/2}),this.changeRailPosition(n,a.x+c.width+l,a.y),i.attr({x:a.x+c.width+u.width+l*2,y:a.y+f/2})):s==="top"?(t.attr({x:a.x,y:a.y}),i.attr({x:a.x+u.width,y:a.y}),this.changeRailPosition(n,a.x,a.y+c.height+l)):(this.changeRailPosition(n,a.x,a.y),t.attr({x:a.x,y:a.y+u.height+l}),i.attr({x:a.x+u.width,y:a.y+u.height+l}))},e.prototype.fixedVertail=function(t,i,n,a){var o=this.get("label"),s=o.align,l=o.spacing,u=n.getBBox(),c=t.getBBox(),h=i.getBBox();if(this.fitRailLength(c,h,u,n),u=n.getBBox(),s==="rail")t.attr({x:a.x,y:a.y}),this.changeRailPosition(n,a.x,a.y+c.height+l),i.attr({x:a.x,y:a.y+c.height+u.height+l*2});else if(s==="right")t.attr({x:a.x+u.width+l,y:a.y}),this.changeRailPosition(n,a.x,a.y),i.attr({x:a.x+u.width+l,y:a.y+u.height});else{var f=Math.max(c.width,h.width);t.attr({x:a.x,y:a.y}),this.changeRailPosition(n,a.x+f+l,a.y),i.attr({x:a.x,y:a.y+u.height})}},e}(_g),mr="g2-tooltip",xr="g2-tooltip-title",ha="g2-tooltip-list",Ps="g2-tooltip-list-item",Ds="g2-tooltip-marker",Os="g2-tooltip-value",qg="g2-tooltip-name",Ac="g2-tooltip-crosshair-x",Fc="g2-tooltip-crosshair-y";const EM=Object.freeze(Object.defineProperty({__proto__:null,CONTAINER_CLASS:mr,CROSSHAIR_X:Ac,CROSSHAIR_Y:Fc,LIST_CLASS:ha,LIST_ITEM_CLASS:Ps,MARKER_CLASS:Ds,NAME_CLASS:qg,TITLE_CLASS:xr,VALUE_CLASS:Os},Symbol.toStringTag,{value:"Module"}));var We;const kM=(We={},We[""+mr]={position:"absolute",visibility:"visible",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:lt.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},We[""+xr]={marginBottom:"4px"},We[""+ha]={margin:"0px",listStyleType:"none",padding:"0px"},We[""+Ps]={listStyleType:"none",marginBottom:"4px"},We[""+Ds]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},We[""+Os]={display:"inline-block",float:"right",marginLeft:"30px"},We[""+Ac]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},We[""+Fc]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},We);function LM(r,e,t,i,n){var a={left:rn.x+n.width,top:en.y+n.height};return a}function IM(r,e,t,i,n,a){var o=r,s=e;switch(a){case"left":o=r-i-t,s=e-n/2;break;case"right":o=r+t,s=e-n/2;break;case"top":o=r-i/2,s=e-n-t;break;case"bottom":o=r-i/2,s=e+t;break;default:o=r+t,s=e-n-t;break}return{x:o,y:s}}function PM(r,e,t,i,n,a,o){var s=IM(r,e,t,i,n,a);if(o){var l=LM(s.x,s.y,i,n,o);a==="auto"?(l.right&&(s.x=Math.max(0,r-i-t)),l.top&&(s.y=Math.max(0,e-n-t))):a==="top"||a==="bottom"?(l.left&&(s.x=o.x),l.right&&(s.x=o.x+o.width-i),a==="top"&&l.top&&(s.y=e+t),a==="bottom"&&l.bottom&&(s.y=e-n-t)):(l.top&&(s.y=o.y),l.bottom&&(s.y=o.y+o.height-n),a==="left"&&l.left&&(s.x=r+t),a==="right"&&l.right&&(s.x=r-i-t))}return s}function DM(r,e){var t=!1;return C(e,function(i){if(Vr(r,i))return t=!0,!1}),t}var OM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'
    ',itemTpl:'
  • {name}: {value}
  • `,xCrosshairTpl:'
    ',yCrosshairTpl:'
    ',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:mr,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:kM})},e.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},e.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},e.prototype.show=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!0),Kt(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},e.prototype.hide=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!1),Kt(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},e.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},e.prototype.setCrossHairsVisible=function(t){var i=t?"":"none",n=this.get("xCrosshairDom"),a=this.get("yCrosshairDom");n&&Kt(n,{display:i}),a&&Kt(a,{display:i})},e.prototype.initContainer=function(){if(r.prototype.initContainer.call(this),this.get("customContent")){this.get("container")&&this.get("container").remove();var t=this.getHtmlContentNode();this.get("parent").appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()}},e.prototype.updateInner=function(t){this.get("customContent")?this.renderCustomContent():(DM(t,["title","showTitle"])&&this.resetTitle(),Vr(t,"items")&&this.renderItems()),r.prototype.updateInner.call(this,t)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.removeDom=function(){r.prototype.removeDom.call(this),this.clearCrosshairs()},e.prototype.resetPosition=function(){var t=this.get("x"),i=this.get("y"),n=this.get("offset"),a=this.getOffset(),o=a.offsetX,s=a.offsetY,l=this.get("position"),u=this.get("region"),c=this.getContainer(),h=this.getBBox(),f=h.width,v=h.height,d;u&&(d=la(u));var p=PM(t,i,n,f,v,l,d);Kt(c,{left:se(p.x+o),top:se(p.y+s)}),this.resetCrosshairs()},e.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),i=this.get("parent"),n=this.get("container");n&&n.parentNode===i?i.replaceChild(t,n):i.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},e.prototype.getHtmlContentNode=function(){var t,i=this.get("customContent");if(i){var n=i(this.get("title"),this.get("items"));fp(n)?t=n:t=Rr(n)}return t},e.prototype.cacheDoms=function(){var t=this.getContainer(),i=t.getElementsByClassName(xr)[0],n=t.getElementsByClassName(ha)[0];this.set("titleDom",i),this.set("listDom",n)},e.prototype.resetTitle=function(){var t=this.get("title"),i=this.get("showTitle");i&&t?this.setTitle(t):this.setTitle("")},e.prototype.setTitle=function(t){var i=this.get("titleDom");i&&(i.innerText=t)},e.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),i=this.get("crosshairs");if(!t||!i)this.clearCrosshairs();else{var n=la(t),a=this.get("xCrosshairDom"),o=this.get("yCrosshairDom");i==="x"?(this.resetCrosshair("x",n),o&&(o.remove(),this.set("yCrosshairDom",null))):i==="y"?(this.resetCrosshair("y",n),a&&(a.remove(),this.set("xCrosshairDom",null))):(this.resetCrosshair("x",n),this.resetCrosshair("y",n)),this.setCrossHairsVisible(this.get("visible"))}},e.prototype.resetCrosshair=function(t,i){var n=this.checkCrosshair(t),a=this.get(t);t==="x"?Kt(n,{left:se(a),top:se(i.y),height:se(i.height)}):Kt(n,{top:se(a),left:se(i.x),width:se(i.width)})},e.prototype.checkCrosshair=function(t){var i=t+"CrosshairDom",n=t+"CrosshairTpl",a="CROSSHAIR_"+t.toUpperCase(),o=EM[a],s=this.get(i),l=this.get("parent");return s||(s=Rr(this.get(n)),this.applyStyle(o,s),l.appendChild(s),this.set(i,s)),s},e.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),i=this.get("itemTpl"),n=this.get("listDom");n&&(C(t,function(a){var o=zr.toCSSGradient(a.color),s=m(m({},a),{color:o}),l=cp(i,s),u=Rr(l);n.appendChild(u)}),this.applyChildrenStyles(n,this.get("domStyles")))},e.prototype.clearItemDoms=function(){this.get("listDom")&&bc(this.get("listDom"))},e.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),i=this.get("yCrosshairDom");t&&t.remove(),i&&i.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},e}(Sc),BM={opacity:0},RM={stroke:"#C5C5C5",strokeOpacity:.85},zM={fill:"#CACED4",opacity:.85};function NM(r){return Mt(r,function(e,t){var i=t===0?"M":"L",n=e[0],a=e[1];return[i,n,a]})}function Ug(r){return NM(r)}function GM(r){if(r.length<=2)return Ug(r);var e=[];C(r,function(o){Pt(o,e.slice(e.length-2))||e.push(o[0],o[1])});var t=Zb(e),i=ye(r),n=i[0],a=i[1];return t.unshift(["M",n,a]),t}function VM(r,e,t,i){i===void 0&&(i=!0);var n=new Es({values:r}),a=new Fs({values:Mt(r,function(s,l){return l})}),o=Mt(r,function(s,l){return[a.scale(l)*e,t-n.scale(s)*t]});return i?GM(o):Ug(o)}function YM(r,e){var t=new Es({values:r}),i=t.max<0?t.max:Math.max(0,t.min);return e-t.scale(i)*e}function $M(r,e,t,i){var n=Kn(r),a=YM(i,t);return n.push(["L",e,a]),n.push(["L",0,a]),n.push(["Z"]),n}var HM=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:BM,lineStyle:RM,areaStyle:zM})},e.prototype.renderInner=function(t){var i=this.cfg,n=i.width,a=i.height,o=i.data,s=i.smooth,l=i.isArea,u=i.backgroundStyle,c=i.lineStyle,h=i.areaStyle;this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:m({x:0,y:0,width:n,height:a},u)});var f=VM(o,n,a,s);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:m({path:f},c)}),l){var v=$M(f,n,a,o);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:m({path:v},h)})}},e.prototype.applyOffset=function(){var t=this.cfg,i=t.x,n=t.y;this.moveElementTo(this.get("group"),{x:i,y:n})},e}(Qt),jg={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},ov=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"handler",x:0,y:0,width:10,height:24,style:jg})},e.prototype.renderInner=function(t){var i=this.cfg,n=i.width,a=i.height,o=i.style,s=o.fill,l=o.stroke,u=o.radius,c=o.opacity,h=o.cursor;this.addShape(t,{type:"rect",id:this.getElementId("background"),attrs:{x:0,y:0,width:n,height:a,fill:s,stroke:l,radius:u,opacity:c,cursor:h}});var f=1/3*n,v=2/3*n,d=1/4*a,p=3/4*a;this.addShape(t,{id:this.getElementId("line-left"),type:"line",attrs:{x1:f,y1:d,x2:f,y2:p,stroke:l,cursor:h}}),this.addShape(t,{id:this.getElementId("line-right"),type:"line",attrs:{x1:v,y1:d,x2:v,y2:p,stroke:l,cursor:h}})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.bindEvents=function(){var t=this;this.get("group").on("mouseenter",function(){var i=t.get("style").highLightFill;t.getElementByLocalId("background").attr("fill",i),t.draw()}),this.get("group").on("mouseleave",function(){var i=t.get("style").fill;t.getElementByLocalId("background").attr("fill",i),t.draw()})},e.prototype.draw=function(){var t=this.get("container").get("canvas");t&&t.draw()},e}(Qt),XM={fill:"#416180",opacity:.05},WM={fill:"#5B8FF9",opacity:.15,cursor:"move"},To=10,_M={width:To,height:24},qM={textBaseline:"middle",fill:"#000",opacity:.45},UM="sliderchange",jM=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.onMouseDown=function(i){return function(n){t.currentTarget=i;var a=n.originalEvent;a.stopPropagation(),a.preventDefault(),t.prevX=A(a,"touches.0.pageX",a.pageX),t.prevY=A(a,"touches.0.pageY",a.pageY);var o=t.getContainerDOM();o.addEventListener("mousemove",t.onMouseMove),o.addEventListener("mouseup",t.onMouseUp),o.addEventListener("mouseleave",t.onMouseUp),o.addEventListener("touchmove",t.onMouseMove),o.addEventListener("touchend",t.onMouseUp),o.addEventListener("touchcancel",t.onMouseUp)}},t.onMouseMove=function(i){var n=t.cfg.width,a=[t.get("start"),t.get("end")];i.stopPropagation(),i.preventDefault();var o=A(i,"touches.0.pageX",i.pageX),s=A(i,"touches.0.pageY",i.pageY),l=o-t.prevX,u=t.adjustOffsetRange(l/n);t.updateStartEnd(u),t.updateUI(t.getElementByLocalId("foreground"),t.getElementByLocalId("minText"),t.getElementByLocalId("maxText")),t.prevX=o,t.prevY=s,t.draw(),t.emit(UM,[t.get("start"),t.get("end")].sort()),t.delegateEmit("valuechanged",{originValue:a,value:[t.get("start"),t.get("end")]})},t.onMouseUp=function(){t.currentTarget&&(t.currentTarget=void 0);var i=t.getContainerDOM();i&&(i.removeEventListener("mousemove",t.onMouseMove),i.removeEventListener("mouseup",t.onMouseUp),i.removeEventListener("mouseleave",t.onMouseUp),i.removeEventListener("touchmove",t.onMouseMove),i.removeEventListener("touchend",t.onMouseUp),i.removeEventListener("touchcancel",t.onMouseUp))},t}return e.prototype.setRange=function(t,i){this.set("minLimit",t),this.set("maxLimit",i);var n=this.get("start"),a=this.get("end"),o=Ct(n,t,i),s=Ct(a,t,i);!this.get("isInit")&&(n!==o||a!==s)&&this.setValue([o,s])},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var i=this.getRange();if(R(t)&&t.length===2){var n=[this.get("start"),this.get("end")];this.update({start:Ct(t[0],i.min,i.max),end:Ct(t[1],i.min,i.max)}),this.get("updateAutoRender")||this.render(),this.delegateEmit("valuechanged",{originValue:n,value:t})}},e.prototype.getValue=function(){return[this.get("start"),this.get("end")]},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:XM,foregroundStyle:WM,handlerStyle:_M,textStyle:qM}})},e.prototype.update=function(t){var i=t.start,n=t.end,a=m({},t);B(i)||(a.start=Ct(i,0,1)),B(n)||(a.end=Ct(n,0,1)),r.prototype.update.call(this,a),this.minHandler=this.getChildComponentById(this.getElementId("minHandler")),this.maxHandler=this.getChildComponentById(this.getElementId("maxHandler")),this.trend=this.getChildComponentById(this.getElementId("trend"))},e.prototype.init=function(){this.set("start",Ct(this.get("start"),0,1)),this.set("end",Ct(this.get("end"),0,1)),r.prototype.init.call(this)},e.prototype.render=function(){r.prototype.render.call(this),this.updateUI(this.getElementByLocalId("foreground"),this.getElementByLocalId("minText"),this.getElementByLocalId("maxText"))},e.prototype.renderInner=function(t){var i=this.cfg;i.start,i.end;var n=i.width,a=i.height,o=i.trendCfg,s=o===void 0?{}:o,l=i.minText,u=i.maxText,c=i.backgroundStyle,h=c===void 0?{}:c,f=i.foregroundStyle,v=f===void 0?{}:f,d=i.textStyle,p=d===void 0?{}:d,g=H({},jg,this.cfg.handlerStyle);Vt(A(s,"data"))&&(this.trend=this.addComponent(t,m({component:HM,id:this.getElementId("trend"),x:0,y:0,width:n,height:a},s))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:m({x:0,y:0,width:n,height:a},h)}),this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:m({y:a/2,textAlign:"right",text:l,silent:!1},p)}),this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:m({y:a/2,textAlign:"left",text:u,silent:!1},p)}),this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:m({y:0,height:a},v)});var y=A(g,"width",To),x=A(g,"height",24);this.minHandler=this.addComponent(t,{component:ov,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(a-x)/2,width:y,height:x,cursor:"ew-resize",style:g}),this.maxHandler=this.addComponent(t,{component:ov,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(a-x)/2,width:y,height:x,cursor:"ew-resize",style:g})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.updateUI=function(t,i,n){var a=this.cfg,o=a.start,s=a.end,l=a.width,u=a.minText,c=a.maxText,h=a.handlerStyle,f=a.height,v=o*l,d=s*l;this.trend&&(this.trend.update({width:l,height:f}),this.get("updateAutoRender")||this.trend.render()),t.attr("x",v),t.attr("width",d-v);var p=A(h,"width",To);i.attr("text",u),n.attr("text",c);var g=this._dodgeText([v,d],i,n),y=g[0],x=g[1];this.minHandler&&(this.minHandler.update({x:v-p/2}),this.get("updateAutoRender")||this.minHandler.render()),C(y,function(w,b){return i.attr(b,w)}),this.maxHandler&&(this.maxHandler.update({x:d-p/2}),this.get("updateAutoRender")||this.maxHandler.render()),C(x,function(w,b){return n.attr(b,w)})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("handler-min:mousedown",this.onMouseDown("minHandler")),t.on("handler-min:touchstart",this.onMouseDown("minHandler")),t.on("handler-max:mousedown",this.onMouseDown("maxHandler")),t.on("handler-max:touchstart",this.onMouseDown("maxHandler"));var i=t.findById(this.getElementId("foreground"));i.on("mousedown",this.onMouseDown("foreground")),i.on("touchstart",this.onMouseDown("foreground"))},e.prototype.adjustOffsetRange=function(t){var i=this.cfg,n=i.start,a=i.end;switch(this.currentTarget){case"minHandler":{var o=0-n,s=1-n;return Math.min(s,Math.max(o,t))}case"maxHandler":{var o=0-a,s=1-a;return Math.min(s,Math.max(o,t))}case"foreground":{var o=0-n,s=1-a;return Math.min(s,Math.max(o,t))}}},e.prototype.updateStartEnd=function(t){var i=this.cfg,n=i.start,a=i.end;switch(this.currentTarget){case"minHandler":n+=t;break;case"maxHandler":a+=t;break;case"foreground":n+=t,a+=t;break}this.set("start",n),this.set("end",a)},e.prototype._dodgeText=function(t,i,n){var a,o,s=this.cfg,l=s.handlerStyle,u=s.width,c=2,h=A(l,"width",To),f=t[0],v=t[1],d=!1;f>v&&(a=[v,f],f=a[0],v=a[1],o=[n,i],i=o[0],n=o[1],d=!0);var p=i.getBBox(),g=n.getBBox(),y=p.width>f-c?{x:f+h/2+c,textAlign:"left"}:{x:f-h/2-c,textAlign:"right"},x=g.width>u-v-c?{x:v-h/2-c,textAlign:"right"}:{x:v+h/2+c,textAlign:"left"};return d?[x,y]:[y,x]},e.prototype.draw=function(){var t=this.get("container"),i=t&&t.get("canvas");i&&i.draw()},e.prototype.getContainerDOM=function(){var t=this.get("container"),i=t&&t.get("canvas");return i&&i.get("container")},e}(Qt),ZM={trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},Fl={default:ZM,hover:{thumbColor:"rgba(0,0,0,0.2)"}},QM=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.clearEvents=Pr,t.onStartEvent=function(i){return function(n){t.isMobile=i,n.originalEvent.preventDefault();var a=i?A(n.originalEvent,"touches.0.clientX"):n.clientX,o=i?A(n.originalEvent,"touches.0.clientY"):n.clientY;t.startPos=t.cfg.isHorizontal?a:o,t.bindLaterEvent()}},t.bindLaterEvent=function(){var i=t.getContainerDOM(),n=[];t.isMobile?n=[Bi(i,"touchmove",t.onMouseMove),Bi(i,"touchend",t.onMouseUp),Bi(i,"touchcancel",t.onMouseUp)]:n=[Bi(i,"mousemove",t.onMouseMove),Bi(i,"mouseup",t.onMouseUp),Bi(i,"mouseleave",t.onMouseUp)],t.clearEvents=function(){n.forEach(function(a){a.remove()})}},t.onMouseMove=function(i){var n=t.cfg,a=n.isHorizontal,o=n.thumbOffset;i.preventDefault();var s=t.isMobile?A(i,"touches.0.clientX"):i.clientX,l=t.isMobile?A(i,"touches.0.clientY"):i.clientY,u=a?s:l,c=u-t.startPos;t.startPos=u,t.updateThumbOffset(o+c)},t.onMouseUp=function(i){i.preventDefault(),t.clearEvents()},t.onTrackClick=function(i){var n=t.cfg,a=n.isHorizontal,o=n.x,s=n.y,l=n.thumbLen,u=t.getContainerDOM(),c=u.getBoundingClientRect(),h=i.clientX,f=i.clientY,v=a?h-c.left-o-l/2:f-c.top-s-l/2,d=t.validateRange(v);t.updateThumbOffset(d)},t.onThumbMouseOver=function(){var i=t.cfg.theme.hover.thumbColor;t.getElementByLocalId("thumb").attr("stroke",i),t.draw()},t.onThumbMouseOut=function(){var i=t.cfg.theme.default.thumbColor;t.getElementByLocalId("thumb").attr("stroke",i),t.draw()},t}return e.prototype.setRange=function(t,i){this.set("minLimit",t),this.set("maxLimit",i);var n=this.getValue(),a=Ct(n,t,i);n!==a&&!this.get("isInit")&&this.setValue(a)},e.prototype.getRange=function(){var t=this.get("minLimit")||0,i=this.get("maxLimit")||1;return{min:t,max:i}},e.prototype.setValue=function(t){var i=this.getRange(),n=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*Ct(t,i.min,i.max)}),this.delegateEmit("valuechange",{originalValue:n,value:this.getValue()})},e.prototype.getValue=function(){return Ct(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return m(m({},t),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:Fl})},e.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.renderTrackShape=function(t){var i=this.cfg,n=i.trackLen,a=i.theme,o=a===void 0?{default:{}}:a,s=H({},Fl,o).default,l=s.lineCap,u=s.trackColor,c=s.size,h=A(this.cfg,"size",c),f=this.get("isHorizontal")?{x1:0+h/2,y1:h/2,x2:n-h/2,y2:h/2,lineWidth:h,stroke:u,lineCap:l}:{x1:h/2,y1:0+h/2,x2:h/2,y2:n-h/2,lineWidth:h,stroke:u,lineCap:l};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:f})},e.prototype.renderThumbShape=function(t){var i=this.cfg,n=i.thumbOffset,a=i.thumbLen,o=i.theme,s=H({},Fl,o).default,l=s.size,u=s.lineCap,c=s.thumbColor,h=A(this.cfg,"size",l),f=this.get("isHorizontal")?{x1:n+h/2,y1:h/2,x2:n+a-h/2,y2:h/2,lineWidth:h,stroke:c,lineCap:u,cursor:"default"}:{x1:h/2,y1:n+h/2,x2:h/2,y2:n+a-h/2,lineWidth:h,stroke:c,lineCap:u,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:f})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("mousedown",this.onStartEvent(!1)),t.on("mouseup",this.onMouseUp),t.on("touchstart",this.onStartEvent(!0)),t.on("touchend",this.onMouseUp);var i=t.findById(this.getElementId("track"));i.on("click",this.onTrackClick);var n=t.findById(this.getElementId("thumb"));n.on("mouseover",this.onThumbMouseOver),n.on("mouseout",this.onThumbMouseOut)},e.prototype.getContainerDOM=function(){var t=this.get("container"),i=t&&t.get("canvas");return i&&i.get("container")},e.prototype.validateRange=function(t){var i=this.cfg,n=i.thumbLen,a=i.trackLen,o=t;return t+n>a?o=a-n:t+na.x?a.x:e,t=ta.y?a.y:i,n=n=i&&r<=n}function aA(r,e,t){if(Q(r))return r.padEnd(e,t);if(R(r)){var i=r.length;if(i=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.add=function(){for(var e=[],t=0;te.minX&&this.minYe.minY},r.prototype.size=function(){return this.width*this.height},r.prototype.isPointIn=function(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY},r}();function oA(r){return[[r.minX,r.minY],[r.maxX,r.minY],[r.maxX,r.maxY],[r.minX,r.maxY]]}function Ia(r){if(r.isPolar&&!r.isTransposed)return(r.endAngle-r.startAngle)*r.getRadius();var e=r.convert({x:0,y:0}),t=r.convert({x:1,y:0});return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function sA(r){if(r.isPolar){var e=r.startAngle,t=r.endAngle;return t-e===Math.PI*2}return!1}function Rs(r,e){var t=r.getCenter();return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function lA(r,e){var t=!1;if(r)if(r.type==="theta"){var i=r.start,n=r.end;t=Wi(e.x,i.x,n.x)&&Wi(e.y,i.y,n.y)}else{var a=r.invert(e);t=Wi(a.x,0,1)&&Wi(a.y,0,1)}return t}function nn(r,e){var t=r.getCenter();return Math.atan2(e.y-t.y,e.x-t.x)}function Tc(r,e){e===void 0&&(e=0);var t=r.start,i=r.end,n=r.getWidth(),a=r.getHeight();if(r.isPolar){var o=r.startAngle,s=r.endAngle,l=r.getCenter(),u=r.getRadius();return{type:"path",startState:{path:Nr(l.x,l.y,u+e,o,o)},endState:function(h){var f=(s-o)*h+o,v=Nr(l.x,l.y,u+e,o,f);return{path:v}},attrs:{path:Nr(l.x,l.y,u+e,o,s)}}}var c;return r.isTransposed?c={height:a+e*2}:c={width:n+e*2},{type:"rect",startState:{x:t.x-e,y:i.y-e,width:r.isTransposed?n+e*2:0,height:r.isTransposed?0:a+e*2},endState:c,attrs:{x:t.x-e,y:i.y-e,width:n+e*2,height:a+e*2}}}function uA(r,e){e===void 0&&(e=0);var t=r.start,i=r.end,n=r.getWidth(),a=r.getHeight(),o=Math.min(t.x,i.x),s=Math.min(t.y,i.y);return ie.fromRange(o-e,s-e,o+n+e,s+a+e)}var cA=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]+)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;function hA(r){var e="linear";return cA.test(r)?e="timeCat":Q(r)&&(e="cat"),e}function Kg(r,e,t,i){return e===void 0&&(e={}),e.type?e.type:r.type!=="identity"&&Hi.includes(t)&&["interval"].includes(i)||r.isCategory?"cat":r.type}function fA(r,e,t){var i=e||[];if(rt(r)||B(Ux(i,r))&&fe(t)){var n=yu("identity");return new n({field:r.toString(),values:[r]})}var a=Ve(i,r),o=A(t,"type",hA(a[0])),s=yu(o);return new s(m({field:r,values:a},t))}function vA(r,e){if(r.type!=="identity"&&e.type!=="identity"){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);r.change(t)}}function va(r){return r.alias||r.field}function Jg(r,e,t){var i=r.values,n=i.length,a;if(n===1)a=[.5,1];else{var o=1,s=0;sA(e)?e.isTransposed?(o=A(t,"widthRatio.multiplePie",1/1.3),s=1/n*o,a=[s/2,1-s/2]):a=[0,1-1/n]:(s=1/n/2,a=[s,1-s])}return a}function dA(r){var e=r.values.filter(function(t){return!B(t)&&!isNaN(t)});return Math.max.apply(Math,Z(Z([],U(e),!1),[B(r.max)?-1/0:r.max],!1))}function pA(r){var e,t;switch(r){case G.TOP:e={x:0,y:1},t={x:1,y:1};break;case G.RIGHT:e={x:1,y:0},t={x:1,y:1};break;case G.BOTTOM:e={x:0,y:0},t={x:1,y:0};break;case G.LEFT:e={x:0,y:0},t={x:0,y:1};break;default:e=t={x:0,y:0}}return{start:e,end:t}}function gA(r){var e,t;return r.isTransposed?(e={x:0,y:0},t={x:1,y:0}):(e={x:0,y:0},t={x:0,y:1}),{start:e,end:t}}function eo(r,e){var t={start:{x:0,y:0},end:{x:0,y:0}};r.isRect?t=pA(e):r.isPolar&&(t=gA(r));var i=t.start,n=t.end;return{start:r.convert(i),end:r.convert(n)}}function ty(r){var e=r.start,t=r.end;return e.x===t.x}function cv(r,e){var t=r.start,i=r.end,n=ty(r);return n?(t.y-i.y)*(e.x-t.x)>0?1:-1:(i.x-t.x)*(t.y-e.y)>0?-1:1}function ro(r,e){var t=A(r,["components","axis"],{});return H({},A(t,["common"],{}),H({},A(t,[e],{})))}function hv(r,e,t){var i=A(r,["components","axis"],{});return H({},A(i,["common","title"],{}),H({},A(i,[e,"title"],{})),t)}function Tl(r){var e=r.x,t=r.y,i=r.circleCenter,n=t.start>t.end,a=r.isTransposed?r.convert({x:n?0:1,y:0}):r.convert({x:0,y:n?0:1}),o=[a.x-i.x,a.y-i.y],s=[1,0],l=a.y>i.y?Ql(o,s):Ql(o,s)*-1,u=l+(e.end-e.start),c=Math.sqrt(Math.pow(a.x-i.x,2)+Math.pow(a.y-i.y,2));return{center:i,radius:c,startAngle:l,endAngle:u}}function Uo(r,e){return tn(r)?r===!1?!1:{}:A(r,[e])}function fv(r,e){return A(r,"position",e)}function vv(r,e){return A(e,["title","text"],va(r))}var gn=function(){function r(e,t){this.destroyed=!1,this.facets=[],this.view=e,this.cfg=H({},this.getDefaultCfg(),t)}return r.prototype.init=function(){this.container||(this.container=this.createContainer());var e=this.view.getData();this.facets=this.generateFacets(e)},r.prototype.render=function(){this.renderViews()},r.prototype.update=function(){},r.prototype.clear=function(){this.clearFacetViews()},r.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},r.prototype.facetToView=function(e){var t=e.region,i=e.data,n=e.padding,a=n===void 0?this.cfg.padding:n,o=this.view.createView({region:t,padding:a});o.data(i||[]),e.view=o,this.beforeEachView(o,e);var s=this.cfg.eachView;return s&&s(o,e),this.afterEachView(o,e),o},r.prototype.createContainer=function(){var e=this.view.getLayer(It.FORE);return e.addGroup()},r.prototype.renderViews=function(){this.createFacetViews()},r.prototype.createFacetViews=function(){var e=this;return this.facets.map(function(t){return e.facetToView(t)})},r.prototype.clearFacetViews=function(){var e=this;C(this.facets,function(t){t.view&&(e.view.removeView(t.view),t.view=void 0)})},r.prototype.parseSpacing=function(){var e=this.view.viewBBox,t=e.width,i=e.height,n=this.cfg.spacing;return n.map(function(a,o){return rt(a)?a/(o===0?t:i):parseFloat(a)/100})},r.prototype.getFieldValues=function(e,t){var i=[],n={};return C(e,function(a){var o=a[t];!B(o)&&!n[o]&&(i.push(o),n[o]=!0)}),i},r.prototype.getRegion=function(e,t,i,n){var a=U(this.parseSpacing(),2),o=a[0],s=a[1],l=(1+o)/(t===0?1:t)-o,u=(1+s)/(e===0?1:e)-s,c={x:(l+o)*i,y:(u+s)*n},h={x:c.x+l,y:c.y+u};return{start:c,end:h}},r.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},r.prototype.getDefaultTitleCfg=function(){var e=this.view.getTheme().fontFamily;return{style:{fontSize:14,fill:"#666",fontFamily:e}}},r.prototype.processAxis=function(e,t){var i=e.getOptions(),n=i.coordinate,a=e.geometries,o=A(n,"type","rect");if(o==="rect"&&a.length){B(i.axes)&&(i.axes={});var s=i.axes,l=U(a[0].getXYFields(),2),u=l[0],c=l[1],h=Uo(s,u),f=Uo(s,c);h!==!1&&(i.axes[u]=this.getXAxisOption(u,s,h,t)),f!==!1&&(i.axes[c]=this.getYAxisOption(c,s,f,t))}},r.prototype.getFacetDataFilter=function(e){return function(t){return Qu(e,function(i){var n=i.field,a=i.value;return!B(a)&&n?t[n]===a:!0})}},r}(),ey={},yA=function(r){return ey[vn(r)]},yn=function(r,e){ey[vn(r)]=e},St=function(){function r(e,t){this.context=e,this.cfg=t,e.addAction(this)}return r.prototype.applyCfg=function(e){mt(this,e)},r.prototype.init=function(){this.applyCfg(this.cfg)},r.prototype.destroy=function(){this.context.removeAction(this),this.context=null},r}(),mA=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.execute=function(){this.callback&&this.callback(this.context)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.callback=null},e}(St),Ec={};function xA(r,e){var t=Ec[r],i=null;if(t){var n=t.ActionClass,a=t.cfg;i=new n(e,a),i.name=r,i.init()}return i}function zs(r){var e=Ec[r];return A(e,"ActionClass")}function j(r,e,t){Ec[r]={ActionClass:e,cfg:t}}function wA(r,e){var t=new mA(e);return t.callback=r,t.name="callback",t}function bA(r,e){var t=[];if(r.length){t.push(["M",r[0].x,r[0].y]);for(var i=1,n=r.length;i=o[u]?1:0,f=c>Math.PI?1:0,v=t.convert(s),d=Rs(t,v);if(d>=.5)if(c===Math.PI*2){var p={x:(s.x+o.x)/2,y:(s.y+o.y)/2},g=t.convert(p);l.push(["A",d,d,0,f,h,g.x,g.y]),l.push(["A",d,d,0,f,h,v.x,v.y])}else l.push(["A",d,d,0,f,h,v.x,v.y]);return l}function CA(r){C(r,function(e,t){var i=e;if(i[0].toLowerCase()==="a"){var n=r[t-1],a=r[t+1];a&&a[0].toLowerCase()==="a"?n&&n[0].toLowerCase()==="l"&&(n[0]="M"):n&&n[0].toLowerCase()==="a"&&a&&a[0].toLowerCase()==="l"&&(a[0]="M")}})}var MA=function(r,e,t,i){var n,a=[],o=!!i,s,l,u,c,h,f,v;if(o){n=U(i,2),u=n[0],c=n[1];for(var d=0,p=r.length;d0&&n>0&&(i>=e||n>=e)}function oy(r,e){var t=r.getCanvasBBox();return ay(r,e)?t:null}function sy(r,e){var t=r.event.maskShapes;return t.map(function(i){return oy(i,e)}).filter(function(i){return!!i})}function TA(r,e){var t=r.event,i=t.target;return ly(i,e)}function ly(r,e){return ay(r,e)?r.attr("path"):null}function EA(r,e){var t=r.event.maskShapes;return t.map(function(i){return ly(i,e)})}function Hr(r){var e=r.event,t,i=e.target;return i&&(t=i.get("element")),t}function Mi(r){var e=r.event,t=e.target,i;return t&&(i=t.get("delegateObject")),i}function uy(r){var e=r.event.gEvent;return!(e&&e.fromShape&&e.toShape&&e.fromShape.get("element")===e.toShape.get("element"))}function da(r){return r&&r.component&&r.component.isList()}function cy(r){return r&&r.component&&r.component.isSlider()}function pa(r){var e=r.event,t=e.target;return t&&(t==null?void 0:t.get("name"))==="mask"||Ns(r)}function Ns(r){var e;return((e=r.event.target)===null||e===void 0?void 0:e.get("name"))==="multi-mask"}function kc(r,e){var t=r.event.target;if(Ns(r))return kA(r,e);if(t.get("type")==="path"){var i=TA(r,e);return i?dy(r.view,i):void 0}var n=ny(r,e);return n?Gs(r.view,n):null}function kA(r,e){var t=r.event.target;if(t.get("type")==="path"){var i=EA(r,e);return i.length>0?i.flatMap(function(a){return dy(r.view,a)}):null}var n=sy(r,e);return n.length>0?n.flatMap(function(a){return Gs(r.view,a)}):null}function hy(r,e,t){if(Ns(r))return LA(r,e,t);var i=ny(r,t);return i?fy(i,r,e):null}function fy(r,e,t){var i=e.view,n=Mu(i,t,{x:r.x,y:r.y}),a=Mu(i,t,{x:r.maxX,y:r.maxY}),o={minX:n.x,minY:n.y,maxX:a.x,maxY:a.y};return Gs(t,o)}function LA(r,e,t){var i=sy(r,t);return i.length>0?i.flatMap(function(n){return fy(n,r,e)}):null}function _t(r){var e=r.geometries,t=[];return C(e,function(i){var n=i.elements;t=t.concat(n)}),r.views&&r.views.length&&C(r.views,function(i){t=t.concat(_t(i))}),t}function IA(r,e,t){var i=_t(r);return i.filter(function(n){return Ye(n,e)===t})}function vy(r,e){var t=r.geometries,i=[];return C(t,function(n){var a=n.getElementsBy(function(o){return o.hasState(e)});i=i.concat(a)}),i}function Ye(r,e){var t=r.getModel(),i=t.data,n;return R(i)?n=i[0][e]:n=i[e],n}function PA(r,e){return!(e.minX>r.maxX||e.maxXr.maxY||e.maxY=e.x&&r.y<=e.y&&r.maxY>e.y}function Ke(r){var e=r.parent,t=null;return e&&(t=e.views.filter(function(i){return i!==r})),t}function OA(r,e){var t=r.getCoordinate();return t.invert(e)}function Mu(r,e,t){var i=OA(r,t);return e.getCoordinate().convert(i)}function gy(r,e,t,i){var n=!1;return C(r,function(a){if(a[t]===e[t]&&a[i]===e[i])return n=!0,!1}),n}function an(r,e){var t=r.getScaleByField(e);return!t&&r.views&&C(r.views,function(i){if(t=an(i,e),t)return!1}),t}var BA=function(){function r(e){this.actions=[],this.event=null,this.cacheMap={},this.view=e}return r.prototype.cache=function(){for(var e=[],t=0;t=0&&t.splice(i,1)},r.prototype.getCurrentPoint=function(){var e=this.event;if(e)if(e.target instanceof HTMLElement){var t=this.view.getCanvas(),i=t.getPointByClient(e.clientX,e.clientY);return i}else return{x:e.x,y:e.y};return null},r.prototype.getCurrentShape=function(){return A(this.event,["gEvent","shape"])},r.prototype.isInPlot=function(){var e=this.getCurrentPoint();return e?this.view.isPointInPlot(e):!1},r.prototype.isInShape=function(e){var t=this.getCurrentShape();return t?t.get("name")===e:!1},r.prototype.isInComponent=function(e){var t=py(this.view),i=this.getCurrentPoint();return i?!!t.find(function(n){var a=n.getBBox();return e?n.get("name")===e&&pv(a,i):pv(a,i)}):!1},r.prototype.destroy=function(){C(this.actions.slice(),function(e){e.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},r}(),RA=function(){function r(e,t){this.view=e,this.cfg=t}return r.prototype.init=function(){this.initEvents()},r.prototype.initEvents=function(){},r.prototype.clearEvents=function(){},r.prototype.destroy=function(){this.clearEvents()},r}();function gv(r,e,t){var i=r.split(":"),n=i[0],a=e.getAction(n)||xA(n,e);if(!a)throw new Error("There is no action named ".concat(n));var o=i[1];return{action:a,methodName:o,arg:t}}function yv(r){var e=r.action,t=r.methodName,i=r.arg;if(e[t])e[t](i);else throw new Error("Action(".concat(e.name,") doesn't have a method called ").concat(t))}var ge={START:"start",SHOW_ENABLE:"showEnable",END:"end",ROLLBACK:"rollback",PROCESSING:"processing"},zA=function(r){E(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.callbackCaches={},n.emitCaches={},n.steps=i,n}return e.prototype.init=function(){this.initContext(),r.prototype.init.call(this)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},e.prototype.initEvents=function(){var t=this;C(this.steps,function(i,n){C(i,function(a){var o=t.getActionCallback(n,a);o&&t.bindEvent(a.trigger,o)})})},e.prototype.clearEvents=function(){var t=this;C(this.steps,function(i,n){C(i,function(a){var o=t.getActionCallback(n,a);o&&t.offEvent(a.trigger,o)})})},e.prototype.initContext=function(){var t=this.view,i=new BA(t);this.context=i;var n=this.steps;C(n,function(a){C(a,function(o){if(X(o.action))o.actionObject={action:wA(o.action,i),methodName:"execute"};else if(Q(o.action))o.actionObject=gv(o.action,i,o.arg);else if(R(o.action)){var s=o.action,l=R(o.arg)?o.arg:[o.arg];o.actionObject=[],C(s,function(u,c){o.actionObject.push(gv(u,i,l[c]))})}})})},e.prototype.isAllowStep=function(t){var i=this.currentStepName,n=this.steps;if(i===t||t===ge.SHOW_ENABLE)return!0;if(t===ge.PROCESSING)return i===ge.START;if(t===ge.START)return i!==ge.PROCESSING;if(t===ge.END)return i===ge.PROCESSING||i===ge.START;if(t===ge.ROLLBACK){if(n[ge.END])return i===ge.END;if(i===ge.START)return!0}return!1},e.prototype.isAllowExecute=function(t,i){if(this.isAllowStep(t)){var n=this.getKey(t,i);return i.once&&this.emitCaches[n]?!1:i.isEnable?i.isEnable(this.context):!0}return!1},e.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},e.prototype.afterExecute=function(t,i){t!==ge.SHOW_ENABLE&&this.currentStepName!==t&&this.enterStep(t);var n=this.getKey(t,i);this.emitCaches[n]=!0},e.prototype.getKey=function(t,i){return t+i.trigger+i.action},e.prototype.getActionCallback=function(t,i){var n=this,a=this.context,o=this.callbackCaches,s=i.actionObject;if(i.action&&s){var l=this.getKey(t,i);if(!o[l]){var u=function(c){a.event=c,n.isAllowExecute(t,i)?(R(s)?C(s,function(h){a.event=c,yv(h)}):(a.event=c,yv(s)),n.afterExecute(t,i),i.callback&&(a.event=c,i.callback(a))):a.event=null};i.debounce?o[l]=vp(u,i.debounce.wait,i.debounce.immediate):i.throttle?o[l]=ec(u,i.throttle.wait,{leading:i.throttle.leading,trailing:i.throttle.trailing}):o[l]=u}return o[l]}return null},e.prototype.bindEvent=function(t,i){var n=t.split(":");n[0]==="window"?window.addEventListener(n[1],i):n[0]==="document"?document.addEventListener(n[1],i):this.view.on(t,i)},e.prototype.offEvent=function(t,i){var n=t.split(":");n[0]==="window"?window.removeEventListener(n[1],i):n[0]==="document"?document.removeEventListener(n[1],i):this.view.off(t,i)},e}(RA),yy={};function NA(r){return yy[vn(r)]}function it(r,e){yy[vn(r)]=e}function GA(r,e,t){var i=NA(r);if(!i)return null;if(Ze(i)){var n=mt(re(i),t);return new zA(e,n)}else{var a=i;return new a(e,t)}}function VA(r){return{title:{autoRotate:!0,position:"center",spacing:r.axisTitleSpacing,style:{fill:r.axisTitleTextFillColor,fontSize:r.axisTitleTextFontSize,lineHeight:r.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:r.fontFamily},iconStyle:{fill:r.axisDescriptionIconFillColor}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:r.axisLabelOffset,style:{fill:r.axisLabelFillColor,fontSize:r.axisLabelFontSize,lineHeight:r.axisLabelLineHeight,fontFamily:r.fontFamily}},line:{style:{lineWidth:r.axisLineBorder,stroke:r.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:r.axisGridBorderColor,lineWidth:r.axisGridBorder,lineDash:r.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:r.axisTickLineBorder,stroke:r.axisTickLineBorderColor},alignTick:!0,length:r.axisTickLineLength},subTickLine:null,animate:!0}}function YA(r){return{title:null,marker:{symbol:"circle",spacing:r.legendMarkerSpacing,style:{r:r.legendCircleMarkerSize,fill:r.legendMarkerColor}},itemName:{spacing:5,style:{fill:r.legendItemNameFillColor,fontFamily:r.fontFamily,fontSize:r.legendItemNameFontSize,lineHeight:r.legendItemNameLineHeight,fontWeight:r.legendItemNameFontWeight,textAlign:"start",textBaseline:"middle"}},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:"#D8D8D8"},markerStyle:{fill:"#D8D8D8",stroke:"#D8D8D8"}},inactive:{nameStyle:{fill:"#D8D8D8"},markerStyle:{opacity:.2}}},flipPage:!0,pageNavigator:{marker:{style:{size:r.legendPageNavigatorMarkerSize,inactiveFill:r.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:r.legendPageNavigatorMarkerInactiveFillOpacity,fill:r.legendPageNavigatorMarkerFillColor,opacity:r.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:r.legendPageNavigatorTextFillColor,fontSize:r.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:r.legendItemSpacing,itemMarginBottom:r.legendItemMarginBottom,padding:r.legendPadding}}function my(r){var e,t={point:{default:{fill:r.pointFillColor,r:r.pointSize,stroke:r.pointBorderColor,lineWidth:r.pointBorder,fillOpacity:r.pointFillOpacity},active:{stroke:r.pointActiveBorderColor,lineWidth:r.pointActiveBorder},selected:{stroke:r.pointSelectedBorderColor,lineWidth:r.pointSelectedBorder},inactive:{fillOpacity:r.pointInactiveFillOpacity,strokeOpacity:r.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:r.hollowPointFillColor,lineWidth:r.hollowPointBorder,stroke:r.hollowPointBorderColor,strokeOpacity:r.hollowPointBorderOpacity,r:r.hollowPointSize},active:{stroke:r.hollowPointActiveBorderColor,strokeOpacity:r.hollowPointActiveBorderOpacity},selected:{lineWidth:r.hollowPointSelectedBorder,stroke:r.hollowPointSelectedBorderColor,strokeOpacity:r.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:r.hollowPointInactiveBorderOpacity}},area:{default:{fill:r.areaFillColor,fillOpacity:r.areaFillOpacity,stroke:null},active:{fillOpacity:r.areaActiveFillOpacity},selected:{fillOpacity:r.areaSelectedFillOpacity},inactive:{fillOpacity:r.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:r.hollowAreaBorderColor,lineWidth:r.hollowAreaBorder,strokeOpacity:r.hollowAreaBorderOpacity},active:{fill:null,lineWidth:r.hollowAreaActiveBorder},selected:{fill:null,lineWidth:r.hollowAreaSelectedBorder},inactive:{strokeOpacity:r.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:r.intervalFillColor,fillOpacity:r.intervalFillOpacity},active:{stroke:r.intervalActiveBorderColor,lineWidth:r.intervalActiveBorder},selected:{stroke:r.intervalSelectedBorderColor,lineWidth:r.intervalSelectedBorder},inactive:{fillOpacity:r.intervalInactiveFillOpacity,strokeOpacity:r.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:r.hollowIntervalFillColor,stroke:r.hollowIntervalBorderColor,lineWidth:r.hollowIntervalBorder,strokeOpacity:r.hollowIntervalBorderOpacity},active:{stroke:r.hollowIntervalActiveBorderColor,lineWidth:r.hollowIntervalActiveBorder,strokeOpacity:r.hollowIntervalActiveBorderOpacity},selected:{stroke:r.hollowIntervalSelectedBorderColor,lineWidth:r.hollowIntervalSelectedBorder,strokeOpacity:r.hollowIntervalSelectedBorderOpacity},inactive:{stroke:r.hollowIntervalInactiveBorderColor,lineWidth:r.hollowIntervalInactiveBorder,strokeOpacity:r.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:r.lineBorderColor,lineWidth:r.lineBorder,strokeOpacity:r.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:r.lineActiveBorder},selected:{lineWidth:r.lineSelectedBorder},inactive:{strokeOpacity:r.lineInactiveBorderOpacity}}},i=VA(r),n=YA(r);return{background:r.backgroundColor,defaultColor:r.brandColor,subColor:r.subColor,semanticRed:r.paletteSemanticRed,semanticGreen:r.paletteSemanticGreen,padding:"auto",fontFamily:r.fontFamily,columnWidthRatio:1/2,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:r.paletteQualitative10,colors20:r.paletteQualitative20,sequenceColors:r.paletteSequence,shapes:{point:["hollow-circle","hollow-square","hollow-bowtie","hollow-diamond","hollow-hexagon","hollow-triangle","hollow-triangle-down","circle","square","bowtie","diamond","hexagon","triangle","triangle-down","cross","tick","plus","hyphen","line"],line:["line","dash","dot","smooth"],area:["area","smooth","line","smooth-line"],interval:["rect","hollow-rect","line","tick"]},sizes:[1,10],geometries:{interval:{rect:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:function(a){var o=a.geometry.coordinate;if(o.isPolar&&o.isTransposed){var s=fa(a.getModel(),o),l=s.startAngle,u=s.endAngle,c=(l+u)/2,h=7.5,f=h*Math.cos(c),v=h*Math.sin(c);return{matrix:Rt(null,[["t",f,v]])}}return t.interval.selected}}},"hollow-rect":{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},line:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},tick:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},funnel:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}},pyramid:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},line:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},dot:{default:{style:m(m({},t.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:m(m({},t.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:m(m({},t.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:m(m({},t.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:m(m({},t.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:m(m({},t.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:m(m({},t.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:m(m({},t.line.selected),{lineCap:null,lineDash:[5.5,1]})}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hvh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},polygon:{polygon:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},point:{circle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},square:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},bowtie:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},diamond:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},hexagon:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},triangle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"triangle-down":{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"hollow-circle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-square":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-bowtie":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-diamond":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-hexagon":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle-down":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},cross:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},tick:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},plus:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},hyphen:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},line:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}}},area:{area:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},smooth:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},line:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"smooth-line":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}},schema:{candle:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},box:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}}},edge:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},arc:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},violin:{violin:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hollow:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"hollow-smooth":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}}},components:{axis:{common:i,top:{position:"top",grid:null,title:null,verticalLimitLength:1/2},bottom:{position:"bottom",grid:null,title:null,verticalLimitLength:1/2},left:{position:"left",title:null,line:null,tickLine:null,verticalLimitLength:1/3},right:{position:"right",title:null,line:null,tickLine:null,verticalLimitLength:1/3},circle:{title:null,grid:H({},i.grid,{line:{type:"line"}})},radius:{title:null,grid:H({},i.grid,{line:{type:"circle"}})}},legend:{common:n,right:{layout:"vertical",padding:r.legendVerticalPadding},left:{layout:"vertical",padding:r.legendVerticalPadding},top:{layout:"horizontal",padding:r.legendHorizontalPadding},bottom:{layout:"horizontal",padding:r.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:r.sliderRailHeight,defaultLength:r.sliderRailWidth,style:{fill:r.sliderRailFillColor,stroke:r.sliderRailBorderColor,lineWidth:r.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:r.sliderLabelTextFillColor,fontSize:r.sliderLabelTextFontSize,lineHeight:r.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:r.fontFamily}},handler:{size:r.sliderHandlerWidth,style:{fill:r.sliderHandlerFillColor,stroke:r.sliderHandlerBorderColor}},slidable:!0,padding:n.padding}},tooltip:{showContent:!0,follow:!0,showCrosshairs:!1,showMarkers:!0,shared:!1,enterable:!1,position:"auto",marker:{symbol:"circle",stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,r:4},crosshairs:{line:{style:{stroke:r.tooltipCrosshairsBorderColor,lineWidth:r.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(e={},e["".concat(mr)]={position:"absolute",visibility:"hidden",zIndex:8,transition:"left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s",backgroundColor:r.tooltipContainerFillColor,opacity:r.tooltipContainerFillOpacity,boxShadow:r.tooltipContainerShadow,borderRadius:"".concat(r.tooltipContainerBorderRadius,"px"),color:r.tooltipTextFillColor,fontSize:"".concat(r.tooltipTextFontSize,"px"),fontFamily:r.fontFamily,lineHeight:"".concat(r.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},e["".concat(xr)]={marginBottom:"12px",marginTop:"12px"},e["".concat(ha)]={margin:0,listStyleType:"none",padding:0},e["".concat(Ps)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},e["".concat(Ds)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},e["".concat(Os)]={display:"inline-block",float:"right",marginLeft:"30px"},e)},annotation:{arc:{style:{stroke:r.annotationArcBorderColor,lineWidth:r.annotationArcBorder},animate:!0},line:{style:{stroke:r.annotationLineBorderColor,lineDash:r.annotationLineDash,lineWidth:r.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,textAlign:"start",fontFamily:r.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:r.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:r.annotationRegionBorder,stroke:r.annotationRegionBorderColor,fill:r.annotationRegionFillColor,fillOpacity:r.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:r.brandColor,lineWidth:2}},line:{style:{stroke:r.annotationLineBorderColor,lineWidth:r.annotationLineBorder},length:r.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,fontFamily:r.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:r.annotationRegionFillColor,fillOpacity:r.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:r.annotationTextFillColor,stroke:r.annotationTextBorderColor,lineWidth:r.annotationTextBorder,fontSize:r.annotationTextFontSize,fontFamily:r.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:r.cSliderBackgroundFillColor,opacity:r.cSliderBackgroundFillOpacity},foregroundStyle:{fill:r.cSliderForegroundFillColor,opacity:r.cSliderForegroundFillOpacity},handlerStyle:{width:r.cSliderHandlerWidth,height:r.cSliderHandlerHeight,fill:r.cSliderHandlerFillColor,opacity:r.cSliderHandlerFillOpacity,stroke:r.cSliderHandlerBorderColor,lineWidth:r.cSliderHandlerBorder,radius:r.cSliderHandlerBorderRadius,highLightFill:r.cSliderHandlerHighlightFillColor},textStyle:{fill:r.cSliderTextFillColor,opacity:r.cSliderTextFillOpacity,fontSize:r.cSliderTextFontSize,lineHeight:r.cSliderTextLineHeight,fontWeight:r.cSliderTextFontWeight,stroke:r.cSliderTextBorderColor,lineWidth:r.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:r.scrollbarTrackFillColor,thumbColor:r.scrollbarThumbFillColor}},hover:{style:{thumbColor:r.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:r.labelFillColor,fontSize:r.labelFontSize,fontFamily:r.fontFamily,stroke:r.labelBorderColor,lineWidth:r.labelBorder},fillColorDark:r.labelFillColorDark,fillColorLight:r.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:r.innerLabelFillColor,fontSize:r.innerLabelFontSize,fontFamily:r.fontFamily,stroke:r.innerLabelBorderColor,lineWidth:r.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:r.overflowLabelFillColor,fontSize:r.overflowLabelFontSize,fontFamily:r.fontFamily,stroke:r.overflowLabelBorderColor,lineWidth:r.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:r.labelLineBorder}},autoRotate:!0}}}var vt={100:"#000",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},Ri={100:"#FFFFFF",85:"#D9D9D9"},$A=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],HA=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],XA=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],xy=function(r){r===void 0&&(r={});var e=r.paletteQualitative10,t=e===void 0?$A:e,i=r.paletteQualitative20,n=i===void 0?HA:i,a=r.brandColor,o=a===void 0?t[0]:a,s={backgroundColor:"transparent",brandColor:o,subColor:"rgba(0,0,0,0.05)",paletteQualitative10:t,paletteQualitative20:n,paletteSemanticRed:"#F4664A",paletteSemanticGreen:"#30BF78",paletteSemanticYellow:"#FAAD14",paletteSequence:XA,fontFamily:`"Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"`,axisLineBorderColor:vt[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:vt[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:Ri[85],axisTickLineBorderColor:vt[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:vt[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:vt[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:vt[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:vt[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:o,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:vt[65],legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:vt[100],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:vt[100],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:vt[45],legendPageNavigatorTextFontSize:12,sliderRailFillColor:vt[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:vt[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:vt[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:vt[25],annotationArcBorderColor:vt[15],annotationArcBorder:1,annotationLineBorderColor:vt[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:vt[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:vt[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:vt[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:vt[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:vt[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:Ri[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:vt[65],overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:Ri[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:vt[25],cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#000",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(0,0,0,0)",scrollbarThumbFillColor:"rgba(0,0,0,0.15)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.2)",pointFillColor:o,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:Ri[100],pointBorderOpacity:1,pointActiveBorderColor:vt[100],pointSelectedBorder:2,pointSelectedBorderColor:vt[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:o,hollowPointBorderOpacity:.95,hollowPointFillColor:Ri[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:vt[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:vt[100],hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:o,lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:o,areaFillOpacity:.25,areaActiveFillColor:o,areaActiveFillOpacity:.5,areaSelectedFillColor:o,areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:o,hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:vt[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:vt[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:o,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:vt[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:vt[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:o,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:Ri[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:vt[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:vt[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return m(m({},s),r)};xy();function Zo(r){var e=r.styleSheet,t=e===void 0?{}:e,i=yt(r,["styleSheet"]),n=xy(t);return H({},my(n),i)}var WA=Zo({}),Au={default:WA};function Un(r){return A(Au,vn(r),Au.default)}function _A(r,e){Au[vn(r)]=Zo(e)}function mv(r,e,t){var i=t.translate(r),n=t.translate(e);return Xt(i,n)}function qA(r,e){var t=e.coordinate,i=e.getXScale(),n=i.range,a=n[n.length-1],o=n[0],s=t.invert(r),l=s.x;return t.isPolar&&l>(1+a)/2&&(l=o),i.translate(i.invert(l))}function xv(r,e,t){var i=t.coordinate,n=t.getYScale(),a=n.field,o=i.invert(e),s=n.invert(o.y),l=Ne(r,function(u){var c=u[bt];return c[a][0]<=s&&c[a][1]>=s});return l||r[r.length-1]}var UA=dn(function(r){if(r.isCategory)return 1;for(var e=r.values,t=e.length,i=r.translate(e[0]),n=i,a=0;an&&(n=s)}return(n-i)/(t-1)});function jA(r,e,t){var i=e.getAttribute("position"),n=i.getFields(),a=e.scales,o=X(t)||!t?n[0]:t,s=a[o],l=s?s.getText(r[o]):r[o]||o;return X(t)?t(l,r):l}function ZA(r){var e=us(r.attributes);return qt(e,function(t){return ai(Hi,t.type)})}function wy(r){var e,t,i=ZA(r),n;try{for(var a=ht(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=s.getScale(s.type);if(l&&l.isLinear){var u=A(r.scaleDefs,l.field),c=Kg(l,u,s.type,r.type);if(c!=="cat"){n=l;break}}}}catch(v){e={error:v}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}var h=r.getXScale(),f=r.getYScale();return n||f||h}function QA(r,e){var t=e.field,i=r[t];if(R(i)){var n=i.map(function(a){return e.getText(a)});return n.join("-")}return e.getText(i)}function KA(r,e){var t,i=e.getGroupScales();if(i.length&&(t=i[0]),t){var n=t.field;return t.getText(r[n])}var a=wy(e);return va(a)}function by(r,e,t){if(e.length===0)return null;var i=t.type,n=t.getXScale(),a=t.getYScale(),o=n.field,s=a.field,l=null;if(i==="heatmap"||i==="point"){for(var u=t.coordinate,c=u.invert(r),h=n.invert(c.x),f=a.invert(c.y),v=1/0,d=0;d=b)if(T)R(l)||(l=[]),l.push(L);else{l=L;break}}R(l)&&(l=xv(l,r,t))}else{var k=void 0;if(!n.isLinear&&n.type!=="timeCat"){for(var d=0;dn.translate(F)||bn.max||bMath.abs(n.translate(k[bt][o])-b)&&(w=k)}var q=UA(t.getXScale());return!l&&Math.abs(n.translate(w[bt][o])-b)<=q/2&&(l=w),l}function Ic(r,e,t,i){var n,a;t===void 0&&(t=""),i===void 0&&(i=!1);var o=r[bt],s=jA(o,e,t),l=e.tooltipOption,u=e.theme.defaultColor,c=[],h,f;function v(L,k){if(i||!B(k)&&k!==""){var I={title:s,data:o,mappingData:r,name:L,value:k,color:r.color||u,marker:!0};c.push(I)}}if(pt(l)){var d=l.fields,p=l.callback;if(p){var g=d.map(function(L){return r[bt][L]}),y=p.apply(void 0,Z([],U(g),!1)),x=m({data:r[bt],mappingData:r,title:s,color:r.color||u,marker:!0},y);c.push(x)}else{var w=e.scales;try{for(var b=ht(d),S=b.next();!S.done;S=b.next()){var M=S.value;if(!B(o[M])){var F=w[M];h=va(F),f=F.getText(o[M]),v(h,f)}}}catch(L){n={error:L}}finally{try{S&&!S.done&&(a=b.return)&&a.call(b)}finally{if(n)throw n.error}}}}else{var T=wy(e);f=QA(o,T),h=KA(o,e),v(h,f)}return c}function wv(r,e,t,i){var n,a,o=i.showNil,s=[],l=r.dataArray;if(!fe(l)){r.sort(l);try{for(var u=ht(l),c=u.next();!c.done;c=u.next()){var h=c.value,f=by(e,h,r);if(f){var v=r.getElementId(f),d=r.elementsMap[v];if(r.type==="heatmap"||d.visible){var p=Ic(f,r,t,o);p.length&&s.push(p)}}}}catch(g){n={error:g}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}}return s}function bv(r,e,t,i){var n=i.showNil,a=[],o=r.container,s=o.getShape(e.x,e.y);if(s&&s.get("visible")&&s.get("origin")){var l=s.get("origin").mappingData,u=Ic(l,r,t,n);u.length&&a.push(u)}return a}function Fu(r,e,t){var i,n,a=[],o=r.geometries,s=t.shared,l=t.title,u=t.reversed;try{for(var c=ht(o),h=c.next();!h.done;h=c.next()){var f=h.value;if(f.visible&&f.tooltipOption!==!1){var v=f.type,d=void 0;["point","edge","polygon"].includes(v)?d=bv(f,e,l,t):["area","line","path","heatmap"].includes(v)||s!==!1?d=wv(f,e,l,t):d=bv(f,e,l,t),d.length&&(u&&d.reverse(),a.push(d))}}}catch(p){i={error:p}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}return a}function JA(r,e,t){var i,n,a=Fu(r,e,t);try{for(var o=ht(r.views),s=o.next();!s.done;s=o.next()){var l=s.value;a=a.concat(Fu(l,e,t))}}catch(u){i={error:u}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function tF(r){return!rt(r)&&!R(r)}function Pc(r){r===void 0&&(r=0);var e=R(r)?r:[r];switch(e.length){case 0:e=[0,0,0,0];break;case 1:e=new Array(4).fill(e[0]);break;case 2:e=Z(Z([],U(e),!1),U(e),!1);break;case 3:e=Z(Z([],U(e),!1),[e[1]],!1);break;default:e=e.slice(0,4);break}return e}var Dc={};function Li(r,e){Dc[r]=e}function eF(){return Object.keys(Dc)}function rF(r){return Dc[r]}var iF=function(){function r(e){this.option=this.wrapperOption(e)}return r.prototype.update=function(e){return this.option=this.wrapperOption(e),this},r.prototype.hasAction=function(e){var t=this.option.actions;return ls(t,function(i){return i[0]===e})},r.prototype.create=function(e,t){var i=this.option,n=i.type,a=i.cfg,o=n==="theta",s=m({start:e,end:t},a),l=TC(o?"polar":n);return this.coordinate=new l(s),this.coordinate.type=n,o&&(this.hasAction("transpose")||this.transpose()),this.execActions(),this.coordinate},r.prototype.adjust=function(e,t){return this.coordinate.update({start:e,end:t}),this.coordinate.resetMatrix(),this.execActions(["scale","rotate","translate"]),this.coordinate},r.prototype.rotate=function(e){return this.option.actions.push(["rotate",e]),this},r.prototype.reflect=function(e){return this.option.actions.push(["reflect",e]),this},r.prototype.scale=function(e,t){return this.option.actions.push(["scale",e,t]),this},r.prototype.transpose=function(){return this.option.actions.push(["transpose"]),this},r.prototype.getOption=function(){return this.option},r.prototype.getCoordinate=function(){return this.coordinate},r.prototype.wrapperOption=function(e){return m({type:"rect",actions:[],cfg:{}},e)},r.prototype.execActions=function(e){var t=this,i=this.option.actions;C(i,function(n){var a,o=U(n),s=o[0],l=o.slice(1),u=B(e)?!0:e.includes(s);u&&(a=t.coordinate)[s].apply(a,Z([],U(l),!1))})},r}(),Tt=function(){function r(e,t,i){this.view=e,this.gEvent=t,this.data=i,this.type=t.type}return r.fromData=function(e,t,i){return new r(e,new Ta(t,{}),i)},Object.defineProperty(r.prototype,"target",{get:function(){return this.gEvent.target},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"event",{get:function(){return this.gEvent.originalEvent},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"x",{get:function(){return this.gEvent.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"y",{get:function(){return this.gEvent.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clientX",{get:function(){return this.gEvent.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"clientY",{get:function(){return this.gEvent.clientY},enumerable:!1,configurable:!0}),r.prototype.toString=function(){return"[Event (type=".concat(this.type,")]")},r.prototype.clone=function(){return new r(this.view,this.gEvent,this.data)},r}();function nF(r){var e=r.getController("axis"),t=r.getController("legend"),i=r.getController("annotation"),n=r.getController("slider"),a=r.getController("scrollbar");[e,n,a,t,i].forEach(function(o){o&&o.layout()})}var aF=function(){function r(){this.scales=new Map,this.syncScales=new Map}return r.prototype.createScale=function(e,t,i,n){var a=i,o=this.getScaleMeta(n);if(t.length===0&&o){var s=o.scale,l={type:s.type};s.isCategory&&(l.values=s.values),a=H(l,o.scaleDef,i)}var u=fA(e,t,a);return this.cacheScale(u,i,n),u},r.prototype.sync=function(e,t){var i=this;this.syncScales.forEach(function(n,a){var o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=[];C(n,function(u){var c=i.getScale(u);s=rt(c.max)?Math.max(s,c.max):s,o=rt(c.min)?Math.min(o,c.min):o,C(c.values,function(h){l.includes(h)||l.push(h)})}),C(n,function(u){var c=i.getScale(u);if(c.isContinuous)c.change({min:o,max:s,values:l});else if(c.isCategory){var h=c.range,f=i.getScaleMeta(u);l&&!A(f,["scaleDef","range"])&&(h=Jg(H({},c,{values:l}),e,t)),c.change({values:l,range:h})}})})},r.prototype.cacheScale=function(e,t,i){var n=this.getScaleMeta(i);n&&n.scale.type===e.type?(vA(n.scale,e),n.scaleDef=t):(n={key:i,scale:e,scaleDef:t},this.scales.set(i,n));var a=this.getSyncKey(n);if(n.syncKey=a,this.removeFromSyncScales(i),a){var o=this.syncScales.get(a);o||(o=[],this.syncScales.set(a,o)),o.push(i)}},r.prototype.getScale=function(e){var t=this.getScaleMeta(e);if(!t){var i=zt(e.split("-")),n=this.syncScales.get(i);n&&n.length&&(t=this.getScaleMeta(n[0]))}return t&&t.scale},r.prototype.deleteScale=function(e){var t=this.getScaleMeta(e);if(t){var i=t.syncKey,n=this.syncScales.get(i);if(n&&n.length){var a=n.indexOf(e);a!==-1&&n.splice(a,1)}}this.scales.delete(e)},r.prototype.clear=function(){this.scales.clear(),this.syncScales.clear()},r.prototype.removeFromSyncScales=function(e){var t=this;this.syncScales.forEach(function(i,n){var a=i.indexOf(e);if(a!==-1)return i.splice(a,1),i.length===0&&t.syncScales.delete(n),!1})},r.prototype.getSyncKey=function(e){var t=e.scale,i=e.scaleDef,n=t.field,a=A(i,["sync"]);return a===!0?n:a===!1?void 0:a},r.prototype.getScaleMeta=function(e){return this.scales.get(e)},r}(),Eo=function(){function r(e,t,i,n){e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),this.top=e,this.right=t,this.bottom=i,this.left=n}return r.instance=function(e,t,i,n){return e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=0),n===void 0&&(n=0),new r(e,t,i,n)},r.prototype.max=function(e){var t=U(e,4),i=t[0],n=t[1],a=t[2],o=t[3];return this.top=Math.max(this.top,i),this.right=Math.max(this.right,n),this.bottom=Math.max(this.bottom,a),this.left=Math.max(this.left,o),this},r.prototype.shrink=function(e){var t=U(e,4),i=t[0],n=t[1],a=t[2],o=t[3];return this.top+=i,this.right+=n,this.bottom+=a,this.left+=o,this},r.prototype.inc=function(e,t){var i=e.width,n=e.height;switch(t){case G.TOP:case G.TOP_LEFT:case G.TOP_RIGHT:this.top+=n;break;case G.RIGHT:case G.RIGHT_TOP:case G.RIGHT_BOTTOM:this.right+=i;break;case G.BOTTOM:case G.BOTTOM_LEFT:case G.BOTTOM_RIGHT:this.bottom+=n;break;case G.LEFT:case G.LEFT_TOP:case G.LEFT_BOTTOM:this.left+=i;break}return this},r.prototype.getPadding=function(){return[this.top,this.right,this.bottom,this.left]},r.prototype.clone=function(){return new(r.bind.apply(r,Z([void 0],U(this.getPadding()),!1)))},r}();function oF(r){var e=r.padding;if(!tF(e))return new(Eo.bind.apply(Eo,Z([void 0],U(Pc(e)),!1)));var t=r.viewBBox,i=new Eo,n=[],a=[],o=[];return C(r.getComponents(),function(s){var l=s.type;l===Gt.AXIS?n.push(s):[Gt.LEGEND,Gt.SLIDER,Gt.SCROLLBAR].includes(l)?a.push(s):l!==Gt.GRID&&l!==Gt.TOOLTIP&&o.push(s)}),C(n,function(s){var l=s.component,u=l.getLayoutBBox(),c=new ie(u.x,u.y,u.width,u.height),h=c.exceed(t);i.max(h)}),C(a,function(s){var l=s.component,u=s.direction,c=l.getLayoutBBox(),h=l.get("padding"),f=new ie(c.x,c.y,c.width,c.height).expand(h);i.inc(f,u)}),C(o,function(s){var l=s.component,u=s.direction,c=l.getLayoutBBox(),h=new ie(c.x,c.y,c.width,c.height);i.inc(h,u)}),i}function sF(r,e,t){var i=t.instance();e.forEach(function(n){n.autoPadding=i.max(n.autoPadding.getPadding())})}var Sy=function(r){E(e,r);function e(t){var i=r.call(this,{visible:t.visible})||this;i.views=[],i.geometries=[],i.controllers=[],i.interactions={},i.limitInPlot=!1,i.options={data:[],animate:!0},i.usedControllers=eF(),i.scalePool=new aF,i.layoutFunc=nF,i.isPreMouseInPlot=!1,i.isDataChanged=!1,i.isCoordinateChanged=!1,i.createdScaleKeys=new Map,i.onCanvasEvent=function(w){var b=w.name;if(!b.includes(":")){var S=i.createViewEvent(w);i.doPlotEvent(S),i.emit(b,S)}},i.onDelegateEvents=function(w){var b=w.name;if(b.includes(":")){var S=i.createViewEvent(w);i.emit(b,S)}};var n=t.id,a=n===void 0?Zr("view"):n,o=t.parent,s=t.canvas,l=t.backgroundGroup,u=t.middleGroup,c=t.foregroundGroup,h=t.region,f=h===void 0?{start:{x:0,y:0},end:{x:1,y:1}}:h,v=t.padding,d=t.appendPadding,p=t.theme,g=t.options,y=t.limitInPlot,x=t.syncViewPadding;return i.parent=o,i.canvas=s,i.backgroundGroup=l,i.middleGroup=u,i.foregroundGroup=c,i.region=f,i.padding=v,i.appendPadding=d,i.options=m(m({},i.options),g),i.limitInPlot=y,i.id=a,i.syncViewPadding=x,i.themeObject=pt(p)?H({},Un("default"),Zo(p)):Un(p),i.init(),i}return e.prototype.setLayout=function(t){this.layoutFunc=t},e.prototype.init=function(){this.calculateViewBBox(),this.initEvents(),this.initComponentController(),this.initOptions()},e.prototype.render=function(t,i){t===void 0&&(t=!1),this.emit(ot.BEFORE_RENDER,Tt.fromData(this,ot.BEFORE_RENDER,i)),this.paint(t),this.emit(ot.AFTER_RENDER,Tt.fromData(this,ot.AFTER_RENDER,i)),this.visible===!1&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this;this.emit(ot.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var i=this.geometries,n=0;n');k.appendChild(I);var O=$h(k,l,a,o),z=xw(f),Y=new z.Canvas(m({container:I,pixelRatio:v,localRefresh:p,supportCSSTransform:w},O));return i=r.call(this,{parent:null,canvas:Y,backgroundGroup:Y.addGroup({zIndex:_i.BG}),middleGroup:Y.addGroup({zIndex:_i.MID}),foregroundGroup:Y.addGroup({zIndex:_i.FORE}),padding:u,appendPadding:c,visible:y,options:M,limitInPlot:F,theme:T,syncViewPadding:L})||this,i.onResize=vp(function(){i.forceFit()},300),i.ele=k,i.canvas=Y,i.width=O.width,i.height=O.height,i.autoFit=l,i.localRefresh=p,i.renderer=f,i.wrapperElement=I,i.updateCanvasStyle(),i.bindAutoFit(),i.initDefaultInteractions(S),i}return e.prototype.initDefaultInteractions=function(t){var i=this;C(t,function(n){i.interaction(n)})},e.prototype.aria=function(t){var i="aria-label";t===!1?this.ele.removeAttribute(i):this.ele.setAttribute(i,t.label)},e.prototype.changeSize=function(t,i){return this.width===t&&this.height===i?this:(this.emit(ot.BEFORE_CHANGE_SIZE),this.width=t,this.height=i,this.canvas.changeSize(t,i),this.render(!0),this.emit(ot.AFTER_CHANGE_SIZE),this)},e.prototype.clear=function(){r.prototype.clear.call(this),this.aria(!1)},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),Fw(this.wrapperElement),this.wrapperElement=null},e.prototype.changeVisible=function(t){return r.prototype.changeVisible.call(this,t),this.wrapperElement.style.display=t?"":"none",this},e.prototype.forceFit=function(){if(!this.destroyed){var t=$h(this.ele,!0,this.width,this.height),i=t.width,n=t.height;this.changeSize(i,n)}},e.prototype.updateCanvasStyle=function(){Kt(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},e.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},e.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},e}(Sy),mn=function(){function r(e){this.visible=!0,this.components=[],this.view=e}return r.prototype.clear=function(e){C(this.components,function(t){t.component.destroy()}),this.components=[]},r.prototype.destroy=function(){this.clear()},r.prototype.getComponents=function(){return this.components},r.prototype.changeVisible=function(e){this.visible!==e&&(this.components.forEach(function(t){e?t.component.show():t.component.hide()}),this.visible=e)},r}();function uF(r){for(var e=[],t=function(n){var a=r[n],o=Ne(e,function(s){return s.color===a.color&&s.name===a.name&&s.value===a.value&&s.title===a.title});o||e.push(a)},i=0;i1){var b=u[0],S=Math.abs(t.y-b[0].y);try{for(var M=ht(u),F=M.next();!F.done;F=M.next()){var T=F.value,L=Math.abs(t.y-T[0].y);L<=S&&(b=T,S=L)}}catch(k){s={error:k}}finally{try{F&&!F.done&&(l=M.return)&&l.call(M)}finally{if(s)throw s.error}}u=[b]}return uF(we(u))}return[]},e.prototype.layout=function(){},e.prototype.update=function(){if(this.point&&this.showTooltip(this.point),this.tooltip){var t=this.view.getCanvas();this.tooltip.set("region",{start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}})}},e.prototype.isCursorEntered=function(t){if(this.tooltip){var i=this.tooltip.getContainer(),n=this.tooltip.get("capture");if(i&&n){var a=i.getBoundingClientRect(),o=a.x,s=a.y,l=a.width,u=a.height;return new ie(o,s,l,u).isPointIn(t)}}return!1},e.prototype.getTooltipCfg=function(){var t=this.view,i=t.getOptions().tooltip,n=this.processCustomContent(i),a=t.getTheme(),o=A(a,["components","tooltip"],{}),s=A(n,"enterable",o.enterable);return H({},o,n,{capture:!!(s||this.isLocked)})},e.prototype.processCustomContent=function(t){if(tn(t)||!A(t,"customContent"))return t;var i=t.customContent,n=function(a,o){var s=i(a,o)||"";return Q(s)?'
    '+s+"
    ":s};return m(m({},t),{customContent:n})},e.prototype.getTitle=function(t){var i=t[0].title||t[0].name;return this.title=i,i},e.prototype.renderTooltip=function(){var t=this.view.getCanvas(),i={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},n=this.getTooltipCfg(),a=new Bs(m(m({parent:t.get("el").parentNode,region:i},n),{visible:!1,crosshairs:null}));a.init(),this.tooltip=a},e.prototype.renderTooltipMarkers=function(t,i){var n,a,o=this.getTooltipMarkersGroup(),s=this.view.getRootView(),l=s.limitInPlot;try{for(var u=ht(t),c=u.next();!c.done;c=u.next()){var h=c.value,f=h.x,v=h.y;if(l||o!=null&&o.getClip()){var d=Tc(s.getCoordinate()),p=d.type,g=d.attrs;o==null||o.setClip({type:p,attrs:g})}else o==null||o.setClip(void 0);var y=this.view.getTheme(),x=A(y,["components","tooltip","marker"],{}),w=m(m({fill:h.color,symbol:"circle",shadowColor:h.color},X(i)?m(m({},x),i(h)):i),{x:f,y:v});o.addShape("marker",{attrs:w})}}catch(b){n={error:b}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}},e.prototype.renderCrosshairs=function(t,i){var n=A(i,["crosshairs","type"],"x");n==="x"?(this.yCrosshair&&this.yCrosshair.hide(),this.renderXCrosshairs(t,i)):n==="y"?(this.xCrosshair&&this.xCrosshair.hide(),this.renderYCrosshairs(t,i)):n==="xy"&&(this.renderXCrosshairs(t,i),this.renderYCrosshairs(t,i))},e.prototype.renderXCrosshairs=function(t,i){var n=this.getViewWithGeometry(this.view).getCoordinate(),a,o;if(n.isRect)n.isTransposed?(a={x:n.start.x,y:t.y},o={x:n.end.x,y:t.y}):(a={x:t.x,y:n.end.y},o={x:t.x,y:n.start.y});else{var s=nn(n,t),l=n.getCenter(),u=n.getRadius();o=Ot(l.x,l.y,u,s),a=l}var c=H({start:a,end:o,container:this.getTooltipCrosshairsGroup()},A(i,"crosshairs",{}),this.getCrosshairsText("x",t,i));delete c.type;var h=this.xCrosshair;h?h.update(c):(h=new Xg(c),h.init()),h.render(),h.show(),this.xCrosshair=h},e.prototype.renderYCrosshairs=function(t,i){var n=this.getViewWithGeometry(this.view).getCoordinate(),a,o;if(n.isRect){var s=void 0,l=void 0;n.isTransposed?(s={x:t.x,y:n.end.y},l={x:t.x,y:n.start.y}):(s={x:n.start.x,y:t.y},l={x:n.end.x,y:t.y}),a={start:s,end:l},o="Line"}else a={center:n.getCenter(),radius:Rs(n,t),startAngle:n.startAngle,endAngle:n.endAngle},o="Circle";a=H({container:this.getTooltipCrosshairsGroup()},a,A(i,"crosshairs",{}),this.getCrosshairsText("y",t,i)),delete a.type;var u=this.yCrosshair;u?n.isRect&&u.get("type")==="circle"||!n.isRect&&u.get("type")==="line"?(u=new iv[o](a),u.init()):u.update(a):(u=new iv[o](a),u.init()),u.render(),u.show(),this.yCrosshair=u},e.prototype.getCrosshairsText=function(t,i,n){var a=A(n,["crosshairs","text"]),o=A(n,["crosshairs","follow"]),s=this.items;if(a){var l=this.getViewWithGeometry(this.view),u=s[0],c=l.getXScale(),h=l.getYScales()[0],f=void 0,v=void 0;if(o){var d=this.view.getCoordinate().invert(i);f=c.invert(d.x),v=h.invert(d.y)}else f=u.data[c.field],v=u.data[h.field];var p=t==="x"?f:v;return X(a)?a=a(t,p,s,i):a.content=p,{text:a}}},e.prototype.getGuideGroup=function(){if(!this.guideGroup){var t=this.view.foregroundGroup;this.guideGroup=t.addGroup({name:"tooltipGuide",capture:!1})}return this.guideGroup},e.prototype.getTooltipMarkersGroup=function(){var t=this.tooltipMarkersGroup;return t&&!t.destroyed?(t.clear(),t.show()):(t=this.getGuideGroup().addGroup({name:"tooltipMarkersGroup"}),t.toFront(),this.tooltipMarkersGroup=t),t},e.prototype.getTooltipCrosshairsGroup=function(){var t=this.tooltipCrosshairsGroup;return t||(t=this.getGuideGroup().addGroup({name:"tooltipCrosshairsGroup",capture:!1}),t.toBack(),this.tooltipCrosshairsGroup=t),t},e.prototype.findItemsFromView=function(t,i){var n,a;if(t.getOptions().tooltip===!1)return[];var o=this.getTooltipCfg(),s=Fu(t,i,o);try{for(var l=ht(t.views),u=l.next();!u.done;u=l.next()){var c=u.value;s=s.concat(this.findItemsFromView(c,i))}}catch(h){n={error:h}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(n)throw n.error}}return s},e.prototype.getViewWithGeometry=function(t){var i=this;return t.geometries.length?t:Ne(t.views,function(n){return i.getViewWithGeometry(n)})},e.prototype.getItemsAfterProcess=function(t){var i=this.getTooltipCfg().customItems,n=i||function(a){return a};return n(t)},e}(mn),My={};function Ay(r){return My[r.toLowerCase()]}function Se(r,e){My[r.toLowerCase()]=e}var on={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},cF={interval:function(r){return{enter:{animation:r.isRect?r.isTransposed?"scale-in-x":"scale-in-y":"fade-in"},update:{animation:r.isPolar&&r.isTransposed?"sector-path-update":null},leave:{animation:"fade-out"}}},line:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},path:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},point:{appear:{animation:"zoom-in"},enter:{animation:"zoom-in"},leave:{animation:"zoom-out"}},area:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},polygon:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},schema:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},edge:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},label:{appear:{animation:"fade-in",delay:450},enter:{animation:"fade-in"},update:{animation:"position-update"},leave:{animation:"fade-out"}}},Sv={line:function(){return{animation:"wave-in"}},area:function(){return{animation:"wave-in"}},path:function(){return{animation:"fade-in"}},interval:function(r){var e;return r.isRect?e=r.isTransposed?"grow-in-x":"grow-in-y":(e="grow-in-xy",r.isPolar&&r.isTransposed&&(e="wave-in")),{animation:e}},schema:function(r){var e;return r.isRect?e=r.isTransposed?"grow-in-x":"grow-in-y":e="grow-in-xy",{animation:e}},polygon:function(){return{animation:"fade-in",duration:500}},edge:function(){return{animation:"fade-in"}}};function hF(r,e){return{delay:X(r.delay)?r.delay(e):r.delay,easing:X(r.easing)?r.easing(e):r.easing,duration:X(r.duration)?r.duration(e):r.duration,callback:r.callback,repeat:r.repeat}}function Fy(r,e,t){var i=cF[r];return i&&(X(i)&&(i=i(e)),i=H({},on,i)),i}function ji(r,e,t){var i=A(r.get("origin"),"data",bt),n=e.animation,a=hF(e,i);if(n){var o=Ay(n);o&&o(r,a,t)}else r.animate(t.toAttrs,a)}function fF(r,e,t,i,n){if(Sv[t]){var a=Sv[t](i),o=Ay(A(a,"animation",""));if(o){var s=m(m(m({},on.appear),a),e);r.stopAnimate(),o(r,s,{coordinate:i,minYPoint:n,toAttrs:null})}}}var Oc="element-background",Ty=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;i.labelShape=[],i.states=[];var n=t.shapeFactory,a=t.container,o=t.offscreenGroup,s=t.elementIndex,l=t.visible,u=l===void 0?!0:l;return i.shapeFactory=n,i.container=a,i.offscreenGroup=o,i.visible=u,i.elementIndex=s,i}return e.prototype.draw=function(t,i){i===void 0&&(i=!1),this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.drawShape(t,i),this.visible===!1&&this.changeVisible(!1)},e.prototype.update=function(t){var i=this,n=i.shapeFactory,a=i.shape;if(a){this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.setShapeInfo(a,t);var o=this.getOffscreenGroup(),s=n.drawShape(this.shapeType,t,o);s.cfg.data=this.data,s.cfg.origin=t,s.cfg.element=this,this.syncShapeStyle(a,s,this.getStates(),this.getAnimateCfg("update"))}},e.prototype.destroy=function(){var t=this,i=t.shapeFactory,n=t.shape;if(n){var a=this.getAnimateCfg("leave");a?ji(n,a,{coordinate:i.coordinate,toAttrs:m({},n.attr())}):n.remove(!0)}this.states=[],this.shapeFactory=void 0,this.container=void 0,this.shape=void 0,this.animate=void 0,this.geometry=void 0,this.labelShape=[],this.model=void 0,this.data=void 0,this.offscreenGroup=void 0,this.statesStyle=void 0,r.prototype.destroy.call(this)},e.prototype.changeVisible=function(t){r.prototype.changeVisible.call(this,t),t?(this.shape&&this.shape.show(),this.labelShape&&this.labelShape.forEach(function(i){i.show()})):(this.shape&&this.shape.hide(),this.labelShape&&this.labelShape.forEach(function(i){i.hide()}))},e.prototype.setState=function(t,i){var n=this,a=n.states,o=n.shapeFactory,s=n.model,l=n.shape,u=n.shapeType,c=a.indexOf(t);if(i){if(c>-1)return;a.push(t),(t==="active"||t==="selected")&&(l==null||l.toFront())}else{if(c===-1)return;if(a.splice(c,1),t==="active"||t==="selected"){var h=this.geometry,f=h.sortZIndex,v=h.zIndexReversed,d=v?this.geometry.elements.length-this.elementIndex:this.elementIndex;f?l.setZIndex(d):l.set("zIndex",d)}}var p=o.drawShape(u,s,this.getOffscreenGroup());a.length?this.syncShapeStyle(l,p,a,null):this.syncShapeStyle(l,p,["reset"],null),p.remove(!0);var g={state:t,stateStatus:i,element:this,target:this.container};this.container.emit("statechange",g),Lg(this.shape,"statechange",g)},e.prototype.clearStates=function(){var t=this,i=this.states;C(i,function(n){t.setState(n,!1)}),this.states=[]},e.prototype.hasState=function(t){return this.states.includes(t)},e.prototype.getStates=function(){return this.states},e.prototype.getData=function(){return this.data},e.prototype.getModel=function(){return this.model},e.prototype.getBBox=function(){var t=this,i=t.shape,n=t.labelShape,a={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return i&&(a=i.getCanvasBBox()),n&&n.forEach(function(o){var s=o.getCanvasBBox();a.x=Math.min(s.x,a.x),a.y=Math.min(s.y,a.y),a.minX=Math.min(s.minX,a.minX),a.minY=Math.min(s.minY,a.minY),a.maxX=Math.max(s.maxX,a.maxX),a.maxY=Math.max(s.maxY,a.maxY)}),a.width=a.maxX-a.minX,a.height=a.maxY-a.minY,a},e.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this,i=t.shapeType,n=t.geometry,a=t.shapeFactory,o=n.stateOption,s=a.defaultShapeType,l=a.theme[i]||a.theme[s];this.statesStyle=H({},l,o)}return this.statesStyle},e.prototype.getStateStyle=function(t,i){var n=this.getStatesStyle(),a=A(n,[t,"style"],{}),o=a[i]||a;return X(o)?o(this):o},e.prototype.getAnimateCfg=function(t){var i=this,n=this.animate;if(n){var a=n[t];return a&&m(m({},a),{callback:function(){var o;X(a.callback)&&a.callback(),(o=i.geometry)===null||o===void 0||o.emit(Br.AFTER_DRAW_ANIMATE)}})}return null},e.prototype.drawShape=function(t,i){var n;i===void 0&&(i=!1);var a=this,o=a.shapeFactory,s=a.container,l=a.shapeType;if(this.shape=o.drawShape(l,t,s),this.shape){this.setShapeInfo(this.shape,t);var u=this.shape.cfg.name;u?Q(u)&&(this.shape.cfg.name=["element",u]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var c=i?"enter":"appear",h=this.getAnimateCfg(c);h&&((n=this.geometry)===null||n===void 0||n.emit(Br.BEFORE_DRAW_ANIMATE),ji(this.shape,h,{coordinate:o.coordinate,toAttrs:m({},this.shape.attr())}))}},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.setShapeInfo=function(t,i){var n=this;if(t.cfg.origin=i,t.cfg.element=this,t.isGroup()){var a=t.get("children");a.forEach(function(o){n.setShapeInfo(o,i)})}},e.prototype.syncShapeStyle=function(t,i,n,a,o){var s=this,l;if(n===void 0&&(n=[]),o===void 0&&(o=0),!(!t||!i)){var u=t.get("clipShape"),c=i.get("clipShape");if(this.syncShapeStyle(u,c,n,a),t.isGroup())for(var h=t.get("children"),f=i.get("children"),v=0;v=0?a=i:n<=0?a=n:a=0,a},e.prototype.createAttrOption=function(t,i,n){if(B(i)||pt(i))pt(i)&&Pt(Object.keys(i),["values"])?Bt(this.attributeOption,t,{fields:i.values}):Bt(this.attributeOption,t,i);else{var a={};rt(i)?a.values=[i]:a.fields=kn(i),n&&(X(n)?a.callback=n:a.values=n),Bt(this.attributeOption,t,a)}},e.prototype.initAttributes=function(){var t=this,i=this,n=i.attributes,a=i.attributeOption,o=i.theme,s=i.shapeType;this.groupScales=[];var l={},u=function(f){if(a.hasOwnProperty(f)){var v=a[f];if(!v)return{value:void 0};var d=m({},v),p=d.callback,g=d.values,y=d.fields,x=y===void 0?[]:y,w=x.map(function(S){var M=t.scales[S];if(!l[S]&&Hi.includes(f)){var F=Kg(M,A(t.scaleDefs,S),f,t.type);F==="cat"&&(t.groupScales.push(M),l[S]=!0)}return M});d.scales=w,f!=="position"&&w.length===1&&w[0].type==="identity"?d.values=w[0].values:!p&&!g&&(f==="size"?d.values=o.sizes:f==="shape"?d.values=o.shapes[s]||[]:f==="color"&&(w.length?d.values=w[0].values.length<=10?o.colors10:o.colors20:d.values=o.colors10));var b=Tg(f);n[f]=new b(d)}};for(var c in a){var h=u(c);if(typeof h=="object")return h.value}},e.prototype.processData=function(t){var i,n;this.hasSorted=!1;for(var a=this.getAttribute("position").scales,o=a.filter(function(F){return F.isCategory}),s=this.groupData(t),l=[],u=0,c=s.length;us&&(s=h)}var f=this.scaleDefs,v={};ot.max&&!A(f,[a,"max"])&&(v.max=s),t.change(v)},e.prototype.beforeMapping=function(t){var i=t;if(this.sortable&&this.sort(i),this.generatePoints)for(var n=0,a=i.length;n1)for(var f=0;f0})}function Dy(r,e,t){var i=t.data,n=t.origin,a=t.animateCfg,o=t.coordinate,s=A(a,"update");r.set("data",i),r.set("origin",n),r.set("animateCfg",a),r.set("coordinate",o),r.set("visible",e.get("visible")),(r.getChildren()||[]).forEach(function(l,u){var c=e.getChildByIndex(u);if(!c)r.removeChild(l),l.remove(!0);else{l.set("data",i),l.set("origin",n),l.set("animateCfg",a),l.set("coordinate",o);var h=Qg(l,c);s?ji(l,s,{toAttrs:h,coordinate:o}):l.attr(h),c.isGroup()&&Dy(l,c,t)}}),C(e.getChildren(),function(l,u){R(r.getChildren())&&u>=r.getCount()&&(l.destroyed||r.add(l))})}var SF=function(){function r(e){this.shapesMap={};var t=e.layout,i=e.container;this.layout=t,this.container=i}return r.prototype.render=function(e,t,i){return i===void 0&&(i=!1),ta(this,void 0,void 0,function(){var n,a,o,s,l,u,c,h,f=this;return ea(this,function(v){switch(v.label){case 0:if(n={},a=this.createOffscreenGroup(),!e.length)return[3,2];try{for(o=ht(e),s=o.next();!s.done;s=o.next())l=s.value,l&&(n[l.id]=this.renderLabel(l,a))}catch(d){c={error:d}}finally{try{s&&!s.done&&(h=o.return)&&h.call(o)}finally{if(c)throw c.error}}return[4,this.doLayout(e,t,n)];case 1:v.sent(),this.renderLabelLine(e,n),this.renderLabelBackground(e,n),this.adjustLabel(e,n),v.label=2;case 2:return u=this.shapesMap,C(n,function(d,p){if(d.destroyed)delete n[p];else{if(u[p]){var g=d.get("data"),y=d.get("origin"),x=d.get("coordinate"),w=d.get("animateCfg"),b=u[p];Dy(b,n[p],{data:g,origin:y,animateCfg:w,coordinate:x}),n[p]=b}else{if(f.container.destroyed)return;f.container.add(d);var S=A(d.get("animateCfg"),i?"enter":"appear");S&&ji(d,S,{toAttrs:m({},d.attr()),coordinate:d.get("coordinate")})}delete u[p]}}),C(u,function(d){var p=A(d.get("animateCfg"),"leave");p?ji(d,p,{toAttrs:null,coordinate:d.get("coordinate")}):d.remove(!0)}),this.shapesMap=n,a.destroy(),[2]}})})},r.prototype.clear=function(){this.container.clear(),this.shapesMap={}},r.prototype.destroy=function(){this.container.destroy(),this.shapesMap=null},r.prototype.renderLabel=function(e,t){var i=e.id,n=e.elementId,a=e.data,o=e.mappingData,s=e.coordinate,l=e.animate,u=e.content,c=e.capture,h={id:i,elementId:n,capture:c,data:a,origin:m(m({},o),{data:o[bt]}),coordinate:s},f=t.addGroup(m({name:"label",animateCfg:this.animate===!1||l===null||l===!1?!1:H({},this.animate,l)},h)),v;if(u.isGroup&&u.isGroup()||u.isShape&&u.isShape()){var d=u.getCanvasBBox(),p=d.width,g=d.height,y=A(e,"textAlign","left"),x=e.x,w=e.y-g/2;y==="center"?x=x-p/2:(y==="right"||y==="end")&&(x=x-p),Oa(u,x,w),v=u,f.add(u)}else{var b=A(e,["style","fill"]);v=f.addShape("text",m({attrs:m(m({x:e.x,y:e.y,textAlign:e.textAlign,textBaseline:A(e,"textBaseline","middle"),text:e.content},e.style),{fill:ow(b)?e.color:b})},h))}return e.rotate&&Rc(v,e.rotate),f},r.prototype.doLayout=function(e,t,i){return ta(this,void 0,void 0,function(){var n,a=this;return ea(this,function(o){switch(o.label){case 0:return this.layout?(n=R(this.layout)?this.layout:[this.layout],[4,Promise.all(n.map(function(s){var l=dF(A(s,"type",""));if(l){var u=[],c=[];return C(i,function(h,f){u.push(h),c.push(t[h.get("elementId")])}),l(e,u,c,a.region,s.cfg)}}))]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})},r.prototype.renderLabelLine=function(e,t){C(e,function(i){var n=A(i,"coordinate");if(!(!i||!n)){var a=n.getCenter(),o=n.getRadius();if(i.labelLine){var s=A(i,"labelLine",{}),l=i.id,u=s.path;if(!u){var c=Ot(a.x,a.y,o,i.angle);u=[["M",c.x,c.y],["L",i.x,i.y]]}var h=t[l];h.destroyed||h.addShape("path",{capture:!1,attrs:m({path:u,stroke:i.color?i.color:A(i,["style","fill"],"#000"),fill:null},s.style),id:l,origin:i.mappingData,data:i.data,coordinate:i.coordinate})}}})},r.prototype.renderLabelBackground=function(e,t){C(e,function(i){var n=A(i,"coordinate"),a=A(i,"background");if(!(!a||!n)){var o=i.id,s=t[o];if(!s.destroyed){var l=s.getChildren()[0];if(l){var u=Py(s,i,a.padding),c=u.rotation,h=yt(u,["rotation"]),f=s.addShape("rect",{attrs:m(m({},h),a.style||{}),id:o,origin:i.mappingData,data:i.data,coordinate:i.coordinate});if(f.setZIndex(-1),c){var v=l.getMatrix();f.setMatrix(v)}}}}})},r.prototype.createOffscreenGroup=function(){var e=this.container,t=e.getGroupBase(),i=new t({});return i},r.prototype.adjustLabel=function(e,t){C(e,function(i){if(i){var n=i.id,a=t[n];if(!a.destroyed){var o=a.findAll(function(s){return s.get("type")!=="path"});C(o,function(s){s&&(i.offsetX&&s.attr("x",s.attr("x")+i.offsetX),i.offsetY&&s.attr("y",s.attr("y")+i.offsetY))})}}})},r}();function Mv(r){var e=0;return C(r,function(t){e+=t}),e/r.length}var Ys=function(){function r(e){this.geometry=e}return r.prototype.getLabelItems=function(e){var t=this,i=[],n=this.getLabelCfgs(e);return C(e,function(a,o){var s=n[o];if(!s||B(a.x)||B(a.y)){i.push(null);return}var l=R(s.content)?s.content:[s.content];s.content=l;var u=l.length;C(l,function(c,h){if(B(c)||c===""){i.push(null);return}var f=m(m({},s),t.getLabelPoint(s,a,h));f.textAlign||(f.textAlign=t.getLabelAlign(f,h,u)),f.offset<=0&&(f.labelLine=null),i.push(f)})}),i},r.prototype.render=function(e,t){return t===void 0&&(t=!1),ta(this,void 0,void 0,function(){var i,n,a;return ea(this,function(o){switch(o.label){case 0:return i=this.getLabelItems(e),n=this.getLabelsRenderer(),a=this.getGeometryShapes(),[4,n.render(i,a,t)];case 1:return o.sent(),[2]}})})},r.prototype.clear=function(){var e=this.labelsRenderer;e&&e.clear()},r.prototype.destroy=function(){var e=this.labelsRenderer;e&&e.destroy(),this.labelsRenderer=null},r.prototype.getCoordinate=function(){return this.geometry.coordinate},r.prototype.getDefaultLabelCfg=function(e,t){var i=this.geometry,n=i.type,a=i.theme;return n==="polygon"||n==="interval"&&t==="middle"||e<0&&!["line","point","path"].includes(n)?A(a,"innerLabels",{}):A(a,"labels",{})},r.prototype.getThemedLabelCfg=function(e){var t=this.geometry,i=this.getDefaultLabelCfg(),n=t.type,a=t.theme,o;return n==="polygon"||e.offset<0&&!["line","point","path"].includes(n)?o=H({},i,a.innerLabels,e):o=H({},i,a.labels,e),o},r.prototype.setLabelPosition=function(e,t,i,n){},r.prototype.getLabelOffset=function(e){var t=this.getCoordinate(),i=this.getOffsetVector(e);return t.isTransposed?i[0]:i[1]},r.prototype.getLabelOffsetPoint=function(e,t,i){var n=e.offset,a=this.getCoordinate(),o=a.isTransposed,s=o?"x":"y",l=o?1:-1,u={x:0,y:0};return t>0||i===1?u[s]=n*l:u[s]=n*l*-1,u},r.prototype.getLabelPoint=function(e,t,i){var n=this.getCoordinate(),a=e.content.length;function o(g,y,x){x===void 0&&(x=!1);var w=g;return R(w)&&(e.content.length===1?x?w=Mv(w):w.length<=2?w=w[g.length-1]:w=Mv(w):w=w[y]),w}var s={content:e.content[i],x:0,y:0,start:{x:0,y:0},color:"#fff"},l=R(t.shape)?t.shape[0]:t.shape,u=l==="funnel"||l==="pyramid";if(this.geometry.type==="polygon"){var c=nA(t.x,t.y);s.x=c[0],s.y=c[1]}else this.geometry.type==="interval"&&!u?(s.x=o(t.x,i,!0),s.y=o(t.y,i)):(s.x=o(t.x,i),s.y=o(t.y,i));if(u){var h=A(t,"nextPoints"),f=A(t,"points");if(h){var v=n.convert(f[1]),d=n.convert(h[1]);s.x=(v.x+d.x)/2,s.y=(v.y+d.y)/2}else if(l==="pyramid"){var v=n.convert(f[1]),d=n.convert(f[2]);s.x=(v.x+d.x)/2,s.y=(v.y+d.y)/2}}e.position&&this.setLabelPosition(s,t,i,e.position);var p=this.getLabelOffsetPoint(e,i,a);return s.start={x:s.x,y:s.y},s.x+=p.x,s.y+=p.y,s.color=t.color,s},r.prototype.getLabelAlign=function(e,t,i){var n="center",a=this.getCoordinate();if(a.isTransposed){var o=e.offset;o<0?n="right":o===0?n="center":n="left",i>1&&t===0&&(n==="right"?n="left":n==="left"&&(n="right"))}return n},r.prototype.getLabelId=function(e){var t=this.geometry,i=t.type,n=t.getXScale(),a=t.getYScale(),o=e[bt],s=t.getElementId(e);return i==="line"||i==="area"?s+=" ".concat(o[n.field]):i==="path"&&(s+=" ".concat(o[n.field],"-").concat(o[a.field])),s},r.prototype.getLabelsRenderer=function(){var e=this.geometry,t=e.labelsContainer,i=e.labelOption,n=e.canvasRegion,a=e.animateOption,o=this.geometry.coordinate,s=this.labelsRenderer;return s||(s=new SF({container:t,layout:A(i,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=s),s.region=n,s.animate=a?Fy("label",o):!1,s},r.prototype.getLabelCfgs=function(e){var t=this,i=this.geometry,n=i.labelOption,a=i.scales,o=i.coordinate,s=n,l=s.fields,u=s.callback,c=s.cfg,h=l.map(function(v){return a[v]}),f=[];return C(e,function(v,d){var p=v[bt],g=t.getLabelText(p,h),y;if(u){var x=l.map(function(F){return p[F]});if(y=u.apply(void 0,Z([],U(x),!1)),B(y)){f.push(null);return}}var w=m(m({id:t.getLabelId(v),elementId:t.geometry.getElementId(v),data:p,mappingData:v,coordinate:o},c),y);X(w.position)&&(w.position=w.position(p,v,d));var b=t.getLabelOffset(w.offset||0),S=t.getDefaultLabelCfg(b,w.position);w=H({},S,w),w.offset=t.getLabelOffset(w.offset||0);var M=w.content;X(M)?w.content=M(p,v,d):si(M)&&(w.content=g[0]),f.push(w)}),f},r.prototype.getLabelText=function(e,t){var i=[];return C(t,function(n){var a=e[n.field];R(a)?a=a.map(function(o){return n.getText(o)}):a=n.getText(a),B(a)||a===""?i.push(null):i.push(a)}),i},r.prototype.getOffsetVector=function(e){e===void 0&&(e=0);var t=this.getCoordinate(),i=0;return rt(e)&&(i=e),t.isTransposed?t.applyMatrix(i,0):t.applyMatrix(0,i)},r.prototype.getGeometryShapes=function(){var e=this.geometry,t={};return C(e.elementsMap,function(i,n){t[n]=i.shape}),C(e.getOffscreenGroup().getChildren(),function(i){var n=e.getElementId(i.get("origin").mappingData);t[n]=i}),t},r}();function Tu(r,e,t){if(!r)return t;var i;if(r.callback&&r.callback.length>1){var n=Array(r.callback.length-1).fill("");i=r.mapping.apply(r,Z([e],U(n),!1)).join("")}else i=r.mapping(e).join("");return i||t}var Ai={hexagon:function(r,e,t){var i=t/2*Math.sqrt(3);return[["M",r,e-t],["L",r+i,e-t/2],["L",r+i,e+t/2],["L",r,e+t],["L",r-i,e+t/2],["L",r-i,e-t/2],["Z"]]},bowtie:function(r,e,t){var i=t-1.5;return[["M",r-t,e-i],["L",r+t,e+i],["L",r+t,e-i],["L",r-t,e+i],["Z"]]},cross:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e+t],["M",r+t,e-t],["L",r-t,e+t]]},tick:function(r,e,t){return[["M",r-t/2,e-t],["L",r+t/2,e-t],["M",r,e-t],["L",r,e+t],["M",r-t/2,e+t],["L",r+t/2,e+t]]},plus:function(r,e,t){return[["M",r-t,e],["L",r+t,e],["M",r,e-t],["L",r,e+t]]},hyphen:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},line:function(r,e,t){return[["M",r,e-t],["L",r,e+t]]}},CF=["line","cross","tick","plus","hyphen"];function MF(r,e){return X(e)?e(r):H({},r,e)}function AF(r,e){var t=r.symbol;if(Q(t)&&CF.indexOf(t)!==-1){var i=A(r,"style",{}),n=A(i,"lineWidth",1),a=i.stroke||i.fill||e;r.style=H({},r.style,{lineWidth:n,stroke:a,fill:null})}}function Oy(r){var e=r.symbol;Q(e)&&Ai[e]&&(r.symbol=Ai[e])}function El(r){return r.startsWith(G.LEFT)||r.startsWith(G.RIGHT)?"vertical":"horizontal"}function By(r,e,t,i,n){var a=t.getScale(t.type);if(a.isCategory){var o=a.field,s=e.getAttribute("color"),l=e.getAttribute("shape"),u=r.getTheme().defaultColor,c=e.coordinate.isPolar;return a.getTicks().map(function(h,f){var v,d=h.text,p=h.value,g=d,y=a.invert(p),x=r.filterFieldData(o,[(v={},v[o]=y,v)]).length===0;C(r.views,function(F){var T;F.filterFieldData(o,[(T={},T[o]=y,T)]).length||(x=!0)});var w=Tu(s,y,u),b=Tu(l,y,"point"),S=e.getShapeMarker(b,{color:w,isInPolar:c}),M=n;return X(M)&&(M=M(g,f,m({name:g,value:y},H({},i,S)))),S=H({},i,S,le(m({},M),["style"])),AF(S,w),M&&M.style&&(S.style=MF(S.style,M.style)),Oy(S),{id:y,name:g,value:y,marker:S,unchecked:x}})}return[]}function FF(r,e,t){return t.map(function(i,n){var a=e;X(a)&&(a=a(i.name,n,H({},r,i)));var o=X(i.marker)?i.marker(i.name,n,H({},r,i)):i.marker,s=H({},r,a,o);return Oy(s),i.marker=s,i})}function Av(r,e){var t=A(r,["components","legend"],{});return H({},A(t,["common"],{}),H({},A(t,[e],{})))}function kl(r){return r?!1:r==null||isNaN(r)}function Fv(r){if(R(r))return kl(r[1].y);var e=r.y;return R(e)?kl(e[0]):kl(e)}function $s(r,e,t){if(e===void 0&&(e=!1),t===void 0&&(t=!0),!r.length||r.length===1&&!t)return[];if(e){for(var i=[],n=0,a=r.length;n=r&&n<=r+t&&a>=e&&a<=e+i}function ga(r,e){return!(e.minX>r.maxX||e.maxXr.maxY||e.maxY=0&&n<1/2*Math.PI?(s={x:o.minX,y:o.minY},l={x:o.maxX,y:o.maxY}):1/2*Math.PI<=n&&n1&&(t*=Math.sqrt(v),i*=Math.sqrt(v));var d=t*t*(f*f)+i*i*(h*h),p=d?Math.sqrt((t*t*(i*i)-d)/d):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var g=i?p*t*f/i:0,y=t?p*-i*h/t:0,x=(s+u)/2+Math.cos(n)*g-Math.sin(n)*y,w=(l+c)/2+Math.sin(n)*g+Math.cos(n)*y,b=[(h-g)/t,(f-y)/i],S=[(-1*h-g)/t,(-1*f-y)/i],M=Ev([1,0],b),F=Ev(b,S);return ku(b,S)<=-1&&(F=Math.PI),ku(b,S)>=1&&(F=0),o===0&&F>0&&(F=F-2*Math.PI),o===1&&F<0&&(F=F+2*Math.PI),{cx:x,cy:w,rx:Tv(r,[u,c])?0:t,ry:Tv(r,[u,c])?0:i,startAngle:M,endAngle:M+F,xRotation:n,arcFlag:a,sweepFlag:o}}var Ko=Math.sin,Jo=Math.cos,Nc=Math.atan2,no=Math.PI;function Xy(r,e,t,i,n,a,o){var s=e.stroke,l=e.lineWidth,u=t-n,c=i-a,h=Nc(c,u),f=new Hc({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*Jo(no/6)+","+10*Ko(no/6)+" L0,0 L"+10*Jo(no/6)+",-"+10*Ko(no/6),stroke:s,lineWidth:l}});f.translate(n,a),f.rotateAtPoint(n,a,h),r.set(o?"startArrowShape":"endArrowShape",f)}function Wy(r,e,t,i,n,a,o){var s=e.startArrow,l=e.endArrow,u=e.stroke,c=e.lineWidth,h=o?s:l,f=h.d,v=h.fill,d=h.stroke,p=h.lineWidth,g=yt(h,["d","fill","stroke","lineWidth"]),y=t-n,x=i-a,w=Nc(x,y);f&&(n=n-Jo(w)*f,a=a-Ko(w)*f);var b=new Hc({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:m(m({},g),{stroke:d||u,lineWidth:p||c,fill:v})});b.translate(n,a),b.rotateAtPoint(n,a,w),r.set(o?"startArrowShape":"endArrowShape",b)}function mi(r,e,t,i,n){var a=Nc(i-e,t-r);return{dx:Jo(a)*n,dy:Ko(a)*n}}function Gc(r,e,t,i,n,a){typeof e.startArrow=="object"?Wy(r,e,t,i,n,a,!0):e.startArrow?Xy(r,e,t,i,n,a,!0):r.set("startArrowShape",null)}function Vc(r,e,t,i,n,a){typeof e.endArrow=="object"?Wy(r,e,t,i,n,a,!1):e.endArrow?Xy(r,e,t,i,n,a,!1):r.set("startArrowShape",null)}var kv={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function sn(r,e){var t=e.attr();for(var i in t){var n=t[i],a=kv[i]?kv[i]:i;a==="matrix"&&n?r.transform(n[0],n[1],n[3],n[4],n[6],n[7]):a==="lineDash"&&r.setLineDash?R(n)&&r.setLineDash(n):(a==="strokeStyle"||a==="fillStyle"?n=$F(r,e,n):a==="globalAlpha"&&(n=n*r.globalAlpha),r[a]=n)}}function Lu(r,e,t){for(var i=0;iS?b:S,I=b>S?1:b/S,O=b>S?S/b:1;e.translate(x,w),e.rotate(T),e.scale(I,O),e.arc(0,0,k,M,F,1-L),e.scale(1/I,1/O),e.rotate(-T),e.translate(-x,-w)}break}case"Z":e.closePath();break}if(f==="Z")s=l;else{var z=h.length;s=[h[z-2],h[z-1]]}}}}function Uy(r,e){var t=r.get("canvas");t&&(e==="remove"&&(r._cacheCanvasBBox=r.get("cacheCanvasBBox")),r.get("hasChanged")||(r.set("hasChanged",!0),r.cfg.parent&&r.cfg.parent.get("hasChanged")||(t.refreshElement(r,e,t),t.get("autoDraw")&&t.draw())))}function _F(r){var e;if(r.destroyed)e=r._cacheCanvasBBox;else{var t=r.get("cacheCanvasBBox"),i=t&&!!(t.width&&t.height),n=r.getCanvasBBox(),a=n&&!!(n.width&&n.height);i&&a?e=BF(t,n):i?e=t:a&&(e=n)}return e}function qF(r){if(!r.length)return null;var e=[],t=[],i=[],n=[];return C(r,function(a){var o=_F(a);o&&(e.push(o.minX),t.push(o.minY),i.push(o.maxX),n.push(o.maxY))}),{minX:Le(e),minY:Le(t),maxX:be(i),maxY:be(n)}}function UF(r,e){return!r||!e||!ga(r,e)?null:{minX:Math.max(r.minX,e.minX),minY:Math.max(r.minY,e.minY),maxX:Math.min(r.maxX,e.maxX),maxY:Math.min(r.maxY,e.maxY)}}var $c=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onCanvasChange=function(t){Uy(this,t)},e.prototype.getShapeBase=function(){return os},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,i){i&&(t.save(),sn(t,i),i.createPath(t),t.restore(),t.clip(),i._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,i=[],n=[];C(t,function(f){var v=f.cfg.cacheCanvasBBox;v&&f.cfg.isInView&&(i.push(v.minX,v.maxX),n.push(v.minY,v.maxY))});var a=null;if(i.length){var o=Le(i),s=be(i),l=Le(n),u=be(n);a={minX:o,minY:l,x:o,y:l,maxX:s,maxY:u,width:s-o,height:u-l};var c=this.cfg.canvas;if(c){var h=c.getViewRange();this.set("isInView",ga(a,h))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",a)},e.prototype.draw=function(t,i){var n=this.cfg.children,a=i?this.cfg.refresh:!0;n.length&&a&&(t.save(),sn(t,this),this._applyClip(t,this.getClip()),Lu(t,n,i),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(gs),He=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return os},e.prototype.getGroupBase=function(){return $c},e.prototype.onCanvasChange=function(t){Uy(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),i=this.getHitLineWidth(),n=ms(t),a=n(this),o=i/2,s=a.x-o,l=a.y-o,u=a.x+a.width+o,c=a.y+a.height+o;return{x:s,minX:s,y:l,minY:l,width:a.width+i,height:a.height+i,maxX:u,maxY:c}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,i){i&&(t.save(),sn(t,i),i.createPath(t),t.restore(),t.clip(),i._afterDraw())},e.prototype.draw=function(t,i){var n=this.cfg.clipShape;if(i){if(this.cfg.refresh===!1){this.set("hasChanged",!1);return}var a=this.getCanvasBBox();if(!ga(i,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),sn(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var i=this.getCanvasBBox(),n=ga(i,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",i):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var i=this.attrs,n=i.lineWidth,a=i.opacity,o=i.strokeOpacity,s=i.fillOpacity;this.isFill()&&(!B(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&n>0&&(!B(o)&&o!==1&&(t.globalAlpha=o),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,i){var n=this.isStroke(),a=this.isFill(),o=this.getHitLineWidth();return this.isInStrokeOrPath(t,i,n,a,o)},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(ys),jF=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){var s=this.attr(),l=s.x,u=s.y,c=s.r,h=o/2,f=Yy(l,u,t,i);return a&&n?f<=c+h:a?f<=c:n?f>=c-h&&f<=c+h:!1},e.prototype.createPath=function(t){var i=this.attr(),n=i.x,a=i.y,o=i.r;t.beginPath(),t.arc(n,a,o,0,Math.PI*2,!1),t.closePath()},e}(He);function ao(r,e,t,i){return r/(t*t)+e/(i*i)}var ZF=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){var s=this.attr(),l=o/2,u=s.x,c=s.y,h=s.rx,f=s.ry,v=(t-u)*(t-u),d=(i-c)*(i-c);return a&&n?ao(v,d,h+l,f+l)<=1:a?ao(v,d,h,f)<=1:n?ao(v,d,h-l,f-l)>=1&&ao(v,d,h+l,f+l)<=1:!1},e.prototype.createPath=function(t){var i=this.attr(),n=i.x,a=i.y,o=i.rx,s=i.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,a,o,s,0,0,Math.PI*2,!1);else{var l=o>s?o:s,u=o>s?1:o/s,c=o>s?s/o:1;t.save(),t.translate(n,a),t.scale(u,c),t.arc(0,0,l,0,Math.PI*2),t.restore(),t.closePath()}},e}(He);function Lv(r){return r instanceof HTMLElement&&Q(r.nodeName)&&r.nodeName.toUpperCase()==="CANVAS"}var QF=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(this.get("toDraw")===!0){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var i=this,n=this.attrs;if(Q(t)){var a=new Image;a.onload=function(){if(i.destroyed)return!1;i.attr("img",a),i.set("loading",!1),i._afterLoading();var o=i.get("callback");o&&o.call(i)},a.crossOrigin="Anonymous",a.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):Lv(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),t==="img"&&this._setImage(i)},e.prototype.createPath=function(t){if(this.get("loading")){this.set("toDraw",!0),this.set("context",t);return}var i=this.attr(),n=i.x,a=i.y,o=i.width,s=i.height,l=i.sx,u=i.sy,c=i.swidth,h=i.sheight,f=i.img;(f instanceof Image||Lv(f))&&(!B(l)&&!B(u)&&!B(c)&&!B(h)?t.drawImage(f,l,u,c,h,n,a,o,s):t.drawImage(f,n,a,o,s))},e}(He);function Dr(r,e,t,i,n,a,o){var s=Math.min(r,t),l=Math.max(r,t),u=Math.min(e,i),c=Math.max(e,i),h=n/2;return a>=s-h&&a<=l+h&&o>=u-h&&o<=c+h?Wt.pointToLine(r,e,t,i,a,o)<=n/2:!1}var KF=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),i=t.x1,n=t.y1,a=t.x2,o=t.y2,s=t.startArrow,l=t.endArrow;s&&Gc(this,t,a,o,i,n),l&&Vc(this,t,i,n,a,o)},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){if(!n||!o)return!1;var s=this.attr(),l=s.x1,u=s.y1,c=s.x2,h=s.y2;return Dr(l,u,c,h,o,t,i)},e.prototype.createPath=function(t){var i=this.attr(),n=i.x1,a=i.y1,o=i.x2,s=i.y2,l=i.startArrow,u=i.endArrow,c={dx:0,dy:0},h={dx:0,dy:0};l&&l.d&&(c=mi(n,a,o,s,i.startArrow.d)),u&&u.d&&(h=mi(n,a,o,s,i.endArrow.d)),t.beginPath(),t.moveTo(n+c.dx,a+c.dy),t.lineTo(o-h.dx,s-h.dy)},e.prototype.afterDrawPath=function(t){var i=this.get("startArrowShape"),n=this.get("endArrowShape");i&&i.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),i=t.x1,n=t.y1,a=t.x2,o=t.y2;return Wt.length(i,n,a,o)},e.prototype.getPoint=function(t){var i=this.attr(),n=i.x1,a=i.y1,o=i.x2,s=i.y2;return Wt.pointAt(n,a,o,s,t)},e}(He),JF={circle:function(r,e,t){return[["M",r-t,e],["A",t,t,0,1,0,r+t,e],["A",t,t,0,1,0,r-t,e]]},square:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e-t],["L",r+t,e+t],["L",r-t,e+t],["Z"]]},diamond:function(r,e,t){return[["M",r-t,e],["L",r,e-t],["L",r+t,e],["L",r,e+t],["Z"]]},triangle:function(r,e,t){var i=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e+i],["L",r,e-i],["L",r+t,e+i],["Z"]]},"triangle-down":function(r,e,t){var i=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e-i],["L",r+t,e-i],["L",r,e+i],["Z"]]}},tT=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),["symbol","x","y","r","radius"].indexOf(t)!==-1&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return B(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t=this.attr(),i=t.x,n=t.y,a=t.symbol||"circle",o=this._getR(t),s,l;if(X(a))s=a,l=s(i,n,o),l=rg(l);else{if(s=e.Symbols[a],!s)return console.warn(a+" marker is not supported."),null;l=s(i,n,o)}return l},e.prototype.createPath=function(t){var i=this._getPath(),n=this.get("paramsCache");qy(this,t,{path:i},n)},e.Symbols=JF,e}(He);function jy(r,e,t){var i=ws();return r.createPath(i),i.isPointInPath(e,t)}var eT=1e-6;function Ll(r){return Math.abs(r)0!=Ll(s[1]-t)>0&&Ll(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(i=!i)}return i}function Nn(r,e,t,i,n,a,o,s){var l=(Math.atan2(s-e,o-r)+Math.PI*2)%(Math.PI*2);if(ln)return!1;var u={x:r+t*Math.cos(l),y:e+t*Math.sin(l)};return Yy(u.x,u.y,o,s)<=a/2}var iT=Rt;function nT(r){for(var e=!1,t=r.length,i=0;iw?x:w,L=x>w?1:x/w,k=x>w?w/x:1,I=iT(null,[["t",-g,-y],["r",-M],["s",1/L,1/k]]);Jn(F,F,I),a=Nn(0,0,T,b,S,e,F[0],F[1]);break}if(a)break}}return a}function oT(r){for(var e=r.length,t=[],i=[],n=[],a=0;a0&&i.push(n),{polygons:t,polylines:i}}const oo=m({hasArc:nT,extractPolygons:oT,isPointInStroke:aT},nc);function Iv(r,e,t){for(var i=!1,n=0;n=c[0]&&t<=c[1]&&(n=(t-c[0])/(c[1]-c[0]),a=h)});var s=o[a];if(B(s)||B(a))return null;var l=s.length,u=o[a+1];return Hn.pointAt(s[l-2],s[l-1],u[1],u[2],u[3],u[4],u[5],u[6],n)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",oo.pathToCurve(t))},e.prototype._setTcache=function(){var t=0,i=0,n=[],a,o,s,l,u=this.get("curve");if(u){if(C(u,function(c,h){s=u[h+1],l=c.length,s&&(t+=Hn.length(c[l-2],c[l-1],s[1],s[2],s[3],s[4],s[5],s[6])||0)}),this.set("totalLength",t),t===0){this.set("tCache",[]);return}C(u,function(c,h){s=u[h+1],l=c.length,s&&(a=[],a[0]=i/t,o=Hn.length(c[l-2],c[l-1],s[1],s[2],s[3],s[4],s[5],s[6]),i+=o||0,a[1]=i/t,n.push(a))}),this.set("tCache",n)}},e.prototype.getStartTangent=function(){var t=this.getSegments(),i;if(t.length>1){var n=t[0].currentPoint,a=t[1].currentPoint,o=t[1].startTangent;i=[],o?(i.push([n[0]-o[0],n[1]-o[1]]),i.push([n[0],n[1]])):(i.push([a[0],a[1]]),i.push([n[0],n[1]]))}return i},e.prototype.getEndTangent=function(){var t=this.getSegments(),i=t.length,n;if(i>1){var a=t[i-2].currentPoint,o=t[i-1].currentPoint,s=t[i-1].endTangent;n=[],s?(n.push([o[0]-s[0],o[1]-s[1]]),n.push([o[0],o[1]])):(n.push([a[0],a[1]]),n.push([o[0],o[1]]))}return n},e}(He);function Qy(r,e,t,i,n){var a=r.length;if(a<2)return!1;for(var o=0;o=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Wt.pointAt(i[o][0],i[o][1],i[o+1][0],i[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var i=this.getTotalLength();if(!(i<=0)){var n=0,a=[],o,s;C(t,function(l,u){t[u+1]&&(o=[],o[0]=n/i,s=Wt.length(l[0],l[1],t[u+1][0],t[u+1][1]),n+=s,o[1]=n/i,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,i=[];return i.push([t[1][0],t[1][1]]),i.push([t[0][0],t[0][1]]),i},e.prototype.getEndTangent=function(){var t=this.attr().points,i=t.length-1,n=[];return n.push([t[i-1][0],t[i-1][1]]),n.push([t[i][0],t[i][1]]),n},e}(He);function uT(r,e,t,i,n,a,o){var s=n/2;return ui(r-s,e-s,t,n,a,o)||ui(r+t-s,e-s,n,i,a,o)||ui(r+s,e+i-s,t,n,a,o)||ui(r-s,e+s,n,i,a,o)}function cT(r,e,t,i,n,a,o,s){return Dr(r+n,e,r+t-n,e,a,o,s)||Dr(r+t,e+n,r+t,e+i-n,a,o,s)||Dr(r+t-n,e+i,r+n,e+i,a,o,s)||Dr(r,e+i-n,r,e+n,a,o,s)||Nn(r+t-n,e+n,n,1.5*Math.PI,2*Math.PI,a,o,s)||Nn(r+t-n,e+i-n,n,0,.5*Math.PI,a,o,s)||Nn(r+n,e+i-n,n,.5*Math.PI,Math.PI,a,o,s)||Nn(r+n,e+n,n,Math.PI,1.5*Math.PI,a,o,s)}var hT=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){var s=this.attr(),l=s.x,u=s.y,c=s.width,h=s.height,f=s.radius;if(f){var d=!1;return n&&(d=cT(l,u,c,h,f,o,t,i)),!d&&a&&(d=jy(this,t,i)),d}else{var v=o/2;if(a&&n)return ui(l-v,u-v,c+v,h+v,t,i);if(a)return ui(l,u,c,h,t,i);if(n)return uT(l,u,c,h,o,t,i)}},e.prototype.createPath=function(t){var i=this.attr(),n=i.x,a=i.y,o=i.width,s=i.height,l=i.radius;if(t.beginPath(),l===0)t.rect(n,a,o,s);else{var u=HF(l),c=u[0],h=u[1],f=u[2],v=u[3];t.moveTo(n+c,a),t.lineTo(n+o-h,a),h!==0&&t.arc(n+o-h,a+h,h,-Math.PI/2,0),t.lineTo(n+o,a+s-f),f!==0&&t.arc(n+o-f,a+s-f,f,0,Math.PI/2),t.lineTo(n+v,a+s),v!==0&&t.arc(n+v,a+s-v,v,Math.PI/2,Math.PI),t.lineTo(n,a+c),c!==0&&t.arc(n+c,a+c,c,Math.PI,Math.PI*1.5),t.closePath()}},e}(He),fT=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Ss(t)},e.prototype._setText=function(t){var i=null;Q(t)&&t.indexOf(` `)!==-1&&(i=t.split(` `)),this.set("textArr",i)},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),t.startsWith("font")&&this._assembleFont(),t==="text"&&this._setText(i)},e.prototype._getSpaceingY=function(){var t=this.attrs,i=t.lineHeight,n=t.fontSize*1;return i?i-n:n*.14},e.prototype._drawTextArr=function(t,i,n){var a=this.attrs,o=a.textBaseline,s=a.x,l=a.y,u=a.fontSize*1,c=this._getSpaceingY(),h=bs(a.text,a.fontSize,a.lineHeight),f;C(i,function(v,d){f=l+d*(c+u)-h+u,o==="middle"&&(f+=h-u-(h-u)/2),o==="top"&&(f+=h-u),B(v)||(n?t.fillText(v,s,f):t.strokeText(v,s,f))})},e.prototype._drawText=function(t,i){var n=this.attr(),a=n.x,o=n.y,s=this.get("textArr");if(s)this._drawTextArr(t,s,i);else{var l=n.text;B(l)||(i?t.fillText(l,a,o):t.strokeText(l,a,o))}},e.prototype.strokeAndFill=function(t){var i=this.attrs,n=i.lineWidth,a=i.opacity,o=i.strokeOpacity,s=i.fillOpacity;this.isStroke()&&n>0&&(!B(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!B(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(He);function vT(r,e){if(e){var t=vs(e);return hr(t,r)}return r}function Ky(r,e,t){var i=r.getTotalMatrix();if(i){var n=vT([e,t,1],i),a=n[0],o=n[1];return[a,o]}return[e,t]}function Pv(r,e,t){if(r.isCanvas&&r.isCanvas())return!0;if(!ra(r)||r.cfg.isInView===!1)return!1;if(r.cfg.clipShape){var i=Ky(r,e,t),n=i[0],a=i[1];if(r.isClipped(n,a))return!1}var o=r.cfg.cacheCanvasBBox||r.getCanvasBBox();return e>=o.minX&&e<=o.maxX&&t>=o.minY&&t<=o.maxY}function Jy(r,e,t){if(!Pv(r,e,t))return null;for(var i=null,n=r.getChildren(),a=n.length,o=a-1;o>=0;o--){var s=n[o];if(s.isGroup())i=Jy(s,e,t);else if(Pv(s,e,t)){var l=s,u=Ky(s,e,t),c=u[0],h=u[1];l.isInShape(c,h)&&(i=s)}if(i)break}return i}var dT=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return t.renderer="canvas",t.autoDraw=!0,t.localRefresh=!0,t.refreshElements=[],t.clipView=!0,t.quickHit=!1,t},e.prototype.onCanvasChange=function(t){(t==="attr"||t==="sort"||t==="changeSize")&&(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return os},e.prototype.getGroupBase=function(){return $c},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||OF();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),i=t.getContext("2d");return this.set("context",i),t},e.prototype.setDOMSize=function(t,i){r.prototype.setDOMSize.call(this,t,i);var n=this.get("context"),a=this.get("el"),o=this.getPixelRatio();a.width=o*t,a.height=o*i,o>1&&n.scale(o,o)},e.prototype.clear=function(){r.prototype.clear.call(this),this._clearFrame();var t=this.get("context"),i=this.get("el");t.clearRect(0,0,i.width,i.height)},e.prototype.getShape=function(t,i){var n;return this.get("quickHit")?n=Jy(this,t,i):n=r.prototype.getShape.call(this,t,i,null),n},e.prototype._getRefreshRegion=function(){var t=this.get("refreshElements"),i=this.getViewRange(),n;if(t.length&&t[0]===this)n=i;else if(n=qF(t),n){n.minX=Math.floor(n.minX),n.minY=Math.floor(n.minY),n.maxX=Math.ceil(n.maxX),n.maxY=Math.ceil(n.maxY),n.maxY+=1;var a=this.get("clipView");a&&(n=UF(n,i))}return n},e.prototype.refreshElement=function(t){var i=this.get("refreshElements");i.push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(cw(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),i=this.get("el"),n=this.getChildren();t.clearRect(0,0,i.width,i.height),sn(t,this),Lu(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),i=this.get("refreshElements"),n=this.getChildren(),a=this._getRefreshRegion();a?(t.clearRect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.save(),t.beginPath(),t.rect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.clip(),sn(t,this),XF(this,n,a),Lu(t,n,a),t.restore()):i.length&&_y(i),C(i,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,i=this.get("drawFrame"),n=this.get("drawFrameCallback");i||(i=uw(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null),n&&n()}),this.set("drawFrame",i))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(ps),pT="0.5.12";const gT=Object.freeze(Object.defineProperty({__proto__:null,AbstractCanvas:ps,AbstractGroup:gs,AbstractShape:ys,Base:hs,Canvas:dT,Event:Ta,Group:$c,PathUtil:nc,Shape:os,assembleFont:Ss,getArcParams:Qo,getBBoxMethod:ms,getOffScreenContext:ws,getTextHeight:bs,invert:vs,isAllowCapture:ra,multiplyVec2:hr,registerBBox:Pe,registerEasing:Wp,version:pT},Symbol.toStringTag,{value:"Module"}));var Pu={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},ct={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"};function Ie(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function tm(r){var e=Pu[r.type],t=r.getParent();if(!e)throw new Error("the type "+r.type+" is not supported by svg");var i=Ie(e);if(r.get("id")&&(i.id=r.get("id")),r.set("el",i),r.set("attrs",{}),t){var n=t.get("el");n||(n=t.createDom(),t.set("el",n)),n.appendChild(i)}return i}function em(r,e){var t=r.get("el"),i=gw(t.children).sort(e),n=document.createDocumentFragment();i.forEach(function(a){n.appendChild(a)}),t.appendChild(n)}function yT(r,e){var t=r.parentNode,i=Array.from(t.childNodes).filter(function(s){return s.nodeType===1&&s.nodeName.toLowerCase()!=="defs"}),n=i[e],a=i.indexOf(r);if(n){if(a>e)t.insertBefore(r,n);else if(a0&&(i?"stroke"in n?this._setColor(t,"stroke",s):"strokeStyle"in n&&this._setColor(t,"stroke",l):this._setColor(t,"stroke",s||l),c&&f.setAttribute(ct.strokeOpacity,c),h&&f.setAttribute(ct.lineWidth,h))},e.prototype._setColor=function(t,i,n){var a=this.get("el");if(!n){a.setAttribute(ct[i],"none");return}if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n)){var o=t.find("gradient",n);o||(o=t.addGradient(n)),a.setAttribute(ct[i],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(n)){var o=t.find("pattern",n);o||(o=t.addPattern(n)),a.setAttribute(ct[i],"url(#"+o+")")}else a.setAttribute(ct[i],n)},e.prototype.shadow=function(t,i){var n=this.attr(),a=i||n,o=a.shadowOffsetX,s=a.shadowOffsetY,l=a.shadowBlur,u=a.shadowColor;(o||s||l||u)&&mT(this,t)},e.prototype.transform=function(t){var i=this.attr(),n=(t||i).matrix;n&&Ba(this)},e.prototype.isInShape=function(t,i){return this.isPointInPath(t,i)},e.prototype.isPointInPath=function(t,i){var n=this.get("el"),a=this.get("canvas"),o=a.get("el").getBoundingClientRect(),s=t+o.left,l=i+o.top,u=document.elementFromPoint(s,l);return!!(u&&u.isEqualNode(n))},e.prototype.getHitLineWidth=function(){var t=this.attrs,i=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?i+n:0},e}(ys),xT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="circle",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,r:0})},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");C(i||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):ct[s]&&a.setAttribute(ct[s],o)})},e}(De),wT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dom",t.canFill=!1,t.canStroke=!1,t}return e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");if(C(i||n,function(u,c){ct[c]&&a.setAttribute(ct[c],u)}),typeof n.html=="function"){var o=n.html.call(this,n);if(o instanceof Element||o instanceof HTMLDocument){for(var s=a.childNodes,l=s.length-1;l>=0;l--)a.removeChild(s[l]);a.appendChild(o)}else a.innerHTML=o}else a.innerHTML=n.html},e}(De),bT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="ellipse",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");C(i||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):ct[s]&&a.setAttribute(ct[s],o)})},e}(De),ST=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="image",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,i){var n=this,a=this.attr(),o=this.get("el");C(i||a,function(s,l){l==="img"?n._setImage(a.img):ct[l]&&o.setAttribute(ct[l],s)})},e.prototype.setAttr=function(t,i){this.attrs[t]=i,t==="img"&&this._setImage(i)},e.prototype._setImage=function(t){var i=this.attr(),n=this.get("el");if(Q(t))n.setAttribute("href",t);else if(t instanceof window.Image)i.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),i.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&Q(t.nodeName)&&t.nodeName.toUpperCase()==="CANVAS")n.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width",""+t.width),a.setAttribute("height",""+t.height),a.getContext("2d").putImageData(t,0,0),i.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),i.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",a.toDataURL())}},e}(De),CT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="line",t.canFill=!1,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");C(i||n,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var l=pt(o)?t.addArrow(n,ct[s]):t.getDefaultArrow(n,ct[s]);a.setAttribute(ct[s],"url(#"+l+")")}else a.removeAttribute(ct[s]);else ct[s]&&a.setAttribute(ct[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr(),i=t.x1,n=t.y1,a=t.x2,o=t.y2;return Wt.length(i,n,a,o)},e.prototype.getPoint=function(t){var i=this.attr(),n=i.x1,a=i.y1,o=i.x2,s=i.y2;return Wt.pointAt(n,a,o,s,t)},e}(De),so={circle:function(r,e,t){return[["M",r,e],["m",-t,0],["a",t,t,0,1,0,t*2,0],["a",t,t,0,1,0,-t*2,0]]},square:function(r,e,t){return[["M",r-t,e-t],["L",r+t,e-t],["L",r+t,e+t],["L",r-t,e+t],["Z"]]},diamond:function(r,e,t){return[["M",r-t,e],["L",r,e-t],["L",r+t,e],["L",r,e+t],["Z"]]},triangle:function(r,e,t){var i=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e+i],["L",r,e-i],["L",r+t,e+i],["z"]]},triangleDown:function(r,e,t){var i=t*Math.sin(.3333333333333333*Math.PI);return[["M",r-t,e-i],["L",r+t,e-i],["L",r,e+i],["Z"]]}};const Dv={get:function(r){return so[r]},register:function(r,e){so[r]=e},remove:function(r){delete so[r]},getAll:function(){return so}};var MT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="marker",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t){var i=this.get("el");i.setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return R(t)?t.map(function(i){return i.join(" ")}).join(""):t},e.prototype._getPath=function(){var t=this.attr(),i=t.x,n=t.y,a=t.r||t.radius,o=t.symbol||"circle",s;return X(o)?s=o:s=Dv.get(o),s?s(i,n,a):(console.warn(s+" symbol is not exist."),null)},e.symbolsFactory=Dv,e}(De),AT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="path",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,i){var n=this,a=this.attr(),o=this.get("el");C(i||a,function(s,l){if(l==="path"&&R(s))o.setAttribute("d",n._formatPath(s));else if(l==="startArrow"||l==="endArrow")if(s){var u=pt(s)?t.addArrow(a,ct[l]):t.getDefaultArrow(a,ct[l]);o.setAttribute(ct[l],"url(#"+u+")")}else o.removeAttribute(ct[l]);else ct[l]&&o.setAttribute(ct[l],s)})},e.prototype._formatPath=function(t){var i=t.map(function(n){return n.join(" ")}).join("");return~i.indexOf("NaN")?"":i},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var i=this.get("el"),n=this.getTotalLength();if(n===0)return null;var a=i?i.getPointAtLength(t*n):null;return a?{x:a.x,y:a.y}:null},e}(De),FT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polygon",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");C(i||n,function(o,s){s==="points"&&R(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):ct[s]&&a.setAttribute(ct[s],o)})},e}(De),TT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polyline",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");C(i||n,function(o,s){s==="points"&&R(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):ct[s]&&a.setAttribute(ct[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr().points,i=this.get("totalLength");return B(i)?(this.set("totalLength",tg.length(t)),this.get("totalLength")):i},e.prototype.getPoint=function(t){var i=this.attr().points,n=this.get("tCache");n||(this._setTcache(),n=this.get("tCache"));var a,o;return C(n,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Wt.pointAt(i[o][0],i[o][1],i[o+1][0],i[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var i=this.getTotalLength();if(!(i<=0)){var n=0,a=[],o,s;C(t,function(l,u){t[u+1]&&(o=[],o[0]=n/i,s=Wt.length(l[0],l[1],t[u+1][0],t[u+1][1]),n+=s,o[1]=n/i,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,i=[];return i.push([t[1][0],t[1][1]]),i.push([t[0][0],t[0][1]]),i},e.prototype.getEndTangent=function(){var t=this.attr().points,i=t.length-1,n=[];return n.push([t[i-1][0],t[i-1][1]]),n.push([t[i][0],t[i][1]]),n},e}(De);function ET(r){var e=0,t=0,i=0,n=0;return R(r)?r.length===1?e=t=i=n=r[0]:r.length===2?(e=i=r[0],t=n=r[1]):r.length===3?(e=r[0],t=n=r[1],i=r[2]):(e=r[0],t=r[1],i=r[2],n=r[3]):e=t=i=n=r,{r1:e,r2:t,r3:i,r4:n}}var kT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="rect",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,i){var n=this,a=this.attr(),o=this.get("el"),s=!1,l=["x","y","width","height","radius"];C(i||a,function(u,c){l.indexOf(c)!==-1&&!s?(o.setAttribute("d",n._assembleRect(a)),s=!0):l.indexOf(c)===-1&&ct[c]&&o.setAttribute(ct[c],u)})},e.prototype._assembleRect=function(t){var i=t.x,n=t.y,a=t.width,o=t.height,s=t.radius;if(!s)return"M "+i+","+n+" l "+a+",0 l 0,"+o+" l"+-a+" 0 z";var l=ET(s);R(s)?s.length===1?l.r1=l.r2=l.r3=l.r4=s[0]:s.length===2?(l.r1=l.r3=s[0],l.r2=l.r4=s[1]):s.length===3?(l.r1=s[0],l.r2=l.r4=s[1],l.r3=s[2]):(l.r1=s[0],l.r2=s[1],l.r3=s[2],l.r4=s[3]):l.r1=l.r2=l.r3=l.r4=s;var u=[["M "+(i+l.r1)+","+n],["l "+(a-l.r1-l.r2)+",0"],["a "+l.r2+","+l.r2+",0,0,1,"+l.r2+","+l.r2],["l 0,"+(o-l.r2-l.r3)],["a "+l.r3+","+l.r3+",0,0,1,"+-l.r3+","+l.r3],["l "+(l.r3+l.r4-a)+",0"],["a "+l.r4+","+l.r4+",0,0,1,"+-l.r4+","+-l.r4],["l 0,"+(l.r4+l.r1-o)],["a "+l.r1+","+l.r1+",0,0,1,"+l.r1+","+-l.r1],["z"]];return u.join(" ")},e}(De),Ov=.3,LT={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},IT={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},PT={left:"left",start:"left",center:"middle",right:"end",end:"end"},DT=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="text",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return m(m({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,i){var n=this,a=this.attr(),o=this.get("el");this._setFont(),C(i||a,function(s,l){l==="text"?n._setText(""+s):l==="matrix"&&s?Ba(n):ct[l]&&o.setAttribute(ct[l],s)}),o.setAttribute("paint-order","stroke"),o.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),i=this.attr(),n=i.textBaseline,a=i.textAlign,o=Fp();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",IT[n]||"alphabetic"):t.setAttribute("alignment-baseline",LT[n]||"baseline"),t.setAttribute("text-anchor",PT[a]||"left")},e.prototype._setText=function(t){var i=this.get("el"),n=this.attr(),a=n.x,o=n.textBaseline,s=o===void 0?"bottom":o;if(!t)i.innerHTML="";else if(~t.indexOf(` `)){var l=t.split(` `),u=l.length-1,c="";C(l,function(h,f){f===0?s==="alphabetic"?c+=''+h+"":s==="top"?c+=''+h+"":s==="middle"?c+=''+h+"":s==="bottom"?c+=''+h+"":s==="hanging"&&(c+=''+h+""):c+=''+h+""}),i.innerHTML=c}else i.innerHTML=t},e}(De),OT=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,BT=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,RT=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function nm(r){var e=r.match(RT);if(!e)return"";var t="";return e.sort(function(i,n){return i=i.split(":"),n=n.split(":"),Number(i[0])-Number(n[0])}),C(e,function(i){i=i.split(":"),t+=''}),t}function zT(r,e){var t=OT.exec(r),i=Ku(Ju(parseFloat(t[1])),Math.PI*2),n=t[2],a,o;i>=0&&i<.5*Math.PI?(a={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=i&&i`;t.innerHTML=i},r}(),Bv=function(){function r(e,t){this.cfg={};var i=Ie("marker"),n=Zr("marker_");i.setAttribute("id",n);var a=Ie("path");a.setAttribute("stroke",e.stroke||"none"),a.setAttribute("fill",e.fill||"none"),i.appendChild(a),i.setAttribute("overflow","visible"),i.setAttribute("orient","auto-start-reverse"),this.el=i,this.child=a,this.id=n;var o=e[t==="marker-start"?"startArrow":"endArrow"];return this.stroke=e.stroke||"#000",o===!0?this._setDefaultPath(t,a):(this.cfg=o,this._setMarker(e.lineWidth,a)),this}return r.prototype.match=function(){return!1},r.prototype._setDefaultPath=function(e,t){var i=this.el;t.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),i.setAttribute("refX",""+10*Math.cos(Math.PI/6)),i.setAttribute("refY","5")},r.prototype._setMarker=function(e,t){var i=this.el,n=this.cfg.path,a=this.cfg.d;R(n)&&(n=n.map(function(o){return o.join(" ")}).join("")),t.setAttribute("d",n),i.appendChild(t),a&&i.setAttribute("refX",""+a/e)},r.prototype.update=function(e){var t=this.child;t.attr?t.attr("fill",e):t.setAttribute("fill",e)},r}(),HT=function(){function r(e){this.type="clip",this.cfg={};var t=Ie("clipPath");this.el=t,this.id=Zr("clip_"),t.id=this.id;var i=e.cfg.el;return t.appendChild(i),this.cfg=e,this}return r.prototype.match=function(){return!1},r.prototype.remove=function(){var e=this.el;e.parentNode.removeChild(e)},r}(),XT=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,WT=function(){function r(e){this.cfg={};var t=Ie("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var i=Ie("image");t.appendChild(i);var n=Zr("pattern_");t.id=n,this.el=t,this.id=n,this.cfg=e;var a=XT.exec(e),o=a[2];i.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function l(){t.setAttribute("width",""+s.width),t.setAttribute("height",""+s.height)}return s.complete?l():(s.onload=l,s.src=s.src),this}return r.prototype.match=function(e,t){return this.cfg===t},r}(),_T=function(){function r(e){var t=Ie("defs"),i=Zr("defs_");t.id=i,e.appendChild(t),this.children=[],this.defaultArrow={},this.el=t,this.canvas=e}return r.prototype.find=function(e,t){for(var i=this.children,n=null,a=0;a0&&(v[0][0]="L")),a=a.concat(v)}),a.push(["Z"])}return a}function Hs(r,e,t,i,n){for(var a=Dt(r,e,!e,"lineWidth"),o=r.connectNulls,s=r.isInCircle,l=r.points,u=r.showSinglePoint,c=$s(l,o,u),h=[],f=0,v=c.length;fo&&(o=l),l=i[0]}));var g=this.scales[d];try{for(var y=ht(t),x=y.next();!x.done;x=y.next()){var w=x.value,b=this.getDrawCfg(w),S=b.x,M=b.y,F=g.scale(w[bt][d]);this.drawGrayScaleBlurredCircle(S-u.x,M-c.y,n+a,F,p)}}catch(k){o={error:k}}finally{try{x&&!x.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}var T=p.getImageData(0,0,h,f);this.clearShadowCanvasCtx(),this.colorize(T),p.putImageData(T,0,0);var L=this.getImageShape();L.attr("x",u.x),L.attr("y",c.y),L.attr("width",h),L.attr("height",f),L.attr("img",p.canvas),L.set("origin",this.getShapeInfo(t))},e.prototype.getDefaultSize=function(){var t=this.getAttribute("position"),i=this.coordinate;return Math.min(i.getWidth()/(t.scales[0].ticks.length*4),i.getHeight()/(t.scales[1].ticks.length*4))},e.prototype.clearShadowCanvasCtx=function(){var t=this.getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},e.prototype.getShadowCanvasCtx=function(){var t=this.shadowCanvas;return t||(t=document.createElement("canvas"),this.shadowCanvas=t),t.width=this.coordinate.getWidth(),t.height=this.coordinate.getHeight(),t.getContext("2d")},e.prototype.getGrayScaleBlurredCanvas=function(){return this.grayScaleBlurredCanvas||(this.grayScaleBlurredCanvas=document.createElement("canvas")),this.grayScaleBlurredCanvas},e.prototype.drawGrayScaleBlurredCircle=function(t,i,n,a,o){var s=this.getGrayScaleBlurredCanvas();o.globalAlpha=a,o.drawImage(s,t-n,i-n)},e.prototype.colorize=function(t){for(var i=this.getAttribute("color"),n=t.data,a=this.paletteCache,o=3;oe&&(t=t?e/(1+i/t):0,i=e-t),n+a>e&&(n=n?e/(1+a/n):0,a=e-n),[t||0,i||0,n||0,a||0]}function sm(r,e,t){var i=[];if(t.isRect){var n=t.isTransposed?{x:t.start.x,y:e[0].y}:{x:e[0].x,y:t.start.y},a=t.isTransposed?{x:t.end.x,y:e[2].y}:{x:e[3].x,y:t.end.y},o=A(r,["background","style","radius"]);if(o){var s=t.isTransposed?Math.abs(e[0].y-e[2].y):e[2].x-e[1].x,l=t.isTransposed?t.getWidth():t.getHeight(),u=U(om(o,Math.min(s,l)),4),c=u[0],h=u[1],f=u[2],v=u[3],d=t.isTransposed&&t.isReflect("y"),p=d?0:1,g=function(M){return d?-M:M};i.push(["M",n.x,a.y+g(c)]),c!==0&&i.push(["A",c,c,0,0,p,n.x+c,a.y]),i.push(["L",a.x-h,a.y]),h!==0&&i.push(["A",h,h,0,0,p,a.x,a.y+g(h)]),i.push(["L",a.x,n.y-g(f)]),f!==0&&i.push(["A",f,f,0,0,p,a.x-f,n.y]),i.push(["L",n.x+v,n.y]),v!==0&&i.push(["A",v,v,0,0,p,n.x,n.y-g(v)])}else i.push(["M",n.x,n.y]),i.push(["L",a.x,n.y]),i.push(["L",a.x,a.y]),i.push(["L",n.x,a.y]),i.push(["L",n.x,n.y]);i.push(["z"])}if(t.isPolar){var y=t.getCenter(),x=fa(r,t),w=x.startAngle,b=x.endAngle;if(t.type!=="theta"&&!t.isTransposed)i=Nr(y.x,y.y,t.getRadius(),w,b);else{var S=function(T){return Math.pow(T,2)},c=Math.sqrt(S(y.x-e[0].x)+S(y.y-e[0].y)),h=Math.sqrt(S(y.x-e[2].x)+S(y.y-e[2].y));i=Nr(y.x,y.y,c,t.startAngle,t.endAngle,h)}}return i}function tE(r,e,t){var i=t.getWidth(),n=t.getHeight(),a=t.type==="rect",o=[],s=(r[2].x-r[1].x)/2,l=t.isTransposed?s*n/i:s*i/n;return e==="round"?(a?(o.push(["M",r[0].x,r[0].y+l]),o.push(["L",r[1].x,r[1].y-l]),o.push(["A",s,s,0,0,1,r[2].x,r[2].y-l]),o.push(["L",r[3].x,r[3].y+l]),o.push(["A",s,s,0,0,1,r[0].x,r[0].y+l])):(o.push(["M",r[0].x,r[0].y]),o.push(["L",r[1].x,r[1].y]),o.push(["A",s,s,0,0,1,r[2].x,r[2].y]),o.push(["L",r[3].x,r[3].y]),o.push(["A",s,s,0,0,1,r[0].x,r[0].y])),o.push(["z"])):o=qc(r),o}function lm(r,e,t){var i=[];return B(e)?t?i.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",(r[2].x+r[3].x)/2,(r[2].y+r[3].y)/2],["Z"]):i.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",r[2].x,r[2].y],["L",r[3].x,r[3].y],["Z"]):i.push(["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["L",e[1].x,e[1].y],["L",e[0].x,e[0].y],["Z"]),i}function Ln(r,e){return[e,r]}function eE(r,e,t){var i,n,a,o,s,l,u,c=U(Z([],U(r),!1),4),h=c[0],f=c[1],v=c[2],d=c[3],p=U(typeof t=="number"?Array(4).fill(t):t,4),g=p[0],y=p[1],x=p[2],w=p[3];e.isTransposed&&(i=U(Ln(f,d),2),f=i[0],d=i[1]),e.isReflect("y")&&(n=U(Ln(h,f),2),h=n[0],f=n[1],a=U(Ln(v,d),2),v=a[0],d=a[1]),e.isReflect("x")&&(o=U(Ln(h,d),2),h=o[0],d=o[1],s=U(Ln(f,v),2),f=s[0],v=s[1]);var b=[],S=function(M){return Math.abs(M)};return l=U(om([g,y,x,w],Math.min(S(d.x-h.x),S(f.y-h.y))).map(function(M){return S(M)}),4),g=l[0],y=l[1],x=l[2],w=l[3],e.isTransposed&&(u=U([w,g,y,x],4),g=u[0],y=u[1],x=u[2],w=u[3]),h.yo&&(n=o)}return n}function iE(r,e){if(e){var t=we(r),i=Ve(t,e);return i.length}return r.length}function Uc(r){var e=r.theme,t=r.coordinate,i=r.getXScale(),n=i.values,a=r.beforeMappingData,o=n.length,s=Ia(r.coordinate),l=r.intervalPadding,u=r.dodgePadding,c=r.maxColumnWidth||e.maxColumnWidth,h=r.minColumnWidth||e.minColumnWidth,f=r.columnWidthRatio||e.columnWidthRatio,v=r.multiplePieWidthRatio||e.multiplePieWidthRatio,d=r.roseWidthRatio||e.roseWidthRatio;if(i.isLinear&&n.length>1){n.sort();var p=rE(n,i);o=(i.max-i.min)/p,n.length>o&&(o=n.length)}var g=i.range,y=1/o,x=1;if(t.isPolar?t.isTransposed&&o>1?x=v:x=d:(i.isLinear&&(y*=g[1]-g[0]),x=f),!B(l)&&l>=0){var w=l/s;y=(1-(o-1)*w)/o}else y*=x;if(r.getAdjust("dodge")){var b=r.getAdjust("dodge"),S=b.dodgeBy,M=iE(a,S);if(!B(u)&&u>=0){var F=u/s;y=(y-F*(M-1))/M}else!B(l)&&l>=0&&(y*=x),y=y/M;y=y>=0?y:0}if(!B(c)&&c>=0){var T=c/s;y>T&&(y=T)}if(!B(h)&&h>=0){var L=h/s;y0&&!A(i,[n,"min"])&&t.change({min:0}),o<=0&&!A(i,[n,"max"])&&t.change({max:0}))}},e.prototype.getDrawCfg=function(t){var i=r.prototype.getDrawCfg.call(this,t);return i.background=this.background,i},e}(Kr),aE=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;i.type="line";var n=t.sortable,a=n===void 0?!1:n;return i.sortable=a,i}return e}(Wc),um=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"],oE=["cross","tick","plus","hyphen","line"];function jc(r,e,t,i,n){var a,o,s=Dt(e,n,!n,"r"),l=r.parsePoints(e.points),u=l[0];if(e.isStack)u=l[1];else if(l.length>1){var c=t.addGroup();try{for(var h=ht(l),f=h.next();!f.done;f=h.next()){var v=f.value;c.addShape({type:"marker",attrs:m(m(m({},s),{symbol:Ai[i]||i}),v)})}}catch(d){a={error:d}}finally{try{f&&!f.done&&(o=h.return)&&o.call(h)}finally{if(a)throw a.error}}return c}return t.addShape({type:"marker",attrs:m(m(m({},s),{symbol:Ai[i]||i}),u)})}Qr("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(r){return zc(r)}});C(um,function(r){ft("point","hollow-".concat(r),{draw:function(e,t){return jc(this,e,t,r,!0)},getMarker:function(e){var t=e.color;return{symbol:Ai[r]||r,style:{r:4.5,stroke:t,fill:null}}}})});var sE=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="point",t.shapeType="point",t.generatePoints=!0,t}return e.prototype.getDrawCfg=function(t){var i=r.prototype.getDrawCfg.call(this,t);return m(m({},i),{isStack:!!this.getAdjust("stack")})},e}(Kr);function lE(r){for(var e=r[0],t=1,i=[["M",e.x,e.y]];t2?"weight":"normal",a;if(r.isInCircle){var o={x:0,y:1};return n==="normal"?a=vE(i[0],i[1],o):(t.fill=t.stroke,a=dE(i,o)),a=this.parsePath(a),e.addShape("path",{attrs:m(m({},t),{path:a})})}else{if(n==="normal")return i=this.parsePoints(i),a=Zg((i[1].x+i[0].x)/2,i[0].y,Math.abs(i[1].x-i[0].x)/2,Math.PI,Math.PI*2),e.addShape("path",{attrs:m(m({},t),{path:a})});var s=Du(i[1],i[3]),l=Du(i[2],i[0]);return a=[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],s,["L",i[3].x,i[3].y],["L",i[2].x,i[2].y],l,["Z"]],a=this.parsePath(a),t.fill=t.stroke,e.addShape("path",{attrs:m(m({},t),{path:a})})}},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});function pE(r,e){var t=Du(r,e),i=[["M",r.x,r.y]];return i.push(t),i}ft("edge","smooth",{draw:function(r,e){var t=Dt(r,!0,!1,"lineWidth"),i=r.points,n=this.parsePath(pE(i[0],i[1]));return e.addShape("path",{attrs:m(m({},t),{path:n})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});var lo=1/3;function gE(r,e){var t=[];t.push({x:r.x,y:r.y*(1-lo)+e.y*lo}),t.push({x:e.x,y:r.y*(1-lo)+e.y*lo}),t.push(e);var i=[["M",r.x,r.y]];return C(t,function(n){i.push(["L",n.x,n.y])}),i}ft("edge","vhv",{draw:function(r,e){var t=Dt(r,!0,!1,"lineWidth"),i=r.points,n=this.parsePath(gE(i[0],i[1]));return e.addShape("path",{attrs:m(m({},t),{path:n})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});ft("interval","funnel",{getPoints:function(r){return r.size=r.size*2,_c(r)},draw:function(r,e){var t=Dt(r,!1,!0),i=this.parsePath(lm(r.points,r.nextPoints,!1)),n=e.addShape("path",{attrs:m(m({},t),{path:i}),name:"interval"});return n},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});ft("interval","hollow-rect",{draw:function(r,e){var t=Dt(r,!0,!1),i=e,n=r==null?void 0:r.background;if(n){i=e.addGroup();var a=Ny(r),o=sm(r,this.parsePoints(r.points),this.coordinate);i.addShape("path",{attrs:m(m({},a),{path:o}),capture:!1,zIndex:-1,name:Oc})}var s=this.parsePath(qc(r.points)),l=i.addShape("path",{attrs:m(m({},t),{path:s}),name:"interval"});return n?i:l},getMarker:function(r){var e=r.color,t=r.isInPolar;return t?{symbol:"circle",style:{r:4.5,stroke:e,fill:null}}:{symbol:"square",style:{r:4,stroke:e,fill:null}}}});function yE(r){var e=r.x,t=r.y,i=r.y0;return R(t)?t.map(function(n,a){return{x:R(e)?e[a]:e,y:n}}):[{x:e,y:i},{x:e,y:t}]}ft("interval","line",{getPoints:function(r){return yE(r)},draw:function(r,e){var t=Dt(r,!0,!1,"lineWidth"),i=le(m({},t),["fill"]),n=this.parsePath(qc(r.points,!1)),a=e.addShape("path",{attrs:m(m({},i),{path:n}),name:"interval"});return a},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){return[["M",t,i-n],["L",t,i+n]]},style:{r:5,stroke:e}}}});ft("interval","pyramid",{getPoints:function(r){return r.size=r.size*2,_c(r)},draw:function(r,e){var t=Dt(r,!1,!0),i=this.parsePath(lm(r.points,r.nextPoints,!0)),n=e.addShape("path",{attrs:m(m({},t),{path:i}),name:"interval"});return n},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});function mE(r){var e,t=r.x,i=r.y,n=r.y0,a=r.size,o,s;R(i)?(e=U(i,2),o=e[0],s=e[1]):(o=n,s=i);var l=t+a/2,u=t-a/2;return[{x:t,y:o},{x:t,y:s},{x:u,y:o},{x:l,y:o},{x:u,y:s},{x:l,y:s}]}function xE(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y]]}ft("interval","tick",{getPoints:function(r){return mE(r)},draw:function(r,e){var t=Dt(r,!0,!1),i=this.parsePath(xE(r.points)),n=e.addShape("path",{attrs:m(m({},t),{path:i}),name:"interval"});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){return[["M",t-n/2,i-n],["L",t+n/2,i-n],["M",t,i-n],["L",t,i+n],["M",t-n/2,i+n],["L",t+n/2,i+n]]},style:{r:5,stroke:e}}}});var wE=function(r,e,t){var i=r.x,n=r.y,a=e.x,o=e.y,s;switch(t){case"hv":s=[{x:a,y:n}];break;case"vh":s=[{x:i,y:o}];break;case"hvh":var l=(a+i)/2;s=[{x:l,y:n},{x:l,y:o}];break;case"vhv":var u=(n+o)/2;s=[{x:i,y:u},{x:a,y:u}];break}return s};function bE(r,e){var t=[];return C(r,function(i,n){var a=r[n+1];if(t.push(i),a){var o=wE(i,a,e);t=t.concat(o)}}),t}function SE(r){return r.map(function(e,t){return t===0?["M",e.x,e.y]:["L",e.x,e.y]})}function CE(r,e){var t=$s(r.points,r.connectNulls,r.showSinglePoint),i=[];return C(t,function(n){var a=bE(n,e);i=i.concat(SE(a))}),m(m({},Dt(r,!0,!1,"lineWidth")),{path:i})}C(["hv","vh","hvh","vhv"],function(r){ft("line",r,{draw:function(e,t){var i=CE(e,r),n=t.addShape({type:"path",attrs:i,name:"line"});return n},getMarker:function(e){return Gy(e,r)}})});C(oE,function(r){ft("point",r,{draw:function(e,t){return jc(this,e,t,r,!0)},getMarker:function(e){var t=e.color;return{symbol:Ai[r],style:{r:4.5,stroke:t,fill:null}}}})});ft("point","image",{draw:function(r,e){var t,i,n=Dt(r,!1,!1,"r").r,a=this.parsePoints(r.points),o=a[0];if(r.isStack)o=a[1];else if(a.length>1){var s=e.addGroup();try{for(var l=ht(a),u=l.next();!u.done;u=l.next()){var c=u.value;s.addShape("image",{attrs:{x:c.x-n/2,y:c.y-n,width:n,height:n,img:r.shape[1]}})}}catch(h){t={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(t)throw t.error}}return s}return e.addShape("image",{attrs:{x:o.x-n/2,y:o.y-n,width:n,height:n,img:r.shape[1]}})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4.5,fill:e}}}});C(um,function(r){ft("point",r,{draw:function(e,t){return jc(this,e,t,r,!1)},getMarker:function(e){var t=e.color;return{symbol:Ai[r]||r,style:{r:4.5,fill:t}}}})});function Rv(r){var e=R(r)?r:[r],t=e[0],i=e[e.length-1],n=e.length>1?e[1]:t,a=e.length>3?e[3]:i,o=e.length>2?e[2]:n;return{min:t,max:i,min1:n,max1:a,median:o}}function zv(r,e,t){var i=t/2,n;if(R(e)){var a=Rv(e),o=a.min,s=a.max,l=a.median,u=a.min1,c=a.max1,h=r-i,f=r+i;n=[[h,s],[f,s],[r,s],[r,c],[h,u],[h,c],[f,c],[f,u],[r,u],[r,o],[h,o],[f,o],[h,l],[f,l]]}else{e=B(e)?.5:e;var v=Rv(r),o=v.min,s=v.max,l=v.median,u=v.min1,c=v.max1,d=e-i,p=e+i;n=[[o,d],[o,p],[o,e],[u,e],[u,d],[u,p],[c,p],[c,d],[c,e],[s,e],[s,d],[s,p],[l,d],[l,p]]}return n.map(function(g){return{x:g[0],y:g[1]}})}function ME(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y],["L",r[6].x,r[6].y],["L",r[7].x,r[7].y],["L",r[4].x,r[4].y],["Z"],["M",r[8].x,r[8].y],["L",r[9].x,r[9].y],["M",r[10].x,r[10].y],["L",r[11].x,r[11].y],["M",r[12].x,r[12].y],["L",r[13].x,r[13].y]]}ft("schema","box",{getPoints:function(r){var e=r.x,t=r.y,i=r.size;return zv(e,t,i)},draw:function(r,e){var t=Dt(r,!0,!1),i=this.parsePath(ME(r.points)),n=e.addShape("path",{attrs:m(m({},t),{path:i,name:"schema"})});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){var a=[i-6,i-3,i,i+3,i+6],o=zv(t,a,n);return[["M",o[0].x+1,o[0].y],["L",o[1].x-1,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["M",o[4].x,o[4].y],["L",o[5].x,o[5].y],["L",o[6].x,o[6].y],["L",o[7].x,o[7].y],["L",o[4].x,o[4].y],["Z"],["M",o[8].x,o[8].y],["L",o[9].x,o[9].y],["M",o[10].x+1,o[10].y],["L",o[11].x-1,o[11].y],["M",o[12].x,o[12].y],["L",o[13].x,o[13].y]]},style:{r:6,lineWidth:1,stroke:e}}}});function AE(r){var e=R(r)?r:[r],t=e.sort(function(i,n){return n-i});return aA(t,4,t[t.length-1])}function Nv(r,e,t){var i=AE(e);return[{x:r,y:i[0]},{x:r,y:i[1]},{x:r-t/2,y:i[2]},{x:r-t/2,y:i[1]},{x:r+t/2,y:i[1]},{x:r+t/2,y:i[2]},{x:r,y:i[2]},{x:r,y:i[3]}]}function FE(r){return[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["L",r[4].x,r[4].y],["L",r[5].x,r[5].y],["Z"],["M",r[6].x,r[6].y],["L",r[7].x,r[7].y]]}ft("schema","candle",{getPoints:function(r){var e=r.x,t=r.y,i=r.size;return Nv(e,t,i)},draw:function(r,e){var t=Dt(r,!0,!0),i=this.parsePath(FE(r.points)),n=e.addShape("path",{attrs:m(m({},t),{path:i,name:"schema"})});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){var a=[i+7.5,i+3,i-3,i-7.5],o=Nv(t,a,n);return[["M",o[0].x,o[0].y],["L",o[1].x,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["L",o[4].x,o[4].y],["L",o[5].x,o[5].y],["Z"],["M",o[6].x,o[6].y],["L",o[7].x,o[7].y]]},style:{lineWidth:1,stroke:e,fill:e,r:6}}}});function TE(r,e){var t=Math.abs(r[0].x-r[2].x),i=Math.abs(r[0].y-r[2].y),n=Math.min(t,i);e&&(n=Ct(e,0,Math.min(t,i))),n=n/2;var a=(r[0].x+r[2].x)/2,o=(r[0].y+r[2].y)/2;return{x:a-n,y:o-n,width:n*2,height:n*2}}ft("polygon","square",{draw:function(r,e){if(!fe(r.points)){var t=Dt(r,!0,!0),i=this.parsePoints(r.points);return e.addShape("rect",{attrs:m(m({},t),TE(i,r.size)),name:"polygon"})}},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});ft("violin","smooth",{draw:function(r,e){var t=Dt(r,!0,!0),i=this.parsePath(zy(r.points));return e.addShape("path",{attrs:m(m({},t),{path:i})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{stroke:null,r:4,fill:e}}}});ft("violin","hollow",{draw:function(r,e){var t=Dt(r,!0,!1),i=this.parsePath(Ry(r.points));return e.addShape("path",{attrs:m(m({},t),{path:i})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});ft("violin","hollow-smooth",{draw:function(r,e){var t=Dt(r,!0,!1),i=this.parsePath(zy(r.points));return e.addShape("path",{attrs:m(m({},t),{path:i})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});var EE=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelValueDir=function(t){var i="y",n=t.points;return n[0][i]<=n[2][i]?1:-1},e.prototype.getLabelOffsetPoint=function(t,i,n,a){var o,s=r.prototype.getLabelOffsetPoint.call(this,t,i,n),l=this.getCoordinate(),u=l.isTransposed,c=u?"x":"y",h=this.getLabelValueDir(t.mappingData);return s=m(m({},s),(o={},o[c]=s[c]*h,o)),l.isReflect("x")&&(s=m(m({},s),{x:s.x*-1})),l.isReflect("y")&&(s=m(m({},s),{y:s.y*-1})),s},e.prototype.getThemedLabelCfg=function(t){var i=this.geometry,n=this.getDefaultLabelCfg(),a=i.theme;return H({},n,a.labels,t.position==="middle"?{offset:0}:{},t)},e.prototype.setLabelPosition=function(t,i,n,a){var o=this.getCoordinate(),s=o.isTransposed,l=i.points,u=o.convert(l[0]),c=o.convert(l[2]),h=this.getLabelValueDir(i),f,v,d,p,g=R(i.shape)?i.shape[0]:i.shape;if(g==="funnel"||g==="pyramid"){var y=A(i,"nextPoints"),x=A(i,"points");if(y){var w=o.convert(x[0]),b=o.convert(x[1]),S=o.convert(y[0]),M=o.convert(y[1]);s?(f=Math.min(S.y,w.y),d=Math.max(S.y,w.y),v=(b.x+M.x)/2,p=(w.x+S.x)/2):(f=Math.min((b.y+M.y)/2,(w.y+S.y)/2),d=Math.max((b.y+M.y)/2,(w.y+S.y)/2),v=M.x,p=w.x)}else f=Math.min(c.y,u.y),d=Math.max(c.y,u.y),v=c.x,p=u.x}else f=Math.min(c.y,u.y),d=Math.max(c.y,u.y),v=c.x,p=u.x;switch(a){case"right":t.x=v,t.y=(f+d)/2,t.textAlign=A(t,"textAlign",h>0?"left":"right");break;case"left":t.x=p,t.y=(f+d)/2,t.textAlign=A(t,"textAlign",h>0?"left":"right");break;case"bottom":s&&(t.x=(v+p)/2),t.y=d,t.textAlign=A(t,"textAlign","center"),t.textBaseline=A(t,"textBaseline",h>0?"bottom":"top");break;case"middle":s&&(t.x=(v+p)/2),t.y=(f+d)/2,t.textAlign=A(t,"textAlign","center"),t.textBaseline=A(t,"textBaseline","middle");break;case"top":s&&(t.x=(v+p)/2),t.y=f,t.textAlign=A(t,"textAlign","center"),t.textBaseline=A(t,"textBaseline",h>0?"bottom":"top");break}},e}(Ys),uo=Math.PI/2,cm=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelOffset=function(t){var i=this.getCoordinate(),n=0;if(rt(t))n=t;else if(Q(t)&&t.indexOf("%")!==-1){var a=i.getRadius();i.innerRadius>0&&(a=a*(1-i.innerRadius)),n=parseFloat(t)*.01*a}return n},e.prototype.getLabelItems=function(t){var i=r.prototype.getLabelItems.call(this,t),n=this.geometry.getYScale();return Mt(i,function(a){if(a&&n){var o=n.scale(A(a.data,n.field));return m(m({},a),{percent:o})}return a})},e.prototype.getLabelAlign=function(t){var i=this.getCoordinate(),n;if(t.labelEmit)n=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(!i.isTransposed)n="center";else{var a=i.getCenter(),o=t.offset;Math.abs(t.x-a.x)<1?n="center":t.angle>Math.PI||t.angle<=0?n=o>0?"left":"right":n=o>0?"right":"left"}return n},e.prototype.getLabelPoint=function(t,i,n){var a=1,o,s=t.content[n];this.isToMiddle(i)?o=this.getMiddlePoint(i.points):(t.content.length===1&&n===0?n=1:n===0&&(a=-1),o=this.getArcPoint(i,n));var l=t.offset*a,u=this.getPointAngle(o),c=t.labelEmit,h=this.getCirclePoint(u,l,o,c);return h.r===0?h.content="":(h.content=s,h.angle=u,h.color=i.color),h.rotate=t.autoRotate?this.getLabelRotate(u,l,c):t.rotate,h.start={x:o.x,y:o.y},h},e.prototype.getArcPoint=function(t,i){return i===void 0&&(i=0),!R(t.x)&&!R(t.y)?{x:t.x,y:t.y}:{x:R(t.x)?t.x[i]:t.x,y:R(t.y)?t.y[i]:t.y}},e.prototype.getPointAngle=function(t){return nn(this.getCoordinate(),t)},e.prototype.getCirclePoint=function(t,i,n,a){var o=this.getCoordinate(),s=o.getCenter(),l=Rs(o,n);if(l===0)return m(m({},s),{r:l});var u=t;if(o.isTransposed&&l>i&&!a){var c=Math.asin(i/(2*l));u=t+c*2}else l=l+i;return{x:s.x+l*Math.cos(u),y:s.y+l*Math.sin(u),r:l}},e.prototype.getLabelRotate=function(t,i,n){var a=t+uo;return n&&(a-=uo),a&&(a>uo?a=a-Math.PI:a<-uo&&(a=a+Math.PI)),a},e.prototype.getMiddlePoint=function(t){var i=this.getCoordinate(),n=t.length,a={x:0,y:0};return C(t,function(o){a.x+=o.x,a.y+=o.y}),a.x/=n,a.y/=n,a=i.convert(a),a},e.prototype.isToMiddle=function(t){return t.x.length>2},e}(Ys),kE=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.defaultLayout="distribute",t}return e.prototype.getDefaultLabelCfg=function(t,i){var n=r.prototype.getDefaultLabelCfg.call(this,t,i);return H({},n,A(this.geometry.theme,"pieLabels",{}))},e.prototype.getLabelOffset=function(t){return r.prototype.getLabelOffset.call(this,t)||0},e.prototype.getLabelRotate=function(t,i,n){var a;return i<0&&(a=t,a>Math.PI/2&&(a=a-Math.PI),a<-Math.PI/2&&(a=a+Math.PI)),a},e.prototype.getLabelAlign=function(t){var i=this.getCoordinate(),n=i.getCenter(),a;return t.angle<=Math.PI/2&&t.x>=n.x?a="left":a="right",t.offset<=0&&(a==="right"?a="left":a="right"),a},e.prototype.getArcPoint=function(t){return t},e.prototype.getPointAngle=function(t){var i=this.getCoordinate(),n={x:R(t.x)?t.x[0]:t.x,y:t.y[0]},a={x:R(t.x)?t.x[1]:t.x,y:t.y[1]},o,s=nn(i,n);if(t.points&&t.points[0].y===t.points[1].y)o=s;else{var l=nn(i,a);s>=l&&(l=l+Math.PI*2),o=s+(l-s)/2}return o},e.prototype.getCirclePoint=function(t,i){var n=this.getCoordinate(),a=n.getCenter(),o=n.getRadius()+i;return m(m({},Ot(a.x,a.y,o,t)),{angle:t,r:o})},e}(cm),Gv=4;function LE(r,e,t,i,n,a){var o,s,l=!0,u=i.start,c=i.end,h=Math.min(u.y,c.y),f=Math.abs(u.y-c.y),v,d=0,p=Number.MIN_VALUE,g=e.map(function(F){return F.y>d&&(d=F.y),F.yf&&(f=d-h);l;)for(g.forEach(function(F){var T=(Math.min.apply(p,F.targets)+Math.max.apply(p,F.targets))/2;F.pos=Math.min(Math.max(p,T-F.size/2),f-F.size)}),l=!1,v=g.length;v--;)if(v>0){var y=g[v-1],x=g[v];y.pos+y.size>x.pos&&(y.size+=x.size,y.targets=y.targets.concat(x.targets),y.pos+y.size>f&&(y.pos=f-y.size),g.splice(v,1),l=!0)}v=0,g.forEach(function(F){var T=h+t/2;F.targets.forEach(function(){e[v].y=F.pos+T,T+=t,v++})});var w={};try{for(var b=ht(r),S=b.next();!S.done;S=b.next()){var M=S.value;w[M.get("id")]=M}}catch(F){o={error:F}}finally{try{S&&!S.done&&(s=b.return)&&s.call(b)}finally{if(o)throw o.error}}e.forEach(function(F){var T=F.r*F.r,L=Math.pow(Math.abs(F.y-n.y),2);if(T0){var l=14,u=o+n,c=u*2+l*2,h={start:a.start,end:a.end},f=[[],[]];r.forEach(function(v){v&&(v.textAlign==="right"?f[0].push(v):f[1].push(v))}),f.forEach(function(v,d){var p=c/l;v.length>p&&(v.sort(function(g,y){return y["..percent"]-g["..percent"]}),v.splice(p,v.length-p)),v.sort(function(g,y){return g.y-y.y}),LE(e,v,l,h,s,d)})}C(r,function(v){if(v&&v.labelLine){var d=v.offset,p=v.angle,g=Ot(s.x,s.y,o,p),y=Ot(s.x,s.y,o+d/2,p),x=v.x+A(v,"offsetX",0),w=v.y+A(v,"offsetY",0),b={x:x-Math.cos(p)*Gv,y:w-Math.sin(p)*Gv};pt(v.labelLine)||(v.labelLine={}),v.labelLine.path=["M ".concat(g.x),"".concat(g.y," Q").concat(y.x),"".concat(y.y," ").concat(b.x),b.y].join(",")}})}}function hm(r,e,t){var i=r.filter(function(d){return!d.invisible});i.sort(function(d,p){return d.y-p.y});var n=!0,a=t.minY,o=t.maxY,s=Math.abs(a-o),l,u=0,c=Number.MIN_VALUE,h=i.map(function(d){return d.y>u&&(u=d.y),d.ys&&(s=u-a);n;)for(h.forEach(function(d){var p=(Math.min.apply(c,d.targets)+Math.max.apply(c,d.targets))/2;d.pos=Math.min(Math.max(c,p-d.size/2),s-d.size),d.pos=Math.max(0,d.pos)}),n=!1,l=h.length;l--;)if(l>0){var f=h[l-1],v=h[l];f.pos+f.size>v.pos&&(f.size+=v.size,f.targets=f.targets.concat(v.targets),f.pos+f.size>s&&(f.pos=s-f.size),h.splice(l,1),n=!0)}l=0,h.forEach(function(d){var p=a+e/2;d.targets.forEach(function(){i[l].y=d.pos+p,p+=e,l++})})}var Vv=4;function PE(r,e){var t=e.getCenter(),i=e.getRadius();if(r&&r.labelLine){var n=r.angle,a=r.offset,o=Ot(t.x,t.y,i,n),s=r.x+A(r,"offsetX",0)*(Math.cos(n)>0?1:-1),l=r.y+A(r,"offsetY",0)*(Math.sin(n)>0?1:-1),u={x:s-Math.cos(n)*Vv,y:l-Math.sin(n)*Vv},c=r.labelLine.smooth,h=[],f=u.x-t.x,v=u.y-t.y,d=Math.atan(v/f);if(f<0&&(d+=Math.PI),c===!1){pt(r.labelLine)||(r.labelLine={});var p=0;(n<0&&n>-Math.PI/2||n>Math.PI*1.5)&&u.y>o.y&&(p=1),n>=0&&no.y&&(p=1),n>=Math.PI/2&&nu.y&&(p=1),(n<-Math.PI/2||n>=Math.PI&&nu.y&&(p=1);var g=a/2>4?4:Math.max(a/2-1,0),y=Ot(t.x,t.y,i+g,n),x=Ot(t.x,t.y,i+a/2,d),w=0;h.push("M ".concat(o.x," ").concat(o.y)),h.push("L ".concat(y.x," ").concat(y.y)),h.push("A ".concat(t.x," ").concat(t.y," 0 ").concat(w," ").concat(p," ").concat(x.x," ").concat(x.y)),h.push("L ".concat(u.x," ").concat(u.y))}else{var y=Ot(t.x,t.y,i+(a/2>4?4:Math.max(a/2-1,0)),n),b=o.xMath.pow(Math.E,-16)&&h.push.apply(h,["C",u.x+b*4,u.y,2*y.x-o.x,2*y.y-o.y,o.x,o.y]),h.push("L ".concat(o.x," ").concat(o.y))}r.labelLine.path=h.join(" ")}}function DE(r,e,t,i){var n,a,o=qt(r,function(T){return!B(T)}),s=e[0]&&e[0].get("coordinate");if(s){var l=s.getCenter(),u=s.getRadius(),c={};try{for(var h=ht(e),f=h.next();!f.done;f=h.next()){var v=f.value;c[v.get("id")]=v}}catch(T){n={error:T}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(n)throw n.error}}var d=A(o[0],"labelHeight",14),p=A(o[0],"offset",0);if(!(p<=0)){var g="left",y="right",x=me(o,function(T){return T.xk&&(T.sort(function(I,O){return O.percent-I.percent}),C(T,function(I,O){O+1>k&&(c[I.id].set("visible",!1),I.invisible=!0)})),hm(T,d,F)}),C(x,function(T,L){C(T,function(k){var I=L===y,O=c[k.id],z=O.getChildByIndex(0);if(z){var Y=u+p,q=k.y-l.y,D=Math.pow(Y,2),N=Math.pow(q,2),W=D-N>0?D-N:0,$=Math.sqrt(W),V=Math.abs(Math.cos(k.angle)*Y);I?k.x=l.x+Math.max($,V):k.x=l.x-Math.max($,V)}z&&(z.attr("y",k.y),z.attr("x",k.x)),PE(k,s)})})}}}var Bu=4,OE=4,BE=4;function RE(r,e,t){var i=e.getCenter(),n=e.getRadius(),a={x:r.x-(t?BE:-4),y:r.y},o=Ot(i.x,i.y,n+Bu,r.angle),s={x:a.x,y:a.y},l={x:o.x,y:o.y},u=Ot(i.x,i.y,n,r.angle),c="";if(a.y!==o.y){var h=t?4:-4;s.y=a.y,r.angle<0&&r.angle>=-Math.PI/2&&(s.x=Math.max(o.x,a.x-h),a.y0&&r.angleo.y?l.y=s.y:(l.y=o.y,l.x=Math.max(l.x,s.x-h))),r.angle>Math.PI/2&&(s.x=Math.min(o.x,a.x-h),a.y>o.y?l.y=s.y:(l.y=o.y,l.x=Math.min(l.x,s.x-h))),r.angle<-Math.PI/2&&(s.x=Math.min(o.x,a.x-h),a.ys.x||T.x===s.x&&T.y>s.y,I=B(T.offsetX)?OE:T.offsetX,O=Ot(s.x,s.y,l+Bu,T.angle),z=d+I;T.x=s.x+(k?1:-1)*(l+z),T.y=O.y}}});var p=o.start,g=o.end,y="left",x="right",w=me(r,function(T){return T.xb&&(b=Math.min(L,Math.abs(p.y-g.y)))});var S={minX:p.x,maxX:g.x,minY:s.y-b/2,maxY:s.y+b/2};C(w,function(T,L){var k=b/v;T.length>k&&(T.sort(function(I,O){return O.percent-I.percent}),C(T,function(I,O){O>k&&(u[I.id].set("visible",!1),I.invisible=!0)})),hm(T,v,S)});var M=S.minY,F=S.maxY;C(w,function(T,L){var k=L===x;C(T,function(I){var O=A(u,I&&[I.id]);if(O){if(I.yF){O.set("visible",!1);return}var z=O.getChildByIndex(0),Y=z.getCanvasBBox(),q={x:k?Y.x:Y.maxX,y:Y.y+Y.height/2};Oa(z,I.x-q.x,I.y-q.y),I.labelLine&&RE(I,o,k)}})})}}function NE(r,e,t,i){C(e,function(n){var a=i.minX,o=i.minY,s=i.maxX,l=i.maxY,u=n.getCanvasBBox(),c=u.minX,h=u.minY,f=u.maxX,v=u.maxY,d=u.x,p=u.y,g=u.width,y=u.height,x=d,w=p;(cs?x=s-g:f>s&&(x=x-(f-s)),h>l?w=l-y:v>l&&(w=w-(v-l)),(x!==d||w!==p)&&Oa(n,x-d,w-p)})}function GE(r,e,t,i){C(e,function(n,a){var o=n.getCanvasBBox(),s=t[a].getBBox();(o.minXs.maxX||o.maxY>s.maxY)&&n.remove(!0)})}var VE=100,fm=function(){function r(e){e===void 0&&(e={}),this.bitmap={};var t=e.xGap,i=t===void 0?1:t,n=e.yGap,a=n===void 0?8:n;this.xGap=i,this.yGap=a}return r.prototype.hasGap=function(e){for(var t=!0,i=this.bitmap,n=Math.round(e.minX),a=Math.round(e.maxX),o=Math.round(e.minY),s=Math.round(e.maxY),l=n;l<=a;l+=1){if(!i[l]){i[l]={};continue}if(l===n||l===a){for(var u=o;u<=s;u++)if(i[l][u]){t=!1;break}}else if(i[l][o]||i[l][s]){t=!1;break}}return t},r.prototype.fillGap=function(e){for(var t=this.bitmap,i=Math.round(e.minX),n=Math.round(e.maxX),a=Math.round(e.minY),o=Math.round(e.maxY),s=i;s<=n;s+=1)t[s]||(t[s]={});for(var s=i;s<=n;s+=this.xGap){for(var l=a;l<=o;l+=this.yGap)t[s][l]=!0;t[s][o]=!0}if(this.yGap!==1)for(var s=a;s<=o;s+=1)t[i][s]=!0,t[n][s]=!0;if(this.xGap!==1)for(var s=i;s<=n;s+=1)t[s][a]=!0,t[s][o]=!0},r.prototype.destroy=function(){this.bitmap={}},r}();function YE(r,e,t){t===void 0&&(t=VE);var i=-1,n=r.attr(),a=n.x,o=n.y,s=r.getCanvasBBox(),l=Math.sqrt(s.width*s.width+s.height*s.height),u,c=1,h=0,f=0,v=function(y){var x=y*.1;return[x*Math.cos(x),x*Math.sin(x)]};if(e.hasGap(s))return e.fillGap(s),!0;for(var d=!1,p=0,g={};Math.min(Math.abs(h),Math.abs(f))4)return[];var e=function(n,a){return[a.x-n.x,a.y-n.y]},t=e(r[0],r[1]),i=e(r[1],r[2]);return[t,i]}function co(r,e,t){e===void 0&&(e=0),t===void 0&&(t={x:0,y:0});var i=r.x,n=r.y;return{x:(i-t.x)*Math.cos(-e)+(n-t.y)*Math.sin(-e)+t.x,y:(t.x-i)*Math.sin(-e)+(n-t.y)*Math.cos(-e)+t.y}}function $v(r){var e=[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}],t=r.rotation;return t?[co(e[0],t,e[0]),co(e[1],t,e[0]),co(e[2],t,e[0]),co(e[3],t,e[0])]:e}function Hv(r,e){if(r.length>4)return{min:0,max:0};var t=[];return r.forEach(function(i){t.push(WE([i.x,i.y],e))}),{min:Math.min.apply(Math,Z([],U(t),!1)),max:Math.max.apply(Math,Z([],U(t),!1))}}function _E(r,e){return r.max>e.min&&r.minr.x+r.width+t||e.x+e.widthr.y+r.height+t||e.y+e.height"u")){var e;try{e=new Blob([r.toString()],{type:"application/javascript"})}catch{e=new window.BlobBuilder,e.append(r.toString()),e=e.getBlob()}return new ZE(URL.createObjectURL(e))}}var KE=function(r){function e(){function u(w,b){return(w[0]||0)*(b[0]||0)+(w[1]||0)*(b[1]||0)+0*(b[2]||0)}function c(w){if(w.length>4)return[];var b=function(F,T){return[T.x-F.x,T.y-F.y]},S=b(w[0],w[1]),M=b(w[1],w[2]);return[S,M]}function h(w,b,S){b===void 0&&(b=0),S===void 0&&(S={x:0,y:0});var M=w.x,F=w.y;return{x:(M-S.x)*Math.cos(-b)+(F-S.y)*Math.sin(-b)+S.x,y:(S.x-M)*Math.sin(-b)+(F-S.y)*Math.cos(-b)+S.y}}function f(w){var b=[{x:w.x,y:w.y},{x:w.x+w.width,y:w.y},{x:w.x+w.width,y:w.y+w.height},{x:w.x,y:w.y+w.height}],S=w.rotation;return S?[h(b[0],S,b[0]),h(b[1],S,b[0]),h(b[2],S,b[0]),h(b[3],S,b[0])]:b}function v(w,b){if(w.length>4)return{min:0,max:0};var S=[];return w.forEach(function(M){S.push(u([M.x,M.y],b))}),{min:Math.min.apply(null,S),max:Math.max.apply(null,S)}}function d(w,b){return w.max>b.min&&w.minw.x+w.width+S||b.x+b.widthw.y+w.height+S||b.y+b.height=a.height:o.width>=a.width}function n2(r,e,t){var i=!!r.getAdjust("stack");return i||e.every(function(n,a){var o=t[a];return i2(r,n,o)})}function a2(r,e,t){var i=r.coordinate,n=ie.fromObject(t.getBBox()),a=Xr(e);i.isTransposed?a.attr({x:n.minX+n.width/2,textAlign:"center"}):a.attr({y:n.minY+n.height/2,textBaseline:"middle"})}function o2(r,e,t){var i;if(t.length!==0){var n=(i=t[0])===null||i===void 0?void 0:i.get("element"),a=n==null?void 0:n.geometry;if(!(!a||a.type!=="interval")){var o=n2(a,e,t);o&&t.forEach(function(s,l){var u=e[l];a2(a,u,s)})}}}function s2(r){var e=500,t=[],i=Math.max(Math.floor(r.length/e),1);return C(r,function(n,a){a%i===0?t.push(n):n.set("visible",!1)}),t}function l2(r,e,t){var i;if(t.length!==0){var n=(i=t[0])===null||i===void 0?void 0:i.get("element"),a=n==null?void 0:n.geometry;if(!(!a||a.type!=="interval")){var o=s2(e),s=U(a.getXYFields(),1),l=s[0],u=[],c=[],h=me(o,function(g){return g.get("data")[l]}),f=bi(Mt(o,function(g){return g.get("data")[l]})),v;o.forEach(function(g){g.set("visible",!0)});var d=function(g){g&&(g.length&&c.push(g.pop()),c.push.apply(c,Z([],U(g),!1)))};for(Vt(f)>0&&(v=f.shift(),d(h[v])),Vt(f)>0&&(v=f.pop(),d(h[v])),C(f.reverse(),function(g){d(h[g])});c.length>0;){var p=c.shift();p.get("visible")&&(bF(p,u)?p.set("visible",!1):u.push(p))}}}}function u2(r,e){var t=r.getXYFields()[1],i=[],n=e.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return n.length>0&&i.push(n.shift()),n.length>0&&i.push(n.pop()),i.push.apply(i,Z([],U(n),!1)),i}function vm(r,e,t){return r.some(function(i){return t(i,e)})}function c2(r,e,t){var i=Math.max(0,Math.min(r.x+r.width+t,e.x+e.width+t)-Math.max(r.x-t,e.x-t)),n=Math.max(0,Math.min(r.y+r.height+t,e.y+e.height+t)-Math.max(r.y-t,e.y-t));return i*n}function qv(r,e){return vm(r,e,function(t,i){var n=Xr(t),a=Xr(i);return c2(n.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function h2(r,e,t,i,n){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||l.type!=="point")){var u=U(l.getXYFields(),2),c=u[0],h=u[1],f=me(e,function(p){return p.get("data")[c]}),v=[],d=n&&n.offset||((o=r[0])===null||o===void 0?void 0:o.offset)||12;Mt(fn(f).reverse(),function(p){for(var g=u2(l,f[p]);g.length;){var y=g.shift(),x=Xr(y);if(vm(v,y,function(S,M){return S.get("data")[c]===M.get("data")[c]&&S.get("data")[h]===M.get("data")[h]})){x.set("visible",!1);continue}var w=qv(v,y),b=!1;if(w&&(x.attr("y",x.attr("y")+2*d),b=qv(v,y)),b){x.set("visible",!1);continue}v.push(y)}})}}}function f2(r,e){var t=r.getXYFields()[1],i=[],n=e.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return n.length>0&&i.push(n.shift()),n.length>0&&i.push(n.pop()),i.push.apply(i,Z([],U(n),!1)),i}function dm(r,e,t){return r.some(function(i){return t(i,e)})}function v2(r,e,t){var i=Math.max(0,Math.min(r.x+r.width+t,e.x+e.width+t)-Math.max(r.x-t,e.x-t)),n=Math.max(0,Math.min(r.y+r.height+t,e.y+e.height+t)-Math.max(r.y-t,e.y-t));return i*n}function Uv(r,e){return dm(r,e,function(t,i){var n=Xr(t),a=Xr(i);return v2(n.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function d2(r,e,t,i,n){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||["path","line","area"].indexOf(l.type)<0)){var u=U(l.getXYFields(),2),c=u[0],h=u[1],f=me(e,function(p){return p.get("data")[c]}),v=[],d=n&&n.offset||((o=r[0])===null||o===void 0?void 0:o.offset)||12;Mt(fn(f).reverse(),function(p){for(var g=f2(l,f[p]);g.length;){var y=g.shift(),x=Xr(y);if(dm(v,y,function(S,M){return S.get("data")[c]===M.get("data")[c]&&S.get("data")[h]===M.get("data")[h]})){x.set("visible",!1);continue}var w=Uv(v,y),b=!1;if(w&&(x.attr("y",x.attr("y")+2*d),b=Uv(v,y)),b){x.set("visible",!1);continue}v.push(y)}})}}}var Dl;function p2(){return Dl||(Dl=document.createElement("canvas").getContext("2d")),Dl}var ho=dn(function(r,e){e===void 0&&(e={});var t=e.fontSize,i=e.fontFamily,n=e.fontWeight,a=e.fontStyle,o=e.fontVariant,s=p2();return s.font=[a,o,n,"".concat(t,"px"),i].join(" "),s.measureText(Q(r)?r:"").width},function(r,e){return e===void 0&&(e={}),Z([r],U(us(e)),!1).join("")}),g2=function(r,e,t){var i=16,n=ho("...",t),a;Q(r)?a=r:a=Fa(r);var o=e,s=[],l,u;if(ho(r,t)<=e)return r;for(;l=a.substr(0,i),u=ho(l,t),!(u+n>o&&u>o);)if(s.push(l),o-=u,a=a.substr(i),!a)return s.join("");for(;l=a.substr(0,1),u=ho(l,t),!(u+n>o);)if(s.push(l),o-=u,a=a.substr(1),!a)return s.join("");return"".concat(s.join(""),"...")};function y2(r,e,t,i,n){if(!(e.length<=0)){var a=(n==null?void 0:n.direction)||["top","right","bottom","left"],o=(n==null?void 0:n.action)||"translate",s=(n==null?void 0:n.margin)||0,l=e[0].get("coordinate");if(l){var u=uA(l,s),c=u.minX,h=u.minY,f=u.maxX,v=u.maxY;C(e,function(d){var p=d.getCanvasBBox(),g=p.minX,y=p.minY,x=p.maxX,w=p.maxY,b=p.x,S=p.y,M=p.width,F=p.height,T=b,L=S;if(a.indexOf("left")>=0&&(g=0&&(y=0&&(g>f?T=f-M:x>f&&(T=T-(x-f))),a.indexOf("bottom")>=0&&(y>v?L=v-F:w>v&&(L=L-(w-v))),T!==b||L!==S){var k=T-b;if(o==="translate")Oa(d,k,L-S);else if(o==="ellipsis"){var I=d.findAll(function(O){return O.get("type")==="text"});I.forEach(function(O){var z=tc(O.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),Y=O.getCanvasBBox(),q=g2(O.attr("text"),Y.width-Math.abs(k),z);O.attr("text",q)})}else d.hide()}})}}}function m2(r,e,t){var i={fillOpacity:B(r.attr("fillOpacity"))?1:r.attr("fillOpacity"),strokeOpacity:B(r.attr("strokeOpacity"))?1:r.attr("strokeOpacity"),opacity:B(r.attr("opacity"))?1:r.attr("opacity")};r.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),r.animate(i,e)}function x2(r,e,t){var i={fillOpacity:0,strokeOpacity:0,opacity:0},n=e.easing,a=e.duration,o=e.delay;r.animate(i,a,n,function(){r.remove(!0)},o)}function w2(r,e,t){var i,n=U(e,2),a=n[0],o=n[1];return r.applyToMatrix([a,o,1]),t==="x"?(r.setMatrix(Rt(r.getMatrix(),[["t",-a,-o],["s",.01,1],["t",a,o]])),i=Rt(r.getMatrix(),[["t",-a,-o],["s",100,1],["t",a,o]])):t==="y"?(r.setMatrix(Rt(r.getMatrix(),[["t",-a,-o],["s",1,.01],["t",a,o]])),i=Rt(r.getMatrix(),[["t",-a,-o],["s",1,100],["t",a,o]])):t==="xy"&&(r.setMatrix(Rt(r.getMatrix(),[["t",-a,-o],["s",.01,.01],["t",a,o]])),i=Rt(r.getMatrix(),[["t",-a,-o],["s",100,100],["t",a,o]])),i}function Zc(r,e,t,i,n){var a=t.start,o=t.end,s=t.getWidth(),l=t.getHeight(),u,c;n==="y"?(u=a.x+s/2,c=i.ya.x?i.x:a.x,c=a.y+l/2):n==="xy"&&(t.isPolar?(u=t.getCenter().x,c=t.getCenter().y):(u=(a.x+o.x)/2,c=(a.y+o.y)/2));var h=w2(r,[u,c],n);r.animate({matrix:h},e)}function b2(r,e,t){var i=t.coordinate,n=t.minYPoint;Zc(r,e,i,n,"x")}function S2(r,e,t){var i=t.coordinate,n=t.minYPoint;Zc(r,e,i,n,"y")}function C2(r,e,t){var i=t.coordinate,n=t.minYPoint;Zc(r,e,i,n,"xy")}function M2(r,e,t){var i=r.getTotalLength();r.attr("lineDash",[i]),r.animate(function(n){return{lineDashOffset:(1-n)*i}},e)}function A2(r,e,t){var i=t.toAttrs,n=i.x,a=i.y;delete i.x,delete i.y,r.attr(i),r.animate({x:n,y:a},e)}function F2(r,e,t){var i=r.getBBox(),n=r.get("origin").mappingData,a=n.points,o=a[0].y-a[1].y>0?i.maxX:i.minX,s=(i.minY+i.maxY)/2;r.applyToMatrix([o,s,1]);var l=Rt(r.getMatrix(),[["t",-o,-s],["s",.01,1],["t",o,s]]);r.setMatrix(l),r.animate({matrix:Rt(r.getMatrix(),[["t",-o,-s],["s",100,1],["t",o,s]])},e)}function T2(r,e,t){var i=r.getBBox(),n=r.get("origin").mappingData,a=(i.minX+i.maxX)/2,o=n.points,s=o[0].y-o[1].y<=0?i.maxY:i.minY;r.applyToMatrix([a,s,1]);var l=Rt(r.getMatrix(),[["t",-a,-s],["s",1,.01],["t",a,s]]);r.setMatrix(l),r.animate({matrix:Rt(r.getMatrix(),[["t",-a,-s],["s",1,100],["t",a,s]])},e)}function jv(r,e){var t,i=Qo(r,e),n=i.startAngle,a=i.endAngle;return!Xt(n,-Math.PI*.5)&&n<-Math.PI*.5&&(n+=Math.PI*2),!Xt(a,-Math.PI*.5)&&a<-Math.PI*.5&&(a+=Math.PI*2),e[5]===0&&(t=U([a,n],2),n=t[0],a=t[1]),Xt(n,Math.PI*1.5)&&(n=Math.PI*-.5),Xt(a,Math.PI*-.5)&&!Xt(n,a)&&(a=Math.PI*1.5),{startAngle:n,endAngle:a}}function Zv(r){var e;return r[0]==="M"||r[0]==="L"?e=[r[1],r[2]]:(r[0]==="a"||r[0]==="A"||r[0]==="C")&&(e=[r[r.length-2],r[r.length-1]]),e}function Qv(r){var e,t,i,n=r.filter(function(w){return w[0]==="A"||w[0]==="a"});if(n.length===0)return{startAngle:0,endAngle:0,radius:0,innerRadius:0};var a=n[0],o=n.length>1?n[1]:n[0],s=r.indexOf(a),l=r.indexOf(o),u=Zv(r[s-1]),c=Zv(r[l-1]),h=jv(u,a),f=h.startAngle,v=h.endAngle,d=jv(c,o),p=d.startAngle,g=d.endAngle;Xt(f,p)&&Xt(v,g)?(t=f,i=v):(t=Math.min(f,p),i=Math.max(v,g));var y=a[1],x=n[n.length-1][1];return y=0;u--){var c=this.getFacetsByLevel(t,u);try{for(var h=(i=void 0,ht(c)),f=h.next();!f.done;f=h.next()){var v=f.value;this.isLeaf(v)||(v.originColIndex=v.columnIndex,v.columnIndex=this.getRegionIndex(v.children),v.columnValuesLength=o.length)}}catch(d){i={error:d}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}}},e.prototype.getFacetsByLevel=function(t,i){var n=[];return t.forEach(function(a){a.rowIndex===i&&n.push(a)}),n},e.prototype.getRegionIndex=function(t){var i=t[0],n=t[t.length-1];return(n.columnIndex-i.columnIndex)/2+i.columnIndex},e.prototype.isLeaf=function(t){return!t.children||!t.children.length},e.prototype.getRows=function(){return this.cfg.fields.length+1},e.prototype.getChildFacets=function(t,i,n){var a=this,o=this.cfg.fields,s=o.length;if(!(s=v){var g=n.parsePosition([d[l],d[s.field]]);g&&f.push(g)}if(d[l]===h)return!1}),f},e.prototype.parsePercentPosition=function(t){var i=parseFloat(t[0])/100,n=parseFloat(t[1])/100,a=this.view.getCoordinate(),o=a.start,s=a.end,l={x:Math.min(o.x,s.x),y:Math.min(o.y,s.y)},u=a.getWidth()*i+l.x,c=a.getHeight()*n+l.y;return{x:u,y:c}},e.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),i=t.start,n=t.end,a=t.getWidth(),o=t.getHeight(),s={x:Math.min(i.x,n.x),y:Math.min(i.y,n.y)};return{x:s.x,y:s.y,minX:s.x,minY:s.y,maxX:s.x+a,maxY:s.y+o,width:a,height:o}},e.prototype.getAnnotationCfg=function(t,i,n){var a=this,o=this.view.getCoordinate(),s=this.view.getCanvas(),l={};if(B(i))return null;var u=i.start,c=i.end,h=i.position,f=this.parsePosition(u),v=this.parsePosition(c),d=this.parsePosition(h);if(["arc","image","line","region","regionFilter"].includes(t)&&(!f||!v))return null;if(["text","dataMarker","html"].includes(t)&&!d)return null;if(t==="arc"){var p=i;p.start,p.end;var g=yt(p,["start","end"]),y=nn(o,f),x=nn(o,v);y>x&&(x=Math.PI*2+x),l=m(m({},g),{center:o.getCenter(),radius:Rs(o,f),startAngle:y,endAngle:x})}else if(t==="image"){var w=i;w.start,w.end;var g=yt(w,["start","end"]);l=m(m({},g),{start:f,end:v,src:i.src})}else if(t==="line"){var b=i;b.start,b.end;var g=yt(b,["start","end"]);l=m(m({},g),{start:f,end:v,text:A(i,"text",null)})}else if(t==="region"){var S=i;S.start,S.end;var g=yt(S,["start","end"]);l=m(m({},g),{start:f,end:v})}else if(t==="text"){var M=this.view.getData(),F=i;F.position;var T=F.content,g=yt(F,["position","content"]),L=T;X(T)&&(L=T(M)),l=m(m(m({},d),g),{content:L})}else if(t==="dataMarker"){var k=i;k.position;var I=k.point,O=k.line,z=k.text,Y=k.autoAdjust,q=k.direction,g=yt(k,["position","point","line","text","autoAdjust","direction"]);l=m(m(m({},g),d),{coordinateBBox:this.getCoordinateBBox(),point:I,line:O,text:z,autoAdjust:Y,direction:q})}else if(t==="dataRegion"){var D=i,N=D.start,W=D.end,$=D.region,z=D.text,V=D.lineLength,g=yt(D,["start","end","region","text","lineLength"]);l=m(m({},g),{points:this.getRegionPoints(N,W),region:$,text:z,lineLength:V})}else if(t==="regionFilter"){var _=i;_.start,_.end;var et=_.apply,at=_.color,g=yt(_,["start","end","apply","color"]),K=this.view.geometries,tt=[],gt=function(Xe){Xe&&(Xe.isGroup()?Xe.getChildren().forEach(function(Mn){return gt(Mn)}):tt.push(Xe))};C(K,function(Xe){et?ai(et,Xe.type)&&C(Xe.elements,function(Mn){gt(Mn.shape)}):C(Xe.elements,function(Mn){gt(Mn.shape)})}),l=m(m({},g),{color:at,shapes:tt,start:f,end:v})}else if(t==="shape"){var Ft=i,kt=Ft.render,Ut=yt(Ft,["render"]),ar=function(Gx){if(X(i.render))return kt(Gx,a.view,{parsePosition:a.parsePosition.bind(a)})};l=m(m({},Ut),{render:ar})}else if(t==="html"){var or=i,sr=or.html;or.position;var Ut=yt(or,["html","position"]),ti=function(Xe){return X(sr)?sr(Xe,a.view):sr};l=m(m(m({},Ut),d),{parent:s.get("el").parentNode,html:ti})}var Sr=H({},n,m(m({},l),{top:i.top,style:i.style,offsetX:i.offsetX,offsetY:i.offsetY}));return t!=="html"&&(Sr.container=this.getComponentContainer(Sr)),Sr.animate=this.view.getOptions().animate&&Sr.animate&&A(i,"animate",Sr.animate),Sr.animateOption=H({},on,Sr.animateOption,i.animateOption),Sr},e.prototype.isTop=function(t){return A(t,"top",!0)},e.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},e.prototype.getAnnotationTheme=function(t){return A(this.view.getTheme(),["components","annotation",t],{})},e.prototype.updateOrCreate=function(t){var i=this.cache.get(this.getCacheKey(t));if(i){var n=t.type,a=this.getAnnotationTheme(n),o=this.getAnnotationCfg(n,t,a);o&&le(o,["container"]),i.component.update(m(m({},o||{}),{visible:!!o})),ai(vo,t.type)&&i.component.render()}else i=this.createAnnotation(t),i&&(i.component.init(),ai(vo,t.type)&&i.component.render());return i},e.prototype.syncCache=function(t){var i=this,n=new Map(this.cache);return t.forEach(function(a,o){n.set(o,a)}),n.forEach(function(a,o){Ne(i.option,function(s){return o===i.getCacheKey(s)})||(a.component.destroy(),n.delete(o))}),n},e.prototype.getCacheKey=function(t){return t},e}(mn);function Jv(r,e){var t=H({},A(r,["components","axis","common"]),A(r,["components","axis",e]));return A(t,["grid"],{})}function po(r,e,t,i){var n=[],a=e.getTicks();return r.isPolar&&a.push({value:1,text:"",tickValue:""}),a.reduce(function(o,s,l){var u=s.value;if(i)n.push({points:[r.convert(t==="y"?{x:0,y:u}:{x:u,y:0}),r.convert(t==="y"?{x:1,y:u}:{x:u,y:1})]});else if(l){var c=o.value,h=(c+u)/2;n.push({points:[r.convert(t==="y"?{x:0,y:h}:{x:h,y:0}),r.convert(t==="y"?{x:1,y:h}:{x:h,y:1})]})}return s},a[0]),n}function Bl(r,e,t,i,n){var a=e.values.length,o=[],s=t.getTicks();return s.reduce(function(l,u){var c=l?l.value:u.value,h=u.value,f=(c+h)/2;return n==="x"?o.push({points:[r.convert({x:i?h:f,y:0}),r.convert({x:i?h:f,y:1})]}):o.push({points:Mt(Array(a+1),function(v,d){return r.convert({x:d/a,y:i?h:f})})}),u},s[0]),o}function td(r,e){var t=A(e,"grid");if(t===null)return!1;var i=A(r,"grid");return!(t===void 0&&i===null)}var Fr=["container"],ed=m(m({},on),{appear:null}),V2=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.cache=new Map,i.gridContainer=i.view.getLayer(It.BG).addGroup(),i.gridForeContainer=i.view.getLayer(It.FORE).addGroup(),i.axisContainer=i.view.getLayer(It.BG).addGroup(),i.axisForeContainer=i.view.getLayer(It.FORE).addGroup(),i}return Object.defineProperty(e.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this,i=this.view.getCoordinate();C(this.getComponents(),function(n){var a=n.component,o=n.direction,s=n.type,l=n.extra,u=l.dim,c=l.scale,h=l.alignTick,f;if(s===Gt.AXIS)i.isPolar?u==="x"?f=i.isTransposed?eo(i,o):Tl(i):u==="y"&&(f=i.isTransposed?Tl(i):eo(i,o)):f=eo(i,o);else if(s===Gt.GRID)if(i.isPolar){var v=void 0;i.isTransposed?v=u==="x"?Bl(i,t.view.getYScales()[0],c,h,u):po(i,c,u,h):v=u==="x"?po(i,c,u,h):Bl(i,t.view.getXScale(),c,h,u),f={items:v,center:t.view.getCoordinate().getCenter()}}else f={items:po(i,c,u,h)};a.update(f)})},e.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var i=new Map;this.cache.forEach(function(n,a){t.has(a)?i.set(a,n):n.component.destroy()}),this.cache=i},e.prototype.clear=function(){r.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(i){t.push(i)}),t},e.prototype.updateXAxes=function(t){var i=this.view.getXScale();if(!(!i||i.isIdentity)){var n=Uo(this.option,i.field);if(n!==!1){var a=fv(n,G.BOTTOM),o=It.BG,s="x",l=this.view.getCoordinate(),u=this.getId("axis",i.field),c=this.getId("grid",i.field);if(l.isRect){var h=this.cache.get(u);if(h){var f=this.getLineAxisCfg(i,n,a);le(f,Fr),h.component.update(f),t.set(u,h)}else h=this.createLineAxis(i,n,o,a,s),this.cache.set(u,h),t.set(u,h);var v=this.cache.get(c);if(v){var f=this.getLineGridCfg(i,n,a,s);le(f,Fr),v.component.update(f),t.set(c,v)}else v=this.createLineGrid(i,n,o,a,s),v&&(this.cache.set(c,v),t.set(c,v))}else if(l.isPolar){var h=this.cache.get(u);if(h){var f=l.isTransposed?this.getLineAxisCfg(i,n,G.RADIUS):this.getCircleAxisCfg(i,n,a);le(f,Fr),h.component.update(f),t.set(u,h)}else{if(l.isTransposed){if(si(n))return;h=this.createLineAxis(i,n,o,G.RADIUS,s)}else h=this.createCircleAxis(i,n,o,a,s);this.cache.set(u,h),t.set(u,h)}var v=this.cache.get(c);if(v){var f=l.isTransposed?this.getCircleGridCfg(i,n,G.RADIUS,s):this.getLineGridCfg(i,n,G.CIRCLE,s);le(f,Fr),v.component.update(f),t.set(c,v)}else{if(l.isTransposed){if(si(n))return;v=this.createCircleGrid(i,n,o,G.RADIUS,s)}else v=this.createLineGrid(i,n,o,G.CIRCLE,s);v&&(this.cache.set(c,v),t.set(c,v))}}}}},e.prototype.updateYAxes=function(t){var i=this,n=this.view.getYScales();C(n,function(a,o){if(!(!a||a.isIdentity)){var s=a.field,l=Uo(i.option,s);if(l!==!1){var u=It.BG,c="y",h=i.getId("axis",s),f=i.getId("grid",s),v=i.view.getCoordinate();if(v.isRect){var d=fv(l,o===0?G.LEFT:G.RIGHT),p=i.cache.get(h);if(p){var g=i.getLineAxisCfg(a,l,d);le(g,Fr),p.component.update(g),t.set(h,p)}else p=i.createLineAxis(a,l,u,d,c),i.cache.set(h,p),t.set(h,p);var y=i.cache.get(f);if(y){var g=i.getLineGridCfg(a,l,d,c);le(g,Fr),y.component.update(g),t.set(f,y)}else y=i.createLineGrid(a,l,u,d,c),y&&(i.cache.set(f,y),t.set(f,y))}else if(v.isPolar){var p=i.cache.get(h);if(p){var g=v.isTransposed?i.getCircleAxisCfg(a,l,G.CIRCLE):i.getLineAxisCfg(a,l,G.RADIUS);le(g,Fr),p.component.update(g),t.set(h,p)}else{if(v.isTransposed){if(si(l))return;p=i.createCircleAxis(a,l,u,G.CIRCLE,c)}else p=i.createLineAxis(a,l,u,G.RADIUS,c);i.cache.set(h,p),t.set(h,p)}var y=i.cache.get(f);if(y){var g=v.isTransposed?i.getLineGridCfg(a,l,G.CIRCLE,c):i.getCircleGridCfg(a,l,G.RADIUS,c);le(g,Fr),y.component.update(g),t.set(f,y)}else{if(v.isTransposed){if(si(l))return;y=i.createLineGrid(a,l,u,G.CIRCLE,c)}else y=i.createCircleGrid(a,l,u,G.RADIUS,c);y&&(i.cache.set(f,y),t.set(f,y))}}}}})},e.prototype.createLineAxis=function(t,i,n,a,o){var s={component:new KM(this.getLineAxisCfg(t,i,a)),layer:n,direction:a===G.RADIUS?G.NONE:a,type:Gt.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},e.prototype.createLineGrid=function(t,i,n,a,o){var s=this.getLineGridCfg(t,i,a,o);if(s){var l={component:new tA(s),layer:n,direction:G.NONE,type:Gt.GRID,extra:{dim:o,scale:t,alignTick:A(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.createCircleAxis=function(t,i,n,a,o){var s={component:new JM(this.getCircleAxisCfg(t,i,a)),layer:n,direction:a,type:Gt.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},e.prototype.createCircleGrid=function(t,i,n,a,o){var s=this.getCircleGridCfg(t,i,a,o);if(s){var l={component:new eA(s),layer:n,direction:G.NONE,type:Gt.GRID,extra:{dim:o,scale:t,alignTick:A(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.getLineAxisCfg=function(t,i,n){var a=A(i,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=eo(o,n),l=vv(t,i),u=ro(this.view.getTheme(),n),c=A(i,["title"])?H({title:{style:{text:l}}},{title:hv(this.view.getTheme(),n,i.title)},i):i,h=H(m(m({container:a},s),{ticks:t.getTicks().map(function(w){return{id:"".concat(w.tickValue),name:w.text,value:w.value}}),verticalFactor:o.isPolar?cv(s,o.getCenter())*-1:cv(s,o.getCenter()),theme:u}),u,c),f=this.getAnimateCfg(h),v=f.animate,d=f.animateOption;h.animateOption=d,h.animate=v;var p=ty(s),g=A(h,"verticalLimitLength",p?1/3:1/2);if(g<=1){var y=this.view.getCanvas().get("width"),x=this.view.getCanvas().get("height");h.verticalLimitLength=g*(p?y:x)}return h},e.prototype.getLineGridCfg=function(t,i,n,a){if(td(ro(this.view.getTheme(),n),i)){var o=Jv(this.view.getTheme(),n),s=H({container:A(i,["top"])?this.gridForeContainer:this.gridContainer},o,A(i,"grid"),this.getAnimateCfg(i));return s.items=po(this.view.getCoordinate(),t,a,A(s,"alignTick",!0)),s}},e.prototype.getCircleAxisCfg=function(t,i,n){var a=A(i,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=t.getTicks().map(function(p){return{id:"".concat(p.tickValue),name:p.text,value:p.value}});!t.isCategory&&Math.abs(o.endAngle-o.startAngle)===Math.PI*2&&s.length&&(s[s.length-1].name="");var l=vv(t,i),u=ro(this.view.getTheme(),G.CIRCLE),c=A(i,["title"])?H({title:{style:{text:l}}},{title:hv(this.view.getTheme(),n,i.title)},i):i,h=H(m(m({container:a},Tl(this.view.getCoordinate())),{ticks:s,verticalFactor:1,theme:u}),u,c),f=this.getAnimateCfg(h),v=f.animate,d=f.animateOption;return h.animate=v,h.animateOption=d,h},e.prototype.getCircleGridCfg=function(t,i,n,a){if(td(ro(this.view.getTheme(),n),i)){var o=Jv(this.view.getTheme(),G.RADIUS),s=H({container:A(i,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},o,A(i,"grid"),this.getAnimateCfg(i)),l=A(s,"alignTick",!0),u=a==="x"?this.view.getYScales()[0]:this.view.getXScale();return s.items=Bl(this.view.getCoordinate(),u,t,l,a),s}},e.prototype.getId=function(t,i){var n=this.view.getCoordinate();return"".concat(t,"-").concat(i,"-").concat(n.type)},e.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&A(t,"animate"),animateOption:t&&t.animateOption?H({},ed,t.animateOption):ed}},e}(mn);function Or(r,e,t){return t===G.TOP?[r.minX+r.width/2-e.width/2,r.minY]:t===G.BOTTOM?[r.minX+r.width/2-e.width/2,r.maxY-e.height]:t===G.LEFT?[r.minX,r.minY+r.height/2-e.height/2]:t===G.RIGHT?[r.maxX-e.width,r.minY+r.height/2-e.height/2]:t===G.TOP_LEFT||t===G.LEFT_TOP?[r.tl.x,r.tl.y]:t===G.TOP_RIGHT||t===G.RIGHT_TOP?[r.tr.x-e.width,r.tr.y]:t===G.BOTTOM_LEFT||t===G.LEFT_BOTTOM?[r.bl.x,r.bl.y-e.height]:t===G.BOTTOM_RIGHT||t===G.RIGHT_BOTTOM?[r.br.x-e.width,r.br.y-e.height]:[0,0]}function rd(r,e){return tn(r)?r===!1?!1:{}:A(r,[e],r)}function go(r){return A(r,"position",G.BOTTOM)}var Y2=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.container=i.view.getLayer(It.FORE).addGroup(),i}return Object.defineProperty(e.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,C(this.components,function(i){var n=i.component,a=i.direction,o=El(a),s=n.get("maxWidthRatio"),l=n.get("maxHeightRatio"),u=t.getCategoryLegendSizeCfg(o,s,l),c=n.get("maxWidth"),h=n.get("maxHeight");n.update({maxWidth:Math.min(u.maxWidth,c||0),maxHeight:Math.min(u.maxHeight,h||0)});var f=n.get("padding"),v=n.getLayoutBBox(),d=new ie(v.x,v.y,v.width,v.height).expand(f),p=U(Or(t.view.viewBBox,d,a),2),g=p[0],y=p[1],x=U(Or(t.layoutBBox,d,a),2),w=x[0],b=x[1],S=0,M=0;a.startsWith("top")||a.startsWith("bottom")?(S=g,M=b):(S=w,M=y),n.setLocation({x:S+f[3],y:M+f[0]}),t.layoutBBox=t.layoutBBox.cut(d,a)})},e.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var i={},n=function(f,v,d){var p=t.getId(d.field),g=t.getComponentById(p);if(g){var y=void 0,x=rd(t.option,d.field);x!==!1&&(A(x,"custom")?y=t.getCategoryCfg(f,v,d,x,!0):d.isLinear?y=t.getContinuousCfg(f,v,d,x):d.isCategory&&(y=t.getCategoryCfg(f,v,d,x))),y&&(le(y,["container"]),g.direction=go(x),g.component.update(y),i[p]=!0)}else{var w=t.createFieldLegend(f,v,d);w&&(w.component.init(),t.components.push(w),i[p]=!0)}};if(A(this.option,"custom")){var a="global-custom",o=this.getComponentById(a);if(o){var s=this.getCategoryCfg(void 0,void 0,void 0,this.option,!0);le(s,["container"]),o.component.update(s),i[a]=!0}else{var l=this.createCustomLegend(void 0,void 0,void 0,this.option);if(l){l.init();var u=It.FORE,c=go(this.option);this.components.push({id:a,component:l,layer:u,direction:c,type:Gt.LEGEND,extra:void 0}),i[a]=!0}}}else this.loopLegends(n);var h=[];C(this.getComponents(),function(f){i[f.id]?h.push(f):f.component.destroy()}),this.components=h},e.prototype.clear=function(){r.prototype.clear.call(this),this.container.clear()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.container.remove(!0)},e.prototype.getGeometries=function(t){var i=this,n=t.geometries;return C(t.views,function(a){n=n.concat(i.getGeometries(a))}),n},e.prototype.loopLegends=function(t){var i=this.view.getRootView()===this.view;if(i){var n=this.getGeometries(this.view),a={};C(n,function(o){var s=o.getGroupAttributes();C(s,function(l){var u=l.getScale(l.type);!u||u.type==="identity"||a[u.field]||(t(o,l,u),a[u.field]=!0)})})}},e.prototype.createFieldLegend=function(t,i,n){var a,o=rd(this.option,n.field),s=It.FORE,l=go(o);if(o!==!1&&(A(o,"custom")?a=this.createCustomLegend(t,i,n,o):n.isLinear?a=this.createContinuousLegend(t,i,n,o):n.isCategory&&(a=this.createCategoryLegend(t,i,n,o))),a)return a.set("field",n.field),{id:this.getId(n.field),component:a,layer:s,direction:l,type:Gt.LEGEND,extra:{scale:n}}},e.prototype.createCustomLegend=function(t,i,n,a){var o=this.getCategoryCfg(t,i,n,a,!0);return new sv(o)},e.prototype.createContinuousLegend=function(t,i,n,a){var o=this.getContinuousCfg(t,i,n,le(a,["value"]));return new rA(o)},e.prototype.createCategoryLegend=function(t,i,n,a){var o=this.getCategoryCfg(t,i,n,a);return new sv(o)},e.prototype.getContinuousCfg=function(t,i,n,a){var o=n.getTicks(),s=Ne(o,function(p){return p.value===0}),l=Ne(o,function(p){return p.value===1}),u=o.map(function(p){var g=p.value,y=p.tickValue,x=i.mapping(n.invert(g)).join("");return{value:y,attrValue:x,color:x,scaleValue:g}});s||u.push({value:n.min,attrValue:i.mapping(n.invert(0)).join(""),color:i.mapping(n.invert(0)).join(""),scaleValue:0}),l||u.push({value:n.max,attrValue:i.mapping(n.invert(1)).join(""),color:i.mapping(n.invert(1)).join(""),scaleValue:1}),u.sort(function(p,g){return p.value-g.value});var c={min:ye(u).value,max:zt(u).value,colors:[],rail:{type:i.type},track:{}};i.type==="size"&&(c.track={style:{fill:i.type==="size"?this.view.getTheme().defaultColor:void 0}}),i.type==="color"&&(c.colors=u.map(function(p){return p.attrValue}));var h=this.container,f=go(a),v=El(f),d=A(a,"title");return d&&(d=H({text:va(n)},d)),c.container=h,c.layout=v,c.title=d,c.animateOption=on,this.mergeLegendCfg(c,a,"continuous")},e.prototype.getCategoryCfg=function(t,i,n,a,o){var s=this.container,l=A(a,"position",G.BOTTOM),u=Av(this.view.getTheme(),l),c=A(u,["marker"]),h=A(a,"marker"),f=El(l),v=A(u,["pageNavigator"]),d=A(a,"pageNavigator"),p=o?FF(c,h,a.items):By(this.view,t,i,c,h),g=A(a,"title");g&&(g=H({text:n?va(n):""},g));var y=A(a,"maxWidthRatio"),x=A(a,"maxHeightRatio"),w=this.getCategoryLegendSizeCfg(f,y,x);w.container=s,w.layout=f,w.items=p,w.title=g,w.animateOption=on,w.pageNavigator=H({},v,d);var b=this.mergeLegendCfg(w,a,l);b.reversed&&b.items.reverse();var S=A(b,"maxItemWidth");return S&&S<=1&&(b.maxItemWidth=this.view.viewBBox.width*S),b},e.prototype.mergeLegendCfg=function(t,i,n){var a=n.split("-")[0],o=Av(this.view.getTheme(),a);return H({},o,t,i)},e.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},e.prototype.getComponentById=function(t){return Ne(this.components,function(i){return i.id===t})},e.prototype.getCategoryLegendSizeCfg=function(t,i,n){i===void 0&&(i=Vh),n===void 0&&(n=Vh);var a=this.view.viewBBox,o=a.width,s=a.height;return t==="vertical"?{maxWidth:o*i,maxHeight:s}:{maxWidth:o,maxHeight:s*n}},e}(mn),$2=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.onChangeFn=Pr,i.resetMeasure=function(){i.clear()},i.onValueChange=function(n){var a=U(n,2),o=a[0],s=a[1];i.start=o,i.end=s,i.changeViewData(o,s)},i.container=i.view.getLayer(It.FORE).addGroup(),i.onChangeFn=ec(i.onValueChange,20,{leading:!0}),i.width=0,i.view.on(ot.BEFORE_CHANGE_DATA,i.resetMeasure),i.view.on(ot.BEFORE_CHANGE_SIZE,i.resetMeasure),i}return Object.defineProperty(e.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){r.prototype.destroy.call(this),this.view.off(ot.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(ot.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),i=t.start,n=t.end;B(this.start)&&(this.start=i,this.end=n);var a=this.view.getOptions().data;this.option&&!fe(a)?this.slider?this.slider=this.updateSlider():(this.slider=this.createSlider(),this.slider.component.on("sliderchange",this.onChangeFn)):this.slider&&(this.slider.component.destroy(),this.slider=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.width&&(this.measureSlider(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.start,t.end)},0)),this.slider){var i=this.view.coordinateBBox.width,n=this.slider.component.get("padding"),a=U(n,4),o=a[0];a[1],a[2];var s=a[3],l=this.slider.component.getLayoutBBox(),u=new ie(l.x,l.y,Math.min(l.width,i),l.height).expand(n),c=this.getMinMaxText(this.start,this.end),h=c.minText,f=c.maxText,v=U(Or(this.view.viewBBox,u,G.BOTTOM),2);v[0];var d=v[1],p=U(Or(this.view.coordinateBBox,u,G.BOTTOM),2),g=p[0];p[1],this.slider.component.update(m(m({},this.getSliderCfg()),{x:g+s,y:d+o,width:this.width,start:this.start,end:this.end,minText:h,maxText:f})),this.view.viewBBox=this.view.viewBBox.cut(u,G.BOTTOM)}},e.prototype.update=function(){this.render()},e.prototype.createSlider=function(){var t=this.getSliderCfg(),i=new jM(m({container:this.container},t));return i.init(),{component:i,layer:It.FORE,direction:G.BOTTOM,type:Gt.SLIDER}},e.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var i=this.getMinMaxText(this.start,this.end),n=i.minText,a=i.maxText;t=m(m({},t),{width:this.width,start:this.start,end:this.end,minText:n,maxText:a})}return this.slider.component.update(t),this.slider},e.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},e.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if(pt(this.option)){var i=m({data:this.getData()},A(this.option,"trendCfg",{}));t=H({},t,this.getThemeOptions(),this.option),t=m(m({},t),{trendCfg:i})}return t.start=Ct(Math.min(B(t.start)?0:t.start,B(t.end)?1:t.end),0,1),t.end=Ct(Math.max(B(t.start)?0:t.start,B(t.end)?1:t.end),0,1),t},e.prototype.getData=function(){var t=this.view.getOptions().data,i=U(this.view.getYScales(),1),n=i[0],a=this.view.getGroupScales();if(a.length){var o=a[0],s=o.field,l=o.ticks;return t.reduce(function(u,c){return c[s]===l[0]&&u.push(c[n.field]),u},[])}return t.map(function(u){return u[n.field]||0})},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return A(t,["components","slider","common"],{})},e.prototype.getMinMaxText=function(t,i){var n=this.view.getOptions().data,a=this.view.getXScale(),o=Ve(n,a.field);a.isLinear&&(o=o.sort());var s=o,l=Vt(n);if(!a||!l)return{};var u=Vt(s),c=Math.round(t*(u-1)),h=Math.round(i*(u-1)),f=A(s,[c]),v=A(s,[h]),d=this.getSliderCfg().formatter;return d&&(f=d(f,n[c],c),v=d(v,n[h],h)),{minText:f,maxText:v}},e.prototype.changeViewData=function(t,i){var n=this.view.getOptions().data,a=this.view.getXScale(),o=Vt(n);if(!(!a||!o)){var s=Ve(n,a.field),l=this.view.getXScale().isLinear?s.sort(function(v,d){return Number(v)-Number(d)}):s,u=l,c=Vt(u),h=Math.round(t*(c-1)),f=Math.round(i*(c-1));this.view.filter(a.field,function(v,d){var p=u.indexOf(v);return p>-1?Wi(p,h,f):!0}),this.view.render(!0)}},e.prototype.getComponents=function(){return this.slider?[this.slider]:[]},e.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},e}(mn),yo=0,id=8,H2=32,X2=20,W2=function(r){E(e,r);function e(t){var i=r.call(this,t)||this;return i.onChangeFn=Pr,i.resetMeasure=function(){i.clear()},i.onValueChange=function(n){var a=n.ratio,o=i.getValidScrollbarCfg().animate;i.ratio=Ct(a,0,1);var s=i.view.getOptions().animate;o||i.view.animate(!1),i.changeViewData(i.getScrollRange(),!0),i.view.animate(s)},i.container=i.view.getLayer(It.FORE).addGroup(),i.onChangeFn=ec(i.onValueChange,20,{leading:!0}),i.trackLen=0,i.thumbLen=0,i.ratio=0,i.view.on(ot.BEFORE_CHANGE_DATA,i.resetMeasure),i.view.on(ot.BEFORE_CHANGE_SIZE,i.resetMeasure),i}return Object.defineProperty(e.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){r.prototype.destroy.call(this),this.view.off(ot.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(ot.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().scrollbar,this.option?this.scrollbar?this.scrollbar=this.updateScrollbar():(this.scrollbar=this.createScrollbar(),this.scrollbar.component.on("scrollchange",this.onChangeFn)):this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.trackLen&&(this.measureScrollbar(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.getScrollRange(),!0)})),this.scrollbar){var i=this.view.coordinateBBox.width,n=this.scrollbar.component.get("padding"),a=this.scrollbar.component.getLayoutBBox(),o=new ie(a.x,a.y,Math.min(a.width,i),a.height).expand(n),s=this.getScrollbarComponentCfg(),l=void 0,u=void 0;if(s.isHorizontal){var c=U(Or(this.view.viewBBox,o,G.BOTTOM),2);c[0];var h=c[1],f=U(Or(this.view.coordinateBBox,o,G.BOTTOM),2),v=f[0];f[1],l=v,u=h}else{var d=U(Or(this.view.viewBBox,o,G.RIGHT),2);d[0];var h=d[1],p=U(Or(this.view.viewBBox,o,G.RIGHT),2),v=p[0];p[1],l=v,u=h}l+=n[3],u+=n[0],this.trackLen?this.scrollbar.component.update(m(m({},s),{x:l,y:u,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update(m(m({},s),{x:l,y:u})),this.view.viewBBox=this.view.viewBBox.cut(o,s.isHorizontal?G.BOTTOM:G.RIGHT)}},e.prototype.update=function(){this.render()},e.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},e.prototype.clear=function(){this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0),this.trackLen=0,this.thumbLen=0,this.ratio=0,this.cnt=0,this.step=0,this.data=void 0,this.xScaleCfg=void 0,this.yScalesCfg=[]},e.prototype.setValue=function(t){this.onValueChange({ratio:t})},e.prototype.getValue=function(){return this.ratio},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return A(t,["components","scrollbar","common"],{})},e.prototype.getScrollbarTheme=function(t){var i=A(this.view.getTheme(),["components","scrollbar"]),n=t||{},a=n.thumbHighlightColor,o=yt(n,["thumbHighlightColor"]);return{default:H({},A(i,["default","style"],{}),o),hover:H({},A(i,["hover","style"],{}),{thumbColor:a})}},e.prototype.measureScrollbar=function(){var t=this.view.getXScale(),i=this.view.getYScales().slice();this.data=this.getScrollbarData(),this.step=this.getStep(),this.cnt=this.getCnt();var n=this.getScrollbarComponentCfg(),a=n.trackLen,o=n.thumbLen;this.trackLen=a,this.thumbLen=o,this.xScaleCfg={field:t.field,values:t.values||[]},this.yScalesCfg=i},e.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*Ct(this.ratio,0,1)),i=Math.min(t+this.step-1,this.cnt-1);return[t,i]},e.prototype.changeViewData=function(t,i){var n=this,a=U(t,2),o=a[0],s=a[1],l=this.getValidScrollbarCfg().type,u=l!=="vertical",c=Ve(this.data,this.xScaleCfg.field),h=this.view.getXScale().isLinear?c.sort(function(v,d){return Number(v)-Number(d)}):c,f=u?h:h.reverse();this.yScalesCfg.forEach(function(v){n.view.scale(v.field,{formatter:v.formatter,type:v.type,min:v.min,max:v.max,tickMethod:v.tickMethod})}),this.view.filter(this.xScaleCfg.field,function(v){var d=f.indexOf(v);return d>-1?Wi(d,o,s):!0}),this.view.render(!0)},e.prototype.createScrollbar=function(){var t=this.getValidScrollbarCfg().type,i=t!=="vertical",n=new QM(m(m({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return n.init(),{component:n,layer:It.FORE,direction:i?G.BOTTOM:G.RIGHT,type:Gt.SCROLLBAR}},e.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),i=this.trackLen?m(m({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):m({},t);return this.scrollbar.component.update(i),this.scrollbar},e.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,i=this.getValidScrollbarCfg(),n=i.type,a=i.categorySize,o=n!=="vertical";return Math.floor((o?t.width:t.height)/a)},e.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),i=this.getScrollbarData(),n=Ve(i,t.field);return Vt(n)},e.prototype.getScrollbarComponentCfg=function(){var t=this.view,i=t.coordinateBBox,n=t.viewBBox,a=this.getValidScrollbarCfg(),o=a.type,s=a.padding,l=a.width,u=a.height,c=a.style,h=o!=="vertical",f=U(s,4),v=f[0],d=f[1],p=f[2],g=f[3],y=h?{x:i.minX+g,y:n.maxY-u-p}:{x:n.maxX-l-d,y:i.minY+v},x=this.getStep(),w=this.getCnt(),b=h?i.width-g-d:i.height-v-p,S=Math.max(b*Ct(x/w,0,1),X2);return m(m({},this.getThemeOptions()),{x:y.x,y:y.y,size:h?u:l,isHorizontal:h,trackLen:b,thumbLen:S,thumbOffset:0,theme:this.getScrollbarTheme(c)})},e.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:H2,width:id,height:id,padding:[0,0,0,0],animate:!0,style:{}};return pt(this.option)&&(t=m(m({},t),this.option)),(!pt(this.option)||!this.option.padding)&&(t.padding=t.type==="horizontal"?[yo,0,yo,0]:[0,yo,0,yo]),t},e.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),i=this.getValidScrollbarCfg(),n=this.view.getOptions().data||[];return t.isReflect("y")&&i.type==="vertical"&&(n=Z([],U(n),!1).reverse()),n},e}(mn),_2={fill:"#CCD6EC",opacity:.3};function q2(r,e,t){var i,n,a,o,s,l,u=JA(r,e,t);if(u.length){u=we(u);try{for(var c=ht(u),h=c.next();!h.done;h=c.next()){var f=h.value;try{for(var v=(a=void 0,ht(f)),d=v.next();!d.done;d=v.next()){var p=d.value,g=p.mappingData,y=g.x,x=g.y;p.x=R(y)?y[y.length-1]:y,p.y=R(x)?x[x.length-1]:x}}catch(k){a={error:k}}finally{try{d&&!d.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}}}catch(k){i={error:k}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}var w=t.shared;if(w===!1&&u.length>1){var b=u[0],S=Math.abs(e.y-b[0].y);try{for(var M=ht(u),F=M.next();!F.done;F=M.next()){var T=F.value,L=Math.abs(e.y-T[0].y);L<=S&&(b=T,S=L)}}catch(k){s={error:k}}finally{try{F&&!F.done&&(l=M.return)&&l.call(M)}finally{if(s)throw s.error}}u=[b]}return bi(we(u))}return[]}var U2=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.show=function(t){var i=this.context.view,n=this.context.event,a=i.getController("tooltip").getTooltipCfg(),o=q2(i,{x:n.x,y:n.y},a);if(!Pt(o,this.items)&&(this.items=o,o.length)){var s=i.getXScale().field,l=o[0].data[s],u=[],c=i.geometries;if(C(c,function(W){if(W.type==="interval"||W.type==="schema"){var $=W.getElementsBy(function(V){var _=V.getData();return _[s]===l});u=u.concat($)}}),u.length){var h=i.getCoordinate(),f=u[0].shape.getCanvasBBox(),v=u[0].shape.getCanvasBBox(),d=f;C(u,function(W){var $=W.shape.getCanvasBBox();h.isTransposed?($.minYv.maxY&&(v=$)):($.minXv.maxX&&(v=$)),d.x=Math.min($.minX,d.minX),d.y=Math.min($.minY,d.minY),d.width=Math.max($.maxX,d.maxX)-d.x,d.height=Math.max($.maxY,d.maxY)-d.y});var p=i.backgroundGroup,g=i.coordinateBBox,y=void 0;if(h.isRect){var x=i.getXScale(),w=t||{},b=w.appendRatio,S=w.appendWidth;B(S)&&(b=B(b)?x.isLinear?0:.25:b,S=h.isTransposed?b*v.height:b*f.width);var M=void 0,F=void 0,T=void 0,L=void 0;h.isTransposed?(M=g.minX,F=Math.min(v.minY,f.minY)-S,T=g.width,L=d.height+S*2):(M=Math.min(f.minX,v.minX)-S,F=g.minY,T=d.width+S*2,L=g.height),y=[["M",M,F],["L",M+T,F],["L",M+T,F+L],["L",M,F+L],["Z"]]}else{var k=ye(u),I=zt(u),O=fa(k.getModel(),h).startAngle,z=fa(I.getModel(),h).endAngle,Y=h.getCenter(),q=h.getRadius(),D=h.innerRadius*q;y=Nr(Y.x,Y.y,q,O,z,D)}if(this.regionPath)this.regionPath.attr("path",y),this.regionPath.show();else{var N=A(t,"style",_2);this.regionPath=p.addShape({type:"path",name:"active-region",capture:!1,attrs:m(m({},N),{path:y})})}}}},e.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},e.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),r.prototype.destroy.call(this)},e}(St),pm=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.show=function(){var t=this.context,i=t.event,n=t.view,a=n.isTooltipLocked();if(!a){var o=this.timeStamp,s=+new Date,l=A(t.view.getOptions(),"tooltip.showDelay",16);if(s-o>l){var u=this.location,c={x:i.x,y:i.y};(!u||!Pt(u,c))&&this.showTooltip(n,c),this.timeStamp=s,this.location=c}}},e.prototype.hide=function(){var t=this.context.view,i=t.getController("tooltip"),n=this.context.event,a=n.clientX,o=n.clientY;i.isCursorEntered({x:a,y:o})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},e.prototype.showTooltip=function(t,i){t.showTooltip(i)},e.prototype.hideTooltip=function(t){t.hideTooltip()},e}(St),j2=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.showTooltip=function(t,i){var n=Ke(t);C(n,function(a){var o=Mu(t,a,i);a.showTooltip(o)})},e.prototype.hideTooltip=function(t){var i=Ke(t);C(i,function(n){n.hideTooltip()})},e}(pm),Z2=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.destroy=function(){r.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.show=function(){var t=this.context,i=t.event,n=this.timeStamp,a=+new Date;if(a-n>16){var o=this.location,s={x:i.x,y:i.y};(!o||!Pt(o,s))&&this.showTooltip(s),this.timeStamp=a,this.location=s}},e.prototype.hide=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var i=this.context,n=i.event,a=n.target;if(a&&a.get("tip")){if(!this.tooltip)this.renderTooltip();else{var o=i.view,s=o.canvas,l={start:{x:0,y:0},end:{x:s.get("width"),y:s.get("height")}};this.tooltip.set("region",l)}var u=a.get("tip");this.tooltip.update(m({title:u},t)),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,i=this.context.view,n=i.canvas,a={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}},o=i.getTheme(),s=A(o,["components","tooltip","domStyles"],{}),l=new Bs({parent:n.get("el").parentNode,region:a,visible:!1,crosshairs:null,domStyles:m({},H({},s,(t={},t[mr]={"max-width":"50%"},t[xr]={"word-break":"break-all"},t)))});l.init(),l.setCapture(!1),this.tooltip=l},e}(St),Kc=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="",t}return e.prototype.hasState=function(t){return t.hasState(this.stateName)},e.prototype.setElementState=function(t,i){t.setState(this.stateName,i)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},e.prototype.clearViewState=function(t){var i=this,n=vy(t,this.stateName);C(n,function(a){i.setElementState(a,!1)})},e}(St);function nd(r){return A(r.get("delegateObject"),"item")}var Jc=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.ignoreListItemStates=["unchecked"],t}return e.prototype.isItemIgnore=function(t,i){var n=this.ignoreListItemStates,a=n.filter(function(o){return i.hasState(t,o)});return!!a.length},e.prototype.setStateByComponent=function(t,i,n){var a=this.context.view,o=t.get("field"),s=_t(a);this.setElementsStateByItem(s,o,i,n)},e.prototype.setStateByElement=function(t,i){this.setElementState(t,i)},e.prototype.isMathItem=function(t,i,n){var a=this.context.view,o=an(a,i),s=Ye(t,i);return!B(s)&&n.name===o.getText(s)},e.prototype.setElementsStateByItem=function(t,i,n,a){var o=this;C(t,function(s){o.isMathItem(s,i,n)&&s.setState(o.stateName,a)})},e.prototype.setStateEnable=function(t){var i=Hr(this.context);if(i)uy(this.context)&&this.setStateByElement(i,t);else{var n=Mi(this.context);if(da(n)){var a=n.item,o=n.component;if(a&&o&&!this.isItemIgnore(a,o)){var s=this.context.event.gEvent;if(s&&s.fromShape&&s.toShape&&nd(s.fromShape)===nd(s.toShape))return;this.setStateByComponent(o,a,t)}}}},e.prototype.toggle=function(){var t=Hr(this.context);if(t){var i=t.hasState(this.stateName);this.setElementState(t,!i)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(Kc),Q2=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(Jc),K2=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.cache={},t}return e.prototype.getColorScale=function(t,i){var n=i.geometry.getAttribute("color");if(!n)return null;var a=t.getScaleByField(n.getFields()[0]);return a},e.prototype.getLinkPath=function(t,i){var n=this.context.view,a=n.getCoordinate().isTransposed,o=t.shape.getCanvasBBox(),s=i.shape.getCanvasBBox(),l=a?[["M",o.minX,o.minY],["L",s.minX,s.maxY],["L",s.maxX,s.maxY],["L",o.maxX,o.minY],["Z"]]:[["M",o.maxX,o.minY],["L",s.minX,s.minY],["L",s.minX,s.maxY],["L",o.maxX,o.maxY],["Z"]];return l},e.prototype.addLinkShape=function(t,i,n,a){var o={opacity:.4,fill:i.shape.attr("fill")};t.addShape({type:"path",attrs:m(m({},H({},o,X(a)?a(o,i):a)),{path:this.getLinkPath(i,n)})})},e.prototype.linkByElement=function(t,i){var n=this,a=this.context.view,o=this.getColorScale(a,t);if(o){var s=Ye(t,o.field);if(!this.cache[s]){var l=IA(a,o.field,s),u=this.linkGroup,c=u.addGroup();this.cache[s]=c;var h=l.length;C(l,function(f,v){if(v=0},i)},e}(th),ik=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.highlight=function(){this.setState()},e.prototype.setElementState=function(t,i){var n=this.context.view,a=_t(n);gm(a,function(o){return t===o},i)},e.prototype.clear=function(){var t=this.context.view;rh(t)},e}(eh),nk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(th),ak=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(Jc),ok=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(eh),Ii=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="",t.ignoreItemStates=[],t}return e.prototype.getTriggerListInfo=function(){var t=Mi(this.context),i=null;return da(t)&&(i={item:t.item,list:t.component}),i},e.prototype.getAllowComponents=function(){var t=this,i=this.context.view,n=py(i),a=[];return C(n,function(o){o.isList()&&t.allowSetStateByElement(o)&&a.push(o)}),a},e.prototype.hasState=function(t,i){return t.hasState(i,this.stateName)},e.prototype.clearAllComponentsState=function(){var t=this,i=this.getAllowComponents();C(i,function(n){n.clearItemsState(t.stateName)})},e.prototype.allowSetStateByElement=function(t){var i=t.get("field");if(!i)return!1;if(this.cfg&&this.cfg.componentNames){var n=t.get("name");if(this.cfg.componentNames.indexOf(n)===-1)return!1}var a=this.context.view,o=an(a,i);return o&&o.isCategory},e.prototype.allowSetStateByItem=function(t,i){var n=this.ignoreItemStates;if(n.length){var a=n.filter(function(o){return i.hasState(t,o)});return a.length===0}return!0},e.prototype.setStateByElement=function(t,i,n){var a=t.get("field"),o=this.context.view,s=an(o,a),l=Ye(i,a),u=s.getText(l);this.setItemsState(t,u,n)},e.prototype.setStateEnable=function(t){var i=this,n=Hr(this.context);if(n){var a=this.getAllowComponents();C(a,function(u){i.setStateByElement(u,n,t)})}else{var o=Mi(this.context);if(da(o)){var s=o.item,l=o.component;this.allowSetStateByElement(l)&&this.allowSetStateByItem(s,l)&&this.setItemState(l,s,t)}}},e.prototype.setItemsState=function(t,i,n){var a=this,o=t.getItems();C(o,function(s){s.name===i&&a.setItemState(t,s,n)})},e.prototype.setItemState=function(t,i,n){t.setItemState(i,this.stateName,n)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.reset=function(){this.setStateEnable(!1)},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var i=t.list,n=t.item,a=this.hasState(i,n);this.setItemState(i,n,!a)}},e.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},e}(St),sk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.active=function(){this.setState()},e}(Ii),ad="inactive",od="active";function lk(r){var e=r.getItems();C(e,function(t){r.hasState(t,od)&&r.setItemState(t,od,!1),r.hasState(t,ad)&&r.setItemState(t,ad,!1)})}var In="inactive",ri="active",nh=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=ri,t.ignoreItemStates=["unchecked"],t}return e.prototype.setItemsState=function(t,i,n){this.setHighlightBy(t,function(a){return a.name===i},n)},e.prototype.setItemState=function(t,i,n){t.getItems(),this.setHighlightBy(t,function(a){return a===i},n)},e.prototype.setHighlightBy=function(t,i,n){var a=t.getItems();if(n)C(a,function(l){i(l)?(t.hasState(l,In)&&t.setItemState(l,In,!1),t.setItemState(l,ri,!0)):t.hasState(l,ri)||t.setItemState(l,In,!0)});else{var o=t.getItemsByState(ri),s=!0;C(o,function(l){if(!i(l))return s=!1,!1}),s?this.clear():C(a,function(l){i(l)&&(t.hasState(l,ri)&&t.setItemState(l,ri,!1),t.setItemState(l,In,!0))})}},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t=this.getTriggerListInfo();if(t)lk(t.list);else{var i=this.getAllowComponents();C(i,function(n){n.clearItemsState(ri),n.clearItemsState(In)})}},e}(Ii),uk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="selected",t}return e.prototype.selected=function(){this.setState()},e}(Ii),ck=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="unchecked",t}return e.prototype.unchecked=function(){this.setState()},e}(Ii),zi="unchecked",mo="checked",hk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=mo,t}return e.prototype.setItemState=function(t,i,n){this.setCheckedBy(t,function(a){return a===i},n)},e.prototype.setCheckedBy=function(t,i,n){var a=t.getItems();n&&C(a,function(o){i(o)?(t.hasState(o,zi)&&t.setItemState(o,zi,!1),t.setItemState(o,mo,!0)):t.hasState(o,mo)||t.setItemState(o,zi,!0)})},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var i=t.list,n=t.item,a=!ls(i.getItems(),function(o){return i.hasState(o,zi)});a||i.hasState(n,zi)?this.setItemState(i,n,!0):this.reset()}},e.prototype.checked=function(){this.setState()},e.prototype.reset=function(){var t=this.getAllowComponents();C(t,function(i){i.clearItemsState(mo),i.clearItemsState(zi)})},e}(Ii),Ni="unchecked",fk=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.toggle=function(){var t,i,n,a,o,s,l,u,c=this.getTriggerListInfo();if(c!=null&&c.item){var h=c.list,f=c.item,v=h.getItems(),d=v.filter(function(k){return!h.hasState(k,Ni)}),p=v.filter(function(k){return h.hasState(k,Ni)}),g=d[0];if(v.length===d.length)try{for(var y=ht(v),x=y.next();!x.done;x=y.next()){var w=x.value;h.setItemState(w,Ni,w.id!==f.id)}}catch(k){t={error:k}}finally{try{x&&!x.done&&(i=y.return)&&i.call(y)}finally{if(t)throw t.error}}else if(v.length-p.length===1)if(g.id===f.id)try{for(var b=ht(v),S=b.next();!S.done;S=b.next()){var w=S.value;h.setItemState(w,Ni,!1)}}catch(k){n={error:k}}finally{try{S&&!S.done&&(a=b.return)&&a.call(b)}finally{if(n)throw n.error}}else try{for(var M=ht(v),F=M.next();!F.done;F=M.next()){var w=F.value;h.setItemState(w,Ni,w.id!==f.id)}}catch(k){o={error:k}}finally{try{F&&!F.done&&(s=M.return)&&s.call(M)}finally{if(o)throw o.error}}else try{for(var T=ht(v),L=T.next();!L.done;L=T.next()){var w=L.value;h.setItemState(w,Ni,w.id!==f.id)}}catch(k){l={error:k}}finally{try{L&&!L.done&&(u=T.return)&&u.call(T)}finally{if(l)throw l.error}}}},e}(Ii),sd="showRadio",Rl="legend-radio-tip",vk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.timeStamp=0,t}return e.prototype.show=function(){var t=this.getTriggerListInfo();if(t!=null&&t.item){var i=t.list,n=t.item;i.setItemState(n,sd,!0)}},e.prototype.hide=function(){var t=this.getTriggerListInfo();if(t!=null&&t.item){var i=t.list,n=t.item;i.setItemState(n,sd,!1)}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.showTip=function(){var t=this.context,i=t.event,n=this.timeStamp,a=+new Date,o=this.context.event.target;if(a-n>16&&o.get("name")==="legend-item-radio"){var s=this.location,l={x:i.x,y:i.y};this.timeStamp=a,this.location=l,(!s||!Pt(s,l))&&this.showTooltip(l)}},e.prototype.hideTip=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var i=this.context,n=i.event,a=n.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=i.view.getCanvas().get("el").getBoundingClientRect(),s=o.x,l=o.y;this.tooltip.update(m(m({title:a.get("tip")},t),{x:t.x+s,y:t.y+l})),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,i=(t={},t[mr]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[xr]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(Rl)&&document.body.removeChild(document.getElementById(Rl));var n=new Bs({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:i,containerId:Rl});n.init(),n.setCapture(!1),this.tooltip=n},e}(Ii),ah=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.maskShape=null,t.points=[],t.starting=!1,t.moving=!1,t.preMovePoint=null,t.shapeType="path",t}return e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var i="mask:".concat(t),n=this.context.view,a=this.context.event;n.emit(i,{target:this.maskShape,shape:this.maskShape,points:this.points,x:a.x,y:a.y})},e.prototype.createMask=function(){var t=this.context.view,i=this.getMaskAttrs(),n=t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:m({fill:"#C5D4EB",opacity:.3},i)});return n},e.prototype.getMaskPath=function(){return[]},e.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},e.prototype.start=function(t){this.starting=!0,this.moving=!1,this.points=[this.getCurrentPoint()],this.maskShape||(this.maskShape=this.createMask(),this.maskShape.set("capture",!1)),this.updateMask(t==null?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},e.prototype.move=function(){if(!(!this.moving||!this.maskShape)){var t=this.getCurrentPoint(),i=this.preMovePoint,n=t.x-i.x,a=t.y-i.y,o=this.points;C(o,function(s){s.x+=n,s.y+=a}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},e.prototype.updateMask=function(t){var i=H({},this.getMaskAttrs(),t);this.maskShape.attr(i)},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},e.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},e.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},e.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,r.prototype.destroy.call(this)},e}(St);function mm(r){var e=zt(r),t=0,i=0,n=0;if(r.length){var a=r[0];t=Lc(a,e)/2,i=(e.x+a.x)/2,n=(e.y+a.y)/2}return{x:i,y:n,r:t}}var dk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="circle",t}return e.prototype.getMaskAttrs=function(){return mm(this.points)},e}(ah);function xm(r){return{start:ye(r),end:zt(r)}}function wm(r,e){var t=Math.min(r.x,e.x),i=Math.min(r.y,e.y),n=Math.abs(e.x-r.x),a=Math.abs(e.y-r.y);return{x:t,y:i,width:n,height:a}}var bm=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="rect",t}return e.prototype.getRegion=function(){return xm(this.points)},e.prototype.getMaskAttrs=function(){var t=this.getRegion(),i=t.start,n=t.end;return wm(i,n)},e}(ah);function ld(r){r.x=Ct(r.x,0,1),r.y=Ct(r.y,0,1)}function Sm(r,e,t,i){var n=null,a=null,o=i.invert(ye(r)),s=i.invert(zt(r));return t&&(ld(o),ld(s)),e==="x"?(n=i.convert({x:o.x,y:0}),a=i.convert({x:s.x,y:1})):(n=i.convert({x:0,y:o.y}),a=i.convert({x:1,y:s.y})),{start:n,end:a}}var Cm=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dim="x",t.inPlot=!0,t}return e.prototype.getRegion=function(){var t=this.context.view.getCoordinate();return Sm(this.points,this.dim,this.inPlot,t)},e}(bm);function oh(r){var e=[];return r.length&&(C(r,function(t,i){i===0?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e.push(["L",r[0].x,r[0].y])),e}function Mm(r){return{path:oh(r)}}var Am=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){return oh(this.points)},e.prototype.getMaskAttrs=function(){return Mm(this.points)},e.prototype.addPoint=function(){this.resize()},e}(ah);function sh(r){return DA(r,!0)}function Fm(r){return{path:sh(r)}}var pk=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){return sh(this.points)},e.prototype.getMaskAttrs=function(){return Fm(this.points)},e}(Am),lh=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.maskShapes=[],t.starting=!1,t.moving=!1,t.recordPoints=null,t.preMovePoint=null,t.shapeType="path",t.maskType="multi-mask",t}return e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var i="".concat(this.maskType,":").concat(t),n=this.context.view,a=this.context.event,o={type:this.shapeType,name:this.maskType,get:function(s){return o.hasOwnProperty(s)?o[s]:void 0}};n.emit(i,{target:o,maskShapes:this.maskShapes,multiPoints:this.recordPoints,x:a.x,y:a.y})},e.prototype.createMask=function(t){var i=this.context.view,n=this.recordPoints[t],a=this.getMaskAttrs(n),o=i.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:m({fill:"#C5D4EB",opacity:.3},a)});this.maskShapes.push(o)},e.prototype.getMaskPath=function(t){return[]},e.prototype.show=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.show()}),this.emitEvent("show"))},e.prototype.start=function(t){this.recordPointStart(),this.starting=!0,this.moving=!1;var i=this.recordPoints.length-1;this.createMask(i),this.updateShapesCapture(!1),this.updateMask(t==null?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint(),this.updateShapesCapture(!1)},e.prototype.move=function(){if(!(!this.moving||this.maskShapes.length===0)){var t=this.getCurrentPoint(),i=this.preMovePoint,n=t.x-i.x,a=t.y-i.y,o=this.getCurMaskShapeIndex();o>-1&&(this.recordPoints[o].forEach(function(s){s.x+=n,s.y+=a}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t)}},e.prototype.updateMask=function(t){var i=this;this.recordPoints.forEach(function(n,a){var o=H({},i.getMaskAttrs(n),t);i.maskShapes[a].attr(o)})},e.prototype.resize=function(){this.starting&&this.maskShapes.length>0&&(this.recordPointContinue(),this.updateMask(),this.emitEvent("change"))},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null,this.updateShapesCapture(!0)},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.updateShapesCapture(!0)},e.prototype.hide=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.hide()}),this.emitEvent("hide"))},e.prototype.remove=function(){var t=this.getCurMaskShapeIndex();t>-1&&(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.updateShapesCapture(!0),this.emitEvent("change"))},e.prototype.clearAll=function(){this.recordPointClear(),this.maskShapes.forEach(function(t){return t.remove()}),this.maskShapes=[],this.preMovePoint=null},e.prototype.clear=function(){var t=this.getCurMaskShapeIndex();t===-1?(this.recordPointClear(),this.maskShapes.forEach(function(i){return i.remove()}),this.maskShapes=[],this.emitEvent("clearAll")):(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.emitEvent("clearSingle")),this.preMovePoint=null},e.prototype.destroy=function(){this.clear(),r.prototype.destroy.call(this)},e.prototype.getRecordPoints=function(){var t;return Z([],U((t=this.recordPoints)!==null&&t!==void 0?t:[]),!1)},e.prototype.recordPointStart=function(){var t=this.getRecordPoints(),i=this.getCurrentPoint();this.recordPoints=Z(Z([],U(t),!1),[[i]],!1)},e.prototype.recordPointContinue=function(){var t=this.getRecordPoints(),i=this.getCurrentPoint(),n=t.splice(-1,1)[0]||[];n.push(i),this.recordPoints=Z(Z([],U(t),!1),[n],!1)},e.prototype.recordPointClear=function(){this.recordPoints=[]},e.prototype.updateShapesCapture=function(t){this.maskShapes.forEach(function(i){return i.set("capture",t)})},e.prototype.getCurMaskShapeIndex=function(){var t=this.getCurrentPoint();return this.maskShapes.findIndex(function(i){var n=i.attrs,a=n.width,o=n.height,s=n.r,l=a===0||o===0||s===0;return!l&&i.isHit(t.x,t.y)})},e}(St),Tm=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="rect",t}return e.prototype.getRegion=function(t){return xm(t)},e.prototype.getMaskAttrs=function(t){var i=this.getRegion(t),n=i.start,a=i.end;return wm(n,a)},e}(lh),Em=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dim="x",t.inPlot=!0,t}return e.prototype.getRegion=function(t){var i=this.context.view.getCoordinate();return Sm(t,this.dim,this.inPlot,i)},e}(Tm),gk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="circle",t.getMaskAttrs=mm,t}return e}(lh),km=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.getMaskPath=oh,t.getMaskAttrs=Mm,t}return e.prototype.addPoint=function(){this.resize()},e}(lh),yk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.getMaskPath=sh,t.getMaskAttrs=Fm,t}return e}(km),mk=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setCursor=function(t){var i=this.context.view;i.getCanvas().setCursor(t)},e.prototype.default=function(){this.setCursor("default")},e.prototype.pointer=function(){this.setCursor("pointer")},e.prototype.move=function(){this.setCursor("move")},e.prototype.crosshair=function(){this.setCursor("crosshair")},e.prototype.wait=function(){this.setCursor("wait")},e.prototype.help=function(){this.setCursor("help")},e.prototype.text=function(){this.setCursor("text")},e.prototype.eResize=function(){this.setCursor("e-resize")},e.prototype.wResize=function(){this.setCursor("w-resize")},e.prototype.nResize=function(){this.setCursor("n-resize")},e.prototype.sResize=function(){this.setCursor("s-resize")},e.prototype.neResize=function(){this.setCursor("ne-resize")},e.prototype.nwResize=function(){this.setCursor("nw-resize")},e.prototype.seResize=function(){this.setCursor("se-resize")},e.prototype.swResize=function(){this.setCursor("sw-resize")},e.prototype.nsResize=function(){this.setCursor("ns-resize")},e.prototype.ewResize=function(){this.setCursor("ew-resize")},e.prototype.zoomIn=function(){this.setCursor("zoom-in")},e.prototype.zoomOut=function(){this.setCursor("zoom-out")},e}(St),xk=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filterView=function(t,i,n){var a=this;t.getScaleByField(i)&&t.filter(i,n),t.views&&t.views.length&&C(t.views,function(o){a.filterView(o,i,n)})},e.prototype.filter=function(){var t=Mi(this.context);if(t){var i=this.context.view,n=t.component,a=n.get("field");if(da(t)){if(a){var o=n.getItemsByState("unchecked"),s=an(i,a),l=o.map(function(v){return v.name});l.length?this.filterView(i,a,function(v){var d=s.getText(v);return!l.includes(d)}):this.filterView(i,a,null),i.render(!0)}}else if(cy(t)){var u=n.getValue(),c=U(u,2),h=c[0],f=c[1];this.filterView(i,a,function(v){return v>=h&&v<=f}),i.render(!0)}}},e}(St);function ud(r,e,t,i){var n=Math.min(t[e],i[e]),a=Math.max(t[e],i[e]),o=U(r.range,2),s=o[0],l=o[1];if(nl&&(a=l),n===l&&a===l)return null;var u=r.invert(n),c=r.invert(a);if(r.isCategory){var h=r.values.indexOf(u),f=r.values.indexOf(c),v=r.values.slice(h,f+1);return function(d){return v.includes(d)}}else return function(d){return d>=u&&d<=c}}var oe;(function(r){r.FILTER="brush-filter-processing",r.RESET="brush-filter-reset",r.BEFORE_FILTER="brush-filter:beforefilter",r.AFTER_FILTER="brush-filter:afterfilter",r.BEFORE_RESET="brush-filter:beforereset",r.AFTER_RESET="brush-filter:afterreset"})(oe||(oe={}));var Xs=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dims=["x","y"],t.startPoint=null,t.isStarted=!1,t}return e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},e.prototype.filter=function(){var t,i;if(pa(this.context)){var n=this.context.event.target,a=n.getCanvasBBox();t={x:a.x,y:a.y},i={x:a.maxX,y:a.maxY}}else{if(!this.isStarted)return;t=this.startPoint,i=this.context.getCurrentPoint()}if(!(Math.abs(t.x-i.x)<5||Math.abs(t.x-i.y)<5)){var o=this.context,s=o.view,l=o.event,u={view:s,event:l,dims:this.dims};s.emit(oe.BEFORE_FILTER,Tt.fromData(s,oe.BEFORE_FILTER,u));var c=s.getCoordinate(),h=c.invert(i),f=c.invert(t);if(this.hasDim("x")){var v=s.getXScale(),d=ud(v,"x",h,f);this.filterView(s,v.field,d)}if(this.hasDim("y")){var p=s.getYScales()[0],d=ud(p,"y",h,f);this.filterView(s,p.field,d)}this.reRender(s,{source:oe.FILTER}),s.emit(oe.AFTER_FILTER,Tt.fromData(s,oe.AFTER_FILTER,u))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(oe.BEFORE_RESET,Tt.fromData(t,oe.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var i=t.getXScale();this.filterView(t,i.field,null)}if(this.hasDim("y")){var n=t.getYScales()[0];this.filterView(t,n.field,null)}this.reRender(t,{source:oe.RESET}),t.emit(oe.AFTER_RESET,Tt.fromData(t,oe.AFTER_RESET,{}))},e.prototype.filterView=function(t,i,n){t.filter(i,n)},e.prototype.reRender=function(t,i){t.render(!0,i)},e}(St),uh=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filterView=function(t,i,n){var a=Ke(t);C(a,function(o){o.filter(i,n)})},e.prototype.reRender=function(t){var i=Ke(t);C(i,function(n){n.render(!0)})},e}(Xs),wk=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filter=function(){var t=Mi(this.context),i=this.context.view,n=_t(i);if(pa(this.context)){var a=kc(this.context,10);a&&C(n,function(p){a.includes(p)?p.show():p.hide()})}else if(t){var o=t.component,s=o.get("field");if(da(t)){if(s){var l=o.getItemsByState("unchecked"),u=an(i,s),c=l.map(function(p){return p.name});C(n,function(p){var g=Ye(p,s),y=u.getText(g);c.indexOf(y)>=0?p.hide():p.show()})}}else if(cy(t)){var h=o.getValue(),f=U(h,2),v=f[0],d=f[1];C(n,function(p){var g=Ye(p,s);g>=v&&g<=d?p.show():p.hide()})}}},e.prototype.clear=function(){var t=_t(this.context.view);C(t,function(i){i.show()})},e.prototype.reset=function(){this.clear()},e}(St),Lm=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.byRecord=!1,t}return e.prototype.filter=function(){pa(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},e.prototype.filterByRecord=function(){var t=this.context.view,i=kc(this.context,10);if(i){var n=t.getXScale().field,a=t.getYScales()[0].field,o=i.map(function(l){return l.getModel().data}),s=Ke(t);C(s,function(l){var u=_t(l);C(u,function(c){var h=c.getModel().data;gy(o,h,n,a)?c.show():c.hide()})})}},e.prototype.filterByBBox=function(){var t=this,i=this.context.view,n=Ke(i);C(n,function(a){var o=hy(t.context,a,10),s=_t(a);o&&C(s,function(l){o.includes(l)?l.show():l.hide()})})},e.prototype.reset=function(){var t=Ke(this.context.view);C(t,function(i){var n=_t(i);C(n,function(a){a.show()})})},e}(St),bk=10,Sk=5,Ck=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.buttonGroup=null,t.buttonCfg={name:"button",text:"button",textStyle:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"},padding:[8,10],style:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},activeStyle:{fill:"#e6e6e6"}},t}return e.prototype.getButtonCfg=function(){return H(this.buttonCfg,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),i=this.context.view.foregroundGroup.addGroup({name:t.name}),n=i.addShape({type:"text",name:"button-text",attrs:m({text:t.text},t.textStyle)}),a=n.getBBox(),o=Pc(t.padding),s=i.addShape({type:"rect",name:"button-rect",attrs:m({x:a.x-o[3],y:a.y-o[0],width:a.width+o[1]+o[3],height:a.height+o[0]+o[2]},t.style)});s.toBack(),i.on("mouseenter",function(){s.attr(t.activeStyle)}),i.on("mouseleave",function(){s.attr(t.style)}),this.buttonGroup=i},e.prototype.resetPosition=function(){var t=this.context.view,i=t.getCoordinate(),n=i.convert({x:1,y:1}),a=this.buttonGroup,o=a.getBBox(),s=Rt(null,[["t",n.x-o.width-bk,n.y+o.height+Sk]]);a.setMatrix(s)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var t=this.buttonGroup;t&&t.remove(),r.prototype.destroy.call(this)},e}(St),Mk=4,Ak=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.starting=!1,t.dragStart=!1,t}return e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},e.prototype.drag=function(){if(this.startPoint){var t=this.context.getCurrentPoint(),i=this.context.view,n=this.context.event;this.dragStart?i.emit("drag",{target:n.target,x:n.x,y:n.y}):Lc(t,this.startPoint)>Mk&&(i.emit("dragstart",{target:n.target,x:n.x,y:n.y}),this.dragStart=!0)}},e.prototype.end=function(){if(this.dragStart){var t=this.context.view,i=this.context.event;t.emit("dragend",{target:i.target,x:i.x,y:i.y})}this.starting=!1,this.dragStart=!1},e}(St),Fk=5,Tk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.starting=!1,t.isMoving=!1,t.startPoint=null,t.startMatrix=null,t}return e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},e.prototype.move=function(){if(this.starting){var t=this.startPoint,i=this.context.getCurrentPoint(),n=Lc(t,i);if(n>Fk&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var a=this.context.view,o=Rt(this.startMatrix,[["t",i.x-t.x,i.y-t.y]]);a.backgroundGroup.setMatrix(o),a.foregroundGroup.setMatrix(o),a.middleGroup.setMatrix(o)}}},e.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},e.prototype.reset=function(){this.starting=!1,this.startPoint=null,this.isMoving=!1;var t=this.context.view;t.backgroundGroup.resetMatrix(),t.foregroundGroup.resetMatrix(),t.middleGroup.resetMatrix(),this.isMoving=!1},e}(St),cd="x",hd="y",Im=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dims=[cd,hd],t.cfgFields=["dims"],t.cacheScaleDefs={},t}return e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.getScale=function(t){var i=this.context.view;return t==="x"?i.getXScale():i.getYScales()[0]},e.prototype.resetDim=function(t){var i=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var n=this.getScale(t);i.scale(n.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},e.prototype.reset=function(){this.resetDim(cd),this.resetDim(hd);var t=this.context.view;t.render(!0)},e}(St),Ek=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.startPoint=null,t.starting=!1,t.startCache={},t}return e.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var i=this.dims;C(i,function(n){var a=t.getScale(n),o=a.min,s=a.max,l=a.values;t.startCache[n]={min:o,max:s,values:l}})},e.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},e.prototype.translate=function(){var t=this;if(this.starting){var i=this.startPoint,n=this.context.view.getCoordinate(),a=this.context.getCurrentPoint(),o=n.invert(i),s=n.invert(a),l=s.x-o.x,u=s.y-o.y,c=this.context.view,h=this.dims;C(h,function(f){t.translateDim(f,{x:l*-1,y:u*-1})}),c.render(!0)}},e.prototype.translateDim=function(t,i){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.translateLinear(t,n,i)}},e.prototype.translateLinear=function(t,i,n){var a=this.context.view,o=this.startCache[t],s=o.min,l=o.max,u=l-s,c=n[t]*u;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:i.nice,min:s,max:l}),a.scale(i.field,{nice:!1,min:s+c,max:l+c})},e.prototype.reset=function(){r.prototype.reset.call(this),this.startPoint=null,this.starting=!1},e}(Im),kk=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.zoomRatio=.05,t}return e.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},e.prototype.zoom=function(t){var i=this,n=this.dims;C(n,function(a){i.zoomDim(a,t)}),this.context.view.render(!0)},e.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},e.prototype.zoomDim=function(t,i){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.zoomLinear(t,n,i)}},e.prototype.zoomLinear=function(t,i,n){var a=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:i.nice,min:i.min,max:i.max});var o=this.cacheScaleDefs[t],s=o.max-o.min,l=i.min,u=i.max,c=n*s,h=l-c,f=u+c,v=f-h,d=v/s;f>h&&d<100&&d>.01&&a.scale(i.field,{nice:!1,min:l-c,max:u+c})},e}(Im);function Lk(r){var e=r.gEvent.originalEvent;return e.deltaY>0}var Ik=1,Pk=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.scroll=function(t){var i=this.context,n=i.view,a=i.event;if(n.getOptions().scrollbar){var o=(t==null?void 0:t.wheelDelta)||Ik,s=n.getController("scrollbar"),l=n.getXScale(),u=n.getOptions().data,c=Vt(Ve(u,l.field)),h=Vt(l.values),f=s.getValue(),v=Math.floor((c-h)*f),d=v+(Lk(a)?o:-o),p=o/(c-h)/1e4,g=Ct(d/(c-h)+p,0,1);s.setValue(g)}},e}(St),Dk="aixs-description-tooltip",Ok=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.show=function(){var t=this.context,i=Mi(t).axis,n=i.cfg.title,a=n.description,o=n.text,s=n.descriptionTooltipStyle,l=t.event,u=l.x,c=l.y;this.tooltip||this.renderTooltip(),this.tooltip.update({title:o||"",customContent:function(){return`
    字段说明:`).concat(a,`
    `)},x:u,y:c}),this.tooltip.show()},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.hide=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,i=this.context.view,n=i.canvas,a={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}},o=new Bs({parent:n.get("el").parentNode,region:a,visible:!1,containerId:Dk,domStyles:m({},H({},(t={},t[mr]={"max-width":"50%",padding:"10px","line-height":"15px","font-size":"12px",color:"rgba(0, 0, 0, .65)"},t[xr]={"word-break":"break-all","margin-bottom":"3px"},t)))});o.init(),o.setCapture(!1),this.tooltip=o},e}(St);_A("dark",my(DF));yp("canvas",gT);yp("svg",jT);nr("Polygon",uE);nr("Interval",nE);nr("Schema",cE);nr("Path",Wc);nr("Point",sE);nr("Line",aE);nr("Area",QT);nr("Edge",KT);nr("Heatmap",JT);nr("Violin",fE);Da("base",Ys);Da("interval",EE);Da("pie",kE);Da("polar",cm);de("overlap",XE);de("distribute",IE);de("fixed-overlap",HE);de("hide-overlap",t2);de("limit-in-shape",GE);de("limit-in-canvas",NE);de("limit-in-plot",y2);de("pie-outer",DE);de("adjust-color",r2);de("interval-adjust-position",o2);de("interval-hide-overlap",l2);de("point-adjust-position",h2);de("pie-spider",zE);de("path-adjust-position",d2);Se("fade-in",m2);Se("fade-out",x2);Se("grow-in-x",b2);Se("grow-in-xy",C2);Se("grow-in-y",S2);Se("scale-in-x",F2);Se("scale-in-y",T2);Se("wave-in",k2);Se("zoom-in",L2);Se("zoom-out",I2);Se("position-update",A2);Se("sector-path-update",E2);Se("path-in",M2);yn("rect",R2);yn("mirror",B2);yn("list",D2);yn("matrix",O2);yn("circle",P2);yn("tree",z2);Li("axis",V2);Li("legend",Y2);Li("tooltip",Cy);Li("annotation",G2);Li("slider",$2);Li("scrollbar",W2);j("tooltip",pm);j("sibling-tooltip",j2);j("ellipsis-text",Z2);j("element-active",Q2);j("element-single-active",tk);j("element-range-active",J2);j("element-highlight",ih);j("element-highlight-by-x",rk);j("element-highlight-by-color",ek);j("element-single-highlight",ik);j("element-range-highlight",ym);j("element-sibling-highlight",ym,{effectSiblings:!0,effectByRecord:!0});j("element-selected",ak);j("element-single-selected",ok);j("element-range-selected",nk);j("element-link-by-color",K2);j("active-region",U2);j("list-active",sk);j("list-selected",uk);j("list-highlight",nh);j("list-unchecked",ck);j("list-checked",hk);j("list-focus",fk);j("list-radio",vk);j("legend-item-highlight",nh,{componentNames:["legend"]});j("axis-label-highlight",nh,{componentNames:["axis"]});j("axis-description",Ok);j("rect-mask",bm);j("x-rect-mask",Cm,{dim:"x"});j("y-rect-mask",Cm,{dim:"y"});j("circle-mask",dk);j("path-mask",Am);j("smooth-path-mask",pk);j("rect-multi-mask",Tm);j("x-rect-multi-mask",Em,{dim:"x"});j("y-rect-multi-mask",Em,{dim:"y"});j("circle-multi-mask",gk);j("path-multi-mask",km);j("smooth-path-multi-mask",yk);j("cursor",mk);j("data-filter",xk);j("brush",Xs);j("brush-x",Xs,{dims:["x"]});j("brush-y",Xs,{dims:["y"]});j("sibling-filter",uh);j("sibling-x-filter",uh,{dims:"x"});j("sibling-y-filter",uh,{dims:"y"});j("element-filter",wk);j("element-sibling-filter",Lm);j("element-sibling-filter-record",Lm,{byRecord:!0});j("view-drag",Ak);j("view-move",Tk);j("scale-translate",Ek);j("scale-zoom",kk);j("reset-button",Ck,{name:"reset-button",text:"reset"});j("mousewheel-scroll",Pk);function pr(r){return r.isInPlot()}it("tooltip",{start:[{trigger:"plot:mousemove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"plot:touchmove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseleave",action:"tooltip:hide"},{trigger:"plot:leave",action:"tooltip:hide"},{trigger:"plot:touchend",action:"tooltip:hide"}]});it("ellipsis-text",{start:[{trigger:"legend-item-name:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"legend-item-name:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"legend-item-name:mouseleave",action:"ellipsis-text:hide"},{trigger:"legend-item-name:touchend",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseleave",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseout",action:"ellipsis-text:hide"},{trigger:"axis-label:touchend",action:"ellipsis-text:hide"}]});it("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]});it("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]});it("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]});it("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]});it("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]});it("legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","element-active:reset"]}]});it("legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","element-highlight:reset"]}]});it("axis-label-highlight",{start:[{trigger:"axis-label:mouseenter",action:["axis-label-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"axis-label:mouseleave",action:["axis-label-highlight:reset","element-highlight:reset"]}]});it("element-list-highlight",{start:[{trigger:"element:mouseenter",action:["list-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"element:mouseleave",action:["list-highlight:reset","element-highlight:reset"]}]});it("element-range-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(r){return!r.isInShape("mask")},action:["rect-mask:start","rect-mask:show"]},{trigger:"mask:dragstart",action:["rect-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:drag",action:["rect-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end"]},{trigger:"mask:dragend",action:["rect-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(r){return!r.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]});it("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:pr,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:pr,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:pr,action:["brush:filter","brush:end","rect-mask:end","rect-mask:hide","reset-button:show"]}],rollback:[{trigger:"reset-button:click",action:["brush:reset","reset-button:hide","cursor:crosshair"]}]});it("brush-visible",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"plot:mousedown",action:["rect-mask:start","rect-mask:show"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end","rect-mask:hide","element-filter:filter","element-range-highlight:clear"]}],rollback:[{trigger:"dblclick",action:["element-filter:clear"]}]});it("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:pr,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:pr,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:pr,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]});it("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:pr,action:"path-mask:start"},{trigger:"mousedown",isEnable:pr,action:"path-mask:show"}],processing:[{trigger:"mousemove",action:"path-mask:addPoint"}],end:[{trigger:"mouseup",action:"path-mask:end"}],rollback:[{trigger:"dblclick",action:"path-mask:hide"}]});it("brush-x-multi",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"mousedown",isEnable:pr,action:["x-rect-multi-mask:start","x-rect-multi-mask:show"]},{trigger:"mask:dragstart",action:["x-rect-multi-mask:moveStart"]}],processing:[{trigger:"mousemove",isEnable:function(r){return!Ns(r)},action:["x-rect-multi-mask:resize"]},{trigger:"multi-mask:change",action:"element-range-highlight:highlight"},{trigger:"mask:drag",action:["x-rect-multi-mask:move"]}],end:[{trigger:"mouseup",action:["x-rect-multi-mask:end"]},{trigger:"mask:dragend",action:["x-rect-multi-mask:moveEnd"]}],rollback:[{trigger:"dblclick",action:["x-rect-multi-mask:clear","cursor:crosshair"]},{trigger:"multi-mask:clearAll",action:["element-range-highlight:clear"]},{trigger:"multi-mask:clearSingle",action:["element-range-highlight:highlight"]}]});it("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]});it("legend-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:["cursor:pointer","list-radio:show"]},{trigger:"legend-item:mouseleave",action:["cursor:default","list-radio:hide"]}],start:[{trigger:"legend-item:click",isEnable:function(r){return!r.isInShape("legend-item-radio")},action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","data-filter:filter","list-radio:show"]},{trigger:"legend-item-radio:mouseenter",action:["list-radio:showTip"]},{trigger:"legend-item-radio:mouseleave",action:["list-radio:hideTip"]},{trigger:"legend-item-radio:click",action:["list-focus:toggle","data-filter:filter","list-radio:show"]}]});it("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]});it("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]});it("legend-visible-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:"cursor:pointer"},{trigger:"legend-item:mouseleave",action:"cursor:default"}],start:[{trigger:"legend-item:click",action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","element-filter:filter"]}]});it("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]});it("axis-description",{start:[{trigger:"axis-description:mousemove",action:"axis-description:show"}],end:[{trigger:"axis-description:mouseleave",action:"axis-description:hide"}]});function fd(r){return r.gEvent.preventDefault(),r.gEvent.originalEvent.deltaY>0}it("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(r){return fd(r.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(r){return!fd(r.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]});it("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]});it("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});var ce=["type","alias","tickCount","tickInterval","min","max","nice","minLimit","maxLimit","range","tickMethod","base","exponent","mask","sync"],$e;(function(r){r.ERROR="error",r.WARN="warn",r.INFO="log"})($e||($e={}));var Bk="AntV/G2Plot";function Rk(r){for(var e=[],t=1;t=0}),n=t.every(function(a){return A(a,[e])<=0});return i?{min:0}:n?{max:0}:{}}function Pm(r,e,t,i,n){if(n===void 0&&(n=[]),!Array.isArray(r))return{nodes:[],links:[]};var a=[],o={},s=-1;return r.forEach(function(l){var u=l[e],c=l[t],h=l[i],f=dt(l,n);o[u]||(o[u]=m({id:++s,name:u},f)),o[c]||(o[c]=m({id:++s,name:c},f)),a.push(m({source:o[u].id,target:o[c].id,value:h},f))}),{nodes:Object.values(o).sort(function(l,u){return l.id-u.id}),links:a}}function ln(r,e){var t=qt(r,function(i){var n=i[e];return n===null||typeof n=="number"&&!isNaN(n)});return br($e.WARN,t.length===r.length,"illegal data existed in chart data."),t}var zk=5,Nk={}.toString,Dm=function(r,e){return Nk.call(r)==="[object "+e+"]"},Gk=function(r){return Dm(r,"Array")},Vk=function(r){return typeof r=="object"&&r!==null},vd=function(r){if(!Vk(r)||!Dm(r,"Object"))return!1;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e},Om=function(r,e,t,i){t=t||0,i=i||zk;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=e[n];a?vd(a)?(vd(r[n])||(r[n]={}),t=i&&r<=n}function Wr(r){if(rt(r))return[r,r,r,r];if(R(r)){var e=r.length;if(e===1)return[r[0],r[0],r[0],r[0]];if(e===2)return[r[0],r[1],r[0],r[1]];if(e===3)return[r[0],r[1],r[2],r[1]];if(e===4)return r}return[0,0,0,0]}function Ws(r,e,t){e===void 0&&(e="bottom"),t===void 0&&(t=25);var i=Wr(r),n=[e.startsWith("top")?t:0,e.startsWith("right")?t:0,e.startsWith("bottom")?t:0,e.startsWith("left")?t:0];return[i[0]+n[0],i[1]+n[1],i[2]+n[2],i[3]+n[3]]}function hh(r){var e=r.map(function(i){return Wr(i)}),t=[0,0,0,0];return e.length>0&&(t=t.map(function(i,n){return e.forEach(function(a,o){i+=e[o][n]}),i})),t}function Xk(r,e){var t=[];if(r.length){t.push(["M",r[0].x,r[0].y]);for(var i=1,n=r.length;i"},key:"".concat(l===0?"top":"bottom","-statistic")},dt(s,["offsetX","offsetY","rotate","style","formatter"])))}})},Uk=function(r,e,t){var i=e.statistic,n=i.title,a=i.content;[n,a].forEach(function(o){if(o){var s=X(o.style)?o.style(t):o.style;r.annotation().html(m({position:["50%","100%"],html:function(l,u){var c=u.getCoordinate(),h=u.views[0].getCoordinate(),f=h.getCenter(),v=h.getRadius(),d=Math.max(Math.sin(h.startAngle),Math.sin(h.endAngle))*v,p=f.y+d-c.y.start-parseFloat(A(s,"fontSize",0)),g=c.getRadius()*c.innerRadius*2;Rm(l,m({width:"".concat(g,"px"),transform:"translate(-50%, ".concat(p,"px)")},Bm(s)));var y=u.getData();if(o.customHtml)return o.customHtml(l,u,t,y);var x=o.content;return o.formatter&&(x=o.formatter(t,y)),x?Q(x)?x:"".concat(x):"
    "}},dt(o,["offsetX","offsetY","rotate","style","formatter"])))}})};function zm(r,e){return e?Jt(e,function(t,i,n){return t.replace(new RegExp("{\\s*".concat(n,"\\s*}"),"g"),i)},r):r}function st(r,e){return r.views.find(function(t){return t.id===e})}function Gn(r){var e=r.parent;return e?e.views:[]}function pd(r){return Gn(r).filter(function(e){return e!==r})}function Ra(r,e,t){t===void 0&&(t=r.geometries),typeof e=="boolean"?r.animate(e):r.animate(!0),C(t,function(i){var n;X(e)?n=e(i.type||i.shapeType,i)||!0:n=e,i.animate(n)})}function qs(){return typeof window=="object"?window==null?void 0:window.devicePixelRatio:2}function fh(r,e){e===void 0&&(e=r);var t=document.createElement("canvas"),i=qs();t.width=r*i,t.height=e*i,t.style.width="".concat(r,"px"),t.style.height="".concat(e,"px");var n=t.getContext("2d");return n.scale(i,i),t}function vh(r,e,t,i){i===void 0&&(i=t);var n=e.backgroundColor,a=e.opacity;r.globalAlpha=a,r.fillStyle=n,r.beginPath(),r.fillRect(0,0,t,i),r.closePath()}function Nm(r,e,t){var i=r+e;return t?i*2:i}function Gm(r,e){var t=e?[[r*.25,r*.25],[r*.75,r*.75]]:[[r*.5,r*.5]];return t}function dh(r,e){var t=e*Math.PI/180,i={a:Math.cos(t)*(1/r),b:Math.sin(t)*(1/r),c:-Math.sin(t)*(1/r),d:Math.cos(t)*(1/r),e:0,f:0};return i}var jk={size:6,padding:2,backgroundColor:"transparent",opacity:1,rotation:0,fill:"#fff",fillOpacity:.5,stroke:"transparent",lineWidth:0,isStagger:!0};function Zk(r,e,t,i){var n=e.size,a=e.fill,o=e.lineWidth,s=e.stroke,l=e.fillOpacity;r.beginPath(),r.globalAlpha=l,r.fillStyle=a,r.strokeStyle=s,r.lineWidth=o,r.arc(t,i,n/2,0,2*Math.PI,!1),r.fill(),o&&r.stroke(),r.closePath()}function Qk(r){var e=P({},jk,r),t=e.size,i=e.padding,n=e.isStagger,a=e.rotation,o=Nm(t,i,n),s=Gm(o,n),l=fh(o,o),u=l.getContext("2d");vh(u,e,o);for(var c=0,h=s;c1&&arguments[1]!==void 0?arguments[1]:60,a=null;return function(){for(var o=this,s=arguments.length,l=new Array(s),u=0;uw){var S=b/p.length,M=Math.max(1,Math.ceil(w/S)-1),F="".concat(p.slice(0,M),"...");x.attr("text",F)}}}}function jL(r,e,t){qL(r,e,t),UL(r,e,t)}function ZL(r,e,t){return e===void 0&&(e=!0),t===void 0&&(t=!1),function(i){var n=i.options,a=i.chart,o=n.conversionTag,s=n.theme;return o&&!t&&(a.theme(P({},pt(s)?s:Un(s),{columnWidthRatio:1/3})),a.annotation().shape({render:function(l,u){var c=l.addGroup({id:"".concat(a.id,"-conversion-tag-group"),name:"conversion-tag-group"}),h=Ne(a.geometries,function(d){return d.type==="interval"}),f={view:u,geometry:h,group:c,field:r,horizontal:e,options:_L(o,e)},v=h.elements;C(v,function(d,p){p>0&&jL(f,v[p-1],d)})}})),i}}function QL(r){var e=r.options,t=e.legend,i=e.seriesField,n=e.isStack;return i?t!==!1&&(t=m({position:n?"right-top":"top-left"},t)):t=!1,r.options.legend=t,r}function KL(r){var e=r.chart,t=r.options,i=t.data,n=t.columnStyle,a=t.color,o=t.columnWidthRatio,s=t.isPercent,l=t.isGroup,u=t.isStack,c=t.xField,h=t.yField,f=t.seriesField,v=t.groupField,d=t.tooltip,p=t.shape,g=s&&l&&u?IL(i,h,[c,v],h):Na(i,h,c,h,s),y=[];u&&f&&!l?g.forEach(function(b){var S=y.find(function(M){return M[c]===b[c]&&M[f]===b[f]});S?S[h]+=b[h]||0:y.push(m({},b))}):y=g,e.data(y);var x=s?m({formatter:function(b){var S;return{name:l&&u?"".concat(b[f]," - ").concat(b[v]):(S=b[f])!==null&&S!==void 0?S:b[c],value:(Number(b[h])*100).toFixed(2)+"%"}}},d):d,w=P({},r,{options:{data:y,widthRatio:o,tooltip:x,interval:{shape:p,style:n,color:a}}});return Zt(w),w}function xh(r){var e,t,i=r.options,n=i.xAxis,a=i.yAxis,o=i.xField,s=i.yField,l=i.data,u=i.isPercent,c=u?{max:1,min:0,minLimit:0,maxLimit:1}:{};return J(Lt((e={},e[o]=n,e[s]=a,e),(t={},t[o]={type:"cat"},t[s]=m(m({},ch(l,s)),c),t)))(r)}function JL(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return i===!1?e.axis(a,!1):e.axis(a,i),n===!1?e.axis(o,!1):e.axis(o,n),r}function tI(r){var e=r.chart,t=r.options,i=t.legend,n=t.seriesField;return i&&n?e.legend(n,i):i===!1&&e.legend(!1),r}function eI(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=t.isRange,o=jt(e,"interval");if(!i)o.label(!1);else{var s=i.callback,l=yt(i,["callback"]);o.label({fields:[n],callback:s,cfg:m({layout:l!=null&&l.position?void 0:[{type:"interval-adjust-position"},{type:"interval-hide-overlap"},{type:"adjust-color"},{type:"limit-in-plot",cfg:{action:"hide"}}]},Yt(a?m({content:function(u){var c;return(c=u[n])===null||c===void 0?void 0:c.join("-")}},l):l))})}return r}function rI(r){var e=r.chart,t=r.options,i=t.tooltip,n=t.isGroup,a=t.isStack,o=t.groupField,s=t.data,l=t.xField,u=t.yField,c=t.seriesField;if(i===!1)e.tooltip(!1);else{var h=i;if(n&&a){var f=h.customItems,v=(h==null?void 0:h.formatter)||function(d){return{name:"".concat(d[c]," - ").concat(d[o]),value:d[u]}};h=m(m({},h),{customItems:function(d){var p=[];return C(d,function(g){var y=qt(s,function(x){return ap(x,dt(g.data,[l,c]))});y.forEach(function(x){p.push(m(m(m({},g),{value:x[u],data:x,mappingData:{_origin:x}}),v(x)))})}),f?f(p):p}})}e.tooltip(h)}return r}function el(r,e){e===void 0&&(e=!1);var t=r.options,i=t.seriesField;return J(QL,ut,Ce("columnStyle"),Jr,Vm("rect"),KL,xh,JL,tI,rI,za,ph,eI,Km,At,xt,Et(),ZL(t.yField,!e,!!i),WL(!t.isStack),Ti)(r)}function iI(r){var e=r.options,t=e.xField,i=e.yField,n=e.xAxis,a=e.yAxis,o={left:"bottom",right:"top",top:"left",bottom:"right"},s=a!==!1?m({position:o[(a==null?void 0:a.position)||"left"]},a):!1,l=n!==!1?m({position:o[(n==null?void 0:n.position)||"bottom"]},n):!1;return m(m({},r),{options:m(m({},e),{xField:i,yField:t,xAxis:s,yAxis:l})})}function nI(r){var e=r.options,t=e.label;return t&&!t.position&&(t.position="left",t.layout||(t.layout=[{type:"interval-adjust-position"},{type:"interval-hide-overlap"},{type:"adjust-color"},{type:"limit-in-plot",cfg:{action:"hide"}}])),P({},r,{options:{label:t}})}function aI(r){var e=r.options,t=e.seriesField,i=e.isStack,n=e.legend;return t?n!==!1&&(n=m({position:i?"top-left":"right-top"},n||{})):n=!1,P({},r,{options:{legend:n}})}function oI(r){var e=r.options,t=[{type:"transpose"},{type:"reflectY"}].concat(e.coordinate||[]);return P({},r,{options:{coordinate:t}})}function sI(r){var e=r.chart,t=r.options,i=t.barStyle,n=t.barWidthRatio,a=t.minBarWidth,o=t.maxBarWidth,s=t.barBackground;return el({chart:e,options:m(m({},t),{columnStyle:i,columnWidthRatio:n,minColumnWidth:a,maxColumnWidth:o,columnBackground:s})},!0)}function t0(r){return J(iI,nI,aI,Nt,oI,sI)(r)}var lI=P({},nt.getDefaultOptions(),{barWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]}),uI=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bar",t}return e.getDefaultOptions=function(){return lI},e.prototype.changeData=function(t){var i,n;this.updateOption({data:t});var a=this,o=a.chart,s=a.options,l=s.isPercent,u=s.xField,c=s.yField,h=s.xAxis,f=s.yAxis;i=[c,u],u=i[0],c=i[1],n=[f,h],h=n[0],f=n[1];var v=m(m({},s),{xField:u,yField:c,yAxis:f,xAxis:h});xh({chart:o,options:v}),o.changeData(Na(t,u,c,u,l))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return t0},e}(nt),cI=P({},nt.getDefaultOptions(),{columnWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]}),hI=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="column",t}return e.getDefaultOptions=function(){return cI},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this.options,n=i.yField,a=i.xField,o=i.isPercent,s=this,l=s.chart,u=s.options;xh({chart:l,options:u}),this.chart.changeData(Na(t,n,a,n,o))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return el},e}(nt),Gl,_r="$$percentage$$",qr="$$mappingValue$$",gr="$$conversion$$",Gu="$$totalPercentage$$",xa="$$x$$",wa="$$y$$",fI={appendPadding:[0,80],minSize:0,maxSize:1,meta:(Gl={},Gl[qr]={min:0,max:1,nice:!1},Gl),label:{style:{fill:"#fff",fontSize:12}},tooltip:{showTitle:!1,showMarkers:!1,shared:!1},conversionTag:{offsetX:10,offsetY:0,style:{fontSize:12,fill:"rgba(0,0,0,0.45)"}}},e0="CONVERSION_TAG_NAME";function wh(r,e,t){var i=[],n=t.yField,a=t.maxSize,o=t.minSize,s=A(up(e,n),[n]),l=rt(a)?a:1,u=rt(o)?o:0;return i=Mt(r,function(c,h){var f=(c[n]||0)/s;return c[_r]=f,c[qr]=(l-u)*f+u,c[gr]=[A(r,[h-1,n]),c[n]],c}),i}function bh(r){return function(e){var t=e.chart,i=e.options,n=i.conversionTag,a=i.filteredData,o=a||t.getOptions().data;if(n){var s=n.formatter;o.forEach(function(l,u){if(!(u<=0||Number.isNaN(l[qr]))){var c=r(l,u,o,{top:!0,name:e0,text:{content:X(s)?s(l,o):s,offsetX:n.offsetX,offsetY:n.offsetY,position:"end",autoRotate:!1,style:m({textAlign:"start",textBaseline:"middle"},n.style)}});t.annotation().line(c)}})}return e}}function vI(r){var e=r.chart,t=r.options,i=t.data,n=i===void 0?[]:i,a=t.yField,o=t.maxSize,s=t.minSize,l=wh(n,n,{yField:a,maxSize:o,minSize:s});return e.data(l),r}function dI(r){var e=r.chart,t=r.options,i=t.xField,n=t.yField,a=t.color,o=t.tooltip,s=t.label,l=t.shape,u=l===void 0?"funnel":l,c=t.funnelStyle,h=t.state,f=Oe(o,[i,n]),v=f.fields,d=f.formatter;pe({chart:e,options:{type:"interval",xField:i,yField:qr,colorField:i,tooltipFields:R(v)&&v.concat([_r,gr]),mapping:{shape:u,tooltip:d,color:a,style:c},label:s,state:h}});var p=jt(r.chart,"interval");return p.adjust("symmetric"),r}function pI(r){var e=r.chart,t=r.options,i=t.isTransposed;return e.coordinate({type:"rect",actions:i?[]:[["transpose"],["scale",1,-1]]}),r}function r0(r){var e=r.options,t=r.chart,i=e.maxSize,n=A(t,["geometries","0","dataArray"],[]),a=A(t,["options","data","length"]),o=Mt(n,function(l){return A(l,["0","nextPoints","0","x"])*a-.5}),s=function(l,u,c,h){var f=i-(i-l[qr])/2;return m(m({},h),{start:[o[u-1]||u-.5,f],end:[o[u-1]||u-.5,f+.05]})};return bh(s)(r),r}function i0(r){return J(vI,dI,pI,r0)(r)}function gI(r){var e,t=r.chart,i=r.options,n=i.data,a=n===void 0?[]:n,o=i.yField;return t.data(a),t.scale((e={},e[o]={sync:!0},e)),r}function yI(r){var e=r.chart,t=r.options,i=t.data,n=t.xField,a=t.yField,o=t.color,s=t.compareField,l=t.isTransposed,u=t.tooltip,c=t.maxSize,h=t.minSize,f=t.label,v=t.funnelStyle,d=t.state,p=t.showFacetTitle;return e.facet("mirror",{fields:[s],transpose:!l,padding:l?0:[32,0,0,0],showTitle:p,eachView:function(g,y){var x=l?y.rowIndex:y.columnIndex;l||g.coordinate({type:"rect",actions:[["transpose"],["scale",x===0?-1:1,-1]]});var w=wh(y.data,i,{yField:a,maxSize:c,minSize:h});g.data(w);var b=Oe(u,[n,a,s]),S=b.fields,M=b.formatter,F=l?{offset:x===0?10:-23,position:x===0?"bottom":"top"}:{offset:10,position:"left",style:{textAlign:x===0?"end":"start"}};pe({chart:g,options:{type:"interval",xField:n,yField:qr,colorField:n,tooltipFields:R(S)&&S.concat([_r,gr]),mapping:{shape:"funnel",tooltip:M,color:o,style:v},label:f===!1?!1:P({},F,f),state:d}})}}),r}function n0(r){var e=r.chart,t=r.index,i=r.options,n=i.conversionTag,a=i.isTransposed;(rt(t)?[e]:e.views).forEach(function(o,s){var l=A(o,["geometries","0","dataArray"],[]),u=A(o,["options","data","length"]),c=Mt(l,function(f){return A(f,["0","nextPoints","0","x"])*u-.5}),h=function(f,v,d,p){var g=(t||s)===0?-1:1;return P({},p,{start:[c[v-1]||v-.5,f[qr]],end:[c[v-1]||v-.5,f[qr]+.05],text:a?{style:{textAlign:"start"}}:{offsetX:n!==!1?g*n.offsetX:0,style:{textAlign:(t||s)===0?"end":"start"}}})};bh(h)(P({},{chart:o,options:i}))})}function mI(r){var e=r.chart;return e.once("beforepaint",function(){return n0(r)}),r}function xI(r){return J(gI,yI,mI)(r)}function wI(r){var e=r.chart,t=r.options,i=t.data,n=i===void 0?[]:i,a=t.yField,o=Jt(n,function(u,c){return u+(c[a]||0)},0),s=up(n,a)[a],l=Mt(n,function(u,c){var h=[],f=[];if(u[Gu]=(u[a]||0)/o,c){var v=n[c-1][xa],d=n[c-1][wa];h[0]=v[3],f[0]=d[3],h[1]=v[2],f[1]=d[2]}else h[0]=-.5,f[0]=1,h[1]=.5,f[1]=1;return f[2]=f[1]-u[Gu],h[2]=(f[2]+1)/4,f[3]=f[2],h[3]=-h[2],u[xa]=h,u[wa]=f,u[_r]=(u[a]||0)/s,u[gr]=[A(n,[c-1,a]),u[a]],u});return e.data(l),r}function bI(r){var e=r.chart,t=r.options,i=t.xField,n=t.yField,a=t.color,o=t.tooltip,s=t.label,l=t.funnelStyle,u=t.state,c=Oe(o,[i,n]),h=c.fields,f=c.formatter;return pe({chart:e,options:{type:"polygon",xField:xa,yField:wa,colorField:i,tooltipFields:R(h)&&h.concat([_r,gr]),label:s,state:u,mapping:{tooltip:f,color:a,style:l}}}),r}function SI(r){var e=r.chart,t=r.options,i=t.isTransposed;return e.coordinate({type:"rect",actions:i?[["transpose"],["reflect","x"]]:[]}),r}function CI(r){var e=function(t,i,n,a){return m(m({},a),{start:[t[xa][1],t[wa][1]],end:[t[xa][1]+.05,t[wa][1]]})};return bh(e)(r),r}function MI(r){return J(wI,bI,SI,CI)(r)}function AI(r){var e,t=r.chart,i=r.options,n=i.data,a=n===void 0?[]:n,o=i.yField;return t.data(a),t.scale((e={},e[o]={sync:!0},e)),r}function FI(r){var e=r.chart,t=r.options,i=t.seriesField,n=t.isTransposed,a=t.showFacetTitle;return e.facet("rect",{fields:[i],padding:[n?0:32,10,0,10],showTitle:a,eachView:function(o,s){i0(P({},r,{chart:o,options:{data:s.data}}))}}),r}function TI(r){return J(AI,FI)(r)}var EI=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.rendering=!1,t}return e.prototype.change=function(t){var i=this;if(!this.rendering){var n=t.seriesField,a=t.compareField,o=a?n0:r0,s=this.context.view,l=n||a?s.views:[s];Mt(l,function(u,c){var h=u.getController("annotation"),f=qt(A(h,["option"],[]),function(d){var p=d.name;return p!==e0});h.clear(!0),C(f,function(d){typeof d=="object"&&u.annotation()[d.type](d)});var v=A(u,["filteredData"],u.getOptions().data);o({chart:u,index:c,options:m(m({},t),{filteredData:wh(v,v,t)})}),u.filterData(v),i.rendering=!0,u.render(!0)})}this.rendering=!1},e}(St),a0="funnel-conversion-tag",Vu="funnel-afterrender",o0={trigger:"afterrender",action:"".concat(a0,":change")};j(a0,EI);it(Vu,{start:[o0]});function kI(r){var e=r.options,t=e.compareField,i=e.xField,n=e.yField,a=e.locale,o=e.funnelStyle,s=e.data,l=Us(a),u={label:t?{fields:[i,n,t,_r,gr],formatter:function(h){return"".concat(h[n])}}:{fields:[i,n,_r,gr],offset:0,position:"middle",formatter:function(h){return"".concat(h[i]," ").concat(h[n])}},tooltip:{title:i,formatter:function(h){return{name:h[i],value:h[n]}}},conversionTag:{formatter:function(h){return"".concat(l.get(["conversionTag","label"]),": ").concat(Jm.apply(void 0,h[gr]))}}},c;return(t||o)&&(c=function(h){return P({},t&&{lineWidth:1,stroke:"#fff"},X(o)?o(h):o)}),P({options:u},r,{options:{funnelStyle:c,data:re(s)}})}function LI(r){var e=r.options,t=e.compareField,i=e.dynamicHeight,n=e.seriesField;return n?TI(r):t?xI(r):i?MI(r):i0(r)}function II(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return J(Lt((e={},e[a]=i,e[o]=n,e)))(r)}function PI(r){var e=r.chart;return e.axis(!1),r}function DI(r){var e=r.chart,t=r.options,i=t.legend;return i===!1?e.legend(!1):e.legend(i),r}function OI(r){var e=r.chart,t=r.options,i=t.interactions,n=t.dynamicHeight;return C(i,function(a){a.enable===!1?e.removeInteraction(a.type):e.interaction(a.type,a.cfg||{})}),n?e.removeInteraction(Vu):e.interaction(Vu,{start:[m(m({},o0),{arg:t})]}),r}function s0(r){return J(kI,LI,II,PI,Nt,OI,DI,xt,ut,Et())(r)}var BI=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="funnel",t}return e.getDefaultOptions=function(){return fI},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return s0},e.prototype.setState=function(t,i,n){n===void 0&&(n=!0);var a=ma(this.chart);C(a,function(o){i(o.getData())&&o.setState(t,n)})},e.prototype.getStates=function(){var t=ma(this.chart),i=[];return C(t,function(n){var a=n.getData(),o=n.getStates();C(o,function(s){i.push({data:a,state:s,geometry:n.geometry,element:n})})}),i},e.CONVERSATION_FIELD=gr,e.PERCENT_FIELD=_r,e.TOTAL_PERCENT_FIELD=Gu,e}(nt),wo,Sh="range",l0="type",vr="percent",RI="#f0f0f0",u0="indicator-view",c0="range-view",zI={percent:0,range:{ticks:[]},innerRadius:.9,radius:.95,startAngle:-7/6*Math.PI,endAngle:1/6*Math.PI,syncViewPadding:!0,axis:{line:null,label:{offset:-24,style:{textAlign:"center",textBaseline:"middle"}},subTickLine:{length:-8},tickLine:{length:-12},grid:null},indicator:{pointer:{style:{lineWidth:5,lineCap:"round"}},pin:{style:{r:9.75,lineWidth:4.5,fill:"#fff"}}},statistic:{title:!1},meta:(wo={},wo[Sh]={sync:"v"},wo[vr]={sync:"v",tickCount:5,tickInterval:.2},wo),animation:!1};function NI(r,e){return r.map(function(t,i){var n;return n={},n[Sh]=t-(r[i-1]||0),n[l0]="".concat(i),n[vr]=e,n})}function h0(r){var e;return[(e={},e[vr]=Ct(r,0,1),e)]}function f0(r,e){var t=A(e,["ticks"],[]),i=Vt(t)?bi(t):[0,Ct(r,0,1),1];return i[0]||i.shift(),NI(i,r)}function GI(r){var e=r.chart,t=r.options,i=t.percent,n=t.range,a=t.radius,o=t.innerRadius,s=t.startAngle,l=t.endAngle,u=t.axis,c=t.indicator,h=t.gaugeStyle,f=t.type,v=t.meter,d=n.color,p=n.width;if(c){var g=h0(i),y=e.createView({id:u0});y.data(g),y.point().position("".concat(vr,"*1")).shape(c.shape||"gauge-indicator").customInfo({defaultColor:e.getTheme().defaultColor,indicator:c}),y.coordinate("polar",{startAngle:s,endAngle:l,radius:o*a}),y.axis(vr,u),y.scale(vr,dt(u,ce))}var x=f0(i,t.range),w=e.createView({id:c0});w.data(x);var b=Q(d)?[d,RI]:d,S=Zt({chart:w,options:{xField:"1",yField:Sh,seriesField:l0,rawFields:[vr],isStack:!0,interval:{color:b,style:h,shape:f==="meter"?"meter-gauge":null},args:{zIndexReversed:!0,sortZIndex:!0},minColumnWidth:p,maxColumnWidth:p}}).ext,M=S.geometry;return M.customInfo({meter:v}),w.coordinate("polar",{innerRadius:o,radius:a,startAngle:s,endAngle:l}).transpose(),r}function VI(r){var e;return J(Lt((e={range:{min:0,max:1,maxLimit:1,minLimit:0}},e[vr]={},e)))(r)}function v0(r,e){var t=r.chart,i=r.options,n=i.statistic,a=i.percent;if(t.getController("annotation").clear(!0),n){var o=n.content,s=void 0;o&&(s=P({},{content:"".concat((a*100).toFixed(2),"%"),style:{opacity:.75,fontSize:"30px",lineHeight:1,textAlign:"center",color:"rgba(44,53,66,0.85)"}},o)),Uk(t,{statistic:m(m({},n),{content:s})},{percent:a})}return e&&t.render(!0),r}function YI(r){var e=r.chart,t=r.options,i=t.tooltip;return i?e.tooltip(P({showTitle:!1,showMarkers:!1,containerTpl:'
    ',domStyles:{"g2-tooltip":{padding:"4px 8px",fontSize:"10px"}},customContent:function(n,a){var o=A(a,[0,"data",vr],0);return"".concat((o*100).toFixed(2),"%")}},i)):e.tooltip(!1),r}function $I(r){var e=r.chart;return e.legend(!1),r}function d0(r){return J(ut,xt,GI,VI,YI,v0,At,Et(),$I)(r)}ft("point","gauge-indicator",{draw:function(r,e){var t=r.customInfo,i=t.indicator,n=t.defaultColor,a=i,o=a.pointer,s=a.pin,l=e.addGroup(),u=this.parsePoint({x:0,y:0});return o&&l.addShape("line",{name:"pointer",attrs:m({x1:u.x,y1:u.y,x2:r.x,y2:r.y,stroke:n},o.style)}),s&&l.addShape("circle",{name:"pin",attrs:m({x:u.x,y:u.y,stroke:n},s.style)}),l}});ft("interval","meter-gauge",{draw:function(r,e){var t=r.customInfo.meter,i=t===void 0?{}:t,n=i.steps,a=n===void 0?50:n,o=i.stepRatio,s=o===void 0?.5:o;a=a<1?1:a,s=Ct(s,0,1);var l=this.coordinate,u=l.startAngle,c=l.endAngle,h=0;if(s>0&&s<1){var f=c-u;h=f/a/(s/(1-s)+1-1/a)}for(var v=h/(1-s)*s,d=e.addGroup(),p=this.coordinate.getCenter(),g=this.coordinate.getRadius(),y=ve.getAngle(r,this.coordinate),x=y.startAngle,w=y.endAngle,b=x;b1?l/(i-1):s.max),!t&&!i){var c=XI(o);u=l/c}var h={},f=me(a,n);fe(f)?C(a,function(d){var p=d[e],g=md(p,u,i),y="".concat(g[0],"-").concat(g[1]);Vr(h,y)||(h[y]={range:g,count:0}),h[y].count+=1}):Object.keys(f).forEach(function(d){C(f[d],function(p){var g=p[e],y=md(g,u,i),x="".concat(y[0],"-").concat(y[1]),w="".concat(x,"-").concat(d);Vr(h,w)||(h[w]={range:y,count:0},h[w][n]=d),h[w].count+=1})});var v=[];return C(h,function(d){v.push(d)}),v}var rs="range",ba="count",WI=P({},nt.getDefaultOptions(),{columnStyle:{stroke:"#FFFFFF"},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]});function _I(r){var e=r.chart,t=r.options,i=t.data,n=t.binField,a=t.binNumber,o=t.binWidth,s=t.color,l=t.stackField,u=t.legend,c=t.columnStyle,h=p0(i,n,o,a,l);e.data(h);var f=P({},r,{options:{xField:rs,yField:ba,seriesField:l,isStack:!0,interval:{color:s,style:c}}});return Zt(f),u&&l?e.legend(l,u):e.legend(!1),r}function qI(r){var e,t=r.options,i=t.xAxis,n=t.yAxis;return J(Lt((e={},e[rs]=i,e[ba]=n,e)))(r)}function UI(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis;return i===!1?e.axis(rs,!1):e.axis(rs,i),n===!1?e.axis(ba,!1):e.axis(ba,n),r}function jI(r){var e=r.chart,t=r.options,i=t.label,n=jt(e,"interval");if(!i)n.label(!1);else{var a=i.callback,o=yt(i,["callback"]);n.label({fields:[ba],callback:a,cfg:Yt(o)})}return r}function g0(r){return J(ut,Ce("columnStyle"),_I,qI,UI,Jr,jI,Nt,At,xt)(r)}var ZI=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="histogram",t}return e.getDefaultOptions=function(){return WI},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this.options,n=i.binField,a=i.binNumber,o=i.binWidth,s=i.stackField;this.chart.changeData(p0(t,n,o,a,s))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return g0},e}(nt),QI=P({},nt.getDefaultOptions(),{tooltip:{shared:!0,showMarkers:!0,showCrosshairs:!0,crosshairs:{type:"x"}},legend:{position:"top-left",radio:{}},isStack:!1}),KI=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.active=function(){var t=this.getView(),i=this.context.event;if(i.data){var n=i.data.items,a=t.geometries.filter(function(o){return o.type==="point"});C(a,function(o){C(o.elements,function(s){var l=op(n,function(u){return u.data===s.data})!==-1;s.setState("active",l)})})}},e.prototype.reset=function(){var t=this.getView(),i=t.geometries.filter(function(n){return n.type==="point"});C(i,function(n){C(n.elements,function(a){a.setState("active",!1)})})},e.prototype.getView=function(){return this.context.view},e}(St);j("marker-active",KI);it("marker-active",{start:[{trigger:"tooltip:show",action:"marker-active:active"}],end:[{trigger:"tooltip:hide",action:"marker-active:reset"}]});var JI=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="line",t}return e.getDefaultOptions=function(){return QI},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;tl({chart:n,options:a}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Zm},e}(nt),y0=P({},nt.getDefaultOptions(),{legend:{position:"right",radio:{}},tooltip:{shared:!1,showTitle:!1,showMarkers:!1},label:{layout:{type:"limit-in-plot",cfg:{action:"ellipsis"}}},pieStyle:{stroke:"white",lineWidth:1},statistic:{title:{style:{fontWeight:300,color:"#4B535E",textAlign:"center",fontSize:"20px",lineHeight:1}},content:{style:{fontWeight:"bold",color:"rgba(44,53,66,0.85)",textAlign:"center",fontSize:"32px",lineHeight:1}}},theme:{components:{annotation:{text:{animate:!1}}}}}),tP=[1,0,0,0,1,0,0,0,1];function Yu(r,e){var t=Z([],tP,!0);return ve.transform(t,r)}var eP=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getActiveElements=function(){var t=ve.getDelegationObject(this.context);if(t){var i=this.context.view,n=t.component,a=t.item,o=n.get("field");if(o){var s=i.geometries[0].elements;return s.filter(function(l){return l.getModel().data[o]===a.value})}}return[]},e.prototype.getActiveElementLabels=function(){var t=this.context.view,i=this.getActiveElements(),n=t.geometries[0].labelsContainer.getChildren();return n.filter(function(a){return i.find(function(o){return Pt(o.getData(),a.get("data"))})})},e.prototype.transfrom=function(t){t===void 0&&(t=7.5);var i=this.getActiveElements(),n=this.getActiveElementLabels();i.forEach(function(a,o){var s=n[o],l=a.geometry.coordinate;if(l.isPolar&&l.isTransposed){var u=ve.getAngle(a.getModel(),l),c=u.startAngle,h=u.endAngle,f=(c+h)/2,v=t,d=v*Math.cos(f),p=v*Math.sin(f);a.shape.setMatrix(Yu([["t",d,p]])),s.setMatrix(Yu([["t",d,p]]))}})},e.prototype.active=function(){this.transfrom()},e.prototype.reset=function(){this.transfrom(0)},e}(St);function rP(r){var e=r.event,t,i=e.target;return i&&(t=i.get("element")),t}var iP=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getAnnotations=function(t){var i=t||this.context.view;return i.getController("annotation").option},e.prototype.getInitialAnnotation=function(){return this.initialAnnotation},e.prototype.init=function(){var t=this,i=this.context.view;i.removeInteraction("tooltip"),i.on("afterchangesize",function(){var n=t.getAnnotations(i);t.initialAnnotation=n})},e.prototype.change=function(t){var i=this.context,n=i.view,a=i.event;this.initialAnnotation||(this.initialAnnotation=this.getAnnotations());var o=A(a,["data","data"]);if(a.type.match("legend-item")){var s=ve.getDelegationObject(this.context),l=n.getGroupedFields()[0];if(s&&l){var u=s.item;o=n.getData().find(function(v){return v[l]===u.value})}}if(o){var c=A(t,"annotations",[]),h=A(t,"statistic",{});n.getController("annotation").clear(!0),C(c,function(v){typeof v=="object"&&n.annotation()[v.type](v)}),_s(n,{statistic:h,plotType:"pie"},o),n.render(!0)}var f=rP(this.context);f&&f.shape.toFront()},e.prototype.reset=function(){var t=this.context.view,i=t.getController("annotation");i.clear(!0);var n=this.getInitialAnnotation();C(n,function(a){t.annotation()[a.type](a)}),t.render(!0)},e}(St),m0="pie-statistic";j(m0,iP);it("pie-statistic-active",{start:[{trigger:"element:mouseenter",action:"pie-statistic:change"}],end:[{trigger:"element:mouseleave",action:"pie-statistic:reset"}]});j("pie-legend",eP);it("pie-legend-active",{start:[{trigger:"legend-item:mouseenter",action:"pie-legend:active"}],end:[{trigger:"legend-item:mouseleave",action:"pie-legend:reset"}]});function nP(r,e){var t=null;return C(r,function(i){typeof i[e]=="number"&&(t+=i[e])}),t}function aP(r,e){var t;switch(r){case"inner":return t="-30%",Q(e)&&e.endsWith("%")?parseFloat(e)*.01>0?t:e:e<0?e:t;case"outer":return t=12,Q(e)&&e.endsWith("%")?parseFloat(e)*.01<0?t:e:e>0?e:t;default:return e}}function is(r,e){return Qu(ln(r,e),function(t){return t[e]===0})}function oP(r){var e=r.chart,t=r.options,i=t.data,n=t.angleField,a=t.colorField,o=t.color,s=t.pieStyle,l=t.shape,u=ln(i,n);if(is(u,n)){var c="$$percentage$$";u=u.map(function(f){var v;return m(m({},f),(v={},v[c]=1/u.length,v))}),e.data(u);var h=P({},r,{options:{xField:"1",yField:c,seriesField:a,isStack:!0,interval:{color:o,shape:l,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});Zt(h)}else{e.data(u);var h=P({},r,{options:{xField:"1",yField:n,seriesField:a,isStack:!0,interval:{color:o,shape:l,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});Zt(h)}return r}function sP(r){var e,t=r.chart,i=r.options,n=i.meta,a=i.colorField,o=P({},n);return t.scale(o,(e={},e[a]={type:"cat"},e)),r}function lP(r){var e=r.chart,t=r.options,i=t.radius,n=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"theta",cfg:{radius:i,innerRadius:n,startAngle:a,endAngle:o}}),r}function uP(r){var e=r.chart,t=r.options,i=t.label,n=t.colorField,a=t.angleField,o=e.geometries[0];if(!i)o.label(!1);else{var s=i.callback,l=yt(i,["callback"]),u=Yt(l);if(u.content){var c=u.content;u.content=function(d,p,g){var y=d[n],x=d[a],w=e.getScaleByField(a),b=w==null?void 0:w.scale(x);return X(c)?c(m(m({},d),{percent:b}),p,g):Q(c)?zm(c,{value:x,name:y,percentage:rt(b)&&!B(x)?"".concat((b*100).toFixed(2),"%"):null}):c}}var h={inner:"",outer:"pie-outer",spider:"pie-spider"},f=u.type?h[u.type]:"pie-outer",v=u.layout?R(u.layout)?u.layout:[u.layout]:[];u.layout=(f?[{type:f}]:[]).concat(v),o.label({fields:n?[a,n]:[a],callback:s,cfg:m(m({},u),{offset:aP(u.type,u.offset),type:"pie"})})}return r}function x0(r){var e=r.innerRadius,t=r.statistic,i=r.angleField,n=r.colorField,a=r.meta,o=r.locale,s=Us(o);if(e&&t){var l=P({},y0.statistic,t),u=l.title,c=l.content;return u!==!1&&(u=P({},{formatter:function(h){var f=h?h[n]:B(u.content)?s.get(["statistic","total"]):u.content,v=A(a,[n,"formatter"])||function(d){return d};return v(f)}},u)),c!==!1&&(c=P({},{formatter:function(h,f){var v=h?h[i]:nP(f,i),d=A(a,[i,"formatter"])||function(p){return p};return h||B(c.content)?d(v):c.content}},c)),P({},{statistic:{title:u,content:c}},r)}return r}function w0(r){var e=r.chart,t=r.options,i=x0(t),n=i.innerRadius,a=i.statistic;return e.getController("annotation").clear(!0),J(Et())(r),n&&a&&_s(e,{statistic:a,plotType:"pie"}),r}function cP(r){var e=r.chart,t=r.options,i=t.tooltip,n=t.colorField,a=t.angleField,o=t.data;if(i===!1)e.tooltip(i);else if(e.tooltip(P({},i,{shared:!1})),is(o,a)){var s=A(i,"fields"),l=A(i,"formatter");fe(A(i,"fields"))&&(s=[n,a],l=l||function(u){return{name:u[n],value:Fa(u[a])}}),e.geometries[0].tooltip(s.join("*"),Vi(s,l))}return r}function hP(r){var e=r.chart,t=r.options,i=x0(t),n=i.interactions,a=i.statistic,o=i.annotations;return C(n,function(s){var l,u;if(s.enable===!1)e.removeInteraction(s.type);else if(s.type==="pie-statistic-active"){var c=[];!((l=s.cfg)===null||l===void 0)&&l.start||(c=[{trigger:"element:mouseenter",action:"".concat(m0,":change"),arg:{statistic:a,annotations:o}}]),C((u=s.cfg)===null||u===void 0?void 0:u.start,function(h){c.push(m(m({},h),{arg:{statistic:a,annotations:o}}))}),e.interaction(s.type,P({},s.cfg,{start:c}))}else e.interaction(s.type,s.cfg||{})}),r}function b0(r){return J(Ce("pieStyle"),oP,sP,ut,lP,xn,cP,uP,Jr,w0,hP,xt)(r)}var fP=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="pie",t}return e.getDefaultOptions=function(){return y0},e.prototype.changeData=function(t){this.chart.emit(ot.BEFORE_CHANGE_DATA,Tt.fromData(this.chart,ot.BEFORE_CHANGE_DATA,null));var i=this.options,n=this.options.angleField,a=ln(i.data,n),o=ln(t,n);is(a,n)||is(o,n)?this.update({data:t}):(this.updateOption({data:t}),this.chart.data(o),w0({chart:this.chart,options:this.options}),this.chart.render(!0)),this.chart.emit(ot.AFTER_CHANGE_DATA,Tt.fromData(this.chart,ot.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return b0},e}(nt),S0=["#FAAD14","#E8EDF3"],vP={percent:.2,color:S0,animation:{}};function Ch(r){var e=Ct(Fi(r)?r:0,0,1);return[{current:"".concat(e),type:"current",percent:e},{current:"".concat(e),type:"target",percent:1}]}function C0(r){var e=r.chart,t=r.options,i=t.percent,n=t.progressStyle,a=t.color,o=t.barWidthRatio;e.data(Ch(i));var s=P({},r,{options:{xField:"current",yField:"percent",seriesField:"type",widthRatio:o,interval:{style:n,color:Q(a)?[a,S0[1]]:a},args:{zIndexReversed:!0,sortZIndex:!0}}});return Zt(s),e.tooltip(!1),e.axis(!1),e.legend(!1),r}function dP(r){var e=r.chart;return e.coordinate("rect").transpose(),r}function M0(r){return J(C0,Lt({}),dP,xt,ut,Et())(r)}var pP=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="process",t}return e.getDefaultOptions=function(){return vP},e.prototype.changeData=function(t){this.updateOption({percent:t}),this.chart.changeData(Ch(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return M0},e}(nt);function gP(r){var e=r.chart,t=r.options,i=t.innerRadius,n=t.radius;return e.coordinate("theta",{innerRadius:i,radius:n}),r}function A0(r,e){var t=r.chart,i=r.options,n=i.innerRadius,a=i.statistic,o=i.percent,s=i.meta;if(t.getController("annotation").clear(!0),n&&a){var l=A(s,["percent","formatter"])||function(c){return"".concat((c*100).toFixed(2),"%")},u=a.content;u&&(u=P({},u,{content:B(u.content)?l(o):u.content})),_s(t,{statistic:m(m({},a),{content:u}),plotType:"ring-progress"},{percent:o})}return e&&t.render(!0),r}function F0(r){return J(C0,Lt({}),gP,A0,xt,ut,Et())(r)}var yP={percent:.2,innerRadius:.8,radius:.98,color:["#FAAD14","#E8EDF3"],statistic:{title:!1,content:{style:{fontSize:"14px",fontWeight:300,fill:"#4D4D4D",textAlign:"center",textBaseline:"middle"}}},animation:{}},mP=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="ring-process",t}return e.getDefaultOptions=function(){return yP},e.prototype.changeData=function(t){this.chart.emit(ot.BEFORE_CHANGE_DATA,Tt.fromData(this.chart,ot.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data(Ch(t)),A0({chart:this.chart,options:this.options},!0),this.chart.emit(ot.AFTER_CHANGE_DATA,Tt.fromData(this.chart,ot.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return F0},e}(nt);function Ur(r,e){return xP(r)||wP(r,e)||bP()}function xP(r){if(Array.isArray(r))return r}function wP(r,e){var t=[],i=!0,n=!1,a=void 0;try{for(var o=r[Symbol.iterator](),s;!(i=(s=o.next()).done)&&(t.push(s.value),!(e&&t.length===e));i=!0);}catch(l){n=!0,a=l}finally{try{!i&&o.return!=null&&o.return()}finally{if(n)throw a}}return t}function bP(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Mh(r,e,t,i){r=r.filter(function(d,p){var g=e(d,p),y=t(d,p);return g!=null&&isFinite(g)&&y!=null&&isFinite(y)}),i&&r.sort(function(d,p){return e(d)-e(p)});for(var n=r.length,a=new Float64Array(n),o=new Float64Array(n),s=0,l=0,u,c,h,f=0;fn&&(c.splice(v+1,0,y),f=!0)}return f}}function Va(r,e,t,i){var n=i-r*r,a=Math.abs(n)<1e-24?0:(t-r*e)/n,o=e-a*r;return[o,a]}function CP(){var r=function(a){return a[0]},e=function(a){return a[1]},t;function i(n){var a=0,o=0,s=0,l=0,u=0,c=0,h=t?+t[0]:1/0,f=t?+t[1]:-1/0;Di(n,r,e,function(w,b){var S=Math.log(b),M=w*b;++a,o+=(b-o)/a,l+=(M-l)/a,c+=(w*M-c)/a,s+=(b*S-s)/a,u+=(M*S-u)/a,t||(wf&&(f=w))});var v=Va(l/o,s/o,u/o,c/o),d=Ur(v,2),p=d[0],g=d[1];p=Math.exp(p);var y=function(b){return p*Math.exp(g*b)},x=Ga(h,f,y);return x.a=p,x.b=g,x.predict=y,x.rSquared=bn(n,r,e,o,y),x}return i.domain=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}function T0(){var r=function(a){return a[0]},e=function(a){return a[1]},t;function i(n){var a=0,o=0,s=0,l=0,u=0,c=t?+t[0]:1/0,h=t?+t[1]:-1/0;Di(n,r,e,function(x,w){++a,o+=(x-o)/a,s+=(w-s)/a,l+=(x*w-l)/a,u+=(x*x-u)/a,t||(xh&&(h=x))});var f=Va(o,s,l,u),v=Ur(f,2),d=v[0],p=v[1],g=function(w){return p*w+d},y=[[c,g(c)],[h,g(h)]];return y.a=p,y.b=d,y.predict=g,y.rSquared=bn(n,r,e,s,g),y}return i.domain=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}function MP(r){r.sort(function(t,i){return t-i});var e=r.length/2;return e%1===0?(r[e-1]+r[e])/2:r[Math.floor(e)]}var wd=2,bd=1e-12;function AP(){var r=function(a){return a[0]},e=function(a){return a[1]},t=.3;function i(n){for(var a=Mh(n,r,e,!0),o=Ur(a,4),s=o[0],l=o[1],u=o[2],c=o[3],h=s.length,f=Math.max(2,~~(t*h)),v=new Float64Array(h),d=new Float64Array(h),p=new Float64Array(h).fill(1),g=-1;++g<=wd;){for(var y=[0,f-1],x=0;xs[S]-w?b:S,F=0,T=0,L=0,k=0,I=0,O=1/Math.abs(s[M]-w||1),z=b;z<=S;++z){var Y=s[z],q=l[z],D=FP(Math.abs(w-Y)*O)*p[z],N=Y*D;F+=D,T+=N,L+=q*D,k+=q*N,I+=Y*N}var W=Va(T/F,L/F,k/F,I/F),$=Ur(W,2),V=$[0],_=$[1];v[x]=V+_*w,d[x]=Math.abs(l[x]-v[x]),TP(s,x+1,y)}if(g===wd)break;var et=MP(d);if(Math.abs(et)=1?bd:(tt=1-K*K)*tt}return EP(s,v,u,c)}return i.bandwidth=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}function FP(r){return(r=1-r*r*r)*r*r}function TP(r,e,t){var i=r[e],n=t[0],a=t[1]+1;if(!(a>=r.length))for(;e>n&&r[a]-i<=i-r[n];)t[0]=++n,t[1]=a,++a}function EP(r,e,t,i){for(var n=r.length,a=[],o=0,s=0,l=[],u;of&&(f=b))});var d=Va(s,l,u,c),p=Ur(d,2),g=p[0],y=p[1],x=function(S){return y*Math.log(S)/v+g},w=Ga(h,f,x);return w.a=y,w.b=g,w.predict=x,w.rSquared=bn(a,r,e,l,x),w}return n.domain=function(a){return arguments.length?(i=a,n):i},n.x=function(a){return arguments.length?(r=a,n):r},n.y=function(a){return arguments.length?(e=a,n):e},n.base=function(a){return arguments.length?(t=a,n):t},n}function E0(){var r=function(a){return a[0]},e=function(a){return a[1]},t;function i(n){var a=Mh(n,r,e),o=Ur(a,4),s=o[0],l=o[1],u=o[2],c=o[3],h=s.length,f=0,v=0,d=0,p=0,g=0,y,x,w,b;for(y=0;yT&&(T=D))});var L=d-f*f,k=f*L-v*v,I=(g*f-p*v)/k,O=(p*L-g*v)/k,z=-I*f,Y=function(N){return N=N-u,I*N*N+O*N+z+c},q=Ga(F,T,Y);return q.a=I,q.b=O-2*I*u,q.c=z-O*u+I*u*u+c,q.predict=Y,q.rSquared=bn(n,r,e,S,Y),q}return i.domain=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}function LP(){var r=function(o){return o[0]},e=function(o){return o[1]},t=3,i;function n(a){if(t===1){var o=T0().x(r).y(e).domain(i)(a);return o.coefficients=[o.b,o.a],delete o.a,delete o.b,o}if(t===2){var s=E0().x(r).y(e).domain(i)(a);return s.coefficients=[s.c,s.b,s.a],delete s.a,delete s.b,delete s.c,s}var l=Mh(a,r,e),u=Ur(l,4),c=u[0],h=u[1],f=u[2],v=u[3],d=c.length,p=[],g=[],y=t+1,x=0,w=0,b=i?+i[0]:1/0,S=i?+i[1]:-1/0;Di(a,r,e,function(Y,q){++w,x+=(q-x)/w,i||(YS&&(S=Y))});var M,F,T,L,k;for(M=0;M=0;--a)for(s=e[a],l=1,n[a]+=s,o=1;o<=a;++o)l*=(a+1-o)/o,n[a-o]+=s*Math.pow(t,o)*l;return n[0]+=i,n}function PP(r){var e=r.length-1,t=[],i,n,a,o,s;for(i=0;iMath.abs(r[i][o])&&(o=n);for(a=i;a=i;a--)r[a][n]-=r[a][i]*r[i][n]/r[i][i]}for(n=e-1;n>=0;--n){for(s=0,a=n+1;af&&(f=w))});var v=Va(o,s,l,u),d=Ur(v,2),p=d[0],g=d[1];p=Math.exp(p);var y=function(b){return p*Math.pow(b,g)},x=Ga(h,f,y);return x.a=p,x.b=g,x.predict=y,x.rSquared=bn(n,r,e,c,y),x}return i.domain=function(n){return arguments.length?(t=n,i):t},i.x=function(n){return arguments.length?(r=n,i):r},i.y=function(n){return arguments.length?(e=n,i):e},i}var OP={exp:CP,linear:T0,loess:AP,log:kP,poly:LP,pow:DP,quad:E0};function BP(r,e){var t=10,i={regionStyle:[{position:{start:[r,"max"],end:["max",e]},style:{fill:"#d8d0c0",opacity:.4}},{position:{start:["min","max"],end:[r,e]},style:{fill:"#a3dda1",opacity:.4}},{position:{start:["min",e],end:[r,"min"]},style:{fill:"#d8d0c0",opacity:.4}},{position:{start:[r,e],end:["max","min"]},style:{fill:"#a3dda1",opacity:.4}}],lineStyle:{stroke:"#9ba29a",lineWidth:1},labelStyle:[{position:["max",e],offsetX:-10,offsetY:-10,style:{textAlign:"right",textBaseline:"bottom",fontSize:14,fill:"#ccc"}},{position:["min",e],offsetX:t,offsetY:-10,style:{textAlign:"left",textBaseline:"bottom",fontSize:14,fill:"#ccc"}},{position:["min",e],offsetX:t,offsetY:t,style:{textAlign:"left",textBaseline:"top",fontSize:14,fill:"#ccc"}},{position:["max",e],offsetX:-10,offsetY:t,style:{textAlign:"right",textBaseline:"top",fontSize:14,fill:"#ccc"}}]};return i}var RP=function(r,e){var t=e.view,i=e.options,n=i.xField,a=i.yField,o=t.getScaleByField(n),s=t.getScaleByField(a),l=r.map(function(u){return t.getCoordinate().convert({x:o.scale(u[0]),y:s.scale(u[1])})});return qk(l,!1)},zP=function(r){var e=r.options,t=e.xField,i=e.yField,n=e.data,a=e.regressionLine,o=a.type,s=o===void 0?"linear":o,l=a.algorithm,u=a.equation,c,h=null;if(l)c=R(l)?l:l(n),h=u;else{var f=OP[s]().x(function(v){return v[t]}).y(function(v){return v[i]});c=f(n),h=GP(s,c)}return[RP(c,r),h]},NP=function(r){var e,t=r.meta,i=t===void 0?{}:t,n=r.xField,a=r.yField,o=r.data,s=o[0][n],l=o[0][a],u=s>0,c=l>0;function h(f,v){var d=A(i,[f]);function p(y){return A(d,y)}var g={};return v==="x"?(rt(s)&&(rt(p("min"))||(g.min=u?0:s*2),rt(p("max"))||(g.max=u?s*2:0)),g):(rt(l)&&(rt(p("min"))||(g.min=c?0:l*2),rt(p("max"))||(g.max=c?l*2:0)),g)}return m(m({},i),(e={},e[n]=m(m({},i[n]),h(n,"x")),e[a]=m(m({},i[a]),h(a,"y")),e))};function GP(r,e){var t,i,n,a=function(u,c){return c===void 0&&(c=4),Math.round(u*Math.pow(10,c))/Math.pow(10,c)},o=function(u){return Number.isFinite(u)?a(u):"?"};switch(r){case"linear":return"y = ".concat(o(e.a),"x + ").concat(o(e.b),", R^2 = ").concat(o(e.rSquared));case"exp":return"y = ".concat(o(e.a),"e^(").concat(o(e.b),"x), R^2 = ").concat(o(e.rSquared));case"log":return"y = ".concat(o(e.a),"ln(x) + ").concat(o(e.b),", R^2 = ").concat(o(e.rSquared));case"quad":return"y = ".concat(o(e.a),"x^2 + ").concat(o(e.b),"x + ").concat(o(e.c),", R^2 = ").concat(o(e.rSquared));case"poly":for(var s="y = ".concat(o((t=e.coefficients)===null||t===void 0?void 0:t[0])," + ").concat(o((i=e.coefficients)===null||i===void 0?void 0:i[1]),"x + ").concat(o((n=e.coefficients)===null||n===void 0?void 0:n[2]),"x^2"),l=3;l
    ',itemTpl:"{value}",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}},showCrosshairs:!0,crosshairs:{type:"x"}},iD={appendPadding:2,tooltip:m({},B0),animation:{}};function nD(r){var e=r.chart,t=r.options,i=t.data,n=t.color,a=t.areaStyle,o=t.point,s=t.line,l=o==null?void 0:o.state,u=Oi(i);e.data(u);var c=P({},r,{options:{xField:Ca,yField:Qi,area:{color:n,style:a},line:s,point:o}}),h=P({},c,{options:{tooltip:!1}}),f=P({},c,{options:{tooltip:!1,state:l}});return js(c),wn(h),Me(f),e.axis(!1),e.legend(!1),r}function Sn(r){var e,t,i=r.options,n=i.xAxis,a=i.yAxis,o=i.data,s=Oi(o);return J(Lt((e={},e[Ca]=n,e[Qi]=a,e),(t={},t[Ca]={type:"cat"},t[Qi]=ch(s,Qi),t)))(r)}function R0(r){return J(Ce("areaStyle"),nD,Sn,Nt,ut,xt,Et())(r)}var aD={appendPadding:2,tooltip:m({},B0),color:"l(90) 0:#E5EDFE 1:#ffffff",areaStyle:{fillOpacity:.6},line:{size:1,color:"#5B8FF9"},animation:{}},oD=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-area",t}return e.getDefaultOptions=function(){return aD},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;Sn({chart:n,options:a}),n.changeData(Oi(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return R0},e}(nt);function sD(r){var e=r.chart,t=r.options,i=t.data,n=t.color,a=t.columnStyle,o=t.columnWidthRatio,s=Oi(i);e.data(s);var l=P({},r,{options:{xField:Ca,yField:Qi,widthRatio:o,interval:{style:a,color:n}}});return Zt(l),e.axis(!1),e.legend(!1),e.interaction("element-active"),r}function z0(r){return J(ut,Ce("columnStyle"),sD,Sn,Nt,xt,Et())(r)}var lD={showTitle:!1,shared:!0,showMarkers:!1,customContent:function(r,e){return"".concat(A(e,[0,"data","y"],0))},containerTpl:'
    ',itemTpl:"{value}",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}}},uD={appendPadding:2,tooltip:m({},lD),animation:{}},cD=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-column",t}return e.getDefaultOptions=function(){return uD},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;Sn({chart:n,options:a}),n.changeData(Oi(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return z0},e}(nt);function hD(r){var e=r.chart,t=r.options,i=t.data,n=t.color,a=t.lineStyle,o=t.point,s=o==null?void 0:o.state,l=Oi(i);e.data(l);var u=P({},r,{options:{xField:Ca,yField:Qi,line:{color:n,style:a},point:o}}),c=P({},u,{options:{tooltip:!1,state:s}});return wn(u),Me(c),e.axis(!1),e.legend(!1),r}function N0(r){return J(hD,Sn,ut,Nt,xt,Et())(r)}var fD=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-line",t}return e.getDefaultOptions=function(){return iD},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;Sn({chart:n,options:a}),n.changeData(Oi(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return N0},e}(nt),vD={line:Zm,pie:b0,column:el,bar:t0,area:Qm,gauge:d0,"tiny-line":N0,"tiny-column":z0,"tiny-area":R0,"ring-progress":F0,progress:M0,scatter:L0,histogram:g0,funnel:s0,stock:O0},dD={line:JI,pie:fP,column:hI,bar:uI,area:VL,gauge:HI,"tiny-line":fD,"tiny-column":cD,"tiny-area":oD,"ring-progress":mP,progress:pP,scatter:UP,histogram:ZI,funnel:BI,stock:rD},pD={pie:{label:!1},column:{tooltip:{showMarkers:!1}},bar:{tooltip:{showMarkers:!1}}};function $u(r,e,t){var i=dD[r];if(!i){console.error("could not find ".concat(r," plot"));return}var n=vD[r];n({chart:e,options:P({},i.getDefaultOptions(),A(pD,r,{}),t)})}function gD(r){var e=r.chart,t=r.options,i=t.views,n=t.legend;return C(i,function(a){var o=a.region,s=a.data,l=a.meta,u=a.axes,c=a.coordinate,h=a.interactions,f=a.annotations,v=a.tooltip,d=a.geometries,p=e.createView({region:o});p.data(s);var g={};u&&C(u,function(y,x){g[x]=dt(y,ce)}),g=P({},l,g),p.scale(g),u?C(u,function(y,x){p.axis(x,y)}):p.axis(!1),p.coordinate(c),C(d,function(y){var x=pe({chart:p,options:y}).ext,w=y.adjust;w&&x.geometry.adjust(w)}),C(h,function(y){y.enable===!1?p.removeInteraction(y.type):p.interaction(y.type,y.cfg)}),C(f,function(y){p.annotation()[y.type](m({},y))}),typeof a.animation=="boolean"?p.animate(!1):(p.animate(!0),C(p.geometries,function(y){y.animate(a.animation)})),v&&(p.interaction("tooltip"),p.tooltip(v))}),n?C(n,function(a,o){e.legend(o,a)}):e.legend(!1),e.tooltip(t.tooltip),r}function yD(r){var e=r.chart,t=r.options,i=t.plots,n=t.data,a=n===void 0?[]:n;return C(i,function(o){var s=o.type,l=o.region,u=o.options,c=u===void 0?{}:u,h=o.top,f=c.tooltip;if(h){$u(s,e,m(m({},c),{data:a}));return}var v=e.createView(m({region:l},dt(c,_m)));f&&v.interaction("tooltip"),$u(s,v,m({data:a},c))}),r}function mD(r){var e=r.chart,t=r.options;return e.option("slider",t.slider),r}function xD(r){return J(xt,gD,yD,At,xt,ut,Nt,mD,Et())(r)}function wD(r,e){var t=r.getModel(),i=t.data,n;return R(i)?n=i[0][e]:n=i[e],n}function bD(r){var e=ts(r);C(e,function(t){t.hasState("active")&&t.setState("active",!1),t.hasState("selected")&&t.setState("selected",!1),t.hasState("inactive")&&t.setState("inactive",!1)})}var SD=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getAssociationItems=function(t,i){var n,a=this.context.event,o=i||{},s=o.linkField,l=o.dim,u=[];if(!((n=a.data)===null||n===void 0)&&n.data){var c=a.data.data;C(t,function(h){var f,v,d=s;if(l==="x"?d=h.getXScale().field:l==="y"?d=(f=h.getYScales().find(function(g){return g.field===d}))===null||f===void 0?void 0:f.field:d||(d=(v=h.getGroupScales()[0])===null||v===void 0?void 0:v.field),!!d){var p=Mt(ts(h),function(g){var y=!1,x=!1,w=R(c)?A(c[0],d):A(c,d);return wD(g,d)===w?y=!0:x=!0,{element:g,view:h,active:y,inactive:x}});u.push.apply(u,p)}})}return u},e.prototype.showTooltip=function(t){var i=pd(this.context.view),n=this.getAssociationItems(i,t);C(n,function(a){if(a.active){var o=a.element.shape.getCanvasBBox();a.view.showTooltip({x:o.minX+o.width/2,y:o.minY+o.height/2})}})},e.prototype.hideTooltip=function(){var t=pd(this.context.view);C(t,function(i){i.hideTooltip()})},e.prototype.active=function(t){var i=Gn(this.context.view),n=this.getAssociationItems(i,t);C(n,function(a){var o=a.active,s=a.element;o&&s.setState("active",!0)})},e.prototype.selected=function(t){var i=Gn(this.context.view),n=this.getAssociationItems(i,t);C(n,function(a){var o=a.active,s=a.element;o&&s.setState("selected",!0)})},e.prototype.highlight=function(t){var i=Gn(this.context.view),n=this.getAssociationItems(i,t);C(n,function(a){var o=a.inactive,s=a.element;o&&s.setState("inactive",!0)})},e.prototype.reset=function(){var t=Gn(this.context.view);C(t,function(i){bD(i)})},e}(St);j("association",SD);it("association-active",{start:[{trigger:"element:mouseenter",action:"association:active"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});it("association-selected",{start:[{trigger:"element:mouseenter",action:"association:selected"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});it("association-highlight",{start:[{trigger:"element:mouseenter",action:"association:highlight"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});it("association-tooltip",{start:[{trigger:"element:mousemove",action:"association:showTooltip"}],end:[{trigger:"element:mouseleave",action:"association:hideTooltip"}]});(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="mix",t}return e.prototype.getSchemaAdaptor=function(){return xD},e})(nt);var Sd;(function(r){r.DEV="DEV",r.BETA="BETA",r.STABLE="STABLE"})(Sd||(Sd={}));var tr="first-axes-view",er="second-axes-view",hi="series-field-key";function G0(r,e,t,i,n){var a=[];e.forEach(function(h){i.forEach(function(f){var v,d=(v={},v[r]=f[r],v[t]=h,v[h]=f[h],v);a.push(d)})});var o=Object.values(me(a,t)),s=o[0],l=s===void 0?[]:s,u=o[1],c=u===void 0?[]:u;return n?[l.reverse(),c.reverse()]:[l,c]}function dr(r){return r!=="vertical"}function CD(r,e,t){var i=e[0],n=e[1],a=i.autoPadding,o=n.autoPadding,s=r.__axisPosition,l=s.layout,u=s.position;if(dr(l)&&u==="top"&&(i.autoPadding=t.instance(a.top,0,a.bottom,a.left),n.autoPadding=t.instance(o.top,a.left,o.bottom,0)),dr(l)&&u==="bottom"&&(i.autoPadding=t.instance(a.top,a.right/2+5,a.bottom,a.left),n.autoPadding=t.instance(o.top,o.right,o.bottom,a.right/2+5)),!dr(l)&&u==="bottom"){var c=a.left>=o.left?a.left:o.left;i.autoPadding=t.instance(a.top,a.right,a.bottom/2+5,c),n.autoPadding=t.instance(a.bottom/2+5,o.right,o.bottom,c)}if(!dr(l)&&u==="top"){var c=a.left>=o.left?a.left:o.left;i.autoPadding=t.instance(a.top,a.right,0,c),n.autoPadding=t.instance(0,o.right,a.top,c)}}function MD(r){var e=r.chart,t=r.options,i=t.data,n=t.xField,a=t.yField,o=t.color,s=t.barStyle,l=t.widthRatio,u=t.legend,c=t.layout,h=G0(n,a,hi,i,dr(c));u?e.legend(hi,u):u===!1&&e.legend(!1);var f,v,d=h[0],p=h[1];dr(c)?(f=e.createView({region:{start:{x:0,y:0},end:{x:.5,y:1}},id:tr}),f.coordinate().transpose().reflect("x"),v=e.createView({region:{start:{x:.5,y:0},end:{x:1,y:1}},id:er}),v.coordinate().transpose(),f.data(d),v.data(p)):(f=e.createView({region:{start:{x:0,y:0},end:{x:1,y:.5}},id:tr}),v=e.createView({region:{start:{x:0,y:.5},end:{x:1,y:1}},id:er}),v.coordinate().reflect("y"),f.data(d),v.data(p));var g=P({},r,{chart:f,options:{widthRatio:l,xField:n,yField:a[0],seriesField:hi,interval:{color:o,style:s}}});Zt(g);var y=P({},r,{chart:v,options:{xField:n,yField:a[1],seriesField:hi,widthRatio:l,interval:{color:o,style:s}}});return Zt(y),r}function AD(r){var e,t,i,n=r.options,a=r.chart,o=n.xAxis,s=n.yAxis,l=n.xField,u=n.yField,c=st(a,tr),h=st(a,er),f={};return fn((n==null?void 0:n.meta)||{}).map(function(v){A(n==null?void 0:n.meta,[v,"alias"])&&(f[v]=n.meta[v].alias)}),a.scale((e={},e[hi]={sync:!0,formatter:function(v){return A(f,v,v)}},e)),Lt((t={},t[l]=o,t[u[0]]=s[u[0]],t))(P({},r,{chart:c})),Lt((i={},i[l]=o,i[u[1]]=s[u[1]],i))(P({},r,{chart:h})),r}function FD(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField,s=t.layout,l=st(e,tr),u=st(e,er);return(i==null?void 0:i.position)==="bottom"?u.axis(a,m(m({},i),{label:{formatter:function(){return""}}})):u.axis(a,!1),i===!1?l.axis(a,!1):l.axis(a,m({position:dr(s)?"top":"bottom"},i)),n===!1?(l.axis(o[0],!1),u.axis(o[1],!1)):(l.axis(o[0],n[o[0]]),u.axis(o[1],n[o[1]])),e.__axisPosition={position:l.getOptions().axes[a].position,layout:s},r}function TD(r){var e=r.chart;return At(P({},r,{chart:st(e,tr)})),At(P({},r,{chart:st(e,er)})),r}function ED(r){var e=r.chart,t=r.options,i=t.yField,n=t.yAxis;return Ti(P({},r,{chart:st(e,tr),options:{yAxis:n[i[0]]}})),Ti(P({},r,{chart:st(e,er),options:{yAxis:n[i[1]]}})),r}function kD(r){var e=r.chart;return ut(P({},r,{chart:st(e,tr)})),ut(P({},r,{chart:st(e,er)})),ut(r),r}function LD(r){var e=r.chart;return xt(P({},r,{chart:st(e,tr)})),xt(P({},r,{chart:st(e,er)})),r}function ID(r){var e=this,t,i,n=r.chart,a=r.options,o=a.label,s=a.yField,l=a.layout,u=st(n,tr),c=st(n,er),h=jt(u,"interval"),f=jt(c,"interval");if(!o)h.label(!1),f.label(!1);else{var v=o.callback,d=yt(o,["callback"]);d.position||(d.position="middle"),d.offset===void 0&&(d.offset=2);var p=m({},d);if(dr(l)){var g=((t=p.style)===null||t===void 0?void 0:t.textAlign)||(d.position==="middle"?"center":"left");d.style=P({},d.style,{textAlign:g});var y={left:"right",right:"left",center:"center"};p.style=P({},p.style,{textAlign:y[g]})}else{var x={top:"bottom",bottom:"top",middle:"middle"};typeof d.position=="string"?d.position=x[d.position]:typeof d.position=="function"&&(d.position=function(){for(var S=[],M=0;M1?"".concat(e,"_").concat(t):"".concat(e)}function $0(r){var e=r.data,t=r.xField,i=r.measureField,n=r.rangeField,a=r.targetField,o=r.layout,s=[],l=[];e.forEach(function(h,f){var v=[h[n]].flat();v.sort(function(g,y){return g-y}),v.forEach(function(g,y){var x,w=y===0?g:v[y]-v[y-1];s.push((x={rKey:"".concat(n,"_").concat(y)},x[t]=t?h[t]:String(f),x[n]=w,x))});var d=[h[i]].flat();d.forEach(function(g,y){var x;s.push((x={mKey:Cd(d,i,y)},x[t]=t?h[t]:String(f),x[i]=g,x))});var p=[h[a]].flat();p.forEach(function(g,y){var x;s.push((x={tKey:Cd(p,a,y)},x[t]=t?h[t]:String(f),x[a]=g,x))}),l.push(h[n],h[i],h[a])});var u=Math.min.apply(Math,l.flat(1/0)),c=Math.max.apply(Math,l.flat(1/0));return u=u>0?0:u,o==="vertical"&&s.reverse(),{min:u,max:c,ds:s}}function $D(r){var e=r.chart,t=r.options,i=t.bulletStyle,n=t.targetField,a=t.rangeField,o=t.measureField,s=t.xField,l=t.color,u=t.layout,c=t.size,h=t.label,f=$0(t),v=f.min,d=f.max,p=f.ds;e.data(p);var g=P({},r,{options:{xField:s,yField:a,seriesField:"rKey",isStack:!0,label:A(h,"range"),interval:{color:A(l,"range"),style:A(i,"range"),size:A(c,"range")}}});Zt(g),e.geometries[0].tooltip(!1);var y=P({},r,{options:{xField:s,yField:o,seriesField:"mKey",isStack:!0,label:A(h,"measure"),interval:{color:A(l,"measure"),style:A(i,"measure"),size:A(c,"measure")}}});Zt(y);var x=P({},r,{options:{xField:s,yField:n,seriesField:"tKey",label:A(h,"target"),point:{color:A(l,"target"),style:A(i,"target"),size:X(A(c,"target"))?function(w){return A(c,"target")(w)/2}:A(c,"target")/2,shape:u==="horizontal"?"line":"hyphen"}}});return Me(x),u==="horizontal"&&e.coordinate().transpose(),m(m({},r),{ext:{data:{min:v,max:d}}})}function H0(r){var e,t,i=r.options,n=r.ext,a=i.xAxis,o=i.yAxis,s=i.targetField,l=i.rangeField,u=i.measureField,c=i.xField,h=n.data;return J(Lt((e={},e[c]=a,e[u]=o,e),(t={},t[u]={min:h==null?void 0:h.min,max:h==null?void 0:h.max,sync:!0},t[s]={sync:"".concat(u)},t[l]={sync:"".concat(u)},t)))(r)}function HD(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.measureField,s=t.rangeField,l=t.targetField;return e.axis("".concat(s),!1),e.axis("".concat(l),!1),i===!1?e.axis("".concat(a),!1):e.axis("".concat(a),i),n===!1?e.axis("".concat(o),!1):e.axis("".concat(o),n),r}function XD(r){var e=r.chart,t=r.options,i=t.legend;return e.removeInteraction("legend-filter"),e.legend(i),e.legend("rKey",!1),e.legend("mKey",!1),e.legend("tKey",!1),r}function WD(r){var e=r.chart,t=r.options,i=t.label,n=t.measureField,a=t.targetField,o=t.rangeField,s=e.geometries,l=s[0],u=s[1],c=s[2];return A(i,"range")?l.label("".concat(o),m({layout:[{type:"limit-in-plot"}]},Yt(i.range))):l.label(!1),A(i,"measure")?u.label("".concat(n),m({layout:[{type:"limit-in-plot"}]},Yt(i.measure))):u.label(!1),A(i,"target")?c.label("".concat(a),m({layout:[{type:"limit-in-plot"}]},Yt(i.target))):c.label(!1),r}function _D(r){J($D,H0,HD,XD,ut,WD,Nt,At,xt)(r)}var qD=P({},nt.getDefaultOptions(),{layout:"horizontal",size:{range:30,measure:20,target:20},xAxis:{tickLine:!1,line:null},bulletStyle:{range:{fillOpacity:.5}},label:{measure:{position:"right"}},tooltip:{showMarkers:!1}});(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bullet",t}return e.getDefaultOptions=function(){return qD},e.prototype.changeData=function(t){this.updateOption({data:t});var i=$0(this.options),n=i.min,a=i.max,o=i.ds;H0({options:this.options,ext:{data:{min:n,max:a}},chart:this.chart}),this.chart.changeData(o)},e.prototype.getSchemaAdaptor=function(){return _D},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(nt);var UD={y:0,nodeWidthRatio:.05,weight:!1,nodePaddingRatio:.1,id:function(r){return r.id},source:function(r){return r.source},target:function(r){return r.target},sourceWeight:function(r){return r.value||1},targetWeight:function(r){return r.value||1},sortBy:null};function jD(r,e,t){C(r,function(i,n){i.inEdges=e.filter(function(a){return"".concat(t.target(a))==="".concat(n)}),i.outEdges=e.filter(function(a){return"".concat(t.source(a))==="".concat(n)}),i.edges=i.outEdges.concat(i.inEdges),i.frequency=i.edges.length,i.value=0,i.inEdges.forEach(function(a){i.value+=t.targetWeight(a)}),i.outEdges.forEach(function(a){i.value+=t.sourceWeight(a)})})}function ZD(r,e){var t={weight:function(n,a){return a.value-n.value},frequency:function(n,a){return a.frequency-n.frequency},id:function(n,a){return"".concat(e.id(n)).localeCompare("".concat(e.id(a)))}},i=t[e.sortBy];!i&&X(e.sortBy)&&(i=e.sortBy),i&&r.sort(i)}function QD(r,e){var t=r.length;if(!t)throw new TypeError("Invalid nodes: it's empty!");if(e.weight){var i=e.nodePaddingRatio;if(i<0||i>=1)throw new TypeError("Invalid nodePaddingRatio: it must be in range [0, 1)!");var n=i/(2*t),a=e.nodeWidthRatio;if(a<=0||a>=1)throw new TypeError("Invalid nodeWidthRatio: it must be in range (0, 1)!");var o=0;r.forEach(function(l){o+=l.value}),r.forEach(function(l){l.weight=l.value/o,l.width=l.weight*(1-i),l.height=a}),r.forEach(function(l,u){for(var c=0,h=u-1;h>=0;h--)c+=r[h].width+2*n;var f=l.minX=n+c,v=l.maxX=l.minX+l.width,d=l.minY=e.y-a/2,p=l.maxY=d+a;l.x=[f,v,v,f],l.y=[d,d,p,p]})}else{var s=1/t;r.forEach(function(l,u){l.x=(u+.5)*s,l.y=e.y})}return r}function KD(r,e,t){if(t.weight){var i={};C(r,function(n,a){i[a]=n.value}),e.forEach(function(n){var a=t.source(n),o=t.target(n),s=r[a],l=r[o];if(s&&l){var u=i[a],c=t.sourceWeight(n),h=s.minX+(s.value-u)/s.value*s.width,f=h+c/s.value*s.width;i[a]-=c;var v=i[o],d=t.targetWeight(n),p=l.minX+(l.value-v)/l.value*l.width,g=p+d/l.value*l.width;i[o]-=d;var y=t.y;n.x=[h,f,p,g],n.y=[y,y,y,y],n.source=s,n.target=l}})}else e.forEach(function(n){var a=r[t.source(n)],o=r[t.target(n)];a&&o&&(n.x=[a.x,o.x],n.y=[a.y,o.y],n.source=a,n.target=o)});return e}function JD(r){return mt({},UD,r)}function tO(r,e){var t=JD(r),i={},n=e.nodes,a=e.links;n.forEach(function(l){var u=t.id(l);i[u]=l}),jD(i,a,t),ZD(n,t);var o=QD(n,t),s=KD(i,a,t);return{nodes:o,links:s}}var X0="x",W0="y",_0="name",q0="source",eO={nodeStyle:{opacity:1,fillOpacity:1,lineWidth:1},edgeStyle:{opacity:.5,lineWidth:2},label:{fields:["x","name"],callback:function(r,e){var t=(r[0]+r[1])/2,i=t>.5?-4:4;return{offsetX:i,content:e}},labelEmit:!0,style:{fill:"#8c8c8c"}},tooltip:{showTitle:!1,showMarkers:!1,fields:["source","target","value","isNode"],showContent:function(r){return!A(r,[0,"data","isNode"])},formatter:function(r){var e=r.source,t=r.target,i=r.value;return{name:"".concat(e," -> ").concat(t),value:i}}},interactions:[{type:"element-active"}],weight:!0,nodePaddingRatio:.1,nodeWidthRatio:.05};function rO(r){var e=r.options,t=e.data,i=e.sourceField,n=e.targetField,a=e.weightField,o=e.nodePaddingRatio,s=e.nodeWidthRatio,l=e.rawFields,u=l===void 0?[]:l,c=Pm(t,i,n,a),h=tO({weight:!0,nodePaddingRatio:o,nodeWidthRatio:s},c),f=h.nodes,v=h.links,d=f.map(function(g){return m(m({},dt(g,Z(["id","x","y","name"],u,!0))),{isNode:!0})}),p=v.map(function(g){return m(m({source:g.source.name,target:g.target.name,name:g.source.name||g.target.name},dt(g,Z(["x","y","value"],u,!0))),{isNode:!1})});return m(m({},r),{ext:m(m({},r.ext),{chordData:{nodesData:d,edgesData:p}})})}function iO(r){var e,t=r.chart;return t.scale((e={x:{sync:!0,nice:!0},y:{sync:!0,nice:!0,max:1}},e[_0]={sync:"color"},e[q0]={sync:"color"},e)),r}function nO(r){var e=r.chart;return e.axis(!1),r}function aO(r){var e=r.chart;return e.legend(!1),r}function oO(r){var e=r.chart,t=r.options,i=t.tooltip;return e.tooltip(i),r}function sO(r){var e=r.chart;return e.coordinate("polar").reflect("y"),r}function lO(r){var e=r.chart,t=r.options,i=r.ext.chordData.nodesData,n=t.nodeStyle,a=t.label,o=t.tooltip,s=e.createView();return s.data(i),Zs({chart:s,options:{xField:X0,yField:W0,seriesField:_0,polygon:{style:n},label:a,tooltip:o}}),r}function uO(r){var e=r.chart,t=r.options,i=r.ext.chordData.edgesData,n=t.edgeStyle,a=t.tooltip,o=e.createView();o.data(i);var s={xField:X0,yField:W0,seriesField:q0,edge:{style:n,shape:"arc"},tooltip:a};return $m({chart:o,options:s}),r}function cO(r){var e=r.chart,t=r.options,i=t.animation;return Ra(e,i,Yk(e)),r}function hO(r){return J(ut,rO,sO,iO,nO,aO,oO,uO,lO,At,Jr,cO)(r)}(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="chord",t}return e.getDefaultOptions=function(){return eO},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return hO},e})(nt);var fO=["x","y","r","name","value","path","depth"],vO={colorField:"name",autoFit:!0,pointStyle:{lineWidth:0,stroke:"#fff"},legend:!1,hierarchyConfig:{size:[1,1],padding:0},label:{fields:["name"],layout:{type:"limit-in-shape"}},tooltip:{showMarkers:!1,showTitle:!1},drilldown:{enabled:!1}},Md=4,dO=0,Ad=5,Fd="drilldown-bread-crumb",pO={position:"top-left",dividerText:"/",textStyle:{fontSize:12,fill:"rgba(0, 0, 0, 0.65)",cursor:"pointer"},activeTextStyle:{fill:"#87B5FF"}},Ma="hierarchy-data-transform-params",gO=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.name="drill-down",t.historyCache=[],t.breadCrumbGroup=null,t.breadCrumbCfg=pO,t}return e.prototype.click=function(){var t=A(this.context,["event","data","data"]);if(!t)return!1;this.drill(t),this.drawBreadCrumb()},e.prototype.resetPosition=function(){if(this.breadCrumbGroup){var t=this.context.view.getCoordinate(),i=this.breadCrumbGroup,n=i.getBBox(),a=this.getButtonCfg().position,o={x:t.start.x,y:t.end.y-(n.height+Ad*2)};t.isPolar&&(o={x:0,y:0}),a==="bottom-left"&&(o={x:t.start.x,y:t.start.y});var s=ve.transform(null,[["t",o.x+dO,o.y+n.height+Ad]]);i.setMatrix(s)}},e.prototype.back=function(){Vt(this.historyCache)&&this.backTo(this.historyCache.slice(0,-1))},e.prototype.reset=function(){this.historyCache[0]&&this.backTo(this.historyCache.slice(0,1)),this.historyCache=[],this.hideCrumbGroup()},e.prototype.drill=function(t){var i=this.context.view,n=A(i,["interactions","drill-down","cfg","transformData"],function(u){return u}),a=n(m({data:t.data},t[Ma]));i.changeData(a);for(var o=[],s=t;s;){var l=s.data;o.unshift({id:"".concat(l.name,"_").concat(s.height,"_").concat(s.depth),name:l.name,children:n(m({data:l},t[Ma]))}),s=s.parent}this.historyCache=(this.historyCache||[]).slice(0,-1).concat(o)},e.prototype.backTo=function(t){if(!(!t||t.length<=0)){var i=this.context.view,n=zt(t).children;i.changeData(n),t.length>1?(this.historyCache=t,this.drawBreadCrumb()):(this.historyCache=[],this.hideCrumbGroup())}},e.prototype.getButtonCfg=function(){var t=this.context.view,i=A(t,["interactions","drill-down","cfg","drillDownConfig"]);return P(this.breadCrumbCfg,i==null?void 0:i.breadCrumb,this.cfg)},e.prototype.drawBreadCrumb=function(){this.drawBreadCrumbGroup(),this.resetPosition(),this.breadCrumbGroup.show()},e.prototype.drawBreadCrumbGroup=function(){var t=this,i=this.getButtonCfg(),n=this.historyCache;this.breadCrumbGroup?this.breadCrumbGroup.clear():this.breadCrumbGroup=this.context.view.foregroundGroup.addGroup({name:Fd});var a=0;n.forEach(function(o,s){var l=t.breadCrumbGroup.addShape({type:"text",id:o.id,name:"".concat(Fd,"_").concat(o.name,"_text"),attrs:m(m({text:s===0&&!B(i.rootText)?i.rootText:o.name},i.textStyle),{x:a,y:0})}),u=l.getBBox();if(a+=u.width+Md,l.on("click",function(f){var v,d=f.target.get("id");if(d!==((v=zt(n))===null||v===void 0?void 0:v.id)){var p=n.slice(0,n.findIndex(function(g){return g.id===d})+1);t.backTo(p)}}),l.on("mouseenter",function(f){var v,d=f.target.get("id");d!==((v=zt(n))===null||v===void 0?void 0:v.id)?l.attr(i.activeTextStyle):l.attr({cursor:"default"})}),l.on("mouseleave",function(){l.attr(i.textStyle)}),s=0;)e+=t[i].value;r.value=e}function FO(){return this.eachAfter(AO)}function TO(r,e){let t=-1;for(const i of this)r.call(e,i,++t,this);return this}function EO(r,e){for(var t=this,i=[t],n,a,o=-1;t=i.pop();)if(r.call(e,t,++o,this),n=t.children)for(a=n.length-1;a>=0;--a)i.push(n[a]);return this}function kO(r,e){for(var t=this,i=[t],n=[],a,o,s,l=-1;t=i.pop();)if(n.push(t),a=t.children)for(o=0,s=a.length;o=0;)t+=i[n].value;e.value=t})}function PO(r){return this.eachBefore(function(e){e.children&&e.children.sort(r)})}function DO(r){for(var e=this,t=OO(e,r),i=[e];e!==t;)e=e.parent,i.push(e);for(var n=i.length;r!==t;)i.splice(n,0,r),r=r.parent;return i}function OO(r,e){if(r===e)return r;var t=r.ancestors(),i=e.ancestors(),n=null;for(r=t.pop(),e=i.pop();r===e;)n=r,r=t.pop(),e=i.pop();return n}function BO(){for(var r=this,e=[r];r=r.parent;)e.push(r);return e}function RO(){return Array.from(this)}function zO(){var r=[];return this.eachBefore(function(e){e.children||r.push(e)}),r}function NO(){var r=this,e=[];return r.each(function(t){t!==r&&e.push({source:t.parent,target:t})}),e}function*GO(){var r=this,e,t=[r],i,n,a;do for(e=t.reverse(),t=[];r=e.pop();)if(yield r,i=r.children)for(n=0,a=i.length;n=0;--s)n.push(a=o[s]=new cn(o[s])),a.parent=i,a.depth=i.depth+1;return t.eachBefore(U0)}function VO(){return Cn(this).eachBefore(HO)}function YO(r){return r.children}function $O(r){return Array.isArray(r)?r[1]:null}function HO(r){r.data.value!==void 0&&(r.value=r.data.value),r.data=r.data.data}function U0(r){var e=0;do r.height=e;while((r=r.parent)&&r.height<++e)}function cn(r){this.data=r,this.depth=this.height=0,this.parent=null}cn.prototype=Cn.prototype={constructor:cn,count:FO,each:TO,eachAfter:kO,eachBefore:EO,find:LO,sum:IO,sort:PO,path:DO,ancestors:BO,descendants:RO,leaves:zO,links:NO,copy:VO,[Symbol.iterator]:GO};function XO(r){return typeof r=="object"&&"length"in r?r:Array.from(r)}function WO(r){for(var e=r.length,t,i;e;)i=Math.random()*e--|0,t=r[e],r[e]=r[i],r[i]=t;return r}function j0(r){for(var e=0,t=(r=WO(Array.from(r))).length,i=[],n,a;e0&&t*t>i*i+n*n}function Yl(r,e){for(var t=0;tl?(n=(u+l-a)/(2*u),s=Math.sqrt(Math.max(0,l/u-n*n)),t.x=r.x-n*i-s*o,t.y=r.y-n*o+s*i):(n=(u+a-l)/(2*u),s=Math.sqrt(Math.max(0,a/u-n*n)),t.x=e.x+n*i-s*o,t.y=e.y+n*o+s*i)):(t.x=e.x+t.r,t.y=e.y)}function Ed(r,e){var t=r.r+e.r-1e-6,i=e.x-r.x,n=e.y-r.y;return t>0&&t*t>i*i+n*n}function kd(r){var e=r._,t=r.next._,i=e.r+t.r,n=(e.x*t.r+t.x*e.r)/i,a=(e.y*t.r+t.y*e.r)/i;return n*n+a*a}function So(r){this._=r,this.next=null,this.previous=null}function K0(r){if(!(n=(r=XO(r)).length))return 0;var e,t,i,n,a,o,s,l,u,c,h;if(e=r[0],e.x=0,e.y=0,!(n>1))return e.r;if(t=r[1],e.x=-t.r,t.x=e.r,t.y=0,!(n>2))return e.r+t.r;Td(t,e,i=r[2]),e=new So(e),t=new So(t),i=new So(i),e.next=i.previous=t,t.next=e.previous=i,i.next=t.previous=e;t:for(s=3;s0)throw new Error("cycle");return l}return t.id=function(i){return arguments.length?(r=ns(i),t):r},t.parentId=function(i){return arguments.length?(e=ns(i),t):e},t}function rB(r,e){return r.parent===e.parent?1:2}function Hl(r){var e=r.children;return e?e[0]:r.t}function Xl(r){var e=r.children;return e?e[e.length-1]:r.t}function iB(r,e,t){var i=t/(e.i-r.i);e.c-=i,e.s+=t,r.c+=i,e.z+=t,e.m+=t}function nB(r){for(var e=0,t=0,i=r.children,n=i.length,a;--n>=0;)a=i[n],a.z+=e,a.m+=e,e+=a.s+(t+=a.c)}function aB(r,e,t){return r.a.parent===e.parent?r.a:t}function Io(r,e){this._=r,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}Io.prototype=Object.create(cn.prototype);function oB(r){for(var e=new Io(r,0),t,i=[e],n,a,o,s;t=i.pop();)if(a=t._.children)for(t.children=new Array(s=a.length),o=s-1;o>=0;--o)i.push(n=t.children[o]=new Io(a[o],o)),n.parent=t;return(e.parent=new Io(null,0)).children=[e],e}function sB(){var r=rB,e=1,t=1,i=null;function n(u){var c=oB(u);if(c.eachAfter(a),c.parent.m=-c.z,c.eachBefore(o),i)u.eachBefore(l);else{var h=u,f=u,v=u;u.eachBefore(function(x){x.xf.x&&(f=x),x.depth>v.depth&&(v=x)});var d=h===f?1:r(h,f)/2,p=d-h.x,g=e/(f.x+d+p),y=t/(v.depth||1);u.eachBefore(function(x){x.x=(x.x+p)*g,x.y=x.depth*y})}return u}function a(u){var c=u.children,h=u.parent.children,f=u.i?h[u.i-1]:null;if(c){nB(u);var v=(c[0].z+c[c.length-1].z)/2;f?(u.z=f.z+r(u._,f._),u.m=u.z-v):u.z=v}else f&&(u.z=f.z+r(u._,f._));u.parent.A=s(u,f,u.parent.A||h[0])}function o(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function s(u,c,h){if(c){for(var f=u,v=u,d=c,p=f.parent.children[0],g=f.m,y=v.m,x=d.m,w=p.m,b;d=Xl(d),f=Hl(f),d&&f;)p=Hl(p),v=Xl(v),v.a=u,b=d.z+x-f.z-g+r(d._,f._),b>0&&(iB(aB(d,u,h),u,b),g+=b,y+=b),x+=d.m,g+=f.m,w+=p.m,y+=v.m;d&&!Xl(v)&&(v.t=d,v.m+=x-y),f&&!Hl(p)&&(p.t=f,p.m+=g-w,h=u)}return h}function l(u){u.x*=e,u.y=u.depth*t}return n.separation=function(u){return arguments.length?(r=u,n):r},n.size=function(u){return arguments.length?(i=!1,e=+u[0],t=+u[1],n):i?null:[e,t]},n.nodeSize=function(u){return arguments.length?(i=!0,e=+u[0],t=+u[1],n):i?[e,t]:null},n}function il(r,e,t,i,n){for(var a=r.children,o,s=-1,l=a.length,u=r.value&&(n-t)/r.value;++sx&&(x=u),M=g*g*S,w=Math.max(x/M,M/y),w>b){g-=u;break}b=w}o.push(l={value:g,dice:v1?i:1)},t}(rx);function ax(){var r=nx,e=!1,t=1,i=1,n=[0],a=oi,o=oi,s=oi,l=oi,u=oi;function c(f){return f.x0=f.y0=0,f.x1=t,f.y1=i,f.eachBefore(h),n=[0],e&&f.eachBefore(tx),f}function h(f){var v=n[f.depth],d=f.x0+v,p=f.y0+v,g=f.x1-v,y=f.y1-v;g=f-1){var x=a[h];x.x0=d,x.y0=p,x.x1=g,x.y1=y;return}for(var w=u[h],b=v/2+w,S=h+1,M=f-1;S>>1;u[F]y-p){var k=v?(d*L+g*T)/v:g;c(h,S,T,d,p,k,y),c(S,f,L,k,p,g,y)}else{var I=v?(p*L+y*T)/v:y;c(h,S,T,d,p,g,I),c(S,f,L,d,I,g,y)}}}function uB(r,e,t,i,n){(r.depth&1?il:Ya)(r,e,t,i,n)}const cB=function r(e){function t(i,n,a,o,s){if((l=i._squarify)&&l.ratio===e)for(var l,u,c,h,f=-1,v,d=l.length,p=i.value;++f1?i:1)},t}(rx),Dd=Object.freeze(Object.defineProperty({__proto__:null,cluster:MO,hierarchy:Cn,pack:J0,packEnclose:j0,packSiblings:jO,partition:ex,stratify:eB,tree:sB,treemap:ax,treemapBinary:lB,treemapDice:Ya,treemapResquarify:cB,treemapSlice:il,treemapSliceDice:uB,treemapSquarify:nx},Symbol.toStringTag,{value:"Module"}));var ox="nodeIndex",sx="childNodeCount",Ah="nodeAncestor",Wl="Invalid field: it must be a string!";function Fh(r,e){var t=r.field,i=r.fields;if(Q(t))return t;if(R(t))return console.warn(Wl),t[0];if(console.warn("".concat(Wl," will try to get fields instead.")),Q(i))return i;if(R(i)&&i.length)return i[0];throw new TypeError(Wl)}function Th(r){var e=[];if(r&&r.each){var t,i;r.each(function(n){var a,o;n.parent!==t?(t=n.parent,i=0):i+=1;var s=qt((((a=n.ancestors)===null||a===void 0?void 0:a.call(n))||[]).map(function(l){return e.find(function(u){return u.name===l.name})||l}),function(l){var u=l.depth;return u>0&&u1;)c="".concat((u=h.parent.data)===null||u===void 0?void 0:u.name," / ").concat(c),h=h.parent;if(a&&l.depth>2)return null;var f=P({},l.data,m(m(m({},dt(l.data,n)),{path:c}),l));f.ext=t,f[Ma]={hierarchyConfig:t,rawFields:n,enableDrillDown:a},s.push(f)}),s}function ux(r,e,t){var i=hh([r,e]),n=i[0],a=i[1],o=i[2],s=i[3],l=t.width,u=t.height,c=l-(s+a),h=u-(n+o),f=Math.min(c,h),v=(c-f)/2,d=(h-f)/2,p=n+d,g=a+v,y=o+d,x=s+v,w=[p,g,y,x],b=f<0?0:f;return{finalPadding:w,finalSize:b}}function vB(r){var e=r.chart,t=Math.min(e.viewBBox.width,e.viewBBox.height);return P({options:{size:function(i){var n=i.r;return n*t}}},r)}function dB(r){var e=r.options,t=r.chart,i=t.viewBBox,n=e.padding,a=e.appendPadding,o=e.drilldown,s=a;if(o!=null&&o.enabled){var l=Ws(t.appendPadding,A(o,["breadCrumb","position"]));s=hh([l,a])}var u=ux(n,s,i).finalPadding;return t.padding=u,t.appendPadding=0,r}function pB(r){var e=r.chart,t=r.options,i=e.padding,n=e.appendPadding,a=t.color,o=t.colorField,s=t.pointStyle,l=t.hierarchyConfig,u=t.sizeField,c=t.rawFields,h=c===void 0?[]:c,f=t.drilldown,v=lx({data:t.data,hierarchyConfig:l,enableDrillDown:f==null?void 0:f.enabled,rawFields:h});e.data(v);var d=e.viewBBox,p=ux(i,n,d).finalSize,g=function(y){var x=y.r;return x*p};return u&&(g=function(y){return y[u]*p}),Me(P({},r,{options:{xField:"x",yField:"y",seriesField:o,sizeField:u,rawFields:Z(Z([],fO,!0),h,!0),point:{color:a,style:s,shape:"circle",size:g}}})),r}function gB(r){return J(Lt({},{x:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0},y:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0}}))(r)}function yB(r){var e=r.chart,t=r.options,i=t.tooltip;if(i===!1)e.tooltip(!1);else{var n=i;A(i,"fields")||(n=P({},{customItems:function(a){return a.map(function(o){var s=A(e.getOptions(),"scales"),l=A(s,["name","formatter"],function(c){return c}),u=A(s,["value","formatter"],function(c){return c});return m(m({},o),{name:l(o.data.name),value:u(o.data.value)})})}},n)),e.tooltip(n)}return r}function mB(r){var e=r.chart;return e.axis(!1),r}function xB(r){var e=r.drilldown,t=r.interactions,i=t===void 0?[]:t;return e!=null&&e.enabled?P({},r,{interactions:Z(Z([],i,!0),[{type:"drill-down",cfg:{drillDownConfig:e,transformData:lx,enableDrillDown:!0}}],!1)}):r}function wB(r){var e=r.chart,t=r.options;return At({chart:e,options:xB(t)}),r}function bB(r){return J(Ce("pointStyle"),vB,dB,ut,gB,pB,mB,xn,yB,wB,xt,Et())(r)}function Od(r){var e=A(r,["event","data","data"],{});return R(e.children)&&e.children.length>0}function Bd(r){var e=r.view.getCoordinate(),t=e.innerRadius;if(t){var i=r.event,n=i.x,a=i.y,o=e.center,s=o.x,l=o.y,u=e.getRadius()*t,c=Math.sqrt(Math.pow(s-n,2)+Math.pow(l-a,2));return c-1?Hk(v,c,h):!0}),r.getRootView().render(!0)}};function AB(r){var e,t=r.options,i=t.geometryOptions,n=i===void 0?[]:i,a=t.xField,o=t.yField,s=Qu(n,function(l){var u=l.geometry;return u===Ei.Line||u===void 0});return P({},{options:{geometryOptions:[],meta:(e={},e[a]={type:"cat",sync:!0,range:s?[0,1]:void 0},e),tooltip:{showMarkers:s,showCrosshairs:s,shared:!0,crosshairs:{type:"x"}},interactions:s?[{type:"legend-visible-filter"}]:[{type:"legend-visible-filter"},{type:"active-region"}],legend:{position:"top-left"}}},r,{options:{yAxis:zd(o,t.yAxis),geometryOptions:[Rd(a,o[0],n[0]),Rd(a,o[1],n[1])],annotations:zd(o,t.annotations)}})}function FB(r){var e,t,i=r.chart,n=r.options,a=n.geometryOptions,o={line:0,column:1},s=[{type:(e=a[0])===null||e===void 0?void 0:e.geometry,id:Ae},{type:(t=a[1])===null||t===void 0?void 0:t.geometry,id:Fe}];return s.sort(function(l,u){return-o[l.type]+o[u.type]}).forEach(function(l){return i.createView({id:l.id})}),r}function TB(r){var e=r.chart,t=r.options,i=t.xField,n=t.yField,a=t.geometryOptions,o=t.data,s=t.tooltip,l=[m(m({},a[0]),{id:Ae,data:o[0],yField:n[0]}),m(m({},a[1]),{id:Fe,data:o[1],yField:n[1]})];return l.forEach(function(u){var c=u.id,h=u.data,f=u.yField,v=Eh(u)&&u.isPercent,d=v?qm(h,f,i,f):h,p=st(e,c).data(d),g=v?m({formatter:function(y){return{name:y[u.seriesField]||f,value:(Number(y[f])*100).toFixed(2)+"%"}}},s):s;MB({chart:p,options:{xField:i,yField:f,tooltip:g,geometryOption:u}})}),r}function EB(r){var e,t=r.chart,i=r.options,n=i.geometryOptions,a=((e=t.getTheme())===null||e===void 0?void 0:e.colors10)||[],o=0;return t.once("beforepaint",function(){C(n,function(s,l){var u=st(t,l===0?Ae:Fe);if(!s.color){var c=u.getGroupScales(),h=A(c,[0,"values","length"],1),f=a.slice(o,o+h).concat(l===0?[]:a);u.geometries.forEach(function(v){s.seriesField?v.color(s.seriesField,f):v.color(f[0])}),o+=h}}),t.render(!0)}),r}function kB(r){var e,t,i=r.chart,n=r.options,a=n.xAxis,o=n.yAxis,s=n.xField,l=n.yField;return Lt((e={},e[s]=a,e[l[0]]=o[0],e))(P({},r,{chart:st(i,Ae)})),Lt((t={},t[s]=a,t[l[1]]=o[1],t))(P({},r,{chart:st(i,Fe)})),r}function LB(r){var e=r.chart,t=r.options,i=st(e,Ae),n=st(e,Fe),a=t.xField,o=t.yField,s=t.xAxis,l=t.yAxis;return e.axis(a,!1),e.axis(o[0],!1),e.axis(o[1],!1),i.axis(a,s),i.axis(o[0],Nd(l[0],hn.Left)),n.axis(a,!1),n.axis(o[1],Nd(l[1],hn.Right)),r}function IB(r){var e=r.chart,t=r.options,i=t.tooltip,n=st(e,Ae),a=st(e,Fe);return e.tooltip(i),n.tooltip({shared:!0}),a.tooltip({shared:!0}),r}function PB(r){var e=r.chart;return At(P({},r,{chart:st(e,Ae)})),At(P({},r,{chart:st(e,Fe)})),r}function DB(r){var e=r.chart,t=r.options,i=t.annotations,n=A(i,[0]),a=A(i,[1]);return Et(n)(P({},r,{chart:st(e,Ae),options:{annotations:n}})),Et(a)(P({},r,{chart:st(e,Fe),options:{annotations:a}})),r}function OB(r){var e=r.chart;return ut(P({},r,{chart:st(e,Ae)})),ut(P({},r,{chart:st(e,Fe)})),ut(r),r}function BB(r){var e=r.chart;return xt(P({},r,{chart:st(e,Ae)})),xt(P({},r,{chart:st(e,Fe)})),r}function RB(r){var e=r.chart,t=r.options,i=t.yAxis;return Ti(P({},r,{chart:st(e,Ae),options:{yAxis:i[0]}})),Ti(P({},r,{chart:st(e,Fe),options:{yAxis:i[1]}})),r}function zB(r){var e=r.chart,t=r.options,i=t.legend,n=t.geometryOptions,a=t.yField,o=t.data,s=st(e,Ae),l=st(e,Fe);if(i===!1)e.legend(!1);else if(pt(i)&&i.custom===!0)e.legend(i);else{var u=A(n,[0,"legend"],i),c=A(n,[1,"legend"],i);e.once("beforepaint",function(){var h=o[0].length?Gd({view:s,geometryOption:n[0],yField:a[0],legend:u}):[],f=o[1].length?Gd({view:l,geometryOption:n[1],yField:a[1],legend:c}):[];e.legend(P({},i,{custom:!0,items:h.concat(f)}))}),n[0].seriesField&&s.legend(n[0].seriesField,u),n[1].seriesField&&l.legend(n[1].seriesField,c),e.on("legend-item:click",function(h){var f=A(h,"gEvent.delegateObject",{});if(f&&f.item){var v=f.item,d=v.value,p=v.isGeometry,g=v.viewId;if(p){var y=op(a,function(b){return b===d});if(y>-1){var x=A(st(e,g),"geometries");C(x,function(b){b.changeVisible(!f.item.unchecked)})}}else{var w=A(e.getController("legend"),"option.items",[]);C(e.views,function(b){var S=b.getGroupScales();C(S,function(M){M.values&&M.values.indexOf(d)>-1&&b.filter(M.field,function(F){var T=Ne(w,function(L){return L.value===F});return!T.unchecked})}),e.render(!0)})}}})}return r}function NB(r){var e=r.chart,t=r.options,i=t.slider,n=st(e,Ae),a=st(e,Fe);return i&&(n.option("slider",i),n.on("slider:valuechanged",function(o){var s=o.event,l=s.value,u=s.originValue;Pt(l,u)||Vd(a,l)}),e.once("afterpaint",function(){if(!tn(i)){var o=i.start,s=i.end;(o||s)&&Vd(a,[o,s])}})),r}function GB(r){return J(AB,FB,OB,TB,kB,LB,RB,IB,PB,DB,BB,EB,zB,NB)(r)}(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dual-axes",t}return e.prototype.getDefaultOptions=function(){return P({},r.prototype.getDefaultOptions.call(this),{yAxis:[],syncViewPadding:!0})},e.prototype.getSchemaAdaptor=function(){return GB},e})(nt);function VB(r,e){var t=e.data,i=e.coordinate,n=e.interactions,a=e.annotations,o=e.animation,s=e.tooltip,l=e.axes,u=e.meta,c=e.geometries;t&&r.data(t);var h={};l&&C(l,function(f,v){h[v]=dt(f,ce)}),h=P({},u,h),r.scale(h),i&&r.coordinate(i),l===!1?r.axis(!1):C(l,function(f,v){r.axis(v,f)}),C(c,function(f){var v=pe({chart:r,options:f}).ext,d=f.adjust;d&&v.geometry.adjust(d)}),C(n,function(f){f.enable===!1?r.removeInteraction(f.type):r.interaction(f.type,f.cfg)}),C(a,function(f){r.annotation()[f.type](m({},f))}),Ra(r,o),s?(r.interaction("tooltip"),r.tooltip(s)):s===!1&&r.removeInteraction("tooltip")}function YB(r){var e=r.chart,t=r.options,i=t.type,n=t.data,a=t.fields,o=t.eachView,s=cs(t,["type","data","fields","eachView","axes","meta","tooltip","coordinate","theme","legend","interactions","annotations"]);return e.data(n),e.facet(i,m(m({},s),{fields:a,eachView:function(l,u){var c=o(l,u);if(c.geometries)VB(l,c);else{var h=c,f=h.options;f.tooltip&&l.interaction("tooltip"),$u(h.type,l,f)}}})),r}function $B(r){var e=r.chart,t=r.options,i=t.axes,n=t.meta,a=t.tooltip,o=t.coordinate,s=t.theme,l=t.legend,u=t.interactions,c=t.annotations,h={};return i&&C(i,function(f,v){h[v]=dt(f,ce)}),h=P({},n,h),e.scale(h),e.coordinate(o),i?C(i,function(f,v){e.axis(v,f)}):e.axis(!1),a?(e.interaction("tooltip"),e.tooltip(a)):a===!1&&e.removeInteraction("tooltip"),e.legend(l),s&&e.theme(s),C(u,function(f){f.enable===!1?e.removeInteraction(f.type):e.interaction(f.type,f.cfg)}),C(c,function(f){e.annotation()[f.type](m({},f))}),r}function HB(r){return J(ut,YB,$B)(r)}var XB={title:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},rowTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},columnTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}}};(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="area",t}return e.getDefaultOptions=function(){return XB},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return HB},e})(nt);function WB(r){var e=r.chart,t=r.options,i=t.data,n=t.type,a=t.xField,o=t.yField,s=t.colorField,l=t.sizeField,u=t.sizeRatio,c=t.shape,h=t.color,f=t.tooltip,v=t.heatmapStyle,d=t.meta;e.data(i);var p="polygon";n==="density"&&(p="heatmap");var g=Oe(f,[a,o,s]),y=g.fields,x=g.formatter,w=1;return(u||u===0)&&(!c&&!l?console.warn("sizeRatio is not in effect: Must define shape or sizeField first"):u<0||u>1?console.warn("sizeRatio is not in effect: It must be a number in [0,1]"):w=u),pe(P({},r,{options:{type:p,colorField:s,tooltipFields:y,shapeField:l||"",label:void 0,mapping:{tooltip:x,shape:c&&(l?function(b){var S=i.map(function(L){return L[l]}),M=(d==null?void 0:d[l])||{},F=M.min,T=M.max;return F=rt(F)?F:Math.min.apply(Math,S),T=rt(T)?T:Math.max.apply(Math,S),[c,(A(b,l)-F)/(T-F),w]}:function(){return[c,1,w]}),color:h||s&&e.getTheme().sequenceColors.join("-"),style:v}}})),r}function _B(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return J(Lt((e={},e[a]=i,e[o]=n,e)))(r)}function qB(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return i===!1?e.axis(a,!1):e.axis(a,i),n===!1?e.axis(o,!1):e.axis(o,n),r}function UB(r){var e=r.chart,t=r.options,i=t.legend,n=t.colorField,a=t.sizeField,o=t.sizeLegend,s=i!==!1;return n&&e.legend(n,s?i:!1),a&&e.legend(a,o===void 0?i:o),!s&&!o&&e.legend(!1),r}function jB(r){var e=r.chart,t=r.options,i=t.label,n=t.colorField,a=t.type,o=jt(e,a==="density"?"heatmap":"polygon");if(!i)o.label(!1);else if(n){var s=i.callback,l=yt(i,["callback"]);o.label({fields:[n],callback:s,cfg:Yt(l)})}return r}function ZB(r){var e,t,i=r.chart,n=r.options,a=n.coordinate,o=n.reflect,s=P({actions:[]},a??{type:"rect"});return o&&((t=(e=s.actions)===null||e===void 0?void 0:e.push)===null||t===void 0||t.call(e,["reflect",o])),i.coordinate(s),r}function QB(r){return J(ut,Ce("heatmapStyle"),_B,ZB,WB,qB,UB,Nt,jB,Et(),At,xt,Jr)(r)}var KB=P({},nt.getDefaultOptions(),{type:"polygon",legend:!1,coordinate:{type:"rect"},xAxis:{tickLine:null,line:null,grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}},yAxis:{grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}}});ft("polygon","circle",{draw:function(r,e){var t,i,n=r.x,a=r.y,o=this.parsePoints(r.points),s=Math.abs(o[2].x-o[1].x),l=Math.abs(o[1].y-o[0].y),u=Math.min(s,l)/2,c=Number(r.shape[1]),h=Number(r.shape[2]),f=Math.sqrt(h),v=u*f*Math.sqrt(c),d=((t=r.style)===null||t===void 0?void 0:t.fill)||r.color||((i=r.defaultStyle)===null||i===void 0?void 0:i.fill),p=e.addShape("circle",{attrs:m(m(m({x:n,y:a,r:v},r.defaultStyle),r.style),{fill:d})});return p}});ft("polygon","square",{draw:function(r,e){var t,i,n=r.x,a=r.y,o=this.parsePoints(r.points),s=Math.abs(o[2].x-o[1].x),l=Math.abs(o[1].y-o[0].y),u=Math.min(s,l),c=Number(r.shape[1]),h=Number(r.shape[2]),f=Math.sqrt(h),v=u*f*Math.sqrt(c),d=((t=r.style)===null||t===void 0?void 0:t.fill)||r.color||((i=r.defaultStyle)===null||i===void 0?void 0:i.fill),p=e.addShape("rect",{attrs:m(m(m({x:n-v/2,y:a-v/2,width:v,height:v},r.defaultStyle),r.style),{fill:d})});return p}});(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="heatmap",t}return e.getDefaultOptions=function(){return KB},e.prototype.getSchemaAdaptor=function(){return QB},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(nt);var JB="liquid";function hx(r){return[{percent:r,type:JB}]}function tR(r){var e=r.chart,t=r.options,i=t.percent,n=t.liquidStyle,a=t.radius,o=t.outline,s=t.wave,l=t.shape,u=t.shapeStyle,c=t.animation;e.scale({percent:{min:0,max:1}}),e.data(hx(i));var h=t.color||e.getTheme().defaultColor,f=P({},r,{options:{xField:"type",yField:"percent",widthRatio:a,interval:{color:h,style:n,shape:"liquid-fill-gauge"}}}),v=Zt(f).ext,d=v.geometry,p=e.getTheme().background,g={percent:i,radius:a,outline:o,wave:s,shape:l,shapeStyle:u,background:p,animation:c};return d.customInfo(g),e.legend(!1),e.axis(!1),e.tooltip(!1),r}function fx(r,e){var t=r.chart,i=r.options,n=i.statistic,a=i.percent,o=i.meta;t.getController("annotation").clear(!0);var s=A(o,["percent","formatter"])||function(u){return"".concat((u*100).toFixed(2),"%")},l=n.content;return l&&(l=P({},l,{content:B(l.content)?s(a):l.content})),_s(t,{statistic:m(m({},n),{content:l}),plotType:"liquid"},{percent:a}),e&&t.render(!0),r}function eR(r){return J(ut,Ce("liquidStyle"),tR,fx,Lt({}),xt,At)(r)}var rR={radius:.9,statistic:{title:!1,content:{style:{opacity:.75,fontSize:"30px",lineHeight:"30px",textAlign:"center"}}},outline:{border:2,distance:0},wave:{count:3,length:192},shape:"circle"},Yd=5e3;function $d(r,e,t){return r+(e-r)*t}function iR(r){var e=m({opacity:1},r.style);return r.color&&!e.fill&&(e.fill=r.color),e}function nR(r){var e={fill:"#fff",fillOpacity:0,lineWidth:4},t=mt({},e,r.style);return r.color&&!t.stroke&&(t.stroke=r.color),rt(r.opacity)&&(t.opacity=t.strokeOpacity=r.opacity),t}function aR(r,e,t,i){return e===0?[[r+1/2*t/Math.PI/2,i/2],[r+1/2*t/Math.PI,i],[r+t/4,i]]:e===1?[[r+1/2*t/Math.PI/2*(Math.PI-2),i],[r+1/2*t/Math.PI/2*(Math.PI-1),i/2],[r+t/4,0]]:e===2?[[r+1/2*t/Math.PI/2,-i/2],[r+1/2*t/Math.PI,-i],[r+t/4,-i]]:[[r+1/2*t/Math.PI/2*(Math.PI-2),-i],[r+1/2*t/Math.PI/2*(Math.PI-1),-i/2],[r+t/4,0]]}function oR(r,e,t,i,n,a,o){for(var s=Math.ceil(2*r/t*4)*4,l=[],u=i;u<-Math.PI*2;)u+=Math.PI*2;for(;u>0;)u-=Math.PI*2;u=u/Math.PI/2*t;var c=a-r+u-r*2;l.push(["M",c,e]);for(var h=0,f=0;f0){var O=e.addGroup({name:"waves"}),z=O.setClip({type:"path",attrs:{path:I}});sR(w.x,w.y,1-r.points[1].y,g,F,O,z,M*2,y,h)}return e.addShape("path",{name:"distance",attrs:{path:I,fill:"transparent",lineWidth:d+p*2,stroke:c==="transparent"?"#fff":c}}),e.addShape("path",{name:"wrap",attrs:mt(T,{path:I,fill:"transparent",lineWidth:d})}),e}});var N5=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="liquid",t}return e.getDefaultOptions=function(){return rR},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.changeData=function(t){this.chart.emit(ot.BEFORE_CHANGE_DATA,Tt.fromData(this.chart,ot.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data(hx(t)),fx({chart:this.chart,options:this.options},!0),this.chart.emit(ot.AFTER_CHANGE_DATA,Tt.fromData(this.chart,ot.AFTER_CHANGE_DATA,null))},e.prototype.getSchemaAdaptor=function(){return eR},e}(nt);function vR(r){var e=r.chart,t=r.options,i=t.data,n=t.lineStyle,a=t.color,o=t.point,s=t.area;e.data(i);var l=P({},r,{options:{line:{style:n,color:a},point:o&&m({color:a},o),area:s&&m({color:a},s),label:void 0}}),u=P({},l,{options:{tooltip:!1}}),c=(o==null?void 0:o.state)||t.state,h=P({},l,{options:{tooltip:!1,state:c}});return wn(l),Me(h),js(u),r}function dR(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return J(Lt((e={},e[a]=i,e[o]=n,e)))(r)}function pR(r){var e=r.chart,t=r.options,i=t.radius,n=t.startAngle,a=t.endAngle;return e.coordinate("polar",{radius:i,startAngle:n,endAngle:a}),r}function gR(r){var e=r.chart,t=r.options,i=t.xField,n=t.xAxis,a=t.yField,o=t.yAxis;return e.axis(i,n),e.axis(a,o),r}function yR(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=jt(e,"line");if(!i)a.label(!1);else{var o=i.fields,s=i.callback,l=yt(i,["fields","callback"]);a.label({fields:o||[n],callback:s,cfg:Yt(l)})}return r}function mR(r){return J(vR,dR,ut,pR,gR,xn,Nt,yR,At,xt,Et())(r)}var xR=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"name",{get:function(){return"radar-tooltip"},enumerable:!1,configurable:!0}),e.prototype.getTooltipItems=function(t){var i=this.getTooltipCfg(),n=i.shared,a=i.title,o=r.prototype.getTooltipItems.call(this,t);if(o.length>0){var s=this.view.geometries[0],l=s.dataArray,u=o[0].name,c=[];return l.forEach(function(h){h.forEach(function(f){var v=ve.getTooltipItems(f,s),d=v[0];if(!n&&d&&d.name===u){var p=B(a)?u:a;c.push(m(m({},d),{name:d.title,title:p}))}else if(n&&d){var p=B(a)?d.name||u:a;c.push(m(m({},d),{name:d.title,title:p}))}})}),c}return[]},e}(Cy);Li("radar-tooltip",xR);var wR=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(){var t=this.context.view;t.removeInteraction("tooltip")},e.prototype.show=function(){var t=this.context.event,i=this.getTooltipController();i.showTooltip({x:t.x,y:t.y})},e.prototype.hide=function(){var t=this.getTooltipController();t.hideTooltip()},e.prototype.getTooltipController=function(){var t=this.context.view;return t.getController("radar-tooltip")},e}(St);j("radar-tooltip",wR);it("radar-tooltip",{start:[{trigger:"plot:mousemove",action:"radar-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"radar-tooltip:hide"}]});var G5=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="radar",t}return e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return P({},r.prototype.getDefaultOptions.call(this),{xAxis:{label:{offset:15},grid:{line:{type:"line"}}},yAxis:{grid:{line:{type:"circle"}}},legend:{position:"top"},tooltip:{shared:!0,showCrosshairs:!0,showMarkers:!0,crosshairs:{type:"xy",line:{style:{stroke:"#565656",lineDash:[4]}},follow:!0}}})},e.prototype.getSchemaAdaptor=function(){return mR},e}(nt);function bR(r,e,t){var i=t.map(function(o){return o[e]}).filter(function(o){return o!==void 0}),n=i.length>0?Math.max.apply(Math,i):0,a=Math.abs(r)%360;return a?n*360/a:n}function SR(r,e,t){var i=[];return r.forEach(function(n){var a=i.find(function(o){return o[e]===n[e]});a?a[t]+=n[t]||null:i.push(m({},n))}),i}function CR(r){var e=r.chart,t=r.options,i=t.barStyle,n=t.color,a=t.tooltip,o=t.colorField,s=t.type,l=t.xField,u=t.yField,c=t.data,h=t.shape,f=ln(c,u);e.data(f);var v=P({},r,{options:{tooltip:a,seriesField:o,interval:{style:i,color:n,shape:h||(s==="line"?"line":"intervel")},minColumnWidth:t.minBarWidth,maxColumnWidth:t.maxBarWidth,columnBackground:t.barBackground}});return Zt(v),s==="line"&&Me({chart:e,options:{xField:l,yField:u,seriesField:o,point:{shape:"circle",color:n}}}),r}function vx(r){var e,t=r.options,i=t.yField,n=t.xField,a=t.data,o=t.isStack,s=t.isGroup,l=t.colorField,u=t.maxAngle,c=o&&!s&&l?SR(a,n,i):a,h=ln(c,i);return J(Lt((e={},e[i]={min:0,max:bR(u,i,h)},e)))(r)}function MR(r){var e=r.chart,t=r.options,i=t.radius,n=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"polar",cfg:{radius:i,innerRadius:n,startAngle:a,endAngle:o}}).transpose(),r}function AR(r){var e=r.chart,t=r.options,i=t.xField,n=t.xAxis;return e.axis(i,n),r}function FR(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=jt(e,"interval");if(!i)a.label(!1);else{var o=i.callback,s=yt(i,["callback"]);a.label({fields:[n],callback:o,cfg:m(m({},Yt(s)),{type:"polar"})})}return r}function TR(r){return J(Ce("barStyle"),CR,vx,AR,MR,At,xt,ut,Nt,xn,Et(),FR)(r)}var ER=P({},nt.getDefaultOptions(),{interactions:[{type:"element-active"}],legend:!1,tooltip:{showMarkers:!1},xAxis:{grid:null,tickLine:null,line:null},maxAngle:240});(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="radial-bar",t}return e.getDefaultOptions=function(){return ER},e.prototype.changeData=function(t){this.updateOption({data:t}),vx({chart:this.chart,options:this.options}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return TR},e})(nt);function kR(r){var e=r.chart,t=r.options,i=t.data,n=t.sectorStyle,a=t.shape,o=t.color;return e.data(i),J(Zt)(P({},r,{options:{marginRatio:1,interval:{style:n,color:o,shape:a}}})),r}function LR(r){var e=r.chart,t=r.options,i=t.label,n=t.xField,a=jt(e,"interval");if(i===!1)a.label(!1);else if(pt(i)){var o=i.callback,s=i.fields,l=yt(i,["callback","fields"]),u=l.offset,c=l.layout;(u===void 0||u>=0)&&(c=c?R(c)?c:[c]:[],l.layout=qt(c,function(h){return h.type!=="limit-in-shape"}),l.layout.length||delete l.layout),a.label({fields:s||[n],callback:o,cfg:Yt(l)})}else br($e.WARN,i===null,"the label option must be an Object."),a.label({fields:[n]});return r}function IR(r){var e=r.chart,t=r.options,i=t.legend,n=t.seriesField;return i===!1?e.legend(!1):n&&e.legend(n,i),r}function PR(r){var e=r.chart,t=r.options,i=t.radius,n=t.innerRadius,a=t.startAngle,o=t.endAngle;return e.coordinate({type:"polar",cfg:{radius:i,innerRadius:n,startAngle:a,endAngle:o}}),r}function DR(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return J(Lt((e={},e[a]=i,e[o]=n,e)))(r)}function OR(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return i?e.axis(a,i):e.axis(a,!1),n?e.axis(o,n):e.axis(o,!1),r}function BR(r){J(Ce("sectorStyle"),kR,DR,LR,PR,OR,IR,Nt,At,xt,ut,Et(),Jr)(r)}var RR=P({},nt.getDefaultOptions(),{xAxis:!1,yAxis:!1,legend:{position:"right",radio:{}},sectorStyle:{stroke:"#fff",lineWidth:1},label:{layout:{type:"limit-in-shape"}},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]});(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="rose",t}return e.getDefaultOptions=function(){return RR},e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return BR},e})(nt);var Xd="x",Wd="y",_d="name",nl="nodes",al="edges";function zR(r,e,t){var i=[];return r.forEach(function(n){var a=n[e],o=n[t];i.includes(a)||i.push(a),i.includes(o)||i.push(o)}),i}function NR(r,e,t,i){var n={};return e.forEach(function(a){n[a]={},e.forEach(function(o){n[a][o]=0})}),r.forEach(function(a){n[a[t]][a[i]]=1}),n}function GR(r,e,t){if(!R(r))return[];var i=[],n=zR(r,e,t),a=NR(r,n,e,t),o={};n.forEach(function(l){o[l]=0});function s(l){o[l]=1,n.forEach(function(u){if(a[l][u]!=0)if(o[u]==1)i.push("".concat(l,"_").concat(u));else{if(o[u]==-1)return;s(u)}}),o[l]=-1}return n.forEach(function(l){o[l]!=-1&&s(l)}),i.length!==0&&console.warn("sankey data contains circle, ".concat(i.length," records removed."),i),r.filter(function(l){return i.findIndex(function(u){return u==="".concat(l[e],"_").concat(l[t])})<0})}function VR(r){return r.target.depth}function YR(r){return r.depth}function $R(r,e){return e-1-r.height}function kh(r,e){return r.sourceLinks.length?r.depth:e-1}function HR(r){return r.targetLinks.length?r.depth:r.sourceLinks.length?rw(r.sourceLinks,VR)-1:0}function Co(r){return function(){return r}}function _l(r,e){for(var t=0,i=0;iW)throw new Error("circular link");$=V,V=new Set}if(u)for(var et=Math.max(ql(N,function(tt){return tt.depth})+1,0),at=void 0,K=0;KW)throw new Error("circular link");$=V,V=new Set}}function b(D){for(var N=D.nodes,W=Math.max(ql(N,function(kt){return kt.depth})+1,0),$=(t-r-n)/(W-1),V=new Array(W).fill(0).map(function(){return[]}),_=0,et=N;_0){var ti=(tt/gt-K.y0)*N;K.y0+=ti,K.y1+=ti,O(K)}}c===void 0&&_.sort(as),_.length&&L(_,W)}}function T(D,N,W){for(var $=D.length,V=$-2;V>=0;--V){for(var _=D[V],et=0,at=_;et0){var ti=(tt/gt-K.y0)*N;K.y0+=ti,K.y1+=ti,O(K)}}c===void 0&&_.sort(as),_.length&&L(_,W)}}function L(D,N){var W=D.length>>1,$=D[W];I(D,$.y0-o,W-1,N),k(D,$.y1+o,W+1,N),I(D,i,D.length-1,N),k(D,e,0,N)}function k(D,N,W,$){for(;W1e-6&&(V.y0+=_,V.y1+=_),N=V.y1+o}}function I(D,N,W,$){for(;W>=0;--W){var V=D[W],_=(V.y1-N)*$;_>1e-6&&(V.y0-=_,V.y1-=_),N=V.y0-o}}function O(D){var N=D.sourceLinks,W=D.targetLinks;if(h===void 0){for(var $=0,V=W;$ "+n,value:a}}},nodeWidthRatio:.008,nodePaddingRatio:.01,animation:{appear:{animation:"wave-in"},enter:{animation:"wave-in"}}}},e.prototype.changeData=function(t){this.updateOption({data:t});var i=dx(this.options,this.chart.width,this.chart.height),n=i.nodes,a=i.edges,o=st(this.chart,nl),s=st(this.chart,al);o.changeData(n),s.changeData(a)},e.prototype.getSchemaAdaptor=function(){return lz},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(nt);var Lh="ancestor-node",px="value",Aa="path",cz=[Aa,ox,Ah,sx,"name","depth","height"],hz=P({},nt.getDefaultOptions(),{innerRadius:0,radius:.85,hierarchyConfig:{field:"value"},tooltip:{shared:!0,showMarkers:!1,offset:20,showTitle:!1},legend:!1,sunburstStyle:{lineWidth:.5,stroke:"#FFF"},drilldown:{enabled:!0}}),fz={field:"value",size:[1,1],round:!1,padding:0,sort:function(r,e){return e.value-r.value},as:["x","y"],ignoreParentValue:!0};function vz(r,e){e=mt({},fz,e);var t=e.as;if(!R(t)||t.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');var i;try{i=Fh(e)}catch(l){console.warn(l)}var n=function(l){return ex().size(e.size).round(e.round).padding(e.padding)(Cn(l).sum(function(u){return Vt(u.children)?e.ignoreParentValue?0:u[i]-Jt(u.children,function(c,h){return c+h[i]},0):u[i]}).sort(e.sort))},a=n(r),o=t[0],s=t[1];return a.each(function(l){var u,c;l[o]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((u=l.data)===null||u===void 0?void 0:u.name)||((c=l.data)===null||c===void 0?void 0:c.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(function(h){t.indexOf(h)===-1&&delete l[h]})}),Th(a)}var dz={field:"value",tile:"treemapSquarify",size:[1,1],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,as:["x","y"],sort:function(r,e){return e.value-r.value},ratio:.5*(1+Math.sqrt(5))};function pz(r,e){return r==="treemapSquarify"?Dd[r].ratio(e):Dd[r]}function gx(r,e){e=mt({},dz,e);var t=e.as;if(!R(t)||t.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');var i;try{i=Fh(e)}catch(u){console.warn(u)}var n=pz(e.tile,e.ratio),a=function(u){return ax().tile(n).size(e.size).round(e.round).padding(e.padding).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(Cn(u).sum(function(c){return e.ignoreParentValue&&c.children?0:c[i]}).sort(e.sort))},o=a(r),s=t[0],l=t[1];return o.each(function(u){u[s]=[u.x0,u.x1,u.x1,u.x0],u[l]=[u.y1,u.y1,u.y0,u.y0],["x0","x1","y0","y1"].forEach(function(c){t.indexOf(c)===-1&&delete u[c]})}),Th(o)}function yx(r){var e=r.data,t=r.colorField,i=r.rawFields,n=r.hierarchyConfig,a=n===void 0?{}:n,o=a.activeDepth,s={partition:vz,treemap:gx},l=r.seriesField,u=r.type||"partition",c=s[u](e,m(m({field:l||"value"},cs(a,["activeDepth"])),{type:"hierarchy.".concat(u),as:["x","y"]})),h=[];return c.forEach(function(f){var v,d,p,g,y,x;if(f.depth===0||o>0&&f.depth>o)return null;for(var w=f.data.name,b=m({},f);b.depth>1;)w="".concat((d=b.parent.data)===null||d===void 0?void 0:d.name," / ").concat(w),b=b.parent;var S=m(m(m({},dt(f.data,Z(Z([],i||[],!0),[a.field],!1))),(v={},v[Aa]=w,v[Lh]=b.data.name,v)),f);l&&(S[l]=f.data[l]||((g=(p=f.parent)===null||p===void 0?void 0:p.data)===null||g===void 0?void 0:g[l])),t&&(S[t]=f.data[t]||((x=(y=f.parent)===null||y===void 0?void 0:y.data)===null||x===void 0?void 0:x[t])),S.ext=a,S[Ma]={hierarchyConfig:a,colorField:t,rawFields:i},h.push(S)}),h}function gz(r){var e=r.chart,t=r.options,i=t.color,n=t.colorField,a=n===void 0?Lh:n,o=t.sunburstStyle,s=t.rawFields,l=s===void 0?[]:s,u=t.shape,c=yx(t);e.data(c);var h;return o&&(h=function(f){return P({},{fillOpacity:Math.pow(.85,f.depth)},X(o)?o(f):o)}),Zs(P({},r,{options:{xField:"x",yField:"y",seriesField:a,rawFields:bi(Z(Z([],cz,!0),l,!0)),polygon:{color:i,style:h,shape:u}}})),r}function yz(r){var e=r.chart;return e.axis(!1),r}function mz(r){var e=r.chart,t=r.options,i=t.label,n=jt(e,"polygon");if(!i)n.label(!1);else{var a=i.fields,o=a===void 0?["name"]:a,s=i.callback,l=yt(i,["fields","callback"]);n.label({fields:o,callback:s,cfg:Yt(l)})}return r}function xz(r){var e=r.chart,t=r.options,i=t.innerRadius,n=t.radius,a=t.reflect,o=e.coordinate({type:"polar",cfg:{innerRadius:i,radius:n}});return a&&o.reflect(a),r}function wz(r){var e,t=r.options,i=t.hierarchyConfig,n=t.meta;return J(Lt({},(e={},e[px]=A(n,A(i,["field"],"value")),e)))(r)}function bz(r){var e=r.chart,t=r.options,i=t.tooltip;if(i===!1)e.tooltip(!1);else{var n=i;A(i,"fields")||(n=P({},{customItems:function(a){return a.map(function(o){var s=A(e.getOptions(),"scales"),l=A(s,[Aa,"formatter"],function(c){return c}),u=A(s,[px,"formatter"],function(c){return c});return m(m({},o),{name:l(o.data[Aa]),value:u(o.data.value)})})}},n)),e.tooltip(n)}return r}function Sz(r){var e=r.drilldown,t=r.interactions,i=t===void 0?[]:t;return e!=null&&e.enabled?P({},r,{interactions:Z(Z([],i,!0),[{type:"drill-down",cfg:{drillDownConfig:e,transformData:yx}}],!1)}):r}function Cz(r){var e=r.chart,t=r.options,i=t.drilldown;return At({chart:e,options:Sz(t)}),i!=null&&i.enabled&&(e.appendPadding=Ws(e.appendPadding,A(i,["breadCrumb","position"]))),r}function Mz(r){return J(ut,Ce("sunburstStyle"),gz,yz,wz,xn,xz,bz,mz,Cz,xt,Et())(r)}(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="sunburst",t}return e.getDefaultOptions=function(){return hz},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Mz},e.SUNBURST_ANCESTOR_FIELD=Lh,e.SUNBURST_PATH_FIELD=Aa,e.NODE_ANCESTORS_FIELD=Ah,e})(nt);function mx(r,e){if(R(r))return r.find(function(t){return t.type===e})}function xx(r,e){var t=mx(r,e);return t&&t.enable!==!1}function Ih(r){var e=r.interactions,t=r.drilldown;return A(t,"enabled")||xx(e,"treemap-drill-down")}function Az(r){var e=r.interactions["drill-down"];if(e){var t=e.context.actions.find(function(i){return i.name==="drill-down-action"});t.reset()}}function Ph(r){var e=r.data,t=r.colorField,i=r.enableDrillDown,n=r.hierarchyConfig,a=gx(e,m(m({},n),{type:"hierarchy.treemap",field:"value",as:["x","y"]})),o=[];return a.forEach(function(s){if(s.depth===0||i&&s.depth!==1||!i&&s.children)return null;var l=s.ancestors().map(function(f){return{data:f.data,height:f.height,value:f.value}}),u=i&&R(e.path)?l.concat(e.path.slice(1)):l,c=Object.assign({},s.data,m({x:s.x,y:s.y,depth:s.depth,value:s.value,path:u},s));if(!s.data[t]&&s.parent){var h=s.ancestors().find(function(f){return f.data[t]});c[t]=h==null?void 0:h.data[t]}else c[t]=s.data[t];c[Ma]={hierarchyConfig:n,colorField:t,enableDrillDown:i},o.push(c)}),o}function Fz(r){var e=r.options,t=e.colorField;return P({options:{rawFields:["value"],tooltip:{fields:["name","value",t,"path"],formatter:function(i){return{name:i.name,value:i.value}}}}},r)}function Tz(r){var e=r.chart,t=r.options,i=t.color,n=t.colorField,a=t.rectStyle,o=t.hierarchyConfig,s=t.rawFields,l=Ph({data:t.data,colorField:t.colorField,enableDrillDown:Ih(t),hierarchyConfig:o});return e.data(l),Zs(P({},r,{options:{xField:"x",yField:"y",seriesField:n,rawFields:s,polygon:{color:i,style:a}}})),e.coordinate().reflect("y"),r}function Ez(r){var e=r.chart;return e.axis(!1),r}function kz(r){var e=r.drilldown,t=r.interactions,i=t===void 0?[]:t,n=Ih(r);return n?P({},r,{interactions:Z(Z([],i,!0),[{type:"drill-down",cfg:{drillDownConfig:e,transformData:Ph}}],!1)}):r}function Lz(r){var e=r.chart,t=r.options,i=t.interactions,n=t.drilldown;At({chart:e,options:kz(t)});var a=mx(i,"view-zoom");a&&(a.enable!==!1?e.getCanvas().on("mousewheel",function(s){s.preventDefault()}):e.getCanvas().off("mousewheel"));var o=Ih(t);return o&&(e.appendPadding=Ws(e.appendPadding,A(n,["breadCrumb","position"]))),r}function Iz(r){return J(Fz,ut,Ce("rectStyle"),Tz,Ez,xn,Nt,Lz,xt,Et())(r)}var Pz={colorField:"name",rectStyle:{lineWidth:1,stroke:"#fff"},hierarchyConfig:{tile:"treemapSquarify"},label:{fields:["name"],layout:{type:"limit-in-shape"}},tooltip:{showMarkers:!1,showTitle:!1},drilldown:{enabled:!1,breadCrumb:{position:"bottom-left",rootText:"初始",dividerText:"/",textStyle:{fontSize:12,fill:"rgba(0, 0, 0, 0.65)",cursor:"pointer"},activeTextStyle:{fill:"#87B5FF"}}}};(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="treemap",t}return e.getDefaultOptions=function(){return Pz},e.prototype.changeData=function(t){var i=this.options,n=i.colorField,a=i.interactions,o=i.hierarchyConfig;this.updateOption({data:t});var s=Ph({data:t,colorField:n,enableDrillDown:xx(a,"treemap-drill-down"),hierarchyConfig:o});this.chart.changeData(s),Az(this.chart)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Iz},e})(nt);var yr="id",Xu="path",Dz={appendPadding:[10,0,20,0],blendMode:"multiply",tooltip:{showTitle:!1,showMarkers:!1,fields:["id","size"],formatter:function(r){return{name:r.id,value:r.size}}},legend:{position:"top-left"},label:{style:{textAlign:"center",fill:"#fff"}},interactions:[{type:"legend-filter",enable:!1}],state:{active:{style:{stroke:"#000"}},selected:{style:{stroke:"#000",lineWidth:2}},inactive:{style:{fillOpacity:.3,strokeOpacity:.3}}},defaultInteractions:["tooltip","venn-legend-active"]};function ol(r){if(r){var e=r.geometries[0].elements;e.forEach(function(t){t.shape.toFront()})}}var Oz=zs("element-active"),Bz=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){ol(this.context.view)},e.prototype.active=function(){r.prototype.active.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(Oz),Rz=zs("element-highlight"),zz=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){ol(this.context.view)},e.prototype.highlight=function(){r.prototype.highlight.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.clear=function(){r.prototype.clear.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(Rz),Nz=zs("element-selected"),Gz=zs("element-single-selected"),Vz=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){ol(this.context.view)},e.prototype.selected=function(){r.prototype.selected.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(Nz),Yz=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){ol(this.context.view)},e.prototype.selected=function(){r.prototype.selected.call(this),this.syncElementsPos()},e.prototype.toggle=function(){r.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){r.prototype.reset.call(this),this.syncElementsPos()},e}(Gz);j("venn-element-active",Bz);j("venn-element-highlight",zz);j("venn-element-selected",Vz);j("venn-element-single-selected",Yz);it("venn-element-active",{start:[{trigger:"element:mouseenter",action:"venn-element-active:active"}],end:[{trigger:"element:mouseleave",action:"venn-element-active:reset"}]});it("venn-element-highlight",{start:[{trigger:"element:mouseenter",action:"venn-element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"venn-element-highlight:reset"}]});it("venn-element-selected",{start:[{trigger:"element:click",action:"venn-element-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-selected:reset"]}]});it("venn-element-single-selected",{start:[{trigger:"element:click",action:"venn-element-single-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-single-selected:reset"]}]});it("venn-legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","venn-element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","venn-element-active:reset"]}]});it("venn-legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","venn-element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","venn-element-highlight:reset"]}]});var $z=function(r){E(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getLabelPoint=function(t,i,n){var a=t.data,o=a.x,s=a.y,l=t.customLabelInfo,u=l.offsetX,c=l.offsetY;return{content:t.content[n],x:o+u,y:s+c}},e}(Ys);Da("venn",$z);var Qn=` \v\f\r   ᠎              \u2028\u2029`,Hz=new RegExp("([a-z])["+Qn+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Qn+"]*,?["+Qn+"]*)+)","ig"),Xz=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Qn+"]*,?["+Qn+"]*","ig");function Wz(r){if(!r)return null;if(Xx(r))return r;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(r).replace(Hz,function(i,n,a){var o=[],s=n.toLowerCase();if(a.replace(Xz,function(l,u){u&&o.push(+u)}),s==="m"&&o.length>2&&(t.push([n].concat(o.splice(0,2))),s="l",n=n==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([n,o[0]]),s==="r")t.push([n].concat(o));else for(;o.length>=e[s]&&(t.push([n].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}function _z(r){return P({},r.defaultStyle,{fill:r.color},r.style)}ft("schema","venn",{draw:function(r,e){var t=r.data,i=Wz(t[Xu]),n=_z(r),a=e.addGroup({name:"venn-shape"});a.addShape("path",{attrs:m(m({},n),{path:i}),name:"venn-path"});var o=r.customInfo,s=o.offsetX,l=o.offsetY,u=ve.transform(null,[["t",s,l]]);return a.setMatrix(u),a},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{lineWidth:0,stroke:e,fill:e,r:4}}}});var qz=function(r){return function(e,t){var i=[];return i[0]=r(e[0],t[0]),i[1]=r(e[1],t[1]),i[2]=r(e[2],t[2]),i}},Qd={normal:function(r){return r},multiply:function(r,e){return r*e/255},screen:function(r,e){return 255*(1-(1-r/255)*(1-e/255))},overlay:function(r,e){return e<128?2*r*e/255:255*(1-2*(1-r/255)*(1-e/255))},darken:function(r,e){return r>e?e:r},lighten:function(r,e){return r>e?r:e},dodge:function(r,e){return r===255?255:(r=255*(e/255)/(1-r/255),r>255?255:r)},burn:function(r,e){return e===255?255:r===0?0:255*(1-Math.min(1,(1-e/255)/(r/255)))}},Uz=function(r){if(!Qd[r])throw new Error("unknown blend mode "+r);return Qd[r]};function jz(r,e,t){t===void 0&&(t="normal");var i=qz(Uz(t))(Mo(r),Mo(e)),n=Mo(r),a=n[0],o=n[1],s=n[2],l=n[3],u=Mo(e),c=u[0],h=u[1],f=u[2],v=u[3],d=Number((l+v*(1-l)).toFixed(2)),p=Math.round((l*(1-v)*(a/255)+l*v*(i[0]/255)+(1-l)*v*(c/255))/d*255),g=Math.round((l*(1-v)*(o/255)+l*v*(i[1]/255)+(1-l)*v*(h/255))/d*255),y=Math.round((l*(1-v)*(s/255)+l*v*(i[2]/255)+(1-l)*v*(f/255))/d*255);return"rgba(".concat(p,", ").concat(g,", ").concat(y,", ").concat(d,")")}function Mo(r){var e=r.replace("/s+/g",""),t;return typeof e=="string"&&!e.startsWith("rgba")&&!e.startsWith("#")?t=zr.rgb2arr(zr.toRGB(e)).concat([1]):(e.startsWith("rgba")&&(t=e.replace("rgba(","").replace(")","").split(",")),e.startsWith("#")&&(t=zr.rgb2arr(e).concat([1])),t.map(function(i,n){return n===3?Number(i):i|0}))}function Zz(r,e,t,i){i=i||{};var n=i.maxIterations||100,a=i.tolerance||1e-10,o=r(e),s=r(t),l=t-e;if(o*s>0)throw"Initial bisect points must have opposite signs";if(o===0)return e;if(s===0)return t;for(var u=0;u=0&&(e=c),Math.abs(l)=d[v-1].fx){var I=!1;if(b.fx>k.fx?(cr(S,1+c,w,-c,k),S.fx=r(S),S.fx=1)break;for(p=1;ps+a*n*l||u>=y)g=n;else{if(Math.abs(h)<=-o*l)return n;h*(g-p)>=0&&(g=p),p=n,y=u}return 0}for(var d=0;d<10;++d){if(cr(i.x,1,t.x,n,e),u=i.fx=r(i.x,i.fxprime),h=Ki(i.fxprime,e),u>s+a*n*l||d&&u>=c)return v(f,n,c);if(Math.abs(h)<=-o*l)return n;if(h>=0)return v(n,f,u);c=u,f=n,n*=2}return n}function Kz(r,e,t){var i={x:e.slice(),fx:0,fxprime:e.slice()},n={x:e.slice(),fx:0,fxprime:e.slice()},a=e.slice(),o,s,l=1,u;t=t||{},u=t.maxIterations||e.length*20,i.fx=r(i.x,i.fxprime),o=i.fxprime.slice(),qu(o,i.fxprime,-1);for(var c=0;c1){var l=Mx(i);for(o=0;o-1){var p=r[h.parentIndex[d]],g=Math.atan2(h.x-p.x,h.y-p.y),y=Math.atan2(c.x-p.x,c.y-p.y),x=y-g;x<0&&(x+=2*Math.PI);var w=y-x/2,b=Ge(f,{x:p.x+p.radius*Math.sin(w),y:p.y+p.radius*Math.cos(w)});b>p.radius*2&&(b=p.radius*2),(v===null||v.width>b)&&(v={circle:p,width:b,p1:h,p2:c})}v!==null&&(s.push(v),n+=Uu(v.circle.radius,v.width),c=h)}}else{var S=r[0];for(o=1;oMath.abs(S.radius-r[o].radius)){M=!0;break}M?n=a=0:(n=S.radius*S.radius*Math.PI,s.push({circle:S,p1:{x:S.x,y:S.y+S.radius},p2:{x:S.x-bx,y:S.y+S.radius},width:S.radius*2}))}return a/=2,e&&(e.area=n+a,e.arcArea=n,e.polygonArea=a,e.arcs=s,e.innerPoints=i,e.intersectionPoints=t),n+a}function Jz(r,e){for(var t=0;te[t].radius+bx)return!1;return!0}function tN(r){for(var e=[],t=0;t=r+e)return 0;if(t<=Math.abs(r-e))return Math.PI*Math.min(r,e)*Math.min(r,e);var i=r-(t*t-e*e+r*r)/(2*t),n=e-(t*t-r*r+e*e)/(2*t);return Uu(r,i)+Uu(e,n)}function Cx(r,e){var t=Ge(r,e),i=r.radius,n=e.radius;if(t>=i+n||t<=Math.abs(i-n))return[];var a=(i*i-n*n+t*t)/(2*t),o=Math.sqrt(i*i-a*a),s=r.x+a*(e.x-r.x)/t,l=r.y+a*(e.y-r.y)/t,u=-(e.y-r.y)*(o/t),c=-(e.x-r.x)*(o/t);return[{x:s+u,y:l-c},{x:s-u,y:l+c}]}function Mx(r){for(var e={x:0,y:0},t=0;t=o&&(a=t[i],o=s)}var l=wx(function(f){return-1*jl({x:f[0],y:f[1]},r,e)},[a.x,a.y],{maxIterations:500,minErrorDelta:1e-10}).x,u={x:l[0],y:l[1]},c=!0;for(i=0;ir[i].radius){c=!1;break}for(i=0;i0&&console.log("WARNING: area "+a+" not represented on screen")}return t}function iN(r,e,t){var i=[],n=r-t,a=e;return i.push("M",n,a),i.push("A",t,t,0,1,0,n+2*t,a),i.push("A",t,t,0,1,0,n,a),i.join(" ")}function nN(r){var e={};Dh(r,e);var t=e.arcs;if(t.length===0)return"M 0 0";if(t.length==1){var i=t[0].circle;return iN(i.x,i.y,i.radius)}else{for(var n=[` M`,t[0].p2.x,t[0].p2.y],a=0;as;n.push(` A`,s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return n.join(" ")}}function aN(r,e){e=e||{},e.maxIterations=e.maxIterations||500;var t=e.initialLayout||uN,i=e.lossFunction||Oh;r=oN(r);var n=t(r,e),a=[],o=[],s;for(s in n)n.hasOwnProperty(s)&&(a.push(n[s].x),a.push(n[s].y),o.push(s));for(var l=wx(function(h){for(var f={},v=0;vu?1:-1}),i=0;i=Math.min(e[o].size,e[s].size)?h=1:a.size<=1e-10&&(h=-1),n[o][s]=n[s][o]=h}),{distances:i,constraints:n}}function lN(r,e,t,i){var n=0,a;for(a=0;a0&&d<=h||f<0&&d>=h||(n+=2*p*p,e[2*a]+=4*p*(o-u),e[2*a+1]+=4*p*(s-c),e[2*l]+=4*p*(u-o),e[2*l+1]+=4*p*(c-s))}return n}function uN(r,e){var t=hN(r,e),i=e.lossFunction||Oh;if(r.length>=8){var n=cN(r,e),a=i(n,r),o=i(t,r);a+1e-8=Math.min(i[c].size,i[h].size)&&(u=0),n[c].push({set:h,size:l.size,weight:u}),n[h].push({set:c,size:l.size,weight:u})}var f=[];for(a in n)if(n.hasOwnProperty(a)){for(var v=0,o=0;o=y.length)){var z=Math.max(O-h,0),Y=O,q=Math.min(O+h,y.length-1),D=z-(O-h),N=O+h-q,W=b[-h-1+D]||0,$=b[-h-1+N]||0,V=S/(S-W-$);D>0&&(F+=V*(D-1)*M);var _=Math.max(0,O-h+1);a.inside(0,y.length-1,_)&&(y[_].y+=V*1*M),a.inside(0,y.length-1,Y+1)&&(y[Y+1].y-=V*2*M),a.inside(0,y.length-1,q+1)&&(y[q+1].y+=V*1*M)}});var T=F,L=0,k=0;return y.forEach(function(I){L+=I.y,T+=L,I.y=T,k+=T}),k>0&&y.forEach(function(I){I.y/=k}),y};function s(l,u){for(var c={},h=0,f=-u;f<=u;f++)h+=l(f/u),c[f]=h;return c}r.exports.getExpectedValueFromPdf=function(l){if(!(!l||l.length===0)){var u=0;return l.forEach(function(c){u+=c.x*c.y}),u}},r.exports.getXWithLeftTailArea=function(l,u){if(!(!l||l.length===0)){for(var c=0,h=0,f=0;f=u));f++);return l[h].x}},r.exports.getPerplexity=function(l){if(!(!l||l.length===0)){var u=0;return l.forEach(function(c){var h=Math.log(c.y);isFinite(h)&&(u+=c.y*h)}),u=-u/i,Math.pow(2,u)}}})(Ix);var DN=Ix.exports;const ON=Wx(DN);function Jd(r,e){var t=r.length*e;if(r.length===0)throw new Error("quantile requires at least one data point.");if(e<0||e>1)throw new Error("quantiles must be between 0 and 1");return e===1?r[r.length-1]:e===0?r[0]:t%1!==0?r[Math.ceil(t)-1]:r.length%2===0?(r[t-1]+r[t])/2:r[t]}function Pn(r,e,t){var i=r[e];r[e]=r[t],r[t]=i}function Po(r,e,t,i){for(t=t||0,i=i||r.length-1;i>t;){if(i-t>600){var n=i-t+1,a=e-t+1,o=Math.log(n),s=.5*Math.exp(2*o/3),l=.5*Math.sqrt(o*s*(n-s)/n);a-n/2<0&&(l*=-1);var u=Math.max(t,Math.floor(e-a*s/n+l)),c=Math.min(i,Math.floor(e+(n-a)*s/n+l));Po(r,e,u,c)}var h=r[e],f=t,v=i;for(Pn(r,t,e),r[i]>h&&Pn(r,t,i);fh;)v--}r[t]===h?Pn(r,t,v):(v++,Pn(r,v,i)),v<=e&&(t=v+1),e<=v&&(i=v-1)}}function Dn(r,e){var t=r.slice();if(Array.isArray(e)){BN(t,e);for(var i=[],n=0;n0?c:h},g=P({},r,{options:{xField:n,yField:ke,seriesField:n,rawFields:[a,sl,Zu,ke],widthRatio:l,interval:{style:u,shape:v||"waterfall",color:p}}}),y=Zt(g).ext,x=y.geometry;return x.customInfo(m(m({},d),{leaderLine:s})),r}function KN(r){var e,t,i=r.options,n=i.xAxis,a=i.yAxis,o=i.xField,s=i.yField,l=i.meta,u=P({},{alias:s},A(l,s));return J(Lt((e={},e[o]=n,e[s]=a,e[ke]=a,e),P({},l,(t={},t[ke]=u,t[sl]=u,t[Rh]=u,t))))(r)}function JN(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return i===!1?e.axis(a,!1):e.axis(a,i),n===!1?(e.axis(o,!1),e.axis(ke,!1)):(e.axis(o,n),e.axis(ke,n)),r}function t5(r){var e=r.chart,t=r.options,i=t.legend,n=t.total,a=t.risingFill,o=t.fallingFill,s=t.locale,l=Us(s);if(i===!1)e.legend(!1);else{var u=[{name:l.get(["general","increase"]),value:"increase",marker:{symbol:"square",style:{r:5,fill:a}}},{name:l.get(["general","decrease"]),value:"decrease",marker:{symbol:"square",style:{r:5,fill:o}}}];n&&u.push({name:n.label||"",value:"total",marker:{symbol:"square",style:P({},{r:5},A(n,"style"))}}),e.legend(P({},{custom:!0,position:"top",items:u},i)),e.removeInteraction("legend-filter")}return r}function e5(r){var e=r.chart,t=r.options,i=t.label,n=t.labelMode,a=t.xField,o=jt(e,"interval");if(!i)o.label(!1);else{var s=i.callback,l=yt(i,["callback"]);o.label({fields:n==="absolute"?[Rh,a]:[sl,a],callback:s,cfg:Yt(l)})}return r}function r5(r){var e=r.chart,t=r.options,i=t.tooltip,n=t.xField,a=t.yField;if(i!==!1){e.tooltip(m({showCrosshairs:!1,showMarkers:!1,shared:!0,fields:[a]},i));var o=e.geometries[0];i!=null&&i.formatter?o.tooltip("".concat(n,"*").concat(a),i.formatter):o.tooltip(a)}else e.tooltip(!1);return r}function i5(r){return J(ZN,ut,QN,KN,JN,t5,r5,e5,Jr,At,xt,Et())(r)}(function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="waterfall",t}return e.getDefaultOptions=function(){return _N},e.prototype.changeData=function(t){var i=this.options,n=i.xField,a=i.yField,o=i.total;this.updateOption({data:t}),this.chart.changeData(Rx(t,n,a,o))},e.prototype.getSchemaAdaptor=function(){return i5},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(nt);var zh="color",n5=P({},nt.getDefaultOptions(),{timeInterval:2e3,legend:!1,tooltip:{showTitle:!1,showMarkers:!1,showCrosshairs:!1,fields:["text","value",zh],formatter:function(r){return{name:r.text,value:r.value}}},wordStyle:{fontFamily:"Verdana",fontWeight:"normal",padding:1,fontSize:[12,60],rotation:[0,90],rotationSteps:2,rotateRatio:.5}}),a5={font:function(){return"serif"},padding:1,size:[500,500],spiral:"archimedean",timeInterval:3e3};function o5(r,e){return e=mt({},a5,e),s5(r,e)}function s5(r,e){var t=w5();["font","fontSize","fontWeight","padding","rotate","size","spiral","timeInterval","random"].forEach(function(l){B(e[l])||t[l](e[l])}),t.words(r),e.imageMask&&t.createMask(e.imageMask);var i=t.start(),n=i._tags;n.forEach(function(l){l.x+=e.size[0]/2,l.y+=e.size[1]/2});var a=e.size,o=a[0],s=a[1];return n.push({text:"",value:0,x:0,y:0,opacity:0}),n.push({text:"",value:0,x:o,y:s,opacity:0}),n}var Zl=Math.PI/180,Yn=64,Bo=2048;function l5(r){return r.text}function u5(){return"serif"}function rp(){return"normal"}function c5(r){return r.value}function h5(){return~~(Math.random()*2)*90}function f5(){return 1}function v5(r,e,t,i){if(!e.sprite){var n=r.context,a=r.ratio;n.clearRect(0,0,(Yn<<5)/a,Bo/a);var o=0,s=0,l=0,u=t.length;for(--i;++i>5<<5,h=~~Math.max(Math.abs(p+g),Math.abs(p-g))}else c=c+31>>5<<5;if(h>l&&(l=h),o+c>=Yn<<5&&(o=0,s+=l,l=0),s+h>=Bo)break;n.translate((o+(c>>1))/a,(s+(h>>1))/a),e.rotate&&n.rotate(e.rotate*Zl),n.fillText(e.text,0,0),e.padding&&(n.lineWidth=2*e.padding,n.strokeText(e.text,0,0)),n.restore(),e.width=c,e.height=h,e.xoff=o,e.yoff=s,e.x1=c>>1,e.y1=h>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,o+=c}for(var x=n.getImageData(0,0,(Yn<<5)/a,Bo/a).data,w=[];--i>=0;)if(e=t[i],!!e.hasText){for(var c=e.width,b=c>>5,h=e.y1-e.y0,S=0;S>5),k=x[(s+T)*(Yn<<5)+(o+S)<<2]?1<<31-S%32:0;w[L]|=k,M|=k}M?F=T:(e.y0++,h--,T--,s++)}e.y1=e.y0+F,e.sprite=w.slice(0,(e.y1-e.y0)*b)}}}function d5(r,e,t){t>>=5;for(var i=r.sprite,n=r.width>>5,a=r.x-(n<<4),o=a&127,s=32-o,l=r.y1-r.y0,u=(r.y+r.y0)*t+(a>>5),c,h=0;h>>o:0))&e[u+f])return!0;u+=t}return!1}function p5(r,e){var t=r[0],i=r[1];e.x+e.x0i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function g5(r,e){return r.x+r.x1>e[0].x&&r.x+r.x0e[0].y&&r.y+r.y0>5)*r[1]),b=l.length,S=[],M=l.map(function(k,I,O){return k.text=c.call(this,k,I,O),k.font=e.call(this,k,I,O),k.style=h.call(this,k,I,O),k.weight=i.call(this,k,I,O),k.rotate=n.call(this,k,I,O),k.size=~~t.call(this,k,I,O),k.padding=a.call(this,k,I,O),k}).sort(function(k,I){return I.size-k.size}),F=-1,T=v.board?[{x:0,y:0},{x:g,y}]:null;L();function L(){for(var k=Date.now();Date.now()-k>1,I.y=y*(s()+.5)>>1,v5(x,I,M,F),I.hasText&&p(w,I,T)&&(S.push(I),T?v.hasImage||p5(T,I):T=[{x:I.x+I.x0,y:I.y+I.y0},{x:I.x+I.x1,y:I.y+I.y1}],I.x-=r[0]>>1,I.y-=r[1]>>1)}v._tags=S,v._bounds=T}return v};function d(g){g.width=g.height=1;var y=Math.sqrt(g.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,1,1).data.length>>2);g.width=(Yn<<5)/y,g.height=Bo/y;var x=g.getContext("2d",{willReadFrequently:!0});return x.fillStyle=x.strokeStyle="red",x.textAlign="center",{context:x,ratio:y}}function p(g,y,x){for(var w=y.x,b=y.y,S=Math.sqrt(r[0]*r[0]+r[1]*r[1]),M=o(r),F=s()<.5?1:-1,T,L=-F,k,I;(T=M(L+=F))&&(k=~~T[0],I=~~T[1],!(Math.min(Math.abs(k),Math.abs(I))>=S));)if(y.x=w+k,y.y=b+I,!(y.x+y.x0<0||y.y+y.y0<0||y.x+y.x1>r[0]||y.y+y.y1>r[1])&&(!x||!d5(y,g,r[0]))&&(!x||g5(y,x))){for(var O=y.sprite,z=y.width>>5,Y=r[0]>>5,q=y.x-(z<<4),D=q&127,N=32-D,W=y.y1-y.y0,$=void 0,V=(y.y+y.y0)*Y+(q>>5),_=0;_>>D:0);V+=Y}return delete y.sprite,!0}return!1}return v.createMask=function(g){var y=document.createElement("canvas"),x=r[0],w=r[1];if(!(!x||!w)){var b=x>>5,S=ip((x>>5)*w);y.width=x,y.height=w;var M=y.getContext("2d");M.drawImage(g,0,0,g.width,g.height,0,0,x,w);for(var F=M.getImageData(0,0,x,w).data,T=0;T>5),I=T*x+L<<2,O=F[I]>=250&&F[I+1]>=250&&F[I+2]>=250,z=O?1<<31-L%32:0;S[k]|=z}v.board=S,v.hasImage=!0}},v.timeInterval=function(g){u=g??1/0},v.words=function(g){l=g},v.size=function(g){r=[+g[0],+g[1]]},v.font=function(g){e=qe(g)},v.fontWeight=function(g){i=qe(g)},v.rotate=function(g){n=qe(g)},v.spiral=function(g){o=x5[g]||g},v.fontSize=function(g){t=qe(g)},v.padding=function(g){a=qe(g)},v.random=function(g){s=qe(g)},v}function Nx(r){var e=r.options,t=r.chart,i=t,n=i.width,a=i.height,o=i.padding,s=i.appendPadding,l=i.ele,u=e.data,c=e.imageMask,h=e.wordField,f=e.weightField,v=e.colorField,d=e.wordStyle,p=e.timeInterval,g=e.random,y=e.spiral,x=e.autoFit,w=x===void 0?!0:x,b=e.placementStrategy;if(!u||!u.length)return[];var S=d.fontFamily,M=d.fontWeight,F=d.padding,T=d.fontSize,L=A5(u,f),k=[E5(L),k5(L)],I=u.map(function(Y){return{text:Y[h],value:Y[f],color:Y[v],datum:Y}}),O={imageMask:c,font:S,fontSize:M5(T,k),fontWeight:M,size:b5({width:n,height:a,padding:o,appendPadding:s,autoFit:w,container:l}),padding:F,timeInterval:p,random:g,spiral:y,rotate:F5(e)};if(X(b)){var z=I.map(function(Y,q,D){return m(m(m({},Y),{hasText:!!Y.text,font:qe(O.font)(Y,q,D),weight:qe(O.fontWeight)(Y,q,D),rotate:qe(O.rotate)(Y,q,D),size:qe(O.fontSize)(Y,q,D),style:"normal"}),b.call(t,Y,q,D))});return z.push({text:"",value:0,x:0,y:0,opacity:0}),z.push({text:"",value:0,x:O.size[0],y:O.size[1],opacity:0}),z}return o5(I,O)}function b5(r){var e=r.width,t=r.height,i=r.container,n=r.autoFit,a=r.padding,o=r.appendPadding;if(n){var s=Ru(i);e=s.width,t=s.height}e=e||400,t=t||400;var l=S5({padding:a,appendPadding:o}),u=l[0],c=l[1],h=l[2],f=l[3],v=[e-(f+c),t-(u+h)];return v}function S5(r){var e=Wr(r.padding),t=Wr(r.appendPadding),i=e[0]+t[0],n=e[1]+t[1],a=e[2]+t[2],o=e[3]+t[3];return[i,n,a,o]}function C5(r){return new Promise(function(e,t){if(r instanceof HTMLImageElement){e(r);return}if(Q(r)){var i=new Image;i.crossOrigin="anonymous",i.src=r,i.onload=function(){e(i)},i.onerror=function(){br($e.ERROR,!1,"image %s load failed !!!",r),t()};return}br($e.WARN,r===void 0,"The type of imageMask option must be String or HTMLImageElement."),t()})}function M5(r,e){if(X(r))return r;if(R(r)){var t=r[0],i=r[1];if(!e)return function(){return(i+t)/2};var n=e[0],a=e[1];return a===n?function(){return(i+t)/2}:function(s){var l=s.value;return(i-t)/(a-n)*(l-n)+t}}return function(){return r}}function A5(r,e){return r.map(function(t){return t[e]}).filter(function(t){return typeof t=="number"&&!isNaN(t)})}function F5(r){var e=T5(r),t=e.rotation,i=e.rotationSteps;if(!R(t))return t;var n=t[0],a=t[1],o=i===1?0:(a-n)/(i-1);return function(){return a===n?a:Math.floor(Math.random()*i)*o}}function T5(r){var e=r.wordStyle.rotationSteps;return e<1&&(br($e.WARN,!1,"The rotationSteps option must be greater than or equal to 1."),e=1),{rotation:r.wordStyle.rotation,rotationSteps:e}}function E5(r){return Math.min.apply(Math,r)}function k5(r){return Math.max.apply(Math,r)}function L5(r){var e=r.chart,t=r.options,i=t.colorField,n=t.color,a=Nx(r);e.data(a);var o=P({},r,{options:{xField:"x",yField:"y",seriesField:i&&zh,rawFields:X(n)&&Z(Z([],A(t,"rawFields",[]),!0),["datum"],!1),point:{color:n,shape:"word-cloud"}}}),s=Me(o).ext;return s.geometry.label(!1),e.coordinate().reflect("y"),e.axis(!1),r}function I5(r){return J(Lt({x:{nice:!1},y:{nice:!1}}))(r)}function P5(r){var e=r.chart,t=r.options,i=t.legend,n=t.colorField;return i===!1?e.legend(!1):n&&e.legend(zh,i),r}function D5(r){J(L5,I5,Nt,P5,At,xt,ut,Jr)(r)}ft("point","word-cloud",{draw:function(r,e){var t=r.x,i=r.y,n=e.addShape("text",{attrs:m(m({},O5(r)),{x:t,y:i})}),a=r.data.rotate;return typeof a=="number"&&ve.rotate(n,a*Math.PI/180),n}});function O5(r){return{fontSize:r.data.size,text:r.data.text,textAlign:"center",fontFamily:r.data.font,fontWeight:r.data.weight,fill:r.color||r.defaultStyle.stroke,textBaseline:"alphabetic"}}var V5=function(r){E(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="word-cloud",t}return e.getDefaultOptions=function(){return n5},e.prototype.changeData=function(t){this.updateOption({data:t}),this.options.imageMask?this.render():this.chart.changeData(Nx({chart:this.chart,options:this.options}))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.render=function(){var t=this;return new Promise(function(i){var n=t.options.imageMask;if(!n){r.prototype.render.call(t),i();return}var a=function(o){t.options=m(m({},t.options),{imageMask:o||null}),r.prototype.render.call(t),i()};C5(n).then(a).catch(a)})},e.prototype.getSchemaAdaptor=function(){return D5},e.prototype.triggerResize=function(){var t=this;this.chart.destroyed||(this.execAdaptor(),window.setTimeout(function(){r.prototype.triggerResize.call(t)}))},e}(nt);(function(r){E(e,r);function e(t,i,n,a){var o=r.call(this,t,P({},a,i))||this;return o.type="g2-plot",o.defaultOptions=a,o.adaptor=n,o}return e.prototype.getDefaultOptions=function(){return this.defaultOptions},e.prototype.getSchemaAdaptor=function(){return this.adaptor},e})(nt);Ym("en-US",oL);Ym("zh-CN",sL);export{hI as C,HI as G,JI as L,pP as P,mP as R,oD as T,V5 as W,cD as a,fP as b,N5 as c,G5 as d};