function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
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 _extends() {
    _extends = Object.assign || function(target) {
        for(var i = 1; i < arguments.length; i++){
            var source = arguments[i];
            for(var key in source){
                if (Object.prototype.hasOwnProperty.call(source, key)) {
                    target[key] = source[key];
                }
            }
        }
        return target;
    };
    return _extends.apply(this, arguments);
}
function _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _object_destructuring_empty(o) {
    if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
    return o;
}
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;
}
function _object_without_properties(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys, key, i;
    if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
        sourceKeys = Reflect.ownKeys(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
        return target;
    }
    target = _object_without_properties_loose(source, excluded);
    if (Object.getOwnPropertySymbols) {
        sourceKeys = Object.getOwnPropertySymbols(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
    }
    return target;
}
function _object_without_properties_loose(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
    for(i = 0; i < sourceKeys.length; i++){
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
    }
    return target;
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
import { CloseCircleFilled } from "@ant-design/icons";
import { ChevronsDownUp, ChevronsUpDown, CircleCheckBig, Loader, Sparkles } from "@sofa-design/icons";
import { ConfigProvider, Descriptions, Drawer, Typography } from "antd";
import classNames from "classnames";
import dayjs from "dayjs";
import duration from "dayjs/plugin/duration";
import { motion } from "framer-motion";
import { merge } from "lodash-es";
import React, { useContext, useEffect, useMemo } from "react";
import { ErrorBoundary } from "react-error-boundary";
import { ActionIconBox } from "../Components/ActionIconBox";
import { useAutoScroll } from "../Hooks/useAutoScroll";
import { I18nContext } from "../I18n";
import { DotLoading } from "./DotAni";
import { FlipText } from "./FlipText";
import { useStyle } from "./style";
import { ThoughtChainListItem } from "./ThoughtChainListItem";
import { TitleInfo } from "./TitleInfo";
// Initialize dayjs plugins
try {
    dayjs.extend(duration);
} catch (error) {
    console.warn('Failed to extend dayjs with duration plugin:', error);
}
// 思维链标题组件 - 独立 memo
var ThoughtChainTitle = /*#__PURE__*/ React.memo(function(_0) {
    var prefixCls = _0.prefixCls, hashId = _0.hashId, collapse = _0.collapse, compact = _0.compact, endStatusDisplay = _0.endStatusDisplay, onCollapseToggle = _0.onCollapseToggle, locale = _0.locale, props = _object_without_properties(_0, [
        "prefixCls",
        "hashId",
        "collapse",
        "compact",
        "endStatusDisplay",
        "onCollapseToggle",
        "locale"
    ]);
    var extra = /*#__PURE__*/ React.createElement(ActionIconBox, {
        title: collapse ? (locale === null || locale === void 0 ? void 0 : locale.expand) || '展开' : (locale === null || locale === void 0 ? void 0 : locale.collapse) || '收起',
        onClick: onCollapseToggle
    }, !collapse ? /*#__PURE__*/ React.createElement(ChevronsDownUp, null) : /*#__PURE__*/ React.createElement(ChevronsUpDown, null));
    var _obj;
    var dom = /*#__PURE__*/ React.createElement(motion.div, {
        className: classNames("".concat(prefixCls, "-title"), hashId, (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-title-collapse"), collapse), _define_property(_obj, "".concat(prefixCls, "-title-compact"), compact), _obj))
    }, /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(prefixCls, "-title-content"), hashId)
    }, /*#__PURE__*/ React.createElement(Sparkles, {
        "data-testid": "magic-icon",
        style: {
            width: 15,
            height: 15,
            color: '#0CE0AD'
        }
    }), /*#__PURE__*/ React.createElement("span", {
        className: classNames("".concat(prefixCls, "-title-progress"), hashId),
        style: {
            fontSize: '1em'
        }
    }, endStatusDisplay)), /*#__PURE__*/ React.createElement("span", {
        className: classNames("".concat(prefixCls, "-title-extra"), hashId)
    }, props.titleExtraRender ? props.titleExtraRender(extra) : extra));
    if (props.titleRender) {
        return props.titleRender(dom);
    }
    return dom;
});
// 文档预览抽屉组件 - 独立 memo
var DocumentDrawer = /*#__PURE__*/ React.memo(function(param) {
    var docMeta = param.docMeta, onClose = param.onClose, locale = param.locale;
    return /*#__PURE__*/ React.createElement(Drawer, {
        title: (locale === null || locale === void 0 ? void 0 : locale.preview) + ' ' + (docMeta === null || docMeta === void 0 ? void 0 : docMeta.doc_name),
        open: !!docMeta,
        onClose: onClose,
        width: '40vw'
    }, /*#__PURE__*/ React.createElement(Descriptions, {
        column: 1,
        items: [
            {
                label: (locale === null || locale === void 0 ? void 0 : locale['common.name']) || '名称',
                span: 1,
                children: (docMeta === null || docMeta === void 0 ? void 0 : docMeta.doc_name) || (docMeta === null || docMeta === void 0 ? void 0 : docMeta.answer)
            },
            {
                label: (locale === null || locale === void 0 ? void 0 : locale['common.updateTime']) || '更新时间',
                span: 1,
                children: dayjs(docMeta === null || docMeta === void 0 ? void 0 : docMeta.upload_time).format('YYYY-MM-DD HH:mm:ss')
            },
            {
                label: (locale === null || locale === void 0 ? void 0 : locale['common.type']) || '类型',
                span: 1,
                children: docMeta === null || docMeta === void 0 ? void 0 : docMeta.type
            },
            (docMeta === null || docMeta === void 0 ? void 0 : docMeta.origin_text) ? {
                label: (locale === null || locale === void 0 ? void 0 : locale['common.content']) || '内容',
                span: 1,
                children: docMeta === null || docMeta === void 0 ? void 0 : docMeta.origin_text
            } : null
        ].filter(Boolean)
    }));
});
// 思维链列表内容组件 - 独立 memo
var ThoughtChainContent = /*#__PURE__*/ React.memo(function(_0) {
    var prefixCls = _0.prefixCls, hashId = _0.hashId, collapse = _0.collapse, compact = _0.compact, thoughtChainList = _0.thoughtChainList, bubble = _0.bubble, loading = _0.loading, markdownRenderProps = _0.markdownRenderProps, onDocMetaClick = _0.onDocMetaClick, instanceId = _0.instanceId, props = _object_without_properties(_0, [
        "prefixCls",
        "hashId",
        "collapse",
        "compact",
        "thoughtChainList",
        "bubble",
        "loading",
        "markdownRenderProps",
        "onDocMetaClick",
        "instanceId"
    ]);
    var containerRef = useAutoScroll({
        SCROLL_TOLERANCE: 30
    }).containerRef;
    var processedItems = useMemo(function() {
        if (collapse) return [];
        return thoughtChainList.map(function(item, index) {
            var _item_output, _item_output1, _item_output2, _item_output3, _item_output4;
            var info = item.info;
            var icon = /*#__PURE__*/ React.createElement(Loader, null);
            var isFinished = false;
            if ((item.output || (bubble === null || bubble === void 0 ? void 0 : bubble.isFinished)) && ((_item_output = item.output) === null || _item_output === void 0 ? void 0 : _item_output.type) !== 'TOKEN' && ((_item_output1 = item.output) === null || _item_output1 === void 0 ? void 0 : _item_output1.type) !== 'RUNNING') {
                isFinished = true;
                icon = /*#__PURE__*/ React.createElement(CircleCheckBig, null);
            }
            if ((_item_output2 = item.output) === null || _item_output2 === void 0 ? void 0 : _item_output2.errorMsg) {
                icon = /*#__PURE__*/ React.createElement(CloseCircleFilled, {
                    style: {
                        color: 'red'
                    }
                });
            }
            return _object_spread_props(_object_spread({
                key: index.toString()
            }, item), {
                info: info,
                isFinished: isFinished,
                status: !item.output || ((_item_output3 = item.output) === null || _item_output3 === void 0 ? void 0 : _item_output3.type) === 'RUNNING' || ((_item_output4 = item.output) === null || _item_output4 === void 0 ? void 0 : _item_output4.type) === 'TOKEN' ? 'loading' : 'success',
                icon: icon
            });
        });
    }, [
        thoughtChainList,
        bubble === null || bubble === void 0 ? void 0 : bubble.isFinished,
        collapse
    ]);
    var _obj;
    return /*#__PURE__*/ React.createElement(motion.div, {
        className: classNames("".concat(prefixCls, "-content"), (_obj = {}, _define_property(_obj, "".concat(prefixCls, "-content-collapse"), collapse), _define_property(_obj, "".concat(prefixCls, "-content-compact"), compact), _obj), hashId),
        ref: containerRef
    }, /*#__PURE__*/ React.createElement(motion.div, {
        role: "list",
        className: classNames("".concat(prefixCls, "-content-list"), hashId),
        variants: {
            hidden: {
                opacity: 0,
                transition: {
                    when: 'afterChildren'
                }
            },
            visible: {
                opacity: 1,
                transition: {
                    staggerChildren: 0.3,
                    when: 'beforeChildren'
                }
            }
        },
        whileInView: "visible",
        initial: "hidden",
        animate: "visible"
    }, processedItems.map(function(item, index) {
        var _item_info;
        var info = (_item_info = item.info) === null || _item_info === void 0 ? void 0 : _item_info.split(/(\$\{\w+\})/);
        if (!info) return null;
        return /*#__PURE__*/ React.createElement(ErrorBoundary, {
            fallback: /*#__PURE__*/ React.createElement(Typography.Paragraph, {
                code: true
            }, /*#__PURE__*/ React.createElement("pre", null, /*#__PURE__*/ React.createElement("code", null, JSON.stringify(thoughtChainList.at(index) || {
                message: 'error'
            }, null, 2)))),
            key: "".concat(instanceId, "-").concat(item.runId || 'no-runid', "-").concat(index)
        }, /*#__PURE__*/ React.createElement(ThoughtChainListItem, {
            index: index,
            markdownRenderProps: merge(markdownRenderProps, {
                codeProps: {
                    showLineNumbers: false,
                    showGutter: false,
                    fontSize: 12
                }
            }),
            bubble: bubble,
            thoughtChainListItem: item,
            hashId: hashId,
            isFinished: item.isFinished || !loading && !!(bubble === null || bubble === void 0 ? void 0 : bubble.endTime),
            setDocMeta: onDocMetaClick,
            prefixCls: prefixCls,
            titleRender: props.titleRender,
            titleExtraRender: props.titleExtraRender,
            contentRender: props.contentRender
        }));
    })));
});
/**
 * ThoughtChainList 组件 - 思维链列表组件
 *
 * 该组件用于显示AI的思维链过程，包括思考步骤、工具调用、任务执行等。
 * 提供完整的思维链可视化功能，支持折叠/展开、状态显示、文档元数据等。
 *
 * @component
 * @description 思维链列表组件，显示AI思维过程
 * @param {ThoughtChainListProps} props - 组件属性
 * @param {WhiteBoxProcessInterface[]} props.thoughtChainList - 思维链列表数据
 * @param {boolean} [props.loading] - 是否显示加载状态
 * @param {BubbleProps} [props.bubble] - 气泡数据
 * @param {React.CSSProperties} [props.style] - 自定义样式
 * @param {boolean} [props.compact] - 是否使用紧凑模式
 * @param {MarkdownRenderConfig} [props.markdownRenderProps] - Markdown渲染配置
 * @param {boolean} [props.finishAutoCollapse=true] - 完成后是否自动折叠
 * @param {(meta: DocMeta | null) => void} [props.onDocMetaClick] - 文档元数据点击回调
 * @param {string} [props.className] - 自定义CSS类名
 * @param {Function} [props.titleRender] - 标题渲染函数
 * @param {Function} [props.extraRender] - 额外内容渲染函数
 *
 * @example
 * ```tsx
 * <ThoughtChainList
 *   thoughtChainList={chainData}
 *   bubble={currentBubble}
 *   loading={isLoading}
 *   style={{ marginBottom: 16 }}
 *   finishAutoCollapse={true}
 *   onDocMetaClick={(meta) => console.log('文档元数据:', meta)}
 * />
 * ```
 *
 * @returns {React.ReactElement} 渲染的思维链列表组件
 *
 * @remarks
 * - 显示AI思维链过程
 * - 支持思维链折叠/展开
 * - 提供状态显示（思考中、完成、中止等）
 * - 支持文档元数据显示
 * - 提供时间统计
 * - 支持自定义渲染
 * - 提供动画效果
 * - 支持国际化
 */ export var ThoughtChainList = /*#__PURE__*/ React.memo(function(props) {
    var _thoughtChainList_at, _thoughtChainList_at1;
    var locale = useContext(I18nContext).locale;
    var thoughtChainList = props.thoughtChainList, loading = props.loading, _props_bubble = props.//@ts-ignore
    bubble, bubble = _props_bubble === void 0 ? props.chatItem : _props_bubble, customStyle = props.style, compact = props.compact, markdownRenderProps = props.markdownRenderProps, _props_finishAutoCollapse = props.finishAutoCollapse, finishAutoCollapse = _props_finishAutoCollapse === void 0 ? true : _props_finishAutoCollapse, onDocMetaClick = props.onDocMetaClick;
    var context = useContext(ConfigProvider.ConfigContext);
    var _React_useState = _sliced_to_array(React.useState(false), 2), collapse = _React_useState[0], setCollapse = _React_useState[1];
    var prefixCls = context === null || context === void 0 ? void 0 : context.getPrefixCls('thought-chain-list');
    var _useStyle = useStyle(prefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
    var _ref = customStyle || {}, ref = _object_destructuring_empty(_ref), restStyle = _extends({}, _ref);
    var _React_useState1 = _sliced_to_array(React.useState(null), 2), docMeta = _React_useState1[0], setDocMeta = _React_useState1[1];
    // 为组件实例生成唯一ID，避免多个实例间的key冲突
    var instanceId = 'ThoughtChainList';
    useEffect(function() {
        if ((bubble === null || bubble === void 0 ? void 0 : bubble.isFinished) && finishAutoCollapse !== false) {
            setCollapse(true);
        }
    }, [
        bubble === null || bubble === void 0 ? void 0 : bubble.isFinished,
        finishAutoCollapse
    ]);
    // memo 化的回调函数
    var handleCollapseToggle = React.useCallback(function() {
        setCollapse(!collapse);
    }, [
        collapse
    ]);
    var handleDocMetaClose = React.useCallback(function() {
        setDocMeta(null);
        onDocMetaClick === null || onDocMetaClick === void 0 ? void 0 : onDocMetaClick(null);
    }, [
        onDocMetaClick
    ]);
    var handleDocMetaClick = React.useCallback(function(meta) {
        setDocMeta(meta);
        onDocMetaClick === null || onDocMetaClick === void 0 ? void 0 : onDocMetaClick(meta);
    }, [
        onDocMetaClick
    ]);
    var endStatusDisplay = useMemo(function() {
        var _thoughtChainList_at, _thoughtChainList_at1, _thoughtChainList_at2, _thoughtChainList_at_meta, _thoughtChainList_at3;
        var time = (((bubble === null || bubble === void 0 ? void 0 : bubble.endTime) || 0) - ((bubble === null || bubble === void 0 ? void 0 : bubble.createAt) || 0)) / 1000;
        if (!loading && (bubble === null || bubble === void 0 ? void 0 : bubble.isAborted)) {
            if (time > 0) {
                return "".concat(locale === null || locale === void 0 ? void 0 : locale.taskAborted, ", ").concat(locale === null || locale === void 0 ? void 0 : locale.totalTimeUsed, " ").concat(time.toFixed(2), "s");
            }
            return locale === null || locale === void 0 ? void 0 : locale.taskAborted;
        }
        if (!loading && (bubble === null || bubble === void 0 ? void 0 : bubble.isFinished)) {
            if (time > 0) {
                if (bubble === null || bubble === void 0 ? void 0 : bubble.isFinished) {
                    return "".concat(locale === null || locale === void 0 ? void 0 : locale.taskComplete, ", ").concat(locale === null || locale === void 0 ? void 0 : locale.totalTimeUsed, " ").concat(time.toFixed(2), "s");
                }
                return /*#__PURE__*/ React.createElement(FlipText, {
                    word: "".concat(locale === null || locale === void 0 ? void 0 : locale.taskComplete, ", ").concat(locale === null || locale === void 0 ? void 0 : locale.totalTimeUsed, " ").concat(time.toFixed(2), "s")
                });
            }
            return /*#__PURE__*/ React.createElement(FlipText, {
                word: locale === null || locale === void 0 ? void 0 : locale.taskComplete
            });
        }
        // 正在运行中时，无论是否收起都显示运行状态
        return /*#__PURE__*/ React.createElement("div", null, thoughtChainList.at(-1) && collapse ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(TitleInfo, {
            title: (_thoughtChainList_at = thoughtChainList.at(-1)) === null || _thoughtChainList_at === void 0 ? void 0 : _thoughtChainList_at.info,
            costMillis: (_thoughtChainList_at1 = thoughtChainList.at(-1)) === null || _thoughtChainList_at1 === void 0 ? void 0 : _thoughtChainList_at1.costMillis,
            category: ((_thoughtChainList_at2 = thoughtChainList.at(-1)) === null || _thoughtChainList_at2 === void 0 ? void 0 : _thoughtChainList_at2.category) || '',
            prefixCls: prefixCls,
            hashId: hashId,
            isFinished: false,
            collapse: true,
            meta: ((_thoughtChainList_at3 = thoughtChainList.at(-1)) === null || _thoughtChainList_at3 === void 0 ? void 0 : (_thoughtChainList_at_meta = _thoughtChainList_at3.meta) === null || _thoughtChainList_at_meta === void 0 ? void 0 : _thoughtChainList_at_meta.data) || {}
        }), loading && /*#__PURE__*/ React.createElement(DotLoading, null)) : /*#__PURE__*/ React.createElement("div", null, locale === null || locale === void 0 ? void 0 : locale.thinking, /*#__PURE__*/ React.createElement(DotLoading, null)));
    }, [
        loading,
        collapse,
        thoughtChainList === null || thoughtChainList === void 0 ? void 0 : (_thoughtChainList_at1 = thoughtChainList.at) === null || _thoughtChainList_at1 === void 0 ? void 0 : (_thoughtChainList_at = _thoughtChainList_at1.call(thoughtChainList, -1)) === null || _thoughtChainList_at === void 0 ? void 0 : _thoughtChainList_at.category,
        bubble === null || bubble === void 0 ? void 0 : bubble.isFinished,
        bubble === null || bubble === void 0 ? void 0 : bubble.isAborted,
        bubble === null || bubble === void 0 ? void 0 : bubble.endTime,
        bubble === null || bubble === void 0 ? void 0 : bubble.createAt,
        locale
    ]);
    return wrapSSR(/*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(DocumentDrawer, {
        docMeta: docMeta,
        onClose: handleDocMetaClose,
        locale: locale
    }), /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(prefixCls), hashId),
        style: restStyle
    }, /*#__PURE__*/ React.createElement(motion.div, {
        transition: {
            duration: 0.3
        },
        className: classNames("".concat(prefixCls, "-container"), hashId, _define_property({}, "".concat(prefixCls, "-container-loading"), !(bubble === null || bubble === void 0 ? void 0 : bubble.isFinished)))
    }, /*#__PURE__*/ React.createElement(ThoughtChainTitle, {
        prefixCls: prefixCls,
        hashId: hashId,
        collapse: collapse,
        compact: compact,
        endStatusDisplay: endStatusDisplay,
        onCollapseToggle: handleCollapseToggle,
        locale: locale,
        titleRender: props.titleRender ? function(defaultDom) {
            var _props_titleRender;
            return (_props_titleRender = props.titleRender) === null || _props_titleRender === void 0 ? void 0 : _props_titleRender.call(props, props, defaultDom);
        } : undefined,
        titleExtraRender: props.titleExtraRender ? function(defaultDom) {
            var _props_titleExtraRender;
            return (_props_titleExtraRender = props.titleExtraRender) === null || _props_titleExtraRender === void 0 ? void 0 : _props_titleExtraRender.call(props, props, defaultDom);
        } : undefined
    }), /*#__PURE__*/ React.createElement("div", {
        style: {
            backgroundColor: '#FFF',
            position: 'relative',
            borderRadius: '6px 12px 12px 12px',
            zIndex: 9
        }
    }, /*#__PURE__*/ React.createElement(ThoughtChainContent, _object_spread({
        prefixCls: prefixCls,
        hashId: hashId,
        collapse: collapse,
        compact: compact,
        thoughtChainList: thoughtChainList,
        bubble: bubble,
        loading: loading,
        markdownRenderProps: markdownRenderProps,
        onDocMetaClick: handleDocMetaClick,
        instanceId: instanceId
    }, props.thoughtChainItemRender)))))));
});
