"use client"
import{a as c}from"./chunk-4XRZT4Y6.mjs";import{p as s}from"./chunk-V5SYWICD.mjs";import{cva as C}from"class-variance-authority";import{createContext as h,useContext as b,useEffect as g,useRef as x,useState as L}from"react";import{jsx as d}from"react/jsx-runtime";var E=C("w-full group/card border-gray-200 bg-white",{variants:{variant:{compact:"first-of-type:rounded-t-xl last-of-type:rounded-b-xl first-of-type:border-t border-b border-x data-[hover-state-enabled=true]:hover:bg-gray-50 transition-colors",loose:"border rounded-xl transition-[filter] data-[hover-state-enabled=true]:hover:drop-shadow-card-hover"}}}),y="w-full py-2.5 px-4",N=h({hovered:!1});function H({outerClassName:u,innerClassName:f,children:v,onClick:i,hoverStateEnabled:m=!0}){let{variant:p}=b(c),t=x(null),[a,o]=L(!1);return g(()=>{if(!a||!t.current)return;let r=setInterval(()=>{var n;((n=t.current)==null?void 0:n.matches(":hover"))===!1&&o(!1)},1e3);return()=>clearInterval(r)},[a]),d("li",{ref:t,className:s(E({variant:p}),u),onPointerEnter:()=>o(!0),onPointerLeave:()=>o(!1),"data-hover-state-enabled":m,children:d("div",{className:s(y,f),onClick:i?r=>{if(!document.getElementById("modal-backdrop")){for(let e=r.target,l=0;e&&e!==r.currentTarget&&l<100;e=e.parentElement,l++)if(["button","a","input","textarea"].includes(e.tagName.toLowerCase()))return;i()}}:void 0,children:d(N.Provider,{value:{hovered:a},children:v})})})}export{N as a,H as b};
