index-8a863595.js 820 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import{aq as g,i as O,p as S,m as ft,T as pt,ao as xi,e as W,a8 as Mr,b as tt,an as Gr,av as kt,f as Lt,a as K,Q as D,a5 as Pe,a1 as Se,aw as Mx,ax as Zd,ay as Ax,a7 as jo,am as Zo,S as zt,F as be,ap as De,k as he,z as ve,E as Fx,A as M,g as Tx,$ as xt,a0 as Ex,a4 as ga,O as oe,M as Qd,Z as It,I as fe,C as Kd,r as Xt,y as Qs,ag as Bt,J as Jd,az as Hn,aA as kx,aB as vn,aC as tg,aD as Lx,aE as Ix,aF as zu,aG as Ii,aH as Px,H as Ir,n as Y,aa as Vu,o as Dx,Y as pa,B as Bx,N as eg,aI as jt,aj as rg,h as mt,aJ as Rt,aK as Nt,aL as ii,aM as Yi,aN as Ye,x as Ox,aO as Ch,L as $i,q as Gu,_ as en,l as ig,ak as Yu,V as Ln,s as Le,v as $u,c as Ei,ah as Qo,af as Et,ad as Rx,ac as Zt,X as Qr,G as Nx,R as zx,j as Vx,ae as Gx,al as Yx,u as hi,t as ng,d as $x,a9 as Ko,P as Hx,a2 as ag,ai as Xx,w as og,a6 as Wx}from"./ext-b20af233.js";import{k as qx}from"./index-3887ab05.js";const Jo=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Re},get Circle(){return wA},get Ellipse(){return bA},get Image(){return CA},get Line(){return AA},get Marker(){return NA},get Path(){return Ec},get Polygon(){return qA},get Polyline(){return jA},get Rect(){return JA},get Text(){return eF}},Symbol.toStringTag,{value:"Module"})),ts=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Ae},get Circle(){return cF},get Dom(){return fF},get Ellipse(){return dF},get Image(){return pF},get Line(){return mF},get Marker(){return wF},get Path(){return bF},get Polygon(){return CF},get Polyline(){return AF},get Rect(){return EF},get Text(){return DF}},Symbol.toStringTag,{value:"Module"}));var At;(function(r){r.FORE="fore",r.MID="mid",r.BG="bg"})(At||(At={}));var N;(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"})(N||(N={}));var Dt;(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"})(Dt||(Dt={}));var Oi={FORE:3,MID:2,BG:1},it;(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"})(it||(it={}));var Tr;(function(r){r.BEFORE_DRAW_ANIMATE="beforeanimate",r.AFTER_DRAW_ANIMATE="afteranimate",r.BEFORE_RENDER_LABEL="beforerenderlabel",r.AFTER_RENDER_LABEL="afterrenderlabel"})(Tr||(Tr={}));var Jt;(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"})(Jt||(Jt={}));var Co;(function(r){r.ACTIVE="active",r.INACTIVE="inactive",r.SELECTED="selected",r.DEFAULT="default"})(Co||(Co={}));var Pi=["color","shape","size"],gt="_origin",Mh=1,Ah=1,Fh=.25,sg={};function Ux(r){var e=sg[r];if(!e)throw new Error("G engine '".concat(r,"' is not exist, please register it at first."));return e}function lg(r,e){sg[r]=e}function Mi(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 Sn,Ks,ug,Nl;function jx(){Sn=document.createElement("table"),Ks=document.createElement("tr"),ug=/^\s*<(\w+|!)[^>]*>/,Nl={tr:document.createElement("tbody"),tbody:Sn,thead:Sn,tfoot:Sn,td:Ks,th:Ks,"*":document.createElement("div")}}function Er(r){Sn||jx();var e=ug.test(r)&&RegExp.$1;(!e||!(e in Nl))&&(e="*");var t=Nl[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 ie(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 Zx(r,e){var t=ie(r,"height",e);return t==="auto"&&(t=r.offsetHeight),parseFloat(t)}function Qx(r,e){var t=Zx(r,e),i=parseFloat(ie(r,"borderTopWidth"))||0,n=parseFloat(ie(r,"paddingTop"))||0,a=parseFloat(ie(r,"paddingBottom"))||0,o=parseFloat(ie(r,"borderBottomWidth"))||0,s=parseFloat(ie(r,"marginTop"))||0,l=parseFloat(ie(r,"marginBottom"))||0;return t+i+o+n+a+s+l}function Kx(r,e){var t=ie(r,"width",e);return t==="auto"&&(t=r.offsetWidth),parseFloat(t)}function Jx(r,e){var t=Kx(r,e),i=parseFloat(ie(r,"borderLeftWidth"))||0,n=parseFloat(ie(r,"paddingLeft"))||0,a=parseFloat(ie(r,"paddingRight"))||0,o=parseFloat(ie(r,"borderRightWidth"))||0,s=parseFloat(ie(r,"marginRight"))||0,l=parseFloat(ie(r,"marginLeft"))||0;return t+i+o+n+a+l+s}function qt(r,e){if(r)for(var t in e)e.hasOwnProperty(t)&&(r.style[t]=e[t]);return r}function tw(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 Th(r){return typeof r=="number"&&!isNaN(r)}function Eh(r,e,t,i){var n=t,a=i;if(e){var o=tw(r);n=o.width?o.width:n,a=o.height?o.height:a}return{width:Math.max(Th(n)?n:Mh,Mh),height:Math.max(Th(a)?a:Ah,Ah)}}function ew(r){var e=r.parentNode;e&&e.removeChild(r)}var rw="*",Hu=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;n<arguments.length;n++)i[n-1]=arguments[n];var a=this._events[e]||[],o=this._events[rw]||[],s=function(l){for(var u=l.length,c=0;c<u;c++)if(l[c]){var h=l[c],f=h.callback,v=h.once;v&&(l.splice(c,1),l.length===0&&delete t._events[e],u--,c--),f.apply(t,i)}};s(a),s(o)},r.prototype.off=function(e,t){if(!e)this._events={};else if(!t)delete this._events[e];else{for(var i=this._events[e]||[],n=i.length,a=0;a<n;a++)i[a].callback===t&&(i.splice(a,1),n--,a--);i.length===0&&delete this._events[e]}return this},r.prototype.getEvents=function(){return this._events},r}(),Xu=function(r){g.__extends(e,r);function e(t){var i=r.call(this)||this;i.destroyed=!1;var n=t.visible,a=n===void 0?!0:n;return i.visible=a,i}return e.prototype.show=function(){var t=this.visible;t||this.changeVisible(!0)},e.prototype.hide=function(){var t=this.visible;t&&this.changeVisible(!1)},e.prototype.destroy=function(){this.off(),this.destroyed=!0},e.prototype.changeVisible=function(t){this.visible!==t&&(this.visible=t)},e}(Hu),In=`
  2. \v\f\r   ᠎              \u2028\u2029`,iw=new RegExp("([a-z])["+In+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+In+"]*,?["+In+"]*)+)","ig"),nw=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+In+"]*,?["+In+"]*","ig"),Di=function(r){if(!r)return null;if(O(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(iw,function(i,n,a){var o=[],s=n.toLowerCase();if(a.replace(nw,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 r}),t},zl=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},Ia=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},Vl=function(r){if(r=Di(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;f<v;f++){if(e.push(c=[]),h=r[f],s=h[0],s!==s.toUpperCase())switch(c[0]=s.toUpperCase(),c[0]){case"A":c[1]=h[1],c[2]=h[2],c[3]=h[3],c[4]=h[4],c[5]=h[5],c[6]=+h[6]+t,c[7]=+h[7]+i;break;case"V":c[1]=+h[1]+i;break;case"H":c[1]=+h[1]+t;break;case"R":l=[t,i].concat(h.slice(1));for(var d=2,p=l.length;d<p;d++)l[d]=+l[d]+t,l[++d]=+l[d]+i;e.pop(),e=e.concat(zl(l,u));break;case"O":e.pop(),l=Ia(t,i,h[1],h[2]),l.push(l[0]),e=e.concat(l);break;case"U":e.pop(),e=e.concat(Ia(t,i,h[1],h[2],h[3])),c=["U"].concat(e[e.length-1].slice(-2));break;case"M":n=+h[1]+t,a=+h[2]+i;break;default:for(var d=1,p=h.length;d<p;d++)c[d]=+h[d]+(d%2?t:i)}else if(s==="R")l=[t,i].concat(h.slice(1)),e.pop(),e=e.concat(zl(l,u)),c=["R"].concat(h.slice(-2));else if(s==="O")e.pop(),l=Ia(t,i,h[1],h[2]),l.push(l[0]),e=e.concat(l);else if(s==="U")e.pop(),e=e.concat(Ia(t,i,h[1],h[2],h[3])),c=["U"].concat(e[e.length-1].slice(-2));else for(var y=0,m=h.length;y<m;y++)c[y]=h[y];if(s=s.toUpperCase(),s!=="O")switch(c[0]){case"Z":t=+n,i=+a;break;case"H":t=c[1];break;case"V":i=c[1];break;case"M":n=c[c.length-2],a=c[c.length-1];break;default:t=c[c.length-2],i=c[c.length-1]}}return e},Pa=function(r,e,t,i){return[r,e,t,i,t,i]},kh=function(r,e,t,i,n,a){var o=.3333333333333333,s=2/3;return[o*r+s*t,o*e+s*i,o*n+s*t,o*a+s*i,n,a]},cg=function(r,e,t,i,n,a,o,s,l,u){t===i&&(t+=1);var c=Math.PI*120/180,h=Math.PI/180*(+n||0),f=[],v,d,p,y,m,x=function(_t,Ct,Yt){var Qe=_t*Math.cos(Yt)-Ct*Math.sin(Yt),Ke=_t*Math.sin(Yt)+Ct*Math.cos(Yt);return{x:Qe,y:Ke}};if(u)d=u[0],p=u[1],y=u[2],m=u[3];else{v=x(r,e,-h),r=v.x,e=v.y,v=x(s,l,-h),s=v.x,l=v.y,r===s&&e===l&&(s+=1,l+=1);var _=(r-s)/2,w=(e-l)/2,b=_*_/(t*t)+w*w/(i*i);b>1&&(b=Math.sqrt(b),t=b*t,i=b*i);var C=t*t,A=i*i,F=(a===o?-1:1)*Math.sqrt(Math.abs((C*A-C*w*w-A*_*_)/(C*w*w+A*_*_)));y=F*t*w/i+(r+s)/2,m=F*-i*_/t+(e+l)/2,d=Math.asin(((e-m)/i).toFixed(9)),p=Math.asin(((l-m)/i).toFixed(9)),d=r<y?Math.PI-d:d,p=s<y?Math.PI-p:p,d<0&&(d=Math.PI*2+d),p<0&&(p=Math.PI*2+p),o&&d>p&&(d=d-Math.PI*2),!o&&p>d&&(p=p-Math.PI*2)}var E=p-d;if(Math.abs(E)>c){var T=p,k=s,P=l;p=d+c*(o&&p>d?1:-1),s=y+t*Math.cos(p),l=m+i*Math.sin(p),f=cg(s,l,t,i,n,0,o,k,P,[p,T,y,m])}E=p-d;var B=Math.cos(d),z=Math.sin(d),X=Math.cos(p),I=Math.sin(p),R=Math.tan(E/4),$=4/3*t*R,G=4/3*i*R,V=[r,e],H=[r+$*z,e-G*B],Z=[s+$*I,l-G*X],rt=[s,l];if(H[0]=2*V[0]-H[0],H[1]=2*V[1]-H[1],u)return[H,Z,rt].concat(f);f=[H,Z,rt].concat(f).join().split(",");for(var U=[],Q=0,ht=f.length;Q<ht;Q++)U[Q]=Q%2?x(f[Q-1],f[Q],h).y:x(f[Q],f[Q+1],h).x;return U},Gl=function(r,e){var t=Vl(r),i=e&&Vl(e),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=[],s=[],l="",u="",c,h=function(_,w,b){var C,A;if(!_)return["C",w.x,w.y,w.x,w.y,w.x,w.y];switch(!(_[0]in{T:1,Q:1})&&(w.qx=w.qy=null),_[0]){case"M":w.X=_[1],w.Y=_[2];break;case"A":_=["C"].concat(cg.apply(0,[w.x,w.y].concat(_.slice(1))));break;case"S":b==="C"||b==="S"?(C=w.x*2-w.bx,A=w.y*2-w.by):(C=w.x,A=w.y),_=["C",C,A].concat(_.slice(1));break;case"T":b==="Q"||b==="T"?(w.qx=w.x*2-w.qx,w.qy=w.y*2-w.qy):(w.qx=w.x,w.qy=w.y),_=["C"].concat(kh(w.x,w.y,w.qx,w.qy,_[1],_[2]));break;case"Q":w.qx=_[1],w.qy=_[2],_=["C"].concat(kh(w.x,w.y,_[1],_[2],_[3],_[4]));break;case"L":_=["C"].concat(Pa(w.x,w.y,_[1],_[2]));break;case"H":_=["C"].concat(Pa(w.x,w.y,_[1],w.y));break;case"V":_=["C"].concat(Pa(w.x,w.y,w.x,_[1]));break;case"Z":_=["C"].concat(Pa(w.x,w.y,w.X,w.Y));break}return _},f=function(_,w){if(_[w].length>7){_[w].shift();for(var b=_[w];b.length;)o[w]="A",i&&(s[w]="A"),_.splice(w++,0,["C"].concat(b.splice(0,6)));_.splice(w,1),c=Math.max(t.length,i&&i.length||0)}},v=function(_,w,b,C,A){_&&w&&_[A][0]==="M"&&w[A][0]!=="M"&&(w.splice(A,0,["M",C.x,C.y]),b.bx=0,b.by=0,b.x=_[A][1],b.y=_[A][2],c=Math.max(t.length,i&&i.length||0))};c=Math.max(t.length,i&&i.length||0);for(var d=0;d<c;d++){t[d]&&(l=t[d][0]),l!=="C"&&(o[d]=l,d&&(u=o[d-1])),t[d]=h(t[d],n,u),o[d]!=="A"&&l==="C"&&(o[d]="C"),f(t,d),i&&(i[d]&&(l=i[d][0]),l!=="C"&&(s[d]=l,d&&(u=s[d-1])),i[d]=h(i[d],a,u),s[d]!=="A"&&l==="C"&&(s[d]="C"),f(i,d)),v(t,i,n,a,d),v(i,t,a,n,d);var p=t[d],y=i&&i[d],m=p.length,x=i&&y.length;n.x=p[m-2],n.y=p[m-1],n.bx=parseFloat(p[m-4])||n.x,n.by=parseFloat(p[m-3])||n.y,a.bx=i&&(parseFloat(y[x-4])||a.x),a.by=i&&(parseFloat(y[x-3])||a.y),a.x=i&&y[x-2],a.y=i&&y[x-1]}return i?[t,i]:t},aw=/,?([a-z]),?/gi,hg=function(r){return r.join(",").replace(aw,"$1")},Lh=function(r,e,t,i,n){var a=-3*e+9*t-9*i+3*n,o=r*a+6*e-12*t+6*i;return r*o-3*e+3*t},Ih=function(r,e,t,i,n,a,o,s,l){l===null&&(l=1),l=l>1?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;d<c;d++){var p=u*h[d]+u,y=Lh(p,r,t,n,o),m=Lh(p,e,i,a,s),x=y*y+m*m;v+=f[d]*Math.sqrt(x)}return u*v},ow=function(r,e,t,i,n,a,o,s){for(var l=[],u=[[],[]],c,h,f,v,d=0;d<2;++d){if(d===0?(h=6*r-12*t+6*n,c=-3*r+9*t-9*n+3*o,f=3*t-3*r):(h=6*e-12*i+6*a,c=-3*e+9*i-9*a+3*s,f=3*i-3*e),Math.abs(c)<1e-12){if(Math.abs(h)<1e-12)continue;v=-f/h,v>0&&v<1&&l.push(v);continue}var p=h*h-4*f*c,y=Math.sqrt(p);if(!(p<0)){var m=(-h+y)/(2*c);m>0&&m<1&&l.push(m);var x=(-h-y)/(2*c);x>0&&x<1&&l.push(x)}}for(var _=l.length,w=_,b;_--;)v=l[_],b=1-v,u[0][_]=b*b*b*r+3*b*b*v*t+3*b*v*v*n+v*v*v*o,u[1][_]=b*b*b*e+3*b*b*v*i+3*b*v*v*a+v*v*v*s;return u[0][w]=r,u[1][w]=e,u[0][w+1]=o,u[1][w+1]=s,u[0].length=u[1].length=w+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])}}},sw=function(r,e,t,i,n,a,o,s){if(!(Math.max(r,t)<Math.min(n,o)||Math.min(r,t)>Math.max(n,o)||Math.max(e,i)<Math.min(a,s)||Math.min(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}}}},pr=function(r,e,t){return e>=r.x&&e<=r.x+r.width&&t>=r.y&&t<=r.y+r.height},fg=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=hg,a},Yl=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:fg(r,e,t,i),vb:[r,e,t,i].join(" ")}},lw=function(r,e){return r=Yl(r),e=Yl(e),pr(e,r.x,r.y)||pr(e,r.x2,r.y)||pr(e,r.x,r.y2)||pr(e,r.x2,r.y2)||pr(r,e.x,e.y)||pr(r,e.x2,e.y)||pr(r,e.x,e.y2)||pr(r,e.x2,e.y2)||(r.x<e.x2&&r.x>e.x||e.x<r.x2&&e.x>r.x)&&(r.y<e.y2&&r.y>e.y||e.y<r.y2&&e.y>r.y)},Ph=function(r,e,t,i,n,a,o,s){O(r)||(r=[r,e,t,i,n,a,o,s]);var l=ow.apply(null,r);return Yl(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},Dh=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,y=r+2*l*(t-r)+f*(n-2*t+r),m=e+2*l*(i-e)+f*(a-2*i+e),x=t+2*l*(n-t)+f*(o-2*n+t),_=i+2*l*(a-i)+f*(s-2*a+i),w=u*r+l*t,b=u*e+l*i,C=u*n+l*o,A=u*a+l*s,F=90-Math.atan2(y-x,m-_)*180/Math.PI;return{x:d,y:p,m:{x:y,y:m},n:{x,y:_},start:{x:w,y:b},end:{x:C,y:A},alpha:F}},uw=function(r,e,t){var i=Ph(r),n=Ph(e);if(!lw(i,n))return t?0:[];for(var a=Ih.apply(0,r),o=Ih.apply(0,e),s=~~(a/8),l=~~(o/8),u=[],c=[],h={},f=t?0:[],v=0;v<s+1;v++){var d=Dh.apply(0,r.concat(v/s));u.push({x:d.x,y:d.y,t:v/s})}for(var v=0;v<l+1;v++){var d=Dh.apply(0,e.concat(v/l));c.push({x:d.x,y:d.y,t:v/l})}for(var v=0;v<s;v++)for(var p=0;p<l;p++){var y=u[v],m=u[v+1],x=c[p],_=c[p+1],w=Math.abs(m.x-y.x)<.001?"y":"x",b=Math.abs(_.x-x.x)<.001?"y":"x",C=sw(y.x,y.y,m.x,m.y,x.x,x.y,_.x,_.y);if(C){if(h[C.x.toFixed(4)]===C.y.toFixed(4))continue;h[C.x.toFixed(4)]=C.y.toFixed(4);var A=y.t+Math.abs((C[w]-y[w])/(m[w]-y[w]))*(m.t-y.t),F=x.t+Math.abs((C[b]-x[b])/(_[b]-x[b]))*(_.t-x.t);A>=0&&A<=1&&F>=0&&F<=1&&(t?f+=1:f.push({x:C.x,y:C.y,t1:A,t2:F}))}}return f},cw=function(r,e,t){r=Gl(r),e=Gl(e);for(var i,n,a,o,s,l,u,c,h,f,v=t?0:[],d=0,p=r.length;d<p;d++){var y=r[d];if(y[0]==="M")i=s=y[1],n=l=y[2];else{y[0]==="C"?(h=[i,n].concat(y.slice(1)),i=h[6],n=h[7]):(h=[i,n,i,n,s,l,s,l],i=s,n=l);for(var m=0,x=e.length;m<x;m++){var _=e[m];if(_[0]==="M")a=u=_[1],o=c=_[2];else{_[0]==="C"?(f=[a,o].concat(_.slice(1)),a=f[6],o=f[7]):(f=[a,o,a,o,u,c,u,c],a=u,o=c);var w=uw(h,f,t);if(t)v+=w;else{for(var b=0,C=w.length;b<C;b++)w[b].segment1=d,w[b].segment2=m,w[b].bez1=h,w[b].bez2=f;v=v.concat(w)}}}}}return v},hw=function(r,e){return cw(r,e)};function fw(r,e){var t=[],i=[];function n(a,o){if(a.length===1)t.push(a[0]),i.push(a[0]);else{for(var s=[],l=0;l<a.length-1;l++)l===0&&t.push(a[0]),l===a.length-2&&i.push(a[l+1]),s[l]=[(1-o)*a[l][0]+o*a[l+1][0],(1-o)*a[l][1]+o*a[l+1][1]];n(s,o)}}return r.length&&n(r,e),{left:t,right:i.reverse()}}function vw(r,e,t){var i=[[r[1],r[2]]];t=t||2;var n=[];e[0]==="A"?(i.push(e[6]),i.push(e[7])):e[0]==="C"?(i.push([e[1],e[2]]),i.push([e[3],e[4]]),i.push([e[5],e[6]])):e[0]==="S"||e[0]==="Q"?(i.push([e[1],e[2]]),i.push([e[3],e[4]])):i.push([e[1],e[2]]);for(var a=i,o=1/t,s=0;s<t-1;s++){var l=o/(1-o*s),u=fw(a,l);n.push(u.left),a=u.right}n.push(a);var c=n.map(function(h){var f=[];return h.length===4&&(f.push("C"),f=f.concat(h[2])),h.length>=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 dw=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(vw(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},gw=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<i-t;o++)r.push(r[0]);return r}for(var o=0;o<i;o++){var s=Math.floor(n*o);a[s]=(a[s]||0)+1}var l=a.reduce(function(u,c,h){return h===t?u.concat(r[t]):u.concat(dw(r[h],r[h+1],c))},[]);return l.unshift(r[0]),(e[i]==="Z"||e[i]==="z")&&l.push("Z"),l},pw=function(r,e){if(r.length!==e.length)return!1;var t=!0;return S(r,function(i,n){if(i!==e[n])return t=!1,!1}),t};function yw(r,e,t){var i=null,n=t;return e<n&&(n=e,i="add"),r<n&&(n=r,i="del"),{type:i,min:n}}var mw=function(r,e){var t=r.length,i=e.length,n,a,o=0;if(t===0||i===0)return null;for(var s=[],l=0;l<=t;l++)s[l]=[],s[l][0]={min:l};for(var u=0;u<=i;u++)s[0][u]={min:u};for(var l=1;l<=t;l++){n=r[l-1];for(var u=1;u<=i;u++){a=e[u-1],pw(n,a)?o=0:o=1;var c=s[l-1][u].min+1,h=s[l][u-1].min+1,f=s[l-1][u-1].min+o;s[l][u]=yw(c,h,f)}}return s},vg=function(r,e){var t=mw(r,e),i=r.length,n=e.length,a=[],o=1,s=1;if(t[i][n].min!==i){for(var l=1;l<=i;l++){var u=t[l][l].min;s=l;for(var c=o;c<=n;c++)t[l][c].min<u&&(u=t[l][c].min,s=c);o=s,t[l][o].type&&a.push({index:l-1,type:t[l][o].type})}for(var l=a.length-1;l>=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(i<n)for(var l=0;l<h;l++)r[i-1][0]==="z"||r[i-1][0]==="Z"?r.splice(i-2,0,r[i-2]):r.push(r[i-1]),i+=1;return r};function Js(r,e,t){for(var i=[].concat(r),n,a=1/(t+1),o=dg(e)[0],s=1;s<=t;s++)a*=s,n=Math.floor(r.length*a),n===0?i.unshift([o[0]*a+r[n][0]*(1-a),o[1]*a+r[n][1]*(1-a)]):i.splice(n,0,[o[0]*a+r[n][0]*(1-a),o[1]*a+r[n][1]*(1-a)]);return i}function dg(r){var e=[];switch(r[0]){case"M":e.push([r[1],r[2]]);break;case"L":e.push([r[1],r[2]]);break;case"A":e.push([r[6],r[7]]);break;case"Q":e.push([r[3],r[4]]),e.push([r[1],r[2]]);break;case"T":e.push([r[1],r[2]]);break;case"C":e.push([r[5],r[6]]),e.push([r[1],r[2]]),e.push([r[3],r[4]]);break;case"S":e.push([r[3],r[4]]),e.push([r[1],r[2]]);break;case"H":e.push([r[1],r[1]]);break;case"V":e.push([r[1],r[1]]);break}return e}var $l=function(r,e){if(r.length<=1)return r;for(var t,i=0;i<e.length;i++)if(r[i][0]!==e[i][0])switch(t=dg(r[i]),e[i][0]){case"M":r[i]=["M"].concat(t[0]);break;case"L":r[i]=["L"].concat(t[0]);break;case"A":r[i]=[].concat(e[i]),r[i][6]=t[0][0],r[i][7]=t[0][1];break;case"Q":if(t.length<2)if(i>0)t=Js(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=Js(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=Js(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 Wu=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:zl,fillPath:gw,fillPathByDiff:vg,formatPath:$l,intersection:hw,parsePathArray:hg,parsePathString:Di,pathToAbsolute:Vl,pathToCurve:Gl,rectPath:fg},Symbol.toStringTag,{value:"Module"}));var ya=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 gg(r,e){var t=r.indexOf(e);t!==-1&&r.splice(t,1)}var Bh=typeof window<"u"&&typeof window.document<"u";function pg(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 Xn(r){return r.cfg.visible&&r.cfg.capture}var es=function(r){g.__extends(e,r);function e(t){var i=r.call(this)||this;i.destroyed=!1;var n=i.getDefaultCfg();return i.cfg=ft(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}(Hu),Oh=globalThis&&globalThis.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,a;i<n;i++)(a||!(i in e))&&(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return r.concat(a||Array.prototype.slice.call(e))},xw=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),ww=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return r}(),_w=function(){function r(e,t,i,n){this.name=e,this.version=t,this.os=i,this.bot=n,this.type="bot-device"}return r}(),bw=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Sw=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Cw=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Mw=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Rh=3,Aw=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Cw]],Nh=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function yg(r){return r?zh(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Sw:typeof navigator<"u"?zh(navigator.userAgent):Ew()}function Fw(r){return r!==""&&Aw.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 zh(r){var e=Fw(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new bw;var n=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);n?n.length<Rh&&(n=Oh(Oh([],n,!0),kw(Rh-n.length),!0)):n=[];var a=n.join("."),o=Tw(r),s=Mw.exec(r);return s&&s[1]?new _w(t,a,o,s[1]):new xw(t,a,o)}function Tw(r){for(var e=0,t=Nh.length;e<t;e++){var i=Nh[e],n=i[0],a=i[1],o=a.exec(r);if(o)return n}return null}function Ew(){var r=typeof process<"u"&&process.version;return r?new ww(process.version.slice(1)):null}function kw(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function Vh(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],y=e[4],m=e[5],x=e[6],_=e[7],w=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+y*o+m*u,t[4]=p*n+y*s+m*c,t[5]=p*a+y*l+m*h,t[6]=x*i+_*o+w*u,t[7]=x*n+_*s+w*c,t[8]=x*a+_*l+w*h,t}function ir(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 rs(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 dn=kt,tl="matrix",Lw=["zIndex","capture","visible","type"],Iw=["repeat"],Pw=":",Dw="*";function Bw(r){for(var e=[],t=0;t<r.length;t++)O(r[t])?e.push([].concat(r[t])):e.push(r[t]);return e}function Ow(r,e){var t={},i=e.attrs;for(var n in r)t[n]=i[n];return t}function Rw(r,e){var t={},i=e.attr();return S(r,function(n,a){Iw.indexOf(a)===-1&&!Lt(i[a],n)&&(t[a]=n)}),t}function Nw(r,e){if(e.onFrame)return r;var t=e.startTime,i=e.delay,n=e.duration,a=Object.prototype.hasOwnProperty;return S(r,function(o){t+i<o.startTime+o.delay+o.duration&&n>o.delay&&S(e.toAttrs,function(s,l){a.call(o.toAttrs,l)&&(delete o.toAttrs[l],delete o.fromAttrs[l])})}),r}var mg=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.attrs={};var n=i.getDefaultAttrs();return ft(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;n<arguments.length;n++)i[n]=arguments[n];var a=i[0],o=i[1];if(!a)return this.attrs;if(pt(a)){for(var s in a)this.setAttr(s,a[s]);return this.afterAttrsChange(a),this}return i.length===2?(this.setAttr(a,o),this.afterAttrsChange((t={},t[a]=o,t)),this):this.attrs[a]},e.prototype.isClipped=function(t,i){var n=this.getClip();return n&&!n.isHit(t,i)},e.prototype.setAttr=function(t,i){var n=this.attrs[t];n!==i&&(this.attrs[t]=i,this.onAttrChange(t,i,n))},e.prototype.onAttrChange=function(t,i,n){t==="matrix"&&this.set("totalMatrix",null)},e.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var i=this.cfg.applyTo;i&&i.onCanvasChange("clip")}else this.onCanvasChange("attr")},e.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},e.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},e.prototype.setZIndex=function(t){this.set("zIndex",t);var i=this.getParent();return i&&i.sort(),this},e.prototype.toFront=function(){var t=this.getParent();if(t){var i=t.getChildren();this.get("el");var n=i.indexOf(this);i.splice(n,1),i.push(this),this.onCanvasChange("zIndex")}},e.prototype.toBack=function(){var t=this.getParent();if(t){var i=t.getChildren();this.get("el");var n=i.indexOf(this);i.splice(n,1),i.unshift(this),this.onCanvasChange("zIndex")}},e.prototype.remove=function(t){t===void 0&&(t=!0);var i=this.getParent();i?(gg(i.getChildren(),this),i.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},e.prototype.resetMatrix=function(){this.attr(tl,this.getDefaultMatrix()),this.onCanvasChange("matrix")},e.prototype.getMatrix=function(){return this.attr(tl)},e.prototype.setMatrix=function(t){this.attr(tl,t),this.onCanvasChange("matrix")},e.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var i=this.attr("matrix"),n=this.cfg.parentMatrix;n&&i?t=Vh(n,i):t=i||n,this.set("totalMatrix",t)}return t},e.prototype.applyMatrix=function(t){var i=this.attr("matrix"),n=null;t&&i?n=Vh(t,i):n=i||t,this.set("totalMatrix",n),this.set("parentMatrix",t)},e.prototype.getDefaultMatrix=function(){return null},e.prototype.applyToMatrix=function(t){var i=this.attr("matrix");return i?ir(i,t):t},e.prototype.invertFromMatrix=function(t){var i=this.attr("matrix");if(i){var n=rs(i);if(n)return ir(n,t)}return t},e.prototype.setClip=function(t){var i=this.getCanvas(),n=null;if(t){var a=this.getShapeBase(),o=xi(t.type),s=a[o];s&&(n=new s({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:i}))}return this.set("clipShape",n),this.onCanvasChange("clip"),n},e.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},e.prototype.clone=function(){var t=this,i=this.attrs,n={};S(i,function(s,l){O(i[l])?n[l]=Bw(i[l]):n[l]=i[l]});var a=this.constructor,o=new a({attrs:n});return S(Lw,function(s){o.set(s,t.get(s))}),o},e.prototype.destroy=function(){var t=this.destroyed;t||(this.attrs={},r.prototype.destroy.call(this))},e.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},e.prototype.animate=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(!(!this.get("timeline")&&!this.get("canvas"))){this.set("animating",!0);var n=this.get("timeline");n||(n=this.get("canvas").get("timeline"),this.set("timeline",n));var a=this.get("animations")||[];n.timer||n.initTimer();var o=t[0],s=t[1],l=t[2],u=l===void 0?"easeLinear":l,c=t[3],h=c===void 0?Mr:c,f=t[4],v=f===void 0?0:f,d,p,y,m,x;W(o)?(d=o,o={}):pt(o)&&o.onFrame&&(d=o.onFrame,p=o.repeat),pt(s)?(x=s,s=x.duration,u=x.easing||"easeLinear",v=x.delay||0,p=x.repeat||p||!1,h=x.callback||Mr,y=x.pauseCallback||Mr,m=x.resumeCallback||Mr):(tt(h)&&(v=h,h=null),W(u)?(h=u,u="easeLinear"):u=u||"easeLinear");var _=Rw(o,this),w={fromAttrs:Ow(_,this),toAttrs:_,duration:s,easing:u,repeat:p,callback:h,pauseCallback:y,resumeCallback:m,delay:v,startTime:n.getTime(),id:Gr(),onFrame:d,pathFormatted:!1};a.length>0?a=Nw(a,w):n.addAnimator(this),a.push(w),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");S(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 S(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 S(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&&pg(f,o))return"break";O(v)?S(v,function(d){n.emitDelegateEvent(f,d,i)}):l.emitDelegateEvent(f,v,i)}},l=this,u=0;u<a.length;u++){var c=s(u);if(c==="break")break}},e.prototype.emitDelegateEvent=function(t,i,n){var a=this.getEvents(),o=i+Pw+n.type;(a[o]||a[Dw])&&(n.name=o,n.currentTarget=t,n.delegateTarget=this,n.delegateObject=t.get("delegateObject"),this.emit(o,n))},e.prototype.translate=function(t,i){t===void 0&&(t=0),i===void 0&&(i=0);var n=this.getMatrix(),a=dn(n,[["t",t,i]]);return this.setMatrix(a),this},e.prototype.move=function(t,i){var n=this.attr("x")||0,a=this.attr("y")||0;return this.translate(t-n,i-a),this},e.prototype.moveTo=function(t,i){return this.move(t,i)},e.prototype.scale=function(t,i){var n=this.getMatrix(),a=dn(n,[["s",t,i||t]]);return this.setMatrix(a),this},e.prototype.rotate=function(t){var i=this.getMatrix(),n=dn(i,[["r",t]]);return this.setMatrix(n),this},e.prototype.rotateAtStart=function(t){var i=this.attr(),n=i.x,a=i.y,o=this.getMatrix(),s=dn(o,[["t",-n,-a],["r",t],["t",n,a]]);return this.setMatrix(s),this},e.prototype.rotateAtPoint=function(t,i,n){var a=this.getMatrix(),o=dn(a,[["t",-t,-i],["r",n],["t",t,i]]);return this.setMatrix(o),this},e}(es),Gh={},Hl="_INDEX";function xg(r,e){if(r.set("canvas",e),r.isGroup()){var t=r.get("children");t.length&&t.forEach(function(i){xg(i,e)})}}function wg(r,e){if(r.set("timeline",e),r.isGroup()){var t=r.get("children");t.length&&t.forEach(function(i){wg(i,e)})}}function zw(r,e,t){t===void 0&&(t=!0),t?e.destroy():(e.set("parent",null),e.set("canvas",null)),gg(r.getChildren(),e)}function Vw(r){return function(e,t){var i=r(e,t);return i===0?e[Hl]-t[Hl]:i}}var _g=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=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?S(o,function(l){var u=l.getBBox(),c=u.minX,h=u.maxX,f=u.minY,v=u.maxY;c<t&&(t=c),h>i&&(i=h),f<n&&(n=f),v>a&&(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?S(o,function(l){var u=l.getCanvasBBox(),c=u.minX,h=u.maxX,f=u.minY,v=u.maxY;c<t&&(t=c),h>i&&(i=h),f<n&&(n=f),v>a&&(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();S(i,function(n){n.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t[0],a=t[1];pt(n)?a=n:a.type=n;var o=Gh[a.type];o||(o=xi(a.type),Gh[a.type]=o);var s=this.getShapeBase(),l=new s[o](a);return this.add(l),l},e.prototype.addGroup=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=t[0],a=t[1],o;if(W(n))a?o=new n(a):o=new n({parent:this});else{var s=n||{},l=this.getGroupBase();o=new l(s)}return this.add(o),o},e.prototype.getCanvas=function(){var t;return this.isCanvas()?t=this:t=this.get("canvas"),t},e.prototype.getShape=function(t,i,n){if(!Xn(this))return null;var a=this.getChildren(),o;if(this.isCanvas())o=this._findShape(a,t,i,n);else{var s=[t,i,1];s=this.invertFromMatrix(s),this.isClipped(s[0],s[1])||(o=this._findShape(a,s[0],s[1],n))}return o},e.prototype._findShape=function(t,i,n,a){for(var o=null,s=t.length-1;s>=0;s--){var l=t[s];if(Xn(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&&zw(o,t,!1),t.set("parent",this),i&&xg(t,i),a&&wg(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();S(t,function(i,n){return i[Hl]=n,i}),t.sort(Vw(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 S(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 S(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}(mg),Hi=0,Cn=0,gn=0,bg=1e3,Mo,Mn,Ao=0,fi=0,is=0,Wn=typeof performance=="object"&&performance.now?performance:Date,Sg=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(r){setTimeout(r,17)};function Cg(){return fi||(Sg(Gw),fi=Wn.now()+is)}function Gw(){fi=0}function Xl(){this._call=this._time=this._next=null}Xl.prototype=Mg.prototype={constructor:Xl,restart:function(r,e,t){if(typeof r!="function")throw new TypeError("callback is not a function");t=(t==null?Cg():+t)+(e==null?0:+e),!this._next&&Mn!==this&&(Mn?Mn._next=this:Mo=this,Mn=this),this._call=r,this._time=t,Wl()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wl())}};function Mg(r,e,t){var i=new Xl;return i.restart(r,e,t),i}function Yw(){Cg(),++Hi;for(var r=Mo,e;r;)(e=fi-r._time)>=0&&r._call.call(null,e),r=r._next;--Hi}function Yh(){fi=(Ao=Wn.now())+is,Hi=Cn=0;try{Yw()}finally{Hi=0,Hw(),fi=0}}function $w(){var r=Wn.now(),e=r-Ao;e>bg&&(is-=e,Ao=r)}function Hw(){for(var r,e=Mo,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:Mo=t);Mn=r,Wl(i)}function Wl(r){if(!Hi){Cn&&(Cn=clearTimeout(Cn));var e=r-fi;e>24?(r<1/0&&(Cn=setTimeout(Yh,r-Wn.now()-is)),gn&&(gn=clearInterval(gn))):(gn||(Ao=Wn.now(),gn=setInterval($w,bg)),Hi=1,Sg(Yh))}}function qu(r,e,t){r.prototype=e.prototype=t,t.constructor=r}function Ag(r,e){var t=Object.create(r.prototype);for(var i in e)t[i]=e[i];return t}function ma(){}var qn=.7,Fo=1/qn,Ri="\\s*([+-]?\\d+)\\s*",Un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",He="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xw=/^#([0-9a-f]{3,8})$/,Ww=new RegExp(`^rgb\\(${Ri},${Ri},${Ri}\\)$`),qw=new RegExp(`^rgb\\(${He},${He},${He}\\)$`),Uw=new RegExp(`^rgba\\(${Ri},${Ri},${Ri},${Un}\\)$`),jw=new RegExp(`^rgba\\(${He},${He},${He},${Un}\\)$`),Zw=new RegExp(`^hsl\\(${Un},${He},${He}\\)$`),Qw=new RegExp(`^hsla\\(${Un},${He},${He},${Un}\\)$`),$h={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};qu(ma,jn,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:Hh,formatHex:Hh,formatHex8:Kw,formatHsl:Jw,formatRgb:Xh,toString:Xh});function Hh(){return this.rgb().formatHex()}function Kw(){return this.rgb().formatHex8()}function Jw(){return Fg(this).formatHsl()}function Xh(){return this.rgb().formatRgb()}function jn(r){var e,t;return r=(r+"").trim().toLowerCase(),(e=Xw.exec(r))?(t=e[1].length,e=parseInt(e[1],16),t===6?Wh(e):t===3?new ae(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Da(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Da(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=Ww.exec(r))?new ae(e[1],e[2],e[3],1):(e=qw.exec(r))?new ae(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Uw.exec(r))?Da(e[1],e[2],e[3],e[4]):(e=jw.exec(r))?Da(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Zw.exec(r))?jh(e[1],e[2]/100,e[3]/100,1):(e=Qw.exec(r))?jh(e[1],e[2]/100,e[3]/100,e[4]):$h.hasOwnProperty(r)?Wh($h[r]):r==="transparent"?new ae(NaN,NaN,NaN,0):null}function Wh(r){return new ae(r>>16&255,r>>8&255,r&255,1)}function Da(r,e,t,i){return i<=0&&(r=e=t=NaN),new ae(r,e,t,i)}function t1(r){return r instanceof ma||(r=jn(r)),r?(r=r.rgb(),new ae(r.r,r.g,r.b,r.opacity)):new ae}function ql(r,e,t,i){return arguments.length===1?t1(r):new ae(r,e,t,i??1)}function ae(r,e,t,i){this.r=+r,this.g=+e,this.b=+t,this.opacity=+i}qu(ae,ql,Ag(ma,{brighter(r){return r=r==null?Fo:Math.pow(Fo,r),new ae(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?qn:Math.pow(qn,r),new ae(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new ae(ni(this.r),ni(this.g),ni(this.b),To(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:qh,formatHex:qh,formatHex8:e1,formatRgb:Uh,toString:Uh}));function qh(){return`#${Kr(this.r)}${Kr(this.g)}${Kr(this.b)}`}function e1(){return`#${Kr(this.r)}${Kr(this.g)}${Kr(this.b)}${Kr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Uh(){const r=To(this.opacity);return`${r===1?"rgb(":"rgba("}${ni(this.r)}, ${ni(this.g)}, ${ni(this.b)}${r===1?")":`, ${r})`}`}function To(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function ni(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function Kr(r){return r=ni(r),(r<16?"0":"")+r.toString(16)}function jh(r,e,t,i){return i<=0?r=e=t=NaN:t<=0||t>=1?r=e=NaN:e<=0&&(r=NaN),new ke(r,e,t,i)}function Fg(r){if(r instanceof ke)return new ke(r.h,r.s,r.l,r.opacity);if(r instanceof ma||(r=jn(r)),!r)return new ke;if(r instanceof ke)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+(t<i)*6:t===a?o=(i-e)/s+2:o=(e-t)/s+4,s/=l<.5?a+n:2-a-n,o*=60):s=l>0&&l<1?0:o,new ke(o,s,l,r.opacity)}function r1(r,e,t,i){return arguments.length===1?Fg(r):new ke(r,e,t,i??1)}function ke(r,e,t,i){this.h=+r,this.s=+e,this.l=+t,this.opacity=+i}qu(ke,r1,Ag(ma,{brighter(r){return r=r==null?Fo:Math.pow(Fo,r),new ke(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?qn:Math.pow(qn,r),new ke(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 ae(el(r>=240?r-240:r+120,n,i),el(r,n,i),el(r<120?r+240:r-120,n,i),this.opacity)},clamp(){return new ke(Zh(this.h),Ba(this.s),Ba(this.l),To(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=To(this.opacity);return`${r===1?"hsl(":"hsla("}${Zh(this.h)}, ${Ba(this.s)*100}%, ${Ba(this.l)*100}%${r===1?")":`, ${r})`}`}}));function Zh(r){return r=(r||0)%360,r<0?r+360:r}function Ba(r){return Math.max(0,Math.min(1,r||0))}function el(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 Uu=r=>()=>r;function i1(r,e){return function(t){return r+t*e}}function n1(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 a1(r){return(r=+r)==1?Tg:function(e,t){return t-e?n1(e,t,r):Uu(isNaN(e)?t:e)}}function Tg(r,e){var t=e-r;return t?i1(r,t):Uu(isNaN(r)?e:r)}const Qh=function r(e){var t=a1(e);function i(n,a){var o=t((n=ql(n)).r,(a=ql(a)).r),s=t(n.g,a.g),l=t(n.b,a.b),u=Tg(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 Eg(r,e){e||(e=[]);var t=r?Math.min(e.length,r.length):0,i=e.slice(),n;return function(a){for(n=0;n<t;++n)i[n]=r[n]*(1-a)+e[n]*a;return i}}function kg(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function o1(r,e){return(kg(e)?Eg:Lg)(r,e)}function Lg(r,e){var t=e?e.length:0,i=r?Math.min(t,r.length):0,n=new Array(i),a=new Array(t),o;for(o=0;o<i;++o)n[o]=Eo(r[o],e[o]);for(;o<t;++o)a[o]=e[o];return function(s){for(o=0;o<i;++o)a[o]=n[o](s);return a}}function s1(r,e){var t=new Date;return r=+r,e=+e,function(i){return t.setTime(r*(1-i)+e*i),t}}function Ul(r,e){return r=+r,e=+e,function(t){return r*(1-t)+e*t}}function l1(r,e){var t={},i={},n;(r===null||typeof r!="object")&&(r={}),(e===null||typeof e!="object")&&(e={});for(n in e)n in r?t[n]=Eo(r[n],e[n]):i[n]=e[n];return function(a){for(n in t)i[n]=t[n](a);return i}}var jl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rl=new RegExp(jl.source,"g");function u1(r){return function(){return r}}function c1(r){return function(e){return r(e)+""}}function h1(r,e){var t=jl.lastIndex=rl.lastIndex=0,i,n,a,o=-1,s=[],l=[];for(r=r+"",e=e+"";(i=jl.exec(r))&&(n=rl.exec(e));)(a=n.index)>t&&(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:Ul(i,n)})),t=rl.lastIndex;return t<e.length&&(a=e.slice(t),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?c1(l[0].x):u1(e):(e=l.length,function(u){for(var c=0,h;c<e;++c)s[(h=l[c]).i]=h.x(u);return s.join("")})}function Eo(r,e){var t=typeof e,i;return e==null||t==="boolean"?Uu(e):(t==="number"?Ul:t==="string"?(i=jn(e))?(e=i,Qh):h1:e instanceof jn?Qh:e instanceof Date?s1:kg(e)?Eg:Array.isArray(e)?Lg:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?l1:Ul)(r,e)}function f1(r){return+r}function v1(r){return r*r}function d1(r){return r*(2-r)}function Kh(r){return((r*=2)<=1?r*r:--r*(2-r)+1)/2}function g1(r){return r*r*r}function p1(r){return--r*r*r+1}function Jh(r){return((r*=2)<=1?r*r*r:(r-=2)*r*r+2)/2}var ju=3,y1=function r(e){e=+e;function t(i){return Math.pow(i,e)}return t.exponent=r,t}(ju),m1=function r(e){e=+e;function t(i){return 1-Math.pow(1-i,e)}return t.exponent=r,t}(ju),tf=function r(e){e=+e;function t(i){return((i*=2)<=1?Math.pow(i,e):2-Math.pow(2-i,e))/2}return t.exponent=r,t}(ju),Ig=Math.PI,Pg=Ig/2;function x1(r){return+r==1?1:1-Math.cos(r*Pg)}function w1(r){return Math.sin(r*Pg)}function ef(r){return(1-Math.cos(Ig*r))/2}function Pr(r){return(Math.pow(2,-10*r)-.0009765625)*1.0009775171065494}function _1(r){return Pr(1-+r)}function b1(r){return 1-Pr(r)}function rf(r){return((r*=2)<=1?Pr(1-r):2-Pr(r-1))/2}function S1(r){return 1-Math.sqrt(1-r*r)}function C1(r){return Math.sqrt(1- --r*r)}function nf(r){return((r*=2)<=1?1-Math.sqrt(1-r*r):Math.sqrt(1-(r-=2)*r)+1)/2}var Zl=4/11,M1=6/11,A1=8/11,F1=3/4,T1=9/11,E1=10/11,k1=15/16,L1=21/22,I1=63/64,Oa=1/Zl/Zl;function P1(r){return 1-Zn(1-r)}function Zn(r){return(r=+r)<Zl?Oa*r*r:r<A1?Oa*(r-=M1)*r+F1:r<E1?Oa*(r-=T1)*r+k1:Oa*(r-=L1)*r+I1}function D1(r){return((r*=2)<=1?1-Zn(1-r):Zn(r-1)+1)/2}var Zu=1.70158,B1=function r(e){e=+e;function t(i){return(i=+i)*i*(e*(i-1)+i)}return t.overshoot=r,t}(Zu),O1=function r(e){e=+e;function t(i){return--i*i*((i+1)*e+i)+1}return t.overshoot=r,t}(Zu),af=function r(e){e=+e;function t(i){return((i*=2)<1?i*i*((e+1)*i-e):(i-=2)*i*((e+1)*i+e)+2)/2}return t.overshoot=r,t}(Zu),Xi=2*Math.PI,Qu=1,Ku=.3,R1=function r(e,t){var i=Math.asin(1/(e=Math.max(1,e)))*(t/=Xi);function n(a){return e*Pr(- --a)*Math.sin((i-a)/t)}return n.amplitude=function(a){return r(a,t*Xi)},n.period=function(a){return r(e,a)},n}(Qu,Ku),of=function r(e,t){var i=Math.asin(1/(e=Math.max(1,e)))*(t/=Xi);function n(a){return 1-e*Pr(a=+a)*Math.sin((a+i)/t)}return n.amplitude=function(a){return r(a,t*Xi)},n.period=function(a){return r(e,a)},n}(Qu,Ku),N1=function r(e,t){var i=Math.asin(1/(e=Math.max(1,e)))*(t/=Xi);function n(a){return((a=a*2-1)<0?e*Pr(-a)*Math.sin((i-a)/t):2-e*Pr(a)*Math.sin((i+a)/t))/2}return n.amplitude=function(a){return r(a,t*Xi)},n.period=function(a){return r(e,a)},n}(Qu,Ku);const z1=Object.freeze(Object.defineProperty({__proto__:null,easeBack:af,easeBackIn:B1,easeBackInOut:af,easeBackOut:O1,easeBounce:Zn,easeBounceIn:P1,easeBounceInOut:D1,easeBounceOut:Zn,easeCircle:nf,easeCircleIn:S1,easeCircleInOut:nf,easeCircleOut:C1,easeCubic:Jh,easeCubicIn:g1,easeCubicInOut:Jh,easeCubicOut:p1,easeElastic:of,easeElasticIn:R1,easeElasticInOut:N1,easeElasticOut:of,easeExp:rf,easeExpIn:_1,easeExpInOut:rf,easeExpOut:b1,easeLinear:f1,easePoly:tf,easePolyIn:y1,easePolyInOut:tf,easePolyOut:m1,easeQuad:Kh,easeQuadIn:v1,easeQuadInOut:Kh,easeQuadOut:d1,easeSin:ef,easeSinIn:x1,easeSinInOut:ef,easeSinOut:w1},Symbol.toStringTag,{value:"Module"}));var Dg={};function V1(r){return Dg[r.toLowerCase()]||z1[r]}function Bg(r,e){Dg[r.toLowerCase()]=e}var G1=function(r){return["fill","stroke","fillStyle","strokeStyle"].includes(r)},Y1=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)},sf=[1,0,0,0,1,0,0,0,1];function $1(r,e,t){var i={},n=e.fromAttrs,a=e.toAttrs;if(!r.destroyed){var o;for(var s in a)if(!Lt(n[s],a[s]))if(s==="path"){var l=a[s],u=n[s];l.length>u.length?(l=Di(a[s]),u=Di(n[s]),u=vg(u,l),u=$l(u,l),e.fromAttrs.path=u,e.toAttrs.path=l):e.pathFormatted||(l=Di(a[s]),u=Di(n[s]),u=$l(u,l),e.fromAttrs.path=u,e.toAttrs.path=l,e.pathFormatted=!0),i[s]=[];for(var c=0;c<l.length;c++){for(var h=l[c],f=u[c],v=[],d=0;d<h.length;d++)tt(h[d])&&f&&tt(f[d])?(o=Eo(f[d],h[d]),v.push(o(t))):v.push(h[d]);i[s].push(v)}}else if(s==="matrix"){var p=o1(n[s]||sf,a[s]||sf),y=p(t);i[s]=y}else G1(s)&&Y1(a[s])?i[s]=a[s]:W(a[s])||(o=Eo(n[s],a[s]),i[s]=o(t));r.attr(i)}}function H1(r,e,t){var i=e.startTime,n=e.delay;if(t<i+n||e._paused)return!1;var a,o=e.duration,s=e.easing,l=V1(s);if(t=t-i-e.delay,e.repeat)a=t%o/o,a=l(a);else if(a=t/o,a<1)a=l(a);else return e.onFrame?r.attr(e.onFrame(1)):r.attr(e.toAttrs),!0;if(e.onFrame){var u=e.onFrame(a);r.attr(u)}else $1(r,e,a);return!1}var X1=function(){function r(e){this.animators=[],this.current=0,this.timer=null,this.canvas=e}return r.prototype.initTimer=function(){var e=this,t=!1,i,n,a;this.timer=Mg(function(o){if(e.current=o,e.animators.length>0){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=H1(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}(),W1=40,lf=0,uf=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function cf(r,e,t){t.name=e,t.target=r,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}function q1(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&&pg(r,i)){t.bubbles=!1;return}t.name=e,t.currentTarget=r,t.delegateTarget=r,r.emit(e,t)}}var U1=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");S(uf,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");S(uf,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 ya(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===lf&&(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===lf){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>W1?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,cf(n,e,s);for(var l=n.getParent();l;)l.emitDelegation(e,s),s.propagationStopped||q1(l,e,s),s.propagationPath.push(l),l=l.getParent()}else{var u=this.canvas;cf(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}(),hf="px",ff=yg(),j1=ff&&ff.name==="firefox",ns=function(r){g.__extends(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");K(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 U1({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new X1(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,i){var n=this.get("el");Bh&&(n.style.width=t+hf,n.style.height=i+hf)},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");Bh&&i&&(i.style.cursor=t)},e.prototype.getPointByEvent=function(t){var i=this.get("supportCSSTransform");if(i){if(j1&&!D(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!D(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}(_g),as=function(r){g.__extends(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<i.length;n++){var a=i[n];t.add(a.clone())}return t},e}(_g),os=function(r){g.__extends(e,r);function e(t){return r.call(this,t)||this}return e.prototype._isInBBox=function(t,i){var n=this.getBBox();return n.minX<=t&&n.maxX>=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=ir(i,[t.minX,t.minY]),u=ir(i,[t.maxX,t.minY]),c=ir(i,[t.minX,t.maxY]),h=ir(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,y=p===void 0?0:p,m=f.shadowOffsetY,x=m===void 0?0:m,_=n-d+y,w=o+d+y,b=a-d+x,C=s+d+x;n=Math.min(n,_),o=Math.max(o,w),a=Math.min(a,b),s=Math.max(s,C)}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}(mg),Og=new Map;function Me(r,e){Og.set(r,e)}function ss(r){return Og.get(r)}function Rg(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 Ng(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 Ut(r,e,t,i){var n=r-t,a=e-i;return Math.sqrt(n*n+a*a)}function fo(r,e){return Math.abs(r-e)<.001}function rn(r,e){var t=Pe(r),i=Pe(e),n=Se(r),a=Se(e);return{x:t,y:i,width:n-t,height:a-i}}function ls(r){return(r+Math.PI*2)%(Math.PI*2)}const Vt={box:function(r,e,t,i){return rn([r,t],[e,i])},length:function(r,e,t,i){return Ut(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 Ut(r,e,n,a);var s=(t-r)*(t-r)+(i-e)*(i-e);return o>s?Ut(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(Mx(o,[0,0]))return Math.sqrt((n-r)*(n-r)+(a-e)*(a-e));var s=[-o[1],o[0]];Zd(s,s);var l=[n-r,a-e];return Math.abs(Ax(l,s))},tangentAngle:function(r,e,t,i){return Math.atan2(i-e,t-r)}};var Z1=1e-4;function zg(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=Ut(l[0],l[1],d[0],d[1]);p<s&&(o=v,s=p)}if(o===0)return{x:r[0],y:e[0]};if(o===1){var y=r.length;return{x:r[y-1],y:e[y-1]}}s=1/0;for(var f=0;f<32&&!(h<Z1);f++){var m=o-h,x=o+h,d=[n.apply(null,r.concat([m])),n.apply(null,e.concat([m]))],p=Ut(l[0],l[1],d[0],d[1]);if(m>=0&&p<s)o=m,s=p;else{var _=[n.apply(null,r.concat([x])),n.apply(null,e.concat([x]))],w=Ut(l[0],l[1],_[0],_[1]);x<=1&&w<s?(o=x,s=w):h*=.5}}return{x:n.apply(null,r.concat([o])),y:n.apply(null,e.concat([o]))}}function Q1(r,e){for(var t=0,i=r.length,n=0;n<i;n++){var a=r[n],o=e[n],s=r[(n+1)%i],l=e[(n+1)%i];t+=Ut(a,o,s,l)}return t/2}function _r(r,e,t,i){var n=1-i;return n*n*r+2*i*n*e+i*i*t}function vf(r,e,t){var i=r+t-2*e;if(fo(i,0))return[.5];var n=(r-e)/i;return n<=1&&n>=0?[n]:[]}function df(r,e,t,i){return 2*(1-i)*(e-r)+2*i*(t-e)}function Vg(r,e,t,i,n,a,o){var s=_r(r,t,n,o),l=_r(e,i,a,o),u=Vt.pointAt(r,e,t,i,o),c=Vt.pointAt(t,i,n,a,o);return[[r,e,u.x,u.y,s,l],[s,l,c.x,c.y,n,a]]}function Ql(r,e,t,i,n,a,o){if(o===0)return(Ut(r,e,t,i)+Ut(t,i,n,a)+Ut(r,e,n,a))/2;var s=Vg(r,e,t,i,n,a,.5),l=s[0],u=s[1];return l.push(o-1),u.push(o-1),Ql.apply(null,l)+Ql.apply(null,u)}const Gg={box:function(r,e,t,i,n,a){var o=vf(r,t,n)[0],s=vf(e,i,a)[0],l=[r,n],u=[e,a];return o!==void 0&&l.push(_r(r,t,n,o)),s!==void 0&&u.push(_r(e,i,a,s)),rn(l,u)},length:function(r,e,t,i,n,a){return Ql(r,e,t,i,n,a,3)},nearestPoint:function(r,e,t,i,n,a,o,s){return zg([r,t,n],[e,i,a],o,s,_r)},pointDistance:function(r,e,t,i,n,a,o,s){var l=this.nearestPoint(r,e,t,i,n,a,o,s);return Ut(l.x,l.y,o,s)},interpolationAt:_r,pointAt:function(r,e,t,i,n,a,o){return{x:_r(r,t,n,o),y:_r(e,i,a,o)}},divide:function(r,e,t,i,n,a,o){return Vg(r,e,t,i,n,a,o)},tangentAngle:function(r,e,t,i,n,a,o){var s=df(r,t,n,o),l=df(e,i,a,o),u=Math.atan2(l,s);return ls(u)}};function br(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 gf(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 il(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(fo(n,0))fo(a,0)||(l=-o/a,l>=0&&l<=1&&s.push(l));else{var h=a*a-4*n*o;fo(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 Yg(r,e,t,i,n,a,o,s,l){var u=br(r,t,n,o,l),c=br(e,i,a,s,l),h=Vt.pointAt(r,e,t,i,l),f=Vt.pointAt(t,i,n,a,l),v=Vt.pointAt(n,a,o,s,l),d=Vt.pointAt(h.x,h.y,f.x,f.y,l),p=Vt.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 Kl(r,e,t,i,n,a,o,s,l){if(l===0)return Q1([r,t,n,o],[e,i,a,s]);var u=Yg(r,e,t,i,n,a,o,s,.5),c=u[0],h=u[1];return c.push(l-1),h.push(l-1),Kl.apply(null,c)+Kl.apply(null,h)}const Pn={extrema:il,box:function(r,e,t,i,n,a,o,s){for(var l=[r,o],u=[e,s],c=il(r,t,n,o),h=il(e,i,a,s),f=0;f<c.length;f++)l.push(br(r,t,n,o,c[f]));for(var f=0;f<h.length;f++)u.push(br(e,i,a,s,h[f]));return rn(l,u)},length:function(r,e,t,i,n,a,o,s){return Kl(r,e,t,i,n,a,o,s,3)},nearestPoint:function(r,e,t,i,n,a,o,s,l,u,c){return zg([r,t,n,o],[e,i,a,s],l,u,br,c)},pointDistance:function(r,e,t,i,n,a,o,s,l,u,c){var h=this.nearestPoint(r,e,t,i,n,a,o,s,l,u,c);return Ut(h.x,h.y,l,u)},interpolationAt:br,pointAt:function(r,e,t,i,n,a,o,s,l){return{x:br(r,t,n,o,l),y:br(e,i,a,s,l)}},divide:function(r,e,t,i,n,a,o,s,l){return Yg(r,e,t,i,n,a,o,s,l)},tangentAngle:function(r,e,t,i,n,a,o,s,l){var u=gf(r,t,n,o,l),c=gf(e,i,a,s,l);return ls(Math.atan2(c,u))}};function pf(r,e){var t=Math.abs(r);return e>0?t:t*-1}const K1={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,y,m=0;m<4;m++){p=o*Math.cos(d),y=s*Math.sin(d);var x=(f-v)*Math.pow(Math.cos(d),3)/o,_=(v-f)*Math.pow(Math.sin(d),3)/s,w=p-x,b=y-_,C=c-x,A=h-_,F=Math.hypot(b,w),E=Math.hypot(A,C),T=F*Math.asin((w*A-b*C)/(F*E)),k=T/Math.sqrt(f+v-p*p-y*y);d+=k,d=Math.min(Math.PI/2,Math.max(0,d))}return{x:r+pf(p,l),y:e+pf(y,u)}},pointDistance:function(r,e,t,i,n,a){var o=this.nearestPoint(r,e,t,i,n,a);return Ut(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 ls(o)}};function J1(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 t_(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 e_(r,e,t){return Math.atan(-e/r*Math.tan(t))}function r_(r,e,t){return Math.atan(e/(r*Math.tan(t)))}function yf(r,e,t,i,n,a){return t*Math.cos(n)*Math.cos(a)-i*Math.sin(n)*Math.sin(a)+r}function mf(r,e,t,i,n,a){return t*Math.sin(n)*Math.cos(a)+i*Math.cos(n)*Math.sin(a)+e}function i_(r,e,t,i){var n=Math.atan2(i*r,t*e);return(n+Math.PI*2)%(Math.PI*2)}function xf(r,e,t){return{x:r*Math.cos(t),y:e*Math.sin(t)}}function wf(r,e,t){var i=Math.cos(t),n=Math.sin(t);return[r*i-e*n,r*n+e*i]}const n_={box:function(r,e,t,i,n,a,o){for(var s=e_(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;a<o?a<f&&f<o&&c.push(f):o<f&&f<a&&c.push(f)}for(var h=0;h<c.length;h++){var v=yf(r,e,t,i,n,c[h]);v<l&&(l=v),v>u&&(u=v)}for(var d=r_(t,i,n),p=1/0,y=-1/0,m=[a,o],h=-Math.PI*2;h<=Math.PI*2;h+=Math.PI){var x=d+h;a<o?a<x&&x<o&&m.push(x):o<x&&x<a&&m.push(x)}for(var h=0;h<m.length;h++){var _=mf(r,e,t,i,n,m[h]);_<p&&(p=_),_>y&&(y=_)}return{x:l,y:p,width:u-l,height:y-p}},length:function(r,e,t,i,n,a,o){},nearestPoint:function(r,e,t,i,n,a,o,s,l){var u=wf(s-r,l-e,-n),c=u[0],h=u[1],f=K1.nearestPoint(0,0,t,i,c,h),v=i_(t,i,f.x,f.y);v<a?f=xf(t,i,a):v>o&&(f=xf(t,i,o));var d=wf(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 Ut(u.x,u.y,s,l)},pointAt:function(r,e,t,i,n,a,o,s){var l=(o-a)*s+a;return{x:yf(r,e,t,i,n,l),y:mf(r,e,t,i,n,l)}},tangentAngle:function(r,e,t,i,n,a,o,s){var l=(o-a)*s+a,u=J1(r,e,t,i,n,a,o,l),c=t_(r,e,t,i,n,a,o,l);return ls(Math.atan2(c,u))}};function $g(r){for(var e=0,t=[],i=0;i<r.length-1;i++){var n=r[i],a=r[i+1],o=Ut(n[0],n[1],a[0],a[1]),s={from:n,to:a,length:o};t.push(s),e+=o}return{segments:t,totalLength:e}}function a_(r){if(r.length<2)return 0;for(var e=0,t=0;t<r.length-1;t++){var i=r[t],n=r[t+1];e+=Ut(i[0],i[1],n[0],n[1])}return e}function o_(r,e){if(e>1||e<0||r.length<2)return null;var t=$g(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<i.length;s++){var l=i[s],u=l.from,c=l.to,h=l.length/n;if(e>=a&&e<=a+h){var f=(e-a)/h;o=Vt.pointAt(u[0],u[1],c[0],c[1],f);break}a+=h}return o}function s_(r,e){if(e>1||e<0||r.length<2)return 0;for(var t=$g(r),i=t.segments,n=t.totalLength,a=0,o=0,s=0;s<i.length;s++){var l=i[s],u=l.from,c=l.to,h=l.length/n;if(e>=a&&e<=a+h){o=Math.atan2(c[1]-u[1],c[0]-u[0]);break}a+=h}return o}function l_(r,e,t){for(var i=1/0,n=0;n<r.length-1;n++){var a=r[n],o=r[n+1],s=Vt.pointDistance(a[0],a[1],o[0],o[1],e,t);s<i&&(i=s)}return i}const Hg={box:function(r){for(var e=[],t=[],i=0;i<r.length;i++){var n=r[i];e.push(n[0]),t.push(n[1])}return rn(e,t)},length:function(r){return a_(r)},pointAt:function(r,e){return o_(r,e)},pointDistance:function(r,e,t){return l_(r,e,t)},tangentAngle:function(r,e){return s_(r,e)}};function _f(r,e){return!r||!e?r||e:{minX:Math.min(r.minX,e.minX),minY:Math.min(r.minY,e.minY),maxX:Math.max(r.maxX,e.maxX),maxY:Math.max(r.maxY,e.maxY)}}function Ju(r,e){var t=r.get("startArrowShape"),i=r.get("endArrowShape"),n=null,a=null;return t&&(n=t.getCanvasBBox(),e=_f(e,n)),i&&(a=i.getCanvasBBox(),e=_f(e,a)),e}function u_(r){for(var e=r.attr(),t=e.points,i=[],n=[],a=0;a<t.length;a++){var o=t[a];i.push(o[0]),n.push(o[1])}var s=rn(i,n),l=s.x,u=s.y,c=s.width,h=s.height,f={minX:l,minY:u,maxX:l+c,maxY:u+h};return f=Ju(r,f),{x:f.minX,y:f.minY,width:f.maxX-f.minX,height:f.maxY-f.minY}}function c_(r){for(var e=r.attr(),t=e.points,i=[],n=[],a=0;a<t.length;a++){var o=t[a];i.push(o[0]),n.push(o[1])}return rn(i,n)}var nl=null;function us(){if(!nl){var r=document.createElement("canvas");r.width=1,r.height=1,nl=r.getContext("2d")}return nl}function cs(r,e,t){var i=1;if(K(r)&&(i=r.split(`
  3. `).length),i>1){var n=h_(e,t);return e*i+n*(i-1)}return e}function h_(r,e){return e?e-r:r*.14}function f_(r,e){var t=us(),i=0;if(D(r)||r==="")return i;if(t.save(),t.font=e,K(r)&&r.includes(`
  4. `)){var n=r.split(`
  5. `);S(n,function(a){var o=t.measureText(a).width;i<o&&(i=o)})}else i=t.measureText(r).width;return t.restore(),i}function hs(r){var e=r.fontSize,t=r.fontFamily,i=r.fontWeight,n=r.fontStyle,a=r.fontVariant;return[n,a,i,e+"px",t].join(" ").trim()}function v_(r){var e=r.attr(),t=e.x,i=e.y,n=e.text,a=e.fontSize,o=e.lineHeight,s=e.font;s||(s=hs(e));var l=f_(n,s),u;if(!l)u={x:t,y:i,width:0,height:0};else{var c=e.textAlign,h=e.textBaseline,f=cs(n,a,o),v={x:t,y:i-f};c&&(c==="end"||c==="right"?v.x-=l:c==="center"&&(v.x-=l/2)),h&&(h==="top"?v.y+=f:h==="middle"&&(v.y+=f/2)),u={x:v.x,y:v.y,width:l,height:f}}return u}var d_=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig,g_=/[^\s\,]+/ig;function p_(r){var e=r||[];if(O(e))return e;if(K(e))return e=e.match(d_),S(e,function(t,i){if(t=t.match(g_),t[0].length>1){var n=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=n}S(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[i]=t}),e}function Ra(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Jl(r,e){return Ra(r)*Ra(e)?(r[0]*e[0]+r[1]*e[1])/(Ra(r)*Ra(e)):1}function bf(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(Jl(r,e))}function tu(r,e){return r[0]===e[0]&&r[1]===e[1]}function y_(r,e){var t=e[1],i=e[2],n=jo(Zo(e[3]),Math.PI*2),a=e[4],o=e[5],s=r[0],l=r[1],u=e[6],c=e[7],h=Math.cos(n)*(s-u)/2+Math.sin(n)*(l-c)/2,f=-1*Math.sin(n)*(s-u)/2+Math.cos(n)*(l-c)/2,v=h*h/(t*t)+f*f/(i*i);v>1&&(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 y=i?p*t*f/i:0,m=t?p*-i*h/t:0,x=(s+u)/2+Math.cos(n)*y-Math.sin(n)*m,_=(l+c)/2+Math.sin(n)*y+Math.cos(n)*m,w=[(h-y)/t,(f-m)/i],b=[(-1*h-y)/t,(-1*f-m)/i],C=bf([1,0],w),A=bf(w,b);return Jl(w,b)<=-1&&(A=Math.PI),Jl(w,b)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:_,rx:tu(r,[u,c])?0:t,ry:tu(r,[u,c])?0:i,startAngle:C,endAngle:C+A,xRotation:n,arcFlag:a,sweepFlag:o}}function Sf(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function m_(r){r=p_(r);for(var e=[],t=null,i=null,n=null,a=0,o=r.length,s=0;s<o;s++){var l=r[s];i=r[s+1];var u=l[0],c={command:u,prePoint:t,params:l,startTangent:null,endTangent:null};switch(u){case"M":n=[l[1],l[2]],a=s;break;case"A":var h=y_(t,l);c.arcParams=h;break}if(u==="Z")t=n,i=r[a+1];else{var f=l.length;t=[l[f-2],l[f-1]]}i&&i[0]==="Z"&&(i=r[a],e[a]&&(e[a].prePoint=t)),c.currentPoint=t,e[a]&&tu(t,e[a].currentPoint)&&(e[a].prePoint=c.prePoint);var v=i?[i[i.length-2],i[i.length-1]]:null;c.nextPoint=v;var d=c.prePoint;if(["L","H","V"].includes(u))c.startTangent=[d[0]-t[0],d[1]-t[1]],c.endTangent=[t[0]-d[0],t[1]-d[1]];else if(u==="Q"){var p=[l[1],l[2]];c.startTangent=[d[0]-p[0],d[1]-p[1]],c.endTangent=[t[0]-p[0],t[1]-p[1]]}else if(u==="T"){var y=e[s-1],p=Sf(y.currentPoint,d);y.command==="Q"?(c.command="Q",c.startTangent=[d[0]-p[0],d[1]-p[1]],c.endTangent=[t[0]-p[0],t[1]-p[1]]):(c.command="TL",c.startTangent=[d[0]-t[0],d[1]-t[1]],c.endTangent=[t[0]-d[0],t[1]-d[1]])}else if(u==="C"){var m=[l[1],l[2]],x=[l[3],l[4]];c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[t[0]-x[0],t[1]-x[1]],c.startTangent[0]===0&&c.startTangent[1]===0&&(c.startTangent=[m[0]-x[0],m[1]-x[1]]),c.endTangent[0]===0&&c.endTangent[1]===0&&(c.endTangent=[x[0]-m[0],x[1]-m[1]])}else if(u==="S"){var y=e[s-1],m=Sf(y.currentPoint,d),x=[l[1],l[2]];y.command==="C"?(c.command="C",c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[t[0]-x[0],t[1]-x[1]]):(c.command="SQ",c.startTangent=[d[0]-x[0],d[1]-x[1]],c.endTangent=[t[0]-x[0],t[1]-x[1]])}else if(u==="A"){var _=.001,w=c.arcParams||{},b=w.cx,C=b===void 0?0:b,A=w.cy,F=A===void 0?0:A,E=w.rx,T=E===void 0?0:E,k=w.ry,P=k===void 0?0:k,B=w.sweepFlag,z=B===void 0?0:B,X=w.startAngle,I=X===void 0?0:X,R=w.endAngle,$=R===void 0?0:R;z===0&&(_*=-1);var G=T*Math.cos(I-_)+C,V=P*Math.sin(I-_)+F;c.startTangent=[G-n[0],V-n[1]];var H=T*Math.cos(I+$+_)+C,Z=P*Math.sin(I+$-_)+F;c.endTangent=[d[0]-H,d[1]-Z]}e.push(c)}return e}function x_(r,e){for(var t=[],i=[],n=[],a=0;a<r.length;a++){var o=r[a],s=o.currentPoint,l=o.params,u=o.prePoint,c=void 0;switch(o.command){case"Q":c=Gg.box(u[0],u[1],l[1],l[2],l[3],l[4]);break;case"C":c=Pn.box(u[0],u[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var h=o.arcParams;c=n_.box(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:t.push(s[0]),i.push(s[1]);break}c&&(o.box=c,t.push(c.x,c.x+c.width),i.push(c.y,c.y+c.height)),e&&(o.command==="L"||o.command==="M")&&o.prePoint&&o.nextPoint&&n.push(o)}t=t.filter(function(m){return!Number.isNaN(m)&&m!==1/0&&m!==-1/0}),i=i.filter(function(m){return!Number.isNaN(m)&&m!==1/0&&m!==-1/0});var f=Pe(t),v=Pe(i),d=Se(t),p=Se(i);if(n.length===0)return{x:f,y:v,width:d-f,height:p-v};for(var a=0;a<n.length;a++){var o=n[a],s=o.currentPoint,y=void 0;s[0]===f?(y=Na(o,e),f=f-y.xExtra):s[0]===d&&(y=Na(o,e),d=d+y.xExtra),s[1]===v?(y=Na(o,e),v=v-y.yExtra):s[1]===p&&(y=Na(o,e),p=p+y.yExtra)}return{x:f,y:v,width:d-f,height:p-v}}function Na(r,e){var t=r.prePoint,i=r.currentPoint,n=r.nextPoint,a=Math.pow(i[0]-t[0],2)+Math.pow(i[1]-t[1],2),o=Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2),s=Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2),l=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!l||Math.sin(l)===0||zt(l,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(n[1]-i[1],n[0]-i[0])),c=Math.abs(Math.atan2(n[0]-i[0],n[1]-i[1]));u=u>Math.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 w_(r){var e=r.attr(),t=e.path,i=e.stroke,n=i?e.lineWidth:0,a=r.get("segments")||m_(t),o=x_(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=Ju(r,h),{x:h.minX,y:h.minY,width:h.maxX-h.minX,height:h.maxY-h.minY}}function __(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=Ju(r,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function b_(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}}Me("rect",Rg);Me("image",Rg);Me("circle",Ng);Me("marker",Ng);Me("polyline",u_);Me("polygon",c_);Me("text",v_);Me("path",w_);Me("line",__);Me("ellipse",b_);var Cf=0,S_=1/2,C_=1/2,M_=.05,fs=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);S(e,function(a,o){S(n,function(s,l){i.adjustDim(l,s,a,o)})})},r.prototype.groupData=function(e,t){return S(e,function(i){i[t]===void 0&&(i[t]=Cf)}),be(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=ft({},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]=De(e,l).sort(function(u,c){return u-c}))}),!n&&this.isAdjust("y")){var s="y";a[s]=[Cf,1]}return a},r}(),Xg={},Wg=function(r){return Xg[r.toLowerCase()]},vs=function(r,e){if(Wg(r))throw new Error("Adjust type '"+r+"' existed.");Xg[r.toLowerCase()]=e};/*! *****************************************************************************
  6. Copyright (c) Microsoft Corporation.
  7. Permission to use, copy, modify, and/or distribute this software for any
  8. purpose with or without fee is hereby granted.
  9. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  10. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  11. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  12. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  13. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  14. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. PERFORMANCE OF THIS SOFTWARE.
  16. ***************************************************************************** */var eu=function(r,e){return eu=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])},eu(r,e)};function ds(r,e){eu(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var $e=function(){return $e=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},$e.apply(this,arguments)},A_=function(r){ds(e,r);function e(t){var i=r.call(this,t)||this;i.cacheMap={},i.adjustDataArray=[],i.mergeData=[];var n=t.marginRatio,a=n===void 0?S_:n,o=t.dodgeRatio,s=o===void 0?C_:o,l=t.dodgeBy,u=t.intervalPadding,c=t.dodgePadding,h=t.xDimensionLength,f=t.groupNum,v=t.defaultSize,d=t.maxColumnWidth,p=t.minColumnWidth,y=t.columnWidthRatio,m=t.customOffset;return i.marginRatio=a,i.dodgeRatio=s,i.dodgeBy=l,i.intervalPadding=u,i.dodgePadding=c,i.xDimensionLegenth=h,i.groupNum=f,i.defaultSize=v,i.maxColumnWidth=d,i.minColumnWidth=p,i.columnWidthRatio=y,i.customOffset=m,i}return e.prototype.process=function(t){var i=he(t),n=ve(i),a=this.dodgeBy,o=a?Fx(n,a):i;return this.cacheMap={},this.adjustDataArray=o,this.mergeData=n,this.adjustData(o,n),this.adjustDataArray=[],this.mergeData=[],i},e.prototype.adjustDim=function(t,i,n,a){var o=this,s=this.customOffset,l=this.getDistribution(t),u=this.groupData(n,t);return S(u,function(c,h){var f;i.length===1?f={pre:i[0]-1,next:i[0]+1}:f=o.getAdjustRange(t,parseFloat(h),i),S(c,function(v){var d=v[t],p=l[d],y=p.indexOf(a);if(D(s))v[t]=o.getDodgeOffset(f,y,p.length);else{var m=f.pre,x=f.next;v[t]=W(s)?s(v,f):(m+x)/2+s}})}),[]},e.prototype.getDodgeOffset=function(t,i,n){var a=this,o=a.dodgeRatio,s=a.marginRatio,l=a.intervalPadding,u=a.dodgePadding,c=t.pre,h=t.next,f=h-c,v;if(!D(l)&&D(u)&&l>=0){var d=this.getIntervalOnlyOffset(n,i);v=c+d}else if(!D(u)&&D(l)&&u>=0){var d=this.getDodgeOnlyOffset(n,i);v=c+d}else if(!D(l)&&!D(u)&&l>=0&&u>=0){var d=this.getIntervalAndDodgeOffset(n,i);v=c+d}else{var p=f*o/n,y=s*p,d=1/2*(f-n*p-(n-1)*y)+((i+1)*p+i*y)-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=D(f)?p:1/l/t*f,!D(c)){var y=c/s;p=Math.min(p,y)}if(!D(h)){var m=h/s;p=Math.max(p,m)}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,!D(c)){var y=c/s;p=Math.min(p,y)}if(!D(h)){var m=h/s;p=Math.max(p,m)}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={},S(i,function(o,s){var l=De(o,t);l.length||l.push(0),S(l,function(u){a[u]||(a[u]=[]),a[u].push(s)})}),n[t]=a),a},e}(fs);function F_(r,e){return(e-r)*Math.random()+r}var T_=function(r){ds(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var i=he(t),n=ve(i);return this.adjustData(i,n),i},e.prototype.adjustDim=function(t,i,n){var a=this,o=this.groupData(n,t);return S(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)*M_;return F_(i+a,n-a)},e.prototype.adjustGroup=function(t,i,n,a){var o=this,s=this.getAdjustRange(i,n,a);return S(t,function(l){l[i]=o.getAdjustOffset(s)}),t},e}(fs),al=Tx,E_=function(r){ds(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 al,u=new al;return s.map(function(c){return c.map(function(h){var f,v=M(h,n,0),d=M(h,[a]),p=v.toString();if(d=O(d)?d[1]:d,!D(d)){var y=d>=0?l:u;y.has(p)||y.set(p,0);var m=y.get(p),x=d+m;return y.set(p,x),$e($e({},h),(f={},f[a]=[m,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 al;return u.map(function(h){return h.map(function(f){var v,d=i.size,p=f[a],y=d*2/o;c.has(p)||c.set(p,y/2);var m=c.get(p);return c.set(p,m+y),$e($e({},f),(v={},v[l]=m,v))})})},e}(fs),k_=function(r){ds(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.process=function(t){var i=ve(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 xt(t,function(u){return xt(u,function(c){var h,f,v=c[o],d=c[a];if(O(v)){var p=(l-s[d])/2;return $e($e({},c),(h={},h[o]=xt(v,function(m){return p+m}),h))}var y=(l-v)/2;return $e($e({},c),(f={},f[o]=[y,v+y],f))})})},e.prototype.getXValuesMaxMap=function(t){var i=this,n=this,a=n.xField,o=n.yField,s=be(t,function(l){return l[a]});return Ex(s,function(l){return i.getDimMaxValue(l,o)})},e.prototype.getDimMaxValue=function(t,i){var n=xt(t,function(o){return M(o,i,[])}),a=ve(n);return Math.max.apply(Math,a)},e}(fs);vs("Dodge",A_);vs("Jitter",T_);vs("Stack",E_);vs("Symmetric",k_);var Mf=function(r,e){return K(e)?e:r.invert(r.scale(e))},xa=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;i<arguments.length;i++)t[i]=arguments[i];var n=t.map(function(a,o){return e._toOriginParam(a,e.scales[o])});return this.callback.apply(this,n)},r.prototype.getLinearValue=function(e){var t=this.values.length-1,i=Math.floor(t*e),n=t*e-i,a=this.values[i],o=i===t?a:this.values[i+1];return a+(o-a)*n},r.prototype.getNames=function(){for(var e=this.scales,t=this.names,i=Math.min(e.length,t.length),n=[],a=0;a<i;a+=1)n.push(t[a]);return n},r.prototype.getFields=function(){return this.scales.map(function(e){return e.field})},r.prototype.getScale=function(e){return this.scales[this.names.indexOf(e)]},r.prototype.defaultCallback=function(){for(var e=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return t.length===0?this.values:t.map(function(n,a){var o=e.scales[a];return o.type==="identity"?o.values[0]:e._getAttributeValue(o,n)})},r.prototype._parseCfg=function(e){var t=this,i=e.type,n=i===void 0?"base":i,a=e.names,o=a===void 0?[]:a,s=e.scales,l=s===void 0?[]:s,u=e.values,c=u===void 0?[]:u,h=e.callback;this.type=n,this.scales=l,this.values=c,this.names=o,this.callback=function(){for(var f=[],v=0;v<arguments.length;v++)f[v]=arguments[v];if(h){var d=h.apply(void 0,f);if(!D(d))return[d]}return t.defaultCallback.apply(t,f)}},r.prototype._getAttributeValue=function(e,t){if(e.isCategory&&!this.linear){var i=e.translate(t);return this.values[i%this.values.length]}var n=e.scale(t);return this.getLinearValue(n)},r.prototype._toOriginParam=function(e,t){return t.isLinear?e:O(e)?e.map(function(i){return Mf(t,i)}):Mf(t,e)},r}(),L_=/rgba?\(([\s.,0-9]+)\)/,I_=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,P_=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,D_=/[\d.]+:(#[^\s]+|[^\)]+\))/gi,B_=function(r){return/^[r,R,L,l]{1}[\s]*\(/.test(r)},O_=function(){var r=document.createElement("i");return r.title="Web Colour Picker",r.style.display="none",document.body.appendChild(r),r},ol=function(r,e,t,i){return r[i]+(e[i]-r[i])*t};function qg(r){return"#"+sl(r[0])+sl(r[1])+sl(r[2])}var Ug=function(r){return[parseInt(r.substr(1,2),16),parseInt(r.substr(3,2),16),parseInt(r.substr(5,2),16)]},sl=function(r){var e=Math.round(r).toString(16);return e.length===1?"0"+e:e},R_=function(r,e){var t=isNaN(Number(e))||e<0?0:e>1?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 qg([ol(o,s,a,0),ol(o,s,a,1),ol(o,s,a,2)])},za,jg=function(r){if(r[0]==="#"&&r.length===7)return r;za||(za=O_()),za.style.color=r;var e=document.defaultView.getComputedStyle(za,"").getPropertyValue("color"),t=L_.exec(e),i=t[1].split(/\s*,\s*/).map(function(n){return Number(n)});return e=qg(i),e},N_=function(r){var e=K(r)?r.split("-"):r,t=xt(e,function(i){return Ug(i.indexOf("#")===-1?jg(i):i)});return function(i){return R_(t,i)}},z_=function(r){if(B_(r)){var e,t=void 0;if(r[0]==="l"){var i=I_.exec(r),n=+i[1]+90;t=i[2],e="linear-gradient("+n+"deg, "}else if(r[0]==="r"){e="radial-gradient(";var i=P_.exec(r);t=i[4]}var a=t.match(D_);return S(a,function(o,s){var l=o.split(":");e+=l[1]+" "+l[0]*100+"%",s!==a.length-1&&(e+=", ")}),e+=")",e}return r};const kr={rgb2arr:Ug,gradient:N_,toRGB:ga(jg),toCSSGradient:z_};var V_=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.type="color",i.names=["color"],K(i.values)&&(i.linear=!0),i.gradient=kr.gradient(i.values),i}return e.prototype.getLinearValue=function(t){return this.gradient(t)},e}(xa),G_=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.type="opacity",i.names=["opacity"],i}return e}(xa),Y_=function(r){g.__extends(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 D(t)||D(i)?[]:[O(t)?t.map(function(s){return a.scale(s)}):a.scale(t),O(i)?i.map(function(s){return o.scale(s)}):o.scale(i)]},e}(xa),$_=function(r){g.__extends(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}(xa),H_=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.type="size",i.names=["size"],i}return e}(xa),Zg={};function X_(r){return Zg[r]}function Ue(r,e){Zg[r]=e}var tc=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){ft(this.__cfg__,e),this.init()},r.prototype.clone=function(){return this.constructor(this.__cfg__)},r.prototype.getTicks=function(){var e=this;return xt(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 D(n)||!W(n.toString)?"":n.toString()},r.prototype.getConfig=function(e){return this.__cfg__[e]},r.prototype.init=function(){ft(this,this.__cfg__),this.setDomain(),oe(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(K(e)){var i=X_(e);if(!i)throw new Error("There is no method to to calculate ticks!");t=i(this)}else W(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 tt(e)?(e-t)/(i-t):NaN},r.prototype.calcValue=function(e,t,i){return t+e*(i-t)},r}(),gs=function(r){g.__extends(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;t<this.values.length;t++)this.translateIndexMap.set(this.values[t],t)}},e.prototype.translate=function(t){this.buildIndexMap();var i=this.translateIndexMap.get(t);return i===void 0&&(i=tt(t)?t:NaN),i},e.prototype.scale=function(t){var i=this.translate(t),n=this.calcPercent(i,this.min,this.max);return this.calcValue(n,this.rangeMin(),this.rangeMax())},e.prototype.invert=function(t){var i=this.max-this.min,n=this.calcPercent(t,this.rangeMin(),this.rangeMax()),a=Math.round(i*n)+this.min;return a<this.min||a>this.max?NaN:this.values[a]},e.prototype.getText=function(t){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];var a=t;return tt(t)&&!this.values.includes(t)&&(a=this.values[a]),r.prototype.getText.apply(this,g.__spreadArrays([a],i))},e.prototype.initCfg=function(){this.tickMethod="cat"},e.prototype.setDomain=function(){if(D(this.getConfig("min"))&&(this.min=0),D(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(tc),Qg=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,wr="\\d\\d?",yr="\\d\\d",W_="\\d{3}",q_="\\d{4}",Dn="[^\\s]+",Kg=/\[([^]*?)\]/gm;function Jg(r,e){for(var t=[],i=0,n=r.length;i<n;i++)t.push(r[i].substr(0,e));return t}var Af=function(r){return function(e,t){var i=t[r].map(function(a){return a.toLowerCase()}),n=i.indexOf(e.toLowerCase());return n>-1?n:null}};function Dr(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var i=0,n=e;i<n.length;i++){var a=n[i];for(var o in a)r[o]=a[o]}return r}var tp=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ep=["January","February","March","April","May","June","July","August","September","October","November","December"],U_=Jg(ep,3),j_=Jg(tp,3),ec={dayNamesShort:j_,dayNames:tp,monthNamesShort:U_,monthNames:ep,amPm:["am","pm"],DoFn:function(r){return r+["th","st","nd","rd"][r%10>3?0:(r-r%10!==10?1:0)*r%10]}},ko=Dr({},ec),rp=function(r){return ko=Dr(ko,r)},Ff=function(r){return r.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},Kt=function(r,e){for(e===void 0&&(e=2),r=String(r);r.length<e;)r="0"+r;return r},Z_={D:function(r){return String(r.getDate())},DD:function(r){return Kt(r.getDate())},Do:function(r,e){return e.DoFn(r.getDate())},d:function(r){return String(r.getDay())},dd:function(r){return Kt(r.getDay())},ddd:function(r,e){return e.dayNamesShort[r.getDay()]},dddd:function(r,e){return e.dayNames[r.getDay()]},M:function(r){return String(r.getMonth()+1)},MM:function(r){return Kt(r.getMonth()+1)},MMM:function(r,e){return e.monthNamesShort[r.getMonth()]},MMMM:function(r,e){return e.monthNames[r.getMonth()]},YY:function(r){return Kt(String(r.getFullYear()),4).substr(2)},YYYY:function(r){return Kt(r.getFullYear(),4)},h:function(r){return String(r.getHours()%12||12)},hh:function(r){return Kt(r.getHours()%12||12)},H:function(r){return String(r.getHours())},HH:function(r){return Kt(r.getHours())},m:function(r){return String(r.getMinutes())},mm:function(r){return Kt(r.getMinutes())},s:function(r){return String(r.getSeconds())},ss:function(r){return Kt(r.getSeconds())},S:function(r){return String(Math.round(r.getMilliseconds()/100))},SS:function(r){return Kt(Math.round(r.getMilliseconds()/10),2)},SSS:function(r){return Kt(r.getMilliseconds(),3)},a:function(r,e){return r.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(r,e){return r.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(r){var e=r.getTimezoneOffset();return(e>0?"-":"+")+Kt(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(r){var e=r.getTimezoneOffset();return(e>0?"-":"+")+Kt(Math.floor(Math.abs(e)/60),2)+":"+Kt(Math.abs(e)%60,2)}},Tf=function(r){return+r-1},Ef=[null,wr],kf=[null,Dn],Lf=["isPm",Dn,function(r,e){var t=r.toLowerCase();return t===e.amPm[0]?0:t===e.amPm[1]?1:null}],If=["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}],Q_={D:["day",wr],DD:["day",yr],Do:["day",wr+Dn,function(r){return parseInt(r,10)}],M:["month",wr,Tf],MM:["month",yr,Tf],YY:["year",yr,function(r){var e=new Date,t=+(""+e.getFullYear()).substr(0,2);return+(""+(+r>68?t-1:t)+r)}],h:["hour",wr,void 0,"isPm"],hh:["hour",yr,void 0,"isPm"],H:["hour",wr],HH:["hour",yr],m:["minute",wr],mm:["minute",yr],s:["second",wr],ss:["second",yr],YYYY:["year",q_],S:["millisecond","\\d",function(r){return+r*100}],SS:["millisecond",yr,function(r){return+r*10}],SSS:["millisecond",W_],d:Ef,dd:Ef,ddd:kf,dddd:kf,MMM:["month",Dn,Af("monthNamesShort")],MMMM:["month",Dn,Af("monthNames")],a:Lf,A:Lf,ZZ:If,Z:If},Lo={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"},ip=function(r){return Dr(Lo,r)},np=function(r,e,t){if(e===void 0&&(e=Lo.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=Lo[e]||e;var i=[];e=e.replace(Kg,function(a,o){return i.push(o),"@@@"});var n=Dr(Dr({},ko),t);return e=e.replace(Qg,function(a){return Z_[a](r,n)}),e.replace(/@@@/g,function(){return i.shift()})};function ap(r,e,t){if(t===void 0&&(t={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=Lo[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(Kg,function(w,b){return o.push(Ff(b)),"@@@"}),l={},u={};s=Ff(s).replace(Qg,function(w){var b=Q_[w],C=b[0],A=b[1],F=b[3];if(l[C])throw new Error("Invalid format. "+C+" specified twice in format");return l[C]=!0,F&&(u[F]=!0),a.push(b),"("+A+")"}),Object.keys(u).forEach(function(w){if(!l[w])throw new Error("Invalid format. "+w+" 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=Dr(Dr({},ko),t),f=1;f<c.length;f++){var v=a[f-1],d=v[0],p=v[2],y=p?p(c[f],h):+c[f];if(y==null)return null;n[d]=y}n.isPm===1&&n.hour!=null&&+n.hour!=12?n.hour=+n.hour+12:n.isPm===0&&+n.hour==12&&(n.hour=0);var m;if(n.timezoneOffset==null){m=new Date(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond);for(var x=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],f=0,_=x.length;f<_;f++)if(l[x[f][0]]&&n[x[f][0]]!==m[x[f][1]]())return null}else if(m=new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute-n.timezoneOffset,n.second,n.millisecond)),n.month>11||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 m}var op={format:np,parse:ap,defaultI18n:ec,setGlobalDateI18n:rp,setGlobalDateMasks:ip};const K_=Object.freeze(Object.defineProperty({__proto__:null,assign:Dr,default:op,defaultI18n:ec,format:np,parse:ap,setGlobalDateI18n:rp,setGlobalDateMasks:ip},Symbol.toStringTag,{value:"Module"}));function J_(r){return function(e,t,i,n){for(var a=D(i)?0:i,o=D(n)?e.length:n;a<o;){var s=a+o>>>1;r(e[s])>t?o=s:a=s+1}return a}}var Pf="format";function sp(r,e){var t=K_[Pf]||op[Pf];return t(r,e)}function Io(r){return K(r)&&(r.indexOf("T")>0?r=new Date(r).getTime():r=new Date(r.replace(/-/gi,"/")).getTime()),Qd(r)&&(r=r.getTime()),r}var Ee=1e3,ai=60*Ee,oi=60*ai,nr=24*oi,Bn=nr*31,Df=nr*365,pn=[["HH:mm:ss",Ee],["HH:mm:ss",Ee*10],["HH:mm:ss",Ee*30],["HH:mm",ai],["HH:mm",ai*10],["HH:mm",ai*30],["HH",oi],["HH",oi*6],["HH",oi*12],["YYYY-MM-DD",nr],["YYYY-MM-DD",nr*4],["YYYY-WW",nr*7],["YYYY-MM",Bn],["YYYY-MM",Bn*4],["YYYY-MM",Bn*6],["YYYY",nr*380]];function tb(r,e,t){var i=(e-r)/t,n=J_(function(o){return o[1]})(pn,i)-1,a=pn[n];return n<0?a=pn[0]:n>=pn.length&&(a=It(pn)),a}var eb=function(r){g.__extends(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=Io(t);var i=this.values.indexOf(t);return i===-1&&(tt(t)&&t<this.values.length?i=t:i=NaN),i},e.prototype.getText=function(t,i){var n=this.translate(t);if(n>-1){var a=this.values[n],o=this.formatter;return a=o?o(a,i):sp(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;S(t,function(i,n){t[n]=Io(i)}),t.sort(function(i,n){return i-n}),r.prototype.setDomain.call(this)},e}(gs),ps=function(r){g.__extends(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(D(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=fe(t),n=It(t);i<this.min&&(this.min=i),n>this.max&&(this.max=n),D(this.minLimit)||(this.min=i),D(this.maxLimit)||(this.max=n)},e.prototype.setDomain=function(){var t=Kd(this.values),i=t.min,n=t.max;D(this.min)&&(this.min=i),D(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=Xt(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}(tc),ys=function(r){g.__extends(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}(ps);function Sr(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 xe(r,e){return r===1?1:Math.log(e)/Math.log(r)}function lp(r,e,t){D(t)&&(t=Math.max.apply(null,r));var i=t;return S(r,function(n){n>0&&n<i&&(i=n)}),i===t&&(i=t/e),i>1&&(i=1),i}var rb=function(r){g.__extends(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=xe(i,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,l=this.positiveMin;if(l){if(t===0)return 0;s=xe(i,l/i);var u=1/(n-s)*o;if(t<u)return t/u*l}else s=xe(i,this.min);var c=(t-a)/o,h=c*(n-s)+s;return Math.pow(i,h)},e.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},e.prototype.setDomain=function(){r.prototype.setDomain.call(this);var t=this.min;if(t<0)throw new Error("When you use log scale, the minimum value must be greater than zero!");t===0&&(this.positiveMin=lp(this.values,this.base,this.max))},e.prototype.getScalePercent=function(t){var i=this.max,n=this.min;if(i===n||t<=0)return 0;var a=this.base,o=this.positiveMin;o&&(n=o*1/a);var s;return t<o?s=t/o/(xe(a,i)-xe(a,n)):s=(xe(a,t)-xe(a,n))/(xe(a,i)-xe(a,n)),s},e}(ps),ib=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="pow",t}return e.prototype.invert=function(t){var i=this.getInvertPercent(t),n=this.exponent,a=Sr(n,this.max),o=Sr(n,this.min),s=i*(a-o)+o,l=s>=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=(Sr(a,t)-Sr(a,n))/(Sr(a,i)-Sr(a,n));return o},e}(ps),nb=function(r){g.__extends(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):sp(n,this.mask)},e.prototype.scale=function(t){var i=t;return(K(i)||Qd(i))&&(i=this.translate(i)),r.prototype.scale.call(this,i)},e.prototype.translate=function(t){return Io(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((!D(i)||!tt(i))&&(this.min=this.translate(this.min)),(!D(n)||!tt(n))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,l=0;S(t,function(u){var c=Io(u);if(isNaN(c))throw new TypeError("Invalid Time: "+u+" in time scale!");o>c?(s=o,o=c):s>c&&(s=c),l<c&&(l=c),a.push(c)}),t.length>1&&(this.minTickInterval=s-o),D(i)&&(this.min=o),D(n)&&(this.max=l)}},e}(ys),up=function(r){g.__extends(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 It(i);if(o<0)return fe(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||(It(t)!==this.max&&t.push(this.max),fe(t)!==this.min&&t.unshift(this.min)),t},e.prototype.getScalePercent=function(t){var i=this.ticks;if(t<fe(i))return 0;if(t>It(i))return 1;var n=0;return S(i,function(a,o){if(t>=a)n=o;else return!1}),n/(i.length-1)},e}(ps),ab=function(r){g.__extends(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}(up),cp={};function ru(r){return cp[r]}function je(r,e){if(ru(r))throw new Error("type '"+r+"' existed.");cp[r]=e}var ob=function(r){g.__extends(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&&tt(t)?t:this.range[0]},e.prototype.invert=function(t){var i=this.range;return t<i[0]||t>i[1]?NaN:this.values[0]},e}(tc);function hp(r){var e=r.values,t=r.tickInterval,i=r.tickCount,n=r.showLast;if(tt(t)){var a=Xt(e,function(d,p){return p%t===0}),o=It(e);return n&&It(a)!==o&&a.push(o),a}var s=e.length,l=r.min,u=r.max;if(D(l)&&(l=0),D(u)&&(u=e.length-1),!tt(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<i&&!(f>=u);v++)f=Math.min(l+v*c,u),v===i-1&&n?h.push(e[u]):h.push(e[f]);return h}function sb(r){var e=r.min,t=r.max,i=r.nice,n=r.tickCount,a=new lb;return a.domain([e,t]),i&&a.nice(n),a.ticks(n)}var ll=5,Bf=Math.sqrt(50),Of=Math.sqrt(10),Rf=Math.sqrt(2),lb=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=ll);var n=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],l=this._domain[o],u;return l<s&&(t=[l,s],s=t[0],l=t[1],i=[o,a],a=i[0],o=i[1]),u=vo(s,l,e),u>0?(s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u,u=vo(s,l,e)):u<0&&(s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u,u=vo(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=ll),ub(this._domain[0],this._domain[this._domain.length-1],e||ll)},r}();function ub(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=e<r)&&(a=r,r=e,e=a),(s=vo(r,e,t))===0||!isFinite(s))return[];if(s>0)for(r=Math.ceil(r/s),e=Math.floor(e/s),o=new Array(a=Math.ceil(e-r+1));++n<a;)o[n]=(r+n)*s;else for(r=Math.floor(r*s),e=Math.ceil(e*s),o=new Array(a=Math.ceil(r-e+1));++n<a;)o[n]=(r-n)/s;return i&&o.reverse(),o}function vo(r,e,t){var i=(e-r)/Math.max(0,t),n=Math.floor(Math.log(i)/Math.LN10),a=i/Math.pow(10,n);return n>=0?(a>=Bf?10:a>=Of?5:a>=Rf?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=Bf?10:a>=Of?5:a>=Rf?2:1)}function Nf(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 rc(r,e,t){var i=Nf(r,t,"floor"),n=Nf(e,t,"ceil");i=Qs(i,t),n=Qs(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=Qs(s,o);a.push(l)}return{min:i,max:n,ticks:a}}function ic(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=D(n)?D(e)?o:e:n,h=D(a)?D(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<u;d++)v.push(c+f*d);return v}function cb(r){var e=r.min,t=r.max,i=r.tickInterval,n=r.minLimit,a=r.maxLimit,o=sb(r);return!D(n)||!D(a)?ic(r,fe(o),It(o)):i?rc(e,t,i).ticks:o}function Ur(r){return Math.abs(r)<1e-15?r:parseFloat(r.toFixed(15))}var hb=[1,5,2,2.5,4,3],zf=Number.EPSILON*100;function fb(r,e){return(r%e+e)%e}function vb(r){return Math.round(r*1e12)/1e12}function db(r,e,t,i,n,a){var o=Bt(e),s=Jd(e,r),l=0,u=fb(i,a);return(u<zf||a-u<zf)&&i<=0&&n>=0&&(l=1),1-s/(o-1)-t+l}function gb(r,e,t){var i=Bt(e),n=Jd(e,r),a=1;return 1-n/(i-1)-t+a}function pb(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 yb(r,e){return r>=e?2-(r-1)/(e-1):1}function mb(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 xb(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 wb(){return 1}function _b(r,e,t,i,n,a){t===void 0&&(t=5),i===void 0&&(i=!0),n===void 0&&(n=hb),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(H,Z){return Ur(r+l*Z)})}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},c=1;c<1/0;){for(var h=0;h<n.length;h+=1){var f=n[h],v=gb(f,n,c);if(a[0]*v+a[1]+a[2]+a[3]<u.score){c=1/0;break}for(var d=2;d<1/0;){var p=yb(d,o);if(a[0]*v+a[1]+a[2]*p+a[3]<u.score)break;for(var y=(e-r)/(d+1)/c/f,m=Math.ceil(Math.log10(y));m<1/0;){var x=c*f*Math.pow(10,m),_=xb(r,e,x*(d-1));if(a[0]*v+a[1]*_+a[2]*p+a[3]<u.score)break;var w=Math.floor(e/x)*c-(d-1)*c,b=Math.ceil(r/x)*c;if(w<=b)for(var s=b-w,C=0;C<=s;C+=1){var A=w+C,F=A*(x/c),E=F+x*(d-1),T=x,k=db(f,n,c,F,E,T),P=mb(r,e,F,E),B=pb(d,o,r,e,F,E),z=wb(),X=a[0]*k+a[1]*P+a[2]*B+a[3]*z;X>u.score&&(!i||F<=r&&E>=e)&&(u.lmin=F,u.lmax=E,u.lstep=T,u.score=X)}m+=1}d+=1}}c+=1}var I=Ur(u.lmax),R=Ur(u.lmin),$=Ur(u.lstep),G=Math.floor(vb((I-R)/$))+1,V=new Array(G);V[0]=Ur(R);for(var h=1;h<G;h++)V[h]=Ur(V[h-1]+$);return{min:Math.min(r,fe(V)),max:Math.max(e,It(V)),ticks:V}}function bb(r){var e=r.min,t=r.max,i=r.tickCount,n=r.nice,a=r.tickInterval,o=r.minLimit,s=r.maxLimit,l=_b(e,t,i,n).ticks;return!D(o)||!D(s)?ic(r,fe(l),It(l)):a?rc(e,t,a).ticks:l}function Sb(r){var e=r.base,t=r.tickCount,i=r.min,n=r.max,a=r.values,o,s=xe(e,n);if(i>0)o=Math.floor(xe(e,i));else{var l=lp(a,e,n);o=Math.floor(xe(e,l))}for(var u=s-o,c=Math.ceil(u/t),h=[],f=o;f<s+c;f=f+c)h.push(Math.pow(e,f));return i<=0&&h.unshift(0),h}function fp(r,e,t){if(t===void 0&&(t=5),r===e)return{max:e,min:r,ticks:[r]};var i=t<0?0:Math.round(t);if(i===0)return{max:e,min:r,ticks:[]};var n=1.5,a=.5+1.5*n,o=e-r,s=o/i,l=Math.pow(10,Math.floor(Math.log10(s))),u=l;2*l-s<n*(s-u)&&(u=2*l,5*l-s<a*(s-u)&&(u=5*l,10*l-s<n*(s-u)&&(u=10*l)));for(var c=Math.ceil(e/u),h=Math.floor(r/u),f=Math.max(c*u,e),v=Math.min(h*u,r),d=Math.floor((f-v)/u)+1,p=new Array(d),y=0;y<d;y++)p[y]=Ur(v+y*u);return{min:v,max:f,ticks:p}}function Cb(r){var e=r.exponent,t=r.tickCount,i=Math.ceil(Sr(e,r.max)),n=Math.floor(Sr(e,r.min)),a=fp(n,i,t).ticks;return a.map(function(o){var s=o>=0?1:-1;return Math.pow(o,e)*s})}function Mb(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 Ab(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;a<e;a++){var o=a/(e-1);n.push(Mb(i,o))}return n}function Fb(r){var e=r.min,t=r.max,i=r.tickCount,n=r.tickInterval,a=r.minLimit,o=r.maxLimit,s=fp(e,t,i).ticks;return!D(a)||!D(o)?ic(r,fe(s),It(s)):n?rc(e,t,n).ticks:s}function Tb(r){var e=r.min,t=r.max,i=r.minTickInterval,n=r.tickInterval,a=r.tickCount;if(n)a=Math.ceil((t-e)/n);else{n=tb(e,t,a)[1];var o=(t-e)/n,s=o/a;s>1&&(n=n*Math.ceil(s)),i&&n<i&&(n=i)}n=Math.max(Math.floor((t-e)/(Math.pow(2,12)-1)),n);for(var l=[],u=e;u<t+n;u+=n)l.push(u);return l}function Eb(r){var e=hp(g.__assign({showLast:!0},r));return e}function Po(r){return new Date(r).getFullYear()}function kb(r){return new Date(r,0,1).getTime()}function iu(r){return new Date(r).getMonth()}function Lb(r,e){var t=Po(r),i=Po(e),n=iu(r),a=iu(e);return(i-t)*12+(a-n)%12}function Ib(r,e){return new Date(r,e,1).getTime()}function Pb(r,e){return Math.ceil((e-r)/nr)}function Db(r,e){return Math.ceil((e-r)/oi)}function Bb(r,e){return Math.ceil((e-r)/(60*1e3))}function Ob(r){var e=r.min,t=r.max,i=r.minTickInterval,n=r.tickCount,a=r.tickInterval,o=[];a||(a=(t-e)/n,i&&a<i&&(a=i)),a=Math.max(Math.floor((t-e)/(Math.pow(2,12)-1)),a);var s=Po(e);if(a>Df)for(var l=Po(t),u=Math.ceil(a/Df),c=s;c<=l+u;c=c+u)o.push(kb(c));else if(a>Bn)for(var h=Math.ceil(a/Bn),f=iu(e),v=Lb(e,t),c=0;c<=v+h;c=c+h)o.push(Ib(s,c+f));else if(a>nr)for(var d=new Date(e),p=d.getFullYear(),y=d.getMonth(),m=d.getDate(),x=Math.ceil(a/nr),_=Pb(e,t),c=0;c<_+x;c=c+x)o.push(new Date(p,y,m+c).getTime());else if(a>oi)for(var d=new Date(e),p=d.getFullYear(),y=d.getMonth(),x=d.getDate(),w=d.getHours(),b=Math.ceil(a/oi),C=Db(e,t),c=0;c<=C+b;c=c+b)o.push(new Date(p,y,x,w+c).getTime());else if(a>ai)for(var A=Bb(e,t),F=Math.ceil(a/ai),c=0;c<=A+F;c=c+F)o.push(e+c*ai);else{var E=a;E<Ee&&(E=Ee);for(var T=Math.floor(e/Ee)*Ee,k=Math.ceil((t-e)/Ee),P=Math.ceil(E/Ee),c=0;c<k+P;c=c+P)o.push(T+c*Ee)}return o.length>=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}Ue("cat",hp);Ue("time-cat",Eb);Ue("wilkinson-extended",bb);Ue("r-pretty",Fb);Ue("time",Tb);Ue("time-pretty",Ob);Ue("log",Sb);Ue("pow",Cb);Ue("quantile",Ab);Ue("d3-linear",cb);je("cat",gs);je("category",gs);je("identity",ob);je("linear",ys);je("log",rb);je("pow",ib);je("time",nb);je("timeCat",eb);je("quantize",up);je("quantile",ab);var vp={},dp=function(r){return vp[r.toLowerCase()]},wa=function(r,e){if(dp(r))throw new Error("Attribute type '".concat(r,"' existed."));vp[r.toLowerCase()]=e};wa("Color",V_);wa("Opacity",G_);wa("Position",Y_);wa("Shape",$_);wa("Size",H_);var nc=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=g.__spreadArray([],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){ft(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 Hn(a,a,n),a},r.prototype.invertMatrix=function(e,t,i){i===void 0&&(i=0);var n=this.matrix,a=kx([0,0,0,0,0,0,0,0,0],n),o=[e,t,i];return a&&Hn(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 vn(t,t,[-i.x,-i.y]),tg(t,t,e),vn(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 vn(i,i,[-n.x,-n.y]),Lx(i,i,[e,t]),vn(i,i,[n.x,n.y]),this},r.prototype.translate=function(e,t){var i=this.matrix;return vn(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||g.__spreadArray([],this.originalMatrix)},r}(),gp=function(r){g.__extends(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}(nc),Rb=function(r){g.__extends(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=Ix([0,0],[t.x,t.y],[this.center.x,this.center.y]),o=zu(a,[1,0],!0),s=o*this.a;Ii(a)<s&&(s=Ii(a));var l=Math.floor((Ii(a)-s)/n);o=2*l*Math.PI+o;var u=this.a*o,c=Ii(a)-u;c=zt(c,0)?0:c;var h=this.invertDim(o,"x"),f=this.invertDim(c,"y");return h=zt(h,0)?0:h,f=zt(f,0)?0:f,this.isTransposed&&(i=[f,h],h=i[0],f=i[1]),{x:h,y:f}},e}(nc),Nb=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.isPolar=!0,i.type="polar";var n=t.startAngle,a=n===void 0?-Math.PI/2:n,o=t.endAngle,s=o===void 0?Math.PI*3/2: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(){for(r.prototype.initial.call(this);this.endAngle<this.startAngle;)this.endAngle+=Math.PI*2;var t=this.getOneBox(),i=t.maxX-t.minX,n=t.maxY-t.minY,a=Math.abs(t.minX)/i,o=Math.abs(t.minY)/n,s;this.height/n>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];tg(u,u,s);var c=[1,0,0];Hn(c,c,u);var h=[c[0],c[1]],f=zu(h,a,l<s);zt(f,Math.PI*2)&&(f=0);var v=Ii(a),d=f/(l-s);d=l-s>0?d:-d;var p=this.invertDim(v,"y"),y={x:0,y:0};return y.x=this.isTransposed?p:d,y.y=this.isTransposed?d:p,y},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<Math.max(t,i);o+=Math.PI/18)n.push(Math.cos(o)),a.push(Math.sin(o));return{minX:Math.min.apply(Math,n),maxX:Math.max.apply(Math,n),minY:Math.min.apply(Math,a),maxY:Math.max.apply(Math,a)}},e}(nc),pp={},zb=function(r){return pp[r.toLowerCase()]},ms=function(r,e){pp[r.toLowerCase()]=e};ms("rect",gp);ms("cartesian",gp);ms("polar",Nb);ms("helix",Rb);function yp(r,e,t){var i=new ya(e,t);i.target=r,i.propagationPath.push(r),r.emitDelegation(e,i);for(var n=r.getParent();n;)n.emitDelegation(e,i),i.propagationPath.push(n),n=n.getParent()}var mp=[1,0,0,0,1,0,0,0,1];function vi(r,e,t){if(t===void 0&&(t=mp),!e)return null;var i=kt(t,[["t",-r.x,-r.y],["r",e],["t",r.x,r.y]]);return i}function ac(r,e){return!r.x&&!r.y?null:kt(e||mp,[["t",r.x,r.y]])}function Vb(r){var e=[1,0,0],t=[0,0,0];return Hn(t,e,r),Math.atan2(t[1],t[0])}function Va(r,e){var t=[0,0];return Px(t,e,r),t}function Gb(r,e){var t=Va(r,[e.minX,e.minY]),i=Va(r,[e.maxX,e.minY]),n=Va(r,[e.minX,e.maxY]),a=Va(r,[e.maxX,e.maxY]),o=Math.min(t[0],i[0],n[0],a[0]),s=Math.max(t[0],i[0],n[0],a[0]),l=Math.min(t[1],i[1],n[1],a[1]),u=Math.max(t[1],i[1],n[1],a[1]);return{x:o,y:l,minX:o,minY:l,maxX:s,maxY:u,width:s-o,height:u-l}}function xp(r,e,t,i){if(e){var n=vi({x:t,y:i},e,r.getMatrix());r.setMatrix(n)}}function oc(r,e,t){var i=ac({x:e,y:t});r.attr("matrix",i)}function Do(r){var e=0,t=0,i=0,n=0;return tt(r)?e=t=i=n=r:O(r)&&(e=r[0],i=D(r[1])?r[0]:r[1],n=D(r[2])?r[0]:r[2],t=D(r[3])?i:r[3]),[e,i,n,t]}function sc(r){for(var e=r.childNodes,t=e.length,i=t-1;i>=0;i--)r.removeChild(e[i])}function Yb(r,e){return!!r.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function Qn(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 $b(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 xs(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 si(r,e,t){return(1-t)*r+e*t}function Ni(r,e,t){return{x:r.x+Math.cos(t)*e,y:r.y+Math.sin(t)*e}}function Hb(r,e){var t=e.x-r.x,i=e.y-r.y;return Math.sqrt(t*t+i*i)}var Bo=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)<t};function Xb(r,e){var t=Math.max(r.minX,e.minX),i=Math.max(r.minY,e.minY),n=Math.min(r.maxX,e.maxX),a=Math.min(r.maxY,e.maxY);return xs(t,i,n-t,a-i)}function wp(r){var e=r.getClip(),t=e&&e.getBBox(),i;if(!r.isGroup())i=r.getBBox();else{var n=1/0,a=-1/0,o=1/0,s=-1/0,l=r.getChildren();l.length>0?S(l,function(u){if(u.get("visible")){if(u.isGroup()&&u.get("children").length===0)return!0;var c=wp(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]),y=Math.max(h[0],f[0],v[0],d[0]),m=Math.min(h[1],f[1],v[1],d[1]),x=Math.max(h[1],f[1],v[1],d[1]);p<n&&(n=p),y>a&&(a=y),m<o&&(o=m),x>s&&(s=x)}}):(n=0,a=0,o=0,s=0),i=xs(n,o,a-n,s-o)}return t?Xb(i,t):i}function Wb(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 ee(r){return r+"px"}function _p(r,e,t,i){var n=Hb(r,e),a=i/n,o=0;return t==="start"?o=0-a:t==="end"&&(o=1+a),{x:si(r.x,e.x,o),y:si(r.y,e.y,o)}}var qb={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},bp=function(r){g.__extends(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")||{};S(t,function(a,o){var s=i.get(o),l=a;s!==a&&(pt(a)&&n[o]&&(l=Y({},n[o],a)),i.set(o,l))}),this.updateInner(t),this.afterUpdate(t)},e.prototype.updateInner=function(t){},e.prototype.afterUpdate=function(t){Ir(t,"visible")&&(t.visible?this.show():this.hide()),Ir(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=g.__assign({},t);this.update(i)},e.prototype.getLocation=function(){var t=this,i={},n=this.get("locationType"),a=qb[n];return S(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");S(i,function(n,a){var o=t.get(a);if(pt(o)){var s=Y({},n,o);t.set(a,s)}})},e}(es),Wr="update_status",Ub=["visible","tip","delegateObject"],jb=["container","group","shapesMap","isRegister","isUpdating","destroyed"],Wt=function(r){g.__extends(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 g.__assign(g.__assign({},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 S(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=Gb(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),yp(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",wp(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=g.__rest(i,["id","component"]),s=new a(g.__assign(g.__assign({},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=ac(i);t.attr("matrix",n)},e.prototype.addAnimation=function(t,i,n){var a=i.attr("opacity");D(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;S(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=Vu(v.cfg,Dx(pa(v.cfg),jb));d.update(p),h.set(Wr,"update")}else{var y=n.getReplaceAttrs(h,u);a&&o.update?n.updateAnimation(f,h,y,o.update):h.attr(y),u.isGroup()&&n.updateElements(u,h),S(Ub,function(w){h.set(w,u.get(w))}),Wb(h,u),l=h,h.set(Wr,"update")}else{i.add(u);var m=i.getChildren();if(m.splice(m.length-1,1),l){var x=m.indexOf(l);m.splice(x+1,0,u)}else m.unshift(u);if(n.registerElement(u),u.set(Wr,"add"),u.get("isComponent")){var v=u.get("component");v.set("container",i)}else u.isGroup()&&n.registerNewGroup(u);if(l=u,a){var _=n.get("isInit")?o.appear:o.enter;_&&n.addAnimation(f,u,_)}}})},e.prototype.clearUpdateStatus=function(t){var i=t.getChildren();S(i,function(n){n.set(Wr,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={}),ft(i.delegateObject,n)},e.prototype.getReplaceAttrs=function(t,i){var n=t.attr(),a=i.attr();return S(n,function(o,s){a[s]===void 0&&(a[s]=void 0)}),a},e.prototype.registerNewGroup=function(t){var i=this,n=t.getChildren();S(n,function(a){i.registerElement(a),a.set(Wr,"add"),a.isGroup()&&i.registerNewGroup(a)})},e.prototype.deleteElements=function(){var t=this,i=this.get("shapesMap"),n=[];S(i,function(s,l){!s.get(Wr)||s.destroyed?n.push([l,s]):s.set(Wr,null)});var a=this.get("animate"),o=this.get("animateOption");S(n,function(s){var l=s[0],u=s[1];if(!u.destroyed){var c=u.get("name");if(a&&o.leave){var h=ft({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}(bp),ul="…";function Zb(r){for(var e=0,t=0;t<r.length;t++)e+=jr(r,t);return e}function jr(r,e){return r.charCodeAt(e)>0&&r.charCodeAt(e)<128?1:2}function Qb(r,e,t){t===void 0&&(t="tail");var i=r.length,n="";if(t==="tail"){for(var a=0,o=0;a<e;){var s=jr(r,o);if(a+s<=e)n+=r[o],a+=jr(r,o),o++;else break}n+=ul}else if(t==="head"){for(var a=0,o=i-1;a<e;){var s=jr(r,o);if(a+s<=e)n+=r[o],a+=jr(r,o),o--;else break}n=ul+n}else{for(var l="",u="",a=0,c=0,h=i-1;a<e;){var f=jr(r,c),v=!1;f+a<=e&&(l+=r[c],c++,a+=f,v=!0);var d=jr(r,h);if(d+a<=e&&(u=r[h]+u,a+=d,h--,v=!0),!v)break}n=l+ul+u}return n}var Kb="…",Jb=2,tS=400;function eS(r){for(var e=r.map(function(l){var u=l.attr("text");return D(u)?"":""+u}),t=0,i=0,n=0;n<e.length;n+=1){for(var a=0,o=0;o<=e[n].length;o+=1){var s=e[n].charCodeAt(o);s>=19968&&s<=40869?a+=2:a+=1}a>t&&(t=a,i=n)}return r[i].getBBox().width}function nu(r){if(r.length>tS)return eS(r);var e=0;return S(r,function(t){var i=t.getBBox(),n=i.width;e<n&&(e=n)}),e}function rS(r,e){var t=e.getCanvasBBox();return r?t.width:t.height}function On(r,e,t,i){var n;i===void 0&&(i="tail");var a=(n=e.attr("text"))!==null&&n!==void 0?n:"";if(i==="tail"){var o=Vu(e.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),s=Bx(a,t,o,"…");return a!==s?(e.attr("text",s),e.set("tip",a),!0):(e.set("tip",null),!1)}var l=rS(r,e),u=Zb(a),c=!1;if(t<l){var h=Math.floor(t/l*u)-Jb,f=void 0;h>=0?f=Qb(a,h,i):f=Kb,f&&(e.attr("text",f),c=!0)}return c?e.set("tip",a):e.set("tip",null),c}function ws(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:g.__assign({x:0,y:0,text:n},a)}),y=Do(M(v,"padding",0));if(u&&c){var m=u-(y[1]+y[3]);On(!h,p,m,f)}if(v){var x=M(v,"style",{}),_=p.getCanvasBBox(),w=_.minX,b=_.minY,C=_.width,A=_.height,F=d.addShape("rect",{id:o+"-bg",name:o+"-bg",attrs:g.__assign({x:w-y[3],y:b-y[0],width:C+y[1]+y[3],height:A+y[0]+y[2]},x)});F.toBack()}oc(d,t,i),xp(d,l,t,i)}const at={fontFamily:`
  17. BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue",
  18. Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
  19. SimSun, "sans-serif"`,textColor:"#2C3542",activeTextColor:"#333333",uncheckedColor:"#D8D8D8",lineColor:"#416180",regionColor:"#CCD7EB",verticalAxisRotate:-Math.PI/4,horizontalAxisRotate:Math.PI/4,descriptionIconStroke:"#fff",descriptionIconFill:"rgba(58, 73, 101, .25)"};var iS=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"annotation",type:"line",locationType:"region",start:null,end:null,style:{},text:null,defaultCfg:{style:{fill:at.textColor,fontSize:12,textAlign:"center",textBaseline:"bottom",fontFamily:at.fontFamily},text:{position:"center",autoRotate:!0,content:null,offsetX:0,offsetY:0,style:{stroke:at.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:g.__assign({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:K(n)&&n.indexOf("%")!==-1?a=parseInt(n,10)/100:tt(n)?a=n:a=1,(a>1||a<0)&&(a=1),{x:si(t.x,i.x,a),y:si(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,y=i.isVertical,m=y===void 0?!1:y,x=this.getLabelPoint(n,a,o),_=x.x+u,w=x.y+c,b={id:this.getElementId("line-text"),name:"annotation-line-text",x:_,y:w,content:s,style:l,maxLength:f,autoEllipsis:v,ellipsisPosition:d,background:p,isVertical:m};if(h){var C=[a.x-n.x,a.y-n.y];b.rotate=Math.atan2(C[1],C[0])}ws(t,b)},e}(Wt),nS=function(r){g.__extends(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 g.__assign(g.__assign({},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:at.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:at.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"),y={id:l,name:u,x:n,y:a,content:o,style:s,maxLength:c,autoEllipsis:h,isVertical:f,ellipsisPosition:v,background:d,rotate:p};ws(t,y)},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");oc(t,n,a),xp(t,o,n,a)}},e}(Wt),aS=function(r){g.__extends(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 g.__assign(g.__assign({},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=Ni(i,n,a),l=Ni(i,n,o),u=o-a>Math.PI?1:0,c=[["M",s.x,s.y]];if(o-a===Math.PI*2){var h=Ni(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:g.__assign({path:i},n)})},e}(Wt),oS=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:at.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=Qn({start:i,end:n});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:g.__assign({x:o.x,y:o.y,width:o.width,height:o.height},a)})},e}(Wt),sS=function(r){g.__extends(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 g.__assign(g.__assign({},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=Qn({start:t,end:i}),o=this.get("src");return g.__assign({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}(Wt),lS=function(r){g.__extends(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 g.__assign(g.__assign({},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:at.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:at.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:at.fontFamily}}}})},e.prototype.renderInner=function(t){M(this.get("line"),"display")&&this.renderLine(t),M(this.get("text"),"display")&&this.renderText(t),M(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=g.__rest(i,["x","y","text"]),l=this.get("text"),u=l.background,c=l.maxLength,h=l.autoEllipsis,f=l.isVertival,v=l.ellipsisPosition,d={x:n,y:a,id:this.getElementId("text"),name:"annotation-text",content:o,style:s,background:u,maxLength:c,autoEllipsis:h,isVertival:f,ellipsisPosition:v};ws(t,d)},e.prototype.autoAdjust=function(t){var i=this.get("direction"),n=this.get("x"),a=this.get("y"),o=M(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 y=v.attr("x"),m=v.attr("y"),x=d.getCanvasBBox(),_=x.width,w=x.height,b=0,C=0;if(n+u<=s.minX)if(i==="leftward")b=1;else{var A=s.minX-(n+u);y=v.attr("x")+A}else if(n+c>=s.maxX)if(i==="rightward")b=-1;else{var A=n+c-s.maxX;y=v.attr("x")-A}if(b&&(p&&p.attr("path",[["M",0,0],["L",o*b,0]]),y=(o+2+_)*b),a+h<=s.minY)if(i==="upward")C=1;else{var A=s.minY-(a+h);m=v.attr("y")+A}else if(a+f>=s.maxY)if(i==="downward")C=-1;else{var A=a+f-s.maxY;m=v.attr("y")-A}C&&(p&&p.attr("path",[["M",0,0],["L",0,o*C]]),m=(o+2+w)*C),(y!==v.attr("x")||m!==v.attr("y"))&&oc(v,y,m)}},e.prototype.getShapeAttrs=function(){var t=M(this.get("line"),"display"),i=M(this.get("point"),"style",{}),n=M(this.get("line"),"style",{}),a=M(this.get("text"),"style",{}),o=this.get("direction"),s=t?M(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:g.__assign({x:0,y:0},i),line:g.__assign({path:[["M",0,0],["L",s*l,s*u]]},n),text:g.__assign({x:(s+2)*l,y:(s+2)*u,text:M(this.get("text"),"content",""),textBaseline:c,textAlign:h},a)}},e}(Wt),uS=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:at.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:at.textColor,fontFamily:at.fontFamily}}}})},e.prototype.renderInner=function(t){var i=M(this.get("region"),"style",{});M(this.get("text"),"style",{});var n=this.get("lineLength")||0,a=this.get("points");if(a.length){var o=$b(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:g.__assign({path:s},i)});var l=g.__assign({id:this.getElementId("text"),name:"annotation-text",x:(o.minX+o.maxX)/2,y:o.minY-n},this.get("text"));ws(t,l)}},e}(Wt),cS=function(r){g.__extends(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 g.__assign(g.__assign({},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});S(this.get("shapes"),function(l,u){var c=l.get("type"),h=he(l.attr());i.adjustShapeAttrs(h),i.addShape(o,{id:i.getElementId("shape-"+c+"-"+u),capture:!1,type:c,attrs:h})});var s=Qn({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}(Wt),hS=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"annotation",type:"shape",draw:Mr})},e.prototype.renderInner=function(t){var i=this.get("render");W(i)&&i(t)},e}(Wt),lc=function(r){g.__extends(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 g.__assign(g.__assign({},t),{container:null,containerTpl:"<div></div>",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 xs(i,n,t.clientWidth,t.clientHeight)},e.prototype.clear=function(){var t=this.get("container");sc(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(D(t)){t=this.createDom();var i=this.get("parent");K(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 K(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=Y({},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&&Yb(i,n)){var a=t[n];qt(i,a)}}},e.prototype.applyChildrenStyles=function(t,i){S(i,function(n,a){var o=t.getElementsByClassName(a);S(o,function(s){qt(s,n)})})},e.prototype.applyStyle=function(t,i){var n=this.get("domStyles");qt(i,n[t])},e.prototype.createDom=function(){var t=this.get("containerTpl");return Er(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){Ir(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},e.prototype.resetPosition=function(){},e}(bp),fS=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'<div class="g2-html-annotation" style="position:absolute"></div>',alignX:"left",alignY:"top",html:"",zIndex:7})},e.prototype.render=function(){var t=this.getContainer(),i=this.get("html");sc(t);var n=W(i)?i(t):i;if(eg(n))t.appendChild(n);else if(K(n)||tt(n)){var a=Er(""+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=Jx(t),h=Qx(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),qt(t,{position:"absolute",left:f.x+"px",top:f.y+"px",zIndex:this.get("zIndex")})},e}(lc);const vS=Object.freeze(Object.defineProperty({__proto__:null,Arc:aS,DataMarker:lS,DataRegion:uS,Html:fS,Image:sS,Line:iS,Region:oS,RegionFilter:cS,Shape:hS,Text:nS},Symbol.toStringTag,{value:"Module"}));function An(r,e,t){var i=e+"Style",n=null;return S(t,function(a,o){r[o]&&a[i]&&(n||(n={}),ft(n,a[i]))}),n}var Sp=function(r){g.__extends(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 g.__assign(g.__assign({},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:at.lineColor}},tickLine:{style:{lineWidth:1,stroke:at.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:at.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:at.textColor,fontFamily:at.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:at.textColor,textBaseline:"middle",fontFamily:at.fontFamily,textAlign:"center"},iconStyle:{fill:at.descriptionIconFill,stroke:at.descriptionIconStroke},description:""},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:at.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){ft(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 S(i,function(a,o){t[o]&&n.push(o)}),n},e.prototype.clearItemsState=function(t){var i=this,n=this.getItemsByState(t);S(n,function(a){i.setItemState(a,t,!1)})},e.prototype.getItemsByState=function(t){var i=this,n=this.getItems();return Xt(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 zt(t[0],0)?i="center":t[0]>0?i="start":t[0]<0&&(i="end"),i},e.prototype.getTextBaseline=function(t){var i;return zt(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:ft({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),S(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;s<o-1;s++)for(var l=t[s],u=t[s+1],c=0;c<a;c++){var h=(c+1)/(a+1),f=(1-h)*l.tickValue+h*u.tickValue,v=this.getTickPoint(f),d=this.getSidePoint(v,n.length);i.push({startPoint:v,endPoint:d,tickValue:f,id:"sub-"+l.id+"-"+c})}return i},e.prototype.getTickLineAttrs=function(t,i,n,a){var o=this.get(i).style,s={points:[t.startPoint,t.endPoint]},l=M(this.get("theme"),["tickLine","style"],{});o=W(o)?ft({},l,o(s,n,a)):o;var u=t.startPoint,c=t.endPoint;return g.__assign({x1:u.x,y1:u.y,x2:c.x,y2:c.y},o)},e.prototype.drawTick=function(t,i,n,a,o){this.addShape(i,{type:"line",id:this.getElementId(t.id),name:"axis-"+n,attrs:this.getTickLineAttrs(t,n,a,o)})},e.prototype.drawTickLines=function(t){var i=this,n=this.get("ticks"),a=this.get("subTickLine"),o=this.getTickLineItems(n),s=this.addGroup(t,{name:"axis-tickline-group",id:this.getElementId("tickline-group")}),l=this.get("tickLine");if(S(o,function(c,h){if(l.displayWithLabel){var f=i.getElementId("label-"+c.tickId);t.findById(f)&&i.drawTick(c,s,"tickLine",h,o)}else i.drawTick(c,s,"tickLine",h,o)}),a){var u=this.getSubTickLineItems(o);S(u,function(c,h){i.drawTick(c,s,"subTickLine",h,u)})}},e.prototype.processTicks=function(){var t=this,i=this.get("ticks");S(i,function(n){n.point=t.getTickPoint(n.value),D(n.id)&&(n.id=n.name)})},e.prototype.drawTicks=function(t){var i=this;this.optimizeTicks(),this.processTicks(),this.get("label")&&this.drawLabels(t),this.get("tickLine")&&this.drawTickLines(t);var n=this.get("ticks");S(n,function(a){i.applyTickStates(a,t)})},e.prototype.optimizeTicks=function(){var t=this.get("optimize"),i=this.get("ticks");if(t&&t.enable&&t.threshold>0){var n=Bt(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=W(d)?M(this.get("theme"),["label","style"],{}):d;var p=ft({x:h.x+s,y:h.y+l,text:v,textAlign:this.getTextAnchor(f),textBaseline:this.getTextBaseline(f)},d);return u&&(p.matrix=vi(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")});S(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=M(this.get("theme"),["label","style"],{}),l=this.get("label"),u=l.style,c=l.formatter;if(W(u)){var h=o.map(function(f){return M(f.get("delegateObject"),"tick")});S(o,function(f,v){var d=f.get("delegateObject").tick,p=c?c(d.name,d,v):d.name,y=ft({},s,u(p,v,h));f.attr(y)})}},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=ft({x:f.x,y:f.y,text:t.text},i),d=t.rotate,p=d;if(D(d)&&l){var y=this.getAxisVector(h),m=[1,0];p=zu(y,m,!0)}if(p){var x=vi(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,y=[d+f,p-f],m=y[0],x=y[1],_=[m+f,x+f],w=_[0],b=_[1],C=[m,b+f],A=C[0],F=C[1],E=[d,x+f],T=E[0],k=E[1],P=[d+f,p-u/4],B=P[0],z=P[1],X=[B,z+v],I=X[0],R=X[1],$=[I,R+v],G=$[0],V=$[1],H=[G,V+f*3/4],Z=H[0],rt=H[1];this.addShape(a,{type:"path",id:this.getElementId("title-description-icon"),name:"axis-title-description-icon",attrs:g.__assign({path:[["M",m,x],["A",f,f,0,0,1,w,b],["A",f,f,0,0,1,A,F],["A",f,f,0,0,1,T,k],["A",f,f,0,0,1,m,x],["M",B,z],["L",I,R],["M",G,V],["L",Z,rt]],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=An(t,"label",a);l&&s.attr(l)}var u=this.getElementId("tickline-"+t.id),c=i.findById(u);if(c){var h=An(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=An(t,"label",n);u&&o.attr(u)}if(l){var c=An(t,"tickLine",n);c&&l.attr(c)}}else o&&o.attr(a.style),l&&l.attr(s.style)},e}(Wt);function uc(r,e,t,i){var n=e.getChildren(),a=!1;return S(n,function(o){var s=On(r,o,t,i);a=a||s}),a}function dS(){return Cp}function gS(r,e,t){return uc(r,e,t,"head")}function Cp(r,e,t){return uc(r,e,t,"tail")}function pS(r,e,t){return uc(r,e,t,"middle")}const yS=Object.freeze(Object.defineProperty({__proto__:null,ellipsisHead:gS,ellipsisMiddle:pS,ellipsisTail:Cp,getDefault:dS},Symbol.toStringTag,{value:"Module"}));function mS(r){var e=r.attr("matrix");return e&&e[0]!==1}function Mp(r){var e=mS(r)?Vb(r.attr("matrix")):0;return e%360}function au(r,e,t,i){var n=!1,a=Mp(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));Bo(l,0,Math.PI/180)?n=s.width+i>o:n=s.height/l+i>o}else{var l=Math.abs(Math.sin(a));Bo(l,0,Math.PI/180)?n=s.width+i>o:n=s.height/l+i>o}return n}function Kn(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;c<s;c++){var h=a[c];h.getBBox();var f=au(r,u,h,n);f?(h.hide(),o=!0):u=h}return o}function Ap(r,e,t){var i=(t==null?void 0:t.minGap)||0,n=e.getChildren().slice();if(n.length<2)return!1;var a=!1,o=n[0],s=o.getBBox(),l=n[1],u=n.length,c=Mp(o),h=Math.abs(r?l.attr("y")-o.attr("y"):l.attr("x")-o.attr("x")),f=0;if(r){var v=Math.abs(Math.cos(c));if(Bo(v,0,Math.PI/180)){var d=nu(n);f=(d+i)/h}else f=(s.height/v+i)/h}else{var v=Math.abs(Math.sin(c));if(Bo(v,0,Math.PI/180)){var d=nu(n);f=(d+i)/h}else f=(s.height/v+i)/h}if(f>1){f=Math.ceil(f);for(var p=0;p<u;p++)p%f!==0&&(n[p].hide(),a=!0)}return a}function xS(){return Fp}function wS(r,e,t,i){return Kn(r,e,!1,i)}function _S(r,e,t,i){return Kn(r,e,!0,i)}function bS(r,e,t,i){var n=(i==null?void 0:i.minGap)||0,a=e.getChildren().slice();if(a.length<=2)return!1;for(var o=!1,s=a.length,l=a[0],u=a[s-1],c=l,h=1;h<s-1;h++){var f=a[h];f.getBBox();var v=au(r,c,f,n);v?(f.hide(),o=!0):c=f}var d=au(r,c,u,n);return d&&(c.hide(),o=!0),o}function Fp(r,e,t,i){var n=Ap(r,e,i);return Kn(r,e,!1)&&(n=!0),n}function SS(r,e,t,i){var n=e.getChildren().slice(),a=Ap(r,e,i);if(n.length>2){var o=n[0],s=n[n.length-1];o.get("visible")||(o.show(),Kn(r,e,!1,i)&&(a=!0)),s.get("visible")||(s.show(),Kn(r,e,!0,i)&&(a=!0))}return a}const CS=Object.freeze(Object.defineProperty({__proto__:null,equidistance:Fp,equidistanceWithReverseBoth:SS,getDefault:xS,reserveBoth:bS,reserveFirst:wS,reserveLast:_S},Symbol.toStringTag,{value:"Module"}));function MS(r,e){S(r,function(t){var i=t.attr("x"),n=t.attr("y"),a=vi({x:i,y:n},e);t.attr("matrix",a)})}function Tp(r,e,t,i){var n=e.getChildren();if(!n.length||!r&&n.length<2)return!1;var a=nu(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);MS(n,l)}return o}function AS(){return Ep}function Ep(r,e,t,i){return Tp(r,e,t,function(){return tt(i)?i:r?at.verticalAxisRotate:at.horizontalAxisRotate})}function FS(r,e,t){return Tp(r,e,t,function(i,n){if(!i)return r?at.verticalAxisRotate:at.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 TS=Object.freeze(Object.defineProperty({__proto__:null,fixedAngle:Ep,getDefault:AS,unfixedAngle:FS},Symbol.toStringTag,{value:"Module"})),kp=Object.freeze(Object.defineProperty({__proto__:null,autoEllipsis:yS,autoHide:CS,autoRotate:TS},Symbol.toStringTag,{value:"Module"}));var ES=function(r){g.__extends(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 g.__assign(g.__assign({},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 zt(t.x,i.x)},e.prototype.isHorizontal=function(){var t=this.get("start"),i=this.get("end");return zt(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=Zd([0,0],i),a=this.get("verticalFactor"),o=[n[1],n[0]*-1];return jt([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(S(v,function(y){o[y]&&i.canProcessOverlap(y)&&i.autoProcessOverlap(y,o[y],t,c)}),s&&D(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"?D(i.rotate):!0},e.prototype.autoProcessOverlap=function(t,i,n,a){var o=this,s=this.isVertical(),l=!1,u=kp[t];if(i===!0)this.get("label"),l=u.getDefault()(s,n,a);else if(W(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");S(h,function(d){var p=d.attr("textAlign");if(p==="center"){var y=f>0?"end":"start";d.attr("textAlign",y)}})}}else if(t==="autoHide"){var v=n.getChildren().slice(0);S(v,function(d){d.get("visible")||(o.get("isRegister")&&o.unregisterElement(d),d.remove())})}},e}(Sp),kS=function(r){g.__extends(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 g.__assign(g.__assign({},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=Ii(a);return jt(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"?D(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(S(h,function(v){n[v]&&i.canProcessOverlap(v)&&i.autoProcessOverlap(v,n[v],t,l)}),a&&D(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=kp[t];if(a>0)if(i===!0)s=l.getDefault()(!1,n,a);else if(W(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");S(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);S(f,function(v){v.get("visible")||(o.get("isRegister")&&o.unregisterElement(v),v.remove())})}},e}(Sp),cc=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:at.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:at.textColor,textAlign:"center",textBaseline:"middle",fontFamily:at.fontFamily}},textBackground:{padding:5,style:{stroke:at.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(!D(o)){var s=this.getTextPoint(),l=null;if(a){var u=this.getRotateAngle();l=vi(s,u)}this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:g.__assign(g.__assign(g.__assign({},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:g.__assign({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=Do(a.padding),l=a.style,u=this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:g.__assign({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}(Wt),Lp=function(r){g.__extends(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 g.__assign(g.__assign({},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 _p(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}(cc),LS=function(r){g.__extends(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 g.__assign(g.__assign({},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=Ni(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=Ni(i,n,a),h=Ni(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}(cc),Jn="g2-crosshair",ou=Jn+"-line",su=Jn+"-text",yn;const IS=(yn={},yn[""+Jn]={position:"relative"},yn[""+ou]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},yn[""+su]={position:"absolute",color:at.textColor,fontFamily:at.fontFamily},yn);var PS=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'<div class="'+Jn+'"></div>',crosshairTpl:'<div class="'+ou+'"></div>',textTpl:'<span class="'+su+'">{content}</span>',domStyles:null,containerClassName:Jn,defaultStyles:IS,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=Er(i);t.appendChild(n),this.applyStyle(ou,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 _p(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=rg(this.get("textTpl"),t);i=Er(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)?qt(t,{width:"1px",height:ee(Math.abs(n.y-i.y))}):qt(t,{height:"1px",width:ee(Math.abs(n.x-i.x))}),qt(t,{top:ee(o),left:ee(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}qt(t,{top:ee(a.y),left:ee(a.x)})}},e.prototype.updateInner=function(t){Ir(t,"text")&&this.resetText(),r.prototype.updateInner.call(this,t)},e}(lc);const Vf=Object.freeze(Object.defineProperty({__proto__:null,Base:cc,Circle:LS,Html:PS,Line:Lp},Symbol.toStringTag,{value:"Module"}));var Ip=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:at.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;S(a,function(l,u){var c=l.id||u;if(n){var h=i.getPathStyle();h=W(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:ft({path:v},h)})}if(o&&u>0){var d=i.getElementId("region-"+c),p=u%2===0;if(K(o))p&&i.drawAlternateRegion(d,t,s.points,l.points,o);else{var y=p?o[1]:o[0];i.drawAlternateRegion(d,t,s.points,l.points,y)}}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}(Wt);function DS(r,e,t,i){var n=t-r,a=i-e;return Math.sqrt(n*n+a*a)}var BS=function(r){g.__extends(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 g.__assign(g.__assign({},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=DS(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"])):S(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 S(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}(Ip),OS=function(r){g.__extends(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 g.__assign(g.__assign({},t),{type:"line"})},e.prototype.getGridPath=function(t){var i=[];return S(t,function(n,a){a===0?i.push(["M",n.x,n.y]):i.push(["L",n.x,n.y])}),i},e}(Ip),Pp=function(r){g.__extends(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 g.__assign(g.__assign({},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)),xs(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=Do(i.padding),o=g.__assign({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:g.__assign({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=Do(t.padding);i.x=n[3],i.y=n[0]}this.set("currentPoint",i)},e}(Wt),cl={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},Ga={fill:at.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:at.fontFamily,fontWeight:"normal",lineHeight:12},hl="navigation-arrow-right",fl="navigation-arrow-left",Gf={right:90*Math.PI/180,left:(360-90)*Math.PI/180,up:0,down:180*Math.PI/180},RS=function(r){g.__extends(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.currentPageIndex<t.totalPagesCnt){t.currentPageIndex+=1,t.updateNavigation();var n=t.getCurrentNavigationMatrix();t.get("animate")?i.animate({matrix:n},100):i.attr({matrix:n})}},t}return e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"legend",type:"category",itemSpacing:24,itemMarginBottom:8,maxItemWidth:null,itemWidth:null,itemHeight:null,itemName:{},itemValue:null,maxWidth:null,maxHeight:null,marker:{},radio:null,items:[],itemStates:{},itemBackground:{},pageNavigator:{},defaultCfg:{title:{spacing:5,style:{fill:at.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}},background:{padding:5,style:{stroke:at.lineColor}},itemBackground:{style:{opacity:0,fill:"#fff"}},pageNavigator:cl,itemName:{spacing:16,style:Ga},marker:{spacing:8,style:{r:6,symbol:"circle"}},itemValue:{alignRight:!1,formatter:null,style:Ga,spacing:6},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:at.uncheckedColor},markerStyle:{fill:at.uncheckedColor,stroke:at.uncheckedColor}},inactive:{nameStyle:{fill:at.uncheckedColor},markerStyle:{opacity:.2}}}}})},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("items")},e.prototype.setItems=function(t){this.update({items:t})},e.prototype.updateItem=function(t,i){ft(t,i),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("item-group");t&&t.clear()},e.prototype.setItemState=function(t,i,n){t[i]=n;var a=this.getElementByLocalId("item-"+t.id);if(a){var o=this.getItems(),s=o.indexOf(t),l=this.createOffScreenGroup(),u=this.drawItem(t,s,this.getItemHeight(),l);this.updateElements(u,a),this.clearUpdateStatus(a)}},e.prototype.hasState=function(t,i){return!!t[i]},e.prototype.getItemStates=function(t){var i=this.get("itemStates"),n=[];return S(i,function(a,o){t[o]&&n.push(o)}),n},e.prototype.clearItemsState=function(t){var i=this,n=this.getItemsByState(t);S(n,function(a){i.setItemState(a,t,!1)})},e.prototype.getItemsByState=function(t){var i=this,n=this.getItems();return Xt(n,function(a){return i.hasState(a,t)})},e.prototype.drawLegendContent=function(t){this.processItems(),this.drawItems(t)},e.prototype.processItems=function(){var t=this.get("items");S(t,function(i){i.id||(i.id=i.name)})},e.prototype.drawItems=function(t){var i=this,n=this.addGroup(t,{id:this.getElementId("item-container-group"),name:"legend-item-container-group"}),a=this.addGroup(n,{id:this.getElementId("item-group"),name:"legend-item-group"}),o=this.getItemHeight(),s=this.get("itemWidth"),l=this.get("itemSpacing"),u=this.get("itemMarginBottom"),c=this.get("currentPoint"),h=c.x,f=c.y,v=this.get("layout"),d=this.get("items"),p=!1,y=0,m=this.get("maxWidth"),x=this.get("maxHeight");S(d,function(_,w){var b=i.drawItem(_,w,o,a),C=b.getBBox(),A=s||C.width;A>y&&(y=A),v==="horizontal"?(m&&m<c.x+A-h&&(p=!0,c.x=h,c.y+=o+u),i.moveElementTo(b,c),c.x+=A+l):(x&&x<c.y+o+u-f&&(p=!0,c.x+=y+l,c.y=f,y=0),i.moveElementTo(b,c),c.y+=o+u)}),p&&this.get("flipPage")&&(this.pageHeight=0,this.pageWidth=0,this.totalPagesCnt=1,this.startX=h,this.startY=f,this.adjustNavigation(t,a))},e.prototype.getItemHeight=function(){var t=this.get("itemHeight");if(!t){var i=(this.get("itemName")||{}).style;if(W(i)){var n=this.getItems();n.forEach(function(a,o){var s=g.__assign(g.__assign({},Ga),i(a,o,n)).fontSize;t<s&&(t=s)})}else i&&(t=i.fontSize)}return t},e.prototype.drawMarker=function(t,i,n,a){var o=g.__assign(g.__assign(g.__assign({x:0,y:a/2},i.style),{symbol:M(n.marker,"symbol","circle")}),M(n.marker,"style",{})),s=this.addShape(t,{type:"marker",id:this.getElementId("item-"+n.id+"-marker"),name:"legend-item-marker",attrs:o}),l=s.getBBox();s.attr("x",l.width/2);var u=s.attr(),c=u.stroke,h=u.fill;return c&&s.set("isStroke",!0),h&&s.set("isFill",!0),s},e.prototype.drawItemText=function(t,i,n,a,o,s,l){var u=n.formatter,c=n.style,h=g.__assign(g.__assign({x:s,y:o/2,text:u?u(a[i],a,l):a[i]},Ga),W(c)?c(a,l,this.getItems()):c);return this.addShape(t,{type:"text",id:this.getElementId("item-"+a.id+"-"+i),name:"legend-item-"+i,attrs:h})},e.prototype.drawRadio=function(t,i,n,a,o){var s,l,u=i.style||{},c=(s=u.r)!==null&&s!==void 0?s:a/2,h=c*3.6/8,f=[o+c,a/2-c],v=f[0],d=f[1],p=[v+c,d+c],y=p[0],m=p[1],x=[v,m+c],_=x[0],w=x[1],b=[o,d+c],C=b[0],A=b[1],F=n.showRadio,E=g.__assign(g.__assign({path:[["M",v,d],["A",c,c,0,0,1,y,m],["L",y-h,m],["L",y,m],["A",c,c,0,0,1,_,w],["L",_,w-h],["L",_,w],["A",c,c,0,0,1,C,A],["L",C+h,A],["L",C,A],["A",c,c,0,0,1,v,d],["L",v,d+h]],stroke:"#000000",fill:"#ffffff"},u),{opacity:F?(l=u==null?void 0:u.opacity)!==null&&l!==void 0?l:.45:0}),T=this.addShape(t,{type:"path",id:this.getElementId("item-"+n.id+"-radio"),name:"legend-item-radio",attrs:E});return T.set("tip",i.tip),T},e.prototype.drawItem=function(t,i,n,a){var o="item-"+t.id,s=this.addGroup(a,{name:"legend-item-container",id:this.getElementId("item-container-"+o),delegateObject:{item:t,index:i}}),l=this.addGroup(s,{name:"legend-item",id:this.getElementId(o),delegateObject:{item:t,index:i}}),u=this.get("marker"),c=this.get("itemName"),h=this.get("itemValue"),f=this.get("itemBackground"),v=this.get("radio"),d=this.getLimitItemWidth(),p=0;if(u){var y=this.drawMarker(l,u,t,n),m=u.spacing,x=M(t,["marker","spacing"]);tt(x)&&(m=x),p=y.getBBox().maxX+m}if(c){var _=this.drawItemText(l,"name",c,t,n,p,i);d&&On(!0,_,mt(d-p,0,d)),p=_.getBBox().maxX+c.spacing}if(h){var w=this.drawItemText(l,"value",h,t,n,p,i);d&&(h.alignRight?(w.attr({textAlign:"right",x:d}),On(!0,w,mt(d-p,0,d),"head")):On(!0,w,mt(d-p,0,d))),p=w.getBBox().maxX+h.spacing}if(v&&this.drawRadio(l,v,t,n,p),f){var b=l.getBBox(),C=this.addShape(l,{type:"rect",name:"legend-item-background",id:this.getElementId(o+"-background"),attrs:g.__assign({x:0,y:0,width:b.width,height:n},f.style)});C.toBack()}return this.applyItemStates(t,l),l},e.prototype.adjustNavigation=function(t,i){var n=this,a=this.startX,o=this.startY,s=this.get("layout"),l=i.findAll(function(P){return P.get("name")==="legend-item"}),u=this.get("maxWidth"),c=this.get("maxHeight"),h=this.get("itemWidth"),f=this.get("itemSpacing"),v=this.getItemHeight(),d=Y({},cl,this.get("pageNavigator")),p=this.drawNavigation(t,s,"00/00",d),y=p.getBBox(),m={x:a,y:o},x=1,_=0,w=0,b=0,C=this.get("itemMarginBottom");function A(P,B){var z=P.getBBox(),X=h||z.width,I=B.x+X+f+y.width;return I>u}if(s==="horizontal"){var F=this.get("maxRow")||1,E=v+(F===1?0:C),T=u-f-y.width-y.minX;this.pageHeight=E*F,this.pageWidth=T,S(l,function(P){var B=P.getBBox(),z=h||B.width;(_&&_<m.x+z+f||A(P,m))&&(x===1&&(_=m.x+f,n.moveElementTo(p,{x:T,y:m.y+v/2-y.height/2-y.minY})),x+=1,m.x=a,m.y+=E),n.moveElementTo(P,m),P.getParent().setClip({type:"rect",attrs:{x:m.x,y:m.y,width:z+f,height:v}}),m.x+=z+f})}else{S(l,function(P){var B=P.getBBox();B.width>w&&(w=B.width)}),b=w,w+=f,u&&(w=Math.min(u,w),b=Math.min(u,b)),this.pageWidth=w,this.pageHeight=c-Math.max(y.height,v+C);var k=Math.floor(this.pageHeight/(v+C));S(l,function(P,B){B!==0&&B%k===0&&(x+=1,m.x+=w,m.y=o),n.moveElementTo(P,m),P.getParent().setClip({type:"rect",attrs:{x:m.x,y:m.y,width:w,height:v}}),m.y+=v+C}),this.totalPagesCnt=x,this.moveElementTo(p,{x:a+b/2-y.width/2-y.minX,y:c-y.height-y.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=M(a.marker,"style",{}),u=l.size,c=u===void 0?12:u,h=g.__rest(l,["size"]),f=this.drawArrow(s,o,fl,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:g.__assign({x:o.x,y:o.y+c/2,text:n,textBaseline:"middle"},M(a.text,"style"))}),p=d.getBBox();o.x+=p.width+2;var y=this.drawArrow(s,o,hl,i==="horizontal"?"down":"right",c,h);return y.on("click",this.onNavigationAfter),s},e.prototype.updateNavigation=function(t){var i=Y({},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(fl)):this.getElementByLocalId(fl),f=t?t.findById(this.getElementId(hl)):this.getElementByLocalId(hl);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:g.__assign({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",vi({x:l+o/2,y:u+o/2},Gf[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=vi({x:n+s/2,y:a+s/2},Gf[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 ac(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");S(o,function(l){var u=l.get("name"),c=u.split("-")[2],h=An(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}(Pp),NS=1.4,Yf=.4,zS=function(r){g.__extends(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 g.__assign(g.__assign({},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:at.textColor,textBaseline:"middle",fontFamily:at.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:at.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];s<a&&(s=a),i.setValue([a,s])}),t.on("legend-handler-max:drag",function(n){var a=i.getValueByCanvasPoint(n.x,n.y),o=i.getCurrentValue(),s=o[0];s>a&&(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]+h<c.max?i.setValue([l[0]+h,l[1]+h]):i.setValue([c.max-u,c.max])),n={x:a.x,y:a.y}}}),t.on("legend-track:dragend",function(a){n=null})},e.prototype.drawLabels=function(t){this.drawLabel("min",t),this.drawLabel("max",t)},e.prototype.drawLabel=function(t,i){var n=this.get("label"),a=n.style,o=n.align,s=n.formatter,l=this.get(t),u=this.getLabelAlignAttrs(t,o),c="label-"+t;this.addShape(i,{type:"text",id:this.getElementId(c),name:"legend-label-"+t,attrs:g.__assign(g.__assign({x:0,y:0,text:W(s)?s(l):l},a),u)})},e.prototype.getLabelAlignAttrs=function(t,i){var n=this.isVertical(),a="center",o="middle";return n?(a="start",i!=="rail"?t==="min"?o="top":o="bottom":o="top"):i!=="rail"?(o="top",t==="min"?a="start":a="end"):(a="start",o="middle"),{textAlign:a,textBaseline:o}},e.prototype.getRailPath=function(t,i,n,a){var o=this.get("rail"),s=o.size,l=o.defaultLength,u=o.type,c=this.isVertical(),h=l,f=n,v=a;f||(f=c?s:h),v||(v=c?h:s);var d=[];return u==="color"?(d.push(["M",t,i]),d.push(["L",t+f,i]),d.push(["L",t+f,i+v]),d.push(["L",t,i+v]),d.push(["Z"])):(d.push(["M",t+f,i]),d.push(["L",t+f,i+v]),d.push(["L",t,i+v]),d.push(["Z"])),d},e.prototype.drawRail=function(t){var i=this.get("rail"),n=i.style;this.addShape(t,{type:"path",id:this.getElementId("rail"),name:"legend-rail",attrs:g.__assign({path:this.getRailPath(0,0)},n)})},e.prototype.getTrackColor=function(t){var i=t.length;if(!i)return null;if(i===1)return t[0];var n;this.isVertical()?n="l(90)":n="l(0)";for(var a=0;a<i;a++){var o=a/(i-1);n+=" "+o+":"+t[a]}return n},e.prototype.getTrackPath=function(t){var i=this.getRailShape(t),n=i.attr("path");return he(n)},e.prototype.getClipTrackAttrs=function(t){var i=this.getCurrentValue(),n=i[0],a=i[1],o=this.getRailBBox(t),s=this.getPointByValue(n,t),l=this.getPointByValue(a,t),u=this.isVertical(),c,h,f,v;return u?(c=o.minX,h=s.y,f=o.width,v=l.y-s.y):(c=s.x,h=o.minY,f=l.x-s.x,v=o.height),{x:c,y:h,width:f,height:v}},e.prototype.getTrackAttrs=function(t){var i=this.get("track"),n=this.get("colors"),a=this.getTrackPath(t);return ft({path:a,fill:this.getTrackColor(n)},i.style)},e.prototype.resetTrackClip=function(t){var i=t||this.get("group"),n=this.getElementId("track"),a=i.findById(n),o=a.getClip(),s=this.getClipTrackAttrs(t);o?o.attr(s):a.setClip({type:"rect",attrs:s})},e.prototype.resetTrack=function(t){var i=this.getElementId("track"),n=t.findById(i),a=this.getTrackAttrs(t);n?n.attr(a):this.addShape(t,{type:"path",id:i,draggable:this.get("slidable"),name:"legend-track",attrs:a})},e.prototype.getPointByValue=function(t,i){var n=this.getRange(),a=n.min,o=n.max,s=(t-a)/(o-a),l=this.getRailBBox(i),u=this.isVertical(),c={x:0,y:0};return u?(c.x=l.minX+l.width/2,c.y=si(l.minY,l.maxY,s)):(c.x=si(l.minX,l.maxX,s),c.y=l.minY+l.height/2),c},e.prototype.getRailShape=function(t){var i=t||this.get("group");return i.findById(this.getElementId("rail"))},e.prototype.getRailBBox=function(t){var i=this.getRailShape(t),n=i.getBBox();return n},e.prototype.getRailCanvasBBox=function(){var t=this.get("group"),i=t.findById(this.getElementId("rail")),n=i.getCanvasBBox();return n},e.prototype.isVertical=function(){return this.get("layout")==="vertical"},e.prototype.getValueByCanvasPoint=function(t,i){var n=this.getRange(),a=n.min,o=n.max,s=this.getRailCanvasBBox(),l=this.isVertical(),u=this.get("step"),c;l?c=(i-s.minY)/s.height:c=(t-s.minX)/s.width;var h=si(a,o,c);if(u){var f=Math.round((h-a)/u);h=a+f*u}return h>o&&(h=o),h<a&&(h=a),h},e.prototype.getCurrentValue=function(){var t=this.get("value");if(!t){var i=this.get("values");return i?[Math.max(Math.min.apply(Math,g.__spreadArrays(i,[this.get("max")])),this.get("min")),Math.min(Math.max.apply(Math,g.__spreadArrays(i,[this.get("min")])),this.get("max"))]:[this.get("min"),this.get("max")]}return t},e.prototype.resetHandlers=function(t){var i=this.getCurrentValue(),n=i[0],a=i[1];this.resetHandler(t,"min",n),this.resetHandler(t,"max",a)},e.prototype.getHandlerPath=function(t,i){var n=this.isVertical(),a=[],o=t.size,s=i.x,l=i.y,u=o*NS,c=o/2,h=o/6;if(n){var f=s+u*Yf;a.push(["M",s,l]),a.push(["L",f,l+c]),a.push(["L",s+u,l+c]),a.push(["L",s+u,l-c]),a.push(["L",f,l-c]),a.push(["Z"]),a.push(["M",f,l+h]),a.push(["L",s+u-2,l+h]),a.push(["M",f,l-h]),a.push(["L",s+u-2,l-h])}else{var v=l+u*Yf;a.push(["M",s,l]),a.push(["L",s-c,v]),a.push(["L",s-c,l+u]),a.push(["L",s+c,l+u]),a.push(["L",s+c,v]),a.push(["Z"]),a.push(["M",s-h,v]),a.push(["L",s-h,l+u-2]),a.push(["M",s+h,v]),a.push(["L",s+h,l+u-2])}return a},e.prototype.resetHandler=function(t,i,n){var a=this.getPointByValue(n,t),o=this.get("handler"),s=this.getHandlerPath(o,a),l=this.getElementId("handler-"+i),u=t.findById(l),c=this.isVertical();u?u.attr("path",s):this.addShape(t,{type:"path",name:"legend-handler-"+i,draggable:!0,id:l,attrs:g.__assign(g.__assign({path:s},o.style),{cursor:c?"ns-resize":"ew-resize"})})},e.prototype.fixedElements=function(t){var i=t.findById(this.getElementId("rail")),n=t.findById(this.getElementId("label-min")),a=t.findById(this.getElementId("label-max")),o=this.getDrawPoint();this.isVertical()?this.fixedVertail(n,a,i,o):this.fixedHorizontal(n,a,i,o)},e.prototype.fitRailLength=function(t,i,n,a){var o=this.isVertical(),s=o?"height":"width",l=this.get("label"),u=l.align,c=l.spacing,h=this.get("max"+xi(s));if(h){var f=u==="rail"?n[s]+t[s]+i[s]+c*2:n[s],v=f-h;v>0&&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}(Pp),hr="g2-tooltip",fr="g2-tooltip-title",ta="g2-tooltip-list",_s="g2-tooltip-list-item",bs="g2-tooltip-marker",Ss="g2-tooltip-value",Dp="g2-tooltip-name",hc="g2-tooltip-crosshair-x",fc="g2-tooltip-crosshair-y";const VS=Object.freeze(Object.defineProperty({__proto__:null,CONTAINER_CLASS:hr,CROSSHAIR_X:hc,CROSSHAIR_Y:fc,LIST_CLASS:ta,LIST_ITEM_CLASS:_s,MARKER_CLASS:bs,NAME_CLASS:Dp,TITLE_CLASS:fr,VALUE_CLASS:Ss},Symbol.toStringTag,{value:"Module"}));var ze;const GS=(ze={},ze[""+hr]={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:at.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},ze[""+fr]={marginBottom:"4px"},ze[""+ta]={margin:"0px",listStyleType:"none",padding:"0px"},ze[""+_s]={listStyleType:"none",marginBottom:"4px"},ze[""+bs]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},ze[""+Ss]={display:"inline-block",float:"right",marginLeft:"30px"},ze[""+hc]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},ze[""+fc]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},ze);function YS(r,e,t,i,n){var a={left:r<n.x,right:r+t>n.x+n.width,top:e<n.y,bottom:e+i>n.y+n.height};return a}function $S(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 HS(r,e,t,i,n,a,o){var s=$S(r,e,t,i,n,a);if(o){var l=YS(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 XS(r,e){var t=!1;return S(e,function(i){if(Ir(r,i))return t=!0,!1}),t}var WS=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'<div class="'+hr+'"><div class="'+fr+'"></div><ul class="'+ta+'"></ul></div>',itemTpl:'<li class="'+_s+`" data-index={index}>
  20. <span class="`+bs+`" style="background:{color}"></span>
  21. <span class="`+Dp+`">{name}</span>:
  22. <span class="`+Ss+`">{value}</span>
  23. </li>`,xCrosshairTpl:'<div class="'+hc+'"></div>',yCrosshairTpl:'<div class="'+fc+'"></div>',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:hr,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:GS})},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),qt(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},e.prototype.hide=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!1),qt(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&&qt(n,{display:i}),a&&qt(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():(XS(t,["title","showTitle"])&&this.resetTitle(),Ir(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=Qn(u));var p=HS(t,i,n,f,v,l,d);qt(c,{left:ee(p.x+o),top:ee(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"));eg(n)?t=n:t=Er(n)}return t},e.prototype.cacheDoms=function(){var t=this.getContainer(),i=t.getElementsByClassName(fr)[0],n=t.getElementsByClassName(ta)[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=Qn(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"?qt(n,{left:ee(a),top:ee(i.y),height:ee(i.height)}):qt(n,{top:ee(a),left:ee(i.x),width:ee(i.width)})},e.prototype.checkCrosshair=function(t){var i=t+"CrosshairDom",n=t+"CrosshairTpl",a="CROSSHAIR_"+t.toUpperCase(),o=VS[a],s=this.get(i),l=this.get("parent");return s||(s=Er(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&&(S(t,function(a){var o=kr.toCSSGradient(a.color),s=g.__assign(g.__assign({},a),{color:o}),l=rg(i,s),u=Er(l);n.appendChild(u)}),this.applyChildrenStyles(n,this.get("domStyles")))},e.prototype.clearItemDoms=function(){this.get("listDom")&&sc(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}(lc),qS={opacity:0},US={stroke:"#C5C5C5",strokeOpacity:.85},jS={fill:"#CACED4",opacity:.85};function ZS(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;v<d;v+=1){var p=r[v];l=Rt([0,0],l,p),u=Nt([0,0],u,p)}}for(var v=0,y=r.length;v<y;v+=1){var p=r[v];if(v===0&&!t)f=p;else if(v===y-1&&!t)h=p,n.push(f),n.push(h);else{var m=[v?v-1:y-1,v-1][t?0:1];o=r[m],s=r[t?(v+1)%y:v+1];var x=[0,0];x=ii(x,s,o),x=jt(x,x,e);var _=Yi(p,o),w=Yi(p,s),b=_+w;b!==0&&(_/=b,w/=b);var C=jt([0,0],x,-_),A=jt([0,0],x,w);h=Ye([0,0],p,C),c=Ye([0,0],p,A),c=Rt([0,0],c,Nt([0,0],s,p)),c=Nt([0,0],c,Rt([0,0],s,p)),C=ii([0,0],c,p),C=jt([0,0],C,-_/w),h=Ye([0,0],p,C),h=Rt([0,0],h,Nt([0,0],o,p)),h=Nt([0,0],h,Rt([0,0],o,p)),A=ii([0,0],p,h),A=jt([0,0],A,w/_),c=Ye([0,0],p,A),a&&(h=Nt([0,0],h,l),h=Rt([0,0],h,u),c=Nt([0,0],c,l),c=Rt([0,0],c,u)),n.push(f),n.push(h),f=c}}return t&&n.push(n.shift()),n}function QS(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=[[0,0],[1,1]]);for(var i=!!e,n=[],a=0,o=r.length;a<o;a+=2)n.push([r[a],r[a+1]]);for(var s=ZS(n,.4,i,t),l=n.length,u=[],c,h,f,a=0;a<l-1;a+=1)c=s[a*2],h=s[a*2+1],f=n[a+1],u.push(["C",c[0],c[1],h[0],h[1],f[0],f[1]]);return i&&(c=s[l],h=s[l+1],f=n[0],u.push(["C",c[0],c[1],h[0],h[1],f[0],f[1]])),u}function KS(r){return xt(r,function(e,t){var i=t===0?"M":"L",n=e[0],a=e[1];return[i,n,a]})}function Bp(r){return KS(r)}function JS(r){if(r.length<=2)return Bp(r);var e=[];S(r,function(o){Lt(o,e.slice(e.length-2))||e.push(o[0],o[1])});var t=QS(e,!1),i=fe(r),n=i[0],a=i[1];return t.unshift(["M",n,a]),t}function tC(r,e,t,i){i===void 0&&(i=!0);var n=new ys({values:r}),a=new gs({values:xt(r,function(s,l){return l})}),o=xt(r,function(s,l){return[a.scale(l)*e,t-n.scale(s)*t]});return i?JS(o):Bp(o)}function eC(r,e){var t=new ys({values:r}),i=t.max<0?t.max:Math.max(0,t.min);return e-t.scale(i)*e}function rC(r,e,t,i){var n=g.__spreadArrays(r),a=eC(i,t);return n.push(["L",e,a]),n.push(["L",0,a]),n.push(["Z"]),n}var iC=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:qS,lineStyle:US,areaStyle:jS})},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:g.__assign({x:0,y:0,width:n,height:a},u)});var f=tC(o,n,a,s);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:g.__assign({path:f},c)}),l){var v=rC(f,n,a,o);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:g.__assign({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}(Wt),Op={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},$f=function(r){g.__extends(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 g.__assign(g.__assign({},t),{name:"handler",x:0,y:0,width:10,height:24,style:Op})},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}(Wt),nC={fill:"#416180",opacity:.05},aC={fill:"#5B8FF9",opacity:.15,cursor:"move"},go=10,oC={width:go,height:24},sC={textBaseline:"middle",fill:"#000",opacity:.45},lC="sliderchange",uC=function(r){g.__extends(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=M(a,"touches.0.pageX",a.pageX),t.prevY=M(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=M(i,"touches.0.pageX",i.pageX),s=M(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(lC,[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=mt(n,t,i),s=mt(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(O(t)&&t.length===2){var n=[this.get("start"),this.get("end")];this.update({start:mt(t[0],i.min,i.max),end:mt(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 g.__assign(g.__assign({},t),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:nC,foregroundStyle:aC,handlerStyle:oC,textStyle:sC}})},e.prototype.update=function(t){var i=t.start,n=t.end,a=g.__assign({},t);D(i)||(a.start=mt(i,0,1)),D(n)||(a.end=mt(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",mt(this.get("start"),0,1)),this.set("end",mt(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,y=Y({},Op,this.cfg.handlerStyle);Bt(M(s,"data"))&&(this.trend=this.addComponent(t,g.__assign({component:iC,id:this.getElementId("trend"),x:0,y:0,width:n,height:a},s))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:g.__assign({x:0,y:0,width:n,height:a},h)}),this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:g.__assign({y:a/2,textAlign:"right",text:l,silent:!1},p)}),this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:g.__assign({y:a/2,textAlign:"left",text:u,silent:!1},p)}),this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:g.__assign({y:0,height:a},v)});var m=M(y,"width",go),x=M(y,"height",24);this.minHandler=this.addComponent(t,{component:$f,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(a-x)/2,width:m,height:x,cursor:"ew-resize",style:y}),this.maxHandler=this.addComponent(t,{component:$f,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(a-x)/2,width:m,height:x,cursor:"ew-resize",style:y})},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=M(h,"width",go);i.attr("text",u),n.attr("text",c);var y=this._dodgeText([v,d],i,n),m=y[0],x=y[1];this.minHandler&&(this.minHandler.update({x:v-p/2}),this.get("updateAutoRender")||this.minHandler.render()),S(m,function(_,w){return i.attr(w,_)}),this.maxHandler&&(this.maxHandler.update({x:d-p/2}),this.get("updateAutoRender")||this.maxHandler.render()),S(x,function(_,w){return n.attr(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=M(l,"width",go),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(),y=n.getBBox(),m=p.width>f-c?{x:f+h/2+c,textAlign:"left"}:{x:f-h/2-c,textAlign:"right"},x=y.width>u-v-c?{x:v-h/2-c,textAlign:"right"}:{x:v+h/2+c,textAlign:"left"};return d?[x,m]:[m,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}(Wt),cC={trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},vl={default:cC,hover:{thumbColor:"rgba(0,0,0,0.2)"}},hC=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.clearEvents=Mr,t.onStartEvent=function(i){return function(n){t.isMobile=i,n.originalEvent.preventDefault();var a=i?M(n.originalEvent,"touches.0.clientX"):n.clientX,o=i?M(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=[Mi(i,"touchmove",t.onMouseMove),Mi(i,"touchend",t.onMouseUp),Mi(i,"touchcancel",t.onMouseUp)]:n=[Mi(i,"mousemove",t.onMouseMove),Mi(i,"mouseup",t.onMouseUp),Mi(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?M(i,"touches.0.clientX"):i.clientX,l=t.isMobile?M(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=mt(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"))*mt(t,i.min,i.max)}),this.delegateEmit("valuechange",{originalValue:n,value:this.getValue()})},e.prototype.getValue=function(){return mt(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},e.prototype.getDefaultCfg=function(){var t=r.prototype.getDefaultCfg.call(this);return g.__assign(g.__assign({},t),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:vl})},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=Y({},vl,o).default,l=s.lineCap,u=s.trackColor,c=s.size,h=M(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=Y({},vl,o).default,l=s.size,u=s.lineCap,c=s.thumbColor,h=M(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+n<n&&(o=0),o},e.prototype.draw=function(){var t=this.get("container"),i=t&&t.get("canvas");i&&i.draw()},e.prototype.updateThumbOffset=function(t){var i=this.cfg,n=i.thumbOffset,a=i.isHorizontal,o=i.thumbLen,s=i.size,l=this.validateRange(t);if(l!==n){var u=this.getElementByLocalId("thumb");a?u.attr({x1:l+s/2,x2:l+o-s/2}):u.attr({y1:l+s/2,y2:l+o-s/2}),this.emitOffsetChange(l)}},e.prototype.emitOffsetChange=function(t){var i=this.cfg,n=i.thumbOffset,a=i.trackLen,o=i.thumbLen;this.cfg.thumbOffset=t,this.emit("scrollchange",{thumbOffset:t,ratio:mt(t/(a-o),0,1)}),this.delegateEmit("valuechange",{originalValue:n,value:t})},e}(Wt),fC=ES,vC=kS,dC=OS,gC=BS,Hf=RS,pC=zS,Cs=WS;function yC(r){if(oe(r))return null;var e=r[0].x,t=r[0].x,i=r[0].y,n=r[0].y;return S(r,function(a){e=e>a.x?a.x:e,t=t<a.x?a.x:t,i=i>a.y?a.y:i,n=n<a.y?a.y:n}),{minX:e,maxX:t,minY:i,maxY:n,centerX:(e+t)/2,centerY:(i+n)/2}}function Xf(r){return Array.from(new Set(r)).length===1}function Wf(r){return(Pe(r)+Se(r))/2}function Tt(r,e,t,i){return{x:r+t*Math.cos(i),y:e+t*Math.sin(i)}}function Lr(r,e,t,i,n,a){a===void 0&&(a=0);var o=Tt(r,e,t,i),s=Tt(r,e,t,n),l=Tt(r,e,a,i),u=Tt(r,e,a,n);if(n-i===Math.PI*2){var c=Tt(r,e,t,i+Math.PI),h=Tt(r,e,a,i+Math.PI),f=[["M",o.x,o.y],["A",t,t,0,1,1,c.x,c.y],["A",t,t,0,1,1,s.x,s.y],["M",l.x,l.y]];return a&&(f.push(["A",a,a,0,1,0,h.x,h.y]),f.push(["A",a,a,0,1,0,u.x,u.y])),f.push(["M",o.x,o.y]),f.push(["Z"]),f}var v=n-i<=Math.PI?0:1,d=[["M",o.x,o.y],["A",t,t,0,v,1,s.x,s.y],["L",u.x,u.y]];return a&&d.push(["A",a,a,0,v,0,l.x,l.y]),d.push(["L",o.x,o.y]),d.push(["Z"]),d}function Rp(r,e,t,i,n){var a=Tt(r,e,t,i),o=Tt(r,e,t,n);if(zt(n-i,Math.PI*2)){var s=Tt(r,e,t,i+Math.PI);return[["M",a.x,a.y],["A",t,t,0,1,1,s.x,s.y],["A",t,t,0,1,1,a.x,a.y],["A",t,t,0,1,0,s.x,s.y],["A",t,t,0,1,0,a.x,a.y],["Z"]]}var l=n-i<=Math.PI?0:1;return[["M",a.x,a.y],["A",t,t,0,l,1,o.x,o.y]]}function ea(r,e){var t=r.points,i=yC(t),n,a,o=e.startAngle,s=e.endAngle,l=s-o;return e.isTransposed?(n=i.maxY*l,a=i.minY*l):(n=i.maxX*l,a=i.minX*l),n+=o,a+=o,{startAngle:a,endAngle:n}}function mC(r,e){if(tt(r)&&tt(e))return[r,e];if(r=r,e=e,Xf(r)||Xf(e))return[Wf(r),Wf(e)];for(var t=-1,i=0,n=0,a,o=r.length-1,s,l=0;++t<r.length;)a=o,o=t,l+=s=r[a]*e[o]-r[o]*e[a],i+=(r[a]+r[o])*s,n+=(e[a]+e[o])*s;return l*=3,[i/l,n/l]}function Np(r,e){var t=r.attr(),i=e.attr();return S(t,function(n,a){i[a]===void 0&&(i[a]=void 0)}),i}function Bi(r,e,t){var i=Math.min(e,t),n=Math.max(e,t);return r>=i&&r<=n}function xC(r,e,t){if(K(r))return r.padEnd(e,t);if(O(r)){var i=r.length;if(i<e)for(var n=e-i,a=0;a<n;a++)r.push(t)}return r}function re(r,e){return typeof r=="object"&&e.forEach(function(t){delete r[t]}),r}function Cr(r,e,t){var i,n;e===void 0&&(e=[]),t===void 0&&(t=new Map);try{for(var a=g.__values(r),o=a.next();!o.done;o=a.next()){var s=o.value;t.has(s)||(e.push(s),t.set(s,!0))}}catch(l){i={error:l}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return e}var Qt=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.x=e,this.y=t,this.height=n,this.width=i}return r.fromRange=function(e,t,i,n){return new r(e,t,i-e,n-t)},r.fromObject=function(e){return new r(e.minX,e.minY,e.width,e.height)},Object.defineProperty(r.prototype,"minX",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxX",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minY",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxY",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tl",{get:function(){return{x:this.x,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tr",{get:function(){return{x:this.maxX,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bl",{get:function(){return{x:this.x,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"br",{get:function(){return{x:this.maxX,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"top",{get:function(){return{x:this.x+this.width/2,y:this.minY}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"right",{get:function(){return{x:this.maxX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"bottom",{get:function(){return{x:this.x+this.width/2,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"left",{get:function(){return{x:this.minX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),r.prototype.isEqual=function(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height},r.prototype.contains=function(e){return e.minX>=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;t<arguments.length;t++)e[t]=arguments[t];var i=this.clone();return S(e,function(n){i.x=Math.min(n.x,i.x),i.y=Math.min(n.y,i.y),i.width=Math.max(n.maxX,i.maxX)-i.x,i.height=Math.max(n.maxY,i.maxY)-i.y}),i},r.prototype.merge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.clone();return S(e,function(n){i.x=Math.max(n.x,i.x),i.y=Math.max(n.y,i.y),i.width=Math.min(n.maxX,i.maxX)-i.x,i.height=Math.min(n.maxY,i.maxY)-i.y}),i},r.prototype.cut=function(e,t){var i=e.width,n=e.height;switch(t){case N.TOP:case N.TOP_LEFT:case N.TOP_RIGHT:return r.fromRange(this.minX,this.minY+n,this.maxX,this.maxY);case N.RIGHT:case N.RIGHT_TOP:case N.RIGHT_BOTTOM:return r.fromRange(this.minX,this.minY,this.maxX-i,this.maxY);case N.BOTTOM:case N.BOTTOM_LEFT:case N.BOTTOM_RIGHT:return r.fromRange(this.minX,this.minY,this.maxX,this.maxY-n);case N.LEFT:case N.LEFT_TOP:case N.LEFT_BOTTOM:return r.fromRange(this.minX+i,this.minY,this.maxX,this.maxY);default:return this}},r.prototype.shrink=function(e){var t=g.__read(e,4),i=t[0],n=t[1],a=t[2],o=t[3];return new r(this.x+o,this.y+i,this.width-o-n,this.height-i-a)},r.prototype.expand=function(e){var t=g.__read(e,4),i=t[0],n=t[1],a=t[2],o=t[3];return new r(this.x-o,this.y-i,this.width+o+n,this.height+i+a)},r.prototype.exceed=function(e){return[Math.max(-this.minY+e.minY,0),Math.max(this.maxX-e.maxX,0),Math.max(this.maxY-e.maxY,0),Math.max(-this.minX+e.minX,0)]},r.prototype.collide=function(e){return this.minX<e.maxX&&this.maxX>e.minX&&this.minY<e.maxY&&this.maxY>e.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 wC(r){return[[r.minX,r.minY],[r.maxX,r.minY],[r.maxX,r.maxY],[r.minX,r.maxY]]}function _a(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 _C(r){if(r.isPolar){var e=r.startAngle,t=r.endAngle;return t-e===Math.PI*2}return!1}function Ms(r,e){var t=r.getCenter();return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function bC(r,e){var t=!1;if(r)if(r.type==="theta"){var i=r.start,n=r.end;t=Bi(e.x,i.x,n.x)&&Bi(e.y,i.y,n.y)}else{var a=r.invert(e);t=Bi(a.x,0,1)&&Bi(a.y,0,1)}return t}function Wi(r,e){var t=r.getCenter();return Math.atan2(e.y-t.y,e.x-t.x)}function vc(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:Lr(l.x,l.y,u+e,o,o)},endState:function(h){var f=(s-o)*h+o,v=Lr(l.x,l.y,u+e,o,f);return{path:v}},attrs:{path:Lr(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 SC(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 Qt.fromRange(o-e,s-e,o+n+e,s+a+e)}var CC=/^(?:(?!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 MC(r){var e="linear";return CC.test(r)?e="timeCat":K(r)&&(e="cat"),e}function zp(r,e,t,i){return e===void 0&&(e={}),e.type?e.type:r.type!=="identity"&&Pi.includes(t)&&["interval"].includes(i)||r.isCategory?"cat":r.type}function AC(r,e,t){var i=e||[];if(tt(r)||D(Ox(i,r))&&oe(t)){var n=ru("identity");return new n({field:r.toString(),values:[r]})}var a=De(i,r),o=M(t,"type",MC(a[0])),s=ru(o);return new s(g.__assign({field:r,values:a},t))}function FC(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 ra(r){return r.alias||r.field}function Vp(r,e,t){var i=r.values,n=i.length,a;if(n===1)a=[.5,1];else{var o=1,s=0;_C(e)?e.isTransposed?(o=M(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 TC(r){var e=r.values.filter(function(t){return!D(t)&&!isNaN(t)});return Math.max.apply(Math,g.__spreadArray(g.__spreadArray([],g.__read(e),!1),[D(r.max)?-1/0:r.max],!1))}function EC(r){var e,t;switch(r){case N.TOP:e={x:0,y:1},t={x:1,y:1};break;case N.RIGHT:e={x:1,y:0},t={x:1,y:1};break;case N.BOTTOM:e={x:0,y:0},t={x:1,y:0};break;case N.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 kC(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 Ya(r,e){var t={start:{x:0,y:0},end:{x:0,y:0}};r.isRect?t=EC(e):r.isPolar&&(t=kC(r));var i=t.start,n=t.end;return{start:r.convert(i),end:r.convert(n)}}function Gp(r){var e=r.start,t=r.end;return e.x===t.x}function qf(r,e){var t=r.start,i=r.end,n=Gp(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 $a(r,e){var t=M(r,["components","axis"],{});return Y({},M(t,["common"],{}),Y({},M(t,[e],{})))}function Uf(r,e,t){var i=M(r,["components","axis"],{});return Y({},M(i,["common","title"],{}),Y({},M(i,[e,"title"],{})),t)}function dl(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?Ch(o,s):Ch(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 Oo(r,e){return $i(r)?r===!1?!1:{}:M(r,[e])}function jf(r,e){return M(r,"position",e)}function Zf(r,e){return M(e,["title","text"],ra(r))}var nn=function(){function r(e,t){this.destroyed=!1,this.facets=[],this.view=e,this.cfg=Y({},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(At.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;S(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 tt(a)?a/(o===0?t:i):parseFloat(a)/100})},r.prototype.getFieldValues=function(e,t){var i=[],n={};return S(e,function(a){var o=a[t];!D(o)&&!n[o]&&(i.push(o),n[o]=!0)}),i},r.prototype.getRegion=function(e,t,i,n){var a=g.__read(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=M(n,"type","rect");if(o==="rect"&&a.length){D(i.axes)&&(i.axes={});var s=i.axes,l=g.__read(a[0].getXYFields(),2),u=l[0],c=l[1],h=Oo(s,u),f=Oo(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 Gu(e,function(i){var n=i.field,a=i.value;return!D(a)&&n?t[n]===a:!0})}},r}(),Yp={},LC=function(r){return Yp[en(r)]},an=function(r,e){Yp[en(r)]=e},yt=function(){function r(e,t){this.context=e,this.cfg=t,e.addAction(this)}return r.prototype.applyCfg=function(e){ft(this,e)},r.prototype.init=function(){this.applyCfg(this.cfg)},r.prototype.destroy=function(){this.context.removeAction(this),this.context=null},r}(),IC=function(r){g.__extends(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}(yt),dc={};function PC(r,e){var t=dc[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 As(r){var e=dc[r];return M(e,"ActionClass")}function q(r,e,t){dc[r]={ActionClass:e,cfg:t}}function DC(r,e){var t=new IC(e);return t.callback=r,t.name="callback",t}function BC(r,e){var t=[];if(r.length){t.push(["M",r[0].x,r[0].y]);for(var i=1,n=r.length;i<n;i+=1){var a=r[i];t.push(["L",a.x,a.y])}e&&t.push(["Z"])}return t}function lu(r,e){for(var t=[r[0]],i=1,n=r.length;i<n;i=i+2){var a=e.convert({x:r[i],y:r[i+1]});t.push(a.x,a.y)}return t}function $p(r,e){var t=e.isTransposed,i=r[1],n=r[6],a=r[7],o=e.convert({x:n,y:a}),s=t?0:1;return["A",i,i,0,0,s,o.x,o.y]}function OC(r,e,t){var i=t.isTransposed,n=t.startAngle,a=t.endAngle,o=r[0].toLowerCase()==="a"?{x:r[6],y:r[7]}:{x:r[1],y:r[2]},s={x:e[1],y:e[2]},l=[],u=i?"y":"x",c=Math.abs(s[u]-o[u])*(a-n),h=s[u]>=o[u]?1:0,f=c>Math.PI?1:0,v=t.convert(s),d=Ms(t,v);if(d>=.5)if(c===Math.PI*2){var p={x:(s.x+o.x)/2,y:(s.y+o.y)/2},y=t.convert(p);l.push(["A",d,d,0,f,h,y.x,y.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 RC(r){S(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 NC=function(r,e,t,i){var n,a=[],o=!!i,s,l,u,c,h,f,v;if(o){n=g.__read(i,2),u=n[0],c=n[1];for(var d=0,p=r.length;d<p;d++){var y=r[d];u=Rt([0,0],u,y),c=Nt([0,0],c,y)}}for(var d=0,m=r.length;d<m;d++){var y=r[d];if(d===0&&!t)v=y;else if(d===m-1&&!t)f=y,a.push(v),a.push(f);else{s=r[t?d?d-1:m-1:d-1],l=r[t?(d+1)%m:d+1];var x=[0,0];x=ii(x,l,s),x=jt(x,x,e);var _=Yi(y,s),w=Yi(y,l),b=_+w;b!==0&&(_/=b,w/=b);var C=jt([0,0],x,-_),A=jt([0,0],x,w);f=Ye([0,0],y,C),h=Ye([0,0],y,A),h=Rt([0,0],h,Nt([0,0],l,y)),h=Nt([0,0],h,Rt([0,0],l,y)),C=ii([0,0],h,y),C=jt([0,0],C,-_/w),f=Ye([0,0],y,C),f=Rt([0,0],f,Nt([0,0],s,y)),f=Nt([0,0],f,Rt([0,0],s,y)),A=ii([0,0],y,f),A=jt([0,0],A,w/_),h=Ye([0,0],y,A),o&&(f=Nt([0,0],f,u),f=Rt([0,0],f,c),h=Nt([0,0],h,u),h=Rt([0,0],h,c)),a.push(v),a.push(f),v=h}}return t&&a.push(a.shift()),a};function Hp(r,e,t){for(var i=!!e,n=[],a=0,o=r.length;a<o;a+=2)n.push([r[a],r[a+1]]);for(var s=NC(n,.4,i,t),l=n.length,u=[],c,h,f,a=0;a<l-1;a++)c=s[a*2],h=s[a*2+1],f=n[a+1],u.push(["C",c[0],c[1],h[0],h[1],f[0],f[1]]);return i&&(c=s[l],h=s[l+1],f=n[0],u.push(["C",c[0],c[1],h[0],h[1],f[0],f[1]])),u}function ba(r,e){return BC(r,e)}function Ro(r,e,t){var i=[],n=r[0],a=null;if(r.length<=2)return ba(r,e);for(var o=0,s=r.length;o<s;o++){var l=r[o];(!a||!(a.x===l.x&&a.y===l.y))&&(i.push(l.x),i.push(l.y),a=l)}var u=t||[[0,0],[1,1]],c=Hp(i,e,u);return c.unshift(["M",n.x,n.y]),c}function zC(r,e){var t=[];return S(e,function(i){var n=i[0];switch(n.toLowerCase()){case"m":case"l":case"c":t.push(lu(i,r));break;case"a":t.push($p(i,r));break;case"z":default:t.push(i);break}}),t}function VC(r,e){var t=[],i,n,a,o;return S(e,function(s,l){var u=s[0];switch(u.toLowerCase()){case"m":case"c":case"q":t.push(lu(s,r));break;case"l":i=e[l-1],n=s,a=r.isTransposed,o=a?i[i.length-2]===n[1]:i[i.length-1]===n[2],o?t=t.concat(OC(i,n,r)):t.push(lu(s,r));break;case"a":t.push($p(s,r));break;case"z":default:t.push(s);break}}),RC(t),t}var Rn=`
  24. \v\f\r   ᠎              \u2028\u2029`,GC=new RegExp("([a-z])["+Rn+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+Rn+"]*,?["+Rn+"]*)+)","ig"),YC=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+Rn+"]*,?["+Rn+"]*","ig");function $C(r){if(!r)return null;if(O(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(GC,function(i,n,a){var o=[],s=n.toLowerCase();if(a.replace(YC,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}var Qf=function(r,e,t){return r>=e&&r<=t};function HC(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;Qf(v,0,1)&&Qf(d,0,1)&&(f={x:r.x+v*o.x,y:r.y+v*o.y})}return f}var XC=1e-6;function gl(r){return Math.abs(r)<XC?0:r<0?-1:1}function WC(r,e,t){return(t[0]-r[0])*(e[1]-r[1])===(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}function Kf(r,e,t){var i=!1,n=r.length;if(n<=2)return!1;for(var a=0;a<n;a++){var o=r[a],s=r[(a+1)%n];if(WC(o,s,[e,t]))return!0;gl(o[1]-t)>0!=gl(s[1]-t)>0&&gl(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(i=!i)}return i}function Jf(r){for(var e=[],t=r.length,i=0;i<t-1;i++){var n=r[i],a=r[i+1];e.push({from:{x:n[0],y:n[1]},to:{x:a[0],y:a[1]}})}if(e.length>1){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 qC(r,e){var t=!1;return S(r,function(i){if(HC(i.from,i.to,e.from,e.to))return t=!0,!1}),t}function tv(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 UC(r,e){return!(e.minX>r.maxX||e.maxX<r.minX||e.minY>r.maxY||e.maxY<r.minY)}function jC(r,e){if(r.length<2||e.length<2)return!1;var t=tv(r),i=tv(e);if(!UC(t,i))return!1;var n=!1;if(S(e,function(l){if(Kf(r,l[0],l[1]))return n=!0,!1}),n||(S(r,function(l){if(Kf(e,l[0],l[1]))return n=!0,!1}),n))return!0;var a=Jf(r),o=Jf(e),s=!1;return S(o,function(l){if(qC(a,l))return s=!0,!1}),s}function Xp(r,e){var t=r.event,i=t.target;return qp(i,e)}function Wp(r,e){var t=r.getCanvasBBox(),i=t.width,n=t.height;return i>0&&n>0&&(i>=e||n>=e)}function qp(r,e){var t=r.getCanvasBBox();return Wp(r,e)?t:null}function Up(r,e){var t=r.event.maskShapes;return t.map(function(i){return qp(i,e)}).filter(function(i){return!!i})}function ZC(r,e){var t=r.event,i=t.target;return jp(i,e)}function jp(r,e){return Wp(r,e)?r.attr("path"):null}function QC(r,e){var t=r.event.maskShapes;return t.map(function(i){return jp(i,e)})}function Br(r){var e=r.event,t,i=e.target;return i&&(t=i.get("element")),t}function di(r){var e=r.event,t=e.target,i;return t&&(i=t.get("delegateObject")),i}function Zp(r){var e=r.event.gEvent;return!(e&&e.fromShape&&e.toShape&&e.fromShape.get("element")===e.toShape.get("element"))}function ia(r){return r&&r.component&&r.component.isList()}function Qp(r){return r&&r.component&&r.component.isSlider()}function na(r){var e=r.event,t=e.target;return t&&(t==null?void 0:t.get("name"))==="mask"||Fs(r)}function Fs(r){var e;return((e=r.event.target)===null||e===void 0?void 0:e.get("name"))==="multi-mask"}function gc(r,e){var t=r.event.target;if(Fs(r))return KC(r,e);if(t.get("type")==="path"){var i=ZC(r,e);return i?ey(r.view,i):void 0}var n=Xp(r,e);return n?Ts(r.view,n):null}function KC(r,e){var t=r.event.target;if(t.get("type")==="path"){var i=QC(r,e);return i.length>0?i.flatMap(function(a){return ey(r.view,a)}):null}var n=Up(r,e);return n.length>0?n.flatMap(function(a){return Ts(r.view,a)}):null}function Kp(r,e,t){if(Fs(r))return JC(r,e,t);var i=Xp(r,t);return i?Jp(i,r,e):null}function Jp(r,e,t){var i=e.view,n=uu(i,t,{x:r.x,y:r.y}),a=uu(i,t,{x:r.maxX,y:r.maxY}),o={minX:n.x,minY:n.y,maxX:a.x,maxY:a.y};return Ts(t,o)}function JC(r,e,t){var i=Up(r,t);return i.length>0?i.flatMap(function(n){return Jp(n,r,e)}):null}function Gt(r){var e=r.geometries,t=[];return S(e,function(i){var n=i.elements;t=t.concat(n)}),r.views&&r.views.length&&S(r.views,function(i){t=t.concat(Gt(i))}),t}function tM(r,e,t){var i=Gt(r);return i.filter(function(n){return Be(n,e)===t})}function ty(r,e){var t=r.geometries,i=[];return S(t,function(n){var a=n.getElementsBy(function(o){return o.hasState(e)});i=i.concat(a)}),i}function Be(r,e){var t=r.getModel(),i=t.data,n;return O(i)?n=i[0][e]:n=i[e],n}function eM(r,e){return!(e.minX>r.maxX||e.maxX<r.minX||e.minY>r.maxY||e.maxY<r.minY)}function Ts(r,e){var t=Gt(r),i=[];return S(t,function(n){var a=n.shape,o=a.getCanvasBBox();eM(e,o)&&i.push(n)}),i}function ev(r){var e=[];return S(r,function(t){var i=t[0];if(i!=="A")for(var n=1;n<t.length;n=n+2)e.push([t[n],t[n+1]]);else{var a=t.length;e.push([t[a-2],t[a-1]])}}),e}function ey(r,e){var t=Gt(r),i=ev(e),n=t.filter(function(a){var o=a.shape,s;if(o.get("type")==="path")s=ev(o.attr("path"));else{var l=o.getCanvasBBox();s=wC(l)}return jC(i,s)});return n}function ry(r){return r.getComponents().map(function(e){return e.component})}function pc(r,e){var t=e.x-r.x,i=e.y-r.y;return Math.sqrt(t*t+i*i)}function rM(r,e){if(r.length<=2)return ba(r,!1);var t=r[0],i=[];S(r,function(a){i.push(a.x),i.push(a.y)});var n=Hp(i,e,null);return n.unshift(["M",t.x,t.y]),n}function rv(r,e){return r.x<=e.x&&r.maxX>=e.x&&r.y<=e.y&&r.maxY>e.y}function Xe(r){var e=r.parent,t=null;return e&&(t=e.views.filter(function(i){return i!==r})),t}function iM(r,e){var t=r.getCoordinate();return t.invert(e)}function uu(r,e,t){var i=iM(r,t);return e.getCoordinate().convert(i)}function iy(r,e,t,i){var n=!1;return S(r,function(a){if(a[t]===e[t]&&a[i]===e[i])return n=!0,!1}),n}function qi(r,e){var t=r.getScaleByField(e);return!t&&r.views&&S(r.views,function(i){if(t=qi(i,e),t)return!1}),t}var nM=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<arguments.length;t++)e[t]=arguments[t];if(e.length===1)return this.cacheMap[e[0]];e.length===2&&(this.cacheMap[e[0]]=e[1])},r.prototype.getAction=function(e){return this.actions.find(function(t){return t.name===e})},r.prototype.addAction=function(e){this.actions.push(e)},r.prototype.removeAction=function(e){var t=this.actions,i=this.actions.indexOf(e);i>=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 M(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=ry(this.view),i=this.getCurrentPoint();return i?!!t.find(function(n){var a=n.getBBox();return e?n.get("name")===e&&rv(a,i):rv(a,i)}):!1},r.prototype.destroy=function(){S(this.actions.slice(),function(e){e.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},r}(),aM=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 iv(r,e,t){var i=r.split(":"),n=i[0],a=e.getAction(n)||PC(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 nv(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 ce={START:"start",SHOW_ENABLE:"showEnable",END:"end",ROLLBACK:"rollback",PROCESSING:"processing"},oM=function(r){g.__extends(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;S(this.steps,function(i,n){S(i,function(a){var o=t.getActionCallback(n,a);o&&t.bindEvent(a.trigger,o)})})},e.prototype.clearEvents=function(){var t=this;S(this.steps,function(i,n){S(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 nM(t);this.context=i;var n=this.steps;S(n,function(a){S(a,function(o){if(W(o.action))o.actionObject={action:DC(o.action,i),methodName:"execute"};else if(K(o.action))o.actionObject=iv(o.action,i,o.arg);else if(O(o.action)){var s=o.action,l=O(o.arg)?o.arg:[o.arg];o.actionObject=[],S(s,function(u,c){o.actionObject.push(iv(u,i,l[c]))})}})})},e.prototype.isAllowStep=function(t){var i=this.currentStepName,n=this.steps;if(i===t||t===ce.SHOW_ENABLE)return!0;if(t===ce.PROCESSING)return i===ce.START;if(t===ce.START)return i!==ce.PROCESSING;if(t===ce.END)return i===ce.PROCESSING||i===ce.START;if(t===ce.ROLLBACK){if(n[ce.END])return i===ce.END;if(i===ce.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!==ce.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)?(O(s)?S(s,function(h){a.event=c,nv(h)}):(a.event=c,nv(s)),n.afterExecute(t,i),i.callback&&(a.event=c,i.callback(a))):a.event=null};i.debounce?o[l]=ig(u,i.debounce.wait,i.debounce.immediate):i.throttle?o[l]=Yu(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}(aM),ny={};function sM(r){return ny[en(r)]}function J(r,e){ny[en(r)]=e}function lM(r,e,t){var i=sM(r);if(!i)return null;if(Ln(i)){var n=ft(he(i),t);return new oM(e,n)}else{var a=i;return new a(e,t)}}function uM(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 cM(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 ay(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=uM(r),n=cM(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=ea(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:kt(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:g.__assign(g.__assign({},t.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:g.__assign(g.__assign({},t.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:g.__assign(g.__assign({},t.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:g.__assign(g.__assign({},t.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:g.__assign(g.__assign({},t.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:g.__assign(g.__assign({},t.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:g.__assign(g.__assign({},t.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:g.__assign(g.__assign({},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:Y({},i.grid,{line:{type:"line"}})},radius:{title:null,grid:Y({},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(hr)]={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(fr)]={marginBottom:"12px",marginTop:"12px"},e["".concat(ta)]={margin:0,listStyleType:"none",padding:0},e["".concat(_s)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},e["".concat(bs)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},e["".concat(Ss)]={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 ut={100:"#000",95:"#0D0D0D",85:"#262626",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},Ai={100:"#FFFFFF",95:"#F2F2F2",85:"#D9D9D9",65:"#A6A6A6",45:"#737373",25:"#404040",15:"#262626",6:"#0F0F0F"},hM=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],fM=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],vM=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],oy=function(r){r===void 0&&(r={});var e=r.paletteQualitative10,t=e===void 0?hM:e,i=r.paletteQualitative20,n=i===void 0?fM: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:vM,fontFamily:`"Segoe UI", Roboto, "Helvetica Neue", Arial,
  25. "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
  26. "Noto Color Emoji"`,axisLineBorderColor:ut[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:ut[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:Ai[85],axisTickLineBorderColor:ut[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:ut[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:ut[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:ut[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:ut[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:o,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:ut[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:ut[100],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:ut[100],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:ut[45],legendPageNavigatorTextFontSize:12,sliderRailFillColor:ut[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:ut[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:ut[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:ut[25],annotationArcBorderColor:ut[15],annotationArcBorder:1,annotationLineBorderColor:ut[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:ut[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:ut[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:ut[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:ut[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:ut[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:Ai[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:ut[65],overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:Ai[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:ut[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:Ai[100],pointBorderOpacity:1,pointActiveBorderColor:ut[100],pointSelectedBorder:2,pointSelectedBorderColor:ut[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:o,hollowPointBorderOpacity:.95,hollowPointFillColor:Ai[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:ut[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:ut[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:ut[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:ut[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:o,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:ut[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:ut[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:o,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:Ai[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:ut[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:ut[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return g.__assign(g.__assign({},s),r)};oy();function No(r){var e=r.styleSheet,t=e===void 0?{}:e,i=g.__rest(r,["styleSheet"]),n=oy(t);return Y({},ay(n),i)}var dM=No({}),cu={default:dM};function Nn(r){return M(cu,en(r),cu.default)}function gM(r,e){cu[en(r)]=No(e)}function av(r,e,t){var i=t.translate(r),n=t.translate(e);return zt(i,n)}function pM(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 ov(r,e,t){var i=t.coordinate,n=t.getYScale(),a=n.field,o=i.invert(e),s=n.invert(o.y),l=Le(r,function(u){var c=u[gt];return c[a][0]<=s&&c[a][1]>=s});return l||r[r.length-1]}var yM=ga(function(r){if(r.isCategory)return 1;for(var e=r.values,t=e.length,i=r.translate(e[0]),n=i,a=0;a<t;a++){var o=e[a],s=r.translate(o);s<i&&(i=s),s>n&&(n=s)}return(n-i)/(t-1)});function mM(r,e,t){var i=e.getAttribute("position"),n=i.getFields(),a=e.scales,o=W(t)||!t?n[0]:t,s=a[o],l=s?s.getText(r[o]):r[o]||o;return W(t)?t(l,r):l}function xM(r){var e=$u(r.attributes);return Xt(e,function(t){return Ei(Pi,t.type)})}function sy(r){var e,t,i=xM(r),n;try{for(var a=g.__values(i),o=a.next();!o.done;o=a.next()){var s=o.value,l=s.getScale(s.type);if(l&&l.isLinear){var u=M(r.scaleDefs,l.field),c=zp(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 wM(r,e){var t=e.field,i=r[t];if(O(i)){var n=i.map(function(a){return e.getText(a)});return n.join("-")}return e.getText(i)}function _M(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=sy(e);return ra(a)}function ly(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<e.length;d++){var p=e[d],y=p[gt],m=Math.pow(y[o]-h,2)+Math.pow(y[s]-f,2);m<v&&(v=m,l=p)}return l}var x=e[0],_=e[e.length-1],w=pM(r,t),b=x[gt][o],C=x[gt][s],A=_[gt][o],F=a.isLinear&&O(C);if(O(b)){for(var d=0;d<e.length;d++){var E=e[d],y=E[gt];if(n.translate(y[o][0])<=w&&n.translate(y[o][1])>=w)if(F)O(l)||(l=[]),l.push(E);else{l=E;break}}O(l)&&(l=ov(l,r,t))}else{var T=void 0;if(!n.isLinear&&n.type!=="timeCat"){for(var d=0;d<e.length;d++){var E=e[d],y=E[gt];if(av(y[o],w,n))if(F)O(l)||(l=[]),l.push(E);else{l=E;break}else n.translate(y[o])<=w&&(_=E,T=e[d+1])}O(l)&&(l=ov(l,r,t))}else{if((w>n.translate(A)||w<n.translate(b))&&(w>n.max||w<n.min))return null;for(var k=0,P=e.length-1,B=void 0;k<=P;){B=Math.floor((k+P)/2);var z=e[B][gt][o];if(av(z,w,n))return e[B];n.translate(z)<=n.translate(w)?(k=B+1,_=e[B],T=e[B+1]):(P===0&&(_=e[0]),P=B-1)}}_&&T&&Math.abs(n.translate(_[gt][o])-w)>Math.abs(n.translate(T[gt][o])-w)&&(_=T)}var X=yM(t.getXScale());return!l&&Math.abs(n.translate(_[gt][o])-w)<=X/2&&(l=_),l}function yc(r,e,t,i){var n,a;t===void 0&&(t=""),i===void 0&&(i=!1);var o=r[gt],s=mM(o,e,t),l=e.tooltipOption,u=e.theme.defaultColor,c=[],h,f;function v(E,T){if(i||!D(T)&&T!==""){var k={title:s,data:o,mappingData:r,name:E,value:T,color:r.color||u,marker:!0};c.push(k)}}if(pt(l)){var d=l.fields,p=l.callback;if(p){var y=d.map(function(E){return r[gt][E]}),m=p.apply(void 0,g.__spreadArray([],g.__read(y),!1)),x=g.__assign({data:r[gt],mappingData:r,title:s,color:r.color||u,marker:!0},m);c.push(x)}else{var _=e.scales;try{for(var w=g.__values(d),b=w.next();!b.done;b=w.next()){var C=b.value;if(!D(o[C])){var A=_[C];h=ra(A),f=A.getText(o[C]),v(h,f)}}}catch(E){n={error:E}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(n)throw n.error}}}}else{var F=sy(e);f=wM(o,F),h=_M(o,e),v(h,f)}return c}function sv(r,e,t,i){var n,a,o=i.showNil,s=[],l=r.dataArray;if(!oe(l)){r.sort(l);try{for(var u=g.__values(l),c=u.next();!c.done;c=u.next()){var h=c.value,f=ly(e,h,r);if(f){var v=r.getElementId(f),d=r.elementsMap[v];if(r.type==="heatmap"||d.visible){var p=yc(f,r,t,o);p.length&&s.push(p)}}}}catch(y){n={error:y}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}}return s}function lv(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=yc(l,r,t,n);u.length&&a.push(u)}return a}function hu(r,e,t){var i,n,a=[],o=r.geometries,s=t.shared,l=t.title,u=t.reversed;try{for(var c=g.__values(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=lv(f,e,l,t):["area","line","path","heatmap"].includes(v)||s!==!1?d=sv(f,e,l,t):d=lv(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 bM(r,e,t){var i,n,a=hu(r,e,t);try{for(var o=g.__values(r.views),s=o.next();!s.done;s=o.next()){var l=s.value;a=a.concat(hu(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 SM(r){return!tt(r)&&!O(r)}function mc(r){r===void 0&&(r=0);var e=O(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=g.__spreadArray(g.__spreadArray([],g.__read(e),!1),g.__read(e),!1);break;case 3:e=g.__spreadArray(g.__spreadArray([],g.__read(e),!1),[e[1]],!1);break;default:e=e.slice(0,4);break}return e}var xc={};function wi(r,e){xc[r]=e}function CM(){return Object.keys(xc)}function MM(r){return xc[r]}var AM=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 Qo(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=g.__assign({start:e,end:t},a),l=zb(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 g.__assign({type:"rect",actions:[],cfg:{}},e)},r.prototype.execActions=function(e){var t=this,i=this.option.actions;S(i,function(n){var a,o=g.__read(n),s=o[0],l=o.slice(1),u=D(e)?!0:e.includes(s);u&&(a=t.coordinate)[s].apply(a,g.__spreadArray([],g.__read(l),!1))})},r}(),bt=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 ya(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 FM(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 TM=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=Y(l,o.scaleDef,i)}var u=AC(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=[];S(n,function(u){var c=i.getScale(u);s=tt(c.max)?Math.max(s,c.max):s,o=tt(c.min)?Math.min(o,c.min):o,S(c.values,function(h){l.includes(h)||l.push(h)})}),S(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&&!M(f,["scaleDef","range"])&&(h=Vp(Y({},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?(FC(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=It(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=M(i,["sync"]);return a===!0?n:a===!1?void 0:a},r.prototype.getScaleMeta=function(e){return this.scales.get(e)},r}(),po=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=g.__read(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=g.__read(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 N.TOP:case N.TOP_LEFT:case N.TOP_RIGHT:this.top+=n;break;case N.RIGHT:case N.RIGHT_TOP:case N.RIGHT_BOTTOM:this.right+=i;break;case N.BOTTOM:case N.BOTTOM_LEFT:case N.BOTTOM_RIGHT:this.bottom+=n;break;case N.LEFT:case N.LEFT_TOP:case N.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,g.__spreadArray([void 0],g.__read(this.getPadding()),!1)))},r}();function EM(r){var e=r.padding;if(!SM(e))return new(po.bind.apply(po,g.__spreadArray([void 0],g.__read(mc(e)),!1)));var t=r.viewBBox,i=new po,n=[],a=[],o=[];return S(r.getComponents(),function(s){var l=s.type;l===Dt.AXIS?n.push(s):[Dt.LEGEND,Dt.SLIDER,Dt.SCROLLBAR].includes(l)?a.push(s):l!==Dt.GRID&&l!==Dt.TOOLTIP&&o.push(s)}),S(n,function(s){var l=s.component,u=l.getLayoutBBox(),c=new Qt(u.x,u.y,u.width,u.height),h=c.exceed(t);i.max(h)}),S(a,function(s){var l=s.component,u=s.direction,c=l.getLayoutBBox(),h=l.get("padding"),f=new Qt(c.x,c.y,c.width,c.height).expand(h);i.inc(f,u)}),S(o,function(s){var l=s.component,u=s.direction,c=l.getLayoutBBox(),h=new Qt(c.x,c.y,c.width,c.height);i.inc(h,u)}),i}function kM(r,e,t){var i=t.instance();e.forEach(function(n){n.autoPadding=i.max(n.autoPadding.getPadding())})}var uy=function(r){g.__extends(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=CM(),i.scalePool=new TM,i.layoutFunc=FM,i.isPreMouseInPlot=!1,i.isDataChanged=!1,i.isCoordinateChanged=!1,i.createdScaleKeys=new Map,i.onCanvasEvent=function(_){var w=_.name;if(!w.includes(":")){var b=i.createViewEvent(_);i.doPlotEvent(b),i.emit(w,b)}},i.onDelegateEvents=function(_){var w=_.name;if(w.includes(":")){var b=i.createViewEvent(_);i.emit(w,b)}};var n=t.id,a=n===void 0?Gr("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,y=t.options,m=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=g.__assign(g.__assign({},i.options),y),i.limitInPlot=m,i.id=a,i.syncViewPadding=x,i.themeObject=pt(p)?Y({},Nn("default"),No(p)):Nn(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(it.BEFORE_RENDER,bt.fromData(this,it.BEFORE_RENDER,i)),this.paint(t),this.emit(it.AFTER_RENDER,bt.fromData(this,it.AFTER_RENDER,i)),this.visible===!1&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this;this.emit(it.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var i=this.geometries,n=0;n<i.length;n++)i[n].clear(),i[n].container.remove(!0),i[n].labelsContainer.remove(!0);this.geometries=[];for(var a=this.controllers,n=0;n<a.length;n++)a[n].name==="annotation"?a[n].clear(!0):a[n].clear();this.createdScaleKeys.forEach(function(s,l){t.getRootView().scalePool.deleteScale(l)}),this.createdScaleKeys.clear();for(var o=this.views,n=0;n<o.length;n++)o[n].clear();this.emit(it.AFTER_CLEAR)},e.prototype.destroy=function(){this.emit(it.BEFORE_DESTROY);var t=this.interactions;S(t,function(s){s&&s.destroy()}),this.clear();for(var i=this.controllers,n=0,a=i.length;n<a;n++){var o=i[n];o.destroy()}this.backgroundGroup.remove(!0),this.middleGroup.remove(!0),this.foregroundGroup.remove(!0),r.prototype.destroy.call(this)},e.prototype.changeVisible=function(t){r.prototype.changeVisible.call(this,t);for(var i=this.geometries,n=0,a=i.length;n<a;n++){var o=i[n];o.changeVisible(t)}for(var s=this.controllers,n=0,a=s.length;n<a;n++){var l=s[n];l.changeVisible(t)}return this.foregroundGroup.set("visible",t),this.middleGroup.set("visible",t),this.backgroundGroup.set("visible",t),this.getCanvas().draw(),this},e.prototype.data=function(t){return Et(this.options,"data",t),this.isDataChanged=!0,this},e.prototype.source=function(t){return console.warn("This method will be removed at G2 V4.1. Please use chart.data() instead."),this.data(t)},e.prototype.filter=function(t,i){return W(i)?(Et(this.options,["filters",t],i),this):(!i&&M(this.options,["filters",t])&&delete this.options.filters[t],this)},e.prototype.axis=function(t,i){return $i(t)?Et(this.options,["axes"],t):Et(this.options,["axes",t],i),this},e.prototype.legend=function(t,i){return $i(t)?Et(this.options,["legends"],t):K(t)?(Et(this.options,["legends",t],i),Ln(i)&&(i!=null&&i.selected)&&Et(this.options,["filters",t],function(n){var a;return(a=i==null?void 0:i.selected[n])!==null&&a!==void 0?a:!0})):Et(this.options,["legends"],t),this},e.prototype.scale=function(t,i){var n=this;return K(t)?Et(this.options,["scales",t],i):pt(t)&&S(t,function(a,o){Et(n.options,["scales",o],a)}),this},e.prototype.tooltip=function(t){return Et(this.options,"tooltip",t),this},e.prototype.annotation=function(){return this.getController("annotation")},e.prototype.guide=function(){return console.warn("This method will be removed at G2 V4.1. Please use chart.annotation() instead."),this.annotation()},e.prototype.coordinate=function(t,i){return K(t)?Et(this.options,"coordinate",{type:t,cfg:i}):Et(this.options,"coordinate",t),this.coordinateController.update(this.options.coordinate),this.coordinateController},e.prototype.coord=function(t,i){return console.warn("This method will be removed at G2 V4.1. Please use chart.coordinate() instead."),this.coordinate(t,i)},e.prototype.facet=function(t,i){this.facetInstance&&this.facetInstance.destroy();var n=LC(t);if(!n)throw new Error("facet '".concat(t,"' is not exist!"));return this.facetInstance=new n(this,g.__assign(g.__assign({},i),{type:t})),this},e.prototype.animate=function(t){return Et(this.options,"animate",t),this},e.prototype.updateOptions=function(t){return this.clear(),ft(this.options,t),this.views.forEach(function(i){return i.destroy()}),this.views=[],this.initOptions(),this.coordinateBBox=this.viewBBox,this},e.prototype.option=function(t,i){if(e.prototype[t])throw new Error(`Can't use built in variable name "`.concat(t,'", please change another one.'));return Et(this.options,t,i),this},e.prototype.theme=function(t){return this.themeObject=pt(t)?Y({},this.themeObject,No(t)):Nn(t),this},e.prototype.interaction=function(t,i){var n=this.interactions[t];n&&n.destroy();var a=lM(t,this,i);return a&&(a.init(),this.interactions[t]=a),this},e.prototype.removeInteraction=function(t){var i=this.interactions[t];i&&(i.destroy(),this.interactions[t]=void 0)},e.prototype.changeData=function(t){this.isDataChanged=!0,this.emit(it.BEFORE_CHANGE_DATA,bt.fromData(this,it.BEFORE_CHANGE_DATA,null)),this.data(t),this.paint(!0);for(var i=this.views,n=0,a=i.length;n<a;n++){var o=i[n];o.changeData(t)}this.emit(it.AFTER_CHANGE_DATA,bt.fromData(this,it.AFTER_CHANGE_DATA,null))},e.prototype.createView=function(t){this.parent&&this.parent.parent&&console.warn("The view nesting recursive feature will be removed at G2 V4.1. Please avoid to use it.");var i={data:this.options.data,scales:he(this.options.scales),axes:he(this.options.axes),coordinate:he(this.coordinateController.getOption()),tooltip:he(this.options.tooltip),legends:he(this.options.legends),animate:this.options.animate,visible:this.visible},n=new e(g.__assign(g.__assign({parent:this,canvas:this.canvas,backgroundGroup:this.backgroundGroup.addGroup({zIndex:Oi.BG}),middleGroup:this.middleGroup.addGroup({zIndex:Oi.MID}),foregroundGroup:this.foregroundGroup.addGroup({zIndex:Oi.FORE}),theme:this.themeObject,padding:this.padding},t),{options:g.__assign(g.__assign({},i),M(t,"options",{}))}));return this.views.push(n),n},e.prototype.view=function(t){return console.warn("This method will be removed at G2 V4.1. Please use chart.createView() instead."),this.createView(t)},e.prototype.removeView=function(t){var i=Rx(this.views,function(n){return n===t})[0];return i&&i.destroy(),i},e.prototype.getCoordinate=function(){return this.coordinateInstance},e.prototype.getTheme=function(){return this.themeObject},e.prototype.getXScale=function(){var t=this.geometries[0];return t?t.getXScale():null},e.prototype.getYScales=function(){var t={},i=[];return this.geometries.forEach(function(n){var a=n.getYScale(),o=a.field;t[o]||(t[o]=!0,i.push(a))}),i},e.prototype.getScalesByDim=function(t){for(var i=this.geometries,n={},a=0,o=i.length;a<o;a++){var s=i[a],l=t==="x"?s.getXScale():s.getYScale();l&&!n[l.field]&&(n[l.field]=l)}return n},e.prototype.getScale=function(t,i){var n=i||this.getScaleKey(t);return this.getRootView().scalePool.getScale(n)},e.prototype.getScaleByField=function(t,i){return this.getScale(t,i)},e.prototype.getOptions=function(){return this.options},e.prototype.getData=function(){return this.filteredData},e.prototype.getOriginalData=function(){return this.options.data},e.prototype.getPadding=function(){return this.autoPadding.getPadding()},e.prototype.getGeometries=function(){return this.geometries},e.prototype.getElements=function(){return Zt(this.geometries,function(t,i){return t.concat(i.getElements())},[])},e.prototype.getElementsBy=function(t){return this.getElements().filter(function(i){return t(i)})},e.prototype.getLayer=function(t){return t===At.BG?this.backgroundGroup:t===At.MID?this.middleGroup:t===At.FORE?this.foregroundGroup:this.foregroundGroup},e.prototype.isPointInPlot=function(t){return bC(this.getCoordinate(),t)},e.prototype.getLegendAttributes=function(){return ve(this.geometries.map(function(t){return t.getGroupAttributes()}))},e.prototype.getGroupScales=function(){var t=this.geometries.map(function(i){return i.getGroupScales()});return Cr(ve(t))},e.prototype.getCanvas=function(){return this.getRootView().canvas},e.prototype.getRootView=function(){for(var t=this;;){if(t.parent){t=t.parent;continue}break}return t},e.prototype.getXY=function(t){var i=this.getCoordinate(),n=this.getScalesByDim("x"),a=this.getScalesByDim("y"),o,s;if(S(t,function(l,u){n[u]&&(o=n[u].scale(l)),a[u]&&(s=a[u].scale(l))}),!D(o)&&!D(s))return i.convert({x:o,y:s})},e.prototype.getController=function(t){return Le(this.controllers,function(i){return i.name===t})},e.prototype.showTooltip=function(t){var i=this.getController("tooltip");return i&&i.showTooltip(t),this},e.prototype.hideTooltip=function(){var t=this.getController("tooltip");return t&&t.hideTooltip(),this},e.prototype.lockTooltip=function(){var t=this.getController("tooltip");return t&&t.lockTooltip(),this},e.prototype.unlockTooltip=function(){var t=this.getController("tooltip");return t&&t.unlockTooltip(),this},e.prototype.isTooltipLocked=function(){var t=this.getController("tooltip");return t&&t.isTooltipLocked()},e.prototype.getTooltipItems=function(t){var i=this.getController("tooltip");return i?i.getTooltipItems(t):[]},e.prototype.getSnapRecords=function(t){for(var i=this.geometries,n=[],a=0,o=i.length;a<o;a++){var s=i[a],l=s.dataArray;s.sort(l);for(var u=void 0,c=0,h=l.length;c<h;c++){var f=l[c];u=ly(t,f,s),u&&n.push(u)}}for(var v=this.views,a=0,o=v.length;a<o;a++){var d=v[a],p=d.getSnapRecords(t);n=n.concat(p)}return n},e.prototype.getComponents=function(){for(var t=[],i=this.controllers,n=0,a=i.length;n<a;n++){var o=i[n];t=t.concat(o.getComponents())}return t},e.prototype.filterData=function(t){var i=this.options.filters;return Bt(i)===0?t:Xt(t,function(n,a){var o=Object.keys(i);return o.every(function(s){var l=i[s];return l(n[s],n,a)})})},e.prototype.filterFieldData=function(t,i){var n=this.options.filters,a=M(n,t);return Qr(a)?i:i.filter(function(o,s){return a(o[t],o,s)})},e.prototype.adjustCoordinate=function(){var t=this.getCoordinate(),i=t.start,n=t.end,a=this.coordinateBBox.bl,o=this.coordinateBBox.tr;if(Lt(i,a)&&Lt(n,o)){this.isCoordinateChanged=!1;return}this.isCoordinateChanged=!0,this.coordinateInstance=this.coordinateController.adjust(a,o)},e.prototype.paint=function(t){this.renderDataRecursive(t),this.syncScale(),this.emit(it.BEFORE_PAINT),this.renderPaddingRecursive(t),this.renderLayoutRecursive(t),this.renderBackgroundStyleShape(),this.renderPaintRecursive(t),this.emit(it.AFTER_PAINT),this.isDataChanged=!1},e.prototype.renderBackgroundStyleShape=function(){if(!this.parent){var t=M(this.themeObject,"background");if(t){this.backgroundStyleRectShape||(this.backgroundStyleRectShape=this.backgroundGroup.addShape("rect",{attrs:{},zIndex:-1,capture:!1}),this.backgroundStyleRectShape.toBack());var i=this.viewBBox,n=i.x,a=i.y,o=i.width,s=i.height;this.backgroundStyleRectShape.attr({fill:t,x:n,y:a,width:o,height:s})}else this.backgroundStyleRectShape&&(this.backgroundStyleRectShape.remove(!0),this.backgroundStyleRectShape=void 0)}},e.prototype.renderPaddingRecursive=function(t){this.calculateViewBBox(),this.adjustCoordinate(),this.initComponents(t),this.autoPadding=EM(this).shrink(mc(this.appendPadding)),this.coordinateBBox=this.viewBBox.shrink(this.autoPadding.getPadding()),this.adjustCoordinate();var i=this.controllers.find(function(l){return l.name==="tooltip"});i.update();for(var n=this.views,a=0,o=n.length;a<o;a++){var s=n[a];s.renderPaddingRecursive(t)}},e.prototype.renderLayoutRecursive=function(t){var i=this.syncViewPadding===!0?kM:W(this.syncViewPadding)?this.syncViewPadding:void 0;i&&(i(this,this.views,po),this.views.forEach(function(l){l.coordinateBBox=l.viewBBox.shrink(l.autoPadding.getPadding()),l.adjustCoordinate()})),this.doLayout();for(var n=this.views,a=0,o=n.length;a<o;a++){var s=n[a];s.renderLayoutRecursive(t)}},e.prototype.renderPaintRecursive=function(t){var i=this.middleGroup;if(this.limitInPlot){var n=vc(this.coordinateInstance),a=n.type,o=n.attrs;i.setClip({type:a,attrs:o})}else i.setClip(void 0);this.paintGeometries(t),this.renderComponents(t);for(var s=this.views,l=0,u=s.length;l<u;l++){var c=s[l];c.renderPaintRecursive(t)}},e.prototype.createScale=function(t,i,n,a){var o=M(this.options.scales,[t]),s=g.__assign(g.__assign({},o),n);return this.parent?this.parent.createScale(t,i,s,a):this.scalePool.createScale(t,i,s,a)},e.prototype.renderDataRecursive=function(t){this.doFilterData(),this.createCoordinate(),this.initGeometries(t),this.renderFacet(t);for(var i=this.views,n=0,a=i.length;n<a;n++){var o=i[n];o.renderDataRecursive(t)}},e.prototype.calculateViewBBox=function(){var t,i,n,a;if(this.parent){var o=this.parent.coordinateBBox;t=o.x,i=o.y,n=o.width,a=o.height}else t=0,i=0,n=this.canvas.get("width"),a=this.canvas.get("height");var s=this.region,l=s.start,u=s.end,c=new Qt(t+n*l.x,i+a*l.y,n*(u.x-l.x),a*(u.y-l.y));(!this.viewBBox||!this.viewBBox.isEqual(c))&&(this.viewBBox=new Qt(t+n*l.x,i+a*l.y,n*(u.x-l.x),a*(u.y-l.y))),this.coordinateBBox=this.viewBBox},e.prototype.initEvents=function(){this.foregroundGroup.on("*",this.onDelegateEvents),this.middleGroup.on("*",this.onDelegateEvents),this.backgroundGroup.on("*",this.onDelegateEvents),this.canvas.on("*",this.onCanvasEvent)},e.prototype.initComponentController=function(){for(var t=this.usedControllers,i=0,n=t.length;i<n;i++){var a=t[i],o=MM(a);o&&this.controllers.push(new o(this))}},e.prototype.createViewEvent=function(t){var i=t.shape,n=t.name,a=i?i.get("origin"):null,o=new bt(this,t,a);return o.type=n,o},e.prototype.doPlotEvent=function(t){var i=t.type,n=t.x,a=t.y,o={x:n,y:a},s=["mousedown","mouseup","mousemove","mouseleave","mousewheel","touchstart","touchmove","touchend","touchcancel","click","dblclick","contextmenu"];if(s.includes(i)){var l=this.isPointInPlot(o),u=t.clone();if(l){var c="plot:".concat(i);u.type=c,this.emit(c,u),(i==="mouseleave"||i==="touchend")&&(this.isPreMouseInPlot=!1)}i==="mousemove"||i==="touchmove"?(this.isPreMouseInPlot&&!l?(i==="mousemove"&&(u.type=Jt.MOUSE_LEAVE,this.emit(Jt.MOUSE_LEAVE,u)),u.type=Jt.LEAVE,this.emit(Jt.LEAVE,u)):!this.isPreMouseInPlot&&l&&(i==="mousemove"&&(u.type=Jt.MOUSE_ENTER,this.emit(Jt.MOUSE_ENTER,u)),u.type=Jt.ENTER,this.emit(Jt.ENTER,u)),this.isPreMouseInPlot=l):(i==="mouseleave"||i==="touchend")&&this.isPreMouseInPlot&&(i==="mouseleave"&&(u.type=Jt.MOUSE_LEAVE,this.emit(Jt.MOUSE_LEAVE,u)),u.type=Jt.LEAVE,this.emit(Jt.LEAVE,u),this.isPreMouseInPlot=!1)}},e.prototype.doFilterData=function(){var t=this.options.data;this.filteredData=this.filterData(t)},e.prototype.initGeometries=function(t){this.createOrUpdateScales();for(var i=this.getCoordinate(),n=M(this.options,"scales",{}),a=this.geometries,o=0,s=a.length;o<s;o++){var l=a[o];l.scales=this.getGeometryScales();var u={coordinate:i,scaleDefs:n,data:this.filteredData,theme:this.themeObject,isDataChanged:this.isDataChanged,isCoordinateChanged:this.isCoordinateChanged};t?l.update(u):l.init(u)}this.adjustScales()},e.prototype.createOrUpdateScales=function(){for(var t=this.getScaleFields(),i=this.getGroupedFields(),n=this.getOptions(),a=n.data,o=n.scales,s=o===void 0?{}:o,l=this.filteredData,u=0,c=t.length;u<c;u++){var h=t[u],f=s[h],v=this.getScaleKey(h);this.createScale(h,i.includes(h)?a:l,f,v),this.createdScaleKeys.set(v,!0)}},e.prototype.syncScale=function(){this.getRootView().scalePool.sync(this.getCoordinate(),this.theme)},e.prototype.getGeometryScales=function(){for(var t=this.getScaleFields(),i={},n=0;n<t.length;n++){var a=t[n];i[a]=this.getScaleByField(a)}return i},e.prototype.getScaleFields=function(){for(var t=[],i=new Map,n=this.geometries,a=0;a<n.length;a++){var o=n[a],s=o.getScaleFields();Cr(s,t,i)}return t},e.prototype.getGroupedFields=function(){for(var t=[],i=new Map,n=this.geometries,a=0;a<n.length;a++){var o=n[a],s=o.getGroupFields();Cr(s,t,i)}return t},e.prototype.adjustScales=function(){this.adjustCategoryScaleRange()},e.prototype.adjustCategoryScaleRange=function(){var t=this,i=g.__spreadArray([this.getXScale()],g.__read(this.getYScales()),!1).filter(function(o){return!!o}),n=this.getCoordinate(),a=this.options.scales;S(i,function(o){var s=o.field,l=o.values,u=o.isCategory,c=o.isIdentity;(u||c)&&l&&!M(a,[s,"range"])&&(o.range=Vp(o,n,t.theme))})},e.prototype.initComponents=function(t){for(var i=this.controllers,n=0;n<i.length;n++){var a=i[n];t?a.update():(a.clear(),a.render())}},e.prototype.doLayout=function(){this.layoutFunc(this)},e.prototype.createCoordinate=function(){var t=this.coordinateBBox.bl,i=this.coordinateBBox.tr;this.coordinateInstance=this.coordinateController.create(t,i)},e.prototype.paintGeometries=function(t){for(var i=this.options.animate,n=this.getCoordinate(),a={x:this.viewBBox.x,y:this.viewBBox.y,minX:this.viewBBox.minX,minY:this.viewBBox.minY,maxX:this.viewBBox.maxX,maxY:this.viewBBox.maxY,width:this.viewBBox.width,height:this.viewBBox.height},o=this.geometries,s=0;s<o.length;s++){var l=o[s];l.coordinate=n,l.canvasRegion=a,i||l.animate(!1),l.paint(t)}},e.prototype.renderComponents=function(t){for(var i=this.getComponents(),n=0;n<i.length;n++){var a=i[n];a.component.render()}},e.prototype.renderFacet=function(t){this.facetInstance&&(t?this.facetInstance.update():(this.facetInstance.clear(),this.facetInstance.init(),this.facetInstance.render()))},e.prototype.initOptions=function(){var t=this,i=this.options,n=i.geometries,a=n===void 0?[]:n,o=i.interactions,s=o===void 0?[]:o,l=i.views,u=l===void 0?[]:l,c=i.annotations,h=c===void 0?[]:c,f=i.coordinate,v=i.events,d=i.facets;this.coordinateController?f&&this.coordinateController.update(f):this.coordinateController=new AM(f);for(var p=0;p<a.length;p++){var y=a[p];this.createGeometry(y)}for(var m=0;m<s.length;m++){var x=s[m],_=x.type,w=x.cfg;this.interaction(_,w)}for(var b=0;b<u.length;b++){var C=u[b];this.createView(C)}for(var A=this.getController("annotation"),F=0;F<h.length;F++){var E=h[F];A.annotation(E)}v&&S(v,function(T,k){t.on(k,T)}),d&&S(d,function(T){var k=T.type,P=g.__rest(T,["type"]);t.facet(k,P)})},e.prototype.createGeometry=function(t){var i=t.type,n=t.cfg,a=n===void 0?{}:n;if(this[i]){var o=this[i](a);S(t,function(s,l){W(o[l])&&o[l](s)})}},e.prototype.getScaleKey=function(t){return"".concat(this.id,"-").concat(t)},e}(Xu);function Ze(r,e){uy.prototype[r.toLowerCase()]=function(t){t===void 0&&(t={});var i=g.__assign({container:this.middleGroup.addGroup(),labelsContainer:this.foregroundGroup.addGroup()},t),n=new e(i);return this.geometries.push(n),n}}var LM=function(r){g.__extends(e,r);function e(t){var i=this,n=t.container,a=t.width,o=t.height,s=t.autoFit,l=s===void 0?!1:s,u=t.padding,c=t.appendPadding,h=t.renderer,f=h===void 0?"canvas":h,v=t.pixelRatio,d=t.localRefresh,p=d===void 0?!0:d,y=t.visible,m=y===void 0?!0:y,x=t.supportCSSTransform,_=x===void 0?!1:x,w=t.defaultInteractions,b=w===void 0?["tooltip","legend-filter","legend-active","continuous-filter","ellipsis-text","axis-description"]:w,C=t.options,A=t.limitInPlot,F=t.theme,E=t.syncViewPadding,T=K(n)?document.getElementById(n):n,k=Er('<div style="position:relative;"></div>');T.appendChild(k);var P=Eh(T,l,a,o),B=Ux(f),z=new B.Canvas(g.__assign({container:k,pixelRatio:v,localRefresh:p,supportCSSTransform:_},P));return i=r.call(this,{parent:null,canvas:z,backgroundGroup:z.addGroup({zIndex:Oi.BG}),middleGroup:z.addGroup({zIndex:Oi.MID}),foregroundGroup:z.addGroup({zIndex:Oi.FORE}),padding:u,appendPadding:c,visible:m,options:C,limitInPlot:A,theme:F,syncViewPadding:E})||this,i.onResize=ig(function(){i.forceFit()},300),i.ele=T,i.canvas=z,i.width=P.width,i.height=P.height,i.autoFit=l,i.localRefresh=p,i.renderer=f,i.wrapperElement=k,i.updateCanvasStyle(),i.bindAutoFit(),i.initDefaultInteractions(b),i}return e.prototype.initDefaultInteractions=function(t){var i=this;S(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(it.BEFORE_CHANGE_SIZE),this.width=t,this.height=i,this.canvas.changeSize(t,i),this.render(!0),this.emit(it.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(),ew(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=Eh(this.ele,!0,this.width,this.height),i=t.width,n=t.height;this.changeSize(i,n)}},e.prototype.updateCanvasStyle=function(){qt(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}(uy),on=function(){function r(e){this.visible=!0,this.components=[],this.view=e}return r.prototype.clear=function(e){S(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 IM(r){for(var e=[],t=function(n){var a=r[n],o=Le(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;i<r.length;i++)t(i);return e}var cy=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.isLocked=!1,t}return Object.defineProperty(e.prototype,"name",{get:function(){return"tooltip"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.isVisible=function(){var t=this.view.getOptions().tooltip;return t!==!1},e.prototype.render=function(){},e.prototype.showTooltip=function(t){if(this.point=t,!!this.isVisible()){var i=this.view,n=this.getTooltipItems(t);if(!n.length){this.hideTooltip();return}var a=this.getTitle(n),o={x:n[0].x,y:n[0].y};i.emit("tooltip:show",bt.fromData(i,"tooltip:show",g.__assign({items:n,title:a},t)));var s=this.getTooltipCfg(),l=s.follow,u=s.showMarkers,c=s.showCrosshairs,h=s.showContent,f=s.marker,v=this.items,d=this.title;if(!Lt(d,a)||!Lt(v,n)?(i.emit("tooltip:change",bt.fromData(i,"tooltip:change",g.__assign({items:n,title:a},t))),(W(h)?h(n):h)&&(this.tooltip||this.renderTooltip(),this.tooltip.update(ft({},s,{items:this.getItemsAfterProcess(n),title:a},l?t:{})),this.tooltip.show()),u&&this.renderTooltipMarkers(n,f)):(this.tooltip&&l&&(this.tooltip.update(t),this.tooltip.show()),this.tooltipMarkersGroup&&this.tooltipMarkersGroup.show()),this.items=n,this.title=a,c){var p=M(s,["crosshairs","follow"],!1);this.renderCrosshairs(p?t:o,s)}}},e.prototype.hideTooltip=function(){var t=this.getTooltipCfg().follow;if(!t){this.point=null;return}var i=this.tooltipMarkersGroup;i&&i.hide();var n=this.xCrosshair,a=this.yCrosshair;n&&n.hide(),a&&a.hide();var o=this.tooltip;o&&o.hide(),this.view.emit("tooltip:hide",bt.fromData(this.view,"tooltip:hide",{})),this.point=null},e.prototype.lockTooltip=function(){this.isLocked=!0,this.tooltip&&this.tooltip.setCapture(!0)},e.prototype.unlockTooltip=function(){this.isLocked=!1;var t=this.getTooltipCfg();this.tooltip&&this.tooltip.setCapture(t.capture)},e.prototype.isTooltipLocked=function(){return this.isLocked},e.prototype.clear=function(){var t=this,i=t.tooltip,n=t.xCrosshair,a=t.yCrosshair,o=t.tooltipMarkersGroup;i&&(i.hide(),i.clear()),n&&n.clear(),a&&a.clear(),o&&o.clear(),i!=null&&i.get("customContent")&&(this.tooltip.destroy(),this.tooltip=null),this.title=null,this.items=null},e.prototype.destroy=function(){this.tooltip&&this.tooltip.destroy(),this.xCrosshair&&this.xCrosshair.destroy(),this.yCrosshair&&this.yCrosshair.destroy(),this.guideGroup&&this.guideGroup.remove(!0),this.reset()},e.prototype.reset=function(){this.items=null,this.title=null,this.tooltipMarkersGroup=null,this.tooltipCrosshairsGroup=null,this.xCrosshair=null,this.yCrosshair=null,this.tooltip=null,this.guideGroup=null,this.isLocked=!1,this.point=null},e.prototype.changeVisible=function(t){if(this.visible!==t){var i=this,n=i.tooltip,a=i.tooltipMarkersGroup,o=i.xCrosshair,s=i.yCrosshair;t?(n&&n.show(),a&&a.show(),o&&o.show(),s&&s.show()):(n&&n.hide(),a&&a.hide(),o&&o.hide(),s&&s.hide()),this.visible=t}},e.prototype.getTooltipItems=function(t){var i,n,a,o,s,l,u=this.findItemsFromView(this.view,t);if(u.length){u=ve(u);try{for(var c=g.__values(u),h=c.next();!h.done;h=c.next()){var f=h.value;try{for(var v=(a=void 0,g.__values(f)),d=v.next();!d.done;d=v.next()){var p=d.value,y=p.mappingData,m=y.x,x=y.y;p.x=O(m)?m[m.length-1]:m,p.y=O(x)?x[x.length-1]:x}}catch(T){a={error:T}}finally{try{d&&!d.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}}}catch(T){i={error:T}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}var _=this.getTooltipCfg().shared;if(_===!1&&u.length>1){var w=u[0],b=Math.abs(t.y-w[0].y);try{for(var C=g.__values(u),A=C.next();!A.done;A=C.next()){var F=A.value,E=Math.abs(t.y-F[0].y);E<=b&&(w=F,b=E)}}catch(T){s={error:T}}finally{try{A&&!A.done&&(l=C.return)&&l.call(C)}finally{if(s)throw s.error}}u=[w]}return IM(ve(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 Qt(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=M(a,["components","tooltip"],{}),s=M(n,"enterable",o.enterable);return Y({},o,n,{capture:!!(s||this.isLocked)})},e.prototype.processCustomContent=function(t){if($i(t)||!M(t,"customContent"))return t;var i=t.customContent,n=function(a,o){var s=i(a,o)||"";return K(s)?'<div class="g2-tooltip">'+s+"</div>":s};return g.__assign(g.__assign({},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 Cs(g.__assign(g.__assign({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=g.__values(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=vc(s.getCoordinate()),p=d.type,y=d.attrs;o==null||o.setClip({type:p,attrs:y})}else o==null||o.setClip(void 0);var m=this.view.getTheme(),x=M(m,["components","tooltip","marker"],{}),_=g.__assign(g.__assign({fill:h.color,symbol:"circle",shadowColor:h.color},W(i)?g.__assign(g.__assign({},x),i(h)):i),{x:f,y:v});o.addShape("marker",{attrs:_})}}catch(w){n={error:w}}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=M(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=Wi(n,t),l=n.getCenter(),u=n.getRadius();o=Tt(l.x,l.y,u,s),a=l}var c=Y({start:a,end:o,container:this.getTooltipCrosshairsGroup()},M(i,"crosshairs",{}),this.getCrosshairsText("x",t,i));delete c.type;var h=this.xCrosshair;h?h.update(c):(h=new Lp(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:Ms(n,t),startAngle:n.startAngle,endAngle:n.endAngle},o="Circle";a=Y({container:this.getTooltipCrosshairsGroup()},a,M(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 Vf[o](a),u.init()):u.update(a):(u=new Vf[o](a),u.init()),u.render(),u.show(),this.yCrosshair=u},e.prototype.getCrosshairsText=function(t,i,n){var a=M(n,["crosshairs","text"]),o=M(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 W(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=hu(t,i,o);try{for(var l=g.__values(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:Le(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}(on),hy={};function fy(r){return hy[r.toLowerCase()]}function de(r,e){hy[r.toLowerCase()]=e}var Ui={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},PM={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"}}},uv={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 DM(r,e){return{delay:W(r.delay)?r.delay(e):r.delay,easing:W(r.easing)?r.easing(e):r.easing,duration:W(r.duration)?r.duration(e):r.duration,callback:r.callback,repeat:r.repeat}}function vy(r,e,t){var i=PM[r];return i&&(W(i)&&(i=i(e)),i=Y({},Ui,i),t)?i[t]:i}function zi(r,e,t){var i=M(r.get("origin"),"data",gt),n=e.animation,a=DM(e,i);if(n){var o=fy(n);o&&o(r,a,t)}else r.animate(t.toAttrs,a)}function BM(r,e,t,i,n){if(uv[t]){var a=uv[t](i),o=fy(M(a,"animation",""));if(o){var s=g.__assign(g.__assign(g.__assign({},Ui.appear),a),e);r.stopAnimate(),o(r,s,{coordinate:i,minYPoint:n,toAttrs:null})}}}var wc="element-background",dy=function(r){g.__extends(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?zi(n,a,{coordinate:i.coordinate,toAttrs:g.__assign({},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 y={state:t,stateStatus:i,element:this,target:this.container};this.container.emit("statechange",y),yp(this.shape,"statechange",y)},e.prototype.clearStates=function(){var t=this,i=this.states;S(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=Y({},l,o)}return this.statesStyle},e.prototype.getStateStyle=function(t,i){var n=this.getStatesStyle(),a=M(n,[t,"style"],{}),o=a[i]||a;return W(o)?o(this):o},e.prototype.getAnimateCfg=function(t){var i=this,n=this.animate;if(n){var a=n[t];return a&&g.__assign(g.__assign({},a),{callback:function(){var o;W(a.callback)&&a.callback(),(o=i.geometry)===null||o===void 0||o.emit(Tr.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?K(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(Tr.BEFORE_DRAW_ANIMATE),zi(this.shape,h,{coordinate:o.coordinate,toAttrs:g.__assign({},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<h.length;v++)this.syncShapeStyle(h[v],f[v],n,a,o+v);else{if(!oe(n)&&!Lt(n,["reset"])){var d=t.get("name");O(d)&&(d=d[1]),S(n,function(y){if(i.get("name")!==wc){var m=s.getStateStyle(y,d||o);i.attr(m)}})}var p=Np(t,i);this.animate?a?((l=this.geometry)===null||l===void 0||l.emit(Tr.BEFORE_DRAW_ANIMATE),zi(t,a,{coordinate:this.shapeFactory.coordinate,toAttrs:p,shapeModel:this.model})):oe(n)?t.attr(p):(t.stopAnimate(),t.animate(p,{duration:300})):t.attr(p)}}},e.prototype.getShapeType=function(t){var i=M(t,"shape");return O(i)?i[0]:i},e}(Xu),gy={},py={};function OM(r){return gy[r.toLowerCase()]}function Sa(r,e){gy[r.toLowerCase()]=e}function RM(r){return py[r.toLowerCase()]}function le(r,e){py[r.toLowerCase()]=e}var NM={coordinate:null,defaultShapeType:null,theme:null,getShapePoints:function(r,e){var t=this.getShape(r);return t.getPoints?t.getPoints(e):this.getDefaultPoints(e)},getShape:function(r){var e=this[r]||this[this.defaultShapeType];return e.coordinate=this.coordinate,e},getDefaultPoints:function(){return[]},getDefaultStyle:function(r){return M(r,[this.defaultShapeType,"default","style"],{})},getMarker:function(r,e){var t=this.getShape(r);if(!t.getMarker){var i=this.defaultShapeType;t=this.getShape(i)}var n=this.theme,a=M(n,[r,"default"],{}),o=t.getMarker(e);return Y({},a,o)},drawShape:function(r,e,t){var i=this.getShape(r);return i.draw(e,t)}},zM={coordinate:null,parsePath:function(r){var e=this.coordinate,t=$C(r);return e.isPolar?t=VC(e,t):t=zC(e,t),t},parsePoint:function(r){var e=this.coordinate;return e.convert(r)},parsePoints:function(r){var e=this.coordinate;return r.map(function(t){return e.convert(t)})},draw:function(r,e){}},_c={};function Yr(r,e){var t=xi(r),i=g.__assign(g.__assign(g.__assign({},NM),e),{geometryType:r});return _c[t]=i,i}function lt(r,e,t){var i=xi(r),n=_c[i],a=g.__assign(g.__assign({},zM),t);return n[e]=a,a}function cv(r){var e=xi(r);return _c[e]}function VM(r,e,t){var i,n;if(t===void 0&&(t={}),!e)return[r];var a=Nx(r,e),o=[];if(e.length===1&&t[e[0]]){var s=t[e[0]];try{for(var l=g.__values(s),u=l.next();!u.done;u=l.next()){var c=u.value,h=a["_".concat(c)];h&&o.push(h)}}catch(d){i={error:d}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}}else for(var f in a)if(a.hasOwnProperty(f)){var v=a[f];o.push(v)}return o}function yy(r,e){return Qo(["color","shape","size","x","y","isInCircle","data","style","defaultStyle","points","mappingData"],function(t){return!Lt(r[t],e[t])})}function mn(r){return O(r)?r:r.split("*")}function my(r,e){for(var t=[],i=[],n=[],a=new Map,o=0;o<e.length;o++){var s=e[o];r[s]?i.push(s):t.push(s),a.set(s,!0)}return Object.keys(r).forEach(function(l){a.has(l)||n.push(l)}),{added:t,updated:i,removed:n}}var $r=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.type="base",i.attributes={},i.elements=[],i.elementsMap={},i.animateOption=!0,i.attributeOption={},i.lastElementsMap={},i.generatePoints=!1,i.beforeMappingData=null,i.adjusts={},i.idFields=[],i.hasSorted=!1,i.isCoordinateChanged=!1;var n=t.container,a=t.labelsContainer,o=t.coordinate,s=t.data,l=t.sortable,u=l===void 0?!1:l,c=t.visible,h=c===void 0?!0:c,f=t.theme,v=t.scales,d=v===void 0?{}:v,p=t.scaleDefs,y=p===void 0?{}:p,m=t.intervalPadding,x=t.dodgePadding,_=t.maxColumnWidth,w=t.minColumnWidth,b=t.columnWidthRatio,C=t.roseWidthRatio,A=t.multiplePieWidthRatio,F=t.zIndexReversed,E=t.sortZIndex,T=t.useDeferredLabel;return i.container=n,i.labelsContainer=a,i.coordinate=o,i.data=s,i.sortable=u,i.visible=h,i.userTheme=f,i.scales=d,i.scaleDefs=y,i.intervalPadding=m,i.dodgePadding=x,i.maxColumnWidth=_,i.minColumnWidth=w,i.columnWidthRatio=b,i.roseWidthRatio=C,i.multiplePieWidthRatio=A,i.zIndexReversed=F,i.sortZIndex=E,i.useDeferredLabel=T?typeof T=="number"?T:1/0:null,i}return e.prototype.position=function(t){var i=t;Ln(t)||(i={fields:mn(t)});var n=M(i,"fields");return n.length===1&&(n.unshift("1"),Et(i,"fields",n)),Et(this.attributeOption,"position",i),this},e.prototype.color=function(t,i){return this.createAttrOption("color",t,i),this},e.prototype.shape=function(t,i){return this.createAttrOption("shape",t,i),this},e.prototype.size=function(t,i){return this.createAttrOption("size",t,i),this},e.prototype.adjust=function(t){var i=t;return(K(t)||Ln(t))&&(i=[t]),S(i,function(n,a){pt(n)||(i[a]={type:n})}),this.adjustOption=i,this},e.prototype.style=function(t,i){if(K(t)){var n=mn(t);this.styleOption={fields:n,callback:i}}else{var a=t,n=a.fields,o=a.callback,s=a.cfg;n||o||s?this.styleOption=t:this.styleOption={cfg:t}}return this},e.prototype.tooltip=function(t,i){if(K(t)){var n=mn(t);this.tooltipOption={fields:n,callback:i}}else this.tooltipOption=t;return this},e.prototype.animate=function(t){return this.animateOption=t,this},e.prototype.label=function(t,i,n){if(K(t)){var a={},o=mn(t);a.fields=o,W(i)?a.callback=i:Ln(i)&&(a.cfg=i),n&&(a.cfg=n),this.labelOption=a}else this.labelOption=t;return this},e.prototype.state=function(t){return this.stateOption=t,this},e.prototype.customInfo=function(t){return this.customOption=t,this},e.prototype.init=function(t){t===void 0&&(t={}),this.setCfg(t),this.initAttributes(),this.processData(this.data),this.adjustScale()},e.prototype.update=function(t){t===void 0&&(t={});var i=t.data,n=t.isDataChanged,a=t.isCoordinateChanged,o=this,s=o.attributeOption,l=o.lastAttributeOption;Lt(s,l)?i&&(n||!Lt(i,this.data))?(this.setCfg(t),this.initAttributes(),this.processData(i)):this.setCfg(t):this.init(t),this.adjustScale(),this.isCoordinateChanged=a},e.prototype.paint=function(t){var i=this;t===void 0&&(t=!1),this.animateOption&&(this.animateOption=Y({},vy(this.type,this.coordinate),this.animateOption)),this.defaultSize=void 0,this.elementsMap={},this.elements=[];var n=this.getOffscreenGroup();n.clear();var a=this.beforeMappingData,o=this.beforeMapping(a);this.dataArray=new Array(o.length);for(var s=0;s<o.length;s++){var l=o[s];this.dataArray[s]=this.mapping(l)}if(this.updateElements(this.dataArray,t),this.lastElementsMap=this.elementsMap,this.canDoGroupAnimation(t)){var u=this.container,c=this.type,h=this.coordinate,f=M(this.animateOption,"appear"),v=this.getYScale(),d=h.convert({x:0,y:v.scale(this.getYMinValue())});BM(u,f,c,h,d)}if(this.labelOption){var p=this.useDeferredLabel,y=function(){return i.renderLabels(ve(i.dataArray),t)}.bind(this);if(typeof p=="number"){var m=typeof p=="number"&&p!==1/0?p:0;if(!window.requestIdleCallback)setTimeout(y,m);else{var x=m&&m!==1/0?{timeout:m}:void 0;window.requestIdleCallback(y,x)}}else y()}this.lastAttributeOption=g.__assign({},this.attributeOption),this.visible===!1&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this,i=t.container,n=t.geometryLabel,a=t.offscreenGroup;i&&i.clear(),n&&n.clear(),a&&a.clear(),this.scaleDefs=void 0,this.attributes={},this.scales={},this.elementsMap={},this.lastElementsMap={},this.elements=[],this.adjusts={},this.dataArray=null,this.beforeMappingData=null,this.lastAttributeOption=void 0,this.defaultSize=void 0,this.idFields=[],this.groupScales=void 0,this.hasSorted=!1,this.isCoordinateChanged=!1},e.prototype.destroy=function(){this.clear();var t=this.container;t.remove(!0),this.offscreenGroup&&(this.offscreenGroup.remove(!0),this.offscreenGroup=null),this.geometryLabel&&(this.geometryLabel.destroy(),this.geometryLabel=null),this.theme=void 0,this.shapeFactory=void 0,r.prototype.destroy.call(this)},e.prototype.getGroupScales=function(){return this.groupScales},e.prototype.getAttribute=function(t){return this.attributes[t]},e.prototype.getXScale=function(){return this.getAttribute("position").scales[0]},e.prototype.getYScale=function(){return this.getAttribute("position").scales[1]},e.prototype.getGroupAttributes=function(){var t=[];return S(this.attributes,function(i){Pi.includes(i.type)&&t.push(i)}),t},e.prototype.getDefaultValue=function(t){var i,n=this.getAttribute(t);return n&&oe(n.scales)&&(i=n.values[0]),i},e.prototype.getAttributeValues=function(t,i){for(var n=[],a=t.scales,o=0,s=a.length;o<s;o++){var l=a[o],u=l.field;l.isIdentity?n.push(l.values):n.push(i[u])}return t.mapping.apply(t,g.__spreadArray([],g.__read(n),!1))},e.prototype.getAdjust=function(t){return this.adjusts[t]},e.prototype.getCoordinate=function(){return this.coordinate},e.prototype.getData=function(){return this.data},e.prototype.getShapeMarker=function(t,i){var n=this.getShapeFactory();return n.getMarker(t,i)},e.prototype.getElementsBy=function(t){return this.elements.filter(function(i){return t(i)})},e.prototype.getElements=function(){return this.elements},e.prototype.getElementId=function(t){t=O(t)?t[0]:t;var i=t[gt];if(this.idFields.length){for(var n=i[this.idFields[0]],a=1;a<this.idFields.length;a++)n+="-"+i[this.idFields[a]];return n}var o=this.type,s=this.getXScale(),l=this.getYScale(),u=s.field||"x",c=l.field||"y",h=i[c],f;s.type==="identity"?f=s.values[0]:f=i[u];var v;o==="interval"||o==="schema"?v="".concat(f):o==="line"||o==="area"||o==="path"?v=o:v="".concat(f,"-").concat(h);for(var d=this.groupScales,a=0,p=d.length;a<p;a++){var y=d[a],m=y.field;v="".concat(v,"-").concat(i[m])}var x=this.getAdjust("dodge");if(x){var _=x.dodgeBy;_&&(v="".concat(v,"-").concat(i[_]))}return this.getAdjust("jitter")&&(v="".concat(v,"-").concat(t.x,"-").concat(t.y)),v},e.prototype.getScaleFields=function(){var t=[],i=new Map,n=this,a=n.attributeOption,o=n.labelOption,s=n.tooltipOption;for(var l in a)if(a.hasOwnProperty(l)){var u=a[l];u.fields?Cr(u.fields,t,i):u.values&&Cr(u.values,t,i)}return o&&o.fields&&Cr(o.fields,t,i),pt(s)&&s.fields&&Cr(s.fields,t,i),t},e.prototype.changeVisible=function(t){r.prototype.changeVisible.call(this,t);for(var i=this.elements,n=0,a=i.length;n<a;n++){var o=i[n];o.changeVisible(t)}t?(this.container&&this.container.show(),this.labelsContainer&&this.labelsContainer.show()):(this.container&&this.container.hide(),this.labelsContainer&&this.labelsContainer.hide())},e.prototype.getFields=function(){var t=new Map,i=[];return Object.values(this.attributeOption).forEach(function(n){var a=(n==null?void 0:n.fields)||[];a.forEach(function(o){t.has(o)||i.push(o),t.set(o,!0)})},[]),i},e.prototype.getGroupFields=function(){for(var t=[],i=new Map,n=0,a=Pi.length;n<a;n++){var o=Pi[n],s=this.attributeOption[o];s&&s.fields&&Cr(s.fields,t,i)}return t},e.prototype.getXYFields=function(){var t=g.__read(this.attributeOption.position.fields,2),i=t[0],n=t[1];return[i,n]},e.prototype.getXField=function(){return M(this.getXYFields(),[0])},e.prototype.getYField=function(){return M(this.getXYFields(),[1])},e.prototype.getShapes=function(){return this.elements.map(function(t){return t.shape})},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.sort=function(t){if(!this.hasSorted)for(var i=this.getXScale(),n=i.field,a=0;a<t.length;a++){var o=t[a];o.sort(function(s,l){return i.translate(s[gt][n])-i.translate(l[gt][n])})}this.hasSorted=!0},e.prototype.adjustScale=function(){var t=this.getYScale();t&&this.getAdjust("stack")&&this.updateStackRange(t,this.beforeMappingData)},e.prototype.getShapeFactory=function(){var t=this.shapeType;if(cv(t))return this.shapeFactory||(this.shapeFactory=he(cv(t))),this.shapeFactory.coordinate=this.coordinate,this.shapeFactory.theme=this.theme.geometries[t]||{},this.shapeFactory},e.prototype.createShapePointsCfg=function(t){var i=this.getXScale(),n=this.getYScale(),a=this.normalizeValues(t[i.field],i),o;return n?o=this.normalizeValues(t[n.field],n):o=t.y?t.y:.1,{x:a,y:o,y0:n?n.scale(this.getYMinValue()):void 0}},e.prototype.createElement=function(t,i,n){n===void 0&&(n=!1);var a=this.container,o=this.getDrawCfg(t),s=this.getShapeFactory(),l=new dy({shapeFactory:s,container:a,offscreenGroup:this.getOffscreenGroup(),elementIndex:i});return l.animate=this.animateOption,l.geometry=this,l.draw(o,n),l},e.prototype.getDrawCfg=function(t){var i=t[gt],n={mappingData:t,data:i,x:t.x,y:t.y,color:t.color,size:t.size,isInCircle:this.coordinate.isPolar,customInfo:this.customOption},a=t.shape;!a&&this.getShapeFactory()&&(a=this.getShapeFactory().defaultShapeType),n.shape=a;var o=this.theme.geometries[this.shapeType];n.defaultStyle=M(o,[a,"default"],{}).style,!n.defaultStyle&&this.getShapeFactory()&&(n.defaultStyle=this.getShapeFactory().getDefaultStyle(o));var s=this.styleOption;return s&&(n.style=this.getStyleCfg(s,i)),this.generatePoints&&(n.points=t.points,n.nextPoints=t.nextPoints),n},e.prototype.updateElements=function(t,i){var n,a,o,s,l,u;i===void 0&&(i=!1);for(var c=new Map,h=[],f=new Map,v=0,d=0;d<t.length;d++)for(var p=t[d],y=0;y<p.length;y++){var m=p[y],x=this.getElementId(m),_=c.has(x)?"".concat(x,"-").concat(d,"-").concat(y):x;h.push(_),c.set(_,m),f.set(_,v),v++}this.elements=new Array(v);var w=my(this.lastElementsMap,h),b=w.added,C=w.updated,A=w.removed;try{for(var F=g.__values(b),E=F.next();!E.done;E=F.next()){var x=E.value,m=c.get(x),d=f.get(x),T=this.createElement(m,d,i);this.elements[d]=T,this.elementsMap[x]=T,T.shape&&T.shape.set("zIndex",this.zIndexReversed?this.elements.length-d:d)}}catch(R){n={error:R}}finally{try{E&&!E.done&&(a=F.return)&&a.call(F)}finally{if(n)throw n.error}}try{for(var k=g.__values(C),P=k.next();!P.done;P=k.next()){var x=P.value,T=this.lastElementsMap[x],m=c.get(x),B=this.getDrawCfg(m),z=T.getModel(),d=f.get(x);(this.isCoordinateChanged||yy(B,z))&&(T.animate=this.animateOption,T.update(B)),this.elements[d]=T,this.elementsMap[x]=T,T.shape&&T.shape.set("zIndex",this.zIndexReversed?this.elements.length-d:d)}}catch(R){o={error:R}}finally{try{P&&!P.done&&(s=k.return)&&s.call(k)}finally{if(o)throw o.error}}this.container&&this.container.sort();try{for(var X=g.__values(A),I=X.next();!I.done;I=X.next()){var x=I.value,T=this.lastElementsMap[x];T.animate=this.animateOption,T.destroy()}}catch(R){l={error:R}}finally{try{I&&!I.done&&(u=X.return)&&u.call(X)}finally{if(l)throw l.error}}},e.prototype.getLabelType=function(){var t=this,i=t.labelOption,n=t.coordinate,a=t.type,o=n.type,s=n.isTransposed,l=M(i,["cfg","type"]);return l||(o==="polar"?l=s?"pie":"polar":o==="theta"?l="pie":a==="interval"||a==="polygon"?l="interval":l="base"),l},e.prototype.getYMinValue=function(){var t=this.getYScale(),i=t.min,n=t.max,a;return i>=0?a=i:n<=0?a=n:a=0,a},e.prototype.createAttrOption=function(t,i,n){if(D(i)||pt(i))pt(i)&&Lt(Object.keys(i),["values"])?Et(this.attributeOption,t,{fields:i.values}):Et(this.attributeOption,t,i);else{var a={};tt(i)?a.values=[i]:a.fields=mn(i),n&&(W(n)?a.callback=n:a.values=n),Et(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=g.__assign({},v),p=d.callback,y=d.values,m=d.fields,x=m===void 0?[]:m,_=x.map(function(b){var C=t.scales[b];if(!l[b]&&Pi.includes(f)){var A=zp(C,M(t.scaleDefs,b),f,t.type);A==="cat"&&(t.groupScales.push(C),l[b]=!0)}return C});d.scales=_,f!=="position"&&_.length===1&&_[0].type==="identity"?d.values=_[0].values:!p&&!y&&(f==="size"?d.values=o.sizes:f==="shape"?d.values=o.shapes[s]||[]:f==="color"&&(_.length?d.values=_[0].values.length<=10?o.colors10:o.colors20:d.values=o.colors10));var w=dp(f);n[f]=new w(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(A){return A.isCategory}),s=this.groupData(t),l=[],u=0,c=s.length;u<c;u++){for(var h=s[u],f=[],v=0,d=h.length;v<d;v++){var p=h[v],y={};for(var m in p)y[m]=p[m];y[gt]=p;try{for(var x=(i=void 0,g.__values(o)),_=x.next();!_.done;_=x.next()){var w=_.value,b=w.field;y[b]=w.translate(y[b])}}catch(A){i={error:A}}finally{try{_&&!_.done&&(n=x.return)&&n.call(x)}finally{if(i)throw i.error}}f.push(y)}l.push(f)}var C=this.adjustData(l);return this.beforeMappingData=C,C},e.prototype.adjustData=function(t){var i=this.adjustOption,n=this,a=n.intervalPadding,o=n.dodgePadding,s=n.theme,l=this.maxColumnWidth||s.maxColumnWidth,u=this.minColumnWidth||s.minColumnWidth,c=this.columnWidthRatio||s.columnWidthRatio,h=t;if(i){var f=this.getXScale(),v=this.getYScale(),d=f.field,p=v?v.field:null,y=_a(this.coordinate),m=f.values.length,x=this.getAttribute("size"),_=void 0;x&&(_=x.values[0]);for(var w=0,b=i.length;w<b;w++){var C=i[w],A=g.__assign({xField:d,yField:p,intervalPadding:a,dodgePadding:o,xDimensionLength:y,groupNum:m,defaultSize:_,maxColumnWidth:l,minColumnWidth:u,columnWidthRatio:c},C),F=C.type;if(F==="dodge"){var E=[];if(f.isCategory||f.type==="identity")E.push("x");else if(!v)E.push("y");else throw new Error("dodge is not support linear attribute, please use category attribute!");A.adjustNames=E,A.dodgeRatio=c}else if(F==="stack"){var T=this.coordinate;if(!v){A.height=T.getHeight();var k=this.getDefaultValue("size")||3;A.size=k}!T.isTransposed&&D(A.reverseOrder)&&(A.reverseOrder=!0)}var P=Wg(F);A.dimValuesMap={},f&&f.values&&(A.dimValuesMap[f.field]=f.values.map(function(z){return f.translate(z)}));var B=new P(A);h=B.process(h),this.adjusts[F]=B}}return h},e.prototype.groupData=function(t){for(var i=this.getGroupScales(),n=this.scaleDefs,a={},o=[],s=0;s<i.length;s++){var l=i[s],u=l.field;o.push(u),M(n,[u,"values"])&&(a[u]=n[u].values)}return VM(t,o,a)},e.prototype.updateStackRange=function(t,i){for(var n=ve(i),a=t.field,o=t.min,s=t.max,l=0;l<n.length;l++){var u=n[l],c=Math.min.apply(null,u[a]),h=Math.max.apply(null,u[a]);c<o&&(o=c),h>s&&(s=h)}var f=this.scaleDefs,v={};o<t.min&&!M(f,[a,"min"])&&(v.min=o),s>t.max&&!M(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;n<a;n++){var o=i[n];this.generateShapePoints(o);var s=i[n+1];s&&(this.generateShapePoints(s),o[0].nextPoints=s[0].points)}return i},e.prototype.generateShapePoints=function(t){for(var i=this.getShapeFactory(),n=this.getAttribute("shape"),a=0;a<t.length;a++){var o=t[a],s=this.createShapePointsCfg(o),l=n?this.getAttributeValues(n,o):null,u=i.getShapePoints(l,s);o.points=u}},e.prototype.normalizeValues=function(t,i){var n=[];if(O(t))for(var a=0;a<t.length;a++){var o=t[a];n.push(i.scale(o))}else n=i.scale(t);return n},e.prototype.mapping=function(t){for(var i=this.attributes,n=[],a=0;a<t.length;a++){var o=t[a],s={_origin:o[gt],points:o.points,nextPoints:o.nextPoints};for(var l in i)if(i.hasOwnProperty(l)){var u=i[l],c=u.names,h=this.getAttributeValues(u,o);if(c.length>1)for(var f=0;f<h.length;f+=1){var v=h[f],d=c[f];s[d]=O(v)&&v.length===1?v[0]:v}else s[c[0]]=h.length===1?h[0]:h}this.convertPoint(s),n.push(s)}return n},e.prototype.convertPoint=function(t){var i=t.x,n=t.y,a,o,s,l=this.coordinate;if(O(i)&&O(n)){a=[],o=[];for(var u=0,c=0,h=i.length,f=n.length;u<h&&c<f;u+=1,c+=1)s=l.convert({x:i[u],y:n[c]}),a.push(s.x),o.push(s.y)}else if(O(n)){o=[];for(var v=0;v<n.length;v++){var d=n[v];s=l.convert({x:i,y:d}),a&&a!==s.x?(O(a)||(a=[a]),a.push(s.x)):a=s.x,o.push(s.y)}}else if(O(i)){a=[];for(var v=0;v<i.length;v++){var p=i[v];s=l.convert({x:p,y:n}),o&&o!==s.y?(O(o)||(o=[o]),o.push(s.y)):o=s.y,a.push(s.x)}}else{var y=l.convert({x:i,y:n});a=y.x,o=y.y}t.x=a,t.y=o},e.prototype.getStyleCfg=function(t,i){var n=t.fields,a=n===void 0?[]:n,o=t.callback,s=t.cfg;if(s)return s;var l=a.map(function(u){return i[u]});return o.apply(void 0,g.__spreadArray([],g.__read(l),!1))},e.prototype.setCfg=function(t){var i=this,n=t.coordinate,a=t.data,o=t.theme,s=t.scaleDefs;n&&(this.coordinate=n),a&&(this.data=a),s&&(this.scaleDefs=s,this.idFields=[],S(s,function(l,u){l&&l.key&&i.idFields.push(u)})),o&&(this.theme=this.userTheme?Y({},o,this.userTheme):o)},e.prototype.renderLabels=function(t,i){return i===void 0&&(i=!1),g.__awaiter(this,void 0,void 0,function(){var n,a,o,s,l,u,c,h,f,v,d,p,y=this;return g.__generator(this,function(m){switch(m.label){case 0:return n=this.geometryLabel,this.emit(Tr.BEFORE_RENDER_LABEL),n||(a=this.getLabelType(),o=OM(a),n=new o(this),this.geometryLabel=n),[4,n.render(t,i)];case 1:m.sent(),s=n.labelsRenderer.shapesMap,l=new Map,S(s,function(x,_){for(var w=x.getChildren()||[],b=0;b<w.length;b++){var C=w[b],A=y.elementsMap[C.get("elementId")||_.split(" ")[0]];if(A){C.cfg.name=["element","label"],C.cfg.element=A;var F=l.get(A)||new Set;F.add(x),l.set(A,F)}}});try{for(u=g.__values(l.entries()),c=u.next();!c.done;c=u.next())h=g.__read(c.value,2),f=h[0],v=h[1],f.labelShape=g.__spreadArray([],g.__read(v),!1)}catch(x){d={error:x}}finally{try{c&&!c.done&&(p=u.return)&&p.call(u)}finally{if(d)throw d.error}}return this.emit(Tr.AFTER_RENDER_LABEL),[2]}})})},e.prototype.canDoGroupAnimation=function(t){return!t&&this.animateOption&&(M(this.animateOption,"appear")===void 0||M(this.animateOption,"appear")&&M(this.animateOption,["appear","animation"])===void 0)},e}(Xu),Es=kt;function Ca(r,e,t){var i=Es(r.getMatrix(),[["t",e,t]]);r.setMatrix(i)}function GM(r,e){var t=r.attr(),i=t.x,n=t.y,a=Es(r.getMatrix(),[["t",-i,-n],["r",e],["t",i,n]]);return a}function bc(r,e){var t=GM(r,e);r.setMatrix(t)}function YM(r,e){var t=r.getBBox(),i=(t.minX+t.maxX)/2,n=(t.minY+t.maxY)/2;r.applyToMatrix([i,n,1]);var a=Es(r.getMatrix(),[["t",-i,-n],["s",e,e],["t",i,n]]);r.setMatrix(a)}function Or(r){return r.find(function(e){return e.get("type")==="text"})}function xy(r,e,t){t===void 0&&(t=[0,0,0,0]);var i=r&&r.getChildren()[0];if(i){var n=i.clone();e!=null&&e.rotate&&bc(n,-e.rotate);var a=n.getCanvasBBox(),o=a.x,s=a.y,l=a.width,u=a.height;n.destroy();var c=t;return D(c)?c=[2,2,2,2]:tt(c)&&(c=new Array(4).fill(c)),{x:o-c[3],y:s-c[0],width:l+c[1]+c[3],height:u+c[0]+c[2],rotation:(e==null?void 0:e.rotate)||0}}return{x:0,y:0,width:0,height:0,rotation:0}}function $M(r,e,t){t===void 0&&(t=0);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 HM(r,e){var t=r.getBBox();return Qo(e,function(i){var n=i.getBBox();return $M(t,n,2)>0})}function wy(r,e,t){var i=t.data,n=t.origin,a=t.animateCfg,o=t.coordinate,s=M(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=Np(l,c);s?zi(l,s,{toAttrs:h,coordinate:o}):l.attr(h),c.isGroup()&&wy(l,c,t)}}),S(e.getChildren(),function(l,u){u>=r.getCount()&&(l.destroyed||r.add(l))})}var XM=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),g.__awaiter(this,void 0,void 0,function(){var n,a,o,s,l,u,c,h,f=this;return g.__generator(this,function(v){switch(v.label){case 0:if(n={},a=this.createOffscreenGroup(),!e.length)return[3,2];try{for(o=g.__values(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,S(n,function(d,p){if(d.destroyed)delete n[p];else{if(u[p]){var y=d.get("data"),m=d.get("origin"),x=d.get("coordinate"),_=d.get("animateCfg"),w=u[p];wy(w,n[p],{data:y,origin:m,animateCfg:_,coordinate:x}),n[p]=w}else{if(f.container.destroyed)return;f.container.add(d);var b=M(d.get("animateCfg"),i?"enter":"appear");b&&zi(d,b,{toAttrs:g.__assign({},d.attr()),coordinate:d.get("coordinate")})}delete u[p]}}),S(u,function(d){var p=M(d.get("animateCfg"),"leave");p?zi(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:g.__assign(g.__assign({},o),{data:o[gt]}),coordinate:s},f=t.addGroup(g.__assign({name:"label",animateCfg:this.animate===!1||l===null||l===!1?!1:Y({},this.animate,l)},h)),v;if(u.isGroup&&u.isGroup()||u.isShape&&u.isShape()){var d=u.getCanvasBBox(),p=d.width,y=d.height,m=M(e,"textAlign","left"),x=e.x,_=e.y-y/2;m==="center"?x=x-p/2:(m==="right"||m==="end")&&(x=x-p),Ca(u,x,_),v=u,f.add(u)}else{var w=M(e,["style","fill"]);v=f.addShape("text",g.__assign({attrs:g.__assign(g.__assign({x:e.x,y:e.y,textAlign:e.textAlign,textBaseline:M(e,"textBaseline","middle"),text:e.content},e.style),{fill:zx(w)?e.color:w})},h))}return e.rotate&&bc(v,e.rotate),f},r.prototype.doLayout=function(e,t,i){return g.__awaiter(this,void 0,void 0,function(){var n,a=this;return g.__generator(this,function(o){switch(o.label){case 0:return this.layout?(n=O(this.layout)?this.layout:[this.layout],[4,Promise.all(n.map(function(s){var l=RM(M(s,"type",""));if(l){var u=[],c=[];return S(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){S(e,function(i){var n=M(i,"coordinate");if(!(!i||!n)){var a=n.getCenter(),o=n.getRadius();if(i.labelLine){var s=M(i,"labelLine",{}),l=i.id,u=s.path;if(!u){var c=Tt(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:g.__assign({path:u,stroke:i.color?i.color:M(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){S(e,function(i){var n=M(i,"coordinate"),a=M(i,"background");if(!(!a||!n)){var o=i.id,s=t[o];if(!s.destroyed){var l=s.getChildren()[0];if(l){var u=xy(s,i,a.padding),c=u.rotation,h=g.__rest(u,["rotation"]),f=s.addShape("rect",{attrs:g.__assign(g.__assign({},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){S(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"});S(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 hv(r){var e=0;return S(r,function(t){e+=t}),e/r.length}var ks=function(){function r(e){this.geometry=e}return r.prototype.getLabelItems=function(e){var t=this,i=[],n=this.getLabelCfgs(e);return S(e,function(a,o){var s=n[o];if(!s||D(a.x)||D(a.y)){i.push(null);return}var l=O(s.content)?s.content:[s.content];s.content=l;var u=l.length;S(l,function(c,h){if(D(c)||c===""){i.push(null);return}var f=g.__assign(g.__assign({},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),g.__awaiter(this,void 0,void 0,function(){var i,n,a;return g.__generator(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)?M(a,"innerLabels",{}):M(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=Y({},i,a.innerLabels,e):o=Y({},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(y,m,x){x===void 0&&(x=!1);var _=y;return O(_)&&(e.content.length===1?x?_=hv(_):_.length<=2?_=_[y.length-1]:_=hv(_):_=_[m]),_}var s={content:e.content[i],x:0,y:0,start:{x:0,y:0},color:"#fff"},l=O(t.shape)?t.shape[0]:t.shape,u=l==="funnel"||l==="pyramid";if(this.geometry.type==="polygon"){var c=mC(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=M(t,"nextPoints"),f=M(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[gt],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 XM({container:t,layout:M(i,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=s),s.region=n,s.animate=a?vy("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 S(e,function(v,d){var p=v[gt],y=t.getLabelText(p,h),m;if(u){var x=l.map(function(A){return p[A]});if(m=u.apply(void 0,g.__spreadArray([],g.__read(x),!1)),D(m)){f.push(null);return}}var _=g.__assign(g.__assign({id:t.getLabelId(v),elementId:t.geometry.getElementId(v),data:p,mappingData:v,coordinate:o},c),m);W(_.position)&&(_.position=_.position(p,v,d));var w=t.getLabelOffset(_.offset||0),b=t.getDefaultLabelCfg(w,_.position);_=Y({},b,_),_.offset=t.getLabelOffset(_.offset||0);var C=_.content;W(C)?_.content=C(p,v,d):Qr(C)&&(_.content=y[0]),f.push(_)}),f},r.prototype.getLabelText=function(e,t){var i=[];return S(t,function(n){var a=e[n.field];O(a)?a=a.map(function(o){return n.getText(o)}):a=n.getText(a),D(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 tt(e)&&(i=e),t.isTransposed?t.applyMatrix(i,0):t.applyMatrix(0,i)},r.prototype.getGeometryShapes=function(){var e=this.geometry,t={};return S(e.elementsMap,function(i,n){t[n]=i.shape}),S(e.getOffscreenGroup().getChildren(),function(i){var n=e.getElementId(i.get("origin").mappingData);t[n]=i}),t},r}();function fu(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,g.__spreadArray([e],g.__read(n),!1)).join("")}else i=r.mapping(e).join("");return i||t}var gi={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]]}},WM=["line","cross","tick","plus","hyphen"];function qM(r,e){return W(e)?e(r):Y({},r,e)}function UM(r,e){var t=r.symbol;if(K(t)&&WM.indexOf(t)!==-1){var i=M(r,"style",{}),n=M(i,"lineWidth",1),a=i.stroke||i.fill||e;r.style=Y({},r.style,{lineWidth:n,stroke:a,fill:null})}}function _y(r){var e=r.symbol;K(e)&&gi[e]&&(r.symbol=gi[e])}function pl(r){return r.startsWith(N.LEFT)||r.startsWith(N.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,y=d,m=a.invert(p),x=r.filterFieldData(o,[(v={},v[o]=m,v)]).length===0;S(r.views,function(A){var F;A.filterFieldData(o,[(F={},F[o]=m,F)]).length||(x=!0)});var _=fu(s,m,u),w=fu(l,m,"point"),b=e.getShapeMarker(w,{color:_,isInPolar:c}),C=n;return W(C)&&(C=C(y,f,g.__assign({name:y,value:m},Y({},i,b)))),b=Y({},i,b,re(g.__assign({},C),["style"])),UM(b,_),C&&C.style&&(b.style=qM(b.style,C.style)),_y(b),{id:m,name:y,value:m,marker:b,unchecked:x}})}return[]}function jM(r,e,t){return t.map(function(i,n){var a=e;W(a)&&(a=a(i.name,n,Y({},r,i)));var o=W(i.marker)?i.marker(i.name,n,Y({},r,i)):i.marker,s=Y({},r,a,o);return _y(s),i.marker=s,i})}function fv(r,e){var t=M(r,["components","legend"],{});return Y({},M(t,["common"],{}),Y({},M(t,[e],{})))}function yl(r){return r?!1:r==null||isNaN(r)}function vv(r){if(O(r))return yl(r[1].y);var e=r.y;return O(e)?yl(e[0]):yl(e)}function Ls(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<a;n++){var o=r[n];vv(o)||i.push(o)}return[i]}for(var s=[],l=[],n=0,a=r.length;n<a;n++){var o=r[n];vv(o)?l.length&&(l.length===1&&!t||s.push(l),l=[]):l.push(o)}return l.length&&s.push(l),s}function Sy(r){for(var e=[],t=0;t<r.length;t++){var i=r[t];if(i){var n=t===0?"M":"L";e.push([n,i.x,i.y])}}var a=r[0];return a&&(e.push(["L",a.x,a.y]),e.push(["z"])),e}function Cy(r){for(var e=r.length/2,t=[],i=[],n=0;n<r.length;n++)n<e?t.push(r[n]):i.push(r[n]);var a=Ro(t,!1),o=Ro(i,!1);i.length&&a.push(["L",i[0].x,i[0].y]),o.shift();var s=a.concat(o);return t.length&&s.push(["L",t[0].x,t[0].y]),s.push(["z"]),s}function Ft(r,e,t,i){i===void 0&&(i="");var n=r.style,a=n===void 0?{}:n,o=r.defaultStyle,s=r.color,l=r.size,u=g.__assign(g.__assign({},o),a);return s&&(e&&(a.stroke||(u.stroke=s)),t&&(a.fill||(u.fill=s))),i&&D(a[i])&&!D(l)&&(u[i]=l),u}function My(r){return Y({},{fill:"#CCD6EC",fillOpacity:.3},M(r,["background","style"]))}function Sc(r){var e=r.x,t=O(r.y)?r.y:[r.y];return t.map(function(i,n){return{x:O(e)?e[n]:e,y:i}})}var ZM={line:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},dot:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},dash:function(r,e,t){return[["M",r-t,e],["L",r+t,e]]},smooth:function(r,e,t){return[["M",r-t,e],["A",t/2,t/2,0,1,1,r,e],["A",t/2,t/2,0,1,0,r+t,e]]},hv:function(r,e,t){return[["M",r-t-1,e-2.5],["L",r,e-2.5],["L",r,e+2.5],["L",r+t+1,e+2.5]]},vh:function(r,e,t){return[["M",r-t-1,e+2.5],["L",r,e+2.5],["L",r,e-2.5],["L",r+t+1,e-2.5]]},hvh:function(r,e,t){return[["M",r-(t+1),e+2.5],["L",r-t/2,e+2.5],["L",r-t/2,e-2.5],["L",r+t/2,e-2.5],["L",r+t/2,e+2.5],["L",r+t+1,e+2.5]]},vhv:function(r,e){return[["M",r-5,e+2.5],["L",r-5,e],["L",r,e],["L",r,e-3],["L",r,e+3],["L",r+6.5,e+3]]}};function Ay(r,e){var t=r.color;return{symbol:ZM[e],style:{lineWidth:2,r:6,stroke:t}}}function QM(r,e,t){for(var i=r.isStack,n=r.connectNulls,a=r.isInCircle,o=r.showSinglePoint,s=Ft(r,!0,!1,"lineWidth"),l=Ls(r.points,n,o),u=[],c=0,h=l.length;c<h;c++){var f=l[c];u=u.concat(Fy(f,a,i,e,t,s))}return s.path=u,s}function vu(r,e,t,i,n){if(r.length===1)return[["M",r[0].x,r[0].y-n.lineWidth/2],["L",r[0].x,r[0].y],["L",r[0].x,r[0].y+n.lineWidth/2]];var a;return t?(e&&r.length&&r.push({x:r[0].x,y:r[0].y}),a=Ro(r,!1,i)):(a=ba(r,!1),e&&a.push(["Z"])),a}function KM(r,e,t,i,n,a){var o=[],s=[];S(r,function(c){var h=Sc(c);o.push(h[1]),s.push(h[0])});var l=vu(o,e,i,n,a),u=vu(s,e,i,n,a);return t?l:l.concat(u)}function Fy(r,e,t,i,n,a){if(r.length){var o=r[0];return O(o.y)?KM(r,e,t,i,n,a):vu(r,e,i,n,a)}return[]}Yr("line",{defaultShapeType:"line"});S(["line","dot","dash","smooth"],function(r){lt("line",r,{draw:function(e,t){var i=r==="smooth",n;if(i){var a=this.coordinate,o=a.start,s=a.end;n=[[o.x,s.y],[s.x,o.y]]}var l=QM(e,i,n),u=t.addShape({type:"path",attrs:l,name:"line",capture:!i});return u},getMarker:function(e){return Ay(e,r)}})});var se={getLegendItems:by,translate:Ca,rotate:bc,zoom:YM,transform:Es,getAngle:ea,getSectorPath:Lr,polarToCartesian:Tt,getDelegationObject:di,getTooltipItems:yc,getMappingValue:fu,getPath:Fy,getPathPoints:Ls},mr={100:"#000",95:"#0D0D0D",85:"#262626",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},dt={100:"#FFFFFF",95:"#F2F2F2",85:"#D9D9D9",65:"#A6A6A6",45:"#737373",25:"#404040",15:"#262626",6:"#0F0F0F"},Te=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#E86452","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],JM=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#E86452","#F8D0CB","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],tA=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],eA=function(r){r===void 0&&(r={});var e=r.paletteQualitative10,t=e===void 0?Te:e,i=r.paletteQualitative20,n=i===void 0?JM:i,a=r.brandColor,o=a===void 0?t[0]:a,s={backgroundColor:"#141414",brandColor:o,subColor:"rgba(255,255,255,0.05)",paletteQualitative10:t,paletteQualitative20:n,paletteSemanticRed:"#F4664A",paletteSemanticGreen:"#30BF78",paletteSemanticYellow:"#FAAD14",paletteSequence:tA,fontFamily:`"Segoe UI", Roboto, "Helvetica Neue", Arial,
  27. "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
  28. "Noto Color Emoji"`,axisLineBorderColor:dt[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:dt[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:mr[85],axisTickLineBorderColor:dt[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:dt[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:dt[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:dt[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:dt[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:Te[0],legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:dt[65],legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendSpacing:16,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:dt[45],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:dt[45],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:dt[65],legendPageNavigatorTextFontSize:12,sliderRailFillColor:dt[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:dt[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:mr[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:mr[25],annotationArcBorderColor:dt[15],annotationArcBorder:1,annotationLineBorderColor:dt[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:dt[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:dt[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:dt[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"#1f1f1f",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 2px 4px rgba(0,0,0,.5)",tooltipContainerBorderRadius:3,tooltipTextFillColor:dt[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:dt[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:mr[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:dt[65],overflowLabelFillColorDark:"#2c3542",overflowLabelFillColorLight:"#ffffff",overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:mr[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:dt[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:"#fff",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(255,255,255,0.65)",scrollbarThumbFillColor:"rgba(0,0,0,0.35)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.45)",pointFillColor:Te[0],pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:mr[100],pointBorderOpacity:1,pointActiveBorderColor:dt[100],pointSelectedBorder:2,pointSelectedBorderColor:dt[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:Te[0],hollowPointBorderOpacity:.95,hollowPointFillColor:mr[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:dt[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:dt[100],hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:Te[0],lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:Te[0],areaFillOpacity:.25,areaActiveFillColor:Te[0],areaActiveFillOpacity:.5,areaSelectedFillColor:Te[0],areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:Te[0],hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:dt[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:dt[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:Te[0],intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:dt[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:dt[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:Te[0],hollowIntervalBorderOpacity:1,hollowIntervalFillColor:mr[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:dt[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:dt[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return g.__assign(g.__assign({},s),r)},rA=eA();function iA(){return window?window.devicePixelRatio:1}function Ty(r,e,t,i){var n=r-t,a=e-i;return Math.sqrt(n*n+a*a)}function Jr(r,e,t,i,n,a){return n>=r&&n<=r+t&&a>=e&&a<=e+i}function aa(r,e){return!(e.minX>r.maxX||e.maxX<r.minX||e.minY>r.maxY||e.maxY<r.minY)}function nA(r,e){return!r||!e?r||e:{minX:Math.min(r.minX,e.minX),minY:Math.min(r.minY,e.minY),maxX:Math.max(r.maxX,e.maxX),maxY:Math.max(r.maxY,e.maxY)}}function dv(r,e){return r[0]===e[0]&&r[1]===e[1]}var aA=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,oA=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,sA=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Ey=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function ky(r,e){var t=r.match(Ey);S(t,function(i){var n=i.split(":");e.addColorStop(n[0],n[1])})}function lA(r,e,t){var i=aA.exec(t),n=parseFloat(i[1])%360*(Math.PI/180),a=i[2],o=e.getBBox(),s,l;n>=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&&n<Math.PI?(s={x:o.maxX,y:o.minY},l={x:o.minX,y:o.maxY}):Math.PI<=n&&n<3/2*Math.PI?(s={x:o.maxX,y:o.maxY},l={x:o.minX,y:o.minY}):(s={x:o.minX,y:o.maxY},l={x:o.maxX,y:o.minY});var u=Math.tan(n),c=u*u,h=(l.x-s.x+u*(l.y-s.y))/(c+1)+s.x,f=u*(l.x-s.x+u*(l.y-s.y))/(c+1)+s.y,v=r.createLinearGradient(s.x,s.y,h,f);return ky(a,v),v}function uA(r,e,t){var i=oA.exec(t),n=parseFloat(i[1]),a=parseFloat(i[2]),o=parseFloat(i[3]),s=i[4];if(o===0){var l=s.match(Ey);return l[l.length-1].split(":")[1]}var u=e.getBBox(),c=u.maxX-u.minX,h=u.maxY-u.minY,f=Math.sqrt(c*c+h*h)/2,v=r.createRadialGradient(u.minX+c*n,u.minY+h*a,0,u.minX+c/2,u.minY+h/2,o*f);return ky(s,v),v}function cA(r,e,t){if(e.get("patternSource")&&e.get("patternSource")===t)return e.get("pattern");var i,n,a=sA.exec(t),o=a[1],s=a[2];function l(){i=r.createPattern(n,o),e.set("pattern",i),e.set("patternSource",t)}switch(o){case"a":o="repeat";break;case"x":o="repeat-x";break;case"y":o="repeat-y";break;case"n":o="no-repeat";break;default:o="no-repeat"}return n=new Image,s.match(/^data:/i)||(n.crossOrigin="Anonymous"),n.src=s,n.complete?l():(n.onload=l,n.src=n.src),i}function hA(r,e,t){var i=e.getBBox();if(isNaN(i.x)||isNaN(i.y)||isNaN(i.width)||isNaN(i.height))return t;if(K(t)){if(t[1]==="("||t[2]==="("){if(t[0]==="l")return lA(r,e,t);if(t[0]==="r")return uA(r,e,t);if(t[0]==="p")return cA(r,e,t)}return t}if(t instanceof CanvasPattern)return t}function fA(r){var e=0,t=0,i=0,n=0;return O(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,[e,t,i,n]}function Ha(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function du(r,e){return Ha(r)*Ha(e)?(r[0]*e[0]+r[1]*e[1])/(Ha(r)*Ha(e)):1}function gv(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(du(r,e))}function zo(r,e){var t=e[1],i=e[2],n=jo(Zo(e[3]),Math.PI*2),a=e[4],o=e[5],s=r[0],l=r[1],u=e[6],c=e[7],h=Math.cos(n)*(s-u)/2+Math.sin(n)*(l-c)/2,f=-1*Math.sin(n)*(s-u)/2+Math.cos(n)*(l-c)/2,v=h*h/(t*t)+f*f/(i*i);v>1&&(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 y=i?p*t*f/i:0,m=t?p*-i*h/t:0,x=(s+u)/2+Math.cos(n)*y-Math.sin(n)*m,_=(l+c)/2+Math.sin(n)*y+Math.cos(n)*m,w=[(h-y)/t,(f-m)/i],b=[(-1*h-y)/t,(-1*f-m)/i],C=gv([1,0],w),A=gv(w,b);return du(w,b)<=-1&&(A=Math.PI),du(w,b)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:_,rx:dv(r,[u,c])?0:t,ry:dv(r,[u,c])?0:i,startAngle:C,endAngle:C+A,xRotation:n,arcFlag:a,sweepFlag:o}}var Vo=Math.sin,Go=Math.cos,Cc=Math.atan2,Xa=Math.PI;function Ly(r,e,t,i,n,a,o){var s=e.stroke,l=e.lineWidth,u=t-n,c=i-a,h=Cc(c,u),f=new Ec({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*Go(Xa/6)+","+10*Vo(Xa/6)+" L0,0 L"+10*Go(Xa/6)+",-"+10*Vo(Xa/6),stroke:s,lineWidth:l}});f.translate(n,a),f.rotateAtPoint(n,a,h),r.set(o?"startArrowShape":"endArrowShape",f)}function Iy(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,y=g.__rest(h,["d","fill","stroke","lineWidth"]),m=t-n,x=i-a,_=Cc(x,m);f&&(n=n-Go(_)*f,a=a-Vo(_)*f);var w=new Ec({type:"path",canvas:r.get("canvas"),isArrowShape:!0,attrs:g.__assign(g.__assign({},y),{stroke:d||u,lineWidth:p||c,fill:v})});w.translate(n,a),w.rotateAtPoint(n,a,_),r.set(o?"startArrowShape":"endArrowShape",w)}function li(r,e,t,i,n){var a=Cc(i-e,t-r);return{dx:Go(a)*n,dy:Vo(a)*n}}function Mc(r,e,t,i,n,a){typeof e.startArrow=="object"?Iy(r,e,t,i,n,a,!0):e.startArrow?Ly(r,e,t,i,n,a,!0):r.set("startArrowShape",null)}function Ac(r,e,t,i,n,a){typeof e.endArrow=="object"?Iy(r,e,t,i,n,a,!1):e.endArrow?Ly(r,e,t,i,n,a,!1):r.set("startArrowShape",null)}var pv={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function ji(r,e){var t=e.attr();for(var i in t){var n=t[i],a=pv[i]?pv[i]:i;a==="matrix"&&n?r.transform(n[0],n[1],n[3],n[4],n[6],n[7]):a==="lineDash"&&r.setLineDash?O(n)&&r.setLineDash(n):(a==="strokeStyle"||a==="fillStyle"?n=hA(r,e,n):a==="globalAlpha"&&(n=n*r.globalAlpha),r[a]=n)}}function gu(r,e,t){for(var i=0;i<e.length;i++){var n=e[i];n.cfg.visible?n.draw(r,t):n.skipDraw()}}function vA(r,e,t){var i=r.get("refreshElements");S(i,function(n){if(n!==r)for(var a=n.cfg.parent;a&&a!==r&&!a.cfg.refresh;)a.cfg.refresh=!0,a=a.cfg.parent}),i[0]===r?Fc(e):pu(e,t)}function pu(r,e){for(var t=0;t<r.length;t++){var i=r[t];if(i.cfg.visible)if(i.cfg.hasChanged)i.cfg.refresh=!0,i.isGroup()&&Fc(i.cfg.children);else if(i.cfg.refresh)i.isGroup()&&pu(i.cfg.children,e);else{var n=dA(i,e);i.cfg.refresh=n,n&&i.isGroup()&&pu(i.cfg.children,e)}}}function Py(r){for(var e=0;e<r.length;e++){var t=r[e];t.cfg.hasChanged=!1,t.isGroup()&&!t.destroyed&&Py(t.cfg.children)}}function Fc(r,e){for(var t=0;t<r.length;t++){var i=r[t];i.cfg.visible&&(i.cfg.refresh=!0,i.isGroup()&&Fc(i.get("children")))}}function dA(r,e){var t=r.cfg.cacheCanvasBBox,i=r.cfg.isInView&&t&&aa(t,e);return i}function Dy(r,e,t,i){var n=t.path,a=t.startArrow,o=t.endArrow;if(n){var s=[0,0],l=[0,0],u={dx:0,dy:0};e.beginPath();for(var c=0;c<n.length;c++){var h=n[c],f=h[0];if(c===0&&a&&a.d){var v=r.getStartTangent();u=li(v[0][0],v[0][1],v[1][0],v[1][1],a.d)}else if(c===n.length-2&&n[c+1][0]==="Z"&&o&&o.d){var d=n[c+1];if(d[0]==="Z"){var v=r.getEndTangent();u=li(v[0][0],v[0][1],v[1][0],v[1][1],o.d)}}else if(c===n.length-1&&o&&o.d&&n[0]!=="Z"){var v=r.getEndTangent();u=li(v[0][0],v[0][1],v[1][0],v[1][1],o.d)}var p=u.dx,y=u.dy;switch(f){case"M":e.moveTo(h[1]-p,h[2]-y),l=[h[1],h[2]];break;case"L":e.lineTo(h[1]-p,h[2]-y);break;case"Q":e.quadraticCurveTo(h[1],h[2],h[3]-p,h[4]-y);break;case"C":e.bezierCurveTo(h[1],h[2],h[3],h[4],h[5]-p,h[6]-y);break;case"A":{var m=void 0;i?(m=i[c],m||(m=zo(s,h),i[c]=m)):m=zo(s,h);var x=m.cx,_=m.cy,w=m.rx,b=m.ry,C=m.startAngle,A=m.endAngle,F=m.xRotation,E=m.sweepFlag;if(e.ellipse)e.ellipse(x,_,w,b,F,C,A,1-E);else{var T=w>b?w:b,k=w>b?1:w/b,P=w>b?b/w:1;e.translate(x,_),e.rotate(F),e.scale(k,P),e.arc(0,0,T,C,A,1-E),e.scale(1/k,1/P),e.rotate(-F),e.translate(-x,-_)}break}case"Z":e.closePath();break}if(f==="Z")s=l;else{var B=h.length;s=[h[B-2],h[B-1]]}}}}function By(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 gA(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=nA(t,n):i?e=t:a&&(e=n)}return e}function pA(r){if(!r.length)return null;var e=[],t=[],i=[],n=[];return S(r,function(a){var o=gA(a);o&&(e.push(o.minX),t.push(o.minY),i.push(o.maxX),n.push(o.maxY))}),{minX:Pe(e),minY:Pe(t),maxX:Se(i),maxY:Se(n)}}function yA(r,e){return!r||!e||!aa(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 Tc=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onCanvasChange=function(t){By(this,t)},e.prototype.getShapeBase=function(){return Jo},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,i){i&&(t.save(),ji(t,i),i.createPath(t),t.restore(),t.clip(),i._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,i=[],n=[];S(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=Pe(i),s=Se(i),l=Pe(n),u=Se(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",aa(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(),ji(t,this),this._applyClip(t,this.getClip()),gu(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}(as),mA=function(r){g.__extends(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 g.__assign(g.__assign({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return Jo},e.prototype.getGroupBase=function(){return Tc},e.prototype.onCanvasChange=function(t){By(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),i=this.getHitLineWidth(),n=ss(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(),ji(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(!aa(i,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),ji(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=aa(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()&&(!D(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&n>0&&(!D(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}(os);const Re=mA;var xA=function(r){g.__extends(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 g.__assign(g.__assign({},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=Ty(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}(Re);const wA=xA;function Wa(r,e,t,i){return r/(t*t)+e/(i*i)}var _A=function(r){g.__extends(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 g.__assign(g.__assign({},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?Wa(v,d,h+l,f+l)<=1:a?Wa(v,d,h,f)<=1:n?Wa(v,d,h-l,f-l)>=1&&Wa(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}(Re);const bA=_A;function yv(r){return r instanceof HTMLElement&&K(r.nodeName)&&r.nodeName.toUpperCase()==="CANVAS"}var SA=function(r){g.__extends(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 g.__assign(g.__assign({},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(K(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)):yv(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||yv(f))&&(!D(l)&&!D(u)&&!D(c)&&!D(h)?t.drawImage(f,l,u,c,h,n,a,o,s):t.drawImage(f,n,a,o,s))},e}(Re);const CA=SA;function Ar(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?Vt.pointToLine(r,e,t,i,a,o)<=n/2:!1}var MA=function(r){g.__extends(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 g.__assign(g.__assign({},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&&Mc(this,t,a,o,i,n),l&&Ac(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 Ar(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=li(n,a,o,s,i.startArrow.d)),u&&u.d&&(h=li(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 Vt.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 Vt.pointAt(n,a,o,s,t)},e}(Re);const AA=MA;var FA=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig,TA=/[^\s\,]+/ig;function EA(r){var e=r||[];if(O(e))return e;if(K(e))return e=e.match(FA),S(e,function(t,i){if(t=t.match(TA),t[0].length>1){var n=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=n}S(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[i]=t}),e}var zn=`
  29. \v\f\r   ᠎              \u2028\u2029`,kA=new RegExp("([a-z])["+zn+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+zn+"]*,?["+zn+"]*)+)","ig"),LA=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+zn+"]*,?["+zn+"]*","ig");function IA(r){if(!r)return null;if(O(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(kA,function(i,n,a){var o=[],s=n.toLowerCase();if(a.replace(LA,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}var PA=/[a-z]/;function mv(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function Oy(r){var e=IA(r);if(!e||!e.length)return[["M",0,0]];for(var t=!1,i=0;i<e.length;i++){var n=e[i][0];if(PA.test(n)||["V","H","T","S"].indexOf(n)>=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;i<f;i++){var v=e[i],d=a[i-1],p=[],n=v[0],y=n.toUpperCase();if(n!==y)switch(p[0]=y,y){case"A":p[1]=v[1],p[2]=v[2],p[3]=v[3],p[4]=v[4],p[5]=v[5],p[6]=+v[6]+o,p[7]=+v[7]+s;break;case"V":p[1]=+v[1]+s;break;case"H":p[1]=+v[1]+o;break;case"M":l=+v[1]+o,u=+v[2]+s,p[1]=l,p[2]=u;break;default:for(var m=1,x=v.length;m<x;m++)p[m]=+v[m]+(m%2?o:s)}else p=e[i];switch(y){case"Z":o=+l,s=+u;break;case"H":o=p[1],p=["L",o,s];break;case"V":s=p[1],p=["L",o,s];break;case"T":o=p[1],s=p[2];var _=mv([d[1],d[2]],[d[3],d[4]]);p=["Q",_[0],_[1],o,s];break;case"S":o=p[p.length-2],s=p[p.length-1];var w=d.length,b=mv([d[w-4],d[w-3]],[d[w-2],d[w-1]]);p=["C",b[0],b[1],p[1],p[2],o,s];break;case"M":l=p[p.length-2],u=p[p.length-1];break;default:o=p[p.length-2],s=p[p.length-1]}a.push(p)}return a}function qa(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function yu(r,e){return qa(r)*qa(e)?(r[0]*e[0]+r[1]*e[1])/(qa(r)*qa(e)):1}function xv(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(yu(r,e))}function mu(r,e){return r[0]===e[0]&&r[1]===e[1]}function DA(r,e){var t=e[1],i=e[2],n=jo(Zo(e[3]),Math.PI*2),a=e[4],o=e[5],s=r[0],l=r[1],u=e[6],c=e[7],h=Math.cos(n)*(s-u)/2+Math.sin(n)*(l-c)/2,f=-1*Math.sin(n)*(s-u)/2+Math.cos(n)*(l-c)/2,v=h*h/(t*t)+f*f/(i*i);v>1&&(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 y=i?p*t*f/i:0,m=t?p*-i*h/t:0,x=(s+u)/2+Math.cos(n)*y-Math.sin(n)*m,_=(l+c)/2+Math.sin(n)*y+Math.cos(n)*m,w=[(h-y)/t,(f-m)/i],b=[(-1*h-y)/t,(-1*f-m)/i],C=xv([1,0],w),A=xv(w,b);return yu(w,b)<=-1&&(A=Math.PI),yu(w,b)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:x,cy:_,rx:mu(r,[u,c])?0:t,ry:mu(r,[u,c])?0:i,startAngle:C,endAngle:C+A,xRotation:n,arcFlag:a,sweepFlag:o}}function wv(r,e){return[e[0]+(e[0]-r[0]),e[1]+(e[1]-r[1])]}function BA(r){r=EA(r);for(var e=[],t=null,i=null,n=null,a=0,o=r.length,s=0;s<o;s++){var l=r[s];i=r[s+1];var u=l[0],c={command:u,prePoint:t,params:l,startTangent:null,endTangent:null};switch(u){case"M":n=[l[1],l[2]],a=s;break;case"A":var h=DA(t,l);c.arcParams=h;break}if(u==="Z")t=n,i=r[a+1];else{var f=l.length;t=[l[f-2],l[f-1]]}i&&i[0]==="Z"&&(i=r[a],e[a]&&(e[a].prePoint=t)),c.currentPoint=t,e[a]&&mu(t,e[a].currentPoint)&&(e[a].prePoint=c.prePoint);var v=i?[i[i.length-2],i[i.length-1]]:null;c.nextPoint=v;var d=c.prePoint;if(["L","H","V"].includes(u))c.startTangent=[d[0]-t[0],d[1]-t[1]],c.endTangent=[t[0]-d[0],t[1]-d[1]];else if(u==="Q"){var p=[l[1],l[2]];c.startTangent=[d[0]-p[0],d[1]-p[1]],c.endTangent=[t[0]-p[0],t[1]-p[1]]}else if(u==="T"){var y=e[s-1],p=wv(y.currentPoint,d);y.command==="Q"?(c.command="Q",c.startTangent=[d[0]-p[0],d[1]-p[1]],c.endTangent=[t[0]-p[0],t[1]-p[1]]):(c.command="TL",c.startTangent=[d[0]-t[0],d[1]-t[1]],c.endTangent=[t[0]-d[0],t[1]-d[1]])}else if(u==="C"){var m=[l[1],l[2]],x=[l[3],l[4]];c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[t[0]-x[0],t[1]-x[1]],c.startTangent[0]===0&&c.startTangent[1]===0&&(c.startTangent=[m[0]-x[0],m[1]-x[1]]),c.endTangent[0]===0&&c.endTangent[1]===0&&(c.endTangent=[x[0]-m[0],x[1]-m[1]])}else if(u==="S"){var y=e[s-1],m=wv(y.currentPoint,d),x=[l[1],l[2]];y.command==="C"?(c.command="C",c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[t[0]-x[0],t[1]-x[1]]):(c.command="SQ",c.startTangent=[d[0]-x[0],d[1]-x[1]],c.endTangent=[t[0]-x[0],t[1]-x[1]])}else if(u==="A"){var _=.001,w=c.arcParams||{},b=w.cx,C=b===void 0?0:b,A=w.cy,F=A===void 0?0:A,E=w.rx,T=E===void 0?0:E,k=w.ry,P=k===void 0?0:k,B=w.sweepFlag,z=B===void 0?0:B,X=w.startAngle,I=X===void 0?0:X,R=w.endAngle,$=R===void 0?0:R;z===0&&(_*=-1);var G=T*Math.cos(I-_)+C,V=P*Math.sin(I-_)+F;c.startTangent=[G-n[0],V-n[1]];var H=T*Math.cos(I+$+_)+C,Z=P*Math.sin(I+$-_)+F;c.endTangent=[d[0]-H,d[1]-Z]}e.push(c)}return e}var OA={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"]]}},RA=function(r){g.__extends(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 D(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(W(a))s=a,l=s(i,n,o),l=Oy(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");Dy(this,t,{path:i},n)},e.Symbols=OA,e}(Re);const NA=RA;function Ry(r,e,t){var i=us();return r.createPath(i),i.isPointInPath(e,t)}var zA=1e-6;function ml(r){return Math.abs(r)<zA?0:r<0?-1:1}function VA(r,e,t){return(t[0]-r[0])*(e[1]-r[1])===(e[0]-r[0])*(t[1]-r[1])&&Math.min(r[0],e[0])<=t[0]&&t[0]<=Math.max(r[0],e[0])&&Math.min(r[1],e[1])<=t[1]&&t[1]<=Math.max(r[1],e[1])}function Ny(r,e,t){var i=!1,n=r.length;if(n<=2)return!1;for(var a=0;a<n;a++){var o=r[a],s=r[(a+1)%n];if(VA(o,s,[e,t]))return!0;ml(o[1]-t)>0!=ml(s[1]-t)>0&&ml(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(i=!i)}return i}function Fn(r,e,t,i,n,a,o,s){var l=(Math.atan2(s-e,o-r)+Math.PI*2)%(Math.PI*2);if(l<i||l>n)return!1;var u={x:r+t*Math.cos(l),y:e+t*Math.sin(l)};return Ty(u.x,u.y,o,s)<=a/2}var GA=kt;function YA(r){for(var e=!1,t=r.length,i=0;i<t;i++){var n=r[i],a=n[0];if(a==="C"||a==="A"||a==="Q"){e=!0;break}}return e}function $A(r,e,t,i,n){for(var a=!1,o=e/2,s=0;s<r.length;s++){var l=r[s],u=l.currentPoint,c=l.params,h=l.prePoint,f=l.box;if(!(f&&!Jr(f.x-o,f.y-o,f.width+e,f.height+e,t,i))){switch(l.command){case"L":case"Z":a=Ar(h[0],h[1],u[0],u[1],e,t,i);break;case"Q":var v=Gg.pointDistance(h[0],h[1],c[1],c[2],c[3],c[4],t,i);a=v<=e/2;break;case"C":var d=Pn.pointDistance(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],t,i,n);a=d<=e/2;break;case"A":var p=l.arcParams,y=p.cx,m=p.cy,x=p.rx,_=p.ry,w=p.startAngle,b=p.endAngle,C=p.xRotation,A=[t,i,1],F=x>_?x:_,E=x>_?1:x/_,T=x>_?_/x:1,k=GA(null,[["t",-y,-m],["r",-C],["s",1/E,1/T]]);Hn(A,A,k),a=Fn(0,0,F,w,b,e,A[0],A[1]);break}if(a)break}}return a}function HA(r){for(var e=r.length,t=[],i=[],n=[],a=0;a<e;a++){var o=r[a],s=o[0];s==="M"?(n.length&&(i.push(n),n=[]),n.push([o[1],o[2]])):s==="Z"?n.length&&(t.push(n),n=[]):n.push([o[1],o[2]])}return n.length>0&&i.push(n),{polygons:t,polylines:i}}const Ua=g.__assign({hasArc:YA,extractPolygons:HA,isPointInStroke:$A},Wu);function _v(r,e,t){for(var i=!1,n=0;n<r.length;n++){var a=r[n];if(i=Ny(a,e,t),i)break}return i}var XA=function(r){g.__extends(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 g.__assign(g.__assign({},t),{startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this._setPathArr(t.path),this.setArrow()},e.prototype.onAttrChange=function(t,i,n){r.prototype.onAttrChange.call(this,t,i,n),t==="path"&&this._setPathArr(i),this.setArrow()},e.prototype._setPathArr=function(t){this.attrs.path=Oy(t);var i=Ua.hasArc(t);this.set("hasArc",i),this.set("paramsCache",{}),this.set("segments",null),this.set("curve",null),this.set("tCache",null),this.set("totalLength",null)},e.prototype.getSegments=function(){var t=this.get("segements");return t||(t=BA(this.attr("path")),this.set("segments",t)),t},e.prototype.setArrow=function(){var t=this.attr(),i=t.startArrow,n=t.endArrow;if(i){var a=this.getStartTangent();Mc(this,t,a[0][0],a[0][1],a[1][0],a[1][1])}if(n){var a=this.getEndTangent();Ac(this,t,a[0][0],a[0][1],a[1][0],a[1][1])}},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){var s=this.getSegments(),l=this.get("hasArc"),u=!1;if(n){var c=this.getTotalLength();u=Ua.isPointInStroke(s,o,t,i,c)}if(!u&&a)if(l)u=Ry(this,t,i);else{var h=this.attr("path"),f=Ua.extractPolygons(h);u=_v(f.polygons,t,i)||_v(f.polylines,t,i)}return u},e.prototype.createPath=function(t){var i=this.attr(),n=this.get("paramsCache");Dy(this,t,i,n)},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.get("totalLength");return D(t)?(this._calculateCurve(),this._setTcache(),this.get("totalLength")):t},e.prototype.getPoint=function(t){var i=this.get("tCache");i||(this._calculateCurve(),this._setTcache(),i=this.get("tCache"));var n,a,o=this.get("curve");if(!i||i.length===0)return o?{x:o[0][1],y:o[0][2]}:null;S(i,function(c,h){t>=c[0]&&t<=c[1]&&(n=(t-c[0])/(c[1]-c[0]),a=h)});var s=o[a];if(D(s)||D(a))return null;var l=s.length,u=o[a+1];return Pn.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",Ua.pathToCurve(t))},e.prototype._setTcache=function(){var t=0,i=0,n=[],a,o,s,l,u=this.get("curve");if(u){if(S(u,function(c,h){s=u[h+1],l=c.length,s&&(t+=Pn.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}S(u,function(c,h){s=u[h+1],l=c.length,s&&(a=[],a[0]=i/t,o=Pn.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}(Re);const Ec=XA;function zy(r,e,t,i,n){var a=r.length;if(a<2)return!1;for(var o=0;o<a-1;o++){var s=r[o][0],l=r[o][1],u=r[o+1][0],c=r[o+1][1];if(Ar(s,l,u,c,e,t,i))return!0}if(n){var h=r[0],f=r[a-1];if(Ar(h[0],h[1],f[0],f[1],e,t,i))return!0}return!1}var WA=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isInStrokeOrPath=function(t,i,n,a,o){var s=this.attr().points,l=!1;return n&&(l=zy(s,o,t,i,!0)),!l&&a&&(l=Ny(s,t,i)),l},e.prototype.createPath=function(t){var i=this.attr(),n=i.points;if(!(n.length<2)){t.beginPath();for(var a=0;a<n.length;a++){var o=n[a];a===0?t.moveTo(o[0],o[1]):t.lineTo(o[0],o[1])}t.closePath()}},e}(Re);const qA=WA;var UA=function(r){g.__extends(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 g.__assign(g.__assign({},t),{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(),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.setArrow=function(){var t=this.attr(),i=this.attrs,n=i.points,a=i.startArrow,o=i.endArrow,s=n.length,l=n[0][0],u=n[0][1],c=n[s-1][0],h=n[s-1][1];a&&Mc(this,t,n[1][0],n[1][1],l,u),o&&Ac(this,t,n[s-2][0],n[s-2][1],c,h)},e.prototype.isFill=function(){return!1},e.prototype.isInStrokeOrPath=function(t,i,n,a,o){if(!n||!o)return!1;var s=this.attr().points;return zy(s,o,t,i,!1)},e.prototype.isStroke=function(){return!0},e.prototype.createPath=function(t){var i=this.attr(),n=i.points,a=i.startArrow,o=i.endArrow,s=n.length;if(!(n.length<2)){var l=n[0][0],u=n[0][1],c=n[s-1][0],h=n[s-1][1];if(a&&a.d){var f=li(l,u,n[1][0],n[1][1],a.d);l+=f.dx,u+=f.dy}if(o&&o.d){var f=li(n[s-2][0],n[s-2][1],c,h,o.d);c-=f.dx,h-=f.dy}t.beginPath(),t.moveTo(l,u);for(var v=0;v<s-1;v++){var d=n[v];t.lineTo(d[0],d[1])}t.lineTo(c,h)}},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().points,i=this.get("totalLength");return D(i)?(this.set("totalLength",Hg.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 S(n,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Vt.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;S(t,function(l,u){t[u+1]&&(o=[],o[0]=n/i,s=Vt.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}(Re);const jA=UA;function ZA(r,e,t,i,n,a,o){var s=n/2;return Jr(r-s,e-s,t,n,a,o)||Jr(r+t-s,e-s,n,i,a,o)||Jr(r+s,e+i-s,t,n,a,o)||Jr(r-s,e+s,n,i,a,o)}function QA(r,e,t,i,n,a,o,s){return Ar(r+n,e,r+t-n,e,a,o,s)||Ar(r+t,e+n,r+t,e+i-n,a,o,s)||Ar(r+t-n,e+i,r+n,e+i,a,o,s)||Ar(r,e+i-n,r,e+n,a,o,s)||Fn(r+t-n,e+n,n,1.5*Math.PI,2*Math.PI,a,o,s)||Fn(r+t-n,e+i-n,n,0,.5*Math.PI,a,o,s)||Fn(r+n,e+i-n,n,.5*Math.PI,Math.PI,a,o,s)||Fn(r+n,e+n,n,Math.PI,1.5*Math.PI,a,o,s)}var KA=function(r){g.__extends(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 g.__assign(g.__assign({},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=QA(l,u,c,h,f,o,t,i)),!d&&a&&(d=Ry(this,t,i)),d}else{var v=o/2;if(a&&n)return Jr(l-v,u-v,c+v,h+v,t,i);if(a)return Jr(l,u,c,h,t,i);if(n)return ZA(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=fA(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}(Re);const JA=KA;var tF=function(r){g.__extends(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 g.__assign(g.__assign({},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=hs(t)},e.prototype._setText=function(t){var i=null;K(t)&&t.indexOf(`
  30. `)!==-1&&(i=t.split(`
  31. `)),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=cs(a.text,a.fontSize,a.lineHeight),f;S(i,function(v,d){f=l+d*(c+u)-h+u,o==="middle"&&(f+=h-u-(h-u)/2),o==="top"&&(f+=h-u),D(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;D(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&&(!D(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!D(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}(Re);const eF=tF;function rF(r,e){if(e){var t=rs(e);return ir(t,r)}return r}function Vy(r,e,t){var i=r.getTotalMatrix();if(i){var n=rF([e,t,1],i),a=n[0],o=n[1];return[a,o]}return[e,t]}function bv(r,e,t){if(r.isCanvas&&r.isCanvas())return!0;if(!Xn(r)||r.cfg.isInView===!1)return!1;if(r.cfg.clipShape){var i=Vy(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 Gy(r,e,t){if(!bv(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=Gy(s,e,t);else if(bv(s,e,t)){var l=s,u=Vy(s,e,t),c=u[0],h=u[1];l.isInShape(c,h)&&(i=s)}if(i)break}return i}var iF=function(r){g.__extends(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 Jo},e.prototype.getGroupBase=function(){return Tc},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||iA();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=Gy(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=pA(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=yA(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&&(Vx(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),ji(t,this),gu(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(),ji(t,this),vA(this,n,a),gu(t,n,a),t.restore()):i.length&&Py(i),S(i,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,i=this.get("drawFrame");i||(i=Gx(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)}),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}(ns),nF="0.5.12";const aF=Object.freeze(Object.defineProperty({__proto__:null,AbstractCanvas:ns,AbstractGroup:as,AbstractShape:os,Base:es,Canvas:iF,Event:ya,Group:Tc,PathUtil:Wu,Shape:Jo,assembleFont:hs,getArcParams:zo,getBBoxMethod:ss,getOffScreenContext:us,getTextHeight:cs,invert:rs,isAllowCapture:Xn,multiplyVec2:ir,registerBBox:Me,registerEasing:Bg,version:nF},Symbol.toStringTag,{value:"Module"}));var xu={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},st={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 Ce(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Yy(r){var e=xu[r.type],t=r.getParent();if(!e)throw new Error("the type "+r.type+" is not supported by svg");var i=Ce(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 $y(r,e){var t=r.get("el"),i=Yx(t.children).sort(e),n=document.createDocumentFragment();i.forEach(function(a){n.appendChild(a)}),t.appendChild(n)}function oF(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(a<e){var o=i[e+1];o?t.insertBefore(r,o):t.appendChild(r)}}else t.appendChild(r)}function sF(r,e){var t=r.cfg.el,i=r.attr(),n={dx:i.shadowOffsetX,dy:i.shadowOffsetY,blur:i.shadowBlur,color:i.shadowColor};if(!n.dx&&!n.dy&&!n.blur&&!n.color)t.removeAttribute("filter");else{var a=e.find("filter",n);a||(a=e.addShadow(n)),t.setAttribute("filter","url(#"+a+")")}}function Ma(r){var e=r.attr().matrix;if(e){for(var t=r.cfg.el,i=[],n=0;n<9;n+=3)i.push(e[n]+","+e[n+1]);i=i.join(","),i.indexOf("NaN")===-1?t.setAttribute("transform","matrix("+i+")"):console.warn("invalid matrix:",e)}}function oa(r,e){var t=r.getClip(),i=r.get("el");if(!t)i.removeAttribute("clip-path");else if(t&&!i.hasAttribute("clip-path")){Yy(t),t.createPath(e);var n=e.addClip(t);i.setAttribute("clip-path","url(#"+n+")")}}function Hy(r,e){e.forEach(function(t){t.draw(r)})}function Xy(r,e){var t=r.get("canvas");if(t&&t.get("autoDraw")){var i=t.get("context"),n=r.getParent(),a=n?n.getChildren():[t],o=r.get("el");if(e==="remove"){var s=r.get("isClipShape");if(s){var l=o&&o.parentNode,u=l&&l.parentNode;l&&u&&u.removeChild(l)}else o&&o.parentNode&&o.parentNode.removeChild(o)}else if(e==="show")o.setAttribute("visibility","visible");else if(e==="hide")o.setAttribute("visibility","hidden");else if(e==="zIndex")oF(o,a.indexOf(r));else if(e==="sort"){var c=r.get("children");c&&c.length&&$y(r,function(h,f){return c.indexOf(h)-c.indexOf(f)?1:0})}else e==="clear"?o&&(o.innerHTML=""):e==="matrix"?Ma(r):e==="clip"?oa(r,i):e==="attr"||e==="add"&&r.draw(i)}}var kc=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.isEntityGroup=function(){return!0},e.prototype.createDom=function(){var t=Ce("g");this.set("el",t);var i=this.getParent();if(i){var n=i.get("el");n||(n=i.createDom(),i.set("el",n)),n.appendChild(t)}return t},e.prototype.afterAttrsChange=function(t){r.prototype.afterAttrsChange.call(this,t);var i=this.get("canvas");if(i&&i.get("autoDraw")){var n=i.get("context");this.createPath(n,t)}},e.prototype.onCanvasChange=function(t){Xy(this,t)},e.prototype.getShapeBase=function(){return ts},e.prototype.getGroupBase=function(){return e},e.prototype.draw=function(t){var i=this.getChildren(),n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||this.createDom(),oa(this,t),this.createPath(t),i.length&&Hy(t,i))},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");S(i||n,function(o,s){st[s]&&a.setAttribute(st[s],o)}),Ma(this)},e}(as),lF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="svg",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=r.prototype.getDefaultAttrs.call(this);return g.__assign(g.__assign({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.afterAttrsChange=function(t){r.prototype.afterAttrsChange.call(this,t);var i=this.get("canvas");if(i&&i.get("autoDraw")){var n=i.get("context");this.draw(n,t)}},e.prototype.getShapeBase=function(){return ts},e.prototype.getGroupBase=function(){return kc},e.prototype.onCanvasChange=function(t){Xy(this,t)},e.prototype.calculateBBox=function(){var t=this.get("el"),i=null;if(t)i=t.getBBox();else{var n=ss(this.get("type"));n&&(i=n(this))}if(i){var a=i.x,o=i.y,s=i.width,l=i.height,u=this.getHitLineWidth(),c=u/2,h=a-c,f=o-c,v=a+s+c,d=o+l+c;return{x:h,y:f,minX:h,minY:f,maxX:v,maxY:d,width:s+u,height:l+u}}return{x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0}},e.prototype.isFill=function(){var t=this.attr(),i=t.fill,n=t.fillStyle;return(i||n||this.isClipShape())&&this.canFill},e.prototype.isStroke=function(){var t=this.attr(),i=t.stroke,n=t.strokeStyle;return(i||n)&&this.canStroke},e.prototype.draw=function(t,i){var n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||Yy(this),oa(this,t),this.createPath(t,i),this.shadow(t,i),this.strokeAndFill(t,i),this.transform(i))},e.prototype.createPath=function(t,i){},e.prototype.strokeAndFill=function(t,i){var n=i||this.attr(),a=n.fill,o=n.fillStyle,s=n.stroke,l=n.strokeStyle,u=n.fillOpacity,c=n.strokeOpacity,h=n.lineWidth,f=this.get("el");this.canFill&&(i?"fill"in n?this._setColor(t,"fill",a):"fillStyle"in n&&this._setColor(t,"fill",o):this._setColor(t,"fill",a||o),u&&f.setAttribute(st.fillOpacity,u)),this.canStroke&&h>0&&(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(st.strokeOpacity,c),h&&f.setAttribute(st.lineWidth,h))},e.prototype._setColor=function(t,i,n){var a=this.get("el");if(!n){a.setAttribute(st[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(st[i],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(n)){var o=t.find("pattern",n);o||(o=t.addPattern(n)),a.setAttribute(st[i],"url(#"+o+")")}else a.setAttribute(st[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)&&sF(this,t)},e.prototype.transform=function(t){var i=this.attr(),n=(t||i).matrix;n&&Ma(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}(os);const Ae=lF;var uF=function(r){g.__extends(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 g.__assign(g.__assign({},t),{x:0,y:0,r:0})},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");S(i||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):st[s]&&a.setAttribute(st[s],o)})},e}(Ae);const cF=uF;var hF=function(r){g.__extends(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(S(i||n,function(u,c){st[c]&&a.setAttribute(st[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}(Ae);const fF=hF;var vF=function(r){g.__extends(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 g.__assign(g.__assign({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,i){var n=this.attr(),a=this.get("el");S(i||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):st[s]&&a.setAttribute(st[s],o)})},e}(Ae);const dF=vF;var gF=function(r){g.__extends(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 g.__assign(g.__assign({},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");S(i||a,function(s,l){l==="img"?n._setImage(a.img):st[l]&&o.setAttribute(st[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(K(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&&K(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}(Ae);const pF=gF;var yF=function(r){g.__extends(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 g.__assign(g.__assign({},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");S(i||n,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var l=pt(o)?t.addArrow(n,st[s]):t.getDefaultArrow(n,st[s]);a.setAttribute(st[s],"url(#"+l+")")}else a.removeAttribute(st[s]);else st[s]&&a.setAttribute(st[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr(),i=t.x1,n=t.y1,a=t.x2,o=t.y2;return Vt.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 Vt.pointAt(n,a,o,s,t)},e}(Ae);const mF=yF;var ja={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 Sv={get:function(r){return ja[r]},register:function(r,e){ja[r]=e},remove:function(r){delete ja[r]},getAll:function(){return ja}};var xF=function(r){g.__extends(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 O(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 W(o)?s=o:s=Sv.get(o),s?s(i,n,a):(console.warn(s+" symbol is not exist."),null)},e.symbolsFactory=Sv,e}(Ae);const wF=xF;var _F=function(r){g.__extends(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 g.__assign(g.__assign({},t),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,i){var n=this,a=this.attr(),o=this.get("el");S(i||a,function(s,l){if(l==="path"&&O(s))o.setAttribute("d",n._formatPath(s));else if(l==="startArrow"||l==="endArrow")if(s){var u=pt(s)?t.addArrow(a,st[l]):t.getDefaultArrow(a,st[l]);o.setAttribute(st[l],"url(#"+u+")")}else o.removeAttribute(st[l]);else st[l]&&o.setAttribute(st[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}(Ae);const bF=_F;var SF=function(r){g.__extends(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");S(i||n,function(o,s){s==="points"&&O(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):st[s]&&a.setAttribute(st[s],o)})},e}(Ae);const CF=SF;var MF=function(r){g.__extends(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 g.__assign(g.__assign({},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");S(i||n,function(o,s){s==="points"&&O(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):st[s]&&a.setAttribute(st[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr().points,i=this.get("totalLength");return D(i)?(this.set("totalLength",Hg.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 S(n,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),Vt.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;S(t,function(l,u){t[u+1]&&(o=[],o[0]=n/i,s=Vt.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}(Ae);const AF=MF;function FF(r){var e=0,t=0,i=0,n=0;return O(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 TF=function(r){g.__extends(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 g.__assign(g.__assign({},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"];S(i||a,function(u,c){l.indexOf(c)!==-1&&!s?(o.setAttribute("d",n._assembleRect(a)),s=!0):l.indexOf(c)===-1&&st[c]&&o.setAttribute(st[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=FF(s);O(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}(Ae);const EF=TF;var Cv=.3,kF={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},LF={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},IF={left:"left",start:"left",center:"middle",right:"end",end:"end"},PF=function(r){g.__extends(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 g.__assign(g.__assign({},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(),S(i||a,function(s,l){l==="text"?n._setText(""+s):l==="matrix"&&s?Ma(n):st[l]&&o.setAttribute(st[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=yg();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",LF[n]||"alphabetic"):t.setAttribute("alignment-baseline",kF[n]||"baseline"),t.setAttribute("text-anchor",IF[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(`
  32. `)){var l=t.split(`
  33. `),u=l.length-1,c="";S(l,function(h,f){f===0?s==="alphabetic"?c+='<tspan x="'+a+'" dy="'+-u+'em">'+h+"</tspan>":s==="top"?c+='<tspan x="'+a+'" dy="0.9em">'+h+"</tspan>":s==="middle"?c+='<tspan x="'+a+'" dy="'+-(u-1)/2+'em">'+h+"</tspan>":s==="bottom"?c+='<tspan x="'+a+'" dy="-'+(u+Cv)+'em">'+h+"</tspan>":s==="hanging"&&(c+='<tspan x="'+a+'" dy="'+(-(u-1)-Cv)+'em">'+h+"</tspan>"):c+='<tspan x="'+a+'" dy="1em">'+h+"</tspan>"}),i.innerHTML=c}else i.innerHTML=t},e}(Ae);const DF=PF;var BF=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,OF=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,RF=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function Wy(r){var e=r.match(RF);if(!e)return"";var t="";return e.sort(function(i,n){return i=i.split(":"),n=n.split(":"),Number(i[0])-Number(n[0])}),S(e,function(i){i=i.split(":"),t+='<stop offset="'+i[0]+'" stop-color="'+i[1]+'"></stop>'}),t}function NF(r,e){var t=BF.exec(r),i=jo(Zo(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<Math.PI?(a={x:1,y:0},o={x:0,y:1}):Math.PI<=i&&i<1.5*Math.PI?(a={x:1,y:1},o={x:0,y:0}):(a={x:0,y:1},o={x:1,y:0});var s=Math.tan(i),l=s*s,u=(o.x-a.x+s*(o.y-a.y))/(l+1)+a.x,c=s*(o.x-a.x+s*(o.y-a.y))/(l+1)+a.y;e.setAttribute("x1",a.x),e.setAttribute("y1",a.y),e.setAttribute("x2",u),e.setAttribute("y2",c),e.innerHTML=Wy(n)}function zF(r,e){var t=OF.exec(r),i=parseFloat(t[1]),n=parseFloat(t[2]),a=parseFloat(t[3]),o=t[4];e.setAttribute("cx",i),e.setAttribute("cy",n),e.setAttribute("r",a),e.innerHTML=Wy(o)}var VF=function(){function r(e){this.cfg={};var t=null,i=Gr("gradient_");return e.toLowerCase()[0]==="l"?(t=Ce("linearGradient"),NF(e,t)):(t=Ce("radialGradient"),zF(e,t)),t.setAttribute("id",i),this.el=t,this.id=i,this.cfg=e,this}return r.prototype.match=function(e,t){return this.cfg===t},r}(),GF={shadowColor:"color",shadowOpacity:"opacity",shadowBlur:"blur",shadowOffsetX:"dx",shadowOffsetY:"dy"},YF={x:"-40%",y:"-40%",width:"200%",height:"200%"},$F=function(){function r(e){this.type="filter",this.cfg={},this.type="filter";var t=Ce("filter");return S(YF,function(i,n){t.setAttribute(n,i)}),this.el=t,this.id=Gr("filter_"),this.el.id=this.id,this.cfg=e,this._parseShadow(e,t),this}return r.prototype.match=function(e,t){if(this.type!==e)return!1;var i=!0,n=this.cfg;return S(Object.keys(n),function(a){if(n[a]!==t[a])return i=!1,!1}),i},r.prototype.update=function(e,t){var i=this.cfg;return i[GF[e]]=t,this._parseShadow(i,this.el),this},r.prototype._parseShadow=function(e,t){var i=`<feDropShadow
  34. dx="`+(e.dx||0)+`"
  35. dy="`+(e.dy||0)+`"
  36. stdDeviation="`+(e.blur?e.blur/10:0)+`"
  37. flood-color="`+(e.color?e.color:"#000")+`"
  38. flood-opacity="`+(e.opacity?e.opacity:1)+`"
  39. />`;t.innerHTML=i},r}(),Mv=function(){function r(e,t){this.cfg={};var i=Ce("marker"),n=Gr("marker_");i.setAttribute("id",n);var a=Ce("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;O(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}(),HF=function(){function r(e){this.type="clip",this.cfg={};var t=Ce("clipPath");this.el=t,this.id=Gr("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}(),XF=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,WF=function(){function r(e){this.cfg={};var t=Ce("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var i=Ce("image");t.appendChild(i);var n=Gr("pattern_");t.id=n,this.el=t,this.id=n,this.cfg=e;var a=XF.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}(),qF=function(){function r(e){var t=Ce("defs"),i=Gr("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;a<i.length;a++)if(i[a].match(e,t)){n=i[a].id;break}return n},r.prototype.findById=function(e){for(var t=this.children,i=null,n=0;n<t.length;n++)if(t[n].id===e){i=t[n];break}return i},r.prototype.add=function(e){this.children.push(e),e.canvas=this.canvas,e.parent=this},r.prototype.getDefaultArrow=function(e,t){var i=e.stroke||e.strokeStyle;if(this.defaultArrow[i])return this.defaultArrow[i].id;var n=new Mv(e,t);return this.defaultArrow[i]=n,this.el.appendChild(n.el),this.add(n),n.id},r.prototype.addGradient=function(e){var t=new VF(e);return this.el.appendChild(t.el),this.add(t),t.id},r.prototype.addArrow=function(e,t){var i=new Mv(e,t);return this.el.appendChild(i.el),this.add(i),i.id},r.prototype.addShadow=function(e){var t=new $F(e);return this.el.appendChild(t.el),this.add(t),t.id},r.prototype.addPattern=function(e){var t=new WF(e);return this.el.appendChild(t.el),this.add(t),t.id},r.prototype.addClip=function(e){var t=new HF(e);return this.el.appendChild(t.el),this.add(t),t.id},r}(),UF=function(r){g.__extends(e,r);function e(t){return r.call(this,g.__assign(g.__assign({},t),{autoDraw:!0,renderer:"svg"}))||this}return e.prototype.getShapeBase=function(){return ts},e.prototype.getGroupBase=function(){return kc},e.prototype.getShape=function(t,i,n){var a=n.target||n.srcElement;if(!xu[a.tagName]){for(var o=a.parentNode;o&&!xu[o.tagName];)o=o.parentNode;a=o}return this.find(function(s){return s.get("el")===a})},e.prototype.createDom=function(){var t=Ce("svg"),i=new qF(t);return t.setAttribute("width",""+this.get("width")),t.setAttribute("height",""+this.get("height")),this.set("context",i),t},e.prototype.onCanvasChange=function(t){var i=this.get("context"),n=this.get("el");if(t==="sort"){var a=this.get("children");a&&a.length&&$y(this,function(s,l){return a.indexOf(s)-a.indexOf(l)?1:0})}else if(t==="clear"){if(n){n.innerHTML="";var o=i.el;o.innerHTML="",n.appendChild(o)}}else t==="matrix"?Ma(this):t==="clip"?oa(this,i):t==="changeSize"&&(n.setAttribute("width",""+this.get("width")),n.setAttribute("height",""+this.get("height")))},e.prototype.draw=function(){var t=this.get("context"),i=this.getChildren();oa(this,t),i.length&&Hy(t,i)},e}(ns),jF="0.5.6";const ZF=Object.freeze(Object.defineProperty({__proto__:null,AbstractCanvas:ns,AbstractGroup:as,AbstractShape:os,Base:es,Canvas:UF,Event:ya,Group:kc,PathUtil:Wu,Shape:ts,assembleFont:hs,getBBoxMethod:ss,getOffScreenContext:us,getTextHeight:cs,invert:rs,isAllowCapture:Xn,multiplyVec2:ir,registerBBox:Me,registerEasing:Bg,version:jF},Symbol.toStringTag,{value:"Module"}));var Lc=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.type="path",i.shapeType="line";var n=t.connectNulls,a=n===void 0?!1:n,o=t.showSinglePoint,s=o===void 0?!0:o;return i.connectNulls=a,i.showSinglePoint=s,i}return e.prototype.updateElements=function(t,i){var n,a,o,s,l,u;i===void 0&&(i=!1);for(var c=new Map,h=new Map,f=[],v=0,d=0;d<t.length;d++){var p=t[d],y=this.getElementId(p);f.push(y),c.set(y,p),h.set(y,v),v++}this.elements=new Array(v);var m=my(this.lastElementsMap,f),x=m.added,_=m.updated,w=m.removed;try{for(var b=g.__values(x),C=b.next();!C.done;C=b.next()){var y=C.value,p=c.get(y),A=this.getShapeFactory(),F=this.getShapeInfo(p),d=h.get(y),E=new dy({shapeFactory:A,container:this.container,offscreenGroup:this.getOffscreenGroup(),elementIndex:d});E.geometry=this,E.animate=this.animateOption,E.draw(F,i),this.elementsMap[y]=E,this.elements[d]=E}}catch(X){n={error:X}}finally{try{C&&!C.done&&(a=b.return)&&a.call(b)}finally{if(n)throw n.error}}try{for(var T=g.__values(_),k=T.next();!k.done;k=T.next()){var y=k.value,p=c.get(y),E=this.lastElementsMap[y],d=h.get(y),F=this.getShapeInfo(p),P=E.getModel();(this.isCoordinateChanged||yy(P,F))&&(E.animate=this.animateOption,E.update(F)),this.elementsMap[y]=E,this.elements[d]=E}}catch(X){o={error:X}}finally{try{k&&!k.done&&(s=T.return)&&s.call(T)}finally{if(o)throw o.error}}try{for(var B=g.__values(w),z=B.next();!z.done;z=B.next()){var y=z.value,E=this.lastElementsMap[y];E.animate=this.animateOption,E.destroy()}}catch(X){l={error:X}}finally{try{z&&!z.done&&(u=B.return)&&u.call(B)}finally{if(l)throw l.error}}},e.prototype.getPointsAndData=function(t){for(var i=[],n=[],a=0,o=t.length;a<o;a++){var s=t[a];i.push({x:s.x,y:s.y}),n.push(s[gt])}return{points:i,data:n}},e.prototype.getShapeInfo=function(t){var i=this.getDrawCfg(t[0]),n=this.getPointsAndData(t),a=n.points,o=n.data;return i.mappingData=t,i.data=o,i.isStack=!!this.getAdjust("stack"),i.points=a,i.connectNulls=this.connectNulls,i.showSinglePoint=this.showSinglePoint,i},e}($r);function QF(r,e,t,i,n){var a=[];if(r.length){for(var o=[],s=[],l=0,u=r.length;l<u;l++){var c=r[l];o.push(c[1]),s.push(c[0])}s=s.reverse(),S([o,s],function(h,f){var v=[],d=i.parsePoints(h),p=d[0];o.length===1&&s.length===1?v=f===0?[["M",p.x-.5,p.y],["L",p.x+.5,p.y]]:[["L",p.x+.5,p.y],["L",p.x-.5,p.y]]:(e&&d.push({x:p.x,y:p.y}),t?v=Ro(d,!1,n):v=ba(d,!1),f>0&&(v[0][0]="L")),a=a.concat(v)}),a.push(["Z"])}return a}function Is(r,e,t,i,n){for(var a=Ft(r,e,!e,"lineWidth"),o=r.connectNulls,s=r.isInCircle,l=r.points,u=r.showSinglePoint,c=Ls(l,o,u),h=[],f=0,v=c.length;f<v;f++){var d=c[f];h=h.concat(QF(d,s,t,i,n))}return a.path=h,a}function qy(r){var e=r.start,t=r.end;return[[e.x,t.y],[t.x,e.y]]}Yr("area",{defaultShapeType:"area",getDefaultPoints:function(r){var e=r.x,t=r.y0,i=O(r.y)?r.y:[t,r.y];return i.map(function(n){return{x:e,y:n}})}});lt("area","area",{draw:function(r,e){var t=Is(r,!1,!1,this),i=e.addShape({type:"path",attrs:t,name:"area"});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){return n===void 0&&(n=5.5),[["M",t-n,i-4],["L",t+n,i-4],["L",t+n,i+4],["L",t-n,i+4],["Z"]]},style:{r:5,fill:e,fillOpacity:1}}}});var KF=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.type="area",i.shapeType="area",i.generatePoints=!0,i.startOnZero=!0;var n=t.startOnZero,a=n===void 0?!0:n,o=t.sortable,s=o===void 0?!1:o,l=t.showSinglePoint,u=l===void 0?!1:l;return i.startOnZero=a,i.sortable=s,i.showSinglePoint=u,i}return e.prototype.getPointsAndData=function(t){for(var i=[],n=[],a=0,o=t.length;a<o;a++){var s=t[a];i.push(s.points),n.push(s[gt])}return{points:i,data:n}},e.prototype.getYMinValue=function(){if(this.startOnZero)return r.prototype.getYMinValue.call(this);var t=this.getYScale();return t.min},e}(Lc);Yr("edge",{defaultShapeType:"line",getDefaultPoints:function(r){return Sc(r)}});lt("edge","line",{draw:function(r,e){var t=Ft(r,!0,!1,"lineWidth"),i=ba(this.parsePoints(r.points),this.coordinate.isPolar);return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});var JF=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="edge",t.shapeType="edge",t.generatePoints=!0,t}return e}($r),tT=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="heatmap",t.paletteCache={},t}return e.prototype.updateElements=function(t,i){for(var n=0;n<t.length;n++){var a=t[n],o=this.prepareRange(a),s=this.prepareSize(),l=M(this.styleOption,["cfg","shadowBlur"]);tt(l)||(l=s/2),this.prepareGreyScaleBlurredCircle(s,l),this.drawWithRange(a,o,s,l)}},e.prototype.color=function(t,i){return this.createAttrOption("color",t,typeof i!="function"?i:""),this},e.prototype.clear=function(){r.prototype.clear.call(this),this.clearShadowCanvasCtx(),this.paletteCache={}},e.prototype.prepareRange=function(t){var i=this.getAttribute("color"),n=i.getFields()[0],a=1/0,o=-1/0;return t.forEach(function(s){var l=s[gt][n];l>o&&(o=l),l<a&&(a=l)}),a===o&&(a=o-1),[a,o]},e.prototype.prepareSize=function(){var t=this.getDefaultValue("size");return tt(t)||(t=this.getDefaultSize()),t},e.prototype.prepareGreyScaleBlurredCircle=function(t,i){var n=this.getGrayScaleBlurredCanvas(),a=t+i,o=n.getContext("2d");n.width=n.height=a*2,o.clearRect(0,0,n.width,n.height),o.shadowOffsetX=o.shadowOffsetY=a*2,o.shadowBlur=i,o.shadowColor="black",o.beginPath(),o.arc(-a,-a,t,0,Math.PI*2,!0),o.closePath(),o.fill()},e.prototype.drawWithRange=function(t,i,n,a){var o,s,l=this.coordinate,u=l.start,c=l.end,h=this.coordinate.getWidth(),f=this.coordinate.getHeight(),v=this.getAttribute("color"),d=v.getFields()[0];this.clearShadowCanvasCtx();var p=this.getShadowCanvasCtx();i&&(t=t.filter(function(T){return T[gt][d]<=i[1]&&T[gt][d]>=i[0]}));var y=this.scales[d];try{for(var m=g.__values(t),x=m.next();!x.done;x=m.next()){var _=x.value,w=this.getDrawCfg(_),b=w.x,C=w.y,A=y.scale(_[gt][d]);this.drawGrayScaleBlurredCircle(b-u.x,C-c.y,n+a,A,p)}}catch(T){o={error:T}}finally{try{x&&!x.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}var F=p.getImageData(0,0,h,f);this.clearShadowCanvasCtx(),this.colorize(F),p.putImageData(F,0,0);var E=this.getImageShape();E.attr("x",u.x),E.attr("y",c.y),E.attr("width",h),E.attr("height",f),E.attr("img",p.canvas),E.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;o<n.length;o+=4){var s=n[o];if(tt(s)){var l=a[s]?a[s]:kr.rgb2arr(i.gradient(s/256));n[o-3]=l[0],n[o-2]=l[1],n[o-1]=l[2],n[o]=s}}},e.prototype.getImageShape=function(){var t=this.imageShape;if(t)return t;var i=this.container;return t=i.addShape({type:"image",attrs:{}}),this.imageShape=t,t},e.prototype.getShapeInfo=function(t){var i=this.getDrawCfg(t[0]),n=t.map(function(a){return a[gt]});return g.__assign(g.__assign({},i),{mappingData:t,data:n})},e}($r);function Ic(r){var e,t,i=r.x,n=r.y,a=r.y0,o=r.size,s,l;O(n)?(e=g.__read(n,2),s=e[0],l=e[1]):(s=a,l=n);var u,c;O(i)?(t=g.__read(i,2),u=t[0],c=t[1]):(u=i-o/2,c=i+o/2);var h=[{x:u,y:s},{x:u,y:l}];return h.push({x:c,y:l},{x:c,y:s}),h}function Pc(r,e){e===void 0&&(e=!0);var t=[],i=r[0];t.push(["M",i.x,i.y]);for(var n=1,a=r.length;n<a;n++)t.push(["L",r[n].x,r[n].y]);return e&&(t.push(["L",i.x,i.y]),t.push(["z"])),t}function Uy(r,e){var t=0,i=0,n=0,a=0;return O(r)?r.length===1?t=i=n=a=r[0]:r.length===2?(t=n=r[0],i=a=r[1]):r.length===3?(t=r[0],i=a=r[1],n=r[2]):(t=r[0],i=r[1],n=r[2],a=r[3]):t=i=n=a=r,t+i>e&&(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 jy(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=M(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=g.__read(Uy(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,y=function(C){return d?-C:C};i.push(["M",n.x,a.y+y(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+y(h)]),i.push(["L",a.x,n.y-y(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-y(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 m=t.getCenter(),x=ea(r,t),_=x.startAngle,w=x.endAngle;if(t.type!=="theta"&&!t.isTransposed)i=Lr(m.x,m.y,t.getRadius(),_,w);else{var b=function(F){return Math.pow(F,2)},c=Math.sqrt(b(m.x-e[0].x)+b(m.y-e[0].y)),h=Math.sqrt(b(m.x-e[2].x)+b(m.y-e[2].y));i=Lr(m.x,m.y,c,t.startAngle,t.endAngle,h)}}return i}function eT(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=Pc(r),o}function Zy(r,e,t){var i=[];return D(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 xn(r,e){return[e,r]}function rT(r,e,t){var i,n,a,o,s,l,u,c=g.__read(g.__spreadArray([],g.__read(r),!1),4),h=c[0],f=c[1],v=c[2],d=c[3],p=g.__read(typeof t=="number"?Array(4).fill(t):t,4),y=p[0],m=p[1],x=p[2],_=p[3];e.isTransposed&&(i=g.__read(xn(f,d),2),f=i[0],d=i[1]),e.isReflect("y")&&(n=g.__read(xn(h,f),2),h=n[0],f=n[1],a=g.__read(xn(v,d),2),v=a[0],d=a[1]),e.isReflect("x")&&(o=g.__read(xn(h,d),2),h=o[0],d=o[1],s=g.__read(xn(f,v),2),f=s[0],v=s[1]);var w=[],b=function(C){return Math.abs(C)};return l=g.__read(Uy([y,m,x,_],Math.min(b(d.x-h.x),b(f.y-h.y))).map(function(C){return b(C)}),4),y=l[0],m=l[1],x=l[2],_=l[3],e.isTransposed&&(u=g.__read([_,y,m,x],4),y=u[0],m=u[1],x=u[2],_=u[3]),h.y<f.y?(w.push(["M",d.x,d.y+x]),x!==0&&w.push(["A",x,x,0,0,0,d.x-x,d.y]),w.push(["L",h.x+_,h.y]),_!==0&&w.push(["A",_,_,0,0,0,h.x,h.y+_]),w.push(["L",f.x,f.y-y]),y!==0&&w.push(["A",y,y,0,0,0,f.x+y,f.y]),w.push(["L",v.x-m,v.y]),m!==0&&w.push(["A",m,m,0,0,0,v.x,v.y-m]),w.push(["L",d.x,d.y+x]),w.push(["z"])):d.x<h.x?(w.push(["M",v.x+m,v.y]),m!==0&&w.push(["A",m,m,0,0,0,v.x,v.y+m]),w.push(["L",d.x,d.y-x]),x!==0&&w.push(["A",x,x,0,0,0,d.x+x,d.y]),w.push(["L",h.x-_,h.y]),_!==0&&w.push(["A",_,_,0,0,0,h.x,h.y-_]),w.push(["L",f.x,f.y+y]),y!==0&&w.push(["A",y,y,0,0,0,f.x-y,f.y]),w.push(["L",v.x+m,v.y]),w.push(["z"])):(w.push(["M",f.x,f.y+y]),y!==0&&w.push(["A",y,y,0,0,1,f.x+y,f.y]),w.push(["L",v.x-m,v.y]),m!==0&&w.push(["A",m,m,0,0,1,v.x,v.y+m]),w.push(["L",d.x,d.y-x]),x!==0&&w.push(["A",x,x,0,0,1,d.x-x,d.y]),w.push(["L",h.x+_,h.y]),_!==0&&w.push(["A",_,_,0,0,1,h.x,h.y-_]),w.push(["L",f.x,f.y+y]),w.push(["z"])),w}Yr("interval",{defaultShapeType:"rect",getDefaultPoints:function(r){return Ic(r)}});lt("interval","rect",{draw:function(r,e){var t=Ft(r,!1,!0),i=e,n=r==null?void 0:r.background;if(n){i=e.addGroup({name:"interval-group"});var a=My(r),o=jy(r,this.parsePoints(r.points),this.coordinate);i.addShape("path",{attrs:g.__assign(g.__assign({},a),{path:o}),capture:!1,zIndex:-1,name:wc})}var s;t.radius&&this.coordinate.isRect?s=rT(this.parsePoints(r.points),this.coordinate,t.radius):s=this.parsePath(eT(r.points,t.lineCap,this.coordinate));var l=i.addShape("path",{attrs:g.__assign(g.__assign({},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,fill:e}}:{symbol:"square",style:{r:4,fill:e}}}});function iT(r,e){var t=r.length,i=r;K(i[0])&&(i=r.map(function(s){return e.translate(s)}));for(var n=i[1]-i[0],a=2;a<t;a++){var o=i[a]-i[a-1];n>o&&(n=o)}return n}function nT(r,e){if(e){var t=ve(r),i=De(t,e);return i.length}return r.length}function Dc(r){var e=r.theme,t=r.coordinate,i=r.getXScale(),n=i.values,a=r.beforeMappingData,o=n.length,s=_a(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=iT(n,i);o=(i.max-i.min)/p,n.length>o&&(o=n.length)}var y=i.range,m=1/o,x=1;if(t.isPolar?t.isTransposed&&o>1?x=v:x=d:(i.isLinear&&(m*=y[1]-y[0]),x=f),!D(l)&&l>=0){var _=l/s;m=(1-(o-1)*_)/o}else m*=x;if(r.getAdjust("dodge")){var w=r.getAdjust("dodge"),b=w.dodgeBy,C=nT(a,b);if(!D(u)&&u>=0){var A=u/s;m=(m-A*(C-1))/C}else!D(l)&&l>=0&&(m*=x),m=m/C;m=m>=0?m:0}if(!D(c)&&c>=0){var F=c/s;m>F&&(m=F)}if(!D(h)&&h>=0){var E=h/s;m<E&&(m=E)}return m}var aT=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;i.type="interval",i.shapeType="interval",i.generatePoints=!0;var n=t.background;return i.background=n,i}return e.prototype.createShapePointsCfg=function(t){var i=r.prototype.createShapePointsCfg.call(this,t),n,a=this.getAttribute("size");if(a){n=this.getAttributeValues(a,t)[0];var o=this.coordinate,s=_a(o);n=n/s}else this.defaultSize||(this.defaultSize=Dc(this)),n=this.defaultSize;return i.size=n,i},e.prototype.adjustScale=function(){r.prototype.adjustScale.call(this);var t=this.getYScale();if(this.coordinate.type==="theta")t.change({nice:!1,min:0,max:TC(t)});else{var i=this.scaleDefs,n=t.field,a=t.min,o=t.max,s=t.type;s!=="time"&&(a>0&&!M(i,[n,"min"])&&t.change({min:0}),o<=0&&!M(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}($r),oT=function(r){g.__extends(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}(Lc),Qy=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"],sT=["cross","tick","plus","hyphen","line"];function Bc(r,e,t,i,n){var a,o,s=Ft(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=g.__values(l),f=h.next();!f.done;f=h.next()){var v=f.value;c.addShape({type:"marker",attrs:g.__assign(g.__assign(g.__assign({},s),{symbol:gi[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:g.__assign(g.__assign(g.__assign({},s),{symbol:gi[i]||i}),u)})}Yr("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(r){return Sc(r)}});S(Qy,function(r){lt("point","hollow-".concat(r),{draw:function(e,t){return Bc(this,e,t,r,!0)},getMarker:function(e){var t=e.color;return{symbol:gi[r]||r,style:{r:4.5,stroke:t,fill:null}}}})});var lT=function(r){g.__extends(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 g.__assign(g.__assign({},i),{isStack:!!this.getAdjust("stack")})},e}($r);function uT(r){for(var e=r[0],t=1,i=[["M",e.x,e.y]];t<r.length;){var n=r[t];(n.x!==r[t-1].x||n.y!==r[t-1].y)&&(i.push(["L",n.x,n.y]),n.x===e.x&&n.y===e.y&&t<r.length-1&&(e=r[t+1],i.push(["Z"]),i.push(["M",e.x,e.y]),t++)),t++}return Lt(It(i),e)||i.push(["L",e.x,e.y]),i.push(["Z"]),i}Yr("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(r){var e=[];return S(r.x,function(t,i){var n=r.y[i];e.push({x:t,y:n})}),e}});lt("polygon","polygon",{draw:function(r,e){if(!oe(r.points)){var t=Ft(r,!0,!0),i=this.parsePath(uT(r.points));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i}),name:"polygon"})}},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});var cT=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="polygon",t.shapeType="polygon",t.generatePoints=!0,t}return e.prototype.createShapePointsCfg=function(t){var i=r.prototype.createShapePointsCfg.call(this,t),n=i.x,a=i.y,o;if(!(O(n)&&O(a))){var s=this.getXScale(),l=this.getYScale(),u=s.values.length,c=l.values.length,h=.5*1/u,f=.5*1/c;s.isCategory&&l.isCategory?(n=[n-h,n-h,n+h,n+h],a=[a-f,a+f,a+f,a-f]):O(n)?(o=n,n=[o[0],o[0],o[1],o[1]],a=[a-f/2,a+f/2,a+f/2,a-f/2]):O(a)&&(o=a,a=[o[0],o[1],o[1],o[0]],n=[n-h/2,n-h/2,n+h/2,n+h/2]),i.x=n,i.y=a}return i},e}($r);Yr("schema",{defaultShapeType:""});var hT=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="schema",t.shapeType="schema",t.generatePoints=!0,t}return e.prototype.createShapePointsCfg=function(t){var i=r.prototype.createShapePointsCfg.call(this,t),n,a=this.getAttribute("size");if(a){n=this.getAttributeValues(a,t)[0];var o=this.coordinate,s=_a(o);n=n/s}else this.defaultSize||(this.defaultSize=Dc(this)),n=this.defaultSize;return i.size=n,i},e}($r);function fT(r){if(!O(r))return[];var e=Se(r);return xt(r,function(t){return t/e})}Yr("violin",{defaultShapeType:"violin",getDefaultPoints:function(r){var e=r.size/2,t=[],i=fT(r._size);return S(r.y,function(n,a){var o=i[a]*e,s=a===0,l=a===r.y.length-1;t.push({isMin:s,isMax:l,x:r.x-o,y:n}),t.unshift({isMin:s,isMax:l,x:r.x+o,y:n})}),t}});lt("violin","violin",{draw:function(r,e){var t=Ft(r,!0,!0),i=this.parsePath(Sy(r.points));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i}),name:"violin"})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:e}}}});var vT=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="violin",t.shapeType="violin",t.generatePoints=!0,t}return e.prototype.createShapePointsCfg=function(t){var i=r.prototype.createShapePointsCfg.call(this,t),n,a=this.getAttribute("size");if(a){n=this.getAttributeValues(a,t)[0];var o=this.coordinate,s=_a(o);n=n/s}else this.defaultSize||(this.defaultSize=Dc(this)),n=this.defaultSize;return i.size=n,i._size=M(t[gt],[this._sizeField]),i},e.prototype.initAttributes=function(){var t=this.attributeOption,i=t.size?t.size.fields[0]:this._sizeField?this._sizeField:"size";this._sizeField=i,delete t.size,r.prototype.initAttributes.call(this)},e}($r);lt("area","line",{draw:function(r,e){var t=Is(r,!0,!1,this),i=e.addShape({type:"path",attrs:t,name:"area"});return i},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){return n===void 0&&(n=5.5),[["M",t-n,i-4],["L",t+n,i-4],["L",t+n,i+4],["L",t-n,i+4],["Z"]]},style:{r:5,stroke:e,fill:null}}}});lt("area","smooth",{draw:function(r,e){var t=this.coordinate,i=Is(r,!1,!0,this,qy(t)),n=e.addShape({type:"path",attrs:i,name:"area"});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){return n===void 0&&(n=5.5),[["M",t-n,i-4],["L",t+n,i-4],["L",t+n,i+4],["L",t-n,i+4],["Z"]]},style:{r:5,fill:e,fillOpacity:1}}}});lt("area","smooth-line",{draw:function(r,e){var t=this.coordinate,i=Is(r,!0,!0,this,qy(t)),n=e.addShape({type:"path",attrs:i,name:"area"});return n},getMarker:function(r){var e=r.color;return{symbol:function(t,i,n){return n===void 0&&(n=5.5),[["M",t-n,i-4],["L",t+n,i-4],["L",t+n,i+4],["L",t-n,i+4],["Z"]]},style:{r:5,stroke:e,fill:null}}}});function wu(r,e){return["C",r.x*1/2+e.x*1/2,r.y,r.x*1/2+e.x*1/2,e.y,e.x,e.y]}function _u(r,e){var t=[];t.push({x:e.x,y:e.y}),t.push(r);var i=["Q"];return S(t,function(n){i.push(n.x,n.y)}),i}function dT(r,e,t){var i=_u(e,t),n=[["M",r.x,r.y]];return n.push(i),n}function gT(r,e){var t=_u(r[1],e),i=_u(r[3],e),n=[["M",r[0].x,r[0].y]];return n.push(i),n.push(["L",r[3].x,r[3].y]),n.push(["L",r[2].x,r[2].y]),n.push(t),n.push(["L",r[1].x,r[1].y]),n.push(["L",r[0].x,r[0].y]),n.push(["Z"]),n}lt("edge","arc",{draw:function(r,e){var t=Ft(r,!0,!1,"lineWidth"),i=r.points,n=i.length>2?"weight":"normal",a;if(r.isInCircle){var o={x:0,y:1};return n==="normal"?a=dT(i[0],i[1],o):(t.fill=t.stroke,a=gT(i,o)),a=this.parsePath(a),e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:a})})}else{if(n==="normal")return i=this.parsePoints(i),a=Rp((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:g.__assign(g.__assign({},t),{path:a})});var s=wu(i[1],i[3]),l=wu(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:g.__assign(g.__assign({},t),{path:a})})}},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});function pT(r,e){var t=wu(r,e),i=[["M",r.x,r.y]];return i.push(t),i}lt("edge","smooth",{draw:function(r,e){var t=Ft(r,!0,!1,"lineWidth"),i=r.points,n=this.parsePath(pT(i[0],i[1]));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:n})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});var Za=1/3;function yT(r,e){var t=[];t.push({x:r.x,y:r.y*(1-Za)+e.y*Za}),t.push({x:e.x,y:r.y*(1-Za)+e.y*Za}),t.push(e);var i=[["M",r.x,r.y]];return S(t,function(n){i.push(["L",n.x,n.y])}),i}lt("edge","vhv",{draw:function(r,e){var t=Ft(r,!0,!1,"lineWidth"),i=r.points,n=this.parsePath(yT(i[0],i[1]));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:n})})},getMarker:function(r){return{symbol:"circle",style:{r:4.5,fill:r.color}}}});lt("interval","funnel",{getPoints:function(r){return r.size=r.size*2,Ic(r)},draw:function(r,e){var t=Ft(r,!1,!0),i=this.parsePath(Zy(r.points,r.nextPoints,!1)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i}),name:"interval"});return n},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});lt("interval","hollow-rect",{draw:function(r,e){var t=Ft(r,!0,!1),i=e,n=r==null?void 0:r.background;if(n){i=e.addGroup();var a=My(r),o=jy(r,this.parsePoints(r.points),this.coordinate);i.addShape("path",{attrs:g.__assign(g.__assign({},a),{path:o}),capture:!1,zIndex:-1,name:wc})}var s=this.parsePath(Pc(r.points)),l=i.addShape("path",{attrs:g.__assign(g.__assign({},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 mT(r){var e=r.x,t=r.y,i=r.y0;return O(t)?t.map(function(n,a){return{x:O(e)?e[a]:e,y:n}}):[{x:e,y:i},{x:e,y:t}]}lt("interval","line",{getPoints:function(r){return mT(r)},draw:function(r,e){var t=Ft(r,!0,!1,"lineWidth"),i=re(g.__assign({},t),["fill"]),n=this.parsePath(Pc(r.points,!1)),a=e.addShape("path",{attrs:g.__assign(g.__assign({},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}}}});lt("interval","pyramid",{getPoints:function(r){return r.size=r.size*2,Ic(r)},draw:function(r,e){var t=Ft(r,!1,!0),i=this.parsePath(Zy(r.points,r.nextPoints,!0)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i}),name:"interval"});return n},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});function xT(r){var e,t=r.x,i=r.y,n=r.y0,a=r.size,o,s;O(i)?(e=g.__read(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 wT(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]]}lt("interval","tick",{getPoints:function(r){return xT(r)},draw:function(r,e){var t=Ft(r,!0,!1),i=this.parsePath(wT(r.points)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},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 _T=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 bT(r,e){var t=[];return S(r,function(i,n){var a=r[n+1];if(t.push(i),a){var o=_T(i,a,e);t=t.concat(o)}}),t}function ST(r){return r.map(function(e,t){return t===0?["M",e.x,e.y]:["L",e.x,e.y]})}function CT(r,e){var t=Ls(r.points,r.connectNulls,r.showSinglePoint),i=[];return S(t,function(n){var a=bT(n,e);i=i.concat(ST(a))}),g.__assign(g.__assign({},Ft(r,!0,!1,"lineWidth")),{path:i})}S(["hv","vh","hvh","vhv"],function(r){lt("line",r,{draw:function(e,t){var i=CT(e,r),n=t.addShape({type:"path",attrs:i,name:"line"});return n},getMarker:function(e){return Ay(e,r)}})});S(sT,function(r){lt("point",r,{draw:function(e,t){return Bc(this,e,t,r,!0)},getMarker:function(e){var t=e.color;return{symbol:gi[r],style:{r:4.5,stroke:t,fill:null}}}})});lt("point","image",{draw:function(r,e){var t,i,n=Ft(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=g.__values(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}}}});S(Qy,function(r){lt("point",r,{draw:function(e,t){return Bc(this,e,t,r,!1)},getMarker:function(e){var t=e.color;return{symbol:gi[r]||r,style:{r:4.5,fill:t}}}})});function Av(r){var e=O(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 Fv(r,e,t){var i=t/2,n;if(O(e)){var a=Av(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=D(e)?.5:e;var v=Av(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(y){return{x:y[0],y:y[1]}})}function MT(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]]}lt("schema","box",{getPoints:function(r){var e=r.x,t=r.y,i=r.size;return Fv(e,t,i)},draw:function(r,e){var t=Ft(r,!0,!1),i=this.parsePath(MT(r.points)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},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=Fv(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 AT(r){var e=O(r)?r:[r],t=e.sort(function(i,n){return n-i});return xC(t,4,t[t.length-1])}function Tv(r,e,t){var i=AT(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 FT(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]]}lt("schema","candle",{getPoints:function(r){var e=r.x,t=r.y,i=r.size;return Tv(e,t,i)},draw:function(r,e){var t=Ft(r,!0,!0),i=this.parsePath(FT(r.points)),n=e.addShape("path",{attrs:g.__assign(g.__assign({},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=Tv(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 TT(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=mt(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}}lt("polygon","square",{draw:function(r,e){if(!oe(r.points)){var t=Ft(r,!0,!0),i=this.parsePoints(r.points);return e.addShape("rect",{attrs:g.__assign(g.__assign({},t),TT(i,r.size)),name:"polygon"})}},getMarker:function(r){var e=r.color;return{symbol:"square",style:{r:4,fill:e}}}});lt("violin","smooth",{draw:function(r,e){var t=Ft(r,!0,!0),i=this.parsePath(Cy(r.points));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{stroke:null,r:4,fill:e}}}});lt("violin","hollow",{draw:function(r,e){var t=Ft(r,!0,!1),i=this.parsePath(Sy(r.points));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});lt("violin","hollow-smooth",{draw:function(r,e){var t=Ft(r,!0,!1),i=this.parsePath(Cy(r.points));return e.addShape("path",{attrs:g.__assign(g.__assign({},t),{path:i})})},getMarker:function(r){var e=r.color;return{symbol:"circle",style:{r:4,fill:null,stroke:e}}}});var ET=function(r){g.__extends(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=g.__assign(g.__assign({},s),(o={},o[c]=s[c]*h,o)),l.isReflect("x")&&(s=g.__assign(g.__assign({},s),{x:s.x*-1})),l.isReflect("y")&&(s=g.__assign(g.__assign({},s),{y:s.y*-1})),s},e.prototype.getThemedLabelCfg=function(t){var i=this.geometry,n=this.getDefaultLabelCfg(),a=i.theme;return Y({},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,y=O(i.shape)?i.shape[0]:i.shape;if(y==="funnel"||y==="pyramid"){var m=M(i,"nextPoints"),x=M(i,"points");if(m){var _=o.convert(x[0]),w=o.convert(x[1]),b=o.convert(m[0]),C=o.convert(m[1]);s?(f=Math.min(b.y,_.y),d=Math.max(b.y,_.y),v=(w.x+C.x)/2,p=(_.x+b.x)/2):(f=Math.min((w.y+C.y)/2,(_.y+b.y)/2),d=Math.max((w.y+C.y)/2,(_.y+b.y)/2),v=C.x,p=_.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=M(t,"textAlign",h>0?"left":"right");break;case"left":t.x=p,t.y=(f+d)/2,t.textAlign=M(t,"textAlign",h>0?"left":"right");break;case"bottom":s&&(t.x=(v+p)/2),t.y=d,t.textAlign=M(t,"textAlign","center"),t.textBaseline=M(t,"textBaseline",h>0?"bottom":"top");break;case"middle":s&&(t.x=(v+p)/2),t.y=(f+d)/2,t.textAlign=M(t,"textAlign","center"),t.textBaseline=M(t,"textBaseline","middle");break;case"top":s&&(t.x=(v+p)/2),t.y=f,t.textAlign=M(t,"textAlign","center"),t.textBaseline=M(t,"textBaseline",h>0?"bottom":"top");break}},e}(ks),Qa=Math.PI/2,Ky=function(r){g.__extends(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(tt(t))n=t;else if(K(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 xt(i,function(a){if(a&&n){var o=n.scale(M(a.data,n.field));return g.__assign(g.__assign({},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),!O(t.x)&&!O(t.y)?{x:t.x,y:t.y}:{x:O(t.x)?t.x[i]:t.x,y:O(t.y)?t.y[i]:t.y}},e.prototype.getPointAngle=function(t){return Wi(this.getCoordinate(),t)},e.prototype.getCirclePoint=function(t,i,n,a){var o=this.getCoordinate(),s=o.getCenter(),l=Ms(o,n);if(l===0)return g.__assign(g.__assign({},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+Qa;return n&&(a-=Qa),a&&(a>Qa?a=a-Math.PI:a<-Qa&&(a=a+Math.PI)),a},e.prototype.getMiddlePoint=function(t){var i=this.getCoordinate(),n=t.length,a={x:0,y:0};return S(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}(ks),kT=function(r){g.__extends(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 Y({},n,M(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:O(t.x)?t.x[0]:t.x,y:t.y[0]},a={x:O(t.x)?t.x[1]:t.x,y:t.y[1]},o,s=Wi(i,n);if(t.points&&t.points[0].y===t.points[1].y)o=s;else{var l=Wi(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 g.__assign(g.__assign({},Tt(a.x,a.y,o,t)),{angle:t,r:o})},e}(Ky),Ev=4;function LT(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,y=e.map(function(A){return A.y>d&&(d=A.y),A.y<p&&(p=A.y),{size:t,targets:[A.y-h]}});for(p-=h,d-h>f&&(f=d-h);l;)for(y.forEach(function(A){var F=(Math.min.apply(p,A.targets)+Math.max.apply(p,A.targets))/2;A.pos=Math.min(Math.max(p,F-A.size/2),f-A.size)}),l=!1,v=y.length;v--;)if(v>0){var m=y[v-1],x=y[v];m.pos+m.size>x.pos&&(m.size+=x.size,m.targets=m.targets.concat(x.targets),m.pos+m.size>f&&(m.pos=f-m.size),y.splice(v,1),l=!0)}v=0,y.forEach(function(A){var F=h+t/2;A.targets.forEach(function(){e[v].y=A.pos+F,F+=t,v++})});var _={};try{for(var w=g.__values(r),b=w.next();!b.done;b=w.next()){var C=b.value;_[C.get("id")]=C}}catch(A){o={error:A}}finally{try{b&&!b.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}e.forEach(function(A){var F=A.r*A.r,E=Math.pow(Math.abs(A.y-n.y),2);if(F<E)A.x=n.x;else{var T=Math.sqrt(F-E);a?A.x=n.x+T:A.x=n.x-T}var k=_[A.id];k.attr("x",A.x),k.attr("y",A.y);var P=Le(k.getChildren(),function(B){return B.get("type")==="text"});P&&(P.attr("y",A.y),P.attr("x",A.x))})}function IT(r,e,t,i){if(!(!r.length||!e.length)){var n=r[0]?r[0].offset:0,a=e[0].get("coordinate"),o=a.getRadius(),s=a.getCenter();if(n>0){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(y,m){return m["..percent"]-y["..percent"]}),v.splice(p,v.length-p)),v.sort(function(y,m){return y.y-m.y}),LT(e,v,l,h,s,d)})}S(r,function(v){if(v&&v.labelLine){var d=v.offset,p=v.angle,y=Tt(s.x,s.y,o,p),m=Tt(s.x,s.y,o+d/2,p),x=v.x+M(v,"offsetX",0),_=v.y+M(v,"offsetY",0),w={x:x-Math.cos(p)*Ev,y:_-Math.sin(p)*Ev};pt(v.labelLine)||(v.labelLine={}),v.labelLine.path=["M ".concat(y.x),"".concat(y.y," Q").concat(m.x),"".concat(m.y," ").concat(w.x),w.y].join(",")}})}}function Jy(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.y<c&&(c=d.y),{content:d.content,size:e,targets:[d.y-a],pos:null}});for(c-=a,u-a>s&&(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 kv=4;function PT(r,e){var t=e.getCenter(),i=e.getRadius();if(r&&r.labelLine){var n=r.angle,a=r.offset,o=Tt(t.x,t.y,i,n),s=r.x+M(r,"offsetX",0)*(Math.cos(n)>0?1:-1),l=r.y+M(r,"offsetY",0)*(Math.sin(n)>0?1:-1),u={x:s-Math.cos(n)*kv,y:l-Math.sin(n)*kv},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&&n<Math.PI/2&&u.y>o.y&&(p=1),n>=Math.PI/2&&n<Math.PI&&o.y>u.y&&(p=1),(n<-Math.PI/2||n>=Math.PI&&n<Math.PI*1.5)&&o.y>u.y&&(p=1);var y=a/2>4?4:Math.max(a/2-1,0),m=Tt(t.x,t.y,i+y,n),x=Tt(t.x,t.y,i+a/2,d),_=0;h.push("M ".concat(o.x," ").concat(o.y)),h.push("L ".concat(m.x," ").concat(m.y)),h.push("A ".concat(t.x," ").concat(t.y," 0 ").concat(_," ").concat(p," ").concat(x.x," ").concat(x.y)),h.push("L ".concat(u.x," ").concat(u.y))}else{var m=Tt(t.x,t.y,i+(a/2>4?4:Math.max(a/2-1,0)),n),w=o.x<t.x?1:-1;h.push("M ".concat(u.x," ").concat(u.y));var b=(o.y-t.y)/(o.x-t.x),C=(u.y-t.y)/(u.x-t.x);Math.abs(b-C)>Math.pow(Math.E,-16)&&h.push.apply(h,["C",u.x+w*4,u.y,2*m.x-o.x,2*m.y-o.y,o.x,o.y]),h.push("L ".concat(o.x," ").concat(o.y))}r.labelLine.path=h.join(" ")}}function DT(r,e,t,i){var n,a,o=Xt(r,function(F){return!D(F)}),s=e[0]&&e[0].get("coordinate");if(s){var l=s.getCenter(),u=s.getRadius(),c={};try{for(var h=g.__values(e),f=h.next();!f.done;f=h.next()){var v=f.value;c[v.get("id")]=v}}catch(F){n={error:F}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(n)throw n.error}}var d=M(o[0],"labelHeight",14),p=M(o[0],"offset",0);if(!(p<=0)){var y="left",m="right",x=be(o,function(F){return F.x<l.x?y:m}),_=s.start,w=s.end,b=Math.min((u+p+d)*2,s.getHeight()),C=b/2,A={minX:_.x,maxX:w.x,minY:l.y-C,maxY:l.y+C};S(x,function(F,E){var T=Math.floor(b/d);F.length>T&&(F.sort(function(k,P){return P.percent-k.percent}),S(F,function(k,P){P+1>T&&(c[k.id].set("visible",!1),k.invisible=!0)})),Jy(F,d,A)}),S(x,function(F,E){S(F,function(T){var k=E===m,P=c[T.id],B=P.getChildByIndex(0);if(B){var z=u+p,X=T.y-l.y,I=Math.pow(z,2),R=Math.pow(X,2),$=I-R>0?I-R:0,G=Math.sqrt($),V=Math.abs(Math.cos(T.angle)*z);k?T.x=l.x+Math.max(G,V):T.x=l.x-Math.max(G,V)}B&&(B.attr("y",T.y),B.attr("x",T.x)),PT(T,s)})})}}}var bu=4,BT=4,Lv=4;function OT(r,e,t){var i=e.getCenter(),n=e.getRadius(),a={x:r.x-(t?Lv:-Lv),y:r.y},o=Tt(i.x,i.y,n+bu,r.angle),s={x:a.x,y:a.y},l={x:o.x,y:o.y},u=Tt(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.y<o.y?l.y=s.y:(l.y=o.y,l.x=Math.max(l.x,s.x-h))),r.angle>0&&r.angle<Math.PI/2&&(s.x=Math.max(o.x,a.x-h),a.y>o.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.y<o.y?l.y=s.y:(l.y=o.y,l.x=Math.min(l.x,s.x-h)))}c=["M ".concat(a.x,",").concat(a.y),"L ".concat(s.x,",").concat(s.y),"L ".concat(l.x,",").concat(l.y),"L ".concat(o.x,",").concat(o.y),"L ".concat(u.x,",").concat(u.y)].join(" "),r.labelLine=Y({},r.labelLine,{path:c})}function RT(r,e,t,i){var n,a,o=e[0]&&e[0].get("coordinate");if(o){var s=o.getCenter(),l=o.getRadius(),u={};try{for(var c=g.__values(e),h=c.next();!h.done;h=c.next()){var f=h.value;u[f.get("id")]=f}}catch(F){n={error:F}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(n)throw n.error}}var v=M(r[0],"labelHeight",14),d=Math.max(M(r[0],"offset",0),bu);S(r,function(F){if(F){var E=M(u,[F.id]);if(E){var T=F.x>s.x||F.x===s.x&&F.y>s.y,k=D(F.offsetX)?BT:F.offsetX,P=Tt(s.x,s.y,l+bu,F.angle),B=d+k;F.x=s.x+(T?1:-1)*(l+B),F.y=P.y}}});var p=o.start,y=o.end,m="left",x="right",_=be(r,function(F){return F.x<s.x?m:x}),w=(l+d)*2+v;S(_,function(F){var E=F.length*v;E>w&&(w=Math.min(E,Math.abs(p.y-y.y)))});var b={minX:p.x,maxX:y.x,minY:s.y-w/2,maxY:s.y+w/2};S(_,function(F,E){var T=w/v;F.length>T&&(F.sort(function(k,P){return P.percent-k.percent}),S(F,function(k,P){P>T&&(u[k.id].set("visible",!1),k.invisible=!0)})),Jy(F,v,b)});var C=b.minY,A=b.maxY;S(_,function(F,E){var T=E===x;S(F,function(k){var P=M(u,k&&[k.id]);if(P){if(k.y<C||k.y>A){P.set("visible",!1);return}var B=P.getChildByIndex(0),z=B.getCanvasBBox(),X={x:T?z.x:z.maxX,y:z.y+z.height/2};Ca(B,k.x-X.x,k.y-X.y),k.labelLine&&OT(k,o,T)}})})}}function NT(r,e,t,i){S(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,y=u.width,m=u.height,x=d,_=p;(c<a||f<a)&&(x=a),(h<o||v<o)&&(_=o),c>s?x=s-y:f>s&&(x=x-(f-s)),h>l?_=l-m:v>l&&(_=_-(v-l)),(x!==d||_!==p)&&Ca(n,x-d,_-p)})}function zT(r,e,t,i){S(e,function(n,a){var o=n.getCanvasBBox(),s=t[a].getBBox();(o.minX<s.minX||o.minY<s.minY||o.maxX>s.maxX||o.maxY>s.maxY)&&n.remove(!0)})}var VT=100,tm=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 GT(r,e,t){t===void 0&&(t=VT);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=-i,h=0,f=0,v=function(m){var x=m*.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,y={};Math.min(Math.abs(h),Math.abs(f))<l&&p<t;)if(u=v(c+=i),h=~~u[0],f=~~u[1],!(!h&&!f||y["".concat(h,"-").concat(f)])&&(r.attr({x:a+h,y:o+f}),h+f<0&&r.attr("textAlign","right"),p++,e.hasGap(r.getCanvasBBox()))){e.fillGap(r.getCanvasBBox()),d=!0,y["".concat(h,"-").concat(f)]=!0;break}return d}function YT(r,e,t,i){var n=r.getCanvasBBox(),a=n.width,o=n.height,s={x:e,y:t,textAlign:"center"};switch(i){case 0:s.y-=o+1,s.x+=1,s.textAlign="left";break;case 1:s.y-=o+1,s.x-=1,s.textAlign="right";break;case 2:s.y+=o+1,s.x-=1,s.textAlign="right";break;case 3:s.y+=o+1,s.x+=1,s.textAlign="left";break;case 5:s.y-=o*2+2;break;case 6:s.y+=o*2+2;break;case 7:s.x+=a+1,s.textAlign="left";break;case 8:s.x-=a+1,s.textAlign="right";break}return r.attr(s),r.getCanvasBBox()}function $T(r,e,t,i){var n=new tm;S(e,function(a){var o=a.find(function(s){return s.get("type")==="text"});GT(o,n)||a.remove(!0)}),n.destroy()}function HT(r,e,t,i){var n=new tm;S(e,function(a){for(var o=a.find(function(v){return v.get("type")==="text"}),s=o.attr(),l=s.x,u=s.y,c=!1,h=0;h<=8;h++){var f=YT(o,l,u,h);if(n.hasGap(f)){n.fillGap(f),c=!0;break}}c||a.remove(!0)}),n.destroy()}function XT(r,e){return(r[0]||0)*(e[0]||0)+(r[1]||0)*(e[1]||0)+(r[2]||0)*(e[2]||0)}function Iv(r){if(r.length>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 Ka(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 Pv(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?[Ka(e[0],t,e[0]),Ka(e[1],t,e[0]),Ka(e[2],t,e[0]),Ka(e[3],t,e[0])]:e}function Dv(r,e){if(r.length>4)return{min:0,max:0};var t=[];return r.forEach(function(i){t.push(XT([i.x,i.y],e))}),{min:Math.min.apply(Math,g.__spreadArray([],g.__read(t),!1)),max:Math.max.apply(Math,g.__spreadArray([],g.__read(t),!1))}}function WT(r,e){return r.max>e.min&&r.min<e.max}function qT(r){return typeof r=="number"&&!Number.isNaN(r)&&r!==1/0&&r!==-1/0}function Bv(r){return["x","y","width","height"].every(function(e){return qT(r[e])})}function UT(r,e,t){return t===void 0&&(t=0),!(e.x>r.x+r.width+t||e.x+e.width<r.x-t||e.y>r.y+r.height+t||e.y+e.height<r.y-t)}function jT(r,e,t){if(t===void 0&&(t=0),!Bv(r)||!Bv(e))return!1;if(!r.rotation&&!e.rotation)return UT(r,e,t);for(var i=Pv(r),n=Pv(e),a=Iv(i).concat(Iv(n)),o=0;o<a.length;o++){var s=a[o],l=Dv(i,s),u=Dv(n,s);if(!WT(l,u))return!1}return!0}var ZT=function(){function r(e){var t=this;this.queue=[],this.worker=new Worker(e),this.worker.onmessage=function(i){var n;(n=t.queue.shift())===null||n===void 0||n.resolve(i)},this.worker.onmessageerror=function(i){var n;console.warn("[AntV G2] Web worker is not available"),(n=t.queue.shift())===null||n===void 0||n.reject(i)}}return r.prototype.post=function(e,t){var i=this;return new Promise(function(n,a){i.queue.push({resolve:n,reject:a});try{i.worker.postMessage(e)}catch{console.warn("[AntV G2] Web worker is not available"),W(t)&&t()}})},r.prototype.destroy=function(){this.worker.terminate()},r}();function QT(r){if(!(typeof window>"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 ZT(URL.createObjectURL(e))}}var KT=function(r){function e(){function u(_,w){return(_[0]||0)*(w[0]||0)+(_[1]||0)*(w[1]||0)+(_[2]||0)*(w[2]||0)}function c(_){if(_.length>4)return[];var w=function(A,F){return[F.x-A.x,F.y-A.y]},b=w(_[0],_[1]),C=w(_[1],_[2]);return[b,C]}function h(_,w,b){w===void 0&&(w=0),b===void 0&&(b={x:0,y:0});var C=_.x,A=_.y;return{x:(C-b.x)*Math.cos(-w)+(A-b.y)*Math.sin(-w)+b.x,y:(b.x-C)*Math.sin(-w)+(A-b.y)*Math.cos(-w)+b.y}}function f(_){var w=[{x:_.x,y:_.y},{x:_.x+_.width,y:_.y},{x:_.x+_.width,y:_.y+_.height},{x:_.x,y:_.y+_.height}],b=_.rotation;return b?[h(w[0],b,w[0]),h(w[1],b,w[0]),h(w[2],b,w[0]),h(w[3],b,w[0])]:w}function v(_,w){if(_.length>4)return{min:0,max:0};var b=[];return _.forEach(function(C){b.push(u([C.x,C.y],w))}),{min:Math.min.apply(null,b),max:Math.max.apply(null,b)}}function d(_,w){return _.max>w.min&&_.min<w.max}function p(_){return typeof _=="number"&&!Number.isNaN(_)&&_!==1/0&&_!==-1/0}function y(_){return["x","y","width","height"].every(function(w){return p(_[w])})}function m(_,w,b){return b===void 0&&(b=0),!(w.x>_.x+_.width+b||w.x+w.width<_.x-b||w.y>_.y+_.height+b||w.y+w.height<_.y-b)}function x(_,w,b){if(b===void 0&&(b=0),!y(_)||!y(w))return!1;if(!_.rotation&&!w.rotation)return m(_,w,b);for(var C=f(_),A=f(w),F=c(C).concat(c(A)),E=0;E<F.length;E++){var T=F[E],k=v(C,T),P=v(A,T);if(!d(k,P))return!1}return!0}return{intersect:x}}var t=e().intersect;function i(u){for(var c=u.slice(),h=0;h<c.length;h++){var f=c[h];if(f.visible)for(var v=h+1;v<c.length;v++){var d=c[v];f!==d&&d.visible&&t(f,d)&&(d.visible=!1)}}return c}var n={"hide-overlap":i};try{var a=JSON.parse(r.data);if(!a||!a.type||!n[a.type])return;var o=a.type,s=a.items,l=n[o](s);self.postMessage(l)}catch(u){throw u}},JT=`
  40. self.onmessage = `.concat(KT.toString(),`
  41. `),xl=function(r){for(var e=r.slice(),t=0;t<e.length;t++){var i=e[t];if(i.visible)for(var n=t+1;n<e.length;n++){var a=e[n];i!==a&&a.visible&&jT(i,a)&&(a.visible=!1)}}return e},wl=new Map,Ov=QT(JT);function t2(r,e,t,i){return g.__awaiter(this,void 0,void 0,function(){var n,a,o,s,l,u;return g.__generator(this,function(c){switch(c.label){case 0:return n=e.map(function(h,f){return g.__assign(g.__assign({},xy(h,r[f],M(r[f],"background.padding"))),{visible:!0})}),a=JSON.stringify(n),o=function(h){return wl.set(a,h),S(h,function(f,v){var d=f.visible,p=e[v];d?p==null||p.show():p==null||p.hide()}),h},wl.get(a)?(o(wl.get(a)),[3,7]):[3,1];case 1:if(!Ov)return[3,6];c.label=2;case 2:return c.trys.push([2,4,,5]),s=JSON.stringify({type:"hide-overlap",items:n}),[4,Ov.post(s,function(){return o(xl(n))})];case 3:return l=c.sent(),o(Array.isArray(l.data)?l.data:[]),[3,5];case 4:return u=c.sent(),console.error(u),o(xl(n)),[3,5];case 5:return[3,7];case 6:o(xl(n)),c.label=7;case 7:return[2]}})})}var Rv={"#5B8FF9":!0},e2=function(r){var e=kr.toRGB(r).toUpperCase();if(Rv[e])return Rv[e];var t=g.__read(kr.rgb2arr(e),3),i=t[0],n=t[1],a=t[2],o=(i*299+n*587+a*114)/1e3<128;return o};function r2(r,e,t){if(t.length!==0){var i=t[0].get("element"),n=i.geometry.theme,a=n.labels||{},o=a.fillColorLight,s=a.fillColorDark;t.forEach(function(l,u){var c=e[u],h=c.find(function(m){return m.get("type")==="text"}),f=Qt.fromObject(l.getBBox()),v=Qt.fromObject(h.getCanvasBBox()),d=!f.contains(v),p=l.attr("fill"),y=e2(p);d?h.attr(n.overflowLabels.style):y?o&&h.attr("fill",o):s&&h.attr("fill",s)})}}function i2(r,e,t){var i=r.coordinate,n=Or(e),a=Qt.fromObject(n.getCanvasBBox()),o=Qt.fromObject(t.getBBox());return i.isTransposed?o.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=Qt.fromObject(t.getBBox()),a=Or(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 S(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=g.__read(a.getXYFields(),1),l=s[0],u=[],c=[],h=be(o,function(y){return y.get("data")[l]}),f=hi(xt(o,function(y){return y.get("data")[l]})),v;o.forEach(function(y){y.set("visible",!0)});var d=function(y){y&&(y.length&&c.push(y.pop()),c.push.apply(c,g.__spreadArray([],g.__read(y),!1)))};for(Bt(f)>0&&(v=f.shift(),d(h[v])),Bt(f)>0&&(v=f.pop(),d(h[v])),S(f.reverse(),function(y){d(h[y])});c.length>0;){var p=c.shift();p.get("visible")&&(HM(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,g.__spreadArray([],g.__read(n),!1)),i}function em(r,e,t){return r.some(function(i){return t(i,e)})}function c2(r,e,t){t===void 0&&(t=0);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 Nv(r,e){return em(r,e,function(t,i){var n=Or(t),a=Or(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=g.__read(l.getXYFields(),2),c=u[0],h=u[1],f=be(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;xt(pa(f).reverse(),function(p){for(var y=u2(l,f[p]);y.length;){var m=y.shift(),x=Or(m);if(em(v,m,function(b,C){return b.get("data")[c]===C.get("data")[c]&&b.get("data")[h]===C.get("data")[h]})){x.set("visible",!1);continue}var _=Nv(v,m),w=!1;if(_&&(x.attr("y",x.attr("y")+2*d),w=Nv(v,m)),w){x.set("visible",!1);continue}v.push(m)}})}}}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,g.__spreadArray([],g.__read(n),!1)),i}function rm(r,e,t){return r.some(function(i){return t(i,e)})}function v2(r,e,t){t===void 0&&(t=0);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 zv(r,e){return rm(r,e,function(t,i){var n=Or(t),a=Or(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=g.__read(l.getXYFields(),2),c=u[0],h=u[1],f=be(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;xt(pa(f).reverse(),function(p){for(var y=f2(l,f[p]);y.length;){var m=y.shift(),x=Or(m);if(rm(v,m,function(b,C){return b.get("data")[c]===C.get("data")[c]&&b.get("data")[h]===C.get("data")[h]})){x.set("visible",!1);continue}var _=zv(v,m),w=!1;if(_&&(x.attr("y",x.attr("y")+2*d),w=zv(v,m)),w){x.set("visible",!1);continue}v.push(m)}})}}}var _l;function g2(){return _l||(_l=document.createElement("canvas").getContext("2d")),_l}var Ja=ga(function(r,e){e===void 0&&(e={});var t=e.fontSize,i=e.fontFamily,n=e.fontWeight,a=e.fontStyle,o=e.fontVariant,s=g2();return s.font=[a,o,n,"".concat(t,"px"),i].join(" "),s.measureText(K(r)?r:"").width},function(r,e){return e===void 0&&(e={}),g.__spreadArray([r],g.__read($u(e)),!1).join("")}),p2=function(r,e,t){var i=16,n=Ja("...",t),a;K(r)?a=r:a=ng(r);var o=e,s=[],l,u;if(Ja(r,t)<=e)return r;for(;l=a.substr(0,i),u=Ja(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=Ja(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=SC(l,s),c=u.minX,h=u.minY,f=u.maxX,v=u.maxY;S(e,function(d){var p=d.getCanvasBBox(),y=p.minX,m=p.minY,x=p.maxX,_=p.maxY,w=p.x,b=p.y,C=p.width,A=p.height,F=w,E=b;if(a.indexOf("left")>=0&&(y<c||x<c)&&(F=c),a.indexOf("top")>=0&&(m<h||_<h)&&(E=h),a.indexOf("right")>=0&&(y>f?F=f-C:x>f&&(F=F-(x-f))),a.indexOf("bottom")>=0&&(m>v?E=v-A:_>v&&(E=E-(_-v))),F!==w||E!==b){var T=F-w;if(o==="translate")Ca(d,T,E-b);else if(o==="ellipsis"){var k=d.findAll(function(P){return P.get("type")==="text"});k.forEach(function(P){var B=Vu(P.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),z=P.getCanvasBBox(),X=p2(P.attr("text"),z.width-Math.abs(T),B);P.attr("text",X)})}else d.hide()}})}}}function m2(r,e,t){var i={fillOpacity:D(r.attr("fillOpacity"))?1:r.attr("fillOpacity"),strokeOpacity:D(r.attr("strokeOpacity"))?1:r.attr("strokeOpacity"),opacity:D(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=g.__read(e,2),a=n[0],o=n[1];return r.applyToMatrix([a,o,1]),t==="x"?(r.setMatrix(kt(r.getMatrix(),[["t",-a,-o],["s",.01,1],["t",a,o]])),i=kt(r.getMatrix(),[["t",-a,-o],["s",100,1],["t",a,o]])):t==="y"?(r.setMatrix(kt(r.getMatrix(),[["t",-a,-o],["s",1,.01],["t",a,o]])),i=kt(r.getMatrix(),[["t",-a,-o],["s",1,100],["t",a,o]])):t==="xy"&&(r.setMatrix(kt(r.getMatrix(),[["t",-a,-o],["s",.01,.01],["t",a,o]])),i=kt(r.getMatrix(),[["t",-a,-o],["s",100,100],["t",a,o]])),i}function Oc(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.y<a.y?i.y:a.y):n==="x"?(u=i.x>a.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 _2(r,e,t){var i=t.coordinate,n=t.minYPoint;Oc(r,e,i,n,"x")}function b2(r,e,t){var i=t.coordinate,n=t.minYPoint;Oc(r,e,i,n,"y")}function S2(r,e,t){var i=t.coordinate,n=t.minYPoint;Oc(r,e,i,n,"xy")}function C2(r,e,t){var i=r.getTotalLength();r.attr("lineDash",[i]),r.animate(function(n){return{lineDashOffset:(1-n)*i}},e)}function M2(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 A2(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=kt(r.getMatrix(),[["t",-o,-s],["s",.01,1],["t",o,s]]);r.setMatrix(l),r.animate({matrix:kt(r.getMatrix(),[["t",-o,-s],["s",100,1],["t",o,s]])},e)}function F2(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=kt(r.getMatrix(),[["t",-a,-s],["s",1,.01],["t",a,s]]);r.setMatrix(l),r.animate({matrix:kt(r.getMatrix(),[["t",-a,-s],["s",1,100],["t",a,s]])},e)}function Vv(r,e){var t,i=zo(r,e),n=i.startAngle,a=i.endAngle;return!zt(n,-Math.PI*.5)&&n<-Math.PI*.5&&(n+=Math.PI*2),!zt(a,-Math.PI*.5)&&a<-Math.PI*.5&&(a+=Math.PI*2),e[5]===0&&(t=g.__read([a,n],2),n=t[0],a=t[1]),zt(n,Math.PI*1.5)&&(n=Math.PI*-.5),zt(a,Math.PI*-.5)&&!zt(n,a)&&(a=Math.PI*1.5),{startAngle:n,endAngle:a}}function Gv(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 Yv(r){var e,t,i,n=r.filter(function(_){return _[0]==="A"||_[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=Gv(r[s-1]),c=Gv(r[l-1]),h=Vv(u,a),f=h.startAngle,v=h.endAngle,d=Vv(c,o),p=d.startAngle,y=d.endAngle;zt(f,p)&&zt(v,y)?(t=f,i=v):(t=Math.min(f,p),i=Math.max(v,y));var m=a[1],x=n[n.length-1][1];return m<x?(e=g.__read([x,m],2),m=e[0],x=e[1]):m===x&&(x=0),{startAngle:t,endAngle:i,radius:m,innerRadius:x}}function T2(r,e,t){var i=t.toAttrs,n=t.coordinate,a=i.path||[],o=a.map(function(x){return x[0]});if(!(a.length<1)){var s=Yv(a),l=s.startAngle,u=s.endAngle,c=s.radius,h=s.innerRadius,f=Yv(r.attr("path")),v=f.startAngle,d=f.endAngle,p=n.getCenter(),y=l-v,m=u-d;if(y===0&&m===0){r.attr("path",a);return}r.animate(function(x){var _=v+x*y,w=d+x*m;return g.__assign(g.__assign({},i),{path:Lt(o,["M","A","A","Z"])?Rp(p.x,p.y,c,_,w):Lr(p.x,p.y,c,_,w,h)})},g.__assign(g.__assign({},e),{callback:function(){r.attr("path",a),W(e.callback)&&e.callback()}}))}}function E2(r,e,t){var i=vc(t.coordinate,20),n=i.type,a=i.startState,o=i.endState,s=r.setClip({type:n,attrs:a});t.toAttrs&&r.attr(t.toAttrs),s.animate(o,g.__assign(g.__assign({},e),{callback:function(){r&&!r.get("destroyed")&&r.set("clipShape",null),s.remove(!0),W(e.callback)&&e.callback()}}))}function Rc(r,e,t){if(r.isGroup())S(r.getChildren(),function(s){Rc(s,e,t)});else{var i=r.getBBox(),n=(i.minX+i.maxX)/2,a=(i.minY+i.maxY)/2;if(r.applyToMatrix([n,a,1]),t==="zoomIn"){var o=kt(r.getMatrix(),[["t",-n,-a],["s",.01,.01],["t",n,a]]);r.setMatrix(o),r.animate({matrix:kt(r.getMatrix(),[["t",-n,-a],["s",100,100],["t",n,a]])},e)}else r.animate({matrix:kt(r.getMatrix(),[["t",-n,-a],["s",.01,.01],["t",n,a]])},g.__assign(g.__assign({},e),{callback:function(){r.remove(!0),W(e.callback)&&e.callback()}}))}}function k2(r,e,t){Rc(r,e,"zoomIn")}function L2(r,e,t){Rc(r,e,"zoomOut")}function vr(r){return[N.TOP,N.BOTTOM].includes(r)?{offsetX:0,offsetY:r===N.TOP?-8:8,style:{textAlign:"center",textBaseline:r===N.TOP?"bottom":"top"}}:[N.LEFT,N.RIGHT].includes(r)?{offsetX:r===N.LEFT?-8:8,offsetY:0,style:{textAlign:r===N.LEFT?"right":"left",textBaseline:"middle",rotate:Math.PI/2}}:{}}function bl(r,e,t){return{x:r.x+e*Math.cos(t),y:r.y+e*Math.sin(t)}}var I2=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return Y({},r.prototype.getDefaultCfg.call(this),{type:"circle",showTitle:!0,title:r.prototype.getDefaultTitleCfg.call(this)})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.getRegion=function(t,i){var n=.5,a={x:.5,y:.5},o=Math.PI*2/t,s=-1*Math.PI/2+o*i,l=n/(1+1/Math.sin(o/2)),u=bl(a,n-l,s),c=Math.PI*5/4,h=Math.PI*1/4;return{start:bl(u,l,c),end:bl(u,l,h)}},e.prototype.afterEachView=function(t,i){this.processAxis(t,i)},e.prototype.beforeEachView=function(t,i){},e.prototype.generateFacets=function(t){var i=this,n=this.cfg,a=n.fields,o=n.type,s=g.__read(a,1),l=s[0];if(!l)throw new Error("No `fields` specified!");var u=this.getFieldValues(t,l),c=u.length,h=[];return u.forEach(function(f,v){var d=[{field:l,value:f,values:u}],p=Xt(t,i.getFacetDataFilter(d)),y={type:o,data:p,region:i.getRegion(c,v),columnValue:f,columnField:l,columnIndex:v,columnValuesLength:c,rowValue:null,rowField:null,rowIndex:0,rowValuesLength:1};h.push(y)}),h},e.prototype.getXAxisOption=function(t,i,n,a){return n},e.prototype.getYAxisOption=function(t,i,n,a){return n},e.prototype.renderTitle=function(){var t=this;S(this.facets,function(i){var n=i.columnValue,a=i.view,o=M(t.cfg.title,"formatter"),s=Y({position:["50%","0%"],content:o?o(n):n},vr(N.TOP),t.cfg.title);a.annotation().text(s)})},e}(nn),P2=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return Y({},r.prototype.getDefaultCfg.call(this),{type:"list",cols:null,showTitle:!0,title:r.prototype.getDefaultTitleCfg.call(this)})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.afterEachView=function(t,i){this.processAxis(t,i)},e.prototype.beforeEachView=function(t,i){},e.prototype.generateFacets=function(t){var i=this,n=this.cfg.fields,a=this.cfg.cols,o=g.__read(n,1),s=o[0];if(!s)throw new Error("No `fields` specified!");var l=this.getFieldValues(t,s),u=l.length;a=a||u;var c=this.getPageCount(u,a),h=[];return l.forEach(function(f,v){var d=i.getRowCol(v,a),p=d.row,y=d.col,m=[{field:s,value:f,values:l}],x=Xt(t,i.getFacetDataFilter(m)),_={type:i.cfg.type,data:x,region:i.getRegion(c,a,y,p),columnValue:f,rowValue:f,columnField:s,rowField:null,columnIndex:y,rowIndex:p,columnValuesLength:a,rowValuesLength:c,total:u};h.push(_)}),h},e.prototype.getXAxisOption=function(t,i,n,a){return a.rowIndex!==a.rowValuesLength-1&&a.columnValuesLength*a.rowIndex+a.columnIndex+1+a.columnValuesLength<=a.total?g.__assign(g.__assign({},n),{label:null,title:null}):n},e.prototype.getYAxisOption=function(t,i,n,a){return a.columnIndex!==0?g.__assign(g.__assign({},n),{title:null,label:null}):n},e.prototype.renderTitle=function(){var t=this;S(this.facets,function(i){var n=i.columnValue,a=i.view,o=M(t.cfg.title,"formatter"),s=Y({position:["50%","0%"],content:o?o(n):n},vr(N.TOP),t.cfg.title);a.annotation().text(s)})},e.prototype.getPageCount=function(t,i){return Math.floor((t+i-1)/i)},e.prototype.getRowCol=function(t,i){var n=Math.floor(t/i),a=t%i;return{row:n,col:a}},e}(nn),D2=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return Y({},r.prototype.getDefaultCfg.call(this),{type:"matrix",showTitle:!1,columnTitle:g.__assign({},r.prototype.getDefaultTitleCfg.call(this)),rowTitle:g.__assign({},r.prototype.getDefaultTitleCfg.call(this))})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.afterEachView=function(t,i){this.processAxis(t,i)},e.prototype.beforeEachView=function(t,i){},e.prototype.generateFacets=function(t){for(var i=this.cfg,n=i.fields,a=i.type,o=n.length,s=o,l=[],u=0;u<s;u++)for(var c=n[u],h=0;h<o;h++){var f=n[h],v={type:a,data:t,region:this.getRegion(o,s,u,h),columnValue:c,rowValue:f,columnField:c,rowField:f,columnIndex:u,rowIndex:h,columnValuesLength:s,rowValuesLength:o};l.push(v)}return l},e.prototype.getXAxisOption=function(t,i,n,a){return a.rowIndex!==a.rowValuesLength-1?g.__assign(g.__assign({},n),{label:null,title:null}):n},e.prototype.getYAxisOption=function(t,i,n,a){return a.columnIndex!==0?g.__assign(g.__assign({},n),{title:null,label:null}):n},e.prototype.renderTitle=function(){var t=this;S(this.facets,function(i,n){var a=i.columnIndex,o=i.rowIndex,s=i.columnValuesLength;i.rowValuesLength;var l=i.columnValue,u=i.rowValue,c=i.view;if(o===0){var h=M(t.cfg.columnTitle,"formatter"),f=Y({position:["50%","0%"],content:h?h(l):l},vr(N.TOP),t.cfg.columnTitle);c.annotation().text(f)}if(a===s-1){var h=M(t.cfg.rowTitle,"formatter"),f=Y({position:["100%","50%"],content:h?h(u):u},vr(N.RIGHT),t.cfg.rowTitle);c.annotation().text(f)}})},e}(nn),B2=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return Y({},r.prototype.getDefaultCfg.call(this),{type:"mirror",showTitle:!0,title:r.prototype.getDefaultTitleCfg.call(this),transpose:!1})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.beforeEachView=function(t,i){this.cfg.transpose?i.columnIndex%2===0?t.coordinate().transpose().reflect("x"):t.coordinate().transpose():i.rowIndex%2!==0&&t.coordinate().reflect("y")},e.prototype.afterEachView=function(t,i){this.processAxis(t,i)},e.prototype.generateFacets=function(t){var i=this,n=g.__read(this.cfg.fields,1),a=n[0],o=[],s=1,l=1,u=[""],c=[""],h,f;return this.cfg.transpose?(h=a,u=this.getFieldValues(t,h).slice(0,2),s=u.length):(f=a,c=this.getFieldValues(t,f).slice(0,2),l=c.length),u.forEach(function(v,d){c.forEach(function(p,y){var m=[{field:h,value:v,values:u},{field:f,value:p,values:c}],x=Xt(t,i.getFacetDataFilter(m)),_={type:i.cfg.type,data:x,region:i.getRegion(l,s,d,y),columnValue:v,rowValue:p,columnField:h,rowField:f,columnIndex:d,rowIndex:y,columnValuesLength:s,rowValuesLength:l};o.push(_)})}),o},e.prototype.getXAxisOption=function(t,i,n,a){return a.columnIndex===1||a.rowIndex===1?g.__assign(g.__assign({},n),{label:null,title:null}):n},e.prototype.getYAxisOption=function(t,i,n,a){return n},e.prototype.renderTitle=function(){var t=this;S(this.facets,function(i,n){var a=i.columnValue,o=i.rowValue,s=i.view,l=M(t.cfg.title,"formatter");if(t.cfg.transpose){var u=Y({position:["50%","0%"],content:l?l(a):a},vr(N.TOP),t.cfg.title);s.annotation().text(u)}else{var u=Y({position:["100%","50%"],content:l?l(o):o},vr(N.RIGHT),t.cfg.title);s.annotation().text(u)}})},e}(nn),O2=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.afterEachView=function(t,i){this.processAxis(t,i)},e.prototype.beforeEachView=function(t,i){},e.prototype.getDefaultCfg=function(){return Y({},r.prototype.getDefaultCfg.call(this),{type:"rect",columnTitle:g.__assign({},r.prototype.getDefaultTitleCfg.call(this)),rowTitle:g.__assign({},r.prototype.getDefaultTitleCfg.call(this))})},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.generateFacets=function(t){var i=this,n=g.__read(this.cfg.fields,2),a=n[0],o=n[1],s=[],l=1,u=1,c=[""],h=[""];return a&&(c=this.getFieldValues(t,a),l=c.length),o&&(h=this.getFieldValues(t,o),u=h.length),c.forEach(function(f,v){h.forEach(function(d,p){var y=[{field:a,value:f,values:c},{field:o,value:d,values:h}],m=Xt(t,i.getFacetDataFilter(y)),x={type:i.cfg.type,data:m,region:i.getRegion(u,l,v,p),columnValue:f,rowValue:d,columnField:a,rowField:o,columnIndex:v,rowIndex:p,columnValuesLength:l,rowValuesLength:u};s.push(x)})}),s},e.prototype.renderTitle=function(){var t=this;S(this.facets,function(i,n){var a=i.columnIndex,o=i.rowIndex,s=i.columnValuesLength,l=i.columnValue,u=i.rowValue,c=i.view;if(o===0){var h=M(t.cfg.columnTitle,"formatter"),f=Y({position:["50%","0%"],content:h?h(l):l},vr(N.TOP),t.cfg.columnTitle);c.annotation().text(f)}if(a===s-1){var h=M(t.cfg.rowTitle,"formatter"),f=Y({position:["100%","50%"],content:h?h(u):u},vr(N.RIGHT),t.cfg.rowTitle);c.annotation().text(f)}})},e.prototype.getXAxisOption=function(t,i,n,a){return a.rowIndex!==a.rowValuesLength-1?g.__assign(g.__assign({},n),{title:null,label:null}):a.columnIndex!==Math.floor((a.columnValuesLength-1)/2)?g.__assign(g.__assign({},n),{title:null}):n},e.prototype.getYAxisOption=function(t,i,n,a){return a.columnIndex!==0?g.__assign(g.__assign({},n),{title:null,label:null}):a.rowIndex!==Math.floor((a.rowValuesLength-1)/2)?g.__assign(g.__assign({},n),{title:null}):n},e}(nn),R2=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.afterChartRender=function(){t.facets&&t.cfg.line&&(t.container.clear(),t.drawLines(t.facets))},t}return e.prototype.afterEachView=function(t,i){this.processAxis(t,i)},e.prototype.beforeEachView=function(t,i){},e.prototype.init=function(){r.prototype.init.call(this),this.view.on(it.AFTER_RENDER,this.afterChartRender)},e.prototype.getDefaultCfg=function(){return Y({},r.prototype.getDefaultCfg.call(this),{type:"tree",line:{style:{lineWidth:1,stroke:"#ddd"},smooth:!1},showTitle:!0,title:r.prototype.getDefaultTitleCfg.call(this)})},e.prototype.generateFacets=function(t){var i=this.cfg.fields;if(!i.length)throw new Error("Please specify for the fields for rootFacet!");var n=[],a={type:this.cfg.type,data:t,region:null,rowValuesLength:this.getRows(),columnValuesLength:1,rowIndex:0,columnIndex:0,rowField:"",columnField:"",rowValue:"",columnValue:""};return n.push(a),a.children=this.getChildFacets(t,1,n),this.setRegion(n),n},e.prototype.setRegion=function(t){var i=this;this.forceColIndex(t),t.forEach(function(n){n.region=i.getRegion(n.rowValuesLength,n.columnValuesLength,n.columnIndex,n.rowIndex)})},e.prototype.getRegion=function(t,i,n,a){var o=1/i,s=1/t,l={x:o*n,y:s*a},u={x:l.x+o,y:l.y+s*2/3};return{start:l,end:u}},e.prototype.forceColIndex=function(t){var i,n,a=this,o=[],s=0;t.forEach(function(d){a.isLeaf(d)&&(o.push(d),d.columnIndex=s,s++)}),o.forEach(function(d){d.columnValuesLength=o.length});for(var l=this.cfg.fields.length,u=l-1;u>=0;u--){var c=this.getFacetsByLevel(t,u);try{for(var h=(i=void 0,g.__values(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<i)){var l=[],u=o[i-1],c=this.getFieldValues(t,u);return c.forEach(function(h,f){var v=[{field:u,value:h,values:c}],d=t.filter(a.getFacetDataFilter(v));if(d.length){var p={type:a.cfg.type,data:d,region:null,columnValue:h,rowValue:"",columnField:u,rowField:"",columnIndex:f,rowValuesLength:a.getRows(),columnValuesLength:1,rowIndex:i,children:a.getChildFacets(d,i+1,n)};l.push(p),n.push(p)}}),l}},e.prototype.render=function(){r.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},e.prototype.renderTitle=function(){var t=this;S(this.facets,function(i){var n=i.columnValue,a=i.view,o=M(t.cfg.title,"formatter"),s=Y({position:["50%","0%"],content:o?o(n):n},vr(N.TOP),t.cfg.title);a.annotation().text(s)})},e.prototype.drawLines=function(t){var i=this;t.forEach(function(n){if(!i.isLeaf(n)){var a=n.children;i.addFacetLines(n,a)}})},e.prototype.addFacetLines=function(t,i){var n=this,a=t.view,o=a.coordinateBBox,s={x:o.x+o.width/2,y:o.y+o.height};i.forEach(function(l){var u=l.view.coordinateBBox,c={x:u.bl.x+(u.tr.x-u.bl.x)/2,y:u.tr.y},h={x:s.x,y:s.y+(c.y-s.y)/2},f={x:c.x,y:h.y};n.drawLine([s,h,f,c])})},e.prototype.getPath=function(t){var i=[],n=this.cfg.line.smooth;return n?(i.push(["M",t[0].x,t[0].y]),i.push(["C",t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y])):t.forEach(function(a,o){o===0?i.push(["M",a.x,a.y]):i.push(["L",a.x,a.y])}),i},e.prototype.drawLine=function(t){var i=this.getPath(t),n=this.cfg.line.style;this.container.addShape("path",{attrs:ft({path:i},n)})},e.prototype.getXAxisOption=function(t,i,n,a){return a.rowIndex!==a.rowValuesLength-1?g.__assign(g.__assign({},n),{title:null,label:null}):n},e.prototype.getYAxisOption=function(t,i,n,a){return a.originColIndex!==0&&a.columnIndex!==0?g.__assign(g.__assign({},n),{title:null,label:null}):n},e}(nn);function $v(r){var e=g.__spreadArray([],g.__read(r),!1);e.sort(function(i,n){return i-n});var t=e.length;return t===0?0:t%2===1?e[(t-1)/2]:(e[t/2]+e[t/2-1])/2}function N2(r){var e=Zt(r,function(t,i){return t+=isNaN(i)||!tt(i)?0:i},0);return r.length===0?0:e/r.length}function to(r,e){if(!e)return null;var t;switch(r){case"start":return 0;case"center":return .5;case"end":return 1;case"median":{t=e.isCategory?$v(e.values.map(function(i,n){return n})):$v(e.values);break}case"mean":{t=e.isCategory?(e.values.length-1)/2:N2(e.values);break}case"min":t=e.isCategory?0:e[r];break;case"max":t=e.isCategory?e.values.length-1:e[r];break;default:t=r;break}return e.scale(t)}var eo=["regionFilter","shape"],z2=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.cache=new Map,i.foregroundContainer=i.view.getLayer(At.FORE).addGroup(),i.backgroundContainer=i.view.getLayer(At.BG).addGroup(),i.option=[],i}return Object.defineProperty(e.prototype,"name",{get:function(){return"annotation"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.layout=function(){this.update()},e.prototype.render=function(){},e.prototype.update=function(){var t=this;this.onAfterRender(function(){var n=new Map;S(t.option,function(a){if(Ei(eo,a.type)){var o=t.updateOrCreate(a);o&&n.set(t.getCacheKey(a),o)}}),t.cache=t.syncCache(n)});var i=new Map;S(this.option,function(n){if(!Ei(eo,n.type)){var a=t.updateOrCreate(n);a&&i.set(t.getCacheKey(n),a)}}),this.cache=this.syncCache(i)},e.prototype.clear=function(t){t===void 0&&(t=!1),r.prototype.clear.call(this),this.clearComponents(),this.foregroundContainer.clear(),this.backgroundContainer.clear(),t&&(this.option=[])},e.prototype.destroy=function(){this.clear(!0),this.foregroundContainer.remove(!0),this.backgroundContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(i){t.push(i)}),t},e.prototype.clearComponents=function(){this.getComponents().forEach(function(t){t.component.destroy()}),this.cache.clear()},e.prototype.onAfterRender=function(t){var i=!1;this.view.getOptions().animate&&this.view.geometries.forEach(function(n){n.animateOption&&(n.once(Tr.AFTER_DRAW_ANIMATE,function(){t()}),i=!0)}),i||this.view.getRootView().once(it.AFTER_RENDER,function(){t()})},e.prototype.createAnnotation=function(t){var i=t.type,n=vS[xi(i)];if(n){var a=this.getAnnotationTheme(i),o=this.getAnnotationCfg(i,t,a);if(!o)return null;var s=new n(o);return{component:s,layer:this.isTop(o)?At.FORE:At.BG,direction:N.NONE,type:Dt.ANNOTATION,extra:t}}},e.prototype.annotation=function(t){this.option.push(t)},e.prototype.arc=function(t){return this.annotation(g.__assign({type:"arc"},t)),this},e.prototype.image=function(t){return this.annotation(g.__assign({type:"image"},t)),this},e.prototype.line=function(t){return this.annotation(g.__assign({type:"line"},t)),this},e.prototype.region=function(t){return this.annotation(g.__assign({type:"region"},t)),this},e.prototype.text=function(t){return this.annotation(g.__assign({type:"text"},t)),this},e.prototype.dataMarker=function(t){return this.annotation(g.__assign({type:"dataMarker"},t)),this},e.prototype.dataRegion=function(t){this.annotation(g.__assign({type:"dataRegion"},t))},e.prototype.regionFilter=function(t){this.annotation(g.__assign({type:"regionFilter"},t))},e.prototype.shape=function(t){this.annotation(g.__assign({type:"shape"},t))},e.prototype.html=function(t){this.annotation(g.__assign({type:"html"},t))},e.prototype.parsePosition=function(t){var i,n,a=this.view.getXScale(),o=this.view.getScalesByDim("y"),s=W(t)?t.call(null,a,o):t,l=0,u=0;if(O(s)){var c=g.__read(s,2),h=c[0],f=c[1];if(K(h)&&h.indexOf("%")!==-1&&!isNaN(h.slice(0,-1)))return this.parsePercentPosition(s);l=to(h,a),u=to(f,Object.values(o)[0])}else if(!D(s))try{for(var v=g.__values(pa(s)),d=v.next();!d.done;d=v.next()){var p=d.value,y=s[p];p===a.field&&(l=to(y,a)),o[p]&&(u=to(y,o[p]))}}catch(m){i={error:m}}finally{try{d&&!d.done&&(n=v.return)&&n.call(v)}finally{if(i)throw i.error}}return isNaN(l)||isNaN(u)?null:this.view.getCoordinate().convert({x:l,y:u})},e.prototype.getRegionPoints=function(t,i){var n=this,a=this.view.getXScale(),o=this.view.getScalesByDim("y"),s=Object.values(o)[0],l=a.field,u=this.view.getData(),c=O(t)?t[0]:t[l],h=O(i)?i[0]:i[l],f=[],v;return S(u,function(d,p){if(d[l]===c&&(v=p),p>=v){var y=n.parsePosition([d[l],d[s.field]]);y&&f.push(y)}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(D(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 y=g.__rest(p,["start","end"]),m=Wi(o,f),x=Wi(o,v);m>x&&(x=Math.PI*2+x),l=g.__assign(g.__assign({},y),{center:o.getCenter(),radius:Ms(o,f),startAngle:m,endAngle:x})}else if(t==="image"){var _=i;_.start,_.end;var y=g.__rest(_,["start","end"]);l=g.__assign(g.__assign({},y),{start:f,end:v,src:i.src})}else if(t==="line"){var w=i;w.start,w.end;var y=g.__rest(w,["start","end"]);l=g.__assign(g.__assign({},y),{start:f,end:v,text:M(i,"text",null)})}else if(t==="region"){var b=i;b.start,b.end;var y=g.__rest(b,["start","end"]);l=g.__assign(g.__assign({},y),{start:f,end:v})}else if(t==="text"){var C=this.view.getData(),A=i;A.position;var F=A.content,y=g.__rest(A,["position","content"]),E=F;W(F)&&(E=F(C)),l=g.__assign(g.__assign(g.__assign({},d),y),{content:E})}else if(t==="dataMarker"){var T=i;T.position;var k=T.point,P=T.line,B=T.text,z=T.autoAdjust,X=T.direction,y=g.__rest(T,["position","point","line","text","autoAdjust","direction"]);l=g.__assign(g.__assign(g.__assign({},y),d),{coordinateBBox:this.getCoordinateBBox(),point:k,line:P,text:B,autoAdjust:z,direction:X})}else if(t==="dataRegion"){var I=i,R=I.start,$=I.end,G=I.region,B=I.text,V=I.lineLength,y=g.__rest(I,["start","end","region","text","lineLength"]);l=g.__assign(g.__assign({},y),{points:this.getRegionPoints(R,$),region:G,text:B,lineLength:V})}else if(t==="regionFilter"){var H=i;H.start,H.end;var Z=H.apply,rt=H.color,y=g.__rest(H,["start","end","apply","color"]),U=this.view.geometries,Q=[],ht=function(Ne){Ne&&(Ne.isGroup()?Ne.getChildren().forEach(function(fn){return ht(fn)}):Q.push(Ne))};S(U,function(Ne){Z?Ei(Z,Ne.type)&&S(Ne.elements,function(fn){ht(fn.shape)}):S(Ne.elements,function(fn){ht(fn.shape)})}),l=g.__assign(g.__assign({},y),{color:rt,shapes:Q,start:f,end:v})}else if(t==="shape"){var _t=i,Ct=_t.render,Yt=g.__rest(_t,["render"]),Qe=function(Cx){if(W(i.render))return Ct(Cx,a.view,{parsePosition:a.parsePosition.bind(a)})};l=g.__assign(g.__assign({},Yt),{render:Qe})}else if(t==="html"){var Ke=i,Je=Ke.html;Ke.position;var Yt=g.__rest(Ke,["html","position"]),Xr=function(Ne){return W(Je)?Je(Ne,a.view):Je};l=g.__assign(g.__assign(g.__assign({},Yt),d),{parent:s.get("el").parentNode,html:Xr})}var gr=Y({},n,g.__assign(g.__assign({},l),{top:i.top,style:i.style,offsetX:i.offsetX,offsetY:i.offsetY}));return t!=="html"&&(gr.container=this.getComponentContainer(gr)),gr.animate=this.view.getOptions().animate&&gr.animate&&M(i,"animate",gr.animate),gr.animateOption=Y({},Ui,gr.animateOption,i.animateOption),gr},e.prototype.isTop=function(t){return M(t,"top",!0)},e.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},e.prototype.getAnnotationTheme=function(t){return M(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&&re(o,["container"]),i.component.update(g.__assign(g.__assign({},o||{}),{visible:!!o})),Ei(eo,t.type)&&i.component.render()}else i=this.createAnnotation(t),i&&(i.component.init(),Ei(eo,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){Le(i.option,function(s){return o===i.getCacheKey(s)})||(a.component.destroy(),n.delete(o))}),n},e.prototype.getCacheKey=function(t){return t},e}(on);function Hv(r,e){var t=Y({},M(r,["components","axis","common"]),M(r,["components","axis",e]));return M(t,["grid"],{})}function ro(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 Sl(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:xt(Array(a+1),function(v,d){return r.convert({x:d/a,y:i?h:f})})}),u},s[0]),o}function Xv(r,e){var t=M(e,"grid");if(t===null)return!1;var i=M(r,"grid");return!(t===void 0&&i===null)}var xr=["container"],Wv=g.__assign(g.__assign({},Ui),{appear:null}),V2=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.cache=new Map,i.gridContainer=i.view.getLayer(At.BG).addGroup(),i.gridForeContainer=i.view.getLayer(At.FORE).addGroup(),i.axisContainer=i.view.getLayer(At.BG).addGroup(),i.axisForeContainer=i.view.getLayer(At.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();S(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===Dt.AXIS)i.isPolar?u==="x"?f=i.isTransposed?Ya(i,o):dl(i):u==="y"&&(f=i.isTransposed?dl(i):Ya(i,o)):f=Ya(i,o);else if(s===Dt.GRID)if(i.isPolar){var v=void 0;i.isTransposed?v=u==="x"?Sl(i,t.view.getYScales()[0],c,h,u):ro(i,c,u,h):v=u==="x"?ro(i,c,u,h):Sl(i,t.view.getXScale(),c,h,u),f={items:v,center:t.view.getCoordinate().getCenter()}}else f={items:ro(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=Oo(this.option,i.field);if(n!==!1){var a=jf(n,N.BOTTOM),o=At.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);re(f,xr),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);re(f,xr),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,N.RADIUS):this.getCircleAxisCfg(i,n,a);re(f,xr),h.component.update(f),t.set(u,h)}else{if(l.isTransposed){if(Qr(n))return;h=this.createLineAxis(i,n,o,N.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,N.RADIUS,s):this.getLineGridCfg(i,n,N.CIRCLE,s);re(f,xr),v.component.update(f),t.set(c,v)}else{if(l.isTransposed){if(Qr(n))return;v=this.createCircleGrid(i,n,o,N.RADIUS,s)}else v=this.createLineGrid(i,n,o,N.CIRCLE,s);v&&(this.cache.set(c,v),t.set(c,v))}}}}},e.prototype.updateYAxes=function(t){var i=this,n=this.view.getYScales();S(n,function(a,o){if(!(!a||a.isIdentity)){var s=a.field,l=Oo(i.option,s);if(l!==!1){var u=At.BG,c="y",h=i.getId("axis",s),f=i.getId("grid",s),v=i.view.getCoordinate();if(v.isRect){var d=jf(l,o===0?N.LEFT:N.RIGHT),p=i.cache.get(h);if(p){var y=i.getLineAxisCfg(a,l,d);re(y,xr),p.component.update(y),t.set(h,p)}else p=i.createLineAxis(a,l,u,d,c),i.cache.set(h,p),t.set(h,p);var m=i.cache.get(f);if(m){var y=i.getLineGridCfg(a,l,d,c);re(y,xr),m.component.update(y),t.set(f,m)}else m=i.createLineGrid(a,l,u,d,c),m&&(i.cache.set(f,m),t.set(f,m))}else if(v.isPolar){var p=i.cache.get(h);if(p){var y=v.isTransposed?i.getCircleAxisCfg(a,l,N.CIRCLE):i.getLineAxisCfg(a,l,N.RADIUS);re(y,xr),p.component.update(y),t.set(h,p)}else{if(v.isTransposed){if(Qr(l))return;p=i.createCircleAxis(a,l,u,N.CIRCLE,c)}else p=i.createLineAxis(a,l,u,N.RADIUS,c);i.cache.set(h,p),t.set(h,p)}var m=i.cache.get(f);if(m){var y=v.isTransposed?i.getLineGridCfg(a,l,N.CIRCLE,c):i.getCircleGridCfg(a,l,N.RADIUS,c);re(y,xr),m.component.update(y),t.set(f,m)}else{if(v.isTransposed){if(Qr(l))return;m=i.createLineGrid(a,l,u,N.CIRCLE,c)}else m=i.createCircleGrid(a,l,u,N.RADIUS,c);m&&(i.cache.set(f,m),t.set(f,m))}}}}})},e.prototype.createLineAxis=function(t,i,n,a,o){var s={component:new fC(this.getLineAxisCfg(t,i,a)),layer:n,direction:a===N.RADIUS?N.NONE:a,type:Dt.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 dC(s),layer:n,direction:N.NONE,type:Dt.GRID,extra:{dim:o,scale:t,alignTick:M(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.createCircleAxis=function(t,i,n,a,o){var s={component:new vC(this.getCircleAxisCfg(t,i,a)),layer:n,direction:a,type:Dt.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 gC(s),layer:n,direction:N.NONE,type:Dt.GRID,extra:{dim:o,scale:t,alignTick:M(s,"alignTick",!0)}};return l.component.init(),l}},e.prototype.getLineAxisCfg=function(t,i,n){var a=M(i,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=Ya(o,n),l=Zf(t,i),u=$a(this.view.getTheme(),n),c=M(i,["title"])?Y({title:{style:{text:l}}},{title:Uf(this.view.getTheme(),n,i.title)},i):i,h=Y(g.__assign(g.__assign({container:a},s),{ticks:t.getTicks().map(function(_){return{id:"".concat(_.tickValue),name:_.text,value:_.value}}),verticalFactor:o.isPolar?qf(s,o.getCenter())*-1:qf(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=Gp(s),y=M(h,"verticalLimitLength",p?1/3:1/2);if(y<=1){var m=this.view.getCanvas().get("width"),x=this.view.getCanvas().get("height");h.verticalLimitLength=y*(p?m:x)}return h},e.prototype.getLineGridCfg=function(t,i,n,a){if(Xv($a(this.view.getTheme(),n),i)){var o=Hv(this.view.getTheme(),n),s=Y({container:M(i,["top"])?this.gridForeContainer:this.gridContainer},o,M(i,"grid"),this.getAnimateCfg(i));return s.items=ro(this.view.getCoordinate(),t,a,M(s,"alignTick",!0)),s}},e.prototype.getCircleAxisCfg=function(t,i,n){var a=M(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=Zf(t,i),u=$a(this.view.getTheme(),N.CIRCLE),c=M(i,["title"])?Y({title:{style:{text:l}}},{title:Uf(this.view.getTheme(),n,i.title)},i):i,h=Y(g.__assign(g.__assign({container:a},dl(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(Xv($a(this.view.getTheme(),n),i)){var o=Hv(this.view.getTheme(),N.RADIUS),s=Y({container:M(i,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},o,M(i,"grid"),this.getAnimateCfg(i)),l=M(s,"alignTick",!0),u=a==="x"?this.view.getYScales()[0]:this.view.getXScale();return s.items=Sl(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&&M(t,"animate"),animateOption:t&&t.animateOption?Y({},Wv,t.animateOption):Wv}},e}(on);function Fr(r,e,t){return t===N.TOP?[r.minX+r.width/2-e.width/2,r.minY]:t===N.BOTTOM?[r.minX+r.width/2-e.width/2,r.maxY-e.height]:t===N.LEFT?[r.minX,r.minY+r.height/2-e.height/2]:t===N.RIGHT?[r.maxX-e.width,r.minY+r.height/2-e.height/2]:t===N.TOP_LEFT||t===N.LEFT_TOP?[r.tl.x,r.tl.y]:t===N.TOP_RIGHT||t===N.RIGHT_TOP?[r.tr.x-e.width,r.tr.y]:t===N.BOTTOM_LEFT||t===N.LEFT_BOTTOM?[r.bl.x,r.bl.y-e.height]:t===N.BOTTOM_RIGHT||t===N.RIGHT_BOTTOM?[r.br.x-e.width,r.br.y-e.height]:[0,0]}function qv(r,e){return $i(r)?r===!1?!1:{}:M(r,[e],r)}function io(r){return M(r,"position",N.BOTTOM)}var G2=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.container=i.view.getLayer(At.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,S(this.components,function(i){var n=i.component,a=i.direction,o=pl(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 Qt(v.x,v.y,v.width,v.height).expand(f),p=g.__read(Fr(t.view.viewBBox,d,a),2),y=p[0],m=p[1],x=g.__read(Fr(t.layoutBBox,d,a),2),_=x[0],w=x[1],b=0,C=0;a.startsWith("top")||a.startsWith("bottom")?(b=y,C=w):(b=_,C=m),n.setLocation({x:b+f[3],y:C+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),y=t.getComponentById(p);if(y){var m=void 0,x=qv(t.option,d.field);x!==!1&&(M(x,"custom")?m=t.getCategoryCfg(f,v,d,x,!0):d.isLinear?m=t.getContinuousCfg(f,v,d,x):d.isCategory&&(m=t.getCategoryCfg(f,v,d,x))),m&&(re(m,["container"]),y.direction=io(x),y.component.update(m),i[p]=!0)}else{var _=t.createFieldLegend(f,v,d);_&&(_.component.init(),t.components.push(_),i[p]=!0)}};if(M(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);re(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=At.FORE,c=io(this.option);this.components.push({id:a,component:l,layer:u,direction:c,type:Dt.LEGEND,extra:void 0}),i[a]=!0}}}else this.loopLegends(n);var h=[];S(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 S(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={};S(n,function(o){var s=o.getGroupAttributes();S(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=qv(this.option,n.field),s=At.FORE,l=io(o);if(o!==!1&&(M(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:Dt.LEGEND,extra:{scale:n}}},e.prototype.createCustomLegend=function(t,i,n,a){var o=this.getCategoryCfg(t,i,n,a,!0);return new Hf(o)},e.prototype.createContinuousLegend=function(t,i,n,a){var o=this.getContinuousCfg(t,i,n,re(a,["value"]));return new pC(o)},e.prototype.createCategoryLegend=function(t,i,n,a){var o=this.getCategoryCfg(t,i,n,a);return new Hf(o)},e.prototype.getContinuousCfg=function(t,i,n,a){var o=n.getTicks(),s=Le(o,function(p){return p.value===0}),l=Le(o,function(p){return p.value===1}),u=o.map(function(p){var y=p.value,m=p.tickValue,x=i.mapping(n.invert(y)).join("");return{value:m,attrValue:x,color:x,scaleValue:y}});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,y){return p.value-y.value});var c={min:fe(u).value,max:It(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=io(a),v=pl(f),d=M(a,"title");return d&&(d=Y({text:ra(n)},d)),c.container=h,c.layout=v,c.title=d,c.animateOption=Ui,this.mergeLegendCfg(c,a,"continuous")},e.prototype.getCategoryCfg=function(t,i,n,a,o){var s=this.container,l=M(a,"position",N.BOTTOM),u=fv(this.view.getTheme(),l),c=M(u,["marker"]),h=M(a,"marker"),f=pl(l),v=M(u,["pageNavigator"]),d=M(a,"pageNavigator"),p=o?jM(c,h,a.items):by(this.view,t,i,c,h),y=M(a,"title");y&&(y=Y({text:n?ra(n):""},y));var m=M(a,"maxWidthRatio"),x=M(a,"maxHeightRatio"),_=this.getCategoryLegendSizeCfg(f,m,x);_.container=s,_.layout=f,_.items=p,_.title=y,_.animateOption=Ui,_.pageNavigator=Y({},v,d);var w=this.mergeLegendCfg(_,a,l);w.reversed&&w.items.reverse();var b=M(w,"maxItemWidth");return b&&b<=1&&(w.maxItemWidth=this.view.viewBBox.width*b),w},e.prototype.mergeLegendCfg=function(t,i,n){var a=n.split("-")[0],o=fv(this.view.getTheme(),a);return Y({},o,t,i)},e.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},e.prototype.getComponentById=function(t){return Le(this.components,function(i){return i.id===t})},e.prototype.getCategoryLegendSizeCfg=function(t,i,n){i===void 0&&(i=Fh),n===void 0&&(n=Fh);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}(on),Y2=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.onChangeFn=Mr,i.resetMeasure=function(){i.clear()},i.onValueChange=function(n){var a=g.__read(n,2),o=a[0],s=a[1];i.start=o,i.end=s,i.changeViewData(o,s)},i.container=i.view.getLayer(At.FORE).addGroup(),i.onChangeFn=Yu(i.onValueChange,20,{leading:!0}),i.width=0,i.view.on(it.BEFORE_CHANGE_DATA,i.resetMeasure),i.view.on(it.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(it.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(it.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;D(this.start)&&(this.start=i,this.end=n);var a=this.view.getOptions().data;this.option&&!oe(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=g.__read(n,4),o=a[0];a[1],a[2];var s=a[3],l=this.slider.component.getLayoutBBox(),u=new Qt(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=g.__read(Fr(this.view.viewBBox,u,N.BOTTOM),2);v[0];var d=v[1],p=g.__read(Fr(this.view.coordinateBBox,u,N.BOTTOM),2),y=p[0];p[1],this.slider.component.update(g.__assign(g.__assign({},this.getSliderCfg()),{x:y+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,N.BOTTOM)}},e.prototype.update=function(){this.render()},e.prototype.createSlider=function(){var t=this.getSliderCfg(),i=new uC(g.__assign({container:this.container},t));return i.init(),{component:i,layer:At.FORE,direction:N.BOTTOM,type:Dt.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=g.__assign(g.__assign({},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=g.__assign({data:this.getData()},M(this.option,"trendCfg",{}));t=Y({},t,this.getThemeOptions(),this.option),t=g.__assign(g.__assign({},t),{trendCfg:i})}return t.start=mt(Math.min(D(t.start)?0:t.start,D(t.end)?1:t.end),0,1),t.end=mt(Math.max(D(t.start)?0:t.start,D(t.end)?1:t.end),0,1),t},e.prototype.getData=function(){var t=this.view.getOptions().data,i=g.__read(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 M(t,["components","slider","common"],{})},e.prototype.getMinMaxText=function(t,i){var n=this.view.getOptions().data,a=this.view.getXScale(),o=De(n,a.field);a.isLinear&&(o=o.sort());var s=o,l=Bt(n);if(!a||!l)return{};var u=Bt(s),c=Math.round(t*(u-1)),h=Math.round(i*(u-1)),f=M(s,[c]),v=M(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=Bt(n);if(!(!a||!o)){var s=De(n,a.field),l=this.view.getXScale().isLinear?s.sort(function(v,d){return Number(v)-Number(d)}):s,u=l,c=Bt(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?Bi(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}(on),no=0,Uv=8,$2=32,H2=20,X2=function(r){g.__extends(e,r);function e(t){var i=r.call(this,t)||this;return i.onChangeFn=Mr,i.resetMeasure=function(){i.clear()},i.onValueChange=function(n){var a=n.ratio,o=i.getValidScrollbarCfg().animate;i.ratio=mt(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(At.FORE).addGroup(),i.onChangeFn=Yu(i.onValueChange,20,{leading:!0}),i.trackLen=0,i.thumbLen=0,i.ratio=0,i.view.on(it.BEFORE_CHANGE_DATA,i.resetMeasure),i.view.on(it.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(it.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(it.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 Qt(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=g.__read(Fr(this.view.viewBBox,o,N.BOTTOM),2);c[0];var h=c[1],f=g.__read(Fr(this.view.coordinateBBox,o,N.BOTTOM),2),v=f[0];f[1],l=v,u=h}else{var d=g.__read(Fr(this.view.viewBBox,o,N.RIGHT),2);d[0];var h=d[1],p=g.__read(Fr(this.view.viewBBox,o,N.RIGHT),2),v=p[0];p[1],l=v,u=h}l+=n[3],u+=n[0],this.trackLen?this.scrollbar.component.update(g.__assign(g.__assign({},s),{x:l,y:u,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update(g.__assign(g.__assign({},s),{x:l,y:u})),this.view.viewBBox=this.view.viewBBox.cut(o,s.isHorizontal?N.BOTTOM:N.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 M(t,["components","scrollbar","common"],{})},e.prototype.getScrollbarTheme=function(t){var i=M(this.view.getTheme(),["components","scrollbar"]),n=t||{},a=n.thumbHighlightColor,o=g.__rest(n,["thumbHighlightColor"]);return{default:Y({},M(i,["default","style"],{}),o),hover:Y({},M(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)*mt(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=g.__read(t,2),o=a[0],s=a[1],l=this.getValidScrollbarCfg().type,u=l!=="vertical",c=De(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?Bi(d,o,s):!0}),this.view.render(!0)},e.prototype.createScrollbar=function(){var t=this.getValidScrollbarCfg().type,i=t!=="vertical",n=new hC(g.__assign(g.__assign({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return n.init(),{component:n,layer:At.FORE,direction:i?N.BOTTOM:N.RIGHT,type:Dt.SCROLLBAR}},e.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),i=this.trackLen?g.__assign(g.__assign({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):g.__assign({},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=De(i,t.field);return Bt(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=g.__read(s,4),v=f[0],d=f[1],p=f[2],y=f[3],m=h?{x:i.minX+y,y:n.maxY-u-p}:{x:n.maxX-l-d,y:i.minY+v},x=this.getStep(),_=this.getCnt(),w=h?i.width-y-d:i.height-v-p,b=Math.max(w*mt(x/_,0,1),H2);return g.__assign(g.__assign({},this.getThemeOptions()),{x:m.x,y:m.y,size:h?u:l,isHorizontal:h,trackLen:w,thumbLen:b,thumbOffset:0,theme:this.getScrollbarTheme(c)})},e.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:$2,width:Uv,height:Uv,padding:[0,0,0,0],animate:!0,style:{}};return pt(this.option)&&(t=g.__assign(g.__assign({},t),this.option)),(!pt(this.option)||!this.option.padding)&&(t.padding=t.type==="horizontal"?[no,0,no,0]:[0,no,0,no]),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=g.__spreadArray([],g.__read(n),!1).reverse()),n},e}(on),W2={fill:"#CCD6EC",opacity:.3};function q2(r,e,t){var i,n,a,o,s,l,u=bM(r,e,t);if(u.length){u=ve(u);try{for(var c=g.__values(u),h=c.next();!h.done;h=c.next()){var f=h.value;try{for(var v=(a=void 0,g.__values(f)),d=v.next();!d.done;d=v.next()){var p=d.value,y=p.mappingData,m=y.x,x=y.y;p.x=O(m)?m[m.length-1]:m,p.y=O(x)?x[x.length-1]:x}}catch(T){a={error:T}}finally{try{d&&!d.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}}}catch(T){i={error:T}}finally{try{h&&!h.done&&(n=c.return)&&n.call(c)}finally{if(i)throw i.error}}var _=t.shared;if(_===!1&&u.length>1){var w=u[0],b=Math.abs(e.y-w[0].y);try{for(var C=g.__values(u),A=C.next();!A.done;A=C.next()){var F=A.value,E=Math.abs(e.y-F[0].y);E<=b&&(w=F,b=E)}}catch(T){s={error:T}}finally{try{A&&!A.done&&(l=C.return)&&l.call(C)}finally{if(s)throw s.error}}u=[w]}return hi(ve(u))}return[]}var U2=function(r){g.__extends(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(!Lt(o,this.items)&&(this.items=o,o.length)){var s=i.getXScale().field,l=o[0].data[s],u=[],c=i.geometries;if(S(c,function($){if($.type==="interval"||$.type==="schema"){var G=$.getElementsBy(function(V){var H=V.getData();return H[s]===l});u=u.concat(G)}}),u.length){var h=i.getCoordinate(),f=u[0].shape.getCanvasBBox(),v=u[0].shape.getCanvasBBox(),d=f;S(u,function($){var G=$.shape.getCanvasBBox();h.isTransposed?(G.minY<f.minY&&(f=G),G.maxY>v.maxY&&(v=G)):(G.minX<f.minX&&(f=G),G.maxX>v.maxX&&(v=G)),d.x=Math.min(G.minX,d.minX),d.y=Math.min(G.minY,d.minY),d.width=Math.max(G.maxX,d.maxX)-d.x,d.height=Math.max(G.maxY,d.maxY)-d.y});var p=i.backgroundGroup,y=i.coordinateBBox,m=void 0;if(h.isRect){var x=i.getXScale(),_=t||{},w=_.appendRatio,b=_.appendWidth;D(b)&&(w=D(w)?x.isLinear?0:.25:w,b=h.isTransposed?w*v.height:w*f.width);var C=void 0,A=void 0,F=void 0,E=void 0;h.isTransposed?(C=y.minX,A=Math.min(v.minY,f.minY)-b,F=y.width,E=d.height+b*2):(C=Math.min(f.minX,v.minX)-b,A=y.minY,F=d.width+b*2,E=y.height),m=[["M",C,A],["L",C+F,A],["L",C+F,A+E],["L",C,A+E],["Z"]]}else{var T=fe(u),k=It(u),P=ea(T.getModel(),h).startAngle,B=ea(k.getModel(),h).endAngle,z=h.getCenter(),X=h.getRadius(),I=h.innerRadius*X;m=Lr(z.x,z.y,X,P,B,I)}if(this.regionPath)this.regionPath.attr("path",m),this.regionPath.show();else{var R=M(t,"style",W2);this.regionPath=p.addShape({type:"path",name:"active-region",capture:!1,attrs:g.__assign(g.__assign({},R),{path:m})})}}}},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}(yt),im=function(r){g.__extends(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=M(t.view.getOptions(),"tooltip.showDelay",16);if(s-o>l){var u=this.location,c={x:i.x,y:i.y};(!u||!Lt(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}(yt),j2=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.showTooltip=function(t,i){var n=Xe(t);S(n,function(a){var o=uu(t,a,i);a.showTooltip(o)})},e.prototype.hideTooltip=function(t){var i=Xe(t);S(i,function(n){n.hideTooltip()})},e}(im),Z2=function(r){g.__extends(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||!Lt(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")){this.tooltip||this.renderTooltip();var o=a.get("tip");this.tooltip.update(g.__assign({title:o},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=M(o,["components","tooltip","domStyles"],{}),l=new Cs({parent:n.get("el").parentNode,region:a,visible:!1,crosshairs:null,domStyles:g.__assign({},Y({},s,(t={},t[hr]={"max-width":"50%"},t[fr]={"word-break":"break-all"},t)))});l.init(),l.setCapture(!1),this.tooltip=l},e}(yt),Nc=function(r){g.__extends(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=ty(t,this.stateName);S(n,function(a){i.setElementState(a,!1)})},e}(yt);function jv(r){return M(r.get("delegateObject"),"item")}var zc=function(r){g.__extends(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=Gt(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=qi(a,i),s=Be(t,i);return!D(s)&&n.name===o.getText(s)},e.prototype.setElementsStateByItem=function(t,i,n,a){var o=this;S(t,function(s){o.isMathItem(s,i,n)&&s.setState(o.stateName,a)})},e.prototype.setStateEnable=function(t){var i=Br(this.context);if(i)Zp(this.context)&&this.setStateByElement(i,t);else{var n=di(this.context);if(ia(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&&jv(s.fromShape)===jv(s.toShape))return;this.setStateByComponent(o,a,t)}}}},e.prototype.toggle=function(){var t=Br(this.context);if(t){var i=t.hasState(this.stateName);this.setElementState(t,!i)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(Nc),Q2=function(r){g.__extends(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}(zc),K2=function(r){g.__extends(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:g.__assign(g.__assign({},Y({},o,W(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=Be(t,o.field);if(!this.cache[s]){var l=tM(a,o.field,s),u=this.linkGroup,c=u.addGroup();this.cache[s]=c;var h=l.length;S(l,function(f,v){if(v<h-1){var d=l[v+1];n.addLinkShape(c,f,d,i)}})}}},e.prototype.removeLink=function(t){var i=this.getColorScale(this.context.view,t);if(i){var n=Be(t,i.field);this.cache[n]&&(this.cache[n].remove(),this.cache[n]=null)}},e.prototype.link=function(t){var i=this.context;this.linkGroup||(this.linkGroup=i.view.foregroundGroup.addGroup({id:"link-by-color-group",capture:!1}));var n=Br(i);n&&this.linkByElement(n,t==null?void 0:t.style)},e.prototype.unlink=function(){var t=Br(this.context);t&&this.removeLink(t)},e.prototype.clear=function(){this.linkGroup&&this.linkGroup.clear(),this.cache={}},e.prototype.destroy=function(){r.prototype.destroy.call(this),this.linkGroup&&this.linkGroup.remove()},e}(yt),Vc=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.startPoint=null,t.endPoint=null,t.isStarted=!1,t.effectSiblings=!1,t.effectByRecord=!1,t}return e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.start=function(){this.clear(),this.startPoint=this.getCurrentPoint(),this.isStarted=!0},e.prototype.getIntersectElements=function(){var t=null;if(na(this.context))t=gc(this.context,10);else{var i=this.startPoint,n=this.isStarted?this.getCurrentPoint():this.endPoint;if(!i||!n)return;var a={minX:Math.min(i.x,n.x),minY:Math.min(i.y,n.y),maxX:Math.max(i.x,n.x),maxY:Math.max(i.y,n.y)},o=this.context.view;t=Ts(o,a)}return t},e.prototype.setStateEnable=function(t){if(this.effectSiblings&&!this.effectByRecord)this.setSiblingsState(t);else{var i=Gt(this.context.view),n=this.getIntersectElements();n&&n.length?this.effectByRecord?this.setSiblingsStateByRecord(n,t):this.setElementsState(n,t,i):this.clear()}},e.prototype.setSiblingsStateByRecord=function(t,i){var n=this,a=this.context.view,o=Xe(a),s=t.map(function(c){return c.getModel().data}),l=a.getXScale().field,u=a.getYScales()[0].field;S(o,function(c){var h=Gt(c),f=h.filter(function(v){var d=v.getModel().data;return iy(s,d,l,u)});n.setElementsState(f,i,h)})},e.prototype.setSiblingsState=function(t){var i=this,n=this.context.view,a=Xe(n);na(this.context)&&S(a,function(o){var s=Gt(o),l=Kp(i.context,o,10);l&&l.length?i.setElementsState(l,t,s):i.clearViewState(o)})},e.prototype.setElementsState=function(t,i,n){var a=this;S(n,function(o){t.includes(o)?a.setElementState(o,i):a.setElementState(o,!1)})},e.prototype.end=function(){this.isStarted=!1,this.endPoint=this.getCurrentPoint()},e.prototype.clear=function(){var t=this,i=this.context.view;if(this.effectSiblings){var n=Xe(i);S(n,function(a){t.clearViewState(a)})}else this.clearViewState(i)},e}(Nc),J2=function(r){g.__extends(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}(Vc),Gc=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setStateEnable=function(t){var i=Br(this.context);if(i){if(!Zp(this.context))return;t?(this.clear(),this.setElementState(i,!0)):this.hasState(i)&&this.setElementState(i,!1)}},e.prototype.toggle=function(){var t=Br(this.context);if(t){var i=this.hasState(t);i||this.clear(),this.setElementState(t,!i)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(Nc),tE=function(r){g.__extends(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}(Gc),Vn="inactive",Gn="active";function Yc(r){var e=Gt(r);S(e,function(t){t.hasState(Gn)&&t.setState(Gn,!1),t.hasState(Vn)&&t.setState(Vn,!1)})}function nm(r,e,t){S(r,function(i){e(i)?(i.hasState(Vn)&&i.setState(Vn,!1),i.setState(Gn,t)):(i.hasState(Gn)&&i.setState(Gn,!1),i.setState(Vn,t))})}var ti=Co.INACTIVE,er=Co.ACTIVE,$c=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=er,t}return e.prototype.setElementsStateByItem=function(t,i,n,a){var o=this,s=function(l){return o.isMathItem(l,i,n)};this.setHighlightBy(t,s,a)},e.prototype.setElementHighlight=function(t,i){i(t)?(t.hasState(ti)&&t.setState(ti,!1),t.setState(er,!0)):t.hasState(er)||t.setState(ti,!0)},e.prototype.setHighlightBy=function(t,i,n){var a=this;if(n)S(t,function(l){a.setElementHighlight(l,i)});else{var o=ty(this.context.view,er),s=!0;S(o,function(l){if(!i(l))return s=!1,!1}),s?this.clear():S(t,function(l){i(l)&&(l.hasState(er)&&l.setState(er,!1),l.setState(ti,!0))})}},e.prototype.setElementState=function(t,i){var n=this.context.view,a=Gt(n);this.setHighlightBy(a,function(o){return t===o},i)},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t=this.context.view;Yc(t)},e}(zc),eE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setStateByElement=function(t,i){var n=this.context.view,a=t.geometry.getAttribute("color");if(a){var o=n.getScaleByField(a.getFields()[0]),s=Be(t,o.field),l=Gt(n),u=l.filter(function(c){return Be(c,o.field)===s});this.setHighlightBy(l,function(c){return u.includes(c)},i)}},e}($c),rE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.setElementHighlight=function(t,i){i(t)?(t.hasState(ti)&&t.setState(ti,!1),t.setState(er,!0)):(t.setState(ti,!0),t.hasState(er)&&t.setState(er,!1))},e.prototype.setStateByElement=function(t,i){var n=this.context.view,a=n.getXScale(),o=Be(t,a.field),s=Gt(n),l=s.filter(function(u){return Be(u,a.field)===o});this.setHighlightBy(s,function(u){return l.includes(u)},i)},e.prototype.toggle=function(){var t=Br(this.context);if(t){var i=t.hasState(this.stateName);this.setStateByElement(t,!i)}},e}($c),Ve;(function(r){r.BEFORE_HIGHLIGHT="element-range-highlight:beforehighlight",r.AFTER_HIGHLIGHT="element-range-highlight:afterhighlight",r.BEFORE_CLEAR="element-range-highlight:beforeclear",r.AFTER_CLEAR="element-range-highlight:afterclear"})(Ve||(Ve={}));var am=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName="active",t}return e.prototype.clearViewState=function(t){Yc(t)},e.prototype.highlight=function(){var t=this.context,i=t.view,n=t.event,a=this.getIntersectElements(),o={view:i,event:n,highlightElements:a};i.emit(Ve.BEFORE_HIGHLIGHT,bt.fromData(i,Ve.BEFORE_HIGHLIGHT,o)),this.setState(),i.emit(Ve.AFTER_HIGHLIGHT,bt.fromData(i,Ve.AFTER_HIGHLIGHT,o))},e.prototype.clear=function(){var t=this.context.view;t.emit(Ve.BEFORE_CLEAR,bt.fromData(t,Ve.BEFORE_CLEAR,{})),r.prototype.clear.call(this),t.emit(Ve.AFTER_CLEAR,bt.fromData(t,Ve.AFTER_CLEAR,{}))},e.prototype.setElementsState=function(t,i,n){nm(n,function(a){return t.indexOf(a)>=0},i)},e}(Vc),iE=function(r){g.__extends(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=Gt(n);nm(a,function(o){return t===o},i)},e.prototype.clear=function(){var t=this.context.view;Yc(t)},e}(Gc),nE=function(r){g.__extends(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}(Vc),aE=function(r){g.__extends(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}(zc),oE=function(r){g.__extends(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}(Gc),_i=function(r){g.__extends(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=di(this.context),i=null;return ia(t)&&(i={item:t.item,list:t.component}),i},e.prototype.getAllowComponents=function(){var t=this,i=this.context.view,n=ry(i),a=[];return S(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();S(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=qi(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=qi(o,a),l=Be(i,a),u=s.getText(l);this.setItemsState(t,u,n)},e.prototype.setStateEnable=function(t){var i=this,n=Br(this.context);if(n){var a=this.getAllowComponents();S(a,function(u){i.setStateByElement(u,n,t)})}else{var o=di(this.context);if(ia(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();S(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}(yt),sE=function(r){g.__extends(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}(_i),Zv="inactive",Qv="active";function lE(r){var e=r.getItems();S(e,function(t){r.hasState(t,Qv)&&r.setItemState(t,Qv,!1),r.hasState(t,Zv)&&r.setItemState(t,Zv,!1)})}var wn="inactive",qr="active",Hc=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=qr,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)S(a,function(l){i(l)?(t.hasState(l,wn)&&t.setItemState(l,wn,!1),t.setItemState(l,qr,!0)):t.hasState(l,qr)||t.setItemState(l,wn,!0)});else{var o=t.getItemsByState(qr),s=!0;S(o,function(l){if(!i(l))return s=!1,!1}),s?this.clear():S(a,function(l){i(l)&&(t.hasState(l,qr)&&t.setItemState(l,qr,!1),t.setItemState(l,wn,!0))})}},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t=this.getTriggerListInfo();if(t)lE(t.list);else{var i=this.getAllowComponents();S(i,function(n){n.clearItemsState(qr),n.clearItemsState(wn)})}},e}(_i),uE=function(r){g.__extends(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}(_i),cE=function(r){g.__extends(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}(_i),Fi="unchecked",ao="checked",hE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.stateName=ao,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&&S(a,function(o){i(o)?(t.hasState(o,Fi)&&t.setItemState(o,Fi,!1),t.setItemState(o,ao,!0)):t.hasState(o,ao)||t.setItemState(o,Fi,!0)})},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var i=t.list,n=t.item,a=!Qo(i.getItems(),function(o){return i.hasState(o,Fi)});a||i.hasState(n,Fi)?this.setItemState(i,n,!0):this.reset()}},e.prototype.checked=function(){this.setState()},e.prototype.reset=function(){var t=this.getAllowComponents();S(t,function(i){i.clearItemsState(ao),i.clearItemsState(Fi)})},e}(_i),Ti="unchecked",fE=function(r){g.__extends(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(T){return!h.hasState(T,Ti)}),p=v.filter(function(T){return h.hasState(T,Ti)}),y=d[0];if(v.length===d.length)try{for(var m=g.__values(v),x=m.next();!x.done;x=m.next()){var _=x.value;h.setItemState(_,Ti,_.id!==f.id)}}catch(T){t={error:T}}finally{try{x&&!x.done&&(i=m.return)&&i.call(m)}finally{if(t)throw t.error}}else if(v.length-p.length===1)if(y.id===f.id)try{for(var w=g.__values(v),b=w.next();!b.done;b=w.next()){var _=b.value;h.setItemState(_,Ti,!1)}}catch(T){n={error:T}}finally{try{b&&!b.done&&(a=w.return)&&a.call(w)}finally{if(n)throw n.error}}else try{for(var C=g.__values(v),A=C.next();!A.done;A=C.next()){var _=A.value;h.setItemState(_,Ti,_.id!==f.id)}}catch(T){o={error:T}}finally{try{A&&!A.done&&(s=C.return)&&s.call(C)}finally{if(o)throw o.error}}else try{for(var F=g.__values(v),E=F.next();!E.done;E=F.next()){var _=E.value;h.setItemState(_,Ti,_.id!==f.id)}}catch(T){l={error:T}}finally{try{E&&!E.done&&(u=F.return)&&u.call(F)}finally{if(l)throw l.error}}}},e}(_i),Kv="showRadio",Cl="legend-radio-tip",vE=function(r){g.__extends(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,Kv,!0)}},e.prototype.hide=function(){var t=this.getTriggerListInfo();if(t!=null&&t.item){var i=t.list,n=t.item;i.setItemState(n,Kv,!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||!Lt(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(g.__assign(g.__assign({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[hr]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[fr]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(Cl)&&document.body.removeChild(document.getElementById(Cl));var n=new Cs({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:i,containerId:Cl});n.init(),n.setCapture(!1),this.tooltip=n},e}(_i),Xc=function(r){g.__extends(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:g.__assign({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;S(o,function(s){s.x+=n,s.y+=a}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},e.prototype.updateMask=function(t){var i=Y({},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}(yt);function om(r){var e=It(r),t=0,i=0,n=0;if(r.length){var a=r[0];t=pc(a,e)/2,i=(e.x+a.x)/2,n=(e.y+a.y)/2}return{x:i,y:n,r:t}}var dE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="circle",t}return e.prototype.getMaskAttrs=function(){return om(this.points)},e}(Xc);function sm(r){return{start:fe(r),end:It(r)}}function lm(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 um=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="rect",t}return e.prototype.getRegion=function(){return sm(this.points)},e.prototype.getMaskAttrs=function(){var t=this.getRegion(),i=t.start,n=t.end;return lm(i,n)},e}(Xc);function Jv(r){r.x=mt(r.x,0,1),r.y=mt(r.y,0,1)}function cm(r,e,t,i){var n=null,a=null,o=i.invert(fe(r)),s=i.invert(It(r));return t&&(Jv(o),Jv(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 hm=function(r){g.__extends(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 cm(this.points,this.dim,this.inPlot,t)},e}(um);function Wc(r){var e=[];return r.length&&(S(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 fm(r){return{path:Wc(r)}}var vm=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){return Wc(this.points)},e.prototype.getMaskAttrs=function(){return fm(this.points)},e.prototype.addPoint=function(){this.resize()},e}(Xc);function qc(r){return rM(r,!0)}function dm(r){return{path:qc(r)}}var gE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getMaskPath=function(){return qc(this.points)},e.prototype.getMaskAttrs=function(){return dm(this.points)},e}(vm),Uc=function(r){g.__extends(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:g.__assign({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=Y({},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 g.__spreadArray([],g.__read((t=this.recordPoints)!==null&&t!==void 0?t:[]),!1)},e.prototype.recordPointStart=function(){var t=this.getRecordPoints(),i=this.getCurrentPoint();this.recordPoints=g.__spreadArray(g.__spreadArray([],g.__read(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=g.__spreadArray(g.__spreadArray([],g.__read(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}(yt),gm=function(r){g.__extends(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 sm(t)},e.prototype.getMaskAttrs=function(t){var i=this.getRegion(t),n=i.start,a=i.end;return lm(n,a)},e}(Uc),pm=function(r){g.__extends(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 cm(t,this.dim,this.inPlot,i)},e}(gm),pE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.shapeType="circle",t.getMaskAttrs=om,t}return e}(Uc),ym=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.getMaskPath=Wc,t.getMaskAttrs=fm,t}return e.prototype.addPoint=function(){this.resize()},e}(Uc),yE=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.getMaskPath=qc,t.getMaskAttrs=dm,t}return e}(ym),mE=function(r){g.__extends(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}(yt),xE=function(r){g.__extends(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&&S(t.views,function(o){a.filterView(o,i,n)})},e.prototype.filter=function(){var t=di(this.context);if(t){var i=this.context.view,n=t.component,a=n.get("field");if(ia(t)){if(a){var o=n.getItemsByState("unchecked"),s=qi(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(Qp(t)){var u=n.getValue(),c=g.__read(u,2),h=c[0],f=c[1];this.filterView(i,a,function(v){return v>=h&&v<=f}),i.render(!0)}}},e}(yt);function td(r,e,t,i){var n=Math.min(t[e],i[e]),a=Math.max(t[e],i[e]),o=g.__read(r.range,2),s=o[0],l=o[1];if(n<s&&(n=s),a>l&&(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 te;(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"})(te||(te={}));var Ps=function(r){g.__extends(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(na(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(te.BEFORE_FILTER,bt.fromData(s,te.BEFORE_FILTER,u));var c=s.getCoordinate(),h=c.invert(i),f=c.invert(t);if(this.hasDim("x")){var v=s.getXScale(),d=td(v,"x",h,f);this.filterView(s,v.field,d)}if(this.hasDim("y")){var p=s.getYScales()[0],d=td(p,"y",h,f);this.filterView(s,p.field,d)}this.reRender(s,{source:te.FILTER}),s.emit(te.AFTER_FILTER,bt.fromData(s,te.AFTER_FILTER,u))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(te.BEFORE_RESET,bt.fromData(t,te.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:te.RESET}),t.emit(te.AFTER_RESET,bt.fromData(t,te.AFTER_RESET,{}))},e.prototype.filterView=function(t,i,n){t.filter(i,n)},e.prototype.reRender=function(t,i){t.render(!0,i)},e}(yt),jc=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filterView=function(t,i,n){var a=Xe(t);S(a,function(o){o.filter(i,n)})},e.prototype.reRender=function(t){var i=Xe(t);S(i,function(n){n.render(!0)})},e}(Ps),wE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.filter=function(){var t=di(this.context),i=this.context.view,n=Gt(i);if(na(this.context)){var a=gc(this.context,10);a&&S(n,function(p){a.includes(p)?p.show():p.hide()})}else if(t){var o=t.component,s=o.get("field");if(ia(t)){if(s){var l=o.getItemsByState("unchecked"),u=qi(i,s),c=l.map(function(p){return p.name});S(n,function(p){var y=Be(p,s),m=u.getText(y);c.indexOf(m)>=0?p.hide():p.show()})}}else if(Qp(t)){var h=o.getValue(),f=g.__read(h,2),v=f[0],d=f[1];S(n,function(p){var y=Be(p,s);y>=v&&y<=d?p.show():p.hide()})}}},e.prototype.clear=function(){var t=Gt(this.context.view);S(t,function(i){i.show()})},e.prototype.reset=function(){this.clear()},e}(yt),mm=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.byRecord=!1,t}return e.prototype.filter=function(){na(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},e.prototype.filterByRecord=function(){var t=this.context.view,i=gc(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=Xe(t);S(s,function(l){var u=Gt(l);S(u,function(c){var h=c.getModel().data;iy(o,h,n,a)?c.show():c.hide()})})}},e.prototype.filterByBBox=function(){var t=this,i=this.context.view,n=Xe(i);S(n,function(a){var o=Kp(t.context,a,10),s=Gt(a);o&&S(s,function(l){o.includes(l)?l.show():l.hide()})})},e.prototype.reset=function(){var t=Xe(this.context.view);S(t,function(i){var n=Gt(i);S(n,function(a){a.show()})})},e}(yt),_E=10,bE=5,SE=function(r){g.__extends(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 Y(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:g.__assign({text:t.text},t.textStyle)}),a=n.getBBox(),o=mc(t.padding),s=i.addShape({type:"rect",name:"button-rect",attrs:g.__assign({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=kt(null,[["t",n.x-o.width-_E,n.y+o.height+bE]]);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}(yt),CE=4,ME=function(r){g.__extends(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}):pc(t,this.startPoint)>CE&&(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}(yt),AE=5,FE=function(r){g.__extends(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=pc(t,i);if(n>AE&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var a=this.context.view,o=kt(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}(yt),ed="x",rd="y",xm=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.dims=[ed,rd],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(ed),this.resetDim(rd);var t=this.context.view;t.render(!0)},e}(yt),TE=function(r){g.__extends(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;S(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;S(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}(xm),EE=function(r){g.__extends(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;S(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}(xm);function kE(r){var e=r.gEvent.originalEvent;return e.deltaY>0}var LE=1,IE=function(r){g.__extends(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)||LE,s=n.getController("scrollbar"),l=n.getXScale(),u=n.getOptions().data,c=Bt(De(u,l.field)),h=Bt(l.values),f=s.getValue(),v=Math.floor((c-h)*f),d=v+(kE(a)?o:-o),p=o/(c-h)/1e4,y=mt(d/(c-h)+p,0,1);s.setValue(y)}},e}(yt),PE="aixs-description-tooltip",DE=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.show=function(){var t=this.context,i=di(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`
  42. <div class="`.concat(hr,'" style={').concat(s,`}>
  43. <div class="`).concat(fr,`">
  44. 字段说明:`).concat(a,`
  45. </div>
  46. </div>
  47. `)},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 Cs({parent:n.get("el").parentNode,region:a,visible:!1,containerId:PE,domStyles:g.__assign({},Y({},(t={},t[hr]={"max-width":"50%",padding:"10px","line-height":"15px","font-size":"12px",color:"rgba(0, 0, 0, .65)"},t[fr]={"word-break":"break-all","margin-bottom":"3px"},t)))});o.init(),o.setCapture(!1),this.tooltip=o},e}(yt);gM("dark",ay(rA));lg("canvas",aF);lg("svg",ZF);Ze("Polygon",cT);Ze("Interval",aT);Ze("Schema",hT);Ze("Path",Lc);Ze("Point",lT);Ze("Line",oT);Ze("Area",KF);Ze("Edge",JF);Ze("Heatmap",tT);Ze("Violin",vT);Sa("base",ks);Sa("interval",ET);Sa("pie",kT);Sa("polar",Ky);le("overlap",HT);le("distribute",IT);le("fixed-overlap",$T);le("hide-overlap",t2);le("limit-in-shape",zT);le("limit-in-canvas",NT);le("limit-in-plot",y2);le("pie-outer",DT);le("adjust-color",r2);le("interval-adjust-position",o2);le("interval-hide-overlap",l2);le("point-adjust-position",h2);le("pie-spider",RT);le("path-adjust-position",d2);de("fade-in",m2);de("fade-out",x2);de("grow-in-x",_2);de("grow-in-xy",S2);de("grow-in-y",b2);de("scale-in-x",A2);de("scale-in-y",F2);de("wave-in",E2);de("zoom-in",k2);de("zoom-out",L2);de("position-update",M2);de("sector-path-update",T2);de("path-in",C2);an("rect",O2);an("mirror",B2);an("list",P2);an("matrix",D2);an("circle",I2);an("tree",R2);wi("axis",V2);wi("legend",G2);wi("tooltip",cy);wi("annotation",z2);wi("slider",Y2);wi("scrollbar",X2);q("tooltip",im);q("sibling-tooltip",j2);q("ellipsis-text",Z2);q("element-active",Q2);q("element-single-active",tE);q("element-range-active",J2);q("element-highlight",$c);q("element-highlight-by-x",rE);q("element-highlight-by-color",eE);q("element-single-highlight",iE);q("element-range-highlight",am);q("element-sibling-highlight",am,{effectSiblings:!0,effectByRecord:!0});q("element-selected",aE);q("element-single-selected",oE);q("element-range-selected",nE);q("element-link-by-color",K2);q("active-region",U2);q("list-active",sE);q("list-selected",uE);q("list-highlight",Hc);q("list-unchecked",cE);q("list-checked",hE);q("list-focus",fE);q("list-radio",vE);q("legend-item-highlight",Hc,{componentNames:["legend"]});q("axis-label-highlight",Hc,{componentNames:["axis"]});q("axis-description",DE);q("rect-mask",um);q("x-rect-mask",hm,{dim:"x"});q("y-rect-mask",hm,{dim:"y"});q("circle-mask",dE);q("path-mask",vm);q("smooth-path-mask",gE);q("rect-multi-mask",gm);q("x-rect-multi-mask",pm,{dim:"x"});q("y-rect-multi-mask",pm,{dim:"y"});q("circle-multi-mask",pE);q("path-multi-mask",ym);q("smooth-path-multi-mask",yE);q("cursor",mE);q("data-filter",xE);q("brush",Ps);q("brush-x",Ps,{dims:["x"]});q("brush-y",Ps,{dims:["y"]});q("sibling-filter",jc);q("sibling-x-filter",jc,{dims:"x"});q("sibling-y-filter",jc,{dims:"y"});q("element-filter",wE);q("element-sibling-filter",mm);q("element-sibling-filter-record",mm,{byRecord:!0});q("view-drag",ME);q("view-move",FE);q("scale-translate",TE);q("scale-zoom",EE);q("reset-button",SE,{name:"reset-button",text:"reset"});q("mousewheel-scroll",IE);function sr(r){return r.isInPlot()}J("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"}]});J("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"}]});J("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]});J("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]});J("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]});J("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]});J("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]});J("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"]}]});J("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"]}]});J("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"]}]});J("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"]}]});J("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"]}]});J("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:sr,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:sr,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:sr,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"]}]});J("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"]}]});J("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:sr,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:sr,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:sr,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]});J("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:sr,action:"path-mask:start"},{trigger:"mousedown",isEnable:sr,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"}]});J("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:sr,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!Fs(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"]}]});J("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]});J("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"]}]});J("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]});J("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]});J("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"]}]});J("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]});J("axis-description",{start:[{trigger:"axis-description:mousemove",action:"axis-description:show"}],end:[{trigger:"axis-description:mouseleave",action:"axis-description:hide"}]});function id(r){return r.gEvent.preventDefault(),r.gEvent.originalEvent.deltaY>0}J("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(r){return id(r.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(r){return!id(r.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]});J("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]});J("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});var ne=["type","alias","tickCount","tickInterval","min","max","nice","minLimit","maxLimit","range","tickMethod","base","exponent","mask","sync"],Oe;(function(r){r.ERROR="error",r.WARN="warn",r.INFO="log"})(Oe||(Oe={}));var BE="AntV/G2Plot";function OE(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];var i=0;return"".concat(BE,": ").concat(r.replace(/%s/g,function(){return"".concat(e[i++])}))}function dr(r,e,t){for(var i=[],n=3;n<arguments.length;n++)i[n-3]=arguments[n];e||console[r](OE.apply(void 0,g.__spreadArray([t],i,!1)))}function ct(r,e){var t={};return r!==null&&typeof r=="object"&&e.forEach(function(i){var n=r[i];n!==void 0&&(t[i]=n)}),t}function Zc(r,e){if(!r)return{};var t=r.filter(function(a){var o=M(a,[e]);return tt(o)&&!isNaN(o)}),i=t.every(function(a){return M(a,[e])>=0}),n=t.every(function(a){return M(a,[e])<=0});return i?{min:0}:n?{max:0}:{}}function wm(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=ct(l,n);o[u]||(o[u]=g.__assign({id:++s,name:u},f)),o[c]||(o[c]=g.__assign({id:++s,name:c},f)),a.push(g.__assign({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 Zi(r,e){var t=Xt(r,function(i){var n=i[e];return n===null||typeof n=="number"&&!isNaN(n)});return dr(Oe.WARN,t.length===r.length,"illegal data existed in chart data."),t}var RE=5,NE={}.toString,_m=function(r,e){return NE.call(r)==="[object "+e+"]"},zE=function(r){return _m(r,"Array")},VE=function(r){return typeof r=="object"&&r!==null},nd=function(r){if(!VE(r)||!_m(r,"Object"))return!1;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e},bm=function(r,e,t,i){t=t||0,i=i||RE;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=e[n];a?nd(a)?(nd(r[n])||(r[n]={}),t<i?bm(r[n],a,t+1,i):r[n]=e[n]):zE(a)?(r[n]=[],r[n]=r[n].concat(a)):r[n]=a:r[n]=a}},L=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var i=0;i<e.length;i+=1)bm(r,e[i]);return r};function Su(r){if(!r)return{width:0,height:0};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 j(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(t){return r.reduce(function(i,n){return n(i)},t)}}function $t(r,e){return r.geometries.find(function(t){return t.type===e})}function Yo(r){return Zt(r.geometries,function(e,t){return e.concat(t.elements)},[])}function sa(r){return M(r,["views","length"],0)<=0?Yo(r):Zt(r.views,function(e,t){return e.concat(sa(t))},Yo(r))}function GE(r){return M(r,["views","length"],0)<=0?r.geometries:Zt(r.views,function(e,t){return e.concat(t.geometries)},r.geometries)}function ad(r){if(!r)return r;var e=r.match(/(([A-Z]{0,1}[a-z]*[^A-Z])|([A-Z]{1}))/g);return e.map(function(t){return t.toLowerCase()}).join("-")}function Ot(r){if(!$x(r,"Object"))return r;var e=g.__assign({},r);return e.formatter&&!e.content&&(e.content=e.formatter),e}var Ml;function YE(){return Ml||(Ml=document.createElement("canvas").getContext("2d")),Ml}ga(function(r,e){e===void 0&&(e={});var t=e.fontSize,i=e.fontFamily,n=i===void 0?"sans-serif":i,a=e.fontWeight,o=e.fontStyle,s=e.fontVariant,l=YE();l.font=[o,a,s,"".concat(t,"px"),n].join(" ");var u=l.measureText(K(r)?r:"");return u.width},function(r,e){return e===void 0&&(e={}),g.__spreadArray([r],$u(e),!0).join("")});function pi(r){return typeof r=="number"&&!isNaN(r)}function $E(r,e,t){var i=Math.min(e,t),n=Math.max(e,t);return r>=i&&r<=n}function Rr(r){if(tt(r))return[r,r,r,r];if(O(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 Ds(r,e,t){e===void 0&&(e="bottom"),t===void 0&&(t=25);var i=Rr(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 Qc(r){var e=r.map(function(i){return Rr(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 HE(r,e){var t=[];if(r.length){t.push(["M",r[0].x,r[0].y]);for(var i=1,n=r.length;i<n;i+=1){var a=r[i];t.push(["L",a.x,a.y])}e&&t.push(["Z"])}return t}var XE=function(r,e,t,i){var n=[],a,o,s=!!i,l,u;if(s){l=[1/0,1/0],u=[-1/0,-1/0];for(var c=0,h=r.length;c<h;c++){var f=r[c];l=Rt([0,0],l,f),u=Nt([0,0],u,f)}l=Rt([0,0],l,i[0]),u=Nt([0,0],u,i[1])}for(var c=0,v=r.length;c<v;c++){var f=r[c];if(t)a=r[c?c-1:v-1],o=r[(c+1)%v];else if(c===0||c===v-1){n.push(f);continue}else a=r[c-1],o=r[c+1];var d=[0,0];d=ii(d,o,a),d=jt(d,d,e);var p=Yi(f,a),y=Yi(f,o),m=p+y;m!==0&&(p/=m,y/=m);var x=jt([0,0],d,-p),_=jt([0,0],d,y),w=Ye([0,0],f,x),b=Ye([0,0],f,_);s&&(w=Nt([0,0],w,l),w=Rt([0,0],w,u),b=Nt([0,0],b,l),b=Rt([0,0],b,u)),n.push(w),n.push(b)}return t&&n.push(n.shift()),n};function WE(r,e,t){for(var i=!!e,n=[],a=0,o=r.length;a<o;a+=2)n.push([r[a],r[a+1]]);for(var s=XE(n,.4,i,t),l=n.length,u=[],c,h,f,a=0;a<l-1;a++)c=s[a*2],h=s[a*2+1],f=n[a+1],u.push(["C",c[0],c[1],h[0],h[1],f[0],f[1]]);return i&&(c=s[l],h=s[l+1],f=n[0],u.push(["C",c[0],c[1],h[0],h[1],f[0],f[1]])),u}function qE(r,e,t){var i=[],n=r[0],a=null;if(r.length<=2)return HE(r,e);for(var o=0,s=r.length;o<s;o++){var l=r[o];(!a||!(a.x===l.x&&a.y===l.y))&&(i.push(l.x),i.push(l.y),a=l)}var u=t||[[0,0],[1,1]],c=WE(i,e,u);return c.unshift(["M",n.x,n.y]),c}function Sm(r){var e={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis",display:"flex",justifyContent:"center",alignItems:"center"},t=["stroke","lineWidth","shadowColor","strokeOpacity","shadowBlur","shadowOffsetX","shadowOffsetY","fill"];M(r,"fill")&&(e.color=r.fill);var i=ct(r,t),n=i.shadowColor,a=i.shadowBlur,o=a===void 0?0:a,s=i.shadowOffsetX,l=s===void 0?0:s,u=i.shadowOffsetY,c=u===void 0?0:u;e["text-shadow"]="".concat([n,"".concat(l,"px"),"".concat(c,"px"),"".concat(o,"px")].join(" "));var h=ct(r,t),f=h.stroke,v=h.lineWidth,d=v===void 0?0:v;return e["-webkit-text-stroke"]="".concat(["".concat(d,"px"),f].join(" ")),S(r,function(p,y){["fontSize"].includes(y)&&tt(p)?e[ad(y)]="".concat(p,"px"):y&&!t.includes(y)&&(e[ad(y)]="".concat(p))}),e}function Cm(r,e){r.style["pointer-events"]="none",S(e,function(t,i){i&&t&&(r.style[i]=t)})}var Bs=function(r,e,t){var i=e.statistic,n=e.plotType,a=i.title,o=i.content;[a,o].forEach(function(s,l){if(s){var u="";l===0?u=o?"translate(-50%, -100%)":"translate(-50%, -50%)":u=a?"translate(-50%, 0)":"translate(-50%, -50%)";var c=W(s.style)?s.style(t):s.style;r.annotation().html(g.__assign({position:["50%","50%"],html:function(h,f){var v=f.getCoordinate(),d=0;if(n==="pie"||n==="ring-progress")d=v.getRadius()*v.innerRadius*2;else if(n==="liquid"){var p=M(f.geometries,[0,"elements",0,"shape"]);if(p){var y=p.find(function(w){return w.get("name")==="wrap"}),m=y.getCanvasBBox().width;d=m}}else d||(d=v.getWidth());Cm(h,g.__assign({width:"".concat(d,"px"),transform:u},Sm(c)));var x=f.getData();if(s.customHtml)return s.customHtml(h,f,t,x);var _=s.content;return s.formatter&&(_=s.formatter(t,x)),_?K(_)?_:"".concat(_):"<div></div>"},key:"".concat(l===0?"top":"bottom","-statistic")},ct(s,["offsetX","offsetY","rotate","style","formatter"])))}})},UE=function(r,e,t){var i=e.statistic,n=i.title,a=i.content;[n,a].forEach(function(o){if(o){var s=W(o.style)?o.style(t):o.style;r.annotation().html(g.__assign({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(M(s,"fontSize",0)),y=c.getRadius()*c.innerRadius*2;Cm(l,g.__assign({width:"".concat(y,"px"),transform:"translate(-50%, ".concat(p,"px)")},Sm(s)));var m=u.getData();if(o.customHtml)return o.customHtml(l,u,t,m);var x=o.content;return o.formatter&&(x=o.formatter(t,m)),x?K(x)?x:"".concat(x):"<div></div>"}},ct(o,["offsetX","offsetY","rotate","style","formatter"])))}})};function Mm(r,e){return e?Zt(e,function(t,i,n){return t.replace(new RegExp("{\\s*".concat(n,"\\s*}"),"g"),i)},r):r}function nt(r,e){return r.views.find(function(t){return t.id===e})}function Tn(r){var e=r.parent;return e?e.views:[]}function od(r){return Tn(r).filter(function(e){return e!==r})}function Aa(r,e,t){t===void 0&&(t=r.geometries),typeof e=="boolean"?r.animate(e):r.animate(!0),S(t,function(i){var n;W(e)?n=e(i.type||i.shapeType,i)||!0:n=e,i.animate(n)})}function Os(){return typeof window=="object"?window==null?void 0:window.devicePixelRatio:2}function Kc(r,e){e===void 0&&(e=r);var t=document.createElement("canvas"),i=Os();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 Jc(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 Am(r,e,t){var i=r+e;return t?i*2:i}function Fm(r,e){var t=e?[[r*.25,r*.25],[r*.75,r*.75]]:[[r*.5,r*.5]];return t}function th(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 jE={size:6,padding:2,backgroundColor:"transparent",opacity:1,rotation:0,fill:"#fff",fillOpacity:.5,stroke:"transparent",lineWidth:0,isStagger:!0};function ZE(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 QE(r){var e=L({},jE,r),t=e.size,i=e.padding,n=e.isStagger,a=e.rotation,o=Am(t,i,n),s=Fm(o,n),l=Kc(o,o),u=l.getContext("2d");Jc(u,e,o);for(var c=0,h=s;c<h.length;c++){var f=h[c],v=f[0],d=f[1];ZE(u,e,v,d)}var p=u.createPattern(l,"repeat");if(p){var y=Os(),m=th(y,a);p.setTransform(m)}return p}var KE={rotation:45,spacing:5,opacity:1,backgroundColor:"transparent",strokeOpacity:.5,stroke:"#fff",lineWidth:2};function JE(r,e,t){var i=e.stroke,n=e.lineWidth,a=e.strokeOpacity,o=new Path2D(t);r.globalAlpha=a,r.lineCap="square",r.strokeStyle=n?i:"transparent",r.lineWidth=n,r.stroke(o)}function tk(r){var e=L({},KE,r),t=e.spacing,i=e.rotation,n=e.lineWidth,a=t+n||1,o=t+n||1,s=`
  48. M 0 0 L `.concat(a,` 0
  49. M 0 `).concat(o," L ").concat(a," ").concat(o,`
  50. `),l=Kc(a,o),u=l.getContext("2d");Jc(u,e,a,o),JE(u,e,s);var c=u.createPattern(l,"repeat");if(c){var h=Os(),f=th(h,i);c.setTransform(f)}return c}var ek={size:6,padding:1,isStagger:!0,backgroundColor:"transparent",opacity:1,rotation:0,fill:"#fff",fillOpacity:.5,stroke:"transparent",lineWidth:0};function rk(r,e,t,i){var n=e.stroke,a=e.size,o=e.fill,s=e.lineWidth,l=e.fillOpacity;r.globalAlpha=l,r.strokeStyle=n,r.lineWidth=s,r.fillStyle=o,r.strokeRect(t-a/2,i-a/2,a,a),r.fillRect(t-a/2,i-a/2,a,a)}function ik(r){var e=L({},ek,r),t=e.size,i=e.padding,n=e.isStagger,a=e.rotation,o=Am(t,i,n),s=Fm(o,n),l=Kc(o,o),u=l.getContext("2d");Jc(u,e,o);for(var c=0,h=s;c<h.length;c++){var f=h[c],v=f[0],d=f[1];rk(u,e,v,d)}var p=u.createPattern(l,"repeat");if(p){var y=Os(),m=th(y,a);p.setTransform(m)}return p}function nk(r){var e=r.type,t=r.cfg,i;switch(e){case"dot":i=QE(t);break;case"line":i=tk(t);break;case"square":i=ik(t);break}return i}function ge(r){var e=this;return function(t){var i,n=t.options,a=t.chart,o=n.pattern;if(!o)return t;var s=function(l){for(var u,c,h,f=[],v=1;v<arguments.length;v++)f[v-1]=arguments[v];var d=a.getTheme().defaultColor,p=d,y=(c=(u=a.geometries)===null||u===void 0?void 0:u[0])===null||c===void 0?void 0:c.getAttribute("color");if(y){var m=y.getFields()[0],x=M(l,m);p=se.getMappingValue(y,x,((h=y.values)===null||h===void 0?void 0:h[0])||d)}var _=o;typeof o=="function"&&(_=o.call(e,l,p)),_ instanceof CanvasPattern||(_=nk(L({},{cfg:{backgroundColor:p}},_)));var w=n[r];return g.__assign(g.__assign({},typeof w=="function"?w.call.apply(w,g.__spreadArray([e,l],f,!1)):w||{}),{fill:_||p})};return L({},t,{options:(i={},i[r]=s,i)})}}function sn(r){var e=r.chart,t=r.options,i=t.legend,n=t.colorField,a=t.seriesField;return i===!1?e.legend(!1):(n||a)&&e.legend(n||a,i),r}function Pt(r){var e=r.chart,t=r.options,i=t.tooltip;return i!==void 0&&e.tooltip(i),r}function wt(r){var e=r.chart,t=r.options,i=t.interactions;return S(i,function(n){n.enable===!1?e.removeInteraction(n.type):e.interaction(n.type,n.cfg||{})}),r}function vt(r){var e=r.chart,t=r.options,i=t.animation;return Aa(e,i),r}function ot(r){var e=r.chart,t=r.options,i=t.theme;return i&&e.theme(i),r}function Hr(r){var e=r.chart,t=r.options,i=t.state;return i&&S(e.geometries,function(n){n.state(i)}),r}function Fa(r){var e=r.chart,t=r.options,i=t.slider;return e.option("slider",i),r}function eh(r){var e=r.chart,t=r.options,i=t.scrollbar;return e.option("scrollbar",i),r}function Mt(r,e){return function(t){var i=t.chart,n=t.options,a={};return S(r,function(o,s){a[s]=ct(o,ne)}),a=L({},e,n.meta,a),i.scale(a),t}}function St(r){return function(e){var t=e.chart,i=e.options,n=t.getController("annotation");return S(g.__spreadArray(g.__spreadArray([],i.annotations||[],!0),r||[],!0),function(a){n.annotation(a)}),e}}function yi(r){var e=r.chart,t=r.options,i=t.yAxis,n=t.limitInPlot,a=n;return pt(i)&&D(n)&&(Object.values(ct(i,["min","max","minLimit","maxLimit"])).some(function(o){return!D(o)})?a=!0:a=!1),e.limitInPlot=a,r}function Tm(r){return r===void 0&&(r="rect"),function(e){var t=e.chart,i=e.options,n=i.coordinate,a=Array.from(n||[]).map(function(o){return o.type==="reflectX"?["reflect","x"]:o.type==="reflectY"?["reflect","y"]:o.type==="transpose"?["transpose"]:null}).filter(function(o){return!!o});return a.length!==0&&t.coordinate({type:r,actions:a}),e}}var ak={locale:"en-US"},yo={};function Em(r,e){yo[r]=e}function Rs(r){return{get:function(e,t){return Mm(M(yo[r],e)||M(yo[ak.locale],e)||M(yo["en-US"],e)||e,t)}}}var ok={locale:"en-US",general:{increase:"Increase",decrease:"Decrease",root:"Root"},statistic:{total:"Total"},conversionTag:{label:"Rate"},legend:{},tooltip:{},slider:{},scrollbar:{},waterfall:{total:"Total"}},sk={locale:"zh-CN",general:{increase:"增加",decrease:"减少",root:"初始"},statistic:{total:"总计"},conversionTag:{label:"转化率"},legend:{},tooltip:{},slider:{},scrollbar:{},waterfall:{total:"总计"}};function Fe(r,e){if(r===!1)return{fields:!1};var t=M(r,"fields"),i=M(r,"formatter");return i&&!t&&(t=e),{fields:t,formatter:i}}function oo(r,e){var t=r.type,i=r.xField,n=r.yField,a=r.colorField,o=r.shapeField,s=r.sizeField,l=r.styleField,u=r.rawFields,c=[];if(u=(W(u)?u(t,e):u)||[],e==="color")c=g.__spreadArray([a||i],u,!0);else if(e==="shape")c=g.__spreadArray([o||i],u,!0);else if(e==="size")c=g.__spreadArray([s||i],u,!0);else{c=g.__spreadArray([i,n,a,o,s,l],u,!0);var h=["x","y","color","shape","size","style"].indexOf(e),f=c[h];c.splice(h,1),c.unshift(f)}var v=hi(c.filter(function(p){return!!p})),d=t==="line"&&[i,n].includes(v.join("*"))?"":v.join("*");return{mappingFields:v,tileMappingField:d}}function ki(r,e){if(e)return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n={};return r.forEach(function(a,o){n[a]=t[o]}),delete n.undefined,e(n)}}function ue(r){var e=r.chart,t=r.options,i=t.type,n=t.args,a=t.mapping,o=t.xField,s=t.yField,l=t.colorField,u=t.shapeField,c=t.sizeField,h=t.tooltipFields,f=t.label,v=t.state,d=t.customInfo;if(!a)return r;var p=a.color,y=a.shape,m=a.size,x=a.style,_=a.tooltip,w=e[i](n).position("".concat(o,"*").concat(s));if(K(p))l?w.color(l,p):w.color(p);else if(W(p)){var b=oo(t,"color"),C=b.mappingFields,A=b.tileMappingField;w.color(A,ki(C,p))}else l&&w.color(l,p);if(K(y))u?w.shape(u,[y]):w.shape(y);else if(W(y)){var F=oo(t,"shape"),C=F.mappingFields,A=F.tileMappingField;w.shape(A,ki(C,y))}else u&&w.shape(u,y);if(tt(m))c?w.size(c,m):w.size(m);else if(W(m)){var E=oo(t,"size"),C=E.mappingFields,A=E.tileMappingField;w.size(A,ki(C,m))}else c&&w.size(c,m);if(W(x)){var T=oo(t,"style"),C=T.mappingFields,A=T.tileMappingField;w.style(A,ki(C,x))}else pt(x)&&w.style(x);if(h===!1?w.tooltip(!1):oe(h)||w.tooltip(h.join("*"),ki(h,_)),f===!1)w.label(!1);else if(f){var k=f.callback,P=f.fields,B=g.__rest(f,["callback","fields"]);w.label({fields:P||[s],callback:k,cfg:Ot(B)})}return v&&w.state(v),d&&w.customInfo(d),[o,s].filter(function(z){return z!==l}).forEach(function(z){e.legend(z,!1)}),g.__assign(g.__assign({},r),{ext:{geometry:w}})}function Ns(r){var e=r.options,t=e.area,i=e.xField,n=e.yField,a=e.seriesField,o=e.smooth,s=e.tooltip,l=e.useDeferredLabel,u=Fe(s,[i,n,a]),c=u.fields,h=u.formatter;return t?ue(L({},r,{options:{type:"area",colorField:a,tooltipFields:c,mapping:Y({shape:o?"smooth":"area",tooltip:h},t),args:{useDeferredLabel:l}}})):r}function km(r){var e=r.options,t=e.edge,i=e.xField,n=e.yField,a=e.seriesField,o=e.tooltip,s=e.useDeferredLabel,l=Fe(o,[i,n,a]),u=l.fields,c=l.formatter;return t?ue(L({},r,{options:{type:"edge",colorField:a,tooltipFields:u,mapping:g.__assign({tooltip:c},t),args:{useDeferredLabel:s}}})):r}function lk(r){var e=r.chart,t=r.options,i=r.ext,n=t.seriesField,a=t.isGroup,o=t.isStack,s=t.marginRatio,l=t.widthRatio,u=t.groupField,c=t.theme,h=[];if(n&&(a&&h.push({type:"dodge",dodgeBy:u||n,marginRatio:s}),o&&h.push({type:"stack",marginRatio:s})),h.length&&(i!=null&&i.geometry)){var f=i==null?void 0:i.geometry;f.adjust(h)}return D(l)||e.theme(L({},pt(c)?c:Nn(c),{columnWidthRatio:l})),r}function Ht(r){var e=r.options,t=e.xField,i=e.yField,n=e.interval,a=e.seriesField,o=e.tooltip,s=e.minColumnWidth,l=e.maxColumnWidth,u=e.columnBackground,c=e.dodgePadding,h=e.intervalPadding,f=e.useDeferredLabel,v=Fe(o,[t,i,a]),d=v.fields,p=v.formatter,y=(n?ue(L({},r,{options:{type:"interval",colorField:a,tooltipFields:d,mapping:g.__assign({tooltip:p},n),args:{dodgePadding:c,intervalPadding:h,minColumnWidth:s,maxColumnWidth:l,background:u,useDeferredLabel:f}}})):r).ext;return lk(g.__assign(g.__assign({},r),{ext:y}))}function ln(r){var e=r.options,t=e.line,i=e.stepType,n=e.xField,a=e.yField,o=e.seriesField,s=e.smooth,l=e.connectNulls,u=e.tooltip,c=e.useDeferredLabel,h=Fe(u,[n,a,o]),f=h.fields,v=h.formatter;return t?ue(L({},r,{options:{type:"line",colorField:o,tooltipFields:f,mapping:Y({shape:i||(s?"smooth":"line"),tooltip:v},t),args:{connectNulls:l,useDeferredLabel:c}}})):r}function pe(r){var e=r.options,t=e.point,i=e.xField,n=e.yField,a=e.seriesField,o=e.sizeField,s=e.shapeField,l=e.tooltip,u=e.useDeferredLabel,c=Fe(l,[i,n,a,o,s]),h=c.fields,f=c.formatter;return t?ue(L({},r,{options:{type:"point",colorField:a,shapeField:s,tooltipFields:h,mapping:g.__assign({tooltip:f},t),args:{useDeferredLabel:u}}})):r}function zs(r){var e=r.options,t=e.polygon,i=e.xField,n=e.yField,a=e.seriesField,o=e.tooltip,s=e.useDeferredLabel,l=Fe(o,[i,n,a]),u=l.fields,c=l.formatter;return t?ue(L({},r,{options:{type:"polygon",colorField:a,tooltipFields:u,mapping:g.__assign({tooltip:c},t),args:{useDeferredLabel:s}}})):r}function rh(r){var e=r.options,t=e.schema,i=e.xField,n=e.yField,a=e.seriesField,o=e.tooltip,s=e.useDeferredLabel,l=Fe(o,[i,n,a]),u=l.fields,c=l.formatter;return t?ue(L({},r,{options:{type:"schema",colorField:a,tooltipFields:u,mapping:g.__assign({tooltip:c},t),args:{useDeferredLabel:s}}})):r}function uk(r){var e=r.options,t=e.violin,i=e.xField,n=e.yField,a=e.seriesField,o=e.sizeField,s=e.tooltip,l=Fe(s,[i,n,a,o]),u=l.fields,c=l.formatter;return t?ue(L({},r,{options:{type:"violin",colorField:a,tooltipFields:u,mapping:g.__assign({tooltip:c},t)}})):r}var ui={},Qi={},Lm={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=1,t=function(){return"".concat(e++)};r.default=t})(Lm);var Vs={},Gs={},ih={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var e=function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,a=null;return function(){for(var o=this,s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];clearTimeout(a),a=setTimeout(function(){i.apply(o,l)},n)}};r.default=e})(ih);var lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.SensorTabIndex=lr.SensorClassName=lr.SizeSensorId=void 0;var ck="size-sensor-id";lr.SizeSensorId=ck;var hk="size-sensor-object";lr.SensorClassName=hk;var fk="-1";lr.SensorTabIndex=fk;Object.defineProperty(Gs,"__esModule",{value:!0});Gs.createSensor=void 0;var vk=dk(ih),sd=lr;function dk(r){return r&&r.__esModule?r:{default:r}}var gk=function(e){var t=void 0,i=[],n=function(){getComputedStyle(e).position==="static"&&(e.style.position="relative");var c=document.createElement("object");return c.onload=function(){c.contentDocument.defaultView.addEventListener("resize",a),a()},c.style.display="block",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.height="100%",c.style.width="100%",c.style.overflow="hidden",c.style.pointerEvents="none",c.style.zIndex="-1",c.style.opacity="0",c.setAttribute("class",sd.SensorClassName),c.setAttribute("tabindex",sd.SensorTabIndex),c.type="text/html",e.appendChild(c),c.data="about:blank",c},a=(0,vk.default)(function(){i.forEach(function(u){u(e)})}),o=function(c){t||(t=n()),i.indexOf(c)===-1&&i.push(c)},s=function(){t&&t.parentNode&&(t.contentDocument&&t.contentDocument.defaultView.removeEventListener("resize",a),t.parentNode.removeChild(t),t=void 0,i=[])},l=function(c){var h=i.indexOf(c);h!==-1&&i.splice(h,1),i.length===0&&t&&s()};return{element:e,bind:o,destroy:s,unbind:l}};Gs.createSensor=gk;var Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.createSensor=void 0;var pk=yk(ih);function yk(r){return r&&r.__esModule?r:{default:r}}var mk=function(e){var t=void 0,i=[],n=(0,pk.default)(function(){i.forEach(function(u){u(e)})}),a=function(){var c=new ResizeObserver(n);return c.observe(e),n(),c},o=function(c){t||(t=a()),i.indexOf(c)===-1&&i.push(c)},s=function(){t.disconnect(),i=[],t=void 0},l=function(c){var h=i.indexOf(c);h!==-1&&i.splice(h,1),i.length===0&&t&&s()};return{element:e,bind:o,destroy:s,unbind:l}};Ys.createSensor=mk;Object.defineProperty(Vs,"__esModule",{value:!0});Vs.createSensor=void 0;var xk=Gs,wk=Ys,_k=typeof ResizeObserver<"u"?wk.createSensor:xk.createSensor;Vs.createSensor=_k;Object.defineProperty(Qi,"__esModule",{value:!0});Qi.removeSensor=Qi.getSensor=void 0;var bk=Ck(Lm),Sk=Vs,$o=lr;function Ck(r){return r&&r.__esModule?r:{default:r}}var Yn={},Mk=function(e){var t=e.getAttribute($o.SizeSensorId);if(t&&Yn[t])return Yn[t];var i=(0,bk.default)();e.setAttribute($o.SizeSensorId,i);var n=(0,Sk.createSensor)(e);return Yn[i]=n,n};Qi.getSensor=Mk;var Ak=function(e){var t=e.element.getAttribute($o.SizeSensorId);e.element.removeAttribute($o.SizeSensorId),e.destroy(),t&&Yn[t]&&delete Yn[t]};Qi.removeSensor=Ak;Object.defineProperty(ui,"__esModule",{value:!0});ui.ver=ui.clear=Im=ui.bind=void 0;var Cu=Qi,Fk=function(e,t){var i=(0,Cu.getSensor)(e);return i.bind(t),function(){i.unbind(t)}},Im=ui.bind=Fk,Tk=function(e){var t=(0,Cu.getSensor)(e);(0,Cu.removeSensor)(t)};ui.clear=Tk;var Ek="1.0.1";ui.ver=Ek;var ld="data-chart-source-type",Pm=["padding","appendPadding","renderer","pixelRatio","syncViewPadding","supportCSSTransform","limitInPlot"],et=function(r){g.__extends(e,r);function e(t,i){var n=r.call(this)||this;return n.container=typeof t=="string"?document.getElementById(t):t,n.options=L({},n.getDefaultOptions(),i),n.createG2(),n.bindEvents(),n}return e.getDefaultOptions=function(){return{renderer:"canvas",xAxis:{nice:!0,label:{autoRotate:!1,autoHide:{type:"equidistance",cfg:{minGap:6}}}},yAxis:{nice:!0,label:{autoHide:!0,autoRotate:!1}},animation:!0}},e.prototype.createG2=function(){var t=this.options,i=t.width,n=t.height,a=t.defaultInteractions;this.chart=new LM(g.__assign(g.__assign(g.__assign(g.__assign({container:this.container,autoFit:!1},this.getChartSize(i,n)),{localRefresh:!1}),ct(this.options,Pm)),{defaultInteractions:a})),this.container.setAttribute(ld,"G2Plot")},e.prototype.getChartSize=function(t,i){var n=Su(this.container);return{width:t||n.width||400,height:i||n.height||400}},e.prototype.bindEvents=function(){var t=this;this.chart&&this.chart.on("*",function(i){i!=null&&i.type&&t.emit(i.type,i)})},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.render=function(){this.chart.clear(),this.chart.options={data:[],animate:!0},this.chart.views=[],this.execAdaptor(),this.chart.render(),this.bindSizeSensor()},e.prototype.update=function(t){this.updateOption(t),this.render()},e.prototype.updateOption=function(t){this.options=L({},this.options,t)},e.prototype.setState=function(t,i,n){n===void 0&&(n=!0);var a=sa(this.chart);S(a,function(o){i(o.getData())&&o.setState(t,n)})},e.prototype.getStates=function(){var t=sa(this.chart),i=[];return S(t,function(n){var a=n.getData(),o=n.getStates();S(o,function(s){i.push({data:a,state:s,geometry:n.geometry,element:n})})}),i},e.prototype.changeData=function(t){this.update({data:t})},e.prototype.changeSize=function(t,i){this.chart.changeSize(t,i)},e.prototype.addAnnotations=function(t,i){i=i||this.chart;var n=g.__spreadArray([],t,!0),a=i.getController("annotation"),o=a.getComponents().map(function(u){return u.extra});a.clear(!0);for(var s=function(u){var c=o[u],h=n.findIndex(function(f){return f.id&&f.id===c.id});h!==-1&&(c=L({},c,n[h]),n.splice(h,1)),a.annotation(c)},l=0;l<o.length;l++)s(l);n.forEach(function(u){return a.annotation(u)}),i.render(!0)},e.prototype.removeAnnotations=function(t){var i=this.chart.getController("annotation"),n=i.getComponents().map(function(s){return s.extra});i.clear(!0);for(var a=function(s){var l=n[s];t.find(function(u){return u.id&&u.id===l.id})||i.annotation(l)},o=0;o<n.length;o++)a(o);this.chart.render(!0)},e.prototype.destroy=function(){this.unbindSizeSensor(),this.chart.destroy(),this.off(),this.container.removeAttribute(ld)},e.prototype.execAdaptor=function(){var t=this.getSchemaAdaptor(),i=this.options,n=i.padding,a=i.appendPadding;this.chart.padding=n,this.chart.appendPadding=a,t({chart:this.chart,options:this.options})},e.prototype.triggerResize=function(){this.chart.forceFit()},e.prototype.bindSizeSensor=function(){var t=this;if(!this.unbind){var i=this.options.autoFit,n=i===void 0?!0:i;n&&(this.unbind=Im(this.container,function(){var a=Su(t.container),o=a.width,s=a.height;(o!==t.chart.width||s!==t.chart.height)&&t.triggerResize()}))}},e.prototype.unbindSizeSensor=function(){this.unbind&&(this.unbind(),this.unbind=void 0)},e}(Hu);function Dm(r,e,t,i){var n=Zt(r,function(a,o){var s=o[t],l=a.has(s)?a.get(s):0,u=o[e];return l=pi(u)?l+u:l,a.set(s,l),a},new Map);return xt(r,function(a){var o,s=a[e],l=a[t],u=pi(s)&&n.get(l)!==0?s/n.get(l):0;return g.__assign(g.__assign({},a),(o={},o[i]=u,o))})}function kk(r,e,t,i){var n=Zt(r,function(a,o){var s=Zt(t,function(c,h){return"".concat(c).concat(o[h])},""),l=a.has(s)?a.get(s):0,u=o[e];return l=pi(u)?l+u:l,a.set(s,l),a},new Map);return xt(r,function(a){var o,s=a[e],l=Zt(t,function(c,h){return"".concat(c).concat(a[h])},""),u=pi(s)&&n.get(l)!==0?s/n.get(l):0;return g.__assign(g.__assign({},a),(o={},o[i]=u,o))})}function Ta(r,e,t,i,n){return n?Dm(r,e,t,i):r}function Lk(r){var e=r.chart,t=r.options,i=t.data,n=t.color,a=t.lineStyle,o=t.lineShape,s=t.point,l=t.area,u=t.seriesField,c=s==null?void 0:s.state,h=l==null?void 0:l.state;e.data(i);var f=L({},r,{options:{shapeField:u,line:{color:n,style:a,shape:o},point:s&&g.__assign({color:n,shape:"circle"},s),area:l&&g.__assign({color:n},l),label:void 0}}),v=L({},f,{options:{tooltip:!1,state:c}}),d=L({},f,{options:{tooltip:!1,state:h}});return ln(f),pe(v),Ns(d),r}function $s(r){var e,t,i=r.options,n=i.xAxis,a=i.yAxis,o=i.xField,s=i.yField,l=i.data;return j(Mt((e={},e[o]=n,e[s]=a,e),(t={},t[o]={type:"cat"},t[s]=Zc(l,s),t)))(r)}function Ik(r){var e=r.chart,t=r.options,i=t.reflect;if(i){var n=i;O(n)||(n=[n]);var a=n.map(function(o){return["reflect",o]});e.coordinate({type:"rect",actions:a})}return r}function Bm(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 Om(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 Pk(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=$t(e,"line");if(!i)a.label(!1);else{var o=i.callback,s=g.__rest(i,["callback"]);a.label({fields:[n],callback:o,cfg:g.__assign({layout:[{type:"limit-in-plot"},{type:"path-adjust-position"},{type:"point-adjust-position"},{type:"limit-in-plot",cfg:{action:"hide"}}]},Ot(s))})}return r}function Dk(r){var e=r.chart,t=r.options,i=t.isStack;return i&&S(e.geometries,function(n){n.adjust("stack")}),r}function Rm(r){return j(Lk,$s,Dk,ot,Ik,Bm,Om,Pt,Pk,Fa,eh,wt,vt,St(),yi)(r)}function Bk(r){var e=r.chart,t=r.options,i=t.data,n=t.areaStyle,a=t.areaShape,o=t.color,s=t.point,l=t.line,u=t.isPercent,c=t.xField,h=t.yField,f=t.tooltip,v=t.seriesField,d=t.startOnZero,p=s==null?void 0:s.state,y=Ta(i,h,c,h,u);e.data(y);var m=u?g.__assign({formatter:function(b){return{name:b[v]||b[c],value:(Number(b[h])*100).toFixed(2)+"%"}}},f):f,x=L({},r,{options:{area:{color:o,style:n,shape:a},point:s&&g.__assign({color:o},s),tooltip:m,label:void 0,args:{startOnZero:d}}}),_={chart:e,options:L({line:{size:2}},Ko(t,["state"]),{line:l&&g.__assign({color:o},l),sizeField:v,state:l==null?void 0:l.state,tooltip:!1,label:void 0,args:{startOnZero:d}})},w=L({},x,{options:{tooltip:!1,state:p}});return Ns(x),ln(_),pe(w),r}function Ok(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=$t(e,"area");if(!i)a.label(!1);else{var o=i.callback,s=g.__rest(i,["callback"]);a.label({fields:[n],callback:o,cfg:g.__assign({layout:[{type:"limit-in-plot"},{type:"path-adjust-position"},{type:"point-adjust-position"},{type:"limit-in-plot",cfg:{action:"hide"}}]},Ot(s))})}return r}function Rk(r){var e=r.chart,t=r.options,i=t.isStack,n=t.isPercent,a=t.seriesField;return(n||i)&&a&&S(e.geometries,function(o){o.adjust("stack")}),r}function Nm(r){return j(ot,ge("areaStyle"),Tm("rect"),Bk,$s,Rk,Bm,Om,Pt,Ok,Fa,St(),wt,vt,yi)(r)}var Nk=L({},et.getDefaultOptions(),{tooltip:{shared:!0,showMarkers:!0,showCrosshairs:!0,crosshairs:{type:"x"}},isStack:!0,line:{},legend:{position:"top-left",radio:{}}}),zk=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="area",t}return e.getDefaultOptions=function(){return Nk},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this.options,n=i.isPercent,a=i.xField,o=i.yField,s=this,l=s.chart,u=s.options;$s({chart:l,options:u}),this.chart.changeData(Ta(t,o,a,o,n))},e.prototype.getSchemaAdaptor=function(){return Nm},e}(et),Vk=10,Gk=5,Yk={padding:[8,10],text:"reset",textStyle:{default:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"}},buttonStyle:{default:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},active:{fill:"#e6e6e6"}}},$k=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.buttonGroup=null,t.buttonCfg=g.__assign({name:"button"},Yk),t}return e.prototype.getButtonCfg=function(){var t=this.context.view,i=M(t,["interactions","filter-action","cfg","buttonConfig"]);return L(this.buttonCfg,i,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),i=this.context.view.foregroundGroup.addGroup({name:t.name}),n=this.drawText(i);this.drawBackground(i,n.getBBox()),this.buttonGroup=i},e.prototype.drawText=function(t){var i,n=this.getButtonCfg();return t.addShape({type:"text",name:"button-text",attrs:g.__assign({text:n.text},(i=n.textStyle)===null||i===void 0?void 0:i.default)})},e.prototype.drawBackground=function(t,i){var n,a=this.getButtonCfg(),o=Rr(a.padding),s=t.addShape({type:"rect",name:"button-rect",attrs:g.__assign({x:i.x-o[3],y:i.y-o[0],width:i.width+o[1]+o[3],height:i.height+o[0]+o[2]},(n=a.buttonStyle)===null||n===void 0?void 0:n.default)});return s.toBack(),t.on("mouseenter",function(){var l;s.attr((l=a.buttonStyle)===null||l===void 0?void 0:l.active)}),t.on("mouseleave",function(){var l;s.attr((l=a.buttonStyle)===null||l===void 0?void 0:l.default)}),s},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=se.transform(null,[["t",n.x-o.width-Vk,n.y+o.height+Gk]]);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}(yt);q("brush-reset-button",$k,{name:"brush-reset-button"});J("filter-action",{});function tr(r){return r.isInPlot()}function bi(r,e,t){var i=t||{},n=i.mask,a=i.isStartEnable,o=e||"rect";switch(r){case"brush":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair",isEnable:a||function(){return!0}},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:a||tr,action:["brush:start","".concat(o,"-mask:start"),"".concat(o,"-mask:show")],arg:[null,{maskStyle:n==null?void 0:n.style}]}],processing:[{trigger:"mousemove",isEnable:tr,action:["".concat(o,"-mask:resize")]}],end:[{trigger:"mouseup",isEnable:tr,action:["brush:filter","brush:end","".concat(o,"-mask:end"),"".concat(o,"-mask:hide"),"brush-reset-button:show"]}],rollback:[{trigger:"brush-reset-button:click",action:["brush:reset","brush-reset-button:hide","cursor:crosshair"]}]};case"brush-highlight":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair",isEnable:a||function(){return!0}},{trigger:"plot:mousemove",action:"cursor:crosshair",isEnable:a||function(){return!0}},{trigger:"plot:mousemove",action:"cursor:default",isEnable:function(s){return a?!a(s):!1}},{trigger:"mask:mouseenter",action:"cursor:move",isEnable:a||function(){return!0}},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:a||function(s){return!s.isInShape("mask")},action:["".concat(o,"-mask:start"),"".concat(o,"-mask:show")],arg:[{maskStyle:n==null?void 0:n.style}]},{trigger:"mask:dragstart",action:["".concat(o,"-mask:moveStart")]}],processing:[{trigger:"plot:mousemove",action:["".concat(o,"-mask:resize")]},{trigger:"mask:drag",action:["".concat(o,"-mask:move")]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["".concat(o,"-mask:end")]},{trigger:"mask:dragend",action:["".concat(o,"-mask:moveEnd")]},{trigger:"document:mouseup",isEnable:function(s){return!s.isInPlot()},action:["element-range-highlight:clear","".concat(o,"-mask:end"),"".concat(o,"-mask:hide")]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","".concat(o,"-mask:hide")]}]};case"brush-x":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair",isEnable:a||function(){return!0}},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:a||tr,action:["brush-x:start","".concat(o,"-mask:start"),"".concat(o,"-mask:show")],arg:[null,{maskStyle:n==null?void 0:n.style}]}],processing:[{trigger:"mousemove",isEnable:tr,action:["".concat(o,"-mask:resize")]}],end:[{trigger:"mouseup",isEnable:tr,action:["brush-x:filter","brush-x:end","".concat(o,"-mask:end"),"".concat(o,"-mask:hide")]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]};case"brush-x-highlight":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair",isEnable:a||function(){return!0}},{trigger:"mask:mouseenter",action:"cursor:move",isEnable:a||function(){return!0}},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:a||function(s){return!s.isInShape("mask")},action:["".concat(o,"-mask:start"),"".concat(o,"-mask:show")],arg:[{maskStyle:n==null?void 0:n.style}]},{trigger:"mask:dragstart",action:["".concat(o,"-mask:moveStart")]}],processing:[{trigger:"plot:mousemove",action:["".concat(o,"-mask:resize")]},{trigger:"mask:drag",action:["".concat(o,"-mask:move")]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["".concat(o,"-mask:end")]},{trigger:"mask:dragend",action:["".concat(o,"-mask:moveEnd")]},{trigger:"document:mouseup",isEnable:function(s){return!s.isInPlot()},action:["element-range-highlight:clear","".concat(o,"-mask:end"),"".concat(o,"-mask:hide")]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","".concat(o,"-mask:hide")]}]};case"brush-y":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair",isEnable:a||function(){return!0}},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:a||tr,action:["brush-y:start","".concat(o,"-mask:start"),"".concat(o,"-mask:show")],arg:[null,{maskStyle:n==null?void 0:n.style}]}],processing:[{trigger:"mousemove",isEnable:tr,action:["".concat(o,"-mask:resize")]}],end:[{trigger:"mouseup",isEnable:tr,action:["brush-y:filter","brush-y:end","".concat(o,"-mask:end"),"".concat(o,"-mask:hide")]}],rollback:[{trigger:"dblclick",action:["brush-y:reset"]}]};case"brush-y-highlight":return{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair",isEnable:a||function(){return!0}},{trigger:"mask:mouseenter",action:"cursor:move",isEnable:a||function(){return!0}},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:a||function(s){return!s.isInShape("mask")},action:["".concat(o,"-mask:start"),"".concat(o,"-mask:show")],arg:[{maskStyle:n==null?void 0:n.style}]},{trigger:"mask:dragstart",action:["".concat(o,"-mask:moveStart")]}],processing:[{trigger:"plot:mousemove",action:["".concat(o,"-mask:resize")]},{trigger:"mask:drag",action:["".concat(o,"-mask:move")]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["".concat(o,"-mask:end")]},{trigger:"mask:dragend",action:["".concat(o,"-mask:moveEnd")]},{trigger:"document:mouseup",isEnable:function(s){return!s.isInPlot()},action:["element-range-highlight:clear","".concat(o,"-mask:end"),"".concat(o,"-mask:hide")]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","".concat(o,"-mask:hide")]}]};default:return{}}}J("brush",bi("brush"));J("brush-highlight",bi("brush-highlight"));J("brush-x",bi("brush-x","x-rect"));J("brush-y",bi("brush-y","y-rect"));J("brush-x-highlight",bi("brush-x-highlight","x-rect"));J("brush-y-highlight",bi("brush-y-highlight","y-rect"));var ud=["brush","brush-x","brush-y","brush-highlight","brush-x-highlight","brush-y-highlight"];function zm(r){var e=r.options,t=e.brush,i=Xt(e.interactions||[],function(n){return ud.indexOf(n.type)===-1});return t!=null&&t.enabled&&(ud.forEach(function(n){var a=!1;switch(t.type){case"x-rect":a=n===(t.action==="highlight"?"brush-x-highlight":"brush-x");break;case"y-rect":a=n===(t.action==="highlight"?"brush-y-highlight":"brush-y");break;default:a=n===(t.action==="highlight"?"brush-highlight":"brush");break}var o={type:n,enable:a};t&&(o.cfg=bi(n,t.type,t)),i.push(o)}),(t==null?void 0:t.action)!=="highlight"&&i.push({type:"filter-action",cfg:{buttonConfig:t.button}})),L({},r,{options:{interactions:i}})}var ci={hover:"__interval-connected-area-hover__",click:"__interval-connected-area-click__"},nh=function(r,e){return r==="hover"?[{trigger:"interval:mouseenter",action:["element-highlight-by-color:highlight","element-link-by-color:link"],arg:[null,{style:e}]}]:[{trigger:"interval:click",action:["element-highlight-by-color:clear","element-highlight-by-color:highlight","element-link-by-color:clear","element-link-by-color:unlink","element-link-by-color:link"],arg:[null,null,null,null,{style:e}]}]};J(ci.hover,{start:nh(ci.hover),end:[{trigger:"interval:mouseleave",action:["element-highlight-by-color:reset","element-link-by-color:unlink"]}]});J(ci.click,{start:nh(ci.click),end:[{trigger:"document:mousedown",action:["element-highlight-by-color:clear","element-link-by-color:clear"]}]});function Hk(r){return r===void 0&&(r=!1),function(e){var t=e.chart,i=e.options,n=i.connectedArea,a=function(){t.removeInteraction(ci.hover),t.removeInteraction(ci.click)};if(!r&&n){var o=n.trigger||"hover";a(),t.interaction(ci[o],{start:nh(o,n.style)})}else a();return e}}function Vm(r,e){return!tt(r)||!tt(e)||r===0&&e===0?"-":r===e?"100%":r===0?"∞":"".concat((100*e/r).toFixed(2),"%")}function Xk(r,e){return L({size:e?32:80,spacing:e?8:12,offset:e?32:0,arrow:r.arrow!==!1&&{headSize:12,style:{fill:"rgba(0, 0, 0, 0.05)"}},text:r.text!==!1&&{style:{fontSize:12,fill:"rgba(0, 0, 0, 0.85)",textAlign:"center",textBaseline:"middle"},formatter:Vm}},r)}function Ho(r,e){return xt(e.getModel().points,function(t){return r.convertPoint(t)})}function Wk(r,e,t){var i=r.view,n=r.geometry,a=r.group,o=r.options,s=r.horizontal,l=o.offset,u=o.size,c=o.arrow,h=i.getCoordinate(),f=Ho(h,e)[3],v=Ho(h,t)[0],d=v.y-f.y,p=v.x-f.x;if(typeof c!="boolean"){var y=c.headSize,m=o.spacing,x;s?(p-y)/2<m?(m=Math.max(1,(p-y)/2),x=[[f.x+m,f.y-l],[f.x+m,f.y-l-u],[v.x-m,v.y-l-u/2]]):x=[[f.x+m,f.y-l],[f.x+m,f.y-l-u],[v.x-m-y,v.y-l-u],[v.x-m,v.y-l-u/2],[v.x-m-y,v.y-l]]:(d-y)/2<m?(m=Math.max(1,(d-y)/2),x=[[f.x+l,f.y+m],[f.x+l+u,f.y+m],[v.x+l+u/2,v.y-m]]):x=[[f.x+l,f.y+m],[f.x+l+u,f.y+m],[v.x+l+u,v.y-m-y],[v.x+l+u/2,v.y-m],[v.x+l,v.y-m-y]],a.addShape("polygon",{id:"".concat(i.id,"-conversion-tag-arrow-").concat(n.getElementId(e.getModel().mappingData)),name:"conversion-tag-arrow",origin:{element:e,nextElement:t},attrs:g.__assign(g.__assign({},c.style||{}),{points:x})})}}function qk(r,e,t){var i,n,a,o=r.view,s=r.geometry,l=r.group,u=r.options,c=r.field,h=r.horizontal,f=u.offset,v=u.size;if(typeof u.text!="boolean"){var d=o.getCoordinate(),p=((i=u.text)===null||i===void 0?void 0:i.formatter)&&((n=u.text)===null||n===void 0?void 0:n.formatter(e.getData()[c],t.getData()[c])),y=Ho(d,e)[h?3:0],m=Ho(d,t)[h?0:3],x=l.addShape("text",{id:"".concat(o.id,"-conversion-tag-text-").concat(s.getElementId(e.getModel().mappingData)),name:"conversion-tag-text",origin:{element:e,nextElement:t},attrs:g.__assign(g.__assign({},((a=u.text)===null||a===void 0?void 0:a.style)||{}),{text:p,x:h?(y.x+m.x)/2:y.x+f+v/2,y:h?y.y-f-v/2:(y.y+m.y)/2})});if(h){var _=m.x-y.x,w=x.getBBox().width;if(w>_){var b=w/p.length,C=Math.max(1,Math.ceil(_/b)-1),A="".concat(p.slice(0,C),"...");x.attr("text",A)}}}}function Uk(r,e,t){Wk(r,e,t),qk(r,e,t)}function jk(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(L({},pt(s)?s:Nn(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=Le(a.geometries,function(d){return d.type==="interval"}),f={view:u,geometry:h,group:c,field:r,horizontal:e,options:Xk(o,e)},v=h.elements;S(v,function(d,p){p>0&&Uk(f,v[p-1],d)})}})),i}}function Zk(r){var e=r.options,t=e.legend,i=e.seriesField,n=e.isStack;return i?t!==!1&&(t=g.__assign({position:n?"right-top":"top-left"},t)):t=!1,r.options.legend=t,r}function Qk(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,y=s&&l&&u?kk(i,h,[c,v],h):Ta(i,h,c,h,s),m=[];u&&f&&!l?y.forEach(function(w){var b=m.find(function(C){return C[c]===w[c]&&C[f]===w[f]});b?b[h]+=w[h]||0:m.push(g.__assign({},w))}):m=y,e.data(m);var x=s?g.__assign({formatter:function(w){var b;return{name:l&&u?"".concat(w[f]," - ").concat(w[v]):(b=w[f])!==null&&b!==void 0?b:w[c],value:(Number(w[h])*100).toFixed(2)+"%"}}},d):d,_=L({},r,{options:{data:m,widthRatio:o,tooltip:x,interval:{shape:p,style:n,color:a}}});return Ht(_),_}function ah(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(Mt((e={},e[o]=n,e[s]=a,e),(t={},t[o]={type:"cat"},t[s]=g.__assign(g.__assign({},Zc(l,s)),c),t)))(r)}function Kk(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 Jk(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 tL(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=t.isRange,o=$t(e,"interval");if(!i)o.label(!1);else{var s=i.callback,l=g.__rest(i,["callback"]);o.label({fields:[n],callback:s,cfg:g.__assign({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"}}]},Ot(a?g.__assign({content:function(u){var c;return(c=u[n])===null||c===void 0?void 0:c.join("-")}},l):l))})}return r}function eL(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=g.__assign(g.__assign({},h),{customItems:function(d){var p=[];return S(d,function(y){var m=Xt(s,function(x){return Hx(x,ct(y.data,[l,c]))});m.forEach(function(x){p.push(g.__assign(g.__assign(g.__assign({},y),{value:x[u],data:x,mappingData:{_origin:x}}),v(x)))})}),f?f(p):p}})}e.tooltip(h)}return r}function Hs(r,e){e===void 0&&(e=!1);var t=r.options,i=t.seriesField;return j(Zk,ot,ge("columnStyle"),Hr,Tm("rect"),Qk,ah,Kk,Jk,eL,Fa,eh,tL,zm,wt,vt,St(),jk(t.yField,!e,!!i),Hk(!t.isStack),yi)(r)}function rL(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?g.__assign({position:o[(a==null?void 0:a.position)||"left"]},a):!1,l=n!==!1?g.__assign({position:o[(n==null?void 0:n.position)||"bottom"]},n):!1;return g.__assign(g.__assign({},r),{options:g.__assign(g.__assign({},e),{xField:i,yField:t,xAxis:s,yAxis:l})})}function iL(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"}}])),L({},r,{options:{label:t}})}function nL(r){var e=r.options,t=e.seriesField,i=e.isStack,n=e.legend;return t?n!==!1&&(n=g.__assign({position:i?"top-left":"right-top"},n||{})):n=!1,L({},r,{options:{legend:n}})}function aL(r){var e=r.options,t=[{type:"transpose"},{type:"reflectY"}].concat(e.coordinate||[]);return L({},r,{options:{coordinate:t}})}function oL(r){var e=r.chart,t=r.options,i=t.barStyle,n=t.barWidthRatio,a=t.minBarWidth,o=t.maxBarWidth,s=t.barBackground;return Hs({chart:e,options:g.__assign(g.__assign({},t),{columnStyle:i,columnWidthRatio:n,minColumnWidth:a,maxColumnWidth:o,columnBackground:s})},!0)}function Gm(r){return j(rL,iL,nL,Pt,aL,oL)(r)}var sL=L({},et.getDefaultOptions(),{barWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]}),lL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bar",t}return e.getDefaultOptions=function(){return sL},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=g.__assign(g.__assign({},s),{xField:u,yField:c,yAxis:f,xAxis:h});ah({chart:o,options:v}),o.changeData(Ta(t,u,c,u,l))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Gm},e}(et),uL=L({},et.getDefaultOptions(),{columnWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]}),cL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="column",t}return e.getDefaultOptions=function(){return uL},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;ah({chart:l,options:u}),this.chart.changeData(Ta(t,n,a,n,o))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Hs},e}(et),Al,Nr="$$percentage$$",zr="$$mappingValue$$",ur="$$conversion$$",Mu="$$totalPercentage$$",la="$$x$$",ua="$$y$$",hL={appendPadding:[0,80],minSize:0,maxSize:1,meta:(Al={},Al[zr]={min:0,max:1,nice:!1},Al),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)"}}},Ym="CONVERSION_TAG_NAME";function oh(r,e,t){var i=[],n=t.yField,a=t.maxSize,o=t.minSize,s=M(ag(e,n),[n]),l=tt(a)?a:1,u=tt(o)?o:0;return i=xt(r,function(c,h){var f=(c[n]||0)/s;return c[Nr]=f,c[zr]=(l-u)*f+u,c[ur]=[M(r,[h-1,n]),c[n]],c}),i}function sh(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[zr]))){var c=r(l,u,o,{top:!0,name:Ym,text:{content:W(s)?s(l,o):s,offsetX:n.offsetX,offsetY:n.offsetY,position:"end",autoRotate:!1,style:g.__assign({textAlign:"start",textBaseline:"middle"},n.style)}});t.annotation().line(c)}})}return e}}function fL(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=oh(n,n,{yField:a,maxSize:o,minSize:s});return e.data(l),r}function vL(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=Fe(o,[i,n]),v=f.fields,d=f.formatter;ue({chart:e,options:{type:"interval",xField:i,yField:zr,colorField:i,tooltipFields:O(v)&&v.concat([Nr,ur]),mapping:{shape:u,tooltip:d,color:a,style:c},label:s,state:h}});var p=$t(r.chart,"interval");return p.adjust("symmetric"),r}function dL(r){var e=r.chart,t=r.options,i=t.isTransposed;return e.coordinate({type:"rect",actions:i?[]:[["transpose"],["scale",1,-1]]}),r}function $m(r){var e=r.options,t=r.chart,i=e.maxSize,n=M(t,["geometries","0","dataArray"],[]),a=M(t,["options","data","length"]),o=xt(n,function(l){return M(l,["0","nextPoints","0","x"])*a-.5}),s=function(l,u,c,h){var f=i-(i-l[zr])/2;return g.__assign(g.__assign({},h),{start:[o[u-1]||u-.5,f],end:[o[u-1]||u-.5,f+.05]})};return sh(s)(r),r}function Hm(r){return j(fL,vL,dL,$m)(r)}function gL(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 pL(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(y,m){var x=l?m.rowIndex:m.columnIndex;l||y.coordinate({type:"rect",actions:[["transpose"],["scale",x===0?-1:1,-1]]});var _=oh(m.data,i,{yField:a,maxSize:c,minSize:h});y.data(_);var w=Fe(u,[n,a,s]),b=w.fields,C=w.formatter,A=l?{offset:x===0?10:-23,position:x===0?"bottom":"top"}:{offset:10,position:"left",style:{textAlign:x===0?"end":"start"}};ue({chart:y,options:{type:"interval",xField:n,yField:zr,colorField:n,tooltipFields:O(b)&&b.concat([Nr,ur]),mapping:{shape:"funnel",tooltip:C,color:o,style:v},label:f===!1?!1:L({},A,f),state:d}})}}),r}function Xm(r){var e=r.chart,t=r.index,i=r.options,n=i.conversionTag,a=i.isTransposed;(tt(t)?[e]:e.views).forEach(function(o,s){var l=M(o,["geometries","0","dataArray"],[]),u=M(o,["options","data","length"]),c=xt(l,function(f){return M(f,["0","nextPoints","0","x"])*u-.5}),h=function(f,v,d,p){var y=(t||s)===0?-1:1;return L({},p,{start:[c[v-1]||v-.5,f[zr]],end:[c[v-1]||v-.5,f[zr]+.05],text:a?{style:{textAlign:"start"}}:{offsetX:n!==!1?y*n.offsetX:0,style:{textAlign:(t||s)===0?"end":"start"}}})};sh(h)(L({},{chart:o,options:i}))})}function yL(r){var e=r.chart;return e.once("beforepaint",function(){return Xm(r)}),r}function mL(r){return j(gL,pL,yL)(r)}function xL(r){var e=r.chart,t=r.options,i=t.data,n=i===void 0?[]:i,a=t.yField,o=Zt(n,function(u,c){return u+(c[a]||0)},0),s=ag(n,a)[a],l=xt(n,function(u,c){var h=[],f=[];if(u[Mu]=(u[a]||0)/o,c){var v=n[c-1][la],d=n[c-1][ua];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[Mu],h[2]=(f[2]+1)/4,f[3]=f[2],h[3]=-h[2],u[la]=h,u[ua]=f,u[Nr]=(u[a]||0)/s,u[ur]=[M(n,[c-1,a]),u[a]],u});return e.data(l),r}function wL(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=Fe(o,[i,n]),h=c.fields,f=c.formatter;return ue({chart:e,options:{type:"polygon",xField:la,yField:ua,colorField:i,tooltipFields:O(h)&&h.concat([Nr,ur]),label:s,state:u,mapping:{tooltip:f,color:a,style:l}}}),r}function _L(r){var e=r.chart,t=r.options,i=t.isTransposed;return e.coordinate({type:"rect",actions:i?[["transpose"],["reflect","x"]]:[]}),r}function bL(r){var e=function(t,i,n,a){return g.__assign(g.__assign({},a),{start:[t[la][1],t[ua][1]],end:[t[la][1]+.05,t[ua][1]]})};return sh(e)(r),r}function SL(r){return j(xL,wL,_L,bL)(r)}function CL(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 ML(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){Hm(L({},r,{chart:o,options:{data:s.data}}))}}),r}function AL(r){return j(CL,ML)(r)}var FL=function(r){g.__extends(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?Xm:$m,s=this.context.view,l=n||a?s.views:[s];xt(l,function(u,c){var h=u.getController("annotation"),f=Xt(M(h,["option"],[]),function(d){var p=d.name;return p!==Ym});h.clear(!0),S(f,function(d){typeof d=="object"&&u.annotation()[d.type](d)});var v=M(u,["filteredData"],u.getOptions().data);o({chart:u,index:c,options:g.__assign(g.__assign({},t),{filteredData:oh(v,v,t)})}),u.filterData(v),i.rendering=!0,u.render(!0)})}this.rendering=!1},e}(yt),Wm="funnel-conversion-tag",Au="funnel-afterrender",qm={trigger:"afterrender",action:"".concat(Wm,":change")};q(Wm,FL);J(Au,{start:[qm]});function TL(r){var e=r.options,t=e.compareField,i=e.xField,n=e.yField,a=e.locale,o=e.funnelStyle,s=e.data,l=Rs(a),u={label:t?{fields:[i,n,t,Nr,ur],formatter:function(h){return"".concat(h[n])}}:{fields:[i,n,Nr,ur],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(Vm.apply(void 0,h[ur]))}}},c;return(t||o)&&(c=function(h){return L({},t&&{lineWidth:1,stroke:"#fff"},W(o)?o(h):o)}),L({options:u},r,{options:{funnelStyle:c,data:he(s)}})}function EL(r){var e=r.options,t=e.compareField,i=e.dynamicHeight,n=e.seriesField;return n?AL(r):t?mL(r):i?SL(r):Hm(r)}function kL(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return j(Mt((e={},e[a]=i,e[o]=n,e)))(r)}function LL(r){var e=r.chart;return e.axis(!1),r}function IL(r){var e=r.chart,t=r.options,i=t.legend;return i===!1?e.legend(!1):e.legend(i),r}function PL(r){var e=r.chart,t=r.options,i=t.interactions,n=t.dynamicHeight;return S(i,function(a){a.enable===!1?e.removeInteraction(a.type):e.interaction(a.type,a.cfg||{})}),n?e.removeInteraction(Au):e.interaction(Au,{start:[g.__assign(g.__assign({},qm),{arg:t})]}),r}function Um(r){return j(TL,EL,kL,LL,Pt,PL,IL,vt,ot,St())(r)}var DL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="funnel",t}return e.getDefaultOptions=function(){return hL},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Um},e.prototype.setState=function(t,i,n){n===void 0&&(n=!0);var a=sa(this.chart);S(a,function(o){i(o.getData())&&o.setState(t,n)})},e.prototype.getStates=function(){var t=sa(this.chart),i=[];return S(t,function(n){var a=n.getData(),o=n.getStates();S(o,function(s){i.push({data:a,state:s,geometry:n.geometry,element:n})})}),i},e.CONVERSATION_FIELD=ur,e.PERCENT_FIELD=Nr,e.TOTAL_PERCENT_FIELD=Mu,e}(et),so,lh="range",jm="type",ar="percent",BL="#f0f0f0",Zm="indicator-view",Qm="range-view",OL={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:(so={},so[lh]={sync:"v"},so[ar]={sync:"v",tickCount:5,tickInterval:.2},so),animation:!1};function RL(r,e){return r.map(function(t,i){var n;return n={},n[lh]=t-(r[i-1]||0),n[jm]="".concat(i),n[ar]=e,n})}function Km(r){var e;return[(e={},e[ar]=mt(r,0,1),e)]}function Jm(r,e){var t=M(e,["ticks"],[]),i=Bt(t)?hi(t):[0,mt(r,0,1),1];return i[0]||i.shift(),RL(i,r)}function NL(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 y=Km(i),m=e.createView({id:Zm});m.data(y),m.point().position("".concat(ar,"*1")).shape(c.shape||"gauge-indicator").customInfo({defaultColor:e.getTheme().defaultColor,indicator:c}),m.coordinate("polar",{startAngle:s,endAngle:l,radius:o*a}),m.axis(ar,u),m.scale(ar,ct(u,ne))}var x=Jm(i,t.range),_=e.createView({id:Qm});_.data(x);var w=K(d)?[d,BL]:d,b=Ht({chart:_,options:{xField:"1",yField:lh,seriesField:jm,rawFields:[ar],isStack:!0,interval:{color:w,style:h,shape:f==="meter"?"meter-gauge":null},args:{zIndexReversed:!0,sortZIndex:!0},minColumnWidth:p,maxColumnWidth:p}}).ext,C=b.geometry;return C.customInfo({meter:v}),_.coordinate("polar",{innerRadius:o,radius:a,startAngle:s,endAngle:l}).transpose(),r}function zL(r){var e;return j(Mt((e={range:{min:0,max:1,maxLimit:1,minLimit:0}},e[ar]={},e)))(r)}function t0(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=L({},{content:"".concat((a*100).toFixed(2),"%"),style:{opacity:.75,fontSize:"30px",lineHeight:1,textAlign:"center",color:"rgba(44,53,66,0.85)"}},o)),UE(t,{statistic:g.__assign(g.__assign({},n),{content:s})},{percent:a})}return e&&t.render(!0),r}function VL(r){var e=r.chart,t=r.options,i=t.tooltip;return i?e.tooltip(L({showTitle:!1,showMarkers:!1,containerTpl:'<div class="g2-tooltip"><div class="g2-tooltip-list"></div></div>',domStyles:{"g2-tooltip":{padding:"4px 8px",fontSize:"10px"}},customContent:function(n,a){var o=M(a,[0,"data",ar],0);return"".concat((o*100).toFixed(2),"%")}},i)):e.tooltip(!1),r}function GL(r){var e=r.chart;return e.legend(!1),r}function e0(r){return j(ot,vt,NL,zL,VL,t0,wt,St(),GL)(r)}lt("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:g.__assign({x1:u.x,y1:u.y,x2:r.x,y2:r.y,stroke:n},o.style)}),s&&l.addShape("circle",{name:"pin",attrs:g.__assign({x:u.x,y:u.y,stroke:n},s.style)}),l}});lt("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=mt(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(),y=this.coordinate.getRadius(),m=se.getAngle(r,this.coordinate),x=m.startAngle,_=m.endAngle,w=x;w<_;){var b=void 0,C=(w-u)%(v+h);C<v?b=w+(v-C):(w+=v+h-C,b=w+v);var A=se.getSectorPath(p.x,p.y,y,w,Math.min(b,_),y*this.coordinate.innerRadius);d.addShape("path",{name:"meter-gauge",attrs:{path:A,fill:r.color,stroke:r.color,lineWidth:.5}}),w=b+h}return d}});var YL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="gauge",t}return e.getDefaultOptions=function(){return OL},e.prototype.changeData=function(t){this.chart.emit(it.BEFORE_CHANGE_DATA,bt.fromData(this.chart,it.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t});var i=this.chart.views.find(function(a){return a.id===Zm});i&&i.data(Km(t));var n=this.chart.views.find(function(a){return a.id===Qm});n&&n.data(Jm(t,this.options.range)),t0({chart:this.chart,options:this.options},!0),this.chart.emit(it.AFTER_CHANGE_DATA,bt.fromData(this.chart,it.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return e0},e}(et);function cd(r,e,t){if(t===1)return[0,e];var i=Math.floor(r/e);return[e*i,e*(i+1)]}function $L(r){return Math.ceil(Math.log(r.length)/Math.LN2)+1}function r0(r,e,t,i,n){var a=he(r);Xx(a,e);var o=De(a,e),s=Kd(o),l=s.max-s.min,u=t;if(!t&&i&&(u=i>1?l/(i-1):s.max),!t&&!i){var c=$L(o);u=l/c}var h={},f=be(a,n);oe(f)?S(a,function(d){var p=d[e],y=cd(p,u,i),m="".concat(y[0],"-").concat(y[1]);Ir(h,m)||(h[m]={range:y,count:0}),h[m].count+=1}):Object.keys(f).forEach(function(d){S(f[d],function(p){var y=p[e],m=cd(y,u,i),x="".concat(m[0],"-").concat(m[1]),_="".concat(x,"-").concat(d);Ir(h,_)||(h[_]={range:m,count:0},h[_][n]=d),h[_].count+=1})});var v=[];return S(h,function(d){v.push(d)}),v}var Xo="range",ca="count",HL=L({},et.getDefaultOptions(),{columnStyle:{stroke:"#FFFFFF"},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]});function XL(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=r0(i,n,o,a,l);e.data(h);var f=L({},r,{options:{xField:Xo,yField:ca,seriesField:l,isStack:!0,interval:{color:s,style:c}}});return Ht(f),u&&l?e.legend(l,u):e.legend(!1),r}function WL(r){var e,t=r.options,i=t.xAxis,n=t.yAxis;return j(Mt((e={},e[Xo]=i,e[ca]=n,e)))(r)}function qL(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis;return i===!1?e.axis(Xo,!1):e.axis(Xo,i),n===!1?e.axis(ca,!1):e.axis(ca,n),r}function UL(r){var e=r.chart,t=r.options,i=t.label,n=$t(e,"interval");if(!i)n.label(!1);else{var a=i.callback,o=g.__rest(i,["callback"]);n.label({fields:[ca],callback:a,cfg:Ot(o)})}return r}function i0(r){return j(ot,ge("columnStyle"),XL,WL,qL,Hr,UL,Pt,wt,vt)(r)}var jL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="histogram",t}return e.getDefaultOptions=function(){return HL},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(r0(t,n,o,a,s))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return i0},e}(et),ZL=L({},et.getDefaultOptions(),{tooltip:{shared:!0,showMarkers:!0,showCrosshairs:!0,crosshairs:{type:"x"}},legend:{position:"top-left",radio:{}},isStack:!1}),QL=function(r){g.__extends(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"});S(a,function(o){S(o.elements,function(s){var l=og(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"});S(i,function(n){S(n.elements,function(a){a.setState("active",!1)})})},e.prototype.getView=function(){return this.context.view},e}(yt);q("marker-active",QL);J("marker-active",{start:[{trigger:"tooltip:show",action:"marker-active:active"}],end:[{trigger:"tooltip:hide",action:"marker-active:reset"}]});var KL=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="line",t}return e.getDefaultOptions=function(){return ZL},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;$s({chart:n,options:a}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return Rm},e}(et),n0=L({},et.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}}}}}),JL=[1,0,0,0,1,0,0,0,1];function Fu(r,e){var t=e?g.__spreadArray([],e,!0):g.__spreadArray([],JL,!0);return se.transform(t,r)}var tI=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getActiveElements=function(){var t=se.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 Lt(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=se.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(Fu([["t",d,p]])),s.setMatrix(Fu([["t",d,p]]))}})},e.prototype.active=function(){this.transfrom()},e.prototype.reset=function(){this.transfrom(0)},e}(yt);function eI(r){var e=r.event,t,i=e.target;return i&&(t=i.get("element")),t}var rI=function(r){g.__extends(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=M(a,["data","data"]);if(a.type.match("legend-item")){var s=se.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=M(t,"annotations",[]),h=M(t,"statistic",{});n.getController("annotation").clear(!0),S(c,function(v){typeof v=="object"&&n.annotation()[v.type](v)}),Bs(n,{statistic:h,plotType:"pie"},o),n.render(!0)}var f=eI(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();S(n,function(a){t.annotation()[a.type](a)}),t.render(!0)},e}(yt),a0="pie-statistic";q(a0,rI);J("pie-statistic-active",{start:[{trigger:"element:mouseenter",action:"pie-statistic:change"}],end:[{trigger:"element:mouseleave",action:"pie-statistic:reset"}]});q("pie-legend",tI);J("pie-legend-active",{start:[{trigger:"legend-item:mouseenter",action:"pie-legend:active"}],end:[{trigger:"legend-item:mouseleave",action:"pie-legend:reset"}]});function iI(r,e){var t=null;return S(r,function(i){typeof i[e]=="number"&&(t+=i[e])}),t}function nI(r,e){var t;switch(r){case"inner":return t="-30%",K(e)&&e.endsWith("%")?parseFloat(e)*.01>0?t:e:e<0?e:t;case"outer":return t=12,K(e)&&e.endsWith("%")?parseFloat(e)*.01<0?t:e:e>0?e:t;default:return e}}function Wo(r,e){return Gu(Zi(r,e),function(t){return t[e]===0})}function aI(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=Zi(i,n);if(Wo(u,n)){var c="$$percentage$$";u=u.map(function(f){var v;return g.__assign(g.__assign({},f),(v={},v[c]=1/u.length,v))}),e.data(u);var h=L({},r,{options:{xField:"1",yField:c,seriesField:a,isStack:!0,interval:{color:o,shape:l,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});Ht(h)}else{e.data(u);var h=L({},r,{options:{xField:"1",yField:n,seriesField:a,isStack:!0,interval:{color:o,shape:l,style:s},args:{zIndexReversed:!0,sortZIndex:!0}}});Ht(h)}return r}function oI(r){var e,t=r.chart,i=r.options,n=i.meta,a=i.colorField,o=L({},n);return t.scale(o,(e={},e[a]={type:"cat"},e)),r}function sI(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 lI(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=g.__rest(i,["callback"]),u=Ot(l);if(u.content){var c=u.content;u.content=function(d,p,y){var m=d[n],x=d[a],_=e.getScaleByField(a),w=_==null?void 0:_.scale(x);return W(c)?c(g.__assign(g.__assign({},d),{percent:w}),p,y):K(c)?Mm(c,{value:x,name:m,percentage:tt(w)&&!D(x)?"".concat((w*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?O(u.layout)?u.layout:[u.layout]:[];u.layout=(f?[{type:f}]:[]).concat(v),o.label({fields:n?[a,n]:[a],callback:s,cfg:g.__assign(g.__assign({},u),{offset:nI(u.type,u.offset),type:"pie"})})}return r}function o0(r){var e=r.innerRadius,t=r.statistic,i=r.angleField,n=r.colorField,a=r.meta,o=r.locale,s=Rs(o);if(e&&t){var l=L({},n0.statistic,t),u=l.title,c=l.content;return u!==!1&&(u=L({},{formatter:function(h){var f=h?h[n]:D(u.content)?s.get(["statistic","total"]):u.content,v=M(a,[n,"formatter"])||function(d){return d};return v(f)}},u)),c!==!1&&(c=L({},{formatter:function(h,f){var v=h?h[i]:iI(f,i),d=M(a,[i,"formatter"])||function(p){return p};return h||D(c.content)?d(v):c.content}},c)),L({},{statistic:{title:u,content:c}},r)}return r}function s0(r){var e=r.chart,t=r.options,i=o0(t),n=i.innerRadius,a=i.statistic;return e.getController("annotation").clear(!0),j(St())(r),n&&a&&Bs(e,{statistic:a,plotType:"pie"}),r}function uI(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(L({},i,{shared:!1})),Wo(o,a)){var s=M(i,"fields"),l=M(i,"formatter");oe(M(i,"fields"))&&(s=[n,a],l=l||function(u){return{name:u[n],value:ng(u[a])}}),e.geometries[0].tooltip(s.join("*"),ki(s,l))}return r}function cI(r){var e=r.chart,t=r.options,i=o0(t),n=i.interactions,a=i.statistic,o=i.annotations;return S(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(a0,":change"),arg:{statistic:a,annotations:o}}]),S((u=s.cfg)===null||u===void 0?void 0:u.start,function(h){c.push(g.__assign(g.__assign({},h),{arg:{statistic:a,annotations:o}}))}),e.interaction(s.type,L({},s.cfg,{start:c}))}else e.interaction(s.type,s.cfg||{})}),r}function l0(r){return j(ge("pieStyle"),aI,oI,ot,sI,sn,uI,lI,Hr,s0,cI,vt)(r)}var hI=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="pie",t}return e.getDefaultOptions=function(){return n0},e.prototype.changeData=function(t){this.chart.emit(it.BEFORE_CHANGE_DATA,bt.fromData(this.chart,it.BEFORE_CHANGE_DATA,null));var i=this.options,n=this.options.angleField,a=Zi(i.data,n),o=Zi(t,n);Wo(a,n)||Wo(o,n)?this.update({data:t}):(this.updateOption({data:t}),this.chart.data(o),s0({chart:this.chart,options:this.options}),this.chart.render(!0)),this.chart.emit(it.AFTER_CHANGE_DATA,bt.fromData(this.chart,it.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return l0},e}(et),u0=["#FAAD14","#E8EDF3"],fI={percent:.2,color:u0,animation:{}};function uh(r){var e=mt(pi(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(uh(i));var s=L({},r,{options:{xField:"current",yField:"percent",seriesField:"type",widthRatio:o,interval:{style:n,color:K(a)?[a,u0[1]]:a},args:{zIndexReversed:!0,sortZIndex:!0}}});return Ht(s),e.tooltip(!1),e.axis(!1),e.legend(!1),r}function vI(r){var e=r.chart;return e.coordinate("rect").transpose(),r}function h0(r){return j(c0,Mt({}),vI,vt,ot,St())(r)}var dI=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="process",t}return e.getDefaultOptions=function(){return fI},e.prototype.changeData=function(t){this.updateOption({percent:t}),this.chart.changeData(uh(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return h0},e}(et);function gI(r){var e=r.chart,t=r.options,i=t.innerRadius,n=t.radius;return e.coordinate("theta",{innerRadius:i,radius:n}),r}function f0(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=M(s,["percent","formatter"])||function(c){return"".concat((c*100).toFixed(2),"%")},u=a.content;u&&(u=L({},u,{content:D(u.content)?l(o):u.content})),Bs(t,{statistic:g.__assign(g.__assign({},a),{content:u}),plotType:"ring-progress"},{percent:o})}return e&&t.render(!0),r}function v0(r){return j(c0,Mt({}),gI,f0,vt,ot,St())(r)}var pI={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:{}},yI=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="ring-process",t}return e.getDefaultOptions=function(){return pI},e.prototype.changeData=function(t){this.chart.emit(it.BEFORE_CHANGE_DATA,bt.fromData(this.chart,it.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data(uh(t)),f0({chart:this.chart,options:this.options},!0),this.chart.emit(it.AFTER_CHANGE_DATA,bt.fromData(this.chart,it.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return v0},e}(et);function Vr(r,e){return mI(r)||xI(r,e)||wI()}function mI(r){if(Array.isArray(r))return r}function xI(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 wI(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function ch(r,e,t,i){r=r.filter(function(d,p){var y=e(d,p),m=t(d,p);return y!=null&&isFinite(y)&&m!=null&&isFinite(m)}),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;f<n;)h=r[f],a[f]=u=+e(h,f,r),o[f]=c=+t(h,f,r),++f,s+=(u-s)/f,l+=(c-l)/f;for(var v=0;v<n;++v)a[v]-=s,o[v]-=l;return[a,o,s,l]}function Si(r,e,t,i){for(var n=0,a=0,o=r.length;a<o;a++){var s=r[a],l=+e(s,a,r),u=+t(s,a,r);l!=null&&isFinite(l)&&u!=null&&isFinite(u)&&i(l,u,n++)}}function un(r,e,t,i,n){var a=0,o=0;return Si(r,e,t,function(s,l){var u=l-n(s),c=l-i;a+=u*u,o+=c*c}),1-a/o}function hd(r){return Math.atan2(r[1][1]-r[0][1],r[1][0]-r[0][0])*180/Math.PI}function _I(r){return[(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]}function Ea(r,e,t){for(var i=Math.log(e-r)*Math.LOG10E+1|0,n=1*Math.pow(10,-i/2-1),a=1e4,o=[l(r),l(e)],s=0;u(o)&&s<a;);return o;function l(c){return[c,t(c)]}function u(c){s++;for(var h=c.length,f=!1,v=0;v<h-1;v++){var d=c[v],p=c[v+1],y=_I([d,p]),m=l(y[0]),x=hd([d,y]),_=hd([d,m]),w=Math.abs(x-_);w>n&&(c.splice(v+1,0,m),f=!0)}return f}}function ka(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 bI(){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;Si(n,r,e,function(_,w){var b=Math.log(w),C=_*w;++a,o+=(w-o)/a,l+=(C-l)/a,c+=(_*C-c)/a,s+=(w*b-s)/a,u+=(C*b-u)/a,t||(_<h&&(h=_),_>f&&(f=_))});var v=ka(l/o,s/o,u/o,c/o),d=Vr(v,2),p=d[0],y=d[1];p=Math.exp(p);var m=function(w){return p*Math.exp(y*w)},x=Ea(h,f,m);return x.a=p,x.b=y,x.predict=m,x.rSquared=un(n,r,e,o,m),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 d0(){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;Si(n,r,e,function(x,_){++a,o+=(x-o)/a,s+=(_-s)/a,l+=(x*_-l)/a,u+=(x*x-u)/a,t||(x<c&&(c=x),x>h&&(h=x))});var f=ka(o,s,l,u),v=Vr(f,2),d=v[0],p=v[1],y=function(_){return p*_+d},m=[[c,y(c)],[h,y(h)]];return m.a=p,m.b=d,m.predict=y,m.rSquared=un(n,r,e,s,y),m}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 SI(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 fd=2,vd=1e-12;function CI(){var r=function(a){return a[0]},e=function(a){return a[1]},t=.3;function i(n){for(var a=ch(n,r,e,!0),o=Vr(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),y=-1;++y<=fd;){for(var m=[0,f-1],x=0;x<h;++x){for(var _=s[x],w=m[0],b=m[1],C=_-s[w]>s[b]-_?w:b,A=0,F=0,E=0,T=0,k=0,P=1/Math.abs(s[C]-_||1),B=w;B<=b;++B){var z=s[B],X=l[B],I=MI(Math.abs(_-z)*P)*p[B],R=z*I;A+=I,F+=R,E+=X*I,T+=X*R,k+=z*R}var $=ka(F/A,E/A,T/A,k/A),G=Vr($,2),V=G[0],H=G[1];v[x]=V+H*_,d[x]=Math.abs(l[x]-v[x]),AI(s,x+1,m)}if(y===fd)break;var Z=SI(d);if(Math.abs(Z)<vd)break;for(var rt=0,U,Q;rt<h;++rt)U=d[rt]/(6*Z),p[rt]=U>=1?vd:(Q=1-U*U)*Q}return FI(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 MI(r){return(r=1-r*r*r)*r*r}function AI(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 FI(r,e,t,i){for(var n=r.length,a=[],o=0,s=0,l=[],u;o<n;++o)u=r[o]+t,l[0]===u?l[1]+=(e[o]-l[1])/++s:(s=0,l[1]+=i,l=[u,e[o]],a.push(l));return l[1]+=i,a}function TI(){var r=function(o){return o[0]},e=function(o){return o[1]},t=Math.E,i;function n(a){var o=0,s=0,l=0,u=0,c=0,h=i?+i[0]:1/0,f=i?+i[1]:-1/0,v=Math.log(t);Si(a,r,e,function(w,b){var C=Math.log(w)/v;++o,s+=(C-s)/o,l+=(b-l)/o,u+=(C*b-u)/o,c+=(C*C-c)/o,i||(w<h&&(h=w),w>f&&(f=w))});var d=ka(s,l,u,c),p=Vr(d,2),y=p[0],m=p[1],x=function(b){return m*Math.log(b)/v+y},_=Ea(h,f,x);return _.a=m,_.b=y,_.predict=x,_.rSquared=un(a,r,e,l,x),_}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 g0(){var r=function(a){return a[0]},e=function(a){return a[1]},t;function i(n){var a=ch(n,r,e),o=Vr(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,y=0,m,x,_,w;for(m=0;m<h;)x=s[m],_=l[m++],w=x*x,f+=(w-f)/m,v+=(w*x-v)/m,d+=(w*w-d)/m,p+=(x*_-p)/m,y+=(w*_-y)/m;var b=0,C=0,A=t?+t[0]:1/0,F=t?+t[1]:-1/0;Si(n,r,e,function(I,R){C++,b+=(R-b)/C,t||(I<A&&(A=I),I>F&&(F=I))});var E=d-f*f,T=f*E-v*v,k=(y*f-p*v)/T,P=(p*E-y*v)/T,B=-k*f,z=function(R){return R=R-u,k*R*R+P*R+B+c},X=Ea(A,F,z);return X.a=k,X.b=P-2*k*u,X.c=B-P*u+k*u*u+c,X.predict=z,X.rSquared=un(n,r,e,b,z),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 EI(){var r=function(o){return o[0]},e=function(o){return o[1]},t=3,i;function n(a){if(t===1){var o=d0().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=g0().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=ch(a,r,e),u=Vr(l,4),c=u[0],h=u[1],f=u[2],v=u[3],d=c.length,p=[],y=[],m=t+1,x=0,_=0,w=i?+i[0]:1/0,b=i?+i[1]:-1/0;Si(a,r,e,function(z,X){++_,x+=(X-x)/_,i||(z<w&&(w=z),z>b&&(b=z))});var C,A,F,E,T;for(C=0;C<m;++C){for(F=0,E=0;F<d;++F)E+=Math.pow(c[F],C)*h[F];for(p.push(E),T=new Float64Array(m),A=0;A<m;++A){for(F=0,E=0;F<d;++F)E+=Math.pow(c[F],C+A);T[A]=E}y.push(T)}y.push(p);var k=LI(y),P=function(X){X-=f;var I=v+k[0]+k[1]*X+k[2]*X*X;for(C=3;C<m;++C)I+=k[C]*Math.pow(X,C);return I},B=Ea(w,b,P);return B.coefficients=kI(m,k,-f,v),B.predict=P,B.rSquared=un(a,r,e,x,P),B}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.order=function(a){return arguments.length?(t=a,n):t},n}function kI(r,e,t,i){var n=Array(r),a,o,s,l;for(a=0;a<r;++a)n[a]=0;for(a=r-1;a>=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 LI(r){var e=r.length-1,t=[],i,n,a,o,s;for(i=0;i<e;++i){for(o=i,n=i+1;n<e;++n)Math.abs(r[i][n])>Math.abs(r[i][o])&&(o=n);for(a=i;a<e+1;++a)s=r[a][i],r[a][i]=r[a][o],r[a][o]=s;for(n=i+1;n<e;++n)for(a=e;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;a<e;++a)s+=r[a][n]*t[a];t[n]=(r[e][n]-s)/r[n][n]}return t}function II(){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;Si(n,r,e,function(_,w){var b=Math.log(_),C=Math.log(w);++a,o+=(b-o)/a,s+=(C-s)/a,l+=(b*C-l)/a,u+=(b*b-u)/a,c+=(w-c)/a,t||(_<h&&(h=_),_>f&&(f=_))});var v=ka(o,s,l,u),d=Vr(v,2),p=d[0],y=d[1];p=Math.exp(p);var m=function(w){return p*Math.pow(w,y)},x=Ea(h,f,m);return x.a=p,x.b=y,x.predict=m,x.rSquared=un(n,r,e,c,m),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 PI={exp:bI,linear:d0,loess:CI,log:TI,poly:EI,pow:II,quad:g0};function DI(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:-t,offsetY:-t,style:{textAlign:"right",textBaseline:"bottom",fontSize:14,fill:"#ccc"}},{position:["min",e],offsetX:t,offsetY:-t,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:-t,offsetY:t,style:{textAlign:"right",textBaseline:"top",fontSize:14,fill:"#ccc"}}]};return i}var BI=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 qE(l,!1)},OI=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=O(l)?l:l(n),h=u;else{var f=PI[s]().x(function(v){return v[t]}).y(function(v){return v[i]});c=f(n),h=NI(s,c)}return[BI(c,r),h]},RI=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=M(i,[f]);function p(m){return M(d,m)}var y={};return v==="x"?(tt(s)&&(tt(p("min"))||(y.min=u?0:s*2),tt(p("max"))||(y.max=u?s*2:0)),y):(tt(l)&&(tt(p("min"))||(y.min=c?0:l*2),tt(p("max"))||(y.max=c?l*2:0)),y)}return g.__assign(g.__assign({},i),(e={},e[n]=g.__assign(g.__assign({},i[n]),h(n,"x")),e[a]=g.__assign(g.__assign({},i[a]),h(a,"y")),e))};function NI(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<e.coefficients.length;++l)s+=" + ".concat(o(e.coefficients[l]),"x^").concat(l);return"".concat(s,", R^2 = ").concat(o(e.rSquared));case"pow":return"y = ".concat(o(e.a),"x^").concat(o(e.b),", R^2 = ").concat(o(e.rSquared))}return null}function p0(r){var e=r.data,t=e===void 0?[]:e,i=r.xField,n=r.yField;if(t.length){for(var a=!0,o=!0,s=t[0],l=void 0,u=1;u<t.length&&(l=t[u],s[i]!==l[i]&&(a=!1),s[n]!==l[n]&&(o=!1),!(!a&&!o));u++)s=l;var c=[];a&&c.push(i),o&&c.push(n);var h=ct(RI(r),c);return L({},r,{meta:h})}return r}function zI(r){var e=r.chart,t=r.options,i=t.data,n=t.type,a=t.color,o=t.shape,s=t.pointStyle,l=t.shapeField,u=t.colorField,c=t.xField,h=t.yField,f=t.sizeField,v=t.size,d=t.tooltip;f&&(v||(v=[2,8]),tt(v)&&(v=[v,v])),d&&!d.fields&&(d=g.__assign(g.__assign({},d),{fields:[c,h,u,f,l]})),e.data(i),pe(L({},r,{options:{seriesField:u,point:{color:a,shape:o,size:v,style:s},tooltip:d}}));var p=$t(e,"point");return n&&p.adjust(n),r}function mo(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField,s=p0(t);return j(Mt((e={},e[a]=i,e[o]=n,e)))(L({},r,{options:s}))}function VI(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return e.axis(a,i),e.axis(o,n),r}function GI(r){var e=r.chart,t=r.options,i=t.legend,n=t.colorField,a=t.shapeField,o=t.sizeField,s=t.shapeLegend,l=t.sizeLegend,u=i!==!1;return n&&e.legend(n,u?i:!1),a&&(s?e.legend(a,s):e.legend(a,s===!1?!1:i)),o&&e.legend(o,l||!1),!u&&!s&&!l&&e.legend(!1),r}function YI(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=$t(e,"point");if(!i)a.label(!1);else{var o=i.callback,s=g.__rest(i,["callback"]);a.label({fields:[n],callback:o,cfg:Ot(s)})}return r}function $I(r){var e=r.options,t=e.quadrant,i=[];if(t){var n=t.xBaseline,a=n===void 0?0:n,o=t.yBaseline,s=o===void 0?0:o,l=t.labels,u=t.regionStyle,c=t.lineStyle,h=DI(a,s),f=new Array(4).join(",").split(",");f.forEach(function(v,d){i.push(g.__assign(g.__assign({type:"region",top:!1},h.regionStyle[d].position),{style:L({},h.regionStyle[d].style,u==null?void 0:u[d])}),g.__assign({type:"text",top:!0},L({},h.labelStyle[d],l==null?void 0:l[d])))}),i.push({type:"line",top:!1,start:["min",s],end:["max",s],style:L({},h.lineStyle,c)},{type:"line",top:!1,start:[a,"min"],end:[a,"max"],style:L({},h.lineStyle,c)})}return j(St(i))(r)}function HI(r){var e=r.options,t=r.chart,i=e.regressionLine;if(i){var n=i.style,a=i.equationStyle,o=a===void 0?{}:a,s=i.top,l=s===void 0?!1:s,u=i.showEquation,c=u===void 0?!1:u,h={stroke:"#9ba29a",lineWidth:2,opacity:.5},f={x:20,y:20,textAlign:"left",textBaseline:"middle",fontSize:14,fillOpacity:.5};t.annotation().shape({top:l,render:function(v,d){var p=v.addGroup({id:"".concat(t.id,"-regression-line"),name:"regression-line-group"}),y=OI({view:d,options:e}),m=y[0],x=y[1];p.addShape("path",{name:"regression-line",attrs:g.__assign(g.__assign({path:m},h),n)}),c&&p.addShape("text",{name:"regression-equation",attrs:g.__assign(g.__assign(g.__assign({},f),o),{text:x})})}})}return r}function XI(r){var e=r.chart,t=r.options,i=t.tooltip;return i?e.tooltip(i):i===!1&&e.tooltip(!1),r}function y0(r){return j(zI,mo,VI,GI,XI,YI,zm,Fa,eh,wt,$I,vt,ot,HI)(r)}var WI=L({},et.getDefaultOptions(),{size:4,tooltip:{showTitle:!1,showMarkers:!1,showCrosshairs:!0,crosshairs:{type:"xy"}}});J("drag-move",{start:[{trigger:"plot:mousedown",action:"scale-translate:start"}],processing:[{trigger:"plot:mousemove",action:"scale-translate:translate",throttle:{wait:100,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseup",action:"scale-translate:end"}]});var qI=function(r){g.__extends(e,r);function e(t,i){var n=r.call(this,t,i)||this;return n.type="scatter",n.on(it.BEFORE_RENDER,function(a){var o,s,l=n,u=l.options,c=l.chart;if(((o=a.data)===null||o===void 0?void 0:o.source)===te.FILTER){var h=n.chart.filterData(n.chart.getData());mo({chart:c,options:g.__assign(g.__assign({},u),{data:h})})}((s=a.data)===null||s===void 0?void 0:s.source)===te.RESET&&mo({chart:c,options:u})}),n}return e.getDefaultOptions=function(){return WI},e.prototype.changeData=function(t){this.updateOption(p0(L({},this.options,{data:t})));var i=this,n=i.options,a=i.chart;mo({chart:a,options:n}),this.chart.changeData(t)},e.prototype.getSchemaAdaptor=function(){return y0},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(et),ha="$$stock-range$$",Xs="trend",m0="up",x0="down",UI={showMarkers:!1,showCrosshairs:!0,shared:!0,crosshairs:{type:"xy",follow:!0,text:function(r,e,t){var i;if(r==="x"){var n=t[0];i=n?n.title:e}else i=e;return{position:r==="y"?"start":"end",content:i,style:{fill:"#dfdfdf"}}},textBackground:{padding:[2,4],style:{fill:"#666"}}}},jI=L({},et.getDefaultOptions(),{tooltip:UI,interactions:[{type:"tooltip"}],legend:{position:"top-left"},risingFill:"#ef5350",fallingFill:"#26a69a"});function w0(r,e){return xt(r,function(t){var i=t&&g.__assign({},t);if(O(e)&&i){var n=e[0],a=e[1],o=e[2],s=e[3];i[Xs]=i[n]<=i[a]?m0:x0,i[ha]=[i[n],i[a],i[o],i[s]]}return i})}function ZI(r){var e=r.chart,t=r.options,i=t.yField,n=t.data,a=t.risingFill,o=t.fallingFill,s=t.tooltip,l=t.stockStyle;e.data(w0(n,i));var u=s;return u!==!1&&(u=L({},{fields:i},u)),rh(L({},r,{options:{schema:{shape:"candle",color:[a,o],style:l},yField:ha,seriesField:Xs,rawFields:i,tooltip:u}})),r}function QI(r){var e,t,i=r.chart,n=r.options,a=n.meta,o=n.xAxis,s=n.yAxis,l=n.xField,u=(e={},e[l]={type:"timeCat",tickCount:6},e[Xs]={values:[m0,x0]},e),c=L(u,a,(t={},t[l]=ct(o,ne),t[ha]=ct(s,ne),t));return i.scale(c),r}function KI(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField;return i===!1?e.axis(a,!1):e.axis(a,i),n===!1?e.axis(ha,!1):e.axis(ha,n),r}function JI(r){var e=r.chart,t=r.options,i=t.tooltip;return i!==!1?e.tooltip(i):e.tooltip(!1),r}function tP(r){var e=r.chart,t=r.options,i=t.legend;return i?e.legend(Xs,i):i===!1&&e.legend(!1),r}function _0(r){j(ot,ZI,QI,KI,JI,tP,wt,vt,St(),Fa)(r)}var eP=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="stock",t}return e.getDefaultOptions=function(){return jI},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return _0},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this.options.yField;this.chart.changeData(w0(t,i))},e}(et);function Ci(r){return xt(r||[],function(e,t){return{x:"".concat(t),y:e}})}var fa="x",Vi="y",b0={showTitle:!1,shared:!0,showMarkers:!1,customContent:function(r,e){return"".concat(M(e,[0,"data","y"],0))},containerTpl:'<div class="g2-tooltip"><div class="g2-tooltip-list"></div></div>',itemTpl:"<span>{value}</span>",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}},showCrosshairs:!0,crosshairs:{type:"x"}},rP={appendPadding:2,tooltip:g.__assign({},b0),animation:{}};function iP(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=Ci(i);e.data(u);var c=L({},r,{options:{xField:fa,yField:Vi,area:{color:n,style:a},line:s,point:o}}),h=L({},c,{options:{tooltip:!1}}),f=L({},c,{options:{tooltip:!1,state:l}});return Ns(c),ln(h),pe(f),e.axis(!1),e.legend(!1),r}function cn(r){var e,t,i=r.options,n=i.xAxis,a=i.yAxis,o=i.data,s=Ci(o);return j(Mt((e={},e[fa]=n,e[Vi]=a,e),(t={},t[fa]={type:"cat"},t[Vi]=Zc(s,Vi),t)))(r)}function S0(r){return j(ge("areaStyle"),iP,cn,Pt,ot,vt,St())(r)}var nP={appendPadding:2,tooltip:g.__assign({},b0),color:"l(90) 0:#E5EDFE 1:#ffffff",areaStyle:{fillOpacity:.6},line:{size:1,color:"#5B8FF9"},animation:{}},aP=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-area",t}return e.getDefaultOptions=function(){return nP},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;cn({chart:n,options:a}),n.changeData(Ci(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return S0},e}(et);function oP(r){var e=r.chart,t=r.options,i=t.data,n=t.color,a=t.columnStyle,o=t.columnWidthRatio,s=Ci(i);e.data(s);var l=L({},r,{options:{xField:fa,yField:Vi,widthRatio:o,interval:{style:a,color:n}}});return Ht(l),e.axis(!1),e.legend(!1),e.interaction("element-active"),r}function C0(r){return j(ot,ge("columnStyle"),oP,cn,Pt,vt,St())(r)}var sP={showTitle:!1,shared:!0,showMarkers:!1,customContent:function(r,e){return"".concat(M(e,[0,"data","y"],0))},containerTpl:'<div class="g2-tooltip"><div class="g2-tooltip-list"></div></div>',itemTpl:"<span>{value}</span>",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}}},lP={appendPadding:2,tooltip:g.__assign({},sP),animation:{}},uP=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-column",t}return e.getDefaultOptions=function(){return lP},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;cn({chart:n,options:a}),n.changeData(Ci(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return C0},e}(et);function cP(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=Ci(i);e.data(l);var u=L({},r,{options:{xField:fa,yField:Vi,line:{color:n,style:a},point:o}}),c=L({},u,{options:{tooltip:!1,state:s}});return ln(u),pe(c),e.axis(!1),e.legend(!1),r}function M0(r){return j(cP,cn,ot,Pt,vt,St())(r)}var hP=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="tiny-line",t}return e.getDefaultOptions=function(){return rP},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this,n=i.chart,a=i.options;cn({chart:n,options:a}),n.changeData(Ci(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return M0},e}(et),fP={line:Rm,pie:l0,column:Hs,bar:Gm,area:Nm,gauge:e0,"tiny-line":M0,"tiny-column":C0,"tiny-area":S0,"ring-progress":v0,progress:h0,scatter:y0,histogram:i0,funnel:Um,stock:_0},vP={line:KL,pie:hI,column:cL,bar:lL,area:zk,gauge:YL,"tiny-line":hP,"tiny-column":uP,"tiny-area":aP,"ring-progress":yI,progress:dI,scatter:qI,histogram:jL,funnel:DL,stock:eP},dP={pie:{label:!1},column:{tooltip:{showMarkers:!1}},bar:{tooltip:{showMarkers:!1}}};function Tu(r,e,t){var i=vP[r];if(!i){console.error("could not find ".concat(r," plot"));return}var n=fP[r];n({chart:e,options:L({},i.getDefaultOptions(),M(dP,r,{}),t)})}function gP(r){var e=r.chart,t=r.options,i=t.views,n=t.legend;return S(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 y={};u&&S(u,function(m,x){y[x]=ct(m,ne)}),y=L({},l,y),p.scale(y),u?S(u,function(m,x){p.axis(x,m)}):p.axis(!1),p.coordinate(c),S(d,function(m){var x=ue({chart:p,options:m}).ext,_=m.adjust;_&&x.geometry.adjust(_)}),S(h,function(m){m.enable===!1?p.removeInteraction(m.type):p.interaction(m.type,m.cfg)}),S(f,function(m){p.annotation()[m.type](g.__assign({},m))}),typeof a.animation=="boolean"?p.animate(!1):(p.animate(!0),S(p.geometries,function(m){m.animate(a.animation)})),v&&(p.interaction("tooltip"),p.tooltip(v))}),n?S(n,function(a,o){e.legend(o,a)}):e.legend(!1),e.tooltip(t.tooltip),r}function pP(r){var e=r.chart,t=r.options,i=t.plots,n=t.data,a=n===void 0?[]:n;return S(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){Tu(s,e,g.__assign(g.__assign({},c),{data:a}));return}var v=e.createView(g.__assign({region:l},ct(c,Pm)));f&&v.interaction("tooltip"),Tu(s,v,g.__assign({data:a},c))}),r}function yP(r){var e=r.chart,t=r.options;return e.option("slider",t.slider),r}function mP(r){return j(vt,gP,pP,wt,vt,ot,Pt,yP,St())(r)}function xP(r,e){var t=r.getModel(),i=t.data,n;return O(i)?n=i[0][e]:n=i[e],n}function wP(r){var e=Yo(r);S(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 _P=function(r){g.__extends(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;S(t,function(h){var f,v,d=s;if(l==="x"?d=h.getXScale().field:l==="y"?d=(f=h.getYScales().find(function(y){return y.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=xt(Yo(h),function(y){var m=!1,x=!1,_=O(c)?M(c[0],d):M(c,d);return xP(y,d)===_?m=!0:x=!0,{element:y,view:h,active:m,inactive:x}});u.push.apply(u,p)}})}return u},e.prototype.showTooltip=function(t){var i=od(this.context.view),n=this.getAssociationItems(i,t);S(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=od(this.context.view);S(t,function(i){i.hideTooltip()})},e.prototype.active=function(t){var i=Tn(this.context.view),n=this.getAssociationItems(i,t);S(n,function(a){var o=a.active,s=a.element;o&&s.setState("active",!0)})},e.prototype.selected=function(t){var i=Tn(this.context.view),n=this.getAssociationItems(i,t);S(n,function(a){var o=a.active,s=a.element;o&&s.setState("selected",!0)})},e.prototype.highlight=function(t){var i=Tn(this.context.view),n=this.getAssociationItems(i,t);S(n,function(a){var o=a.inactive,s=a.element;o&&s.setState("inactive",!0)})},e.prototype.reset=function(){var t=Tn(this.context.view);S(t,function(i){wP(i)})},e}(yt);q("association",_P);J("association-active",{start:[{trigger:"element:mouseenter",action:"association:active"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});J("association-selected",{start:[{trigger:"element:mouseenter",action:"association:selected"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});J("association-highlight",{start:[{trigger:"element:mouseenter",action:"association:highlight"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]});J("association-tooltip",{start:[{trigger:"element:mousemove",action:"association:showTooltip"}],end:[{trigger:"element:mouseleave",action:"association:hideTooltip"}]});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="mix",t}return e.prototype.getSchemaAdaptor=function(){return mP},e})(et);var dd;(function(r){r.DEV="DEV",r.BETA="BETA",r.STABLE="STABLE"})(dd||(dd={}));var We="first-axes-view",qe="second-axes-view",ei="series-field-key";function A0(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(be(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 or(r){return r!=="vertical"}function bP(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(or(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)),or(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)),!or(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(!or(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 SP(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=A0(n,a,ei,i,or(c));u?e.legend(ei,u):u===!1&&e.legend(!1);var f,v,d=h[0],p=h[1];or(c)?(f=e.createView({region:{start:{x:0,y:0},end:{x:.5,y:1}},id:We}),f.coordinate().transpose().reflect("x"),v=e.createView({region:{start:{x:.5,y:0},end:{x:1,y:1}},id:qe}),v.coordinate().transpose(),f.data(d),v.data(p)):(f=e.createView({region:{start:{x:0,y:0},end:{x:1,y:.5}},id:We}),v=e.createView({region:{start:{x:0,y:.5},end:{x:1,y:1}},id:qe}),v.coordinate().reflect("y"),f.data(d),v.data(p));var y=L({},r,{chart:f,options:{widthRatio:l,xField:n,yField:a[0],seriesField:ei,interval:{color:o,style:s}}});Ht(y);var m=L({},r,{chart:v,options:{xField:n,yField:a[1],seriesField:ei,widthRatio:l,interval:{color:o,style:s}}});return Ht(m),r}function CP(r){var e,t,i,n=r.options,a=r.chart,o=n.xAxis,s=n.yAxis,l=n.xField,u=n.yField,c=nt(a,We),h=nt(a,qe),f={};return pa((n==null?void 0:n.meta)||{}).map(function(v){M(n==null?void 0:n.meta,[v,"alias"])&&(f[v]=n.meta[v].alias)}),a.scale((e={},e[ei]={sync:!0,formatter:function(v){return M(f,v,v)}},e)),Mt((t={},t[l]=o,t[u[0]]=s[u[0]],t))(L({},r,{chart:c})),Mt((i={},i[l]=o,i[u[1]]=s[u[1]],i))(L({},r,{chart:h})),r}function MP(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField,s=t.layout,l=nt(e,We),u=nt(e,qe);return(i==null?void 0:i.position)==="bottom"?u.axis(a,g.__assign(g.__assign({},i),{label:{formatter:function(){return""}}})):u.axis(a,!1),i===!1?l.axis(a,!1):l.axis(a,g.__assign({position:or(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 AP(r){var e=r.chart;return wt(L({},r,{chart:nt(e,We)})),wt(L({},r,{chart:nt(e,qe)})),r}function FP(r){var e=r.chart,t=r.options,i=t.yField,n=t.yAxis;return yi(L({},r,{chart:nt(e,We),options:{yAxis:n[i[0]]}})),yi(L({},r,{chart:nt(e,qe),options:{yAxis:n[i[1]]}})),r}function TP(r){var e=r.chart;return ot(L({},r,{chart:nt(e,We)})),ot(L({},r,{chart:nt(e,qe)})),ot(r),r}function EP(r){var e=r.chart;return vt(L({},r,{chart:nt(e,We)})),vt(L({},r,{chart:nt(e,qe)})),r}function kP(r){var e=this,t,i,n=r.chart,a=r.options,o=a.label,s=a.yField,l=a.layout,u=nt(n,We),c=nt(n,qe),h=$t(u,"interval"),f=$t(c,"interval");if(!o)h.label(!1),f.label(!1);else{var v=o.callback,d=g.__rest(o,["callback"]);d.position||(d.position="middle"),d.offset===void 0&&(d.offset=2);var p=g.__assign({},d);if(or(l)){var y=((t=p.style)===null||t===void 0?void 0:t.textAlign)||(d.position==="middle"?"center":"left");d.style=L({},d.style,{textAlign:y});var m={left:"right",right:"left",center:"center"};p.style=L({},p.style,{textAlign:m[y]})}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 b=[],C=0;C<arguments.length;C++)b[C]=arguments[C];return x[d.position.apply(e,b)]});var _=((i=p.style)===null||i===void 0?void 0:i.textBaseline)||"bottom";p.style=L({},p.style,{textBaseline:_});var w={top:"bottom",bottom:"top",middle:"middle"};d.style=L({},d.style,{textBaseline:w[_]})}h.label({fields:[s[0]],callback:v,cfg:Ot(p)}),f.label({fields:[s[1]],callback:v,cfg:Ot(d)})}return r}function LP(r){return j(SP,CP,MP,FP,TP,kP,Pt,AP,EP)(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bidirectional-bar",t}return e.getDefaultOptions=function(){return L({},r.getDefaultOptions.call(this),{syncViewPadding:bP})},e.prototype.changeData=function(t){t===void 0&&(t=[]),this.chart.emit(it.BEFORE_CHANGE_DATA,bt.fromData(this.chart,it.BEFORE_CHANGE_DATA,null)),this.updateOption({data:t});var i=this.options,n=i.xField,a=i.yField,o=i.layout,s=A0(n,a,ei,t,or(o)),l=s[0],u=s[1],c=nt(this.chart,We),h=nt(this.chart,qe);c.data(l),h.data(u),this.chart.render(!0),this.chart.emit(it.AFTER_CHANGE_DATA,bt.fromData(this.chart,it.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return LP},e.SERIES_FIELD_KEY=ei,e})(et);var Fl,Ki="$$range$$",IP="low-q1-median-q3-high",PP="$$y_outliers$$",F0="outliers_view",DP=L({},et.getDefaultOptions(),{meta:(Fl={},Fl[Ki]={min:0,alias:IP},Fl),interactions:[{type:"active-region"}],tooltip:{showMarkers:!1,shared:!0},boxStyle:{lineWidth:1}}),T0=function(r,e){var t=r;if(Array.isArray(e)){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4];t=xt(r,function(l){return l[Ki]=[l[i],l[n],l[a],l[o],l[s]],l})}return t};function BP(r){var e=r.chart,t=r.options,i=t.xField,n=t.yField,a=t.groupField,o=t.color,s=t.tooltip,l=t.boxStyle;e.data(T0(t.data,n));var u=O(n)?Ki:n,c=n?O(n)?n:[n]:[],h=s;h!==!1&&(h=L({},{fields:O(n)?n:[]},h));var f=rh(L({},r,{options:{xField:i,yField:u,seriesField:a,tooltip:h,rawFields:c,label:!1,schema:{shape:"box",color:o,style:l}}})).ext;return a&&f.geometry.adjust("dodge"),r}function OP(r){var e=r.chart,t=r.options,i=t.xField,n=t.data,a=t.outliersField,o=t.outliersStyle,s=t.padding,l=t.label;if(!a)return r;var u=e.createView({padding:s,id:F0}),c=n.reduce(function(h,f){var v=f[a];return v.forEach(function(d){var p;return h.push(g.__assign(g.__assign({},f),(p={},p[a]=d,p)))}),h},[]);return u.data(c),pe({chart:u,options:{xField:i,yField:a,point:{shape:"circle",style:o},label:l}}),u.axis(!1),r}function RP(r){var e,t,i=r.chart,n=r.options,a=n.meta,o=n.xAxis,s=n.yAxis,l=n.xField,u=n.yField,c=n.outliersField,h=Array.isArray(u)?Ki:u,f={};if(c){var v=PP;f=(e={},e[c]={sync:v,nice:!0},e[h]={sync:v,nice:!0},e)}var d=L(f,a,(t={},t[l]=ct(o,ne),t[h]=ct(s,ne),t));return i.scale(d),r}function NP(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField,s=Array.isArray(o)?Ki:o;return i===!1?e.axis(a,!1):e.axis(a,i),n===!1?e.axis(Ki,!1):e.axis(s,n),r}function zP(r){var e=r.chart,t=r.options,i=t.legend,n=t.groupField;return n?i?e.legend(n,i):e.legend(n,{position:"bottom"}):e.legend(!1),r}function VP(r){return j(BP,OP,RP,NP,zP,Pt,St(),wt,vt,ot)(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="box",t}return e.getDefaultOptions=function(){return DP},e.prototype.changeData=function(t){this.updateOption({data:t});var i=this.options.yField,n=this.chart.views.find(function(a){return a.id===F0});n&&n.data(t),this.chart.changeData(T0(t,i))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return VP},e})(et);function gd(r,e,t){return r.length>1?"".concat(e,"_").concat(t):"".concat(e)}function E0(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(y,m){return y-m}),v.forEach(function(y,m){var x,_=m===0?y:v[m]-v[m-1];s.push((x={rKey:"".concat(n,"_").concat(m)},x[t]=t?h[t]:String(f),x[n]=_,x))});var d=[h[i]].flat();d.forEach(function(y,m){var x;s.push((x={mKey:gd(d,i,m)},x[t]=t?h[t]:String(f),x[i]=y,x))});var p=[h[a]].flat();p.forEach(function(y,m){var x;s.push((x={tKey:gd(p,a,m)},x[t]=t?h[t]:String(f),x[a]=y,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 GP(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=E0(t),v=f.min,d=f.max,p=f.ds;e.data(p);var y=L({},r,{options:{xField:s,yField:a,seriesField:"rKey",isStack:!0,label:M(h,"range"),interval:{color:M(l,"range"),style:M(i,"range"),size:M(c,"range")}}});Ht(y),e.geometries[0].tooltip(!1);var m=L({},r,{options:{xField:s,yField:o,seriesField:"mKey",isStack:!0,label:M(h,"measure"),interval:{color:M(l,"measure"),style:M(i,"measure"),size:M(c,"measure")}}});Ht(m);var x=L({},r,{options:{xField:s,yField:n,seriesField:"tKey",label:M(h,"target"),point:{color:M(l,"target"),style:M(i,"target"),size:W(M(c,"target"))?function(_){return M(c,"target")(_)/2}:M(c,"target")/2,shape:u==="horizontal"?"line":"hyphen"}}});return pe(x),u==="horizontal"&&e.coordinate().transpose(),g.__assign(g.__assign({},r),{ext:{data:{min:v,max:d}}})}function k0(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(Mt((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 YP(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 $P(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 HP(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 M(i,"range")?l.label("".concat(o),g.__assign({layout:[{type:"limit-in-plot"}]},Ot(i.range))):l.label(!1),M(i,"measure")?u.label("".concat(n),g.__assign({layout:[{type:"limit-in-plot"}]},Ot(i.measure))):u.label(!1),M(i,"target")?c.label("".concat(a),g.__assign({layout:[{type:"limit-in-plot"}]},Ot(i.target))):c.label(!1),r}function XP(r){j(GP,k0,YP,$P,ot,HP,Pt,wt,vt)(r)}var WP=L({},et.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){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="bullet",t}return e.getDefaultOptions=function(){return WP},e.prototype.changeData=function(t){this.updateOption({data:t});var i=E0(this.options),n=i.min,a=i.max,o=i.ds;k0({options:this.options,ext:{data:{min:n,max:a}},chart:this.chart}),this.chart.changeData(o)},e.prototype.getSchemaAdaptor=function(){return XP},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(et);var qP={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 UP(r,e,t){S(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 jP(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&&W(e.sortBy)&&(i=e.sortBy),i&&r.sort(i)}function ZP(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 QP(r,e,t){if(t.weight){var i={};S(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,y=p+d/l.value*l.width;i[o]-=d;var m=t.y;n.x=[h,f,p,y],n.y=[m,m,m,m],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 KP(r){return ft({},qP,r)}function JP(r,e){var t=KP(r),i={},n=e.nodes,a=e.links;n.forEach(function(l){var u=t.id(l);i[u]=l}),UP(i,a,t),jP(n,t);var o=ZP(n,t),s=QP(i,a,t);return{nodes:o,links:s}}var L0="x",I0="y",P0="name",D0="source",tD={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!M(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 eD(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=wm(t,i,n,a),h=JP({weight:!0,nodePaddingRatio:o,nodeWidthRatio:s},c),f=h.nodes,v=h.links,d=f.map(function(y){return g.__assign(g.__assign({},ct(y,g.__spreadArray(["id","x","y","name"],u,!0))),{isNode:!0})}),p=v.map(function(y){return g.__assign(g.__assign({source:y.source.name,target:y.target.name,name:y.source.name||y.target.name},ct(y,g.__spreadArray(["x","y","value"],u,!0))),{isNode:!1})});return g.__assign(g.__assign({},r),{ext:g.__assign(g.__assign({},r.ext),{chordData:{nodesData:d,edgesData:p}})})}function rD(r){var e,t=r.chart;return t.scale((e={x:{sync:!0,nice:!0},y:{sync:!0,nice:!0,max:1}},e[P0]={sync:"color"},e[D0]={sync:"color"},e)),r}function iD(r){var e=r.chart;return e.axis(!1),r}function nD(r){var e=r.chart;return e.legend(!1),r}function aD(r){var e=r.chart,t=r.options,i=t.tooltip;return e.tooltip(i),r}function oD(r){var e=r.chart;return e.coordinate("polar").reflect("y"),r}function sD(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:L0,yField:I0,seriesField:P0,polygon:{style:n},label:a,tooltip:o}}),r}function lD(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:L0,yField:I0,seriesField:D0,edge:{style:n,shape:"arc"},tooltip:a};return km({chart:o,options:s}),r}function uD(r){var e=r.chart,t=r.options,i=t.animation;return Aa(e,i,GE(e)),r}function cD(r){return j(ot,eD,oD,rD,iD,nD,aD,lD,sD,wt,Hr,uD)(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="chord",t}return e.getDefaultOptions=function(){return tD},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return cD},e})(et);var hD=["x","y","r","name","value","path","depth"],fD={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}},pd=4,vD=0,yd=5,md="drilldown-bread-crumb",dD={position:"top-left",dividerText:"/",textStyle:{fontSize:12,fill:"rgba(0, 0, 0, 0.65)",cursor:"pointer"},activeTextStyle:{fill:"#87B5FF"}},va="hierarchy-data-transform-params",gD=function(r){g.__extends(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=dD,t}return e.prototype.click=function(){var t=M(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+yd*2)};t.isPolar&&(o={x:0,y:0}),a==="bottom-left"&&(o={x:t.start.x,y:t.start.y});var s=se.transform(null,[["t",o.x+vD,o.y+n.height+yd]]);i.setMatrix(s)}},e.prototype.back=function(){Bt(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=M(i,["interactions","drill-down","cfg","transformData"],function(u){return u}),a=n(g.__assign({data:t.data},t[va]));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(g.__assign({data:l},t[va]))}),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=It(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=M(t,["interactions","drill-down","cfg","drillDownConfig"]);return L(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:md});var a=0;n.forEach(function(o,s){var l=t.breadCrumbGroup.addShape({type:"text",id:o.id,name:"".concat(md,"_").concat(o.name,"_text"),attrs:g.__assign(g.__assign({text:s===0&&!D(i.rootText)?i.rootText:o.name},i.textStyle),{x:a,y:0})}),u=l.getBBox();if(a+=u.width+pd,l.on("click",function(f){var v,d=f.target.get("id");if(d!==((v=It(n))===null||v===void 0?void 0:v.id)){var p=n.slice(0,n.findIndex(function(y){return y.id===d})+1);t.backTo(p)}}),l.on("mouseenter",function(f){var v,d=f.target.get("id");d!==((v=It(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<n.length-1){var c=t.breadCrumbGroup.addShape({type:"text",name:"".concat(i.name,"_").concat(o.name,"_divider"),attrs:g.__assign(g.__assign({text:i.dividerText},i.textStyle),{x:a,y:0})}),h=c.getBBox();a+=h.width+pd}})},e.prototype.hideCrumbGroup=function(){this.breadCrumbGroup&&this.breadCrumbGroup.hide()},e.prototype.destroy=function(){this.breadCrumbGroup&&this.breadCrumbGroup.remove(),r.prototype.destroy.call(this)},e}(yt);function pD(r,e){return r.parent===e.parent?1:2}function yD(r){return r.reduce(mD,0)/r.length}function mD(r,e){return r+e.x}function xD(r){return 1+r.reduce(wD,0)}function wD(r,e){return Math.max(r,e.y)}function _D(r){for(var e;e=r.children;)r=e[0];return r}function bD(r){for(var e;e=r.children;)r=e[e.length-1];return r}function SD(){var r=pD,e=1,t=1,i=!1;function n(a){var o,s=0;a.eachAfter(function(f){var v=f.children;v?(f.x=yD(v),f.y=xD(v)):(f.x=o?s+=r(f,o):0,f.y=0,o=f)});var l=_D(a),u=bD(a),c=l.x-r(l,u)/2,h=u.x+r(u,l)/2;return a.eachAfter(i?function(f){f.x=(f.x-a.x)*e,f.y=(a.y-f.y)*t}:function(f){f.x=(f.x-c)/(h-c)*e,f.y=(1-(a.y?f.y/a.y:1))*t})}return n.separation=function(a){return arguments.length?(r=a,n):r},n.size=function(a){return arguments.length?(i=!1,e=+a[0],t=+a[1],n):i?null:[e,t]},n.nodeSize=function(a){return arguments.length?(i=!0,e=+a[0],t=+a[1],n):i?[e,t]:null},n}function CD(r){var e=0,t=r.children,i=t&&t.length;if(!i)e=1;else for(;--i>=0;)e+=t[i].value;r.value=e}function MD(){return this.eachAfter(CD)}function AD(r,e){let t=-1;for(const i of this)r.call(e,i,++t,this);return this}function FD(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 TD(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<s;++o)i.push(a[o]);for(;t=n.pop();)r.call(e,t,++l,this);return this}function ED(r,e){let t=-1;for(const i of this)if(r.call(e,i,++t,this))return i}function kD(r){return this.eachAfter(function(e){for(var t=+r(e.data)||0,i=e.children,n=i&&i.length;--n>=0;)t+=i[n].value;e.value=t})}function LD(r){return this.eachBefore(function(e){e.children&&e.children.sort(r)})}function ID(r){for(var e=this,t=PD(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 PD(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 DD(){for(var r=this,e=[r];r=r.parent;)e.push(r);return e}function BD(){return Array.from(this)}function OD(){var r=[];return this.eachBefore(function(e){e.children||r.push(e)}),r}function RD(){var r=this,e=[];return r.each(function(t){t!==r&&e.push({source:t.parent,target:t})}),e}function*ND(){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<a;++n)t.push(i[n]);while(t.length)}function hn(r,e){r instanceof Map?(r=[void 0,r],e===void 0&&(e=GD)):e===void 0&&(e=VD);for(var t=new Ji(r),i,n=[t],a,o,s,l;i=n.pop();)if((o=e(i.data))&&(l=(o=Array.from(o)).length))for(i.children=o,s=l-1;s>=0;--s)n.push(a=o[s]=new Ji(o[s])),a.parent=i,a.depth=i.depth+1;return t.eachBefore(B0)}function zD(){return hn(this).eachBefore(YD)}function VD(r){return r.children}function GD(r){return Array.isArray(r)?r[1]:null}function YD(r){r.data.value!==void 0&&(r.value=r.data.value),r.data=r.data.data}function B0(r){var e=0;do r.height=e;while((r=r.parent)&&r.height<++e)}function Ji(r){this.data=r,this.depth=this.height=0,this.parent=null}Ji.prototype=hn.prototype={constructor:Ji,count:MD,each:AD,eachAfter:TD,eachBefore:FD,find:ED,sum:kD,sort:LD,path:ID,ancestors:DD,descendants:BD,leaves:OD,links:RD,copy:zD,[Symbol.iterator]:ND};function $D(r){return typeof r=="object"&&"length"in r?r:Array.from(r)}function HD(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 O0(r){for(var e=0,t=(r=HD(Array.from(r))).length,i=[],n,a;e<t;)n=r[e],a&&R0(a,n)?++e:(a=WD(i=XD(i,n)),e=0);return a}function XD(r,e){var t,i;if(Tl(e,r))return[e];for(t=0;t<r.length;++t)if(lo(e,r[t])&&Tl(En(r[t],e),r))return[r[t],e];for(t=0;t<r.length-1;++t)for(i=t+1;i<r.length;++i)if(lo(En(r[t],r[i]),e)&&lo(En(r[t],e),r[i])&&lo(En(r[i],e),r[t])&&Tl(N0(r[t],r[i],e),r))return[r[t],r[i],e];throw new Error}function lo(r,e){var t=r.r-e.r,i=e.x-r.x,n=e.y-r.y;return t<0||t*t<i*i+n*n}function R0(r,e){var t=r.r-e.r+Math.max(r.r,e.r,1)*1e-9,i=e.x-r.x,n=e.y-r.y;return t>0&&t*t>i*i+n*n}function Tl(r,e){for(var t=0;t<e.length;++t)if(!R0(r,e[t]))return!1;return!0}function WD(r){switch(r.length){case 1:return qD(r[0]);case 2:return En(r[0],r[1]);case 3:return N0(r[0],r[1],r[2])}}function qD(r){return{x:r.x,y:r.y,r:r.r}}function En(r,e){var t=r.x,i=r.y,n=r.r,a=e.x,o=e.y,s=e.r,l=a-t,u=o-i,c=s-n,h=Math.sqrt(l*l+u*u);return{x:(t+a+l/h*c)/2,y:(i+o+u/h*c)/2,r:(h+n+s)/2}}function N0(r,e,t){var i=r.x,n=r.y,a=r.r,o=e.x,s=e.y,l=e.r,u=t.x,c=t.y,h=t.r,f=i-o,v=i-u,d=n-s,p=n-c,y=l-a,m=h-a,x=i*i+n*n-a*a,_=x-o*o-s*s+l*l,w=x-u*u-c*c+h*h,b=v*d-f*p,C=(d*w-p*_)/(b*2)-i,A=(p*y-d*m)/b,F=(v*_-f*w)/(b*2)-n,E=(f*m-v*y)/b,T=A*A+E*E-1,k=2*(a+C*A+F*E),P=C*C+F*F-a*a,B=-(T?(k+Math.sqrt(k*k-4*T*P))/(2*T):P/k);return{x:i+C+A*B,y:n+F+E*B,r:B}}function xd(r,e,t){var i=r.x-e.x,n,a,o=r.y-e.y,s,l,u=i*i+o*o;u?(a=e.r+t.r,a*=a,l=r.r+t.r,l*=l,a>l?(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 wd(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 _d(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 uo(r){this._=r,this.next=null,this.previous=null}function z0(r){if(!(n=(r=$D(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;xd(t,e,i=r[2]),e=new uo(e),t=new uo(t),i=new uo(i),e.next=i.previous=t,t.next=e.previous=i,i.next=t.previous=e;t:for(s=3;s<n;++s){xd(e._,t._,i=r[s]),i=new uo(i),l=t.next,u=e.previous,c=t._.r,h=e._.r;do if(c<=h){if(wd(l._,i._)){t=l,e.next=t,t.previous=e,--s;continue t}c+=l._.r,l=l.next}else{if(wd(u._,i._)){e=u,e.next=t,t.previous=e,--s;continue t}h+=u._.r,u=u.previous}while(l!==u.next);for(i.previous=e,i.next=t,e.next=t.previous=t=i,a=_d(e);(i=i.next)!==t;)(o=_d(i))<a&&(e=i,a=o);t=e.next}for(e=[t._],i=t;(i=i.next)!==t;)e.push(i._);for(i=O0(e),s=0;s<n;++s)e=r[s],e.x-=i.x,e.y-=i.y;return i.r}function UD(r){return z0(r),r}function jD(r){return r==null?null:qo(r)}function qo(r){if(typeof r!="function")throw new Error;return r}function Zr(){return 0}function Li(r){return function(){return r}}function ZD(r){return Math.sqrt(r.value)}function V0(){var r=null,e=1,t=1,i=Zr;function n(a){return a.x=e/2,a.y=t/2,r?a.eachBefore(bd(r)).eachAfter(El(i,.5)).eachBefore(Sd(1)):a.eachBefore(bd(ZD)).eachAfter(El(Zr,1)).eachAfter(El(i,a.r/Math.min(e,t))).eachBefore(Sd(Math.min(e,t)/(2*a.r))),a}return n.radius=function(a){return arguments.length?(r=jD(a),n):r},n.size=function(a){return arguments.length?(e=+a[0],t=+a[1],n):[e,t]},n.padding=function(a){return arguments.length?(i=typeof a=="function"?a:Li(+a),n):i},n}function bd(r){return function(e){e.children||(e.r=Math.max(0,+r(e)||0))}}function El(r,e){return function(t){if(i=t.children){var i,n,a=i.length,o=r(t)*e||0,s;if(o)for(n=0;n<a;++n)i[n].r+=o;if(s=z0(i),o)for(n=0;n<a;++n)i[n].r-=o;t.r=s+o}}}function Sd(r){return function(e){var t=e.parent;e.r*=r,t&&(e.x=t.x+r*e.x,e.y=t.y+r*e.y)}}function G0(r){r.x0=Math.round(r.x0),r.y0=Math.round(r.y0),r.x1=Math.round(r.x1),r.y1=Math.round(r.y1)}function La(r,e,t,i,n){for(var a=r.children,o,s=-1,l=a.length,u=r.value&&(i-e)/r.value;++s<l;)o=a[s],o.y0=t,o.y1=n,o.x0=e,o.x1=e+=o.value*u}function Y0(){var r=1,e=1,t=0,i=!1;function n(o){var s=o.height+1;return o.x0=o.y0=t,o.x1=r,o.y1=e/s,o.eachBefore(a(e,s)),i&&o.eachBefore(G0),o}function a(o,s){return function(l){l.children&&La(l,l.x0,o*(l.depth+1)/s,l.x1,o*(l.depth+2)/s);var u=l.x0,c=l.y0,h=l.x1-t,f=l.y1-t;h<u&&(u=h=(u+h)/2),f<c&&(c=f=(c+f)/2),l.x0=u,l.y0=c,l.x1=h,l.y1=f}}return n.round=function(o){return arguments.length?(i=!!o,n):i},n.size=function(o){return arguments.length?(r=+o[0],e=+o[1],n):[r,e]},n.padding=function(o){return arguments.length?(t=+o,n):t},n}var QD={depth:-1},Cd={};function KD(r){return r.id}function JD(r){return r.parentId}function tB(){var r=KD,e=JD;function t(i){var n=Array.from(i),a=n.length,o,s,l,u,c,h,f,v=new Map;for(s=0;s<a;++s)o=n[s],c=n[s]=new Ji(o),(h=r(o,s,i))!=null&&(h+="")&&(f=c.id=h,v.set(f,v.has(f)?Cd:c)),(h=e(o,s,i))!=null&&(h+="")&&(c.parent=h);for(s=0;s<a;++s)if(c=n[s],h=c.parent){if(u=v.get(h),!u)throw new Error("missing: "+h);if(u===Cd)throw new Error("ambiguous: "+h);u.children?u.children.push(c):u.children=[c],c.parent=u}else{if(l)throw new Error("multiple roots");l=c}if(!l)throw new Error("no root");if(l.parent=QD,l.eachBefore(function(d){d.depth=d.parent.depth+1,--a}).eachBefore(B0),l.parent=null,a>0)throw new Error("cycle");return l}return t.id=function(i){return arguments.length?(r=qo(i),t):r},t.parentId=function(i){return arguments.length?(e=qo(i),t):e},t}function eB(r,e){return r.parent===e.parent?1:2}function kl(r){var e=r.children;return e?e[0]:r.t}function Ll(r){var e=r.children;return e?e[e.length-1]:r.t}function rB(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 iB(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 nB(r,e,t){return r.a.parent===e.parent?r.a:t}function xo(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}xo.prototype=Object.create(Ji.prototype);function aB(r){for(var e=new xo(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 xo(a[o],o)),n.parent=t;return(e.parent=new xo(null,0)).children=[e],e}function oB(){var r=eB,e=1,t=1,i=null;function n(u){var c=aB(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.x<h.x&&(h=x),x.x>f.x&&(f=x),x.depth>v.depth&&(v=x)});var d=h===f?1:r(h,f)/2,p=d-h.x,y=e/(f.x+d+p),m=t/(v.depth||1);u.eachBefore(function(x){x.x=(x.x+p)*y,x.y=x.depth*m})}return u}function a(u){var c=u.children,h=u.parent.children,f=u.i?h[u.i-1]:null;if(c){iB(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],y=f.m,m=v.m,x=d.m,_=p.m,w;d=Ll(d),f=kl(f),d&&f;)p=kl(p),v=Ll(v),v.a=u,w=d.z+x-f.z-y+r(d._,f._),w>0&&(rB(nB(d,u,h),u,w),y+=w,m+=w),x+=d.m,y+=f.m,_+=p.m,m+=v.m;d&&!Ll(v)&&(v.t=d,v.m+=x-m),f&&!kl(p)&&(p.t=f,p.m+=y-_,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 Ws(r,e,t,i,n){for(var a=r.children,o,s=-1,l=a.length,u=r.value&&(n-t)/r.value;++s<l;)o=a[s],o.x0=e,o.x1=i,o.y0=t,o.y1=t+=o.value*u}var $0=(1+Math.sqrt(5))/2;function H0(r,e,t,i,n,a){for(var o=[],s=e.children,l,u,c=0,h=0,f=s.length,v,d,p=e.value,y,m,x,_,w,b,C;c<f;){v=n-t,d=a-i;do y=s[h++].value;while(!y&&h<f);for(m=x=y,b=Math.max(d/v,v/d)/(p*r),C=y*y*b,w=Math.max(x/C,C/m);h<f;++h){if(y+=u=s[h].value,u<m&&(m=u),u>x&&(x=u),C=y*y*b,_=Math.max(x/C,C/m),_>w){y-=u;break}w=_}o.push(l={value:y,dice:v<d,children:s.slice(c,h)}),l.dice?La(l,t,i,n,p?i+=d*y/p:a):Ws(l,t,i,p?t+=v*y/p:n,a),p-=y,c=h}return o}const X0=function r(e){function t(i,n,a,o,s){H0(e,i,n,a,o,s)}return t.ratio=function(i){return r((i=+i)>1?i:1)},t}($0);function W0(){var r=X0,e=!1,t=1,i=1,n=[0],a=Zr,o=Zr,s=Zr,l=Zr,u=Zr;function c(f){return f.x0=f.y0=0,f.x1=t,f.y1=i,f.eachBefore(h),n=[0],e&&f.eachBefore(G0),f}function h(f){var v=n[f.depth],d=f.x0+v,p=f.y0+v,y=f.x1-v,m=f.y1-v;y<d&&(d=y=(d+y)/2),m<p&&(p=m=(p+m)/2),f.x0=d,f.y0=p,f.x1=y,f.y1=m,f.children&&(v=n[f.depth+1]=a(f)/2,d+=u(f)-v,p+=o(f)-v,y-=s(f)-v,m-=l(f)-v,y<d&&(d=y=(d+y)/2),m<p&&(p=m=(p+m)/2),r(f,d,p,y,m))}return c.round=function(f){return arguments.length?(e=!!f,c):e},c.size=function(f){return arguments.length?(t=+f[0],i=+f[1],c):[t,i]},c.tile=function(f){return arguments.length?(r=qo(f),c):r},c.padding=function(f){return arguments.length?c.paddingInner(f).paddingOuter(f):c.paddingInner()},c.paddingInner=function(f){return arguments.length?(a=typeof f=="function"?f:Li(+f),c):a},c.paddingOuter=function(f){return arguments.length?c.paddingTop(f).paddingRight(f).paddingBottom(f).paddingLeft(f):c.paddingTop()},c.paddingTop=function(f){return arguments.length?(o=typeof f=="function"?f:Li(+f),c):o},c.paddingRight=function(f){return arguments.length?(s=typeof f=="function"?f:Li(+f),c):s},c.paddingBottom=function(f){return arguments.length?(l=typeof f=="function"?f:Li(+f),c):l},c.paddingLeft=function(f){return arguments.length?(u=typeof f=="function"?f:Li(+f),c):u},c}function sB(r,e,t,i,n){var a=r.children,o,s=a.length,l,u=new Array(s+1);for(u[0]=l=o=0;o<s;++o)u[o+1]=l+=a[o].value;c(0,s,r.value,e,t,i,n);function c(h,f,v,d,p,y,m){if(h>=f-1){var x=a[h];x.x0=d,x.y0=p,x.x1=y,x.y1=m;return}for(var _=u[h],w=v/2+_,b=h+1,C=f-1;b<C;){var A=b+C>>>1;u[A]<w?b=A+1:C=A}w-u[b-1]<u[b]-w&&h+1<b&&--b;var F=u[b]-_,E=v-F;if(y-d>m-p){var T=v?(d*E+y*F)/v:y;c(h,b,F,d,p,T,m),c(b,f,E,T,p,y,m)}else{var k=v?(p*E+m*F)/v:m;c(h,b,F,d,p,y,k),c(b,f,E,d,k,y,m)}}}function lB(r,e,t,i,n){(r.depth&1?Ws:La)(r,e,t,i,n)}const uB=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;++f<d;){for(u=l[f],c=u.children,h=u.value=0,v=c.length;h<v;++h)u.value+=c[h].value;u.dice?La(u,n,a,o,p?a+=(s-a)*u.value/p:s):Ws(u,n,a,p?n+=(o-n)*u.value/p:o,s),p-=u.value}else i._squarify=l=H0(e,i,n,a,o,s),l.ratio=e}return t.ratio=function(i){return r((i=+i)>1?i:1)},t}($0),Md=Object.freeze(Object.defineProperty({__proto__:null,cluster:SD,hierarchy:hn,pack:V0,packEnclose:O0,packSiblings:UD,partition:Y0,stratify:tB,tree:oB,treemap:W0,treemapBinary:sB,treemapDice:La,treemapResquarify:uB,treemapSlice:Ws,treemapSliceDice:lB,treemapSquarify:X0},Symbol.toStringTag,{value:"Module"}));var q0="nodeIndex",U0="childNodeCount",hh="nodeAncestor",Il="Invalid field: it must be a string!";function fh(r,e){var t=r.field,i=r.fields;if(K(t))return t;if(O(t))return console.warn(Il),t[0];if(console.warn("".concat(Il," will try to get fields instead.")),K(i))return i;if(O(i)&&i.length)return i[0];if(e)return e;throw new TypeError(Il)}function vh(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=Xt((((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&&u<n.depth});n[hh]=s,n[U0]=((o=n.children)===null||o===void 0?void 0:o.length)||0,n[q0]=i,e.push(n)})}else r&&r.eachNode&&r.eachNode(function(n){e.push(n)});return e}var cB={field:"value",as:["x","y","r"],sort:function(r,e){return e.value-r.value}};function hB(r,e){e=ft({},cB,e);var t=e.as;if(!O(t)||t.length!==3)throw new TypeError('Invalid as: it must be an array with 3 strings (e.g. [ "x", "y", "r" ])!');var i;try{i=fh(e)}catch(u){console.warn(u)}var n=function(u){return V0().size(e.size).padding(e.padding)(hn(u).sum(function(c){return c[i]}).sort(e.sort))},a=n(r),o=t[0],s=t[1],l=t[2];return a.each(function(u){u[o]=u.x,u[s]=u.y,u[l]=u.r}),vh(a)}function j0(r){var e=r.data,t=r.hierarchyConfig,i=r.rawFields,n=i===void 0?[]:i,a=r.enableDrillDown,o=hB(e,g.__assign(g.__assign({},t),{field:"value",as:["x","y","r"]})),s=[];return o.forEach(function(l){for(var u,c=l.data.name,h=g.__assign({},l);h.depth>1;)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=L({},l.data,g.__assign(g.__assign(g.__assign({},ct(l.data,n)),{path:c}),l));f.ext=t,f[va]={hierarchyConfig:t,rawFields:n,enableDrillDown:a},s.push(f)}),s}function Z0(r,e,t){var i=Qc([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,y=a+v,m=o+d,x=s+v,_=[p,y,m,x],w=f<0?0:f;return{finalPadding:_,finalSize:w}}function fB(r){var e=r.chart,t=Math.min(e.viewBBox.width,e.viewBBox.height);return L({options:{size:function(i){var n=i.r;return n*t}}},r)}function vB(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=Ds(t.appendPadding,M(o,["breadCrumb","position"]));s=Qc([l,a])}var u=Z0(n,s,i).finalPadding;return t.padding=u,t.appendPadding=0,r}function dB(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=j0({data:t.data,hierarchyConfig:l,enableDrillDown:f==null?void 0:f.enabled,rawFields:h});e.data(v);var d=e.viewBBox,p=Z0(i,n,d).finalSize,y=function(m){var x=m.r;return x*p};return u&&(y=function(m){return m[u]*p}),pe(L({},r,{options:{xField:"x",yField:"y",seriesField:o,sizeField:u,rawFields:g.__spreadArray(g.__spreadArray([],hD,!0),h,!0),point:{color:a,style:s,shape:"circle",size:y}}})),r}function gB(r){return j(Mt({},{x:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0},y:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0}}))(r)}function pB(r){var e=r.chart,t=r.options,i=t.tooltip;if(i===!1)e.tooltip(!1);else{var n=i;M(i,"fields")||(n=L({},{customItems:function(a){return a.map(function(o){var s=M(e.getOptions(),"scales"),l=M(s,["name","formatter"],function(c){return c}),u=M(s,["value","formatter"],function(c){return c});return g.__assign(g.__assign({},o),{name:l(o.data.name),value:u(o.data.value)})})}},n)),e.tooltip(n)}return r}function yB(r){var e=r.chart;return e.axis(!1),r}function mB(r){var e=r.drilldown,t=r.interactions,i=t===void 0?[]:t;return e!=null&&e.enabled?L({},r,{interactions:g.__spreadArray(g.__spreadArray([],i,!0),[{type:"drill-down",cfg:{drillDownConfig:e,transformData:j0,enableDrillDown:!0}}],!1)}):r}function xB(r){var e=r.chart,t=r.options;return wt({chart:e,options:mB(t)}),r}function wB(r){return j(ge("pointStyle"),fB,vB,ot,gB,dB,yB,sn,pB,xB,vt,St())(r)}function Ad(r){var e=M(r,["event","data","data"],{});return O(e.children)&&e.children.length>0}function Fd(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<u}return!1}q("drill-down-action",gD);J("drill-down",{showEnable:[{trigger:"element:mouseenter",action:"cursor:pointer",isEnable:Ad},{trigger:"element:mouseleave",action:"cursor:default"},{trigger:"element:mouseleave",action:"cursor:pointer",isEnable:Fd}],start:[{trigger:"element:click",isEnable:Ad,action:["drill-down-action:click"]},{trigger:"afterchangesize",action:["drill-down-action:resetPosition"]},{trigger:"click",isEnable:Fd,action:["drill-down-action:back"]}]});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="circle-packing",t}return e.getDefaultOptions=function(){return fD},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return wB},e.prototype.triggerResize=function(){this.chart.destroyed||(this.chart.forceFit(),this.chart.clear(),this.execAdaptor(),this.chart.render(!0))},e})(et);var ye="left-axes-view",me="right-axes-view",Q0={nice:!0,label:{autoHide:!0,autoRotate:!1}},_B=g.__assign(g.__assign({},Q0),{position:"left"}),bB=g.__assign(g.__assign({},Q0),{position:"right",grid:null}),tn;(function(r){r.Left="Left",r.Right="Right"})(tn||(tn={}));var mi;(function(r){r.Line="line",r.Column="column"})(mi||(mi={}));function Eu(r){return M(r,"geometry")===mi.Line}function dh(r){return M(r,"geometry")===mi.Column}function Td(r,e,t){return dh(t)?L({},{geometry:mi.Column,label:t.label&&t.isRange?{content:function(i){var n;return(n=i[e])===null||n===void 0?void 0:n.join("-")}}:void 0},t):g.__assign({geometry:mi.Line},t)}function Ed(r,e){var t=r[0],i=r[1];if(O(e)){var n=e[0],a=e[1];return[n,a]}var o=M(e,t),s=M(e,i);return[o,s]}function kd(r,e){return e===tn.Left?r===!1?!1:L({},_B,r):e===tn.Right?r===!1?!1:L({},bB,r):r}function SB(r){var e=r.options,t=r.chart,i=e.geometryOption,n=i.isStack,a=i.color,o=i.seriesField,s=i.groupField,l=i.isGroup,u=["xField","yField"];if(Eu(i)){ln(L({},r,{options:g.__assign(g.__assign(g.__assign({},ct(e,u)),i),{line:{color:i.color,style:i.lineStyle}})})),pe(L({},r,{options:g.__assign(g.__assign(g.__assign({},ct(e,u)),i),{point:i.point&&g.__assign({color:a,shape:"circle"},i.point)})}));var c=[];l&&c.push({type:"dodge",dodgeBy:s||o,customOffset:0}),n&&c.push({type:"stack"}),c.length&&S(t.geometries,function(h){h.adjust(c)})}return dh(i)&&Hs(L({},r,{options:g.__assign(g.__assign(g.__assign({},ct(e,u)),i),{widthRatio:i.columnWidthRatio,interval:g.__assign(g.__assign({},ct(i,["color"])),{style:i.columnStyle})})})),r}function Ld(r){var e=r.view,t=r.geometryOption,i=r.yField,n=r.legend,a=M(n,"marker"),o=$t(e,Eu(t)?"line":"interval");if(!t.seriesField){var s=M(e,"options.scales.".concat(i,".alias"))||i,l=o.getAttribute("color"),u=e.getTheme().defaultColor;l&&(u=se.getMappingValue(l,s,M(l,["values",0],u)));var c=(W(a)?a:!oe(a)&&L({},{style:{stroke:u,fill:u}},a))||(Eu(t)?{symbol:function(f,v,d){return[["M",f-d,v],["L",f+d,v]]},style:{lineWidth:2,r:6,stroke:u}}:{symbol:"square",style:{fill:u}});return[{value:i,name:s,marker:c,isGeometry:!0,viewId:e.id}]}var h=o.getGroupAttributes();return Zt(h,function(f,v){var d=se.getLegendItems(e,o,v,e.getTheme(),a);return f.concat(d)},[])}var Id=function(r,e){var t=e[0],i=e[1],n=r.getOptions().data,a=r.getXScale(),o=Bt(n);if(!(!a||!o)){var s=De(n,a.field),l=s,u=Bt(l),c=Math.floor(t*(u-1)),h=Math.floor(i*(u-1));r.filter(a.field,function(f){var v=l.indexOf(f);return v>-1?$E(v,c,h):!0}),r.getRootView().render(!0)}};function CB(r){var e,t=r.options,i=t.geometryOptions,n=i===void 0?[]:i,a=t.xField,o=t.yField,s=Gu(n,function(l){var u=l.geometry;return u===mi.Line||u===void 0});return L({},{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:Ed(o,t.yAxis),geometryOptions:[Td(a,o[0],n[0]),Td(a,o[1],n[1])],annotations:Ed(o,t.annotations)}})}function MB(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:ye},{type:(t=a[1])===null||t===void 0?void 0:t.geometry,id:me}];return s.sort(function(l,u){return-o[l.type]+o[u.type]}).forEach(function(l){return i.createView({id:l.id})}),r}function AB(r){var e=r.chart,t=r.options,i=t.xField,n=t.yField,a=t.geometryOptions,o=t.data,s=t.tooltip,l=[g.__assign(g.__assign({},a[0]),{id:ye,data:o[0],yField:n[0]}),g.__assign(g.__assign({},a[1]),{id:me,data:o[1],yField:n[1]})];return l.forEach(function(u){var c=u.id,h=u.data,f=u.yField,v=dh(u)&&u.isPercent,d=v?Dm(h,f,i,f):h,p=nt(e,c).data(d),y=v?g.__assign({formatter:function(m){return{name:m[u.seriesField]||f,value:(Number(m[f])*100).toFixed(2)+"%"}}},s):s;SB({chart:p,options:{xField:i,yField:f,tooltip:y,geometryOption:u}})}),r}function FB(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(){S(n,function(s,l){var u=nt(t,l===0?ye:me);if(!s.color){var c=u.getGroupScales(),h=M(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 TB(r){var e,t,i=r.chart,n=r.options,a=n.xAxis,o=n.yAxis,s=n.xField,l=n.yField;return Mt((e={},e[s]=a,e[l[0]]=o[0],e))(L({},r,{chart:nt(i,ye)})),Mt((t={},t[s]=a,t[l[1]]=o[1],t))(L({},r,{chart:nt(i,me)})),r}function EB(r){var e=r.chart,t=r.options,i=nt(e,ye),n=nt(e,me),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],kd(l[0],tn.Left)),n.axis(a,!1),n.axis(o[1],kd(l[1],tn.Right)),r}function kB(r){var e=r.chart,t=r.options,i=t.tooltip,n=nt(e,ye),a=nt(e,me);return e.tooltip(i),n.tooltip({shared:!0}),a.tooltip({shared:!0}),r}function LB(r){var e=r.chart;return wt(L({},r,{chart:nt(e,ye)})),wt(L({},r,{chart:nt(e,me)})),r}function IB(r){var e=r.chart,t=r.options,i=t.annotations,n=M(i,[0]),a=M(i,[1]);return St(n)(L({},r,{chart:nt(e,ye),options:{annotations:n}})),St(a)(L({},r,{chart:nt(e,me),options:{annotations:a}})),r}function PB(r){var e=r.chart;return ot(L({},r,{chart:nt(e,ye)})),ot(L({},r,{chart:nt(e,me)})),ot(r),r}function DB(r){var e=r.chart;return vt(L({},r,{chart:nt(e,ye)})),vt(L({},r,{chart:nt(e,me)})),r}function BB(r){var e=r.chart,t=r.options,i=t.yAxis;return yi(L({},r,{chart:nt(e,ye),options:{yAxis:i[0]}})),yi(L({},r,{chart:nt(e,me),options:{yAxis:i[1]}})),r}function OB(r){var e=r.chart,t=r.options,i=t.legend,n=t.geometryOptions,a=t.yField,o=t.data,s=nt(e,ye),l=nt(e,me);if(i===!1)e.legend(!1);else if(pt(i)&&i.custom===!0)e.legend(i);else{var u=M(n,[0,"legend"],i),c=M(n,[1,"legend"],i);e.once("beforepaint",function(){var h=o[0].length?Ld({view:s,geometryOption:n[0],yField:a[0],legend:u}):[],f=o[1].length?Ld({view:l,geometryOption:n[1],yField:a[1],legend:c}):[];e.legend(L({},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=M(h,"gEvent.delegateObject",{});if(f&&f.item){var v=f.item,d=v.value,p=v.isGeometry,y=v.viewId;if(p){var m=og(a,function(w){return w===d});if(m>-1){var x=M(nt(e,y),"geometries");S(x,function(w){w.changeVisible(!f.item.unchecked)})}}else{var _=M(e.getController("legend"),"option.items",[]);S(e.views,function(w){var b=w.getGroupScales();S(b,function(C){C.values&&C.values.indexOf(d)>-1&&w.filter(C.field,function(A){var F=Le(_,function(E){return E.value===A});return!F.unchecked})}),e.render(!0)})}}})}return r}function RB(r){var e=r.chart,t=r.options,i=t.slider,n=nt(e,ye),a=nt(e,me);return i&&(n.option("slider",i),n.on("slider:valuechanged",function(o){var s=o.event,l=s.value,u=s.originValue;Lt(l,u)||Id(a,l)}),e.once("afterpaint",function(){if(!$i(i)){var o=i.start,s=i.end;(o||s)&&Id(a,[o,s])}})),r}function NB(r){return j(CB,MB,PB,AB,TB,EB,BB,kB,LB,IB,DB,FB,OB,RB)(r)}(function(r){g.__extends(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 L({},r.prototype.getDefaultOptions.call(this),{yAxis:[],syncViewPadding:!0})},e.prototype.getSchemaAdaptor=function(){return NB},e})(et);function zB(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&&S(l,function(f,v){h[v]=ct(f,ne)}),h=L({},u,h),r.scale(h),i&&r.coordinate(i),l===!1?r.axis(!1):S(l,function(f,v){r.axis(v,f)}),S(c,function(f){var v=ue({chart:r,options:f}).ext,d=f.adjust;d&&v.geometry.adjust(d)}),S(n,function(f){f.enable===!1?r.removeInteraction(f.type):r.interaction(f.type,f.cfg)}),S(a,function(f){r.annotation()[f.type](g.__assign({},f))}),Aa(r,o),s?(r.interaction("tooltip"),r.tooltip(s)):s===!1&&r.removeInteraction("tooltip")}function VB(r){var e=r.chart,t=r.options,i=t.type,n=t.data,a=t.fields,o=t.eachView,s=Ko(t,["type","data","fields","eachView","axes","meta","tooltip","coordinate","theme","legend","interactions","annotations"]);return e.data(n),e.facet(i,g.__assign(g.__assign({},s),{fields:a,eachView:function(l,u){var c=o(l,u);if(c.geometries)zB(l,c);else{var h=c,f=h.options;f.tooltip&&l.interaction("tooltip"),Tu(h.type,l,f)}}})),r}function GB(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&&S(i,function(f,v){h[v]=ct(f,ne)}),h=L({},n,h),e.scale(h),e.coordinate(o),i?S(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),S(u,function(f){f.enable===!1?e.removeInteraction(f.type):e.interaction(f.type,f.cfg)}),S(c,function(f){e.annotation()[f.type](g.__assign({},f))}),r}function YB(r){return j(ot,VB,GB)(r)}var $B={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){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="area",t}return e.getDefaultOptions=function(){return $B},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return YB},e})(et);function HB(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 y=Fe(f,[a,o,s]),m=y.fields,x=y.formatter,_=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]"):_=u),ue(L({},r,{options:{type:p,colorField:s,tooltipFields:m,shapeField:l||"",label:void 0,mapping:{tooltip:x,shape:c&&(l?function(w){var b=i.map(function(E){return E[l]}),C=(d==null?void 0:d[l])||{},A=C.min,F=C.max;return A=tt(A)?A:Math.min.apply(Math,b),F=tt(F)?F:Math.max.apply(Math,b),[c,(M(w,l)-A)/(F-A),_]}:function(){return[c,1,_]}),color:h||s&&e.getTheme().sequenceColors.join("-"),style:v}}})),r}function XB(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return j(Mt((e={},e[a]=i,e[o]=n,e)))(r)}function WB(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 qB(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 UB(r){var e=r.chart,t=r.options,i=t.label,n=t.colorField,a=t.type,o=$t(e,a==="density"?"heatmap":"polygon");if(!i)o.label(!1);else if(n){var s=i.callback,l=g.__rest(i,["callback"]);o.label({fields:[n],callback:s,cfg:Ot(l)})}return r}function jB(r){var e,t,i=r.chart,n=r.options,a=n.coordinate,o=n.reflect,s=L({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 ZB(r){return j(ot,ge("heatmapStyle"),XB,jB,HB,WB,qB,Pt,UB,St(),wt,vt,Hr)(r)}var QB=L({},et.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"}}}}});lt("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:g.__assign(g.__assign(g.__assign({x:n,y:a,r:v},r.defaultStyle),r.style),{fill:d})});return p}});lt("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:g.__assign(g.__assign(g.__assign({x:n-v/2,y:a-v/2,width:v,height:v},r.defaultStyle),r.style),{fill:d})});return p}});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="heatmap",t}return e.getDefaultOptions=function(){return QB},e.prototype.getSchemaAdaptor=function(){return ZB},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(et);var KB="liquid";function K0(r){return[{percent:r,type:KB}]}function JB(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(K0(i));var h=t.color||e.getTheme().defaultColor,f=L({},r,{options:{xField:"type",yField:"percent",widthRatio:a,interval:{color:h,style:n,shape:"liquid-fill-gauge"}}}),v=Ht(f).ext,d=v.geometry,p=e.getTheme().background,y={percent:i,radius:a,outline:o,wave:s,shape:l,shapeStyle:u,background:p,animation:c};return d.customInfo(y),e.legend(!1),e.axis(!1),e.tooltip(!1),r}function J0(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=M(o,["percent","formatter"])||function(u){return"".concat((u*100).toFixed(2),"%")},l=n.content;return l&&(l=L({},l,{content:D(l.content)?s(a):l.content})),Bs(t,{statistic:g.__assign(g.__assign({},n),{content:l}),plotType:"liquid"},{percent:a}),e&&t.render(!0),r}function tO(r){return j(ot,ge("liquidStyle"),JB,J0,Mt({}),vt,wt)(r)}var eO={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"},Pd=5e3;function Dd(r,e,t){return r+(e-r)*t}function rO(r){var e=g.__assign({opacity:1},r.style);return r.color&&!e.fill&&(e.fill=r.color),e}function iO(r){var e={fill:"#fff",fillOpacity:0,lineWidth:4},t=ft({},e,r.style);return r.color&&!t.stroke&&(t.stroke=r.color),tt(r.opacity)&&(t.opacity=t.strokeOpacity=r.opacity),t}function nO(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 aO(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;f<s;++f){var v=f%4,d=nO(f*t/4,v,t,n);l.push(["C",d[0][0]+c,-d[0][1]+e,d[1][0]+c,-d[1][1]+e,d[2][0]+c,-d[2][1]+e]),f===s-1&&(h=d[2][0])}return l.push(["L",h+c,o+r]),l.push(["L",c,o+r]),l.push(["Z"]),l}function oO(r,e,t,i,n,a,o,s,l,u){for(var c=n.fill,h=n.opacity,f=o.getBBox(),v=f.maxX-f.minX,d=f.maxY-f.minY,p=0;p<i;p++){var y=i<=1?1:p/(i-1),m=a.addShape("path",{name:"waterwave-path",attrs:{path:aO(s,f.minY+d*t,l,0,v/32,r,e),fill:c,opacity:Dd(.2,.9,y)*h}});try{if(u===!1)return;var x=Fu([["t",l,0]]);m.stopAnimate(),m.animate({matrix:x},{duration:Dd(.5*Pd,Pd,y),repeat:!0})}catch{console.warn("off-screen group animate error!")}}}function sO(r,e,t,i){var n=t*2/3,a=Math.max(n,i),o=n/2,s=r,l=o+e-a/2,u=Math.asin(o/((a-o)*.85)),c=Math.sin(u)*o,h=Math.cos(u)*o,f=s-h,v=l+c,d=r,p=l+o/Math.sin(u);return`
  51. M `.concat(f," ").concat(v,`
  52. A `).concat(o," ").concat(o," 0 1 1 ").concat(f+h*2," ").concat(v,`
  53. Q `).concat(d," ").concat(p," ").concat(r," ").concat(e+a/2,`
  54. Q `).concat(d," ").concat(p," ").concat(f," ").concat(v,`
  55. Z
  56. `)}function lO(r,e,t,i){var n=t/2,a=i/2;return`
  57. M `.concat(r," ").concat(e-a,`
  58. a `).concat(n," ").concat(a," 0 1 0 0 ").concat(a*2,`
  59. a `).concat(n," ").concat(a," 0 1 0 0 ").concat(-a*2,`
  60. Z
  61. `)}function uO(r,e,t,i){var n=i/2,a=t/2;return`
  62. M `.concat(r," ").concat(e-n,`
  63. L `).concat(r+a," ").concat(e,`
  64. L `).concat(r," ").concat(e+n,`
  65. L `).concat(r-a," ").concat(e,`
  66. Z
  67. `)}function cO(r,e,t,i){var n=i/2,a=t/2;return`
  68. M `.concat(r," ").concat(e-n,`
  69. L `).concat(r+a," ").concat(e+n,`
  70. L `).concat(r-a," ").concat(e+n,`
  71. Z
  72. `)}function hO(r,e,t,i){var n=.618,a=i/2,o=t/2*n;return`
  73. M `.concat(r-o," ").concat(e-a,`
  74. L `).concat(r+o," ").concat(e-a,`
  75. L `).concat(r+o," ").concat(e+a,`
  76. L `).concat(r-o," ").concat(e+a,`
  77. Z
  78. `)}var Bd={pin:sO,circle:lO,diamond:uO,triangle:cO,rect:hO};lt("interval","liquid-fill-gauge",{draw:function(r,e){var t=.5,i=.5,n=r.customInfo,a=n,o=a.percent,s=a.radius,l=a.shape,u=a.shapeStyle,c=a.background,h=a.animation,f=n.outline,v=n.wave,d=f.border,p=f.distance,y=v.count,m=v.length,x=Zt(r.points,function(z,X){return Math.min(z,X.x)},1/0),_=this.parsePoint({x:t,y:i}),w=this.parsePoint({x,y:i}),b=_.x-w.x,C=Math.min(b,w.y*s),A=rO(r),F=iO(ft({},r,f)),E=C-d/2,T=typeof l=="function"?l:Bd[l]||Bd.circle,k=T(_.x,_.y,E*2,E*2);if(u&&e.addShape("path",{name:"shape",attrs:g.__assign({path:k},u)}),o>0){var P=e.addGroup({name:"waves"}),B=P.setClip({type:"path",attrs:{path:k}});oO(_.x,_.y,1-r.points[1].y,y,A,P,B,C*2,m,h)}return e.addShape("path",{name:"distance",attrs:{path:k,fill:"transparent",lineWidth:d+p*2,stroke:c==="transparent"?"#fff":c}}),e.addShape("path",{name:"wrap",attrs:ft(F,{path:k,fill:"transparent",lineWidth:d})}),e}});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="liquid",t}return e.getDefaultOptions=function(){return eO},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.changeData=function(t){this.chart.emit(it.BEFORE_CHANGE_DATA,bt.fromData(this.chart,it.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data(K0(t)),J0({chart:this.chart,options:this.options},!0),this.chart.emit(it.AFTER_CHANGE_DATA,bt.fromData(this.chart,it.AFTER_CHANGE_DATA,null))},e.prototype.getSchemaAdaptor=function(){return tO},e})(et);function fO(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=L({},r,{options:{line:{style:n,color:a},point:o&&g.__assign({color:a},o),area:s&&g.__assign({color:a},s),label:void 0}}),u=L({},l,{options:{tooltip:!1}}),c=(o==null?void 0:o.state)||t.state,h=L({},l,{options:{tooltip:!1,state:c}});return ln(l),pe(h),Ns(u),r}function vO(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return j(Mt((e={},e[a]=i,e[o]=n,e)))(r)}function dO(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 gO(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 pO(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=$t(e,"line");if(!i)a.label(!1);else{var o=i.callback,s=g.__rest(i,["callback"]);a.label({fields:[n],callback:o,cfg:Ot(s)})}return r}function yO(r){return j(fO,vO,ot,dO,gO,sn,Pt,pO,wt,vt,St())(r)}var mO=function(r){g.__extends(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=se.getTooltipItems(f,s),d=v[0];if(!n&&d&&d.name===u){var p=D(a)?u:a;c.push(g.__assign(g.__assign({},d),{name:d.title,title:p}))}else if(n&&d){var p=D(a)?d.name||u:a;c.push(g.__assign(g.__assign({},d),{name:d.title,title:p}))}})}),c}return[]},e}(cy);wi("radar-tooltip",mO);var xO=function(r){g.__extends(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}(yt);q("radar-tooltip",xO);J("radar-tooltip",{start:[{trigger:"plot:mousemove",action:"radar-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"radar-tooltip:hide"}]});(function(r){g.__extends(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 L({},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 yO},e})(et);function wO(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 _O(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(g.__assign({},n))}),i}function bO(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=Zi(c,u);e.data(f);var v=L({},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 Ht(v),s==="line"&&pe({chart:e,options:{xField:l,yField:u,seriesField:o,point:{shape:"circle",color:n}}}),r}function tx(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?_O(a,n,i):a,h=Zi(c,i);return j(Mt((e={},e[i]={min:0,max:wO(u,i,h)},e)))(r)}function SO(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 CO(r){var e=r.chart,t=r.options,i=t.xField,n=t.xAxis;return e.axis(i,n),r}function MO(r){var e=r.chart,t=r.options,i=t.label,n=t.yField,a=$t(e,"interval");if(!i)a.label(!1);else{var o=i.callback,s=g.__rest(i,["callback"]);a.label({fields:[n],callback:o,cfg:g.__assign(g.__assign({},Ot(s)),{type:"polar"})})}return r}function AO(r){return j(ge("barStyle"),bO,tx,CO,SO,wt,vt,ot,Pt,sn,St(),MO)(r)}var FO=L({},et.getDefaultOptions(),{interactions:[{type:"element-active"}],legend:!1,tooltip:{showMarkers:!1},xAxis:{grid:null,tickLine:null,line:null},maxAngle:240});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="radial-bar",t}return e.getDefaultOptions=function(){return FO},e.prototype.changeData=function(t){this.updateOption({data:t}),tx({chart:this.chart,options:this.options}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return AO},e})(et);function TO(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(Ht)(L({},r,{options:{marginRatio:1,interval:{style:n,color:o,shape:a}}})),r}function EO(r){var e=r.chart,t=r.options,i=t.label,n=t.xField,a=$t(e,"interval");if(i===!1)a.label(!1);else if(pt(i)){var o=i.callback,s=i.fields,l=g.__rest(i,["callback","fields"]),u=l.offset,c=l.layout;(u===void 0||u>=0)&&(c=c?O(c)?c:[c]:[],l.layout=Xt(c,function(h){return h.type!=="limit-in-shape"}),l.layout.length||delete l.layout),a.label({fields:s||[n],callback:o,cfg:Ot(l)})}else dr(Oe.WARN,i===null,"the label option must be an Object."),a.label({fields:[n]});return r}function kO(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 LO(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 IO(r){var e,t=r.options,i=t.xAxis,n=t.yAxis,a=t.xField,o=t.yField;return j(Mt((e={},e[a]=i,e[o]=n,e)))(r)}function PO(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 DO(r){j(ge("sectorStyle"),TO,IO,EO,LO,PO,kO,Pt,wt,vt,ot,St(),Hr)(r)}var BO=L({},et.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){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="rose",t}return e.getDefaultOptions=function(){return BO},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 DO},e})(et);var Od="x",Rd="y",Nd="name",qs="nodes",Us="edges";function OO(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 RO(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 NO(r,e,t){if(!O(r))return[];var i=[],n=OO(r,e,t),a=RO(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 zO(r){return r.target.depth}function VO(r){return r.depth}function GO(r,e){return e-1-r.height}function gh(r,e){return r.sourceLinks.length?r.depth:e-1}function YO(r){return r.targetLinks.length?r.depth:r.sourceLinks.length?Wx(r.sourceLinks,zO)-1:0}function co(r){return function(){return r}}function Pl(r,e){for(var t=0,i=0;i<r.length;i++)t+=e(r[i]);return t}function Dl(r,e){for(var t=-1/0,i=0;i<r.length;i++)t=Math.max(e(r[i]),t);return t}function $O(r,e){for(var t=1/0,i=0;i<r.length;i++)t=Math.min(e(r[i]),t);return t}function zd(r,e){return Uo(r.source,e.source)||r.index-e.index}function Vd(r,e){return Uo(r.target,e.target)||r.index-e.index}function Uo(r,e){return r.y0-e.y0}function Bl(r){return r.value}function HO(r){return r.index}function XO(r){return r.nodes}function WO(r){return r.links}function Gd(r,e){var t=r.get(e);if(!t)throw new Error("missing: "+e);return t}function Yd(r){for(var e=r.nodes,t=0,i=e;t<i.length;t++){for(var n=i[t],a=n.y0,o=a,s=0,l=n.sourceLinks;s<l.length;s++){var u=l[s];u.y0=a+u.width/2,a+=u.width}for(var c=0,h=n.targetLinks;c<h.length;c++){var u=h[c];u.y1=o+u.width/2,o+=u.width}}}function qO(){var r=0,e=0,t=1,i=1,n=24,a=8,o,s=HO,l=gh,u,c,h,f=XO,v=WO,d=6;function p(I){var R={nodes:f(I),links:v(I)};return y(R),m(R),x(R),_(R),C(R),Yd(R),R}p.update=function(I){return Yd(I),I},p.nodeId=function(I){return arguments.length?(s=typeof I=="function"?I:co(I),p):s},p.nodeAlign=function(I){return arguments.length?(l=typeof I=="function"?I:co(I),p):l},p.nodeDepth=function(I){return arguments.length?(u=I,p):u},p.nodeSort=function(I){return arguments.length?(c=I,p):c},p.nodeWidth=function(I){return arguments.length?(n=+I,p):n},p.nodePadding=function(I){return arguments.length?(a=o=+I,p):a},p.nodes=function(I){return arguments.length?(f=typeof I=="function"?I:co(I),p):f},p.links=function(I){return arguments.length?(v=typeof I=="function"?I:co(I),p):v},p.linkSort=function(I){return arguments.length?(h=I,p):h},p.size=function(I){return arguments.length?(r=e=0,t=+I[0],i=+I[1],p):[t-r,i-e]},p.extent=function(I){return arguments.length?(r=+I[0][0],t=+I[1][0],e=+I[0][1],i=+I[1][1],p):[[r,e],[t,i]]},p.iterations=function(I){return arguments.length?(d=+I,p):d};function y(I){var R=I.nodes,$=I.links;R.forEach(function(Q,ht){Q.index=ht,Q.sourceLinks=[],Q.targetLinks=[]});var G=new Map(R.map(function(Q){return[s(Q),Q]}));if($.forEach(function(Q,ht){Q.index=ht;var _t=Q.source,Ct=Q.target;typeof _t!="object"&&(_t=Q.source=Gd(G,_t)),typeof Ct!="object"&&(Ct=Q.target=Gd(G,Ct)),_t.sourceLinks.push(Q),Ct.targetLinks.push(Q)}),h!=null)for(var V=0,H=R;V<H.length;V++){var Z=H[V],rt=Z.sourceLinks,U=Z.targetLinks;rt.sort(h),U.sort(h)}}function m(I){for(var R=I.nodes,$=0,G=R;$<G.length;$++){var V=G[$];V.value=V.fixedValue===void 0?Math.max(Pl(V.sourceLinks,Bl),Pl(V.targetLinks,Bl)):V.fixedValue}}function x(I){for(var R=I.nodes,$=R.length,G=new Set(R),V=new Set,H=0;G.size;){if(G.forEach(function(Q){Q.depth=H;for(var ht=0,_t=Q.sourceLinks;ht<_t.length;ht++){var Ct=_t[ht].target;V.add(Ct)}}),++H>$)throw new Error("circular link");G=V,V=new Set}if(u)for(var Z=Math.max(Dl(R,function(Q){return Q.depth})+1,0),rt=void 0,U=0;U<R.length;U++)rt=R[U],rt.depth=u.call(null,rt,Z)}function _(I){for(var R=I.nodes,$=R.length,G=new Set(R),V=new Set,H=0;G.size;){if(G.forEach(function(Z){Z.height=H;for(var rt=0,U=Z.targetLinks;rt<U.length;rt++){var Q=U[rt].source;V.add(Q)}}),++H>$)throw new Error("circular link");G=V,V=new Set}}function w(I){for(var R=I.nodes,$=Math.max(Dl(R,function(Ct){return Ct.depth})+1,0),G=(t-r-n)/($-1),V=new Array($).fill(0).map(function(){return[]}),H=0,Z=R;H<Z.length;H++){var rt=Z[H],U=Math.max(0,Math.min($-1,Math.floor(l.call(null,rt,$))));rt.layer=U,rt.x0=r+U*G,rt.x1=rt.x0+n,V[U]?V[U].push(rt):V[U]=[rt]}if(c)for(var Q=0,ht=V;Q<ht.length;Q++){var _t=ht[Q];_t.sort(c)}return V}function b(I){for(var R=$O(I,function(Yt){return(i-e-(Yt.length-1)*o)/Pl(Yt,Bl)}),$=0,G=I;$<G.length;$++){for(var V=G[$],H=e,Z=0,rt=V;Z<rt.length;Z++){var U=rt[Z];U.y0=H,U.y1=H+U.value*R,H=U.y1+o;for(var Q=0,ht=U.sourceLinks;Q<ht.length;Q++){var _t=ht[Q];_t.width=_t.value*R}}H=(i-H+o)/(V.length+1);for(var Ct=0;Ct<V.length;++Ct){var U=V[Ct];U.y0+=H*(Ct+1),U.y1+=H*(Ct+1)}B(V)}}function C(I){var R=w(I);o=Math.min(a,(i-e)/(Dl(R,function(H){return H.length})-1)),b(R);for(var $=0;$<d;++$){var G=Math.pow(.99,$),V=Math.max(1-G,($+1)/d);F(R,G,V),A(R,G,V)}}function A(I,R,$){for(var G=1,V=I.length;G<V;++G){for(var H=I[G],Z=0,rt=H;Z<rt.length;Z++){for(var U=rt[Z],Q=0,ht=0,_t=0,Ct=U.targetLinks;_t<Ct.length;_t++){var Yt=Ct[_t],Qe=Yt.source,Ke=Yt.value,Je=Ke*(U.layer-Qe.layer);Q+=z(Qe,U)*Je,ht+=Je}if(ht>0){var Xr=(Q/ht-U.y0)*R;U.y0+=Xr,U.y1+=Xr,P(U)}}c===void 0&&H.sort(Uo),H.length&&E(H,$)}}function F(I,R,$){for(var G=I.length,V=G-2;V>=0;--V){for(var H=I[V],Z=0,rt=H;Z<rt.length;Z++){for(var U=rt[Z],Q=0,ht=0,_t=0,Ct=U.sourceLinks;_t<Ct.length;_t++){var Yt=Ct[_t],Qe=Yt.target,Ke=Yt.value,Je=Ke*(Qe.layer-U.layer);Q+=X(U,Qe)*Je,ht+=Je}if(ht>0){var Xr=(Q/ht-U.y0)*R;U.y0+=Xr,U.y1+=Xr,P(U)}}c===void 0&&H.sort(Uo),H.length&&E(H,$)}}function E(I,R){var $=I.length>>1,G=I[$];k(I,G.y0-o,$-1,R),T(I,G.y1+o,$+1,R),k(I,i,I.length-1,R),T(I,e,0,R)}function T(I,R,$,G){for(;$<I.length;++$){var V=I[$],H=(R-V.y0)*G;H>1e-6&&(V.y0+=H,V.y1+=H),R=V.y1+o}}function k(I,R,$,G){for(;$>=0;--$){var V=I[$],H=(V.y1-R)*G;H>1e-6&&(V.y0-=H,V.y1-=H),R=V.y0-o}}function P(I){var R=I.sourceLinks,$=I.targetLinks;if(h===void 0){for(var G=0,V=$;G<V.length;G++){var H=V[G].source.sourceLinks;H.sort(Vd)}for(var Z=0,rt=R;Z<rt.length;Z++){var U=rt[Z].target.targetLinks;U.sort(zd)}}}function B(I){if(h===void 0)for(var R=0,$=I;R<$.length;R++){var G=$[R],V=G.sourceLinks,H=G.targetLinks;V.sort(Vd),H.sort(zd)}}function z(I,R){for(var $=I.y0-(I.sourceLinks.length-1)*o/2,G=0,V=I.sourceLinks;G<V.length;G++){var H=V[G],Z=H.target,rt=H.width;if(Z===R)break;$+=rt+o}for(var U=0,Q=R.targetLinks;U<Q.length;U++){var ht=Q[U],Z=ht.source,rt=ht.width;if(Z===I)break;$-=rt}return $}function X(I,R){for(var $=R.y0-(R.targetLinks.length-1)*o/2,G=0,V=R.targetLinks;G<V.length;G++){var H=V[G],Z=H.source,rt=H.width;if(Z===I)break;$+=rt+o}for(var U=0,Q=I.sourceLinks;U<Q.length;U++){var ht=Q[U],Z=ht.target,rt=ht.width;if(Z===R)break;$-=rt}return $}return p}var UO={left:VO,right:GO,center:YO,justify:gh},jO={nodeId:function(r){return r.index},nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodeSort:void 0};function ZO(r){var e=K(r)?UO[r]:W(r)?r:null;return e||gh}function QO(r){return ft({},jO,r)}function KO(r,e){var t=QO(r),i=t.nodeId,n=t.nodeSort,a=t.nodeAlign,o=t.nodeWidth,s=t.nodePadding,l=t.nodeDepth,u=qO().nodeSort(n).nodeWidth(o).nodePadding(s).nodeDepth(l).nodeAlign(ZO(a)).extent([[0,0],[1,1]]).nodeId(i),c=u(e),h=c.nodes.map(function(v){var d=v.x0,p=v.x1,y=v.y0,m=v.y1;return v.x=[d,p,p,d],v.y=[y,y,m,m],v}).filter(function(v){return v.name!==null}),f=c.links.map(function(v){var d=v.source,p=v.target,y=d.x1,m=p.x0;v.x=[y,y,m,m];var x=v.width/2;return v.y=[v.y0+x,v.y0-x,v.y1+x,v.y1-x],v}).filter(function(v){var d=v.source,p=v.target;return d.name!==null&&p.name!==null});return{nodes:h,links:f}}function JO(r){return r==="node-link"}function tR(r,e,t){return pi(r)?r/t:e}function eR(r,e,t){return pi(r)?r/t:e}function ex(r,e,t){var i=r.dataType,n=r.data,a=r.sourceField,o=r.targetField,s=r.weightField,l=r.nodeAlign,u=r.nodeSort,c=r.nodePadding,h=r.nodePaddingRatio,f=r.nodeWidth,v=r.nodeWidthRatio,d=r.nodeDepth,p=r.rawFields,y=p===void 0?[]:p,m;JO(i)?m=n:m=wm(NO(n,a,o),a,o,s,y);var x=KO({nodeAlign:l,nodePadding:eR(c,h,t),nodeWidth:tR(f,v,e),nodeSort:u,nodeDepth:d},m),_=x.nodes,w=x.links;return{nodes:_.map(function(b){return g.__assign(g.__assign({},ct(b,g.__spreadArray(["x","y","name"],y,!0))),{isNode:!0})}),edges:w.map(function(b){return g.__assign(g.__assign({source:b.source.name,target:b.target.name,name:b.source.name||b.target.name},ct(b,g.__spreadArray(["x","y","value"],y,!0))),{isNode:!1})})}}function rR(r){var e=r.options,t=e.rawFields,i=t===void 0?[]:t;return L({},{options:{tooltip:{fields:hi(g.__spreadArray(["name","source","target","value","isNode"],i,!0))},label:{fields:hi(g.__spreadArray(["x","name"],i,!0))}}},r)}function iR(r){var e=r.chart,t=r.options,i=t.color,n=t.nodeStyle,a=t.edgeStyle,o=t.label,s=t.tooltip,l=t.nodeState,u=t.edgeState,c=t.rawFields,h=c===void 0?[]:c;e.legend(!1),e.tooltip(s),e.axis(!1),e.coordinate().reflect("y");var f=ex(t,e.width,e.height),v=f.nodes,d=f.edges,p=e.createView({id:Us});p.data(d),km({chart:p,options:{xField:Od,yField:Rd,seriesField:Nd,rawFields:g.__spreadArray(["source","target"],h,!0),edge:{color:i,style:a,shape:"arc"},tooltip:s,state:u}});var y=e.createView({id:qs});return y.data(v),zs({chart:y,options:{xField:Od,yField:Rd,seriesField:Nd,polygon:{color:i,style:n},label:o,tooltip:s,state:l}}),e.interaction("element-active"),e.scale({x:{sync:!0,nice:!0,min:0,max:1,minLimit:0,maxLimit:1},y:{sync:!0,nice:!0,min:0,max:1,minLimit:0,maxLimit:1},name:{sync:"color",type:"cat"}}),r}function nR(r){var e=r.chart,t=r.options,i=t.animation,n=g.__spreadArray(g.__spreadArray([],e.views[0].geometries,!0),e.views[1].geometries,!0);return Aa(e,i,n),r}function aR(r){var e=r.chart,t=r.options,i=t.nodeDraggable,n="sankey-node-draggable";return i?e.interaction(n):e.removeInteraction(n),r}function oR(r){var e=r.chart,t=r.options,i=t.interactions,n=i===void 0?[]:i,a=[].concat(n,t.nodeInteractions||[]),o=[].concat(n,t.edgeInteractions||[]),s=nt(e,qs),l=nt(e,Us);return a.forEach(function(u){(u==null?void 0:u.enable)===!1?s.removeInteraction(u.type):s.interaction(u.type,u.cfg||{})}),o.forEach(function(u){(u==null?void 0:u.enable)===!1?l.removeInteraction(u.type):l.interaction(u.type,u.cfg||{})}),r}function sR(r){return j(rR,iR,oR,aR,nR,ot)(r)}var lR=function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.isDragging=!1,t}return e.prototype.isNodeElement=function(){var t=M(this.context,"event.target");if(t){var i=t.get("element");return i&&i.getModel().data.isNode}return!1},e.prototype.getNodeView=function(){return nt(this.context.view,qs)},e.prototype.getEdgeView=function(){return nt(this.context.view,Us)},e.prototype.getCurrentDatumIdx=function(t){return this.getNodeView().geometries[0].elements.indexOf(t)},e.prototype.start=function(){if(this.isNodeElement()){this.prevPoint={x:M(this.context,"event.x"),y:M(this.context,"event.y")};var t=this.context.event.target.get("element"),i=this.getCurrentDatumIdx(t);if(i===-1)return;this.currentElementIdx=i,this.context.isDragging=!0,this.isDragging=!0,this.prevNodeAnimateCfg=this.getNodeView().getOptions().animate,this.prevEdgeAnimateCfg=this.getEdgeView().getOptions().animate,this.getNodeView().animate(!1),this.getEdgeView().animate(!1)}},e.prototype.translate=function(){if(this.isDragging){var t=this.context.view,i={x:M(this.context,"event.x"),y:M(this.context,"event.y")},n=i.x-this.prevPoint.x,a=i.y-this.prevPoint.y,o=this.getNodeView(),s=o.geometries[0].elements[this.currentElementIdx];if(s&&s.getModel()){var l=s.getModel().data,u=o.getOptions().data,c=o.getCoordinate(),h={x:n/c.getWidth(),y:a/c.getHeight()},f=g.__assign(g.__assign({},l),{x:l.x.map(function(m){return m+=h.x}),y:l.y.map(function(m){return m+=h.y})}),v=g.__spreadArray([],u,!0);v[this.currentElementIdx]=f,o.data(v);var d=l.name,p=this.getEdgeView(),y=p.getOptions().data;y.forEach(function(m){m.source===d&&(m.x[0]+=h.x,m.x[1]+=h.x,m.y[0]+=h.y,m.y[1]+=h.y),m.target===d&&(m.x[2]+=h.x,m.x[3]+=h.x,m.y[2]+=h.y,m.y[3]+=h.y)}),p.data(y),this.prevPoint=i,t.render(!0)}}},e.prototype.end=function(){this.isDragging=!1,this.context.isDragging=!1,this.prevPoint=null,this.currentElementIdx=null,this.getNodeView().animate(this.prevNodeAnimateCfg),this.getEdgeView().animate(this.prevEdgeAnimateCfg)},e}(yt);q("sankey-node-drag",lR);J("sankey-node-draggable",{showEnable:[{trigger:"polygon:mouseenter",action:"cursor:pointer"},{trigger:"polygon:mouseleave",action:"cursor:default"}],start:[{trigger:"polygon:mousedown",action:"sankey-node-drag:start"}],processing:[{trigger:"plot:mousemove",action:"sankey-node-drag:translate"},{isEnable:function(r){return r.isDragging},trigger:"plot:mousemove",action:"cursor:move"}],end:[{trigger:"plot:mouseup",action:"sankey-node-drag:end"}]});(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="sankey",t}return e.getDefaultOptions=function(){return{appendPadding:8,syncViewPadding:!0,nodeStyle:{opacity:1,fillOpacity:1,lineWidth:1},edgeStyle:{opacity:.3,lineWidth:0},edgeState:{active:{style:{opacity:.8,lineWidth:0}}},label:{formatter:function(t){var i=t.name;return i},callback:function(t){var i=t[1]===1;return{style:{fill:"#545454",textAlign:i?"end":"start"},offsetX:i?-8:8}},layout:[{type:"hide-overlap"}]},tooltip:{showTitle:!1,showMarkers:!1,shared:!1,showContent:function(t){return!M(t,[0,"data","isNode"])},formatter:function(t){var i=t.source,n=t.target,a=t.value;return{name:i+" -> "+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=ex(this.options,this.chart.width,this.chart.height),n=i.nodes,a=i.edges,o=nt(this.chart,qs),s=nt(this.chart,Us);o.changeData(n),s.changeData(a)},e.prototype.getSchemaAdaptor=function(){return sR},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(et);var ph="ancestor-node",rx="value",da="path",uR=[da,q0,hh,U0,"name","depth","height"],cR=L({},et.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}}),hR={field:"value",size:[1,1],round:!1,padding:0,sort:function(r,e){return e.value-r.value},as:["x","y"],ignoreParentValue:!0};function fR(r,e){e=ft({},hR,e);var t=e.as;if(!O(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 Y0().size(e.size).round(e.round).padding(e.padding)(hn(l).sum(function(u){return Bt(u.children)?e.ignoreParentValue?0:u[i]-Zt(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]})}),vh(a)}var vR={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 dR(r,e){return r==="treemapSquarify"?Md[r].ratio(e):Md[r]}function ix(r,e){e=ft({},vR,e);var t=e.as;if(!O(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=dR(e.tile,e.ratio),a=function(u){return W0().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)(hn(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]})}),vh(o)}function nx(r){var e=r.data,t=r.colorField,i=r.rawFields,n=r.hierarchyConfig,a=n===void 0?{}:n,o=a.activeDepth,s={partition:fR,treemap:ix},l=r.seriesField,u=r.type||"partition",c=s[u](e,g.__assign(g.__assign({field:l||"value"},Ko(a,["activeDepth"])),{type:"hierarchy.".concat(u),as:["x","y"]})),h=[];return c.forEach(function(f){var v,d,p,y,m,x;if(f.depth===0||o>0&&f.depth>o)return null;for(var _=f.data.name,w=g.__assign({},f);w.depth>1;)_="".concat((d=w.parent.data)===null||d===void 0?void 0:d.name," / ").concat(_),w=w.parent;var b=g.__assign(g.__assign(g.__assign({},ct(f.data,g.__spreadArray(g.__spreadArray([],i||[],!0),[a.field],!1))),(v={},v[da]=_,v[ph]=w.data.name,v)),f);l&&(b[l]=f.data[l]||((y=(p=f.parent)===null||p===void 0?void 0:p.data)===null||y===void 0?void 0:y[l])),t&&(b[t]=f.data[t]||((x=(m=f.parent)===null||m===void 0?void 0:m.data)===null||x===void 0?void 0:x[t])),b.ext=a,b[va]={hierarchyConfig:a,colorField:t,rawFields:i},h.push(b)}),h}function gR(r){var e=r.chart,t=r.options,i=t.color,n=t.colorField,a=n===void 0?ph:n,o=t.sunburstStyle,s=t.rawFields,l=s===void 0?[]:s,u=t.shape,c=nx(t);e.data(c);var h;return o&&(h=function(f){return L({},{fillOpacity:Math.pow(.85,f.depth)},W(o)?o(f):o)}),zs(L({},r,{options:{xField:"x",yField:"y",seriesField:a,rawFields:hi(g.__spreadArray(g.__spreadArray([],uR,!0),l,!0)),polygon:{color:i,style:h,shape:u}}})),r}function pR(r){var e=r.chart;return e.axis(!1),r}function yR(r){var e=r.chart,t=r.options,i=t.label,n=$t(e,"polygon");if(!i)n.label(!1);else{var a=i.fields,o=a===void 0?["name"]:a,s=i.callback,l=g.__rest(i,["fields","callback"]);n.label({fields:o,callback:s,cfg:Ot(l)})}return r}function mR(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 xR(r){var e,t=r.options,i=t.hierarchyConfig,n=t.meta;return j(Mt({},(e={},e[rx]=M(n,M(i,["field"],"value")),e)))(r)}function wR(r){var e=r.chart,t=r.options,i=t.tooltip;if(i===!1)e.tooltip(!1);else{var n=i;M(i,"fields")||(n=L({},{customItems:function(a){return a.map(function(o){var s=M(e.getOptions(),"scales"),l=M(s,[da,"formatter"],function(c){return c}),u=M(s,[rx,"formatter"],function(c){return c});return g.__assign(g.__assign({},o),{name:l(o.data[da]),value:u(o.data.value)})})}},n)),e.tooltip(n)}return r}function _R(r){var e=r.drilldown,t=r.interactions,i=t===void 0?[]:t;return e!=null&&e.enabled?L({},r,{interactions:g.__spreadArray(g.__spreadArray([],i,!0),[{type:"drill-down",cfg:{drillDownConfig:e,transformData:nx}}],!1)}):r}function bR(r){var e=r.chart,t=r.options,i=t.drilldown;return wt({chart:e,options:_R(t)}),i!=null&&i.enabled&&(e.appendPadding=Ds(e.appendPadding,M(i,["breadCrumb","position"]))),r}function SR(r){return j(ot,ge("sunburstStyle"),gR,pR,xR,sn,mR,wR,yR,bR,vt,St())(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="sunburst",t}return e.getDefaultOptions=function(){return cR},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return SR},e.SUNBURST_ANCESTOR_FIELD=ph,e.SUNBURST_PATH_FIELD=da,e.NODE_ANCESTORS_FIELD=hh,e})(et);function ax(r,e){if(O(r))return r.find(function(t){return t.type===e})}function ox(r,e){var t=ax(r,e);return t&&t.enable!==!1}function yh(r){var e=r.interactions,t=r.drilldown;return M(t,"enabled")||ox(e,"treemap-drill-down")}function CR(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 mh(r){var e=r.data,t=r.colorField,i=r.enableDrillDown,n=r.hierarchyConfig,a=ix(e,g.__assign(g.__assign({},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&&O(e.path)?l.concat(e.path.slice(1)):l,c=Object.assign({},s.data,g.__assign({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[va]={hierarchyConfig:n,colorField:t,enableDrillDown:i},o.push(c)}),o}function MR(r){var e=r.options,t=e.colorField;return L({options:{rawFields:["value"],tooltip:{fields:["name","value",t,"path"],formatter:function(i){return{name:i.name,value:i.value}}}}},r)}function AR(r){var e=r.chart,t=r.options,i=t.color,n=t.colorField,a=t.rectStyle,o=t.hierarchyConfig,s=t.rawFields,l=mh({data:t.data,colorField:t.colorField,enableDrillDown:yh(t),hierarchyConfig:o});return e.data(l),zs(L({},r,{options:{xField:"x",yField:"y",seriesField:n,rawFields:s,polygon:{color:i,style:a}}})),e.coordinate().reflect("y"),r}function FR(r){var e=r.chart;return e.axis(!1),r}function TR(r){var e=r.drilldown,t=r.interactions,i=t===void 0?[]:t,n=yh(r);return n?L({},r,{interactions:g.__spreadArray(g.__spreadArray([],i,!0),[{type:"drill-down",cfg:{drillDownConfig:e,transformData:mh}}],!1)}):r}function ER(r){var e=r.chart,t=r.options,i=t.interactions,n=t.drilldown;wt({chart:e,options:TR(t)});var a=ax(i,"view-zoom");a&&(a.enable!==!1?e.getCanvas().on("mousewheel",function(s){s.preventDefault()}):e.getCanvas().off("mousewheel"));var o=yh(t);return o&&(e.appendPadding=Ds(e.appendPadding,M(n,["breadCrumb","position"]))),r}function kR(r){return j(MR,ot,ge("rectStyle"),AR,FR,sn,Pt,ER,vt,St())(r)}var LR={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){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="treemap",t}return e.getDefaultOptions=function(){return LR},e.prototype.changeData=function(t){var i=this.options,n=i.colorField,a=i.interactions,o=i.hierarchyConfig;this.updateOption({data:t});var s=mh({data:t,colorField:n,enableDrillDown:ox(a,"treemap-drill-down"),hierarchyConfig:o});this.chart.changeData(s),CR(this.chart)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return kR},e})(et);var cr="id",ku="path",IR={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 js(r){if(r){var e=r.geometries[0].elements;e.forEach(function(t){t.shape.toFront()})}}var PR=As("element-active"),DR=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){js(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}(PR),BR=As("element-highlight"),OR=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){js(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}(BR),RR=As("element-selected"),NR=As("element-single-selected"),zR=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){js(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}(RR),VR=function(r){g.__extends(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.syncElementsPos=function(){js(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}(NR);q("venn-element-active",DR);q("venn-element-highlight",OR);q("venn-element-selected",zR);q("venn-element-single-selected",VR);J("venn-element-active",{start:[{trigger:"element:mouseenter",action:"venn-element-active:active"}],end:[{trigger:"element:mouseleave",action:"venn-element-active:reset"}]});J("venn-element-highlight",{start:[{trigger:"element:mouseenter",action:"venn-element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"venn-element-highlight:reset"}]});J("venn-element-selected",{start:[{trigger:"element:click",action:"venn-element-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-selected:reset"]}]});J("venn-element-single-selected",{start:[{trigger:"element:click",action:"venn-element-single-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-single-selected:reset"]}]});J("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"]}]});J("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 GR=function(r){g.__extends(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}(ks);Sa("venn",GR);var $n=`
  79. \v\f\r   ᠎              \u2028\u2029`,YR=new RegExp("([a-z])["+$n+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+$n+"]*,?["+$n+"]*)+)","ig"),$R=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+$n+"]*,?["+$n+"]*","ig");function HR(r){if(!r)return null;if(qx(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(YR,function(i,n,a){var o=[],s=n.toLowerCase();if(a.replace($R,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 XR(r){return L({},r.defaultStyle,{fill:r.color},r.style)}lt("schema","venn",{draw:function(r,e){var t=r.data,i=HR(t[ku]),n=XR(r),a=e.addGroup({name:"venn-shape"});a.addShape("path",{attrs:g.__assign(g.__assign({},n),{path:i}),name:"venn-path"});var o=r.customInfo,s=o.offsetX,l=o.offsetY,u=se.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 WR=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}},$d={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)))}},qR=function(r){if(!$d[r])throw new Error("unknown blend mode "+r);return $d[r]};function UR(r,e,t){t===void 0&&(t="normal");var i=WR(qR(t))(ho(r),ho(e)),n=ho(r),a=n[0],o=n[1],s=n[2],l=n[3],u=ho(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),y=Math.round((l*(1-v)*(o/255)+l*v*(i[1]/255)+(1-l)*v*(h/255))/d*255),m=Math.round((l*(1-v)*(s/255)+l*v*(i[2]/255)+(1-l)*v*(f/255))/d*255);return"rgba(".concat(p,", ").concat(y,", ").concat(m,", ").concat(d,")")}function ho(r){var e=r.replace("/s+/g",""),t;return typeof e=="string"&&!e.startsWith("rgba")&&!e.startsWith("#")?t=kr.rgb2arr(kr.toRGB(e)).concat([1]):(e.startsWith("rgba")&&(t=e.replace("rgba(","").replace(")","").split(",")),e.startsWith("#")&&(t=kr.rgb2arr(e).concat([1])),t.map(function(i,n){return n===3?Number(i):i|0}))}function jR(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<n;++u){l/=2;var c=e+l,h=r(c);if(h*o>=0&&(e=c),Math.abs(l)<a||h===0)return c}return e+l}function Lu(r){for(var e=new Array(r),t=0;t<r;++t)e[t]=0;return e}function Hd(r,e){return Lu(r).map(function(){return Lu(e)})}function Gi(r,e){for(var t=0,i=0;i<r.length;++i)t+=r[i]*e[i];return t}function Iu(r){return Math.sqrt(Gi(r,r))}function Pu(r,e,t){for(var i=0;i<e.length;++i)r[i]=e[i]*t}function rr(r,e,t,i,n){for(var a=0;a<r.length;++a)r[a]=e*t[a]+i*n[a]}function sx(r,e,t){t=t||{};var i=t.maxIterations||e.length*200,n=t.nonZeroDelta||1.05,a=t.zeroDelta||.001,o=t.minErrorDelta||1e-6,s=t.minErrorDelta||1e-5,l=t.rho!==void 0?t.rho:1,u=t.chi!==void 0?t.chi:2,c=t.psi!==void 0?t.psi:-.5,h=t.sigma!==void 0?t.sigma:.5,f,v=e.length,d=new Array(v+1);d[0]=e,d[0].fx=r(e),d[0].id=0;for(var p=0;p<v;++p){var y=e.slice();y[p]=y[p]?y[p]*n:a,d[p+1]=y,d[p+1].fx=r(y),d[p+1].id=p+1}function m(P){for(var B=0;B<P.length;B++)d[v][B]=P[B];d[v].fx=P.fx}for(var x=function(P,B){return P.fx-B.fx},_=e.slice(),w=e.slice(),b=e.slice(),C=e.slice(),A=0;A<i;++A){if(d.sort(x),t.history){var F=d.map(function(P){var B=P.slice();return B.fx=P.fx,B.id=P.id,B});F.sort(function(P,B){return P.id-B.id}),t.history.push({x:d[0].slice(),fx:d[0].fx,simplex:F})}for(f=0,p=0;p<v;++p)f=Math.max(f,Math.abs(d[0][p]-d[1][p]));if(Math.abs(d[0].fx-d[v].fx)<o&&f<s)break;for(p=0;p<v;++p){_[p]=0;for(var E=0;E<v;++E)_[p]+=d[E][p];_[p]/=v}var T=d[v];if(rr(w,1+l,_,-l,T),w.fx=r(w),w.fx<d[0].fx)rr(C,1+u,_,-u,T),C.fx=r(C),C.fx<w.fx?m(C):m(w);else if(w.fx>=d[v-1].fx){var k=!1;if(w.fx>T.fx?(rr(b,1+c,_,-c,T),b.fx=r(b),b.fx<T.fx?m(b):k=!0):(rr(b,1-c*l,_,c*l,T),b.fx=r(b),b.fx<w.fx?m(b):k=!0),k){if(h>=1)break;for(p=1;p<d.length;++p)rr(d[p],1-h,d[0],h,d[p]),d[p].fx=r(d[p])}}else m(w)}return d.sort(x),{fx:d[0].fx,x:d[0]}}function ZR(r,e,t,i,n,a,o){var s=t.fx,l=Gi(t.fxprime,e),u=s,c=s,h=l,f=0;n=n||1,a=a||1e-6,o=o||.1;function v(p,y,m){for(var x=0;x<16;++x)if(n=(p+y)/2,rr(i.x,1,t.x,n,e),u=i.fx=r(i.x,i.fxprime),h=Gi(i.fxprime,e),u>s+a*n*l||u>=m)y=n;else{if(Math.abs(h)<=-o*l)return n;h*(y-p)>=0&&(y=p),p=n,m=u}return 0}for(var d=0;d<10;++d){if(rr(i.x,1,t.x,n,e),u=i.fx=r(i.x,i.fxprime),h=Gi(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 QR(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(),Pu(o,i.fxprime,-1);for(var c=0;c<u;++c){if(l=ZR(r,o,i,n,l),t.history&&t.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),alpha:l}),!l)Pu(o,i.fxprime,-1);else{rr(a,1,n.fxprime,-1,i.fxprime);var h=Gi(i.fxprime,i.fxprime),f=Math.max(0,Gi(a,n.fxprime)/h);rr(o,f,o,-1,n.fxprime),s=i,i=n,n=s}if(Iu(i.fxprime)<=1e-5)break}return t.history&&t.history.push({x:i.x.slice(),fx:i.fx,fxprime:i.fxprime.slice(),alpha:l}),i}var lx=1e-10;function xh(r,e){var t=JR(r),i=t.filter(function(A){return KR(A,r)}),n=0,a=0,o,s=[];if(i.length>1){var l=hx(i);for(o=0;o<i.length;++o){var u=i[o];u.angle=Math.atan2(u.x-l.x,u.y-l.y)}i.sort(function(A,F){return F.angle-A.angle});var c=i[i.length-1];for(o=0;o<i.length;++o){var h=i[o];a+=(c.x+h.x)*(h.y-c.y);for(var f={x:(h.x+c.x)/2,y:(h.y+c.y)/2},v=null,d=0;d<h.parentIndex.length;++d)if(c.parentIndex.indexOf(h.parentIndex[d])>-1){var p=r[h.parentIndex[d]],y=Math.atan2(h.x-p.x,h.y-p.y),m=Math.atan2(c.x-p.x,c.y-p.y),x=m-y;x<0&&(x+=2*Math.PI);var _=m-x/2,w=Ie(f,{x:p.x+p.radius*Math.sin(_),y:p.y+p.radius*Math.cos(_)});w>p.radius*2&&(w=p.radius*2),(v===null||v.width>w)&&(v={circle:p,width:w,p1:h,p2:c})}v!==null&&(s.push(v),n+=Du(v.circle.radius,v.width),c=h)}}else{var b=r[0];for(o=1;o<r.length;++o)r[o].radius<b.radius&&(b=r[o]);var C=!1;for(o=0;o<r.length;++o)if(Ie(r[o],b)>Math.abs(b.radius-r[o].radius)){C=!0;break}C?n=a=0:(n=b.radius*b.radius*Math.PI,s.push({circle:b,p1:{x:b.x,y:b.y+b.radius},p2:{x:b.x-lx,y:b.y+b.radius},width:b.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 KR(r,e){for(var t=0;t<e.length;++t)if(Ie(r,e[t])>e[t].radius+lx)return!1;return!0}function JR(r){for(var e=[],t=0;t<r.length;++t)for(var i=t+1;i<r.length;++i)for(var n=cx(r[t],r[i]),a=0;a<n.length;++a){var o=n[a];o.parentIndex=[t,i],e.push(o)}return e}function Du(r,e){return r*r*Math.acos(1-e/r)-(r-e)*Math.sqrt(e*(2*r-e))}function Ie(r,e){return Math.sqrt((r.x-e.x)*(r.x-e.x)+(r.y-e.y)*(r.y-e.y))}function ux(r,e,t){if(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 Du(r,i)+Du(e,n)}function cx(r,e){var t=Ie(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 hx(r){for(var e={x:0,y:0},t=0;t<r.length;++t)e.x+=r[t].x,e.y+=r[t].y;return e.x/=r.length,e.y/=r.length,e}function Ol(r,e,t){var i=e[0].radius-Ie(e[0],r),n,a;for(n=1;n<e.length;++n)a=e[n].radius-Ie(e[n],r),a<=i&&(i=a);for(n=0;n<t.length;++n)a=Ie(t[n],r)-t[n].radius,a<=i&&(i=a);return i}function fx(r,e){var t=[],i;for(i=0;i<r.length;++i){var n=r[i];t.push({x:n.x,y:n.y}),t.push({x:n.x+n.radius/2,y:n.y}),t.push({x:n.x-n.radius/2,y:n.y}),t.push({x:n.x,y:n.y+n.radius/2}),t.push({x:n.x,y:n.y-n.radius/2})}var a=t[0],o=Ol(t[0],r,e);for(i=1;i<t.length;++i){var s=Ol(t[i],r,e);s>=o&&(a=t[i],o=s)}var l=sx(function(f){return-1*Ol({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;i<r.length;++i)if(Ie(u,r[i])>r[i].radius){c=!1;break}for(i=0;i<e.length;++i)if(Ie(u,e[i])<e[i].radius){c=!1;break}if(!c)if(r.length==1)u={x:r[0].x,y:r[0].y};else{var h={};xh(r,h),h.arcs.length===0?u={x:0,y:-1e3,disjoint:!0}:h.arcs.length==1?u={x:h.arcs[0].circle.x,y:h.arcs[0].circle.y}:e.length?u=fx(r,[]):u=hx(h.arcs.map(function(f){return f.p1}))}return u}function tN(r){var e={},t=[];for(var i in r)t.push(i),e[i]=[];for(var n=0;n<t.length;n++)for(var a=r[t[n]],o=n+1;o<t.length;++o){var s=r[t[o]],l=Ie(a,s);l+s.radius<=a.radius+1e-10?e[t[o]].push(t[n]):l+a.radius<=s.radius+1e-10&&e[t[n]].push(t[o])}return e}function eN(r,e){for(var t={},i=tN(r),n=0;n<e.length;++n){for(var a=e[n].sets,o={},s={},l=0;l<a.length;++l){o[a[l]]=!0;for(var u=i[a[l]],c=0;c<u.length;++c)s[u[c]]=!0}var h=[],f=[];for(var v in r)v in o?h.push(r[v]):v in s||f.push(r[v]);var d=fx(h,f);t[a]=d,d.disjoint&&e[n].size>0&&console.log("WARNING: area "+a+" not represented on screen")}return t}function rN(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 iN(r){var e={};xh(r,e);var t=e.arcs;if(t.length===0)return"M 0 0";if(t.length==1){var i=t[0].circle;return rN(i.x,i.y,i.radius)}else{for(var n=[`
  80. M`,t[0].p2.x,t[0].p2.y],a=0;a<t.length;++a){var o=t[a],s=o.circle.radius,l=o.width>s;n.push(`
  81. A`,s,s,0,l?1:0,1,o.p1.x,o.p1.y)}return n.join(" ")}}function nN(r,e){e=e||{},e.maxIterations=e.maxIterations||500;var t=e.initialLayout||lN,i=e.lossFunction||wh;r=aN(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=sx(function(h){for(var f={},v=0;v<o.length;++v){var d=o[v];f[d]={x:h[2*v],y:h[2*v+1],radius:n[d].radius}}return i(f,r)},a,e),u=l.x,c=0;c<o.length;++c)s=o[c],n[s].x=u[2*c],n[s].y=u[2*c+1];return n}var vx=1e-10;function Bu(r,e,t){return Math.min(r,e)*Math.min(r,e)*Math.PI<=t+vx?Math.abs(r-e):jR(function(i){return ux(r,e,i)-t},0,r+e)}function aN(r){r=r.slice();var e=[],t={},i,n,a,o;for(i=0;i<r.length;++i){var s=r[i];s.sets.length==1?e.push(s.sets[0]):s.sets.length==2&&(a=s.sets[0],o=s.sets[1],t[[a,o]]=!0,t[[o,a]]=!0)}for(e.sort(function(l,u){return l>u?1:-1}),i=0;i<e.length;++i)for(a=e[i],n=i+1;n<e.length;++n)o=e[n],[a,o]in t||r.push({sets:[a,o],size:0});return r}function oN(r,e,t){var i=Hd(e.length,e.length),n=Hd(e.length,e.length);return r.filter(function(a){return a.sets.length==2}).map(function(a){var o=t[a.sets[0]],s=t[a.sets[1]],l=Math.sqrt(e[o].size/Math.PI),u=Math.sqrt(e[s].size/Math.PI),c=Bu(l,u,a.size);i[o][s]=i[s][o]=c;var h=0;a.size+1e-10>=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 sN(r,e,t,i){var n=0,a;for(a=0;a<e.length;++a)e[a]=0;for(a=0;a<t.length;++a)for(var o=r[2*a],s=r[2*a+1],l=a+1;l<t.length;++l){var u=r[2*l],c=r[2*l+1],h=t[a][l],f=i[a][l],v=(u-o)*(u-o)+(c-s)*(c-s),d=Math.sqrt(v),p=v-h*h;f>0&&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 lN(r,e){var t=cN(r,e),i=e.lossFunction||wh;if(r.length>=8){var n=uN(r,e),a=i(n,r),o=i(t,r);a+1e-8<o&&(t=n)}return t}function uN(r,e){e=e||{};var t=e.restarts||10,i=[],n={},a;for(a=0;a<r.length;++a){var o=r[a];o.sets.length==1&&(n[o.sets[0]]=i.length,i.push(o))}var s=oN(r,i,n),l=s.distances,u=s.constraints,c=Iu(l.map(Iu))/l.length;l=l.map(function(x){return x.map(function(_){return _/c})});var h=function(x,_){return sN(x,_,l,u)},f,v;for(a=0;a<t;++a){var d=Lu(l.length*2).map(Math.random);v=QR(h,d,e),(!f||v.fx<f.fx)&&(f=v)}var p=f.x,y={};for(a=0;a<i.length;++a){var m=i[a];y[m.sets[0]]={x:p[2*a]*c,y:p[2*a+1]*c,radius:Math.sqrt(m.size/Math.PI)}}if(e.history)for(a=0;a<e.history.length;++a)Pu(e.history[a].x,c);return y}function cN(r,e){for(var t=e&&e.lossFunction?e.lossFunction:wh,i={},n={},a,o=0;o<r.length;++o){var s=r[o];s.sets.length==1&&(a=s.sets[0],i[a]={x:1e10,y:1e10,rowid:Object.keys(i).length,size:s.size,radius:Math.sqrt(s.size/Math.PI)},n[a]=[])}r=r.filter(function(I){return I.sets.length==2});for(var o=0;o<r.length;++o){var l=r[o],u=l.hasOwnProperty("weight")?l.weight:1,c=l.sets[0],h=l.sets[1];l.size+vx>=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<n[a].length;++o)v+=n[a][o].size*n[a][o].weight;f.push({set:a,size:v})}function d(I,R){return R.size-I.size}f.sort(d);var p={};function y(I){return I.set in p}function m(I,R){i[R].x=I.x,i[R].y=I.y,p[R]=!0}m({x:0,y:0},f[0].set);for(var o=1;o<f.length;++o){var x=f[o].set,_=n[x].filter(y);if(a=i[x],_.sort(d),_.length===0)throw"ERROR: missing pairwise overlap information";for(var w=[],b=0;b<_.length;++b){var C=i[_[b].set],A=Bu(a.radius,C.radius,_[b].size);w.push({x:C.x+A,y:C.y}),w.push({x:C.x-A,y:C.y}),w.push({y:C.y+A,x:C.x}),w.push({y:C.y-A,x:C.x});for(var F=b+1;F<_.length;++F)for(var E=i[_[F].set],T=Bu(a.radius,E.radius,_[F].size),k=cx({x:C.x,y:C.y,radius:A},{x:E.x,y:E.y,radius:T}),P=0;P<k.length;++P)w.push(k[P])}for(var B=1e50,z=w[0],b=0;b<w.length;++b){i[x].x=w[b].x,i[x].y=w[b].y;var X=t(i,r);X<B&&(B=X,z=w[b])}m(z,x)}return i}function wh(r,e){var t=0;function i(c){return c.map(function(h){return r[h]})}for(var n=0;n<e.length;++n){var a=e[n],o=void 0;if(a.sets.length!=1){if(a.sets.length==2){var s=r[a.sets[0]],l=r[a.sets[1]];o=ux(s.radius,l.radius,Ie(s,l))}else o=xh(i(a.sets));var u=a.hasOwnProperty("weight")?a.weight:1;t+=u*(o-a.size)*(o-a.size)}}return t}function hN(r){var e=function(t){var i=Math.max.apply(null,r.map(function(a){return a[t]+a.radius})),n=Math.min.apply(null,r.map(function(a){return a[t]-a.radius}));return{max:i,min:n}};return{xRange:e("x"),yRange:e("y")}}function fN(r,e,t,i){var n=[],a=[];for(var o in r)r.hasOwnProperty(o)&&(a.push(o),n.push(r[o]));e-=2*i,t-=2*i;var s=hN(n),l=s.xRange,u=s.yRange;if(l.max==l.min||u.max==u.min)return console.log("not scaling solution: zero size detected"),r;for(var c=e/(l.max-l.min),h=t/(u.max-u.min),f=Math.min(h,c),v=(e-(l.max-l.min)*f)/2,d=(t-(u.max-u.min)*f)/2,p={},y=0;y<n.length;++y){var m=n[y];p[a[y]]={radius:f*m.radius,x:i+v+(m.x-l.min)*f,y:i+d+(m.y-u.min)*f}}return p}var vN=ga(function(r,e,t,i){var n=new Map,a=r.length;return e.forEach(function(o,s){if(o[i].length===1)n.set(o[cr],r[(s+a)%a]);else{var l=o[i].map(function(u){return n.get(u)});n.set(o[cr],l.slice(1).reduce(function(u,c){return UR(u,c,t)},l[0]))}}),n},function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return JSON.stringify(r)});function dN(r,e,t,i){i===void 0&&(i=0);var n=r.data,a=r.setsField,o=r.sizeField;if(n.length===0)return dr(Oe.WARN,!1,"warn: %s","数据不能为空"),[];var s=n.map(function(h){var f;return g.__assign(g.__assign({},h),(f={sets:h[a]||[],size:h[o]},f[ku]="",f[cr]="",f))});s.sort(function(h,f){return h.sets.length-f.sets.length});var l=nN(s),u=fN(l,e,t,i),c=eN(u,s);return s.forEach(function(h){var f=h.sets,v=f.join(",");h[cr]=v;var d=f.map(function(m){return u[m]}),p=iN(d);/[zZ]$/.test(p)||(p+=" Z"),h[ku]=p;var y=c[v]||{x:0,y:0};ft(h,y)}),s}function gN(r,e){for(var t=0;t<e.length;t++)if(!r.includes(e[t]))return!1;return!0}var pN=40;function dx(r,e,t){var i=r.chart,n=r.options,a=n.blendMode,o=n.setsField,s=i.getTheme(),l=s.colors10,u=s.colors20,c=t;O(c)||(c=e.filter(function(f){return f[o].length===1}).length<=10?l:u);var h=vN(c,e,a,o);return function(f){return h.get(f)||c[0]}}function yN(r,e){var t=r.options,i=t.color;if(typeof i!="function"){var n=typeof i=="string"?[i]:i,a=dx(r,e,n);return function(o){return a(o[cr])}}return i}function mN(r){var e=r.chart,t=r.options,i=t.legend,n=t.appendPadding,a=t.padding,o=Rr(n);return i!==!1&&(o=Ds(n,M(i,"position"),pN)),e.appendPadding=Qc([o,a]),r}function xN(r){var e=r.options,t=e.data;t||(dr(Oe.WARN,!1,"warn: %s","数据不能为空"),t=[]);var i=t.filter(function(a){return a.sets.length===1}).map(function(a){return a.sets[0]}),n=t.filter(function(a){var o=a.sets;return gN(i,o)});return Lt(n,t)||dr(Oe.WARN,!1,"warn: %s","交集中不能出现不存在的集合, 请输入合法数据"),Y({},r,{options:{data:n}})}function wN(r){var e=r.chart,t=r.options,i=t.pointStyle,n=t.setsField,a=t.sizeField,o=Rr(e.appendPadding),s=o[0],l=o[1],u=o[2],c=o[3],h={offsetX:c,offsetY:s},f=e.viewBBox,v=f.width,d=f.height,p=dN(t,Math.max(v-(l+c),0),Math.max(d-(s+u),0),0);e.data(p);var y=rh(L({},r,{options:{xField:"x",yField:"y",sizeField:a,seriesField:cr,rawFields:[n,a],schema:{shape:"venn",style:i}}})).ext,m=y.geometry;m.customInfo(h);var x=yN(r,p);return typeof x=="function"&&m.color(cr,function(_){var w=p.find(function(C){return C[cr]===_}),b=dx(r,p)(_);return x(w,b)}),r}function _N(r){var e=r.chart,t=r.options,i=t.label,n=Rr(e.appendPadding),a=n[0],o=n[3],s={offsetX:o,offsetY:a},l=$t(e,"schema");if(!i)l.label(!1);else{var u=i.callback,c=g.__rest(i,["callback"]);l.label({fields:["id"],callback:u,cfg:Y({},Ot(c),{type:"venn",customLabelInfo:s})})}return r}function bN(r){var e=r.chart,t=r.options,i=t.legend,n=t.sizeField;return e.legend(cr,i),e.legend(n,!1),r}function SN(r){var e=r.chart;return e.axis(!1),r}function CN(r){var e=r.options,t=r.chart,i=e.interactions;if(i){var n={"legend-active":"venn-legend-active","legend-highlight":"venn-legend-highlight"};wt(L({},r,{options:{interactions:i.map(function(a){return g.__assign(g.__assign({},a),{type:n[a.type]||a.type})})}}))}return t.removeInteraction("legend-active"),t.removeInteraction("legend-highlight"),r}function MN(r){return j(mN,ot,xN,wN,_N,Mt({}),bN,SN,Pt,CN,vt)(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="venn",t}return e.getDefaultOptions=function(){return IR},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return MN},e.prototype.triggerResize=function(){this.chart.destroyed||(this.chart.forceFit(),this.chart.clear(),this.execAdaptor(),this.chart.render(!0))},e})(et);var we="x",ri="violinY",AN="violinSize",gx="minMax",px="quantile",yx="median",_h="violin_view",FN="min_max_view",TN="quantile_view",EN="median_view",kN=L({},et.getDefaultOptions(),{syncViewPadding:!0,kde:{type:"triangular",sampleSize:32,width:3},violinStyle:{lineWidth:1,fillOpacity:.3,strokeOpacity:.75},xAxis:{grid:{line:null},tickLine:{alignTick:!1}},yAxis:{grid:{line:{style:{lineWidth:.5,lineDash:[4,4]}}}},legend:{position:"top-left"},tooltip:{showMarkers:!1}}),Ou={},LN={get exports(){return Ou},set exports(r){Ou=r}},Ru={},IN={get exports(){return Ru},set exports(r){Ru=r}};(function(r){var e=r.exports;r.exports.isNumber=function(t){return typeof t=="number"},r.exports.findMin=function(t){if(t.length===0)return 1/0;for(var i=t[0],n=1;n<t.length;n++)i=Math.min(i,t[n]);return i},r.exports.findMax=function(t){if(t.length===0)return-1/0;for(var i=t[0],n=1;n<t.length;n++)i=Math.max(i,t[n]);return i},r.exports.findMinMulti=function(t){for(var i=e.findMin(t[0]),n=1;n<t.length;n++)i=Math.min(i,e.findMin(t[n]));return i},r.exports.findMaxMulti=function(t){for(var i=e.findMax(t[0]),n=1;n<t.length;n++)i=Math.max(i,e.findMax(t[n]));return i},r.exports.inside=function(t,i,n){return t<=n&&n<=i}})(IN);(function(r){var e=50,t=2,i=Math.log(2),n=r.exports,a=Ru;function o(l){return 1-Math.abs(l)}r.exports.getUnifiedMinMax=function(l,u){return n.getUnifiedMinMaxMulti([l],u)},r.exports.getUnifiedMinMaxMulti=function(l,u){u=u||{};var c=!1,h=!1,f=a.isNumber(u.width)?u.width:t,v=a.isNumber(u.size)?u.size:e,d=a.isNumber(u.min)?u.min:(c=!0,a.findMinMulti(l)),p=a.isNumber(u.max)?u.max:(h=!0,a.findMaxMulti(l)),y=p-d,m=y/(v-1);return c&&(d=d-2*f*m),h&&(p=p+2*f*m),{min:d,max:p}},r.exports.create=function(l,u){if(u=u||{},!l||l.length===0)return[];var c=a.isNumber(u.size)?u.size:e,h=a.isNumber(u.width)?u.width:t,f=n.getUnifiedMinMax(l,{size:c,width:h,min:u.min,max:u.max}),v=f.min,d=f.max,p=d-v,y=p/(c-1);if(p===0)return[{x:v,y:1}];for(var m=[],x=0;x<c;x++)m.push({x:v+x*y,y:0});var _=function(k){return Math.floor((k-v)/y)},w=s(o,h),b=w[h],C=w[h-1]-w[h-2],A=0;l.forEach(function(k){var P=_(k);if(!(P+h<0||P-h>=m.length)){var B=Math.max(P-h,0),z=P,X=Math.min(P+h,m.length-1),I=B-(P-h),R=P+h-X,$=w[-h-1+I]||0,G=w[-h-1+R]||0,V=b/(b-$-G);I>0&&(A+=V*(I-1)*C);var H=Math.max(0,P-h+1);a.inside(0,m.length-1,H)&&(m[H].y+=V*1*C),a.inside(0,m.length-1,z+1)&&(m[z+1].y-=V*2*C),a.inside(0,m.length-1,X+1)&&(m[X+1].y+=V*1*C)}});var F=A,E=0,T=0;return m.forEach(function(k){E+=k.y,F+=E,k.y=F,T+=F}),T>0&&m.forEach(function(k){k.y/=T}),m};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<l.length&&(h=f,c+=l[f].y,!(c>=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)}}})(LN);const PN=Ou;function Xd(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 _n(r,e,t){var i=r[e];r[e]=r[t],r[t]=i}function wo(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));wo(r,e,u,c)}var h=r[e],f=t,v=i;for(_n(r,t,e),r[i]>h&&_n(r,t,i);f<v;){for(_n(r,f,v),f++,v--;r[f]<h;)f++;for(;r[v]>h;)v--}r[t]===h?_n(r,t,v):(v++,_n(r,v,i)),v<=e&&(t=v+1),e<=v&&(i=v-1)}}function bn(r,e){var t=r.slice();if(Array.isArray(e)){DN(t,e);for(var i=[],n=0;n<e.length;n++)i[n]=Xd(t,e[n]);return i}else{var a=xx(t.length,e);return mx(t,a,0,t.length-1),Xd(t,e)}}function mx(r,e,t,i){e%1===0?wo(r,e,t,i):(e=Math.floor(e),wo(r,e,t,i),wo(r,e+1,e+1,i))}function DN(r,e){for(var t=[0],i=0;i<e.length;i++)t.push(xx(r.length,e[i]));t.push(r.length-1),t.sort(BN);for(var n=[0,t.length-1];n.length;){var a=Math.ceil(n.pop()),o=Math.floor(n.pop());if(!(a-o<=1)){var s=Math.floor((o+a)/2);mx(r,t[s],Math.floor(t[o]),Math.ceil(t[a])),n.push(o,s,s,a)}}}function BN(r,e){return r-e}function xx(r,e){var t=r*e;return e===1?r-1:e===0?0:t%1!==0?Math.ceil(t)-1:r%2===0?t-.5:t}var Wd=function(r){return{low:Pe(r),high:Se(r),q1:bn(r,.25),q3:bn(r,.75),median:bn(r,[.5]),minMax:[Pe(r),Se(r)],quantile:[bn(r,.25),bn(r,.75)]}},qd=function(r,e){var t=PN.create(r,e);return{violinSize:t.map(function(i){return i.y}),violinY:t.map(function(i){return i.x})}},wx=function(r){var e=r.xField,t=r.yField,i=r.seriesField,n=r.data,a=r.kde,o={min:a.min,max:a.max,size:a.sampleSize,width:a.width};if(!i){var s=be(n,e);return Object.keys(s).map(function(c){var h=s[c],f=h.map(function(v){return v[t]});return g.__assign(g.__assign({x:c},qd(f,o)),Wd(f))})}var l=[],u=be(n,i);return Object.keys(u).forEach(function(c){var h=be(u[c],e);return Object.keys(h).forEach(function(f){var v,d=h[f],p=d.map(function(y){return y[t]});l.push(g.__assign(g.__assign((v={x:f},v[i]=c,v),qd(p,o)),Wd(p)))})}),l},_o=["low","high","q1","q3","median"],bo=[{type:"dodge",marginRatio:1/32}];function ON(r){var e=r.chart,t=r.options;return e.data(wx(t)),r}function RN(r){var e=r.chart,t=r.options,i=t.seriesField,n=t.color,a=t.shape,o=a===void 0?"violin":a,s=t.violinStyle,l=t.tooltip,u=t.state,c=e.createView({id:_h});return uk({chart:c,options:{xField:we,yField:ri,seriesField:i||we,sizeField:AN,tooltip:g.__assign({fields:_o},l),violin:{style:s,color:n,shape:o},state:u}}),c.geometries[0].adjust(bo),r}function NN(r){var e=r.chart,t=r.options,i=t.seriesField,n=t.color,a=t.tooltip,o=t.box;if(o===!1)return r;var s=e.createView({id:FN});Ht({chart:s,options:{xField:we,yField:gx,seriesField:i||we,tooltip:g.__assign({fields:_o},a),state:typeof o=="object"?o.state:{},interval:{color:n,size:1,style:{lineWidth:0}}}}),s.geometries[0].adjust(bo);var l=e.createView({id:TN});Ht({chart:l,options:{xField:we,yField:px,seriesField:i||we,tooltip:g.__assign({fields:_o},a),state:typeof o=="object"?o.state:{},interval:{color:n,size:8,style:{fillOpacity:1}}}}),l.geometries[0].adjust(bo);var u=e.createView({id:EN});return pe({chart:u,options:{xField:we,yField:yx,seriesField:i||we,tooltip:g.__assign({fields:_o},a),state:typeof o=="object"?o.state:{},point:{color:n,size:1,style:{fill:"white",lineWidth:0}}}}),u.geometries[0].adjust(bo),l.axis(!1),s.axis(!1),u.axis(!1),u.legend(!1),s.legend(!1),l.legend(!1),r}function zN(r){var e,t=r.chart,i=r.options,n=i.meta,a=i.xAxis,o=i.yAxis,s={},l=L(s,n,(e={},e[we]=g.__assign(g.__assign({sync:!0},ct(a,ne)),{type:"cat"}),e[ri]=g.__assign({sync:!0},ct(o,ne)),e[gx]=g.__assign({sync:ri},ct(o,ne)),e[px]=g.__assign({sync:ri},ct(o,ne)),e[yx]=g.__assign({sync:ri},ct(o,ne)),e));return t.scale(l),r}function VN(r){var e=r.chart,t=r.options,i=t.xAxis,n=t.yAxis,a=nt(e,_h);return i===!1?a.axis(we,!1):a.axis(we,i),n===!1?a.axis(ri,!1):a.axis(ri,n),e.axis(!1),r}function GN(r){var e=r.chart,t=r.options,i=t.legend,n=t.seriesField,a=t.shape;if(i===!1)e.legend(!1);else{var o=n||we,s=Ko(i,["selected"]);(!a||!a.startsWith("hollow"))&&(M(s,["marker","style","lineWidth"])||Et(s,["marker","style","lineWidth"],0)),e.legend(o,s),M(i,"selected")&&S(e.views,function(l){return l.legend(o,i)})}return r}function YN(r){var e=r.chart,t=nt(e,_h);return St()(g.__assign(g.__assign({},r),{chart:t})),r}function $N(r){var e=r.chart,t=r.options,i=t.animation;return S(e.views,function(n){Aa(n,i)}),r}function HN(r){return j(ot,ON,RN,NN,zN,Pt,VN,GN,wt,YN,$N)(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="violin",t}return e.getDefaultOptions=function(){return kN},e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(wx(this.options))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return HN},e})(et);var _e="$$yField$$",Zs="$$diffField$$",bh="$$absoluteField$$",Nu="$$isTotal$$",XN={label:{},leaderLine:{style:{lineWidth:1,stroke:"#8c8c8c",lineDash:[4,2]}},total:{style:{fill:"rgba(0, 0, 0, 0.25)"}},interactions:[{type:"element-active"}],risingFill:"#f4664a",fallingFill:"#30bf78",waterfallStyle:{fill:"rgba(0, 0, 0, 0.25)"},yAxis:{grid:{line:{style:{lineDash:[4,2]}}}}};function WN(r){for(var e=[],t=0;t<r.length;t++){var i=r[t];if(i){var n=t===0?"M":"L";e.push([n,i.x,i.y])}}var a=r[0];return e.push(["L",a.x,a.y]),e.push(["z"]),e}function qN(r){return L({},r.defaultStyle,r.style,{fill:r.color})}lt("interval","waterfall",{draw:function(r,e){var t=r.customInfo,i=r.points,n=r.nextPoints,a=e.addGroup(),o=this.parsePath(WN(i)),s=qN(r);a.addShape("path",{attrs:g.__assign(g.__assign({},s),{path:o})});var l=M(t,"leaderLine");if(l&&n){var u=[["M",i[2].x,i[2].y],["L",n[0].x,n[0].y]];i[2].y===n[1].y&&(u[1]=["L",n[1].x,n[1].y]),u=this.parsePath(u),a.addShape("path",{attrs:g.__assign({path:u},l.style||{})})}return a}});function UN(r,e,t,i,n){var a,o=[];if(Zt(r,function(l,u){var c;dr(Oe.WARN,tt(u[t]),"".concat(u[t]," is not a valid number"));var h=Qr(u[t])?null:u[t];return o.push(g.__assign(g.__assign({},u),(c={},c[i]=[l,l+h],c))),l+h},0),o.length&&n){var s=M(o,[[r.length-1],i,[1]]);o.push((a={},a[e]=n.label,a[t]=s,a[i]=[0,s],a))}return o}function _x(r,e,t,i){var n=UN(r,e,t,_e,i);return n.map(function(a,o){var s;return pt(a)?g.__assign(g.__assign({},a),(s={},s[bh]=a[_e][1],s[Zs]=a[_e][1]-a[_e][0],s[Nu]=o===r.length,s)):a})}function jN(r){var e=r.options,t=e.locale,i=e.total,n=Rs(t).get(["waterfall","total"]);return i&&typeof i.label!="string"&&n&&(r.options.total.label=n),r}function ZN(r){var e=r.chart,t=r.options,i=t.data,n=t.xField,a=t.yField,o=t.total,s=t.leaderLine,l=t.columnWidthRatio,u=t.waterfallStyle,c=t.risingFill,h=t.fallingFill,f=t.color,v=t.shape,d=t.customInfo;e.data(_x(i,n,a,o));var p=f||function(_){return M(_,[Nu])?M(o,["style","fill"],""):M(_,[_e,1])-M(_,[_e,0])>0?c:h},y=L({},r,{options:{xField:n,yField:_e,seriesField:n,rawFields:[a,Zs,Nu,_e],widthRatio:l,interval:{style:u,shape:v||"waterfall",color:p}}}),m=Ht(y).ext,x=m.geometry;return x.customInfo(g.__assign(g.__assign({},d),{leaderLine:s})),r}function QN(r){var e,t,i=r.options,n=i.xAxis,a=i.yAxis,o=i.xField,s=i.yField,l=i.meta,u=L({},{alias:s},M(l,s));return j(Mt((e={},e[o]=n,e[s]=a,e[_e]=a,e),L({},l,(t={},t[_e]=u,t[Zs]=u,t[bh]=u,t))))(r)}function KN(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(_e,!1)):(e.axis(o,n),e.axis(_e,n)),r}function JN(r){var e=r.chart,t=r.options,i=t.legend,n=t.total,a=t.risingFill,o=t.fallingFill,s=t.locale,l=Rs(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:L({},{r:5},M(n,"style"))}}),e.legend(L({},{custom:!0,position:"top",items:u},i)),e.removeInteraction("legend-filter")}return r}function tz(r){var e=r.chart,t=r.options,i=t.label,n=t.labelMode,a=t.xField,o=$t(e,"interval");if(!i)o.label(!1);else{var s=i.callback,l=g.__rest(i,["callback"]);o.label({fields:n==="absolute"?[bh,a]:[Zs,a],callback:s,cfg:Ot(l)})}return r}function ez(r){var e=r.chart,t=r.options,i=t.tooltip,n=t.xField,a=t.yField;if(i!==!1){e.tooltip(g.__assign({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 rz(r){return j(jN,ot,ZN,QN,KN,JN,ez,tz,Hr,wt,vt,St())(r)}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="waterfall",t}return e.getDefaultOptions=function(){return XN},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(_x(t,n,a,o))},e.prototype.getSchemaAdaptor=function(){return rz},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e})(et);var Sh="color",iz=L({},et.getDefaultOptions(),{timeInterval:2e3,legend:!1,tooltip:{showTitle:!1,showMarkers:!1,showCrosshairs:!1,fields:["text","value",Sh],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}}),nz={font:function(){return"serif"},padding:1,size:[500,500],spiral:"archimedean",timeInterval:3e3};function az(r,e){return e=ft({},nz,e),oz(r,e)}function oz(r,e){var t=xz();["font","fontSize","fontWeight","padding","rotate","size","spiral","timeInterval","random"].forEach(function(l){D(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 Rl=Math.PI/180,kn=1<<11>>5,So=1<<11;function sz(r){return r.text}function lz(){return"serif"}function Ud(){return"normal"}function uz(r){return r.value}function cz(){return~~(Math.random()*2)*90}function hz(){return 1}function fz(r,e,t,i){if(!e.sprite){var n=r.context,a=r.ratio;n.clearRect(0,0,(kn<<5)/a,So/a);var o=0,s=0,l=0,u=t.length;for(--i;++i<u;){e=t[i],n.save(),n.font=e.style+" "+e.weight+" "+~~((e.size+1)/a)+"px "+e.font;var c=n.measureText(e.text+"m").width*a,h=e.size<<1;if(e.rotate){var f=Math.sin(e.rotate*Rl),v=Math.cos(e.rotate*Rl),d=c*v,p=c*f,y=h*v,m=h*f;c=Math.max(Math.abs(d+m),Math.abs(d-m))+31>>5<<5,h=~~Math.max(Math.abs(p+y),Math.abs(p-y))}else c=c+31>>5<<5;if(h>l&&(l=h),o+c>=kn<<5&&(o=0,s+=l,l=0),s+h>=So)break;n.translate((o+(c>>1))/a,(s+(h>>1))/a),e.rotate&&n.rotate(e.rotate*Rl),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,(kn<<5)/a,So/a).data,_=[];--i>=0;)if(e=t[i],!!e.hasText){for(var c=e.width,w=c>>5,h=e.y1-e.y0,b=0;b<h*w;b++)_[b]=0;if(o=e.xoff,o==null)return;s=e.yoff;for(var C=0,A=-1,F=0;F<h;F++){for(var b=0;b<c;b++){var E=w*F+(b>>5),T=x[(s+F)*(kn<<5)+(o+b)<<2]?1<<31-b%32:0;_[E]|=T,C|=T}C?A=F:(e.y0++,h--,F--,s++)}e.y1=e.y0+A,e.sprite=_.slice(0,(e.y1-e.y0)*w)}}}function vz(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<l;h++){c=0;for(var f=0;f<=n;f++)if((c<<s|(f<n?(c=i[h*n+f])>>>o:0))&e[u+f])return!0;u+=t}return!1}function dz(r,e){var t=r[0],i=r[1];e.x+e.x0<t.x&&(t.x=e.x+e.x0),e.y+e.y0<t.y&&(t.y=e.y+e.y0),e.x+e.x1>i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function gz(r,e){return r.x+r.x1>e[0].x&&r.x+r.x0<e[1].x&&r.y+r.y1>e[0].y&&r.y+r.y0<e[1].y}function bx(r){var e=r[0]/r[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function pz(r){var e=4,t=e*r[0]/r[1],i=0,n=0;return function(a){var o=a<0?-1:1;switch(Math.sqrt(1+4*o*a)-o&3){case 0:i+=t;break;case 1:n+=e;break;case 2:i-=t;break;default:n-=e;break}return[i,n]}}function jd(r){for(var e=[],t=-1;++t<r;)e[t]=0;return e}function yz(){return document.createElement("canvas")}function Ge(r){return W(r)?r:function(){return r}}var mz={archimedean:bx,rectangular:pz};function xz(){var r=[256,256],e=lz,t=uz,i=Ud,n=cz,a=hz,o=bx,s=Math.random,l=[],u=1/0,c=sz,h=Ud,f=yz,v={};v.start=function(){var y=r[0],m=r[1],x=d(f()),_=v.board?v.board:jd((r[0]>>5)*r[1]),w=l.length,b=[],C=l.map(function(T,k,P){return T.text=c.call(this,T,k,P),T.font=e.call(this,T,k,P),T.style=h.call(this,T,k,P),T.weight=i.call(this,T,k,P),T.rotate=n.call(this,T,k,P),T.size=~~t.call(this,T,k,P),T.padding=a.call(this,T,k,P),T}).sort(function(T,k){return k.size-T.size}),A=-1,F=v.board?[{x:0,y:0},{x:y,y:m}]:null;E();function E(){for(var T=Date.now();Date.now()-T<u&&++A<w;){var k=C[A];k.x=y*(s()+.5)>>1,k.y=m*(s()+.5)>>1,fz(x,k,C,A),k.hasText&&p(_,k,F)&&(b.push(k),F?v.hasImage||dz(F,k):F=[{x:k.x+k.x0,y:k.y+k.y0},{x:k.x+k.x1,y:k.y+k.y1}],k.x-=r[0]>>1,k.y-=r[1]>>1)}v._tags=b,v._bounds=F}return v};function d(y){y.width=y.height=1;var m=Math.sqrt(y.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,1,1).data.length>>2);y.width=(kn<<5)/m,y.height=So/m;var x=y.getContext("2d",{willReadFrequently:!0});return x.fillStyle=x.strokeStyle="red",x.textAlign="center",{context:x,ratio:m}}function p(y,m,x){for(var _=m.x,w=m.y,b=Math.sqrt(r[0]*r[0]+r[1]*r[1]),C=o(r),A=s()<.5?1:-1,F,E=-A,T,k;(F=C(E+=A))&&(T=~~F[0],k=~~F[1],!(Math.min(Math.abs(T),Math.abs(k))>=b));)if(m.x=_+T,m.y=w+k,!(m.x+m.x0<0||m.y+m.y0<0||m.x+m.x1>r[0]||m.y+m.y1>r[1])&&(!x||!vz(m,y,r[0]))&&(!x||gz(m,x))){for(var P=m.sprite,B=m.width>>5,z=r[0]>>5,X=m.x-(B<<4),I=X&127,R=32-I,$=m.y1-m.y0,G=void 0,V=(m.y+m.y0)*z+(X>>5),H=0;H<$;H++){G=0;for(var Z=0;Z<=B;Z++)y[V+Z]|=G<<R|(Z<B?(G=P[H*B+Z])>>>I:0);V+=z}return delete m.sprite,!0}return!1}return v.createMask=function(y){var m=document.createElement("canvas"),x=r[0],_=r[1];if(!(!x||!_)){var w=x>>5,b=jd((x>>5)*_);m.width=x,m.height=_;var C=m.getContext("2d");C.drawImage(y,0,0,y.width,y.height,0,0,x,_);for(var A=C.getImageData(0,0,x,_).data,F=0;F<_;F++)for(var E=0;E<x;E++){var T=w*F+(E>>5),k=F*x+E<<2,P=A[k]>=250&&A[k+1]>=250&&A[k+2]>=250,B=P?1<<31-E%32:0;b[T]|=B}v.board=b,v.hasImage=!0}},v.timeInterval=function(y){u=y??1/0},v.words=function(y){l=y},v.size=function(y){r=[+y[0],+y[1]]},v.font=function(y){e=Ge(y)},v.fontWeight=function(y){i=Ge(y)},v.rotate=function(y){n=Ge(y)},v.spiral=function(y){o=mz[y]||y},v.fontSize=function(y){t=Ge(y)},v.padding=function(y){a=Ge(y)},v.random=function(y){s=Ge(y)},v}function Sx(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,y=e.random,m=e.spiral,x=e.autoFit,_=x===void 0?!0:x,w=e.placementStrategy;if(!u||!u.length)return[];var b=d.fontFamily,C=d.fontWeight,A=d.padding,F=d.fontSize,E=Cz(u,f),T=[Fz(E),Tz(E)],k=u.map(function(z){return{text:z[h],value:z[f],color:z[v],datum:z}}),P={imageMask:c,font:b,fontSize:Sz(F,T),fontWeight:C,size:wz({width:n,height:a,padding:o,appendPadding:s,autoFit:_,container:l}),padding:A,timeInterval:p,random:y,spiral:m,rotate:Mz(e)};if(W(w)){var B=k.map(function(z,X,I){return g.__assign(g.__assign(g.__assign({},z),{hasText:!!z.text,font:Ge(P.font)(z,X,I),weight:Ge(P.fontWeight)(z,X,I),rotate:Ge(P.rotate)(z,X,I),size:Ge(P.fontSize)(z,X,I),style:"normal"}),w.call(t,z,X,I))});return B.push({text:"",value:0,x:0,y:0,opacity:0}),B.push({text:"",value:0,x:P.size[0],y:P.size[1],opacity:0}),B}return az(k,P)}function wz(r){var e=r.width,t=r.height,i=r.container,n=r.autoFit,a=r.padding,o=r.appendPadding;if(n){var s=Su(i);e=s.width,t=s.height}e=e||400,t=t||400;var l=_z({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 _z(r){var e=Rr(r.padding),t=Rr(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 bz(r){return new Promise(function(e,t){if(r instanceof HTMLImageElement){e(r);return}if(K(r)){var i=new Image;i.crossOrigin="anonymous",i.src=r,i.onload=function(){e(i)},i.onerror=function(){dr(Oe.ERROR,!1,"image %s load failed !!!",r),t()};return}dr(Oe.WARN,r===void 0,"The type of imageMask option must be String or HTMLImageElement."),t()})}function Sz(r,e){if(W(r))return r;if(O(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 Cz(r,e){return r.map(function(t){return t[e]}).filter(function(t){return typeof t=="number"&&!isNaN(t)})}function Mz(r){var e=Az(r),t=e.rotation,i=e.rotationSteps;if(!O(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 Az(r){var e=r.wordStyle.rotationSteps;return e<1&&(dr(Oe.WARN,!1,"The rotationSteps option must be greater than or equal to 1."),e=1),{rotation:r.wordStyle.rotation,rotationSteps:e}}function Fz(r){return Math.min.apply(Math,r)}function Tz(r){return Math.max.apply(Math,r)}function Ez(r){var e=r.chart,t=r.options,i=t.colorField,n=t.color,a=Sx(r);e.data(a);var o=L({},r,{options:{xField:"x",yField:"y",seriesField:i&&Sh,rawFields:W(n)&&g.__spreadArray(g.__spreadArray([],M(t,"rawFields",[]),!0),["datum"],!1),point:{color:n,shape:"word-cloud"}}}),s=pe(o).ext;return s.geometry.label(!1),e.coordinate().reflect("y"),e.axis(!1),r}function kz(r){return j(Mt({x:{nice:!1},y:{nice:!1}}))(r)}function Lz(r){var e=r.chart,t=r.options,i=t.legend,n=t.colorField;return i===!1?e.legend(!1):n&&e.legend(Sh,i),r}function Iz(r){j(Ez,kz,Pt,Lz,wt,vt,ot,Hr)(r)}lt("point","word-cloud",{draw:function(r,e){var t=r.x,i=r.y,n=e.addShape("text",{attrs:g.__assign(g.__assign({},Pz(r)),{x:t,y:i})}),a=r.data.rotate;return typeof a=="number"&&se.rotate(n,a*Math.PI/180),n}});function Pz(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"}}(function(r){g.__extends(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="word-cloud",t}return e.getDefaultOptions=function(){return iz},e.prototype.changeData=function(t){this.updateOption({data:t}),this.options.imageMask?this.render():this.chart.changeData(Sx({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=g.__assign(g.__assign({},t.options),{imageMask:o||null}),r.prototype.render.call(t),i()};bz(n).then(a).catch(a)})},e.prototype.getSchemaAdaptor=function(){return Iz},e.prototype.triggerResize=function(){var t=this;this.chart.destroyed||(this.execAdaptor(),window.setTimeout(function(){r.prototype.triggerResize.call(t)}))},e})(et);(function(r){g.__extends(e,r);function e(t,i,n,a){var o=r.call(this,t,L({},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})(et);Em("en-US",ok);Em("zh-CN",sk);export{zk as A,cL as C,KL as L,hI as P,yI as R,aP as T};