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";
import { sharedButtonVariants } from "../sharedStyle";
var genStyle = function genStyle(token) {
    return _define_property({}, token.componentCls, _object_spread_props(_object_spread({
        // 基础按钮样式
        borderRadius: '200px',
        boxSizing: 'border-box',
        border: '1px solid var(--color-gray-border-light)',
        height: '32px',
        display: 'flex',
        alignItems: 'center',
        padding: '5px 12px',
        cursor: 'pointer',
        fontFamily: 'var(--font-family-base, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif)',
        fontSize: 'var(--font-size-base, 14px)',
        fontWeight: 'var(--font-weight-medium, 500)',
        lineHeight: 'var(--line-height-base, 1.5)',
        textAlign: 'center',
        textDecoration: 'none',
        transition: 'all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1)',
        userSelect: 'none',
        outline: 'none',
        position: 'relative',
        overflow: 'hidden',
        backgroundColor: 'transparent',
        // Hover 状态
        '&:hover:not(&-disabled)': {
            background: 'var(--color-gray-control-fill-hover)',
            boxSizing: 'border-box',
            border: '1px solid var(--color-gray-border-light)'
        },
        // Active 状态
        '&:active:not(&-disabled)': {
            background: 'var(--color-primary-bg-card-light)',
            boxSizing: 'border-box',
            border: '1px solid var(--color-primary-border-light)'
        },
        // Active 属性状态
        '&-active': // Active 状态下的文字颜色
        _define_property({
            background: 'var(--color-primary-bg-card-light)',
            boxSizing: 'border-box',
            border: '1px solid var(--color-primary-border-light)'
        }, "".concat(token.componentCls, "-text"), {
            color: 'var(--color-blue-text-secondary)'
        }),
        // 尺寸变体
        '&-small': {
            height: 'var(--height-control-small, 28px)',
            padding: '0 var(--padding-control-small, 12px)',
            fontSize: 'var(--font-size-small, 12px)',
            minWidth: 'var(--min-width-control-small, 60px)'
        },
        '&-large': {
            height: 'var(--height-control-large, 40px)',
            padding: '0 var(--padding-control-large, 16px)',
            fontSize: 'var(--font-size-base, 14px)',
            minWidth: 'var(--min-width-control-large, 80px)'
        }
    }, sharedButtonVariants), {
        // 图标样式
        '&-icon': {
            display: 'inline-flex',
            alignItems: 'center',
            justifyContent: 'center',
            fontSize: 'inherit',
            lineHeight: 1,
            marginRight: '4px'
        },
        // 文字样式
        '&-text': {
            display: 'inline-block',
            whiteSpace: 'nowrap',
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            font: 'var(--font-text-body-base)',
            letterSpacing: 'var(--letter-spacing-body-base, normal)',
            color: 'var(--color-gray-text-default)'
        },
        // 触发图标样式
        '&-trigger-icon': {
            display: 'inline-flex',
            alignItems: 'center',
            justifyContent: 'center',
            color: 'var(--color-gray-text-light)',
            fontSize: 'inherit',
            lineHeight: 1
        }
    }));
};
export function useStyle(prefixCls) {
    return useEditorStyleRegister('toggle-button', function(token) {
        var buttonToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(buttonToken)
        ];
    });
}
