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 THINKING_DOT_SIZE = 4;
var THINKING_DOT_GAP = 4;
var THINKING_DOT_ANIMATION = 'agenticBubbleThinkingDotPulse';
var THINKING_DOT_ANIMATION_DURATION = '1.2s';
var THINKING_LOADING_MARGIN_TOP = 'var(--padding-2x)';
var THINKING_LOADING_PADDING = {
    paddingLeft: 'var(--padding-5x)',
    paddingRight: 'var(--padding-5x)',
    paddingTop: 'var(--padding-1x)',
    paddingBottom: 'var(--padding-2x)'
};
var genStyle = function genStyle(token) {
    var _obj, _obj1;
    return _obj1 = {}, // 加载状态容器（compact模式）
    _define_property(_obj1, "".concat(token.componentCls, "-messages-content-loading"), _object_spread_props(_object_spread({
        lineHeight: '24px',
        display: 'flex',
        alignItems: 'center',
        gap: 'var(--padding-2x)',
        marginTop: THINKING_LOADING_MARGIN_TOP
    }, THINKING_LOADING_PADDING), (_obj = {
        color: 'rgb(102, 111, 141)'
    }, _define_property(_obj, "&-dots", {
        display: 'inline-flex',
        alignItems: 'center',
        gap: THINKING_DOT_GAP,
        lineHeight: 1
    }), _define_property(_obj, "&-dot", {
        width: THINKING_DOT_SIZE,
        height: THINKING_DOT_SIZE,
        borderRadius: '50%',
        backgroundColor: 'currentColor',
        opacity: 0.35,
        animationName: THINKING_DOT_ANIMATION,
        animationDuration: THINKING_DOT_ANIMATION_DURATION,
        animationTimingFunction: 'ease-in-out',
        animationIterationCount: 'infinite'
    }), _define_property(_obj, "&-dot:nth-of-type(2)", {
        animationDelay: '0.2s'
    }), _define_property(_obj, "&-dot:nth-of-type(3)", {
        animationDelay: '0.4s'
    }), _define_property(_obj, '&-compact', _object_spread({}, THINKING_LOADING_PADDING)), _define_property(_obj, '&-default', _object_spread({}, THINKING_LOADING_PADDING)), _obj))), // 消息内容容器
    _define_property(_obj1, "".concat(token.componentCls, "-messages-content-message"), {
        lineHeight: '24px'
    }), // 用户消息文本颜色
    _define_property(_obj1, "".concat(token.componentCls, "-messages-content-user-text"), {
        color: 'var(--color-gray-text-default)'
    }), // Popover 标题容器
    _define_property(_obj1, "".concat(token.componentCls, "-messages-content-popover-title"), {
        display: 'flex',
        justifyContent: 'space-between',
        alignItems: 'center',
        fontSize: '1em'
    }), // Popover 内容容器
    _define_property(_obj1, "".concat(token.componentCls, "-messages-content-popover-content"), {
        width: 400,
        display: 'flex',
        maxHeight: 400,
        overflow: 'auto',
        flexDirection: 'column',
        gap: 'var(--padding-3x)'
    }), // MarkdownEditor 容器样式
    _define_property(_obj1, "".concat(token.componentCls, "-messages-content-markdown-editor"), {
        padding: 0,
        width: '100%'
    }), // 重新生成按钮容器
    _define_property(_obj1, "div[data-messages-content-retry]", {
        gap: 4,
        display: 'flex',
        cursor: 'pointer',
        alignItems: 'center'
    }), // 文档标签容器
    _define_property(_obj1, "".concat(token.componentCls, "-messages-content-doc-tag"), {
        borderRadius: 'var(--padding-5x)',
        opacity: 1,
        display: 'flex',
        flexDirection: 'row',
        alignItems: 'center',
        padding: 'var(--padding-2x) var(--padding-3x)',
        gap: 'var(--padding-2x)',
        alignSelf: 'stretch',
        background: 'var(--color-gray-bg-page-light)',
        cursor: 'pointer',
        zIndex: 1
    }), // 文档标签图标
    _define_property(_obj1, "".concat(token.componentCls, "-messages-content-doc-tag-icon"), {
        width: 24
    }), // 文档名称文本
    _define_property(_obj1, "".concat(token.componentCls, "-messages-content-doc-name"), {
        overflow: 'hidden',
        textOverflow: 'ellipsis',
        WebkitBoxOrient: 'vertical',
        WebkitLineClamp: 2,
        display: '-webkit-box'
    }), _define_property(_obj1, "@keyframes ".concat(THINKING_DOT_ANIMATION), {
        '0%, 80%, 100%': {
            transform: 'scale(0.6)',
            opacity: 0.35
        },
        '40%': {
            transform: 'scale(1)',
            opacity: 1
        }
    }), // BubbleExtra 操作区入场动画：替代 framer-motion 的 fade-in
    // 原实现 staggerChildren 对子组件无效（子组件并非 motion.*），故直接 fade
    _define_property(_obj1, "".concat(token.componentCls, "-action-box"), {
        animationName: "".concat(token.componentCls, "-actionBoxFadeIn"),
        animationDuration: '0.3s',
        animationTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',
        animationDelay: '0.5s',
        animationFillMode: 'both'
    }), _define_property(_obj1, "@keyframes ".concat(token.componentCls, "-actionBoxFadeIn"), {
        from: {
            opacity: 0
        },
        to: {
            opacity: 1
        }
    }), _obj1;
};
export function useMessagesContentStyle(componentCls) {
    return useEditorStyleRegister('BubbleMessageDisplay', function(token) {
        var chatToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(componentCls)
        });
        return genStyle(chatToken);
    });
}
