"use strict";var e=require("react");let t=null;exports.useMarqueeItem=r=>{let{index:u,activeItem:c,hoverItem:s,timeToScroll:i=0,setHoverItem:n,setActiveItem:o}=r??{},a=e.useRef(!0),[f,l]=e.useState(!1),m=e.useRef(!1);return e.useEffect(()=>{s===u?.toString()?(l(!0),t&&clearTimeout(t),t=setTimeout(()=>{m.current||(l(!1),n?.())},1e3)):l(!1)},[s,u,n]),e.useEffect(()=>{if(a.current){t=setTimeout(()=>{a.current=!1},500);return}return c===u?.toString()?(l(!0),m.current=!0,t&&clearTimeout(t),t=setTimeout(()=>{l(!1),m.current=!1,o?.()},i+1e3)):l(!1),()=>{t&&clearTimeout(t)}},[c,u,o,i]),{isActive:f}};
