@hep-code-runner/vue3 1.5.0 → 1.5.3

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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as ie, useCssVars as be, ref as N, computed as G, onMounted as pe, watch as le, openBlock as _, createElementBlock as R, normalizeClass as W, createElementVNode as E, withDirectives as Ee, createCommentVNode as U, Fragment as ve, renderList as ye, toDisplayString as H, vModelSelect as Ae, createTextVNode as Se, normalizeStyle as se, createVNode as oe, createBlock as ke, Teleport as we, Transition as Te, withCtx as Ie, normalizeProps as Fe, guardReactiveProps as _e, renderSlot as Re } from "vue";
1
+ import { defineComponent as ie, useCssVars as be, ref as N, computed as G, onMounted as pe, watch as le, openBlock as _, createElementBlock as R, normalizeClass as W, createElementVNode as E, withDirectives as Ee, createCommentVNode as U, Fragment as ve, renderList as ye, toDisplayString as H, vModelSelect as Ae, createTextVNode as Se, normalizeStyle as oe, createVNode as se, createBlock as ke, Teleport as we, Transition as Te, withCtx as Ie, normalizeProps as Fe, guardReactiveProps as _e, renderSlot as Re } from "vue";
2
2
  var xe = Object.defineProperty, Oe = (i, d, n) => d in i ? xe(i, d, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[d] = n, ce = (i, d, n) => Oe(i, typeof d != "symbol" ? d + "" : d, n);
3
3
  let ne = null;
4
4
  class Le {
@@ -45,7 +45,7 @@ class Le {
45
45
  args: l.args || [],
46
46
  run_timeout: l.runTimeout || this.timeout,
47
47
  compile_timeout: this.timeout
48
- }, s = Date.now();
48
+ }, o = Date.now();
49
49
  try {
50
50
  const f = await fetch(`${this.baseUrl}/execute`, {
51
51
  method: "POST",
@@ -56,7 +56,7 @@ class Le {
56
56
  });
57
57
  if (!f.ok)
58
58
  throw new Error(`Execute failed: ${f.statusText}`);
59
- const m = await f.json(), T = Date.now() - s, L = m.run.stdout || "", I = m.run.stderr || "";
59
+ const m = await f.json(), T = Date.now() - o, L = m.run.stdout || "", I = m.run.stderr || "";
60
60
  return {
61
61
  success: m.run.code === 0,
62
62
  output: L,
@@ -75,7 +75,7 @@ class Le {
75
75
  output: "",
76
76
  stderr: f instanceof Error ? f.message : "Unknown error",
77
77
  code: -1,
78
- executionTime: Date.now() - s
78
+ executionTime: Date.now() - o
79
79
  };
80
80
  }
81
81
  }
@@ -207,7 +207,7 @@ h1 {
207
207
 
208
208
  This is a sample markdown document.`
209
209
  };
210
- function ae(i) {
210
+ function re(i) {
211
211
  const d = i.toLowerCase();
212
212
  return Ne[d] || `// ${i}
213
213
  // Write your code here`;
@@ -228,7 +228,7 @@ var ge = { exports: {} };
228
228
  * @public
229
229
  */
230
230
  var n = function(l) {
231
- var h = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, y = 0, A = {}, s = {
231
+ var h = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, y = 0, A = {}, o = {
232
232
  /**
233
233
  * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
234
234
  * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
@@ -324,28 +324,28 @@ var ge = { exports: {} };
324
324
  * @returns {T}
325
325
  * @template T
326
326
  */
327
- clone: function t(e, a) {
328
- a = a || {};
329
- var r, o;
330
- switch (s.util.type(e)) {
327
+ clone: function t(e, r) {
328
+ r = r || {};
329
+ var a, s;
330
+ switch (o.util.type(e)) {
331
331
  case "Object":
332
- if (o = s.util.objId(e), a[o])
333
- return a[o];
334
- r = /** @type {Record<string, any>} */
335
- {}, a[o] = r;
332
+ if (s = o.util.objId(e), r[s])
333
+ return r[s];
334
+ a = /** @type {Record<string, any>} */
335
+ {}, r[s] = a;
336
336
  for (var c in e)
337
- e.hasOwnProperty(c) && (r[c] = t(e[c], a));
337
+ e.hasOwnProperty(c) && (a[c] = t(e[c], r));
338
338
  return (
339
339
  /** @type {any} */
340
- r
340
+ a
341
341
  );
342
342
  case "Array":
343
- return o = s.util.objId(e), a[o] ? a[o] : (r = [], a[o] = r, /** @type {Array} */
343
+ return s = o.util.objId(e), r[s] ? r[s] : (a = [], r[s] = a, /** @type {Array} */
344
344
  /** @type {any} */
345
345
  e.forEach(function(b, u) {
346
- r[u] = t(b, a);
346
+ a[u] = t(b, r);
347
347
  }), /** @type {any} */
348
- r);
348
+ a);
349
349
  default:
350
350
  return e;
351
351
  }
@@ -394,13 +394,13 @@ var ge = { exports: {} };
394
394
  );
395
395
  try {
396
396
  throw new Error();
397
- } catch (r) {
398
- var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack) || [])[1];
397
+ } catch (a) {
398
+ var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(a.stack) || [])[1];
399
399
  if (t) {
400
400
  var e = document.getElementsByTagName("script");
401
- for (var a in e)
402
- if (e[a].src == t)
403
- return e[a];
401
+ for (var r in e)
402
+ if (e[r].src == t)
403
+ return e[r];
404
404
  }
405
405
  return null;
406
406
  }
@@ -424,16 +424,16 @@ var ge = { exports: {} };
424
424
  * @param {boolean} [defaultActivation=false]
425
425
  * @returns {boolean}
426
426
  */
427
- isActive: function(t, e, a) {
428
- for (var r = "no-" + e; t; ) {
429
- var o = t.classList;
430
- if (o.contains(e))
427
+ isActive: function(t, e, r) {
428
+ for (var a = "no-" + e; t; ) {
429
+ var s = t.classList;
430
+ if (s.contains(e))
431
431
  return !0;
432
- if (o.contains(r))
432
+ if (s.contains(a))
433
433
  return !1;
434
434
  t = t.parentElement;
435
435
  }
436
- return !!a;
436
+ return !!r;
437
437
  }
438
438
  },
439
439
  /**
@@ -480,10 +480,10 @@ var ge = { exports: {} };
480
480
  * });
481
481
  */
482
482
  extend: function(t, e) {
483
- var a = s.util.clone(s.languages[t]);
484
- for (var r in e)
485
- a[r] = e[r];
486
- return a;
483
+ var r = o.util.clone(o.languages[t]);
484
+ for (var a in e)
485
+ r[a] = e[a];
486
+ return r;
487
487
  },
488
488
  /**
489
489
  * Inserts tokens _before_ another token in a language definition or any other grammar.
@@ -560,31 +560,31 @@ var ge = { exports: {} };
560
560
  * @returns {Grammar} The new grammar object.
561
561
  * @public
562
562
  */
563
- insertBefore: function(t, e, a, r) {
564
- r = r || /** @type {any} */
565
- s.languages;
566
- var o = r[t], c = {};
567
- for (var b in o)
568
- if (o.hasOwnProperty(b)) {
563
+ insertBefore: function(t, e, r, a) {
564
+ a = a || /** @type {any} */
565
+ o.languages;
566
+ var s = a[t], c = {};
567
+ for (var b in s)
568
+ if (s.hasOwnProperty(b)) {
569
569
  if (b == e)
570
- for (var u in a)
571
- a.hasOwnProperty(u) && (c[u] = a[u]);
572
- a.hasOwnProperty(b) || (c[b] = o[b]);
570
+ for (var u in r)
571
+ r.hasOwnProperty(u) && (c[u] = r[u]);
572
+ r.hasOwnProperty(b) || (c[b] = s[b]);
573
573
  }
574
- var k = r[t];
575
- return r[t] = c, s.languages.DFS(s.languages, function(F, P) {
574
+ var k = a[t];
575
+ return a[t] = c, o.languages.DFS(o.languages, function(F, P) {
576
576
  P === k && F != t && (this[F] = c);
577
577
  }), c;
578
578
  },
579
579
  // Traverse a language definition with Depth First Search
580
- DFS: function t(e, a, r, o) {
581
- o = o || {};
582
- var c = s.util.objId;
580
+ DFS: function t(e, r, a, s) {
581
+ s = s || {};
582
+ var c = o.util.objId;
583
583
  for (var b in e)
584
584
  if (e.hasOwnProperty(b)) {
585
- a.call(e, b, e[b], r || b);
586
- var u = e[b], k = s.util.type(u);
587
- k === "Object" && !o[c(u)] ? (o[c(u)] = !0, t(u, a, null, o)) : k === "Array" && !o[c(u)] && (o[c(u)] = !0, t(u, a, b, o));
585
+ r.call(e, b, e[b], a || b);
586
+ var u = e[b], k = o.util.type(u);
587
+ k === "Object" && !s[c(u)] ? (s[c(u)] = !0, t(u, r, null, s)) : k === "Array" && !s[c(u)] && (s[c(u)] = !0, t(u, r, b, s));
588
588
  }
589
589
  }
590
590
  },
@@ -602,7 +602,7 @@ var ge = { exports: {} };
602
602
  * @public
603
603
  */
604
604
  highlightAll: function(t, e) {
605
- s.highlightAllUnder(document, t, e);
605
+ o.highlightAllUnder(document, t, e);
606
606
  },
607
607
  /**
608
608
  * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
@@ -619,15 +619,15 @@ var ge = { exports: {} };
619
619
  * @memberof Prism
620
620
  * @public
621
621
  */
622
- highlightAllUnder: function(t, e, a) {
623
- var r = {
624
- callback: a,
622
+ highlightAllUnder: function(t, e, r) {
623
+ var a = {
624
+ callback: r,
625
625
  container: t,
626
626
  selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
627
627
  };
628
- s.hooks.run("before-highlightall", r), r.elements = Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)), s.hooks.run("before-all-elements-highlight", r);
629
- for (var o = 0, c; c = r.elements[o++]; )
630
- s.highlightElement(c, e === !0, r.callback);
628
+ o.hooks.run("before-highlightall", a), a.elements = Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)), o.hooks.run("before-all-elements-highlight", a);
629
+ for (var s = 0, c; c = a.elements[s++]; )
630
+ o.highlightElement(c, e === !0, a.callback);
631
631
  },
632
632
  /**
633
633
  * Highlights the code inside a single element.
@@ -657,30 +657,30 @@ var ge = { exports: {} };
657
657
  * @memberof Prism
658
658
  * @public
659
659
  */
660
- highlightElement: function(t, e, a) {
661
- var r = s.util.getLanguage(t), o = s.languages[r];
662
- s.util.setLanguage(t, r);
660
+ highlightElement: function(t, e, r) {
661
+ var a = o.util.getLanguage(t), s = o.languages[a];
662
+ o.util.setLanguage(t, a);
663
663
  var c = t.parentElement;
664
- c && c.nodeName.toLowerCase() === "pre" && s.util.setLanguage(c, r);
664
+ c && c.nodeName.toLowerCase() === "pre" && o.util.setLanguage(c, a);
665
665
  var b = t.textContent, u = {
666
666
  element: t,
667
- language: r,
668
- grammar: o,
667
+ language: a,
668
+ grammar: s,
669
669
  code: b
670
670
  };
671
671
  function k(P) {
672
- u.highlightedCode = P, s.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, s.hooks.run("after-highlight", u), s.hooks.run("complete", u), a && a.call(u.element);
672
+ u.highlightedCode = P, o.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, o.hooks.run("after-highlight", u), o.hooks.run("complete", u), r && r.call(u.element);
673
673
  }
674
- if (s.hooks.run("before-sanity-check", u), c = u.element.parentElement, c && c.nodeName.toLowerCase() === "pre" && !c.hasAttribute("tabindex") && c.setAttribute("tabindex", "0"), !u.code) {
675
- s.hooks.run("complete", u), a && a.call(u.element);
674
+ if (o.hooks.run("before-sanity-check", u), c = u.element.parentElement, c && c.nodeName.toLowerCase() === "pre" && !c.hasAttribute("tabindex") && c.setAttribute("tabindex", "0"), !u.code) {
675
+ o.hooks.run("complete", u), r && r.call(u.element);
676
676
  return;
677
677
  }
678
- if (s.hooks.run("before-highlight", u), !u.grammar) {
679
- k(s.util.encode(u.code));
678
+ if (o.hooks.run("before-highlight", u), !u.grammar) {
679
+ k(o.util.encode(u.code));
680
680
  return;
681
681
  }
682
682
  if (e && l.Worker) {
683
- var F = new Worker(s.filename);
683
+ var F = new Worker(o.filename);
684
684
  F.onmessage = function(P) {
685
685
  k(P.data);
686
686
  }, F.postMessage(JSON.stringify({
@@ -689,7 +689,7 @@ var ge = { exports: {} };
689
689
  immediateClose: !0
690
690
  }));
691
691
  } else
692
- k(s.highlight(u.code, u.grammar, u.language));
692
+ k(o.highlight(u.code, u.grammar, u.language));
693
693
  },
694
694
  /**
695
695
  * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
@@ -711,15 +711,15 @@ var ge = { exports: {} };
711
711
  * @example
712
712
  * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
713
713
  */
714
- highlight: function(t, e, a) {
715
- var r = {
714
+ highlight: function(t, e, r) {
715
+ var a = {
716
716
  code: t,
717
717
  grammar: e,
718
- language: a
718
+ language: r
719
719
  };
720
- if (s.hooks.run("before-tokenize", r), !r.grammar)
721
- throw new Error('The language "' + r.language + '" has no grammar.');
722
- return r.tokens = s.tokenize(r.code, r.grammar), s.hooks.run("after-tokenize", r), f.stringify(s.util.encode(r.tokens), r.language);
720
+ if (o.hooks.run("before-tokenize", a), !a.grammar)
721
+ throw new Error('The language "' + a.language + '" has no grammar.');
722
+ return a.tokens = o.tokenize(a.code, a.grammar), o.hooks.run("after-tokenize", a), f.stringify(o.util.encode(a.tokens), a.language);
723
723
  },
724
724
  /**
725
725
  * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
@@ -746,14 +746,14 @@ var ge = { exports: {} };
746
746
  * });
747
747
  */
748
748
  tokenize: function(t, e) {
749
- var a = e.rest;
750
- if (a) {
751
- for (var r in a)
752
- e[r] = a[r];
749
+ var r = e.rest;
750
+ if (r) {
751
+ for (var a in r)
752
+ e[a] = r[a];
753
753
  delete e.rest;
754
754
  }
755
- var o = new L();
756
- return I(o, o.head, t), T(t, o, e, o.head, 0), D(o);
755
+ var s = new L();
756
+ return I(s, s.head, t), T(t, s, e, s.head, 0), D(s);
757
757
  },
758
758
  /**
759
759
  * @namespace
@@ -775,8 +775,8 @@ var ge = { exports: {} };
775
775
  * @public
776
776
  */
777
777
  add: function(t, e) {
778
- var a = s.hooks.all;
779
- a[t] = a[t] || [], a[t].push(e);
778
+ var r = o.hooks.all;
779
+ r[t] = r[t] || [], r[t].push(e);
780
780
  },
781
781
  /**
782
782
  * Runs a hook invoking all registered callbacks with the given environment variables.
@@ -788,54 +788,54 @@ var ge = { exports: {} };
788
788
  * @public
789
789
  */
790
790
  run: function(t, e) {
791
- var a = s.hooks.all[t];
792
- if (!(!a || !a.length))
793
- for (var r = 0, o; o = a[r++]; )
794
- o(e);
791
+ var r = o.hooks.all[t];
792
+ if (!(!r || !r.length))
793
+ for (var a = 0, s; s = r[a++]; )
794
+ s(e);
795
795
  }
796
796
  },
797
797
  Token: f
798
798
  };
799
- l.Prism = s;
800
- function f(t, e, a, r) {
801
- this.type = t, this.content = e, this.alias = a, this.length = (r || "").length | 0;
799
+ l.Prism = o;
800
+ function f(t, e, r, a) {
801
+ this.type = t, this.content = e, this.alias = r, this.length = (a || "").length | 0;
802
802
  }
803
- f.stringify = function t(e, a) {
803
+ f.stringify = function t(e, r) {
804
804
  if (typeof e == "string")
805
805
  return e;
806
806
  if (Array.isArray(e)) {
807
- var r = "";
807
+ var a = "";
808
808
  return e.forEach(function(k) {
809
- r += t(k, a);
810
- }), r;
809
+ a += t(k, r);
810
+ }), a;
811
811
  }
812
- var o = {
812
+ var s = {
813
813
  type: e.type,
814
- content: t(e.content, a),
814
+ content: t(e.content, r),
815
815
  tag: "span",
816
816
  classes: ["token", e.type],
817
817
  attributes: {},
818
- language: a
818
+ language: r
819
819
  }, c = e.alias;
820
- c && (Array.isArray(c) ? Array.prototype.push.apply(o.classes, c) : o.classes.push(c)), s.hooks.run("wrap", o);
820
+ c && (Array.isArray(c) ? Array.prototype.push.apply(s.classes, c) : s.classes.push(c)), o.hooks.run("wrap", s);
821
821
  var b = "";
822
- for (var u in o.attributes)
823
- b += " " + u + '="' + (o.attributes[u] || "").replace(/"/g, "&quot;") + '"';
824
- return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + b + ">" + o.content + "</" + o.tag + ">";
822
+ for (var u in s.attributes)
823
+ b += " " + u + '="' + (s.attributes[u] || "").replace(/"/g, "&quot;") + '"';
824
+ return "<" + s.tag + ' class="' + s.classes.join(" ") + '"' + b + ">" + s.content + "</" + s.tag + ">";
825
825
  };
826
- function m(t, e, a, r) {
826
+ function m(t, e, r, a) {
827
827
  t.lastIndex = e;
828
- var o = t.exec(a);
829
- if (o && r && o[1]) {
830
- var c = o[1].length;
831
- o.index += c, o[0] = o[0].slice(c);
828
+ var s = t.exec(r);
829
+ if (s && a && s[1]) {
830
+ var c = s[1].length;
831
+ s.index += c, s[0] = s[0].slice(c);
832
832
  }
833
- return o;
833
+ return s;
834
834
  }
835
- function T(t, e, a, r, o, c) {
836
- for (var b in a)
837
- if (!(!a.hasOwnProperty(b) || !a[b])) {
838
- var u = a[b];
835
+ function T(t, e, r, a, s, c) {
836
+ for (var b in r)
837
+ if (!(!r.hasOwnProperty(b) || !r[b])) {
838
+ var u = r[b];
839
839
  u = Array.isArray(u) ? u : [u];
840
840
  for (var k = 0; k < u.length; ++k) {
841
841
  if (c && c.cause == b + "," + k)
@@ -845,7 +845,7 @@ var ge = { exports: {} };
845
845
  var x = F.pattern.toString().match(/[imsuy]*$/)[0];
846
846
  F.pattern = RegExp(F.pattern.source, x + "g");
847
847
  }
848
- for (var Y = F.pattern || F, O = r.next, M = o; O !== e.tail && !(c && M >= c.reach); M += O.value.length, O = O.next) {
848
+ for (var Y = F.pattern || F, O = a.next, M = s; O !== e.tail && !(c && M >= c.reach); M += O.value.length, O = O.next) {
849
849
  var z = O.value;
850
850
  if (e.length > t.length)
851
851
  return;
@@ -868,13 +868,13 @@ var ge = { exports: {} };
868
868
  c && ee > c.reach && (c.reach = ee);
869
869
  var q = O.prev;
870
870
  Q && (q = I(e, q, Q), M += Q.length), C(e, q, X);
871
- var me = new f(b, P ? s.tokenize(K, P) : K, w, K);
871
+ var me = new f(b, P ? o.tokenize(K, P) : K, w, K);
872
872
  if (O = I(e, q, me), ue && I(e, O, ue), X > 1) {
873
873
  var te = {
874
874
  cause: b + "," + k,
875
875
  reach: ee
876
876
  };
877
- T(t, e, a, O.prev, M, te), c && te.reach > c.reach && (c.reach = te.reach);
877
+ T(t, e, r, O.prev, M, te), c && te.reach > c.reach && (c.reach = te.reach);
878
878
  }
879
879
  }
880
880
  }
@@ -885,35 +885,35 @@ var ge = { exports: {} };
885
885
  var t = { value: null, prev: null, next: null }, e = { value: null, prev: t, next: null };
886
886
  t.next = e, this.head = t, this.tail = e, this.length = 0;
887
887
  }
888
- function I(t, e, a) {
889
- var r = e.next, o = { value: a, prev: e, next: r };
890
- return e.next = o, r.prev = o, t.length++, o;
888
+ function I(t, e, r) {
889
+ var a = e.next, s = { value: r, prev: e, next: a };
890
+ return e.next = s, a.prev = s, t.length++, s;
891
891
  }
892
- function C(t, e, a) {
893
- for (var r = e.next, o = 0; o < a && r !== t.tail; o++)
894
- r = r.next;
895
- e.next = r, r.prev = e, t.length -= o;
892
+ function C(t, e, r) {
893
+ for (var a = e.next, s = 0; s < r && a !== t.tail; s++)
894
+ a = a.next;
895
+ e.next = a, a.prev = e, t.length -= s;
896
896
  }
897
897
  function D(t) {
898
- for (var e = [], a = t.head.next; a !== t.tail; )
899
- e.push(a.value), a = a.next;
898
+ for (var e = [], r = t.head.next; r !== t.tail; )
899
+ e.push(r.value), r = r.next;
900
900
  return e;
901
901
  }
902
902
  if (!l.document)
903
- return l.addEventListener && (s.disableWorkerMessageHandler || l.addEventListener("message", function(t) {
904
- var e = JSON.parse(t.data), a = e.language, r = e.code, o = e.immediateClose;
905
- l.postMessage(s.highlight(r, s.languages[a], a)), o && l.close();
906
- }, !1)), s;
907
- var g = s.util.currentScript();
908
- g && (s.filename = g.src, g.hasAttribute("data-manual") && (s.manual = !0));
903
+ return l.addEventListener && (o.disableWorkerMessageHandler || l.addEventListener("message", function(t) {
904
+ var e = JSON.parse(t.data), r = e.language, a = e.code, s = e.immediateClose;
905
+ l.postMessage(o.highlight(a, o.languages[r], r)), s && l.close();
906
+ }, !1)), o;
907
+ var g = o.util.currentScript();
908
+ g && (o.filename = g.src, g.hasAttribute("data-manual") && (o.manual = !0));
909
909
  function p() {
910
- s.manual || s.highlightAll();
910
+ o.manual || o.highlightAll();
911
911
  }
912
- if (!s.manual) {
912
+ if (!o.manual) {
913
913
  var S = document.readyState;
914
914
  S === "loading" || S === "interactive" && g && g.defer ? document.addEventListener("DOMContentLoaded", p) : window.requestAnimationFrame ? window.requestAnimationFrame(p) : window.setTimeout(p, 16);
915
915
  }
916
- return s;
916
+ return o;
917
917
  }(d);
918
918
  i.exports && (i.exports = n), typeof de < "u" && (de.Prism = n), n.languages.markup = {
919
919
  comment: {
@@ -1013,13 +1013,13 @@ var ge = { exports: {} };
1013
1013
  lookbehind: !0,
1014
1014
  inside: n.languages[y]
1015
1015
  }, A.cdata = /^<!\[CDATA\[|\]\]>$/i;
1016
- var s = {
1016
+ var o = {
1017
1017
  "included-cdata": {
1018
1018
  pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1019
1019
  inside: A
1020
1020
  }
1021
1021
  };
1022
- s["language-" + y] = {
1022
+ o["language-" + y] = {
1023
1023
  pattern: /[\s\S]+/,
1024
1024
  inside: n.languages[y]
1025
1025
  };
@@ -1030,7 +1030,7 @@ var ge = { exports: {} };
1030
1030
  }), "i"),
1031
1031
  lookbehind: !0,
1032
1032
  greedy: !0,
1033
- inside: s
1033
+ inside: o
1034
1034
  }, n.languages.insertBefore("markup", "cdata", f);
1035
1035
  }
1036
1036
  }), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
@@ -1305,7 +1305,7 @@ var ge = { exports: {} };
1305
1305
  bat: "batch",
1306
1306
  h: "c",
1307
1307
  tex: "latex"
1308
- }, s = "data-src-status", f = "loading", m = "loaded", T = "failed", L = "pre[data-src]:not([" + s + '="' + m + '"]):not([' + s + '="' + f + '"])';
1308
+ }, o = "data-src-status", f = "loading", m = "loaded", T = "failed", L = "pre[data-src]:not([" + o + '="' + m + '"]):not([' + o + '="' + f + '"])';
1309
1309
  function I(g, p, S) {
1310
1310
  var t = new XMLHttpRequest();
1311
1311
  t.open("GET", g, !0), t.onreadystatechange = function() {
@@ -1327,30 +1327,30 @@ var ge = { exports: {} };
1327
1327
  g.element
1328
1328
  );
1329
1329
  if (p.matches(L)) {
1330
- g.code = "", p.setAttribute(s, f);
1330
+ g.code = "", p.setAttribute(o, f);
1331
1331
  var S = p.appendChild(document.createElement("CODE"));
1332
1332
  S.textContent = l;
1333
1333
  var t = p.getAttribute("data-src"), e = g.language;
1334
1334
  if (e === "none") {
1335
- var a = (/\.(\w+)$/.exec(t) || [, "none"])[1];
1336
- e = A[a] || a;
1335
+ var r = (/\.(\w+)$/.exec(t) || [, "none"])[1];
1336
+ e = A[r] || r;
1337
1337
  }
1338
1338
  n.util.setLanguage(S, e), n.util.setLanguage(p, e);
1339
- var r = n.plugins.autoloader;
1340
- r && r.loadLanguages(e), I(
1339
+ var a = n.plugins.autoloader;
1340
+ a && a.loadLanguages(e), I(
1341
1341
  t,
1342
- function(o) {
1343
- p.setAttribute(s, m);
1342
+ function(s) {
1343
+ p.setAttribute(o, m);
1344
1344
  var c = C(p.getAttribute("data-range"));
1345
1345
  if (c) {
1346
- var b = o.split(/\r\n?|\n/g), u = c[0], k = c[1] == null ? b.length : c[1];
1347
- u < 0 && (u += b.length), u = Math.max(0, Math.min(u - 1, b.length)), k < 0 && (k += b.length), k = Math.max(0, Math.min(k, b.length)), o = b.slice(u, k).join(`
1346
+ var b = s.split(/\r\n?|\n/g), u = c[0], k = c[1] == null ? b.length : c[1];
1347
+ u < 0 && (u += b.length), u = Math.max(0, Math.min(u - 1, b.length)), k < 0 && (k += b.length), k = Math.max(0, Math.min(k, b.length)), s = b.slice(u, k).join(`
1348
1348
  `), p.hasAttribute("data-start") || p.setAttribute("data-start", String(u + 1));
1349
1349
  }
1350
- S.textContent = o, n.highlightElement(S);
1350
+ S.textContent = s, n.highlightElement(S);
1351
1351
  },
1352
- function(o) {
1353
- p.setAttribute(s, T), S.textContent = o;
1352
+ function(s) {
1353
+ p.setAttribute(o, T), S.textContent = s;
1354
1354
  }
1355
1355
  );
1356
1356
  }
@@ -1374,7 +1374,7 @@ var ge = { exports: {} };
1374
1374
  }();
1375
1375
  })(ge);
1376
1376
  var De = ge.exports;
1377
- const re = /* @__PURE__ */ Ce(De);
1377
+ const ae = /* @__PURE__ */ Ce(De);
1378
1378
  Prism.languages.clike = {
1379
1379
  comment: [
1380
1380
  {
@@ -2216,15 +2216,21 @@ Prism.languages.json = {
2216
2216
  };
2217
2217
  Prism.languages.webmanifest = Prism.languages.json;
2218
2218
  const Pe = `
2219
+ /* 默认代码颜色 */
2220
+ .hep-cr-editor .hep-cr-highlight code,
2221
+ .hep-cr-editor .hep-cr-highlight pre {
2222
+ color: #f8f8f2 !important;
2223
+ }
2224
+
2219
2225
  .hep-cr-editor .token.comment,
2220
2226
  .hep-cr-editor .token.prolog,
2221
2227
  .hep-cr-editor .token.doctype,
2222
2228
  .hep-cr-editor .token.cdata {
2223
- color: #8292a2;
2229
+ color: #8292a2 !important;
2224
2230
  }
2225
2231
 
2226
2232
  .hep-cr-editor .token.punctuation {
2227
- color: #f8f8f2;
2233
+ color: #f8f8f2 !important;
2228
2234
  }
2229
2235
 
2230
2236
  .hep-cr-editor .token.property,
@@ -2232,12 +2238,18 @@ const Pe = `
2232
2238
  .hep-cr-editor .token.constant,
2233
2239
  .hep-cr-editor .token.symbol,
2234
2240
  .hep-cr-editor .token.deleted {
2235
- color: #f92672;
2241
+ color: #f92672 !important;
2242
+ }
2243
+
2244
+ /* console 单独处理 - 必须是白色 */
2245
+ .hep-cr-editor .token.property.console,
2246
+ .hep-cr-editor .token.console {
2247
+ color: #f8f8f2 !important;
2236
2248
  }
2237
2249
 
2238
2250
  .hep-cr-editor .token.boolean,
2239
2251
  .hep-cr-editor .token.number {
2240
- color: #ae81ff;
2252
+ color: #ae81ff !important;
2241
2253
  }
2242
2254
 
2243
2255
  .hep-cr-editor .token.selector,
@@ -2246,7 +2258,7 @@ const Pe = `
2246
2258
  .hep-cr-editor .token.char,
2247
2259
  .hep-cr-editor .token.builtin,
2248
2260
  .hep-cr-editor .token.inserted {
2249
- color: #a6e22e;
2261
+ color: #a6e22e !important;
2250
2262
  }
2251
2263
 
2252
2264
  .hep-cr-editor .token.operator,
@@ -2255,25 +2267,47 @@ const Pe = `
2255
2267
  .hep-cr-editor .language-css .hep-cr-editor .token.string,
2256
2268
  .hep-cr-editor .style .hep-cr-editor .token.string,
2257
2269
  .hep-cr-editor .token.variable {
2258
- color: #f8f8f2;
2270
+ color: #f8f8f2 !important;
2259
2271
  }
2260
2272
 
2261
2273
  .hep-cr-editor .token.atrule,
2262
2274
  .hep-cr-editor .token.attr-value,
2263
2275
  .hep-cr-editor .token.function,
2264
2276
  .hep-cr-editor .token.class-name {
2265
- color: #e6db74;
2277
+ color: #e6db74 !important;
2266
2278
  }
2267
2279
 
2268
- .hep-cr-editor .token.keyword {
2269
- color: #66d9ef;
2280
+ .hep-cr-editor .token.keyword,
2281
+ .hep-cr-editor .token.keyword-control {
2282
+ color: #66d9ef !important;
2270
2283
  }
2271
2284
 
2272
2285
  .hep-cr-editor .token.regex,
2273
2286
  .hep-cr-editor .token.important {
2274
- color: #fd971f;
2287
+ color: #fd971f !important;
2288
+ }
2289
+
2290
+ /* 覆盖用户项目的 text-shadow 样式,避免白边 */
2291
+ .hep-cr-editor code[class*="language-"],
2292
+ .hep-cr-editor pre[class*="language-"],
2293
+ .hep-cr-editor .hep-cr-highlight code,
2294
+ .hep-cr-editor .hep-cr-highlight pre {
2295
+ text-shadow: none !important;
2296
+ }
2297
+
2298
+ /* 覆盖 console 等内置对象 - 使用最高特异性 */
2299
+ .hep-cr-editor .hep-cr-highlight .token.console,
2300
+ .hep-cr-editor code.token.console,
2301
+ .hep-cr-editor .token.console {
2302
+ color: #f8f8f2 !important;
2275
2303
  }
2276
2304
  `, $e = `
2305
+ /* 默认代码颜色 */
2306
+ .hep-cr-editor .hep-cr-highlight code,
2307
+ .hep-cr-editor .hep-cr-highlight pre {
2308
+ color: #333 !important;
2309
+ }
2310
+
2277
2311
  .hep-cr-editor .token.comment,
2278
2312
  .hep-cr-editor .token.prolog,
2279
2313
  .hep-cr-editor .token.doctype,
@@ -2331,6 +2365,19 @@ const Pe = `
2331
2365
  .hep-cr-editor .token.important {
2332
2366
  color: #e36209;
2333
2367
  }
2368
+
2369
+ /* 覆盖用户项目的 text-shadow 样式,避免白边 */
2370
+ .hep-cr-editor code[class*="language-"],
2371
+ .hep-cr-editor pre[class*="language-"],
2372
+ .hep-cr-editor .hep-cr-highlight code,
2373
+ .hep-cr-editor .hep-cr-highlight pre {
2374
+ text-shadow: none !important;
2375
+ }
2376
+
2377
+ /* 覆盖 console 等内置对象 */
2378
+ .hep-cr-editor .token.console {
2379
+ color: #333 !important;
2380
+ }
2334
2381
  `, Me = ["innerHTML"], Ue = ["value", "disabled"], He = /* @__PURE__ */ ie({
2335
2382
  __name: "CodeEditor",
2336
2383
  props: {
@@ -2342,16 +2389,16 @@ const Pe = `
2342
2389
  emits: ["update:modelValue"],
2343
2390
  setup(i, { emit: d }) {
2344
2391
  be((g) => ({
2345
- v0de6db6b: m.value
2346
- })), typeof window < "u" && (window.Prism = re);
2392
+ v6d72dafb: m.value
2393
+ })), typeof window < "u" && (window.Prism = ae);
2347
2394
  function n(g) {
2348
2395
  if (typeof document > "u") return;
2349
- const p = "hep-cr-prism-styles";
2350
- let S = document.getElementById(p);
2351
- const t = g === "dark" ? Pe : $e;
2352
- S ? S.textContent = t : (S = document.createElement("style"), S.id = p, S.textContent = t, document.head.appendChild(S));
2396
+ const p = "hep-cr-prism-styles", S = document.getElementById(p), t = g === "dark" ? Pe : $e;
2397
+ S && S.remove();
2398
+ const e = document.createElement("style");
2399
+ e.id = p, e.textContent = t, document.head.appendChild(e);
2353
2400
  }
2354
- const l = i, h = d, y = N(null), A = N(null), s = {
2401
+ const l = i, h = d, y = N(null), A = N(null), o = {
2355
2402
  javascript: "javascript",
2356
2403
  js: "javascript",
2357
2404
  typescript: "typescript",
@@ -2382,11 +2429,11 @@ const Pe = `
2382
2429
  yml: "yaml",
2383
2430
  markdown: "markdown",
2384
2431
  md: "markdown"
2385
- }, f = G(() => s[l.language.toLowerCase()] || "javascript"), m = G(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), T = G(() => {
2432
+ }, f = G(() => o[l.language.toLowerCase()] || "javascript"), m = G(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), T = G(() => {
2386
2433
  try {
2387
- const g = re.languages[f.value];
2434
+ const g = ae.languages[f.value];
2388
2435
  if (g)
2389
- return re.highlight(l.modelValue || "", g, f.value);
2436
+ return ae.highlight(l.modelValue || "", g, f.value);
2390
2437
  } catch {
2391
2438
  }
2392
2439
  return L(l.modelValue || "");
@@ -2443,7 +2490,7 @@ const Pe = `
2443
2490
  for (const [l, h] of d)
2444
2491
  n[l] = h;
2445
2492
  return n;
2446
- }, Be = /* @__PURE__ */ he(He, [["__scopeId", "data-v-91e77d58"]]), Ge = { class: "hep-cr-header" }, ze = { class: "hep-cr-controls" }, je = ["disabled"], We = {
2493
+ }, Be = /* @__PURE__ */ he(He, [["__scopeId", "data-v-bf752fa5"]]), Ge = { class: "hep-cr-header" }, ze = { class: "hep-cr-controls" }, je = ["disabled"], We = {
2447
2494
  key: 0,
2448
2495
  value: ""
2449
2496
  }, Ve = ["value"], Ye = { class: "hep-cr-actions" }, Xe = ["disabled"], Ze = {
@@ -2455,10 +2502,10 @@ const Pe = `
2455
2502
  }, qe = ["title"], Je = {
2456
2503
  key: 0,
2457
2504
  class: "hep-cr-error"
2458
- }, Qe = { class: "hep-cr-main" }, et = { class: "hep-cr-panel-header" }, tt = { class: "hep-cr-language-badge" }, nt = { class: "hep-cr-panel-header" }, at = { class: "hep-cr-output-tabs" }, rt = { class: "hep-cr-output-actions" }, st = {
2505
+ }, Qe = { class: "hep-cr-main" }, et = { class: "hep-cr-panel-header" }, tt = { class: "hep-cr-language-badge" }, nt = { class: "hep-cr-panel-header" }, rt = { class: "hep-cr-output-tabs" }, at = { class: "hep-cr-output-actions" }, ot = {
2459
2506
  key: 0,
2460
2507
  class: "hep-cr-execution-time"
2461
- }, ot = { class: "hep-cr-output-content" }, it = { key: 0 }, lt = {
2508
+ }, st = { class: "hep-cr-output-content" }, it = { key: 0 }, lt = {
2462
2509
  key: 1,
2463
2510
  class: "hep-cr-stderr"
2464
2511
  }, ut = /* @__PURE__ */ ie({
@@ -2475,7 +2522,7 @@ const Pe = `
2475
2522
  },
2476
2523
  emits: ["execute-start", "execute-end", "language-change"],
2477
2524
  setup(i, { emit: d }) {
2478
- const n = i, l = d, h = N([]), y = N(n.language), A = N(n.theme), s = N(""), f = N(""), m = N(""), T = N(!1), L = N(null), I = N("stdout"), C = N(null), D = N(!1), g = N(60);
2525
+ const n = i, l = d, h = N([]), y = N(n.language), A = N(n.theme), o = N(""), f = N(""), m = N(""), T = N(!1), L = N(null), I = N("stdout"), C = N(null), D = N(!1), g = N(60);
2479
2526
  function p() {
2480
2527
  A.value = A.value === "light" ? "dark" : "light";
2481
2528
  }
@@ -2488,7 +2535,7 @@ const Pe = `
2488
2535
  const v = y.value;
2489
2536
  return v.includes(":") ? v.split(":")[0] : v;
2490
2537
  });
2491
- async function a() {
2538
+ async function r() {
2492
2539
  D.value = !0, C.value = null;
2493
2540
  try {
2494
2541
  h.value = await S.value.getRuntimes();
@@ -2499,14 +2546,14 @@ const Pe = `
2499
2546
  }
2500
2547
  }
2501
2548
  le(y, (v) => {
2502
- const w = v.includes(":") ? v.split(":")[0] : v, x = ae(w);
2503
- s.value = x, l("language-change", w, x);
2549
+ const w = v.includes(":") ? v.split(":")[0] : v, x = re(w);
2550
+ o.value = x, l("language-change", w, x);
2504
2551
  });
2505
- async function r() {
2552
+ async function a() {
2506
2553
  if (!T.value) {
2507
2554
  T.value = !0, f.value = "", m.value = "", L.value = null, C.value = null, I.value = "stdout", l("execute-start");
2508
2555
  try {
2509
- const v = await S.value.execute(e.value, s.value);
2556
+ const v = await S.value.execute(e.value, o.value);
2510
2557
  f.value = v.output, m.value = v.stderr, L.value = v.executionTime || null, I.value = v.stderr ? "stderr" : "stdout", l("execute-end", v);
2511
2558
  } catch (v) {
2512
2559
  C.value = v instanceof Error ? v.message : "Execution failed", l("execute-end", {
@@ -2520,7 +2567,7 @@ const Pe = `
2520
2567
  }
2521
2568
  }
2522
2569
  }
2523
- function o() {
2570
+ function s() {
2524
2571
  f.value = "", m.value = "", L.value = null, C.value = null;
2525
2572
  }
2526
2573
  async function c() {
@@ -2528,7 +2575,7 @@ const Pe = `
2528
2575
  await navigator.clipboard.writeText(v);
2529
2576
  }
2530
2577
  function b() {
2531
- s.value = ae(e.value);
2578
+ o.value = re(e.value);
2532
2579
  }
2533
2580
  let u = !1;
2534
2581
  function k(v) {
@@ -2547,7 +2594,7 @@ const Pe = `
2547
2594
  u = !1, document.removeEventListener("mousemove", F), document.removeEventListener("mouseup", P), document.body.style.cursor = "", document.body.style.userSelect = "";
2548
2595
  }
2549
2596
  pe(async () => {
2550
- await a(), s.value || (s.value = n.defaultCode || ae(y.value));
2597
+ await r(), o.value || (o.value = n.defaultCode || re(y.value));
2551
2598
  });
2552
2599
  const V = G(() => `hep-cr-runner-${A.value}`);
2553
2600
  return (v, w) => (_(), R("div", {
@@ -2574,7 +2621,7 @@ const Pe = `
2574
2621
  E("button", {
2575
2622
  class: "hep-cr-btn hep-cr-btn-run",
2576
2623
  disabled: T.value || D.value,
2577
- onClick: r
2624
+ onClick: a
2578
2625
  }, [
2579
2626
  T.value ? (_(), R("span", Ze)) : (_(), R("span", Ke, "▶")),
2580
2627
  Se(" " + H(T.value ? "运行中..." : i.executorLabel), 1)
@@ -2596,15 +2643,15 @@ const Pe = `
2596
2643
  i.showEditor ? (_(), R("div", {
2597
2644
  key: 0,
2598
2645
  class: "hep-cr-editor-panel",
2599
- style: se({ width: g.value + "%" })
2646
+ style: oe({ width: g.value + "%" })
2600
2647
  }, [
2601
2648
  E("div", et, [
2602
2649
  w[4] || (w[4] = E("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
2603
2650
  E("span", tt, H(e.value), 1)
2604
2651
  ]),
2605
- oe(Be, {
2606
- modelValue: s.value,
2607
- "onUpdate:modelValue": w[1] || (w[1] = (x) => s.value = x),
2652
+ se(Be, {
2653
+ modelValue: o.value,
2654
+ "onUpdate:modelValue": w[1] || (w[1] = (x) => o.value = x),
2608
2655
  language: e.value,
2609
2656
  theme: A.value,
2610
2657
  disabled: !i.editable || T.value
@@ -2619,10 +2666,10 @@ const Pe = `
2619
2666
  ])], 32)) : U("", !0),
2620
2667
  E("div", {
2621
2668
  class: "hep-cr-output-panel",
2622
- style: se({ width: i.showEditor ? 100 - g.value + "%" : "100%" })
2669
+ style: oe({ width: i.showEditor ? 100 - g.value + "%" : "100%" })
2623
2670
  }, [
2624
2671
  E("div", nt, [
2625
- E("div", at, [
2672
+ E("div", rt, [
2626
2673
  E("button", {
2627
2674
  class: W(["hep-cr-tab", { active: I.value === "stdout" }]),
2628
2675
  onClick: w[2] || (w[2] = (x) => I.value = "stdout")
@@ -2633,8 +2680,8 @@ const Pe = `
2633
2680
  onClick: w[3] || (w[3] = (x) => I.value = "stderr")
2634
2681
  }, " 错误 ", 2)) : U("", !0)
2635
2682
  ]),
2636
- E("div", rt, [
2637
- L.value !== null ? (_(), R("span", st, H(L.value) + "ms ", 1)) : U("", !0),
2683
+ E("div", at, [
2684
+ L.value !== null ? (_(), R("span", ot, H(L.value) + "ms ", 1)) : U("", !0),
2638
2685
  E("button", {
2639
2686
  class: "hep-cr-btn-icon",
2640
2687
  onClick: c,
@@ -2661,7 +2708,7 @@ const Pe = `
2661
2708
  ])]),
2662
2709
  E("button", {
2663
2710
  class: "hep-cr-btn-icon",
2664
- onClick: o,
2711
+ onClick: s,
2665
2712
  title: "清除"
2666
2713
  }, [...w[7] || (w[7] = [
2667
2714
  E("svg", {
@@ -2678,7 +2725,7 @@ const Pe = `
2678
2725
  ])])
2679
2726
  ])
2680
2727
  ]),
2681
- E("div", ot, [
2728
+ E("div", st, [
2682
2729
  I.value === "stdout" ? (_(), R("pre", it, H(f.value || '点击"运行"执行代码'), 1)) : (_(), R("pre", lt, H(m.value), 1))
2683
2730
  ])
2684
2731
  ], 4)
@@ -2712,16 +2759,16 @@ const Pe = `
2712
2759
  m !== void 0 && (y.value = m);
2713
2760
  }
2714
2761
  );
2715
- function s() {
2762
+ function o() {
2716
2763
  y.value = !1, h("update:modelValue", !1), h("close");
2717
2764
  }
2718
2765
  function f(m) {
2719
- m.target === m.currentTarget && s();
2766
+ m.target === m.currentTarget && o();
2720
2767
  }
2721
2768
  return d({
2722
- close: s
2769
+ close: o
2723
2770
  }), (m, T) => (_(), ke(we, { to: "body" }, [
2724
- oe(Te, { name: "hep-cr-dialog-fade" }, {
2771
+ se(Te, { name: "hep-cr-dialog-fade" }, {
2725
2772
  default: Ie(() => [
2726
2773
  A.value ? (_(), R("div", {
2727
2774
  key: 0,
@@ -2730,13 +2777,13 @@ const Pe = `
2730
2777
  }, [
2731
2778
  E("div", {
2732
2779
  class: "hep-cr-dialog-container",
2733
- style: se({ width: typeof i.width == "number" ? i.width + "px" : i.width })
2780
+ style: oe({ width: typeof i.width == "number" ? i.width + "px" : i.width })
2734
2781
  }, [
2735
2782
  E("div", ct, [
2736
2783
  E("h3", dt, H(i.title), 1),
2737
2784
  E("button", {
2738
2785
  class: "hep-cr-dialog-close",
2739
- onClick: s
2786
+ onClick: o
2740
2787
  }, [...T[0] || (T[0] = [
2741
2788
  E("svg", {
2742
2789
  width: "16",
@@ -2762,10 +2809,10 @@ const Pe = `
2762
2809
  ])])
2763
2810
  ]),
2764
2811
  E("div", pt, [
2765
- oe(J, Fe(_e(m.$attrs)), null, 16)
2812
+ se(J, Fe(_e(m.$attrs)), null, 16)
2766
2813
  ]),
2767
2814
  m.$slots.footer ? (_(), R("div", gt, [
2768
- Re(m.$slots, "footer", { close: s })
2815
+ Re(m.$slots, "footer", { close: o })
2769
2816
  ])) : U("", !0)
2770
2817
  ], 4)
2771
2818
  ])) : U("", !0)