@wenyan-md/core 1.0.5 → 1.0.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/README.md +227 -1
- package/dist/browser/wenyan-core.js +94 -0
- package/dist/core.js +224 -206
- package/dist/math/wenyan-math.js +50 -0
- package/dist/styles/wenyan-styles.js +2244 -0
- package/package.json +15 -6
package/README.md
CHANGED
|
@@ -1,3 +1,229 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img alt
|
|
2
|
+
<img alt="logo" src="https://raw.githubusercontent.com/caol64/wenyan/main/Data/256-mac.png" />
|
|
3
3
|
</div>
|
|
4
|
+
|
|
5
|
+
# 文颜 CORE
|
|
6
|
+
|
|
7
|
+
「文颜」是一款多平台排版美化工具,让你将 Markdown 一键发布至微信公众号、知乎、今日头条等主流写作平台。
|
|
8
|
+
|
|
9
|
+
**文颜**现已推出多个版本:
|
|
10
|
+
|
|
11
|
+
* [macOS App Store 版](https://github.com/caol64/wenyan) - MAC 桌面应用
|
|
12
|
+
* [Windows + Linux 版](https://github.com/caol64/wenyan-pc) - 跨平台桌面应用
|
|
13
|
+
* [CLI 版本](https://github.com/caol64/wenyan-cli) - CI/CD 或脚本自动化发布公众号文章
|
|
14
|
+
* [MCP 版本](https://github.com/caol64/wenyan-mcp) - 让 AI 自动发布公众号文章
|
|
15
|
+
|
|
16
|
+
本项目是 **文颜的核心库文件**,你可以将其方便地嵌入自己的应用中,以实现排版美化和自动发布功能。
|
|
17
|
+
|
|
18
|
+
## 功能
|
|
19
|
+
|
|
20
|
+
* 使用内置主题对 Markdown 内容排版
|
|
21
|
+
* 支持图片自动上传
|
|
22
|
+
* 支持数学公式渲染
|
|
23
|
+
* 一键发布文章到微信公众号草稿箱
|
|
24
|
+
|
|
25
|
+
## 主题效果
|
|
26
|
+
|
|
27
|
+
👉 [内置主题预览](https://yuzhi.tech/docs/wenyan/theme)
|
|
28
|
+
|
|
29
|
+
文颜采用了多个开源的 Typora 主题,在此向各位作者表示感谢:
|
|
30
|
+
|
|
31
|
+
- [Orange Heart](https://github.com/evgo2017/typora-theme-orange-heart)
|
|
32
|
+
- [Rainbow](https://github.com/thezbm/typora-theme-rainbow)
|
|
33
|
+
- [Lapis](https://github.com/YiNNx/typora-theme-lapis)
|
|
34
|
+
- [Pie](https://github.com/kevinzhao2233/typora-theme-pie)
|
|
35
|
+
- [Maize](https://github.com/BEATREE/typora-maize-theme)
|
|
36
|
+
- [Purple](https://github.com/hliu202/typora-purple-theme)
|
|
37
|
+
- [物理猫-薄荷](https://github.com/sumruler/typora-theme-phycat)
|
|
38
|
+
|
|
39
|
+
## 安装方式
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pnpm add @wenyan-md/core
|
|
43
|
+
# 或者
|
|
44
|
+
npm install @wenyan-md/core
|
|
45
|
+
# 或者
|
|
46
|
+
yarn add @wenyan-md/core
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 使用示例
|
|
50
|
+
|
|
51
|
+
### 1. Markdown 排版美化
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
import { getGzhContent } from "@wenyan-md/core/wrapper";
|
|
55
|
+
|
|
56
|
+
const inputContent = "# Hello, Wenyan";
|
|
57
|
+
const theme = "lapis";
|
|
58
|
+
const highlightTheme = "solarized-light";
|
|
59
|
+
const isMacStyle = true;
|
|
60
|
+
|
|
61
|
+
const { title, cover, content, description } = await getGzhContent(
|
|
62
|
+
inputContent,
|
|
63
|
+
theme,
|
|
64
|
+
highlightTheme,
|
|
65
|
+
isMacStyle
|
|
66
|
+
);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### 参数说明
|
|
70
|
+
|
|
71
|
+
| 参数名 | 类型 | 说明 |
|
|
72
|
+
| ---------------- | --------- | ----------------------------------------------- |
|
|
73
|
+
| `inputContent` | `string` | 输入的 Markdown 文本 |
|
|
74
|
+
| `theme` | `string` | 排版主题 ID(如 `"lapis"`, `"default"` 等,见下文) |
|
|
75
|
+
| `highlightTheme` | `string` | 代码高亮主题(如 `"github"`, `"solarized-light"`, 见下文) |
|
|
76
|
+
| `isMacStyle` | `boolean` | 代码块是否启用 Mac 风格 |
|
|
77
|
+
|
|
78
|
+
排版主题可选参数:
|
|
79
|
+
|
|
80
|
+
- default
|
|
81
|
+
- orangeheart
|
|
82
|
+
- rainbow
|
|
83
|
+
- lapis
|
|
84
|
+
- pie
|
|
85
|
+
- maize
|
|
86
|
+
- purple
|
|
87
|
+
- phycat
|
|
88
|
+
|
|
89
|
+
高亮主题可选参数:
|
|
90
|
+
|
|
91
|
+
- atom-one-dark
|
|
92
|
+
- atom-one-light
|
|
93
|
+
- dracula
|
|
94
|
+
- github-dark
|
|
95
|
+
- github
|
|
96
|
+
- monokai
|
|
97
|
+
- solarized-dark
|
|
98
|
+
- solarized-light
|
|
99
|
+
- xcode
|
|
100
|
+
|
|
101
|
+
#### 返回值
|
|
102
|
+
|
|
103
|
+
| 字段 | 类型 | 说明 |
|
|
104
|
+
| ------------- | -------- | ---------------------- |
|
|
105
|
+
| `title` | `string` | `frontmatter`中的文章标题,见下文 |
|
|
106
|
+
| `cover` | `string` | `frontmatter`中的文章封面图,见下文 |
|
|
107
|
+
| `content` | `string` | 转换后的 HTML 文章内容,发布接口需要用到 |
|
|
108
|
+
| `description` | `string` | `frontmatter`中的文章简介,见下文 |
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### 2. 发布到微信公众号草稿箱
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
import { publishToDraft } from "@wenyan-md/core/publish";
|
|
116
|
+
|
|
117
|
+
// 首先确保环境变量有效
|
|
118
|
+
const wechatAppId = process.env.WECHAT_APP_ID;
|
|
119
|
+
const wechatAppSecret = process.env.WECHAT_APP_SECRET;
|
|
120
|
+
|
|
121
|
+
if (!wechatAppId || !wechatAppSecret) {
|
|
122
|
+
console.error("WECHAT_APP_ID and WECHAT_APP_SECRET must be set as environment variables.");
|
|
123
|
+
process.exit(1);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const data = await publishToDraft(title, content, cover);
|
|
127
|
+
|
|
128
|
+
if (data.media_id) {
|
|
129
|
+
console.log(`上传成功,media_id: ${data.media_id}`);
|
|
130
|
+
} else {
|
|
131
|
+
console.error(`上传失败,\n${data}`);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### 参数说明
|
|
136
|
+
|
|
137
|
+
| 参数名 | 类型 | 说明 |
|
|
138
|
+
| --------- | -------- | ---------- |
|
|
139
|
+
| `title` | `string` | 文章标题 |
|
|
140
|
+
| `content` | `string` | 文章 HTML 内容 |
|
|
141
|
+
| `cover` | `string` | 封面图 URL |
|
|
142
|
+
|
|
143
|
+
#### 返回值
|
|
144
|
+
|
|
145
|
+
返回 **微信公众号 API 的响应对象**,常见字段:
|
|
146
|
+
|
|
147
|
+
| 字段 | 类型 | 说明 |
|
|
148
|
+
| ---------- | -------- | --------------------- |
|
|
149
|
+
| `media_id` | `string` | 草稿的 media\_id,后续发布时需要 |
|
|
150
|
+
|
|
151
|
+
## 环境变量
|
|
152
|
+
|
|
153
|
+
在使用 `publishToDraft` 前,需要在环境中配置:
|
|
154
|
+
|
|
155
|
+
* `WECHAT_APP_ID`
|
|
156
|
+
* `WECHAT_APP_SECRET`
|
|
157
|
+
|
|
158
|
+
推荐通过 `.env` 文件或 CI/CD 环境变量注入。
|
|
159
|
+
|
|
160
|
+
## 浏览器直接使用
|
|
161
|
+
|
|
162
|
+
除了通过 `npm` 安装外,你也可以直接在浏览器环境中引入打包好的版本(IIFE 格式),无需构建工具。
|
|
163
|
+
|
|
164
|
+
推荐使用 **[unpkg](https://unpkg.com/)** 或 **[jsDelivr](https://www.jsdelivr.com/)**。
|
|
165
|
+
|
|
166
|
+
```html
|
|
167
|
+
<!-- 从 unpkg 引入 -->
|
|
168
|
+
<script src="https://unpkg.com/@wenyan-md/core/dist/browser/wenyan-core.js"></script>
|
|
169
|
+
|
|
170
|
+
<!-- 或者从 jsDelivr 引入 -->
|
|
171
|
+
<script src="https://cdn.jsdelivr.net/npm/@wenyan-md/core/dist/browser/wenyan-core.js"></script>
|
|
172
|
+
|
|
173
|
+
<script>
|
|
174
|
+
// 使用全局变量 WenyanCore
|
|
175
|
+
const { configureMarked, renderMarkdown, themes } = WenyanCore;
|
|
176
|
+
|
|
177
|
+
(async () => {
|
|
178
|
+
configureMarked();
|
|
179
|
+
const input = "# Hello from Browser";
|
|
180
|
+
const content = await renderMarkdown(input);
|
|
181
|
+
const theme = themes["lapis"];
|
|
182
|
+
const styledCss = await theme.getCss();
|
|
183
|
+
const style = document.createElement("style");
|
|
184
|
+
style.textContent = styledCss;
|
|
185
|
+
document.head.appendChild(style);
|
|
186
|
+
document.body.innerHTML = content;
|
|
187
|
+
})();
|
|
188
|
+
</script>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
这样你就可以在 **任意前端项目** 或 **纯静态页面** 中直接使用文颜的功能。
|
|
192
|
+
|
|
193
|
+
## 微信公众号 IP 白名单
|
|
194
|
+
|
|
195
|
+
请务必将服务器 IP 加入公众号平台的 IP 白名单,以确保上传接口调用成功。
|
|
196
|
+
详细配置说明请参考:[https://yuzhi.tech/docs/wenyan/upload](https://yuzhi.tech/docs/wenyan/upload)
|
|
197
|
+
|
|
198
|
+
## 配置说明(Frontmatter)
|
|
199
|
+
|
|
200
|
+
为了可以正确上传文章,需要在每一篇 Markdown 文章的开头添加一段`frontmatter`,提供`title`、`cover`两个字段:
|
|
201
|
+
|
|
202
|
+
```md
|
|
203
|
+
---
|
|
204
|
+
title: 在本地跑一个大语言模型(2) - 给模型提供外部知识库
|
|
205
|
+
cover: /Users/lei/Downloads/result_image.jpg
|
|
206
|
+
description: 本文介绍如何为本地大语言模型提供外部知识库。
|
|
207
|
+
---
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
* `title` 是文章标题,必填。
|
|
211
|
+
* `cover` 是文章封面,支持本地路径和网络图片:
|
|
212
|
+
|
|
213
|
+
* 如果正文有至少一张图片,可省略,此时将使用其中一张作为封面;
|
|
214
|
+
* 如果正文无图片,则必须提供 cover。
|
|
215
|
+
|
|
216
|
+
## 关于图片自动上传
|
|
217
|
+
|
|
218
|
+
* 支持图片路径:
|
|
219
|
+
|
|
220
|
+
* 本地路径(如:`/Users/lei/Downloads/result_image.jpg`)
|
|
221
|
+
* 网络路径(如:`https://example.com/image.jpg`)
|
|
222
|
+
|
|
223
|
+
## 赞助
|
|
224
|
+
|
|
225
|
+
如果您觉得不错,可以给我家猫咪买点罐头吃。[喂猫❤️](https://yuzhi.tech/sponsor)
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
Apache License Version 2.0
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var WenyanCore=(function(U,Zn,rt,tt,it,Je,Kn){"use strict";function lt(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const i in r)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(n,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}return n.default=r,Object.freeze(n)}const N=lt(rt);function Xe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ae=Xe();function Wn(r){ae=r}var ge={exec:()=>null};function M(r,n=""){let i=typeof r=="string"?r:r.source;const o={replace:(t,a)=>{let s=typeof a=="string"?a:a.source;return s=s.replace(G.caret,"$1"),i=i.replace(t,s),o},getRegex:()=>new RegExp(i,n)};return o}var G={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,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,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},ot=/^(?:[ \t]*(?:\n|$))+/,at=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,st=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,me=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ut=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,en=/(?:[*+-]|\d{1,9}[.)])/,Vn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Qn=M(Vn).replace(/bull/g,en).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),ct=M(Vn).replace(/bull/g,en).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),nn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,pt=/^[^\n]+/,rn=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ft=M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ht=M(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,en).getRegex(),Se="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",tn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dt=M("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",tn).replace("tag",Se).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Jn=M(nn).replace("hr",me).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Se).getRegex(),gt=M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Jn).getRegex(),ln={blockquote:gt,code:at,def:ft,fences:st,heading:ut,hr:me,html:dt,lheading:Qn,list:ht,newline:ot,paragraph:Jn,table:ge,text:pt},Xn=M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",me).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Se).getRegex(),mt={...ln,lheading:ct,table:Xn,paragraph:M(nn).replace("hr",me).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Se).getRegex()},xt={...ln,html:M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",tn).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:ge,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:M(nn).replace("hr",me).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",Qn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},kt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,vt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,er=/^( {2,}|\\)\n(?!\s*$)/,bt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ce=/[\p{P}\p{S}]/u,on=/[\s\p{P}\p{S}]/u,nr=/[^\s\p{P}\p{S}]/u,yt=M(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,on).getRegex(),rr=/(?!~)[\p{P}\p{S}]/u,wt=/(?!~)[\s\p{P}\p{S}]/u,At=/(?:[^\s\p{P}\p{S}]|~)/u,St=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,tr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ct=M(tr,"u").replace(/punct/g,Ce).getRegex(),Tt=M(tr,"u").replace(/punct/g,rr).getRegex(),ir="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_t=M(ir,"gu").replace(/notPunctSpace/g,nr).replace(/punctSpace/g,on).replace(/punct/g,Ce).getRegex(),Et=M(ir,"gu").replace(/notPunctSpace/g,At).replace(/punctSpace/g,wt).replace(/punct/g,rr).getRegex(),Rt=M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,nr).replace(/punctSpace/g,on).replace(/punct/g,Ce).getRegex(),Ft=M(/\\(punct)/,"gu").replace(/punct/g,Ce).getRegex(),Lt=M(/^<(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(),It=M(tn).replace("(?:-->|$)","-->").getRegex(),$t=M("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",It).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Te=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ot=M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Te).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lr=M(/^!?\[(label)\]\[(ref)\]/).replace("label",Te).replace("ref",rn).getRegex(),or=M(/^!?\[(ref)\](?:\[\])?/).replace("ref",rn).getRegex(),Mt=M("reflink|nolink(?!\\()","g").replace("reflink",lr).replace("nolink",or).getRegex(),an={_backpedal:ge,anyPunctuation:Ft,autolink:Lt,blockSkip:St,br:er,code:vt,del:ge,emStrongLDelim:Ct,emStrongRDelimAst:_t,emStrongRDelimUnd:Rt,escape:kt,link:Ot,nolink:or,punctuation:yt,reflink:lr,reflinkSearch:Mt,tag:$t,text:bt,url:ge},Dt={...an,link:M(/^!?\[(label)\]\((.*?)\)/).replace("label",Te).getRegex(),reflink:M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Te).getRegex()},sn={...an,emStrongRDelimAst:Et,emStrongLDelim:Tt,url:M(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Pt={...sn,br:M(er).replace("{2,}","*").getRegex(),text:M(sn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},_e={normal:ln,gfm:mt,pedantic:xt},xe={normal:an,gfm:sn,breaks:Pt,pedantic:Dt},qt={"&":"&","<":"<",">":">",'"':""","'":"'"},ar=r=>qt[r];function J(r,n){if(n){if(G.escapeTest.test(r))return r.replace(G.escapeReplace,ar)}else if(G.escapeTestNoEncode.test(r))return r.replace(G.escapeReplaceNoEncode,ar);return r}function sr(r){try{r=encodeURI(r).replace(G.percentDecode,"%")}catch{return null}return r}function ur(r,n){const i=r.replace(G.findPipe,(a,s,u)=>{let p=!1,c=s;for(;--c>=0&&u[c]==="\\";)p=!p;return p?"|":" |"}),o=i.split(G.splitPipe);let t=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),n)if(o.length>n)o.splice(n);else for(;o.length<n;)o.push("");for(;t<o.length;t++)o[t]=o[t].trim().replace(G.slashPipe,"|");return o}function ke(r,n,i){const o=r.length;if(o===0)return"";let t=0;for(;t<o&&r.charAt(o-t-1)===n;)t++;return r.slice(0,o-t)}function Nt(r,n){if(r.indexOf(n[1])===-1)return-1;let i=0;for(let o=0;o<r.length;o++)if(r[o]==="\\")o++;else if(r[o]===n[0])i++;else if(r[o]===n[1]&&(i--,i<0))return o;return i>0?-2:-1}function cr(r,n,i,o,t){const a=n.href,s=n.title||null,u=r[1].replace(t.other.outputLinkReplace,"$1");o.state.inLink=!0;const p={type:r[0].charAt(0)==="!"?"image":"link",raw:i,href:a,title:s,text:u,tokens:o.inlineTokens(u)};return o.state.inLink=!1,p}function Bt(r,n,i){const o=r.match(i.other.indentCodeCompensation);if(o===null)return n;const t=o[1];return n.split(`
|
|
3
|
+
`).map(a=>{const s=a.match(i.other.beginningSpace);if(s===null)return a;const[u]=s;return u.length>=t.length?a.slice(t.length):a}).join(`
|
|
4
|
+
`)}var Ee=class{options;rules;lexer;constructor(r){this.options=r||ae}space(r){const n=this.rules.block.newline.exec(r);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(r){const n=this.rules.block.code.exec(r);if(n){const i=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:ke(i,`
|
|
5
|
+
`)}}}fences(r){const n=this.rules.block.fences.exec(r);if(n){const i=n[0],o=Bt(i,n[3]||"",this.rules);return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:o}}}heading(r){const n=this.rules.block.heading.exec(r);if(n){let i=n[2].trim();if(this.rules.other.endingHash.test(i)){const o=ke(i,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(i=o.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(r){const n=this.rules.block.hr.exec(r);if(n)return{type:"hr",raw:ke(n[0],`
|
|
6
|
+
`)}}blockquote(r){const n=this.rules.block.blockquote.exec(r);if(n){let i=ke(n[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),o="",t="";const a=[];for(;i.length>0;){let s=!1;const u=[];let p;for(p=0;p<i.length;p++)if(this.rules.other.blockquoteStart.test(i[p]))u.push(i[p]),s=!0;else if(!s)u.push(i[p]);else break;i=i.slice(p);const c=u.join(`
|
|
9
|
+
`),f=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
11
|
+
${c}`:c,t=t?`${t}
|
|
12
|
+
${f}`:f;const v=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,a,!0),this.lexer.state.top=v,i.length===0)break;const x=a.at(-1);if(x?.type==="code")break;if(x?.type==="blockquote"){const F=x,_=F.raw+`
|
|
13
|
+
`+i.join(`
|
|
14
|
+
`),$=this.blockquote(_);a[a.length-1]=$,o=o.substring(0,o.length-F.raw.length)+$.raw,t=t.substring(0,t.length-F.text.length)+$.text;break}else if(x?.type==="list"){const F=x,_=F.raw+`
|
|
15
|
+
`+i.join(`
|
|
16
|
+
`),$=this.list(_);a[a.length-1]=$,o=o.substring(0,o.length-x.raw.length)+$.raw,t=t.substring(0,t.length-F.raw.length)+$.raw,i=_.substring(a.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:a,text:t}}}list(r){let n=this.rules.block.list.exec(r);if(n){let i=n[1].trim();const o=i.length>1,t={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");const a=this.rules.other.listItemRegex(i);let s=!1;for(;r;){let p=!1,c="",f="";if(!(n=a.exec(r))||this.rules.block.hr.test(r))break;c=n[0],r=r.substring(c.length);let v=n[2].split(`
|
|
18
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,Z=>" ".repeat(3*Z.length)),x=r.split(`
|
|
19
|
+
`,1)[0],F=!v.trim(),_=0;if(this.options.pedantic?(_=2,f=v.trimStart()):F?_=n[1].length+1:(_=n[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,f=v.slice(_),_+=n[1].length),F&&this.rules.other.blankLine.test(x)&&(c+=x+`
|
|
20
|
+
`,r=r.substring(x.length+1),p=!0),!p){const Z=this.rules.other.nextBulletRegex(_),K=this.rules.other.hrRegex(_),j=this.rules.other.fencesBeginRegex(_),W=this.rules.other.headingBeginRegex(_),z=this.rules.other.htmlBeginRegex(_);for(;r;){const V=r.split(`
|
|
21
|
+
`,1)[0];let ie;if(x=V,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),ie=x):ie=x.replace(this.rules.other.tabCharGlobal," "),j.test(x)||W.test(x)||z.test(x)||Z.test(x)||K.test(x))break;if(ie.search(this.rules.other.nonSpaceChar)>=_||!x.trim())f+=`
|
|
22
|
+
`+ie.slice(_);else{if(F||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||j.test(v)||W.test(v)||K.test(v))break;f+=`
|
|
23
|
+
`+x}!F&&!x.trim()&&(F=!0),c+=V+`
|
|
24
|
+
`,r=r.substring(V.length+1),v=ie.slice(_)}}t.loose||(s?t.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(s=!0));let $=null,H;this.options.gfm&&($=this.rules.other.listIsTask.exec(f),$&&(H=$[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),t.items.push({type:"list_item",raw:c,task:!!$,checked:H,loose:!1,text:f,tokens:[]}),t.raw+=c}const u=t.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let p=0;p<t.items.length;p++)if(this.lexer.state.top=!1,t.items[p].tokens=this.lexer.blockTokens(t.items[p].text,[]),!t.loose){const c=t.items[p].tokens.filter(v=>v.type==="space"),f=c.length>0&&c.some(v=>this.rules.other.anyLine.test(v.raw));t.loose=f}if(t.loose)for(let p=0;p<t.items.length;p++)t.items[p].loose=!0;return t}}html(r){const n=this.rules.block.html.exec(r);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(r){const n=this.rules.block.def.exec(r);if(n){const i=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:i,raw:n[0],href:o,title:t}}}table(r){const n=this.rules.block.table.exec(r);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;const i=ur(n[1]),o=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],a={type:"table",raw:n[0],header:[],align:[],rows:[]};if(i.length===o.length){for(const s of o)this.rules.other.tableAlignRight.test(s)?a.align.push("right"):this.rules.other.tableAlignCenter.test(s)?a.align.push("center"):this.rules.other.tableAlignLeft.test(s)?a.align.push("left"):a.align.push(null);for(let s=0;s<i.length;s++)a.header.push({text:i[s],tokens:this.lexer.inline(i[s]),header:!0,align:a.align[s]});for(const s of t)a.rows.push(ur(s,a.header.length).map((u,p)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:a.align[p]})));return a}}lheading(r){const n=this.rules.block.lheading.exec(r);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(r){const n=this.rules.block.paragraph.exec(r);if(n){const i=n[1].charAt(n[1].length-1)===`
|
|
26
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:i,tokens:this.lexer.inline(i)}}}text(r){const n=this.rules.block.text.exec(r);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(r){const n=this.rules.inline.escape.exec(r);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(r){const n=this.rules.inline.tag.exec(r);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(r){const n=this.rules.inline.link.exec(r);if(n){const i=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;const a=ke(i.slice(0,-1),"\\");if((i.length-a.length)%2===0)return}else{const a=Nt(n[2],"()");if(a===-2)return;if(a>-1){const u=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,u).trim(),n[3]=""}}let o=n[2],t="";if(this.options.pedantic){const a=this.rules.other.pedanticHrefTitle.exec(o);a&&(o=a[1],t=a[3])}else t=n[3]?n[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?o=o.slice(1):o=o.slice(1,-1)),cr(n,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(r,n){let i;if((i=this.rules.inline.reflink.exec(r))||(i=this.rules.inline.nolink.exec(r))){const o=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=n[o.toLowerCase()];if(!t){const a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return cr(i,t,i[0],this.lexer,this.rules)}}emStrong(r,n,i=""){let o=this.rules.inline.emStrongLDelim.exec(r);if(!o||o[3]&&i.match(this.rules.other.unicodeAlphaNumeric))return;if(!(o[1]||o[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const a=[...o[0]].length-1;let s,u,p=a,c=0;const f=o[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,n=n.slice(-1*r.length+a);(o=f.exec(n))!=null;){if(s=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!s)continue;if(u=[...s].length,o[3]||o[4]){p+=u;continue}else if((o[5]||o[6])&&a%3&&!((a+u)%3)){c+=u;continue}if(p-=u,p>0)continue;u=Math.min(u,u+p+c);const v=[...o[0]][0].length,x=r.slice(0,a+o.index+v+u);if(Math.min(a,u)%2){const _=x.slice(1,-1);return{type:"em",raw:x,text:_,tokens:this.lexer.inlineTokens(_)}}const F=x.slice(2,-2);return{type:"strong",raw:x,text:F,tokens:this.lexer.inlineTokens(F)}}}}codespan(r){const n=this.rules.inline.code.exec(r);if(n){let i=n[2].replace(this.rules.other.newLineCharGlobal," ");const o=this.rules.other.nonSpaceChar.test(i),t=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return o&&t&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:n[0],text:i}}}br(r){const n=this.rules.inline.br.exec(r);if(n)return{type:"br",raw:n[0]}}del(r){const n=this.rules.inline.del.exec(r);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(r){const n=this.rules.inline.autolink.exec(r);if(n){let i,o;return n[2]==="@"?(i=n[1],o="mailto:"+i):(i=n[1],o=i),{type:"link",raw:n[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}url(r){let n;if(n=this.rules.inline.url.exec(r)){let i,o;if(n[2]==="@")i=n[0],o="mailto:"+i;else{let t;do t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(t!==n[0]);i=n[0],n[1]==="www."?o="http://"+n[0]:o=n[0]}return{type:"link",raw:n[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(r){const n=this.rules.inline.text.exec(r);if(n){const i=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:i}}}},re=class Un{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||ae,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const i={other:G,block:_e.normal,inline:xe.normal};this.options.pedantic?(i.block=_e.pedantic,i.inline=xe.pedantic):this.options.gfm&&(i.block=_e.gfm,this.options.breaks?i.inline=xe.breaks:i.inline=xe.gfm),this.tokenizer.rules=i}static get rules(){return{block:_e,inline:xe}}static lex(n,i){return new Un(i).lex(n)}static lexInline(n,i){return new Un(i).inlineTokens(n)}lex(n){n=n.replace(G.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(n,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){const o=this.inlineQueue[i];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,i=[],o=!1){for(this.options.pedantic&&(n=n.replace(G.tabCharGlobal," ").replace(G.spaceLine,""));n;){let t;if(this.options.extensions?.block?.some(s=>(t=s.call({lexer:this},n,i))?(n=n.substring(t.raw.length),i.push(t),!0):!1))continue;if(t=this.tokenizer.space(n)){n=n.substring(t.raw.length);const s=i.at(-1);t.raw.length===1&&s!==void 0?s.raw+=`
|
|
28
|
+
`:i.push(t);continue}if(t=this.tokenizer.code(n)){n=n.substring(t.raw.length);const s=i.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=`
|
|
29
|
+
`+t.raw,s.text+=`
|
|
30
|
+
`+t.text,this.inlineQueue.at(-1).src=s.text):i.push(t);continue}if(t=this.tokenizer.fences(n)){n=n.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.heading(n)){n=n.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.hr(n)){n=n.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.blockquote(n)){n=n.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.list(n)){n=n.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.html(n)){n=n.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.def(n)){n=n.substring(t.raw.length);const s=i.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=`
|
|
31
|
+
`+t.raw,s.text+=`
|
|
32
|
+
`+t.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});continue}if(t=this.tokenizer.table(n)){n=n.substring(t.raw.length),i.push(t);continue}if(t=this.tokenizer.lheading(n)){n=n.substring(t.raw.length),i.push(t);continue}let a=n;if(this.options.extensions?.startBlock){let s=1/0;const u=n.slice(1);let p;this.options.extensions.startBlock.forEach(c=>{p=c.call({lexer:this},u),typeof p=="number"&&p>=0&&(s=Math.min(s,p))}),s<1/0&&s>=0&&(a=n.substring(0,s+1))}if(this.state.top&&(t=this.tokenizer.paragraph(a))){const s=i.at(-1);o&&s?.type==="paragraph"?(s.raw+=`
|
|
33
|
+
`+t.raw,s.text+=`
|
|
34
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):i.push(t),o=a.length!==n.length,n=n.substring(t.raw.length);continue}if(t=this.tokenizer.text(n)){n=n.substring(t.raw.length);const s=i.at(-1);s?.type==="text"?(s.raw+=`
|
|
35
|
+
`+t.raw,s.text+=`
|
|
36
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):i.push(t);continue}if(n){const s="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,i}inline(n,i=[]){return this.inlineQueue.push({src:n,tokens:i}),i}inlineTokens(n,i=[]){let o=n,t=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)u.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,t.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,s="";for(;n;){a||(s=""),a=!1;let u;if(this.options.extensions?.inline?.some(c=>(u=c.call({lexer:this},n,i))?(n=n.substring(u.raw.length),i.push(u),!0):!1))continue;if(u=this.tokenizer.escape(n)){n=n.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.tag(n)){n=n.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.link(n)){n=n.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(u.raw.length);const c=i.at(-1);u.type==="text"&&c?.type==="text"?(c.raw+=u.raw,c.text+=u.text):i.push(u);continue}if(u=this.tokenizer.emStrong(n,o,s)){n=n.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.codespan(n)){n=n.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.br(n)){n=n.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.del(n)){n=n.substring(u.raw.length),i.push(u);continue}if(u=this.tokenizer.autolink(n)){n=n.substring(u.raw.length),i.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(n))){n=n.substring(u.raw.length),i.push(u);continue}let p=n;if(this.options.extensions?.startInline){let c=1/0;const f=n.slice(1);let v;this.options.extensions.startInline.forEach(x=>{v=x.call({lexer:this},f),typeof v=="number"&&v>=0&&(c=Math.min(c,v))}),c<1/0&&c>=0&&(p=n.substring(0,c+1))}if(u=this.tokenizer.inlineText(p)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(s=u.raw.slice(-1)),a=!0;const c=i.at(-1);c?.type==="text"?(c.raw+=u.raw,c.text+=u.text):i.push(u);continue}if(n){const c="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return i}},Re=class{options;parser;constructor(r){this.options=r||ae}space(r){return""}code({text:r,lang:n,escaped:i}){const o=(n||"").match(G.notSpaceStart)?.[0],t=r.replace(G.endingNewline,"")+`
|
|
37
|
+
`;return o?'<pre><code class="language-'+J(o)+'">'+(i?t:J(t,!0))+`</code></pre>
|
|
38
|
+
`:"<pre><code>"+(i?t:J(t,!0))+`</code></pre>
|
|
39
|
+
`}blockquote({tokens:r}){return`<blockquote>
|
|
40
|
+
${this.parser.parse(r)}</blockquote>
|
|
41
|
+
`}html({text:r}){return r}heading({tokens:r,depth:n}){return`<h${n}>${this.parser.parseInline(r)}</h${n}>
|
|
42
|
+
`}hr(r){return`<hr>
|
|
43
|
+
`}list(r){const n=r.ordered,i=r.start;let o="";for(let s=0;s<r.items.length;s++){const u=r.items[s];o+=this.listitem(u)}const t=n?"ol":"ul",a=n&&i!==1?' start="'+i+'"':"";return"<"+t+a+`>
|
|
44
|
+
`+o+"</"+t+`>
|
|
45
|
+
`}listitem(r){let n="";if(r.task){const i=this.checkbox({checked:!!r.checked});r.loose?r.tokens[0]?.type==="paragraph"?(r.tokens[0].text=i+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&r.tokens[0].tokens[0].type==="text"&&(r.tokens[0].tokens[0].text=i+" "+J(r.tokens[0].tokens[0].text),r.tokens[0].tokens[0].escaped=!0)):r.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):n+=i+" "}return n+=this.parser.parse(r.tokens,!!r.loose),`<li>${n}</li>
|
|
46
|
+
`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
|
|
47
|
+
`}table(r){let n="",i="";for(let t=0;t<r.header.length;t++)i+=this.tablecell(r.header[t]);n+=this.tablerow({text:i});let o="";for(let t=0;t<r.rows.length;t++){const a=r.rows[t];i="";for(let s=0;s<a.length;s++)i+=this.tablecell(a[s]);o+=this.tablerow({text:i})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
48
|
+
<thead>
|
|
49
|
+
`+n+`</thead>
|
|
50
|
+
`+o+`</table>
|
|
51
|
+
`}tablerow({text:r}){return`<tr>
|
|
52
|
+
${r}</tr>
|
|
53
|
+
`}tablecell(r){const n=this.parser.parseInline(r.tokens),i=r.header?"th":"td";return(r.align?`<${i} align="${r.align}">`:`<${i}>`)+n+`</${i}>
|
|
54
|
+
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${J(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:n,tokens:i}){const o=this.parser.parseInline(i),t=sr(r);if(t===null)return o;r=t;let a='<a href="'+r+'"';return n&&(a+=' title="'+J(n)+'"'),a+=">"+o+"</a>",a}image({href:r,title:n,text:i,tokens:o}){o&&(i=this.parser.parseInline(o,this.parser.textRenderer));const t=sr(r);if(t===null)return J(i);r=t;let a=`<img src="${r}" alt="${i}"`;return n&&(a+=` title="${J(n)}"`),a+=">",a}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:J(r.text)}},un=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}},te=class Gn{options;renderer;textRenderer;constructor(n){this.options=n||ae,this.options.renderer=this.options.renderer||new Re,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new un}static parse(n,i){return new Gn(i).parse(n)}static parseInline(n,i){return new Gn(i).parseInline(n)}parse(n,i=!0){let o="";for(let t=0;t<n.length;t++){const a=n[t];if(this.options.extensions?.renderers?.[a.type]){const u=a,p=this.options.extensions.renderers[u.type].call({parser:this},u);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){o+=p||"";continue}}const s=a;switch(s.type){case"space":{o+=this.renderer.space(s);continue}case"hr":{o+=this.renderer.hr(s);continue}case"heading":{o+=this.renderer.heading(s);continue}case"code":{o+=this.renderer.code(s);continue}case"table":{o+=this.renderer.table(s);continue}case"blockquote":{o+=this.renderer.blockquote(s);continue}case"list":{o+=this.renderer.list(s);continue}case"html":{o+=this.renderer.html(s);continue}case"paragraph":{o+=this.renderer.paragraph(s);continue}case"text":{let u=s,p=this.renderer.text(u);for(;t+1<n.length&&n[t+1].type==="text";)u=n[++t],p+=`
|
|
55
|
+
`+this.renderer.text(u);i?o+=this.renderer.paragraph({type:"paragraph",raw:p,text:p,tokens:[{type:"text",raw:p,text:p,escaped:!0}]}):o+=p;continue}default:{const u='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return o}parseInline(n,i=this.renderer){let o="";for(let t=0;t<n.length;t++){const a=n[t];if(this.options.extensions?.renderers?.[a.type]){const u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){o+=u||"";continue}}const s=a;switch(s.type){case"escape":{o+=i.text(s);break}case"html":{o+=i.html(s);break}case"link":{o+=i.link(s);break}case"image":{o+=i.image(s);break}case"strong":{o+=i.strong(s);break}case"em":{o+=i.em(s);break}case"codespan":{o+=i.codespan(s);break}case"br":{o+=i.br(s);break}case"del":{o+=i.del(s);break}case"text":{o+=i.text(s);break}default:{const u='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return o}},Fe=class{options;block;constructor(r){this.options=r||ae}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}provideLexer(){return this.block?re.lex:re.lexInline}provideParser(){return this.block?te.parse:te.parseInline}},zt=class{defaults=Xe();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=te;Renderer=Re;TextRenderer=un;Lexer=re;Tokenizer=Ee;Hooks=Fe;constructor(...r){this.use(...r)}walkTokens(r,n){let i=[];for(const o of r)switch(i=i.concat(n.call(this,o)),o.type){case"table":{const t=o;for(const a of t.header)i=i.concat(this.walkTokens(a.tokens,n));for(const a of t.rows)for(const s of a)i=i.concat(this.walkTokens(s.tokens,n));break}case"list":{const t=o;i=i.concat(this.walkTokens(t.items,n));break}default:{const t=o;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(a=>{const s=t[a].flat(1/0);i=i.concat(this.walkTokens(s,n))}):t.tokens&&(i=i.concat(this.walkTokens(t.tokens,n)))}}return i}use(...r){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(i=>{const o={...i};if(o.async=this.defaults.async||o.async||!1,i.extensions&&(i.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const a=n.renderers[t.name];a?n.renderers[t.name]=function(...s){let u=t.renderer.apply(this,s);return u===!1&&(u=a.apply(this,s)),u}:n.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=n[t.level];a?a.unshift(t.tokenizer):n[t.level]=[t.tokenizer],t.start&&(t.level==="block"?n.startBlock?n.startBlock.push(t.start):n.startBlock=[t.start]:t.level==="inline"&&(n.startInline?n.startInline.push(t.start):n.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(n.childTokens[t.name]=t.childTokens)}),o.extensions=n),i.renderer){const t=this.defaults.renderer||new Re(this.defaults);for(const a in i.renderer){if(!(a in t))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;const s=a,u=i.renderer[s],p=t[s];t[s]=(...c)=>{let f=u.apply(t,c);return f===!1&&(f=p.apply(t,c)),f||""}}o.renderer=t}if(i.tokenizer){const t=this.defaults.tokenizer||new Ee(this.defaults);for(const a in i.tokenizer){if(!(a in t))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const s=a,u=i.tokenizer[s],p=t[s];t[s]=(...c)=>{let f=u.apply(t,c);return f===!1&&(f=p.apply(t,c)),f}}o.tokenizer=t}if(i.hooks){const t=this.defaults.hooks||new Fe;for(const a in i.hooks){if(!(a in t))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;const s=a,u=i.hooks[s],p=t[s];Fe.passThroughHooks.has(a)?t[s]=c=>{if(this.defaults.async)return Promise.resolve(u.call(t,c)).then(v=>p.call(t,v));const f=u.call(t,c);return p.call(t,f)}:t[s]=(...c)=>{let f=u.apply(t,c);return f===!1&&(f=p.apply(t,c)),f}}o.hooks=t}if(i.walkTokens){const t=this.defaults.walkTokens,a=i.walkTokens;o.walkTokens=function(s){let u=[];return u.push(a.call(this,s)),t&&(u=u.concat(t.call(this,s))),u}}this.defaults={...this.defaults,...o}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,n){return re.lex(r,n??this.defaults)}parser(r,n){return te.parse(r,n??this.defaults)}parseMarkdown(r){return(i,o)=>{const t={...o},a={...this.defaults,...t},s=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&t.async===!1)return s(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 i>"u"||i===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=r);const u=a.hooks?a.hooks.provideLexer():r?re.lex:re.lexInline,p=a.hooks?a.hooks.provideParser():r?te.parse:te.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(i):i).then(c=>u(c,a)).then(c=>a.hooks?a.hooks.processAllTokens(c):c).then(c=>a.walkTokens?Promise.all(this.walkTokens(c,a.walkTokens)).then(()=>c):c).then(c=>p(c,a)).then(c=>a.hooks?a.hooks.postprocess(c):c).catch(s);try{a.hooks&&(i=a.hooks.preprocess(i));let c=u(i,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let f=p(c,a);return a.hooks&&(f=a.hooks.postprocess(f)),f}catch(c){return s(c)}}}onError(r,n){return i=>{if(i.message+=`
|
|
56
|
+
Please report this to https://github.com/markedjs/marked.`,r){const o="<p>An error occurred:</p><pre>"+J(i.message+"",!0)+"</pre>";return n?Promise.resolve(o):o}if(n)return Promise.reject(i);throw i}}},se=new zt;function O(r,n){return se.parse(r,n)}O.options=O.setOptions=function(r){return se.setOptions(r),O.defaults=se.defaults,Wn(O.defaults),O},O.getDefaults=Xe,O.defaults=ae,O.use=function(...r){return se.use(...r),O.defaults=se.defaults,Wn(O.defaults),O},O.walkTokens=function(r,n){return se.walkTokens(r,n)},O.parseInline=se.parseInline,O.Parser=te,O.parser=te.parse,O.Renderer=Re,O.TextRenderer=un,O.Lexer=re,O.lexer=re.lex,O.Tokenizer=Ee,O.Hooks=Fe,O.parse=O,O.options,O.setOptions,O.use,O.walkTokens,O.parseInline,te.parse,re.lex;function Ht(r){if(typeof r=="function"&&(r={highlight:r}),!r||typeof r.highlight!="function")throw new Error("Must provide highlight function");return typeof r.langPrefix!="string"&&(r.langPrefix="language-"),typeof r.emptyLangClass!="string"&&(r.emptyLangClass=""),{async:!!r.async,walkTokens(n){if(n.type!=="code")return;const i=pr(n.lang);if(r.async)return Promise.resolve(r.highlight(n.text,i,n.lang||"")).then(fr(n));const o=r.highlight(n.text,i,n.lang||"");if(o instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");fr(n)(o)},useNewRenderer:!0,renderer:{code(n,i,o){typeof n=="object"&&(o=n.escaped,i=n.lang,n=n.text);const t=pr(i),a=t?r.langPrefix+mr(t):r.emptyLangClass,s=a?` class="${a}"`:"";return n=n.replace(/\n$/,""),`<pre><code${s}>${o?n:mr(n,!0)}
|
|
57
|
+
</code></pre>`}}}}function pr(r){return(r||"").match(/\S*/)[0]}function fr(r){return n=>{typeof n=="string"&&n!==r.text&&(r.escaped=!0,r.text=n)}}const hr=/[&<>"']/,jt=new RegExp(hr.source,"g"),dr=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Yt=new RegExp(dr.source,"g"),Ut={"&":"&","<":"<",">":">",'"':""","'":"'"},gr=r=>Ut[r];function mr(r,n){if(n){if(hr.test(r))return r.replace(jt,gr)}else if(dr.test(r))return r.replace(Yt,gr);return r}function Gt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Le={exports:{}},D={},pe={},le={},xr;function fe(){if(xr)return le;xr=1;function r(s){return typeof s>"u"||s===null}function n(s){return typeof s=="object"&&s!==null}function i(s){return Array.isArray(s)?s:r(s)?[]:[s]}function o(s,u){var p,c,f,v;if(u)for(v=Object.keys(u),p=0,c=v.length;p<c;p+=1)f=v[p],s[f]=u[f];return s}function t(s,u){var p="",c;for(c=0;c<u;c+=1)p+=s;return p}function a(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return le.isNothing=r,le.isObject=n,le.toArray=i,le.repeat=t,le.isNegativeZero=a,le.extend=o,le}var cn,kr;function ve(){if(kr)return cn;kr=1;function r(n,i){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=i,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(i){var o=this.name+": ";return o+=this.reason||"(unknown reason)",!i&&this.mark&&(o+=" "+this.mark.toString()),o},cn=r,cn}var pn,vr;function Zt(){if(vr)return pn;vr=1;var r=fe();function n(i,o,t,a,s){this.name=i,this.buffer=o,this.position=t,this.line=a,this.column=s}return n.prototype.getSnippet=function(o,t){var a,s,u,p,c;if(!this.buffer)return null;for(o=o||4,t=t||75,a="",s=this.position;s>0&&`\0\r
|
|
58
|
+
\u2028\u2029`.indexOf(this.buffer.charAt(s-1))===-1;)if(s-=1,this.position-s>t/2-1){a=" ... ",s+=5;break}for(u="",p=this.position;p<this.buffer.length&&`\0\r
|
|
59
|
+
\u2028\u2029`.indexOf(this.buffer.charAt(p))===-1;)if(p+=1,p-this.position>t/2-1){u=" ... ",p-=5;break}return c=this.buffer.slice(s,p),r.repeat(" ",o)+a+c+u+`
|
|
60
|
+
`+r.repeat(" ",o+this.position-s+a.length)+"^"},n.prototype.toString=function(o){var t,a="";return this.name&&(a+='in "'+this.name+'" '),a+="at line "+(this.line+1)+", column "+(this.column+1),o||(t=this.getSnippet(),t&&(a+=`:
|
|
61
|
+
`+t)),a},pn=n,pn}var fn,br;function B(){if(br)return fn;br=1;var r=ve(),n=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],i=["scalar","sequence","mapping"];function o(a){var s={};return a!==null&&Object.keys(a).forEach(function(u){a[u].forEach(function(p){s[String(p)]=u})}),s}function t(a,s){if(s=s||{},Object.keys(s).forEach(function(u){if(n.indexOf(u)===-1)throw new r('Unknown option "'+u+'" is met in definition of "'+a+'" YAML type.')}),this.tag=a,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(u){return u},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.defaultStyle=s.defaultStyle||null,this.styleAliases=o(s.styleAliases||null),i.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+a+'" YAML type.')}return fn=t,fn}var hn,yr;function he(){if(yr)return hn;yr=1;var r=fe(),n=ve(),i=B();function o(s,u,p){var c=[];return s.include.forEach(function(f){p=o(f,u,p)}),s[u].forEach(function(f){p.forEach(function(v,x){v.tag===f.tag&&v.kind===f.kind&&c.push(x)}),p.push(f)}),p.filter(function(f,v){return c.indexOf(v)===-1})}function t(){var s={scalar:{},sequence:{},mapping:{},fallback:{}},u,p;function c(f){s[f.kind][f.tag]=s.fallback[f.tag]=f}for(u=0,p=arguments.length;u<p;u+=1)arguments[u].forEach(c);return s}function a(s){this.include=s.include||[],this.implicit=s.implicit||[],this.explicit=s.explicit||[],this.implicit.forEach(function(u){if(u.loadKind&&u.loadKind!=="scalar")throw new n("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=o(this,"implicit",[]),this.compiledExplicit=o(this,"explicit",[]),this.compiledTypeMap=t(this.compiledImplicit,this.compiledExplicit)}return a.DEFAULT=null,a.create=function(){var u,p;switch(arguments.length){case 1:u=a.DEFAULT,p=arguments[0];break;case 2:u=arguments[0],p=arguments[1];break;default:throw new n("Wrong number of arguments for Schema.create function")}if(u=r.toArray(u),p=r.toArray(p),!u.every(function(c){return c instanceof a}))throw new n("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!p.every(function(c){return c instanceof i}))throw new n("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new a({include:u,explicit:p})},hn=a,hn}var dn,wr;function Kt(){if(wr)return dn;wr=1;var r=B();return dn=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:function(n){return n!==null?n:""}}),dn}var gn,Ar;function Wt(){if(Ar)return gn;Ar=1;var r=B();return gn=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(n){return n!==null?n:[]}}),gn}var mn,Sr;function Vt(){if(Sr)return mn;Sr=1;var r=B();return mn=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:function(n){return n!==null?n:{}}}),mn}var xn,Cr;function kn(){if(Cr)return xn;Cr=1;var r=he();return xn=new r({explicit:[Kt(),Wt(),Vt()]}),xn}var vn,Tr;function Qt(){if(Tr)return vn;Tr=1;var r=B();function n(t){if(t===null)return!0;var a=t.length;return a===1&&t==="~"||a===4&&(t==="null"||t==="Null"||t==="NULL")}function i(){return null}function o(t){return t===null}return vn=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"}),vn}var bn,_r;function Jt(){if(_r)return bn;_r=1;var r=B();function n(t){if(t===null)return!1;var a=t.length;return a===4&&(t==="true"||t==="True"||t==="TRUE")||a===5&&(t==="false"||t==="False"||t==="FALSE")}function i(t){return t==="true"||t==="True"||t==="TRUE"}function o(t){return Object.prototype.toString.call(t)==="[object Boolean]"}return bn=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:n,construct:i,predicate:o,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"}),bn}var yn,Er;function Xt(){if(Er)return yn;Er=1;var r=fe(),n=B();function i(p){return 48<=p&&p<=57||65<=p&&p<=70||97<=p&&p<=102}function o(p){return 48<=p&&p<=55}function t(p){return 48<=p&&p<=57}function a(p){if(p===null)return!1;var c=p.length,f=0,v=!1,x;if(!c)return!1;if(x=p[f],(x==="-"||x==="+")&&(x=p[++f]),x==="0"){if(f+1===c)return!0;if(x=p[++f],x==="b"){for(f++;f<c;f++)if(x=p[f],x!=="_"){if(x!=="0"&&x!=="1")return!1;v=!0}return v&&x!=="_"}if(x==="x"){for(f++;f<c;f++)if(x=p[f],x!=="_"){if(!i(p.charCodeAt(f)))return!1;v=!0}return v&&x!=="_"}for(;f<c;f++)if(x=p[f],x!=="_"){if(!o(p.charCodeAt(f)))return!1;v=!0}return v&&x!=="_"}if(x==="_")return!1;for(;f<c;f++)if(x=p[f],x!=="_"){if(x===":")break;if(!t(p.charCodeAt(f)))return!1;v=!0}return!v||x==="_"?!1:x!==":"?!0:/^(:[0-5]?[0-9])+$/.test(p.slice(f))}function s(p){var c=p,f=1,v,x,F=[];return c.indexOf("_")!==-1&&(c=c.replace(/_/g,"")),v=c[0],(v==="-"||v==="+")&&(v==="-"&&(f=-1),c=c.slice(1),v=c[0]),c==="0"?0:v==="0"?c[1]==="b"?f*parseInt(c.slice(2),2):c[1]==="x"?f*parseInt(c,16):f*parseInt(c,8):c.indexOf(":")!==-1?(c.split(":").forEach(function(_){F.unshift(parseInt(_,10))}),c=0,x=1,F.forEach(function(_){c+=_*x,x*=60}),f*c):f*parseInt(c,10)}function u(p){return Object.prototype.toString.call(p)==="[object Number]"&&p%1===0&&!r.isNegativeZero(p)}return yn=new n("tag:yaml.org,2002:int",{kind:"scalar",resolve:a,construct:s,predicate:u,represent:{binary:function(p){return p>=0?"0b"+p.toString(2):"-0b"+p.toString(2).slice(1)},octal:function(p){return p>=0?"0"+p.toString(8):"-0"+p.toString(8).slice(1)},decimal:function(p){return p.toString(10)},hexadecimal:function(p){return p>=0?"0x"+p.toString(16).toUpperCase():"-0x"+p.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),yn}var wn,Rr;function ei(){if(Rr)return wn;Rr=1;var r=fe(),n=B(),i=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function o(p){return!(p===null||!i.test(p)||p[p.length-1]==="_")}function t(p){var c,f,v,x;return c=p.replace(/_/g,"").toLowerCase(),f=c[0]==="-"?-1:1,x=[],"+-".indexOf(c[0])>=0&&(c=c.slice(1)),c===".inf"?f===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:c===".nan"?NaN:c.indexOf(":")>=0?(c.split(":").forEach(function(F){x.unshift(parseFloat(F,10))}),c=0,v=1,x.forEach(function(F){c+=F*v,v*=60}),f*c):f*parseFloat(c,10)}var a=/^[-+]?[0-9]+e/;function s(p,c){var f;if(isNaN(p))switch(c){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===p)switch(c){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===p)switch(c){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(p))return"-0.0";return f=p.toString(10),a.test(f)?f.replace("e",".e"):f}function u(p){return Object.prototype.toString.call(p)==="[object Number]"&&(p%1!==0||r.isNegativeZero(p))}return wn=new n("tag:yaml.org,2002:float",{kind:"scalar",resolve:o,construct:t,predicate:u,represent:s,defaultStyle:"lowercase"}),wn}var An,Fr;function Lr(){if(Fr)return An;Fr=1;var r=he();return An=new r({include:[kn()],implicit:[Qt(),Jt(),Xt(),ei()]}),An}var Sn,Ir;function $r(){if(Ir)return Sn;Ir=1;var r=he();return Sn=new r({include:[Lr()]}),Sn}var Cn,Or;function ni(){if(Or)return Cn;Or=1;var r=B(),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),i=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function o(s){return s===null?!1:n.exec(s)!==null||i.exec(s)!==null}function t(s){var u,p,c,f,v,x,F,_=0,$=null,H,Z,K;if(u=n.exec(s),u===null&&(u=i.exec(s)),u===null)throw new Error("Date resolve error");if(p=+u[1],c=+u[2]-1,f=+u[3],!u[4])return new Date(Date.UTC(p,c,f));if(v=+u[4],x=+u[5],F=+u[6],u[7]){for(_=u[7].slice(0,3);_.length<3;)_+="0";_=+_}return u[9]&&(H=+u[10],Z=+(u[11]||0),$=(H*60+Z)*6e4,u[9]==="-"&&($=-$)),K=new Date(Date.UTC(p,c,f,v,x,F,_)),$&&K.setTime(K.getTime()-$),K}function a(s){return s.toISOString()}return Cn=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:o,construct:t,instanceOf:Date,represent:a}),Cn}var Tn,Mr;function ri(){if(Mr)return Tn;Mr=1;var r=B();function n(i){return i==="<<"||i===null}return Tn=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:n}),Tn}function Dr(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var _n,Pr;function ti(){if(Pr)return _n;Pr=1;var r;try{var n=Dr;r=n("buffer").Buffer}catch{}var i=B(),o=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
62
|
+
\r`;function t(p){if(p===null)return!1;var c,f,v=0,x=p.length,F=o;for(f=0;f<x;f++)if(c=F.indexOf(p.charAt(f)),!(c>64)){if(c<0)return!1;v+=6}return v%8===0}function a(p){var c,f,v=p.replace(/[\r\n=]/g,""),x=v.length,F=o,_=0,$=[];for(c=0;c<x;c++)c%4===0&&c&&($.push(_>>16&255),$.push(_>>8&255),$.push(_&255)),_=_<<6|F.indexOf(v.charAt(c));return f=x%4*6,f===0?($.push(_>>16&255),$.push(_>>8&255),$.push(_&255)):f===18?($.push(_>>10&255),$.push(_>>2&255)):f===12&&$.push(_>>4&255),r?r.from?r.from($):new r($):$}function s(p){var c="",f=0,v,x,F=p.length,_=o;for(v=0;v<F;v++)v%3===0&&v&&(c+=_[f>>18&63],c+=_[f>>12&63],c+=_[f>>6&63],c+=_[f&63]),f=(f<<8)+p[v];return x=F%3,x===0?(c+=_[f>>18&63],c+=_[f>>12&63],c+=_[f>>6&63],c+=_[f&63]):x===2?(c+=_[f>>10&63],c+=_[f>>4&63],c+=_[f<<2&63],c+=_[64]):x===1&&(c+=_[f>>2&63],c+=_[f<<4&63],c+=_[64],c+=_[64]),c}function u(p){return r&&r.isBuffer(p)}return _n=new i("tag:yaml.org,2002:binary",{kind:"scalar",resolve:t,construct:a,predicate:u,represent:s}),_n}var En,qr;function ii(){if(qr)return En;qr=1;var r=B(),n=Object.prototype.hasOwnProperty,i=Object.prototype.toString;function o(a){if(a===null)return!0;var s=[],u,p,c,f,v,x=a;for(u=0,p=x.length;u<p;u+=1){if(c=x[u],v=!1,i.call(c)!=="[object Object]")return!1;for(f in c)if(n.call(c,f))if(!v)v=!0;else return!1;if(!v)return!1;if(s.indexOf(f)===-1)s.push(f);else return!1}return!0}function t(a){return a!==null?a:[]}return En=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:o,construct:t}),En}var Rn,Nr;function li(){if(Nr)return Rn;Nr=1;var r=B(),n=Object.prototype.toString;function i(t){if(t===null)return!0;var a,s,u,p,c,f=t;for(c=new Array(f.length),a=0,s=f.length;a<s;a+=1){if(u=f[a],n.call(u)!=="[object Object]"||(p=Object.keys(u),p.length!==1))return!1;c[a]=[p[0],u[p[0]]]}return!0}function o(t){if(t===null)return[];var a,s,u,p,c,f=t;for(c=new Array(f.length),a=0,s=f.length;a<s;a+=1)u=f[a],p=Object.keys(u),c[a]=[p[0],u[p[0]]];return c}return Rn=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:i,construct:o}),Rn}var Fn,Br;function oi(){if(Br)return Fn;Br=1;var r=B(),n=Object.prototype.hasOwnProperty;function i(t){if(t===null)return!0;var a,s=t;for(a in s)if(n.call(s,a)&&s[a]!==null)return!1;return!0}function o(t){return t!==null?t:{}}return Fn=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:i,construct:o}),Fn}var Ln,zr;function be(){if(zr)return Ln;zr=1;var r=he();return Ln=new r({include:[$r()],implicit:[ni(),ri()],explicit:[ti(),ii(),li(),oi()]}),Ln}var In,Hr;function ai(){if(Hr)return In;Hr=1;var r=B();function n(){return!0}function i(){}function o(){return""}function t(a){return typeof a>"u"}return In=new r("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:n,construct:i,predicate:t,represent:o}),In}var $n,jr;function si(){if(jr)return $n;jr=1;var r=B();function n(a){if(a===null||a.length===0)return!1;var s=a,u=/\/([gim]*)$/.exec(a),p="";return!(s[0]==="/"&&(u&&(p=u[1]),p.length>3||s[s.length-p.length-1]!=="/"))}function i(a){var s=a,u=/\/([gim]*)$/.exec(a),p="";return s[0]==="/"&&(u&&(p=u[1]),s=s.slice(1,s.length-p.length-1)),new RegExp(s,p)}function o(a){var s="/"+a.source+"/";return a.global&&(s+="g"),a.multiline&&(s+="m"),a.ignoreCase&&(s+="i"),s}function t(a){return Object.prototype.toString.call(a)==="[object RegExp]"}return $n=new r("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:n,construct:i,predicate:t,represent:o}),$n}var On,Yr;function ui(){if(Yr)return On;Yr=1;var r;try{var n=Dr;r=n("esprima")}catch{typeof window<"u"&&(r=window.esprima)}var i=B();function o(u){if(u===null)return!1;try{var p="("+u+")",c=r.parse(p,{range:!0});return!(c.type!=="Program"||c.body.length!==1||c.body[0].type!=="ExpressionStatement"||c.body[0].expression.type!=="ArrowFunctionExpression"&&c.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function t(u){var p="("+u+")",c=r.parse(p,{range:!0}),f=[],v;if(c.type!=="Program"||c.body.length!==1||c.body[0].type!=="ExpressionStatement"||c.body[0].expression.type!=="ArrowFunctionExpression"&&c.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return c.body[0].expression.params.forEach(function(x){f.push(x.name)}),v=c.body[0].expression.body.range,c.body[0].expression.body.type==="BlockStatement"?new Function(f,p.slice(v[0]+1,v[1]-1)):new Function(f,"return "+p.slice(v[0],v[1]))}function a(u){return u.toString()}function s(u){return Object.prototype.toString.call(u)==="[object Function]"}return On=new i("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:o,construct:t,predicate:s,represent:a}),On}var Mn,Ur;function Ie(){if(Ur)return Mn;Ur=1;var r=he();return Mn=r.DEFAULT=new r({include:[be()],explicit:[ai(),si(),ui()]}),Mn}var Gr;function ci(){if(Gr)return pe;Gr=1;var r=fe(),n=ve(),i=Zt(),o=be(),t=Ie(),a=Object.prototype.hasOwnProperty,s=1,u=2,p=3,c=4,f=1,v=2,x=3,F=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,_=/[\x85\u2028\u2029]/,$=/[,\[\]\{\}]/,H=/^(?:!|!!|![a-z\-]+!)$/i,Z=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function K(e){return Object.prototype.toString.call(e)}function j(e){return e===10||e===13}function W(e){return e===9||e===32}function z(e){return e===9||e===32||e===10||e===13}function V(e){return e===44||e===91||e===93||e===123||e===125}function ie(e){var h;return 48<=e&&e<=57?e-48:(h=e|32,97<=h&&h<=102?h-97+10:-1)}function Oe(e){return e===120?2:e===117?4:e===85?8:0}function Me(e){return 48<=e&&e<=57?e-48:-1}function De(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
63
|
+
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Pe(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}for(var qe=new Array(256),ye=new Array(256),P=0;P<256;P++)qe[P]=De(P)?1:0,ye[P]=De(P);function Bn(e,h){this.input=e,this.filename=h.filename||null,this.schema=h.schema||t,this.onWarning=h.onWarning||null,this.legacy=h.legacy||!1,this.json=h.json||!1,this.listener=h.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function Ne(e,h){return new n(h,new i(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function R(e,h){throw Ne(e,h)}function de(e,h){e.onWarning&&e.onWarning.call(null,Ne(e,h))}var we={YAML:function(h,k,C){var b,T,l;h.version!==null&&R(h,"duplication of %YAML directive"),C.length!==1&&R(h,"YAML directive accepts exactly one argument"),b=/^([0-9]+)\.([0-9]+)$/.exec(C[0]),b===null&&R(h,"ill-formed argument of the YAML directive"),T=parseInt(b[1],10),l=parseInt(b[2],10),T!==1&&R(h,"unacceptable YAML version of the document"),h.version=C[0],h.checkLineBreaks=l<2,l!==1&&l!==2&&de(h,"unsupported YAML version of the document")},TAG:function(h,k,C){var b,T;C.length!==2&&R(h,"TAG directive accepts exactly two arguments"),b=C[0],T=C[1],H.test(b)||R(h,"ill-formed tag handle (first argument) of the TAG directive"),a.call(h.tagMap,b)&&R(h,'there is a previously declared suffix for "'+b+'" tag handle'),Z.test(T)||R(h,"ill-formed tag prefix (second argument) of the TAG directive"),h.tagMap[b]=T}};function Q(e,h,k,C){var b,T,l,d;if(h<k){if(d=e.input.slice(h,k),C)for(b=0,T=d.length;b<T;b+=1)l=d.charCodeAt(b),l===9||32<=l&&l<=1114111||R(e,"expected valid JSON character");else F.test(d)&&R(e,"the stream contains non-printable characters");e.result+=d}}function Be(e,h,k,C){var b,T,l,d;for(r.isObject(k)||R(e,"cannot merge mappings; the provided source object is unacceptable"),b=Object.keys(k),l=0,d=b.length;l<d;l+=1)T=b[l],a.call(h,T)||(h[T]=k[T],C[T]=!0)}function X(e,h,k,C,b,T,l,d){var g,A;if(Array.isArray(b))for(b=Array.prototype.slice.call(b),g=0,A=b.length;g<A;g+=1)Array.isArray(b[g])&&R(e,"nested arrays are not supported inside keys"),typeof b=="object"&&K(b[g])==="[object Object]"&&(b[g]="[object Object]");if(typeof b=="object"&&K(b)==="[object Object]"&&(b="[object Object]"),b=String(b),h===null&&(h={}),C==="tag:yaml.org,2002:merge")if(Array.isArray(T))for(g=0,A=T.length;g<A;g+=1)Be(e,h,T[g],k);else Be(e,h,T,k);else!e.json&&!a.call(k,b)&&a.call(h,b)&&(e.line=l||e.line,e.position=d||e.position,R(e,"duplicated mapping key")),h[b]=T,delete k[b];return h}function ee(e){var h;h=e.input.charCodeAt(e.position),h===10?e.position++:h===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):R(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function q(e,h,k){for(var C=0,b=e.input.charCodeAt(e.position);b!==0;){for(;W(b);)b=e.input.charCodeAt(++e.position);if(h&&b===35)do b=e.input.charCodeAt(++e.position);while(b!==10&&b!==13&&b!==0);if(j(b))for(ee(e),b=e.input.charCodeAt(e.position),C++,e.lineIndent=0;b===32;)e.lineIndent++,b=e.input.charCodeAt(++e.position);else break}return k!==-1&&C!==0&&e.lineIndent<k&&de(e,"deficient indentation"),C}function ue(e){var h=e.position,k;return k=e.input.charCodeAt(h),!!((k===45||k===46)&&k===e.input.charCodeAt(h+1)&&k===e.input.charCodeAt(h+2)&&(h+=3,k=e.input.charCodeAt(h),k===0||z(k)))}function Ae(e,h){h===1?e.result+=" ":h>1&&(e.result+=r.repeat(`
|
|
64
|
+
`,h-1))}function ze(e,h,k){var C,b,T,l,d,g,A,w,m=e.kind,S=e.result,y;if(y=e.input.charCodeAt(e.position),z(y)||V(y)||y===35||y===38||y===42||y===33||y===124||y===62||y===39||y===34||y===37||y===64||y===96||(y===63||y===45)&&(b=e.input.charCodeAt(e.position+1),z(b)||k&&V(b)))return!1;for(e.kind="scalar",e.result="",T=l=e.position,d=!1;y!==0;){if(y===58){if(b=e.input.charCodeAt(e.position+1),z(b)||k&&V(b))break}else if(y===35){if(C=e.input.charCodeAt(e.position-1),z(C))break}else{if(e.position===e.lineStart&&ue(e)||k&&V(y))break;if(j(y))if(g=e.line,A=e.lineStart,w=e.lineIndent,q(e,!1,-1),e.lineIndent>=h){d=!0,y=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=g,e.lineStart=A,e.lineIndent=w;break}}d&&(Q(e,T,l,!1),Ae(e,e.line-g),T=l=e.position,d=!1),W(y)||(l=e.position+1),y=e.input.charCodeAt(++e.position)}return Q(e,T,l,!1),e.result?!0:(e.kind=m,e.result=S,!1)}function He(e,h){var k,C,b;if(k=e.input.charCodeAt(e.position),k!==39)return!1;for(e.kind="scalar",e.result="",e.position++,C=b=e.position;(k=e.input.charCodeAt(e.position))!==0;)if(k===39)if(Q(e,C,e.position,!0),k=e.input.charCodeAt(++e.position),k===39)C=e.position,e.position++,b=e.position;else return!0;else j(k)?(Q(e,C,b,!0),Ae(e,q(e,!1,h)),C=b=e.position):e.position===e.lineStart&&ue(e)?R(e,"unexpected end of the document within a single quoted scalar"):(e.position++,b=e.position);R(e,"unexpected end of the stream within a single quoted scalar")}function je(e,h){var k,C,b,T,l,d;if(d=e.input.charCodeAt(e.position),d!==34)return!1;for(e.kind="scalar",e.result="",e.position++,k=C=e.position;(d=e.input.charCodeAt(e.position))!==0;){if(d===34)return Q(e,k,e.position,!0),e.position++,!0;if(d===92){if(Q(e,k,e.position,!0),d=e.input.charCodeAt(++e.position),j(d))q(e,!1,h);else if(d<256&&qe[d])e.result+=ye[d],e.position++;else if((l=Oe(d))>0){for(b=l,T=0;b>0;b--)d=e.input.charCodeAt(++e.position),(l=ie(d))>=0?T=(T<<4)+l:R(e,"expected hexadecimal character");e.result+=Pe(T),e.position++}else R(e,"unknown escape sequence");k=C=e.position}else j(d)?(Q(e,k,C,!0),Ae(e,q(e,!1,h)),k=C=e.position):e.position===e.lineStart&&ue(e)?R(e,"unexpected end of the document within a double quoted scalar"):(e.position++,C=e.position)}R(e,"unexpected end of the stream within a double quoted scalar")}function Ye(e,h){var k=!0,C,b=e.tag,T,l=e.anchor,d,g,A,w,m,S={},y,E,I,L;if(L=e.input.charCodeAt(e.position),L===91)g=93,m=!1,T=[];else if(L===123)g=125,m=!0,T={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=T),L=e.input.charCodeAt(++e.position);L!==0;){if(q(e,!0,h),L=e.input.charCodeAt(e.position),L===g)return e.position++,e.tag=b,e.anchor=l,e.kind=m?"mapping":"sequence",e.result=T,!0;k||R(e,"missed comma between flow collection entries"),E=y=I=null,A=w=!1,L===63&&(d=e.input.charCodeAt(e.position+1),z(d)&&(A=w=!0,e.position++,q(e,!0,h))),C=e.line,oe(e,h,s,!1,!0),E=e.tag,y=e.result,q(e,!0,h),L=e.input.charCodeAt(e.position),(w||e.line===C)&&L===58&&(A=!0,L=e.input.charCodeAt(++e.position),q(e,!0,h),oe(e,h,s,!1,!0),I=e.result),m?X(e,T,S,E,y,I):A?T.push(X(e,null,S,E,y,I)):T.push(y),q(e,!0,h),L=e.input.charCodeAt(e.position),L===44?(k=!0,L=e.input.charCodeAt(++e.position)):k=!1}R(e,"unexpected end of the stream within a flow collection")}function Ue(e,h){var k,C,b=f,T=!1,l=!1,d=h,g=0,A=!1,w,m;if(m=e.input.charCodeAt(e.position),m===124)C=!1;else if(m===62)C=!0;else return!1;for(e.kind="scalar",e.result="";m!==0;)if(m=e.input.charCodeAt(++e.position),m===43||m===45)f===b?b=m===43?x:v:R(e,"repeat of a chomping mode identifier");else if((w=Me(m))>=0)w===0?R(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?R(e,"repeat of an indentation width identifier"):(d=h+w-1,l=!0);else break;if(W(m)){do m=e.input.charCodeAt(++e.position);while(W(m));if(m===35)do m=e.input.charCodeAt(++e.position);while(!j(m)&&m!==0)}for(;m!==0;){for(ee(e),e.lineIndent=0,m=e.input.charCodeAt(e.position);(!l||e.lineIndent<d)&&m===32;)e.lineIndent++,m=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>d&&(d=e.lineIndent),j(m)){g++;continue}if(e.lineIndent<d){b===x?e.result+=r.repeat(`
|
|
65
|
+
`,T?1+g:g):b===f&&T&&(e.result+=`
|
|
66
|
+
`);break}for(C?W(m)?(A=!0,e.result+=r.repeat(`
|
|
67
|
+
`,T?1+g:g)):A?(A=!1,e.result+=r.repeat(`
|
|
68
|
+
`,g+1)):g===0?T&&(e.result+=" "):e.result+=r.repeat(`
|
|
69
|
+
`,g):e.result+=r.repeat(`
|
|
70
|
+
`,T?1+g:g),T=!0,l=!0,g=0,k=e.position;!j(m)&&m!==0;)m=e.input.charCodeAt(++e.position);Q(e,k,e.position,!1)}return!0}function ce(e,h){var k,C=e.tag,b=e.anchor,T=[],l,d=!1,g;for(e.anchor!==null&&(e.anchorMap[e.anchor]=T),g=e.input.charCodeAt(e.position);g!==0&&!(g!==45||(l=e.input.charCodeAt(e.position+1),!z(l)));){if(d=!0,e.position++,q(e,!0,-1)&&e.lineIndent<=h){T.push(null),g=e.input.charCodeAt(e.position);continue}if(k=e.line,oe(e,h,p,!1,!0),T.push(e.result),q(e,!0,-1),g=e.input.charCodeAt(e.position),(e.line===k||e.lineIndent>h)&&g!==0)R(e,"bad indentation of a sequence entry");else if(e.lineIndent<h)break}return d?(e.tag=C,e.anchor=b,e.kind="sequence",e.result=T,!0):!1}function zn(e,h,k){var C,b,T,l,d=e.tag,g=e.anchor,A={},w={},m=null,S=null,y=null,E=!1,I=!1,L;for(e.anchor!==null&&(e.anchorMap[e.anchor]=A),L=e.input.charCodeAt(e.position);L!==0;){if(C=e.input.charCodeAt(e.position+1),T=e.line,l=e.position,(L===63||L===58)&&z(C))L===63?(E&&(X(e,A,w,m,S,null),m=S=y=null),I=!0,E=!0,b=!0):E?(E=!1,b=!0):R(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,L=C;else if(oe(e,k,u,!1,!0))if(e.line===T){for(L=e.input.charCodeAt(e.position);W(L);)L=e.input.charCodeAt(++e.position);if(L===58)L=e.input.charCodeAt(++e.position),z(L)||R(e,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(X(e,A,w,m,S,null),m=S=y=null),I=!0,E=!1,b=!1,m=e.tag,S=e.result;else if(I)R(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=g,!0}else if(I)R(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=g,!0;else break;if((e.line===T||e.lineIndent>h)&&(oe(e,h,c,!0,b)&&(E?S=e.result:y=e.result),E||(X(e,A,w,m,S,y,T,l),m=S=y=null),q(e,!0,-1),L=e.input.charCodeAt(e.position)),e.lineIndent>h&&L!==0)R(e,"bad indentation of a mapping entry");else if(e.lineIndent<h)break}return E&&X(e,A,w,m,S,null),I&&(e.tag=d,e.anchor=g,e.kind="mapping",e.result=A),I}function Hn(e){var h,k=!1,C=!1,b,T,l;if(l=e.input.charCodeAt(e.position),l!==33)return!1;if(e.tag!==null&&R(e,"duplication of a tag property"),l=e.input.charCodeAt(++e.position),l===60?(k=!0,l=e.input.charCodeAt(++e.position)):l===33?(C=!0,b="!!",l=e.input.charCodeAt(++e.position)):b="!",h=e.position,k){do l=e.input.charCodeAt(++e.position);while(l!==0&&l!==62);e.position<e.length?(T=e.input.slice(h,e.position),l=e.input.charCodeAt(++e.position)):R(e,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!z(l);)l===33&&(C?R(e,"tag suffix cannot contain exclamation marks"):(b=e.input.slice(h-1,e.position+1),H.test(b)||R(e,"named tag handle cannot contain such characters"),C=!0,h=e.position+1)),l=e.input.charCodeAt(++e.position);T=e.input.slice(h,e.position),$.test(T)&&R(e,"tag suffix cannot contain flow indicator characters")}return T&&!Z.test(T)&&R(e,"tag name cannot contain such characters: "+T),k?e.tag=T:a.call(e.tagMap,b)?e.tag=e.tagMap[b]+T:b==="!"?e.tag="!"+T:b==="!!"?e.tag="tag:yaml.org,2002:"+T:R(e,'undeclared tag handle "'+b+'"'),!0}function Ge(e){var h,k;if(k=e.input.charCodeAt(e.position),k!==38)return!1;for(e.anchor!==null&&R(e,"duplication of an anchor property"),k=e.input.charCodeAt(++e.position),h=e.position;k!==0&&!z(k)&&!V(k);)k=e.input.charCodeAt(++e.position);return e.position===h&&R(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(h,e.position),!0}function Ze(e){var h,k,C;if(C=e.input.charCodeAt(e.position),C!==42)return!1;for(C=e.input.charCodeAt(++e.position),h=e.position;C!==0&&!z(C)&&!V(C);)C=e.input.charCodeAt(++e.position);return e.position===h&&R(e,"name of an alias node must contain at least one character"),k=e.input.slice(h,e.position),a.call(e.anchorMap,k)||R(e,'unidentified alias "'+k+'"'),e.result=e.anchorMap[k],q(e,!0,-1),!0}function oe(e,h,k,C,b){var T,l,d,g=1,A=!1,w=!1,m,S,y,E,I;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,T=l=d=c===k||p===k,C&&q(e,!0,-1)&&(A=!0,e.lineIndent>h?g=1:e.lineIndent===h?g=0:e.lineIndent<h&&(g=-1)),g===1)for(;Hn(e)||Ge(e);)q(e,!0,-1)?(A=!0,d=T,e.lineIndent>h?g=1:e.lineIndent===h?g=0:e.lineIndent<h&&(g=-1)):d=!1;if(d&&(d=A||b),(g===1||c===k)&&(s===k||u===k?E=h:E=h+1,I=e.position-e.lineStart,g===1?d&&(ce(e,I)||zn(e,I,E))||Ye(e,E)?w=!0:(l&&Ue(e,E)||He(e,E)||je(e,E)?w=!0:Ze(e)?(w=!0,(e.tag!==null||e.anchor!==null)&&R(e,"alias node should not have any properties")):ze(e,E,s===k)&&(w=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):g===0&&(w=d&&ce(e,I))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&R(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),m=0,S=e.implicitTypes.length;m<S;m+=1)if(y=e.implicitTypes[m],y.resolve(e.result)){e.result=y.construct(e.result),e.tag=y.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else a.call(e.typeMap[e.kind||"fallback"],e.tag)?(y=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&y.kind!==e.kind&&R(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+y.kind+'", not "'+e.kind+'"'),y.resolve(e.result)?(e.result=y.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):R(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):R(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||w}function Ke(e){var h=e.position,k,C,b,T=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(l=e.input.charCodeAt(e.position))!==0&&(q(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(T=!0,l=e.input.charCodeAt(++e.position),k=e.position;l!==0&&!z(l);)l=e.input.charCodeAt(++e.position);for(C=e.input.slice(k,e.position),b=[],C.length<1&&R(e,"directive name must not be less than one character in length");l!==0;){for(;W(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!j(l));break}if(j(l))break;for(k=e.position;l!==0&&!z(l);)l=e.input.charCodeAt(++e.position);b.push(e.input.slice(k,e.position))}l!==0&&ee(e),a.call(we,C)?we[C](e,C,b):de(e,'unknown document directive "'+C+'"')}if(q(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,q(e,!0,-1)):T&&R(e,"directives end mark is expected"),oe(e,e.lineIndent-1,c,!1,!0),q(e,!0,-1),e.checkLineBreaks&&_.test(e.input.slice(h,e.position))&&de(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ue(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,q(e,!0,-1));return}if(e.position<e.length-1)R(e,"end of the stream or a document separator is expected");else return}function We(e,h){e=String(e),h=h||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
71
|
+
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var k=new Bn(e,h),C=e.indexOf("\0");for(C!==-1&&(k.position=C,R(k,"null byte is not allowed in input")),k.input+="\0";k.input.charCodeAt(k.position)===32;)k.lineIndent+=1,k.position+=1;for(;k.position<k.length-1;)Ke(k);return k.documents}function Ve(e,h,k){h!==null&&typeof h=="object"&&typeof k>"u"&&(k=h,h=null);var C=We(e,k);if(typeof h!="function")return C;for(var b=0,T=C.length;b<T;b+=1)h(C[b])}function Qe(e,h){var k=We(e,h);if(k.length!==0){if(k.length===1)return k[0];throw new n("expected a single document in the stream, but found more")}}function jn(e,h,k){return typeof h=="object"&&h!==null&&typeof k>"u"&&(k=h,h=null),Ve(e,h,r.extend({schema:o},k))}function Yn(e,h){return Qe(e,r.extend({schema:o},h))}return pe.loadAll=Ve,pe.load=Qe,pe.safeLoadAll=jn,pe.safeLoad=Yn,pe}var $e={},Zr;function pi(){if(Zr)return $e;Zr=1;var r=fe(),n=ve(),i=Ie(),o=be(),t=Object.prototype.toString,a=Object.prototype.hasOwnProperty,s=9,u=10,p=13,c=32,f=33,v=34,x=35,F=37,_=38,$=39,H=42,Z=44,K=45,j=58,W=61,z=62,V=63,ie=64,Oe=91,Me=93,De=96,Pe=123,qe=124,ye=125,P={};P[0]="\\0",P[7]="\\a",P[8]="\\b",P[9]="\\t",P[10]="\\n",P[11]="\\v",P[12]="\\f",P[13]="\\r",P[27]="\\e",P[34]='\\"',P[92]="\\\\",P[133]="\\N",P[160]="\\_",P[8232]="\\L",P[8233]="\\P";var Bn=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Ne(l,d){var g,A,w,m,S,y,E;if(d===null)return{};for(g={},A=Object.keys(d),w=0,m=A.length;w<m;w+=1)S=A[w],y=String(d[S]),S.slice(0,2)==="!!"&&(S="tag:yaml.org,2002:"+S.slice(2)),E=l.compiledTypeMap.fallback[S],E&&a.call(E.styleAliases,y)&&(y=E.styleAliases[y]),g[S]=y;return g}function R(l){var d,g,A;if(d=l.toString(16).toUpperCase(),l<=255)g="x",A=2;else if(l<=65535)g="u",A=4;else if(l<=4294967295)g="U",A=8;else throw new n("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+g+r.repeat("0",A-d.length)+d}function de(l){this.schema=l.schema||i,this.indent=Math.max(1,l.indent||2),this.noArrayIndent=l.noArrayIndent||!1,this.skipInvalid=l.skipInvalid||!1,this.flowLevel=r.isNothing(l.flowLevel)?-1:l.flowLevel,this.styleMap=Ne(this.schema,l.styles||null),this.sortKeys=l.sortKeys||!1,this.lineWidth=l.lineWidth||80,this.noRefs=l.noRefs||!1,this.noCompatMode=l.noCompatMode||!1,this.condenseFlow=l.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function we(l,d){for(var g=r.repeat(" ",d),A=0,w=-1,m="",S,y=l.length;A<y;)w=l.indexOf(`
|
|
72
|
+
`,A),w===-1?(S=l.slice(A),A=y):(S=l.slice(A,w+1),A=w+1),S.length&&S!==`
|
|
73
|
+
`&&(m+=g),m+=S;return m}function Q(l,d){return`
|
|
74
|
+
`+r.repeat(" ",l.indent*d)}function Be(l,d){var g,A,w;for(g=0,A=l.implicitTypes.length;g<A;g+=1)if(w=l.implicitTypes[g],w.resolve(d))return!0;return!1}function X(l){return l===c||l===s}function ee(l){return 32<=l&&l<=126||161<=l&&l<=55295&&l!==8232&&l!==8233||57344<=l&&l<=65533&&l!==65279||65536<=l&&l<=1114111}function q(l){return ee(l)&&!X(l)&&l!==65279&&l!==p&&l!==u}function ue(l,d){return ee(l)&&l!==65279&&l!==Z&&l!==Oe&&l!==Me&&l!==Pe&&l!==ye&&l!==j&&(l!==x||d&&q(d))}function Ae(l){return ee(l)&&l!==65279&&!X(l)&&l!==K&&l!==V&&l!==j&&l!==Z&&l!==Oe&&l!==Me&&l!==Pe&&l!==ye&&l!==x&&l!==_&&l!==H&&l!==f&&l!==qe&&l!==W&&l!==z&&l!==$&&l!==v&&l!==F&&l!==ie&&l!==De}function ze(l){var d=/^\n* /;return d.test(l)}var He=1,je=2,Ye=3,Ue=4,ce=5;function zn(l,d,g,A,w){var m,S,y,E=!1,I=!1,L=A!==-1,ne=-1,Y=Ae(l.charCodeAt(0))&&!X(l.charCodeAt(l.length-1));if(d)for(m=0;m<l.length;m++){if(S=l.charCodeAt(m),!ee(S))return ce;y=m>0?l.charCodeAt(m-1):null,Y=Y&&ue(S,y)}else{for(m=0;m<l.length;m++){if(S=l.charCodeAt(m),S===u)E=!0,L&&(I=I||m-ne-1>A&&l[ne+1]!==" ",ne=m);else if(!ee(S))return ce;y=m>0?l.charCodeAt(m-1):null,Y=Y&&ue(S,y)}I=I||L&&m-ne-1>A&&l[ne+1]!==" "}return!E&&!I?Y&&!w(l)?He:je:g>9&&ze(l)?ce:I?Ue:Ye}function Hn(l,d,g,A){l.dump=(function(){if(d.length===0)return"''";if(!l.noCompatMode&&Bn.indexOf(d)!==-1)return"'"+d+"'";var w=l.indent*Math.max(1,g),m=l.lineWidth===-1?-1:Math.max(Math.min(l.lineWidth,40),l.lineWidth-w),S=A||l.flowLevel>-1&&g>=l.flowLevel;function y(E){return Be(l,E)}switch(zn(d,S,l.indent,m,y)){case He:return d;case je:return"'"+d.replace(/'/g,"''")+"'";case Ye:return"|"+Ge(d,l.indent)+Ze(we(d,w));case Ue:return">"+Ge(d,l.indent)+Ze(we(oe(d,m),w));case ce:return'"'+We(d)+'"';default:throw new n("impossible error: invalid scalar style")}})()}function Ge(l,d){var g=ze(l)?String(d):"",A=l[l.length-1]===`
|
|
75
|
+
`,w=A&&(l[l.length-2]===`
|
|
76
|
+
`||l===`
|
|
77
|
+
`),m=w?"+":A?"":"-";return g+m+`
|
|
78
|
+
`}function Ze(l){return l[l.length-1]===`
|
|
79
|
+
`?l.slice(0,-1):l}function oe(l,d){for(var g=/(\n+)([^\n]*)/g,A=(function(){var I=l.indexOf(`
|
|
80
|
+
`);return I=I!==-1?I:l.length,g.lastIndex=I,Ke(l.slice(0,I),d)})(),w=l[0]===`
|
|
81
|
+
`||l[0]===" ",m,S;S=g.exec(l);){var y=S[1],E=S[2];m=E[0]===" ",A+=y+(!w&&!m&&E!==""?`
|
|
82
|
+
`:"")+Ke(E,d),w=m}return A}function Ke(l,d){if(l===""||l[0]===" ")return l;for(var g=/ [^ ]/g,A,w=0,m,S=0,y=0,E="";A=g.exec(l);)y=A.index,y-w>d&&(m=S>w?S:y,E+=`
|
|
83
|
+
`+l.slice(w,m),w=m+1),S=y;return E+=`
|
|
84
|
+
`,l.length-w>d&&S>w?E+=l.slice(w,S)+`
|
|
85
|
+
`+l.slice(S+1):E+=l.slice(w),E.slice(1)}function We(l){for(var d="",g,A,w,m=0;m<l.length;m++){if(g=l.charCodeAt(m),g>=55296&&g<=56319&&(A=l.charCodeAt(m+1),A>=56320&&A<=57343)){d+=R((g-55296)*1024+A-56320+65536),m++;continue}w=P[g],d+=!w&&ee(g)?l[m]:w||R(g)}return d}function Ve(l,d,g){var A="",w=l.tag,m,S;for(m=0,S=g.length;m<S;m+=1)h(l,d,g[m],!1,!1)&&(m!==0&&(A+=","+(l.condenseFlow?"":" ")),A+=l.dump);l.tag=w,l.dump="["+A+"]"}function Qe(l,d,g,A){var w="",m=l.tag,S,y;for(S=0,y=g.length;S<y;S+=1)h(l,d+1,g[S],!0,!0)&&((!A||S!==0)&&(w+=Q(l,d)),l.dump&&u===l.dump.charCodeAt(0)?w+="-":w+="- ",w+=l.dump);l.tag=m,l.dump=w||"[]"}function jn(l,d,g){var A="",w=l.tag,m=Object.keys(g),S,y,E,I,L;for(S=0,y=m.length;S<y;S+=1)L="",S!==0&&(L+=", "),l.condenseFlow&&(L+='"'),E=m[S],I=g[E],h(l,d,E,!1,!1)&&(l.dump.length>1024&&(L+="? "),L+=l.dump+(l.condenseFlow?'"':"")+":"+(l.condenseFlow?"":" "),h(l,d,I,!1,!1)&&(L+=l.dump,A+=L));l.tag=w,l.dump="{"+A+"}"}function Yn(l,d,g,A){var w="",m=l.tag,S=Object.keys(g),y,E,I,L,ne,Y;if(l.sortKeys===!0)S.sort();else if(typeof l.sortKeys=="function")S.sort(l.sortKeys);else if(l.sortKeys)throw new n("sortKeys must be a boolean or a function");for(y=0,E=S.length;y<E;y+=1)Y="",(!A||y!==0)&&(Y+=Q(l,d)),I=S[y],L=g[I],h(l,d+1,I,!0,!0,!0)&&(ne=l.tag!==null&&l.tag!=="?"||l.dump&&l.dump.length>1024,ne&&(l.dump&&u===l.dump.charCodeAt(0)?Y+="?":Y+="? "),Y+=l.dump,ne&&(Y+=Q(l,d)),h(l,d+1,L,!0,ne)&&(l.dump&&u===l.dump.charCodeAt(0)?Y+=":":Y+=": ",Y+=l.dump,w+=Y));l.tag=m,l.dump=w||"{}"}function e(l,d,g){var A,w,m,S,y,E;for(w=g?l.explicitTypes:l.implicitTypes,m=0,S=w.length;m<S;m+=1)if(y=w[m],(y.instanceOf||y.predicate)&&(!y.instanceOf||typeof d=="object"&&d instanceof y.instanceOf)&&(!y.predicate||y.predicate(d))){if(l.tag=g?y.tag:"?",y.represent){if(E=l.styleMap[y.tag]||y.defaultStyle,t.call(y.represent)==="[object Function]")A=y.represent(d,E);else if(a.call(y.represent,E))A=y.represent[E](d,E);else throw new n("!<"+y.tag+'> tag resolver accepts not "'+E+'" style');l.dump=A}return!0}return!1}function h(l,d,g,A,w,m){l.tag=null,l.dump=g,e(l,g,!1)||e(l,g,!0);var S=t.call(l.dump);A&&(A=l.flowLevel<0||l.flowLevel>d);var y=S==="[object Object]"||S==="[object Array]",E,I;if(y&&(E=l.duplicates.indexOf(g),I=E!==-1),(l.tag!==null&&l.tag!=="?"||I||l.indent!==2&&d>0)&&(w=!1),I&&l.usedDuplicates[E])l.dump="*ref_"+E;else{if(y&&I&&!l.usedDuplicates[E]&&(l.usedDuplicates[E]=!0),S==="[object Object]")A&&Object.keys(l.dump).length!==0?(Yn(l,d,l.dump,w),I&&(l.dump="&ref_"+E+l.dump)):(jn(l,d,l.dump),I&&(l.dump="&ref_"+E+" "+l.dump));else if(S==="[object Array]"){var L=l.noArrayIndent&&d>0?d-1:d;A&&l.dump.length!==0?(Qe(l,L,l.dump,w),I&&(l.dump="&ref_"+E+l.dump)):(Ve(l,L,l.dump),I&&(l.dump="&ref_"+E+" "+l.dump))}else if(S==="[object String]")l.tag!=="?"&&Hn(l,l.dump,d,m);else{if(l.skipInvalid)return!1;throw new n("unacceptable kind of an object to dump "+S)}l.tag!==null&&l.tag!=="?"&&(l.dump="!<"+l.tag+"> "+l.dump)}return!0}function k(l,d){var g=[],A=[],w,m;for(C(l,g,A),w=0,m=A.length;w<m;w+=1)d.duplicates.push(g[A[w]]);d.usedDuplicates=new Array(m)}function C(l,d,g){var A,w,m;if(l!==null&&typeof l=="object")if(w=d.indexOf(l),w!==-1)g.indexOf(w)===-1&&g.push(w);else if(d.push(l),Array.isArray(l))for(w=0,m=l.length;w<m;w+=1)C(l[w],d,g);else for(A=Object.keys(l),w=0,m=A.length;w<m;w+=1)C(l[A[w]],d,g)}function b(l,d){d=d||{};var g=new de(d);return g.noRefs||k(l,g),h(g,0,l,!0,!0)?g.dump+`
|
|
86
|
+
`:""}function T(l,d){return b(l,r.extend({schema:o},d))}return $e.dump=b,$e.safeDump=T,$e}var Kr;function fi(){if(Kr)return D;Kr=1;var r=ci(),n=pi();function i(o){return function(){throw new Error("Function "+o+" is deprecated and cannot be used.")}}return D.Type=B(),D.Schema=he(),D.FAILSAFE_SCHEMA=kn(),D.JSON_SCHEMA=Lr(),D.CORE_SCHEMA=$r(),D.DEFAULT_SAFE_SCHEMA=be(),D.DEFAULT_FULL_SCHEMA=Ie(),D.load=r.load,D.loadAll=r.loadAll,D.safeLoad=r.safeLoad,D.safeLoadAll=r.safeLoadAll,D.dump=n.dump,D.safeDump=n.safeDump,D.YAMLException=ve(),D.MINIMAL_SCHEMA=kn(),D.SAFE_SCHEMA=be(),D.DEFAULT_SCHEMA=Ie(),D.scan=i("scan"),D.parse=i("parse"),D.compose=i("compose"),D.addConstructor=i("addConstructor"),D}var Dn,Wr;function hi(){if(Wr)return Dn;Wr=1;var r=fi();return Dn=r,Dn}var Vr;function di(){if(Vr)return Le.exports;Vr=1;var r=hi(),n="\\ufeff?",i=typeof process<"u"?process.platform:"",o="^("+n+"(= yaml =|---)$([\\s\\S]*?)^(?:\\2|\\.\\.\\.)\\s*$"+(i==="win32"?"\\r?":"")+"(?:\\n)?)",t=new RegExp(o,"m");Le.exports=a,Le.exports.test=p;function a(c,f){c=c||"";var v={allowUnsafe:!1};f=f instanceof Object?{...v,...f}:v,f.allowUnsafe=!!f.allowUnsafe;var x=c.split(/(\r?\n)/);return x[0]&&/= yaml =|---/.test(x[0])?u(c,f.allowUnsafe):{attributes:{},body:c,bodyBegin:1}}function s(c,f){for(var v=1,x=f.indexOf(`
|
|
87
|
+
`),F=c.index+c[0].length;x!==-1;){if(x>=F)return v;v++,x=f.indexOf(`
|
|
88
|
+
`,x+1)}return v}function u(c,f){var v=t.exec(c);if(!v)return{attributes:{},body:c,bodyBegin:1};var x=f?r.load:r.safeLoad,F=v[v.length-1].replace(/^\s+|\s+$/g,""),_=x(F)||{},$=c.replace(v[0],""),H=s(v,c);return{attributes:_,body:$,bodyBegin:H,frontmatter:F}}function p(c){return c=c||"",t.test(c)}return Le.exports}var gi=di();const mi=Gt(gi),xi="ui-serif, Georgia, Cambria, 'Noto Serif', 'Times New Roman', serif",Qr="ui-sans-serif, system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', 'Roboto', sans-serif",Pn="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace";function ki(){O.use(Ht({langPrefix:"hljs language-",highlight:function(o,t){return t=Zn.getLanguage(t)?t:"plaintext",Zn.highlight(o,{language:t}).value}}));const r={name:"attributeImage",level:"inline",start(o){return o.indexOf("![")},tokenizer(o){const a=/^!\[([^\]]*)\]\(([^)]+)\)\{(.*?)\}/.exec(o);if(a)return{type:"attributeImage",raw:a[0],alt:a[1],href:a[2],attrs:a[3]}},renderer(o){const t=vi(o.attrs),a=Array.from(t).map(([s,u])=>/^\d+$/.test(u)?`${s}:${u}px`:`${s}:${u}`).join("; ");return`<img src="${o.href}" alt="${o.alt}" style="${a}">`}};O.use({extensions:[r]});const n=O.Renderer,i=O.Parser;n.heading=function(o){const t=i.parseInline(o.tokens),a=o.depth;return`<h${a}><span>${t}</span></h${a}>
|
|
89
|
+
`},n.paragraph=function(o){const t=o.text;return t.length>4&&(/\$\$[\s\S]*?\$\$/g.test(t)||/\\\[[\s\S]*?\\\]/g.test(t))?`${t}
|
|
90
|
+
`:`<p>${i.parseInline(o.tokens)}</p>
|
|
91
|
+
`},n.image=function(o,t,a){return`<img src="${o.href}" alt="${a||""}" title="${t||a||""}">`},O.use({renderer:n})}function vi(r){const n=new Map;return r.split(/\s+/).forEach(i=>{const[o,t]=i.split("=");o&&t&&n.set(o,t.replace(/^["']|["']$/g,""))}),n}function bi(r){const{attributes:n,body:i}=mi(r),o={};let t="";const{title:a,description:s,cover:u}=n;return a&&(o.title=a),s&&(t+="> "+s+`
|
|
92
|
+
|
|
93
|
+
`,o.description=s),u&&(o.cover=u),o.body=t+i,o}async function yi(r){const n=O.parse(r);return await tt.renderMathInHtml(n)}async function wi(r,n,i,o,t){let a=Je.themes.default;if(n&&(a=Je.themes[n],a||(a=Object.values(Je.themes).find(c=>c.name.toLowerCase()===n.toLowerCase()))),!a)throw new Error("主题不存在");if(!(i in Kn.hlThemes))throw new Error("代码块主题不存在");const s=Xr(await a.getCss()),p=await Kn.hlThemes[i].getCss();return Jr(r,s,p,o,t)}async function Jr(r,n,i,o,t){t&&nt(!1,r),n=et(n,{"#wenyan pre code":[{property:"font-family",value:Pn,append:!0}],"#wenyan pre":[{property:"font-size",value:"12px",append:!0}]});const a=N.parse(n,{context:"stylesheet",positions:!1,parseAtrulePrelude:!1,parseCustomProperty:!1,parseValue:!1}),s=N.parse(i,{context:"stylesheet",positions:!1,parseAtrulePrelude:!1,parseCustomProperty:!1,parseValue:!1});if(a.children.appendList(s.children),o){const p=N.parse(it,{context:"stylesheet",positions:!1,parseAtrulePrelude:!1,parseCustomProperty:!1,parseValue:!1});a.children.appendList(p.children)}N.walk(a,{visit:"Rule",enter(p,c,f){const v=p.prelude.children;v&&v.forEach(x=>{const F=N.generate(x),_=p.block.children.toArray();F==="#wenyan"?_.forEach($=>{const H=N.generate($.value);r.style[$.property]=H}):r.querySelectorAll(F).forEach(H=>{_.forEach(Z=>{const K=N.generate(Z.value);H.style[Z.property]=K})})})}});let u=r.querySelectorAll("mjx-container");return u.forEach(p=>{const c=p.querySelector("svg");c.style.width=c.getAttribute("width"),c.style.height=c.getAttribute("height"),c.removeAttribute("width"),c.removeAttribute("height");const f=p.parentElement;p.remove(),f.appendChild(c),f.classList.contains("block-equation")&&f.setAttribute("style","text-align: center; margin-bottom: 1rem;")}),u=r.querySelectorAll("pre code"),u.forEach(p=>{p.innerHTML=p.innerHTML.replace(/\n/g,"<br>").replace(/(>[^<]+)|(^[^<]+)/g,c=>c.replace(/\s/g," "))}),u=r.querySelectorAll("h1, h2, h3, h4, h5, h6, blockquote, pre"),u.forEach(p=>{const c=new Map,f=new Map;N.walk(a,{visit:"Rule",enter(v){const x=N.generate(v.prelude),F=p.tagName.toLowerCase();x.includes(`${F}::after`)?qn(v,c):x.includes(`${F}::before`)&&qn(v,f)}}),c.size>0&&p.appendChild(Nn(c,r.ownerDocument)),f.size>0&&p.insertBefore(Nn(f,r.ownerDocument),p.firstChild)}),r.setAttribute("data-provider","WenYan"),`${r.outerHTML.replace(/class="mjx-solid"/g,'fill="none" stroke-width="70"')}`}function Xr(r){const n=/--([a-zA-Z0-9\-]+):\s*([^;()]*\((?:[^()]*|\([^()]*\))*\)[^;()]*|[^;]+);/g,i=/var\(--([a-zA-Z0-9\-]+)\)/g,o={};let t;for(;(t=n.exec(r))!==null;){const u=t[1],p=t[2].trim().replaceAll(`
|
|
94
|
+
`,"");o[u]=p}o["sans-serif-font"]||(o["sans-serif-font"]=Qr),o["monospace-font"]||(o["monospace-font"]=Pn);function a(u,p,c=new Set){if(c.has(u))return u;c.add(u);let f=u,v;for(;(v=i.exec(f))!==null;){const x=v[1];if(p[x]){const F=a(p[x],p,c);f=f.replace(v[0],F)}}return f}for(const u in o){const p=a(o[u],o);o[u]=p}let s=r;for(;(t=i.exec(r))!==null;){const u=t[1];o[u]&&(s=s.replace(t[0],o[u]))}return s.replace(/:root\s*\{[^}]*\}/g,"")}function et(r,n){const i=N.parse(r,{context:"stylesheet",positions:!1,parseAtrulePrelude:!1,parseCustomProperty:!1,parseValue:!1});return N.walk(i,{visit:"Rule",leave:(o,t,a)=>{if(o.prelude.type!=="SelectorList")return;const s=o.prelude.children.toArray().map(u=>N.generate(u));if(s){const u=s[0],p=n[u];if(!p)return;for(const{property:c,value:f,append:v}of p)if(f){let x=!1;N.walk(o.block,F=>{F.type==="Declaration"&&F.property===c&&(F.value=N.parse(f,{context:"value"}),x=!0)}),!x&&v&&o.block.children.prepend(a.createItem({type:"Declaration",property:c,value:N.parse(f,{context:"value"})}))}}}}),N.generate(i)}function qn(r,n){N.walk(r.block,{visit:"Declaration",enter(i){const o=i.property,t=N.generate(i.value);n.set(o,t)}})}function Nn(r,n){const i=n.createElement("section");r.get("content")&&(i.textContent=r.get("content").replace(/['"]/g,""),r.delete("content"));for(const[a,s]of r)if(s.includes("url(")){const u=s.match(/data:image\/svg\+xml;utf8,(.*<\/svg>)/),p=s.match(/data:image\/svg\+xml;base64,([^"'\)]*)["']?\)/),c=s.match(/(?:"|')?(https?[^"'\)]*)(?:"|')?\)/);if(u){const f=decodeURIComponent(u[1]);i.innerHTML=f}else if(p){const f=atob(p[1]);i.innerHTML=f}else if(c){const f=n.createElement("img");f.src=c[1],f.setAttribute("style","vertical-align: top;"),i.appendChild(f)}r.delete(a)}const t=Array.from(r.entries()).map(([a,s])=>`${a}: ${s}`).join("; ");return i.style.cssText=t,i}function nt(r,n){let i=[],o=0;if(n.querySelectorAll("a[href]").forEach(a=>{const s=a.textContent||a.innerText,u=a.getAttribute("href");i.push([++o,s,u]);const p=n.ownerDocument.createElement("sup");p.setAttribute("class","footnote"),p.innerHTML=`[${o}]`,a.after(p)}),o>0)if(r){const s=`<h3>引用链接</h3><div id="footnotes"><ul>${i.map(u=>u[1]===u[2]?`<li id="#footnote-${u[0]}">[${u[0]}]: <i>${u[1]}</i></li>`:`<li id="#footnote-${u[0]}">[${u[0]}] ${u[1]}: <i>${u[2]}</i></li>`).join("")}</ul></div>`;n.innerHTML+=s}else{const s=`<h3>引用链接</h3><section id="footnotes">${i.map(u=>u[1]===u[2]?`<p><span class="footnote-num">[${u[0]}]</span><span class="footnote-txt"><i>${u[1]}</i></span></p>`:`<p><span class="footnote-num">[${u[0]}]</span><span class="footnote-txt">${u[1]}: <i>${u[2]}</i></span></p>`).join("")}</section>`;n.innerHTML+=s}}return U.addFootnotes=nt,U.buildPseudoSpan=Nn,U.configureMarked=ki,U.extractDeclarations=qn,U.getContentForGzhBuiltinTheme=wi,U.getContentForGzhCustomCss=Jr,U.handleFrontMatter=bi,U.modifyCss=et,U.monospace=Pn,U.renderMarkdown=yi,U.replaceCSSVariables=Xr,U.sansSerif=Qr,U.serif=xi,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"}),U})({},hljs,csstree,WenyanMath,macStyleCss,themes,hlThemes);
|