@codingame/monaco-vscode-mermaid-markdown-features-default-extension 33.0.9 → 34.0.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/extension.ts", "../../src/chatOutputRenderer.ts", "../../src/util/html.ts", "../../src/util/uuid.ts", "../../src/util/dispose.ts", "../../src/editorManager.ts", "../../src/markdownMermaid/config.ts", "../../src/markdownMermaid/markdownIt.ts", "../../src/webviewManager.ts"],
4
- "sourcesContent": ["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\nimport { registerChatSupport } from './chatOutputRenderer';\nimport { MermaidEditorManager } from './editorManager';\nimport { configSection, injectMermaidConfig } from './markdownMermaid/config';\nimport { extendMarkdownItWithMermaid } from './markdownMermaid/markdownIt';\nimport { MermaidCommandContext, MermaidWebviewManager } from './webviewManager';\nimport type MarkdownIt from 'markdown-it';\n\nexport function activate(context: vscode.ExtensionContext) {\n\tconst webviewManager = new MermaidWebviewManager();\n\n\tconst editorManager = new MermaidEditorManager(context.extensionUri, webviewManager);\n\tcontext.subscriptions.push(editorManager);\n\n\t// Register chat support\n\tcontext.subscriptions.push(registerChatSupport(context, webviewManager, editorManager));\n\n\t// Register commands\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('_mermaid-markdown.resetPanZoom', (ctx?: { mermaidWebviewId?: string }) => {\n\t\t\twebviewManager.resetPanZoom(ctx?.mermaidWebviewId);\n\t\t})\n\t);\n\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('_mermaid-markdown.copySource', (ctx?: MermaidCommandContext) => {\n\t\t\tif (typeof ctx?.mermaidSource === 'string') {\n\t\t\t\tvoid vscode.env.clipboard.writeText(ctx.mermaidSource);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst webviewInfo = ctx?.mermaidWebviewId ? webviewManager.getWebview(ctx.mermaidWebviewId) : webviewManager.activeWebview;\n\t\t\tif (webviewInfo) {\n\t\t\t\tvoid vscode.env.clipboard.writeText(webviewInfo.mermaidSource);\n\t\t\t}\n\t\t})\n\t);\n\n\tcontext.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => {\n\t\tif (e.affectsConfiguration(`${configSection}.languages`)) {\n\t\t\tvoid vscode.commands.executeCommand('markdown.api.reloadPlugins');\n\t\t}\n\t\tif (e.affectsConfiguration(configSection) || e.affectsConfiguration('workbench.colorTheme')) {\n\t\t\tvoid vscode.commands.executeCommand('markdown.preview.refresh');\n\t\t}\n\t}));\n\n\treturn {\n\t\textendMarkdownIt(md: MarkdownIt) {\n\t\t\textendMarkdownItWithMermaid(md, {\n\t\t\t\tlanguageIds: () => vscode.workspace.getConfiguration(configSection).get<readonly string[]>('languages', ['mermaid'])\n\t\t\t});\n\t\t\tmd.use(injectMermaidConfig);\n\t\t\treturn md;\n\t\t}\n\t};\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\nimport { MermaidEditorManager } from './editorManager';\nimport { MermaidCommandContext, MermaidWebviewManager } from './webviewManager';\nimport { escapeHtmlText } from './util/html';\nimport { generateUuid } from './util/uuid';\nimport { disposeAll } from './util/dispose';\n\n/**\n * Mime type used to identify Mermaid diagram data in chat output.\n */\nconst mime = 'text/vnd.mermaid';\n\n/**\n * View type that uniquely identifies the Mermaid chat output renderer.\n */\nconst viewType = 'vscode.mermaid-markdown-features.chatOutputItem';\n\nclass MermaidChatOutputRenderer implements vscode.ChatOutputRenderer {\n\n\tconstructor(\n\t\tprivate readonly _extensionUri: vscode.Uri,\n\t\tprivate readonly _webviewManager: MermaidWebviewManager\n\t) { }\n\n\tasync renderChatOutput({ value }: vscode.ChatOutputDataItem, chatOutputWebview: vscode.ChatOutputWebview, _ctx: unknown, _token: vscode.CancellationToken): Promise<void> {\n\t\tconst webview = chatOutputWebview.webview;\n\t\tconst decoded = decodeMermaidData(value);\n\t\tconst mermaidSource = decoded.source;\n\t\tconst title = decoded.title;\n\n\t\t// Generate unique ID for this webview\n\t\tconst webviewId = generateUuid();\n\n\t\tconst disposables: vscode.Disposable[] = [];\n\n\t\t// Register and set as active\n\t\tdisposables.push(this._webviewManager.registerWebview(webviewId, webview, mermaidSource, title, 'chat'));\n\n\t\t// Listen for messages from the webview\n\t\tdisposables.push(webview.onDidReceiveMessage(message => {\n\t\t\tif (message.type === 'openInEditor') {\n\t\t\t\tvoid vscode.commands.executeCommand('_mermaid-markdown.openInEditor', { mermaidWebviewId: webviewId });\n\t\t\t}\n\t\t}));\n\n\t\t// Dispose resources when webview is disposed\n\t\tchatOutputWebview.onDidDispose(() => {\n\t\t\tdisposeAll(disposables);\n\t\t});\n\n\t\t// Set the options for the webview\n\t\tconst mediaRoot = vscode.Uri.joinPath(this._extensionUri, 'chat-webview-out');\n\t\twebview.options = {\n\t\t\tenableScripts: true,\n\t\t\tlocalResourceRoots: [mediaRoot],\n\t\t};\n\n\t\t// Set the HTML content for the webview\n\t\tconst nonce = generateUuid();\n\t\tconst mermaidScript = vscode.Uri.joinPath(mediaRoot, 'index.js');\n\t\tconst codiconsUri = webview.asWebviewUri(vscode.Uri.joinPath(mediaRoot, 'codicon.css'));\n\t\tconst openInEditorLabel = vscode.l10n.t('Open Diagram in Editor');\n\n\t\twebview.html = `\n\t\t\t<!DOCTYPE html>\n\t\t\t<html lang=\"en\">\n\n\t\t\t<head>\n\t\t\t\t<meta charset=\"UTF-8\">\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\t\t<title>Mermaid Diagram</title>\n\t\t\t\t<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; script-src 'nonce-${nonce}'; style-src ${webview.cspSource} 'unsafe-inline'; font-src data:;\" />\n\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"${codiconsUri}\" crossorigin=\"anonymous\">\n\n\t\t\t\t<style>\n\t\t\t\t\tbody {\n\t\t\t\t\t\tpadding: 0;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid {\n\t\t\t\t\t\tvisibility: hidden;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid.rendered {\n\t\t\t\t\t\tvisibility: visible;\n\t\t\t\t\t}\n\t\t\t\t\t.open-in-editor-btn {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: 8px;\n\t\t\t\t\t\tright: 8px;\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\twidth: 26px;\n\t\t\t\t\t\theight: 26px;\n\t\t\t\t\t\tbackground: var(--vscode-editorWidget-background);\n\t\t\t\t\t\tcolor: var(--vscode-icon-foreground);\n\t\t\t\t\t\tborder: 1px solid var(--vscode-editorWidget-border);\n\t\t\t\t\t\tborder-radius: 6px;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\tz-index: 100;\n\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\ttransition: opacity 0.2s;\n\t\t\t\t\t}\n\t\t\t\t\tbody:hover .open-in-editor-btn,\n\t\t\t\t\t.open-in-editor-btn:focus {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t}\n\t\t\t\t\t.open-in-editor-btn:hover {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\tbackground: var(--vscode-toolbar-hoverBackground);\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t</head>\n\n\t\t\t<body data-vscode-context='${JSON.stringify({ preventDefaultContextMenuItems: true, mermaidWebviewId: webviewId })}' data-vscode-mermaid-webview-id=\"${webviewId}\">\n\t\t\t\t<button class=\"open-in-editor-btn\" title=\"${openInEditorLabel}\" aria-label=\"${openInEditorLabel}\"><i class=\"codicon codicon-open-preview\" aria-hidden=\"true\"></i></button>\n\t\t\t\t<pre class=\"mermaid\">\n\t\t\t\t\t${escapeHtmlText(mermaidSource)}\n\t\t\t\t</pre>\n\n\t\t\t\t<script type=\"module\" nonce=\"${nonce}\" src=\"${webview.asWebviewUri(mermaidScript)}\"></script>\n\t\t\t</body>\n\t\t\t</html>`;\n\t}\n}\n\n\nexport function registerChatSupport(\n\tcontext: vscode.ExtensionContext,\n\twebviewManager: MermaidWebviewManager,\n\teditorManager: MermaidEditorManager\n): vscode.Disposable {\n\tconst disposables: vscode.Disposable[] = [];\n\n\tdisposables.push(\n\t\tvscode.commands.registerCommand('_mermaid-markdown.openInEditor', (ctx?: MermaidCommandContext) => {\n\t\t\tif (typeof ctx?.mermaidSource === 'string') {\n\t\t\t\teditorManager.openPreview(ctx.mermaidSource, typeof ctx.title === 'string' ? ctx.title : undefined);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst webviewInfo = ctx?.mermaidWebviewId ? webviewManager.getWebview(ctx.mermaidWebviewId) : webviewManager.activeWebview;\n\t\t\tif (webviewInfo) {\n\t\t\t\teditorManager.openPreview(webviewInfo.mermaidSource, webviewInfo.title);\n\t\t\t}\n\t\t})\n\t);\n\n\t// Register lm tools\n\tdisposables.push(\n\t\tvscode.lm.registerTool<{ markup: string; title?: string }>('renderMermaidDiagram', {\n\t\t\tinvoke: async (options, _token) => {\n\t\t\t\tconst sourceCode = options.input.markup;\n\t\t\t\tconst title = options.input.title;\n\t\t\t\treturn writeMermaidToolOutput(sourceCode, title);\n\t\t\t},\n\t\t})\n\t);\n\n\t// Register the chat output renderer for Mermaid diagrams.\n\t// This will be invoked with the data generated by the tools.\n\t// It can also be invoked when rendering old Mermaid diagrams in the chat history.\n\tconst renderer = new MermaidChatOutputRenderer(context.extensionUri, webviewManager);\n\tdisposables.push(vscode.chat.registerChatOutputRenderer(viewType, renderer));\n\n\treturn vscode.Disposable.from(...disposables);\n}\n\nfunction writeMermaidToolOutput(sourceCode: string, title: string | undefined): vscode.LanguageModelToolResult {\n\t// Expose the source code as a markdown mermaid code block\n\tconst fence = getFenceForContent(sourceCode);\n\tconst result = new vscode.LanguageModelToolResult([\n\t\tnew vscode.LanguageModelTextPart(`${fence}mermaid\\n${sourceCode}\\n${fence}`)\n\t]);\n\n\t// And store custom data in the tool result details to indicate that a custom renderer should be used for it.\n\t// Encode source and optional title as JSON.\n\tconst data = JSON.stringify({ source: sourceCode, title });\n\t// Add cast to use proposed API\n\t(result as vscode.ExtendedLanguageModelToolResult2).toolResultDetails2 = {\n\t\tmime,\n\t\tvalue: new TextEncoder().encode(data),\n\t};\n\n\treturn result;\n}\n\nfunction getFenceForContent(content: string): string {\n\tconst backtickMatch = content.matchAll(/`+/g);\n\tif (!backtickMatch) {\n\t\treturn '```';\n\t}\n\n\tconst maxBackticks = Math.max(...Array.from(backtickMatch, s => s[0].length));\n\treturn '`'.repeat(Math.max(3, maxBackticks + 1));\n}\n\ninterface MermaidData {\n\treadonly title: string | undefined;\n\treadonly source: string;\n}\n\nfunction decodeMermaidData(value: Uint8Array): MermaidData {\n\tconst text = new TextDecoder().decode(value);\n\n\t// Try to parse as JSON (new format with title), fall back to plain text (legacy format)\n\ttry {\n\t\tconst parsed = JSON.parse(text);\n\t\tif (typeof parsed === 'object' && typeof parsed.source === 'string') {\n\t\t\treturn { title: parsed.title, source: parsed.source };\n\t\t}\n\t} catch {\n\t\t// Not JSON, treat as legacy plain text format\n\t}\n\n\treturn { title: undefined, source: text };\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function escapeHtmlText(str: string): string {\n\treturn str\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&#39;');\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/**\n * Copied from src/vs/base/common/uuid.ts\n */\nexport function generateUuid(): string {\n\t// use `randomUUID` if possible\n\tif (typeof crypto.randomUUID === 'function') {\n\t\t// see https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto\n\t\t// > Although crypto is available on all windows, the returned Crypto object only has one\n\t\t// > usable feature in insecure contexts: the getRandomValues() method.\n\t\t// > In general, you should use this API only in secure contexts.\n\n\t\treturn crypto.randomUUID.bind(crypto)();\n\t}\n\n\t// prep-work\n\tconst _data = new Uint8Array(16);\n\tconst _hex: string[] = [];\n\tfor (let i = 0; i < 256; i++) {\n\t\t_hex.push(i.toString(16).padStart(2, '0'));\n\t}\n\n\t// get data\n\tcrypto.getRandomValues(_data);\n\n\t// set version bits\n\t_data[6] = (_data[6] & 0x0f) | 0x40;\n\t_data[8] = (_data[8] & 0x3f) | 0x80;\n\n\t// print as string\n\tlet i = 0;\n\tlet result = '';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\treturn result;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\n\nexport function disposeAll(disposables: vscode.Disposable[]) {\n\twhile (disposables.length) {\n\t\tconst item = disposables.pop();\n\t\titem?.dispose();\n\t}\n}\n\nexport abstract class Disposable {\n\tprivate _isDisposed = false;\n\n\tprotected _disposables: vscode.Disposable[] = [];\n\n\tpublic dispose(): any {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isDisposed = true;\n\t\tdisposeAll(this._disposables);\n\t}\n\n\tprotected _register<T extends vscode.Disposable>(value: T): T {\n\t\tif (this._isDisposed) {\n\t\t\tvalue.dispose();\n\t\t} else {\n\t\t\tthis._disposables.push(value);\n\t\t}\n\t\treturn value;\n\t}\n\n\tprotected get isDisposed() {\n\t\treturn this._isDisposed;\n\t}\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\nimport { generateUuid } from './util/uuid';\nimport { MermaidWebviewManager } from './webviewManager';\nimport { escapeHtmlText } from './util/html';\nimport { Disposable } from './util/dispose';\n\nexport const mermaidEditorViewType = 'vscode.mermaid-markdown-features.preview';\n\ninterface MermaidPreviewState {\n\treadonly webviewId: string;\n\treadonly mermaidSource: string;\n}\n\n/**\n * Manages mermaid diagram editor panels, ensuring only one editor per diagram.\n */\nexport class MermaidEditorManager extends Disposable implements vscode.WebviewPanelSerializer {\n\n\tprivate readonly _previews = new Map<string, MermaidPreview>();\n\n\tconstructor(\n\t\tprivate readonly _extensionUri: vscode.Uri,\n\t\tprivate readonly _webviewManager: MermaidWebviewManager\n\t) {\n\t\tsuper();\n\n\t\tthis._register(vscode.window.registerWebviewPanelSerializer(mermaidEditorViewType, this));\n\t}\n\n\t/**\n\t * Opens a preview for the given diagram\n\t *\n\t * If a preview already exists for this diagram, it will be revealed instead of creating a new one.\n\t */\n\tpublic openPreview(mermaidSource: string, title?: string): void {\n\t\tconst webviewId = getWebviewId(mermaidSource);\n\t\tconst existingPreview = this._previews.get(webviewId);\n\t\tif (existingPreview) {\n\t\t\texistingPreview.reveal();\n\t\t\treturn;\n\t\t}\n\n\t\tconst preview = MermaidPreview.create(\n\t\t\twebviewId,\n\t\t\tmermaidSource,\n\t\t\ttitle,\n\t\t\tthis._extensionUri,\n\t\t\tthis._webviewManager,\n\t\t\tvscode.ViewColumn.Active);\n\n\t\tthis._registerPreview(preview);\n\t}\n\n\tpublic async deserializeWebviewPanel(\n\t\twebviewPanel: vscode.WebviewPanel,\n\t\tstate: MermaidPreviewState\n\t): Promise<void> {\n\t\tif (!state?.mermaidSource) {\n\t\t\twebviewPanel.webview.html = this._getErrorHtml();\n\t\t\treturn;\n\t\t}\n\n\t\tconst webviewId = getWebviewId(state.mermaidSource);\n\n\t\tconst preview = MermaidPreview.revive(\n\t\t\twebviewPanel,\n\t\t\twebviewId,\n\t\t\tstate.mermaidSource,\n\t\t\tthis._extensionUri,\n\t\t\tthis._webviewManager\n\t\t);\n\n\t\tthis._registerPreview(preview);\n\t}\n\n\tprivate _registerPreview(preview: MermaidPreview): void {\n\t\tthis._previews.set(preview.diagramId, preview);\n\n\t\tpreview.onDispose(() => {\n\t\t\tthis._previews.delete(preview.diagramId);\n\t\t});\n\t}\n\n\tprivate _getErrorHtml(): string {\n\t\treturn /* html */`<!DOCTYPE html>\n\t\t\t<html lang=\"en\">\n\t\t\t<head>\n\t\t\t\t<meta charset=\"UTF-8\">\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\t\t<title>Mermaid Preview</title>\n\t\t\t\t<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none';\">\n\t\t\t\t<style>\n\t\t\t\t\tbody {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\theight: 100vh;\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<p>An unexpected error occurred while restoring the Mermaid preview.</p>\n\t\t\t</body>\n\t\t\t</html>`;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\n\t\tfor (const preview of this._previews.values()) {\n\t\t\tpreview.dispose();\n\t\t}\n\t\tthis._previews.clear();\n\t}\n}\n\nclass MermaidPreview extends Disposable {\n\n\tprivate readonly _onDisposeEmitter = this._register(new vscode.EventEmitter<void>());\n\tpublic readonly onDispose = this._onDisposeEmitter.event;\n\n\tpublic static create(\n\t\tdiagramId: string,\n\t\tmermaidSource: string,\n\t\ttitle: string | undefined,\n\t\textensionUri: vscode.Uri,\n\t\twebviewManager: MermaidWebviewManager,\n\t\tviewColumn: vscode.ViewColumn\n\t): MermaidPreview {\n\t\tconst webviewPanel = vscode.window.createWebviewPanel(\n\t\t\tmermaidEditorViewType,\n\t\t\ttitle ?? vscode.l10n.t('Mermaid Diagram'),\n\t\t\tviewColumn,\n\t\t\t{\n\t\t\t\tretainContextWhenHidden: false,\n\t\t\t}\n\t\t);\n\n\t\treturn new MermaidPreview(webviewPanel, diagramId, mermaidSource, extensionUri, webviewManager);\n\t}\n\n\tpublic static revive(\n\t\twebviewPanel: vscode.WebviewPanel,\n\t\tdiagramId: string,\n\t\tmermaidSource: string,\n\t\textensionUri: vscode.Uri,\n\t\twebviewManager: MermaidWebviewManager\n\t): MermaidPreview {\n\t\treturn new MermaidPreview(webviewPanel, diagramId, mermaidSource, extensionUri, webviewManager);\n\t}\n\n\tprivate constructor(\n\t\tprivate readonly _webviewPanel: vscode.WebviewPanel,\n\t\tpublic readonly diagramId: string,\n\t\tprivate readonly _mermaidSource: string,\n\t\tprivate readonly _extensionUri: vscode.Uri,\n\t\tprivate readonly _webviewManager: MermaidWebviewManager\n\t) {\n\t\tsuper();\n\n\t\tthis._webviewPanel.iconPath = new vscode.ThemeIcon('graph');\n\n\t\tthis._webviewPanel.webview.options = {\n\t\t\tenableScripts: true,\n\t\t\tlocalResourceRoots: [\n\t\t\t\tvscode.Uri.joinPath(this._extensionUri, 'chat-webview-out')\n\t\t\t],\n\t\t};\n\n\t\tthis._webviewPanel.webview.html = this._getHtml();\n\n\t\t// Register with the webview manager\n\t\tthis._register(this._webviewManager.registerWebview(this.diagramId, this._webviewPanel.webview, this._mermaidSource, undefined, 'editor'));\n\n\t\tthis._register(this._webviewPanel.onDidChangeViewState(e => {\n\t\t\tif (e.webviewPanel.active) {\n\t\t\t\tthis._webviewManager.setActiveWebview(this.diagramId);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._webviewPanel.onDidDispose(() => {\n\t\t\tthis._onDisposeEmitter.fire();\n\t\t\tthis.dispose();\n\t\t}));\n\t}\n\n\tpublic reveal(): void {\n\t\tthis._webviewPanel.reveal();\n\t}\n\n\tpublic override dispose() {\n\t\tthis._onDisposeEmitter.fire();\n\n\t\tsuper.dispose();\n\n\t\tthis._webviewPanel.dispose();\n\t}\n\n\tprivate _getHtml(): string {\n\t\tconst nonce = generateUuid();\n\n\t\tconst mediaRoot = vscode.Uri.joinPath(this._extensionUri, 'chat-webview-out');\n\t\tconst scriptUri = this._webviewPanel.webview.asWebviewUri(\n\t\t\tvscode.Uri.joinPath(mediaRoot, 'index-editor.js')\n\t\t);\n\t\tconst codiconsUri = this._webviewPanel.webview.asWebviewUri(\n\t\t\tvscode.Uri.joinPath(mediaRoot, 'codicon.css')\n\t\t);\n\t\tconst togglePanModeLabel = vscode.l10n.t('Toggle Pan Mode');\n\t\tconst zoomOutLabel = vscode.l10n.t('Zoom Out');\n\t\tconst zoomInLabel = vscode.l10n.t('Zoom In');\n\t\tconst resetPanZoomLabel = vscode.l10n.t('Reset Pan and Zoom');\n\n\t\treturn /* html */`<!DOCTYPE html>\n\t\t\t<html lang=\"en\">\n\t\t\t<head>\n\t\t\t\t<meta charset=\"UTF-8\">\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\t\t<title>Mermaid Diagram</title>\n\t\t\t\t<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; script-src 'nonce-${nonce}'; style-src ${this._webviewPanel.webview.cspSource} 'unsafe-inline'; font-src data:;\" />\n\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"${codiconsUri}\" crossorigin=\"anonymous\">\n\t\t\t\t<style>\n\t\t\t\t\thtml, body {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t\tpadding: 0;\n\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid {\n\t\t\t\t\t\tvisibility: hidden;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid.rendered {\n\t\t\t\t\t\tvisibility: visible;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid-wrapper {\n\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t}\n\t\t\t\t\t.zoom-controls {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: 8px;\n\t\t\t\t\t\tright: 8px;\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tgap: 2px;\n\t\t\t\t\t\tz-index: 100;\n\t\t\t\t\t\tbackground: var(--vscode-editorWidget-background);\n\t\t\t\t\t\tborder: 1px solid var(--vscode-editorWidget-border);\n\t\t\t\t\t\tborder-radius: 6px;\n\t\t\t\t\t\tpadding: 3px;\n\t\t\t\t\t}\n\t\t\t\t\t.zoom-controls button {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\twidth: 26px;\n\t\t\t\t\t\theight: 26px;\n\t\t\t\t\t\tbackground: transparent;\n\t\t\t\t\t\tcolor: var(--vscode-icon-foreground);\n\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\t\t\t\t\t.zoom-controls button:hover {\n\t\t\t\t\t\tbackground: var(--vscode-toolbar-hoverBackground);\n\t\t\t\t\t}\n\t\t\t\t\t.zoom-controls button.active {\n\t\t\t\t\t\tbackground: var(--vscode-toolbar-activeBackground);\n\t\t\t\t\t\tcolor: var(--vscode-focusBorder);\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t</head>\n\t\t\t<body data-vscode-context='${JSON.stringify({ preventDefaultContextMenuItems: true, mermaidWebviewId: this.diagramId })}' data-vscode-mermaid-webview-id=\"${this.diagramId}\">\n\t\t\t\t<div class=\"zoom-controls\">\n\t\t\t\t\t<button class=\"pan-mode-btn\" title=\"${togglePanModeLabel}\" aria-label=\"${togglePanModeLabel}\" aria-pressed=\"false\"><i class=\"codicon codicon-move\" aria-hidden=\"true\"></i></button>\n\t\t\t\t\t<button class=\"zoom-out-btn\" title=\"${zoomOutLabel}\" aria-label=\"${zoomOutLabel}\"><i class=\"codicon codicon-zoom-out\" aria-hidden=\"true\"></i></button>\n\t\t\t\t\t<button class=\"zoom-in-btn\" title=\"${zoomInLabel}\" aria-label=\"${zoomInLabel}\"><i class=\"codicon codicon-zoom-in\" aria-hidden=\"true\"></i></button>\n\t\t\t\t\t<button class=\"zoom-reset-btn\" title=\"${resetPanZoomLabel}\" aria-label=\"${resetPanZoomLabel}\"><i class=\"codicon codicon-screen-normal\" aria-hidden=\"true\"></i></button>\n\t\t\t\t</div>\n\t\t\t\t<pre class=\"mermaid\">\n\t\t\t\t\t${escapeHtmlText(this._mermaidSource)}\n\t\t\t\t</pre>\n\t\t\t\t<script type=\"module\" nonce=\"${nonce}\" src=\"${scriptUri}\"></script>\n\t\t\t</body>\n\t\t\t</html>`;\n\t}\n}\n\n\n/**\n * Generates a unique ID for a diagram based on its content.\n * This ensures the same diagram content always gets the same ID.\n */\nfunction getWebviewId(source: string): string {\n\t// Simple hash function for generating a content-based ID\n\tlet hash = 0;\n\tfor (let i = 0; i < source.length; i++) {\n\t\tconst char = source.charCodeAt(i);\n\t\thash = ((hash << 5) - hash) + char;\n\t\thash = hash & hash; // Convert to 32-bit integer\n\t}\n\treturn Math.abs(hash).toString(16);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\n\nimport type MarkdownIt from 'markdown-it';\n\nexport const configSection = 'markdown-mermaid';\n\nconst enum ClickDragMode {\n\tAlt = 'alt'\n}\n\nconst enum ShowControlsMode {\n\tOnHoverOrFocus = 'onHoverOrFocus'\n}\n\nconst defaultMermaidTheme = 'default';\nconst validMermaidThemes = [\n\t'base',\n\t'forest',\n\t'dark',\n\t'default',\n\t'neutral',\n];\n\nfunction sanitizeMermaidTheme(theme: string | undefined): string {\n\treturn typeof theme === 'string' && validMermaidThemes.includes(theme) ? theme : defaultMermaidTheme;\n}\n\nexport function injectMermaidConfig(md: MarkdownIt): MarkdownIt {\n\tconst render = md.renderer.render;\n\tmd.renderer.render = function (...args) {\n\t\tconst config = vscode.workspace.getConfiguration(configSection);\n\t\tconst configData = {\n\t\t\tdarkModeTheme: sanitizeMermaidTheme(config.get('darkModeTheme')),\n\t\t\tlightModeTheme: sanitizeMermaidTheme(config.get('lightModeTheme')),\n\t\t\tmaxTextSize: config.get('maxTextSize'),\n\t\t\tclickDrag: config.get('mouseNavigation.enabled', ClickDragMode.Alt),\n\t\t\tshowControls: config.get('controls.show', ShowControlsMode.OnHoverOrFocus),\n\t\t\tresizable: config.get('resizable', true),\n\t\t\tmaxHeight: config.get('maxHeight', ''),\n\t\t};\n\n\t\tconst escapedConfig = escapeHtmlAttribute(JSON.stringify(configData));\n\t\treturn `<span id=\"${configSection}\" aria-hidden=\"true\" data-config=\"${escapedConfig}\"></span>\n\t\t\t\t${render.apply(md.renderer, args)}`;\n\t};\n\treturn md;\n}\n\nfunction escapeHtmlAttribute(str: string): string {\n\treturn str\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;');\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport type MarkdownIt from 'markdown-it';\n\nconst mermaidLanguageId = 'mermaid';\nconst containerTokenName = 'mermaidContainer';\n\nconst minMarkers = 3;\nconst markerStr = ':';\nconst markerChar = markerStr.charCodeAt(0);\nconst markerLen = markerStr.length;\n\n/**\n * Extends markdown-it so that it can render mermaid diagrams.\n *\n * This does not actually implement rendering of mermaid diagrams. Instead we just make sure that mermaid\n * block syntax is properly parsed by markdown-it. All actual mermaid rendering happens in the webview\n * where the markdown is rendered.\n */\nexport function extendMarkdownItWithMermaid(md: MarkdownIt, config: { languageIds(): readonly string[] }): MarkdownIt {\n\tmd.use((md: MarkdownIt) => {\n\t\tfunction container(state: MarkdownIt.StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n\t\t\tlet pos: number;\n\t\t\tlet autoClosed = false;\n\t\t\tlet start = state.bMarks[startLine] + state.tShift[startLine];\n\t\t\tlet max = state.eMarks[startLine];\n\n\t\t\tif (markerChar !== state.src.charCodeAt(start)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (pos = start + 1; pos <= max; pos++) {\n\t\t\t\tif (markerStr[(pos - start) % markerLen] !== state.src[pos]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst markerCount = Math.floor((pos - start) / markerLen);\n\t\t\tif (markerCount < minMarkers) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tpos -= (pos - start) % markerLen;\n\n\t\t\tconst markup = state.src.slice(start, pos);\n\t\t\tconst params = state.src.slice(pos, max);\n\t\t\tif (params.trim().split(' ')[0].toLowerCase() !== mermaidLanguageId) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (silent) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tlet nextLine = startLine;\n\n\t\t\tfor (; ;) {\n\t\t\t\tnextLine++;\n\t\t\t\tif (nextLine >= endLine) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tstart = state.bMarks[nextLine] + state.tShift[nextLine];\n\t\t\t\tmax = state.eMarks[nextLine];\n\n\t\t\t\tif (start < max && state.sCount[nextLine] < state.blkIndent) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (markerChar !== state.src.charCodeAt(start)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (state.sCount[nextLine] - state.blkIndent >= 4) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (pos = start + 1; pos <= max; pos++) {\n\t\t\t\t\tif (markerStr[(pos - start) % markerLen] !== state.src[pos]) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (Math.floor((pos - start) / markerLen) < markerCount) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tpos -= (pos - start) % markerLen;\n\t\t\t\tpos = state.skipSpaces(pos);\n\n\t\t\t\tif (pos < max) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tautoClosed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst oldParent = state.parentType;\n\t\t\tconst oldLineMax = state.lineMax;\n\t\t\tstate.parentType = 'container' as MarkdownIt.StateBlock.ParentType;\n\n\t\t\tstate.lineMax = nextLine;\n\n\t\t\tconst containerToken = state.push(containerTokenName, 'div', 1);\n\t\t\tcontainerToken.markup = markup;\n\t\t\tcontainerToken.block = true;\n\t\t\tcontainerToken.info = params;\n\t\t\tcontainerToken.map = [startLine, nextLine];\n\t\t\tcontainerToken.content = state.getLines(startLine + 1, nextLine, state.blkIndent, true);\n\n\t\t\tstate.parentType = oldParent;\n\t\t\tstate.lineMax = oldLineMax;\n\t\t\tstate.line = nextLine + (autoClosed ? 1 : 0);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tmd.block.ruler.before('fence', containerTokenName, container, {\n\t\t\talt: ['paragraph', 'reference', 'blockquote', 'list']\n\t\t});\n\t\tmd.renderer.rules[containerTokenName] = (tokens: MarkdownIt.Token[], idx: number) => {\n\t\t\tconst token = tokens[idx];\n\t\t\tconst src = token.content;\n\t\t\treturn `<div class=\"${mermaidLanguageId}\">${preProcess(src)}</div>`;\n\t\t};\n\t});\n\n\tconst highlight = md.options.highlight;\n\tmd.options.highlight = (code: string, lang: string, attrs: string) => {\n\t\tconst reg = new RegExp('\\\\b(' + config.languageIds().map(escapeRegExp).join('|') + ')\\\\b', 'i');\n\t\tif (lang && reg.test(lang)) {\n\t\t\treturn `<pre class=\"${mermaidLanguageId}\" style=\"all: unset;\">${preProcess(code)}</pre>`;\n\t\t}\n\t\treturn highlight?.(code, lang, attrs) ?? code;\n\t};\n\treturn md;\n}\n\nfunction preProcess(source: string): string {\n\treturn source\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\\n+$/, '')\n\t\t.trimStart();\n}\n\nfunction escapeRegExp(string: string): string {\n\treturn string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\n\nexport interface MermaidWebviewInfo {\n\treadonly id: string;\n\treadonly webview: vscode.Webview;\n\treadonly mermaidSource: string;\n\treadonly title: string | undefined;\n\treadonly type: 'chat' | 'editor';\n}\n\nexport interface MermaidCommandContext {\n\treadonly mermaidWebviewId?: string;\n\treadonly mermaidSource?: string;\n\treadonly title?: string;\n}\n\n/**\n * Manages all mermaid webviews (both chat output renderers and editor previews).\n * Tracks the active webview and provides methods for interacting with webviews.\n */\nexport class MermaidWebviewManager {\n\n\tprivate _activeWebviewId: string | undefined;\n\tprivate readonly _webviews = new Map<string, MermaidWebviewInfo>();\n\n\t/**\n\t * Gets the currently active webview info.\n\t */\n\tpublic get activeWebview(): MermaidWebviewInfo | undefined {\n\t\treturn this._activeWebviewId ? this._webviews.get(this._activeWebviewId) : undefined;\n\t}\n\n\tpublic registerWebview(id: string, webview: vscode.Webview, mermaidSource: string, title: string | undefined, type: 'chat' | 'editor'): vscode.Disposable {\n\t\tif (this._webviews.has(id)) {\n\t\t\tthrow new Error(`Webview with id ${id} is already registered.`);\n\t\t}\n\n\t\tconst info: MermaidWebviewInfo = {\n\t\t\tid,\n\t\t\twebview,\n\t\t\tmermaidSource,\n\t\t\ttitle,\n\t\t\ttype\n\t\t};\n\t\tthis._webviews.set(id, info);\n\t\treturn { dispose: () => this.unregisterWebview(id) };\n\t}\n\n\tprivate unregisterWebview(id: string): void {\n\t\tthis._webviews.delete(id);\n\n\t\t// Clear active if this was the active webview\n\t\tif (this._activeWebviewId === id) {\n\t\t\tthis._activeWebviewId = undefined;\n\t\t}\n\t}\n\n\tpublic setActiveWebview(id: string): void {\n\t\tif (this._webviews.has(id)) {\n\t\t\tthis._activeWebviewId = id;\n\t\t}\n\t}\n\n\tpublic getWebview(id: string): MermaidWebviewInfo | undefined {\n\t\treturn this._webviews.get(id);\n\t}\n\n\t/**\n\t * Sends a reset pan/zoom message to a specific webview by ID.\n\t */\n\tpublic resetPanZoom(id: string | undefined): void {\n\t\tconst target = id ? this._webviews.get(id) : this.activeWebview;\n\t\ttarget?.webview.postMessage({ type: 'resetPanZoom' });\n\t}\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,cAAAE,KAAA,eAAAC,EAAAH,IAIA,IAAAI,EAAwB,qBCAxB,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F,EAEAN,EAAQ,cAAc,KACd,WAAS,gBAAgB,+BAAiCM,GAAgC,CAChG,GAAI,OAAOA,GAAK,eAAkB,SAAU,CAC/B,MAAI,UAAU,UAAUA,EAAI,aAAa,EACrD,MACD,CAEA,IAAMC,EAAcD,GAAK,iBAAmBL,EAAe,WAAWK,EAAI,gBAAgB,EAAIL,EAAe,cACzGM,GACS,MAAI,UAAU,UAAUA,EAAY,aAAa,CAE/D,CAAC,CACF,EAEAP,EAAQ,cAAc,KAAY,YAAU,yBAAyBQ,GAAK,CACrEA,EAAE,qBAAqB,GAAGC,CAAa,YAAY,GAC1C,WAAS,eAAe,4BAA4B,GAE7DD,EAAE,qBAAqBC,CAAa,GAAKD,EAAE,qBAAqB,sBAAsB,IAC7E,WAAS,eAAe,0BAA0B,CAEhE,CAAC,CAAC,EAEK,CACN,iBAAiBE,EAAgB,CAChC,OAAAC,EAA4BD,EAAI,CAC/B,YAAa,IAAa,YAAU,iBAAiBD,CAAa,EAAE,IAAuB,YAAa,CAAC,SAAS,CAAC,CACpH,CAAC,EACDC,EAAG,IAAIE,CAAmB,EACnBF,CACR,CACD,CACD",
6
- "names": ["extension_exports", "__export", "activate", "__toCommonJS", "vscode", "vscode", "escapeHtmlText", "str", "generateUuid", "_data", "_hex", "i", "result", "disposeAll", "disposables", "Disposable", "value", "mime", "viewType", "MermaidChatOutputRenderer", "_extensionUri", "_webviewManager", "value", "chatOutputWebview", "_ctx", "_token", "webview", "decoded", "decodeMermaidData", "mermaidSource", "title", "webviewId", "generateUuid", "disposables", "message", "disposeAll", "mediaRoot", "nonce", "mermaidScript", "codiconsUri", "openInEditorLabel", "escapeHtmlText", "registerChatSupport", "context", "webviewManager", "editorManager", "ctx", "webviewInfo", "options", "sourceCode", "writeMermaidToolOutput", "renderer", "fence", "getFenceForContent", "result", "data", "content", "backtickMatch", "maxBackticks", "s", "text", "parsed", "vscode", "mermaidEditorViewType", "MermaidEditorManager", "Disposable", "_extensionUri", "_webviewManager", "mermaidSource", "title", "webviewId", "getWebviewId", "existingPreview", "preview", "MermaidPreview", "webviewPanel", "state", "_MermaidPreview", "_webviewPanel", "diagramId", "_mermaidSource", "e", "extensionUri", "webviewManager", "viewColumn", "nonce", "generateUuid", "mediaRoot", "scriptUri", "codiconsUri", "togglePanModeLabel", "zoomOutLabel", "zoomInLabel", "resetPanZoomLabel", "escapeHtmlText", "source", "hash", "i", "char", "vscode", "configSection", "defaultMermaidTheme", "validMermaidThemes", "sanitizeMermaidTheme", "theme", "injectMermaidConfig", "md", "render", "args", "config", "configSection", "configData", "escapedConfig", "escapeHtmlAttribute", "str", "mermaidLanguageId", "containerTokenName", "extendMarkdownItWithMermaid", "md", "config", "container", "state", "startLine", "endLine", "silent", "pos", "autoClosed", "start", "max", "markerCount", "markup", "params", "mermaidLanguageId", "nextLine", "oldParent", "oldLineMax", "containerToken", "containerTokenName", "tokens", "idx", "src", "preProcess", "highlight", "code", "lang", "attrs", "reg", "escapeRegExp", "source", "string", "MermaidWebviewManager", "id", "webview", "mermaidSource", "title", "type", "info", "activate", "context", "webviewManager", "MermaidWebviewManager", "editorManager", "MermaidEditorManager", "registerChatSupport", "ctx", "webviewInfo", "e", "configSection", "md", "extendMarkdownItWithMermaid", "injectMermaidConfig"]
3
+ "sources": ["../../src/extension.ts", "../../src/chatOutputRenderer.ts", "../../src/util/html.ts", "../../src/util/uuid.ts", "../../src/util/dispose.ts", "../../src/markdownMermaid/config.ts", "../../src/editorManager.ts", "../../src/markdownMermaid/markdownIt.ts", "../../src/webviewManager.ts"],
4
+ "sourcesContent": ["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\nimport { registerChatSupport } from './chatOutputRenderer';\nimport { MermaidEditorManager } from './editorManager';\nimport { configSection, injectMermaidConfig } from './markdownMermaid/config';\nimport { extendMarkdownItWithMermaid } from './markdownMermaid/markdownIt';\nimport { MermaidCommandContext, MermaidWebviewManager } from './webviewManager';\nimport type MarkdownIt from 'markdown-it';\n\nexport function activate(context: vscode.ExtensionContext) {\n\tconst webviewManager = new MermaidWebviewManager();\n\n\tconst editorManager = new MermaidEditorManager(context.extensionUri, webviewManager);\n\tcontext.subscriptions.push(editorManager);\n\n\t// Register chat support\n\tcontext.subscriptions.push(registerChatSupport(context, webviewManager, editorManager));\n\n\t// Register commands\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('_mermaid-markdown.resetPanZoom', (ctx?: { mermaidWebviewId?: string }) => {\n\t\t\twebviewManager.resetPanZoom(ctx?.mermaidWebviewId);\n\t\t})\n\t);\n\n\tcontext.subscriptions.push(\n\t\tvscode.commands.registerCommand('_mermaid-markdown.copySource', (ctx?: MermaidCommandContext) => {\n\t\t\tif (typeof ctx?.mermaidSource === 'string') {\n\t\t\t\tvoid vscode.env.clipboard.writeText(ctx.mermaidSource);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst webviewInfo = ctx?.mermaidWebviewId ? webviewManager.getWebview(ctx.mermaidWebviewId) : webviewManager.activeWebview;\n\t\t\tif (webviewInfo) {\n\t\t\t\tvoid vscode.env.clipboard.writeText(webviewInfo.mermaidSource);\n\t\t\t}\n\t\t})\n\t);\n\n\tcontext.subscriptions.push(vscode.workspace.onDidChangeConfiguration(e => {\n\t\tif (e.affectsConfiguration(`${configSection}.languages`)) {\n\t\t\tvoid vscode.commands.executeCommand('markdown.api.reloadPlugins');\n\t\t}\n\t\tif (e.affectsConfiguration(configSection) || e.affectsConfiguration('workbench.colorTheme')) {\n\t\t\tvoid vscode.commands.executeCommand('markdown.preview.refresh');\n\t\t}\n\t}));\n\n\treturn {\n\t\textendMarkdownIt(md: MarkdownIt) {\n\t\t\textendMarkdownItWithMermaid(md, {\n\t\t\t\tlanguageIds: () => vscode.workspace.getConfiguration(configSection).get<readonly string[]>('languages', ['mermaid'])\n\t\t\t});\n\t\t\tmd.use(injectMermaidConfig);\n\t\t\treturn md;\n\t\t}\n\t};\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\nimport { MermaidEditorManager } from './editorManager';\nimport { MermaidCommandContext, MermaidWebviewManager } from './webviewManager';\nimport { escapeHtmlText } from './util/html';\nimport { generateUuid } from './util/uuid';\nimport { disposeAll } from './util/dispose';\nimport { renderMermaidConfigSpan } from './markdownMermaid/config';\n\n/**\n * Mime type used to identify Mermaid diagram data in chat output.\n */\nconst mime = 'text/vnd.mermaid';\n\n/**\n * View type that uniquely identifies the Mermaid chat output renderer.\n */\nconst viewType = 'vscode.mermaid-markdown-features.chatOutputItem';\n\nclass MermaidChatOutputRenderer implements vscode.ChatOutputRenderer {\n\n\tconstructor(\n\t\tprivate readonly _extensionUri: vscode.Uri,\n\t\tprivate readonly _webviewManager: MermaidWebviewManager\n\t) { }\n\n\tasync renderChatOutput({ value }: vscode.ChatOutputDataItem, chatOutputWebview: vscode.ChatOutputWebview, _ctx: unknown, _token: vscode.CancellationToken): Promise<void> {\n\t\tconst webview = chatOutputWebview.webview;\n\t\tconst decoded = decodeMermaidData(value);\n\t\tconst mermaidSource = decoded.source;\n\t\tconst title = decoded.title;\n\n\t\t// Generate unique ID for this webview\n\t\tconst webviewId = generateUuid();\n\n\t\tconst disposables: vscode.Disposable[] = [];\n\n\t\t// Register and set as active\n\t\tdisposables.push(this._webviewManager.registerWebview(webviewId, webview, mermaidSource, title, 'chat'));\n\n\t\t// Listen for messages from the webview\n\t\tdisposables.push(webview.onDidReceiveMessage(message => {\n\t\t\tif (message.type === 'openInEditor') {\n\t\t\t\tvoid vscode.commands.executeCommand('_mermaid-markdown.openInEditor', { mermaidWebviewId: webviewId });\n\t\t\t}\n\t\t}));\n\n\t\t// Dispose resources when webview is disposed\n\t\tchatOutputWebview.onDidDispose(() => {\n\t\t\tdisposeAll(disposables);\n\t\t});\n\n\t\t// Set the options for the webview\n\t\tconst mediaRoot = vscode.Uri.joinPath(this._extensionUri, 'chat-webview-out');\n\t\twebview.options = {\n\t\t\tenableScripts: true,\n\t\t\tlocalResourceRoots: [mediaRoot],\n\t\t};\n\n\t\t// Set the HTML content for the webview\n\t\tconst nonce = generateUuid();\n\t\tconst mermaidScript = vscode.Uri.joinPath(mediaRoot, 'index.js');\n\t\tconst codiconsUri = webview.asWebviewUri(vscode.Uri.joinPath(mediaRoot, 'codicon.css'));\n\t\tconst openInEditorLabel = vscode.l10n.t('Open Diagram in Editor');\n\n\t\twebview.html = `\n\t\t\t<!DOCTYPE html>\n\t\t\t<html lang=\"en\">\n\n\t\t\t<head>\n\t\t\t\t<meta charset=\"UTF-8\">\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\t\t<title>Mermaid Diagram</title>\n\t\t\t\t<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; img-src data:; script-src 'nonce-${nonce}'; style-src ${webview.cspSource} 'unsafe-inline'; font-src data:;\" />\n\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"${codiconsUri}\" crossorigin=\"anonymous\">\n\n\t\t\t\t<style>\n\t\t\t\t\tbody {\n\t\t\t\t\t\tpadding: 0;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid {\n\t\t\t\t\t\tvisibility: hidden;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid.rendered {\n\t\t\t\t\t\tvisibility: visible;\n\t\t\t\t\t}\n\t\t\t\t\t.open-in-editor-btn {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: 8px;\n\t\t\t\t\t\tright: 8px;\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\twidth: 26px;\n\t\t\t\t\t\theight: 26px;\n\t\t\t\t\t\tbackground: var(--vscode-editorWidget-background);\n\t\t\t\t\t\tcolor: var(--vscode-icon-foreground);\n\t\t\t\t\t\tborder: 1px solid var(--vscode-editorWidget-border);\n\t\t\t\t\t\tborder-radius: 6px;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t\tz-index: 100;\n\t\t\t\t\t\topacity: 0;\n\t\t\t\t\t\ttransition: opacity 0.2s;\n\t\t\t\t\t}\n\t\t\t\t\tbody:hover .open-in-editor-btn,\n\t\t\t\t\t.open-in-editor-btn:focus {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t}\n\t\t\t\t\t.open-in-editor-btn:hover {\n\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\tbackground: var(--vscode-toolbar-hoverBackground);\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t</head>\n\n\t\t\t<body data-vscode-context='${JSON.stringify({ preventDefaultContextMenuItems: true, mermaidWebviewId: webviewId })}' data-vscode-mermaid-webview-id=\"${webviewId}\">\n\t\t\t\t${renderMermaidConfigSpan()}\n\t\t\t\t<button class=\"open-in-editor-btn\" title=\"${openInEditorLabel}\" aria-label=\"${openInEditorLabel}\"><i class=\"codicon codicon-open-preview\" aria-hidden=\"true\"></i></button>\n\t\t\t\t<pre class=\"mermaid\">\n\t\t\t\t\t${escapeHtmlText(mermaidSource)}\n\t\t\t\t</pre>\n\n\t\t\t\t<script type=\"module\" nonce=\"${nonce}\" src=\"${webview.asWebviewUri(mermaidScript)}\"></script>\n\t\t\t</body>\n\t\t\t</html>`;\n\t}\n}\n\n\nexport function registerChatSupport(\n\tcontext: vscode.ExtensionContext,\n\twebviewManager: MermaidWebviewManager,\n\teditorManager: MermaidEditorManager\n): vscode.Disposable {\n\tconst disposables: vscode.Disposable[] = [];\n\n\tdisposables.push(\n\t\tvscode.commands.registerCommand('_mermaid-markdown.openInEditor', (ctx?: MermaidCommandContext) => {\n\t\t\tif (typeof ctx?.mermaidSource === 'string') {\n\t\t\t\teditorManager.openPreview(ctx.mermaidSource, typeof ctx.title === 'string' ? ctx.title : undefined);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst webviewInfo = ctx?.mermaidWebviewId ? webviewManager.getWebview(ctx.mermaidWebviewId) : webviewManager.activeWebview;\n\t\t\tif (webviewInfo) {\n\t\t\t\teditorManager.openPreview(webviewInfo.mermaidSource, webviewInfo.title);\n\t\t\t}\n\t\t})\n\t);\n\n\t// Register lm tools\n\tdisposables.push(\n\t\tvscode.lm.registerTool<{ markup: string; title?: string }>('renderMermaidDiagram', {\n\t\t\tinvoke: async (options, _token) => {\n\t\t\t\tconst sourceCode = options.input.markup;\n\t\t\t\tconst title = options.input.title;\n\t\t\t\treturn writeMermaidToolOutput(sourceCode, title);\n\t\t\t},\n\t\t})\n\t);\n\n\t// Register the chat output renderer for Mermaid diagrams.\n\t// This will be invoked with the data generated by the tools.\n\t// It can also be invoked when rendering old Mermaid diagrams in the chat history.\n\tconst renderer = new MermaidChatOutputRenderer(context.extensionUri, webviewManager);\n\tdisposables.push(vscode.chat.registerChatOutputRenderer(viewType, renderer));\n\n\treturn vscode.Disposable.from(...disposables);\n}\n\nfunction writeMermaidToolOutput(sourceCode: string, title: string | undefined): vscode.LanguageModelToolResult {\n\t// Expose the source code as a markdown mermaid code block\n\tconst fence = getFenceForContent(sourceCode);\n\tconst result = new vscode.LanguageModelToolResult([\n\t\tnew vscode.LanguageModelTextPart(`${fence}mermaid\\n${sourceCode}\\n${fence}`)\n\t]);\n\n\t// And store custom data in the tool result details to indicate that a custom renderer should be used for it.\n\t// Encode source and optional title as JSON.\n\tconst data = JSON.stringify({ source: sourceCode, title });\n\t// Add cast to use proposed API\n\t(result as vscode.ExtendedLanguageModelToolResult2).toolResultDetails2 = {\n\t\tmime,\n\t\tvalue: new TextEncoder().encode(data),\n\t};\n\n\treturn result;\n}\n\nfunction getFenceForContent(content: string): string {\n\tconst backtickMatch = content.matchAll(/`+/g);\n\tif (!backtickMatch) {\n\t\treturn '```';\n\t}\n\n\tconst maxBackticks = Math.max(...Array.from(backtickMatch, s => s[0].length));\n\treturn '`'.repeat(Math.max(3, maxBackticks + 1));\n}\n\ninterface MermaidData {\n\treadonly title: string | undefined;\n\treadonly source: string;\n}\n\nfunction decodeMermaidData(value: Uint8Array): MermaidData {\n\tconst text = new TextDecoder().decode(value);\n\n\t// Try to parse as JSON (new format with title), fall back to plain text (legacy format)\n\ttry {\n\t\tconst parsed = JSON.parse(text);\n\t\tif (typeof parsed === 'object' && typeof parsed.source === 'string') {\n\t\t\treturn { title: parsed.title, source: parsed.source };\n\t\t}\n\t} catch {\n\t\t// Not JSON, treat as legacy plain text format\n\t}\n\n\treturn { title: undefined, source: text };\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function escapeHtmlText(str: string): string {\n\treturn str\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&#39;');\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n/**\n * Copied from src/vs/base/common/uuid.ts\n */\nexport function generateUuid(): string {\n\t// use `randomUUID` if possible\n\tif (typeof crypto.randomUUID === 'function') {\n\t\t// see https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto\n\t\t// > Although crypto is available on all windows, the returned Crypto object only has one\n\t\t// > usable feature in insecure contexts: the getRandomValues() method.\n\t\t// > In general, you should use this API only in secure contexts.\n\n\t\treturn crypto.randomUUID.bind(crypto)();\n\t}\n\n\t// prep-work\n\tconst _data = new Uint8Array(16);\n\tconst _hex: string[] = [];\n\tfor (let i = 0; i < 256; i++) {\n\t\t_hex.push(i.toString(16).padStart(2, '0'));\n\t}\n\n\t// get data\n\tcrypto.getRandomValues(_data);\n\n\t// set version bits\n\t_data[6] = (_data[6] & 0x0f) | 0x40;\n\t_data[8] = (_data[8] & 0x3f) | 0x80;\n\n\t// print as string\n\tlet i = 0;\n\tlet result = '';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += '-';\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\tresult += _hex[_data[i++]];\n\treturn result;\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as vscode from 'vscode';\n\nexport function disposeAll(disposables: vscode.Disposable[]): void {\n\twhile (disposables.length) {\n\t\tconst item = disposables.pop();\n\t\titem?.dispose();\n\t}\n}\n\nexport abstract class Disposable {\n\tprivate _isDisposed = false;\n\n\tprotected _disposables: vscode.Disposable[] = [];\n\n\tpublic dispose(): void {\n\t\tif (this._isDisposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis._isDisposed = true;\n\t\tdisposeAll(this._disposables);\n\t}\n\n\tprotected _register<T extends vscode.Disposable>(value: T): T {\n\t\tif (this._isDisposed) {\n\t\t\tvalue.dispose();\n\t\t} else {\n\t\t\tthis._disposables.push(value);\n\t\t}\n\t\treturn value;\n\t}\n\n\tprotected get isDisposed() {\n\t\treturn this._isDisposed;\n\t}\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\n\nimport type MarkdownIt from 'markdown-it';\n\nexport const configSection = 'markdown-mermaid';\n\nconst enum ClickDragMode {\n\tAlt = 'alt'\n}\n\nconst enum ShowControlsMode {\n\tOnHoverOrFocus = 'onHoverOrFocus'\n}\n\nconst defaultMermaidTheme = 'vscode';\nconst validMermaidThemes = [\n\t'vscode',\n\t'base',\n\t'forest',\n\t'dark',\n\t'default',\n\t'neutral',\n];\n\nfunction sanitizeMermaidTheme(theme: string | undefined): string {\n\treturn typeof theme === 'string' && validMermaidThemes.includes(theme) ? theme : defaultMermaidTheme;\n}\n\nexport function buildMermaidConfigData() {\n\tconst config = vscode.workspace.getConfiguration(configSection);\n\treturn {\n\t\tdarkModeTheme: sanitizeMermaidTheme(config.get('darkModeTheme')),\n\t\tlightModeTheme: sanitizeMermaidTheme(config.get('lightModeTheme')),\n\t\tmaxTextSize: config.get('maxTextSize'),\n\t\tclickDrag: config.get('mouseNavigation.enabled', ClickDragMode.Alt),\n\t\tshowControls: config.get('controls.show', ShowControlsMode.OnHoverOrFocus),\n\t\tresizable: config.get('resizable', true),\n\t\tmaxHeight: config.get('maxHeight', ''),\n\t};\n}\n\nexport function injectMermaidConfig(md: MarkdownIt): MarkdownIt {\n\tconst render = md.renderer.render;\n\tmd.renderer.render = function (...args) {\n\t\treturn `${renderMermaidConfigSpan()}\n\t\t\t\t${render.apply(md.renderer, args)}`;\n\t};\n\treturn md;\n}\n\nexport function renderMermaidConfigSpan(): string {\n\tconst escapedConfig = escapeHtmlAttribute(JSON.stringify(buildMermaidConfigData()));\n\treturn `<span id=\"${configSection}\" aria-hidden=\"true\" data-config=\"${escapedConfig}\"></span>`;\n}\n\nfunction escapeHtmlAttribute(str: string): string {\n\treturn str\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;');\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\nimport { generateUuid } from './util/uuid';\nimport { MermaidWebviewManager } from './webviewManager';\nimport { escapeHtmlText } from './util/html';\nimport { Disposable } from './util/dispose';\nimport { renderMermaidConfigSpan } from './markdownMermaid/config';\n\nexport const mermaidEditorViewType = 'vscode.mermaid-markdown-features.preview';\n\ninterface MermaidPreviewState {\n\treadonly webviewId: string;\n\treadonly mermaidSource: string;\n}\n\n/**\n * Manages mermaid diagram editor panels, ensuring only one editor per diagram.\n */\nexport class MermaidEditorManager extends Disposable implements vscode.WebviewPanelSerializer {\n\n\tprivate readonly _previews = new Map<string, MermaidPreview>();\n\n\tconstructor(\n\t\tprivate readonly _extensionUri: vscode.Uri,\n\t\tprivate readonly _webviewManager: MermaidWebviewManager\n\t) {\n\t\tsuper();\n\n\t\tthis._register(vscode.window.registerWebviewPanelSerializer(mermaidEditorViewType, this));\n\t}\n\n\t/**\n\t * Opens a preview for the given diagram\n\t *\n\t * If a preview already exists for this diagram, it will be revealed instead of creating a new one.\n\t */\n\tpublic openPreview(mermaidSource: string, title?: string): void {\n\t\tconst webviewId = getWebviewId(mermaidSource);\n\t\tconst existingPreview = this._previews.get(webviewId);\n\t\tif (existingPreview) {\n\t\t\texistingPreview.reveal();\n\t\t\treturn;\n\t\t}\n\n\t\tconst preview = MermaidPreview.create(\n\t\t\twebviewId,\n\t\t\tmermaidSource,\n\t\t\ttitle,\n\t\t\tthis._extensionUri,\n\t\t\tthis._webviewManager,\n\t\t\tvscode.ViewColumn.Active);\n\n\t\tthis._registerPreview(preview);\n\t}\n\n\tpublic async deserializeWebviewPanel(\n\t\twebviewPanel: vscode.WebviewPanel,\n\t\tstate: MermaidPreviewState\n\t): Promise<void> {\n\t\tif (!state?.mermaidSource) {\n\t\t\twebviewPanel.webview.html = this._getErrorHtml();\n\t\t\treturn;\n\t\t}\n\n\t\tconst webviewId = getWebviewId(state.mermaidSource);\n\n\t\tconst preview = MermaidPreview.revive(\n\t\t\twebviewPanel,\n\t\t\twebviewId,\n\t\t\tstate.mermaidSource,\n\t\t\tthis._extensionUri,\n\t\t\tthis._webviewManager\n\t\t);\n\n\t\tthis._registerPreview(preview);\n\t}\n\n\tprivate _registerPreview(preview: MermaidPreview): void {\n\t\tthis._previews.set(preview.diagramId, preview);\n\n\t\tpreview.onDispose(() => {\n\t\t\tthis._previews.delete(preview.diagramId);\n\t\t});\n\t}\n\n\tprivate _getErrorHtml(): string {\n\t\treturn /* html */`<!DOCTYPE html>\n\t\t\t<html lang=\"en\">\n\t\t\t<head>\n\t\t\t\t<meta charset=\"UTF-8\">\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\t\t<title>Mermaid Preview</title>\n\t\t\t\t<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none';\">\n\t\t\t\t<style>\n\t\t\t\t\tbody {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\theight: 100vh;\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<p>An unexpected error occurred while restoring the Mermaid preview.</p>\n\t\t\t</body>\n\t\t\t</html>`;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\n\t\tfor (const preview of this._previews.values()) {\n\t\t\tpreview.dispose();\n\t\t}\n\t\tthis._previews.clear();\n\t}\n}\n\nclass MermaidPreview extends Disposable {\n\n\tprivate readonly _onDisposeEmitter = this._register(new vscode.EventEmitter<void>());\n\tpublic readonly onDispose = this._onDisposeEmitter.event;\n\n\tpublic static create(\n\t\tdiagramId: string,\n\t\tmermaidSource: string,\n\t\ttitle: string | undefined,\n\t\textensionUri: vscode.Uri,\n\t\twebviewManager: MermaidWebviewManager,\n\t\tviewColumn: vscode.ViewColumn\n\t): MermaidPreview {\n\t\tconst webviewPanel = vscode.window.createWebviewPanel(\n\t\t\tmermaidEditorViewType,\n\t\t\ttitle ?? vscode.l10n.t('Mermaid Diagram'),\n\t\t\tviewColumn,\n\t\t\t{\n\t\t\t\tretainContextWhenHidden: false,\n\t\t\t}\n\t\t);\n\n\t\treturn new MermaidPreview(webviewPanel, diagramId, mermaidSource, extensionUri, webviewManager);\n\t}\n\n\tpublic static revive(\n\t\twebviewPanel: vscode.WebviewPanel,\n\t\tdiagramId: string,\n\t\tmermaidSource: string,\n\t\textensionUri: vscode.Uri,\n\t\twebviewManager: MermaidWebviewManager\n\t): MermaidPreview {\n\t\treturn new MermaidPreview(webviewPanel, diagramId, mermaidSource, extensionUri, webviewManager);\n\t}\n\n\tprivate constructor(\n\t\tprivate readonly _webviewPanel: vscode.WebviewPanel,\n\t\tpublic readonly diagramId: string,\n\t\tprivate readonly _mermaidSource: string,\n\t\tprivate readonly _extensionUri: vscode.Uri,\n\t\tprivate readonly _webviewManager: MermaidWebviewManager\n\t) {\n\t\tsuper();\n\n\t\tthis._webviewPanel.iconPath = new vscode.ThemeIcon('graph');\n\n\t\tthis._webviewPanel.webview.options = {\n\t\t\tenableScripts: true,\n\t\t\tlocalResourceRoots: [\n\t\t\t\tvscode.Uri.joinPath(this._extensionUri, 'chat-webview-out')\n\t\t\t],\n\t\t};\n\n\t\tthis._webviewPanel.webview.html = this._getHtml();\n\n\t\t// Register with the webview manager\n\t\tthis._register(this._webviewManager.registerWebview(this.diagramId, this._webviewPanel.webview, this._mermaidSource, undefined, 'editor'));\n\n\t\tthis._register(this._webviewPanel.onDidChangeViewState(e => {\n\t\t\tif (e.webviewPanel.active) {\n\t\t\t\tthis._webviewManager.setActiveWebview(this.diagramId);\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(this._webviewPanel.onDidDispose(() => {\n\t\t\tthis._onDisposeEmitter.fire();\n\t\t\tthis.dispose();\n\t\t}));\n\t}\n\n\tpublic reveal(): void {\n\t\tthis._webviewPanel.reveal();\n\t}\n\n\tpublic override dispose() {\n\t\tthis._onDisposeEmitter.fire();\n\n\t\tsuper.dispose();\n\n\t\tthis._webviewPanel.dispose();\n\t}\n\n\tprivate _getHtml(): string {\n\t\tconst nonce = generateUuid();\n\n\t\tconst mediaRoot = vscode.Uri.joinPath(this._extensionUri, 'chat-webview-out');\n\t\tconst scriptUri = this._webviewPanel.webview.asWebviewUri(\n\t\t\tvscode.Uri.joinPath(mediaRoot, 'index-editor.js')\n\t\t);\n\t\tconst codiconsUri = this._webviewPanel.webview.asWebviewUri(\n\t\t\tvscode.Uri.joinPath(mediaRoot, 'codicon.css')\n\t\t);\n\t\tconst togglePanModeLabel = vscode.l10n.t('Toggle Pan Mode');\n\t\tconst zoomOutLabel = vscode.l10n.t('Zoom Out');\n\t\tconst zoomInLabel = vscode.l10n.t('Zoom In');\n\t\tconst resetPanZoomLabel = vscode.l10n.t('Reset Pan and Zoom');\n\n\t\treturn /* html */`<!DOCTYPE html>\n\t\t\t<html lang=\"en\">\n\t\t\t<head>\n\t\t\t\t<meta charset=\"UTF-8\">\n\t\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\t\t\t\t<title>Mermaid Diagram</title>\n\t\t\t\t<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; img-src data:; script-src 'nonce-${nonce}'; style-src ${this._webviewPanel.webview.cspSource} 'unsafe-inline'; font-src data:;\" />\n\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"${codiconsUri}\" crossorigin=\"anonymous\">\n\t\t\t\t<style>\n\t\t\t\t\thtml, body {\n\t\t\t\t\t\tmargin: 0;\n\t\t\t\t\t\tpadding: 0;\n\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid {\n\t\t\t\t\t\tvisibility: hidden;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid.rendered {\n\t\t\t\t\t\tvisibility: visible;\n\t\t\t\t\t}\n\t\t\t\t\t.mermaid-wrapper {\n\t\t\t\t\t\theight: 100%;\n\t\t\t\t\t\twidth: 100%;\n\t\t\t\t\t}\n\t\t\t\t\t.zoom-controls {\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\ttop: 8px;\n\t\t\t\t\t\tright: 8px;\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\tgap: 2px;\n\t\t\t\t\t\tz-index: 100;\n\t\t\t\t\t\tbackground: var(--vscode-editorWidget-background);\n\t\t\t\t\t\tborder: 1px solid var(--vscode-editorWidget-border);\n\t\t\t\t\t\tborder-radius: 6px;\n\t\t\t\t\t\tpadding: 3px;\n\t\t\t\t\t}\n\t\t\t\t\t.zoom-controls button {\n\t\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t\talign-items: center;\n\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t\twidth: 26px;\n\t\t\t\t\t\theight: 26px;\n\t\t\t\t\t\tbackground: transparent;\n\t\t\t\t\t\tcolor: var(--vscode-icon-foreground);\n\t\t\t\t\t\tborder: none;\n\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\t\t\t\t\t.zoom-controls button:hover {\n\t\t\t\t\t\tbackground: var(--vscode-toolbar-hoverBackground);\n\t\t\t\t\t}\n\t\t\t\t\t.zoom-controls button.active {\n\t\t\t\t\t\tbackground: var(--vscode-toolbar-activeBackground);\n\t\t\t\t\t\tcolor: var(--vscode-focusBorder);\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t</head>\n\t\t\t<body data-vscode-context='${JSON.stringify({ preventDefaultContextMenuItems: true, mermaidWebviewId: this.diagramId })}' data-vscode-mermaid-webview-id=\"${this.diagramId}\">\n\t\t\t\t${renderMermaidConfigSpan()}\n\t\t\t\t<div class=\"zoom-controls\">\n\t\t\t\t\t<button class=\"pan-mode-btn\" title=\"${togglePanModeLabel}\" aria-label=\"${togglePanModeLabel}\" aria-pressed=\"false\"><i class=\"codicon codicon-move\" aria-hidden=\"true\"></i></button>\n\t\t\t\t\t<button class=\"zoom-out-btn\" title=\"${zoomOutLabel}\" aria-label=\"${zoomOutLabel}\"><i class=\"codicon codicon-zoom-out\" aria-hidden=\"true\"></i></button>\n\t\t\t\t\t<button class=\"zoom-in-btn\" title=\"${zoomInLabel}\" aria-label=\"${zoomInLabel}\"><i class=\"codicon codicon-zoom-in\" aria-hidden=\"true\"></i></button>\n\t\t\t\t\t<button class=\"zoom-reset-btn\" title=\"${resetPanZoomLabel}\" aria-label=\"${resetPanZoomLabel}\"><i class=\"codicon codicon-screen-normal\" aria-hidden=\"true\"></i></button>\n\t\t\t\t</div>\n\t\t\t\t<pre class=\"mermaid\">\n\t\t\t\t\t${escapeHtmlText(this._mermaidSource)}\n\t\t\t\t</pre>\n\t\t\t\t<script type=\"module\" nonce=\"${nonce}\" src=\"${scriptUri}\"></script>\n\t\t\t</body>\n\t\t\t</html>`;\n\t}\n}\n\n\n/**\n * Generates a unique ID for a diagram based on its content.\n * This ensures the same diagram content always gets the same ID.\n */\nfunction getWebviewId(source: string): string {\n\t// Simple hash function for generating a content-based ID\n\tlet hash = 0;\n\tfor (let i = 0; i < source.length; i++) {\n\t\tconst char = source.charCodeAt(i);\n\t\thash = ((hash << 5) - hash) + char;\n\t\thash = hash & hash; // Convert to 32-bit integer\n\t}\n\treturn Math.abs(hash).toString(16);\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport type MarkdownIt from 'markdown-it';\n\nconst mermaidLanguageId = 'mermaid';\nconst containerTokenName = 'mermaidContainer';\n\nconst minMarkers = 3;\nconst markerStr = ':';\nconst markerChar = markerStr.charCodeAt(0);\nconst markerLen = markerStr.length;\n\n/**\n * Extends markdown-it so that it can render mermaid diagrams.\n *\n * This does not actually implement rendering of mermaid diagrams. Instead we just make sure that mermaid\n * block syntax is properly parsed by markdown-it. All actual mermaid rendering happens in the webview\n * where the markdown is rendered.\n */\nexport function extendMarkdownItWithMermaid(md: MarkdownIt, config: { languageIds(): readonly string[] }): MarkdownIt {\n\tmd.use((md: MarkdownIt) => {\n\t\tfunction container(state: MarkdownIt.StateBlock, startLine: number, endLine: number, silent: boolean): boolean {\n\t\t\tlet pos: number;\n\t\t\tlet autoClosed = false;\n\t\t\tlet start = state.bMarks[startLine] + state.tShift[startLine];\n\t\t\tlet max = state.eMarks[startLine];\n\n\t\t\tif (markerChar !== state.src.charCodeAt(start)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfor (pos = start + 1; pos <= max; pos++) {\n\t\t\t\tif (markerStr[(pos - start) % markerLen] !== state.src[pos]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst markerCount = Math.floor((pos - start) / markerLen);\n\t\t\tif (markerCount < minMarkers) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tpos -= (pos - start) % markerLen;\n\n\t\t\tconst markup = state.src.slice(start, pos);\n\t\t\tconst params = state.src.slice(pos, max);\n\t\t\tif (params.trim().split(' ')[0].toLowerCase() !== mermaidLanguageId) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (silent) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tlet nextLine = startLine;\n\n\t\t\tfor (; ;) {\n\t\t\t\tnextLine++;\n\t\t\t\tif (nextLine >= endLine) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tstart = state.bMarks[nextLine] + state.tShift[nextLine];\n\t\t\t\tmax = state.eMarks[nextLine];\n\n\t\t\t\tif (start < max && state.sCount[nextLine] < state.blkIndent) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (markerChar !== state.src.charCodeAt(start)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (state.sCount[nextLine] - state.blkIndent >= 4) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tfor (pos = start + 1; pos <= max; pos++) {\n\t\t\t\t\tif (markerStr[(pos - start) % markerLen] !== state.src[pos]) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (Math.floor((pos - start) / markerLen) < markerCount) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tpos -= (pos - start) % markerLen;\n\t\t\t\tpos = state.skipSpaces(pos);\n\n\t\t\t\tif (pos < max) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tautoClosed = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst oldParent = state.parentType;\n\t\t\tconst oldLineMax = state.lineMax;\n\t\t\tstate.parentType = 'container' as MarkdownIt.StateBlock.ParentType;\n\n\t\t\tstate.lineMax = nextLine;\n\n\t\t\tconst containerToken = state.push(containerTokenName, 'div', 1);\n\t\t\tcontainerToken.markup = markup;\n\t\t\tcontainerToken.block = true;\n\t\t\tcontainerToken.info = params;\n\t\t\tcontainerToken.map = [startLine, nextLine];\n\t\t\tcontainerToken.content = state.getLines(startLine + 1, nextLine, state.blkIndent, true);\n\n\t\t\tstate.parentType = oldParent;\n\t\t\tstate.lineMax = oldLineMax;\n\t\t\tstate.line = nextLine + (autoClosed ? 1 : 0);\n\n\t\t\treturn true;\n\t\t}\n\n\t\tmd.block.ruler.before('fence', containerTokenName, container, {\n\t\t\talt: ['paragraph', 'reference', 'blockquote', 'list']\n\t\t});\n\t\tmd.renderer.rules[containerTokenName] = (tokens: MarkdownIt.Token[], idx: number) => {\n\t\t\tconst token = tokens[idx];\n\t\t\tconst src = token.content;\n\t\t\treturn `<div class=\"${mermaidLanguageId}\">${preProcess(src)}</div>`;\n\t\t};\n\t});\n\n\tconst highlight = md.options.highlight;\n\tmd.options.highlight = (code: string, lang: string, attrs: string) => {\n\t\tconst reg = new RegExp('\\\\b(' + config.languageIds().map(escapeRegExp).join('|') + ')\\\\b', 'i');\n\t\tif (lang && reg.test(lang)) {\n\t\t\treturn `<pre class=\"${mermaidLanguageId}\" style=\"all: unset;\">${preProcess(code)}</pre>`;\n\t\t}\n\t\treturn highlight?.(code, lang, attrs) ?? code;\n\t};\n\treturn md;\n}\n\nfunction preProcess(source: string): string {\n\treturn source\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\\n+$/, '')\n\t\t.trimStart();\n}\n\nfunction escapeRegExp(string: string): string {\n\treturn string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n", "/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as vscode from 'vscode';\n\nexport interface MermaidWebviewInfo {\n\treadonly id: string;\n\treadonly webview: vscode.Webview;\n\treadonly mermaidSource: string;\n\treadonly title: string | undefined;\n\treadonly type: 'chat' | 'editor';\n}\n\nexport interface MermaidCommandContext {\n\treadonly mermaidWebviewId?: string;\n\treadonly mermaidSource?: string;\n\treadonly title?: string;\n}\n\n/**\n * Manages all mermaid webviews (both chat output renderers and editor previews).\n * Tracks the active webview and provides methods for interacting with webviews.\n */\nexport class MermaidWebviewManager {\n\n\tprivate _activeWebviewId: string | undefined;\n\tprivate readonly _webviews = new Map<string, MermaidWebviewInfo>();\n\n\t/**\n\t * Gets the currently active webview info.\n\t */\n\tpublic get activeWebview(): MermaidWebviewInfo | undefined {\n\t\treturn this._activeWebviewId ? this._webviews.get(this._activeWebviewId) : undefined;\n\t}\n\n\tpublic registerWebview(id: string, webview: vscode.Webview, mermaidSource: string, title: string | undefined, type: 'chat' | 'editor'): vscode.Disposable {\n\t\tif (this._webviews.has(id)) {\n\t\t\tthrow new Error(`Webview with id ${id} is already registered.`);\n\t\t}\n\n\t\tconst info: MermaidWebviewInfo = {\n\t\t\tid,\n\t\t\twebview,\n\t\t\tmermaidSource,\n\t\t\ttitle,\n\t\t\ttype\n\t\t};\n\t\tthis._webviews.set(id, info);\n\t\treturn { dispose: () => this.unregisterWebview(id) };\n\t}\n\n\tprivate unregisterWebview(id: string): void {\n\t\tthis._webviews.delete(id);\n\n\t\t// Clear active if this was the active webview\n\t\tif (this._activeWebviewId === id) {\n\t\t\tthis._activeWebviewId = undefined;\n\t\t}\n\t}\n\n\tpublic setActiveWebview(id: string): void {\n\t\tif (this._webviews.has(id)) {\n\t\t\tthis._activeWebviewId = id;\n\t\t}\n\t}\n\n\tpublic getWebview(id: string): MermaidWebviewInfo | undefined {\n\t\treturn this._webviews.get(id);\n\t}\n\n\t/**\n\t * Sends a reset pan/zoom message to a specific webview by ID.\n\t */\n\tpublic resetPanZoom(id: string | undefined): void {\n\t\tconst target = id ? this._webviews.get(id) : this.activeWebview;\n\t\ttarget?.webview.postMessage({ type: 'resetPanZoom' });\n\t}\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,cAAAE,KAAA,eAAAC,EAAAH,IAIA,IAAAI,EAAwB,qBCAxB,IAAAC,EAAwB,qBCAjB,SAASC,EAAeC,EAAqB,CACnD,OAAOA,EACL,QAAQ,KAAM,OAAO,EACrB,QAAQ,KAAM,MAAM,EACpB,QAAQ,KAAM,MAAM,EACpB,QAAQ,KAAM,QAAQ,EACtB,QAAQ,KAAM,OAAO,CACxB,CCHO,SAASC,GAAuB,CAEtC,GAAI,OAAO,OAAO,YAAe,WAMhC,OAAO,OAAO,WAAW,KAAK,MAAM,EAAE,EAIvC,IAAMC,EAAQ,IAAI,WAAW,EAAE,EACzBC,EAAiB,CAAC,EACxB,QAASC,EAAI,EAAGA,EAAI,IAAKA,IACxBD,EAAK,KAAKC,E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UAAUA,EAAY,aAAa,CAE/D,CAAC,CACF,EAEAP,EAAQ,cAAc,KAAY,YAAU,yBAAyBQ,GAAK,CACrEA,EAAE,qBAAqB,GAAGC,CAAa,YAAY,GAC1C,WAAS,eAAe,4BAA4B,GAE7DD,EAAE,qBAAqBC,CAAa,GAAKD,EAAE,qBAAqB,sBAAsB,IAC7E,WAAS,eAAe,0BAA0B,CAEhE,CAAC,CAAC,EAEK,CACN,iBAAiBE,EAAgB,CAChC,OAAAC,EAA4BD,EAAI,CAC/B,YAAa,IAAa,YAAU,iBAAiBD,CAAa,EAAE,IAAuB,YAAa,CAAC,SAAS,CAAC,CACpH,CAAC,EACDC,EAAG,IAAIE,CAAmB,EACnBF,CACR,CACD,CACD",
6
+ "names": ["extension_exports", "__export", "activate", "__toCommonJS", "vscode", "vscode", "escapeHtmlText", "str", "generateUuid", "_data", "_hex", "i", "result", "disposeAll", "disposables", "Disposable", "value", "vscode", "configSection", "defaultMermaidTheme", "validMermaidThemes", "sanitizeMermaidTheme", "theme", "buildMermaidConfigData", "config", "configSection", "injectMermaidConfig", "md", "render", "args", "renderMermaidConfigSpan", "escapedConfig", "escapeHtmlAttribute", "str", "mime", "viewType", "MermaidChatOutputRenderer", "_extensionUri", "_webviewManager", "value", "chatOutputWebview", "_ctx", "_token", "webview", "decoded", "decodeMermaidData", "mermaidSource", "title", "webviewId", "generateUuid", "disposables", "message", "disposeAll", "mediaRoot", "nonce", "mermaidScript", "codiconsUri", "openInEditorLabel", "renderMermaidConfigSpan", "escapeHtmlText", "registerChatSupport", "context", "webviewManager", "editorManager", "ctx", "webviewInfo", "options", "sourceCode", "writeMermaidToolOutput", "renderer", "fence", "getFenceForContent", "result", "data", "content", "backtickMatch", "maxBackticks", "s", "text", "parsed", "vscode", "mermaidEditorViewType", "MermaidEditorManager", "Disposable", "_extensionUri", "_webviewManager", "mermaidSource", "title", "webviewId", "getWebviewId", "existingPreview", "preview", "MermaidPreview", "webviewPanel", "state", "_MermaidPreview", "_webviewPanel", "diagramId", "_mermaidSource", "e", "extensionUri", "webviewManager", "viewColumn", "nonce", "generateUuid", "mediaRoot", "scriptUri", "codiconsUri", "togglePanModeLabel", "zoomOutLabel", "zoomInLabel", "resetPanZoomLabel", "renderMermaidConfigSpan", "escapeHtmlText", "source", "hash", "i", "char", "mermaidLanguageId", "containerTokenName", "extendMarkdownItWithMermaid", "md", "config", "container", "state", "startLine", "endLine", "silent", "pos", "autoClosed", "start", "max", "markerCount", "markup", "params", "mermaidLanguageId", "nextLine", "oldParent", "oldLineMax", "containerToken", "containerTokenName", "tokens", "idx", "src", "preProcess", "highlight", "code", "lang", "attrs", "reg", "escapeRegExp", "source", "string", "MermaidWebviewManager", "id", "webview", "mermaidSource", "title", "type", "info", "activate", "context", "webviewManager", "MermaidWebviewManager", "editorManager", "MermaidEditorManager", "registerChatSupport", "ctx", "webviewInfo", "e", "configSection", "md", "extendMarkdownItWithMermaid", "injectMermaidConfig"]
7
7
  }