@hep-code-runner/vue3 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.js +4 -4
- package/dist/index.mjs +477 -387
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
3
|
-
let
|
|
4
|
-
class
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
1
|
+
import { defineComponent as oe, useCssVars as be, ref as L, computed as G, onMounted as ge, watch as le, openBlock as F, createElementBlock as R, normalizeClass as W, createElementVNode as E, withDirectives as Ee, createCommentVNode as U, Fragment as ve, renderList as ye, toDisplayString as H, vModelSelect as Ae, createTextVNode as Se, normalizeStyle as se, createVNode as ie, createBlock as we, Teleport as Te, Transition as ke, withCtx as Ie, normalizeProps as _e, guardReactiveProps as Fe, renderSlot as Re } from "vue";
|
|
2
|
+
var xe = Object.defineProperty, Oe = (o, c, a) => c in o ? xe(o, c, { enumerable: !0, configurable: !0, writable: !0, value: a }) : o[c] = a, ce = (o, c, a) => Oe(o, typeof c != "symbol" ? c + "" : c, a);
|
|
3
|
+
let ae = null;
|
|
4
|
+
class Ne {
|
|
5
|
+
constructor(c = {}) {
|
|
6
|
+
ce(this, "baseUrl"), ce(this, "timeout"), this.baseUrl = c.pistonUrl || "/api/piston", this.timeout = c.timeout || 3e3;
|
|
7
7
|
}
|
|
8
|
-
async getRuntimes(
|
|
9
|
-
if (
|
|
10
|
-
return
|
|
8
|
+
async getRuntimes(c = !1) {
|
|
9
|
+
if (ae && !c)
|
|
10
|
+
return ae;
|
|
11
11
|
try {
|
|
12
12
|
const a = await fetch(`${this.baseUrl}/runtimes`, {
|
|
13
13
|
method: "GET",
|
|
@@ -18,26 +18,26 @@ class ke {
|
|
|
18
18
|
if (!a.ok)
|
|
19
19
|
throw new Error(`Failed to fetch runtimes: ${a.statusText}`);
|
|
20
20
|
const l = await a.json();
|
|
21
|
-
return
|
|
21
|
+
return ae = l, l;
|
|
22
22
|
} catch (a) {
|
|
23
23
|
throw console.error("Failed to fetch runtimes:", a), a;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
async execute(
|
|
27
|
-
const
|
|
26
|
+
async execute(c, a, l = {}) {
|
|
27
|
+
const m = (await this.getRuntimes()).find(
|
|
28
28
|
(f) => {
|
|
29
|
-
var
|
|
30
|
-
return f.language.toLowerCase() ===
|
|
29
|
+
var h;
|
|
30
|
+
return f.language.toLowerCase() === c.toLowerCase() || ((h = f.aliases) == null ? void 0 : h.some((k) => k.toLowerCase() === c.toLowerCase()));
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
if (!
|
|
34
|
-
throw new Error(`Language '${
|
|
35
|
-
const
|
|
36
|
-
language:
|
|
37
|
-
version: l.version ||
|
|
33
|
+
if (!m)
|
|
34
|
+
throw new Error(`Language '${c}' is not supported`);
|
|
35
|
+
const y = this.getFileName(c), A = {
|
|
36
|
+
language: m.language,
|
|
37
|
+
version: l.version || m.version,
|
|
38
38
|
files: [
|
|
39
39
|
{
|
|
40
|
-
name:
|
|
40
|
+
name: y,
|
|
41
41
|
content: a
|
|
42
42
|
}
|
|
43
43
|
],
|
|
@@ -45,28 +45,28 @@ class ke {
|
|
|
45
45
|
args: l.args || [],
|
|
46
46
|
run_timeout: l.runTimeout || this.timeout,
|
|
47
47
|
compile_timeout: this.timeout
|
|
48
|
-
},
|
|
48
|
+
}, s = Date.now();
|
|
49
49
|
try {
|
|
50
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(A)
|
|
56
56
|
});
|
|
57
57
|
if (!f.ok)
|
|
58
58
|
throw new Error(`Execute failed: ${f.statusText}`);
|
|
59
|
-
const
|
|
59
|
+
const h = await f.json(), k = Date.now() - s, N = h.run.stdout || "", I = h.run.stderr || "";
|
|
60
60
|
return {
|
|
61
|
-
success:
|
|
62
|
-
output:
|
|
61
|
+
success: h.run.code === 0,
|
|
62
|
+
output: N,
|
|
63
63
|
stderr: I,
|
|
64
|
-
code:
|
|
64
|
+
code: h.run.code,
|
|
65
65
|
executionTime: k,
|
|
66
|
-
compile:
|
|
67
|
-
stdout:
|
|
68
|
-
stderr:
|
|
69
|
-
code:
|
|
66
|
+
compile: h.compile ? {
|
|
67
|
+
stdout: h.compile.stdout || "",
|
|
68
|
+
stderr: h.compile.stderr || "",
|
|
69
|
+
code: h.compile.code
|
|
70
70
|
} : void 0
|
|
71
71
|
};
|
|
72
72
|
} catch (f) {
|
|
@@ -75,11 +75,11 @@ class ke {
|
|
|
75
75
|
output: "",
|
|
76
76
|
stderr: f instanceof Error ? f.message : "Unknown error",
|
|
77
77
|
code: -1,
|
|
78
|
-
executionTime: Date.now() -
|
|
78
|
+
executionTime: Date.now() - s
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
getFileName(
|
|
82
|
+
getFileName(c) {
|
|
83
83
|
return {
|
|
84
84
|
javascript: "main.js",
|
|
85
85
|
typescript: "main.ts",
|
|
@@ -106,10 +106,10 @@ class ke {
|
|
|
106
106
|
css: "style.css",
|
|
107
107
|
sql: "query.sql",
|
|
108
108
|
markdown: "readme.md"
|
|
109
|
-
}[
|
|
109
|
+
}[c.toLowerCase()] || `main.${c}`;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
const
|
|
112
|
+
const Le = {
|
|
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 ne(o) {
|
|
211
|
+
const c = o.toLowerCase();
|
|
212
|
+
return Le[c] || `// ${o}
|
|
213
213
|
// Write your code here`;
|
|
214
214
|
}
|
|
215
|
-
var
|
|
216
|
-
function
|
|
215
|
+
var pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
216
|
+
function Ce(o) {
|
|
217
217
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
218
218
|
}
|
|
219
|
-
var
|
|
219
|
+
var me = { exports: {} };
|
|
220
220
|
(function(o) {
|
|
221
|
-
var
|
|
221
|
+
var c = 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 pe = { exports: {} };
|
|
|
228
228
|
* @public
|
|
229
229
|
*/
|
|
230
230
|
var a = function(l) {
|
|
231
|
-
var
|
|
231
|
+
var m = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, y = 0, A = {}, s = {
|
|
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
|
|
@@ -312,7 +312,7 @@ var pe = { exports: {} };
|
|
|
312
312
|
* @returns {number}
|
|
313
313
|
*/
|
|
314
314
|
objId: function(t) {
|
|
315
|
-
return t.__id || Object.defineProperty(t, "__id", { value: ++
|
|
315
|
+
return t.__id || Object.defineProperty(t, "__id", { value: ++y }), t.__id;
|
|
316
316
|
},
|
|
317
317
|
/**
|
|
318
318
|
* Creates a deep clone of the given object.
|
|
@@ -326,24 +326,24 @@ var pe = { exports: {} };
|
|
|
326
326
|
*/
|
|
327
327
|
clone: function t(e, n) {
|
|
328
328
|
n = n || {};
|
|
329
|
-
var r,
|
|
330
|
-
switch (
|
|
329
|
+
var r, i;
|
|
330
|
+
switch (s.util.type(e)) {
|
|
331
331
|
case "Object":
|
|
332
|
-
if (
|
|
333
|
-
return n[
|
|
332
|
+
if (i = s.util.objId(e), n[i])
|
|
333
|
+
return n[i];
|
|
334
334
|
r = /** @type {Record<string, any>} */
|
|
335
|
-
{}, n[
|
|
336
|
-
for (var
|
|
337
|
-
e.hasOwnProperty(
|
|
335
|
+
{}, n[i] = r;
|
|
336
|
+
for (var d in e)
|
|
337
|
+
e.hasOwnProperty(d) && (r[d] = t(e[d], n));
|
|
338
338
|
return (
|
|
339
339
|
/** @type {any} */
|
|
340
340
|
r
|
|
341
341
|
);
|
|
342
342
|
case "Array":
|
|
343
|
-
return
|
|
343
|
+
return i = s.util.objId(e), n[i] ? n[i] : (r = [], n[i] = r, /** @type {Array} */
|
|
344
344
|
/** @type {any} */
|
|
345
|
-
e.forEach(function(
|
|
346
|
-
r[u] = t(
|
|
345
|
+
e.forEach(function(b, u) {
|
|
346
|
+
r[u] = t(b, n);
|
|
347
347
|
}), /** @type {any} */
|
|
348
348
|
r);
|
|
349
349
|
default:
|
|
@@ -360,7 +360,7 @@ var pe = { exports: {} };
|
|
|
360
360
|
*/
|
|
361
361
|
getLanguage: function(t) {
|
|
362
362
|
for (; t; ) {
|
|
363
|
-
var e =
|
|
363
|
+
var e = m.exec(t.className);
|
|
364
364
|
if (e)
|
|
365
365
|
return e[1].toLowerCase();
|
|
366
366
|
t = t.parentElement;
|
|
@@ -375,7 +375,7 @@ var pe = { exports: {} };
|
|
|
375
375
|
* @returns {void}
|
|
376
376
|
*/
|
|
377
377
|
setLanguage: function(t, e) {
|
|
378
|
-
t.className = t.className.replace(RegExp(
|
|
378
|
+
t.className = t.className.replace(RegExp(m, "gi"), ""), t.classList.add("language-" + e);
|
|
379
379
|
},
|
|
380
380
|
/**
|
|
381
381
|
* Returns the script element that is currently executing.
|
|
@@ -426,10 +426,10 @@ var pe = { exports: {} };
|
|
|
426
426
|
*/
|
|
427
427
|
isActive: function(t, e, n) {
|
|
428
428
|
for (var r = "no-" + e; t; ) {
|
|
429
|
-
var
|
|
430
|
-
if (
|
|
429
|
+
var i = t.classList;
|
|
430
|
+
if (i.contains(e))
|
|
431
431
|
return !0;
|
|
432
|
-
if (
|
|
432
|
+
if (i.contains(r))
|
|
433
433
|
return !1;
|
|
434
434
|
t = t.parentElement;
|
|
435
435
|
}
|
|
@@ -447,10 +447,10 @@ var pe = { exports: {} };
|
|
|
447
447
|
/**
|
|
448
448
|
* The grammar for plain, unformatted text.
|
|
449
449
|
*/
|
|
450
|
-
plain:
|
|
451
|
-
plaintext:
|
|
452
|
-
text:
|
|
453
|
-
txt:
|
|
450
|
+
plain: A,
|
|
451
|
+
plaintext: A,
|
|
452
|
+
text: A,
|
|
453
|
+
txt: A,
|
|
454
454
|
/**
|
|
455
455
|
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
456
456
|
*
|
|
@@ -480,7 +480,7 @@ var pe = { exports: {} };
|
|
|
480
480
|
* });
|
|
481
481
|
*/
|
|
482
482
|
extend: function(t, e) {
|
|
483
|
-
var n =
|
|
483
|
+
var n = s.util.clone(s.languages[t]);
|
|
484
484
|
for (var r in e)
|
|
485
485
|
n[r] = e[r];
|
|
486
486
|
return n;
|
|
@@ -562,29 +562,29 @@ var pe = { exports: {} };
|
|
|
562
562
|
*/
|
|
563
563
|
insertBefore: function(t, e, n, r) {
|
|
564
564
|
r = r || /** @type {any} */
|
|
565
|
-
|
|
566
|
-
var
|
|
567
|
-
for (var
|
|
568
|
-
if (
|
|
569
|
-
if (
|
|
565
|
+
s.languages;
|
|
566
|
+
var i = r[t], d = {};
|
|
567
|
+
for (var b in i)
|
|
568
|
+
if (i.hasOwnProperty(b)) {
|
|
569
|
+
if (b == e)
|
|
570
570
|
for (var u in n)
|
|
571
|
-
n.hasOwnProperty(u) && (
|
|
572
|
-
n.hasOwnProperty(
|
|
571
|
+
n.hasOwnProperty(u) && (d[u] = n[u]);
|
|
572
|
+
n.hasOwnProperty(b) || (d[b] = i[b]);
|
|
573
573
|
}
|
|
574
574
|
var w = r[t];
|
|
575
|
-
return r[t] =
|
|
576
|
-
P === w &&
|
|
577
|
-
}),
|
|
575
|
+
return r[t] = d, s.languages.DFS(s.languages, function(_, P) {
|
|
576
|
+
P === w && _ != t && (this[_] = d);
|
|
577
|
+
}), d;
|
|
578
578
|
},
|
|
579
579
|
// Traverse a language definition with Depth First Search
|
|
580
|
-
DFS: function t(e, n, r,
|
|
581
|
-
|
|
582
|
-
var
|
|
583
|
-
for (var
|
|
584
|
-
if (e.hasOwnProperty(
|
|
585
|
-
n.call(e,
|
|
586
|
-
var u = e[
|
|
587
|
-
w === "Object" && !
|
|
580
|
+
DFS: function t(e, n, r, i) {
|
|
581
|
+
i = i || {};
|
|
582
|
+
var d = s.util.objId;
|
|
583
|
+
for (var b in e)
|
|
584
|
+
if (e.hasOwnProperty(b)) {
|
|
585
|
+
n.call(e, b, e[b], r || b);
|
|
586
|
+
var u = e[b], w = s.util.type(u);
|
|
587
|
+
w === "Object" && !i[d(u)] ? (i[d(u)] = !0, t(u, n, null, i)) : w === "Array" && !i[d(u)] && (i[d(u)] = !0, t(u, n, b, i));
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
},
|
|
@@ -602,7 +602,7 @@ var pe = { exports: {} };
|
|
|
602
602
|
* @public
|
|
603
603
|
*/
|
|
604
604
|
highlightAll: function(t, e) {
|
|
605
|
-
|
|
605
|
+
s.highlightAllUnder(document, t, e);
|
|
606
606
|
},
|
|
607
607
|
/**
|
|
608
608
|
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
@@ -625,9 +625,9 @@ var pe = { exports: {} };
|
|
|
625
625
|
container: t,
|
|
626
626
|
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
627
627
|
};
|
|
628
|
-
|
|
629
|
-
for (var
|
|
630
|
-
|
|
628
|
+
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);
|
|
629
|
+
for (var i = 0, d; d = r.elements[i++]; )
|
|
630
|
+
s.highlightElement(d, e === !0, r.callback);
|
|
631
631
|
},
|
|
632
632
|
/**
|
|
633
633
|
* Highlights the code inside a single element.
|
|
@@ -658,38 +658,38 @@ var pe = { exports: {} };
|
|
|
658
658
|
* @public
|
|
659
659
|
*/
|
|
660
660
|
highlightElement: function(t, e, n) {
|
|
661
|
-
var r =
|
|
662
|
-
|
|
663
|
-
var
|
|
664
|
-
|
|
665
|
-
var
|
|
661
|
+
var r = s.util.getLanguage(t), i = s.languages[r];
|
|
662
|
+
s.util.setLanguage(t, r);
|
|
663
|
+
var d = t.parentElement;
|
|
664
|
+
d && d.nodeName.toLowerCase() === "pre" && s.util.setLanguage(d, r);
|
|
665
|
+
var b = t.textContent, u = {
|
|
666
666
|
element: t,
|
|
667
667
|
language: r,
|
|
668
|
-
grammar:
|
|
669
|
-
code:
|
|
668
|
+
grammar: i,
|
|
669
|
+
code: b
|
|
670
670
|
};
|
|
671
671
|
function w(P) {
|
|
672
|
-
u.highlightedCode = P,
|
|
672
|
+
u.highlightedCode = P, s.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, s.hooks.run("after-highlight", u), s.hooks.run("complete", u), n && n.call(u.element);
|
|
673
673
|
}
|
|
674
|
-
if (
|
|
675
|
-
|
|
674
|
+
if (s.hooks.run("before-sanity-check", u), d = u.element.parentElement, d && d.nodeName.toLowerCase() === "pre" && !d.hasAttribute("tabindex") && d.setAttribute("tabindex", "0"), !u.code) {
|
|
675
|
+
s.hooks.run("complete", u), n && n.call(u.element);
|
|
676
676
|
return;
|
|
677
677
|
}
|
|
678
|
-
if (
|
|
679
|
-
w(
|
|
678
|
+
if (s.hooks.run("before-highlight", u), !u.grammar) {
|
|
679
|
+
w(s.util.encode(u.code));
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
if (e && l.Worker) {
|
|
683
|
-
var
|
|
684
|
-
|
|
683
|
+
var _ = new Worker(s.filename);
|
|
684
|
+
_.onmessage = function(P) {
|
|
685
685
|
w(P.data);
|
|
686
|
-
},
|
|
686
|
+
}, _.postMessage(JSON.stringify({
|
|
687
687
|
language: u.language,
|
|
688
688
|
code: u.code,
|
|
689
689
|
immediateClose: !0
|
|
690
690
|
}));
|
|
691
691
|
} else
|
|
692
|
-
w(
|
|
692
|
+
w(s.highlight(u.code, u.grammar, u.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
|
|
@@ -717,9 +717,9 @@ var pe = { exports: {} };
|
|
|
717
717
|
grammar: e,
|
|
718
718
|
language: n
|
|
719
719
|
};
|
|
720
|
-
if (
|
|
720
|
+
if (s.hooks.run("before-tokenize", r), !r.grammar)
|
|
721
721
|
throw new Error('The language "' + r.language + '" has no grammar.');
|
|
722
|
-
return r.tokens =
|
|
722
|
+
return r.tokens = s.tokenize(r.code, r.grammar), s.hooks.run("after-tokenize", r), f.stringify(s.util.encode(r.tokens), r.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
|
|
@@ -752,8 +752,8 @@ var pe = { exports: {} };
|
|
|
752
752
|
e[r] = n[r];
|
|
753
753
|
delete e.rest;
|
|
754
754
|
}
|
|
755
|
-
var
|
|
756
|
-
return I(
|
|
755
|
+
var i = new N();
|
|
756
|
+
return I(i, i.head, t), k(t, i, e, i.head, 0), D(i);
|
|
757
757
|
},
|
|
758
758
|
/**
|
|
759
759
|
* @namespace
|
|
@@ -775,7 +775,7 @@ var pe = { exports: {} };
|
|
|
775
775
|
* @public
|
|
776
776
|
*/
|
|
777
777
|
add: function(t, e) {
|
|
778
|
-
var n =
|
|
778
|
+
var n = s.hooks.all;
|
|
779
779
|
n[t] = n[t] || [], n[t].push(e);
|
|
780
780
|
},
|
|
781
781
|
/**
|
|
@@ -788,15 +788,15 @@ var pe = { exports: {} };
|
|
|
788
788
|
* @public
|
|
789
789
|
*/
|
|
790
790
|
run: function(t, e) {
|
|
791
|
-
var n =
|
|
791
|
+
var n = s.hooks.all[t];
|
|
792
792
|
if (!(!n || !n.length))
|
|
793
|
-
for (var r = 0,
|
|
794
|
-
|
|
793
|
+
for (var r = 0, i; i = n[r++]; )
|
|
794
|
+
i(e);
|
|
795
795
|
}
|
|
796
796
|
},
|
|
797
797
|
Token: f
|
|
798
798
|
};
|
|
799
|
-
l.Prism =
|
|
799
|
+
l.Prism = s;
|
|
800
800
|
function f(t, e, n, r) {
|
|
801
801
|
this.type = t, this.content = e, this.alias = n, this.length = (r || "").length | 0;
|
|
802
802
|
}
|
|
@@ -809,90 +809,90 @@ var pe = { exports: {} };
|
|
|
809
809
|
r += t(w, n);
|
|
810
810
|
}), r;
|
|
811
811
|
}
|
|
812
|
-
var
|
|
812
|
+
var i = {
|
|
813
813
|
type: e.type,
|
|
814
814
|
content: t(e.content, n),
|
|
815
815
|
tag: "span",
|
|
816
816
|
classes: ["token", e.type],
|
|
817
817
|
attributes: {},
|
|
818
818
|
language: n
|
|
819
|
-
},
|
|
820
|
-
|
|
821
|
-
var
|
|
822
|
-
for (var u in
|
|
823
|
-
|
|
824
|
-
return "<" +
|
|
819
|
+
}, d = e.alias;
|
|
820
|
+
d && (Array.isArray(d) ? Array.prototype.push.apply(i.classes, d) : i.classes.push(d)), s.hooks.run("wrap", i);
|
|
821
|
+
var b = "";
|
|
822
|
+
for (var u in i.attributes)
|
|
823
|
+
b += " " + u + '="' + (i.attributes[u] || "").replace(/"/g, """) + '"';
|
|
824
|
+
return "<" + i.tag + ' class="' + i.classes.join(" ") + '"' + b + ">" + i.content + "</" + i.tag + ">";
|
|
825
825
|
};
|
|
826
|
-
function
|
|
826
|
+
function h(t, e, n, r) {
|
|
827
827
|
t.lastIndex = e;
|
|
828
|
-
var
|
|
829
|
-
if (
|
|
830
|
-
var
|
|
831
|
-
|
|
828
|
+
var i = t.exec(n);
|
|
829
|
+
if (i && r && i[1]) {
|
|
830
|
+
var d = i[1].length;
|
|
831
|
+
i.index += d, i[0] = i[0].slice(d);
|
|
832
832
|
}
|
|
833
|
-
return
|
|
833
|
+
return i;
|
|
834
834
|
}
|
|
835
|
-
function k(t, e, n, r,
|
|
836
|
-
for (var
|
|
837
|
-
if (!(!n.hasOwnProperty(
|
|
838
|
-
var u = n[
|
|
835
|
+
function k(t, e, n, r, i, d) {
|
|
836
|
+
for (var b in n)
|
|
837
|
+
if (!(!n.hasOwnProperty(b) || !n[b])) {
|
|
838
|
+
var u = n[b];
|
|
839
839
|
u = Array.isArray(u) ? u : [u];
|
|
840
840
|
for (var w = 0; w < u.length; ++w) {
|
|
841
|
-
if (
|
|
841
|
+
if (d && d.cause == b + "," + w)
|
|
842
842
|
return;
|
|
843
|
-
var
|
|
844
|
-
if (
|
|
845
|
-
var
|
|
846
|
-
|
|
843
|
+
var _ = u[w], P = _.inside, V = !!_.lookbehind, v = !!_.greedy, T = _.alias;
|
|
844
|
+
if (v && !_.pattern.global) {
|
|
845
|
+
var x = _.pattern.toString().match(/[imsuy]*$/)[0];
|
|
846
|
+
_.pattern = RegExp(_.pattern.source, x + "g");
|
|
847
847
|
}
|
|
848
|
-
for (var Y =
|
|
849
|
-
var z =
|
|
848
|
+
for (var Y = _.pattern || _, O = r.next, M = i; O !== e.tail && !(d && M >= d.reach); M += O.value.length, O = O.next) {
|
|
849
|
+
var z = O.value;
|
|
850
850
|
if (e.length > t.length)
|
|
851
851
|
return;
|
|
852
852
|
if (!(z instanceof f)) {
|
|
853
853
|
var X = 1, $;
|
|
854
|
-
if (
|
|
855
|
-
if ($ =
|
|
854
|
+
if (v) {
|
|
855
|
+
if ($ = h(Y, M, t, V), !$ || $.index >= t.length)
|
|
856
856
|
break;
|
|
857
|
-
var Z = $.index,
|
|
858
|
-
for (
|
|
859
|
-
|
|
860
|
-
if (
|
|
857
|
+
var Z = $.index, fe = $.index + $[0].length, B = M;
|
|
858
|
+
for (B += O.value.length; Z >= B; )
|
|
859
|
+
O = O.next, B += O.value.length;
|
|
860
|
+
if (B -= O.value.length, M = B, O.value instanceof f)
|
|
861
861
|
continue;
|
|
862
|
-
for (var j =
|
|
863
|
-
X++,
|
|
864
|
-
X--, z = t.slice(M,
|
|
865
|
-
} else if ($ =
|
|
862
|
+
for (var j = O; j !== e.tail && (B < fe || typeof j.value == "string"); j = j.next)
|
|
863
|
+
X++, B += j.value.length;
|
|
864
|
+
X--, z = t.slice(M, B), $.index -= M;
|
|
865
|
+
} else if ($ = h(Y, 0, z, V), !$)
|
|
866
866
|
continue;
|
|
867
|
-
var Z = $.index, K = $[0],
|
|
868
|
-
|
|
869
|
-
var q =
|
|
870
|
-
|
|
871
|
-
var
|
|
872
|
-
if (
|
|
873
|
-
var
|
|
874
|
-
cause:
|
|
875
|
-
reach:
|
|
867
|
+
var Z = $.index, K = $[0], Q = z.slice(0, Z), de = z.slice(Z + K.length), ee = M + z.length;
|
|
868
|
+
d && ee > d.reach && (d.reach = ee);
|
|
869
|
+
var q = O.prev;
|
|
870
|
+
Q && (q = I(e, q, Q), M += Q.length), C(e, q, X);
|
|
871
|
+
var he = new f(b, P ? s.tokenize(K, P) : K, T, K);
|
|
872
|
+
if (O = I(e, q, he), de && I(e, O, de), X > 1) {
|
|
873
|
+
var te = {
|
|
874
|
+
cause: b + "," + w,
|
|
875
|
+
reach: ee
|
|
876
876
|
};
|
|
877
|
-
k(t, e, n,
|
|
877
|
+
k(t, e, n, O.prev, M, te), d && te.reach > d.reach && (d.reach = te.reach);
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function N() {
|
|
885
885
|
var t = { value: null, prev: null, next: null }, e = { value: null, prev: t, next: null };
|
|
886
886
|
t.next = e, this.head = t, this.tail = e, this.length = 0;
|
|
887
887
|
}
|
|
888
888
|
function I(t, e, n) {
|
|
889
|
-
var r = e.next,
|
|
890
|
-
return e.next =
|
|
889
|
+
var r = e.next, i = { value: n, prev: e, next: r };
|
|
890
|
+
return e.next = i, r.prev = i, t.length++, i;
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
for (var r = e.next,
|
|
892
|
+
function C(t, e, n) {
|
|
893
|
+
for (var r = e.next, i = 0; i < n && r !== t.tail; i++)
|
|
894
894
|
r = r.next;
|
|
895
|
-
e.next = r, r.prev = e, t.length -=
|
|
895
|
+
e.next = r, r.prev = e, t.length -= i;
|
|
896
896
|
}
|
|
897
897
|
function D(t) {
|
|
898
898
|
for (var e = [], n = t.head.next; n !== t.tail; )
|
|
@@ -900,22 +900,22 @@ var pe = { exports: {} };
|
|
|
900
900
|
return e;
|
|
901
901
|
}
|
|
902
902
|
if (!l.document)
|
|
903
|
-
return l.addEventListener && (
|
|
904
|
-
var e = JSON.parse(t.data), n = e.language, r = e.code,
|
|
905
|
-
l.postMessage(
|
|
906
|
-
}, !1)),
|
|
907
|
-
var g =
|
|
908
|
-
g && (
|
|
903
|
+
return l.addEventListener && (s.disableWorkerMessageHandler || l.addEventListener("message", function(t) {
|
|
904
|
+
var e = JSON.parse(t.data), n = e.language, r = e.code, i = e.immediateClose;
|
|
905
|
+
l.postMessage(s.highlight(r, s.languages[n], n)), i && l.close();
|
|
906
|
+
}, !1)), s;
|
|
907
|
+
var g = s.util.currentScript();
|
|
908
|
+
g && (s.filename = g.src, g.hasAttribute("data-manual") && (s.manual = !0));
|
|
909
909
|
function p() {
|
|
910
|
-
|
|
910
|
+
s.manual || s.highlightAll();
|
|
911
911
|
}
|
|
912
|
-
if (!
|
|
913
|
-
var
|
|
914
|
-
|
|
912
|
+
if (!s.manual) {
|
|
913
|
+
var S = document.readyState;
|
|
914
|
+
S === "loading" || S === "interactive" && g && g.defer ? document.addEventListener("DOMContentLoaded", p) : window.requestAnimationFrame ? window.requestAnimationFrame(p) : window.setTimeout(p, 16);
|
|
915
915
|
}
|
|
916
|
-
return
|
|
917
|
-
}(
|
|
918
|
-
o.exports && (o.exports = a), typeof
|
|
916
|
+
return s;
|
|
917
|
+
}(c);
|
|
918
|
+
o.exports && (o.exports = a), typeof pe < "u" && (pe.Prism = a), a.languages.markup = {
|
|
919
919
|
comment: {
|
|
920
920
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
921
921
|
greedy: !0
|
|
@@ -1006,31 +1006,31 @@ var pe = { exports: {} };
|
|
|
1006
1006
|
* @example
|
|
1007
1007
|
* addInlined('style', 'css');
|
|
1008
1008
|
*/
|
|
1009
|
-
value: function(
|
|
1010
|
-
var
|
|
1011
|
-
|
|
1009
|
+
value: function(m, y) {
|
|
1010
|
+
var A = {};
|
|
1011
|
+
A["language-" + y] = {
|
|
1012
1012
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1013
1013
|
lookbehind: !0,
|
|
1014
|
-
inside: a.languages[
|
|
1015
|
-
},
|
|
1016
|
-
var
|
|
1014
|
+
inside: a.languages[y]
|
|
1015
|
+
}, A.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1016
|
+
var s = {
|
|
1017
1017
|
"included-cdata": {
|
|
1018
1018
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1019
|
-
inside:
|
|
1019
|
+
inside: A
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
1022
|
-
|
|
1022
|
+
s["language-" + y] = {
|
|
1023
1023
|
pattern: /[\s\S]+/,
|
|
1024
|
-
inside: a.languages[
|
|
1024
|
+
inside: a.languages[y]
|
|
1025
1025
|
};
|
|
1026
1026
|
var f = {};
|
|
1027
|
-
f[
|
|
1027
|
+
f[m] = {
|
|
1028
1028
|
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1029
|
-
return
|
|
1029
|
+
return m;
|
|
1030
1030
|
}), "i"),
|
|
1031
1031
|
lookbehind: !0,
|
|
1032
1032
|
greedy: !0,
|
|
1033
|
-
inside:
|
|
1033
|
+
inside: s
|
|
1034
1034
|
}, a.languages.insertBefore("markup", "cdata", f);
|
|
1035
1035
|
}
|
|
1036
1036
|
}), Object.defineProperty(a.languages.markup.tag, "addAttribute", {
|
|
@@ -1045,7 +1045,7 @@ var pe = { exports: {} };
|
|
|
1045
1045
|
* @example
|
|
1046
1046
|
* addAttribute('style', 'css');
|
|
1047
1047
|
*/
|
|
1048
|
-
value: function(l,
|
|
1048
|
+
value: function(l, m) {
|
|
1049
1049
|
a.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 pe = { exports: {} };
|
|
|
1060
1060
|
value: {
|
|
1061
1061
|
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1062
1062
|
lookbehind: !0,
|
|
1063
|
-
alias: [
|
|
1064
|
-
inside: a.languages[
|
|
1063
|
+
alias: [m, "language-" + m],
|
|
1064
|
+
inside: a.languages[m]
|
|
1065
1065
|
},
|
|
1066
1066
|
punctuation: [
|
|
1067
1067
|
{
|
|
@@ -1076,11 +1076,11 @@ var pe = { exports: {} };
|
|
|
1076
1076
|
});
|
|
1077
1077
|
}
|
|
1078
1078
|
}), a.languages.html = a.languages.markup, a.languages.mathml = a.languages.markup, a.languages.svg = a.languages.markup, a.languages.xml = a.languages.extend("markup", {}), a.languages.ssml = a.languages.xml, a.languages.atom = a.languages.xml, a.languages.rss = a.languages.xml, function(l) {
|
|
1079
|
-
var
|
|
1079
|
+
var m = /(?:"(?:\\(?:\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 + "|" + m.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
1084
1084
|
inside: {
|
|
1085
1085
|
rule: /^@[\w-]+/,
|
|
1086
1086
|
"selector-function-argument": {
|
|
@@ -1097,23 +1097,23 @@ var pe = { exports: {} };
|
|
|
1097
1097
|
},
|
|
1098
1098
|
url: {
|
|
1099
1099
|
// https://drafts.csswg.org/css-values-3/#urls
|
|
1100
|
-
pattern: RegExp("\\burl\\((?:" +
|
|
1100
|
+
pattern: RegExp("\\burl\\((?:" + m.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("^" + m.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{])|` + m.source + ")*(?=\\s*\\{)"),
|
|
1113
1113
|
lookbehind: !0
|
|
1114
1114
|
},
|
|
1115
1115
|
string: {
|
|
1116
|
-
pattern:
|
|
1116
|
+
pattern: m,
|
|
1117
1117
|
greedy: !0
|
|
1118
1118
|
},
|
|
1119
1119
|
property: {
|
|
@@ -1127,8 +1127,8 @@ var pe = { exports: {} };
|
|
|
1127
1127
|
},
|
|
1128
1128
|
punctuation: /[(){};:,]/
|
|
1129
1129
|
}, l.languages.css.atrule.inside.rest = l.languages.css;
|
|
1130
|
-
var
|
|
1131
|
-
|
|
1130
|
+
var y = l.languages.markup;
|
|
1131
|
+
y && (y.tag.addInlined("style", "css"), y.tag.addAttribute("style", "css"));
|
|
1132
1132
|
}(a), a.languages.clike = {
|
|
1133
1133
|
comment: [
|
|
1134
1134
|
{
|
|
@@ -1293,9 +1293,9 @@ var pe = { exports: {} };
|
|
|
1293
1293
|
if (typeof a > "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…",
|
|
1296
|
+
var l = "Loading…", m = function(g, p) {
|
|
1297
1297
|
return "✖ Error " + g + " while fetching file: " + p;
|
|
1298
|
-
},
|
|
1298
|
+
}, y = "✖ Error: File does not exist or is empty", A = {
|
|
1299
1299
|
js: "javascript",
|
|
1300
1300
|
py: "python",
|
|
1301
1301
|
rb: "ruby",
|
|
@@ -1305,52 +1305,52 @@ var pe = { exports: {} };
|
|
|
1305
1305
|
bat: "batch",
|
|
1306
1306
|
h: "c",
|
|
1307
1307
|
tex: "latex"
|
|
1308
|
-
},
|
|
1309
|
-
function I(g, p,
|
|
1308
|
+
}, s = "data-src-status", f = "loading", h = "loaded", k = "failed", N = "pre[data-src]:not([" + s + '="' + h + '"]):not([' + s + '="' + f + '"])';
|
|
1309
|
+
function I(g, p, S) {
|
|
1310
1310
|
var t = new XMLHttpRequest();
|
|
1311
1311
|
t.open("GET", g, !0), t.onreadystatechange = function() {
|
|
1312
|
-
t.readyState == 4 && (t.status < 400 && t.responseText ? p(t.responseText) : t.status >= 400 ?
|
|
1312
|
+
t.readyState == 4 && (t.status < 400 && t.responseText ? p(t.responseText) : t.status >= 400 ? S(m(t.status, t.statusText)) : S(y));
|
|
1313
1313
|
}, t.send(null);
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function C(g) {
|
|
1316
1316
|
var p = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g || "");
|
|
1317
1317
|
if (p) {
|
|
1318
|
-
var
|
|
1319
|
-
return t ? e ? [
|
|
1318
|
+
var S = Number(p[1]), t = p[2], e = p[3];
|
|
1319
|
+
return t ? e ? [S, Number(e)] : [S, void 0] : [S, S];
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
1322
|
a.hooks.add("before-highlightall", function(g) {
|
|
1323
|
-
g.selector += ", " +
|
|
1323
|
+
g.selector += ", " + N;
|
|
1324
1324
|
}), a.hooks.add("before-sanity-check", function(g) {
|
|
1325
1325
|
var p = (
|
|
1326
1326
|
/** @type {HTMLPreElement} */
|
|
1327
1327
|
g.element
|
|
1328
1328
|
);
|
|
1329
|
-
if (p.matches(
|
|
1330
|
-
g.code = "", p.setAttribute(
|
|
1331
|
-
var
|
|
1332
|
-
|
|
1329
|
+
if (p.matches(N)) {
|
|
1330
|
+
g.code = "", p.setAttribute(s, f);
|
|
1331
|
+
var S = p.appendChild(document.createElement("CODE"));
|
|
1332
|
+
S.textContent = l;
|
|
1333
1333
|
var t = p.getAttribute("data-src"), e = g.language;
|
|
1334
1334
|
if (e === "none") {
|
|
1335
1335
|
var n = (/\.(\w+)$/.exec(t) || [, "none"])[1];
|
|
1336
|
-
e =
|
|
1336
|
+
e = A[n] || n;
|
|
1337
1337
|
}
|
|
1338
|
-
a.util.setLanguage(
|
|
1338
|
+
a.util.setLanguage(S, e), a.util.setLanguage(p, e);
|
|
1339
1339
|
var r = a.plugins.autoloader;
|
|
1340
1340
|
r && r.loadLanguages(e), I(
|
|
1341
1341
|
t,
|
|
1342
|
-
function(
|
|
1343
|
-
p.setAttribute(
|
|
1344
|
-
var
|
|
1345
|
-
if (
|
|
1346
|
-
var
|
|
1347
|
-
u < 0 && (u +=
|
|
1342
|
+
function(i) {
|
|
1343
|
+
p.setAttribute(s, h);
|
|
1344
|
+
var d = C(p.getAttribute("data-range"));
|
|
1345
|
+
if (d) {
|
|
1346
|
+
var b = i.split(/\r\n?|\n/g), u = d[0], w = d[1] == null ? b.length : d[1];
|
|
1347
|
+
u < 0 && (u += b.length), u = Math.max(0, Math.min(u - 1, b.length)), w < 0 && (w += b.length), w = Math.max(0, Math.min(w, b.length)), i = b.slice(u, w).join(`
|
|
1348
1348
|
`), p.hasAttribute("data-start") || p.setAttribute("data-start", String(u + 1));
|
|
1349
1349
|
}
|
|
1350
|
-
|
|
1350
|
+
S.textContent = i, a.highlightElement(S);
|
|
1351
1351
|
},
|
|
1352
|
-
function(
|
|
1353
|
-
p.setAttribute(
|
|
1352
|
+
function(i) {
|
|
1353
|
+
p.setAttribute(s, k), S.textContent = i;
|
|
1354
1354
|
}
|
|
1355
1355
|
);
|
|
1356
1356
|
}
|
|
@@ -1363,7 +1363,7 @@ var pe = { exports: {} };
|
|
|
1363
1363
|
* @param {ParentNode} [container=document]
|
|
1364
1364
|
*/
|
|
1365
1365
|
highlight: function(p) {
|
|
1366
|
-
for (var
|
|
1366
|
+
for (var S = (p || document).querySelectorAll(N), t = 0, e; e = S[t++]; )
|
|
1367
1367
|
a.highlightElement(e);
|
|
1368
1368
|
}
|
|
1369
1369
|
};
|
|
@@ -1372,9 +1372,9 @@ var pe = { exports: {} };
|
|
|
1372
1372
|
D || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), D = !0), a.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1373
1373
|
};
|
|
1374
1374
|
}();
|
|
1375
|
-
})(
|
|
1376
|
-
var
|
|
1377
|
-
const
|
|
1375
|
+
})(me);
|
|
1376
|
+
var De = me.exports;
|
|
1377
|
+
const re = /* @__PURE__ */ Ce(De);
|
|
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(o) {
|
|
1636
|
-
var
|
|
1636
|
+
var c = /\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/, a = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = {
|
|
1637
1637
|
pattern: RegExp(/(^|[^\w.])/.source + a + /[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: c,
|
|
1673
1673
|
function: [
|
|
1674
1674
|
o.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: c,
|
|
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 c.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(o) {
|
|
1826
|
-
for (var
|
|
1827
|
-
|
|
1828
|
-
return
|
|
1826
|
+
for (var c = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, a = 0; a < 2; a++)
|
|
1827
|
+
c = c.replace(/<self>/g, function() {
|
|
1828
|
+
return c;
|
|
1829
1829
|
});
|
|
1830
|
-
|
|
1830
|
+
c = c.replace(/<self>/g, function() {
|
|
1831
1831
|
return /[^\s\S]/.source;
|
|
1832
1832
|
}), o.languages.rust = {
|
|
1833
1833
|
comment: [
|
|
1834
1834
|
{
|
|
1835
|
-
pattern: RegExp(/(^|[^\\])/.source +
|
|
1835
|
+
pattern: RegExp(/(^|[^\\])/.source + c),
|
|
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(o) {
|
|
1975
|
-
var
|
|
1975
|
+
var c = "\\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 = {
|
|
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: a,
|
|
1984
1984
|
environment: {
|
|
1985
|
-
pattern: RegExp("\\$" +
|
|
1985
|
+
pattern: RegExp("\\$" + c),
|
|
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("(\\{)" + c),
|
|
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;|&]|[<>]\\()" + c),
|
|
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("\\$?" + c),
|
|
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
|
}, a.inside = o.languages.bash;
|
|
2173
|
-
for (var
|
|
2173
|
+
for (var m = [
|
|
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
|
+
], y = l.variable[1].inside, A = 0; A < m.length; A++)
|
|
2190
|
+
y[m[A]] = o.languages.bash[m[A]];
|
|
2191
2191
|
o.languages.sh = o.languages.bash, o.languages.shell = o.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 Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
2219
2219
|
__name: "CodeEditor",
|
|
2220
2220
|
props: {
|
|
2221
2221
|
modelValue: {},
|
|
@@ -2224,22 +2224,22 @@ const Re = ["innerHTML"], xe = ["value", "disabled"], Ne = /* @__PURE__ */ ue({
|
|
|
2224
2224
|
disabled: { type: Boolean, default: !1 }
|
|
2225
2225
|
},
|
|
2226
2226
|
emits: ["update:modelValue"],
|
|
2227
|
-
setup(o, { emit:
|
|
2228
|
-
|
|
2229
|
-
v4a58b198:
|
|
2227
|
+
setup(o, { emit: c }) {
|
|
2228
|
+
be((g) => ({
|
|
2229
|
+
v4a58b198: h.value
|
|
2230
2230
|
}));
|
|
2231
2231
|
function a(g) {
|
|
2232
2232
|
if (typeof document > "u") return;
|
|
2233
|
-
const p = g === "dark" ? "prism-okaidia" : "prism",
|
|
2234
|
-
if (
|
|
2235
|
-
|
|
2233
|
+
const p = g === "dark" ? "prism-okaidia" : "prism", S = document.getElementById("prism-theme-style"), t = `https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/${p}.min.css`;
|
|
2234
|
+
if (S)
|
|
2235
|
+
S.setAttribute("href", t);
|
|
2236
2236
|
else {
|
|
2237
2237
|
const e = document.createElement("link");
|
|
2238
2238
|
e.id = "prism-theme-style", e.rel = "stylesheet", e.href = t, document.head.appendChild(e);
|
|
2239
2239
|
}
|
|
2240
2240
|
}
|
|
2241
|
-
typeof window < "u" && (window.Prism =
|
|
2242
|
-
const l = o,
|
|
2241
|
+
typeof window < "u" && (window.Prism = re);
|
|
2242
|
+
const l = o, m = c, y = L(null), A = L(null), s = {
|
|
2243
2243
|
javascript: "javascript",
|
|
2244
2244
|
js: "javascript",
|
|
2245
2245
|
typescript: "typescript",
|
|
@@ -2270,86 +2270,86 @@ const Re = ["innerHTML"], xe = ["value", "disabled"], Ne = /* @__PURE__ */ ue({
|
|
|
2270
2270
|
yml: "yaml",
|
|
2271
2271
|
markdown: "markdown",
|
|
2272
2272
|
md: "markdown"
|
|
2273
|
-
}, f = G(() =>
|
|
2273
|
+
}, f = G(() => s[l.language.toLowerCase()] || "javascript"), h = G(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), k = G(() => {
|
|
2274
2274
|
try {
|
|
2275
|
-
const g =
|
|
2275
|
+
const g = re.languages[f.value];
|
|
2276
2276
|
if (g)
|
|
2277
|
-
return
|
|
2277
|
+
return re.highlight(l.modelValue || "", g, f.value);
|
|
2278
2278
|
} catch {
|
|
2279
2279
|
}
|
|
2280
|
-
return
|
|
2280
|
+
return N(l.modelValue || "");
|
|
2281
2281
|
});
|
|
2282
|
-
function
|
|
2282
|
+
function N(g) {
|
|
2283
2283
|
const p = document.createElement("div");
|
|
2284
2284
|
return p.textContent = g, p.innerHTML;
|
|
2285
2285
|
}
|
|
2286
2286
|
function I(g) {
|
|
2287
2287
|
const p = g.target;
|
|
2288
|
-
|
|
2288
|
+
m("update:modelValue", p.value);
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2291
|
-
|
|
2290
|
+
function C() {
|
|
2291
|
+
y.value && A.value && (A.value.scrollTop = y.value.scrollTop, A.value.scrollLeft = y.value.scrollLeft);
|
|
2292
2292
|
}
|
|
2293
2293
|
function D(g) {
|
|
2294
2294
|
if (g.key === "Tab") {
|
|
2295
2295
|
g.preventDefault();
|
|
2296
|
-
const p = g.target,
|
|
2297
|
-
p.value = e.substring(0,
|
|
2296
|
+
const p = g.target, S = p.selectionStart, t = p.selectionEnd, e = p.value;
|
|
2297
|
+
p.value = e.substring(0, S) + " " + e.substring(t), p.selectionStart = p.selectionEnd = S + 2, m("update:modelValue", p.value);
|
|
2298
2298
|
}
|
|
2299
2299
|
}
|
|
2300
|
-
return
|
|
2300
|
+
return ge(() => {
|
|
2301
2301
|
a(l.theme);
|
|
2302
|
-
}),
|
|
2302
|
+
}), le(() => l.theme, (g) => {
|
|
2303
2303
|
a(g);
|
|
2304
|
-
}), (g, p) => (
|
|
2304
|
+
}), (g, p) => (F(), R("div", {
|
|
2305
2305
|
class: W(["code-editor", `theme-${o.theme}`])
|
|
2306
2306
|
}, [
|
|
2307
|
-
|
|
2307
|
+
E("pre", {
|
|
2308
2308
|
ref_key: "highlightRef",
|
|
2309
|
-
ref:
|
|
2309
|
+
ref: A,
|
|
2310
2310
|
class: W(["code-highlight", [`language-${f.value}`, `prism-theme-${o.theme}`]]),
|
|
2311
2311
|
"aria-hidden": "true"
|
|
2312
2312
|
}, [
|
|
2313
|
-
|
|
2313
|
+
E("code", { innerHTML: k.value }, null, 8, Pe)
|
|
2314
2314
|
], 2),
|
|
2315
|
-
|
|
2315
|
+
E("textarea", {
|
|
2316
2316
|
ref_key: "codeRef",
|
|
2317
|
-
ref:
|
|
2317
|
+
ref: y,
|
|
2318
2318
|
class: "code-input",
|
|
2319
2319
|
value: o.modelValue,
|
|
2320
2320
|
disabled: o.disabled,
|
|
2321
2321
|
onInput: I,
|
|
2322
|
-
onScroll:
|
|
2322
|
+
onScroll: C,
|
|
2323
2323
|
onKeydown: D,
|
|
2324
2324
|
spellcheck: "false",
|
|
2325
2325
|
placeholder: "Write your code here..."
|
|
2326
|
-
}, null, 40,
|
|
2326
|
+
}, null, 40, $e)
|
|
2327
2327
|
], 2));
|
|
2328
2328
|
}
|
|
2329
|
-
}),
|
|
2329
|
+
}), ue = (o, c) => {
|
|
2330
2330
|
const a = o.__vccOpts || o;
|
|
2331
|
-
for (const [l,
|
|
2332
|
-
a[l] =
|
|
2331
|
+
for (const [l, m] of c)
|
|
2332
|
+
a[l] = m;
|
|
2333
2333
|
return a;
|
|
2334
|
-
},
|
|
2334
|
+
}, Ue = /* @__PURE__ */ ue(Me, [["__scopeId", "data-v-0ec35612"]]), He = { class: "code-runner-header" }, Be = { class: "code-runner-controls" }, Ge = ["disabled"], ze = {
|
|
2335
2335
|
key: 0,
|
|
2336
2336
|
value: ""
|
|
2337
|
-
},
|
|
2337
|
+
}, je = ["value"], We = { class: "code-runner-actions" }, Ve = ["disabled"], Ye = {
|
|
2338
2338
|
key: 0,
|
|
2339
2339
|
class: "spinner"
|
|
2340
|
-
},
|
|
2340
|
+
}, Xe = {
|
|
2341
2341
|
key: 1,
|
|
2342
2342
|
class: "run-icon"
|
|
2343
|
-
},
|
|
2343
|
+
}, Ze = ["title"], Ke = {
|
|
2344
2344
|
key: 0,
|
|
2345
2345
|
class: "error-message"
|
|
2346
|
-
},
|
|
2346
|
+
}, qe = { class: "code-runner-main" }, Je = { class: "panel-header" }, Qe = { class: "language-badge" }, et = { class: "panel-header" }, tt = { class: "output-tabs" }, at = { class: "output-actions" }, nt = {
|
|
2347
2347
|
key: 0,
|
|
2348
2348
|
class: "execution-time"
|
|
2349
|
-
},
|
|
2349
|
+
}, rt = { class: "output-content" }, st = { key: 0 }, it = {
|
|
2350
2350
|
key: 1,
|
|
2351
2351
|
class: "stderr"
|
|
2352
|
-
},
|
|
2352
|
+
}, ot = /* @__PURE__ */ oe({
|
|
2353
2353
|
__name: "CodeRunner",
|
|
2354
2354
|
props: {
|
|
2355
2355
|
pistonUrl: { default: "/api/piston" },
|
|
@@ -2362,45 +2362,45 @@ const Re = ["innerHTML"], xe = ["value", "disabled"], Ne = /* @__PURE__ */ ue({
|
|
|
2362
2362
|
executorLabel: { default: "运行" }
|
|
2363
2363
|
},
|
|
2364
2364
|
emits: ["execute-start", "execute-end", "language-change"],
|
|
2365
|
-
setup(o, { emit:
|
|
2366
|
-
const a = o, l =
|
|
2365
|
+
setup(o, { emit: c }) {
|
|
2366
|
+
const a = o, l = c, m = L([]), y = L(a.language), A = L(a.theme), s = L(""), f = L(""), h = L(""), k = L(!1), N = L(null), I = L("stdout"), C = L(null), D = L(!1), g = L(60);
|
|
2367
2367
|
function p() {
|
|
2368
|
-
|
|
2368
|
+
A.value = A.value === "light" ? "dark" : "light";
|
|
2369
2369
|
}
|
|
2370
|
-
const
|
|
2371
|
-
() => new
|
|
2372
|
-
), t = G(() =>
|
|
2373
|
-
value: `${
|
|
2374
|
-
label: `${
|
|
2370
|
+
const S = G(
|
|
2371
|
+
() => new Ne({ pistonUrl: a.pistonUrl })
|
|
2372
|
+
), t = G(() => m.value.map((v) => ({
|
|
2373
|
+
value: `${v.language}:${v.version}`,
|
|
2374
|
+
label: `${v.language.charAt(0).toUpperCase() + v.language.slice(1)} ${v.version}`
|
|
2375
2375
|
}))), e = G(() => {
|
|
2376
|
-
const
|
|
2377
|
-
return
|
|
2376
|
+
const v = y.value;
|
|
2377
|
+
return v.includes(":") ? v.split(":")[0] : v;
|
|
2378
2378
|
});
|
|
2379
2379
|
async function n() {
|
|
2380
|
-
D.value = !0,
|
|
2380
|
+
D.value = !0, C.value = null;
|
|
2381
2381
|
try {
|
|
2382
|
-
|
|
2383
|
-
} catch (
|
|
2384
|
-
|
|
2382
|
+
m.value = await S.value.getRuntimes();
|
|
2383
|
+
} catch (v) {
|
|
2384
|
+
C.value = v instanceof Error ? v.message : "Failed to load runtimes";
|
|
2385
2385
|
} finally {
|
|
2386
2386
|
D.value = !1;
|
|
2387
2387
|
}
|
|
2388
2388
|
}
|
|
2389
|
-
|
|
2390
|
-
const T =
|
|
2391
|
-
|
|
2389
|
+
le(y, (v) => {
|
|
2390
|
+
const T = v.includes(":") ? v.split(":")[0] : v, x = ne(T);
|
|
2391
|
+
s.value = x, l("language-change", T, x);
|
|
2392
2392
|
});
|
|
2393
2393
|
async function r() {
|
|
2394
2394
|
if (!k.value) {
|
|
2395
|
-
k.value = !0, f.value = "",
|
|
2395
|
+
k.value = !0, f.value = "", h.value = "", N.value = null, C.value = null, I.value = "stdout", l("execute-start");
|
|
2396
2396
|
try {
|
|
2397
|
-
const
|
|
2398
|
-
f.value =
|
|
2399
|
-
} catch (
|
|
2400
|
-
|
|
2397
|
+
const v = await S.value.execute(e.value, s.value);
|
|
2398
|
+
f.value = v.output, h.value = v.stderr, N.value = v.executionTime || null, I.value = v.stderr ? "stderr" : "stdout", l("execute-end", v);
|
|
2399
|
+
} catch (v) {
|
|
2400
|
+
C.value = v instanceof Error ? v.message : "Execution failed", l("execute-end", {
|
|
2401
2401
|
success: !1,
|
|
2402
2402
|
output: "",
|
|
2403
|
-
stderr:
|
|
2403
|
+
stderr: C.value,
|
|
2404
2404
|
code: -1
|
|
2405
2405
|
});
|
|
2406
2406
|
} finally {
|
|
@@ -2408,127 +2408,127 @@ const Re = ["innerHTML"], xe = ["value", "disabled"], Ne = /* @__PURE__ */ ue({
|
|
|
2408
2408
|
}
|
|
2409
2409
|
}
|
|
2410
2410
|
}
|
|
2411
|
-
function
|
|
2412
|
-
f.value = "",
|
|
2411
|
+
function i() {
|
|
2412
|
+
f.value = "", h.value = "", N.value = null, C.value = null;
|
|
2413
2413
|
}
|
|
2414
|
-
async function
|
|
2415
|
-
const
|
|
2416
|
-
await navigator.clipboard.writeText(
|
|
2414
|
+
async function d() {
|
|
2415
|
+
const v = I.value === "stdout" ? f.value : h.value;
|
|
2416
|
+
await navigator.clipboard.writeText(v);
|
|
2417
2417
|
}
|
|
2418
|
-
function
|
|
2419
|
-
|
|
2418
|
+
function b() {
|
|
2419
|
+
s.value = ne(e.value);
|
|
2420
2420
|
}
|
|
2421
2421
|
let u = !1;
|
|
2422
|
-
function w(
|
|
2423
|
-
u = !0, document.addEventListener("mousemove",
|
|
2422
|
+
function w(v) {
|
|
2423
|
+
u = !0, document.addEventListener("mousemove", _), document.addEventListener("mouseup", P), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
2424
2424
|
}
|
|
2425
|
-
function
|
|
2425
|
+
function _(v) {
|
|
2426
2426
|
if (!u) return;
|
|
2427
2427
|
const T = document.querySelector(
|
|
2428
2428
|
".code-runner-main"
|
|
2429
2429
|
);
|
|
2430
2430
|
if (!T) return;
|
|
2431
|
-
const
|
|
2431
|
+
const x = T.getBoundingClientRect(), Y = (v.clientX - x.left) / x.width * 100;
|
|
2432
2432
|
g.value = Math.max(20, Math.min(80, Y));
|
|
2433
2433
|
}
|
|
2434
2434
|
function P() {
|
|
2435
|
-
u = !1, document.removeEventListener("mousemove",
|
|
2435
|
+
u = !1, document.removeEventListener("mousemove", _), document.removeEventListener("mouseup", P), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
2436
2436
|
}
|
|
2437
|
-
|
|
2438
|
-
await n(),
|
|
2437
|
+
ge(async () => {
|
|
2438
|
+
await n(), s.value || (s.value = a.defaultCode || ne(y.value));
|
|
2439
2439
|
});
|
|
2440
|
-
const V = G(() => `code-runner-${
|
|
2441
|
-
return (
|
|
2440
|
+
const V = G(() => `code-runner-${A.value}`);
|
|
2441
|
+
return (v, T) => (F(), R("div", {
|
|
2442
2442
|
class: W(["code-runner", V.value])
|
|
2443
2443
|
}, [
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
o.showLanguageSelector ?
|
|
2444
|
+
E("div", He, [
|
|
2445
|
+
E("div", Be, [
|
|
2446
|
+
o.showLanguageSelector ? Ee((F(), R("select", {
|
|
2447
2447
|
key: 0,
|
|
2448
|
-
"onUpdate:modelValue": T[0] || (T[0] = (
|
|
2448
|
+
"onUpdate:modelValue": T[0] || (T[0] = (x) => y.value = x),
|
|
2449
2449
|
class: "language-select",
|
|
2450
2450
|
disabled: k.value
|
|
2451
2451
|
}, [
|
|
2452
|
-
D.value ? (
|
|
2453
|
-
(
|
|
2454
|
-
key:
|
|
2455
|
-
value:
|
|
2456
|
-
},
|
|
2457
|
-
], 8,
|
|
2458
|
-
[
|
|
2459
|
-
]) :
|
|
2452
|
+
D.value ? (F(), R("option", ze, "加载中...")) : U("", !0),
|
|
2453
|
+
(F(!0), R(ve, null, ye(t.value, (x) => (F(), R("option", {
|
|
2454
|
+
key: x.value,
|
|
2455
|
+
value: x.value
|
|
2456
|
+
}, H(x.label), 9, je))), 128))
|
|
2457
|
+
], 8, Ge)), [
|
|
2458
|
+
[Ae, y.value]
|
|
2459
|
+
]) : U("", !0)
|
|
2460
2460
|
]),
|
|
2461
|
-
|
|
2462
|
-
|
|
2461
|
+
E("div", We, [
|
|
2462
|
+
E("button", {
|
|
2463
2463
|
class: "btn btn-run",
|
|
2464
2464
|
disabled: k.value || D.value,
|
|
2465
2465
|
onClick: r
|
|
2466
2466
|
}, [
|
|
2467
|
-
k.value ? (
|
|
2468
|
-
|
|
2469
|
-
], 8,
|
|
2470
|
-
o.showEditor && o.editable ? (
|
|
2467
|
+
k.value ? (F(), R("span", Ye)) : (F(), R("span", Xe, "▶")),
|
|
2468
|
+
Se(" " + H(k.value ? "运行中..." : o.executorLabel), 1)
|
|
2469
|
+
], 8, Ve),
|
|
2470
|
+
o.showEditor && o.editable ? (F(), R("button", {
|
|
2471
2471
|
key: 0,
|
|
2472
2472
|
class: "btn btn-reset",
|
|
2473
|
-
onClick:
|
|
2474
|
-
}, " 重置 ")) :
|
|
2475
|
-
|
|
2473
|
+
onClick: b
|
|
2474
|
+
}, " 重置 ")) : U("", !0),
|
|
2475
|
+
E("button", {
|
|
2476
2476
|
class: "btn btn-theme",
|
|
2477
2477
|
onClick: p,
|
|
2478
|
-
title:
|
|
2479
|
-
},
|
|
2478
|
+
title: A.value === "light" ? "Switch to dark mode" : "Switch to light mode"
|
|
2479
|
+
}, H(A.value === "light" ? "🌙" : "☀️"), 9, Ze)
|
|
2480
2480
|
])
|
|
2481
2481
|
]),
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
o.showEditor ? (
|
|
2482
|
+
C.value ? (F(), R("div", Ke, H(C.value), 1)) : U("", !0),
|
|
2483
|
+
E("div", qe, [
|
|
2484
|
+
o.showEditor ? (F(), R("div", {
|
|
2485
2485
|
key: 0,
|
|
2486
2486
|
class: "editor-panel",
|
|
2487
|
-
style:
|
|
2487
|
+
style: se({ width: g.value + "%" })
|
|
2488
2488
|
}, [
|
|
2489
|
-
|
|
2490
|
-
T[4] || (T[4] =
|
|
2491
|
-
|
|
2489
|
+
E("div", Je, [
|
|
2490
|
+
T[4] || (T[4] = E("span", { class: "panel-title" }, "编辑器", -1)),
|
|
2491
|
+
E("span", Qe, H(e.value), 1)
|
|
2492
2492
|
]),
|
|
2493
|
-
|
|
2494
|
-
modelValue:
|
|
2495
|
-
"onUpdate:modelValue": T[1] || (T[1] = (
|
|
2493
|
+
ie(Ue, {
|
|
2494
|
+
modelValue: s.value,
|
|
2495
|
+
"onUpdate:modelValue": T[1] || (T[1] = (x) => s.value = x),
|
|
2496
2496
|
language: e.value,
|
|
2497
|
-
theme:
|
|
2497
|
+
theme: A.value,
|
|
2498
2498
|
disabled: !o.editable || k.value
|
|
2499
2499
|
}, null, 8, ["modelValue", "language", "theme", "disabled"])
|
|
2500
|
-
], 4)) :
|
|
2501
|
-
o.showEditor ? (
|
|
2500
|
+
], 4)) : U("", !0),
|
|
2501
|
+
o.showEditor ? (F(), R("div", {
|
|
2502
2502
|
key: 1,
|
|
2503
2503
|
class: "resize-handle",
|
|
2504
2504
|
onMousedown: w
|
|
2505
2505
|
}, [...T[5] || (T[5] = [
|
|
2506
|
-
|
|
2507
|
-
])], 32)) :
|
|
2508
|
-
|
|
2506
|
+
E("div", { class: "resize-line" }, null, -1)
|
|
2507
|
+
])], 32)) : U("", !0),
|
|
2508
|
+
E("div", {
|
|
2509
2509
|
class: "output-panel",
|
|
2510
|
-
style:
|
|
2510
|
+
style: se({ width: o.showEditor ? 100 - g.value + "%" : "100%" })
|
|
2511
2511
|
}, [
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2512
|
+
E("div", et, [
|
|
2513
|
+
E("div", tt, [
|
|
2514
|
+
E("button", {
|
|
2515
2515
|
class: W(["tab", { active: I.value === "stdout" }]),
|
|
2516
|
-
onClick: T[2] || (T[2] = (
|
|
2516
|
+
onClick: T[2] || (T[2] = (x) => I.value = "stdout")
|
|
2517
2517
|
}, " 输出 ", 2),
|
|
2518
|
-
|
|
2518
|
+
h.value ? (F(), R("button", {
|
|
2519
2519
|
key: 0,
|
|
2520
2520
|
class: W(["tab", { active: I.value === "stderr" }]),
|
|
2521
|
-
onClick: T[3] || (T[3] = (
|
|
2522
|
-
}, " 错误 ", 2)) :
|
|
2521
|
+
onClick: T[3] || (T[3] = (x) => I.value = "stderr")
|
|
2522
|
+
}, " 错误 ", 2)) : U("", !0)
|
|
2523
2523
|
]),
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2524
|
+
E("div", at, [
|
|
2525
|
+
N.value !== null ? (F(), R("span", nt, H(N.value) + "ms ", 1)) : U("", !0),
|
|
2526
|
+
E("button", {
|
|
2527
2527
|
class: "btn-icon",
|
|
2528
|
-
onClick:
|
|
2528
|
+
onClick: d,
|
|
2529
2529
|
title: "复制"
|
|
2530
2530
|
}, [...T[6] || (T[6] = [
|
|
2531
|
-
|
|
2531
|
+
E("svg", {
|
|
2532
2532
|
width: "14",
|
|
2533
2533
|
height: "14",
|
|
2534
2534
|
viewBox: "0 0 24 24",
|
|
@@ -2536,7 +2536,7 @@ const Re = ["innerHTML"], xe = ["value", "disabled"], Ne = /* @__PURE__ */ ue({
|
|
|
2536
2536
|
stroke: "currentColor",
|
|
2537
2537
|
"stroke-width": "2"
|
|
2538
2538
|
}, [
|
|
2539
|
-
|
|
2539
|
+
E("rect", {
|
|
2540
2540
|
x: "9",
|
|
2541
2541
|
y: "9",
|
|
2542
2542
|
width: "13",
|
|
@@ -2544,15 +2544,15 @@ const Re = ["innerHTML"], xe = ["value", "disabled"], Ne = /* @__PURE__ */ ue({
|
|
|
2544
2544
|
rx: "2",
|
|
2545
2545
|
ry: "2"
|
|
2546
2546
|
}),
|
|
2547
|
-
|
|
2547
|
+
E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2548
2548
|
], -1)
|
|
2549
2549
|
])]),
|
|
2550
|
-
|
|
2550
|
+
E("button", {
|
|
2551
2551
|
class: "btn-icon",
|
|
2552
|
-
onClick:
|
|
2552
|
+
onClick: i,
|
|
2553
2553
|
title: "清除"
|
|
2554
2554
|
}, [...T[7] || (T[7] = [
|
|
2555
|
-
|
|
2555
|
+
E("svg", {
|
|
2556
2556
|
width: "14",
|
|
2557
2557
|
height: "14",
|
|
2558
2558
|
viewBox: "0 0 24 24",
|
|
@@ -2560,29 +2560,119 @@ const Re = ["innerHTML"], xe = ["value", "disabled"], Ne = /* @__PURE__ */ ue({
|
|
|
2560
2560
|
stroke: "currentColor",
|
|
2561
2561
|
"stroke-width": "2"
|
|
2562
2562
|
}, [
|
|
2563
|
-
|
|
2564
|
-
|
|
2563
|
+
E("polyline", { points: "3 6 5 6 21 6" }),
|
|
2564
|
+
E("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
2565
2565
|
], -1)
|
|
2566
2566
|
])])
|
|
2567
2567
|
])
|
|
2568
2568
|
]),
|
|
2569
|
-
|
|
2570
|
-
I.value === "stdout" ? (
|
|
2569
|
+
E("div", rt, [
|
|
2570
|
+
I.value === "stdout" ? (F(), R("pre", st, H(f.value || '点击"运行"执行代码'), 1)) : (F(), R("pre", it, H(h.value), 1))
|
|
2571
2571
|
])
|
|
2572
2572
|
], 4)
|
|
2573
2573
|
])
|
|
2574
2574
|
], 2));
|
|
2575
2575
|
}
|
|
2576
|
-
}),
|
|
2577
|
-
|
|
2578
|
-
|
|
2576
|
+
}), J = /* @__PURE__ */ ue(ot, [["__scopeId", "data-v-6e14ca02"]]), lt = { class: "dialog-header" }, ut = { class: "dialog-title" }, dt = { class: "dialog-body" }, ct = {
|
|
2577
|
+
key: 0,
|
|
2578
|
+
class: "dialog-footer"
|
|
2579
|
+
}, pt = /* @__PURE__ */ oe({
|
|
2580
|
+
__name: "CodeRunnerDialog",
|
|
2581
|
+
props: {
|
|
2582
|
+
modelValue: { type: Boolean, default: !1 },
|
|
2583
|
+
title: { default: "代码执行器" },
|
|
2584
|
+
width: { default: 800 },
|
|
2585
|
+
pistonUrl: { default: "/api/piston" },
|
|
2586
|
+
language: { default: "javascript" },
|
|
2587
|
+
theme: { default: "light" },
|
|
2588
|
+
showLanguageSelector: { type: Boolean, default: !0 },
|
|
2589
|
+
showEditor: { type: Boolean, default: !0 },
|
|
2590
|
+
editable: { type: Boolean, default: !0 },
|
|
2591
|
+
defaultCode: {},
|
|
2592
|
+
executorLabel: { default: "运行" }
|
|
2593
|
+
},
|
|
2594
|
+
emits: ["update:modelValue", "close"],
|
|
2595
|
+
setup(o, { expose: c, emit: a }) {
|
|
2596
|
+
const l = o, m = a, y = L(l.modelValue), A = G(() => l.modelValue !== void 0 ? l.modelValue : y.value);
|
|
2597
|
+
le(
|
|
2598
|
+
() => l.modelValue,
|
|
2599
|
+
(h) => {
|
|
2600
|
+
h !== void 0 && (y.value = h);
|
|
2601
|
+
}
|
|
2602
|
+
);
|
|
2603
|
+
function s() {
|
|
2604
|
+
y.value = !1, m("update:modelValue", !1), m("close");
|
|
2605
|
+
}
|
|
2606
|
+
function f(h) {
|
|
2607
|
+
h.target === h.currentTarget && s();
|
|
2608
|
+
}
|
|
2609
|
+
return c({
|
|
2610
|
+
close: s
|
|
2611
|
+
}), (h, k) => (F(), we(Te, { to: "body" }, [
|
|
2612
|
+
ie(ke, { name: "dialog-fade" }, {
|
|
2613
|
+
default: Ie(() => [
|
|
2614
|
+
A.value ? (F(), R("div", {
|
|
2615
|
+
key: 0,
|
|
2616
|
+
class: "dialog-overlay",
|
|
2617
|
+
onClick: f
|
|
2618
|
+
}, [
|
|
2619
|
+
E("div", {
|
|
2620
|
+
class: "dialog-container",
|
|
2621
|
+
style: se({ width: typeof o.width == "number" ? o.width + "px" : o.width })
|
|
2622
|
+
}, [
|
|
2623
|
+
E("div", lt, [
|
|
2624
|
+
E("h3", ut, H(o.title), 1),
|
|
2625
|
+
E("button", {
|
|
2626
|
+
class: "dialog-close",
|
|
2627
|
+
onClick: s
|
|
2628
|
+
}, [...k[0] || (k[0] = [
|
|
2629
|
+
E("svg", {
|
|
2630
|
+
width: "16",
|
|
2631
|
+
height: "16",
|
|
2632
|
+
viewBox: "0 0 24 24",
|
|
2633
|
+
fill: "none",
|
|
2634
|
+
stroke: "currentColor",
|
|
2635
|
+
"stroke-width": "2"
|
|
2636
|
+
}, [
|
|
2637
|
+
E("line", {
|
|
2638
|
+
x1: "18",
|
|
2639
|
+
y1: "6",
|
|
2640
|
+
x2: "6",
|
|
2641
|
+
y2: "18"
|
|
2642
|
+
}),
|
|
2643
|
+
E("line", {
|
|
2644
|
+
x1: "6",
|
|
2645
|
+
y1: "6",
|
|
2646
|
+
x2: "18",
|
|
2647
|
+
y2: "18"
|
|
2648
|
+
})
|
|
2649
|
+
], -1)
|
|
2650
|
+
])])
|
|
2651
|
+
]),
|
|
2652
|
+
E("div", dt, [
|
|
2653
|
+
ie(J, _e(Fe(h.$attrs)), null, 16)
|
|
2654
|
+
]),
|
|
2655
|
+
h.$slots.footer ? (F(), R("div", ct, [
|
|
2656
|
+
Re(h.$slots, "footer", { close: s }, void 0, !0)
|
|
2657
|
+
])) : U("", !0)
|
|
2658
|
+
], 4)
|
|
2659
|
+
])) : U("", !0)
|
|
2660
|
+
]),
|
|
2661
|
+
_: 3
|
|
2662
|
+
})
|
|
2663
|
+
]));
|
|
2664
|
+
}
|
|
2665
|
+
}), mt = /* @__PURE__ */ ue(pt, [["__scopeId", "data-v-8a12e3c8"]]);
|
|
2666
|
+
J.install = (o) => {
|
|
2667
|
+
o.component("CodeRunner", J);
|
|
2579
2668
|
};
|
|
2580
|
-
const
|
|
2669
|
+
const ft = {
|
|
2581
2670
|
install(o) {
|
|
2582
|
-
o.component("CodeRunner",
|
|
2671
|
+
o.component("CodeRunner", J);
|
|
2583
2672
|
}
|
|
2584
2673
|
};
|
|
2585
2674
|
export {
|
|
2586
|
-
|
|
2587
|
-
|
|
2675
|
+
J as CodeRunner,
|
|
2676
|
+
mt as CodeRunnerDialog,
|
|
2677
|
+
ft as default
|
|
2588
2678
|
};
|