kivii-public-components 0.2.37 → 0.2.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5646,6 +5646,6 @@ echarts.use([`+c+`]);`:`Unknown series `+s))}return}if(t===`tooltip`){if(f){proc
5646
5646
  `)){var p=new Q7;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,X7(e9,f,null,r,d)).on(`mouseover`,X7(n9,m.name,null,r,d)).on(`mouseout`,X7(r9,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=XH(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=tL(h.fill);_&&_[3]===0&&(_[3]=.2,h=bP(bP({},h),{fill:oL(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,X7(e9,null,f,r,d)).on(`mouseover`,X7(n9,null,f,r,d)).on(`mouseout`,X7(r9,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=XH(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this);process.env.NODE_ENV!==`production`&&(c.get(f)||console.warn(f+` series not exists. Legend data should be same with series name or data name.`))}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};XH(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();Z7(e,function(e){var r=e.type,i=new IH({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),kK(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),KU(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=vde(c,r,o,s,d,m,u),y=new Q7,b=r.getModel(`textStyle`);if(NP(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(yde({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;PP(w)&&w?T=w.replace(`{name}`,t??``):NP(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new IH({style:jK(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new jH({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&hK({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),KU(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();kJ(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){kJ(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}else return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(dQ);function vde(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),Z7(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:m1(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function yde(e){var t=e.icon||`roundRect`,n=T$(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=GJ.color.neutral00,n.style.lineWidth=2),n}function e9(e,t,n,r){r9(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),n9(e,t,n,r)}function t9(e){for(var t=e.getZr().storage.getDisplayList(),n,r=0,i=t.length;r<i&&!(n=t[r].states.emphasis);)r++;return n&&n.hoverLayer}function n9(e,t,n,r){t9(n)||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function r9(e,t,n,r){t9(n)||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function bde(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;n<t.length;n++)if(!t[n].isSelected(e.name))return!1;return!0})}function i9(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),a9(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){$(i,function(t,n){e[t?`select`:`unSelect`](n)}),a9(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function a9(e,t){var n=t||{};return $(e.getData(),function(t){var r=t.get(`name`);if(!(r===`
5647
5647
  `||r===``)){var i=e.isSelected(r);rF(n,r)?n[r]=n[r]&&i:n[r]=i}}),n}function xde(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,jP(i9,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,jP(i9,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,jP(i9,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,jP(i9,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,jP(i9,`unSelect`))}function o9(e){e.registerComponentModel(Y7),e.registerComponentView($7),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,bde),e.registerSubTypeDefaulter(`legend`,function(){return`plain`}),xde(e)}var Sde=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},t.prototype.init=function(t,n,r){var i=BJ(t);e.prototype.init.call(this,t,n,r),s9(this,t,i)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.call(this,t,n),s9(this,this.option,t)},t.type=`legend.scroll`,t.defaultOption=aq(Y7.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:`end`,pageFormatter:`{current}/{total}`,pageIcons:{horizontal:[`M0,0L12,-10L12,10z`,`M0,0L-12,-10L-12,10z`],vertical:[`M0,0L20,0L10,-20z`,`M0,0L20,0L10,20z`]},pageIconColor:GJ.color.accent50,pageIconInactiveColor:GJ.color.accent10,pageIconSize:15,pageTextStyle:{color:GJ.color.tertiary},animationDurationUpdate:800}),t}(Y7);function s9(e,t,n){var r=e.getOrient(),i=[1,1];i[r.index]=0,zJ(t,n,{type:`box`,ignoreSize:!!i})}var c9=LR,l9=[`width`,`height`],u9=[`x`,`y`],Cde=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!0,n._currentIndex=0,n}return t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new c9),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new c9)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(t,n,r,i,a,o,s){var c=this;e.prototype.renderInner.call(this,t,n,r,i,a,o,s);var l=this._controllerGroup,u=n.get(`pageIconSize`,!0),d=MP(u)?u:[u,u];p(`pagePrev`,0);var f=n.getModel(`pageTextStyle`);l.add(new IH({name:`pageText`,style:{text:`xx/xx`,fill:f.getTextColor(),font:f.getFont(),verticalAlign:`middle`,align:`center`},silent:!0})),p(`pageNext`,1);function p(e,t){var r=e+`DataIndex`,a=sK(n.get(`pageIcons`,!0)[n.getOrient().name][t],{onclick:AP(c._pageGo,c,r,n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});a.name=e,l.add(a)}},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getSelectorGroup(),s=e.getOrient().index,c=l9[s],l=u9[s],u=l9[1-s],d=u9[1-s];i&&kJ(`horizontal`,o,e.get(`selectorItemGap`,!0));var f=e.get(`selectorButtonGap`,!0),p=o.getBoundingRect(),m=[-p.x,-p.y],h=vP(n);i&&(h[c]=n[c]-p[c]-f);var g=this._layoutContentAndController(e,r,h,s,c,u,d,l);if(i){if(a===`end`)m[s]+=g[c]+f;else{var _=p[c]+f;m[s]-=_,g[l]-=_}g[c]+=p[c]+f,m[1-s]+=g[d]+g[u]/2-p[u]/2,g[u]=Math.max(g[u],p[u]),g[d]=Math.min(g[d],p[d]+m[1-s]),o.x=m[0],o.y=m[1],o.markRedraw()}return g},t.prototype._layoutContentAndController=function(e,t,n,r,i,a,o,s){var c=this.getContentGroup(),l=this._containerGroup,u=this._controllerGroup;kJ(e.get(`orient`),c,e.get(`itemGap`),r?n.width:null,r?null:n.height),kJ(`horizontal`,u,e.get(`pageButtonItemGap`,!0));var d=c.getBoundingRect(),f=u.getBoundingRect(),p=this._showController=d[i]>n[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=WP(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new jH({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&kG(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;$([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,PP(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=l9[i],o=u9[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i<g.i&&(g=h,f.pagePrevDataIndex??=h.i,++f.pageCount,++f.pageIndex),h=_;return f;function v(e){if(e){var t=e.getBoundingRect(),n=t[o]+e[o];return{s:n,e:n+t[a],i:e.__legendDataIndex}}}function y(e,t){return e.e>=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}($7);function wde(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function Tde(e){n3(o9),e.registerComponentModel(Sde),e.registerComponentView(Cde),wde(e)}function Ede(e){n3(o9),n3(Tde)}var Dde=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.inside`,t.defaultOption=aq(E7.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(E7),d9=iB();function Ode(e,t,n){d9(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function kde(e,t){for(var n=d9(e).coordSysRecordMap,r=n.keys(),i=0;i<r.length;i++){var a=r[i],o=n.get(a),s=o.dataZoomInfoMap;if(s){var c=t.uid;s.get(c)&&(s.removeKey(c),s.keys().length||f9(n,o))}}}function f9(e,t){if(t){e.removeKey(t.model.uid);var n=t.controller;n&&n.dispose()}}function Ade(e,t){var n={model:t,containsPoint:jP(Mde,t),dispatchAction:jP(jde,e),dataZoomInfoMap:null,controller:null},r=n.controller=new ple(e.getZr());return $([`pan`,`zoom`,`scrollMove`],function(e){r.on(e,function(t){var r=[];n.dataZoomInfoMap.each(function(i){if(t.isAvailableBehavior(i.model.option)){var a=(i.getRange||{})[e],o=a&&a(i.dzReferCoordSysInfo,n.model.mainType,n.controller,t);!i.model.get(`disabled`,!0)&&o&&r.push({dataZoomId:i.model.id,start:o[0],end:o[1]})}}),r.length&&n.dispatchAction(r)})}),n}function jde(e,t){e.isDisposed()||e.dispatchAction({type:`dataZoom`,animation:{easing:`cubicOut`,duration:100},batch:t})}function Mde(e,t,n,r){return e.coordinateSystem.containPoint([n,r])}function Nde(e,t,n){var r,i=`type_`,a={type_true:2,type_move:1,type_false:0,type_undefined:-1},o=!0;return e.each(function(e){var t=e.model,n=t.get(`disabled`,!0)?!1:t.get(`zoomLock`,!0)?`move`:!0;a[i+n]>a[i+r]&&(r=n),o&&=t.get(`preventDefaultMouseMove`,!0)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:n,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint}}}}function Pde(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=d9(t),r=n.coordSysRecordMap||=eF();r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){$(w7(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,Ade(t,n.model));(a.dataZoomInfoMap||=eF()).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var n=e.controller,i,a=e.dataZoomInfoMap;if(a){var o=a.keys()[0];o!=null&&(i=a.get(o))}if(!i){f9(r,e);return}var s=Nde(a,e,t);n.enable(s.controlType,s.opt),TQ(e,`dispatchAction`,i.model.get(`throttle`,!0),`fixRate`)})})}var Fde=function(e){aP(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return t.prototype.render=function(t,n,r){if(e.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),Ode(r,t,{pan:AP(p9.pan,this),zoom:AP(p9.zoom,this),scrollMove:AP(p9.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){kde(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}(O7),p9={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=h9[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(y5(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:m9(function(e,t,n,r,i,a){var o=h9[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:m9(function(e,t,n,r,i,a){return h9[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})};function m9(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&(y5(e(o,s,t,n,r,i),o,[0,100],`all`),this.range=o,a[0]!==o[0]||a[1]!==o[1]))return o}}var h9={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e||=[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e||=[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function Ide(e){M7(e),e.registerComponentModel(Dde),e.registerComponentView(Fde),Pde(e)}var Lde=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.slider`,t.layoutMode=`box`,t.defaultOption=aq(E7.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:GJ.color.accent10,borderRadius:0,backgroundColor:GJ.color.transparent,dataBackground:{lineStyle:{color:GJ.color.accent30,width:.5},areaStyle:{color:GJ.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:GJ.color.accent40,width:.5},areaStyle:{color:GJ.color.accent20,opacity:.3}},fillerColor:`rgba(135,175,274,0.2)`,handleIcon:`path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z`,handleSize:`100%`,handleStyle:{color:GJ.color.neutral00,borderColor:GJ.color.accent20},moveHandleSize:7,moveHandleIcon:`path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z`,moveHandleStyle:{color:GJ.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:GJ.color.tertiary},brushSelect:!0,brushStyle:{color:GJ.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:GJ.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(E7),g9=jH,Rde=1,_9=30,zde=7,v9=`horizontal`,y9=`vertical`,Bde=5,Vde=[`line`,`bar`,`candlestick`,`scatter`],Hde={easing:`cubicOut`,duration:100,delay:0},Ude=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return t.prototype.init=function(e,t){this.api=t,this._onBrush=AP(this._onBrush,this),this._onBrushEnd=AP(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),TQ(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!i||i.type!==`dataZoom`||i.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){EQ(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new LR;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?zde:0,r=FJ(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===v9?{right:r.width-i.x-i.width,top:r.height-_9-a-n,width:i.width,height:_9}:{right:a,top:i.y,width:_9,height:i.height},s=BJ(e.option);$([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=NJ(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===y9&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===v9&&!i?{scaleY:o?1:-1,scaleX:1}:n===v9&&i?{scaleY:o?1:-1,scaleX:-1}:n===y9&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new g9({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new g9({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:AP(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(e.thisDim),u=i.getDataExtent(o),d=(u[1]-u[0])*.3;u=[u[0]-d,u[1]+d];var f=[0,t[1]],p=[0,t[0]],m=[[t[0],0],[0,0]],h=[],g=p[1]/Math.max(1,i.count()-1),_=t[0]/(l[1]-l[0]),v=e.thisAxis.type===`time`,y=-g,b=Math.round(i.count()/t[0]),x;i.each([e.thisDim,o],function(e,t,n){if(b>0&&n%b){v||(y+=g);return}y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:ZR(t,u,f,!0);r&&!x&&n?(m.push([m[m.length-1][0],0]),h.push([h[h.length-1][0],0])):!r&&x&&(m.push([y,0]),h.push([y,0])),r||(m.push([y,i]),h.push([y,i])),x=r}),s=this._shadowPolygonPts=m,c=this._shadowPolylinePts=h}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var S=this.dataZoomModel;function C(e){var t=S.getModel(e?`selectedDataBackground`:`dataBackground`),n=new LR,r=new $W({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new tG({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var w=0;w<3;w++){var T=C(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){$(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&&SP(Vde,e.get(`type`))<0)){var o=r.getComponent(C7(i),a).axis,s=Wde(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:e.getData().mapDimension(i),otherDim:s,otherAxisInverse:c}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new g9({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new g9({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:Rde,fill:GJ.color.transparent}})),$([0,1],function(t){var a=o.get(`handleIcon`);!S$[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a,process.env.NODE_ENV!==`production`&&Oz(`handleIcon now needs 'path://' prefix when using a path string`));var s=T$(a,-1,0,2,2,null,!0);s.attr({cursor:Gde(this._orient),draggable:!0,drift:AP(this._onDragMove,this,t),ondragend:AP(this._onDragEnd,this),onmouseover:AP(this._showDataInfo,this,!0),onmouseout:AP(this._showDataInfo,this,!1),z2:5});var c=s.getBoundingRect();this._handleHeight=QR(o.get(`handleSize`),this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),KU(s);var l=o.get(`handleColor`);l!=null&&(s.style.fill=l),i.add(n[t]=s);var u=o.getModel(`textStyle`),d=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new IH({silent:!0,invisible:!d,style:jK(u,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:u.getTextColor(),font:u.getFont()}),z2:10}))},this);var d=u;if(l){var f=QR(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new jH({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=T$(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,GJ.color.neutral00,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new jH({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:`default`,drift:AP(this._onDragMove,this,`all`),ondragstart:AP(this._showDataInfo,this,!0),ondragend:AP(this._onDragEnd,this),onmouseover:AP(this._showDataInfo,this,!0),onmouseout:AP(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[ZR(e[0],[0,100],t,!0),ZR(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];y5(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:ZR(a.minSpan,o,i,!0),a.maxSpan==null?null:ZR(a.maxSpan,o,i,!0));var s=this._range,c=this._range=nz([ZR(r[0],i,o,!0),ZR(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=nz(n.slice()),i=this._size;$([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;c<o.length;c++){var l=o[c],u=l.getClipPath();u||(u=new jH,l.setClipPath(u)),u.setShape({x:s[c],y:0,width:s[c+1]-s[c],height:i[1]})}this._updateDataInfo(e)},t.prototype._updateDataInfo=function(e){var t=this.dataZoomModel,n=this._displayables,r=n.handleLabels,i=this._orient,a=[``,``];if(t.get(`showDetail`)){var o=t.findRepresentativeAxisProxy();if(o){var s=o.getAxisModel().axis,c=this._range,l=e?o.calculateDataWindow({start:c[0],end:c[1]}).valueWindow:o.getDataValueWindow();a=[this._formatLabel(l[0],s),this._formatLabel(l[1],s)]}}var u=nz(this._handleEnds.slice());d.call(this,0),d.call(this,1);function d(e){var t=$G(n.handles[e].parent,this.group),o=tK(e===0?`right`:`left`,t),s=this._handleWidth/2+Bde,c=eK([u[e]+(e===0?-s:s),this._size[1]/2],t);r[e].setStyle({x:c[0],y:c[1],verticalAlign:i===v9?`middle`:o,align:i===v9?o:`center`,text:a[e]})}},t.prototype._formatLabel=function(e,t){var n=this.dataZoomModel,r=n.get(`labelFormatter`),i=n.get(`labelPrecision`);(i==null||i===`auto`)&&(i=t.getPixelPrecision());var a=e==null||isNaN(e)?``:t.type===`category`||t.type===`time`?t.scale.getLabel({value:Math.round(e)}):e.toFixed(Math.min(i,20));return NP(r)?r(e,a):PP(r)?r.replace(`{value}`,a):a},t.prototype._showDataInfo=function(e){var t=(this.dataZoomModel.get(`handleLabel`)||{}).show||!1,n=this.dataZoomModel.getModel([`emphasis`,`handleLabel`]).get(`show`)||!1,r=e||this._dragging?n:t,i=this._displayables,a=i.handleLabels;a[0].attr(`invisible`,!r),a[1].attr(`invisible`,!r),i.moveHandle&&this.api[r?`enterEmphasis`:`leaveEmphasis`](i.moveHandle,1)},t.prototype._onDragMove=function(e,t,n,r){this._dragging=!0,kF(r.event);var i=this._displayables.sliderGroup.getLocalTransform(),a=eK([t,n],i,!0),o=this._updateInterval(e,a[0]),s=this.dataZoomModel.get(`realtime`);this._updateView(!s),o&&s&&this._dispatchZoomAction(!0)},t.prototype._onDragEnd=function(){this._dragging=!1,this._showDataInfo(!1),!this.dataZoomModel.get(`realtime`)&&this._dispatchZoomAction(!1)},t.prototype._onClickPanel=function(e){var t=this._size,n=this._displayables.sliderGroup.transformCoordToLocal(e.offsetX,e.offsetY);if(!(n[0]<0||n[0]>t[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new BF(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],a=this._handleEnds=[n.x,n.x+n.width],o=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();y5(0,a,r,0,o.minSpan==null?null:ZR(o.minSpan,i,r,!0),o.maxSpan==null?null:ZR(o.maxSpan,i,r,!0)),this._range=nz([ZR(a[0],r,i,!0),ZR(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(kF(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new g9({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?Hde:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=w7(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},t.type=`dataZoom.slider`,t}(O7);function Wde(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function Gde(e){return e===`vertical`?`ns-resize`:`ew-resize`}function Kde(e){e.registerComponentModel(Lde),e.registerComponentView(Ude),M7(e)}function qde(e){n3(Ide),n3(Kde)}var b9={get:function(e,t,n){var r=vP((Jde[e]||{})[t]);return n&&MP(r)?r[r.length-1]:r}},Jde={color:{active:[`#006edd`,`#e0ffff`],inactive:[GJ.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:[`circle`,`roundRect`,`diamond`],inactive:[`none`]},symbolSize:{active:[10,50],inactive:[0,0]}},x9=s5.mapVisual,Yde=s5.eachVisual,Xde=MP,S9=$,Zde=nz,Qde=ZR,C9=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&fde(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=AP(e,this),this.controllerVisuals=J7(this.option.controller,t,e),this.targetVisuals=J7(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesId,t=this.option.seriesIndex;t==null&&e==null&&(t=`all`);var n=uB(this.ecModel,`series`,{index:t,id:e},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return TP(n,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){$(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],MP(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);if(PP(o))return o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c);if(NP(o))return s?o(e[0],e[1]):o(e);if(s)return e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1];return c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option;this._dataExtent=Zde([e.min,e.max])},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(t!=null)return e.getDimensionIndex(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var i=n[r],a=e.getDimensionInfo(i);if(!a.isCalculationCoord)return a.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};yP(r,n),yP(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){Xde(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},S9(r,function(e,t){if(s5.isValidType(t)){var n=b9.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;S9(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??=t&&vP(t)||(a?i:[i]),c.symbolSize??=n&&vP(n)||(a?s[0]:[s[0],s[0]]),c.symbol=x9(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;Yde(l,function(e){e>u&&(u=e)}),c.symbolSize=x9(l,function(e){return Qde(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:GJ.color.transparent,borderColor:GJ.color.borderTint,contentColor:GJ.color.theme[0],inactiveColor:GJ.color.disabled,borderWidth:0,padding:GJ.size.m,textGap:10,precision:0,textStyle:{color:GJ.color.secondary}},t}(UJ),w9=[20,140],$de=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod=`linear`,e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=w9[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=w9[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):MP(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),$(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=nz((this.get(`range`)||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]<e[0]&&(t[0]=e[0]),t[1]<e[0]&&(t[1]=e[0]),t},t.prototype.getValueState=function(e){var t=this.option.range,n=this.getExtent(),r=WP(this.option.unboundedRange,!0);return(r&&t[0]<=n[0]||t[0]<=e)&&(r&&t[1]>=n[1]||e<=t[1])?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=T9(this,`outOfRange`,this.getExtent()),n=T9(this,`inRange`,this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,c=t.length;o<c&&(!n.length||t[o]<=n[0]);o++)t[o]<n[a]&&i(t[o],`outOfRange`);for(var l=1;a<s;a++,l=0)l&&r.length&&i(n[a],`outOfRange`),i(n[a],`inRange`);for(var l=1;o<c;o++)(!n.length||n[n.length-1]<t[o])&&(l&&=(r.length&&i(r[r.length-1].value,`outOfRange`),0),i(t[o],`outOfRange`));var u=r.length;return{stops:r,outerColors:[u?r[0].color:`transparent`,u?r[u-1].color:`transparent`]}},t.type=`visualMap.continuous`,t.defaultOption=aq(C9.defaultOption,{align:`auto`,calculable:!1,hoverLink:!0,realtime:!0,handleIcon:`path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z`,handleSize:`120%`,handleStyle:{borderColor:GJ.color.neutral00,borderWidth:1},indicatorIcon:`circle`,indicatorSize:`50%`,indicatorStyle:{borderColor:GJ.color.neutral00,borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:GJ.color.shadow}}),t}(C9);function T9(e,t,n){if(n[0]===n[1])return n.slice();for(var r=200,i=(n[1]-n[0])/r,a=n[0],o=[],s=0;s<=r&&a<n[1];s++)o.push(a),a+=i;return o.push(n[1]),o}var E9=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.autoPositionValues={left:1,right:1,top:1,bottom:1},n}return t.prototype.init=function(e,t){this.ecModel=e,this.api=t},t.prototype.render=function(e,t,n,r){if(this.visualMapModel=e,e.get(`show`)===!1){this.group.removeAll();return}this.doRender(e,t,n,r)},t.prototype.renderBackground=function(e){var t=this.visualMapModel,n=iJ(t.get(`padding`)||0),r=e.getBoundingRect();e.add(new jH({z2:-1,silent:!0,shape:{x:r.x-n[3],y:r.y-n[0],width:r.width+n[3]+n[1],height:r.height+n[0]+n[2]},style:{fill:t.get(`backgroundColor`),stroke:t.get(`borderColor`),lineWidth:t.get(`borderWidth`)}}))},t.prototype.getControllerVisual=function(e,t,n){n||={};var r=n.forceState,i=this.visualMapModel,a={};t===`color`&&(a.color=i.get(`contentColor`));function o(e){return a[e]}function s(e,t){a[e]=t}var c=i.controllerVisuals[r||i.getValueState(e)];return $(s5.prepareVisualTypes(c),function(r){var i=c[r];n.convertOpacityToAlpha&&r===`opacity`&&(r=`colorAlpha`,i=c.__alphaForOpacity),s5.dependsOn(r,t)&&i&&i.applyVisual(e,o,s)}),a[t]},t.prototype.positionGroup=function(e){var t=this.visualMapModel,n=this.api,r=FJ(t,n).refContainer;IJ(e,t.getBoxLayoutParams(),r)},t.prototype.doRender=function(e,t,n,r){},t.type=`visualMap`,t}(dQ),D9=[[`left`,`right`,`width`],[`top`,`bottom`,`height`]];function O9(e,t,n){var r=e.option,i=r.align;if(i!=null&&i!==`auto`)return i;for(var a={width:t.getWidth(),height:t.getHeight()},o=+(r.orient===`horizontal`),s=D9[o],c=[0,null,10],l={},u=0;u<3;u++)l[D9[1-o][u]]=c[u],l[s[u]]=u===2?n[0]:r[s[u]];var d=[[`x`,`width`,3],[`y`,`height`,0]][o],f=NJ(l,a,r.padding);return s[(f.margin[d[2]]||0)+f[d[0]]+f[d[1]]*.5<a[d[1]]*.5?0:1]}function k9(e,t){return $(e||[],function(e){e.dataIndex!=null&&(e.dataIndexInside=e.dataIndex,e.dataIndex=null),e.highlightKey=`visualMap`+(t?t.componentIndex:``)}),e}var A9=ZR,efe=$,j9=Math.min,M9=Math.max,tfe=12,nfe=6,rfe=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._shapes={},n._dataInterval=[],n._handleEnds=[],n._hoverLinkDataIndices=[],n}return t.prototype.init=function(t,n){e.prototype.init.call(this,t,n),this._hoverLinkFromSeriesMouseOver=AP(this._hoverLinkFromSeriesMouseOver,this),this._hideIndicator=AP(this._hideIndicator,this)},t.prototype.doRender=function(e,t,n,r){(!r||r.type!==`selectDataRange`||r.from!==this.uid)&&this._buildView()},t.prototype._buildView=function(){this.group.removeAll();var e=this.visualMapModel,t=this.group;this._orient=e.get(`orient`),this._useHandle=e.get(`calculable`),this._resetInterval(),this._renderBar(t);var n=e.get(`text`);this._renderEndsText(t,n,0),this._renderEndsText(t,n,1),this._updateView(!0),this.renderBackground(t),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(t)},t.prototype._renderEndsText=function(e,t,n){if(t){var r=t[1-n];r=r==null?``:r+``;var i=this.visualMapModel,a=i.get(`textGap`),o=i.itemSize,s=this._shapes.mainGroup,c=this._applyTransform([o[0]/2,n===0?-a:o[1]+a],s),l=this._applyTransform(n===0?`bottom`:`top`,s),u=this._orient,d=this.visualMapModel.textStyleModel;this.group.add(new IH({style:jK(d,{x:c[0],y:c[1],verticalAlign:d.get(`verticalAlign`)||(u===`horizontal`?`middle`:l),align:d.get(`align`)||(u===`horizontal`?l:`center`),text:r})}))}},t.prototype._renderBar=function(e){var t=this.visualMapModel,n=this._shapes,r=t.itemSize,i=this._orient,a=this._useHandle,o=O9(t,this.api,r),s=n.mainGroup=this._createBarGroup(o),c=new LR;s.add(c),c.add(n.outOfRange=N9()),c.add(n.inRange=N9(null,a?F9(this._orient):null,AP(this._dragHandle,this,`all`,!1),AP(this._dragHandle,this,`all`,!0))),c.setClipPath(new jH({shape:{x:0,y:0,width:r[0],height:r[1],r:3}}));var l=t.textStyleModel.getTextRect(`国`),u=M9(l.width,l.height);a&&(n.handleThumbs=[],n.handleLabels=[],n.handleLabelPoints=[],this._createHandle(t,s,0,r,u,i),this._createHandle(t,s,1,r,u,i)),this._createIndicator(t,s,r,u,i),e.add(s)},t.prototype._createHandle=function(e,t,n,r,i,a){var o=AP(this._dragHandle,this,n,!1),s=AP(this._dragHandle,this,n,!0),c=xR(e.get(`handleSize`),r[0]),l=T$(e.get(`handleIcon`),-c/2,-c/2,c,c,null,!0),u=F9(this._orient);l.attr({cursor:u,draggable:!0,drift:o,ondragend:s,onmousemove:function(e){kF(e.event)}}),l.x=r[0]/2,l.useStyle(e.getModel(`handleStyle`).getItemStyle()),l.setStyle({strokeNoScale:!0,strokeFirst:!0}),l.style.lineWidth*=2,l.ensureState(`emphasis`).style=e.getModel([`emphasis`,`handleStyle`]).getItemStyle(),$U(l,!0),t.add(l);var d=this.visualMapModel.textStyleModel,f=new IH({cursor:u,draggable:!0,drift:o,onmousemove:function(e){kF(e.event)},ondragend:s,style:jK(d,{x:0,y:0,text:``})});f.ensureState(`blur`).style={opacity:.1},f.stateTransition={duration:200},this.group.add(f);var p=[c,0],m=this._shapes;m.handleThumbs[n]=l,m.handleLabelPoints[n]=p,m.handleLabels[n]=f},t.prototype._createIndicator=function(e,t,n,r,i){var a=xR(e.get(`indicatorSize`),n[0]),o=T$(e.get(`indicatorIcon`),-a/2,-a/2,a,a,null,!0);o.attr({cursor:`move`,invisible:!0,silent:!0,x:n[0]/2});var s=e.getModel(`indicatorStyle`).getItemStyle();if(o instanceof CH){var c=o.style;o.useStyle(bP({image:c.image,x:c.x,y:c.y,width:c.width,height:c.height},s))}else o.useStyle(s);t.add(o);var l=this.visualMapModel.textStyleModel,u=new IH({silent:!0,invisible:!0,style:jK(l,{x:0,y:0,text:``})});this.group.add(u);var d=[(i===`horizontal`?r/2:nfe)+n[0]/2,0],f=this._shapes;f.indicator=o,f.indicatorLabel=u,f.indicatorLabelPoint=d,this._firstShowIndicator=!0},t.prototype._dragHandle=function(e,t,n,r){if(this._useHandle){if(this._dragging=!t,!t){var i=this._applyTransform([n,r],this._shapes.mainGroup,!0);this._updateInterval(e,i[1]),this._hideIndicator(),this._updateView()}t===!this.visualMapModel.get(`realtime`)&&this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),t?!this._hovering&&this._clearHoverLinkToSeries():P9(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[e],!1)}},t.prototype._resetInterval=function(){var e=this.visualMapModel,t=this._dataInterval=e.getSelected(),n=e.getExtent(),r=[0,e.itemSize[1]];this._handleEnds=[A9(t[0],n,r,!0),A9(t[1],n,r,!0)]},t.prototype._updateInterval=function(e,t){t||=0;var n=this.visualMapModel,r=this._handleEnds,i=[0,n.itemSize[1]];y5(t,r,i,e,0);var a=n.getExtent();this._dataInterval=[A9(r[0],i,a,!0),A9(r[1],i,a,!0)]},t.prototype._updateView=function(e){var t=this.visualMapModel,n=t.getExtent(),r=this._shapes,i=[0,t.itemSize[1]],a=e?i:this._handleEnds,o=this._createBarVisual(this._dataInterval,n,a,`inRange`),s=this._createBarVisual(n,n,i,`outOfRange`);r.inRange.setStyle({fill:o.barColor}).setShape(`points`,o.barPoints),r.outOfRange.setStyle({fill:s.barColor}).setShape(`points`,s.barPoints),this._updateHandle(a,o)},t.prototype._createBarVisual=function(e,t,n,r){var i={forceState:r,convertOpacityToAlpha:!0},a=this._makeColorGradient(e,i),o=[this.getControllerVisual(e[0],`symbolSize`,i),this.getControllerVisual(e[1],`symbolSize`,i)],s=this._createBarPoints(n,o);return{barColor:new pG(0,0,0,1,a),barPoints:s,handlesColor:[a[0].color,a[a.length-1].color]}},t.prototype._makeColorGradient=function(e,t){var n=100,r=[],i=(e[1]-e[0])/n;r.push({color:this.getControllerVisual(e[0],`color`,t),offset:0});for(var a=1;a<n;a++){var o=e[0]+i*a;if(o>e[1])break;r.push({color:this.getControllerVisual(o,`color`,t),offset:a/n})}return r.push({color:this.getControllerVisual(e[1],`color`,t),offset:1}),r},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get(`inverse`);return new LR(t===`horizontal`&&!n?{scaleX:e===`bottom`?1:-1,rotation:Math.PI/2}:t===`horizontal`&&n?{scaleX:e===`bottom`?-1:1,rotation:-Math.PI/2}:t===`vertical`&&!n?{scaleX:e===`left`?1:-1,scaleY:-1}:{scaleX:e===`left`?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,a=n.handleLabels,o=r.itemSize,s=r.getExtent(),c=this._applyTransform(`left`,n.mainGroup);efe([0,1],function(l){var u=i[l];u.setStyle(`fill`,t.handlesColor[l]),u.y=e[l];var d=A9(e[l],[0,o[1]],s,!0),f=this.getControllerVisual(d,`symbolSize`);u.scaleX=u.scaleY=f/o[0],u.x=o[0]-f/2;var p=eK(n.handleLabelPoints[l],$G(u,this.group));if(this._orient===`horizontal`){var m=c===`left`||c===`top`?(o[0]-f)/2:(o[0]-f)/-2;p[1]+=m}a[l].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:`middle`,align:this._orient===`vertical`?this._applyTransform(`left`,n.mainGroup):`center`})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,a=i.getExtent(),o=i.itemSize,s=[0,o[1]],c=this._shapes,l=c.indicator;if(l){l.attr(`invisible`,!1);var u=this.getControllerVisual(e,`color`,{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,`symbolSize`),f=A9(e,a,s,!0),p=o[0]-d/2,m={x:l.x,y:l.y};l.y=f,l.x=p;var h=eK(c.indicatorLabelPoint,$G(l,this.group)),g=c.indicatorLabel;g.attr(`invisible`,!1);var _=this._applyTransform(`left`,c.mainGroup),v=this._orient===`horizontal`;g.setStyle({text:(n||``)+i.formatValueText(t),verticalAlign:v?_:`middle`,align:v?`center`:_});var y={x:p,y:f,style:{fill:u}},b={style:{x:h[0],y:h[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var x={duration:100,easing:`cubicInOut`,additive:!0};l.x=m.x,l.y=m.y,l.animateTo(y,x),g.animateTo(b,x)}else l.attr(y),g.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;C<S.length;C++)this.api.enterBlur(S[C])}},t.prototype._enableHoverLinkToSeries=function(){var e=this;this._shapes.mainGroup.on(`mousemove`,function(t){if(e._hovering=!0,!e._dragging){var n=e.visualMapModel.itemSize,r=e._applyTransform([t.offsetX,t.offsetY],e._shapes.mainGroup,!0,!0);r[1]=j9(M9(0,r[1]),n[1]),e._doHoverLinkToSeries(r[1],0<=r[0]&&r[0]<=n[0])}}).on(`mouseout`,function(){e._hovering=!1,!e._dragging&&e._clearHoverLinkToSeries()})},t.prototype._enableHoverLinkFromSeries=function(){var e=this.api.getZr();this.visualMapModel.option.hoverLink?(e.on(`mouseover`,this._hoverLinkFromSeriesMouseOver,this),e.on(`mouseout`,this._hideIndicator,this)):this._clearHoverLinkFromSeries()},t.prototype._doHoverLinkToSeries=function(e,t){var n=this.visualMapModel,r=n.itemSize;if(n.option.hoverLink){var i=[0,r[1]],a=n.getExtent();e=j9(M9(i[0],e),i[1]);var o=ife(n,a,i),s=[e-o,e+o],c=A9(e,i,a,!0),l=[A9(s[0],i,a,!0),A9(s[1],i,a,!0)];s[0]<i[0]&&(l[0]=-1/0),s[1]>i[1]&&(l[1]=1/0),t&&(l[0]===-1/0?this._showIndicator(c,l[1],`< `,o):l[1]===1/0?this._showIndicator(c,l[0],`> `,o):this._showIndicator(c,c,`≈ `,o));var u=this._hoverLinkDataIndices,d=[];(t||P9(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(l));var f=nB(u,d);this._dispatchHighDown(`downplay`,k9(f[0],n)),this._dispatchHighDown(`highlight`,k9(f[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(h$(e.target,function(e){var n=XH(e);if(n.dataIndex!=null)return t=n,!0},!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),a=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(a)||this._showIndicator(a,a)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr(`invisible`,!0),e.indicatorLabel&&e.indicatorLabel.attr(`invisible`,!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n<t.length;n++)this.api.leaveBlur(t[n])},t.prototype._clearHoverLinkToSeries=function(){this._hideIndicator();var e=this._hoverLinkDataIndices;this._dispatchHighDown(`downplay`,k9(e,this.visualMapModel)),e.length=0},t.prototype._clearHoverLinkFromSeries=function(){this._hideIndicator();var e=this.api.getZr();e.off(`mouseover`,this._hoverLinkFromSeriesMouseOver),e.off(`mouseout`,this._hideIndicator)},t.prototype._applyTransform=function(e,t,n,r){var i=$G(t,r?null:this.group);return MP(e)?eK(e,i,n):tK(e,i,n)},t.prototype._dispatchHighDown=function(e,t){t&&t.length&&this.api.dispatchAction({type:e,batch:t})},t.prototype.dispose=function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},t.type=`visualMap.continuous`,t}(E9);function N9(e,t,n,r){return new $W({shape:{points:e},draggable:!!n,cursor:t,drift:n,onmousemove:function(e){kF(e.event)},ondragend:r})}function ife(e,t,n){var r=tfe/2,i=e.get(`hoverLinkDataSize`);return i&&(r=A9(i,t,n,!0)/2),r}function P9(e){return!!(e.get(`hoverLinkOnHandle`)??e.get(`realtime`))}function F9(e){return e===`vertical`?`ns-resize`:`ew-resize`}var afe={type:`selectDataRange`,event:`dataRangeSelected`,update:`update`},ofe=function(e,t){t.eachComponent({mainType:`visualMap`,query:e},function(t){t.setSelected(e.selected)})},sfe=[{createOnAllSeries:!0,reset:function(e,t){var n=[];return t.eachComponent(`visualMap`,function(t){var r=e.pipelineContext;!t.isTargetSeries(e)||r&&r.large||n.push(pde(t.stateList,t.targetVisuals,AP(t.getValueState,t),t.getDataDimensionIndex(e.getData())))}),n}},{createOnAllSeries:!0,reset:function(e,t){var n=e.getData(),r=[];t.eachComponent(`visualMap`,function(t){if(t.isTargetSeries(e)){var i=t.getVisualMeta(AP(cfe,null,e,t))||{stops:[],outerColors:[]},a=t.getDataDimensionIndex(n);a>=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}];function cfe(e,t,n,r){for(var i=t.targetVisuals[r],a=s5.prepareVisualTypes(i),o={color:u$(e.getData(),`color`)},s=0,c=a.length;s<c;s++){var l=a[s],u=i[l===`opacity`?`__alphaForOpacity`:l];u&&u.applyVisual(n,d,f)}return o.color;function d(e){return o[e]}function f(e,t){o[e]=t}}var I9=$;function lfe(e){var t=e&&e.visualMap;MP(t)||(t=t?[t]:[]),I9(t,function(e){if(e){L9(e,`splitList`)&&!L9(e,`pieces`)&&(e.pieces=e.splitList,delete e.splitList);var t=e.pieces;t&&MP(t)&&I9(t,function(e){LP(e)&&(L9(e,`start`)&&!L9(e,`min`)&&(e.min=e.start),L9(e,`end`)&&!L9(e,`max`)&&(e.max=e.end))})}})}function L9(e,t){return e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var R9=!1;function z9(e){R9||(R9=!0,e.registerSubTypeDefaulter(`visualMap`,function(e){return!e.categories&&(!(e.pieces?e.pieces.length>0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(afe,ofe),$(sfe,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(lfe))}function ufe(e){e.registerComponentModel($de),e.registerComponentView(rfe),z9(e)}var dfe=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],ffe[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=vP(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=TP(this._pieceList,function(e){return e=vP(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=s5.listVisualTypes(),i=this.isCategory();$(t.pieces,function(e){$(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),$(n,function(e,n){var r=!1;$(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&$(this.stateList,function(e){(t[e]||(t[e]={}))[n]=b9.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,$(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;$(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=vP(e)},t.prototype.getValueState=function(e){var t=s5.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){s5.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return $(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=aq(C9.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:`auto`,itemWidth:20,itemHeight:14,itemSymbol:`roundRect`,pieces:null,categories:null,splitNumber:5,selectedMode:`multiple`,itemGap:10,hoverLink:!0}),t}(C9),ffe={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o<i;s+=a,o++){var c=o===i-1?r[1]:s+a;e.push({interval:[s,c],close:[1,1]})}t.maxOpen&&e.push({interval:[r[1],1/0],close:[0,0]}),hz(e),$(e,function(e,t){e.index=t,e.text=this.formatValueText(e.interval)},this)},categories:function(e){var t=this.option;$(t.categories,function(t){e.push({text:this.formatValueText(t,!0),value:t})},this),B9(t,e)},pieces:function(e){var t=this.option;$(t.pieces,function(t,n){LP(t)||(t={value:t});var r={text:``,index:n};if(t.label!=null&&(r.text=t.label),t.hasOwnProperty(`value`)){var i=r.value=t.value;r.interval=[i,i],r.close=[1,1]}else{for(var a=r.interval=[],o=r.close=[0,0],s=[1,0,1],c=[-1/0,1/0],l=[],u=0;u<2;u++){for(var d=[[`gte`,`gt`,`min`],[`lte`,`lt`,`max`]][u],f=0;f<3&&a[u]==null;f++)a[u]=t[d[f]],o[u]=s[f],l[u]=f===2;a[u]??(a[u]=c[u])}l[0]&&a[1]===1/0&&(o[0]=0),l[1]&&a[0]===-1/0&&(o[1]=0),process.env.NODE_ENV!==`production`&&a[0]>a[1]&&console.warn(`Piece `+n+`is illegal: `+a+` lower bound should not greater then uppper bound.`),a[0]===a[1]&&o[0]&&o[1]&&(r.value=a[0])}r.visual=s5.retrieveVisuals(t),e.push(r)},this),B9(t,e),hz(e),$(e,function(e){var t=e.close,n=[[`<`,`≤`][t[1]],[`>`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}};function B9(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var pfe=function(e){aP(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=UP(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),$(o.viewPieceList,function(o){var s=o.piece,u=new LR;u.onclick=AP(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new IH({style:jK(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:WP(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),kJ(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:k9(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return O9(e,this.api,e.itemSize);var n=t.align;return(!n||n===`auto`)&&(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new LR,o=this.visualMapModel.textStyleModel;a.add(new IH({style:jK(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=TP(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=T$(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=vP(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,$(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(E9);function mfe(e){e.registerComponentModel(dfe),e.registerComponentView(pfe),z9(e)}function hfe(e){n3(ufe),n3(mfe)}var gfe=[`getWidth`,`getHeight`,`getDom`,`getOption`,`resize`,`dispatchAction`,`convertToPixel`,`convertFromPixel`,`containPixel`,`getDataURL`,`getConnectedDataURL`,`appendData`,`clear`,`isDisposed`,`dispose`];function _fe(e){function t(t){return function(...n){if(!e.value)throw Error(`ECharts is not initialized yet.`);return Reflect.apply(e.value[t],e.value,n)}}return gfe.reduce((e,n)=>(e[n]=t(n),e),{})}function vfe(e,n,r){(0,t.watch)([r,e,n],([e,t,n],r,i)=>{let a=null;if(e&&t&&n){let{offsetWidth:r,offsetHeight:i}=e,{throttle:o=100,onResize:s}=n===!0?{}:n,c=!1,l=()=>{t.resize(),s?.()},u=o?wQ(l,o):l;a=new ResizeObserver(()=>{!c&&(c=!0,e.offsetWidth===r&&e.offsetHeight===i)||e.offsetWidth===0||e.offsetHeight===0||u()}),a.observe(e)}i(()=>{a&&=(a.disconnect(),null)})})}var yfe={autoresize:[Boolean,Object]},bfe=Symbol();function xfe(e,n,r){let i=(0,t.inject)(bfe,{}),a=(0,t.computed)(()=>({...(0,t.toValue)(i),...r?.value}));(0,t.watchEffect)(()=>{let t=e.value;t&&(n.value?t.showLoading(a.value):t.hideLoading())})}var Sfe={loading:Boolean,loadingOptions:Object};function V9(){return typeof window<`u`&&typeof document<`u`}var Cfe=/^on[^a-z]/,H9=e=>Cfe.test(e);function wfe(e){let t={};for(let n in e)H9(n)||(t[n]=e[n]);return t}function Tfe(e){let t=Number(e);return Number.isInteger(t)&&t>=0&&t<2**32-1&&String(t)===e}function Efe(e,t){let n=new Set(e),r=new Set(t);if(n.size!==r.size)return!1;for(let e of n)if(!r.has(e))return!1;return!0}function U9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Dfe=`[vue-echarts]`;function W9(e){(0,t.warn)(`${Dfe} ${e}`)}var G9={tooltip:[`tooltip`,`formatter`],dataView:[`toolbox`,`feature`,`dataView`,`optionToContent`]},Ofe=Object.keys(G9);function K9(e){return Ofe.some(t=>e===t||e.startsWith(t+`-`))}function kfe(e,n){let r=V9()?document.createElement(`div`):void 0,i=(0,t.shallowReactive)({}),a=(0,t.shallowReactive)({}),o=(0,t.shallowReactive)({}),s=(0,t.shallowRef)(!1),c=()=>s.value&&r?(0,t.h)(t.Teleport,{to:r},Object.entries(e).filter(([e])=>K9(e)).map(([e,n])=>{let r=e;return(0,t.h)(`div`,{ref:e=>{e instanceof HTMLElement&&(i[r]=e)},style:{display:`contents`}},a[r]?n?.(o[r]):void 0)})):void 0;function l(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function u(t){let n={...t},r=(e,t)=>{let n=e[t];if(Array.isArray(n))return e[t]=[...n],e[t];if(l(n))return e[t]={...n},e[t];if(n===void 0)return e[t]=Tfe(t)?[]:{},e[t]};return Object.keys(e).filter(e=>{let t=K9(e);return t||W9(`Invalid slot name: ${e}`),t}).forEach(e=>{let[t,...s]=e.split(`-`),c=G9[t];if(!c)return;let l=[...s,...c];if(l.length===0)return;let u=n;for(let e=0;e<l.length-1;e++)if(u=r(u,l[e]),!u)return;u[l[l.length-1]]=t=>(a[e]=!0,o[e]=t,i[e])}),n}let d=[];return(0,t.onUpdated)(()=>{let t=Object.keys(e).filter(K9);Efe(t,d)||(d.forEach(e=>{t.includes(e)||(delete o[e],delete a[e],delete i[e])}),d=t,n())}),(0,t.onMounted)(()=>{s.value=!0}),(0,t.onUnmounted)(()=>{r?.remove()}),{teleportedSlots:c,patchOption:u}}var q9=null,J9=`x-vue-echarts`;function Afe(){if(q9!=null)return q9;let e=globalThis.customElements;if(!V9()||!e?.get)return q9=!1,q9;if(!e.get(J9))try{class t extends HTMLElement{__dispose=null;disconnectedCallback(){this.__dispose&&=(this.__dispose(),null)}}e.define(J9,t)}catch{return q9=!1,q9}return q9=!0,q9}function jfe(e){if(!U9(e))return;let t=e.id;if(typeof t==`string`)return t;if(typeof t==`number`&&Number.isFinite(t))return String(t)}function Y9(e){let t=e,n=Array.isArray(t.options)?t.options.length:0,r=Array.isArray(t.media)?t.media.length:0,i=Object.create(null),a=[],o=[];for(let e of Object.keys(t)){if(e===`options`||e===`media`)continue;let n=t[e];if(Array.isArray(n)){let t=n,r=new Set,a=0;for(let e=0;e<t.length;e++){let n=jfe(t[e]);n===void 0?a++:r.add(n)}i[e]={idsSorted:r.size>0?Array.from(r).sort():[],noIdCount:a}}else U9(n)?a.push(e):n!==void 0&&o.push(e)}return a.length>1&&a.sort(),o.length>1&&o.sort(),{optionsLength:n,mediaLength:r,arrays:i,objects:a,scalars:o}}function X9(e,t){if(e.length===0)return[];if(t.length===0)return e.slice();let n=new Set(t),r=[];for(let t=0;t<e.length;t++){let i=e[t];n.has(i)||r.push(i)}return r}function Mfe(e,t){if(e.length===0)return!1;if(t.length===0)return!0;let n=new Set(t);for(let t=0;t<e.length;t++)if(!n.has(e[t]))return!0;return!1}function Nfe(e,t){let n=Y9(t);if(!e)return{option:t,signature:n,plan:{notMerge:!1}};if(n.optionsLength<e.optionsLength||n.mediaLength<e.mediaLength||X9(e.scalars,n.scalars).length>0)return{option:t,signature:n,plan:{notMerge:!0}};let r=new Set,i=new Map,a=X9(e.objects,n.objects);for(let e=0;e<a.length;e++)i.set(a[e],null);for(let t of Object.keys(e.arrays)){let a=e.arrays[t];if(!a)continue;let o=n.arrays[t];if(!o){(a.idsSorted.length>0||a.noIdCount>0)&&(i.set(t,[]),r.add(t));continue}if(Mfe(a.idsSorted,o.idsSorted)){r.add(t);continue}o.noIdCount<a.noIdCount&&r.add(t)}let o=t,s=n;if(i.size>0){let e={...t};i.forEach((t,n)=>{e[n]=t}),o=e,s=Y9(o)}let c=r.size>0?Array.from(r).sort():void 0;return{option:o,signature:s,plan:c?{notMerge:!1,replaceMerge:c}:{notMerge:!1}}}var Z9=`x-vue-echarts{display:block;width:100%;height:100%;min-width:0;}
5648
5648
  x-vue-echarts>:first-child,x-vue-echarts>:first-child>canvas{border-radius:inherit;}
5649
- `;if(typeof document<`u`)if(Array.isArray(document.adoptedStyleSheets)&&`replaceSync`in CSSStyleSheet.prototype){let e=new CSSStyleSheet;e.replaceSync(Z9),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}else{let e=document.createElement(`style`);e.textContent=Z9,document.head.appendChild(e)}var Pfe=Afe(),Ffe=Symbol(),Ife=Symbol(),Lfe=Symbol(),Rfe=(0,t.defineComponent)({name:`Echarts`,inheritAttrs:!1,props:{option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean,...yfe,...Sfe},emits:{},slots:Object,setup(e,{attrs:n,expose:r,slots:i}){let a=(0,t.shallowRef)(),o=(0,t.shallowRef)(),s=(0,t.inject)(Ffe,null),c=(0,t.inject)(Ife,null),l=(0,t.inject)(Lfe,null),{autoresize:u,manualUpdate:d,loading:f,loadingOptions:p}=(0,t.toRefs)(e),m=(0,t.computed)(()=>e.theme||(0,t.toValue)(s)),h=(0,t.computed)(()=>e.initOptions||(0,t.toValue)(c)||void 0),g=(0,t.computed)(()=>e.updateOptions||(0,t.toValue)(l)),_=(0,t.computed)(()=>wfe(n)),v={},y=new Map,{teleportedSlots:b,patchOption:x}=kfe(i,()=>{!d.value&&e.option&&o.value&&w(o.value,e.option)}),S;function C(e){let t={},n=(e?.replaceMerge??[]).filter(e=>e!=null);return n.length>0&&(t.replaceMerge=[...new Set(n)]),e?.notMerge!==void 0&&(t.notMerge=e.notMerge),t}function w(e,t,n,r=!1){let i=x(t);if(r){e.setOption(i,n??{}),S=void 0;return}if(g.value){let t=n??g.value;e.setOption(i,t),S=void 0;return}let a=Nfe(S,i),o=C(a.plan);e.setOption(a.option,o),S=a.signature}Object.keys(n).filter(e=>H9(e)).forEach(e=>{if(e.indexOf(`Native:`)===2){let t=`on${e.charAt(9).toUpperCase()}${e.slice(10)}`;v[t]=n[e];return}let t=e.charAt(2).toLowerCase()+e.slice(3),r;t.indexOf(`zr:`)===0&&(r=!0,t=t.substring(3));let i;t.substring(t.length-4)===`Once`&&(i=!0,t=t.substring(0,t.length-4)),y.set({event:t,zr:r,once:i},n[e])});function T(){if(!a.value)return;let n=o.value=z0(a.value,m.value,h.value);e.group&&(n.group=e.group),y.forEach((e,{zr:t,once:r,event:i})=>{if(!e)return;let a=t?n.getZr():n;if(r){let t=e,n=!1;e=(...r)=>{n||(n=!0,t(...r),a.off(i,e))}}a.on(i,e)});function r(){n&&!n.isDisposed()&&n.resize()}function i(){let{option:t}=e;if(d.value){t&&w(n,t,void 0,!0);return}t&&w(n,t)}u.value?(0,t.nextTick)(()=>{r(),i()}):i()}let E=(t,n,r)=>{if(!e.manualUpdate){W9("`setOption` is only available when `manual-update` is `true`.");return}let i=typeof n==`boolean`?{notMerge:n,lazyUpdate:r}:n;o.value&&w(o.value,t,i??void 0,!0)};function D(){o.value&&=(o.value.dispose(),void 0),S=void 0}(0,t.watch)(()=>e.option,e=>{if(!e){S=void 0;return}if(d.value){W9("`option` prop changes are ignored when `manual-update` is `true`.");return}o.value&&w(o.value,e)},{deep:!0}),(0,t.watch)([d,h],()=>{D(),T()},{deep:!0}),(0,t.watch)(m,e=>{o.value?.setTheme(e||{})},{deep:!0}),(0,t.watchEffect)(()=>{e.group&&o.value&&(o.value.group=e.group)});let O=_fe(o);return xfe(o,f,p),vfe(o,u,a),(0,t.onMounted)(()=>{T()}),(0,t.onBeforeUnmount)(()=>{Pfe&&a.value?a.value.__dispose=D:D()}),r({setOption:E,root:a,chart:o,...O}),(()=>(0,t.h)(J9,{..._.value,...v,ref:a,class:[`echarts`,_.value.class]},b()))}}),zfe={class:`echart-renderer`},Bfe=HT((0,t.defineComponent)({__name:`EChartRenderer`,props:{type:{},option:{},loading:{type:Boolean},theme:{}},setup(e){return n3([dse,Nse,Jse,ice,Ele,ele,lle,Vle,Ple,gde,dde,Ede,Eue,qde,Z8,hfe,Aue,Rue]),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,zfe,[(0,t.createVNode)((0,t.unref)(Rfe),{option:e.option,loading:e.loading,theme:e.theme,autoresize:``,style:{width:`100%`,height:`100%`}},null,8,[`option`,`loading`,`theme`])]))}}),[[`__scopeId`,`data-v-16ef0443`]]);function Vfe(e,t,n,r,i){if(!e||e.length===0)return Jfe(n);let a;return a=t===`pie`?Ufe(e,n,r):t===`gauge`?Wfe(e,n,r):t===`radar`?Gfe(e,n,r):t===`heatmap`?Kfe(e,n,r):t===`funnel`?qfe(e,n,r):Hfe(e,t,n,r),i&&(a=Q9(a,i)),a}function Hfe(e,t,n,r){let i=e.map(e=>e[r.xField]),a=Array.isArray(r.yField)?r.yField:[r.yField],o=a.map(n=>({name:n,type:t===`scatter`?`scatter`:t,data:e.map(e=>e[n]??null),smooth:t===`line`}));return{title:{text:n,left:`center`,textStyle:{fontSize:14}},tooltip:{trigger:`axis`},legend:a.length>1?{bottom:0}:void 0,grid:{left:`3%`,right:`4%`,bottom:a.length>1?40:20,containLabel:!0},xAxis:{type:`category`,data:i,axisLabel:{rotate:i.length>8?30:0}},yAxis:{type:`value`},series:o}}function Ufe(e,t,n){let r=Array.isArray(n.yField)?n.yField[0]:n.yField,i=e.map(e=>({name:e[n.xField],value:e[r]??0}));return{title:{text:t,left:`center`,textStyle:{fontSize:14}},tooltip:{trigger:`item`,formatter:`{b}: {c} ({d}%)`},legend:{bottom:0,type:`scroll`},series:[{type:`pie`,radius:[`35%`,`65%`],center:[`50%`,`50%`],data:i,label:{show:!0,formatter:`{b}
5649
+ `;if(typeof document<`u`)if(Array.isArray(document.adoptedStyleSheets)&&`replaceSync`in CSSStyleSheet.prototype){let e=new CSSStyleSheet;e.replaceSync(Z9),document.adoptedStyleSheets=[...document.adoptedStyleSheets,e]}else{let e=document.createElement(`style`);e.textContent=Z9,document.head.appendChild(e)}var Pfe=Afe(),Ffe=Symbol(),Ife=Symbol(),Lfe=Symbol(),Rfe=(0,t.defineComponent)({name:`Echarts`,inheritAttrs:!1,props:{option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean,...yfe,...Sfe},emits:{},slots:Object,setup(e,{attrs:n,expose:r,slots:i}){let a=(0,t.shallowRef)(),o=(0,t.shallowRef)(),s=(0,t.inject)(Ffe,null),c=(0,t.inject)(Ife,null),l=(0,t.inject)(Lfe,null),{autoresize:u,manualUpdate:d,loading:f,loadingOptions:p}=(0,t.toRefs)(e),m=(0,t.computed)(()=>e.theme||(0,t.toValue)(s)),h=(0,t.computed)(()=>e.initOptions||(0,t.toValue)(c)||void 0),g=(0,t.computed)(()=>e.updateOptions||(0,t.toValue)(l)),_=(0,t.computed)(()=>wfe(n)),v={},y=new Map,{teleportedSlots:b,patchOption:x}=kfe(i,()=>{!d.value&&e.option&&o.value&&w(o.value,e.option)}),S;function C(e){let t={},n=(e?.replaceMerge??[]).filter(e=>e!=null);return n.length>0&&(t.replaceMerge=[...new Set(n)]),e?.notMerge!==void 0&&(t.notMerge=e.notMerge),t}function w(e,t,n,r=!1){let i=x(t);if(r){e.setOption(i,n??{}),S=void 0;return}if(g.value){let t=n??g.value;e.setOption(i,t),S=void 0;return}let a=Nfe(S,i),o=C(a.plan);e.setOption(a.option,o),S=a.signature}Object.keys(n).filter(e=>H9(e)).forEach(e=>{if(e.indexOf(`Native:`)===2){let t=`on${e.charAt(9).toUpperCase()}${e.slice(10)}`;v[t]=n[e];return}let t=e.charAt(2).toLowerCase()+e.slice(3),r;t.indexOf(`zr:`)===0&&(r=!0,t=t.substring(3));let i;t.substring(t.length-4)===`Once`&&(i=!0,t=t.substring(0,t.length-4)),y.set({event:t,zr:r,once:i},n[e])});function T(){if(!a.value)return;let n=o.value=z0(a.value,m.value,h.value);e.group&&(n.group=e.group),y.forEach((e,{zr:t,once:r,event:i})=>{if(!e)return;let a=t?n.getZr():n;if(r){let t=e,n=!1;e=(...r)=>{n||(n=!0,t(...r),a.off(i,e))}}a.on(i,e)});function r(){n&&!n.isDisposed()&&n.resize()}function i(){let{option:t}=e;if(d.value){t&&w(n,t,void 0,!0);return}t&&w(n,t)}u.value?(0,t.nextTick)(()=>{r(),i()}):i()}let E=(t,n,r)=>{if(!e.manualUpdate){W9("`setOption` is only available when `manual-update` is `true`.");return}let i=typeof n==`boolean`?{notMerge:n,lazyUpdate:r}:n;o.value&&w(o.value,t,i??void 0,!0)};function D(){o.value&&=(o.value.dispose(),void 0),S=void 0}(0,t.watch)(()=>e.option,e=>{if(!e){S=void 0;return}if(d.value){W9("`option` prop changes are ignored when `manual-update` is `true`.");return}o.value&&w(o.value,e)},{deep:!0}),(0,t.watch)([d,h],()=>{D(),T()},{deep:!0}),(0,t.watch)(m,e=>{o.value?.setTheme(e||{})},{deep:!0}),(0,t.watchEffect)(()=>{e.group&&o.value&&(o.value.group=e.group)});let O=_fe(o);return xfe(o,f,p),vfe(o,u,a),(0,t.onMounted)(()=>{T()}),(0,t.onBeforeUnmount)(()=>{Pfe&&a.value?a.value.__dispose=D:D()}),r({setOption:E,root:a,chart:o,...O}),(()=>(0,t.h)(J9,{..._.value,...v,ref:a,class:[`echarts`,_.value.class]},b()))}}),zfe={class:`echart-renderer`},Bfe=HT((0,t.defineComponent)({__name:`EchartsFieldRenderer`,props:{type:{},option:{},loading:{type:Boolean},theme:{}},setup(e){return n3([dse,Nse,Jse,ice,Ele,ele,lle,Vle,Ple,gde,dde,Ede,Eue,qde,Z8,hfe,Aue,Rue]),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,zfe,[(0,t.createVNode)((0,t.unref)(Rfe),{option:e.option,loading:e.loading,theme:e.theme,autoresize:``,style:{width:`100%`,height:`100%`}},null,8,[`option`,`loading`,`theme`])]))}}),[[`__scopeId`,`data-v-a20c87e3`]]);function Vfe(e,t,n,r,i){if(!e||e.length===0)return Jfe(n);let a;return a=t===`pie`?Ufe(e,n,r):t===`gauge`?Wfe(e,n,r):t===`radar`?Gfe(e,n,r):t===`heatmap`?Kfe(e,n,r):t===`funnel`?qfe(e,n,r):Hfe(e,t,n,r),i&&(a=Q9(a,i)),a}function Hfe(e,t,n,r){let i=e.map(e=>e[r.xField]),a=Array.isArray(r.yField)?r.yField:[r.yField],o=a.map(n=>({name:n,type:t===`scatter`?`scatter`:t,data:e.map(e=>e[n]??null),smooth:t===`line`}));return{title:{text:n,left:`center`,textStyle:{fontSize:14}},tooltip:{trigger:`axis`},legend:a.length>1?{bottom:0}:void 0,grid:{left:`3%`,right:`4%`,bottom:a.length>1?40:20,containLabel:!0},xAxis:{type:`category`,data:i,axisLabel:{rotate:i.length>8?30:0}},yAxis:{type:`value`},series:o}}function Ufe(e,t,n){let r=Array.isArray(n.yField)?n.yField[0]:n.yField,i=e.map(e=>({name:e[n.xField],value:e[r]??0}));return{title:{text:t,left:`center`,textStyle:{fontSize:14}},tooltip:{trigger:`item`,formatter:`{b}: {c} ({d}%)`},legend:{bottom:0,type:`scroll`},series:[{type:`pie`,radius:[`35%`,`65%`],center:[`50%`,`50%`],data:i,label:{show:!0,formatter:`{b}
5650
5650
  {d}%`}}]}}function Wfe(e,t,n){let r=Array.isArray(n.yField)?n.yField[0]:n.yField,i=e[0]?.[r]??0;return{title:{text:t,left:`center`,textStyle:{fontSize:14}},tooltip:{formatter:`{b}: {c}`},series:[{type:`gauge`,detail:{formatter:`{value}`},data:[{value:i,name:r}]}]}}function Gfe(e,t,n){let r=Array.isArray(n.yField)?n.yField[0]:n.yField,i=n.seriesField??`max`,a=e.map(e=>({name:e[n.xField],max:e[i]??Math.ceil((e[r]??0)*1.3)})),o=e.map(e=>e[r]??0);return{title:{text:t,left:`center`,textStyle:{fontSize:14}},tooltip:{trigger:`item`},radar:{indicator:a,radius:`65%`,center:[`50%`,`55%`]},series:[{type:`radar`,data:[{value:o,name:t,areaStyle:{opacity:.25}}]}]}}function Kfe(e,t,n){let r=n.xField,i=Array.isArray(n.yField)?n.yField[0]:n.yField,a=n.seriesField??`value`,o=[...new Set(e.map(e=>e[r]))],s=[...new Set(e.map(e=>e[i]))],c=e.map(e=>[o.indexOf(e[r]),s.indexOf(e[i]),e[a]??0]),l=Math.max(...e.map(e=>e[a]??0));return{title:{text:t,left:`center`,textStyle:{fontSize:14}},tooltip:{position:`top`,formatter:e=>`${o[e.data[0]]} / ${s[e.data[1]]}: ${e.data[2]}`},grid:{left:`3%`,right:`4%`,bottom:20,top:50,containLabel:!0},xAxis:{type:`category`,data:o,splitArea:{show:!0}},yAxis:{type:`category`,data:s,splitArea:{show:!0}},visualMap:{min:0,max:l,calculable:!0,orient:`horizontal`,left:`center`,bottom:-10,itemHeight:80},series:[{type:`heatmap`,data:c,label:{show:!1}}]}}function qfe(e,t,n){let r=Array.isArray(n.yField)?n.yField[0]:n.yField,i=e.map(e=>({name:e[n.xField],value:e[r]??0}));return{title:{text:t,left:`center`,textStyle:{fontSize:14}},tooltip:{trigger:`item`,formatter:`{b}: {c} ({d}%)`},legend:{bottom:0,type:`scroll`},series:[{type:`funnel`,left:`10%`,width:`80%`,top:40,bottom:30,sort:`descending`,gap:2,label:{show:!0,position:`inside`,formatter:`{b}
5651
- {d}%`},data:i}]}}function Jfe(e){return{title:{text:e,left:`center`,textStyle:{fontSize:14}},graphic:[{type:`text`,left:`center`,top:`middle`,style:{text:`暂无数据`,fill:`#999`,fontSize:14}}]}}function Q9(e,t){let n={...e};for(let r of Object.keys(t))t[r]&&typeof t[r]==`object`&&!Array.isArray(t[r])?n[r]=Q9(e[r]??{},t[r]):n[r]=t[r];return n}var Yfe={class:`flex items-center gap-1 flex-shrink-0 ml-2`},Xfe={class:`flex-1 overflow-hidden relative flex items-center justify-center p-1`},Zfe={key:0,class:`flex flex-col items-center gap-2 text-red-500 text-[13px]`},Qfe=(0,t.defineComponent)({__name:`ChartWidget`,props:{widget:{},editable:{type:Boolean}},emits:[`edit`,`remove`],setup(e,{emit:n}){let r=(0,t.inject)(`isDark`,(0,t.ref)(!1)),i=e,a=n;function o(e,t){if(t){let n=t.split(`.`).reduce((e,t)=>e?.[t],e);return Array.isArray(n)?n:[]}if(Array.isArray(e))return e;for(let t of[`Results`,`data`,`list`,`rows`,`items`])if(Array.isArray(e?.[t]))return e[t];return[]}let s=(0,t.ref)(!1),c=(0,t.ref)(``),l=(0,t.ref)([]),u=(0,t.computed)(()=>Vfe(l.value,i.widget.type,i.widget.title,i.widget.api.mapping,i.widget.echartsOverride));async function d(){if(i.widget.api.url){s.value=!0,c.value=``;try{let e={method:i.widget.api.method||`GET`,url:i.widget.api.url,headers:i.widget.api.headers};e.method===`GET`?e.params=i.widget.api.params:e.data=i.widget.api.params,l.value=o((await ek(e)).data,i.widget.api.dataPath)}catch(e){c.value=e.message||`请求失败`,l.value=[]}finally{s.value=!1}}}let f=null;function p(){f&&=(clearInterval(f),null);let e=i.widget.api.refreshInterval;e&&e>0&&(f=setInterval(d,e*1e3))}return(0,t.onMounted)(()=>{d(),p()}),(0,t.onUnmounted)(()=>{f&&clearInterval(f)}),(0,t.watch)(()=>i.widget.api.url,()=>{d(),p()}),(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`w-full h-full flex flex-col rounded-lg shadow-sm overflow-hidden`,style:(0,t.normalizeStyle)({backgroundColor:(0,t.unref)(r)?`#18181c`:`#ffffff`,borderWidth:`1px`,borderStyle:`solid`,borderColor:(0,t.unref)(r)?`#ffffff17`:`transparent`})},[(0,t.createElementVNode)(`div`,{class:`flex items-center justify-between px-3 py-2 min-h-[36px] flex-shrink-0 cursor-move select-none`,style:(0,t.normalizeStyle)({borderBottomWidth:`1px`,borderBottomStyle:`solid`,borderBottomColor:(0,t.unref)(r)?`#ffffff17`:`#f3f4f6`})},[(0,t.createElementVNode)(`span`,{class:`text-[13px] font-semibold truncate`,style:(0,t.normalizeStyle)({color:(0,t.unref)(r)?`#e5e7eb`:`#374151`})},(0,t.toDisplayString)(e.widget.title||`未命名图表`),5),(0,t.createElementVNode)(`div`,Yfe,[(0,t.createVNode)((0,t.unref)(qv),{trigger:`hover`},{trigger:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`w-6 h-6 flex items-center justify-center rounded hover:text-blue-500 hover:bg-blue-50 transition-colors`,style:(0,t.normalizeStyle)({color:(0,t.unref)(r)?`#6b7280`:`#9ca3af`}),onClick:(0,t.withModifiers)(d,[`stop`])},[...i[2]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-rotate-right text-xs`},null,-1)]],4)]),default:(0,t.withCtx)(()=>[i[3]||=(0,t.createTextVNode)(` 刷新数据 `,-1)]),_:1}),e.editable?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createVNode)((0,t.unref)(qv),{trigger:`hover`},{trigger:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`w-6 h-6 flex items-center justify-center rounded hover:text-blue-500 hover:bg-blue-50 transition-colors`,style:(0,t.normalizeStyle)({color:(0,t.unref)(r)?`#6b7280`:`#9ca3af`}),onClick:i[0]||=(0,t.withModifiers)(t=>a(`edit`,e.widget.id),[`stop`])},[...i[4]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-gear text-xs`},null,-1)]],4)]),default:(0,t.withCtx)(()=>[i[5]||=(0,t.createTextVNode)(` 配置 `,-1)]),_:1}),(0,t.createVNode)((0,t.unref)(qv),{trigger:`hover`},{trigger:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`w-6 h-6 flex items-center justify-center rounded hover:text-red-500 hover:bg-red-50 transition-colors`,style:(0,t.normalizeStyle)({color:(0,t.unref)(r)?`#6b7280`:`#9ca3af`}),onClick:i[1]||=(0,t.withModifiers)(t=>a(`remove`,e.widget.id),[`stop`])},[...i[6]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-xmark text-xs`},null,-1)]],4)]),default:(0,t.withCtx)(()=>[i[7]||=(0,t.createTextVNode)(` 删除 `,-1)]),_:1})],64)):(0,t.createCommentVNode)(``,!0)])],4),(0,t.createElementVNode)(`div`,Xfe,[c.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Zfe,[i[9]||=(0,t.createElementVNode)(`i`,{class:`fa-solid fa-triangle-exclamation text-base`},null,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(c.value),1),(0,t.createVNode)((0,t.unref)(_m),{size:`tiny`,onClick:d},{default:(0,t.withCtx)(()=>[...i[8]||=[(0,t.createTextVNode)(`重试`,-1)]]),_:1})])):s.value&&l.value.length===0?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Qw),{key:1,size:`medium`})):((0,t.openBlock)(),(0,t.createBlock)(Bfe,{key:2,type:e.widget.type,option:u.value,loading:s.value,theme:(0,t.unref)(r)?`dark`:void 0},null,8,[`type`,`option`,`loading`,`theme`]))])],4))}}),$fe=(0,t.defineComponent)({__name:`ChartConfigDrawer`,props:{show:{type:Boolean},widget:{}},emits:[`update:show`,`save`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(null),o=(0,t.ref)(``);(0,t.watch)(()=>r.widget,e=>{if(a.value=e?JSON.parse(JSON.stringify(e)):null,a.value){let e=a.value.api.mapping.yField;o.value=Array.isArray(e)?e.join(`, `):e??``}},{immediate:!0});function s(){if(!a.value)return;let e=o.value.split(`,`).map(e=>e.trim()).filter(Boolean);a.value.api.mapping.yField=e.length===1?e[0]:e}function c(e,n,r){return{value:r,label:n,renderLabel:()=>(0,t.h)(`span`,{style:`display:flex;align-items:center;gap:8px`},[(0,t.h)(`i`,{class:e,style:`width:14px;text-align:center;opacity:0.7`}),(0,t.h)(`span`,n)])}}let l=[c(`fa-solid fa-chart-line`,`折线图`,`line`),c(`fa-solid fa-chart-column`,`柱状图`,`bar`),c(`fa-solid fa-chart-pie`,`饼图`,`pie`),c(`fa-solid fa-gauge`,`仪表盘`,`gauge`),c(`fa-solid fa-circle-dot`,`散点图`,`scatter`),c(`fa-solid fa-spider`,`雷达图`,`radar`),c(`fa-solid fa-fire`,`热力图`,`heatmap`),c(`fa-solid fa-filter`,`漏斗图`,`funnel`)],u=[{label:`GET`,value:`GET`},{label:`POST`,value:`POST`}];function d(){a.value&&(i(`save`,JSON.parse(JSON.stringify(a.value))),i(`update:show`,!1))}function f(){i(`update:show`,!1)}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Tx),{show:e.show,width:420,placement:`right`,"onUpdate:show":r[7]||=e=>i(`update:show`,e)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Dx),{title:`图表配置`,closable:``},{footer:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Lx),{justify:`end`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(_m),{onClick:f},{icon:(0,t.withCtx)(()=>[...r[12]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-xmark`},null,-1)]]),default:(0,t.withCtx)(()=>[r[13]||=(0,t.createTextVNode)(` 取消 `,-1)]),_:1}),(0,t.createVNode)((0,t.unref)(_m),{type:`primary`,onClick:d},{icon:(0,t.withCtx)(()=>[...r[14]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-floppy-disk`},null,-1)]]),default:(0,t.withCtx)(()=>[r[15]||=(0,t.createTextVNode)(` 保存 `,-1)]),_:1})]),_:1})]),default:(0,t.withCtx)(()=>[a.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(lC),{key:0,"label-placement":`top`,"label-width":`auto`,size:`small`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(ax),{"title-placement":`left`,style:{"font-size":`12px`}},{default:(0,t.withCtx)(()=>[...r[8]||=[(0,t.createTextVNode)(`基础信息`,-1)]]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`标题`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(im),{value:a.value.title,"onUpdate:value":r[0]||=e=>a.value.title=e,placeholder:`请输入图表标题`},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`图表类型`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(dv),{value:a.value.type,"onUpdate:value":r[1]||=e=>a.value.type=e,options:l},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(ax),{"title-placement":`left`,style:{"font-size":`12px`}},{default:(0,t.withCtx)(()=>[...r[9]||=[(0,t.createTextVNode)(`接口配置`,-1)]]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`请求方式`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(dv),{value:a.value.api.method,"onUpdate:value":r[2]||=e=>a.value.api.method=e,options:u,style:{width:`120px`}},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`接口地址 (URL)`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(im),{value:a.value.api.url,"onUpdate:value":r[3]||=e=>a.value.api.url=e,placeholder:`/api/your-data-endpoint`},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(ax),{"title-placement":`left`,style:{"font-size":`12px`}},{default:(0,t.withCtx)(()=>[...r[10]||=[(0,t.createTextVNode)(`数据字段映射`,-1)]]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`X轴字段(分类/时间)`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(im),{value:a.value.api.mapping.xField,"onUpdate:value":r[4]||=e=>a.value.api.mapping.xField=e,placeholder:`如: date, month, name`},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`Y轴字段(数值,多个用英文逗号分隔)`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(im),{value:o.value,"onUpdate:value":r[5]||=e=>o.value=e,placeholder:`如: value 或 sales, cost`,onBlur:s},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(ax),{"title-placement":`left`,style:{"font-size":`12px`}},{default:(0,t.withCtx)(()=>[...r[11]||=[(0,t.createTextVNode)(`自动刷新`,-1)]]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`刷新间隔(秒,0 = 不刷新)`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Bw),{value:a.value.api.refreshInterval,"onUpdate:value":r[6]||=e=>a.value.api.refreshInterval=e,min:0,step:10,placeholder:`0`,style:{width:`100%`}},null,8,[`value`])]),_:1})]),_:1})):(0,t.createCommentVNode)(``,!0)]),_:1})]),_:1},8,[`show`]))}}),$9=[{type:`line`,label:`折线图`,icon:`fa-solid fa-chart-line`},{type:`bar`,label:`柱状图`,icon:`fa-solid fa-chart-column`},{type:`pie`,label:`饼图`,icon:`fa-solid fa-chart-pie`},{type:`gauge`,label:`仪表盘`,icon:`fa-solid fa-gauge`},{type:`scatter`,label:`散点图`,icon:`fa-solid fa-circle-dot`},{type:`radar`,label:`雷达图`,icon:`fa-solid fa-spider`},{type:`heatmap`,label:`热力图`,icon:`fa-solid fa-fire`},{type:`funnel`,label:`漏斗图`,icon:`fa-solid fa-filter`}],epe={class:`flex flex-1 overflow-hidden`},tpe={class:`flex flex-col gap-1 px-2 py-2`},npe=[`onClick`],rpe={class:`flex-1 overflow-hidden flex flex-col relative`},ipe={class:`fab-label`},ape={class:`flex-1 overflow-y-auto`},ope={key:0,class:`h-full flex items-center justify-center`},spe=HT((0,t.defineComponent)({__name:`KiviiDashboard`,props:{widgets:{},editable:{type:Boolean}},emits:[`update:widgets`],setup(e,{emit:n}){let r=e,i=(0,t.ref)(!1),a=(0,t.computed)(()=>r.editable!==!1&&!i.value),o=n,s=(0,t.ref)(new Map),c=(0,t.ref)([]),l=!1;(0,t.watch)(()=>r.widgets,e=>{if(l){l=!1;return}if(!e?.length)return;let t=new Map;e.forEach(e=>t.set(e.id,JSON.parse(JSON.stringify(e)))),s.value=t,c.value=e.map(e=>({i:e.id,x:e.layout.x,y:e.layout.y,w:e.layout.w,h:e.layout.h}))},{immediate:!0});let u=(0,t.computed)(()=>c.value.length>0);function d(){let e=c.value.map(e=>({...s.value.get(e.i),layout:{x:e.x,y:e.y,w:e.w,h:e.h}}));l=!0,o(`update:widgets`,e)}function f(e){e.forEach(e=>{let t=s.value.get(e.i);t&&(t.layout={x:e.x,y:e.y,w:e.w,h:e.h})}),d()}function p(e){let t=`chart_${Date.now()}`,n=c.value.length===0?0:Math.max(...c.value.map(e=>e.y+e.h)),r={id:t,type:e,title:$9.find(t=>t.type===e)?.label??`新图表`,layout:{x:0,y:n,w:6,h:4},api:{url:``,method:`GET`,mapping:{xField:`name`,yField:`value`},refreshInterval:0}};s.value.set(t,r),c.value=[...c.value,{i:t,x:0,y:n,w:6,h:4}],d(),_(t)}function m(e){s.value.delete(e),c.value=c.value.filter(t=>t.i!==e),d()}let h=(0,t.ref)(!1),g=(0,t.ref)(null);function _(e){g.value=s.value.get(e)??null,h.value=!0}function v(e){s.value.set(e.id,e),d()}let y=(0,t.inject)(`isDark`,(0,t.ref)(!1));return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`flex flex-col h-full w-full overflow-hidden`,style:(0,t.normalizeStyle)({background:(0,t.unref)(y)?`#101014`:`#f9fafb`})},[(0,t.createElementVNode)(`div`,epe,[a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`w-24 flex-shrink-0 flex flex-col overflow-y-auto`,style:(0,t.normalizeStyle)({background:(0,t.unref)(y)?`#18181c`:`#fff`,borderRight:`1px solid ${(0,t.unref)(y)?`#ffffff17`:`#f0f0f0`}`})},[(0,t.createElementVNode)(`div`,{class:`flex-shrink-0 flex items-center justify-center py-2`,style:(0,t.normalizeStyle)({borderBottom:`1px solid ${(0,t.unref)(y)?`#ffffff17`:`#f0f0f0`}`})},[(0,t.createElementVNode)(`span`,{class:`text-[11px] font-medium tracking-wide`,style:(0,t.normalizeStyle)({color:(0,t.unref)(y)?`#6b7280`:`#9ca3af`})},`图表类型`,4)],4),(0,t.createElementVNode)(`div`,tpe,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)($9),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.type,class:`chart-type-item flex flex-col items-center py-2 px-1 rounded-lg cursor-pointer transition-colors duration-150`,style:(0,t.normalizeStyle)({"--hover-bg":(0,t.unref)(y)?`rgba(59,130,246,0.15)`:`#eff6ff`}),onClick:t=>p(e.type)},[(0,t.createElementVNode)(`i`,{class:(0,t.normalizeClass)([e.icon,`text-base transition-colors`]),style:(0,t.normalizeStyle)({color:(0,t.unref)(y)?`#6b7280`:`#9ca3af`})},null,6),(0,t.createElementVNode)(`span`,{class:`text-[10px] mt-1 leading-none`,style:(0,t.normalizeStyle)({color:(0,t.unref)(y)?`#52525b`:`#9ca3af`})},(0,t.toDisplayString)(e.label),5)],12,npe))),128))]),(0,t.createElementVNode)(`p`,{class:`mt-auto pt-2 text-[10px] text-center`,style:(0,t.normalizeStyle)({color:(0,t.unref)(y)?`#374151`:`#d1d5db`})},`点击添加`,4)],4)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,rpe,[e.editable===!1?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`fab-toggle`,style:(0,t.normalizeStyle)({background:i.value?`#3b82f6`:(0,t.unref)(y)?`#27272a`:`#fff`,color:i.value?`#fff`:(0,t.unref)(y)?`#9ca3af`:`#6b7280`,boxShadow:(0,t.unref)(y)?`0 2px 10px rgba(0,0,0,0.6)`:`0 2px 10px rgba(0,0,0,0.15)`,border:`1px solid ${i.value?`#2563eb`:(0,t.unref)(y)?`#3f3f46`:`#e5e7eb`}`}),onClick:r[0]||=e=>i.value=!i.value},[(0,t.createElementVNode)(`i`,{class:(0,t.normalizeClass)(i.value?`fa-solid fa-pen`:`fa-solid fa-eye`)},null,2),(0,t.createElementVNode)(`span`,ipe,(0,t.toDisplayString)(i.value?`编辑`:`保存`),1)],4)),(0,t.createElementVNode)(`div`,ape,[u.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)($ie),{key:1,layout:c.value,"onUpdate:layout":r[1]||=e=>c.value=e,"col-num":12,"row-height":60,"is-draggable":a.value,"is-resizable":a.value,"vertical-compact":!0,"use-css-transforms":!0,onLayoutUpdated:f,style:{"margin-top":`-10px`}},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(mN),{key:e.i,i:e.i,x:e.x,y:e.y,w:e.w,h:e.h},{default:(0,t.withCtx)(()=>[s.value.get(e.i)?((0,t.openBlock)(),(0,t.createBlock)(Qfe,{key:0,widget:s.value.get(e.i),editable:a.value,onEdit:_,onRemove:m},null,8,[`widget`,`editable`])):(0,t.createCommentVNode)(``,!0)]),_:2},1032,[`i`,`x`,`y`,`w`,`h`]))),128))]),_:1},8,[`layout`,`is-draggable`,`is-resizable`])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ope,[(0,t.createVNode)((0,t.unref)(vp),{description:`点击左侧图表类型添加图表`})]))])])]),(0,t.createVNode)($fe,{show:h.value,"onUpdate:show":r[2]||=e=>h.value=e,widget:g.value,onSave:v},null,8,[`show`,`widget`])],4))}}),[[`__scopeId`,`data-v-0406c226`]]),cpe=HT((0,t.defineComponent)({name:`KiviiDashboard`,inheritAttrs:!1,__name:`KiviiDashboardWrapper`,setup(e){let{isDark:n,primaryColor:r,naiveTheme:i,themeOverrides:a}=dM();return(0,t.provide)(`isDark`,n),(0,t.provide)(`primaryColor`,r),(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`kivii-demo-lib-wrapper`,{dark:(0,t.unref)(n)}])},[(0,t.createVNode)((0,t.unref)(X_),{theme:(0,t.unref)(i),"theme-overrides":(0,t.unref)(a),locale:(0,t.unref)(da),"date-locale":(0,t.unref)(qa),style:{height:`100%`}},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Yb),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Pb),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)(spe,(0,t.normalizeProps)((0,t.guardReactiveProps)(e.$attrs)),null,16)]),_:1})]),_:1})]),_:1},8,[`theme`,`theme-overrides`,`locale`,`date-locale`])],2))}}),[[`__scopeId`,`data-v-1eb46155`]]);e.HelloWorld=m,e.KiviiDashboard=cpe,e.TableIndex=pM});
5651
+ {d}%`},data:i}]}}function Jfe(e){return{title:{text:e,left:`center`,textStyle:{fontSize:14}},graphic:[{type:`text`,left:`center`,top:`middle`,style:{text:`暂无数据`,fill:`#999`,fontSize:14}}]}}function Q9(e,t){let n={...e};for(let r of Object.keys(t))t[r]&&typeof t[r]==`object`&&!Array.isArray(t[r])?n[r]=Q9(e[r]??{},t[r]):n[r]=t[r];return n}var Yfe={class:`flex items-center gap-1 flex-shrink-0 ml-2`},Xfe={class:`flex-1 overflow-hidden relative flex items-center justify-center p-1`},Zfe={key:0,class:`flex flex-col items-center gap-2 text-red-500 text-[13px]`},Qfe=(0,t.defineComponent)({__name:`EchartsFieldWidget`,props:{widget:{},editable:{type:Boolean}},emits:[`edit`,`remove`],setup(e,{emit:n}){let r=(0,t.inject)(`isDark`,(0,t.ref)(!1)),i=e,a=n;function o(e,t){if(t){let n=t.split(`.`).reduce((e,t)=>e?.[t],e);return Array.isArray(n)?n:[]}if(Array.isArray(e))return e;for(let t of[`Results`,`data`,`list`,`rows`,`items`])if(Array.isArray(e?.[t]))return e[t];return[]}let s=(0,t.ref)(!1),c=(0,t.ref)(``),l=(0,t.ref)([]),u=(0,t.computed)(()=>Vfe(l.value,i.widget.type,i.widget.title,i.widget.api.mapping,i.widget.echartsOverride));async function d(){if(i.widget.api.url){s.value=!0,c.value=``;try{let e={method:i.widget.api.method||`GET`,url:i.widget.api.url,headers:i.widget.api.headers};e.method===`GET`?e.params=i.widget.api.params:e.data=i.widget.api.params,l.value=o((await ek(e)).data,i.widget.api.dataPath)}catch(e){c.value=e.message||`请求失败`,l.value=[]}finally{s.value=!1}}}let f=null;function p(){f&&=(clearInterval(f),null);let e=i.widget.api.refreshInterval;e&&e>0&&(f=setInterval(d,e*1e3))}return(0,t.onMounted)(()=>{d(),p()}),(0,t.onUnmounted)(()=>{f&&clearInterval(f)}),(0,t.watch)(()=>i.widget.api.url,()=>{d(),p()}),(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`w-full h-full flex flex-col rounded-lg shadow-sm overflow-hidden`,style:(0,t.normalizeStyle)({backgroundColor:(0,t.unref)(r)?`#18181c`:`#ffffff`,borderWidth:`1px`,borderStyle:`solid`,borderColor:(0,t.unref)(r)?`#ffffff17`:`transparent`})},[(0,t.createElementVNode)(`div`,{class:`flex items-center justify-between px-3 py-2 min-h-[36px] flex-shrink-0 cursor-move select-none`,style:(0,t.normalizeStyle)({borderBottomWidth:`1px`,borderBottomStyle:`solid`,borderBottomColor:(0,t.unref)(r)?`#ffffff17`:`#f3f4f6`})},[(0,t.createElementVNode)(`span`,{class:`text-[13px] font-semibold truncate`,style:(0,t.normalizeStyle)({color:(0,t.unref)(r)?`#e5e7eb`:`#374151`})},(0,t.toDisplayString)(e.widget.title||`未命名图表`),5),(0,t.createElementVNode)(`div`,Yfe,[(0,t.createVNode)((0,t.unref)(qv),{trigger:`hover`},{trigger:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`w-6 h-6 flex items-center justify-center rounded hover:text-blue-500 hover:bg-blue-50 transition-colors`,style:(0,t.normalizeStyle)({color:(0,t.unref)(r)?`#6b7280`:`#9ca3af`}),onClick:(0,t.withModifiers)(d,[`stop`])},[...i[2]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-rotate-right text-xs`},null,-1)]],4)]),default:(0,t.withCtx)(()=>[i[3]||=(0,t.createTextVNode)(` 刷新数据 `,-1)]),_:1}),e.editable?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createVNode)((0,t.unref)(qv),{trigger:`hover`},{trigger:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`w-6 h-6 flex items-center justify-center rounded hover:text-blue-500 hover:bg-blue-50 transition-colors`,style:(0,t.normalizeStyle)({color:(0,t.unref)(r)?`#6b7280`:`#9ca3af`}),onClick:i[0]||=(0,t.withModifiers)(t=>a(`edit`,e.widget.id),[`stop`])},[...i[4]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-gear text-xs`},null,-1)]],4)]),default:(0,t.withCtx)(()=>[i[5]||=(0,t.createTextVNode)(` 配置 `,-1)]),_:1}),(0,t.createVNode)((0,t.unref)(qv),{trigger:`hover`},{trigger:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`w-6 h-6 flex items-center justify-center rounded hover:text-red-500 hover:bg-red-50 transition-colors`,style:(0,t.normalizeStyle)({color:(0,t.unref)(r)?`#6b7280`:`#9ca3af`}),onClick:i[1]||=(0,t.withModifiers)(t=>a(`remove`,e.widget.id),[`stop`])},[...i[6]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-xmark text-xs`},null,-1)]],4)]),default:(0,t.withCtx)(()=>[i[7]||=(0,t.createTextVNode)(` 删除 `,-1)]),_:1})],64)):(0,t.createCommentVNode)(``,!0)])],4),(0,t.createElementVNode)(`div`,Xfe,[c.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Zfe,[i[9]||=(0,t.createElementVNode)(`i`,{class:`fa-solid fa-triangle-exclamation text-base`},null,-1),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(c.value),1),(0,t.createVNode)((0,t.unref)(_m),{size:`tiny`,onClick:d},{default:(0,t.withCtx)(()=>[...i[8]||=[(0,t.createTextVNode)(`重试`,-1)]]),_:1})])):s.value&&l.value.length===0?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Qw),{key:1,size:`medium`})):((0,t.openBlock)(),(0,t.createBlock)(Bfe,{key:2,type:e.widget.type,option:u.value,loading:s.value,theme:(0,t.unref)(r)?`dark`:void 0},null,8,[`type`,`option`,`loading`,`theme`]))])],4))}}),$fe=(0,t.defineComponent)({__name:`EchartsFieldConfigDrawer`,props:{show:{type:Boolean},widget:{}},emits:[`update:show`,`save`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(null),o=(0,t.ref)(``);(0,t.watch)(()=>r.widget,e=>{if(a.value=e?JSON.parse(JSON.stringify(e)):null,a.value){let e=a.value.api.mapping.yField;o.value=Array.isArray(e)?e.join(`, `):e??``}},{immediate:!0});function s(){if(!a.value)return;let e=o.value.split(`,`).map(e=>e.trim()).filter(Boolean);a.value.api.mapping.yField=e.length===1?e[0]:e}function c(e,n,r){return{value:r,label:n,renderLabel:()=>(0,t.h)(`span`,{style:`display:flex;align-items:center;gap:8px`},[(0,t.h)(`i`,{class:e,style:`width:14px;text-align:center;opacity:0.7`}),(0,t.h)(`span`,n)])}}let l=[c(`fa-solid fa-chart-line`,`折线图`,`line`),c(`fa-solid fa-chart-column`,`柱状图`,`bar`),c(`fa-solid fa-chart-pie`,`饼图`,`pie`),c(`fa-solid fa-gauge`,`仪表盘`,`gauge`),c(`fa-solid fa-circle-dot`,`散点图`,`scatter`),c(`fa-solid fa-spider`,`雷达图`,`radar`),c(`fa-solid fa-fire`,`热力图`,`heatmap`),c(`fa-solid fa-filter`,`漏斗图`,`funnel`)],u=[{label:`GET`,value:`GET`},{label:`POST`,value:`POST`}];function d(){a.value&&(i(`save`,JSON.parse(JSON.stringify(a.value))),i(`update:show`,!1))}function f(){i(`update:show`,!1)}return(n,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(Tx),{show:e.show,width:420,placement:`right`,"onUpdate:show":r[7]||=e=>i(`update:show`,e)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Dx),{title:`图表配置`,closable:``},{footer:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Lx),{justify:`end`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(_m),{onClick:f},{icon:(0,t.withCtx)(()=>[...r[12]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-xmark`},null,-1)]]),default:(0,t.withCtx)(()=>[r[13]||=(0,t.createTextVNode)(` 取消 `,-1)]),_:1}),(0,t.createVNode)((0,t.unref)(_m),{type:`primary`,onClick:d},{icon:(0,t.withCtx)(()=>[...r[14]||=[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-floppy-disk`},null,-1)]]),default:(0,t.withCtx)(()=>[r[15]||=(0,t.createTextVNode)(` 保存 `,-1)]),_:1})]),_:1})]),default:(0,t.withCtx)(()=>[a.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(lC),{key:0,"label-placement":`top`,"label-width":`auto`,size:`small`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(ax),{"title-placement":`left`,style:{"font-size":`12px`}},{default:(0,t.withCtx)(()=>[...r[8]||=[(0,t.createTextVNode)(`基础信息`,-1)]]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`标题`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(im),{value:a.value.title,"onUpdate:value":r[0]||=e=>a.value.title=e,placeholder:`请输入图表标题`},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`图表类型`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(dv),{value:a.value.type,"onUpdate:value":r[1]||=e=>a.value.type=e,options:l},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(ax),{"title-placement":`left`,style:{"font-size":`12px`}},{default:(0,t.withCtx)(()=>[...r[9]||=[(0,t.createTextVNode)(`接口配置`,-1)]]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`请求方式`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(dv),{value:a.value.api.method,"onUpdate:value":r[2]||=e=>a.value.api.method=e,options:u,style:{width:`120px`}},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`接口地址 (URL)`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(im),{value:a.value.api.url,"onUpdate:value":r[3]||=e=>a.value.api.url=e,placeholder:`/api/your-data-endpoint`},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(ax),{"title-placement":`left`,style:{"font-size":`12px`}},{default:(0,t.withCtx)(()=>[...r[10]||=[(0,t.createTextVNode)(`数据字段映射`,-1)]]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`X轴字段(分类/时间)`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(im),{value:a.value.api.mapping.xField,"onUpdate:value":r[4]||=e=>a.value.api.mapping.xField=e,placeholder:`如: date, month, name`},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`Y轴字段(数值,多个用英文逗号分隔)`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(im),{value:o.value,"onUpdate:value":r[5]||=e=>o.value=e,placeholder:`如: value 或 sales, cost`,onBlur:s},null,8,[`value`])]),_:1}),(0,t.createVNode)((0,t.unref)(ax),{"title-placement":`left`,style:{"font-size":`12px`}},{default:(0,t.withCtx)(()=>[...r[11]||=[(0,t.createTextVNode)(`自动刷新`,-1)]]),_:1}),(0,t.createVNode)((0,t.unref)(_w),{label:`刷新间隔(秒,0 = 不刷新)`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Bw),{value:a.value.api.refreshInterval,"onUpdate:value":r[6]||=e=>a.value.api.refreshInterval=e,min:0,step:10,placeholder:`0`,style:{width:`100%`}},null,8,[`value`])]),_:1})]),_:1})):(0,t.createCommentVNode)(``,!0)]),_:1})]),_:1},8,[`show`]))}}),$9=[{type:`line`,label:`折线图`,icon:`fa-solid fa-chart-line`},{type:`bar`,label:`柱状图`,icon:`fa-solid fa-chart-column`},{type:`pie`,label:`饼图`,icon:`fa-solid fa-chart-pie`},{type:`gauge`,label:`仪表盘`,icon:`fa-solid fa-gauge`},{type:`scatter`,label:`散点图`,icon:`fa-solid fa-circle-dot`},{type:`radar`,label:`雷达图`,icon:`fa-solid fa-spider`},{type:`heatmap`,label:`热力图`,icon:`fa-solid fa-fire`},{type:`funnel`,label:`漏斗图`,icon:`fa-solid fa-filter`}],epe={class:`flex flex-1 overflow-hidden`},tpe={class:`flex flex-col gap-1 px-2 py-2`},npe=[`onClick`],rpe={class:`flex-1 overflow-hidden flex flex-col relative`},ipe=[`disabled`],ape={key:0,class:`fa-solid fa-spinner fa-spin`},ope={class:`fab-label`},spe={class:`flex-1 overflow-y-auto`},cpe={key:0,class:`h-full flex items-center justify-center`},lpe=HT((0,t.defineComponent)({__name:`EchartsField`,props:{widgets:{},editable:{type:Boolean},apiConfig:{}},emits:[`update:widgets`],setup(e,{emit:n}){let r=e,i=(0,t.ref)(!1),a=(0,t.computed)(()=>r.editable!==!1&&!i.value),o=n,s=(0,t.ref)(new Map),c=(0,t.ref)([]),l=!1;(0,t.watch)(()=>r.widgets,e=>{if(l){l=!1;return}if(!e?.length)return;let t=new Map;e.forEach(e=>t.set(e.id,JSON.parse(JSON.stringify(e)))),s.value=t,c.value=e.map(e=>({i:e.id,x:e.layout.x,y:e.layout.y,w:e.layout.w,h:e.layout.h}))},{immediate:!0});let u=(0,t.computed)(()=>c.value.length>0);function d(){let e=c.value.map(e=>({...s.value.get(e.i),layout:{x:e.x,y:e.y,w:e.w,h:e.h}}));l=!0,o(`update:widgets`,e)}function f(e){e.forEach(e=>{let t=s.value.get(e.i);t&&(t.layout={x:e.x,y:e.y,w:e.w,h:e.h})}),d()}function p(e){let t=`chart_${Date.now()}`,n=c.value.length===0?0:Math.max(...c.value.map(e=>e.y+e.h)),r={id:t,type:e,title:$9.find(t=>t.type===e)?.label??`新图表`,layout:{x:0,y:n,w:6,h:4},api:{url:``,method:`GET`,mapping:{xField:`name`,yField:`value`},refreshInterval:0}};s.value.set(t,r),c.value=[...c.value,{i:t,x:0,y:n,w:6,h:4}],d(),_(t)}function m(e){s.value.delete(e),c.value=c.value.filter(t=>t.i!==e),d()}let h=(0,t.ref)(!1),g=(0,t.ref)(null);function _(e){g.value=s.value.get(e)??null,h.value=!0}function v(e){s.value.set(e.id,e),d()}let y=(0,t.inject)(`isDark`,(0,t.ref)(!1)),b=Xb(),x=(0,t.ref)(!1),S=(0,t.ref)(!1);function C(e){let t=new Map;e.forEach(e=>t.set(e.id,e)),l=!0,s.value=t,c.value=e.map(e=>({i:e.id,x:e.layout.x,y:e.layout.y,w:e.layout.w,h:e.layout.h})),o(`update:widgets`,e)}(0,t.onMounted)(async()=>{if(!r.apiConfig)return;let e=r.apiConfig.getUrl??`/Restful/Kivii.Basic.Entities.UiConfig/Get.json`;S.value=!0;try{let t=(await ek.post(e,{Type:r.apiConfig.type,InternalCode:r.apiConfig.internalCode,IsDefault:r.apiConfig.isDefault??!1})).data,n=Array.isArray(t)?t[0]:t;if(n?.Parameters){let e=JSON.parse(n.Parameters);Array.isArray(e)&&e.length>0&&C(e)}}catch{}finally{S.value=!1}});async function w(){if(!r.apiConfig){i.value=!i.value;return}let e=c.value.map(e=>({...s.value.get(e.i),layout:{x:e.x,y:e.y,w:e.w,h:e.h}}));x.value=!0;try{let t=r.apiConfig.setUrl??`/Restful/Kivii.Basic.Entities.UiConfig/Set.json`;await ek.post(t,{Type:r.apiConfig.type,InternalCode:r.apiConfig.internalCode,IsDefault:r.apiConfig.isDefault??!1,Parameters:JSON.stringify(e)}),b.success(`保存成功`),i.value=!0}catch(e){b.error(`保存失败:`+(e.message??`未知错误`))}finally{x.value=!1}}return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`flex flex-col h-full w-full overflow-hidden`,style:(0,t.normalizeStyle)({background:(0,t.unref)(y)?`#101014`:`#f9fafb`})},[(0,t.createElementVNode)(`div`,epe,[a.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`w-24 flex-shrink-0 flex flex-col overflow-y-auto`,style:(0,t.normalizeStyle)({background:(0,t.unref)(y)?`#18181c`:`#fff`,borderRight:`1px solid ${(0,t.unref)(y)?`#ffffff17`:`#f0f0f0`}`})},[(0,t.createElementVNode)(`div`,{class:`flex-shrink-0 flex items-center justify-center py-2`,style:(0,t.normalizeStyle)({borderBottom:`1px solid ${(0,t.unref)(y)?`#ffffff17`:`#f0f0f0`}`})},[(0,t.createElementVNode)(`span`,{class:`text-[11px] font-medium tracking-wide`,style:(0,t.normalizeStyle)({color:(0,t.unref)(y)?`#6b7280`:`#9ca3af`})},`图表类型`,4)],4),(0,t.createElementVNode)(`div`,tpe,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)((0,t.unref)($9),e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.type,class:`chart-type-item flex flex-col items-center py-2 px-1 rounded-lg cursor-pointer transition-colors duration-150`,style:(0,t.normalizeStyle)({"--hover-bg":(0,t.unref)(y)?`rgba(59,130,246,0.15)`:`#eff6ff`}),onClick:t=>p(e.type)},[(0,t.createElementVNode)(`i`,{class:(0,t.normalizeClass)([e.icon,`text-base transition-colors`]),style:(0,t.normalizeStyle)({color:(0,t.unref)(y)?`#6b7280`:`#9ca3af`})},null,6),(0,t.createElementVNode)(`span`,{class:`text-[10px] mt-1 leading-none`,style:(0,t.normalizeStyle)({color:(0,t.unref)(y)?`#52525b`:`#9ca3af`})},(0,t.toDisplayString)(e.label),5)],12,npe))),128))]),(0,t.createElementVNode)(`p`,{class:`mt-auto pt-2 text-[10px] text-center`,style:(0,t.normalizeStyle)({color:(0,t.unref)(y)?`#374151`:`#d1d5db`})},`点击添加`,4)],4)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,rpe,[e.editable===!1?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:0,class:`fab-toggle`,disabled:x.value,style:(0,t.normalizeStyle)({background:i.value?`#3b82f6`:(0,t.unref)(y)?`#27272a`:`#fff`,color:i.value?`#fff`:(0,t.unref)(y)?`#9ca3af`:`#6b7280`,boxShadow:(0,t.unref)(y)?`0 2px 10px rgba(0,0,0,0.6)`:`0 2px 10px rgba(0,0,0,0.15)`,border:`1px solid ${i.value?`#2563eb`:(0,t.unref)(y)?`#3f3f46`:`#e5e7eb`}`,opacity:x.value?.7:1}),onClick:r[0]||=e=>i.value?i.value=!1:w()},[x.value?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,ape)):((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)(i.value?`fa-solid fa-pen`:`fa-solid fa-floppy-disk`)},null,2)),(0,t.createElementVNode)(`span`,ope,(0,t.toDisplayString)(i.value?`编辑`:`保存`),1)],12,ipe)),S.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`absolute inset-0 z-10 flex items-center justify-center`,style:(0,t.normalizeStyle)({background:(0,t.unref)(y)?`rgba(16,16,20,0.7)`:`rgba(249,250,251,0.7)`})},[(0,t.createElementVNode)(`i`,{class:`fa-solid fa-spinner fa-spin text-2xl`,style:(0,t.normalizeStyle)({color:(0,t.unref)(y)?`#6b7280`:`#9ca3af`})},null,4)],4)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,spe,[!u.value&&!S.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,cpe,[(0,t.createVNode)((0,t.unref)(vp),{description:`点击左侧图表类型添加图表`})])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)($ie),{key:1,layout:c.value,"onUpdate:layout":r[1]||=e=>c.value=e,"col-num":12,"row-height":60,"is-draggable":a.value,"is-resizable":a.value,"vertical-compact":!0,"use-css-transforms":!0,onLayoutUpdated:f,style:(0,t.normalizeStyle)({marginTop:i.value?`12px`:`-10px`})},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(c.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(mN),{key:e.i,i:e.i,x:e.x,y:e.y,w:e.w,h:e.h},{default:(0,t.withCtx)(()=>[s.value.get(e.i)?((0,t.openBlock)(),(0,t.createBlock)(Qfe,{key:0,widget:s.value.get(e.i),editable:a.value,onEdit:_,onRemove:m},null,8,[`widget`,`editable`])):(0,t.createCommentVNode)(``,!0)]),_:2},1032,[`i`,`x`,`y`,`w`,`h`]))),128))]),_:1},8,[`layout`,`is-draggable`,`is-resizable`,`style`]))])])]),(0,t.createVNode)($fe,{show:h.value,"onUpdate:show":r[2]||=e=>h.value=e,widget:g.value,onSave:v},null,8,[`show`,`widget`])],4))}}),[[`__scopeId`,`data-v-34462287`]]);e.EchartsField=HT((0,t.defineComponent)({name:`EchartsField`,inheritAttrs:!1,__name:`EchartsFieldWrapper`,setup(e){let{isDark:n,primaryColor:r,naiveTheme:i,themeOverrides:a}=dM();return(0,t.provide)(`isDark`,n),(0,t.provide)(`primaryColor`,r),(e,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`kivii-demo-lib-wrapper`,{dark:(0,t.unref)(n)}])},[(0,t.createVNode)((0,t.unref)(X_),{theme:(0,t.unref)(i),"theme-overrides":(0,t.unref)(a),locale:(0,t.unref)(da),"date-locale":(0,t.unref)(qa),style:{height:`100%`}},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Yb),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(Pb),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)(lpe,(0,t.normalizeProps)((0,t.guardReactiveProps)(e.$attrs)),null,16)]),_:1})]),_:1})]),_:1},8,[`theme`,`theme-overrides`,`locale`,`date-locale`])],2))}}),[[`__scopeId`,`data-v-53db6608`]]),e.HelloWorld=m,e.TableIndex=pM});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kivii-public-components",
3
- "version": "0.2.37",
3
+ "version": "0.2.39",
4
4
  "type": "module",
5
5
  "description": "Kivii 公共 Vue3 组件库",
6
6
  "main": "./dist/kivii-public-components.umd.cjs",