@thanh01.pmt/presentation-kit 0.2.18 → 0.3.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.
- package/README.md +26 -0
- package/dist/ai/index.cjs +16 -15
- package/dist/ai/index.cjs.map +1 -1
- package/dist/ai/index.d.cts +3 -2
- package/dist/ai/index.d.ts +3 -2
- package/dist/ai/index.js +2 -1
- package/dist/ai/index.js.map +1 -1
- package/dist/assets/fonts/NOTICE.md +25 -0
- package/dist/assets/fonts/SOURCES.json +47 -0
- package/dist/assets/fonts/fira-code.woff2 +0 -0
- package/dist/assets/fonts/inter.woff2 +0 -0
- package/dist/assets/fonts/jetbrains-mono.woff2 +0 -0
- package/dist/assets/fonts/playfair-display.woff2 +0 -0
- package/dist/assets/fonts/plus-jakarta-sans.woff2 +0 -0
- package/dist/assets/fonts/space-grotesk.woff2 +0 -0
- package/dist/{chunk-DDOUFYLK.js → chunk-3DXMAPAY.js} +3 -3
- package/dist/{chunk-DDOUFYLK.js.map → chunk-3DXMAPAY.js.map} +1 -1
- package/dist/chunk-3Q4RMZVQ.cjs +867 -0
- package/dist/chunk-3Q4RMZVQ.cjs.map +1 -0
- package/dist/{chunk-JJQDQIRG.js → chunk-5HIDQQHE.js} +288 -855
- package/dist/chunk-5HIDQQHE.js.map +1 -0
- package/dist/{chunk-SFBEDDGU.cjs → chunk-5WEZOGQA.cjs} +292 -866
- package/dist/chunk-5WEZOGQA.cjs.map +1 -0
- package/dist/{chunk-DIHFQ5LF.cjs → chunk-CVEC72CT.cjs} +4 -4
- package/dist/{chunk-DIHFQ5LF.cjs.map → chunk-CVEC72CT.cjs.map} +1 -1
- package/dist/chunk-V6X7D44H.js +854 -0
- package/dist/chunk-V6X7D44H.js.map +1 -0
- package/dist/{click-css-Bcc1CkTN.d.cts → click-css-C8VciwZ6.d.cts} +1 -1
- package/dist/{click-css-B2s9B_uP.d.ts → click-css-COIiFo1I.d.ts} +1 -1
- package/dist/index.cjs +90 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -5
- package/dist/index.d.ts +46 -5
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +117 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.cts +36 -0
- package/dist/node/index.d.ts +36 -0
- package/dist/node/index.js +105 -0
- package/dist/node/index.js.map +1 -0
- package/dist/{presets-D_hfPJX9.d.ts → presets-DPRGtpO-.d.ts} +1 -1
- package/dist/{presets-BYvgAAkJ.d.cts → presets-MIi91wZg.d.cts} +1 -1
- package/dist/react/index.cjs +17 -16
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +4 -3
- package/dist/react/index.d.ts +4 -3
- package/dist/react/index.js +4 -3
- package/dist/react/index.js.map +1 -1
- package/dist/{types-C3d04zzP.d.cts → types-CvxCxWus.d.cts} +1 -67
- package/dist/{types-C3d04zzP.d.ts → types-CvxCxWus.d.ts} +1 -67
- package/dist/types-k_eae8UV.d.cts +74 -0
- package/dist/types-k_eae8UV.d.ts +74 -0
- package/package.json +8 -2
- package/dist/chunk-JJQDQIRG.js.map +0 -1
- package/dist/chunk-SFBEDDGU.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/arrow-converter.ts","../src/core/source-extractor.ts","../src/themes/dark.ts","../src/themes/light.ts","../src/themes/navy.ts","../src/themes/scoped-css.ts","../src/themes/index.ts","../src/plugins/mermaid.ts","../src/vclick/preprocessor.ts","../src/vclick/postprocessor.ts","../src/vclick/click-css.ts","../src/core/layout/parser.ts","../src/core/layout/css-generator.ts","../src/core/render.ts"],"names":["generateScopedCss","totalClicks"],"mappings":";;;;;AAUO,SAAS,kBAAkB,IAAA,EAAsB;AACtD,EAAA,IAAI,CAAC,MAAM,OAAO,EAAA;AAElB,EAAA,IAAI,OAAA,GAAU,IAAA;AACd,EAAA,IAAI,eAAA,GAAkB,EAAA;AAGtB,EAAA,MAAM,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AA;AACrD,EAAA,MAAM,UAAA,GAAa,YAAY,IAAI,CAAA;AACnC,EAAA,MAAM,gBAAgB,OAAA,EAAS,aAAA,KAAkB,QAC7C,mBAAA,CAAoB,IAAI,IACxB,EAAC;AACL,EAAA,MAAM,WAAW,YAAA,GACb,gBAAA,CAAiB,EAAE,WAAA,EAAa,CAAA,GAChC,EAAA;AAEJ,EAAA,MAAM,EAAE,OAAA,EAAS,KAAA,EAAM,GAAI,uBAAuB,QAAQ,CAAA;AAC1D,EAAA,MAAM,SAAA,GAAY,iBAAA,CAAkB,OAAA,EAAS,WAAW,CAAA;AAGxD,EAAA,MAAM,WAAA,GAAc,SAAS,WAAA,IAAe,IAAA;AAC5C,EAAA,MAAM,gBAAgB,WAAA,GAClB,MAAM,oBAAoB,IAAA,EAAM,KAAA,CAAM,IAAI,CAAA,GAC1C,IAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA;AAAA,IACA,GAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAA;AAAA,IACA,UAAA;AAAA,IACA,aAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-DDOUFYLK.js","sourcesContent":["// ═══════════════════════════════════════════════════════════════════════════════\n// Arrow Converter — Text arrows → Unicode arrows\n// Ported from: apps/web/app/api/render-marp/route.ts\n// ═══════════════════════════════════════════════════════════════════════════════\n\n/**\n * Converts text arrows (->, -->, --->, =>, ==>, <->, etc.) into clean Unicode\n * arrows while strictly preserving YAML frontmatter, code fences, inline code,\n * HTML comments, and style tags.\n */\nexport function convertTextArrows(text: string): string {\n if (!text) return '';\n\n let content = text;\n let yamlFrontmatter = '';\n\n // 1. Preserve YAML frontmatter at the beginning of markdown (e.g. --- ... ---)\n const yamlMatch = content.match(/^(---\\r?\\n[\\s\\S]*?\\r?\\n---(?:\\r?\\n|$))/);\n if (yamlMatch?.[1]) {\n yamlFrontmatter = yamlMatch[1];\n content = content.slice(yamlFrontmatter.length);\n }\n\n // 2. Split by code fences, inline code, HTML comments, and style tags\n const segments = content.split(/(```[\\s\\S]*?```|`[^`\\n]+`|<!--[\\s\\S]*?-->|<style[\\s\\S]*?<\\/style>)/g);\n\n const processedContent = segments\n .map((segment) => {\n // If it's a code block, inline code, HTML comment, or style tag, leave untouched\n if (\n segment.startsWith('```') ||\n segment.startsWith('`') ||\n segment.startsWith('<!--') ||\n segment.startsWith('<style')\n ) {\n return segment;\n }\n\n return (\n segment\n // Bi-directional double arrows\n .replace(/<={3,}>/g, '⟺')\n .replace(/<==>/g, '⟺')\n .replace(/<=>/g, '⇔')\n // Bi-directional single arrows\n .replace(/<-{3,}>/g, '⟷')\n .replace(/<-->/g, '⟷')\n .replace(/<->/g, '↔')\n // Long right double arrows\n .replace(/={3,}>/g, '⟹')\n .replace(/==>/g, '⟹')\n .replace(/(^|\\s)=>(?=\\s|$|[.,:;!?\\)])/g, '$1⇒')\n // Long left double arrows\n .replace(/<={3,}/g, '⟸')\n .replace(/<==/g, '⟸')\n .replace(/(^|\\s)<=(?=\\s|$|[.,:;!?\\)])/g, '$1⇐')\n // Long right single arrows (----> -> ⟶, ---> -> ⟶, --> -> ⟶, -> -> →)\n .replace(/-{3,}>/g, '⟶')\n .replace(/-->/g, '⟶')\n .replace(/(^|\\s)->(?=\\s|$|[.,:;!?\\)])/g, '$1→')\n // Long left single arrows (<---- -> ⟵, <--- -> ⟵, <-- -> ⟵, <- -> ←)\n .replace(/<-{3,}/g, '⟵')\n .replace(/<--/g, '⟵')\n .replace(/(^|\\s)<-(?=\\s|$|[.,:;!?\\)])/g, '$1←')\n // LaTeX math arrows\n .replace(/\\$\\\\rightarrow\\$/g, '→')\n .replace(/\\$\\\\leftarrow\\$/g, '←')\n .replace(/\\$\\\\Rightarrow\\$/g, '⇒')\n .replace(/\\$\\\\Leftarrow\\$/g, '⇐')\n .replace(/\\\\rightarrow/g, '→')\n .replace(/\\\\leftarrow/g, '←')\n .replace(/\\\\Rightarrow/g, '⇒')\n .replace(/\\\\Leftarrow/g, '⇐')\n );\n })\n .join('');\n\n return yamlFrontmatter + processedContent;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Source Extractor — Extract clean Marp source from markdown wrappers\n// Ported from: apps/web/components/MarpSlideViewer.tsx\n// ═══════════════════════════════════════════════════════════════════════════════\n\n/**\n * Extracts clean Marp source from markdown that may be wrapped in code fences\n * or preceded by conversational preamble.\n *\n * Handles:\n * - Wrapped in ```markdown ... ``` or ```marp ... ``` or ```md ... ```\n * - Conversational preamble before the first frontmatter ---\n */\nexport function extractMarpSource(raw: string): string {\n if (!raw) return '';\n let text = raw.trim();\n\n // If wrapped in ```markdown ... ``` or ```marp ... ``` or ```md ... ```\n const codeBlockMatch = text.match(/^```(?:markdown|marp|md)?\\s*\\n([\\s\\S]*?)\\n```\\s*$/i);\n if (codeBlockMatch?.[1]) {\n text = codeBlockMatch[1].trim();\n }\n\n // If there is conversational preamble before the first frontmatter ---\n const firstFrontmatter = text.search(/^---\\s*$/m);\n if (firstFrontmatter > 0 && text.includes('marp: true')) {\n text = text.substring(firstFrontmatter).trim();\n }\n\n return text;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Dark Theme — Studio Dark (#14151b)\n// Ported from: apps/web/components/MarpSlideViewer.tsx scopedSlideStyles\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { ThemeTokens } from '../types.js';\n\nexport const darkThemeTokens: ThemeTokens = {\n // Surfaces\n background: '#14151b',\n cardBorder: '1px solid rgba(255, 255, 255, 0.08)',\n cardShadow: '0 8px 24px -4px rgba(0, 0, 0, 0.4)',\n\n // Typography — Calm single-hue readability (Zinc-200)\n text: '#cbd5e1',\n heading: '#e4e4e7',\n bold: '#ffffff',\n link: '#60a5fa',\n meta: '#94a3b8',\n\n // Code\n codeBg: '#0c0c0e',\n codeText: '#e4e4e7',\n inlineCodeBg: '#0c0c0e',\n inlineCodeText: '#e4e4e7',\n codeBorder: 'rgba(255, 255, 255, 0.08)',\n\n // Blockquotes\n quoteBg: 'rgba(255, 255, 255, 0.04)',\n quoteBorder: 'rgba(255, 255, 255, 0.15)',\n quoteText: '#e4e4e7',\n\n // Tables\n tableHeaderBg: 'rgba(255, 255, 255, 0.04)',\n tableBorder: 'rgba(255, 255, 255, 0.08)',\n tableRowHover: 'rgba(255, 255, 255, 0.02)',\n tableText: '#cbd5e1',\n tableEvenRow: 'rgba(255, 255, 255, 0.03)',\n\n // Mermaid\n mermaidDark: true,\n mermaidVariables: {\n darkMode: 'true',\n background: '#18181b',\n primaryColor: '#27272a',\n primaryTextColor: '#f4f4f5',\n primaryBorderColor: 'rgba(255, 255, 255, 0.2)',\n lineColor: '#71717a',\n secondaryColor: '#1e1e24',\n tertiaryColor: '#121214',\n textColor: '#f4f4f5',\n mainBkg: '#1f1f23',\n nodeBorder: 'rgba(255, 255, 255, 0.22)',\n clusterBkg: 'rgba(255, 255, 255, 0.02)',\n clusterBorder: 'rgba(255, 255, 255, 0.12)',\n titleColor: '#f4f4f5',\n edgeLabelBackground: '#27272a',\n actorBorder: 'rgba(255, 255, 255, 0.2)',\n actorBkg: '#27272a',\n actorTextColor: '#f4f4f5',\n actorLineColor: '#71717a',\n signalColor: '#f4f4f5',\n signalTextColor: '#f4f4f5',\n },\n mermaidThemeCSS: `\n svg, svg *, g, text, tspan, .node, .node *, .edgeLabel, .edgeLabel *, .cluster, .cluster * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n overflow: visible !important;\n }\n .node rect, .node circle, .node ellipse, .node polygon, .node path {\n stroke-width: 1.5px !important;\n rx: 8px !important;\n ry: 8px !important;\n }\n .node text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .edgeLabel rect {\n rx: 5px !important;\n ry: 5px !important;\n fill: #27272a !important;\n stroke: rgba(255, 255, 255, 0.12) !important;\n stroke-width: 1px !important;\n }\n .edgeLabel text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 11px !important;\n font-weight: 500 !important;\n fill: #e4e4e7 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .cluster rect {\n rx: 10px !important;\n ry: 10px !important;\n fill: rgba(255, 255, 255, 0.02) !important;\n stroke: rgba(255, 255, 255, 0.12) !important;\n stroke-width: 1.5px !important;\n }\n .cluster text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n fill: #a1a1aa !important;\n }\n .edgePath path {\n stroke: #71717a !important;\n stroke-width: 1.5px !important;\n }\n .arrowheadPath {\n fill: #71717a !important;\n }\n `,\n};\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Light Theme — Keynote White (#ffffff)\n// Ported from: apps/web/components/MarpSlideViewer.tsx scopedSlideStyles\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { ThemeTokens } from '../types.js';\n\nexport const lightThemeTokens: ThemeTokens = {\n // Surfaces\n background: '#ffffff',\n cardBorder: '1px solid rgba(0, 0, 0, 0.08)',\n cardShadow: '0 4px 16px -2px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03)',\n\n // Typography — Calm single-hue readability (Zinc-800)\n text: '#3f3f46',\n heading: '#27272a',\n bold: '#18181b',\n link: '#2563eb',\n meta: '#71717a',\n\n // Code\n codeBg: '#f4f4f5',\n codeText: '#27272a',\n inlineCodeBg: '#f4f4f5',\n inlineCodeText: '#27272a',\n codeBorder: 'rgba(0, 0, 0, 0.08)',\n\n // Blockquotes\n quoteBg: '#f8f9fa',\n quoteBorder: 'rgba(0, 0, 0, 0.15)',\n quoteText: '#27272a',\n\n // Tables\n tableHeaderBg: '#f8fafc',\n tableBorder: '#e2e8f0',\n tableRowHover: 'rgba(0, 0, 0, 0.02)',\n tableText: '#3f3f46',\n tableEvenRow: '#f8fafc',\n\n // Mermaid\n mermaidDark: false,\n mermaidVariables: {\n darkMode: 'false',\n background: '#ffffff',\n primaryColor: '#f4f4f6',\n primaryTextColor: '#18181b',\n primaryBorderColor: 'rgba(0, 0, 0, 0.15)',\n lineColor: '#94a3b8',\n secondaryColor: '#fafafa',\n tertiaryColor: '#f4f4f5',\n textColor: '#18181b',\n mainBkg: '#f8fafc',\n nodeBorder: 'rgba(0, 0, 0, 0.15)',\n clusterBkg: 'rgba(0, 0, 0, 0.015)',\n clusterBorder: 'rgba(0, 0, 0, 0.1)',\n titleColor: '#18181b',\n edgeLabelBackground: '#f1f5f9',\n actorBorder: 'rgba(0, 0, 0, 0.2)',\n actorBkg: '#f4f4f6',\n actorTextColor: '#18181b',\n actorLineColor: '#94a3b8',\n signalColor: '#18181b',\n signalTextColor: '#18181b',\n },\n mermaidThemeCSS: `\n svg, svg *, g, text, tspan, .node, .node *, .edgeLabel, .edgeLabel *, .cluster, .cluster * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n overflow: visible !important;\n }\n .node rect, .node circle, .node ellipse, .node polygon, .node path {\n stroke-width: 1.5px !important;\n rx: 8px !important;\n ry: 8px !important;\n }\n .node text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .edgeLabel rect {\n rx: 5px !important;\n ry: 5px !important;\n fill: #f1f5f9 !important;\n stroke: rgba(0, 0, 0, 0.12) !important;\n stroke-width: 1px !important;\n }\n .edgeLabel text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 11px !important;\n font-weight: 500 !important;\n fill: #334155 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .cluster rect {\n rx: 10px !important;\n ry: 10px !important;\n fill: rgba(0, 0, 0, 0.015) !important;\n stroke: rgba(0, 0, 0, 0.12) !important;\n stroke-width: 1.5px !important;\n }\n .cluster text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n fill: #64748b !important;\n }\n .edgePath path {\n stroke: #94a3b8 !important;\n stroke-width: 1.5px !important;\n }\n .arrowheadPath {\n fill: #94a3b8 !important;\n }\n `,\n};\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Navy Theme — Deep Navy (#0f172a)\n// Ported from: apps/web/components/MarpSlideViewer.tsx scopedSlideStyles\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { ThemeTokens } from '../types.js';\n\nexport const navyThemeTokens: ThemeTokens = {\n // Surfaces\n background: '#0f172a',\n cardBorder: '1px solid rgba(255, 255, 255, 0.08)',\n cardShadow: '0 8px 24px -4px rgba(0, 0, 0, 0.4)',\n\n // Typography — Calm single-hue readability (Zinc-200)\n text: '#94a3b8',\n heading: '#f8fafc',\n bold: '#ffffff',\n link: '#38bdf8',\n meta: '#94a3b8',\n\n // Code\n codeBg: '#020617',\n codeText: '#e4e4e7',\n inlineCodeBg: '#020617',\n inlineCodeText: '#e4e4e7',\n codeBorder: 'rgba(255, 255, 255, 0.08)',\n\n // Blockquotes — Navy uses sky tint\n quoteBg: 'rgba(56, 189, 248, 0.06)',\n quoteBorder: 'rgba(255, 255, 255, 0.15)',\n quoteText: '#e4e4e7',\n\n // Tables\n tableHeaderBg: 'rgba(255, 255, 255, 0.04)',\n tableBorder: 'rgba(255, 255, 255, 0.08)',\n tableRowHover: 'rgba(255, 255, 255, 0.02)',\n tableText: '#94a3b8',\n tableEvenRow: 'rgba(56, 189, 248, 0.03)',\n\n // Mermaid — reuse dark config with navy tint\n mermaidDark: true,\n mermaidVariables: {\n darkMode: 'true',\n background: '#18181b',\n primaryColor: '#27272a',\n primaryTextColor: '#f4f4f5',\n primaryBorderColor: 'rgba(255, 255, 255, 0.2)',\n lineColor: '#71717a',\n secondaryColor: '#1e1e24',\n tertiaryColor: '#121214',\n textColor: '#f4f4f5',\n mainBkg: '#1f1f23',\n nodeBorder: 'rgba(255, 255, 255, 0.22)',\n clusterBkg: 'rgba(255, 255, 255, 0.02)',\n clusterBorder: 'rgba(255, 255, 255, 0.12)',\n titleColor: '#f4f4f5',\n edgeLabelBackground: '#27272a',\n actorBorder: 'rgba(255, 255, 255, 0.2)',\n actorBkg: '#27272a',\n actorTextColor: '#f4f4f5',\n actorLineColor: '#71717a',\n signalColor: '#f4f4f5',\n signalTextColor: '#f4f4f5',\n },\n mermaidThemeCSS: `\n svg, svg *, g, text, tspan, .node, .node *, .edgeLabel, .edgeLabel *, .cluster, .cluster * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n overflow: visible !important;\n }\n .node rect, .node circle, .node ellipse, .node polygon, .node path {\n stroke-width: 1.5px !important;\n rx: 8px !important;\n ry: 8px !important;\n }\n .node text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .edgeLabel rect {\n rx: 5px !important;\n ry: 5px !important;\n fill: #27272a !important;\n stroke: rgba(255, 255, 255, 0.12) !important;\n stroke-width: 1px !important;\n }\n .edgeLabel text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 11px !important;\n font-weight: 500 !important;\n fill: #e4e4e7 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .cluster rect {\n rx: 10px !important;\n ry: 10px !important;\n fill: rgba(255, 255, 255, 0.02) !important;\n stroke: rgba(255, 255, 255, 0.12) !important;\n stroke-width: 1.5px !important;\n }\n .cluster text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n fill: #a1a1aa !important;\n }\n .edgePath path {\n stroke: #71717a !important;\n stroke-width: 1.5px !important;\n }\n .arrowheadPath {\n fill: #71717a !important;\n }\n `,\n};\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Scoped CSS Generator — Theme-specific CSS for 1280x720 Marp canvas\n// Ported from: apps/web/components/MarpSlideViewer.tsx scopedSlideStyles\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { ThemeTokens } from '../types.js';\n\n/**\n * Sanitize a string for safe use as a CSS selector (ID).\n * Escapes characters that are special in CSS selectors.\n */\nfunction sanitizeCssId(id: string): string {\n // CSS.escape() is available in modern browsers and Node 20+\n // Fallback: manual escape for common problematic chars\n if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') {\n return CSS.escape(id);\n }\n return id.replace(/([\"'\\\\()\\[\\]#.;,{}\\s!@#$%^&*=+|<>?/~`])/g, '\\\\$1');\n}\n\n/**\n * Generate scoped CSS string for a given theme.\n * This CSS overrides Marp defaults for 1280×720 canvas typography using\n * the container ID for CSS isolation.\n */\nexport function generateScopedCss(tokens: ThemeTokens, containerId: string = 'marp-container'): string {\n const safeId = sanitizeCssId(containerId);\n return `\n/* ── Isolation: Scope all styles to #${safeId} ── */\n#${safeId} {\n width: 100%;\n}\n\n/* Base Slide Card Styling (Thin hairline border) */\n#${safeId} svg[data-marpit-svg] {\n background-color: ${tokens.background} !important;\n border-radius: 12px !important;\n border: ${tokens.cardBorder} !important;\n box-shadow: ${tokens.cardShadow} !important;\n overflow: hidden !important;\n transition: border-color 0.15s ease;\n}\n\n/* Slide Inner Section (1280x720 Canvas Coordinate Scale) */\n#${safeId} section:not([data-background-color]):not([style*=\"background\"]),\n#${safeId} foreignObject > section:not([data-background-color]):not([style*=\"background\"]) {\n background-color: ${tokens.background} !important;\n}\n\n#${safeId} section,\n#${safeId} foreignObject > section {\n color: ${tokens.text} !important;\n font-family: var(--font-sans), Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n padding: 50px 60px !important;\n box-sizing: border-box !important;\n display: flex !important;\n flex-direction: column !important;\n justify-content: center !important;\n}\n\n/* Force inline display for emojis, twemojis, and inline text emojis */\n#${safeId} section img.emoji,\n#${safeId} section img[data-marp-twemoji],\n#${safeId} section .emoji {\n display: inline-block !important;\n vertical-align: -0.15em !important;\n height: 1.15em !important;\n width: 1.15em !important;\n margin: 0 0.15em !important;\n}\n\n/* Mermaid Diagram styling inside Marp Canvas */\n#${safeId} section .marp-mermaid-rendered {\n width: 100% !important;\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n margin: 16px 0 !important;\n}\n\n#${safeId} section .marp-mermaid-rendered svg {\n display: block !important;\n max-width: 100% !important;\n max-height: 420px !important;\n width: auto !important;\n height: auto !important;\n}\n\n#${safeId} section .marp-mermaid-rendered svg * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n}\n\n#${safeId} section .katex,\n#${safeId} section .katex-html {\n display: inline-block !important;\n vertical-align: baseline !important;\n}\n\n#${safeId} section strong,\n#${safeId} section b,\n#${safeId} section em,\n#${safeId} section span {\n display: inline !important;\n}\n\n/* ── Typography Scale for 1280x720 Canvas ── */\n#${safeId} section h1 {\n font-size: 38px !important;\n font-weight: 700 !important;\n line-height: 1.25 !important;\n color: ${tokens.heading} !important;\n margin: 0 0 18px 0 !important;\n letter-spacing: -0.02em !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n}\n\n#${safeId} section h2 {\n font-size: 28px !important;\n font-weight: 600 !important;\n line-height: 1.3 !important;\n color: ${tokens.heading} !important;\n margin: 0 0 16px 0 !important;\n letter-spacing: -0.01em !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n}\n\n#${safeId} section h3 {\n font-size: 22px !important;\n font-weight: 600 !important;\n line-height: 1.4 !important;\n color: ${tokens.heading} !important;\n margin: 0 0 14px 0 !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n}\n\n#${safeId} section p,\n#${safeId} section li {\n font-size: 18px !important;\n line-height: 1.7 !important;\n color: ${tokens.text} !important;\n margin-top: 0 !important;\n margin-bottom: 12px !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n}\n\n#${safeId} section strong,\n#${safeId} section b {\n color: ${tokens.bold} !important;\n font-weight: 600 !important;\n}\n\n#${safeId} section a {\n color: ${tokens.link} !important;\n text-decoration: underline !important;\n text-decoration-thickness: 1px !important;\n text-underline-offset: 2px !important;\n}\n\n#${safeId} section a:hover {\n opacity: 0.85 !important;\n}\n\n#${safeId} section ul,\n#${safeId} section ol {\n margin: 0 0 16px 28px !important;\n padding: 0 !important;\n}\n\n#${safeId} section li {\n margin-bottom: 8px !important;\n}\n\n/* Blockquotes / Callout Cards */\n#${safeId} section blockquote {\n background: ${tokens.quoteBg} !important;\n border-left: 3px solid ${tokens.quoteBorder} !important;\n border-radius: 6px !important;\n padding: 16px 24px !important;\n margin: 16px 0 !important;\n color: ${tokens.quoteText} !important;\n}\n#${safeId} section blockquote p {\n color: ${tokens.quoteText} !important;\n font-size: 18px !important;\n margin: 0 !important;\n}\n\n/* Code Blocks & Inline Code (Monospace font standard) */\n#${safeId} section code {\n font-family: var(--font-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;\n font-style: normal !important;\n font-size: 15px !important;\n background: ${tokens.inlineCodeBg} !important;\n color: ${tokens.inlineCodeText} !important;\n padding: 2px 8px !important;\n border-radius: 6px !important;\n border: 1px solid ${tokens.codeBorder} !important;\n}\n\n#${safeId} section pre {\n background: ${tokens.codeBg} !important;\n border: 1px solid ${tokens.codeBorder} !important;\n border-radius: 8px !important;\n padding: 18px 22px !important;\n margin: 16px 0 !important;\n overflow-x: auto !important;\n}\n\n#${safeId} section pre code {\n background: transparent !important;\n border: none !important;\n padding: 0 !important;\n font-family: var(--font-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;\n font-style: normal !important;\n font-size: 15px !important;\n line-height: 1.6 !important;\n color: ${tokens.codeText} !important;\n}\n\n/* Tables */\ndiv#${safeId} svg foreignObject section table,\n#${safeId} section table {\n width: 100% !important;\n border-collapse: collapse !important;\n margin: 16px 0 !important;\n font-size: 17px !important;\n background-color: transparent !important;\n background: transparent !important;\n display: table !important;\n}\n\ndiv#${safeId} svg foreignObject section table tr,\n#${safeId} section table tr {\n background-color: transparent !important;\n background: transparent !important;\n border-top: 1px solid ${tokens.tableBorder} !important;\n}\n\ndiv#${safeId} svg foreignObject section table tbody tr:nth-child(2n),\n#${safeId} section table tbody tr:nth-child(2n) {\n background-color: ${tokens.tableEvenRow ?? tokens.tableHeaderBg} !important;\n}\n\ndiv#${safeId} svg foreignObject section table thead tr,\n#${safeId} section table thead tr {\n background-color: ${tokens.tableHeaderBg} !important;\n}\n\ndiv#${safeId} svg foreignObject section table th,\n#${safeId} section table th {\n background-color: ${tokens.tableHeaderBg} !important;\n color: ${tokens.heading} !important;\n font-weight: 600 !important;\n padding: 10px 16px !important;\n border: 1px solid ${tokens.tableBorder} !important;\n text-align: left !important;\n}\n\ndiv#${safeId} svg foreignObject section table td,\n#${safeId} section table td {\n padding: 10px 16px !important;\n border: 1px solid ${tokens.tableBorder} !important;\n color: ${tokens.tableText} !important;\n background-color: transparent !important;\n}\n\ndiv#${safeId} svg foreignObject section table tr:hover td,\n#${safeId} section table tr:hover td {\n background-color: ${tokens.tableRowHover} !important;\n}\n\n/* Header & Footer */\n#${safeId} section header,\n#${safeId} section footer {\n position: absolute !important;\n left: 60px !important;\n right: 60px !important;\n font-size: 14px !important;\n color: ${tokens.meta} !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n opacity: 0.8 !important;\n}\n\n#${safeId} section header {\n top: 24px !important;\n border-bottom: 1px solid ${tokens.tableBorder} !important;\n padding-bottom: 6px !important;\n}\n\n#${safeId} section footer {\n bottom: 24px !important;\n border-top: 1px solid ${tokens.tableBorder} !important;\n padding-top: 6px !important;\n}\n\n/* Multi-column Grid & Flex Layout Utilities */\n#${safeId} section .columns,\n#${safeId} section .grid-2 {\n display: grid !important;\n grid-template-columns: 1fr 1fr !important;\n gap: 28px !important;\n width: 100% !important;\n margin: 16px 0 !important;\n align-items: start !important;\n}\n\n#${safeId} section .columns > div,\n#${safeId} section .grid-2 > div {\n min-width: 0 !important;\n}\n\n#${safeId} section .card {\n background: ${tokens.quoteBg} !important;\n border: 1px solid ${tokens.cardBorder} !important;\n border-radius: 10px !important;\n padding: 18px 22px !important;\n margin: 12px 0 !important;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;\n}\n\n#${safeId} section .card.highlight {\n border-left: 4px solid ${tokens.link} !important;\n}\n\n#${safeId} section .card.warning {\n border-left: 4px solid #f59e0b !important;\n}\n\n#${safeId} section .card.success {\n border-left: 4px solid #10b981 !important;\n}\n\n/* Marp Split Layout Container */\n#${safeId} section[data-marpit-advanced-background=\"background\"] {\n display: flex !important;\n flex-direction: row !important;\n padding: 0 !important;\n}\n\n#${safeId} section[data-marpit-advanced-background=\"background\"] > .marpit-advanced-background-container {\n flex: 0 0 50% !important;\n height: 100% !important;\n position: relative !important;\n}\n\n#${safeId} section[data-marpit-advanced-background=\"background\"] > .marpit-advanced-background-container + * {\n flex: 1 !important;\n padding: 50px 60px !important;\n display: flex !important;\n flex-direction: column !important;\n justify-content: center !important;\n}\n\n/* Hide Raw Marp Image Artifacts */\n#${safeId} section img[data-marp-bg] {\n display: none !important;\n}\n`;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Theme System — Registry, resolution, and CSS generation\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { BuiltInTheme, SlideTheme, ThemeTokens } from '../types.js';\nimport { darkThemeTokens } from './dark.js';\nimport { lightThemeTokens } from './light.js';\nimport { navyThemeTokens } from './navy.js';\nimport { generateScopedCss as _generateScopedCss } from './scoped-css.js';\n\n/** Built-in theme registry */\nconst builtInThemes: Record<BuiltInTheme, ThemeTokens> = {\n dark: darkThemeTokens,\n light: lightThemeTokens,\n navy: navyThemeTokens,\n};\n\n/**\n * Get theme tokens by built-in name.\n */\nexport function getThemeTokens(theme: BuiltInTheme): ThemeTokens {\n return builtInThemes[theme];\n}\n\n/**\n * Resolve a theme (built-in name or custom SlideTheme) to a full SlideTheme object.\n */\nexport function resolveTheme(theme: BuiltInTheme | SlideTheme | undefined): SlideTheme {\n if (!theme) {\n return { name: 'dark', tokens: builtInThemes.dark };\n }\n\n if (typeof theme === 'string') {\n return { name: theme, tokens: builtInThemes[theme] };\n }\n\n return theme;\n}\n\n/**\n * Define a custom theme with full token control.\n */\nexport function defineTheme(definition: { name: string; tokens: ThemeTokens }): SlideTheme {\n return {\n name: definition.name,\n tokens: definition.tokens,\n };\n}\n\n/**\n * Generate scoped CSS for a theme.\n */\nexport function generateScopedCss(\n theme: SlideTheme,\n containerId?: string,\n): string {\n return _generateScopedCss(theme.tokens, containerId);\n}\n\n// Re-export sub-modules (token objects for advanced usage)\nexport { darkThemeTokens } from './dark.js';\nexport { lightThemeTokens } from './light.js';\nexport { navyThemeTokens } from './navy.js';\nexport { generateScopedCss as generateScopedCssFromTokens } from './scoped-css.js';\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Mermaid Plugin — Lazy-loaded diagram detection and DOM-based rendering\n// Ported from: apps/web/components/MarpSlideViewer.tsx + MermaidRenderer.tsx\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { MermaidBlock } from '../types.js';\n\n/** Singleton mermaid module promise */\nlet mermaidModulePromise: Promise<typeof import('mermaid').default> | null = null;\n/** Track if singleton init failed so we can retry */\nlet mermaidFailed = false;\n\n// ─── Detection ───────────────────────────────────────────────────────────────\n\n/**\n * Decode HTML entities in code content.\n */\nfunction decodeHtmlEntities(html: string): string {\n return html\n .replace(/&/g, '&') // MUST be first to avoid double-decode\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n .replace(/ /g, ' ')\n .replace(/&#(\\d+);/g, (_, code: string) => String.fromCharCode(Number(code)))\n .replace(/&#x([0-9a-fA-F]+);/g, (_, hex: string) => String.fromCharCode(parseInt(hex, 16)));\n}\n\n/**\n * Check if raw text looks like valid mermaid diagram code.\n */\nfunction isValidMermaidCode(text: string): boolean {\n if (!text || text.length > 2500) return false;\n if (text.startsWith('---') || text.includes('marp: true')) return false;\n\n // Check for known mermaid diagram headers\n const hasHeader =\n /^(?:graph\\s+(?:TD|TB|LR|RL|BT)|flowchart\\s+(?:TD|TB|LR|RL|BT)|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt|pie|gitGraph|mindmap|quadrantChart|journey|timeline|xychart|C4Context)\\b/i.test(\n text,\n );\n\n // Must have at least one connection indicator\n const hasConnections =\n text.includes('-->') ||\n text.includes('->>') ||\n text.includes('---') ||\n text.includes('[') ||\n text.includes('(');\n\n return hasHeader && text.includes('\\n') && hasConnections;\n}\n\n/**\n * Detect mermaid blocks in rendered Marp HTML.\n * Returns array of MermaidBlock with raw and sanitized code.\n */\nexport function detectMermaidBlocks(html: string): MermaidBlock[] {\n const blocks: MermaidBlock[] = [];\n\n // Match <pre><code class=\"language-mermaid|diagram|graph\">...</code></pre>\n const regex =\n /<pre><code class=\"language-(?:mermaid|diagram|graph)\">([\\s\\S]*?)<\\/code><\\/pre>/g;\n\n let match;\n let index = 0;\n\n while ((match = regex.exec(html)) !== null) {\n const code = decodeHtmlEntities(match[1]);\n if (isValidMermaidCode(code)) {\n blocks.push({\n index: index++,\n code,\n sanitizedCode: sanitizeMermaidCode(code),\n });\n }\n }\n\n return blocks;\n}\n\n// ─── Sanitization ────────────────────────────────────────────────────────────\n\n/**\n * Sanitize mermaid code — fix common issues that cause render failures.\n * Ported from: apps/web/components/MermaidRenderer.tsx sanitizeMermaidCode()\n */\nexport function sanitizeMermaidCode(chart: string, isDark = false): string {\n let code = (chart || '').trim();\n\n // Remove markdown code fences if wrapped\n code = code.replace(/^```(?:mermaid|diagram|graph)?\\s*/i, '').replace(/```$/i, '').trim();\n\n // If missing diagram header, prepend flowchart TD\n if (\n code &&\n !/^(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt|pie|gitGraph|mindmap|journey|quadrantChart|xychart|C4Context|timeline)/i.test(\n code,\n )\n ) {\n code = `flowchart TD\\n${code}`;\n }\n\n // Fix unquoted node labels with special characters in square brackets\n code = code.replace(\n /([a-zA-Z0-9_-]+)\\[([^\\]\\n\\r\"]+)\\]/g,\n (match, id: string, label: string) => {\n const trimmed = label.trim();\n if (trimmed.startsWith('\"') && trimmed.endsWith('\"')) return match;\n return `${id}[\"${trimmed.replace(/\"/g, \"'\")}\"]`;\n },\n );\n\n // Fix unquoted node labels with special characters in rounded nodes\n code = code.replace(\n /([a-zA-Z0-9_-]+)\\(([^)\\n\\r\"]+)\\)/g,\n (match, id: string, label: string) => {\n const trimmed = label.trim();\n if (trimmed.startsWith('\"') && trimmed.endsWith('\"')) return match;\n return `${id}(\"${trimmed.replace(/\"/g, \"'\")}\")`;\n },\n );\n\n // Fix subgraphs with spaces in name (Mermaid v10+ requires: subgraph id [Title])\n code = code.replace(\n /^\\s*subgraph\\s+([A-Za-z0-9_ -]+)\\s*$/gm,\n (match, rawName: string) => {\n const trimmed = rawName.trim();\n if (trimmed.includes('[') || trimmed.includes(']')) return match;\n const cleanId = trimmed.replace(/[^A-Za-z0-9_]/g, '_');\n return ` subgraph ${cleanId} [\"${trimmed}\"]`;\n },\n );\n\n return code;\n}\n\n// ─── DOM Rendering ───────────────────────────────────────────────────────────\n\n/**\n * Get or create the Mermaid singleton module.\n */\nasync function getMermaid(): Promise<typeof import('mermaid').default> {\n if (mermaidFailed) {\n mermaidModulePromise = null;\n mermaidFailed = false;\n }\n\n if (!mermaidModulePromise) {\n mermaidModulePromise = import('mermaid')\n .then((mod) => mod.default)\n .catch((err) => {\n mermaidModulePromise = null;\n mermaidFailed = true;\n throw new Error(`[presentation-kit] Failed to load Mermaid: ${err}`);\n });\n }\n return mermaidModulePromise;\n}\n\n/**\n * Configuration for Mermaid initialization.\n * Matches the detailed config from MarpSlideViewer.\n */\nfunction getMermaidConfig(isDark: boolean) {\n const tokens = isDark\n ? {\n darkMode: true,\n background: '#18181b',\n primaryColor: '#27272a',\n primaryTextColor: '#f4f4f5',\n primaryBorderColor: 'rgba(255, 255, 255, 0.2)',\n lineColor: '#71717a',\n secondaryColor: '#1e1e24',\n tertiaryColor: '#121214',\n textColor: '#f4f4f5',\n mainBkg: '#1f1f23',\n nodeBorder: 'rgba(255, 255, 255, 0.22)',\n clusterBkg: 'rgba(255, 255, 255, 0.02)',\n clusterBorder: 'rgba(255, 255, 255, 0.12)',\n titleColor: '#f4f4f5',\n edgeLabelBackground: '#27272a',\n actorBorder: 'rgba(255, 255, 255, 0.2)',\n actorBkg: '#27272a',\n actorTextColor: '#f4f4f5',\n actorLineColor: '#71717a',\n signalColor: '#f4f4f5',\n signalTextColor: '#f4f4f5',\n }\n : {\n darkMode: false,\n background: '#ffffff',\n primaryColor: '#f4f4f6',\n primaryTextColor: '#18181b',\n primaryBorderColor: 'rgba(0, 0, 0, 0.15)',\n lineColor: '#94a3b8',\n secondaryColor: '#fafafa',\n tertiaryColor: '#f4f4f5',\n textColor: '#18181b',\n mainBkg: '#f8fafc',\n nodeBorder: 'rgba(0, 0, 0, 0.15)',\n clusterBkg: 'rgba(0, 0, 0, 0.015)',\n clusterBorder: 'rgba(0, 0, 0, 0.1)',\n titleColor: '#18181b',\n edgeLabelBackground: '#f1f5f9',\n actorBorder: 'rgba(0, 0, 0, 0.2)',\n actorBkg: '#f4f4f6',\n actorTextColor: '#18181b',\n actorLineColor: '#94a3b8',\n signalColor: '#18181b',\n signalTextColor: '#18181b',\n };\n\n return {\n startOnLoad: false,\n suppressErrorRendering: true,\n theme: isDark ? ('dark' as const) : ('neutral' as const),\n securityLevel: 'loose' as const,\n fontFamily: 'Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n fontSize: 14,\n flowchart: {\n htmlLabels: false,\n useMaxWidth: false,\n padding: 32,\n nodeSpacing: 55,\n rankSpacing: 60,\n curve: 'basis' as const,\n },\n themeCSS: `\n svg, svg *, g, text, tspan, .node, .node *, .edgeLabel, .edgeLabel *, .cluster, .cluster * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n overflow: visible !important;\n }\n .node rect, .node circle, .node ellipse, .node polygon, .node path {\n stroke-width: 1.5px !important;\n rx: 8px !important;\n ry: 8px !important;\n }\n .node text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .edgeLabel rect {\n rx: 5px !important;\n ry: 5px !important;\n fill: ${isDark ? '#27272a' : '#f1f5f9'} !important;\n stroke: ${isDark ? 'rgba(255, 255, 255, 0.12)' : 'rgba(0, 0, 0, 0.12)'} !important;\n stroke-width: 1px !important;\n }\n .edgeLabel text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 11px !important;\n font-weight: 500 !important;\n fill: ${isDark ? '#e4e4e7' : '#334155'} !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .cluster rect {\n rx: 10px !important;\n ry: 10px !important;\n fill: ${isDark ? 'rgba(255, 255, 255, 0.02)' : 'rgba(0, 0, 0, 0.015)'} !important;\n stroke: ${isDark ? 'rgba(255, 255, 255, 0.12)' : 'rgba(0, 0, 0, 0.12)'} !important;\n stroke-width: 1.5px !important;\n }\n .cluster text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n fill: ${isDark ? '#a1a1aa' : '#64748b'} !important;\n }\n .edgePath path {\n stroke: ${isDark ? '#71717a' : '#94a3b8'} !important;\n stroke-width: 1.5px !important;\n }\n .arrowheadPath {\n fill: ${isDark ? '#71717a' : '#94a3b8'} !important;\n }\n `,\n themeVariables: tokens,\n };\n}\n\n/**\n * Render mermaid diagrams inside a container element.\n * Lazy-loads mermaid module on first call.\n *\n * This function MUST run in a browser environment (needs DOM).\n * Returns early gracefully in SSR/Node.js environments.\n */\nexport async function renderMermaidDiagrams(\n container: HTMLElement,\n theme: 'dark' | 'light' | 'navy' = 'dark',\n): Promise<void> {\n // Guard: SSR/Node.js environments have no DOM\n if (typeof document === 'undefined' || typeof window === 'undefined') {\n console.warn('[presentation-kit] renderMermaidDiagrams skipped: no DOM available (SSR)');\n return;\n }\n\n const mermaid = await getMermaid();\n const isDark = theme === 'dark' || theme === 'navy';\n\n mermaid.initialize(getMermaidConfig(isDark));\n\n // Find mermaid code blocks in container\n const codeNodes = Array.from(\n container.querySelectorAll('pre > code, pre, .marp-mermaid-rendered'),\n );\n\n const mermaidNodes = codeNodes.filter((node) => {\n if ((node as HTMLElement).classList.contains('marp-mermaid-rendered')) return true;\n const text = node.textContent?.trim() || '';\n const className = (node as HTMLElement).className || '';\n\n // Never treat frontmatter or large blocks as mermaid\n if (text.startsWith('---') || text.includes('marp: true') || text.length > 2500) {\n return false;\n }\n\n return (\n className.includes('language-mermaid') ||\n className.includes('language-diagram') ||\n className.includes('language-graph') ||\n isValidMermaidCode(text)\n );\n });\n\n if (mermaidNodes.length === 0) return;\n\n for (let i = 0; i < mermaidNodes.length; i++) {\n const node = mermaidNodes[i] as HTMLElement;\n const isAlreadyWrapper = node.classList.contains('marp-mermaid-rendered');\n const rawChartCode = isAlreadyWrapper\n ? node.getAttribute('data-chart-code') || ''\n : node.textContent?.trim() || '';\n\n if (!rawChartCode) continue;\n\n const preEl = isAlreadyWrapper\n ? node\n : node.tagName.toLowerCase() === 'pre'\n ? node\n : node.parentElement;\n if (!preEl) continue;\n\n const sanitizedCode = sanitizeMermaidCode(rawChartCode, isDark);\n const diagId = `slide_mermaid_${Date.now()}_${i}_${Math.floor(Math.random() * 10000)}`;\n\n try {\n let { svg } = await mermaid.render(diagId, sanitizedCode);\n\n // Strip SVG clip-path attributes to eliminate clipping issues\n svg = svg\n .replace(/clip-path=\"url\\(#[^\"]+\\)\"/gi, '')\n .replace(/clip-path=\"[^\"]*\"/gi, '')\n .replace(/<clipPath[\\s\\S]*?<\\/clipPath>/gi, '');\n\n const wrapper = document.createElement('div');\n wrapper.className =\n 'marp-mermaid-rendered my-3 flex items-center justify-center p-3 rounded-xl bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 [&_svg]:max-w-full [&_svg]:h-auto';\n wrapper.setAttribute('data-chart-code', rawChartCode);\n wrapper.setAttribute('data-mermaid-processed', 'true');\n wrapper.innerHTML = svg;\n preEl.replaceWith(wrapper);\n } catch (renderErr) {\n console.warn('[presentation-kit] Mermaid render error:', renderErr);\n }\n }\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Click Preprocessor — Convert <!-- click --> / <!-- clicks --> to wrapped divs\n// Runs BEFORE Marp renders. Wraps content INSIDE divs for robust HTML structure.\n// ═══════════════════════════════════════════════════════════════════════════════\n\nexport interface ClickPreprocessResult {\n /** Processed markdown with HTML click markers */\n markdown: string;\n /** Total number of click groups assigned */\n totalClicks: number;\n}\n\n/**\n * Preprocess markdown to convert click directives to HTML wrappers.\n *\n * Syntax:\n * - `<!-- click -->` → Block-level: wraps next block in data-click-group=\"N\"\n * - `<!-- clicks -->` → Item-level: marks list for auto-expansion in postprocessor\n *\n * Auto-assigns sequential indices (1, 2, 3, ...) based on order of appearance.\n *\n * IMPORTANT: Skips code fences (``` ... ```) to avoid converting directives\n * inside code blocks.\n *\n * Strategy: Each `<!-- click -->` opens a `<div data-click-group=\"N\">` that wraps\n * all content until the next `<!-- click -->` / `<!-- clicks -->` or end of slide.\n * The postprocessor only needs to handle `<!-- clicks -->` (list expansion).\n */\nexport function preprocessClicks(markdown: string): ClickPreprocessResult {\n if (!markdown || !markdown.trim()) {\n return { markdown, totalClicks: 0 };\n }\n\n // Split markdown into segments: code fences vs normal content\n // Code fences are preserved untouched\n const segments = splitByCodeFences(markdown);\n\n let clickIndex = 0;\n let totalClicks = 0;\n let inClickBlock = false;\n\n const processed = segments\n .map((segment) => {\n // Code fences — pass through untouched\n if (segment.isCodeFence) {\n return segment.content;\n }\n\n // Normal content — process click directives\n let content = segment.content;\n\n // Replace <!-- click --> and <!-- clicks --> with HTML markers\n content = content.replace(\n /^<!--\\s*(click|clicks)\\s*-->$/gm,\n (match, type: string) => {\n clickIndex++;\n\n // Close previous click block if open\n const closePrev = inClickBlock ? '</div>\\n' : '';\n inClickBlock = true;\n\n if (type === 'clicks') {\n totalClicks++;\n // clicks marker — will be expanded in postprocessor\n return `${closePrev}<div data-clicks=\"${clickIndex}\">`;\n } else {\n totalClicks++;\n // click marker — wraps everything until next marker\n return `${closePrev}<div data-click-group=\"${clickIndex}\">`;\n }\n },\n );\n\n return content;\n })\n .join('');\n\n // Close the last click block if open\n const result = inClickBlock ? processed + '</div>' : processed;\n\n return { markdown: result, totalClicks };\n}\n\n/** Represents a segment of markdown (either code fence or normal content) */\ninterface Segment {\n content: string;\n isCodeFence: boolean;\n}\n\n/**\n * Split markdown into code fence and non-code-fence segments.\n * Code fences (``` ... ```) are preserved untouched.\n */\nfunction splitByCodeFences(markdown: string): Segment[] {\n const segments: Segment[] = [];\n const regex = /^(```[\\s\\S]*?^```)/gm;\n\n let lastIndex = 0;\n let match;\n\n while ((match = regex.exec(markdown)) !== null) {\n // Add non-code content before this fence\n if (match.index > lastIndex) {\n segments.push({\n content: markdown.slice(lastIndex, match.index),\n isCodeFence: false,\n });\n }\n // Add the code fence itself\n segments.push({\n content: match[0],\n isCodeFence: true,\n });\n lastIndex = match.index + match[0].length;\n }\n\n // Add remaining content\n if (lastIndex < markdown.length) {\n segments.push({\n content: markdown.slice(lastIndex),\n isCodeFence: false,\n });\n }\n\n return segments;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Click Postprocessor — Expand <!-- clicks --> list items after Marp render\n//\n// The preprocessor already handles <!-- click --> wrapping (block-level).\n// This postprocessor only handles <!-- clicks --> (item-level list expansion).\n// ═══════════════════════════════════════════════════════════════════════════════\n\nexport interface ClickPostprocessResult {\n /** HTML with click groups applied */\n html: string;\n /** Total number of individual click groups (after expanding clicks) */\n totalClicks: number;\n}\n\n/**\n * Post-process rendered Marp HTML to expand clicks (item-level) list items.\n *\n * The preprocessor wraps <!-- click --> blocks in <div data-click-group=\"N\">.\n * This postprocessor handles <!-- clicks --> by splitting list items into\n * individual click groups.\n *\n * Pattern: <div data-clicks=\"N\">...<ul><li>...</li></ul>...</div>\n * Becomes: multiple <div data-click-group=\"N\">...<ul><li>...</li></ul>...</div>\n *\n * @param html - Raw Marp-rendered HTML (with click-group and clicks markers)\n * @returns HTML with all click groups expanded\n */\nexport function postprocessClicks(html: string): ClickPostprocessResult {\n if (!html || !html.includes('data-clicks')) {\n // No clicks markers — count existing click-groups\n const totalClicks = extractMaxClicks(html);\n return { html, totalClicks };\n }\n\n let result = html;\n let totalClicks = 0;\n\n // Handle <!-- clicks --> markers: expand list items into individual click groups\n // Pattern: <div data-clicks=\"N\">...(content with <ul>/<ol>)...</div>\n result = result.replace(\n /<div data-clicks=\"(\\d+)\">([\\s\\S]*?)<\\/div>/g,\n (_, startIdx: string, innerContent: string) => {\n const start = parseInt(startIdx, 10);\n\n // Check if inner content contains a list\n const listMatch = innerContent.match(/((?:<[^>]+>)*?<(?:ul|ol)[^>]*>[\\s\\S]*?<\\/(?:ul|ol)>)/);\n\n if (!listMatch) {\n // No list found — treat as single click group\n totalClicks++;\n return `<div data-click-group=\"${start}\">${innerContent}</div>`;\n }\n\n // Extract list items\n const listBlock = listMatch[0];\n const liRegex = /<li[^>]*>[\\s\\S]*?<\\/li>/g;\n const items: string[] = [];\n let liMatch;\n while ((liMatch = liRegex.exec(listBlock)) !== null) {\n items.push(liMatch[0]);\n }\n\n if (items.length === 0) {\n totalClicks++;\n return `<div data-click-group=\"${start}\">${innerContent}</div>`;\n }\n\n // Get list wrapper tags\n const listOpenTag = listBlock.match(/<(ul|ol)[^>]*>/)?.[0] ?? '<ul>';\n const listCloseTag = listBlock.match(/<\\/(ul|ol)>$/)?.[0] ?? '</ul>';\n\n // Wrap each item in its own click group\n let clickIdx = start;\n const wrappedItems = items.map((item) => {\n const idx = clickIdx++;\n totalClicks++;\n return `<div data-click-group=\"${idx}\">${listOpenTag}${item}${listCloseTag}</div>`;\n });\n\n return wrappedItems.join('\\n');\n },\n );\n\n // Also count any click-groups that were already in the HTML (from <!-- click -->)\n const existingGroups = extractMaxClicks(result);\n if (existingGroups > totalClicks) {\n totalClicks = existingGroups;\n }\n\n return { html: result, totalClicks };\n}\n\n/**\n * Extract max click index from rendered HTML.\n * Scans for all data-click-group=\"N\" attributes and returns the max N.\n */\nexport function extractMaxClicks(html: string): number {\n const matches = html.match(/data-click-group=\"(\\d+)\"/g);\n if (!matches) return 0;\n\n let max = 0;\n for (const match of matches) {\n const num = parseInt(match.match(/data-click-group=\"(\\d+)\"/)?.[1] ?? '0', 10);\n if (num > max) max = num;\n }\n return max;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Click CSS — Scoped CSS for click-to-reveal animations\n// ═══════════════════════════════════════════════════════════════════════════════\n\nexport interface ClickCssOptions {\n /** Container ID to scope CSS (default: no scope, global) */\n containerId?: string;\n /** Animation duration in ms (default: 300) */\n duration?: number;\n /** Animation easing (default: 'ease') */\n easing?: string;\n /** Y offset for slide-up animation in px (default: 8) */\n offsetY?: number;\n /** Use slide-up animation (default: true) */\n slideUp?: boolean;\n /** Use fade animation (default: true) */\n fade?: boolean;\n}\n\n/**\n * Generate CSS for click-to-reveal system.\n *\n * Elements with `data-click-group=\"N\"` are hidden by default.\n * Adding class `visible` reveals them with animation.\n *\n * @param options - Animation options\n * @returns CSS string to inject via <style>\n */\nexport function generateClickCss(options?: ClickCssOptions): string {\n const {\n containerId,\n duration = 300,\n easing = 'ease',\n offsetY = 8,\n slideUp = true,\n fade = true,\n } = options ?? {};\n\n const prefix = containerId ? `#${containerId} ` : '';\n\n const opacityFrom = fade ? '0' : '1';\n const transformFrom = slideUp ? `translateY(${offsetY}px)` : 'none';\n const opacityTo = '1';\n const transformTo = 'translateY(0)';\n\n return `\n/* ── Click-to-Reveal System ── */\n${prefix}[data-click-group] {\n opacity: ${opacityFrom};\n ${slideUp ? `transform: ${transformFrom};` : ''}\n transition: opacity ${duration}ms ${easing}, transform ${duration}ms ${easing};\n pointer-events: none;\n}\n\n${prefix}[data-click-group].visible {\n opacity: ${opacityTo};\n ${slideUp ? `transform: ${transformTo};` : ''}\n pointer-events: auto;\n}\n\n`;\n}\n","import yaml from 'js-yaml';\nimport type { LayoutBoxConfig, SlideLayoutData } from '../../types.js';\n\n/**\n * Check if a comment string represents a layout definition\n */\nexport function isLayoutComment(comment: string): boolean {\n const trimmed = comment.trim();\n return trimmed.startsWith('layout:') || trimmed.startsWith('layout :');\n}\n\n/**\n * Parse YAML layout data from a comment string\n */\nexport function parseLayoutFromComment(comment: string): SlideLayoutData | null {\n try {\n const trimmed = comment.trim();\n if (!isLayoutComment(trimmed)) return null;\n\n const parsed = yaml.load(trimmed) as { layout?: { boxes?: LayoutBoxConfig[] }; boxes?: LayoutBoxConfig[] } | null;\n if (!parsed || typeof parsed !== 'object') return null;\n\n const boxes = parsed.boxes ?? parsed.layout?.boxes;\n if (Array.isArray(boxes)) {\n return { boxes };\n }\n return null;\n } catch (err) {\n console.warn('[presentation-kit] Failed to parse layout comment YAML:', err);\n return null;\n }\n}\n\n/**\n * Filter presenter notes from a slide's comment list,\n * excluding layout blocks and Marp system directives.\n */\nexport function filterPresenterNotes(comments: string[]): string[] {\n return comments\n .map(c => c.trim())\n .filter(c => {\n if (!c) return false;\n // Skip layout definitions\n if (isLayoutComment(c)) return false;\n // Skip Marp directives like <!-- _backgroundColor: ... --> or <!-- paginate: true -->\n if (/^_?[a-zA-Z0-9_-]+\\s*:/i.test(c) && !c.toLowerCase().startsWith('note:')) {\n return false;\n }\n return true;\n })\n .map(c => {\n // If starts with \"note:\" or \"_note:\", strip the prefix\n return c.replace(/^_?note:\\s*/i, '').trim();\n });\n}\n\n/**\n * Extract per-slide layout data and presenter notes from Marp's comments array.\n */\nexport function extractLayoutsAndNotes(rawComments: (string[] | undefined)[]): {\n layouts: (SlideLayoutData | null)[];\n notes: string[][];\n} {\n const layouts: (SlideLayoutData | null)[] = [];\n const notes: string[][] = [];\n\n for (const slideComments of rawComments) {\n if (!slideComments || slideComments.length === 0) {\n layouts.push(null);\n notes.push([]);\n continue;\n }\n\n let slideLayout: SlideLayoutData | null = null;\n\n for (const comment of slideComments) {\n if (isLayoutComment(comment)) {\n const parsed = parseLayoutFromComment(comment);\n if (parsed) {\n slideLayout = parsed;\n }\n }\n }\n\n layouts.push(slideLayout);\n notes.push(filterPresenterNotes(slideComments));\n }\n\n return { layouts, notes };\n}\n","import type { SlideLayoutData } from '../../types.js';\n\n/**\n * Generate scoped CSS for per-slide layout overrides.\n *\n * Targets each slide's section within Marp's 1280x720 SVG coordinate space.\n */\nexport function generateLayoutCss(\n layouts: (SlideLayoutData | null)[],\n containerId: string = 'marp-container'\n): string {\n const cssRules: string[] = [];\n\n layouts.forEach((layout, index) => {\n if (!layout || !layout.boxes || layout.boxes.length === 0) return;\n\n const slideNum = index + 1;\n const sectionSelectors = [\n `#${containerId} svg[data-marpit-svg]:nth-of-type(${slideNum}) section`,\n `#${containerId} .marpit > svg:nth-of-type(${slideNum}) section`,\n `#${containerId} > svg:nth-of-type(${slideNum}) section`,\n ];\n\n // Make section position: relative so absolute boxes position correctly within 1280x720 canvas\n cssRules.push(`\n/* Slide ${slideNum} Layout Container */\n${sectionSelectors.join(',\\n')} {\n position: relative !important;\n display: block !important;\n}`);\n\n for (const box of layout.boxes) {\n if (!box || !Array.isArray(box.pos) || box.pos.length < 4) continue;\n\n const [x, y, w, h] = box.pos;\n // Target selector inside the slide\n const targetSelector = box.target || `[data-box-id=\"${box.id}\"]`;\n const ruleSelector = sectionSelectors.map(s => `${s} ${targetSelector}`).join(',\\n');\n\n const styles: string[] = [\n `position: absolute !important`,\n `left: ${Math.round(x)}px !important`,\n `top: ${Math.round(y)}px !important`,\n `width: ${Math.round(w)}px !important`,\n `min-height: ${Math.round(h)}px !important`,\n `box-sizing: border-box !important`,\n `margin: 0 !important`,\n `word-break: break-word !important`,\n `overflow-wrap: break-word !important`,\n `white-space: normal !important`,\n ];\n\n if (targetSelector.includes('li')) {\n styles.push(`list-style-position: inside !important`);\n }\n\n if (box.fontSize) {\n styles.push(`font-size: ${box.fontSize} !important`);\n }\n if (box.color) {\n styles.push(`color: ${box.color} !important`);\n }\n if (box.textAlign) {\n styles.push(`text-align: ${box.textAlign} !important`);\n }\n if (box.style) {\n styles.push(box.style);\n }\n\n cssRules.push(`\n${ruleSelector} {\n ${styles.join(';\\n ')};\n}`);\n }\n });\n\n return cssRules.join('\\n');\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Core Render — Client-side Marp rendering\n// Replaces: apps/web/app/api/render-marp (server-side HTTP roundtrip)\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport { Marp } from '@marp-team/marp-core';\nimport type { SlideRenderResult, SlideRenderAsyncResult, SlideRenderOptions, MermaidBlock } from '../types.js';\nimport { convertTextArrows } from './arrow-converter.js';\nimport { extractMarpSource } from './source-extractor.js';\nimport { resolveTheme, generateScopedCss } from '../themes/index.js';\nimport { detectMermaidBlocks } from '../plugins/mermaid.js';\nimport { highlightCodeBlocks } from '../plugins/shiki.js';\nimport { preprocessClicks } from '../vclick/preprocessor.js';\nimport { postprocessClicks } from '../vclick/postprocessor.js';\nimport { generateClickCss } from '../vclick/click-css.js';\nimport { extractLayoutsAndNotes, generateLayoutCss } from './layout/index.js';\n\ninterface RenderMarpResult {\n html: string;\n css: string;\n comments: (string[] | undefined)[];\n maxClicks: number;\n}\n\n/**\n * Low-level synchronous Marp render.\n * Preprocesses clicks, converts arrows, renders Marp, postprocesses clicks.\n */\nexport function renderMarp(\n markdown: string,\n containerId: string = 'marp-container',\n enableClicks: boolean = false,\n): RenderMarpResult {\n const cleanSource = extractMarpSource(markdown);\n \n const { markdown: clickProcessed, totalClicks } = enableClicks\n ? preprocessClicks(cleanSource)\n : { markdown: cleanSource, totalClicks: 0 };\n \n const arrowsConverted = convertTextArrows(clickProcessed);\n\n const marp = new Marp({\n container: { tag: 'div', id: containerId },\n html: true,\n emoji: { unicode: true },\n });\n\n const { html, css, comments } = marp.render(arrowsConverted);\n\n // Postprocess click groups if clicks were preprocessed\n if (enableClicks && totalClicks > 0) {\n const { html: processedHtml, totalClicks: finalClicks } = postprocessClicks(html);\n return { html: processedHtml, css, comments: (comments ?? []) as (string[] | undefined)[], maxClicks: finalClicks };\n }\n\n return { html, css, comments: (comments ?? []) as (string[] | undefined)[], maxClicks: 0 };\n}\n\n/**\n * Count slides in rendered Marp HTML by detecting <svg data-marpit-svg> elements.\n */\nexport function countSlides(html: string): number {\n const matches = html.match(/<svg[^>]*data-marpit-svg/g);\n return matches ? matches.length : 1;\n}\n\n/**\n * High-level synchronous render — resolves theme, generates scoped CSS,\n * detects mermaid blocks. Does NOT apply Shiki or Mermaid rendering.\n */\nexport function renderSlide(\n markdown: string,\n options?: SlideRenderOptions,\n): SlideRenderResult {\n const containerId = options?.containerId ?? 'marp-container';\n const theme = resolveTheme(options?.theme ?? 'dark');\n const enableClicks = options?.enableClicks ?? false;\n\n const { html, css, comments, maxClicks } = renderMarp(markdown, containerId, enableClicks);\n const themeCss = generateScopedCss(theme, containerId);\n const slideCount = countSlides(html);\n const mermaidBlocks = options?.enableMermaid !== false\n ? detectMermaidBlocks(html)\n : [];\n const clickCss = enableClicks\n ? generateClickCss({ containerId })\n : '';\n\n const { layouts, notes } = extractLayoutsAndNotes(comments);\n const layoutCss = generateLayoutCss(layouts, containerId);\n\n return {\n html,\n css,\n themeCss,\n layoutCss,\n slideCount,\n mermaidBlocks,\n clickCss,\n maxClicks,\n notes,\n layouts,\n };\n}\n\n/**\n * High-level async render — applies Shiki syntax highlighting.\n * Mermaid blocks are returned separately (DOM-based, consumer renders them).\n */\nexport async function renderSlideAsync(\n markdown: string,\n options?: SlideRenderOptions,\n): Promise<SlideRenderAsyncResult> {\n const containerId = options?.containerId ?? 'marp-container';\n const theme = resolveTheme(options?.theme ?? 'dark');\n const enableClicks = options?.enableClicks ?? false;\n\n const { html, css, comments, maxClicks } = renderMarp(markdown, containerId, enableClicks);\n const themeCss = generateScopedCss(theme, containerId);\n const slideCount = countSlides(html);\n const mermaidBlocks = options?.enableMermaid !== false\n ? detectMermaidBlocks(html)\n : [];\n const clickCss = enableClicks\n ? generateClickCss({ containerId })\n : '';\n\n const { layouts, notes } = extractLayoutsAndNotes(comments);\n const layoutCss = generateLayoutCss(layouts, containerId);\n\n // Apply Shiki syntax highlighting\n const enableShiki = options?.enableShiki ?? true;\n const processedHtml = enableShiki\n ? await highlightCodeBlocks(html, theme.name)\n : html;\n\n return {\n html,\n css,\n themeCss,\n layoutCss,\n processedHtml,\n slideCount,\n mermaidBlocks,\n clickCss,\n maxClicks,\n notes,\n layouts,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/core/arrow-converter.ts","../src/core/source-extractor.ts","../src/themes/dark.ts","../src/themes/light.ts","../src/themes/navy.ts","../src/themes/scoped-css.ts","../src/themes/index.ts","../src/plugins/mermaid.ts","../src/vclick/preprocessor.ts","../src/vclick/postprocessor.ts","../src/vclick/click-css.ts","../src/core/layout/parser.ts","../src/core/layout/css-generator.ts","../src/core/render.ts"],"names":["generateScopedCss","totalClicks"],"mappings":";;;;;AAUO,SAAS,kBAAkB,IAAA,EAAsB;AACtD,EAAA,IAAI,CAAC,MAAM,OAAO,EAAA;AAElB,EAAA,IAAI,OAAA,GAAU,IAAA;AACd,EAAA,IAAI,eAAA,GAAkB,EAAA;AAGtB,EAAA,MAAM,SAAA,GAAY,OAAA,CAAQ,KAAA,CAAM,wCAAwC,CAAA;AACxE,EAAA,IAAI,SAAA,GAAY,CAAC,CAAA,EAAG;AAClB,IAAA,eAAA,GAAkB,UAAU,CAAC,CAAA;AAC7B,IAAA,OAAA,GAAU,OAAA,CAAQ,KAAA,C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B,EAAE,WAAA,EAAa,CAAA,GAChC,EAAA;AAEJ,EAAA,MAAM,EAAE,OAAA,EAAS,KAAA,EAAM,GAAI,uBAAuB,QAAQ,CAAA;AAC1D,EAAA,MAAM,SAAA,GAAY,iBAAA,CAAkB,OAAA,EAAS,WAAW,CAAA;AAGxD,EAAA,MAAM,WAAA,GAAc,SAAS,WAAA,IAAe,IAAA;AAC5C,EAAA,MAAM,gBAAgB,WAAA,GAClB,MAAM,oBAAoB,IAAA,EAAM,KAAA,CAAM,IAAI,CAAA,GAC1C,IAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA;AAAA,IACA,GAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,aAAA;AAAA,IACA,UAAA;AAAA,IACA,aAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA;AAAA,IACA,KAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-3DXMAPAY.js","sourcesContent":["// ═══════════════════════════════════════════════════════════════════════════════\n// Arrow Converter — Text arrows → Unicode arrows\n// Ported from: apps/web/app/api/render-marp/route.ts\n// ═══════════════════════════════════════════════════════════════════════════════\n\n/**\n * Converts text arrows (->, -->, --->, =>, ==>, <->, etc.) into clean Unicode\n * arrows while strictly preserving YAML frontmatter, code fences, inline code,\n * HTML comments, and style tags.\n */\nexport function convertTextArrows(text: string): string {\n if (!text) return '';\n\n let content = text;\n let yamlFrontmatter = '';\n\n // 1. Preserve YAML frontmatter at the beginning of markdown (e.g. --- ... ---)\n const yamlMatch = content.match(/^(---\\r?\\n[\\s\\S]*?\\r?\\n---(?:\\r?\\n|$))/);\n if (yamlMatch?.[1]) {\n yamlFrontmatter = yamlMatch[1];\n content = content.slice(yamlFrontmatter.length);\n }\n\n // 2. Split by code fences, inline code, HTML comments, and style tags\n const segments = content.split(/(```[\\s\\S]*?```|`[^`\\n]+`|<!--[\\s\\S]*?-->|<style[\\s\\S]*?<\\/style>)/g);\n\n const processedContent = segments\n .map((segment) => {\n // If it's a code block, inline code, HTML comment, or style tag, leave untouched\n if (\n segment.startsWith('```') ||\n segment.startsWith('`') ||\n segment.startsWith('<!--') ||\n segment.startsWith('<style')\n ) {\n return segment;\n }\n\n return (\n segment\n // Bi-directional double arrows\n .replace(/<={3,}>/g, '⟺')\n .replace(/<==>/g, '⟺')\n .replace(/<=>/g, '⇔')\n // Bi-directional single arrows\n .replace(/<-{3,}>/g, '⟷')\n .replace(/<-->/g, '⟷')\n .replace(/<->/g, '↔')\n // Long right double arrows\n .replace(/={3,}>/g, '⟹')\n .replace(/==>/g, '⟹')\n .replace(/(^|\\s)=>(?=\\s|$|[.,:;!?\\)])/g, '$1⇒')\n // Long left double arrows\n .replace(/<={3,}/g, '⟸')\n .replace(/<==/g, '⟸')\n .replace(/(^|\\s)<=(?=\\s|$|[.,:;!?\\)])/g, '$1⇐')\n // Long right single arrows (----> -> ⟶, ---> -> ⟶, --> -> ⟶, -> -> →)\n .replace(/-{3,}>/g, '⟶')\n .replace(/-->/g, '⟶')\n .replace(/(^|\\s)->(?=\\s|$|[.,:;!?\\)])/g, '$1→')\n // Long left single arrows (<---- -> ⟵, <--- -> ⟵, <-- -> ⟵, <- -> ←)\n .replace(/<-{3,}/g, '⟵')\n .replace(/<--/g, '⟵')\n .replace(/(^|\\s)<-(?=\\s|$|[.,:;!?\\)])/g, '$1←')\n // LaTeX math arrows\n .replace(/\\$\\\\rightarrow\\$/g, '→')\n .replace(/\\$\\\\leftarrow\\$/g, '←')\n .replace(/\\$\\\\Rightarrow\\$/g, '⇒')\n .replace(/\\$\\\\Leftarrow\\$/g, '⇐')\n .replace(/\\\\rightarrow/g, '→')\n .replace(/\\\\leftarrow/g, '←')\n .replace(/\\\\Rightarrow/g, '⇒')\n .replace(/\\\\Leftarrow/g, '⇐')\n );\n })\n .join('');\n\n return yamlFrontmatter + processedContent;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Source Extractor — Extract clean Marp source from markdown wrappers\n// Ported from: apps/web/components/MarpSlideViewer.tsx\n// ═══════════════════════════════════════════════════════════════════════════════\n\n/**\n * Extracts clean Marp source from markdown that may be wrapped in code fences\n * or preceded by conversational preamble.\n *\n * Handles:\n * - Wrapped in ```markdown ... ``` or ```marp ... ``` or ```md ... ```\n * - Conversational preamble before the first frontmatter ---\n */\nexport function extractMarpSource(raw: string): string {\n if (!raw) return '';\n let text = raw.trim();\n\n // If wrapped in ```markdown ... ``` or ```marp ... ``` or ```md ... ```\n const codeBlockMatch = text.match(/^```(?:markdown|marp|md)?\\s*\\n([\\s\\S]*?)\\n```\\s*$/i);\n if (codeBlockMatch?.[1]) {\n text = codeBlockMatch[1].trim();\n }\n\n // If there is conversational preamble before the first frontmatter ---\n const firstFrontmatter = text.search(/^---\\s*$/m);\n if (firstFrontmatter > 0 && text.includes('marp: true')) {\n text = text.substring(firstFrontmatter).trim();\n }\n\n return text;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Dark Theme — Studio Dark (#14151b)\n// Ported from: apps/web/components/MarpSlideViewer.tsx scopedSlideStyles\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { ThemeTokens } from '../types.js';\n\nexport const darkThemeTokens: ThemeTokens = {\n // Surfaces\n background: '#14151b',\n cardBorder: '1px solid rgba(255, 255, 255, 0.08)',\n cardShadow: '0 8px 24px -4px rgba(0, 0, 0, 0.4)',\n\n // Typography — Calm single-hue readability (Zinc-200)\n text: '#cbd5e1',\n heading: '#e4e4e7',\n bold: '#ffffff',\n link: '#60a5fa',\n meta: '#94a3b8',\n\n // Code\n codeBg: '#0c0c0e',\n codeText: '#e4e4e7',\n inlineCodeBg: '#0c0c0e',\n inlineCodeText: '#e4e4e7',\n codeBorder: 'rgba(255, 255, 255, 0.08)',\n\n // Blockquotes\n quoteBg: 'rgba(255, 255, 255, 0.04)',\n quoteBorder: 'rgba(255, 255, 255, 0.15)',\n quoteText: '#e4e4e7',\n\n // Tables\n tableHeaderBg: 'rgba(255, 255, 255, 0.04)',\n tableBorder: 'rgba(255, 255, 255, 0.08)',\n tableRowHover: 'rgba(255, 255, 255, 0.02)',\n tableText: '#cbd5e1',\n tableEvenRow: 'rgba(255, 255, 255, 0.03)',\n\n // Mermaid\n mermaidDark: true,\n mermaidVariables: {\n darkMode: 'true',\n background: '#18181b',\n primaryColor: '#27272a',\n primaryTextColor: '#f4f4f5',\n primaryBorderColor: 'rgba(255, 255, 255, 0.2)',\n lineColor: '#71717a',\n secondaryColor: '#1e1e24',\n tertiaryColor: '#121214',\n textColor: '#f4f4f5',\n mainBkg: '#1f1f23',\n nodeBorder: 'rgba(255, 255, 255, 0.22)',\n clusterBkg: 'rgba(255, 255, 255, 0.02)',\n clusterBorder: 'rgba(255, 255, 255, 0.12)',\n titleColor: '#f4f4f5',\n edgeLabelBackground: '#27272a',\n actorBorder: 'rgba(255, 255, 255, 0.2)',\n actorBkg: '#27272a',\n actorTextColor: '#f4f4f5',\n actorLineColor: '#71717a',\n signalColor: '#f4f4f5',\n signalTextColor: '#f4f4f5',\n },\n mermaidThemeCSS: `\n svg, svg *, g, text, tspan, .node, .node *, .edgeLabel, .edgeLabel *, .cluster, .cluster * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n overflow: visible !important;\n }\n .node rect, .node circle, .node ellipse, .node polygon, .node path {\n stroke-width: 1.5px !important;\n rx: 8px !important;\n ry: 8px !important;\n }\n .node text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .edgeLabel rect {\n rx: 5px !important;\n ry: 5px !important;\n fill: #27272a !important;\n stroke: rgba(255, 255, 255, 0.12) !important;\n stroke-width: 1px !important;\n }\n .edgeLabel text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 11px !important;\n font-weight: 500 !important;\n fill: #e4e4e7 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .cluster rect {\n rx: 10px !important;\n ry: 10px !important;\n fill: rgba(255, 255, 255, 0.02) !important;\n stroke: rgba(255, 255, 255, 0.12) !important;\n stroke-width: 1.5px !important;\n }\n .cluster text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n fill: #a1a1aa !important;\n }\n .edgePath path {\n stroke: #71717a !important;\n stroke-width: 1.5px !important;\n }\n .arrowheadPath {\n fill: #71717a !important;\n }\n `,\n};\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Light Theme — Keynote White (#ffffff)\n// Ported from: apps/web/components/MarpSlideViewer.tsx scopedSlideStyles\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { ThemeTokens } from '../types.js';\n\nexport const lightThemeTokens: ThemeTokens = {\n // Surfaces\n background: '#ffffff',\n cardBorder: '1px solid rgba(0, 0, 0, 0.08)',\n cardShadow: '0 4px 16px -2px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03)',\n\n // Typography — Calm single-hue readability (Zinc-800)\n text: '#3f3f46',\n heading: '#27272a',\n bold: '#18181b',\n link: '#2563eb',\n meta: '#71717a',\n\n // Code\n codeBg: '#f4f4f5',\n codeText: '#27272a',\n inlineCodeBg: '#f4f4f5',\n inlineCodeText: '#27272a',\n codeBorder: 'rgba(0, 0, 0, 0.08)',\n\n // Blockquotes\n quoteBg: '#f8f9fa',\n quoteBorder: 'rgba(0, 0, 0, 0.15)',\n quoteText: '#27272a',\n\n // Tables\n tableHeaderBg: '#f8fafc',\n tableBorder: '#e2e8f0',\n tableRowHover: 'rgba(0, 0, 0, 0.02)',\n tableText: '#3f3f46',\n tableEvenRow: '#f8fafc',\n\n // Mermaid\n mermaidDark: false,\n mermaidVariables: {\n darkMode: 'false',\n background: '#ffffff',\n primaryColor: '#f4f4f6',\n primaryTextColor: '#18181b',\n primaryBorderColor: 'rgba(0, 0, 0, 0.15)',\n lineColor: '#94a3b8',\n secondaryColor: '#fafafa',\n tertiaryColor: '#f4f4f5',\n textColor: '#18181b',\n mainBkg: '#f8fafc',\n nodeBorder: 'rgba(0, 0, 0, 0.15)',\n clusterBkg: 'rgba(0, 0, 0, 0.015)',\n clusterBorder: 'rgba(0, 0, 0, 0.1)',\n titleColor: '#18181b',\n edgeLabelBackground: '#f1f5f9',\n actorBorder: 'rgba(0, 0, 0, 0.2)',\n actorBkg: '#f4f4f6',\n actorTextColor: '#18181b',\n actorLineColor: '#94a3b8',\n signalColor: '#18181b',\n signalTextColor: '#18181b',\n },\n mermaidThemeCSS: `\n svg, svg *, g, text, tspan, .node, .node *, .edgeLabel, .edgeLabel *, .cluster, .cluster * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n overflow: visible !important;\n }\n .node rect, .node circle, .node ellipse, .node polygon, .node path {\n stroke-width: 1.5px !important;\n rx: 8px !important;\n ry: 8px !important;\n }\n .node text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .edgeLabel rect {\n rx: 5px !important;\n ry: 5px !important;\n fill: #f1f5f9 !important;\n stroke: rgba(0, 0, 0, 0.12) !important;\n stroke-width: 1px !important;\n }\n .edgeLabel text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 11px !important;\n font-weight: 500 !important;\n fill: #334155 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .cluster rect {\n rx: 10px !important;\n ry: 10px !important;\n fill: rgba(0, 0, 0, 0.015) !important;\n stroke: rgba(0, 0, 0, 0.12) !important;\n stroke-width: 1.5px !important;\n }\n .cluster text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n fill: #64748b !important;\n }\n .edgePath path {\n stroke: #94a3b8 !important;\n stroke-width: 1.5px !important;\n }\n .arrowheadPath {\n fill: #94a3b8 !important;\n }\n `,\n};\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Navy Theme — Deep Navy (#0f172a)\n// Ported from: apps/web/components/MarpSlideViewer.tsx scopedSlideStyles\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { ThemeTokens } from '../types.js';\n\nexport const navyThemeTokens: ThemeTokens = {\n // Surfaces\n background: '#0f172a',\n cardBorder: '1px solid rgba(255, 255, 255, 0.08)',\n cardShadow: '0 8px 24px -4px rgba(0, 0, 0, 0.4)',\n\n // Typography — Calm single-hue readability (Zinc-200)\n text: '#94a3b8',\n heading: '#f8fafc',\n bold: '#ffffff',\n link: '#38bdf8',\n meta: '#94a3b8',\n\n // Code\n codeBg: '#020617',\n codeText: '#e4e4e7',\n inlineCodeBg: '#020617',\n inlineCodeText: '#e4e4e7',\n codeBorder: 'rgba(255, 255, 255, 0.08)',\n\n // Blockquotes — Navy uses sky tint\n quoteBg: 'rgba(56, 189, 248, 0.06)',\n quoteBorder: 'rgba(255, 255, 255, 0.15)',\n quoteText: '#e4e4e7',\n\n // Tables\n tableHeaderBg: 'rgba(255, 255, 255, 0.04)',\n tableBorder: 'rgba(255, 255, 255, 0.08)',\n tableRowHover: 'rgba(255, 255, 255, 0.02)',\n tableText: '#94a3b8',\n tableEvenRow: 'rgba(56, 189, 248, 0.03)',\n\n // Mermaid — reuse dark config with navy tint\n mermaidDark: true,\n mermaidVariables: {\n darkMode: 'true',\n background: '#18181b',\n primaryColor: '#27272a',\n primaryTextColor: '#f4f4f5',\n primaryBorderColor: 'rgba(255, 255, 255, 0.2)',\n lineColor: '#71717a',\n secondaryColor: '#1e1e24',\n tertiaryColor: '#121214',\n textColor: '#f4f4f5',\n mainBkg: '#1f1f23',\n nodeBorder: 'rgba(255, 255, 255, 0.22)',\n clusterBkg: 'rgba(255, 255, 255, 0.02)',\n clusterBorder: 'rgba(255, 255, 255, 0.12)',\n titleColor: '#f4f4f5',\n edgeLabelBackground: '#27272a',\n actorBorder: 'rgba(255, 255, 255, 0.2)',\n actorBkg: '#27272a',\n actorTextColor: '#f4f4f5',\n actorLineColor: '#71717a',\n signalColor: '#f4f4f5',\n signalTextColor: '#f4f4f5',\n },\n mermaidThemeCSS: `\n svg, svg *, g, text, tspan, .node, .node *, .edgeLabel, .edgeLabel *, .cluster, .cluster * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n overflow: visible !important;\n }\n .node rect, .node circle, .node ellipse, .node polygon, .node path {\n stroke-width: 1.5px !important;\n rx: 8px !important;\n ry: 8px !important;\n }\n .node text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .edgeLabel rect {\n rx: 5px !important;\n ry: 5px !important;\n fill: #27272a !important;\n stroke: rgba(255, 255, 255, 0.12) !important;\n stroke-width: 1px !important;\n }\n .edgeLabel text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 11px !important;\n font-weight: 500 !important;\n fill: #e4e4e7 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .cluster rect {\n rx: 10px !important;\n ry: 10px !important;\n fill: rgba(255, 255, 255, 0.02) !important;\n stroke: rgba(255, 255, 255, 0.12) !important;\n stroke-width: 1.5px !important;\n }\n .cluster text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n fill: #a1a1aa !important;\n }\n .edgePath path {\n stroke: #71717a !important;\n stroke-width: 1.5px !important;\n }\n .arrowheadPath {\n fill: #71717a !important;\n }\n `,\n};\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Scoped CSS Generator — Theme-specific CSS for 1280x720 Marp canvas\n// Ported from: apps/web/components/MarpSlideViewer.tsx scopedSlideStyles\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { ThemeTokens } from '../types.js';\n\n/**\n * Sanitize a string for safe use as a CSS selector (ID).\n * Escapes characters that are special in CSS selectors.\n */\nfunction sanitizeCssId(id: string): string {\n // CSS.escape() is available in modern browsers and Node 20+\n // Fallback: manual escape for common problematic chars\n if (typeof CSS !== 'undefined' && typeof CSS.escape === 'function') {\n return CSS.escape(id);\n }\n return id.replace(/([\"'\\\\()\\[\\]#.;,{}\\s!@#$%^&*=+|<>?/~`])/g, '\\\\$1');\n}\n\n/**\n * Generate scoped CSS string for a given theme.\n * This CSS overrides Marp defaults for 1280×720 canvas typography using\n * the container ID for CSS isolation.\n */\nexport function generateScopedCss(tokens: ThemeTokens, containerId: string = 'marp-container'): string {\n const safeId = sanitizeCssId(containerId);\n return `\n/* ── Isolation: Scope all styles to #${safeId} ── */\n#${safeId} {\n width: 100%;\n}\n\n/* Base Slide Card Styling (Thin hairline border) */\n#${safeId} svg[data-marpit-svg] {\n background-color: ${tokens.background} !important;\n border-radius: 12px !important;\n border: ${tokens.cardBorder} !important;\n box-shadow: ${tokens.cardShadow} !important;\n overflow: hidden !important;\n transition: border-color 0.15s ease;\n}\n\n/* Slide Inner Section (1280x720 Canvas Coordinate Scale) */\n#${safeId} section:not([data-background-color]):not([style*=\"background\"]),\n#${safeId} foreignObject > section:not([data-background-color]):not([style*=\"background\"]) {\n background-color: ${tokens.background} !important;\n}\n\n#${safeId} section,\n#${safeId} foreignObject > section {\n color: ${tokens.text} !important;\n font-family: var(--font-sans), Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n padding: 50px 60px !important;\n box-sizing: border-box !important;\n display: flex !important;\n flex-direction: column !important;\n justify-content: center !important;\n}\n\n/* Force inline display for emojis, twemojis, and inline text emojis */\n#${safeId} section img.emoji,\n#${safeId} section img[data-marp-twemoji],\n#${safeId} section .emoji {\n display: inline-block !important;\n vertical-align: -0.15em !important;\n height: 1.15em !important;\n width: 1.15em !important;\n margin: 0 0.15em !important;\n}\n\n/* Mermaid Diagram styling inside Marp Canvas */\n#${safeId} section .marp-mermaid-rendered {\n width: 100% !important;\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n margin: 16px 0 !important;\n}\n\n#${safeId} section .marp-mermaid-rendered svg {\n display: block !important;\n max-width: 100% !important;\n max-height: 420px !important;\n width: auto !important;\n height: auto !important;\n}\n\n#${safeId} section .marp-mermaid-rendered svg * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n}\n\n#${safeId} section .katex,\n#${safeId} section .katex-html {\n display: inline-block !important;\n vertical-align: baseline !important;\n}\n\n#${safeId} section strong,\n#${safeId} section b,\n#${safeId} section em,\n#${safeId} section span {\n display: inline !important;\n}\n\n/* ── Typography Scale for 1280x720 Canvas ── */\n#${safeId} section h1 {\n font-size: 38px !important;\n font-weight: 700 !important;\n line-height: 1.25 !important;\n color: ${tokens.heading} !important;\n margin: 0 0 18px 0 !important;\n letter-spacing: -0.02em !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n}\n\n#${safeId} section h2 {\n font-size: 28px !important;\n font-weight: 600 !important;\n line-height: 1.3 !important;\n color: ${tokens.heading} !important;\n margin: 0 0 16px 0 !important;\n letter-spacing: -0.01em !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n}\n\n#${safeId} section h3 {\n font-size: 22px !important;\n font-weight: 600 !important;\n line-height: 1.4 !important;\n color: ${tokens.heading} !important;\n margin: 0 0 14px 0 !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n}\n\n#${safeId} section p,\n#${safeId} section li {\n font-size: 18px !important;\n line-height: 1.7 !important;\n color: ${tokens.text} !important;\n margin-top: 0 !important;\n margin-bottom: 12px !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n}\n\n#${safeId} section strong,\n#${safeId} section b {\n color: ${tokens.bold} !important;\n font-weight: 600 !important;\n}\n\n#${safeId} section a {\n color: ${tokens.link} !important;\n text-decoration: underline !important;\n text-decoration-thickness: 1px !important;\n text-underline-offset: 2px !important;\n}\n\n#${safeId} section a:hover {\n opacity: 0.85 !important;\n}\n\n#${safeId} section ul,\n#${safeId} section ol {\n margin: 0 0 16px 28px !important;\n padding: 0 !important;\n}\n\n#${safeId} section li {\n margin-bottom: 8px !important;\n}\n\n/* Blockquotes / Callout Cards */\n#${safeId} section blockquote {\n background: ${tokens.quoteBg} !important;\n border-left: 3px solid ${tokens.quoteBorder} !important;\n border-radius: 6px !important;\n padding: 16px 24px !important;\n margin: 16px 0 !important;\n color: ${tokens.quoteText} !important;\n}\n#${safeId} section blockquote p {\n color: ${tokens.quoteText} !important;\n font-size: 18px !important;\n margin: 0 !important;\n}\n\n/* Code Blocks & Inline Code (Monospace font standard) */\n#${safeId} section code {\n font-family: var(--font-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;\n font-style: normal !important;\n font-size: 15px !important;\n background: ${tokens.inlineCodeBg} !important;\n color: ${tokens.inlineCodeText} !important;\n padding: 2px 8px !important;\n border-radius: 6px !important;\n border: 1px solid ${tokens.codeBorder} !important;\n}\n\n#${safeId} section pre {\n background: ${tokens.codeBg} !important;\n border: 1px solid ${tokens.codeBorder} !important;\n border-radius: 8px !important;\n padding: 18px 22px !important;\n margin: 16px 0 !important;\n overflow-x: auto !important;\n}\n\n#${safeId} section pre code {\n background: transparent !important;\n border: none !important;\n padding: 0 !important;\n font-family: var(--font-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;\n font-style: normal !important;\n font-size: 15px !important;\n line-height: 1.6 !important;\n color: ${tokens.codeText} !important;\n}\n\n/* Tables */\ndiv#${safeId} svg foreignObject section table,\n#${safeId} section table {\n width: 100% !important;\n border-collapse: collapse !important;\n margin: 16px 0 !important;\n font-size: 17px !important;\n background-color: transparent !important;\n background: transparent !important;\n display: table !important;\n}\n\ndiv#${safeId} svg foreignObject section table tr,\n#${safeId} section table tr {\n background-color: transparent !important;\n background: transparent !important;\n border-top: 1px solid ${tokens.tableBorder} !important;\n}\n\ndiv#${safeId} svg foreignObject section table tbody tr:nth-child(2n),\n#${safeId} section table tbody tr:nth-child(2n) {\n background-color: ${tokens.tableEvenRow ?? tokens.tableHeaderBg} !important;\n}\n\ndiv#${safeId} svg foreignObject section table thead tr,\n#${safeId} section table thead tr {\n background-color: ${tokens.tableHeaderBg} !important;\n}\n\ndiv#${safeId} svg foreignObject section table th,\n#${safeId} section table th {\n background-color: ${tokens.tableHeaderBg} !important;\n color: ${tokens.heading} !important;\n font-weight: 600 !important;\n padding: 10px 16px !important;\n border: 1px solid ${tokens.tableBorder} !important;\n text-align: left !important;\n}\n\ndiv#${safeId} svg foreignObject section table td,\n#${safeId} section table td {\n padding: 10px 16px !important;\n border: 1px solid ${tokens.tableBorder} !important;\n color: ${tokens.tableText} !important;\n background-color: transparent !important;\n}\n\ndiv#${safeId} svg foreignObject section table tr:hover td,\n#${safeId} section table tr:hover td {\n background-color: ${tokens.tableRowHover} !important;\n}\n\n/* Header & Footer */\n#${safeId} section header,\n#${safeId} section footer {\n position: absolute !important;\n left: 60px !important;\n right: 60px !important;\n font-size: 14px !important;\n color: ${tokens.meta} !important;\n font-family: var(--font-sans), Inter, sans-serif !important;\n opacity: 0.8 !important;\n}\n\n#${safeId} section header {\n top: 24px !important;\n border-bottom: 1px solid ${tokens.tableBorder} !important;\n padding-bottom: 6px !important;\n}\n\n#${safeId} section footer {\n bottom: 24px !important;\n border-top: 1px solid ${tokens.tableBorder} !important;\n padding-top: 6px !important;\n}\n\n/* Multi-column Grid & Flex Layout Utilities */\n#${safeId} section .columns,\n#${safeId} section .grid-2 {\n display: grid !important;\n grid-template-columns: 1fr 1fr !important;\n gap: 28px !important;\n width: 100% !important;\n margin: 16px 0 !important;\n align-items: start !important;\n}\n\n#${safeId} section .columns > div,\n#${safeId} section .grid-2 > div {\n min-width: 0 !important;\n}\n\n#${safeId} section .card {\n background: ${tokens.quoteBg} !important;\n border: 1px solid ${tokens.cardBorder} !important;\n border-radius: 10px !important;\n padding: 18px 22px !important;\n margin: 12px 0 !important;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;\n}\n\n#${safeId} section .card.highlight {\n border-left: 4px solid ${tokens.link} !important;\n}\n\n#${safeId} section .card.warning {\n border-left: 4px solid #f59e0b !important;\n}\n\n#${safeId} section .card.success {\n border-left: 4px solid #10b981 !important;\n}\n\n/* Marp Split Layout Container */\n#${safeId} section[data-marpit-advanced-background=\"background\"] {\n display: flex !important;\n flex-direction: row !important;\n padding: 0 !important;\n}\n\n#${safeId} section[data-marpit-advanced-background=\"background\"] > .marpit-advanced-background-container {\n flex: 0 0 50% !important;\n height: 100% !important;\n position: relative !important;\n}\n\n#${safeId} section[data-marpit-advanced-background=\"background\"] > .marpit-advanced-background-container + * {\n flex: 1 !important;\n padding: 50px 60px !important;\n display: flex !important;\n flex-direction: column !important;\n justify-content: center !important;\n}\n\n/* Hide Raw Marp Image Artifacts */\n#${safeId} section img[data-marp-bg] {\n display: none !important;\n}\n`;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Theme System — Registry, resolution, and CSS generation\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { BuiltInTheme, SlideTheme, ThemeTokens } from '../types.js';\nimport { darkThemeTokens } from './dark.js';\nimport { lightThemeTokens } from './light.js';\nimport { navyThemeTokens } from './navy.js';\nimport { generateScopedCss as _generateScopedCss } from './scoped-css.js';\n\n/** Built-in theme registry */\nconst builtInThemes: Record<BuiltInTheme, ThemeTokens> = {\n dark: darkThemeTokens,\n light: lightThemeTokens,\n navy: navyThemeTokens,\n};\n\n/**\n * Get theme tokens by built-in name.\n */\nexport function getThemeTokens(theme: BuiltInTheme): ThemeTokens {\n return builtInThemes[theme];\n}\n\n/**\n * Resolve a theme (built-in name or custom SlideTheme) to a full SlideTheme object.\n */\nexport function resolveTheme(theme: BuiltInTheme | SlideTheme | undefined): SlideTheme {\n if (!theme) {\n return { name: 'dark', tokens: builtInThemes.dark };\n }\n\n if (typeof theme === 'string') {\n return { name: theme, tokens: builtInThemes[theme] };\n }\n\n return theme;\n}\n\n/**\n * Define a custom theme with full token control.\n */\nexport function defineTheme(definition: { name: string; tokens: ThemeTokens }): SlideTheme {\n return {\n name: definition.name,\n tokens: definition.tokens,\n };\n}\n\n/**\n * Generate scoped CSS for a theme.\n */\nexport function generateScopedCss(\n theme: SlideTheme,\n containerId?: string,\n): string {\n return _generateScopedCss(theme.tokens, containerId);\n}\n\n// Re-export sub-modules (token objects for advanced usage)\nexport { darkThemeTokens } from './dark.js';\nexport { lightThemeTokens } from './light.js';\nexport { navyThemeTokens } from './navy.js';\nexport { generateScopedCss as generateScopedCssFromTokens } from './scoped-css.js';\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Mermaid Plugin — Lazy-loaded diagram detection and DOM-based rendering\n// Ported from: apps/web/components/MarpSlideViewer.tsx + MermaidRenderer.tsx\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport type { MermaidBlock } from '../types.js';\n\n/** Singleton mermaid module promise */\nlet mermaidModulePromise: Promise<typeof import('mermaid').default> | null = null;\n/** Track if singleton init failed so we can retry */\nlet mermaidFailed = false;\n\n// ─── Detection ───────────────────────────────────────────────────────────────\n\n/**\n * Decode HTML entities in code content.\n */\nfunction decodeHtmlEntities(html: string): string {\n return html\n .replace(/&/g, '&') // MUST be first to avoid double-decode\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/"/g, '\"')\n .replace(/'/g, \"'\")\n .replace(/ /g, ' ')\n .replace(/&#(\\d+);/g, (_, code: string) => String.fromCharCode(Number(code)))\n .replace(/&#x([0-9a-fA-F]+);/g, (_, hex: string) => String.fromCharCode(parseInt(hex, 16)));\n}\n\n/**\n * Check if raw text looks like valid mermaid diagram code.\n */\nfunction isValidMermaidCode(text: string): boolean {\n if (!text || text.length > 2500) return false;\n if (text.startsWith('---') || text.includes('marp: true')) return false;\n\n // Check for known mermaid diagram headers\n const hasHeader =\n /^(?:graph\\s+(?:TD|TB|LR|RL|BT)|flowchart\\s+(?:TD|TB|LR|RL|BT)|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt|pie|gitGraph|mindmap|quadrantChart|journey|timeline|xychart|C4Context)\\b/i.test(\n text,\n );\n\n // Must have at least one connection indicator\n const hasConnections =\n text.includes('-->') ||\n text.includes('->>') ||\n text.includes('---') ||\n text.includes('[') ||\n text.includes('(');\n\n return hasHeader && text.includes('\\n') && hasConnections;\n}\n\n/**\n * Detect mermaid blocks in rendered Marp HTML.\n * Returns array of MermaidBlock with raw and sanitized code.\n */\nexport function detectMermaidBlocks(html: string): MermaidBlock[] {\n const blocks: MermaidBlock[] = [];\n\n // Match <pre><code class=\"language-mermaid|diagram|graph\">...</code></pre>\n const regex =\n /<pre><code class=\"language-(?:mermaid|diagram|graph)\">([\\s\\S]*?)<\\/code><\\/pre>/g;\n\n let match;\n let index = 0;\n\n while ((match = regex.exec(html)) !== null) {\n const code = decodeHtmlEntities(match[1]);\n if (isValidMermaidCode(code)) {\n blocks.push({\n index: index++,\n code,\n sanitizedCode: sanitizeMermaidCode(code),\n });\n }\n }\n\n return blocks;\n}\n\n// ─── Sanitization ────────────────────────────────────────────────────────────\n\n/**\n * Sanitize mermaid code — fix common issues that cause render failures.\n * Ported from: apps/web/components/MermaidRenderer.tsx sanitizeMermaidCode()\n */\nexport function sanitizeMermaidCode(chart: string, isDark = false): string {\n let code = (chart || '').trim();\n\n // Remove markdown code fences if wrapped\n code = code.replace(/^```(?:mermaid|diagram|graph)?\\s*/i, '').replace(/```$/i, '').trim();\n\n // If missing diagram header, prepend flowchart TD\n if (\n code &&\n !/^(graph|flowchart|sequenceDiagram|classDiagram|stateDiagram|erDiagram|gantt|pie|gitGraph|mindmap|journey|quadrantChart|xychart|C4Context|timeline)/i.test(\n code,\n )\n ) {\n code = `flowchart TD\\n${code}`;\n }\n\n // Fix unquoted node labels with special characters in square brackets\n code = code.replace(\n /([a-zA-Z0-9_-]+)\\[([^\\]\\n\\r\"]+)\\]/g,\n (match, id: string, label: string) => {\n const trimmed = label.trim();\n if (trimmed.startsWith('\"') && trimmed.endsWith('\"')) return match;\n return `${id}[\"${trimmed.replace(/\"/g, \"'\")}\"]`;\n },\n );\n\n // Fix unquoted node labels with special characters in rounded nodes\n code = code.replace(\n /([a-zA-Z0-9_-]+)\\(([^)\\n\\r\"]+)\\)/g,\n (match, id: string, label: string) => {\n const trimmed = label.trim();\n if (trimmed.startsWith('\"') && trimmed.endsWith('\"')) return match;\n return `${id}(\"${trimmed.replace(/\"/g, \"'\")}\")`;\n },\n );\n\n // Fix subgraphs with spaces in name (Mermaid v10+ requires: subgraph id [Title])\n code = code.replace(\n /^\\s*subgraph\\s+([A-Za-z0-9_ -]+)\\s*$/gm,\n (match, rawName: string) => {\n const trimmed = rawName.trim();\n if (trimmed.includes('[') || trimmed.includes(']')) return match;\n const cleanId = trimmed.replace(/[^A-Za-z0-9_]/g, '_');\n return ` subgraph ${cleanId} [\"${trimmed}\"]`;\n },\n );\n\n return code;\n}\n\n// ─── DOM Rendering ───────────────────────────────────────────────────────────\n\n/**\n * Get or create the Mermaid singleton module.\n */\nasync function getMermaid(): Promise<typeof import('mermaid').default> {\n if (mermaidFailed) {\n mermaidModulePromise = null;\n mermaidFailed = false;\n }\n\n if (!mermaidModulePromise) {\n mermaidModulePromise = import('mermaid')\n .then((mod) => mod.default)\n .catch((err) => {\n mermaidModulePromise = null;\n mermaidFailed = true;\n throw new Error(`[presentation-kit] Failed to load Mermaid: ${err}`);\n });\n }\n return mermaidModulePromise;\n}\n\n/**\n * Configuration for Mermaid initialization.\n * Matches the detailed config from MarpSlideViewer.\n */\nfunction getMermaidConfig(isDark: boolean) {\n const tokens = isDark\n ? {\n darkMode: true,\n background: '#18181b',\n primaryColor: '#27272a',\n primaryTextColor: '#f4f4f5',\n primaryBorderColor: 'rgba(255, 255, 255, 0.2)',\n lineColor: '#71717a',\n secondaryColor: '#1e1e24',\n tertiaryColor: '#121214',\n textColor: '#f4f4f5',\n mainBkg: '#1f1f23',\n nodeBorder: 'rgba(255, 255, 255, 0.22)',\n clusterBkg: 'rgba(255, 255, 255, 0.02)',\n clusterBorder: 'rgba(255, 255, 255, 0.12)',\n titleColor: '#f4f4f5',\n edgeLabelBackground: '#27272a',\n actorBorder: 'rgba(255, 255, 255, 0.2)',\n actorBkg: '#27272a',\n actorTextColor: '#f4f4f5',\n actorLineColor: '#71717a',\n signalColor: '#f4f4f5',\n signalTextColor: '#f4f4f5',\n }\n : {\n darkMode: false,\n background: '#ffffff',\n primaryColor: '#f4f4f6',\n primaryTextColor: '#18181b',\n primaryBorderColor: 'rgba(0, 0, 0, 0.15)',\n lineColor: '#94a3b8',\n secondaryColor: '#fafafa',\n tertiaryColor: '#f4f4f5',\n textColor: '#18181b',\n mainBkg: '#f8fafc',\n nodeBorder: 'rgba(0, 0, 0, 0.15)',\n clusterBkg: 'rgba(0, 0, 0, 0.015)',\n clusterBorder: 'rgba(0, 0, 0, 0.1)',\n titleColor: '#18181b',\n edgeLabelBackground: '#f1f5f9',\n actorBorder: 'rgba(0, 0, 0, 0.2)',\n actorBkg: '#f4f4f6',\n actorTextColor: '#18181b',\n actorLineColor: '#94a3b8',\n signalColor: '#18181b',\n signalTextColor: '#18181b',\n };\n\n return {\n startOnLoad: false,\n suppressErrorRendering: true,\n theme: isDark ? ('dark' as const) : ('neutral' as const),\n securityLevel: 'loose' as const,\n fontFamily: 'Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n fontSize: 14,\n flowchart: {\n htmlLabels: false,\n useMaxWidth: false,\n padding: 32,\n nodeSpacing: 55,\n rankSpacing: 60,\n curve: 'basis' as const,\n },\n themeCSS: `\n svg, svg *, g, text, tspan, .node, .node *, .edgeLabel, .edgeLabel *, .cluster, .cluster * {\n clip-path: none !important;\n -webkit-clip-path: none !important;\n overflow: visible !important;\n }\n .node rect, .node circle, .node ellipse, .node polygon, .node path {\n stroke-width: 1.5px !important;\n rx: 8px !important;\n ry: 8px !important;\n }\n .node text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 13px !important;\n font-weight: 500 !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .edgeLabel rect {\n rx: 5px !important;\n ry: 5px !important;\n fill: ${isDark ? '#27272a' : '#f1f5f9'} !important;\n stroke: ${isDark ? 'rgba(255, 255, 255, 0.12)' : 'rgba(0, 0, 0, 0.12)'} !important;\n stroke-width: 1px !important;\n }\n .edgeLabel text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 11px !important;\n font-weight: 500 !important;\n fill: ${isDark ? '#e4e4e7' : '#334155'} !important;\n text-anchor: middle !important;\n dominant-baseline: central !important;\n }\n .cluster rect {\n rx: 10px !important;\n ry: 10px !important;\n fill: ${isDark ? 'rgba(255, 255, 255, 0.02)' : 'rgba(0, 0, 0, 0.015)'} !important;\n stroke: ${isDark ? 'rgba(255, 255, 255, 0.12)' : 'rgba(0, 0, 0, 0.12)'} !important;\n stroke-width: 1.5px !important;\n }\n .cluster text {\n font-family: Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n fill: ${isDark ? '#a1a1aa' : '#64748b'} !important;\n }\n .edgePath path {\n stroke: ${isDark ? '#71717a' : '#94a3b8'} !important;\n stroke-width: 1.5px !important;\n }\n .arrowheadPath {\n fill: ${isDark ? '#71717a' : '#94a3b8'} !important;\n }\n `,\n themeVariables: tokens,\n };\n}\n\n/**\n * Render mermaid diagrams inside a container element.\n * Lazy-loads mermaid module on first call.\n *\n * This function MUST run in a browser environment (needs DOM).\n * Returns early gracefully in SSR/Node.js environments.\n */\nexport async function renderMermaidDiagrams(\n container: HTMLElement,\n theme: 'dark' | 'light' | 'navy' = 'dark',\n): Promise<void> {\n // Guard: SSR/Node.js environments have no DOM\n if (typeof document === 'undefined' || typeof window === 'undefined') {\n console.warn('[presentation-kit] renderMermaidDiagrams skipped: no DOM available (SSR)');\n return;\n }\n\n const mermaid = await getMermaid();\n const isDark = theme === 'dark' || theme === 'navy';\n\n mermaid.initialize(getMermaidConfig(isDark));\n\n // Find mermaid code blocks in container\n const codeNodes = Array.from(\n container.querySelectorAll('pre > code, pre, .marp-mermaid-rendered'),\n );\n\n const mermaidNodes = codeNodes.filter((node) => {\n if ((node as HTMLElement).classList.contains('marp-mermaid-rendered')) return true;\n const text = node.textContent?.trim() || '';\n const className = (node as HTMLElement).className || '';\n\n // Never treat frontmatter or large blocks as mermaid\n if (text.startsWith('---') || text.includes('marp: true') || text.length > 2500) {\n return false;\n }\n\n return (\n className.includes('language-mermaid') ||\n className.includes('language-diagram') ||\n className.includes('language-graph') ||\n isValidMermaidCode(text)\n );\n });\n\n if (mermaidNodes.length === 0) return;\n\n for (let i = 0; i < mermaidNodes.length; i++) {\n const node = mermaidNodes[i] as HTMLElement;\n const isAlreadyWrapper = node.classList.contains('marp-mermaid-rendered');\n const rawChartCode = isAlreadyWrapper\n ? node.getAttribute('data-chart-code') || ''\n : node.textContent?.trim() || '';\n\n if (!rawChartCode) continue;\n\n const preEl = isAlreadyWrapper\n ? node\n : node.tagName.toLowerCase() === 'pre'\n ? node\n : node.parentElement;\n if (!preEl) continue;\n\n const sanitizedCode = sanitizeMermaidCode(rawChartCode, isDark);\n const diagId = `slide_mermaid_${Date.now()}_${i}_${Math.floor(Math.random() * 10000)}`;\n\n try {\n let { svg } = await mermaid.render(diagId, sanitizedCode);\n\n // Strip SVG clip-path attributes to eliminate clipping issues\n svg = svg\n .replace(/clip-path=\"url\\(#[^\"]+\\)\"/gi, '')\n .replace(/clip-path=\"[^\"]*\"/gi, '')\n .replace(/<clipPath[\\s\\S]*?<\\/clipPath>/gi, '');\n\n const wrapper = document.createElement('div');\n wrapper.className =\n 'marp-mermaid-rendered my-3 flex items-center justify-center p-3 rounded-xl bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 [&_svg]:max-w-full [&_svg]:h-auto';\n wrapper.setAttribute('data-chart-code', rawChartCode);\n wrapper.setAttribute('data-mermaid-processed', 'true');\n wrapper.innerHTML = svg;\n preEl.replaceWith(wrapper);\n } catch (renderErr) {\n console.warn('[presentation-kit] Mermaid render error:', renderErr);\n }\n }\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Click Preprocessor — Convert <!-- click --> / <!-- clicks --> to wrapped divs\n// Runs BEFORE Marp renders. Wraps content INSIDE divs for robust HTML structure.\n// ═══════════════════════════════════════════════════════════════════════════════\n\nexport interface ClickPreprocessResult {\n /** Processed markdown with HTML click markers */\n markdown: string;\n /** Total number of click groups assigned */\n totalClicks: number;\n}\n\n/**\n * Preprocess markdown to convert click directives to HTML wrappers.\n *\n * Syntax:\n * - `<!-- click -->` → Block-level: wraps next block in data-click-group=\"N\"\n * - `<!-- clicks -->` → Item-level: marks list for auto-expansion in postprocessor\n *\n * Auto-assigns sequential indices (1, 2, 3, ...) based on order of appearance.\n *\n * IMPORTANT: Skips code fences (``` ... ```) to avoid converting directives\n * inside code blocks.\n *\n * Strategy: Each `<!-- click -->` opens a `<div data-click-group=\"N\">` that wraps\n * all content until the next `<!-- click -->` / `<!-- clicks -->` or end of slide.\n * The postprocessor only needs to handle `<!-- clicks -->` (list expansion).\n */\nexport function preprocessClicks(markdown: string): ClickPreprocessResult {\n if (!markdown || !markdown.trim()) {\n return { markdown, totalClicks: 0 };\n }\n\n // Split markdown into segments: code fences vs normal content\n // Code fences are preserved untouched\n const segments = splitByCodeFences(markdown);\n\n let clickIndex = 0;\n let totalClicks = 0;\n let inClickBlock = false;\n\n const processed = segments\n .map((segment) => {\n // Code fences — pass through untouched\n if (segment.isCodeFence) {\n return segment.content;\n }\n\n // Normal content — process click directives\n let content = segment.content;\n\n // Replace <!-- click --> and <!-- clicks --> with HTML markers\n content = content.replace(\n /^<!--\\s*(click|clicks)\\s*-->$/gm,\n (match, type: string) => {\n clickIndex++;\n\n // Close previous click block if open\n const closePrev = inClickBlock ? '</div>\\n' : '';\n inClickBlock = true;\n\n if (type === 'clicks') {\n totalClicks++;\n // clicks marker — will be expanded in postprocessor\n return `${closePrev}<div data-clicks=\"${clickIndex}\">`;\n } else {\n totalClicks++;\n // click marker — wraps everything until next marker\n return `${closePrev}<div data-click-group=\"${clickIndex}\">`;\n }\n },\n );\n\n return content;\n })\n .join('');\n\n // Close the last click block if open\n const result = inClickBlock ? processed + '</div>' : processed;\n\n return { markdown: result, totalClicks };\n}\n\n/** Represents a segment of markdown (either code fence or normal content) */\ninterface Segment {\n content: string;\n isCodeFence: boolean;\n}\n\n/**\n * Split markdown into code fence and non-code-fence segments.\n * Code fences (``` ... ```) are preserved untouched.\n */\nfunction splitByCodeFences(markdown: string): Segment[] {\n const segments: Segment[] = [];\n const regex = /^(```[\\s\\S]*?^```)/gm;\n\n let lastIndex = 0;\n let match;\n\n while ((match = regex.exec(markdown)) !== null) {\n // Add non-code content before this fence\n if (match.index > lastIndex) {\n segments.push({\n content: markdown.slice(lastIndex, match.index),\n isCodeFence: false,\n });\n }\n // Add the code fence itself\n segments.push({\n content: match[0],\n isCodeFence: true,\n });\n lastIndex = match.index + match[0].length;\n }\n\n // Add remaining content\n if (lastIndex < markdown.length) {\n segments.push({\n content: markdown.slice(lastIndex),\n isCodeFence: false,\n });\n }\n\n return segments;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Click Postprocessor — Expand <!-- clicks --> list items after Marp render\n//\n// The preprocessor already handles <!-- click --> wrapping (block-level).\n// This postprocessor only handles <!-- clicks --> (item-level list expansion).\n// ═══════════════════════════════════════════════════════════════════════════════\n\nexport interface ClickPostprocessResult {\n /** HTML with click groups applied */\n html: string;\n /** Total number of individual click groups (after expanding clicks) */\n totalClicks: number;\n}\n\n/**\n * Post-process rendered Marp HTML to expand clicks (item-level) list items.\n *\n * The preprocessor wraps <!-- click --> blocks in <div data-click-group=\"N\">.\n * This postprocessor handles <!-- clicks --> by splitting list items into\n * individual click groups.\n *\n * Pattern: <div data-clicks=\"N\">...<ul><li>...</li></ul>...</div>\n * Becomes: multiple <div data-click-group=\"N\">...<ul><li>...</li></ul>...</div>\n *\n * @param html - Raw Marp-rendered HTML (with click-group and clicks markers)\n * @returns HTML with all click groups expanded\n */\nexport function postprocessClicks(html: string): ClickPostprocessResult {\n if (!html || !html.includes('data-clicks')) {\n // No clicks markers — count existing click-groups\n const totalClicks = extractMaxClicks(html);\n return { html, totalClicks };\n }\n\n let result = html;\n let totalClicks = 0;\n\n // Handle <!-- clicks --> markers: expand list items into individual click groups\n // Pattern: <div data-clicks=\"N\">...(content with <ul>/<ol>)...</div>\n result = result.replace(\n /<div data-clicks=\"(\\d+)\">([\\s\\S]*?)<\\/div>/g,\n (_, startIdx: string, innerContent: string) => {\n const start = parseInt(startIdx, 10);\n\n // Check if inner content contains a list\n const listMatch = innerContent.match(/((?:<[^>]+>)*?<(?:ul|ol)[^>]*>[\\s\\S]*?<\\/(?:ul|ol)>)/);\n\n if (!listMatch) {\n // No list found — treat as single click group\n totalClicks++;\n return `<div data-click-group=\"${start}\">${innerContent}</div>`;\n }\n\n // Extract list items\n const listBlock = listMatch[0];\n const liRegex = /<li[^>]*>[\\s\\S]*?<\\/li>/g;\n const items: string[] = [];\n let liMatch;\n while ((liMatch = liRegex.exec(listBlock)) !== null) {\n items.push(liMatch[0]);\n }\n\n if (items.length === 0) {\n totalClicks++;\n return `<div data-click-group=\"${start}\">${innerContent}</div>`;\n }\n\n // Get list wrapper tags\n const listOpenTag = listBlock.match(/<(ul|ol)[^>]*>/)?.[0] ?? '<ul>';\n const listCloseTag = listBlock.match(/<\\/(ul|ol)>$/)?.[0] ?? '</ul>';\n\n // Wrap each item in its own click group\n let clickIdx = start;\n const wrappedItems = items.map((item) => {\n const idx = clickIdx++;\n totalClicks++;\n return `<div data-click-group=\"${idx}\">${listOpenTag}${item}${listCloseTag}</div>`;\n });\n\n return wrappedItems.join('\\n');\n },\n );\n\n // Also count any click-groups that were already in the HTML (from <!-- click -->)\n const existingGroups = extractMaxClicks(result);\n if (existingGroups > totalClicks) {\n totalClicks = existingGroups;\n }\n\n return { html: result, totalClicks };\n}\n\n/**\n * Extract max click index from rendered HTML.\n * Scans for all data-click-group=\"N\" attributes and returns the max N.\n */\nexport function extractMaxClicks(html: string): number {\n const matches = html.match(/data-click-group=\"(\\d+)\"/g);\n if (!matches) return 0;\n\n let max = 0;\n for (const match of matches) {\n const num = parseInt(match.match(/data-click-group=\"(\\d+)\"/)?.[1] ?? '0', 10);\n if (num > max) max = num;\n }\n return max;\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Click CSS — Scoped CSS for click-to-reveal animations\n// ═══════════════════════════════════════════════════════════════════════════════\n\nexport interface ClickCssOptions {\n /** Container ID to scope CSS (default: no scope, global) */\n containerId?: string;\n /** Animation duration in ms (default: 300) */\n duration?: number;\n /** Animation easing (default: 'ease') */\n easing?: string;\n /** Y offset for slide-up animation in px (default: 8) */\n offsetY?: number;\n /** Use slide-up animation (default: true) */\n slideUp?: boolean;\n /** Use fade animation (default: true) */\n fade?: boolean;\n}\n\n/**\n * Generate CSS for click-to-reveal system.\n *\n * Elements with `data-click-group=\"N\"` are hidden by default.\n * Adding class `visible` reveals them with animation.\n *\n * @param options - Animation options\n * @returns CSS string to inject via <style>\n */\nexport function generateClickCss(options?: ClickCssOptions): string {\n const {\n containerId,\n duration = 300,\n easing = 'ease',\n offsetY = 8,\n slideUp = true,\n fade = true,\n } = options ?? {};\n\n const prefix = containerId ? `#${containerId} ` : '';\n\n const opacityFrom = fade ? '0' : '1';\n const transformFrom = slideUp ? `translateY(${offsetY}px)` : 'none';\n const opacityTo = '1';\n const transformTo = 'translateY(0)';\n\n return `\n/* ── Click-to-Reveal System ── */\n${prefix}[data-click-group] {\n opacity: ${opacityFrom};\n ${slideUp ? `transform: ${transformFrom};` : ''}\n transition: opacity ${duration}ms ${easing}, transform ${duration}ms ${easing};\n pointer-events: none;\n}\n\n${prefix}[data-click-group].visible {\n opacity: ${opacityTo};\n ${slideUp ? `transform: ${transformTo};` : ''}\n pointer-events: auto;\n}\n\n`;\n}\n","import yaml from 'js-yaml';\nimport type { LayoutBoxConfig, SlideLayoutData } from '../../types.js';\n\n/**\n * Check if a comment string represents a layout definition\n */\nexport function isLayoutComment(comment: string): boolean {\n const trimmed = comment.trim();\n return trimmed.startsWith('layout:') || trimmed.startsWith('layout :');\n}\n\n/**\n * Parse YAML layout data from a comment string\n */\nexport function parseLayoutFromComment(comment: string): SlideLayoutData | null {\n try {\n const trimmed = comment.trim();\n if (!isLayoutComment(trimmed)) return null;\n\n const parsed = yaml.load(trimmed) as { layout?: { boxes?: LayoutBoxConfig[] }; boxes?: LayoutBoxConfig[] } | null;\n if (!parsed || typeof parsed !== 'object') return null;\n\n const boxes = parsed.boxes ?? parsed.layout?.boxes;\n if (Array.isArray(boxes)) {\n return { boxes };\n }\n return null;\n } catch (err) {\n console.warn('[presentation-kit] Failed to parse layout comment YAML:', err);\n return null;\n }\n}\n\n/**\n * Filter presenter notes from a slide's comment list,\n * excluding layout blocks and Marp system directives.\n */\nexport function filterPresenterNotes(comments: string[]): string[] {\n return comments\n .map(c => c.trim())\n .filter(c => {\n if (!c) return false;\n // Skip layout definitions\n if (isLayoutComment(c)) return false;\n // Skip Marp directives like <!-- _backgroundColor: ... --> or <!-- paginate: true -->\n if (/^_?[a-zA-Z0-9_-]+\\s*:/i.test(c) && !c.toLowerCase().startsWith('note:')) {\n return false;\n }\n return true;\n })\n .map(c => {\n // If starts with \"note:\" or \"_note:\", strip the prefix\n return c.replace(/^_?note:\\s*/i, '').trim();\n });\n}\n\n/**\n * Extract per-slide layout data and presenter notes from Marp's comments array.\n */\nexport function extractLayoutsAndNotes(rawComments: (string[] | undefined)[]): {\n layouts: (SlideLayoutData | null)[];\n notes: string[][];\n} {\n const layouts: (SlideLayoutData | null)[] = [];\n const notes: string[][] = [];\n\n for (const slideComments of rawComments) {\n if (!slideComments || slideComments.length === 0) {\n layouts.push(null);\n notes.push([]);\n continue;\n }\n\n let slideLayout: SlideLayoutData | null = null;\n\n for (const comment of slideComments) {\n if (isLayoutComment(comment)) {\n const parsed = parseLayoutFromComment(comment);\n if (parsed) {\n slideLayout = parsed;\n }\n }\n }\n\n layouts.push(slideLayout);\n notes.push(filterPresenterNotes(slideComments));\n }\n\n return { layouts, notes };\n}\n","import type { SlideLayoutData } from '../../types.js';\n\n/**\n * Generate scoped CSS for per-slide layout overrides.\n *\n * Targets each slide's section within Marp's 1280x720 SVG coordinate space.\n */\nexport function generateLayoutCss(\n layouts: (SlideLayoutData | null)[],\n containerId: string = 'marp-container'\n): string {\n const cssRules: string[] = [];\n\n layouts.forEach((layout, index) => {\n if (!layout || !layout.boxes || layout.boxes.length === 0) return;\n\n const slideNum = index + 1;\n const sectionSelectors = [\n `#${containerId} svg[data-marpit-svg]:nth-of-type(${slideNum}) section`,\n `#${containerId} .marpit > svg:nth-of-type(${slideNum}) section`,\n `#${containerId} > svg:nth-of-type(${slideNum}) section`,\n ];\n\n // Make section position: relative so absolute boxes position correctly within 1280x720 canvas\n cssRules.push(`\n/* Slide ${slideNum} Layout Container */\n${sectionSelectors.join(',\\n')} {\n position: relative !important;\n display: block !important;\n}`);\n\n for (const box of layout.boxes) {\n if (!box || !Array.isArray(box.pos) || box.pos.length < 4) continue;\n\n const [x, y, w, h] = box.pos;\n // Target selector inside the slide\n const targetSelector = box.target || `[data-box-id=\"${box.id}\"]`;\n const ruleSelector = sectionSelectors.map(s => `${s} ${targetSelector}`).join(',\\n');\n\n const styles: string[] = [\n `position: absolute !important`,\n `left: ${Math.round(x)}px !important`,\n `top: ${Math.round(y)}px !important`,\n `width: ${Math.round(w)}px !important`,\n `min-height: ${Math.round(h)}px !important`,\n `box-sizing: border-box !important`,\n `margin: 0 !important`,\n `word-break: break-word !important`,\n `overflow-wrap: break-word !important`,\n `white-space: normal !important`,\n ];\n\n if (targetSelector.includes('li')) {\n styles.push(`list-style-position: inside !important`);\n }\n\n if (box.fontSize) {\n styles.push(`font-size: ${box.fontSize} !important`);\n }\n if (box.color) {\n styles.push(`color: ${box.color} !important`);\n }\n if (box.textAlign) {\n styles.push(`text-align: ${box.textAlign} !important`);\n }\n if (box.style) {\n styles.push(box.style);\n }\n\n cssRules.push(`\n${ruleSelector} {\n ${styles.join(';\\n ')};\n}`);\n }\n });\n\n return cssRules.join('\\n');\n}\n","// ═══════════════════════════════════════════════════════════════════════════════\n// Core Render — Client-side Marp rendering\n// Replaces: apps/web/app/api/render-marp (server-side HTTP roundtrip)\n// ═══════════════════════════════════════════════════════════════════════════════\n\nimport { Marp } from '@marp-team/marp-core';\nimport type { SlideRenderResult, SlideRenderAsyncResult, SlideRenderOptions, MermaidBlock } from '../types.js';\nimport { convertTextArrows } from './arrow-converter.js';\nimport { extractMarpSource } from './source-extractor.js';\nimport { resolveTheme, generateScopedCss } from '../themes/index.js';\nimport { detectMermaidBlocks } from '../plugins/mermaid.js';\nimport { highlightCodeBlocks } from '../plugins/shiki.js';\nimport { preprocessClicks } from '../vclick/preprocessor.js';\nimport { postprocessClicks } from '../vclick/postprocessor.js';\nimport { generateClickCss } from '../vclick/click-css.js';\nimport { extractLayoutsAndNotes, generateLayoutCss } from './layout/index.js';\n\ninterface RenderMarpResult {\n html: string;\n css: string;\n comments: (string[] | undefined)[];\n maxClicks: number;\n}\n\n/**\n * Low-level synchronous Marp render.\n * Preprocesses clicks, converts arrows, renders Marp, postprocesses clicks.\n */\nexport function renderMarp(\n markdown: string,\n containerId: string = 'marp-container',\n enableClicks: boolean = false,\n): RenderMarpResult {\n const cleanSource = extractMarpSource(markdown);\n \n const { markdown: clickProcessed, totalClicks } = enableClicks\n ? preprocessClicks(cleanSource)\n : { markdown: cleanSource, totalClicks: 0 };\n \n const arrowsConverted = convertTextArrows(clickProcessed);\n\n const marp = new Marp({\n container: { tag: 'div', id: containerId },\n html: true,\n emoji: { unicode: true },\n });\n\n const { html, css, comments } = marp.render(arrowsConverted);\n\n // Postprocess click groups if clicks were preprocessed\n if (enableClicks && totalClicks > 0) {\n const { html: processedHtml, totalClicks: finalClicks } = postprocessClicks(html);\n return { html: processedHtml, css, comments: (comments ?? []) as (string[] | undefined)[], maxClicks: finalClicks };\n }\n\n return { html, css, comments: (comments ?? []) as (string[] | undefined)[], maxClicks: 0 };\n}\n\n/**\n * Count slides in rendered Marp HTML by detecting <svg data-marpit-svg> elements.\n */\nexport function countSlides(html: string): number {\n const matches = html.match(/<svg[^>]*data-marpit-svg/g);\n return matches ? matches.length : 1;\n}\n\n/**\n * High-level synchronous render — resolves theme, generates scoped CSS,\n * detects mermaid blocks. Does NOT apply Shiki or Mermaid rendering.\n */\nexport function renderSlide(\n markdown: string,\n options?: SlideRenderOptions,\n): SlideRenderResult {\n const containerId = options?.containerId ?? 'marp-container';\n const theme = resolveTheme(options?.theme ?? 'dark');\n const enableClicks = options?.enableClicks ?? false;\n\n const { html, css, comments, maxClicks } = renderMarp(markdown, containerId, enableClicks);\n const themeCss = generateScopedCss(theme, containerId);\n const slideCount = countSlides(html);\n const mermaidBlocks = options?.enableMermaid !== false\n ? detectMermaidBlocks(html)\n : [];\n const clickCss = enableClicks\n ? generateClickCss({ containerId })\n : '';\n\n const { layouts, notes } = extractLayoutsAndNotes(comments);\n const layoutCss = generateLayoutCss(layouts, containerId);\n\n return {\n html,\n css,\n themeCss,\n layoutCss,\n slideCount,\n mermaidBlocks,\n clickCss,\n maxClicks,\n notes,\n layouts,\n };\n}\n\n/**\n * High-level async render — applies Shiki syntax highlighting.\n * Mermaid blocks are returned separately (DOM-based, consumer renders them).\n */\nexport async function renderSlideAsync(\n markdown: string,\n options?: SlideRenderOptions,\n): Promise<SlideRenderAsyncResult> {\n const containerId = options?.containerId ?? 'marp-container';\n const theme = resolveTheme(options?.theme ?? 'dark');\n const enableClicks = options?.enableClicks ?? false;\n\n const { html, css, comments, maxClicks } = renderMarp(markdown, containerId, enableClicks);\n const themeCss = generateScopedCss(theme, containerId);\n const slideCount = countSlides(html);\n const mermaidBlocks = options?.enableMermaid !== false\n ? detectMermaidBlocks(html)\n : [];\n const clickCss = enableClicks\n ? generateClickCss({ containerId })\n : '';\n\n const { layouts, notes } = extractLayoutsAndNotes(comments);\n const layoutCss = generateLayoutCss(layouts, containerId);\n\n // Apply Shiki syntax highlighting\n const enableShiki = options?.enableShiki ?? true;\n const processedHtml = enableShiki\n ? await highlightCodeBlocks(html, theme.name)\n : html;\n\n return {\n html,\n css,\n themeCss,\n layoutCss,\n processedHtml,\n slideCount,\n mermaidBlocks,\n clickCss,\n maxClicks,\n notes,\n layouts,\n };\n}\n"]}
|