@splunk/react-ui 4.20.0 → 4.21.1

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 (101) hide show
  1. package/Accordion.js +425 -441
  2. package/Anchor.js +147 -193
  3. package/Animation.js +142 -166
  4. package/AnimationToggle.js +197 -253
  5. package/Box.js +145 -194
  6. package/Breadcrumbs.js +288 -298
  7. package/Button.js +488 -613
  8. package/ButtonGroup.js +160 -212
  9. package/ButtonSimple.js +543 -562
  10. package/CHANGELOG.md +26 -0
  11. package/Calendar.js +1107 -1195
  12. package/Card.js +771 -746
  13. package/CardLayout.js +205 -223
  14. package/Chip.js +509 -612
  15. package/Clickable.js +416 -472
  16. package/CloseButton.js +165 -250
  17. package/Code.js +1808 -2172
  18. package/Code.js.LICENSE.txt +8 -0
  19. package/CollapsiblePanel.js +586 -675
  20. package/Color.js +1066 -1297
  21. package/ColumnLayout.js +402 -465
  22. package/ComboBox.js +892 -969
  23. package/Concertina.js +998 -963
  24. package/ControlGroup.js +687 -718
  25. package/Date.js +567 -697
  26. package/DefinitionList.js +308 -310
  27. package/Divider.js +149 -194
  28. package/Dropdown.js +459 -558
  29. package/DualListbox.js +1480 -1735
  30. package/EventListener.js +94 -165
  31. package/File.js +1051 -1173
  32. package/FormRows.js +885 -880
  33. package/Heading.js +216 -263
  34. package/Image.js +446 -558
  35. package/JSONTree.js +690 -699
  36. package/Layer.js +442 -582
  37. package/Link.js +336 -361
  38. package/List.js +213 -237
  39. package/Markdown.js +510 -612
  40. package/Menu.js +1109 -1331
  41. package/Message.js +474 -629
  42. package/MessageBar.js +387 -561
  43. package/Modal.js +810 -798
  44. package/ModalLayer.js +326 -343
  45. package/Monogram.js +308 -368
  46. package/Multiselect.js +3558 -3998
  47. package/Number.js +729 -843
  48. package/Paginator.js +510 -615
  49. package/Paragraph.js +145 -188
  50. package/Popover.js +1470 -1693
  51. package/Progress.js +301 -362
  52. package/RadioBar.js +610 -651
  53. package/RadioList.js +483 -544
  54. package/Resize.js +530 -623
  55. package/ResultsMenu.js +494 -597
  56. package/ScreenReaderContent.js +142 -187
  57. package/Scroll.js +595 -598
  58. package/ScrollContainerContext.js +197 -278
  59. package/Search.js +745 -817
  60. package/Select.js +2441 -2746
  61. package/SidePanel.js +390 -392
  62. package/Slider.js +668 -825
  63. package/SlidingPanels.js +639 -645
  64. package/SplitButton.js +464 -499
  65. package/StaticContent.js +161 -217
  66. package/StepBar.js +386 -466
  67. package/Switch.js +710 -764
  68. package/TabBar.js +724 -815
  69. package/TabLayout.js +406 -438
  70. package/Table.js +4842 -5121
  71. package/Text.js +1169 -1351
  72. package/TextArea.js +1097 -1307
  73. package/Tooltip.js +624 -721
  74. package/TransitionOpen.js +489 -546
  75. package/Typography.js +176 -229
  76. package/WaitSpinner.js +230 -298
  77. package/package.json +14 -15
  78. package/stubs-splunkui.d.ts +4 -1
  79. package/types/src/ComboBox/Option.d.ts +1 -1
  80. package/types/src/Concertina/Concertina.d.ts +4 -0
  81. package/types/src/JSONTree/JSONTreeContext.d.ts +7 -0
  82. package/types/src/JSONTree/TreeNode.d.ts +5 -0
  83. package/types/src/Link/Link.d.ts +7 -3
  84. package/types/src/Link/docs/examples/NewWindow.d.ts +2 -0
  85. package/types/src/Markdown/Markdown.d.ts +1 -1
  86. package/types/src/Markdown/renderers/MarkdownHeading.d.ts +1 -1
  87. package/types/src/Menu/Item.d.ts +1 -1
  88. package/types/src/Menu/Menu.d.ts +1 -0
  89. package/types/src/MessageBar/docs/examples/WithActions.d.ts +2 -0
  90. package/types/src/Multiselect/Option.d.ts +1 -1
  91. package/types/src/Search/Option.d.ts +1 -1
  92. package/types/src/Select/Option.d.ts +1 -1
  93. package/types/src/Select/OptionBase.d.ts +1 -1
  94. package/types/src/fixtures/FetchOptions.d.ts +2 -8
  95. package/useForceUpdate.js +112 -146
  96. package/useKeyPress.js +74 -128
  97. package/usePrevious.js +65 -129
  98. package/useRovingFocus.js +122 -218
  99. package/types/src/Link/docs/examples/NewTab.d.ts +0 -2
  100. /package/types/src/Table/docs/examples/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
  101. /package/types/src/Table/docs/examples/prisma/{DockedHeader.d.ts → DockedHeaderScrollbar.d.ts} +0 -0
package/Code.js CHANGED
@@ -1,143 +1,29 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId]) {
11
- /******/ return installedModules[moduleId].exports;
12
- /******/ }
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ i: moduleId,
16
- /******/ l: false,
17
- /******/ exports: {}
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.l = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // define getter function for harmony exports
38
- /******/ __webpack_require__.d = function(exports, name, getter) {
39
- /******/ if(!__webpack_require__.o(exports, name)) {
40
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
41
- /******/ }
42
- /******/ };
43
- /******/
44
- /******/ // define __esModule on exports
45
- /******/ __webpack_require__.r = function(exports) {
46
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
47
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
48
- /******/ }
49
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
50
- /******/ };
51
- /******/
52
- /******/ // create a fake namespace object
53
- /******/ // mode & 1: value is a module id, require it
54
- /******/ // mode & 2: merge all properties of value into the ns
55
- /******/ // mode & 4: return value when already ns object
56
- /******/ // mode & 8|1: behave like require
57
- /******/ __webpack_require__.t = function(value, mode) {
58
- /******/ if(mode & 1) value = __webpack_require__(value);
59
- /******/ if(mode & 8) return value;
60
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
61
- /******/ var ns = Object.create(null);
62
- /******/ __webpack_require__.r(ns);
63
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
64
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
65
- /******/ return ns;
66
- /******/ };
67
- /******/
68
- /******/ // getDefaultExport function for compatibility with non-harmony modules
69
- /******/ __webpack_require__.n = function(module) {
70
- /******/ var getter = module && module.__esModule ?
71
- /******/ function getDefault() { return module['default']; } :
72
- /******/ function getModuleExports() { return module; };
73
- /******/ __webpack_require__.d(getter, 'a', getter);
74
- /******/ return getter;
75
- /******/ };
76
- /******/
77
- /******/ // Object.prototype.hasOwnProperty.call
78
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
79
- /******/
80
- /******/ // __webpack_public_path__
81
- /******/ __webpack_require__.p = "";
82
- /******/
83
- /******/
84
- /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 219);
86
- /******/ })
87
- /************************************************************************/
88
- /******/ ({
89
-
90
- /***/ 0:
91
- /***/ (function(module, exports) {
92
-
93
- module.exports = require("@splunk/themes");
94
-
95
- /***/ }),
96
-
97
- /***/ 1:
98
- /***/ (function(module, exports) {
99
-
100
- module.exports = require("prop-types");
101
-
102
- /***/ }),
103
-
104
- /***/ 118:
105
- /***/ (function(module, exports, __webpack_require__) {
106
-
107
-
108
- (function() {
109
- var window = undefined;
110
- var global = undefined;
111
- /// <reference lib="WebWorker"/>
112
-
113
- var _self = (typeof window !== 'undefined')
114
- ? window // if in browser
115
- : (
116
- (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
117
- ? self // if in worker
118
- : {} // if in node js
119
- );
120
-
121
- /**
1
+ /*! For license information please see Code.js.LICENSE.txt */
2
+ /******/ (() => {
3
+ // webpackBootstrap
4
+ /******/ var e = {
5
+ /***/ 74:
6
+ /***/ e => {
7
+ (function() {
8
+ var t = undefined;
9
+ var a = undefined;
10
+ /// <reference lib="WebWorker"/>
11
+ var n = typeof t !== "undefined" ? t : typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope ? self : {};
12
+ /**
122
13
  * Prism: Lightweight, robust, elegant syntax highlighting
123
14
  *
124
15
  * @license MIT <https://opensource.org/licenses/MIT>
125
16
  * @author Lea Verou <https://lea.verou.me>
126
17
  * @namespace
127
18
  * @public
128
- */
129
- var Prism = (function (_self) {
130
-
131
- // Private helper vars
132
- var lang = /\blang(?:uage)?-([\w-]+)\b/i;
133
- var uniqueId = 0;
134
-
135
- // The grammar object for plaintext
136
- var plainTextGrammar = {};
137
-
138
-
139
- var _ = {
140
- /**
19
+ */ var r = function(e) {
20
+ // Private helper vars
21
+ var a = /\blang(?:uage)?-([\w-]+)\b/i;
22
+ var n = 0;
23
+ // The grammar object for plaintext
24
+ var r = {};
25
+ var s = {
26
+ /**
141
27
  * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
142
28
  * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
143
29
  * additional languages or plugins yourself.
@@ -158,10 +44,9 @@ var Prism = (function (_self) {
158
44
  * @memberof Prism
159
45
  * @public
160
46
  */
161
- manual: _self.Prism && _self.Prism.manual,
162
- disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
163
-
164
- /**
47
+ manual: e.Prism && e.Prism.manual,
48
+ disableWorkerMessageHandler: e.Prism && e.Prism.disableWorkerMessageHandler,
49
+ /**
165
50
  * A namespace for utility methods.
166
51
  *
167
52
  * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
@@ -170,18 +55,17 @@ var Prism = (function (_self) {
170
55
  * @namespace
171
56
  * @memberof Prism
172
57
  */
173
- util: {
174
- encode: function encode(tokens) {
175
- if (tokens instanceof Token) {
176
- return new Token(tokens.type, encode(tokens.content), tokens.alias);
177
- } else if (Array.isArray(tokens)) {
178
- return tokens.map(encode);
179
- } else {
180
- return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
181
- }
182
- },
183
-
184
- /**
58
+ util: {
59
+ encode: function e(t) {
60
+ if (t instanceof i) {
61
+ return new i(t.type, e(t.content), t.alias);
62
+ } else if (Array.isArray(t)) {
63
+ return t.map(e);
64
+ } else {
65
+ return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
66
+ }
67
+ },
68
+ /**
185
69
  * Returns the name of the type of the given value.
186
70
  *
187
71
  * @param {any} o
@@ -197,24 +81,24 @@ var Prism = (function (_self) {
197
81
  * type(String) === 'Function'
198
82
  * type(/abc+/) === 'RegExp'
199
83
  */
200
- type: function (o) {
201
- return Object.prototype.toString.call(o).slice(8, -1);
202
- },
203
-
204
- /**
84
+ type: function(e) {
85
+ return Object.prototype.toString.call(e).slice(8, -1);
86
+ },
87
+ /**
205
88
  * Returns a unique number for the given object. Later calls will still return the same number.
206
89
  *
207
90
  * @param {Object} obj
208
91
  * @returns {number}
209
92
  */
210
- objId: function (obj) {
211
- if (!obj['__id']) {
212
- Object.defineProperty(obj, '__id', { value: ++uniqueId });
213
- }
214
- return obj['__id'];
215
- },
216
-
217
- /**
93
+ objId: function(e) {
94
+ if (!e["__id"]) {
95
+ Object.defineProperty(e, "__id", {
96
+ value: ++n
97
+ });
98
+ }
99
+ return e["__id"];
100
+ },
101
+ /**
218
102
  * Creates a deep clone of the given object.
219
103
  *
220
104
  * The main intended use of this function is to clone language definitions.
@@ -224,47 +108,44 @@ var Prism = (function (_self) {
224
108
  * @returns {T}
225
109
  * @template T
226
110
  */
227
- clone: function deepClone(o, visited) {
228
- visited = visited || {};
229
-
230
- var clone; var id;
231
- switch (_.util.type(o)) {
232
- case 'Object':
233
- id = _.util.objId(o);
234
- if (visited[id]) {
235
- return visited[id];
236
- }
237
- clone = /** @type {Record<string, any>} */ ({});
238
- visited[id] = clone;
239
-
240
- for (var key in o) {
241
- if (o.hasOwnProperty(key)) {
242
- clone[key] = deepClone(o[key], visited);
243
- }
244
- }
245
-
246
- return /** @type {any} */ (clone);
247
-
248
- case 'Array':
249
- id = _.util.objId(o);
250
- if (visited[id]) {
251
- return visited[id];
252
- }
253
- clone = [];
254
- visited[id] = clone;
255
-
256
- (/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {
257
- clone[i] = deepClone(v, visited);
258
- });
259
-
260
- return /** @type {any} */ (clone);
261
-
262
- default:
263
- return o;
264
- }
265
- },
266
-
267
- /**
111
+ clone: function e(t, a) {
112
+ a = a || {};
113
+ var n;
114
+ var r;
115
+ switch (s.util.type(t)) {
116
+ case "Object":
117
+ r = s.util.objId(t);
118
+ if (a[r]) {
119
+ return a[r];
120
+ }
121
+ n = /** @type {Record<string, any>} */ {};
122
+ a[r] = n;
123
+ for (var i in t) {
124
+ if (t.hasOwnProperty(i)) {
125
+ n[i] = e(t[i], a);
126
+ }
127
+ }
128
+ /** @type {any} */
129
+ return n;
130
+
131
+ case "Array":
132
+ r = s.util.objId(t);
133
+ if (a[r]) {
134
+ return a[r];
135
+ }
136
+ n = [];
137
+ a[r] = n;
138
+ /** @type {Array} */ /** @type {any} */ t.forEach((function(t, r) {
139
+ n[r] = e(t, a);
140
+ }));
141
+ /** @type {any} */
142
+ return n;
143
+
144
+ default:
145
+ return t;
146
+ }
147
+ },
148
+ /**
268
149
  * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
269
150
  *
270
151
  * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
@@ -272,59 +153,54 @@ var Prism = (function (_self) {
272
153
  * @param {Element} element
273
154
  * @returns {string}
274
155
  */
275
- getLanguage: function (element) {
276
- while (element && !lang.test(element.className)) {
277
- element = element.parentElement;
278
- }
279
- if (element) {
280
- return (element.className.match(lang) || [, 'none'])[1].toLowerCase();
281
- }
282
- return 'none';
283
- },
284
-
285
- /**
156
+ getLanguage: function(e) {
157
+ while (e && !a.test(e.className)) {
158
+ e = e.parentElement;
159
+ }
160
+ if (e) {
161
+ return (e.className.match(a) || [ , "none" ])[1].toLowerCase();
162
+ }
163
+ return "none";
164
+ },
165
+ /**
286
166
  * Returns the script element that is currently executing.
287
167
  *
288
168
  * This does __not__ work for line script element.
289
169
  *
290
170
  * @returns {HTMLScriptElement | null}
291
171
  */
292
- currentScript: function () {
293
- if (typeof document === 'undefined') {
294
- return null;
295
- }
296
- if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
297
- return /** @type {any} */ (document.currentScript);
298
- }
299
-
300
- // IE11 workaround
301
- // we'll get the src of the current script by parsing IE11's error stack trace
302
- // this will not work for inline scripts
303
-
304
- try {
305
- throw new Error();
306
- } catch (err) {
307
- // Get file src url from stack. Specifically works with the format of stack traces in IE.
308
- // A stack will look like this:
309
- //
310
- // Error
311
- // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
312
- // at Global code (http://localhost/components/prism-core.js:606:1)
313
-
314
- var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
315
- if (src) {
316
- var scripts = document.getElementsByTagName('script');
317
- for (var i in scripts) {
318
- if (scripts[i].src == src) {
319
- return scripts[i];
320
- }
321
- }
322
- }
323
- return null;
324
- }
325
- },
326
-
327
- /**
172
+ currentScript: function() {
173
+ if (typeof document === "undefined") {
174
+ return null;
175
+ }
176
+ if ("currentScript" in document && 1 < 2 /* hack to trip TS' flow analysis */) {
177
+ /** @type {any} */
178
+ return document.currentScript;
179
+ }
180
+ // IE11 workaround
181
+ // we'll get the src of the current script by parsing IE11's error stack trace
182
+ // this will not work for inline scripts
183
+ try {
184
+ throw new Error;
185
+ } catch (n) {
186
+ // Get file src url from stack. Specifically works with the format of stack traces in IE.
187
+ // A stack will look like this:
188
+ // Error
189
+ // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
190
+ // at Global code (http://localhost/components/prism-core.js:606:1)
191
+ var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(n.stack) || [])[1];
192
+ if (e) {
193
+ var t = document.getElementsByTagName("script");
194
+ for (var a in t) {
195
+ if (t[a].src == e) {
196
+ return t[a];
197
+ }
198
+ }
199
+ }
200
+ return null;
201
+ }
202
+ },
203
+ /**
328
204
  * Returns whether a given class is active for `element`.
329
205
  *
330
206
  * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
@@ -343,40 +219,37 @@ var Prism = (function (_self) {
343
219
  * @param {boolean} [defaultActivation=false]
344
220
  * @returns {boolean}
345
221
  */
346
- isActive: function (element, className, defaultActivation) {
347
- var no = 'no-' + className;
348
-
349
- while (element) {
350
- var classList = element.classList;
351
- if (classList.contains(className)) {
352
- return true;
353
- }
354
- if (classList.contains(no)) {
355
- return false;
356
- }
357
- element = element.parentElement;
358
- }
359
- return !!defaultActivation;
360
- }
361
- },
362
-
363
- /**
222
+ isActive: function(e, t, a) {
223
+ var n = "no-" + t;
224
+ while (e) {
225
+ var r = e.classList;
226
+ if (r.contains(t)) {
227
+ return true;
228
+ }
229
+ if (r.contains(n)) {
230
+ return false;
231
+ }
232
+ e = e.parentElement;
233
+ }
234
+ return !!a;
235
+ }
236
+ },
237
+ /**
364
238
  * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
365
239
  *
366
240
  * @namespace
367
241
  * @memberof Prism
368
242
  * @public
369
243
  */
370
- languages: {
371
- /**
244
+ languages: {
245
+ /**
372
246
  * The grammar for plain, unformatted text.
373
247
  */
374
- plain: plainTextGrammar,
375
- plaintext: plainTextGrammar,
376
- text: plainTextGrammar,
377
- txt: plainTextGrammar,
378
-
379
- /**
248
+ plain: r,
249
+ plaintext: r,
250
+ text: r,
251
+ txt: r,
252
+ /**
380
253
  * Creates a deep copy of the language with the given id and appends the given tokens.
381
254
  *
382
255
  * If a token in `redef` also appears in the copied language, then the existing token in the copied language
@@ -404,17 +277,14 @@ var Prism = (function (_self) {
404
277
  * 'color': /\b(?:red|green|blue)\b/
405
278
  * });
406
279
  */
407
- extend: function (id, redef) {
408
- var lang = _.util.clone(_.languages[id]);
409
-
410
- for (var key in redef) {
411
- lang[key] = redef[key];
412
- }
413
-
414
- return lang;
415
- },
416
-
417
- /**
280
+ extend: function(e, t) {
281
+ var a = s.util.clone(s.languages[e]);
282
+ for (var n in t) {
283
+ a[n] = t[n];
284
+ }
285
+ return a;
286
+ },
287
+ /**
418
288
  * Inserts tokens _before_ another token in a language definition or any other grammar.
419
289
  *
420
290
  * ## Usage
@@ -489,71 +359,57 @@ var Prism = (function (_self) {
489
359
  * @returns {Grammar} The new grammar object.
490
360
  * @public
491
361
  */
492
- insertBefore: function (inside, before, insert, root) {
493
- root = root || /** @type {any} */ (_.languages);
494
- var grammar = root[inside];
495
- /** @type {Grammar} */
496
- var ret = {};
497
-
498
- for (var token in grammar) {
499
- if (grammar.hasOwnProperty(token)) {
500
-
501
- if (token == before) {
502
- for (var newToken in insert) {
503
- if (insert.hasOwnProperty(newToken)) {
504
- ret[newToken] = insert[newToken];
505
- }
506
- }
507
- }
508
-
509
- // Do not insert token which also occur in insert. See #1525
510
- if (!insert.hasOwnProperty(token)) {
511
- ret[token] = grammar[token];
512
- }
513
- }
514
- }
515
-
516
- var old = root[inside];
517
- root[inside] = ret;
518
-
519
- // Update references in other language definitions
520
- _.languages.DFS(_.languages, function (key, value) {
521
- if (value === old && key != inside) {
522
- this[key] = ret;
523
- }
524
- });
525
-
526
- return ret;
527
- },
528
-
529
- // Traverse a language definition with Depth First Search
530
- DFS: function DFS(o, callback, type, visited) {
531
- visited = visited || {};
532
-
533
- var objId = _.util.objId;
534
-
535
- for (var i in o) {
536
- if (o.hasOwnProperty(i)) {
537
- callback.call(o, i, o[i], type || i);
538
-
539
- var property = o[i];
540
- var propertyType = _.util.type(property);
541
-
542
- if (propertyType === 'Object' && !visited[objId(property)]) {
543
- visited[objId(property)] = true;
544
- DFS(property, callback, null, visited);
545
- } else if (propertyType === 'Array' && !visited[objId(property)]) {
546
- visited[objId(property)] = true;
547
- DFS(property, callback, i, visited);
548
- }
549
- }
550
- }
551
- }
552
- },
553
-
554
- plugins: {},
555
-
556
- /**
362
+ insertBefore: function(e, t, a, n) {
363
+ n = n || /** @type {any} */ s.languages;
364
+ var r = n[e];
365
+ /** @type {Grammar} */ var i = {};
366
+ for (var o in r) {
367
+ if (r.hasOwnProperty(o)) {
368
+ if (o == t) {
369
+ for (var l in a) {
370
+ if (a.hasOwnProperty(l)) {
371
+ i[l] = a[l];
372
+ }
373
+ }
374
+ }
375
+ // Do not insert token which also occur in insert. See #1525
376
+ if (!a.hasOwnProperty(o)) {
377
+ i[o] = r[o];
378
+ }
379
+ }
380
+ }
381
+ var u = n[e];
382
+ n[e] = i;
383
+ // Update references in other language definitions
384
+ s.languages.DFS(s.languages, (function(t, a) {
385
+ if (a === u && t != e) {
386
+ this[t] = i;
387
+ }
388
+ }));
389
+ return i;
390
+ },
391
+ // Traverse a language definition with Depth First Search
392
+ DFS: function e(t, a, n, r) {
393
+ r = r || {};
394
+ var i = s.util.objId;
395
+ for (var o in t) {
396
+ if (t.hasOwnProperty(o)) {
397
+ a.call(t, o, t[o], n || o);
398
+ var l = t[o];
399
+ var u = s.util.type(l);
400
+ if (u === "Object" && !r[i(l)]) {
401
+ r[i(l)] = true;
402
+ e(l, a, null, r);
403
+ } else if (u === "Array" && !r[i(l)]) {
404
+ r[i(l)] = true;
405
+ e(l, a, o, r);
406
+ }
407
+ }
408
+ }
409
+ }
410
+ },
411
+ plugins: {},
412
+ /**
557
413
  * This is the most high-level function in Prism’s API.
558
414
  * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
559
415
  * each one of them.
@@ -565,11 +421,10 @@ var Prism = (function (_self) {
565
421
  * @memberof Prism
566
422
  * @public
567
423
  */
568
- highlightAll: function (async, callback) {
569
- _.highlightAllUnder(document, async, callback);
570
- },
571
-
572
- /**
424
+ highlightAll: function(e, t) {
425
+ s.highlightAllUnder(document, e, t);
426
+ },
427
+ /**
573
428
  * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
574
429
  * {@link Prism.highlightElement} on each one of them.
575
430
  *
@@ -584,25 +439,20 @@ var Prism = (function (_self) {
584
439
  * @memberof Prism
585
440
  * @public
586
441
  */
587
- highlightAllUnder: function (container, async, callback) {
588
- var env = {
589
- callback: callback,
590
- container: container,
591
- selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
592
- };
593
-
594
- _.hooks.run('before-highlightall', env);
595
-
596
- env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
597
-
598
- _.hooks.run('before-all-elements-highlight', env);
599
-
600
- for (var i = 0, element; (element = env.elements[i++]);) {
601
- _.highlightElement(element, async === true, env.callback);
602
- }
603
- },
604
-
605
- /**
442
+ highlightAllUnder: function(e, t, a) {
443
+ var n = {
444
+ callback: a,
445
+ container: e,
446
+ selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
447
+ };
448
+ s.hooks.run("before-highlightall", n);
449
+ n.elements = Array.prototype.slice.apply(n.container.querySelectorAll(n.selector));
450
+ s.hooks.run("before-all-elements-highlight", n);
451
+ for (var r = 0, i; i = n.elements[r++]; ) {
452
+ s.highlightElement(i, t === true, n.callback);
453
+ }
454
+ },
455
+ /**
606
456
  * Highlights the code inside a single element.
607
457
  *
608
458
  * The following hooks will be run:
@@ -630,80 +480,63 @@ var Prism = (function (_self) {
630
480
  * @memberof Prism
631
481
  * @public
632
482
  */
633
- highlightElement: function (element, async, callback) {
634
- // Find language
635
- var language = _.util.getLanguage(element);
636
- var grammar = _.languages[language];
637
-
638
- // Set language on the element, if not present
639
- element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
640
-
641
- // Set language on the parent, for styling
642
- var parent = element.parentElement;
643
- if (parent && parent.nodeName.toLowerCase() === 'pre') {
644
- parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language;
645
- }
646
-
647
- var code = element.textContent;
648
-
649
- var env = {
650
- element: element,
651
- language: language,
652
- grammar: grammar,
653
- code: code
654
- };
655
-
656
- function insertHighlightedCode(highlightedCode) {
657
- env.highlightedCode = highlightedCode;
658
-
659
- _.hooks.run('before-insert', env);
660
-
661
- env.element.innerHTML = env.highlightedCode;
662
-
663
- _.hooks.run('after-highlight', env);
664
- _.hooks.run('complete', env);
665
- callback && callback.call(env.element);
666
- }
667
-
668
- _.hooks.run('before-sanity-check', env);
669
-
670
- // plugins may change/add the parent/element
671
- parent = env.element.parentElement;
672
- if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
673
- parent.setAttribute('tabindex', '0');
674
- }
675
-
676
- if (!env.code) {
677
- _.hooks.run('complete', env);
678
- callback && callback.call(env.element);
679
- return;
680
- }
681
-
682
- _.hooks.run('before-highlight', env);
683
-
684
- if (!env.grammar) {
685
- insertHighlightedCode(_.util.encode(env.code));
686
- return;
687
- }
688
-
689
- if (async && _self.Worker) {
690
- var worker = new Worker(_.filename);
691
-
692
- worker.onmessage = function (evt) {
693
- insertHighlightedCode(evt.data);
694
- };
695
-
696
- worker.postMessage(JSON.stringify({
697
- language: env.language,
698
- code: env.code,
699
- immediateClose: true
700
- }));
701
- } else {
702
- insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
703
- }
704
- },
705
-
706
- /**
483
+ highlightElement: function(t, n, r) {
484
+ // Find language
485
+ var i = s.util.getLanguage(t);
486
+ var o = s.languages[i];
487
+ // Set language on the element, if not present
488
+ t.className = t.className.replace(a, "").replace(/\s+/g, " ") + " language-" + i;
489
+ // Set language on the parent, for styling
490
+ var l = t.parentElement;
491
+ if (l && l.nodeName.toLowerCase() === "pre") {
492
+ l.className = l.className.replace(a, "").replace(/\s+/g, " ") + " language-" + i;
493
+ }
494
+ var u = t.textContent;
495
+ var c = {
496
+ element: t,
497
+ language: i,
498
+ grammar: o,
499
+ code: u
500
+ };
501
+ function p(e) {
502
+ c.highlightedCode = e;
503
+ s.hooks.run("before-insert", c);
504
+ c.element.innerHTML = c.highlightedCode;
505
+ s.hooks.run("after-highlight", c);
506
+ s.hooks.run("complete", c);
507
+ r && r.call(c.element);
508
+ }
509
+ s.hooks.run("before-sanity-check", c);
510
+ // plugins may change/add the parent/element
511
+ l = c.element.parentElement;
512
+ if (l && l.nodeName.toLowerCase() === "pre" && !l.hasAttribute("tabindex")) {
513
+ l.setAttribute("tabindex", "0");
514
+ }
515
+ if (!c.code) {
516
+ s.hooks.run("complete", c);
517
+ r && r.call(c.element);
518
+ return;
519
+ }
520
+ s.hooks.run("before-highlight", c);
521
+ if (!c.grammar) {
522
+ p(s.util.encode(c.code));
523
+ return;
524
+ }
525
+ if (n && e.Worker) {
526
+ var d = new Worker(s.filename);
527
+ d.onmessage = function(e) {
528
+ p(e.data);
529
+ };
530
+ d.postMessage(JSON.stringify({
531
+ language: c.language,
532
+ code: c.code,
533
+ immediateClose: true
534
+ }));
535
+ } else {
536
+ p(s.highlight(c.code, c.grammar, c.language));
537
+ }
538
+ },
539
+ /**
707
540
  * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
708
541
  * and the language definitions to use, and returns a string with the HTML produced.
709
542
  *
@@ -723,19 +556,18 @@ var Prism = (function (_self) {
723
556
  * @example
724
557
  * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
725
558
  */
726
- highlight: function (text, grammar, language) {
727
- var env = {
728
- code: text,
729
- grammar: grammar,
730
- language: language
731
- };
732
- _.hooks.run('before-tokenize', env);
733
- env.tokens = _.tokenize(env.code, env.grammar);
734
- _.hooks.run('after-tokenize', env);
735
- return Token.stringify(_.util.encode(env.tokens), env.language);
736
- },
737
-
738
- /**
559
+ highlight: function(e, t, a) {
560
+ var n = {
561
+ code: e,
562
+ grammar: t,
563
+ language: a
564
+ };
565
+ s.hooks.run("before-tokenize", n);
566
+ n.tokens = s.tokenize(n.code, n.grammar);
567
+ s.hooks.run("after-tokenize", n);
568
+ return i.stringify(s.util.encode(n.tokens), n.language);
569
+ },
570
+ /**
739
571
  * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
740
572
  * and the language definitions to use, and returns an array with the tokenized code.
741
573
  *
@@ -759,33 +591,27 @@ var Prism = (function (_self) {
759
591
  * }
760
592
  * });
761
593
  */
762
- tokenize: function (text, grammar) {
763
- var rest = grammar.rest;
764
- if (rest) {
765
- for (var token in rest) {
766
- grammar[token] = rest[token];
767
- }
768
-
769
- delete grammar.rest;
770
- }
771
-
772
- var tokenList = new LinkedList();
773
- addAfter(tokenList, tokenList.head, text);
774
-
775
- matchGrammar(text, tokenList, grammar, tokenList.head, 0);
776
-
777
- return toArray(tokenList);
778
- },
779
-
780
- /**
594
+ tokenize: function(e, t) {
595
+ var a = t.rest;
596
+ if (a) {
597
+ for (var n in a) {
598
+ t[n] = a[n];
599
+ }
600
+ delete t.rest;
601
+ }
602
+ var r = new u;
603
+ c(r, r.head, e);
604
+ l(e, r, t, r.head, 0);
605
+ return d(r);
606
+ },
607
+ /**
781
608
  * @namespace
782
609
  * @memberof Prism
783
610
  * @public
784
611
  */
785
- hooks: {
786
- all: {},
787
-
788
- /**
612
+ hooks: {
613
+ all: {},
614
+ /**
789
615
  * Adds the given callback to the list of callbacks for the given hook.
790
616
  *
791
617
  * The callback will be invoked when the hook it is registered for is run.
@@ -797,15 +623,12 @@ var Prism = (function (_self) {
797
623
  * @param {HookCallback} callback The callback function which is given environment variables.
798
624
  * @public
799
625
  */
800
- add: function (name, callback) {
801
- var hooks = _.hooks.all;
802
-
803
- hooks[name] = hooks[name] || [];
804
-
805
- hooks[name].push(callback);
806
- },
807
-
808
- /**
626
+ add: function(e, t) {
627
+ var a = s.hooks.all;
628
+ a[e] = a[e] || [];
629
+ a[e].push(t);
630
+ },
631
+ /**
809
632
  * Runs a hook invoking all registered callbacks with the given environment variables.
810
633
  *
811
634
  * Callbacks will be invoked synchronously and in the order in which they were registered.
@@ -814,30 +637,24 @@ var Prism = (function (_self) {
814
637
  * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
815
638
  * @public
816
639
  */
817
- run: function (name, env) {
818
- var callbacks = _.hooks.all[name];
819
-
820
- if (!callbacks || !callbacks.length) {
821
- return;
822
- }
823
-
824
- for (var i = 0, callback; (callback = callbacks[i++]);) {
825
- callback(env);
826
- }
827
- }
828
- },
829
-
830
- Token: Token
831
- };
832
- _self.Prism = _;
833
-
834
-
835
- // Typescript note:
836
- // The following can be used to import the Token type in JSDoc:
837
- //
838
- // @typedef {InstanceType<import("./prism-core")["Token"]>} Token
839
-
840
- /**
640
+ run: function(e, t) {
641
+ var a = s.hooks.all[e];
642
+ if (!a || !a.length) {
643
+ return;
644
+ }
645
+ for (var n = 0, r; r = a[n++]; ) {
646
+ r(t);
647
+ }
648
+ }
649
+ },
650
+ Token: i
651
+ };
652
+ e.Prism = s;
653
+ // Typescript note:
654
+ // The following can be used to import the Token type in JSDoc:
655
+
656
+ // @typedef {InstanceType<import("./prism-core")["Token"]>} Token
657
+ /**
841
658
  * Creates a new token.
842
659
  *
843
660
  * @param {string} type See {@link Token#type type}
@@ -847,9 +664,8 @@ var Prism = (function (_self) {
847
664
  * @class
848
665
  * @global
849
666
  * @public
850
- */
851
- function Token(type, content, alias, matchedStr) {
852
- /**
667
+ */ function i(e, t, a, n) {
668
+ /**
853
669
  * The type of the token.
854
670
  *
855
671
  * This is usually the key of a pattern in a {@link Grammar}.
@@ -858,29 +674,26 @@ var Prism = (function (_self) {
858
674
  * @see GrammarToken
859
675
  * @public
860
676
  */
861
- this.type = type;
862
- /**
677
+ this.type = e;
678
+ /**
863
679
  * The strings or tokens contained by this token.
864
680
  *
865
681
  * This will be a token stream if the pattern matched also defined an `inside` grammar.
866
682
  *
867
683
  * @type {string | TokenStream}
868
684
  * @public
869
- */
870
- this.content = content;
871
- /**
685
+ */ this.content = t;
686
+ /**
872
687
  * The alias(es) of the token.
873
688
  *
874
689
  * @type {string|string[]}
875
690
  * @see GrammarToken
876
691
  * @public
877
- */
878
- this.alias = alias;
879
- // Copy of the full string this token was created from
880
- this.length = (matchedStr || '').length | 0;
881
- }
882
-
883
- /**
692
+ */ this.alias = a;
693
+ // Copy of the full string this token was created from
694
+ this.length = (n || "").length | 0;
695
+ }
696
+ /**
884
697
  * A token stream is an array of strings and {@link Token Token} objects.
885
698
  *
886
699
  * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
@@ -895,8 +708,7 @@ var Prism = (function (_self) {
895
708
  * @global
896
709
  * @public
897
710
  */
898
-
899
- /**
711
+ /**
900
712
  * Converts the given token or token stream to an HTML representation.
901
713
  *
902
714
  * The following hooks will be run:
@@ -907,67 +719,58 @@ var Prism = (function (_self) {
907
719
  * @returns {string} The HTML representation of the token or token stream.
908
720
  * @memberof Token
909
721
  * @static
910
- */
911
- Token.stringify = function stringify(o, language) {
912
- if (typeof o == 'string') {
913
- return o;
914
- }
915
- if (Array.isArray(o)) {
916
- var s = '';
917
- o.forEach(function (e) {
918
- s += stringify(e, language);
919
- });
920
- return s;
921
- }
922
-
923
- var env = {
924
- type: o.type,
925
- content: stringify(o.content, language),
926
- tag: 'span',
927
- classes: ['token', o.type],
928
- attributes: {},
929
- language: language
930
- };
931
-
932
- var aliases = o.alias;
933
- if (aliases) {
934
- if (Array.isArray(aliases)) {
935
- Array.prototype.push.apply(env.classes, aliases);
936
- } else {
937
- env.classes.push(aliases);
938
- }
939
- }
940
-
941
- _.hooks.run('wrap', env);
942
-
943
- var attributes = '';
944
- for (var name in env.attributes) {
945
- attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
946
- }
947
-
948
- return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
949
- };
950
-
951
- /**
722
+ */ i.stringify = function e(t, a) {
723
+ if (typeof t == "string") {
724
+ return t;
725
+ }
726
+ if (Array.isArray(t)) {
727
+ var n = "";
728
+ t.forEach((function(t) {
729
+ n += e(t, a);
730
+ }));
731
+ return n;
732
+ }
733
+ var r = {
734
+ type: t.type,
735
+ content: e(t.content, a),
736
+ tag: "span",
737
+ classes: [ "token", t.type ],
738
+ attributes: {},
739
+ language: a
740
+ };
741
+ var i = t.alias;
742
+ if (i) {
743
+ if (Array.isArray(i)) {
744
+ Array.prototype.push.apply(r.classes, i);
745
+ } else {
746
+ r.classes.push(i);
747
+ }
748
+ }
749
+ s.hooks.run("wrap", r);
750
+ var o = "";
751
+ for (var l in r.attributes) {
752
+ o += " " + l + '="' + (r.attributes[l] || "").replace(/"/g, "&quot;") + '"';
753
+ }
754
+ return "<" + r.tag + ' class="' + r.classes.join(" ") + '"' + o + ">" + r.content + "</" + r.tag + ">";
755
+ };
756
+ /**
952
757
  * @param {RegExp} pattern
953
758
  * @param {number} pos
954
759
  * @param {string} text
955
760
  * @param {boolean} lookbehind
956
761
  * @returns {RegExpExecArray | null}
957
- */
958
- function matchPattern(pattern, pos, text, lookbehind) {
959
- pattern.lastIndex = pos;
960
- var match = pattern.exec(text);
961
- if (match && lookbehind && match[1]) {
962
- // change the match to remove the text matched by the Prism lookbehind group
963
- var lookbehindLength = match[1].length;
964
- match.index += lookbehindLength;
965
- match[0] = match[0].slice(lookbehindLength);
966
- }
967
- return match;
968
- }
969
-
970
- /**
762
+ */ function o(e, t, a, n) {
763
+ e.lastIndex = t;
764
+ var r = e.exec(a);
765
+ if (r && n && r[1]) {
766
+ // change the match to remove the text matched by the Prism lookbehind group
767
+ var s = r[1].length;
768
+ r.index += s;
769
+ r[0] = r[0].slice(s);
770
+ }
771
+ return r;
772
+ }
773
+ /**
971
774
  * @param {string} text
972
775
  * @param {LinkedList<string | Token>} tokenList
973
776
  * @param {any} grammar
@@ -980,155 +783,119 @@ var Prism = (function (_self) {
980
783
  * @typedef RematchOptions
981
784
  * @property {string} cause
982
785
  * @property {number} reach
983
- */
984
- function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
985
- for (var token in grammar) {
986
- if (!grammar.hasOwnProperty(token) || !grammar[token]) {
987
- continue;
988
- }
989
-
990
- var patterns = grammar[token];
991
- patterns = Array.isArray(patterns) ? patterns : [patterns];
992
-
993
- for (var j = 0; j < patterns.length; ++j) {
994
- if (rematch && rematch.cause == token + ',' + j) {
995
- return;
996
- }
997
-
998
- var patternObj = patterns[j];
999
- var inside = patternObj.inside;
1000
- var lookbehind = !!patternObj.lookbehind;
1001
- var greedy = !!patternObj.greedy;
1002
- var alias = patternObj.alias;
1003
-
1004
- if (greedy && !patternObj.pattern.global) {
1005
- // Without the global flag, lastIndex won't work
1006
- var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
1007
- patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
1008
- }
1009
-
1010
- /** @type {RegExp} */
1011
- var pattern = patternObj.pattern || patternObj;
1012
-
1013
- for ( // iterate the token list and keep track of the current token/string position
1014
- var currentNode = startNode.next, pos = startPos;
1015
- currentNode !== tokenList.tail;
1016
- pos += currentNode.value.length, currentNode = currentNode.next
1017
- ) {
1018
-
1019
- if (rematch && pos >= rematch.reach) {
1020
- break;
1021
- }
1022
-
1023
- var str = currentNode.value;
1024
-
1025
- if (tokenList.length > text.length) {
1026
- // Something went terribly wrong, ABORT, ABORT!
1027
- return;
1028
- }
1029
-
1030
- if (str instanceof Token) {
1031
- continue;
1032
- }
1033
-
1034
- var removeCount = 1; // this is the to parameter of removeBetween
1035
- var match;
1036
-
1037
- if (greedy) {
1038
- match = matchPattern(pattern, pos, text, lookbehind);
1039
- if (!match) {
1040
- break;
1041
- }
1042
-
1043
- var from = match.index;
1044
- var to = match.index + match[0].length;
1045
- var p = pos;
1046
-
1047
- // find the node that contains the match
1048
- p += currentNode.value.length;
1049
- while (from >= p) {
1050
- currentNode = currentNode.next;
1051
- p += currentNode.value.length;
1052
- }
1053
- // adjust pos (and p)
1054
- p -= currentNode.value.length;
1055
- pos = p;
1056
-
1057
- // the current node is a Token, then the match starts inside another Token, which is invalid
1058
- if (currentNode.value instanceof Token) {
1059
- continue;
1060
- }
1061
-
1062
- // find the last node which is affected by this match
1063
- for (
1064
- var k = currentNode;
1065
- k !== tokenList.tail && (p < to || typeof k.value === 'string');
1066
- k = k.next
1067
- ) {
1068
- removeCount++;
1069
- p += k.value.length;
1070
- }
1071
- removeCount--;
1072
-
1073
- // replace with the new match
1074
- str = text.slice(pos, p);
1075
- match.index -= pos;
1076
- } else {
1077
- match = matchPattern(pattern, 0, str, lookbehind);
1078
- if (!match) {
1079
- continue;
1080
- }
1081
- }
1082
-
1083
- // eslint-disable-next-line no-redeclare
1084
- var from = match.index;
1085
- var matchStr = match[0];
1086
- var before = str.slice(0, from);
1087
- var after = str.slice(from + matchStr.length);
1088
-
1089
- var reach = pos + str.length;
1090
- if (rematch && reach > rematch.reach) {
1091
- rematch.reach = reach;
1092
- }
1093
-
1094
- var removeFrom = currentNode.prev;
1095
-
1096
- if (before) {
1097
- removeFrom = addAfter(tokenList, removeFrom, before);
1098
- pos += before.length;
1099
- }
1100
-
1101
- removeRange(tokenList, removeFrom, removeCount);
1102
-
1103
- var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
1104
- currentNode = addAfter(tokenList, removeFrom, wrapped);
1105
-
1106
- if (after) {
1107
- addAfter(tokenList, currentNode, after);
1108
- }
1109
-
1110
- if (removeCount > 1) {
1111
- // at least one Token object was removed, so we have to do some rematching
1112
- // this can only happen if the current pattern is greedy
1113
-
1114
- /** @type {RematchOptions} */
1115
- var nestedRematch = {
1116
- cause: token + ',' + j,
1117
- reach: reach
1118
- };
1119
- matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
1120
-
1121
- // the reach might have been extended because of the rematching
1122
- if (rematch && nestedRematch.reach > rematch.reach) {
1123
- rematch.reach = nestedRematch.reach;
1124
- }
1125
- }
1126
- }
1127
- }
1128
- }
1129
- }
1130
-
1131
- /**
786
+ */ function l(e, t, a, n, r, u) {
787
+ for (var d in a) {
788
+ if (!a.hasOwnProperty(d) || !a[d]) {
789
+ continue;
790
+ }
791
+ var g = a[d];
792
+ g = Array.isArray(g) ? g : [ g ];
793
+ for (var f = 0; f < g.length; ++f) {
794
+ if (u && u.cause == d + "," + f) {
795
+ return;
796
+ }
797
+ var m = g[f];
798
+ var h = m.inside;
799
+ var v = !!m.lookbehind;
800
+ var b = !!m.greedy;
801
+ var y = m.alias;
802
+ if (b && !m.pattern.global) {
803
+ // Without the global flag, lastIndex won't work
804
+ var k = m.pattern.toString().match(/[imsuy]*$/)[0];
805
+ m.pattern = RegExp(m.pattern.source, k + "g");
806
+ }
807
+ /** @type {RegExp} */ var x = m.pattern || m;
808
+ for (// iterate the token list and keep track of the current token/string position
809
+ var S = n.next, A = r; S !== t.tail; A += S.value.length, S = S.next) {
810
+ if (u && A >= u.reach) {
811
+ break;
812
+ }
813
+ var F = S.value;
814
+ if (t.length > e.length) {
815
+ // Something went terribly wrong, ABORT, ABORT!
816
+ return;
817
+ }
818
+ if (F instanceof i) {
819
+ continue;
820
+ }
821
+ var w = 1;
822
+ // this is the to parameter of removeBetween
823
+ var E;
824
+ if (b) {
825
+ E = o(x, A, e, v);
826
+ if (!E) {
827
+ break;
828
+ }
829
+ var _ = E.index;
830
+ var O = E.index + E[0].length;
831
+ var T = A;
832
+ // find the node that contains the match
833
+ T += S.value.length;
834
+ while (_ >= T) {
835
+ S = S.next;
836
+ T += S.value.length;
837
+ }
838
+ // adjust pos (and p)
839
+ T -= S.value.length;
840
+ A = T;
841
+ // the current node is a Token, then the match starts inside another Token, which is invalid
842
+ if (S.value instanceof i) {
843
+ continue;
844
+ }
845
+ // find the last node which is affected by this match
846
+ for (var I = S; I !== t.tail && (T < O || typeof I.value === "string"); I = I.next) {
847
+ w++;
848
+ T += I.value.length;
849
+ }
850
+ w--;
851
+ // replace with the new match
852
+ F = e.slice(A, T);
853
+ E.index -= A;
854
+ } else {
855
+ E = o(x, 0, F, v);
856
+ if (!E) {
857
+ continue;
858
+ }
859
+ }
860
+ // eslint-disable-next-line no-redeclare
861
+ var _ = E.index;
862
+ var $ = E[0];
863
+ var N = F.slice(0, _);
864
+ var P = F.slice(_ + $.length);
865
+ var R = A + F.length;
866
+ if (u && R > u.reach) {
867
+ u.reach = R;
868
+ }
869
+ var C = S.prev;
870
+ if (N) {
871
+ C = c(t, C, N);
872
+ A += N.length;
873
+ }
874
+ p(t, C, w);
875
+ var D = new i(d, h ? s.tokenize($, h) : $, y, $);
876
+ S = c(t, C, D);
877
+ if (P) {
878
+ c(t, S, P);
879
+ }
880
+ if (w > 1) {
881
+ // at least one Token object was removed, so we have to do some rematching
882
+ // this can only happen if the current pattern is greedy
883
+ /** @type {RematchOptions} */
884
+ var j = {
885
+ cause: d + "," + f,
886
+ reach: R
887
+ };
888
+ l(e, t, a, S.prev, A, j);
889
+ // the reach might have been extended because of the rematching
890
+ if (u && j.reach > u.reach) {
891
+ u.reach = j.reach;
892
+ }
893
+ }
894
+ }
895
+ }
896
+ }
897
+ }
898
+ /**
1132
899
  * @typedef LinkedListNode
1133
900
  * @property {T} value
1134
901
  * @property {LinkedListNode<T> | null} prev The previous node.
@@ -1136,26 +903,27 @@ var Prism = (function (_self) {
1136
903
  * @template T
1137
904
  * @private
1138
905
  */
1139
-
1140
- /**
906
+ /**
1141
907
  * @template T
1142
908
  * @private
1143
- */
1144
- function LinkedList() {
1145
- /** @type {LinkedListNode<T>} */
1146
- var head = { value: null, prev: null, next: null };
1147
- /** @type {LinkedListNode<T>} */
1148
- var tail = { value: null, prev: head, next: null };
1149
- head.next = tail;
1150
-
1151
- /** @type {LinkedListNode<T>} */
1152
- this.head = head;
1153
- /** @type {LinkedListNode<T>} */
1154
- this.tail = tail;
1155
- this.length = 0;
1156
- }
1157
-
1158
- /**
909
+ */ function u() {
910
+ /** @type {LinkedListNode<T>} */
911
+ var e = {
912
+ value: null,
913
+ prev: null,
914
+ next: null
915
+ };
916
+ /** @type {LinkedListNode<T>} */ var t = {
917
+ value: null,
918
+ prev: e,
919
+ next: null
920
+ };
921
+ e.next = t;
922
+ /** @type {LinkedListNode<T>} */ this.head = e;
923
+ /** @type {LinkedListNode<T>} */ this.tail = t;
924
+ this.length = 0;
925
+ }
926
+ /**
1159
927
  * Adds a new node with the given value to the list.
1160
928
  *
1161
929
  * @param {LinkedList<T>} list
@@ -1163,127 +931,110 @@ var Prism = (function (_self) {
1163
931
  * @param {T} value
1164
932
  * @returns {LinkedListNode<T>} The added node.
1165
933
  * @template T
1166
- */
1167
- function addAfter(list, node, value) {
1168
- // assumes that node != list.tail && values.length >= 0
1169
- var next = node.next;
1170
-
1171
- var newNode = { value: value, prev: node, next: next };
1172
- node.next = newNode;
1173
- next.prev = newNode;
1174
- list.length++;
1175
-
1176
- return newNode;
1177
- }
1178
- /**
934
+ */ function c(e, t, a) {
935
+ // assumes that node != list.tail && values.length >= 0
936
+ var n = t.next;
937
+ var r = {
938
+ value: a,
939
+ prev: t,
940
+ next: n
941
+ };
942
+ t.next = r;
943
+ n.prev = r;
944
+ e.length++;
945
+ return r;
946
+ }
947
+ /**
1179
948
  * Removes `count` nodes after the given node. The given node will not be removed.
1180
949
  *
1181
950
  * @param {LinkedList<T>} list
1182
951
  * @param {LinkedListNode<T>} node
1183
952
  * @param {number} count
1184
953
  * @template T
1185
- */
1186
- function removeRange(list, node, count) {
1187
- var next = node.next;
1188
- for (var i = 0; i < count && next !== list.tail; i++) {
1189
- next = next.next;
1190
- }
1191
- node.next = next;
1192
- next.prev = node;
1193
- list.length -= i;
1194
- }
1195
- /**
954
+ */ function p(e, t, a) {
955
+ var n = t.next;
956
+ for (var r = 0; r < a && n !== e.tail; r++) {
957
+ n = n.next;
958
+ }
959
+ t.next = n;
960
+ n.prev = t;
961
+ e.length -= r;
962
+ }
963
+ /**
1196
964
  * @param {LinkedList<T>} list
1197
965
  * @returns {T[]}
1198
966
  * @template T
1199
- */
1200
- function toArray(list) {
1201
- var array = [];
1202
- var node = list.head.next;
1203
- while (node !== list.tail) {
1204
- array.push(node.value);
1205
- node = node.next;
1206
- }
1207
- return array;
1208
- }
1209
-
1210
-
1211
- if (!_self.document) {
1212
- if (!_self.addEventListener) {
1213
- // in Node.js
1214
- return _;
1215
- }
1216
-
1217
- if (!_.disableWorkerMessageHandler) {
1218
- // In worker
1219
- _self.addEventListener('message', function (evt) {
1220
- var message = JSON.parse(evt.data);
1221
- var lang = message.language;
1222
- var code = message.code;
1223
- var immediateClose = message.immediateClose;
1224
-
1225
- _self.postMessage(_.highlight(code, _.languages[lang], lang));
1226
- if (immediateClose) {
1227
- _self.close();
1228
- }
1229
- }, false);
1230
- }
1231
-
1232
- return _;
1233
- }
1234
-
1235
- // Get current script and highlight
1236
- var script = _.util.currentScript();
1237
-
1238
- if (script) {
1239
- _.filename = script.src;
1240
-
1241
- if (script.hasAttribute('data-manual')) {
1242
- _.manual = true;
1243
- }
1244
- }
1245
-
1246
- function highlightAutomaticallyCallback() {
1247
- if (!_.manual) {
1248
- _.highlightAll();
1249
- }
1250
- }
1251
-
1252
- if (!_.manual) {
1253
- // If the document state is "loading", then we'll use DOMContentLoaded.
1254
- // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
1255
- // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
1256
- // might take longer one animation frame to execute which can create a race condition where only some plugins have
1257
- // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
1258
- // See https://github.com/PrismJS/prism/issues/2102
1259
- var readyState = document.readyState;
1260
- if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
1261
- document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
1262
- } else {
1263
- if (window.requestAnimationFrame) {
1264
- window.requestAnimationFrame(highlightAutomaticallyCallback);
1265
- } else {
1266
- window.setTimeout(highlightAutomaticallyCallback, 16);
1267
- }
1268
- }
1269
- }
1270
-
1271
- return _;
1272
-
1273
- }(_self));
1274
-
1275
- if ( true && module.exports) {
1276
- module.exports = Prism;
1277
- }
1278
-
1279
- // hack for components to work correctly in node.js
1280
- if (typeof global !== 'undefined') {
1281
- global.Prism = Prism;
1282
- }
1283
-
1284
- // some additional documentation/types
1285
-
1286
- /**
967
+ */ function d(e) {
968
+ var t = [];
969
+ var a = e.head.next;
970
+ while (a !== e.tail) {
971
+ t.push(a.value);
972
+ a = a.next;
973
+ }
974
+ return t;
975
+ }
976
+ if (!e.document) {
977
+ if (!e.addEventListener) {
978
+ // in Node.js
979
+ return s;
980
+ }
981
+ if (!s.disableWorkerMessageHandler) {
982
+ // In worker
983
+ e.addEventListener("message", (function(t) {
984
+ var a = JSON.parse(t.data);
985
+ var n = a.language;
986
+ var r = a.code;
987
+ var i = a.immediateClose;
988
+ e.postMessage(s.highlight(r, s.languages[n], n));
989
+ if (i) {
990
+ e.close();
991
+ }
992
+ }), false);
993
+ }
994
+ return s;
995
+ }
996
+ // Get current script and highlight
997
+ var g = s.util.currentScript();
998
+ if (g) {
999
+ s.filename = g.src;
1000
+ if (g.hasAttribute("data-manual")) {
1001
+ s.manual = true;
1002
+ }
1003
+ }
1004
+ function f() {
1005
+ if (!s.manual) {
1006
+ s.highlightAll();
1007
+ }
1008
+ }
1009
+ if (!s.manual) {
1010
+ // If the document state is "loading", then we'll use DOMContentLoaded.
1011
+ // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
1012
+ // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
1013
+ // might take longer one animation frame to execute which can create a race condition where only some plugins have
1014
+ // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
1015
+ // See https://github.com/PrismJS/prism/issues/2102
1016
+ var m = document.readyState;
1017
+ if (m === "loading" || m === "interactive" && g && g.defer) {
1018
+ document.addEventListener("DOMContentLoaded", f);
1019
+ } else {
1020
+ if (t.requestAnimationFrame) {
1021
+ t.requestAnimationFrame(f);
1022
+ } else {
1023
+ t.setTimeout(f, 16);
1024
+ }
1025
+ }
1026
+ }
1027
+ return s;
1028
+ }(n);
1029
+ if (true && e.exports) {
1030
+ e.exports = r;
1031
+ }
1032
+ // hack for components to work correctly in node.js
1033
+ if (typeof a !== "undefined") {
1034
+ a.Prism = r;
1035
+ }
1036
+ // some additional documentation/types
1037
+ /**
1287
1038
  * The expansion of a simple `RegExp` literal to support additional properties.
1288
1039
  *
1289
1040
  * @typedef GrammarToken
@@ -1303,16 +1054,14 @@ if (typeof global !== 'undefined') {
1303
1054
  * @global
1304
1055
  * @public
1305
1056
  */
1306
-
1307
- /**
1057
+ /**
1308
1058
  * @typedef Grammar
1309
1059
  * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
1310
1060
  * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
1311
1061
  * @global
1312
1062
  * @public
1313
1063
  */
1314
-
1315
- /**
1064
+ /**
1316
1065
  * A function which will invoked after an element was successfully highlighted.
1317
1066
  *
1318
1067
  * @callback HighlightCallback
@@ -1321,133 +1070,117 @@ if (typeof global !== 'undefined') {
1321
1070
  * @global
1322
1071
  * @public
1323
1072
  */
1324
-
1325
- /**
1073
+ /**
1326
1074
  * @callback HookCallback
1327
1075
  * @param {Object<string, any>} env The environment variables of the hook.
1328
1076
  * @returns {void}
1329
1077
  * @global
1330
1078
  * @public
1331
1079
  */
1332
-
1333
- // https://www.json.org/json-en.html
1334
- Prism.languages.json = {
1335
- 'property': {
1336
- pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
1337
- lookbehind: true,
1338
- greedy: true
1339
- },
1340
- 'string': {
1341
- pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
1342
- lookbehind: true,
1343
- greedy: true
1344
- },
1345
- 'comment': {
1346
- pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
1347
- greedy: true
1348
- },
1349
- 'number': /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
1350
- 'punctuation': /[{}[\],]/,
1351
- 'operator': /:/,
1352
- 'boolean': /\b(?:true|false)\b/,
1353
- 'null': {
1354
- pattern: /\bnull\b/,
1355
- alias: 'keyword'
1356
- }
1357
- };
1358
-
1359
- Prism.languages.webmanifest = Prism.languages.json;
1360
-
1361
- Prism.languages.markup = {
1362
- 'comment': {
1363
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1364
- greedy: true
1365
- },
1366
- 'prolog': {
1367
- pattern: /<\?[\s\S]+?\?>/,
1368
- greedy: true
1369
- },
1370
- 'doctype': {
1371
- // https://www.w3.org/TR/xml/#NT-doctypedecl
1372
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1373
- greedy: true,
1374
- inside: {
1375
- 'internal-subset': {
1376
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1377
- lookbehind: true,
1378
- greedy: true,
1379
- inside: null // see below
1380
- },
1381
- 'string': {
1382
- pattern: /"[^"]*"|'[^']*'/,
1383
- greedy: true
1384
- },
1385
- 'punctuation': /^<!|>$|[[\]]/,
1386
- 'doctype-tag': /^DOCTYPE/i,
1387
- 'name': /[^\s<>'"]+/
1388
- }
1389
- },
1390
- 'cdata': {
1391
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1392
- greedy: true
1393
- },
1394
- 'tag': {
1395
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1396
- greedy: true,
1397
- inside: {
1398
- 'tag': {
1399
- pattern: /^<\/?[^\s>\/]+/,
1400
- inside: {
1401
- 'punctuation': /^<\/?/,
1402
- 'namespace': /^[^\s>\/:]+:/
1403
- }
1404
- },
1405
- 'special-attr': [],
1406
- 'attr-value': {
1407
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1408
- inside: {
1409
- 'punctuation': [
1410
- {
1411
- pattern: /^=/,
1412
- alias: 'attr-equals'
1413
- },
1414
- /"|'/
1415
- ]
1416
- }
1417
- },
1418
- 'punctuation': /\/?>/,
1419
- 'attr-name': {
1420
- pattern: /[^\s>\/]+/,
1421
- inside: {
1422
- 'namespace': /^[^\s>\/:]+:/
1423
- }
1424
- }
1425
-
1426
- }
1427
- },
1428
- 'entity': [
1429
- {
1430
- pattern: /&[\da-z]{1,8};/i,
1431
- alias: 'named-entity'
1432
- },
1433
- /&#x?[\da-f]{1,8};/i
1434
- ]
1435
- };
1436
-
1437
- Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
1438
- Prism.languages.markup['entity'];
1439
- Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
1440
-
1441
- // Plugin to make entity title show the real entity, idea by Roman Komarov
1442
- Prism.hooks.add('wrap', function (env) {
1443
-
1444
- if (env.type === 'entity') {
1445
- env.attributes['title'] = env.content.replace(/&amp;/, '&');
1446
- }
1447
- });
1448
-
1449
- Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1450
- /**
1080
+ // https://www.json.org/json-en.html
1081
+ r.languages.json = {
1082
+ property: {
1083
+ pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,
1084
+ lookbehind: true,
1085
+ greedy: true
1086
+ },
1087
+ string: {
1088
+ pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,
1089
+ lookbehind: true,
1090
+ greedy: true
1091
+ },
1092
+ comment: {
1093
+ pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,
1094
+ greedy: true
1095
+ },
1096
+ number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
1097
+ punctuation: /[{}[\],]/,
1098
+ operator: /:/,
1099
+ boolean: /\b(?:true|false)\b/,
1100
+ null: {
1101
+ pattern: /\bnull\b/,
1102
+ alias: "keyword"
1103
+ }
1104
+ };
1105
+ r.languages.webmanifest = r.languages.json;
1106
+ r.languages.markup = {
1107
+ comment: {
1108
+ pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1109
+ greedy: true
1110
+ },
1111
+ prolog: {
1112
+ pattern: /<\?[\s\S]+?\?>/,
1113
+ greedy: true
1114
+ },
1115
+ doctype: {
1116
+ // https://www.w3.org/TR/xml/#NT-doctypedecl
1117
+ pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1118
+ greedy: true,
1119
+ inside: {
1120
+ "internal-subset": {
1121
+ pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1122
+ lookbehind: true,
1123
+ greedy: true,
1124
+ inside: null
1125
+ },
1126
+ string: {
1127
+ pattern: /"[^"]*"|'[^']*'/,
1128
+ greedy: true
1129
+ },
1130
+ punctuation: /^<!|>$|[[\]]/,
1131
+ "doctype-tag": /^DOCTYPE/i,
1132
+ name: /[^\s<>'"]+/
1133
+ }
1134
+ },
1135
+ cdata: {
1136
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1137
+ greedy: true
1138
+ },
1139
+ tag: {
1140
+ pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1141
+ greedy: true,
1142
+ inside: {
1143
+ tag: {
1144
+ pattern: /^<\/?[^\s>\/]+/,
1145
+ inside: {
1146
+ punctuation: /^<\/?/,
1147
+ namespace: /^[^\s>\/:]+:/
1148
+ }
1149
+ },
1150
+ "special-attr": [],
1151
+ "attr-value": {
1152
+ pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1153
+ inside: {
1154
+ punctuation: [ {
1155
+ pattern: /^=/,
1156
+ alias: "attr-equals"
1157
+ }, /"|'/ ]
1158
+ }
1159
+ },
1160
+ punctuation: /\/?>/,
1161
+ "attr-name": {
1162
+ pattern: /[^\s>\/]+/,
1163
+ inside: {
1164
+ namespace: /^[^\s>\/:]+:/
1165
+ }
1166
+ }
1167
+ }
1168
+ },
1169
+ entity: [ {
1170
+ pattern: /&[\da-z]{1,8};/i,
1171
+ alias: "named-entity"
1172
+ }, /&#x?[\da-f]{1,8};/i ]
1173
+ };
1174
+ r.languages.markup["tag"].inside["attr-value"].inside["entity"] = r.languages.markup["entity"];
1175
+ r.languages.markup["doctype"].inside["internal-subset"].inside = r.languages.markup;
1176
+ // Plugin to make entity title show the real entity, idea by Roman Komarov
1177
+ r.hooks.add("wrap", (function(e) {
1178
+ if (e.type === "entity") {
1179
+ e.attributes["title"] = e.content.replace(/&amp;/, "&");
1180
+ }
1181
+ }));
1182
+ Object.defineProperty(r.languages.markup.tag, "addInlined", {
1183
+ /**
1451
1184
  * Adds an inlined language to markup.
1452
1185
  *
1453
1186
  * An example of an inlined language is CSS with `<style>` tags.
@@ -1458,39 +1191,38 @@ Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1458
1191
  * @example
1459
1192
  * addInlined('style', 'css');
1460
1193
  */
1461
- value: function addInlined(tagName, lang) {
1462
- var includedCdataInside = {};
1463
- includedCdataInside['language-' + lang] = {
1464
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1465
- lookbehind: true,
1466
- inside: Prism.languages[lang]
1467
- };
1468
- includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
1469
-
1470
- var inside = {
1471
- 'included-cdata': {
1472
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1473
- inside: includedCdataInside
1474
- }
1475
- };
1476
- inside['language-' + lang] = {
1477
- pattern: /[\s\S]+/,
1478
- inside: Prism.languages[lang]
1479
- };
1480
-
1481
- var def = {};
1482
- def[tagName] = {
1483
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
1484
- lookbehind: true,
1485
- greedy: true,
1486
- inside: inside
1487
- };
1488
-
1489
- Prism.languages.insertBefore('markup', 'cdata', def);
1490
- }
1491
- });
1492
- Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1493
- /**
1194
+ value: function e(t, a) {
1195
+ var n = {};
1196
+ n["language-" + a] = {
1197
+ pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1198
+ lookbehind: true,
1199
+ inside: r.languages[a]
1200
+ };
1201
+ n["cdata"] = /^<!\[CDATA\[|\]\]>$/i;
1202
+ var s = {
1203
+ "included-cdata": {
1204
+ pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1205
+ inside: n
1206
+ }
1207
+ };
1208
+ s["language-" + a] = {
1209
+ pattern: /[\s\S]+/,
1210
+ inside: r.languages[a]
1211
+ };
1212
+ var i = {};
1213
+ i[t] = {
1214
+ pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, (function() {
1215
+ return t;
1216
+ })), "i"),
1217
+ lookbehind: true,
1218
+ greedy: true,
1219
+ inside: s
1220
+ };
1221
+ r.languages.insertBefore("markup", "cdata", i);
1222
+ }
1223
+ });
1224
+ Object.defineProperty(r.languages.markup.tag, "addAttribute", {
1225
+ /**
1494
1226
  * Adds an pattern to highlight languages embedded in HTML attributes.
1495
1227
  *
1496
1228
  * An example of an inlined language is CSS with `style` attributes.
@@ -1501,1154 +1233,1058 @@ Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1501
1233
  * @example
1502
1234
  * addAttribute('style', 'css');
1503
1235
  */
1504
- value: function (attrName, lang) {
1505
- Prism.languages.markup.tag.inside['special-attr'].push({
1506
- pattern: RegExp(
1507
- /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1508
- 'i'
1509
- ),
1510
- lookbehind: true,
1511
- inside: {
1512
- 'attr-name': /^[^\s=]+/,
1513
- 'attr-value': {
1514
- pattern: /=[\s\S]+/,
1515
- inside: {
1516
- 'value': {
1517
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1518
- lookbehind: true,
1519
- alias: [lang, 'language-' + lang],
1520
- inside: Prism.languages[lang]
1521
- },
1522
- 'punctuation': [
1523
- {
1524
- pattern: /^=/,
1525
- alias: 'attr-equals'
1526
- },
1527
- /"|'/
1528
- ]
1529
- }
1530
- }
1531
- }
1532
- });
1533
- }
1534
- });
1535
-
1536
- Prism.languages.html = Prism.languages.markup;
1537
- Prism.languages.mathml = Prism.languages.markup;
1538
- Prism.languages.svg = Prism.languages.markup;
1539
-
1540
- Prism.languages.xml = Prism.languages.extend('markup', {});
1541
- Prism.languages.ssml = Prism.languages.xml;
1542
- Prism.languages.atom = Prism.languages.xml;
1543
- Prism.languages.rss = Prism.languages.xml;
1544
-
1545
- Prism.languages.clike = {
1546
- 'comment': [
1547
- {
1548
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1549
- lookbehind: true,
1550
- greedy: true
1551
- },
1552
- {
1553
- pattern: /(^|[^\\:])\/\/.*/,
1554
- lookbehind: true,
1555
- greedy: true
1556
- }
1557
- ],
1558
- 'string': {
1559
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1560
- greedy: true
1561
- },
1562
- 'class-name': {
1563
- pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
1564
- lookbehind: true,
1565
- inside: {
1566
- 'punctuation': /[.\\]/
1567
- }
1568
- },
1569
- 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
1570
- 'boolean': /\b(?:true|false)\b/,
1571
- 'function': /\b\w+(?=\()/,
1572
- 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1573
- 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1574
- 'punctuation': /[{}[\];(),.:]/
1575
- };
1576
-
1577
- Prism.languages.javascript = Prism.languages.extend('clike', {
1578
- 'class-name': [
1579
- Prism.languages.clike['class-name'],
1580
- {
1581
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,
1582
- lookbehind: true
1583
- }
1584
- ],
1585
- 'keyword': [
1586
- {
1587
- pattern: /((?:^|\})\s*)catch\b/,
1588
- lookbehind: true
1589
- },
1590
- {
1591
- 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/,
1592
- lookbehind: true
1593
- },
1594
- ],
1595
- // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1596
- 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1597
- 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
1598
- 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1599
- });
1600
-
1601
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
1602
-
1603
- Prism.languages.insertBefore('javascript', 'keyword', {
1604
- 'regex': {
1605
- // eslint-disable-next-line regexp/no-dupe-characters-character-class
1606
- pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
1607
- lookbehind: true,
1608
- greedy: true,
1609
- inside: {
1610
- 'regex-source': {
1611
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1612
- lookbehind: true,
1613
- alias: 'language-regex',
1614
- inside: Prism.languages.regex
1615
- },
1616
- 'regex-delimiter': /^\/|\/$/,
1617
- 'regex-flags': /^[a-z]+$/,
1618
- }
1619
- },
1620
- // This must be declared before keyword because we use "function" inside the look-forward
1621
- 'function-variable': {
1622
- 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*=>))/,
1623
- alias: 'function'
1624
- },
1625
- 'parameter': [
1626
- {
1627
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1628
- lookbehind: true,
1629
- inside: Prism.languages.javascript
1630
- },
1631
- {
1632
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1633
- lookbehind: true,
1634
- inside: Prism.languages.javascript
1635
- },
1636
- {
1637
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1638
- lookbehind: true,
1639
- inside: Prism.languages.javascript
1640
- },
1641
- {
1642
- 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*\{)/,
1643
- lookbehind: true,
1644
- inside: Prism.languages.javascript
1645
- }
1646
- ],
1647
- 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1648
- });
1649
-
1650
- Prism.languages.insertBefore('javascript', 'string', {
1651
- 'hashbang': {
1652
- pattern: /^#!.*/,
1653
- greedy: true,
1654
- alias: 'comment'
1655
- },
1656
- 'template-string': {
1657
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1658
- greedy: true,
1659
- inside: {
1660
- 'template-punctuation': {
1661
- pattern: /^`|`$/,
1662
- alias: 'string'
1663
- },
1664
- 'interpolation': {
1665
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1666
- lookbehind: true,
1667
- inside: {
1668
- 'interpolation-punctuation': {
1669
- pattern: /^\$\{|\}$/,
1670
- alias: 'punctuation'
1671
- },
1672
- rest: Prism.languages.javascript
1673
- }
1674
- },
1675
- 'string': /[\s\S]+/
1676
- }
1677
- }
1678
- });
1679
-
1680
- if (Prism.languages.markup) {
1681
- Prism.languages.markup.tag.addInlined('script', 'javascript');
1682
-
1683
- // add attribute support for all DOM events.
1684
- // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
1685
- Prism.languages.markup.tag.addAttribute(
1686
- /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,
1687
- 'javascript'
1688
- );
1689
- }
1690
-
1691
- Prism.languages.js = Prism.languages.javascript;
1692
-
1693
- (function (Prism) {
1694
-
1695
- var javascript = Prism.util.clone(Prism.languages.javascript);
1696
-
1697
- var space = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source;
1698
- var braces = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source;
1699
- var spread = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
1700
-
1701
- /**
1236
+ value: function(e, t) {
1237
+ r.languages.markup.tag.inside["special-attr"].push({
1238
+ pattern: RegExp(/(^|["'\s])/.source + "(?:" + e + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"),
1239
+ lookbehind: true,
1240
+ inside: {
1241
+ "attr-name": /^[^\s=]+/,
1242
+ "attr-value": {
1243
+ pattern: /=[\s\S]+/,
1244
+ inside: {
1245
+ value: {
1246
+ pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1247
+ lookbehind: true,
1248
+ alias: [ t, "language-" + t ],
1249
+ inside: r.languages[t]
1250
+ },
1251
+ punctuation: [ {
1252
+ pattern: /^=/,
1253
+ alias: "attr-equals"
1254
+ }, /"|'/ ]
1255
+ }
1256
+ }
1257
+ }
1258
+ });
1259
+ }
1260
+ });
1261
+ r.languages.html = r.languages.markup;
1262
+ r.languages.mathml = r.languages.markup;
1263
+ r.languages.svg = r.languages.markup;
1264
+ r.languages.xml = r.languages.extend("markup", {});
1265
+ r.languages.ssml = r.languages.xml;
1266
+ r.languages.atom = r.languages.xml;
1267
+ r.languages.rss = r.languages.xml;
1268
+ r.languages.clike = {
1269
+ comment: [ {
1270
+ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1271
+ lookbehind: true,
1272
+ greedy: true
1273
+ }, {
1274
+ pattern: /(^|[^\\:])\/\/.*/,
1275
+ lookbehind: true,
1276
+ greedy: true
1277
+ } ],
1278
+ string: {
1279
+ pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1280
+ greedy: true
1281
+ },
1282
+ "class-name": {
1283
+ pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,
1284
+ lookbehind: true,
1285
+ inside: {
1286
+ punctuation: /[.\\]/
1287
+ }
1288
+ },
1289
+ keyword: /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,
1290
+ boolean: /\b(?:true|false)\b/,
1291
+ function: /\b\w+(?=\()/,
1292
+ number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1293
+ operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1294
+ punctuation: /[{}[\];(),.:]/
1295
+ };
1296
+ r.languages.javascript = r.languages.extend("clike", {
1297
+ "class-name": [ r.languages.clike["class-name"], {
1298
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,
1299
+ lookbehind: true
1300
+ } ],
1301
+ keyword: [ {
1302
+ pattern: /((?:^|\})\s*)catch\b/,
1303
+ lookbehind: true
1304
+ }, {
1305
+ 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/,
1306
+ lookbehind: true
1307
+ } ],
1308
+ // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1309
+ function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1310
+ number: /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,
1311
+ operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
1312
+ });
1313
+ r.languages.javascript["class-name"][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
1314
+ r.languages.insertBefore("javascript", "keyword", {
1315
+ regex: {
1316
+ // eslint-disable-next-line regexp/no-dupe-characters-character-class
1317
+ pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,
1318
+ lookbehind: true,
1319
+ greedy: true,
1320
+ inside: {
1321
+ "regex-source": {
1322
+ pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
1323
+ lookbehind: true,
1324
+ alias: "language-regex",
1325
+ inside: r.languages.regex
1326
+ },
1327
+ "regex-delimiter": /^\/|\/$/,
1328
+ "regex-flags": /^[a-z]+$/
1329
+ }
1330
+ },
1331
+ // This must be declared before keyword because we use "function" inside the look-forward
1332
+ "function-variable": {
1333
+ 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*=>))/,
1334
+ alias: "function"
1335
+ },
1336
+ parameter: [ {
1337
+ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
1338
+ lookbehind: true,
1339
+ inside: r.languages.javascript
1340
+ }, {
1341
+ pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
1342
+ lookbehind: true,
1343
+ inside: r.languages.javascript
1344
+ }, {
1345
+ pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
1346
+ lookbehind: true,
1347
+ inside: r.languages.javascript
1348
+ }, {
1349
+ 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*\{)/,
1350
+ lookbehind: true,
1351
+ inside: r.languages.javascript
1352
+ } ],
1353
+ constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
1354
+ });
1355
+ r.languages.insertBefore("javascript", "string", {
1356
+ hashbang: {
1357
+ pattern: /^#!.*/,
1358
+ greedy: true,
1359
+ alias: "comment"
1360
+ },
1361
+ "template-string": {
1362
+ pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
1363
+ greedy: true,
1364
+ inside: {
1365
+ "template-punctuation": {
1366
+ pattern: /^`|`$/,
1367
+ alias: "string"
1368
+ },
1369
+ interpolation: {
1370
+ pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
1371
+ lookbehind: true,
1372
+ inside: {
1373
+ "interpolation-punctuation": {
1374
+ pattern: /^\$\{|\}$/,
1375
+ alias: "punctuation"
1376
+ },
1377
+ rest: r.languages.javascript
1378
+ }
1379
+ },
1380
+ string: /[\s\S]+/
1381
+ }
1382
+ }
1383
+ });
1384
+ if (r.languages.markup) {
1385
+ r.languages.markup.tag.addInlined("script", "javascript");
1386
+ // add attribute support for all DOM events.
1387
+ // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
1388
+ r.languages.markup.tag.addAttribute(/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, "javascript");
1389
+ }
1390
+ r.languages.js = r.languages.javascript;
1391
+ (function(e) {
1392
+ var t = e.util.clone(e.languages.javascript);
1393
+ var a = /(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source;
1394
+ var n = /(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source;
1395
+ var r = /(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;
1396
+ /**
1702
1397
  * @param {string} source
1703
1398
  * @param {string} [flags]
1704
- */
1705
- function re(source, flags) {
1706
- source = source
1707
- .replace(/<S>/g, function () { return space; })
1708
- .replace(/<BRACES>/g, function () { return braces; })
1709
- .replace(/<SPREAD>/g, function () { return spread; });
1710
- return RegExp(source, flags);
1711
- }
1712
-
1713
- spread = re(spread).source;
1714
-
1715
-
1716
- Prism.languages.jsx = Prism.languages.extend('markup', javascript);
1717
- Prism.languages.jsx.tag.pattern = re(
1718
- /<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source
1719
- );
1720
-
1721
- Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/i;
1722
- Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/i;
1723
- Prism.languages.jsx.tag.inside['tag'].inside['class-name'] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/;
1724
- Prism.languages.jsx.tag.inside['comment'] = javascript['comment'];
1725
-
1726
- Prism.languages.insertBefore('inside', 'attr-name', {
1727
- 'spread': {
1728
- pattern: re(/<SPREAD>/.source),
1729
- inside: Prism.languages.jsx
1730
- }
1731
- }, Prism.languages.jsx.tag);
1732
-
1733
- Prism.languages.insertBefore('inside', 'special-attr', {
1734
- 'script': {
1735
- // Allow for two levels of nesting
1736
- pattern: re(/=<BRACES>/.source),
1737
- inside: {
1738
- 'script-punctuation': {
1739
- pattern: /^=(?=\{)/,
1740
- alias: 'punctuation'
1741
- },
1742
- rest: Prism.languages.jsx
1743
- },
1744
- 'alias': 'language-javascript'
1745
- }
1746
- }, Prism.languages.jsx.tag);
1747
-
1748
- // The following will handle plain text inside tags
1749
- var stringifyToken = function (token) {
1750
- if (!token) {
1751
- return '';
1752
- }
1753
- if (typeof token === 'string') {
1754
- return token;
1755
- }
1756
- if (typeof token.content === 'string') {
1757
- return token.content;
1758
- }
1759
- return token.content.map(stringifyToken).join('');
1760
- };
1761
-
1762
- var walkTokens = function (tokens) {
1763
- var openedTags = [];
1764
- for (var i = 0; i < tokens.length; i++) {
1765
- var token = tokens[i];
1766
- var notTagNorBrace = false;
1767
-
1768
- if (typeof token !== 'string') {
1769
- if (token.type === 'tag' && token.content[0] && token.content[0].type === 'tag') {
1770
- // We found a tag, now find its kind
1771
-
1772
- if (token.content[0].content[0].content === '</') {
1773
- // Closing tag
1774
- if (openedTags.length > 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1])) {
1775
- // Pop matching opening tag
1776
- openedTags.pop();
1777
- }
1778
- } else {
1779
- if (token.content[token.content.length - 1].content === '/>') {
1780
- // Autoclosed tag, ignore
1781
- } else {
1782
- // Opening tag
1783
- openedTags.push({
1784
- tagName: stringifyToken(token.content[0].content[1]),
1785
- openedBraces: 0
1786
- });
1787
- }
1788
- }
1789
- } else if (openedTags.length > 0 && token.type === 'punctuation' && token.content === '{') {
1790
-
1791
- // Here we might have entered a JSX context inside a tag
1792
- openedTags[openedTags.length - 1].openedBraces++;
1793
-
1794
- } else if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === 'punctuation' && token.content === '}') {
1795
-
1796
- // Here we might have left a JSX context inside a tag
1797
- openedTags[openedTags.length - 1].openedBraces--;
1798
-
1799
- } else {
1800
- notTagNorBrace = true;
1801
- }
1802
- }
1803
- if (notTagNorBrace || typeof token === 'string') {
1804
- if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) {
1805
- // Here we are inside a tag, and not inside a JSX context.
1806
- // That's plain text: drop any tokens matched.
1807
- var plainText = stringifyToken(token);
1808
-
1809
- // And merge text with adjacent text
1810
- if (i < tokens.length - 1 && (typeof tokens[i + 1] === 'string' || tokens[i + 1].type === 'plain-text')) {
1811
- plainText += stringifyToken(tokens[i + 1]);
1812
- tokens.splice(i + 1, 1);
1813
- }
1814
- if (i > 0 && (typeof tokens[i - 1] === 'string' || tokens[i - 1].type === 'plain-text')) {
1815
- plainText = stringifyToken(tokens[i - 1]) + plainText;
1816
- tokens.splice(i - 1, 1);
1817
- i--;
1818
- }
1819
-
1820
- tokens[i] = new Prism.Token('plain-text', plainText, null, plainText);
1821
- }
1822
- }
1823
-
1824
- if (token.content && typeof token.content !== 'string') {
1825
- walkTokens(token.content);
1826
- }
1827
- }
1828
- };
1829
-
1830
- Prism.hooks.add('after-tokenize', function (env) {
1831
- if (env.language !== 'jsx' && env.language !== 'tsx') {
1832
- return;
1833
- }
1834
- walkTokens(env.tokens);
1835
- });
1836
-
1837
- }(Prism));
1838
-
1839
- (function (Prism) {
1840
-
1841
- Prism.languages.typescript = Prism.languages.extend('javascript', {
1842
- 'class-name': {
1843
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
1844
- lookbehind: true,
1845
- greedy: true,
1846
- inside: null // see below
1847
- },
1848
- 'builtin': /\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/,
1849
- });
1850
-
1851
- // The keywords TypeScript adds to JavaScript
1852
- Prism.languages.typescript.keyword.push(
1853
- /\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,
1854
- // keywords that have to be followed by an identifier
1855
- /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
1856
- // This is for `import type *, {}`
1857
- /\btype\b(?=\s*(?:[\{*]|$))/
1858
- );
1859
-
1860
- // doesn't work with TS because TS is too complex
1861
- delete Prism.languages.typescript['parameter'];
1862
-
1863
- // a version of typescript specifically for highlighting types
1864
- var typeInside = Prism.languages.extend('typescript', {});
1865
- delete typeInside['class-name'];
1866
-
1867
- Prism.languages.typescript['class-name'].inside = typeInside;
1868
-
1869
- Prism.languages.insertBefore('typescript', 'function', {
1870
- 'decorator': {
1871
- pattern: /@[$\w\xA0-\uFFFF]+/,
1872
- inside: {
1873
- 'at': {
1874
- pattern: /^@/,
1875
- alias: 'operator'
1876
- },
1877
- 'function': /^[\s\S]+/
1878
- }
1879
- },
1880
- 'generic-function': {
1881
- // e.g. foo<T extends "bar" | "baz">( ...
1882
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
1883
- greedy: true,
1884
- inside: {
1885
- 'function': /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
1886
- 'generic': {
1887
- pattern: /<[\s\S]+/, // everything after the first <
1888
- alias: 'class-name',
1889
- inside: typeInside
1890
- }
1891
- }
1892
- }
1893
- });
1894
-
1895
- Prism.languages.ts = Prism.languages.typescript;
1896
-
1897
- }(Prism));
1898
-
1899
- (function (Prism) {
1900
- var typescript = Prism.util.clone(Prism.languages.typescript);
1901
- Prism.languages.tsx = Prism.languages.extend('jsx', typescript);
1902
-
1903
- // This will prevent collisions between TSX tags and TS generic types.
1904
- // Idea by https://github.com/karlhorky
1905
- // Discussion: https://github.com/PrismJS/prism/issues/2594#issuecomment-710666928
1906
- var tag = Prism.languages.tsx.tag;
1907
- tag.pattern = RegExp(/(^|[^\w$]|(?=<\/))/.source + '(?:' + tag.pattern.source + ')', tag.pattern.flags);
1908
- tag.lookbehind = true;
1909
- }(Prism));
1910
-
1911
- (function (Prism) {
1912
-
1913
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1914
-
1915
- Prism.languages.css = {
1916
- 'comment': /\/\*[\s\S]*?\*\//,
1917
- 'atrule': {
1918
- pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
1919
- inside: {
1920
- 'rule': /^@[\w-]+/,
1921
- 'selector-function-argument': {
1922
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1923
- lookbehind: true,
1924
- alias: 'selector'
1925
- },
1926
- 'keyword': {
1927
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1928
- lookbehind: true
1929
- }
1930
- // See rest below
1931
- }
1932
- },
1933
- 'url': {
1934
- // https://drafts.csswg.org/css-values-3/#urls
1935
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
1936
- greedy: true,
1937
- inside: {
1938
- 'function': /^url/i,
1939
- 'punctuation': /^\(|\)$/,
1940
- 'string': {
1941
- pattern: RegExp('^' + string.source + '$'),
1942
- alias: 'url'
1943
- }
1944
- }
1945
- },
1946
- 'selector': {
1947
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
1948
- lookbehind: true
1949
- },
1950
- 'string': {
1951
- pattern: string,
1952
- greedy: true
1953
- },
1954
- 'property': {
1955
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1956
- lookbehind: true
1957
- },
1958
- 'important': /!important\b/i,
1959
- 'function': {
1960
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1961
- lookbehind: true
1962
- },
1963
- 'punctuation': /[(){};:,]/
1964
- };
1965
-
1966
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
1967
-
1968
- var markup = Prism.languages.markup;
1969
- if (markup) {
1970
- markup.tag.addInlined('style', 'css');
1971
- markup.tag.addAttribute('style', 'css');
1972
- }
1973
-
1974
- }(Prism));
1975
-
1976
- (function (Prism) {
1977
- // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
1978
- // + LC_ALL, RANDOM, REPLY, SECONDS.
1979
- // + make sure PS1..4 are here as they are not always set,
1980
- // - some useless things.
1981
- var envVars = '\\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';
1982
-
1983
- var commandAfterHeredoc = {
1984
- pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
1985
- lookbehind: true,
1986
- alias: 'punctuation', // this looks reasonably well in all themes
1987
- inside: null // see below
1988
- };
1989
-
1990
- var insideString = {
1991
- 'bash': commandAfterHeredoc,
1992
- 'environment': {
1993
- pattern: RegExp('\\$' + envVars),
1994
- alias: 'constant'
1995
- },
1996
- 'variable': [
1997
- // [0]: Arithmetic Environment
1998
- {
1999
- pattern: /\$?\(\([\s\S]+?\)\)/,
2000
- greedy: true,
2001
- inside: {
2002
- // If there is a $ sign at the beginning highlight $(( and )) as variable
2003
- 'variable': [
2004
- {
2005
- pattern: /(^\$\(\([\s\S]+)\)\)/,
2006
- lookbehind: true
2007
- },
2008
- /^\$\(\(/
2009
- ],
2010
- 'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
2011
- // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
2012
- 'operator': /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
2013
- // If there is no $ sign at the beginning highlight (( and )) as punctuation
2014
- 'punctuation': /\(\(?|\)\)?|,|;/
2015
- }
2016
- },
2017
- // [1]: Command Substitution
2018
- {
2019
- pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
2020
- greedy: true,
2021
- inside: {
2022
- 'variable': /^\$\(|^`|\)$|`$/
2023
- }
2024
- },
2025
- // [2]: Brace expansion
2026
- {
2027
- pattern: /\$\{[^}]+\}/,
2028
- greedy: true,
2029
- inside: {
2030
- 'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
2031
- 'punctuation': /[\[\]]/,
2032
- 'environment': {
2033
- pattern: RegExp('(\\{)' + envVars),
2034
- lookbehind: true,
2035
- alias: 'constant'
2036
- }
2037
- }
2038
- },
2039
- /\$(?:\w+|[#?*!@$])/
2040
- ],
2041
- // Escape sequences from echo and printf's manuals, and escaped quotes.
2042
- 'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/
2043
- };
2044
-
2045
- Prism.languages.bash = {
2046
- 'shebang': {
2047
- pattern: /^#!\s*\/.*/,
2048
- alias: 'important'
2049
- },
2050
- 'comment': {
2051
- pattern: /(^|[^"{\\$])#.*/,
2052
- lookbehind: true
2053
- },
2054
- 'function-name': [
2055
- // a) function foo {
2056
- // b) foo() {
2057
- // c) function foo() {
2058
- // but not “foo {”
2059
- {
2060
- // a) and c)
2061
- pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
2062
- lookbehind: true,
2063
- alias: 'function'
2064
- },
2065
- {
2066
- // b)
2067
- pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
2068
- alias: 'function'
2069
- }
2070
- ],
2071
- // Highlight variable names as variables in for and select beginnings.
2072
- 'for-or-select': {
2073
- pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
2074
- alias: 'variable',
2075
- lookbehind: true
2076
- },
2077
- // Highlight variable names as variables in the left-hand part
2078
- // of assignments (“=” and “+=”).
2079
- 'assign-left': {
2080
- pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,
2081
- inside: {
2082
- 'environment': {
2083
- pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars),
2084
- lookbehind: true,
2085
- alias: 'constant'
2086
- }
2087
- },
2088
- alias: 'variable',
2089
- lookbehind: true
2090
- },
2091
- 'string': [
2092
- // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
2093
- {
2094
- pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
2095
- lookbehind: true,
2096
- greedy: true,
2097
- inside: insideString
2098
- },
2099
- // Here-document with quotes around the tag
2100
- // → No expansion (so no “inside”).
2101
- {
2102
- pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
2103
- lookbehind: true,
2104
- greedy: true,
2105
- inside: {
2106
- 'bash': commandAfterHeredoc
2107
- }
2108
- },
2109
- // “Normal” string
2110
- {
2111
- // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
2112
- pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
2113
- lookbehind: true,
2114
- greedy: true,
2115
- inside: insideString
2116
- },
2117
- {
2118
- // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
2119
- pattern: /(^|[^$\\])'[^']*'/,
2120
- lookbehind: true,
2121
- greedy: true
2122
- },
2123
- {
2124
- // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
2125
- pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
2126
- greedy: true,
2127
- inside: {
2128
- 'entity': insideString.entity
2129
- }
2130
- }
2131
- ],
2132
- 'environment': {
2133
- pattern: RegExp('\\$?' + envVars),
2134
- alias: 'constant'
2135
- },
2136
- 'variable': insideString.variable,
2137
- 'function': {
2138
- pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|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|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|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|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|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|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|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
2139
- lookbehind: true
2140
- },
2141
- 'keyword': {
2142
- pattern: /(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,
2143
- lookbehind: true
2144
- },
2145
- // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
2146
- 'builtin': {
2147
- pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,
2148
- lookbehind: true,
2149
- // Alias added to make those easier to distinguish from strings.
2150
- alias: 'class-name'
2151
- },
2152
- 'boolean': {
2153
- pattern: /(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,
2154
- lookbehind: true
2155
- },
2156
- 'file-descriptor': {
2157
- pattern: /\B&\d\b/,
2158
- alias: 'important'
2159
- },
2160
- 'operator': {
2161
- // Lots of redirections here, but not just that.
2162
- pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
2163
- inside: {
2164
- 'file-descriptor': {
2165
- pattern: /^\d/,
2166
- alias: 'important'
2167
- }
2168
- }
2169
- },
2170
- 'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
2171
- 'number': {
2172
- pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
2173
- lookbehind: true
2174
- }
2175
- };
2176
-
2177
- commandAfterHeredoc.inside = Prism.languages.bash;
2178
-
2179
- /* Patterns in command substitution. */
2180
- var toBeCopied = [
2181
- 'comment',
2182
- 'function-name',
2183
- 'for-or-select',
2184
- 'assign-left',
2185
- 'string',
2186
- 'environment',
2187
- 'function',
2188
- 'keyword',
2189
- 'builtin',
2190
- 'boolean',
2191
- 'file-descriptor',
2192
- 'operator',
2193
- 'punctuation',
2194
- 'number'
2195
- ];
2196
- var inside = insideString.variable[1].inside;
2197
- for (var i = 0; i < toBeCopied.length; i++) {
2198
- inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];
2199
- }
2200
-
2201
- Prism.languages.shell = Prism.languages.bash;
2202
- }(Prism));
2203
-
2204
- (function (Prism) {
2205
-
2206
- // https://yaml.org/spec/1.2/spec.html#c-ns-anchor-property
2207
- // https://yaml.org/spec/1.2/spec.html#c-ns-alias-node
2208
- var anchorOrAlias = /[*&][^\s[\]{},]+/;
2209
- // https://yaml.org/spec/1.2/spec.html#c-ns-tag-property
2210
- var tag = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
2211
- // https://yaml.org/spec/1.2/spec.html#c-ns-properties(n,c)
2212
- var properties = '(?:' + tag.source + '(?:[ \t]+' + anchorOrAlias.source + ')?|'
2213
- + anchorOrAlias.source + '(?:[ \t]+' + tag.source + ')?)';
2214
- // https://yaml.org/spec/1.2/spec.html#ns-plain(n,c)
2215
- // This is a simplified version that doesn't support "#" and multiline keys
2216
- // All these long scarry character classes are simplified versions of YAML's characters
2217
- var plainKey = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source
2218
- .replace(/<PLAIN>/g, function () { return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source; });
2219
- var string = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
2220
-
2221
- /**
1399
+ */ function s(e, t) {
1400
+ e = e.replace(/<S>/g, (function() {
1401
+ return a;
1402
+ })).replace(/<BRACES>/g, (function() {
1403
+ return n;
1404
+ })).replace(/<SPREAD>/g, (function() {
1405
+ return r;
1406
+ }));
1407
+ return RegExp(e, t);
1408
+ }
1409
+ r = s(r).source;
1410
+ e.languages.jsx = e.languages.extend("markup", t);
1411
+ e.languages.jsx.tag.pattern = s(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source);
1412
+ e.languages.jsx.tag.inside["tag"].pattern = /^<\/?[^\s>\/]*/i;
1413
+ e.languages.jsx.tag.inside["attr-value"].pattern = /=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/i;
1414
+ e.languages.jsx.tag.inside["tag"].inside["class-name"] = /^[A-Z]\w*(?:\.[A-Z]\w*)*$/;
1415
+ e.languages.jsx.tag.inside["comment"] = t["comment"];
1416
+ e.languages.insertBefore("inside", "attr-name", {
1417
+ spread: {
1418
+ pattern: s(/<SPREAD>/.source),
1419
+ inside: e.languages.jsx
1420
+ }
1421
+ }, e.languages.jsx.tag);
1422
+ e.languages.insertBefore("inside", "special-attr", {
1423
+ script: {
1424
+ // Allow for two levels of nesting
1425
+ pattern: s(/=<BRACES>/.source),
1426
+ inside: {
1427
+ "script-punctuation": {
1428
+ pattern: /^=(?=\{)/,
1429
+ alias: "punctuation"
1430
+ },
1431
+ rest: e.languages.jsx
1432
+ },
1433
+ alias: "language-javascript"
1434
+ }
1435
+ }, e.languages.jsx.tag);
1436
+ // The following will handle plain text inside tags
1437
+ var i = function(e) {
1438
+ if (!e) {
1439
+ return "";
1440
+ }
1441
+ if (typeof e === "string") {
1442
+ return e;
1443
+ }
1444
+ if (typeof e.content === "string") {
1445
+ return e.content;
1446
+ }
1447
+ return e.content.map(i).join("");
1448
+ };
1449
+ var o = function(t) {
1450
+ var a = [];
1451
+ for (var n = 0; n < t.length; n++) {
1452
+ var r = t[n];
1453
+ var s = false;
1454
+ if (typeof r !== "string") {
1455
+ if (r.type === "tag" && r.content[0] && r.content[0].type === "tag") {
1456
+ // We found a tag, now find its kind
1457
+ if (r.content[0].content[0].content === "</") {
1458
+ // Closing tag
1459
+ if (a.length > 0 && a[a.length - 1].tagName === i(r.content[0].content[1])) {
1460
+ // Pop matching opening tag
1461
+ a.pop();
1462
+ }
1463
+ } else {
1464
+ if (r.content[r.content.length - 1].content === "/>") {
1465
+ // Autoclosed tag, ignore
1466
+ } else {
1467
+ // Opening tag
1468
+ a.push({
1469
+ tagName: i(r.content[0].content[1]),
1470
+ openedBraces: 0
1471
+ });
1472
+ }
1473
+ }
1474
+ } else if (a.length > 0 && r.type === "punctuation" && r.content === "{") {
1475
+ // Here we might have entered a JSX context inside a tag
1476
+ a[a.length - 1].openedBraces++;
1477
+ } else if (a.length > 0 && a[a.length - 1].openedBraces > 0 && r.type === "punctuation" && r.content === "}") {
1478
+ // Here we might have left a JSX context inside a tag
1479
+ a[a.length - 1].openedBraces--;
1480
+ } else {
1481
+ s = true;
1482
+ }
1483
+ }
1484
+ if (s || typeof r === "string") {
1485
+ if (a.length > 0 && a[a.length - 1].openedBraces === 0) {
1486
+ // Here we are inside a tag, and not inside a JSX context.
1487
+ // That's plain text: drop any tokens matched.
1488
+ var l = i(r);
1489
+ // And merge text with adjacent text
1490
+ if (n < t.length - 1 && (typeof t[n + 1] === "string" || t[n + 1].type === "plain-text")) {
1491
+ l += i(t[n + 1]);
1492
+ t.splice(n + 1, 1);
1493
+ }
1494
+ if (n > 0 && (typeof t[n - 1] === "string" || t[n - 1].type === "plain-text")) {
1495
+ l = i(t[n - 1]) + l;
1496
+ t.splice(n - 1, 1);
1497
+ n--;
1498
+ }
1499
+ t[n] = new e.Token("plain-text", l, null, l);
1500
+ }
1501
+ }
1502
+ if (r.content && typeof r.content !== "string") {
1503
+ o(r.content);
1504
+ }
1505
+ }
1506
+ };
1507
+ e.hooks.add("after-tokenize", (function(e) {
1508
+ if (e.language !== "jsx" && e.language !== "tsx") {
1509
+ return;
1510
+ }
1511
+ o(e.tokens);
1512
+ }));
1513
+ })(r);
1514
+ (function(e) {
1515
+ e.languages.typescript = e.languages.extend("javascript", {
1516
+ "class-name": {
1517
+ pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
1518
+ lookbehind: true,
1519
+ greedy: true,
1520
+ inside: null
1521
+ },
1522
+ builtin: /\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/
1523
+ });
1524
+ // The keywords TypeScript adds to JavaScript
1525
+ e.languages.typescript.keyword.push(/\b(?:abstract|as|declare|implements|is|keyof|readonly|require)\b/,
1526
+ // keywords that have to be followed by an identifier
1527
+ /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
1528
+ // This is for `import type *, {}`
1529
+ /\btype\b(?=\s*(?:[\{*]|$))/);
1530
+ // doesn't work with TS because TS is too complex
1531
+ delete e.languages.typescript["parameter"];
1532
+ // a version of typescript specifically for highlighting types
1533
+ var t = e.languages.extend("typescript", {});
1534
+ delete t["class-name"];
1535
+ e.languages.typescript["class-name"].inside = t;
1536
+ e.languages.insertBefore("typescript", "function", {
1537
+ decorator: {
1538
+ pattern: /@[$\w\xA0-\uFFFF]+/,
1539
+ inside: {
1540
+ at: {
1541
+ pattern: /^@/,
1542
+ alias: "operator"
1543
+ },
1544
+ function: /^[\s\S]+/
1545
+ }
1546
+ },
1547
+ "generic-function": {
1548
+ // e.g. foo<T extends "bar" | "baz">( ...
1549
+ pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,
1550
+ greedy: true,
1551
+ inside: {
1552
+ function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,
1553
+ generic: {
1554
+ pattern: /<[\s\S]+/,
1555
+ // everything after the first <
1556
+ alias: "class-name",
1557
+ inside: t
1558
+ }
1559
+ }
1560
+ }
1561
+ });
1562
+ e.languages.ts = e.languages.typescript;
1563
+ })(r);
1564
+ (function(e) {
1565
+ var t = e.util.clone(e.languages.typescript);
1566
+ e.languages.tsx = e.languages.extend("jsx", t);
1567
+ // This will prevent collisions between TSX tags and TS generic types.
1568
+ // Idea by https://github.com/karlhorky
1569
+ // Discussion: https://github.com/PrismJS/prism/issues/2594#issuecomment-710666928
1570
+ var a = e.languages.tsx.tag;
1571
+ a.pattern = RegExp(/(^|[^\w$]|(?=<\/))/.source + "(?:" + a.pattern.source + ")", a.pattern.flags);
1572
+ a.lookbehind = true;
1573
+ })(r);
1574
+ (function(e) {
1575
+ var t = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1576
+ e.languages.css = {
1577
+ comment: /\/\*[\s\S]*?\*\//,
1578
+ atrule: {
1579
+ pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,
1580
+ inside: {
1581
+ rule: /^@[\w-]+/,
1582
+ "selector-function-argument": {
1583
+ pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1584
+ lookbehind: true,
1585
+ alias: "selector"
1586
+ },
1587
+ keyword: {
1588
+ pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1589
+ lookbehind: true
1590
+ }
1591
+ }
1592
+ },
1593
+ url: {
1594
+ // https://drafts.csswg.org/css-values-3/#urls
1595
+ pattern: RegExp("\\burl\\((?:" + t.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
1596
+ greedy: true,
1597
+ inside: {
1598
+ function: /^url/i,
1599
+ punctuation: /^\(|\)$/,
1600
+ string: {
1601
+ pattern: RegExp("^" + t.source + "$"),
1602
+ alias: "url"
1603
+ }
1604
+ }
1605
+ },
1606
+ selector: {
1607
+ pattern: RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|" + t.source + ")*(?=\\s*\\{)"),
1608
+ lookbehind: true
1609
+ },
1610
+ string: {
1611
+ pattern: t,
1612
+ greedy: true
1613
+ },
1614
+ property: {
1615
+ pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1616
+ lookbehind: true
1617
+ },
1618
+ important: /!important\b/i,
1619
+ function: {
1620
+ pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1621
+ lookbehind: true
1622
+ },
1623
+ punctuation: /[(){};:,]/
1624
+ };
1625
+ e.languages.css["atrule"].inside.rest = e.languages.css;
1626
+ var a = e.languages.markup;
1627
+ if (a) {
1628
+ a.tag.addInlined("style", "css");
1629
+ a.tag.addAttribute("style", "css");
1630
+ }
1631
+ })(r);
1632
+ (function(e) {
1633
+ // $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
1634
+ // + LC_ALL, RANDOM, REPLY, SECONDS.
1635
+ // + make sure PS1..4 are here as they are not always set,
1636
+ // - some useless things.
1637
+ var t = "\\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";
1638
+ var a = {
1639
+ pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
1640
+ lookbehind: true,
1641
+ alias: "punctuation",
1642
+ // this looks reasonably well in all themes
1643
+ inside: null
1644
+ };
1645
+ var n = {
1646
+ bash: a,
1647
+ environment: {
1648
+ pattern: RegExp("\\$" + t),
1649
+ alias: "constant"
1650
+ },
1651
+ variable: [
1652
+ // [0]: Arithmetic Environment
1653
+ {
1654
+ pattern: /\$?\(\([\s\S]+?\)\)/,
1655
+ greedy: true,
1656
+ inside: {
1657
+ // If there is a $ sign at the beginning highlight $(( and )) as variable
1658
+ variable: [ {
1659
+ pattern: /(^\$\(\([\s\S]+)\)\)/,
1660
+ lookbehind: true
1661
+ }, /^\$\(\(/ ],
1662
+ number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
1663
+ // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
1664
+ operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
1665
+ // If there is no $ sign at the beginning highlight (( and )) as punctuation
1666
+ punctuation: /\(\(?|\)\)?|,|;/
1667
+ }
1668
+ },
1669
+ // [1]: Command Substitution
1670
+ {
1671
+ pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
1672
+ greedy: true,
1673
+ inside: {
1674
+ variable: /^\$\(|^`|\)$|`$/
1675
+ }
1676
+ },
1677
+ // [2]: Brace expansion
1678
+ {
1679
+ pattern: /\$\{[^}]+\}/,
1680
+ greedy: true,
1681
+ inside: {
1682
+ operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
1683
+ punctuation: /[\[\]]/,
1684
+ environment: {
1685
+ pattern: RegExp("(\\{)" + t),
1686
+ lookbehind: true,
1687
+ alias: "constant"
1688
+ }
1689
+ }
1690
+ }, /\$(?:\w+|[#?*!@$])/ ],
1691
+ // Escape sequences from echo and printf's manuals, and escaped quotes.
1692
+ entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/
1693
+ };
1694
+ e.languages.bash = {
1695
+ shebang: {
1696
+ pattern: /^#!\s*\/.*/,
1697
+ alias: "important"
1698
+ },
1699
+ comment: {
1700
+ pattern: /(^|[^"{\\$])#.*/,
1701
+ lookbehind: true
1702
+ },
1703
+ "function-name": [
1704
+ // a) function foo {
1705
+ // b) foo() {
1706
+ // c) function foo() {
1707
+ // but not “foo {”
1708
+ {
1709
+ // a) and c)
1710
+ pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
1711
+ lookbehind: true,
1712
+ alias: "function"
1713
+ }, {
1714
+ // b)
1715
+ pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
1716
+ alias: "function"
1717
+ } ],
1718
+ // Highlight variable names as variables in for and select beginnings.
1719
+ "for-or-select": {
1720
+ pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
1721
+ alias: "variable",
1722
+ lookbehind: true
1723
+ },
1724
+ // Highlight variable names as variables in the left-hand part
1725
+ // of assignments (“=” and “+=”).
1726
+ "assign-left": {
1727
+ pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,
1728
+ inside: {
1729
+ environment: {
1730
+ pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + t),
1731
+ lookbehind: true,
1732
+ alias: "constant"
1733
+ }
1734
+ },
1735
+ alias: "variable",
1736
+ lookbehind: true
1737
+ },
1738
+ string: [
1739
+ // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
1740
+ {
1741
+ pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
1742
+ lookbehind: true,
1743
+ greedy: true,
1744
+ inside: n
1745
+ },
1746
+ // Here-document with quotes around the tag
1747
+ // → No expansion (so no “inside”).
1748
+ {
1749
+ pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
1750
+ lookbehind: true,
1751
+ greedy: true,
1752
+ inside: {
1753
+ bash: a
1754
+ }
1755
+ },
1756
+ // “Normal” string
1757
+ {
1758
+ // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
1759
+ pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
1760
+ lookbehind: true,
1761
+ greedy: true,
1762
+ inside: n
1763
+ }, {
1764
+ // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
1765
+ pattern: /(^|[^$\\])'[^']*'/,
1766
+ lookbehind: true,
1767
+ greedy: true
1768
+ }, {
1769
+ // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
1770
+ pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
1771
+ greedy: true,
1772
+ inside: {
1773
+ entity: n.entity
1774
+ }
1775
+ } ],
1776
+ environment: {
1777
+ pattern: RegExp("\\$?" + t),
1778
+ alias: "constant"
1779
+ },
1780
+ variable: n.variable,
1781
+ function: {
1782
+ pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|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|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|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|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|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|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|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
1783
+ lookbehind: true
1784
+ },
1785
+ keyword: {
1786
+ pattern: /(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,
1787
+ lookbehind: true
1788
+ },
1789
+ // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
1790
+ builtin: {
1791
+ pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,
1792
+ lookbehind: true,
1793
+ // Alias added to make those easier to distinguish from strings.
1794
+ alias: "class-name"
1795
+ },
1796
+ boolean: {
1797
+ pattern: /(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,
1798
+ lookbehind: true
1799
+ },
1800
+ "file-descriptor": {
1801
+ pattern: /\B&\d\b/,
1802
+ alias: "important"
1803
+ },
1804
+ operator: {
1805
+ // Lots of redirections here, but not just that.
1806
+ pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
1807
+ inside: {
1808
+ "file-descriptor": {
1809
+ pattern: /^\d/,
1810
+ alias: "important"
1811
+ }
1812
+ }
1813
+ },
1814
+ punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
1815
+ number: {
1816
+ pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
1817
+ lookbehind: true
1818
+ }
1819
+ };
1820
+ a.inside = e.languages.bash;
1821
+ /* Patterns in command substitution. */ var r = [ "comment", "function-name", "for-or-select", "assign-left", "string", "environment", "function", "keyword", "builtin", "boolean", "file-descriptor", "operator", "punctuation", "number" ];
1822
+ var s = n.variable[1].inside;
1823
+ for (var i = 0; i < r.length; i++) {
1824
+ s[r[i]] = e.languages.bash[r[i]];
1825
+ }
1826
+ e.languages.shell = e.languages.bash;
1827
+ })(r);
1828
+ (function(e) {
1829
+ // https://yaml.org/spec/1.2/spec.html#c-ns-anchor-property
1830
+ // https://yaml.org/spec/1.2/spec.html#c-ns-alias-node
1831
+ var t = /[*&][^\s[\]{},]+/;
1832
+ // https://yaml.org/spec/1.2/spec.html#c-ns-tag-property
1833
+ var a = /!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/;
1834
+ // https://yaml.org/spec/1.2/spec.html#c-ns-properties(n,c)
1835
+ var n = "(?:" + a.source + "(?:[ \t]+" + t.source + ")?|" + t.source + "(?:[ \t]+" + a.source + ")?)";
1836
+ // https://yaml.org/spec/1.2/spec.html#ns-plain(n,c)
1837
+ // This is a simplified version that doesn't support "#" and multiline keys
1838
+ // All these long scarry character classes are simplified versions of YAML's characters
1839
+ var r = /(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g, (function() {
1840
+ return /[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source;
1841
+ }));
1842
+ var s = /"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;
1843
+ /**
2222
1844
  *
2223
1845
  * @param {string} value
2224
1846
  * @param {string} [flags]
2225
1847
  * @returns {RegExp}
2226
- */
2227
- function createValuePattern(value, flags) {
2228
- flags = (flags || '').replace(/m/g, '') + 'm'; // add m flag
2229
- var pattern = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source
2230
- .replace(/<<prop>>/g, function () { return properties; }).replace(/<<value>>/g, function () { return value; });
2231
- return RegExp(pattern, flags);
2232
- }
2233
-
2234
- Prism.languages.yaml = {
2235
- 'scalar': {
2236
- pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source
2237
- .replace(/<<prop>>/g, function () { return properties; })),
2238
- lookbehind: true,
2239
- alias: 'string'
2240
- },
2241
- 'comment': /#.*/,
2242
- 'key': {
2243
- pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source
2244
- .replace(/<<prop>>/g, function () { return properties; })
2245
- .replace(/<<key>>/g, function () { return '(?:' + plainKey + '|' + string + ')'; })),
2246
- lookbehind: true,
2247
- greedy: true,
2248
- alias: 'atrule'
2249
- },
2250
- 'directive': {
2251
- pattern: /(^[ \t]*)%.+/m,
2252
- lookbehind: true,
2253
- alias: 'important'
2254
- },
2255
- 'datetime': {
2256
- pattern: createValuePattern(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
2257
- lookbehind: true,
2258
- alias: 'number'
2259
- },
2260
- 'boolean': {
2261
- pattern: createValuePattern(/true|false/.source, 'i'),
2262
- lookbehind: true,
2263
- alias: 'important'
2264
- },
2265
- 'null': {
2266
- pattern: createValuePattern(/null|~/.source, 'i'),
2267
- lookbehind: true,
2268
- alias: 'important'
2269
- },
2270
- 'string': {
2271
- pattern: createValuePattern(string),
2272
- lookbehind: true,
2273
- greedy: true
2274
- },
2275
- 'number': {
2276
- pattern: createValuePattern(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, 'i'),
2277
- lookbehind: true
2278
- },
2279
- 'tag': tag,
2280
- 'important': anchorOrAlias,
2281
- 'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./
2282
- };
2283
-
2284
- Prism.languages.yml = Prism.languages.yaml;
2285
-
2286
- }(Prism));
2287
-
2288
- Prism.languages['splunk-spl'] = {
2289
- 'comment': /`comment\("(?:\\.|[^\\"])*"\)`/,
2290
- 'string': {
2291
- pattern: /"(?:\\.|[^\\"])*"/,
2292
- greedy: true
2293
- },
2294
- // https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/ListOfSearchCommands
2295
- 'keyword': /\b(?:abstract|accum|addcoltotals|addinfo|addtotals|analyzefields|anomalies|anomalousvalue|anomalydetection|append|appendcols|appendcsv|appendlookup|appendpipe|arules|associate|audit|autoregress|bin|bucket|bucketdir|chart|cluster|cofilter|collect|concurrency|contingency|convert|correlate|datamodel|dbinspect|dedup|delete|delta|diff|erex|eval|eventcount|eventstats|extract|fieldformat|fields|fieldsummary|filldown|fillnull|findtypes|folderize|foreach|format|from|gauge|gentimes|geom|geomfilter|geostats|head|highlight|history|iconify|input|inputcsv|inputlookup|iplocation|join|kmeans|kv|kvform|loadjob|localize|localop|lookup|makecontinuous|makemv|makeresults|map|mcollect|metadata|metasearch|meventcollect|mstats|multikv|multisearch|mvcombine|mvexpand|nomv|outlier|outputcsv|outputlookup|outputtext|overlap|pivot|predict|rangemap|rare|regex|relevancy|reltime|rename|replace|rest|return|reverse|rex|rtorder|run|savedsearch|script|scrub|search|searchtxn|selfjoin|sendemail|set|setfields|sichart|sirare|sistats|sitimechart|sitop|sort|spath|stats|strcat|streamstats|table|tags|tail|timechart|timewrap|top|transaction|transpose|trendline|tscollect|tstats|typeahead|typelearner|typer|union|uniq|untable|where|x11|xmlkv|xmlunescape|xpath|xyseries)\b/i,
2296
- 'operator-word': {
2297
- pattern: /\b(?:and|as|by|not|or|xor)\b/i,
2298
- alias: 'operator'
2299
- },
2300
- 'function': /\b\w+(?=\s*\()/,
2301
- 'property': /\b\w+(?=\s*=(?!=))/,
2302
- 'date': {
2303
- // MM/DD/YYYY(:HH:MM:SS)?
2304
- pattern: /\b\d{1,2}\/\d{1,2}\/\d{1,4}(?:(?::\d{1,2}){3})?\b/,
2305
- alias: 'number'
2306
- },
2307
- 'number': /\b\d+(?:\.\d+)?\b/,
2308
- 'boolean': /\b(?:f|false|t|true)\b/i,
2309
- 'operator': /[<>=]=?|[-+*/%|]/,
2310
- 'punctuation': /[()[\],]/
2311
- };
2312
-
1848
+ */ function i(e, t) {
1849
+ t = (t || "").replace(/m/g, "") + "m";
1850
+ // add m flag
1851
+ var a = /([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g, (function() {
1852
+ return n;
1853
+ })).replace(/<<value>>/g, (function() {
1854
+ return e;
1855
+ }));
1856
+ return RegExp(a, t);
1857
+ }
1858
+ e.languages.yaml = {
1859
+ scalar: {
1860
+ pattern: RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g, (function() {
1861
+ return n;
1862
+ }))),
1863
+ lookbehind: true,
1864
+ alias: "string"
1865
+ },
1866
+ comment: /#.*/,
1867
+ key: {
1868
+ pattern: RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g, (function() {
1869
+ return n;
1870
+ })).replace(/<<key>>/g, (function() {
1871
+ return "(?:" + r + "|" + s + ")";
1872
+ }))),
1873
+ lookbehind: true,
1874
+ greedy: true,
1875
+ alias: "atrule"
1876
+ },
1877
+ directive: {
1878
+ pattern: /(^[ \t]*)%.+/m,
1879
+ lookbehind: true,
1880
+ alias: "important"
1881
+ },
1882
+ datetime: {
1883
+ pattern: i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),
1884
+ lookbehind: true,
1885
+ alias: "number"
1886
+ },
1887
+ boolean: {
1888
+ pattern: i(/true|false/.source, "i"),
1889
+ lookbehind: true,
1890
+ alias: "important"
1891
+ },
1892
+ null: {
1893
+ pattern: i(/null|~/.source, "i"),
1894
+ lookbehind: true,
1895
+ alias: "important"
1896
+ },
1897
+ string: {
1898
+ pattern: i(s),
1899
+ lookbehind: true,
1900
+ greedy: true
1901
+ },
1902
+ number: {
1903
+ pattern: i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source, "i"),
1904
+ lookbehind: true
1905
+ },
1906
+ tag: a,
1907
+ important: t,
1908
+ punctuation: /---|[:[\]{}\-,|>?]|\.\.\./
1909
+ };
1910
+ e.languages.yml = e.languages.yaml;
1911
+ })(r);
1912
+ r.languages["splunk-spl"] = {
1913
+ comment: /`comment\("(?:\\.|[^\\"])*"\)`/,
1914
+ string: {
1915
+ pattern: /"(?:\\.|[^\\"])*"/,
1916
+ greedy: true
1917
+ },
1918
+ // https://docs.splunk.com/Documentation/Splunk/7.3.0/SearchReference/ListOfSearchCommands
1919
+ keyword: /\b(?:abstract|accum|addcoltotals|addinfo|addtotals|analyzefields|anomalies|anomalousvalue|anomalydetection|append|appendcols|appendcsv|appendlookup|appendpipe|arules|associate|audit|autoregress|bin|bucket|bucketdir|chart|cluster|cofilter|collect|concurrency|contingency|convert|correlate|datamodel|dbinspect|dedup|delete|delta|diff|erex|eval|eventcount|eventstats|extract|fieldformat|fields|fieldsummary|filldown|fillnull|findtypes|folderize|foreach|format|from|gauge|gentimes|geom|geomfilter|geostats|head|highlight|history|iconify|input|inputcsv|inputlookup|iplocation|join|kmeans|kv|kvform|loadjob|localize|localop|lookup|makecontinuous|makemv|makeresults|map|mcollect|metadata|metasearch|meventcollect|mstats|multikv|multisearch|mvcombine|mvexpand|nomv|outlier|outputcsv|outputlookup|outputtext|overlap|pivot|predict|rangemap|rare|regex|relevancy|reltime|rename|replace|rest|return|reverse|rex|rtorder|run|savedsearch|script|scrub|search|searchtxn|selfjoin|sendemail|set|setfields|sichart|sirare|sistats|sitimechart|sitop|sort|spath|stats|strcat|streamstats|table|tags|tail|timechart|timewrap|top|transaction|transpose|trendline|tscollect|tstats|typeahead|typelearner|typer|union|uniq|untable|where|x11|xmlkv|xmlunescape|xpath|xyseries)\b/i,
1920
+ "operator-word": {
1921
+ pattern: /\b(?:and|as|by|not|or|xor)\b/i,
1922
+ alias: "operator"
1923
+ },
1924
+ function: /\b\w+(?=\s*\()/,
1925
+ property: /\b\w+(?=\s*=(?!=))/,
1926
+ date: {
1927
+ // MM/DD/YYYY(:HH:MM:SS)?
1928
+ pattern: /\b\d{1,2}\/\d{1,2}\/\d{1,4}(?:(?::\d{1,2}){3})?\b/,
1929
+ alias: "number"
1930
+ },
1931
+ number: /\b\d+(?:\.\d+)?\b/,
1932
+ boolean: /\b(?:f|false|t|true)\b/i,
1933
+ operator: /[<>=]=?|[-+*/%|]/,
1934
+ punctuation: /[()[\],]/
1935
+ };
1936
+ })();
1937
+ /***/
1938
+ /******/ }
1939
+ };
1940
+ /************************************************************************/
1941
+ /******/ // The module cache
1942
+ /******/ var t = {};
1943
+ /******/
1944
+ /******/ // The require function
1945
+ /******/ function a(n) {
1946
+ /******/ // Check if module is in cache
1947
+ /******/ var r = t[n];
1948
+ /******/ if (r !== undefined) {
1949
+ /******/ return r.exports;
1950
+ /******/ }
1951
+ /******/ // Create a new module (and put it into the cache)
1952
+ /******/ var s = t[n] = {
1953
+ /******/ // no module.id needed
1954
+ /******/ // no module.loaded needed
1955
+ /******/ exports: {}
1956
+ /******/ };
1957
+ /******/
1958
+ /******/ // Execute the module function
1959
+ /******/ e[n](s, s.exports, a);
1960
+ /******/
1961
+ /******/ // Return the exports of the module
1962
+ /******/ return s.exports;
1963
+ /******/ }
1964
+ /******/
1965
+ /************************************************************************/
1966
+ /******/ /* webpack/runtime/compat get default export */
1967
+ /******/ (() => {
1968
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
1969
+ /******/ a.n = e => {
1970
+ /******/ var t = e && e.__esModule ?
1971
+ /******/ () => e["default"]
1972
+ /******/ : () => e
1973
+ /******/;
1974
+ a.d(t, {
1975
+ a: t
1976
+ });
1977
+ /******/ return t;
1978
+ /******/ };
1979
+ /******/ })();
1980
+ /******/
1981
+ /******/ /* webpack/runtime/define property getters */
1982
+ /******/ (() => {
1983
+ /******/ // define getter functions for harmony exports
1984
+ /******/ a.d = (e, t) => {
1985
+ /******/ for (var n in t) {
1986
+ /******/ if (a.o(t, n) && !a.o(e, n)) {
1987
+ /******/ Object.defineProperty(e, n, {
1988
+ enumerable: true,
1989
+ get: t[n]
1990
+ });
1991
+ /******/ }
1992
+ /******/ }
1993
+ /******/ };
1994
+ /******/ })();
1995
+ /******/
1996
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1997
+ /******/ (() => {
1998
+ /******/ a.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
1999
+ /******/;
2313
2000
  })();
2314
-
2315
-
2316
- /***/ }),
2317
-
2318
- /***/ 128:
2319
- /***/ (function(module, exports) {
2320
-
2321
- module.exports = require("lodash/flatten");
2322
-
2323
- /***/ }),
2324
-
2325
- /***/ 2:
2326
- /***/ (function(module, exports) {
2327
-
2328
- module.exports = require("react");
2329
-
2330
- /***/ }),
2331
-
2332
- /***/ 219:
2333
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
2334
-
2335
- "use strict";
2336
- // ESM COMPAT FLAG
2337
- __webpack_require__.r(__webpack_exports__);
2338
-
2339
- // EXPORTS
2340
- __webpack_require__.d(__webpack_exports__, "default", function() { return /* reexport */ Code_Code; });
2341
-
2342
- // EXTERNAL MODULE: external "react"
2343
- var external_react_ = __webpack_require__(2);
2344
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
2345
-
2346
- // EXTERNAL MODULE: external "prop-types"
2347
- var external_prop_types_ = __webpack_require__(1);
2348
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
2349
-
2350
- // EXTERNAL MODULE: external "lodash/castArray"
2351
- var castArray_ = __webpack_require__(67);
2352
- var castArray_default = /*#__PURE__*/__webpack_require__.n(castArray_);
2353
-
2354
- // EXTERNAL MODULE: external "lodash/flatten"
2355
- var flatten_ = __webpack_require__(128);
2356
- var flatten_default = /*#__PURE__*/__webpack_require__.n(flatten_);
2357
-
2358
- // EXTERNAL MODULE: external "lodash/indexOf"
2359
- var indexOf_ = __webpack_require__(84);
2360
- var indexOf_default = /*#__PURE__*/__webpack_require__.n(indexOf_);
2361
-
2362
- // EXTERNAL MODULE: external "lodash/repeat"
2363
- var repeat_ = __webpack_require__(82);
2364
- var repeat_default = /*#__PURE__*/__webpack_require__.n(repeat_);
2365
-
2366
- // EXTERNAL MODULE: external "lodash/times"
2367
- var times_ = __webpack_require__(81);
2368
- var times_default = /*#__PURE__*/__webpack_require__.n(times_);
2369
-
2370
- // EXTERNAL MODULE: ./src/Code/prism/prism.empty
2371
- var prism_empty = __webpack_require__(118);
2372
- var prism_empty_default = /*#__PURE__*/__webpack_require__.n(prism_empty);
2373
-
2374
- // EXTERNAL MODULE: external "styled-components"
2375
- var external_styled_components_ = __webpack_require__(3);
2376
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
2377
-
2378
- // EXTERNAL MODULE: external "@splunk/themes"
2379
- var themes_ = __webpack_require__(0);
2380
-
2381
- // CONCATENATED MODULE: ./src/Code/CodeStyles.ts
2382
-
2383
-
2384
- var Styled = external_styled_components_default.a.pre.withConfig({
2385
- displayName: "CodeStyles__Styled",
2386
- componentId: "sc-1eq4k68-0"
2387
- })(["", ";", " line-height:", ";text-align:left;tab-size:4;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;hyphens:none;overflow-x:auto;margin-bottom:1.3em;&:focus-visible{outline:solid ", ";}"], themes_["mixins"].reset('block'), Object(themes_["pick"])({
2388
- enterprise: {
2389
- dark: Object(external_styled_components_["css"])(["color:", ";"], themes_["variables"].gray92)
2390
- }
2391
- }), Object(themes_["pick"])({
2392
- enterprise: '17px',
2393
- prisma: themes_["variables"].lineHeight
2394
- }), themes_["variables"].focusColor);
2395
- var StyledCode = external_styled_components_default.a.code.withConfig({
2396
- displayName: "CodeStyles__StyledCode",
2397
- componentId: "sc-1eq4k68-1"
2398
- })(["font-family:", ";"], themes_["variables"].monoFontFamily);
2399
- var StyledIndent = external_styled_components_default.a.span.withConfig({
2400
- displayName: "CodeStyles__StyledIndent",
2401
- componentId: "sc-1eq4k68-2"
2402
- })(["&:not(:last-child){background-image:linear-gradient( to left,rgba(0,0,0,0.15) 1px,transparent 1px,transparent );}"]);
2403
- var gray = Object(themes_["pick"])({
2404
- prisma: themes_["variables"].syntaxGray,
2405
- enterprise: {
2406
- dark: themes_["variables"].gray60,
2407
- light: themes_["variables"].syntaxGray
2408
- }
2409
- });
2410
- var purple = Object(themes_["pick"])({
2411
- prisma: themes_["variables"].syntaxPurple,
2412
- enterprise: {
2413
- dark: themes_["variables"].syntaxPurpleLight,
2414
- light: themes_["variables"].syntaxPurple
2415
- }
2416
- });
2417
- var green = Object(themes_["pick"])({
2418
- prisma: themes_["variables"].syntaxGreen,
2419
- enterprise: {
2420
- dark: themes_["variables"].syntaxGreenLight,
2421
- light: themes_["variables"].syntaxGreen
2422
- }
2423
- });
2424
- var blue = Object(themes_["pick"])({
2425
- prisma: themes_["variables"].syntaxBlue,
2426
- enterprise: {
2427
- dark: themes_["variables"].syntaxBlueLight,
2428
- light: themes_["variables"].syntaxBlue
2429
- }
2430
- });
2431
- var red = Object(themes_["pick"])({
2432
- prisma: themes_["variables"].syntaxRed,
2433
- enterprise: {
2434
- dark: themes_["variables"].syntaxRedLight,
2435
- light: themes_["variables"].syntaxRed
2436
- }
2437
- });
2438
- var TokenColors = {
2439
- comment: gray,
2440
- prolog: gray,
2441
- doctype: gray,
2442
- cdata: gray,
2443
- punctuation: gray,
2444
- property: purple,
2445
- tag: purple,
2446
- "boolean": purple,
2447
- number: purple,
2448
- constant: purple,
2449
- symbol: purple,
2450
- deleted: purple,
2451
- key: purple,
2452
- selector: green,
2453
- 'attr-name': green,
2454
- string: green,
2455
- "char": green,
2456
- builtin: green,
2457
- inserted: green,
2458
- operator: themes_["variables"].syntaxBrown,
2459
- entity: themes_["variables"].syntaxBrown,
2460
- url: themes_["variables"].syntaxBrown,
2461
- atrule: blue,
2462
- 'attr-value': blue,
2463
- keyword: blue,
2464
- "function": red,
2465
- regex: themes_["variables"].syntaxOrange,
2466
- important: themes_["variables"].syntaxOrange,
2467
- variable: themes_["variables"].syntaxOrange
2468
- };
2469
- var StyledToken = external_styled_components_default.a.span.withConfig({
2470
- displayName: "CodeStyles__StyledToken",
2471
- componentId: "sc-1eq4k68-3"
2472
- })(["color:", ";cursor:", ";opacity:", ";font-style:", ";font-weight:", ";"], function (_ref) {
2473
- var partType = _ref.partType;
2474
- return TokenColors[partType];
2475
- }, function (_ref2) {
2476
- var partType = _ref2.partType;
2477
- return partType === 'entity' ? 'help' : null;
2478
- }, function (_ref3) {
2479
- var partType = _ref3.partType;
2480
- return partType === 'namespace' ? 0.7 : null;
2481
- }, function (_ref4) {
2482
- var partType = _ref4.partType;
2483
- return partType === 'italic' ? 'italic' : null;
2484
- }, function (_ref5) {
2485
- var partType = _ref5.partType;
2486
- return partType === 'important' || partType === 'bold' ? 'bold' : null;
2487
- });
2488
-
2489
- // CONCATENATED MODULE: ./src/Code/Code.tsx
2490
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2491
-
2492
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
2493
-
2494
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
2495
-
2496
-
2497
-
2498
-
2499
-
2500
-
2501
-
2502
- // Prism requires special handling to work around issues related to global scope and
2503
- // auto formatting. The import below points to an empty file which is replaced at build
2504
- // time, see ./prism/build-isolated-prism.js for details.
2505
-
2506
- // typed as 'prismjs'
2507
-
2508
-
2509
- var supportedLanguages = ['bash', 'clike', 'css', 'html', 'json', 'javascript', 'js', 'jsx', 'typescript', 'ts', 'tsx', 'markup', 'mathml', 'splunk-spl', 'svg', 'xml', 'yaml', 'yml'];
2510
-
2511
- function tokenize(text, language) {
2512
- return prism_empty_default.a.tokenize(text, prism_empty_default.a.languages[language]);
2513
- }
2514
-
2515
- var propTypes = {
2516
- elementRef: external_prop_types_default.a.oneOfType([external_prop_types_default.a.func, external_prop_types_default.a.object]),
2517
- indentChars: external_prop_types_default.a.number,
2518
- language: external_prop_types_default.a.oneOf(supportedLanguages),
2519
- languageFallback: external_prop_types_default.a.oneOf(supportedLanguages),
2520
- showIndentGuide: external_prop_types_default.a.bool,
2521
- value: external_prop_types_default.a.string
2522
- };
2523
-
2524
- function Code(_ref) {
2525
- var elementRef = _ref.elementRef,
2526
- _ref$indentChars = _ref.indentChars,
2527
- indentChars = _ref$indentChars === void 0 ? 4 : _ref$indentChars,
2528
- language = _ref.language,
2529
- _ref$languageFallback = _ref.languageFallback,
2530
- languageFallback = _ref$languageFallback === void 0 ? 'javascript' : _ref$languageFallback,
2531
- _ref$showIndentGuide = _ref.showIndentGuide,
2532
- showIndentGuide = _ref$showIndentGuide === void 0 ? true : _ref$showIndentGuide,
2533
- _ref$value = _ref.value,
2534
- value = _ref$value === void 0 ? '' : _ref$value,
2535
- otherProps = _objectWithoutProperties(_ref, ["elementRef", "indentChars", "language", "languageFallback", "showIndentGuide", "value"]);
2536
-
2537
- // @docs-props-type CodePropsBase
2538
- var indentBlock = repeat_default()(' ', indentChars);
2539
-
2540
- var makeIndentGuide = function makeIndentGuide(spaces) {
2541
- var level = Math.floor(spaces / indentChars);
2542
- var rest = spaces % indentChars;
2543
- var spans = times_default()(level, function (idx) {
2544
- return /*#__PURE__*/external_react_default.a.createElement(StyledIndent, {
2545
- key: idx.toString()
2546
- }, indentBlock);
2547
- });
2548
-
2549
- if (rest) {
2550
- spans.push(repeat_default()(' ', rest));
2551
- }
2552
-
2553
- return spans;
2554
- }; // a fix for SUI-5425, where the Markdown component doesn't pass a valid language in some circumstances
2555
-
2556
-
2557
- var isSupportedLanguage = indexOf_default()(supportedLanguages, language) > -1;
2558
-
2559
- if (false) {}
2560
-
2561
- var languageUsed = isSupportedLanguage && language ? language : languageFallback;
2562
- var tokens = tokenize(value, languageUsed);
2563
-
2564
- var render = function render(tks) {
2565
- return castArray_default()(tks).map(function (part, idx) {
2566
- if (typeof part === 'string') {
2567
- if (!showIndentGuide) {
2568
- return part;
2001
+ /******/
2002
+ /******/ /* webpack/runtime/make namespace object */
2003
+ /******/ (() => {
2004
+ /******/ // define __esModule on exports
2005
+ /******/ a.r = e => {
2006
+ /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
2007
+ /******/ Object.defineProperty(e, Symbol.toStringTag, {
2008
+ value: "Module"
2009
+ });
2010
+ /******/ }
2011
+ /******/ Object.defineProperty(e, "__esModule", {
2012
+ value: true
2013
+ });
2014
+ /******/ };
2015
+ /******/ })();
2016
+ /******/
2017
+ /************************************************************************/ var n = {};
2018
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
2019
+ (() => {
2020
+ "use strict";
2021
+ // ESM COMPAT FLAG
2022
+ a.r(n);
2023
+ // EXPORTS
2024
+ a.d(n, {
2025
+ default: () => /* reexport */ L
2026
+ });
2027
+ // CONCATENATED MODULE: external "react"
2028
+ const e = require("react");
2029
+ var t = a.n(e);
2030
+ // CONCATENATED MODULE: external "prop-types"
2031
+ const r = require("prop-types");
2032
+ var s = a.n(r);
2033
+ // CONCATENATED MODULE: external "lodash/castArray"
2034
+ const i = require("lodash/castArray");
2035
+ var o = a.n(i);
2036
+ // CONCATENATED MODULE: external "lodash/flatten"
2037
+ const l = require("lodash/flatten");
2038
+ var u = a.n(l);
2039
+ // CONCATENATED MODULE: external "lodash/indexOf"
2040
+ const c = require("lodash/indexOf");
2041
+ var p = a.n(c);
2042
+ // CONCATENATED MODULE: external "lodash/repeat"
2043
+ const d = require("lodash/repeat");
2044
+ var g = a.n(d);
2045
+ // CONCATENATED MODULE: external "lodash/times"
2046
+ const f = require("lodash/times");
2047
+ var m = a.n(f);
2048
+ // EXTERNAL MODULE: ./src/Code/prism/prism.empty
2049
+ var h = a(74);
2050
+ var v = a.n(h);
2051
+ // CONCATENATED MODULE: external "styled-components"
2052
+ const b = require("styled-components");
2053
+ var y = a.n(b);
2054
+ // CONCATENATED MODULE: external "@splunk/themes"
2055
+ const k = require("@splunk/themes");
2056
+ // CONCATENATED MODULE: ./src/Code/CodeStyles.ts
2057
+ var x = y().pre.withConfig({
2058
+ displayName: "CodeStyles__Styled",
2059
+ componentId: "sc-1eq4k68-0"
2060
+ })([ "", ";", " line-height:", ";text-align:left;tab-size:4;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;hyphens:none;overflow-x:auto;margin-bottom:1.3em;&:focus-visible{outline:solid ", ";}" ], k.mixins.reset("block"), (0,
2061
+ k.pick)({
2062
+ enterprise: {
2063
+ dark: (0, b.css)([ "color:", ";" ], k.variables.gray92)
2064
+ }
2065
+ }), (0, k.pick)({
2066
+ enterprise: "17px",
2067
+ prisma: k.variables.lineHeight
2068
+ }), k.variables.focusColor);
2069
+ var S = y().code.withConfig({
2070
+ displayName: "CodeStyles__StyledCode",
2071
+ componentId: "sc-1eq4k68-1"
2072
+ })([ "font-family:", ";" ], k.variables.monoFontFamily);
2073
+ var A = y().span.withConfig({
2074
+ displayName: "CodeStyles__StyledIndent",
2075
+ componentId: "sc-1eq4k68-2"
2076
+ })([ "&:not(:last-child){background-image:linear-gradient( to left,rgba(0,0,0,0.15) 1px,transparent 1px,transparent );}" ]);
2077
+ var F = (0, k.pick)({
2078
+ prisma: k.variables.syntaxGray,
2079
+ enterprise: {
2080
+ dark: k.variables.gray60,
2081
+ light: k.variables.syntaxGray
2082
+ }
2083
+ });
2084
+ var w = (0, k.pick)({
2085
+ prisma: k.variables.syntaxPurple,
2086
+ enterprise: {
2087
+ dark: k.variables.syntaxPurpleLight,
2088
+ light: k.variables.syntaxPurple
2089
+ }
2090
+ });
2091
+ var E = (0, k.pick)({
2092
+ prisma: k.variables.syntaxGreen,
2093
+ enterprise: {
2094
+ dark: k.variables.syntaxGreenLight,
2095
+ light: k.variables.syntaxGreen
2096
+ }
2097
+ });
2098
+ var _ = (0, k.pick)({
2099
+ prisma: k.variables.syntaxBlue,
2100
+ enterprise: {
2101
+ dark: k.variables.syntaxBlueLight,
2102
+ light: k.variables.syntaxBlue
2103
+ }
2104
+ });
2105
+ var O = (0, k.pick)({
2106
+ prisma: k.variables.syntaxRed,
2107
+ enterprise: {
2108
+ dark: k.variables.syntaxRedLight,
2109
+ light: k.variables.syntaxRed
2110
+ }
2111
+ });
2112
+ var T = {
2113
+ comment: F,
2114
+ prolog: F,
2115
+ doctype: F,
2116
+ cdata: F,
2117
+ punctuation: F,
2118
+ property: w,
2119
+ tag: w,
2120
+ boolean: w,
2121
+ number: w,
2122
+ constant: w,
2123
+ symbol: w,
2124
+ deleted: w,
2125
+ key: w,
2126
+ selector: E,
2127
+ "attr-name": E,
2128
+ string: E,
2129
+ char: E,
2130
+ builtin: E,
2131
+ inserted: E,
2132
+ operator: k.variables.syntaxBrown,
2133
+ entity: k.variables.syntaxBrown,
2134
+ url: k.variables.syntaxBrown,
2135
+ atrule: _,
2136
+ "attr-value": _,
2137
+ keyword: _,
2138
+ function: O,
2139
+ regex: k.variables.syntaxOrange,
2140
+ important: k.variables.syntaxOrange,
2141
+ variable: k.variables.syntaxOrange
2142
+ };
2143
+ var I = y().span.withConfig({
2144
+ displayName: "CodeStyles__StyledToken",
2145
+ componentId: "sc-1eq4k68-3"
2146
+ })([ "color:", ";cursor:", ";opacity:", ";font-style:", ";font-weight:", ";" ], (function(e) {
2147
+ var t = e.partType;
2148
+ return T[t];
2149
+ }), (function(e) {
2150
+ var t = e.partType;
2151
+ return t === "entity" ? "help" : null;
2152
+ }), (function(e) {
2153
+ var t = e.partType;
2154
+ return t === "namespace" ? .7 : null;
2155
+ }), (function(e) {
2156
+ var t = e.partType;
2157
+ return t === "italic" ? "italic" : null;
2158
+ }), (function(e) {
2159
+ var t = e.partType;
2160
+ return t === "important" || t === "bold" ? "bold" : null;
2161
+ }));
2162
+ // CONCATENATED MODULE: ./src/Code/Code.tsx
2163
+ function $() {
2164
+ $ = Object.assign || function(e) {
2165
+ for (var t = 1; t < arguments.length; t++) {
2166
+ var a = arguments[t];
2167
+ for (var n in a) {
2168
+ if (Object.prototype.hasOwnProperty.call(a, n)) {
2169
+ e[n] = a[n];
2170
+ }
2171
+ }
2172
+ }
2173
+ return e;
2174
+ };
2175
+ return $.apply(this, arguments);
2569
2176
  }
2570
-
2571
- var lines = part.split('\n');
2572
-
2573
- if (lines.length === 1) {
2574
- return part;
2177
+ function N(e, t) {
2178
+ if (e == null) return {};
2179
+ var a = P(e, t);
2180
+ var n, r;
2181
+ if (Object.getOwnPropertySymbols) {
2182
+ var s = Object.getOwnPropertySymbols(e);
2183
+ for (r = 0; r < s.length; r++) {
2184
+ n = s[r];
2185
+ if (t.indexOf(n) >= 0) continue;
2186
+ if (!Object.prototype.propertyIsEnumerable.call(e, n)) continue;
2187
+ a[n] = e[n];
2188
+ }
2189
+ }
2190
+ return a;
2575
2191
  }
2576
-
2577
- return flatten_default()(lines.map(function (line, lineNo) {
2578
- var res = lineNo === 0 ? [] : ['\n'];
2579
- var indentMatch = line.match(/^(\s+)(.*)/);
2580
-
2581
- if (!indentMatch) {
2582
- res.push(line);
2583
- } else {
2584
- res.push( /*#__PURE__*/external_react_default.a.createElement("span", {
2585
- key: "".concat(idx.toString(), ":").concat(lineNo.toString())
2586
- }, makeIndentGuide(indentMatch[1].length)), indentMatch[2]);
2587
- }
2588
-
2589
- return res;
2590
- }));
2591
- }
2592
-
2593
- var content = typeof part.content === 'string' ? part.content : render(part.content);
2594
- return /*#__PURE__*/external_react_default.a.createElement(StyledToken, {
2595
- "data-part-type": part.type,
2596
- partType: part.type,
2597
- key: idx.toString()
2598
- }, content);
2599
- });
2600
- };
2601
-
2602
- var codeContent = render(tokens);
2603
- return /*#__PURE__*/external_react_default.a.createElement(Styled, _extends({
2604
- "data-test": "code",
2605
- ref: elementRef,
2606
- tabIndex: 0
2607
- }, otherProps), /*#__PURE__*/external_react_default.a.createElement(StyledCode, {
2608
- className: "language-".concat(languageUsed)
2609
- }, codeContent));
2610
- }
2611
-
2612
- Code.propTypes = propTypes;
2613
- /* harmony default export */ var Code_Code = (Code);
2614
- // CONCATENATED MODULE: ./src/Code/index.ts
2615
-
2616
-
2617
- /***/ }),
2618
-
2619
- /***/ 3:
2620
- /***/ (function(module, exports) {
2621
-
2622
- module.exports = require("styled-components");
2623
-
2624
- /***/ }),
2625
-
2626
- /***/ 67:
2627
- /***/ (function(module, exports) {
2628
-
2629
- module.exports = require("lodash/castArray");
2630
-
2631
- /***/ }),
2632
-
2633
- /***/ 81:
2634
- /***/ (function(module, exports) {
2635
-
2636
- module.exports = require("lodash/times");
2637
-
2638
- /***/ }),
2639
-
2640
- /***/ 82:
2641
- /***/ (function(module, exports) {
2642
-
2643
- module.exports = require("lodash/repeat");
2644
-
2645
- /***/ }),
2646
-
2647
- /***/ 84:
2648
- /***/ (function(module, exports) {
2649
-
2650
- module.exports = require("lodash/indexOf");
2651
-
2652
- /***/ })
2653
-
2654
- /******/ });
2192
+ function P(e, t) {
2193
+ if (e == null) return {};
2194
+ var a = {};
2195
+ var n = Object.keys(e);
2196
+ var r, s;
2197
+ for (s = 0; s < n.length; s++) {
2198
+ r = n[s];
2199
+ if (t.indexOf(r) >= 0) continue;
2200
+ a[r] = e[r];
2201
+ }
2202
+ return a;
2203
+ }
2204
+ // Prism requires special handling to work around issues related to global scope and
2205
+ // auto formatting. The import below points to an empty file which is replaced at build
2206
+ // time, see ./prism/build-isolated-prism.js for details.
2207
+ // typed as 'prismjs'
2208
+ var R = [ "bash", "clike", "css", "html", "json", "javascript", "js", "jsx", "typescript", "ts", "tsx", "markup", "mathml", "splunk-spl", "svg", "xml", "yaml", "yml" ];
2209
+ function C(e, t) {
2210
+ return v().tokenize(e, v().languages[t]);
2211
+ }
2212
+ var D = {
2213
+ elementRef: s().oneOfType([ s().func, s().object ]),
2214
+ indentChars: s().number,
2215
+ language: s().oneOf(R),
2216
+ languageFallback: s().oneOf(R),
2217
+ showIndentGuide: s().bool,
2218
+ value: s().string
2219
+ };
2220
+ function j(e) {
2221
+ var a = e.elementRef, n = e.indentChars, r = n === void 0 ? 4 : n, s = e.language, i = e.languageFallback, l = i === void 0 ? "javascript" : i, c = e.showIndentGuide, d = c === void 0 ? true : c, f = e.value, h = f === void 0 ? "" : f, v = N(e, [ "elementRef", "indentChars", "language", "languageFallback", "showIndentGuide", "value" ]);
2222
+ // @docs-props-type CodePropsBase
2223
+ var b = g()(" ", r);
2224
+ var y = function e(a) {
2225
+ var n = Math.floor(a / r);
2226
+ var s = a % r;
2227
+ var i = m()(n, (function(e) {
2228
+
2229
+ return t().createElement(A, {
2230
+ key: e.toString()
2231
+ }, b);
2232
+ }));
2233
+ if (s) {
2234
+ i.push(g()(" ", s));
2235
+ }
2236
+ return i;
2237
+ };
2238
+ // a fix for SUI-5425, where the Markdown component doesn't pass a valid language in some circumstances
2239
+ var k = p()(R, s) > -1;
2240
+ if (false) {}
2241
+ var F = k && s ? s : l;
2242
+ var w = C(h, F);
2243
+ var E = function e(a) {
2244
+ return o()(a).map((function(a, n) {
2245
+ if (typeof a === "string") {
2246
+ if (!d) {
2247
+ return a;
2248
+ }
2249
+ var r = a.split("\n");
2250
+ if (r.length === 1) {
2251
+ return a;
2252
+ }
2253
+ return u()(r.map((function(e, a) {
2254
+ var r = a === 0 ? [] : [ "\n" ];
2255
+ var s = e.match(/^(\s+)(.*)/);
2256
+ if (!s) {
2257
+ r.push(e);
2258
+ } else {
2259
+ r.push( t().createElement("span", {
2260
+ key: "".concat(n.toString(), ":").concat(a.toString())
2261
+ }, y(s[1].length)), s[2]);
2262
+ }
2263
+ return r;
2264
+ })));
2265
+ }
2266
+ var s = typeof a.content === "string" ? a.content : e(a.content);
2267
+
2268
+ return t().createElement(I, {
2269
+ "data-part-type": a.type,
2270
+ partType: a.type,
2271
+ key: n.toString()
2272
+ }, s);
2273
+ }));
2274
+ };
2275
+ var _ = E(w);
2276
+
2277
+ return t().createElement(x, $({
2278
+ "data-test": "code",
2279
+ ref: a,
2280
+ tabIndex: 0
2281
+ }, v), t().createElement(S, {
2282
+ className: "language-".concat(F)
2283
+ }, _));
2284
+ }
2285
+ j.propTypes = D;
2286
+ /* harmony default export */ const L = j;
2287
+ }) // CONCATENATED MODULE: ./src/Code/index.ts
2288
+ ();
2289
+ module.exports = n;
2290
+ /******/})();