Files
Nexus/web/app/assets/FleetTrendEChart-lgdTP3R-.js
T
2026-07-08 22:31:31 +08:00

35 lines
68 KiB
JavaScript

import{Er as e,Nr as t,Zt as n,_i as r,bi as i,pn as a,qr as o,wr as s}from"./index-CDcgx9V8.js";import{$ as c,$t as l,An as u,B as d,Bn as f,Bt as p,C as m,Cn as h,Ct as g,Dt as _,En as v,F as y,Fn as b,Ft as x,G as S,Hn as C,I as ee,In as w,It as te,Jt as T,L as ne,Ln as re,Lt as ie,M as ae,Mn as oe,Mt as se,N as ce,Nn as le,O as ue,On as E,P as de,Pn as fe,Q as pe,Qt as me,R as D,Sn as O,St as k,T as he,Tn as A,Tt as ge,U as _e,V as ve,Vn as ye,Vt as be,Xt as j,Y as xe,Yt as Se,Z as Ce,Zt as we,_ as Te,_n as Ee,_t as De,a as Oe,an as ke,at as Ae,b as je,bn as M,bt as Me,c as Ne,ct as Pe,d as Fe,dn as Ie,dt as Le,en as Re,f as ze,ft as Be,g as Ve,gn as He,hn as Ue,ht as We,i as Ge,in as Ke,it as qe,j as Je,jn as N,jt as Ye,kn as P,kt as Xe,l as Ze,ln as Qe,lt as $e,mn as et,mt as tt,n as nt,nt as rt,o as it,on as at,ot,pt as st,q as ct,r as lt,rn as ut,rt as dt,s as ft,sn as pt,st as mt,t as ht,tt as gt,u as _t,un as F,ut as vt,v as yt,vn as bt,vt as xt,w as St,wn as I,wt as Ct,x as wt,xn as Tt,xt as Et,y as L,yn as Dt,yt as Ot,z as kt,zn as At}from"./dist-DCycUQQT.js";import{a as jt,c as Mt,i as Nt,l as Pt,n as Ft,o as It,r as Lt,s as Rt,t as zt,u as Bt}from"./install-BY4V-NK4.js";import{c as Vt,p as Ht,u as Ut}from"./StatCardsRow-CdfBB9tI.js";import{t as Wt}from"./_plugin-vue_export-helper-BDNMzG2s.js";var Gt=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.getInitialData=function(e,t){return Ve(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){return this.option.progressive??(this.option.large?5e3:this.get(`progressive`))},t.prototype.getProgressiveThreshold=function(){return this.option.progressiveThreshold??(this.option.large?1e4:this.get(`progressiveThreshold`))},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:``},t.type=`series.scatter`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:D.color.primary}},universalTransition:{divideShape:`clone`}},t}(ce),Kt=4,qt=function(){function e(){}return e}(),Jt=function(e){C(t,e);function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.getDefaultShape=function(){return new qt},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.beforeBrush=function(e){e&&!e.contentRetained&&this.reset()},t.prototype.buildPath=function(e,t){var n=t.points,r=t.size,i=this.symbolProxy,a=i.shape,o=e.getContext?e.getContext():e,s=o&&r[0]<Kt,c=this.softClipShape,l;if(s){this._ctx=o;return}for(this._ctx=null,l=this._off;l<n.length;){var u=n[l++],d=n[l++];isNaN(u)||isNaN(d)||c&&!c.contain(u,d)||(a.x=u-r[0]/2,a.y=d-r[1]/2,a.width=r[0],a.height=r[1],i.buildPath(e,a,!0))}this.incremental&&(this._off=l,this.notClear=!0)},t.prototype.afterBrush=function(){var e=this.shape,t=e.points,n=e.size,r=this._ctx,i=this.softClipShape,a;if(r){for(a=this._off;a<t.length;){var o=t[a++],s=t[a++];isNaN(o)||isNaN(s)||i&&!i.contain(o,s)||r.fillRect(o-n[0]/2,s-n[1]/2,n[0],n[1])}this.incremental&&(this._off=a,this.notClear=!0)}},t.prototype.findDataIndex=function(e,t){for(var n=this.shape,r=n.points,i=n.size,a=Math.max(i[0],4),o=Math.max(i[1],4),s=r.length/2-1;s>=0;s--){var c=s*2,l=r[c]-a/2,u=r[c+1]-o/2;if(e>=l&&t>=u&&e<=l+a&&t<=u+o)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],a=r[1],o=1/0,s=1/0,c=-1/0,l=-1/0,u=0;u<n.length;){var d=n[u++],f=n[u++];o=Math.min(d,o),c=Math.max(d,c),s=Math.min(f,s),l=Math.max(f,l)}e=this._rect=new ut(o-i/2,s-a/2,c-o+i,l-s+a)}return e},t}(ge),Yt=function(){function e(){this.group=new j}return e.prototype.updateData=function(e,t){this._clear(),this._data=e;var n=this._create();n.setShape({points:e.getLayout(`points`)}),this._setCommon(n,e,t)},e.prototype.updateLayout=function(e){var t=this._data;if(t){var n=t.getLayout(`points`);this.group.eachChild(function(e){if(e.startIndex!=null){var t=(e.endIndex-e.startIndex)*2,r=e.startIndex*4*2;n=new Float32Array(n.buffer,r,t)}e.setShape(`points`,n),e.reset(),e.stopAnimation()})}},e.prototype.incrementalPrepareUpdate=function(e){this._clear()},e.prototype.incrementalUpdate=function(e,t,n,r){var i=this._newAdded[0],a=t.getLayout(`points`),o=i&&i.shape.points;if(o&&o.length<2e4){var s=o.length,c=new Float32Array(s+a.length);c.set(o),c.set(a,s),i.endIndex=e.end,i.setShape({points:c})}else{this._newAdded=[];var l=this._create();l.startIndex=e.start,l.endIndex=e.end,l.incremental=n,l.setShape({points:a}),this._setCommon(l,t,r)}},e.prototype.eachRendered=function(e){this._newAdded[0]&&e(this._newAdded[0])},e.prototype._create=function(){var e=new Jt({cursor:`default`});return e.ignoreCoarsePointer=!0,this.group.add(e),this._newAdded.push(e),e},e.prototype._setCommon=function(e,t,n){var r=t.hostModel;n||={};var i=t.getVisual(`symbolSize`);e.setShape(`size`,i instanceof Array?i:[i,i]),e.softClipShape=n.clipShape||null,e.symbolProxy=m(t.getVisual(`symbol`),0,0,0,0),e.setColor=e.symbolProxy.setColor;var a=e.shape.size[0]<Kt;e.useStyle(r.getModel(`itemStyle`).getItemStyle(a?[`color`,`shadowBlur`,`shadowColor`]:[`color`]));var o=t.getVisual(`style`),s=o&&o.fill;s&&e.setColor(s);var c=k(e);c.seriesIndex=r.seriesIndex,e.on(`mousemove`,function(t){c.dataIndex=null;var n=e.hoverDataIdx;n>=0&&(c.dataIndex=n+(e.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),Xt=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).updateData(r,Zt(e)),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).incrementalPrepareUpdate(r),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),Ye(t),Zt(t)),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var r=e.getData();if(this.group.dirty(),this._finished){var i=ft(``).reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(Zt(e))}else return{update:!0}},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,r=t.pipelineContext.large;return(!n||r!==this._isLargeDraw)&&(n&&n.remove(),n=this._symbolDraw=r?new Yt:new _t,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type=`scatter`,t}(Je);function Zt(e){return{clipShape:Ze(e)}}function Qt(e){ze(Ge),e.registerSeriesModel(Gt),e.registerChartView(Xt),e.registerLayout(ft(`scatter`))}function R(e){return e}var $t=`view`;(function(e){C(t,e);function t(t,n,r){var i=e.call(this)||this;i.type=$t,i.dimensions=[`x`,`y`];var a=R(i);a.invertY=t,a.lgCt=n,a.lgGeo=r;var o=a.trans=[];return o[0]=l(),o[1]=l(),o[2]=l(),a.mtRaw=F(),a.mtRawInv=F(),a.mtOverall=F(),a.mtOverallInv=F(),a.zoom=1,i}return t.prototype.getBoundingRect=function(){return tn(null,this)},t.prototype.getViewRect=function(){return nn(null,this)},t.prototype.getRoamTransform=function(){return Re(R(this).trans[1])},t.prototype.dataToPoint=function(e,t,n){var r=t?R(this).mtRaw:R(this).mtOverall;return n||=[],r?Ue(n,e,r):He(n,e)},t.prototype.pointToData=function(e,t,n){n||=[];var r=R(this).mtOverallInv;return r?Ue(n,e,r):He(n,e)},t.prototype.convertToPixel=function(e,t,n){var r=rn(t);return r===this?r.dataToPoint(n):null},t.prototype.convertFromPixel=function(e,t,n){var r=rn(t);return r===this?r.pointToData(n):null},t.prototype.containPoint=function(e){var t=R(this);return at(z,t.dataRect),Ke(z,z,t.mtOverall),ke(z,e[0],e[1])},t.dimensions=[`x`,`y`],t})(me);var z=pt();function en(e,t){return Qe(e||[],R(t).mtOverall)}function tn(e,t){return at(e||pt(),R(t).dataRect)}function nn(e,t){return at(e||pt(),R(t).viewRect)}F(),F(),pt(),F(),F();function rn(e){var t=e.seriesModel;return t?t.coordinateSystem:null}l(),l();var an=Be.prototype,on=Le.prototype,sn=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return e}();(function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t})(sn);function cn(e){return isNaN(+e.cpx1)||isNaN(+e.cpy1)}var ln=function(e){C(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-line`,n}return t.prototype.getDefaultStyle=function(){return{stroke:D.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new sn},t.prototype.buildPath=function(e,t){cn(t)?an.buildPath.call(this,e,t):on.buildPath.call(this,e,t)},t.prototype.pointAt=function(e){return cn(this.shape)?an.pointAt.call(this,e):on.pointAt.call(this,e)},t.prototype.tangentAt=function(e){var t=this.shape,n=cn(t)?[t.x2-t.x1,t.y2-t.y1]:on.tangentAt.call(this,e);return Ee(n,n)},t}(ge),un=[`fromSymbol`,`toSymbol`];function dn(e){return`_`+e+`Type`}function fn(e,t,n){var r=t.getItemVisual(n,e);if(!r||r===`none`)return r;var i=t.getItemVisual(n,e+`Size`),a=t.getItemVisual(n,e+`Rotate`),o=t.getItemVisual(n,e+`Offset`),s=t.getItemVisual(n,e+`KeepAspect`),c=he(i),l=St(o||0,c);return r+c+l+(a||``)+(s||``)}function pn(e,t,n){var r=t.getItemVisual(n,e);if(!(!r||r===`none`)){var i=t.getItemVisual(n,e+`Size`),a=t.getItemVisual(n,e+`Rotate`),o=t.getItemVisual(n,e+`Offset`),s=t.getItemVisual(n,e+`KeepAspect`),c=he(i),l=St(o||0,c),u=m(r,-c[0]/2+l[0],-c[1]/2+l[1],c[0],c[1],null,s);return u.__specifiedRotation=a==null||isNaN(a)?void 0:+a*Math.PI/180||0,u.name=e,u}}function mn(e){var t=new ln({name:`line`,subPixelOptimize:!0});return hn(t.shape,e),t}function hn(e,t){e.x1=t[0][0],e.y1=t[0][1],e.x2=t[1][0],e.y2=t[1][1],e.percent=1;var n=t[2];n?(e.cpx1=n[0],e.cpy1=n[1]):(e.cpx1=NaN,e.cpy1=NaN)}var gn=function(e){C(t,e);function t(t,n,r){var i=e.call(this)||this;return i._createLine(t,n,r),i}return t.prototype._createLine=function(e,t,n){var r=e.hostModel,i=e.getItemLayout(t),a=e.getItemVisual(t,`z2`),o=mn(i);o.shape.percent=0,$e(o,{z2:f(a,0),shape:{percent:1}},r,t),this.add(o),I(un,function(n){var r=pn(n,e,t);this.add(r),this[dn(n)]=fn(n,e,t)},this),this._updateCommonStl(e,t,n)},t.prototype.updateData=function(e,t,n){var r=e.hostModel,i=this.childOfName(`line`),a=e.getItemLayout(t),o={shape:{}};hn(o.shape,a),vt(i,o,r,t),I(un,function(n){var r=fn(n,e,t),i=dn(n);if(this[i]!==r){this.remove(this.childOfName(n));var a=pn(n,e,t);this.add(a)}this[i]=r},this),this._updateCommonStl(e,t,n)},t.prototype.getLinePath=function(){return this.childAt(0)},t.prototype._updateCommonStl=function(e,t,n){var r=e.hostModel,i=this.childOfName(`line`),a=n&&n.emphasisLineStyle,o=n&&n.blurLineStyle,s=n&&n.selectLineStyle,l=n&&n.labelStatesModels,u=n&&n.emphasisDisabled,d=n&&n.focus,f=n&&n.blurScope;if(!n||e.hasItemOption){var p=e.getItemModel(t),m=p.getModel(`emphasis`);a=m.getModel(`lineStyle`).getLineStyle(),o=p.getModel([`blur`,`lineStyle`]).getLineStyle(),s=p.getModel([`select`,`lineStyle`]).getLineStyle(),u=m.get(`disabled`),d=m.get(`focus`),f=m.get(`blurScope`),l=pe(p)}var h=e.getItemVisual(t,`style`),g=h.stroke;i.useStyle(h),i.style.fill=null,i.style.strokeNoScale=!0,i.ensureState(`emphasis`).style=a,i.ensureState(`blur`).style=o,i.ensureState(`select`).style=s,I(un,function(e){var t=this.childOfName(e);if(t){t.setColor(g),t.style.opacity=h.opacity;for(var n=0;n<We.length;n++){var r=We[n],a=i.getState(r);if(a){var o=a.style||{},s=t.ensureState(r),c=s.style||={};o.stroke!=null&&(c[t.__isEmptyBrush?`stroke`:`fill`]=o.stroke),o.opacity!=null&&(c.opacity=o.opacity)}}t.markRedraw()}},this);var _=r.getRawValue(t);c(this,l,{labelDataIndex:t,labelFetcher:{getFormattedLabel:function(t,n){return r.getFormattedLabel(t,n,e.dataType)}},inheritColor:g||D.color.neutral99,defaultOpacity:h.opacity,defaultText:(_==null?e.getName(t):isFinite(_)?Se(_,10):_)+``});var v=this.getTextContent();if(v){var y=l.normal;v.__align=v.style.align,v.__verticalAlign=v.style.verticalAlign,v.__position=y.get(`position`)||`middle`;var b=y.get(`distance`);P(b)||(b=[b,b]),v.__labelDistance=b}this.setTextConfig({position:null,local:!0,inside:!1}),Et(this,d,f,u)},t.prototype.highlight=function(){xt(this)},t.prototype.downplay=function(){Me(this)},t.prototype.updateLayout=function(e,t){this.childOfName(`line`).stopAnimation(),this.setLinePoints(e.getItemLayout(t))},t.prototype.setLinePoints=function(e){var t=this.childOfName(`line`);hn(t.shape,e),t.dirty()},t.prototype.beforeUpdate=function(){var e=this,t=e.childOfName(`fromSymbol`),n=e.childOfName(`toSymbol`),r=e.getTextContent();if(!t&&!n&&(!r||r.ignore))return;for(var i=1,a=this.parent;a;)a.scaleX&&(i/=a.scaleX),a=a.parent;var o=e.childOfName(`line`);if(!this.__dirty&&!o.__dirty)return;var s=o.shape.percent,c=o.pointAt(0),l=o.pointAt(s),u=bt([],l,c);Ee(u,u);function d(e,t){var n=e.__specifiedRotation;if(n==null){var r=o.tangentAt(t);e.attr(`rotation`,(t===1?-1:1)*Math.PI/2-Math.atan2(r[1],r[0]))}else e.attr(`rotation`,n)}if(t&&(t.setPosition(c),d(t,0),t.scaleX=t.scaleY=i*s,t.markRedraw()),n&&(n.setPosition(l),d(n,1),n.scaleX=n.scaleY=i*s,n.markRedraw()),r&&!r.ignore){r.x=r.y=0,r.originX=r.originY=0;var f=void 0,p=void 0,m=r.__labelDistance,h=m[0]*i,g=m[1]*i,_=s/2,v=o.tangentAt(_),y=[v[1],-v[0]],b=o.pointAt(_);y[1]>0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if(r.__position!==`start`&&r.__position!==`end`){var S=-Math.atan2(v[1],v[0]);l[0]<c[0]&&(S=Math.PI+S),r.rotation=S}var C=void 0;switch(r.__position){case`insideStartTop`:case`insideMiddleTop`:case`insideEndTop`:case`middle`:C=-g,p=`bottom`;break;case`insideStartBottom`:case`insideMiddleBottom`:case`insideEndBottom`:C=g,p=`top`;break;default:C=0,p=`middle`}switch(r.__position){case`end`:r.x=u[0]*h+l[0],r.y=u[1]*g+l[1],f=u[0]>.8?`left`:u[0]<-.8?`right`:`center`,p=u[1]>.8?`top`:u[1]<-.8?`bottom`:`middle`;break;case`start`:r.x=-u[0]*h+c[0],r.y=-u[1]*g+c[1],f=u[0]>.8?`right`:u[0]<-.8?`left`:`center`,p=u[1]>.8?`bottom`:u[1]<-.8?`top`:`middle`;break;case`insideStartTop`:case`insideStart`:case`insideStartBottom`:r.x=h*x+c[0],r.y=c[1]+C,f=v[0]<0?`right`:`left`,r.originX=-h*x,r.originY=-C;break;case`insideMiddleTop`:case`insideMiddle`:case`insideMiddleBottom`:case`middle`:r.x=b[0],r.y=b[1]+C,f=`center`,r.originY=-C;break;case`insideEndTop`:case`insideEnd`:case`insideEndBottom`:r.x=-h*x+l[0],r.y=l[1]+C,f=v[0]>=0?`right`:`left`,r.originX=h*x,r.originY=-C;break}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||p,align:r.__align||f})}},t}(j),_n=function(){function e(e){this.group=new j,this._LineCtor=e||gn}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var a=yn(e);e.diff(i).add(function(n){t._doAdd(e,n,a)}).update(function(n,r){t._doUpdate(i,e,r,n,a)}).remove(function(e){r.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=yn(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[];function r(e){!e.isGroup&&!vn(e)&&(e.incremental=n,e.ensureState(`emphasis`).hoverLayer=2)}for(var i=e.start;i<e.end;i++)if(xn(t.getItemLayout(i))){var a=new this._LineCtor(t,i,this._seriesScope);a.traverse(r),this.group.add(a),t.setItemGraphicEl(i,a),this._progressiveEls.push(a)}},e.prototype.remove=function(){this.group.removeAll()},e.prototype.eachRendered=function(e){mt(this._progressiveEls||this.group,e)},e.prototype._doAdd=function(e,t,n){if(xn(e.getItemLayout(t))){var r=new this._LineCtor(e,t,n);e.setItemGraphicEl(t,r),this.group.add(r)}},e.prototype._doUpdate=function(e,t,n,r,i){var a=e.getItemGraphicEl(n);if(!xn(t.getItemLayout(r))){this.group.remove(a);return}a?a.updateData(t,r,i):a=new this._LineCtor(t,r,i),t.setItemGraphicEl(r,a),this.group.add(a)},e}();function vn(e){return e.animators&&e.animators.length>0}function yn(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{lineStyle:t.getModel(`lineStyle`).getLineStyle(),emphasisLineStyle:n.getModel([`lineStyle`]).getLineStyle(),blurLineStyle:t.getModel([`blur`,`lineStyle`]).getLineStyle(),selectLineStyle:t.getModel([`select`,`lineStyle`]).getLineStyle(),emphasisDisabled:n.get(`disabled`),blurScope:n.get(`blurScope`),focus:n.get(`focus`),labelStatesModels:pe(t)}}function bn(e){return isNaN(e[0])||isNaN(e[1])}function xn(e){return e&&!bn(e[0])&&!bn(e[1])}var B=!0,V=Math.min,H=Math.max,Sn=Math.pow,Cn=1e4,wn=6,Tn=6,En=`globalPan`,Dn={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},On={w:`ew`,e:`ew`,n:`ns`,s:`ns`,ne:`nesw`,sw:`nesw`,nw:`nwse`,se:`nwse`},kn={brushStyle:{lineWidth:2,stroke:D.color.backgroundTint,fill:D.color.borderTint},transformable:!0,brushMode:`single`,removeOnClick:!1},An=0,jn=function(e){C(t,e);function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new j,n._uid=`brushController_`+ An++,I(sr,function(e,t){this._handlers[t]=Dt(e,this)},n),n}return t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t=this._zr;this._enableGlobalPan||Bt(t,En,this._uid),I(this._handlers,function(e,n){t.on(n,e)}),this._brushType=e.brushType,this._brushOption=w(M(kn),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;Pt(e,En,this._uid),I(this._handlers,function(t,n){e.off(n,t)}),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};I(e,function(e){t[e.panelId]=M(e)})}else this._panels=null;return this},t.prototype.mount=function(e){e||={},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){e=b(e,function(e){return w(M(kn),e,!0)});var t=`\0-brush-index-`,n=this._covers,r=this._covers=[],i=this,a=this._creatingCover;return new je(n,e,s,o).add(c).update(c).remove(l).execute(),this;function o(e,n){return(e.id==null?t+n:e.id)+`-`+e.brushType}function s(e,t){return o(e.__brushOption,t)}function c(t,o){var s=e[t];o!=null&&n[o]===a?r[t]=n[o]:In(i,r[t]=o==null?Nn(i,Mn(i,s)):(n[o].__brushOption=s,n[o]))}function l(e){n[e]!==a&&i.group.remove(n[e])}},t.prototype.unmount=function(){return this.enableBrush(!1),Bn(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(et);function Mn(e,t){var n=G[t.brushType].createCover(e,t);return n.__brushOption=t,Fn(n,t),e.group.add(n),n}function Nn(e,t){var n=Ln(t);return n.endCreating&&(n.endCreating(e,t),Fn(t,t.__brushOption)),t}function Pn(e,t){var n=t.__brushOption;Ln(t).updateCoverShape(e,t,n.range,n)}function Fn(e,t){var n=t.z;n??=Cn,e.traverse(function(e){e.z=n,e.z2=n})}function In(e,t){Ln(t).updateCommon(e,t),Pn(e,t)}function Ln(e){return G[e.__brushOption.brushType]}function Rn(e,t,n){var r=e._panels;if(!r)return B;var i,a=e._transform;return I(r,function(e){e.isTargetByCursor(t,n,a)&&(i=e)}),i}function zn(e,t){var n=e._panels;if(!n)return B;var r=t.__brushOption.panelId;return r==null?B:n[r]}function Bn(e){var t=e._covers,n=t.length;return I(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function U(e,t){var n=b(e._covers,function(e){var t=e.__brushOption,n=M(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger(`brush`,{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function Vn(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],r=t[0],i=n[0]-r[0],a=n[1]-r[1];return Sn(i*i+a*a,.5)>wn}function Hn(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function Un(e,t,n,r){var i=new j;return i.add(new Ct({name:`main`,style:Kn(n),silent:!0,draggable:!0,cursor:`move`,drift:O(Zn,e,t,i,[`n`,`s`,`w`,`e`]),ondragend:O(U,t,{isEnd:!0})})),I(r,function(n){i.add(new Ct({name:n.join(``),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:O(Zn,e,t,i,n),ondragend:O(U,t,{isEnd:!0})}))}),i}function Wn(e,t,n,r){var i=r.brushStyle.lineWidth||0,a=H(i,Tn),o=n[0][0],s=n[1][0],c=o-i/2,l=s-i/2,u=n[0][1],d=n[1][1],f=u-a+i/2,p=d-a+i/2,m=u-o,h=d-s,g=m+i,_=h+i;W(e,t,`main`,o,s,m,h),r.transformable&&(W(e,t,`w`,c,l,a,_),W(e,t,`e`,f,l,a,_),W(e,t,`n`,c,l,g,a),W(e,t,`s`,c,p,g,a),W(e,t,`nw`,c,l,a,a),W(e,t,`ne`,f,l,a,a),W(e,t,`sw`,c,p,a,a),W(e,t,`se`,f,p,a,a))}function Gn(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(Kn(n)),i.attr({silent:!r,cursor:r?`move`:`default`}),I([[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]],function(n){var i=t.childOfName(n.join(``)),a=n.length===1?Yn(e,n[0]):Xn(e,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?On[a]+`-resize`:null})})}function W(e,t,n,r,i,a,o){var s=t.childOfName(n);s&&s.setShape(tr(er(e,t,[[r,i],[r+a,i+o]])))}function Kn(e){return h({strokeNoScale:!0},e.brushStyle)}function qn(e,t,n,r){var i=[V(e,n),V(t,r)],a=[H(e,n),H(t,r)];return[[i[0],a[0]],[i[1],a[1]]]}function Jn(e){return dt(e.group)}function Yn(e,t){return{left:`w`,right:`e`,top:`n`,bottom:`s`}[ot({w:`left`,e:`right`,n:`top`,s:`bottom`}[t],Jn(e))]}function Xn(e,t){var n=[Yn(e,t[0]),Yn(e,t[1])];return(n[0]===`e`||n[0]===`w`)&&n.reverse(),n.join(``)}function Zn(e,t,n,r,i,a){var o=n.__brushOption,s=e.toRectRange(o.range),c=$n(t,i,a);I(r,function(e){var t=Dn[e];s[t[0]][t[1]]+=c[t[0]]}),o.range=e.fromRectRange(qn(s[0][0],s[1][0],s[0][1],s[1][1])),In(t,n),U(t,{isEnd:!1})}function Qn(e,t,n,r){var i=t.__brushOption.range,a=$n(e,n,r);I(i,function(e){e[0]+=a[0],e[1]+=a[1]}),In(e,t),U(e,{isEnd:!1})}function $n(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),a=r.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function er(e,t,n){var r=zn(e,t);return r&&r!==B?r.clipPath(n,e._transform):M(n)}function tr(e){var t=V(e[0][0],e[1][0]),n=V(e[0][1],e[1][1]),r=H(e[0][0],e[1][0]),i=H(e[0][1],e[1][1]);return{x:t,y:n,width:r-t,height:i-n}}function nr(e,t,n){if(!(!e._brushType||lr(e,t.offsetX,t.offsetY))){var r=e._zr,i=e._covers,a=Rn(e,t,n);if(!e._dragging)for(var o=0;o<i.length;o++){var s=i[o].__brushOption;if(a&&(a===B||s.panelId===a.panelId)&&G[s.brushType].contain(i[o],n[0],n[1]))return}a&&r.setCursorStyle(`crosshair`)}}function rr(e){var t=e.event;t.preventDefault&&t.preventDefault()}function ir(e,t,n){return e.childOfName(`main`).contain(t,n)}function ar(e,t,n,r){var i=e._creatingCover,a=e._creatingPanel,o=e._brushOption,s;if(e._track.push(n.slice()),Vn(e)||i){if(a&&!i){o.brushMode===`single`&&Bn(e);var c=M(o);c.brushType=or(c.brushType,a),c.panelId=a===B?null:a.panelId,i=e._creatingCover=Mn(e,c),e._covers.push(i)}if(i){var l=G[or(e._brushType,a)],u=i.__brushOption;u.range=l.getCreatingRange(er(e,i,e._track)),r&&(Nn(e,i),l.updateCommon(e,i)),Pn(e,i),s={isEnd:r}}}else r&&o.brushMode===`single`&&o.removeOnClick&&Rn(e,t,n)&&Bn(e)&&(s={isEnd:r,removeOnClick:!0});return s}function or(e,t){return e===`auto`?t.defaultBrushType:e}var sr={mousedown:function(e){if(this._dragging)cr(this,e);else if(!e.target||!e.target.draggable){rr(e);var t=this.group.transformCoordToLocal(e.offsetX,e.offsetY);this._creatingCover=null,(this._creatingPanel=Rn(this,e,t))&&(this._dragging=!0,this._track=[t.slice()])}},mousemove:function(e){var t=e.offsetX,n=e.offsetY,r=this.group.transformCoordToLocal(t,n);if(nr(this,e,r),this._dragging){rr(e);var i=ar(this,e,r,!1);i&&U(this,i)}},mouseup:function(e){cr(this,e)}};function cr(e,t){if(e._dragging){rr(t);var n=t.offsetX,r=t.offsetY,i=ar(e,t,e.group.transformCoordToLocal(n,r),!0);e._dragging=!1,e._track=[],e._creatingCover=null,i&&U(e,i)}}function lr(e,t,n){var r=e._zr;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var G={lineX:ur(0),lineY:ur(1),rect:{createCover:function(e,t){function n(e){return e}return Un({toRectRange:n,fromRectRange:n},e,t,[[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]])},getCreatingRange:function(e){var t=Hn(e);return qn(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){Wn(e,t,n,r)},updateCommon:Gn,contain:ir},polygon:{createCover:function(e,t){var n=new j;return n.add(new st({name:`main`,style:Kn(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new tt({name:`main`,draggable:!0,drift:O(Qn,e,t),ondragend:O(U,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:er(e,t,n)})},updateCommon:Gn,contain:ir}};function ur(e){return{createCover:function(t,n){return Un({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[[`w`],[`e`]],[[`n`],[`s`]]][e])},getCreatingRange:function(t){var n=Hn(t);return[V(n[0][e],n[1][e]),H(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var a,o=zn(t,n);if(o!==B&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var c=[r,a];e&&c.reverse(),Wn(t,n,c,i)},updateCommon:Gn,contain:ir}}function dr(e){return e=mr(e),function(t){return gt(t,e)}}function fr(e,t){return e=mr(e),function(n){var r=t??n,i=r?e.width:e.height,a=r?e.x:e.y;return[a,a+(i||0)]}}function pr(e,t,n){var r=mr(e);return function(e,i){return r.contain(i[0],i[1])&&!Mt(e,t,n)}}function mr(e){return ut.create(e)}var hr=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.select`,t}(It),gr=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.select`,t}(jt);function _r(e){e.registerComponentModel(hr),e.registerComponentView(gr),Nt(e)}var K=function(){function e(){}return e}(),vr={};function q(e,t){vr[e]=t}function yr(e){return vr[e]}var br=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t,n,r){var i=r.getTheme().get(`toolbox`),a=i?i.feature:null;a&&(this._themeFeatureOption=A({},a),i.feature={}),e.prototype.init.call(this,t,n,r),a&&(i.feature=a)},t.prototype.optionUpdated=function(){I(this.option.feature,function(e,t){var n=this._themeFeatureOption,r=yr(t);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(this.ecModel)),n&&n[t]&&(w(e,n[t]),n[t]=null),w(e,r.defaultOption))},this)},t.type=`toolbox`,t.layoutMode={type:`box`,ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:`horizontal`,left:`right`,top:`top`,backgroundColor:`transparent`,borderColor:D.color.border,borderRadius:0,borderWidth:0,padding:D.size.m,itemSize:15,itemGap:D.size.s,showTitle:!0,iconStyle:{borderColor:D.color.accent50,color:`none`},emphasis:{iconStyle:{borderColor:D.color.accent70}},tooltip:{show:!1,position:`bottom`}},t}(kt),xr=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),!e.get(`show`))return;var a=+e.get(`itemSize`),o=e.get(`orient`)===`vertical`,s=e.get(`feature`)||{},c=this._features||=Tt(),l=[];I(s,function(e,t){l.push(t)}),new je(this._featureNames||[],l).add(u).update(u).remove(O(u,null)).execute(),this._featureNames=v(l,function(e){return c.hasKey(e)});function u(i,a){var o=i!=null&&a==null,u=i!=null&&a!=null,d=i==null,p=o||u?l[i]:l[a],m=s[p],h=o||u?new xe(m,e,t):null,g=h&&h.get(`show`),_;if(o){if(!g)return;if(Sr(p))_={onclick:h.option.onclick,featureName:p};else{var v=yr(p);if(!v)return;_=new v}c.set(p,_)}else _=c.get(p);if(d||!g){Cr(_)&&_.dispose&&_.dispose(t,n),c.removeKey(p);return}r&&r.newTitle!=null&&r.featureName===p&&(m.title=r.newTitle),o&&(_.uid=ct(`toolbox-feature`)),_.model=h,_.ecModel=t,_.api=n,f(h,_,p),h.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&(t===`emphasis`?xt:Me)(r[e])},Cr(_)&&_.render&&_.render(h,t,n,r)}function f(r,s,c){var l=r.getModel(`iconStyle`),u=r.getModel([`emphasis`,`iconStyle`]),d=s instanceof K&&s.getIcons?s.getIcons():r.get(`icon`),f=r.get(`title`)||{},p,m;fe(d)?(p={},p[c]=d):p=d,fe(f)?(m={},m[c]=f):m=f;var h=r.iconPaths={};I(p,function(c,d){var f=rt(c,{},{x:-a/2,y:-a/2,width:a,height:a});f.setStyle(l.getItemStyle());var p=f.ensureState(`emphasis`);p.style=u.getItemStyle();var _=new g({style:{text:m[d],align:u.get(`textAlign`),borderRadius:u.get(`textBorderRadius`),padding:u.get(`textPadding`),fill:null,font:Ce({fontStyle:u.get(`textFontStyle`),fontFamily:u.get(`textFontFamily`),fontSize:u.get(`textFontSize`),fontWeight:u.get(`textFontWeight`)},t)},ignore:!0});f.setTextContent(_),Ae({el:f,componentModel:e,itemName:d,formatterParamsExtra:{title:m[d]}}),f.__title=m[d],f.on(`mouseover`,function(){var t=u.getItemStyle(),r=o?e.get(`right`)==null&&e.get(`left`)!==`right`?`right`:`left`:e.get(`bottom`)==null&&e.get(`top`)!==`bottom`?`bottom`:`top`;_.setStyle({fill:u.get(`textFill`)||t.fill||t.stroke||D.color.neutral99,backgroundColor:u.get(`textBackgroundColor`)}),f.setTextConfig({position:u.get(`textPosition`)||r}),_.ignore=!e.get(`showTitle`),n.enterEmphasis(this)}).on(`mouseout`,function(){r.get([`iconStatus`,d])!==`emphasis`&&n.leaveEmphasis(this),_.hide()}),(r.get([`iconStatus`,d])===`emphasis`?xt:Me)(f),i.add(f),f.on(`click`,Dt(s.onclick,s,t,n,d)),h[d]=f})}var p=ve(e,n).refContainer,m=e.getBoxLayoutParams(),h=e.get(`padding`),_=_e(m,p,h);d(e.get(`orient`),i,e.get(`itemGap`),_.width,_.height),S(i,m,p,h),i.add(Lt(i.getBoundingRect(),e)),o||i.eachChild(function(e){var t=e.__title,r=e.ensureState(`emphasis`),o=r.textConfig||={},s=e.getTextContent(),c=s&&s.ensureState(`emphasis`);if(c&&!N(c)&&t){var l=c.style||={},u=we(t,g.makeFont(l)),d=e.x+i.x,f=e.y+i.y+a,p=!1;f+u.height>n.getHeight()&&(o.position=`top`,p=!0);var m=p?-5-u.height:a+10;d+u.width/2>n.getWidth()?(o.position=[`100%`,m],l.align=`right`):d-u.width/2<0&&(o.position=[0,m],l.align=`left`)}})},t.prototype.updateView=function(e,t,n,r){I(this._features,function(e){e&&e instanceof K&&e.updateView&&e.updateView(e.model,t,n,r)})},t.prototype.dispose=function(e,t){I(this._features,function(n){n&&n instanceof K&&n.dispose&&n.dispose(e,t)})},t.type=`toolbox`,t}(ae);function Sr(e){return e.indexOf(`my`)===0}function Cr(e){return e instanceof K}var wr=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){var n=this.model,r=n.get(`name`)||e.get(`title.0.text`)||`echarts`,i=t.getZr().painter.getType()===`svg`,a=i?`svg`:n.get(`type`,!0)||`png`,o=t.getConnectedDataURL({type:a,backgroundColor:n.get(`backgroundColor`,!0)||e.get(`backgroundColor`)||D.color.neutral00,connectedBackgroundColor:n.get(`connectedBackgroundColor`),excludeComponents:n.get(`excludeComponents`),pixelRatio:n.get(`pixelRatio`)}),s=ye.browser;if(typeof MouseEvent==`function`&&(s.newEdge||!s.ie&&!s.edge)){var c=document.createElement(`a`);c.download=r+`.`+a,c.target=`_blank`,c.href=o;var l=new MouseEvent(`click`,{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(l)}else if(window.navigator.msSaveOrOpenBlob||i){var u=o.split(`,`),d=u[0].indexOf(`base64`)>-1,f=i?decodeURIComponent(u[1]):u[1];d&&(f=window.atob(f));var p=r+`.`+a;if(window.navigator.msSaveOrOpenBlob){for(var m=f.length,h=new Uint8Array(m);m--;)h[m]=f.charCodeAt(m);var g=new Blob([h]);window.navigator.msSaveOrOpenBlob(g,p)}else{var _=document.createElement(`iframe`);document.body.appendChild(_);var v=_.contentWindow,y=v.document;y.open(`image/svg+xml`,`replace`),y.write(f),y.close(),v.focus(),y.execCommand(`SaveAs`,!0,p),document.body.removeChild(_)}}else{var b=n.get(`lang`),x=`<body style="margin:0;"><img src="`+o+`" style="max-width:100%;" title="`+(b&&b[0]||``)+`" /></body>`,S=window.open();S.document.write(x),S.document.title=r}},t.getDefaultOption=function(e){return{show:!0,icon:`M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0`,title:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`title`]),type:`png`,connectedBackgroundColor:D.color.neutral00,name:``,excludeComponents:[`toolbox`],lang:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`lang`])}},t}(K),Tr=`__ec_magicType_stack__`,Er=[[`line`,`bar`],[`stack`]],Dr=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getIcons=function(){var e=this.model,t=e.get(`icon`),n={};return I(e.get(`type`),function(e){t[e]&&(n[e]=t[e])}),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:`M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4`,bar:`M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7`,stack:`M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z`},title:e.getLocaleModel().get([`toolbox`,`magicType`,`title`]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var r=this.model,i=r.get([`seriesIndex`,n]);if(Or[n]){var a={series:[]};I(Er,function(e){E(e,n)>=0&&I(e,function(e){r.setIconStatus(e,`normal`)})}),r.setIconStatus(n,`emphasis`),e.eachComponent({mainType:`series`,query:i==null?null:{seriesIndex:i}},function(e){var t=e.subType,i=e.id,o=Or[n](t,i,e,r);o&&(h(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&s.type===`cartesian2d`&&(n===`line`||n===`bar`)){var c=s.getAxesByScale(`ordinal`)[0];if(c){var l=c.dim+`Axis`,u=e.getReferringComponents(l,_).models[0].componentIndex;a[l]=a[l]||[];for(var d=0;d<=u;d++)a[l][u]=a[l][u]||{};a[l][u].boundaryGap=n===`bar`}}});var o,s=n;n===`stack`&&(o=w({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),r.get([`iconStatus`,n])!==`emphasis`&&(s=`tiled`)),t.dispatchAction({type:`changeMagicType`,currentType:s,newOption:a,newTitle:o,featureName:`magicType`})}},t}(K),Or={line:function(e,t,n,r){if(e===`bar`)return w({id:t,type:`line`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`line`])||{},!0)},bar:function(e,t,n,r){if(e===`line`)return w({id:t,type:`bar`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`bar`])||{},!0)},stack:function(e,t,n,r){var i=n.get(`stack`)===Tr;if(e===`line`||e===`bar`)return r.setIconStatus(`stack`,i?`normal`:`emphasis`),w({id:t,stack:i?``:Tr},r.get([`option`,`stack`])||{},!0)}};wt({type:`changeMagicType`,event:`magicTypeChanged`,update:`prepareAndUpdate`},function(e,t){t.mergeOption(e.newOption)});var J=Array(60).join(`-`),Y=` `;function kr(e){var t={},n=[],r=[];return e.eachRawSeries(function(e){var i=e.coordinateSystem;if(i&&(i.type===`cartesian2d`||i.type===`polar`)){var a=i.getBaseAxis();if(a.type===`category`){var o=Oe(a);t[o]||(t[o]={categoryAxis:a,valueAxis:i.getOtherAxis(a),series:[]},r.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else n.push(e)}else n.push(e)}),{seriesGroupByCategoryAxis:t,other:n,meta:r}}function Ar(e){var t=[];return I(e,function(e,n){var r=e.categoryAxis,i=e.valueAxis.dim,a=[` `].concat(b(e.series,function(e){return e.name})),o=[r.model.getCategories()];I(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(i),function(e){return e}))});for(var s=[a.join(Y)],c=0;c<o[0].length;c++){for(var l=[],u=0;u<o.length;u++)l.push(o[u][c]);s.push(l.join(Y))}t.push(s.join(`
`))}),t.join(`
`+J+`
`)}function jr(e){return b(e,function(e){var t=e.getRawData(),n=[e.name],r=[];return t.each(t.dimensions,function(){for(var e=arguments.length,i=arguments[e-1],a=t.getName(i),o=0;o<e-1;o++)r[o]=arguments[o];n.push((a?a+Y:``)+r.join(Y))}),n.join(`
`)}).join(`
`+J+`
`)}function Mr(e){var t=kr(e);return{value:v([Ar(t.seriesGroupByCategoryAxis),jr(t.other)],function(e){return!!e.replace(/[\n\t\s]/g,``)}).join(`
`+J+`
`),meta:t.meta}}function X(e){return e.replace(/^\s\s*/,``).replace(/\s\s*$/,``)}function Nr(e){if(e.slice(0,e.indexOf(`
`)).indexOf(Y)>=0)return!0}var Pr=RegExp(`[`+Y+`]+`,`g`);function Fr(e){for(var t=e.split(/\n+/g),n=X(t.shift()).split(Pr),r=[],i=b(n,function(e){return{name:e,data:[]}}),a=0;a<t.length;a++){var o=X(t[a]).split(Pr);r.push(o.shift());for(var s=0;s<o.length;s++)i[s]&&(i[s].data[a]=o[s])}return{series:i,categories:r}}function Ir(e){for(var t=e.split(/\n+/g),n=X(t.shift()),r=[],i=0;i<t.length;i++){var a=X(t[i]);if(a){var o=a.split(Pr),s=``,c=void 0,l=!1;isNaN(o[0])?(l=!0,s=o[0],o=o.slice(1),r[i]={name:s,value:[]},c=r[i].value):c=r[i]=[];for(var u=0;u<o.length;u++)c.push(+o[u]);c.length===1&&(l?r[i].value=c[0]:r[i]=c[0])}}return{name:n,data:r}}function Lr(e,t){var n=e.split(RegExp(`
*`+J+`
*`,`g`)),r={series:[]};return I(n,function(e,n){if(Nr(e)){var i=Fr(e),a=t[n],o=a.axisDim+`Axis`;a&&(r[o]=r[o]||[],r[o][a.axisIndex]={data:i.categories},r.series=r.series.concat(i.series))}else{var i=Ir(e);r.series.push(i)}}),r}var Rr=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){setTimeout(function(){t.dispatchAction({type:`hideTip`})});var n=t.getDom(),r=this.model;this._dom&&n.removeChild(this._dom);var i=document.createElement(`div`);i.style.cssText=`position:absolute;top:0;bottom:0;left:0;right:0;padding:5px`,i.style.backgroundColor=r.get(`backgroundColor`)||D.color.neutral00;var a=document.createElement(`h4`),o=r.get(`lang`)||[];a.innerHTML=o[0]||r.get(`title`),a.style.cssText=`margin:10px 20px`,a.style.color=r.get(`textColor`);var s=document.createElement(`div`),c=document.createElement(`textarea`);s.style.cssText=`overflow:auto`;var l=r.get(`optionToContent`),d=r.get(`contentToOption`),f=Mr(e);if(N(l)){var p=l(t.getOption());fe(p)?s.innerHTML=p:u(p)&&s.appendChild(p)}else{c.readOnly=r.get(`readOnly`);var m=c.style;m.cssText=`display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none`,m.color=r.get(`textColor`),m.borderColor=r.get(`textareaBorderColor`),m.backgroundColor=r.get(`textareaColor`),c.value=f.value,s.appendChild(c)}var h=f.meta,g=document.createElement(`div`);g.style.cssText=`position:absolute;bottom:5px;left:0;right:0`;var _=`float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px`,v=document.createElement(`div`),y=document.createElement(`div`);_+=`;background-color:`+r.get(`buttonColor`),_+=`;color:`+r.get(`buttonTextColor`);var b=this;function x(){n.removeChild(i),b._dom=null}Ie(v,`click`,x),Ie(y,`click`,function(){if(d==null&&l!=null||d!=null&&l==null){x();return}var e;try{e=N(d)?d(s,t.getOption()):Lr(c.value,h)}catch(e){throw x(),Error(`Data view format error `+e)}e&&t.dispatchAction({type:`changeDataView`,newOption:e}),x()}),v.innerHTML=o[1],y.innerHTML=o[2],y.style.cssText=v.style.cssText=_,!r.get(`readOnly`)&&g.appendChild(y),g.appendChild(v),i.appendChild(a),i.appendChild(s),i.appendChild(g),s.style.height=n.clientHeight-80+`px`,n.appendChild(i),this._dom=i},t.prototype.dispose=function(e,t){this._dom&&t.getDom().removeChild(this._dom)},t.getDefaultOption=function(e){return{show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:`M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28`,title:e.getLocaleModel().get([`toolbox`,`dataView`,`title`]),lang:e.getLocaleModel().get([`toolbox`,`dataView`,`lang`]),backgroundColor:D.color.background,textColor:D.color.primary,textareaColor:D.color.background,textareaBorderColor:D.color.border,buttonColor:D.color.accent50,buttonTextColor:D.color.neutral00}},t}(K);function zr(e,t){return b(e,function(e,n){var r=t&&t[n];if(le(r)&&!P(r)){le(e)&&!P(e)||(e={value:e});var i=r.name!=null&&e.name==null;return e=h(e,r),i&&delete e.name,e}else return e})}wt({type:`changeDataView`,event:`dataViewChanged`,update:`prepareAndUpdate`},function(e,t){var n=[];I(e.newOption.series,function(e){var r=t.getSeriesByName(e.name)[0];if(!r)n.push(A({type:`scatter`},e));else{var i=r.get(`data`);n.push({name:e.name,data:zr(e.data,i)})}}),t.mergeOption(h({series:n},e.newOption))});var Br=I,Vr=x();function Hr(e,t){var n=Kr(e);Br(t,function(t,r){for(var i=n.length-1;i>=0&&!n[i][r];i--);if(i<0){var a=e.queryComponents({mainType:`dataZoom`,subType:`select`,id:r})[0];if(a){var o=a.getPercentRange();n[0][r]={dataZoomId:r,start:o[0],end:o[1]}}}}),n.push(t)}function Ur(e){var t=Kr(e),n=t[t.length-1];t.length>1&&t.pop();var r={};return Br(n,function(e,n){for(var i=t.length-1;i>=0;i--)if(e=t[i][n],e){r[n]=e;break}}),r}function Wr(e){Vr(e).snapshots=null}function Gr(e){return Kr(e).length}function Kr(e){var t=Vr(e);return t.snapshots||=[{}],t.snapshots}var qr=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){Wr(e),t.dispatchAction({type:`restore`,from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:`M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5`,title:e.getLocaleModel().get([`toolbox`,`restore`,`title`])}},t}(K);wt({type:`restore`,event:`restore`,update:`prepareAndUpdate`},function(e,t){t.resetOption(`recreate`)});var Jr=[`grid`,`xAxis`,`yAxis`,`geo`,`graph`,`polar`,`radiusAxis`,`angleAxis`,`bmap`],Yr=function(){function e(e,t,n){var r=this;this._targetInfoList=[];var i=Zr(t,e);I(Qr,function(e,t){(!n||!n.include||E(n.include,t)>=0)&&e(i,r._targetInfoList)})}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(e,t,n){if((e.coordRanges||=[]).push(t),!e.coordRange){e.coordRange=t;var r=ti[e.brushType](0,n,t);e.__rangeOffset={offset:ri[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}}),e},e.prototype.matchOutputRanges=function(e,t,n){I(e,function(e){var r=this.findTargetInfo(e,t);r&&r!==!0&&I(r.coordSyses,function(r){n(e,ti[e.brushType](1,r,e.range,!0).values,r,t)})},this)},e.prototype.setInputRanges=function(e,t){I(e,function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&n!==!0){e.panelId=n.panelId;var r=ti[e.brushType](0,n.coordSys,e.coordRange),i=e.__rangeOffset;e.range=i?ri[e.brushType](r.values,i.offset,ai(r.xyMinMax,i.xyMinMax)):r.values}},this)},e.prototype.makePanelOpts=function(e,t){return b(this._targetInfoList,function(n){var r=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:dr(r),isTargetByCursor:pr(r,e,n.coordSysModel),getLinearBrushOtherExtent:fr(r)}})},e.prototype.controlSeries=function(e,t,n){var r=this.findTargetInfo(e,n);return r===!0||r&&E(r.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,r=Zr(t,e),i=0;i<n.length;i++){var a=n[i],o=e.panelId;if(o){if(a.panelId===o)return a}else for(var s=0;s<$r.length;s++)if($r[s](r,a))return a}return!0},e}();function Xr(e){return e[0]>e[1]&&e.reverse(),e}function Zr(e,t){return ie(e,t,{includeMainTypes:Jr})}var Qr={grid:function(e,t){var n=e.xAxisModels,r=e.yAxisModels,i=e.gridModels,a=Tt(),o={},s={};!n&&!r&&!i||(I(n,function(e){var t=e.axis.grid.model;a.set(t.id,t),o[t.id]=!0}),I(r,function(e){var t=e.axis.grid.model;a.set(t.id,t),s[t.id]=!0}),I(i,function(e){a.set(e.id,e),o[e.id]=!0,s[e.id]=!0}),a.each(function(e){var i=e.coordinateSystem,a=[];I(i.getCartesians(),function(e,t){(E(n,e.getAxis(`x`).model)>=0||E(r,e.getAxis(`y`).model)>=0)&&a.push(e)}),t.push({panelId:`grid--`+e.id,gridModel:e,coordSysModel:e,coordSys:a[0],coordSyses:a,getPanelRect:ei.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})}))},geo:function(e,t){I(e.geoModels,function(e){var n=e.coordinateSystem;t.push({panelId:`geo--`+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:ei.geo})})}},$r=[function(e,t){var n=e.xAxisModel,r=e.yAxisModel,i=e.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],ei={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys.view,t=tn(null,e);return Ke(t,t,en(null,e)),t}},ti={lineX:O(ni,0),lineY:O(ni,1),rect:function(e,t,n,r){var i=e?t.pointToData([n[0][0],n[1][0]],r):t.dataToPoint([n[0][0],n[1][0]],r),a=e?t.pointToData([n[0][1],n[1][1]],r):t.dataToPoint([n[0][1],n[1][1]],r),o=[Xr([i[0],a[0]]),Xr([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(e,t,n,r){var i=[se(),se()];return{values:b(n,function(n){var a=e?t.pointToData(n,r):t.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],a[0]),i[1][0]=Math.min(i[1][0],a[1]),i[0][1]=Math.max(i[0][1],a[0]),i[1][1]=Math.max(i[1][1],a[1]),a}),xyMinMax:i}}};function ni(e,t,n,r){var i=n.getAxis([`x`,`y`][e]),a=Xr(b([0,1],function(e){return t?i.coordToData(i.toLocalCoord(r[e]),!0):i.toGlobalCoord(i.dataToCoord(r[e]))})),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var ri={lineX:O(ii,0),lineY:O(ii,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return b(e,function(e,r){return[e[0]-n[0]*t[r][0],e[1]-n[1]*t[r][1]]})}};function ii(e,t,n,r){return[t[0]-r[e]*n[0],t[1]-r[e]*n[1]]}function ai(e,t){var n=oi(e),r=oi(t),i=[n[0]/r[0],n[1]/r[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function oi(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var si=I,ci=te(`toolbox-dataZoom_`),li={x:`width`,y:`height`},ui=function(e){C(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n,r){this._brushController||(this._brushController=new jn(n.getZr()),this._brushController.on(`brush`,Dt(this._onBrush,this)).mount()),mi(e,t,this,r,n),pi(e,t)},t.prototype.onclick=function(e,t,n){di[n].call(this)},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(!e.isEnd||!t.length)return;var n={},r=this.ecModel;this._brushController.updateCovers([]),new Yr(fi(this.model),r,{include:[`grid`]}).matchOutputRanges(t,r,function(e,t,n){if(n.type===`cartesian2d`){var r=n.master.getRect().clone(),a=e.brushType;a===`rect`?(i(`x`,n,r,t[0]),i(`y`,n,r,t[1])):i({lineX:`x`,lineY:`y`}[a],n,r,t)}}),Hr(r,n),this._dispatchZoomAction(n);function i(e,t,i,o){var s=t.getAxis(e),c=s.model,l=a(e,c,r),u=l.findRepresentativeAxisProxy(c).getMinMaxSpan(),d=s.scale.getExtent();(u.minValueSpan!=null||u.maxValueSpan!=null)&&(o=Rt(0,o.slice(),d,0,u.minValueSpan,u.maxValueSpan));var f=p(d,i[li[e]],.5);l&&(n[l.id]={dataZoomId:l.id,startValue:isFinite(f)?Se(o[0],f):o[0],endValue:isFinite(f)?Se(o[1],f):o[1]})}function a(e,t,n){var r;return n.eachComponent({mainType:`dataZoom`,subType:`select`},function(n){n.getAxisModel(e,t.componentIndex)&&(r=n)}),r}},t.prototype._dispatchZoomAction=function(e){var t=[];si(e,function(e,n){t.push(M(e))}),t.length&&this.api.dispatchAction({type:`dataZoom`,from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:`filter`,icon:{zoom:`M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1`,back:`M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26`},title:e.getLocaleModel().get([`toolbox`,`dataZoom`,`title`]),brushStyle:{borderWidth:0,color:D.color.backgroundTint}}},t}(K),di={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:`takeGlobalCursor`,key:`dataZoomSelect`,dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(Ur(this.ecModel))}};function fi(e){var t={xAxisIndex:e.get(`xAxisIndex`,!0),yAxisIndex:e.get(`yAxisIndex`,!0),xAxisId:e.get(`xAxisId`,!0),yAxisId:e.get(`yAxisId`,!0)};return t.xAxisIndex==null&&t.xAxisId==null&&(t.xAxisIndex=`all`),t.yAxisIndex==null&&t.yAxisId==null&&(t.yAxisIndex=`all`),t}function pi(e,t){e.setIconStatus(`back`,Gr(t)>1?`emphasis`:`normal`)}function mi(e,t,n,r,i){var a=n._isZoomActive;r&&r.type===`takeGlobalCursor`&&(a=r.key===`dataZoomSelect`?r.dataZoomSelectActive:!1),n._isZoomActive=a,e.setIconStatus(`zoom`,a?`emphasis`:`normal`);var o=new Yr(fi(e),t,{include:[`grid`]}).makePanelOpts(i,function(e){return e.xAxisDeclared&&!e.yAxisDeclared?`lineX`:!e.xAxisDeclared&&e.yAxisDeclared?`lineY`:`rect`});n._brushController.setPanels(o).enableBrush(a&&o.length?{brushType:`auto`,brushStyle:e.getModel(`brushStyle`).getItemStyle()}:!1)}ne(`dataZoom`,function(e){var t=e.getComponent(`toolbox`,0),n=[`feature`,`dataZoom`];if(!t||t.get(n)==null)return;var r=t.getModel(n),i=[],a=ie(e,fi(r));si(a.xAxisModels,function(e){return o(e,`xAxis`,`xAxisIndex`)}),si(a.yAxisModels,function(e){return o(e,`yAxis`,`yAxisIndex`)});function o(e,t,n){var a=e.componentIndex,o={type:`select`,$fromToolbox:!0,filterMode:r.get(`filterMode`,!0)||`filter`,id:ci+t+a};o[n]=a,i.push(o)}return i});function hi(e){e.registerComponentModel(br),e.registerComponentView(xr),q(`saveAsImage`,wr),q(`magicType`,Dr),q(`dataView`,Rr),q(`dataZoom`,ui),q(`restore`,qr),ze(_r)}function gi(e,t){if(!e)return!1;for(var n=P(e)?e:[e],r=0;r<n.length;r++)if(n[r]&&n[r][t])return!0;return!1}function Z(e){Xe(e,`label`,[`show`])}var Q=x(),$=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.createdBySelf=!1,n.preventAutoZ=!0,n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._mergeOption(e,n,!1,!0)},t.prototype.isAnimationEnabled=function(){if(ye.node)return!1;var e=this.__hostSeries;return this.getShallow(`animation`)&&e&&e.isAnimationEnabled()},t.prototype.mergeOption=function(e,t){this._mergeOption(e,t,!1,!1)},t.prototype._mergeOption=function(e,t,n,r){var i=this.mainType;n||t.eachSeries(function(e){var n=e.get(this.mainType,!0),a=Q(e)[i];if(!n||!n.data){Q(e)[i]=null;return}a?a._mergeOption(n,t,!0):(r&&Z(n),I(n.data,function(e){e instanceof Array?(Z(e[0]),Z(e[1])):Z(e)}),a=this.createMarkerModelFromSeries(n,this,t),A(a,{mainType:this.mainType,seriesIndex:e.seriesIndex,name:e.name,createdBySelf:!0}),a.__hostSeries=e),Q(e)[i]=a},this)},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e),a=r.getName(e);return de(`section`,{header:this.name,blocks:[de(`nameValue`,{name:a,value:i,noName:!a,noValue:i==null})]})},t.prototype.getData=function(){return this._data},t.prototype.setData=function(e){this._data=e},t.prototype.getDataParams=function(e,t){var n=ee.prototype.getDataParams.call(this,e,t),r=this.__hostSeries;return r&&(n.seriesId=r.id,n.seriesName=r.name,n.seriesType=r.subType),n},t.getMarkerModelFromSeries=function(e,t){return Q(e)[t]},t.type=`marker`,t.dependencies=[`series`,`grid`,`polar`,`geo`],t}(kt);re($,ee.prototype);var _i=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markPoint`,t.defaultOption={z:5,symbol:`pin`,symbolSize:50,tooltip:{trigger:`item`},label:{show:!0,position:`inside`},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}},t}($);function vi(e){return!(isNaN(parseFloat(e.x))&&isNaN(parseFloat(e.y)))}function yi(e){return!isNaN(parseFloat(e.x))&&!isNaN(parseFloat(e.y))}function bi(e,t,n,r,i,a,o){var s=[],c=yt(t,i)?t.getCalculationInfo(`stackResultDimension`):i,l=Di(t,c,e),u=t.hostModel.indicesOfNearest(n,c,l)[0];s[a]=t.get(r,u),s[o]=t.get(c,u);var d=t.get(i,u),f=be(t.get(i,u));return f=Math.min(f,20),f>=0&&(s[o]=+s[o].toFixed(f)),[s,d]}var xi={min:O(bi,`min`),max:O(bi,`max`),average:O(bi,`average`),median:O(bi,`median`)};function Si(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!yi(t)&&!P(t.coord)&&P(i)){var a=Ci(t,n,r,e);if(t=M(t),t.type&&xi[t.type]&&a.baseAxis&&a.valueAxis){var o=E(i,a.baseAxis.dim),s=E(i,a.valueAxis.dim),c=xi[t.type](n,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=c[0],t.value=c[1]}else t.coord=[t.xAxis==null?t.radiusAxis:t.xAxis,t.yAxis==null?t.angleAxis:t.yAxis]}if(t.coord==null||!P(i)){t.coord=[];var l=e.getBaseAxis();if(l&&t.type&&xi[t.type]){var u=r.getOtherAxis(l);u&&(t.value=Di(n,n.mapDimension(u.dim),t.type))}}else for(var d=t.coord,f=0;f<2;f++)xi[d[f]]&&(d[f]=Di(n,n.mapDimension(i[f]),d[f]));return t}}function Ci(e,t,n,r){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex==null?e.valueDim:t.getDimension(e.valueIndex),i.valueAxis=n.getAxis(wi(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function wi(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}function Ti(e,t){return e&&e.containData&&t.coord&&!vi(t)?e.containData(t.coord):!0}function Ei(e,t){return e?function(e,n,r,i){return y(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return y(e.value,t[i])}}function Di(e,t,n){if(n===`average`){var r=0,i=0;return e.each(t,function(e,t){isNaN(e)||(r+=e,i++)}),r/i}else if(n===`median`)return e.getMedian(t);else return e.getDataExtent(t)[+(n===`max`)]}var Oi=x(),ki=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){this.markerGroupMap=Tt()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){Oi(e).keep=!1}),t.eachSeries(function(e){var i=$.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){!Oi(e).keep&&r.group.remove(e.group)}),Ai(t,i,this.type)},t.prototype.markKeep=function(e){Oi(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;I(e,function(e){var r=$.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?De(e):Ot(e))})})},t.type=`marker`,t}(ae);function Ai(e,t,n){e.eachSeries(function(e){var r=$.getMarkerModelFromSeries(e,n),i=t.get(e.id);if(r&&i&&i.group){var a=qe(r),o=a.z,s=a.zlevel;Pe(i.group,o,s)}})}function ji(e,t,n){var r=t.coordinateSystem,i=n.getWidth(),a=n.getHeight(),o=r&&r.getArea&&r.getArea();e.each(function(n){var s=e.getItemModel(n),c=s.get(`relativeTo`)===`coordinate`,l=c?o?o.width:0:i,u=c?o?o.height:0:a,d=c&&o?o.x:0,f=c&&o?o.y:0,p,m=T(s.get(`x`),l)+d,h=T(s.get(`y`),u)+f;if(!isNaN(m)&&!isNaN(h))p=[m,h];else if(t.getMarkerPosition)p=t.getMarkerPosition(e.getValues(e.dimensions,n));else if(r){var g=e.get(r.dimensions[0],n),_=e.get(r.dimensions[1],n);p=r.dataToPoint([g,_])}isNaN(m)||(p[0]=m),isNaN(h)||(p[1]=h),e.setItemLayout(n,p)})}var Mi=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=$.getMarkerModelFromSeries(e,`markPoint`);t&&(ji(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new _t),l=Ni(i,e,t);t.setData(l),ji(t.getData(),e,r),l.each(function(e){var n=l.getItemModel(e),r=n.getShallow(`symbol`),i=n.getShallow(`symbolSize`),a=n.getShallow(`symbolRotate`),s=n.getShallow(`symbolOffset`),c=n.getShallow(`symbolKeepAspect`);if(N(r)||N(i)||N(a)||N(s)){var u=t.getRawValue(e),d=t.getDataParams(e);N(r)&&(r=r(u,d)),N(i)&&(i=i(u,d)),N(a)&&(a=a(u,d)),N(s)&&(s=s(u,d))}var p=n.getModel(`itemStyle`).getItemStyle(),m=n.get(`z2`),h=ue(o,`color`);p.fill||=h,l.setItemVisual(e,{z2:f(m,0),symbol:r,symbolSize:i,symbolRotate:a,symbolOffset:s,symbolKeepAspect:c,style:p})}),c.updateData(l),this.group.add(c.group),l.eachItemGraphicEl(function(e){e.traverse(function(e){k(e).dataModel=t})}),this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markPoint`,t}(ki);function Ni(e,t,n){var r=e?b(e&&e.dimensions,function(e){var n=t.getData();return A(A({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new L(r,n),a=b(n.get(`data`),O(Si,t));e&&(a=v(a,O(Ti,e)));var o=Ei(!!e,r);return i.initData(a,null,o),i}function Pi(e){e.registerComponentModel(_i),e.registerComponentView(Mi),e.registerPreprocessor(function(e){gi(e.series,`markPoint`)&&(e.markPoint=e.markPoint||{})})}var Fi=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markLine`,t.defaultOption={z:5,symbol:[`circle`,`arrow`],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:`item`},label:{show:!0,position:`end`,distance:5},lineStyle:{type:`dashed`},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:`linear`},t}($),Ii=x(),Li=function(e,t,n,r){var i=e.getData(),a;if(P(r))a=r;else{var o=r.type;if(o===`min`||o===`max`||o===`average`||o===`median`||r.xAxis!=null||r.yAxis!=null){var s=void 0,c=void 0;if(r.yAxis!=null||r.xAxis!=null)s=t.getAxis(r.yAxis==null?`x`:`y`),c=At(r.yAxis,r.xAxis);else{var l=Ci(r,i,t,e);s=l.valueAxis,c=Di(i,Te(i,l.valueDataDim),o)}var u=s.dim===`x`?0:1,d=1-u,f=M(r),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var m=n.get(`precision`);m>=0&&oe(c)&&(c=+c.toFixed(Math.min(m,20))),f.coord[u]=p.coord[u]=c,a=[f,p,{type:o,valueIndex:r.valueIndex,value:c}]}else a=[]}var h=[Si(e,a[0]),Si(e,a[1]),A({},a[2])];return h[2].type=h[2].type||null,w(h[2],h[0]),w(h[2],h[1]),h};function Ri(e){return!isNaN(e)&&!isFinite(e)}function zi(e,t,n,r){var i=1-e,a=r.dimensions[e];return Ri(t[i])&&Ri(n[i])&&t[e]===n[e]&&r.getAxis(a).containData(t[e])}function Bi(e,t){if(e.type===`cartesian2d`){var n=t[0].coord,r=t[1].coord;if(n&&r&&(zi(1,n,r,e)||zi(0,n,r,e)))return!0}return Ti(e,t[0])&&Ti(e,t[1])}function Vi(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=T(o.get(`x`),i.getWidth()),l=T(o.get(`y`),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition)s=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var u=a.dimensions,d=e.get(u[0],t),f=e.get(u[1],t);s=a.dataToPoint([d,f])}if(Ne(a,`cartesian2d`)){var p=a.getAxis(`x`),m=a.getAxis(`y`),u=a.dimensions;Ri(e.get(u[0],t))?s[0]=p.toGlobalCoord(p.getExtent()[+!n]):Ri(e.get(u[1],t))&&(s[1]=m.toGlobalCoord(m.getExtent()[+!n]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}e.setItemLayout(t,s)}var Hi=function(e){C(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=$.getMarkerModelFromSeries(e,`markLine`);if(t){var r=t.getData(),i=Ii(t).from,a=Ii(t).to;i.each(function(t){Vi(i,t,!0,e,n),Vi(a,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),a.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new _n);this.group.add(c.group);var l=Ui(i,e,t),u=l.from,d=l.to,p=l.line;Ii(t).from=u,Ii(t).to=d,t.setData(p);var m=t.get(`symbol`),h=t.get(`symbolSize`),g=t.get(`symbolRotate`),_=t.get(`symbolOffset`);P(m)||(m=[m,m]),P(h)||(h=[h,h]),P(g)||(g=[g,g]),P(_)||(_=[_,_]),l.from.each(function(e){v(u,e,!0),v(d,e,!1)}),p.each(function(e){var t=p.getItemModel(e),n=t.getModel(`lineStyle`).getLineStyle();p.setItemLayout(e,[u.getItemLayout(e),d.getItemLayout(e)]);var r=t.get(`z2`);n.stroke??=u.getItemVisual(e,`style`).fill,p.setItemVisual(e,{z2:f(r,0),fromSymbolKeepAspect:u.getItemVisual(e,`symbolKeepAspect`),fromSymbolOffset:u.getItemVisual(e,`symbolOffset`),fromSymbolRotate:u.getItemVisual(e,`symbolRotate`),fromSymbolSize:u.getItemVisual(e,`symbolSize`),fromSymbol:u.getItemVisual(e,`symbol`),toSymbolKeepAspect:d.getItemVisual(e,`symbolKeepAspect`),toSymbolOffset:d.getItemVisual(e,`symbolOffset`),toSymbolRotate:d.getItemVisual(e,`symbolRotate`),toSymbolSize:d.getItemVisual(e,`symbolSize`),toSymbol:d.getItemVisual(e,`symbol`),style:n})}),c.updateData(p),l.line.eachItemGraphicEl(function(e){k(e).dataModel=t,e.traverse(function(e){k(e).dataModel=t})});function v(t,n,i){var a=t.getItemModel(n);Vi(t,n,i,e,r);var s=a.getModel(`itemStyle`).getItemStyle();s.fill??=ue(o,`color`),t.setItemVisual(n,{symbolKeepAspect:a.get(`symbolKeepAspect`),symbolOffset:f(a.get(`symbolOffset`,!0),_[+!i]),symbolRotate:f(a.get(`symbolRotate`,!0),g[+!i]),symbolSize:f(a.get(`symbolSize`),h[+!i]),symbol:f(a.get(`symbol`,!0),m[+!i]),style:s})}this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markLine`,t}(ki);function Ui(e,t,n){var r=e?b(e&&e.dimensions,function(e){var n=t.getData();return A(A({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new L(r,n),a=new L(r,n),o=new L([],n),s=b(n.get(`data`),O(Li,t,e,n));e&&(s=v(s,O(Bi,e)));var c=Ei(!!e,r);return i.initData(b(s,function(e){return e[0]}),null,c),a.initData(b(s,function(e){return e[1]}),null,c),o.initData(b(s,function(e){return e[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function Wi(e){e.registerComponentModel(Fi),e.registerComponentView(Hi),e.registerPreprocessor(function(e){gi(e.series,`markLine`)&&(e.markLine=e.markLine||{})})}var Gi=600*1e3,Ki=Wt(t({__name:`FleetTrendEChart`,props:{points:{},hours:{},thresholds:{},height:{default:360},zoomStart:{default:void 0},zoomEnd:{default:void 0}},emits:[`range-change`],setup(t,{emit:c}){ze([Fe,it,Qt,lt,nt,Ft,zt,hi,Wi,Pi]);let l=t,u=c,d=a();function f(e){let t=d.current.value.colors[e];return typeof t==`string`?t:`#1976D2`}function p(e){return l.points.map(t=>{let r=n(t.recorded_at),i=t[e];return!r||i==null?null:[r.getTime(),i]}).filter(e=>e!=null)}function m(){return l.points.map(e=>{let t=n(e.recorded_at);return t?[t.getTime(),e.online_count]:null}).filter(e=>e!=null)}function h(e,t,n){return[{yAxis:e,name:t,lineStyle:{color:n,type:`dashed`,width:1,opacity:.75},label:{formatter:`${t} ${e}%`,color:n,fontSize:10,position:`insideEndTop`}}]}function g(){return{symbol:`circle`,symbolSize:8,label:{fontSize:10,formatter:e=>{let t=e.value,n=Array.isArray(t)?t[1]:t;return typeof n==`number`?`${n}%`:``}},data:[{type:`max`,name:`峰值`},{type:`min`,name:`谷值`}]}}function _(e,t=!1){let n=Ut(new Date(e).toISOString());return t?n:(l.hours,n.slice(5,16))}function v(){return l.points.filter(e=>(e.alert_count??0)>0).map(e=>{let t=Ht(e.recorded_at),n=Math.max(e.cpu_avg??0,e.mem_avg??0,e.disk_avg??0,8);return[t??0,Math.min(n+4,99),e.alert_count??0]}).filter(e=>e[0]>0)}function y(e){let t=e.alerts??[];if(!t.length)return`<div style="margin-top:8px;font-size:11px;opacity:0.65">本 10 分钟无告警</div>`;let n=t.slice(0,8).map(e=>{let t=e.alert_type_label||e.alert_type,n=e.is_recovery?`恢复`:`告警`,r=e.is_recovery?`#4CAF50`:`#F44336`,i=e.created_at?Ut(e.created_at).slice(11,19):``;return`<div style="font-size:11px;line-height:1.45">
<span style="color:${r};font-weight:600">${n}</span>
${e.server_name||`—`} · ${t} ${e.value||``}
${i?`<span style="opacity:0.7"> @ ${i}</span>`:``}
</div>`}),r=t.length>8?`<div style="font-size:11px;opacity:0.7">还有 ${t.length-8} 条…</div>`:``;return`<div style="margin-top:8px;padding-top:8px;border-top:1px solid rgba(128,128,128,0.25)">
<div style="font-weight:600;font-size:12px;margin-bottom:4px">告警 ${t.length} 条(10 分钟窗口)</div>
${n.join(``)}${r}
</div>`}function b(e,t){let n=Ut(e.recorded_at),r=t>0?l.points[t-1]:null,i=(e,t,n,r,i)=>{let a=``;if(n!=null&&r!=null){let e=Math.round((n-r)*10)/10;a=`<span style="color:${e>0?`#FB8C00`:e<0?`#4CAF50`:`#9E9E9E`};font-size:11px;margin-left:6px">${e>0?`+`:``}${e}${i}</span>`}return`<tr>
<td style="padding:2px 8px 2px 0;white-space:nowrap">
<span style="display:inline-block;width:8px;height:8px;border-radius:50%;background:${e};margin-right:6px"></span>${t}
</td>
<td style="padding:2px 0;text-align:right">${n==null?`—`:`<b>${n}${i}</b>`}${a}</td>
</tr>`},a=e.sample_count!=null&&e.online_count>0?Math.round(e.sample_count/e.online_count*100):null,o=[`在线 <b>${e.online_count}</b> 台`,e.sample_count==null?null:`采样 <b>${e.sample_count}</b>`,a==null?null:`覆盖率 <b>${a}%</b>`].filter(Boolean).join(` · `);return`<div style="min-width:200px;line-height:1.5">
<div style="font-weight:600;font-size:13px;margin-bottom:8px">${n}</div>
<table style="width:100%;border-collapse:collapse;font-size:12px">${[i(f(`primary`),`CPU`,e.cpu_avg,r?.cpu_avg??null,`%`),i(f(`warning`),`内存`,e.mem_avg,r?.mem_avg??null,`%`),i(`#9C27B0`,`磁盘`,e.disk_avg,r?.disk_avg??null,`%`),i(f(`success`),`在线`,e.online_count,r?.online_count??null,` 台`)].join(``)}</table>
<div style="margin-top:8px;font-size:11px;opacity:0.75">${o}</div>
${y(e)}
</div>`}let x=s(()=>l.zoomStart==null?l.hours>=168?65:0:l.zoomStart),S=s(()=>l.zoomEnd??100),C=s(()=>{let e=d.current.value.dark,t=e?`rgba(255,255,255,0.78)`:`rgba(0,0,0,0.65)`,n=e?`rgba(255,255,255,0.14)`:`rgba(0,0,0,0.1)`,r=e?`rgba(255,255,255,0.07)`:`rgba(0,0,0,0.06)`,i=f(`primary`),a=f(`warning`),o=f(`success`),s=f(`error`),c=v();return{animationDuration:600,animationEasing:`cubicOut`,color:[i,a,`#9C27B0`,o,s],grid:{left:12,right:16,top:52,bottom:78,containLabel:!0},legend:{top:6,left:`center`,textStyle:{color:t,fontSize:12},itemWidth:18,itemHeight:8,itemGap:20,selected:{在线台数:!1,告警:c.length>0}},tooltip:{trigger:`axis`,confine:!0,axisPointer:{type:`cross`,snap:!0,crossStyle:{color:n},lineStyle:{color:i,type:`dashed`,width:1},label:{backgroundColor:e?`#333`:`#666`,formatter:e=>{let t=e.axisDimension,n=e.value;return t===`x`&&n!=null?_(Number(n),!0):t===`y`&&n!=null?`${Math.round(Number(n)*10)/10}`:``}}},backgroundColor:e?`rgba(28,28,32,0.97)`:`rgba(255,255,255,0.98)`,borderColor:n,borderWidth:1,padding:[10,12],extraCssText:`box-shadow:0 8px 24px rgba(0,0,0,0.18);border-radius:8px;`,textStyle:{color:e?`#eee`:`#222`},formatter(e){let t=(Array.isArray(e)?e:[e])[0]?.axisValue;if(t==null)return``;let n=typeof t==`number`?t:Number(t),r=Vt(l.points,n);return r<0||r>=l.points.length?``:b(l.points[r],r)}},toolbox:{right:12,top:4,itemSize:14,iconStyle:{borderColor:t},feature:{dataZoom:{yAxisIndex:`none`,title:{zoom:`框选`,back:`还原`}},restore:{title:`重置`},saveAsImage:{title:`导出图片`,name:`nexus-fleet-trend`,pixelRatio:2}}},dataZoom:[{type:`inside`,start:x.value,end:S.value,minValueSpan:Gi},{type:`slider`,height:24,bottom:10,start:x.value,end:S.value,borderColor:n,backgroundColor:e?`rgba(255,255,255,0.04)`:`rgba(0,0,0,0.03)`,fillerColor:e?`rgba(25,118,210,0.2)`:`rgba(25,118,210,0.15)`,handleStyle:{color:i,borderColor:i},moveHandleStyle:{color:i},textStyle:{color:t,fontSize:10},labelFormatter:e=>_(e,!0)}],xAxis:{type:`time`,minInterval:Gi,maxInterval:l.hours>=168?360*60*1e3:3600*1e3,axisLine:{lineStyle:{color:n}},axisLabel:{color:t,fontSize:10,hideOverlap:!0,formatter:e=>_(e,!0)},axisTick:{show:!1},splitLine:{show:!0,lineStyle:{color:r,type:`dotted`}},minorSplitLine:{show:!1}},yAxis:[{type:`value`,name:`利用率`,min:0,max:100,nameTextStyle:{color:t,fontSize:11,padding:[0,0,0,4]},axisLabel:{color:t,fontSize:10,formatter:`{value}%`},splitLine:{lineStyle:{color:r,type:`dashed`}}},{type:`value`,name:`在线台数`,position:`right`,minInterval:1,nameTextStyle:{color:t,fontSize:11},axisLabel:{color:t,fontSize:10},splitLine:{show:!1}}],series:[{name:`CPU`,type:`line`,smooth:.28,showSymbol:!1,symbolSize:7,connectNulls:!1,emphasis:{focus:`series`,scale:!0},lineStyle:{width:2.5},areaStyle:{color:{type:`linear`,x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:`${i}40`},{offset:1,color:`${i}06`}]}},markLine:{symbol:`none`,silent:!0,data:h(l.thresholds.cpu,`CPU 告警`,s)},markPoint:g(),data:p(`cpu_avg`)},{name:`内存`,type:`line`,smooth:.28,showSymbol:!1,connectNulls:!1,emphasis:{focus:`series`},lineStyle:{width:2},areaStyle:{color:{type:`linear`,x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:`${a}35`},{offset:1,color:`${a}05`}]}},markLine:{symbol:`none`,silent:!0,data:h(l.thresholds.mem,`内存告警`,s)},data:p(`mem_avg`)},{name:`磁盘`,type:`line`,smooth:.28,showSymbol:!1,connectNulls:!1,emphasis:{focus:`series`},lineStyle:{width:2},markLine:{symbol:`none`,silent:!0,data:h(l.thresholds.disk,`磁盘告警`,s)},data:p(`disk_avg`)},{name:`在线台数`,type:`line`,yAxisIndex:1,smooth:.28,showSymbol:!1,connectNulls:!1,emphasis:{focus:`series`},lineStyle:{width:2,type:`dashed`,opacity:.85},data:m()},...c.length?[{name:`告警`,type:`scatter`,yAxisIndex:0,symbol:`pin`,symbolSize:e=>{let t=e?.[2]??1;return Math.min(28,12+Number(t)*3)},itemStyle:{color:s},emphasis:{scale:1.2},z:12,data:c}]:[]]}});function ee(e){let t=e.batch?.[0];u(`range-change`,{startPercent:t?.start??e.start??0,endPercent:t?.end??e.end??100})}return(n,a)=>(o(),e(r(ht),{class:`fleet-echart`,style:i({height:`${t.height}px`}),option:C.value,"update-options":{notMerge:!0},autoresize:``,onDatazoom:ee},null,8,[`style`,`option`]))}}),[[`__scopeId`,`data-v-a04be566`]]);export{Ki as default};