@opentuah/core 0.1.92 → 0.1.94
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/3d.js +31289 -53
- package/3d.js.map +136 -3
- package/{index-bsnn7gyg.js → index-bm6w895a.js} +2401 -138
- package/index-bm6w895a.js.map +62 -0
- package/index.js +1994 -20
- package/index.js.map +17 -7
- package/package.json +9 -9
- package/renderables/TextNode.d.ts +2 -3
- package/testing.js +1 -1
- package/index-bsnn7gyg.js.map +0 -57
package/index.js
CHANGED
|
@@ -11,7 +11,9 @@ import {
|
|
|
11
11
|
ConsolePosition,
|
|
12
12
|
DataPathsManager,
|
|
13
13
|
DebugOverlayCorner,
|
|
14
|
+
Edge,
|
|
14
15
|
ExtmarksController,
|
|
16
|
+
Gutter,
|
|
15
17
|
InternalKeyHandler,
|
|
16
18
|
KeyEvent,
|
|
17
19
|
KeyHandler,
|
|
@@ -19,6 +21,7 @@ import {
|
|
|
19
21
|
LinearScrollAccel,
|
|
20
22
|
LogLevel,
|
|
21
23
|
MacOSScrollAccel,
|
|
24
|
+
MeasureMode,
|
|
22
25
|
MouseButton,
|
|
23
26
|
MouseEvent,
|
|
24
27
|
MouseParser,
|
|
@@ -79,6 +82,7 @@ import {
|
|
|
79
82
|
dim,
|
|
80
83
|
env,
|
|
81
84
|
envRegistry,
|
|
85
|
+
exports_src,
|
|
82
86
|
extToFiletype,
|
|
83
87
|
fg,
|
|
84
88
|
fonts,
|
|
@@ -151,7 +155,7 @@ import {
|
|
|
151
155
|
white,
|
|
152
156
|
wrapWithDelegates,
|
|
153
157
|
yellow
|
|
154
|
-
} from "./index-
|
|
158
|
+
} from "./index-bm6w895a.js";
|
|
155
159
|
// src/text-buffer-view.ts
|
|
156
160
|
class TextBufferView {
|
|
157
161
|
lib;
|
|
@@ -2511,7 +2515,6 @@ class ASCIIFontRenderable extends FrameBufferRenderable {
|
|
|
2511
2515
|
}
|
|
2512
2516
|
}
|
|
2513
2517
|
// src/renderables/Box.ts
|
|
2514
|
-
import { Edge, Gutter } from "yoga-layout";
|
|
2515
2518
|
function isGapType(value) {
|
|
2516
2519
|
if (value === undefined) {
|
|
2517
2520
|
return true;
|
|
@@ -2731,7 +2734,6 @@ class BoxRenderable extends Renderable {
|
|
|
2731
2734
|
}
|
|
2732
2735
|
}
|
|
2733
2736
|
// src/renderables/TextBufferRenderable.ts
|
|
2734
|
-
import { MeasureMode } from "yoga-layout";
|
|
2735
2737
|
class TextBufferRenderable extends Renderable {
|
|
2736
2738
|
selectable = true;
|
|
2737
2739
|
_defaultFg;
|
|
@@ -4162,8 +4164,720 @@ class LineNumberRenderable extends Renderable {
|
|
|
4162
4164
|
}
|
|
4163
4165
|
}
|
|
4164
4166
|
|
|
4165
|
-
//
|
|
4166
|
-
|
|
4167
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/base.js
|
|
4168
|
+
class Diff {
|
|
4169
|
+
diff(oldStr, newStr, options = {}) {
|
|
4170
|
+
let callback;
|
|
4171
|
+
if (typeof options === "function") {
|
|
4172
|
+
callback = options;
|
|
4173
|
+
options = {};
|
|
4174
|
+
} else if ("callback" in options) {
|
|
4175
|
+
callback = options.callback;
|
|
4176
|
+
}
|
|
4177
|
+
const oldString = this.castInput(oldStr, options);
|
|
4178
|
+
const newString = this.castInput(newStr, options);
|
|
4179
|
+
const oldTokens = this.removeEmpty(this.tokenize(oldString, options));
|
|
4180
|
+
const newTokens = this.removeEmpty(this.tokenize(newString, options));
|
|
4181
|
+
return this.diffWithOptionsObj(oldTokens, newTokens, options, callback);
|
|
4182
|
+
}
|
|
4183
|
+
diffWithOptionsObj(oldTokens, newTokens, options, callback) {
|
|
4184
|
+
var _a;
|
|
4185
|
+
const done = (value) => {
|
|
4186
|
+
value = this.postProcess(value, options);
|
|
4187
|
+
if (callback) {
|
|
4188
|
+
setTimeout(function() {
|
|
4189
|
+
callback(value);
|
|
4190
|
+
}, 0);
|
|
4191
|
+
return;
|
|
4192
|
+
} else {
|
|
4193
|
+
return value;
|
|
4194
|
+
}
|
|
4195
|
+
};
|
|
4196
|
+
const newLen = newTokens.length, oldLen = oldTokens.length;
|
|
4197
|
+
let editLength = 1;
|
|
4198
|
+
let maxEditLength = newLen + oldLen;
|
|
4199
|
+
if (options.maxEditLength != null) {
|
|
4200
|
+
maxEditLength = Math.min(maxEditLength, options.maxEditLength);
|
|
4201
|
+
}
|
|
4202
|
+
const maxExecutionTime = (_a = options.timeout) !== null && _a !== undefined ? _a : Infinity;
|
|
4203
|
+
const abortAfterTimestamp = Date.now() + maxExecutionTime;
|
|
4204
|
+
const bestPath = [{ oldPos: -1, lastComponent: undefined }];
|
|
4205
|
+
let newPos = this.extractCommon(bestPath[0], newTokens, oldTokens, 0, options);
|
|
4206
|
+
if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
|
4207
|
+
return done(this.buildValues(bestPath[0].lastComponent, newTokens, oldTokens));
|
|
4208
|
+
}
|
|
4209
|
+
let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
|
|
4210
|
+
const execEditLength = () => {
|
|
4211
|
+
for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength);diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
|
|
4212
|
+
let basePath;
|
|
4213
|
+
const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
|
|
4214
|
+
if (removePath) {
|
|
4215
|
+
bestPath[diagonalPath - 1] = undefined;
|
|
4216
|
+
}
|
|
4217
|
+
let canAdd = false;
|
|
4218
|
+
if (addPath) {
|
|
4219
|
+
const addPathNewPos = addPath.oldPos - diagonalPath;
|
|
4220
|
+
canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
|
|
4221
|
+
}
|
|
4222
|
+
const canRemove = removePath && removePath.oldPos + 1 < oldLen;
|
|
4223
|
+
if (!canAdd && !canRemove) {
|
|
4224
|
+
bestPath[diagonalPath] = undefined;
|
|
4225
|
+
continue;
|
|
4226
|
+
}
|
|
4227
|
+
if (!canRemove || canAdd && removePath.oldPos < addPath.oldPos) {
|
|
4228
|
+
basePath = this.addToPath(addPath, true, false, 0, options);
|
|
4229
|
+
} else {
|
|
4230
|
+
basePath = this.addToPath(removePath, false, true, 1, options);
|
|
4231
|
+
}
|
|
4232
|
+
newPos = this.extractCommon(basePath, newTokens, oldTokens, diagonalPath, options);
|
|
4233
|
+
if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
|
|
4234
|
+
return done(this.buildValues(basePath.lastComponent, newTokens, oldTokens)) || true;
|
|
4235
|
+
} else {
|
|
4236
|
+
bestPath[diagonalPath] = basePath;
|
|
4237
|
+
if (basePath.oldPos + 1 >= oldLen) {
|
|
4238
|
+
maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
|
|
4239
|
+
}
|
|
4240
|
+
if (newPos + 1 >= newLen) {
|
|
4241
|
+
minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
|
|
4242
|
+
}
|
|
4243
|
+
}
|
|
4244
|
+
}
|
|
4245
|
+
editLength++;
|
|
4246
|
+
};
|
|
4247
|
+
if (callback) {
|
|
4248
|
+
(function exec() {
|
|
4249
|
+
setTimeout(function() {
|
|
4250
|
+
if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
|
|
4251
|
+
return callback(undefined);
|
|
4252
|
+
}
|
|
4253
|
+
if (!execEditLength()) {
|
|
4254
|
+
exec();
|
|
4255
|
+
}
|
|
4256
|
+
}, 0);
|
|
4257
|
+
})();
|
|
4258
|
+
} else {
|
|
4259
|
+
while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
|
|
4260
|
+
const ret = execEditLength();
|
|
4261
|
+
if (ret) {
|
|
4262
|
+
return ret;
|
|
4263
|
+
}
|
|
4264
|
+
}
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
addToPath(path, added, removed, oldPosInc, options) {
|
|
4268
|
+
const last = path.lastComponent;
|
|
4269
|
+
if (last && !options.oneChangePerToken && last.added === added && last.removed === removed) {
|
|
4270
|
+
return {
|
|
4271
|
+
oldPos: path.oldPos + oldPosInc,
|
|
4272
|
+
lastComponent: { count: last.count + 1, added, removed, previousComponent: last.previousComponent }
|
|
4273
|
+
};
|
|
4274
|
+
} else {
|
|
4275
|
+
return {
|
|
4276
|
+
oldPos: path.oldPos + oldPosInc,
|
|
4277
|
+
lastComponent: { count: 1, added, removed, previousComponent: last }
|
|
4278
|
+
};
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
extractCommon(basePath, newTokens, oldTokens, diagonalPath, options) {
|
|
4282
|
+
const newLen = newTokens.length, oldLen = oldTokens.length;
|
|
4283
|
+
let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
|
|
4284
|
+
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(oldTokens[oldPos + 1], newTokens[newPos + 1], options)) {
|
|
4285
|
+
newPos++;
|
|
4286
|
+
oldPos++;
|
|
4287
|
+
commonCount++;
|
|
4288
|
+
if (options.oneChangePerToken) {
|
|
4289
|
+
basePath.lastComponent = { count: 1, previousComponent: basePath.lastComponent, added: false, removed: false };
|
|
4290
|
+
}
|
|
4291
|
+
}
|
|
4292
|
+
if (commonCount && !options.oneChangePerToken) {
|
|
4293
|
+
basePath.lastComponent = { count: commonCount, previousComponent: basePath.lastComponent, added: false, removed: false };
|
|
4294
|
+
}
|
|
4295
|
+
basePath.oldPos = oldPos;
|
|
4296
|
+
return newPos;
|
|
4297
|
+
}
|
|
4298
|
+
equals(left, right, options) {
|
|
4299
|
+
if (options.comparator) {
|
|
4300
|
+
return options.comparator(left, right);
|
|
4301
|
+
} else {
|
|
4302
|
+
return left === right || !!options.ignoreCase && left.toLowerCase() === right.toLowerCase();
|
|
4303
|
+
}
|
|
4304
|
+
}
|
|
4305
|
+
removeEmpty(array) {
|
|
4306
|
+
const ret = [];
|
|
4307
|
+
for (let i = 0;i < array.length; i++) {
|
|
4308
|
+
if (array[i]) {
|
|
4309
|
+
ret.push(array[i]);
|
|
4310
|
+
}
|
|
4311
|
+
}
|
|
4312
|
+
return ret;
|
|
4313
|
+
}
|
|
4314
|
+
castInput(value, options) {
|
|
4315
|
+
return value;
|
|
4316
|
+
}
|
|
4317
|
+
tokenize(value, options) {
|
|
4318
|
+
return Array.from(value);
|
|
4319
|
+
}
|
|
4320
|
+
join(chars) {
|
|
4321
|
+
return chars.join("");
|
|
4322
|
+
}
|
|
4323
|
+
postProcess(changeObjects, options) {
|
|
4324
|
+
return changeObjects;
|
|
4325
|
+
}
|
|
4326
|
+
get useLongestToken() {
|
|
4327
|
+
return false;
|
|
4328
|
+
}
|
|
4329
|
+
buildValues(lastComponent, newTokens, oldTokens) {
|
|
4330
|
+
const components = [];
|
|
4331
|
+
let nextComponent;
|
|
4332
|
+
while (lastComponent) {
|
|
4333
|
+
components.push(lastComponent);
|
|
4334
|
+
nextComponent = lastComponent.previousComponent;
|
|
4335
|
+
delete lastComponent.previousComponent;
|
|
4336
|
+
lastComponent = nextComponent;
|
|
4337
|
+
}
|
|
4338
|
+
components.reverse();
|
|
4339
|
+
const componentLen = components.length;
|
|
4340
|
+
let componentPos = 0, newPos = 0, oldPos = 0;
|
|
4341
|
+
for (;componentPos < componentLen; componentPos++) {
|
|
4342
|
+
const component = components[componentPos];
|
|
4343
|
+
if (!component.removed) {
|
|
4344
|
+
if (!component.added && this.useLongestToken) {
|
|
4345
|
+
let value = newTokens.slice(newPos, newPos + component.count);
|
|
4346
|
+
value = value.map(function(value2, i) {
|
|
4347
|
+
const oldValue = oldTokens[oldPos + i];
|
|
4348
|
+
return oldValue.length > value2.length ? oldValue : value2;
|
|
4349
|
+
});
|
|
4350
|
+
component.value = this.join(value);
|
|
4351
|
+
} else {
|
|
4352
|
+
component.value = this.join(newTokens.slice(newPos, newPos + component.count));
|
|
4353
|
+
}
|
|
4354
|
+
newPos += component.count;
|
|
4355
|
+
if (!component.added) {
|
|
4356
|
+
oldPos += component.count;
|
|
4357
|
+
}
|
|
4358
|
+
} else {
|
|
4359
|
+
component.value = this.join(oldTokens.slice(oldPos, oldPos + component.count));
|
|
4360
|
+
oldPos += component.count;
|
|
4361
|
+
}
|
|
4362
|
+
}
|
|
4363
|
+
return components;
|
|
4364
|
+
}
|
|
4365
|
+
}
|
|
4366
|
+
|
|
4367
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/character.js
|
|
4368
|
+
class CharacterDiff extends Diff {
|
|
4369
|
+
}
|
|
4370
|
+
var characterDiff = new CharacterDiff;
|
|
4371
|
+
|
|
4372
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/util/string.js
|
|
4373
|
+
function longestCommonPrefix(str1, str2) {
|
|
4374
|
+
let i;
|
|
4375
|
+
for (i = 0;i < str1.length && i < str2.length; i++) {
|
|
4376
|
+
if (str1[i] != str2[i]) {
|
|
4377
|
+
return str1.slice(0, i);
|
|
4378
|
+
}
|
|
4379
|
+
}
|
|
4380
|
+
return str1.slice(0, i);
|
|
4381
|
+
}
|
|
4382
|
+
function longestCommonSuffix(str1, str2) {
|
|
4383
|
+
let i;
|
|
4384
|
+
if (!str1 || !str2 || str1[str1.length - 1] != str2[str2.length - 1]) {
|
|
4385
|
+
return "";
|
|
4386
|
+
}
|
|
4387
|
+
for (i = 0;i < str1.length && i < str2.length; i++) {
|
|
4388
|
+
if (str1[str1.length - (i + 1)] != str2[str2.length - (i + 1)]) {
|
|
4389
|
+
return str1.slice(-i);
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
return str1.slice(-i);
|
|
4393
|
+
}
|
|
4394
|
+
function replacePrefix(string, oldPrefix, newPrefix) {
|
|
4395
|
+
if (string.slice(0, oldPrefix.length) != oldPrefix) {
|
|
4396
|
+
throw Error(`string ${JSON.stringify(string)} doesn't start with prefix ${JSON.stringify(oldPrefix)}; this is a bug`);
|
|
4397
|
+
}
|
|
4398
|
+
return newPrefix + string.slice(oldPrefix.length);
|
|
4399
|
+
}
|
|
4400
|
+
function replaceSuffix(string, oldSuffix, newSuffix) {
|
|
4401
|
+
if (!oldSuffix) {
|
|
4402
|
+
return string + newSuffix;
|
|
4403
|
+
}
|
|
4404
|
+
if (string.slice(-oldSuffix.length) != oldSuffix) {
|
|
4405
|
+
throw Error(`string ${JSON.stringify(string)} doesn't end with suffix ${JSON.stringify(oldSuffix)}; this is a bug`);
|
|
4406
|
+
}
|
|
4407
|
+
return string.slice(0, -oldSuffix.length) + newSuffix;
|
|
4408
|
+
}
|
|
4409
|
+
function removePrefix(string, oldPrefix) {
|
|
4410
|
+
return replacePrefix(string, oldPrefix, "");
|
|
4411
|
+
}
|
|
4412
|
+
function removeSuffix(string, oldSuffix) {
|
|
4413
|
+
return replaceSuffix(string, oldSuffix, "");
|
|
4414
|
+
}
|
|
4415
|
+
function maximumOverlap(string1, string2) {
|
|
4416
|
+
return string2.slice(0, overlapCount(string1, string2));
|
|
4417
|
+
}
|
|
4418
|
+
function overlapCount(a, b) {
|
|
4419
|
+
let startA = 0;
|
|
4420
|
+
if (a.length > b.length) {
|
|
4421
|
+
startA = a.length - b.length;
|
|
4422
|
+
}
|
|
4423
|
+
let endB = b.length;
|
|
4424
|
+
if (a.length < b.length) {
|
|
4425
|
+
endB = a.length;
|
|
4426
|
+
}
|
|
4427
|
+
const map = Array(endB);
|
|
4428
|
+
let k = 0;
|
|
4429
|
+
map[0] = 0;
|
|
4430
|
+
for (let j = 1;j < endB; j++) {
|
|
4431
|
+
if (b[j] == b[k]) {
|
|
4432
|
+
map[j] = map[k];
|
|
4433
|
+
} else {
|
|
4434
|
+
map[j] = k;
|
|
4435
|
+
}
|
|
4436
|
+
while (k > 0 && b[j] != b[k]) {
|
|
4437
|
+
k = map[k];
|
|
4438
|
+
}
|
|
4439
|
+
if (b[j] == b[k]) {
|
|
4440
|
+
k++;
|
|
4441
|
+
}
|
|
4442
|
+
}
|
|
4443
|
+
k = 0;
|
|
4444
|
+
for (let i = startA;i < a.length; i++) {
|
|
4445
|
+
while (k > 0 && a[i] != b[k]) {
|
|
4446
|
+
k = map[k];
|
|
4447
|
+
}
|
|
4448
|
+
if (a[i] == b[k]) {
|
|
4449
|
+
k++;
|
|
4450
|
+
}
|
|
4451
|
+
}
|
|
4452
|
+
return k;
|
|
4453
|
+
}
|
|
4454
|
+
function trailingWs(string) {
|
|
4455
|
+
let i;
|
|
4456
|
+
for (i = string.length - 1;i >= 0; i--) {
|
|
4457
|
+
if (!string[i].match(/\s/)) {
|
|
4458
|
+
break;
|
|
4459
|
+
}
|
|
4460
|
+
}
|
|
4461
|
+
return string.substring(i + 1);
|
|
4462
|
+
}
|
|
4463
|
+
function leadingWs(string) {
|
|
4464
|
+
const match = string.match(/^\s*/);
|
|
4465
|
+
return match ? match[0] : "";
|
|
4466
|
+
}
|
|
4467
|
+
|
|
4468
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/word.js
|
|
4469
|
+
var extendedWordChars = "a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";
|
|
4470
|
+
var tokenizeIncludingWhitespace = new RegExp(`[${extendedWordChars}]+|\\s+|[^${extendedWordChars}]`, "ug");
|
|
4471
|
+
|
|
4472
|
+
class WordDiff extends Diff {
|
|
4473
|
+
equals(left, right, options) {
|
|
4474
|
+
if (options.ignoreCase) {
|
|
4475
|
+
left = left.toLowerCase();
|
|
4476
|
+
right = right.toLowerCase();
|
|
4477
|
+
}
|
|
4478
|
+
return left.trim() === right.trim();
|
|
4479
|
+
}
|
|
4480
|
+
tokenize(value, options = {}) {
|
|
4481
|
+
let parts;
|
|
4482
|
+
if (options.intlSegmenter) {
|
|
4483
|
+
const segmenter = options.intlSegmenter;
|
|
4484
|
+
if (segmenter.resolvedOptions().granularity != "word") {
|
|
4485
|
+
throw new Error('The segmenter passed must have a granularity of "word"');
|
|
4486
|
+
}
|
|
4487
|
+
parts = Array.from(segmenter.segment(value), (segment) => segment.segment);
|
|
4488
|
+
} else {
|
|
4489
|
+
parts = value.match(tokenizeIncludingWhitespace) || [];
|
|
4490
|
+
}
|
|
4491
|
+
const tokens = [];
|
|
4492
|
+
let prevPart = null;
|
|
4493
|
+
parts.forEach((part) => {
|
|
4494
|
+
if (/\s/.test(part)) {
|
|
4495
|
+
if (prevPart == null) {
|
|
4496
|
+
tokens.push(part);
|
|
4497
|
+
} else {
|
|
4498
|
+
tokens.push(tokens.pop() + part);
|
|
4499
|
+
}
|
|
4500
|
+
} else if (prevPart != null && /\s/.test(prevPart)) {
|
|
4501
|
+
if (tokens[tokens.length - 1] == prevPart) {
|
|
4502
|
+
tokens.push(tokens.pop() + part);
|
|
4503
|
+
} else {
|
|
4504
|
+
tokens.push(prevPart + part);
|
|
4505
|
+
}
|
|
4506
|
+
} else {
|
|
4507
|
+
tokens.push(part);
|
|
4508
|
+
}
|
|
4509
|
+
prevPart = part;
|
|
4510
|
+
});
|
|
4511
|
+
return tokens;
|
|
4512
|
+
}
|
|
4513
|
+
join(tokens) {
|
|
4514
|
+
return tokens.map((token, i) => {
|
|
4515
|
+
if (i == 0) {
|
|
4516
|
+
return token;
|
|
4517
|
+
} else {
|
|
4518
|
+
return token.replace(/^\s+/, "");
|
|
4519
|
+
}
|
|
4520
|
+
}).join("");
|
|
4521
|
+
}
|
|
4522
|
+
postProcess(changes, options) {
|
|
4523
|
+
if (!changes || options.oneChangePerToken) {
|
|
4524
|
+
return changes;
|
|
4525
|
+
}
|
|
4526
|
+
let lastKeep = null;
|
|
4527
|
+
let insertion = null;
|
|
4528
|
+
let deletion = null;
|
|
4529
|
+
changes.forEach((change) => {
|
|
4530
|
+
if (change.added) {
|
|
4531
|
+
insertion = change;
|
|
4532
|
+
} else if (change.removed) {
|
|
4533
|
+
deletion = change;
|
|
4534
|
+
} else {
|
|
4535
|
+
if (insertion || deletion) {
|
|
4536
|
+
dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, change);
|
|
4537
|
+
}
|
|
4538
|
+
lastKeep = change;
|
|
4539
|
+
insertion = null;
|
|
4540
|
+
deletion = null;
|
|
4541
|
+
}
|
|
4542
|
+
});
|
|
4543
|
+
if (insertion || deletion) {
|
|
4544
|
+
dedupeWhitespaceInChangeObjects(lastKeep, deletion, insertion, null);
|
|
4545
|
+
}
|
|
4546
|
+
return changes;
|
|
4547
|
+
}
|
|
4548
|
+
}
|
|
4549
|
+
var wordDiff = new WordDiff;
|
|
4550
|
+
function dedupeWhitespaceInChangeObjects(startKeep, deletion, insertion, endKeep) {
|
|
4551
|
+
if (deletion && insertion) {
|
|
4552
|
+
const oldWsPrefix = leadingWs(deletion.value);
|
|
4553
|
+
const oldWsSuffix = trailingWs(deletion.value);
|
|
4554
|
+
const newWsPrefix = leadingWs(insertion.value);
|
|
4555
|
+
const newWsSuffix = trailingWs(insertion.value);
|
|
4556
|
+
if (startKeep) {
|
|
4557
|
+
const commonWsPrefix = longestCommonPrefix(oldWsPrefix, newWsPrefix);
|
|
4558
|
+
startKeep.value = replaceSuffix(startKeep.value, newWsPrefix, commonWsPrefix);
|
|
4559
|
+
deletion.value = removePrefix(deletion.value, commonWsPrefix);
|
|
4560
|
+
insertion.value = removePrefix(insertion.value, commonWsPrefix);
|
|
4561
|
+
}
|
|
4562
|
+
if (endKeep) {
|
|
4563
|
+
const commonWsSuffix = longestCommonSuffix(oldWsSuffix, newWsSuffix);
|
|
4564
|
+
endKeep.value = replacePrefix(endKeep.value, newWsSuffix, commonWsSuffix);
|
|
4565
|
+
deletion.value = removeSuffix(deletion.value, commonWsSuffix);
|
|
4566
|
+
insertion.value = removeSuffix(insertion.value, commonWsSuffix);
|
|
4567
|
+
}
|
|
4568
|
+
} else if (insertion) {
|
|
4569
|
+
if (startKeep) {
|
|
4570
|
+
const ws = leadingWs(insertion.value);
|
|
4571
|
+
insertion.value = insertion.value.substring(ws.length);
|
|
4572
|
+
}
|
|
4573
|
+
if (endKeep) {
|
|
4574
|
+
const ws = leadingWs(endKeep.value);
|
|
4575
|
+
endKeep.value = endKeep.value.substring(ws.length);
|
|
4576
|
+
}
|
|
4577
|
+
} else if (startKeep && endKeep) {
|
|
4578
|
+
const newWsFull = leadingWs(endKeep.value), delWsStart = leadingWs(deletion.value), delWsEnd = trailingWs(deletion.value);
|
|
4579
|
+
const newWsStart = longestCommonPrefix(newWsFull, delWsStart);
|
|
4580
|
+
deletion.value = removePrefix(deletion.value, newWsStart);
|
|
4581
|
+
const newWsEnd = longestCommonSuffix(removePrefix(newWsFull, newWsStart), delWsEnd);
|
|
4582
|
+
deletion.value = removeSuffix(deletion.value, newWsEnd);
|
|
4583
|
+
endKeep.value = replacePrefix(endKeep.value, newWsFull, newWsEnd);
|
|
4584
|
+
startKeep.value = replaceSuffix(startKeep.value, newWsFull, newWsFull.slice(0, newWsFull.length - newWsEnd.length));
|
|
4585
|
+
} else if (endKeep) {
|
|
4586
|
+
const endKeepWsPrefix = leadingWs(endKeep.value);
|
|
4587
|
+
const deletionWsSuffix = trailingWs(deletion.value);
|
|
4588
|
+
const overlap = maximumOverlap(deletionWsSuffix, endKeepWsPrefix);
|
|
4589
|
+
deletion.value = removeSuffix(deletion.value, overlap);
|
|
4590
|
+
} else if (startKeep) {
|
|
4591
|
+
const startKeepWsSuffix = trailingWs(startKeep.value);
|
|
4592
|
+
const deletionWsPrefix = leadingWs(deletion.value);
|
|
4593
|
+
const overlap = maximumOverlap(startKeepWsSuffix, deletionWsPrefix);
|
|
4594
|
+
deletion.value = removePrefix(deletion.value, overlap);
|
|
4595
|
+
}
|
|
4596
|
+
}
|
|
4597
|
+
|
|
4598
|
+
class WordsWithSpaceDiff extends Diff {
|
|
4599
|
+
tokenize(value) {
|
|
4600
|
+
const regex = new RegExp(`(\\r?\\n)|[${extendedWordChars}]+|[^\\S\\n\\r]+|[^${extendedWordChars}]`, "ug");
|
|
4601
|
+
return value.match(regex) || [];
|
|
4602
|
+
}
|
|
4603
|
+
}
|
|
4604
|
+
var wordsWithSpaceDiff = new WordsWithSpaceDiff;
|
|
4605
|
+
|
|
4606
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/line.js
|
|
4607
|
+
class LineDiff extends Diff {
|
|
4608
|
+
constructor() {
|
|
4609
|
+
super(...arguments);
|
|
4610
|
+
this.tokenize = tokenize;
|
|
4611
|
+
}
|
|
4612
|
+
equals(left, right, options) {
|
|
4613
|
+
if (options.ignoreWhitespace) {
|
|
4614
|
+
if (!options.newlineIsToken || !left.includes(`
|
|
4615
|
+
`)) {
|
|
4616
|
+
left = left.trim();
|
|
4617
|
+
}
|
|
4618
|
+
if (!options.newlineIsToken || !right.includes(`
|
|
4619
|
+
`)) {
|
|
4620
|
+
right = right.trim();
|
|
4621
|
+
}
|
|
4622
|
+
} else if (options.ignoreNewlineAtEof && !options.newlineIsToken) {
|
|
4623
|
+
if (left.endsWith(`
|
|
4624
|
+
`)) {
|
|
4625
|
+
left = left.slice(0, -1);
|
|
4626
|
+
}
|
|
4627
|
+
if (right.endsWith(`
|
|
4628
|
+
`)) {
|
|
4629
|
+
right = right.slice(0, -1);
|
|
4630
|
+
}
|
|
4631
|
+
}
|
|
4632
|
+
return super.equals(left, right, options);
|
|
4633
|
+
}
|
|
4634
|
+
}
|
|
4635
|
+
var lineDiff = new LineDiff;
|
|
4636
|
+
function tokenize(value, options) {
|
|
4637
|
+
if (options.stripTrailingCr) {
|
|
4638
|
+
value = value.replace(/\r\n/g, `
|
|
4639
|
+
`);
|
|
4640
|
+
}
|
|
4641
|
+
const retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
|
|
4642
|
+
if (!linesAndNewlines[linesAndNewlines.length - 1]) {
|
|
4643
|
+
linesAndNewlines.pop();
|
|
4644
|
+
}
|
|
4645
|
+
for (let i = 0;i < linesAndNewlines.length; i++) {
|
|
4646
|
+
const line = linesAndNewlines[i];
|
|
4647
|
+
if (i % 2 && !options.newlineIsToken) {
|
|
4648
|
+
retLines[retLines.length - 1] += line;
|
|
4649
|
+
} else {
|
|
4650
|
+
retLines.push(line);
|
|
4651
|
+
}
|
|
4652
|
+
}
|
|
4653
|
+
return retLines;
|
|
4654
|
+
}
|
|
4655
|
+
|
|
4656
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/sentence.js
|
|
4657
|
+
function isSentenceEndPunct(char) {
|
|
4658
|
+
return char == "." || char == "!" || char == "?";
|
|
4659
|
+
}
|
|
4660
|
+
|
|
4661
|
+
class SentenceDiff extends Diff {
|
|
4662
|
+
tokenize(value) {
|
|
4663
|
+
var _a;
|
|
4664
|
+
const result = [];
|
|
4665
|
+
let tokenStartI = 0;
|
|
4666
|
+
for (let i = 0;i < value.length; i++) {
|
|
4667
|
+
if (i == value.length - 1) {
|
|
4668
|
+
result.push(value.slice(tokenStartI));
|
|
4669
|
+
break;
|
|
4670
|
+
}
|
|
4671
|
+
if (isSentenceEndPunct(value[i]) && value[i + 1].match(/\s/)) {
|
|
4672
|
+
result.push(value.slice(tokenStartI, i + 1));
|
|
4673
|
+
i = tokenStartI = i + 1;
|
|
4674
|
+
while ((_a = value[i + 1]) === null || _a === undefined ? undefined : _a.match(/\s/)) {
|
|
4675
|
+
i++;
|
|
4676
|
+
}
|
|
4677
|
+
result.push(value.slice(tokenStartI, i + 1));
|
|
4678
|
+
tokenStartI = i + 1;
|
|
4679
|
+
}
|
|
4680
|
+
}
|
|
4681
|
+
return result;
|
|
4682
|
+
}
|
|
4683
|
+
}
|
|
4684
|
+
var sentenceDiff = new SentenceDiff;
|
|
4685
|
+
|
|
4686
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/css.js
|
|
4687
|
+
class CssDiff extends Diff {
|
|
4688
|
+
tokenize(value) {
|
|
4689
|
+
return value.split(/([{}:;,]|\s+)/);
|
|
4690
|
+
}
|
|
4691
|
+
}
|
|
4692
|
+
var cssDiff = new CssDiff;
|
|
4693
|
+
|
|
4694
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/json.js
|
|
4695
|
+
class JsonDiff extends Diff {
|
|
4696
|
+
constructor() {
|
|
4697
|
+
super(...arguments);
|
|
4698
|
+
this.tokenize = tokenize;
|
|
4699
|
+
}
|
|
4700
|
+
get useLongestToken() {
|
|
4701
|
+
return true;
|
|
4702
|
+
}
|
|
4703
|
+
castInput(value, options) {
|
|
4704
|
+
const { undefinedReplacement, stringifyReplacer = (k, v) => typeof v === "undefined" ? undefinedReplacement : v } = options;
|
|
4705
|
+
return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), null, " ");
|
|
4706
|
+
}
|
|
4707
|
+
equals(left, right, options) {
|
|
4708
|
+
return super.equals(left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1"), options);
|
|
4709
|
+
}
|
|
4710
|
+
}
|
|
4711
|
+
var jsonDiff = new JsonDiff;
|
|
4712
|
+
function canonicalize(obj, stack, replacementStack, replacer, key) {
|
|
4713
|
+
stack = stack || [];
|
|
4714
|
+
replacementStack = replacementStack || [];
|
|
4715
|
+
if (replacer) {
|
|
4716
|
+
obj = replacer(key === undefined ? "" : key, obj);
|
|
4717
|
+
}
|
|
4718
|
+
let i;
|
|
4719
|
+
for (i = 0;i < stack.length; i += 1) {
|
|
4720
|
+
if (stack[i] === obj) {
|
|
4721
|
+
return replacementStack[i];
|
|
4722
|
+
}
|
|
4723
|
+
}
|
|
4724
|
+
let canonicalizedObj;
|
|
4725
|
+
if (Object.prototype.toString.call(obj) === "[object Array]") {
|
|
4726
|
+
stack.push(obj);
|
|
4727
|
+
canonicalizedObj = new Array(obj.length);
|
|
4728
|
+
replacementStack.push(canonicalizedObj);
|
|
4729
|
+
for (i = 0;i < obj.length; i += 1) {
|
|
4730
|
+
canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, String(i));
|
|
4731
|
+
}
|
|
4732
|
+
stack.pop();
|
|
4733
|
+
replacementStack.pop();
|
|
4734
|
+
return canonicalizedObj;
|
|
4735
|
+
}
|
|
4736
|
+
if (obj && obj.toJSON) {
|
|
4737
|
+
obj = obj.toJSON();
|
|
4738
|
+
}
|
|
4739
|
+
if (typeof obj === "object" && obj !== null) {
|
|
4740
|
+
stack.push(obj);
|
|
4741
|
+
canonicalizedObj = {};
|
|
4742
|
+
replacementStack.push(canonicalizedObj);
|
|
4743
|
+
const sortedKeys = [];
|
|
4744
|
+
let key2;
|
|
4745
|
+
for (key2 in obj) {
|
|
4746
|
+
if (Object.prototype.hasOwnProperty.call(obj, key2)) {
|
|
4747
|
+
sortedKeys.push(key2);
|
|
4748
|
+
}
|
|
4749
|
+
}
|
|
4750
|
+
sortedKeys.sort();
|
|
4751
|
+
for (i = 0;i < sortedKeys.length; i += 1) {
|
|
4752
|
+
key2 = sortedKeys[i];
|
|
4753
|
+
canonicalizedObj[key2] = canonicalize(obj[key2], stack, replacementStack, replacer, key2);
|
|
4754
|
+
}
|
|
4755
|
+
stack.pop();
|
|
4756
|
+
replacementStack.pop();
|
|
4757
|
+
} else {
|
|
4758
|
+
canonicalizedObj = obj;
|
|
4759
|
+
}
|
|
4760
|
+
return canonicalizedObj;
|
|
4761
|
+
}
|
|
4762
|
+
|
|
4763
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/diff/array.js
|
|
4764
|
+
class ArrayDiff extends Diff {
|
|
4765
|
+
tokenize(value) {
|
|
4766
|
+
return value.slice();
|
|
4767
|
+
}
|
|
4768
|
+
join(value) {
|
|
4769
|
+
return value;
|
|
4770
|
+
}
|
|
4771
|
+
removeEmpty(value) {
|
|
4772
|
+
return value;
|
|
4773
|
+
}
|
|
4774
|
+
}
|
|
4775
|
+
var arrayDiff = new ArrayDiff;
|
|
4776
|
+
|
|
4777
|
+
// ../../node_modules/.bun/diff@8.0.2/node_modules/diff/libesm/patch/parse.js
|
|
4778
|
+
function parsePatch(uniDiff) {
|
|
4779
|
+
const diffstr = uniDiff.split(/\n/), list = [];
|
|
4780
|
+
let i = 0;
|
|
4781
|
+
function parseIndex() {
|
|
4782
|
+
const index = {};
|
|
4783
|
+
list.push(index);
|
|
4784
|
+
while (i < diffstr.length) {
|
|
4785
|
+
const line = diffstr[i];
|
|
4786
|
+
if (/^(---|\+\+\+|@@)\s/.test(line)) {
|
|
4787
|
+
break;
|
|
4788
|
+
}
|
|
4789
|
+
const header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
|
|
4790
|
+
if (header) {
|
|
4791
|
+
index.index = header[1];
|
|
4792
|
+
}
|
|
4793
|
+
i++;
|
|
4794
|
+
}
|
|
4795
|
+
parseFileHeader(index);
|
|
4796
|
+
parseFileHeader(index);
|
|
4797
|
+
index.hunks = [];
|
|
4798
|
+
while (i < diffstr.length) {
|
|
4799
|
+
const line = diffstr[i];
|
|
4800
|
+
if (/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(line)) {
|
|
4801
|
+
break;
|
|
4802
|
+
} else if (/^@@/.test(line)) {
|
|
4803
|
+
index.hunks.push(parseHunk());
|
|
4804
|
+
} else if (line) {
|
|
4805
|
+
throw new Error("Unknown line " + (i + 1) + " " + JSON.stringify(line));
|
|
4806
|
+
} else {
|
|
4807
|
+
i++;
|
|
4808
|
+
}
|
|
4809
|
+
}
|
|
4810
|
+
}
|
|
4811
|
+
function parseFileHeader(index) {
|
|
4812
|
+
const fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]);
|
|
4813
|
+
if (fileHeader) {
|
|
4814
|
+
const data = fileHeader[2].split("\t", 2), header = (data[1] || "").trim();
|
|
4815
|
+
let fileName = data[0].replace(/\\\\/g, "\\");
|
|
4816
|
+
if (/^".*"$/.test(fileName)) {
|
|
4817
|
+
fileName = fileName.substr(1, fileName.length - 2);
|
|
4818
|
+
}
|
|
4819
|
+
if (fileHeader[1] === "---") {
|
|
4820
|
+
index.oldFileName = fileName;
|
|
4821
|
+
index.oldHeader = header;
|
|
4822
|
+
} else {
|
|
4823
|
+
index.newFileName = fileName;
|
|
4824
|
+
index.newHeader = header;
|
|
4825
|
+
}
|
|
4826
|
+
i++;
|
|
4827
|
+
}
|
|
4828
|
+
}
|
|
4829
|
+
function parseHunk() {
|
|
4830
|
+
var _a;
|
|
4831
|
+
const chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
|
|
4832
|
+
const hunk = {
|
|
4833
|
+
oldStart: +chunkHeader[1],
|
|
4834
|
+
oldLines: typeof chunkHeader[2] === "undefined" ? 1 : +chunkHeader[2],
|
|
4835
|
+
newStart: +chunkHeader[3],
|
|
4836
|
+
newLines: typeof chunkHeader[4] === "undefined" ? 1 : +chunkHeader[4],
|
|
4837
|
+
lines: []
|
|
4838
|
+
};
|
|
4839
|
+
if (hunk.oldLines === 0) {
|
|
4840
|
+
hunk.oldStart += 1;
|
|
4841
|
+
}
|
|
4842
|
+
if (hunk.newLines === 0) {
|
|
4843
|
+
hunk.newStart += 1;
|
|
4844
|
+
}
|
|
4845
|
+
let addCount = 0, removeCount = 0;
|
|
4846
|
+
for (;i < diffstr.length && (removeCount < hunk.oldLines || addCount < hunk.newLines || ((_a = diffstr[i]) === null || _a === undefined ? undefined : _a.startsWith("\\"))); i++) {
|
|
4847
|
+
const operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? " " : diffstr[i][0];
|
|
4848
|
+
if (operation === "+" || operation === "-" || operation === " " || operation === "\\") {
|
|
4849
|
+
hunk.lines.push(diffstr[i]);
|
|
4850
|
+
if (operation === "+") {
|
|
4851
|
+
addCount++;
|
|
4852
|
+
} else if (operation === "-") {
|
|
4853
|
+
removeCount++;
|
|
4854
|
+
} else if (operation === " ") {
|
|
4855
|
+
addCount++;
|
|
4856
|
+
removeCount++;
|
|
4857
|
+
}
|
|
4858
|
+
} else {
|
|
4859
|
+
throw new Error(`Hunk at line ${chunkHeaderIndex + 1} contained invalid line ${diffstr[i]}`);
|
|
4860
|
+
}
|
|
4861
|
+
}
|
|
4862
|
+
if (!addCount && hunk.newLines === 1) {
|
|
4863
|
+
hunk.newLines = 0;
|
|
4864
|
+
}
|
|
4865
|
+
if (!removeCount && hunk.oldLines === 1) {
|
|
4866
|
+
hunk.oldLines = 0;
|
|
4867
|
+
}
|
|
4868
|
+
if (addCount !== hunk.newLines) {
|
|
4869
|
+
throw new Error("Added line count did not match for hunk at line " + (chunkHeaderIndex + 1));
|
|
4870
|
+
}
|
|
4871
|
+
if (removeCount !== hunk.oldLines) {
|
|
4872
|
+
throw new Error("Removed line count did not match for hunk at line " + (chunkHeaderIndex + 1));
|
|
4873
|
+
}
|
|
4874
|
+
return hunk;
|
|
4875
|
+
}
|
|
4876
|
+
while (i < diffstr.length) {
|
|
4877
|
+
parseIndex();
|
|
4878
|
+
}
|
|
4879
|
+
return list;
|
|
4880
|
+
}
|
|
4167
4881
|
|
|
4168
4882
|
// src/renderables/Text.ts
|
|
4169
4883
|
class TextRenderable extends TextBufferRenderable {
|
|
@@ -5407,8 +6121,6 @@ class DiffRenderable extends Renderable {
|
|
|
5407
6121
|
}
|
|
5408
6122
|
}
|
|
5409
6123
|
// src/renderables/EditBufferRenderable.ts
|
|
5410
|
-
import { MeasureMode as MeasureMode2 } from "yoga-layout";
|
|
5411
|
-
|
|
5412
6124
|
class EditBufferRenderable extends Renderable {
|
|
5413
6125
|
_focusable = true;
|
|
5414
6126
|
selectable = true;
|
|
@@ -5796,7 +6508,7 @@ class EditBufferRenderable extends Renderable {
|
|
|
5796
6508
|
setupMeasureFunc() {
|
|
5797
6509
|
const measureFunc = (width, widthMode, height, heightMode) => {
|
|
5798
6510
|
let effectiveWidth;
|
|
5799
|
-
if (widthMode ===
|
|
6511
|
+
if (widthMode === MeasureMode.Undefined || isNaN(width)) {
|
|
5800
6512
|
effectiveWidth = 0;
|
|
5801
6513
|
} else {
|
|
5802
6514
|
effectiveWidth = width;
|
|
@@ -5805,7 +6517,7 @@ class EditBufferRenderable extends Renderable {
|
|
|
5805
6517
|
const measureResult = this.editorView.measureForDimensions(Math.floor(effectiveWidth), Math.floor(effectiveHeight));
|
|
5806
6518
|
const measuredWidth = measureResult ? Math.max(1, measureResult.maxWidth) : 1;
|
|
5807
6519
|
const measuredHeight = measureResult ? Math.max(1, measureResult.lineCount) : 1;
|
|
5808
|
-
if (widthMode ===
|
|
6520
|
+
if (widthMode === MeasureMode.AtMost && this._positionType !== "absolute") {
|
|
5809
6521
|
return {
|
|
5810
6522
|
width: Math.min(effectiveWidth, measuredWidth),
|
|
5811
6523
|
height: Math.min(effectiveHeight, measuredHeight)
|
|
@@ -6685,12 +7397,1276 @@ class InputRenderable extends TextareaRenderable {
|
|
|
6685
7397
|
}
|
|
6686
7398
|
set initialValue(value) {}
|
|
6687
7399
|
}
|
|
7400
|
+
// ../../node_modules/.bun/marked@17.0.1/node_modules/marked/lib/marked.esm.js
|
|
7401
|
+
function L() {
|
|
7402
|
+
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
7403
|
+
}
|
|
7404
|
+
var T = L();
|
|
7405
|
+
function Z(u) {
|
|
7406
|
+
T = u;
|
|
7407
|
+
}
|
|
7408
|
+
var C = { exec: () => null };
|
|
7409
|
+
function k(u, e = "") {
|
|
7410
|
+
let t2 = typeof u == "string" ? u : u.source, n = { replace: (r, i) => {
|
|
7411
|
+
let s = typeof i == "string" ? i : i.source;
|
|
7412
|
+
return s = s.replace(m.caret, "$1"), t2 = t2.replace(r, s), n;
|
|
7413
|
+
}, getRegex: () => new RegExp(t2, e) };
|
|
7414
|
+
return n;
|
|
7415
|
+
}
|
|
7416
|
+
var me = (() => {
|
|
7417
|
+
try {
|
|
7418
|
+
return !!new RegExp("(?<=1)(?<!1)");
|
|
7419
|
+
} catch {
|
|
7420
|
+
return false;
|
|
7421
|
+
}
|
|
7422
|
+
})();
|
|
7423
|
+
var m = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (u) => new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}#`), htmlBeginRegex: (u) => new RegExp(`^ {0,${Math.min(3, u - 1)}}<(?:[a-z].*>|!--)`, "i") };
|
|
7424
|
+
var xe = /^(?:[ \t]*(?:\n|$))+/;
|
|
7425
|
+
var be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
|
|
7426
|
+
var Re = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
|
|
7427
|
+
var I = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
|
|
7428
|
+
var Te = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
|
|
7429
|
+
var N = /(?:[*+-]|\d{1,9}[.)])/;
|
|
7430
|
+
var re = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
|
|
7431
|
+
var se = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex();
|
|
7432
|
+
var Oe = k(re).replace(/bull/g, N).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex();
|
|
7433
|
+
var Q = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
|
|
7434
|
+
var we = /^[^\n]+/;
|
|
7435
|
+
var F = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
|
|
7436
|
+
var ye = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", F).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
|
|
7437
|
+
var Pe = k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, N).getRegex();
|
|
7438
|
+
var v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
7439
|
+
var j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
|
|
7440
|
+
var Se = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))", "i").replace("comment", j).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
7441
|
+
var ie = k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
|
|
7442
|
+
var $e = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ie).getRegex();
|
|
7443
|
+
var U = { blockquote: $e, code: be, def: ye, fences: Re, heading: Te, hr: I, html: Se, lheading: se, list: Pe, newline: xe, paragraph: ie, table: C, text: we };
|
|
7444
|
+
var te = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3}\t)[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex();
|
|
7445
|
+
var _e = { ...U, lheading: Oe, table: te, paragraph: k(Q).replace("hr", I).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", te).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() };
|
|
7446
|
+
var Le = { ...U, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: C, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(Q).replace("hr", I).replace("heading", ` *#{1,6} *[^
|
|
7447
|
+
]`).replace("lheading", se).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() };
|
|
7448
|
+
var Me = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
|
|
7449
|
+
var ze = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
|
|
7450
|
+
var oe = /^( {2,}|\\)\n(?!\s*$)/;
|
|
7451
|
+
var Ae = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
|
|
7452
|
+
var D = /[\p{P}\p{S}]/u;
|
|
7453
|
+
var K = /[\s\p{P}\p{S}]/u;
|
|
7454
|
+
var ae = /[^\s\p{P}\p{S}]/u;
|
|
7455
|
+
var Ce = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, K).getRegex();
|
|
7456
|
+
var le = /(?!~)[\p{P}\p{S}]/u;
|
|
7457
|
+
var Ie = /(?!~)[\s\p{P}\p{S}]/u;
|
|
7458
|
+
var Ee = /(?:[^\s\p{P}\p{S}]|~)/u;
|
|
7459
|
+
var Be = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", me ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex();
|
|
7460
|
+
var ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
|
|
7461
|
+
var qe = k(ue, "u").replace(/punct/g, D).getRegex();
|
|
7462
|
+
var ve = k(ue, "u").replace(/punct/g, le).getRegex();
|
|
7463
|
+
var pe = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
|
|
7464
|
+
var De = k(pe, "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex();
|
|
7465
|
+
var He = k(pe, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, Ie).replace(/punct/g, le).getRegex();
|
|
7466
|
+
var Ze = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ae).replace(/punctSpace/g, K).replace(/punct/g, D).getRegex();
|
|
7467
|
+
var Ge = k(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
|
|
7468
|
+
var Ne = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();
|
|
7469
|
+
var Qe = k(j).replace("(?:-->|$)", "-->").getRegex();
|
|
7470
|
+
var Fe = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Qe).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();
|
|
7471
|
+
var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
|
|
7472
|
+
var je = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
|
|
7473
|
+
var ce = k(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", F).getRegex();
|
|
7474
|
+
var he = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", F).getRegex();
|
|
7475
|
+
var Ue = k("reflink|nolink(?!\\()", "g").replace("reflink", ce).replace("nolink", he).getRegex();
|
|
7476
|
+
var ne = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
|
|
7477
|
+
var W = { _backpedal: C, anyPunctuation: Ge, autolink: Ne, blockSkip: Be, br: oe, code: ze, del: C, emStrongLDelim: qe, emStrongRDelimAst: De, emStrongRDelimUnd: Ze, escape: Me, link: je, nolink: he, punctuation: Ce, reflink: ce, reflinkSearch: Ue, tag: Fe, text: Ae, url: C };
|
|
7478
|
+
var Ke = { ...W, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() };
|
|
7479
|
+
var G = { ...W, emStrongRDelimAst: He, emStrongLDelim: ve, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ne).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ne).getRegex() };
|
|
7480
|
+
var We = { ...G, br: k(oe).replace("{2,}", "*").getRegex(), text: k(G.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() };
|
|
7481
|
+
var E = { normal: U, gfm: _e, pedantic: Le };
|
|
7482
|
+
var M = { normal: W, gfm: G, breaks: We, pedantic: Ke };
|
|
7483
|
+
var Xe = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" };
|
|
7484
|
+
var ke = (u) => Xe[u];
|
|
7485
|
+
function w(u, e) {
|
|
7486
|
+
if (e) {
|
|
7487
|
+
if (m.escapeTest.test(u))
|
|
7488
|
+
return u.replace(m.escapeReplace, ke);
|
|
7489
|
+
} else if (m.escapeTestNoEncode.test(u))
|
|
7490
|
+
return u.replace(m.escapeReplaceNoEncode, ke);
|
|
7491
|
+
return u;
|
|
7492
|
+
}
|
|
7493
|
+
function X(u) {
|
|
7494
|
+
try {
|
|
7495
|
+
u = encodeURI(u).replace(m.percentDecode, "%");
|
|
7496
|
+
} catch {
|
|
7497
|
+
return null;
|
|
7498
|
+
}
|
|
7499
|
+
return u;
|
|
7500
|
+
}
|
|
7501
|
+
function J(u, e) {
|
|
7502
|
+
let t2 = u.replace(m.findPipe, (i, s, a) => {
|
|
7503
|
+
let o = false, l = s;
|
|
7504
|
+
for (;--l >= 0 && a[l] === "\\"; )
|
|
7505
|
+
o = !o;
|
|
7506
|
+
return o ? "|" : " |";
|
|
7507
|
+
}), n = t2.split(m.splitPipe), r = 0;
|
|
7508
|
+
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e)
|
|
7509
|
+
if (n.length > e)
|
|
7510
|
+
n.splice(e);
|
|
7511
|
+
else
|
|
7512
|
+
for (;n.length < e; )
|
|
7513
|
+
n.push("");
|
|
7514
|
+
for (;r < n.length; r++)
|
|
7515
|
+
n[r] = n[r].trim().replace(m.slashPipe, "|");
|
|
7516
|
+
return n;
|
|
7517
|
+
}
|
|
7518
|
+
function z(u, e, t2) {
|
|
7519
|
+
let n = u.length;
|
|
7520
|
+
if (n === 0)
|
|
7521
|
+
return "";
|
|
7522
|
+
let r = 0;
|
|
7523
|
+
for (;r < n; ) {
|
|
7524
|
+
let i = u.charAt(n - r - 1);
|
|
7525
|
+
if (i === e && !t2)
|
|
7526
|
+
r++;
|
|
7527
|
+
else if (i !== e && t2)
|
|
7528
|
+
r++;
|
|
7529
|
+
else
|
|
7530
|
+
break;
|
|
7531
|
+
}
|
|
7532
|
+
return u.slice(0, n - r);
|
|
7533
|
+
}
|
|
7534
|
+
function de(u, e) {
|
|
7535
|
+
if (u.indexOf(e[1]) === -1)
|
|
7536
|
+
return -1;
|
|
7537
|
+
let t2 = 0;
|
|
7538
|
+
for (let n = 0;n < u.length; n++)
|
|
7539
|
+
if (u[n] === "\\")
|
|
7540
|
+
n++;
|
|
7541
|
+
else if (u[n] === e[0])
|
|
7542
|
+
t2++;
|
|
7543
|
+
else if (u[n] === e[1] && (t2--, t2 < 0))
|
|
7544
|
+
return n;
|
|
7545
|
+
return t2 > 0 ? -2 : -1;
|
|
7546
|
+
}
|
|
7547
|
+
function ge(u, e, t2, n, r) {
|
|
7548
|
+
let i = e.href, s = e.title || null, a = u[1].replace(r.other.outputLinkReplace, "$1");
|
|
7549
|
+
n.state.inLink = true;
|
|
7550
|
+
let o = { type: u[0].charAt(0) === "!" ? "image" : "link", raw: t2, href: i, title: s, text: a, tokens: n.inlineTokens(a) };
|
|
7551
|
+
return n.state.inLink = false, o;
|
|
7552
|
+
}
|
|
7553
|
+
function Je(u, e, t2) {
|
|
7554
|
+
let n = u.match(t2.other.indentCodeCompensation);
|
|
7555
|
+
if (n === null)
|
|
7556
|
+
return e;
|
|
7557
|
+
let r = n[1];
|
|
7558
|
+
return e.split(`
|
|
7559
|
+
`).map((i) => {
|
|
7560
|
+
let s = i.match(t2.other.beginningSpace);
|
|
7561
|
+
if (s === null)
|
|
7562
|
+
return i;
|
|
7563
|
+
let [a] = s;
|
|
7564
|
+
return a.length >= r.length ? i.slice(r.length) : i;
|
|
7565
|
+
}).join(`
|
|
7566
|
+
`);
|
|
7567
|
+
}
|
|
7568
|
+
var y = class {
|
|
7569
|
+
options;
|
|
7570
|
+
rules;
|
|
7571
|
+
lexer;
|
|
7572
|
+
constructor(e) {
|
|
7573
|
+
this.options = e || T;
|
|
7574
|
+
}
|
|
7575
|
+
space(e) {
|
|
7576
|
+
let t2 = this.rules.block.newline.exec(e);
|
|
7577
|
+
if (t2 && t2[0].length > 0)
|
|
7578
|
+
return { type: "space", raw: t2[0] };
|
|
7579
|
+
}
|
|
7580
|
+
code(e) {
|
|
7581
|
+
let t2 = this.rules.block.code.exec(e);
|
|
7582
|
+
if (t2) {
|
|
7583
|
+
let n = t2[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
7584
|
+
return { type: "code", raw: t2[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : z(n, `
|
|
7585
|
+
`) };
|
|
7586
|
+
}
|
|
7587
|
+
}
|
|
7588
|
+
fences(e) {
|
|
7589
|
+
let t2 = this.rules.block.fences.exec(e);
|
|
7590
|
+
if (t2) {
|
|
7591
|
+
let n = t2[0], r = Je(n, t2[3] || "", this.rules);
|
|
7592
|
+
return { type: "code", raw: n, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: r };
|
|
7593
|
+
}
|
|
7594
|
+
}
|
|
7595
|
+
heading(e) {
|
|
7596
|
+
let t2 = this.rules.block.heading.exec(e);
|
|
7597
|
+
if (t2) {
|
|
7598
|
+
let n = t2[2].trim();
|
|
7599
|
+
if (this.rules.other.endingHash.test(n)) {
|
|
7600
|
+
let r = z(n, "#");
|
|
7601
|
+
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
7602
|
+
}
|
|
7603
|
+
return { type: "heading", raw: t2[0], depth: t2[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
7604
|
+
}
|
|
7605
|
+
}
|
|
7606
|
+
hr(e) {
|
|
7607
|
+
let t2 = this.rules.block.hr.exec(e);
|
|
7608
|
+
if (t2)
|
|
7609
|
+
return { type: "hr", raw: z(t2[0], `
|
|
7610
|
+
`) };
|
|
7611
|
+
}
|
|
7612
|
+
blockquote(e) {
|
|
7613
|
+
let t2 = this.rules.block.blockquote.exec(e);
|
|
7614
|
+
if (t2) {
|
|
7615
|
+
let n = z(t2[0], `
|
|
7616
|
+
`).split(`
|
|
7617
|
+
`), r = "", i = "", s = [];
|
|
7618
|
+
for (;n.length > 0; ) {
|
|
7619
|
+
let a = false, o = [], l;
|
|
7620
|
+
for (l = 0;l < n.length; l++)
|
|
7621
|
+
if (this.rules.other.blockquoteStart.test(n[l]))
|
|
7622
|
+
o.push(n[l]), a = true;
|
|
7623
|
+
else if (!a)
|
|
7624
|
+
o.push(n[l]);
|
|
7625
|
+
else
|
|
7626
|
+
break;
|
|
7627
|
+
n = n.slice(l);
|
|
7628
|
+
let p = o.join(`
|
|
7629
|
+
`), c = p.replace(this.rules.other.blockquoteSetextReplace, `
|
|
7630
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
7631
|
+
r = r ? `${r}
|
|
7632
|
+
${p}` : p, i = i ? `${i}
|
|
7633
|
+
${c}` : c;
|
|
7634
|
+
let g = this.lexer.state.top;
|
|
7635
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(c, s, true), this.lexer.state.top = g, n.length === 0)
|
|
7636
|
+
break;
|
|
7637
|
+
let h2 = s.at(-1);
|
|
7638
|
+
if (h2?.type === "code")
|
|
7639
|
+
break;
|
|
7640
|
+
if (h2?.type === "blockquote") {
|
|
7641
|
+
let R = h2, f = R.raw + `
|
|
7642
|
+
` + n.join(`
|
|
7643
|
+
`), O = this.blockquote(f);
|
|
7644
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - R.raw.length) + O.raw, i = i.substring(0, i.length - R.text.length) + O.text;
|
|
7645
|
+
break;
|
|
7646
|
+
} else if (h2?.type === "list") {
|
|
7647
|
+
let R = h2, f = R.raw + `
|
|
7648
|
+
` + n.join(`
|
|
7649
|
+
`), O = this.list(f);
|
|
7650
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - h2.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
7651
|
+
`);
|
|
7652
|
+
continue;
|
|
7653
|
+
}
|
|
7654
|
+
}
|
|
7655
|
+
return { type: "blockquote", raw: r, tokens: s, text: i };
|
|
7656
|
+
}
|
|
7657
|
+
}
|
|
7658
|
+
list(e) {
|
|
7659
|
+
let t2 = this.rules.block.list.exec(e);
|
|
7660
|
+
if (t2) {
|
|
7661
|
+
let n = t2[1].trim(), r = n.length > 1, i = { type: "list", raw: "", ordered: r, start: r ? +n.slice(0, -1) : "", loose: false, items: [] };
|
|
7662
|
+
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
7663
|
+
let s = this.rules.other.listItemRegex(n), a = false;
|
|
7664
|
+
for (;e; ) {
|
|
7665
|
+
let l = false, p = "", c = "";
|
|
7666
|
+
if (!(t2 = s.exec(e)) || this.rules.block.hr.test(e))
|
|
7667
|
+
break;
|
|
7668
|
+
p = t2[0], e = e.substring(p.length);
|
|
7669
|
+
let g = t2[2].split(`
|
|
7670
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (O) => " ".repeat(3 * O.length)), h2 = e.split(`
|
|
7671
|
+
`, 1)[0], R = !g.trim(), f = 0;
|
|
7672
|
+
if (this.options.pedantic ? (f = 2, c = g.trimStart()) : R ? f = t2[1].length + 1 : (f = t2[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += t2[1].length), R && this.rules.other.blankLine.test(h2) && (p += h2 + `
|
|
7673
|
+
`, e = e.substring(h2.length + 1), l = true), !l) {
|
|
7674
|
+
let O = this.rules.other.nextBulletRegex(f), V = this.rules.other.hrRegex(f), Y = this.rules.other.fencesBeginRegex(f), ee = this.rules.other.headingBeginRegex(f), fe = this.rules.other.htmlBeginRegex(f);
|
|
7675
|
+
for (;e; ) {
|
|
7676
|
+
let H = e.split(`
|
|
7677
|
+
`, 1)[0], A;
|
|
7678
|
+
if (h2 = H, this.options.pedantic ? (h2 = h2.replace(this.rules.other.listReplaceNesting, " "), A = h2) : A = h2.replace(this.rules.other.tabCharGlobal, " "), Y.test(h2) || ee.test(h2) || fe.test(h2) || O.test(h2) || V.test(h2))
|
|
7679
|
+
break;
|
|
7680
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !h2.trim())
|
|
7681
|
+
c += `
|
|
7682
|
+
` + A.slice(f);
|
|
7683
|
+
else {
|
|
7684
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Y.test(g) || ee.test(g) || V.test(g))
|
|
7685
|
+
break;
|
|
7686
|
+
c += `
|
|
7687
|
+
` + h2;
|
|
7688
|
+
}
|
|
7689
|
+
!R && !h2.trim() && (R = true), p += H + `
|
|
7690
|
+
`, e = e.substring(H.length + 1), g = A.slice(f);
|
|
7691
|
+
}
|
|
7692
|
+
}
|
|
7693
|
+
i.loose || (a ? i.loose = true : this.rules.other.doubleBlankLine.test(p) && (a = true)), i.items.push({ type: "list_item", raw: p, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: false, text: c, tokens: [] }), i.raw += p;
|
|
7694
|
+
}
|
|
7695
|
+
let o = i.items.at(-1);
|
|
7696
|
+
if (o)
|
|
7697
|
+
o.raw = o.raw.trimEnd(), o.text = o.text.trimEnd();
|
|
7698
|
+
else
|
|
7699
|
+
return;
|
|
7700
|
+
i.raw = i.raw.trimEnd();
|
|
7701
|
+
for (let l of i.items) {
|
|
7702
|
+
if (this.lexer.state.top = false, l.tokens = this.lexer.blockTokens(l.text, []), l.task) {
|
|
7703
|
+
if (l.text = l.text.replace(this.rules.other.listReplaceTask, ""), l.tokens[0]?.type === "text" || l.tokens[0]?.type === "paragraph") {
|
|
7704
|
+
l.tokens[0].raw = l.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), l.tokens[0].text = l.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
|
|
7705
|
+
for (let c = this.lexer.inlineQueue.length - 1;c >= 0; c--)
|
|
7706
|
+
if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)) {
|
|
7707
|
+
this.lexer.inlineQueue[c].src = this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask, "");
|
|
7708
|
+
break;
|
|
7709
|
+
}
|
|
7710
|
+
}
|
|
7711
|
+
let p = this.rules.other.listTaskCheckbox.exec(l.raw);
|
|
7712
|
+
if (p) {
|
|
7713
|
+
let c = { type: "checkbox", raw: p[0] + " ", checked: p[0] !== "[ ]" };
|
|
7714
|
+
l.checked = c.checked, i.loose ? l.tokens[0] && ["paragraph", "text"].includes(l.tokens[0].type) && "tokens" in l.tokens[0] && l.tokens[0].tokens ? (l.tokens[0].raw = c.raw + l.tokens[0].raw, l.tokens[0].text = c.raw + l.tokens[0].text, l.tokens[0].tokens.unshift(c)) : l.tokens.unshift({ type: "paragraph", raw: c.raw, text: c.raw, tokens: [c] }) : l.tokens.unshift(c);
|
|
7715
|
+
}
|
|
7716
|
+
}
|
|
7717
|
+
if (!i.loose) {
|
|
7718
|
+
let p = l.tokens.filter((g) => g.type === "space"), c = p.length > 0 && p.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
7719
|
+
i.loose = c;
|
|
7720
|
+
}
|
|
7721
|
+
}
|
|
7722
|
+
if (i.loose)
|
|
7723
|
+
for (let l of i.items) {
|
|
7724
|
+
l.loose = true;
|
|
7725
|
+
for (let p of l.tokens)
|
|
7726
|
+
p.type === "text" && (p.type = "paragraph");
|
|
7727
|
+
}
|
|
7728
|
+
return i;
|
|
7729
|
+
}
|
|
7730
|
+
}
|
|
7731
|
+
html(e) {
|
|
7732
|
+
let t2 = this.rules.block.html.exec(e);
|
|
7733
|
+
if (t2)
|
|
7734
|
+
return { type: "html", block: true, raw: t2[0], pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: t2[0] };
|
|
7735
|
+
}
|
|
7736
|
+
def(e) {
|
|
7737
|
+
let t2 = this.rules.block.def.exec(e);
|
|
7738
|
+
if (t2) {
|
|
7739
|
+
let n = t2[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), r = t2[2] ? t2[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", i = t2[3] ? t2[3].substring(1, t2[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t2[3];
|
|
7740
|
+
return { type: "def", tag: n, raw: t2[0], href: r, title: i };
|
|
7741
|
+
}
|
|
7742
|
+
}
|
|
7743
|
+
table(e) {
|
|
7744
|
+
let t2 = this.rules.block.table.exec(e);
|
|
7745
|
+
if (!t2 || !this.rules.other.tableDelimiter.test(t2[2]))
|
|
7746
|
+
return;
|
|
7747
|
+
let n = J(t2[1]), r = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t2[3]?.trim() ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
7748
|
+
`) : [], s = { type: "table", raw: t2[0], header: [], align: [], rows: [] };
|
|
7749
|
+
if (n.length === r.length) {
|
|
7750
|
+
for (let a of r)
|
|
7751
|
+
this.rules.other.tableAlignRight.test(a) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(a) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(a) ? s.align.push("left") : s.align.push(null);
|
|
7752
|
+
for (let a = 0;a < n.length; a++)
|
|
7753
|
+
s.header.push({ text: n[a], tokens: this.lexer.inline(n[a]), header: true, align: s.align[a] });
|
|
7754
|
+
for (let a of i)
|
|
7755
|
+
s.rows.push(J(a, s.header.length).map((o, l) => ({ text: o, tokens: this.lexer.inline(o), header: false, align: s.align[l] })));
|
|
7756
|
+
return s;
|
|
7757
|
+
}
|
|
7758
|
+
}
|
|
7759
|
+
lheading(e) {
|
|
7760
|
+
let t2 = this.rules.block.lheading.exec(e);
|
|
7761
|
+
if (t2)
|
|
7762
|
+
return { type: "heading", raw: t2[0], depth: t2[2].charAt(0) === "=" ? 1 : 2, text: t2[1], tokens: this.lexer.inline(t2[1]) };
|
|
7763
|
+
}
|
|
7764
|
+
paragraph(e) {
|
|
7765
|
+
let t2 = this.rules.block.paragraph.exec(e);
|
|
7766
|
+
if (t2) {
|
|
7767
|
+
let n = t2[1].charAt(t2[1].length - 1) === `
|
|
7768
|
+
` ? t2[1].slice(0, -1) : t2[1];
|
|
7769
|
+
return { type: "paragraph", raw: t2[0], text: n, tokens: this.lexer.inline(n) };
|
|
7770
|
+
}
|
|
7771
|
+
}
|
|
7772
|
+
text(e) {
|
|
7773
|
+
let t2 = this.rules.block.text.exec(e);
|
|
7774
|
+
if (t2)
|
|
7775
|
+
return { type: "text", raw: t2[0], text: t2[0], tokens: this.lexer.inline(t2[0]) };
|
|
7776
|
+
}
|
|
7777
|
+
escape(e) {
|
|
7778
|
+
let t2 = this.rules.inline.escape.exec(e);
|
|
7779
|
+
if (t2)
|
|
7780
|
+
return { type: "escape", raw: t2[0], text: t2[1] };
|
|
7781
|
+
}
|
|
7782
|
+
tag(e) {
|
|
7783
|
+
let t2 = this.rules.inline.tag.exec(e);
|
|
7784
|
+
if (t2)
|
|
7785
|
+
return !this.lexer.state.inLink && this.rules.other.startATag.test(t2[0]) ? this.lexer.state.inLink = true : this.lexer.state.inLink && this.rules.other.endATag.test(t2[0]) && (this.lexer.state.inLink = false), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(t2[0]) ? this.lexer.state.inRawBlock = true : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(t2[0]) && (this.lexer.state.inRawBlock = false), { type: "html", raw: t2[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: false, text: t2[0] };
|
|
7786
|
+
}
|
|
7787
|
+
link(e) {
|
|
7788
|
+
let t2 = this.rules.inline.link.exec(e);
|
|
7789
|
+
if (t2) {
|
|
7790
|
+
let n = t2[2].trim();
|
|
7791
|
+
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
7792
|
+
if (!this.rules.other.endAngleBracket.test(n))
|
|
7793
|
+
return;
|
|
7794
|
+
let s = z(n.slice(0, -1), "\\");
|
|
7795
|
+
if ((n.length - s.length) % 2 === 0)
|
|
7796
|
+
return;
|
|
7797
|
+
} else {
|
|
7798
|
+
let s = de(t2[2], "()");
|
|
7799
|
+
if (s === -2)
|
|
7800
|
+
return;
|
|
7801
|
+
if (s > -1) {
|
|
7802
|
+
let o = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + s;
|
|
7803
|
+
t2[2] = t2[2].substring(0, s), t2[0] = t2[0].substring(0, o).trim(), t2[3] = "";
|
|
7804
|
+
}
|
|
7805
|
+
}
|
|
7806
|
+
let r = t2[2], i = "";
|
|
7807
|
+
if (this.options.pedantic) {
|
|
7808
|
+
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
7809
|
+
s && (r = s[1], i = s[3]);
|
|
7810
|
+
} else
|
|
7811
|
+
i = t2[3] ? t2[3].slice(1, -1) : "";
|
|
7812
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ge(t2, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t2[0], this.lexer, this.rules);
|
|
7813
|
+
}
|
|
7814
|
+
}
|
|
7815
|
+
reflink(e, t2) {
|
|
7816
|
+
let n;
|
|
7817
|
+
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
7818
|
+
let r = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i = t2[r.toLowerCase()];
|
|
7819
|
+
if (!i) {
|
|
7820
|
+
let s = n[0].charAt(0);
|
|
7821
|
+
return { type: "text", raw: s, text: s };
|
|
7822
|
+
}
|
|
7823
|
+
return ge(n, i, n[0], this.lexer, this.rules);
|
|
7824
|
+
}
|
|
7825
|
+
}
|
|
7826
|
+
emStrong(e, t2, n = "") {
|
|
7827
|
+
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
7828
|
+
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric))
|
|
7829
|
+
return;
|
|
7830
|
+
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
7831
|
+
let s = [...r[0]].length - 1, a, o, l = s, p = 0, c = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
7832
|
+
for (c.lastIndex = 0, t2 = t2.slice(-1 * e.length + s);(r = c.exec(t2)) != null; ) {
|
|
7833
|
+
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a)
|
|
7834
|
+
continue;
|
|
7835
|
+
if (o = [...a].length, r[3] || r[4]) {
|
|
7836
|
+
l += o;
|
|
7837
|
+
continue;
|
|
7838
|
+
} else if ((r[5] || r[6]) && s % 3 && !((s + o) % 3)) {
|
|
7839
|
+
p += o;
|
|
7840
|
+
continue;
|
|
7841
|
+
}
|
|
7842
|
+
if (l -= o, l > 0)
|
|
7843
|
+
continue;
|
|
7844
|
+
o = Math.min(o, o + l + p);
|
|
7845
|
+
let g = [...r[0]][0].length, h2 = e.slice(0, s + r.index + g + o);
|
|
7846
|
+
if (Math.min(s, o) % 2) {
|
|
7847
|
+
let f = h2.slice(1, -1);
|
|
7848
|
+
return { type: "em", raw: h2, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
7849
|
+
}
|
|
7850
|
+
let R = h2.slice(2, -2);
|
|
7851
|
+
return { type: "strong", raw: h2, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
7852
|
+
}
|
|
7853
|
+
}
|
|
7854
|
+
}
|
|
7855
|
+
codespan(e) {
|
|
7856
|
+
let t2 = this.rules.inline.code.exec(e);
|
|
7857
|
+
if (t2) {
|
|
7858
|
+
let n = t2[2].replace(this.rules.other.newLineCharGlobal, " "), r = this.rules.other.nonSpaceChar.test(n), i = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
|
|
7859
|
+
return r && i && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: t2[0], text: n };
|
|
7860
|
+
}
|
|
7861
|
+
}
|
|
7862
|
+
br(e) {
|
|
7863
|
+
let t2 = this.rules.inline.br.exec(e);
|
|
7864
|
+
if (t2)
|
|
7865
|
+
return { type: "br", raw: t2[0] };
|
|
7866
|
+
}
|
|
7867
|
+
del(e) {
|
|
7868
|
+
let t2 = this.rules.inline.del.exec(e);
|
|
7869
|
+
if (t2)
|
|
7870
|
+
return { type: "del", raw: t2[0], text: t2[2], tokens: this.lexer.inlineTokens(t2[2]) };
|
|
7871
|
+
}
|
|
7872
|
+
autolink(e) {
|
|
7873
|
+
let t2 = this.rules.inline.autolink.exec(e);
|
|
7874
|
+
if (t2) {
|
|
7875
|
+
let n, r;
|
|
7876
|
+
return t2[2] === "@" ? (n = t2[1], r = "mailto:" + n) : (n = t2[1], r = n), { type: "link", raw: t2[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
|
|
7877
|
+
}
|
|
7878
|
+
}
|
|
7879
|
+
url(e) {
|
|
7880
|
+
let t2;
|
|
7881
|
+
if (t2 = this.rules.inline.url.exec(e)) {
|
|
7882
|
+
let n, r;
|
|
7883
|
+
if (t2[2] === "@")
|
|
7884
|
+
n = t2[0], r = "mailto:" + n;
|
|
7885
|
+
else {
|
|
7886
|
+
let i;
|
|
7887
|
+
do
|
|
7888
|
+
i = t2[0], t2[0] = this.rules.inline._backpedal.exec(t2[0])?.[0] ?? "";
|
|
7889
|
+
while (i !== t2[0]);
|
|
7890
|
+
n = t2[0], t2[1] === "www." ? r = "http://" + t2[0] : r = t2[0];
|
|
7891
|
+
}
|
|
7892
|
+
return { type: "link", raw: t2[0], text: n, href: r, tokens: [{ type: "text", raw: n, text: n }] };
|
|
7893
|
+
}
|
|
7894
|
+
}
|
|
7895
|
+
inlineText(e) {
|
|
7896
|
+
let t2 = this.rules.inline.text.exec(e);
|
|
7897
|
+
if (t2) {
|
|
7898
|
+
let n = this.lexer.state.inRawBlock;
|
|
7899
|
+
return { type: "text", raw: t2[0], text: t2[0], escaped: n };
|
|
7900
|
+
}
|
|
7901
|
+
}
|
|
7902
|
+
};
|
|
7903
|
+
var x = class u {
|
|
7904
|
+
tokens;
|
|
7905
|
+
options;
|
|
7906
|
+
state;
|
|
7907
|
+
inlineQueue;
|
|
7908
|
+
tokenizer;
|
|
7909
|
+
constructor(e) {
|
|
7910
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || T, this.options.tokenizer = this.options.tokenizer || new y, this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: false, inRawBlock: false, top: true };
|
|
7911
|
+
let t2 = { other: m, block: E.normal, inline: M.normal };
|
|
7912
|
+
this.options.pedantic ? (t2.block = E.pedantic, t2.inline = M.pedantic) : this.options.gfm && (t2.block = E.gfm, this.options.breaks ? t2.inline = M.breaks : t2.inline = M.gfm), this.tokenizer.rules = t2;
|
|
7913
|
+
}
|
|
7914
|
+
static get rules() {
|
|
7915
|
+
return { block: E, inline: M };
|
|
7916
|
+
}
|
|
7917
|
+
static lex(e, t2) {
|
|
7918
|
+
return new u(t2).lex(e);
|
|
7919
|
+
}
|
|
7920
|
+
static lexInline(e, t2) {
|
|
7921
|
+
return new u(t2).inlineTokens(e);
|
|
7922
|
+
}
|
|
7923
|
+
lex(e) {
|
|
7924
|
+
e = e.replace(m.carriageReturn, `
|
|
7925
|
+
`), this.blockTokens(e, this.tokens);
|
|
7926
|
+
for (let t2 = 0;t2 < this.inlineQueue.length; t2++) {
|
|
7927
|
+
let n = this.inlineQueue[t2];
|
|
7928
|
+
this.inlineTokens(n.src, n.tokens);
|
|
7929
|
+
}
|
|
7930
|
+
return this.inlineQueue = [], this.tokens;
|
|
7931
|
+
}
|
|
7932
|
+
blockTokens(e, t2 = [], n = false) {
|
|
7933
|
+
for (this.options.pedantic && (e = e.replace(m.tabCharGlobal, " ").replace(m.spaceLine, ""));e; ) {
|
|
7934
|
+
let r;
|
|
7935
|
+
if (this.options.extensions?.block?.some((s) => (r = s.call({ lexer: this }, e, t2)) ? (e = e.substring(r.raw.length), t2.push(r), true) : false))
|
|
7936
|
+
continue;
|
|
7937
|
+
if (r = this.tokenizer.space(e)) {
|
|
7938
|
+
e = e.substring(r.raw.length);
|
|
7939
|
+
let s = t2.at(-1);
|
|
7940
|
+
r.raw.length === 1 && s !== undefined ? s.raw += `
|
|
7941
|
+
` : t2.push(r);
|
|
7942
|
+
continue;
|
|
7943
|
+
}
|
|
7944
|
+
if (r = this.tokenizer.code(e)) {
|
|
7945
|
+
e = e.substring(r.raw.length);
|
|
7946
|
+
let s = t2.at(-1);
|
|
7947
|
+
s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
7948
|
+
`) ? "" : `
|
|
7949
|
+
`) + r.raw, s.text += `
|
|
7950
|
+
` + r.text, this.inlineQueue.at(-1).src = s.text) : t2.push(r);
|
|
7951
|
+
continue;
|
|
7952
|
+
}
|
|
7953
|
+
if (r = this.tokenizer.fences(e)) {
|
|
7954
|
+
e = e.substring(r.raw.length), t2.push(r);
|
|
7955
|
+
continue;
|
|
7956
|
+
}
|
|
7957
|
+
if (r = this.tokenizer.heading(e)) {
|
|
7958
|
+
e = e.substring(r.raw.length), t2.push(r);
|
|
7959
|
+
continue;
|
|
7960
|
+
}
|
|
7961
|
+
if (r = this.tokenizer.hr(e)) {
|
|
7962
|
+
e = e.substring(r.raw.length), t2.push(r);
|
|
7963
|
+
continue;
|
|
7964
|
+
}
|
|
7965
|
+
if (r = this.tokenizer.blockquote(e)) {
|
|
7966
|
+
e = e.substring(r.raw.length), t2.push(r);
|
|
7967
|
+
continue;
|
|
7968
|
+
}
|
|
7969
|
+
if (r = this.tokenizer.list(e)) {
|
|
7970
|
+
e = e.substring(r.raw.length), t2.push(r);
|
|
7971
|
+
continue;
|
|
7972
|
+
}
|
|
7973
|
+
if (r = this.tokenizer.html(e)) {
|
|
7974
|
+
e = e.substring(r.raw.length), t2.push(r);
|
|
7975
|
+
continue;
|
|
7976
|
+
}
|
|
7977
|
+
if (r = this.tokenizer.def(e)) {
|
|
7978
|
+
e = e.substring(r.raw.length);
|
|
7979
|
+
let s = t2.at(-1);
|
|
7980
|
+
s?.type === "paragraph" || s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
7981
|
+
`) ? "" : `
|
|
7982
|
+
`) + r.raw, s.text += `
|
|
7983
|
+
` + r.raw, this.inlineQueue.at(-1).src = s.text) : this.tokens.links[r.tag] || (this.tokens.links[r.tag] = { href: r.href, title: r.title }, t2.push(r));
|
|
7984
|
+
continue;
|
|
7985
|
+
}
|
|
7986
|
+
if (r = this.tokenizer.table(e)) {
|
|
7987
|
+
e = e.substring(r.raw.length), t2.push(r);
|
|
7988
|
+
continue;
|
|
7989
|
+
}
|
|
7990
|
+
if (r = this.tokenizer.lheading(e)) {
|
|
7991
|
+
e = e.substring(r.raw.length), t2.push(r);
|
|
7992
|
+
continue;
|
|
7993
|
+
}
|
|
7994
|
+
let i = e;
|
|
7995
|
+
if (this.options.extensions?.startBlock) {
|
|
7996
|
+
let s = 1 / 0, a = e.slice(1), o;
|
|
7997
|
+
this.options.extensions.startBlock.forEach((l) => {
|
|
7998
|
+
o = l.call({ lexer: this }, a), typeof o == "number" && o >= 0 && (s = Math.min(s, o));
|
|
7999
|
+
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
8000
|
+
}
|
|
8001
|
+
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
8002
|
+
let s = t2.at(-1);
|
|
8003
|
+
n && s?.type === "paragraph" ? (s.raw += (s.raw.endsWith(`
|
|
8004
|
+
`) ? "" : `
|
|
8005
|
+
`) + r.raw, s.text += `
|
|
8006
|
+
` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t2.push(r), n = i.length !== e.length, e = e.substring(r.raw.length);
|
|
8007
|
+
continue;
|
|
8008
|
+
}
|
|
8009
|
+
if (r = this.tokenizer.text(e)) {
|
|
8010
|
+
e = e.substring(r.raw.length);
|
|
8011
|
+
let s = t2.at(-1);
|
|
8012
|
+
s?.type === "text" ? (s.raw += (s.raw.endsWith(`
|
|
8013
|
+
`) ? "" : `
|
|
8014
|
+
`) + r.raw, s.text += `
|
|
8015
|
+
` + r.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s.text) : t2.push(r);
|
|
8016
|
+
continue;
|
|
8017
|
+
}
|
|
8018
|
+
if (e) {
|
|
8019
|
+
let s = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
8020
|
+
if (this.options.silent) {
|
|
8021
|
+
console.error(s);
|
|
8022
|
+
break;
|
|
8023
|
+
} else
|
|
8024
|
+
throw new Error(s);
|
|
8025
|
+
}
|
|
8026
|
+
}
|
|
8027
|
+
return this.state.top = true, t2;
|
|
8028
|
+
}
|
|
8029
|
+
inline(e, t2 = []) {
|
|
8030
|
+
return this.inlineQueue.push({ src: e, tokens: t2 }), t2;
|
|
8031
|
+
}
|
|
8032
|
+
inlineTokens(e, t2 = []) {
|
|
8033
|
+
let n = e, r = null;
|
|
8034
|
+
if (this.tokens.links) {
|
|
8035
|
+
let o = Object.keys(this.tokens.links);
|
|
8036
|
+
if (o.length > 0)
|
|
8037
|
+
for (;(r = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; )
|
|
8038
|
+
o.includes(r[0].slice(r[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, r.index) + "[" + "a".repeat(r[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
8039
|
+
}
|
|
8040
|
+
for (;(r = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; )
|
|
8041
|
+
n = n.slice(0, r.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
8042
|
+
let i;
|
|
8043
|
+
for (;(r = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; )
|
|
8044
|
+
i = r[2] ? r[2].length : 0, n = n.slice(0, r.index + i) + "[" + "a".repeat(r[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
8045
|
+
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
8046
|
+
let s = false, a = "";
|
|
8047
|
+
for (;e; ) {
|
|
8048
|
+
s || (a = ""), s = false;
|
|
8049
|
+
let o;
|
|
8050
|
+
if (this.options.extensions?.inline?.some((p) => (o = p.call({ lexer: this }, e, t2)) ? (e = e.substring(o.raw.length), t2.push(o), true) : false))
|
|
8051
|
+
continue;
|
|
8052
|
+
if (o = this.tokenizer.escape(e)) {
|
|
8053
|
+
e = e.substring(o.raw.length), t2.push(o);
|
|
8054
|
+
continue;
|
|
8055
|
+
}
|
|
8056
|
+
if (o = this.tokenizer.tag(e)) {
|
|
8057
|
+
e = e.substring(o.raw.length), t2.push(o);
|
|
8058
|
+
continue;
|
|
8059
|
+
}
|
|
8060
|
+
if (o = this.tokenizer.link(e)) {
|
|
8061
|
+
e = e.substring(o.raw.length), t2.push(o);
|
|
8062
|
+
continue;
|
|
8063
|
+
}
|
|
8064
|
+
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
8065
|
+
e = e.substring(o.raw.length);
|
|
8066
|
+
let p = t2.at(-1);
|
|
8067
|
+
o.type === "text" && p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t2.push(o);
|
|
8068
|
+
continue;
|
|
8069
|
+
}
|
|
8070
|
+
if (o = this.tokenizer.emStrong(e, n, a)) {
|
|
8071
|
+
e = e.substring(o.raw.length), t2.push(o);
|
|
8072
|
+
continue;
|
|
8073
|
+
}
|
|
8074
|
+
if (o = this.tokenizer.codespan(e)) {
|
|
8075
|
+
e = e.substring(o.raw.length), t2.push(o);
|
|
8076
|
+
continue;
|
|
8077
|
+
}
|
|
8078
|
+
if (o = this.tokenizer.br(e)) {
|
|
8079
|
+
e = e.substring(o.raw.length), t2.push(o);
|
|
8080
|
+
continue;
|
|
8081
|
+
}
|
|
8082
|
+
if (o = this.tokenizer.del(e)) {
|
|
8083
|
+
e = e.substring(o.raw.length), t2.push(o);
|
|
8084
|
+
continue;
|
|
8085
|
+
}
|
|
8086
|
+
if (o = this.tokenizer.autolink(e)) {
|
|
8087
|
+
e = e.substring(o.raw.length), t2.push(o);
|
|
8088
|
+
continue;
|
|
8089
|
+
}
|
|
8090
|
+
if (!this.state.inLink && (o = this.tokenizer.url(e))) {
|
|
8091
|
+
e = e.substring(o.raw.length), t2.push(o);
|
|
8092
|
+
continue;
|
|
8093
|
+
}
|
|
8094
|
+
let l = e;
|
|
8095
|
+
if (this.options.extensions?.startInline) {
|
|
8096
|
+
let p = 1 / 0, c = e.slice(1), g;
|
|
8097
|
+
this.options.extensions.startInline.forEach((h2) => {
|
|
8098
|
+
g = h2.call({ lexer: this }, c), typeof g == "number" && g >= 0 && (p = Math.min(p, g));
|
|
8099
|
+
}), p < 1 / 0 && p >= 0 && (l = e.substring(0, p + 1));
|
|
8100
|
+
}
|
|
8101
|
+
if (o = this.tokenizer.inlineText(l)) {
|
|
8102
|
+
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (a = o.raw.slice(-1)), s = true;
|
|
8103
|
+
let p = t2.at(-1);
|
|
8104
|
+
p?.type === "text" ? (p.raw += o.raw, p.text += o.text) : t2.push(o);
|
|
8105
|
+
continue;
|
|
8106
|
+
}
|
|
8107
|
+
if (e) {
|
|
8108
|
+
let p = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
8109
|
+
if (this.options.silent) {
|
|
8110
|
+
console.error(p);
|
|
8111
|
+
break;
|
|
8112
|
+
} else
|
|
8113
|
+
throw new Error(p);
|
|
8114
|
+
}
|
|
8115
|
+
}
|
|
8116
|
+
return t2;
|
|
8117
|
+
}
|
|
8118
|
+
};
|
|
8119
|
+
var P = class {
|
|
8120
|
+
options;
|
|
8121
|
+
parser;
|
|
8122
|
+
constructor(e) {
|
|
8123
|
+
this.options = e || T;
|
|
8124
|
+
}
|
|
8125
|
+
space(e) {
|
|
8126
|
+
return "";
|
|
8127
|
+
}
|
|
8128
|
+
code({ text: e, lang: t2, escaped: n }) {
|
|
8129
|
+
let r = (t2 || "").match(m.notSpaceStart)?.[0], i = e.replace(m.endingNewline, "") + `
|
|
8130
|
+
`;
|
|
8131
|
+
return r ? '<pre><code class="language-' + w(r) + '">' + (n ? i : w(i, true)) + `</code></pre>
|
|
8132
|
+
` : "<pre><code>" + (n ? i : w(i, true)) + `</code></pre>
|
|
8133
|
+
`;
|
|
8134
|
+
}
|
|
8135
|
+
blockquote({ tokens: e }) {
|
|
8136
|
+
return `<blockquote>
|
|
8137
|
+
${this.parser.parse(e)}</blockquote>
|
|
8138
|
+
`;
|
|
8139
|
+
}
|
|
8140
|
+
html({ text: e }) {
|
|
8141
|
+
return e;
|
|
8142
|
+
}
|
|
8143
|
+
def(e) {
|
|
8144
|
+
return "";
|
|
8145
|
+
}
|
|
8146
|
+
heading({ tokens: e, depth: t2 }) {
|
|
8147
|
+
return `<h${t2}>${this.parser.parseInline(e)}</h${t2}>
|
|
8148
|
+
`;
|
|
8149
|
+
}
|
|
8150
|
+
hr(e) {
|
|
8151
|
+
return `<hr>
|
|
8152
|
+
`;
|
|
8153
|
+
}
|
|
8154
|
+
list(e) {
|
|
8155
|
+
let { ordered: t2, start: n } = e, r = "";
|
|
8156
|
+
for (let a = 0;a < e.items.length; a++) {
|
|
8157
|
+
let o = e.items[a];
|
|
8158
|
+
r += this.listitem(o);
|
|
8159
|
+
}
|
|
8160
|
+
let i = t2 ? "ol" : "ul", s = t2 && n !== 1 ? ' start="' + n + '"' : "";
|
|
8161
|
+
return "<" + i + s + `>
|
|
8162
|
+
` + r + "</" + i + `>
|
|
8163
|
+
`;
|
|
8164
|
+
}
|
|
8165
|
+
listitem(e) {
|
|
8166
|
+
return `<li>${this.parser.parse(e.tokens)}</li>
|
|
8167
|
+
`;
|
|
8168
|
+
}
|
|
8169
|
+
checkbox({ checked: e }) {
|
|
8170
|
+
return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
|
|
8171
|
+
}
|
|
8172
|
+
paragraph({ tokens: e }) {
|
|
8173
|
+
return `<p>${this.parser.parseInline(e)}</p>
|
|
8174
|
+
`;
|
|
8175
|
+
}
|
|
8176
|
+
table(e) {
|
|
8177
|
+
let t2 = "", n = "";
|
|
8178
|
+
for (let i = 0;i < e.header.length; i++)
|
|
8179
|
+
n += this.tablecell(e.header[i]);
|
|
8180
|
+
t2 += this.tablerow({ text: n });
|
|
8181
|
+
let r = "";
|
|
8182
|
+
for (let i = 0;i < e.rows.length; i++) {
|
|
8183
|
+
let s = e.rows[i];
|
|
8184
|
+
n = "";
|
|
8185
|
+
for (let a = 0;a < s.length; a++)
|
|
8186
|
+
n += this.tablecell(s[a]);
|
|
8187
|
+
r += this.tablerow({ text: n });
|
|
8188
|
+
}
|
|
8189
|
+
return r && (r = `<tbody>${r}</tbody>`), `<table>
|
|
8190
|
+
<thead>
|
|
8191
|
+
` + t2 + `</thead>
|
|
8192
|
+
` + r + `</table>
|
|
8193
|
+
`;
|
|
8194
|
+
}
|
|
8195
|
+
tablerow({ text: e }) {
|
|
8196
|
+
return `<tr>
|
|
8197
|
+
${e}</tr>
|
|
8198
|
+
`;
|
|
8199
|
+
}
|
|
8200
|
+
tablecell(e) {
|
|
8201
|
+
let t2 = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td";
|
|
8202
|
+
return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t2 + `</${n}>
|
|
8203
|
+
`;
|
|
8204
|
+
}
|
|
8205
|
+
strong({ tokens: e }) {
|
|
8206
|
+
return `<strong>${this.parser.parseInline(e)}</strong>`;
|
|
8207
|
+
}
|
|
8208
|
+
em({ tokens: e }) {
|
|
8209
|
+
return `<em>${this.parser.parseInline(e)}</em>`;
|
|
8210
|
+
}
|
|
8211
|
+
codespan({ text: e }) {
|
|
8212
|
+
return `<code>${w(e, true)}</code>`;
|
|
8213
|
+
}
|
|
8214
|
+
br(e) {
|
|
8215
|
+
return "<br>";
|
|
8216
|
+
}
|
|
8217
|
+
del({ tokens: e }) {
|
|
8218
|
+
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
8219
|
+
}
|
|
8220
|
+
link({ href: e, title: t2, tokens: n }) {
|
|
8221
|
+
let r = this.parser.parseInline(n), i = X(e);
|
|
8222
|
+
if (i === null)
|
|
8223
|
+
return r;
|
|
8224
|
+
e = i;
|
|
8225
|
+
let s = '<a href="' + e + '"';
|
|
8226
|
+
return t2 && (s += ' title="' + w(t2) + '"'), s += ">" + r + "</a>", s;
|
|
8227
|
+
}
|
|
8228
|
+
image({ href: e, title: t2, text: n, tokens: r }) {
|
|
8229
|
+
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
8230
|
+
let i = X(e);
|
|
8231
|
+
if (i === null)
|
|
8232
|
+
return w(n);
|
|
8233
|
+
e = i;
|
|
8234
|
+
let s = `<img src="${e}" alt="${n}"`;
|
|
8235
|
+
return t2 && (s += ` title="${w(t2)}"`), s += ">", s;
|
|
8236
|
+
}
|
|
8237
|
+
text(e) {
|
|
8238
|
+
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : ("escaped" in e) && e.escaped ? e.text : w(e.text);
|
|
8239
|
+
}
|
|
8240
|
+
};
|
|
8241
|
+
var $ = class {
|
|
8242
|
+
strong({ text: e }) {
|
|
8243
|
+
return e;
|
|
8244
|
+
}
|
|
8245
|
+
em({ text: e }) {
|
|
8246
|
+
return e;
|
|
8247
|
+
}
|
|
8248
|
+
codespan({ text: e }) {
|
|
8249
|
+
return e;
|
|
8250
|
+
}
|
|
8251
|
+
del({ text: e }) {
|
|
8252
|
+
return e;
|
|
8253
|
+
}
|
|
8254
|
+
html({ text: e }) {
|
|
8255
|
+
return e;
|
|
8256
|
+
}
|
|
8257
|
+
text({ text: e }) {
|
|
8258
|
+
return e;
|
|
8259
|
+
}
|
|
8260
|
+
link({ text: e }) {
|
|
8261
|
+
return "" + e;
|
|
8262
|
+
}
|
|
8263
|
+
image({ text: e }) {
|
|
8264
|
+
return "" + e;
|
|
8265
|
+
}
|
|
8266
|
+
br() {
|
|
8267
|
+
return "";
|
|
8268
|
+
}
|
|
8269
|
+
checkbox({ raw: e }) {
|
|
8270
|
+
return e;
|
|
8271
|
+
}
|
|
8272
|
+
};
|
|
8273
|
+
var b = class u2 {
|
|
8274
|
+
options;
|
|
8275
|
+
renderer;
|
|
8276
|
+
textRenderer;
|
|
8277
|
+
constructor(e) {
|
|
8278
|
+
this.options = e || T, this.options.renderer = this.options.renderer || new P, this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new $;
|
|
8279
|
+
}
|
|
8280
|
+
static parse(e, t2) {
|
|
8281
|
+
return new u2(t2).parse(e);
|
|
8282
|
+
}
|
|
8283
|
+
static parseInline(e, t2) {
|
|
8284
|
+
return new u2(t2).parseInline(e);
|
|
8285
|
+
}
|
|
8286
|
+
parse(e) {
|
|
8287
|
+
let t2 = "";
|
|
8288
|
+
for (let n = 0;n < e.length; n++) {
|
|
8289
|
+
let r = e[n];
|
|
8290
|
+
if (this.options.extensions?.renderers?.[r.type]) {
|
|
8291
|
+
let s = r, a = this.options.extensions.renderers[s.type].call({ parser: this }, s);
|
|
8292
|
+
if (a !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(s.type)) {
|
|
8293
|
+
t2 += a || "";
|
|
8294
|
+
continue;
|
|
8295
|
+
}
|
|
8296
|
+
}
|
|
8297
|
+
let i = r;
|
|
8298
|
+
switch (i.type) {
|
|
8299
|
+
case "space": {
|
|
8300
|
+
t2 += this.renderer.space(i);
|
|
8301
|
+
break;
|
|
8302
|
+
}
|
|
8303
|
+
case "hr": {
|
|
8304
|
+
t2 += this.renderer.hr(i);
|
|
8305
|
+
break;
|
|
8306
|
+
}
|
|
8307
|
+
case "heading": {
|
|
8308
|
+
t2 += this.renderer.heading(i);
|
|
8309
|
+
break;
|
|
8310
|
+
}
|
|
8311
|
+
case "code": {
|
|
8312
|
+
t2 += this.renderer.code(i);
|
|
8313
|
+
break;
|
|
8314
|
+
}
|
|
8315
|
+
case "table": {
|
|
8316
|
+
t2 += this.renderer.table(i);
|
|
8317
|
+
break;
|
|
8318
|
+
}
|
|
8319
|
+
case "blockquote": {
|
|
8320
|
+
t2 += this.renderer.blockquote(i);
|
|
8321
|
+
break;
|
|
8322
|
+
}
|
|
8323
|
+
case "list": {
|
|
8324
|
+
t2 += this.renderer.list(i);
|
|
8325
|
+
break;
|
|
8326
|
+
}
|
|
8327
|
+
case "checkbox": {
|
|
8328
|
+
t2 += this.renderer.checkbox(i);
|
|
8329
|
+
break;
|
|
8330
|
+
}
|
|
8331
|
+
case "html": {
|
|
8332
|
+
t2 += this.renderer.html(i);
|
|
8333
|
+
break;
|
|
8334
|
+
}
|
|
8335
|
+
case "def": {
|
|
8336
|
+
t2 += this.renderer.def(i);
|
|
8337
|
+
break;
|
|
8338
|
+
}
|
|
8339
|
+
case "paragraph": {
|
|
8340
|
+
t2 += this.renderer.paragraph(i);
|
|
8341
|
+
break;
|
|
8342
|
+
}
|
|
8343
|
+
case "text": {
|
|
8344
|
+
t2 += this.renderer.text(i);
|
|
8345
|
+
break;
|
|
8346
|
+
}
|
|
8347
|
+
default: {
|
|
8348
|
+
let s = 'Token with "' + i.type + '" type was not found.';
|
|
8349
|
+
if (this.options.silent)
|
|
8350
|
+
return console.error(s), "";
|
|
8351
|
+
throw new Error(s);
|
|
8352
|
+
}
|
|
8353
|
+
}
|
|
8354
|
+
}
|
|
8355
|
+
return t2;
|
|
8356
|
+
}
|
|
8357
|
+
parseInline(e, t2 = this.renderer) {
|
|
8358
|
+
let n = "";
|
|
8359
|
+
for (let r = 0;r < e.length; r++) {
|
|
8360
|
+
let i = e[r];
|
|
8361
|
+
if (this.options.extensions?.renderers?.[i.type]) {
|
|
8362
|
+
let a = this.options.extensions.renderers[i.type].call({ parser: this }, i);
|
|
8363
|
+
if (a !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
|
|
8364
|
+
n += a || "";
|
|
8365
|
+
continue;
|
|
8366
|
+
}
|
|
8367
|
+
}
|
|
8368
|
+
let s = i;
|
|
8369
|
+
switch (s.type) {
|
|
8370
|
+
case "escape": {
|
|
8371
|
+
n += t2.text(s);
|
|
8372
|
+
break;
|
|
8373
|
+
}
|
|
8374
|
+
case "html": {
|
|
8375
|
+
n += t2.html(s);
|
|
8376
|
+
break;
|
|
8377
|
+
}
|
|
8378
|
+
case "link": {
|
|
8379
|
+
n += t2.link(s);
|
|
8380
|
+
break;
|
|
8381
|
+
}
|
|
8382
|
+
case "image": {
|
|
8383
|
+
n += t2.image(s);
|
|
8384
|
+
break;
|
|
8385
|
+
}
|
|
8386
|
+
case "checkbox": {
|
|
8387
|
+
n += t2.checkbox(s);
|
|
8388
|
+
break;
|
|
8389
|
+
}
|
|
8390
|
+
case "strong": {
|
|
8391
|
+
n += t2.strong(s);
|
|
8392
|
+
break;
|
|
8393
|
+
}
|
|
8394
|
+
case "em": {
|
|
8395
|
+
n += t2.em(s);
|
|
8396
|
+
break;
|
|
8397
|
+
}
|
|
8398
|
+
case "codespan": {
|
|
8399
|
+
n += t2.codespan(s);
|
|
8400
|
+
break;
|
|
8401
|
+
}
|
|
8402
|
+
case "br": {
|
|
8403
|
+
n += t2.br(s);
|
|
8404
|
+
break;
|
|
8405
|
+
}
|
|
8406
|
+
case "del": {
|
|
8407
|
+
n += t2.del(s);
|
|
8408
|
+
break;
|
|
8409
|
+
}
|
|
8410
|
+
case "text": {
|
|
8411
|
+
n += t2.text(s);
|
|
8412
|
+
break;
|
|
8413
|
+
}
|
|
8414
|
+
default: {
|
|
8415
|
+
let a = 'Token with "' + s.type + '" type was not found.';
|
|
8416
|
+
if (this.options.silent)
|
|
8417
|
+
return console.error(a), "";
|
|
8418
|
+
throw new Error(a);
|
|
8419
|
+
}
|
|
8420
|
+
}
|
|
8421
|
+
}
|
|
8422
|
+
return n;
|
|
8423
|
+
}
|
|
8424
|
+
};
|
|
8425
|
+
var S = class {
|
|
8426
|
+
options;
|
|
8427
|
+
block;
|
|
8428
|
+
constructor(e) {
|
|
8429
|
+
this.options = e || T;
|
|
8430
|
+
}
|
|
8431
|
+
static passThroughHooks = new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
|
|
8432
|
+
static passThroughHooksRespectAsync = new Set(["preprocess", "postprocess", "processAllTokens"]);
|
|
8433
|
+
preprocess(e) {
|
|
8434
|
+
return e;
|
|
8435
|
+
}
|
|
8436
|
+
postprocess(e) {
|
|
8437
|
+
return e;
|
|
8438
|
+
}
|
|
8439
|
+
processAllTokens(e) {
|
|
8440
|
+
return e;
|
|
8441
|
+
}
|
|
8442
|
+
emStrongMask(e) {
|
|
8443
|
+
return e;
|
|
8444
|
+
}
|
|
8445
|
+
provideLexer() {
|
|
8446
|
+
return this.block ? x.lex : x.lexInline;
|
|
8447
|
+
}
|
|
8448
|
+
provideParser() {
|
|
8449
|
+
return this.block ? b.parse : b.parseInline;
|
|
8450
|
+
}
|
|
8451
|
+
};
|
|
8452
|
+
var B = class {
|
|
8453
|
+
defaults = L();
|
|
8454
|
+
options = this.setOptions;
|
|
8455
|
+
parse = this.parseMarkdown(true);
|
|
8456
|
+
parseInline = this.parseMarkdown(false);
|
|
8457
|
+
Parser = b;
|
|
8458
|
+
Renderer = P;
|
|
8459
|
+
TextRenderer = $;
|
|
8460
|
+
Lexer = x;
|
|
8461
|
+
Tokenizer = y;
|
|
8462
|
+
Hooks = S;
|
|
8463
|
+
constructor(...e) {
|
|
8464
|
+
this.use(...e);
|
|
8465
|
+
}
|
|
8466
|
+
walkTokens(e, t2) {
|
|
8467
|
+
let n = [];
|
|
8468
|
+
for (let r of e)
|
|
8469
|
+
switch (n = n.concat(t2.call(this, r)), r.type) {
|
|
8470
|
+
case "table": {
|
|
8471
|
+
let i = r;
|
|
8472
|
+
for (let s of i.header)
|
|
8473
|
+
n = n.concat(this.walkTokens(s.tokens, t2));
|
|
8474
|
+
for (let s of i.rows)
|
|
8475
|
+
for (let a of s)
|
|
8476
|
+
n = n.concat(this.walkTokens(a.tokens, t2));
|
|
8477
|
+
break;
|
|
8478
|
+
}
|
|
8479
|
+
case "list": {
|
|
8480
|
+
let i = r;
|
|
8481
|
+
n = n.concat(this.walkTokens(i.items, t2));
|
|
8482
|
+
break;
|
|
8483
|
+
}
|
|
8484
|
+
default: {
|
|
8485
|
+
let i = r;
|
|
8486
|
+
this.defaults.extensions?.childTokens?.[i.type] ? this.defaults.extensions.childTokens[i.type].forEach((s) => {
|
|
8487
|
+
let a = i[s].flat(1 / 0);
|
|
8488
|
+
n = n.concat(this.walkTokens(a, t2));
|
|
8489
|
+
}) : i.tokens && (n = n.concat(this.walkTokens(i.tokens, t2)));
|
|
8490
|
+
}
|
|
8491
|
+
}
|
|
8492
|
+
return n;
|
|
8493
|
+
}
|
|
8494
|
+
use(...e) {
|
|
8495
|
+
let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
8496
|
+
return e.forEach((n) => {
|
|
8497
|
+
let r = { ...n };
|
|
8498
|
+
if (r.async = this.defaults.async || r.async || false, n.extensions && (n.extensions.forEach((i) => {
|
|
8499
|
+
if (!i.name)
|
|
8500
|
+
throw new Error("extension name required");
|
|
8501
|
+
if ("renderer" in i) {
|
|
8502
|
+
let s = t2.renderers[i.name];
|
|
8503
|
+
s ? t2.renderers[i.name] = function(...a) {
|
|
8504
|
+
let o = i.renderer.apply(this, a);
|
|
8505
|
+
return o === false && (o = s.apply(this, a)), o;
|
|
8506
|
+
} : t2.renderers[i.name] = i.renderer;
|
|
8507
|
+
}
|
|
8508
|
+
if ("tokenizer" in i) {
|
|
8509
|
+
if (!i.level || i.level !== "block" && i.level !== "inline")
|
|
8510
|
+
throw new Error("extension level must be 'block' or 'inline'");
|
|
8511
|
+
let s = t2[i.level];
|
|
8512
|
+
s ? s.unshift(i.tokenizer) : t2[i.level] = [i.tokenizer], i.start && (i.level === "block" ? t2.startBlock ? t2.startBlock.push(i.start) : t2.startBlock = [i.start] : i.level === "inline" && (t2.startInline ? t2.startInline.push(i.start) : t2.startInline = [i.start]));
|
|
8513
|
+
}
|
|
8514
|
+
"childTokens" in i && i.childTokens && (t2.childTokens[i.name] = i.childTokens);
|
|
8515
|
+
}), r.extensions = t2), n.renderer) {
|
|
8516
|
+
let i = this.defaults.renderer || new P(this.defaults);
|
|
8517
|
+
for (let s in n.renderer) {
|
|
8518
|
+
if (!(s in i))
|
|
8519
|
+
throw new Error(`renderer '${s}' does not exist`);
|
|
8520
|
+
if (["options", "parser"].includes(s))
|
|
8521
|
+
continue;
|
|
8522
|
+
let a = s, o = n.renderer[a], l = i[a];
|
|
8523
|
+
i[a] = (...p) => {
|
|
8524
|
+
let c = o.apply(i, p);
|
|
8525
|
+
return c === false && (c = l.apply(i, p)), c || "";
|
|
8526
|
+
};
|
|
8527
|
+
}
|
|
8528
|
+
r.renderer = i;
|
|
8529
|
+
}
|
|
8530
|
+
if (n.tokenizer) {
|
|
8531
|
+
let i = this.defaults.tokenizer || new y(this.defaults);
|
|
8532
|
+
for (let s in n.tokenizer) {
|
|
8533
|
+
if (!(s in i))
|
|
8534
|
+
throw new Error(`tokenizer '${s}' does not exist`);
|
|
8535
|
+
if (["options", "rules", "lexer"].includes(s))
|
|
8536
|
+
continue;
|
|
8537
|
+
let a = s, o = n.tokenizer[a], l = i[a];
|
|
8538
|
+
i[a] = (...p) => {
|
|
8539
|
+
let c = o.apply(i, p);
|
|
8540
|
+
return c === false && (c = l.apply(i, p)), c;
|
|
8541
|
+
};
|
|
8542
|
+
}
|
|
8543
|
+
r.tokenizer = i;
|
|
8544
|
+
}
|
|
8545
|
+
if (n.hooks) {
|
|
8546
|
+
let i = this.defaults.hooks || new S;
|
|
8547
|
+
for (let s in n.hooks) {
|
|
8548
|
+
if (!(s in i))
|
|
8549
|
+
throw new Error(`hook '${s}' does not exist`);
|
|
8550
|
+
if (["options", "block"].includes(s))
|
|
8551
|
+
continue;
|
|
8552
|
+
let a = s, o = n.hooks[a], l = i[a];
|
|
8553
|
+
S.passThroughHooks.has(s) ? i[a] = (p) => {
|
|
8554
|
+
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s))
|
|
8555
|
+
return (async () => {
|
|
8556
|
+
let g = await o.call(i, p);
|
|
8557
|
+
return l.call(i, g);
|
|
8558
|
+
})();
|
|
8559
|
+
let c = o.call(i, p);
|
|
8560
|
+
return l.call(i, c);
|
|
8561
|
+
} : i[a] = (...p) => {
|
|
8562
|
+
if (this.defaults.async)
|
|
8563
|
+
return (async () => {
|
|
8564
|
+
let g = await o.apply(i, p);
|
|
8565
|
+
return g === false && (g = await l.apply(i, p)), g;
|
|
8566
|
+
})();
|
|
8567
|
+
let c = o.apply(i, p);
|
|
8568
|
+
return c === false && (c = l.apply(i, p)), c;
|
|
8569
|
+
};
|
|
8570
|
+
}
|
|
8571
|
+
r.hooks = i;
|
|
8572
|
+
}
|
|
8573
|
+
if (n.walkTokens) {
|
|
8574
|
+
let i = this.defaults.walkTokens, s = n.walkTokens;
|
|
8575
|
+
r.walkTokens = function(a) {
|
|
8576
|
+
let o = [];
|
|
8577
|
+
return o.push(s.call(this, a)), i && (o = o.concat(i.call(this, a))), o;
|
|
8578
|
+
};
|
|
8579
|
+
}
|
|
8580
|
+
this.defaults = { ...this.defaults, ...r };
|
|
8581
|
+
}), this;
|
|
8582
|
+
}
|
|
8583
|
+
setOptions(e) {
|
|
8584
|
+
return this.defaults = { ...this.defaults, ...e }, this;
|
|
8585
|
+
}
|
|
8586
|
+
lexer(e, t2) {
|
|
8587
|
+
return x.lex(e, t2 ?? this.defaults);
|
|
8588
|
+
}
|
|
8589
|
+
parser(e, t2) {
|
|
8590
|
+
return b.parse(e, t2 ?? this.defaults);
|
|
8591
|
+
}
|
|
8592
|
+
parseMarkdown(e) {
|
|
8593
|
+
return (n, r) => {
|
|
8594
|
+
let i = { ...r }, s = { ...this.defaults, ...i }, a = this.onError(!!s.silent, !!s.async);
|
|
8595
|
+
if (this.defaults.async === true && i.async === false)
|
|
8596
|
+
return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
8597
|
+
if (typeof n > "u" || n === null)
|
|
8598
|
+
return a(new Error("marked(): input parameter is undefined or null"));
|
|
8599
|
+
if (typeof n != "string")
|
|
8600
|
+
return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
8601
|
+
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async)
|
|
8602
|
+
return (async () => {
|
|
8603
|
+
let o = s.hooks ? await s.hooks.preprocess(n) : n, p = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
|
|
8604
|
+
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
8605
|
+
let h2 = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(c, s);
|
|
8606
|
+
return s.hooks ? await s.hooks.postprocess(h2) : h2;
|
|
8607
|
+
})().catch(a);
|
|
8608
|
+
try {
|
|
8609
|
+
s.hooks && (n = s.hooks.preprocess(n));
|
|
8610
|
+
let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
8611
|
+
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
8612
|
+
let c = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
|
|
8613
|
+
return s.hooks && (c = s.hooks.postprocess(c)), c;
|
|
8614
|
+
} catch (o) {
|
|
8615
|
+
return a(o);
|
|
8616
|
+
}
|
|
8617
|
+
};
|
|
8618
|
+
}
|
|
8619
|
+
onError(e, t2) {
|
|
8620
|
+
return (n) => {
|
|
8621
|
+
if (n.message += `
|
|
8622
|
+
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
8623
|
+
let r = "<p>An error occurred:</p><pre>" + w(n.message + "", true) + "</pre>";
|
|
8624
|
+
return t2 ? Promise.resolve(r) : r;
|
|
8625
|
+
}
|
|
8626
|
+
if (t2)
|
|
8627
|
+
return Promise.reject(n);
|
|
8628
|
+
throw n;
|
|
8629
|
+
};
|
|
8630
|
+
}
|
|
8631
|
+
};
|
|
8632
|
+
var _ = new B;
|
|
8633
|
+
function d(u3, e) {
|
|
8634
|
+
return _.parse(u3, e);
|
|
8635
|
+
}
|
|
8636
|
+
d.options = d.setOptions = function(u3) {
|
|
8637
|
+
return _.setOptions(u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
8638
|
+
};
|
|
8639
|
+
d.getDefaults = L;
|
|
8640
|
+
d.defaults = T;
|
|
8641
|
+
d.use = function(...u3) {
|
|
8642
|
+
return _.use(...u3), d.defaults = _.defaults, Z(d.defaults), d;
|
|
8643
|
+
};
|
|
8644
|
+
d.walkTokens = function(u3, e) {
|
|
8645
|
+
return _.walkTokens(u3, e);
|
|
8646
|
+
};
|
|
8647
|
+
d.parseInline = _.parseInline;
|
|
8648
|
+
d.Parser = b;
|
|
8649
|
+
d.parser = b.parse;
|
|
8650
|
+
d.Renderer = P;
|
|
8651
|
+
d.TextRenderer = $;
|
|
8652
|
+
d.Lexer = x;
|
|
8653
|
+
d.lexer = x.lex;
|
|
8654
|
+
d.Tokenizer = y;
|
|
8655
|
+
d.Hooks = S;
|
|
8656
|
+
d.parse = d;
|
|
8657
|
+
var Dt = d.options;
|
|
8658
|
+
var Ht = d.setOptions;
|
|
8659
|
+
var Zt = d.use;
|
|
8660
|
+
var Gt = d.walkTokens;
|
|
8661
|
+
var Nt = d.parseInline;
|
|
8662
|
+
var Ft = b.parse;
|
|
8663
|
+
var jt = x.lex;
|
|
8664
|
+
|
|
6688
8665
|
// src/renderables/markdown-parser.ts
|
|
6689
|
-
import { Lexer } from "marked";
|
|
6690
8666
|
function parseMarkdownIncremental(newContent, prevState, trailingUnstable = 2) {
|
|
6691
8667
|
if (!prevState || prevState.tokens.length === 0) {
|
|
6692
8668
|
try {
|
|
6693
|
-
const tokens =
|
|
8669
|
+
const tokens = x.lex(newContent, { gfm: true });
|
|
6694
8670
|
return { content: newContent, tokens };
|
|
6695
8671
|
} catch {
|
|
6696
8672
|
return { content: newContent, tokens: [] };
|
|
@@ -6718,7 +8694,7 @@ function parseMarkdownIncremental(newContent, prevState, trailingUnstable = 2) {
|
|
|
6718
8694
|
return { content: newContent, tokens: stableTokens };
|
|
6719
8695
|
}
|
|
6720
8696
|
try {
|
|
6721
|
-
const newTokens =
|
|
8697
|
+
const newTokens = x.lex(remainingContent, { gfm: true });
|
|
6722
8698
|
return { content: newContent, tokens: [...stableTokens, ...newTokens] };
|
|
6723
8699
|
} catch {
|
|
6724
8700
|
return { content: newContent, tokens: stableTokens };
|
|
@@ -7738,8 +9714,8 @@ class SliderRenderable extends Renderable {
|
|
|
7738
9714
|
char = "\u2590";
|
|
7739
9715
|
}
|
|
7740
9716
|
}
|
|
7741
|
-
for (let
|
|
7742
|
-
buffer.setCellWithAlphaBlending(this.x + realX, this.y +
|
|
9717
|
+
for (let y2 = 0;y2 < this.height; y2++) {
|
|
9718
|
+
buffer.setCellWithAlphaBlending(this.x + realX, this.y + y2, char, this._foregroundColor, this._backgroundColor);
|
|
7743
9719
|
}
|
|
7744
9720
|
}
|
|
7745
9721
|
}
|
|
@@ -7769,8 +9745,8 @@ class SliderRenderable extends Renderable {
|
|
|
7769
9745
|
char = "\u2584";
|
|
7770
9746
|
}
|
|
7771
9747
|
}
|
|
7772
|
-
for (let
|
|
7773
|
-
buffer.setCellWithAlphaBlending(this.x +
|
|
9748
|
+
for (let x2 = 0;x2 < this.width; x2++) {
|
|
9749
|
+
buffer.setCellWithAlphaBlending(this.x + x2, this.y + realY, char, this._foregroundColor, this._backgroundColor);
|
|
7774
9750
|
}
|
|
7775
9751
|
}
|
|
7776
9752
|
}
|
|
@@ -9512,8 +11488,6 @@ class StatelessTerminalRenderable extends TextBufferRenderable {
|
|
|
9512
11488
|
return this.y + lineYOffset;
|
|
9513
11489
|
}
|
|
9514
11490
|
}
|
|
9515
|
-
// src/index.ts
|
|
9516
|
-
import * as Yoga from "yoga-layout";
|
|
9517
11491
|
export {
|
|
9518
11492
|
yellow,
|
|
9519
11493
|
wrapWithDelegates,
|
|
@@ -9634,7 +11608,7 @@ export {
|
|
|
9634
11608
|
applyChromaticAberration,
|
|
9635
11609
|
applyAsciiArt,
|
|
9636
11610
|
addDefaultParsers,
|
|
9637
|
-
Yoga,
|
|
11611
|
+
exports_src as Yoga,
|
|
9638
11612
|
VignetteEffect,
|
|
9639
11613
|
VTermStyleFlags,
|
|
9640
11614
|
VRenderable,
|
|
@@ -9721,5 +11695,5 @@ export {
|
|
|
9721
11695
|
ASCIIFont
|
|
9722
11696
|
};
|
|
9723
11697
|
|
|
9724
|
-
//# debugId=
|
|
11698
|
+
//# debugId=BB0EDE58447BBE9564756E2164756E21
|
|
9725
11699
|
//# sourceMappingURL=index.js.map
|