lampson 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chat.syn +5 -0
- package/cli.syn +3 -0
- package/hub.tpl.syn +3 -0
- package/lib/settings.syn +23 -0
- package/package.json +1 -1
- package/public/css/chat.css +28 -0
- package/public/index.html +3 -0
- package/public/js/core.js +14 -11
- package/public/js/editor.js +11 -1
- package/public/js/markdown.js +72 -0
- package/public/js/tree.js +2 -1
- package/public/vendor/README.md +8 -0
- package/public/vendor/dompurify.LICENSE +202 -0
- package/public/vendor/marked.LICENSE +44 -0
- package/public/vendor/marked.umd.js +92 -0
- package/public/vendor/purify.min.js +7 -0
- package/run.syn +5 -0
- package/web.syn +3 -0
package/chat.syn
CHANGED
|
@@ -35,6 +35,9 @@ require file("memory")
|
|
|
35
35
|
require file("memory/**")
|
|
36
36
|
require file(".lampson")
|
|
37
37
|
require file(".lampson/**")
|
|
38
|
+
-- Config compartida: el destino de esta junction queda fuera del .lampson del workspace.
|
|
39
|
+
require file(".lampson/global")
|
|
40
|
+
require file(".lampson/global/**")
|
|
38
41
|
|
|
39
42
|
use "./lib/provider.syn" as provider
|
|
40
43
|
use "./lib/tools.syn" as tools
|
|
@@ -927,6 +930,8 @@ agent Sched
|
|
|
927
930
|
require file("memory/**")
|
|
928
931
|
require file(".lampson")
|
|
929
932
|
require file(".lampson/**")
|
|
933
|
+
require file(".lampson/global")
|
|
934
|
+
require file(".lampson/global/**")
|
|
930
935
|
let alive be true
|
|
931
936
|
let waited be 25
|
|
932
937
|
while alive
|
package/cli.syn
CHANGED
|
@@ -27,6 +27,9 @@ require env("HOME")
|
|
|
27
27
|
require env("USERPROFILE")
|
|
28
28
|
require file(".lampson")
|
|
29
29
|
require file(".lampson/**")
|
|
30
|
+
-- Config compartida: el destino de esta junction queda fuera del .lampson del workspace.
|
|
31
|
+
require file(".lampson/global")
|
|
32
|
+
require file(".lampson/global/**")
|
|
30
33
|
require file.read("web.syn")
|
|
31
34
|
require file.read(".env")
|
|
32
35
|
require file.read("chat.syn")
|
package/hub.tpl.syn
CHANGED
|
@@ -26,6 +26,9 @@ require env("HOME")
|
|
|
26
26
|
require env("USERPROFILE")
|
|
27
27
|
require file(".lampson")
|
|
28
28
|
require file(".lampson/**")
|
|
29
|
+
-- Config compartida: el destino de esta junction queda fuera del .lampson del workspace.
|
|
30
|
+
require file(".lampson/global")
|
|
31
|
+
require file(".lampson/global/**")
|
|
29
32
|
require file.read("web.syn")
|
|
30
33
|
require file.read(".env")
|
|
31
34
|
require file.read("chat.syn")
|
package/lib/settings.syn
CHANGED
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
-- bajo el hub cada workspace corre con su propio .lampson/ y una junction .lampson/global → <home>/.lampson:
|
|
11
11
|
-- la config (keys, ⚙) es una sola para todos. Sin junction (instalación directa, tests) es .lampson/config.json
|
|
12
|
+
-- El enlace sale del .lampson local: desde Synsema 0.6.45 necesita un grant propio.
|
|
13
|
+
-- Sin él, cfg_path() recuperaba el rechazo y usaba una configuración local distinta por workspace.
|
|
14
|
+
|
|
12
15
|
task cfg_path()
|
|
13
16
|
try
|
|
14
17
|
when file_exists(".lampson/global/config.json") or file_exists(".lampson/global")
|
|
@@ -20,6 +23,8 @@ task cfg_path()
|
|
|
20
23
|
export task load()
|
|
21
24
|
require file.read(".lampson")
|
|
22
25
|
require file.read(".lampson/**")
|
|
26
|
+
require file.read(".lampson/global")
|
|
27
|
+
require file.read(".lampson/global/**")
|
|
23
28
|
require env("LAMPSON_*")
|
|
24
29
|
-- LAMPSON_NO_CONFIG=1: ignorar config.json (proveedor/key reales) — lo fija tests/run.ps1|sh para que la
|
|
25
30
|
-- suite hable SOLO con el mock (2026-08-27: agents_test gastó tokens reales de DeepSeek por no tenerlo)
|
|
@@ -41,6 +46,8 @@ export task load()
|
|
|
41
46
|
export task save(doc)
|
|
42
47
|
require file(".lampson")
|
|
43
48
|
require file(".lampson/**")
|
|
49
|
+
require file(".lampson/global")
|
|
50
|
+
require file(".lampson/global/**")
|
|
44
51
|
require env("LAMPSON_*")
|
|
45
52
|
-- LAMPSON_NO_CONFIG=1 (tests): NUNCA escribir el archivo real. Como load() devuelve un doc en blanco,
|
|
46
53
|
-- cualquier save() (remember_command al tipear /exit en tty_test, /verbose, set_key, set_default…)
|
|
@@ -54,6 +61,8 @@ export task save(doc)
|
|
|
54
61
|
export task raw_key(name)
|
|
55
62
|
require file.read(".lampson")
|
|
56
63
|
require file.read(".lampson/**")
|
|
64
|
+
require file.read(".lampson/global")
|
|
65
|
+
require file.read(".lampson/global/**")
|
|
57
66
|
let doc be load()
|
|
58
67
|
when contains(doc["keys"], lower(name))
|
|
59
68
|
give text(doc["keys"][lower(name)])
|
|
@@ -62,6 +71,8 @@ export task raw_key(name)
|
|
|
62
71
|
export task set_key(name, key)
|
|
63
72
|
require file(".lampson")
|
|
64
73
|
require file(".lampson/**")
|
|
74
|
+
require file(".lampson/global")
|
|
75
|
+
require file(".lampson/global/**")
|
|
65
76
|
let doc be load()
|
|
66
77
|
when trim(key) == ""
|
|
67
78
|
let keys be {}
|
|
@@ -77,6 +88,8 @@ export task set_key(name, key)
|
|
|
77
88
|
export task set_default(name, model)
|
|
78
89
|
require file(".lampson")
|
|
79
90
|
require file(".lampson/**")
|
|
91
|
+
require file(".lampson/global")
|
|
92
|
+
require file(".lampson/global/**")
|
|
80
93
|
let doc be load()
|
|
81
94
|
set doc["provider"] to lower(name)
|
|
82
95
|
set doc["model"] to model
|
|
@@ -109,6 +122,8 @@ task load_raw()
|
|
|
109
122
|
export task set_value(key, value)
|
|
110
123
|
require file(".lampson")
|
|
111
124
|
require file(".lampson/**")
|
|
125
|
+
require file(".lampson/global")
|
|
126
|
+
require file(".lampson/global/**")
|
|
112
127
|
require env("LAMPSON_*")
|
|
113
128
|
when not contains(KEYS, key)
|
|
114
129
|
raise("unknown setting '" + text(key) + "'")
|
|
@@ -127,6 +142,8 @@ export task set_value(key, value)
|
|
|
127
142
|
export task values()
|
|
128
143
|
require file.read(".lampson")
|
|
129
144
|
require file.read(".lampson/**")
|
|
145
|
+
require file.read(".lampson/global")
|
|
146
|
+
require file.read(".lampson/global/**")
|
|
130
147
|
require env("LAMPSON_*")
|
|
131
148
|
let doc be load_raw()
|
|
132
149
|
let out be {}
|
|
@@ -149,6 +166,8 @@ export task values()
|
|
|
149
166
|
export task judge_env()
|
|
150
167
|
require file.read(".lampson")
|
|
151
168
|
require file.read(".lampson/**")
|
|
169
|
+
require file.read(".lampson/global")
|
|
170
|
+
require file.read(".lampson/global/**")
|
|
152
171
|
require env("LAMPSON_*")
|
|
153
172
|
let js be judge_setting()
|
|
154
173
|
let mode be lower(trim(text(js["mode"])))
|
|
@@ -173,6 +192,8 @@ export task judge_env()
|
|
|
173
192
|
export task judge_setting()
|
|
174
193
|
require file.read(".lampson")
|
|
175
194
|
require file.read(".lampson/**")
|
|
195
|
+
require file.read(".lampson/global")
|
|
196
|
+
require file.read(".lampson/global/**")
|
|
176
197
|
require env("LAMPSON_*")
|
|
177
198
|
let v be values()
|
|
178
199
|
let m be trim(text(v["judge"]))
|
|
@@ -187,6 +208,8 @@ export task judge_setting()
|
|
|
187
208
|
export task set_judge(mode, model)
|
|
188
209
|
require file(".lampson")
|
|
189
210
|
require file(".lampson/**")
|
|
211
|
+
require file(".lampson/global")
|
|
212
|
+
require file(".lampson/global/**")
|
|
190
213
|
require env("LAMPSON_*")
|
|
191
214
|
set_value("judge", when mode == "off" then "" otherwise mode)
|
|
192
215
|
when model != nothing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lampson",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "A coding agent written in Synsema: terminal + web, tools confined to the mounted project, plugins (your own tools, any language), LSP, MCP, sub-agents. Also an SDK: import { Lampson } from \"lampson\" (server or local mode).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
package/public/css/chat.css
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/* chat: mensajes, pasos del agente, tarjeta de permiso, portada (hero) */
|
|
2
2
|
/* mensajes: el del usuario es una nota al margen (como el blockquote de la doc), el del agente es prosa */
|
|
3
3
|
.msg { margin:0 0 16px; }
|
|
4
|
+
.msg a { color:var(--accent); text-decoration:underline; text-underline-offset:3px; overflow-wrap:anywhere; }
|
|
5
|
+
.msg a:hover { text-decoration-thickness:2px; }
|
|
4
6
|
.user { margin:26px 0 16px; padding:.85em 1.1em; background:var(--paper-2); border-left:2px solid var(--accent); white-space:pre-wrap; font-size:15px; }
|
|
5
7
|
.user::before { content:"vos"; display:block; font:400 12px/1 var(--mono); color:var(--accent); margin-bottom:6px; }
|
|
6
8
|
.assistant { font-size:15px; line-height:1.62; }
|
|
@@ -13,6 +15,32 @@
|
|
|
13
15
|
.assistant li::marker { color:var(--ink-3); }
|
|
14
16
|
.assistant h1, .assistant h2, .assistant h3 { font:600 1.06rem/1.4 var(--serif); margin:1.4em 0 .5em; }
|
|
15
17
|
.assistant b, .assistant strong { font-weight:600; }
|
|
18
|
+
.assistant { min-width:0; overflow-wrap:anywhere; }
|
|
19
|
+
.assistant h1 { font-size:1.4rem; }
|
|
20
|
+
.assistant h2 { font-size:1.2rem; }
|
|
21
|
+
.assistant h4, .assistant h5, .assistant h6 { margin:1.2em 0 .5em; font-weight:600; }
|
|
22
|
+
.assistant blockquote { margin:1em 0; padding:.15em 1em; border-left:3px solid var(--accent); color:var(--ink-2); }
|
|
23
|
+
.assistant blockquote p:last-child { margin-bottom:0; }
|
|
24
|
+
.assistant hr { border:0; border-top:1px solid var(--rule); margin:1.4em 0; }
|
|
25
|
+
.assistant li > ul, .assistant li > ol { margin:.35em 0; }
|
|
26
|
+
.assistant input[type="checkbox"] { margin-right:.45em; accent-color:var(--accent); }
|
|
27
|
+
.chat-table { max-width:100%; overflow-x:auto; margin:1em 0; border:1px solid var(--rule); border-radius:var(--r); }
|
|
28
|
+
.chat-table table { width:100%; border-collapse:collapse; font-size:.93em; }
|
|
29
|
+
.chat-table th, .chat-table td { padding:.6em .8em; border-bottom:1px solid var(--rule); vertical-align:top; min-width:7em; }
|
|
30
|
+
.chat-table th { font-weight:600; background:var(--paper-2); text-align:left; }
|
|
31
|
+
.chat-table [align="right"] { text-align:right; }
|
|
32
|
+
.chat-table [align="center"] { text-align:center; }
|
|
33
|
+
.chat-table tr:last-child td { border-bottom:0; }
|
|
34
|
+
.chat-code { max-width:100%; margin:1em 0; border:1px solid var(--rule); border-radius:var(--r); overflow:hidden; }
|
|
35
|
+
.chat-code-bar { display:flex; align-items:center; justify-content:space-between; gap:1em; padding:6px 12px; background:var(--paper-2); border-bottom:1px solid var(--rule); color:var(--ink-2); font:12px/1.5 var(--mono); }
|
|
36
|
+
.chat-code-bar button { padding:3px 8px; color:var(--ink); font:inherit; background:transparent; border:1px solid var(--rule); border-radius:var(--r-sm); cursor:pointer; }
|
|
37
|
+
.chat-code-bar button:hover { border-color:var(--accent); }
|
|
38
|
+
.chat-code-bar button:focus-visible, .chat-table:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
|
|
39
|
+
.assistant .chat-code pre { margin:0; border:0; border-radius:0; }
|
|
40
|
+
@media (max-width:600px) {
|
|
41
|
+
.chat-table th, .chat-table td { padding:.5em .6em; }
|
|
42
|
+
.assistant .chat-code pre { padding:12px; }
|
|
43
|
+
}
|
|
16
44
|
|
|
17
45
|
/* pasos del agente: maquinaria, en mono */
|
|
18
46
|
.step { display:grid; grid-template-columns:16px 1fr; column-gap:8px; margin:0 0 7px 2px; font:400 12.5px/1.5 var(--mono); color:var(--ink-2); }
|
package/public/index.html
CHANGED
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
<script src="/vendor/xterm-addon-fit.js"></script>
|
|
26
26
|
<script src="/vendor/xterm-addon-webgl.js"></script>
|
|
27
27
|
<script src="/vendor/highlight.min.js"></script>
|
|
28
|
+
<script src="/vendor/marked.umd.js"></script>
|
|
29
|
+
<script src="/vendor/purify.min.js"></script>
|
|
28
30
|
<script>(function(){try{var t=localStorage.getItem('lampson.theme');if(t!=='light'&&t!=='dark'){t='dark';}document.documentElement.setAttribute('data-theme',t);}catch(e){}})();</script>
|
|
29
31
|
</head>
|
|
30
32
|
<body>
|
|
@@ -131,6 +133,7 @@
|
|
|
131
133
|
</main>
|
|
132
134
|
<!-- módulos (scripts clásicos, en orden): core y el componente Panel primero, las vistas después, app.js arranca -->
|
|
133
135
|
<script src="/js/core.js"></script>
|
|
136
|
+
<script src="/js/markdown.js"></script>
|
|
134
137
|
<script src="/js/panel.js"></script>
|
|
135
138
|
<script src="/js/theme.js"></script>
|
|
136
139
|
<script src="/js/sidebar.js"></script>
|
package/public/js/core.js
CHANGED
|
@@ -27,17 +27,20 @@ function selectSession(id, navigation = 'replace') {
|
|
|
27
27
|
// pantalla o grabar un video, y la ruta sigue siendo inequívoca
|
|
28
28
|
function shortPath(p) { return String(p || '').replace(/^[a-z]:[\\/]users[\\/][^\\/]+/i, '~').replace(/^\/(home|Users)\/[^/]+/, '~'); }
|
|
29
29
|
function esc(s) { return String(s ?? '').replace(/[&<>]/g, c => ({'&':'&','<':'<','>':'>'}[c])); }
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
function chatFilePath(value) {
|
|
31
|
+
let path = String(value).replace(/\\/g, '/').replace(/(?:#L\d+(?:C\d+)?|:\d+(?::\d+)?)$/, '');
|
|
32
|
+
const root = String(cfg.workspace || '').replace(/\\/g, '/').replace(/\/$/, '');
|
|
33
|
+
if (root && path.toLowerCase().startsWith(root.toLowerCase() + '/')) path = path.slice(root.length + 1);
|
|
34
|
+
path = path.replace(/^\.\//, '').replace(/^workspace\//, '');
|
|
35
|
+
if (!path || /\s/.test(path) || /^(?:[a-z][\w+.-]*:|\/|#)/i.test(path) || path.split('/').includes('..')) return '';
|
|
36
|
+
return /(?:^|\/)[^/]+\.(?:syn|fsyn|md|mdx|txt|json|jsonl|csv|tsv|html?|css|[cm]?js|jsx|tsx?|py|rs|go|toml|ya?ml|xml|sql|sh|ps1|log|pdf|png|jpe?g|svg|webp|xlsx?|docx?|zip)(?::\d+)?$/i.test(path) ? path : '';
|
|
37
|
+
}
|
|
38
|
+
function chatLink(label, target) {
|
|
39
|
+
const attr = s => esc(s).replace(/"/g, '"').replace(/'/g, ''');
|
|
40
|
+
if (/^https?:\/\/[^\s<>]+$/i.test(target)) return `<a href="${attr(target)}" target="_blank" rel="noopener noreferrer">${label}</a>`;
|
|
41
|
+
const path = chatFilePath(target);
|
|
42
|
+
const pos = String(target).match(/(?:#L|:)(\d+)(?:(?:C|:)(\d+))?$/);
|
|
43
|
+
return path ? `<a href="#" data-chat-file="${attr(path)}"${pos ? ` data-chat-line="${Number(pos[1])}" data-chat-column="${Number(pos[2] || 1)}"` : ''}>${label}</a>` : label;
|
|
41
44
|
}
|
|
42
45
|
// un bloque en el chat: 'user' | 'assistant' | 'step' | 'meta' | 'denied' | 'approval' | 'working'
|
|
43
46
|
function add(cls, html) { showPane('log'); log.classList.remove('hero'); const d = document.createElement('div'); d.className = 'msg ' + cls; d.innerHTML = html; log.appendChild(d); $('#stage').scrollTop = $('#stage').scrollHeight; return d; }
|
package/public/js/editor.js
CHANGED
|
@@ -33,7 +33,7 @@ function langOf(path) {
|
|
|
33
33
|
const i = base.lastIndexOf('.'); const ext = i >= 0 ? base.slice(i + 1) : '';
|
|
34
34
|
return LANG_BY_EXT[ext] || 'plaintext';
|
|
35
35
|
}
|
|
36
|
-
// código en un bloque ``` del chat (
|
|
36
|
+
// código en un bloque ``` del chat (markdown.js): resaltado si el fence trae un lenguaje conocido
|
|
37
37
|
function hlCode(code, lang) {
|
|
38
38
|
if (typeof hljs === 'undefined') return esc(code);
|
|
39
39
|
const l = String(lang || '').toLowerCase(); const name = LANG_BY_EXT[l] || (l && hljs.getLanguage(l) ? l : '');
|
|
@@ -125,6 +125,16 @@ function edOpen(d) {
|
|
|
125
125
|
eta.scrollTop = 0; eta.scrollLeft = 0; edSync();
|
|
126
126
|
if (!ED.readonly) eta.focus({ preventScroll: true });
|
|
127
127
|
}
|
|
128
|
+
function edGoTo(line, column = 1) {
|
|
129
|
+
const lines = eta.value.split('\n');
|
|
130
|
+
const index = Math.max(0, Math.min(lines.length - 1, Math.floor(Number(line) || 1) - 1));
|
|
131
|
+
const col = Math.max(0, Math.min(lines[index].length, Math.floor(Number(column) || 1) - 1));
|
|
132
|
+
let offset = col;
|
|
133
|
+
for (let i = 0; i < index; i++) offset += lines[i].length + 1;
|
|
134
|
+
eta.focus({ preventScroll: true }); eta.setSelectionRange(offset, offset);
|
|
135
|
+
const height = parseFloat(getComputedStyle(eta).lineHeight) || 21;
|
|
136
|
+
eta.scrollTop = Math.max(0, index * height - eta.clientHeight / 3); edSync();
|
|
137
|
+
}
|
|
128
138
|
function edStash() { if (!ED.path) return; if (ED.dirty) drafts.set(ED.path, eta.value); else drafts.delete(ED.path); }
|
|
129
139
|
// cierra el editor (✕ del visor, tras confirmar si había cambios); el visor vuelve a su <pre> de texto
|
|
130
140
|
function edClose(discard) {
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Marked + DOMPurify are vendored: rendering needs no CDN or network connection.
|
|
2
|
+
let chatMarkdown;
|
|
3
|
+
function md(src) {
|
|
4
|
+
if (typeof marked === 'undefined' || typeof DOMPurify === 'undefined') return '<p>' + esc(src) + '</p>';
|
|
5
|
+
if (!chatMarkdown) {
|
|
6
|
+
let inLink = false;
|
|
7
|
+
const filePattern = /^(?:[A-Za-z]:[\\/])?[\w./\\-]+\.(?:syn|fsyn|md|mdx|txt|json|jsonl|csv|tsv|html?|css|[cm]?js|jsx|tsx?|py|rs|go|toml|ya?ml|xml|sql|sh|ps1|log|pdf|png|jpe?g|svg|webp|xlsx?|docx?|zip)(?::\d+(?::\d+)?|#L\d+(?:C\d+)?)?(?![\w.])/i;
|
|
8
|
+
chatMarkdown = new marked.Marked({
|
|
9
|
+
gfm: true, breaks: true,
|
|
10
|
+
renderer: {
|
|
11
|
+
html({ text }) { return esc(text); },
|
|
12
|
+
link({ href, tokens }) {
|
|
13
|
+
const previous = inLink; inLink = true;
|
|
14
|
+
let label;
|
|
15
|
+
try { label = this.parser.parseInline(tokens); } finally { inLink = previous; }
|
|
16
|
+
return chatLink(label, href);
|
|
17
|
+
},
|
|
18
|
+
image({ text, href }) { return chatLink(esc(text || href), href); },
|
|
19
|
+
codespan({ text }) {
|
|
20
|
+
const label = '<code>' + esc(text) + '</code>';
|
|
21
|
+
return inLink ? label : chatLink(label, text);
|
|
22
|
+
},
|
|
23
|
+
code({ text, lang }) {
|
|
24
|
+
const language = String(lang || '').split(/\s+/)[0];
|
|
25
|
+
const highlighted = typeof hlCode === 'function' ? hlCode(text, language) : esc(text);
|
|
26
|
+
return '<div class="chat-code"><div class="chat-code-bar"><span>' + esc(language || 'texto') +
|
|
27
|
+
'</span><button type="button" data-copy-code aria-label="Copiar código">Copiar</button></div><pre><code class="hljs">' + highlighted + '</code></pre></div>\n';
|
|
28
|
+
},
|
|
29
|
+
table(token) {
|
|
30
|
+
return '<div class="chat-table" role="region" aria-label="Tabla" tabindex="0">' + marked.Renderer.prototype.table.call(this, token) + '</div>';
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
extensions: [{
|
|
34
|
+
name: 'chatFile', level: 'inline',
|
|
35
|
+
start(src) { const m = /(?:^|[\s(])(?=(?:[A-Za-z]:[\\/])?[\w./\\-]+\.[a-z])/i.exec(src); return m ? m.index + m[0].length : undefined; },
|
|
36
|
+
tokenizer(src) {
|
|
37
|
+
const m = filePattern.exec(src);
|
|
38
|
+
if (m && chatFilePath(m[0])) return { type: 'chatFile', raw: m[0], text: m[0] };
|
|
39
|
+
},
|
|
40
|
+
renderer(token) { return inLink ? esc(token.text) : chatLink(esc(token.text), token.text); },
|
|
41
|
+
}],
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return DOMPurify.sanitize(chatMarkdown.parse(String(src ?? '')), {
|
|
45
|
+
ALLOWED_TAGS: ['p', 'br', 'strong', 'b', 'em', 'i', 'del', 's', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'blockquote', 'hr', 'a', 'pre', 'code', 'span', 'div', 'button', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 'input'],
|
|
46
|
+
ALLOWED_ATTR: ['href', 'target', 'rel', 'class', 'type', 'disabled', 'checked', 'start', 'align', 'role', 'tabindex', 'aria-label', 'data-chat-file', 'data-chat-line', 'data-chat-column', 'data-copy-code'],
|
|
47
|
+
ALLOW_DATA_ATTR: false,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async function copyChatCode(button) {
|
|
51
|
+
const code = button.closest('.chat-code').querySelector('pre code').textContent;
|
|
52
|
+
try {
|
|
53
|
+
if (navigator.clipboard && window.isSecureContext) await navigator.clipboard.writeText(code);
|
|
54
|
+
else {
|
|
55
|
+
const field = document.createElement('textarea'); field.value = code;
|
|
56
|
+
field.style.cssText = 'position:fixed;opacity:0;pointer-events:none'; document.body.appendChild(field);
|
|
57
|
+
const focused = document.activeElement;
|
|
58
|
+
try { field.select(); if (!document.execCommand('copy')) throw new Error('copy'); }
|
|
59
|
+
finally { field.remove(); if (focused) focused.focus({ preventScroll: true }); }
|
|
60
|
+
}
|
|
61
|
+
button.textContent = 'Copiado';
|
|
62
|
+
} catch (_) { button.textContent = 'No se pudo copiar'; }
|
|
63
|
+
setTimeout(() => { button.textContent = 'Copiar'; }, 2000);
|
|
64
|
+
}
|
|
65
|
+
log.addEventListener('click', ev => {
|
|
66
|
+
const button = ev.target.closest('button[data-copy-code]');
|
|
67
|
+
if (button) { ev.preventDefault(); copyChatCode(button); return; }
|
|
68
|
+
const link = ev.target.closest('a[data-chat-file]');
|
|
69
|
+
if (!link) return;
|
|
70
|
+
ev.preventDefault();
|
|
71
|
+
openFile(link.dataset.chatFile, null, { line: Number(link.dataset.chatLine || 1), column: Number(link.dataset.chatColumn || 1) });
|
|
72
|
+
});
|
package/public/js/tree.js
CHANGED
|
@@ -242,7 +242,7 @@ function showMenu(x, y, e, only) {
|
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
// abre el archivo en el editor (js/editor.js): colores por tipo de archivo, Ctrl+S guarda. El <pre> #vbody queda para logs.
|
|
245
|
-
async function openFile(path, row) {
|
|
245
|
+
async function openFile(path, row, position) {
|
|
246
246
|
document.querySelectorAll('.row.active').forEach(x => x.classList.remove('active')); if (row) row.classList.add('active');
|
|
247
247
|
const r = await fetch(BASE + '/api/file?path=' + encodeURIComponent(path)); const d = await r.json();
|
|
248
248
|
if (!r.ok) { viewerNotice(path, 'no se pudo abrir', String(d.error || 'error')); return; }
|
|
@@ -251,6 +251,7 @@ async function openFile(path, row) {
|
|
|
251
251
|
$('#vpath').textContent = d.path; $('#vbody').className = '';
|
|
252
252
|
edOpen(d);
|
|
253
253
|
showPane('viewer'); $('#stage').scrollTop = 0;
|
|
254
|
+
if (position) edGoTo(position.line, position.column);
|
|
254
255
|
}
|
|
255
256
|
// avisos del visor (binario, error al abrir): en el propio visor, no como mensaje en el chat
|
|
256
257
|
function viewerNotice(path, meta, text) { showText(path, meta, text, false); }
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Browser dependencies are stored locally so the UI works without a CDN.
|
|
2
|
+
|
|
3
|
+
Markdown rendering:
|
|
4
|
+
|
|
5
|
+
- Marked 18.4.0: `https://cdn.jsdelivr.net/npm/marked@18.4.0/lib/marked.umd.js` (MIT, see marked.LICENSE).
|
|
6
|
+
- DOMPurify 3.5.0: `https://cdn.jsdelivr.net/npm/dompurify@3.5.0/dist/purify.min.js` (see dompurify.LICENSE).
|
|
7
|
+
|
|
8
|
+
When upgrading, replace the pinned build and license together and run the chat Markdown tests.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# License information
|
|
2
|
+
|
|
3
|
+
## Contribution License Agreement
|
|
4
|
+
|
|
5
|
+
If you contribute code to this project, you are implicitly allowing your code
|
|
6
|
+
to be distributed under the MIT license. You are also implicitly verifying that
|
|
7
|
+
all code is your original work. `</legalese>`
|
|
8
|
+
|
|
9
|
+
## Marked
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
|
|
12
|
+
Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
The above copyright notice and this permission notice shall be included in
|
|
22
|
+
all copies or substantial portions of the Software.
|
|
23
|
+
|
|
24
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
25
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
26
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
27
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
28
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
29
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
30
|
+
THE SOFTWARE.
|
|
31
|
+
|
|
32
|
+
## Markdown
|
|
33
|
+
|
|
34
|
+
Copyright © 2004, John Gruber
|
|
35
|
+
http://daringfireball.net/
|
|
36
|
+
All rights reserved.
|
|
37
|
+
|
|
38
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
39
|
+
|
|
40
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
41
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
42
|
+
* Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
43
|
+
|
|
44
|
+
This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* marked v18.4.0 - a markdown parser
|
|
3
|
+
* Copyright (c) 2018-2026, MarkedJS. (MIT License)
|
|
4
|
+
* Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
|
|
5
|
+
* https://github.com/markedjs/marked
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* DO NOT EDIT THIS FILE
|
|
10
|
+
* The code in this file is generated from files in ./src/
|
|
11
|
+
*/
|
|
12
|
+
(function(g,f){if(typeof exports=="object"&&typeof module<"u"){module.exports=f()}else if("function"==typeof define && define.amd){define("marked",f)}else {g["marked"]=f()}}(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : this,function(){var exports={};var __exports=exports;var module={exports};
|
|
13
|
+
"use strict";var ge=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var rt=Object.prototype.hasOwnProperty;var st=(l,e)=>{for(var t in e)ge(l,t,{get:e[t],enumerable:!0})},it=(l,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of nt(e))!rt.call(l,r)&&r!==t&&ge(l,r,{get:()=>e[r],enumerable:!(n=tt(e,r))||n.enumerable});return l};var ot=l=>it(ge({},"__esModule",{value:!0}),l);var On={};st(On,{Hooks:()=>A,Lexer:()=>P,Marked:()=>V,Parser:()=>y,Renderer:()=>L,TextRenderer:()=>D,Tokenizer:()=>C,defaults:()=>$,getDefaults:()=>j,lexer:()=>Rn,marked:()=>O,options:()=>gn,parse:()=>xn,parseInline:()=>mn,parser:()=>bn,setOptions:()=>kn,use:()=>Ye,walkTokens:()=>fn});module.exports=ot(On);function j(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $=j();function ke(l){$=l}var F={exec:()=>null};function N(l){let e=[];return t=>{let n=Math.max(0,Math.min(3,t-1)),r=e[n];return r||(r=l(n),e[n]=r),r}}function h(l,e=""){let t=typeof l=="string"?l:l.source,n={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(b.caret,"$1"),t=t.replace(r,o),n},getRegex:()=>new RegExp(t,e)};return n}var Me=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),Be="^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)",b={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|0{0,8}1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^( {1,3})(?:`{3}|~{3})/,beginningSpace:/^[ \t]{1,3}/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,multipleSpaceTabGlobal:/[ \t\r\n]+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,textIndentedContinuation:/^(?:\n(?: {4}| {0,3}\t)[ \t]*[^ \t\n][^\n]*)+/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)(\t[ \t]*)/gm,blockquoteFenceOpen:/^ {0,3}(`{3,}(?=[^`]*$)|~{3,})/,blockquoteFenceClose:/^ {0,3}(`{3,}|~{3,})[ \t]*$/,blockquoteListItemStart:/^ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|$)/,nestedBlockMarker:/^ {0,3}(?:(?:[*+-]|\d{1,9}[.)])(?: |$)|> ?)/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableHeader:new RegExp(Be+"(?:\\n|$)"),tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:N(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:N(l=>new RegExp(`^ {0,${l}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:N(l=>new RegExp(`^ {0,${l}}(?:\`{3,}(?=[^\`\\n]*(?:\\n|$))|~~~)`)),headingBeginRegex:N(l=>new RegExp(`^ {0,${l}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:N(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:N(l=>new RegExp(`^ {0,${l}}(?:</?(?:${xe})(?:[ \\t]+|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:N(l=>new RegExp(`^ {0,${l}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},at=/^(?:[ \t]*(?:\n|$))+/,lt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ut=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*)[ \t]*(?=\n|$)|$)/,te=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,me=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xe="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ne=h(" {0,3}(?:</?(?:tag)(?:[ \\t]+|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",xe).getRegex(),De=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?![ \t]*\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,qe=h(De).replace(/bull/g,me).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}(?=[^`\n]*(?:\n|$))|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/\|table/g,"").replace(/html/g,ne).getRegex(),ct=h(De).replace(/bull/g,me).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}(?=[^`\n]*(?:\n|$))|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).replace(/html/g,ne).getRegex(),be=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ht=/^[^\n]+/,Re=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,dt=h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<(?:\\.|[^\n<>\\])*>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Re).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),gt=h(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,me).getRegex(),Oe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,kt=h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*?[ \\t]*/?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Oe).replace("tag",xe).replace("attribute",/[ \t]+[a-zA-Z:_][\w.:-]*(?:[ \t]*=[ \t]*"[^"\n]*"|[ \t]*=[ \t]*'[^'\n]*'|[ \t]*=[ \t]*[^\s"'=<>`]+)?/).getRegex(),He=l=>h(be).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",l).replace("html",ne).getRegex(),ft=He(b.listInterruptsParagraph),mt=He(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Ae=/ {0,3}> ?(?:(?!blank)(paragraph)|[^\n]*)(?:\n|$)/,xt=h(/^(first)(?:next)*/).replace("first",h(Ae).replace("blank",/[ \t]*(?:\n|$)| {4}/).getRegex()).replace("next",h(Ae).replace("blank",/[ \t]*(?:\n|$)/).getRegex()).replace(/paragraph/g,mt).getRegex(),Te={blockquote:xt,code:lt,def:dt,fences:ut,heading:pt,hr:te,html:kt,lheading:qe,list:gt,newline:at,paragraph:ft,table:F,text:ht},bt=h(Be+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|0{0,8}1[.)])[ \\t]").replace("html",ne).getRegex(),Rt={...Te,lheading:ct,table:bt,paragraph:h(be).replace("hr",te).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",b.tableHeader).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",b.listInterruptsParagraph).replace("html",ne).getRegex()},Ot={...Te,html:h(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment",Oe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:F,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:h(be).replace("hr",te).replace("heading",` *#{1,6} *[^
|
|
14
|
+
]`).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").replace("lheading",qe).getRegex()},Tt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ve=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,Pt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,M=/[\p{P}\p{S}]/u,Q=/[\s\p{P}\p{S}]/u,re=/[^\s\p{P}\p{S}]/u,yt=h(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Q).getRegex(),St=/[\p{Pi}\p{Ps}"']/u,Ze=/(?!~)[\p{P}\p{S}]/u,_t=/(?!~)[\s\p{P}\p{S}]/u,$t=/(?:[^\s\p{P}\p{S}]|~)/u,Ct=h(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Me?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),je=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,It=h(je,"u").replace(/punct/g,M).getRegex(),Lt=h(je,"u").replace(/punct/g,Ze).getRegex(),At=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Et=h(At,"u").replace(/openQuote/g,St).replace(/punct/g,M).getRegex(),Ne="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",zt=h(Ne,"gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Q).replace(/punct/g,M).getRegex(),Mt=h(Ne,"gu").replace(/notPunctSpace/g,$t).replace(/punctSpace/g,_t).replace(/punct/g,Ze).getRegex(),Bt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Dt=h(Bt,"gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Q).replace(/punct/g,M).getRegex(),qt=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Q).replace(/punct/g,M).getRegex(),Ht="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",vt=h(Ht,"gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Q).replace(/punct/g,M).getRegex(),Zt=h(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,M).getRegex(),jt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Nt=h(jt,"gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Q).replace(/punct/g,M).getRegex(),Ft=h(/\\(punct)/,"gu").replace(/punct/g,M).getRegex(),Gt=h(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,M).getRegex(),Qt=h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Wt=h(Oe).replace("(?:-->|$)","-->").getRegex(),Ut=h("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Wt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Fe=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,le=h(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Fe).getRegex(),ue=/\\[^ \t\n\x00-\x1f]|\\(?=[ \t\n])|[^ \t\n\x00-\x1f\\()]/,Kt=h(/\((?:char)*\)/).replace("char",ue).getRegex(),Xt=h(/\((?:char|p1)*\)/).replace("char",ue).replace("p1",Kt).getRegex(),Vt=h(/\((?:char|p2)*\)/).replace("char",ue).replace("p2",Xt).getRegex(),Jt=h(/(?!<)(?:char|p3)+/).replace("char",ue).replace("p3",Vt).getRegex(),Yt=h(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",le).replace("href",h(/<(?:\\.|[^\n<>\\])*>|bareHref|(?=\))/).replace("bareHref",Jt).getRegex()).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),en=h(/^!?\[(label)\]\[(ref)\]/).replace("label",le).replace("ref",Re).getRegex(),tn=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",Re).getRegex(),Ee=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,nn=h(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Fe).getRegex(),rn=h("reflink|nolink(?!\\()","g").replace("reflink",h(/^!?\[(label)\]\[(ref)\]/).replace("label",nn).replace("ref",Ee).getRegex()).replace("nolink",h(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ee).getRegex()).getRegex(),ze=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sn=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,on=h(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,sn).getRegex(),we={_backpedal:F,anyPunctuation:Ft,anyPunctuationOutsideCode:Gt,autolink:Qt,blockSkip:Ct,br:ve,code:wt,del:F,delLDelim:F,delRDelim:F,emStrongLDelim:It,emStrongRDelimAst:zt,emStrongRDelimUnd:qt,escape:Tt,link:Yt,nolink:tn,punctuation:yt,reflink:en,reflinkSearch:rn,tag:Ut,text:Pt,url:F},an={...we,emStrongLDelim:Et,emStrongRDelimAst:Dt,emStrongRDelimUnd:vt,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",le).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",le).getRegex()},fe={...we,emStrongRDelimAst:Mt,emStrongLDelim:Lt,delLDelim:Zt,delRDelim:Nt,url:h(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",on).replace("protocol",ze).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:h(/^(?:[A-Za-z0-9.+-]+(?=@)|[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",ze).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",Me?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},ln={...fe,br:h(ve).replace("{2,}","*").getRegex(),text:h(fe.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},se={normal:Te,gfm:Rt,pedantic:Ot},W={normal:we,gfm:fe,breaks:ln,pedantic:an};var un={"&":"&","<":"<",">":">",'"':""","'":"'"},Ge=l=>un[l];function S(l,e){if(e){if(b.escapeTest.test(l))return l.replace(b.escapeReplace,Ge)}else if(b.escapeTestNoEncode.test(l))return l.replace(b.escapeReplaceNoEncode,Ge);return l}function We(l){return b.numericCharacterReference.test(l)?l.replace(b.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return"&";let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?"\uFFFD":r===38?"&":String.fromCodePoint(r)}):l}function Pe(l){try{l=encodeURI(l).replace(b.percentDecode,"%")}catch{return null}return l}function pe(l,e){let t=l.replace(b.findPipe,(s,o,i)=>{let a=!1,p=o;for(;--p>=0&&i[p]==="\\";)a=!a;return a?"|":" |"}),n=t.split(b.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(b.slashPipe,"|");return n}function B(l,e,t){let n=l.length;if(n===0)return"";let r=0;for(;r<n;){let s=l.charAt(n-r-1);if(s===e&&!t)r++;else if(s!==e&&t)r++;else break}return l.slice(0,n-r)}function ye(l){let e=l.split(`
|
|
15
|
+
`),t=e.length-1;for(;t>=0&&b.blankLine.test(e[t]);)t--;return e.length-t<=2?l:e.slice(0,t+1).join(`
|
|
16
|
+
`)}function K(l,e=!1){let t=e?b.multipleSpaceGlobal:b.multipleSpaceTabGlobal;return l.trim().replace(t," ").toLowerCase().toUpperCase().toLowerCase()}function Se(l,e){if(l.indexOf(e[0])===-1&&l.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<l.length;n++)if(l[n]==="\\")n++;else if(l[n]===e[0])t++;else if(l[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}var U=new WeakMap;function _e(l){let e={"*":-1,_:-1},t=-1,n=l.length;for(let r=0;r<n;r++){let s=l[r];if(s!=="*"&&s!=="_"&&s!=="~")continue;let o=r===0?`
|
|
17
|
+
`:l[r-1],i=r+1;for(;i<n&&l[i]===s;)i++;o!==" "&&o!==" "&&o!==`
|
|
18
|
+
`&&o!=="\r"&&o!=="\f"&&(s==="~"?t=r:e[s]=r),r=i-1}return{maskedSrc:l,lastPossibleEmStrongCloserIndex:e,lastPossibleDelCloserIndex:t}}function Ue(l,e){let t=_e(e),n=U.get(l);n?n.push(t):U.set(l,[t])}function Ke(l){let e=U.get(l);e&&(e.pop(),e.length===0&&U.delete(l))}function ce(l,e,t){let n=U.get(l)?.at(-1);return n&&n.maskedSrc===e?n.lastPossibleEmStrongCloserIndex[t]:_e(e).lastPossibleEmStrongCloserIndex[t]}function he(l,e){let t=U.get(l)?.at(-1);return t&&t.maskedSrc===e?t.lastPossibleDelCloserIndex:_e(e).lastPossibleDelCloserIndex}function X(l,e=0){let t=e,n="";for(let r of l)if(r===" "){let s=4-t%4;n+=" ".repeat(s),t+=s}else n+=r,t++;return n}function Xe(l){let e,t=!1;return l.map(n=>{if(t)return n;let{depth:r,expanded:s,keptIndent:o,content:i}=pn(n,e?.depth??1/0);if(e?.depth!==r&&(e=void 0),e){let p=b.blockquoteFenceClose.exec(i)?.[1];return!p||p[0]!==e.marker[0]||p.length<e.marker.length?o:(e=void 0,s)}if(t=b.blockquoteListItemStart.test(i),t)return n;let a=b.blockquoteFenceOpen.exec(i)?.[1];return a&&(e={marker:a,depth:r}),s}).join(`
|
|
19
|
+
`)}function pn(l,e){let t=0,n=0,r=0,s=0,o="";for(;r<e;){let u=t,d=n;for(;l[u]===" "||l[u]===" ";)d+=Qe(l[u],d),u++;if(l[u]!==">"||d-s>3)break;o+=" ".repeat(d-n)+">",r++,t=u+1,n=d+1,s=l[t]===" "||l[t]===" "?n+1:n}if(r===0)return{depth:r,expanded:l,keptIndent:l,content:l};let i="",a="";for(;(l[t]===" "||l[t]===" ")&&n<s+4;){let u=Qe(l[t],n);i+=" ".repeat(u),a+=n<s&&u>1?" ".repeat(u):l[t],n+=u,t++}let p=l.slice(t);return{depth:r,expanded:o+i+p,keptIndent:o+a+p,content:" ".repeat(Math.max(0,n-s))+p}}function Qe(l,e){return l===" "?4-e%4:1}function cn(l,e){let t="";for(let n=0;n<l.length;n++){if(l[n]==="`"){let r=e.inline.code.exec(l.slice(n));if(r){t+=r[0],n+=r[0].length-1;continue}}if(l[n]==="\\"&&(l[n+1]==="["||l[n+1]==="]")){t+=l[n+1],n++;continue}t+=l[n]}return t}function Ve(l,e,t,n,r){let s=e.href,o=e.title||null,i=cn(l[1],r),a=l[0].charAt(0)==="!",p=n.state.inLink,u=n.state.linkEmitted,d=n.state.inRawBlock;n.state.inLink=!0,n.state.linkEmitted=!1;let k=n.inlineTokens(i),g=n.state.linkEmitted;if(n.state.linkEmitted=u,n.state.inLink=p,!a){if(g){n.state.inRawBlock=d;return}n.state.linkEmitted=!0}return{type:a?"image":"link",raw:t,href:s,title:o,text:i,tokens:k}}function hn(l,e,t,n){let r=l.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1].length;return e.split(`
|
|
20
|
+
`).map(o=>{let i=o.match(t.other.beginningSpace);if(i===null)return o;let[a]=i,p=a.indexOf(" ");if(p!==-1&&p<s){if(n)return" ".repeat(4-s)+o.slice(p+1);if(l[s]==="~")return o}return o.slice(Math.min(a.length,s))}).join(`
|
|
21
|
+
`)}function Je(l,e,t,n){if(!e.includes("<"))return!1;for(let r=0;r<e.length;r++){if(e[r]==="\\"){r++;continue}if(e[r]==="`"){let i=n.inline.code.exec(e.slice(r));if(i){r+=i[0].length-1;continue}}if(e[r]!=="<")continue;let s=l.slice(t+r),o=n.inline.tag.exec(s)||n.inline.autolink.exec(s);if(o){if(o[0].length>e.length-r)return!0;r+=o[0].length-1}}return!1}var C=class{options;rules;lexer;constructor(e){this.options=e||$}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=this.options.pedantic?t[0]:ye(t[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=hn(n,t[3]||"",this.rules,this.lexer.state.top&&!this.lexer.state.inBlockquote);t[3]!==void 0&&(r===""||r.endsWith(`
|
|
22
|
+
`))&&(r+=`
|
|
23
|
+
`);let s=t[2];if(s){let o=0,i=s.length;for(;o<i&&(s[o]===" "||s[o]===" ");)o++;for(;i>o&&(s[i-1]===" "||s[i-1]===" ");)i--;s=s.slice(o,i).replace(this.rules.inline.anyPunctuation,"$1")}return{type:"code",raw:n,lang:s,text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=B(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceTabChar.test(r))&&(n=r.trim())}return{type:"heading",raw:B(t[0],`
|
|
24
|
+
`),depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:B(t[0],`
|
|
25
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=B(t[0],`
|
|
26
|
+
`).split(`
|
|
27
|
+
`),r="",s="",o=[];for(;n.length>0;){let i=!1,a=[],p;for(p=0;p<n.length;p++)if(this.rules.other.blockquoteStart.test(n[p]))a.push(n[p]),i=!0;else if(!i)a.push(n[p]);else break;n=n.slice(p);let u=a.join(`
|
|
28
|
+
`),k=(this.lexer.state.top&&!this.lexer.state.inBlockquote&&u.includes(" ")?Xe(a):u).replace(this.rules.other.blockquoteMarkerWhitespace,(w,f,m)=>m.startsWith(" ")?f+" "+m.slice(1):f+X(m,f.length)).replace(this.rules.other.blockquoteSetextReplace,`
|
|
29
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
30
|
+
${u}`:u,s=s?`${s}
|
|
31
|
+
${k}`:k;let g=this.lexer.state.top,c=this.lexer.state.inBlockquote,R=this.lexer.state.lastToken;if(this.lexer.state.top=!0,this.lexer.state.inBlockquote=!0,this.lexer.blockTokens(k,o,!0),this.lexer.state.top=g,this.lexer.state.inBlockquote=c,n.length===0)break;let x=o.at(-1);if(x?.type==="code"||x?.type==="heading"||x?.type==="hr"||x?.type==="html"||x?.type==="table")break;if(x?.type==="blockquote"){let w=x,f=n.join(`
|
|
32
|
+
`),m=w.raw+`
|
|
33
|
+
`+f.replace(this.rules.other.blockquoteSetextReplace2,"");this.lexer.state.inBlockquote=!0,this.lexer.state.lastToken=o.at(-2);let _=this.blockquote(m);this.lexer.state.inBlockquote=c,this.lexer.state.lastToken=R,o[o.length-1]=_;let T=m.substring(_.raw.length).replace(/^\n/,""),H=T?T.split(`
|
|
34
|
+
`).length:0,q=H?n.slice(0,-H):n;if(q.length>0&&(r=`${r}
|
|
35
|
+
${q.join(`
|
|
36
|
+
`)}`),s=s.substring(0,s.length-w.text.length)+_.text,n=n.slice(q.length),n.length>0&&this.rules.other.blockquoteStart.test(n[0]))continue;break}else if(x?.type==="list"){let w=x,f=w.raw+`
|
|
37
|
+
`+n.join(`
|
|
38
|
+
`);this.lexer.state.inBlockquote=!0,this.lexer.state.lastToken=o.at(-2);let m=this.list(f);this.lexer.state.top=g,this.lexer.state.inBlockquote=c,this.lexer.state.lastToken=R,o[o.length-1]=m;let _=m.raw.length>w.raw.length?f.slice(w.raw.length+1,m.raw.length).split(`
|
|
39
|
+
`).length:0;if(_>0){let T=n.slice(0,_).join(`
|
|
40
|
+
`);r=`${r}
|
|
41
|
+
${T}`,s=`${s}
|
|
42
|
+
${T}`}if(n=n.slice(_),n.length>0&&!this.rules.other.blockquoteStart.test(n[0]))break;continue}}return{type:"blockquote",raw:r,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){if(!this.options.pedantic&&this.lexer.state.lastToken?.type==="text"&&!this.rules.other.listInterruptsParagraph.test(e))return;let n=e,r=()=>n.length-e.length,s=t[1].trim(),o=s.length>1,i={type:"list",raw:"",ordered:o,start:o?+s.slice(0,-1):"",loose:!1,items:[]};s=o?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=o?s:"[*+-]");let a=this.rules.other.listItemRegex(s),p=!1;for(;e;){let g=!1,c="";if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;let R=r();e=e.substring(t[0].length);let x=t[2].split(`
|
|
43
|
+
`,1)[0],w=t[1].length,f=this.options.pedantic?X(x,w):x.replace(this.rules.other.leadingSpaceTab,q=>X(q,w)),m=e.split(`
|
|
44
|
+
`,1)[0],_=!f.trim(),T=0;if(this.options.pedantic?(T=2,c=f.trimStart()):_?T=w+1:(T=f.search(this.rules.other.nonSpaceChar),T=T>4?1:T,c=f.slice(T),f=c,T+=w),_&&this.rules.other.blankLine.test(m)&&(e=e.substring(m.length+1),g=!0),!g){let q=this.rules.other.nextBulletRegex(T),J=this.rules.other.hrRegex(T),ie=this.rules.other.fencesBeginRegex(T),Z=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(T):this.rules.other.headingBeginRegex(T),Y=this.rules.other.htmlBeginRegex(T),oe=this.rules.other.blockquoteBeginRegex(T),ae=!1;for(;e;){let Ce=e.split(`
|
|
45
|
+
`,1)[0],E;if(m=Ce,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),E=m):E=m.replace(this.rules.other.leadingSpaceTab,I=>X(I)),ie.test(m)||Z.test(m)||Y.test(m)||oe.test(m)||q.test(m)||J.test(m))break;if(E.search(this.rules.other.nonSpaceChar)>=T||!m.trim())c+=`
|
|
46
|
+
`+E.slice(T),ae=!1;else{if(_)break;let I=f;if(!this.options.pedantic&&!c.includes(`
|
|
47
|
+
`)&&!f.includes(" ")){let z;for(;!J.test(I)&&(z=this.rules.other.nestedBlockMarker.exec(I));)I=I.slice(z[0].length);if(!I.trim())break}if(I.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ie.test(I)||Z.test(I)||Y.test(I)||J.test(I))break;if(!this.options.pedantic&&!ae){let z=f.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(z)||this.rules.block.heading.test(z)||this.rules.block.hr.test(z))break}let Ie=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(m)&&this.rules.block.lheading.test(`${f}
|
|
48
|
+
${m}`)?` ${E.replace(/^ {0,3}/,"")}`:m,de=!this.options.pedantic&&!ae&&E.startsWith(" ")?this.rules.block.list.exec(f):null;if(de?.[2]){let z=de[1].length,Le=de[2].replace(this.rules.other.leadingSpaceTab,et=>X(et,z)),ee=Le.search(this.rules.other.nonSpaceChar);ee>0&&ee<=4&&!this.rules.other.nestedBlockMarker.test(Le.slice(ee))&&E.search(this.rules.other.nonSpaceChar)>=z+ee&&this.rules.other.listInterruptsParagraph.test(E.slice(z+ee))&&(Ie=` ${E}`)}c+=`
|
|
49
|
+
`+Ie,ae=!0}_=!m.trim(),e=e.substring(Ce.length+1),f=E.slice(T)}}let H=n.slice(R,r());i.loose||(p?i.loose=!0:this.rules.other.doubleBlankLine.test(H)&&(p=!0)),i.items.push({type:"list_item",raw:H,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]})}let u=i.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;i.raw=n.slice(0,r()).trimEnd();let d=[],k=this.lexer.state.top;for(let g of i.items)if(this.lexer.state.top=!1,d.push(this.lexer.inlineQueue.length),g.tokens=this.lexer.blockTokens(g.text,[]),!i.loose){let c=g.tokens.filter(x=>x.type==="space"),R=c.length>0&&c.some(x=>this.rules.other.anyLine.test(x.raw));i.loose=R}this.lexer.state.top=k;for(let g=0;g<i.items.length;g++){let c=i.items[g],R=c.tokens[0];if(c.task&&(R?.type==="text"||R?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),R.raw=R.raw.replace(this.rules.other.listReplaceTask,""),R.text=R.text.replace(this.rules.other.listReplaceTask,"");let x=this.lexer.inlineQueue;for(let f=d[g];f<x.length;f++)if(x[f].tokens===R.tokens){x[f].src=x[f].src.replace(this.rules.other.listReplaceTask,"");break}let w=this.rules.other.listTaskCheckbox.exec(c.raw);if(w){let f={type:"checkbox",raw:w[0]+" ",checked:w[0]!=="[ ]"};c.checked=f.checked,i.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=f.raw+c.tokens[0].raw,c.tokens[0].text=f.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(f)):c.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):c.tokens.unshift(f)}}else c.task&&(c.task=!1)}if(i.loose)for(let g of i.items){g.loose=!0;for(let c of g.tokens)c.type==="text"&&(c.type="paragraph")}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){if(this.lexer.state.lastToken?.type==="paragraph"&&!this.rules.other.htmlBeginRegex(4).test(e))return;let n=ye(t[0]);return{type:"html",block:!0,raw:n,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:n}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Se(t[2],"()")!==-1)return;let n=K(t[1],this.options.pedantic),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:B(t[0],`
|
|
50
|
+
`),href:r,title:s}}}table(e){let t,n;if(this.options.gfm&&!this.options.pedantic){let i=this.rules.other.tableHeader.exec(e);if(!i||!this.rules.other.tableDelimiter.test(i[2])||(t=pe(i[1]),n=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),t.length!==n.length))return}let r=this.rules.block.table.exec(e);if(!r||!this.rules.other.tableDelimiter.test(r[2]))return;t??=pe(r[1]),n??=r[2].replace(this.rules.other.tableAlignChars,"").split("|");let s=r[3]?.trim()?r[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
51
|
+
`):[],o={type:"table",raw:B(r[0],`
|
|
52
|
+
`),header:[],align:[],rows:[]};if(t.length===n.length){for(let i of n)this.rules.other.tableAlignRight.test(i)?o.align.push("right"):this.rules.other.tableAlignCenter.test(i)?o.align.push("center"):this.rules.other.tableAlignLeft.test(i)?o.align.push("left"):o.align.push(null);for(let i=0;i<t.length;i++)o.header.push({text:t[i],tokens:this.lexer.inline(t[i]),header:!0,align:o.align[i]});for(let i of s)o.rows.push(pe(i,o.header.length).map((a,p)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:o.align[p]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let n=t[1].trim();return{type:"heading",raw:B(t[0],`
|
|
53
|
+
`),depth:t[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
|
|
54
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t){let n=t[0],r=t[0],s=this.rules.other.textIndentedContinuation.exec(e.slice(n.length));return s&&(n+=s[0],r+=s[0].replace(this.rules.other.codeRemoveIndent,"")),{type:"text",raw:n,text:r,tokens:this.lexer.inline(r)}}}escape(e){if(e.charCodeAt(0)!==92)return;let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){if(e.charCodeAt(0)!==60)return;let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=e.charCodeAt(0);if(t!==91&&t!==33)return;let n=this.rules.inline.link.exec(e);if(n){let r=n[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Je(e,n[1],r,this.rules))return;let s=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let p=B(s.slice(0,-1),"\\");if((s.length-p.length)%2===0)return}else{let p=Se(n[2],"()");if(p===-2)return;if(p>-1){let d=(n[0].indexOf("!")===0?5:4)+n[1].length+p;n[2]=n[2].substring(0,p),n[0]=n[0].substring(0,d).trim(),n[3]=""}}let o=B(n[0].slice(0,-1),"\\");if((n[0].length-o.length)%2===0)return;let i=n[2],a="";if(this.options.pedantic){let p=this.rules.other.pedanticHrefTitle.exec(i);p&&(i=p[1],a=p[3])}else a=n[3]?n[3].slice(1,-1):"";return this.options.pedantic&&(i=i.trim()),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?i=i.slice(1):i=i.slice(1,-1)),Ve(n,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,t){let n=e.charCodeAt(0);if(n!==91&&n!==33)return;let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let s=r[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Je(e,r[1],s,this.rules))return;let o=t[K(r[2]||r[1],this.options.pedantic)];if(!o){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return Ve(r,o,r[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||!r[1]&&!r[2]&&!r[3]&&!r[4])return;let s=r[0][0],o=n===s,i=t.length-e.length,a=i;for(;!this.options.pedantic&&a>0&&t[a-1]===s;)a--;let p=[...t.slice(Math.max(0,a-2),a)].at(-1)??"",u=p==="*"||p==="_"||!!this.rules.inline.punctuation.exec(p);a<i&&(n=p);let d=a<i?u:n==="*"||n==="_"||!!this.rules.inline.punctuation.exec(n);if(r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))return;let k=r[1]||r[3]||"";if(!k||!n||d){let g=[...r[0]].length-1,c,R,x=g,w=0,f=i-a+g,m=!this.options.pedantic&&!!p.trim()&&(!!k||s==="*"&&!u);if(s!=="*"&&s!=="_")return;let _=s==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,T=ce(this,t,s),H=t.length-e.length+g;if(T<H)return;t=t.slice(-1*e.length+g);let q=T-H;for(_.lastIndex=0;(r=_.exec(t))!==null&&!(r.index>q);){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c)continue;R=[...c].length;let J=R>x-g;if(r[3]||r[4]){x+=R;continue}else if((r[5]||r[6]||m&&J)&&f%3&&!((f+R)%3)){if(o&&(r[5]||r[6]))break;w+=R;continue}if(x-=R,x>0)continue;R=Math.min(R,R+x+w);let ie=[...r[0]][0].length,Z=e.slice(0,g+r.index+ie+R);if(Math.min(g,R)%2){let oe=Z.slice(1,-1);return{type:"em",raw:Z,text:oe,tokens:this.lexer.inlineTokens(oe)}}let Y=Z.slice(2,-2);return{type:"strong",raw:Z,text:Y,tokens:this.lexer.inlineTokens(Y)}}}}codespan(e){if(e.charCodeAt(0)!==96)return;let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=e.charCodeAt(0);if(t!==32&&t!==92&&t!==10)return;let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e,t,n=""){if(e.charCodeAt(0)!==126)return;let r=this.rules.inline.delLDelim.exec(e);if(!r)return;if(!(r[1]||"")||!n||this.rules.inline.punctuation.exec(n)){let o=[...r[0]].length-1,i,a,p=o,u=this.rules.inline.delRDelim,d=he(this,t),k=t.length-e.length+o;if(d<k)return;t=t.slice(-1*e.length+o);let g=d-k;for(u.lastIndex=0;(r=u.exec(t))!==null&&!(r.index>g);){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==o))continue;if(r[3]||r[4]){p+=a;continue}if(p-=a,p>0)continue;a=Math.min(a,a+p);let c=[...r[0]][0].length,R=e.slice(0,o+r.index+c+a),x=R.slice(o,-o);return{type:"del",raw:R,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(e){if(e.charCodeAt(0)!==60)return;let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let n,r;if(t[2]==="@")n=t[0],r="mailto:"+n;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);n=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:n,href:r,autolink:!0,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:n?t[0]:We(t[0]),escaped:n}}}};var P=class l{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$,this.options.tokenizer=this.options.tokenizer||new C,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0,inBlockquote:!1};let t={other:b,block:se.normal,inline:W.normal};this.options.pedantic?(t.block=se.pedantic,t.inline=W.pedantic):this.options.gfm&&(t.block=se.gfm,this.options.breaks?t.inline=W.breaks:t.inline=W.gfm),this.tokenizer.rules=t}static get rules(){return{block:se,inline:W}}static lex(e,t){return new l(t).lex(e)}static lexInline(e,t){let n=new l(t);return e.includes("\r")&&(e=e.replace(b.carriageReturn,`
|
|
55
|
+
`)),n.inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
|
|
56
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let n=this.inlineQueue[t];this.state.inRawBlock=!1,this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this;let r=this.state.lastToken;this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));let s=1/0,o,i=this.options.gfm&&!this.options.pedantic&&this.tokenizer.paragraph===C.prototype.paragraph;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}this.state.lastToken=t.at(-1);let a;if(this.options.extensions?.block?.some(u=>(a=u.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let u=t.at(-1);a.raw.length===1&&u!==void 0?u.raw+=`
|
|
57
|
+
`:t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let u=t.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
58
|
+
`)?"":`
|
|
59
|
+
`)+a.raw,u.text+=`
|
|
60
|
+
`+a.text,this.inlineQueue.at(-1).src=u.text):t.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let u=t.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
61
|
+
`)?"":`
|
|
62
|
+
`)+a.raw,u.text+=`
|
|
63
|
+
`+a.raw,this.inlineQueue.at(-1).src=u.text):(this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title}),t.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),t.push(a);continue}let p=e;if(this.options.extensions?.startBlock){let u=1/0,d=e.slice(1),k;this.options.extensions.startBlock.forEach(g=>{k=g.call({lexer:this},d),typeof k=="number"&&k>=0&&(u=Math.min(u,k))}),u<1/0&&u>=0&&(p=e.substring(0,u+1))}if(this.state.top&&(a=this.tokenizer.paragraph(p))){let u=t.at(-1);(n||u===o&&i)&&u?.type==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
64
|
+
`)?"":`
|
|
65
|
+
`)+a.raw,u.text+=`
|
|
66
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text,o=u):(t.push(a),o=a),n=p.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let u=t.at(-1);u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
67
|
+
`)?"":`
|
|
68
|
+
`)+a.raw,u.text+=`
|
|
69
|
+
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=r,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes("["))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!=="!")return!0;for(let n of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let r=n[0],s=r.lastIndexOf("[");if(!(r.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,K(r.slice(s+1,-1),this.options.pedantic)))&&!(s>1&&this.linkInText(r.slice(1,s-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=e.includes(")");try{return this.#t(e,t)}finally{this.state.linkParenPossible=n}}#t(e,t){let n=e.includes("*")||e.includes("_")||e.includes("~"),r=n||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==C.prototype.emStrong||this.tokenizer.del!==C.prototype.del?this.#r(e):e;if(!n)return this.#e(e,r,t);Ue(this.tokenizer,r);try{return this.#e(e,r,t)}finally{Ke(this.tokenizer)}}#e(e,t,n){let r=!1,s="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(s=""),r=!1;let i;if(this.options.extensions?.inline?.some(u=>(i=u.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length);let u=n.at(-1);i.type==="text"&&u?.type==="text"?(u.raw+=i.raw,u.text+=i.text):n.push(i);continue}let a=e[0];if(a==="*"||a==="_"){let u=t.length-e.length;if(ce(this.tokenizer,t,a)<=u){let k=1;for(;k<e.length&&e.charCodeAt(k)===a.charCodeAt(0);)k++;let g=e.substring(0,k),c=n.at(-1);c?.type==="text"&&!c.escaped?(c.raw+=g,c.text+=g):n.push({type:"text",raw:g,text:g,escaped:!1}),e=e.substring(k),s=a,r=!0;continue}}else if(a==="~"){let u=t.length-e.length;if(he(this.tokenizer,t)<=u){let k=1;for(;k<e.length&&e.charCodeAt(k)===126;)k++;let g=e.substring(0,k),c=n.at(-1);c?.type==="text"&&!c.escaped?(c.raw+=g,c.text+=g):n.push({type:"text",raw:g,text:g,escaped:!1}),e=e.substring(k),s=a,r=!0;continue}}if(i=this.tokenizer.emStrong(e,t,s)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.del(e,t,s)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.autolink(e)){e=e.substring(i.raw.length),n.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e))){e=e.substring(i.raw.length),n.push(i);continue}let p=e;if(this.options.extensions?.startInline){let u=1/0,d=e.slice(1),k;this.options.extensions.startInline.forEach(g=>{k=g.call({lexer:this},d),typeof k=="number"&&k>=0&&(u=Math.min(u,k))}),u<1/0&&u>=0&&(p=e.substring(0,u+1))}if(i=this.tokenizer.inlineText(p)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(s=i.raw.slice(-1)),r=!0;let u=n.at(-1);u?.type==="text"?(u.raw+=i.raw,u.text+=i.text):n.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}#n(e){let{blockSkip:t,tag:n,autolink:r}=this.tokenizer.rules.inline,s="",o=0,i;for(t.lastIndex=0;i=t.exec(e);){let a=i.index+(i[2]?i[2].length:0),p=i.index+i[0].length;if(e.charAt(a)==="<"){let u=e.slice(a),d=n.exec(u)||r.exec(u);if(!d){t.lastIndex=a+1;continue}p=a+d[0].length,t.lastIndex=p}s+=e.slice(o,a)+"["+"a".repeat(p-a-2)+"]",o=p}return s+e.slice(o)}#r(e){let t=e;if(this.tokens.links&&e.includes("[")){let n=this.tokenizer.rules.inline.reflinkSearch,r=s=>{let o=s.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,K(s.slice(o+1,-1),this.options.pedantic)))return s;if(o>1&&s.charAt(0)!=="!"){let i=s.slice(1,o-1);if(this.linkInText(i))return"["+i.replace(n,r)+"]["+"a".repeat(s.length-o-2)+"]"}return"["+"a".repeat(s.length-2)+"]"};t=t.replace(n,r)}return t=t.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(n,r,s)=>s?"+".repeat(n.length):r?r+n.slice(r.length,-r.length).replace(/`/g,"+")+r:n),t=this.#n(t),t=this.options.hooks?.emStrongMask?.call({lexer:this},t)??t,t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}};function $e(l,e=!1){let t;for(let n=0;n<l.length;n++){let r=l[n],s=r;if(r.type==="codespan"||r.type==="escape"||e&&r.type==="text"){let o=S(r.text,!0);o!==r.text&&(s={...r,text:o})}else if(r.type==="link"&&r.autolink){let o=S(r.text,!0),i=r.tokens,a=i&&(i.length===1&&i[0].type==="text"&&i[0].text===r.text?o!==r.text?[{...i[0],text:o}]:i:$e(i,!0));(o!==r.text||a!==i)&&(s=a!==i?{...r,text:o,tokens:a}:{...r,text:o})}else if("tokens"in r&&r.tokens){let o=$e(r.tokens,e);o!==r.tokens&&(s={...r,tokens:o})}s!==r?(t||(t=l.slice(0,n)),t.push(s)):t&&t.push(r)}return t||l}var L=class{options;parser;constructor(e){this.options=e||$}space(e){return""}code({text:e,lang:t,escaped:n}){let r=(t||"").trim().match(b.notSpaceStart)?.[0],s=e?e.replace(b.endingNewline,"")+`
|
|
70
|
+
`:"";return r?'<pre><code class="language-'+S(r)+'">'+(n?s:S(s,!0))+`</code></pre>
|
|
71
|
+
`:"<pre><code>"+(n?s:S(s,!0))+`</code></pre>
|
|
72
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
73
|
+
${this.parser.parse(e)}</blockquote>
|
|
74
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
75
|
+
`}hr(e){return`<hr>
|
|
76
|
+
`}list(e){let t=e.ordered,n=e.start,r="";for(let i=0;i<e.items.length;i++){let a=e.items[i];r+=this.listitem(a)}let s=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+s+o+`>
|
|
77
|
+
`+r+"</"+s+`>
|
|
78
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
79
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
80
|
+
`}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){let o=e.rows[s];n="";for(let i=0;i<o.length;i++)n+=this.tablecell(o[i]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
81
|
+
<thead>
|
|
82
|
+
`+t+`</thead>
|
|
83
|
+
`+r+`</table>
|
|
84
|
+
`}tablerow({text:e}){return`<tr>
|
|
85
|
+
${e}</tr>
|
|
86
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
87
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${S(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:s}){let o=s?S(n,!0):this.parser.parseInline(r),i=Pe(e);if(i===null)return o;e=S(i,s);let a='<a href="'+e+'"';return t&&(a+=' title="'+S(t)+'"'),a+=">"+o+"</a>",a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline($e(r),this.parser.textRenderer));let s=Pe(e);if(s===null)return S(n);e=s;let o=`<img src="${S(e)}" alt="${S(n)}"`;return t&&(o+=` title="${S(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:S(e.text)}};var D=class{parser;strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return`
|
|
88
|
+
`}checkbox({raw:e}){return e}};var y=class l{options;renderer;textRenderer;constructor(e){this.options=e||$,this.options.renderer=this.options.renderer||new L,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new D,this.textRenderer.parser=this}static parse(e,t){return new l(t).parse(e)}static parseInline(e,t){return new l(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n],s=this.options.extensions?.renderers;if(s&&Object.hasOwn(s,r.type)&&s[r.type]){let i=r,a=s[i.type].call({parser:this},i);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(i.type)){t+=a===!1?"":a??"";continue}}let o=r;switch(o.type){case"space":{t+=this.renderer.space(o);break}case"hr":{t+=this.renderer.hr(o);break}case"heading":{t+=this.renderer.heading(o);break}case"code":{t+=this.renderer.code(o);break}case"table":{t+=this.renderer.table(o);break}case"blockquote":{t+=this.renderer.blockquote(o);break}case"list":{t+=this.renderer.list(o);break}case"checkbox":{t+=this.renderer.checkbox(o);break}case"html":{t+=this.renderer.html(o);break}case"def":{t+=this.renderer.def(o);break}case"paragraph":{t+=this.renderer.paragraph(o);break}case"text":{t+=this.renderer.text(o);break}default:{let i='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let s=e[r],o=this.options.extensions?.renderers;if(o&&Object.hasOwn(o,s.type)&&o[s.type]){let a=o[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(s.type)){n+=a===!1?"":a??"";continue}}let i=s;switch(i.type){case"escape":{n+=t.text(i);break}case"html":{n+=t.html(i);break}case"link":{n+=t.link(i);break}case"image":{n+=t.image(i);break}case"checkbox":{n+=t.checkbox(i);break}case"strong":{n+=t.strong(i);break}case"em":{n+=t.em(i);break}case"codespan":{n+=t.codespan(i);break}case"br":{n+=t.br(i);break}case"del":{n+=t.del(i);break}case"text":{n+=t.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}};var A=class{options;block;constructor(e){this.options=e||$}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?P.lex:P.lexInline}provideParser(e=this.block){return e?y.parse:y.parseInline}};function v(l,e){if(Array.isArray(e))for(let t=0;t<e.length;t++)l.push(e[t]);else l.push(e)}var V=class{defaults=j();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=y;Renderer=L;TextRenderer=D;Lexer=P;Tokenizer=C;Hooks=A;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(v(n,t.call(this,r)),r.type){case"table":{let s=r;for(let o of s.header)v(n,this.walkTokens(o.tokens,t));for(let o of s.rows)for(let i of o)v(n,this.walkTokens(i.tokens,t));break}case"list":{let s=r;v(n,this.walkTokens(s.items,t));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{if(s[o]){let i=s[o].flat(1/0);v(n,this.walkTokens(i,t))}}):s.tokens&&v(n,this.walkTokens(s.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s&&s.renderer){let o=s.renderer,i=t.renderers[s.name];i?t.renderers[s.name]=function(...a){let p=o.apply(this,a);return p===!1&&(p=i.apply(this,a)),p}:t.renderers[s.name]=o}if("tokenizer"in s&&s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){let s=this.defaults.renderer||new L(this.defaults);for(let o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,a=n.renderer[i];if(a===void 0)continue;let p=s[i];s[i]=(...u)=>{let d=a.apply(s,u);return d===!1&&(d=p.apply(s,u)),d===!1?"":d??""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new C(this.defaults);for(let o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,a=n.tokenizer[i];if(a===void 0)continue;let p=s[i];s[i]=(...u)=>{let d=a.apply(s,u);return d===!1&&(d=p.apply(s,u)),d}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new A;for(let o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,a=n.hooks[i];if(a===void 0)continue;let p=s[i];A.passThroughHooks.has(o)?s[i]=u=>{if(s.options.async&&A.passThroughHooksRespectAsync.has(o))return(async()=>{let k=await a.call(s,u);return p.call(s,k)})();let d=a.call(s,u);return p.call(s,d)}:s[i]=(...u)=>{if(s.options.async)return(async()=>{let k=await a.apply(s,u);return k===!1&&(k=await p.apply(s,u)),k})();let d=a.apply(s,u);return d===!1&&(d=p.apply(s,u)),d}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(i){let a=[];return v(a,o.call(this,i)),s&&v(a,s.call(this,i)),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return P.lex(e,t??this.defaults)}parser(e,t){return y.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{let s={...r},o={...this.defaults,...s},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let a=o.hooks?await o.hooks.preprocess(n):n,u=await(o.hooks?await o.hooks.provideLexer(e):e?P.lex:P.lexInline)(a,o),d=o.hooks?await o.hooks.processAllTokens(u):u;o.walkTokens&&await Promise.all(this.walkTokens(d,o.walkTokens));let g=await(o.hooks?await o.hooks.provideParser(e):e?y.parse:y.parseInline)(d,o);return o.hooks?await o.hooks.postprocess(g):g})().catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let p=(o.hooks?o.hooks.provideLexer(e):e?P.lex:P.lexInline)(n,o);o.hooks&&(p=o.hooks.processAllTokens(p)),o.walkTokens&&this.walkTokens(p,o.walkTokens);let d=(o.hooks?o.hooks.provideParser(e):e?y.parse:y.parseInline)(p,o);return o.hooks&&(d=o.hooks.postprocess(d)),d}catch(a){return i(a)}}}onError(e,t){return n=>{let r=n instanceof Error?n:new Error(String(n));if(r.message+=`
|
|
89
|
+
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+S(r.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(r);throw r}}};var G=new V;function O(l,e){return G.parse(l,e)}function dn(l,e){return G.parseInline(l,e)}O.options=O.setOptions=function(l){return G.setOptions(l),O.defaults=G.defaults,ke(O.defaults),O};O.getDefaults=j;O.defaults=$;function Ye(...l){return G.use(...l),O.defaults=G.defaults,ke(O.defaults),O}O.use=Ye;O.walkTokens=function(l,e){return G.walkTokens(l,e)};O.parseInline=dn;O.Parser=y;O.parser=y.parse;O.Renderer=L;O.TextRenderer=D;O.Lexer=P;O.lexer=P.lex;O.Tokenizer=C;O.Hooks=A;O.parse=O;var gn=O.options,kn=O.setOptions,fn=O.walkTokens,mn=O.parseInline,xn=O,bn=y.parse,Rn=P.lex;
|
|
90
|
+
|
|
91
|
+
if(__exports != exports)module.exports = exports;return module.exports}));
|
|
92
|
+
//# sourceMappingURL=marked.umd.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*! @license DOMPurify 3.5.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.5.0/LICENSE */
|
|
2
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.DOMPurify=t())})(this,function(){"use strict";function e(e,t){this.v=e,this.k=t}function t(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e){if(Array.isArray(e))return e}function r(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function i(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
|
|
4
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
5
|
+
function a(e,t){return n(e)||r(e,t)||o(e,t)||i()}function o(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}function s(t){var n,r;function i(n,r){try{var o=t[n](r),s=o.value,c=s instanceof e;Promise.resolve(c?s.v:s).then(function(e){if(c){var r=n===`return`&&s.k?n:`next`;if(!s.k||e.done)return i(r,e);e=t[r](e).value}a(!!o.done,e)},function(e){i(`throw`,e)})}catch(e){a(2,e)}}function a(e,t){e===2?n.reject(t):n.resolve({value:t,done:e}),(n=n.next)?i(n.key,n.arg):r=null}this._invoke=function(e,t){return new Promise(function(a,o){var s={key:e,arg:t,resolve:a,reject:o,next:null};r?r=r.next=s:(n=r=s,i(e,t))})},typeof t.return!=`function`&&(this.return=void 0)}s.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},s.prototype.next=function(e){return this._invoke(`next`,e)},s.prototype.throw=function(e){return this._invoke(`throw`,e)},s.prototype.return=function(e){return this._invoke(`return`,e)};let c=Object.entries,l=Object.keys,u=Object.setPrototypeOf,d=Object.isFrozen,f=Object.getPrototypeOf,p=Object.getOwnPropertyDescriptor,m=Object.freeze,h=Object.seal,g=Object.create,ee=typeof Reflect<`u`&&Reflect,te=ee.apply,ne=ee.construct;m||(m=function(e){return e}),h||(h=function(e){return e}),te||(te=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)}),ne||(ne=function(e){return new e(...[...arguments].slice(1))});let _=E(Array.prototype.forEach),re=E(Array.prototype.lastIndexOf),ie=E(Array.prototype.pop),ae=E(Array.prototype.push),oe=E(Array.prototype.slice),se=E(Array.prototype.splice),ce=Array.isArray,le=Ce(Set),ue=E(Set.prototype.add),de=E(Set.prototype.has),fe=E(Set.prototype.delete),pe=Ce(Map),me=E(Map.prototype.get),he=E(Map.prototype.set),v=E(String.prototype.toLowerCase),ge=E(String.prototype.toString),_e=E(String.prototype.match),ve=E(String.prototype.replace),ye=E(String.prototype.indexOf),be=E(String.prototype.trim),xe=E(Number.prototype.toString),y=E(Boolean.prototype.toString),b=typeof BigInt>`u`?null:E(BigInt.prototype.toString),Se=typeof Symbol>`u`?null:E(Symbol.prototype.toString),x=E(Object.prototype.hasOwnProperty),S=E(Object.prototype.toString),C=RegExp.prototype.test,w=function(e,t){return e instanceof RegExp&&(e.lastIndex=0),te(C,e,[t])},T=Ce(TypeError);function E(e){return function(t){var n=[...arguments].slice(1);return te(e,t,n)}}function Ce(e){return function(){return ne(e,[...arguments])}}function D(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:v;if(u&&u(e,null),!ce(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(d(t)||(t[r]=e),i=e)}e[i]=!0}return e}function O(e){for(let t=0;t<e.length;t++)x(e,t)||(e[t]=null);return e}function we(e){let t=g(null);for(let r of c(e)){var n=a(r,2);let i=n[0],o=n[1];x(e,i)&&(t[i]=ce(o)?O(o):o&&typeof o==`object`&&o.constructor===Object?we(o):o)}return t}function Te(e){let t=g(null),n=l(e),r=n.length;for(;r--;)t[n[r]]=e[n[r]];return t}function Ee(e){switch(typeof e){case`string`:return e;case`number`:return xe(e);case`boolean`:return y(e);case`bigint`:return b?b(e):`0`;case`symbol`:return Se?Se(e):`Symbol()`;case`undefined`:return S(e);case`function`:case`object`:{if(e===null)return S(e);let t=e,n=k(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:S(e)}return S(e)}default:return S(e)}}function k(e,t){for(;e!==null;){let n=p(e,t);if(n){if(n.get)return E(n.get);if(typeof n.value==`function`)return E(n.value)}e=f(e)}function n(){return null}return n}function De(e,t){for(;e!==null;){let n=p(e,t);if(n)return n.get?E(n.get):null;e=f(e)}return null}function Oe(e){if(!e)return!1;try{return w(e,``),!0}catch(e){return!1}}let ke=m(/* @__PURE__ */ `a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ae=m(/* @__PURE__ */ `svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.filter.font.g.glyph.glyphref.hkern.image.line.lineargradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),je=m([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Me=m([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ne=m(/* @__PURE__ */ `math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Pe=m([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Fe=m([`#text`]),Ie=m(/* @__PURE__ */ `accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Le=m(/* @__PURE__ */ `accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Re=m(/* @__PURE__ */ `accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ze=m([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Be=h(/{{[\w\W]*|^[\w\W]*}}/g),Ve=h(/<%[\w\W]*|^[\w\W]*%>/g),He=h(/\${[\w\W]*/g),Ue=h(/{{|}}|\${|<%|%>/),We=h(/[^\t\n\f\r ]/),Ge=h(/\u0000/g),Ke=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),qe=h(/^aria-[\-\w]+$/),Je=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ye=h(/^(?:\w+script|data):/i),Xe=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ze=h(/^html$/i),Qe=h(/^[a-z][.\w]*(-[.\w]+)+$/i),$e=h(/<[/\w!]/g),et=h(/<[/\w]/g),tt=h(/<[/\w]|^-?>|--!?>|<!-$/g),nt=h(/<\/no(script|embed|frames)/i),rt=h(/\/>/i),it=h(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),at=h(/^[\r\n\t ]+/),A={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},ot=m(D({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),st=m(D({},[`textarea`,`title`])),ct=m(D({},[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`embed`,`frame`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`])),lt=function(){return typeof window>`u`?null:window},ut=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch(e){return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},dt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},j=function(e,t,n,r){return x(e,t)&&ce(e[t])?D(r.base?Te(r.base):{},e[t],r.transform):n},ft=function(e,t,n){let r=x(e,t)?e[t]:void 0;return r&&typeof r==`object`?we(r):n};function pt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lt(),t=e=>pt(e);if(t.version=`3.5.0`,t.removed=[],!e||!e.document||e.document.nodeType!==A.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.HTMLTemplateElement,o=e.Node,s=e.Element,l=e.NodeFilter,u=e.DOMParser,d=e.trustedTypes,f=s.prototype,p=k(f,`cloneNode`),ee=k(f,`remove`),te=k(f,`removeChild`),ne=k(f,`removeAttributeNode`),xe=k(f,`nextSibling`),y=k(f,`childNodes`),b=k(f,`parentNode`),Se=k(f,`shadowRoot`),S=k(f,`attributes`),C=o&&o.prototype?k(o.prototype,`nodeType`):null,E=o&&o.prototype?k(o.prototype,`nodeName`):null,Ce=o&&o.prototype?k(o.prototype,`ownerDocument`):null,O=function(e){return C?C(e):e.nodeType},M=function(e){return E?E(e):e.nodeName},mt=De(f,`namespaceURI`),ht=function(e){return mt?mt(e):e.namespaceURI},gt=function(e){return O(e)===A.element?S(e):null};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let N,P=``,_t,vt=!1,yt=0,bt=function(){if(yt>0)throw T(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},xt=function(e){bt(),yt++;try{return N.createHTML(e)}finally{yt--}},St=function(e){return N&&$t?xt(e):e},Ct=function(e){bt(),yt++;try{return N.createScriptURL(e)}finally{yt--}},wt=function(){return vt||(_t=ut(d,i),vt=!0),_t},Tt=n,Et=Tt.implementation,Dt=Tt.createNodeIterator,Ot=Tt.createDocumentFragment,kt=Tt.getElementsByTagName,At=r.importNode,F=dt();t.isSupported=typeof c==`function`&&typeof b==`function`&&Et&&Et.createHTMLDocument!==void 0;let jt=Be,Mt=Ve,Nt=He,Pt=Ke,Ft=qe,It=Ye,Lt=Xe,Rt=Qe,zt=Je,I=null,Bt=D({},[...ke,...Ae,...je,...Ne,...Fe]),L=null,Vt=D({},[...Ie,...Le,...Re,...ze]),R=null,Ht=null,Ut=null,z=Object.seal(g(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Wt=!0,Gt=!0,Kt=!1,qt=!0,B=!1,V=!0,H=!1,Jt=!1,Yt=null,Xt=null,Zt=!1,U=!1,Qt=!1,$t=!1,en=!0,tn=!1,nn=`user-content-`,rn=!0,an=!1,W=null,G=null,K=!1,q=null,on=D({},/* @__PURE__ */ `annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),sn=null,cn=D({},[`audio`,`video`,`img`,`source`,`image`,`track`]),ln=null,un=D({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),dn=`http://www.w3.org/1998/Math/MathML`,fn=`http://www.w3.org/2000/svg`,J=`http://www.w3.org/1999/xhtml`,Y=J,pn=!1,mn=null,hn=D({},[dn,fn,J],ge),gn=m(D({},[`mi`,`mo`,`mn`,`ms`,`mtext`])),_n=null,vn=m(D({},[`annotation-xml`])),yn=null,bn=m(g(null)),xn=D({},[`title`,`style`,`font`,`a`,`script`]),X=null,Sn=[`application/xhtml+xml`,`text/html`],Z=null,Cn=null,wn=null,Tn=n.createElement(`form`),En=function(e){return e instanceof RegExp||e instanceof Function},Dn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e&&typeof e==`object`||(e={}),e=we(e),X=Sn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Z=X===`application/xhtml+xml`?ge:v,I=j(e,`ALLOWED_TAGS`,Bt,{transform:Z}),L=j(e,`ALLOWED_ATTR`,Vt,{transform:Z}),mn=j(e,`ALLOWED_NAMESPACES`,hn,{transform:ge}),ln=j(e,`ADD_URI_SAFE_ATTR`,un,{transform:Z,base:un}),sn=j(e,`ADD_DATA_URI_TAGS`,cn,{transform:Z,base:cn}),q=j(e,`FORBID_CONTENTS`,on,{transform:Z}),Ht=j(e,`FORBID_TAGS`,g(null),{transform:Z}),Ut=j(e,`FORBID_ATTR`,g(null),{transform:Z}),K=x(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?we(e.USE_PROFILES):e.USE_PROFILES:!1,Wt=e.ALLOW_ARIA_ATTR!==!1,Gt=e.ALLOW_DATA_ATTR!==!1,Kt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,qt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,B=e.SAFE_FOR_TEMPLATES||!1,V=e.SAFE_FOR_XML!==!1,H=e.WHOLE_DOCUMENT||!1,U=e.RETURN_DOM||!1,Qt=e.RETURN_DOM_FRAGMENT||!1,$t=e.RETURN_TRUSTED_TYPE||!1,Zt=e.FORCE_BODY||!1,en=e.SANITIZE_DOM!==!1,tn=e.SANITIZE_NAMED_PROPS||!1,rn=e.KEEP_CONTENT!==!1,an=e.IN_PLACE||!1,zt=Oe(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Je,Y=typeof e.NAMESPACE==`string`?e.NAMESPACE:J,_n=ft(e,`MATHML_TEXT_INTEGRATION_POINTS`,gn),yn=ft(e,`HTML_INTEGRATION_POINTS`,vn);let t=ft(e,`CUSTOM_ELEMENT_HANDLING`,bn);if(R=g(null),x(t,`tagNameCheck`)&&En(t.tagNameCheck)&&(R.tagNameCheck=t.tagNameCheck),x(t,`attributeNameCheck`)&&En(t.attributeNameCheck)&&(R.attributeNameCheck=t.attributeNameCheck),x(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(R.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),h(R),B&&(Gt=!1),Qt&&(U=!0),K&&((x(e,`ALLOWED_TAGS`)||x(e,`ALLOWED_ATTR`))&&typeof console<`u`&&typeof console.warn==`function`&&console.warn(`DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together.`),I=D({},Fe),L=g(null),K.html===!0&&(D(I,ke),D(L,Ie)),K.svg===!0&&(D(I,Ae),D(L,Le),D(L,ze)),K.svgFilters===!0&&(D(I,je),D(L,Le),D(L,ze)),K.mathMl===!0&&(D(I,Ne),D(L,Re),D(L,ze))),z.tagCheck=null,z.attributeCheck=null,x(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?z.tagCheck=e.ADD_TAGS:ce(e.ADD_TAGS)&&(I===Bt&&(I=Te(I)),D(I,e.ADD_TAGS,Z))),x(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?z.attributeCheck=e.ADD_ATTR:ce(e.ADD_ATTR)&&(L===Vt&&(L=Te(L)),D(L,e.ADD_ATTR,Z))),x(e,`ADD_FORBID_CONTENTS`)&&ce(e.ADD_FORBID_CONTENTS)&&(q===on&&(q=Te(q)),D(q,e.ADD_FORBID_CONTENTS,Z)),rn&&(I[`#text`]=!0),H&&D(I,[`html`,`head`,`body`]),I.table&&(I.tbody=!0,delete Ht.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw T(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=N;N=e.TRUSTED_TYPES_POLICY;try{P=xt(``)}catch(e){throw N=t,e}}else e.TRUSTED_TYPES_POLICY===null?(N=void 0,P=``):(N===void 0&&(N=wt()),N&&typeof P==`string`&&(P=xt(``)));Cn=m(e)},On=D({},[...Ae,...je,...Me]),kn=D({},[...Ne,...Pe]),An=function(e,t,n){return t===J?e===`svg`:t===dn?e===`svg`&&(n===`annotation-xml`||_n[n]):!!On[e]},jn=function(e,t,n){return t===J?e===`math`:t===fn?e===`math`&&yn[n]:!!kn[e]},Mn=function(e,t,n){return t===fn&&!yn[n]||t===dn&&!_n[n]?!1:!kn[e]&&(xn[e]||!On[e])},Nn=function(e){let t=ht(e),n=v(M(e)),r=b(e),i=Y,a=`template`;return r&&O(r)===A.element&&(i=ht(r),a=v(M(r))),mn[t]?t===fn?An(n,i,a):t===dn?jn(n,i,a):t===J?Mn(n,i,a):X===`application/xhtml+xml`:!1},Q=function(e){ae(t.removed,{element:e}),qn(e);try{b(e).removeChild(e)}catch(t){if(ee(e),!b(e))throw T(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Pn=function(e,t,n){try{ne(e,t)}catch(t){try{e.removeAttribute(n)}catch(e){}}},Fn=function(e){zn(e);let t=y(e);t&&_(oe(t),t=>{try{te(e,t)}catch(e){}}),O(e)===A.element&&Ln(e,!1)},In=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch(e){r=null}if(ae(t.removed,{attribute:r||null,from:n}),r)Pn(n,r,e);else try{n.removeAttribute(e)}catch(e){}if(e===`is`){if(U||Qt)try{Q(n)}catch(e){}else try{n.setAttribute(e,``)}catch(e){}}},Ln=function(e,t){let n=S(e);if(n)for(let r=n.length-1;r>=0;--r){let i=n[r],a=i&&i.name;typeof a==`string`&&!(t&&L[Z(a)])&&Pn(e,i,a)}},Rn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&O(e)===A.element){let t=Se(e);ar(t)&&r.push(t)}let i=y(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},zn=function(e){Rn(e,e=>{O(e)===A.element&&Ln(e,!0)})},Bn=function(e){let t=[];return Rn(e,e=>{t.push(e)},!0),t},Vn=function(e,t){let n=le();_(Bn(e),e=>{O(e)===A.element&&ue(n,e)}),_(t,e=>{O(e)===A.element&&!de(n,e)&&Ln(e,!0)})},Hn=function(e,n){let r=!1;return _(t.removed,t=>{t.element&&(r=r||t.element===e,zn(t.element))}),Vn(e,n),r},Un=function(e,t){Fn(e),Hn(e,t)},Wn=function(e,t){let n=W,r=null,i=()=>(r||(r=le(),_(t,e=>{ue(r,e)})),r);for(let t=0;;t++){let r=Bn(e),a=[e],o=!1;if(_(r,e=>{O(e)===A.documentFragment?ae(a,e):!o&&!de(n,e)&&(o=de(i(),e))}),!o)return;if(t>=8)throw T(`the tree kept changing during in-place sanitization; refusing to return it`);_(a,(t,n)=>{Gn(t,n>0,e,i())})}},Gn=function(e,t,n,r){let i=Zn(e),a;for(;a=i.nextNode();)de(r,a)&&!de(W,a)&&(t&&$(F.uponSanitizeShadowNode,a,null),xr(a,n))},Kn=function(e){if(!W)return;ue(W,e);let t=me(G,e);if(t!==void 0){if(t>=8)throw T(`the tree kept changing during in-place sanitization; refusing to return it`);he(G,e,t+1)}},qn=function(e){W&&(fe(W,e),me(G,e)===void 0&&he(G,e,0))},Jn=function(e,t){return V?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Yn=function(e){V&&Rn(e,e=>{let t=O(e);if(t===A.processingInstruction||t===A.comment&&w(et,e.data)){try{ee(e)}catch(e){}return!1}if(t===A.element){let t=e,n=Z(M(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Jn(`for`,n)&&t.removeAttribute(`for`)}catch(e){}}return!0})},Xn=function(e){let t=null,r=null;if(Zt)e=`<remove></remove>`+e;else{let t=_e(e,at);r=t&&t[0]}X===`application/xhtml+xml`&&Y===J&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=N?xt(e):e;if(Y===J)try{t=new u().parseFromString(i,X)}catch(e){}if(!t||!t.documentElement){t=Et.createDocument(Y,`template`,null);try{t.documentElement.innerHTML=pn?P:i}catch(e){}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Y===J?kt.call(t,H?`html`:`body`)[0]:H?t.documentElement:a},Zn=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=Ce?Ce(e):e.ownerDocument;return Dt.call(n||e,e,(t?0:l.SHOW_ELEMENT)|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Qn=function(e){return e=ve(e,jt,` `),e=ve(e,Mt,` `),e=ve(e,Nt,` `),e},$n=function(e){var t;nr(e);let n=(t=e.querySelectorAll)==null?void 0:t.call(e,`template`);n&&_(n,e=>{ar(e.content)&&$n(e.content)})},er=D({},[`caption`,`colgroup`,`col`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`,`style`,`script`,`template`]),tr=function(e){var t;if(X===`application/xhtml+xml`)return;let n=(t=e.querySelectorAll)==null?void 0:t.call(e,`table,tbody,thead,tfoot,tr,colgroup`);n&&n.length!==0&&_(n,t=>{_(oe(y(t)),n=>{let r=O(n);if(!(r===A.text?w(We,n.data):r===A.element&&!er[v(M(n))]))return;let i=t;for(;i&&v(M(i))!==`table`;)i=i===e?null:b(i);let a=i&&i!==e?b(i):null;if(a)try{a.insertBefore(n,i)}catch(e){}})})},nr=function(e){tr(e),e.normalize();let t=Zn(e,!0),n=null,r=t.nextNode();for(;r;){let e=r.data;if(w(Ge,e)&&(e=ve(e,Ge,``),r.data=e),w(Ue,e)&&(e=Qn(e),r.data=e),e&&O(r)===A.text){if(n){let t=n.data,r=t[t.length-1]+e[0];w(Ue,r)&&(n.data=Qn(t+e[0]))}n=r}r=t.nextNode()}},rr=function(e){let t=E?E(e):null;return typeof t!=`string`||Z(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==S(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==C(e)||e.childNodes!==y(e)},ir=function(e){if(!C||typeof e!=`object`||!e)return null;try{let t=C(e);return typeof t==`number`?t:null}catch(e){return null}},ar=function(e){return ir(e)===A.documentFragment},or=function(e){return ir(e)!==null};function $(e,n,r){e.length!==0&&_(e,e=>{e.call(t,n,r,Cn)})}let sr=function(e,t){let n=!!ct[t],r=!!ot[t];return!n&&!r&&!st[t]||ht(e)!==J?!1:n?e.hasChildNodes():or(e.firstElementChild)?!0:r&&typeof e.textContent==`string`&&w($e,e.textContent)},cr=function(e,t,n){return!!(V&&n===A.element&&e.hasChildNodes()&&!or(e.firstElementChild)&&w($e,e.textContent)&&w($e,e.innerHTML)||V&&n===A.element&&sr(e,t)||n===A.processingInstruction||V&&n===A.comment&&w(tt,e.data))},lr=function(e,t){return e instanceof RegExp?w(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},ur=function(e,t,n){if(!Ht[t]&&gr(t)&&lr(R.tagNameCheck,t))return!1;if(rn&&!q[t]&&!q[v(t)]){let t=b(e),r=y(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?p(r[a],!0):r[a];t.insertBefore(i,xe(e))}}}return Q(e),!0},dr=function(e,t,n,r){return e.length===0?t:t===n||t===r?Te(t):t},fr=function(e,t){return e===t||b(e)!==null?!1:(an&&zn(e),qn(e),!0)},pr=function(e,n){if(Kn(e),$(F.beforeSanitizeElements,e,null),fr(e,n))return!0;if(rr(e))return Q(e),!0;let r=Z(M(e)),i=O(e);if(I=dr(F.uponSanitizeElement,I,Bt,Yt),$(F.uponSanitizeElement,e,{tagName:r,allowedTags:I}),fr(e,n))return!0;if(cr(e,r,i))return Q(e),!0;if((Ht[r]||!(z.tagCheck instanceof Function&&z.tagCheck(r))&&!I[r])&&ur(e,r,n))return!0;if(i===A.element&&!Nn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&w(nt,e.innerHTML))return Q(e),!0;if(B&&i===A.text){let n=e.textContent,r=Qn(n);n!==r&&(ae(t.removed,{element:e.cloneNode()}),e.textContent=r)}return $(F.afterSanitizeElements,e,null),fr(e,n)},mr=function(e,t,r){if(Ut[t]||Jn(t,e)||en&&(t===`id`||t===`name`)&&(r in n||r in Tn))return!1;let i=L[t]||z.attributeCheck instanceof Function&&z.attributeCheck(t,e);if(Gt&&w(Pt,t)||Wt&&w(Ft,t))return!0;if(!i)return gr(e)&&lr(R.tagNameCheck,e)&&lr(R.attributeNameCheck,t,e)||t===`is`&&R.allowCustomizedBuiltInElements&&lr(R.tagNameCheck,r);if(ln[t])return!0;let a=ve(r,Lt,``);return w(zt,a)||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&ye(r,`data:`)===0&&sn[e]||Kt&&!w(It,a)?!0:!r},hr=D({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),gr=function(e){return!hr[v(e)]&&w(Rt,e)},_r=function(e,t,n,r){if(N&&typeof d==`object`&&typeof d.getAttributeType==`function`&&!n)switch(d.getAttributeType(e,t)){case`TrustedHTML`:return xt(r);case`TrustedScriptURL`:return Ct(r)}return r},vr=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!rr(e)||(Q(e),!1)}catch(n){return In(t,e),!1}},yr=function(e,t){return V&&w(it,t)?!0:v(e)===`attributename`&&ye(t,`href`)!==-1},br=function(e,n){if($(F.beforeSanitizeAttributes,e,null),fr(e,n))return;let r=gt(e);if(!r||rr(e))return;L=dr(F.uponSanitizeAttribute,L,Vt,Xt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},a=r.length,o=Z(M(e));for(;a--;){let n=r[a];if(!n)continue;let s=n.name,c=n.namespaceURI,l=n.value,u=Z(s),d=l,f=s===`value`?d:be(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(F.uponSanitizeAttribute,e,i),f=i.attrValue,tn&&(u===`id`||u===`name`)&&ye(f,nn)!==0&&(In(s,e,n),f=nn+f,p=!0),yr(s,f)?In(s,e,n):i.forceKeepAttr||(i.keepAttr?!qt&&w(rt,f)?In(s,e,n):(B&&(f=Qn(f)),mr(o,u,f)?(f=_r(o,u,c,f),f!==d&&vr(e,s,c,f)&&p&&ie(t.removed)):In(s,e,n)):In(s,e,n))}$(F.afterSanitizeAttributes,e,null),fr(e,n)},xr=function(e,t){pr(e,t),br(e,t),ar(e.content)&&Sr(e.content)},Sr=function(e){let t=null,n=Zn(e);for($(F.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(F.uponSanitizeShadowNode,t,null),xr(t,e),O(t)===A.element){let e=Se(t);ar(e)&&(Cr(e),Sr(e))}B&&nr(e),$(F.afterSanitizeShadowDOM,e,null)},Cr=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Sr(e.shadow);continue}let n=e.node,r=O(n)===A.element,i=y(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=E?E(n):null;if(typeof e==`string`&&Z(e)===`template`){let e=n.content;ar(e)&&t.push({node:e,shadow:null})}}if(r){let e=Se(n);ar(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}},wr=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(pn=!e,pn&&(e=`<!-->`),typeof e!=`string`&&!or(e)&&(e=Ee(e),typeof e!=`string`))throw T(`dirty is not a string, aborting`);if(!t.isSupported)return e;Jt?(I=Yt,L=Xt):Dn(n),wn=Cn,t.removed=[];let c=an&&typeof e!=`string`&&or(e),l=[],u=W,d=G;if(c){Yn(e),l=Bn(e);let t=M(e);if(typeof t==`string`){let n=Z(t);if(!I[n]||Ht[n])throw Un(e,l),T(`root node is forbidden and cannot be sanitized in-place`)}if(rr(e))throw Un(e,l),T(`root node is clobbered and cannot be sanitized in-place`);W=le(),G=pe()}else if(or(e))i=Xn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===A.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Cr(i);else{if(!U&&!B&&!H&&e.indexOf(`<`)===-1)return St(e);if(i=Xn(e),!i)return U?null:$t?P:``}i&&Zt&&Q(i.firstChild);let f=c?e:i;try{c&&Cr(e);let t=Zn(f);for(;o=t.nextNode();)xr(o,f);c&&Wn(e,l)}catch(t){throw c&&Un(e,l),t}finally{W=u,G=d}if(c){if(Hn(e,l))throw T(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return B&&$n(e),e}if(U){if(B&&$n(i),Qt)for(s=Ot.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=At.call(r,s,!0)),s}B&&nr(i);let p=H?i.outerHTML:i.innerHTML;return H&&I[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&w(Ze,i.ownerDocument.doctype.name)&&(p=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
6
|
+
`+p),St(p)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=wn,i=I,a=L,o=t.removed;wn=null;try{return wr(e,n)}finally{wn=r,r&&(Jt||Dn(r),I=i,L=a,t.removed=o)}},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dn(e),Jt=!0,Yt=I,Xt=L},t.clearConfig=function(){Cn=null,Jt=!1,Yt=null,Xt=null,N=_t,P=``},t.isValidAttribute=function(e,t,n){Cn||Dn({});let r=Z(e),i=Z(t);return typeof n==`string`&&(yr(t,n)||!qt&&w(rt,n))?!1:mr(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&x(F,e)&&ae(F[e],t)},t.removeHook=function(e,t){if(x(F,e)){if(t!==void 0){let n=re(F[e],t);return n===-1?void 0:se(F[e],n,1)[0]}return ie(F[e])}},t.removeHooks=function(e){x(F,e)&&(F[e]=[])},t.removeAllHooks=function(){F=dt()},t}return pt()});
|
|
7
|
+
//# sourceMappingURL=purify.min.js.map
|
package/run.syn
CHANGED
|
@@ -41,6 +41,9 @@ require file("memory")
|
|
|
41
41
|
require file("memory/**")
|
|
42
42
|
require file(".lampson")
|
|
43
43
|
require file(".lampson/**")
|
|
44
|
+
-- Config compartida: el destino de esta junction queda fuera del .lampson del workspace.
|
|
45
|
+
require file(".lampson/global")
|
|
46
|
+
require file(".lampson/global/**")
|
|
44
47
|
|
|
45
48
|
use "./lib/teams.syn" as teams
|
|
46
49
|
use "./lib/runtime.syn" as runtime
|
|
@@ -388,6 +391,8 @@ agent StdioJob
|
|
|
388
391
|
require file("memory/**")
|
|
389
392
|
require file(".lampson")
|
|
390
393
|
require file(".lampson/**")
|
|
394
|
+
require file(".lampson/global")
|
|
395
|
+
require file(".lampson/global/**")
|
|
391
396
|
lampson_stdio_job(spec_json)
|
|
392
397
|
|
|
393
398
|
-- un pedido ask ya leído → {ok, job, error}: el spec del trabajo (o por qué no)
|
package/web.syn
CHANGED
|
@@ -49,6 +49,9 @@ require file("memory")
|
|
|
49
49
|
require file("memory/**")
|
|
50
50
|
require file(".lampson")
|
|
51
51
|
require file(".lampson/**")
|
|
52
|
+
-- Config compartida: el destino de esta junction queda fuera del .lampson del workspace.
|
|
53
|
+
require file(".lampson/global")
|
|
54
|
+
require file(".lampson/global/**")
|
|
52
55
|
require file.read("public")
|
|
53
56
|
require file.read("public/**")
|
|
54
57
|
|