@hep-code-runner/vue2 1.3.0 → 1.5.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/dist/index.js +121 -5
- package/dist/index.mjs +384 -272
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ae = Object.defineProperty, ie = (r, e, t) => e in r ? ae(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, q = (r, e, t) => ie(r, typeof e != "symbol" ? e + "" : e, t);
|
|
2
2
|
let W = null;
|
|
3
|
-
class
|
|
3
|
+
class se {
|
|
4
4
|
constructor(e = {}) {
|
|
5
5
|
q(this, "baseUrl"), q(this, "timeout"), this.baseUrl = e.pistonUrl || "/api/piston", this.timeout = e.timeout || 3e3;
|
|
6
6
|
}
|
|
@@ -26,7 +26,7 @@ class oe {
|
|
|
26
26
|
const p = (await this.getRuntimes()).find(
|
|
27
27
|
(h) => {
|
|
28
28
|
var A;
|
|
29
|
-
return h.language.toLowerCase() === e.toLowerCase() || ((A = h.aliases) == null ? void 0 : A.some((
|
|
29
|
+
return h.language.toLowerCase() === e.toLowerCase() || ((A = h.aliases) == null ? void 0 : A.some((_) => _.toLowerCase() === e.toLowerCase()));
|
|
30
30
|
}
|
|
31
31
|
);
|
|
32
32
|
if (!p)
|
|
@@ -55,13 +55,13 @@ class oe {
|
|
|
55
55
|
});
|
|
56
56
|
if (!h.ok)
|
|
57
57
|
throw new Error(`Execute failed: ${h.statusText}`);
|
|
58
|
-
const A = await h.json(),
|
|
58
|
+
const A = await h.json(), _ = Date.now() - u, x = A.run.stdout || "", I = A.run.stderr || "";
|
|
59
59
|
return {
|
|
60
60
|
success: A.run.code === 0,
|
|
61
61
|
output: x,
|
|
62
|
-
stderr:
|
|
62
|
+
stderr: I,
|
|
63
63
|
code: A.run.code,
|
|
64
|
-
executionTime:
|
|
64
|
+
executionTime: _,
|
|
65
65
|
compile: A.compile ? {
|
|
66
66
|
stdout: A.compile.stdout || "",
|
|
67
67
|
stderr: A.compile.stderr || "",
|
|
@@ -108,7 +108,7 @@ class oe {
|
|
|
108
108
|
}[e.toLowerCase()] || `main.${e}`;
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const oe = {
|
|
112
112
|
javascript: 'console.log("Hello, World!");',
|
|
113
113
|
typescript: 'console.log("Hello, World!");',
|
|
114
114
|
python: 'print("Hello, World!")',
|
|
@@ -206,17 +206,17 @@ h1 {
|
|
|
206
206
|
|
|
207
207
|
This is a sample markdown document.`
|
|
208
208
|
};
|
|
209
|
-
function z(
|
|
210
|
-
const e =
|
|
211
|
-
return
|
|
209
|
+
function z(r) {
|
|
210
|
+
const e = r.toLowerCase();
|
|
211
|
+
return oe[e] || `// ${r}
|
|
212
212
|
// Write your code here`;
|
|
213
213
|
}
|
|
214
214
|
var J = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
215
|
-
function
|
|
216
|
-
return
|
|
215
|
+
function le(r) {
|
|
216
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
217
217
|
}
|
|
218
|
-
var
|
|
219
|
-
(function(
|
|
218
|
+
var Q = { exports: {} };
|
|
219
|
+
(function(r) {
|
|
220
220
|
var e = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
221
221
|
/**
|
|
222
222
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
@@ -282,8 +282,8 @@ var ee = { exports: {} };
|
|
|
282
282
|
* @memberof Prism
|
|
283
283
|
*/
|
|
284
284
|
util: {
|
|
285
|
-
encode: function
|
|
286
|
-
return n instanceof h ? new h(n.type,
|
|
285
|
+
encode: function a(n) {
|
|
286
|
+
return n instanceof h ? new h(n.type, a(n.content), n.alias) : Array.isArray(n) ? n.map(a) : n.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
287
287
|
},
|
|
288
288
|
/**
|
|
289
289
|
* Returns the name of the type of the given value.
|
|
@@ -301,8 +301,8 @@ var ee = { exports: {} };
|
|
|
301
301
|
* type(String) === 'Function'
|
|
302
302
|
* type(/abc+/) === 'RegExp'
|
|
303
303
|
*/
|
|
304
|
-
type: function(
|
|
305
|
-
return Object.prototype.toString.call(
|
|
304
|
+
type: function(a) {
|
|
305
|
+
return Object.prototype.toString.call(a).slice(8, -1);
|
|
306
306
|
},
|
|
307
307
|
/**
|
|
308
308
|
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
@@ -310,8 +310,8 @@ var ee = { exports: {} };
|
|
|
310
310
|
* @param {Object} obj
|
|
311
311
|
* @returns {number}
|
|
312
312
|
*/
|
|
313
|
-
objId: function(
|
|
314
|
-
return
|
|
313
|
+
objId: function(a) {
|
|
314
|
+
return a.__id || Object.defineProperty(a, "__id", { value: ++f }), a.__id;
|
|
315
315
|
},
|
|
316
316
|
/**
|
|
317
317
|
* Creates a deep clone of the given object.
|
|
@@ -323,28 +323,28 @@ var ee = { exports: {} };
|
|
|
323
323
|
* @returns {T}
|
|
324
324
|
* @template T
|
|
325
325
|
*/
|
|
326
|
-
clone: function
|
|
327
|
-
|
|
328
|
-
var
|
|
326
|
+
clone: function a(n, i) {
|
|
327
|
+
i = i || {};
|
|
328
|
+
var s, o;
|
|
329
329
|
switch (u.util.type(n)) {
|
|
330
330
|
case "Object":
|
|
331
|
-
if (o = u.util.objId(n),
|
|
332
|
-
return
|
|
333
|
-
|
|
334
|
-
{},
|
|
331
|
+
if (o = u.util.objId(n), i[o])
|
|
332
|
+
return i[o];
|
|
333
|
+
s = /** @type {Record<string, any>} */
|
|
334
|
+
{}, i[o] = s;
|
|
335
335
|
for (var d in n)
|
|
336
|
-
n.hasOwnProperty(d) && (
|
|
336
|
+
n.hasOwnProperty(d) && (s[d] = a(n[d], i));
|
|
337
337
|
return (
|
|
338
338
|
/** @type {any} */
|
|
339
|
-
|
|
339
|
+
s
|
|
340
340
|
);
|
|
341
341
|
case "Array":
|
|
342
|
-
return o = u.util.objId(n),
|
|
342
|
+
return o = u.util.objId(n), i[o] ? i[o] : (s = [], i[o] = s, /** @type {Array} */
|
|
343
343
|
/** @type {any} */
|
|
344
344
|
n.forEach(function(g, c) {
|
|
345
|
-
|
|
345
|
+
s[c] = a(g, i);
|
|
346
346
|
}), /** @type {any} */
|
|
347
|
-
|
|
347
|
+
s);
|
|
348
348
|
default:
|
|
349
349
|
return n;
|
|
350
350
|
}
|
|
@@ -357,12 +357,12 @@ var ee = { exports: {} };
|
|
|
357
357
|
* @param {Element} element
|
|
358
358
|
* @returns {string}
|
|
359
359
|
*/
|
|
360
|
-
getLanguage: function(
|
|
361
|
-
for (;
|
|
362
|
-
var n = p.exec(
|
|
360
|
+
getLanguage: function(a) {
|
|
361
|
+
for (; a; ) {
|
|
362
|
+
var n = p.exec(a.className);
|
|
363
363
|
if (n)
|
|
364
364
|
return n[1].toLowerCase();
|
|
365
|
-
|
|
365
|
+
a = a.parentElement;
|
|
366
366
|
}
|
|
367
367
|
return "none";
|
|
368
368
|
},
|
|
@@ -373,8 +373,8 @@ var ee = { exports: {} };
|
|
|
373
373
|
* @param {string} language
|
|
374
374
|
* @returns {void}
|
|
375
375
|
*/
|
|
376
|
-
setLanguage: function(
|
|
377
|
-
|
|
376
|
+
setLanguage: function(a, n) {
|
|
377
|
+
a.className = a.className.replace(RegExp(p, "gi"), ""), a.classList.add("language-" + n);
|
|
378
378
|
},
|
|
379
379
|
/**
|
|
380
380
|
* Returns the script element that is currently executing.
|
|
@@ -393,13 +393,13 @@ var ee = { exports: {} };
|
|
|
393
393
|
);
|
|
394
394
|
try {
|
|
395
395
|
throw new Error();
|
|
396
|
-
} catch (
|
|
397
|
-
var
|
|
398
|
-
if (
|
|
396
|
+
} catch (s) {
|
|
397
|
+
var a = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(s.stack) || [])[1];
|
|
398
|
+
if (a) {
|
|
399
399
|
var n = document.getElementsByTagName("script");
|
|
400
|
-
for (var
|
|
401
|
-
if (n[
|
|
402
|
-
return n[
|
|
400
|
+
for (var i in n)
|
|
401
|
+
if (n[i].src == a)
|
|
402
|
+
return n[i];
|
|
403
403
|
}
|
|
404
404
|
return null;
|
|
405
405
|
}
|
|
@@ -423,16 +423,16 @@ var ee = { exports: {} };
|
|
|
423
423
|
* @param {boolean} [defaultActivation=false]
|
|
424
424
|
* @returns {boolean}
|
|
425
425
|
*/
|
|
426
|
-
isActive: function(
|
|
427
|
-
for (var
|
|
428
|
-
var o =
|
|
426
|
+
isActive: function(a, n, i) {
|
|
427
|
+
for (var s = "no-" + n; a; ) {
|
|
428
|
+
var o = a.classList;
|
|
429
429
|
if (o.contains(n))
|
|
430
430
|
return !0;
|
|
431
|
-
if (o.contains(
|
|
431
|
+
if (o.contains(s))
|
|
432
432
|
return !1;
|
|
433
|
-
|
|
433
|
+
a = a.parentElement;
|
|
434
434
|
}
|
|
435
|
-
return !!
|
|
435
|
+
return !!i;
|
|
436
436
|
}
|
|
437
437
|
},
|
|
438
438
|
/**
|
|
@@ -478,11 +478,11 @@ var ee = { exports: {} };
|
|
|
478
478
|
* 'color': /\b(?:red|green|blue)\b/
|
|
479
479
|
* });
|
|
480
480
|
*/
|
|
481
|
-
extend: function(
|
|
482
|
-
var
|
|
483
|
-
for (var
|
|
484
|
-
s
|
|
485
|
-
return
|
|
481
|
+
extend: function(a, n) {
|
|
482
|
+
var i = u.util.clone(u.languages[a]);
|
|
483
|
+
for (var s in n)
|
|
484
|
+
i[s] = n[s];
|
|
485
|
+
return i;
|
|
486
486
|
},
|
|
487
487
|
/**
|
|
488
488
|
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
@@ -559,31 +559,31 @@ var ee = { exports: {} };
|
|
|
559
559
|
* @returns {Grammar} The new grammar object.
|
|
560
560
|
* @public
|
|
561
561
|
*/
|
|
562
|
-
insertBefore: function(
|
|
563
|
-
|
|
562
|
+
insertBefore: function(a, n, i, s) {
|
|
563
|
+
s = s || /** @type {any} */
|
|
564
564
|
u.languages;
|
|
565
|
-
var o =
|
|
565
|
+
var o = s[a], d = {};
|
|
566
566
|
for (var g in o)
|
|
567
567
|
if (o.hasOwnProperty(g)) {
|
|
568
568
|
if (g == n)
|
|
569
|
-
for (var c in
|
|
570
|
-
|
|
571
|
-
|
|
569
|
+
for (var c in i)
|
|
570
|
+
i.hasOwnProperty(c) && (d[c] = i[c]);
|
|
571
|
+
i.hasOwnProperty(g) || (d[g] = o[g]);
|
|
572
572
|
}
|
|
573
|
-
var E =
|
|
574
|
-
return
|
|
575
|
-
|
|
573
|
+
var E = s[a];
|
|
574
|
+
return s[a] = d, u.languages.DFS(u.languages, function(S, F) {
|
|
575
|
+
F === E && S != a && (this[S] = d);
|
|
576
576
|
}), d;
|
|
577
577
|
},
|
|
578
578
|
// Traverse a language definition with Depth First Search
|
|
579
|
-
DFS: function
|
|
579
|
+
DFS: function a(n, i, s, o) {
|
|
580
580
|
o = o || {};
|
|
581
581
|
var d = u.util.objId;
|
|
582
582
|
for (var g in n)
|
|
583
583
|
if (n.hasOwnProperty(g)) {
|
|
584
|
-
|
|
584
|
+
i.call(n, g, n[g], s || g);
|
|
585
585
|
var c = n[g], E = u.util.type(c);
|
|
586
|
-
E === "Object" && !o[d(c)] ? (o[d(c)] = !0,
|
|
586
|
+
E === "Object" && !o[d(c)] ? (o[d(c)] = !0, a(c, i, null, o)) : E === "Array" && !o[d(c)] && (o[d(c)] = !0, a(c, i, g, o));
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
},
|
|
@@ -600,8 +600,8 @@ var ee = { exports: {} };
|
|
|
600
600
|
* @memberof Prism
|
|
601
601
|
* @public
|
|
602
602
|
*/
|
|
603
|
-
highlightAll: function(
|
|
604
|
-
u.highlightAllUnder(document,
|
|
603
|
+
highlightAll: function(a, n) {
|
|
604
|
+
u.highlightAllUnder(document, a, n);
|
|
605
605
|
},
|
|
606
606
|
/**
|
|
607
607
|
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
@@ -618,15 +618,15 @@ var ee = { exports: {} };
|
|
|
618
618
|
* @memberof Prism
|
|
619
619
|
* @public
|
|
620
620
|
*/
|
|
621
|
-
highlightAllUnder: function(
|
|
622
|
-
var
|
|
623
|
-
callback:
|
|
624
|
-
container:
|
|
621
|
+
highlightAllUnder: function(a, n, i) {
|
|
622
|
+
var s = {
|
|
623
|
+
callback: i,
|
|
624
|
+
container: a,
|
|
625
625
|
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
626
626
|
};
|
|
627
|
-
u.hooks.run("before-highlightall",
|
|
628
|
-
for (var o = 0, d; d =
|
|
629
|
-
u.highlightElement(d, n === !0,
|
|
627
|
+
u.hooks.run("before-highlightall", s), s.elements = Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)), u.hooks.run("before-all-elements-highlight", s);
|
|
628
|
+
for (var o = 0, d; d = s.elements[o++]; )
|
|
629
|
+
u.highlightElement(d, n === !0, s.callback);
|
|
630
630
|
},
|
|
631
631
|
/**
|
|
632
632
|
* Highlights the code inside a single element.
|
|
@@ -656,22 +656,22 @@ var ee = { exports: {} };
|
|
|
656
656
|
* @memberof Prism
|
|
657
657
|
* @public
|
|
658
658
|
*/
|
|
659
|
-
highlightElement: function(
|
|
660
|
-
var
|
|
661
|
-
u.util.setLanguage(
|
|
662
|
-
var d =
|
|
663
|
-
d && d.nodeName.toLowerCase() === "pre" && u.util.setLanguage(d,
|
|
664
|
-
var g =
|
|
665
|
-
element:
|
|
666
|
-
language:
|
|
659
|
+
highlightElement: function(a, n, i) {
|
|
660
|
+
var s = u.util.getLanguage(a), o = u.languages[s];
|
|
661
|
+
u.util.setLanguage(a, s);
|
|
662
|
+
var d = a.parentElement;
|
|
663
|
+
d && d.nodeName.toLowerCase() === "pre" && u.util.setLanguage(d, s);
|
|
664
|
+
var g = a.textContent, c = {
|
|
665
|
+
element: a,
|
|
666
|
+
language: s,
|
|
667
667
|
grammar: o,
|
|
668
668
|
code: g
|
|
669
669
|
};
|
|
670
|
-
function E(
|
|
671
|
-
c.highlightedCode =
|
|
670
|
+
function E(F) {
|
|
671
|
+
c.highlightedCode = F, u.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, u.hooks.run("after-highlight", c), u.hooks.run("complete", c), i && i.call(c.element);
|
|
672
672
|
}
|
|
673
673
|
if (u.hooks.run("before-sanity-check", c), d = c.element.parentElement, d && d.nodeName.toLowerCase() === "pre" && !d.hasAttribute("tabindex") && d.setAttribute("tabindex", "0"), !c.code) {
|
|
674
|
-
u.hooks.run("complete", c),
|
|
674
|
+
u.hooks.run("complete", c), i && i.call(c.element);
|
|
675
675
|
return;
|
|
676
676
|
}
|
|
677
677
|
if (u.hooks.run("before-highlight", c), !c.grammar) {
|
|
@@ -680,8 +680,8 @@ var ee = { exports: {} };
|
|
|
680
680
|
}
|
|
681
681
|
if (n && l.Worker) {
|
|
682
682
|
var S = new Worker(u.filename);
|
|
683
|
-
S.onmessage = function(
|
|
684
|
-
E(
|
|
683
|
+
S.onmessage = function(F) {
|
|
684
|
+
E(F.data);
|
|
685
685
|
}, S.postMessage(JSON.stringify({
|
|
686
686
|
language: c.language,
|
|
687
687
|
code: c.code,
|
|
@@ -710,15 +710,15 @@ var ee = { exports: {} };
|
|
|
710
710
|
* @example
|
|
711
711
|
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
712
712
|
*/
|
|
713
|
-
highlight: function(
|
|
714
|
-
var
|
|
715
|
-
code:
|
|
713
|
+
highlight: function(a, n, i) {
|
|
714
|
+
var s = {
|
|
715
|
+
code: a,
|
|
716
716
|
grammar: n,
|
|
717
|
-
language:
|
|
717
|
+
language: i
|
|
718
718
|
};
|
|
719
|
-
if (u.hooks.run("before-tokenize",
|
|
720
|
-
throw new Error('The language "' +
|
|
721
|
-
return
|
|
719
|
+
if (u.hooks.run("before-tokenize", s), !s.grammar)
|
|
720
|
+
throw new Error('The language "' + s.language + '" has no grammar.');
|
|
721
|
+
return s.tokens = u.tokenize(s.code, s.grammar), u.hooks.run("after-tokenize", s), h.stringify(u.util.encode(s.tokens), s.language);
|
|
722
722
|
},
|
|
723
723
|
/**
|
|
724
724
|
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
@@ -744,15 +744,15 @@ var ee = { exports: {} };
|
|
|
744
744
|
* }
|
|
745
745
|
* });
|
|
746
746
|
*/
|
|
747
|
-
tokenize: function(
|
|
748
|
-
var
|
|
749
|
-
if (
|
|
750
|
-
for (var
|
|
751
|
-
n[
|
|
747
|
+
tokenize: function(a, n) {
|
|
748
|
+
var i = n.rest;
|
|
749
|
+
if (i) {
|
|
750
|
+
for (var s in i)
|
|
751
|
+
n[s] = i[s];
|
|
752
752
|
delete n.rest;
|
|
753
753
|
}
|
|
754
754
|
var o = new x();
|
|
755
|
-
return
|
|
755
|
+
return I(o, o.head, a), _(a, o, n, o.head, 0), O(o);
|
|
756
756
|
},
|
|
757
757
|
/**
|
|
758
758
|
* @namespace
|
|
@@ -773,9 +773,9 @@ var ee = { exports: {} };
|
|
|
773
773
|
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
774
774
|
* @public
|
|
775
775
|
*/
|
|
776
|
-
add: function(
|
|
777
|
-
var
|
|
778
|
-
|
|
776
|
+
add: function(a, n) {
|
|
777
|
+
var i = u.hooks.all;
|
|
778
|
+
i[a] = i[a] || [], i[a].push(n);
|
|
779
779
|
},
|
|
780
780
|
/**
|
|
781
781
|
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
@@ -786,35 +786,35 @@ var ee = { exports: {} };
|
|
|
786
786
|
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
787
787
|
* @public
|
|
788
788
|
*/
|
|
789
|
-
run: function(
|
|
790
|
-
var
|
|
791
|
-
if (!(!
|
|
792
|
-
for (var
|
|
789
|
+
run: function(a, n) {
|
|
790
|
+
var i = u.hooks.all[a];
|
|
791
|
+
if (!(!i || !i.length))
|
|
792
|
+
for (var s = 0, o; o = i[s++]; )
|
|
793
793
|
o(n);
|
|
794
794
|
}
|
|
795
795
|
},
|
|
796
796
|
Token: h
|
|
797
797
|
};
|
|
798
798
|
l.Prism = u;
|
|
799
|
-
function h(
|
|
800
|
-
this.type =
|
|
799
|
+
function h(a, n, i, s) {
|
|
800
|
+
this.type = a, this.content = n, this.alias = i, this.length = (s || "").length | 0;
|
|
801
801
|
}
|
|
802
|
-
h.stringify = function
|
|
802
|
+
h.stringify = function a(n, i) {
|
|
803
803
|
if (typeof n == "string")
|
|
804
804
|
return n;
|
|
805
805
|
if (Array.isArray(n)) {
|
|
806
|
-
var
|
|
806
|
+
var s = "";
|
|
807
807
|
return n.forEach(function(E) {
|
|
808
|
-
|
|
809
|
-
}),
|
|
808
|
+
s += a(E, i);
|
|
809
|
+
}), s;
|
|
810
810
|
}
|
|
811
811
|
var o = {
|
|
812
812
|
type: n.type,
|
|
813
|
-
content:
|
|
813
|
+
content: a(n.content, i),
|
|
814
814
|
tag: "span",
|
|
815
815
|
classes: ["token", n.type],
|
|
816
816
|
attributes: {},
|
|
817
|
-
language:
|
|
817
|
+
language: i
|
|
818
818
|
}, d = n.alias;
|
|
819
819
|
d && (Array.isArray(d) ? Array.prototype.push.apply(o.classes, d) : o.classes.push(d)), u.hooks.run("wrap", o);
|
|
820
820
|
var g = "";
|
|
@@ -822,58 +822,58 @@ var ee = { exports: {} };
|
|
|
822
822
|
g += " " + c + '="' + (o.attributes[c] || "").replace(/"/g, """) + '"';
|
|
823
823
|
return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + g + ">" + o.content + "</" + o.tag + ">";
|
|
824
824
|
};
|
|
825
|
-
function A(
|
|
826
|
-
|
|
827
|
-
var o =
|
|
828
|
-
if (o &&
|
|
825
|
+
function A(a, n, i, s) {
|
|
826
|
+
a.lastIndex = n;
|
|
827
|
+
var o = a.exec(i);
|
|
828
|
+
if (o && s && o[1]) {
|
|
829
829
|
var d = o[1].length;
|
|
830
830
|
o.index += d, o[0] = o[0].slice(d);
|
|
831
831
|
}
|
|
832
832
|
return o;
|
|
833
833
|
}
|
|
834
|
-
function
|
|
835
|
-
for (var g in
|
|
836
|
-
if (!(!
|
|
837
|
-
var c =
|
|
834
|
+
function _(a, n, i, s, o, d) {
|
|
835
|
+
for (var g in i)
|
|
836
|
+
if (!(!i.hasOwnProperty(g) || !i[g])) {
|
|
837
|
+
var c = i[g];
|
|
838
838
|
c = Array.isArray(c) ? c : [c];
|
|
839
839
|
for (var E = 0; E < c.length; ++E) {
|
|
840
840
|
if (d && d.cause == g + "," + E)
|
|
841
841
|
return;
|
|
842
|
-
var S = c[E],
|
|
842
|
+
var S = c[E], F = S.inside, X = !!S.lookbehind, Z = !!S.greedy, ee = S.alias;
|
|
843
843
|
if (Z && !S.pattern.global) {
|
|
844
|
-
var
|
|
845
|
-
S.pattern = RegExp(S.pattern.source,
|
|
844
|
+
var te = S.pattern.toString().match(/[imsuy]*$/)[0];
|
|
845
|
+
S.pattern = RegExp(S.pattern.source, te + "g");
|
|
846
846
|
}
|
|
847
|
-
for (var K = S.pattern || S, T =
|
|
847
|
+
for (var K = S.pattern || S, T = s.next, k = o; T !== n.tail && !(d && k >= d.reach); k += T.value.length, T = T.next) {
|
|
848
848
|
var C = T.value;
|
|
849
|
-
if (n.length >
|
|
849
|
+
if (n.length > a.length)
|
|
850
850
|
return;
|
|
851
851
|
if (!(C instanceof h)) {
|
|
852
852
|
var N = 1, w;
|
|
853
853
|
if (Z) {
|
|
854
|
-
if (w = A(K,
|
|
854
|
+
if (w = A(K, k, a, X), !w || w.index >= a.length)
|
|
855
855
|
break;
|
|
856
|
-
var D = w.index,
|
|
857
|
-
for (
|
|
858
|
-
T = T.next,
|
|
859
|
-
if (
|
|
856
|
+
var D = w.index, ne = w.index + w[0].length, R = k;
|
|
857
|
+
for (R += T.value.length; D >= R; )
|
|
858
|
+
T = T.next, R += T.value.length;
|
|
859
|
+
if (R -= T.value.length, k = R, T.value instanceof h)
|
|
860
860
|
continue;
|
|
861
|
-
for (var L = T; L !== n.tail && (
|
|
862
|
-
N++,
|
|
863
|
-
N--, C =
|
|
861
|
+
for (var L = T; L !== n.tail && (R < ne || typeof L.value == "string"); L = L.next)
|
|
862
|
+
N++, R += L.value.length;
|
|
863
|
+
N--, C = a.slice(k, R), w.index -= k;
|
|
864
864
|
} else if (w = A(K, 0, C, X), !w)
|
|
865
865
|
continue;
|
|
866
|
-
var D = w.index, P = w[0], H = C.slice(0, D), V = C.slice(D + P.length), B =
|
|
866
|
+
var D = w.index, P = w[0], H = C.slice(0, D), V = C.slice(D + P.length), B = k + C.length;
|
|
867
867
|
d && B > d.reach && (d.reach = B);
|
|
868
868
|
var $ = T.prev;
|
|
869
|
-
H && ($ =
|
|
870
|
-
var re = new h(g,
|
|
871
|
-
if (T =
|
|
869
|
+
H && ($ = I(n, $, H), k += H.length), U(n, $, N);
|
|
870
|
+
var re = new h(g, F ? u.tokenize(P, F) : P, ee, P);
|
|
871
|
+
if (T = I(n, $, re), V && I(n, T, V), N > 1) {
|
|
872
872
|
var G = {
|
|
873
873
|
cause: g + "," + E,
|
|
874
874
|
reach: B
|
|
875
875
|
};
|
|
876
|
-
|
|
876
|
+
_(a, n, i, T.prev, k, G), d && G.reach > d.reach && (d.reach = G.reach);
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
879
|
}
|
|
@@ -881,27 +881,27 @@ var ee = { exports: {} };
|
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
function x() {
|
|
884
|
-
var
|
|
885
|
-
|
|
884
|
+
var a = { value: null, prev: null, next: null }, n = { value: null, prev: a, next: null };
|
|
885
|
+
a.next = n, this.head = a, this.tail = n, this.length = 0;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
888
|
-
var
|
|
889
|
-
return n.next = o,
|
|
887
|
+
function I(a, n, i) {
|
|
888
|
+
var s = n.next, o = { value: i, prev: n, next: s };
|
|
889
|
+
return n.next = o, s.prev = o, a.length++, o;
|
|
890
890
|
}
|
|
891
|
-
function U(
|
|
892
|
-
for (var
|
|
893
|
-
|
|
894
|
-
n.next =
|
|
891
|
+
function U(a, n, i) {
|
|
892
|
+
for (var s = n.next, o = 0; o < i && s !== a.tail; o++)
|
|
893
|
+
s = s.next;
|
|
894
|
+
n.next = s, s.prev = n, a.length -= o;
|
|
895
895
|
}
|
|
896
|
-
function O(
|
|
897
|
-
for (var n = [],
|
|
898
|
-
n.push(
|
|
896
|
+
function O(a) {
|
|
897
|
+
for (var n = [], i = a.head.next; i !== a.tail; )
|
|
898
|
+
n.push(i.value), i = i.next;
|
|
899
899
|
return n;
|
|
900
900
|
}
|
|
901
901
|
if (!l.document)
|
|
902
|
-
return l.addEventListener && (u.disableWorkerMessageHandler || l.addEventListener("message", function(
|
|
903
|
-
var n = JSON.parse(
|
|
904
|
-
l.postMessage(u.highlight(
|
|
902
|
+
return l.addEventListener && (u.disableWorkerMessageHandler || l.addEventListener("message", function(a) {
|
|
903
|
+
var n = JSON.parse(a.data), i = n.language, s = n.code, o = n.immediateClose;
|
|
904
|
+
l.postMessage(u.highlight(s, u.languages[i], i)), o && l.close();
|
|
905
905
|
}, !1)), u;
|
|
906
906
|
var v = u.util.currentScript();
|
|
907
907
|
v && (u.filename = v.src, v.hasAttribute("data-manual") && (u.manual = !0));
|
|
@@ -914,7 +914,7 @@ var ee = { exports: {} };
|
|
|
914
914
|
}
|
|
915
915
|
return u;
|
|
916
916
|
}(e);
|
|
917
|
-
|
|
917
|
+
r.exports && (r.exports = t), typeof J < "u" && (J.Prism = t), t.languages.markup = {
|
|
918
918
|
comment: {
|
|
919
919
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
920
920
|
greedy: !0
|
|
@@ -1304,18 +1304,18 @@ var ee = { exports: {} };
|
|
|
1304
1304
|
bat: "batch",
|
|
1305
1305
|
h: "c",
|
|
1306
1306
|
tex: "latex"
|
|
1307
|
-
}, u = "data-src-status", h = "loading", A = "loaded",
|
|
1308
|
-
function
|
|
1309
|
-
var
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
},
|
|
1307
|
+
}, u = "data-src-status", h = "loading", A = "loaded", _ = "failed", x = "pre[data-src]:not([" + u + '="' + A + '"]):not([' + u + '="' + h + '"])';
|
|
1308
|
+
function I(v, m, y) {
|
|
1309
|
+
var a = new XMLHttpRequest();
|
|
1310
|
+
a.open("GET", v, !0), a.onreadystatechange = function() {
|
|
1311
|
+
a.readyState == 4 && (a.status < 400 && a.responseText ? m(a.responseText) : a.status >= 400 ? y(p(a.status, a.statusText)) : y(f));
|
|
1312
|
+
}, a.send(null);
|
|
1313
1313
|
}
|
|
1314
1314
|
function U(v) {
|
|
1315
1315
|
var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v || "");
|
|
1316
1316
|
if (m) {
|
|
1317
|
-
var y = Number(m[1]),
|
|
1318
|
-
return
|
|
1317
|
+
var y = Number(m[1]), a = m[2], n = m[3];
|
|
1318
|
+
return a ? n ? [y, Number(n)] : [y, void 0] : [y, y];
|
|
1319
1319
|
}
|
|
1320
1320
|
}
|
|
1321
1321
|
t.hooks.add("before-highlightall", function(v) {
|
|
@@ -1329,15 +1329,15 @@ var ee = { exports: {} };
|
|
|
1329
1329
|
v.code = "", m.setAttribute(u, h);
|
|
1330
1330
|
var y = m.appendChild(document.createElement("CODE"));
|
|
1331
1331
|
y.textContent = l;
|
|
1332
|
-
var
|
|
1332
|
+
var a = m.getAttribute("data-src"), n = v.language;
|
|
1333
1333
|
if (n === "none") {
|
|
1334
|
-
var
|
|
1335
|
-
n = b[
|
|
1334
|
+
var i = (/\.(\w+)$/.exec(a) || [, "none"])[1];
|
|
1335
|
+
n = b[i] || i;
|
|
1336
1336
|
}
|
|
1337
1337
|
t.util.setLanguage(y, n), t.util.setLanguage(m, n);
|
|
1338
|
-
var
|
|
1339
|
-
|
|
1340
|
-
|
|
1338
|
+
var s = t.plugins.autoloader;
|
|
1339
|
+
s && s.loadLanguages(n), I(
|
|
1340
|
+
a,
|
|
1341
1341
|
function(o) {
|
|
1342
1342
|
m.setAttribute(u, A);
|
|
1343
1343
|
var d = U(m.getAttribute("data-range"));
|
|
@@ -1349,7 +1349,7 @@ var ee = { exports: {} };
|
|
|
1349
1349
|
y.textContent = o, t.highlightElement(y);
|
|
1350
1350
|
},
|
|
1351
1351
|
function(o) {
|
|
1352
|
-
m.setAttribute(u,
|
|
1352
|
+
m.setAttribute(u, _), y.textContent = o;
|
|
1353
1353
|
}
|
|
1354
1354
|
);
|
|
1355
1355
|
}
|
|
@@ -1362,7 +1362,7 @@ var ee = { exports: {} };
|
|
|
1362
1362
|
* @param {ParentNode} [container=document]
|
|
1363
1363
|
*/
|
|
1364
1364
|
highlight: function(m) {
|
|
1365
|
-
for (var y = (m || document).querySelectorAll(x),
|
|
1365
|
+
for (var y = (m || document).querySelectorAll(x), a = 0, n; n = y[a++]; )
|
|
1366
1366
|
t.highlightElement(n);
|
|
1367
1367
|
}
|
|
1368
1368
|
};
|
|
@@ -1371,9 +1371,9 @@ var ee = { exports: {} };
|
|
|
1371
1371
|
O || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), O = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1372
1372
|
};
|
|
1373
1373
|
}();
|
|
1374
|
-
})(
|
|
1375
|
-
var
|
|
1376
|
-
const j = /* @__PURE__ */ ue
|
|
1374
|
+
})(Q);
|
|
1375
|
+
var ue = Q.exports;
|
|
1376
|
+
const j = /* @__PURE__ */ le(ue);
|
|
1377
1377
|
Prism.languages.clike = {
|
|
1378
1378
|
comment: [
|
|
1379
1379
|
{
|
|
@@ -1631,7 +1631,7 @@ Prism.languages.insertBefore("go", "string", {
|
|
|
1631
1631
|
}
|
|
1632
1632
|
});
|
|
1633
1633
|
delete Prism.languages.go["class-name"];
|
|
1634
|
-
(function(
|
|
1634
|
+
(function(r) {
|
|
1635
1635
|
var e = /\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/, t = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = {
|
|
1636
1636
|
pattern: RegExp(/(^|[^\w.])/.source + t + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
|
|
1637
1637
|
lookbehind: !0,
|
|
@@ -1645,7 +1645,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1645
1645
|
punctuation: /\./
|
|
1646
1646
|
}
|
|
1647
1647
|
};
|
|
1648
|
-
|
|
1648
|
+
r.languages.java = r.languages.extend("clike", {
|
|
1649
1649
|
string: {
|
|
1650
1650
|
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
|
|
1651
1651
|
lookbehind: !0,
|
|
@@ -1670,7 +1670,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1670
1670
|
],
|
|
1671
1671
|
keyword: e,
|
|
1672
1672
|
function: [
|
|
1673
|
-
|
|
1673
|
+
r.languages.clike.function,
|
|
1674
1674
|
{
|
|
1675
1675
|
pattern: /(::\s*)[a-z_]\w*/,
|
|
1676
1676
|
lookbehind: !0
|
|
@@ -1682,7 +1682,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1682
1682
|
lookbehind: !0
|
|
1683
1683
|
},
|
|
1684
1684
|
constant: /\b[A-Z][A-Z_\d]+\b/
|
|
1685
|
-
}),
|
|
1685
|
+
}), r.languages.insertBefore("java", "string", {
|
|
1686
1686
|
"triple-quoted-string": {
|
|
1687
1687
|
// http://openjdk.java.net/jeps/355#Description
|
|
1688
1688
|
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
|
|
@@ -1693,7 +1693,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1693
1693
|
pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
|
|
1694
1694
|
greedy: !0
|
|
1695
1695
|
}
|
|
1696
|
-
}),
|
|
1696
|
+
}), r.languages.insertBefore("java", "class-name", {
|
|
1697
1697
|
annotation: {
|
|
1698
1698
|
pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
|
|
1699
1699
|
lookbehind: !0,
|
|
@@ -1821,14 +1821,14 @@ Prism.languages.insertBefore("c", "function", {
|
|
|
1821
1821
|
constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
|
|
1822
1822
|
});
|
|
1823
1823
|
delete Prism.languages.c.boolean;
|
|
1824
|
-
(function(
|
|
1824
|
+
(function(r) {
|
|
1825
1825
|
for (var e = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, t = 0; t < 2; t++)
|
|
1826
1826
|
e = e.replace(/<self>/g, function() {
|
|
1827
1827
|
return e;
|
|
1828
1828
|
});
|
|
1829
1829
|
e = e.replace(/<self>/g, function() {
|
|
1830
1830
|
return /[^\s\S]/.source;
|
|
1831
|
-
}),
|
|
1831
|
+
}), r.languages.rust = {
|
|
1832
1832
|
comment: [
|
|
1833
1833
|
{
|
|
1834
1834
|
pattern: RegExp(/(^|[^\\])/.source + e),
|
|
@@ -1935,7 +1935,7 @@ delete Prism.languages.c.boolean;
|
|
|
1935
1935
|
boolean: /\b(?:false|true)\b/,
|
|
1936
1936
|
punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
|
|
1937
1937
|
operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
|
|
1938
|
-
},
|
|
1938
|
+
}, r.languages.rust["closure-params"].inside.rest = r.languages.rust, r.languages.rust.attribute.inside.string = r.languages.rust.string;
|
|
1939
1939
|
})(Prism);
|
|
1940
1940
|
Prism.languages.sql = {
|
|
1941
1941
|
comment: {
|
|
@@ -1970,7 +1970,7 @@ Prism.languages.sql = {
|
|
|
1970
1970
|
operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
|
|
1971
1971
|
punctuation: /[;[\]()`,.]/
|
|
1972
1972
|
};
|
|
1973
|
-
(function(
|
|
1973
|
+
(function(r) {
|
|
1974
1974
|
var e = "\\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", t = {
|
|
1975
1975
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
1976
1976
|
lookbehind: !0,
|
|
@@ -2032,7 +2032,7 @@ Prism.languages.sql = {
|
|
|
2032
2032
|
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
2033
2033
|
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
2034
2034
|
};
|
|
2035
|
-
|
|
2035
|
+
r.languages.bash = {
|
|
2036
2036
|
shebang: {
|
|
2037
2037
|
pattern: /^#!\s*\/.*/,
|
|
2038
2038
|
alias: "important"
|
|
@@ -2168,7 +2168,7 @@ Prism.languages.sql = {
|
|
|
2168
2168
|
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
2169
2169
|
lookbehind: !0
|
|
2170
2170
|
}
|
|
2171
|
-
}, t.inside =
|
|
2171
|
+
}, t.inside = r.languages.bash;
|
|
2172
2172
|
for (var p = [
|
|
2173
2173
|
"comment",
|
|
2174
2174
|
"function-name",
|
|
@@ -2186,8 +2186,8 @@ Prism.languages.sql = {
|
|
|
2186
2186
|
"punctuation",
|
|
2187
2187
|
"number"
|
|
2188
2188
|
], f = l.variable[1].inside, b = 0; b < p.length; b++)
|
|
2189
|
-
f[p[b]] =
|
|
2190
|
-
|
|
2189
|
+
f[p[b]] = r.languages.bash[p[b]];
|
|
2190
|
+
r.languages.sh = r.languages.bash, r.languages.shell = r.languages.bash;
|
|
2191
2191
|
})(Prism);
|
|
2192
2192
|
Prism.languages.json = {
|
|
2193
2193
|
property: {
|
|
@@ -2214,26 +2214,132 @@ Prism.languages.json = {
|
|
|
2214
2214
|
}
|
|
2215
2215
|
};
|
|
2216
2216
|
Prism.languages.webmanifest = Prism.languages.json;
|
|
2217
|
-
|
|
2218
|
-
|
|
2217
|
+
const ce = `
|
|
2218
|
+
.hep-cr-editor .token.comment,
|
|
2219
|
+
.hep-cr-editor .token.prolog,
|
|
2220
|
+
.hep-cr-editor .token.doctype,
|
|
2221
|
+
.hep-cr-editor .token.cdata {
|
|
2222
|
+
color: #8292a2;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
.hep-cr-editor .token.punctuation {
|
|
2226
|
+
color: #f8f8f2;
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
.hep-cr-editor .token.property,
|
|
2230
|
+
.hep-cr-editor .token.tag,
|
|
2231
|
+
.hep-cr-editor .token.constant,
|
|
2232
|
+
.hep-cr-editor .token.symbol,
|
|
2233
|
+
.hep-cr-editor .token.deleted {
|
|
2234
|
+
color: #f92672;
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
.hep-cr-editor .token.boolean,
|
|
2238
|
+
.hep-cr-editor .token.number {
|
|
2239
|
+
color: #ae81ff;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
.hep-cr-editor .token.selector,
|
|
2243
|
+
.hep-cr-editor .token.attr-name,
|
|
2244
|
+
.hep-cr-editor .token.string,
|
|
2245
|
+
.hep-cr-editor .token.char,
|
|
2246
|
+
.hep-cr-editor .token.builtin,
|
|
2247
|
+
.hep-cr-editor .token.inserted {
|
|
2248
|
+
color: #a6e22e;
|
|
2249
|
+
}
|
|
2250
|
+
|
|
2251
|
+
.hep-cr-editor .token.operator,
|
|
2252
|
+
.hep-cr-editor .token.entity,
|
|
2253
|
+
.hep-cr-editor .token.url,
|
|
2254
|
+
.hep-cr-editor .language-css .hep-cr-editor .token.string,
|
|
2255
|
+
.hep-cr-editor .style .hep-cr-editor .token.string,
|
|
2256
|
+
.hep-cr-editor .token.variable {
|
|
2257
|
+
color: #f8f8f2;
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
.hep-cr-editor .token.atrule,
|
|
2261
|
+
.hep-cr-editor .token.attr-value,
|
|
2262
|
+
.hep-cr-editor .token.function,
|
|
2263
|
+
.hep-cr-editor .token.class-name {
|
|
2264
|
+
color: #e6db74;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
.hep-cr-editor .token.keyword {
|
|
2268
|
+
color: #66d9ef;
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
.hep-cr-editor .token.regex,
|
|
2272
|
+
.hep-cr-editor .token.important {
|
|
2273
|
+
color: #fd971f;
|
|
2274
|
+
}
|
|
2275
|
+
`, de = `
|
|
2276
|
+
.hep-cr-editor .token.comment,
|
|
2277
|
+
.hep-cr-editor .token.prolog,
|
|
2278
|
+
.hep-cr-editor .token.doctype,
|
|
2279
|
+
.hep-cr-editor .token.cdata {
|
|
2280
|
+
color: #708090;
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
.hep-cr-editor .token.punctuation {
|
|
2284
|
+
color: #333;
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
.hep-cr-editor .token.property,
|
|
2288
|
+
.hep-cr-editor .token.tag,
|
|
2289
|
+
.hep-cr-editor .token.constant,
|
|
2290
|
+
.hep-cr-editor .token.symbol,
|
|
2291
|
+
.hep-cr-editor .token.deleted {
|
|
2292
|
+
color: #d73a49;
|
|
2293
|
+
}
|
|
2294
|
+
|
|
2295
|
+
.hep-cr-editor .token.boolean,
|
|
2296
|
+
.hep-cr-editor .token.number {
|
|
2297
|
+
color: #005cc5;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
.hep-cr-editor .token.selector,
|
|
2301
|
+
.hep-cr-editor .token.attr-name,
|
|
2302
|
+
.hep-cr-editor .token.string,
|
|
2303
|
+
.hep-cr-editor .token.char,
|
|
2304
|
+
.hep-cr-editor .token.builtin,
|
|
2305
|
+
.hep-cr-editor .token.inserted {
|
|
2306
|
+
color: #22863a;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
.hep-cr-editor .token.operator,
|
|
2310
|
+
.hep-cr-editor .token.entity,
|
|
2311
|
+
.hep-cr-editor .token.url,
|
|
2312
|
+
.hep-cr-editor .language-css .hep-cr-editor .token.string,
|
|
2313
|
+
.hep-cr-editor .style .hep-cr-editor .token.string,
|
|
2314
|
+
.hep-cr-editor .token.variable {
|
|
2315
|
+
color: #333;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
.hep-cr-editor .token.atrule,
|
|
2319
|
+
.hep-cr-editor .token.attr-value,
|
|
2320
|
+
.hep-cr-editor .token.function,
|
|
2321
|
+
.hep-cr-editor .token.class-name {
|
|
2322
|
+
color: #6f42c1;
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
.hep-cr-editor .token.keyword {
|
|
2326
|
+
color: #d73a49;
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
.hep-cr-editor .token.regex,
|
|
2330
|
+
.hep-cr-editor .token.important {
|
|
2331
|
+
color: #e36209;
|
|
2332
|
+
}
|
|
2333
|
+
`;
|
|
2334
|
+
function Y(r, e, t, l, p, f, b, u) {
|
|
2335
|
+
var h = typeof r == "function" ? r.options : r;
|
|
2219
2336
|
return e && (h.render = e, h.staticRenderFns = t, h._compiled = !0), f && (h._scopeId = "data-v-" + f), {
|
|
2220
|
-
exports:
|
|
2337
|
+
exports: r,
|
|
2221
2338
|
options: h
|
|
2222
2339
|
};
|
|
2223
2340
|
}
|
|
2224
|
-
function Q(a) {
|
|
2225
|
-
if (!(typeof document > "u")) {
|
|
2226
|
-
var e = a === "dark" ? "prism-okaidia" : "prism", t = document.getElementById("prism-theme-style"), l = "https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/" + e + ".min.css";
|
|
2227
|
-
if (t)
|
|
2228
|
-
t.setAttribute("href", l);
|
|
2229
|
-
else {
|
|
2230
|
-
var p = document.createElement("link");
|
|
2231
|
-
p.id = "prism-theme-style", p.rel = "stylesheet", p.href = l, document.head.appendChild(p);
|
|
2232
|
-
}
|
|
2233
|
-
}
|
|
2234
|
-
}
|
|
2235
2341
|
typeof window < "u" && (window.Prism = j);
|
|
2236
|
-
const
|
|
2342
|
+
const pe = {
|
|
2237
2343
|
name: "CodeEditor",
|
|
2238
2344
|
props: {
|
|
2239
2345
|
value: {
|
|
@@ -2258,6 +2364,14 @@ const de = {
|
|
|
2258
2364
|
highlightRef: null
|
|
2259
2365
|
};
|
|
2260
2366
|
},
|
|
2367
|
+
mounted() {
|
|
2368
|
+
this.loadPrismTheme(this.theme);
|
|
2369
|
+
},
|
|
2370
|
+
watch: {
|
|
2371
|
+
theme(r) {
|
|
2372
|
+
this.loadPrismTheme(r);
|
|
2373
|
+
}
|
|
2374
|
+
},
|
|
2261
2375
|
computed: {
|
|
2262
2376
|
languageMap: function() {
|
|
2263
2377
|
return {
|
|
@@ -2301,11 +2415,11 @@ const de = {
|
|
|
2301
2415
|
},
|
|
2302
2416
|
highlightedCode: function() {
|
|
2303
2417
|
try {
|
|
2304
|
-
var
|
|
2305
|
-
if (
|
|
2418
|
+
var r = j.languages[this.prismLanguage];
|
|
2419
|
+
if (r)
|
|
2306
2420
|
return j.highlight(
|
|
2307
2421
|
this.value || "",
|
|
2308
|
-
|
|
2422
|
+
r,
|
|
2309
2423
|
this.prismLanguage
|
|
2310
2424
|
);
|
|
2311
2425
|
} catch {
|
|
@@ -2313,50 +2427,48 @@ const de = {
|
|
|
2313
2427
|
return this.escapeHtml(this.value || "");
|
|
2314
2428
|
}
|
|
2315
2429
|
},
|
|
2316
|
-
watch: {
|
|
2317
|
-
theme: function(a) {
|
|
2318
|
-
Q(a);
|
|
2319
|
-
}
|
|
2320
|
-
},
|
|
2321
|
-
mounted: function() {
|
|
2322
|
-
Q(this.theme);
|
|
2323
|
-
},
|
|
2324
2430
|
methods: {
|
|
2325
|
-
|
|
2431
|
+
loadPrismTheme(r) {
|
|
2432
|
+
const e = "hep-cr-prism-styles";
|
|
2433
|
+
let t = document.getElementById(e);
|
|
2434
|
+
const l = r === "dark" ? ce : de;
|
|
2435
|
+
t ? t.textContent = l : (t = document.createElement("style"), t.id = e, t.textContent = l, document.head.appendChild(t));
|
|
2436
|
+
},
|
|
2437
|
+
escapeHtml: function(r) {
|
|
2326
2438
|
var e = document.createElement("div");
|
|
2327
|
-
return e.textContent =
|
|
2439
|
+
return e.textContent = r, e.innerHTML;
|
|
2328
2440
|
},
|
|
2329
|
-
handleInput: function(
|
|
2330
|
-
this.$emit("input",
|
|
2441
|
+
handleInput: function(r) {
|
|
2442
|
+
this.$emit("input", r.target.value), this.$emit("update:value", r.target.value);
|
|
2331
2443
|
},
|
|
2332
|
-
handleScroll: function(
|
|
2444
|
+
handleScroll: function(r) {
|
|
2333
2445
|
var e = this.$refs.highlightRef;
|
|
2334
|
-
e && (e.scrollTop =
|
|
2446
|
+
e && (e.scrollTop = r.target.scrollTop, e.scrollLeft = r.target.scrollLeft);
|
|
2335
2447
|
},
|
|
2336
|
-
handleKeydown: function(
|
|
2337
|
-
if (
|
|
2338
|
-
|
|
2339
|
-
var e =
|
|
2448
|
+
handleKeydown: function(r) {
|
|
2449
|
+
if (r.key === "Tab") {
|
|
2450
|
+
r.preventDefault();
|
|
2451
|
+
var e = r.target, t = e.selectionStart, l = e.selectionEnd, p = e.value;
|
|
2340
2452
|
e.value = p.substring(0, t) + " " + p.substring(l), e.selectionStart = e.selectionEnd = t + 2, this.$emit("input", e.value), this.$emit("update:value", e.value);
|
|
2341
2453
|
}
|
|
2342
2454
|
}
|
|
2343
2455
|
}
|
|
2344
2456
|
};
|
|
2345
|
-
var
|
|
2457
|
+
var ge = function() {
|
|
2346
2458
|
var e = this, t = e._self._c;
|
|
2347
2459
|
return t("div", { staticClass: "hep-cr-editor", class: "hep-cr-theme-" + e.theme, style: { background: e.editorBackground } }, [t("pre", { ref: "highlightRef", staticClass: "hep-cr-highlight", class: "language-" + e.prismLanguage, attrs: { "aria-hidden": "true" } }, [t("code", { domProps: { innerHTML: e._s(e.highlightedCode) } })]), t("textarea", { staticClass: "hep-cr-input", attrs: { disabled: e.disabled, spellcheck: "false", placeholder: "Write your code here..." }, domProps: { value: e.value }, on: { input: e.handleInput, scroll: e.handleScroll, keydown: e.handleKeydown } })]);
|
|
2348
|
-
},
|
|
2349
|
-
de,
|
|
2460
|
+
}, he = [], fe = /* @__PURE__ */ Y(
|
|
2350
2461
|
pe,
|
|
2351
2462
|
ge,
|
|
2463
|
+
he,
|
|
2352
2464
|
!1,
|
|
2353
2465
|
null,
|
|
2354
|
-
"
|
|
2466
|
+
"ef521764"
|
|
2355
2467
|
);
|
|
2356
|
-
const
|
|
2468
|
+
const me = fe.exports, be = {
|
|
2357
2469
|
name: "CodeRunner",
|
|
2358
2470
|
components: {
|
|
2359
|
-
CodeEditor:
|
|
2471
|
+
CodeEditor: me
|
|
2360
2472
|
},
|
|
2361
2473
|
props: {
|
|
2362
2474
|
pistonUrl: {
|
|
@@ -2370,8 +2482,8 @@ const fe = he.exports, me = {
|
|
|
2370
2482
|
theme: {
|
|
2371
2483
|
type: String,
|
|
2372
2484
|
default: "light",
|
|
2373
|
-
validator: function(
|
|
2374
|
-
return ["light", "dark"].indexOf(
|
|
2485
|
+
validator: function(r) {
|
|
2486
|
+
return ["light", "dark"].indexOf(r) !== -1;
|
|
2375
2487
|
}
|
|
2376
2488
|
},
|
|
2377
2489
|
showLanguageSelector: {
|
|
@@ -2417,59 +2529,59 @@ const fe = he.exports, me = {
|
|
|
2417
2529
|
return "hep-cr-runner-" + this.currentTheme;
|
|
2418
2530
|
},
|
|
2419
2531
|
languageOptions: function() {
|
|
2420
|
-
return this.runtimes.map(function(
|
|
2532
|
+
return this.runtimes.map(function(r) {
|
|
2421
2533
|
return {
|
|
2422
|
-
value:
|
|
2423
|
-
label:
|
|
2534
|
+
value: r.language + ":" + r.version,
|
|
2535
|
+
label: r.language.charAt(0).toUpperCase() + r.language.slice(1) + " " + r.version
|
|
2424
2536
|
};
|
|
2425
2537
|
});
|
|
2426
2538
|
},
|
|
2427
2539
|
languageName: function() {
|
|
2428
|
-
var
|
|
2429
|
-
return
|
|
2540
|
+
var r = this.currentLanguage;
|
|
2541
|
+
return r.includes(":") ? r.split(":")[0] : r;
|
|
2430
2542
|
}
|
|
2431
2543
|
},
|
|
2432
2544
|
watch: {
|
|
2433
|
-
currentLanguage: function(
|
|
2434
|
-
var e =
|
|
2545
|
+
currentLanguage: function(r) {
|
|
2546
|
+
var e = r.includes(":") ? r.split(":")[0] : r;
|
|
2435
2547
|
this.code = z(e), this.$emit("language-change", e, this.code);
|
|
2436
2548
|
}
|
|
2437
2549
|
},
|
|
2438
2550
|
mounted: function() {
|
|
2439
|
-
this.client = new
|
|
2551
|
+
this.client = new se({ pistonUrl: this.pistonUrl }), this.loadRuntimes();
|
|
2440
2552
|
},
|
|
2441
2553
|
methods: {
|
|
2442
2554
|
loadRuntimes: function() {
|
|
2443
|
-
var
|
|
2555
|
+
var r = this;
|
|
2444
2556
|
this.runtimesLoading = !0, this.error = null, this.client.getRuntimes().then(function(e) {
|
|
2445
|
-
|
|
2557
|
+
r.runtimes = e;
|
|
2446
2558
|
}).catch(function(e) {
|
|
2447
|
-
|
|
2559
|
+
r.error = e.message || "Failed to load runtimes";
|
|
2448
2560
|
}).finally(function() {
|
|
2449
|
-
|
|
2561
|
+
r.runtimesLoading = !1;
|
|
2450
2562
|
});
|
|
2451
2563
|
},
|
|
2452
2564
|
execute: function() {
|
|
2453
|
-
var
|
|
2565
|
+
var r = this;
|
|
2454
2566
|
this.isRunning || (this.isRunning = !0, this.output = "", this.stderr = "", this.executionTime = null, this.error = null, this.activeTab = "stdout", this.$emit("execute-start"), this.client.execute(this.languageName, this.code).then(function(e) {
|
|
2455
|
-
|
|
2567
|
+
r.output = e.output, r.stderr = e.stderr, r.executionTime = e.executionTime || null, r.activeTab = e.stderr ? "stderr" : "stdout", r.$emit("execute-end", e);
|
|
2456
2568
|
}).catch(function(e) {
|
|
2457
|
-
|
|
2569
|
+
r.error = e.message || "Execution failed", r.$emit("execute-end", {
|
|
2458
2570
|
success: !1,
|
|
2459
2571
|
output: "",
|
|
2460
|
-
stderr:
|
|
2572
|
+
stderr: r.error,
|
|
2461
2573
|
code: -1
|
|
2462
2574
|
});
|
|
2463
2575
|
}).finally(function() {
|
|
2464
|
-
|
|
2576
|
+
r.isRunning = !1;
|
|
2465
2577
|
}));
|
|
2466
2578
|
},
|
|
2467
2579
|
clearOutput: function() {
|
|
2468
2580
|
this.output = "", this.stderr = "", this.executionTime = null, this.error = null;
|
|
2469
2581
|
},
|
|
2470
2582
|
copyOutput: function() {
|
|
2471
|
-
var
|
|
2472
|
-
navigator.clipboard.writeText(
|
|
2583
|
+
var r = this.activeTab === "stdout" ? this.output : this.stderr;
|
|
2584
|
+
navigator.clipboard.writeText(r);
|
|
2473
2585
|
},
|
|
2474
2586
|
resetCode: function() {
|
|
2475
2587
|
this.code = z(this.languageName);
|
|
@@ -2477,7 +2589,7 @@ const fe = he.exports, me = {
|
|
|
2477
2589
|
toggleTheme: function() {
|
|
2478
2590
|
this.currentTheme = this.currentTheme === "light" ? "dark" : "light";
|
|
2479
2591
|
},
|
|
2480
|
-
startDrag: function(
|
|
2592
|
+
startDrag: function(r) {
|
|
2481
2593
|
var e = this, t = document.querySelector(".hep-cr-runner-main");
|
|
2482
2594
|
if (t) {
|
|
2483
2595
|
var l = function(f) {
|
|
@@ -2491,7 +2603,7 @@ const fe = he.exports, me = {
|
|
|
2491
2603
|
}
|
|
2492
2604
|
}
|
|
2493
2605
|
};
|
|
2494
|
-
var
|
|
2606
|
+
var Ee = function() {
|
|
2495
2607
|
var e = this, t = e._self._c;
|
|
2496
2608
|
return t("div", { class: ["hep-cr-runner", e.themeClass] }, [t("div", { staticClass: "hep-cr-runner-header" }, [t("div", { staticClass: "hep-cr-runner-controls" }, [e.showLanguageSelector ? t("select", { directives: [{ name: "model", rawName: "v-model", value: e.currentLanguage, expression: "currentLanguage" }], staticClass: "hep-cr-language-select", attrs: { disabled: e.isRunning }, on: { change: function(l) {
|
|
2497
2609
|
var p = Array.prototype.filter.call(l.target.options, function(f) {
|
|
@@ -2510,15 +2622,15 @@ var be = function() {
|
|
|
2510
2622
|
} } }, [e._v(" 输出 ")]), e.stderr ? t("button", { class: ["hep-cr-tab", { active: e.activeTab === "stderr" }], on: { click: function(l) {
|
|
2511
2623
|
e.activeTab = "stderr";
|
|
2512
2624
|
} } }, [e._v(" 错误 ")]) : e._e()]), t("div", { staticClass: "hep-cr-output-actions" }, [e.executionTime !== null ? t("span", { staticClass: "hep-cr-execution-time" }, [e._v(" " + e._s(e.executionTime) + "ms ")]) : e._e(), t("button", { staticClass: "hep-cr-btn-icon", attrs: { title: "复制" }, on: { click: e.copyOutput } }, [t("svg", { attrs: { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" } }, [t("rect", { attrs: { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" } }), t("path", { attrs: { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" } })])]), t("button", { staticClass: "hep-cr-btn-icon", attrs: { title: "清除" }, on: { click: e.clearOutput } }, [t("svg", { attrs: { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" } }, [t("polyline", { attrs: { points: "3 6 5 6 21 6" } }), t("path", { attrs: { 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" } })])])])]), t("div", { staticClass: "hep-cr-output-content" }, [e.activeTab === "stdout" ? t("pre", [e._v(e._s(e.output || '点击"运行"执行代码'))]) : t("pre", { staticClass: "hep-cr-stderr" }, [e._v(e._s(e.stderr))])])])])]);
|
|
2513
|
-
},
|
|
2514
|
-
me,
|
|
2625
|
+
}, ve = [], ye = /* @__PURE__ */ Y(
|
|
2515
2626
|
be,
|
|
2516
2627
|
Ee,
|
|
2628
|
+
ve,
|
|
2517
2629
|
!1,
|
|
2518
2630
|
null,
|
|
2519
2631
|
"490ecb17"
|
|
2520
2632
|
);
|
|
2521
|
-
const M =
|
|
2633
|
+
const M = ye.exports, Ae = {
|
|
2522
2634
|
name: "CodeRunnerDialog",
|
|
2523
2635
|
components: {
|
|
2524
2636
|
CodeRunner: M
|
|
@@ -2552,42 +2664,42 @@ const M = ve.exports, ye = {
|
|
|
2552
2664
|
}
|
|
2553
2665
|
},
|
|
2554
2666
|
watch: {
|
|
2555
|
-
value(
|
|
2556
|
-
this.localVisible =
|
|
2667
|
+
value(r) {
|
|
2668
|
+
this.localVisible = r;
|
|
2557
2669
|
}
|
|
2558
2670
|
},
|
|
2559
2671
|
methods: {
|
|
2560
2672
|
close() {
|
|
2561
2673
|
this.localVisible = !1, this.$emit("input", !1), this.$emit("update:value", !1), this.$emit("close");
|
|
2562
2674
|
},
|
|
2563
|
-
handleOverlayClick(
|
|
2564
|
-
|
|
2675
|
+
handleOverlayClick(r) {
|
|
2676
|
+
r.target === r.currentTarget && this.close();
|
|
2565
2677
|
}
|
|
2566
2678
|
},
|
|
2567
2679
|
expose: ["close"]
|
|
2568
2680
|
};
|
|
2569
|
-
var
|
|
2681
|
+
var Se = function() {
|
|
2570
2682
|
var e = this, t = e._self._c;
|
|
2571
2683
|
return t("Teleport", { attrs: { to: "body" } }, [t("Transition", { attrs: { name: "hep-cr-dialog-fade" } }, [e.localVisible ? t("div", { staticClass: "hep-cr-dialog-overlay", on: { click: e.handleOverlayClick } }, [t("div", { staticClass: "hep-cr-dialog-container", style: { width: e.dialogWidth } }, [t("div", { staticClass: "hep-cr-dialog-header" }, [t("h3", { staticClass: "hep-cr-dialog-title" }, [e._v(e._s(e.title))]), t("button", { staticClass: "hep-cr-dialog-close", on: { click: e.close } }, [t("svg", { attrs: { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" } }, [t("line", { attrs: { x1: "18", y1: "6", x2: "6", y2: "18" } }), t("line", { attrs: { x1: "6", y1: "6", x2: "18", y2: "18" } })])])]), t("div", { staticClass: "hep-cr-dialog-body" }, [t("CodeRunner", e._b({}, "CodeRunner", e.$attrs, !1))], 1), e.$slots.footer ? t("div", { staticClass: "hep-cr-dialog-footer" }, [e._t("footer", null, { close: e.close })], 2) : e._e()])]) : e._e()])], 1);
|
|
2572
|
-
},
|
|
2573
|
-
ye,
|
|
2684
|
+
}, Te = [], we = /* @__PURE__ */ Y(
|
|
2574
2685
|
Ae,
|
|
2575
2686
|
Se,
|
|
2687
|
+
Te,
|
|
2576
2688
|
!1,
|
|
2577
2689
|
null,
|
|
2578
2690
|
"ec700b03"
|
|
2579
2691
|
);
|
|
2580
|
-
const
|
|
2581
|
-
M.install = (
|
|
2582
|
-
|
|
2692
|
+
const ke = we.exports;
|
|
2693
|
+
M.install = (r) => {
|
|
2694
|
+
r.component("CodeRunner", M);
|
|
2583
2695
|
};
|
|
2584
2696
|
const _e = {
|
|
2585
|
-
install(
|
|
2586
|
-
|
|
2697
|
+
install(r) {
|
|
2698
|
+
r.component("CodeRunner", M);
|
|
2587
2699
|
}
|
|
2588
2700
|
};
|
|
2589
2701
|
export {
|
|
2590
2702
|
M as CodeRunner,
|
|
2591
|
-
|
|
2703
|
+
ke as CodeRunnerDialog,
|
|
2592
2704
|
_e as default
|
|
2593
2705
|
};
|