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