@hep-code-runner/react 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +72 -27
- package/dist/index.mjs +347 -302
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import qe, { useRef as Oe, useMemo as Ee, useEffect as ke, useState as Z, useCallback as le, forwardRef as xt, useImperativeHandle as kt } from "react";
|
|
2
2
|
var Ve = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3
|
-
function
|
|
3
|
+
function wt(u) {
|
|
4
4
|
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
|
|
5
5
|
}
|
|
6
6
|
var Ie = { exports: {} }, be = {};
|
|
@@ -14,16 +14,16 @@ var Ie = { exports: {} }, be = {};
|
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
16
|
var Xe;
|
|
17
|
-
function
|
|
17
|
+
function St() {
|
|
18
18
|
if (Xe) return be;
|
|
19
19
|
Xe = 1;
|
|
20
|
-
var u = qe,
|
|
21
|
-
function k(l,
|
|
20
|
+
var u = qe, d = Symbol.for("react.element"), n = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, m = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, R = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
21
|
+
function k(l, b, y) {
|
|
22
22
|
var _, O = {}, D = null, I = null;
|
|
23
|
-
y !== void 0 && (D = "" + y),
|
|
24
|
-
for (_ in
|
|
25
|
-
if (l && l.defaultProps) for (_ in
|
|
26
|
-
return { $$typeof:
|
|
23
|
+
y !== void 0 && (D = "" + y), b.key !== void 0 && (D = "" + b.key), b.ref !== void 0 && (I = b.ref);
|
|
24
|
+
for (_ in b) p.call(b, _) && !R.hasOwnProperty(_) && (O[_] = b[_]);
|
|
25
|
+
if (l && l.defaultProps) for (_ in b = l.defaultProps, b) O[_] === void 0 && (O[_] = b[_]);
|
|
26
|
+
return { $$typeof: d, type: l, key: D, ref: I, props: O, _owner: m.current };
|
|
27
27
|
}
|
|
28
28
|
return be.Fragment = n, be.jsx = k, be.jsxs = k, be;
|
|
29
29
|
}
|
|
@@ -40,8 +40,8 @@ var ve = {};
|
|
|
40
40
|
var Ke;
|
|
41
41
|
function At() {
|
|
42
42
|
return Ke || (Ke = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var u = qe,
|
|
44
|
-
function
|
|
43
|
+
var u = qe, d = Symbol.for("react.element"), n = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), l = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), B = Symbol.iterator, F = "@@iterator";
|
|
44
|
+
function w(e) {
|
|
45
45
|
if (e === null || typeof e != "object")
|
|
46
46
|
return null;
|
|
47
47
|
var a = B && e[B] || e[F];
|
|
@@ -65,14 +65,14 @@ function At() {
|
|
|
65
65
|
L.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, L);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
var i = !1, o = !1, s = !1, f = !1, E = !1,
|
|
69
|
-
|
|
68
|
+
var i = !1, o = !1, s = !1, f = !1, E = !1, h;
|
|
69
|
+
h = Symbol.for("react.module.reference");
|
|
70
70
|
function C(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
71
|
+
return !!(typeof e == "string" || typeof e == "function" || e === p || e === R || E || e === m || e === y || e === _ || f || e === I || i || o || s || typeof e == "object" && e !== null && (e.$$typeof === D || e.$$typeof === O || e.$$typeof === k || e.$$typeof === l || e.$$typeof === b || // This needs to include all possible module reference object
|
|
72
72
|
// types supported by any Flight configuration anywhere since
|
|
73
73
|
// we don't know which Flight build this will end up being used
|
|
74
74
|
// with.
|
|
75
|
-
e.$$typeof ===
|
|
75
|
+
e.$$typeof === h || e.getModuleId !== void 0));
|
|
76
76
|
}
|
|
77
77
|
function P(e, a, c) {
|
|
78
78
|
var v = e.displayName;
|
|
@@ -92,13 +92,13 @@ function At() {
|
|
|
92
92
|
if (typeof e == "string")
|
|
93
93
|
return e;
|
|
94
94
|
switch (e) {
|
|
95
|
-
case
|
|
95
|
+
case p:
|
|
96
96
|
return "Fragment";
|
|
97
97
|
case n:
|
|
98
98
|
return "Portal";
|
|
99
99
|
case R:
|
|
100
100
|
return "Profiler";
|
|
101
|
-
case
|
|
101
|
+
case m:
|
|
102
102
|
return "StrictMode";
|
|
103
103
|
case y:
|
|
104
104
|
return "Suspense";
|
|
@@ -113,7 +113,7 @@ function At() {
|
|
|
113
113
|
case k:
|
|
114
114
|
var c = e;
|
|
115
115
|
return z(c._context) + ".Provider";
|
|
116
|
-
case
|
|
116
|
+
case b:
|
|
117
117
|
return P(e, e.render, "ForwardRef");
|
|
118
118
|
case O:
|
|
119
119
|
var v = e.displayName || null;
|
|
@@ -207,8 +207,8 @@ function At() {
|
|
|
207
207
|
}
|
|
208
208
|
var oe = !1, te;
|
|
209
209
|
{
|
|
210
|
-
var
|
|
211
|
-
te = new
|
|
210
|
+
var S = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
+
te = new S();
|
|
212
212
|
}
|
|
213
213
|
function M(e, a) {
|
|
214
214
|
if (!e || oe)
|
|
@@ -278,7 +278,7 @@ function At() {
|
|
|
278
278
|
} finally {
|
|
279
279
|
oe = !1, ae.current = L, se(), Error.prepareStackTrace = N;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
281
|
+
var ge = e ? e.displayName || e.name : "", de = ge ? ie(ge) : "";
|
|
282
282
|
return typeof e == "function" && te.set(e, de), de;
|
|
283
283
|
}
|
|
284
284
|
function re(e, a, c) {
|
|
@@ -303,7 +303,7 @@ function At() {
|
|
|
303
303
|
}
|
|
304
304
|
if (typeof e == "object")
|
|
305
305
|
switch (e.$$typeof) {
|
|
306
|
-
case
|
|
306
|
+
case b:
|
|
307
307
|
return re(e.render);
|
|
308
308
|
case O:
|
|
309
309
|
return ye(e.type, a, c);
|
|
@@ -345,7 +345,7 @@ function At() {
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
var et = Array.isArray;
|
|
348
|
-
function
|
|
348
|
+
function we(e) {
|
|
349
349
|
return et(e);
|
|
350
350
|
}
|
|
351
351
|
function tt(e) {
|
|
@@ -418,7 +418,7 @@ function At() {
|
|
|
418
418
|
var ct = function(e, a, c, v, N, L, A) {
|
|
419
419
|
var x = {
|
|
420
420
|
// This tag allows us to uniquely identify this as a React Element
|
|
421
|
-
$$typeof:
|
|
421
|
+
$$typeof: d,
|
|
422
422
|
// Built-in properties that belong on the element
|
|
423
423
|
type: e,
|
|
424
424
|
key: a,
|
|
@@ -462,8 +462,8 @@ function At() {
|
|
|
462
462
|
return ct(e, x, Y, N, v, je.current, A);
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
var
|
|
466
|
-
function
|
|
465
|
+
var Se = T.ReactCurrentOwner, Ue = T.ReactDebugCurrentFrame;
|
|
466
|
+
function he(e) {
|
|
467
467
|
if (e) {
|
|
468
468
|
var a = e._owner, c = ye(e.type, e._source, a ? a.type : null);
|
|
469
469
|
Ue.setExtraStackFrame(c);
|
|
@@ -473,12 +473,12 @@ function At() {
|
|
|
473
473
|
var Ae;
|
|
474
474
|
Ae = !1;
|
|
475
475
|
function Te(e) {
|
|
476
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
476
|
+
return typeof e == "object" && e !== null && e.$$typeof === d;
|
|
477
477
|
}
|
|
478
478
|
function He() {
|
|
479
479
|
{
|
|
480
|
-
if (
|
|
481
|
-
var e = V(
|
|
480
|
+
if (Se.current) {
|
|
481
|
+
var e = V(Se.current.type);
|
|
482
482
|
if (e)
|
|
483
483
|
return `
|
|
484
484
|
|
|
@@ -513,14 +513,14 @@ Check the top-level render call using <` + c + ">.");
|
|
|
513
513
|
return;
|
|
514
514
|
Be[c] = !0;
|
|
515
515
|
var v = "";
|
|
516
|
-
e && e._owner && e._owner !==
|
|
516
|
+
e && e._owner && e._owner !== Se.current && (v = " It was passed a child from " + V(e._owner.type) + "."), he(e), t('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, v), he(null);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
function We(e, a) {
|
|
520
520
|
{
|
|
521
521
|
if (typeof e != "object")
|
|
522
522
|
return;
|
|
523
|
-
if (
|
|
523
|
+
if (we(e))
|
|
524
524
|
for (var c = 0; c < e.length; c++) {
|
|
525
525
|
var v = e[c];
|
|
526
526
|
Te(v) && ze(v, a);
|
|
@@ -528,7 +528,7 @@ Check the top-level render call using <` + c + ">.");
|
|
|
528
528
|
else if (Te(e))
|
|
529
529
|
e._store && (e._store.validated = !0);
|
|
530
530
|
else if (e) {
|
|
531
|
-
var N =
|
|
531
|
+
var N = w(e);
|
|
532
532
|
if (typeof N == "function" && N !== e.entries)
|
|
533
533
|
for (var L = N.call(e), A; !(A = L.next()).done; )
|
|
534
534
|
Te(A.value) && ze(A.value, a);
|
|
@@ -543,7 +543,7 @@ Check the top-level render call using <` + c + ">.");
|
|
|
543
543
|
var c;
|
|
544
544
|
if (typeof a == "function")
|
|
545
545
|
c = a.propTypes;
|
|
546
|
-
else if (typeof a == "object" && (a.$$typeof ===
|
|
546
|
+
else if (typeof a == "object" && (a.$$typeof === b || // Note: Memo only checks outer props here.
|
|
547
547
|
// Inner props are checked in the reconciler.
|
|
548
548
|
a.$$typeof === O))
|
|
549
549
|
c = a.propTypes;
|
|
@@ -560,16 +560,16 @@ Check the top-level render call using <` + c + ">.");
|
|
|
560
560
|
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && t("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function ht(e) {
|
|
564
564
|
{
|
|
565
565
|
for (var a = Object.keys(e.props), c = 0; c < a.length; c++) {
|
|
566
566
|
var v = a[c];
|
|
567
567
|
if (v !== "children" && v !== "key") {
|
|
568
|
-
|
|
568
|
+
he(e), t("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), he(null);
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
|
-
e.ref !== null && (
|
|
572
|
+
e.ref !== null && (he(e), t("Invalid attribute `ref` supplied to `React.Fragment`."), he(null));
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
var Ge = {};
|
|
@@ -582,7 +582,7 @@ Check the top-level render call using <` + c + ">.");
|
|
|
582
582
|
var Y = dt();
|
|
583
583
|
Y ? x += Y : x += He();
|
|
584
584
|
var $;
|
|
585
|
-
e === null ? $ = "null" :
|
|
585
|
+
e === null ? $ = "null" : we(e) ? $ = "array" : e !== void 0 && e.$$typeof === d ? ($ = "<" + (V(e.type) || "Unknown") + " />", x = " Did you accidentally export a JSX literal instead of a component?") : $ = typeof e, t("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", $, x);
|
|
586
586
|
}
|
|
587
587
|
var U = ut(e, a, c, N, L);
|
|
588
588
|
if (U == null)
|
|
@@ -591,9 +591,9 @@ Check the top-level render call using <` + c + ">.");
|
|
|
591
591
|
var Q = a.children;
|
|
592
592
|
if (Q !== void 0)
|
|
593
593
|
if (v)
|
|
594
|
-
if (
|
|
595
|
-
for (var
|
|
596
|
-
We(Q[
|
|
594
|
+
if (we(Q)) {
|
|
595
|
+
for (var ge = 0; ge < Q.length; ge++)
|
|
596
|
+
We(Q[ge], e);
|
|
597
597
|
Object.freeze && Object.freeze(Q);
|
|
598
598
|
} else
|
|
599
599
|
t("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
@@ -614,23 +614,23 @@ React keys must be passed directly to JSX without using spread:
|
|
|
614
614
|
<%s key={someKey} {...props} />`, Re, de, Et, de), Ge[de + Re] = !0;
|
|
615
615
|
}
|
|
616
616
|
}
|
|
617
|
-
return e ===
|
|
617
|
+
return e === p ? ht(U) : ft(U), U;
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function gt(e, a, c) {
|
|
621
621
|
return Ye(e, a, c, !0);
|
|
622
622
|
}
|
|
623
623
|
function mt(e, a, c) {
|
|
624
624
|
return Ye(e, a, c, !1);
|
|
625
625
|
}
|
|
626
|
-
var bt = mt, vt =
|
|
627
|
-
ve.Fragment =
|
|
626
|
+
var bt = mt, vt = gt;
|
|
627
|
+
ve.Fragment = p, ve.jsx = bt, ve.jsxs = vt;
|
|
628
628
|
}()), ve;
|
|
629
629
|
}
|
|
630
|
-
process.env.NODE_ENV === "production" ? Ie.exports =
|
|
631
|
-
var
|
|
630
|
+
process.env.NODE_ENV === "production" ? Ie.exports = St() : Ie.exports = At();
|
|
631
|
+
var g = Ie.exports, Je = { exports: {} };
|
|
632
632
|
(function(u) {
|
|
633
|
-
var
|
|
633
|
+
var d = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
634
634
|
/**
|
|
635
635
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
636
636
|
*
|
|
@@ -639,8 +639,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
639
639
|
* @namespace
|
|
640
640
|
* @public
|
|
641
641
|
*/
|
|
642
|
-
var n = function(
|
|
643
|
-
var
|
|
642
|
+
var n = function(p) {
|
|
643
|
+
var m = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, R = 0, k = {}, l = {
|
|
644
644
|
/**
|
|
645
645
|
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
646
646
|
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
@@ -662,7 +662,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
662
662
|
* @memberof Prism
|
|
663
663
|
* @public
|
|
664
664
|
*/
|
|
665
|
-
manual:
|
|
665
|
+
manual: p.Prism && p.Prism.manual,
|
|
666
666
|
/**
|
|
667
667
|
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
|
|
668
668
|
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
|
|
@@ -684,7 +684,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
684
684
|
* @memberof Prism
|
|
685
685
|
* @public
|
|
686
686
|
*/
|
|
687
|
-
disableWorkerMessageHandler:
|
|
687
|
+
disableWorkerMessageHandler: p.Prism && p.Prism.disableWorkerMessageHandler,
|
|
688
688
|
/**
|
|
689
689
|
* A namespace for utility methods.
|
|
690
690
|
*
|
|
@@ -696,7 +696,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
696
696
|
*/
|
|
697
697
|
util: {
|
|
698
698
|
encode: function t(r) {
|
|
699
|
-
return r instanceof
|
|
699
|
+
return r instanceof b ? new b(r.type, t(r.content), r.alias) : Array.isArray(r) ? r.map(t) : r.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
700
700
|
},
|
|
701
701
|
/**
|
|
702
702
|
* Returns the name of the type of the given value.
|
|
@@ -754,8 +754,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
754
754
|
case "Array":
|
|
755
755
|
return s = l.util.objId(r), i[s] ? i[s] : (o = [], i[s] = o, /** @type {Array} */
|
|
756
756
|
/** @type {any} */
|
|
757
|
-
r.forEach(function(E,
|
|
758
|
-
o[
|
|
757
|
+
r.forEach(function(E, h) {
|
|
758
|
+
o[h] = t(E, i);
|
|
759
759
|
}), /** @type {any} */
|
|
760
760
|
o);
|
|
761
761
|
default:
|
|
@@ -772,7 +772,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
772
772
|
*/
|
|
773
773
|
getLanguage: function(t) {
|
|
774
774
|
for (; t; ) {
|
|
775
|
-
var r =
|
|
775
|
+
var r = m.exec(t.className);
|
|
776
776
|
if (r)
|
|
777
777
|
return r[1].toLowerCase();
|
|
778
778
|
t = t.parentElement;
|
|
@@ -787,7 +787,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
787
787
|
* @returns {void}
|
|
788
788
|
*/
|
|
789
789
|
setLanguage: function(t, r) {
|
|
790
|
-
t.className = t.className.replace(RegExp(
|
|
790
|
+
t.className = t.className.replace(RegExp(m, "gi"), ""), t.classList.add("language-" + r);
|
|
791
791
|
},
|
|
792
792
|
/**
|
|
793
793
|
* Returns the script element that is currently executing.
|
|
@@ -979,8 +979,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
979
979
|
for (var E in s)
|
|
980
980
|
if (s.hasOwnProperty(E)) {
|
|
981
981
|
if (E == r)
|
|
982
|
-
for (var
|
|
983
|
-
i.hasOwnProperty(
|
|
982
|
+
for (var h in i)
|
|
983
|
+
i.hasOwnProperty(h) && (f[h] = i[h]);
|
|
984
984
|
i.hasOwnProperty(E) || (f[E] = s[E]);
|
|
985
985
|
}
|
|
986
986
|
var C = o[t];
|
|
@@ -995,8 +995,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
995
995
|
for (var E in r)
|
|
996
996
|
if (r.hasOwnProperty(E)) {
|
|
997
997
|
i.call(r, E, r[E], o || E);
|
|
998
|
-
var
|
|
999
|
-
C === "Object" && !s[f(
|
|
998
|
+
var h = r[E], C = l.util.type(h);
|
|
999
|
+
C === "Object" && !s[f(h)] ? (s[f(h)] = !0, t(h, i, null, s)) : C === "Array" && !s[f(h)] && (s[f(h)] = !0, t(h, i, E, s));
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
},
|
|
@@ -1074,34 +1074,34 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1074
1074
|
l.util.setLanguage(t, o);
|
|
1075
1075
|
var f = t.parentElement;
|
|
1076
1076
|
f && f.nodeName.toLowerCase() === "pre" && l.util.setLanguage(f, o);
|
|
1077
|
-
var E = t.textContent,
|
|
1077
|
+
var E = t.textContent, h = {
|
|
1078
1078
|
element: t,
|
|
1079
1079
|
language: o,
|
|
1080
1080
|
grammar: s,
|
|
1081
1081
|
code: E
|
|
1082
1082
|
};
|
|
1083
1083
|
function C(z) {
|
|
1084
|
-
|
|
1084
|
+
h.highlightedCode = z, l.hooks.run("before-insert", h), h.element.innerHTML = h.highlightedCode, l.hooks.run("after-highlight", h), l.hooks.run("complete", h), i && i.call(h.element);
|
|
1085
1085
|
}
|
|
1086
|
-
if (l.hooks.run("before-sanity-check",
|
|
1087
|
-
l.hooks.run("complete",
|
|
1086
|
+
if (l.hooks.run("before-sanity-check", h), f = h.element.parentElement, f && f.nodeName.toLowerCase() === "pre" && !f.hasAttribute("tabindex") && f.setAttribute("tabindex", "0"), !h.code) {
|
|
1087
|
+
l.hooks.run("complete", h), i && i.call(h.element);
|
|
1088
1088
|
return;
|
|
1089
1089
|
}
|
|
1090
|
-
if (l.hooks.run("before-highlight",
|
|
1091
|
-
C(l.util.encode(
|
|
1090
|
+
if (l.hooks.run("before-highlight", h), !h.grammar) {
|
|
1091
|
+
C(l.util.encode(h.code));
|
|
1092
1092
|
return;
|
|
1093
1093
|
}
|
|
1094
|
-
if (r &&
|
|
1094
|
+
if (r && p.Worker) {
|
|
1095
1095
|
var P = new Worker(l.filename);
|
|
1096
1096
|
P.onmessage = function(z) {
|
|
1097
1097
|
C(z.data);
|
|
1098
1098
|
}, P.postMessage(JSON.stringify({
|
|
1099
|
-
language:
|
|
1100
|
-
code:
|
|
1099
|
+
language: h.language,
|
|
1100
|
+
code: h.code,
|
|
1101
1101
|
immediateClose: !0
|
|
1102
1102
|
}));
|
|
1103
1103
|
} else
|
|
1104
|
-
C(l.highlight(
|
|
1104
|
+
C(l.highlight(h.code, h.grammar, h.language));
|
|
1105
1105
|
},
|
|
1106
1106
|
/**
|
|
1107
1107
|
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
@@ -1131,7 +1131,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1131
1131
|
};
|
|
1132
1132
|
if (l.hooks.run("before-tokenize", o), !o.grammar)
|
|
1133
1133
|
throw new Error('The language "' + o.language + '" has no grammar.');
|
|
1134
|
-
return o.tokens = l.tokenize(o.code, o.grammar), l.hooks.run("after-tokenize", o),
|
|
1134
|
+
return o.tokens = l.tokenize(o.code, o.grammar), l.hooks.run("after-tokenize", o), b.stringify(l.util.encode(o.tokens), o.language);
|
|
1135
1135
|
},
|
|
1136
1136
|
/**
|
|
1137
1137
|
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
@@ -1206,13 +1206,13 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1206
1206
|
s(r);
|
|
1207
1207
|
}
|
|
1208
1208
|
},
|
|
1209
|
-
Token:
|
|
1209
|
+
Token: b
|
|
1210
1210
|
};
|
|
1211
|
-
|
|
1212
|
-
function
|
|
1211
|
+
p.Prism = l;
|
|
1212
|
+
function b(t, r, i, o) {
|
|
1213
1213
|
this.type = t, this.content = r, this.alias = i, this.length = (o || "").length | 0;
|
|
1214
1214
|
}
|
|
1215
|
-
|
|
1215
|
+
b.stringify = function t(r, i) {
|
|
1216
1216
|
if (typeof r == "string")
|
|
1217
1217
|
return r;
|
|
1218
1218
|
if (Array.isArray(r)) {
|
|
@@ -1231,8 +1231,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1231
1231
|
}, f = r.alias;
|
|
1232
1232
|
f && (Array.isArray(f) ? Array.prototype.push.apply(s.classes, f) : s.classes.push(f)), l.hooks.run("wrap", s);
|
|
1233
1233
|
var E = "";
|
|
1234
|
-
for (var
|
|
1235
|
-
E += " " +
|
|
1234
|
+
for (var h in s.attributes)
|
|
1235
|
+
E += " " + h + '="' + (s.attributes[h] || "").replace(/"/g, """) + '"';
|
|
1236
1236
|
return "<" + s.tag + ' class="' + s.classes.join(" ") + '"' + E + ">" + s.content + "</" + s.tag + ">";
|
|
1237
1237
|
};
|
|
1238
1238
|
function y(t, r, i, o) {
|
|
@@ -1247,12 +1247,12 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1247
1247
|
function _(t, r, i, o, s, f) {
|
|
1248
1248
|
for (var E in i)
|
|
1249
1249
|
if (!(!i.hasOwnProperty(E) || !i[E])) {
|
|
1250
|
-
var
|
|
1251
|
-
|
|
1252
|
-
for (var C = 0; C <
|
|
1250
|
+
var h = i[E];
|
|
1251
|
+
h = Array.isArray(h) ? h : [h];
|
|
1252
|
+
for (var C = 0; C < h.length; ++C) {
|
|
1253
1253
|
if (f && f.cause == E + "," + C)
|
|
1254
1254
|
return;
|
|
1255
|
-
var P =
|
|
1255
|
+
var P = h[C], z = P.inside, V = !!P.lookbehind, W = !!P.greedy, ne = P.alias;
|
|
1256
1256
|
if (W && !P.pattern.global) {
|
|
1257
1257
|
var ue = P.pattern.toString().match(/[imsuy]*$/)[0];
|
|
1258
1258
|
P.pattern = RegExp(P.pattern.source, ue + "g");
|
|
@@ -1261,7 +1261,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1261
1261
|
var ee = j.value;
|
|
1262
1262
|
if (r.length > t.length)
|
|
1263
1263
|
return;
|
|
1264
|
-
if (!(ee instanceof
|
|
1264
|
+
if (!(ee instanceof b)) {
|
|
1265
1265
|
var X = 1, G;
|
|
1266
1266
|
if (W) {
|
|
1267
1267
|
if (G = y(ce, H, t, V), !G || G.index >= t.length)
|
|
@@ -1269,7 +1269,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1269
1269
|
var ae = G.index, pe = G.index + G[0].length, q = H;
|
|
1270
1270
|
for (q += j.value.length; ae >= q; )
|
|
1271
1271
|
j = j.next, q += j.value.length;
|
|
1272
|
-
if (q -= j.value.length, H = q, j.value instanceof
|
|
1272
|
+
if (q -= j.value.length, H = q, j.value instanceof b)
|
|
1273
1273
|
continue;
|
|
1274
1274
|
for (var se = j; se !== r.tail && (q < pe || typeof se.value == "string"); se = se.next)
|
|
1275
1275
|
X++, q += se.value.length;
|
|
@@ -1278,10 +1278,10 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1278
1278
|
continue;
|
|
1279
1279
|
var ae = G.index, J = G[0], ie = ee.slice(0, ae), oe = ee.slice(ae + J.length), te = H + ee.length;
|
|
1280
1280
|
f && te > f.reach && (f.reach = te);
|
|
1281
|
-
var
|
|
1282
|
-
ie && (
|
|
1283
|
-
var M = new
|
|
1284
|
-
if (j = D(r,
|
|
1281
|
+
var S = j.prev;
|
|
1282
|
+
ie && (S = D(r, S, ie), H += ie.length), I(r, S, X);
|
|
1283
|
+
var M = new b(E, z ? l.tokenize(J, z) : J, ne, J);
|
|
1284
|
+
if (j = D(r, S, M), oe && D(r, j, oe), X > 1) {
|
|
1285
1285
|
var re = {
|
|
1286
1286
|
cause: E + "," + C,
|
|
1287
1287
|
reach: te
|
|
@@ -1311,22 +1311,22 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1311
1311
|
r.push(i.value), i = i.next;
|
|
1312
1312
|
return r;
|
|
1313
1313
|
}
|
|
1314
|
-
if (!
|
|
1315
|
-
return
|
|
1314
|
+
if (!p.document)
|
|
1315
|
+
return p.addEventListener && (l.disableWorkerMessageHandler || p.addEventListener("message", function(t) {
|
|
1316
1316
|
var r = JSON.parse(t.data), i = r.language, o = r.code, s = r.immediateClose;
|
|
1317
|
-
|
|
1317
|
+
p.postMessage(l.highlight(o, l.languages[i], i)), s && p.close();
|
|
1318
1318
|
}, !1)), l;
|
|
1319
1319
|
var F = l.util.currentScript();
|
|
1320
1320
|
F && (l.filename = F.src, F.hasAttribute("data-manual") && (l.manual = !0));
|
|
1321
|
-
function
|
|
1321
|
+
function w() {
|
|
1322
1322
|
l.manual || l.highlightAll();
|
|
1323
1323
|
}
|
|
1324
1324
|
if (!l.manual) {
|
|
1325
1325
|
var T = document.readyState;
|
|
1326
|
-
T === "loading" || T === "interactive" && F && F.defer ? document.addEventListener("DOMContentLoaded",
|
|
1326
|
+
T === "loading" || T === "interactive" && F && F.defer ? document.addEventListener("DOMContentLoaded", w) : window.requestAnimationFrame ? window.requestAnimationFrame(w) : window.setTimeout(w, 16);
|
|
1327
1327
|
}
|
|
1328
1328
|
return l;
|
|
1329
|
-
}(
|
|
1329
|
+
}(d);
|
|
1330
1330
|
u.exports && (u.exports = n), typeof Ve < "u" && (Ve.Prism = n), n.languages.markup = {
|
|
1331
1331
|
comment: {
|
|
1332
1332
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
@@ -1404,8 +1404,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1404
1404
|
},
|
|
1405
1405
|
/&#x?[\da-f]{1,8};/i
|
|
1406
1406
|
]
|
|
1407
|
-
}, n.languages.markup.tag.inside["attr-value"].inside.entity = n.languages.markup.entity, n.languages.markup.doctype.inside["internal-subset"].inside = n.languages.markup, n.hooks.add("wrap", function(
|
|
1408
|
-
|
|
1407
|
+
}, n.languages.markup.tag.inside["attr-value"].inside.entity = n.languages.markup.entity, n.languages.markup.doctype.inside["internal-subset"].inside = n.languages.markup, n.hooks.add("wrap", function(p) {
|
|
1408
|
+
p.type === "entity" && (p.attributes.title = p.content.replace(/&/, "&"));
|
|
1409
1409
|
}), Object.defineProperty(n.languages.markup.tag, "addInlined", {
|
|
1410
1410
|
/**
|
|
1411
1411
|
* Adds an inlined language to markup.
|
|
@@ -1418,7 +1418,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1418
1418
|
* @example
|
|
1419
1419
|
* addInlined('style', 'css');
|
|
1420
1420
|
*/
|
|
1421
|
-
value: function(
|
|
1421
|
+
value: function(m, R) {
|
|
1422
1422
|
var k = {};
|
|
1423
1423
|
k["language-" + R] = {
|
|
1424
1424
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
@@ -1435,15 +1435,15 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1435
1435
|
pattern: /[\s\S]+/,
|
|
1436
1436
|
inside: n.languages[R]
|
|
1437
1437
|
};
|
|
1438
|
-
var
|
|
1439
|
-
m
|
|
1438
|
+
var b = {};
|
|
1439
|
+
b[m] = {
|
|
1440
1440
|
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1441
|
-
return
|
|
1441
|
+
return m;
|
|
1442
1442
|
}), "i"),
|
|
1443
1443
|
lookbehind: !0,
|
|
1444
1444
|
greedy: !0,
|
|
1445
1445
|
inside: l
|
|
1446
|
-
}, n.languages.insertBefore("markup", "cdata",
|
|
1446
|
+
}, n.languages.insertBefore("markup", "cdata", b);
|
|
1447
1447
|
}
|
|
1448
1448
|
}), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
|
|
1449
1449
|
/**
|
|
@@ -1457,10 +1457,10 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1457
1457
|
* @example
|
|
1458
1458
|
* addAttribute('style', 'css');
|
|
1459
1459
|
*/
|
|
1460
|
-
value: function(
|
|
1460
|
+
value: function(p, m) {
|
|
1461
1461
|
n.languages.markup.tag.inside["special-attr"].push({
|
|
1462
1462
|
pattern: RegExp(
|
|
1463
|
-
/(^|["'\s])/.source + "(?:" +
|
|
1463
|
+
/(^|["'\s])/.source + "(?:" + p + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
1464
1464
|
"i"
|
|
1465
1465
|
),
|
|
1466
1466
|
lookbehind: !0,
|
|
@@ -1472,8 +1472,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1472
1472
|
value: {
|
|
1473
1473
|
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1474
1474
|
lookbehind: !0,
|
|
1475
|
-
alias: [
|
|
1476
|
-
inside: n.languages[
|
|
1475
|
+
alias: [m, "language-" + m],
|
|
1476
|
+
inside: n.languages[m]
|
|
1477
1477
|
},
|
|
1478
1478
|
punctuation: [
|
|
1479
1479
|
{
|
|
@@ -1487,12 +1487,12 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1487
1487
|
}
|
|
1488
1488
|
});
|
|
1489
1489
|
}
|
|
1490
|
-
}), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, function(
|
|
1491
|
-
var
|
|
1492
|
-
|
|
1490
|
+
}), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, function(p) {
|
|
1491
|
+
var m = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1492
|
+
p.languages.css = {
|
|
1493
1493
|
comment: /\/\*[\s\S]*?\*\//,
|
|
1494
1494
|
atrule: {
|
|
1495
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" +
|
|
1495
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + m.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
1496
1496
|
inside: {
|
|
1497
1497
|
rule: /^@[\w-]+/,
|
|
1498
1498
|
"selector-function-argument": {
|
|
@@ -1509,23 +1509,23 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1509
1509
|
},
|
|
1510
1510
|
url: {
|
|
1511
1511
|
// https://drafts.csswg.org/css-values-3/#urls
|
|
1512
|
-
pattern: RegExp("\\burl\\((?:" +
|
|
1512
|
+
pattern: RegExp("\\burl\\((?:" + m.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
1513
1513
|
greedy: !0,
|
|
1514
1514
|
inside: {
|
|
1515
1515
|
function: /^url/i,
|
|
1516
1516
|
punctuation: /^\(|\)$/,
|
|
1517
1517
|
string: {
|
|
1518
|
-
pattern: RegExp("^" +
|
|
1518
|
+
pattern: RegExp("^" + m.source + "$"),
|
|
1519
1519
|
alias: "url"
|
|
1520
1520
|
}
|
|
1521
1521
|
}
|
|
1522
1522
|
},
|
|
1523
1523
|
selector: {
|
|
1524
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` +
|
|
1524
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + m.source + ")*(?=\\s*\\{)"),
|
|
1525
1525
|
lookbehind: !0
|
|
1526
1526
|
},
|
|
1527
1527
|
string: {
|
|
1528
|
-
pattern:
|
|
1528
|
+
pattern: m,
|
|
1529
1529
|
greedy: !0
|
|
1530
1530
|
},
|
|
1531
1531
|
property: {
|
|
@@ -1538,8 +1538,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1538
1538
|
lookbehind: !0
|
|
1539
1539
|
},
|
|
1540
1540
|
punctuation: /[(){};:,]/
|
|
1541
|
-
},
|
|
1542
|
-
var R =
|
|
1541
|
+
}, p.languages.css.atrule.inside.rest = p.languages.css;
|
|
1542
|
+
var R = p.languages.markup;
|
|
1543
1543
|
R && (R.tag.addInlined("style", "css"), R.tag.addAttribute("style", "css"));
|
|
1544
1544
|
}(n), n.languages.clike = {
|
|
1545
1545
|
comment: [
|
|
@@ -1705,8 +1705,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1705
1705
|
if (typeof n > "u" || typeof document > "u")
|
|
1706
1706
|
return;
|
|
1707
1707
|
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1708
|
-
var
|
|
1709
|
-
return "✖ Error " + F + " while fetching file: " +
|
|
1708
|
+
var p = "Loading…", m = function(F, w) {
|
|
1709
|
+
return "✖ Error " + F + " while fetching file: " + w;
|
|
1710
1710
|
}, R = "✖ Error: File does not exist or is empty", k = {
|
|
1711
1711
|
js: "javascript",
|
|
1712
1712
|
py: "python",
|
|
@@ -1717,52 +1717,52 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1717
1717
|
bat: "batch",
|
|
1718
1718
|
h: "c",
|
|
1719
1719
|
tex: "latex"
|
|
1720
|
-
}, l = "data-src-status",
|
|
1721
|
-
function D(F,
|
|
1720
|
+
}, l = "data-src-status", b = "loading", y = "loaded", _ = "failed", O = "pre[data-src]:not([" + l + '="' + y + '"]):not([' + l + '="' + b + '"])';
|
|
1721
|
+
function D(F, w, T) {
|
|
1722
1722
|
var t = new XMLHttpRequest();
|
|
1723
1723
|
t.open("GET", F, !0), t.onreadystatechange = function() {
|
|
1724
|
-
t.readyState == 4 && (t.status < 400 && t.responseText ?
|
|
1724
|
+
t.readyState == 4 && (t.status < 400 && t.responseText ? w(t.responseText) : t.status >= 400 ? T(m(t.status, t.statusText)) : T(R));
|
|
1725
1725
|
}, t.send(null);
|
|
1726
1726
|
}
|
|
1727
1727
|
function I(F) {
|
|
1728
|
-
var
|
|
1729
|
-
if (
|
|
1730
|
-
var T = Number(
|
|
1728
|
+
var w = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(F || "");
|
|
1729
|
+
if (w) {
|
|
1730
|
+
var T = Number(w[1]), t = w[2], r = w[3];
|
|
1731
1731
|
return t ? r ? [T, Number(r)] : [T, void 0] : [T, T];
|
|
1732
1732
|
}
|
|
1733
1733
|
}
|
|
1734
1734
|
n.hooks.add("before-highlightall", function(F) {
|
|
1735
1735
|
F.selector += ", " + O;
|
|
1736
1736
|
}), n.hooks.add("before-sanity-check", function(F) {
|
|
1737
|
-
var
|
|
1737
|
+
var w = (
|
|
1738
1738
|
/** @type {HTMLPreElement} */
|
|
1739
1739
|
F.element
|
|
1740
1740
|
);
|
|
1741
|
-
if (
|
|
1742
|
-
F.code = "",
|
|
1743
|
-
var T =
|
|
1744
|
-
T.textContent =
|
|
1745
|
-
var t =
|
|
1741
|
+
if (w.matches(O)) {
|
|
1742
|
+
F.code = "", w.setAttribute(l, b);
|
|
1743
|
+
var T = w.appendChild(document.createElement("CODE"));
|
|
1744
|
+
T.textContent = p;
|
|
1745
|
+
var t = w.getAttribute("data-src"), r = F.language;
|
|
1746
1746
|
if (r === "none") {
|
|
1747
1747
|
var i = (/\.(\w+)$/.exec(t) || [, "none"])[1];
|
|
1748
1748
|
r = k[i] || i;
|
|
1749
1749
|
}
|
|
1750
|
-
n.util.setLanguage(T, r), n.util.setLanguage(
|
|
1750
|
+
n.util.setLanguage(T, r), n.util.setLanguage(w, r);
|
|
1751
1751
|
var o = n.plugins.autoloader;
|
|
1752
1752
|
o && o.loadLanguages(r), D(
|
|
1753
1753
|
t,
|
|
1754
1754
|
function(s) {
|
|
1755
|
-
|
|
1756
|
-
var f = I(
|
|
1755
|
+
w.setAttribute(l, y);
|
|
1756
|
+
var f = I(w.getAttribute("data-range"));
|
|
1757
1757
|
if (f) {
|
|
1758
|
-
var E = s.split(/\r\n?|\n/g),
|
|
1759
|
-
|
|
1760
|
-
`),
|
|
1758
|
+
var E = s.split(/\r\n?|\n/g), h = f[0], C = f[1] == null ? E.length : f[1];
|
|
1759
|
+
h < 0 && (h += E.length), h = Math.max(0, Math.min(h - 1, E.length)), C < 0 && (C += E.length), C = Math.max(0, Math.min(C, E.length)), s = E.slice(h, C).join(`
|
|
1760
|
+
`), w.hasAttribute("data-start") || w.setAttribute("data-start", String(h + 1));
|
|
1761
1761
|
}
|
|
1762
1762
|
T.textContent = s, n.highlightElement(T);
|
|
1763
1763
|
},
|
|
1764
1764
|
function(s) {
|
|
1765
|
-
|
|
1765
|
+
w.setAttribute(l, _), T.textContent = s;
|
|
1766
1766
|
}
|
|
1767
1767
|
);
|
|
1768
1768
|
}
|
|
@@ -1774,8 +1774,8 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1774
1774
|
*
|
|
1775
1775
|
* @param {ParentNode} [container=document]
|
|
1776
1776
|
*/
|
|
1777
|
-
highlight: function(
|
|
1778
|
-
for (var T = (
|
|
1777
|
+
highlight: function(w) {
|
|
1778
|
+
for (var T = (w || document).querySelectorAll(O), t = 0, r; r = T[t++]; )
|
|
1779
1779
|
n.highlightElement(r);
|
|
1780
1780
|
}
|
|
1781
1781
|
};
|
|
@@ -1786,7 +1786,7 @@ var h = Ie.exports, Je = { exports: {} };
|
|
|
1786
1786
|
}();
|
|
1787
1787
|
})(Je);
|
|
1788
1788
|
var Tt = Je.exports;
|
|
1789
|
-
const Ne = /* @__PURE__ */
|
|
1789
|
+
const Ne = /* @__PURE__ */ wt(Tt);
|
|
1790
1790
|
Prism.languages.clike = {
|
|
1791
1791
|
comment: [
|
|
1792
1792
|
{
|
|
@@ -2045,7 +2045,7 @@ Prism.languages.insertBefore("go", "string", {
|
|
|
2045
2045
|
});
|
|
2046
2046
|
delete Prism.languages.go["class-name"];
|
|
2047
2047
|
(function(u) {
|
|
2048
|
-
var
|
|
2048
|
+
var d = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, n = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, p = {
|
|
2049
2049
|
pattern: RegExp(/(^|[^\w.])/.source + n + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
|
|
2050
2050
|
lookbehind: !0,
|
|
2051
2051
|
inside: {
|
|
@@ -2065,23 +2065,23 @@ delete Prism.languages.go["class-name"];
|
|
|
2065
2065
|
greedy: !0
|
|
2066
2066
|
},
|
|
2067
2067
|
"class-name": [
|
|
2068
|
-
|
|
2068
|
+
p,
|
|
2069
2069
|
{
|
|
2070
2070
|
// variables, parameters, and constructor references
|
|
2071
2071
|
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
|
|
2072
2072
|
pattern: RegExp(/(^|[^\w.])/.source + n + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
|
|
2073
2073
|
lookbehind: !0,
|
|
2074
|
-
inside:
|
|
2074
|
+
inside: p.inside
|
|
2075
2075
|
},
|
|
2076
2076
|
{
|
|
2077
2077
|
// class names based on keyword
|
|
2078
2078
|
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
|
|
2079
2079
|
pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + n + /[A-Z]\w*\b/.source),
|
|
2080
2080
|
lookbehind: !0,
|
|
2081
|
-
inside:
|
|
2081
|
+
inside: p.inside
|
|
2082
2082
|
}
|
|
2083
2083
|
],
|
|
2084
|
-
keyword:
|
|
2084
|
+
keyword: d,
|
|
2085
2085
|
function: [
|
|
2086
2086
|
u.languages.clike.function,
|
|
2087
2087
|
{
|
|
@@ -2115,8 +2115,8 @@ delete Prism.languages.go["class-name"];
|
|
|
2115
2115
|
generics: {
|
|
2116
2116
|
pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
|
|
2117
2117
|
inside: {
|
|
2118
|
-
"class-name":
|
|
2119
|
-
keyword:
|
|
2118
|
+
"class-name": p,
|
|
2119
|
+
keyword: d,
|
|
2120
2120
|
punctuation: /[<>(),.:]/,
|
|
2121
2121
|
operator: /[?&|]/
|
|
2122
2122
|
}
|
|
@@ -2126,7 +2126,7 @@ delete Prism.languages.go["class-name"];
|
|
|
2126
2126
|
pattern: RegExp(/(\bimport\s+)/.source + n + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
|
|
2127
2127
|
lookbehind: !0,
|
|
2128
2128
|
inside: {
|
|
2129
|
-
namespace:
|
|
2129
|
+
namespace: p.inside.namespace,
|
|
2130
2130
|
punctuation: /\./,
|
|
2131
2131
|
operator: /\*/,
|
|
2132
2132
|
"class-name": /\w+/
|
|
@@ -2137,7 +2137,7 @@ delete Prism.languages.go["class-name"];
|
|
|
2137
2137
|
lookbehind: !0,
|
|
2138
2138
|
alias: "static",
|
|
2139
2139
|
inside: {
|
|
2140
|
-
namespace:
|
|
2140
|
+
namespace: p.inside.namespace,
|
|
2141
2141
|
static: /\b\w+$/,
|
|
2142
2142
|
punctuation: /\./,
|
|
2143
2143
|
operator: /\*/,
|
|
@@ -2148,7 +2148,7 @@ delete Prism.languages.go["class-name"];
|
|
|
2148
2148
|
namespace: {
|
|
2149
2149
|
pattern: RegExp(
|
|
2150
2150
|
/(\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() {
|
|
2151
|
-
return
|
|
2151
|
+
return d.source;
|
|
2152
2152
|
})
|
|
2153
2153
|
),
|
|
2154
2154
|
lookbehind: !0,
|
|
@@ -2235,16 +2235,16 @@ Prism.languages.insertBefore("c", "function", {
|
|
|
2235
2235
|
});
|
|
2236
2236
|
delete Prism.languages.c.boolean;
|
|
2237
2237
|
(function(u) {
|
|
2238
|
-
for (var
|
|
2239
|
-
|
|
2240
|
-
return
|
|
2238
|
+
for (var d = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, n = 0; n < 2; n++)
|
|
2239
|
+
d = d.replace(/<self>/g, function() {
|
|
2240
|
+
return d;
|
|
2241
2241
|
});
|
|
2242
|
-
|
|
2242
|
+
d = d.replace(/<self>/g, function() {
|
|
2243
2243
|
return /[^\s\S]/.source;
|
|
2244
2244
|
}), u.languages.rust = {
|
|
2245
2245
|
comment: [
|
|
2246
2246
|
{
|
|
2247
|
-
pattern: RegExp(/(^|[^\\])/.source +
|
|
2247
|
+
pattern: RegExp(/(^|[^\\])/.source + d),
|
|
2248
2248
|
lookbehind: !0,
|
|
2249
2249
|
greedy: !0
|
|
2250
2250
|
},
|
|
@@ -2384,17 +2384,17 @@ Prism.languages.sql = {
|
|
|
2384
2384
|
punctuation: /[;[\]()`,.]/
|
|
2385
2385
|
};
|
|
2386
2386
|
(function(u) {
|
|
2387
|
-
var
|
|
2387
|
+
var d = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", n = {
|
|
2388
2388
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
2389
2389
|
lookbehind: !0,
|
|
2390
2390
|
alias: "punctuation",
|
|
2391
2391
|
// this looks reasonably well in all themes
|
|
2392
2392
|
inside: null
|
|
2393
2393
|
// see below
|
|
2394
|
-
},
|
|
2394
|
+
}, p = {
|
|
2395
2395
|
bash: n,
|
|
2396
2396
|
environment: {
|
|
2397
|
-
pattern: RegExp("\\$" +
|
|
2397
|
+
pattern: RegExp("\\$" + d),
|
|
2398
2398
|
alias: "constant"
|
|
2399
2399
|
},
|
|
2400
2400
|
variable: [
|
|
@@ -2434,7 +2434,7 @@ Prism.languages.sql = {
|
|
|
2434
2434
|
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
2435
2435
|
punctuation: /[\[\]]/,
|
|
2436
2436
|
environment: {
|
|
2437
|
-
pattern: RegExp("(\\{)" +
|
|
2437
|
+
pattern: RegExp("(\\{)" + d),
|
|
2438
2438
|
lookbehind: !0,
|
|
2439
2439
|
alias: "constant"
|
|
2440
2440
|
}
|
|
@@ -2483,7 +2483,7 @@ Prism.languages.sql = {
|
|
|
2483
2483
|
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
2484
2484
|
inside: {
|
|
2485
2485
|
environment: {
|
|
2486
|
-
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" +
|
|
2486
|
+
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + d),
|
|
2487
2487
|
lookbehind: !0,
|
|
2488
2488
|
alias: "constant"
|
|
2489
2489
|
}
|
|
@@ -2503,7 +2503,7 @@ Prism.languages.sql = {
|
|
|
2503
2503
|
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
2504
2504
|
lookbehind: !0,
|
|
2505
2505
|
greedy: !0,
|
|
2506
|
-
inside:
|
|
2506
|
+
inside: p
|
|
2507
2507
|
},
|
|
2508
2508
|
// Here-document with quotes around the tag
|
|
2509
2509
|
// → No expansion (so no “inside”).
|
|
@@ -2521,7 +2521,7 @@ Prism.languages.sql = {
|
|
|
2521
2521
|
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
2522
2522
|
lookbehind: !0,
|
|
2523
2523
|
greedy: !0,
|
|
2524
|
-
inside:
|
|
2524
|
+
inside: p
|
|
2525
2525
|
},
|
|
2526
2526
|
{
|
|
2527
2527
|
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
@@ -2534,15 +2534,15 @@ Prism.languages.sql = {
|
|
|
2534
2534
|
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
2535
2535
|
greedy: !0,
|
|
2536
2536
|
inside: {
|
|
2537
|
-
entity:
|
|
2537
|
+
entity: p.entity
|
|
2538
2538
|
}
|
|
2539
2539
|
}
|
|
2540
2540
|
],
|
|
2541
2541
|
environment: {
|
|
2542
|
-
pattern: RegExp("\\$?" +
|
|
2542
|
+
pattern: RegExp("\\$?" + d),
|
|
2543
2543
|
alias: "constant"
|
|
2544
2544
|
},
|
|
2545
|
-
variable:
|
|
2545
|
+
variable: p.variable,
|
|
2546
2546
|
function: {
|
|
2547
2547
|
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
2548
2548
|
lookbehind: !0
|
|
@@ -2582,7 +2582,7 @@ Prism.languages.sql = {
|
|
|
2582
2582
|
lookbehind: !0
|
|
2583
2583
|
}
|
|
2584
2584
|
}, n.inside = u.languages.bash;
|
|
2585
|
-
for (var
|
|
2585
|
+
for (var m = [
|
|
2586
2586
|
"comment",
|
|
2587
2587
|
"function-name",
|
|
2588
2588
|
"for-or-select",
|
|
@@ -2598,8 +2598,8 @@ Prism.languages.sql = {
|
|
|
2598
2598
|
"operator",
|
|
2599
2599
|
"punctuation",
|
|
2600
2600
|
"number"
|
|
2601
|
-
], R =
|
|
2602
|
-
R[
|
|
2601
|
+
], R = p.variable[1].inside, k = 0; k < m.length; k++)
|
|
2602
|
+
R[m[k]] = u.languages.bash[m[k]];
|
|
2603
2603
|
u.languages.sh = u.languages.bash, u.languages.shell = u.languages.bash;
|
|
2604
2604
|
})(Prism);
|
|
2605
2605
|
Prism.languages.json = {
|
|
@@ -2628,15 +2628,21 @@ Prism.languages.json = {
|
|
|
2628
2628
|
};
|
|
2629
2629
|
Prism.languages.webmanifest = Prism.languages.json;
|
|
2630
2630
|
const Rt = `
|
|
2631
|
+
/* 默认代码颜色 */
|
|
2632
|
+
.hep-cr-editor .hep-cr-highlight code,
|
|
2633
|
+
.hep-cr-editor .hep-cr-highlight pre {
|
|
2634
|
+
color: #f8f8f2 !important;
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2631
2637
|
.hep-cr-editor .token.comment,
|
|
2632
2638
|
.hep-cr-editor .token.prolog,
|
|
2633
2639
|
.hep-cr-editor .token.doctype,
|
|
2634
2640
|
.hep-cr-editor .token.cdata {
|
|
2635
|
-
color: #8292a2;
|
|
2641
|
+
color: #8292a2 !important;
|
|
2636
2642
|
}
|
|
2637
2643
|
|
|
2638
2644
|
.hep-cr-editor .token.punctuation {
|
|
2639
|
-
color: #f8f8f2;
|
|
2645
|
+
color: #f8f8f2 !important;
|
|
2640
2646
|
}
|
|
2641
2647
|
|
|
2642
2648
|
.hep-cr-editor .token.property,
|
|
@@ -2644,12 +2650,18 @@ const Rt = `
|
|
|
2644
2650
|
.hep-cr-editor .token.constant,
|
|
2645
2651
|
.hep-cr-editor .token.symbol,
|
|
2646
2652
|
.hep-cr-editor .token.deleted {
|
|
2647
|
-
color: #f92672;
|
|
2653
|
+
color: #f92672 !important;
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
/* console 单独处理 - 必须是白色 */
|
|
2657
|
+
.hep-cr-editor .token.property.console,
|
|
2658
|
+
.hep-cr-editor .token.console {
|
|
2659
|
+
color: #f8f8f2 !important;
|
|
2648
2660
|
}
|
|
2649
2661
|
|
|
2650
2662
|
.hep-cr-editor .token.boolean,
|
|
2651
2663
|
.hep-cr-editor .token.number {
|
|
2652
|
-
color: #ae81ff;
|
|
2664
|
+
color: #ae81ff !important;
|
|
2653
2665
|
}
|
|
2654
2666
|
|
|
2655
2667
|
.hep-cr-editor .token.selector,
|
|
@@ -2658,7 +2670,7 @@ const Rt = `
|
|
|
2658
2670
|
.hep-cr-editor .token.char,
|
|
2659
2671
|
.hep-cr-editor .token.builtin,
|
|
2660
2672
|
.hep-cr-editor .token.inserted {
|
|
2661
|
-
color: #a6e22e;
|
|
2673
|
+
color: #a6e22e !important;
|
|
2662
2674
|
}
|
|
2663
2675
|
|
|
2664
2676
|
.hep-cr-editor .token.operator,
|
|
@@ -2667,25 +2679,45 @@ const Rt = `
|
|
|
2667
2679
|
.hep-cr-editor .language-css .hep-cr-editor .token.string,
|
|
2668
2680
|
.hep-cr-editor .style .hep-cr-editor .token.string,
|
|
2669
2681
|
.hep-cr-editor .token.variable {
|
|
2670
|
-
color: #f8f8f2;
|
|
2682
|
+
color: #f8f8f2 !important;
|
|
2671
2683
|
}
|
|
2672
2684
|
|
|
2673
2685
|
.hep-cr-editor .token.atrule,
|
|
2674
2686
|
.hep-cr-editor .token.attr-value,
|
|
2675
2687
|
.hep-cr-editor .token.function,
|
|
2676
2688
|
.hep-cr-editor .token.class-name {
|
|
2677
|
-
color: #e6db74;
|
|
2689
|
+
color: #e6db74 !important;
|
|
2678
2690
|
}
|
|
2679
2691
|
|
|
2680
|
-
.hep-cr-editor .token.keyword
|
|
2681
|
-
|
|
2692
|
+
.hep-cr-editor .token.keyword,
|
|
2693
|
+
.hep-cr-editor .token.keyword-control {
|
|
2694
|
+
color: #66d9ef !important;
|
|
2682
2695
|
}
|
|
2683
2696
|
|
|
2684
2697
|
.hep-cr-editor .token.regex,
|
|
2685
2698
|
.hep-cr-editor .token.important {
|
|
2686
|
-
color: #fd971f;
|
|
2699
|
+
color: #fd971f !important;
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2702
|
+
/* 覆盖用户项目的 text-shadow 样式,避免白边 */
|
|
2703
|
+
.hep-cr-editor code[class*="language-"],
|
|
2704
|
+
.hep-cr-editor pre[class*="language-"],
|
|
2705
|
+
.hep-cr-editor .hep-cr-highlight code,
|
|
2706
|
+
.hep-cr-editor .hep-cr-highlight pre {
|
|
2707
|
+
text-shadow: none !important;
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
/* 覆盖 console 等内置对象 */
|
|
2711
|
+
.hep-cr-editor .token.console {
|
|
2712
|
+
color: #f8f8f2 !important;
|
|
2687
2713
|
}
|
|
2688
2714
|
`, _t = `
|
|
2715
|
+
/* 默认代码颜色 */
|
|
2716
|
+
.hep-cr-editor .hep-cr-highlight code,
|
|
2717
|
+
.hep-cr-editor .hep-cr-highlight pre {
|
|
2718
|
+
color: #333 !important;
|
|
2719
|
+
}
|
|
2720
|
+
|
|
2689
2721
|
.hep-cr-editor .token.comment,
|
|
2690
2722
|
.hep-cr-editor .token.prolog,
|
|
2691
2723
|
.hep-cr-editor .token.doctype,
|
|
@@ -2743,14 +2775,27 @@ const Rt = `
|
|
|
2743
2775
|
.hep-cr-editor .token.important {
|
|
2744
2776
|
color: #e36209;
|
|
2745
2777
|
}
|
|
2778
|
+
|
|
2779
|
+
/* 覆盖用户项目的 text-shadow 样式,避免白边 */
|
|
2780
|
+
.hep-cr-editor code[class*="language-"],
|
|
2781
|
+
.hep-cr-editor pre[class*="language-"],
|
|
2782
|
+
.hep-cr-editor .hep-cr-highlight code,
|
|
2783
|
+
.hep-cr-editor .hep-cr-highlight pre {
|
|
2784
|
+
text-shadow: none !important;
|
|
2785
|
+
}
|
|
2786
|
+
|
|
2787
|
+
/* 覆盖 console 等内置对象 */
|
|
2788
|
+
.hep-cr-editor .token.console {
|
|
2789
|
+
color: #333 !important;
|
|
2790
|
+
}
|
|
2746
2791
|
`;
|
|
2747
2792
|
window.Prism = Ne;
|
|
2748
2793
|
function Ft(u) {
|
|
2749
2794
|
if (typeof document > "u") return;
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2752
|
-
const
|
|
2753
|
-
|
|
2795
|
+
const d = "hep-cr-prism-styles", n = document.getElementById(d), p = u === "dark" ? Rt : _t;
|
|
2796
|
+
n && n.remove();
|
|
2797
|
+
const m = document.createElement("style");
|
|
2798
|
+
m.id = d, m.textContent = p, document.head.appendChild(m);
|
|
2754
2799
|
}
|
|
2755
2800
|
const Ot = {
|
|
2756
2801
|
javascript: "javascript",
|
|
@@ -2785,17 +2830,17 @@ const Ot = {
|
|
|
2785
2830
|
md: "markdown"
|
|
2786
2831
|
};
|
|
2787
2832
|
function It(u) {
|
|
2788
|
-
const
|
|
2789
|
-
return
|
|
2833
|
+
const d = document.createElement("div");
|
|
2834
|
+
return d.textContent = u, d.innerHTML;
|
|
2790
2835
|
}
|
|
2791
2836
|
const Nt = ({
|
|
2792
2837
|
value: u,
|
|
2793
|
-
language:
|
|
2838
|
+
language: d,
|
|
2794
2839
|
theme: n = "dark",
|
|
2795
|
-
disabled:
|
|
2796
|
-
onChange:
|
|
2840
|
+
disabled: p = !1,
|
|
2841
|
+
onChange: m
|
|
2797
2842
|
}) => {
|
|
2798
|
-
const R = Oe(null), k = Oe(null), l = Ee(() => Ot[
|
|
2843
|
+
const R = Oe(null), k = Oe(null), l = Ee(() => Ot[d.toLowerCase()] || "javascript", [d]), b = n === "dark" ? "#1e1e1e" : "#fafafa", y = Ee(() => {
|
|
2799
2844
|
try {
|
|
2800
2845
|
const I = Ne.languages[l];
|
|
2801
2846
|
if (I)
|
|
@@ -2804,37 +2849,37 @@ const Nt = ({
|
|
|
2804
2849
|
}
|
|
2805
2850
|
return It(u || "");
|
|
2806
2851
|
}, [u, l]), _ = (I) => {
|
|
2807
|
-
|
|
2852
|
+
m == null || m(I.target.value);
|
|
2808
2853
|
}, O = () => {
|
|
2809
2854
|
R.current && k.current && (k.current.scrollTop = R.current.scrollTop, k.current.scrollLeft = R.current.scrollLeft);
|
|
2810
2855
|
}, D = (I) => {
|
|
2811
2856
|
if (I.key === "Tab") {
|
|
2812
2857
|
I.preventDefault();
|
|
2813
|
-
const B = I.target, F = B.selectionStart,
|
|
2814
|
-
|
|
2858
|
+
const B = I.target, F = B.selectionStart, w = B.selectionEnd, T = u.substring(0, F) + " " + u.substring(w);
|
|
2859
|
+
m == null || m(T), requestAnimationFrame(() => {
|
|
2815
2860
|
B.selectionStart = B.selectionEnd = F + 2;
|
|
2816
2861
|
});
|
|
2817
2862
|
}
|
|
2818
2863
|
};
|
|
2819
2864
|
return ke(() => {
|
|
2820
2865
|
Ft(n);
|
|
2821
|
-
}, [n]), /* @__PURE__ */
|
|
2822
|
-
/* @__PURE__ */
|
|
2866
|
+
}, [n]), /* @__PURE__ */ g.jsxs("div", { className: `hep-cr-editor theme-${n}`, style: { background: b }, children: [
|
|
2867
|
+
/* @__PURE__ */ g.jsx(
|
|
2823
2868
|
"pre",
|
|
2824
2869
|
{
|
|
2825
2870
|
ref: k,
|
|
2826
2871
|
className: `hep-cr-highlight language-${l}`,
|
|
2827
2872
|
"aria-hidden": "true",
|
|
2828
|
-
children: /* @__PURE__ */
|
|
2873
|
+
children: /* @__PURE__ */ g.jsx("code", { dangerouslySetInnerHTML: { __html: y } })
|
|
2829
2874
|
}
|
|
2830
2875
|
),
|
|
2831
|
-
/* @__PURE__ */
|
|
2876
|
+
/* @__PURE__ */ g.jsx(
|
|
2832
2877
|
"textarea",
|
|
2833
2878
|
{
|
|
2834
2879
|
ref: R,
|
|
2835
2880
|
className: "hep-cr-input",
|
|
2836
2881
|
value: u,
|
|
2837
|
-
disabled:
|
|
2882
|
+
disabled: p,
|
|
2838
2883
|
onChange: _,
|
|
2839
2884
|
onScroll: O,
|
|
2840
2885
|
onKeyDown: D,
|
|
@@ -2904,18 +2949,18 @@ const Nt = ({
|
|
|
2904
2949
|
if (typeof document < "u") {
|
|
2905
2950
|
const u = "hep-cr-editor-styles";
|
|
2906
2951
|
if (!document.getElementById(u)) {
|
|
2907
|
-
const
|
|
2908
|
-
|
|
2952
|
+
const d = document.createElement("style");
|
|
2953
|
+
d.id = u, d.textContent = Ct, document.head.appendChild(d);
|
|
2909
2954
|
}
|
|
2910
2955
|
}
|
|
2911
|
-
var Lt = Object.defineProperty, Pt = (u,
|
|
2956
|
+
var Lt = Object.defineProperty, Pt = (u, d, n) => d in u ? Lt(u, d, { enumerable: !0, configurable: !0, writable: !0, value: n }) : u[d] = n, Ze = (u, d, n) => Pt(u, typeof d != "symbol" ? d + "" : d, n);
|
|
2912
2957
|
let _e = null;
|
|
2913
2958
|
class Dt {
|
|
2914
|
-
constructor(
|
|
2915
|
-
Ze(this, "baseUrl"), Ze(this, "timeout"), this.baseUrl =
|
|
2959
|
+
constructor(d = {}) {
|
|
2960
|
+
Ze(this, "baseUrl"), Ze(this, "timeout"), this.baseUrl = d.pistonUrl || "/api/piston", this.timeout = d.timeout || 3e3;
|
|
2916
2961
|
}
|
|
2917
|
-
async getRuntimes(
|
|
2918
|
-
if (_e && !
|
|
2962
|
+
async getRuntimes(d = !1) {
|
|
2963
|
+
if (_e && !d)
|
|
2919
2964
|
return _e;
|
|
2920
2965
|
try {
|
|
2921
2966
|
const n = await fetch(`${this.baseUrl}/runtimes`, {
|
|
@@ -2926,46 +2971,46 @@ class Dt {
|
|
|
2926
2971
|
});
|
|
2927
2972
|
if (!n.ok)
|
|
2928
2973
|
throw new Error(`Failed to fetch runtimes: ${n.statusText}`);
|
|
2929
|
-
const
|
|
2930
|
-
return _e =
|
|
2974
|
+
const p = await n.json();
|
|
2975
|
+
return _e = p, p;
|
|
2931
2976
|
} catch (n) {
|
|
2932
2977
|
throw console.error("Failed to fetch runtimes:", n), n;
|
|
2933
2978
|
}
|
|
2934
2979
|
}
|
|
2935
|
-
async execute(
|
|
2936
|
-
const
|
|
2937
|
-
(
|
|
2980
|
+
async execute(d, n, p = {}) {
|
|
2981
|
+
const m = (await this.getRuntimes()).find(
|
|
2982
|
+
(b) => {
|
|
2938
2983
|
var y;
|
|
2939
|
-
return
|
|
2984
|
+
return b.language.toLowerCase() === d.toLowerCase() || ((y = b.aliases) == null ? void 0 : y.some((_) => _.toLowerCase() === d.toLowerCase()));
|
|
2940
2985
|
}
|
|
2941
2986
|
);
|
|
2942
|
-
if (!
|
|
2943
|
-
throw new Error(`Language '${
|
|
2944
|
-
const R = this.getFileName(
|
|
2945
|
-
language:
|
|
2946
|
-
version:
|
|
2987
|
+
if (!m)
|
|
2988
|
+
throw new Error(`Language '${d}' is not supported`);
|
|
2989
|
+
const R = this.getFileName(d), k = {
|
|
2990
|
+
language: m.language,
|
|
2991
|
+
version: p.version || m.version,
|
|
2947
2992
|
files: [
|
|
2948
2993
|
{
|
|
2949
2994
|
name: R,
|
|
2950
2995
|
content: n
|
|
2951
2996
|
}
|
|
2952
2997
|
],
|
|
2953
|
-
stdin:
|
|
2954
|
-
args:
|
|
2955
|
-
run_timeout:
|
|
2998
|
+
stdin: p.stdin || "",
|
|
2999
|
+
args: p.args || [],
|
|
3000
|
+
run_timeout: p.runTimeout || this.timeout,
|
|
2956
3001
|
compile_timeout: this.timeout
|
|
2957
3002
|
}, l = Date.now();
|
|
2958
3003
|
try {
|
|
2959
|
-
const
|
|
3004
|
+
const b = await fetch(`${this.baseUrl}/execute`, {
|
|
2960
3005
|
method: "POST",
|
|
2961
3006
|
headers: {
|
|
2962
3007
|
"Content-Type": "application/json"
|
|
2963
3008
|
},
|
|
2964
3009
|
body: JSON.stringify(k)
|
|
2965
3010
|
});
|
|
2966
|
-
if (!
|
|
2967
|
-
throw new Error(`Execute failed: ${
|
|
2968
|
-
const y = await
|
|
3011
|
+
if (!b.ok)
|
|
3012
|
+
throw new Error(`Execute failed: ${b.statusText}`);
|
|
3013
|
+
const y = await b.json(), _ = Date.now() - l, O = y.run.stdout || "", D = y.run.stderr || "";
|
|
2969
3014
|
return {
|
|
2970
3015
|
success: y.run.code === 0,
|
|
2971
3016
|
output: O,
|
|
@@ -2978,17 +3023,17 @@ class Dt {
|
|
|
2978
3023
|
code: y.compile.code
|
|
2979
3024
|
} : void 0
|
|
2980
3025
|
};
|
|
2981
|
-
} catch (
|
|
3026
|
+
} catch (b) {
|
|
2982
3027
|
return {
|
|
2983
3028
|
success: !1,
|
|
2984
3029
|
output: "",
|
|
2985
|
-
stderr:
|
|
3030
|
+
stderr: b instanceof Error ? b.message : "Unknown error",
|
|
2986
3031
|
code: -1,
|
|
2987
3032
|
executionTime: Date.now() - l
|
|
2988
3033
|
};
|
|
2989
3034
|
}
|
|
2990
3035
|
}
|
|
2991
|
-
getFileName(
|
|
3036
|
+
getFileName(d) {
|
|
2992
3037
|
return {
|
|
2993
3038
|
javascript: "main.js",
|
|
2994
3039
|
typescript: "main.ts",
|
|
@@ -3015,7 +3060,7 @@ class Dt {
|
|
|
3015
3060
|
css: "style.css",
|
|
3016
3061
|
sql: "query.sql",
|
|
3017
3062
|
markdown: "readme.md"
|
|
3018
|
-
}[
|
|
3063
|
+
}[d.toLowerCase()] || `main.${d}`;
|
|
3019
3064
|
}
|
|
3020
3065
|
}
|
|
3021
3066
|
const jt = {
|
|
@@ -3117,29 +3162,29 @@ h1 {
|
|
|
3117
3162
|
This is a sample markdown document.`
|
|
3118
3163
|
};
|
|
3119
3164
|
function Fe(u) {
|
|
3120
|
-
const
|
|
3121
|
-
return jt[
|
|
3165
|
+
const d = u.toLowerCase();
|
|
3166
|
+
return jt[d] || `// ${u}
|
|
3122
3167
|
// Write your code here`;
|
|
3123
3168
|
}
|
|
3124
3169
|
const $t = ({
|
|
3125
3170
|
pistonUrl: u = "/api/piston",
|
|
3126
|
-
language:
|
|
3171
|
+
language: d = "javascript",
|
|
3127
3172
|
theme: n = "light",
|
|
3128
|
-
showLanguageSelector:
|
|
3129
|
-
showEditor:
|
|
3173
|
+
showLanguageSelector: p = !0,
|
|
3174
|
+
showEditor: m = !0,
|
|
3130
3175
|
editable: R = !0,
|
|
3131
3176
|
defaultCode: k = "",
|
|
3132
3177
|
executorLabel: l = "运行",
|
|
3133
|
-
onExecuteStart:
|
|
3178
|
+
onExecuteStart: b,
|
|
3134
3179
|
onExecuteEnd: y,
|
|
3135
3180
|
onLanguageChange: _
|
|
3136
3181
|
}) => {
|
|
3137
|
-
const [O, D] = Z([]), [I, B] = Z(
|
|
3138
|
-
value: `${
|
|
3139
|
-
label: `${
|
|
3182
|
+
const [O, D] = Z([]), [I, B] = Z(d), [F, w] = Z(n), [T, t] = Z(k), [r, i] = Z(""), [o, s] = Z(""), [f, E] = Z(!1), [h, C] = Z(null), [P, z] = Z("stdout"), [V, W] = Z(null), [ne, ue] = Z(!0), [ce, j] = Z(60), H = Ee(() => new Dt({ pistonUrl: u }), [u]), ee = Ee(() => O.map((S) => ({
|
|
3183
|
+
value: `${S.language}:${S.version}`,
|
|
3184
|
+
label: `${S.language.charAt(0).toUpperCase() + S.language.slice(1)} ${S.version}`
|
|
3140
3185
|
})), [O]), X = Ee(() => I.includes(":") ? I.split(":")[0] : I, [I]);
|
|
3141
3186
|
ke(() => {
|
|
3142
|
-
async function
|
|
3187
|
+
async function S() {
|
|
3143
3188
|
ue(!0), W(null);
|
|
3144
3189
|
try {
|
|
3145
3190
|
const M = await H.getRuntimes();
|
|
@@ -3150,13 +3195,13 @@ const $t = ({
|
|
|
3150
3195
|
ue(!1);
|
|
3151
3196
|
}
|
|
3152
3197
|
}
|
|
3153
|
-
|
|
3198
|
+
S();
|
|
3154
3199
|
}, [H]), ke(() => {
|
|
3155
3200
|
!T && O.length > 0 && t(k || Fe(X));
|
|
3156
3201
|
}, [O, T, k, X]);
|
|
3157
3202
|
const G = le(
|
|
3158
|
-
(
|
|
3159
|
-
const M =
|
|
3203
|
+
(S) => {
|
|
3204
|
+
const M = S.target.value, re = M.includes(":") ? M.split(":")[0] : M;
|
|
3160
3205
|
B(M);
|
|
3161
3206
|
const fe = Fe(re);
|
|
3162
3207
|
t(fe), _ == null || _(re, fe);
|
|
@@ -3164,12 +3209,12 @@ const $t = ({
|
|
|
3164
3209
|
[_]
|
|
3165
3210
|
), pe = le(async () => {
|
|
3166
3211
|
if (!f) {
|
|
3167
|
-
E(!0), i(""), s(""), C(null), W(null), z("stdout"),
|
|
3212
|
+
E(!0), i(""), s(""), C(null), W(null), z("stdout"), b == null || b();
|
|
3168
3213
|
try {
|
|
3169
|
-
const
|
|
3170
|
-
i(
|
|
3171
|
-
} catch (
|
|
3172
|
-
const M =
|
|
3214
|
+
const S = await H.execute(X, T);
|
|
3215
|
+
i(S.output), s(S.stderr), C(S.executionTime || null), z(S.stderr ? "stderr" : "stdout"), y == null || y(S);
|
|
3216
|
+
} catch (S) {
|
|
3217
|
+
const M = S instanceof Error ? S.message : "Execution failed";
|
|
3173
3218
|
W(M), y == null || y({
|
|
3174
3219
|
success: !1,
|
|
3175
3220
|
output: "",
|
|
@@ -3180,27 +3225,27 @@ const $t = ({
|
|
|
3180
3225
|
E(!1);
|
|
3181
3226
|
}
|
|
3182
3227
|
}
|
|
3183
|
-
}, [f, I, T, H,
|
|
3228
|
+
}, [f, I, T, H, b, y]), q = le(() => {
|
|
3184
3229
|
i(""), s(""), C(null), W(null);
|
|
3185
3230
|
}, []), se = le(async () => {
|
|
3186
|
-
const
|
|
3187
|
-
await navigator.clipboard.writeText(
|
|
3231
|
+
const S = P === "stdout" ? r : o;
|
|
3232
|
+
await navigator.clipboard.writeText(S);
|
|
3188
3233
|
}, [P, r, o]), ae = le(() => {
|
|
3189
3234
|
t(Fe(X));
|
|
3190
|
-
}, [I]), J = Oe(!1), ie = le((
|
|
3235
|
+
}, [I]), J = Oe(!1), ie = le((S) => {
|
|
3191
3236
|
J.current = !0, document.addEventListener("mousemove", oe), document.addEventListener("mouseup", te), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
3192
|
-
}, []), oe = le((
|
|
3237
|
+
}, []), oe = le((S) => {
|
|
3193
3238
|
if (!J.current) return;
|
|
3194
3239
|
const M = document.querySelector(".hep-cr-main");
|
|
3195
3240
|
if (!M) return;
|
|
3196
|
-
const re = M.getBoundingClientRect(), fe = (
|
|
3241
|
+
const re = M.getBoundingClientRect(), fe = (S.clientX - re.left) / re.width * 100;
|
|
3197
3242
|
j(Math.max(20, Math.min(80, fe)));
|
|
3198
3243
|
}, []), te = le(() => {
|
|
3199
3244
|
J.current = !1, document.removeEventListener("mousemove", oe), document.removeEventListener("mouseup", te), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
3200
3245
|
}, [oe]);
|
|
3201
|
-
return /* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3203
|
-
/* @__PURE__ */
|
|
3246
|
+
return /* @__PURE__ */ g.jsxs("div", { className: `hep-cr-runner hep-cr-runner-${F}`, children: [
|
|
3247
|
+
/* @__PURE__ */ g.jsxs("div", { className: "hep-cr-header", children: [
|
|
3248
|
+
/* @__PURE__ */ g.jsx("div", { className: "hep-cr-controls", children: p && /* @__PURE__ */ g.jsxs(
|
|
3204
3249
|
"select",
|
|
3205
3250
|
{
|
|
3206
3251
|
value: I,
|
|
@@ -3208,44 +3253,44 @@ const $t = ({
|
|
|
3208
3253
|
className: "hep-cr-language-select",
|
|
3209
3254
|
disabled: f,
|
|
3210
3255
|
children: [
|
|
3211
|
-
ne && /* @__PURE__ */
|
|
3212
|
-
ee.map((
|
|
3256
|
+
ne && /* @__PURE__ */ g.jsx("option", { value: "", children: "加载中..." }),
|
|
3257
|
+
ee.map((S) => /* @__PURE__ */ g.jsx("option", { value: S.value, children: S.label }, S.value))
|
|
3213
3258
|
]
|
|
3214
3259
|
}
|
|
3215
3260
|
) }),
|
|
3216
|
-
/* @__PURE__ */
|
|
3217
|
-
/* @__PURE__ */
|
|
3261
|
+
/* @__PURE__ */ g.jsxs("div", { className: "hep-cr-actions", children: [
|
|
3262
|
+
/* @__PURE__ */ g.jsxs(
|
|
3218
3263
|
"button",
|
|
3219
3264
|
{
|
|
3220
3265
|
className: "hep-cr-btn hep-cr-btn-run",
|
|
3221
3266
|
disabled: f || ne,
|
|
3222
3267
|
onClick: pe,
|
|
3223
3268
|
children: [
|
|
3224
|
-
f ? /* @__PURE__ */
|
|
3269
|
+
f ? /* @__PURE__ */ g.jsx("span", { className: "hep-cr-spinner" }) : /* @__PURE__ */ g.jsx("span", { className: "hep-cr-run-icon", children: "▶" }),
|
|
3225
3270
|
f ? "运行中..." : l
|
|
3226
3271
|
]
|
|
3227
3272
|
}
|
|
3228
3273
|
),
|
|
3229
|
-
|
|
3230
|
-
/* @__PURE__ */
|
|
3274
|
+
m && R && /* @__PURE__ */ g.jsx("button", { className: "hep-cr-btn hep-cr-btn-reset", onClick: ae, children: "重置" }),
|
|
3275
|
+
/* @__PURE__ */ g.jsx(
|
|
3231
3276
|
"button",
|
|
3232
3277
|
{
|
|
3233
3278
|
className: "hep-cr-btn hep-cr-btn-theme",
|
|
3234
|
-
onClick: () =>
|
|
3279
|
+
onClick: () => w(F === "light" ? "dark" : "light"),
|
|
3235
3280
|
title: F === "light" ? "Switch to dark mode" : "Switch to light mode",
|
|
3236
3281
|
children: F === "light" ? "🌙" : "☀️"
|
|
3237
3282
|
}
|
|
3238
3283
|
)
|
|
3239
3284
|
] })
|
|
3240
3285
|
] }),
|
|
3241
|
-
V && /* @__PURE__ */
|
|
3242
|
-
/* @__PURE__ */
|
|
3243
|
-
|
|
3244
|
-
/* @__PURE__ */
|
|
3245
|
-
/* @__PURE__ */
|
|
3246
|
-
/* @__PURE__ */
|
|
3286
|
+
V && /* @__PURE__ */ g.jsx("div", { className: "hep-cr-error-message", children: V }),
|
|
3287
|
+
/* @__PURE__ */ g.jsxs("div", { className: "hep-cr-main", children: [
|
|
3288
|
+
m && /* @__PURE__ */ g.jsxs("div", { className: "hep-cr-editor-panel", style: { width: `${ce}%` }, children: [
|
|
3289
|
+
/* @__PURE__ */ g.jsxs("div", { className: "hep-cr-panel-header", children: [
|
|
3290
|
+
/* @__PURE__ */ g.jsx("span", { className: "hep-cr-panel-title", children: "编辑器" }),
|
|
3291
|
+
/* @__PURE__ */ g.jsx("span", { className: "hep-cr-language-badge", children: X })
|
|
3247
3292
|
] }),
|
|
3248
|
-
/* @__PURE__ */
|
|
3293
|
+
/* @__PURE__ */ g.jsx(
|
|
3249
3294
|
Nt,
|
|
3250
3295
|
{
|
|
3251
3296
|
value: T,
|
|
@@ -3256,16 +3301,16 @@ const $t = ({
|
|
|
3256
3301
|
}
|
|
3257
3302
|
)
|
|
3258
3303
|
] }),
|
|
3259
|
-
|
|
3260
|
-
/* @__PURE__ */
|
|
3304
|
+
m && /* @__PURE__ */ g.jsx("div", { className: "hep-cr-resize-handle", onMouseDown: ie, children: /* @__PURE__ */ g.jsx("div", { className: "hep-cr-resize-line" }) }),
|
|
3305
|
+
/* @__PURE__ */ g.jsxs(
|
|
3261
3306
|
"div",
|
|
3262
3307
|
{
|
|
3263
3308
|
className: "hep-cr-output-panel",
|
|
3264
|
-
style: { width:
|
|
3309
|
+
style: { width: m ? `${100 - ce}%` : "100%" },
|
|
3265
3310
|
children: [
|
|
3266
|
-
/* @__PURE__ */
|
|
3267
|
-
/* @__PURE__ */
|
|
3268
|
-
/* @__PURE__ */
|
|
3311
|
+
/* @__PURE__ */ g.jsxs("div", { className: "hep-cr-panel-header", children: [
|
|
3312
|
+
/* @__PURE__ */ g.jsxs("div", { className: "hep-cr-output-tabs", children: [
|
|
3313
|
+
/* @__PURE__ */ g.jsx(
|
|
3269
3314
|
"button",
|
|
3270
3315
|
{
|
|
3271
3316
|
className: `hep-cr-tab ${P === "stdout" ? "active" : ""}`,
|
|
@@ -3273,7 +3318,7 @@ const $t = ({
|
|
|
3273
3318
|
children: "输出"
|
|
3274
3319
|
}
|
|
3275
3320
|
),
|
|
3276
|
-
o && /* @__PURE__ */
|
|
3321
|
+
o && /* @__PURE__ */ g.jsx(
|
|
3277
3322
|
"button",
|
|
3278
3323
|
{
|
|
3279
3324
|
className: `hep-cr-tab ${P === "stderr" ? "active" : ""}`,
|
|
@@ -3282,12 +3327,12 @@ const $t = ({
|
|
|
3282
3327
|
}
|
|
3283
3328
|
)
|
|
3284
3329
|
] }),
|
|
3285
|
-
/* @__PURE__ */
|
|
3286
|
-
|
|
3287
|
-
|
|
3330
|
+
/* @__PURE__ */ g.jsxs("div", { className: "hep-cr-output-actions", children: [
|
|
3331
|
+
h !== null && /* @__PURE__ */ g.jsxs("span", { className: "hep-cr-execution-time", children: [
|
|
3332
|
+
h,
|
|
3288
3333
|
"ms"
|
|
3289
3334
|
] }),
|
|
3290
|
-
/* @__PURE__ */
|
|
3335
|
+
/* @__PURE__ */ g.jsx("button", { className: "hep-cr-btn-icon", onClick: se, title: "复制", children: /* @__PURE__ */ g.jsxs(
|
|
3291
3336
|
"svg",
|
|
3292
3337
|
{
|
|
3293
3338
|
width: "14",
|
|
@@ -3297,12 +3342,12 @@ const $t = ({
|
|
|
3297
3342
|
stroke: "currentColor",
|
|
3298
3343
|
strokeWidth: "2",
|
|
3299
3344
|
children: [
|
|
3300
|
-
/* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3345
|
+
/* @__PURE__ */ g.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
3346
|
+
/* @__PURE__ */ g.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
3302
3347
|
]
|
|
3303
3348
|
}
|
|
3304
3349
|
) }),
|
|
3305
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ g.jsx("button", { className: "hep-cr-btn-icon", onClick: q, title: "清除", children: /* @__PURE__ */ g.jsxs(
|
|
3306
3351
|
"svg",
|
|
3307
3352
|
{
|
|
3308
3353
|
width: "14",
|
|
@@ -3312,19 +3357,19 @@ const $t = ({
|
|
|
3312
3357
|
stroke: "currentColor",
|
|
3313
3358
|
strokeWidth: "2",
|
|
3314
3359
|
children: [
|
|
3315
|
-
/* @__PURE__ */
|
|
3316
|
-
/* @__PURE__ */
|
|
3360
|
+
/* @__PURE__ */ g.jsx("polyline", { points: "3 6 5 6 21 6" }),
|
|
3361
|
+
/* @__PURE__ */ g.jsx("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" })
|
|
3317
3362
|
]
|
|
3318
3363
|
}
|
|
3319
3364
|
) })
|
|
3320
3365
|
] })
|
|
3321
3366
|
] }),
|
|
3322
|
-
/* @__PURE__ */
|
|
3367
|
+
/* @__PURE__ */ g.jsx("div", { className: "hep-cr-output-content", children: /* @__PURE__ */ g.jsx("pre", { children: P === "stdout" ? r || '点击"运行"执行代码' : o }) })
|
|
3323
3368
|
]
|
|
3324
3369
|
}
|
|
3325
3370
|
)
|
|
3326
3371
|
] }),
|
|
3327
|
-
/* @__PURE__ */
|
|
3372
|
+
/* @__PURE__ */ g.jsx("style", { children: `
|
|
3328
3373
|
.hep-cr-runner {
|
|
3329
3374
|
display: flex;
|
|
3330
3375
|
flex-direction: column;
|
|
@@ -3544,32 +3589,32 @@ const $t = ({
|
|
|
3544
3589
|
}, Mt = xt(
|
|
3545
3590
|
({
|
|
3546
3591
|
open: u,
|
|
3547
|
-
defaultOpen:
|
|
3592
|
+
defaultOpen: d = !1,
|
|
3548
3593
|
title: n = "代码执行器",
|
|
3549
|
-
width:
|
|
3550
|
-
onClose:
|
|
3594
|
+
width: p = 800,
|
|
3595
|
+
onClose: m,
|
|
3551
3596
|
footer: R,
|
|
3552
3597
|
theme: k = "light",
|
|
3553
3598
|
...l
|
|
3554
|
-
},
|
|
3555
|
-
const [y, _] = Z(
|
|
3599
|
+
}, b) => {
|
|
3600
|
+
const [y, _] = Z(d), O = u !== void 0, D = O ? u : y;
|
|
3556
3601
|
ke(() => {
|
|
3557
3602
|
O && u !== y && _(u);
|
|
3558
3603
|
}, [u, O]);
|
|
3559
3604
|
const I = le(() => {
|
|
3560
|
-
O || _(!1),
|
|
3561
|
-
}, [O,
|
|
3562
|
-
|
|
3605
|
+
O || _(!1), m == null || m();
|
|
3606
|
+
}, [O, m]), B = (w) => {
|
|
3607
|
+
w.target === w.currentTarget && I();
|
|
3563
3608
|
};
|
|
3564
|
-
kt(
|
|
3609
|
+
kt(b, () => ({
|
|
3565
3610
|
close: I
|
|
3566
3611
|
}));
|
|
3567
|
-
const F = typeof
|
|
3568
|
-
return D ? /* @__PURE__ */
|
|
3569
|
-
/* @__PURE__ */
|
|
3570
|
-
/* @__PURE__ */
|
|
3571
|
-
/* @__PURE__ */
|
|
3572
|
-
/* @__PURE__ */
|
|
3612
|
+
const F = typeof p == "number" ? `${p}px` : p;
|
|
3613
|
+
return D ? /* @__PURE__ */ g.jsxs("div", { className: "hep-cr-dialog-overlay", onClick: B, children: [
|
|
3614
|
+
/* @__PURE__ */ g.jsxs("div", { className: "hep-cr-dialog-container", style: { width: F }, children: [
|
|
3615
|
+
/* @__PURE__ */ g.jsxs("div", { className: "hep-cr-dialog-header", children: [
|
|
3616
|
+
/* @__PURE__ */ g.jsx("h3", { className: "hep-cr-dialog-title", children: n }),
|
|
3617
|
+
/* @__PURE__ */ g.jsx("button", { className: "hep-cr-dialog-close", onClick: I, children: /* @__PURE__ */ g.jsxs(
|
|
3573
3618
|
"svg",
|
|
3574
3619
|
{
|
|
3575
3620
|
width: "16",
|
|
@@ -3579,16 +3624,16 @@ const $t = ({
|
|
|
3579
3624
|
stroke: "currentColor",
|
|
3580
3625
|
strokeWidth: "2",
|
|
3581
3626
|
children: [
|
|
3582
|
-
/* @__PURE__ */
|
|
3583
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ g.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
3628
|
+
/* @__PURE__ */ g.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
3584
3629
|
]
|
|
3585
3630
|
}
|
|
3586
3631
|
) })
|
|
3587
3632
|
] }),
|
|
3588
|
-
/* @__PURE__ */
|
|
3589
|
-
R && /* @__PURE__ */
|
|
3633
|
+
/* @__PURE__ */ g.jsx("div", { className: "hep-cr-dialog-body", children: /* @__PURE__ */ g.jsx($t, { theme: k, ...l }) }),
|
|
3634
|
+
R && /* @__PURE__ */ g.jsx("div", { className: "hep-cr-dialog-footer", children: R })
|
|
3590
3635
|
] }),
|
|
3591
|
-
/* @__PURE__ */
|
|
3636
|
+
/* @__PURE__ */ g.jsx("style", { children: `
|
|
3592
3637
|
.hep-cr-dialog-overlay {
|
|
3593
3638
|
position: fixed;
|
|
3594
3639
|
top: 0;
|