@kong-ui-public/document-viewer 2.3.13-pr.2751.7a3f18384.0 → 2.3.14-pr.2694.d983d66d0.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.
Files changed (81) hide show
  1. package/package.json +1 -1
  2. package/dist/document-viewer.es.js +0 -1654
  3. package/dist/document-viewer.umd.js +0 -47
  4. package/dist/prism-bash.min-HHIMdNJ_.js +0 -6
  5. package/dist/prism-css.min-BgYu_Rzi.js +0 -7
  6. package/dist/prism-docker.min-RkX3juQh.js +0 -22
  7. package/dist/prism-go.min-C7UmK6TW.js +0 -1
  8. package/dist/prism-http.min-CP9t4YhN.js +0 -22
  9. package/dist/prism-javascript.min-CEqHqgbm.js +0 -8
  10. package/dist/prism-jq.min-KI3qrR2-.js +0 -8
  11. package/dist/prism-json.min-B1GJqK1k.js +0 -1
  12. package/dist/prism-log.min-SDopTpKN.js +0 -1
  13. package/dist/prism-lua.min-DwRnUVfS.js +0 -1
  14. package/dist/prism-makefile.min-DyutknhE.js +0 -1
  15. package/dist/prism-markdown.min-C0Qn0m-5.js +0 -60
  16. package/dist/prism-python.min-BIfpAh5K.js +0 -1
  17. package/dist/prism-regex.min-BqTi0NTp.js +0 -4
  18. package/dist/prism-rest.min-B6veHRJF.js +0 -1
  19. package/dist/prism-rust.min-xSp7-1qY.js +0 -8
  20. package/dist/prism-scss.min-B0csyGJo.js +0 -1
  21. package/dist/prism-sql.min-BHXzX-c_.js +0 -1
  22. package/dist/prism-typescript.min-oSVeWCAd.js +0 -5
  23. package/dist/prism-xml-doc.min-BGai1RKL.js +0 -7
  24. package/dist/prism-yaml.min-ADtdOEMG.js +0 -28
  25. package/dist/style.css +0 -1
  26. package/dist/types/components/DocumentViewer.vue.d.ts +0 -14
  27. package/dist/types/components/DocumentViewer.vue.d.ts.map +0 -1
  28. package/dist/types/components/nodes/Blockquote.vue.d.ts +0 -14
  29. package/dist/types/components/nodes/Blockquote.vue.d.ts.map +0 -1
  30. package/dist/types/components/nodes/Code.vue.d.ts +0 -14
  31. package/dist/types/components/nodes/Code.vue.d.ts.map +0 -1
  32. package/dist/types/components/nodes/CodeBlock.vue.d.ts +0 -74
  33. package/dist/types/components/nodes/CodeBlock.vue.d.ts.map +0 -1
  34. package/dist/types/components/nodes/Emphasis.vue.d.ts +0 -28
  35. package/dist/types/components/nodes/Emphasis.vue.d.ts.map +0 -1
  36. package/dist/types/components/nodes/Heading.vue.d.ts +0 -37
  37. package/dist/types/components/nodes/Heading.vue.d.ts.map +0 -1
  38. package/dist/types/components/nodes/Image.vue.d.ts +0 -33
  39. package/dist/types/components/nodes/Image.vue.d.ts.map +0 -1
  40. package/dist/types/components/nodes/LineBreak.vue.d.ts +0 -4
  41. package/dist/types/components/nodes/LineBreak.vue.d.ts.map +0 -1
  42. package/dist/types/components/nodes/Link.vue.d.ts +0 -34
  43. package/dist/types/components/nodes/Link.vue.d.ts.map +0 -1
  44. package/dist/types/components/nodes/List.vue.d.ts +0 -35
  45. package/dist/types/components/nodes/List.vue.d.ts.map +0 -1
  46. package/dist/types/components/nodes/ListItem.vue.d.ts +0 -14
  47. package/dist/types/components/nodes/ListItem.vue.d.ts.map +0 -1
  48. package/dist/types/components/nodes/Paragraph.vue.d.ts +0 -14
  49. package/dist/types/components/nodes/Paragraph.vue.d.ts.map +0 -1
  50. package/dist/types/components/nodes/Strikethrough.vue.d.ts +0 -14
  51. package/dist/types/components/nodes/Strikethrough.vue.d.ts.map +0 -1
  52. package/dist/types/components/nodes/Table.vue.d.ts +0 -14
  53. package/dist/types/components/nodes/Table.vue.d.ts.map +0 -1
  54. package/dist/types/components/nodes/TableCell.vue.d.ts +0 -37
  55. package/dist/types/components/nodes/TableCell.vue.d.ts.map +0 -1
  56. package/dist/types/components/nodes/TableRow.vue.d.ts +0 -28
  57. package/dist/types/components/nodes/TableRow.vue.d.ts.map +0 -1
  58. package/dist/types/components/nodes/TaskCheckbox.vue.d.ts +0 -7
  59. package/dist/types/components/nodes/TaskCheckbox.vue.d.ts.map +0 -1
  60. package/dist/types/components/nodes/Text.vue.d.ts +0 -33
  61. package/dist/types/components/nodes/Text.vue.d.ts.map +0 -1
  62. package/dist/types/components/nodes/TextBlock.vue.d.ts +0 -14
  63. package/dist/types/components/nodes/TextBlock.vue.d.ts.map +0 -1
  64. package/dist/types/components/renderChildren.d.ts +0 -4
  65. package/dist/types/components/renderChildren.d.ts.map +0 -1
  66. package/dist/types/composables/index.d.ts +0 -8
  67. package/dist/types/composables/index.d.ts.map +0 -1
  68. package/dist/types/composables/useI18n.d.ts +0 -9
  69. package/dist/types/composables/useI18n.d.ts.map +0 -1
  70. package/dist/types/composables/useUtilities.d.ts +0 -4
  71. package/dist/types/composables/useUtilities.d.ts.map +0 -1
  72. package/dist/types/index.d.ts +0 -5
  73. package/dist/types/index.d.ts.map +0 -1
  74. package/dist/types/types/index.d.ts +0 -51
  75. package/dist/types/types/index.d.ts.map +0 -1
  76. package/dist/types/utils/addUniqueHeadingSlugs.d.ts +0 -9
  77. package/dist/types/utils/addUniqueHeadingSlugs.d.ts.map +0 -1
  78. package/dist/types/utils/index.d.ts +0 -3
  79. package/dist/types/utils/index.d.ts.map +0 -1
  80. package/dist/types/utils/toSlug.d.ts +0 -2
  81. package/dist/types/utils/toSlug.d.ts.map +0 -1
@@ -1,1654 +0,0 @@
1
- import { createElementBlock as A, openBlock as _, renderSlot as S, defineComponent as T, ref as ge, computed as ne, watch as xe, resolveComponent as ke, createBlock as q, resolveDynamicComponent as U, unref as H, withCtx as j, createElementVNode as we, normalizeClass as pe, Fragment as Fe, createTextVNode as Ae, createCommentVNode as le, toDisplayString as fe, createVNode as ee, mergeProps as te } from "vue";
2
- import { createI18n as $e, i18nTComponent as Se } from "@kong-ui-public/i18n";
3
- var D = /* @__PURE__ */ ((e) => (e.header = "header", e.body = "body", e.footer = "footer", e))(D || {}), K = /* @__PURE__ */ ((e) => (e.left = "left", e.center = "center", e.right = "right", e))(K || {});
4
- function Ee(e) {
5
- return (e == null ? void 0 : e.type) === "table_header";
6
- }
7
- function Te(e) {
8
- return (e == null ? void 0 : e.type) === "text";
9
- }
10
- function Ce(e) {
11
- return (e == null ? void 0 : e.type) === "heading";
12
- }
13
- function Ie(e) {
14
- return (e == null ? void 0 : e.type) === "list";
15
- }
16
- const $ = (e, u) => {
17
- const n = e.__vccOpts || e;
18
- for (const [l, g] of u)
19
- n[l] = g;
20
- return n;
21
- }, Le = {};
22
- function Pe(e, u) {
23
- return _(), A("blockquote", null, [
24
- S(e.$slots, "default", {}, void 0, !0)
25
- ]);
26
- }
27
- const Be = /* @__PURE__ */ $(Le, [["render", Pe], ["__scopeId", "data-v-afdbfde6"]]), Oe = {};
28
- function De(e, u) {
29
- return _(), A("code", null, [
30
- S(e.$slots, "default", {}, void 0, !0)
31
- ]);
32
- }
33
- const qe = /* @__PURE__ */ $(Oe, [["render", De], ["__scopeId", "data-v-cbde41ab"]]);
34
- var ue = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
35
- function Me(e) {
36
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
37
- }
38
- var he = { exports: {} };
39
- (function(e) {
40
- var u = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
41
- /**
42
- * Prism: Lightweight, robust, elegant syntax highlighting
43
- *
44
- * @license MIT <https://opensource.org/licenses/MIT>
45
- * @author Lea Verou <https://lea.verou.me>
46
- * @namespace
47
- * @public
48
- */
49
- var n = function(l) {
50
- var g = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, p = 0, v = {}, r = {
51
- /**
52
- * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
53
- * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
54
- * additional languages or plugins yourself.
55
- *
56
- * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
57
- *
58
- * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
59
- * empty Prism object into the global scope before loading the Prism script like this:
60
- *
61
- * ```js
62
- * window.Prism = window.Prism || {};
63
- * Prism.manual = true;
64
- * // add a new <script> to load Prism's script
65
- * ```
66
- *
67
- * @default false
68
- * @type {boolean}
69
- * @memberof Prism
70
- * @public
71
- */
72
- manual: l.Prism && l.Prism.manual,
73
- /**
74
- * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
75
- * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
76
- * own worker, you don't want it to do this.
77
- *
78
- * By setting this value to `true`, Prism will not add its own listeners to the worker.
79
- *
80
- * You obviously have to change this value before Prism executes. To do this, you can add an
81
- * empty Prism object into the global scope before loading the Prism script like this:
82
- *
83
- * ```js
84
- * window.Prism = window.Prism || {};
85
- * Prism.disableWorkerMessageHandler = true;
86
- * // Load Prism's script
87
- * ```
88
- *
89
- * @default false
90
- * @type {boolean}
91
- * @memberof Prism
92
- * @public
93
- */
94
- disableWorkerMessageHandler: l.Prism && l.Prism.disableWorkerMessageHandler,
95
- /**
96
- * A namespace for utility methods.
97
- *
98
- * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
99
- * change or disappear at any time.
100
- *
101
- * @namespace
102
- * @memberof Prism
103
- */
104
- util: {
105
- encode: function a(t) {
106
- return t instanceof h ? new h(t.type, a(t.content), t.alias) : Array.isArray(t) ? t.map(a) : t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
107
- },
108
- /**
109
- * Returns the name of the type of the given value.
110
- *
111
- * @param {any} o
112
- * @returns {string}
113
- * @example
114
- * type(null) === 'Null'
115
- * type(undefined) === 'Undefined'
116
- * type(123) === 'Number'
117
- * type('foo') === 'String'
118
- * type(true) === 'Boolean'
119
- * type([1, 2]) === 'Array'
120
- * type({}) === 'Object'
121
- * type(String) === 'Function'
122
- * type(/abc+/) === 'RegExp'
123
- */
124
- type: function(a) {
125
- return Object.prototype.toString.call(a).slice(8, -1);
126
- },
127
- /**
128
- * Returns a unique number for the given object. Later calls will still return the same number.
129
- *
130
- * @param {Object} obj
131
- * @returns {number}
132
- */
133
- objId: function(a) {
134
- return a.__id || Object.defineProperty(a, "__id", { value: ++p }), a.__id;
135
- },
136
- /**
137
- * Creates a deep clone of the given object.
138
- *
139
- * The main intended use of this function is to clone language definitions.
140
- *
141
- * @param {T} o
142
- * @param {Record<number, any>} [visited]
143
- * @returns {T}
144
- * @template T
145
- */
146
- clone: function a(t, s) {
147
- s = s || {};
148
- var i, o;
149
- switch (r.util.type(t)) {
150
- case "Object":
151
- if (o = r.util.objId(t), s[o])
152
- return s[o];
153
- i = /** @type {Record<string, any>} */
154
- {}, s[o] = i;
155
- for (var d in t)
156
- t.hasOwnProperty(d) && (i[d] = a(t[d], s));
157
- return (
158
- /** @type {any} */
159
- i
160
- );
161
- case "Array":
162
- return o = r.util.objId(t), s[o] ? s[o] : (i = [], s[o] = i, /** @type {Array} */
163
- /** @type {any} */
164
- t.forEach(function(f, c) {
165
- i[c] = a(f, s);
166
- }), /** @type {any} */
167
- i);
168
- default:
169
- return t;
170
- }
171
- },
172
- /**
173
- * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
174
- *
175
- * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
176
- *
177
- * @param {Element} element
178
- * @returns {string}
179
- */
180
- getLanguage: function(a) {
181
- for (; a; ) {
182
- var t = g.exec(a.className);
183
- if (t)
184
- return t[1].toLowerCase();
185
- a = a.parentElement;
186
- }
187
- return "none";
188
- },
189
- /**
190
- * Sets the Prism `language-xxxx` class of the given element.
191
- *
192
- * @param {Element} element
193
- * @param {string} language
194
- * @returns {void}
195
- */
196
- setLanguage: function(a, t) {
197
- a.className = a.className.replace(RegExp(g, "gi"), ""), a.classList.add("language-" + t);
198
- },
199
- /**
200
- * Returns the script element that is currently executing.
201
- *
202
- * This does __not__ work for line script element.
203
- *
204
- * @returns {HTMLScriptElement | null}
205
- */
206
- currentScript: function() {
207
- if (typeof document > "u")
208
- return null;
209
- if (document.currentScript && document.currentScript.tagName === "SCRIPT")
210
- return (
211
- /** @type {any} */
212
- document.currentScript
213
- );
214
- try {
215
- throw new Error();
216
- } catch (i) {
217
- var a = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(i.stack) || [])[1];
218
- if (a) {
219
- var t = document.getElementsByTagName("script");
220
- for (var s in t)
221
- if (t[s].src == a)
222
- return t[s];
223
- }
224
- return null;
225
- }
226
- },
227
- /**
228
- * Returns whether a given class is active for `element`.
229
- *
230
- * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
231
- * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
232
- * given class is just the given class with a `no-` prefix.
233
- *
234
- * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
235
- * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
236
- * ancestors have the given class or the negated version of it, then the default activation will be returned.
237
- *
238
- * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
239
- * version of it, the class is considered active.
240
- *
241
- * @param {Element} element
242
- * @param {string} className
243
- * @param {boolean} [defaultActivation=false]
244
- * @returns {boolean}
245
- */
246
- isActive: function(a, t, s) {
247
- for (var i = "no-" + t; a; ) {
248
- var o = a.classList;
249
- if (o.contains(t))
250
- return !0;
251
- if (o.contains(i))
252
- return !1;
253
- a = a.parentElement;
254
- }
255
- return !!s;
256
- }
257
- },
258
- /**
259
- * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
260
- *
261
- * @namespace
262
- * @memberof Prism
263
- * @public
264
- */
265
- languages: {
266
- /**
267
- * The grammar for plain, unformatted text.
268
- */
269
- plain: v,
270
- plaintext: v,
271
- text: v,
272
- txt: v,
273
- /**
274
- * Creates a deep copy of the language with the given id and appends the given tokens.
275
- *
276
- * If a token in `redef` also appears in the copied language, then the existing token in the copied language
277
- * will be overwritten at its original position.
278
- *
279
- * ## Best practices
280
- *
281
- * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
282
- * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
283
- * understand the language definition because, normally, the order of tokens matters in Prism grammars.
284
- *
285
- * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
286
- * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
287
- *
288
- * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
289
- * @param {Grammar} redef The new tokens to append.
290
- * @returns {Grammar} The new language created.
291
- * @public
292
- * @example
293
- * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
294
- * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
295
- * // at its original position
296
- * 'comment': { ... },
297
- * // CSS doesn't have a 'color' token, so this token will be appended
298
- * 'color': /\b(?:red|green|blue)\b/
299
- * });
300
- */
301
- extend: function(a, t) {
302
- var s = r.util.clone(r.languages[a]);
303
- for (var i in t)
304
- s[i] = t[i];
305
- return s;
306
- },
307
- /**
308
- * Inserts tokens _before_ another token in a language definition or any other grammar.
309
- *
310
- * ## Usage
311
- *
312
- * This helper method makes it easy to modify existing languages. For example, the CSS language definition
313
- * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
314
- * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
315
- * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
316
- * this:
317
- *
318
- * ```js
319
- * Prism.languages.markup.style = {
320
- * // token
321
- * };
322
- * ```
323
- *
324
- * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
325
- * before existing tokens. For the CSS example above, you would use it like this:
326
- *
327
- * ```js
328
- * Prism.languages.insertBefore('markup', 'cdata', {
329
- * 'style': {
330
- * // token
331
- * }
332
- * });
333
- * ```
334
- *
335
- * ## Special cases
336
- *
337
- * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
338
- * will be ignored.
339
- *
340
- * This behavior can be used to insert tokens after `before`:
341
- *
342
- * ```js
343
- * Prism.languages.insertBefore('markup', 'comment', {
344
- * 'comment': Prism.languages.markup.comment,
345
- * // tokens after 'comment'
346
- * });
347
- * ```
348
- *
349
- * ## Limitations
350
- *
351
- * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
352
- * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
353
- * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
354
- * deleting properties which is necessary to insert at arbitrary positions.
355
- *
356
- * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
357
- * Instead, it will create a new object and replace all references to the target object with the new one. This
358
- * can be done without temporarily deleting properties, so the iteration order is well-defined.
359
- *
360
- * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
361
- * you hold the target object in a variable, then the value of the variable will not change.
362
- *
363
- * ```js
364
- * var oldMarkup = Prism.languages.markup;
365
- * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
366
- *
367
- * assert(oldMarkup !== Prism.languages.markup);
368
- * assert(newMarkup === Prism.languages.markup);
369
- * ```
370
- *
371
- * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
372
- * object to be modified.
373
- * @param {string} before The key to insert before.
374
- * @param {Grammar} insert An object containing the key-value pairs to be inserted.
375
- * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
376
- * object to be modified.
377
- *
378
- * Defaults to `Prism.languages`.
379
- * @returns {Grammar} The new grammar object.
380
- * @public
381
- */
382
- insertBefore: function(a, t, s, i) {
383
- i = i || /** @type {any} */
384
- r.languages;
385
- var o = i[a], d = {};
386
- for (var f in o)
387
- if (o.hasOwnProperty(f)) {
388
- if (f == t)
389
- for (var c in s)
390
- s.hasOwnProperty(c) && (d[c] = s[c]);
391
- s.hasOwnProperty(f) || (d[f] = o[f]);
392
- }
393
- var y = i[a];
394
- return i[a] = d, r.languages.DFS(r.languages, function(w, B) {
395
- B === y && w != a && (this[w] = d);
396
- }), d;
397
- },
398
- // Traverse a language definition with Depth First Search
399
- DFS: function a(t, s, i, o) {
400
- o = o || {};
401
- var d = r.util.objId;
402
- for (var f in t)
403
- if (t.hasOwnProperty(f)) {
404
- s.call(t, f, t[f], i || f);
405
- var c = t[f], y = r.util.type(c);
406
- y === "Object" && !o[d(c)] ? (o[d(c)] = !0, a(c, s, null, o)) : y === "Array" && !o[d(c)] && (o[d(c)] = !0, a(c, s, f, o));
407
- }
408
- }
409
- },
410
- plugins: {},
411
- /**
412
- * This is the most high-level function in Prism’s API.
413
- * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
414
- * each one of them.
415
- *
416
- * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
417
- *
418
- * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
419
- * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
420
- * @memberof Prism
421
- * @public
422
- */
423
- highlightAll: function(a, t) {
424
- r.highlightAllUnder(document, a, t);
425
- },
426
- /**
427
- * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
428
- * {@link Prism.highlightElement} on each one of them.
429
- *
430
- * The following hooks will be run:
431
- * 1. `before-highlightall`
432
- * 2. `before-all-elements-highlight`
433
- * 3. All hooks of {@link Prism.highlightElement} for each element.
434
- *
435
- * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
436
- * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
437
- * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
438
- * @memberof Prism
439
- * @public
440
- */
441
- highlightAllUnder: function(a, t, s) {
442
- var i = {
443
- callback: s,
444
- container: a,
445
- selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
446
- };
447
- r.hooks.run("before-highlightall", i), i.elements = Array.prototype.slice.apply(i.container.querySelectorAll(i.selector)), r.hooks.run("before-all-elements-highlight", i);
448
- for (var o = 0, d; d = i.elements[o++]; )
449
- r.highlightElement(d, t === !0, i.callback);
450
- },
451
- /**
452
- * Highlights the code inside a single element.
453
- *
454
- * The following hooks will be run:
455
- * 1. `before-sanity-check`
456
- * 2. `before-highlight`
457
- * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
458
- * 4. `before-insert`
459
- * 5. `after-highlight`
460
- * 6. `complete`
461
- *
462
- * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
463
- * the element's language.
464
- *
465
- * @param {Element} element The element containing the code.
466
- * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
467
- * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
468
- * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
469
- * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
470
- *
471
- * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
472
- * asynchronous highlighting to work. You can build your own bundle on the
473
- * [Download page](https://prismjs.com/download.html).
474
- * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
475
- * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
476
- * @memberof Prism
477
- * @public
478
- */
479
- highlightElement: function(a, t, s) {
480
- var i = r.util.getLanguage(a), o = r.languages[i];
481
- r.util.setLanguage(a, i);
482
- var d = a.parentElement;
483
- d && d.nodeName.toLowerCase() === "pre" && r.util.setLanguage(d, i);
484
- var f = a.textContent, c = {
485
- element: a,
486
- language: i,
487
- grammar: o,
488
- code: f
489
- };
490
- function y(B) {
491
- c.highlightedCode = B, r.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, r.hooks.run("after-highlight", c), r.hooks.run("complete", c), s && s.call(c.element);
492
- }
493
- if (r.hooks.run("before-sanity-check", c), d = c.element.parentElement, d && d.nodeName.toLowerCase() === "pre" && !d.hasAttribute("tabindex") && d.setAttribute("tabindex", "0"), !c.code) {
494
- r.hooks.run("complete", c), s && s.call(c.element);
495
- return;
496
- }
497
- if (r.hooks.run("before-highlight", c), !c.grammar) {
498
- y(r.util.encode(c.code));
499
- return;
500
- }
501
- if (t && l.Worker) {
502
- var w = new Worker(r.filename);
503
- w.onmessage = function(B) {
504
- y(B.data);
505
- }, w.postMessage(JSON.stringify({
506
- language: c.language,
507
- code: c.code,
508
- immediateClose: !0
509
- }));
510
- } else
511
- y(r.highlight(c.code, c.grammar, c.language));
512
- },
513
- /**
514
- * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
515
- * and the language definitions to use, and returns a string with the HTML produced.
516
- *
517
- * The following hooks will be run:
518
- * 1. `before-tokenize`
519
- * 2. `after-tokenize`
520
- * 3. `wrap`: On each {@link Token}.
521
- *
522
- * @param {string} text A string with the code to be highlighted.
523
- * @param {Grammar} grammar An object containing the tokens to use.
524
- *
525
- * Usually a language definition like `Prism.languages.markup`.
526
- * @param {string} language The name of the language definition passed to `grammar`.
527
- * @returns {string} The highlighted HTML.
528
- * @memberof Prism
529
- * @public
530
- * @example
531
- * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
532
- */
533
- highlight: function(a, t, s) {
534
- var i = {
535
- code: a,
536
- grammar: t,
537
- language: s
538
- };
539
- if (r.hooks.run("before-tokenize", i), !i.grammar)
540
- throw new Error('The language "' + i.language + '" has no grammar.');
541
- return i.tokens = r.tokenize(i.code, i.grammar), r.hooks.run("after-tokenize", i), h.stringify(r.util.encode(i.tokens), i.language);
542
- },
543
- /**
544
- * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
545
- * and the language definitions to use, and returns an array with the tokenized code.
546
- *
547
- * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
548
- *
549
- * This method could be useful in other contexts as well, as a very crude parser.
550
- *
551
- * @param {string} text A string with the code to be highlighted.
552
- * @param {Grammar} grammar An object containing the tokens to use.
553
- *
554
- * Usually a language definition like `Prism.languages.markup`.
555
- * @returns {TokenStream} An array of strings and tokens, a token stream.
556
- * @memberof Prism
557
- * @public
558
- * @example
559
- * let code = `var foo = 0;`;
560
- * let tokens = Prism.tokenize(code, Prism.languages.javascript);
561
- * tokens.forEach(token => {
562
- * if (token instanceof Prism.Token && token.type === 'number') {
563
- * console.log(`Found numeric literal: ${token.content}`);
564
- * }
565
- * });
566
- */
567
- tokenize: function(a, t) {
568
- var s = t.rest;
569
- if (s) {
570
- for (var i in s)
571
- t[i] = s[i];
572
- delete t.rest;
573
- }
574
- var o = new L();
575
- return P(o, o.head, a), I(a, o, t, o.head, 0), R(o);
576
- },
577
- /**
578
- * @namespace
579
- * @memberof Prism
580
- * @public
581
- */
582
- hooks: {
583
- all: {},
584
- /**
585
- * Adds the given callback to the list of callbacks for the given hook.
586
- *
587
- * The callback will be invoked when the hook it is registered for is run.
588
- * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
589
- *
590
- * One callback function can be registered to multiple hooks and the same hook multiple times.
591
- *
592
- * @param {string} name The name of the hook.
593
- * @param {HookCallback} callback The callback function which is given environment variables.
594
- * @public
595
- */
596
- add: function(a, t) {
597
- var s = r.hooks.all;
598
- s[a] = s[a] || [], s[a].push(t);
599
- },
600
- /**
601
- * Runs a hook invoking all registered callbacks with the given environment variables.
602
- *
603
- * Callbacks will be invoked synchronously and in the order in which they were registered.
604
- *
605
- * @param {string} name The name of the hook.
606
- * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
607
- * @public
608
- */
609
- run: function(a, t) {
610
- var s = r.hooks.all[a];
611
- if (!(!s || !s.length))
612
- for (var i = 0, o; o = s[i++]; )
613
- o(t);
614
- }
615
- },
616
- Token: h
617
- };
618
- l.Prism = r;
619
- function h(a, t, s, i) {
620
- this.type = a, this.content = t, this.alias = s, this.length = (i || "").length | 0;
621
- }
622
- h.stringify = function a(t, s) {
623
- if (typeof t == "string")
624
- return t;
625
- if (Array.isArray(t)) {
626
- var i = "";
627
- return t.forEach(function(y) {
628
- i += a(y, s);
629
- }), i;
630
- }
631
- var o = {
632
- type: t.type,
633
- content: a(t.content, s),
634
- tag: "span",
635
- classes: ["token", t.type],
636
- attributes: {},
637
- language: s
638
- }, d = t.alias;
639
- d && (Array.isArray(d) ? Array.prototype.push.apply(o.classes, d) : o.classes.push(d)), r.hooks.run("wrap", o);
640
- var f = "";
641
- for (var c in o.attributes)
642
- f += " " + c + '="' + (o.attributes[c] || "").replace(/"/g, "&quot;") + '"';
643
- return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + f + ">" + o.content + "</" + o.tag + ">";
644
- };
645
- function k(a, t, s, i) {
646
- a.lastIndex = t;
647
- var o = a.exec(s);
648
- if (o && i && o[1]) {
649
- var d = o[1].length;
650
- o.index += d, o[0] = o[0].slice(d);
651
- }
652
- return o;
653
- }
654
- function I(a, t, s, i, o, d) {
655
- for (var f in s)
656
- if (!(!s.hasOwnProperty(f) || !s[f])) {
657
- var c = s[f];
658
- c = Array.isArray(c) ? c : [c];
659
- for (var y = 0; y < c.length; ++y) {
660
- if (d && d.cause == f + "," + y)
661
- return;
662
- var w = c[y], B = w.inside, re = !!w.lookbehind, se = !!w.greedy, ve = w.alias;
663
- if (se && !w.pattern.global) {
664
- var _e = w.pattern.toString().match(/[imsuy]*$/)[0];
665
- w.pattern = RegExp(w.pattern.source, _e + "g");
666
- }
667
- for (var ie = w.pattern || w, F = i.next, C = o; F !== t.tail && !(d && C >= d.reach); C += F.value.length, F = F.next) {
668
- var z = F.value;
669
- if (t.length > a.length)
670
- return;
671
- if (!(z instanceof h)) {
672
- var G = 1, E;
673
- if (se) {
674
- if (E = k(ie, C, a, re), !E || E.index >= a.length)
675
- break;
676
- var V = E.index, ye = E.index + E[0].length, O = C;
677
- for (O += F.value.length; V >= O; )
678
- F = F.next, O += F.value.length;
679
- if (O -= F.value.length, C = O, F.value instanceof h)
680
- continue;
681
- for (var N = F; N !== t.tail && (O < ye || typeof N.value == "string"); N = N.next)
682
- G++, O += N.value.length;
683
- G--, z = a.slice(C, O), E.index -= C;
684
- } else if (E = k(ie, 0, z, re), !E)
685
- continue;
686
- var V = E.index, Z = E[0], X = z.slice(0, V), oe = z.slice(V + Z.length), Y = C + z.length;
687
- d && Y > d.reach && (d.reach = Y);
688
- var W = F.prev;
689
- X && (W = P(t, W, X), C += X.length), M(t, W, G);
690
- var be = new h(f, B ? r.tokenize(Z, B) : Z, ve, Z);
691
- if (F = P(t, W, be), oe && P(t, F, oe), G > 1) {
692
- var Q = {
693
- cause: f + "," + y,
694
- reach: Y
695
- };
696
- I(a, t, s, F.prev, C, Q), d && Q.reach > d.reach && (d.reach = Q.reach);
697
- }
698
- }
699
- }
700
- }
701
- }
702
- }
703
- function L() {
704
- var a = { value: null, prev: null, next: null }, t = { value: null, prev: a, next: null };
705
- a.next = t, this.head = a, this.tail = t, this.length = 0;
706
- }
707
- function P(a, t, s) {
708
- var i = t.next, o = { value: s, prev: t, next: i };
709
- return t.next = o, i.prev = o, a.length++, o;
710
- }
711
- function M(a, t, s) {
712
- for (var i = t.next, o = 0; o < s && i !== a.tail; o++)
713
- i = i.next;
714
- t.next = i, i.prev = t, a.length -= o;
715
- }
716
- function R(a) {
717
- for (var t = [], s = a.head.next; s !== a.tail; )
718
- t.push(s.value), s = s.next;
719
- return t;
720
- }
721
- if (!l.document)
722
- return l.addEventListener && (r.disableWorkerMessageHandler || l.addEventListener("message", function(a) {
723
- var t = JSON.parse(a.data), s = t.language, i = t.code, o = t.immediateClose;
724
- l.postMessage(r.highlight(i, r.languages[s], s)), o && l.close();
725
- }, !1)), r;
726
- var b = r.util.currentScript();
727
- b && (r.filename = b.src, b.hasAttribute("data-manual") && (r.manual = !0));
728
- function m() {
729
- r.manual || r.highlightAll();
730
- }
731
- if (!r.manual) {
732
- var x = document.readyState;
733
- x === "loading" || x === "interactive" && b && b.defer ? document.addEventListener("DOMContentLoaded", m) : window.requestAnimationFrame ? window.requestAnimationFrame(m) : window.setTimeout(m, 16);
734
- }
735
- return r;
736
- }(u);
737
- e.exports && (e.exports = n), typeof ue < "u" && (ue.Prism = n), n.languages.markup = {
738
- comment: {
739
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
740
- greedy: !0
741
- },
742
- prolog: {
743
- pattern: /<\?[\s\S]+?\?>/,
744
- greedy: !0
745
- },
746
- doctype: {
747
- // https://www.w3.org/TR/xml/#NT-doctypedecl
748
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
749
- greedy: !0,
750
- inside: {
751
- "internal-subset": {
752
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
753
- lookbehind: !0,
754
- greedy: !0,
755
- inside: null
756
- // see below
757
- },
758
- string: {
759
- pattern: /"[^"]*"|'[^']*'/,
760
- greedy: !0
761
- },
762
- punctuation: /^<!|>$|[[\]]/,
763
- "doctype-tag": /^DOCTYPE/i,
764
- name: /[^\s<>'"]+/
765
- }
766
- },
767
- cdata: {
768
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
769
- greedy: !0
770
- },
771
- tag: {
772
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
773
- greedy: !0,
774
- inside: {
775
- tag: {
776
- pattern: /^<\/?[^\s>\/]+/,
777
- inside: {
778
- punctuation: /^<\/?/,
779
- namespace: /^[^\s>\/:]+:/
780
- }
781
- },
782
- "special-attr": [],
783
- "attr-value": {
784
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
785
- inside: {
786
- punctuation: [
787
- {
788
- pattern: /^=/,
789
- alias: "attr-equals"
790
- },
791
- {
792
- pattern: /^(\s*)["']|["']$/,
793
- lookbehind: !0
794
- }
795
- ]
796
- }
797
- },
798
- punctuation: /\/?>/,
799
- "attr-name": {
800
- pattern: /[^\s>\/]+/,
801
- inside: {
802
- namespace: /^[^\s>\/:]+:/
803
- }
804
- }
805
- }
806
- },
807
- entity: [
808
- {
809
- pattern: /&[\da-z]{1,8};/i,
810
- alias: "named-entity"
811
- },
812
- /&#x?[\da-f]{1,8};/i
813
- ]
814
- }, 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) {
815
- l.type === "entity" && (l.attributes.title = l.content.replace(/&amp;/, "&"));
816
- }), Object.defineProperty(n.languages.markup.tag, "addInlined", {
817
- /**
818
- * Adds an inlined language to markup.
819
- *
820
- * An example of an inlined language is CSS with `<style>` tags.
821
- *
822
- * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
823
- * case insensitive.
824
- * @param {string} lang The language key.
825
- * @example
826
- * addInlined('style', 'css');
827
- */
828
- value: function(g, p) {
829
- var v = {};
830
- v["language-" + p] = {
831
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
832
- lookbehind: !0,
833
- inside: n.languages[p]
834
- }, v.cdata = /^<!\[CDATA\[|\]\]>$/i;
835
- var r = {
836
- "included-cdata": {
837
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
838
- inside: v
839
- }
840
- };
841
- r["language-" + p] = {
842
- pattern: /[\s\S]+/,
843
- inside: n.languages[p]
844
- };
845
- var h = {};
846
- h[g] = {
847
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
848
- return g;
849
- }), "i"),
850
- lookbehind: !0,
851
- greedy: !0,
852
- inside: r
853
- }, n.languages.insertBefore("markup", "cdata", h);
854
- }
855
- }), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
856
- /**
857
- * Adds an pattern to highlight languages embedded in HTML attributes.
858
- *
859
- * An example of an inlined language is CSS with `style` attributes.
860
- *
861
- * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
862
- * case insensitive.
863
- * @param {string} lang The language key.
864
- * @example
865
- * addAttribute('style', 'css');
866
- */
867
- value: function(l, g) {
868
- n.languages.markup.tag.inside["special-attr"].push({
869
- pattern: RegExp(
870
- /(^|["'\s])/.source + "(?:" + l + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
871
- "i"
872
- ),
873
- lookbehind: !0,
874
- inside: {
875
- "attr-name": /^[^\s=]+/,
876
- "attr-value": {
877
- pattern: /=[\s\S]+/,
878
- inside: {
879
- value: {
880
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
881
- lookbehind: !0,
882
- alias: [g, "language-" + g],
883
- inside: n.languages[g]
884
- },
885
- punctuation: [
886
- {
887
- pattern: /^=/,
888
- alias: "attr-equals"
889
- },
890
- /"|'/
891
- ]
892
- }
893
- }
894
- }
895
- });
896
- }
897
- }), 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) {
898
- var g = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
899
- l.languages.css = {
900
- comment: /\/\*[\s\S]*?\*\//,
901
- atrule: {
902
- pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + g.source + ")*?" + /(?:;|(?=\s*\{))/.source),
903
- inside: {
904
- rule: /^@[\w-]+/,
905
- "selector-function-argument": {
906
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
907
- lookbehind: !0,
908
- alias: "selector"
909
- },
910
- keyword: {
911
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
912
- lookbehind: !0
913
- }
914
- // See rest below
915
- }
916
- },
917
- url: {
918
- // https://drafts.csswg.org/css-values-3/#urls
919
- pattern: RegExp("\\burl\\((?:" + g.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
920
- greedy: !0,
921
- inside: {
922
- function: /^url/i,
923
- punctuation: /^\(|\)$/,
924
- string: {
925
- pattern: RegExp("^" + g.source + "$"),
926
- alias: "url"
927
- }
928
- }
929
- },
930
- selector: {
931
- pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + g.source + ")*(?=\\s*\\{)"),
932
- lookbehind: !0
933
- },
934
- string: {
935
- pattern: g,
936
- greedy: !0
937
- },
938
- property: {
939
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
940
- lookbehind: !0
941
- },
942
- important: /!important\b/i,
943
- function: {
944
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
945
- lookbehind: !0
946
- },
947
- punctuation: /[(){};:,]/
948
- }, l.languages.css.atrule.inside.rest = l.languages.css;
949
- var p = l.languages.markup;
950
- p && (p.tag.addInlined("style", "css"), p.tag.addAttribute("style", "css"));
951
- }(n), n.languages.clike = {
952
- comment: [
953
- {
954
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
955
- lookbehind: !0,
956
- greedy: !0
957
- },
958
- {
959
- pattern: /(^|[^\\:])\/\/.*/,
960
- lookbehind: !0,
961
- greedy: !0
962
- }
963
- ],
964
- string: {
965
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
966
- greedy: !0
967
- },
968
- "class-name": {
969
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
970
- lookbehind: !0,
971
- inside: {
972
- punctuation: /[.\\]/
973
- }
974
- },
975
- keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
976
- boolean: /\b(?:false|true)\b/,
977
- function: /\b\w+(?=\()/,
978
- number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
979
- operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
980
- punctuation: /[{}[\];(),.:]/
981
- }, n.languages.javascript = n.languages.extend("clike", {
982
- "class-name": [
983
- n.languages.clike["class-name"],
984
- {
985
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
986
- lookbehind: !0
987
- }
988
- ],
989
- keyword: [
990
- {
991
- pattern: /((?:^|\})\s*)catch\b/,
992
- lookbehind: !0
993
- },
994
- {
995
- 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/,
996
- lookbehind: !0
997
- }
998
- ],
999
- // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1000
- function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1001
- number: {
1002
- pattern: RegExp(
1003
- /(^|[^\w$])/.source + "(?:" + // constant
1004
- (/NaN|Infinity/.source + "|" + // binary integer
1005
- /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
1006
- /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
1007
- /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
1008
- /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
1009
- /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
1010
- ),
1011
- lookbehind: !0
1012
- },
1013
- operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1014
- }), n.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, n.languages.insertBefore("javascript", "keyword", {
1015
- regex: {
1016
- pattern: RegExp(
1017
- // lookbehind
1018
- // eslint-disable-next-line regexp/no-dupe-characters-character-class
1019
- /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
1020
- // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
1021
- // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
1022
- // with the only syntax, so we have to define 2 different regex patterns.
1023
- /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
1024
- /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
1025
- /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
1026
- ),
1027
- lookbehind: !0,
1028
- greedy: !0,
1029
- inside: {
1030
- "regex-source": {
1031
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1032
- lookbehind: !0,
1033
- alias: "language-regex",
1034
- inside: n.languages.regex
1035
- },
1036
- "regex-delimiter": /^\/|\/$/,
1037
- "regex-flags": /^[a-z]+$/
1038
- }
1039
- },
1040
- // This must be declared before keyword because we use "function" inside the look-forward
1041
- "function-variable": {
1042
- 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*=>))/,
1043
- alias: "function"
1044
- },
1045
- parameter: [
1046
- {
1047
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1048
- lookbehind: !0,
1049
- inside: n.languages.javascript
1050
- },
1051
- {
1052
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1053
- lookbehind: !0,
1054
- inside: n.languages.javascript
1055
- },
1056
- {
1057
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1058
- lookbehind: !0,
1059
- inside: n.languages.javascript
1060
- },
1061
- {
1062
- 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*\{)/,
1063
- lookbehind: !0,
1064
- inside: n.languages.javascript
1065
- }
1066
- ],
1067
- constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1068
- }), n.languages.insertBefore("javascript", "string", {
1069
- hashbang: {
1070
- pattern: /^#!.*/,
1071
- greedy: !0,
1072
- alias: "comment"
1073
- },
1074
- "template-string": {
1075
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1076
- greedy: !0,
1077
- inside: {
1078
- "template-punctuation": {
1079
- pattern: /^`|`$/,
1080
- alias: "string"
1081
- },
1082
- interpolation: {
1083
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1084
- lookbehind: !0,
1085
- inside: {
1086
- "interpolation-punctuation": {
1087
- pattern: /^\$\{|\}$/,
1088
- alias: "punctuation"
1089
- },
1090
- rest: n.languages.javascript
1091
- }
1092
- },
1093
- string: /[\s\S]+/
1094
- }
1095
- },
1096
- "string-property": {
1097
- pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
1098
- lookbehind: !0,
1099
- greedy: !0,
1100
- alias: "property"
1101
- }
1102
- }), n.languages.insertBefore("javascript", "operator", {
1103
- "literal-property": {
1104
- pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
1105
- lookbehind: !0,
1106
- alias: "property"
1107
- }
1108
- }), n.languages.markup && (n.languages.markup.tag.addInlined("script", "javascript"), n.languages.markup.tag.addAttribute(
1109
- /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,
1110
- "javascript"
1111
- )), n.languages.js = n.languages.javascript, function() {
1112
- if (typeof n > "u" || typeof document > "u")
1113
- return;
1114
- Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
1115
- var l = "Loading…", g = function(b, m) {
1116
- return "✖ Error " + b + " while fetching file: " + m;
1117
- }, p = "✖ Error: File does not exist or is empty", v = {
1118
- js: "javascript",
1119
- py: "python",
1120
- rb: "ruby",
1121
- ps1: "powershell",
1122
- psm1: "powershell",
1123
- sh: "bash",
1124
- bat: "batch",
1125
- h: "c",
1126
- tex: "latex"
1127
- }, r = "data-src-status", h = "loading", k = "loaded", I = "failed", L = "pre[data-src]:not([" + r + '="' + k + '"]):not([' + r + '="' + h + '"])';
1128
- function P(b, m, x) {
1129
- var a = new XMLHttpRequest();
1130
- a.open("GET", b, !0), a.onreadystatechange = function() {
1131
- a.readyState == 4 && (a.status < 400 && a.responseText ? m(a.responseText) : a.status >= 400 ? x(g(a.status, a.statusText)) : x(p));
1132
- }, a.send(null);
1133
- }
1134
- function M(b) {
1135
- var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(b || "");
1136
- if (m) {
1137
- var x = Number(m[1]), a = m[2], t = m[3];
1138
- return a ? t ? [x, Number(t)] : [x, void 0] : [x, x];
1139
- }
1140
- }
1141
- n.hooks.add("before-highlightall", function(b) {
1142
- b.selector += ", " + L;
1143
- }), n.hooks.add("before-sanity-check", function(b) {
1144
- var m = (
1145
- /** @type {HTMLPreElement} */
1146
- b.element
1147
- );
1148
- if (m.matches(L)) {
1149
- b.code = "", m.setAttribute(r, h);
1150
- var x = m.appendChild(document.createElement("CODE"));
1151
- x.textContent = l;
1152
- var a = m.getAttribute("data-src"), t = b.language;
1153
- if (t === "none") {
1154
- var s = (/\.(\w+)$/.exec(a) || [, "none"])[1];
1155
- t = v[s] || s;
1156
- }
1157
- n.util.setLanguage(x, t), n.util.setLanguage(m, t);
1158
- var i = n.plugins.autoloader;
1159
- i && i.loadLanguages(t), P(
1160
- a,
1161
- function(o) {
1162
- m.setAttribute(r, k);
1163
- var d = M(m.getAttribute("data-range"));
1164
- if (d) {
1165
- var f = o.split(/\r\n?|\n/g), c = d[0], y = d[1] == null ? f.length : d[1];
1166
- c < 0 && (c += f.length), c = Math.max(0, Math.min(c - 1, f.length)), y < 0 && (y += f.length), y = Math.max(0, Math.min(y, f.length)), o = f.slice(c, y).join(`
1167
- `), m.hasAttribute("data-start") || m.setAttribute("data-start", String(c + 1));
1168
- }
1169
- x.textContent = o, n.highlightElement(x);
1170
- },
1171
- function(o) {
1172
- m.setAttribute(r, I), x.textContent = o;
1173
- }
1174
- );
1175
- }
1176
- }), n.plugins.fileHighlight = {
1177
- /**
1178
- * Executes the File Highlight plugin for all matching `pre` elements under the given container.
1179
- *
1180
- * Note: Elements which are already loaded or currently loading will not be touched by this method.
1181
- *
1182
- * @param {ParentNode} [container=document]
1183
- */
1184
- highlight: function(m) {
1185
- for (var x = (m || document).querySelectorAll(L), a = 0, t; t = x[a++]; )
1186
- n.highlightElement(t);
1187
- }
1188
- };
1189
- var R = !1;
1190
- n.fileHighlight = function() {
1191
- R || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), R = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
1192
- };
1193
- }();
1194
- })(he);
1195
- var Re = he.exports;
1196
- const J = /* @__PURE__ */ Me(Re), ze = /* @__PURE__ */ T({
1197
- __name: "CodeBlock",
1198
- props: {
1199
- codeBlockIndex: {
1200
- type: Number,
1201
- default: 1
1202
- },
1203
- lines: {
1204
- type: Array,
1205
- required: !0
1206
- },
1207
- lang: {
1208
- type: String,
1209
- default: "plaintext"
1210
- },
1211
- isSingleLine: {
1212
- type: Boolean,
1213
- default: !1
1214
- }
1215
- },
1216
- setup(e) {
1217
- J.manual = !0;
1218
- const u = e, n = ge(!1);
1219
- function l(r) {
1220
- n.value = !0, J.languages[r.language] || console.warn(`Prism: the language “${r.language}” isn’t enabled.`), r.preElement.classList.contains(`language-${r.language}`) || r.preElement.classList.add(`language-${r.language}`), r.codeElement.innerHTML = g(r.code), J.highlightElement(r.codeElement), n.value = !1;
1221
- }
1222
- const g = (r) => r.replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#039;"), p = ne(() => `document-code-block-${u.codeBlockIndex}`), v = ne(() => {
1223
- var h, k;
1224
- const r = ((k = (h = u.lines) == null ? void 0 : h.flatMap((I) => I.text)) == null ? void 0 : k.join("")) || "";
1225
- return r.endsWith(`
1226
- `) && !u.isSingleLine ? r.slice(0, -1) : r;
1227
- });
1228
- return xe(() => u.lang, async () => {
1229
- try {
1230
- await Promise.all([
1231
- import("./prism-bash.min-HHIMdNJ_.js"),
1232
- import("./prism-css.min-BgYu_Rzi.js"),
1233
- import("./prism-docker.min-RkX3juQh.js"),
1234
- import("./prism-go.min-C7UmK6TW.js"),
1235
- import("./prism-http.min-CP9t4YhN.js"),
1236
- import("./prism-javascript.min-CEqHqgbm.js"),
1237
- import("./prism-jq.min-KI3qrR2-.js"),
1238
- import("./prism-json.min-B1GJqK1k.js"),
1239
- import("./prism-log.min-SDopTpKN.js"),
1240
- import("./prism-lua.min-DwRnUVfS.js"),
1241
- import("./prism-makefile.min-DyutknhE.js"),
1242
- import("./prism-markdown.min-C0Qn0m-5.js"),
1243
- import("./prism-python.min-BIfpAh5K.js"),
1244
- import("./prism-regex.min-BqTi0NTp.js"),
1245
- import("./prism-rust.min-xSp7-1qY.js"),
1246
- import("./prism-rest.min-B6veHRJF.js"),
1247
- import("./prism-scss.min-B0csyGJo.js"),
1248
- import("./prism-sql.min-BHXzX-c_.js"),
1249
- import("./prism-typescript.min-oSVeWCAd.js"),
1250
- import("./prism-yaml.min-ADtdOEMG.js"),
1251
- import("./prism-xml-doc.min-BGai1RKL.js")
1252
- ]);
1253
- } catch {
1254
- console.warn("Could not import PrismJS language file.");
1255
- }
1256
- J.highlightAll();
1257
- }, { immediate: !0 }), (r, h) => {
1258
- const k = ke("KCodeBlock");
1259
- return _(), q(k, {
1260
- id: p.value,
1261
- class: "document-code-block",
1262
- code: v.value,
1263
- language: e.lang,
1264
- processing: n.value,
1265
- "single-line": e.isSingleLine,
1266
- theme: "light",
1267
- onCodeBlockRender: l
1268
- }, null, 8, ["id", "code", "language", "processing", "single-line"]);
1269
- };
1270
- }
1271
- }), He = /* @__PURE__ */ $(ze, [["__scopeId", "data-v-1897ab78"]]), Ne = /* @__PURE__ */ T({
1272
- __name: "Emphasis",
1273
- props: {
1274
- level: {
1275
- type: Number,
1276
- default: 1,
1277
- validator(e) {
1278
- if (!Number.isInteger(e))
1279
- return !1;
1280
- const u = e;
1281
- return u > 0 && u < 3;
1282
- }
1283
- }
1284
- },
1285
- setup(e) {
1286
- const n = e.level === 1 ? "em" : "strong";
1287
- return (l, g) => (_(), q(U(H(n)), null, {
1288
- default: j(() => [
1289
- S(l.$slots, "default")
1290
- ]),
1291
- _: 3
1292
- }));
1293
- }
1294
- }), Ue = /* @__PURE__ */ T({
1295
- __name: "Heading",
1296
- props: {
1297
- level: {
1298
- type: Number,
1299
- validator(e) {
1300
- if (!Number.isInteger(e))
1301
- return !1;
1302
- const u = e;
1303
- return u > 0 && u < 7;
1304
- },
1305
- default: 1
1306
- },
1307
- slug: {
1308
- type: String,
1309
- default: ""
1310
- }
1311
- },
1312
- setup(e) {
1313
- const u = e, n = `${u.slug}`, l = `h${u.level}`;
1314
- return (g, p) => (_(), q(U(l), { id: n }, {
1315
- default: j(() => [
1316
- S(g.$slots, "default", {}, void 0, !0)
1317
- ]),
1318
- _: 3
1319
- }));
1320
- }
1321
- }), je = /* @__PURE__ */ $(Ue, [["__scopeId", "data-v-9ef4ad64"]]), Ge = ["alt", "src", "title"], Ve = /* @__PURE__ */ T({
1322
- __name: "Image",
1323
- props: {
1324
- url: {
1325
- type: String,
1326
- required: !0
1327
- },
1328
- alt: {
1329
- type: String,
1330
- default: ""
1331
- },
1332
- title: {
1333
- type: String,
1334
- default: ""
1335
- }
1336
- },
1337
- setup(e) {
1338
- return (u, n) => (_(), A("img", {
1339
- alt: e.alt,
1340
- src: e.url,
1341
- title: e.title
1342
- }, null, 8, Ge));
1343
- }
1344
- }), Ze = /* @__PURE__ */ $(Ve, [["__scopeId", "data-v-13314abe"]]), We = {};
1345
- function Je(e, u) {
1346
- return _(), A("hr");
1347
- }
1348
- const Ke = /* @__PURE__ */ $(We, [["render", Je], ["__scopeId", "data-v-b6e25b56"]]), Xe = {};
1349
- function Ye(e, u) {
1350
- return _(), A("s", null, [
1351
- S(e.$slots, "default")
1352
- ]);
1353
- }
1354
- const Qe = /* @__PURE__ */ $(Xe, [["render", Ye]]), et = {};
1355
- function tt(e, u) {
1356
- return _(), A("table", null, [
1357
- S(e.$slots, "default", {}, void 0, !0)
1358
- ]);
1359
- }
1360
- const nt = /* @__PURE__ */ $(et, [["render", tt], ["__scopeId", "data-v-c2502730"]]), at = /* @__PURE__ */ T({
1361
- __name: "TableRow",
1362
- props: {
1363
- section: {
1364
- type: String,
1365
- default: D.body
1366
- }
1367
- },
1368
- setup(e) {
1369
- const u = e;
1370
- let n;
1371
- return u.section === D.header ? n = "thead" : u.section === D.body ? n = "tbody" : u.section === D.footer && (n = "tfoot"), (l, g) => (_(), q(U(H(n)), null, {
1372
- default: j(() => [
1373
- we("tr", null, [
1374
- S(l.$slots, "default", {}, void 0, !0)
1375
- ])
1376
- ]),
1377
- _: 3
1378
- }));
1379
- }
1380
- }), ce = /* @__PURE__ */ $(at, [["__scopeId", "data-v-90ab3ded"]]), rt = /* @__PURE__ */ T({
1381
- __name: "TableCell",
1382
- props: {
1383
- alignment: {
1384
- type: String,
1385
- default: K.left
1386
- },
1387
- parent: {
1388
- type: Object,
1389
- required: !0
1390
- }
1391
- },
1392
- setup(e) {
1393
- var g;
1394
- const u = e, n = ((g = u.parent) == null ? void 0 : g.section) === D.header ? "th" : "td";
1395
- let l;
1396
- return u.alignment === K.center ? l = "align-center" : u.alignment === K.right && (l = "align-right"), (p, v) => (_(), q(U(H(n)), {
1397
- class: pe(H(l))
1398
- }, {
1399
- default: j(() => [
1400
- S(p.$slots, "default", {}, void 0, !0)
1401
- ]),
1402
- _: 3
1403
- }, 8, ["class"]));
1404
- }
1405
- }), st = /* @__PURE__ */ $(rt, [["__scopeId", "data-v-6fde1a24"]]), it = ["checked"], ot = /* @__PURE__ */ T({
1406
- __name: "TaskCheckbox",
1407
- props: {
1408
- checked: { type: Boolean }
1409
- },
1410
- setup(e) {
1411
- const n = ge(e.checked);
1412
- return (l, g) => (_(), A("input", {
1413
- "aria-label": "Display-only checkbox for task",
1414
- checked: n.value,
1415
- type: "checkbox"
1416
- }, null, 8, it));
1417
- }
1418
- }), lt = { key: 0 }, ut = { key: 1 }, ct = {
1419
- inheritAttrs: !1
1420
- }, dt = /* @__PURE__ */ T({
1421
- ...ct,
1422
- __name: "Text",
1423
- props: {
1424
- text: {
1425
- type: String,
1426
- required: !0
1427
- },
1428
- appendSpace: {
1429
- type: Boolean,
1430
- default: !1
1431
- },
1432
- hardBreak: {
1433
- type: Boolean,
1434
- default: !1
1435
- }
1436
- },
1437
- setup(e) {
1438
- return (u, n) => (_(), A(Fe, null, [
1439
- Ae(fe(e.text), 1),
1440
- e.appendSpace ? (_(), A("span", lt, " ")) : le("", !0),
1441
- e.hardBreak ? (_(), A("br", ut)) : le("", !0)
1442
- ], 64));
1443
- }
1444
- }), gt = {};
1445
- function pt(e, u) {
1446
- return _(), A("span", null, [
1447
- S(e.$slots, "default")
1448
- ]);
1449
- }
1450
- const ft = /* @__PURE__ */ $(gt, [["render", pt]]), ht = {};
1451
- function mt(e, u) {
1452
- return _(), A("p", null, [
1453
- S(e.$slots, "default", {}, void 0, !0)
1454
- ]);
1455
- }
1456
- const vt = /* @__PURE__ */ $(ht, [["render", mt], ["__scopeId", "data-v-7b54f530"]]), _t = /* @__PURE__ */ T({
1457
- __name: "List",
1458
- props: {
1459
- isOrdered: {
1460
- type: Boolean,
1461
- default: !1
1462
- },
1463
- hasTaskItems: {
1464
- type: Boolean,
1465
- default: !1
1466
- }
1467
- },
1468
- setup(e) {
1469
- const n = e.isOrdered ? "ol" : "ul";
1470
- return (l, g) => (_(), q(U(H(n)), {
1471
- class: pe({ "has-task-items": e.hasTaskItems })
1472
- }, {
1473
- default: j(() => [
1474
- S(l.$slots, "default", {}, void 0, !0)
1475
- ]),
1476
- _: 3
1477
- }, 8, ["class"]));
1478
- }
1479
- }), yt = /* @__PURE__ */ $(_t, [["__scopeId", "data-v-31520231"]]), bt = {};
1480
- function xt(e, u) {
1481
- return _(), A("li", null, [
1482
- S(e.$slots, "default", {}, void 0, !0)
1483
- ]);
1484
- }
1485
- const kt = /* @__PURE__ */ $(bt, [["render", xt], ["__scopeId", "data-v-cf238e78"]]), wt = ["href", "title"], Ft = /* @__PURE__ */ T({
1486
- __name: "Link",
1487
- props: {
1488
- href: {
1489
- type: String,
1490
- required: !0
1491
- },
1492
- title: {
1493
- type: String,
1494
- default: ""
1495
- }
1496
- },
1497
- setup(e) {
1498
- return (u, n) => (_(), A("a", {
1499
- class: "noZensmooth",
1500
- href: e.href,
1501
- rel: "noreferrer noopener nofollow",
1502
- title: e.title
1503
- }, [
1504
- S(u.$slots, "default", {}, void 0, !0)
1505
- ], 8, wt));
1506
- }
1507
- }), At = /* @__PURE__ */ $(Ft, [["__scopeId", "data-v-07756a64"]]), $t = {
1508
- blockquote: Be,
1509
- code: qe,
1510
- code_block: He,
1511
- emphasis: Ne,
1512
- heading: je,
1513
- image: Ze,
1514
- break: Ke,
1515
- link: At,
1516
- list: yt,
1517
- list_item: kt,
1518
- paragraph: vt,
1519
- strikethrough: Qe,
1520
- table: nt,
1521
- table_header: ce,
1522
- table_row: ce,
1523
- table_cell: st,
1524
- task_checkbox: ot,
1525
- text: dt,
1526
- text_block: ft
1527
- }, de = [];
1528
- function St(e) {
1529
- de.indexOf(e) === -1 && (de.push(e), console.warn(`[DocumentViewer] Unable to render an unknown node type "${e}"`));
1530
- }
1531
- function ae(e, u) {
1532
- return e.map((n, l) => {
1533
- var h;
1534
- if (!n)
1535
- return null;
1536
- const {
1537
- type: g,
1538
- children: p,
1539
- ...v
1540
- } = n, r = $t[n.type];
1541
- if (!r)
1542
- return St(g), null;
1543
- if (Ee(n) && (n.section = D.header), Ie(n)) {
1544
- const k = (h = n.children) == null ? void 0 : h.some((I) => {
1545
- var L;
1546
- return (L = I.children) == null ? void 0 : L.some((P) => {
1547
- var M;
1548
- return (M = P.children) == null ? void 0 : M.some((R) => R.type === "task_checkbox");
1549
- });
1550
- });
1551
- return ee(r, te({
1552
- hasTaskItems: k
1553
- }, v, {
1554
- parent: u
1555
- }), {
1556
- default: () => p && ae(p, n)
1557
- });
1558
- }
1559
- return (n == null ? void 0 : n.type) === "code_block" ? ee(r, te(v, {
1560
- lines: p,
1561
- isSingleLine: (p == null ? void 0 : p.length) && p.length === 1,
1562
- codeBlockIndex: l
1563
- }), null) : ee(r, te(v, {
1564
- parent: u
1565
- }), {
1566
- default: () => p && ae(p, n)
1567
- });
1568
- });
1569
- }
1570
- const Et = {
1571
- error: "Error: Markdown content missing",
1572
- "ANOTHER-key": "ok"
1573
- }, Tt = {
1574
- documentViewer: Et
1575
- };
1576
- function Ct() {
1577
- const e = $e("en-us", Tt);
1578
- return {
1579
- i18n: e,
1580
- i18nT: Se(e)
1581
- // Translation component <i18n-t>
1582
- };
1583
- }
1584
- function It() {
1585
- return {
1586
- hasRequiredProps: (u, n) => {
1587
- let l = !0;
1588
- return u.forEach((g) => {
1589
- n.forEach((p) => {
1590
- g[p] || (l = !1);
1591
- });
1592
- }), l;
1593
- }
1594
- };
1595
- }
1596
- const Lt = {
1597
- useI18n: Ct,
1598
- useUtilities: It
1599
- };
1600
- function Pt(e, u = "") {
1601
- return e.toLowerCase().trim().replace(/ /g, "-").replace(/[^\w-]+/g, "") + u;
1602
- }
1603
- function me(e, u = /* @__PURE__ */ new Map()) {
1604
- if (!e) return e;
1605
- const n = u || /* @__PURE__ */ new Map();
1606
- return e.map((l) => Ce(l) ? Bt(l, u) : (l.children && (l.children = me(l.children, n)), l));
1607
- }
1608
- function Bt(e, u, n = "doc-heading-") {
1609
- var k;
1610
- const l = (k = e.children) == null ? void 0 : k[0], g = `level-${e.level}`, p = Te(l) && l.text || g, v = (u.get(p) || 0) + 1;
1611
- u.set(p, v);
1612
- const r = v > 1 ? `-${v}` : "", h = n + Pt(p, r);
1613
- return {
1614
- ...e,
1615
- slug: h
1616
- };
1617
- }
1618
- const Ot = {
1619
- class: "document-viewer",
1620
- "data-testid": "document-viewer"
1621
- }, Dt = {
1622
- key: 1,
1623
- "data-testid": "document-viewer-error"
1624
- }, qt = /* @__PURE__ */ T({
1625
- __name: "DocumentViewer",
1626
- props: {
1627
- document: {
1628
- type: Object,
1629
- required: !0
1630
- }
1631
- },
1632
- setup(e) {
1633
- var r;
1634
- const u = e, { i18n: n } = Lt.useI18n(), l = (h) => !h || Object.keys(h).length === 0 && h.constructor === Object, g = ne(() => !l(u.document)), p = me((r = u.document) == null ? void 0 : r.children), v = () => {
1635
- var h;
1636
- return (h = u.document) != null && h.children ? ae(p) : null;
1637
- };
1638
- return (h, k) => (_(), A("div", Ot, [
1639
- g.value ? (_(), q(v, { key: 0 })) : (_(), A("div", Dt, fe(H(n).t("documentViewer.error")), 1))
1640
- ]));
1641
- }
1642
- }), zt = /* @__PURE__ */ $(qt, [["__scopeId", "data-v-1ab71c85"]]);
1643
- export {
1644
- K as TableCellAlign,
1645
- D as TableRowSection,
1646
- Bt as addSlug,
1647
- me as addUniqueHeadingSlugs,
1648
- zt as default,
1649
- Ce as isHeadingNode,
1650
- Ie as isListNode,
1651
- Ee as isTableHeaderNode,
1652
- Te as isTextNode,
1653
- Pt as toSlug
1654
- };