"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[8534],{38534:(e,t,r)=>{r.r(t),r.d(t,{default:()=>s});var n=r(85867),a=r(2445);function s(e){const{height:t,width:r,echartOptions:s,onFocusedSeries:c,onLegendStateChanged:u,refs:h}=e,i={legendselectchanged:e=>{null==u||u(e.selected)},legendselectall:e=>{null==u||u(e.selected)},legendinverseselect:e=>{null==u||u(e.selected)},mouseout:()=>{c(void 0)},mouseover:e=>{c(e.seriesIndex)}};return(0,a.Y)(n.A,{refs:h,height:t,width:r,echartOptions:s,eventHandlers:i})}},85867:(e,t,r)=>{r.d(t,{A:()=>Z});var n=r(96540),a=r(96453),s=r(3087),c=r(92351),u=r(42900),h=r(51719),i=r(74508),l=r(61030),d=r(45567),o=r(49714),f=r(11734),g=r(80491),p=r(25652),v=r(73900),w=r(32003),b=r(22329),E=r(31441),O=r(12458),k=r(39539),I=r(5553),y=r(45967),R=r(40830),m=r(45620),A=r(39838),C=r(42998),H=r(69380),j=r(25384),x=r(29022),T=r(28540),Y=r(35278),z=r(2445);const L=a.I4.div`
  height: ${({height:e})=>e};
  width: ${({width:e})=>e};
`;function S({width:e,height:t,echartOptions:r,eventHandlers:a,zrEventHandlers:s,selectedValues:u={},refs:h},i){const l=(0,n.useRef)(null);h&&(h.divRef=l);const d=(0,n.useRef)(),o=(0,n.useMemo)((()=>Object.keys(u)||[]),[u]),f=(0,n.useRef)([]);(0,n.useImperativeHandle)(i,(()=>({getEchartInstance:()=>d.current}))),(0,n.useEffect)((()=>{l.current&&(d.current||(d.current=(0,c.Ts)(l.current)),Object.entries(a||{}).forEach((([e,t])=>{var r,n;null==(r=d.current)||r.off(e),null==(n=d.current)||n.on(e,t)})),Object.entries(s||{}).forEach((([e,t])=>{var r,n;null==(r=d.current)||r.getZr().off(e),null==(n=d.current)||n.getZr().on(e,t)})),d.current.setOption(r,!0))}),[r,a,s]),(0,n.useEffect)((()=>{d.current&&(d.current.dispatchAction({type:"downplay",dataIndex:f.current.filter((e=>!o.includes(e)))}),o.length&&d.current.dispatchAction({type:"highlight",dataIndex:o}),f.current=o)}),[o]);const g=(0,n.useCallback)((({width:e,height:t})=>{d.current&&d.current.resize({width:e,height:t})}),[]);return(0,n.useEffect)((()=>(g({width:e,height:t}),()=>{var e;return null==(e=d.current)?void 0:e.dispose()})),[]),(0,n.useLayoutEffect)((()=>{g({width:e,height:t})}),[e,t,g]),(0,z.Y)(L,{ref:l,height:t,width:e})}(0,s.Y)([k.a,u.a,h.a,i.a,l.a,d.a,o.a,f.a,g.a,p.a,v.a,w.a,b.a,E.a,O.a,I.a,y.a,R.a,m.a,A.a,C.a,H.a,j.a,x.a,T.a,Y._]);const Z=(0,n.forwardRef)(S)}}]);