@hep-code-runner/vue3 2.1.2 → 2.1.4
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 +7 -7
- package/dist/index.mjs +570 -567
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as le, useCssVars as
|
|
2
|
-
var Le = Object.defineProperty,
|
|
3
|
-
let
|
|
4
|
-
class
|
|
5
|
-
constructor(
|
|
6
|
-
de(this, "baseUrl"), de(this, "timeout"), this.baseUrl =
|
|
1
|
+
import { defineComponent as le, useCssVars as ve, ref as N, computed as H, onMounted as he, watch as ue, onUnmounted as Ee, openBlock as x, createElementBlock as I, normalizeClass as j, createElementVNode as A, normalizeStyle as Q, withDirectives as ye, createCommentVNode as B, Fragment as Ae, renderList as Se, toDisplayString as z, vModelSelect as ke, createTextVNode as we, createStaticVNode as Te, createVNode as ie, createBlock as _e, Teleport as xe, Transition as Ie, withCtx as Fe, mergeProps as Re, toHandlers as Ne, renderSlot as Oe } from "vue";
|
|
2
|
+
var Le = Object.defineProperty, Ce = (i, p, n) => p in i ? Le(i, p, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[p] = n, de = (i, p, n) => Ce(i, typeof p != "symbol" ? p + "" : p, n);
|
|
3
|
+
let oe = null;
|
|
4
|
+
class De {
|
|
5
|
+
constructor(p = {}) {
|
|
6
|
+
de(this, "baseUrl"), de(this, "timeout"), this.baseUrl = p.pistonUrl || "/api/piston", this.timeout = p.timeout || 3e3;
|
|
7
7
|
}
|
|
8
|
-
async getRuntimes(
|
|
9
|
-
if (
|
|
10
|
-
return
|
|
8
|
+
async getRuntimes(p = !1) {
|
|
9
|
+
if (oe && !p)
|
|
10
|
+
return oe;
|
|
11
11
|
try {
|
|
12
12
|
const n = await fetch(`${this.baseUrl}/runtimes`, {
|
|
13
13
|
method: "GET",
|
|
@@ -18,26 +18,26 @@ class Ce {
|
|
|
18
18
|
if (!n.ok)
|
|
19
19
|
throw new Error(`Failed to fetch runtimes: ${n.statusText}`);
|
|
20
20
|
const l = await n.json();
|
|
21
|
-
return
|
|
21
|
+
return oe = l, l;
|
|
22
22
|
} catch (n) {
|
|
23
23
|
throw console.error("Failed to fetch runtimes:", n), n;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
async execute(
|
|
27
|
-
const
|
|
28
|
-
(
|
|
29
|
-
var
|
|
30
|
-
return
|
|
26
|
+
async execute(p, n, l = {}) {
|
|
27
|
+
const v = (await this.getRuntimes()).find(
|
|
28
|
+
(f) => {
|
|
29
|
+
var b;
|
|
30
|
+
return f.language.toLowerCase() === p.toLowerCase() || ((b = f.aliases) == null ? void 0 : b.some((k) => k.toLowerCase() === p.toLowerCase()));
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
if (!
|
|
34
|
-
throw new Error(`Language '${
|
|
35
|
-
const
|
|
36
|
-
language:
|
|
37
|
-
version: l.version ||
|
|
33
|
+
if (!v)
|
|
34
|
+
throw new Error(`Language '${p}' is not supported`);
|
|
35
|
+
const _ = this.getFileName(p), S = {
|
|
36
|
+
language: v.language,
|
|
37
|
+
version: l.version || v.version,
|
|
38
38
|
files: [
|
|
39
39
|
{
|
|
40
|
-
name:
|
|
40
|
+
name: _,
|
|
41
41
|
content: n
|
|
42
42
|
}
|
|
43
43
|
],
|
|
@@ -45,41 +45,41 @@ class Ce {
|
|
|
45
45
|
args: l.args || [],
|
|
46
46
|
run_timeout: l.runTimeout || this.timeout,
|
|
47
47
|
compile_timeout: this.timeout
|
|
48
|
-
},
|
|
48
|
+
}, o = Date.now();
|
|
49
49
|
try {
|
|
50
|
-
const
|
|
50
|
+
const f = await fetch(`${this.baseUrl}/execute`, {
|
|
51
51
|
method: "POST",
|
|
52
52
|
headers: {
|
|
53
53
|
"Content-Type": "application/json"
|
|
54
54
|
},
|
|
55
|
-
body: JSON.stringify(
|
|
55
|
+
body: JSON.stringify(S)
|
|
56
56
|
});
|
|
57
|
-
if (!
|
|
58
|
-
throw new Error(`Execute failed: ${
|
|
59
|
-
const
|
|
57
|
+
if (!f.ok)
|
|
58
|
+
throw new Error(`Execute failed: ${f.statusText}`);
|
|
59
|
+
const b = await f.json(), k = Date.now() - o, C = b.run.stdout || "", O = b.run.stderr || "";
|
|
60
60
|
return {
|
|
61
|
-
success:
|
|
62
|
-
output:
|
|
61
|
+
success: b.run.code === 0,
|
|
62
|
+
output: C,
|
|
63
63
|
stderr: O,
|
|
64
|
-
code:
|
|
65
|
-
executionTime:
|
|
66
|
-
compile:
|
|
67
|
-
stdout:
|
|
68
|
-
stderr:
|
|
69
|
-
code:
|
|
64
|
+
code: b.run.code,
|
|
65
|
+
executionTime: k,
|
|
66
|
+
compile: b.compile ? {
|
|
67
|
+
stdout: b.compile.stdout || "",
|
|
68
|
+
stderr: b.compile.stderr || "",
|
|
69
|
+
code: b.compile.code
|
|
70
70
|
} : void 0
|
|
71
71
|
};
|
|
72
|
-
} catch (
|
|
72
|
+
} catch (f) {
|
|
73
73
|
return {
|
|
74
74
|
success: !1,
|
|
75
75
|
output: "",
|
|
76
|
-
stderr:
|
|
76
|
+
stderr: f instanceof Error ? f.message : "Unknown error",
|
|
77
77
|
code: -1,
|
|
78
|
-
executionTime: Date.now() -
|
|
78
|
+
executionTime: Date.now() - o
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
getFileName(
|
|
82
|
+
getFileName(p) {
|
|
83
83
|
return {
|
|
84
84
|
javascript: "main.js",
|
|
85
85
|
typescript: "main.ts",
|
|
@@ -106,10 +106,10 @@ class Ce {
|
|
|
106
106
|
css: "style.css",
|
|
107
107
|
sql: "query.sql",
|
|
108
108
|
markdown: "readme.md"
|
|
109
|
-
}[
|
|
109
|
+
}[p.toLowerCase()] || `main.${p}`;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
const
|
|
112
|
+
const Pe = {
|
|
113
113
|
javascript: 'console.log("Hello, World!");',
|
|
114
114
|
typescript: 'console.log("Hello, World!");',
|
|
115
115
|
python: 'print("Hello, World!")',
|
|
@@ -207,18 +207,18 @@ h1 {
|
|
|
207
207
|
|
|
208
208
|
This is a sample markdown document.`
|
|
209
209
|
};
|
|
210
|
-
function
|
|
211
|
-
const
|
|
212
|
-
return
|
|
210
|
+
function J(i) {
|
|
211
|
+
const p = i.toLowerCase();
|
|
212
|
+
return Pe[p] || `// ${i}
|
|
213
213
|
// Write your code here`;
|
|
214
214
|
}
|
|
215
215
|
var pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
216
|
-
function
|
|
216
|
+
function $e(i) {
|
|
217
217
|
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var fe = { exports: {} };
|
|
220
220
|
(function(i) {
|
|
221
|
-
var
|
|
221
|
+
var p = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
222
222
|
/**
|
|
223
223
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
224
224
|
*
|
|
@@ -228,7 +228,7 @@ var he = { exports: {} };
|
|
|
228
228
|
* @public
|
|
229
229
|
*/
|
|
230
230
|
var n = function(l) {
|
|
231
|
-
var
|
|
231
|
+
var v = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, _ = 0, S = {}, o = {
|
|
232
232
|
/**
|
|
233
233
|
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
234
234
|
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
@@ -284,7 +284,7 @@ var he = { exports: {} };
|
|
|
284
284
|
*/
|
|
285
285
|
util: {
|
|
286
286
|
encode: function e(t) {
|
|
287
|
-
return t instanceof
|
|
287
|
+
return t instanceof f ? new f(t.type, e(t.content), t.alias) : Array.isArray(t) ? t.map(e) : t.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
288
288
|
},
|
|
289
289
|
/**
|
|
290
290
|
* Returns the name of the type of the given value.
|
|
@@ -312,7 +312,7 @@ var he = { exports: {} };
|
|
|
312
312
|
* @returns {number}
|
|
313
313
|
*/
|
|
314
314
|
objId: function(e) {
|
|
315
|
-
return e.__id || Object.defineProperty(e, "__id", { value: ++
|
|
315
|
+
return e.__id || Object.defineProperty(e, "__id", { value: ++_ }), e.__id;
|
|
316
316
|
},
|
|
317
317
|
/**
|
|
318
318
|
* Creates a deep clone of the given object.
|
|
@@ -324,28 +324,28 @@ var he = { exports: {} };
|
|
|
324
324
|
* @returns {T}
|
|
325
325
|
* @template T
|
|
326
326
|
*/
|
|
327
|
-
clone: function e(t,
|
|
328
|
-
|
|
329
|
-
var
|
|
330
|
-
switch (
|
|
327
|
+
clone: function e(t, r) {
|
|
328
|
+
r = r || {};
|
|
329
|
+
var a, s;
|
|
330
|
+
switch (o.util.type(t)) {
|
|
331
331
|
case "Object":
|
|
332
|
-
if (
|
|
333
|
-
return
|
|
334
|
-
|
|
335
|
-
{},
|
|
336
|
-
for (var
|
|
337
|
-
t.hasOwnProperty(
|
|
332
|
+
if (s = o.util.objId(t), r[s])
|
|
333
|
+
return r[s];
|
|
334
|
+
a = /** @type {Record<string, any>} */
|
|
335
|
+
{}, r[s] = a;
|
|
336
|
+
for (var u in t)
|
|
337
|
+
t.hasOwnProperty(u) && (a[u] = e(t[u], r));
|
|
338
338
|
return (
|
|
339
339
|
/** @type {any} */
|
|
340
|
-
|
|
340
|
+
a
|
|
341
341
|
);
|
|
342
342
|
case "Array":
|
|
343
|
-
return
|
|
343
|
+
return s = o.util.objId(t), r[s] ? r[s] : (a = [], r[s] = a, /** @type {Array} */
|
|
344
344
|
/** @type {any} */
|
|
345
|
-
t.forEach(function(
|
|
346
|
-
|
|
345
|
+
t.forEach(function(y, c) {
|
|
346
|
+
a[c] = e(y, r);
|
|
347
347
|
}), /** @type {any} */
|
|
348
|
-
|
|
348
|
+
a);
|
|
349
349
|
default:
|
|
350
350
|
return t;
|
|
351
351
|
}
|
|
@@ -360,7 +360,7 @@ var he = { exports: {} };
|
|
|
360
360
|
*/
|
|
361
361
|
getLanguage: function(e) {
|
|
362
362
|
for (; e; ) {
|
|
363
|
-
var t =
|
|
363
|
+
var t = v.exec(e.className);
|
|
364
364
|
if (t)
|
|
365
365
|
return t[1].toLowerCase();
|
|
366
366
|
e = e.parentElement;
|
|
@@ -375,7 +375,7 @@ var he = { exports: {} };
|
|
|
375
375
|
* @returns {void}
|
|
376
376
|
*/
|
|
377
377
|
setLanguage: function(e, t) {
|
|
378
|
-
e.className = e.className.replace(RegExp(
|
|
378
|
+
e.className = e.className.replace(RegExp(v, "gi"), ""), e.classList.add("language-" + t);
|
|
379
379
|
},
|
|
380
380
|
/**
|
|
381
381
|
* Returns the script element that is currently executing.
|
|
@@ -394,13 +394,13 @@ var he = { exports: {} };
|
|
|
394
394
|
);
|
|
395
395
|
try {
|
|
396
396
|
throw new Error();
|
|
397
|
-
} catch (
|
|
398
|
-
var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(
|
|
397
|
+
} catch (a) {
|
|
398
|
+
var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(a.stack) || [])[1];
|
|
399
399
|
if (e) {
|
|
400
400
|
var t = document.getElementsByTagName("script");
|
|
401
|
-
for (var
|
|
402
|
-
if (t[
|
|
403
|
-
return t[
|
|
401
|
+
for (var r in t)
|
|
402
|
+
if (t[r].src == e)
|
|
403
|
+
return t[r];
|
|
404
404
|
}
|
|
405
405
|
return null;
|
|
406
406
|
}
|
|
@@ -424,16 +424,16 @@ var he = { exports: {} };
|
|
|
424
424
|
* @param {boolean} [defaultActivation=false]
|
|
425
425
|
* @returns {boolean}
|
|
426
426
|
*/
|
|
427
|
-
isActive: function(e, t,
|
|
428
|
-
for (var
|
|
429
|
-
var
|
|
430
|
-
if (
|
|
427
|
+
isActive: function(e, t, r) {
|
|
428
|
+
for (var a = "no-" + t; e; ) {
|
|
429
|
+
var s = e.classList;
|
|
430
|
+
if (s.contains(t))
|
|
431
431
|
return !0;
|
|
432
|
-
if (
|
|
432
|
+
if (s.contains(a))
|
|
433
433
|
return !1;
|
|
434
434
|
e = e.parentElement;
|
|
435
435
|
}
|
|
436
|
-
return !!
|
|
436
|
+
return !!r;
|
|
437
437
|
}
|
|
438
438
|
},
|
|
439
439
|
/**
|
|
@@ -447,10 +447,10 @@ var he = { exports: {} };
|
|
|
447
447
|
/**
|
|
448
448
|
* The grammar for plain, unformatted text.
|
|
449
449
|
*/
|
|
450
|
-
plain:
|
|
451
|
-
plaintext:
|
|
452
|
-
text:
|
|
453
|
-
txt:
|
|
450
|
+
plain: S,
|
|
451
|
+
plaintext: S,
|
|
452
|
+
text: S,
|
|
453
|
+
txt: S,
|
|
454
454
|
/**
|
|
455
455
|
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
456
456
|
*
|
|
@@ -480,10 +480,10 @@ var he = { exports: {} };
|
|
|
480
480
|
* });
|
|
481
481
|
*/
|
|
482
482
|
extend: function(e, t) {
|
|
483
|
-
var
|
|
484
|
-
for (var
|
|
485
|
-
a
|
|
486
|
-
return
|
|
483
|
+
var r = o.util.clone(o.languages[e]);
|
|
484
|
+
for (var a in t)
|
|
485
|
+
r[a] = t[a];
|
|
486
|
+
return r;
|
|
487
487
|
},
|
|
488
488
|
/**
|
|
489
489
|
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
@@ -560,31 +560,31 @@ var he = { exports: {} };
|
|
|
560
560
|
* @returns {Grammar} The new grammar object.
|
|
561
561
|
* @public
|
|
562
562
|
*/
|
|
563
|
-
insertBefore: function(e, t,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
var
|
|
567
|
-
for (var
|
|
568
|
-
if (
|
|
569
|
-
if (
|
|
570
|
-
for (var
|
|
571
|
-
|
|
572
|
-
|
|
563
|
+
insertBefore: function(e, t, r, a) {
|
|
564
|
+
a = a || /** @type {any} */
|
|
565
|
+
o.languages;
|
|
566
|
+
var s = a[e], u = {};
|
|
567
|
+
for (var y in s)
|
|
568
|
+
if (s.hasOwnProperty(y)) {
|
|
569
|
+
if (y == t)
|
|
570
|
+
for (var c in r)
|
|
571
|
+
r.hasOwnProperty(c) && (u[c] = r[c]);
|
|
572
|
+
r.hasOwnProperty(y) || (u[y] = s[y]);
|
|
573
573
|
}
|
|
574
|
-
var
|
|
575
|
-
return
|
|
576
|
-
|
|
577
|
-
}),
|
|
574
|
+
var T = a[e];
|
|
575
|
+
return a[e] = u, o.languages.DFS(o.languages, function(F, U) {
|
|
576
|
+
U === T && F != e && (this[F] = u);
|
|
577
|
+
}), u;
|
|
578
578
|
},
|
|
579
579
|
// Traverse a language definition with Depth First Search
|
|
580
|
-
DFS: function e(t,
|
|
581
|
-
|
|
582
|
-
var
|
|
583
|
-
for (var
|
|
584
|
-
if (t.hasOwnProperty(
|
|
585
|
-
|
|
586
|
-
var
|
|
587
|
-
|
|
580
|
+
DFS: function e(t, r, a, s) {
|
|
581
|
+
s = s || {};
|
|
582
|
+
var u = o.util.objId;
|
|
583
|
+
for (var y in t)
|
|
584
|
+
if (t.hasOwnProperty(y)) {
|
|
585
|
+
r.call(t, y, t[y], a || y);
|
|
586
|
+
var c = t[y], T = o.util.type(c);
|
|
587
|
+
T === "Object" && !s[u(c)] ? (s[u(c)] = !0, e(c, r, null, s)) : T === "Array" && !s[u(c)] && (s[u(c)] = !0, e(c, r, y, s));
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
},
|
|
@@ -602,7 +602,7 @@ var he = { exports: {} };
|
|
|
602
602
|
* @public
|
|
603
603
|
*/
|
|
604
604
|
highlightAll: function(e, t) {
|
|
605
|
-
|
|
605
|
+
o.highlightAllUnder(document, e, t);
|
|
606
606
|
},
|
|
607
607
|
/**
|
|
608
608
|
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
@@ -619,15 +619,15 @@ var he = { exports: {} };
|
|
|
619
619
|
* @memberof Prism
|
|
620
620
|
* @public
|
|
621
621
|
*/
|
|
622
|
-
highlightAllUnder: function(e, t,
|
|
623
|
-
var
|
|
624
|
-
callback:
|
|
622
|
+
highlightAllUnder: function(e, t, r) {
|
|
623
|
+
var a = {
|
|
624
|
+
callback: r,
|
|
625
625
|
container: e,
|
|
626
626
|
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
627
627
|
};
|
|
628
|
-
|
|
629
|
-
for (var
|
|
630
|
-
|
|
628
|
+
o.hooks.run("before-highlightall", a), a.elements = Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)), o.hooks.run("before-all-elements-highlight", a);
|
|
629
|
+
for (var s = 0, u; u = a.elements[s++]; )
|
|
630
|
+
o.highlightElement(u, t === !0, a.callback);
|
|
631
631
|
},
|
|
632
632
|
/**
|
|
633
633
|
* Highlights the code inside a single element.
|
|
@@ -657,39 +657,39 @@ var he = { exports: {} };
|
|
|
657
657
|
* @memberof Prism
|
|
658
658
|
* @public
|
|
659
659
|
*/
|
|
660
|
-
highlightElement: function(e, t,
|
|
661
|
-
var
|
|
662
|
-
|
|
663
|
-
var
|
|
664
|
-
|
|
665
|
-
var
|
|
660
|
+
highlightElement: function(e, t, r) {
|
|
661
|
+
var a = o.util.getLanguage(e), s = o.languages[a];
|
|
662
|
+
o.util.setLanguage(e, a);
|
|
663
|
+
var u = e.parentElement;
|
|
664
|
+
u && u.nodeName.toLowerCase() === "pre" && o.util.setLanguage(u, a);
|
|
665
|
+
var y = e.textContent, c = {
|
|
666
666
|
element: e,
|
|
667
|
-
language:
|
|
668
|
-
grammar:
|
|
669
|
-
code:
|
|
667
|
+
language: a,
|
|
668
|
+
grammar: s,
|
|
669
|
+
code: y
|
|
670
670
|
};
|
|
671
|
-
function
|
|
672
|
-
|
|
671
|
+
function T(U) {
|
|
672
|
+
c.highlightedCode = U, o.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, o.hooks.run("after-highlight", c), o.hooks.run("complete", c), r && r.call(c.element);
|
|
673
673
|
}
|
|
674
|
-
if (
|
|
675
|
-
|
|
674
|
+
if (o.hooks.run("before-sanity-check", c), u = c.element.parentElement, u && u.nodeName.toLowerCase() === "pre" && !u.hasAttribute("tabindex") && u.setAttribute("tabindex", "0"), !c.code) {
|
|
675
|
+
o.hooks.run("complete", c), r && r.call(c.element);
|
|
676
676
|
return;
|
|
677
677
|
}
|
|
678
|
-
if (
|
|
679
|
-
|
|
678
|
+
if (o.hooks.run("before-highlight", c), !c.grammar) {
|
|
679
|
+
T(o.util.encode(c.code));
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
if (t && l.Worker) {
|
|
683
|
-
var
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
},
|
|
687
|
-
language:
|
|
688
|
-
code:
|
|
683
|
+
var F = new Worker(o.filename);
|
|
684
|
+
F.onmessage = function(U) {
|
|
685
|
+
T(U.data);
|
|
686
|
+
}, F.postMessage(JSON.stringify({
|
|
687
|
+
language: c.language,
|
|
688
|
+
code: c.code,
|
|
689
689
|
immediateClose: !0
|
|
690
690
|
}));
|
|
691
691
|
} else
|
|
692
|
-
|
|
692
|
+
T(o.highlight(c.code, c.grammar, c.language));
|
|
693
693
|
},
|
|
694
694
|
/**
|
|
695
695
|
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
@@ -711,15 +711,15 @@ var he = { exports: {} };
|
|
|
711
711
|
* @example
|
|
712
712
|
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
713
713
|
*/
|
|
714
|
-
highlight: function(e, t,
|
|
715
|
-
var
|
|
714
|
+
highlight: function(e, t, r) {
|
|
715
|
+
var a = {
|
|
716
716
|
code: e,
|
|
717
717
|
grammar: t,
|
|
718
|
-
language:
|
|
718
|
+
language: r
|
|
719
719
|
};
|
|
720
|
-
if (
|
|
721
|
-
throw new Error('The language "' +
|
|
722
|
-
return
|
|
720
|
+
if (o.hooks.run("before-tokenize", a), !a.grammar)
|
|
721
|
+
throw new Error('The language "' + a.language + '" has no grammar.');
|
|
722
|
+
return a.tokens = o.tokenize(a.code, a.grammar), o.hooks.run("after-tokenize", a), f.stringify(o.util.encode(a.tokens), a.language);
|
|
723
723
|
},
|
|
724
724
|
/**
|
|
725
725
|
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
@@ -746,14 +746,14 @@ var he = { exports: {} };
|
|
|
746
746
|
* });
|
|
747
747
|
*/
|
|
748
748
|
tokenize: function(e, t) {
|
|
749
|
-
var
|
|
750
|
-
if (
|
|
751
|
-
for (var
|
|
752
|
-
t[
|
|
749
|
+
var r = t.rest;
|
|
750
|
+
if (r) {
|
|
751
|
+
for (var a in r)
|
|
752
|
+
t[a] = r[a];
|
|
753
753
|
delete t.rest;
|
|
754
754
|
}
|
|
755
|
-
var
|
|
756
|
-
return O(
|
|
755
|
+
var s = new C();
|
|
756
|
+
return O(s, s.head, e), k(e, s, t, s.head, 0), $(s);
|
|
757
757
|
},
|
|
758
758
|
/**
|
|
759
759
|
* @namespace
|
|
@@ -775,8 +775,8 @@ var he = { exports: {} };
|
|
|
775
775
|
* @public
|
|
776
776
|
*/
|
|
777
777
|
add: function(e, t) {
|
|
778
|
-
var
|
|
779
|
-
|
|
778
|
+
var r = o.hooks.all;
|
|
779
|
+
r[e] = r[e] || [], r[e].push(t);
|
|
780
780
|
},
|
|
781
781
|
/**
|
|
782
782
|
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
@@ -788,133 +788,133 @@ var he = { exports: {} };
|
|
|
788
788
|
* @public
|
|
789
789
|
*/
|
|
790
790
|
run: function(e, t) {
|
|
791
|
-
var
|
|
792
|
-
if (!(!
|
|
793
|
-
for (var
|
|
794
|
-
|
|
791
|
+
var r = o.hooks.all[e];
|
|
792
|
+
if (!(!r || !r.length))
|
|
793
|
+
for (var a = 0, s; s = r[a++]; )
|
|
794
|
+
s(t);
|
|
795
795
|
}
|
|
796
796
|
},
|
|
797
|
-
Token:
|
|
797
|
+
Token: f
|
|
798
798
|
};
|
|
799
|
-
l.Prism =
|
|
800
|
-
function
|
|
801
|
-
this.type = e, this.content = t, this.alias =
|
|
799
|
+
l.Prism = o;
|
|
800
|
+
function f(e, t, r, a) {
|
|
801
|
+
this.type = e, this.content = t, this.alias = r, this.length = (a || "").length | 0;
|
|
802
802
|
}
|
|
803
|
-
|
|
803
|
+
f.stringify = function e(t, r) {
|
|
804
804
|
if (typeof t == "string")
|
|
805
805
|
return t;
|
|
806
806
|
if (Array.isArray(t)) {
|
|
807
|
-
var
|
|
808
|
-
return t.forEach(function(
|
|
809
|
-
|
|
810
|
-
}),
|
|
807
|
+
var a = "";
|
|
808
|
+
return t.forEach(function(T) {
|
|
809
|
+
a += e(T, r);
|
|
810
|
+
}), a;
|
|
811
811
|
}
|
|
812
|
-
var
|
|
812
|
+
var s = {
|
|
813
813
|
type: t.type,
|
|
814
|
-
content: e(t.content,
|
|
814
|
+
content: e(t.content, r),
|
|
815
815
|
tag: "span",
|
|
816
816
|
classes: ["token", t.type],
|
|
817
817
|
attributes: {},
|
|
818
|
-
language:
|
|
819
|
-
},
|
|
820
|
-
|
|
821
|
-
var
|
|
822
|
-
for (var
|
|
823
|
-
|
|
824
|
-
return "<" +
|
|
818
|
+
language: r
|
|
819
|
+
}, u = t.alias;
|
|
820
|
+
u && (Array.isArray(u) ? Array.prototype.push.apply(s.classes, u) : s.classes.push(u)), o.hooks.run("wrap", s);
|
|
821
|
+
var y = "";
|
|
822
|
+
for (var c in s.attributes)
|
|
823
|
+
y += " " + c + '="' + (s.attributes[c] || "").replace(/"/g, """) + '"';
|
|
824
|
+
return "<" + s.tag + ' class="' + s.classes.join(" ") + '"' + y + ">" + s.content + "</" + s.tag + ">";
|
|
825
825
|
};
|
|
826
|
-
function
|
|
826
|
+
function b(e, t, r, a) {
|
|
827
827
|
e.lastIndex = t;
|
|
828
|
-
var
|
|
829
|
-
if (
|
|
830
|
-
var
|
|
831
|
-
|
|
828
|
+
var s = e.exec(r);
|
|
829
|
+
if (s && a && s[1]) {
|
|
830
|
+
var u = s[1].length;
|
|
831
|
+
s.index += u, s[0] = s[0].slice(u);
|
|
832
832
|
}
|
|
833
|
-
return
|
|
833
|
+
return s;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
for (var
|
|
837
|
-
if (!(!
|
|
838
|
-
var
|
|
839
|
-
|
|
840
|
-
for (var
|
|
841
|
-
if (
|
|
835
|
+
function k(e, t, r, a, s, u) {
|
|
836
|
+
for (var y in r)
|
|
837
|
+
if (!(!r.hasOwnProperty(y) || !r[y])) {
|
|
838
|
+
var c = r[y];
|
|
839
|
+
c = Array.isArray(c) ? c : [c];
|
|
840
|
+
for (var T = 0; T < c.length; ++T) {
|
|
841
|
+
if (u && u.cause == y + "," + T)
|
|
842
842
|
return;
|
|
843
|
-
var
|
|
844
|
-
if (
|
|
845
|
-
var
|
|
846
|
-
|
|
843
|
+
var F = c[T], U = F.inside, X = !!F.lookbehind, Z = !!F.greedy, V = F.alias;
|
|
844
|
+
if (Z && !F.pattern.global) {
|
|
845
|
+
var te = F.pattern.toString().match(/[imsuy]*$/)[0];
|
|
846
|
+
F.pattern = RegExp(F.pattern.source, te + "g");
|
|
847
847
|
}
|
|
848
|
-
for (var
|
|
849
|
-
var
|
|
848
|
+
for (var Y = F.pattern || F, R = a.next, D = s; R !== t.tail && !(u && D >= u.reach); D += R.value.length, R = R.next) {
|
|
849
|
+
var d = R.value;
|
|
850
850
|
if (t.length > e.length)
|
|
851
851
|
return;
|
|
852
|
-
if (!(
|
|
853
|
-
var
|
|
854
|
-
if (
|
|
855
|
-
if (
|
|
852
|
+
if (!(d instanceof f)) {
|
|
853
|
+
var g = 1, m;
|
|
854
|
+
if (Z) {
|
|
855
|
+
if (m = b(Y, D, e, X), !m || m.index >= e.length)
|
|
856
856
|
break;
|
|
857
|
-
var
|
|
858
|
-
for (
|
|
859
|
-
|
|
860
|
-
if (
|
|
857
|
+
var W = m.index, M = m.index + m[0].length, P = D;
|
|
858
|
+
for (P += R.value.length; W >= P; )
|
|
859
|
+
R = R.next, P += R.value.length;
|
|
860
|
+
if (P -= R.value.length, D = P, R.value instanceof f)
|
|
861
861
|
continue;
|
|
862
|
-
for (var G =
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
} else if (
|
|
862
|
+
for (var G = R; G !== t.tail && (P < M || typeof G.value == "string"); G = G.next)
|
|
863
|
+
g++, P += G.value.length;
|
|
864
|
+
g--, d = e.slice(D, P), m.index -= D;
|
|
865
|
+
} else if (m = b(Y, 0, d, X), !m)
|
|
866
866
|
continue;
|
|
867
|
-
var
|
|
868
|
-
|
|
869
|
-
var q =
|
|
870
|
-
|
|
871
|
-
var
|
|
872
|
-
if (
|
|
873
|
-
var
|
|
874
|
-
cause:
|
|
875
|
-
reach:
|
|
867
|
+
var W = m.index, K = m[0], ne = d.slice(0, W), ce = d.slice(W + K.length), ae = D + d.length;
|
|
868
|
+
u && ae > u.reach && (u.reach = ae);
|
|
869
|
+
var q = R.prev;
|
|
870
|
+
ne && (q = O(t, q, ne), D += ne.length), L(t, q, g);
|
|
871
|
+
var be = new f(y, U ? o.tokenize(K, U) : K, V, K);
|
|
872
|
+
if (R = O(t, q, be), ce && O(t, R, ce), g > 1) {
|
|
873
|
+
var re = {
|
|
874
|
+
cause: y + "," + T,
|
|
875
|
+
reach: ae
|
|
876
876
|
};
|
|
877
|
-
|
|
877
|
+
k(e, t, r, R.prev, D, re), u && re.reach > u.reach && (u.reach = re.reach);
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function C() {
|
|
885
885
|
var e = { value: null, prev: null, next: null }, t = { value: null, prev: e, next: null };
|
|
886
886
|
e.next = t, this.head = e, this.tail = t, this.length = 0;
|
|
887
887
|
}
|
|
888
|
-
function O(e, t,
|
|
889
|
-
var
|
|
890
|
-
return t.next =
|
|
888
|
+
function O(e, t, r) {
|
|
889
|
+
var a = t.next, s = { value: r, prev: t, next: a };
|
|
890
|
+
return t.next = s, a.prev = s, e.length++, s;
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
for (var
|
|
894
|
-
|
|
895
|
-
t.next =
|
|
892
|
+
function L(e, t, r) {
|
|
893
|
+
for (var a = t.next, s = 0; s < r && a !== e.tail; s++)
|
|
894
|
+
a = a.next;
|
|
895
|
+
t.next = a, a.prev = t, e.length -= s;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
898
|
-
for (var t = [],
|
|
899
|
-
t.push(
|
|
897
|
+
function $(e) {
|
|
898
|
+
for (var t = [], r = e.head.next; r !== e.tail; )
|
|
899
|
+
t.push(r.value), r = r.next;
|
|
900
900
|
return t;
|
|
901
901
|
}
|
|
902
902
|
if (!l.document)
|
|
903
|
-
return l.addEventListener && (
|
|
904
|
-
var t = JSON.parse(e.data),
|
|
905
|
-
l.postMessage(
|
|
906
|
-
}, !1)),
|
|
907
|
-
var
|
|
908
|
-
|
|
909
|
-
function
|
|
910
|
-
|
|
903
|
+
return l.addEventListener && (o.disableWorkerMessageHandler || l.addEventListener("message", function(e) {
|
|
904
|
+
var t = JSON.parse(e.data), r = t.language, a = t.code, s = t.immediateClose;
|
|
905
|
+
l.postMessage(o.highlight(a, o.languages[r], r)), s && l.close();
|
|
906
|
+
}, !1)), o;
|
|
907
|
+
var w = o.util.currentScript();
|
|
908
|
+
w && (o.filename = w.src, w.hasAttribute("data-manual") && (o.manual = !0));
|
|
909
|
+
function E() {
|
|
910
|
+
o.manual || o.highlightAll();
|
|
911
911
|
}
|
|
912
|
-
if (!
|
|
912
|
+
if (!o.manual) {
|
|
913
913
|
var h = document.readyState;
|
|
914
|
-
h === "loading" || h === "interactive" &&
|
|
914
|
+
h === "loading" || h === "interactive" && w && w.defer ? document.addEventListener("DOMContentLoaded", E) : window.requestAnimationFrame ? window.requestAnimationFrame(E) : window.setTimeout(E, 16);
|
|
915
915
|
}
|
|
916
|
-
return
|
|
917
|
-
}(
|
|
916
|
+
return o;
|
|
917
|
+
}(p);
|
|
918
918
|
i.exports && (i.exports = n), typeof pe < "u" && (pe.Prism = n), n.languages.markup = {
|
|
919
919
|
comment: {
|
|
920
920
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
@@ -1006,32 +1006,32 @@ var he = { exports: {} };
|
|
|
1006
1006
|
* @example
|
|
1007
1007
|
* addInlined('style', 'css');
|
|
1008
1008
|
*/
|
|
1009
|
-
value: function(
|
|
1010
|
-
var
|
|
1011
|
-
|
|
1009
|
+
value: function(v, _) {
|
|
1010
|
+
var S = {};
|
|
1011
|
+
S["language-" + _] = {
|
|
1012
1012
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1013
1013
|
lookbehind: !0,
|
|
1014
|
-
inside: n.languages[
|
|
1015
|
-
},
|
|
1016
|
-
var
|
|
1014
|
+
inside: n.languages[_]
|
|
1015
|
+
}, S.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1016
|
+
var o = {
|
|
1017
1017
|
"included-cdata": {
|
|
1018
1018
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1019
|
-
inside:
|
|
1019
|
+
inside: S
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
1022
|
-
|
|
1022
|
+
o["language-" + _] = {
|
|
1023
1023
|
pattern: /[\s\S]+/,
|
|
1024
|
-
inside: n.languages[
|
|
1024
|
+
inside: n.languages[_]
|
|
1025
1025
|
};
|
|
1026
|
-
var
|
|
1027
|
-
|
|
1026
|
+
var f = {};
|
|
1027
|
+
f[v] = {
|
|
1028
1028
|
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1029
|
-
return
|
|
1029
|
+
return v;
|
|
1030
1030
|
}), "i"),
|
|
1031
1031
|
lookbehind: !0,
|
|
1032
1032
|
greedy: !0,
|
|
1033
|
-
inside:
|
|
1034
|
-
}, n.languages.insertBefore("markup", "cdata",
|
|
1033
|
+
inside: o
|
|
1034
|
+
}, n.languages.insertBefore("markup", "cdata", f);
|
|
1035
1035
|
}
|
|
1036
1036
|
}), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
|
|
1037
1037
|
/**
|
|
@@ -1045,7 +1045,7 @@ var he = { exports: {} };
|
|
|
1045
1045
|
* @example
|
|
1046
1046
|
* addAttribute('style', 'css');
|
|
1047
1047
|
*/
|
|
1048
|
-
value: function(l,
|
|
1048
|
+
value: function(l, v) {
|
|
1049
1049
|
n.languages.markup.tag.inside["special-attr"].push({
|
|
1050
1050
|
pattern: RegExp(
|
|
1051
1051
|
/(^|["'\s])/.source + "(?:" + l + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
@@ -1060,8 +1060,8 @@ var he = { exports: {} };
|
|
|
1060
1060
|
value: {
|
|
1061
1061
|
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1062
1062
|
lookbehind: !0,
|
|
1063
|
-
alias: [
|
|
1064
|
-
inside: n.languages[
|
|
1063
|
+
alias: [v, "language-" + v],
|
|
1064
|
+
inside: n.languages[v]
|
|
1065
1065
|
},
|
|
1066
1066
|
punctuation: [
|
|
1067
1067
|
{
|
|
@@ -1076,11 +1076,11 @@ var he = { exports: {} };
|
|
|
1076
1076
|
});
|
|
1077
1077
|
}
|
|
1078
1078
|
}), 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(l) {
|
|
1079
|
-
var
|
|
1079
|
+
var v = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1080
1080
|
l.languages.css = {
|
|
1081
1081
|
comment: /\/\*[\s\S]*?\*\//,
|
|
1082
1082
|
atrule: {
|
|
1083
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" +
|
|
1083
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + v.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
1084
1084
|
inside: {
|
|
1085
1085
|
rule: /^@[\w-]+/,
|
|
1086
1086
|
"selector-function-argument": {
|
|
@@ -1097,23 +1097,23 @@ var he = { exports: {} };
|
|
|
1097
1097
|
},
|
|
1098
1098
|
url: {
|
|
1099
1099
|
// https://drafts.csswg.org/css-values-3/#urls
|
|
1100
|
-
pattern: RegExp("\\burl\\((?:" +
|
|
1100
|
+
pattern: RegExp("\\burl\\((?:" + v.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
1101
1101
|
greedy: !0,
|
|
1102
1102
|
inside: {
|
|
1103
1103
|
function: /^url/i,
|
|
1104
1104
|
punctuation: /^\(|\)$/,
|
|
1105
1105
|
string: {
|
|
1106
|
-
pattern: RegExp("^" +
|
|
1106
|
+
pattern: RegExp("^" + v.source + "$"),
|
|
1107
1107
|
alias: "url"
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
1110
|
},
|
|
1111
1111
|
selector: {
|
|
1112
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` +
|
|
1112
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + v.source + ")*(?=\\s*\\{)"),
|
|
1113
1113
|
lookbehind: !0
|
|
1114
1114
|
},
|
|
1115
1115
|
string: {
|
|
1116
|
-
pattern:
|
|
1116
|
+
pattern: v,
|
|
1117
1117
|
greedy: !0
|
|
1118
1118
|
},
|
|
1119
1119
|
property: {
|
|
@@ -1127,8 +1127,8 @@ var he = { exports: {} };
|
|
|
1127
1127
|
},
|
|
1128
1128
|
punctuation: /[(){};:,]/
|
|
1129
1129
|
}, l.languages.css.atrule.inside.rest = l.languages.css;
|
|
1130
|
-
var
|
|
1131
|
-
|
|
1130
|
+
var _ = l.languages.markup;
|
|
1131
|
+
_ && (_.tag.addInlined("style", "css"), _.tag.addAttribute("style", "css"));
|
|
1132
1132
|
}(n), n.languages.clike = {
|
|
1133
1133
|
comment: [
|
|
1134
1134
|
{
|
|
@@ -1293,9 +1293,9 @@ var he = { exports: {} };
|
|
|
1293
1293
|
if (typeof n > "u" || typeof document > "u")
|
|
1294
1294
|
return;
|
|
1295
1295
|
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1296
|
-
var l = "Loading…",
|
|
1297
|
-
return "✖ Error " +
|
|
1298
|
-
},
|
|
1296
|
+
var l = "Loading…", v = function(w, E) {
|
|
1297
|
+
return "✖ Error " + w + " while fetching file: " + E;
|
|
1298
|
+
}, _ = "✖ Error: File does not exist or is empty", S = {
|
|
1299
1299
|
js: "javascript",
|
|
1300
1300
|
py: "python",
|
|
1301
1301
|
rb: "ruby",
|
|
@@ -1305,52 +1305,52 @@ var he = { exports: {} };
|
|
|
1305
1305
|
bat: "batch",
|
|
1306
1306
|
h: "c",
|
|
1307
1307
|
tex: "latex"
|
|
1308
|
-
},
|
|
1309
|
-
function O(
|
|
1308
|
+
}, o = "data-src-status", f = "loading", b = "loaded", k = "failed", C = "pre[data-src]:not([" + o + '="' + b + '"]):not([' + o + '="' + f + '"])';
|
|
1309
|
+
function O(w, E, h) {
|
|
1310
1310
|
var e = new XMLHttpRequest();
|
|
1311
|
-
e.open("GET",
|
|
1312
|
-
e.readyState == 4 && (e.status < 400 && e.responseText ?
|
|
1311
|
+
e.open("GET", w, !0), e.onreadystatechange = function() {
|
|
1312
|
+
e.readyState == 4 && (e.status < 400 && e.responseText ? E(e.responseText) : e.status >= 400 ? h(v(e.status, e.statusText)) : h(_));
|
|
1313
1313
|
}, e.send(null);
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1316
|
-
var
|
|
1317
|
-
if (
|
|
1318
|
-
var h = Number(
|
|
1315
|
+
function L(w) {
|
|
1316
|
+
var E = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(w || "");
|
|
1317
|
+
if (E) {
|
|
1318
|
+
var h = Number(E[1]), e = E[2], t = E[3];
|
|
1319
1319
|
return e ? t ? [h, Number(t)] : [h, void 0] : [h, h];
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
|
-
n.hooks.add("before-highlightall", function(
|
|
1323
|
-
|
|
1324
|
-
}), n.hooks.add("before-sanity-check", function(
|
|
1325
|
-
var
|
|
1322
|
+
n.hooks.add("before-highlightall", function(w) {
|
|
1323
|
+
w.selector += ", " + C;
|
|
1324
|
+
}), n.hooks.add("before-sanity-check", function(w) {
|
|
1325
|
+
var E = (
|
|
1326
1326
|
/** @type {HTMLPreElement} */
|
|
1327
|
-
|
|
1327
|
+
w.element
|
|
1328
1328
|
);
|
|
1329
|
-
if (
|
|
1330
|
-
|
|
1331
|
-
var h =
|
|
1329
|
+
if (E.matches(C)) {
|
|
1330
|
+
w.code = "", E.setAttribute(o, f);
|
|
1331
|
+
var h = E.appendChild(document.createElement("CODE"));
|
|
1332
1332
|
h.textContent = l;
|
|
1333
|
-
var e =
|
|
1333
|
+
var e = E.getAttribute("data-src"), t = w.language;
|
|
1334
1334
|
if (t === "none") {
|
|
1335
|
-
var
|
|
1336
|
-
t =
|
|
1335
|
+
var r = (/\.(\w+)$/.exec(e) || [, "none"])[1];
|
|
1336
|
+
t = S[r] || r;
|
|
1337
1337
|
}
|
|
1338
|
-
n.util.setLanguage(h, t), n.util.setLanguage(
|
|
1339
|
-
var
|
|
1340
|
-
|
|
1338
|
+
n.util.setLanguage(h, t), n.util.setLanguage(E, t);
|
|
1339
|
+
var a = n.plugins.autoloader;
|
|
1340
|
+
a && a.loadLanguages(t), O(
|
|
1341
1341
|
e,
|
|
1342
|
-
function(
|
|
1343
|
-
|
|
1344
|
-
var
|
|
1345
|
-
if (
|
|
1346
|
-
var
|
|
1347
|
-
|
|
1348
|
-
`),
|
|
1342
|
+
function(s) {
|
|
1343
|
+
E.setAttribute(o, b);
|
|
1344
|
+
var u = L(E.getAttribute("data-range"));
|
|
1345
|
+
if (u) {
|
|
1346
|
+
var y = s.split(/\r\n?|\n/g), c = u[0], T = u[1] == null ? y.length : u[1];
|
|
1347
|
+
c < 0 && (c += y.length), c = Math.max(0, Math.min(c - 1, y.length)), T < 0 && (T += y.length), T = Math.max(0, Math.min(T, y.length)), s = y.slice(c, T).join(`
|
|
1348
|
+
`), E.hasAttribute("data-start") || E.setAttribute("data-start", String(c + 1));
|
|
1349
1349
|
}
|
|
1350
|
-
h.textContent =
|
|
1350
|
+
h.textContent = s, n.highlightElement(h);
|
|
1351
1351
|
},
|
|
1352
|
-
function(
|
|
1353
|
-
|
|
1352
|
+
function(s) {
|
|
1353
|
+
E.setAttribute(o, k), h.textContent = s;
|
|
1354
1354
|
}
|
|
1355
1355
|
);
|
|
1356
1356
|
}
|
|
@@ -1362,19 +1362,19 @@ var he = { exports: {} };
|
|
|
1362
1362
|
*
|
|
1363
1363
|
* @param {ParentNode} [container=document]
|
|
1364
1364
|
*/
|
|
1365
|
-
highlight: function(
|
|
1366
|
-
for (var h = (
|
|
1365
|
+
highlight: function(E) {
|
|
1366
|
+
for (var h = (E || document).querySelectorAll(C), e = 0, t; t = h[e++]; )
|
|
1367
1367
|
n.highlightElement(t);
|
|
1368
1368
|
}
|
|
1369
1369
|
};
|
|
1370
|
-
var
|
|
1370
|
+
var $ = !1;
|
|
1371
1371
|
n.fileHighlight = function() {
|
|
1372
|
-
|
|
1372
|
+
$ || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), $ = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1373
1373
|
};
|
|
1374
1374
|
}();
|
|
1375
|
-
})(
|
|
1376
|
-
var
|
|
1377
|
-
const se = /* @__PURE__ */
|
|
1375
|
+
})(fe);
|
|
1376
|
+
var Me = fe.exports;
|
|
1377
|
+
const se = /* @__PURE__ */ $e(Me);
|
|
1378
1378
|
Prism.languages.clike = {
|
|
1379
1379
|
comment: [
|
|
1380
1380
|
{
|
|
@@ -1633,7 +1633,7 @@ Prism.languages.insertBefore("go", "string", {
|
|
|
1633
1633
|
});
|
|
1634
1634
|
delete Prism.languages.go["class-name"];
|
|
1635
1635
|
(function(i) {
|
|
1636
|
-
var
|
|
1636
|
+
var p = /\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/, n = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = {
|
|
1637
1637
|
pattern: RegExp(/(^|[^\w.])/.source + n + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
|
|
1638
1638
|
lookbehind: !0,
|
|
1639
1639
|
inside: {
|
|
@@ -1669,7 +1669,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1669
1669
|
inside: l.inside
|
|
1670
1670
|
}
|
|
1671
1671
|
],
|
|
1672
|
-
keyword:
|
|
1672
|
+
keyword: p,
|
|
1673
1673
|
function: [
|
|
1674
1674
|
i.languages.clike.function,
|
|
1675
1675
|
{
|
|
@@ -1704,7 +1704,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1704
1704
|
pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
|
|
1705
1705
|
inside: {
|
|
1706
1706
|
"class-name": l,
|
|
1707
|
-
keyword:
|
|
1707
|
+
keyword: p,
|
|
1708
1708
|
punctuation: /[<>(),.:]/,
|
|
1709
1709
|
operator: /[?&|]/
|
|
1710
1710
|
}
|
|
@@ -1736,7 +1736,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1736
1736
|
namespace: {
|
|
1737
1737
|
pattern: RegExp(
|
|
1738
1738
|
/(\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() {
|
|
1739
|
-
return
|
|
1739
|
+
return p.source;
|
|
1740
1740
|
})
|
|
1741
1741
|
),
|
|
1742
1742
|
lookbehind: !0,
|
|
@@ -1823,16 +1823,16 @@ Prism.languages.insertBefore("c", "function", {
|
|
|
1823
1823
|
});
|
|
1824
1824
|
delete Prism.languages.c.boolean;
|
|
1825
1825
|
(function(i) {
|
|
1826
|
-
for (var
|
|
1827
|
-
|
|
1828
|
-
return
|
|
1826
|
+
for (var p = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, n = 0; n < 2; n++)
|
|
1827
|
+
p = p.replace(/<self>/g, function() {
|
|
1828
|
+
return p;
|
|
1829
1829
|
});
|
|
1830
|
-
|
|
1830
|
+
p = p.replace(/<self>/g, function() {
|
|
1831
1831
|
return /[^\s\S]/.source;
|
|
1832
1832
|
}), i.languages.rust = {
|
|
1833
1833
|
comment: [
|
|
1834
1834
|
{
|
|
1835
|
-
pattern: RegExp(/(^|[^\\])/.source +
|
|
1835
|
+
pattern: RegExp(/(^|[^\\])/.source + p),
|
|
1836
1836
|
lookbehind: !0,
|
|
1837
1837
|
greedy: !0
|
|
1838
1838
|
},
|
|
@@ -1972,7 +1972,7 @@ Prism.languages.sql = {
|
|
|
1972
1972
|
punctuation: /[;[\]()`,.]/
|
|
1973
1973
|
};
|
|
1974
1974
|
(function(i) {
|
|
1975
|
-
var
|
|
1975
|
+
var p = "\\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", n = {
|
|
1976
1976
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
1977
1977
|
lookbehind: !0,
|
|
1978
1978
|
alias: "punctuation",
|
|
@@ -1982,7 +1982,7 @@ Prism.languages.sql = {
|
|
|
1982
1982
|
}, l = {
|
|
1983
1983
|
bash: n,
|
|
1984
1984
|
environment: {
|
|
1985
|
-
pattern: RegExp("\\$" +
|
|
1985
|
+
pattern: RegExp("\\$" + p),
|
|
1986
1986
|
alias: "constant"
|
|
1987
1987
|
},
|
|
1988
1988
|
variable: [
|
|
@@ -2022,7 +2022,7 @@ Prism.languages.sql = {
|
|
|
2022
2022
|
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
2023
2023
|
punctuation: /[\[\]]/,
|
|
2024
2024
|
environment: {
|
|
2025
|
-
pattern: RegExp("(\\{)" +
|
|
2025
|
+
pattern: RegExp("(\\{)" + p),
|
|
2026
2026
|
lookbehind: !0,
|
|
2027
2027
|
alias: "constant"
|
|
2028
2028
|
}
|
|
@@ -2071,7 +2071,7 @@ Prism.languages.sql = {
|
|
|
2071
2071
|
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
2072
2072
|
inside: {
|
|
2073
2073
|
environment: {
|
|
2074
|
-
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" +
|
|
2074
|
+
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + p),
|
|
2075
2075
|
lookbehind: !0,
|
|
2076
2076
|
alias: "constant"
|
|
2077
2077
|
}
|
|
@@ -2127,7 +2127,7 @@ Prism.languages.sql = {
|
|
|
2127
2127
|
}
|
|
2128
2128
|
],
|
|
2129
2129
|
environment: {
|
|
2130
|
-
pattern: RegExp("\\$?" +
|
|
2130
|
+
pattern: RegExp("\\$?" + p),
|
|
2131
2131
|
alias: "constant"
|
|
2132
2132
|
},
|
|
2133
2133
|
variable: l.variable,
|
|
@@ -2170,7 +2170,7 @@ Prism.languages.sql = {
|
|
|
2170
2170
|
lookbehind: !0
|
|
2171
2171
|
}
|
|
2172
2172
|
}, n.inside = i.languages.bash;
|
|
2173
|
-
for (var
|
|
2173
|
+
for (var v = [
|
|
2174
2174
|
"comment",
|
|
2175
2175
|
"function-name",
|
|
2176
2176
|
"for-or-select",
|
|
@@ -2186,8 +2186,8 @@ Prism.languages.sql = {
|
|
|
2186
2186
|
"operator",
|
|
2187
2187
|
"punctuation",
|
|
2188
2188
|
"number"
|
|
2189
|
-
],
|
|
2190
|
-
|
|
2189
|
+
], _ = l.variable[1].inside, S = 0; S < v.length; S++)
|
|
2190
|
+
_[v[S]] = i.languages.bash[v[S]];
|
|
2191
2191
|
i.languages.sh = i.languages.bash, i.languages.shell = i.languages.bash;
|
|
2192
2192
|
})(Prism);
|
|
2193
2193
|
Prism.languages.json = {
|
|
@@ -2215,7 +2215,7 @@ Prism.languages.json = {
|
|
|
2215
2215
|
}
|
|
2216
2216
|
};
|
|
2217
2217
|
Prism.languages.webmanifest = Prism.languages.json;
|
|
2218
|
-
const
|
|
2218
|
+
const Ue = `
|
|
2219
2219
|
/* 默认代码颜色 */
|
|
2220
2220
|
.hep-cr-editor .hep-cr-highlight code,
|
|
2221
2221
|
.hep-cr-editor .hep-cr-highlight pre {
|
|
@@ -2301,7 +2301,7 @@ const Me = `
|
|
|
2301
2301
|
.hep-cr-editor .token.console {
|
|
2302
2302
|
color: #f8f8f2 !important;
|
|
2303
2303
|
}
|
|
2304
|
-
`,
|
|
2304
|
+
`, Be = `
|
|
2305
2305
|
/* 默认代码颜色 */
|
|
2306
2306
|
.hep-cr-editor .hep-cr-highlight code,
|
|
2307
2307
|
.hep-cr-editor .hep-cr-highlight pre {
|
|
@@ -2378,7 +2378,7 @@ const Me = `
|
|
|
2378
2378
|
.hep-cr-editor .token.console {
|
|
2379
2379
|
color: #333 !important;
|
|
2380
2380
|
}
|
|
2381
|
-
`,
|
|
2381
|
+
`, He = ["innerHTML"], Ge = ["value", "disabled"], ze = 500, je = /* @__PURE__ */ le({
|
|
2382
2382
|
__name: "CodeEditor",
|
|
2383
2383
|
props: {
|
|
2384
2384
|
modelValue: {},
|
|
@@ -2387,25 +2387,25 @@ const Me = `
|
|
|
2387
2387
|
disabled: { type: Boolean, default: !1 }
|
|
2388
2388
|
},
|
|
2389
2389
|
emits: ["update:modelValue", "change"],
|
|
2390
|
-
setup(i, { emit:
|
|
2391
|
-
|
|
2392
|
-
v2b19bab6:
|
|
2390
|
+
setup(i, { emit: p }) {
|
|
2391
|
+
ve((h) => ({
|
|
2392
|
+
v2b19bab6: C.value
|
|
2393
2393
|
})), typeof window < "u" && (window.Prism = se);
|
|
2394
2394
|
function n(h) {
|
|
2395
2395
|
if (typeof document > "u") return;
|
|
2396
|
-
const e = "hep-cr-prism-styles", t = document.getElementById(e),
|
|
2396
|
+
const e = "hep-cr-prism-styles", t = document.getElementById(e), r = h === "dark" ? Ue : Be;
|
|
2397
2397
|
t && t.remove();
|
|
2398
|
-
const
|
|
2399
|
-
|
|
2398
|
+
const a = document.createElement("style");
|
|
2399
|
+
a.id = e, a.textContent = r, document.head.appendChild(a);
|
|
2400
2400
|
}
|
|
2401
|
-
const l = i,
|
|
2402
|
-
let
|
|
2403
|
-
function
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
},
|
|
2401
|
+
const l = i, v = p, _ = N(null), S = N(null);
|
|
2402
|
+
let o = null;
|
|
2403
|
+
function f(h) {
|
|
2404
|
+
o && clearTimeout(o), o = setTimeout(() => {
|
|
2405
|
+
v("change", h);
|
|
2406
|
+
}, ze);
|
|
2407
2407
|
}
|
|
2408
|
-
const
|
|
2408
|
+
const b = {
|
|
2409
2409
|
javascript: "javascript",
|
|
2410
2410
|
js: "javascript",
|
|
2411
2411
|
typescript: "typescript",
|
|
@@ -2436,79 +2436,79 @@ const Me = `
|
|
|
2436
2436
|
yml: "yaml",
|
|
2437
2437
|
markdown: "markdown",
|
|
2438
2438
|
md: "markdown"
|
|
2439
|
-
},
|
|
2439
|
+
}, k = H(() => b[l.language.toLowerCase()] || "javascript"), C = H(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), O = H(() => {
|
|
2440
2440
|
try {
|
|
2441
|
-
const h = se.languages[
|
|
2441
|
+
const h = se.languages[k.value];
|
|
2442
2442
|
if (h)
|
|
2443
|
-
return se.highlight(l.modelValue || "", h,
|
|
2443
|
+
return se.highlight(l.modelValue || "", h, k.value);
|
|
2444
2444
|
} catch {
|
|
2445
2445
|
}
|
|
2446
|
-
return
|
|
2446
|
+
return L(l.modelValue || "");
|
|
2447
2447
|
});
|
|
2448
|
-
function
|
|
2448
|
+
function L(h) {
|
|
2449
2449
|
const e = document.createElement("div");
|
|
2450
2450
|
return e.textContent = h, e.innerHTML;
|
|
2451
2451
|
}
|
|
2452
|
-
function
|
|
2452
|
+
function $(h) {
|
|
2453
2453
|
const e = h.target;
|
|
2454
|
-
|
|
2454
|
+
v("update:modelValue", e.value), f(e.value);
|
|
2455
2455
|
}
|
|
2456
|
-
function
|
|
2457
|
-
|
|
2456
|
+
function w() {
|
|
2457
|
+
_.value && S.value && (S.value.scrollTop = _.value.scrollTop, S.value.scrollLeft = _.value.scrollLeft);
|
|
2458
2458
|
}
|
|
2459
|
-
function
|
|
2459
|
+
function E(h) {
|
|
2460
2460
|
if (h.key === "Tab") {
|
|
2461
2461
|
h.preventDefault();
|
|
2462
|
-
const e = h.target, t = e.selectionStart,
|
|
2463
|
-
e.value =
|
|
2462
|
+
const e = h.target, t = e.selectionStart, r = e.selectionEnd, a = e.value;
|
|
2463
|
+
e.value = a.substring(0, t) + " " + a.substring(r), e.selectionStart = e.selectionEnd = t + 2, v("update:modelValue", e.value), f(e.value);
|
|
2464
2464
|
}
|
|
2465
2465
|
}
|
|
2466
|
-
return
|
|
2466
|
+
return he(() => {
|
|
2467
2467
|
n(l.theme);
|
|
2468
2468
|
}), ue(() => l.theme, (h) => {
|
|
2469
2469
|
n(h);
|
|
2470
|
-
}),
|
|
2471
|
-
|
|
2472
|
-
}), (h, e) => (
|
|
2473
|
-
class:
|
|
2470
|
+
}), Ee(() => {
|
|
2471
|
+
o && clearTimeout(o);
|
|
2472
|
+
}), (h, e) => (x(), I("div", {
|
|
2473
|
+
class: j(["hep-cr-editor", `hep-cr-theme-${i.theme}`])
|
|
2474
2474
|
}, [
|
|
2475
|
-
|
|
2475
|
+
A("pre", {
|
|
2476
2476
|
ref_key: "highlightRef",
|
|
2477
|
-
ref:
|
|
2478
|
-
class:
|
|
2477
|
+
ref: S,
|
|
2478
|
+
class: j(["hep-cr-highlight", [`language-${k.value}`, `hep-cr-prism-${i.theme}`]]),
|
|
2479
2479
|
"aria-hidden": "true"
|
|
2480
2480
|
}, [
|
|
2481
|
-
|
|
2481
|
+
A("code", { innerHTML: O.value }, null, 8, He)
|
|
2482
2482
|
], 2),
|
|
2483
|
-
|
|
2483
|
+
A("textarea", {
|
|
2484
2484
|
ref_key: "codeRef",
|
|
2485
|
-
ref:
|
|
2485
|
+
ref: _,
|
|
2486
2486
|
class: "hep-cr-input",
|
|
2487
2487
|
value: i.modelValue,
|
|
2488
2488
|
disabled: i.disabled,
|
|
2489
|
-
onInput:
|
|
2490
|
-
onScroll:
|
|
2491
|
-
onKeydown:
|
|
2489
|
+
onInput: $,
|
|
2490
|
+
onScroll: w,
|
|
2491
|
+
onKeydown: E,
|
|
2492
2492
|
spellcheck: "false",
|
|
2493
2493
|
placeholder: "Write your code here..."
|
|
2494
|
-
}, null, 40,
|
|
2494
|
+
}, null, 40, Ge)
|
|
2495
2495
|
], 2));
|
|
2496
2496
|
}
|
|
2497
|
-
}), me = (i,
|
|
2497
|
+
}), me = (i, p) => {
|
|
2498
2498
|
const n = i.__vccOpts || i;
|
|
2499
|
-
for (const [l,
|
|
2500
|
-
n[l] =
|
|
2499
|
+
for (const [l, v] of p)
|
|
2500
|
+
n[l] = v;
|
|
2501
2501
|
return n;
|
|
2502
|
-
},
|
|
2502
|
+
}, We = /* @__PURE__ */ me(je, [["__scopeId", "data-v-a988ca2a"]]), Ve = { class: "hep-cr-header" }, Ye = { class: "hep-cr-controls" }, Xe = ["disabled"], Ze = {
|
|
2503
2503
|
key: 0,
|
|
2504
2504
|
value: ""
|
|
2505
|
-
},
|
|
2505
|
+
}, Ke = ["value"], qe = { class: "hep-cr-actions" }, Je = ["disabled"], Qe = {
|
|
2506
2506
|
key: 0,
|
|
2507
2507
|
class: "hep-cr-spinner"
|
|
2508
|
-
},
|
|
2508
|
+
}, et = {
|
|
2509
2509
|
key: 1,
|
|
2510
2510
|
class: "hep-cr-run-icon"
|
|
2511
|
-
},
|
|
2511
|
+
}, tt = ["title"], nt = {
|
|
2512
2512
|
key: 0,
|
|
2513
2513
|
width: "16",
|
|
2514
2514
|
height: "16",
|
|
@@ -2516,7 +2516,7 @@ const Me = `
|
|
|
2516
2516
|
fill: "none",
|
|
2517
2517
|
stroke: "currentColor",
|
|
2518
2518
|
"stroke-width": "2"
|
|
2519
|
-
},
|
|
2519
|
+
}, at = {
|
|
2520
2520
|
key: 1,
|
|
2521
2521
|
width: "16",
|
|
2522
2522
|
height: "16",
|
|
@@ -2524,10 +2524,10 @@ const Me = `
|
|
|
2524
2524
|
fill: "none",
|
|
2525
2525
|
stroke: "currentColor",
|
|
2526
2526
|
"stroke-width": "2"
|
|
2527
|
-
},
|
|
2527
|
+
}, rt = {
|
|
2528
2528
|
key: 0,
|
|
2529
2529
|
class: "hep-cr-error"
|
|
2530
|
-
},
|
|
2530
|
+
}, ot = { class: "hep-cr-main" }, st = { class: "hep-cr-panel-header" }, it = { class: "hep-cr-output-actions" }, lt = { class: "hep-cr-language-badge" }, ut = ["disabled", "title"], ct = {
|
|
2531
2531
|
key: 0,
|
|
2532
2532
|
width: "14",
|
|
2533
2533
|
height: "14",
|
|
@@ -2535,13 +2535,13 @@ const Me = `
|
|
|
2535
2535
|
fill: "none",
|
|
2536
2536
|
stroke: "currentColor",
|
|
2537
2537
|
"stroke-width": "2"
|
|
2538
|
-
},
|
|
2538
|
+
}, dt = {
|
|
2539
2539
|
key: 1,
|
|
2540
2540
|
class: "hep-cr-copied-text"
|
|
2541
|
-
},
|
|
2541
|
+
}, pt = { class: "hep-cr-panel-header" }, gt = { class: "hep-cr-output-tabs" }, ht = { class: "hep-cr-output-actions" }, ft = {
|
|
2542
2542
|
key: 0,
|
|
2543
2543
|
class: "hep-cr-execution-time"
|
|
2544
|
-
}, mt = ["disabled", "title"],
|
|
2544
|
+
}, mt = ["disabled", "title"], bt = {
|
|
2545
2545
|
key: 0,
|
|
2546
2546
|
width: "14",
|
|
2547
2547
|
height: "14",
|
|
@@ -2549,13 +2549,13 @@ const Me = `
|
|
|
2549
2549
|
fill: "none",
|
|
2550
2550
|
stroke: "currentColor",
|
|
2551
2551
|
"stroke-width": "2"
|
|
2552
|
-
},
|
|
2552
|
+
}, vt = {
|
|
2553
2553
|
key: 1,
|
|
2554
2554
|
class: "hep-cr-copied-text"
|
|
2555
|
-
},
|
|
2555
|
+
}, Et = { class: "hep-cr-output-content" }, yt = { key: 0 }, At = {
|
|
2556
2556
|
key: 1,
|
|
2557
2557
|
class: "hep-cr-stderr"
|
|
2558
|
-
},
|
|
2558
|
+
}, ge = "hep-cr-default-language", St = /* @__PURE__ */ le({
|
|
2559
2559
|
__name: "CodeRunner",
|
|
2560
2560
|
props: {
|
|
2561
2561
|
pistonUrl: { default: "/api/piston" },
|
|
@@ -2569,173 +2569,176 @@ const Me = `
|
|
|
2569
2569
|
executorLabel: { default: "运行" }
|
|
2570
2570
|
},
|
|
2571
2571
|
emits: ["execute-start", "execute-end", "language-change", "change"],
|
|
2572
|
-
setup(i, { emit:
|
|
2573
|
-
const n = i, l =
|
|
2572
|
+
setup(i, { emit: p }) {
|
|
2573
|
+
const n = i, l = H(() => {
|
|
2574
2574
|
if (!n.themeColor) return {};
|
|
2575
|
-
const d = n.theme === "dark",
|
|
2575
|
+
const d = n.theme === "dark", g = n.themeColor, M = v(g) ? "#000" : "#fff";
|
|
2576
2576
|
return {
|
|
2577
|
-
"--hep-cr-theme-color":
|
|
2578
|
-
"--hep-cr-theme-color-hover": d ?
|
|
2579
|
-
"--hep-cr-tab-active-color":
|
|
2577
|
+
"--hep-cr-theme-color": g,
|
|
2578
|
+
"--hep-cr-theme-color-hover": d ? _(g, 20) : _(g, -20),
|
|
2579
|
+
"--hep-cr-tab-active-color": M
|
|
2580
2580
|
};
|
|
2581
2581
|
});
|
|
2582
|
-
function
|
|
2583
|
-
const
|
|
2584
|
-
return (0.299 *
|
|
2582
|
+
function v(d) {
|
|
2583
|
+
const g = parseInt(d.replace("#", ""), 16), m = g >> 16 & 255, M = g >> 8 & 255, P = g & 255;
|
|
2584
|
+
return (0.299 * m + 0.587 * M + 0.114 * P) / 255 > 0.5;
|
|
2585
2585
|
}
|
|
2586
|
-
function
|
|
2587
|
-
const
|
|
2588
|
-
return "#" + (16777216 +
|
|
2586
|
+
function _(d, g) {
|
|
2587
|
+
const m = parseInt(d.replace("#", ""), 16), M = Math.round(2.55 * g), P = Math.min(255, Math.max(0, (m >> 16) + M)), G = Math.min(255, Math.max(0, (m >> 8 & 255) + M)), W = Math.min(255, Math.max(0, (m & 255) + M));
|
|
2588
|
+
return "#" + (16777216 + P * 65536 + G * 256 + W).toString(16).slice(1);
|
|
2589
2589
|
}
|
|
2590
|
-
const
|
|
2590
|
+
const S = p, o = N([]), f = N(t()), b = N(n.theme), k = N(""), C = N(""), O = N(""), L = N(!1), $ = N(null), w = N("stdout"), E = N(null), h = N(!1), e = N(60);
|
|
2591
2591
|
function t() {
|
|
2592
|
-
|
|
2592
|
+
return typeof window > "u" ? n.language : localStorage.getItem(ge) || n.language;
|
|
2593
|
+
}
|
|
2594
|
+
function r() {
|
|
2595
|
+
b.value = b.value === "light" ? "dark" : "light";
|
|
2593
2596
|
}
|
|
2594
|
-
const a =
|
|
2595
|
-
() => new
|
|
2596
|
-
),
|
|
2597
|
+
const a = H(
|
|
2598
|
+
() => new De({ pistonUrl: n.pistonUrl })
|
|
2599
|
+
), s = H(() => o.value.map((d) => ({
|
|
2597
2600
|
value: `${d.language}:${d.version}`,
|
|
2598
2601
|
label: `${d.language.charAt(0).toUpperCase() + d.language.slice(1)} ${d.version}`
|
|
2599
|
-
}))),
|
|
2600
|
-
const d =
|
|
2602
|
+
}))), u = H(() => {
|
|
2603
|
+
const d = f.value;
|
|
2601
2604
|
return d.includes(":") ? d.split(":")[0] : d;
|
|
2602
2605
|
});
|
|
2603
|
-
async function
|
|
2604
|
-
h.value = !0,
|
|
2606
|
+
async function y() {
|
|
2607
|
+
h.value = !0, E.value = null;
|
|
2605
2608
|
try {
|
|
2606
|
-
|
|
2607
|
-
const d =
|
|
2608
|
-
|
|
2609
|
+
o.value = await a.value.getRuntimes();
|
|
2610
|
+
const d = f.value.split(":")[0], g = o.value.find((m) => m.language === d);
|
|
2611
|
+
g && !f.value.includes(":") && (f.value = `${d}:${g.version}`), k.value || (k.value = n.defaultCode || J(d), S("change", k.value)), S("language-change", d, k.value);
|
|
2609
2612
|
} catch (d) {
|
|
2610
|
-
|
|
2613
|
+
E.value = d instanceof Error ? d.message : "Failed to load runtimes";
|
|
2611
2614
|
} finally {
|
|
2612
2615
|
h.value = !1;
|
|
2613
2616
|
}
|
|
2614
2617
|
}
|
|
2615
|
-
ue(
|
|
2616
|
-
const
|
|
2617
|
-
|
|
2618
|
+
ue(f, (d) => {
|
|
2619
|
+
const g = d.includes(":") ? d.split(":")[0] : d, m = J(g);
|
|
2620
|
+
k.value = m, S("language-change", g, m), typeof window < "u" && localStorage.setItem(ge, d);
|
|
2618
2621
|
});
|
|
2619
|
-
async function
|
|
2620
|
-
if (!
|
|
2621
|
-
|
|
2622
|
+
async function c() {
|
|
2623
|
+
if (!L.value) {
|
|
2624
|
+
L.value = !0, C.value = "", O.value = "", $.value = null, E.value = null, w.value = "stdout", S("execute-start");
|
|
2622
2625
|
try {
|
|
2623
|
-
const d = await a.value.execute(
|
|
2624
|
-
|
|
2626
|
+
const d = await a.value.execute(u.value, k.value);
|
|
2627
|
+
C.value = d.output, O.value = d.stderr, $.value = d.executionTime || null, w.value = d.stderr ? "stderr" : "stdout", S("execute-end", d);
|
|
2625
2628
|
} catch (d) {
|
|
2626
|
-
|
|
2629
|
+
E.value = d instanceof Error ? d.message : "Execution failed", S("execute-end", {
|
|
2627
2630
|
success: !1,
|
|
2628
2631
|
output: "",
|
|
2629
|
-
stderr:
|
|
2632
|
+
stderr: E.value,
|
|
2630
2633
|
code: -1
|
|
2631
2634
|
});
|
|
2632
2635
|
} finally {
|
|
2633
|
-
|
|
2636
|
+
L.value = !1;
|
|
2634
2637
|
}
|
|
2635
2638
|
}
|
|
2636
2639
|
}
|
|
2637
|
-
const
|
|
2638
|
-
async function
|
|
2639
|
-
await navigator.clipboard.writeText(
|
|
2640
|
-
|
|
2640
|
+
const T = N(!1), F = N(!1);
|
|
2641
|
+
async function U() {
|
|
2642
|
+
await navigator.clipboard.writeText(k.value), T.value = !0, setTimeout(() => {
|
|
2643
|
+
T.value = !1;
|
|
2641
2644
|
}, 2e3);
|
|
2642
2645
|
}
|
|
2643
|
-
async function
|
|
2644
|
-
const d =
|
|
2645
|
-
await navigator.clipboard.writeText(d),
|
|
2646
|
-
|
|
2646
|
+
async function X() {
|
|
2647
|
+
const d = w.value === "stdout" ? C.value : O.value;
|
|
2648
|
+
await navigator.clipboard.writeText(d), F.value = !0, setTimeout(() => {
|
|
2649
|
+
F.value = !1;
|
|
2647
2650
|
}, 2e3);
|
|
2648
2651
|
}
|
|
2649
|
-
function
|
|
2650
|
-
|
|
2652
|
+
function Z() {
|
|
2653
|
+
k.value = J(u.value);
|
|
2651
2654
|
}
|
|
2652
|
-
let
|
|
2653
|
-
function
|
|
2654
|
-
|
|
2655
|
+
let V = !1;
|
|
2656
|
+
function te(d) {
|
|
2657
|
+
V = !0, document.addEventListener("mousemove", Y), document.addEventListener("mouseup", R), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
2655
2658
|
}
|
|
2656
|
-
function
|
|
2657
|
-
if (!
|
|
2658
|
-
const
|
|
2659
|
+
function Y(d) {
|
|
2660
|
+
if (!V) return;
|
|
2661
|
+
const g = document.querySelector(
|
|
2659
2662
|
".hep-cr-main"
|
|
2660
2663
|
);
|
|
2661
|
-
if (!
|
|
2662
|
-
const
|
|
2663
|
-
e.value = Math.max(20, Math.min(80,
|
|
2664
|
+
if (!g) return;
|
|
2665
|
+
const m = g.getBoundingClientRect(), M = (d.clientX - m.left) / m.width * 100;
|
|
2666
|
+
e.value = Math.max(20, Math.min(80, M));
|
|
2664
2667
|
}
|
|
2665
|
-
function
|
|
2666
|
-
|
|
2668
|
+
function R() {
|
|
2669
|
+
V = !1, document.removeEventListener("mousemove", Y), document.removeEventListener("mouseup", R), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
2667
2670
|
}
|
|
2668
|
-
|
|
2669
|
-
await
|
|
2671
|
+
he(async () => {
|
|
2672
|
+
await y(), k.value || (k.value = n.defaultCode || J(f.value), S("change", k.value));
|
|
2670
2673
|
});
|
|
2671
|
-
const
|
|
2672
|
-
return (d,
|
|
2673
|
-
class:
|
|
2674
|
-
style:
|
|
2674
|
+
const D = H(() => `hep-cr-runner-${b.value}`);
|
|
2675
|
+
return (d, g) => (x(), I("div", {
|
|
2676
|
+
class: j(["hep-cr-runner", D.value]),
|
|
2677
|
+
style: Q(l.value)
|
|
2675
2678
|
}, [
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
i.showLanguageSelector ?
|
|
2679
|
+
A("div", Ve, [
|
|
2680
|
+
A("div", Ye, [
|
|
2681
|
+
i.showLanguageSelector ? ye((x(), I("select", {
|
|
2679
2682
|
key: 0,
|
|
2680
|
-
"onUpdate:modelValue":
|
|
2683
|
+
"onUpdate:modelValue": g[0] || (g[0] = (m) => f.value = m),
|
|
2681
2684
|
class: "hep-cr-language-select",
|
|
2682
|
-
disabled:
|
|
2685
|
+
disabled: L.value
|
|
2683
2686
|
}, [
|
|
2684
|
-
h.value ? (
|
|
2685
|
-
(
|
|
2686
|
-
key:
|
|
2687
|
-
value:
|
|
2688
|
-
},
|
|
2689
|
-
], 8,
|
|
2690
|
-
[ke,
|
|
2691
|
-
]) :
|
|
2687
|
+
h.value ? (x(), I("option", Ze, "加载中...")) : B("", !0),
|
|
2688
|
+
(x(!0), I(Ae, null, Se(s.value, (m) => (x(), I("option", {
|
|
2689
|
+
key: m.value,
|
|
2690
|
+
value: m.value
|
|
2691
|
+
}, z(m.label), 9, Ke))), 128))
|
|
2692
|
+
], 8, Xe)), [
|
|
2693
|
+
[ke, f.value]
|
|
2694
|
+
]) : B("", !0)
|
|
2692
2695
|
]),
|
|
2693
|
-
|
|
2694
|
-
|
|
2696
|
+
A("div", qe, [
|
|
2697
|
+
A("button", {
|
|
2695
2698
|
class: "hep-cr-btn hep-cr-btn-run",
|
|
2696
|
-
disabled:
|
|
2697
|
-
onClick:
|
|
2699
|
+
disabled: L.value || h.value,
|
|
2700
|
+
onClick: c
|
|
2698
2701
|
}, [
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
], 8,
|
|
2702
|
-
i.showEditor && i.editable ? (
|
|
2702
|
+
L.value ? (x(), I("span", Qe)) : (x(), I("span", et, "▶")),
|
|
2703
|
+
we(" " + z(L.value ? "运行中..." : i.executorLabel), 1)
|
|
2704
|
+
], 8, Je),
|
|
2705
|
+
i.showEditor && i.editable ? (x(), I("button", {
|
|
2703
2706
|
key: 0,
|
|
2704
2707
|
class: "hep-cr-btn hep-cr-btn-reset",
|
|
2705
|
-
onClick:
|
|
2706
|
-
}, " 重置 ")) :
|
|
2707
|
-
|
|
2708
|
+
onClick: Z
|
|
2709
|
+
}, " 重置 ")) : B("", !0),
|
|
2710
|
+
A("button", {
|
|
2708
2711
|
class: "hep-cr-btn hep-cr-btn-theme",
|
|
2709
|
-
onClick:
|
|
2710
|
-
title:
|
|
2712
|
+
onClick: r,
|
|
2713
|
+
title: b.value === "light" ? "Switch to dark mode" : "Switch to light mode"
|
|
2711
2714
|
}, [
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
])])) : (
|
|
2715
|
-
|
|
2715
|
+
b.value === "light" ? (x(), I("svg", nt, [...g[5] || (g[5] = [
|
|
2716
|
+
A("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)
|
|
2717
|
+
])])) : (x(), I("svg", at, [...g[6] || (g[6] = [
|
|
2718
|
+
Te('<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)
|
|
2716
2719
|
])]))
|
|
2717
|
-
], 8,
|
|
2720
|
+
], 8, tt)
|
|
2718
2721
|
])
|
|
2719
2722
|
]),
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
i.showEditor ? (
|
|
2723
|
+
E.value ? (x(), I("div", rt, z(E.value), 1)) : B("", !0),
|
|
2724
|
+
A("div", ot, [
|
|
2725
|
+
i.showEditor ? (x(), I("div", {
|
|
2723
2726
|
key: 0,
|
|
2724
2727
|
class: "hep-cr-editor-panel",
|
|
2725
|
-
style:
|
|
2728
|
+
style: Q({ width: e.value + "%" })
|
|
2726
2729
|
}, [
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
class:
|
|
2733
|
-
disabled:
|
|
2734
|
-
onClick:
|
|
2735
|
-
title:
|
|
2730
|
+
A("div", st, [
|
|
2731
|
+
g[8] || (g[8] = A("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
|
|
2732
|
+
A("div", it, [
|
|
2733
|
+
A("span", lt, z(u.value), 1),
|
|
2734
|
+
A("button", {
|
|
2735
|
+
class: j(["hep-cr-btn-icon", { "hep-cr-btn-copied": T.value }]),
|
|
2736
|
+
disabled: T.value,
|
|
2737
|
+
onClick: U,
|
|
2738
|
+
title: T.value ? "已复制" : "复制"
|
|
2736
2739
|
}, [
|
|
2737
|
-
|
|
2738
|
-
|
|
2740
|
+
T.value ? (x(), I("span", dt, "已复制")) : (x(), I("svg", ct, [...g[7] || (g[7] = [
|
|
2741
|
+
A("rect", {
|
|
2739
2742
|
x: "9",
|
|
2740
2743
|
y: "9",
|
|
2741
2744
|
width: "13",
|
|
@@ -2743,53 +2746,53 @@ const Me = `
|
|
|
2743
2746
|
rx: "2",
|
|
2744
2747
|
ry: "2"
|
|
2745
2748
|
}, null, -1),
|
|
2746
|
-
|
|
2749
|
+
A("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
2747
2750
|
])]))
|
|
2748
|
-
], 10,
|
|
2751
|
+
], 10, ut)
|
|
2749
2752
|
])
|
|
2750
2753
|
]),
|
|
2751
|
-
ie(
|
|
2752
|
-
modelValue:
|
|
2753
|
-
"onUpdate:modelValue":
|
|
2754
|
-
language:
|
|
2755
|
-
theme:
|
|
2756
|
-
disabled: !i.editable ||
|
|
2757
|
-
onChange:
|
|
2754
|
+
ie(We, {
|
|
2755
|
+
modelValue: k.value,
|
|
2756
|
+
"onUpdate:modelValue": g[1] || (g[1] = (m) => k.value = m),
|
|
2757
|
+
language: u.value,
|
|
2758
|
+
theme: b.value,
|
|
2759
|
+
disabled: !i.editable || L.value,
|
|
2760
|
+
onChange: g[2] || (g[2] = (m) => S("change", m))
|
|
2758
2761
|
}, null, 8, ["modelValue", "language", "theme", "disabled"])
|
|
2759
|
-
], 4)) :
|
|
2760
|
-
i.showEditor ? (
|
|
2762
|
+
], 4)) : B("", !0),
|
|
2763
|
+
i.showEditor ? (x(), I("div", {
|
|
2761
2764
|
key: 1,
|
|
2762
2765
|
class: "hep-cr-resize-handle",
|
|
2763
|
-
onMousedown:
|
|
2764
|
-
}, [...
|
|
2765
|
-
|
|
2766
|
-
])], 32)) :
|
|
2767
|
-
|
|
2766
|
+
onMousedown: te
|
|
2767
|
+
}, [...g[9] || (g[9] = [
|
|
2768
|
+
A("div", { class: "hep-cr-resize-line" }, null, -1)
|
|
2769
|
+
])], 32)) : B("", !0),
|
|
2770
|
+
A("div", {
|
|
2768
2771
|
class: "hep-cr-output-panel",
|
|
2769
|
-
style:
|
|
2772
|
+
style: Q({ width: i.showEditor ? 100 - e.value + "%" : "100%" })
|
|
2770
2773
|
}, [
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
class:
|
|
2775
|
-
onClick:
|
|
2774
|
+
A("div", pt, [
|
|
2775
|
+
A("div", gt, [
|
|
2776
|
+
A("button", {
|
|
2777
|
+
class: j(["hep-cr-tab", { active: w.value === "stdout" }]),
|
|
2778
|
+
onClick: g[3] || (g[3] = (m) => w.value = "stdout")
|
|
2776
2779
|
}, " 输出 ", 2),
|
|
2777
|
-
O.value ? (
|
|
2780
|
+
O.value ? (x(), I("button", {
|
|
2778
2781
|
key: 0,
|
|
2779
|
-
class:
|
|
2780
|
-
onClick:
|
|
2781
|
-
}, " 错误 ", 2)) :
|
|
2782
|
+
class: j(["hep-cr-tab", "hep-cr-tab-error", { active: w.value === "stderr" }]),
|
|
2783
|
+
onClick: g[4] || (g[4] = (m) => w.value = "stderr")
|
|
2784
|
+
}, " 错误 ", 2)) : B("", !0)
|
|
2782
2785
|
]),
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
class:
|
|
2787
|
-
disabled:
|
|
2788
|
-
onClick:
|
|
2789
|
-
title:
|
|
2786
|
+
A("div", ht, [
|
|
2787
|
+
$.value !== null ? (x(), I("span", ft, z($.value) + "ms ", 1)) : B("", !0),
|
|
2788
|
+
A("button", {
|
|
2789
|
+
class: j(["hep-cr-btn-icon", { "hep-cr-btn-copied": F.value }]),
|
|
2790
|
+
disabled: F.value,
|
|
2791
|
+
onClick: X,
|
|
2792
|
+
title: F.value ? "已复制" : "复制"
|
|
2790
2793
|
}, [
|
|
2791
|
-
|
|
2792
|
-
|
|
2794
|
+
F.value ? (x(), I("span", vt, "已复制")) : (x(), I("svg", bt, [...g[10] || (g[10] = [
|
|
2795
|
+
A("rect", {
|
|
2793
2796
|
x: "9",
|
|
2794
2797
|
y: "9",
|
|
2795
2798
|
width: "13",
|
|
@@ -2797,22 +2800,22 @@ const Me = `
|
|
|
2797
2800
|
rx: "2",
|
|
2798
2801
|
ry: "2"
|
|
2799
2802
|
}, null, -1),
|
|
2800
|
-
|
|
2803
|
+
A("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
|
|
2801
2804
|
])]))
|
|
2802
2805
|
], 10, mt)
|
|
2803
2806
|
])
|
|
2804
2807
|
]),
|
|
2805
|
-
|
|
2806
|
-
|
|
2808
|
+
A("div", Et, [
|
|
2809
|
+
w.value === "stdout" ? (x(), I("pre", yt, z(L.value ? "代码执行中..." : C.value || '点击"运行"执行代码'), 1)) : (x(), I("pre", At, z(O.value), 1))
|
|
2807
2810
|
])
|
|
2808
2811
|
], 4)
|
|
2809
2812
|
])
|
|
2810
2813
|
], 6));
|
|
2811
2814
|
}
|
|
2812
|
-
}),
|
|
2815
|
+
}), ee = /* @__PURE__ */ me(St, [["__scopeId", "data-v-41977f3b"]]), kt = { class: "hep-cr-dialog-header" }, wt = { class: "hep-cr-dialog-title" }, Tt = { class: "hep-cr-dialog-body" }, _t = {
|
|
2813
2816
|
key: 0,
|
|
2814
2817
|
class: "hep-cr-dialog-footer"
|
|
2815
|
-
},
|
|
2818
|
+
}, It = /* @__PURE__ */ le({
|
|
2816
2819
|
__name: "CodeRunnerDialog",
|
|
2817
2820
|
props: {
|
|
2818
2821
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2829,41 +2832,41 @@ const Me = `
|
|
|
2829
2832
|
executorLabel: { default: "运行" }
|
|
2830
2833
|
},
|
|
2831
2834
|
emits: ["update:modelValue", "close", "change"],
|
|
2832
|
-
setup(i, { expose:
|
|
2833
|
-
const l = i,
|
|
2835
|
+
setup(i, { expose: p, emit: n }) {
|
|
2836
|
+
const l = i, v = n, _ = N(l.modelValue), S = H(() => l.modelValue !== void 0 ? l.modelValue : _.value);
|
|
2834
2837
|
ue(
|
|
2835
2838
|
() => l.modelValue,
|
|
2836
|
-
(
|
|
2837
|
-
|
|
2839
|
+
(b) => {
|
|
2840
|
+
b !== void 0 && (_.value = b);
|
|
2838
2841
|
}
|
|
2839
2842
|
);
|
|
2840
|
-
function
|
|
2841
|
-
|
|
2843
|
+
function o() {
|
|
2844
|
+
_.value = !1, v("update:modelValue", !1), v("close");
|
|
2842
2845
|
}
|
|
2843
|
-
function
|
|
2844
|
-
|
|
2846
|
+
function f(b) {
|
|
2847
|
+
b.target === b.currentTarget && o();
|
|
2845
2848
|
}
|
|
2846
|
-
return
|
|
2847
|
-
close:
|
|
2848
|
-
}), (
|
|
2849
|
-
ie(
|
|
2850
|
-
default:
|
|
2851
|
-
|
|
2849
|
+
return p({
|
|
2850
|
+
close: o
|
|
2851
|
+
}), (b, k) => (x(), _e(xe, { to: "body" }, [
|
|
2852
|
+
ie(Ie, { name: "hep-cr-dialog-fade" }, {
|
|
2853
|
+
default: Fe(() => [
|
|
2854
|
+
S.value ? (x(), I("div", {
|
|
2852
2855
|
key: 0,
|
|
2853
2856
|
class: "hep-cr-dialog-overlay",
|
|
2854
|
-
onClick:
|
|
2857
|
+
onClick: f
|
|
2855
2858
|
}, [
|
|
2856
|
-
|
|
2859
|
+
A("div", {
|
|
2857
2860
|
class: "hep-cr-dialog-container",
|
|
2858
|
-
style:
|
|
2861
|
+
style: Q({ width: typeof i.width == "number" ? i.width + "px" : i.width })
|
|
2859
2862
|
}, [
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
+
A("div", kt, [
|
|
2864
|
+
A("h3", wt, z(i.title), 1),
|
|
2865
|
+
A("button", {
|
|
2863
2866
|
class: "hep-cr-dialog-close",
|
|
2864
|
-
onClick:
|
|
2865
|
-
}, [...
|
|
2866
|
-
|
|
2867
|
+
onClick: o
|
|
2868
|
+
}, [...k[0] || (k[0] = [
|
|
2869
|
+
A("svg", {
|
|
2867
2870
|
width: "16",
|
|
2868
2871
|
height: "16",
|
|
2869
2872
|
viewBox: "0 0 24 24",
|
|
@@ -2871,13 +2874,13 @@ const Me = `
|
|
|
2871
2874
|
stroke: "currentColor",
|
|
2872
2875
|
"stroke-width": "2"
|
|
2873
2876
|
}, [
|
|
2874
|
-
|
|
2877
|
+
A("line", {
|
|
2875
2878
|
x1: "18",
|
|
2876
2879
|
y1: "6",
|
|
2877
2880
|
x2: "6",
|
|
2878
2881
|
y2: "18"
|
|
2879
2882
|
}),
|
|
2880
|
-
|
|
2883
|
+
A("line", {
|
|
2881
2884
|
x1: "6",
|
|
2882
2885
|
y1: "6",
|
|
2883
2886
|
x2: "18",
|
|
@@ -2886,30 +2889,30 @@ const Me = `
|
|
|
2886
2889
|
], -1)
|
|
2887
2890
|
])])
|
|
2888
2891
|
]),
|
|
2889
|
-
|
|
2890
|
-
ie(
|
|
2892
|
+
A("div", Tt, [
|
|
2893
|
+
ie(ee, Re(b.$attrs, Ne(b.$attrs)), null, 16)
|
|
2891
2894
|
]),
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
])) :
|
|
2895
|
+
b.$slots.footer ? (x(), I("div", _t, [
|
|
2896
|
+
Oe(b.$slots, "footer", { close: o })
|
|
2897
|
+
])) : B("", !0)
|
|
2895
2898
|
], 4)
|
|
2896
|
-
])) :
|
|
2899
|
+
])) : B("", !0)
|
|
2897
2900
|
]),
|
|
2898
2901
|
_: 3
|
|
2899
2902
|
})
|
|
2900
2903
|
]));
|
|
2901
2904
|
}
|
|
2902
2905
|
});
|
|
2903
|
-
|
|
2904
|
-
i.component("CodeRunner",
|
|
2906
|
+
ee.install = (i) => {
|
|
2907
|
+
i.component("CodeRunner", ee);
|
|
2905
2908
|
};
|
|
2906
|
-
const
|
|
2909
|
+
const Ft = {
|
|
2907
2910
|
install(i) {
|
|
2908
|
-
i.component("CodeRunner",
|
|
2911
|
+
i.component("CodeRunner", ee);
|
|
2909
2912
|
}
|
|
2910
2913
|
};
|
|
2911
2914
|
export {
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
+
ee as CodeRunner,
|
|
2916
|
+
It as CodeRunnerDialog,
|
|
2917
|
+
Ft as default
|
|
2915
2918
|
};
|