@deep-eye/core 1.2.8 → 1.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -128
- package/dist/components/chat/components/ChatReasoning.vue.d.ts.map +1 -1
- package/dist/components/chat/mdoc/tableStreaming.d.ts +1 -3
- package/dist/components/chat/mdoc/tableStreaming.d.ts.map +1 -1
- package/dist/index-BufnUXnQ.js +1 -1
- package/dist/index-CnxZBHPD.js +1 -1
- package/dist/index-DF8KmkKX.js +1 -1
- package/dist/index-cW_BnxHR.js +1 -1
- package/dist/index-iCVvFIlX.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +24 -16
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,227 +1,139 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@deep-eye/core` 的用户可见变更(语义化版本)。
|
|
4
4
|
|
|
5
|
-
## [1.2.
|
|
6
|
-
|
|
7
|
-
### Fixed
|
|
8
|
-
|
|
9
|
-
- 表格行去掉多余边框声明,避免与单元格单向边线叠加。
|
|
5
|
+
## [1.2.10] - 2026-08-03
|
|
10
6
|
|
|
11
7
|
### Changed
|
|
12
8
|
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
## [1.2.7] - 2026-08-03
|
|
9
|
+
- 思考过程默认展开显示。
|
|
16
10
|
|
|
17
11
|
### Fixed
|
|
18
12
|
|
|
19
|
-
-
|
|
20
|
-
- 助手消息表格:圆角卡片外框、单方向内部分隔线(消除表头双线)、流式生成中的骨架屏;宿主将 `table` 设为 `display: block` 时不再出现右侧大块空白。
|
|
13
|
+
- 移除表格流式输出时的骨架占位动画,流式渲染直接展示已有表格内容。
|
|
21
14
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- Markdown 解析进一步委托 md4x:数学公式走原生 `<x-equation>`,流式场景开启 `heal`;KaTeX 仅负责公式排版。
|
|
25
|
-
- 表格包壳并入 `renderTextToSegments` 管线;prose/表格样式抽离为 `mdoc/prose.css`。
|
|
26
|
-
|
|
27
|
-
## [1.2.6] - 2026-07-31
|
|
15
|
+
## [1.2.9] - 2026-08-03
|
|
28
16
|
|
|
29
17
|
### Fixed
|
|
30
18
|
|
|
31
|
-
-
|
|
19
|
+
- 修复打包产物对 Vue 3 ESM 的 default import 不兼容(消费端 Vite 报错)。
|
|
32
20
|
|
|
33
|
-
## [1.2.
|
|
21
|
+
## [1.2.8] - 2026-08-03
|
|
34
22
|
|
|
35
23
|
### Fixed
|
|
36
24
|
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
## [1.2.4] - 2026-07-31
|
|
25
|
+
- Markdown / 表格在 CSS reset 下样式丢失、表头双线、流式骨架与 `display: block` 撑宽问题。
|
|
40
26
|
|
|
41
27
|
### Changed
|
|
42
28
|
|
|
43
|
-
-
|
|
44
|
-
> 注意:npm 上的 `1.2.4` 未包含重建后的 `dist`,请升级到 `1.2.5`。
|
|
29
|
+
- Markdown 解析进一步委托 md4x;prose/表格样式抽离为独立 CSS。
|
|
45
30
|
|
|
46
|
-
## [1.2.
|
|
31
|
+
## [1.2.6] - 2026-07-31
|
|
47
32
|
|
|
48
33
|
### Fixed
|
|
49
34
|
|
|
50
|
-
-
|
|
35
|
+
- 剥离助手正文中的 provider `<summary>` 标记,避免后续 Markdown 解析失败。
|
|
51
36
|
|
|
52
|
-
## [1.2.
|
|
37
|
+
## [1.2.5] - 2026-07-31
|
|
53
38
|
|
|
54
|
-
###
|
|
39
|
+
### Changed
|
|
55
40
|
|
|
56
|
-
-
|
|
41
|
+
- 首包前「思考中」占位复用 `ChatReasoning`(统一 Brain 图标、计时与 shimmer)。含 `1.2.4` 未重建 dist 的补发。
|
|
57
42
|
|
|
58
|
-
## [1.2.
|
|
43
|
+
## [1.2.3] - 2026-07-31
|
|
59
44
|
|
|
60
45
|
### Fixed
|
|
61
46
|
|
|
62
|
-
-
|
|
63
|
-
|
|
47
|
+
- 忽略网关 `event:session` / `event:end` 控制帧,避免 SSE 开头解析失败。
|
|
48
|
+
- 兼容 Responses SSE 稀疏 `output_item.added`(`1.2.1`/`1.2.2` 同批)。
|
|
64
49
|
|
|
65
50
|
## [1.2.0] - 2026-07-31
|
|
66
51
|
|
|
67
52
|
### Added
|
|
68
53
|
|
|
69
|
-
- `ChatBot` 新增 `enableQueue
|
|
54
|
+
- `ChatBot` 新增 `enableQueue`(默认关闭):显式开启后才挂载发送队列。
|
|
70
55
|
|
|
71
56
|
### Changed
|
|
72
57
|
|
|
73
|
-
-
|
|
74
|
-
- 未开启 `enableQueue` 时,流式期间的发送会被忽略(不再默认入队)。
|
|
58
|
+
- 未开启队列时,流式期间的发送会被忽略。
|
|
75
59
|
|
|
76
60
|
## [1.1.0] - 2026-07-31
|
|
77
61
|
|
|
78
62
|
### Added
|
|
79
63
|
|
|
80
|
-
- assistant
|
|
81
|
-
- 新增公开 primitive `ChatFollowUps`。
|
|
64
|
+
- assistant `follow_ups` 推荐追问;公开 `ChatFollowUps`。
|
|
82
65
|
|
|
83
66
|
## [1.0.0] - 2026-07-31
|
|
84
67
|
|
|
85
68
|
### Added
|
|
86
69
|
|
|
87
|
-
-
|
|
88
|
-
- 官方文档全面重写:安装引入、Props/事件/插槽、使用示例与全局 FAQ,覆盖 `ChatBot`、`ChatMessage`、`ChatSender`、`D3MindMap` 完整使用链路。
|
|
89
|
-
- 文档示例补充可预览样例 PDF(`/files/q3.pdf`),并按 VitePress `base` 路径解析。
|
|
70
|
+
- `ChatSidebarResizeHandle`;文档全面重写(ChatBot / ChatMessage / ChatSender / D3MindMap)。
|
|
90
71
|
|
|
91
72
|
### Changed
|
|
92
73
|
|
|
93
|
-
-
|
|
94
|
-
- 工具调用图标轨道与思维链(`ChatReasoning`)脑图标对齐;同组工具名列宽同步,参数摘要水平对齐。
|
|
95
|
-
- 文档与对外表述统一为企业 Agent Responses 协议,不再使用「火山方舟」措辞。
|
|
74
|
+
- 侧栏拖拽相对 `ChatBot` 根节点计算;对外统一为企业 Agent Responses 协议表述。
|
|
96
75
|
|
|
97
76
|
### Fixed
|
|
98
77
|
|
|
99
|
-
-
|
|
100
|
-
- 修复文档站点 PDF 预览因缺少 base 前缀与素材文件导致的 Vite 提示页问题。
|
|
78
|
+
- 侧栏拖拽手柄被裁切;文档 PDF 预览路径。
|
|
101
79
|
|
|
102
80
|
## [0.11.0] - 2026-07-29
|
|
103
81
|
|
|
104
82
|
### Added
|
|
105
83
|
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
- 新增受控 `toolStates`、强类型 `tool-action`、工具审批、孤立工具结果警告与 renderer 注册 API。
|
|
111
|
-
- 新增流式消息队列,支持编辑、删除、拖拽/按钮排序以及终态自动出队。
|
|
112
|
-
- `ChatBot` 新增 `consume(Response)` 与 `abort()`,直接消费火山方舟 Responses API 原始 HTTP SSE,并公开 18 种官方事件与完整 `ResponseObject` 类型。
|
|
113
|
-
- 标准 messages 支持 system、user、assistant、tool 四种角色,以及 text、image、video、audio、file 多模态输入。
|
|
114
|
-
- `ConversationStreamStatus` 新增 `incomplete`;失败和异常 EOF 会保留已生成的部分 assistant 内容。
|
|
115
|
-
- 正文、思考区流式输出改用逐帧平滑追赶,避免逐 delta 硬跳;思考区、工具调用结果区展开/收起高度过渡动画化。
|
|
116
|
-
- 新增 `classifyChatError`,将失败归类为 `network`/`timeout`/`api`/`protocol`/`unknown`;`response-error` 事件随原始 `Error` 一并携带分类结果。
|
|
117
|
-
- 用户主动停止(`aborted` 且无 error)时内联展示"已停止生成"状态,与失败态区分。
|
|
118
|
-
- 多个并发工具调用改为扁平连接的时间线(去除嵌套的"执行了 A、B"分组折叠层,修复该分组标题因 `<button>` 默认居中样式导致与下方条目错位的问题),每条工具调用独立展开/折叠,完成态自动收起为单行摘要,视觉上更接近 Cursor/Codex 的工具调用列表。`running` 状态图标由易误读为"卡死转圈"的 spinner 改为随呼吸动画渐隐渐显的实心圆环。
|
|
119
|
-
- 修复工具调用时间线中图标+连接线轨道占用行内布局宽度、导致工具名称文字比同一条消息里的正文文字多缩进约 26px 的问题:轨道改为绝对定位悬挂在内容左侧的空白区域,工具名称与正文文字现在水平起始位置对齐。
|
|
120
|
-
- 修复工具调用展开详情后图标随连接线轨道整体高度垂直居中、与标题错位的问题:连接线改为固定顶部间距 + 弹性底部,图标始终与标题保持同一水平线,与折叠态一致。鼠标悬浮时仅 `tool-call-part__header`(标题行)显示背景色,不再覆盖到左侧图标与整行。
|
|
121
|
-
- 文档新增连续 5 张图片堆叠展示示例(`ChatImageStackDemo`),演示折叠封面、九宫格展开与灯箱浏览。
|
|
122
|
-
- `ChatSender` 新增 `quickActions`/`v-model:active-quick-action`,在 `+` 图标后可扩展一排快捷功能按钮,选中后收起为可移除的模式标签并联动占位符(豆包式交互);模式标签的关闭按钮点击区域由 18px 增大到 22px,图标同步放大,避免误触/难以点击。
|
|
84
|
+
- `ChatProvider`、七牛上传、附件/灯箱/文件预览(Vue Office、Vidstack、sandbox HTML)。
|
|
85
|
+
- `ChatReasoning`、`ChatToolGroup`、`ChatQueue`、预览相关 primitives;工具审批与 renderer 注册。
|
|
86
|
+
- `ChatBot.consume(Response)` / `abort()`,消费 Responses API SSE;多模态 messages 与错误分类。
|
|
87
|
+
- `ChatSender` `quickActions`;流式平滑追赶与工具时间线。
|
|
123
88
|
|
|
124
89
|
### Changed
|
|
125
90
|
|
|
126
|
-
- `
|
|
127
|
-
- `
|
|
128
|
-
- assistant 固定按思考、工具组、最终正文渲染;思考区尊重用户手动展开选择。
|
|
129
|
-
- 侧栏桌面默认宽度改为 42%,限制在 360px 至视口 72%,移动端使用全屏预览。
|
|
130
|
-
- 默认消息操作栏只保留复制,错误以 assistant 内联状态显示并提供重试事件。
|
|
131
|
-
- 一个 Responses 流统一聚合为一条 assistant 消息;正文、思考和 function call delta 立即显示,done 与终态 Response 权威校准结果。
|
|
132
|
-
- `useConversation` 简化为 `appendMessage`、`setMessages` 与 `reset`。
|
|
133
|
-
- Playground、README 与组件文档在原有富文本、工具、工件和表单示例上改用 Responses SSE。
|
|
134
|
-
|
|
135
|
-
### Fixed
|
|
136
|
-
|
|
137
|
-
- 兼容 `response.reasoning_summary_part.added` 中仅包含 `type: "summary_text"`、尚未包含 `text` 的官方事件序列。
|
|
138
|
-
- 连续图片堆叠(`MediaImageStack`)折叠态的背景层不再向容器外溢出,避免遮挡上方消息文字。
|
|
91
|
+
- `send` 改为单一 `ChatSendPayload`;`ChatSender` 改用 `v-model:draft` / `attachments`。
|
|
92
|
+
- 一个 Responses 流聚合为一条 assistant;`useConversation` 简化为 `appendMessage` / `setMessages` / `reset`。
|
|
139
93
|
|
|
140
94
|
### Removed
|
|
141
95
|
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
- 移除 `ChatSender` 的 `modelValue`、`showToolbar`、`attach` 描述和 `(content, files?)` 发送签名。
|
|
145
|
-
- 移除字符串 HTML 自定义菜单图标、blob 消息持久化与旧的独立 Sender 主题类型。
|
|
146
|
-
- 移除公开的 `AiConversation` 组件导出。
|
|
147
|
-
- 移除公开的 `useConversationStream`、completion/delta 类型、session/resume、event ID、last index 与 `[DONE]` 协议。
|
|
148
|
-
- 移除 assistant 正文中的私有 Turn、`<summary>`、`<think>` 与 `🛠️` 标记解析。
|
|
96
|
+
- 旧 Sender API、`AiConversation`、`useConversationStream` 及旧 completion/session 协议。
|
|
97
|
+
- 正文中私有 Turn / `<summary>` / `<think>` / `🛠️` 标记解析。
|
|
149
98
|
|
|
150
99
|
## [0.10.0] - 2026-07-28
|
|
151
100
|
|
|
152
101
|
### Added
|
|
153
102
|
|
|
154
|
-
- `ChatBot`
|
|
155
|
-
- `AiConversation` 新增消息外壳及列表前后扩展插槽,`ChatMessage` 新增只替换规范化正文的 `#content`。
|
|
156
|
-
- `ConversationMessage` 新增不透明业务扩展字段 `metadata`。
|
|
157
|
-
- `useConversationStream` 新增 `ConversationStreamEvent`、`onEvent`、`initialLastIndex` 和响应式 `lastIndex`。
|
|
103
|
+
- `ChatBot` `#sender` 等插槽扩展;消息 `metadata`。
|
|
158
104
|
|
|
159
105
|
### Changed
|
|
160
106
|
|
|
161
|
-
- SSE
|
|
162
|
-
- 原始 SSE 事件与完整 JSON chunk 会保留未知字段,数字 `lastEventId` 与逻辑 `lastIndex` 独立维护。
|
|
163
|
-
|
|
164
|
-
### Fixed
|
|
165
|
-
|
|
166
|
-
- 恢复 OpenAI 标准 tool-call delta 类型及按调用索引合并行为。
|
|
167
|
-
- `ChatSender` 在浏览器媒体 API 不可用时安全降级。
|
|
107
|
+
- SSE 兼容标准帧、heartbeat 与 session/end;未知字段保留。
|
|
168
108
|
|
|
169
109
|
## [0.9.1] - 2026-07-28
|
|
170
110
|
|
|
171
111
|
### Added
|
|
172
112
|
|
|
173
|
-
-
|
|
174
|
-
|
|
175
|
-
### Changed
|
|
176
|
-
|
|
177
|
-
- 工件侧边栏在桌面端与移动端使用更稳定的响应式布局,自定义 `sidebar` 插槽仍可完整替换默认预览。
|
|
178
|
-
|
|
179
|
-
### Fixed
|
|
180
|
-
|
|
181
|
-
- 工件预览关闭操作恢复为明确的关闭图标与“关闭侧边栏”可访问语义。
|
|
113
|
+
- 工件侧边栏 Preview/Code、复制、下载、展开/关闭。
|
|
182
114
|
|
|
183
115
|
## [0.7.0] - 2026-07-23
|
|
184
116
|
|
|
185
117
|
### Added
|
|
186
118
|
|
|
187
|
-
- `ChatSender`
|
|
188
|
-
- 图片文件以 120x120 缩略图卡片显示,非图片文件显示文件名、类型标签和大小信息。
|
|
189
|
-
- 文件卡片支持悬浮显示删除按钮,支持累加上传多个文件。
|
|
190
|
-
- 新增截图功能,使用浏览器原生 `getDisplayMedia` API 支持屏幕、窗口或标签页截图,截图后自动添加到附件列表。
|
|
191
|
-
- `ChatSender` 导出 `AttachmentMenuItem` 类型,支持自定义附件菜单项。
|
|
192
|
-
|
|
193
|
-
### Changed
|
|
194
|
-
|
|
195
|
-
- 附件菜单从直接触发文件选择改为弹出菜单模式,与主流 AI 产品交互一致。
|
|
196
|
-
- 文件预览采用卡片化设计,统一尺寸和样式,提升视觉一致性。
|
|
119
|
+
- `ChatSender` 多文件附件、截图与自定义附件菜单。
|
|
197
120
|
|
|
198
121
|
## [0.6.0] - 2026-07-22
|
|
199
122
|
|
|
200
123
|
### Added
|
|
201
124
|
|
|
202
|
-
-
|
|
203
|
-
- 已完成的助手消息默认显示复制操作。`AiConversation` 的 `#assistant-actionbar`、`ChatMessage` 的 `#actionbar` 和 `ChatActionbar` 默认插槽均可追加自定义操作。
|
|
204
|
-
- AI Conversation 文档新增基于标准 SSE 的可交互渲染预览,覆盖 Markdown、公式、图片组、视频、音频和 AskUserForm。
|
|
125
|
+
- 公开 `ChatMessage` / `ChatActionbar`;助手默认复制操作。
|
|
205
126
|
|
|
206
127
|
### Changed
|
|
207
128
|
|
|
208
|
-
-
|
|
209
|
-
- “返回最新消息”操作调整至会话右下角。
|
|
210
|
-
- 助手默认使用内置标识,并将标识尺寸调整为 26px。
|
|
129
|
+
- 图片组改为可展开堆叠。
|
|
211
130
|
|
|
212
131
|
### Fixed
|
|
213
132
|
|
|
214
|
-
-
|
|
215
|
-
- 混合流中的 `LLM Running`、`🛠️` 和 `<summary>` 运行标记不再进入正文或默认复制内容。
|
|
216
|
-
- 会话列表不再渲染结构化工具调用和工具结果。
|
|
133
|
+
- 流式首包加载态;运行标记不再进入正文/复制内容。
|
|
217
134
|
|
|
218
135
|
## [0.2.0]
|
|
219
136
|
|
|
220
|
-
###
|
|
137
|
+
### Added
|
|
221
138
|
|
|
222
|
-
-
|
|
223
|
-
- Add D3MindMap visualization component with theme support
|
|
224
|
-
- Add composables for layout and theme management
|
|
225
|
-
- Support for multiple themes (default, dark, colorful, minimal)
|
|
226
|
-
- Interactive features: zoom, pan, node collapse/expand
|
|
227
|
-
- Export functionality (PNG, SVG, JSON)
|
|
139
|
+
- 初始发布:`D3MindMap`(主题、缩放平移、折叠展开、PNG/SVG/JSON 导出)。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatReasoning.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/components/ChatReasoning.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChatReasoning.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/components/ChatReasoning.vue"],"names":[],"mappings":"AA0VA,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AA0O5D,QAAA,IAAI,QAAQ;;;CAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAQhD,QAAA,MAAM,UAAU,kSAEd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableStreaming.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/tableStreaming.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tableStreaming.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/mdoc/tableStreaming.ts"],"names":[],"mappings":"AASA,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkBnD"}
|
package/dist/index-BufnUXnQ.js
CHANGED
package/dist/index-CnxZBHPD.js
CHANGED
package/dist/index-DF8KmkKX.js
CHANGED
package/dist/index-cW_BnxHR.js
CHANGED
package/dist/index-iCVvFIlX.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import o from "vue";
|
|
1
|
+
import * as o from "vue";
|
|
2
2
|
var d = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3
3
|
function t(e) {
|
|
4
4
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
package/dist/index.cjs
CHANGED
|
@@ -507,9 +507,9 @@ l0,-`+(e+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
|
507
507
|
please report what input caused this bug`);return g=g.slice(1,-1),{type:"verb",mode:"text",body:g,star:i}}Vn.hasOwnProperty(e[0])&&!ae[this.mode][e[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+e[0]+'" used in math mode',A),e=Vn[e[0]]+e.slice(1));var o=Eh.exec(e);o&&(e=e.substring(0,o.index),e==="i"?e="ı":e==="j"&&(e="ȷ"));var s;if(ae[this.mode][e]){this.settings.strict&&this.mode==="math"&&Va.includes(e)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+e[0]+'" used in math mode',A);var n=ae[this.mode][e].group,I=Oe.range(A),C;if(hE.hasOwnProperty(n)){var r=n;C={type:"atom",mode:this.mode,family:r,loc:I,text:e}}else C={type:n,mode:this.mode,loc:I,text:e};s=C}else if(e.charCodeAt(0)>=128)this.settings.strict&&(ir(e.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+e[0]+'" used in math mode',A):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+e[0]+'"'+(" ("+e.charCodeAt(0)+")"),A)),s={type:"textord",mode:"text",loc:Oe.range(A),text:e};else return null;if(this.consume(),o)for(var B=0;B<o[0].length;B++){var c=o[0][B];if(!ua[c])throw new eA("Unknown accent ' "+c+"'",A);var l=ua[c][this.mode]||ua[c].text;if(!l)throw new eA("Accent "+c+" unsupported in "+this.mode+" mode",A);s={type:"accent",mode:this.mode,loc:Oe.range(A),label:l,isStretchy:!1,isShifty:!0,base:s}}return s}}Oo.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Ss=function(A,e){if(!(typeof A=="string"||A instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var g=new Oo(A,e);delete g.gullet.macros.current["\\df@tag"];var i=g.parse();if(delete g.gullet.macros.current["\\current@color"],delete g.gullet.macros.current["\\color"],g.gullet.macros.get("\\df@tag")){if(!e.displayMode)throw new eA("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:g.subparse([new At("\\df@tag")])}]}return i},Pr=function(A,e,g){e.textContent="";var i=Gs(A,g).toNode();e.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Pr=function(){throw new eA("KaTeX doesn't work in quirks mode.")});var wh=function(A,e){var g=Gs(A,e).toMarkup();return g},ph=function(A,e){var g=new us(e);return Ss(A,g)},$r=function(A,e,g){if(g.throwOnError||!(A instanceof eA))throw A;var i=z(["katex-error"],[new et(e)]);return i.setAttribute("title",A.toString()),i.setAttribute("style","color:"+g.errorColor),i},Gs=function(A,e){var g=new us(e);try{var i=Ss(A,g);return RE(i,A,g)}catch(o){return $r(o,A,g)}},Dh=function(A,e){var g=new us(e);try{var i=Ss(A,g);return YE(i,A,g)}catch(o){return $r(o,A,g)}},kh="0.16.45",yh={Span:Kg,Anchor:Uo,SymbolNode:et,SvgNode:Yt,PathNode:zt,LineNode:Wa},Fh={version:kh,render:Pr,renderToString:wh,ParseError:eA,SETTINGS_SCHEMA:qa,__parse:ph,__renderToDomTree:Gs,__renderToHTMLTree:Dh,__setFontMetrics:cE,__defineSymbol:Q,__defineFunction:QA,__defineMacro:f,__domTree:yh};const Nh=/<summary\b[^>]*>[\s\S]*?<\/summary\s*>/gi,bh=/<summary\b/gi;function A0(t){return t?Sh(vh(t)):""}function vh(t){const A=t.replace(Nh,""),e=[...A.matchAll(bh)],g=e[e.length-1];return(g==null?void 0:g.index)!==void 0?A.slice(0,g.index):A}function Sh(t){return t.trim()?t.replace(/^(?:[\t ]*\r?\n)+/,"").replace(/(?:\r?\n[\t ]*)+$/,"").replace(/(?:\r?\n[\t ]*){3,}/g,`
|
|
508
508
|
|
|
509
509
|
`):""}/*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */const{entries:e0,setPrototypeOf:_n,isFrozen:Gh,getPrototypeOf:Rh,getOwnPropertyDescriptor:Yh}=Object;let{freeze:qe,seal:st,create:yg}=Object,{apply:ts,construct:gs}=typeof Reflect<"u"&&Reflect;qe||(qe=function(A){return A});st||(st=function(A){return A});ts||(ts=function(A,e){for(var g=arguments.length,i=new Array(g>2?g-2:0),o=2;o<g;o++)i[o-2]=arguments[o];return A.apply(e,i)});gs||(gs=function(A){for(var e=arguments.length,g=new Array(e>1?e-1:0),i=1;i<e;i++)g[i-1]=arguments[i];return new A(...g)});const Pg=ke(Array.prototype.forEach),Jh=ke(Array.prototype.lastIndexOf),On=ke(Array.prototype.pop),$g=ke(Array.prototype.push),Uh=ke(Array.prototype.splice),Le=Array.isArray,Ci=ke(String.prototype.toLowerCase),da=ke(String.prototype.toString),Xn=ke(String.prototype.match),wg=ke(String.prototype.replace),zn=ke(String.prototype.indexOf),Mh=ke(String.prototype.trim),xh=ke(Number.prototype.toString),Lh=ke(Boolean.prototype.toString),jn=typeof BigInt>"u"?null:ke(BigInt.prototype.toString),Pn=typeof Symbol>"u"?null:ke(Symbol.prototype.toString),ce=ke(Object.prototype.hasOwnProperty),Ai=ke(Object.prototype.toString),Je=ke(RegExp.prototype.test),Vi=Hh(TypeError);function ke(t){return function(A){A instanceof RegExp&&(A.lastIndex=0);for(var e=arguments.length,g=new Array(e>1?e-1:0),i=1;i<e;i++)g[i-1]=arguments[i];return ts(t,A,g)}}function Hh(t){return function(){for(var A=arguments.length,e=new Array(A),g=0;g<A;g++)e[g]=arguments[g];return gs(t,e)}}function RA(t,A){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ci;if(_n&&_n(t,null),!Le(A))return t;let g=A.length;for(;g--;){let i=A[g];if(typeof i=="string"){const o=e(i);o!==i&&(Gh(A)||(A[g]=o),i=o)}t[i]=!0}return t}function Kh(t){for(let A=0;A<t.length;A++)ce(t,A)||(t[A]=null);return t}function _e(t){const A=yg(null);for(const[e,g]of e0(t))ce(t,e)&&(Le(g)?A[e]=Kh(g):g&&typeof g=="object"&&g.constructor===Object?A[e]=_e(g):A[e]=g);return A}function qh(t){switch(typeof t){case"string":return t;case"number":return xh(t);case"boolean":return Lh(t);case"bigint":return jn?jn(t):"0";case"symbol":return Pn?Pn(t):"Symbol()";case"undefined":return Ai(t);case"function":case"object":{if(t===null)return Ai(t);const A=t,e=Fg(A,"toString");if(typeof e=="function"){const g=e(A);return typeof g=="string"?g:Ai(g)}return Ai(t)}default:return Ai(t)}}function Fg(t,A){for(;t!==null;){const g=Yh(t,A);if(g){if(g.get)return ke(g.get);if(typeof g.value=="function")return ke(g.value)}t=Rh(t)}function e(){return null}return e}function Th(t){try{return Je(t,""),!0}catch{return!1}}const $n=qe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ma=qe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fa=qe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Zh=qe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),wa=qe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Wh=qe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),AI=qe(["#text"]),eI=qe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),pa=qe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),tI=qe(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),_i=qe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Vh=st(/\{\{[\w\W]*|[\w\W]*\}\}/gm),_h=st(/<%[\w\W]*|[\w\W]*%>/gm),Oh=st(/\$\{[\w\W]*/gm),Xh=st(/^data-[\-\w.\u00B7-\uFFFF]+$/),zh=st(/^aria-[\-\w]+$/),t0=st(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jh=st(/^(?:\w+script|data):/i),Ph=st(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),g0=st(/^html$/i),$h=st(/^[a-z][.\w]*(-[.\w]+)+$/i);var gI=Object.freeze({__proto__:null,ARIA_ATTR:zh,ATTR_WHITESPACE:Ph,CUSTOM_ELEMENT:$h,DATA_ATTR:Xh,DOCTYPE_NAME:g0,ERB_EXPR:_h,IS_ALLOWED_URI:t0,IS_SCRIPT_OR_DATA:jh,MUSTACHE_EXPR:Vh,TMPLIT_EXPR:Oh});const ei={element:1,text:3,progressingInstruction:7,comment:8,document:9},Au=function(){return typeof window>"u"?null:window},eu=function(A,e){if(typeof A!="object"||typeof A.createPolicy!="function")return null;let g=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(g=e.getAttribute(i));const o="dompurify"+(g?"#"+g:"");try{return A.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},iI=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function i0(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Au();const A=W=>i0(W);if(A.version="3.4.2",A.removed=[],!t||!t.document||t.document.nodeType!==ei.document||!t.Element)return A.isSupported=!1,A;let{document:e}=t;const g=e,i=g.currentScript,{DocumentFragment:o,HTMLTemplateElement:s,Node:n,Element:I,NodeFilter:C,NamedNodeMap:r=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:B,DOMParser:c,trustedTypes:l}=t,h=I.prototype,d=Fg(h,"cloneNode"),u=Fg(h,"remove"),p=Fg(h,"nextSibling"),b=Fg(h,"childNodes"),N=Fg(h,"parentNode");if(typeof s=="function"){const W=e.createElement("template");W.content&&W.content.ownerDocument&&(e=W.content.ownerDocument)}let y,v="";const{implementation:U,createNodeIterator:G,createDocumentFragment:Y,getElementsByTagName:K}=e,{importNode:sA}=g;let _=iI();A.isSupported=typeof e0=="function"&&typeof N=="function"&&U&&U.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:AA,ERB_EXPR:BA,TMPLIT_EXPR:uA,DATA_ATTR:L,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:IA,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:Z}=gI;let{IS_ALLOWED_URI:iA}=gI,cA=null;const vA=RA({},[...$n,...ma,...fa,...wa,...AI]);let fA=null;const rA=RA({},[...eI,...pa,...tI,..._i]);let gA=Object.seal(yg(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),lA=null,LA=null;const UA=Object.seal(yg(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let MA=!0,te=!0,Ee=!1,dA=!0,ne=!1,Qe=!0,PA=!1,T=!1,hA=!1,nA=!1,x=!1,oA=!1,WA=!0,de=!1;const Me="user-content-";let me=!0,H=!1,j={},X=null;const ZA=RA({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let OA=null;const Fe=RA({},["audio","video","img","source","image","track"]);let he=null;const hg=RA({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",xt="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml";let Qt=Ze,_g=!1,Og=null;const $o=RA({},[pt,xt,Ze],da);let Xg=RA({},["mi","mo","mn","ms","mtext"]),zg=RA({},["annotation-xml"]);const Ri=RA({},["title","style","font","a","script"]);let tg=null;const gg=["application/xhtml+xml","text/html"],An="text/html";let fe=null,ig=null;const en=e.createElement("form"),Aa=function(D){return D instanceof RegExp||D instanceof Function},Yi=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ig&&ig===D)return;(!D||typeof D!="object")&&(D={}),D=_e(D),tg=gg.indexOf(D.PARSER_MEDIA_TYPE)===-1?An:D.PARSER_MEDIA_TYPE,fe=tg==="application/xhtml+xml"?da:Ci,cA=ce(D,"ALLOWED_TAGS")&&Le(D.ALLOWED_TAGS)?RA({},D.ALLOWED_TAGS,fe):vA,fA=ce(D,"ALLOWED_ATTR")&&Le(D.ALLOWED_ATTR)?RA({},D.ALLOWED_ATTR,fe):rA,Og=ce(D,"ALLOWED_NAMESPACES")&&Le(D.ALLOWED_NAMESPACES)?RA({},D.ALLOWED_NAMESPACES,da):$o,he=ce(D,"ADD_URI_SAFE_ATTR")&&Le(D.ADD_URI_SAFE_ATTR)?RA(_e(hg),D.ADD_URI_SAFE_ATTR,fe):hg,OA=ce(D,"ADD_DATA_URI_TAGS")&&Le(D.ADD_DATA_URI_TAGS)?RA(_e(Fe),D.ADD_DATA_URI_TAGS,fe):Fe,X=ce(D,"FORBID_CONTENTS")&&Le(D.FORBID_CONTENTS)?RA({},D.FORBID_CONTENTS,fe):ZA,lA=ce(D,"FORBID_TAGS")&&Le(D.FORBID_TAGS)?RA({},D.FORBID_TAGS,fe):_e({}),LA=ce(D,"FORBID_ATTR")&&Le(D.FORBID_ATTR)?RA({},D.FORBID_ATTR,fe):_e({}),j=ce(D,"USE_PROFILES")?D.USE_PROFILES&&typeof D.USE_PROFILES=="object"?_e(D.USE_PROFILES):D.USE_PROFILES:!1,MA=D.ALLOW_ARIA_ATTR!==!1,te=D.ALLOW_DATA_ATTR!==!1,Ee=D.ALLOW_UNKNOWN_PROTOCOLS||!1,dA=D.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ne=D.SAFE_FOR_TEMPLATES||!1,Qe=D.SAFE_FOR_XML!==!1,PA=D.WHOLE_DOCUMENT||!1,nA=D.RETURN_DOM||!1,x=D.RETURN_DOM_FRAGMENT||!1,oA=D.RETURN_TRUSTED_TYPE||!1,hA=D.FORCE_BODY||!1,WA=D.SANITIZE_DOM!==!1,de=D.SANITIZE_NAMED_PROPS||!1,me=D.KEEP_CONTENT!==!1,H=D.IN_PLACE||!1,iA=Th(D.ALLOWED_URI_REGEXP)?D.ALLOWED_URI_REGEXP:t0,Qt=typeof D.NAMESPACE=="string"?D.NAMESPACE:Ze,Xg=ce(D,"MATHML_TEXT_INTEGRATION_POINTS")&&D.MATHML_TEXT_INTEGRATION_POINTS&&typeof D.MATHML_TEXT_INTEGRATION_POINTS=="object"?_e(D.MATHML_TEXT_INTEGRATION_POINTS):RA({},["mi","mo","mn","ms","mtext"]),zg=ce(D,"HTML_INTEGRATION_POINTS")&&D.HTML_INTEGRATION_POINTS&&typeof D.HTML_INTEGRATION_POINTS=="object"?_e(D.HTML_INTEGRATION_POINTS):RA({},["annotation-xml"]);const w=ce(D,"CUSTOM_ELEMENT_HANDLING")&&D.CUSTOM_ELEMENT_HANDLING&&typeof D.CUSTOM_ELEMENT_HANDLING=="object"?_e(D.CUSTOM_ELEMENT_HANDLING):yg(null);if(gA=yg(null),ce(w,"tagNameCheck")&&Aa(w.tagNameCheck)&&(gA.tagNameCheck=w.tagNameCheck),ce(w,"attributeNameCheck")&&Aa(w.attributeNameCheck)&&(gA.attributeNameCheck=w.attributeNameCheck),ce(w,"allowCustomizedBuiltInElements")&&typeof w.allowCustomizedBuiltInElements=="boolean"&&(gA.allowCustomizedBuiltInElements=w.allowCustomizedBuiltInElements),ne&&(te=!1),x&&(nA=!0),j&&(cA=RA({},AI),fA=yg(null),j.html===!0&&(RA(cA,$n),RA(fA,eI)),j.svg===!0&&(RA(cA,ma),RA(fA,pa),RA(fA,_i)),j.svgFilters===!0&&(RA(cA,fa),RA(fA,pa),RA(fA,_i)),j.mathMl===!0&&(RA(cA,wa),RA(fA,tI),RA(fA,_i))),UA.tagCheck=null,UA.attributeCheck=null,ce(D,"ADD_TAGS")&&(typeof D.ADD_TAGS=="function"?UA.tagCheck=D.ADD_TAGS:Le(D.ADD_TAGS)&&(cA===vA&&(cA=_e(cA)),RA(cA,D.ADD_TAGS,fe))),ce(D,"ADD_ATTR")&&(typeof D.ADD_ATTR=="function"?UA.attributeCheck=D.ADD_ATTR:Le(D.ADD_ATTR)&&(fA===rA&&(fA=_e(fA)),RA(fA,D.ADD_ATTR,fe))),ce(D,"ADD_URI_SAFE_ATTR")&&Le(D.ADD_URI_SAFE_ATTR)&&RA(he,D.ADD_URI_SAFE_ATTR,fe),ce(D,"FORBID_CONTENTS")&&Le(D.FORBID_CONTENTS)&&(X===ZA&&(X=_e(X)),RA(X,D.FORBID_CONTENTS,fe)),ce(D,"ADD_FORBID_CONTENTS")&&Le(D.ADD_FORBID_CONTENTS)&&(X===ZA&&(X=_e(X)),RA(X,D.ADD_FORBID_CONTENTS,fe)),me&&(cA["#text"]=!0),PA&&RA(cA,["html","head","body"]),cA.table&&(RA(cA,["tbody"]),delete lA.tbody),D.TRUSTED_TYPES_POLICY){if(typeof D.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof D.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=D.TRUSTED_TYPES_POLICY,v=y.createHTML("")}else y===void 0&&(y=eu(l,i)),y!==null&&typeof v=="string"&&(v=y.createHTML(""));qe&&qe(D),ig=D},R=RA({},[...ma,...fa,...Zh]),J=RA({},[...wa,...Wh]),P=function(D){let w=N(D);(!w||!w.tagName)&&(w={namespaceURI:Qt,tagName:"template"});const M=Ci(D.tagName),CA=Ci(w.tagName);return Og[D.namespaceURI]?D.namespaceURI===xt?w.namespaceURI===Ze?M==="svg":w.namespaceURI===pt?M==="svg"&&(CA==="annotation-xml"||Xg[CA]):!!R[M]:D.namespaceURI===pt?w.namespaceURI===Ze?M==="math":w.namespaceURI===xt?M==="math"&&zg[CA]:!!J[M]:D.namespaceURI===Ze?w.namespaceURI===xt&&!zg[CA]||w.namespaceURI===pt&&!Xg[CA]?!1:!J[M]&&(Ri[M]||!R[M]):!!(tg==="application/xhtml+xml"&&Og[D.namespaceURI]):!1},$=function(D){$g(A.removed,{element:D});try{N(D).removeChild(D)}catch{u(D)}},mA=function(D,w){try{$g(A.removed,{attribute:w.getAttributeNode(D),from:w})}catch{$g(A.removed,{attribute:null,from:w})}if(w.removeAttribute(D),D==="is")if(nA||x)try{$(w)}catch{}else try{w.setAttribute(D,"")}catch{}},yA=function(D){let w=null,M=null;if(hA)D="<remove></remove>"+D;else{const wA=Xn(D,/^[\r\n\t ]+/);M=wA&&wA[0]}tg==="application/xhtml+xml"&&Qt===Ze&&(D='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+D+"</body></html>");const CA=y?y.createHTML(D):D;if(Qt===Ze)try{w=new c().parseFromString(CA,tg)}catch{}if(!w||!w.documentElement){w=U.createDocument(Qt,"template",null);try{w.documentElement.innerHTML=_g?v:CA}catch{}}const FA=w.body||w.documentElement;return D&&M&&FA.insertBefore(e.createTextNode(M),FA.childNodes[0]||null),Qt===Ze?K.call(w,PA?"html":"body")[0]:PA?w.documentElement:FA},JA=function(D){return G.call(D.ownerDocument||D,D,C.SHOW_ELEMENT|C.SHOW_COMMENT|C.SHOW_TEXT|C.SHOW_PROCESSING_INSTRUCTION|C.SHOW_CDATA_SECTION,null)},DA=function(D){return D instanceof B&&(typeof D.nodeName!="string"||typeof D.textContent!="string"||typeof D.removeChild!="function"||!(D.attributes instanceof r)||typeof D.removeAttribute!="function"||typeof D.setAttribute!="function"||typeof D.namespaceURI!="string"||typeof D.insertBefore!="function"||typeof D.hasChildNodes!="function")},HA=function(D){return typeof n=="function"&&D instanceof n};function bA(W,D,w){Pg(W,M=>{M.call(A,D,w,ig)})}const Ie=function(D){let w=null;if(bA(_.beforeSanitizeElements,D,null),DA(D))return $(D),!0;const M=fe(D.nodeName);if(bA(_.uponSanitizeElement,D,{tagName:M,allowedTags:cA}),Qe&&D.hasChildNodes()&&!HA(D.firstElementChild)&&Je(/<[/\w!]/g,D.innerHTML)&&Je(/<[/\w!]/g,D.textContent)||Qe&&D.namespaceURI===Ze&&M==="style"&&HA(D.firstElementChild)||D.nodeType===ei.progressingInstruction||Qe&&D.nodeType===ei.comment&&Je(/<[/\w]/g,D.data))return $(D),!0;if(lA[M]||!(UA.tagCheck instanceof Function&&UA.tagCheck(M))&&!cA[M]){if(!lA[M]&&Ne(M)&&(gA.tagNameCheck instanceof RegExp&&Je(gA.tagNameCheck,M)||gA.tagNameCheck instanceof Function&&gA.tagNameCheck(M)))return!1;if(me&&!X[M]){const CA=N(D)||D.parentNode,FA=b(D)||D.childNodes;if(FA&&CA){const wA=FA.length;for(let jA=wA-1;jA>=0;--jA){const Ce=d(FA[jA],!0);CA.insertBefore(Ce,p(D))}}}return $(D),!0}return D instanceof I&&!P(D)||(M==="noscript"||M==="noembed"||M==="noframes")&&Je(/<\/no(script|embed|frames)/i,D.innerHTML)?($(D),!0):(ne&&D.nodeType===ei.text&&(w=D.textContent,Pg([AA,BA,uA],CA=>{w=wg(w,CA," ")}),D.textContent!==w&&($g(A.removed,{element:D.cloneNode()}),D.textContent=w)),bA(_.afterSanitizeElements,D,null),!1)},Ge=function(D,w,M){if(LA[w]||WA&&(w==="id"||w==="name")&&(M in e||M in en))return!1;const CA=fA[w]||UA.attributeCheck instanceof Function&&UA.attributeCheck(w,D);if(!(te&&!LA[w]&&Je(L,w))){if(!(MA&&Je(q,w))){if(!CA||LA[w]){if(!(Ne(D)&&(gA.tagNameCheck instanceof RegExp&&Je(gA.tagNameCheck,D)||gA.tagNameCheck instanceof Function&&gA.tagNameCheck(D))&&(gA.attributeNameCheck instanceof RegExp&&Je(gA.attributeNameCheck,w)||gA.attributeNameCheck instanceof Function&&gA.attributeNameCheck(w,D))||w==="is"&&gA.allowCustomizedBuiltInElements&&(gA.tagNameCheck instanceof RegExp&&Je(gA.tagNameCheck,M)||gA.tagNameCheck instanceof Function&&gA.tagNameCheck(M))))return!1}else if(!he[w]){if(!Je(iA,wg(M,O,""))){if(!((w==="src"||w==="xlink:href"||w==="href")&&D!=="script"&&zn(M,"data:")===0&&OA[D])){if(!(Ee&&!Je(IA,wg(M,O,"")))){if(M)return!1}}}}}}return!0},It=RA({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ne=function(D){return!It[Ci(D)]&&Je(Z,D)},Dt=function(D){bA(_.beforeSanitizeAttributes,D,null);const{attributes:w}=D;if(!w||DA(D))return;const M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:fA,forceKeepAttr:void 0};let CA=w.length;for(;CA--;){const FA=w[CA],{name:wA,namespaceURI:jA,value:Ce}=FA,Ye=fe(wA),We=Ce;let $A=wA==="value"?We:Mh(We);if(M.attrName=Ye,M.attrValue=$A,M.keepAttr=!0,M.forceKeepAttr=void 0,bA(_.uponSanitizeAttribute,D,M),$A=M.attrValue,de&&(Ye==="id"||Ye==="name")&&zn($A,Me)!==0&&(mA(wA,D),$A=Me+$A),Qe&&Je(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,$A)){mA(wA,D);continue}if(Ye==="attributename"&&Xn($A,"href")){mA(wA,D);continue}if(M.forceKeepAttr)continue;if(!M.keepAttr){mA(wA,D);continue}if(!dA&&Je(/\/>/i,$A)){mA(wA,D);continue}ne&&Pg([AA,BA,uA],Ui=>{$A=wg($A,Ui," ")});const Ji=fe(D.nodeName);if(!Ge(Ji,Ye,$A)){mA(wA,D);continue}if(y&&typeof l=="object"&&typeof l.getAttributeType=="function"&&!jA)switch(l.getAttributeType(Ji,Ye)){case"TrustedHTML":{$A=y.createHTML($A);break}case"TrustedScriptURL":{$A=y.createScriptURL($A);break}}if($A!==We)try{jA?D.setAttributeNS(jA,wA,$A):D.setAttribute(wA,$A),DA(D)?$(D):On(A.removed)}catch{mA(wA,D)}}bA(_.afterSanitizeAttributes,D,null)},oe=function(D){let w=null;const M=JA(D);for(bA(_.beforeSanitizeShadowDOM,D,null);w=M.nextNode();)bA(_.uponSanitizeShadowNode,w,null),Ie(w),Dt(w),w.content instanceof o&&oe(w.content);bA(_.afterSanitizeShadowDOM,D,null)};return A.sanitize=function(W){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,M=null,CA=null,FA=null;if(_g=!W,_g&&(W="<!-->"),typeof W!="string"&&!HA(W)&&(W=qh(W),typeof W!="string"))throw Vi("dirty is not a string, aborting");if(!A.isSupported)return W;if(T||Yi(D),A.removed=[],typeof W=="string"&&(H=!1),H){const Ce=W.nodeName;if(typeof Ce=="string"){const Ye=fe(Ce);if(!cA[Ye]||lA[Ye])throw Vi("root node is forbidden and cannot be sanitized in-place")}}else if(W instanceof n)w=yA("<!---->"),M=w.ownerDocument.importNode(W,!0),M.nodeType===ei.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?w=M:w.appendChild(M);else{if(!nA&&!ne&&!PA&&W.indexOf("<")===-1)return y&&oA?y.createHTML(W):W;if(w=yA(W),!w)return nA?null:oA?v:""}w&&hA&&$(w.firstChild);const wA=JA(H?W:w);for(;CA=wA.nextNode();)Ie(CA),Dt(CA),CA.content instanceof o&&oe(CA.content);if(H)return W;if(nA){if(ne){w.normalize();let Ce=w.innerHTML;Pg([AA,BA,uA],Ye=>{Ce=wg(Ce,Ye," ")}),w.innerHTML=Ce}if(x)for(FA=Y.call(w.ownerDocument);w.firstChild;)FA.appendChild(w.firstChild);else FA=w;return(fA.shadowroot||fA.shadowrootmode)&&(FA=sA.call(g,FA,!0)),FA}let jA=PA?w.outerHTML:w.innerHTML;return PA&&cA["!doctype"]&&w.ownerDocument&&w.ownerDocument.doctype&&w.ownerDocument.doctype.name&&Je(g0,w.ownerDocument.doctype.name)&&(jA="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
|
|
510
|
-
`+jA),ne&&Pg([AA,BA,uA],Ce=>{jA=wg(jA,Ce," ")}),y&&oA?y.createHTML(jA):jA},A.setConfig=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yi(W),T=!0},A.clearConfig=function(){ig=null,T=!1},A.isValidAttribute=function(W,D,w){ig||Yi({});const M=fe(W),CA=fe(D);return Ge(M,CA,w)},A.addHook=function(W,D){typeof D=="function"&&$g(_[W],D)},A.removeHook=function(W,D){if(D!==void 0){const w=Jh(_[W],D);return w===-1?void 0:Uh(_[W],w,1)[0]}return On(_[W])},A.removeHooks=function(W){_[W]=[]},A.removeAllHooks=function(){_=iI()},A}var tu=i0();const gu={ALLOWED_TAGS:["h1","h2","h3","h4","h5","h6","p","br","hr","strong","em","u","s","del","ins","a","img","ul","ol","li","blockquote","pre","code","table","thead","tbody","tr","th","td","div","span","annotation","math","semantics","mrow","mi","mo","mn","msup","msub","mfrac"],ALLOWED_ATTR:["href","target","rel","src","alt","width","height","class","id","colspan","rowspan","style","aria-hidden"],ALLOW_DATA_ATTR:!1};function iu(t){return tu.sanitize(t,gu)}const ou=/<table[\s\S]*?<\/table>/g;function au(t
|
|
510
|
+
`+jA),ne&&Pg([AA,BA,uA],Ce=>{jA=wg(jA,Ce," ")}),y&&oA?y.createHTML(jA):jA},A.setConfig=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yi(W),T=!0},A.clearConfig=function(){ig=null,T=!1},A.isValidAttribute=function(W,D,w){ig||Yi({});const M=fe(W),CA=fe(D);return Ge(M,CA,w)},A.addHook=function(W,D){typeof D=="function"&&$g(_[W],D)},A.removeHook=function(W,D){if(D!==void 0){const w=Jh(_[W],D);return w===-1?void 0:Uh(_[W],w,1)[0]}return On(_[W])},A.removeHooks=function(W){_[W]=[]},A.removeAllHooks=function(){_=iI()},A}var tu=i0();const gu={ALLOWED_TAGS:["h1","h2","h3","h4","h5","h6","p","br","hr","strong","em","u","s","del","ins","a","img","ul","ol","li","blockquote","pre","code","table","thead","tbody","tr","th","td","div","span","annotation","math","semantics","mrow","mi","mo","mn","msup","msub","mfrac"],ALLOWED_ATTR:["href","target","rel","src","alt","width","height","class","id","colspan","rowspan","style","aria-hidden"],ALLOW_DATA_ATTR:!1};function iu(t){return tu.sanitize(t,gu)}const ou=/<table[\s\S]*?<\/table>/g;function au(t){const A=[...t.matchAll(ou)];if(A.length===0)return t;let e="",g=0;for(const i of A){const o=i[0],s=i.index,n=s+o.length;e+=t.slice(g,s),e+=`<div class="table-node-wrapper"><div class="table-node">${o}</div></div>`,g=n}return e+t.slice(g)}const fo=a.ref(!1);let ti=null;function o0(){return fo.value?Promise.resolve():ti||(ti=xc().then(()=>{fo.value=!0}).catch(t=>{console.error("[mdoc] Failed to initialize md4x:",t),ti=null}),ti)}typeof window<"u"&&o0();const su=/\[(IMG|VIDEO|AUDIO):\{([^}]+)\}\]/g,nu=/<x-equation(\s+type="display")?>([\s\S]*?)<\/x-equation>/g;function Iu(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function Cu(t){return t.replace(nu,(A,e,g)=>{const i=!!e,o=Fh.renderToString(Iu(g).trim(),{displayMode:i,throwOnError:!1,strict:!1});return i?`<span class="math-block">${o}</span>`:`<span class="math-inline">${o}</span>`})}function ru(t){const A=[];let e=0;return{content:t.replace(su,(i,o,s)=>{try{const n=JSON.parse(`{${s}}`),I=o==="IMG"?"image":o.toLowerCase(),C=`media-${e}`;return A.push({id:C,type:I,data:n}),e+=1,`
|
|
511
511
|
%%${C}%%
|
|
512
|
-
`}catch{return i}}),media:A}}function Bu(t,A={}){if(!t)return[];if(!fo.value)return[{type:"html",id:"pending",html:"<p></p>"}];const e=A0(t);if(!e)return[];const{content:g,media:i}=ru(e);let o=Mc(g,{heal:A.streaming===!0});o=Cu(o),o=iu(o),o=au(o,{streaming:A.streaming===!0}),o=o.replace(/<p>\s*((?:%%media-\d+%%\s*)+)<\/p>/g,"$1");const s=new Map(i.map(r=>[r.id,r])),n=o.split(/(%%media-\d+%%)/),I=[];let C=0;for(const r of n){const B=r.match(/^%%(media-\d+)%%$/);if(B){const c=s.get(B[1]);if(!c||typeof c.data.url!="string")continue;c.type==="image"?I.push({type:"image",id:`${c.id}-${C}`,url:c.data.url,alt:typeof c.data.alt=="string"?c.data.alt:void 0}):c.type==="video"?I.push({type:"video",id:`${c.id}-${C}`,url:c.data.url,poster:typeof c.data.poster=="string"?c.data.poster:void 0}):I.push({type:"audio",id:`${c.id}-${C}`,url:c.data.url,title:typeof c.data.title=="string"?c.data.title:void 0}),C+=1;continue}r.trim()&&(I.push({type:"html",id:`html-${C}`,html:r}),C+=1)}return Qu(I)}function Qu(t){const A=[];let e=[];const g=()=>{e.length!==0&&(e.length===1?A.push(e[0]):A.push({type:"image-stack",id:`image-stack-${e[0].id}`,images:e.map(i=>({id:i.id,url:i.url,alt:i.alt}))}),e=[])};for(const i of t){if(i.type==="image"){e.push(i);continue}g(),A.push(i)}return g(),A}const lu={key:1,class:"content-nodes__text"},cu=["innerHTML"],Eu={key:3,class:"content-nodes__media"},hu=["src","poster"],uu={key:4,class:"content-nodes__media"},du={key:0},mu=["src"],fu=a.defineComponent({name:"ContentNodes",__name:"ContentNodes",props:{content:{},isStreaming:{type:Boolean},highlightStreamTail:{type:Boolean},density:{}},emits:["action"],setup(t,{emit:A}){const e=t,g=A,i=a.ref([]),o=a.ref();function s(l,h){const d=new tr({registry:Jo});return l&&d.push(l),h||d.finalize(),d.getNodes().filter(u=>u.kind==="text"?u.text.length>0:u.tag==="ask-form"?!1:u.complete)}function n(){i.value=s(e.content,e.isStreaming===!0),a.nextTick(c)}a.watch(()=>[e.content,e.isStreaming,e.highlightStreamTail,fo.value],()=>n(),{immediate:!0}),a.onMounted(()=>{o0().then(()=>n())});const I=a.computed(()=>{const l=[];let h=-1;for(let d=0;d<i.value.length;d+=1)i.value[d].kind==="text"&&(h=d);for(let d=0;d<i.value.length;d+=1){const u=i.value[d];if(u.kind==="text"){const p=e.isStreaming===!0&&d===h;l.push({type:"text",key:u.id,segments:Bu(u.text,{streaming:p})});continue}u.tag==="artifact"&&l.push({type:"artifact",key:u.id,node:u})}return l});function C(){const l=o.value;if(!(!l||typeof document>"u"))for(const h of l.querySelectorAll(".content-nodes__stream-tail"))h.replaceWith(document.createTextNode(h.textContent??""))}function r(l){let h;const d=l.lastElementChild,u=d==null?void 0:d.lastElementChild;if(!(u!=null&&u.classList.contains("content-nodes__html")))return;function p(b){for(const N of b.childNodes){if(N.nodeType===3){const y=N,v=y.parentElement;y.data.trim().length>0&&v&&!v.closest(".math-block, .math-inline, .content-nodes__media")&&(h=y);continue}p(N)}}return p(u),h}function B(l){var y;const h=l.data,d=h.length-(((y=h.match(/\s*$/))==null?void 0:y[0].length)??0);if(d===0||typeof document>"u")return 0;const u=document.createRange();if(typeof u.getClientRects!="function")return 0;const p=v=>(u.setStart(l,v),u.setEnd(l,d),u.getClientRects().length);if(p(0)===0)return 0;let b=0,N=d;for(;b<N;){const v=Math.floor((b+N)/2);p(v)<=1?N=v:b=v+1}return b}function c(){C();const l=o.value;if(!l||!e.isStreaming||!e.highlightStreamTail||typeof document>"u")return;const h=r(l);if(!h||!h.data.trim())return;const d=B(h),u=h.data.slice(0,d),p=h.data.slice(d),b=document.createElement("span");b.className="content-nodes__stream-tail",b.textContent=p;const N=document.createDocumentFragment();u&&N.append(document.createTextNode(u)),N.append(b),h.replaceWith(N)}return(l,h)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"rootRef",ref:o,class:a.normalizeClass(["content-nodes",{"content-nodes--compact":t.density==="compact"}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(I.value,d=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:d.key},[d.type==="artifact"?(a.openBlock(),a.createBlock(_l,{key:0,node:d.node,onAction:h[0]||(h[0]=u=>g("action",u))},null,8,["node"])):(a.openBlock(),a.createElementBlock("div",lu,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.segments,u=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:u.id},[u.type==="html"?(a.openBlock(),a.createElementBlock("div",{key:0,class:"content-nodes__html",innerHTML:u.html},null,8,cu)):u.type==="image"?(a.openBlock(),a.createBlock(Qn,{key:1,images:[{id:u.id,url:u.url,alt:u.alt}]},null,8,["images"])):u.type==="image-stack"?(a.openBlock(),a.createBlock(Qn,{key:2,images:u.images},null,8,["images"])):u.type==="video"?(a.openBlock(),a.createElementBlock("figure",Eu,[a.createElementVNode("video",{src:u.url,poster:u.poster,controls:"",playsinline:""},null,8,hu)])):u.type==="audio"?(a.openBlock(),a.createElementBlock("figure",uu,[u.title?(a.openBlock(),a.createElementBlock("figcaption",du,a.toDisplayString(u.title),1)):a.createCommentVNode("",!0),a.createElementVNode("audio",{src:u.url,controls:""},null,8,mu)])):a.createCommentVNode("",!0)],64))),128))]))],64))),128))],2))}}),wu=xA(fu,[["__scopeId","data-v-8ef9846c"]]),pu=8;function Du(t,A){const e=a.ref(t.value);let g,i=!1;function o(){g!==void 0&&(cancelAnimationFrame(g),g=void 0)}function s(){const n=t.value,I=e.value;if(!A.value||I.length>=n.length){e.value=n,g=void 0;return}const C=n.length-I.length,r=Math.max(1,Math.ceil(C/pu));e.value=n.slice(0,I.length+r),g=requestAnimationFrame(s)}return a.watch(t,n=>{if(!i){i=!0,e.value=n;return}if(!A.value||n.length<e.value.length){e.value=n,o();return}g===void 0&&(g=requestAnimationFrame(s))},{immediate:!0}),a.watch(A,n=>{n||(e.value=t.value,o())}),a.onBeforeUnmount(o),{displayed:e}}const Rs=a.defineComponent({name:"TextPartRenderer",__name:"TextPartRenderer",props:{content:{},isStreaming:{type:Boolean},highlightStreamTail:{type:Boolean},density:{default:"default"}},emits:["action"],setup(t,{emit:A}){const e=t,g=A,{displayed:i}=Du(a.toRef(e,"content"),a.computed(()=>e.isStreaming===!0));return(o,s)=>(a.openBlock(),a.createBlock(wu,{content:a.unref(i),"is-streaming":t.isStreaming,"highlight-stream-tail":t.highlightStreamTail,density:t.density,onAction:s[0]||(s[0]=n=>g("action",n))},null,8,["content","is-streaming","highlight-stream-tail","density"]))}});function a0(t,A){const e=a.ref(void 0);let g;function i(){const s=t.value;s&&(e.value=`${s.scrollHeight}px`)}function o(){g==null||g.disconnect(),g=void 0}return a.watch([t,A],([s,n])=>{if(o(),!s||!n){e.value=void 0;return}i(),typeof ResizeObserver<"u"&&(g=new ResizeObserver(i),g.observe(s))},{immediate:!0,flush:"post"}),a.onBeforeUnmount(o),{height:e}}const ku=["open","aria-busy"],yu=["aria-expanded","aria-disabled"],Fu=a.defineComponent({__name:"ChatReasoning",props:{content:{},streaming:{type:Boolean}},setup(t){const A=t,e=a.ref(!1),g=a.ref(!1),i=a.ref(),o=a.ref(),{height:s}=a0(o,e),n=a.ref(0),I=a.ref(!1);let C=0,r;const B=a.computed(()=>!!A.content.trim());function c(){B.value&&(g.value=!0,e.value=!e.value)}a.watch(B,p=>{p||(e.value=!1,g.value=!1)}),a.watch(()=>A.streaming,p=>{g.value||(e.value=!1),p?l():h()}),a.watch(()=>A.content,()=>{!A.streaming||!e.value||a.nextTick(()=>{const p=i.value;p&&(p.scrollTop=p.scrollHeight)})});function l(){r||(C=Date.now()-n.value*1e3,I.value=!0,r=setInterval(()=>{n.value=Math.floor((Date.now()-C)/1e3)},250))}function h(){r&&(clearInterval(r),r=void 0,n.value=Math.max(n.value,Math.floor((Date.now()-C)/1e3)))}function d(){if(n.value<1)return"<1 秒";if(n.value<60)return`${n.value} 秒`;const p=Math.floor(n.value/60),b=n.value%60;return b?`${p} 分 ${b} 秒`:`${p} 分钟`}const u=a.computed(()=>A.streaming?`正在思考 ${d()}`:I.value?`已思考 ${d()}`:"思考过程");return a.onMounted(()=>{A.streaming&&l()}),a.onBeforeUnmount(h),(p,b)=>(a.openBlock(),a.createElementBlock("details",{class:a.normalizeClass(["chat-reasoning",{"chat-reasoning--empty":!B.value}]),open:e.value,"aria-busy":t.streaming?"true":void 0,"aria-label":"思考过程"},[a.createElementVNode("summary",{class:"chat-reasoning__summary","aria-expanded":e.value,"aria-disabled":B.value?void 0:"true",onClick:a.withModifiers(c,["prevent"])},[a.createVNode(a.unref(jB),{class:a.normalizeClass(["chat-reasoning__spark",{"chat-reasoning__spark--active":t.streaming}]),size:16,"stroke-width":1.75,"aria-hidden":"true"},null,8,["class"]),a.createElementVNode("span",{class:a.normalizeClass(["chat-reasoning__label",{"chat-reasoning__label--streaming":t.streaming}])},a.toDisplayString(u.value),3),B.value?(a.openBlock(),a.createBlock(a.unref(ls),{key:0,class:"chat-reasoning__chevron",size:14,"stroke-width":1.75,"aria-hidden":"true"})):a.createCommentVNode("",!0)],8,yu),B.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"bodyRef",ref:i,class:"chat-reasoning__viewport",style:a.normalizeStyle({height:a.unref(s)})},[a.createElementVNode("div",{ref_key:"contentRef",ref:o,class:"chat-reasoning__body"},[a.renderSlot(p.$slots,"default",{content:t.content,streaming:t.streaming===!0},()=>[a.createVNode(Rs,{content:t.content,"is-streaming":t.streaming,"highlight-stream-tail":t.streaming},null,8,["content","is-streaming","highlight-stream-tail"])],!0)],512)],4)):a.createCommentVNode("",!0)],10,ku))}}),s0=xA(Fu,[["__scopeId","data-v-09e6bd1d"]]),Nu=["aria-label"],bu={class:"conversation-chart__title"},vu={class:"conversation-chart__rows",role:"list"},Su={class:"conversation-chart__label"},Gu={class:"conversation-chart__bar-wrap"},Ru={class:"conversation-chart__value"},Yu=a.defineComponent({name:"ChartToolRenderer",__name:"ChartToolRenderer",props:{result:{}},setup(t){const A=t,e=a.computed(()=>{const o=i(A.result)?A.result:{},n=(Array.isArray(o.data)?o.data:[]).flatMap(C=>!i(C)||typeof C.label!="string"||typeof C.value!="number"?[]:[{label:C.label,value:C.value}]),I=Math.max(1,...n.map(C=>C.value));return{title:typeof o.title=="string"?o.title:"图表结果",rows:n,maxValue:I}});function g(o){return`${Math.max(0,Math.min(100,o/e.value.maxValue*100))}%`}function i(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}return(o,s)=>e.value.rows.length?(a.openBlock(),a.createElementBlock("section",{key:0,class:"conversation-chart","aria-label":e.value.title},[a.createElementVNode("strong",bu,a.toDisplayString(e.value.title),1),a.createElementVNode("div",vu,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.value.rows,n=>(a.openBlock(),a.createElementBlock("div",{key:n.label,class:"conversation-chart__row",role:"listitem"},[a.createElementVNode("span",Su,a.toDisplayString(n.label),1),a.createElementVNode("span",Gu,[a.createElementVNode("span",{class:"conversation-chart__bar",style:a.normalizeStyle({width:g(n.value)})},null,4)]),a.createElementVNode("span",Ru,a.toDisplayString(n.value),1)]))),128))])],8,Nu)):a.createCommentVNode("",!0)}}),n0=xA(Yu,[["__scopeId","data-v-db9fb284"]]),Ju={class:"conversation-code-result","aria-label":"代码执行结果"},Uu={key:0,class:"conversation-code-result__block"},Mu={class:"conversation-code-result__label"},xu={class:"conversation-code-result__code"},Lu={key:1,class:"conversation-code-result__block"},Hu={class:"conversation-code-result__label"},Ku={class:"conversation-code-result__code"},qu=a.defineComponent({name:"CodeToolRenderer",__name:"CodeToolRenderer",props:{toolCall:{},result:{}},setup(t){const A=t,e=a.computed(()=>C(A.result)?A.result:{}),g=a.computed(()=>I(e.value.language)??"text"),i=a.computed(()=>I(e.value.code)??n(A.toolCall.function.arguments)),o=a.computed(()=>I(e.value.output)??""),s=a.computed(()=>e.value.exitCode);function n(r){try{const B=JSON.parse(r);return C(B)?I(B.code)??"":""}catch{return""}}function I(r){return typeof r=="string"?r:void 0}function C(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}return(r,B)=>(a.openBlock(),a.createElementBlock("section",Ju,[i.value?(a.openBlock(),a.createElementBlock("div",Uu,[a.createElementVNode("span",Mu,a.toDisplayString(g.value),1),a.createElementVNode("pre",xu,[a.createElementVNode("code",null,a.toDisplayString(i.value),1)])])):a.createCommentVNode("",!0),o.value?(a.openBlock(),a.createElementBlock("div",Lu,[a.createElementVNode("span",Hu,"输出"+a.toDisplayString(s.value===void 0?"":` (${s.value})`),1),a.createElementVNode("pre",Ku,[a.createElementVNode("code",null,a.toDisplayString(o.value),1)])])):a.createCommentVNode("",!0)]))}}),I0=xA(qu,[["__scopeId","data-v-161409fc"]]),Tu={class:"conversation-mind-map","aria-label":"思维导图结果"},Zu={key:1,class:"conversation-mind-map__error",role:"alert"},oI=6,aI=80,Wu=a.defineComponent({name:"MindMapToolRenderer",__name:"MindMapToolRenderer",props:{result:{}},setup(t){const A=t,e=a.computed(()=>i(A.result)),g={name:"ai-conversation",background:"transparent",grid:{show:!1},nodeStyle:{colors:["var(--ai-conversation-code-bg)","var(--ai-conversation-tool-bg)","var(--ai-conversation-assistant-bg)"],textColor:"var(--ai-conversation-assistant-color)",borderColor:"var(--ai-conversation-tool-border)",borderWidth:1,borderRadius:6,fontSize:13,fontWeight:600},linkStyle:{color:"var(--ai-conversation-tool-running)",width:1.5,curve:"bezier",animated:!1}};function i(I){const C=n(I)?I:void 0,r=n(C==null?void 0:C.data)?C.data:C;if(!r||!n(r.nodeData))return o();let B=0;const c=new WeakSet;function l(h,d){if(!n(h)||c.has(h))return;if(d>oI)throw new Error(`思维导图最多支持 ${oI} 层。`);const u=s(h.id),p=s(h.topic);if(!u||!p||h.children!==void 0&&!Array.isArray(h.children))return;if(c.add(h),B+=1,B>aI)throw new Error(`思维导图最多支持 ${aI} 个节点。`);const b=[];for(const N of h.children??[]){const y=l(N,d+1);if(!y)return;b.push(y)}return{id:u,topic:p,root:d===1,expanded:typeof h.expanded=="boolean"?h.expanded:!0,...b.length?{children:b}:{}}}try{const h=l(r.nodeData,1);return h?{data:{nodeData:h}}:o()}catch(h){return{error:h instanceof Error?h.message:o().error}}}function o(){return{error:"无法显示思维导图:数据结构无效。"}}function s(I){return typeof I=="string"&&I.trim()?I.trim():void 0}function n(I){return typeof I=="object"&&I!==null&&!Array.isArray(I)}return(I,C)=>(a.openBlock(),a.createElementBlock("section",Tu,[e.value.data?(a.openBlock(),a.createBlock(xC,{key:0,data:e.value.data,theme:g,height:"18rem",readonly:"","show-toolbar":"","show-download":!1,"show-counts":!0,"toolbar-position":"bottom"},null,8,["data"])):(a.openBlock(),a.createElementBlock("p",Zu,a.toDisplayString(e.value.error),1))]))}}),C0=xA(Wu,[["__scopeId","data-v-42be305a"]]);/*!
|
|
512
|
+
`}catch{return i}}),media:A}}function Bu(t,A={}){if(!t)return[];if(!fo.value)return[{type:"html",id:"pending",html:"<p></p>"}];const e=A0(t);if(!e)return[];const{content:g,media:i}=ru(e);let o=Mc(g,{heal:A.streaming===!0});o=Cu(o),o=iu(o),o=au(o),o=o.replace(/<p>\s*((?:%%media-\d+%%\s*)+)<\/p>/g,"$1");const s=new Map(i.map(r=>[r.id,r])),n=o.split(/(%%media-\d+%%)/),I=[];let C=0;for(const r of n){const B=r.match(/^%%(media-\d+)%%$/);if(B){const c=s.get(B[1]);if(!c||typeof c.data.url!="string")continue;c.type==="image"?I.push({type:"image",id:`${c.id}-${C}`,url:c.data.url,alt:typeof c.data.alt=="string"?c.data.alt:void 0}):c.type==="video"?I.push({type:"video",id:`${c.id}-${C}`,url:c.data.url,poster:typeof c.data.poster=="string"?c.data.poster:void 0}):I.push({type:"audio",id:`${c.id}-${C}`,url:c.data.url,title:typeof c.data.title=="string"?c.data.title:void 0}),C+=1;continue}r.trim()&&(I.push({type:"html",id:`html-${C}`,html:r}),C+=1)}return Qu(I)}function Qu(t){const A=[];let e=[];const g=()=>{e.length!==0&&(e.length===1?A.push(e[0]):A.push({type:"image-stack",id:`image-stack-${e[0].id}`,images:e.map(i=>({id:i.id,url:i.url,alt:i.alt}))}),e=[])};for(const i of t){if(i.type==="image"){e.push(i);continue}g(),A.push(i)}return g(),A}const lu={key:1,class:"content-nodes__text"},cu=["innerHTML"],Eu={key:3,class:"content-nodes__media"},hu=["src","poster"],uu={key:4,class:"content-nodes__media"},du={key:0},mu=["src"],fu=a.defineComponent({name:"ContentNodes",__name:"ContentNodes",props:{content:{},isStreaming:{type:Boolean},highlightStreamTail:{type:Boolean},density:{}},emits:["action"],setup(t,{emit:A}){const e=t,g=A,i=a.ref([]),o=a.ref();function s(l,h){const d=new tr({registry:Jo});return l&&d.push(l),h||d.finalize(),d.getNodes().filter(u=>u.kind==="text"?u.text.length>0:u.tag==="ask-form"?!1:u.complete)}function n(){i.value=s(e.content,e.isStreaming===!0),a.nextTick(c)}a.watch(()=>[e.content,e.isStreaming,e.highlightStreamTail,fo.value],()=>n(),{immediate:!0}),a.onMounted(()=>{o0().then(()=>n())});const I=a.computed(()=>{const l=[];let h=-1;for(let d=0;d<i.value.length;d+=1)i.value[d].kind==="text"&&(h=d);for(let d=0;d<i.value.length;d+=1){const u=i.value[d];if(u.kind==="text"){const p=e.isStreaming===!0&&d===h;l.push({type:"text",key:u.id,segments:Bu(u.text,{streaming:p})});continue}u.tag==="artifact"&&l.push({type:"artifact",key:u.id,node:u})}return l});function C(){const l=o.value;if(!(!l||typeof document>"u"))for(const h of l.querySelectorAll(".content-nodes__stream-tail"))h.replaceWith(document.createTextNode(h.textContent??""))}function r(l){let h;const d=l.lastElementChild,u=d==null?void 0:d.lastElementChild;if(!(u!=null&&u.classList.contains("content-nodes__html")))return;function p(b){for(const N of b.childNodes){if(N.nodeType===3){const y=N,v=y.parentElement;y.data.trim().length>0&&v&&!v.closest(".math-block, .math-inline, .content-nodes__media")&&(h=y);continue}p(N)}}return p(u),h}function B(l){var y;const h=l.data,d=h.length-(((y=h.match(/\s*$/))==null?void 0:y[0].length)??0);if(d===0||typeof document>"u")return 0;const u=document.createRange();if(typeof u.getClientRects!="function")return 0;const p=v=>(u.setStart(l,v),u.setEnd(l,d),u.getClientRects().length);if(p(0)===0)return 0;let b=0,N=d;for(;b<N;){const v=Math.floor((b+N)/2);p(v)<=1?N=v:b=v+1}return b}function c(){C();const l=o.value;if(!l||!e.isStreaming||!e.highlightStreamTail||typeof document>"u")return;const h=r(l);if(!h||!h.data.trim())return;const d=B(h),u=h.data.slice(0,d),p=h.data.slice(d),b=document.createElement("span");b.className="content-nodes__stream-tail",b.textContent=p;const N=document.createDocumentFragment();u&&N.append(document.createTextNode(u)),N.append(b),h.replaceWith(N)}return(l,h)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"rootRef",ref:o,class:a.normalizeClass(["content-nodes",{"content-nodes--compact":t.density==="compact"}])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(I.value,d=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:d.key},[d.type==="artifact"?(a.openBlock(),a.createBlock(_l,{key:0,node:d.node,onAction:h[0]||(h[0]=u=>g("action",u))},null,8,["node"])):(a.openBlock(),a.createElementBlock("div",lu,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(d.segments,u=>(a.openBlock(),a.createElementBlock(a.Fragment,{key:u.id},[u.type==="html"?(a.openBlock(),a.createElementBlock("div",{key:0,class:"content-nodes__html",innerHTML:u.html},null,8,cu)):u.type==="image"?(a.openBlock(),a.createBlock(Qn,{key:1,images:[{id:u.id,url:u.url,alt:u.alt}]},null,8,["images"])):u.type==="image-stack"?(a.openBlock(),a.createBlock(Qn,{key:2,images:u.images},null,8,["images"])):u.type==="video"?(a.openBlock(),a.createElementBlock("figure",Eu,[a.createElementVNode("video",{src:u.url,poster:u.poster,controls:"",playsinline:""},null,8,hu)])):u.type==="audio"?(a.openBlock(),a.createElementBlock("figure",uu,[u.title?(a.openBlock(),a.createElementBlock("figcaption",du,a.toDisplayString(u.title),1)):a.createCommentVNode("",!0),a.createElementVNode("audio",{src:u.url,controls:""},null,8,mu)])):a.createCommentVNode("",!0)],64))),128))]))],64))),128))],2))}}),wu=xA(fu,[["__scopeId","data-v-6a17c994"]]),pu=8;function Du(t,A){const e=a.ref(t.value);let g,i=!1;function o(){g!==void 0&&(cancelAnimationFrame(g),g=void 0)}function s(){const n=t.value,I=e.value;if(!A.value||I.length>=n.length){e.value=n,g=void 0;return}const C=n.length-I.length,r=Math.max(1,Math.ceil(C/pu));e.value=n.slice(0,I.length+r),g=requestAnimationFrame(s)}return a.watch(t,n=>{if(!i){i=!0,e.value=n;return}if(!A.value||n.length<e.value.length){e.value=n,o();return}g===void 0&&(g=requestAnimationFrame(s))},{immediate:!0}),a.watch(A,n=>{n||(e.value=t.value,o())}),a.onBeforeUnmount(o),{displayed:e}}const Rs=a.defineComponent({name:"TextPartRenderer",__name:"TextPartRenderer",props:{content:{},isStreaming:{type:Boolean},highlightStreamTail:{type:Boolean},density:{default:"default"}},emits:["action"],setup(t,{emit:A}){const e=t,g=A,{displayed:i}=Du(a.toRef(e,"content"),a.computed(()=>e.isStreaming===!0));return(o,s)=>(a.openBlock(),a.createBlock(wu,{content:a.unref(i),"is-streaming":t.isStreaming,"highlight-stream-tail":t.highlightStreamTail,density:t.density,onAction:s[0]||(s[0]=n=>g("action",n))},null,8,["content","is-streaming","highlight-stream-tail","density"]))}});function a0(t,A){const e=a.ref(void 0);let g;function i(){const s=t.value;s&&(e.value=`${s.scrollHeight}px`)}function o(){g==null||g.disconnect(),g=void 0}return a.watch([t,A],([s,n])=>{if(o(),!s||!n){e.value=void 0;return}i(),typeof ResizeObserver<"u"&&(g=new ResizeObserver(i),g.observe(s))},{immediate:!0,flush:"post"}),a.onBeforeUnmount(o),{height:e}}const ku=["open","aria-busy"],yu=["aria-expanded","aria-disabled"],Fu=a.defineComponent({__name:"ChatReasoning",props:{content:{},streaming:{type:Boolean}},setup(t){const A=t,e=a.ref(!0),g=a.ref(!1),i=a.ref(),o=a.ref(),{height:s}=a0(o,e),n=a.ref(0),I=a.ref(!1);let C=0,r;const B=a.computed(()=>!!A.content.trim());function c(){B.value&&(g.value=!0,e.value=!e.value)}a.watch(B,p=>{if(!p){e.value=!1,g.value=!1;return}g.value||(e.value=!0)},{immediate:!0}),a.watch(()=>A.streaming,p=>{p?l():h()}),a.watch(()=>A.content,()=>{!A.streaming||!e.value||a.nextTick(()=>{const p=i.value;p&&(p.scrollTop=p.scrollHeight)})});function l(){r||(C=Date.now()-n.value*1e3,I.value=!0,r=setInterval(()=>{n.value=Math.floor((Date.now()-C)/1e3)},250))}function h(){r&&(clearInterval(r),r=void 0,n.value=Math.max(n.value,Math.floor((Date.now()-C)/1e3)))}function d(){if(n.value<1)return"<1 秒";if(n.value<60)return`${n.value} 秒`;const p=Math.floor(n.value/60),b=n.value%60;return b?`${p} 分 ${b} 秒`:`${p} 分钟`}const u=a.computed(()=>A.streaming?`正在思考 ${d()}`:I.value?`已思考 ${d()}`:"思考过程");return a.onMounted(()=>{A.streaming&&l()}),a.onBeforeUnmount(h),(p,b)=>(a.openBlock(),a.createElementBlock("details",{class:a.normalizeClass(["chat-reasoning",{"chat-reasoning--empty":!B.value}]),open:e.value,"aria-busy":t.streaming?"true":void 0,"aria-label":"思考过程"},[a.createElementVNode("summary",{class:"chat-reasoning__summary","aria-expanded":e.value,"aria-disabled":B.value?void 0:"true",onClick:a.withModifiers(c,["prevent"])},[a.createVNode(a.unref(jB),{class:a.normalizeClass(["chat-reasoning__spark",{"chat-reasoning__spark--active":t.streaming}]),size:16,"stroke-width":1.75,"aria-hidden":"true"},null,8,["class"]),a.createElementVNode("span",{class:a.normalizeClass(["chat-reasoning__label",{"chat-reasoning__label--streaming":t.streaming}])},a.toDisplayString(u.value),3),B.value?(a.openBlock(),a.createBlock(a.unref(ls),{key:0,class:"chat-reasoning__chevron",size:14,"stroke-width":1.75,"aria-hidden":"true"})):a.createCommentVNode("",!0)],8,yu),B.value?(a.openBlock(),a.createElementBlock("div",{key:0,ref_key:"bodyRef",ref:i,class:"chat-reasoning__viewport",style:a.normalizeStyle({height:a.unref(s)})},[a.createElementVNode("div",{ref_key:"contentRef",ref:o,class:"chat-reasoning__body"},[a.renderSlot(p.$slots,"default",{content:t.content,streaming:t.streaming===!0},()=>[a.createVNode(Rs,{content:t.content,"is-streaming":t.streaming,"highlight-stream-tail":t.streaming},null,8,["content","is-streaming","highlight-stream-tail"])],!0)],512)],4)):a.createCommentVNode("",!0)],10,ku))}}),s0=xA(Fu,[["__scopeId","data-v-6eefa7f8"]]),Nu=["aria-label"],bu={class:"conversation-chart__title"},vu={class:"conversation-chart__rows",role:"list"},Su={class:"conversation-chart__label"},Gu={class:"conversation-chart__bar-wrap"},Ru={class:"conversation-chart__value"},Yu=a.defineComponent({name:"ChartToolRenderer",__name:"ChartToolRenderer",props:{result:{}},setup(t){const A=t,e=a.computed(()=>{const o=i(A.result)?A.result:{},n=(Array.isArray(o.data)?o.data:[]).flatMap(C=>!i(C)||typeof C.label!="string"||typeof C.value!="number"?[]:[{label:C.label,value:C.value}]),I=Math.max(1,...n.map(C=>C.value));return{title:typeof o.title=="string"?o.title:"图表结果",rows:n,maxValue:I}});function g(o){return`${Math.max(0,Math.min(100,o/e.value.maxValue*100))}%`}function i(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}return(o,s)=>e.value.rows.length?(a.openBlock(),a.createElementBlock("section",{key:0,class:"conversation-chart","aria-label":e.value.title},[a.createElementVNode("strong",bu,a.toDisplayString(e.value.title),1),a.createElementVNode("div",vu,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(e.value.rows,n=>(a.openBlock(),a.createElementBlock("div",{key:n.label,class:"conversation-chart__row",role:"listitem"},[a.createElementVNode("span",Su,a.toDisplayString(n.label),1),a.createElementVNode("span",Gu,[a.createElementVNode("span",{class:"conversation-chart__bar",style:a.normalizeStyle({width:g(n.value)})},null,4)]),a.createElementVNode("span",Ru,a.toDisplayString(n.value),1)]))),128))])],8,Nu)):a.createCommentVNode("",!0)}}),n0=xA(Yu,[["__scopeId","data-v-db9fb284"]]),Ju={class:"conversation-code-result","aria-label":"代码执行结果"},Uu={key:0,class:"conversation-code-result__block"},Mu={class:"conversation-code-result__label"},xu={class:"conversation-code-result__code"},Lu={key:1,class:"conversation-code-result__block"},Hu={class:"conversation-code-result__label"},Ku={class:"conversation-code-result__code"},qu=a.defineComponent({name:"CodeToolRenderer",__name:"CodeToolRenderer",props:{toolCall:{},result:{}},setup(t){const A=t,e=a.computed(()=>C(A.result)?A.result:{}),g=a.computed(()=>I(e.value.language)??"text"),i=a.computed(()=>I(e.value.code)??n(A.toolCall.function.arguments)),o=a.computed(()=>I(e.value.output)??""),s=a.computed(()=>e.value.exitCode);function n(r){try{const B=JSON.parse(r);return C(B)?I(B.code)??"":""}catch{return""}}function I(r){return typeof r=="string"?r:void 0}function C(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}return(r,B)=>(a.openBlock(),a.createElementBlock("section",Ju,[i.value?(a.openBlock(),a.createElementBlock("div",Uu,[a.createElementVNode("span",Mu,a.toDisplayString(g.value),1),a.createElementVNode("pre",xu,[a.createElementVNode("code",null,a.toDisplayString(i.value),1)])])):a.createCommentVNode("",!0),o.value?(a.openBlock(),a.createElementBlock("div",Lu,[a.createElementVNode("span",Hu,"输出"+a.toDisplayString(s.value===void 0?"":` (${s.value})`),1),a.createElementVNode("pre",Ku,[a.createElementVNode("code",null,a.toDisplayString(o.value),1)])])):a.createCommentVNode("",!0)]))}}),I0=xA(qu,[["__scopeId","data-v-161409fc"]]),Tu={class:"conversation-mind-map","aria-label":"思维导图结果"},Zu={key:1,class:"conversation-mind-map__error",role:"alert"},oI=6,aI=80,Wu=a.defineComponent({name:"MindMapToolRenderer",__name:"MindMapToolRenderer",props:{result:{}},setup(t){const A=t,e=a.computed(()=>i(A.result)),g={name:"ai-conversation",background:"transparent",grid:{show:!1},nodeStyle:{colors:["var(--ai-conversation-code-bg)","var(--ai-conversation-tool-bg)","var(--ai-conversation-assistant-bg)"],textColor:"var(--ai-conversation-assistant-color)",borderColor:"var(--ai-conversation-tool-border)",borderWidth:1,borderRadius:6,fontSize:13,fontWeight:600},linkStyle:{color:"var(--ai-conversation-tool-running)",width:1.5,curve:"bezier",animated:!1}};function i(I){const C=n(I)?I:void 0,r=n(C==null?void 0:C.data)?C.data:C;if(!r||!n(r.nodeData))return o();let B=0;const c=new WeakSet;function l(h,d){if(!n(h)||c.has(h))return;if(d>oI)throw new Error(`思维导图最多支持 ${oI} 层。`);const u=s(h.id),p=s(h.topic);if(!u||!p||h.children!==void 0&&!Array.isArray(h.children))return;if(c.add(h),B+=1,B>aI)throw new Error(`思维导图最多支持 ${aI} 个节点。`);const b=[];for(const N of h.children??[]){const y=l(N,d+1);if(!y)return;b.push(y)}return{id:u,topic:p,root:d===1,expanded:typeof h.expanded=="boolean"?h.expanded:!0,...b.length?{children:b}:{}}}try{const h=l(r.nodeData,1);return h?{data:{nodeData:h}}:o()}catch(h){return{error:h instanceof Error?h.message:o().error}}}function o(){return{error:"无法显示思维导图:数据结构无效。"}}function s(I){return typeof I=="string"&&I.trim()?I.trim():void 0}function n(I){return typeof I=="object"&&I!==null&&!Array.isArray(I)}return(I,C)=>(a.openBlock(),a.createElementBlock("section",Tu,[e.value.data?(a.openBlock(),a.createBlock(xC,{key:0,data:e.value.data,theme:g,height:"18rem",readonly:"","show-toolbar":"","show-download":!1,"show-counts":!0,"toolbar-position":"bottom"},null,8,["data"])):(a.openBlock(),a.createElementBlock("p",Zu,a.toDisplayString(e.value.error),1))]))}}),C0=xA(Wu,[["__scopeId","data-v-42be305a"]]);/*!
|
|
513
513
|
* @kurkle/color v0.3.4
|
|
514
514
|
* https://github.com/kurkle/color#readme
|
|
515
515
|
* (c) 2024 Jukka Kurkela
|
package/dist/index.js
CHANGED
|
@@ -15457,15 +15457,15 @@ function Qu(t) {
|
|
|
15457
15457
|
return nu.sanitize(t, ru);
|
|
15458
15458
|
}
|
|
15459
15459
|
const Bu = /<table[\s\S]*?<\/table>/g;
|
|
15460
|
-
function lu(t
|
|
15461
|
-
const
|
|
15462
|
-
if (
|
|
15463
|
-
let
|
|
15464
|
-
for (
|
|
15465
|
-
const
|
|
15466
|
-
|
|
15460
|
+
function lu(t) {
|
|
15461
|
+
const A = [...t.matchAll(Bu)];
|
|
15462
|
+
if (A.length === 0) return t;
|
|
15463
|
+
let e = "", g = 0;
|
|
15464
|
+
for (const i of A) {
|
|
15465
|
+
const I = i[0], s = i.index, a = s + I.length;
|
|
15466
|
+
e += t.slice(g, s), e += `<div class="table-node-wrapper"><div class="table-node">${I}</div></div>`, g = a;
|
|
15467
15467
|
}
|
|
15468
|
-
return
|
|
15468
|
+
return e + t.slice(g);
|
|
15469
15469
|
}
|
|
15470
15470
|
const OI = gA(!1);
|
|
15471
15471
|
let Fi = null;
|
|
@@ -15513,7 +15513,7 @@ function fu(t, A = {}) {
|
|
|
15513
15513
|
if (!e) return [];
|
|
15514
15514
|
const { content: g, media: i } = du(e);
|
|
15515
15515
|
let I = Wc(g, { heal: A.streaming === !0 });
|
|
15516
|
-
I = uu(I), I = Qu(I), I = lu(I
|
|
15516
|
+
I = uu(I), I = Qu(I), I = lu(I), I = I.replace(/<p>\s*((?:%%media-\d+%%\s*)+)<\/p>/g, "$1");
|
|
15517
15517
|
const s = new Map(i.map((n) => [n.id, n])), a = I.split(/(%%media-\d+%%)/), o = [];
|
|
15518
15518
|
let C = 0;
|
|
15519
15519
|
for (const n of a) {
|
|
@@ -15711,7 +15711,7 @@ const wu = {
|
|
|
15711
15711
|
], 64))), 128))
|
|
15712
15712
|
], 2));
|
|
15713
15713
|
}
|
|
15714
|
-
}), vu = /* @__PURE__ */ zA(bu, [["__scopeId", "data-v-
|
|
15714
|
+
}), vu = /* @__PURE__ */ zA(bu, [["__scopeId", "data-v-6a17c994"]]), Gu = 8;
|
|
15715
15715
|
function Ru(t, A) {
|
|
15716
15716
|
const e = gA(t.value);
|
|
15717
15717
|
let g, i = !1;
|
|
@@ -15798,18 +15798,26 @@ const Su = ["open", "aria-busy"], Yu = ["aria-expanded", "aria-disabled"], Ju =
|
|
|
15798
15798
|
streaming: { type: Boolean }
|
|
15799
15799
|
},
|
|
15800
15800
|
setup(t) {
|
|
15801
|
-
const A = t, e = gA(!
|
|
15801
|
+
const A = t, e = gA(!0), g = gA(!1), i = gA(), I = gA(), { height: s } = d0(I, e), a = gA(0), o = gA(!1);
|
|
15802
15802
|
let C = 0, n;
|
|
15803
15803
|
const r = J(() => !!A.content.trim());
|
|
15804
15804
|
function l() {
|
|
15805
15805
|
r.value && (g.value = !0, e.value = !e.value);
|
|
15806
15806
|
}
|
|
15807
|
-
Re(
|
|
15808
|
-
|
|
15809
|
-
|
|
15807
|
+
Re(
|
|
15808
|
+
r,
|
|
15809
|
+
(D) => {
|
|
15810
|
+
if (!D) {
|
|
15811
|
+
e.value = !1, g.value = !1;
|
|
15812
|
+
return;
|
|
15813
|
+
}
|
|
15814
|
+
g.value || (e.value = !0);
|
|
15815
|
+
},
|
|
15816
|
+
{ immediate: !0 }
|
|
15817
|
+
), Re(
|
|
15810
15818
|
() => A.streaming,
|
|
15811
15819
|
(D) => {
|
|
15812
|
-
|
|
15820
|
+
D ? B() : E();
|
|
15813
15821
|
}
|
|
15814
15822
|
), Re(
|
|
15815
15823
|
() => A.content,
|
|
@@ -15892,7 +15900,7 @@ const Su = ["open", "aria-busy"], Yu = ["aria-expanded", "aria-disabled"], Ju =
|
|
|
15892
15900
|
], 4)) : nA("", !0)
|
|
15893
15901
|
], 10, Su));
|
|
15894
15902
|
}
|
|
15895
|
-
}), Uu = /* @__PURE__ */ zA(Ju, [["__scopeId", "data-v-
|
|
15903
|
+
}), Uu = /* @__PURE__ */ zA(Ju, [["__scopeId", "data-v-6eefa7f8"]]), Mu = ["aria-label"], xu = { class: "conversation-chart__title" }, Lu = {
|
|
15896
15904
|
class: "conversation-chart__rows",
|
|
15897
15905
|
role: "list"
|
|
15898
15906
|
}, Hu = { class: "conversation-chart__label" }, Ku = { class: "conversation-chart__bar-wrap" }, qu = { class: "conversation-chart__value" }, Tu = /* @__PURE__ */ ZA({
|