"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),e=require("react"),x=require("react-dom"),b=require("../../../utils/cn/cn.cjs.js"),t=require("../../../src/components/Cursor/components/clientCursor.module.css"),g=require("../../Typography/Typography.cjs.js");function j({children:c,label:a,colorScheme:l}){const[o,d]=e.useState({x:0,y:0}),[f,n]=e.useState(!1),m=e.useRef(null),[p,r]=e.useState(!1);e.useEffect(()=>(r(!0),()=>r(!1)),[]),e.useEffect(()=>{const u=i=>{d({x:i.clientX,y:i.clientY})};return window.addEventListener("mousemove",u),()=>window.removeEventListener("mousemove",u)},[]);const y=()=>{n(!0)},v=()=>{n(!1)},h=s.jsx("div",{ref:m,className:b.cn(t.cursor,{[t.cursorVisible]:f}),style:{left:`${o.x}px`,top:`${o.y}px`},"data-color-scheme":l,children:s.jsx(g.Typography,{as:"p",emphasis:!0,defaultVariant:"labelLg",children:a})});return s.jsxs("div",{children:[s.jsx("div",{className:t.cursorContainer,onMouseEnter:y,onMouseLeave:v,children:c}),p&&x.createPortal(h,document.body)]})}exports.ClientCursor=j;
