"use client";
'use strict';

var React = require('react');
var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');
var jsxRuntime = require('react/jsx-runtime');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespace(React);

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.clsx(inputs));
}
__name(cn, "cn");
var Cursor = React__namespace.forwardRef(
  ({ className, children, cursorText, cursorSize = 20, ...props }, ref) => {
    const [position, setPosition] = React__namespace.useState({ x: 0, y: 0 });
    const [isHovered, setIsHovered] = React__namespace.useState(false);
    const handleMouseMove = /* @__PURE__ */ __name((e) => {
      const rect = e.currentTarget.getBoundingClientRect();
      setPosition({
        x: e.clientX - rect.left,
        y: e.clientY - rect.top
      });
    }, "handleMouseMove");
    return /* @__PURE__ */ jsxRuntime.jsxs(
      "div",
      {
        ref,
        className: cn("relative cursor-none", className),
        onMouseMove: handleMouseMove,
        onMouseEnter: () => setIsHovered(true),
        onMouseLeave: () => setIsHovered(false),
        ...props,
        children: [
          children,
          isHovered && /* @__PURE__ */ jsxRuntime.jsx(
            "div",
            {
              className: "pointer-events-none absolute z-50 flex items-center justify-center rounded-full bg-primary/20 backdrop-blur-sm transition-transform",
              style: {
                left: position.x,
                top: position.y,
                width: cursorSize,
                height: cursorSize,
                transform: "translate(-50%, -50%)"
              },
              children: cursorText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-primary", children: cursorText })
            }
          )
        ]
      }
    );
  }
);
Cursor.displayName = "Cursor";

exports.Cursor = Cursor;
