const T=(l,n,e)=>{let d={interval:2e3,loopSeries:!1,seriesIndex:0,updateData:null};if(!l||!n)return{};let t=0,a=0,i=0,o=n.series.length,f=0,s,I=!0;e?(e.interval=e.interval||d.interval,e.loopSeries=e.loopSeries||d.loopSeries,e.seriesIndex=e.seriesIndex||d.seriesIndex,e.updateData=e.updateData||d.updateData):e=d,e.seriesIndex<0||e.seriesIndex>=o?a=0:a=e.seriesIndex;function m(){function c(){var y,S;t===0&&!I&&typeof e.updateData=="function"&&(e.updateData(),l.setOption(n));let x=n.series;s=x[a].type,f=x[a].data.length;let r={seriesIndex:a};switch(s){case"map":case"pie":case"chord":case"bar3D":r.name=(S=(y=x[a])==null?void 0:y.data[t])==null?void 0:S.name;break;case"radar":r.seriesIndex=a,r.dataIndex=t;break;default:r.dataIndex=t;break}(s==="pie"||s==="radar"||s==="map"||s==="scatter")&&(l.dispatchAction({type:"downplay",seriesIndex:e.loopSeries?a===0?o-1:a-1:a,dataIndex:t===0?f-1:t-1}),l.dispatchAction({type:"highlight",seriesIndex:a,dataIndex:t})),r.type="showTip",l.dispatchAction(r),t=(t+1)%f,e.loopSeries&&t===0&&!I&&(a=(a+1)%o),I=!1}c(),i=setInterval(c,e.interval)}function p(){i&&(clearInterval(i),i=0,(s==="pie"||s==="radar"||s==="map"||s==="scatter")&&l.dispatchAction({type:"downplay",seriesIndex:e.loopSeries?a===0?o-1:a-1:a,dataIndex:t===0?f-1:t-1}))}let u=l.getZr();function v(c){c.event,p()}function g(){i||m()}return l.on("mousemove",p),u.on("mousemove",v),u.on("globalout",g),m(),{timeTicket:i,clearLoop:function(){i&&(clearInterval(i),i=0),l.off("mousemove",p),u.off("mousemove",v),u.off("globalout",g)}}};export{T as a};
