function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
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 _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
import { genStyleHooks } 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',
        border: "1px solid ".concat(token.aiLabelDotBorderColor),
        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 ".concat(token.aiLabelWatermarkBorderColor),
        backdropFilter: 'blur(40px)'
    })), _define_property(_obj, "&".concat(token.componentCls, "-status-emphasis"), _define_property({}, "".concat(token.componentCls, "-dot"), {
        background: token.aiLabelEmphasisBackground,
        border: "1px solid ".concat(token.aiLabelEmphasisBorderColor)
    })), _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: token.aiLabelTooltipBackground,
        backdropFilter: 'blur(40px)'
    })), _obj));
};
/**
 * AILabel 默认 prefixCls。
 *
 * 也作为 `ConfigProvider.getPrefixCls(prefixCls)` 的入参，确保「样式注册」与「外部
 * prefix 推导」共享同一字符串字面量，避免散落的 magic string 不一致。
 */ export var prefixCls = 'ai-label';
var useGenStyle = genStyleHooks('AILabel', genStyle, function() {
    return {
        aiLabelDotBorderColor: 'rgba(191, 215, 240, 0.25)',
        aiLabelWatermarkBorderColor: 'var(--color-gray-border-light)',
        aiLabelEmphasisBackground: 'linear-gradient(180deg, var(--color-primary-bg-page-light) 0%, var(--color-primary-bg-page) 100%)',
        aiLabelEmphasisBorderColor: 'var(--color-gray-bg-card-white)',
        aiLabelTooltipBackground: 'linear-gradient(293deg, var(--color-primary-bg-page-light) 39%, var(--color-primary-bg-page) 62%, var(--color-primary-bg-page-light) 91%)'
    };
});
/**
 * AILabel 样式 hook。返回结构与旧版一致（`{ wrapSSR, hashId }`），保持调用方零改动。
 *
 * @param customPrefixCls 实际拼接的类名前缀（通常为
 *   `ConfigProvider.getPrefixCls(prefixCls)` 的返回值，例如 `ant-ai-label`）。
 *   未传时回退到 {@link prefixCls}。
 */ export function useStyle(customPrefixCls) {
    var _useGenStyle = _sliced_to_array(useGenStyle(customPrefixCls !== null && customPrefixCls !== void 0 ? customPrefixCls : prefixCls), 2), wrapSSR = _useGenStyle[0], hashId = _useGenStyle[1];
    return {
        wrapSSR: wrapSSR,
        hashId: hashId
    };
}
