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, _obj4, _obj5;
    return _define_property({}, token.componentCls, (_obj5 = {
        padding: '5px 12px',
        height: 'var(--height-control-base)',
        borderRadius: '200px',
        border: '1px solid var(--color-gray-border-light)',
        boxSizing: 'border-box',
        display: 'flex',
        alignItems: 'center',
        cursor: 'pointer',
        background: 'transparent',
        font: 'var(--font-text-body-base)',
        letterSpacing: 'var(--letter-spacing-body-base, normal)',
        color: 'var(--color-gray-text-default)',
        '&.ant-btn': {
            borderRadius: '200px',
            gap: 0
        },
        // hover
        '&:hover:not(&-disabled)': {
            background: 'var(--color-gray-control-fill-hover)',
            border: '1px solid var(--color-gray-border-light)'
        },
        // active
        '&:active:not(&-disabled)': (_obj = {
            background: 'var(--color-primary-bg-card-light)',
            border: '1px solid var(--color-primary-border-light)',
            font: 'var(--font-text-h6-base)',
            color: 'var(--color-blue-text-secondary)'
        }, // 文本与图标颜色显式同步
        _define_property(_obj, "".concat(token.componentCls, "-text, ").concat(token.componentCls, "-icon"), {
            color: 'var(--color-blue-text-secondary)'
        }), _define_property(_obj, "".concat(token.componentCls, "-icon svg"), {
            fill: 'currentColor',
            color: 'currentColor'
        }), _obj),
        // 受控 active（类名）
        '&-active': (_obj1 = {
            background: 'var(--color-primary-bg-card-light)',
            border: '1px solid var(--color-primary-border-light)',
            font: 'var(--font-text-h6-base)',
            color: 'var(--color-blue-text-secondary)'
        }, _define_property(_obj1, "".concat(token.componentCls, "-text, ").concat(token.componentCls, "-icon"), {
            color: 'var(--color-blue-text-secondary)'
        }), _define_property(_obj1, "".concat(token.componentCls, "-icon svg"), {
            fill: 'currentColor',
            color: 'currentColor'
        }), _obj1),
        // 与 antd 变体类（outlined）组合时的 active 覆盖（按下）
        '&.ant-btn-variant-outlined:not(:disabled):not(.ant-btn-disabled):active': (_obj2 = {
            background: 'var(--color-primary-bg-card-light)',
            borderColor: 'var(--color-primary-border-light)',
            color: 'var(--color-blue-text-secondary)'
        }, _define_property(_obj2, "".concat(token.componentCls, "-text, ").concat(token.componentCls, "-icon"), {
            color: 'var(--color-blue-text-secondary)'
        }), _define_property(_obj2, "".concat(token.componentCls, "-icon svg"), {
            fill: 'currentColor',
            color: 'currentColor'
        }), _obj2),
        // 与 antd 变体类（outlined）组合时的受控 active 常驻覆盖
        '&.ant-btn-variant-outlined&-active': (_obj3 = {
            background: 'var(--color-primary-bg-card-light)',
            borderColor: 'var(--color-primary-border-light)',
            color: 'var(--color-blue-text-secondary)'
        }, _define_property(_obj3, "".concat(token.componentCls, "-text, ").concat(token.componentCls, "-icon"), {
            color: 'var(--color-blue-text-secondary)'
        }), _define_property(_obj3, "".concat(token.componentCls, "-icon svg"), {
            fill: 'currentColor',
            color: 'currentColor'
        }), _obj3),
        // disabled
        '&-disabled': (_obj4 = {
            border: '1px solid var(--color-gray-border-light)',
            color: 'var(--color-gray-text-disabled)',
            cursor: 'not-allowed'
        }, _define_property(_obj4, "".concat(token.componentCls, "-text, ").concat(token.componentCls, "-icon"), {
            color: 'var(--color-gray-text-disabled)'
        }), _define_property(_obj4, "".concat(token.componentCls, "-icon svg"), {
            fill: 'currentColor',
            color: 'currentColor'
        }), _obj4)
    }, _define_property(_obj5, "".concat(token.componentCls, "-icon"), {
        display: 'inline-flex',
        alignItems: 'center',
        justifyContent: 'center',
        fontSize: 'inherit',
        lineHeight: 1,
        marginRight: 4,
        color: 'inherit'
    }), _define_property(_obj5, "".concat(token.componentCls, "-text"), {
        display: 'inline-block',
        whiteSpace: 'nowrap',
        overflow: 'hidden',
        textOverflow: 'ellipsis',
        marginRight: 8,
        color: 'inherit',
        font: 'inherit',
        letterSpacing: 'inherit',
        lineHeight: '19px'
    }), _define_property(_obj5, "".concat(token.componentCls, "-trigger-icon"), {
        display: 'inline-flex',
        alignItems: 'center',
        justifyContent: 'center',
        fontSize: 'inherit',
        lineHeight: 1,
        color: 'inherit'
    }), _obj5));
};
export function useStyle(prefixCls) {
    return useEditorStyleRegister('switch-button', function(token) {
        var buttonToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genStyle(buttonToken)
        ];
    });
}
