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 { resetComponent, useEditorStyleRegister } from "../Hooks/useStyle";
var genStyle = function genStyle(token, classNames) {
    var _obj;
    return _define_property({}, token.componentCls, {
        '&-bubble': {
            position: 'relative',
            maxWidth: '100vw',
            cursor: 'pointer',
            '&&-compact': {
                padding: 'var(--padding-0-5x)'
            },
            '&:hover': _define_property({}, "".concat(token.componentCls, "-bubble-title-time"), {
                visibility: 'visible'
            })
        },
        '.agentic-md-editor-code': {
            borderRadius: '12px !important',
            overflow: 'auto',
            padding: 'var(--padding-3x)'
        },
        '&-bubble-avatar': {
            width: 40,
            height: 40
        },
        '&-bubble-avatar-title': _define_property({
            lineHeight: '20px',
            textAlign: 'justify',
            letterSpacing: 'normal',
            color: 'var(--color-gray-text-default)',
            fontSize: '1em',
            display: 'flex',
            gap: 'var(--margin-1x)',
            '&-pure': {
                paddingLeft: '20px'
            },
            '&-quote': {
                marginBottom: '0px',
                flexDirection: 'column'
            }
        }, "span.".concat(classNames === null || classNames === void 0 ? void 0 : classNames.bubbleNameClassName), {
            fontWeight: 600,
            fontSize: '1em',
            color: 'var(--color-gray-text-default)',
            display: 'flex',
            alignItems: 'center'
        }),
        '&-bubble-avatar-emoji': {
            fontSize: 24,
            textAlign: 'center',
            lineHeight: '36px'
        },
        '&-bubble-container': {
            width: '100%',
            display: 'flex',
            flexDirection: 'column',
            gap: 8,
            '&-pure': {
                gap: 8
            },
            '&-right': {
                alignItems: 'flex-end'
            },
            '&-left': {
                alignItems: 'flex-start'
            }
        },
        '&-bubble-content': (_obj = {
            fontSize: '1em',
            minHeight: '2em',
            maxWidth: 'min(860px,100%)',
            justifyContent: 'center',
            gap: 0,
            lineHeight: '22px',
            padding: 0,
            backdropFilter: 'blur(10px)',
            color: 'var(--color-gray-text-secondary)',
            width: 'max-content',
            borderRadius: '12px',
            background: 'var(--color-gray-bg-card-white)',
            boxShadow: 'var(--shadow-control-base)',
            display: 'flex',
            flexDirection: 'column',
            zIndex: 0,
            '&&-compact': {
                minHeight: '38px',
                padding: '0px'
            },
            '&&-pure': {
                width: '100%',
                boxShadow: 'none !important',
                background: 'transparent',
                backgroundColor: 'transparent',
                color: 'var(--color-gray-text-default)'
            },
            '&-standalone': {
                maxWidth: 'min(860px,100%)'
            },
            '*': {
                whiteSpace: 'pre-wrap',
                textWrap: 'wrap',
                wordWrap: 'break-word'
            },
            video: {
                borderRadius: '12px',
                overflow: 'auto'
            }
        }, _define_property(_obj, "div['data-be=code']", {
            borderRadius: '12px',
            overflow: 'auto'
        }), _define_property(_obj, 'div[data-be="paragraph"]', {
            color: 'var(--color-gray-text-default)',
            font: 'var(--font-text-paragraph-lg)',
            letterSpacing: 'var(--letter-spacing-paragraph-lg, normal)'
        }), _define_property(_obj, "img", {
            borderRadius: '12px',
            overflow: 'auto'
        }), _obj),
        '&-bubble-after': {
            width: 'max-content',
            minWidth: '0px',
            display: 'flex',
            maxWidth: 'min(860px,100%)',
            '&-left': {
                justifyContent: 'flex-start',
                maxWidth: 'min(860px,100%)'
            },
            '&-right': {
                justifyContent: 'flex-end',
                maxWidth: 'min(860px,100%)'
            }
        },
        '&-bubble-before': {
            width: 'max-content',
            minWidth: '0px',
            maxWidth: 'min(860px,100%)'
        },
        '&-bubble-content-right': {
            maxWidth: '75%',
            borderRadius: '16px 16px 2px 16px',
            background: 'var(--color-primary-control-fill-secondary-active)',
            color: 'var(--color-gray-text-default)',
            boxShadow: 'none',
            '&&-pure': {
                background: 'var(--color-primary-control-fill-primary)'
            }
        },
        // 用户消息特定样式
        '&-bubble-user': {
            marginBlockStart: -20,
            '&-avatar-title-user': {
                flexDirection: 'row-reverse',
                justifyContent: 'flex-end'
            },
            '&-container-user': {
                alignItems: 'flex-end',
                maxWidth: 'max(668px,75%)'
            },
            '&-content-user': {
                background: 'var(--color-primary-bg-card-light)',
                color: 'var(--color-gray-text-default)',
                borderRadius: '12px 12px 2px 12px',
                maxWidth: '668px',
                '&&-pure': {
                    background: 'var(--color-primary-control-fill-primary)'
                }
            },
            '&-before-user': {
                justifyContent: 'flex-end'
            },
            '&-after-user': {
                justifyContent: 'flex-end'
            }
        },
        // AI消息特定样式
        '&-bubble-ai': {
            '&-avatar-title-ai': {
                flexDirection: 'row',
                justifyContent: 'flex-start'
            },
            '&-container-ai': {
                alignItems: 'flex-start'
            },
            '&-content-ai': {
                background: 'var(--color-gray-bg-card-white)',
                color: 'var(--color-gray-text-secondary)',
                borderRadius: '12px',
                '&&-pure': {
                    boxShadow: 'none',
                    backgroundColor: 'transparent',
                    color: 'var(--color-gray-text-default)'
                }
            },
            '&-before-ai': {
                justifyContent: 'flex-start'
            },
            '&-after-ai': {
                justifyContent: 'flex-start'
            }
        }
    });
};
/**
 * Probubble
 * @param prefixCls
 * @returns
 */ export function useStyle(prefixCls, classNames) {
    return useEditorStyleRegister('ListItem', function(token) {
        var proChatToken = _object_spread_props(_object_spread({}, token), {
            componentCls: ".".concat(prefixCls)
        });
        return [
            resetComponent(proChatToken),
            genStyle(proChatToken, classNames)
        ];
    });
}
