├── icon.png
├── assets
├── 3014ef6c26c03498fc46c5439b97309d.png
└── a8cbe5b0b51b65710f69a937a4154041.png
├── README.md
├── manifest.json
├── popup.html
├── background.js
├── markmap.js
├── markmap.html
├── content.js
├── js
├── markmap-toolbar.js
├── markmap-autoloader.js
├── markmap-view.js
└── hightlight.js
└── LICENSE
/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyBoyM/doc2mindmap/main/icon.png
--------------------------------------------------------------------------------
/assets/3014ef6c26c03498fc46c5439b97309d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyBoyM/doc2mindmap/main/assets/3014ef6c26c03498fc46c5439b97309d.png
--------------------------------------------------------------------------------
/assets/a8cbe5b0b51b65710f69a937a4154041.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CrazyBoyM/doc2mindmap/main/assets/a8cbe5b0b51b65710f69a937a4154041.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # doc2mindmap
2 | 一款把网页文章内容生成为思维导图的浏览器AI插件,很方便。
3 | 这是我大三的期末小作业的一部分,非常简单,开源出来供学习浏览器插件开发如何与AI模型结合,做成工具。
4 |
5 | ## 安装
6 | 下载代码,在chrome、edge浏览器中打开设置-扩展程序,加载已解压的文件夹。
7 |
8 | ## 使用方法
9 | 这是一个浏览器插件用于生成思维导图,请打开content.js代码将其中的apiurl和apikey换成你通过vllm部署自己模型的后端url或者任意openai格式的模型后端。默认使用的是作者自己的deepseek云端apikey,仅供演示不稳定,请替换成自己的apikey。
10 | tip:deepseek是一个大模型超便宜但是很智能的API平台,作为云端模型充值几块钱够用很久了,接口注册地址:https://platform.deepseek.com
11 |
12 | ## 效果展示
13 | 
14 | 
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "manifest_version": 3,
3 | "name": "思维导图生成器",
4 | "version": "1.0",
5 | "description": "Generate a mindmap of the current page's article content using AI",
6 | "permissions": ["contextMenus", "activeTab", "scripting", "storage", "tabs"],
7 | "background": {
8 | "service_worker": "background.js"
9 | },
10 | "action": {
11 | "default_popup": "popup.html",
12 | "default_icon": {
13 | "16": "icon.png",
14 | "48": "icon.png",
15 | "128": "icon.png"
16 | }
17 | },
18 | "icons": {
19 | "16": "icon.png",
20 | "48": "icon.png",
21 | "128": "icon.png"
22 | },
23 | "content_security_policy": {
24 | "extension_pages": "script-src 'self'; object-src 'self'"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/popup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Mindmap Generator
5 |
15 |
16 |
17 | Mindmap Generator
18 | Right-click on a page and select "Generate Mindmap" to create a mindmap of the page's content.
19 |
20 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/background.js:
--------------------------------------------------------------------------------
1 | chrome.runtime.onInstalled.addListener(() => {
2 | chrome.contextMenus.create({
3 | id: "generateMindmap",
4 | title: "🥬 生成当页思维导图",
5 | contexts: ["page"]
6 | });
7 | });
8 |
9 | chrome.contextMenus.onClicked.addListener((info, tab) => {
10 | if (info.menuItemId === "generateMindmap") {
11 | chrome.scripting.executeScript({
12 | target: { tabId: tab.id },
13 | files: ["content.js"]
14 | });
15 | }
16 | });
17 |
18 | chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
19 | if (message.action === "openMindmap") {
20 | chrome.tabs.create({ url: chrome.runtime.getURL('markmap.html') }, (newTab) => {
21 | chrome.storage.local.set({ mindmapTabId: newTab.id });
22 | });
23 | } else if (message.action === "updateMindmap") {
24 | chrome.storage.local.get('mindmapTabId', (data) => {
25 | if (data.mindmapTabId) {
26 | chrome.tabs.sendMessage(data.mindmapTabId, { action: "updateContent", content: message.content });
27 | }
28 | });
29 | }
30 | });
--------------------------------------------------------------------------------
/markmap.js:
--------------------------------------------------------------------------------
1 | document.addEventListener('DOMContentLoaded', () => {
2 | const { markmap } = window;
3 | const options = {};
4 | const transformer = new markmap.Transformer();
5 | const svg = document.querySelector(".markmap > svg");
6 | const mm = markmap.Markmap.create(svg, options);
7 | const updateThreshold = 25; // 默认字长变化阈值
8 | const codeUpdateThreshold = 100; // 处于代码块中时更新字符数量触发渲染的阈值
9 | let lastContent = '';
10 | let contentLength = 0;
11 | let inCodeBlock = false; // 标记是否处于代码块内
12 | let lastUpdateTime = 0; // 上次更新时间
13 | const updateInterval = 3000; // 更新间隔(毫秒)
14 |
15 | function removeBackticks(markdown_content) {
16 | if (markdown_content.startsWith('```')) {
17 | markdown_content = markdown_content.split('\n').slice(1).join('\n');
18 | }
19 | if (markdown_content.startsWith('```') && markdown_content.endsWith('```')) {
20 | markdown_content = markdown_content.split('\n').slice(1, -1).join('\n');
21 | }
22 | return markdown_content;
23 | }
24 |
25 | function updateCodeBlockStatus(markdown_content) {
26 | markdown_content = removeBackticks(markdown_content);
27 | const lines = markdown_content.split('\n');
28 | let localInCodeBlock = false;
29 | for (let line of lines) {
30 | if (line.startsWith('```')) {
31 | if (inCodeBlock) {
32 | inCodeBlock = false;
33 | } else {
34 | inCodeBlock = true;
35 | }
36 | }
37 | if (inCodeBlock) {
38 | localInCodeBlock = true;
39 | }
40 | }
41 | inCodeBlock = localInCodeBlock;
42 | }
43 |
44 | function render(markdown_content) {
45 | markdown_content = removeBackticks(markdown_content);
46 | const { root } = transformer.transform(markdown_content);
47 | mm.setData(root);
48 | mm.fit();
49 | }
50 |
51 | chrome.storage.local.get('mindmapContent', (data) => {
52 | const content = data.mindmapContent || '';
53 | document.getElementById('mindmap-content').textContent = content;
54 | lastContent = content;
55 | contentLength = content.length;
56 | updateCodeBlockStatus(content); // 初始化代码块状态
57 | render(content);
58 | document.querySelector('.loading').style.display = 'none';
59 | lastUpdateTime = Date.now(); // 初始化最后更新时间
60 | });
61 |
62 | chrome.runtime.onMessage.addListener((message) => {
63 | if (message.action === "updateContent") {
64 | const newContent = message.content;
65 | document.getElementById('mindmap-content').textContent = newContent;
66 |
67 | updateCodeBlockStatus(newContent); // 更新代码块状态
68 |
69 | let charUpdateThreshold = inCodeBlock ? codeUpdateThreshold : updateThreshold;
70 |
71 | const currentTime = Date.now();
72 | if (Math.abs(newContent.length - contentLength) >= charUpdateThreshold || (currentTime - lastUpdateTime) > updateInterval) {
73 | render(newContent);
74 | lastContent = newContent;
75 | contentLength = newContent.length;
76 | lastUpdateTime = currentTime; // 更新最后更新时间
77 | }
78 | document.querySelector('.loading').style.display = 'none';
79 | }
80 | });
81 | });
82 |
--------------------------------------------------------------------------------
/markmap.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Mindmap
7 |
66 |
67 |
68 | Generating mindmap...
69 |
70 |
71 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/content.js:
--------------------------------------------------------------------------------
1 | function extractArticleContent() {
2 | let article = document.querySelector('article');
3 | if (!article) {
4 | article = document.body;
5 | }
6 | return article.innerText;
7 | }
8 |
9 | function callLLM(content) {
10 | const apiKey = 'sk-be352978f74743df9ee7ddd441b57633'; // 临时key,请去deepseek网站注册后换成自己的
11 | const apiUrl = 'https://api.deepseek.com/chat/completions';
12 |
13 | fetch(apiUrl, {
14 | method: 'POST',
15 | headers: {
16 | 'Content-Type': 'application/json',
17 | 'Authorization': `Bearer ${apiKey}`
18 | },
19 | body: JSON.stringify({
20 | model: 'deepseek-coder',
21 | messages: [
22 | { role: 'system', content: 'You are a helpful assistant.' },
23 | { role: 'user', content: `作为一名专业的文档编辑专家,您需要具备以下技能和完成以下任务:
24 | 1、熟悉Markdown语法: 您应熟练掌握Markdown语言,能够高效地编写和格式化文档。
25 | 2、深入理解参考文章: 在开始撰写之前,请仔细阅读并全面理解用户提供的参考版本文章。确保您对文章的主题、结构和关键信息有清晰的理解。
26 | 3、撰写Markdown格式报告: 根据您的专业视角,撰写一份结构清晰、层次分明的Markdown格式文章报告。
27 | 你写的报告应该满足以下要求:
28 | 1、使用多级结构: 灵活使用markdown的多级标题和多级子节点来组织内容,确保文档结构美观且易于导航。
29 | 2、学会取舍内容: 剔除与文章主题无关的多余文字、无效内容,忽略你认为对读者不太重要的信息内容,但要保留关键部分的细节,确保内容的清晰性、重要性。
30 | 3、代码和示例的适当保留: 根据写作的需要,适当保留具体的代码片段或示例,以增强文章的实用性和可读性,如果其内容过长,也可以按需取舍细节。
31 | 4、关键信息的突出: 确保报告中的关键信息和知识点被清晰地呈现,使读者能够快速抓住文章的核心内容。
32 | 5、灵活处理节点格式:如果节点内容包含代码或数学公式、图片、链接等,你需要使用正确的语法格式将该节点范围包裹。
33 | 6、思维大纲结构:你需要根据自己对参考文章所述内容的独特理解和思考,使用合适的节点标题名称,以生成清晰正确的思维树。
34 | 7、正确理解参考文章:在你的输出报告中,避免错误混淆原文中的概念、关系和逻辑,确保严格正确表述原文观点。
35 | 8、思维树形式:只使用节点形式表达内容,不要使用任何正文形态。
36 | 9、忽略不必要的内容: 不要在报告中包含任何无关的、多余的、不重要的内容,确保报告内容清晰易读,特别是一些网页头部和尾部的文字。
37 | 注意,直接给出输出的报告内容,不要在输出内容前后追加多余的话语。
38 |
39 | 参考格式:
40 | # 一级标题
41 |
42 | ## 二级标题
43 | - 节点内容1
44 |
45 | - 节点内容2
46 |
47 | - 节点内容3
48 |
49 | ## 二级标题
50 | - 节点内容1
51 |
52 | - 节点内容2
53 | - 子节点内容1
54 |
55 | - 子节点内容2
56 | ...
57 |
58 | 以下是用户给定的参考文章:
59 | :\n\n${content}\n\n以上是用户给定的参考文章。
60 | 作为一名专业的文档编辑专家,您需要具备以下技能和完成以下任务:
61 | 1、熟悉Markdown语法: 您应熟练掌握Markdown语言,能够高效地编写和格式化文档。
62 | 2、深入理解参考文章: 在开始撰写之前,请仔细阅读并全面理解用户提供的参考版本文章。确保您对文章的主题、结构和关键信息有清晰的理解。
63 | 3、撰写Markdown格式报告: 根据您的专业视角,撰写一份结构清晰、层次分明的Markdown格式文章报告。
64 | 你写的报告应该满足以下要求:
65 | 1、使用多级结构: 灵活使用markdown的多级标题和多级子节点来组织内容,确保文档结构美观且易于导航。
66 | 2、学会取舍内容: 剔除与文章主题无关的多余文字、无效内容,忽略你认为对读者不太重要的信息内容,但要保留关键部分的细节,确保内容的清晰性、重要性。
67 | 3、代码和示例的适当保留: 根据写作的需要,适当保留具体的代码片段或示例,以增强文章的实用性和可读性,如果其内容过长,也可以按需取舍细节。
68 | 4、关键信息的突出: 确保报告中的关键信息和知识点被清晰地呈现,使读者能够快速抓住文章的核心内容。
69 | 5、灵活处理节点格式:如果节点内容包含代码或数学公式、图片、链接等,你需要使用正确的语法格式将该节点范围包裹。
70 | 6、思维大纲结构:你需要根据自己对参考文章所述内容的独特理解和思考,使用合适的节点标题名称,以生成清晰正确的思维树。
71 | 7、正确理解参考文章:在你的输出报告中,避免错误混淆原文中的概念、关系和逻辑,确保严格正确表述原文观点。
72 | 8、思维树形式:只使用节点形式表达内容,不要使用任何正文形态。
73 | 注意,直接给出输出的报告内容,不要在输出内容前后追加多余的话语。
74 | ` }
75 | ],
76 | stream: true
77 | })
78 | }).then(response => {
79 | const reader = response.body.getReader();
80 | const decoder = new TextDecoder('utf-8');
81 | let text = '';
82 |
83 | function readStream() {
84 | reader.read().then(({ done, value }) => {
85 | if (done) {
86 | chrome.runtime.sendMessage({ action: "updateMindmap", content: text });
87 | return;
88 | }
89 |
90 | const chunk = decoder.decode(value, { stream: true });
91 | const lines = chunk.split('\n').filter(line => line.trim() !== '');
92 |
93 | for (const line of lines) {
94 | if (line.startsWith('data: ')) {
95 | const jsonString = line.slice(6); // Remove 'data: ' prefix
96 | if (jsonString !== '[DONE]') {
97 | try {
98 | const json = JSON.parse(jsonString);
99 | const deltaContent = json.choices[0].delta.content;
100 | text += deltaContent;
101 | chrome.runtime.sendMessage({ action: "updateMindmap", content: text });
102 | } catch (e) {
103 | console.error('Error parsing JSON:', e);
104 | }
105 | }
106 | }
107 | }
108 |
109 | readStream();
110 | });
111 | }
112 |
113 | readStream();
114 | }).catch(err => {
115 | console.error('Error calling DeepSeek API:', err);
116 | });
117 | }
118 |
119 | const content = extractArticleContent();
120 | chrome.runtime.sendMessage({ action: "openMindmap" });
121 | callLLM(content);
122 |
--------------------------------------------------------------------------------
/js/markmap-toolbar.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Minified by jsDelivr using Terser v5.19.2.
3 | * Original file: /npm/markmap-toolbar@0.17.0/dist/index.js
4 | *
5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
6 | */
7 | !function(t){"use strict";
8 | /*! @gera2ld/jsx-dom v2.2.2 | ISC License */const A=1,e=2,r="http://www.w3.org/2000/svg",i="http://www.w3.org/1999/xlink",n={show:i,actuate:i,href:i},o=t=>"string"==typeof t||"number"==typeof t,s=t=>(null==t?void 0:t.vtype)===A,l=t=>(null==t?void 0:t.vtype)===e;function h(t,r){let i;if("string"==typeof t)i=A;else{if("function"!=typeof t)throw new Error("Invalid VNode type");i=e}return{vtype:i,type:t,props:r}}const c=h;function a(t){return t.children}const g={isSvg:!1};function v(t,A){Array.isArray(A)||(A=[A]),(A=A.filter(Boolean)).length&&t.append(...A)}const u={className:"class",labelFor:"for"};function d(t,A,e,r){if(A=u[A]||A,!0===e)t.setAttribute(A,"");else if(!1===e)t.removeAttribute(A);else{const i=r?n[A]:void 0;void 0!==i?t.setAttributeNS(i,A,e):t.setAttribute(A,e)}}function m(t,A){return Array.isArray(t)?t.map((t=>m(t,A))).reduce(((t,A)=>t.concat(A)),[]):f(t,A)}function f(t,A=g){if(null==t||"boolean"==typeof t)return null;if(t instanceof Node)return t;if(l(t)){const{type:e,props:r}=t;if(e===a){const t=document.createDocumentFragment();if(r.children){v(t,m(r.children,A))}return t}return f(e(r),A)}if(o(t))return document.createTextNode(`${t}`);if(s(t)){let e;const{type:i,props:n}=t;if(A.isSvg||"svg"!==i||(A=Object.assign({},A,{isSvg:!0})),e=A.isSvg?document.createElementNS(r,i):document.createElement(i),function(t,A,e){for(const r in A)if("key"!==r&&"children"!==r&&"ref"!==r)if("dangerouslySetInnerHTML"===r)t.innerHTML=A[r].__html;else if("innerHTML"===r||"textContent"===r||"innerText"===r||"value"===r&&["textarea","select"].includes(t.tagName)){const e=A[r];null!=e&&(t[r]=e)}else r.startsWith("on")?t[r.toLowerCase()]=A[r]:d(t,r,A[r],e.isSvg)}(e,n,A),n.children){let t=A;A.isSvg&&"foreignObject"===i&&(t=Object.assign({},t,{isSvg:!1}));const r=m(n.children,t);null!=r&&v(e,r)}const{ref:o}=n;return"function"==typeof o&&o(e),e}throw new Error("mount: Invalid Vnode!")}function R(t){return f(t)}const p="mm-toolbar-item";function w({title:t,content:A,onClick:e}){return h("div",{className:p,title:t,onClick:e,children:A})}let B;const y=class t{constructor(){this.showBrand=!0,this.registry={},this.el=R(h("div",{className:"mm-toolbar"})),this.items=[...t.defaultItems],this.register({id:"zoomIn",title:"Zoom in",content:t.icon("M9 5v4h-4v2h4v4h2v-4h4v-2h-4v-4z"),onClick:this.getHandler((t=>t.rescale(1.25)))}),this.register({id:"zoomOut",title:"Zoom out",content:t.icon("M5 9h10v2h-10z"),onClick:this.getHandler((t=>t.rescale(.8)))}),this.register({id:"fit",title:"Fit window size",content:t.icon("M4 7h2v-2h2v4h-4zM4 13h2v2h2v-4h-4zM16 7h-2v-2h-2v4h4zM16 13h-2v2h-2v-4h4z"),onClick:this.getHandler((t=>t.fit()))}),this.register({id:"recurse",title:"Toggle recursively",content:t.icon("M16 4h-12v12h12v-8h-8v4h2v-2h4v4h-8v-8h10z"),onClick:t=>{var A;const e=t.target.closest(`.${p}`),r=null==e?void 0:e.classList.toggle("active");null==(A=this.markmap)||A.setOptions({toggleRecursively:r})}}),this.render()}static create(A){const e=new t;return e.attach(A),e}static icon(t,A={}){return A={stroke:"none",fill:"currentColor","fill-rule":"evenodd",...A},h("svg",{width:"20",height:"20",viewBox:"0 0 20 20",children:h("path",{...A,d:t})})}setBrand(t){return this.showBrand=t,this.render()}register(t){this.registry[t.id]=t}getHandler(t){var A;return A=t,t=async(...t)=>{if(!B){B=A(...t);try{await B}finally{B=void 0}}},()=>{this.markmap&&t(this.markmap)}}setItems(t){return this.items=[...t],this.render()}attach(t){this.markmap=t}render(){const t=this.items.map((t=>{if("string"==typeof t){const A=this.registry[t];return A||console.warn(`[markmap-toolbar] ${t} not found`),A}return t})).filter(Boolean);for(;this.el.firstChild;)this.el.firstChild.remove();return this.el.append(R(c(a,{children:[this.showBrand&&c("a",{className:"mm-toolbar-brand",href:"https://markmap.js.org/",children:[h("img",{alt:"markmap",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAACoFBMVEUAAAAAAAD//wAAAACAgAD//wAAAABVVQCqqgBAQACAQACAgABmZgBtbQAAAABgQABgYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaFQAAAAAAAAAAAAAAAAAHAAARBQIdGAIYEwI/OgJYUQUfHQI+OgJDPgJJRARBPQRJQgRRSwRRTQRIQQRUTgRUUARZUgRSTQRPSQRjWgZORQRfWQZsZAhTTQRNRwRWUAZkXAZOSARUTgZPRwRRSQRoYwZWUQZWTgRbUwZmXQZoXghmXwdqYwdsYwdfVwVmXQdqYgdiWgVpYAl3bgl6cgl4cAqLggw8OAOWjA2Uig1OSAR2bQihlg55cAh5cAh6cQmMgwyOhAyUjA2QhQ2Uiw2Viw2soBCflA+voxGwpRGhlg+hlg+snxGroBGjmBCpnBC0pxKyphKxpRG2qhK0qBK5rBK5rBP/7h3/8B7/8R3/8h3/8R7/8h786x397B3+7R3EtxT66Rz66hz76hz86xz96xz97Bz+7Rz45xz56Bz76hz97Bz97B3MvRX15Rv25Rv45xz66Rz76hz97B3+7R3IuxX05Bv15Bv25Rz56Bz66Ry/sxPAsxPCtRTCthTNvxbZyxfczxfi0xjl1Rnn2Bnr2xrr3Brs3Rru3Rru3xrv3hrw3xrx4Bvx4Rvy4hvz4hvz4xv04xv05Bv14xv15Bv15Rv25Bv25Rv25Rz25hv35hv35xv45xv45xz55xz56Bv56Bz66Rv66Rz76Rv76Rz76hz86hv86xz+7h3/7R3/7h3/7x3/8B3/8B7/8R3/8R4Yqhj5AAAAq3RSTlMAAQECAgIDAwMEBAQFBwgICAwQERITFRYXGBkbHB0eHyQlJyguNTg8RUZISU5PV2FiY2RlZmdqa2xubnJzc3R2d3d3eXl5eXp7fH1+gIGCgoKDg4SEhIWGh4eHiYmJjIyMjZSUlJ+sra+zt7i4uru8ztHV1tbW2d7g4OHi4uPk5ufp7Ozv9fX29/f3+Pj6+vr7+/v7+/v7+/z8/Pz8/f39/f39/f3+/v7+/v7K6J1dAAACHklEQVQ4y2NgwAoYWdi5uLm5GXHIcrLCmMzYpDmAhKCKjoGtp40MFhVsDAwSxmmVEzZu2XvqSLkchjw3g0h445Ybd24vmTN1Usd5X3R5DgaNqgN35sycP2/GxMkTMRVwMOivvtO3YsWUm3duX790EcMKdgbNNXdnnJh1+9T6ipzU+FB0RzIyiFYB5WdfaElUF8TmTQ6GwH39J2bvypMHcpg4MAKKkUGo5s6KWRfyGRh4WJClGEGBCgS8DLobliy/3abMwM8NBYwQjXDgf3ryxOspyKYyg+RFTFwdnYDAzbrw+oLFm9Ot3J3AwNHFTBykQrhg++GDh48cOXzk4P6VZy8s230MyAGCwwcP7iyRBJpiur1n8hQIWHX27NkLi6bAwOSuow5ABeY7OydOhoCFIAULe6E8YFCf8QAqEC86evniZTA4tfLsuRXHr0E4ly9ePF0uC3KnpH1MZBQQxPoVgxyZ5RMdBQaRMc6yIEcihWbQGaA3k9G8CfQoN0pAtSoxCMACihk9qGtBQZ2LHtRIkRUMiqwd2TJADiswsrjQlAGju/o+MLrPNkWo8mFN1ewMWmvBCebQ0rKMJG87QzF0FRwMRuvugpLcrXu3rp7Zs61UCtMZ2nVHbk+fMX/+jMmTp3Sf9MLiULG45q237txaPG3yxPYrYQzYMo60RWbD3E27Ll68Uq+AK+uJqOlZBiSEKGLNnMA0iDfzwrI/NKgBOivk9piPdtUAAAAASUVORK5CYII="}),h("span",{children:"markmap"})]}),t.map(w)]}))),this.el}};y.defaultItems=["zoomIn","zoomOut","fit","recurse"];let z=y;t.Toolbar=z,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}(this.markmap=this.markmap||{});
9 | //# sourceMappingURL=/sm/adba47aa401d3315097245499685e39a208052fd8e7a2433d63acf4774545c96.map
--------------------------------------------------------------------------------
/js/markmap-autoloader.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Minified by jsDelivr using Terser v5.19.2.
3 | * Original file: /npm/markmap-autoloader@0.17.0/dist/index.js
4 | *
5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
6 | */
7 | this.markmap=this.markmap||{},function(e){"use strict";var t;const r={jsdelivr:e=>`https://cdn.jsdelivr.net/npm/${e}`,unpkg:e=>`https://unpkg.com/${e}`};const n=new class{constructor(){this.providers={...r},this.provider="jsdelivr"}async getFastestProvider(e=5e3,t="npm2url/dist/index.cjs"){const r=new AbortController;let n=0;try{return await new Promise(((o,a)=>{Promise.all(Object.entries(this.providers).map((async([e,n])=>{try{await async function(e,t){const r=await fetch(e,{signal:t});if(!r.ok)throw r;await r.text()}(n(t),r.signal),o(e)}catch{}}))).then((()=>a(new Error("All providers failed")))),n=setTimeout(a,e,new Error("Timed out"))}))}finally{r.abort(),clearTimeout(n)}}async findFastestProvider(e,t){return this.provider=await this.getFastestProvider(e,t),this.provider}setProvider(e,t){t?this.providers[e]=t:delete this.providers[e]}getFullUrl(e,t=this.provider){if(e.includes("://"))return e;const r=this.providers[t];if(!r)throw new Error(`Provider ${t} not found`);return r(e)}};function o(){const e={};return e.promise=new Promise(((t,r)=>{e.resolve=t,e.reject=r})),e}Math.random().toString(36).slice(2,8);
8 | /*! @gera2ld/jsx-dom v2.2.2 | ISC License */
9 | const a=1,s=2,i="http://www.w3.org/2000/svg",l="http://www.w3.org/1999/xlink",c={show:l,actuate:l,href:l},d=e=>"string"==typeof e||"number"==typeof e,u=e=>(null==e?void 0:e.vtype)===a,p=e=>(null==e?void 0:e.vtype)===s;function f(e,t,...r){return function(e,t){let r;if("string"==typeof e)r=a;else{if("function"!=typeof e)throw new Error("Invalid VNode type");r=s}return{vtype:r,type:e,props:t}}(e,t=Object.assign({},t,{children:1===r.length?r[0]:r}))}function m(e){return e.children}const v={isSvg:!1};function h(e,t){Array.isArray(t)||(t=[t]),(t=t.filter(Boolean)).length&&e.append(...t)}const y={className:"class",labelFor:"for"};function g(e,t,r,n){if(t=y[t]||t,!0===r)e.setAttribute(t,"");else if(!1===r)e.removeAttribute(t);else{const o=n?c[t]:void 0;void 0!==o?e.setAttributeNS(o,t,r):e.setAttribute(t,r)}}function w(e,t){return Array.isArray(e)?e.map((e=>w(e,t))).reduce(((e,t)=>e.concat(t)),[]):b(e,t)}function b(e,t=v){if(null==e||"boolean"==typeof e)return null;if(e instanceof Node)return e;if(p(e)){const{type:r,props:n}=e;if(r===m){const e=document.createDocumentFragment();if(n.children){h(e,w(n.children,t))}return e}return b(r(n),t)}if(d(e))return document.createTextNode(`${e}`);if(u(e)){let r;const{type:n,props:o}=e;if(t.isSvg||"svg"!==n||(t=Object.assign({},t,{isSvg:!0})),r=t.isSvg?document.createElementNS(i,n):document.createElement(n),function(e,t,r){for(const n in t)if("key"!==n&&"children"!==n&&"ref"!==n)if("dangerouslySetInnerHTML"===n)e.innerHTML=t[n].__html;else if("innerHTML"===n||"textContent"===n||"innerText"===n||"value"===n&&["textarea","select"].includes(e.tagName)){const r=t[n];null!=r&&(e[n]=r)}else n.startsWith("on")?e[n.toLowerCase()]=t[n]:g(e,n,t[n],r.isSvg)}(r,o,t),o.children){let e=t;t.isSvg&&"foreignObject"===n&&(e=Object.assign({},e,{isSvg:!1}));const a=w(o.children,e);null!=a&&h(r,a)}const{ref:a}=o;return"function"==typeof a&&a(r),r}throw new Error("mount: Invalid Vnode!")}function k(...e){return b(f(...e))}const S=function(e){const t={};return function(...r){const n=`${r[0]}`;let o=t[n];return o||(o={value:e(...r)},t[n]=o),o.value}}((e=>{document.head.append(k("link",{rel:"preload",as:"script",href:e}))})),j={},P={};async function A(e,t){var r;const n="script"===e.type&&(null==(r=e.data)?void 0:r.src)||"";if(e.loaded||(e.loaded=j[n]),!e.loaded){const r=o();if(e.loaded=r.promise,"script"===e.type&&(document.head.append(k("script",{...e.data,onLoad:()=>r.resolve(),onError:r.reject})),n?j[n]=e.loaded:r.resolve()),"iife"===e.type){const{fn:n,getParams:o}=e.data;n(...(null==o?void 0:o(t))||[]),r.resolve()}}await e.loaded}async function E(e,t){e.forEach((e=>{var t;"script"===e.type&&(null==(t=e.data)?void 0:t.src)&&S(e.data.src)})),t={getMarkmap:()=>window.markmap,...t};for(const r of e)await A(r,t)}async function x(e){await Promise.all(e.map((e=>async function(e){const t="stylesheet"===e.type&&e.data.href||"";if(e.loaded||(e.loaded=P[t]),!e.loaded){const r=o();e.loaded=r.promise,t&&(P[t]=e.loaded),"style"===e.type?(document.head.append(k("style",{textContent:e.data})),r.resolve()):t&&(document.head.append(k("link",{rel:"stylesheet",...e.data})),fetch(t).then((e=>{if(e.ok)return e.text();throw e})).then((()=>r.resolve()),r.reject))}await e.loaded}(e))))}const C={},L={baseJs:["d3@7.8.5","markmap-lib@0.17.0","markmap-view@0.17.0","markmap-toolbar@0.17.0"],baseCss:["markmap-toolbar@0.17.0/dist/style.css"],manual:!1,toolbar:!1,...null==(t=window.markmap)?void 0:t.autoLoader};const T=async function(){var e;if("function"==typeof L.provider)n.setProvider(n.provider="autoLoader",L.provider);else if("string"==typeof L.provider)n.provider=L.provider;else try{await n.findFastestProvider()}catch{}await Promise.all([E(L.baseJs.map((e=>"string"==typeof e?{type:"script",data:{src:n.getFullUrl(e)}}:e))),x(L.baseCss.map((e=>"string"==typeof e?{type:"stylesheet",data:{href:n.getFullUrl(e)}}:e)))]);const{markmap:t}=window,r=document.createElement("style");r.textContent=t.globalCSS,document.body.prepend(r),null==(e=L.onReady)||e.call(L)}();function M(e){var t;const{Transformer:r,Markmap:o,deriveOptions:a,Toolbar:s}=window.markmap,i=(null==(t=e.textContent)?void 0:t.split("\n"))||[];let l=1/0;i.forEach((e=>{var t;const r=(null==(t=e.match(/^\s*/))?void 0:t[0].length)||0;re.slice(l))).join("\n").trim(),d=new r(L.transformPlugins);d.urlBuilder=n,e.innerHTML="";const u=e.firstChild,p=o.create(u,{embedGlobalCSS:!1});if(L.toolbar){const{el:t}=s.create(p);Object.assign(t.style,{position:"absolute",right:"20px",bottom:"20px"}),e.append(t)}const f=()=>{const{root:e,frontmatter:t}=function(e,t){const r=e.transform(t),n=Object.keys(r.features).filter((e=>!C[e]));n.forEach((e=>{C[e]=!0}));const{styles:o,scripts:a}=e.getAssets(n),{markmap:s}=window;return o&&s.loadCSS(o),a&&s.loadJS(a),r}(d,c),r=null==t?void 0:t.markmap,n=a(r);p.setData(e,n),p.fit()};d.hooks.retransform.tap(f),f()}async function O(e){await T,e.querySelectorAll(".markmap").forEach(M)}function F(){return O(document)}L.manual||("loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{F()})):F()),e.ready=T,e.render=M,e.renderAll=F,e.renderAllUnder=O,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}(this.markmap.autoLoader=this.markmap.autoLoader||{});
10 | //# sourceMappingURL=/sm/cb79d9e12dd286ef44083dd3a59fac30ac2469ca168e06859000d602486698a5.map
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/js/markmap-view.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Minified by jsDelivr using Terser v5.19.2.
3 | * Original file: /npm/markmap-view@0.17.0/dist/browser/index.js
4 | *
5 | * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
6 | */
7 | !function(t,e){"use strict";const n=Math.random().toString(36).slice(2,8);let r=0;function i(){}function a(t,e){const n=(t,r)=>e(t,(()=>{var e;return null==(e=t.children)?void 0:e.map((e=>n(e,t)))}),r);return n(t)}function o(t){if("string"==typeof t){const e=t;t=t=>t.tagName===e}const e=t;return function(){let t=Array.from(this.childNodes);return e&&(t=t.filter((t=>e(t)))),t}}function s(){const t={};return t.promise=new Promise(((e,n)=>{t.resolve=e,t.reject=n})),t}
8 | /*! @gera2ld/jsx-dom v2.2.2 | ISC License */
9 | const l=1,c=2,h="http://www.w3.org/2000/svg",d="http://www.w3.org/1999/xlink",u={show:d,actuate:d,href:d},p=t=>"string"==typeof t||"number"==typeof t,m=t=>(null==t?void 0:t.vtype)===l,f=t=>(null==t?void 0:t.vtype)===c;function g(t,e,...n){return function(t,e){let n;if("string"==typeof t)n=l;else{if("function"!=typeof t)throw new Error("Invalid VNode type");n=c}return{vtype:n,type:t,props:e}}(t,e=Object.assign({},e,{children:1===n.length?n[0]:n}))}function v(t){return t.children}const y={isSvg:!1};function x(t,e){Array.isArray(e)||(e=[e]),(e=e.filter(Boolean)).length&&t.append(...e)}const k={className:"class",labelFor:"for"};function b(t,e,n,r){if(e=k[e]||e,!0===n)t.setAttribute(e,"");else if(!1===n)t.removeAttribute(e);else{const i=r?u[e]:void 0;void 0!==i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}}function S(t,e){return Array.isArray(t)?t.map((t=>S(t,e))).reduce(((t,e)=>t.concat(e)),[]):w(t,e)}function w(t,e=y){if(null==t||"boolean"==typeof t)return null;if(t instanceof Node)return t;if(f(t)){const{type:n,props:r}=t;if(n===v){const t=document.createDocumentFragment();if(r.children){x(t,S(r.children,e))}return t}return w(n(r),e)}if(p(t))return document.createTextNode(`${t}`);if(m(t)){let n;const{type:r,props:i}=t;if(e.isSvg||"svg"!==r||(e=Object.assign({},e,{isSvg:!0})),n=e.isSvg?document.createElementNS(h,r):document.createElement(r),function(t,e,n){for(const r in e)if("key"!==r&&"children"!==r&&"ref"!==r)if("dangerouslySetInnerHTML"===r)t.innerHTML=e[r].__html;else if("innerHTML"===r||"textContent"===r||"innerText"===r||"value"===r&&["textarea","select"].includes(t.tagName)){const n=e[r];null!=n&&(t[r]=n)}else r.startsWith("on")?t[r.toLowerCase()]=e[r]:b(t,r,e[r],n.isSvg)}(n,i,e),i.children){let t=e;e.isSvg&&"foreignObject"===r&&(t=Object.assign({},t,{isSvg:!1}));const a=S(i.children,t);null!=a&&x(n,a)}const{ref:a}=i;return"function"==typeof a&&a(n),n}throw new Error("mount: Invalid Vnode!")}function z(...t){return w(g(...t))}const E=function(t){const e={};return function(...n){const r=`${n[0]}`;let i=e[r];return i||(i={value:t(...n)},e[r]=i),i.value}}((t=>{document.head.append(z("link",{rel:"preload",as:"script",href:t}))})),C={},j={};async function X(t,e){var n;const r="script"===t.type&&(null==(n=t.data)?void 0:n.src)||"";if(t.loaded||(t.loaded=C[r]),!t.loaded){const n=s();if(t.loaded=n.promise,"script"===t.type&&(document.head.append(z("script",{...t.data,onLoad:()=>n.resolve(),onError:n.reject})),r?C[r]=t.loaded:n.resolve()),"iife"===t.type){const{fn:r,getParams:i}=t.data;r(...(null==i?void 0:i(e))||[]),n.resolve()}}await t.loaded}const A="undefined"!=typeof navigator&&navigator.userAgent.includes("Macintosh"),M=e.scaleOrdinal(e.schemeCategory10),O={autoFit:!1,color:t=>{var e;return M(`${(null==(e=t.state)?void 0:e.path)||""}`)},duration:500,embedGlobalCSS:!0,fitRatio:.95,maxWidth:0,nodeMinHeight:16,paddingX:8,scrollForPan:A,spacingHorizontal:80,spacingVertical:5,initialExpandLevel:-1,zoom:!0,pan:!0,toggleRecursively:!1};
10 | /*! @gera2ld/jsx-dom v2.2.2 | ISC License */
11 | const N="http://www.w3.org/2000/svg",T="http://www.w3.org/1999/xlink",$={show:T,actuate:T,href:T},R=t=>"string"==typeof t||"number"==typeof t,B=t=>1===(null==t?void 0:t.vtype),L=t=>2===(null==t?void 0:t.vtype);function I(t,e){let n;if("string"==typeof t)n=1;else{if("function"!=typeof t)throw new Error("Invalid VNode type");n=2}return{vtype:n,type:t,props:e}}function D(t){return t.children}const H={isSvg:!1};function F(t,e){Array.isArray(e)||(e=[e]),(e=e.filter(Boolean)).length&&t.append(...e)}const P={className:"class",labelFor:"for"};function Y(t,e,n,r){if(e=P[e]||e,!0===n)t.setAttribute(e,"");else if(!1===n)t.removeAttribute(e);else{const i=r?$[e]:void 0;void 0!==i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}}function _(t,e){return Array.isArray(t)?t.map((t=>_(t,e))).reduce(((t,e)=>t.concat(e)),[]):W(t,e)}function W(t,e=H){if(null==t||"boolean"==typeof t)return null;if(t instanceof Node)return t;if(L(t)){const{type:n,props:r}=t;if(n===D){const t=document.createDocumentFragment();if(r.children){F(t,_(r.children,e))}return t}return W(n(r),e)}if(R(t))return document.createTextNode(`${t}`);if(B(t)){let n;const{type:r,props:i}=t;if(e.isSvg||"svg"!==r||(e=Object.assign({},e,{isSvg:!0})),n=e.isSvg?document.createElementNS(N,r):document.createElement(r),function(t,e,n){for(const r in e)if("key"!==r&&"children"!==r&&"ref"!==r)if("dangerouslySetInnerHTML"===r)t.innerHTML=e[r].__html;else if("innerHTML"===r||"textContent"===r||"innerText"===r||"value"===r&&["textarea","select"].includes(t.tagName)){const n=e[r];null!=n&&(t[r]=n)}else r.startsWith("on")?t[r.toLowerCase()]=e[r]:Y(t,r,e[r],n.isSvg)}(n,i,e),i.children){let t=e;e.isSvg&&"foreignObject"===r&&(t=Object.assign({},t,{isSvg:!1}));const a=_(i.children,t);null!=a&&F(n,a)}const{ref:a}=i;return"function"==typeof a&&a(n),n}throw new Error("mount: Invalid Vnode!")}function V(t){return W(t)}function K(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function U(t,e){var n,r,i,a,o,s=new J(t),l=+t.value&&(s.value=t.value),c=[s];for(null==e&&(e=G);n=c.pop();)if(l&&(n.value=+n.data.value),(i=e(n.data))&&(o=i.length))for(n.children=new Array(o),a=o-1;a>=0;--a)c.push(r=n.children[a]=new J(i[a])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(q)}function G(t){return t.children}function Z(t){t.data=t.data.data}function q(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function J(t){this.data=t,this.depth=this.height=0,this.parent=null}J.prototype=U.prototype={constructor:J,count:function(){return this.eachAfter(K)},each:function(t){var e,n,r,i,a=this,o=[a];do{for(e=o.reverse(),o=[];a=e.pop();)if(t(a),n=a.children)for(r=0,i=n.length;r=0;--n)i.push(e[n]);return this},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){var t=[];return this.each((function(e){t.push(e)})),t},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return U(this).eachBefore(Z)}};const Q={name:"d3-flextree",version:"2.1.2",main:"build/d3-flextree.js",module:"index","jsnext:main":"index",author:{name:"Chris Maloney",url:"http://chrismaloney.org"},description:"Flexible tree layout algorithm that allows for variable node sizes.",keywords:["d3","d3-module","layout","tree","hierarchy","d3-hierarchy","plugin","d3-plugin","infovis","visualization","2d"],homepage:"https://github.com/klortho/d3-flextree",license:"WTFPL",repository:{type:"git",url:"https://github.com/klortho/d3-flextree.git"},scripts:{clean:"rm -rf build demo test","build:demo":"rollup -c --environment BUILD:demo","build:dev":"rollup -c --environment BUILD:dev","build:prod":"rollup -c --environment BUILD:prod","build:test":"rollup -c --environment BUILD:test",build:"rollup -c",lint:"eslint index.js src","test:main":"node test/bundle.js","test:browser":"node test/browser-tests.js",test:"npm-run-all test:*",prepare:"npm-run-all clean build lint test"},dependencies:{"d3-hierarchy":"^1.1.5"},devDependencies:{"babel-plugin-external-helpers":"^6.22.0","babel-preset-es2015-rollup":"^3.0.0",d3:"^4.13.0","d3-selection-multi":"^1.0.1",eslint:"^4.19.1",jsdom:"^11.6.2","npm-run-all":"^4.1.2",rollup:"^0.55.3","rollup-plugin-babel":"^2.7.1","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-copy":"^0.2.3","rollup-plugin-json":"^2.3.0","rollup-plugin-node-resolve":"^3.0.2","rollup-plugin-uglify":"^3.0.0","uglify-es":"^3.3.9"}},{version:tt}=Q,et=Object.freeze({children:t=>t.children,nodeSize:t=>t.data.size,spacing:0});function nt(t){const e=Object.assign({},et,t);function n(t){const n=e[t];return"function"==typeof n?n:()=>n}function r(t){const e=a(function(){const t=i(),e=n("nodeSize"),r=n("spacing");return class extends t{constructor(t){super(t),Object.assign(this,{x:0,y:0,relX:0,prelim:0,shift:0,change:0,lExt:this,lExtRelX:0,lThr:null,rExt:this,rExtRelX:0,rThr:null})}get size(){return e(this.data)}spacing(t){return r(this.data,t.data)}get x(){return this.data.x}set x(t){this.data.x=t}get y(){return this.data.y}set y(t){this.data.y=t}update(){return rt(this),it(this),this}}}(),t,(t=>t.children));return e.update(),e.data}function i(){const t=n("nodeSize"),e=n("spacing");return class n extends U.prototype.constructor{constructor(t){super(t)}copy(){const t=a(this.constructor,this,(t=>t.children));return t.each((t=>t.data=t.data.data)),t}get size(){return t(this)}spacing(t){return e(this,t)}get nodes(){return this.descendants()}get xSize(){return this.size[0]}get ySize(){return this.size[1]}get top(){return this.y}get bottom(){return this.y+this.ySize}get left(){return this.x-this.xSize/2}get right(){return this.x+this.xSize/2}get root(){const t=this.ancestors();return t[t.length-1]}get numChildren(){return this.hasChildren?this.children.length:0}get hasChildren(){return!this.noChildren}get noChildren(){return null===this.children}get firstChild(){return this.hasChildren?this.children[0]:null}get lastChild(){return this.hasChildren?this.children[this.numChildren-1]:null}get extents(){return(this.children||[]).reduce(((t,e)=>n.maxExtents(t,e.extents)),this.nodeExtents)}get nodeExtents(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}static maxExtents(t,e){return{top:Math.min(t.top,e.top),bottom:Math.max(t.bottom,e.bottom),left:Math.min(t.left,e.left),right:Math.max(t.right,e.right)}}}}function a(t,e,n){const r=(e,i)=>{const a=new t(e);Object.assign(a,{parent:i,depth:null===i?0:i.depth+1,height:0,length:1});const o=n(e)||[];return a.children=0===o.length?null:o.map((t=>r(t,a))),a.children&&Object.assign(a,a.children.reduce(((t,e)=>({height:Math.max(t.height,e.height+1),length:t.length+e.length})),a)),a};return r(e,null)}return Object.assign(r,{nodeSize(t){return arguments.length?(e.nodeSize=t,r):e.nodeSize},spacing(t){return arguments.length?(e.spacing=t,r):e.spacing},children(t){return arguments.length?(e.children=t,r):e.children},hierarchy(t,n){const r=void 0===n?e.children:n;return a(i(),t,r)},dump(t){const e=n("nodeSize"),r=t=>n=>{const i=t+" ",a=t+" ",{x:o,y:s}=n,l=e(n),c=n.children||[],h=0===c.length?" ":`,${i}children: [${a}${c.map(r(a)).join(a)}${i}],${t}`;return`{ size: [${l.join(", ")}],${i}x: ${o}, y: ${s}${h}},`};return r("\n")(t)}}),r}nt.version=tt;const rt=(t,e=0)=>(t.y=e,(t.children||[]).reduce(((e,n)=>{const[r,i]=e;rt(n,t.y+t.ySize);const a=(0===r?n.lExt:n.rExt).bottom;0!==r&&ot(t,r,i);return[r+1,mt(a,r,i)]}),[0,null]),at(t),pt(t),t),it=(t,e,n)=>{void 0===e&&(e=-t.relX-t.prelim,n=0);const r=e+t.relX;return t.relX=r+t.prelim-n,t.prelim=0,t.x=n+t.relX,(t.children||[]).forEach((e=>it(e,r,t.x))),t},at=t=>{(t.children||[]).reduce(((t,e)=>{const[n,r]=t,i=n+e.shift,a=r+i+e.change;return e.relX+=a,[i,a]}),[0,0])},ot=(t,e,n)=>{const r=t.children[e-1],i=t.children[e];let a=r,o=r.relX,s=i,l=i.relX,c=!0;for(;a&&s;){a.bottom>n.lowY&&(n=n.next);const r=o+a.prelim-(l+s.prelim)+a.xSize/2+s.xSize/2+a.spacing(s);(r>0||r<0&&c)&&(l+=r,st(i,r),lt(t,e,n.index,r)),c=!1;const h=a.bottom,d=s.bottom;h<=d&&(a=ht(a),a&&(o+=a.relX)),h>=d&&(s=ct(s),s&&(l+=s.relX))}!a&&s?dt(t,e,s,l):a&&!s&&ut(t,e,a,o)},st=(t,e)=>{t.relX+=e,t.lExtRelX+=e,t.rExtRelX+=e},lt=(t,e,n,r)=>{const i=t.children[e],a=e-n;if(a>1){const e=r/a;t.children[n+1].shift+=e,i.shift-=e,i.change-=r-e}},ct=t=>t.hasChildren?t.firstChild:t.lThr,ht=t=>t.hasChildren?t.lastChild:t.rThr,dt=(t,e,n,r)=>{const i=t.firstChild,a=i.lExt,o=t.children[e];a.lThr=n;const s=r-n.relX-i.lExtRelX;a.relX+=s,a.prelim-=s,i.lExt=o.lExt,i.lExtRelX=o.lExtRelX},ut=(t,e,n,r)=>{const i=t.children[e],a=i.rExt,o=t.children[e-1];a.rThr=n;const s=r-n.relX-i.rExtRelX;a.relX+=s,a.prelim-=s,i.rExt=o.rExt,i.rExtRelX=o.rExtRelX},pt=t=>{if(t.hasChildren){const e=t.firstChild,n=t.lastChild,r=(e.prelim+e.relX-e.xSize/2+n.relX+n.prelim+n.xSize/2)/2;Object.assign(t,{prelim:r,lExt:e.lExt,lExtRelX:e.lExtRelX,rExt:n.rExt,rExtRelX:n.rExtRelX})}},mt=(t,e,n)=>{for(;null!==n&&t>=n.lowY;)n=n.next;return{lowY:t,index:e,next:n}},ft="/* used for pre-rendering to get the size of each node */\n.markmap-container {\n position: absolute;\n width: 0;\n height: 0;\n top: -100px;\n left: -100px;\n overflow: hidden;\n}\n.markmap-container > .markmap-foreign {\n display: inline-block;\n }\n/* first-child for line wrapping, last-child for max-width detection */\n.markmap-container > .markmap-foreign > div:last-child,\n \n .markmap-container > .markmap-foreign > div:last-child :not(pre) {\n white-space: nowrap;\n }\n.markmap-container > .markmap-foreign > div:last-child code {\n white-space: inherit;\n }\n",gt=".markmap {\n --markmap-max-width: none;\n --markmap-a-color: #0097e6;\n --markmap-a-hover-color: #00a8ff;\n --markmap-code-bg: #f0f0f0;\n --markmap-code-color: #555;\n --markmap-highlight-bg: #ffeaa7;\n --markmap-table-border: 1px solid currentColor;\n --markmap-font: 300 16px/20px sans-serif;\n --markmap-circle-open-bg: #fff;\n --markmap-text-color: #333;\n\n font: var(--markmap-font);\n color: var(--markmap-text-color);\n}\n\n .markmap-link {\n fill: none;\n }\n\n .markmap-node > circle {\n cursor: pointer;\n }\n\n .markmap-foreign {\n display: inline-block;\n }\n\n .markmap-foreign p {\n margin: 0;\n }\n\n .markmap-foreign a {\n color: var(--markmap-a-color);\n }\n\n .markmap-foreign a:hover {\n color: var(--markmap-a-hover-color);\n }\n\n .markmap-foreign code {\n padding: 0.25em;\n font-size: calc(1em - 2px);\n color: var(--markmap-code-color);\n background-color: var(--markmap-code-bg);\n border-radius: 2px;\n }\n\n .markmap-foreign pre {\n margin: 0;\n }\n\n .markmap-foreign pre > code {\n display: block;\n }\n\n .markmap-foreign del {\n text-decoration: line-through;\n }\n\n .markmap-foreign em {\n font-style: italic;\n }\n\n .markmap-foreign strong {\n font-weight: bold;\n }\n\n .markmap-foreign mark {\n background: var(--markmap-highlight-bg);\n }\n\n .markmap-foreign table,\n .markmap-foreign th,\n .markmap-foreign td {\n border-collapse: collapse;\n border: var(--markmap-table-border);\n }\n\n .markmap-foreign img {\n display: inline-block;\n }\n\n .markmap-foreign svg {\n fill: currentColor;\n }\n\n .markmap-foreign-testing-max {\n max-width: var(--markmap-max-width);\n }\n\n .markmap-foreign-testing-max img {\n max-width: var(--markmap-max-width);\n max-height: none;\n }\n\n.markmap-dark .markmap {\n --markmap-code-bg: #1a1b26;\n --markmap-code-color: #ddd;\n --markmap-circle-open-bg: #444;\n --markmap-text-color: #eee;\n}\n",vt=gt;function yt(t){const e=t.data;return Math.max(4-2*e.state.depth,1.5)}function xt(t,n){return t[e.minIndex(t,n)]}function kt(t){t.stopPropagation()}const bt=new class{constructor(){this.listeners=[]}tap(t){return this.listeners.push(t),()=>this.revoke(t)}revoke(t){const e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)}revokeAll(){this.listeners.splice(0)}call(...t){for(const e of this.listeners)e(...t)}};class St{constructor(t,i){this.options=O,this.revokers=[],this.imgCache={},this.handleZoom=t=>{const{transform:e}=t;this.g.attr("transform",e)},this.handlePan=t=>{t.preventDefault();const n=e.zoomTransform(this.svg.node()),r=n.translate(-t.deltaX/n.k,-t.deltaY/n.k);this.svg.call(this.zoom.transform,r)},this.handleClick=(t,e)=>{let n=this.options.toggleRecursively;(A?t.metaKey:t.ctrlKey)&&(n=!n),this.toggleNode(e.data,n)},this.svg=t.datum?t:e.select(t),this.styleNode=this.svg.append("style"),this.zoom=e.zoom().filter((t=>this.options.scrollForPan&&"wheel"===t.type?t.ctrlKey&&!t.button:!(t.ctrlKey&&"wheel"!==t.type||t.button))).on("zoom",this.handleZoom),this.setOptions(i),this.state={id:this.options.id||this.svg.attr("id")||(r+=1,`mm-${n}-${r}`),minX:0,maxX:0,minY:0,maxY:0},this.g=this.svg.append("g"),this.debouncedRefresh=function(t,e){const n={timer:0};function r(){n.timer&&(window.clearTimeout(n.timer),n.timer=0)}function i(){r(),n.args&&(n.result=t(...n.args))}return function(...t){return r(),n.args=t,n.timer=window.setTimeout(i,e),n.result}}((()=>this.setData()),200),this.revokers.push(bt.tap((()=>{this.setData()})))}getStyleContent(){const{style:t}=this.options,{id:e}=this.state,n="function"==typeof t?t(e):"";return[this.options.embedGlobalCSS&>,n].filter(Boolean).join("\n")}updateStyle(){this.svg.attr("class",function(t,...e){const n=(t||"").split(" ").filter(Boolean);return e.forEach((t=>{t&&n.indexOf(t)<0&&n.push(t)})),n.join(" ")}(this.svg.attr("class"),"markmap",this.state.id));const t=this.getStyleContent();this.styleNode.text(t)}toggleNode(t,e=!1){var n,r;const i=(null==(n=t.payload)?void 0:n.fold)?0:1;e?a(t,((t,e)=>{t.payload={...t.payload,fold:i},e()})):t.payload={...t.payload,fold:(null==(r=t.payload)?void 0:r.fold)?0:1},this.renderData(t)}initializeData(t){let e=0;const{color:n,nodeMinHeight:r,maxWidth:i,initialExpandLevel:o}=this.options,{id:s}=this.state,l=V(I("div",{className:`markmap-container markmap ${s}-g`})),c=V(I("style",{children:[this.getStyleContent(),ft].join("\n")}));document.body.append(l,c);const h=i?`--markmap-max-width: ${i}px`:"";let d=0,u=0;a(t,((t,r,i)=>{var a,s,c;u+=1,t.children=null==(a=t.children)?void 0:a.map((t=>({...t}))),e+=1;const p=V(I("div",{className:"markmap-foreign markmap-foreign-testing-max",style:h,children:I("div",{dangerouslySetInnerHTML:{__html:t.content}})}));l.append(p),t.state={...t.state,depth:u,id:e,el:p.firstChild},t.state.path=[null==(s=null==i?void 0:i.state)?void 0:s.path,t.state.id].filter(Boolean).join("."),n(t);const m=2===(null==(c=t.payload)?void 0:c.fold);m?d+=1:(d||o>=0&&t.state.depth>=o)&&(t.payload={...t.payload,fold:1}),r(),m&&(d-=1),u-=1}));const p=Array.from(l.childNodes).map((t=>t.firstChild));this._checkImages(l),p.forEach((t=>{var e;null==(e=t.parentNode)||e.append(t.cloneNode(!0))})),a(t,((t,e,n)=>{var i;const a=t.state,o=a.el.getBoundingClientRect();t.content=a.el.innerHTML,a.size=[Math.ceil(o.width)+1,Math.max(Math.ceil(o.height),r)],a.key=[null==(i=null==n?void 0:n.state)?void 0:i.id,a.id].filter(Boolean).join(".")+t.content,e()})),l.remove(),c.remove()}_checkImages(t){t.querySelectorAll("img").forEach((t=>{if(t.width)return;const e=this.imgCache[t.src];(null==e?void 0:e[0])?[t.width,t.height]=e:e||this._loadImage(t.src)}))}_loadImage(t){this.imgCache[t]=[0,0];const e=new Image;e.src=t,e.onload=()=>{this.imgCache[t]=[e.naturalWidth,e.naturalHeight],this.debouncedRefresh()}}setOptions(t){this.options={...this.options,...t},this.options.zoom?this.svg.call(this.zoom):this.svg.on(".zoom",null),this.options.pan?this.svg.on("wheel",this.handlePan):this.svg.on("wheel",null)}setData(t,e){e&&this.setOptions(e),t&&(this.state.data=t),this.state.data&&(this.initializeData(this.state.data),this.updateStyle(),this.renderData())}renderData(t){if(!this.state.data)return;const{spacingHorizontal:n,paddingX:r,spacingVertical:i,autoFit:a,color:s}=this.options,l=nt({}).children((t=>{var e;if(!(null==(e=t.payload)?void 0:e.fold))return t.children})).nodeSize((t=>{const[e,i]=t.data.state.size;return[i,e+(e?2*r:0)+n]})).spacing(((t,e)=>t.parent===e.parent?i:2*i)),c=l.hierarchy(this.state.data);l(c);const h=c.descendants().reverse(),d=c.links(),u=e.linkHorizontal(),p=e.min(h,(t=>t.x-t.xSize/2)),m=e.max(h,(t=>t.x+t.xSize/2)),f=e.min(h,(t=>t.y)),g=e.max(h,(t=>t.y+t.ySize-n));Object.assign(this.state,{minX:p,maxX:m,minY:f,maxY:g}),a&&this.fit();const v=t&&h.find((e=>e.data===t))||c,y=v.data.state.x0??v.x,x=v.data.state.y0??v.y,k=this.g.selectAll(o("g")).data(h,(t=>t.data.state.key)),b=k.enter().append("g").attr("data-depth",(t=>t.data.state.depth)).attr("data-path",(t=>t.data.state.path)).attr("transform",(t=>`translate(${x+v.ySize-t.ySize},${y+v.xSize/2-t.xSize})`)),S=this.transition(k.exit());S.select("line").attr("x1",(t=>t.ySize-n)).attr("x2",(t=>t.ySize-n)),S.select("foreignObject").style("opacity",0),S.attr("transform",(t=>`translate(${v.y+v.ySize-t.ySize},${v.x+v.xSize/2-t.xSize})`)).remove();const w=k.merge(b).attr("class",(t=>{var e;return["markmap-node",(null==(e=t.data.payload)?void 0:e.fold)&&"markmap-fold"].filter(Boolean).join(" ")}));this.transition(w).attr("transform",(t=>`translate(${t.y},${t.x-t.xSize/2})`));const z=w.selectAll(o("line")).data((t=>[t]),(t=>t.data.state.key)).join((t=>t.append("line").attr("x1",(t=>t.ySize-n)).attr("x2",(t=>t.ySize-n))),(t=>t),(t=>t.remove()));this.transition(z).attr("x1",-1).attr("x2",(t=>t.ySize-n+2)).attr("y1",(t=>t.xSize)).attr("y2",(t=>t.xSize)).attr("stroke",(t=>s(t.data))).attr("stroke-width",yt);const E=w.selectAll(o("circle")).data((t=>{var e;return(null==(e=t.data.children)?void 0:e.length)?[t]:[]}),(t=>t.data.state.key)).join((t=>t.append("circle").attr("stroke-width","1.5").attr("cx",(t=>t.ySize-n)).attr("cy",(t=>t.xSize)).attr("r",0).on("click",((t,e)=>this.handleClick(t,e))).on("mousedown",kt)),(t=>t),(t=>t.remove()));this.transition(E).attr("r",6).attr("cx",(t=>t.ySize-n)).attr("cy",(t=>t.xSize)).attr("stroke",(t=>s(t.data))).attr("fill",(t=>{var e;return(null==(e=t.data.payload)?void 0:e.fold)&&t.data.children?s(t.data):"var(--markmap-circle-open-bg)"}));const C=w.selectAll(o("foreignObject")).data((t=>[t]),(t=>t.data.state.key)).join((t=>{const e=t.append("foreignObject").attr("class","markmap-foreign").attr("x",r).attr("y",0).style("opacity",0).on("mousedown",kt).on("dblclick",kt);return e.append("xhtml:div").select((function(t){const e=t.data.state.el.cloneNode(!0);return this.replaceWith(e),e})).attr("xmlns","http://www.w3.org/1999/xhtml"),e}),(t=>t),(t=>t.remove())).attr("width",(t=>Math.max(0,t.ySize-n-2*r))).attr("height",(t=>t.xSize));this.transition(C).style("opacity",1);const j=this.g.selectAll(o("path")).data(d,(t=>t.target.data.state.key)).join((t=>{const e=[x+v.ySize-n,y+v.xSize/2];return t.insert("path","g").attr("class","markmap-link").attr("data-depth",(t=>t.target.data.state.depth)).attr("data-path",(t=>t.target.data.state.path)).attr("d",u({source:e,target:e}))}),(t=>t),(t=>{const e=[v.y+v.ySize-n,v.x+v.xSize/2];return this.transition(t).attr("d",u({source:e,target:e})).remove()}));this.transition(j).attr("stroke",(t=>s(t.target.data))).attr("stroke-width",(t=>yt(t.target))).attr("d",(t=>{const e=t.source,r=t.target,i=[e.y+e.ySize-n,e.x+e.xSize/2],a=[r.y,r.x+r.xSize/2];return u({source:i,target:a})})),h.forEach((t=>{t.data.state.x0=t.x,t.data.state.y0=t.y}))}transition(t){const{duration:e}=this.options;return t.transition().duration(e)}async fit(){const t=this.svg.node(),{width:n,height:r}=t.getBoundingClientRect(),{fitRatio:a}=this.options,{minX:o,maxX:s,minY:l,maxY:c}=this.state,h=c-l,d=s-o,u=Math.min(n/h*a,r/d*a,2),p=e.zoomIdentity.translate((n-h*u)/2-l*u,(r-d*u)/2-o*u).scale(u);return this.transition(this.svg).call(this.zoom.transform,p).end().catch(i)}findElement(t){let e;return this.g.selectAll(o("g")).each((function(n){n.data===t&&(e={data:n,g:this})})),e}async ensureView(t,n){var r;const a=null==(r=this.findElement(t))?void 0:r.data;if(!a)return;const o=this.svg.node(),{spacingHorizontal:s}=this.options,l=o.getBoundingClientRect(),c=e.zoomTransform(o),[h,d]=[a.y,a.y+a.ySize-s+2].map((t=>t*c.k+c.x)),[u,p]=[a.x-a.xSize/2,a.x+a.xSize/2].map((t=>t*c.k+c.y)),m={left:0,right:0,top:0,bottom:0,...n},f=[m.left-h,l.width-m.right-d],g=[m.top-u,l.height-m.bottom-p],v=f[0]*f[1]>0?xt(f,Math.abs)/c.k:0,y=g[0]*g[1]>0?xt(g,Math.abs)/c.k:0;if(v||y){const t=c.translate(v,y);return this.transition(this.svg).call(this.zoom.transform,t).end().catch(i)}}async rescale(t){const n=this.svg.node(),{width:r,height:a}=n.getBoundingClientRect(),o=r/2,s=a/2,l=e.zoomTransform(n),c=l.translate((o-l.x)*(1-t)/l.k,(s-l.y)*(1-t)/l.k).scale(t);return this.transition(this.svg).call(this.zoom.transform,c).end().catch(i)}destroy(){this.svg.on(".zoom",null),this.svg.html(null),this.revokers.forEach((t=>{t()}))}static create(t,e,n=null){const r=new St(t,e);return n&&(r.setData(n),r.fit()),r}}t.Markmap=St,t.defaultColorFn=M,t.defaultOptions=O,t.deriveOptions=function(t){const n={},r={...t},{color:i,colorFreezeLevel:a}=r;if(1===(null==i?void 0:i.length)){const t=i[0];n.color=()=>t}else if(null==i?void 0:i.length){const t=e.scaleOrdinal(i);n.color=e=>t(`${e.state.path}`)}if(a){const t=n.color||O.color;n.color=e=>(e={...e,state:{...e.state,path:e.state.path.split(".").slice(0,a).join(".")}},t(e))}return["duration","maxWidth","initialExpandLevel"].forEach((t=>{const e=r[t];"number"==typeof e&&(n[t]=e)})),["zoom","pan"].forEach((t=>{const e=r[t];null!=e&&(n[t]=!!e)})),n},t.globalCSS=vt,t.isMacintosh=A,t.loadCSS=async function(t){await Promise.all(t.map((t=>async function(t){const e="stylesheet"===t.type&&t.data.href||"";if(t.loaded||(t.loaded=j[e]),!t.loaded){const n=s();t.loaded=n.promise,e&&(j[e]=t.loaded),"style"===t.type?(document.head.append(z("style",{textContent:t.data})),n.resolve()):e&&(document.head.append(z("link",{rel:"stylesheet",...t.data})),fetch(e).then((t=>{if(t.ok)return t.text();throw t})).then((()=>n.resolve()),n.reject))}await t.loaded}(t))))},t.loadJS=async function(t,e){t.forEach((t=>{var e;"script"===t.type&&(null==(e=t.data)?void 0:e.src)&&E(t.data.src)})),e={getMarkmap:()=>window.markmap,...e};for(const n of t)await X(n,e)},t.refreshHook=bt,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}(this.markmap=this.markmap||{},d3);
12 | //# sourceMappingURL=/sm/576e40e89b450bbcf4142e50a16a2086a9a145874bbed0aee8be9ef422ec2fab.map
--------------------------------------------------------------------------------
/js/hightlight.js:
--------------------------------------------------------------------------------
1 | /*!
2 | Highlight.js v11.8.0 (git: 65687a907b)
3 | (c) 2006-2023 undefined and other contributors
4 | License: BSD-3-Clause
5 | */
6 | var hljs=function(){"use strict";function e(n){
7 | return n instanceof Map?n.clear=n.delete=n.set=()=>{
8 | throw Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=()=>{
9 | throw Error("set is read-only")
10 | }),Object.freeze(n),Object.getOwnPropertyNames(n).forEach((t=>{
11 | const a=n[t],i=typeof a;"object"!==i&&"function"!==i||Object.isFrozen(a)||e(a)
12 | })),n}class n{constructor(e){
13 | void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}
14 | ignoreMatch(){this.isMatchIgnored=!0}}function t(e){
15 | return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")
16 | }function a(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n]
17 | ;return n.forEach((e=>{for(const n in e)t[n]=e[n]})),t}const i=e=>!!e.scope
18 | ;class r{constructor(e,n){
19 | this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){
20 | this.buffer+=t(e)}openNode(e){if(!i(e))return;const n=((e,{prefix:n})=>{
21 | if(e.startsWith("language:"))return e.replace("language:","language-")
22 | ;if(e.includes(".")){const t=e.split(".")
23 | ;return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")
24 | }return`${n}${e}`})(e.scope,{prefix:this.classPrefix});this.span(n)}
25 | closeNode(e){i(e)&&(this.buffer+="")}value(){return this.buffer}span(e){
26 | this.buffer+=``}}const s=(e={})=>{const n={children:[]}
27 | ;return Object.assign(n,e),n};class o{constructor(){
28 | this.rootNode=s(),this.stack=[this.rootNode]}get top(){
29 | return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){
30 | this.top.children.push(e)}openNode(e){const n=s({scope:e})
31 | ;this.add(n),this.stack.push(n)}closeNode(){
32 | if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){
33 | for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}
34 | walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){
35 | return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),
36 | n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){
37 | "string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{
38 | o._collapse(e)})))}}class l extends o{constructor(e){super(),this.options=e}
39 | addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){
40 | this.closeNode()}__addSublanguage(e,n){const t=e.root
41 | ;n&&(t.scope="language:"+n),this.add(t)}toHTML(){
42 | return new r(this,this.options).value()}finalize(){
43 | return this.closeAllNodes(),!0}}function c(e){
44 | return e?"string"==typeof e?e:e.source:null}function d(e){return b("(?=",e,")")}
45 | function g(e){return b("(?:",e,")*")}function u(e){return b("(?:",e,")?")}
46 | function b(...e){return e.map((e=>c(e))).join("")}function m(...e){const n=(e=>{
47 | const n=e[e.length-1]
48 | ;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}
49 | })(e);return"("+(n.capture?"":"?:")+e.map((e=>c(e))).join("|")+")"}
50 | function p(e){return RegExp(e.toString()+"|").exec("").length-1}
51 | const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./
52 | ;function h(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t
53 | ;let a=c(e),i="";for(;a.length>0;){const e=_.exec(a);if(!e){i+=a;break}
54 | i+=a.substring(0,e.index),
55 | a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+(Number(e[1])+n):(i+=e[0],
56 | "("===e[0]&&t++)}return i})).map((e=>`(${e})`)).join(n)}
57 | const f="[a-zA-Z]\\w*",E="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",N="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",w="\\b(0b[01]+)",v={
58 | begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'",
59 | illegal:"\\n",contains:[v]},k={scope:"string",begin:'"',end:'"',illegal:"\\n",
60 | contains:[v]},x=(e,n,t={})=>{const i=a({scope:"comment",begin:e,end:n,
61 | contains:[]},t);i.contains.push({scope:"doctag",
62 | begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
63 | end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0})
64 | ;const r=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/)
65 | ;return i.contains.push({begin:b(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i
66 | },M=x("//","$"),S=x("/\\*","\\*/"),A=x("#","$");var C=Object.freeze({
67 | __proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:f,UNDERSCORE_IDENT_RE:E,
68 | NUMBER_RE:y,C_NUMBER_RE:N,BINARY_NUMBER_RE:w,
69 | RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",
70 | SHEBANG:(e={})=>{const n=/^#![ ]*\//
71 | ;return e.binary&&(e.begin=b(n,/.*\b/,e.binary,/\b.*/)),a({scope:"meta",begin:n,
72 | end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},
73 | BACKSLASH_ESCAPE:v,APOS_STRING_MODE:O,QUOTE_STRING_MODE:k,PHRASAL_WORDS_MODE:{
74 | begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
75 | },COMMENT:x,C_LINE_COMMENT_MODE:M,C_BLOCK_COMMENT_MODE:S,HASH_COMMENT_MODE:A,
76 | NUMBER_MODE:{scope:"number",begin:y,relevance:0},C_NUMBER_MODE:{scope:"number",
77 | begin:N,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:w,relevance:0},
78 | REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,
79 | end:/\/[gimuy]*/,illegal:/\n/,contains:[v,{begin:/\[/,end:/\]/,relevance:0,
80 | contains:[v]}]}]},TITLE_MODE:{scope:"title",begin:f,relevance:0},
81 | UNDERSCORE_TITLE_MODE:{scope:"title",begin:E,relevance:0},METHOD_GUARD:{
82 | begin:"\\.\\s*"+E,relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{
83 | "on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{
84 | n.data._beginMatch!==e[1]&&n.ignoreMatch()}})});function T(e,n){
85 | "."===e.input[e.index-1]&&n.ignoreMatch()}function R(e,n){
86 | void 0!==e.className&&(e.scope=e.className,delete e.className)}function D(e,n){
87 | n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",
88 | e.__beforeBegin=T,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,
89 | void 0===e.relevance&&(e.relevance=0))}function I(e,n){
90 | Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function L(e,n){
91 | if(e.match){
92 | if(e.begin||e.end)throw Error("begin & end are not supported with match")
93 | ;e.begin=e.match,delete e.match}}function B(e,n){
94 | void 0===e.relevance&&(e.relevance=1)}const $=(e,n)=>{if(!e.beforeMatch)return
95 | ;if(e.starts)throw Error("beforeMatch cannot be used with starts")
96 | ;const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]
97 | })),e.keywords=t.keywords,e.begin=b(t.beforeMatch,d(t.begin)),e.starts={
98 | relevance:0,contains:[Object.assign(t,{endsParent:!0})]
99 | },e.relevance=0,delete t.beforeMatch
100 | },z=["of","and","for","in","not","or","if","then","parent","list","value"],F="keyword"
101 | ;function U(e,n,t=F){const a=Object.create(null)
102 | ;return"string"==typeof e?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach((t=>{
103 | Object.assign(a,U(e[t],n,t))})),a;function i(e,t){
104 | n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((n=>{const t=n.split("|")
105 | ;a[t[0]]=[e,j(t[0],t[1])]}))}}function j(e,n){
106 | return n?Number(n):(e=>z.includes(e.toLowerCase()))(e)?0:1}const P={},K=e=>{
107 | console.error(e)},q=(e,...n)=>{console.log("WARN: "+e,...n)},H=(e,n)=>{
108 | P[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),P[`${e}/${n}`]=!0)
109 | },G=Error();function Z(e,n,{key:t}){let a=0;const i=e[t],r={},s={}
110 | ;for(let e=1;e<=n.length;e++)s[e+a]=i[e],r[e+a]=!0,a+=p(n[e-1])
111 | ;e[t]=s,e[t]._emit=r,e[t]._multi=!0}function W(e){(e=>{
112 | e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,
113 | delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={
114 | _wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope
115 | }),(e=>{if(Array.isArray(e.begin)){
116 | if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),
117 | G
118 | ;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"),
119 | G;Z(e,e.begin,{key:"beginScope"}),e.begin=h(e.begin,{joinWith:""})}})(e),(e=>{
120 | if(Array.isArray(e.end)){
121 | if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"),
122 | G
123 | ;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"),
124 | G;Z(e,e.end,{key:"endScope"}),e.end=h(e.end,{joinWith:""})}})(e)}function Q(e){
125 | function n(n,t){
126 | return RegExp(c(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))
127 | }class t{constructor(){
128 | this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}
129 | addRule(e,n){
130 | n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),
131 | this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null)
132 | ;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(h(e,{joinWith:"|"
133 | }),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex
134 | ;const n=this.matcherRe.exec(e);if(!n)return null
135 | ;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t]
136 | ;return n.splice(0,t),Object.assign(n,a)}}class i{constructor(){
137 | this.rules=[],this.multiRegexes=[],
138 | this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){
139 | if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t
140 | ;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),
141 | n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){
142 | return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){
143 | this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){
144 | const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex
145 | ;let t=n.exec(e)
146 | ;if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{
147 | const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}
148 | return t&&(this.regexIndex+=t.position+1,
149 | this.regexIndex===this.count&&this.considerAll()),t}}
150 | if(e.compilerExtensions||(e.compilerExtensions=[]),
151 | e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.")
152 | ;return e.classNameAliases=a(e.classNameAliases||{}),function t(r,s){const o=r
153 | ;if(r.isCompiled)return o
154 | ;[R,L,W,$].forEach((e=>e(r,s))),e.compilerExtensions.forEach((e=>e(r,s))),
155 | r.__beforeBegin=null,[D,I,B].forEach((e=>e(r,s))),r.isCompiled=!0;let l=null
156 | ;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),
157 | l=r.keywords.$pattern,
158 | delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=U(r.keywords,e.case_insensitive)),
159 | o.keywordPatternRe=n(l,!0),
160 | s&&(r.begin||(r.begin=/\B|\b/),o.beginRe=n(o.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),
161 | r.end&&(o.endRe=n(o.end)),
162 | o.terminatorEnd=c(o.end)||"",r.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)),
163 | r.illegal&&(o.illegalRe=n(r.illegal)),
164 | r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((n=>a(e,{
165 | variants:null},n)))),e.cachedVariants?e.cachedVariants:X(e)?a(e,{
166 | starts:e.starts?a(e.starts):null
167 | }):Object.isFrozen(e)?a(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{t(e,o)
168 | })),r.starts&&t(r.starts,s),o.matcher=(e=>{const n=new i
169 | ;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"
170 | }))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"
171 | }),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n})(o),o}(e)}function X(e){
172 | return!!e&&(e.endsWithParent||X(e.starts))}class V extends Error{
173 | constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}
174 | const J=t,Y=a,ee=Symbol("nomatch"),ne=t=>{
175 | const a=Object.create(null),i=Object.create(null),r=[];let s=!0
176 | ;const o="Could not find the language '{}', did you forget to load/include a language module?",c={
177 | disableAutodetect:!0,name:"Plain text",contains:[]};let p={
178 | ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,
179 | languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",
180 | cssSelector:"pre code",languages:null,__emitter:l};function _(e){
181 | return p.noHighlightRe.test(e)}function h(e,n,t){let a="",i=""
182 | ;"object"==typeof n?(a=e,
183 | t=n.ignoreIllegals,i=n.language):(H("10.7.0","highlight(lang, code, ...args) has been deprecated."),
184 | H("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),
185 | i=e,a=n),void 0===t&&(t=!0);const r={code:a,language:i};x("before:highlight",r)
186 | ;const s=r.result?r.result:f(r.language,r.code,t)
187 | ;return s.code=r.code,x("after:highlight",s),s}function f(e,t,i,r){
188 | const l=Object.create(null);function c(){if(!x.keywords)return void S.addText(A)
189 | ;let e=0;x.keywordPatternRe.lastIndex=0;let n=x.keywordPatternRe.exec(A),t=""
190 | ;for(;n;){t+=A.substring(e,n.index)
191 | ;const i=w.case_insensitive?n[0].toLowerCase():n[0],r=(a=i,x.keywords[a]);if(r){
192 | const[e,a]=r
193 | ;if(S.addText(t),t="",l[i]=(l[i]||0)+1,l[i]<=7&&(C+=a),e.startsWith("_"))t+=n[0];else{
194 | const t=w.classNameAliases[e]||e;g(n[0],t)}}else t+=n[0]
195 | ;e=x.keywordPatternRe.lastIndex,n=x.keywordPatternRe.exec(A)}var a
196 | ;t+=A.substring(e),S.addText(t)}function d(){null!=x.subLanguage?(()=>{
197 | if(""===A)return;let e=null;if("string"==typeof x.subLanguage){
198 | if(!a[x.subLanguage])return void S.addText(A)
199 | ;e=f(x.subLanguage,A,!0,M[x.subLanguage]),M[x.subLanguage]=e._top
200 | }else e=E(A,x.subLanguage.length?x.subLanguage:null)
201 | ;x.relevance>0&&(C+=e.relevance),S.__addSublanguage(e._emitter,e.language)
202 | })():c(),A=""}function g(e,n){
203 | ""!==e&&(S.startScope(n),S.addText(e),S.endScope())}function u(e,n){let t=1
204 | ;const a=n.length-1;for(;t<=a;){if(!e._emit[t]){t++;continue}
205 | const a=w.classNameAliases[e[t]]||e[t],i=n[t];a?g(i,a):(A=i,c(),A=""),t++}}
206 | function b(e,n){
207 | return e.scope&&"string"==typeof e.scope&&S.openNode(w.classNameAliases[e.scope]||e.scope),
208 | e.beginScope&&(e.beginScope._wrap?(g(A,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),
209 | A=""):e.beginScope._multi&&(u(e.beginScope,n),A="")),x=Object.create(e,{parent:{
210 | value:x}}),x}function m(e,t,a){let i=((e,n)=>{const t=e&&e.exec(n)
211 | ;return t&&0===t.index})(e.endRe,a);if(i){if(e["on:end"]){const a=new n(e)
212 | ;e["on:end"](t,a),a.isMatchIgnored&&(i=!1)}if(i){
213 | for(;e.endsParent&&e.parent;)e=e.parent;return e}}
214 | if(e.endsWithParent)return m(e.parent,t,a)}function _(e){
215 | return 0===x.matcher.regexIndex?(A+=e[0],1):(D=!0,0)}function h(e){
216 | const n=e[0],a=t.substring(e.index),i=m(x,e,a);if(!i)return ee;const r=x
217 | ;x.endScope&&x.endScope._wrap?(d(),
218 | g(n,x.endScope._wrap)):x.endScope&&x.endScope._multi?(d(),
219 | u(x.endScope,e)):r.skip?A+=n:(r.returnEnd||r.excludeEnd||(A+=n),
220 | d(),r.excludeEnd&&(A=n));do{
221 | x.scope&&S.closeNode(),x.skip||x.subLanguage||(C+=x.relevance),x=x.parent
222 | }while(x!==i.parent);return i.starts&&b(i.starts,e),r.returnEnd?0:n.length}
223 | let y={};function N(a,r){const o=r&&r[0];if(A+=a,null==o)return d(),0
224 | ;if("begin"===y.type&&"end"===r.type&&y.index===r.index&&""===o){
225 | if(A+=t.slice(r.index,r.index+1),!s){const n=Error(`0 width match regex (${e})`)
226 | ;throw n.languageName=e,n.badRule=y.rule,n}return 1}
227 | if(y=r,"begin"===r.type)return(e=>{
228 | const t=e[0],a=e.rule,i=new n(a),r=[a.__beforeBegin,a["on:begin"]]
229 | ;for(const n of r)if(n&&(n(e,i),i.isMatchIgnored))return _(t)
230 | ;return a.skip?A+=t:(a.excludeBegin&&(A+=t),
231 | d(),a.returnBegin||a.excludeBegin||(A=t)),b(a,e),a.returnBegin?0:t.length})(r)
232 | ;if("illegal"===r.type&&!i){
233 | const e=Error('Illegal lexeme "'+o+'" for mode "'+(x.scope||"")+'"')
234 | ;throw e.mode=x,e}if("end"===r.type){const e=h(r);if(e!==ee)return e}
235 | if("illegal"===r.type&&""===o)return 1
236 | ;if(R>1e5&&R>3*r.index)throw Error("potential infinite loop, way more iterations than matches")
237 | ;return A+=o,o.length}const w=v(e)
238 | ;if(!w)throw K(o.replace("{}",e)),Error('Unknown language: "'+e+'"')
239 | ;const O=Q(w);let k="",x=r||O;const M={},S=new p.__emitter(p);(()=>{const e=[]
240 | ;for(let n=x;n!==w;n=n.parent)n.scope&&e.unshift(n.scope)
241 | ;e.forEach((e=>S.openNode(e)))})();let A="",C=0,T=0,R=0,D=!1;try{
242 | if(w.__emitTokens)w.__emitTokens(t,S);else{for(x.matcher.considerAll();;){
243 | R++,D?D=!1:x.matcher.considerAll(),x.matcher.lastIndex=T
244 | ;const e=x.matcher.exec(t);if(!e)break;const n=N(t.substring(T,e.index),e)
245 | ;T=e.index+n}N(t.substring(T))}return S.finalize(),k=S.toHTML(),{language:e,
246 | value:k,relevance:C,illegal:!1,_emitter:S,_top:x}}catch(n){
247 | if(n.message&&n.message.includes("Illegal"))return{language:e,value:J(t),
248 | illegal:!0,relevance:0,_illegalBy:{message:n.message,index:T,
249 | context:t.slice(T-100,T+100),mode:n.mode,resultSoFar:k},_emitter:S};if(s)return{
250 | language:e,value:J(t),illegal:!1,relevance:0,errorRaised:n,_emitter:S,_top:x}
251 | ;throw n}}function E(e,n){n=n||p.languages||Object.keys(a);const t=(e=>{
252 | const n={value:J(e),illegal:!1,relevance:0,_top:c,_emitter:new p.__emitter(p)}
253 | ;return n._emitter.addText(e),n})(e),i=n.filter(v).filter(k).map((n=>f(n,e,!1)))
254 | ;i.unshift(t);const r=i.sort(((e,n)=>{
255 | if(e.relevance!==n.relevance)return n.relevance-e.relevance
256 | ;if(e.language&&n.language){if(v(e.language).supersetOf===n.language)return 1
257 | ;if(v(n.language).supersetOf===e.language)return-1}return 0})),[s,o]=r,l=s
258 | ;return l.secondBest=o,l}function y(e){let n=null;const t=(e=>{
259 | let n=e.className+" ";n+=e.parentNode?e.parentNode.className:""
260 | ;const t=p.languageDetectRe.exec(n);if(t){const n=v(t[1])
261 | ;return n||(q(o.replace("{}",t[1])),
262 | q("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}
263 | return n.split(/\s+/).find((e=>_(e)||v(e)))})(e);if(_(t))return
264 | ;if(x("before:highlightElement",{el:e,language:t
265 | }),e.children.length>0&&(p.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),
266 | console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),
267 | console.warn("The element with unescaped HTML:"),
268 | console.warn(e)),p.throwUnescapedHTML))throw new V("One of your code blocks includes unescaped HTML.",e.innerHTML)
269 | ;n=e;const a=n.textContent,r=t?h(a,{language:t,ignoreIllegals:!0}):E(a)
270 | ;e.innerHTML=r.value,((e,n,t)=>{const a=n&&i[n]||t
271 | ;e.classList.add("hljs"),e.classList.add("language-"+a)
272 | })(e,t,r.language),e.result={language:r.language,re:r.relevance,
273 | relevance:r.relevance},r.secondBest&&(e.secondBest={
274 | language:r.secondBest.language,relevance:r.secondBest.relevance
275 | }),x("after:highlightElement",{el:e,result:r,text:a})}let N=!1;function w(){
276 | "loading"!==document.readyState?document.querySelectorAll(p.cssSelector).forEach(y):N=!0
277 | }function v(e){return e=(e||"").toLowerCase(),a[e]||a[i[e]]}
278 | function O(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{
279 | i[e.toLowerCase()]=n}))}function k(e){const n=v(e)
280 | ;return n&&!n.disableAutodetect}function x(e,n){const t=e;r.forEach((e=>{
281 | e[t]&&e[t](n)}))}
282 | "undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{
283 | N&&w()}),!1),Object.assign(t,{highlight:h,highlightAuto:E,highlightAll:w,
284 | highlightElement:y,
285 | highlightBlock:e=>(H("10.7.0","highlightBlock will be removed entirely in v12.0"),
286 | H("10.7.0","Please use highlightElement now."),y(e)),configure:e=>{p=Y(p,e)},
287 | initHighlighting:()=>{
288 | w(),H("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},
289 | initHighlightingOnLoad:()=>{
290 | w(),H("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")
291 | },registerLanguage:(e,n)=>{let i=null;try{i=n(t)}catch(n){
292 | if(K("Language definition for '{}' could not be registered.".replace("{}",e)),
293 | !s)throw n;K(n),i=c}
294 | i.name||(i.name=e),a[e]=i,i.rawDefinition=n.bind(null,t),i.aliases&&O(i.aliases,{
295 | languageName:e})},unregisterLanguage:e=>{delete a[e]
296 | ;for(const n of Object.keys(i))i[n]===e&&delete i[n]},
297 | listLanguages:()=>Object.keys(a),getLanguage:v,registerAliases:O,
298 | autoDetection:k,inherit:Y,addPlugin:e=>{(e=>{
299 | e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{
300 | e["before:highlightBlock"](Object.assign({block:n.el},n))
301 | }),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{
302 | e["after:highlightBlock"](Object.assign({block:n.el},n))})})(e),r.push(e)},
303 | removePlugin:e=>{const n=r.indexOf(e);-1!==n&&r.splice(n,1)}}),t.debugMode=()=>{
304 | s=!1},t.safeMode=()=>{s=!0},t.versionString="11.8.0",t.regex={concat:b,
305 | lookahead:d,either:m,optional:u,anyNumberOfTimes:g}
306 | ;for(const n in C)"object"==typeof C[n]&&e(C[n]);return Object.assign(t,C),t
307 | },te=ne({});te.newInstance=()=>ne({});var ae=te;const ie=e=>({IMPORTANT:{
308 | scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{
309 | scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},
310 | FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},
311 | ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",
312 | contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{
313 | scope:"number",
314 | begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
315 | relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}
316 | }),re=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],se=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],oe=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],le=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ce=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),de=oe.concat(le)
317 | ;var ge="[0-9](_*[0-9])*",ue=`\\.(${ge})`,be="[0-9a-fA-F](_*[0-9a-fA-F])*",me={
318 | className:"number",variants:[{
319 | begin:`(\\b(${ge})((${ue})|\\.)?|(${ue}))[eE][+-]?(${ge})[fFdD]?\\b`},{
320 | begin:`\\b(${ge})((${ue})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{
321 | begin:`(${ue})[fFdD]?\\b`},{begin:`\\b(${ge})[fFdD]\\b`},{
322 | begin:`\\b0[xX]((${be})\\.?|(${be})?\\.(${be}))[pP][+-]?(${ge})[fFdD]?\\b`},{
323 | begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${be})[lL]?\\b`},{
324 | begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],
325 | relevance:0};function pe(e,n,t){return-1===t?"":e.replace(n,(a=>pe(e,n,t-1)))}
326 | const _e="[A-Za-z$_][0-9A-Za-z$_]*",he=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],fe=["true","false","null","undefined","NaN","Infinity"],Ee=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],ye=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ne=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],we=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ve=[].concat(Ne,Ee,ye)
327 | ;function Oe(e){const n=e.regex,t=_e,a={begin:/<[A-Za-z0-9\\._:-]+/,
328 | end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{
329 | const t=e[0].length+e.index,a=e.input[t]
330 | ;if("<"===a||","===a)return void n.ignoreMatch();let i
331 | ;">"===a&&(((e,{after:n})=>{const t=""+e[0].slice(1)
332 | ;return-1!==e.input.indexOf(t,n)})(e,{after:t})||n.ignoreMatch())
333 | ;const r=e.input.substring(t)
334 | ;((i=r.match(/^\s*=/))||(i=r.match(/^\s+extends\s+/))&&0===i.index)&&n.ignoreMatch()
335 | }},i={$pattern:_e,keyword:he,literal:fe,built_in:ve,"variable.language":we
336 | },r="[0-9](_?[0-9])*",s=`\\.(${r})`,o="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",l={
337 | className:"number",variants:[{
338 | begin:`(\\b(${o})((${s})|\\.)?|(${s}))[eE][+-]?(${r})\\b`},{
339 | begin:`\\b(${o})\\b((${s})\\b|\\.)?|(${s})\\b`},{
340 | begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{
341 | begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{
342 | begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{
343 | begin:"\\b0[0-7]+n?\\b"}],relevance:0},c={className:"subst",begin:"\\$\\{",
344 | end:"\\}",keywords:i,contains:[]},d={begin:"html`",end:"",starts:{end:"`",
345 | returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"xml"}},g={
346 | begin:"css`",end:"",starts:{end:"`",returnEnd:!1,
347 | contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"css"}},u={begin:"gql`",end:"",
348 | starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],
349 | subLanguage:"graphql"}},b={className:"string",begin:"`",end:"`",
350 | contains:[e.BACKSLASH_ESCAPE,c]},m={className:"comment",
351 | variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{
352 | begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",
353 | begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,
354 | excludeBegin:!0,relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",
355 | endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]
356 | }),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]
357 | },p=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,g,u,b,{match:/\$\d+/},l]
358 | ;c.contains=p.concat({begin:/\{/,end:/\}/,keywords:i,contains:["self"].concat(p)
359 | });const _=[].concat(m,c.contains),h=_.concat([{begin:/\(/,end:/\)/,keywords:i,
360 | contains:["self"].concat(_)}]),f={className:"params",begin:/\(/,end:/\)/,
361 | excludeBegin:!0,excludeEnd:!0,keywords:i,contains:h},E={variants:[{
362 | match:[/class/,/\s+/,t,/\s+/,/extends/,/\s+/,n.concat(t,"(",n.concat(/\./,t),")*")],
363 | scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{
364 | match:[/class/,/\s+/,t],scope:{1:"keyword",3:"title.class"}}]},y={relevance:0,
365 | match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),
366 | className:"title.class",keywords:{_:[...Ee,...ye]}},N={variants:[{
367 | match:[/function/,/\s+/,t,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],
368 | className:{1:"keyword",3:"title.function"},label:"func.def",contains:[f],
369 | illegal:/%/},w={
370 | match:n.concat(/\b/,(v=[...Ne,"super","import"],n.concat("(?!",v.join("|"),")")),t,n.lookahead(/\(/)),
371 | className:"title.function",relevance:0};var v;const O={
372 | begin:n.concat(/\./,n.lookahead(n.concat(t,/(?![0-9A-Za-z$_(])/))),end:t,
373 | excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={
374 | match:[/get|set/,/\s+/,t,/(?=\()/],className:{1:"keyword",3:"title.function"},
375 | contains:[{begin:/\(\)/},f]
376 | },x="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={
377 | match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(x)],
378 | keywords:"async",className:{1:"keyword",3:"title.function"},contains:[f]}
379 | ;return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{
380 | PARAMS_CONTAINS:h,CLASS_REFERENCE:y},illegal:/#(?![$_A-z])/,
381 | contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{
382 | label:"use_strict",className:"meta",relevance:10,
383 | begin:/^\s*['"]use (strict|asm)['"]/
384 | },e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,g,u,b,m,{match:/\$\d+/},l,y,{
385 | className:"attr",begin:t+n.lookahead(":"),relevance:0},M,{
386 | begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",
387 | keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{
388 | className:"function",begin:x,returnBegin:!0,end:"\\s*=>",contains:[{
389 | className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{
390 | className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,
391 | excludeEnd:!0,keywords:i,contains:h}]}]},{begin:/,/,relevance:0},{match:/\s+/,
392 | relevance:0},{variants:[{begin:"<>",end:">"},{
393 | match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin,
394 | "on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{
395 | begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},N,{
396 | beginKeywords:"while if switch catch for"},{
397 | begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
398 | returnBegin:!0,label:"func.def",contains:[f,e.inherit(e.TITLE_MODE,{begin:t,
399 | className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$"+t,
400 | relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},
401 | contains:[f]},w,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,
402 | className:"variable.constant"},E,k,{match:/\$[(.]/}]}}
403 | const ke=e=>b(/\b/,e,/\w$/.test(e)?/\b/:/\B/),xe=["Protocol","Type"].map(ke),Me=["init","self"].map(ke),Se=["Any","Self"],Ae=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Ce=["false","nil","true"],Te=["assignment","associativity","higherThan","left","lowerThan","none","right"],Re=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],De=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Ie=m(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Le=m(Ie,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Be=b(Ie,Le,"*"),$e=m(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),ze=m($e,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Fe=b($e,ze,"*"),Ue=b(/[A-Z]/,ze,"*"),je=["autoclosure",b(/convention\(/,m("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",b(/objc\(/,Fe,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],Pe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"]
404 | ;var Ke=Object.freeze({__proto__:null,grmr_bash:e=>{const n=e.regex,t={},a={
405 | begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]}
406 | ;Object.assign(t,{className:"variable",variants:[{
407 | begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const i={
408 | className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r={
409 | begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,
410 | end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,
411 | contains:[e.BACKSLASH_ESCAPE,t,i]};i.contains.push(s);const o={begin:/\$?\(\(/,
412 | end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]
413 | },l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10
414 | }),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,
415 | contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{
416 | name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,
417 | keyword:["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],
418 | literal:["true","false"],
419 | built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]
420 | },contains:[l,e.SHEBANG(),c,o,e.HASH_COMMENT_MODE,r,{match:/(\/[a-z._-]+)+/},s,{
421 | className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}},
422 | grmr_c:e=>{const n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]
423 | }),a="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",r="("+a+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",s={
424 | className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{
425 | match:/\batomic_[a-z]{3,6}\b/}]},o={className:"string",variants:[{
426 | begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{
427 | begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",
428 | end:"'",illegal:"."},e.END_SAME_AS_BEGIN({
429 | begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={
430 | className:"number",variants:[{begin:"\\b(0b[01']+)"},{
431 | begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"
432 | },{
433 | begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"
434 | }],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{
435 | keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"
436 | },contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"string"}),{
437 | className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={
438 | className:"title",begin:n.optional(i)+e.IDENT_RE,relevance:0
439 | },g=n.optional(i)+e.IDENT_RE+"\\s*\\(",u={
440 | keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],
441 | type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],
442 | literal:"true false NULL",
443 | built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"
444 | },b=[c,s,t,e.C_BLOCK_COMMENT_MODE,l,o],m={variants:[{begin:/=/,end:/;/},{
445 | begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],
446 | keywords:u,contains:b.concat([{begin:/\(/,end:/\)/,keywords:u,
447 | contains:b.concat(["self"]),relevance:0}]),relevance:0},p={
448 | begin:"("+r+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,
449 | keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:u,relevance:0},{
450 | begin:g,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],
451 | relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,
452 | keywords:u,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,o,l,s,{begin:/\(/,
453 | end:/\)/,keywords:u,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,o,l,s]
454 | }]},s,t,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:u,
455 | disableAutodetect:!0,illegal:"",contains:[].concat(m,p,b,[c,{
456 | begin:e.IDENT_RE+"::",keywords:u},{className:"class",
457 | beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{
458 | beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,
459 | strings:o,keywords:u}}},grmr_cpp:e=>{const n=e.regex,t=e.COMMENT("//","$",{
460 | contains:[{begin:/\\\n/}]
461 | }),a="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",r="(?!struct)("+a+"|"+n.optional(i)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",s={
462 | className:"type",begin:"\\b[a-z\\d_]*_t\\b"},o={className:"string",variants:[{
463 | begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{
464 | begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",
465 | end:"'",illegal:"."},e.END_SAME_AS_BEGIN({
466 | begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={
467 | className:"number",variants:[{begin:"\\b(0b[01']+)"},{
468 | begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"
469 | },{
470 | begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"
471 | }],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{
472 | keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"
473 | },contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"string"}),{
474 | className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={
475 | className:"title",begin:n.optional(i)+e.IDENT_RE,relevance:0
476 | },g=n.optional(i)+e.IDENT_RE+"\\s*\\(",u={
477 | type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],
478 | keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],
479 | literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],
480 | _type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]
481 | },b={className:"function.dispatch",relevance:0,keywords:{
482 | _hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]
483 | },
484 | begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))
485 | },m=[b,c,s,t,e.C_BLOCK_COMMENT_MODE,l,o],p={variants:[{begin:/=/,end:/;/},{
486 | begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],
487 | keywords:u,contains:m.concat([{begin:/\(/,end:/\)/,keywords:u,
488 | contains:m.concat(["self"]),relevance:0}]),relevance:0},_={className:"function",
489 | begin:"("+r+"[\\*&\\s]+)+"+g,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,
490 | keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:u,relevance:0},{
491 | begin:g,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{
492 | begin:/:/,endsWithParent:!0,contains:[o,l]},{relevance:0,match:/,/},{
493 | className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,
494 | contains:[t,e.C_BLOCK_COMMENT_MODE,o,l,s,{begin:/\(/,end:/\)/,keywords:u,
495 | relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,o,l,s]}]
496 | },s,t,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",
497 | aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:u,illegal:"",
498 | classNameAliases:{"function.dispatch":"built_in"},
499 | contains:[].concat(p,_,b,m,[c,{
500 | begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",
501 | end:">",keywords:u,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:u},{
502 | match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],
503 | className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{const n={
504 | keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),
505 | built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],
506 | literal:["default","false","null","true"]},t=e.inherit(e.TITLE_MODE,{
507 | begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{
508 | begin:"\\b(0b[01']+)"},{
509 | begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{
510 | begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"
511 | }],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]
512 | },r=e.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,
513 | keywords:n},o=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,
514 | end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/
515 | },e.BACKSLASH_ESCAPE,o]},c={className:"string",begin:/\$@"/,end:'"',contains:[{
516 | begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=e.inherit(c,{illegal:/\n/,
517 | contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]})
518 | ;s.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],
519 | o.contains=[d,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{
520 | illegal:/\n/})];const g={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]
521 | },u={begin:"<",end:">",contains:[{beginKeywords:"in out"},t]
522 | },b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",m={
523 | begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],
524 | keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,
525 | contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{
526 | begin:"\x3c!--|--\x3e"},{begin:"?",end:">"}]}]
527 | }),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",
528 | end:"$",keywords:{
529 | keyword:"if else elif endif define undef warning error line region endregion pragma checksum"
530 | }},g,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,
531 | illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"
532 | },t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",
533 | relevance:0,end:/[{;=]/,illegal:/[^\s:]/,
534 | contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{
535 | beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,
536 | contains:[t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",
537 | begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{
538 | className:"string",begin:/"/,end:/"/}]},{
539 | beginKeywords:"new return throw await else",relevance:0},{className:"function",
540 | begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,
541 | end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{
542 | beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial",
543 | relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,
544 | contains:[e.TITLE_MODE,u],relevance:0},{match:/\(\)/},{className:"params",
545 | begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0,
546 | contains:[g,a,e.C_BLOCK_COMMENT_MODE]
547 | },e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},m]}},grmr_css:e=>{
548 | const n=e.regex,t=ie(e),a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{
549 | name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{
550 | keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},
551 | contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/
552 | },t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0
553 | },{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0
554 | },t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{
555 | begin:":("+oe.join("|")+")"},{begin:":(:)?("+le.join("|")+")"}]
556 | },t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ce.join("|")+")\\b"},{
557 | begin:/:/,end:/[;}{]/,
558 | contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{
559 | begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"
560 | },contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,
561 | excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",
562 | relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/
563 | },{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{
564 | $pattern:/[a-z-]+/,keyword:"and or not only",attribute:se.join(" ")},contains:[{
565 | begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{
566 | className:"selector-tag",begin:"\\b("+re.join("|")+")\\b"}]}},grmr_diff:e=>{
567 | const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{
568 | className:"meta",relevance:10,
569 | match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)
570 | },{className:"comment",variants:[{
571 | begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),
572 | end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{
573 | className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,
574 | end:/$/}]}},grmr_go:e=>{const n={
575 | keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],
576 | type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],
577 | literal:["true","false","iota","nil"],
578 | built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]
579 | };return{name:"Go",aliases:["golang"],keywords:n,illegal:"",
580 | contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",
581 | variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{
582 | className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1
583 | },e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",
584 | end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",
585 | begin:/\(/,end:/\)/,endsParent:!0,keywords:n,illegal:/["']/}]}]}},
586 | grmr_graphql:e=>{const n=e.regex;return{name:"GraphQL",aliases:["gql"],
587 | case_insensitive:!0,disableAutodetect:!1,keywords:{
588 | keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],
589 | literal:["true","false","null"]},
590 | contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{
591 | scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",
592 | begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,
593 | end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{
594 | scope:"symbol",begin:n.concat(/[_A-Za-z][_0-9A-Za-z]*/,n.lookahead(/\s*:/)),
595 | relevance:0}],illegal:[/[;<']/,/BEGIN/]}},grmr_ini:e=>{const n=e.regex,t={
596 | className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{
597 | begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,
598 | end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{
599 | begin:/\$\{(.*?)\}/}]},r={className:"literal",
600 | begin:/\bon|off|true|false|yes|no\b/},s={className:"string",
601 | contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{
602 | begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]
603 | },o={begin:/\[/,end:/\]/,contains:[a,r,i,s,t,"self"],relevance:0
604 | },l=n.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{
605 | name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,
606 | contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{
607 | begin:n.concat(l,"(\\s*\\.\\s*",l,")*",n.lookahead(/\s*=\s*[^#\s]/)),
608 | className:"attr",starts:{end:/$/,contains:[a,o,r,i,s,t]}}]}},grmr_java:e=>{
609 | const n=e.regex,t="[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*",a=t+pe("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),i={
610 | keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],
611 | literal:["false","true","null"],
612 | type:["char","boolean","long","float","int","byte","short","double"],
613 | built_in:["super","this"]},r={className:"meta",begin:"@"+t,contains:[{
614 | begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,
615 | end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0}
616 | ;return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,
617 | contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,
618 | relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{
619 | begin:/import java\.[a-z]+\./,keywords:"import",relevance:2
620 | },e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,
621 | className:"string",contains:[e.BACKSLASH_ESCAPE]
622 | },e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{
623 | match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{
624 | 1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{
625 | begin:[n.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",
626 | 3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",
627 | 3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{
628 | beginKeywords:"new throw return else",relevance:0},{
629 | begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{
630 | 2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,
631 | end:/\)/,keywords:i,relevance:0,
632 | contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,me,e.C_BLOCK_COMMENT_MODE]
633 | },e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},me,r]}},grmr_javascript:Oe,
634 | grmr_json:e=>{const n=["true","false","null"],t={scope:"literal",
635 | beginKeywords:n.join(" ")};return{name:"JSON",keywords:{literal:n},contains:[{
636 | className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{
637 | match:/[{}[\],:]/,className:"punctuation",relevance:0
638 | },e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],
639 | illegal:"\\S"}},grmr_kotlin:e=>{const n={
640 | keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",
641 | built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",
642 | literal:"true false null"},t={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"
643 | },a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={
644 | className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string",
645 | variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,a]},{begin:"'",end:"'",
646 | illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,
647 | contains:[e.BACKSLASH_ESCAPE,i,a]}]};a.contains.push(r);const s={
648 | className:"meta",
649 | begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"
650 | },o={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,
651 | end:/\)/,contains:[e.inherit(r,{className:"string"}),"self"]}]
652 | },l=me,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={
653 | variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,
654 | contains:[]}]},g=d;return g.variants[1].contains=[d],d.variants[1].contains=[g],
655 | {name:"Kotlin",aliases:["kt","kts"],keywords:n,
656 | contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",
657 | begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",
658 | begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",
659 | begin:/@\w+/}]}},t,s,o,{className:"function",beginKeywords:"fun",end:"[(]|$",
660 | returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{
661 | begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,
662 | contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/,end:/>/,
663 | keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,
664 | endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,
665 | endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0
666 | },e.C_LINE_COMMENT_MODE,c,s,o,r,e.C_NUMBER_MODE]},c]},{
667 | begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{
668 | 3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,
669 | illegal:"extends implements",contains:[{
670 | beginKeywords:"public protected internal private constructor"
671 | },e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/,end:/>/,excludeBegin:!0,
672 | excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,
673 | excludeBegin:!0,returnEnd:!0},s,o]},r,{className:"meta",begin:"^#!/usr/bin/env",
674 | end:"$",illegal:"\n"},l]}},grmr_less:e=>{
675 | const n=ie(e),t=de,a="[\\w-]+",i="("+a+"|@\\{"+a+"\\})",r=[],s=[],o=e=>({
676 | className:"string",begin:"~?"+e+".*?"+e}),l=(e,n,t)=>({className:e,begin:n,
677 | relevance:t}),c={$pattern:/[a-z-]+/,keyword:"and or not only",
678 | attribute:se.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:c,
679 | relevance:0}
680 | ;s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,o("'"),o('"'),n.CSS_NUMBER_MODE,{
681 | begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",
682 | excludeEnd:!0}
683 | },n.HEXCOLOR,d,l("variable","@@?"+a,10),l("variable","@\\{"+a+"\\}"),l("built_in","~?`[^`]*?`"),{
684 | className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0
685 | },n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);const g=s.concat({
686 | begin:/\{/,end:/\}/,contains:r}),u={beginKeywords:"when",endsWithParent:!0,
687 | contains:[{beginKeywords:"and not"}].concat(s)},b={begin:i+"\\s*:",
688 | returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/
689 | },n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ce.join("|")+")\\b",
690 | end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]
691 | },m={className:"keyword",
692 | begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",
693 | starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},p={
694 | className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a
695 | }],starts:{end:"[;}]",returnEnd:!0,contains:g}},_={variants:[{
696 | begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:i,end:/\{/}],returnBegin:!0,
697 | returnEnd:!0,illegal:"[<='$\"]",relevance:0,
698 | contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,l("keyword","all\\b"),l("variable","@\\{"+a+"\\}"),{
699 | begin:"\\b("+re.join("|")+")\\b",className:"selector-tag"
700 | },n.CSS_NUMBER_MODE,l("selector-tag",i,0),l("selector-id","#"+i),l("selector-class","\\."+i,0),l("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{
701 | className:"selector-pseudo",begin:":("+oe.join("|")+")"},{
702 | className:"selector-pseudo",begin:":(:)?("+le.join("|")+")"},{begin:/\(/,
703 | end:/\)/,relevance:0,contains:g},{begin:"!important"},n.FUNCTION_DISPATCH]},h={
704 | begin:a+":(:)?"+`(${t.join("|")})`,returnBegin:!0,contains:[_]}
705 | ;return r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,p,h,b,_,u,n.FUNCTION_DISPATCH),
706 | {name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:r}},
707 | grmr_lua:e=>{const n="\\[=*\\[",t="\\]=*\\]",a={begin:n,end:t,contains:["self"]
708 | },i=[e.COMMENT("--(?!"+n+")","$"),e.COMMENT("--"+n,t,{contains:[a],relevance:10
709 | })];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,
710 | literal:"true false nil",
711 | keyword:"and break do else elseif end for goto if in local not or repeat return then until while",
712 | built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"
713 | },contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",
714 | contains:[e.inherit(e.TITLE_MODE,{
715 | begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",
716 | begin:"\\(",endsWithParent:!0,contains:i}].concat(i)
717 | },e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",
718 | begin:n,end:t,contains:[a],relevance:5}])}},grmr_makefile:e=>{const n={
719 | className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",
720 | contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%\^\+\*]/}]},t={className:"string",
721 | begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n]},a={className:"variable",
722 | begin:/\$\([\w-]+\s/,end:/\)/,keywords:{
723 | built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"
724 | },contains:[n]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},r={
725 | className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};return{
726 | name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,
727 | keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"
728 | },contains:[e.HASH_COMMENT_MODE,n,t,a,i,{className:"meta",begin:/^\.PHONY:/,
729 | end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},r]}},grmr_xml:e=>{
730 | const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a={
731 | className:"symbol",begin:/&[a-z]+;|[0-9]+;|[a-f0-9]+;/},i={begin:/\s/,
732 | contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]
733 | },r=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{
734 | className:"string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={
735 | endsWithParent:!0,illegal:/,relevance:0,contains:[{className:"attr",
736 | begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{
737 | className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{
738 | begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{
739 | name:"HTML, XML",
740 | aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],
741 | case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,o,s,r,{begin:/\[/,end:/\]/,contains:[{
743 | className:"meta",begin://,contains:[i,r,o,s]}]}]
744 | },e.COMMENT(//,{relevance:10}),{begin://,
745 | relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,
746 | relevance:10,contains:[o]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",
747 | begin:/