netstar-ai-chat 1.0.7 → 1.1.0

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.
Files changed (83) hide show
  1. package/dist/AgentChat/AIMessage.d.ts +35 -5
  2. package/dist/AgentChat/Langchain_py_AIMessage.d.ts +2 -2
  3. package/dist/AgentChat/index.vue.d.ts +1 -1
  4. package/dist/ChatPanel/AgentPicker.vue.d.ts +2 -2
  5. package/dist/ChatPanel/index.vue.d.ts +26 -26
  6. package/dist/{CodeBlockNode-CBF9Wys1.js → CodeBlockNode-Bl376Tuq.js} +1 -1
  7. package/dist/{CodeBlockNode-DAo61g1R.cjs → CodeBlockNode-C5YfkOd2.cjs} +1 -1
  8. package/dist/{_baseClone-2wT6lyYv.js → _baseClone-DfLe8fd9.js} +75 -75
  9. package/dist/_baseClone-DnuF78sx.cjs +1 -0
  10. package/dist/_baseUniq-Dcs-spTT.cjs +1 -0
  11. package/dist/{_baseUniq-5ISs7FiP.js → _baseUniq-DvIaM-Ll.js} +294 -262
  12. package/dist/{blockDiagram-677ZJIJ3-Cr9IXkty.cjs → blockDiagram-677ZJIJ3-CMnrPBRA.cjs} +1 -1
  13. package/dist/{blockDiagram-677ZJIJ3-D1rHhaps.js → blockDiagram-677ZJIJ3-RU9mFIp8.js} +1 -1
  14. package/dist/{chunk-EX3LRPZG-B9CLQvjn.js → chunk-EX3LRPZG-DsMgdRSQ.js} +1 -1
  15. package/dist/{chunk-EX3LRPZG-GvqDfUn1.cjs → chunk-EX3LRPZG-DtMEhuOI.cjs} +1 -1
  16. package/dist/{chunk-FWX5IMBZ-CUdXgrWK.js → chunk-FWX5IMBZ-CmuXQilW.js} +2 -2
  17. package/dist/{chunk-FWX5IMBZ-Cs_GPGXa.cjs → chunk-FWX5IMBZ-D1zxb7hX.cjs} +1 -1
  18. package/dist/{chunk-PUDLZKDR-t4VFI7Z_.js → chunk-PUDLZKDR-C38vl57g.js} +1 -1
  19. package/dist/{chunk-PUDLZKDR-BliZ2Xsv.cjs → chunk-PUDLZKDR-CW0NtNgG.cjs} +1 -1
  20. package/dist/{chunk-RYQCIY6F-DY6YO-ra.js → chunk-RYQCIY6F-BzgJphK3.js} +3 -3
  21. package/dist/{chunk-RYQCIY6F-DsaYljka.cjs → chunk-RYQCIY6F-TmRlMIef.cjs} +1 -1
  22. package/dist/{chunk-V7JOEXUC-DveVaknS.cjs → chunk-V7JOEXUC-BZ8tO4Um.cjs} +1 -1
  23. package/dist/{chunk-V7JOEXUC-D6hYwcFw.js → chunk-V7JOEXUC-BtPDQ29N.js} +1 -1
  24. package/dist/{classDiagram-OUVF2IWQ-DaxjCtMD.cjs → classDiagram-OUVF2IWQ-D5d3Ve3V.cjs} +1 -1
  25. package/dist/{classDiagram-OUVF2IWQ-BORBn8NL.js → classDiagram-OUVF2IWQ-fZsVI9E2.js} +2 -2
  26. package/dist/{classDiagram-v2-EOCWNBFH-CE1zoE2Y.js → classDiagram-v2-EOCWNBFH-C6kEwoL8.js} +2 -2
  27. package/dist/{classDiagram-v2-EOCWNBFH-DaxjCtMD.cjs → classDiagram-v2-EOCWNBFH-D5d3Ve3V.cjs} +1 -1
  28. package/dist/dagre-CXyc9XfZ.cjs +1 -0
  29. package/dist/{dagre-UOTTX-Ls.js → dagre-PTzdtelL.js} +529 -529
  30. package/dist/{dagre-VKFMJZFB-DZSgt7B5.js → dagre-VKFMJZFB-BTdSraA9.js} +3 -3
  31. package/dist/{dagre-VKFMJZFB-BKYyO16c.cjs → dagre-VKFMJZFB-Ctqi7MfW.cjs} +1 -1
  32. package/dist/{erDiagram-Q63AITRT-pfsYw052.cjs → erDiagram-Q63AITRT-Cn4JXzJb.cjs} +1 -1
  33. package/dist/{erDiagram-Q63AITRT-BgTTXKyk.js → erDiagram-Q63AITRT-oWnqBAPP.js} +1 -1
  34. package/dist/{exports-Duk5bF8U.js → exports-Dinh5Uav.js} +8 -8
  35. package/dist/{exports-arka-E9j.cjs → exports-DwEr4CaV.cjs} +2 -2
  36. package/dist/{find-BnPvj2ej.js → find-ClvQYvkR.js} +29 -29
  37. package/dist/find-x1vnFfLQ.cjs +1 -0
  38. package/dist/{flowDiagram-23GEKE2U-DlipvW4i.cjs → flowDiagram-23GEKE2U-BUXacWnP.cjs} +1 -1
  39. package/dist/{flowDiagram-23GEKE2U-Dzd1-nhI.js → flowDiagram-23GEKE2U-BaBY93fD.js} +2 -2
  40. package/dist/graphlib-DAeg7Jk0.cjs +1 -0
  41. package/dist/{graphlib-DNYwf2Q3.js → graphlib-k6k9Vm8G.js} +65 -97
  42. package/dist/index.cjs +93 -105
  43. package/dist/index.d.ts +1 -1
  44. package/dist/index.mjs +16955 -14622
  45. package/dist/{index2-B6bq_gT5.cjs → index2-CnmK_w-r.cjs} +1 -1
  46. package/dist/{index2-D0G_wi0X.js → index2-yTxzTVBu.js} +1 -1
  47. package/dist/{index3-zcICi2UD.cjs → index3-Cra8CIdH.cjs} +1 -1
  48. package/dist/{index3-B7VD0bp5.js → index3-DrxPRm5U.js} +1 -1
  49. package/dist/{index4-Bz-HXO_t.cjs → index4-CHF714Fw.cjs} +1 -1
  50. package/dist/{index4-DP46yPWR.js → index4-ppvoYsGN.js} +1 -1
  51. package/dist/{index5-DvsLxpPM.cjs → index5-BKQ2Amnn.cjs} +1 -1
  52. package/dist/{index5-DKkNi-Gi.js → index5-DzVNhT7a.js} +1 -1
  53. package/dist/{index6-uf4qLQF-.js → index6-8EbawCUX.js} +1 -1
  54. package/dist/{index6-9652i-rR.cjs → index6-CBReBKoT.cjs} +1 -1
  55. package/dist/{index7-DMt42BW9.js → index7-C5MItTwA.js} +1 -1
  56. package/dist/index7-DEgfT5JF.cjs +1 -0
  57. package/dist/map-DjeO4fpf.js +15 -0
  58. package/dist/map-Z0MjoLCA.cjs +1 -0
  59. package/dist/{mermaid.core-BVdmq8G9.cjs → mermaid.core-OQ4AmR9-.cjs} +2 -2
  60. package/dist/{mermaid.core-0mKBU1f3.js → mermaid.core-qeaVmjNi.js} +13 -13
  61. package/dist/{mindmap-definition-LN4V7U3C-CQE_XUtS.js → mindmap-definition-LN4V7U3C-3kHBPRaO.js} +1 -1
  62. package/dist/{mindmap-definition-LN4V7U3C-BNu--kki.cjs → mindmap-definition-LN4V7U3C-BPRHfBFx.cjs} +1 -1
  63. package/dist/{requirementDiagram-TGXJPOKE-CRqEhMHO.cjs → requirementDiagram-TGXJPOKE-BYbIrtTk.cjs} +1 -1
  64. package/dist/{requirementDiagram-TGXJPOKE-DAJtmGPP.js → requirementDiagram-TGXJPOKE-CgkIyDji.js} +1 -1
  65. package/dist/{stateDiagram-2N3HPSRC-Dn8hU81H.cjs → stateDiagram-2N3HPSRC-C-LgZZWO.cjs} +1 -1
  66. package/dist/{stateDiagram-2N3HPSRC-Bww_UKIU.js → stateDiagram-2N3HPSRC-DE5rAPBU.js} +4 -4
  67. package/dist/{stateDiagram-v2-6OUMAXLB-BwE9fK3n.cjs → stateDiagram-v2-6OUMAXLB-BCQHyE7c.cjs} +1 -1
  68. package/dist/{stateDiagram-v2-6OUMAXLB-C2R_9_Uv.js → stateDiagram-v2-6OUMAXLB-DkIz3RiF.js} +2 -2
  69. package/dist/style.css +1 -1
  70. package/dist/{swimlanes-5IMT3BWC-WMV2md8F.js → swimlanes-5IMT3BWC-60brIBR8.js} +2 -2
  71. package/dist/{swimlanes-5IMT3BWC-C7NFa2wg.cjs → swimlanes-5IMT3BWC-CtACnTwN.cjs} +1 -1
  72. package/dist/{swimlanesDiagram-G3AALYLV-CsuSDnWf.cjs → swimlanesDiagram-G3AALYLV-D0jwQqk6.cjs} +1 -1
  73. package/dist/{swimlanesDiagram-G3AALYLV-XwNa4ZI_.js → swimlanesDiagram-G3AALYLV-DH4TYPXG.js} +2 -2
  74. package/dist/types/agent.d.ts +33 -3
  75. package/package.json +1 -1
  76. package/dist/_baseClone-DP4oIZ9B.cjs +0 -1
  77. package/dist/_baseUniq-D0NfTM7s.cjs +0 -1
  78. package/dist/dagre-CqPF1PeH.cjs +0 -1
  79. package/dist/find-CdmKt8F2.cjs +0 -1
  80. package/dist/graphlib-DGcxpOxW.cjs +0 -1
  81. package/dist/index7-DOS0ydZt.cjs +0 -1
  82. package/dist/map-DYVGVxPK.js +0 -16
  83. package/dist/map-Iz5EK08G.cjs +0 -1
@@ -44,8 +44,7 @@ export interface ToolCallEvent {
44
44
  /** 工具名称(程序标识符) */
45
45
  toolName: string;
46
46
  }
47
- /**
48
- * 连续文本段,指向宿主消息 `content` 的字符区间 `[start, end)`.
47
+ /** 连续文本段,指向宿主消息 `content` 的字符区间 `[start, end)`.
49
48
  * `end === -1` 表示延伸到 `content` 末尾(流式尚未结束时使用)。
50
49
  */
51
50
  export interface TextSegment {
@@ -60,8 +59,28 @@ export interface ToolSegment {
60
59
  toolCallId: string;
61
60
  type: 'tool';
62
61
  }
63
- /** 消息内容段(文本段 | 工具调用段) */
64
- export type ContentSegment = TextSegment | ToolSegment;
62
+ /** 单个附件信息 */
63
+ export interface AttachmentItem {
64
+ /** 附件唯一 ID(上传后由后端返回) */
65
+ id: string;
66
+ /** 文件名(含扩展名) */
67
+ name: string;
68
+ /** 文件大小(字节) */
69
+ size: number;
70
+ /** 文件 MIME 类型 */
71
+ type: string;
72
+ /** 可访问的预览/下载 URL(可选) */
73
+ url?: string;
74
+ }
75
+ /** 附件上传状态 */
76
+ export type AttachmentStatus = 'done' | 'error' | 'uploading';
77
+ /** 附件内容段,描述消息中携带的附件集合 */
78
+ export interface AttachmentSegment {
79
+ attachments: AttachmentItem[];
80
+ type: 'attachment';
81
+ }
82
+ /** 消息内容段(文本段 | 工具调用段 | 附件段) */
83
+ export type ContentSegment = AttachmentSegment | TextSegment | ToolSegment;
65
84
  /**
66
85
  * 工具调用时间线中的单条记录。
67
86
  * 由原始 ToolCallEvent 整合而来,包含截断后的预览字符串,
@@ -146,8 +165,13 @@ export interface ResolvedToolSegment {
146
165
  toolCallId: string;
147
166
  type: 'tool';
148
167
  }
168
+ /** 已解析的附件渲染段 */
169
+ export interface ResolvedAttachmentSegment {
170
+ attachments: AttachmentItem[];
171
+ type: 'attachment';
172
+ }
149
173
  /** 可直接供模板 v-for 消费的渲染段联合类型 */
150
- export type ResolvedSegment = ResolvedTextSegment | ResolvedToolSegment;
174
+ export type ResolvedSegment = ResolvedAttachmentSegment | ResolvedTextSegment | ResolvedToolSegment;
151
175
  /**
152
176
  * 历史会话摘要条目,用于侧边栏列表展示。
153
177
  * 与具体后端(Dify / 自研)无关,由 Agent 层负责适配。
@@ -307,6 +331,12 @@ export interface AgentRuntime {
307
331
  * 未实现时默认视为不支持历史功能。
308
332
  */
309
333
  supportsHistory?(): boolean;
334
+ /**
335
+ * 上传附件文件(可选)。
336
+ * 当实现方不支持附件功能时,返回 `undefined` 或抛出错误。
337
+ * @returns 上传后的附件信息(含后端返回的 ID)
338
+ */
339
+ uploadFile?(file: File): Promise<AttachmentItem>;
310
340
  }
311
341
  /**
312
342
  * 携带初始上下文注入能力的扩展 Agent 接口(可选实现)。
@@ -1,4 +1,4 @@
1
- import { ChatMessage, ConversationListResult, ExtendedAgentRuntime } from './AIMessage';
1
+ import { AttachmentItem, ChatMessage, ConversationListResult, ExtendedAgentRuntime } from './AIMessage';
2
2
  import { ResumeDecision } from './LangchainMessage';
3
3
  import { default as EventEmitter } from '../utils/EventEmitter';
4
4
 
@@ -81,7 +81,7 @@ export declare class Langchain_py_AIMessage extends EventEmitter implements Exte
81
81
  private user;
82
82
  constructor({ endpoint, historyEndpoint, resumeEndpoint, user, app, initialUserContexts, mode, resumeMode, requestHeaders, prepareRequestBody, }: Langchain_py_AIMessageOptions);
83
83
  addInitialUserContext(context: string): void;
84
- ask(query: string): Promise<void>;
84
+ ask(query: string, attachments?: AttachmentItem[]): Promise<void>;
85
85
  clearInitialUserContexts(): void;
86
86
  /**
87
87
  * 删除指定会话的所有 checkpoint 记录。
@@ -73,8 +73,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
73
73
  "onUpdate:agentKey"?: ((key: string) => any) | undefined;
74
74
  }>, {
75
75
  title: string;
76
- emptyHint: string;
77
76
  agentKey: string;
77
+ emptyHint: string;
78
78
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
79
79
  export default _default;
80
80
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,6 +1,6 @@
1
1
  import { AgentOption } from '../types/agent';
2
2
 
3
- /** 自定义代理人配置(保存到 localStorage) */
3
+ /** 自定义智能体配置(保存到 localStorage) */
4
4
  export interface CustomAgentConfig {
5
5
  apiBaseUrl?: string;
6
6
  apiKey?: string;
@@ -16,7 +16,7 @@ export interface CustomAgentConfig {
16
16
  user?: string;
17
17
  }
18
18
  interface Props {
19
- /** 代码中内置的代理人列表,不可删除 */
19
+ /** 代码中内置的智能体列表,不可删除 */
20
20
  builtInAgents: AgentOption[];
21
21
  /** 是否禁用选择器 */
22
22
  disabled?: boolean;
@@ -5,38 +5,38 @@ type AnyRecord = Record<string, any>;
5
5
  /** @deprecated 请使用 ChatMessage,此别名保留以兼容存量代码 */
6
6
  export type BubbleMsg = ChatMessage;
7
7
  interface Props {
8
- /** 标题 */
9
- title?: string;
10
- /** 副标题 */
11
- subtitle?: string;
12
- /** 消息列表为空时的提示文字 */
13
- emptyHint?: string;
14
- /** 可选 Agent 列表 */
15
- agents: AgentOption[];
16
8
  /** 当前 Agent(v-model:agentKey) */
17
9
  agentKey?: string;
18
10
  /** AgentPicker localStorage 存储键前缀(用于多实例隔离) */
19
11
  agentPickerStorageKey?: string;
20
- /** BubbleList roles */
21
- roles: AnyRecord;
22
- /** 输入框内容 (v-model) */
23
- modelValue?: string;
24
- /** 传给 StreamMarkdown 的自定义 HTML 标签白名单 */
25
- customHtmlTags?: readonly string[];
12
+ /** 可选 Agent 列表 */
13
+ agents: AgentOption[];
26
14
  /** 传给 StreamMarkdown 的自定义组件映射 */
27
15
  customComponents?: MarkdownCustomComponentMap;
28
- /** 当前会话 key,变化时重置内部消息列表 */
29
- sessionKey?: string;
30
- /** 初始历史消息 */
31
- initialMessages?: ChatMessage[];
32
- /** 透传 Agent 运行时事件给上层 */
33
- onAgentEvent?: AgentEventCallback;
16
+ /** 传给 StreamMarkdown 的自定义 HTML 标签白名单 */
17
+ customHtmlTags?: readonly string[];
34
18
  /**
35
19
  * 默认工具渲染 map(全局兜底,对所有 Agent 生效)。
36
20
  * Agent 自身的 `toolRenderers` 优先级更高,未覆盖的工具名才会走此 map,
37
21
  * 两者均未命中时最终回退到内置 `ToolCallNode`。
38
22
  */
39
23
  defaultToolRenderers?: ToolRendererMap;
24
+ /** 消息列表为空时的提示文字 */
25
+ emptyHint?: string;
26
+ /** 初始历史消息 */
27
+ initialMessages?: ChatMessage[];
28
+ /** 输入框内容 (v-model) */
29
+ modelValue?: string;
30
+ /** 透传 Agent 运行时事件给上层 */
31
+ onAgentEvent?: AgentEventCallback;
32
+ /** BubbleList roles */
33
+ roles: AnyRecord;
34
+ /** 当前会话 key,变化时重置内部消息列表 */
35
+ sessionKey?: string;
36
+ /** 副标题 */
37
+ subtitle?: string;
38
+ /** 标题 */
39
+ title?: string;
40
40
  }
41
41
  declare function __VLS_template(): {
42
42
  "header-actions"?(_: {}): any;
@@ -73,23 +73,23 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
73
73
  initialMessages: () => never[];
74
74
  defaultToolRenderers: () => ToolRendererMap;
75
75
  }>>> & Readonly<{
76
- "onUpdate:agents"?: ((value: AgentOption[]) => any) | undefined;
77
- onReset?: (() => any) | undefined;
78
76
  onSubmit?: ((value?: string | undefined, agentKey?: string | undefined) => any) | undefined;
77
+ onReset?: (() => any) | undefined;
79
78
  onCancel?: (() => any) | undefined;
79
+ "onUpdate:agents"?: ((value: AgentOption[]) => any) | undefined;
80
80
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
81
81
  "onUpdate:agentKey"?: ((value: string) => any) | undefined;
82
82
  onAgentChange?: ((value: string) => any) | undefined;
83
83
  }>, {
84
84
  title: string;
85
- subtitle: string;
86
- emptyHint: string;
87
85
  agentKey: string;
88
86
  agentPickerStorageKey: string;
87
+ defaultToolRenderers: ToolRendererMap;
88
+ emptyHint: string;
89
+ initialMessages: ChatMessage[];
89
90
  modelValue: string;
90
91
  sessionKey: string;
91
- initialMessages: ChatMessage[];
92
- defaultToolRenderers: ToolRendererMap;
92
+ subtitle: string;
93
93
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
94
94
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
95
95
  export default _default;
@@ -1,4 +1,4 @@
1
- import { C as e, D as t, E as n, O as r, T as i, a, b as o, d as s, h as ee, m as c, n as te, r as l, s as u, y as ne } from "./exports-Duk5bF8U.js";
1
+ import { C as e, D as t, E as n, O as r, T as i, a, b as o, d as s, h as ee, m as c, n as te, r as l, s as u, y as ne } from "./exports-Dinh5Uav.js";
2
2
  import { Fragment as re, Teleport as ie, computed as d, createBlock as ae, createCommentVNode as f, createElementBlock as p, createElementVNode as m, defineComponent as h, getCurrentInstance as oe, nextTick as se, normalizeClass as g, normalizeStyle as ce, onBeforeUnmount as le, onMounted as ue, onUnmounted as de, openBlock as _, ref as v, renderSlot as fe, toDisplayString as pe, unref as y, vShow as me, watch as b, withDirectives as he, withModifiers as ge } from "vue";
3
3
  //#region ../../node_modules/.pnpm/markstream-vue@0.0.10_katex@0.16.47_mermaid@11.16.0_shiki@2.5.0_stream-markdown@0.0.16__933418433302c8f1097502413881496d/node_modules/markstream-vue/dist/CodeBlockNode.js
4
4
  var _e = Object.defineProperty, x = Object.defineProperties, S = Object.getOwnPropertyDescriptors, ve = Object.getOwnPropertySymbols, C = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable, T = (e, t, n) => t in e ? _e(e, t, {
@@ -1 +1 @@
1
- const e=require("./exports-arka-E9j.cjs");let t=require("vue");var n=Object.defineProperty,r=Object.defineProperties,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,c=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t)=>{for(var n in t||={})o.call(t,n)&&c(e,n,t[n]);if(a)for(var n of a(t))s.call(t,n)&&c(e,n,t[n]);return e},u=(e,t)=>r(e,i(t)),d=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),f={class:`markstream-vue`},p={class:`html-preview-frame__header`},m={class:`html-preview-frame__title`},h={class:`html-preview-frame__label`},g=[`srcdoc`],ee=e.E((0,t.defineComponent)({__name:`HtmlPreviewFrame`,props:{code:{},isDark:{type:Boolean},onClose:{type:Function},title:{}},setup(n){let r=n,{t:i}=e.T(),a=(0,t.computed)(()=>{let e=r.code||``,t=e.trim().toLowerCase();return t.startsWith(`<!doctype`)||t.startsWith(`<html`)||t.startsWith(`<body`)?e:`<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n background-color: ${r.isDark?`#020617`:`#ffffff`};\n color: ${r.isDark?`#e5e7eb`:`#020617`};\n }\n body {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;\n }\n </style>\n </head>\n <body>\n ${e}\n </body>\n</html>`});function o(e){var t;e.key!==`Escape`&&e.key!==`Esc`||(t=r.onClose)==null||t.call(r)}return(0,t.onMounted)(()=>{typeof window<`u`&&window.addEventListener(`keydown`,o)}),(0,t.onUnmounted)(()=>{typeof window<`u`&&window.removeEventListener(`keydown`,o)}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[(0,t.createElementVNode)(`div`,f,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`html-preview-frame__backdrop`,{"html-preview-frame__backdrop--dark":r.isDark}]),onClick:n[2]||=e=>r.onClose?.call(r)},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`html-preview-frame`,{"html-preview-frame--dark":r.isDark}]),onClick:n[1]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,p,[(0,t.createElementVNode)(`div`,m,[n[3]||=(0,t.createElementVNode)(`span`,{class:`html-preview-frame__dot`},null,-1),(0,t.createElementVNode)(`span`,h,(0,t.toDisplayString)(r.title||(0,t.unref)(i)(`common.preview`)||`Preview`),1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`html-preview-frame__close`,{"html-preview-frame__close--dark":r.isDark}]),onClick:n[0]||=e=>r.onClose?.call(r)},` × `,2)]),(0,t.createElementVNode)(`iframe`,{class:`html-preview-frame__iframe`,sandbox:`allow-scripts allow-same-origin`,srcdoc:a.value},null,8,g)],2)],2)])]))}}),[[`__scopeId`,`data-v-296dd89d`]]),_=null,te=null,v=null,y=null,ne=null,re=null,ie=new WeakMap,ae=0,oe=[`data-markstream-enhanced`],se={class:`code-header-main`},ce=[`innerHTML`],le={class:`code-header-copy`},ue={class:`code-header-title`},de={key:0,class:`code-header-caption`},fe={class:`code-header-actions`},pe=[`aria-label`],me={class:`code-diff-stat removed`},he={class:`code-diff-stat added`},ge=[`aria-pressed`],_e=[`disabled`],ve=[`disabled`],ye=[`disabled`],be=[`aria-label`],xe={key:0,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},Se={key:1,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},Ce=[`aria-pressed`],we={key:0,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},Te={key:1,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},Ee=[`aria-label`],De={class:`code-editor-layer`},Oe={class:`sr-only`,"aria-live":`polite`,role:`status`},ke=`__markstreamMonacoPassiveTouch__`,Ae=e.E((0,t.defineComponent)({__name:`CodeBlockNode`,props:{node:{},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:`vitesse-dark`},lightTheme:{default:`vitesse-light`},isShowPreview:{type:Boolean,default:!0},monacoOptions:{},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},customId:{},estimatedHeightPx:{},estimatedContentHeightPx:{}},emits:[`previewCode`,`copy`],setup(n,{emit:r}){let i=n,a=r,o=(0,t.getCurrentInstance)(),s=(0,t.computed)(()=>{let e=o?.vnode.props;return!(!e||!e.onPreviewCode&&!e.onPreviewCode)}),{t:c}=e.T(),f=(0,t.ref)(null),p=(0,t.ref)(null),m=(0,t.ref)(!1),h=(0,t.ref)(e.r(i.node.language)),g=(0,t.computed)(()=>e.a(h.value)),Ae=(0,t.computed)(()=>g.value===`plaintext`),b=(0,t.ref)(!1),x=(0,t.ref)(!1),S=(0,t.ref)(!1),C=(0,t.ref)(!1),je=(0,t.ref)(!1),w=!1,T=null,E=(0,t.ref)(null),Me=0,Ne=e.y(),D=(0,t.ref)(null),O=(0,t.ref)(typeof window>`u`);typeof window<`u`&&(0,t.watch)(()=>p.value,e=>{var t;if((t=D.value)==null||t.destroy(),D.value=null,!e)return void(O.value=!1);let n=Ne(e,{rootMargin:`400px`});D.value=n,O.value=n.isVisible.value,n.whenVisible.then(()=>{O.value=!0})},{immediate:!0}),(0,t.onBeforeUnmount)(()=>{var e;w=!0,(e=D.value)==null||e.destroy(),D.value=null});let k=null,Pe=null,Fe=()=>{},Ie=()=>{},Le=()=>null,A=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),j=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),Re=()=>{},M=()=>{},ze=()=>{},N=null,Be=()=>String(i.node.language??`plaintext`),Ve=()=>d(null,null,function*(){}),P=[],He=[],F=null,I=(0,t.computed)(()=>i.node.diff),L=(0,t.ref)({removed:0,added:0}),Ue=(0,t.computed)(()=>`-${L.value.removed} +${L.value.added}`),We=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function Ge(e){var t;if(typeof e==`boolean`)return e;if(e&&typeof e==`object`){let n=e;return u(l(l({},We),n),{enabled:(t=n.enabled)==null||t})}return l({},We)}let R=(0,t.computed)(()=>{let e=i.monacoOptions?l({},i.monacoOptions):{};if(!I.value)return e;let t=e.diffHideUnchangedRegions===void 0?l({},We):Ge(e.diffHideUnchangedRegions),n=e.hideUnchangedRegions===void 0?void 0:Ge(e.hideUnchangedRegions),r=e.diffUnchangedRegionStyle??`line-info`;return u(l(l(l({},{maxComputationTime:0,diffAlgorithm:`legacy`,ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:`none`,renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:`off`,matchBrackets:`never`,lineDecorationsWidth:12,lineNumbersMinChars:2,glyphMargin:!1,fontSize:13,lineHeight:30,renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,padding:{top:10,bottom:r===`line-info`||r===`line-info-basic`||r===`metadata`?22:14},diffHideUnchangedRegions:t,diffLineStyle:`background`,diffAppearance:`auto`,diffUnchangedRegionStyle:r,diffHunkActionsOnHover:!0,diffHunkHoverHideDelayMs:160}),e),n===void 0?{}:{hideUnchangedRegions:n}),{diffHideUnchangedRegions:t})}),Ke=(0,t.computed)(()=>I.value?`diff`:`single`),qe=(0,t.ref)(Ke.value),z=(0,t.ref)(!1),Je=(0,t.computed)(()=>{let e=i.monacoOptions?.wordWrap;return e==null||String(e)!==`off`}),Ye=(0,t.computed)(()=>!z.value&&!C.value),Xe=(0,t.ref)(!1);typeof window<`u`&&d(null,null,function*(){try{let t=yield e.D();if(w)return;if(!t)return void(z.value=!0);let n=t.useMonaco,r=t.detectLanguage;if(typeof r==`function`&&(Be=r),typeof n==`function`){let e=Nt();if(e&&i.themes&&Array.isArray(i.themes)&&!i.themes.includes(e))throw Error(`Preferred theme not in provided themes array`);F=Lt();let t=n(F);k=t.createEditor||k,Pe=t.createDiffEditor||Pe,Fe=t.updateCode||Fe,Ie=t.updateDiff||Ie,Le=t.getEditor||Le,A=t.getEditorView||A,j=t.getDiffEditorView||j,Re=t.cleanupEditor||Re,M=t.safeClean||t.cleanupEditor||M,ze=t.refreshDiffPresentation||ze,Ve=t.setTheme||Ve,je.value=!0,!w&&f.value&&(yield $(f.value))}}catch{if(w)return;z.value=!0}});let B=(0,t.ref)(typeof i.monacoOptions?.fontSize==`number`?i.monacoOptions.fontSize:NaN),V=(0,t.ref)(B.value),Ze=(0,t.computed)(()=>{let e=B.value,t=V.value;return typeof e==`number`&&Number.isFinite(e)&&e>0&&typeof t==`number`&&Number.isFinite(t)&&t>0}),Qe=(0,t.computed)(()=>{let e=i.monacoOptions?.fontSize;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e;let t=V.value;return typeof t==`number`&&Number.isFinite(t)&&t>0?t:12}),$e=(0,t.computed)(()=>{let e=i.monacoOptions?.lineHeight;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:Math.round(1.5*Qe.value)}),et=(0,t.computed)(()=>{let e=i.monacoOptions?.tabSize;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:4}),H=(0,t.computed)(()=>{let e=i.estimatedContentHeightPx;return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.round(e):null}),tt=(0,t.computed)(()=>{let e=i.monacoOptions?.fontFamily;return l(l({fontSize:`${Qe.value}px`,lineHeight:`${$e.value}px`,tabSize:et.value},H.value==null?{}:{minHeight:`${H.value}px`}),typeof e==`string`&&e.trim()?{"--markstream-code-font-family":e.trim()}:{})}),nt=(0,t.computed)(()=>H.value!=null&&!C.value),rt=(0,t.computed)(()=>{if(nt.value)return{minHeight:`${H.value}px`}}),it=(0,t.computed)(()=>{if(H.value!=null)return{minHeight:`${H.value}px`}});function at(){var e;try{let t=I.value?((e=j())?.getModifiedEditor)?.call(e)??j():A(),n=Le()?.EditorOption?.fontInfo;if(t&&n!=null){let e=t.getOption?.call(t,n)?.fontSize;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e}}catch{}try{let e=f.value;if(e){let t=e.querySelector(`.view-lines .view-line`);if(t)try{if(typeof window<`u`&&typeof window.getComputedStyle==`function`){let e=window.getComputedStyle(t).fontSize,n=e&&e.match(/^(\d+(?:\.\d+)?)/);if(n)return Number.parseFloat(n[1])}}catch{}}}catch{}return null}function ot(e){try{let t=Le()?.EditorOption?.lineHeight;if(t!=null){let n=(e?.getOption)?.call(e,t);if(typeof n==`number`&&n>0)return n}}catch{}let t=function(){try{let e=f.value;if(!e)return null;let t=e.querySelector(`.view-lines .view-line`);if(t){let e=Math.ceil(t.getBoundingClientRect().height);if(e>0)return e}}catch{}return null}();if(t&&t>0)return t;let n=Number.isFinite(V.value)&&V.value>0?V.value:12;return Math.max(12,Math.round(1.35*n))}function st(e,t){return typeof e!=`number`||typeof t!=`number`||e<1||t<e?0:t-e+1}function ct(e){if(!e)return[];let t=e.split(/\r?\n/);return t.length===1&&t[0]===``?[]:t}function lt(){I.value?L.value=function(e,t){let n=ct(e),r=ct(t),i=0,a=n.length-1,o=r.length-1;for(;i<=a&&i<=o&&n[i]===r[i];)i++;for(;a>=i&&o>=i&&n[a]===r[o];)a--,o--;return{removed:Math.max(0,a-i+1),added:Math.max(0,o-i+1)}}(String(i.node.originalCode??``),String(i.node.updatedCode??``)):L.value={removed:0,added:0}}function ut(){if(I.value)try{let e=j(),t=(e?.getLineChanges)?.call(e);if(!Array.isArray(t))return void lt();let n=0,r=0;for(let e of t)n+=st(e.originalStartLineNumber,e.originalEndLineNumber),r+=st(e.modifiedStartLineNumber,e.modifiedEndLineNumber);L.value={removed:n,added:r}}catch{lt()}else L.value={removed:0,added:0}}function dt(){if(Number.isFinite(V.value)&&V.value>0&&Number.isFinite(B.value))return V.value;let e=at();return typeof i.monacoOptions?.fontSize==`number`?(B.value=i.monacoOptions.fontSize,V.value=i.monacoOptions.fontSize,V.value):e&&e>0?(B.value=e,V.value=e,e):(B.value=12,V.value=12,12)}function ft(){var e,t,n,r,i;try{let a=I.value?j():null,o=I.value?a:A();if(!o)return null;if(a?.getOriginalEditor&&a?.getModifiedEditor){let i=a.getOriginalEditor?.call(a),o=a.getModifiedEditor?.call(a);(e=i?.layout)==null||e.call(i),(t=o?.layout)==null||t.call(o);let s=(i?.getContentHeight)?.call(i)||0,c=(o?.getContentHeight)?.call(o)||0,l=Math.max(s,c);if(l>0)return Math.ceil(l+1);let u=((n=(i?.getModel)?.call(i))?.getLineCount)?.call(n)||1,d=((r=(o?.getModel)?.call(o))?.getLineCount)?.call(r)||1,f=Math.max(u,d),p=Math.max(ot(i),ot(o));return Math.ceil(f*(p+1.5)+0+1)}if(o?.getContentHeight){(i=o?.layout)==null||i.call(o);let e=o.getContentHeight();if(e>0)return Math.ceil(e+1)}let s=(o?.getModel)?.call(o),c=1;s&&typeof s.getLineCount==`function`&&(c=s.getLineCount());let l=ot(o);return Math.ceil(c*(l+1.5)+0+1)}catch{return null}}function pt(e){let t=String(e??``).match(/\d+(?:\.\d+)?/g);if(!t||t.length<3)return null;let[n,r,i]=t.slice(0,3).map(Number);return .2126*n+.7152*r+.0722*i}function mt(){let e=f.value,t=p.value;if(!e||!t)return;if(I.value)return t.style.removeProperty(`--vscode-editor-foreground`),t.style.removeProperty(`--vscode-editor-background`),void t.style.removeProperty(`--vscode-editor-selectionBackground`);let n=e.querySelector(`.monaco-editor`)||e,r=n.querySelector(`.monaco-editor-background`)||n,i=n.querySelector(`.view-lines`)||n,a=null,o=null,s=null;try{typeof window<`u`&&typeof window.getComputedStyle==`function`&&(a=window.getComputedStyle(n),o=r===n?a:window.getComputedStyle(r),s=i===n?a:window.getComputedStyle(i))}catch{a=null,o=null,s=null}let c=String(a?.getPropertyValue(`--vscode-editor-foreground`)??``).trim(),l=String(a?.getPropertyValue(`--vscode-editor-background`)??``).trim(),u=String(a?.getPropertyValue(`--vscode-editor-selectionBackground`)??a?.getPropertyValue(`--vscode-editor-hoverHighlightBackground`)??``).trim(),d=c||String(s?.color??a?.color??``).trim(),m=l||String(o?.backgroundColor??a?.backgroundColor??``).trim();if(function(e,t,n){if(!Ae.value)return!1;let r=pt(e),i=pt(t);return n?r!=null&&r>170||i!=null&&i<110:r!=null&&r<85||i!=null&&i>190}(m,d,t.classList.contains(`is-dark`)))return t.style.removeProperty(`--vscode-editor-foreground`),t.style.removeProperty(`--vscode-editor-background`),void t.style.removeProperty(`--vscode-editor-selectionBackground`);d&&t.style.setProperty(`--vscode-editor-foreground`,d),m&&t.style.setProperty(`--vscode-editor-background`,m),u&&t.style.setProperty(`--vscode-editor-selectionBackground`,u)}let ht=/auto|scroll|overlay/i;function U(e,t,n){if(typeof window>`u`)return;let r=Math.ceil(n)-Math.ceil(t);if(!r)return;let i=function(e){if(typeof window>`u`)return null;let t=e?.ownerDocument??document,n=t.scrollingElement||t.documentElement||t.body,r=e?.parentElement??null;for(;r&&r!==t.body&&r!==n;){let e=window.getComputedStyle(r),t=(e.overflowY||``).toLowerCase(),n=(e.overflow||``).toLowerCase();if(ht.test(t)||ht.test(n))return r;r=r.parentElement}return n}(e);if(!i)return;let a=e.ownerDocument??document,o=i===a.body||i===a.documentElement||i===a.scrollingElement,s=o?0:i.getBoundingClientRect().top;e.getBoundingClientRect().top-s>=0||(o&&typeof window.scrollBy==`function`?window.scrollBy(0,r):i.scrollTop+=r)}function W(){try{let e=f.value;if(!e)return;let t=e.getBoundingClientRect().height,n=ft();if(n!=null&&n>0){let r=Math.ceil(n);e.style.minHeight=`0px`,e.style.height=`${r}px`,e.style.maxHeight=`none`,e.style.overflow=`visible`,U(e,t,r)}}catch{}}function G(){for(var t,n;P.length>0;)try{(n=(t=P.pop())?.dispose)==null||n.call(t)}catch{}T!=null&&(e.s(T),T=null)}function K(){for(var e;He.length>0;)try{(e=He.pop())==null||e()}catch{}}function gt(){if(K(),!I.value)return;let e=f.value;if(!e)return;let t=e.querySelector(`.monaco-diff-editor`);if(!t||t.classList.contains(`side-by-side`))return;let n=Array.from(t.querySelectorAll(`.editor.original .diff-hidden-lines`)),r=Array.from(t.querySelectorAll(`.editor.modified .diff-hidden-lines`)),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e],i=r[e].querySelector(`a`),a=t.querySelector(`.center > div:first-child`);if(!i||!a)continue;let o=document.createElement(`button`);o.type=`button`,o.className=`markstream-inline-fold-proxy`;let s=i.getAttribute(`title`)||`Show Unchanged Region`;o.title=s,o.setAttribute(`aria-label`,s);let c=i.querySelector(`.codicon`),l=document.createElement(`span`);l.className=c?.className||`codicon codicon-unfold`,o.append(l);let u=e=>{e.preventDefault(),e.stopPropagation()},d=e=>{e.preventDefault(),e.stopPropagation(),i.click()},f=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),e.stopPropagation(),i.click())};o.addEventListener(`mousedown`,u),o.addEventListener(`click`,d),o.addEventListener(`keydown`,f),a.replaceChildren(o),He.push(()=>{o.removeEventListener(`mousedown`,u),o.removeEventListener(`click`,d),o.removeEventListener(`keydown`,f),a.contains(o)&&a.replaceChildren()})}}function q(){T??=e.O(()=>{T=null,e.O(()=>{gt(),x.value||(b.value?W():Y())})})}function J(e,t,n){let r=Math.min(t,n),i=t>n+1;return e.style.minHeight=`0px`,e.style.height=`${Math.ceil(r)}px`,e.style.maxHeight=`${Math.ceil(n)}px`,e.style.overflow=i?`auto`:`hidden`,Math.ceil(r)}function Y(){try{let e=f.value;if(!e)return;let t=e.getBoundingClientRect().height,n=function(){let e=i.monacoOptions?.MAX_HEIGHT??500;if(typeof e==`number`)return e;let t=String(e).match(/^(\d+(?:\.\d+)?)/);return t?Number.parseFloat(t[1]):500}();if(Me>0&&(Me--,E.value!=null))return void U(e,t,J(e,E.value,n));let r=ft();if(r!=null&&r>0)return void U(e,t,J(e,r,n));if(E.value!=null)return void U(e,t,J(e,E.value,n));let a=Math.ceil(e.getBoundingClientRect?.call(e).height||0);if(a>0)return void U(e,t,J(e,a,n));let o=Number.parseFloat(e.style.height);!Number.isNaN(o)&&o>0?U(e,t,J(e,o,n)):U(e,t,J(e,n,n))}catch{}}let _t=(0,t.computed)(()=>i.isShowPreview&&(h.value===`html`||h.value===`svg`));(0,t.watch)(()=>i.node.language,t=>{h.value=e.r(t)}),(0,t.watch)(()=>[i.node.originalCode,i.node.updatedCode,I.value],()=>{lt(),e.O(()=>ut())},{immediate:!0}),(0,t.watch)(()=>[i.node.originalCode,i.node.updatedCode,g.value,I.value],t=>d(null,[t],function*([t,n,r,a]){if(!1!==i.stream&&a){if(k&&!S.value&&f.value)try{yield $(f.value)}catch{}Ie(String(t??``),String(n??``),g.value),b.value&&e.O(()=>W())}})),(0,t.watch)(()=>i.node.code,t=>d(null,null,function*(){if(!1!==i.stream&&(h.value||=e.r(Be(t)),!I.value)){if(k&&!S.value&&f.value)try{yield $(f.value)}catch{}Fe(t,g.value),b.value&&e.O(()=>W())}}));let vt=(0,t.computed)(()=>{let t=h.value;return t?e.d[t]||t.charAt(0).toUpperCase()+t.slice(1):e.d[``]||`Plain Text`}),yt=(0,t.computed)(()=>function(e){let t=function(e){let t=String(e??``).split(/\r?\n/,1)[0]?.trim()??``;if(t.length<3)return``;let n=t[0];if(n!=="`"&&n!==`~`||t[1]!==n||t[2]!==n)return``;let r=3;for(;t[r]===n;)r+=1;return t.slice(r).trim()}(e);if(!t)return``;let n=t.split(/\s+/).filter(Boolean);if(!n.length)return``;let r=n[0]===`diff`?n.slice(1):n;for(let e of r){let t=e.includes(`:`)?e.slice(e.indexOf(`:`)+1):e;if(t&&/[./\\-]/.test(t))return t}return``}(String(i.node.raw??``))),bt=(0,t.computed)(()=>yt.value||vt.value),xt=(0,t.computed)(()=>yt.value?I.value?`Diff / ${vt.value}`:vt.value:``),St=(0,t.computed)(()=>(e.n.value,e.h(h.value||``))),Ct=(0,t.computed)(()=>{let e={},t=e=>{if(e!=null)return typeof e==`number`?`${e}px`:String(e)},n=t(i.minWidth),r=t(i.maxWidth);return n&&(e.minWidth=n),r&&(e.maxWidth=r),I.value?(e.color=`var(--markstream-diff-shell-fg)`,e.borderColor=`var(--markstream-diff-shell-border)`):(e.color=`var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))`,e.backgroundColor=`var(--vscode-editor-background, var(--markstream-code-fallback-bg))`,e.borderColor=`var(--markstream-code-border-color)`),e}),wt=(0,t.computed)(()=>{if(!I.value)return{color:`var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))`,backgroundColor:`var(--vscode-editor-background, var(--markstream-code-fallback-bg))`}}),X=(0,t.computed)(()=>!1!==i.showTooltips);function Tt(){return d(this,null,function*(){try{typeof navigator<`u`&&navigator.clipboard&&typeof navigator.clipboard.writeText==`function`&&(yield navigator.clipboard.writeText(i.node.code)),m.value=!0,a(`copy`,i.node.code),setTimeout(()=>{m.value=!1},1e3)}catch(e){console.error(`复制失败:`,e)}})}function Et(e){let t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Z(t,n,r=`top`){if(!X.value)return;let a=Et(t);if(!a)return;let o=t;e.b(a,n,r,!1,o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0,i.isDark)}function Q(){X.value&&e.C()}function Dt(t){if(!X.value)return;let n=Et(t);if(!n)return;let r=m.value?c(`common.copied`)||`Copied`:c(`common.copy`)||`Copy`,a=t;e.b(n,r,`top`,!1,a?.clientX!=null&&a?.clientY!=null?{x:a.clientX,y:a.clientY}:void 0,i.isDark)}function Ot(){var t,n;if(x.value=!x.value,x.value){if(f.value){let e=Math.ceil((t=f.value).getBoundingClientRect?.call(t).height||0);e>0&&(E.value=e)}At(!1)}else{b.value&&At(!0),f.value&&E.value!=null&&(f.value.style.height=`${E.value}px`);let t=I.value?j():A();try{(n=t?.layout)==null||n.call(t)}catch{}Me=2,e.O(()=>{b.value?W():Y()})}}function kt(){if(!_t.value)return;let e=h.value;if(s.value){let t=e===`html`?`text/html`:`image/svg+xml`,n=e===`html`?c(`artifacts.htmlPreviewTitle`)||`HTML Preview`:c(`artifacts.svgPreviewTitle`)||`SVG Preview`;a(`previewCode`,{node:i.node,artifactType:t,artifactTitle:n,id:`temp-${e}-${Date.now()}`});return}e===`html`&&(Xe.value=!Xe.value)}function At(e){var t,n;try{if(I.value){let n=j();(t=n?.updateOptions)==null||t.call(n,{automaticLayout:e})}else{let t=A();(n=t?.updateOptions)==null||n.call(t,{automaticLayout:e})}}catch{}}function $(n){if(!k||w)return null;if(function(){try{let e=window;if(e[ke])return;let t=window.Element?.prototype,n=t?.addEventListener;if(!t||!n)return;t.addEventListener=function(e,t,r){return e===`touchstart`&&function(e,t){if(!e)return!1;let n=e;return!(typeof n.closest!=`function`||!n.closest(`.monaco-editor, .monaco-diff-editor`)||t&&typeof t==`object`&&`passive`in t)}(this,r)?n.call(this,e,t,function(e){return e==null?{passive:!0}:typeof e==`boolean`?{capture:e,passive:!0}:typeof e==`object`?`passive`in e?e:u(l({},e),{passive:!0}):{passive:!0}}(r)):n.call(this,e,t,r)},e[ke]=!0}catch{}}(),N)return N;if(S.value&&C.value)return Promise.resolve();S.value=!0;let r=d(null,null,function*(){yield function(n){return d(this,null,function*(){if(!k||w||(G(),K(),function(e){e.replaceChildren()}(n),w)||(I.value?(M(),Pe?yield Pe(n,String(i.node.originalCode??``),String(i.node.updatedCode??``),g.value):yield k(n,i.node.code,g.value)):yield k(n,i.node.code,g.value),w))return;let r=I.value?j():A();if(typeof i.monacoOptions?.fontSize==`number`)r?.updateOptions({fontSize:i.monacoOptions.fontSize,automaticLayout:!1}),B.value=i.monacoOptions.fontSize,V.value=i.monacoOptions.fontSize;else{let e=at();e&&e>0?(B.value=e,V.value=e):(B.value=12,V.value=12)}if(b.value||x.value||Y(),!1===i.loading){if(yield(0,t.nextTick)(),w)return;e.O(()=>{w||(b.value&&!x.value?W():x.value||Y())})}yield(0,t.nextTick)(),w||(C.value=!0,function(){if(G(),I.value){let t=j(),n=(t?.getOriginalEditor)?.call(t),r=(t?.getModifiedEditor)?.call(t),i=(e,t)=>{try{let n=e?.[t];if(typeof n!=`function`)return;let r=n.call(e,()=>q());r&&P.push(r)}catch{}};try{let n=(t?.onDidUpdateDiff)?.call(t,()=>{q(),e.O(()=>ut())});n&&P.push(n)}catch{}i(n,`onDidContentSizeChange`),i(r,`onDidContentSizeChange`),i(n,`onDidLayoutChange`),i(r,`onDidLayoutChange`)}else{let e=A();try{let t=(e?.onDidContentSizeChange)?.call(e,()=>q());t&&P.push(t)}catch{}try{let t=(e?.onDidLayoutChange)?.call(e,()=>q());t&&P.push(t)}catch{}}}(),mt(),gt(),ut(),q())})}(n)}).finally(()=>{N===r&&(N=null)});return N=r,r}(0,t.watch)(X,t=>{t||e.C()}),(0,t.watch)(()=>V.value,(e,t)=>{let n=I.value?j():A();n&&typeof e==`number`&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),b.value&&!x.value&&W())},{flush:`post`,immediate:!1});let jt=(0,t.watch)(()=>[f.value,I.value,i.stream,i.loading,je.value,O.value],e=>d(null,[e],function*([e,t,n,r,i,a]){if(!e||!k||!a||!1===n&&!1!==r)return;let o=$(e);if(o){try{yield o}catch{C.value=!1}jt()}}));function Mt(e){return typeof e==`string`?e:e&&typeof e==`object`&&`name`in e?String(e.name):null}function Nt(){let e=i.isDark?i.darkTheme:i.lightTheme,t=R.value?.theme,n=e??t,r=Array.isArray(i.themes)?i.themes:[];if(!r.length||n==null)return n;let a=Mt(n),o=r.map(e=>Mt(e)).filter(e=>!!e);if(!a||o.includes(a))return n;let s=Mt(t);return t!=null&&s&&o.includes(s)?t:r[0]}(0,t.watch)(Ke,(e,n)=>d(null,null,function*(){if(e===n||(qe.value=e,!k||!f.value)||!S.value||!1===i.stream&&!1!==i.loading||!O.value)return;let r=N;if(r){try{yield r}catch{}if(w||!f.value)return}try{C.value=!1,S.value=!1,G(),K(),M(),yield(0,t.nextTick)(),yield $(f.value)}catch{C.value=!1}}));let Pt=(0,t.computed)(()=>function(e){let t=(Mt(e)??``).toLowerCase();return t?[`dark`,`night`,`moon`,`black`,`dracula`,`mocha`,`frappe`,`macchiato`,`palenight`,`ocean`,`poimandres`,`monokai`,`laserwave`,`tokyo`,`slack-dark`,`rose-pine`,`github-dark`,`material-theme`,`one-dark`,`catppuccin-mocha`,`catppuccin-frappe`,`catppuccin-macchiato`].some(e=>t.includes(e))&&![`light`,`latte`,`dawn`,`lotus`].some(e=>t.includes(e)):!!i.isDark}(Nt())),Ft=(0,t.computed)(()=>{if(!I.value)return Pt.value?`dark`:`light`;let e=R.value?.diffAppearance;return e===`light`||e===`dark`?e:i.isDark?`dark`:`light`}),It=(0,t.computed)(()=>I.value?Ft.value===`dark`:Pt.value);function Lt(){return u(l(u(l({wordWrap:`on`,wrappingIndent:`same`,themes:i.themes},R.value||{}),{theme:Nt()}),I.value?{diffAppearance:Ft.value}:{}),{onThemeChange(){mt()}})}function Rt(){let e=Lt();if(!F)return F=e,F;for(let t of Object.keys(F))t in e||delete F[t];return Object.assign(F,e),F}let zt=(0,t.computed)(()=>{var e,t,n,r,i;return JSON.stringify({diffLineStyle:R.value?.diffLineStyle??`background`,diffUnchangedRegionStyle:R.value?.diffUnchangedRegionStyle??`line-info`,diffHideUnchangedRegions:(e=R.value?.diffHideUnchangedRegions)==null||e,renderSideBySide:(t=R.value?.renderSideBySide)==null||t,enableSplitViewResizing:(n=R.value?.enableSplitViewResizing)==null||n,ignoreTrimWhitespace:(r=R.value?.ignoreTrimWhitespace)==null||r,originalEditable:(i=R.value?.originalEditable)!=null&&i})});(0,t.watch)(()=>[i.monacoOptions,O.value],()=>{var e;if(Rt(),!k||!O.value)return;let t=I.value?j():A(),n=typeof i.monacoOptions?.fontSize==`number`?i.monacoOptions.fontSize:Number.isFinite(V.value)?V.value:void 0;typeof n==`number`&&Number.isFinite(n)&&n>0&&((e=t?.updateOptions)==null||e.call(t,{fontSize:n})),b.value&&!x.value?W():x.value||Y()},{deep:!0}),(0,t.watch)(()=>[Nt(),Ft.value,je.value,S.value,O.value],()=>{je.value&&S.value&&O.value&&function(){Rt();let t=Nt(),n=()=>{I.value&&ze(),e.O(()=>{mt(),q()})};t?function(e,t){let n=function(e){if(e==null)return null;if(typeof e==`string`)return e;if(typeof e==`object`&&`name`in e)return String(e.name);if(typeof e==`object`){let t=ie.get(e);if(t)return t;try{let t=JSON.stringify(e);if(t)return ie.set(e,t),t}catch{}let n=`__theme_`+ ++ae;return ie.set(e,n),n}return String(e)}(t);return n?(re=e,_||ne!==n?_?(y===n||te===n||(v=t,y=n),_):(v=t,y=n,_=d(null,null,function*(){for(;y&&v!=null;){let t=v,n=y;if(v=null,y=null,ne!==n)try{te=n,yield(re??e)(t),ne=n}catch{}}}).finally(()=>{_=null,te=null}),_):Promise.resolve()):Promise.resolve()}(Ve,t).then(n).catch(e=>{}):n()}()},{flush:`post`}),(0,t.watch)(()=>[zt.value,je.value,O.value],(e,n)=>d(null,[e,n],function*([e,n,r],[a]){if(Rt(),!n||!r||!k||!f.value||!S.value||e===a||!1===i.stream&&!1!==i.loading)return;let o=N;if(o){try{yield o}catch{}if(w||!f.value)return}try{C.value=!1,S.value=!1,G(),K(),M(),yield(0,t.nextTick)(),yield $(f.value)}catch{C.value=!1}}),{flush:`post`});let Bt=(0,t.watch)(()=>[i.loading,O.value],(n,r)=>d(null,[n,r],function*([n,r],a){if(!r||n)return;let o=a?.[0],s=o!==void 0&&!1!==o;yield(0,t.nextTick)(),e.O(()=>{d(null,null,function*(){try{if(s&&S.value)if(I.value&&f.value){let e=N;if(e)try{yield e}catch{}C.value=!1,S.value=!1,G(),K(),M(),f.value.replaceChildren(),yield(0,t.nextTick)(),yield $(f.value)}else Fe(String(i.node.code??``),g.value);x.value||(b.value?W():Y()),Bt()}catch{}})})}),{immediate:!0,flush:`post`});return(0,t.onUnmounted)(()=>{G(),K(),Re()}),(r,a)=>z.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(e.m),{key:0,node:i.node,loading:i.loading},null,8,[`node`,`loading`])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,ref_key:`container`,ref:p,style:(0,t.normalizeStyle)(Ct.value),class:(0,t.normalizeClass)([`code-block-container my-4 rounded-lg border overflow-hidden shadow-sm`,[{"is-rendering":i.loading,"is-dark":It.value,"is-diff":I.value,"is-plain-text":Ae.value}]]),"data-markstream-code-block":`1`,"data-markstream-enhanced":C.value&&!z.value?`true`:`false`},[i.showHeader?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5`,style:(0,t.normalizeStyle)(wt.value)},[(0,t.renderSlot)(r.$slots,`header-left`,{},()=>[(0,t.createElementVNode)(`div`,se,[(0,t.createElementVNode)(`span`,{class:`icon-slot h-4 w-4 flex-shrink-0`,innerHTML:St.value},null,8,ce),(0,t.createElementVNode)(`div`,le,[(0,t.createElementVNode)(`div`,ue,(0,t.toDisplayString)(bt.value),1),xt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,de,(0,t.toDisplayString)(xt.value),1)):(0,t.createCommentVNode)(``,!0)])])],!0),(0,t.renderSlot)(r.$slots,`header-right`,{},()=>[(0,t.createElementVNode)(`div`,fe,[I.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`code-diff-stats`,"aria-label":Ue.value},[(0,t.createElementVNode)(`span`,me,`-`+(0,t.toDisplayString)(L.value.removed),1),(0,t.createElementVNode)(`span`,he,`+`+(0,t.toDisplayString)(L.value.added),1)],8,pe)):(0,t.createCommentVNode)(``,!0),i.showCollapseButton?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,"aria-pressed":x.value,onClick:Ot,onMouseenter:a[0]||=e=>Z(e,x.value?(0,t.unref)(c)(`common.expand`)||`Expand`:(0,t.unref)(c)(`common.collapse`)||`Collapse`),onFocus:a[1]||=e=>Z(e,x.value?(0,t.unref)(c)(`common.expand`)||`Expand`:(0,t.unref)(c)(`common.collapse`)||`Collapse`),onMouseleave:Q,onBlur:Q},[((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,{style:(0,t.normalizeStyle)({rotate:x.value?`0deg`:`90deg`}),xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},[...a[18]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m9 18l6-6l-6-6`},null,-1)]],4))],40,ge)):(0,t.createCommentVNode)(``,!0),i.showFontSizeButtons&&i.enableFontSizeControl?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[(0,t.createElementVNode)(`button`,{type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,disabled:!!Number.isFinite(V.value)&&V.value<=10,onClick:a[2]||=e=>function(){let e=dt();V.value=Math.max(10,e-1)}(),onMouseenter:a[3]||=e=>Z(e,(0,t.unref)(c)(`common.decrease`)||`Decrease`),onFocus:a[4]||=e=>Z(e,(0,t.unref)(c)(`common.decrease`)||`Decrease`),onMouseleave:Q,onBlur:Q},[...a[19]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14`})],-1)]],40,_e),(0,t.createElementVNode)(`button`,{type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,disabled:!Ze.value||V.value===B.value,onClick:a[5]||=e=>(dt(),void(Number.isFinite(B.value)&&(V.value=B.value))),onMouseenter:a[6]||=e=>Z(e,(0,t.unref)(c)(`common.reset`)||`Reset`),onFocus:a[7]||=e=>Z(e,(0,t.unref)(c)(`common.reset`)||`Reset`),onMouseleave:Q,onBlur:Q},[...a[20]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},[(0,t.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,t.createElementVNode)(`path`,{d:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,t.createElementVNode)(`path`,{d:`M3 3v5h5`})])],-1)]],40,ve),(0,t.createElementVNode)(`button`,{type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,disabled:!!Number.isFinite(V.value)&&V.value>=36,onClick:a[8]||=e=>function(){let e=dt();V.value=Math.min(36,e+1)}(),onMouseenter:a[9]||=e=>Z(e,(0,t.unref)(c)(`common.increase`)||`Increase`),onFocus:a[10]||=e=>Z(e,(0,t.unref)(c)(`common.increase`)||`Increase`),onMouseleave:Q,onBlur:Q},[...a[21]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14m-7-7v14`})],-1)]],40,ye)],64)):(0,t.createCommentVNode)(``,!0),i.showCopyButton?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,"aria-label":m.value?(0,t.unref)(c)(`common.copied`)||`Copied`:(0,t.unref)(c)(`common.copy`)||`Copy`,onClick:Tt,onMouseenter:a[11]||=e=>Dt(e),onFocus:a[12]||=e=>Dt(e),onMouseleave:Q,onBlur:Q},[m.value?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Se,[...a[23]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 6L9 17l-5-5`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,xe,[...a[22]||=[(0,t.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,t.createElementVNode)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,t.createElementVNode)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})],-1)]]))],40,be)):(0,t.createCommentVNode)(``,!0),i.showExpandButton?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:4,type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,"aria-pressed":b.value,onClick:a[13]||=t=>function(t){if(b.value=!b.value,t&&X.value){let n=Et(t);n&&e.b(n,b.value?c(`common.collapse`)||`Collapse`:c(`common.expand`)||`Expand`,`top`,!1,void 0,i.isDark)}let n=I.value?j():A(),r=f.value;n&&r&&(b.value?(At(!0),r.style.maxHeight=`none`,r.style.overflow=`visible`,W()):(At(!1),r.style.overflow=`auto`,Y()))}(t),onMouseenter:a[14]||=e=>Z(e,b.value?(0,t.unref)(c)(`common.collapse`)||`Collapse`:(0,t.unref)(c)(`common.expand`)||`Expand`),onFocus:a[15]||=e=>Z(e,b.value?(0,t.unref)(c)(`common.collapse`)||`Collapse`:(0,t.unref)(c)(`common.expand`)||`Expand`),onMouseleave:Q,onBlur:Q},[b.value?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,we,[...a[24]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Te,[...a[25]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6`},null,-1)]]))],40,Ce)):(0,t.createCommentVNode)(``,!0),_t.value&&i.showPreviewButton?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:5,type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,"aria-label":(0,t.unref)(c)(`common.preview`)||`Preview`,onClick:kt,onMouseenter:a[16]||=e=>Z(e,(0,t.unref)(c)(`common.preview`)||`Preview`),onFocus:a[17]||=e=>Z(e,(0,t.unref)(c)(`common.preview`)||`Preview`),onMouseleave:Q,onBlur:Q},[...a[26]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`g`,{fill:`currentColor`,"fill-rule":`evenodd`,"clip-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496`}),(0,t.createElementVNode)(`path`,{d:`M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23`})])],-1)]],40,Ee)):(0,t.createCommentVNode)(``,!0)])],!0)],4)):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`div`,De,[(0,t.createElementVNode)(`div`,{ref_key:`codeEditor`,ref:f,class:(0,t.normalizeClass)([`code-editor-container`,[n.stream?``:`code-height-placeholder`,{"is-hidden":Ye.value}]]),style:(0,t.normalizeStyle)(rt.value)},null,6),Ye.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(e.m),{key:0,class:(0,t.normalizeClass)([`code-pre-fallback`,{"is-wrap":Je.value}]),style:(0,t.normalizeStyle)(tt.value),node:i.node},null,8,[`class`,`style`,`node`])):(0,t.createCommentVNode)(``,!0)],512),[[t.vShow,!(x.value||!n.stream&&n.loading)]]),Xe.value&&!s.value&&_t.value&&h.value===`html`?((0,t.openBlock)(),(0,t.createBlock)(ee,{key:1,code:i.node.code,"is-dark":i.isDark,"on-close":()=>Xe.value=!1},null,8,[`code`,`is-dark`,`on-close`])):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:`code-loading-placeholder`,style:(0,t.normalizeStyle)(it.value)},[(0,t.renderSlot)(r.$slots,`loading`,{loading:n.loading,stream:n.stream},()=>[a[27]||=(0,t.createElementVNode)(`div`,{class:`loading-skeleton`},[(0,t.createElementVNode)(`div`,{class:`skeleton-line`}),(0,t.createElementVNode)(`div`,{class:`skeleton-line`}),(0,t.createElementVNode)(`div`,{class:`skeleton-line short`})],-1)],!0)],4),[[t.vShow,!n.stream&&n.loading]]),(0,t.createElementVNode)(`span`,Oe,(0,t.toDisplayString)(m.value?(0,t.unref)(c)(`common.copied`)||`Copied`:``),1)],14,oe))}}),[[`__scopeId`,`data-v-1a55f98f`]]);exports.default=Ae;
1
+ const e=require("./exports-DwEr4CaV.cjs");let t=require("vue");var n=Object.defineProperty,r=Object.defineProperties,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,c=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t)=>{for(var n in t||={})o.call(t,n)&&c(e,n,t[n]);if(a)for(var n of a(t))s.call(t,n)&&c(e,n,t[n]);return e},u=(e,t)=>r(e,i(t)),d=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),f={class:`markstream-vue`},p={class:`html-preview-frame__header`},m={class:`html-preview-frame__title`},h={class:`html-preview-frame__label`},g=[`srcdoc`],ee=e.E((0,t.defineComponent)({__name:`HtmlPreviewFrame`,props:{code:{},isDark:{type:Boolean},onClose:{type:Function},title:{}},setup(n){let r=n,{t:i}=e.T(),a=(0,t.computed)(()=>{let e=r.code||``,t=e.trim().toLowerCase();return t.startsWith(`<!doctype`)||t.startsWith(`<html`)||t.startsWith(`<body`)?e:`<!doctype html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1" />\n <style>\n html, body {\n margin: 0;\n padding: 0;\n height: 100%;\n background-color: ${r.isDark?`#020617`:`#ffffff`};\n color: ${r.isDark?`#e5e7eb`:`#020617`};\n }\n body {\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', ui-sans-serif, sans-serif;\n }\n </style>\n </head>\n <body>\n ${e}\n </body>\n</html>`});function o(e){var t;e.key!==`Escape`&&e.key!==`Esc`||(t=r.onClose)==null||t.call(r)}return(0,t.onMounted)(()=>{typeof window<`u`&&window.addEventListener(`keydown`,o)}),(0,t.onUnmounted)(()=>{typeof window<`u`&&window.removeEventListener(`keydown`,o)}),(e,n)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[(0,t.createElementVNode)(`div`,f,[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`html-preview-frame__backdrop`,{"html-preview-frame__backdrop--dark":r.isDark}]),onClick:n[2]||=e=>r.onClose?.call(r)},[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`html-preview-frame`,{"html-preview-frame--dark":r.isDark}]),onClick:n[1]||=(0,t.withModifiers)(()=>{},[`stop`])},[(0,t.createElementVNode)(`div`,p,[(0,t.createElementVNode)(`div`,m,[n[3]||=(0,t.createElementVNode)(`span`,{class:`html-preview-frame__dot`},null,-1),(0,t.createElementVNode)(`span`,h,(0,t.toDisplayString)(r.title||(0,t.unref)(i)(`common.preview`)||`Preview`),1)]),(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`html-preview-frame__close`,{"html-preview-frame__close--dark":r.isDark}]),onClick:n[0]||=e=>r.onClose?.call(r)},` × `,2)]),(0,t.createElementVNode)(`iframe`,{class:`html-preview-frame__iframe`,sandbox:`allow-scripts allow-same-origin`,srcdoc:a.value},null,8,g)],2)],2)])]))}}),[[`__scopeId`,`data-v-296dd89d`]]),_=null,te=null,v=null,y=null,ne=null,re=null,ie=new WeakMap,ae=0,oe=[`data-markstream-enhanced`],se={class:`code-header-main`},ce=[`innerHTML`],le={class:`code-header-copy`},ue={class:`code-header-title`},de={key:0,class:`code-header-caption`},fe={class:`code-header-actions`},pe=[`aria-label`],me={class:`code-diff-stat removed`},he={class:`code-diff-stat added`},ge=[`aria-pressed`],_e=[`disabled`],ve=[`disabled`],ye=[`disabled`],be=[`aria-label`],xe={key:0,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},Se={key:1,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},Ce=[`aria-pressed`],we={key:0,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},Te={key:1,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},Ee=[`aria-label`],De={class:`code-editor-layer`},Oe={class:`sr-only`,"aria-live":`polite`,role:`status`},ke=`__markstreamMonacoPassiveTouch__`,Ae=e.E((0,t.defineComponent)({__name:`CodeBlockNode`,props:{node:{},isDark:{type:Boolean,default:!1},loading:{type:Boolean,default:!0},stream:{type:Boolean,default:!0},darkTheme:{default:`vitesse-dark`},lightTheme:{default:`vitesse-light`},isShowPreview:{type:Boolean,default:!0},monacoOptions:{},enableFontSizeControl:{type:Boolean,default:!0},minWidth:{default:void 0},maxWidth:{default:void 0},themes:{},showHeader:{type:Boolean,default:!0},showCopyButton:{type:Boolean,default:!0},showExpandButton:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showCollapseButton:{type:Boolean,default:!0},showFontSizeButtons:{type:Boolean,default:!0},showTooltips:{type:Boolean},customId:{},estimatedHeightPx:{},estimatedContentHeightPx:{}},emits:[`previewCode`,`copy`],setup(n,{emit:r}){let i=n,a=r,o=(0,t.getCurrentInstance)(),s=(0,t.computed)(()=>{let e=o?.vnode.props;return!(!e||!e.onPreviewCode&&!e.onPreviewCode)}),{t:c}=e.T(),f=(0,t.ref)(null),p=(0,t.ref)(null),m=(0,t.ref)(!1),h=(0,t.ref)(e.r(i.node.language)),g=(0,t.computed)(()=>e.a(h.value)),Ae=(0,t.computed)(()=>g.value===`plaintext`),b=(0,t.ref)(!1),x=(0,t.ref)(!1),S=(0,t.ref)(!1),C=(0,t.ref)(!1),je=(0,t.ref)(!1),w=!1,T=null,E=(0,t.ref)(null),Me=0,Ne=e.y(),D=(0,t.ref)(null),O=(0,t.ref)(typeof window>`u`);typeof window<`u`&&(0,t.watch)(()=>p.value,e=>{var t;if((t=D.value)==null||t.destroy(),D.value=null,!e)return void(O.value=!1);let n=Ne(e,{rootMargin:`400px`});D.value=n,O.value=n.isVisible.value,n.whenVisible.then(()=>{O.value=!0})},{immediate:!0}),(0,t.onBeforeUnmount)(()=>{var e;w=!0,(e=D.value)==null||e.destroy(),D.value=null});let k=null,Pe=null,Fe=()=>{},Ie=()=>{},Le=()=>null,A=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),j=()=>({getModel:()=>({getLineCount:()=>1}),getOption:()=>14,updateOptions:()=>{}}),Re=()=>{},M=()=>{},ze=()=>{},N=null,Be=()=>String(i.node.language??`plaintext`),Ve=()=>d(null,null,function*(){}),P=[],He=[],F=null,I=(0,t.computed)(()=>i.node.diff),L=(0,t.ref)({removed:0,added:0}),Ue=(0,t.computed)(()=>`-${L.value.removed} +${L.value.added}`),We=Object.freeze({enabled:!0,contextLineCount:2,minimumLineCount:4,revealLineCount:5});function Ge(e){var t;if(typeof e==`boolean`)return e;if(e&&typeof e==`object`){let n=e;return u(l(l({},We),n),{enabled:(t=n.enabled)==null||t})}return l({},We)}let R=(0,t.computed)(()=>{let e=i.monacoOptions?l({},i.monacoOptions):{};if(!I.value)return e;let t=e.diffHideUnchangedRegions===void 0?l({},We):Ge(e.diffHideUnchangedRegions),n=e.hideUnchangedRegions===void 0?void 0:Ge(e.hideUnchangedRegions),r=e.diffUnchangedRegionStyle??`line-info`;return u(l(l(l({},{maxComputationTime:0,diffAlgorithm:`legacy`,ignoreTrimWhitespace:!1,renderIndicators:!0,diffUpdateThrottleMs:120,renderLineHighlight:`none`,renderLineHighlightOnlyWhenFocus:!0,selectionHighlight:!1,occurrencesHighlight:`off`,matchBrackets:`never`,lineDecorationsWidth:12,lineNumbersMinChars:2,glyphMargin:!1,fontSize:13,lineHeight:30,renderOverviewRuler:!1,overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollBeyondLastLine:!1,padding:{top:10,bottom:r===`line-info`||r===`line-info-basic`||r===`metadata`?22:14},diffHideUnchangedRegions:t,diffLineStyle:`background`,diffAppearance:`auto`,diffUnchangedRegionStyle:r,diffHunkActionsOnHover:!0,diffHunkHoverHideDelayMs:160}),e),n===void 0?{}:{hideUnchangedRegions:n}),{diffHideUnchangedRegions:t})}),Ke=(0,t.computed)(()=>I.value?`diff`:`single`),qe=(0,t.ref)(Ke.value),z=(0,t.ref)(!1),Je=(0,t.computed)(()=>{let e=i.monacoOptions?.wordWrap;return e==null||String(e)!==`off`}),Ye=(0,t.computed)(()=>!z.value&&!C.value),Xe=(0,t.ref)(!1);typeof window<`u`&&d(null,null,function*(){try{let t=yield e.D();if(w)return;if(!t)return void(z.value=!0);let n=t.useMonaco,r=t.detectLanguage;if(typeof r==`function`&&(Be=r),typeof n==`function`){let e=Nt();if(e&&i.themes&&Array.isArray(i.themes)&&!i.themes.includes(e))throw Error(`Preferred theme not in provided themes array`);F=Lt();let t=n(F);k=t.createEditor||k,Pe=t.createDiffEditor||Pe,Fe=t.updateCode||Fe,Ie=t.updateDiff||Ie,Le=t.getEditor||Le,A=t.getEditorView||A,j=t.getDiffEditorView||j,Re=t.cleanupEditor||Re,M=t.safeClean||t.cleanupEditor||M,ze=t.refreshDiffPresentation||ze,Ve=t.setTheme||Ve,je.value=!0,!w&&f.value&&(yield $(f.value))}}catch{if(w)return;z.value=!0}});let B=(0,t.ref)(typeof i.monacoOptions?.fontSize==`number`?i.monacoOptions.fontSize:NaN),V=(0,t.ref)(B.value),Ze=(0,t.computed)(()=>{let e=B.value,t=V.value;return typeof e==`number`&&Number.isFinite(e)&&e>0&&typeof t==`number`&&Number.isFinite(t)&&t>0}),Qe=(0,t.computed)(()=>{let e=i.monacoOptions?.fontSize;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e;let t=V.value;return typeof t==`number`&&Number.isFinite(t)&&t>0?t:12}),$e=(0,t.computed)(()=>{let e=i.monacoOptions?.lineHeight;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:Math.round(1.5*Qe.value)}),et=(0,t.computed)(()=>{let e=i.monacoOptions?.tabSize;return typeof e==`number`&&Number.isFinite(e)&&e>0?e:4}),H=(0,t.computed)(()=>{let e=i.estimatedContentHeightPx;return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.round(e):null}),tt=(0,t.computed)(()=>{let e=i.monacoOptions?.fontFamily;return l(l({fontSize:`${Qe.value}px`,lineHeight:`${$e.value}px`,tabSize:et.value},H.value==null?{}:{minHeight:`${H.value}px`}),typeof e==`string`&&e.trim()?{"--markstream-code-font-family":e.trim()}:{})}),nt=(0,t.computed)(()=>H.value!=null&&!C.value),rt=(0,t.computed)(()=>{if(nt.value)return{minHeight:`${H.value}px`}}),it=(0,t.computed)(()=>{if(H.value!=null)return{minHeight:`${H.value}px`}});function at(){var e;try{let t=I.value?((e=j())?.getModifiedEditor)?.call(e)??j():A(),n=Le()?.EditorOption?.fontInfo;if(t&&n!=null){let e=t.getOption?.call(t,n)?.fontSize;if(typeof e==`number`&&Number.isFinite(e)&&e>0)return e}}catch{}try{let e=f.value;if(e){let t=e.querySelector(`.view-lines .view-line`);if(t)try{if(typeof window<`u`&&typeof window.getComputedStyle==`function`){let e=window.getComputedStyle(t).fontSize,n=e&&e.match(/^(\d+(?:\.\d+)?)/);if(n)return Number.parseFloat(n[1])}}catch{}}}catch{}return null}function ot(e){try{let t=Le()?.EditorOption?.lineHeight;if(t!=null){let n=(e?.getOption)?.call(e,t);if(typeof n==`number`&&n>0)return n}}catch{}let t=function(){try{let e=f.value;if(!e)return null;let t=e.querySelector(`.view-lines .view-line`);if(t){let e=Math.ceil(t.getBoundingClientRect().height);if(e>0)return e}}catch{}return null}();if(t&&t>0)return t;let n=Number.isFinite(V.value)&&V.value>0?V.value:12;return Math.max(12,Math.round(1.35*n))}function st(e,t){return typeof e!=`number`||typeof t!=`number`||e<1||t<e?0:t-e+1}function ct(e){if(!e)return[];let t=e.split(/\r?\n/);return t.length===1&&t[0]===``?[]:t}function lt(){I.value?L.value=function(e,t){let n=ct(e),r=ct(t),i=0,a=n.length-1,o=r.length-1;for(;i<=a&&i<=o&&n[i]===r[i];)i++;for(;a>=i&&o>=i&&n[a]===r[o];)a--,o--;return{removed:Math.max(0,a-i+1),added:Math.max(0,o-i+1)}}(String(i.node.originalCode??``),String(i.node.updatedCode??``)):L.value={removed:0,added:0}}function ut(){if(I.value)try{let e=j(),t=(e?.getLineChanges)?.call(e);if(!Array.isArray(t))return void lt();let n=0,r=0;for(let e of t)n+=st(e.originalStartLineNumber,e.originalEndLineNumber),r+=st(e.modifiedStartLineNumber,e.modifiedEndLineNumber);L.value={removed:n,added:r}}catch{lt()}else L.value={removed:0,added:0}}function dt(){if(Number.isFinite(V.value)&&V.value>0&&Number.isFinite(B.value))return V.value;let e=at();return typeof i.monacoOptions?.fontSize==`number`?(B.value=i.monacoOptions.fontSize,V.value=i.monacoOptions.fontSize,V.value):e&&e>0?(B.value=e,V.value=e,e):(B.value=12,V.value=12,12)}function ft(){var e,t,n,r,i;try{let a=I.value?j():null,o=I.value?a:A();if(!o)return null;if(a?.getOriginalEditor&&a?.getModifiedEditor){let i=a.getOriginalEditor?.call(a),o=a.getModifiedEditor?.call(a);(e=i?.layout)==null||e.call(i),(t=o?.layout)==null||t.call(o);let s=(i?.getContentHeight)?.call(i)||0,c=(o?.getContentHeight)?.call(o)||0,l=Math.max(s,c);if(l>0)return Math.ceil(l+1);let u=((n=(i?.getModel)?.call(i))?.getLineCount)?.call(n)||1,d=((r=(o?.getModel)?.call(o))?.getLineCount)?.call(r)||1,f=Math.max(u,d),p=Math.max(ot(i),ot(o));return Math.ceil(f*(p+1.5)+0+1)}if(o?.getContentHeight){(i=o?.layout)==null||i.call(o);let e=o.getContentHeight();if(e>0)return Math.ceil(e+1)}let s=(o?.getModel)?.call(o),c=1;s&&typeof s.getLineCount==`function`&&(c=s.getLineCount());let l=ot(o);return Math.ceil(c*(l+1.5)+0+1)}catch{return null}}function pt(e){let t=String(e??``).match(/\d+(?:\.\d+)?/g);if(!t||t.length<3)return null;let[n,r,i]=t.slice(0,3).map(Number);return .2126*n+.7152*r+.0722*i}function mt(){let e=f.value,t=p.value;if(!e||!t)return;if(I.value)return t.style.removeProperty(`--vscode-editor-foreground`),t.style.removeProperty(`--vscode-editor-background`),void t.style.removeProperty(`--vscode-editor-selectionBackground`);let n=e.querySelector(`.monaco-editor`)||e,r=n.querySelector(`.monaco-editor-background`)||n,i=n.querySelector(`.view-lines`)||n,a=null,o=null,s=null;try{typeof window<`u`&&typeof window.getComputedStyle==`function`&&(a=window.getComputedStyle(n),o=r===n?a:window.getComputedStyle(r),s=i===n?a:window.getComputedStyle(i))}catch{a=null,o=null,s=null}let c=String(a?.getPropertyValue(`--vscode-editor-foreground`)??``).trim(),l=String(a?.getPropertyValue(`--vscode-editor-background`)??``).trim(),u=String(a?.getPropertyValue(`--vscode-editor-selectionBackground`)??a?.getPropertyValue(`--vscode-editor-hoverHighlightBackground`)??``).trim(),d=c||String(s?.color??a?.color??``).trim(),m=l||String(o?.backgroundColor??a?.backgroundColor??``).trim();if(function(e,t,n){if(!Ae.value)return!1;let r=pt(e),i=pt(t);return n?r!=null&&r>170||i!=null&&i<110:r!=null&&r<85||i!=null&&i>190}(m,d,t.classList.contains(`is-dark`)))return t.style.removeProperty(`--vscode-editor-foreground`),t.style.removeProperty(`--vscode-editor-background`),void t.style.removeProperty(`--vscode-editor-selectionBackground`);d&&t.style.setProperty(`--vscode-editor-foreground`,d),m&&t.style.setProperty(`--vscode-editor-background`,m),u&&t.style.setProperty(`--vscode-editor-selectionBackground`,u)}let ht=/auto|scroll|overlay/i;function U(e,t,n){if(typeof window>`u`)return;let r=Math.ceil(n)-Math.ceil(t);if(!r)return;let i=function(e){if(typeof window>`u`)return null;let t=e?.ownerDocument??document,n=t.scrollingElement||t.documentElement||t.body,r=e?.parentElement??null;for(;r&&r!==t.body&&r!==n;){let e=window.getComputedStyle(r),t=(e.overflowY||``).toLowerCase(),n=(e.overflow||``).toLowerCase();if(ht.test(t)||ht.test(n))return r;r=r.parentElement}return n}(e);if(!i)return;let a=e.ownerDocument??document,o=i===a.body||i===a.documentElement||i===a.scrollingElement,s=o?0:i.getBoundingClientRect().top;e.getBoundingClientRect().top-s>=0||(o&&typeof window.scrollBy==`function`?window.scrollBy(0,r):i.scrollTop+=r)}function W(){try{let e=f.value;if(!e)return;let t=e.getBoundingClientRect().height,n=ft();if(n!=null&&n>0){let r=Math.ceil(n);e.style.minHeight=`0px`,e.style.height=`${r}px`,e.style.maxHeight=`none`,e.style.overflow=`visible`,U(e,t,r)}}catch{}}function G(){for(var t,n;P.length>0;)try{(n=(t=P.pop())?.dispose)==null||n.call(t)}catch{}T!=null&&(e.s(T),T=null)}function K(){for(var e;He.length>0;)try{(e=He.pop())==null||e()}catch{}}function gt(){if(K(),!I.value)return;let e=f.value;if(!e)return;let t=e.querySelector(`.monaco-diff-editor`);if(!t||t.classList.contains(`side-by-side`))return;let n=Array.from(t.querySelectorAll(`.editor.original .diff-hidden-lines`)),r=Array.from(t.querySelectorAll(`.editor.modified .diff-hidden-lines`)),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e],i=r[e].querySelector(`a`),a=t.querySelector(`.center > div:first-child`);if(!i||!a)continue;let o=document.createElement(`button`);o.type=`button`,o.className=`markstream-inline-fold-proxy`;let s=i.getAttribute(`title`)||`Show Unchanged Region`;o.title=s,o.setAttribute(`aria-label`,s);let c=i.querySelector(`.codicon`),l=document.createElement(`span`);l.className=c?.className||`codicon codicon-unfold`,o.append(l);let u=e=>{e.preventDefault(),e.stopPropagation()},d=e=>{e.preventDefault(),e.stopPropagation(),i.click()},f=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),e.stopPropagation(),i.click())};o.addEventListener(`mousedown`,u),o.addEventListener(`click`,d),o.addEventListener(`keydown`,f),a.replaceChildren(o),He.push(()=>{o.removeEventListener(`mousedown`,u),o.removeEventListener(`click`,d),o.removeEventListener(`keydown`,f),a.contains(o)&&a.replaceChildren()})}}function q(){T??=e.O(()=>{T=null,e.O(()=>{gt(),x.value||(b.value?W():Y())})})}function J(e,t,n){let r=Math.min(t,n),i=t>n+1;return e.style.minHeight=`0px`,e.style.height=`${Math.ceil(r)}px`,e.style.maxHeight=`${Math.ceil(n)}px`,e.style.overflow=i?`auto`:`hidden`,Math.ceil(r)}function Y(){try{let e=f.value;if(!e)return;let t=e.getBoundingClientRect().height,n=function(){let e=i.monacoOptions?.MAX_HEIGHT??500;if(typeof e==`number`)return e;let t=String(e).match(/^(\d+(?:\.\d+)?)/);return t?Number.parseFloat(t[1]):500}();if(Me>0&&(Me--,E.value!=null))return void U(e,t,J(e,E.value,n));let r=ft();if(r!=null&&r>0)return void U(e,t,J(e,r,n));if(E.value!=null)return void U(e,t,J(e,E.value,n));let a=Math.ceil(e.getBoundingClientRect?.call(e).height||0);if(a>0)return void U(e,t,J(e,a,n));let o=Number.parseFloat(e.style.height);!Number.isNaN(o)&&o>0?U(e,t,J(e,o,n)):U(e,t,J(e,n,n))}catch{}}let _t=(0,t.computed)(()=>i.isShowPreview&&(h.value===`html`||h.value===`svg`));(0,t.watch)(()=>i.node.language,t=>{h.value=e.r(t)}),(0,t.watch)(()=>[i.node.originalCode,i.node.updatedCode,I.value],()=>{lt(),e.O(()=>ut())},{immediate:!0}),(0,t.watch)(()=>[i.node.originalCode,i.node.updatedCode,g.value,I.value],t=>d(null,[t],function*([t,n,r,a]){if(!1!==i.stream&&a){if(k&&!S.value&&f.value)try{yield $(f.value)}catch{}Ie(String(t??``),String(n??``),g.value),b.value&&e.O(()=>W())}})),(0,t.watch)(()=>i.node.code,t=>d(null,null,function*(){if(!1!==i.stream&&(h.value||=e.r(Be(t)),!I.value)){if(k&&!S.value&&f.value)try{yield $(f.value)}catch{}Fe(t,g.value),b.value&&e.O(()=>W())}}));let vt=(0,t.computed)(()=>{let t=h.value;return t?e.d[t]||t.charAt(0).toUpperCase()+t.slice(1):e.d[``]||`Plain Text`}),yt=(0,t.computed)(()=>function(e){let t=function(e){let t=String(e??``).split(/\r?\n/,1)[0]?.trim()??``;if(t.length<3)return``;let n=t[0];if(n!=="`"&&n!==`~`||t[1]!==n||t[2]!==n)return``;let r=3;for(;t[r]===n;)r+=1;return t.slice(r).trim()}(e);if(!t)return``;let n=t.split(/\s+/).filter(Boolean);if(!n.length)return``;let r=n[0]===`diff`?n.slice(1):n;for(let e of r){let t=e.includes(`:`)?e.slice(e.indexOf(`:`)+1):e;if(t&&/[./\\-]/.test(t))return t}return``}(String(i.node.raw??``))),bt=(0,t.computed)(()=>yt.value||vt.value),xt=(0,t.computed)(()=>yt.value?I.value?`Diff / ${vt.value}`:vt.value:``),St=(0,t.computed)(()=>(e.n.value,e.h(h.value||``))),Ct=(0,t.computed)(()=>{let e={},t=e=>{if(e!=null)return typeof e==`number`?`${e}px`:String(e)},n=t(i.minWidth),r=t(i.maxWidth);return n&&(e.minWidth=n),r&&(e.maxWidth=r),I.value?(e.color=`var(--markstream-diff-shell-fg)`,e.borderColor=`var(--markstream-diff-shell-border)`):(e.color=`var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))`,e.backgroundColor=`var(--vscode-editor-background, var(--markstream-code-fallback-bg))`,e.borderColor=`var(--markstream-code-border-color)`),e}),wt=(0,t.computed)(()=>{if(!I.value)return{color:`var(--vscode-editor-foreground, var(--markstream-code-fallback-fg))`,backgroundColor:`var(--vscode-editor-background, var(--markstream-code-fallback-bg))`}}),X=(0,t.computed)(()=>!1!==i.showTooltips);function Tt(){return d(this,null,function*(){try{typeof navigator<`u`&&navigator.clipboard&&typeof navigator.clipboard.writeText==`function`&&(yield navigator.clipboard.writeText(i.node.code)),m.value=!0,a(`copy`,i.node.code),setTimeout(()=>{m.value=!1},1e3)}catch(e){console.error(`复制失败:`,e)}})}function Et(e){let t=e.currentTarget||e.target;return!t||t.disabled?null:t}function Z(t,n,r=`top`){if(!X.value)return;let a=Et(t);if(!a)return;let o=t;e.b(a,n,r,!1,o?.clientX!=null&&o?.clientY!=null?{x:o.clientX,y:o.clientY}:void 0,i.isDark)}function Q(){X.value&&e.C()}function Dt(t){if(!X.value)return;let n=Et(t);if(!n)return;let r=m.value?c(`common.copied`)||`Copied`:c(`common.copy`)||`Copy`,a=t;e.b(n,r,`top`,!1,a?.clientX!=null&&a?.clientY!=null?{x:a.clientX,y:a.clientY}:void 0,i.isDark)}function Ot(){var t,n;if(x.value=!x.value,x.value){if(f.value){let e=Math.ceil((t=f.value).getBoundingClientRect?.call(t).height||0);e>0&&(E.value=e)}At(!1)}else{b.value&&At(!0),f.value&&E.value!=null&&(f.value.style.height=`${E.value}px`);let t=I.value?j():A();try{(n=t?.layout)==null||n.call(t)}catch{}Me=2,e.O(()=>{b.value?W():Y()})}}function kt(){if(!_t.value)return;let e=h.value;if(s.value){let t=e===`html`?`text/html`:`image/svg+xml`,n=e===`html`?c(`artifacts.htmlPreviewTitle`)||`HTML Preview`:c(`artifacts.svgPreviewTitle`)||`SVG Preview`;a(`previewCode`,{node:i.node,artifactType:t,artifactTitle:n,id:`temp-${e}-${Date.now()}`});return}e===`html`&&(Xe.value=!Xe.value)}function At(e){var t,n;try{if(I.value){let n=j();(t=n?.updateOptions)==null||t.call(n,{automaticLayout:e})}else{let t=A();(n=t?.updateOptions)==null||n.call(t,{automaticLayout:e})}}catch{}}function $(n){if(!k||w)return null;if(function(){try{let e=window;if(e[ke])return;let t=window.Element?.prototype,n=t?.addEventListener;if(!t||!n)return;t.addEventListener=function(e,t,r){return e===`touchstart`&&function(e,t){if(!e)return!1;let n=e;return!(typeof n.closest!=`function`||!n.closest(`.monaco-editor, .monaco-diff-editor`)||t&&typeof t==`object`&&`passive`in t)}(this,r)?n.call(this,e,t,function(e){return e==null?{passive:!0}:typeof e==`boolean`?{capture:e,passive:!0}:typeof e==`object`?`passive`in e?e:u(l({},e),{passive:!0}):{passive:!0}}(r)):n.call(this,e,t,r)},e[ke]=!0}catch{}}(),N)return N;if(S.value&&C.value)return Promise.resolve();S.value=!0;let r=d(null,null,function*(){yield function(n){return d(this,null,function*(){if(!k||w||(G(),K(),function(e){e.replaceChildren()}(n),w)||(I.value?(M(),Pe?yield Pe(n,String(i.node.originalCode??``),String(i.node.updatedCode??``),g.value):yield k(n,i.node.code,g.value)):yield k(n,i.node.code,g.value),w))return;let r=I.value?j():A();if(typeof i.monacoOptions?.fontSize==`number`)r?.updateOptions({fontSize:i.monacoOptions.fontSize,automaticLayout:!1}),B.value=i.monacoOptions.fontSize,V.value=i.monacoOptions.fontSize;else{let e=at();e&&e>0?(B.value=e,V.value=e):(B.value=12,V.value=12)}if(b.value||x.value||Y(),!1===i.loading){if(yield(0,t.nextTick)(),w)return;e.O(()=>{w||(b.value&&!x.value?W():x.value||Y())})}yield(0,t.nextTick)(),w||(C.value=!0,function(){if(G(),I.value){let t=j(),n=(t?.getOriginalEditor)?.call(t),r=(t?.getModifiedEditor)?.call(t),i=(e,t)=>{try{let n=e?.[t];if(typeof n!=`function`)return;let r=n.call(e,()=>q());r&&P.push(r)}catch{}};try{let n=(t?.onDidUpdateDiff)?.call(t,()=>{q(),e.O(()=>ut())});n&&P.push(n)}catch{}i(n,`onDidContentSizeChange`),i(r,`onDidContentSizeChange`),i(n,`onDidLayoutChange`),i(r,`onDidLayoutChange`)}else{let e=A();try{let t=(e?.onDidContentSizeChange)?.call(e,()=>q());t&&P.push(t)}catch{}try{let t=(e?.onDidLayoutChange)?.call(e,()=>q());t&&P.push(t)}catch{}}}(),mt(),gt(),ut(),q())})}(n)}).finally(()=>{N===r&&(N=null)});return N=r,r}(0,t.watch)(X,t=>{t||e.C()}),(0,t.watch)(()=>V.value,(e,t)=>{let n=I.value?j():A();n&&typeof e==`number`&&Number.isFinite(e)&&e>0&&(n.updateOptions({fontSize:e}),b.value&&!x.value&&W())},{flush:`post`,immediate:!1});let jt=(0,t.watch)(()=>[f.value,I.value,i.stream,i.loading,je.value,O.value],e=>d(null,[e],function*([e,t,n,r,i,a]){if(!e||!k||!a||!1===n&&!1!==r)return;let o=$(e);if(o){try{yield o}catch{C.value=!1}jt()}}));function Mt(e){return typeof e==`string`?e:e&&typeof e==`object`&&`name`in e?String(e.name):null}function Nt(){let e=i.isDark?i.darkTheme:i.lightTheme,t=R.value?.theme,n=e??t,r=Array.isArray(i.themes)?i.themes:[];if(!r.length||n==null)return n;let a=Mt(n),o=r.map(e=>Mt(e)).filter(e=>!!e);if(!a||o.includes(a))return n;let s=Mt(t);return t!=null&&s&&o.includes(s)?t:r[0]}(0,t.watch)(Ke,(e,n)=>d(null,null,function*(){if(e===n||(qe.value=e,!k||!f.value)||!S.value||!1===i.stream&&!1!==i.loading||!O.value)return;let r=N;if(r){try{yield r}catch{}if(w||!f.value)return}try{C.value=!1,S.value=!1,G(),K(),M(),yield(0,t.nextTick)(),yield $(f.value)}catch{C.value=!1}}));let Pt=(0,t.computed)(()=>function(e){let t=(Mt(e)??``).toLowerCase();return t?[`dark`,`night`,`moon`,`black`,`dracula`,`mocha`,`frappe`,`macchiato`,`palenight`,`ocean`,`poimandres`,`monokai`,`laserwave`,`tokyo`,`slack-dark`,`rose-pine`,`github-dark`,`material-theme`,`one-dark`,`catppuccin-mocha`,`catppuccin-frappe`,`catppuccin-macchiato`].some(e=>t.includes(e))&&![`light`,`latte`,`dawn`,`lotus`].some(e=>t.includes(e)):!!i.isDark}(Nt())),Ft=(0,t.computed)(()=>{if(!I.value)return Pt.value?`dark`:`light`;let e=R.value?.diffAppearance;return e===`light`||e===`dark`?e:i.isDark?`dark`:`light`}),It=(0,t.computed)(()=>I.value?Ft.value===`dark`:Pt.value);function Lt(){return u(l(u(l({wordWrap:`on`,wrappingIndent:`same`,themes:i.themes},R.value||{}),{theme:Nt()}),I.value?{diffAppearance:Ft.value}:{}),{onThemeChange(){mt()}})}function Rt(){let e=Lt();if(!F)return F=e,F;for(let t of Object.keys(F))t in e||delete F[t];return Object.assign(F,e),F}let zt=(0,t.computed)(()=>{var e,t,n,r,i;return JSON.stringify({diffLineStyle:R.value?.diffLineStyle??`background`,diffUnchangedRegionStyle:R.value?.diffUnchangedRegionStyle??`line-info`,diffHideUnchangedRegions:(e=R.value?.diffHideUnchangedRegions)==null||e,renderSideBySide:(t=R.value?.renderSideBySide)==null||t,enableSplitViewResizing:(n=R.value?.enableSplitViewResizing)==null||n,ignoreTrimWhitespace:(r=R.value?.ignoreTrimWhitespace)==null||r,originalEditable:(i=R.value?.originalEditable)!=null&&i})});(0,t.watch)(()=>[i.monacoOptions,O.value],()=>{var e;if(Rt(),!k||!O.value)return;let t=I.value?j():A(),n=typeof i.monacoOptions?.fontSize==`number`?i.monacoOptions.fontSize:Number.isFinite(V.value)?V.value:void 0;typeof n==`number`&&Number.isFinite(n)&&n>0&&((e=t?.updateOptions)==null||e.call(t,{fontSize:n})),b.value&&!x.value?W():x.value||Y()},{deep:!0}),(0,t.watch)(()=>[Nt(),Ft.value,je.value,S.value,O.value],()=>{je.value&&S.value&&O.value&&function(){Rt();let t=Nt(),n=()=>{I.value&&ze(),e.O(()=>{mt(),q()})};t?function(e,t){let n=function(e){if(e==null)return null;if(typeof e==`string`)return e;if(typeof e==`object`&&`name`in e)return String(e.name);if(typeof e==`object`){let t=ie.get(e);if(t)return t;try{let t=JSON.stringify(e);if(t)return ie.set(e,t),t}catch{}let n=`__theme_`+ ++ae;return ie.set(e,n),n}return String(e)}(t);return n?(re=e,_||ne!==n?_?(y===n||te===n||(v=t,y=n),_):(v=t,y=n,_=d(null,null,function*(){for(;y&&v!=null;){let t=v,n=y;if(v=null,y=null,ne!==n)try{te=n,yield(re??e)(t),ne=n}catch{}}}).finally(()=>{_=null,te=null}),_):Promise.resolve()):Promise.resolve()}(Ve,t).then(n).catch(e=>{}):n()}()},{flush:`post`}),(0,t.watch)(()=>[zt.value,je.value,O.value],(e,n)=>d(null,[e,n],function*([e,n,r],[a]){if(Rt(),!n||!r||!k||!f.value||!S.value||e===a||!1===i.stream&&!1!==i.loading)return;let o=N;if(o){try{yield o}catch{}if(w||!f.value)return}try{C.value=!1,S.value=!1,G(),K(),M(),yield(0,t.nextTick)(),yield $(f.value)}catch{C.value=!1}}),{flush:`post`});let Bt=(0,t.watch)(()=>[i.loading,O.value],(n,r)=>d(null,[n,r],function*([n,r],a){if(!r||n)return;let o=a?.[0],s=o!==void 0&&!1!==o;yield(0,t.nextTick)(),e.O(()=>{d(null,null,function*(){try{if(s&&S.value)if(I.value&&f.value){let e=N;if(e)try{yield e}catch{}C.value=!1,S.value=!1,G(),K(),M(),f.value.replaceChildren(),yield(0,t.nextTick)(),yield $(f.value)}else Fe(String(i.node.code??``),g.value);x.value||(b.value?W():Y()),Bt()}catch{}})})}),{immediate:!0,flush:`post`});return(0,t.onUnmounted)(()=>{G(),K(),Re()}),(r,a)=>z.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(e.m),{key:0,node:i.node,loading:i.loading},null,8,[`node`,`loading`])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,ref_key:`container`,ref:p,style:(0,t.normalizeStyle)(Ct.value),class:(0,t.normalizeClass)([`code-block-container my-4 rounded-lg border overflow-hidden shadow-sm`,[{"is-rendering":i.loading,"is-dark":It.value,"is-diff":I.value,"is-plain-text":Ae.value}]]),"data-markstream-code-block":`1`,"data-markstream-enhanced":C.value&&!z.value?`true`:`false`},[i.showHeader?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`code-block-header flex justify-between items-center px-4 py-2.5 border-b border-gray-400/5`,style:(0,t.normalizeStyle)(wt.value)},[(0,t.renderSlot)(r.$slots,`header-left`,{},()=>[(0,t.createElementVNode)(`div`,se,[(0,t.createElementVNode)(`span`,{class:`icon-slot h-4 w-4 flex-shrink-0`,innerHTML:St.value},null,8,ce),(0,t.createElementVNode)(`div`,le,[(0,t.createElementVNode)(`div`,ue,(0,t.toDisplayString)(bt.value),1),xt.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,de,(0,t.toDisplayString)(xt.value),1)):(0,t.createCommentVNode)(``,!0)])])],!0),(0,t.renderSlot)(r.$slots,`header-right`,{},()=>[(0,t.createElementVNode)(`div`,fe,[I.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`code-diff-stats`,"aria-label":Ue.value},[(0,t.createElementVNode)(`span`,me,`-`+(0,t.toDisplayString)(L.value.removed),1),(0,t.createElementVNode)(`span`,he,`+`+(0,t.toDisplayString)(L.value.added),1)],8,pe)):(0,t.createCommentVNode)(``,!0),i.showCollapseButton?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:1,type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,"aria-pressed":x.value,onClick:Ot,onMouseenter:a[0]||=e=>Z(e,x.value?(0,t.unref)(c)(`common.expand`)||`Expand`:(0,t.unref)(c)(`common.collapse`)||`Collapse`),onFocus:a[1]||=e=>Z(e,x.value?(0,t.unref)(c)(`common.expand`)||`Expand`:(0,t.unref)(c)(`common.collapse`)||`Collapse`),onMouseleave:Q,onBlur:Q},[((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,{style:(0,t.normalizeStyle)({rotate:x.value?`0deg`:`90deg`}),xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},[...a[18]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m9 18l6-6l-6-6`},null,-1)]],4))],40,ge)):(0,t.createCommentVNode)(``,!0),i.showFontSizeButtons&&i.enableFontSizeControl?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[(0,t.createElementVNode)(`button`,{type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,disabled:!!Number.isFinite(V.value)&&V.value<=10,onClick:a[2]||=e=>function(){let e=dt();V.value=Math.max(10,e-1)}(),onMouseenter:a[3]||=e=>Z(e,(0,t.unref)(c)(`common.decrease`)||`Decrease`),onFocus:a[4]||=e=>Z(e,(0,t.unref)(c)(`common.decrease`)||`Decrease`),onMouseleave:Q,onBlur:Q},[...a[19]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14`})],-1)]],40,_e),(0,t.createElementVNode)(`button`,{type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,disabled:!Ze.value||V.value===B.value,onClick:a[5]||=e=>(dt(),void(Number.isFinite(B.value)&&(V.value=B.value))),onMouseenter:a[6]||=e=>Z(e,(0,t.unref)(c)(`common.reset`)||`Reset`),onFocus:a[7]||=e=>Z(e,(0,t.unref)(c)(`common.reset`)||`Reset`),onMouseleave:Q,onBlur:Q},[...a[20]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},[(0,t.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,t.createElementVNode)(`path`,{d:`M3 12a9 9 0 1 0 9-9a9.75 9.75 0 0 0-6.74 2.74L3 8`}),(0,t.createElementVNode)(`path`,{d:`M3 3v5h5`})])],-1)]],40,ve),(0,t.createElementVNode)(`button`,{type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,disabled:!!Number.isFinite(V.value)&&V.value>=36,onClick:a[8]||=e=>function(){let e=dt();V.value=Math.min(36,e+1)}(),onMouseenter:a[9]||=e=>Z(e,(0,t.unref)(c)(`common.increase`)||`Increase`),onFocus:a[10]||=e=>Z(e,(0,t.unref)(c)(`common.increase`)||`Increase`),onMouseleave:Q,onBlur:Q},[...a[21]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,"aria-hidden":`true`,role:`img`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`w-3 h-3`},[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14m-7-7v14`})],-1)]],40,ye)],64)):(0,t.createCommentVNode)(``,!0),i.showCopyButton?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:3,type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,"aria-label":m.value?(0,t.unref)(c)(`common.copied`)||`Copied`:(0,t.unref)(c)(`common.copy`)||`Copy`,onClick:Tt,onMouseenter:a[11]||=e=>Dt(e),onFocus:a[12]||=e=>Dt(e),onMouseleave:Q,onBlur:Q},[m.value?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Se,[...a[23]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 6L9 17l-5-5`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,xe,[...a[22]||=[(0,t.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,t.createElementVNode)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,t.createElementVNode)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})],-1)]]))],40,be)):(0,t.createCommentVNode)(``,!0),i.showExpandButton?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:4,type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,"aria-pressed":b.value,onClick:a[13]||=t=>function(t){if(b.value=!b.value,t&&X.value){let n=Et(t);n&&e.b(n,b.value?c(`common.collapse`)||`Collapse`:c(`common.expand`)||`Expand`,`top`,!1,void 0,i.isDark)}let n=I.value?j():A(),r=f.value;n&&r&&(b.value?(At(!0),r.style.maxHeight=`none`,r.style.overflow=`visible`,W()):(At(!1),r.style.overflow=`auto`,Y()))}(t),onMouseenter:a[14]||=e=>Z(e,b.value?(0,t.unref)(c)(`common.collapse`)||`Collapse`:(0,t.unref)(c)(`common.expand`)||`Expand`),onFocus:a[15]||=e=>Z(e,b.value?(0,t.unref)(c)(`common.collapse`)||`Collapse`:(0,t.unref)(c)(`common.expand`)||`Expand`),onMouseleave:Q,onBlur:Q},[b.value?((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,we,[...a[24]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m14 10l7-7m-1 7h-6V4M3 21l7-7m-6 0h6v6`},null,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`svg`,Te,[...a[25]||=[(0,t.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 3h6v6m0-6l-7 7M3 21l7-7m-1 7H3v-6`},null,-1)]]))],40,Ce)):(0,t.createCommentVNode)(``,!0),_t.value&&i.showPreviewButton?((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:5,type:`button`,class:`code-action-btn p-2 text-xs rounded-md transition-colors hover:bg-[var(--vscode-editor-selectionBackground)]`,"aria-label":(0,t.unref)(c)(`common.preview`)||`Preview`,onClick:kt,onMouseenter:a[16]||=e=>Z(e,(0,t.unref)(c)(`common.preview`)||`Preview`),onFocus:a[17]||=e=>Z(e,(0,t.unref)(c)(`common.preview`)||`Preview`),onMouseleave:Q,onBlur:Q},[...a[26]||=[(0,t.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`g`,{fill:`currentColor`,"fill-rule":`evenodd`,"clip-rule":`evenodd`},[(0,t.createElementVNode)(`path`,{d:`M23.628 7.41c-.12-1.172-.08-3.583-.9-4.233c-1.921-1.51-6.143-1.11-8.815-1.19c-3.481-.15-7.193.14-10.625.24a.34.34 0 0 0 0 .67c3.472-.05 7.074-.29 10.575-.09c2.471.15 6.653-.14 8.254 1.16c.4.33.41 2.732.49 3.582a42 42 0 0 1 .08 9.005a13.8 13.8 0 0 1-.45 3.001c-2.42 1.4-19.69 2.381-20.72.55a21 21 0 0 1-.65-4.632a41.5 41.5 0 0 1 .12-7.964c.08 0 7.334.33 12.586.24c2.331 0 4.682-.13 6.764-.21a.33.33 0 0 0 0-.66c-7.714-.16-12.897-.43-19.31.05c.11-1.38.48-3.922.38-4.002a.3.3 0 0 0-.42 0c-.37.41-.29 1.77-.36 2.251s-.14 1.07-.2 1.6a45 45 0 0 0-.36 8.645a21.8 21.8 0 0 0 .66 5.002c1.46 2.702 17.248 1.461 20.95.43c1.45-.4 1.69-.8 1.871-1.95c.575-3.809.602-7.68.08-11.496`}),(0,t.createElementVNode)(`path`,{d:`M4.528 5.237a.84.84 0 0 0-.21-1c-.77-.41-1.71.39-1 1.1a.83.83 0 0 0 1.21-.1m2.632-.25c.14-.14.19-.84-.2-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.2-.09m2.88 0a.83.83 0 0 0-.21-1c-.77-.41-1.71.39-1 1.09a.82.82 0 0 0 1.21-.09m-4.29 8.735c0 .08.23 2.471.31 2.561a.371.371 0 0 0 .63-.14c0-.09 0 0 .15-1.72a10 10 0 0 0-.11-2.232a5.3 5.3 0 0 1-.26-1.37a.3.3 0 0 0-.54-.24a6.8 6.8 0 0 0-.2 2.33c-1.281-.38-1.121.13-1.131-.42a15 15 0 0 0-.19-1.93c-.16-.17-.36-.17-.51.14a20 20 0 0 0-.43 3.471c.04.773.18 1.536.42 2.272c.26.4.7.22.7-.1c0-.09-.16-.09 0-1.862c.06-1.18-.23-.3 1.16-.76m5.033-2.552c.32-.07.41-.28.39-.37c0-.55-3.322-.34-3.462-.24s-.2.18-.18.28s0 .11 0 .16a3.8 3.8 0 0 0 1.591.361v.82a15 15 0 0 0-.13 3.132c0 .2-.09.94.17 1.16a.34.34 0 0 0 .48 0c.125-.35.196-.718.21-1.09a8 8 0 0 0 .14-3.232c0-.13.05-.7-.1-.89a8 8 0 0 0 .89-.09m5.544-.181a.69.69 0 0 0-.89-.44a2.8 2.8 0 0 0-1.252 1.001a2.3 2.3 0 0 0-.41-.83a1 1 0 0 0-1.6.27a7 7 0 0 0-.35 2.07c0 .571 0 2.642.06 2.762c.14 1.09 1 .51.63.13a17.6 17.6 0 0 1 .38-3.962c.32-1.18.32.2.39.51s.11 1.081.73 1.081s.48-.93 1.401-1.78q.075 1.345 0 2.69a15 15 0 0 0 0 1.811a.34.34 0 0 0 .68 0q.112-.861.11-1.73a16.7 16.7 0 0 0 .12-3.582m1.441-.201c-.05.16-.3 3.002-.31 3.202a6.3 6.3 0 0 0 .21 1.741c.33 1 1.21 1.07 2.291.82a3.7 3.7 0 0 0 1.14-.23c.21-.22.10-.59-.41-.64q-.817.096-1.64.07c-.44-.07-.34 0-.67-4.442q.015-.185 0-.37a.316.316 0 0 0-.23-.38a.316.316 0 0 0-.38.23`})])],-1)]],40,Ee)):(0,t.createCommentVNode)(``,!0)])],!0)],4)):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`div`,De,[(0,t.createElementVNode)(`div`,{ref_key:`codeEditor`,ref:f,class:(0,t.normalizeClass)([`code-editor-container`,[n.stream?``:`code-height-placeholder`,{"is-hidden":Ye.value}]]),style:(0,t.normalizeStyle)(rt.value)},null,6),Ye.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(e.m),{key:0,class:(0,t.normalizeClass)([`code-pre-fallback`,{"is-wrap":Je.value}]),style:(0,t.normalizeStyle)(tt.value),node:i.node},null,8,[`class`,`style`,`node`])):(0,t.createCommentVNode)(``,!0)],512),[[t.vShow,!(x.value||!n.stream&&n.loading)]]),Xe.value&&!s.value&&_t.value&&h.value===`html`?((0,t.openBlock)(),(0,t.createBlock)(ee,{key:1,code:i.node.code,"is-dark":i.isDark,"on-close":()=>Xe.value=!1},null,8,[`code`,`is-dark`,`on-close`])):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:`code-loading-placeholder`,style:(0,t.normalizeStyle)(it.value)},[(0,t.renderSlot)(r.$slots,`loading`,{loading:n.loading,stream:n.stream},()=>[a[27]||=(0,t.createElementVNode)(`div`,{class:`loading-skeleton`},[(0,t.createElementVNode)(`div`,{class:`skeleton-line`}),(0,t.createElementVNode)(`div`,{class:`skeleton-line`}),(0,t.createElementVNode)(`div`,{class:`skeleton-line short`})],-1)],!0)],4),[[t.vShow,!n.stream&&n.loading]]),(0,t.createElementVNode)(`span`,Oe,(0,t.toDisplayString)(m.value?(0,t.unref)(c)(`common.copied`)||`Copied`:``),1)],14,oe))}}),[[`__scopeId`,`data-v-1a55f98f`]]);exports.default=Ae;