@harbour-enterprises/superdoc 0.28.3 → 0.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{PdfViewer-QTV3RJM1.cjs → PdfViewer-CfUwzBbx.cjs} +1 -1
- package/dist/chunks/{PdfViewer-DUpLlOgk.es.js → PdfViewer-FhoWTpo9.es.js} +1 -1
- package/dist/chunks/{index-CuXB3dyN.cjs → index-C3gwy96O.cjs} +3 -3
- package/dist/chunks/{index-B3rVM2bJ-B62R9mgx.es.js → index-CEL3ujoV-BXzhXCnT.es.js} +1 -1
- package/dist/chunks/{index-B3rVM2bJ-BgYPFhrh.cjs → index-CEL3ujoV-C85AsK84.cjs} +1 -1
- package/dist/chunks/{index-DKtyoTAq.es.js → index-CQbyD7vC.es.js} +3 -3
- package/dist/chunks/{super-editor.es-BKCxu5-_.cjs → super-editor.es-BQCukgDh.cjs} +791 -736
- package/dist/chunks/{super-editor.es-BjTZa-cJ.es.js → super-editor.es-rFPLjn7D.es.js} +791 -736
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-CMtyH2w0.js → converter-BkMCDOKg.js} +429 -385
- package/dist/super-editor/chunks/{docx-zipper-Pgf9i5kI.js → docx-zipper-CPrVIeS5.js} +1 -1
- package/dist/super-editor/chunks/{editor-C3KgN3zx.js → editor-D2rTPB17.js} +15 -4
- package/dist/super-editor/chunks/{index-B3rVM2bJ.js → index-CEL3ujoV.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-TXkIPPvk.js → toolbar-EGiGMLTV.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor/src/core/super-converter/relationship-helpers.d.ts +2 -0
- package/dist/super-editor/super-editor.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +555 -500
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +2 -5
|
@@ -112,18 +112,18 @@ ieee754.read = function(buffer2, offset, isLE, mLen, nBytes) {
|
|
|
112
112
|
var eBias = eMax >> 1;
|
|
113
113
|
var nBits = -7;
|
|
114
114
|
var i = isLE ? nBytes - 1 : 0;
|
|
115
|
-
var
|
|
115
|
+
var d = isLE ? -1 : 1;
|
|
116
116
|
var s = buffer2[offset + i];
|
|
117
|
-
i +=
|
|
117
|
+
i += d;
|
|
118
118
|
e = s & (1 << -nBits) - 1;
|
|
119
119
|
s >>= -nBits;
|
|
120
120
|
nBits += eLen;
|
|
121
|
-
for (; nBits > 0; e = e * 256 + buffer2[offset + i], i +=
|
|
121
|
+
for (; nBits > 0; e = e * 256 + buffer2[offset + i], i += d, nBits -= 8) {
|
|
122
122
|
}
|
|
123
123
|
m2 = e & (1 << -nBits) - 1;
|
|
124
124
|
e >>= -nBits;
|
|
125
125
|
nBits += mLen;
|
|
126
|
-
for (; nBits > 0; m2 = m2 * 256 + buffer2[offset + i], i +=
|
|
126
|
+
for (; nBits > 0; m2 = m2 * 256 + buffer2[offset + i], i += d, nBits -= 8) {
|
|
127
127
|
}
|
|
128
128
|
if (e === 0) {
|
|
129
129
|
e = 1 - eBias;
|
|
@@ -142,7 +142,7 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
142
142
|
var eBias = eMax >> 1;
|
|
143
143
|
var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
|
|
144
144
|
var i = isLE ? 0 : nBytes - 1;
|
|
145
|
-
var
|
|
145
|
+
var d = isLE ? 1 : -1;
|
|
146
146
|
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
|
|
147
147
|
value = Math.abs(value);
|
|
148
148
|
if (isNaN(value) || value === Infinity) {
|
|
@@ -174,13 +174,13 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
174
174
|
e = 0;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
for (; mLen >= 8; buffer2[offset + i] = m2 & 255, i +=
|
|
177
|
+
for (; mLen >= 8; buffer2[offset + i] = m2 & 255, i += d, m2 /= 256, mLen -= 8) {
|
|
178
178
|
}
|
|
179
179
|
e = e << mLen | m2;
|
|
180
180
|
eLen += mLen;
|
|
181
|
-
for (; eLen > 0; buffer2[offset + i] = e & 255, i +=
|
|
181
|
+
for (; eLen > 0; buffer2[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {
|
|
182
182
|
}
|
|
183
|
-
buffer2[offset + i -
|
|
183
|
+
buffer2[offset + i - d] |= s * 128;
|
|
184
184
|
};
|
|
185
185
|
/*!
|
|
186
186
|
* The buffer module from node.js, for the browser.
|
|
@@ -414,17 +414,17 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
414
414
|
);
|
|
415
415
|
}
|
|
416
416
|
if (a === b2) return 0;
|
|
417
|
-
let
|
|
417
|
+
let x2 = a.length;
|
|
418
418
|
let y2 = b2.length;
|
|
419
|
-
for (let i = 0, len = Math.min(
|
|
419
|
+
for (let i = 0, len = Math.min(x2, y2); i < len; ++i) {
|
|
420
420
|
if (a[i] !== b2[i]) {
|
|
421
|
-
|
|
421
|
+
x2 = a[i];
|
|
422
422
|
y2 = b2[i];
|
|
423
423
|
break;
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
if (
|
|
427
|
-
if (y2 <
|
|
426
|
+
if (x2 < y2) return -1;
|
|
427
|
+
if (y2 < x2) return 1;
|
|
428
428
|
return 0;
|
|
429
429
|
};
|
|
430
430
|
Buffer3.isEncoding = function isEncoding(encoding) {
|
|
@@ -673,20 +673,20 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
673
673
|
thisStart >>>= 0;
|
|
674
674
|
thisEnd >>>= 0;
|
|
675
675
|
if (this === target) return 0;
|
|
676
|
-
let
|
|
676
|
+
let x2 = thisEnd - thisStart;
|
|
677
677
|
let y2 = end - start;
|
|
678
|
-
const len = Math.min(
|
|
678
|
+
const len = Math.min(x2, y2);
|
|
679
679
|
const thisCopy = this.slice(thisStart, thisEnd);
|
|
680
680
|
const targetCopy = target.slice(start, end);
|
|
681
681
|
for (let i = 0; i < len; ++i) {
|
|
682
682
|
if (thisCopy[i] !== targetCopy[i]) {
|
|
683
|
-
|
|
683
|
+
x2 = thisCopy[i];
|
|
684
684
|
y2 = targetCopy[i];
|
|
685
685
|
break;
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
|
-
if (
|
|
689
|
-
if (y2 <
|
|
688
|
+
if (x2 < y2) return -1;
|
|
689
|
+
if (y2 < x2) return 1;
|
|
690
690
|
return 0;
|
|
691
691
|
};
|
|
692
692
|
function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir) {
|
|
@@ -1776,8 +1776,8 @@ ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) {
|
|
|
1776
1776
|
})(buffer);
|
|
1777
1777
|
const Buffer2 = buffer.Buffer;
|
|
1778
1778
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
1779
|
-
function getDefaultExportFromCjs$2(
|
|
1780
|
-
return
|
|
1779
|
+
function getDefaultExportFromCjs$2(x2) {
|
|
1780
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
1781
1781
|
}
|
|
1782
1782
|
var sax = {};
|
|
1783
1783
|
var events = { exports: {} };
|
|
@@ -1785,13 +1785,13 @@ var hasRequiredEvents;
|
|
|
1785
1785
|
function requireEvents() {
|
|
1786
1786
|
if (hasRequiredEvents) return events.exports;
|
|
1787
1787
|
hasRequiredEvents = 1;
|
|
1788
|
-
var
|
|
1789
|
-
var ReflectApply =
|
|
1788
|
+
var R = typeof Reflect === "object" ? Reflect : null;
|
|
1789
|
+
var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
|
|
1790
1790
|
return Function.prototype.apply.call(target, receiver, args);
|
|
1791
1791
|
};
|
|
1792
1792
|
var ReflectOwnKeys;
|
|
1793
|
-
if (
|
|
1794
|
-
ReflectOwnKeys =
|
|
1793
|
+
if (R && typeof R.ownKeys === "function") {
|
|
1794
|
+
ReflectOwnKeys = R.ownKeys;
|
|
1795
1795
|
} else if (Object.getOwnPropertySymbols) {
|
|
1796
1796
|
ReflectOwnKeys = function ReflectOwnKeys2(target) {
|
|
1797
1797
|
return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
|
|
@@ -2181,8 +2181,8 @@ function requireInherits_browser() {
|
|
|
2181
2181
|
}
|
|
2182
2182
|
return inherits_browser.exports;
|
|
2183
2183
|
}
|
|
2184
|
-
function getDefaultExportFromCjs$1(
|
|
2185
|
-
return
|
|
2184
|
+
function getDefaultExportFromCjs$1(x2) {
|
|
2185
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
2186
2186
|
}
|
|
2187
2187
|
var browser$1 = { exports: {} };
|
|
2188
2188
|
var process = browser$1.exports = {};
|
|
@@ -2461,18 +2461,18 @@ function requireDist() {
|
|
|
2461
2461
|
var eBias = eMax >> 1;
|
|
2462
2462
|
var nBits = -7;
|
|
2463
2463
|
var i2 = isLE ? nBytes - 1 : 0;
|
|
2464
|
-
var
|
|
2464
|
+
var d = isLE ? -1 : 1;
|
|
2465
2465
|
var s = buffer3[offset + i2];
|
|
2466
|
-
i2 +=
|
|
2466
|
+
i2 += d;
|
|
2467
2467
|
e = s & (1 << -nBits) - 1;
|
|
2468
2468
|
s >>= -nBits;
|
|
2469
2469
|
nBits += eLen;
|
|
2470
|
-
for (; nBits > 0; e = e * 256 + buffer3[offset + i2], i2 +=
|
|
2470
|
+
for (; nBits > 0; e = e * 256 + buffer3[offset + i2], i2 += d, nBits -= 8) {
|
|
2471
2471
|
}
|
|
2472
2472
|
m2 = e & (1 << -nBits) - 1;
|
|
2473
2473
|
e >>= -nBits;
|
|
2474
2474
|
nBits += mLen;
|
|
2475
|
-
for (; nBits > 0; m2 = m2 * 256 + buffer3[offset + i2], i2 +=
|
|
2475
|
+
for (; nBits > 0; m2 = m2 * 256 + buffer3[offset + i2], i2 += d, nBits -= 8) {
|
|
2476
2476
|
}
|
|
2477
2477
|
if (e === 0) {
|
|
2478
2478
|
e = 1 - eBias;
|
|
@@ -2491,7 +2491,7 @@ function requireDist() {
|
|
|
2491
2491
|
var eBias = eMax >> 1;
|
|
2492
2492
|
var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
|
|
2493
2493
|
var i2 = isLE ? 0 : nBytes - 1;
|
|
2494
|
-
var
|
|
2494
|
+
var d = isLE ? 1 : -1;
|
|
2495
2495
|
var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
|
|
2496
2496
|
value = Math.abs(value);
|
|
2497
2497
|
if (isNaN(value) || value === Infinity) {
|
|
@@ -2523,13 +2523,13 @@ function requireDist() {
|
|
|
2523
2523
|
e = 0;
|
|
2524
2524
|
}
|
|
2525
2525
|
}
|
|
2526
|
-
for (; mLen >= 8; buffer3[offset + i2] = m2 & 255, i2 +=
|
|
2526
|
+
for (; mLen >= 8; buffer3[offset + i2] = m2 & 255, i2 += d, m2 /= 256, mLen -= 8) {
|
|
2527
2527
|
}
|
|
2528
2528
|
e = e << mLen | m2;
|
|
2529
2529
|
eLen += mLen;
|
|
2530
|
-
for (; eLen > 0; buffer3[offset + i2] = e & 255, i2 +=
|
|
2530
|
+
for (; eLen > 0; buffer3[offset + i2] = e & 255, i2 += d, e /= 256, eLen -= 8) {
|
|
2531
2531
|
}
|
|
2532
|
-
buffer3[offset + i2 -
|
|
2532
|
+
buffer3[offset + i2 - d] |= s * 128;
|
|
2533
2533
|
};
|
|
2534
2534
|
/*!
|
|
2535
2535
|
* The buffer module from node.js, for the browser.
|
|
@@ -2763,17 +2763,17 @@ function requireDist() {
|
|
|
2763
2763
|
);
|
|
2764
2764
|
}
|
|
2765
2765
|
if (a === b2) return 0;
|
|
2766
|
-
let
|
|
2766
|
+
let x2 = a.length;
|
|
2767
2767
|
let y2 = b2.length;
|
|
2768
|
-
for (let i2 = 0, len2 = Math.min(
|
|
2768
|
+
for (let i2 = 0, len2 = Math.min(x2, y2); i2 < len2; ++i2) {
|
|
2769
2769
|
if (a[i2] !== b2[i2]) {
|
|
2770
|
-
|
|
2770
|
+
x2 = a[i2];
|
|
2771
2771
|
y2 = b2[i2];
|
|
2772
2772
|
break;
|
|
2773
2773
|
}
|
|
2774
2774
|
}
|
|
2775
|
-
if (
|
|
2776
|
-
if (y2 <
|
|
2775
|
+
if (x2 < y2) return -1;
|
|
2776
|
+
if (y2 < x2) return 1;
|
|
2777
2777
|
return 0;
|
|
2778
2778
|
};
|
|
2779
2779
|
Buffer4.isEncoding = function isEncoding(encoding) {
|
|
@@ -3022,20 +3022,20 @@ function requireDist() {
|
|
|
3022
3022
|
thisStart >>>= 0;
|
|
3023
3023
|
thisEnd >>>= 0;
|
|
3024
3024
|
if (this === target) return 0;
|
|
3025
|
-
let
|
|
3025
|
+
let x2 = thisEnd - thisStart;
|
|
3026
3026
|
let y2 = end - start;
|
|
3027
|
-
const len2 = Math.min(
|
|
3027
|
+
const len2 = Math.min(x2, y2);
|
|
3028
3028
|
const thisCopy = this.slice(thisStart, thisEnd);
|
|
3029
3029
|
const targetCopy = target.slice(start, end);
|
|
3030
3030
|
for (let i2 = 0; i2 < len2; ++i2) {
|
|
3031
3031
|
if (thisCopy[i2] !== targetCopy[i2]) {
|
|
3032
|
-
|
|
3032
|
+
x2 = thisCopy[i2];
|
|
3033
3033
|
y2 = targetCopy[i2];
|
|
3034
3034
|
break;
|
|
3035
3035
|
}
|
|
3036
3036
|
}
|
|
3037
|
-
if (
|
|
3038
|
-
if (y2 <
|
|
3037
|
+
if (x2 < y2) return -1;
|
|
3038
|
+
if (y2 < x2) return 1;
|
|
3039
3039
|
return 0;
|
|
3040
3040
|
};
|
|
3041
3041
|
function bidirectionalIndexOf(buffer3, val, byteOffset, encoding, dir) {
|
|
@@ -4607,15 +4607,15 @@ function requireGetProto() {
|
|
|
4607
4607
|
var reflectGetProto = requireReflect_getPrototypeOf();
|
|
4608
4608
|
var originalGetProto = requireObject_getPrototypeOf();
|
|
4609
4609
|
var getDunderProto = /* @__PURE__ */ requireGet();
|
|
4610
|
-
getProto = reflectGetProto ? function getProto2(
|
|
4611
|
-
return reflectGetProto(
|
|
4612
|
-
} : originalGetProto ? function getProto2(
|
|
4613
|
-
if (!
|
|
4610
|
+
getProto = reflectGetProto ? function getProto2(O) {
|
|
4611
|
+
return reflectGetProto(O);
|
|
4612
|
+
} : originalGetProto ? function getProto2(O) {
|
|
4613
|
+
if (!O || typeof O !== "object" && typeof O !== "function") {
|
|
4614
4614
|
throw new TypeError("getProto: not an object");
|
|
4615
4615
|
}
|
|
4616
|
-
return originalGetProto(
|
|
4617
|
-
} : getDunderProto ? function getProto2(
|
|
4618
|
-
return getDunderProto(
|
|
4616
|
+
return originalGetProto(O);
|
|
4617
|
+
} : getDunderProto ? function getProto2(O) {
|
|
4618
|
+
return getDunderProto(O);
|
|
4619
4619
|
} : null;
|
|
4620
4620
|
return getProto;
|
|
4621
4621
|
}
|
|
@@ -5283,18 +5283,18 @@ function requireForEach() {
|
|
|
5283
5283
|
}
|
|
5284
5284
|
};
|
|
5285
5285
|
var forEachObject = function forEachObject2(object, iterator, receiver) {
|
|
5286
|
-
for (var
|
|
5287
|
-
if (hasOwnProperty.call(object,
|
|
5286
|
+
for (var k2 in object) {
|
|
5287
|
+
if (hasOwnProperty.call(object, k2)) {
|
|
5288
5288
|
if (receiver == null) {
|
|
5289
|
-
iterator(object[
|
|
5289
|
+
iterator(object[k2], k2, object);
|
|
5290
5290
|
} else {
|
|
5291
|
-
iterator.call(receiver, object[
|
|
5291
|
+
iterator.call(receiver, object[k2], k2, object);
|
|
5292
5292
|
}
|
|
5293
5293
|
}
|
|
5294
5294
|
}
|
|
5295
5295
|
};
|
|
5296
|
-
function isArray(
|
|
5297
|
-
return toStr.call(
|
|
5296
|
+
function isArray(x2) {
|
|
5297
|
+
return toStr.call(x2) === "[object Array]";
|
|
5298
5298
|
}
|
|
5299
5299
|
forEach = function forEach2(list, iterator, thisArg) {
|
|
5300
5300
|
if (!isCallable2(iterator)) {
|
|
@@ -5903,10 +5903,10 @@ function requireUtil() {
|
|
|
5903
5903
|
var i = 1;
|
|
5904
5904
|
var args = arguments;
|
|
5905
5905
|
var len = args.length;
|
|
5906
|
-
var str = String(f).replace(formatRegExp, function(
|
|
5907
|
-
if (
|
|
5908
|
-
if (i >= len) return
|
|
5909
|
-
switch (
|
|
5906
|
+
var str = String(f).replace(formatRegExp, function(x3) {
|
|
5907
|
+
if (x3 === "%%") return "%";
|
|
5908
|
+
if (i >= len) return x3;
|
|
5909
|
+
switch (x3) {
|
|
5910
5910
|
case "%s":
|
|
5911
5911
|
return String(args[i++]);
|
|
5912
5912
|
case "%d":
|
|
@@ -5918,14 +5918,14 @@ function requireUtil() {
|
|
|
5918
5918
|
return "[Circular]";
|
|
5919
5919
|
}
|
|
5920
5920
|
default:
|
|
5921
|
-
return
|
|
5921
|
+
return x3;
|
|
5922
5922
|
}
|
|
5923
5923
|
});
|
|
5924
|
-
for (var
|
|
5925
|
-
if (isNull(
|
|
5926
|
-
str += " " +
|
|
5924
|
+
for (var x2 = args[i]; i < len; x2 = args[++i]) {
|
|
5925
|
+
if (isNull(x2) || !isObject(x2)) {
|
|
5926
|
+
str += " " + x2;
|
|
5927
5927
|
} else {
|
|
5928
|
-
str += " " + inspect(
|
|
5928
|
+
str += " " + inspect(x2);
|
|
5929
5929
|
}
|
|
5930
5930
|
}
|
|
5931
5931
|
return str;
|
|
@@ -6138,7 +6138,7 @@ function requireUtil() {
|
|
|
6138
6138
|
}
|
|
6139
6139
|
function formatArray(ctx, value, recurseTimes, visibleKeys, keys2) {
|
|
6140
6140
|
var output = [];
|
|
6141
|
-
for (var i = 0,
|
|
6141
|
+
for (var i = 0, l = value.length; i < l; ++i) {
|
|
6142
6142
|
if (hasOwnProperty(value, String(i))) {
|
|
6143
6143
|
output.push(formatProperty(
|
|
6144
6144
|
ctx,
|
|
@@ -6272,8 +6272,8 @@ function requireUtil() {
|
|
|
6272
6272
|
return typeof arg === "object" && arg !== null;
|
|
6273
6273
|
}
|
|
6274
6274
|
exports.isObject = isObject;
|
|
6275
|
-
function isDate(
|
|
6276
|
-
return isObject(
|
|
6275
|
+
function isDate(d) {
|
|
6276
|
+
return isObject(d) && objectToString(d) === "[object Date]";
|
|
6277
6277
|
}
|
|
6278
6278
|
exports.isDate = isDate;
|
|
6279
6279
|
exports.types.isDate = isDate;
|
|
@@ -6313,13 +6313,13 @@ function requireUtil() {
|
|
|
6313
6313
|
"Dec"
|
|
6314
6314
|
];
|
|
6315
6315
|
function timestamp() {
|
|
6316
|
-
var
|
|
6316
|
+
var d = /* @__PURE__ */ new Date();
|
|
6317
6317
|
var time = [
|
|
6318
|
-
pad(
|
|
6319
|
-
pad(
|
|
6320
|
-
pad(
|
|
6318
|
+
pad(d.getHours()),
|
|
6319
|
+
pad(d.getMinutes()),
|
|
6320
|
+
pad(d.getSeconds())
|
|
6321
6321
|
].join(":");
|
|
6322
|
-
return [
|
|
6322
|
+
return [d.getDate(), months[d.getMonth()], time].join(" ");
|
|
6323
6323
|
}
|
|
6324
6324
|
exports.log = function() {
|
|
6325
6325
|
console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments));
|
|
@@ -7237,8 +7237,8 @@ function require_stream_writable() {
|
|
|
7237
7237
|
state2.bufferProcessing = true;
|
|
7238
7238
|
var entry = state2.bufferedRequest;
|
|
7239
7239
|
if (stream._writev && entry && entry.next) {
|
|
7240
|
-
var
|
|
7241
|
-
var buffer2 = new Array(
|
|
7240
|
+
var l = state2.bufferedRequestCount;
|
|
7241
|
+
var buffer2 = new Array(l);
|
|
7242
7242
|
var holder = state2.corkedRequestsFree;
|
|
7243
7243
|
holder.entry = entry;
|
|
7244
7244
|
var count = 0;
|
|
@@ -8788,9 +8788,9 @@ function require_stream_readable() {
|
|
|
8788
8788
|
return from(Readable, iterable, opts);
|
|
8789
8789
|
};
|
|
8790
8790
|
}
|
|
8791
|
-
function indexOf(xs,
|
|
8792
|
-
for (var i = 0,
|
|
8793
|
-
if (xs[i] ===
|
|
8791
|
+
function indexOf(xs, x2) {
|
|
8792
|
+
for (var i = 0, l = xs.length; i < l; i++) {
|
|
8793
|
+
if (xs[i] === x2) return i;
|
|
8794
8794
|
}
|
|
8795
8795
|
return -1;
|
|
8796
8796
|
}
|
|
@@ -9169,7 +9169,7 @@ function requireSax() {
|
|
|
9169
9169
|
function checkBufferLength(parser) {
|
|
9170
9170
|
var maxAllowed = Math.max(sax2.MAX_BUFFER_LENGTH, 10);
|
|
9171
9171
|
var maxActual = 0;
|
|
9172
|
-
for (var i = 0,
|
|
9172
|
+
for (var i = 0, l = buffers.length; i < l; i++) {
|
|
9173
9173
|
var len = parser[buffers[i]].length;
|
|
9174
9174
|
if (len > maxAllowed) {
|
|
9175
9175
|
switch (buffers[i]) {
|
|
@@ -9194,7 +9194,7 @@ function requireSax() {
|
|
|
9194
9194
|
parser.bufferCheckPosition = m2 + parser.position;
|
|
9195
9195
|
}
|
|
9196
9196
|
function clearBuffers(parser) {
|
|
9197
|
-
for (var i = 0,
|
|
9197
|
+
for (var i = 0, l = buffers.length; i < l; i++) {
|
|
9198
9198
|
parser[buffers[i]] = "";
|
|
9199
9199
|
}
|
|
9200
9200
|
}
|
|
@@ -9248,27 +9248,27 @@ function requireSax() {
|
|
|
9248
9248
|
this._parser = new SAXParser(strict, opt);
|
|
9249
9249
|
this.writable = true;
|
|
9250
9250
|
this.readable = true;
|
|
9251
|
-
var
|
|
9251
|
+
var me2 = this;
|
|
9252
9252
|
this._parser.onend = function() {
|
|
9253
|
-
|
|
9253
|
+
me2.emit("end");
|
|
9254
9254
|
};
|
|
9255
9255
|
this._parser.onerror = function(er) {
|
|
9256
|
-
|
|
9257
|
-
|
|
9256
|
+
me2.emit("error", er);
|
|
9257
|
+
me2._parser.error = null;
|
|
9258
9258
|
};
|
|
9259
9259
|
this._decoder = null;
|
|
9260
9260
|
streamWraps.forEach(function(ev) {
|
|
9261
|
-
Object.defineProperty(
|
|
9261
|
+
Object.defineProperty(me2, "on" + ev, {
|
|
9262
9262
|
get: function() {
|
|
9263
|
-
return
|
|
9263
|
+
return me2._parser["on" + ev];
|
|
9264
9264
|
},
|
|
9265
9265
|
set: function(h2) {
|
|
9266
9266
|
if (!h2) {
|
|
9267
|
-
|
|
9268
|
-
|
|
9267
|
+
me2.removeAllListeners(ev);
|
|
9268
|
+
me2._parser["on" + ev] = h2;
|
|
9269
9269
|
return h2;
|
|
9270
9270
|
}
|
|
9271
|
-
|
|
9271
|
+
me2.on(ev, h2);
|
|
9272
9272
|
},
|
|
9273
9273
|
enumerable: true,
|
|
9274
9274
|
configurable: false
|
|
@@ -9300,15 +9300,15 @@ function requireSax() {
|
|
|
9300
9300
|
return true;
|
|
9301
9301
|
};
|
|
9302
9302
|
SAXStream.prototype.on = function(ev, handler2) {
|
|
9303
|
-
var
|
|
9304
|
-
if (!
|
|
9305
|
-
|
|
9303
|
+
var me2 = this;
|
|
9304
|
+
if (!me2._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) {
|
|
9305
|
+
me2._parser["on" + ev] = function() {
|
|
9306
9306
|
var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
|
|
9307
9307
|
args.splice(0, 0, ev);
|
|
9308
|
-
|
|
9308
|
+
me2.emit.apply(me2, args);
|
|
9309
9309
|
};
|
|
9310
9310
|
}
|
|
9311
|
-
return Stream.prototype.on.call(
|
|
9311
|
+
return Stream.prototype.on.call(me2, ev, handler2);
|
|
9312
9312
|
};
|
|
9313
9313
|
var CDATA = "[CDATA[";
|
|
9314
9314
|
var DOCTYPE = "DOCTYPE";
|
|
@@ -9814,7 +9814,7 @@ function requireSax() {
|
|
|
9814
9814
|
});
|
|
9815
9815
|
});
|
|
9816
9816
|
}
|
|
9817
|
-
for (var i = 0,
|
|
9817
|
+
for (var i = 0, l = parser.attribList.length; i < l; i++) {
|
|
9818
9818
|
var nv = parser.attribList[i];
|
|
9819
9819
|
var name = nv[0];
|
|
9820
9820
|
var value = nv[1];
|
|
@@ -9900,9 +9900,9 @@ function requireSax() {
|
|
|
9900
9900
|
var tag = parser.tag = parser.tags.pop();
|
|
9901
9901
|
parser.tagName = parser.tag.name;
|
|
9902
9902
|
emitNode(parser, "onclosetag", parser.tagName);
|
|
9903
|
-
var
|
|
9903
|
+
var x2 = {};
|
|
9904
9904
|
for (var i in tag.ns) {
|
|
9905
|
-
|
|
9905
|
+
x2[i] = tag.ns[i];
|
|
9906
9906
|
}
|
|
9907
9907
|
var parent = parser.tags[parser.tags.length - 1] || parser;
|
|
9908
9908
|
if (parser.opt.xmlns && tag.ns !== parent.ns) {
|
|
@@ -10959,8 +10959,8 @@ function requireXml2json() {
|
|
|
10959
10959
|
js = xml2js2(xml, options);
|
|
10960
10960
|
parentKey = "compact" in options && options.compact ? "_parent" : "parent";
|
|
10961
10961
|
if ("addParent" in options && options.addParent) {
|
|
10962
|
-
json = JSON.stringify(js, function(
|
|
10963
|
-
return
|
|
10962
|
+
json = JSON.stringify(js, function(k2, v2) {
|
|
10963
|
+
return k2 === parentKey ? "_" : v2;
|
|
10964
10964
|
}, options.spaces);
|
|
10965
10965
|
} else {
|
|
10966
10966
|
json = JSON.stringify(js, null, options.spaces);
|
|
@@ -11382,8 +11382,8 @@ function v4(options, buf, offset) {
|
|
|
11382
11382
|
rnds[8] = rnds[8] & 63 | 128;
|
|
11383
11383
|
return unsafeStringify(rnds);
|
|
11384
11384
|
}
|
|
11385
|
-
function getDefaultExportFromCjs(
|
|
11386
|
-
return
|
|
11385
|
+
function getDefaultExportFromCjs(x2) {
|
|
11386
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
11387
11387
|
}
|
|
11388
11388
|
const CRC_TABLE = new Int32Array([
|
|
11389
11389
|
0,
|
|
@@ -12756,9 +12756,9 @@ class ResolvedPos {
|
|
|
12756
12756
|
blockRange(other = this, pred) {
|
|
12757
12757
|
if (other.pos < this.pos)
|
|
12758
12758
|
return other.blockRange(this);
|
|
12759
|
-
for (let
|
|
12760
|
-
if (other.pos <= this.end(
|
|
12761
|
-
return new NodeRange(this, other,
|
|
12759
|
+
for (let d = this.depth - (this.parent.inlineContent || this.pos == other.pos ? 1 : 0); d >= 0; d--)
|
|
12760
|
+
if (other.pos <= this.end(d) && (!pred || pred(this.node(d))))
|
|
12761
|
+
return new NodeRange(this, other, d);
|
|
12762
12762
|
return null;
|
|
12763
12763
|
}
|
|
12764
12764
|
/**
|
|
@@ -14777,8 +14777,8 @@ class ParseContext {
|
|
|
14777
14777
|
textblockFromContext() {
|
|
14778
14778
|
let $context = this.options.context;
|
|
14779
14779
|
if ($context)
|
|
14780
|
-
for (let
|
|
14781
|
-
let deflt = $context.node(
|
|
14780
|
+
for (let d = $context.depth; d >= 0; d--) {
|
|
14781
|
+
let deflt = $context.node(d).contentMatchAt($context.indexAfter(d)).defaultType;
|
|
14782
14782
|
if (deflt && deflt.isTextblock && deflt.defaultAttrs)
|
|
14783
14783
|
return deflt;
|
|
14784
14784
|
}
|
|
@@ -15199,8 +15199,8 @@ function polygonToObj(polygonNode) {
|
|
|
15199
15199
|
const points = [];
|
|
15200
15200
|
polygonNode.elements.forEach((element) => {
|
|
15201
15201
|
if (["wp:start", "wp:lineTo"].includes(element.name)) {
|
|
15202
|
-
const { x, y: y2 } = element.attributes;
|
|
15203
|
-
points.push([polygonUnitsToPixels(
|
|
15202
|
+
const { x: x2, y: y2 } = element.attributes;
|
|
15203
|
+
points.push([polygonUnitsToPixels(x2), polygonUnitsToPixels(y2)]);
|
|
15204
15204
|
}
|
|
15205
15205
|
});
|
|
15206
15206
|
if (points.length > 1) {
|
|
@@ -15223,13 +15223,13 @@ function objToPolygon(points) {
|
|
|
15223
15223
|
elements: []
|
|
15224
15224
|
};
|
|
15225
15225
|
points.forEach((point, index2) => {
|
|
15226
|
-
const [
|
|
15226
|
+
const [x2, y2] = point;
|
|
15227
15227
|
const tagName = index2 === 0 ? "wp:start" : "wp:lineTo";
|
|
15228
15228
|
const pointNode = {
|
|
15229
15229
|
name: tagName,
|
|
15230
15230
|
type: tagName,
|
|
15231
15231
|
attributes: {
|
|
15232
|
-
x: pixelsToPolygonUnits(
|
|
15232
|
+
x: pixelsToPolygonUnits(x2),
|
|
15233
15233
|
y: pixelsToPolygonUnits(y2)
|
|
15234
15234
|
}
|
|
15235
15235
|
};
|
|
@@ -17461,19 +17461,19 @@ function lift(tr, range2, target) {
|
|
|
17461
17461
|
let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
|
|
17462
17462
|
let start = gapStart, end = gapEnd;
|
|
17463
17463
|
let before = Fragment.empty, openStart = 0;
|
|
17464
|
-
for (let
|
|
17465
|
-
if (splitting || $from.index(
|
|
17464
|
+
for (let d = depth, splitting = false; d > target; d--)
|
|
17465
|
+
if (splitting || $from.index(d) > 0) {
|
|
17466
17466
|
splitting = true;
|
|
17467
|
-
before = Fragment.from($from.node(
|
|
17467
|
+
before = Fragment.from($from.node(d).copy(before));
|
|
17468
17468
|
openStart++;
|
|
17469
17469
|
} else {
|
|
17470
17470
|
start--;
|
|
17471
17471
|
}
|
|
17472
17472
|
let after = Fragment.empty, openEnd = 0;
|
|
17473
|
-
for (let
|
|
17474
|
-
if (splitting || $to.after(
|
|
17473
|
+
for (let d = depth, splitting = false; d > target; d--)
|
|
17474
|
+
if (splitting || $to.after(d + 1) < $to.end(d)) {
|
|
17475
17475
|
splitting = true;
|
|
17476
|
-
after = Fragment.from($to.node(
|
|
17476
|
+
after = Fragment.from($to.node(d).copy(after));
|
|
17477
17477
|
openEnd++;
|
|
17478
17478
|
} else {
|
|
17479
17479
|
end++;
|
|
@@ -17593,8 +17593,8 @@ function canSplit(doc2, pos, depth = 1, typesAfter) {
|
|
|
17593
17593
|
let innerType = typesAfter && typesAfter[typesAfter.length - 1] || $pos.parent;
|
|
17594
17594
|
if (base < 0 || $pos.parent.type.spec.isolating || !$pos.parent.canReplace($pos.index(), $pos.parent.childCount) || !innerType.type.validContent($pos.parent.content.cutByIndex($pos.index(), $pos.parent.childCount)))
|
|
17595
17595
|
return false;
|
|
17596
|
-
for (let
|
|
17597
|
-
let node = $pos.node(
|
|
17596
|
+
for (let d = $pos.depth - 1, i = depth - 2; d > base; d--, i--) {
|
|
17597
|
+
let node = $pos.node(d), index3 = $pos.index(d);
|
|
17598
17598
|
if (node.type.spec.isolating)
|
|
17599
17599
|
return false;
|
|
17600
17600
|
let rest = node.content.cutByIndex(index3, node.childCount);
|
|
@@ -17611,10 +17611,10 @@ function canSplit(doc2, pos, depth = 1, typesAfter) {
|
|
|
17611
17611
|
}
|
|
17612
17612
|
function split(tr, pos, depth = 1, typesAfter) {
|
|
17613
17613
|
let $pos = tr.doc.resolve(pos), before = Fragment.empty, after = Fragment.empty;
|
|
17614
|
-
for (let
|
|
17615
|
-
before = Fragment.from($pos.node(
|
|
17614
|
+
for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {
|
|
17615
|
+
before = Fragment.from($pos.node(d).copy(before));
|
|
17616
17616
|
let typeAfter = typesAfter && typesAfter[i];
|
|
17617
|
-
after = Fragment.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(
|
|
17617
|
+
after = Fragment.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
|
|
17618
17618
|
}
|
|
17619
17619
|
tr.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));
|
|
17620
17620
|
}
|
|
@@ -17643,24 +17643,24 @@ function joinable(a, b2) {
|
|
|
17643
17643
|
}
|
|
17644
17644
|
function joinPoint(doc2, pos, dir = -1) {
|
|
17645
17645
|
let $pos = doc2.resolve(pos);
|
|
17646
|
-
for (let
|
|
17647
|
-
let before, after, index2 = $pos.index(
|
|
17648
|
-
if (
|
|
17646
|
+
for (let d = $pos.depth; ; d--) {
|
|
17647
|
+
let before, after, index2 = $pos.index(d);
|
|
17648
|
+
if (d == $pos.depth) {
|
|
17649
17649
|
before = $pos.nodeBefore;
|
|
17650
17650
|
after = $pos.nodeAfter;
|
|
17651
17651
|
} else if (dir > 0) {
|
|
17652
|
-
before = $pos.node(
|
|
17652
|
+
before = $pos.node(d + 1);
|
|
17653
17653
|
index2++;
|
|
17654
|
-
after = $pos.node(
|
|
17654
|
+
after = $pos.node(d).maybeChild(index2);
|
|
17655
17655
|
} else {
|
|
17656
|
-
before = $pos.node(
|
|
17657
|
-
after = $pos.node(
|
|
17656
|
+
before = $pos.node(d).maybeChild(index2 - 1);
|
|
17657
|
+
after = $pos.node(d + 1);
|
|
17658
17658
|
}
|
|
17659
|
-
if (before && !before.isTextblock && joinable(before, after) && $pos.node(
|
|
17659
|
+
if (before && !before.isTextblock && joinable(before, after) && $pos.node(d).canReplace(index2, index2 + 1))
|
|
17660
17660
|
return pos;
|
|
17661
|
-
if (
|
|
17661
|
+
if (d == 0)
|
|
17662
17662
|
break;
|
|
17663
|
-
pos = dir < 0 ? $pos.before(
|
|
17663
|
+
pos = dir < 0 ? $pos.before(d) : $pos.after(d);
|
|
17664
17664
|
}
|
|
17665
17665
|
}
|
|
17666
17666
|
function join(tr, pos, depth) {
|
|
@@ -17695,19 +17695,19 @@ function insertPoint(doc2, pos, nodeType) {
|
|
|
17695
17695
|
if ($pos.parent.canReplaceWith($pos.index(), $pos.index(), nodeType))
|
|
17696
17696
|
return pos;
|
|
17697
17697
|
if ($pos.parentOffset == 0)
|
|
17698
|
-
for (let
|
|
17699
|
-
let index2 = $pos.index(
|
|
17700
|
-
if ($pos.node(
|
|
17701
|
-
return $pos.before(
|
|
17698
|
+
for (let d = $pos.depth - 1; d >= 0; d--) {
|
|
17699
|
+
let index2 = $pos.index(d);
|
|
17700
|
+
if ($pos.node(d).canReplaceWith(index2, index2, nodeType))
|
|
17701
|
+
return $pos.before(d + 1);
|
|
17702
17702
|
if (index2 > 0)
|
|
17703
17703
|
return null;
|
|
17704
17704
|
}
|
|
17705
17705
|
if ($pos.parentOffset == $pos.parent.content.size)
|
|
17706
|
-
for (let
|
|
17707
|
-
let index2 = $pos.indexAfter(
|
|
17708
|
-
if ($pos.node(
|
|
17709
|
-
return $pos.after(
|
|
17710
|
-
if (index2 < $pos.node(
|
|
17706
|
+
for (let d = $pos.depth - 1; d >= 0; d--) {
|
|
17707
|
+
let index2 = $pos.indexAfter(d);
|
|
17708
|
+
if ($pos.node(d).canReplaceWith(index2, index2, nodeType))
|
|
17709
|
+
return $pos.after(d + 1);
|
|
17710
|
+
if (index2 < $pos.node(d).childCount)
|
|
17711
17711
|
return null;
|
|
17712
17712
|
}
|
|
17713
17713
|
return null;
|
|
@@ -17720,10 +17720,10 @@ function dropPoint(doc2, pos, slice) {
|
|
|
17720
17720
|
for (let i = 0; i < slice.openStart; i++)
|
|
17721
17721
|
content = content.firstChild.content;
|
|
17722
17722
|
for (let pass = 1; pass <= (slice.openStart == 0 && slice.size ? 2 : 1); pass++) {
|
|
17723
|
-
for (let
|
|
17724
|
-
let bias =
|
|
17725
|
-
let insertPos = $pos.index(
|
|
17726
|
-
let parent = $pos.node(
|
|
17723
|
+
for (let d = $pos.depth; d >= 0; d--) {
|
|
17724
|
+
let bias = d == $pos.depth ? 0 : $pos.pos <= ($pos.start(d + 1) + $pos.end(d + 1)) / 2 ? -1 : 1;
|
|
17725
|
+
let insertPos = $pos.index(d) + (bias > 0 ? 1 : 0);
|
|
17726
|
+
let parent = $pos.node(d), fits = false;
|
|
17727
17727
|
if (pass == 1) {
|
|
17728
17728
|
fits = parent.canReplace(insertPos, insertPos, content);
|
|
17729
17729
|
} else {
|
|
@@ -17731,7 +17731,7 @@ function dropPoint(doc2, pos, slice) {
|
|
|
17731
17731
|
fits = wrapping && parent.canReplaceWith(insertPos, insertPos, wrapping[0]);
|
|
17732
17732
|
}
|
|
17733
17733
|
if (fits)
|
|
17734
|
-
return bias == 0 ? $pos.pos : bias < 0 ? $pos.before(
|
|
17734
|
+
return bias == 0 ? $pos.pos : bias < 0 ? $pos.before(d + 1) : $pos.after(d + 1);
|
|
17735
17735
|
}
|
|
17736
17736
|
}
|
|
17737
17737
|
return null;
|
|
@@ -17797,12 +17797,12 @@ class Fitter {
|
|
|
17797
17797
|
// depths, one for the slice and one for the frontier.
|
|
17798
17798
|
findFittable() {
|
|
17799
17799
|
let startDepth = this.unplaced.openStart;
|
|
17800
|
-
for (let cur = this.unplaced.content,
|
|
17800
|
+
for (let cur = this.unplaced.content, d = 0, openEnd = this.unplaced.openEnd; d < startDepth; d++) {
|
|
17801
17801
|
let node = cur.firstChild;
|
|
17802
17802
|
if (cur.childCount > 1)
|
|
17803
17803
|
openEnd = 0;
|
|
17804
|
-
if (node.type.spec.isolating && openEnd <=
|
|
17805
|
-
startDepth =
|
|
17804
|
+
if (node.type.spec.isolating && openEnd <= d) {
|
|
17805
|
+
startDepth = d;
|
|
17806
17806
|
break;
|
|
17807
17807
|
}
|
|
17808
17808
|
cur = node.content;
|
|
@@ -17908,9 +17908,9 @@ class Fitter {
|
|
|
17908
17908
|
let fit = contentAfterFits($to, i, type2, match, dropInner);
|
|
17909
17909
|
if (!fit)
|
|
17910
17910
|
continue;
|
|
17911
|
-
for (let
|
|
17912
|
-
let { match: match2, type: type3 } = this.frontier[
|
|
17913
|
-
let matches2 = contentAfterFits($to,
|
|
17911
|
+
for (let d = i - 1; d >= 0; d--) {
|
|
17912
|
+
let { match: match2, type: type3 } = this.frontier[d];
|
|
17913
|
+
let matches2 = contentAfterFits($to, d, type3, match2, true);
|
|
17914
17914
|
if (!matches2 || matches2.childCount)
|
|
17915
17915
|
continue scan;
|
|
17916
17916
|
}
|
|
@@ -17926,8 +17926,8 @@ class Fitter {
|
|
|
17926
17926
|
if (close2.fit.childCount)
|
|
17927
17927
|
this.placed = addToFragment(this.placed, close2.depth, close2.fit);
|
|
17928
17928
|
$to = close2.move;
|
|
17929
|
-
for (let
|
|
17930
|
-
let node = $to.node(
|
|
17929
|
+
for (let d = close2.depth + 1; d <= $to.depth; d++) {
|
|
17930
|
+
let node = $to.node(d), add = node.type.contentMatch.fillBefore(node.content, true, $to.index(d));
|
|
17931
17931
|
this.openFrontierNode(node.type, node.attrs, add);
|
|
17932
17932
|
}
|
|
17933
17933
|
return $to;
|
|
@@ -18000,14 +18000,14 @@ function replaceRange(tr, from, to, slice) {
|
|
|
18000
18000
|
targetDepths.pop();
|
|
18001
18001
|
let preferredTarget = -($from.depth + 1);
|
|
18002
18002
|
targetDepths.unshift(preferredTarget);
|
|
18003
|
-
for (let
|
|
18004
|
-
let spec = $from.node(
|
|
18003
|
+
for (let d = $from.depth, pos = $from.pos - 1; d > 0; d--, pos--) {
|
|
18004
|
+
let spec = $from.node(d).type.spec;
|
|
18005
18005
|
if (spec.defining || spec.definingAsContext || spec.isolating)
|
|
18006
18006
|
break;
|
|
18007
|
-
if (targetDepths.indexOf(
|
|
18008
|
-
preferredTarget =
|
|
18009
|
-
else if ($from.before(
|
|
18010
|
-
targetDepths.splice(1, 0, -
|
|
18007
|
+
if (targetDepths.indexOf(d) > -1)
|
|
18008
|
+
preferredTarget = d;
|
|
18009
|
+
else if ($from.before(d) == pos)
|
|
18010
|
+
targetDepths.splice(1, 0, -d);
|
|
18011
18011
|
}
|
|
18012
18012
|
let preferredTargetIndex = targetDepths.indexOf(preferredTarget);
|
|
18013
18013
|
let leftNodes = [], preferredDepth = slice.openStart;
|
|
@@ -18018,10 +18018,10 @@ function replaceRange(tr, from, to, slice) {
|
|
|
18018
18018
|
break;
|
|
18019
18019
|
content = node.content;
|
|
18020
18020
|
}
|
|
18021
|
-
for (let
|
|
18022
|
-
let leftNode = leftNodes[
|
|
18021
|
+
for (let d = preferredDepth - 1; d >= 0; d--) {
|
|
18022
|
+
let leftNode = leftNodes[d], def = definesContent(leftNode.type);
|
|
18023
18023
|
if (def && !leftNode.sameMarkup($from.node(Math.abs(preferredTarget) - 1)))
|
|
18024
|
-
preferredDepth =
|
|
18024
|
+
preferredDepth = d;
|
|
18025
18025
|
else if (def || !leftNode.type.isTextblock)
|
|
18026
18026
|
break;
|
|
18027
18027
|
}
|
|
@@ -18083,20 +18083,20 @@ function deleteRange(tr, from, to) {
|
|
|
18083
18083
|
if (depth > 0 && (last || $from.node(depth - 1).canReplace($from.index(depth - 1), $to.indexAfter(depth - 1))))
|
|
18084
18084
|
return tr.delete($from.before(depth), $to.after(depth));
|
|
18085
18085
|
}
|
|
18086
|
-
for (let
|
|
18087
|
-
if (from - $from.start(
|
|
18088
|
-
return tr.delete($from.before(
|
|
18086
|
+
for (let d = 1; d <= $from.depth && d <= $to.depth; d++) {
|
|
18087
|
+
if (from - $from.start(d) == $from.depth - d && to > $from.end(d) && $to.end(d) - to != $to.depth - d && $from.start(d - 1) == $to.start(d - 1) && $from.node(d - 1).canReplace($from.index(d - 1), $to.index(d - 1)))
|
|
18088
|
+
return tr.delete($from.before(d), to);
|
|
18089
18089
|
}
|
|
18090
18090
|
tr.delete(from, to);
|
|
18091
18091
|
}
|
|
18092
18092
|
function coveredDepths($from, $to) {
|
|
18093
18093
|
let result = [], minDepth = Math.min($from.depth, $to.depth);
|
|
18094
|
-
for (let
|
|
18095
|
-
let start = $from.start(
|
|
18096
|
-
if (start < $from.pos - ($from.depth -
|
|
18094
|
+
for (let d = minDepth; d >= 0; d--) {
|
|
18095
|
+
let start = $from.start(d);
|
|
18096
|
+
if (start < $from.pos - ($from.depth - d) || $to.end(d) > $to.pos + ($to.depth - d) || $from.node(d).type.spec.isolating || $to.node(d).type.spec.isolating)
|
|
18097
18097
|
break;
|
|
18098
|
-
if (start == $to.start(
|
|
18099
|
-
result.push(
|
|
18098
|
+
if (start == $to.start(d) || d == $from.depth && d == $to.depth && $from.parent.inlineContent && $to.parent.inlineContent && d && $to.start(d - 1) == start - 1)
|
|
18099
|
+
result.push(d);
|
|
18100
18100
|
}
|
|
18101
18101
|
return result;
|
|
18102
18102
|
}
|
|
@@ -22856,7 +22856,7 @@ function posToDOMRect(view, from, to) {
|
|
|
22856
22856
|
const right = Math.max(start.right, end.right);
|
|
22857
22857
|
const width = right - left;
|
|
22858
22858
|
const height = bottom - top;
|
|
22859
|
-
const
|
|
22859
|
+
const x2 = left;
|
|
22860
22860
|
const y2 = top;
|
|
22861
22861
|
const data = {
|
|
22862
22862
|
top,
|
|
@@ -22865,7 +22865,7 @@ function posToDOMRect(view, from, to) {
|
|
|
22865
22865
|
right,
|
|
22866
22866
|
width,
|
|
22867
22867
|
height,
|
|
22868
|
-
x,
|
|
22868
|
+
x: x2,
|
|
22869
22869
|
y: y2
|
|
22870
22870
|
};
|
|
22871
22871
|
return {
|
|
@@ -22875,8 +22875,8 @@ function posToDOMRect(view, from, to) {
|
|
|
22875
22875
|
}
|
|
22876
22876
|
const isInTable = (state2) => {
|
|
22877
22877
|
const { $head } = state2.selection;
|
|
22878
|
-
for (let
|
|
22879
|
-
if ($head.node(
|
|
22878
|
+
for (let d = $head.depth; d > 0; d -= 1) {
|
|
22879
|
+
if ($head.node(d).type?.spec?.tableRole === "row") {
|
|
22880
22880
|
return true;
|
|
22881
22881
|
}
|
|
22882
22882
|
}
|
|
@@ -22929,7 +22929,7 @@ function stripHtmlStyles(html) {
|
|
|
22929
22929
|
function cleanStyle(style) {
|
|
22930
22930
|
if (!style) return "";
|
|
22931
22931
|
const declarations = style.split(";").map((s) => s.trim()).filter(Boolean);
|
|
22932
|
-
const textAlign = declarations.find((
|
|
22932
|
+
const textAlign = declarations.find((d) => d.startsWith("text-align"));
|
|
22933
22933
|
return textAlign ? `${textAlign};` : "";
|
|
22934
22934
|
}
|
|
22935
22935
|
function preserveSpaces(innerHtml) {
|
|
@@ -22954,39 +22954,39 @@ function createDocFromHTML(content, schema, options = {}) {
|
|
|
22954
22954
|
function L() {
|
|
22955
22955
|
return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
|
|
22956
22956
|
}
|
|
22957
|
-
var
|
|
22958
|
-
function G(
|
|
22959
|
-
|
|
22957
|
+
var T = L();
|
|
22958
|
+
function G(u3) {
|
|
22959
|
+
T = u3;
|
|
22960
22960
|
}
|
|
22961
|
-
var
|
|
22962
|
-
function h(
|
|
22963
|
-
let t = typeof
|
|
22961
|
+
var I = { exec: () => null };
|
|
22962
|
+
function h(u3, e = "") {
|
|
22963
|
+
let t = typeof u3 == "string" ? u3 : u3.source, n = { replace: (r, i) => {
|
|
22964
22964
|
let s = typeof i == "string" ? i : i.source;
|
|
22965
22965
|
return s = s.replace(m.caret, "$1"), t = t.replace(r, s), n;
|
|
22966
22966
|
}, getRegex: () => new RegExp(t, e) };
|
|
22967
22967
|
return n;
|
|
22968
22968
|
}
|
|
22969
|
-
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]\] /, listReplaceTask: /^\[[ 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: (
|
|
22970
|
-
]`).replace("lheading",
|
|
22971
|
-
var
|
|
22972
|
-
function w(
|
|
22969
|
+
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]\] /, listReplaceTask: /^\[[ 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: (u3) => new RegExp(`^( {0,3}${u3})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}#`), htmlBeginRegex: (u3) => new RegExp(`^ {0,${Math.min(3, u3 - 1)}}<(?:[a-z].*>|!--)`, "i") }, be = /^(?:[ \t]*(?:\n|$))+/, Re = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, F = /(?:[*+-]|\d{1,9}[.)])/, ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, oe = h(ie).replace(/bull/g, F).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(), we = h(ie).replace(/bull/g, F).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(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, ye = /^[^\n]+/, Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Pe = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Se = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex(), 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", U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, $e = h("^ {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[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", U).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = h(j).replace("hr", E).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(), _e = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), K = { blockquote: _e, code: Re, def: Pe, fences: Te, heading: Oe, hr: E, html: $e, lheading: oe, list: Se, newline: be, paragraph: ae, table: I, text: ye }, re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\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(), Le = { ...K, lheading: we, table: re, paragraph: h(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).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() }, Me = { ...K, html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", U).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: I, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(j).replace("hr", E).replace("heading", ` *#{1,6} *[^
|
|
22970
|
+
]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, ze = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ae = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, le = /^( {2,}|\\)\n(?!\s*$)/, Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, D = /[\p{P}\p{S}]/u, W = /[\s\p{P}\p{S}]/u, ue = /[^\s\p{P}\p{S}]/u, Ee = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex(), pe = /(?!~)[\p{P}\p{S}]/u, Ce = /(?!~)[\s\p{P}\p{S}]/u, Be = /(?:[^\s\p{P}\p{S}]|~)/u, qe = h(/link|code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<!`)(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("code", /(?<!`)(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, ve = h(ce, "u").replace(/punct/g, D).getRegex(), De = h(ce, "u").replace(/punct/g, pe).getRegex(), he$3 = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", He = h(he$3, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ze = h(he$3, "gu").replace(/notPunctSpace/g, Be).replace(/punctSpace/g, Ce).replace(/punct/g, pe).getRegex(), Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex(), Ne = h(/\\(punct)/, "gu").replace(/punct/g, D).getRegex(), Fe = h(/^<(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(), je = h(U).replace("(?:-->|$)", "-->").getRegex(), Qe = h("^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", je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ue = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), de = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex(), ke = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex(), Ke = h("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex(), se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, X = { _backpedal: I, anyPunctuation: Ne, autolink: Fe, blockSkip: qe, br: le, code: Ae, del: I, emStrongLDelim: ve, emStrongRDelimAst: He, emStrongRDelimUnd: Ge, escape: ze, link: Ue, nolink: ke, punctuation: Ee, reflink: de, reflinkSearch: Ke, tag: Qe, text: Ie, url: I }, We = { ...X, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() }, N = { ...X, emStrongRDelimAst: Ze, emStrongLDelim: De, url: h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).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: h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() }, Xe = { ...N, br: h(le).replace("{2,}", "*").getRegex(), text: h(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, C = { normal: K, gfm: Le, pedantic: Me }, M = { normal: X, gfm: N, breaks: Xe, pedantic: We };
|
|
22971
|
+
var Je = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, ge = (u3) => Je[u3];
|
|
22972
|
+
function w(u3, e) {
|
|
22973
22973
|
if (e) {
|
|
22974
|
-
if (m.escapeTest.test(
|
|
22975
|
-
} else if (m.escapeTestNoEncode.test(
|
|
22976
|
-
return
|
|
22974
|
+
if (m.escapeTest.test(u3)) return u3.replace(m.escapeReplace, ge);
|
|
22975
|
+
} else if (m.escapeTestNoEncode.test(u3)) return u3.replace(m.escapeReplaceNoEncode, ge);
|
|
22976
|
+
return u3;
|
|
22977
22977
|
}
|
|
22978
|
-
function J(
|
|
22978
|
+
function J(u3) {
|
|
22979
22979
|
try {
|
|
22980
|
-
|
|
22980
|
+
u3 = encodeURI(u3).replace(m.percentDecode, "%");
|
|
22981
22981
|
} catch {
|
|
22982
22982
|
return null;
|
|
22983
22983
|
}
|
|
22984
|
-
return
|
|
22984
|
+
return u3;
|
|
22985
22985
|
}
|
|
22986
|
-
function V(
|
|
22987
|
-
let t =
|
|
22988
|
-
let a = false,
|
|
22989
|
-
for (; --
|
|
22986
|
+
function V(u3, e) {
|
|
22987
|
+
let t = u3.replace(m.findPipe, (i, s, o) => {
|
|
22988
|
+
let a = false, l = s;
|
|
22989
|
+
for (; --l >= 0 && o[l] === "\\"; ) a = !a;
|
|
22990
22990
|
return a ? "|" : " |";
|
|
22991
22991
|
}), n = t.split(m.splitPipe), r = 0;
|
|
22992
22992
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
|
|
@@ -22994,33 +22994,33 @@ function V(l3, e) {
|
|
|
22994
22994
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(m.slashPipe, "|");
|
|
22995
22995
|
return n;
|
|
22996
22996
|
}
|
|
22997
|
-
function z(
|
|
22998
|
-
let n =
|
|
22997
|
+
function z(u3, e, t) {
|
|
22998
|
+
let n = u3.length;
|
|
22999
22999
|
if (n === 0) return "";
|
|
23000
23000
|
let r = 0;
|
|
23001
23001
|
for (; r < n; ) {
|
|
23002
|
-
let i =
|
|
23002
|
+
let i = u3.charAt(n - r - 1);
|
|
23003
23003
|
if (i === e && true) r++;
|
|
23004
23004
|
else break;
|
|
23005
23005
|
}
|
|
23006
|
-
return
|
|
23006
|
+
return u3.slice(0, n - r);
|
|
23007
23007
|
}
|
|
23008
|
-
function
|
|
23009
|
-
if (
|
|
23008
|
+
function fe(u3, e) {
|
|
23009
|
+
if (u3.indexOf(e[1]) === -1) return -1;
|
|
23010
23010
|
let t = 0;
|
|
23011
|
-
for (let n = 0; n <
|
|
23012
|
-
else if (
|
|
23013
|
-
else if (
|
|
23011
|
+
for (let n = 0; n < u3.length; n++) if (u3[n] === "\\") n++;
|
|
23012
|
+
else if (u3[n] === e[0]) t++;
|
|
23013
|
+
else if (u3[n] === e[1] && (t--, t < 0)) return n;
|
|
23014
23014
|
return t > 0 ? -2 : -1;
|
|
23015
23015
|
}
|
|
23016
|
-
function
|
|
23017
|
-
let i = e.href, s = e.title || null, o =
|
|
23016
|
+
function me(u3, e, t, n, r) {
|
|
23017
|
+
let i = e.href, s = e.title || null, o = u3[1].replace(r.other.outputLinkReplace, "$1");
|
|
23018
23018
|
n.state.inLink = true;
|
|
23019
|
-
let a = { type:
|
|
23019
|
+
let a = { type: u3[0].charAt(0) === "!" ? "image" : "link", raw: t, href: i, title: s, text: o, tokens: n.inlineTokens(o) };
|
|
23020
23020
|
return n.state.inLink = false, a;
|
|
23021
23021
|
}
|
|
23022
|
-
function
|
|
23023
|
-
let n =
|
|
23022
|
+
function Ve(u3, e, t) {
|
|
23023
|
+
let n = u3.match(t.other.indentCodeCompensation);
|
|
23024
23024
|
if (n === null) return e;
|
|
23025
23025
|
let r = n[1];
|
|
23026
23026
|
return e.split(`
|
|
@@ -23037,7 +23037,7 @@ var y = class {
|
|
|
23037
23037
|
__publicField(this, "options");
|
|
23038
23038
|
__publicField(this, "rules");
|
|
23039
23039
|
__publicField(this, "lexer");
|
|
23040
|
-
this.options = e ||
|
|
23040
|
+
this.options = e || T;
|
|
23041
23041
|
}
|
|
23042
23042
|
space(e) {
|
|
23043
23043
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -23054,7 +23054,7 @@ var y = class {
|
|
|
23054
23054
|
fences(e) {
|
|
23055
23055
|
let t = this.rules.block.fences.exec(e);
|
|
23056
23056
|
if (t) {
|
|
23057
|
-
let n = t[0], r =
|
|
23057
|
+
let n = t[0], r = Ve(n, t[3] || "", this.rules);
|
|
23058
23058
|
return { type: "code", raw: n, lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2], text: r };
|
|
23059
23059
|
}
|
|
23060
23060
|
}
|
|
@@ -23081,32 +23081,32 @@ var y = class {
|
|
|
23081
23081
|
`).split(`
|
|
23082
23082
|
`), r = "", i = "", s = [];
|
|
23083
23083
|
for (; n.length > 0; ) {
|
|
23084
|
-
let o = false, a = [],
|
|
23085
|
-
for (
|
|
23086
|
-
else if (!o) a.push(n[
|
|
23084
|
+
let o = false, a = [], l;
|
|
23085
|
+
for (l = 0; l < n.length; l++) if (this.rules.other.blockquoteStart.test(n[l])) a.push(n[l]), o = true;
|
|
23086
|
+
else if (!o) a.push(n[l]);
|
|
23087
23087
|
else break;
|
|
23088
|
-
n = n.slice(
|
|
23089
|
-
let
|
|
23090
|
-
`),
|
|
23088
|
+
n = n.slice(l);
|
|
23089
|
+
let c = a.join(`
|
|
23090
|
+
`), p = c.replace(this.rules.other.blockquoteSetextReplace, `
|
|
23091
23091
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
23092
23092
|
r = r ? `${r}
|
|
23093
|
-
${
|
|
23094
|
-
${
|
|
23095
|
-
let
|
|
23096
|
-
if (this.lexer.state.top = true, this.lexer.blockTokens(
|
|
23097
|
-
let
|
|
23098
|
-
if (
|
|
23099
|
-
if (
|
|
23100
|
-
let
|
|
23093
|
+
${c}` : c, i = i ? `${i}
|
|
23094
|
+
${p}` : p;
|
|
23095
|
+
let g = this.lexer.state.top;
|
|
23096
|
+
if (this.lexer.state.top = true, this.lexer.blockTokens(p, s, true), this.lexer.state.top = g, n.length === 0) break;
|
|
23097
|
+
let d = s.at(-1);
|
|
23098
|
+
if (d?.type === "code") break;
|
|
23099
|
+
if (d?.type === "blockquote") {
|
|
23100
|
+
let R = d, f = R.raw + `
|
|
23101
23101
|
` + n.join(`
|
|
23102
|
-
`),
|
|
23103
|
-
s[s.length - 1] =
|
|
23102
|
+
`), O = this.blockquote(f);
|
|
23103
|
+
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;
|
|
23104
23104
|
break;
|
|
23105
|
-
} else if (
|
|
23106
|
-
let
|
|
23105
|
+
} else if (d?.type === "list") {
|
|
23106
|
+
let R = d, f = R.raw + `
|
|
23107
23107
|
` + n.join(`
|
|
23108
|
-
`),
|
|
23109
|
-
s[s.length - 1] =
|
|
23108
|
+
`), O = this.list(f);
|
|
23109
|
+
s[s.length - 1] = O, r = r.substring(0, r.length - d.raw.length) + O.raw, i = i.substring(0, i.length - R.raw.length) + O.raw, n = f.substring(s.at(-1).raw.length).split(`
|
|
23110
23110
|
`);
|
|
23111
23111
|
continue;
|
|
23112
23112
|
}
|
|
@@ -23121,43 +23121,43 @@ ${c}` : c;
|
|
|
23121
23121
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
23122
23122
|
let s = this.rules.other.listItemRegex(n), o = false;
|
|
23123
23123
|
for (; e; ) {
|
|
23124
|
-
let
|
|
23124
|
+
let l = false, c = "", p = "";
|
|
23125
23125
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
23126
|
-
|
|
23127
|
-
let
|
|
23128
|
-
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)),
|
|
23129
|
-
`, 1)[0],
|
|
23130
|
-
if (this.options.pedantic ? (
|
|
23131
|
-
`, e = e.substring(
|
|
23132
|
-
let H = this.rules.other.nextBulletRegex(
|
|
23126
|
+
c = t[0], e = e.substring(c.length);
|
|
23127
|
+
let g = t[2].split(`
|
|
23128
|
+
`, 1)[0].replace(this.rules.other.listReplaceTabs, (H) => " ".repeat(3 * H.length)), d = e.split(`
|
|
23129
|
+
`, 1)[0], R = !g.trim(), f = 0;
|
|
23130
|
+
if (this.options.pedantic ? (f = 2, p = g.trimStart()) : R ? f = t[1].length + 1 : (f = t[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, p = g.slice(f), f += t[1].length), R && this.rules.other.blankLine.test(d) && (c += d + `
|
|
23131
|
+
`, e = e.substring(d.length + 1), l = true), !l) {
|
|
23132
|
+
let H = this.rules.other.nextBulletRegex(f), ee = this.rules.other.hrRegex(f), te = this.rules.other.fencesBeginRegex(f), ne = this.rules.other.headingBeginRegex(f), xe = this.rules.other.htmlBeginRegex(f);
|
|
23133
23133
|
for (; e; ) {
|
|
23134
23134
|
let Z = e.split(`
|
|
23135
23135
|
`, 1)[0], A;
|
|
23136
|
-
if (
|
|
23137
|
-
if (A.search(this.rules.other.nonSpaceChar) >=
|
|
23138
|
-
` + A.slice(
|
|
23136
|
+
if (d = Z, this.options.pedantic ? (d = d.replace(this.rules.other.listReplaceNesting, " "), A = d) : A = d.replace(this.rules.other.tabCharGlobal, " "), te.test(d) || ne.test(d) || xe.test(d) || H.test(d) || ee.test(d)) break;
|
|
23137
|
+
if (A.search(this.rules.other.nonSpaceChar) >= f || !d.trim()) p += `
|
|
23138
|
+
` + A.slice(f);
|
|
23139
23139
|
else {
|
|
23140
|
-
if (
|
|
23141
|
-
|
|
23142
|
-
` +
|
|
23140
|
+
if (R || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || te.test(g) || ne.test(g) || ee.test(g)) break;
|
|
23141
|
+
p += `
|
|
23142
|
+
` + d;
|
|
23143
23143
|
}
|
|
23144
|
-
!
|
|
23145
|
-
`, e = e.substring(Z.length + 1),
|
|
23144
|
+
!R && !d.trim() && (R = true), c += Z + `
|
|
23145
|
+
`, e = e.substring(Z.length + 1), g = A.slice(f);
|
|
23146
23146
|
}
|
|
23147
23147
|
}
|
|
23148
|
-
i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(
|
|
23149
|
-
let
|
|
23150
|
-
this.options.gfm && (
|
|
23148
|
+
i.loose || (o ? i.loose = true : this.rules.other.doubleBlankLine.test(c) && (o = true));
|
|
23149
|
+
let O = null, Y;
|
|
23150
|
+
this.options.gfm && (O = this.rules.other.listIsTask.exec(p), O && (Y = O[0] !== "[ ] ", p = p.replace(this.rules.other.listReplaceTask, ""))), i.items.push({ type: "list_item", raw: c, task: !!O, checked: Y, loose: false, text: p, tokens: [] }), i.raw += c;
|
|
23151
23151
|
}
|
|
23152
23152
|
let a = i.items.at(-1);
|
|
23153
23153
|
if (a) a.raw = a.raw.trimEnd(), a.text = a.text.trimEnd();
|
|
23154
23154
|
else return;
|
|
23155
23155
|
i.raw = i.raw.trimEnd();
|
|
23156
|
-
for (let
|
|
23157
|
-
let
|
|
23158
|
-
i.loose =
|
|
23156
|
+
for (let l = 0; l < i.items.length; l++) if (this.lexer.state.top = false, i.items[l].tokens = this.lexer.blockTokens(i.items[l].text, []), !i.loose) {
|
|
23157
|
+
let c = i.items[l].tokens.filter((g) => g.type === "space"), p = c.length > 0 && c.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
23158
|
+
i.loose = p;
|
|
23159
23159
|
}
|
|
23160
|
-
if (i.loose) for (let
|
|
23160
|
+
if (i.loose) for (let l = 0; l < i.items.length; l++) i.items[l].loose = true;
|
|
23161
23161
|
return i;
|
|
23162
23162
|
}
|
|
23163
23163
|
}
|
|
@@ -23180,7 +23180,7 @@ ${c}` : c;
|
|
|
23180
23180
|
if (n.length === r.length) {
|
|
23181
23181
|
for (let o of r) this.rules.other.tableAlignRight.test(o) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? s.align.push("left") : s.align.push(null);
|
|
23182
23182
|
for (let o = 0; o < n.length; o++) s.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: true, align: s.align[o] });
|
|
23183
|
-
for (let o of i) s.rows.push(V(o, s.header.length).map((a,
|
|
23183
|
+
for (let o of i) s.rows.push(V(o, s.header.length).map((a, l) => ({ text: a, tokens: this.lexer.inline(a), header: false, align: s.align[l] })));
|
|
23184
23184
|
return s;
|
|
23185
23185
|
}
|
|
23186
23186
|
}
|
|
@@ -23217,7 +23217,7 @@ ${c}` : c;
|
|
|
23217
23217
|
let s = z(n.slice(0, -1), "\\");
|
|
23218
23218
|
if ((n.length - s.length) % 2 === 0) return;
|
|
23219
23219
|
} else {
|
|
23220
|
-
let s =
|
|
23220
|
+
let s = fe(t[2], "()");
|
|
23221
23221
|
if (s === -2) return;
|
|
23222
23222
|
if (s > -1) {
|
|
23223
23223
|
let a = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
@@ -23229,7 +23229,7 @@ ${c}` : c;
|
|
|
23229
23229
|
let s = this.rules.other.pedanticHrefTitle.exec(r);
|
|
23230
23230
|
s && (r = s[1], i = s[3]);
|
|
23231
23231
|
} else i = t[3] ? t[3].slice(1, -1) : "";
|
|
23232
|
-
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)),
|
|
23232
|
+
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)), me(t, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, t[0], this.lexer, this.rules);
|
|
23233
23233
|
}
|
|
23234
23234
|
}
|
|
23235
23235
|
reflink(e, t) {
|
|
@@ -23240,32 +23240,32 @@ ${c}` : c;
|
|
|
23240
23240
|
let s = n[0].charAt(0);
|
|
23241
23241
|
return { type: "text", raw: s, text: s };
|
|
23242
23242
|
}
|
|
23243
|
-
return
|
|
23243
|
+
return me(n, i, n[0], this.lexer, this.rules);
|
|
23244
23244
|
}
|
|
23245
23245
|
}
|
|
23246
23246
|
emStrong(e, t, n = "") {
|
|
23247
23247
|
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
23248
23248
|
if (!r || r[3] && n.match(this.rules.other.unicodeAlphaNumeric)) return;
|
|
23249
23249
|
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
23250
|
-
let s = [...r[0]].length - 1, o, a,
|
|
23251
|
-
for (
|
|
23250
|
+
let s = [...r[0]].length - 1, o, a, l = s, c = 0, p = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
23251
|
+
for (p.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = p.exec(t)) != null; ) {
|
|
23252
23252
|
if (o = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !o) continue;
|
|
23253
23253
|
if (a = [...o].length, r[3] || r[4]) {
|
|
23254
|
-
|
|
23254
|
+
l += a;
|
|
23255
23255
|
continue;
|
|
23256
23256
|
} else if ((r[5] || r[6]) && s % 3 && !((s + a) % 3)) {
|
|
23257
|
-
|
|
23257
|
+
c += a;
|
|
23258
23258
|
continue;
|
|
23259
23259
|
}
|
|
23260
|
-
if (
|
|
23261
|
-
a = Math.min(a, a +
|
|
23262
|
-
let
|
|
23260
|
+
if (l -= a, l > 0) continue;
|
|
23261
|
+
a = Math.min(a, a + l + c);
|
|
23262
|
+
let g = [...r[0]][0].length, d = e.slice(0, s + r.index + g + a);
|
|
23263
23263
|
if (Math.min(s, a) % 2) {
|
|
23264
|
-
let
|
|
23265
|
-
return { type: "em", raw:
|
|
23264
|
+
let f = d.slice(1, -1);
|
|
23265
|
+
return { type: "em", raw: d, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
23266
23266
|
}
|
|
23267
|
-
let
|
|
23268
|
-
return { type: "strong", raw:
|
|
23267
|
+
let R = d.slice(2, -2);
|
|
23268
|
+
return { type: "strong", raw: d, text: R, tokens: this.lexer.inlineTokens(R) };
|
|
23269
23269
|
}
|
|
23270
23270
|
}
|
|
23271
23271
|
}
|
|
@@ -23314,25 +23314,25 @@ ${c}` : c;
|
|
|
23314
23314
|
}
|
|
23315
23315
|
}
|
|
23316
23316
|
};
|
|
23317
|
-
var
|
|
23317
|
+
var x = class u {
|
|
23318
23318
|
constructor(e) {
|
|
23319
23319
|
__publicField(this, "tokens");
|
|
23320
23320
|
__publicField(this, "options");
|
|
23321
23321
|
__publicField(this, "state");
|
|
23322
23322
|
__publicField(this, "tokenizer");
|
|
23323
23323
|
__publicField(this, "inlineQueue");
|
|
23324
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e ||
|
|
23325
|
-
let t = { other: m, block:
|
|
23326
|
-
this.options.pedantic ? (t.block =
|
|
23324
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ 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 };
|
|
23325
|
+
let t = { other: m, block: C.normal, inline: M.normal };
|
|
23326
|
+
this.options.pedantic ? (t.block = C.pedantic, t.inline = M.pedantic) : this.options.gfm && (t.block = C.gfm, this.options.breaks ? t.inline = M.breaks : t.inline = M.gfm), this.tokenizer.rules = t;
|
|
23327
23327
|
}
|
|
23328
23328
|
static get rules() {
|
|
23329
|
-
return { block:
|
|
23329
|
+
return { block: C, inline: M };
|
|
23330
23330
|
}
|
|
23331
23331
|
static lex(e, t) {
|
|
23332
|
-
return new
|
|
23332
|
+
return new u(t).lex(e);
|
|
23333
23333
|
}
|
|
23334
23334
|
static lexInline(e, t) {
|
|
23335
|
-
return new
|
|
23335
|
+
return new u(t).inlineTokens(e);
|
|
23336
23336
|
}
|
|
23337
23337
|
lex(e) {
|
|
23338
23338
|
e = e.replace(m.carriageReturn, `
|
|
@@ -23407,8 +23407,8 @@ var b = class l {
|
|
|
23407
23407
|
let i = e;
|
|
23408
23408
|
if (this.options.extensions?.startBlock) {
|
|
23409
23409
|
let s = 1 / 0, o = e.slice(1), a;
|
|
23410
|
-
this.options.extensions.startBlock.forEach((
|
|
23411
|
-
a =
|
|
23410
|
+
this.options.extensions.startBlock.forEach((l) => {
|
|
23411
|
+
a = l.call({ lexer: this }, o), typeof a == "number" && a >= 0 && (s = Math.min(s, a));
|
|
23412
23412
|
}), s < 1 / 0 && s >= 0 && (i = e.substring(0, s + 1));
|
|
23413
23413
|
}
|
|
23414
23414
|
if (this.state.top && (r = this.tokenizer.paragraph(i))) {
|
|
@@ -23454,7 +23454,7 @@ var b = class l {
|
|
|
23454
23454
|
for (; e; ) {
|
|
23455
23455
|
i || (s = ""), i = false;
|
|
23456
23456
|
let o;
|
|
23457
|
-
if (this.options.extensions?.inline?.some((
|
|
23457
|
+
if (this.options.extensions?.inline?.some((l) => (o = l.call({ lexer: this }, e, t)) ? (e = e.substring(o.raw.length), t.push(o), true) : false)) continue;
|
|
23458
23458
|
if (o = this.tokenizer.escape(e)) {
|
|
23459
23459
|
e = e.substring(o.raw.length), t.push(o);
|
|
23460
23460
|
continue;
|
|
@@ -23469,8 +23469,8 @@ var b = class l {
|
|
|
23469
23469
|
}
|
|
23470
23470
|
if (o = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
23471
23471
|
e = e.substring(o.raw.length);
|
|
23472
|
-
let
|
|
23473
|
-
o.type === "text" &&
|
|
23472
|
+
let l = t.at(-1);
|
|
23473
|
+
o.type === "text" && l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
|
|
23474
23474
|
continue;
|
|
23475
23475
|
}
|
|
23476
23476
|
if (o = this.tokenizer.emStrong(e, n, s)) {
|
|
@@ -23499,23 +23499,23 @@ var b = class l {
|
|
|
23499
23499
|
}
|
|
23500
23500
|
let a = e;
|
|
23501
23501
|
if (this.options.extensions?.startInline) {
|
|
23502
|
-
let
|
|
23503
|
-
this.options.extensions.startInline.forEach((
|
|
23504
|
-
|
|
23505
|
-
}),
|
|
23502
|
+
let l = 1 / 0, c = e.slice(1), p;
|
|
23503
|
+
this.options.extensions.startInline.forEach((g) => {
|
|
23504
|
+
p = g.call({ lexer: this }, c), typeof p == "number" && p >= 0 && (l = Math.min(l, p));
|
|
23505
|
+
}), l < 1 / 0 && l >= 0 && (a = e.substring(0, l + 1));
|
|
23506
23506
|
}
|
|
23507
23507
|
if (o = this.tokenizer.inlineText(a)) {
|
|
23508
23508
|
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (s = o.raw.slice(-1)), i = true;
|
|
23509
|
-
let
|
|
23510
|
-
|
|
23509
|
+
let l = t.at(-1);
|
|
23510
|
+
l?.type === "text" ? (l.raw += o.raw, l.text += o.text) : t.push(o);
|
|
23511
23511
|
continue;
|
|
23512
23512
|
}
|
|
23513
23513
|
if (e) {
|
|
23514
|
-
let
|
|
23514
|
+
let l = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
23515
23515
|
if (this.options.silent) {
|
|
23516
|
-
console.error(
|
|
23516
|
+
console.error(l);
|
|
23517
23517
|
break;
|
|
23518
|
-
} else throw new Error(
|
|
23518
|
+
} else throw new Error(l);
|
|
23519
23519
|
}
|
|
23520
23520
|
}
|
|
23521
23521
|
return t;
|
|
@@ -23525,7 +23525,7 @@ var P = class {
|
|
|
23525
23525
|
constructor(e) {
|
|
23526
23526
|
__publicField(this, "options");
|
|
23527
23527
|
__publicField(this, "parser");
|
|
23528
|
-
this.options = e ||
|
|
23528
|
+
this.options = e || T;
|
|
23529
23529
|
}
|
|
23530
23530
|
space(e) {
|
|
23531
23531
|
return "";
|
|
@@ -23673,18 +23673,18 @@ var $ = class {
|
|
|
23673
23673
|
return "";
|
|
23674
23674
|
}
|
|
23675
23675
|
};
|
|
23676
|
-
var
|
|
23676
|
+
var b = class u2 {
|
|
23677
23677
|
constructor(e) {
|
|
23678
23678
|
__publicField(this, "options");
|
|
23679
23679
|
__publicField(this, "renderer");
|
|
23680
23680
|
__publicField(this, "textRenderer");
|
|
23681
|
-
this.options = e ||
|
|
23681
|
+
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 $();
|
|
23682
23682
|
}
|
|
23683
23683
|
static parse(e, t) {
|
|
23684
|
-
return new
|
|
23684
|
+
return new u2(t).parse(e);
|
|
23685
23685
|
}
|
|
23686
23686
|
static parseInline(e, t) {
|
|
23687
|
-
return new
|
|
23687
|
+
return new u2(t).parseInline(e);
|
|
23688
23688
|
}
|
|
23689
23689
|
parse(e, t = true) {
|
|
23690
23690
|
let n = "";
|
|
@@ -23822,7 +23822,7 @@ var S = (_a = class {
|
|
|
23822
23822
|
constructor(e) {
|
|
23823
23823
|
__publicField(this, "options");
|
|
23824
23824
|
__publicField(this, "block");
|
|
23825
|
-
this.options = e ||
|
|
23825
|
+
this.options = e || T;
|
|
23826
23826
|
}
|
|
23827
23827
|
preprocess(e) {
|
|
23828
23828
|
return e;
|
|
@@ -23837,10 +23837,10 @@ var S = (_a = class {
|
|
|
23837
23837
|
return e;
|
|
23838
23838
|
}
|
|
23839
23839
|
provideLexer() {
|
|
23840
|
-
return this.block ?
|
|
23840
|
+
return this.block ? x.lex : x.lexInline;
|
|
23841
23841
|
}
|
|
23842
23842
|
provideParser() {
|
|
23843
|
-
return this.block ?
|
|
23843
|
+
return this.block ? b.parse : b.parseInline;
|
|
23844
23844
|
}
|
|
23845
23845
|
}, __publicField(_a, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), __publicField(_a, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), _a);
|
|
23846
23846
|
var B = class {
|
|
@@ -23849,10 +23849,10 @@ var B = class {
|
|
|
23849
23849
|
__publicField(this, "options", this.setOptions);
|
|
23850
23850
|
__publicField(this, "parse", this.parseMarkdown(true));
|
|
23851
23851
|
__publicField(this, "parseInline", this.parseMarkdown(false));
|
|
23852
|
-
__publicField(this, "Parser",
|
|
23852
|
+
__publicField(this, "Parser", b);
|
|
23853
23853
|
__publicField(this, "Renderer", P);
|
|
23854
23854
|
__publicField(this, "TextRenderer", $);
|
|
23855
|
-
__publicField(this, "Lexer",
|
|
23855
|
+
__publicField(this, "Lexer", x);
|
|
23856
23856
|
__publicField(this, "Tokenizer", y);
|
|
23857
23857
|
__publicField(this, "Hooks", S);
|
|
23858
23858
|
this.use(...e);
|
|
@@ -23905,10 +23905,10 @@ var B = class {
|
|
|
23905
23905
|
for (let s in n.renderer) {
|
|
23906
23906
|
if (!(s in i)) throw new Error(`renderer '${s}' does not exist`);
|
|
23907
23907
|
if (["options", "parser"].includes(s)) continue;
|
|
23908
|
-
let o = s, a = n.renderer[o],
|
|
23909
|
-
i[o] = (...
|
|
23910
|
-
let
|
|
23911
|
-
return
|
|
23908
|
+
let o = s, a = n.renderer[o], l = i[o];
|
|
23909
|
+
i[o] = (...c) => {
|
|
23910
|
+
let p = a.apply(i, c);
|
|
23911
|
+
return p === false && (p = l.apply(i, c)), p || "";
|
|
23912
23912
|
};
|
|
23913
23913
|
}
|
|
23914
23914
|
r.renderer = i;
|
|
@@ -23918,10 +23918,10 @@ var B = class {
|
|
|
23918
23918
|
for (let s in n.tokenizer) {
|
|
23919
23919
|
if (!(s in i)) throw new Error(`tokenizer '${s}' does not exist`);
|
|
23920
23920
|
if (["options", "rules", "lexer"].includes(s)) continue;
|
|
23921
|
-
let o = s, a = n.tokenizer[o],
|
|
23922
|
-
i[o] = (...
|
|
23923
|
-
let
|
|
23924
|
-
return
|
|
23921
|
+
let o = s, a = n.tokenizer[o], l = i[o];
|
|
23922
|
+
i[o] = (...c) => {
|
|
23923
|
+
let p = a.apply(i, c);
|
|
23924
|
+
return p === false && (p = l.apply(i, c)), p;
|
|
23925
23925
|
};
|
|
23926
23926
|
}
|
|
23927
23927
|
r.tokenizer = i;
|
|
@@ -23931,14 +23931,21 @@ var B = class {
|
|
|
23931
23931
|
for (let s in n.hooks) {
|
|
23932
23932
|
if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
|
|
23933
23933
|
if (["options", "block"].includes(s)) continue;
|
|
23934
|
-
let o = s, a = n.hooks[o],
|
|
23935
|
-
S.passThroughHooks.has(s) ? i[o] = (
|
|
23936
|
-
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return
|
|
23937
|
-
|
|
23938
|
-
|
|
23939
|
-
|
|
23940
|
-
let
|
|
23941
|
-
return
|
|
23934
|
+
let o = s, a = n.hooks[o], l = i[o];
|
|
23935
|
+
S.passThroughHooks.has(s) ? i[o] = (c) => {
|
|
23936
|
+
if (this.defaults.async && S.passThroughHooksRespectAsync.has(s)) return (async () => {
|
|
23937
|
+
let g = await a.call(i, c);
|
|
23938
|
+
return l.call(i, g);
|
|
23939
|
+
})();
|
|
23940
|
+
let p = a.call(i, c);
|
|
23941
|
+
return l.call(i, p);
|
|
23942
|
+
} : i[o] = (...c) => {
|
|
23943
|
+
if (this.defaults.async) return (async () => {
|
|
23944
|
+
let g = await a.apply(i, c);
|
|
23945
|
+
return g === false && (g = await l.apply(i, c)), g;
|
|
23946
|
+
})();
|
|
23947
|
+
let p = a.apply(i, c);
|
|
23948
|
+
return p === false && (p = l.apply(i, c)), p;
|
|
23942
23949
|
};
|
|
23943
23950
|
}
|
|
23944
23951
|
r.hooks = i;
|
|
@@ -23957,10 +23964,10 @@ var B = class {
|
|
|
23957
23964
|
return this.defaults = { ...this.defaults, ...e }, this;
|
|
23958
23965
|
}
|
|
23959
23966
|
lexer(e, t) {
|
|
23960
|
-
return
|
|
23967
|
+
return x.lex(e, t ?? this.defaults);
|
|
23961
23968
|
}
|
|
23962
23969
|
parser(e, t) {
|
|
23963
|
-
return
|
|
23970
|
+
return b.parse(e, t ?? this.defaults);
|
|
23964
23971
|
}
|
|
23965
23972
|
parseMarkdown(e) {
|
|
23966
23973
|
return (n, r) => {
|
|
@@ -23968,17 +23975,20 @@ var B = class {
|
|
|
23968
23975
|
if (this.defaults.async === true && i.async === false) return o(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."));
|
|
23969
23976
|
if (typeof n > "u" || n === null) return o(new Error("marked(): input parameter is undefined or null"));
|
|
23970
23977
|
if (typeof n != "string") return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
23971
|
-
s.hooks && (s.hooks.options = s, s.hooks.block = e)
|
|
23972
|
-
|
|
23973
|
-
|
|
23978
|
+
if (s.hooks && (s.hooks.options = s, s.hooks.block = e), s.async) return (async () => {
|
|
23979
|
+
let a = s.hooks ? await s.hooks.preprocess(n) : n, c = await (s.hooks ? await s.hooks.provideLexer() : e ? x.lex : x.lexInline)(a, s), p = s.hooks ? await s.hooks.processAllTokens(c) : c;
|
|
23980
|
+
s.walkTokens && await Promise.all(this.walkTokens(p, s.walkTokens));
|
|
23981
|
+
let d = await (s.hooks ? await s.hooks.provideParser() : e ? b.parse : b.parseInline)(p, s);
|
|
23982
|
+
return s.hooks ? await s.hooks.postprocess(d) : d;
|
|
23983
|
+
})().catch(o);
|
|
23974
23984
|
try {
|
|
23975
23985
|
s.hooks && (n = s.hooks.preprocess(n));
|
|
23976
|
-
let
|
|
23977
|
-
s.hooks && (
|
|
23978
|
-
let
|
|
23979
|
-
return s.hooks && (
|
|
23980
|
-
} catch (
|
|
23981
|
-
return o(
|
|
23986
|
+
let l = (s.hooks ? s.hooks.provideLexer() : e ? x.lex : x.lexInline)(n, s);
|
|
23987
|
+
s.hooks && (l = s.hooks.processAllTokens(l)), s.walkTokens && this.walkTokens(l, s.walkTokens);
|
|
23988
|
+
let p = (s.hooks ? s.hooks.provideParser() : e ? b.parse : b.parseInline)(l, s);
|
|
23989
|
+
return s.hooks && (p = s.hooks.postprocess(p)), p;
|
|
23990
|
+
} catch (a) {
|
|
23991
|
+
return o(a);
|
|
23982
23992
|
}
|
|
23983
23993
|
};
|
|
23984
23994
|
}
|
|
@@ -23995,38 +24005,38 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23995
24005
|
}
|
|
23996
24006
|
};
|
|
23997
24007
|
var _ = new B();
|
|
23998
|
-
function
|
|
23999
|
-
return _.parse(
|
|
24000
|
-
}
|
|
24001
|
-
|
|
24002
|
-
return _.setOptions(
|
|
24003
|
-
};
|
|
24004
|
-
|
|
24005
|
-
|
|
24006
|
-
|
|
24007
|
-
return _.use(...
|
|
24008
|
-
};
|
|
24009
|
-
|
|
24010
|
-
return _.walkTokens(
|
|
24011
|
-
};
|
|
24012
|
-
|
|
24013
|
-
|
|
24014
|
-
|
|
24015
|
-
|
|
24016
|
-
|
|
24017
|
-
|
|
24018
|
-
|
|
24019
|
-
|
|
24020
|
-
|
|
24021
|
-
|
|
24022
|
-
|
|
24023
|
-
|
|
24024
|
-
|
|
24025
|
-
|
|
24026
|
-
|
|
24027
|
-
|
|
24028
|
-
|
|
24029
|
-
|
|
24008
|
+
function k(u3, e) {
|
|
24009
|
+
return _.parse(u3, e);
|
|
24010
|
+
}
|
|
24011
|
+
k.options = k.setOptions = function(u3) {
|
|
24012
|
+
return _.setOptions(u3), k.defaults = _.defaults, G(k.defaults), k;
|
|
24013
|
+
};
|
|
24014
|
+
k.getDefaults = L;
|
|
24015
|
+
k.defaults = T;
|
|
24016
|
+
k.use = function(...u3) {
|
|
24017
|
+
return _.use(...u3), k.defaults = _.defaults, G(k.defaults), k;
|
|
24018
|
+
};
|
|
24019
|
+
k.walkTokens = function(u3, e) {
|
|
24020
|
+
return _.walkTokens(u3, e);
|
|
24021
|
+
};
|
|
24022
|
+
k.parseInline = _.parseInline;
|
|
24023
|
+
k.Parser = b;
|
|
24024
|
+
k.parser = b.parse;
|
|
24025
|
+
k.Renderer = P;
|
|
24026
|
+
k.TextRenderer = $;
|
|
24027
|
+
k.Lexer = x;
|
|
24028
|
+
k.lexer = x.lex;
|
|
24029
|
+
k.Tokenizer = y;
|
|
24030
|
+
k.Hooks = S;
|
|
24031
|
+
k.parse = k;
|
|
24032
|
+
k.options;
|
|
24033
|
+
k.setOptions;
|
|
24034
|
+
k.use;
|
|
24035
|
+
k.walkTokens;
|
|
24036
|
+
k.parseInline;
|
|
24037
|
+
b.parse;
|
|
24038
|
+
x.lex;
|
|
24039
|
+
k.use({
|
|
24030
24040
|
breaks: false,
|
|
24031
24041
|
// Use proper paragraphs, not <br> tags
|
|
24032
24042
|
gfm: true
|
|
@@ -24037,7 +24047,7 @@ function createDocFromMarkdown(markdown, schema, options = {}) {
|
|
|
24037
24047
|
return createDocFromHTML(html, schema, options);
|
|
24038
24048
|
}
|
|
24039
24049
|
function convertMarkdownToHTML(markdown) {
|
|
24040
|
-
let html =
|
|
24050
|
+
let html = k.parse(markdown, { async: false });
|
|
24041
24051
|
return html.replace(/<\/p>\n<ul>/g, "</p>\n<p> </p>\n<ul>").replace(/<\/p>\n<ol>/g, "</p>\n<p> </p>\n<ol>").replace(/<\/ul>\n<h/g, "</ul>\n<p> </p>\n<h").replace(/<\/ol>\n<h/g, "</ol>\n<p> </p>\n<h");
|
|
24042
24052
|
}
|
|
24043
24053
|
function processContent({ content, type: type2, schema }) {
|
|
@@ -24216,7 +24226,7 @@ const getBasicNumIdTag = (numId, abstractId) => {
|
|
|
24216
24226
|
};
|
|
24217
24227
|
const getNewListId = (editor, grouping = "definitions") => {
|
|
24218
24228
|
const defs = editor.converter.numbering[grouping] || {};
|
|
24219
|
-
const intKeys = Object.keys(defs).map((
|
|
24229
|
+
const intKeys = Object.keys(defs).map((k2) => Number(k2)).filter((n) => Number.isInteger(n));
|
|
24220
24230
|
const max2 = intKeys.length ? Math.max(...intKeys) : 0;
|
|
24221
24231
|
return max2 + 1;
|
|
24222
24232
|
};
|
|
@@ -28793,7 +28803,16 @@ const translateImageNode = (params) => {
|
|
|
28793
28803
|
const { width: w2, height: h2 } = resizeKeepAspectRatio(size.w, size.h, maxWidthEmu);
|
|
28794
28804
|
if (w2 && h2) size = { w: w2, h: h2 };
|
|
28795
28805
|
}
|
|
28796
|
-
if (
|
|
28806
|
+
if (imageId) {
|
|
28807
|
+
const docx = params.converter?.convertedXml || {};
|
|
28808
|
+
const rels = docx["word/_rels/document.xml.rels"];
|
|
28809
|
+
const relsTag = rels?.elements?.find((el) => el.name === "Relationships");
|
|
28810
|
+
const hasRelation = relsTag?.elements.find((el) => el.attributes.Id === imageId);
|
|
28811
|
+
const path = src?.split("word/")[1];
|
|
28812
|
+
if (!hasRelation) {
|
|
28813
|
+
addImageRelationshipForId(params, imageId, path);
|
|
28814
|
+
}
|
|
28815
|
+
} else if (params.node.type === "image" && !imageId) {
|
|
28797
28816
|
const path = src?.split("word/")[1];
|
|
28798
28817
|
imageId = addNewImageRelationship(params, path);
|
|
28799
28818
|
} else if (params.node.type === "fieldAnnotation" && !imageId) {
|
|
@@ -29017,6 +29036,18 @@ function addNewImageRelationship(params, imagePath) {
|
|
|
29017
29036
|
params.relationships.push(newRel);
|
|
29018
29037
|
return newId;
|
|
29019
29038
|
}
|
|
29039
|
+
function addImageRelationshipForId(params, id, imagePath) {
|
|
29040
|
+
const newRel = {
|
|
29041
|
+
type: "element",
|
|
29042
|
+
name: "Relationship",
|
|
29043
|
+
attributes: {
|
|
29044
|
+
Id: id,
|
|
29045
|
+
Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
|
|
29046
|
+
Target: imagePath
|
|
29047
|
+
}
|
|
29048
|
+
};
|
|
29049
|
+
params.relationships.push(newRel);
|
|
29050
|
+
}
|
|
29020
29051
|
function translateVectorShape(params) {
|
|
29021
29052
|
const { node } = params;
|
|
29022
29053
|
const { drawingContent } = node.attrs;
|
|
@@ -35306,6 +35337,35 @@ const prepareCommentsXmlFilesForExport = ({ convertedXml, defs, commentsWithPara
|
|
|
35306
35337
|
};
|
|
35307
35338
|
const HYPERLINK_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
35308
35339
|
const HEADER_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
|
|
35340
|
+
const FOOTER_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
|
|
35341
|
+
const REL_ID_NUMERIC_PATTERN = /rId|mi/g;
|
|
35342
|
+
const getLargestRelationshipId = (relationships = []) => {
|
|
35343
|
+
const numericIds = relationships.map((rel) => Number(String(rel?.attributes?.Id ?? "").replace(REL_ID_NUMERIC_PATTERN, ""))).filter((value) => Number.isFinite(value));
|
|
35344
|
+
return numericIds.length ? Math.max(...numericIds) : 0;
|
|
35345
|
+
};
|
|
35346
|
+
const mergeRelationshipElements = (existingRelationships = [], newRelationships = []) => {
|
|
35347
|
+
if (!newRelationships?.length) return existingRelationships;
|
|
35348
|
+
let largestId = getLargestRelationshipId(existingRelationships);
|
|
35349
|
+
const seenIds = new Set(existingRelationships.map((rel) => rel?.attributes?.Id).filter(Boolean));
|
|
35350
|
+
const additions = [];
|
|
35351
|
+
newRelationships.forEach((rel) => {
|
|
35352
|
+
if (!rel?.attributes) return;
|
|
35353
|
+
const attributes = rel.attributes;
|
|
35354
|
+
const currentId = attributes.Id || "";
|
|
35355
|
+
attributes.Target = attributes?.Target?.replace(/&/g, "&");
|
|
35356
|
+
const existingTarget = existingRelationships.find((el) => el.attributes.Target === attributes.Target);
|
|
35357
|
+
const isMedia = attributes.Target?.startsWith("media/");
|
|
35358
|
+
const isNewHyperlink = attributes.Type === HYPERLINK_RELATIONSHIP_TYPE && currentId.length > 6;
|
|
35359
|
+
const isNewHeadFoot = (attributes.Type === HEADER_RELATIONSHIP_TYPE || attributes.Type === FOOTER_RELATIONSHIP_TYPE) && currentId.length > 6;
|
|
35360
|
+
const hasSeenId = currentId && seenIds.has(currentId);
|
|
35361
|
+
const shouldSkip = !isNewHyperlink && !isNewHeadFoot && (hasSeenId || existingTarget);
|
|
35362
|
+
if (shouldSkip) return;
|
|
35363
|
+
attributes.Id = currentId.length > 6 || isMedia ? currentId : `rId${++largestId}`;
|
|
35364
|
+
seenIds.add(attributes.Id);
|
|
35365
|
+
additions.push(rel);
|
|
35366
|
+
});
|
|
35367
|
+
return additions.length ? [...existingRelationships, ...additions] : existingRelationships;
|
|
35368
|
+
};
|
|
35309
35369
|
const FONT_FAMILY_FALLBACKS = Object.freeze({
|
|
35310
35370
|
swiss: "Arial, sans-serif",
|
|
35311
35371
|
roman: "Times New Roman, serif",
|
|
@@ -35514,7 +35574,7 @@ const _SuperConverter = class _SuperConverter {
|
|
|
35514
35574
|
static getStoredSuperdocVersion(docx) {
|
|
35515
35575
|
return _SuperConverter.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
35516
35576
|
}
|
|
35517
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.28.
|
|
35577
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version = "0.28.4") {
|
|
35518
35578
|
return _SuperConverter.setStoredCustomProperty(docx, "SuperdocVersion", version, false);
|
|
35519
35579
|
}
|
|
35520
35580
|
/**
|
|
@@ -35908,7 +35968,7 @@ prepareCommentsXmlFilesForExport_fn = function({ defs, exportType, commentsWithP
|
|
|
35908
35968
|
};
|
|
35909
35969
|
exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
35910
35970
|
const relsData = this.convertedXml["word/_rels/document.xml.rels"];
|
|
35911
|
-
const relationships = relsData.elements.find((
|
|
35971
|
+
const relationships = relsData.elements.find((x2) => x2.name === "Relationships");
|
|
35912
35972
|
const newDocRels = [];
|
|
35913
35973
|
Object.entries(this.headers).forEach(([id, header], index2) => {
|
|
35914
35974
|
const fileName = relationships.elements.find((el) => el.attributes.Id === id)?.attributes.Target || `header${index2 + 1}.xml`;
|
|
@@ -35949,7 +36009,7 @@ exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
|
35949
36009
|
}
|
|
35950
36010
|
this.convertedXml[`word/${fileName}`].elements[0].elements = bodyContent;
|
|
35951
36011
|
if (params.relationships.length) {
|
|
35952
|
-
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((
|
|
36012
|
+
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((x2) => x2.name === "Relationships")?.elements || [];
|
|
35953
36013
|
this.convertedXml[`word/_rels/${fileName}.rels`] = {
|
|
35954
36014
|
declaration: this.initialJSON?.declaration,
|
|
35955
36015
|
elements: [
|
|
@@ -36003,7 +36063,7 @@ exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
|
36003
36063
|
}
|
|
36004
36064
|
this.convertedXml[`word/${fileName}`].elements[0].elements = bodyContent;
|
|
36005
36065
|
if (params.relationships.length) {
|
|
36006
|
-
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((
|
|
36066
|
+
const relationships2 = this.convertedXml[`word/_rels/${fileName}.rels`]?.elements?.find((x2) => x2.name === "Relationships")?.elements || [];
|
|
36007
36067
|
this.convertedXml[`word/_rels/${fileName}.rels`] = {
|
|
36008
36068
|
declaration: this.initialJSON?.declaration,
|
|
36009
36069
|
elements: [
|
|
@@ -36022,24 +36082,8 @@ exportProcessHeadersFooters_fn = function({ isFinalDoc = false }) {
|
|
|
36022
36082
|
};
|
|
36023
36083
|
exportProcessNewRelationships_fn = function(rels = []) {
|
|
36024
36084
|
const relsData = this.convertedXml["word/_rels/document.xml.rels"];
|
|
36025
|
-
const relationships = relsData.elements.find((
|
|
36026
|
-
|
|
36027
|
-
const regex = /rId|mi/g;
|
|
36028
|
-
let largestId = Math.max(...relationships.elements.map((el) => Number(el.attributes.Id.replace(regex, ""))));
|
|
36029
|
-
rels.forEach((rel) => {
|
|
36030
|
-
const existingId = rel.attributes.Id;
|
|
36031
|
-
const existingTarget = relationships.elements.find((el) => el.attributes.Target === rel.attributes.Target);
|
|
36032
|
-
const isNewMedia = rel.attributes.Target?.startsWith("media/") && existingId.length > 6;
|
|
36033
|
-
const isNewHyperlink = rel.attributes.Type === HYPERLINK_RELATIONSHIP_TYPE && existingId.length > 6;
|
|
36034
|
-
const isNewHeadFoot = rel.attributes.Type === HEADER_RELATIONSHIP_TYPE && existingId.length > 6;
|
|
36035
|
-
if (existingTarget && !isNewMedia && !isNewHyperlink && !isNewHeadFoot) {
|
|
36036
|
-
return;
|
|
36037
|
-
}
|
|
36038
|
-
rel.attributes.Target = rel.attributes?.Target?.replace(/&/g, "&");
|
|
36039
|
-
rel.attributes.Id = existingId.length > 6 ? existingId : `rId${++largestId}`;
|
|
36040
|
-
newRels.push(rel);
|
|
36041
|
-
});
|
|
36042
|
-
relationships.elements = [...relationships.elements, ...newRels];
|
|
36085
|
+
const relationships = relsData.elements.find((x2) => x2.name === "Relationships");
|
|
36086
|
+
relationships.elements = mergeRelationshipElements(relationships.elements, rels);
|
|
36043
36087
|
};
|
|
36044
36088
|
exportProcessMediaFiles_fn = async function(media = {}) {
|
|
36045
36089
|
const processedData = {
|