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 genQuoteStyle = function genQuoteStyle(token) {
    return _define_property({}, token.componentCls, {
        '&-container': {
            width: 'fit-content',
            minWidth: '150px',
            maxWidth: '560px',
            position: 'relative',
            display: 'flex',
            alignItems: 'center',
            padding: '6px 8px',
            gap: '8px',
            borderRadius: 'var(--radius-control-base)',
            cursor: 'pointer',
            font: 'var(--font-text-body-sm)'
        },
        '&-container:hover': {
            /* 圆角-控件-sm */ borderRadius: 'var(--radius-control-sm)',
            /* gray/gray-控件填充-悬停 */ /* 样式描述：--gray-a2 */ background: 'var(--color-gray-control-fill-hover)',
            /* 投影-描边-base */ boxShadow: 'var(--shadow-border-base)'
        },
        '&-container:hover &-close-button': {
            display: 'flex',
            alignItems: 'center'
        },
        '&-quote-icon': {
            fontSize: 14,
            display: 'flex',
            alignItems: 'center',
            color: 'var(--color-gray-text-secondary)'
        },
        '&-close-button': {
            fontSize: 14,
            color: 'var(--color-gray-text-default)',
            display: 'none'
        },
        '&-quoteDescription': {
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            whiteSpace: 'nowrap',
            flex: 1,
            color: 'var(--color-gray-text-default)',
            font: 'var(--font-text-body-sm)'
        },
        // 弹出层样式
        '&-popup': {
            position: 'absolute',
            bottom: '30px',
            minWidth: '240px',
            maxWidth: '800px',
            /* 圆角-卡片-base */ borderRadius: 'var(--radius-card-base)',
            background: 'var(--color-gray-bg-page-light)',
            boxSizing: 'border-box',
            border: '1px solid var(--color-gray-border-light)',
            boxShadow: 'var(--shadow-popover-base)',
            display: 'none',
            flexDirection: 'column',
            gap: 4,
            zIndex: 1001,
            minHeight: 'auto',
            fontSize: '12px',
            fontWeight: 'normal',
            lineHeight: '20px',
            letterSpacing: 'normal',
            color: 'var(--color-gray-text-secondary)',
            padding: 4,
            // 扩展hover区域，填补与容器之间的空隙
            '&::before': {
                content: '""',
                position: 'absolute',
                bottom: '-10px',
                left: '0',
                right: '0',
                height: '10px',
                background: 'transparent',
                pointerEvents: 'auto'
            }
        },
        // hover时显示弹框（包括hover到连接区域）
        '&-container:hover &-popup': {
            display: 'flex'
        },
        '&-popup:hover': {
            display: 'flex'
        },
        /* gray/gray-背景-页面-浅 */ '&-popup-content': {
            padding: '8px',
            whiteSpace: 'pre-wrap',
            wordBreak: 'break-word',
            maxHeight: '70px',
            overflowY: 'auto',
            lineHeight: '20px',
            boxSizing: 'border-box',
            letterSpacing: 'var(--letter-spacing-body-sm, normal)',
            borderRadius: 'var(--radius-card-base)',
            background: 'var(--color-gray-bg-card-white)',
            boxShadow: 'var(--shadow-border-base)'
        },
        '&-popup-header': {
            display: 'flex',
            alignItems: 'center',
            gap: 4,
            padding: '4px 8px',
            width: 'fit-content',
            maxWidth: '100%'
        },
        '&-popup-header:hover': {
            borderRadius: 'var(--radius-control-base)',
            background: 'var(--color-gray-control-fill-hover)'
        },
        '&-popup-title': {
            overflow: 'hidden',
            textOverflow: 'ellipsis',
            whiteSpace: 'nowrap'
        },
        '&-popup-range': {
            flex: 'none'
        }
    });
};
export function useStyle(prefixCls) {
    return useEditorStyleRegister('quote', function(token) {
        var quoteToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            genQuoteStyle(quoteToken)
        ];
    });
}
