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 { Keyframes } from "@ant-design/cssinjs";
import { useEditorStyleRegister } from "../Hooks/useStyle";
// 定义旋转动画
var stopIconRotate = new Keyframes('stopIconRotate', {
    '0%': {
        transform: 'rotate(0deg)'
    },
    '100%': {
        transform: 'rotate(360deg)'
    }
});
var borderSpin = new Keyframes('borderSpin', {
    '0%': {
        backgroundPosition: '200% 50%'
    },
    '100%': {
        backgroundPosition: '0% 50%'
    }
});
/**
 * 生成任务运行组件的样式
 *
 * @param token - 主题令牌，包含全局样式变量
 * @returns CSS-in-JS 样式对象
 */ var genStyle = function genStyle(token) {
    var componentCls = token.componentCls;
    // 优先使用 antd token，回退到原有的 CSS 变量（兼容尚未注入 antd token 的旧主题）
    var colorText = "var(--color-gray-text-default, ".concat(token.colorText, ")");
    var colorTextSecondary = "var(--color-gray-text-light, ".concat(token.colorTextSecondary, ")");
    var colorTextTertiary = "var(--color-gray-text-secondary, ".concat(token.colorTextTertiary, ")");
    var colorBgContainer = "var(--color-gray-bg-card-white, ".concat(token.colorBgContainer, ")");
    var colorBgLayout = "var(--color-gray-bg-page-dark, ".concat(token.colorBgLayout, ")");
    var colorFillSecondary = "var(--color-gray-control-fill-secondary, ".concat(token.colorFillSecondary, ")");
    var colorFillTertiary = "var(--color-gray-control-fill-secondary-hover, ".concat(token.colorFillTertiary, ")");
    var colorFillActive = "var(--color-gray-control-fill-active, ".concat(token.colorFillTertiary, ")");
    var colorPrimary = "var(--color-primary-control-fill-primary, ".concat(token.colorPrimary, ")");
    var colorPrimaryBg = "var(--color-primary-control-fill-secondary, ".concat(token.colorPrimaryBg, ")");
    var borderRadiusLG = "var(--radius-card-lg, ".concat(token.borderRadiusLG, "px)");
    var borderRadius = "var(--radius-control-base, ".concat(token.borderRadius, "px)");
    var borderRadiusSM = "var(--radius-control-sm, ".concat(token.borderRadiusSM, "px)");
    var boxShadowSecondary = "var(--shadow-popover-base, ".concat(token.boxShadowSecondary, ")");
    var boxShadow = "var(--shadow-control-base, ".concat(token.boxShadow, ")");
    var fontSize = "var(--font-size-base, ".concat(token.fontSize, "px)");
    var _obj, _obj1, _obj2;
    return _obj2 = {}, _define_property(_obj2, componentCls, {
        position: 'relative',
        minWidth: 398,
        width: 'max-content',
        maxWidth: 'min(800px,100%)',
        height: 58,
        padding: 8,
        gap: 12,
        zIndex: 2,
        display: 'flex',
        justifyContent: 'space-between',
        alignItems: 'center',
        borderRadius: borderRadiusLG,
        '&-border': {
            position: 'absolute',
            top: 0,
            left: 0,
            right: 0,
            bottom: 0,
            zIndex: -1,
            background: 'linear-gradient(90deg, #D3FEFF 0%, #FFF16F 16%, rgba(82, 212, 255, 0.2329) 50%, #D3FEFF 75%, #D3FEFF 100%)',
            backgroundSize: '200% 50%',
            borderRadius: borderRadiusLG,
            opacity: 1,
            boxShadow: boxShadowSecondary,
            animationName: borderSpin,
            animationDuration: '8s',
            animationTimingFunction: 'linear',
            animationIterationCount: 'infinite',
            pointerEvents: 'none',
            overflow: 'hidden',
            transitionProperty: 'background',
            transitionDuration: token.motionDurationMid,
            transitionTimingFunction: token.motionEaseInOut
        },
        '&-background': {
            position: 'absolute',
            top: 2,
            left: 2,
            right: 2,
            bottom: 2,
            zIndex: -1,
            background: colorBgContainer,
            borderRadius: 14,
            pointerEvents: 'none'
        },
        '&-left': {
            display: 'flex',
            alignItems: 'center',
            gap: 8,
            fontSize: fontSize,
            lineHeight: '20px',
            color: colorText,
            flex: 1,
            minWidth: 0
        },
        '&-left-icon-wrapper': {
            display: 'flex',
            alignItems: 'center',
            justifyContent: 'center',
            marginRight: 20,
            width: 40,
            height: 40
        },
        '&-left-content': (_obj = {
            display: 'flex',
            flexDirection: 'column',
            // 标题与描述的纵向间距由各自 lineHeight 控制（CSS gap 不接受负值，
            // 历史代码里的 gap: -2 等同于 0，已显式改为 0 以避免误导）
            gap: 0,
            overflow: 'hidden'
        }, // title
        _define_property(_obj, "".concat(componentCls, "-left-main-text"), {
            color: colorText,
            lineHeight: '20px',
            font: 'var(--font-text-h6-base)',
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            WebkitBoxOrient: 'vertical',
            WebkitLineClamp: 2,
            display: '-webkit-box',
            margin: 0
        }), // description
        _define_property(_obj, "".concat(componentCls, "-left-text"), {
            lineHeight: '20px',
            font: 'var(--font-text-body-sm)',
            alignItems: 'center',
            letterSpacing: 'var(--letter-spacing-body-sm, normal)',
            display: '-webkit-box',
            '-webkit-line-clamp': '1',
            lineClamp: 1,
            '-webkit-box-orient': 'vertical',
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            color: colorTextSecondary
        }), _obj),
        '&-button-wrapper': {
            display: 'flex',
            alignItems: 'center',
            gap: 8,
            justifyContent: 'center',
            paddingRight: 4,
            '> * ': {
                cursor: 'pointer'
            }
        },
        // 圆形图标控制按钮（停止 / 暂停 / 继续）共用样式
        '&-pause, &-play': {
            display: 'flex',
            justifyContent: 'center',
            alignItems: 'center',
            width: 32,
            height: 32,
            color: colorTextTertiary,
            fontSize: 16,
            background: colorFillSecondary,
            backdropFilter: 'blur(40px)',
            borderRadius: 200,
            zIndex: 0,
            cursor: 'pointer',
            transitionProperty: 'background-color, color',
            transitionDuration: token.motionDurationMid,
            transitionTimingFunction: token.motionEaseInOut,
            '&:hover': {
                background: colorFillTertiary
            },
            '&:active': {
                color: colorPrimary,
                background: colorPrimaryBg
            }
        },
        button: {
            borderRadius: 200
        },
        // 旋转动画样式
        '.stop-icon-ring': {
            transition: 'transform 0.1s ',
            transformOrigin: '16px 16px',
            animationName: stopIconRotate,
            animationDuration: '1s',
            animationTimingFunction: 'linear',
            animationIterationCount: 'infinite'
        }
    }), // with description
    _define_property(_obj2, "".concat(componentCls, "-with-description"), _define_property({}, "".concat(componentCls, "-left-main-text"), {
        textWrap: 'nowrap',
        '-webkit-line-clamp': '1',
        lineClamp: 1
    })), // Status pause
    _define_property(_obj2, "".concat(componentCls, "-status-pause"), _define_property({}, "".concat(componentCls, "-border"), {
        background: colorBgContainer
    })), _define_property(_obj2, "".concat(componentCls).concat(componentCls, "-simple"), (_obj1 = {
        width: '100%',
        height: 39,
        padding: '8px 12px',
        borderRadius: 8
    }, _define_property(_obj1, "".concat(componentCls, "-border"), {
        background: colorBgLayout,
        borderRadius: borderRadius,
        boxShadow: boxShadow
    }), _define_property(_obj1, "".concat(componentCls, "-background"), {
        position: 'absolute',
        top: 0,
        left: 0,
        right: 0,
        bottom: 0,
        background: colorBgLayout,
        borderRadius: 8
    }), // title
    _define_property(_obj1, "".concat(componentCls, "-left-main-text"), {
        color: colorText,
        fontWeight: 'normal',
        lineHeight: '16px',
        font: 'var(--font-text-paragraph-base)',
        letterSpacing: 'var(--letter-spacing-paragraph-base, normal)'
    }), _define_property(_obj1, "".concat(componentCls, "-button-wrapper"), {
        gap: 4
    }), _define_property(_obj1, "".concat(componentCls, "-play, ").concat(componentCls, "-pause"), {
        width: 28,
        height: 28,
        color: colorText,
        fontSize: 14,
        background: 'transparent',
        borderRadius: borderRadiusSM,
        cursor: 'pointer',
        '&:hover': {
            background: colorFillActive
        },
        '&:active': {
            color: colorPrimary,
            background: colorPrimaryBg
        }
    }), _obj1)), _obj2;
};
/**
 * 任务运行组件的样式 Hook
 *
 * 该 Hook 用于生成任务运行组件所需的样式，包括：
 * - 容器样式
 * - 左侧区域样式（图标、标题和描述）
 * - 按钮区域样式（暂停、操作按钮）
 * - 动画效果
 *
 * @param prefixCls - 组件类名前缀
 * @returns 包含样式和 SSR 包装器的对象
 *
 * @example
 * ```tsx
 * const { wrapSSR, hashId } = useStyle('my-prefix');
 * ```
 */ export function useStyle(prefixCls) {
    return useEditorStyleRegister('agent-run-bar', function(token) {
        var agentRunBarToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(agentRunBarToken)
        ];
    });
}
