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 _obj, _obj1, _obj2, _obj3;
    return _obj3 = {}, _define_property(_obj3, "".concat(token.componentCls, "-load-more"), {
        height: '48px',
        display: 'flex',
        justifyContent: 'flex-start',
        alignItems: 'center',
        font: 'var(--font-text-body-base)',
        letterSpacing: 'var(--letter-spacing-body-base, normal)',
        color: 'var(--color-gray-text-default)',
        cursor: 'pointer',
        gap: '4px',
        padding: '0px 12px',
        marginTop: '4px',
        '&.chat': {
            color: 'var(--color-gray-text-light)',
            height: '32px',
            justifyContent: 'center',
            padding: '0'
        },
        '& > div:first-child': {
            width: '32px',
            height: '32px',
            display: 'flex',
            justifyContent: 'center',
            alignItems: 'center',
            borderRadius: '50%',
            background: 'var(--color-gray-bg-card-light)',
            marginRight: '8px',
            fontSize: '16px',
            color: 'var(--color-gray-text-secondary)'
        },
        '&:hover': {
            borderRadius: '8px',
            background: 'var(--color-gray-control-fill-hover)',
            boxSizing: 'border-box'
        }
    }), _define_property(_obj3, token.componentCls, (_obj2 = {
        width: '100%',
        backgroundColor: 'transparent',
        outline: 'none',
        padding: '0',
        '&-item': (_obj = {
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'space-between',
            cursor: 'pointer',
            borderRadius: 'var(--radius-control-base)',
            padding: '5px 6px 5px 12px',
            backgroundColor: 'transparent',
            color: token.colorText || 'var(--color-gray-text-default)',
            font: 'var(--font-text-body-base)',
            position: 'relative',
            userSelect: 'none',
            lineHeight: '20px',
            transition: 'all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)'
        }, // 任务状态图标容器：之前同名 key 写了两份会被静默覆盖（后者胜出，丢失 padding:8px）。
        // 合并为并集：保留 padding 控制内边距 + fontSize 控制图标字号。
        _define_property(_obj, "".concat(token.componentCls, "-task-icon"), {
            width: '32px',
            height: '32px',
            display: 'flex',
            flexDirection: 'column',
            justifyContent: 'center',
            alignItems: 'center',
            padding: '8px',
            gap: '10px',
            fontSize: '16px',
            borderRadius: '50%',
            background: 'var(--color-gray-bg-page-dark)',
            color: 'var(--color-gray-text-secondary)'
        }), _define_property(_obj, '&:hover:not(&-disabled)', _define_property({
            backgroundColor: 'var(--color-gray-control-fill-hover)'
        }, "".concat(token.componentCls, "-extra-actions"), {
            opacity: 1
        })), _define_property(_obj, "".concat(token.componentCls, "-extra-actions"), {
            opacity: 0,
            transition: 'all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)'
        }), _define_property(_obj, '&-selected', {
            font: 'var(--font-text-h6-base)',
            backgroundColor: 'var(--color-gray-control-fill-active)'
        }), _define_property(_obj, '&-disabled', {
            cursor: 'not-allowed',
            color: token.colorTextDisabled || 'var(--color-gray-text-default)',
            opacity: 0.6,
            '&:hover': {
                backgroundColor: 'transparent'
            }
        }), _define_property(_obj, '&-content', {
            display: 'flex',
            alignItems: 'center',
            gap: '8px',
            flex: 1,
            minWidth: 0,
            font: 'var(--font-text-body-emphasized-sm)',
            letterSpacing: 'var(--letter-spacing-body-emphasized-sm, normal)',
            color: 'var(--color-gray-text-light)'
        }), _define_property(_obj, '&-icon', {
            fontSize: 'var(--font-size-base)',
            width: '16px',
            height: '16px',
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            flexShrink: 0,
            color: 'inherit'
        }), _define_property(_obj, '&-group', {
            cursor: 'default',
            backgroundColor: 'transparent',
            height: '32px',
            display: 'flex',
            justifyContent: 'space-between',
            alignItems: 'center',
            fontSize: 'var(--font-size-base)',
            padding: '6px 6px 6px 12px',
            lineHeight: '20px',
            letterSpacing: 'normal',
            color: 'var(--color-gray-text-default)',
            zIndex: 0
        }), _define_property(_obj, '&:active:not(&-disabled)', {
            backgroundColor: 'transparent'
        }), _obj),
        '&-submenu': (_obj1 = {
            gap: 4,
            display: 'flex',
            flexDirection: 'column'
        }, _define_property(_obj1, "".concat(token.componentCls, "-item"), {
            fontSize: 'var(--font-size-base)'
        }), _define_property(_obj1, "".concat(token.componentCls, "-submenu"), _define_property({
            marginLeft: '16px'
        }, "".concat(token.componentCls, "-item"), {
            paddingLeft: '28px',
            fontSize: 'var(--font-size-base)'
        })), _obj1),
        '&-submenu-title': {
            fontSize: 'var(--font-size-base)',
            color: token.colorTextSecondary || 'var(--color-gray-text-default)',
            fontWeight: 500,
            padding: '5px 6px 5px 12px'
        },
        // Container focus styles
        '&:focus-within': {
            outline: 'none'
        },
        // Scrollbar styles
        '&::-webkit-scrollbar': {
            width: '6px'
        },
        '&::-webkit-scrollbar-track': {
            backgroundColor: 'transparent'
        },
        '&::-webkit-scrollbar-thumb': {
            backgroundColor: token.colorBorder || 'var(--color-gray-border-light)',
            borderRadius: '3px',
            '&:hover': {
                backgroundColor: token.colorTextSecondary || 'var(--color-gray-text-default)'
            }
        }
    }, // Animation for menu items
    _define_property(_obj2, "".concat(token.componentCls, "-item"), {
        animationName: 'fadeIn',
        animationDuration: '0.2s',
        animationTimingFunction: 'ease-in-out'
    }), _define_property(_obj2, '@keyframes fadeIn', {
        '0%': {
            opacity: 0,
            transform: 'translateY(-2px)'
        },
        '100%': {
            opacity: 1,
            transform: 'translateY(0)'
        }
    }), // 文本滚动动画
    _define_property(_obj2, '@keyframes scrollText', {
        '0%': {
            transform: 'translateX(0)'
        },
        '5%': {
            transform: 'translateX(0)'
        },
        '95%': {
            transform: 'translateX(var(--scroll-width, 0px))'
        },
        '100%': {
            transform: 'translateX(var(--scroll-width, 0px))'
        }
    }), // 为超长文本添加滚动效果
    _define_property(_obj2, '[data-overflow="true"]', {
        '&:hover': {
            // 支持直接在元素上的属性
            '&[aria-describedby]': {
                animationName: 'scrollText',
                animationDuration: 'var(--scroll-duration, 6s)',
                animationTimingFunction: 'linear',
                animationDelay: '0.5s',
                animationFillMode: 'forwards',
                animationPlayState: 'running'
            },
            // 支持子元素上的属性
            '& > div[aria-describedby]': {
                animationName: 'scrollText',
                animationDuration: 'var(--scroll-duration, 6s)',
                animationTimingFunction: 'linear',
                animationDelay: '0.5s',
                animationFillMode: 'forwards',
                animationPlayState: 'running'
            },
            // 渐变遮罩层
            '& > div[style*="linear-gradient"], & + div[style*="linear-gradient"]': {
                opacity: '0 !important',
                transition: 'opacity 0.2s'
            }
        }
    }), // 基础样式和重置
    // 同时支持元素自身和子元素的情况
    _define_property(_obj2, '[data-overflow="true"][aria-describedby], [data-overflow="true"] > div[aria-describedby]', {
        transition: 'transform 0.3s ease-out',
        transform: 'translateX(0)',
        animation: 'none'
    }), _define_property(_obj2, '&-scroll-container', {
        '&::-webkit-scrollbar': {
            width: '4px'
        },
        '&::-webkit-scrollbar-track': {
            backgroundColor: 'transparent'
        },
        '&::-webkit-scrollbar-thumb': {
            backgroundColor: 'var(--color-gray-border-light)',
            borderRadius: '4px'
        }
    }), _obj2)), _obj3;
};
/** @internal 供单测调用 genStyle 覆盖 token 回退分支 */ export { genStyle };
export function useStyle(prefixCls) {
    return useEditorStyleRegister('history-group-menu', function(token) {
        var groupMenuToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(groupMenuToken)
        ];
    });
}
