@hep-code-runner/vue3 2.2.0 → 2.2.2
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/dist/index.js +70 -3
- package/dist/index.mjs +538 -1350
- package/package.json +7 -4
package/dist/index.mjs
CHANGED
|
@@ -1,847 +1,422 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
8
|
-
lookbehind: !0,
|
|
9
|
-
greedy: !0
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
pattern: /(^|[^\\:])\/\/.*/,
|
|
13
|
-
lookbehind: !0,
|
|
14
|
-
greedy: !0
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
string: {
|
|
18
|
-
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
19
|
-
greedy: !0
|
|
20
|
-
},
|
|
21
|
-
"class-name": {
|
|
22
|
-
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
23
|
-
lookbehind: !0,
|
|
24
|
-
inside: {
|
|
25
|
-
punctuation: /[.\\]/
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
29
|
-
boolean: /\b(?:false|true)\b/,
|
|
30
|
-
function: /\b\w+(?=\()/,
|
|
31
|
-
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
32
|
-
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
33
|
-
punctuation: /[{}[\];(),.:]/
|
|
34
|
-
};
|
|
35
|
-
Prism.languages.javascript = Prism.languages.extend("clike", {
|
|
36
|
-
"class-name": [
|
|
37
|
-
Prism.languages.clike["class-name"],
|
|
38
|
-
{
|
|
39
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
40
|
-
lookbehind: !0
|
|
41
|
-
}
|
|
42
|
-
],
|
|
43
|
-
keyword: [
|
|
44
|
-
{
|
|
45
|
-
pattern: /((?:^|\})\s*)catch\b/,
|
|
46
|
-
lookbehind: !0
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
|
|
50
|
-
lookbehind: !0
|
|
51
|
-
}
|
|
52
|
-
],
|
|
53
|
-
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
|
54
|
-
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
55
|
-
number: {
|
|
56
|
-
pattern: RegExp(
|
|
57
|
-
/(^|[^\w$])/.source + "(?:" + // constant
|
|
58
|
-
(/NaN|Infinity/.source + "|" + // binary integer
|
|
59
|
-
/0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
|
|
60
|
-
/0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
|
|
61
|
-
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
|
|
62
|
-
/\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
|
|
63
|
-
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
|
|
64
|
-
),
|
|
65
|
-
lookbehind: !0
|
|
66
|
-
},
|
|
67
|
-
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
68
|
-
});
|
|
69
|
-
Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
|
|
70
|
-
Prism.languages.insertBefore("javascript", "keyword", {
|
|
71
|
-
regex: {
|
|
72
|
-
pattern: RegExp(
|
|
73
|
-
// lookbehind
|
|
74
|
-
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
|
75
|
-
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
|
|
76
|
-
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
|
|
77
|
-
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
|
|
78
|
-
// with the only syntax, so we have to define 2 different regex patterns.
|
|
79
|
-
/\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
|
|
80
|
-
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
|
|
81
|
-
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
|
|
82
|
-
),
|
|
83
|
-
lookbehind: !0,
|
|
84
|
-
greedy: !0,
|
|
85
|
-
inside: {
|
|
86
|
-
"regex-source": {
|
|
87
|
-
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
88
|
-
lookbehind: !0,
|
|
89
|
-
alias: "language-regex",
|
|
90
|
-
inside: Prism.languages.regex
|
|
91
|
-
},
|
|
92
|
-
"regex-delimiter": /^\/|\/$/,
|
|
93
|
-
"regex-flags": /^[a-z]+$/
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
// This must be declared before keyword because we use "function" inside the look-forward
|
|
97
|
-
"function-variable": {
|
|
98
|
-
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
|
99
|
-
alias: "function"
|
|
100
|
-
},
|
|
101
|
-
parameter: [
|
|
102
|
-
{
|
|
103
|
-
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
104
|
-
lookbehind: !0,
|
|
105
|
-
inside: Prism.languages.javascript
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
109
|
-
lookbehind: !0,
|
|
110
|
-
inside: Prism.languages.javascript
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
114
|
-
lookbehind: !0,
|
|
115
|
-
inside: Prism.languages.javascript
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
119
|
-
lookbehind: !0,
|
|
120
|
-
inside: Prism.languages.javascript
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
124
|
-
});
|
|
125
|
-
Prism.languages.insertBefore("javascript", "string", {
|
|
126
|
-
hashbang: {
|
|
127
|
-
pattern: /^#!.*/,
|
|
128
|
-
greedy: !0,
|
|
129
|
-
alias: "comment"
|
|
130
|
-
},
|
|
131
|
-
"template-string": {
|
|
132
|
-
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
133
|
-
greedy: !0,
|
|
134
|
-
inside: {
|
|
135
|
-
"template-punctuation": {
|
|
136
|
-
pattern: /^`|`$/,
|
|
137
|
-
alias: "string"
|
|
138
|
-
},
|
|
139
|
-
interpolation: {
|
|
140
|
-
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
141
|
-
lookbehind: !0,
|
|
142
|
-
inside: {
|
|
143
|
-
"interpolation-punctuation": {
|
|
144
|
-
pattern: /^\$\{|\}$/,
|
|
145
|
-
alias: "punctuation"
|
|
146
|
-
},
|
|
147
|
-
rest: Prism.languages.javascript
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
string: /[\s\S]+/
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
"string-property": {
|
|
154
|
-
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
155
|
-
lookbehind: !0,
|
|
156
|
-
greedy: !0,
|
|
157
|
-
alias: "property"
|
|
1
|
+
import { defineComponent as oe, useCssVars as me, ref as O, computed as D, onMounted as de, watch as se, onUnmounted as fe, openBlock as A, createElementBlock as T, normalizeClass as B, createElementVNode as v, normalizeStyle as K, withDirectives as be, createCommentVNode as P, Fragment as Ee, renderList as ve, toDisplayString as M, vModelSelect as ye, createTextVNode as ke, createStaticVNode as Se, createVNode as re, createBlock as we, Teleport as Ae, Transition as Te, withCtx as xe, mergeProps as Fe, toHandlers as Ie, renderSlot as _e } from "vue";
|
|
2
|
+
var Re = Object.defineProperty, le = (c, n, i) => ((l, f, b) => f in l ? Re(l, f, { enumerable: !0, configurable: !0, writable: !0, value: b }) : l[f] = b)(c, typeof n != "symbol" ? n + "" : n, i);
|
|
3
|
+
let ne = null;
|
|
4
|
+
class Ne {
|
|
5
|
+
constructor(n = {}) {
|
|
6
|
+
le(this, "baseUrl"), le(this, "timeout"), this.baseUrl = n.pistonUrl || "/api/piston", this.timeout = n.timeout || 3e3;
|
|
158
7
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
|
|
169
|
-
"javascript"
|
|
170
|
-
));
|
|
171
|
-
Prism.languages.js = Prism.languages.javascript;
|
|
172
|
-
Prism.languages.python = {
|
|
173
|
-
comment: {
|
|
174
|
-
pattern: /(^|[^\\])#.*/,
|
|
175
|
-
lookbehind: !0,
|
|
176
|
-
greedy: !0
|
|
177
|
-
},
|
|
178
|
-
"string-interpolation": {
|
|
179
|
-
pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
|
|
180
|
-
greedy: !0,
|
|
181
|
-
inside: {
|
|
182
|
-
interpolation: {
|
|
183
|
-
// "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
|
|
184
|
-
pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
|
|
185
|
-
lookbehind: !0,
|
|
186
|
-
inside: {
|
|
187
|
-
"format-spec": {
|
|
188
|
-
pattern: /(:)[^:(){}]+(?=\}$)/,
|
|
189
|
-
lookbehind: !0
|
|
190
|
-
},
|
|
191
|
-
"conversion-option": {
|
|
192
|
-
pattern: //,
|
|
193
|
-
alias: "punctuation"
|
|
194
|
-
},
|
|
195
|
-
rest: null
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
string: /[\s\S]+/
|
|
8
|
+
async getRuntimes(n = !1) {
|
|
9
|
+
if (ne && !n) return ne;
|
|
10
|
+
try {
|
|
11
|
+
const i = await fetch(`${this.baseUrl}/runtimes`, { method: "GET", headers: { "Content-Type": "application/json" } });
|
|
12
|
+
if (!i.ok) throw new Error(`Failed to fetch runtimes: ${i.statusText}`);
|
|
13
|
+
const l = await i.json();
|
|
14
|
+
return ne = l, l;
|
|
15
|
+
} catch (i) {
|
|
16
|
+
throw i;
|
|
199
17
|
}
|
|
200
|
-
},
|
|
201
|
-
"triple-quoted-string": {
|
|
202
|
-
pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
|
|
203
|
-
greedy: !0,
|
|
204
|
-
alias: "string"
|
|
205
|
-
},
|
|
206
|
-
string: {
|
|
207
|
-
pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
|
|
208
|
-
greedy: !0
|
|
209
|
-
},
|
|
210
|
-
function: {
|
|
211
|
-
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
|
|
212
|
-
lookbehind: !0
|
|
213
|
-
},
|
|
214
|
-
"class-name": {
|
|
215
|
-
pattern: /(\bclass\s+)\w+/i,
|
|
216
|
-
lookbehind: !0
|
|
217
|
-
},
|
|
218
|
-
decorator: {
|
|
219
|
-
pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
|
|
220
|
-
lookbehind: !0,
|
|
221
|
-
alias: ["annotation", "punctuation"],
|
|
222
|
-
inside: {
|
|
223
|
-
punctuation: /\./
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
|
|
227
|
-
builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
|
|
228
|
-
boolean: /\b(?:False|None|True)\b/,
|
|
229
|
-
number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
|
|
230
|
-
operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
|
|
231
|
-
punctuation: /[{}[\];(),.:]/
|
|
232
|
-
};
|
|
233
|
-
Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python;
|
|
234
|
-
Prism.languages.py = Prism.languages.python;
|
|
235
|
-
Prism.languages.go = Prism.languages.extend("clike", {
|
|
236
|
-
string: {
|
|
237
|
-
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,
|
|
238
|
-
lookbehind: !0,
|
|
239
|
-
greedy: !0
|
|
240
|
-
},
|
|
241
|
-
keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,
|
|
242
|
-
boolean: /\b(?:_|false|iota|nil|true)\b/,
|
|
243
|
-
number: [
|
|
244
|
-
// binary and octal integers
|
|
245
|
-
/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,
|
|
246
|
-
// hexadecimal integers and floats
|
|
247
|
-
/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,
|
|
248
|
-
// decimal integers and floats
|
|
249
|
-
/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i
|
|
250
|
-
],
|
|
251
|
-
operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,
|
|
252
|
-
builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/
|
|
253
|
-
});
|
|
254
|
-
Prism.languages.insertBefore("go", "string", {
|
|
255
|
-
char: {
|
|
256
|
-
pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/,
|
|
257
|
-
greedy: !0
|
|
258
18
|
}
|
|
259
|
-
})
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
19
|
+
async execute(n, i, l = {}) {
|
|
20
|
+
const f = (await this.getRuntimes()).find((k) => {
|
|
21
|
+
var d;
|
|
22
|
+
return k.language.toLowerCase() === n.toLowerCase() || ((d = k.aliases) == null ? void 0 : d.some((S) => S.toLowerCase() === n.toLowerCase()));
|
|
23
|
+
});
|
|
24
|
+
if (!f) throw new Error(`Language '${n}' is not supported`);
|
|
25
|
+
const b = this.getFileName(n), s = { language: f.language, version: l.version || f.version, files: [{ name: b, content: i }], stdin: l.stdin || "", args: l.args || [], run_timeout: l.runTimeout || this.timeout, compile_timeout: this.timeout }, y = Date.now();
|
|
26
|
+
try {
|
|
27
|
+
const k = await fetch(`${this.baseUrl}/execute`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(s) });
|
|
28
|
+
if (!k.ok) throw new Error(`Execute failed: ${k.statusText}`);
|
|
29
|
+
const d = await k.json(), S = Date.now() - y, I = d.run.stdout || "", x = d.run.stderr || "";
|
|
30
|
+
return { success: d.run.code === 0, output: I, stderr: x, code: d.run.code, executionTime: S, compile: d.compile ? { stdout: d.compile.stdout || "", stderr: d.compile.stderr || "", code: d.compile.code } : void 0 };
|
|
31
|
+
} catch (k) {
|
|
32
|
+
return { success: !1, output: "", stderr: k instanceof Error ? k.message : "Unknown error", code: -1, executionTime: Date.now() - y };
|
|
273
33
|
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
34
|
+
}
|
|
35
|
+
getFileName(n) {
|
|
36
|
+
return { javascript: "main.js", typescript: "main.ts", python: "main.py", python3: "main.py", go: "main.go", rust: "main.rs", java: "Main.java", c: "main.c", cpp: "main.cpp", csharp: "Main.cs", ruby: "main.rb", php: "main.php", bash: "main.sh", shell: "main.sh", perl: "main.pl", lua: "main.lua", swift: "main.swift", kotlin: "Main.kt", scala: "Main.scala", haskell: "main.hs", dart: "main.dart", html: "index.html", css: "style.css", sql: "query.sql", markdown: "readme.md" }[n.toLowerCase()] || `main.${n}`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const Oe = { javascript: 'console.log("Hello, World!");', typescript: 'console.log("Hello, World!");', python: 'print("Hello, World!")', python3: 'print("Hello, World!")', go: `package main
|
|
40
|
+
|
|
41
|
+
import "fmt"
|
|
42
|
+
|
|
43
|
+
func main() {
|
|
44
|
+
fmt.Println("Hello, World!")
|
|
45
|
+
}`, rust: `fn main() {
|
|
46
|
+
println!("Hello, World!");
|
|
47
|
+
}`, java: `public class Main {
|
|
48
|
+
public static void main(String[] args) {
|
|
49
|
+
System.out.println("Hello, World!");
|
|
50
|
+
}
|
|
51
|
+
}`, c: `#include <stdio.h>
|
|
52
|
+
|
|
53
|
+
int main() {
|
|
54
|
+
printf("Hello, World!\\n");
|
|
55
|
+
return 0;
|
|
56
|
+
}`, cpp: `#include <iostream>
|
|
57
|
+
|
|
58
|
+
int main() {
|
|
59
|
+
std::cout << "Hello, World!" << std::endl;
|
|
60
|
+
return 0;
|
|
61
|
+
}`, csharp: `using System;
|
|
62
|
+
|
|
63
|
+
class Main {
|
|
64
|
+
static void Main() {
|
|
65
|
+
Console.WriteLine("Hello, World!");
|
|
66
|
+
}
|
|
67
|
+
}`, ruby: 'puts "Hello, World!"', php: `<?php
|
|
68
|
+
echo "Hello, World!";
|
|
69
|
+
?>`, bash: 'echo "Hello, World!"', shell: 'echo "Hello, World!"', perl: 'print "Hello, World!\\n";', lua: 'print("Hello, World!")', r: 'print("Hello, World!")', swift: 'print("Hello, World!")', kotlin: `fun main() {
|
|
70
|
+
println("Hello, World!")
|
|
71
|
+
}`, scala: `object Main extends App {
|
|
72
|
+
println("Hello, World!")
|
|
73
|
+
}`, haskell: 'main = putStrLn "Hello, World!"', elixir: 'IO.puts "Hello, World!"', erlang: 'main() -> io:fwrite("Hello, World!~n").', clojure: '(println "Hello, World!")', fsharp: 'printfn "Hello, World!"', dart: `void main() {
|
|
74
|
+
print("Hello, World!");
|
|
75
|
+
}`, assembly: `section .data
|
|
76
|
+
msg db 'Hello, World!', 0
|
|
77
|
+
section .text
|
|
78
|
+
global _start
|
|
79
|
+
_start:
|
|
80
|
+
mov rax, 1
|
|
81
|
+
mov rdi, 1
|
|
82
|
+
mov rsi, msg
|
|
83
|
+
mov rdx, 13
|
|
84
|
+
syscall
|
|
85
|
+
mov rax, 60
|
|
86
|
+
xor rdi, rdi
|
|
87
|
+
syscall`, html: `<!DOCTYPE html>
|
|
88
|
+
<html>
|
|
89
|
+
<head>
|
|
90
|
+
<title>Hello</title>
|
|
91
|
+
</head>
|
|
92
|
+
<body>
|
|
93
|
+
<h1>Hello, World!</h1>
|
|
94
|
+
</body>
|
|
95
|
+
</html>`, css: `body {
|
|
96
|
+
background-color: #f0f0f0;
|
|
97
|
+
font-family: Arial, sans-serif;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
h1 {
|
|
101
|
+
color: #333;
|
|
102
|
+
}`, sql: "SELECT 'Hello, World!' AS message;", markdown: `# Hello, World!
|
|
103
|
+
|
|
104
|
+
This is a sample markdown document.` };
|
|
105
|
+
function Z(c) {
|
|
106
|
+
const n = c.toLowerCase();
|
|
107
|
+
return Oe[n] || `// ${c}
|
|
108
|
+
// Write your code here`;
|
|
109
|
+
}
|
|
110
|
+
var ce = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
111
|
+
function Le(c) {
|
|
112
|
+
return c && c.__esModule && Object.prototype.hasOwnProperty.call(c, "default") ? c.default : c;
|
|
113
|
+
}
|
|
114
|
+
var pe = { exports: {} };
|
|
115
|
+
(function(c) {
|
|
116
|
+
var n = function(i) {
|
|
117
|
+
var l = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, f = 0, b = {}, s = { manual: i.Prism && i.Prism.manual, disableWorkerMessageHandler: i.Prism && i.Prism.disableWorkerMessageHandler, util: { encode: function t(e) {
|
|
118
|
+
return e instanceof y ? new y(e.type, t(e.content), e.alias) : Array.isArray(e) ? e.map(t) : e.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
119
|
+
}, type: function(t) {
|
|
120
|
+
return Object.prototype.toString.call(t).slice(8, -1);
|
|
121
|
+
}, objId: function(t) {
|
|
122
|
+
return t.__id || Object.defineProperty(t, "__id", { value: ++f }), t.__id;
|
|
123
|
+
}, clone: function t(e, a) {
|
|
124
|
+
var r, o;
|
|
125
|
+
switch (a = a || {}, s.util.type(e)) {
|
|
126
|
+
case "Object":
|
|
127
|
+
if (o = s.util.objId(e), a[o]) return a[o];
|
|
128
|
+
for (var u in r = {}, a[o] = r, e) e.hasOwnProperty(u) && (r[u] = t(e[u], a));
|
|
129
|
+
return r;
|
|
130
|
+
case "Array":
|
|
131
|
+
return o = s.util.objId(e), a[o] ? a[o] : (r = [], a[o] = r, e.forEach(function(p, m) {
|
|
132
|
+
r[m] = t(p, a);
|
|
133
|
+
}), r);
|
|
134
|
+
default:
|
|
135
|
+
return e;
|
|
304
136
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
-
constant: /\b[A-Z][A-Z_\d]+\b/
|
|
312
|
-
}), e.languages.insertBefore("java", "string", {
|
|
313
|
-
"triple-quoted-string": {
|
|
314
|
-
// http://openjdk.java.net/jeps/355#Description
|
|
315
|
-
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
|
|
316
|
-
greedy: !0,
|
|
317
|
-
alias: "string"
|
|
318
|
-
},
|
|
319
|
-
char: {
|
|
320
|
-
pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
|
|
321
|
-
greedy: !0
|
|
322
|
-
}
|
|
323
|
-
}), e.languages.insertBefore("java", "class-name", {
|
|
324
|
-
annotation: {
|
|
325
|
-
pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
|
|
326
|
-
lookbehind: !0,
|
|
327
|
-
alias: "punctuation"
|
|
328
|
-
},
|
|
329
|
-
generics: {
|
|
330
|
-
pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
|
|
331
|
-
inside: {
|
|
332
|
-
"class-name": o,
|
|
333
|
-
keyword: u,
|
|
334
|
-
punctuation: /[<>(),.:]/,
|
|
335
|
-
operator: /[?&|]/
|
|
137
|
+
}, getLanguage: function(t) {
|
|
138
|
+
for (; t; ) {
|
|
139
|
+
var e = l.exec(t.className);
|
|
140
|
+
if (e) return e[1].toLowerCase();
|
|
141
|
+
t = t.parentElement;
|
|
336
142
|
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
pattern: RegExp(/(\bimport\s+static\s+)/.source + a + /(?:\w+|\*)(?=\s*;)/.source),
|
|
351
|
-
lookbehind: !0,
|
|
352
|
-
alias: "static",
|
|
353
|
-
inside: {
|
|
354
|
-
namespace: o.inside.namespace,
|
|
355
|
-
static: /\b\w+$/,
|
|
356
|
-
punctuation: /\./,
|
|
357
|
-
operator: /\*/,
|
|
358
|
-
"class-name": /\w+/
|
|
143
|
+
return "none";
|
|
144
|
+
}, setLanguage: function(t, e) {
|
|
145
|
+
t.className = t.className.replace(RegExp(l, "gi"), ""), t.classList.add("language-" + e);
|
|
146
|
+
}, currentScript: function() {
|
|
147
|
+
if (typeof document > "u") return null;
|
|
148
|
+
if (document.currentScript && document.currentScript.tagName === "SCRIPT") return document.currentScript;
|
|
149
|
+
try {
|
|
150
|
+
throw new Error();
|
|
151
|
+
} catch (r) {
|
|
152
|
+
var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack) || [])[1];
|
|
153
|
+
if (t) {
|
|
154
|
+
var e = document.getElementsByTagName("script");
|
|
155
|
+
for (var a in e) if (e[a].src == t) return e[a];
|
|
359
156
|
}
|
|
157
|
+
return null;
|
|
360
158
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
),
|
|
368
|
-
lookbehind: !0,
|
|
369
|
-
inside: {
|
|
370
|
-
punctuation: /\./
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
})(Prism);
|
|
375
|
-
Prism.languages.c = Prism.languages.extend("clike", {
|
|
376
|
-
comment: {
|
|
377
|
-
pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
378
|
-
greedy: !0
|
|
379
|
-
},
|
|
380
|
-
string: {
|
|
381
|
-
// https://en.cppreference.com/w/c/language/string_literal
|
|
382
|
-
pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
|
|
383
|
-
greedy: !0
|
|
384
|
-
},
|
|
385
|
-
"class-name": {
|
|
386
|
-
pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,
|
|
387
|
-
lookbehind: !0
|
|
388
|
-
},
|
|
389
|
-
keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,
|
|
390
|
-
function: /\b[a-z_]\w*(?=\s*\()/i,
|
|
391
|
-
number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,
|
|
392
|
-
operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/
|
|
393
|
-
});
|
|
394
|
-
Prism.languages.insertBefore("c", "string", {
|
|
395
|
-
char: {
|
|
396
|
-
// https://en.cppreference.com/w/c/language/character_constant
|
|
397
|
-
pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,
|
|
398
|
-
greedy: !0
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
Prism.languages.insertBefore("c", "string", {
|
|
402
|
-
macro: {
|
|
403
|
-
// allow for multiline macro definitions
|
|
404
|
-
// spaces after the # character compile fine with gcc
|
|
405
|
-
pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,
|
|
406
|
-
lookbehind: !0,
|
|
407
|
-
greedy: !0,
|
|
408
|
-
alias: "property",
|
|
409
|
-
inside: {
|
|
410
|
-
string: [
|
|
411
|
-
{
|
|
412
|
-
// highlight the path of the include statement as a string
|
|
413
|
-
pattern: /^(#\s*include\s*)<[^>]+>/,
|
|
414
|
-
lookbehind: !0
|
|
415
|
-
},
|
|
416
|
-
Prism.languages.c.string
|
|
417
|
-
],
|
|
418
|
-
char: Prism.languages.c.char,
|
|
419
|
-
comment: Prism.languages.c.comment,
|
|
420
|
-
"macro-name": [
|
|
421
|
-
{
|
|
422
|
-
pattern: /(^#\s*define\s+)\w+\b(?!\()/i,
|
|
423
|
-
lookbehind: !0
|
|
424
|
-
},
|
|
425
|
-
{
|
|
426
|
-
pattern: /(^#\s*define\s+)\w+\b(?=\()/i,
|
|
427
|
-
lookbehind: !0,
|
|
428
|
-
alias: "function"
|
|
429
|
-
}
|
|
430
|
-
],
|
|
431
|
-
// highlight macro directives as keywords
|
|
432
|
-
directive: {
|
|
433
|
-
pattern: /^(#\s*)[a-z]+/,
|
|
434
|
-
lookbehind: !0,
|
|
435
|
-
alias: "keyword"
|
|
436
|
-
},
|
|
437
|
-
"directive-hash": /^#/,
|
|
438
|
-
punctuation: /##|\\(?=[\r\n])/,
|
|
439
|
-
expression: {
|
|
440
|
-
pattern: /\S[\s\S]*/,
|
|
441
|
-
inside: Prism.languages.c
|
|
159
|
+
}, isActive: function(t, e, a) {
|
|
160
|
+
for (var r = "no-" + e; t; ) {
|
|
161
|
+
var o = t.classList;
|
|
162
|
+
if (o.contains(e)) return !0;
|
|
163
|
+
if (o.contains(r)) return !1;
|
|
164
|
+
t = t.parentElement;
|
|
442
165
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
(
|
|
452
|
-
|
|
453
|
-
u = u.replace(/<self>/g, function() {
|
|
454
|
-
return u;
|
|
455
|
-
});
|
|
456
|
-
u = u.replace(/<self>/g, function() {
|
|
457
|
-
return /[^\s\S]/.source;
|
|
458
|
-
}), e.languages.rust = {
|
|
459
|
-
comment: [
|
|
460
|
-
{
|
|
461
|
-
pattern: RegExp(/(^|[^\\])/.source + u),
|
|
462
|
-
lookbehind: !0,
|
|
463
|
-
greedy: !0
|
|
464
|
-
},
|
|
465
|
-
{
|
|
466
|
-
pattern: /(^|[^\\:])\/\/.*/,
|
|
467
|
-
lookbehind: !0,
|
|
468
|
-
greedy: !0
|
|
166
|
+
return !!a;
|
|
167
|
+
} }, languages: { plain: b, plaintext: b, text: b, txt: b, extend: function(t, e) {
|
|
168
|
+
var a = s.util.clone(s.languages[t]);
|
|
169
|
+
for (var r in e) a[r] = e[r];
|
|
170
|
+
return a;
|
|
171
|
+
}, insertBefore: function(t, e, a, r) {
|
|
172
|
+
var o = (r = r || s.languages)[t], u = {};
|
|
173
|
+
for (var p in o) if (o.hasOwnProperty(p)) {
|
|
174
|
+
if (p == e) for (var m in a) a.hasOwnProperty(m) && (u[m] = a[m]);
|
|
175
|
+
a.hasOwnProperty(p) || (u[p] = o[p]);
|
|
469
176
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
greedy: !0,
|
|
482
|
-
alias: "attr-name",
|
|
483
|
-
inside: {
|
|
484
|
-
string: null
|
|
485
|
-
// see below
|
|
177
|
+
var w = r[t];
|
|
178
|
+
return r[t] = u, s.languages.DFS(s.languages, function(_, H) {
|
|
179
|
+
H === w && _ != t && (this[_] = u);
|
|
180
|
+
}), u;
|
|
181
|
+
}, DFS: function t(e, a, r, o) {
|
|
182
|
+
o = o || {};
|
|
183
|
+
var u = s.util.objId;
|
|
184
|
+
for (var p in e) if (e.hasOwnProperty(p)) {
|
|
185
|
+
a.call(e, p, e[p], r || p);
|
|
186
|
+
var m = e[p], w = s.util.type(m);
|
|
187
|
+
w !== "Object" || o[u(m)] ? w !== "Array" || o[u(m)] || (o[u(m)] = !0, t(m, a, p, o)) : (o[u(m)] = !0, t(m, a, null, o));
|
|
486
188
|
}
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
189
|
+
} }, plugins: {}, highlightAll: function(t, e) {
|
|
190
|
+
s.highlightAllUnder(document, t, e);
|
|
191
|
+
}, highlightAllUnder: function(t, e, a) {
|
|
192
|
+
var r = { callback: a, container: t, selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' };
|
|
193
|
+
s.hooks.run("before-highlightall", r), r.elements = Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)), s.hooks.run("before-all-elements-highlight", r);
|
|
194
|
+
for (var o, u = 0; o = r.elements[u++]; ) s.highlightElement(o, e === !0, r.callback);
|
|
195
|
+
}, highlightElement: function(t, e, a) {
|
|
196
|
+
var r = s.util.getLanguage(t), o = s.languages[r];
|
|
197
|
+
s.util.setLanguage(t, r);
|
|
198
|
+
var u = t.parentElement;
|
|
199
|
+
u && u.nodeName.toLowerCase() === "pre" && s.util.setLanguage(u, r);
|
|
200
|
+
var p = { element: t, language: r, grammar: o, code: t.textContent };
|
|
201
|
+
function m(_) {
|
|
202
|
+
p.highlightedCode = _, s.hooks.run("before-insert", p), p.element.innerHTML = p.highlightedCode, s.hooks.run("after-highlight", p), s.hooks.run("complete", p), a && a.call(p.element);
|
|
500
203
|
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/,
|
|
519
|
-
lookbehind: !0,
|
|
520
|
-
alias: "class-name"
|
|
521
|
-
},
|
|
522
|
-
"module-declaration": [
|
|
523
|
-
{
|
|
524
|
-
pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,
|
|
525
|
-
lookbehind: !0,
|
|
526
|
-
alias: "namespace"
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,
|
|
530
|
-
lookbehind: !0,
|
|
531
|
-
alias: "namespace",
|
|
532
|
-
inside: {
|
|
533
|
-
punctuation: /::/
|
|
534
|
-
}
|
|
204
|
+
if (s.hooks.run("before-sanity-check", p), (u = p.element.parentElement) && u.nodeName.toLowerCase() === "pre" && !u.hasAttribute("tabindex") && u.setAttribute("tabindex", "0"), !p.code) return s.hooks.run("complete", p), void (a && a.call(p.element));
|
|
205
|
+
if (s.hooks.run("before-highlight", p), p.grammar) if (e && i.Worker) {
|
|
206
|
+
var w = new Worker(s.filename);
|
|
207
|
+
w.onmessage = function(_) {
|
|
208
|
+
m(_.data);
|
|
209
|
+
}, w.postMessage(JSON.stringify({ language: p.language, code: p.code, immediateClose: !0 }));
|
|
210
|
+
} else m(s.highlight(p.code, p.grammar, p.language));
|
|
211
|
+
else m(s.util.encode(p.code));
|
|
212
|
+
}, highlight: function(t, e, a) {
|
|
213
|
+
var r = { code: t, grammar: e, language: a };
|
|
214
|
+
if (s.hooks.run("before-tokenize", r), !r.grammar) throw new Error('The language "' + r.language + '" has no grammar.');
|
|
215
|
+
return r.tokens = s.tokenize(r.code, r.grammar), s.hooks.run("after-tokenize", r), y.stringify(s.util.encode(r.tokens), r.language);
|
|
216
|
+
}, tokenize: function(t, e) {
|
|
217
|
+
var a = e.rest;
|
|
218
|
+
if (a) {
|
|
219
|
+
for (var r in a) e[r] = a[r];
|
|
220
|
+
delete e.rest;
|
|
535
221
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
punctuation: /::/
|
|
222
|
+
var o = new S();
|
|
223
|
+
return I(o, o.head, t), d(t, o, e, o.head, 0), function(u) {
|
|
224
|
+
for (var p = [], m = u.head.next; m !== u.tail; ) p.push(m.value), m = m.next;
|
|
225
|
+
return p;
|
|
226
|
+
}(o);
|
|
227
|
+
}, hooks: { all: {}, add: function(t, e) {
|
|
228
|
+
var a = s.hooks.all;
|
|
229
|
+
a[t] = a[t] || [], a[t].push(e);
|
|
230
|
+
}, run: function(t, e) {
|
|
231
|
+
var a = s.hooks.all[t];
|
|
232
|
+
if (a && a.length) for (var r, o = 0; r = a[o++]; ) r(e);
|
|
233
|
+
} }, Token: y };
|
|
234
|
+
function y(t, e, a, r) {
|
|
235
|
+
this.type = t, this.content = e, this.alias = a, this.length = 0 | (r || "").length;
|
|
236
|
+
}
|
|
237
|
+
function k(t, e, a, r) {
|
|
238
|
+
t.lastIndex = e;
|
|
239
|
+
var o = t.exec(a);
|
|
240
|
+
if (o && r && o[1]) {
|
|
241
|
+
var u = o[1].length;
|
|
242
|
+
o.index += u, o[0] = o[0].slice(u);
|
|
558
243
|
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
keyword: /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,
|
|
595
|
-
boolean: /\b(?:FALSE|NULL|TRUE)\b/i,
|
|
596
|
-
number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,
|
|
597
|
-
operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
|
|
598
|
-
punctuation: /[;[\]()`,.]/
|
|
599
|
-
};
|
|
600
|
-
(function(e) {
|
|
601
|
-
var u = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", a = {
|
|
602
|
-
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
603
|
-
lookbehind: !0,
|
|
604
|
-
alias: "punctuation",
|
|
605
|
-
// this looks reasonably well in all themes
|
|
606
|
-
inside: null
|
|
607
|
-
// see below
|
|
608
|
-
}, o = {
|
|
609
|
-
bash: a,
|
|
610
|
-
environment: {
|
|
611
|
-
pattern: RegExp("\\$" + u),
|
|
612
|
-
alias: "constant"
|
|
613
|
-
},
|
|
614
|
-
variable: [
|
|
615
|
-
// [0]: Arithmetic Environment
|
|
616
|
-
{
|
|
617
|
-
pattern: /\$?\(\([\s\S]+?\)\)/,
|
|
618
|
-
greedy: !0,
|
|
619
|
-
inside: {
|
|
620
|
-
// If there is a $ sign at the beginning highlight $(( and )) as variable
|
|
621
|
-
variable: [
|
|
622
|
-
{
|
|
623
|
-
pattern: /(^\$\(\([\s\S]+)\)\)/,
|
|
624
|
-
lookbehind: !0
|
|
625
|
-
},
|
|
626
|
-
/^\$\(\(/
|
|
627
|
-
],
|
|
628
|
-
number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
|
|
629
|
-
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
|
|
630
|
-
operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
|
|
631
|
-
// If there is no $ sign at the beginning highlight (( and )) as punctuation
|
|
632
|
-
punctuation: /\(\(?|\)\)?|,|;/
|
|
633
|
-
}
|
|
634
|
-
},
|
|
635
|
-
// [1]: Command Substitution
|
|
636
|
-
{
|
|
637
|
-
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
|
|
638
|
-
greedy: !0,
|
|
639
|
-
inside: {
|
|
640
|
-
variable: /^\$\(|^`|\)$|`$/
|
|
641
|
-
}
|
|
642
|
-
},
|
|
643
|
-
// [2]: Brace expansion
|
|
644
|
-
{
|
|
645
|
-
pattern: /\$\{[^}]+\}/,
|
|
646
|
-
greedy: !0,
|
|
647
|
-
inside: {
|
|
648
|
-
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
649
|
-
punctuation: /[\[\]]/,
|
|
650
|
-
environment: {
|
|
651
|
-
pattern: RegExp("(\\{)" + u),
|
|
652
|
-
lookbehind: !0,
|
|
653
|
-
alias: "constant"
|
|
244
|
+
return o;
|
|
245
|
+
}
|
|
246
|
+
function d(t, e, a, r, o, u) {
|
|
247
|
+
for (var p in a) if (a.hasOwnProperty(p) && a[p]) {
|
|
248
|
+
var m = a[p];
|
|
249
|
+
m = Array.isArray(m) ? m : [m];
|
|
250
|
+
for (var w = 0; w < m.length; ++w) {
|
|
251
|
+
if (u && u.cause == p + "," + w) return;
|
|
252
|
+
var _ = m[w], H = _.inside, W = !!_.lookbehind, G = !!_.greedy, J = _.alias;
|
|
253
|
+
if (G && !_.pattern.global) {
|
|
254
|
+
var V = _.pattern.toString().match(/[imsuy]*$/)[0];
|
|
255
|
+
_.pattern = RegExp(_.pattern.source, V + "g");
|
|
256
|
+
}
|
|
257
|
+
for (var j = _.pattern || _, N = r.next, g = o; N !== e.tail && !(u && g >= u.reach); g += N.value.length, N = N.next) {
|
|
258
|
+
var h = N.value;
|
|
259
|
+
if (e.length > t.length) return;
|
|
260
|
+
if (!(h instanceof y)) {
|
|
261
|
+
var E, C = 1;
|
|
262
|
+
if (G) {
|
|
263
|
+
if (!(E = k(j, g, t, W)) || E.index >= t.length) break;
|
|
264
|
+
var $ = E.index, he = E.index + E[0].length, U = g;
|
|
265
|
+
for (U += N.value.length; $ >= U; ) U += (N = N.next).value.length;
|
|
266
|
+
if (g = U -= N.value.length, N.value instanceof y) continue;
|
|
267
|
+
for (var z = N; z !== e.tail && (U < he || typeof z.value == "string"); z = z.next) C++, U += z.value.length;
|
|
268
|
+
C--, h = t.slice(g, U), E.index -= g;
|
|
269
|
+
} else if (!(E = k(j, 0, h, W))) continue;
|
|
270
|
+
$ = E.index;
|
|
271
|
+
var Y = E[0], Q = h.slice(0, $), ie = h.slice($ + Y.length), ee = g + h.length;
|
|
272
|
+
u && ee > u.reach && (u.reach = ee);
|
|
273
|
+
var X = N.prev;
|
|
274
|
+
if (Q && (X = I(e, X, Q), g += Q.length), x(e, X, C), N = I(e, X, new y(p, H ? s.tokenize(Y, H) : Y, J, Y)), ie && I(e, N, ie), C > 1) {
|
|
275
|
+
var te = { cause: p + "," + w, reach: ee };
|
|
276
|
+
d(t, e, a, N.prev, g, te), u && te.reach > u.reach && (u.reach = te.reach);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
654
279
|
}
|
|
655
280
|
}
|
|
656
|
-
},
|
|
657
|
-
/\$(?:\w+|[#?*!@$])/
|
|
658
|
-
],
|
|
659
|
-
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
660
|
-
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
661
|
-
};
|
|
662
|
-
e.languages.bash = {
|
|
663
|
-
shebang: {
|
|
664
|
-
pattern: /^#!\s*\/.*/,
|
|
665
|
-
alias: "important"
|
|
666
|
-
},
|
|
667
|
-
comment: {
|
|
668
|
-
pattern: /(^|[^"{\\$])#.*/,
|
|
669
|
-
lookbehind: !0
|
|
670
|
-
},
|
|
671
|
-
"function-name": [
|
|
672
|
-
// a) function foo {
|
|
673
|
-
// b) foo() {
|
|
674
|
-
// c) function foo() {
|
|
675
|
-
// but not “foo {”
|
|
676
|
-
{
|
|
677
|
-
// a) and c)
|
|
678
|
-
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
|
|
679
|
-
lookbehind: !0,
|
|
680
|
-
alias: "function"
|
|
681
|
-
},
|
|
682
|
-
{
|
|
683
|
-
// b)
|
|
684
|
-
pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
|
|
685
|
-
alias: "function"
|
|
686
281
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
},
|
|
708
|
-
// Highlight parameter names as variables
|
|
709
|
-
parameter: {
|
|
710
|
-
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
|
|
711
|
-
alias: "variable",
|
|
712
|
-
lookbehind: !0
|
|
713
|
-
},
|
|
714
|
-
string: [
|
|
715
|
-
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
|
|
716
|
-
{
|
|
717
|
-
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
718
|
-
lookbehind: !0,
|
|
719
|
-
greedy: !0,
|
|
720
|
-
inside: o
|
|
721
|
-
},
|
|
722
|
-
// Here-document with quotes around the tag
|
|
723
|
-
// → No expansion (so no “inside”).
|
|
724
|
-
{
|
|
725
|
-
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
|
|
726
|
-
lookbehind: !0,
|
|
727
|
-
greedy: !0,
|
|
728
|
-
inside: {
|
|
729
|
-
bash: a
|
|
730
|
-
}
|
|
731
|
-
},
|
|
732
|
-
// “Normal” string
|
|
733
|
-
{
|
|
734
|
-
// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
|
|
735
|
-
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
736
|
-
lookbehind: !0,
|
|
737
|
-
greedy: !0,
|
|
738
|
-
inside: o
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
742
|
-
pattern: /(^|[^$\\])'[^']*'/,
|
|
743
|
-
lookbehind: !0,
|
|
744
|
-
greedy: !0
|
|
745
|
-
},
|
|
746
|
-
{
|
|
747
|
-
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
|
748
|
-
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
749
|
-
greedy: !0,
|
|
750
|
-
inside: {
|
|
751
|
-
entity: o.entity
|
|
752
|
-
}
|
|
282
|
+
}
|
|
283
|
+
function S() {
|
|
284
|
+
var t = { value: null, prev: null, next: null }, e = { value: null, prev: t, next: null };
|
|
285
|
+
t.next = e, this.head = t, this.tail = e, this.length = 0;
|
|
286
|
+
}
|
|
287
|
+
function I(t, e, a) {
|
|
288
|
+
var r = e.next, o = { value: a, prev: e, next: r };
|
|
289
|
+
return e.next = o, r.prev = o, t.length++, o;
|
|
290
|
+
}
|
|
291
|
+
function x(t, e, a) {
|
|
292
|
+
for (var r = e.next, o = 0; o < a && r !== t.tail; o++) r = r.next;
|
|
293
|
+
e.next = r, r.prev = e, t.length -= o;
|
|
294
|
+
}
|
|
295
|
+
if (i.Prism = s, y.stringify = function t(e, a) {
|
|
296
|
+
if (typeof e == "string") return e;
|
|
297
|
+
if (Array.isArray(e)) {
|
|
298
|
+
var r = "";
|
|
299
|
+
return e.forEach(function(w) {
|
|
300
|
+
r += t(w, a);
|
|
301
|
+
}), r;
|
|
753
302
|
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
}
|
|
779
|
-
"
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
303
|
+
var o = { type: e.type, content: t(e.content, a), tag: "span", classes: ["token", e.type], attributes: {}, language: a }, u = e.alias;
|
|
304
|
+
u && (Array.isArray(u) ? Array.prototype.push.apply(o.classes, u) : o.classes.push(u)), s.hooks.run("wrap", o);
|
|
305
|
+
var p = "";
|
|
306
|
+
for (var m in o.attributes) p += " " + m + '="' + (o.attributes[m] || "").replace(/"/g, """) + '"';
|
|
307
|
+
return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + p + ">" + o.content + "</" + o.tag + ">";
|
|
308
|
+
}, !i.document) return i.addEventListener && (s.disableWorkerMessageHandler || i.addEventListener("message", function(t) {
|
|
309
|
+
var e = JSON.parse(t.data), a = e.language, r = e.code, o = e.immediateClose;
|
|
310
|
+
i.postMessage(s.highlight(r, s.languages[a], a)), o && i.close();
|
|
311
|
+
}, !1)), s;
|
|
312
|
+
var L = s.util.currentScript();
|
|
313
|
+
function R() {
|
|
314
|
+
s.manual || s.highlightAll();
|
|
315
|
+
}
|
|
316
|
+
if (L && (s.filename = L.src, L.hasAttribute("data-manual") && (s.manual = !0)), !s.manual) {
|
|
317
|
+
var F = document.readyState;
|
|
318
|
+
F === "loading" || F === "interactive" && L && L.defer ? document.addEventListener("DOMContentLoaded", R) : window.requestAnimationFrame ? window.requestAnimationFrame(R) : window.setTimeout(R, 16);
|
|
319
|
+
}
|
|
320
|
+
return s;
|
|
321
|
+
}(typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {});
|
|
322
|
+
c.exports && (c.exports = n), ce !== void 0 && (ce.Prism = n), n.languages.markup = { comment: { pattern: /<!--(?:(?!<!--)[\s\S])*?-->/, greedy: !0 }, prolog: { pattern: /<\?[\s\S]+?\?>/, greedy: !0 }, doctype: { pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i, greedy: !0, inside: { "internal-subset": { pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, lookbehind: !0, greedy: !0, inside: null }, string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 }, punctuation: /^<!|>$|[[\]]/, "doctype-tag": /^DOCTYPE/i, name: /[^\s<>'"]+/ } }, cdata: { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, greedy: !0 }, tag: { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, greedy: !0, inside: { tag: { pattern: /^<\/?[^\s>\/]+/, inside: { punctuation: /^<\/?/, namespace: /^[^\s>\/:]+:/ } }, "special-attr": [], "attr-value": { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { punctuation: [{ pattern: /^=/, alias: "attr-equals" }, { pattern: /^(\s*)["']|["']$/, lookbehind: !0 }] } }, punctuation: /\/?>/, "attr-name": { pattern: /[^\s>\/]+/, inside: { namespace: /^[^\s>\/:]+:/ } } } }, entity: [{ pattern: /&[\da-z]{1,8};/i, alias: "named-entity" }, /&#x?[\da-f]{1,8};/i] }, n.languages.markup.tag.inside["attr-value"].inside.entity = n.languages.markup.entity, n.languages.markup.doctype.inside["internal-subset"].inside = n.languages.markup, n.hooks.add("wrap", function(i) {
|
|
323
|
+
i.type === "entity" && (i.attributes.title = i.content.replace(/&/, "&"));
|
|
324
|
+
}), Object.defineProperty(n.languages.markup.tag, "addInlined", { value: function(i, l) {
|
|
325
|
+
var f = {};
|
|
326
|
+
f["language-" + l] = { pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i, lookbehind: !0, inside: n.languages[l] }, f.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
327
|
+
var b = { "included-cdata": { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, inside: f } };
|
|
328
|
+
b["language-" + l] = { pattern: /[\s\S]+/, inside: n.languages[l] };
|
|
329
|
+
var s = {};
|
|
330
|
+
s[i] = { pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
331
|
+
return i;
|
|
332
|
+
}), "i"), lookbehind: !0, greedy: !0, inside: b }, n.languages.insertBefore("markup", "cdata", s);
|
|
333
|
+
} }), Object.defineProperty(n.languages.markup.tag, "addAttribute", { value: function(i, l) {
|
|
334
|
+
n.languages.markup.tag.inside["special-attr"].push({ pattern: RegExp(/(^|["'\s])/.source + "(?:" + i + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"), lookbehind: !0, inside: { "attr-name": /^[^\s=]+/, "attr-value": { pattern: /=[\s\S]+/, inside: { value: { pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/, lookbehind: !0, alias: [l, "language-" + l], inside: n.languages[l] }, punctuation: [{ pattern: /^=/, alias: "attr-equals" }, /"|'/] } } } });
|
|
335
|
+
} }), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, function(i) {
|
|
336
|
+
var l = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
337
|
+
i.languages.css = { comment: /\/\*[\s\S]*?\*\//, atrule: { pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + l.source + ")*?" + /(?:;|(?=\s*\{))/.source), inside: { rule: /^@[\w-]+/, "selector-function-argument": { pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/, lookbehind: !0, alias: "selector" }, keyword: { pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, lookbehind: !0 } } }, url: { pattern: RegExp("\\burl\\((?:" + l.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"), greedy: !0, inside: { function: /^url/i, punctuation: /^\(|\)$/, string: { pattern: RegExp("^" + l.source + "$"), alias: "url" } } }, selector: { pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + l.source + ")*(?=\\s*\\{)"), lookbehind: !0 }, string: { pattern: l, greedy: !0 }, property: { pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i, lookbehind: !0 }, important: /!important\b/i, function: { pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i, lookbehind: !0 }, punctuation: /[(){};:,]/ }, i.languages.css.atrule.inside.rest = i.languages.css;
|
|
338
|
+
var f = i.languages.markup;
|
|
339
|
+
f && (f.tag.addInlined("style", "css"), f.tag.addAttribute("style", "css"));
|
|
340
|
+
}(n), n.languages.clike = { comment: [{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, lookbehind: !0, inside: { punctuation: /[.\\]/ } }, keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, boolean: /\b(?:false|true)\b/, function: /\b\w+(?=\()/, number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, punctuation: /[{}[\];(),.:]/ }, n.languages.javascript = n.languages.extend("clike", { "class-name": [n.languages.clike["class-name"], { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, lookbehind: !0 }], keyword: [{ pattern: /((?:^|\})\s*)catch\b/, lookbehind: !0 }, { pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, lookbehind: !0 }], function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, number: { pattern: RegExp(/(^|[^\w$])/.source + "(?:" + /NaN|Infinity/.source + "|" + /0[bB][01]+(?:_[01]+)*n?/.source + "|" + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + /\d+(?:_\d+)*n/.source + "|" + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source + ")" + /(?![\w$])/.source), lookbehind: !0 }, operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }), n.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, n.languages.insertBefore("javascript", "keyword", { regex: { pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source), lookbehind: !0, greedy: !0, inside: { "regex-source": { pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, lookbehind: !0, alias: "language-regex", inside: n.languages.regex }, "regex-delimiter": /^\/|\/$/, "regex-flags": /^[a-z]+$/ } }, "function-variable": { pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, alias: "function" }, parameter: [{ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, lookbehind: !0, inside: n.languages.javascript }, { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, lookbehind: !0, inside: n.languages.javascript }, { pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, lookbehind: !0, inside: n.languages.javascript }, { pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, lookbehind: !0, inside: n.languages.javascript }], constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/ }), n.languages.insertBefore("javascript", "string", { hashbang: { pattern: /^#!.*/, greedy: !0, alias: "comment" }, "template-string": { pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, greedy: !0, inside: { "template-punctuation": { pattern: /^`|`$/, alias: "string" }, interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, lookbehind: !0, inside: { "interpolation-punctuation": { pattern: /^\$\{|\}$/, alias: "punctuation" }, rest: n.languages.javascript } }, string: /[\s\S]+/ } }, "string-property": { pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, lookbehind: !0, greedy: !0, alias: "property" } }), n.languages.insertBefore("javascript", "operator", { "literal-property": { pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, lookbehind: !0, alias: "property" } }), n.languages.markup && (n.languages.markup.tag.addInlined("script", "javascript"), n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, "javascript")), n.languages.js = n.languages.javascript, function() {
|
|
341
|
+
if (n !== void 0 && typeof document < "u") {
|
|
342
|
+
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
343
|
+
var i = { js: "javascript", py: "python", rb: "ruby", ps1: "powershell", psm1: "powershell", sh: "bash", bat: "batch", h: "c", tex: "latex" }, l = "data-src-status", f = "loading", b = "loaded", s = "pre[data-src]:not([" + l + '="' + b + '"]):not([' + l + '="' + f + '"])';
|
|
344
|
+
n.hooks.add("before-highlightall", function(k) {
|
|
345
|
+
k.selector += ", " + s;
|
|
346
|
+
}), n.hooks.add("before-sanity-check", function(k) {
|
|
347
|
+
var d = k.element;
|
|
348
|
+
if (d.matches(s)) {
|
|
349
|
+
k.code = "", d.setAttribute(l, f);
|
|
350
|
+
var S = d.appendChild(document.createElement("CODE"));
|
|
351
|
+
S.textContent = "Loading…";
|
|
352
|
+
var I = d.getAttribute("data-src"), x = k.language;
|
|
353
|
+
if (x === "none") {
|
|
354
|
+
var L = (/\.(\w+)$/.exec(I) || [, "none"])[1];
|
|
355
|
+
x = i[L] || L;
|
|
356
|
+
}
|
|
357
|
+
n.util.setLanguage(S, x), n.util.setLanguage(d, x);
|
|
358
|
+
var R = n.plugins.autoloader;
|
|
359
|
+
R && R.loadLanguages(x), function(F, t, e) {
|
|
360
|
+
var a = new XMLHttpRequest();
|
|
361
|
+
a.open("GET", F, !0), a.onreadystatechange = function() {
|
|
362
|
+
a.readyState == 4 && (a.status < 400 && a.responseText ? t(a.responseText) : a.status >= 400 ? e("✖ Error " + a.status + " while fetching file: " + a.statusText) : e("✖ Error: File does not exist or is empty"));
|
|
363
|
+
}, a.send(null);
|
|
364
|
+
}(I, function(F) {
|
|
365
|
+
d.setAttribute(l, b);
|
|
366
|
+
var t = function(o) {
|
|
367
|
+
var u = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(o || "");
|
|
368
|
+
if (u) {
|
|
369
|
+
var p = Number(u[1]), m = u[2], w = u[3];
|
|
370
|
+
return m ? w ? [p, Number(w)] : [p, void 0] : [p, p];
|
|
371
|
+
}
|
|
372
|
+
}(d.getAttribute("data-range"));
|
|
373
|
+
if (t) {
|
|
374
|
+
var e = F.split(/\r\n?|\n/g), a = t[0], r = t[1] == null ? e.length : t[1];
|
|
375
|
+
a < 0 && (a += e.length), a = Math.max(0, Math.min(a - 1, e.length)), r < 0 && (r += e.length), r = Math.max(0, Math.min(r, e.length)), F = e.slice(a, r).join(`
|
|
376
|
+
`), d.hasAttribute("data-start") || d.setAttribute("data-start", String(a + 1));
|
|
377
|
+
}
|
|
378
|
+
S.textContent = F, n.highlightElement(S);
|
|
379
|
+
}, function(F) {
|
|
380
|
+
d.setAttribute(l, "failed"), S.textContent = F;
|
|
381
|
+
});
|
|
790
382
|
}
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
383
|
+
}), n.plugins.fileHighlight = { highlight: function(k) {
|
|
384
|
+
for (var d, S = (k || document).querySelectorAll(s), I = 0; d = S[I++]; ) n.highlightElement(d);
|
|
385
|
+
} };
|
|
386
|
+
var y = !1;
|
|
387
|
+
n.fileHighlight = function() {
|
|
388
|
+
y || (y = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
389
|
+
};
|
|
797
390
|
}
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
],
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
})(Prism
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
lookbehind: !0,
|
|
828
|
-
greedy: !0
|
|
829
|
-
},
|
|
830
|
-
comment: {
|
|
831
|
-
pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
|
|
832
|
-
greedy: !0
|
|
833
|
-
},
|
|
834
|
-
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
|
835
|
-
punctuation: /[{}[\],]/,
|
|
836
|
-
operator: /:/,
|
|
837
|
-
boolean: /\b(?:false|true)\b/,
|
|
838
|
-
null: {
|
|
839
|
-
pattern: /\bnull\b/,
|
|
840
|
-
alias: "keyword"
|
|
841
|
-
}
|
|
842
|
-
};
|
|
843
|
-
Prism.languages.webmanifest = Prism.languages.json;
|
|
844
|
-
const ye = `
|
|
391
|
+
}();
|
|
392
|
+
})(pe);
|
|
393
|
+
const ae = Le(pe.exports);
|
|
394
|
+
Prism.languages.clike = { comment: [{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, lookbehind: !0, inside: { punctuation: /[.\\]/ } }, keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, boolean: /\b(?:false|true)\b/, function: /\b\w+(?=\()/, number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, punctuation: /[{}[\];(),.:]/ }, Prism.languages.javascript = Prism.languages.extend("clike", { "class-name": [Prism.languages.clike["class-name"], { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, lookbehind: !0 }], keyword: [{ pattern: /((?:^|\})\s*)catch\b/, lookbehind: !0 }, { pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, lookbehind: !0 }], function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, number: { pattern: RegExp(/(^|[^\w$])/.source + "(?:" + /NaN|Infinity/.source + "|" + /0[bB][01]+(?:_[01]+)*n?/.source + "|" + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + /\d+(?:_\d+)*n/.source + "|" + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source + ")" + /(?![\w$])/.source), lookbehind: !0 }, operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }), Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, Prism.languages.insertBefore("javascript", "keyword", { regex: { pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source), lookbehind: !0, greedy: !0, inside: { "regex-source": { pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, lookbehind: !0, alias: "language-regex", inside: Prism.languages.regex }, "regex-delimiter": /^\/|\/$/, "regex-flags": /^[a-z]+$/ } }, "function-variable": { pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, alias: "function" }, parameter: [{ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, lookbehind: !0, inside: Prism.languages.javascript }, { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, lookbehind: !0, inside: Prism.languages.javascript }, { pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, lookbehind: !0, inside: Prism.languages.javascript }, { pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, lookbehind: !0, inside: Prism.languages.javascript }], constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/ }), Prism.languages.insertBefore("javascript", "string", { hashbang: { pattern: /^#!.*/, greedy: !0, alias: "comment" }, "template-string": { pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, greedy: !0, inside: { "template-punctuation": { pattern: /^`|`$/, alias: "string" }, interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, lookbehind: !0, inside: { "interpolation-punctuation": { pattern: /^\$\{|\}$/, alias: "punctuation" }, rest: Prism.languages.javascript } }, string: /[\s\S]+/ } }, "string-property": { pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, lookbehind: !0, greedy: !0, alias: "property" } }), Prism.languages.insertBefore("javascript", "operator", { "literal-property": { pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, lookbehind: !0, alias: "property" } }), Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, "javascript")), Prism.languages.js = Prism.languages.javascript, Prism.languages.python = { comment: { pattern: /(^|[^\\])#.*/, lookbehind: !0, greedy: !0 }, "string-interpolation": { pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, greedy: !0, inside: { interpolation: { pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/, lookbehind: !0, inside: { "format-spec": { pattern: /(:)[^:(){}]+(?=\}$)/, lookbehind: !0 }, "conversion-option": { pattern: //, alias: "punctuation" }, rest: null } }, string: /[\s\S]+/ } }, "triple-quoted-string": { pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i, greedy: !0, alias: "string" }, string: { pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, greedy: !0 }, function: { pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, lookbehind: !0 }, "class-name": { pattern: /(\bclass\s+)\w+/i, lookbehind: !0 }, decorator: { pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m, lookbehind: !0, alias: ["annotation", "punctuation"], inside: { punctuation: /\./ } }, keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, boolean: /\b(?:False|None|True)\b/, number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i, operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, punctuation: /[{}[\];(),.:]/ }, Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python, Prism.languages.py = Prism.languages.python, Prism.languages.go = Prism.languages.extend("clike", { string: { pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/, lookbehind: !0, greedy: !0 }, keyword: /\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/, boolean: /\b(?:_|false|iota|nil|true)\b/, number: [/\b0(?:b[01_]+|o[0-7_]+)i?\b/i, /\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i, /(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i], operator: /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./, builtin: /\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/ }), Prism.languages.insertBefore("go", "string", { char: { pattern: /'(?:\\.|[^'\\\r\n]){0,10}'/, greedy: !0 } }), delete Prism.languages.go["class-name"], function(c) {
|
|
395
|
+
var n = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, i = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = { pattern: RegExp(/(^|[^\w.])/.source + i + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source), lookbehind: !0, inside: { namespace: { pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/, inside: { punctuation: /\./ } }, punctuation: /\./ } };
|
|
396
|
+
c.languages.java = c.languages.extend("clike", { string: { pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/, lookbehind: !0, greedy: !0 }, "class-name": [l, { pattern: RegExp(/(^|[^\w.])/.source + i + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source), lookbehind: !0, inside: l.inside }, { pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + i + /[A-Z]\w*\b/.source), lookbehind: !0, inside: l.inside }], keyword: n, function: [c.languages.clike.function, { pattern: /(::\s*)[a-z_]\w*/, lookbehind: !0 }], number: /\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i, operator: { pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, lookbehind: !0 }, constant: /\b[A-Z][A-Z_\d]+\b/ }), c.languages.insertBefore("java", "string", { "triple-quoted-string": { pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/, greedy: !0, alias: "string" }, char: { pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/, greedy: !0 } }), c.languages.insertBefore("java", "class-name", { annotation: { pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/, lookbehind: !0, alias: "punctuation" }, generics: { pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/, inside: { "class-name": l, keyword: n, punctuation: /[<>(),.:]/, operator: /[?&|]/ } }, import: [{ pattern: RegExp(/(\bimport\s+)/.source + i + /(?:[A-Z]\w*|\*)(?=\s*;)/.source), lookbehind: !0, inside: { namespace: l.inside.namespace, punctuation: /\./, operator: /\*/, "class-name": /\w+/ } }, { pattern: RegExp(/(\bimport\s+static\s+)/.source + i + /(?:\w+|\*)(?=\s*;)/.source), lookbehind: !0, alias: "static", inside: { namespace: l.inside.namespace, static: /\b\w+$/, punctuation: /\./, operator: /\*/, "class-name": /\w+/ } }], namespace: { pattern: RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function() {
|
|
397
|
+
return n.source;
|
|
398
|
+
})), lookbehind: !0, inside: { punctuation: /\./ } } });
|
|
399
|
+
}(Prism), Prism.languages.c = Prism.languages.extend("clike", { comment: { pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 }, string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, greedy: !0 }, "class-name": { pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/, lookbehind: !0 }, keyword: /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/, function: /\b[a-z_]\w*(?=\s*\()/i, number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/ }), Prism.languages.insertBefore("c", "string", { char: { pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/, greedy: !0 } }), Prism.languages.insertBefore("c", "string", { macro: { pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, lookbehind: !0, greedy: !0, alias: "property", inside: { string: [{ pattern: /^(#\s*include\s*)<[^>]+>/, lookbehind: !0 }, Prism.languages.c.string], char: Prism.languages.c.char, comment: Prism.languages.c.comment, "macro-name": [{ pattern: /(^#\s*define\s+)\w+\b(?!\()/i, lookbehind: !0 }, { pattern: /(^#\s*define\s+)\w+\b(?=\()/i, lookbehind: !0, alias: "function" }], directive: { pattern: /^(#\s*)[a-z]+/, lookbehind: !0, alias: "keyword" }, "directive-hash": /^#/, punctuation: /##|\\(?=[\r\n])/, expression: { pattern: /\S[\s\S]*/, inside: Prism.languages.c } } } }), Prism.languages.insertBefore("c", "function", { constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/ }), delete Prism.languages.c.boolean, function(c) {
|
|
400
|
+
for (var n = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, i = 0; i < 2; i++) n = n.replace(/<self>/g, function() {
|
|
401
|
+
return n;
|
|
402
|
+
});
|
|
403
|
+
n = n.replace(/<self>/g, function() {
|
|
404
|
+
return /[^\s\S]/.source;
|
|
405
|
+
}), c.languages.rust = { comment: [{ pattern: RegExp(/(^|[^\\])/.source + n), lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/, greedy: !0 }, char: { pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/, greedy: !0 }, attribute: { pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/, greedy: !0, alias: "attr-name", inside: { string: null } }, "closure-params": { pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/, lookbehind: !0, greedy: !0, inside: { "closure-punctuation": { pattern: /^\||\|$/, alias: "punctuation" }, rest: null } }, "lifetime-annotation": { pattern: /'\w+/, alias: "symbol" }, "fragment-specifier": { pattern: /(\$\w+:)[a-z]+/, lookbehind: !0, alias: "punctuation" }, variable: /\$\w+/, "function-definition": { pattern: /(\bfn\s+)\w+/, lookbehind: !0, alias: "function" }, "type-definition": { pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/, lookbehind: !0, alias: "class-name" }, "module-declaration": [{ pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/, lookbehind: !0, alias: "namespace" }, { pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/, lookbehind: !0, alias: "namespace", inside: { punctuation: /::/ } }], keyword: [/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/, /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/], function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/, macro: { pattern: /\b\w+!/, alias: "property" }, constant: /\b[A-Z_][A-Z_\d]+\b/, "class-name": /\b[A-Z]\w*\b/, namespace: { pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/, inside: { punctuation: /::/ } }, number: /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/, boolean: /\b(?:false|true)\b/, punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/, operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/ }, c.languages.rust["closure-params"].inside.rest = c.languages.rust, c.languages.rust.attribute.inside.string = c.languages.rust.string;
|
|
406
|
+
}(Prism), Prism.languages.sql = { comment: { pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, lookbehind: !0 }, variable: [{ pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/, greedy: !0 }, /@[\w.$]+/], string: { pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/, greedy: !0, lookbehind: !0 }, identifier: { pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/, greedy: !0, lookbehind: !0, inside: { punctuation: /^`|`$/ } }, function: /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, keyword: /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i, boolean: /\b(?:FALSE|NULL|TRUE)\b/i, number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i, operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, punctuation: /[;[\]()`,.]/ }, function(c) {
|
|
407
|
+
var n = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", i = { pattern: /(^(["']?)\w+\2)[ \t]+\S.*/, lookbehind: !0, alias: "punctuation", inside: null }, l = { bash: i, environment: { pattern: RegExp("\\$" + n), alias: "constant" }, variable: [{ pattern: /\$?\(\([\s\S]+?\)\)/, greedy: !0, inside: { variable: [{ pattern: /(^\$\(\([\s\S]+)\)\)/, lookbehind: !0 }, /^\$\(\(/], number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/, operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/, punctuation: /\(\(?|\)\)?|,|;/ } }, { pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/, greedy: !0, inside: { variable: /^\$\(|^`|\)$|`$/ } }, { pattern: /\$\{[^}]+\}/, greedy: !0, inside: { operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/, punctuation: /[\[\]]/, environment: { pattern: RegExp("(\\{)" + n), lookbehind: !0, alias: "constant" } } }, /\$(?:\w+|[#?*!@$])/], entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/ };
|
|
408
|
+
c.languages.bash = { shebang: { pattern: /^#!\s*\/.*/, alias: "important" }, comment: { pattern: /(^|[^"{\\$])#.*/, lookbehind: !0 }, "function-name": [{ pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/, lookbehind: !0, alias: "function" }, { pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/, alias: "function" }], "for-or-select": { pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/, alias: "variable", lookbehind: !0 }, "assign-left": { pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/, inside: { environment: { pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + n), lookbehind: !0, alias: "constant" } }, alias: "variable", lookbehind: !0 }, parameter: { pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/, alias: "variable", lookbehind: !0 }, string: [{ pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/, lookbehind: !0, greedy: !0, inside: l }, { pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/, lookbehind: !0, greedy: !0, inside: { bash: i } }, { pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/, lookbehind: !0, greedy: !0, inside: l }, { pattern: /(^|[^$\\])'[^']*'/, lookbehind: !0, greedy: !0 }, { pattern: /\$'(?:[^'\\]|\\[\s\S])*'/, greedy: !0, inside: { entity: l.entity } }], environment: { pattern: RegExp("\\$?" + n), alias: "constant" }, variable: l.variable, function: { pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, lookbehind: !0 }, keyword: { pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/, lookbehind: !0 }, builtin: { pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/, lookbehind: !0, alias: "class-name" }, boolean: { pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/, lookbehind: !0 }, "file-descriptor": { pattern: /\B&\d\b/, alias: "important" }, operator: { pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/, inside: { "file-descriptor": { pattern: /^\d/, alias: "important" } } }, punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/, number: { pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, lookbehind: !0 } }, i.inside = c.languages.bash;
|
|
409
|
+
for (var f = ["comment", "function-name", "for-or-select", "assign-left", "parameter", "string", "environment", "function", "keyword", "builtin", "boolean", "file-descriptor", "operator", "punctuation", "number"], b = l.variable[1].inside, s = 0; s < f.length; s++) b[f[s]] = c.languages.bash[f[s]];
|
|
410
|
+
c.languages.sh = c.languages.bash, c.languages.shell = c.languages.bash;
|
|
411
|
+
}(Prism), Prism.languages.json = { property: { pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, lookbehind: !0, greedy: !0 }, string: { pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, lookbehind: !0, greedy: !0 }, comment: { pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 }, number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, punctuation: /[{}[\],]/, operator: /:/, boolean: /\b(?:false|true)\b/, null: { pattern: /\bnull\b/, alias: "keyword" } }, Prism.languages.webmanifest = Prism.languages.json;
|
|
412
|
+
const Ce = ["innerHTML"], Pe = ["value", "disabled"], ge = (c, n) => {
|
|
413
|
+
const i = c.__vccOpts || c;
|
|
414
|
+
for (const [l, f] of n) i[l] = f;
|
|
415
|
+
return i;
|
|
416
|
+
}, De = ge(oe({ __name: "CodeEditor", props: { modelValue: {}, language: {}, theme: { default: "dark" }, disabled: { type: Boolean, default: !1 } }, emits: ["update:modelValue", "change"], setup(c, { emit: n }) {
|
|
417
|
+
function i(t) {
|
|
418
|
+
if (typeof document > "u") return;
|
|
419
|
+
const e = "hep-cr-prism-styles", a = document.getElementById(e), r = t === "dark" ? `
|
|
845
420
|
/* 默认代码颜色 */
|
|
846
421
|
.hep-cr-editor .hep-cr-highlight code,
|
|
847
422
|
.hep-cr-editor .hep-cr-highlight pre {
|
|
@@ -927,7 +502,7 @@ const ye = `
|
|
|
927
502
|
.hep-cr-editor .token.console {
|
|
928
503
|
color: #f8f8f2 !important;
|
|
929
504
|
}
|
|
930
|
-
|
|
505
|
+
` : `
|
|
931
506
|
/* 默认代码颜色 */
|
|
932
507
|
.hep-cr-editor .hep-cr-highlight code,
|
|
933
508
|
.hep-cr-editor .hep-cr-highlight pre {
|
|
@@ -1004,541 +579,154 @@ const ye = `
|
|
|
1004
579
|
.hep-cr-editor .token.console {
|
|
1005
580
|
color: #333 !important;
|
|
1006
581
|
}
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
language: {},
|
|
1012
|
-
theme: { default: "dark" },
|
|
1013
|
-
disabled: { type: Boolean, default: !1 }
|
|
1014
|
-
},
|
|
1015
|
-
emits: ["update:modelValue", "change"],
|
|
1016
|
-
setup(e, { emit: u }) {
|
|
1017
|
-
ie((l) => ({
|
|
1018
|
-
v2b19bab6: L.value
|
|
1019
|
-
})), typeof window < "u" && (window.Prism = H);
|
|
1020
|
-
function a(l) {
|
|
1021
|
-
if (typeof document > "u") return;
|
|
1022
|
-
const d = "hep-cr-prism-styles", w = document.getElementById(d), F = l === "dark" ? ye : Ae;
|
|
1023
|
-
w && w.remove();
|
|
1024
|
-
const A = document.createElement("style");
|
|
1025
|
-
A.id = d, A.textContent = F, document.head.appendChild(A);
|
|
1026
|
-
}
|
|
1027
|
-
const o = e, E = u, f = m(null), p = m(null);
|
|
1028
|
-
let b = null;
|
|
1029
|
-
function v(l) {
|
|
1030
|
-
b && clearTimeout(b), b = setTimeout(() => {
|
|
1031
|
-
E("change", l);
|
|
1032
|
-
}, Re);
|
|
1033
|
-
}
|
|
1034
|
-
const g = {
|
|
1035
|
-
javascript: "javascript",
|
|
1036
|
-
js: "javascript",
|
|
1037
|
-
typescript: "typescript",
|
|
1038
|
-
ts: "typescript",
|
|
1039
|
-
python: "python",
|
|
1040
|
-
py: "python",
|
|
1041
|
-
java: "java",
|
|
1042
|
-
c: "c",
|
|
1043
|
-
cpp: "cpp",
|
|
1044
|
-
"c++": "cpp",
|
|
1045
|
-
csharp: "csharp",
|
|
1046
|
-
"c#": "csharp",
|
|
1047
|
-
go: "go",
|
|
1048
|
-
golang: "go",
|
|
1049
|
-
rust: "rust",
|
|
1050
|
-
ruby: "ruby",
|
|
1051
|
-
rb: "ruby",
|
|
1052
|
-
php: "php",
|
|
1053
|
-
swift: "swift",
|
|
1054
|
-
kotlin: "kotlin",
|
|
1055
|
-
kt: "kotlin",
|
|
1056
|
-
sql: "sql",
|
|
1057
|
-
bash: "bash",
|
|
1058
|
-
sh: "bash",
|
|
1059
|
-
shell: "bash",
|
|
1060
|
-
json: "json",
|
|
1061
|
-
yaml: "yaml",
|
|
1062
|
-
yml: "yaml",
|
|
1063
|
-
markdown: "markdown",
|
|
1064
|
-
md: "markdown"
|
|
1065
|
-
}, h = _(() => g[o.language.toLowerCase()] || "javascript"), L = _(() => o.theme === "dark" ? "#1e1e1e" : "#fafafa"), N = _(() => {
|
|
1066
|
-
try {
|
|
1067
|
-
const l = H.languages[h.value];
|
|
1068
|
-
if (l)
|
|
1069
|
-
return H.highlight(o.modelValue || "", l, h.value);
|
|
1070
|
-
} catch {
|
|
1071
|
-
}
|
|
1072
|
-
return S(o.modelValue || "");
|
|
1073
|
-
});
|
|
1074
|
-
function S(l) {
|
|
1075
|
-
const d = document.createElement("div");
|
|
1076
|
-
return d.textContent = l, d.innerHTML;
|
|
1077
|
-
}
|
|
1078
|
-
function C(l) {
|
|
1079
|
-
const d = l.target;
|
|
1080
|
-
E("update:modelValue", d.value), v(d.value);
|
|
1081
|
-
}
|
|
1082
|
-
function T() {
|
|
1083
|
-
f.value && p.value && (p.value.scrollTop = f.value.scrollTop, p.value.scrollLeft = f.value.scrollLeft);
|
|
1084
|
-
}
|
|
1085
|
-
function y(l) {
|
|
1086
|
-
if (l.key === "Tab") {
|
|
1087
|
-
l.preventDefault();
|
|
1088
|
-
const d = l.target, w = d.selectionStart, F = d.selectionEnd, A = d.value;
|
|
1089
|
-
d.value = A.substring(0, w) + " " + A.substring(F), d.selectionStart = d.selectionEnd = w + 2, E("update:modelValue", d.value), v(d.value);
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
return W(() => {
|
|
1093
|
-
a(o.theme);
|
|
1094
|
-
}), Y(() => o.theme, (l) => {
|
|
1095
|
-
a(l);
|
|
1096
|
-
}), le(() => {
|
|
1097
|
-
b && clearTimeout(b);
|
|
1098
|
-
}), (l, d) => (i(), c("div", {
|
|
1099
|
-
class: O(["hep-cr-editor", `hep-cr-theme-${e.theme}`])
|
|
1100
|
-
}, [
|
|
1101
|
-
r("pre", {
|
|
1102
|
-
ref_key: "highlightRef",
|
|
1103
|
-
ref: p,
|
|
1104
|
-
class: O(["hep-cr-highlight", [`language-${h.value}`, `hep-cr-prism-${e.theme}`]]),
|
|
1105
|
-
"aria-hidden": "true"
|
|
1106
|
-
}, [
|
|
1107
|
-
r("code", { innerHTML: N.value }, null, 8, Ie)
|
|
1108
|
-
], 2),
|
|
1109
|
-
r("textarea", {
|
|
1110
|
-
ref_key: "codeRef",
|
|
1111
|
-
ref: f,
|
|
1112
|
-
class: "hep-cr-input",
|
|
1113
|
-
value: e.modelValue,
|
|
1114
|
-
disabled: e.disabled,
|
|
1115
|
-
onInput: C,
|
|
1116
|
-
onScroll: T,
|
|
1117
|
-
onKeydown: y,
|
|
1118
|
-
spellcheck: "false",
|
|
1119
|
-
placeholder: "Write your code here..."
|
|
1120
|
-
}, null, 40, _e)
|
|
1121
|
-
], 2));
|
|
582
|
+
`;
|
|
583
|
+
a && a.remove();
|
|
584
|
+
const o = document.createElement("style");
|
|
585
|
+
o.id = e, o.textContent = r, document.head.appendChild(o);
|
|
1122
586
|
}
|
|
1123
|
-
}),
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
key: 0,
|
|
1155
|
-
class: "hep-cr-error"
|
|
1156
|
-
}, ze = { class: "hep-cr-main" }, Ve = { class: "hep-cr-panel-header" }, Ye = { class: "hep-cr-output-actions" }, Xe = { class: "hep-cr-language-badge" }, je = ["disabled", "title"], Ke = {
|
|
1157
|
-
key: 0,
|
|
1158
|
-
width: "14",
|
|
1159
|
-
height: "14",
|
|
1160
|
-
viewBox: "0 0 24 24",
|
|
1161
|
-
fill: "none",
|
|
1162
|
-
stroke: "currentColor",
|
|
1163
|
-
"stroke-width": "2"
|
|
1164
|
-
}, Ze = {
|
|
1165
|
-
key: 1,
|
|
1166
|
-
class: "hep-cr-copied-text"
|
|
1167
|
-
}, We = { class: "hep-cr-panel-header" }, qe = { class: "hep-cr-output-tabs" }, Qe = { class: "hep-cr-output-actions" }, Je = {
|
|
1168
|
-
key: 0,
|
|
1169
|
-
class: "hep-cr-execution-time"
|
|
1170
|
-
}, et = ["disabled", "title"], tt = {
|
|
1171
|
-
key: 0,
|
|
1172
|
-
width: "14",
|
|
1173
|
-
height: "14",
|
|
1174
|
-
viewBox: "0 0 24 24",
|
|
1175
|
-
fill: "none",
|
|
1176
|
-
stroke: "currentColor",
|
|
1177
|
-
"stroke-width": "2"
|
|
1178
|
-
}, nt = {
|
|
1179
|
-
key: 1,
|
|
1180
|
-
class: "hep-cr-copied-text"
|
|
1181
|
-
}, rt = { class: "hep-cr-output-content" }, at = { key: 0 }, ot = {
|
|
1182
|
-
key: 1,
|
|
1183
|
-
class: "hep-cr-stderr"
|
|
1184
|
-
}, Z = "hep-cr-default-language", st = /* @__PURE__ */ V({
|
|
1185
|
-
__name: "CodeRunner",
|
|
1186
|
-
props: {
|
|
1187
|
-
pistonUrl: { default: "/api/piston" },
|
|
1188
|
-
language: { default: "javascript" },
|
|
1189
|
-
theme: { default: "light" },
|
|
1190
|
-
themeColor: { default: "" },
|
|
1191
|
-
showLanguageSelector: { type: Boolean, default: !0 },
|
|
1192
|
-
showEditor: { type: Boolean, default: !0 },
|
|
1193
|
-
editable: { type: Boolean, default: !0 },
|
|
1194
|
-
defaultCode: {},
|
|
1195
|
-
executorLabel: { default: "运行" }
|
|
1196
|
-
},
|
|
1197
|
-
emits: ["execute-start", "execute-end", "language-change", "change"],
|
|
1198
|
-
setup(e, { emit: u }) {
|
|
1199
|
-
const a = e, o = _(() => {
|
|
1200
|
-
if (!a.themeColor) return {};
|
|
1201
|
-
const t = a.theme === "dark", n = a.themeColor, I = E(n) ? "#000" : "#fff";
|
|
1202
|
-
return {
|
|
1203
|
-
"--hep-cr-theme-color": n,
|
|
1204
|
-
"--hep-cr-theme-color-hover": t ? f(n, 20) : f(n, -20),
|
|
1205
|
-
"--hep-cr-tab-active-color": I
|
|
1206
|
-
};
|
|
1207
|
-
});
|
|
1208
|
-
function E(t) {
|
|
1209
|
-
const n = parseInt(t.replace("#", ""), 16), s = n >> 16 & 255, I = n >> 8 & 255, G = n & 255;
|
|
1210
|
-
return (0.299 * s + 0.587 * I + 0.114 * G) / 255 > 0.5;
|
|
1211
|
-
}
|
|
1212
|
-
function f(t, n) {
|
|
1213
|
-
const s = parseInt(t.replace("#", ""), 16), I = Math.round(2.55 * n), G = Math.min(255, Math.max(0, (s >> 16) + I)), K = Math.min(255, Math.max(0, (s >> 8 & 255) + I)), se = Math.min(255, Math.max(0, (s & 255) + I));
|
|
1214
|
-
return "#" + (16777216 + G * 65536 + K * 256 + se).toString(16).slice(1);
|
|
1215
|
-
}
|
|
1216
|
-
const p = u, b = m([]), v = m(w()), g = m(a.theme), h = m(""), L = m(""), N = m(""), S = m(!1), C = m(null), T = m("stdout"), y = m(null), l = m(!1), d = m(60);
|
|
1217
|
-
function w() {
|
|
1218
|
-
return typeof window > "u" ? a.language : localStorage.getItem(Z) || a.language;
|
|
1219
|
-
}
|
|
1220
|
-
function F() {
|
|
1221
|
-
g.value = g.value === "light" ? "dark" : "light";
|
|
587
|
+
me((t) => ({ v2b19bab6: I.value })), typeof window < "u" && (window.Prism = ae);
|
|
588
|
+
const l = c, f = n, b = O(null), s = O(null);
|
|
589
|
+
let y = null;
|
|
590
|
+
function k(t) {
|
|
591
|
+
y && clearTimeout(y), y = setTimeout(() => {
|
|
592
|
+
f("change", t);
|
|
593
|
+
}, 500);
|
|
594
|
+
}
|
|
595
|
+
const d = { javascript: "javascript", js: "javascript", typescript: "typescript", ts: "typescript", python: "python", py: "python", java: "java", c: "c", cpp: "cpp", "c++": "cpp", csharp: "csharp", "c#": "csharp", go: "go", golang: "go", rust: "rust", ruby: "ruby", rb: "ruby", php: "php", swift: "swift", kotlin: "kotlin", kt: "kotlin", sql: "sql", bash: "bash", sh: "bash", shell: "bash", json: "json", yaml: "yaml", yml: "yaml", markdown: "markdown", md: "markdown" }, S = D(() => d[l.language.toLowerCase()] || "javascript"), I = D(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), x = D(() => {
|
|
596
|
+
try {
|
|
597
|
+
const t = ae.languages[S.value];
|
|
598
|
+
if (t) return ae.highlight(l.modelValue || "", t, S.value);
|
|
599
|
+
} catch {
|
|
600
|
+
}
|
|
601
|
+
return function(t) {
|
|
602
|
+
const e = document.createElement("div");
|
|
603
|
+
return e.textContent = t, e.innerHTML;
|
|
604
|
+
}(l.modelValue || "");
|
|
605
|
+
});
|
|
606
|
+
function L(t) {
|
|
607
|
+
const e = t.target;
|
|
608
|
+
f("update:modelValue", e.value), k(e.value);
|
|
609
|
+
}
|
|
610
|
+
function R() {
|
|
611
|
+
b.value && s.value && (s.value.scrollTop = b.value.scrollTop, s.value.scrollLeft = b.value.scrollLeft);
|
|
612
|
+
}
|
|
613
|
+
function F(t) {
|
|
614
|
+
if (t.key === "Tab") {
|
|
615
|
+
t.preventDefault();
|
|
616
|
+
const e = t.target, a = e.selectionStart, r = e.selectionEnd, o = e.value;
|
|
617
|
+
e.value = o.substring(0, a) + " " + o.substring(r), e.selectionStart = e.selectionEnd = a + 2, f("update:modelValue", e.value), k(e.value);
|
|
1222
618
|
}
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
619
|
+
}
|
|
620
|
+
return de(() => {
|
|
621
|
+
i(l.theme);
|
|
622
|
+
}), se(() => l.theme, (t) => {
|
|
623
|
+
i(t);
|
|
624
|
+
}), fe(() => {
|
|
625
|
+
y && clearTimeout(y);
|
|
626
|
+
}), (t, e) => (A(), T("div", { class: B(["hep-cr-editor", `hep-cr-theme-${c.theme}`]) }, [v("pre", { ref_key: "highlightRef", ref: s, class: B(["hep-cr-highlight", [`language-${S.value}`, `hep-cr-prism-${c.theme}`]]), "aria-hidden": "true" }, [v("code", { innerHTML: x.value }, null, 8, Ce)], 2), v("textarea", { ref_key: "codeRef", ref: b, class: "hep-cr-input", value: c.modelValue, disabled: c.disabled, onInput: L, onScroll: R, onKeydown: F, spellcheck: "false", placeholder: "Write your code here..." }, null, 40, Pe)], 2));
|
|
627
|
+
} }), [["__scopeId", "data-v-a988ca2a"]]), $e = { class: "hep-cr-header" }, Me = { class: "hep-cr-controls" }, Ue = ["disabled"], Be = { key: 0, value: "" }, He = ["value"], Ge = { class: "hep-cr-actions" }, je = ["disabled"], ze = { key: 0, class: "hep-cr-spinner" }, We = { key: 1, class: "hep-cr-run-icon" }, Ve = ["title"], Ye = { key: 0, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, Xe = { key: 1, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, Ze = { key: 0, class: "hep-cr-error" }, Ke = { class: "hep-cr-main" }, qe = { class: "hep-cr-panel-header" }, Je = { class: "hep-cr-output-actions" }, Qe = { class: "hep-cr-language-badge" }, et = ["disabled", "title"], tt = { key: 0, width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, nt = { key: 1, class: "hep-cr-copied-text" }, at = { class: "hep-cr-panel-header" }, rt = { class: "hep-cr-output-tabs" }, ot = { class: "hep-cr-output-actions" }, st = { key: 0, class: "hep-cr-execution-time" }, it = ["disabled", "title"], lt = { key: 0, width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, ct = { key: 1, class: "hep-cr-copied-text" }, ut = { class: "hep-cr-output-content" }, dt = { key: 0 }, pt = { key: 1, class: "hep-cr-stderr" }, ue = "hep-cr-default-language", q = ge(oe({ __name: "CodeRunner", props: { pistonUrl: { default: "/api/piston" }, language: { default: "javascript" }, theme: { default: "light" }, themeColor: { default: "" }, showLanguageSelector: { type: Boolean, default: !0 }, showEditor: { type: Boolean, default: !0 }, editable: { type: Boolean, default: !0 }, defaultCode: {}, executorLabel: { default: "运行" } }, emits: ["execute-start", "execute-end", "language-change", "change"], setup(c, { emit: n }) {
|
|
628
|
+
const i = c, l = D(() => {
|
|
629
|
+
if (!i.themeColor) return {};
|
|
630
|
+
const g = i.theme === "dark", h = i.themeColor, E = function(C) {
|
|
631
|
+
const $ = parseInt(C.replace("#", ""), 16);
|
|
632
|
+
return (0.299 * ($ >> 16 & 255) + 0.587 * ($ >> 8 & 255) + 0.114 * (255 & $)) / 255 > 0.5;
|
|
633
|
+
}(h) ? "#000" : "#fff";
|
|
634
|
+
return { "--hep-cr-theme-color": h, "--hep-cr-theme-color-hover": f(h, g ? 20 : -20), "--hep-cr-tab-active-color": E };
|
|
635
|
+
});
|
|
636
|
+
function f(g, h) {
|
|
637
|
+
const E = parseInt(g.replace("#", ""), 16), C = Math.round(2.55 * h);
|
|
638
|
+
return "#" + (16777216 + 65536 * Math.min(255, Math.max(0, (E >> 16) + C)) + 256 * Math.min(255, Math.max(0, (E >> 8 & 255) + C)) + Math.min(255, Math.max(0, (255 & E) + C))).toString(16).slice(1);
|
|
639
|
+
}
|
|
640
|
+
const b = n, s = O([]), y = O(typeof window > "u" ? i.language : localStorage.getItem(ue) || i.language), k = O(i.theme), d = O(""), S = O(""), I = O(""), x = O(!1), L = O(null), R = O("stdout"), F = O(null), t = O(!1), e = O(60);
|
|
641
|
+
function a() {
|
|
642
|
+
k.value = k.value === "light" ? "dark" : "light";
|
|
643
|
+
}
|
|
644
|
+
const r = D(() => new Ne({ pistonUrl: i.pistonUrl })), o = D(() => s.value.map((g) => ({ value: `${g.language}:${g.version}`, label: `${g.language.charAt(0).toUpperCase() + g.language.slice(1)} ${g.version}` }))), u = D(() => {
|
|
645
|
+
const g = y.value;
|
|
646
|
+
return g.includes(":") ? g.split(":")[0] : g;
|
|
647
|
+
});
|
|
648
|
+
async function p() {
|
|
649
|
+
if (!x.value) {
|
|
650
|
+
x.value = !0, S.value = "", I.value = "", L.value = null, F.value = null, R.value = "stdout", b("execute-start");
|
|
1234
651
|
try {
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
y.value = t instanceof Error ? t.message : "Failed to load runtimes";
|
|
652
|
+
const g = await r.value.execute(u.value, d.value);
|
|
653
|
+
S.value = g.output, I.value = g.stderr, L.value = g.executionTime || null, R.value = g.stderr ? "stderr" : "stdout", b("execute-end", g);
|
|
654
|
+
} catch (g) {
|
|
655
|
+
F.value = g instanceof Error ? g.message : "Execution failed", b("execute-end", { success: !1, output: "", stderr: F.value, code: -1 });
|
|
1240
656
|
} finally {
|
|
1241
|
-
l.value = !1;
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
Y(v, (t) => {
|
|
1245
|
-
const n = t.includes(":") ? t.split(":")[0] : t, s = U(n);
|
|
1246
|
-
h.value = s, p("language-change", n, s), typeof window < "u" && localStorage.setItem(Z, t);
|
|
1247
|
-
});
|
|
1248
|
-
async function ee() {
|
|
1249
|
-
if (!S.value) {
|
|
1250
|
-
S.value = !0, L.value = "", N.value = "", C.value = null, y.value = null, T.value = "stdout", p("execute-start");
|
|
1251
|
-
try {
|
|
1252
|
-
const t = await A.value.execute(P.value, h.value);
|
|
1253
|
-
L.value = t.output, N.value = t.stderr, C.value = t.executionTime || null, T.value = t.stderr ? "stderr" : "stdout", p("execute-end", t);
|
|
1254
|
-
} catch (t) {
|
|
1255
|
-
y.value = t instanceof Error ? t.message : "Execution failed", p("execute-end", {
|
|
1256
|
-
success: !1,
|
|
1257
|
-
output: "",
|
|
1258
|
-
stderr: y.value,
|
|
1259
|
-
code: -1
|
|
1260
|
-
});
|
|
1261
|
-
} finally {
|
|
1262
|
-
S.value = !1;
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
const x = m(!1), D = m(!1);
|
|
1267
|
-
async function te() {
|
|
1268
|
-
await navigator.clipboard.writeText(h.value), x.value = !0, setTimeout(() => {
|
|
1269
657
|
x.value = !1;
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
async function ne() {
|
|
1273
|
-
const t = T.value === "stdout" ? L.value : N.value;
|
|
1274
|
-
await navigator.clipboard.writeText(t), D.value = !0, setTimeout(() => {
|
|
1275
|
-
D.value = !1;
|
|
1276
|
-
}, 2e3);
|
|
1277
|
-
}
|
|
1278
|
-
function re() {
|
|
1279
|
-
h.value = U(P.value);
|
|
1280
|
-
}
|
|
1281
|
-
let $ = !1;
|
|
1282
|
-
function ae(t) {
|
|
1283
|
-
$ = !0, document.addEventListener("mousemove", X), document.addEventListener("mouseup", j), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
1284
|
-
}
|
|
1285
|
-
function X(t) {
|
|
1286
|
-
if (!$) return;
|
|
1287
|
-
const n = document.querySelector(
|
|
1288
|
-
".hep-cr-main"
|
|
1289
|
-
);
|
|
1290
|
-
if (!n) return;
|
|
1291
|
-
const s = n.getBoundingClientRect(), I = (t.clientX - s.left) / s.width * 100;
|
|
1292
|
-
d.value = Math.max(20, Math.min(80, I));
|
|
1293
|
-
}
|
|
1294
|
-
function j() {
|
|
1295
|
-
$ = !1, document.removeEventListener("mousemove", X), document.removeEventListener("mouseup", j), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
658
|
+
}
|
|
1296
659
|
}
|
|
1297
|
-
W(async () => {
|
|
1298
|
-
await J(), h.value || (h.value = a.defaultCode || U(v.value), p("change", h.value));
|
|
1299
|
-
});
|
|
1300
|
-
const oe = _(() => `hep-cr-runner-${g.value}`);
|
|
1301
|
-
return (t, n) => (i(), c("div", {
|
|
1302
|
-
class: O(["hep-cr-runner", oe.value]),
|
|
1303
|
-
style: M(o.value)
|
|
1304
|
-
}, [
|
|
1305
|
-
r("div", Oe, [
|
|
1306
|
-
r("div", Le, [
|
|
1307
|
-
e.showLanguageSelector ? ce((i(), c("select", {
|
|
1308
|
-
key: 0,
|
|
1309
|
-
"onUpdate:modelValue": n[0] || (n[0] = (s) => v.value = s),
|
|
1310
|
-
class: "hep-cr-language-select",
|
|
1311
|
-
disabled: S.value
|
|
1312
|
-
}, [
|
|
1313
|
-
l.value ? (i(), c("option", xe, "加载中...")) : k("", !0),
|
|
1314
|
-
(i(!0), c(ue, null, de(Q.value, (s) => (i(), c("option", {
|
|
1315
|
-
key: s.value,
|
|
1316
|
-
value: s.value
|
|
1317
|
-
}, R(s.label), 9, De))), 128))
|
|
1318
|
-
], 8, Ce)), [
|
|
1319
|
-
[pe, v.value]
|
|
1320
|
-
]) : k("", !0)
|
|
1321
|
-
]),
|
|
1322
|
-
r("div", Fe, [
|
|
1323
|
-
r("button", {
|
|
1324
|
-
class: "hep-cr-btn hep-cr-btn-run",
|
|
1325
|
-
disabled: S.value || l.value,
|
|
1326
|
-
onClick: ee
|
|
1327
|
-
}, [
|
|
1328
|
-
S.value ? (i(), c("span", Ue)) : (i(), c("span", Me, "▶")),
|
|
1329
|
-
he(" " + R(S.value ? "运行中..." : e.executorLabel), 1)
|
|
1330
|
-
], 8, Pe),
|
|
1331
|
-
e.showEditor && e.editable ? (i(), c("button", {
|
|
1332
|
-
key: 0,
|
|
1333
|
-
class: "hep-cr-btn hep-cr-btn-reset",
|
|
1334
|
-
onClick: re
|
|
1335
|
-
}, " 重置 ")) : k("", !0),
|
|
1336
|
-
r("button", {
|
|
1337
|
-
class: "hep-cr-btn hep-cr-btn-theme",
|
|
1338
|
-
onClick: F,
|
|
1339
|
-
title: g.value === "light" ? "Switch to dark mode" : "Switch to light mode"
|
|
1340
|
-
}, [
|
|
1341
|
-
g.value === "light" ? (i(), c("svg", $e, [...n[5] || (n[5] = [
|
|
1342
|
-
r("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)
|
|
1343
|
-
])])) : (i(), c("svg", Ge, [...n[6] || (n[6] = [
|
|
1344
|
-
ge('<circle cx="12" cy="12" r="5" data-v-41977f3b></circle><line x1="12" y1="1" x2="12" y2="3" data-v-41977f3b></line><line x1="12" y1="21" x2="12" y2="23" data-v-41977f3b></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-41977f3b></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-41977f3b></line><line x1="1" y1="12" x2="3" y2="12" data-v-41977f3b></line><line x1="21" y1="12" x2="23" y2="12" data-v-41977f3b></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-41977f3b></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-41977f3b></line>', 9)
|
|
1345
|
-
])]))
|
|
1346
|
-
], 8, Be)
|
|
1347
|
-
])
|
|
1348
|
-
]),
|
|
1349
|
-
y.value ? (i(), c("div", He, R(y.value), 1)) : k("", !0),
|
|
1350
|
-
r("div", ze, [
|
|
1351
|
-
e.showEditor ? (i(), c("div", {
|
|
1352
|
-
key: 0,
|
|
1353
|
-
class: "hep-cr-editor-panel",
|
|
1354
|
-
style: M({ width: d.value + "%" })
|
|
1355
|
-
}, [
|
|
1356
|
-
r("div", Ve, [
|
|
1357
|
-
n[8] || (n[8] = r("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
|
|
1358
|
-
r("div", Ye, [
|
|
1359
|
-
r("span", Xe, R(P.value), 1),
|
|
1360
|
-
r("button", {
|
|
1361
|
-
class: O(["hep-cr-btn-icon", { "hep-cr-btn-copied": x.value }]),
|
|
1362
|
-
disabled: x.value,
|
|
1363
|
-
onClick: te,
|
|
1364
|
-
title: x.value ? "已复制" : "复制"
|
|
1365
|
-
}, [
|
|
1366
|
-
x.value ? (i(), c("span", Ze, "已复制")) : (i(), c("svg", Ke, [...n[7] || (n[7] = [
|
|
1367
|
-
r("rect", {
|
|
1368
|
-
x: "9",
|
|
1369
|
-
y: "9",
|
|
1370
|
-
width: "13",
|
|
1371
|
-
height: "13",
|
|
1372
|
-
rx: "2",
|
|
1373
|
-
ry: "2"
|
|
1374
|
-
}, null, -1),
|
|
1375
|
-
r("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
1376
|
-
])]))
|
|
1377
|
-
], 10, je)
|
|
1378
|
-
])
|
|
1379
|
-
]),
|
|
1380
|
-
z(we, {
|
|
1381
|
-
modelValue: h.value,
|
|
1382
|
-
"onUpdate:modelValue": n[1] || (n[1] = (s) => h.value = s),
|
|
1383
|
-
language: P.value,
|
|
1384
|
-
theme: g.value,
|
|
1385
|
-
disabled: !e.editable || S.value,
|
|
1386
|
-
onChange: n[2] || (n[2] = (s) => p("change", s))
|
|
1387
|
-
}, null, 8, ["modelValue", "language", "theme", "disabled"])
|
|
1388
|
-
], 4)) : k("", !0),
|
|
1389
|
-
e.showEditor ? (i(), c("div", {
|
|
1390
|
-
key: 1,
|
|
1391
|
-
class: "hep-cr-resize-handle",
|
|
1392
|
-
onMousedown: ae
|
|
1393
|
-
}, [...n[9] || (n[9] = [
|
|
1394
|
-
r("div", { class: "hep-cr-resize-line" }, null, -1)
|
|
1395
|
-
])], 32)) : k("", !0),
|
|
1396
|
-
r("div", {
|
|
1397
|
-
class: "hep-cr-output-panel",
|
|
1398
|
-
style: M({ width: e.showEditor ? 100 - d.value + "%" : "100%" })
|
|
1399
|
-
}, [
|
|
1400
|
-
r("div", We, [
|
|
1401
|
-
r("div", qe, [
|
|
1402
|
-
r("button", {
|
|
1403
|
-
class: O(["hep-cr-tab", { active: T.value === "stdout" }]),
|
|
1404
|
-
onClick: n[3] || (n[3] = (s) => T.value = "stdout")
|
|
1405
|
-
}, " 输出 ", 2),
|
|
1406
|
-
N.value ? (i(), c("button", {
|
|
1407
|
-
key: 0,
|
|
1408
|
-
class: O(["hep-cr-tab", "hep-cr-tab-error", { active: T.value === "stderr" }]),
|
|
1409
|
-
onClick: n[4] || (n[4] = (s) => T.value = "stderr")
|
|
1410
|
-
}, " 错误 ", 2)) : k("", !0)
|
|
1411
|
-
]),
|
|
1412
|
-
r("div", Qe, [
|
|
1413
|
-
C.value !== null ? (i(), c("span", Je, R(C.value) + "ms ", 1)) : k("", !0),
|
|
1414
|
-
r("button", {
|
|
1415
|
-
class: O(["hep-cr-btn-icon", { "hep-cr-btn-copied": D.value }]),
|
|
1416
|
-
disabled: D.value,
|
|
1417
|
-
onClick: ne,
|
|
1418
|
-
title: D.value ? "已复制" : "复制"
|
|
1419
|
-
}, [
|
|
1420
|
-
D.value ? (i(), c("span", nt, "已复制")) : (i(), c("svg", tt, [...n[10] || (n[10] = [
|
|
1421
|
-
r("rect", {
|
|
1422
|
-
x: "9",
|
|
1423
|
-
y: "9",
|
|
1424
|
-
width: "13",
|
|
1425
|
-
height: "13",
|
|
1426
|
-
rx: "2",
|
|
1427
|
-
ry: "2"
|
|
1428
|
-
}, null, -1),
|
|
1429
|
-
r("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
1430
|
-
])]))
|
|
1431
|
-
], 10, et)
|
|
1432
|
-
])
|
|
1433
|
-
]),
|
|
1434
|
-
r("div", rt, [
|
|
1435
|
-
T.value === "stdout" ? (i(), c("pre", at, R(S.value ? "代码执行中..." : L.value || '点击"运行"执行代码'), 1)) : (i(), c("pre", ot, R(N.value), 1))
|
|
1436
|
-
])
|
|
1437
|
-
], 4)
|
|
1438
|
-
])
|
|
1439
|
-
], 6));
|
|
1440
660
|
}
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
661
|
+
se(y, (g) => {
|
|
662
|
+
const h = g.includes(":") ? g.split(":")[0] : g, E = Z(h);
|
|
663
|
+
d.value = E, b("language-change", h, E), typeof window < "u" && localStorage.setItem(ue, g);
|
|
664
|
+
});
|
|
665
|
+
const m = O(!1), w = O(!1);
|
|
666
|
+
async function _() {
|
|
667
|
+
await navigator.clipboard.writeText(d.value), m.value = !0, setTimeout(() => {
|
|
668
|
+
m.value = !1;
|
|
669
|
+
}, 2e3);
|
|
670
|
+
}
|
|
671
|
+
async function H() {
|
|
672
|
+
const g = R.value === "stdout" ? S.value : I.value;
|
|
673
|
+
await navigator.clipboard.writeText(g), w.value = !0, setTimeout(() => {
|
|
674
|
+
w.value = !1;
|
|
675
|
+
}, 2e3);
|
|
676
|
+
}
|
|
677
|
+
function W() {
|
|
678
|
+
d.value = Z(u.value);
|
|
679
|
+
}
|
|
680
|
+
let G = !1;
|
|
681
|
+
function J(g) {
|
|
682
|
+
G = !0, document.addEventListener("mousemove", V), document.addEventListener("mouseup", j), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
683
|
+
}
|
|
684
|
+
function V(g) {
|
|
685
|
+
if (!G) return;
|
|
686
|
+
const h = document.querySelector(".hep-cr-main");
|
|
687
|
+
if (!h) return;
|
|
688
|
+
const E = h.getBoundingClientRect(), C = (g.clientX - E.left) / E.width * 100;
|
|
689
|
+
e.value = Math.max(20, Math.min(80, C));
|
|
690
|
+
}
|
|
691
|
+
function j() {
|
|
692
|
+
G = !1, document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", j), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
693
|
+
}
|
|
694
|
+
de(async () => {
|
|
695
|
+
await async function() {
|
|
696
|
+
t.value = !0, F.value = null;
|
|
697
|
+
try {
|
|
698
|
+
s.value = await r.value.getRuntimes();
|
|
699
|
+
const g = y.value.split(":")[0], h = s.value.find((E) => E.language === g);
|
|
700
|
+
h && !y.value.includes(":") && (y.value = `${g}:${h.version}`), d.value || (d.value = i.defaultCode || Z(g), b("change", d.value)), b("language-change", g, d.value);
|
|
701
|
+
} catch (g) {
|
|
702
|
+
F.value = g instanceof Error ? g.message : "Failed to load runtimes";
|
|
703
|
+
} finally {
|
|
704
|
+
t.value = !1;
|
|
1467
705
|
}
|
|
1468
|
-
);
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
close: b
|
|
1477
|
-
}), (g, h) => (i(), me(Ee, { to: "body" }, [
|
|
1478
|
-
z(be, { name: "hep-cr-dialog-fade" }, {
|
|
1479
|
-
default: fe(() => [
|
|
1480
|
-
p.value ? (i(), c("div", {
|
|
1481
|
-
key: 0,
|
|
1482
|
-
class: "hep-cr-dialog-overlay",
|
|
1483
|
-
onClick: v
|
|
1484
|
-
}, [
|
|
1485
|
-
r("div", {
|
|
1486
|
-
class: "hep-cr-dialog-container",
|
|
1487
|
-
style: M({ width: typeof e.width == "number" ? e.width + "px" : e.width })
|
|
1488
|
-
}, [
|
|
1489
|
-
r("div", it, [
|
|
1490
|
-
r("h3", lt, R(e.title), 1),
|
|
1491
|
-
r("button", {
|
|
1492
|
-
class: "hep-cr-dialog-close",
|
|
1493
|
-
onClick: b
|
|
1494
|
-
}, [...h[0] || (h[0] = [
|
|
1495
|
-
r("svg", {
|
|
1496
|
-
width: "16",
|
|
1497
|
-
height: "16",
|
|
1498
|
-
viewBox: "0 0 24 24",
|
|
1499
|
-
fill: "none",
|
|
1500
|
-
stroke: "currentColor",
|
|
1501
|
-
"stroke-width": "2"
|
|
1502
|
-
}, [
|
|
1503
|
-
r("line", {
|
|
1504
|
-
x1: "18",
|
|
1505
|
-
y1: "6",
|
|
1506
|
-
x2: "6",
|
|
1507
|
-
y2: "18"
|
|
1508
|
-
}),
|
|
1509
|
-
r("line", {
|
|
1510
|
-
x1: "6",
|
|
1511
|
-
y1: "6",
|
|
1512
|
-
x2: "18",
|
|
1513
|
-
y2: "18"
|
|
1514
|
-
})
|
|
1515
|
-
], -1)
|
|
1516
|
-
])])
|
|
1517
|
-
]),
|
|
1518
|
-
r("div", ct, [
|
|
1519
|
-
z(B, ve(g.$attrs, Se(g.$attrs)), null, 16)
|
|
1520
|
-
]),
|
|
1521
|
-
g.$slots.footer ? (i(), c("div", ut, [
|
|
1522
|
-
Te(g.$slots, "footer", { close: b })
|
|
1523
|
-
])) : k("", !0)
|
|
1524
|
-
], 4)
|
|
1525
|
-
])) : k("", !0)
|
|
1526
|
-
]),
|
|
1527
|
-
_: 3
|
|
1528
|
-
})
|
|
1529
|
-
]));
|
|
706
|
+
}(), d.value || (d.value = i.defaultCode || Z(y.value), b("change", d.value));
|
|
707
|
+
});
|
|
708
|
+
const N = D(() => `hep-cr-runner-${k.value}`);
|
|
709
|
+
return (g, h) => (A(), T("div", { class: B(["hep-cr-runner", N.value]), style: K(l.value) }, [v("div", $e, [v("div", Me, [c.showLanguageSelector ? be((A(), T("select", { key: 0, "onUpdate:modelValue": h[0] || (h[0] = (E) => y.value = E), class: "hep-cr-language-select", disabled: x.value }, [t.value ? (A(), T("option", Be, "加载中...")) : P("", !0), (A(!0), T(Ee, null, ve(o.value, (E) => (A(), T("option", { key: E.value, value: E.value }, M(E.label), 9, He))), 128))], 8, Ue)), [[ye, y.value]]) : P("", !0)]), v("div", Ge, [v("button", { class: "hep-cr-btn hep-cr-btn-run", disabled: x.value || t.value, onClick: p }, [x.value ? (A(), T("span", ze)) : (A(), T("span", We, "▶")), ke(" " + M(x.value ? "运行中..." : c.executorLabel), 1)], 8, je), c.showEditor && c.editable ? (A(), T("button", { key: 0, class: "hep-cr-btn hep-cr-btn-reset", onClick: W }, " 重置 ")) : P("", !0), v("button", { class: "hep-cr-btn hep-cr-btn-theme", onClick: a, title: k.value === "light" ? "Switch to dark mode" : "Switch to light mode" }, [k.value === "light" ? (A(), T("svg", Ye, [...h[5] || (h[5] = [v("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)])])) : (A(), T("svg", Xe, [...h[6] || (h[6] = [Se('<circle cx="12" cy="12" r="5" data-v-41977f3b></circle><line x1="12" y1="1" x2="12" y2="3" data-v-41977f3b></line><line x1="12" y1="21" x2="12" y2="23" data-v-41977f3b></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-41977f3b></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-41977f3b></line><line x1="1" y1="12" x2="3" y2="12" data-v-41977f3b></line><line x1="21" y1="12" x2="23" y2="12" data-v-41977f3b></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-41977f3b></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-41977f3b></line>', 9)])]))], 8, Ve)])]), F.value ? (A(), T("div", Ze, M(F.value), 1)) : P("", !0), v("div", Ke, [c.showEditor ? (A(), T("div", { key: 0, class: "hep-cr-editor-panel", style: K({ width: e.value + "%" }) }, [v("div", qe, [h[8] || (h[8] = v("span", { class: "hep-cr-panel-title" }, "编辑器", -1)), v("div", Je, [v("span", Qe, M(u.value), 1), v("button", { class: B(["hep-cr-btn-icon", { "hep-cr-btn-copied": m.value }]), disabled: m.value, onClick: _, title: m.value ? "已复制" : "复制" }, [m.value ? (A(), T("span", nt, "已复制")) : (A(), T("svg", tt, [...h[7] || (h[7] = [v("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }, null, -1), v("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)])]))], 10, et)])]), re(De, { modelValue: d.value, "onUpdate:modelValue": h[1] || (h[1] = (E) => d.value = E), language: u.value, theme: k.value, disabled: !c.editable || x.value, onChange: h[2] || (h[2] = (E) => b("change", E)) }, null, 8, ["modelValue", "language", "theme", "disabled"])], 4)) : P("", !0), c.showEditor ? (A(), T("div", { key: 1, class: "hep-cr-resize-handle", onMousedown: J }, [...h[9] || (h[9] = [v("div", { class: "hep-cr-resize-line" }, null, -1)])], 32)) : P("", !0), v("div", { class: "hep-cr-output-panel", style: K({ width: c.showEditor ? 100 - e.value + "%" : "100%" }) }, [v("div", at, [v("div", rt, [v("button", { class: B(["hep-cr-tab", { active: R.value === "stdout" }]), onClick: h[3] || (h[3] = (E) => R.value = "stdout") }, " 输出 ", 2), I.value ? (A(), T("button", { key: 0, class: B(["hep-cr-tab", "hep-cr-tab-error", { active: R.value === "stderr" }]), onClick: h[4] || (h[4] = (E) => R.value = "stderr") }, " 错误 ", 2)) : P("", !0)]), v("div", ot, [L.value !== null ? (A(), T("span", st, M(L.value) + "ms ", 1)) : P("", !0), v("button", { class: B(["hep-cr-btn-icon", { "hep-cr-btn-copied": w.value }]), disabled: w.value, onClick: H, title: w.value ? "已复制" : "复制" }, [w.value ? (A(), T("span", ct, "已复制")) : (A(), T("svg", lt, [...h[10] || (h[10] = [v("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }, null, -1), v("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)])]))], 10, it)])]), v("div", ut, [R.value === "stdout" ? (A(), T("pre", dt, M(x.value ? "代码执行中..." : S.value || '点击"运行"执行代码'), 1)) : (A(), T("pre", pt, M(I.value), 1))])], 4)])], 6));
|
|
710
|
+
} }), [["__scopeId", "data-v-41977f3b"]]), gt = { class: "hep-cr-dialog-header" }, ht = { class: "hep-cr-dialog-title" }, mt = { class: "hep-cr-dialog-body" }, ft = { key: 0, class: "hep-cr-dialog-footer" }, Et = oe({ __name: "CodeRunnerDialog", props: { modelValue: { type: Boolean, default: !1 }, title: { default: "代码执行器" }, width: { default: 800 }, pistonUrl: { default: "/api/piston" }, language: { default: "javascript" }, theme: { default: "light" }, themeColor: { default: "" }, showLanguageSelector: { type: Boolean, default: !0 }, showEditor: { type: Boolean, default: !0 }, editable: { type: Boolean, default: !0 }, defaultCode: {}, executorLabel: { default: "运行" } }, emits: ["update:modelValue", "close", "change"], setup(c, { expose: n, emit: i }) {
|
|
711
|
+
const l = c, f = i, b = O(l.modelValue), s = D(() => l.modelValue !== void 0 ? l.modelValue : b.value);
|
|
712
|
+
function y() {
|
|
713
|
+
b.value = !1, f("update:modelValue", !1), f("close");
|
|
1530
714
|
}
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
e.component("CodeRunner", B);
|
|
1534
|
-
};
|
|
1535
|
-
const mt = {
|
|
1536
|
-
install(e) {
|
|
1537
|
-
e.component("CodeRunner", B);
|
|
715
|
+
function k(d) {
|
|
716
|
+
d.target === d.currentTarget && y();
|
|
1538
717
|
}
|
|
718
|
+
return se(() => l.modelValue, (d) => {
|
|
719
|
+
d !== void 0 && (b.value = d);
|
|
720
|
+
}), n({ close: y }), (d, S) => (A(), we(Ae, { to: "body" }, [re(Te, { name: "hep-cr-dialog-fade" }, { default: xe(() => [s.value ? (A(), T("div", { key: 0, class: "hep-cr-dialog-overlay", onClick: k }, [v("div", { class: "hep-cr-dialog-container", style: K({ width: typeof c.width == "number" ? c.width + "px" : c.width }) }, [v("div", gt, [v("h3", ht, M(c.title), 1), v("button", { class: "hep-cr-dialog-close", onClick: y }, [...S[0] || (S[0] = [v("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" }, [v("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), v("line", { x1: "6", y1: "6", x2: "18", y2: "18" })], -1)])])]), v("div", mt, [re(q, Fe(d.$attrs, Ie(d.$attrs)), null, 16)]), d.$slots.footer ? (A(), T("div", ft, [_e(d.$slots, "footer", { close: y })])) : P("", !0)], 4)])) : P("", !0)]), _: 3 })]));
|
|
721
|
+
} });
|
|
722
|
+
q.install = (c) => {
|
|
723
|
+
c.component("CodeRunner", q);
|
|
1539
724
|
};
|
|
725
|
+
const vt = { install(c) {
|
|
726
|
+
c.component("CodeRunner", q);
|
|
727
|
+
} };
|
|
1540
728
|
export {
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
729
|
+
q as CodeRunner,
|
|
730
|
+
Et as CodeRunnerDialog,
|
|
731
|
+
vt as default
|
|
1544
732
|
};
|