@hep-code-runner/vue3 2.1.3 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,1380 +1,6 @@
1
- import { defineComponent as le, useCssVars as ve, ref as N, computed as H, onMounted as he, watch as ue, onUnmounted as Ee, openBlock as _, createElementBlock as I, normalizeClass as W, createElementVNode as E, normalizeStyle as J, withDirectives as ye, createCommentVNode as U, Fragment as Ae, renderList as Se, toDisplayString as z, vModelSelect as ke, createTextVNode as we, createStaticVNode as Te, createVNode as ie, createBlock as _e, Teleport as xe, Transition as Ie, withCtx as Fe, mergeProps as Re, toHandlers as Le, renderSlot as Ne } from "vue";
2
- var Oe = Object.defineProperty, Ce = (i, p, n) => p in i ? Oe(i, p, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[p] = n, de = (i, p, n) => Ce(i, typeof p != "symbol" ? p + "" : p, n);
3
- let re = null;
4
- class De {
5
- constructor(p = {}) {
6
- de(this, "baseUrl"), de(this, "timeout"), this.baseUrl = p.pistonUrl || "/api/piston", this.timeout = p.timeout || 3e3;
7
- }
8
- async getRuntimes(p = !1) {
9
- if (re && !p)
10
- return re;
11
- try {
12
- const n = await fetch(`${this.baseUrl}/runtimes`, {
13
- method: "GET",
14
- headers: {
15
- "Content-Type": "application/json"
16
- }
17
- });
18
- if (!n.ok)
19
- throw new Error(`Failed to fetch runtimes: ${n.statusText}`);
20
- const l = await n.json();
21
- return re = l, l;
22
- } catch (n) {
23
- throw console.error("Failed to fetch runtimes:", n), n;
24
- }
25
- }
26
- async execute(p, n, l = {}) {
27
- const v = (await this.getRuntimes()).find(
28
- (m) => {
29
- var b;
30
- return m.language.toLowerCase() === p.toLowerCase() || ((b = m.aliases) == null ? void 0 : b.some((T) => T.toLowerCase() === p.toLowerCase()));
31
- }
32
- );
33
- if (!v)
34
- throw new Error(`Language '${p}' is not supported`);
35
- const k = this.getFileName(p), A = {
36
- language: v.language,
37
- version: l.version || v.version,
38
- files: [
39
- {
40
- name: k,
41
- content: n
42
- }
43
- ],
44
- stdin: l.stdin || "",
45
- args: l.args || [],
46
- run_timeout: l.runTimeout || this.timeout,
47
- compile_timeout: this.timeout
48
- }, s = Date.now();
49
- try {
50
- const m = await fetch(`${this.baseUrl}/execute`, {
51
- method: "POST",
52
- headers: {
53
- "Content-Type": "application/json"
54
- },
55
- body: JSON.stringify(A)
56
- });
57
- if (!m.ok)
58
- throw new Error(`Execute failed: ${m.statusText}`);
59
- const b = await m.json(), T = Date.now() - s, P = b.run.stdout || "", O = b.run.stderr || "";
60
- return {
61
- success: b.run.code === 0,
62
- output: P,
63
- stderr: O,
64
- code: b.run.code,
65
- executionTime: T,
66
- compile: b.compile ? {
67
- stdout: b.compile.stdout || "",
68
- stderr: b.compile.stderr || "",
69
- code: b.compile.code
70
- } : void 0
71
- };
72
- } catch (m) {
73
- return {
74
- success: !1,
75
- output: "",
76
- stderr: m instanceof Error ? m.message : "Unknown error",
77
- code: -1,
78
- executionTime: Date.now() - s
79
- };
80
- }
81
- }
82
- getFileName(p) {
83
- return {
84
- javascript: "main.js",
85
- typescript: "main.ts",
86
- python: "main.py",
87
- python3: "main.py",
88
- go: "main.go",
89
- rust: "main.rs",
90
- java: "Main.java",
91
- c: "main.c",
92
- cpp: "main.cpp",
93
- csharp: "Main.cs",
94
- ruby: "main.rb",
95
- php: "main.php",
96
- bash: "main.sh",
97
- shell: "main.sh",
98
- perl: "main.pl",
99
- lua: "main.lua",
100
- swift: "main.swift",
101
- kotlin: "Main.kt",
102
- scala: "Main.scala",
103
- haskell: "main.hs",
104
- dart: "main.dart",
105
- html: "index.html",
106
- css: "style.css",
107
- sql: "query.sql",
108
- markdown: "readme.md"
109
- }[p.toLowerCase()] || `main.${p}`;
110
- }
111
- }
112
- const Pe = {
113
- javascript: 'console.log("Hello, World!");',
114
- typescript: 'console.log("Hello, World!");',
115
- python: 'print("Hello, World!")',
116
- python3: 'print("Hello, World!")',
117
- go: `package main
118
-
119
- import "fmt"
120
-
121
- func main() {
122
- fmt.Println("Hello, World!")
123
- }`,
124
- rust: `fn main() {
125
- println!("Hello, World!");
126
- }`,
127
- java: `public class Main {
128
- public static void main(String[] args) {
129
- System.out.println("Hello, World!");
130
- }
131
- }`,
132
- c: `#include <stdio.h>
133
-
134
- int main() {
135
- printf("Hello, World!\\n");
136
- return 0;
137
- }`,
138
- cpp: `#include <iostream>
139
-
140
- int main() {
141
- std::cout << "Hello, World!" << std::endl;
142
- return 0;
143
- }`,
144
- csharp: `using System;
145
-
146
- class Main {
147
- static void Main() {
148
- Console.WriteLine("Hello, World!");
149
- }
150
- }`,
151
- ruby: 'puts "Hello, World!"',
152
- php: `<?php
153
- echo "Hello, World!";
154
- ?>`,
155
- bash: 'echo "Hello, World!"',
156
- shell: 'echo "Hello, World!"',
157
- perl: 'print "Hello, World!\\n";',
158
- lua: 'print("Hello, World!")',
159
- r: 'print("Hello, World!")',
160
- swift: 'print("Hello, World!")',
161
- kotlin: `fun main() {
162
- println("Hello, World!")
163
- }`,
164
- scala: `object Main extends App {
165
- println("Hello, World!")
166
- }`,
167
- haskell: 'main = putStrLn "Hello, World!"',
168
- elixir: 'IO.puts "Hello, World!"',
169
- erlang: 'main() -> io:fwrite("Hello, World!~n").',
170
- clojure: '(println "Hello, World!")',
171
- fsharp: 'printfn "Hello, World!"',
172
- dart: `void main() {
173
- print("Hello, World!");
174
- }`,
175
- assembly: `section .data
176
- msg db 'Hello, World!', 0
177
- section .text
178
- global _start
179
- _start:
180
- mov rax, 1
181
- mov rdi, 1
182
- mov rsi, msg
183
- mov rdx, 13
184
- syscall
185
- mov rax, 60
186
- xor rdi, rdi
187
- syscall`,
188
- html: `<!DOCTYPE html>
189
- <html>
190
- <head>
191
- <title>Hello</title>
192
- </head>
193
- <body>
194
- <h1>Hello, World!</h1>
195
- </body>
196
- </html>`,
197
- css: `body {
198
- background-color: #f0f0f0;
199
- font-family: Arial, sans-serif;
200
- }
201
-
202
- h1 {
203
- color: #333;
204
- }`,
205
- sql: "SELECT 'Hello, World!' AS message;",
206
- markdown: `# Hello, World!
207
-
208
- This is a sample markdown document.`
209
- };
210
- function oe(i) {
211
- const p = i.toLowerCase();
212
- return Pe[p] || `// ${i}
213
- // Write your code here`;
214
- }
215
- var pe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
216
- function $e(i) {
217
- return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
218
- }
219
- var me = { exports: {} };
220
- (function(i) {
221
- var p = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
222
- /**
223
- * Prism: Lightweight, robust, elegant syntax highlighting
224
- *
225
- * @license MIT <https://opensource.org/licenses/MIT>
226
- * @author Lea Verou <https://lea.verou.me>
227
- * @namespace
228
- * @public
229
- */
230
- var n = function(l) {
231
- var v = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, k = 0, A = {}, s = {
232
- /**
233
- * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
234
- * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
235
- * additional languages or plugins yourself.
236
- *
237
- * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
238
- *
239
- * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
240
- * empty Prism object into the global scope before loading the Prism script like this:
241
- *
242
- * ```js
243
- * window.Prism = window.Prism || {};
244
- * Prism.manual = true;
245
- * // add a new <script> to load Prism's script
246
- * ```
247
- *
248
- * @default false
249
- * @type {boolean}
250
- * @memberof Prism
251
- * @public
252
- */
253
- manual: l.Prism && l.Prism.manual,
254
- /**
255
- * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
256
- * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
257
- * own worker, you don't want it to do this.
258
- *
259
- * By setting this value to `true`, Prism will not add its own listeners to the worker.
260
- *
261
- * You obviously have to change this value before Prism executes. To do this, you can add an
262
- * empty Prism object into the global scope before loading the Prism script like this:
263
- *
264
- * ```js
265
- * window.Prism = window.Prism || {};
266
- * Prism.disableWorkerMessageHandler = true;
267
- * // Load Prism's script
268
- * ```
269
- *
270
- * @default false
271
- * @type {boolean}
272
- * @memberof Prism
273
- * @public
274
- */
275
- disableWorkerMessageHandler: l.Prism && l.Prism.disableWorkerMessageHandler,
276
- /**
277
- * A namespace for utility methods.
278
- *
279
- * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
280
- * change or disappear at any time.
281
- *
282
- * @namespace
283
- * @memberof Prism
284
- */
285
- util: {
286
- encode: function e(t) {
287
- return t instanceof m ? new m(t.type, e(t.content), t.alias) : Array.isArray(t) ? t.map(e) : t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
288
- },
289
- /**
290
- * Returns the name of the type of the given value.
291
- *
292
- * @param {any} o
293
- * @returns {string}
294
- * @example
295
- * type(null) === 'Null'
296
- * type(undefined) === 'Undefined'
297
- * type(123) === 'Number'
298
- * type('foo') === 'String'
299
- * type(true) === 'Boolean'
300
- * type([1, 2]) === 'Array'
301
- * type({}) === 'Object'
302
- * type(String) === 'Function'
303
- * type(/abc+/) === 'RegExp'
304
- */
305
- type: function(e) {
306
- return Object.prototype.toString.call(e).slice(8, -1);
307
- },
308
- /**
309
- * Returns a unique number for the given object. Later calls will still return the same number.
310
- *
311
- * @param {Object} obj
312
- * @returns {number}
313
- */
314
- objId: function(e) {
315
- return e.__id || Object.defineProperty(e, "__id", { value: ++k }), e.__id;
316
- },
317
- /**
318
- * Creates a deep clone of the given object.
319
- *
320
- * The main intended use of this function is to clone language definitions.
321
- *
322
- * @param {T} o
323
- * @param {Record<number, any>} [visited]
324
- * @returns {T}
325
- * @template T
326
- */
327
- clone: function e(t, a) {
328
- a = a || {};
329
- var r, o;
330
- switch (s.util.type(t)) {
331
- case "Object":
332
- if (o = s.util.objId(t), a[o])
333
- return a[o];
334
- r = /** @type {Record<string, any>} */
335
- {}, a[o] = r;
336
- for (var d in t)
337
- t.hasOwnProperty(d) && (r[d] = e(t[d], a));
338
- return (
339
- /** @type {any} */
340
- r
341
- );
342
- case "Array":
343
- return o = s.util.objId(t), a[o] ? a[o] : (r = [], a[o] = r, /** @type {Array} */
344
- /** @type {any} */
345
- t.forEach(function(f, c) {
346
- r[c] = e(f, a);
347
- }), /** @type {any} */
348
- r);
349
- default:
350
- return t;
351
- }
352
- },
353
- /**
354
- * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
355
- *
356
- * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
357
- *
358
- * @param {Element} element
359
- * @returns {string}
360
- */
361
- getLanguage: function(e) {
362
- for (; e; ) {
363
- var t = v.exec(e.className);
364
- if (t)
365
- return t[1].toLowerCase();
366
- e = e.parentElement;
367
- }
368
- return "none";
369
- },
370
- /**
371
- * Sets the Prism `language-xxxx` class of the given element.
372
- *
373
- * @param {Element} element
374
- * @param {string} language
375
- * @returns {void}
376
- */
377
- setLanguage: function(e, t) {
378
- e.className = e.className.replace(RegExp(v, "gi"), ""), e.classList.add("language-" + t);
379
- },
380
- /**
381
- * Returns the script element that is currently executing.
382
- *
383
- * This does __not__ work for line script element.
384
- *
385
- * @returns {HTMLScriptElement | null}
386
- */
387
- currentScript: function() {
388
- if (typeof document > "u")
389
- return null;
390
- if (document.currentScript && document.currentScript.tagName === "SCRIPT")
391
- return (
392
- /** @type {any} */
393
- document.currentScript
394
- );
395
- try {
396
- throw new Error();
397
- } catch (r) {
398
- var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack) || [])[1];
399
- if (e) {
400
- var t = document.getElementsByTagName("script");
401
- for (var a in t)
402
- if (t[a].src == e)
403
- return t[a];
404
- }
405
- return null;
406
- }
407
- },
408
- /**
409
- * Returns whether a given class is active for `element`.
410
- *
411
- * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
412
- * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
413
- * given class is just the given class with a `no-` prefix.
414
- *
415
- * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
416
- * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
417
- * ancestors have the given class or the negated version of it, then the default activation will be returned.
418
- *
419
- * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
420
- * version of it, the class is considered active.
421
- *
422
- * @param {Element} element
423
- * @param {string} className
424
- * @param {boolean} [defaultActivation=false]
425
- * @returns {boolean}
426
- */
427
- isActive: function(e, t, a) {
428
- for (var r = "no-" + t; e; ) {
429
- var o = e.classList;
430
- if (o.contains(t))
431
- return !0;
432
- if (o.contains(r))
433
- return !1;
434
- e = e.parentElement;
435
- }
436
- return !!a;
437
- }
438
- },
439
- /**
440
- * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
441
- *
442
- * @namespace
443
- * @memberof Prism
444
- * @public
445
- */
446
- languages: {
447
- /**
448
- * The grammar for plain, unformatted text.
449
- */
450
- plain: A,
451
- plaintext: A,
452
- text: A,
453
- txt: A,
454
- /**
455
- * Creates a deep copy of the language with the given id and appends the given tokens.
456
- *
457
- * If a token in `redef` also appears in the copied language, then the existing token in the copied language
458
- * will be overwritten at its original position.
459
- *
460
- * ## Best practices
461
- *
462
- * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
463
- * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
464
- * understand the language definition because, normally, the order of tokens matters in Prism grammars.
465
- *
466
- * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
467
- * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
468
- *
469
- * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
470
- * @param {Grammar} redef The new tokens to append.
471
- * @returns {Grammar} The new language created.
472
- * @public
473
- * @example
474
- * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
475
- * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
476
- * // at its original position
477
- * 'comment': { ... },
478
- * // CSS doesn't have a 'color' token, so this token will be appended
479
- * 'color': /\b(?:red|green|blue)\b/
480
- * });
481
- */
482
- extend: function(e, t) {
483
- var a = s.util.clone(s.languages[e]);
484
- for (var r in t)
485
- a[r] = t[r];
486
- return a;
487
- },
488
- /**
489
- * Inserts tokens _before_ another token in a language definition or any other grammar.
490
- *
491
- * ## Usage
492
- *
493
- * This helper method makes it easy to modify existing languages. For example, the CSS language definition
494
- * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
495
- * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
496
- * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
497
- * this:
498
- *
499
- * ```js
500
- * Prism.languages.markup.style = {
501
- * // token
502
- * };
503
- * ```
504
- *
505
- * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
506
- * before existing tokens. For the CSS example above, you would use it like this:
507
- *
508
- * ```js
509
- * Prism.languages.insertBefore('markup', 'cdata', {
510
- * 'style': {
511
- * // token
512
- * }
513
- * });
514
- * ```
515
- *
516
- * ## Special cases
517
- *
518
- * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
519
- * will be ignored.
520
- *
521
- * This behavior can be used to insert tokens after `before`:
522
- *
523
- * ```js
524
- * Prism.languages.insertBefore('markup', 'comment', {
525
- * 'comment': Prism.languages.markup.comment,
526
- * // tokens after 'comment'
527
- * });
528
- * ```
529
- *
530
- * ## Limitations
531
- *
532
- * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
533
- * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
534
- * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
535
- * deleting properties which is necessary to insert at arbitrary positions.
536
- *
537
- * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
538
- * Instead, it will create a new object and replace all references to the target object with the new one. This
539
- * can be done without temporarily deleting properties, so the iteration order is well-defined.
540
- *
541
- * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
542
- * you hold the target object in a variable, then the value of the variable will not change.
543
- *
544
- * ```js
545
- * var oldMarkup = Prism.languages.markup;
546
- * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
547
- *
548
- * assert(oldMarkup !== Prism.languages.markup);
549
- * assert(newMarkup === Prism.languages.markup);
550
- * ```
551
- *
552
- * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
553
- * object to be modified.
554
- * @param {string} before The key to insert before.
555
- * @param {Grammar} insert An object containing the key-value pairs to be inserted.
556
- * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
557
- * object to be modified.
558
- *
559
- * Defaults to `Prism.languages`.
560
- * @returns {Grammar} The new grammar object.
561
- * @public
562
- */
563
- insertBefore: function(e, t, a, r) {
564
- r = r || /** @type {any} */
565
- s.languages;
566
- var o = r[e], d = {};
567
- for (var f in o)
568
- if (o.hasOwnProperty(f)) {
569
- if (f == t)
570
- for (var c in a)
571
- a.hasOwnProperty(c) && (d[c] = a[c]);
572
- a.hasOwnProperty(f) || (d[f] = o[f]);
573
- }
574
- var x = r[e];
575
- return r[e] = d, s.languages.DFS(s.languages, function(F, D) {
576
- D === x && F != e && (this[F] = d);
577
- }), d;
578
- },
579
- // Traverse a language definition with Depth First Search
580
- DFS: function e(t, a, r, o) {
581
- o = o || {};
582
- var d = s.util.objId;
583
- for (var f in t)
584
- if (t.hasOwnProperty(f)) {
585
- a.call(t, f, t[f], r || f);
586
- var c = t[f], x = s.util.type(c);
587
- x === "Object" && !o[d(c)] ? (o[d(c)] = !0, e(c, a, null, o)) : x === "Array" && !o[d(c)] && (o[d(c)] = !0, e(c, a, f, o));
588
- }
589
- }
590
- },
591
- plugins: {},
592
- /**
593
- * This is the most high-level function in Prism’s API.
594
- * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
595
- * each one of them.
596
- *
597
- * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
598
- *
599
- * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
600
- * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
601
- * @memberof Prism
602
- * @public
603
- */
604
- highlightAll: function(e, t) {
605
- s.highlightAllUnder(document, e, t);
606
- },
607
- /**
608
- * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
609
- * {@link Prism.highlightElement} on each one of them.
610
- *
611
- * The following hooks will be run:
612
- * 1. `before-highlightall`
613
- * 2. `before-all-elements-highlight`
614
- * 3. All hooks of {@link Prism.highlightElement} for each element.
615
- *
616
- * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
617
- * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
618
- * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
619
- * @memberof Prism
620
- * @public
621
- */
622
- highlightAllUnder: function(e, t, a) {
623
- var r = {
624
- callback: a,
625
- container: e,
626
- selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
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, d; d = r.elements[o++]; )
630
- s.highlightElement(d, t === !0, r.callback);
631
- },
632
- /**
633
- * Highlights the code inside a single element.
634
- *
635
- * The following hooks will be run:
636
- * 1. `before-sanity-check`
637
- * 2. `before-highlight`
638
- * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
639
- * 4. `before-insert`
640
- * 5. `after-highlight`
641
- * 6. `complete`
642
- *
643
- * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
644
- * the element's language.
645
- *
646
- * @param {Element} element The element containing the code.
647
- * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
648
- * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
649
- * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
650
- * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
651
- *
652
- * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
653
- * asynchronous highlighting to work. You can build your own bundle on the
654
- * [Download page](https://prismjs.com/download.html).
655
- * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
656
- * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
657
- * @memberof Prism
658
- * @public
659
- */
660
- highlightElement: function(e, t, a) {
661
- var r = s.util.getLanguage(e), o = s.languages[r];
662
- s.util.setLanguage(e, r);
663
- var d = e.parentElement;
664
- d && d.nodeName.toLowerCase() === "pre" && s.util.setLanguage(d, r);
665
- var f = e.textContent, c = {
666
- element: e,
667
- language: r,
668
- grammar: o,
669
- code: f
670
- };
671
- function x(D) {
672
- c.highlightedCode = D, s.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, s.hooks.run("after-highlight", c), s.hooks.run("complete", c), a && a.call(c.element);
673
- }
674
- if (s.hooks.run("before-sanity-check", c), d = c.element.parentElement, d && d.nodeName.toLowerCase() === "pre" && !d.hasAttribute("tabindex") && d.setAttribute("tabindex", "0"), !c.code) {
675
- s.hooks.run("complete", c), a && a.call(c.element);
676
- return;
677
- }
678
- if (s.hooks.run("before-highlight", c), !c.grammar) {
679
- x(s.util.encode(c.code));
680
- return;
681
- }
682
- if (t && l.Worker) {
683
- var F = new Worker(s.filename);
684
- F.onmessage = function(D) {
685
- x(D.data);
686
- }, F.postMessage(JSON.stringify({
687
- language: c.language,
688
- code: c.code,
689
- immediateClose: !0
690
- }));
691
- } else
692
- x(s.highlight(c.code, c.grammar, c.language));
693
- },
694
- /**
695
- * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
696
- * and the language definitions to use, and returns a string with the HTML produced.
697
- *
698
- * The following hooks will be run:
699
- * 1. `before-tokenize`
700
- * 2. `after-tokenize`
701
- * 3. `wrap`: On each {@link Token}.
702
- *
703
- * @param {string} text A string with the code to be highlighted.
704
- * @param {Grammar} grammar An object containing the tokens to use.
705
- *
706
- * Usually a language definition like `Prism.languages.markup`.
707
- * @param {string} language The name of the language definition passed to `grammar`.
708
- * @returns {string} The highlighted HTML.
709
- * @memberof Prism
710
- * @public
711
- * @example
712
- * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
713
- */
714
- highlight: function(e, t, a) {
715
- var r = {
716
- code: e,
717
- grammar: t,
718
- language: a
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), m.stringify(s.util.encode(r.tokens), r.language);
723
- },
724
- /**
725
- * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
726
- * and the language definitions to use, and returns an array with the tokenized code.
727
- *
728
- * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
729
- *
730
- * This method could be useful in other contexts as well, as a very crude parser.
731
- *
732
- * @param {string} text A string with the code to be highlighted.
733
- * @param {Grammar} grammar An object containing the tokens to use.
734
- *
735
- * Usually a language definition like `Prism.languages.markup`.
736
- * @returns {TokenStream} An array of strings and tokens, a token stream.
737
- * @memberof Prism
738
- * @public
739
- * @example
740
- * let code = `var foo = 0;`;
741
- * let tokens = Prism.tokenize(code, Prism.languages.javascript);
742
- * tokens.forEach(token => {
743
- * if (token instanceof Prism.Token && token.type === 'number') {
744
- * console.log(`Found numeric literal: ${token.content}`);
745
- * }
746
- * });
747
- */
748
- tokenize: function(e, t) {
749
- var a = t.rest;
750
- if (a) {
751
- for (var r in a)
752
- t[r] = a[r];
753
- delete t.rest;
754
- }
755
- var o = new P();
756
- return O(o, o.head, e), T(e, o, t, o.head, 0), M(o);
757
- },
758
- /**
759
- * @namespace
760
- * @memberof Prism
761
- * @public
762
- */
763
- hooks: {
764
- all: {},
765
- /**
766
- * Adds the given callback to the list of callbacks for the given hook.
767
- *
768
- * The callback will be invoked when the hook it is registered for is run.
769
- * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
770
- *
771
- * One callback function can be registered to multiple hooks and the same hook multiple times.
772
- *
773
- * @param {string} name The name of the hook.
774
- * @param {HookCallback} callback The callback function which is given environment variables.
775
- * @public
776
- */
777
- add: function(e, t) {
778
- var a = s.hooks.all;
779
- a[e] = a[e] || [], a[e].push(t);
780
- },
781
- /**
782
- * Runs a hook invoking all registered callbacks with the given environment variables.
783
- *
784
- * Callbacks will be invoked synchronously and in the order in which they were registered.
785
- *
786
- * @param {string} name The name of the hook.
787
- * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
788
- * @public
789
- */
790
- run: function(e, t) {
791
- var a = s.hooks.all[e];
792
- if (!(!a || !a.length))
793
- for (var r = 0, o; o = a[r++]; )
794
- o(t);
795
- }
796
- },
797
- Token: m
798
- };
799
- l.Prism = s;
800
- function m(e, t, a, r) {
801
- this.type = e, this.content = t, this.alias = a, this.length = (r || "").length | 0;
802
- }
803
- m.stringify = function e(t, a) {
804
- if (typeof t == "string")
805
- return t;
806
- if (Array.isArray(t)) {
807
- var r = "";
808
- return t.forEach(function(x) {
809
- r += e(x, a);
810
- }), r;
811
- }
812
- var o = {
813
- type: t.type,
814
- content: e(t.content, a),
815
- tag: "span",
816
- classes: ["token", t.type],
817
- attributes: {},
818
- language: a
819
- }, d = t.alias;
820
- d && (Array.isArray(d) ? Array.prototype.push.apply(o.classes, d) : o.classes.push(d)), s.hooks.run("wrap", o);
821
- var f = "";
822
- for (var c in o.attributes)
823
- f += " " + c + '="' + (o.attributes[c] || "").replace(/"/g, "&quot;") + '"';
824
- return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + f + ">" + o.content + "</" + o.tag + ">";
825
- };
826
- function b(e, t, a, r) {
827
- e.lastIndex = t;
828
- var o = e.exec(a);
829
- if (o && r && o[1]) {
830
- var d = o[1].length;
831
- o.index += d, o[0] = o[0].slice(d);
832
- }
833
- return o;
834
- }
835
- function T(e, t, a, r, o, d) {
836
- for (var f in a)
837
- if (!(!a.hasOwnProperty(f) || !a[f])) {
838
- var c = a[f];
839
- c = Array.isArray(c) ? c : [c];
840
- for (var x = 0; x < c.length; ++x) {
841
- if (d && d.cause == f + "," + x)
842
- return;
843
- var F = c[x], D = F.inside, X = !!F.lookbehind, Z = !!F.greedy, ee = F.alias;
844
- if (Z && !F.pattern.global) {
845
- var Y = F.pattern.toString().match(/[imsuy]*$/)[0];
846
- F.pattern = RegExp(F.pattern.source, Y + "g");
847
- }
848
- for (var K = F.pattern || F, R = r.next, $ = o; R !== t.tail && !(d && $ >= d.reach); $ += R.value.length, R = R.next) {
849
- var G = R.value;
850
- if (t.length > e.length)
851
- return;
852
- if (!(G instanceof m)) {
853
- var g = 1, u;
854
- if (Z) {
855
- if (u = b(K, $, e, X), !u || u.index >= e.length)
856
- break;
857
- var j = u.index, w = u.index + u[0].length, L = $;
858
- for (L += R.value.length; j >= L; )
859
- R = R.next, L += R.value.length;
860
- if (L -= R.value.length, $ = L, R.value instanceof m)
861
- continue;
862
- for (var B = R; B !== t.tail && (L < w || typeof B.value == "string"); B = B.next)
863
- g++, L += B.value.length;
864
- g--, G = e.slice($, L), u.index -= $;
865
- } else if (u = b(K, 0, G, X), !u)
866
- continue;
867
- var j = u.index, V = u[0], te = G.slice(0, j), ce = G.slice(j + V.length), ne = $ + G.length;
868
- d && ne > d.reach && (d.reach = ne);
869
- var q = R.prev;
870
- te && (q = O(t, q, te), $ += te.length), C(t, q, g);
871
- var be = new m(f, D ? s.tokenize(V, D) : V, ee, V);
872
- if (R = O(t, q, be), ce && O(t, R, ce), g > 1) {
873
- var ae = {
874
- cause: f + "," + x,
875
- reach: ne
876
- };
877
- T(e, t, a, R.prev, $, ae), d && ae.reach > d.reach && (d.reach = ae.reach);
878
- }
879
- }
880
- }
881
- }
882
- }
883
- }
884
- function P() {
885
- var e = { value: null, prev: null, next: null }, t = { value: null, prev: e, next: null };
886
- e.next = t, this.head = e, this.tail = t, this.length = 0;
887
- }
888
- function O(e, t, a) {
889
- var r = t.next, o = { value: a, prev: t, next: r };
890
- return t.next = o, r.prev = o, e.length++, o;
891
- }
892
- function C(e, t, a) {
893
- for (var r = t.next, o = 0; o < a && r !== e.tail; o++)
894
- r = r.next;
895
- t.next = r, r.prev = t, e.length -= o;
896
- }
897
- function M(e) {
898
- for (var t = [], a = e.head.next; a !== e.tail; )
899
- t.push(a.value), a = a.next;
900
- return t;
901
- }
902
- if (!l.document)
903
- return l.addEventListener && (s.disableWorkerMessageHandler || l.addEventListener("message", function(e) {
904
- var t = JSON.parse(e.data), a = t.language, r = t.code, o = t.immediateClose;
905
- l.postMessage(s.highlight(r, s.languages[a], a)), o && l.close();
906
- }, !1)), s;
907
- var S = s.util.currentScript();
908
- S && (s.filename = S.src, S.hasAttribute("data-manual") && (s.manual = !0));
909
- function y() {
910
- s.manual || s.highlightAll();
911
- }
912
- if (!s.manual) {
913
- var h = document.readyState;
914
- h === "loading" || h === "interactive" && S && S.defer ? document.addEventListener("DOMContentLoaded", y) : window.requestAnimationFrame ? window.requestAnimationFrame(y) : window.setTimeout(y, 16);
915
- }
916
- return s;
917
- }(p);
918
- i.exports && (i.exports = n), typeof pe < "u" && (pe.Prism = n), n.languages.markup = {
919
- comment: {
920
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
921
- greedy: !0
922
- },
923
- prolog: {
924
- pattern: /<\?[\s\S]+?\?>/,
925
- greedy: !0
926
- },
927
- doctype: {
928
- // https://www.w3.org/TR/xml/#NT-doctypedecl
929
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
930
- greedy: !0,
931
- inside: {
932
- "internal-subset": {
933
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
934
- lookbehind: !0,
935
- greedy: !0,
936
- inside: null
937
- // see below
938
- },
939
- string: {
940
- pattern: /"[^"]*"|'[^']*'/,
941
- greedy: !0
942
- },
943
- punctuation: /^<!|>$|[[\]]/,
944
- "doctype-tag": /^DOCTYPE/i,
945
- name: /[^\s<>'"]+/
946
- }
947
- },
948
- cdata: {
949
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
950
- greedy: !0
951
- },
952
- tag: {
953
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
954
- greedy: !0,
955
- inside: {
956
- tag: {
957
- pattern: /^<\/?[^\s>\/]+/,
958
- inside: {
959
- punctuation: /^<\/?/,
960
- namespace: /^[^\s>\/:]+:/
961
- }
962
- },
963
- "special-attr": [],
964
- "attr-value": {
965
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
966
- inside: {
967
- punctuation: [
968
- {
969
- pattern: /^=/,
970
- alias: "attr-equals"
971
- },
972
- {
973
- pattern: /^(\s*)["']|["']$/,
974
- lookbehind: !0
975
- }
976
- ]
977
- }
978
- },
979
- punctuation: /\/?>/,
980
- "attr-name": {
981
- pattern: /[^\s>\/]+/,
982
- inside: {
983
- namespace: /^[^\s>\/:]+:/
984
- }
985
- }
986
- }
987
- },
988
- entity: [
989
- {
990
- pattern: /&[\da-z]{1,8};/i,
991
- alias: "named-entity"
992
- },
993
- /&#x?[\da-f]{1,8};/i
994
- ]
995
- }, 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(l) {
996
- l.type === "entity" && (l.attributes.title = l.content.replace(/&amp;/, "&"));
997
- }), Object.defineProperty(n.languages.markup.tag, "addInlined", {
998
- /**
999
- * Adds an inlined language to markup.
1000
- *
1001
- * An example of an inlined language is CSS with `<style>` tags.
1002
- *
1003
- * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1004
- * case insensitive.
1005
- * @param {string} lang The language key.
1006
- * @example
1007
- * addInlined('style', 'css');
1008
- */
1009
- value: function(v, k) {
1010
- var A = {};
1011
- A["language-" + k] = {
1012
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1013
- lookbehind: !0,
1014
- inside: n.languages[k]
1015
- }, A.cdata = /^<!\[CDATA\[|\]\]>$/i;
1016
- var s = {
1017
- "included-cdata": {
1018
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1019
- inside: A
1020
- }
1021
- };
1022
- s["language-" + k] = {
1023
- pattern: /[\s\S]+/,
1024
- inside: n.languages[k]
1025
- };
1026
- var m = {};
1027
- m[v] = {
1028
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
1029
- return v;
1030
- }), "i"),
1031
- lookbehind: !0,
1032
- greedy: !0,
1033
- inside: s
1034
- }, n.languages.insertBefore("markup", "cdata", m);
1035
- }
1036
- }), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
1037
- /**
1038
- * Adds an pattern to highlight languages embedded in HTML attributes.
1039
- *
1040
- * An example of an inlined language is CSS with `style` attributes.
1041
- *
1042
- * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1043
- * case insensitive.
1044
- * @param {string} lang The language key.
1045
- * @example
1046
- * addAttribute('style', 'css');
1047
- */
1048
- value: function(l, v) {
1049
- n.languages.markup.tag.inside["special-attr"].push({
1050
- pattern: RegExp(
1051
- /(^|["'\s])/.source + "(?:" + l + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1052
- "i"
1053
- ),
1054
- lookbehind: !0,
1055
- inside: {
1056
- "attr-name": /^[^\s=]+/,
1057
- "attr-value": {
1058
- pattern: /=[\s\S]+/,
1059
- inside: {
1060
- value: {
1061
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1062
- lookbehind: !0,
1063
- alias: [v, "language-" + v],
1064
- inside: n.languages[v]
1065
- },
1066
- punctuation: [
1067
- {
1068
- pattern: /^=/,
1069
- alias: "attr-equals"
1070
- },
1071
- /"|'/
1072
- ]
1073
- }
1074
- }
1075
- }
1076
- });
1077
- }
1078
- }), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, function(l) {
1079
- var v = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1080
- l.languages.css = {
1081
- comment: /\/\*[\s\S]*?\*\//,
1082
- atrule: {
1083
- pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + v.source + ")*?" + /(?:;|(?=\s*\{))/.source),
1084
- inside: {
1085
- rule: /^@[\w-]+/,
1086
- "selector-function-argument": {
1087
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1088
- lookbehind: !0,
1089
- alias: "selector"
1090
- },
1091
- keyword: {
1092
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1093
- lookbehind: !0
1094
- }
1095
- // See rest below
1096
- }
1097
- },
1098
- url: {
1099
- // https://drafts.csswg.org/css-values-3/#urls
1100
- pattern: RegExp("\\burl\\((?:" + v.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1101
- greedy: !0,
1102
- inside: {
1103
- function: /^url/i,
1104
- punctuation: /^\(|\)$/,
1105
- string: {
1106
- pattern: RegExp("^" + v.source + "$"),
1107
- alias: "url"
1108
- }
1109
- }
1110
- },
1111
- selector: {
1112
- pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + v.source + ")*(?=\\s*\\{)"),
1113
- lookbehind: !0
1114
- },
1115
- string: {
1116
- pattern: v,
1117
- greedy: !0
1118
- },
1119
- property: {
1120
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1121
- lookbehind: !0
1122
- },
1123
- important: /!important\b/i,
1124
- function: {
1125
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1126
- lookbehind: !0
1127
- },
1128
- punctuation: /[(){};:,]/
1129
- }, l.languages.css.atrule.inside.rest = l.languages.css;
1130
- var k = l.languages.markup;
1131
- k && (k.tag.addInlined("style", "css"), k.tag.addAttribute("style", "css"));
1132
- }(n), n.languages.clike = {
1133
- comment: [
1134
- {
1135
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1136
- lookbehind: !0,
1137
- greedy: !0
1138
- },
1139
- {
1140
- pattern: /(^|[^\\:])\/\/.*/,
1141
- lookbehind: !0,
1142
- greedy: !0
1143
- }
1144
- ],
1145
- string: {
1146
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1147
- greedy: !0
1148
- },
1149
- "class-name": {
1150
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
1151
- lookbehind: !0,
1152
- inside: {
1153
- punctuation: /[.\\]/
1154
- }
1155
- },
1156
- keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
1157
- boolean: /\b(?:false|true)\b/,
1158
- function: /\b\w+(?=\()/,
1159
- number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1160
- operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1161
- punctuation: /[{}[\];(),.:]/
1162
- }, n.languages.javascript = n.languages.extend("clike", {
1163
- "class-name": [
1164
- n.languages.clike["class-name"],
1165
- {
1166
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1167
- lookbehind: !0
1168
- }
1169
- ],
1170
- keyword: [
1171
- {
1172
- pattern: /((?:^|\})\s*)catch\b/,
1173
- lookbehind: !0
1174
- },
1175
- {
1176
- pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1177
- lookbehind: !0
1178
- }
1179
- ],
1180
- // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1181
- function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1182
- number: {
1183
- pattern: RegExp(
1184
- /(^|[^\w$])/.source + "(?:" + // constant
1185
- (/NaN|Infinity/.source + "|" + // binary integer
1186
- /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
1187
- /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
1188
- /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
1189
- /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
1190
- /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
1191
- ),
1192
- lookbehind: !0
1193
- },
1194
- operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1195
- }), n.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, n.languages.insertBefore("javascript", "keyword", {
1196
- regex: {
1197
- pattern: RegExp(
1198
- // lookbehind
1199
- // eslint-disable-next-line regexp/no-dupe-characters-character-class
1200
- /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
1201
- // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
1202
- // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
1203
- // with the only syntax, so we have to define 2 different regex patterns.
1204
- /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
1205
- /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
1206
- /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
1207
- ),
1208
- lookbehind: !0,
1209
- greedy: !0,
1210
- inside: {
1211
- "regex-source": {
1212
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1213
- lookbehind: !0,
1214
- alias: "language-regex",
1215
- inside: n.languages.regex
1216
- },
1217
- "regex-delimiter": /^\/|\/$/,
1218
- "regex-flags": /^[a-z]+$/
1219
- }
1220
- },
1221
- // This must be declared before keyword because we use "function" inside the look-forward
1222
- "function-variable": {
1223
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
1224
- alias: "function"
1225
- },
1226
- parameter: [
1227
- {
1228
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1229
- lookbehind: !0,
1230
- inside: n.languages.javascript
1231
- },
1232
- {
1233
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1234
- lookbehind: !0,
1235
- inside: n.languages.javascript
1236
- },
1237
- {
1238
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1239
- lookbehind: !0,
1240
- inside: n.languages.javascript
1241
- },
1242
- {
1243
- pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
1244
- lookbehind: !0,
1245
- inside: n.languages.javascript
1246
- }
1247
- ],
1248
- constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1249
- }), n.languages.insertBefore("javascript", "string", {
1250
- hashbang: {
1251
- pattern: /^#!.*/,
1252
- greedy: !0,
1253
- alias: "comment"
1254
- },
1255
- "template-string": {
1256
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1257
- greedy: !0,
1258
- inside: {
1259
- "template-punctuation": {
1260
- pattern: /^`|`$/,
1261
- alias: "string"
1262
- },
1263
- interpolation: {
1264
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1265
- lookbehind: !0,
1266
- inside: {
1267
- "interpolation-punctuation": {
1268
- pattern: /^\$\{|\}$/,
1269
- alias: "punctuation"
1270
- },
1271
- rest: n.languages.javascript
1272
- }
1273
- },
1274
- string: /[\s\S]+/
1275
- }
1276
- },
1277
- "string-property": {
1278
- pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1279
- lookbehind: !0,
1280
- greedy: !0,
1281
- alias: "property"
1282
- }
1283
- }), n.languages.insertBefore("javascript", "operator", {
1284
- "literal-property": {
1285
- pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1286
- lookbehind: !0,
1287
- alias: "property"
1288
- }
1289
- }), n.languages.markup && (n.languages.markup.tag.addInlined("script", "javascript"), n.languages.markup.tag.addAttribute(
1290
- /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
1291
- "javascript"
1292
- )), n.languages.js = n.languages.javascript, function() {
1293
- if (typeof n > "u" || typeof document > "u")
1294
- return;
1295
- Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
1296
- var l = "Loading…", v = function(S, y) {
1297
- return "✖ Error " + S + " while fetching file: " + y;
1298
- }, k = "✖ Error: File does not exist or is empty", A = {
1299
- js: "javascript",
1300
- py: "python",
1301
- rb: "ruby",
1302
- ps1: "powershell",
1303
- psm1: "powershell",
1304
- sh: "bash",
1305
- bat: "batch",
1306
- h: "c",
1307
- tex: "latex"
1308
- }, s = "data-src-status", m = "loading", b = "loaded", T = "failed", P = "pre[data-src]:not([" + s + '="' + b + '"]):not([' + s + '="' + m + '"])';
1309
- function O(S, y, h) {
1310
- var e = new XMLHttpRequest();
1311
- e.open("GET", S, !0), e.onreadystatechange = function() {
1312
- e.readyState == 4 && (e.status < 400 && e.responseText ? y(e.responseText) : e.status >= 400 ? h(v(e.status, e.statusText)) : h(k));
1313
- }, e.send(null);
1314
- }
1315
- function C(S) {
1316
- var y = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(S || "");
1317
- if (y) {
1318
- var h = Number(y[1]), e = y[2], t = y[3];
1319
- return e ? t ? [h, Number(t)] : [h, void 0] : [h, h];
1320
- }
1321
- }
1322
- n.hooks.add("before-highlightall", function(S) {
1323
- S.selector += ", " + P;
1324
- }), n.hooks.add("before-sanity-check", function(S) {
1325
- var y = (
1326
- /** @type {HTMLPreElement} */
1327
- S.element
1328
- );
1329
- if (y.matches(P)) {
1330
- S.code = "", y.setAttribute(s, m);
1331
- var h = y.appendChild(document.createElement("CODE"));
1332
- h.textContent = l;
1333
- var e = y.getAttribute("data-src"), t = S.language;
1334
- if (t === "none") {
1335
- var a = (/\.(\w+)$/.exec(e) || [, "none"])[1];
1336
- t = A[a] || a;
1337
- }
1338
- n.util.setLanguage(h, t), n.util.setLanguage(y, t);
1339
- var r = n.plugins.autoloader;
1340
- r && r.loadLanguages(t), O(
1341
- e,
1342
- function(o) {
1343
- y.setAttribute(s, b);
1344
- var d = C(y.getAttribute("data-range"));
1345
- if (d) {
1346
- var f = o.split(/\r\n?|\n/g), c = d[0], x = d[1] == null ? f.length : d[1];
1347
- c < 0 && (c += f.length), c = Math.max(0, Math.min(c - 1, f.length)), x < 0 && (x += f.length), x = Math.max(0, Math.min(x, f.length)), o = f.slice(c, x).join(`
1348
- `), y.hasAttribute("data-start") || y.setAttribute("data-start", String(c + 1));
1349
- }
1350
- h.textContent = o, n.highlightElement(h);
1351
- },
1352
- function(o) {
1353
- y.setAttribute(s, T), h.textContent = o;
1354
- }
1355
- );
1356
- }
1357
- }), n.plugins.fileHighlight = {
1358
- /**
1359
- * Executes the File Highlight plugin for all matching `pre` elements under the given container.
1360
- *
1361
- * Note: Elements which are already loaded or currently loading will not be touched by this method.
1362
- *
1363
- * @param {ParentNode} [container=document]
1364
- */
1365
- highlight: function(y) {
1366
- for (var h = (y || document).querySelectorAll(P), e = 0, t; t = h[e++]; )
1367
- n.highlightElement(t);
1368
- }
1369
- };
1370
- var M = !1;
1371
- n.fileHighlight = function() {
1372
- M || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), M = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
1373
- };
1374
- }();
1375
- })(me);
1376
- var Me = me.exports;
1377
- const se = /* @__PURE__ */ $e(Me);
1
+ import { defineComponent as V, useCssVars as ie, ref as m, computed as _, onMounted as W, watch as Y, onUnmounted as le, openBlock as i, createElementBlock as c, normalizeClass as O, createElementVNode as r, normalizeStyle as M, withDirectives as ce, createCommentVNode as k, Fragment as ue, renderList as de, toDisplayString as R, vModelSelect as pe, createTextVNode as he, createStaticVNode as ge, createVNode as z, createBlock as me, Teleport as Ee, Transition as be, withCtx as fe, mergeProps as ve, toHandlers as Se, renderSlot as Te } from "vue";
2
+ import { PistonClient as ke, getSnippet as U } from "@hep-code-runner/core";
3
+ import H from "prismjs";
1378
4
  Prism.languages.clike = {
1379
5
  comment: [
1380
6
  {
@@ -1632,9 +258,9 @@ Prism.languages.insertBefore("go", "string", {
1632
258
  }
1633
259
  });
1634
260
  delete Prism.languages.go["class-name"];
1635
- (function(i) {
1636
- var p = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, n = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = {
1637
- pattern: RegExp(/(^|[^\w.])/.source + n + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
261
+ (function(e) {
262
+ var u = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, a = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, o = {
263
+ pattern: RegExp(/(^|[^\w.])/.source + a + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
1638
264
  lookbehind: !0,
1639
265
  inside: {
1640
266
  namespace: {
@@ -1646,32 +272,32 @@ delete Prism.languages.go["class-name"];
1646
272
  punctuation: /\./
1647
273
  }
1648
274
  };
1649
- i.languages.java = i.languages.extend("clike", {
275
+ e.languages.java = e.languages.extend("clike", {
1650
276
  string: {
1651
277
  pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
1652
278
  lookbehind: !0,
1653
279
  greedy: !0
1654
280
  },
1655
281
  "class-name": [
1656
- l,
282
+ o,
1657
283
  {
1658
284
  // variables, parameters, and constructor references
1659
285
  // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
1660
- pattern: RegExp(/(^|[^\w.])/.source + n + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
286
+ pattern: RegExp(/(^|[^\w.])/.source + a + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
1661
287
  lookbehind: !0,
1662
- inside: l.inside
288
+ inside: o.inside
1663
289
  },
1664
290
  {
1665
291
  // class names based on keyword
1666
292
  // this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
1667
- pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + n + /[A-Z]\w*\b/.source),
293
+ pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + a + /[A-Z]\w*\b/.source),
1668
294
  lookbehind: !0,
1669
- inside: l.inside
295
+ inside: o.inside
1670
296
  }
1671
297
  ],
1672
- keyword: p,
298
+ keyword: u,
1673
299
  function: [
1674
- i.languages.clike.function,
300
+ e.languages.clike.function,
1675
301
  {
1676
302
  pattern: /(::\s*)[a-z_]\w*/,
1677
303
  lookbehind: !0
@@ -1683,7 +309,7 @@ delete Prism.languages.go["class-name"];
1683
309
  lookbehind: !0
1684
310
  },
1685
311
  constant: /\b[A-Z][A-Z_\d]+\b/
1686
- }), i.languages.insertBefore("java", "string", {
312
+ }), e.languages.insertBefore("java", "string", {
1687
313
  "triple-quoted-string": {
1688
314
  // http://openjdk.java.net/jeps/355#Description
1689
315
  pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
@@ -1694,7 +320,7 @@ delete Prism.languages.go["class-name"];
1694
320
  pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
1695
321
  greedy: !0
1696
322
  }
1697
- }), i.languages.insertBefore("java", "class-name", {
323
+ }), e.languages.insertBefore("java", "class-name", {
1698
324
  annotation: {
1699
325
  pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
1700
326
  lookbehind: !0,
@@ -1703,29 +329,29 @@ delete Prism.languages.go["class-name"];
1703
329
  generics: {
1704
330
  pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
1705
331
  inside: {
1706
- "class-name": l,
1707
- keyword: p,
332
+ "class-name": o,
333
+ keyword: u,
1708
334
  punctuation: /[<>(),.:]/,
1709
335
  operator: /[?&|]/
1710
336
  }
1711
337
  },
1712
338
  import: [
1713
339
  {
1714
- pattern: RegExp(/(\bimport\s+)/.source + n + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
340
+ pattern: RegExp(/(\bimport\s+)/.source + a + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
1715
341
  lookbehind: !0,
1716
342
  inside: {
1717
- namespace: l.inside.namespace,
343
+ namespace: o.inside.namespace,
1718
344
  punctuation: /\./,
1719
345
  operator: /\*/,
1720
346
  "class-name": /\w+/
1721
347
  }
1722
348
  },
1723
349
  {
1724
- pattern: RegExp(/(\bimport\s+static\s+)/.source + n + /(?:\w+|\*)(?=\s*;)/.source),
350
+ pattern: RegExp(/(\bimport\s+static\s+)/.source + a + /(?:\w+|\*)(?=\s*;)/.source),
1725
351
  lookbehind: !0,
1726
352
  alias: "static",
1727
353
  inside: {
1728
- namespace: l.inside.namespace,
354
+ namespace: o.inside.namespace,
1729
355
  static: /\b\w+$/,
1730
356
  punctuation: /\./,
1731
357
  operator: /\*/,
@@ -1736,7 +362,7 @@ delete Prism.languages.go["class-name"];
1736
362
  namespace: {
1737
363
  pattern: RegExp(
1738
364
  /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function() {
1739
- return p.source;
365
+ return u.source;
1740
366
  })
1741
367
  ),
1742
368
  lookbehind: !0,
@@ -1822,17 +448,17 @@ Prism.languages.insertBefore("c", "function", {
1822
448
  constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
1823
449
  });
1824
450
  delete Prism.languages.c.boolean;
1825
- (function(i) {
1826
- for (var p = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, n = 0; n < 2; n++)
1827
- p = p.replace(/<self>/g, function() {
1828
- return p;
451
+ (function(e) {
452
+ for (var u = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, a = 0; a < 2; a++)
453
+ u = u.replace(/<self>/g, function() {
454
+ return u;
1829
455
  });
1830
- p = p.replace(/<self>/g, function() {
456
+ u = u.replace(/<self>/g, function() {
1831
457
  return /[^\s\S]/.source;
1832
- }), i.languages.rust = {
458
+ }), e.languages.rust = {
1833
459
  comment: [
1834
460
  {
1835
- pattern: RegExp(/(^|[^\\])/.source + p),
461
+ pattern: RegExp(/(^|[^\\])/.source + u),
1836
462
  lookbehind: !0,
1837
463
  greedy: !0
1838
464
  },
@@ -1936,7 +562,7 @@ delete Prism.languages.c.boolean;
1936
562
  boolean: /\b(?:false|true)\b/,
1937
563
  punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
1938
564
  operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
1939
- }, i.languages.rust["closure-params"].inside.rest = i.languages.rust, i.languages.rust.attribute.inside.string = i.languages.rust.string;
565
+ }, e.languages.rust["closure-params"].inside.rest = e.languages.rust, e.languages.rust.attribute.inside.string = e.languages.rust.string;
1940
566
  })(Prism);
1941
567
  Prism.languages.sql = {
1942
568
  comment: {
@@ -1971,18 +597,18 @@ Prism.languages.sql = {
1971
597
  operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
1972
598
  punctuation: /[;[\]()`,.]/
1973
599
  };
1974
- (function(i) {
1975
- var p = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", n = {
600
+ (function(e) {
601
+ var u = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", a = {
1976
602
  pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
1977
603
  lookbehind: !0,
1978
604
  alias: "punctuation",
1979
605
  // this looks reasonably well in all themes
1980
606
  inside: null
1981
607
  // see below
1982
- }, l = {
1983
- bash: n,
608
+ }, o = {
609
+ bash: a,
1984
610
  environment: {
1985
- pattern: RegExp("\\$" + p),
611
+ pattern: RegExp("\\$" + u),
1986
612
  alias: "constant"
1987
613
  },
1988
614
  variable: [
@@ -2022,7 +648,7 @@ Prism.languages.sql = {
2022
648
  operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
2023
649
  punctuation: /[\[\]]/,
2024
650
  environment: {
2025
- pattern: RegExp("(\\{)" + p),
651
+ pattern: RegExp("(\\{)" + u),
2026
652
  lookbehind: !0,
2027
653
  alias: "constant"
2028
654
  }
@@ -2033,7 +659,7 @@ Prism.languages.sql = {
2033
659
  // Escape sequences from echo and printf's manuals, and escaped quotes.
2034
660
  entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
2035
661
  };
2036
- i.languages.bash = {
662
+ e.languages.bash = {
2037
663
  shebang: {
2038
664
  pattern: /^#!\s*\/.*/,
2039
665
  alias: "important"
@@ -2071,7 +697,7 @@ Prism.languages.sql = {
2071
697
  pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
2072
698
  inside: {
2073
699
  environment: {
2074
- pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + p),
700
+ pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + u),
2075
701
  lookbehind: !0,
2076
702
  alias: "constant"
2077
703
  }
@@ -2091,7 +717,7 @@ Prism.languages.sql = {
2091
717
  pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
2092
718
  lookbehind: !0,
2093
719
  greedy: !0,
2094
- inside: l
720
+ inside: o
2095
721
  },
2096
722
  // Here-document with quotes around the tag
2097
723
  // → No expansion (so no “inside”).
@@ -2100,7 +726,7 @@ Prism.languages.sql = {
2100
726
  lookbehind: !0,
2101
727
  greedy: !0,
2102
728
  inside: {
2103
- bash: n
729
+ bash: a
2104
730
  }
2105
731
  },
2106
732
  // “Normal” string
@@ -2109,7 +735,7 @@ Prism.languages.sql = {
2109
735
  pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
2110
736
  lookbehind: !0,
2111
737
  greedy: !0,
2112
- inside: l
738
+ inside: o
2113
739
  },
2114
740
  {
2115
741
  // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
@@ -2122,15 +748,15 @@ Prism.languages.sql = {
2122
748
  pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
2123
749
  greedy: !0,
2124
750
  inside: {
2125
- entity: l.entity
751
+ entity: o.entity
2126
752
  }
2127
753
  }
2128
754
  ],
2129
755
  environment: {
2130
- pattern: RegExp("\\$?" + p),
756
+ pattern: RegExp("\\$?" + u),
2131
757
  alias: "constant"
2132
758
  },
2133
- variable: l.variable,
759
+ variable: o.variable,
2134
760
  function: {
2135
761
  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;|&])/,
2136
762
  lookbehind: !0
@@ -2169,8 +795,8 @@ Prism.languages.sql = {
2169
795
  pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
2170
796
  lookbehind: !0
2171
797
  }
2172
- }, n.inside = i.languages.bash;
2173
- for (var v = [
798
+ }, a.inside = e.languages.bash;
799
+ for (var E = [
2174
800
  "comment",
2175
801
  "function-name",
2176
802
  "for-or-select",
@@ -2186,9 +812,9 @@ Prism.languages.sql = {
2186
812
  "operator",
2187
813
  "punctuation",
2188
814
  "number"
2189
- ], k = l.variable[1].inside, A = 0; A < v.length; A++)
2190
- k[v[A]] = i.languages.bash[v[A]];
2191
- i.languages.sh = i.languages.bash, i.languages.shell = i.languages.bash;
815
+ ], f = o.variable[1].inside, p = 0; p < E.length; p++)
816
+ f[E[p]] = e.languages.bash[E[p]];
817
+ e.languages.sh = e.languages.bash, e.languages.shell = e.languages.bash;
2192
818
  })(Prism);
2193
819
  Prism.languages.json = {
2194
820
  property: {
@@ -2215,7 +841,7 @@ Prism.languages.json = {
2215
841
  }
2216
842
  };
2217
843
  Prism.languages.webmanifest = Prism.languages.json;
2218
- const Ue = `
844
+ const ye = `
2219
845
  /* 默认代码颜色 */
2220
846
  .hep-cr-editor .hep-cr-highlight code,
2221
847
  .hep-cr-editor .hep-cr-highlight pre {
@@ -2301,7 +927,7 @@ const Ue = `
2301
927
  .hep-cr-editor .token.console {
2302
928
  color: #f8f8f2 !important;
2303
929
  }
2304
- `, Be = `
930
+ `, Ae = `
2305
931
  /* 默认代码颜色 */
2306
932
  .hep-cr-editor .hep-cr-highlight code,
2307
933
  .hep-cr-editor .hep-cr-highlight pre {
@@ -2378,7 +1004,7 @@ const Ue = `
2378
1004
  .hep-cr-editor .token.console {
2379
1005
  color: #333 !important;
2380
1006
  }
2381
- `, He = ["innerHTML"], Ge = ["value", "disabled"], ze = 500, je = /* @__PURE__ */ le({
1007
+ `, Ie = ["innerHTML"], _e = ["value", "disabled"], Re = 500, Ne = /* @__PURE__ */ V({
2382
1008
  __name: "CodeEditor",
2383
1009
  props: {
2384
1010
  modelValue: {},
@@ -2387,25 +1013,25 @@ const Ue = `
2387
1013
  disabled: { type: Boolean, default: !1 }
2388
1014
  },
2389
1015
  emits: ["update:modelValue", "change"],
2390
- setup(i, { emit: p }) {
2391
- ve((h) => ({
2392
- v2b19bab6: P.value
2393
- })), typeof window < "u" && (window.Prism = se);
2394
- function n(h) {
1016
+ setup(e, { emit: u }) {
1017
+ ie((l) => ({
1018
+ v2b19bab6: L.value
1019
+ })), typeof window < "u" && (window.Prism = H);
1020
+ function a(l) {
2395
1021
  if (typeof document > "u") return;
2396
- const e = "hep-cr-prism-styles", t = document.getElementById(e), a = h === "dark" ? Ue : Be;
2397
- t && t.remove();
2398
- const r = document.createElement("style");
2399
- r.id = e, r.textContent = a, document.head.appendChild(r);
1022
+ const d = "hep-cr-prism-styles", w = document.getElementById(d), F = l === "dark" ? ye : Ae;
1023
+ w && w.remove();
1024
+ const A = document.createElement("style");
1025
+ A.id = d, A.textContent = F, document.head.appendChild(A);
2400
1026
  }
2401
- const l = i, v = p, k = N(null), A = N(null);
2402
- let s = null;
2403
- function m(h) {
2404
- s && clearTimeout(s), s = setTimeout(() => {
2405
- v("change", h);
2406
- }, ze);
1027
+ const o = e, E = u, f = m(null), p = m(null);
1028
+ let b = null;
1029
+ function v(l) {
1030
+ b && clearTimeout(b), b = setTimeout(() => {
1031
+ E("change", l);
1032
+ }, Re);
2407
1033
  }
2408
- const b = {
1034
+ const g = {
2409
1035
  javascript: "javascript",
2410
1036
  js: "javascript",
2411
1037
  typescript: "typescript",
@@ -2436,79 +1062,79 @@ const Ue = `
2436
1062
  yml: "yaml",
2437
1063
  markdown: "markdown",
2438
1064
  md: "markdown"
2439
- }, T = H(() => b[l.language.toLowerCase()] || "javascript"), P = H(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), O = H(() => {
1065
+ }, h = _(() => g[o.language.toLowerCase()] || "javascript"), L = _(() => o.theme === "dark" ? "#1e1e1e" : "#fafafa"), N = _(() => {
2440
1066
  try {
2441
- const h = se.languages[T.value];
2442
- if (h)
2443
- return se.highlight(l.modelValue || "", h, T.value);
1067
+ const l = H.languages[h.value];
1068
+ if (l)
1069
+ return H.highlight(o.modelValue || "", l, h.value);
2444
1070
  } catch {
2445
1071
  }
2446
- return C(l.modelValue || "");
1072
+ return S(o.modelValue || "");
2447
1073
  });
2448
- function C(h) {
2449
- const e = document.createElement("div");
2450
- return e.textContent = h, e.innerHTML;
1074
+ function S(l) {
1075
+ const d = document.createElement("div");
1076
+ return d.textContent = l, d.innerHTML;
2451
1077
  }
2452
- function M(h) {
2453
- const e = h.target;
2454
- v("update:modelValue", e.value), m(e.value);
1078
+ function C(l) {
1079
+ const d = l.target;
1080
+ E("update:modelValue", d.value), v(d.value);
2455
1081
  }
2456
- function S() {
2457
- k.value && A.value && (A.value.scrollTop = k.value.scrollTop, A.value.scrollLeft = k.value.scrollLeft);
1082
+ function T() {
1083
+ f.value && p.value && (p.value.scrollTop = f.value.scrollTop, p.value.scrollLeft = f.value.scrollLeft);
2458
1084
  }
2459
- function y(h) {
2460
- if (h.key === "Tab") {
2461
- h.preventDefault();
2462
- const e = h.target, t = e.selectionStart, a = e.selectionEnd, r = e.value;
2463
- e.value = r.substring(0, t) + " " + r.substring(a), e.selectionStart = e.selectionEnd = t + 2, v("update:modelValue", e.value), m(e.value);
1085
+ function y(l) {
1086
+ if (l.key === "Tab") {
1087
+ l.preventDefault();
1088
+ const d = l.target, w = d.selectionStart, F = d.selectionEnd, A = d.value;
1089
+ d.value = A.substring(0, w) + " " + A.substring(F), d.selectionStart = d.selectionEnd = w + 2, E("update:modelValue", d.value), v(d.value);
2464
1090
  }
2465
1091
  }
2466
- return he(() => {
2467
- n(l.theme);
2468
- }), ue(() => l.theme, (h) => {
2469
- n(h);
2470
- }), Ee(() => {
2471
- s && clearTimeout(s);
2472
- }), (h, e) => (_(), I("div", {
2473
- class: W(["hep-cr-editor", `hep-cr-theme-${i.theme}`])
1092
+ return W(() => {
1093
+ a(o.theme);
1094
+ }), Y(() => o.theme, (l) => {
1095
+ a(l);
1096
+ }), le(() => {
1097
+ b && clearTimeout(b);
1098
+ }), (l, d) => (i(), c("div", {
1099
+ class: O(["hep-cr-editor", `hep-cr-theme-${e.theme}`])
2474
1100
  }, [
2475
- E("pre", {
1101
+ r("pre", {
2476
1102
  ref_key: "highlightRef",
2477
- ref: A,
2478
- class: W(["hep-cr-highlight", [`language-${T.value}`, `hep-cr-prism-${i.theme}`]]),
1103
+ ref: p,
1104
+ class: O(["hep-cr-highlight", [`language-${h.value}`, `hep-cr-prism-${e.theme}`]]),
2479
1105
  "aria-hidden": "true"
2480
1106
  }, [
2481
- E("code", { innerHTML: O.value }, null, 8, He)
1107
+ r("code", { innerHTML: N.value }, null, 8, Ie)
2482
1108
  ], 2),
2483
- E("textarea", {
1109
+ r("textarea", {
2484
1110
  ref_key: "codeRef",
2485
- ref: k,
1111
+ ref: f,
2486
1112
  class: "hep-cr-input",
2487
- value: i.modelValue,
2488
- disabled: i.disabled,
2489
- onInput: M,
2490
- onScroll: S,
1113
+ value: e.modelValue,
1114
+ disabled: e.disabled,
1115
+ onInput: C,
1116
+ onScroll: T,
2491
1117
  onKeydown: y,
2492
1118
  spellcheck: "false",
2493
1119
  placeholder: "Write your code here..."
2494
- }, null, 40, Ge)
1120
+ }, null, 40, _e)
2495
1121
  ], 2));
2496
1122
  }
2497
- }), fe = (i, p) => {
2498
- const n = i.__vccOpts || i;
2499
- for (const [l, v] of p)
2500
- n[l] = v;
2501
- return n;
2502
- }, We = /* @__PURE__ */ fe(je, [["__scopeId", "data-v-a988ca2a"]]), Ve = { class: "hep-cr-header" }, Ye = { class: "hep-cr-controls" }, Xe = ["disabled"], Ze = {
1123
+ }), q = (e, u) => {
1124
+ const a = e.__vccOpts || e;
1125
+ for (const [o, E] of u)
1126
+ a[o] = E;
1127
+ return a;
1128
+ }, we = /* @__PURE__ */ q(Ne, [["__scopeId", "data-v-a988ca2a"]]), Oe = { class: "hep-cr-header" }, Le = { class: "hep-cr-controls" }, Ce = ["disabled"], xe = {
2503
1129
  key: 0,
2504
1130
  value: ""
2505
- }, Ke = ["value"], qe = ["disabled"], Je = { class: "hep-cr-actions" }, Qe = ["disabled"], et = {
1131
+ }, De = ["value"], Fe = { class: "hep-cr-actions" }, Pe = ["disabled"], Ue = {
2506
1132
  key: 0,
2507
1133
  class: "hep-cr-spinner"
2508
- }, tt = {
1134
+ }, Me = {
2509
1135
  key: 1,
2510
1136
  class: "hep-cr-run-icon"
2511
- }, nt = ["title"], at = {
1137
+ }, Be = ["title"], $e = {
2512
1138
  key: 0,
2513
1139
  width: "16",
2514
1140
  height: "16",
@@ -2516,7 +1142,7 @@ const Ue = `
2516
1142
  fill: "none",
2517
1143
  stroke: "currentColor",
2518
1144
  "stroke-width": "2"
2519
- }, rt = {
1145
+ }, Ge = {
2520
1146
  key: 1,
2521
1147
  width: "16",
2522
1148
  height: "16",
@@ -2524,10 +1150,10 @@ const Ue = `
2524
1150
  fill: "none",
2525
1151
  stroke: "currentColor",
2526
1152
  "stroke-width": "2"
2527
- }, ot = {
1153
+ }, He = {
2528
1154
  key: 0,
2529
1155
  class: "hep-cr-error"
2530
- }, st = { class: "hep-cr-main" }, it = { class: "hep-cr-panel-header" }, lt = { class: "hep-cr-output-actions" }, ut = { class: "hep-cr-language-badge" }, ct = ["disabled", "title"], dt = {
1156
+ }, ze = { class: "hep-cr-main" }, Ve = { class: "hep-cr-panel-header" }, Ye = { class: "hep-cr-output-actions" }, Xe = { class: "hep-cr-language-badge" }, je = ["disabled", "title"], Ke = {
2531
1157
  key: 0,
2532
1158
  width: "14",
2533
1159
  height: "14",
@@ -2535,13 +1161,13 @@ const Ue = `
2535
1161
  fill: "none",
2536
1162
  stroke: "currentColor",
2537
1163
  "stroke-width": "2"
2538
- }, pt = {
1164
+ }, Ze = {
2539
1165
  key: 1,
2540
1166
  class: "hep-cr-copied-text"
2541
- }, gt = { class: "hep-cr-panel-header" }, ht = { class: "hep-cr-output-tabs" }, mt = { class: "hep-cr-output-actions" }, ft = {
1167
+ }, We = { class: "hep-cr-panel-header" }, qe = { class: "hep-cr-output-tabs" }, Qe = { class: "hep-cr-output-actions" }, Je = {
2542
1168
  key: 0,
2543
1169
  class: "hep-cr-execution-time"
2544
- }, bt = ["disabled", "title"], vt = {
1170
+ }, et = ["disabled", "title"], tt = {
2545
1171
  key: 0,
2546
1172
  width: "14",
2547
1173
  height: "14",
@@ -2549,13 +1175,13 @@ const Ue = `
2549
1175
  fill: "none",
2550
1176
  stroke: "currentColor",
2551
1177
  "stroke-width": "2"
2552
- }, Et = {
1178
+ }, nt = {
2553
1179
  key: 1,
2554
1180
  class: "hep-cr-copied-text"
2555
- }, yt = { class: "hep-cr-output-content" }, At = { key: 0 }, St = {
1181
+ }, rt = { class: "hep-cr-output-content" }, at = { key: 0 }, ot = {
2556
1182
  key: 1,
2557
1183
  class: "hep-cr-stderr"
2558
- }, ge = "hep-cr-default-language", kt = /* @__PURE__ */ le({
1184
+ }, Z = "hep-cr-default-language", st = /* @__PURE__ */ V({
2559
1185
  __name: "CodeRunner",
2560
1186
  props: {
2561
1187
  pistonUrl: { default: "/api/piston" },
@@ -2569,185 +1195,176 @@ const Ue = `
2569
1195
  executorLabel: { default: "运行" }
2570
1196
  },
2571
1197
  emits: ["execute-start", "execute-end", "language-change", "change"],
2572
- setup(i, { emit: p }) {
2573
- const n = i, l = H(() => {
2574
- if (!n.themeColor) return {};
2575
- const g = n.theme === "dark", u = n.themeColor, L = v(u) ? "#000" : "#fff";
1198
+ setup(e, { emit: u }) {
1199
+ const a = e, o = _(() => {
1200
+ if (!a.themeColor) return {};
1201
+ const t = a.theme === "dark", n = a.themeColor, I = E(n) ? "#000" : "#fff";
2576
1202
  return {
2577
- "--hep-cr-theme-color": u,
2578
- "--hep-cr-theme-color-hover": g ? k(u, 20) : k(u, -20),
2579
- "--hep-cr-tab-active-color": L
1203
+ "--hep-cr-theme-color": n,
1204
+ "--hep-cr-theme-color-hover": t ? f(n, 20) : f(n, -20),
1205
+ "--hep-cr-tab-active-color": I
2580
1206
  };
2581
1207
  });
2582
- function v(g) {
2583
- const u = parseInt(g.replace("#", ""), 16), w = u >> 16 & 255, L = u >> 8 & 255, B = u & 255;
2584
- return (0.299 * w + 0.587 * L + 0.114 * B) / 255 > 0.5;
2585
- }
2586
- function k(g, u) {
2587
- const w = parseInt(g.replace("#", ""), 16), L = Math.round(2.55 * u), B = Math.min(255, Math.max(0, (w >> 16) + L)), j = Math.min(255, Math.max(0, (w >> 8 & 255) + L)), V = Math.min(255, Math.max(0, (w & 255) + L));
2588
- return "#" + (16777216 + B * 65536 + j * 256 + V).toString(16).slice(1);
1208
+ function E(t) {
1209
+ const n = parseInt(t.replace("#", ""), 16), s = n >> 16 & 255, I = n >> 8 & 255, G = n & 255;
1210
+ return (0.299 * s + 0.587 * I + 0.114 * G) / 255 > 0.5;
2589
1211
  }
2590
- const A = p, s = N([]), m = N(t()), b = N(n.theme), T = N(""), P = N(""), O = N(""), C = N(!1), M = N(null), S = N("stdout"), y = N(null), h = N(!1), e = N(60);
2591
- function t() {
2592
- return typeof window > "u" ? n.language : localStorage.getItem(ge) || n.language;
1212
+ function f(t, n) {
1213
+ const s = parseInt(t.replace("#", ""), 16), I = Math.round(2.55 * n), G = Math.min(255, Math.max(0, (s >> 16) + I)), K = Math.min(255, Math.max(0, (s >> 8 & 255) + I)), se = Math.min(255, Math.max(0, (s & 255) + I));
1214
+ return "#" + (16777216 + G * 65536 + K * 256 + se).toString(16).slice(1);
2593
1215
  }
2594
- function a() {
2595
- typeof window < "u" && localStorage.setItem(ge, m.value);
1216
+ const p = u, b = m([]), v = m(w()), g = m(a.theme), h = m(""), L = m(""), N = m(""), S = m(!1), C = m(null), T = m("stdout"), y = m(null), l = m(!1), d = m(60);
1217
+ function w() {
1218
+ return typeof window > "u" ? a.language : localStorage.getItem(Z) || a.language;
2596
1219
  }
2597
- function r() {
2598
- b.value = b.value === "light" ? "dark" : "light";
1220
+ function F() {
1221
+ g.value = g.value === "light" ? "dark" : "light";
2599
1222
  }
2600
- const o = H(
2601
- () => new De({ pistonUrl: n.pistonUrl })
2602
- ), d = H(() => s.value.map((g) => ({
2603
- value: `${g.language}:${g.version}`,
2604
- label: `${g.language.charAt(0).toUpperCase() + g.language.slice(1)} ${g.version}`
2605
- }))), f = H(() => {
2606
- const g = m.value;
2607
- return g.includes(":") ? g.split(":")[0] : g;
1223
+ const A = _(
1224
+ () => new ke({ pistonUrl: a.pistonUrl })
1225
+ ), Q = _(() => b.value.map((t) => ({
1226
+ value: `${t.language}:${t.version}`,
1227
+ label: `${t.language.charAt(0).toUpperCase() + t.language.slice(1)} ${t.version}`
1228
+ }))), P = _(() => {
1229
+ const t = v.value;
1230
+ return t.includes(":") ? t.split(":")[0] : t;
2608
1231
  });
2609
- async function c() {
2610
- h.value = !0, y.value = null;
1232
+ async function J() {
1233
+ l.value = !0, y.value = null;
2611
1234
  try {
2612
- s.value = await o.value.getRuntimes();
2613
- const g = m.value.split(":")[0], u = s.value.find((w) => w.language === g);
2614
- u && !m.value.includes(":") && (m.value = `${g}:${u.version}`), A("language-change", g, T.value);
2615
- } catch (g) {
2616
- y.value = g instanceof Error ? g.message : "Failed to load runtimes";
1235
+ b.value = await A.value.getRuntimes();
1236
+ const t = v.value.split(":")[0], n = b.value.find((s) => s.language === t);
1237
+ n && !v.value.includes(":") && (v.value = `${t}:${n.version}`), h.value || (h.value = a.defaultCode || U(t), p("change", h.value)), p("language-change", t, h.value);
1238
+ } catch (t) {
1239
+ y.value = t instanceof Error ? t.message : "Failed to load runtimes";
2617
1240
  } finally {
2618
- h.value = !1;
1241
+ l.value = !1;
2619
1242
  }
2620
1243
  }
2621
- ue(m, (g) => {
2622
- const u = g.includes(":") ? g.split(":")[0] : g, w = oe(u);
2623
- T.value = w, A("language-change", u, w);
1244
+ Y(v, (t) => {
1245
+ const n = t.includes(":") ? t.split(":")[0] : t, s = U(n);
1246
+ h.value = s, p("language-change", n, s), typeof window < "u" && localStorage.setItem(Z, t);
2624
1247
  });
2625
- async function x() {
2626
- if (!C.value) {
2627
- C.value = !0, P.value = "", O.value = "", M.value = null, y.value = null, S.value = "stdout", A("execute-start");
1248
+ async function ee() {
1249
+ if (!S.value) {
1250
+ S.value = !0, L.value = "", N.value = "", C.value = null, y.value = null, T.value = "stdout", p("execute-start");
2628
1251
  try {
2629
- const g = await o.value.execute(f.value, T.value);
2630
- P.value = g.output, O.value = g.stderr, M.value = g.executionTime || null, S.value = g.stderr ? "stderr" : "stdout", A("execute-end", g);
2631
- } catch (g) {
2632
- y.value = g instanceof Error ? g.message : "Execution failed", A("execute-end", {
1252
+ const t = await A.value.execute(P.value, h.value);
1253
+ L.value = t.output, N.value = t.stderr, C.value = t.executionTime || null, T.value = t.stderr ? "stderr" : "stdout", p("execute-end", t);
1254
+ } catch (t) {
1255
+ y.value = t instanceof Error ? t.message : "Execution failed", p("execute-end", {
2633
1256
  success: !1,
2634
1257
  output: "",
2635
1258
  stderr: y.value,
2636
1259
  code: -1
2637
1260
  });
2638
1261
  } finally {
2639
- C.value = !1;
1262
+ S.value = !1;
2640
1263
  }
2641
1264
  }
2642
1265
  }
2643
- const F = N(!1), D = N(!1);
2644
- async function X() {
2645
- await navigator.clipboard.writeText(T.value), F.value = !0, setTimeout(() => {
2646
- F.value = !1;
1266
+ const x = m(!1), D = m(!1);
1267
+ async function te() {
1268
+ await navigator.clipboard.writeText(h.value), x.value = !0, setTimeout(() => {
1269
+ x.value = !1;
2647
1270
  }, 2e3);
2648
1271
  }
2649
- async function Z() {
2650
- const g = S.value === "stdout" ? P.value : O.value;
2651
- await navigator.clipboard.writeText(g), D.value = !0, setTimeout(() => {
1272
+ async function ne() {
1273
+ const t = T.value === "stdout" ? L.value : N.value;
1274
+ await navigator.clipboard.writeText(t), D.value = !0, setTimeout(() => {
2652
1275
  D.value = !1;
2653
1276
  }, 2e3);
2654
1277
  }
2655
- function ee() {
2656
- T.value = oe(f.value);
1278
+ function re() {
1279
+ h.value = U(P.value);
2657
1280
  }
2658
- let Y = !1;
2659
- function K(g) {
2660
- Y = !0, document.addEventListener("mousemove", R), document.addEventListener("mouseup", $), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
1281
+ let $ = !1;
1282
+ function ae(t) {
1283
+ $ = !0, document.addEventListener("mousemove", X), document.addEventListener("mouseup", j), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
2661
1284
  }
2662
- function R(g) {
2663
- if (!Y) return;
2664
- const u = document.querySelector(
1285
+ function X(t) {
1286
+ if (!$) return;
1287
+ const n = document.querySelector(
2665
1288
  ".hep-cr-main"
2666
1289
  );
2667
- if (!u) return;
2668
- const w = u.getBoundingClientRect(), L = (g.clientX - w.left) / w.width * 100;
2669
- e.value = Math.max(20, Math.min(80, L));
1290
+ if (!n) return;
1291
+ const s = n.getBoundingClientRect(), I = (t.clientX - s.left) / s.width * 100;
1292
+ d.value = Math.max(20, Math.min(80, I));
2670
1293
  }
2671
- function $() {
2672
- Y = !1, document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", $), document.body.style.cursor = "", document.body.style.userSelect = "";
1294
+ function j() {
1295
+ $ = !1, document.removeEventListener("mousemove", X), document.removeEventListener("mouseup", j), document.body.style.cursor = "", document.body.style.userSelect = "";
2673
1296
  }
2674
- he(async () => {
2675
- await c(), T.value || (T.value = n.defaultCode || oe(m.value), A("change", T.value));
1297
+ W(async () => {
1298
+ await J(), h.value || (h.value = a.defaultCode || U(v.value), p("change", h.value));
2676
1299
  });
2677
- const G = H(() => `hep-cr-runner-${b.value}`);
2678
- return (g, u) => (_(), I("div", {
2679
- class: W(["hep-cr-runner", G.value]),
2680
- style: J(l.value)
1300
+ const oe = _(() => `hep-cr-runner-${g.value}`);
1301
+ return (t, n) => (i(), c("div", {
1302
+ class: O(["hep-cr-runner", oe.value]),
1303
+ style: M(o.value)
2681
1304
  }, [
2682
- E("div", Ve, [
2683
- E("div", Ye, [
2684
- i.showLanguageSelector ? ye((_(), I("select", {
1305
+ r("div", Oe, [
1306
+ r("div", Le, [
1307
+ e.showLanguageSelector ? ce((i(), c("select", {
2685
1308
  key: 0,
2686
- "onUpdate:modelValue": u[0] || (u[0] = (w) => m.value = w),
1309
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => v.value = s),
2687
1310
  class: "hep-cr-language-select",
2688
- disabled: C.value
1311
+ disabled: S.value
2689
1312
  }, [
2690
- h.value ? (_(), I("option", Ze, "加载中...")) : U("", !0),
2691
- (_(!0), I(Ae, null, Se(d.value, (w) => (_(), I("option", {
2692
- key: w.value,
2693
- value: w.value
2694
- }, z(w.label), 9, Ke))), 128))
2695
- ], 8, Xe)), [
2696
- [ke, m.value]
2697
- ]) : U("", !0),
2698
- E("button", {
2699
- class: "hep-cr-btn hep-cr-btn-set-default",
2700
- disabled: C.value,
2701
- onClick: a,
2702
- title: "设为默认语言"
2703
- }, " ★ ", 8, qe)
1313
+ l.value ? (i(), c("option", xe, "加载中...")) : k("", !0),
1314
+ (i(!0), c(ue, null, de(Q.value, (s) => (i(), c("option", {
1315
+ key: s.value,
1316
+ value: s.value
1317
+ }, R(s.label), 9, De))), 128))
1318
+ ], 8, Ce)), [
1319
+ [pe, v.value]
1320
+ ]) : k("", !0)
2704
1321
  ]),
2705
- E("div", Je, [
2706
- E("button", {
1322
+ r("div", Fe, [
1323
+ r("button", {
2707
1324
  class: "hep-cr-btn hep-cr-btn-run",
2708
- disabled: C.value || h.value,
2709
- onClick: x
1325
+ disabled: S.value || l.value,
1326
+ onClick: ee
2710
1327
  }, [
2711
- C.value ? (_(), I("span", et)) : (_(), I("span", tt, "▶")),
2712
- we(" " + z(C.value ? "运行中..." : i.executorLabel), 1)
2713
- ], 8, Qe),
2714
- i.showEditor && i.editable ? (_(), I("button", {
1328
+ S.value ? (i(), c("span", Ue)) : (i(), c("span", Me, "▶")),
1329
+ he(" " + R(S.value ? "运行中..." : e.executorLabel), 1)
1330
+ ], 8, Pe),
1331
+ e.showEditor && e.editable ? (i(), c("button", {
2715
1332
  key: 0,
2716
1333
  class: "hep-cr-btn hep-cr-btn-reset",
2717
- onClick: ee
2718
- }, " 重置 ")) : U("", !0),
2719
- E("button", {
1334
+ onClick: re
1335
+ }, " 重置 ")) : k("", !0),
1336
+ r("button", {
2720
1337
  class: "hep-cr-btn hep-cr-btn-theme",
2721
- onClick: r,
2722
- title: b.value === "light" ? "Switch to dark mode" : "Switch to light mode"
1338
+ onClick: F,
1339
+ title: g.value === "light" ? "Switch to dark mode" : "Switch to light mode"
2723
1340
  }, [
2724
- b.value === "light" ? (_(), I("svg", at, [...u[5] || (u[5] = [
2725
- E("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)
2726
- ])])) : (_(), I("svg", rt, [...u[6] || (u[6] = [
2727
- Te('<circle cx="12" cy="12" r="5" data-v-d9748673></circle><line x1="12" y1="1" x2="12" y2="3" data-v-d9748673></line><line x1="12" y1="21" x2="12" y2="23" data-v-d9748673></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-d9748673></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-d9748673></line><line x1="1" y1="12" x2="3" y2="12" data-v-d9748673></line><line x1="21" y1="12" x2="23" y2="12" data-v-d9748673></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-d9748673></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-d9748673></line>', 9)
1341
+ g.value === "light" ? (i(), c("svg", $e, [...n[5] || (n[5] = [
1342
+ r("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)
1343
+ ])])) : (i(), c("svg", Ge, [...n[6] || (n[6] = [
1344
+ ge('<circle cx="12" cy="12" r="5" data-v-41977f3b></circle><line x1="12" y1="1" x2="12" y2="3" data-v-41977f3b></line><line x1="12" y1="21" x2="12" y2="23" data-v-41977f3b></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-41977f3b></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-41977f3b></line><line x1="1" y1="12" x2="3" y2="12" data-v-41977f3b></line><line x1="21" y1="12" x2="23" y2="12" data-v-41977f3b></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-41977f3b></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-41977f3b></line>', 9)
2728
1345
  ])]))
2729
- ], 8, nt)
1346
+ ], 8, Be)
2730
1347
  ])
2731
1348
  ]),
2732
- y.value ? (_(), I("div", ot, z(y.value), 1)) : U("", !0),
2733
- E("div", st, [
2734
- i.showEditor ? (_(), I("div", {
1349
+ y.value ? (i(), c("div", He, R(y.value), 1)) : k("", !0),
1350
+ r("div", ze, [
1351
+ e.showEditor ? (i(), c("div", {
2735
1352
  key: 0,
2736
1353
  class: "hep-cr-editor-panel",
2737
- style: J({ width: e.value + "%" })
1354
+ style: M({ width: d.value + "%" })
2738
1355
  }, [
2739
- E("div", it, [
2740
- u[8] || (u[8] = E("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
2741
- E("div", lt, [
2742
- E("span", ut, z(f.value), 1),
2743
- E("button", {
2744
- class: W(["hep-cr-btn-icon", { "hep-cr-btn-copied": F.value }]),
2745
- disabled: F.value,
2746
- onClick: X,
2747
- title: F.value ? "已复制" : "复制"
1356
+ r("div", Ve, [
1357
+ n[8] || (n[8] = r("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
1358
+ r("div", Ye, [
1359
+ r("span", Xe, R(P.value), 1),
1360
+ r("button", {
1361
+ class: O(["hep-cr-btn-icon", { "hep-cr-btn-copied": x.value }]),
1362
+ disabled: x.value,
1363
+ onClick: te,
1364
+ title: x.value ? "已复制" : "复制"
2748
1365
  }, [
2749
- F.value ? (_(), I("span", pt, "已复制")) : (_(), I("svg", dt, [...u[7] || (u[7] = [
2750
- E("rect", {
1366
+ x.value ? (i(), c("span", Ze, "已复制")) : (i(), c("svg", Ke, [...n[7] || (n[7] = [
1367
+ r("rect", {
2751
1368
  x: "9",
2752
1369
  y: "9",
2753
1370
  width: "13",
@@ -2755,53 +1372,53 @@ const Ue = `
2755
1372
  rx: "2",
2756
1373
  ry: "2"
2757
1374
  }, null, -1),
2758
- E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
1375
+ r("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
2759
1376
  ])]))
2760
- ], 10, ct)
1377
+ ], 10, je)
2761
1378
  ])
2762
1379
  ]),
2763
- ie(We, {
2764
- modelValue: T.value,
2765
- "onUpdate:modelValue": u[1] || (u[1] = (w) => T.value = w),
2766
- language: f.value,
2767
- theme: b.value,
2768
- disabled: !i.editable || C.value,
2769
- onChange: u[2] || (u[2] = (w) => A("change", w))
1380
+ z(we, {
1381
+ modelValue: h.value,
1382
+ "onUpdate:modelValue": n[1] || (n[1] = (s) => h.value = s),
1383
+ language: P.value,
1384
+ theme: g.value,
1385
+ disabled: !e.editable || S.value,
1386
+ onChange: n[2] || (n[2] = (s) => p("change", s))
2770
1387
  }, null, 8, ["modelValue", "language", "theme", "disabled"])
2771
- ], 4)) : U("", !0),
2772
- i.showEditor ? (_(), I("div", {
1388
+ ], 4)) : k("", !0),
1389
+ e.showEditor ? (i(), c("div", {
2773
1390
  key: 1,
2774
1391
  class: "hep-cr-resize-handle",
2775
- onMousedown: K
2776
- }, [...u[9] || (u[9] = [
2777
- E("div", { class: "hep-cr-resize-line" }, null, -1)
2778
- ])], 32)) : U("", !0),
2779
- E("div", {
1392
+ onMousedown: ae
1393
+ }, [...n[9] || (n[9] = [
1394
+ r("div", { class: "hep-cr-resize-line" }, null, -1)
1395
+ ])], 32)) : k("", !0),
1396
+ r("div", {
2780
1397
  class: "hep-cr-output-panel",
2781
- style: J({ width: i.showEditor ? 100 - e.value + "%" : "100%" })
1398
+ style: M({ width: e.showEditor ? 100 - d.value + "%" : "100%" })
2782
1399
  }, [
2783
- E("div", gt, [
2784
- E("div", ht, [
2785
- E("button", {
2786
- class: W(["hep-cr-tab", { active: S.value === "stdout" }]),
2787
- onClick: u[3] || (u[3] = (w) => S.value = "stdout")
1400
+ r("div", We, [
1401
+ r("div", qe, [
1402
+ r("button", {
1403
+ class: O(["hep-cr-tab", { active: T.value === "stdout" }]),
1404
+ onClick: n[3] || (n[3] = (s) => T.value = "stdout")
2788
1405
  }, " 输出 ", 2),
2789
- O.value ? (_(), I("button", {
1406
+ N.value ? (i(), c("button", {
2790
1407
  key: 0,
2791
- class: W(["hep-cr-tab", "hep-cr-tab-error", { active: S.value === "stderr" }]),
2792
- onClick: u[4] || (u[4] = (w) => S.value = "stderr")
2793
- }, " 错误 ", 2)) : U("", !0)
1408
+ class: O(["hep-cr-tab", "hep-cr-tab-error", { active: T.value === "stderr" }]),
1409
+ onClick: n[4] || (n[4] = (s) => T.value = "stderr")
1410
+ }, " 错误 ", 2)) : k("", !0)
2794
1411
  ]),
2795
- E("div", mt, [
2796
- M.value !== null ? (_(), I("span", ft, z(M.value) + "ms ", 1)) : U("", !0),
2797
- E("button", {
2798
- class: W(["hep-cr-btn-icon", { "hep-cr-btn-copied": D.value }]),
1412
+ r("div", Qe, [
1413
+ C.value !== null ? (i(), c("span", Je, R(C.value) + "ms ", 1)) : k("", !0),
1414
+ r("button", {
1415
+ class: O(["hep-cr-btn-icon", { "hep-cr-btn-copied": D.value }]),
2799
1416
  disabled: D.value,
2800
- onClick: Z,
1417
+ onClick: ne,
2801
1418
  title: D.value ? "已复制" : "复制"
2802
1419
  }, [
2803
- D.value ? (_(), I("span", Et, "已复制")) : (_(), I("svg", vt, [...u[10] || (u[10] = [
2804
- E("rect", {
1420
+ D.value ? (i(), c("span", nt, "已复制")) : (i(), c("svg", tt, [...n[10] || (n[10] = [
1421
+ r("rect", {
2805
1422
  x: "9",
2806
1423
  y: "9",
2807
1424
  width: "13",
@@ -2809,22 +1426,22 @@ const Ue = `
2809
1426
  rx: "2",
2810
1427
  ry: "2"
2811
1428
  }, null, -1),
2812
- E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
1429
+ r("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
2813
1430
  ])]))
2814
- ], 10, bt)
1431
+ ], 10, et)
2815
1432
  ])
2816
1433
  ]),
2817
- E("div", yt, [
2818
- S.value === "stdout" ? (_(), I("pre", At, z(C.value ? "代码执行中..." : P.value || '点击"运行"执行代码'), 1)) : (_(), I("pre", St, z(O.value), 1))
1434
+ r("div", rt, [
1435
+ T.value === "stdout" ? (i(), c("pre", at, R(S.value ? "代码执行中..." : L.value || '点击"运行"执行代码'), 1)) : (i(), c("pre", ot, R(N.value), 1))
2819
1436
  ])
2820
1437
  ], 4)
2821
1438
  ])
2822
1439
  ], 6));
2823
1440
  }
2824
- }), Q = /* @__PURE__ */ fe(kt, [["__scopeId", "data-v-d9748673"]]), wt = { class: "hep-cr-dialog-header" }, Tt = { class: "hep-cr-dialog-title" }, _t = { class: "hep-cr-dialog-body" }, xt = {
1441
+ }), B = /* @__PURE__ */ q(st, [["__scopeId", "data-v-41977f3b"]]), it = { class: "hep-cr-dialog-header" }, lt = { class: "hep-cr-dialog-title" }, ct = { class: "hep-cr-dialog-body" }, ut = {
2825
1442
  key: 0,
2826
1443
  class: "hep-cr-dialog-footer"
2827
- }, Ft = /* @__PURE__ */ le({
1444
+ }, gt = /* @__PURE__ */ V({
2828
1445
  __name: "CodeRunnerDialog",
2829
1446
  props: {
2830
1447
  modelValue: { type: Boolean, default: !1 },
@@ -2841,41 +1458,41 @@ const Ue = `
2841
1458
  executorLabel: { default: "运行" }
2842
1459
  },
2843
1460
  emits: ["update:modelValue", "close", "change"],
2844
- setup(i, { expose: p, emit: n }) {
2845
- const l = i, v = n, k = N(l.modelValue), A = H(() => l.modelValue !== void 0 ? l.modelValue : k.value);
2846
- ue(
2847
- () => l.modelValue,
2848
- (b) => {
2849
- b !== void 0 && (k.value = b);
1461
+ setup(e, { expose: u, emit: a }) {
1462
+ const o = e, E = a, f = m(o.modelValue), p = _(() => o.modelValue !== void 0 ? o.modelValue : f.value);
1463
+ Y(
1464
+ () => o.modelValue,
1465
+ (g) => {
1466
+ g !== void 0 && (f.value = g);
2850
1467
  }
2851
1468
  );
2852
- function s() {
2853
- k.value = !1, v("update:modelValue", !1), v("close");
1469
+ function b() {
1470
+ f.value = !1, E("update:modelValue", !1), E("close");
2854
1471
  }
2855
- function m(b) {
2856
- b.target === b.currentTarget && s();
1472
+ function v(g) {
1473
+ g.target === g.currentTarget && b();
2857
1474
  }
2858
- return p({
2859
- close: s
2860
- }), (b, T) => (_(), _e(xe, { to: "body" }, [
2861
- ie(Ie, { name: "hep-cr-dialog-fade" }, {
2862
- default: Fe(() => [
2863
- A.value ? (_(), I("div", {
1475
+ return u({
1476
+ close: b
1477
+ }), (g, h) => (i(), me(Ee, { to: "body" }, [
1478
+ z(be, { name: "hep-cr-dialog-fade" }, {
1479
+ default: fe(() => [
1480
+ p.value ? (i(), c("div", {
2864
1481
  key: 0,
2865
1482
  class: "hep-cr-dialog-overlay",
2866
- onClick: m
1483
+ onClick: v
2867
1484
  }, [
2868
- E("div", {
1485
+ r("div", {
2869
1486
  class: "hep-cr-dialog-container",
2870
- style: J({ width: typeof i.width == "number" ? i.width + "px" : i.width })
1487
+ style: M({ width: typeof e.width == "number" ? e.width + "px" : e.width })
2871
1488
  }, [
2872
- E("div", wt, [
2873
- E("h3", Tt, z(i.title), 1),
2874
- E("button", {
1489
+ r("div", it, [
1490
+ r("h3", lt, R(e.title), 1),
1491
+ r("button", {
2875
1492
  class: "hep-cr-dialog-close",
2876
- onClick: s
2877
- }, [...T[0] || (T[0] = [
2878
- E("svg", {
1493
+ onClick: b
1494
+ }, [...h[0] || (h[0] = [
1495
+ r("svg", {
2879
1496
  width: "16",
2880
1497
  height: "16",
2881
1498
  viewBox: "0 0 24 24",
@@ -2883,13 +1500,13 @@ const Ue = `
2883
1500
  stroke: "currentColor",
2884
1501
  "stroke-width": "2"
2885
1502
  }, [
2886
- E("line", {
1503
+ r("line", {
2887
1504
  x1: "18",
2888
1505
  y1: "6",
2889
1506
  x2: "6",
2890
1507
  y2: "18"
2891
1508
  }),
2892
- E("line", {
1509
+ r("line", {
2893
1510
  x1: "6",
2894
1511
  y1: "6",
2895
1512
  x2: "18",
@@ -2898,30 +1515,30 @@ const Ue = `
2898
1515
  ], -1)
2899
1516
  ])])
2900
1517
  ]),
2901
- E("div", _t, [
2902
- ie(Q, Re(b.$attrs, Le(b.$attrs)), null, 16)
1518
+ r("div", ct, [
1519
+ z(B, ve(g.$attrs, Se(g.$attrs)), null, 16)
2903
1520
  ]),
2904
- b.$slots.footer ? (_(), I("div", xt, [
2905
- Ne(b.$slots, "footer", { close: s })
2906
- ])) : U("", !0)
1521
+ g.$slots.footer ? (i(), c("div", ut, [
1522
+ Te(g.$slots, "footer", { close: b })
1523
+ ])) : k("", !0)
2907
1524
  ], 4)
2908
- ])) : U("", !0)
1525
+ ])) : k("", !0)
2909
1526
  ]),
2910
1527
  _: 3
2911
1528
  })
2912
1529
  ]));
2913
1530
  }
2914
1531
  });
2915
- Q.install = (i) => {
2916
- i.component("CodeRunner", Q);
1532
+ B.install = (e) => {
1533
+ e.component("CodeRunner", B);
2917
1534
  };
2918
- const Rt = {
2919
- install(i) {
2920
- i.component("CodeRunner", Q);
1535
+ const mt = {
1536
+ install(e) {
1537
+ e.component("CodeRunner", B);
2921
1538
  }
2922
1539
  };
2923
1540
  export {
2924
- Q as CodeRunner,
2925
- Ft as CodeRunnerDialog,
2926
- Rt as default
1541
+ B as CodeRunner,
1542
+ gt as CodeRunnerDialog,
1543
+ mt as default
2927
1544
  };