musora-content-services 1.0.20 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/docs/config.js.html +124 -0
- package/docs/index.html +2 -2
- package/docs/module-Config.html +669 -0
- package/docs/module-Railcontent-Services.html +751 -0
- package/docs/{global.html → module-Sanity-Services.html} +52 -501
- package/docs/railcontent.js.html +178 -0
- package/docs/sanity.js.html +994 -0
- package/jsdoc.json +1 -1
- package/package.json +1 -1
- package/publish.sh +0 -0
- package/src/index.d.ts +2 -2
- package/src/index.js +32 -909
- package/src/services/config.js +52 -0
- package/src/services/railcontent.js +106 -0
- package/src/services/sanity.js +922 -0
- package/test/sanityQueryService.test.js +2 -2
- package/docs/data/search.json +0 -1
- package/docs/fonts/Inconsolata-Regular.ttf +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular.ttf +0 -0
- package/docs/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Semibold-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/docs/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/docs/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/docs/fonts/WorkSans-Bold.ttf +0 -0
- package/docs/index.js.html +0 -1122
- package/docs/scripts/core.js +0 -726
- package/docs/scripts/core.min.js +0 -23
- package/docs/scripts/resize.js +0 -90
- package/docs/scripts/search.min.js +0 -6
- package/docs/scripts/third-party/Apache-License-2.0.txt +0 -202
- package/docs/scripts/third-party/fuse.js +0 -9
- package/docs/scripts/third-party/hljs-line-num-original.js +0 -369
- package/docs/scripts/third-party/hljs-line-num.js +0 -1
- package/docs/scripts/third-party/hljs-original.js +0 -5171
- package/docs/scripts/third-party/hljs.js +0 -1
- package/docs/scripts/third-party/popper.js +0 -5
- package/docs/scripts/third-party/tippy.js +0 -1
- package/docs/scripts/third-party/tocbot.js +0 -672
- package/docs/scripts/third-party/tocbot.min.js +0 -1
- package/docs/styles/clean-jsdoc-theme-base.css +0 -1159
- package/docs/styles/clean-jsdoc-theme-dark.css +0 -412
- package/docs/styles/clean-jsdoc-theme-light.css +0 -482
- package/docs/styles/clean-jsdoc-theme-scrollbar.css +0 -30
- package/docs/styles/clean-jsdoc-theme-without-scrollbar.min.css +0 -1
- package/docs/styles/clean-jsdoc-theme.min.css +0 -1
- package/docs/styles/jsdoc-default.css +0 -692
- package/docs/styles/prettify-jsdoc.css +0 -111
- package/docs/styles/prettify-tomorrow.css +0 -132
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
// jshint multistr:true
|
|
2
|
-
|
|
3
|
-
(function (w, d) {
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
var TABLE_NAME = 'hljs-ln',
|
|
7
|
-
LINE_NAME = 'hljs-ln-line',
|
|
8
|
-
CODE_BLOCK_NAME = 'hljs-ln-code',
|
|
9
|
-
NUMBERS_BLOCK_NAME = 'hljs-ln-numbers',
|
|
10
|
-
NUMBER_LINE_NAME = 'hljs-ln-n',
|
|
11
|
-
DATA_ATTR_NAME = 'data-line-number',
|
|
12
|
-
BREAK_LINE_REGEXP = /\r\n|\r|\n/g;
|
|
13
|
-
|
|
14
|
-
if (w.hljs) {
|
|
15
|
-
w.hljs.initLineNumbersOnLoad = initLineNumbersOnLoad;
|
|
16
|
-
w.hljs.lineNumbersBlock = lineNumbersBlock;
|
|
17
|
-
w.hljs.lineNumbersValue = lineNumbersValue;
|
|
18
|
-
|
|
19
|
-
addStyles();
|
|
20
|
-
} else {
|
|
21
|
-
w.console.error('highlight.js not detected!');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function isHljsLnCodeDescendant(domElt) {
|
|
25
|
-
var curElt = domElt;
|
|
26
|
-
while (curElt) {
|
|
27
|
-
if (curElt.className && curElt.className.indexOf('hljs-ln-code') !== -1) {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
curElt = curElt.parentNode;
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getHljsLnTable(hljsLnDomElt) {
|
|
36
|
-
var curElt = hljsLnDomElt;
|
|
37
|
-
while (curElt.nodeName !== 'TABLE') {
|
|
38
|
-
curElt = curElt.parentNode;
|
|
39
|
-
}
|
|
40
|
-
return curElt;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Function to workaround a copy issue with Microsoft Edge.
|
|
44
|
-
// Due to hljs-ln wrapping the lines of code inside a <table> element,
|
|
45
|
-
// itself wrapped inside a <pre> element, window.getSelection().toString()
|
|
46
|
-
// does not contain any line breaks. So we need to get them back using the
|
|
47
|
-
// rendered code in the DOM as reference.
|
|
48
|
-
function edgeGetSelectedCodeLines(selection) {
|
|
49
|
-
// current selected text without line breaks
|
|
50
|
-
var selectionText = selection.toString();
|
|
51
|
-
|
|
52
|
-
// get the <td> element wrapping the first line of selected code
|
|
53
|
-
var tdAnchor = selection.anchorNode;
|
|
54
|
-
while (tdAnchor.nodeName !== 'TD') {
|
|
55
|
-
tdAnchor = tdAnchor.parentNode;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// get the <td> element wrapping the last line of selected code
|
|
59
|
-
var tdFocus = selection.focusNode;
|
|
60
|
-
while (tdFocus.nodeName !== 'TD') {
|
|
61
|
-
tdFocus = tdFocus.parentNode;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// extract line numbers
|
|
65
|
-
var firstLineNumber = parseInt(tdAnchor.dataset.lineNumber);
|
|
66
|
-
var lastLineNumber = parseInt(tdFocus.dataset.lineNumber);
|
|
67
|
-
|
|
68
|
-
// multi-lines copied case
|
|
69
|
-
if (firstLineNumber != lastLineNumber) {
|
|
70
|
-
|
|
71
|
-
var firstLineText = tdAnchor.textContent;
|
|
72
|
-
var lastLineText = tdFocus.textContent;
|
|
73
|
-
|
|
74
|
-
// if the selection was made backward, swap values
|
|
75
|
-
if (firstLineNumber > lastLineNumber) {
|
|
76
|
-
var tmp = firstLineNumber;
|
|
77
|
-
firstLineNumber = lastLineNumber;
|
|
78
|
-
lastLineNumber = tmp;
|
|
79
|
-
tmp = firstLineText;
|
|
80
|
-
firstLineText = lastLineText;
|
|
81
|
-
lastLineText = tmp;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// discard not copied characters in first line
|
|
85
|
-
while (selectionText.indexOf(firstLineText) !== 0) {
|
|
86
|
-
firstLineText = firstLineText.slice(1);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// discard not copied characters in last line
|
|
90
|
-
while (selectionText.lastIndexOf(lastLineText) === -1) {
|
|
91
|
-
lastLineText = lastLineText.slice(0, -1);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// reconstruct and return the real copied text
|
|
95
|
-
var selectedText = firstLineText;
|
|
96
|
-
var hljsLnTable = getHljsLnTable(tdAnchor);
|
|
97
|
-
for (var i = firstLineNumber + 1 ; i < lastLineNumber ; ++i) {
|
|
98
|
-
var codeLineSel = format('.{0}[{1}="{2}"]', [CODE_BLOCK_NAME, DATA_ATTR_NAME, i]);
|
|
99
|
-
var codeLineElt = hljsLnTable.querySelector(codeLineSel);
|
|
100
|
-
selectedText += '\n' + codeLineElt.textContent;
|
|
101
|
-
}
|
|
102
|
-
selectedText += '\n' + lastLineText;
|
|
103
|
-
return selectedText;
|
|
104
|
-
// single copied line case
|
|
105
|
-
} else {
|
|
106
|
-
return selectionText;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// ensure consistent code copy/paste behavior across all browsers
|
|
111
|
-
// (see https://github.com/wcoder/highlightjs-line-numbers.js/issues/51)
|
|
112
|
-
document.addEventListener('copy', function(e) {
|
|
113
|
-
// get current selection
|
|
114
|
-
var selection = window.getSelection();
|
|
115
|
-
// override behavior when one wants to copy line of codes
|
|
116
|
-
if (isHljsLnCodeDescendant(selection.anchorNode)) {
|
|
117
|
-
var selectionText;
|
|
118
|
-
// workaround an issue with Microsoft Edge as copied line breaks
|
|
119
|
-
// are removed otherwise from the selection string
|
|
120
|
-
if (window.navigator.userAgent.indexOf('Edge') !== -1) {
|
|
121
|
-
selectionText = edgeGetSelectedCodeLines(selection);
|
|
122
|
-
} else {
|
|
123
|
-
// other browsers can directly use the selection string
|
|
124
|
-
selectionText = selection.toString();
|
|
125
|
-
}
|
|
126
|
-
e.clipboardData.setData(
|
|
127
|
-
'text/plain',
|
|
128
|
-
selectionText
|
|
129
|
-
.replace(/(^\t)/gm, '')
|
|
130
|
-
);
|
|
131
|
-
e.preventDefault();
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
function addStyles () {
|
|
136
|
-
var css = d.createElement('style');
|
|
137
|
-
css.type = 'text/css';
|
|
138
|
-
css.innerHTML = format(
|
|
139
|
-
'.{0}{border-collapse:collapse}' +
|
|
140
|
-
'.{0} td{padding:0}' +
|
|
141
|
-
'.{1}:before{content:attr({2})}',
|
|
142
|
-
[
|
|
143
|
-
TABLE_NAME,
|
|
144
|
-
NUMBER_LINE_NAME,
|
|
145
|
-
DATA_ATTR_NAME
|
|
146
|
-
]);
|
|
147
|
-
d.getElementsByTagName('head')[0].appendChild(css);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function initLineNumbersOnLoad (options) {
|
|
151
|
-
if (d.readyState === 'interactive' || d.readyState === 'complete') {
|
|
152
|
-
documentReady(options);
|
|
153
|
-
} else {
|
|
154
|
-
w.addEventListener('DOMContentLoaded', function () {
|
|
155
|
-
documentReady(options);
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function documentReady (options) {
|
|
161
|
-
try {
|
|
162
|
-
var blocks = d.querySelectorAll('code.hljs,code.nohighlight');
|
|
163
|
-
|
|
164
|
-
for (var i in blocks) {
|
|
165
|
-
if (blocks.hasOwnProperty(i)) {
|
|
166
|
-
if (!isPluginDisabledForBlock(blocks[i])) {
|
|
167
|
-
lineNumbersBlock(blocks[i], options);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
} catch (e) {
|
|
172
|
-
w.console.error('LineNumbers error: ', e);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function isPluginDisabledForBlock(element) {
|
|
177
|
-
return element.classList.contains('nohljsln');
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function lineNumbersBlock (element, options) {
|
|
181
|
-
if (typeof element !== 'object') return;
|
|
182
|
-
|
|
183
|
-
async(function () {
|
|
184
|
-
element.innerHTML = lineNumbersInternal(element, options);
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function lineNumbersValue (value, options) {
|
|
189
|
-
if (typeof value !== 'string') return;
|
|
190
|
-
|
|
191
|
-
var element = document.createElement('code')
|
|
192
|
-
element.innerHTML = value
|
|
193
|
-
|
|
194
|
-
return lineNumbersInternal(element, options);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
function lineNumbersInternal (element, options) {
|
|
198
|
-
|
|
199
|
-
var internalOptions = mapOptions(element, options);
|
|
200
|
-
|
|
201
|
-
duplicateMultilineNodes(element);
|
|
202
|
-
|
|
203
|
-
return addLineNumbersBlockFor(element.innerHTML, internalOptions);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function addLineNumbersBlockFor (inputHtml, options) {
|
|
207
|
-
var lines = getLines(inputHtml);
|
|
208
|
-
|
|
209
|
-
// if last line contains only carriage return remove it
|
|
210
|
-
if (lines[lines.length-1].trim() === '') {
|
|
211
|
-
lines.pop();
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
if (lines.length > 1 || options.singleLine) {
|
|
215
|
-
var html = '';
|
|
216
|
-
|
|
217
|
-
for (var i = 0, l = lines.length; i < l; i++) {
|
|
218
|
-
html += format(
|
|
219
|
-
'<tr>' +
|
|
220
|
-
'<td class="{0} {1}" {3}="{5}">' +
|
|
221
|
-
'</td>' +
|
|
222
|
-
'<td class="{0} {4}" {3}="{5}">' +
|
|
223
|
-
'{6}' +
|
|
224
|
-
'</td>' +
|
|
225
|
-
'</tr>',
|
|
226
|
-
[
|
|
227
|
-
LINE_NAME,
|
|
228
|
-
NUMBERS_BLOCK_NAME,
|
|
229
|
-
NUMBER_LINE_NAME,
|
|
230
|
-
DATA_ATTR_NAME,
|
|
231
|
-
CODE_BLOCK_NAME,
|
|
232
|
-
i + options.startFrom,
|
|
233
|
-
lines[i].length > 0 ? lines[i] : ' '
|
|
234
|
-
]);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return format('<table class="{0}">{1}</table>', [ TABLE_NAME, html ]);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return inputHtml;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* @param {HTMLElement} element Code block.
|
|
245
|
-
* @param {Object} options External API options.
|
|
246
|
-
* @returns {Object} Internal API options.
|
|
247
|
-
*/
|
|
248
|
-
function mapOptions (element, options) {
|
|
249
|
-
options = options || {};
|
|
250
|
-
return {
|
|
251
|
-
singleLine: getSingleLineOption(options),
|
|
252
|
-
startFrom: getStartFromOption(element, options)
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
function getSingleLineOption (options) {
|
|
257
|
-
var defaultValue = false;
|
|
258
|
-
if (!!options.singleLine) {
|
|
259
|
-
return options.singleLine;
|
|
260
|
-
}
|
|
261
|
-
return defaultValue;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function getStartFromOption (element, options) {
|
|
265
|
-
var defaultValue = 1;
|
|
266
|
-
var startFrom = defaultValue;
|
|
267
|
-
|
|
268
|
-
if (isFinite(options.startFrom)) {
|
|
269
|
-
startFrom = options.startFrom;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// can be overridden because local option is priority
|
|
273
|
-
var value = getAttribute(element, 'data-ln-start-from');
|
|
274
|
-
if (value !== null) {
|
|
275
|
-
startFrom = toNumber(value, defaultValue);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
return startFrom;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Recursive method for fix multi-line elements implementation in highlight.js
|
|
283
|
-
* Doing deep passage on child nodes.
|
|
284
|
-
* @param {HTMLElement} element
|
|
285
|
-
*/
|
|
286
|
-
function duplicateMultilineNodes (element) {
|
|
287
|
-
var nodes = element.childNodes;
|
|
288
|
-
for (var node in nodes) {
|
|
289
|
-
if (nodes.hasOwnProperty(node)) {
|
|
290
|
-
var child = nodes[node];
|
|
291
|
-
if (getLinesCount(child.textContent) > 0) {
|
|
292
|
-
if (child.childNodes.length > 0) {
|
|
293
|
-
duplicateMultilineNodes(child);
|
|
294
|
-
} else {
|
|
295
|
-
duplicateMultilineNode(child.parentNode);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* Method for fix multi-line elements implementation in highlight.js
|
|
304
|
-
* @param {HTMLElement} element
|
|
305
|
-
*/
|
|
306
|
-
function duplicateMultilineNode (element) {
|
|
307
|
-
var className = element.className;
|
|
308
|
-
|
|
309
|
-
if ( ! /hljs-/.test(className)) return;
|
|
310
|
-
|
|
311
|
-
var lines = getLines(element.innerHTML);
|
|
312
|
-
|
|
313
|
-
for (var i = 0, result = ''; i < lines.length; i++) {
|
|
314
|
-
var lineText = lines[i].length > 0 ? lines[i] : ' ';
|
|
315
|
-
result += format('<span class="{0}">{1}</span>\n', [ className, lineText ]);
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
element.innerHTML = result.trim();
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
function getLines (text) {
|
|
322
|
-
if (text.length === 0) return [];
|
|
323
|
-
return text.split(BREAK_LINE_REGEXP);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
function getLinesCount (text) {
|
|
327
|
-
return (text.trim().match(BREAK_LINE_REGEXP) || []).length;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
///
|
|
331
|
-
/// HELPERS
|
|
332
|
-
///
|
|
333
|
-
|
|
334
|
-
function async (func) {
|
|
335
|
-
w.setTimeout(func, 0);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* {@link https://wcoder.github.io/notes/string-format-for-string-formating-in-javascript}
|
|
340
|
-
* @param {string} format
|
|
341
|
-
* @param {array} args
|
|
342
|
-
*/
|
|
343
|
-
function format (format, args) {
|
|
344
|
-
return format.replace(/\{(\d+)\}/g, function(m, n){
|
|
345
|
-
return args[n] !== undefined ? args[n] : m;
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* @param {HTMLElement} element Code block.
|
|
351
|
-
* @param {String} attrName Attribute name.
|
|
352
|
-
* @returns {String} Attribute value or empty.
|
|
353
|
-
*/
|
|
354
|
-
function getAttribute (element, attrName) {
|
|
355
|
-
return element.hasAttribute(attrName) ? element.getAttribute(attrName) : null;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* @param {String} str Source string.
|
|
360
|
-
* @param {Number} fallback Fallback value.
|
|
361
|
-
* @returns Parsed number or fallback value.
|
|
362
|
-
*/
|
|
363
|
-
function toNumber (str, fallback) {
|
|
364
|
-
if (!str) return fallback;
|
|
365
|
-
var number = Number(str);
|
|
366
|
-
return isFinite(number) ? number : fallback;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
}(window, document));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(r,o){"use strict";var e,l="hljs-ln",s="hljs-ln-line",f="hljs-ln-code",c="hljs-ln-numbers",u="hljs-ln-n",h="data-line-number",n=/\r\n|\r|\n/g;function t(e){for(var n=e.toString(),t=e.anchorNode;"TD"!==t.nodeName;)t=t.parentNode;for(var r=e.focusNode;"TD"!==r.nodeName;)r=r.parentNode;var e=parseInt(t.dataset.lineNumber),o=parseInt(r.dataset.lineNumber);if(e==o)return n;var a,i=t.textContent,l=r.textContent;for(o<e&&(a=e,e=o,o=a,a=i,i=l,l=a);0!==n.indexOf(i);)i=i.slice(1);for(;-1===n.lastIndexOf(l);)l=l.slice(0,-1);for(var s=i,c=function(e){for(var n=e;"TABLE"!==n.nodeName;)n=n.parentNode;return n}(t),u=e+1;u<o;++u){var d=v('.{0}[{1}="{2}"]',[f,h,u]);s+="\n"+c.querySelector(d).textContent}return s+="\n"+l}function a(e){try{var n,t=o.querySelectorAll("code.hljs,code.nohighlight");for(n in t)!t.hasOwnProperty(n)||t[n].classList.contains("nohljsln")||i(t[n],e)}catch(e){r.console.error("LineNumbers error: ",e)}}function i(e,n){"object"==typeof e&&r.setTimeout(function(){e.innerHTML=d(e,n)},0)}function d(e,n){var n={singleLine:function(e){return e.singleLine||!1}(n=(n=n)||{}),startFrom:function(e,n){var t=1;isFinite(n.startFrom)&&(t=n.startFrom);n=function(e,n){return e.hasAttribute(n)?e.getAttribute(n):null}(e,"data-ln-start-from");null!==n&&(t=function(e,n){if(!e)return n;e=Number(e);return isFinite(e)?e:n}(n,1));return t}(e,n)},e=(!function e(n){var t=n.childNodes;for(var r in t)!t.hasOwnProperty(r)||0<p((r=t[r]).textContent)&&(0<r.childNodes.length?e(r):m(r.parentNode))}(e),e.innerHTML),t=n,r=g(e);if(""===r[r.length-1].trim()&&r.pop(),1<r.length||t.singleLine){for(var o="",a=0,i=r.length;a<i;a++)o+=v('<tr><td class="{0} {1}" {3}="{5}"></td><td class="{0} {4}" {3}="{5}">{6}</td></tr>',[s,c,u,h,f,a+t.startFrom,0<r[a].length?r[a]:" "]);return v('<table class="{0}">{1}</table>',[l,o])}return e}function m(e){var n=e.className;if(/hljs-/.test(n)){for(var t=g(e.innerHTML),r=0,o="";r<t.length;r++)o+=v('<span class="{0}">{1}</span>\n',[n,0<t[r].length?t[r]:" "]);e.innerHTML=o.trim()}}function g(e){return 0===e.length?[]:e.split(n)}function p(e){return(e.trim().match(n)||[]).length}function v(e,t){return e.replace(/\{(\d+)\}/g,function(e,n){return void 0!==t[n]?t[n]:e})}r.hljs?(r.hljs.initLineNumbersOnLoad=function(e){"interactive"===o.readyState||"complete"===o.readyState?a(e):r.addEventListener("DOMContentLoaded",function(){a(e)})},r.hljs.lineNumbersBlock=i,r.hljs.lineNumbersValue=function(e,n){var t;if("string"==typeof e)return(t=document.createElement("code")).innerHTML=e,d(t,n)},(e=o.createElement("style")).type="text/css",e.innerHTML=v(".{0}{border-collapse:collapse}.{0} td{padding:0}.{1}:before{content:attr({2})}",[l,u,h]),o.getElementsByTagName("head")[0].appendChild(e)):r.console.error("highlight.js not detected!"),document.addEventListener("copy",function(e){var n=window.getSelection();!function(e){for(var n=e;n;){if(n.className&&-1!==n.className.indexOf("hljs-ln-code"))return 1;n=n.parentNode}}(n.anchorNode)||(n=-1!==window.navigator.userAgent.indexOf("Edge")?t(n):n.toString(),e.clipboardData.setData("text/plain",n.replace(/(^\t)/gm,"")),e.preventDefault())})}(window,document);
|