function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import { useEditorStyleRegister } from "../Hooks/useStyle";
var genStyle = function genStyle(token) {
    var _token_borderRadiusSM;
    var _obj;
    return _define_property({}, token.componentCls, (_obj = {
        position: 'relative',
        display: 'inline-block',
        width: 'fit-content',
        margin: 0,
        padding: 0,
        // 视觉规范固定为 11px / 4px 圆角，此处保持字面量以与设计稿对齐
        fontSize: 11,
        lineHeight: 1,
        listStyle: 'none',
        verticalAlign: 'middle',
        boxSizing: 'border-box'
    }, _define_property(_obj, "".concat(token.componentCls, "-dot"), {
        display: 'inline-flex',
        justifyContent: 'center',
        padding: '3px 4px',
        textAlign: 'center',
        // 默认描边色：偏冷的浅蓝半透明，与图标渐变呼应；
        // 当前 design token 体系无完全等价 token，保持字面量并集中维护于此
        border: '1px solid rgba(191, 215, 240, 0.25)',
        borderRadius: (_token_borderRadiusSM = token.borderRadiusSM) !== null && _token_borderRadiusSM !== void 0 ? _token_borderRadiusSM : 4,
        // 状态切换时统一过渡，避免在 emphasis / tooltip-visible 切换时跳变
        transition: 'background 0.2s ease-in-out, border-color 0.2s ease-in-out'
    }), _define_property(_obj, "&".concat(token.componentCls, "-status-watermark"), _define_property({}, "".concat(token.componentCls, "-dot"), {
        background: 'transparent',
        border: '1px solid var(--color-gray-border-light)',
        backdropFilter: 'blur(40px)'
    })), _define_property(_obj, "&".concat(token.componentCls, "-status-emphasis"), _define_property({}, "".concat(token.componentCls, "-dot"), {
        background: 'linear-gradient(180deg, var(--color-primary-bg-page-light) 0%, var(--color-primary-bg-page) 100%)',
        border: '1px solid var(--color-gray-bg-card-white)'
    })), _define_property(_obj, "&".concat(token.componentCls, "-with-children"), _define_property({}, "".concat(token.componentCls, "-dot"), {
        position: 'absolute',
        top: 0,
        insetInlineEnd: 0,
        transform: 'translate(50%, -50%)',
        transformOrigin: '100% 0%'
    })), // tooltip 打开时的高亮渐变。仅对 default / watermark 状态生效；
    // emphasis 已经有自己的强调渐变，不应被覆盖（视觉一致性 + 避免抢戏）
    _define_property(_obj, "&".concat(token.componentCls, "-tooltip-visible:not(").concat(token.componentCls, "-status-emphasis)"), _define_property({}, "".concat(token.componentCls, "-dot"), {
        background: 'linear-gradient(293deg, var(--color-primary-bg-page-light) 39%, var(--color-primary-bg-page) 62%, var(--color-primary-bg-page-light) 91%)',
        backdropFilter: 'blur(40px)'
    })), _obj));
};
/**
 * AILabel 默认 prefixCls。
 *
 * 也作为 `ConfigProvider.getPrefixCls(prefixCls)` 的入参，确保「样式注册」与「外部
 * prefix 推导」共享同一字符串字面量，避免散落的 magic string 不一致。
 */ export var prefixCls = 'ai-label';
/**
 * AILabel 样式 hook。
 *
 * @param customPrefixCls - 实际拼接的类名前缀（通常为 `ConfigProvider.getPrefixCls(prefixCls)`
 *   的返回值，例如 `ant-ai-label`）。未传时回退到 {@link prefixCls}。
 *
 * 注意：useEditorStyleRegister 的第一个参数（注册名）固定为 {@link prefixCls}，
 * 与 hash 缓存 key 强绑定；类名前缀（`componentCls`）则使用 `customPrefixCls` 拼接，
 * 二者职责不同。
 */ export function useStyle(customPrefixCls) {
    return useEditorStyleRegister(prefixCls, function(token) {
        var badgeToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(customPrefixCls !== null && customPrefixCls !== void 0 ? customPrefixCls : prefixCls)
        });
        return [
            genStyle(badgeToken)
        ];
    });
}
