Loading
function(e,t,n){n.d(t,{T:()=>y});var r=n(477900),l=n(582128),a=n(503698),i=n.n(a),u=n(202091),s=n(505124),c=n(661531),o=n(866665),d=n(43990),m=n(717421),f=n(713608),h=n(918715),g=n(271520),p=n(762555),v=n(268378),x=n(660183),S=n(328115);function C(e){let{leftPx:t,rightPx:n,setHoveredIndex:l,isAnimated:a,index:m,activated:f,expansionSpring:h,icon:g,tooltip:p}=e;return(0,r.jsx)(o.m,{delay:300,text:p,children:(0,r.jsx)(d.N,{theme:s.NJ.ONYX,children:e=>(0,r.jsx)(u.animated.div,{className:i()(S.z,e),onMouseEnter:()=>l(m),onMouseLeave:()=>l(null),style:{left:a?h.to(e=>t-e):t,right:n,width:a?h.to(e=>`${E+2*e}px`):E,height:a?h.to(e=>`${E+2*e}px`):E},children:(0,r.jsx)(g,{size:"custom",width:"100%",height:"100%",color:f?c.A.colors.INTERACTIVE_ICON_ACTIVE:c.A.colors.INTERACTIVE_ICON_DEFAULT})})})})}let E=12,b={tension:500,friction:30,clamp:!0};function y(e){let[t,n]=l.useState(null),a=l.useRef(null),[{expansion:i},u]=(0,m.z)(()=>({expansion:0,config:b,onRest:()=>{null==a.current&&n(null)}})),s=l.useCallback(e=>{a.current=e,null!=e?(n(e),u({expansion:4})):u({expansion:0})},[u]),c=g.A.useConfig({location:"useClipTimelineIndicators"}).enableGameEventsOnPlayer,o=l.useMemo(()=>c?e.filter(e=>null!=e.game):[],[e,c]),d=l.useMemo(()=>o.map((e,t)=>({index:t,timeSec:e.timestamp_ms/1e3,widthPx:E,gapPx:4})),[o]),S=l.useCallback((e,n)=>{let l,a,u=t===e.index,c=o[e.index];if(null==c)return null;let d=n>e.leftPx;switch(c.game.type){case p.Q_.MULTIKILL:a=x.intl.string(v.default.PMLPER),l=f.q;break;case p.Q_.KILL:l=f.q,a=x.intl.string(v.default.fYdqnM);break;case p.Q_.DEATH:l=h.V,a=x.intl.string(v.default.MhIx41)}return null==l||null==a?null:(0,r.jsx)(C,{...e,activated:d,gapPx:4,tooltip:a,expansionSpring:i,setHoveredIndex:s,isAnimated:u,icon:l})},[t,o,s,i]);return{indicators:d,animatingIndex:t,expansionSpring:i,hoverExpansionPx:4,renderIndicator:S}}}