import { jsx as _jsx } from "react/jsx-runtime";
import React from "react";
export function HoldToTalkButton({ tokens, active, disabled, text = "按住 说话", activeText = "松开 结束", onPressStart, onPressMove, onPressEnd, onPressCancel, }) {
    return (_jsx("button", { type: "button", disabled: disabled, onContextMenu: (event) => {
            event.preventDefault();
        }, onSelect: (event) => {
            event.preventDefault();
        }, onDragStart: (event) => {
            event.preventDefault();
        }, onPointerDown: (event) => {
            try {
                event.currentTarget.setPointerCapture(event.pointerId);
            }
            catch {
                // ignore unsupported pointer capture cases in test environments
            }
            onPressStart?.(event);
        }, onPointerMove: onPressMove, onPointerUp: onPressEnd, onPointerCancel: onPressCancel, style: {
            width: "100%",
            borderRadius: tokens.radius.mobileHoldToTalk,
            background: active ? "#ECE2FF" : "#FFFFFF",
            color: active ? "#4E2DBF" : "#171717",
            border: `1px solid ${active ? "#BFA9FF" : "#E5E7EB"}`,
            boxShadow: active ? "0 14px 28px rgba(109, 74, 255, 0.22)" : "none",
            padding: "15px 18px",
            minHeight: 60,
            fontSize: 16,
            lineHeight: "22px",
            fontWeight: 600,
            opacity: disabled ? 0.55 : 1,
            userSelect: "none",
            WebkitUserSelect: "none",
            WebkitTouchCallout: "none",
            WebkitTapHighlightColor: "transparent",
            touchAction: "none",
            transition: `all ${tokens.motion.stateTransition}`,
        }, children: active ? activeText : text }));
}
