@harbour-enterprises/superdoc 1.0.0-next.9 → 1.0.2
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-C7Wo4VVN.es.js → PdfViewer-C51KNTCu.es.js} +2 -2
- package/dist/chunks/{PdfViewer-QwjK1Tx6.cjs → PdfViewer-Dk7wI3bm.cjs} +2 -2
- package/dist/chunks/{eventemitter3-DQmQUge-.cjs → eventemitter3-DIclNhoR.cjs} +1 -1
- package/dist/chunks/{eventemitter3-44XulWQe.es.js → eventemitter3-D_2kqkfV.es.js} +1 -1
- package/dist/chunks/{index-DI2R4qz8.cjs → index-Cf7hdzkm.cjs} +20 -15
- package/dist/chunks/{index-DNIymDRK-CzsYNHvC.cjs → index-DDZ1ZT8N-DzepXBTN.cjs} +1 -1
- package/dist/chunks/{index-DNIymDRK-BMrUTNeb.es.js → index-DDZ1ZT8N-MJzqg0qg.es.js} +1 -1
- package/dist/chunks/{index-CfSkb15j.es.js → index-rtbawgUA.es.js} +20 -15
- package/dist/chunks/{jszip-VP334ufO.es.js → jszip-B690S4j-.es.js} +1 -1
- package/dist/chunks/{jszip-BdEez1WM.cjs → jszip-qHp7FC78.cjs} +1 -1
- package/dist/chunks/{super-editor.es-BI8ByUNm.cjs → super-editor.es-BijxiFs9.cjs} +1671 -353
- package/dist/chunks/{super-editor.es-B42HV1fg.es.js → super-editor.es-DFXddrgb.es.js} +1671 -353
- package/dist/chunks/{vue-BuPTonTJ.es.js → vue-CLFbn_1r.es.js} +209 -185
- package/dist/chunks/{vue-jWLMl8Ts.cjs → vue-gvuFr0vx.cjs} +209 -185
- package/dist/chunks/xml-js-BXUvL-Mz.es.js +2 -0
- package/dist/chunks/xml-js-CCH4ckfW.cjs +3 -0
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-a3CAItrf.js → converter-VYPiNbpo.js} +1 -1
- package/dist/super-editor/chunks/{docx-zipper-BsmzO0LG.js → docx-zipper-D8Tzq3RX.js} +1 -1
- package/dist/super-editor/chunks/{editor-qn0f9LDg.js → editor-mgoEnsBi.js} +1635 -288
- package/dist/super-editor/chunks/{index-DNIymDRK.js → index-DDZ1ZT8N.js} +1 -1
- package/dist/super-editor/chunks/{toolbar-DW8hTxsF.js → toolbar-DULgxvjl.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.es.js +6 -6
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +2 -2
- package/dist/super-editor.es.js +2 -2
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +1913 -572
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/xml-js-Dz51sEbr.cjs +0 -3
- package/dist/chunks/xml-js-LkEmUa9-.es.js +0 -2
package/dist/superdoc.umd.js
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
var __accessCheck$2 = (obj, member, msg2) => member.has(obj) || __typeError$2("Cannot " + msg2);
|
|
29
29
|
var __privateAdd$2 = (obj, member, value) => member.has(obj) ? __typeError$2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
30
30
|
var __privateMethod$2 = (obj, member, method) => (__accessCheck$2(obj, member, "access private method"), method);
|
|
31
|
-
var _a, _b, _DocxExporter_instances, generate_xml_as_list_fn, replaceSpecialCharacters_fn, generateXml_fn, _SuperConverter_instances, generateDocumentHash_fn, exportNumberingFile_fn, prepareCommentsXmlFilesForExport_fn, exportProcessHeadersFooters_fn, exportProcessNewRelationships_fn, exportProcessMediaFiles_fn;
|
|
31
|
+
var _a$1, _b, _DocxExporter_instances, generate_xml_as_list_fn, replaceSpecialCharacters_fn, generateXml_fn, _SuperConverter_instances, generateDocumentHash_fn, exportNumberingFile_fn, prepareCommentsXmlFilesForExport_fn, exportProcessHeadersFooters_fn, exportProcessNewRelationships_fn, exportProcessMediaFiles_fn;
|
|
32
32
|
var buffer = {};
|
|
33
33
|
var base64Js = {};
|
|
34
34
|
base64Js.byteLength = byteLength;
|
|
@@ -640,7 +640,7 @@
|
|
|
640
640
|
return slowToString.apply(this, arguments);
|
|
641
641
|
};
|
|
642
642
|
Buffer3.prototype.toLocaleString = Buffer3.prototype.toString;
|
|
643
|
-
Buffer3.prototype.equals = function
|
|
643
|
+
Buffer3.prototype.equals = function equals2(b2) {
|
|
644
644
|
if (!Buffer3.isBuffer(b2)) throw new TypeError("Argument must be a Buffer");
|
|
645
645
|
if (this === b2) return true;
|
|
646
646
|
return Buffer3.compare(this, b2) === 0;
|
|
@@ -2989,7 +2989,7 @@
|
|
|
2989
2989
|
return slowToString.apply(this, arguments);
|
|
2990
2990
|
};
|
|
2991
2991
|
Buffer4.prototype.toLocaleString = Buffer4.prototype.toString;
|
|
2992
|
-
Buffer4.prototype.equals = function
|
|
2992
|
+
Buffer4.prototype.equals = function equals2(b2) {
|
|
2993
2993
|
if (!Buffer4.isBuffer(b2)) throw new TypeError("Argument must be a Buffer");
|
|
2994
2994
|
if (this === b2) return true;
|
|
2995
2995
|
return Buffer4.compare(this, b2) === 0;
|
|
@@ -4446,8 +4446,8 @@
|
|
|
4446
4446
|
function requireObject_getPrototypeOf() {
|
|
4447
4447
|
if (hasRequiredObject_getPrototypeOf) return Object_getPrototypeOf;
|
|
4448
4448
|
hasRequiredObject_getPrototypeOf = 1;
|
|
4449
|
-
var $
|
|
4450
|
-
Object_getPrototypeOf = $
|
|
4449
|
+
var $Object2 = /* @__PURE__ */ requireEsObjectAtoms();
|
|
4450
|
+
Object_getPrototypeOf = $Object2.getPrototypeOf || null;
|
|
4451
4451
|
return Object_getPrototypeOf;
|
|
4452
4452
|
}
|
|
4453
4453
|
var implementation;
|
|
@@ -4609,12 +4609,12 @@
|
|
|
4609
4609
|
/** @type {keyof typeof Object.prototype} */
|
|
4610
4610
|
"__proto__"
|
|
4611
4611
|
);
|
|
4612
|
-
var $
|
|
4613
|
-
var $getPrototypeOf = $
|
|
4612
|
+
var $Object2 = Object;
|
|
4613
|
+
var $getPrototypeOf = $Object2.getPrototypeOf;
|
|
4614
4614
|
get$2 = desc && typeof desc.get === "function" ? callBind2([desc.get]) : typeof $getPrototypeOf === "function" ? (
|
|
4615
4615
|
/** @type {import('./get')} */
|
|
4616
4616
|
(function getDunder(value) {
|
|
4617
|
-
return $getPrototypeOf(value == null ? value : $
|
|
4617
|
+
return $getPrototypeOf(value == null ? value : $Object2(value));
|
|
4618
4618
|
})
|
|
4619
4619
|
) : false;
|
|
4620
4620
|
return get$2;
|
|
@@ -4656,7 +4656,7 @@
|
|
|
4656
4656
|
if (hasRequiredGetIntrinsic) return getIntrinsic;
|
|
4657
4657
|
hasRequiredGetIntrinsic = 1;
|
|
4658
4658
|
var undefined$1;
|
|
4659
|
-
var $
|
|
4659
|
+
var $Object2 = /* @__PURE__ */ requireEsObjectAtoms();
|
|
4660
4660
|
var $Error = /* @__PURE__ */ requireEsErrors();
|
|
4661
4661
|
var $EvalError = /* @__PURE__ */ require_eval();
|
|
4662
4662
|
var $RangeError = /* @__PURE__ */ requireRange();
|
|
@@ -4746,7 +4746,7 @@
|
|
|
4746
4746
|
"%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols2 || !getProto2 ? undefined$1 : getProto2((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
4747
4747
|
"%Math%": Math,
|
|
4748
4748
|
"%Number%": Number,
|
|
4749
|
-
"%Object%": $
|
|
4749
|
+
"%Object%": $Object2,
|
|
4750
4750
|
"%Object.getOwnPropertyDescriptor%": $gOPD,
|
|
4751
4751
|
"%parseFloat%": parseFloat,
|
|
4752
4752
|
"%parseInt%": parseInt,
|
|
@@ -4889,8 +4889,8 @@
|
|
|
4889
4889
|
throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
|
|
4890
4890
|
}
|
|
4891
4891
|
var result = [];
|
|
4892
|
-
$replace(string, rePropName2, function(
|
|
4893
|
-
result[result.length] = quote ? $replace(subString, reEscapeChar2, "$1") : number2 ||
|
|
4892
|
+
$replace(string, rePropName2, function(match2, number2, quote, subString) {
|
|
4893
|
+
result[result.length] = quote ? $replace(subString, reEscapeChar2, "$1") : number2 || match2;
|
|
4894
4894
|
});
|
|
4895
4895
|
return result;
|
|
4896
4896
|
};
|
|
@@ -10794,9 +10794,9 @@
|
|
|
10794
10794
|
var attributes = {};
|
|
10795
10795
|
if (instruction.body && (instruction.name.toLowerCase() === "xml" || options.instructionHasAttributes)) {
|
|
10796
10796
|
var attrsRegExp = /([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;
|
|
10797
|
-
var
|
|
10798
|
-
while ((
|
|
10799
|
-
attributes[
|
|
10797
|
+
var match2;
|
|
10798
|
+
while ((match2 = attrsRegExp.exec(instruction.body)) !== null) {
|
|
10799
|
+
attributes[match2[1]] = match2[2] || match2[3] || match2[4];
|
|
10800
10800
|
}
|
|
10801
10801
|
attributes = manipulateAttributes(attributes);
|
|
10802
10802
|
}
|
|
@@ -11781,8 +11781,8 @@
|
|
|
11781
11781
|
function parseSizeUnit(val = "0") {
|
|
11782
11782
|
const length2 = val.toString() || "0";
|
|
11783
11783
|
const value = Number.parseFloat(length2);
|
|
11784
|
-
const
|
|
11785
|
-
const unit = (
|
|
11784
|
+
const match2 = length2.match(CSS_DIMENSION_REGEX);
|
|
11785
|
+
const unit = (match2?.[1] ?? "").toLowerCase();
|
|
11786
11786
|
return [value, DOM_SIZE_UNITS.includes(unit) ? unit : null];
|
|
11787
11787
|
}
|
|
11788
11788
|
function minMax(value = 0, min2 = 0, max2 = 0) {
|
|
@@ -13235,10 +13235,10 @@
|
|
|
13235
13235
|
Get the content match in this node at the given index.
|
|
13236
13236
|
*/
|
|
13237
13237
|
contentMatchAt(index2) {
|
|
13238
|
-
let
|
|
13239
|
-
if (!
|
|
13238
|
+
let match2 = this.type.contentMatch.matchFragment(this.content, 0, index2);
|
|
13239
|
+
if (!match2)
|
|
13240
13240
|
throw new Error("Called contentMatchAt on a node with invalid content");
|
|
13241
|
-
return
|
|
13241
|
+
return match2;
|
|
13242
13242
|
}
|
|
13243
13243
|
/**
|
|
13244
13244
|
Test whether replacing the range between `from` and `to` (by
|
|
@@ -13406,9 +13406,9 @@
|
|
|
13406
13406
|
let expr = parseExpr(stream);
|
|
13407
13407
|
if (stream.next)
|
|
13408
13408
|
stream.err("Unexpected trailing text");
|
|
13409
|
-
let
|
|
13410
|
-
checkForDeadEnds(
|
|
13411
|
-
return
|
|
13409
|
+
let match2 = dfa(nfa(expr));
|
|
13410
|
+
checkForDeadEnds(match2, stream);
|
|
13411
|
+
return match2;
|
|
13412
13412
|
}
|
|
13413
13413
|
/**
|
|
13414
13414
|
Match a node type, returning a match after that node if
|
|
@@ -13468,12 +13468,12 @@
|
|
|
13468
13468
|
*/
|
|
13469
13469
|
fillBefore(after, toEnd = false, startIndex = 0) {
|
|
13470
13470
|
let seen = [this];
|
|
13471
|
-
function search2(
|
|
13472
|
-
let finished =
|
|
13471
|
+
function search2(match2, types2) {
|
|
13472
|
+
let finished = match2.matchFragment(after, startIndex);
|
|
13473
13473
|
if (finished && (!toEnd || finished.validEnd))
|
|
13474
13474
|
return Fragment$1.from(types2.map((tp) => tp.createAndFill()));
|
|
13475
|
-
for (let i2 = 0; i2 <
|
|
13476
|
-
let { type: type2, next: next2 } =
|
|
13475
|
+
for (let i2 = 0; i2 < match2.next.length; i2++) {
|
|
13476
|
+
let { type: type2, next: next2 } = match2.next[i2];
|
|
13477
13477
|
if (!(type2.isText || type2.hasRequiredAttrs()) && seen.indexOf(next2) == -1) {
|
|
13478
13478
|
seen.push(next2);
|
|
13479
13479
|
let found2 = search2(next2, types2.concat(type2));
|
|
@@ -13505,15 +13505,15 @@
|
|
|
13505
13505
|
computeWrapping(target) {
|
|
13506
13506
|
let seen = /* @__PURE__ */ Object.create(null), active = [{ match: this, type: null, via: null }];
|
|
13507
13507
|
while (active.length) {
|
|
13508
|
-
let current = active.shift(),
|
|
13509
|
-
if (
|
|
13508
|
+
let current = active.shift(), match2 = current.match;
|
|
13509
|
+
if (match2.matchType(target)) {
|
|
13510
13510
|
let result = [];
|
|
13511
13511
|
for (let obj = current; obj.type; obj = obj.via)
|
|
13512
13512
|
result.push(obj.type);
|
|
13513
13513
|
return result.reverse();
|
|
13514
13514
|
}
|
|
13515
|
-
for (let i2 = 0; i2 <
|
|
13516
|
-
let { type: type2, next: next2 } =
|
|
13515
|
+
for (let i2 = 0; i2 < match2.next.length; i2++) {
|
|
13516
|
+
let { type: type2, next: next2 } = match2.next[i2];
|
|
13517
13517
|
if (!type2.isLeaf && !type2.hasRequiredAttrs() && !(type2.name in seen) && (!current.type || next2.validEnd)) {
|
|
13518
13518
|
active.push({ match: type2.contentMatch, type: type2, via: current });
|
|
13519
13519
|
seen[type2.name] = true;
|
|
@@ -13774,8 +13774,8 @@
|
|
|
13774
13774
|
return state2;
|
|
13775
13775
|
}
|
|
13776
13776
|
}
|
|
13777
|
-
function checkForDeadEnds(
|
|
13778
|
-
for (let i2 = 0, work = [
|
|
13777
|
+
function checkForDeadEnds(match2, stream) {
|
|
13778
|
+
for (let i2 = 0, work = [match2]; i2 < work.length; i2++) {
|
|
13779
13779
|
let state2 = work[i2], dead = !state2.validEnd, nodes = [];
|
|
13780
13780
|
for (let j2 = 0; j2 < state2.next.length; j2++) {
|
|
13781
13781
|
let { type: type2, next: next2 } = state2.next[j2];
|
|
@@ -14401,7 +14401,7 @@
|
|
|
14401
14401
|
return type2 && type2.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base2 & ~OPT_OPEN_LEFT;
|
|
14402
14402
|
}
|
|
14403
14403
|
class NodeContext {
|
|
14404
|
-
constructor(type2, attrs, marks, solid,
|
|
14404
|
+
constructor(type2, attrs, marks, solid, match2, options) {
|
|
14405
14405
|
this.type = type2;
|
|
14406
14406
|
this.attrs = attrs;
|
|
14407
14407
|
this.marks = marks;
|
|
@@ -14409,7 +14409,7 @@
|
|
|
14409
14409
|
this.options = options;
|
|
14410
14410
|
this.content = [];
|
|
14411
14411
|
this.activeMarks = Mark$1.none;
|
|
14412
|
-
this.match =
|
|
14412
|
+
this.match = match2 || (options & OPT_OPEN_LEFT ? null : type2.contentMatch);
|
|
14413
14413
|
}
|
|
14414
14414
|
findWrapping(node2) {
|
|
14415
14415
|
if (!this.match) {
|
|
@@ -14808,14 +14808,14 @@
|
|
|
14808
14808
|
let option = this.options.context;
|
|
14809
14809
|
let useRoot = !this.isOpen && (!option || option.parent.type == this.nodes[0].type);
|
|
14810
14810
|
let minDepth = -(option ? option.depth + 1 : 0) + (useRoot ? 0 : 1);
|
|
14811
|
-
let
|
|
14811
|
+
let match2 = (i2, depth) => {
|
|
14812
14812
|
for (; i2 >= 0; i2--) {
|
|
14813
14813
|
let part = parts[i2];
|
|
14814
14814
|
if (part == "") {
|
|
14815
14815
|
if (i2 == parts.length - 1 || i2 == 0)
|
|
14816
14816
|
continue;
|
|
14817
14817
|
for (; depth >= minDepth; depth--)
|
|
14818
|
-
if (
|
|
14818
|
+
if (match2(i2 - 1, depth))
|
|
14819
14819
|
return true;
|
|
14820
14820
|
return false;
|
|
14821
14821
|
} else {
|
|
@@ -14827,7 +14827,7 @@
|
|
|
14827
14827
|
}
|
|
14828
14828
|
return true;
|
|
14829
14829
|
};
|
|
14830
|
-
return
|
|
14830
|
+
return match2(parts.length - 1, this.open);
|
|
14831
14831
|
}
|
|
14832
14832
|
textblockFromContext() {
|
|
14833
14833
|
let $context = this.options.context;
|
|
@@ -14872,10 +14872,10 @@
|
|
|
14872
14872
|
let parent = nodes[name];
|
|
14873
14873
|
if (!parent.allowsMarkType(markType))
|
|
14874
14874
|
continue;
|
|
14875
|
-
let seen = [], scan = (
|
|
14876
|
-
seen.push(
|
|
14877
|
-
for (let i2 = 0; i2 <
|
|
14878
|
-
let { type: type2, next: next2 } =
|
|
14875
|
+
let seen = [], scan = (match2) => {
|
|
14876
|
+
seen.push(match2);
|
|
14877
|
+
for (let i2 = 0; i2 < match2.edgeCount; i2++) {
|
|
14878
|
+
let { type: type2, next: next2 } = match2.edge(i2);
|
|
14879
14879
|
if (type2 == nodeType)
|
|
14880
14880
|
return true;
|
|
14881
14881
|
if (seen.indexOf(next2) < 0 && scan(next2))
|
|
@@ -22948,16 +22948,16 @@
|
|
|
22948
22948
|
});
|
|
22949
22949
|
matched.forEach((m2) => tr.step(new RemoveMarkStep(m2.from, m2.to, m2.style)));
|
|
22950
22950
|
}
|
|
22951
|
-
function clearIncompatible(tr, pos, parentType,
|
|
22951
|
+
function clearIncompatible(tr, pos, parentType, match2 = parentType.contentMatch, clearNewlines = true) {
|
|
22952
22952
|
let node2 = tr.doc.nodeAt(pos);
|
|
22953
22953
|
let replSteps = [], cur = pos + 1;
|
|
22954
22954
|
for (let i2 = 0; i2 < node2.childCount; i2++) {
|
|
22955
22955
|
let child = node2.child(i2), end2 = cur + child.nodeSize;
|
|
22956
|
-
let allowed =
|
|
22956
|
+
let allowed = match2.matchType(child.type);
|
|
22957
22957
|
if (!allowed) {
|
|
22958
22958
|
replSteps.push(new ReplaceStep(cur, end2, Slice.empty));
|
|
22959
22959
|
} else {
|
|
22960
|
-
|
|
22960
|
+
match2 = allowed;
|
|
22961
22961
|
for (let j2 = 0; j2 < child.marks.length; j2++)
|
|
22962
22962
|
if (!parentType.allowsMarkType(child.marks[j2].type))
|
|
22963
22963
|
tr.step(new RemoveMarkStep(cur, end2, child.marks[j2]));
|
|
@@ -22972,8 +22972,8 @@
|
|
|
22972
22972
|
}
|
|
22973
22973
|
cur = end2;
|
|
22974
22974
|
}
|
|
22975
|
-
if (!
|
|
22976
|
-
let fill =
|
|
22975
|
+
if (!match2.validEnd) {
|
|
22976
|
+
let fill = match2.fillBefore(Fragment$1.empty, true);
|
|
22977
22977
|
tr.replace(cur, cur, new Slice(fill, 0, 0));
|
|
22978
22978
|
}
|
|
22979
22979
|
for (let i2 = replSteps.length - 1; i2 >= 0; i2--)
|
|
@@ -23027,8 +23027,8 @@
|
|
|
23027
23027
|
let content2 = Fragment$1.empty;
|
|
23028
23028
|
for (let i2 = wrappers.length - 1; i2 >= 0; i2--) {
|
|
23029
23029
|
if (content2.size) {
|
|
23030
|
-
let
|
|
23031
|
-
if (!
|
|
23030
|
+
let match2 = wrappers[i2].type.contentMatch.matchFragment(content2);
|
|
23031
|
+
if (!match2 || !match2.validEnd)
|
|
23032
23032
|
throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
|
|
23033
23033
|
}
|
|
23034
23034
|
content2 = Fragment$1.from(wrappers[i2].type.create(wrappers[i2].attrs, content2));
|
|
@@ -23136,18 +23136,18 @@
|
|
|
23136
23136
|
function canAppendWithSubstitutedLinebreaks(a2, b2) {
|
|
23137
23137
|
if (!b2.content.size)
|
|
23138
23138
|
a2.type.compatibleContent(b2.type);
|
|
23139
|
-
let
|
|
23139
|
+
let match2 = a2.contentMatchAt(a2.childCount);
|
|
23140
23140
|
let { linebreakReplacement } = a2.type.schema;
|
|
23141
23141
|
for (let i2 = 0; i2 < b2.childCount; i2++) {
|
|
23142
23142
|
let child = b2.child(i2);
|
|
23143
23143
|
let type2 = child.type == linebreakReplacement ? a2.type.schema.nodes.text : child.type;
|
|
23144
|
-
|
|
23145
|
-
if (!
|
|
23144
|
+
match2 = match2.matchType(type2);
|
|
23145
|
+
if (!match2)
|
|
23146
23146
|
return false;
|
|
23147
23147
|
if (!a2.type.allowsMarks(child.marks))
|
|
23148
23148
|
return false;
|
|
23149
23149
|
}
|
|
23150
|
-
return
|
|
23150
|
+
return match2.validEnd;
|
|
23151
23151
|
}
|
|
23152
23152
|
function joinable(a2, b2) {
|
|
23153
23153
|
return !!(a2 && b2 && !a2.isLeaf && canAppendWithSubstitutedLinebreaks(a2, b2));
|
|
@@ -23329,12 +23329,12 @@
|
|
|
23329
23329
|
}
|
|
23330
23330
|
let first2 = fragment.firstChild;
|
|
23331
23331
|
for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {
|
|
23332
|
-
let { type: type2, match } = this.frontier[frontierDepth], wrap2, inject2 = null;
|
|
23333
|
-
if (pass == 1 && (first2 ?
|
|
23332
|
+
let { type: type2, match: match2 } = this.frontier[frontierDepth], wrap2, inject2 = null;
|
|
23333
|
+
if (pass == 1 && (first2 ? match2.matchType(first2.type) || (inject2 = match2.fillBefore(Fragment$1.from(first2), false)) : parent && type2.compatibleContent(parent.type)))
|
|
23334
23334
|
return { sliceDepth, frontierDepth, parent, inject: inject2 };
|
|
23335
|
-
else if (pass == 2 && first2 && (wrap2 =
|
|
23335
|
+
else if (pass == 2 && first2 && (wrap2 = match2.findWrapping(first2.type)))
|
|
23336
23336
|
return { sliceDepth, frontierDepth, parent, wrap: wrap2 };
|
|
23337
|
-
if (parent &&
|
|
23337
|
+
if (parent && match2.matchType(parent.type))
|
|
23338
23338
|
break;
|
|
23339
23339
|
}
|
|
23340
23340
|
}
|
|
@@ -23370,20 +23370,20 @@
|
|
|
23370
23370
|
let slice = this.unplaced, fragment = parent ? parent.content : slice.content;
|
|
23371
23371
|
let openStart = slice.openStart - sliceDepth;
|
|
23372
23372
|
let taken = 0, add = [];
|
|
23373
|
-
let { match, type: type2 } = this.frontier[frontierDepth];
|
|
23373
|
+
let { match: match2, type: type2 } = this.frontier[frontierDepth];
|
|
23374
23374
|
if (inject2) {
|
|
23375
23375
|
for (let i2 = 0; i2 < inject2.childCount; i2++)
|
|
23376
23376
|
add.push(inject2.child(i2));
|
|
23377
|
-
|
|
23377
|
+
match2 = match2.matchFragment(inject2);
|
|
23378
23378
|
}
|
|
23379
23379
|
let openEndCount = fragment.size + sliceDepth - (slice.content.size - slice.openEnd);
|
|
23380
23380
|
while (taken < fragment.childCount) {
|
|
23381
|
-
let next2 = fragment.child(taken), matches2 =
|
|
23381
|
+
let next2 = fragment.child(taken), matches2 = match2.matchType(next2.type);
|
|
23382
23382
|
if (!matches2)
|
|
23383
23383
|
break;
|
|
23384
23384
|
taken++;
|
|
23385
23385
|
if (taken > 1 || openStart == 0 || next2.content.size) {
|
|
23386
|
-
|
|
23386
|
+
match2 = matches2;
|
|
23387
23387
|
add.push(closeNodeStart(next2.mark(type2.allowedMarks(next2.marks)), taken == 1 ? openStart : 0, taken == fragment.childCount ? openEndCount : -1));
|
|
23388
23388
|
}
|
|
23389
23389
|
}
|
|
@@ -23391,7 +23391,7 @@
|
|
|
23391
23391
|
if (!toEnd)
|
|
23392
23392
|
openEndCount = -1;
|
|
23393
23393
|
this.placed = addToFragment(this.placed, frontierDepth, Fragment$1.from(add));
|
|
23394
|
-
this.frontier[frontierDepth].match =
|
|
23394
|
+
this.frontier[frontierDepth].match = match2;
|
|
23395
23395
|
if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)
|
|
23396
23396
|
this.closeFrontierNode();
|
|
23397
23397
|
for (let i2 = 0, cur = fragment; i2 < openEndCount; i2++) {
|
|
@@ -23414,14 +23414,14 @@
|
|
|
23414
23414
|
}
|
|
23415
23415
|
findCloseLevel($to) {
|
|
23416
23416
|
scan: for (let i2 = Math.min(this.depth, $to.depth); i2 >= 0; i2--) {
|
|
23417
|
-
let { match, type: type2 } = this.frontier[i2];
|
|
23417
|
+
let { match: match2, type: type2 } = this.frontier[i2];
|
|
23418
23418
|
let dropInner = i2 < $to.depth && $to.end(i2 + 1) == $to.pos + ($to.depth - (i2 + 1));
|
|
23419
|
-
let fit = contentAfterFits($to, i2, type2,
|
|
23419
|
+
let fit = contentAfterFits($to, i2, type2, match2, dropInner);
|
|
23420
23420
|
if (!fit)
|
|
23421
23421
|
continue;
|
|
23422
23422
|
for (let d2 = i2 - 1; d2 >= 0; d2--) {
|
|
23423
|
-
let { match:
|
|
23424
|
-
let matches2 = contentAfterFits($to, d2, type3,
|
|
23423
|
+
let { match: match22, type: type3 } = this.frontier[d2];
|
|
23424
|
+
let matches2 = contentAfterFits($to, d2, type3, match22, true);
|
|
23425
23425
|
if (!matches2 || matches2.childCount)
|
|
23426
23426
|
continue scan;
|
|
23427
23427
|
}
|
|
@@ -23484,11 +23484,11 @@
|
|
|
23484
23484
|
}
|
|
23485
23485
|
return node2.copy(frag);
|
|
23486
23486
|
}
|
|
23487
|
-
function contentAfterFits($to, depth, type2,
|
|
23487
|
+
function contentAfterFits($to, depth, type2, match2, open) {
|
|
23488
23488
|
let node2 = $to.node(depth), index2 = open ? $to.indexAfter(depth) : $to.index(depth);
|
|
23489
23489
|
if (index2 == node2.childCount && !type2.compatibleContent(node2.type))
|
|
23490
23490
|
return null;
|
|
23491
|
-
let fit =
|
|
23491
|
+
let fit = match2.fillBefore(node2.content, true, index2);
|
|
23492
23492
|
return fit && !invalidMarks(type2, node2.content, index2) ? fit : null;
|
|
23493
23493
|
}
|
|
23494
23494
|
function invalidMarks(type2, fragment, start2) {
|
|
@@ -23570,9 +23570,9 @@
|
|
|
23570
23570
|
fragment = fragment.replaceChild(0, first2.copy(closeFragment(first2.content, depth + 1, oldOpen, newOpen, first2)));
|
|
23571
23571
|
}
|
|
23572
23572
|
if (depth > newOpen) {
|
|
23573
|
-
let
|
|
23574
|
-
let start2 =
|
|
23575
|
-
fragment = start2.append(
|
|
23573
|
+
let match2 = parent.contentMatchAt(0);
|
|
23574
|
+
let start2 = match2.fillBefore(fragment).append(fragment);
|
|
23575
|
+
fragment = start2.append(match2.matchFragment(start2).fillBefore(Fragment$1.empty, true));
|
|
23576
23576
|
}
|
|
23577
23577
|
return fragment;
|
|
23578
23578
|
}
|
|
@@ -23946,8 +23946,8 @@
|
|
|
23946
23946
|
an optional starting [content match](https://prosemirror.net/docs/ref/#model.ContentMatch) as
|
|
23947
23947
|
third argument.
|
|
23948
23948
|
*/
|
|
23949
|
-
clearIncompatible(pos, parentType,
|
|
23950
|
-
clearIncompatible(this, pos, parentType,
|
|
23949
|
+
clearIncompatible(pos, parentType, match2) {
|
|
23950
|
+
clearIncompatible(this, pos, parentType, match2);
|
|
23951
23951
|
return this;
|
|
23952
23952
|
}
|
|
23953
23953
|
}
|
|
@@ -25302,7 +25302,7 @@
|
|
|
25302
25302
|
function loggingEnabled$1(enabled) {
|
|
25303
25303
|
isLoggingEnabled$1 = enabled;
|
|
25304
25304
|
}
|
|
25305
|
-
let Helper$1 = (_a = class {
|
|
25305
|
+
let Helper$1 = (_a$1 = class {
|
|
25306
25306
|
static log(message) {
|
|
25307
25307
|
if (isLoggingEnabled$1) {
|
|
25308
25308
|
console.log(message);
|
|
@@ -25325,7 +25325,7 @@
|
|
|
25325
25325
|
}
|
|
25326
25326
|
return ret;
|
|
25327
25327
|
}
|
|
25328
|
-
}, _a.GDI = {
|
|
25328
|
+
}, _a$1.GDI = {
|
|
25329
25329
|
FormatSignature: {
|
|
25330
25330
|
ENHMETA_SIGNATURE: 1179469088,
|
|
25331
25331
|
EPS_SIGNATURE: 1179865157
|
|
@@ -25605,7 +25605,7 @@
|
|
|
25605
25605
|
DC_BRUSH: 2147483666,
|
|
25606
25606
|
DC_PEN: 2147483667
|
|
25607
25607
|
}
|
|
25608
|
-
}, _a._uniqueId = 0, _a);
|
|
25608
|
+
}, _a$1._uniqueId = 0, _a$1);
|
|
25609
25609
|
let Blob$2 = class Blob2 {
|
|
25610
25610
|
constructor(blob, offset2) {
|
|
25611
25611
|
if (blob instanceof Blob2) {
|
|
@@ -31314,9 +31314,9 @@
|
|
|
31314
31314
|
}
|
|
31315
31315
|
return nameOrType;
|
|
31316
31316
|
}
|
|
31317
|
-
function defaultBlockAt$1(
|
|
31318
|
-
for (let i2 = 0; i2 <
|
|
31319
|
-
const { type: type2 } =
|
|
31317
|
+
function defaultBlockAt$1(match2) {
|
|
31318
|
+
for (let i2 = 0; i2 < match2.edgeCount; i2++) {
|
|
31319
|
+
const { type: type2 } = match2.edge(i2);
|
|
31320
31320
|
if (type2.isTextblock && !type2.hasRequiredAttrs()) return type2;
|
|
31321
31321
|
}
|
|
31322
31322
|
return null;
|
|
@@ -31993,11 +31993,11 @@
|
|
|
31993
31993
|
if (customFormat.match(/(?:[0]+\d,\s){3}\.{3}/) == null) {
|
|
31994
31994
|
return generateNumbering(path2, lvlText, numberToStringFormatter);
|
|
31995
31995
|
}
|
|
31996
|
-
const
|
|
31997
|
-
if (!
|
|
31996
|
+
const match2 = customFormat.match(/(\d+)/);
|
|
31997
|
+
if (!match2) {
|
|
31998
31998
|
throw new Error("Invalid format string: no numeric pattern found");
|
|
31999
31999
|
}
|
|
32000
|
-
const digitCount =
|
|
32000
|
+
const digitCount = match2[1].length;
|
|
32001
32001
|
return generateNumbering(path2, lvlText, (p2) => String(p2).padStart(digitCount, "0"));
|
|
32002
32002
|
};
|
|
32003
32003
|
const numberToStringFormatter = (value) => String(value);
|
|
@@ -33909,9 +33909,9 @@
|
|
|
33909
33909
|
};
|
|
33910
33910
|
const extractListLevelStyles = (cssText, listId, level, numId) => {
|
|
33911
33911
|
const pattern = new RegExp(`@list\\s+l${listId}:level${level}(?:\\s+lfo${numId})?\\s*\\{([^}]+)\\}`, "i");
|
|
33912
|
-
const
|
|
33913
|
-
if (!
|
|
33914
|
-
const rawStyles =
|
|
33912
|
+
const match2 = cssText.match(pattern);
|
|
33913
|
+
if (!match2) return null;
|
|
33914
|
+
const rawStyles = match2[1].split(";").map((line) => line.trim()).filter(Boolean);
|
|
33915
33915
|
const styleMap = {};
|
|
33916
33916
|
for (const style2 of rawStyles) {
|
|
33917
33917
|
const [key2, value] = style2.split(":").map((s2) => s2.trim());
|
|
@@ -33921,9 +33921,9 @@
|
|
|
33921
33921
|
};
|
|
33922
33922
|
const extractParagraphStyles = (cssText, selector) => {
|
|
33923
33923
|
const pattern = new RegExp(`(${selector})\\s*\\{([^}]+)\\}`, "i");
|
|
33924
|
-
const
|
|
33925
|
-
if (!
|
|
33926
|
-
const rawStyles =
|
|
33924
|
+
const match2 = cssText.match(pattern);
|
|
33925
|
+
if (!match2) return null;
|
|
33926
|
+
const rawStyles = match2[2].split(";").map((line) => line.trim()).filter(Boolean);
|
|
33927
33927
|
const styleMap = {};
|
|
33928
33928
|
for (const style2 of rawStyles) {
|
|
33929
33929
|
const [key2, value] = style2.split(":").map((s2) => s2.trim());
|
|
@@ -33968,16 +33968,16 @@
|
|
|
33968
33968
|
["i", "lowerRoman"]
|
|
33969
33969
|
]);
|
|
33970
33970
|
function getStartNumber(lvlText) {
|
|
33971
|
-
const
|
|
33972
|
-
if (
|
|
33971
|
+
const match2 = lvlText.match(/^(\d+)/);
|
|
33972
|
+
if (match2) return parseInt(match2[1], 10);
|
|
33973
33973
|
return null;
|
|
33974
33974
|
}
|
|
33975
|
-
function letterToNumber(
|
|
33976
|
-
return
|
|
33975
|
+
function letterToNumber(letter2) {
|
|
33976
|
+
return letter2.toLowerCase().charCodeAt(0) - "a".charCodeAt(0) + 1;
|
|
33977
33977
|
}
|
|
33978
33978
|
function getStartNumberFromAlpha(lvlText) {
|
|
33979
|
-
const
|
|
33980
|
-
if (
|
|
33979
|
+
const match2 = lvlText.match(/^([a-zA-Z])/);
|
|
33980
|
+
if (match2) return letterToNumber(match2[1]);
|
|
33981
33981
|
return null;
|
|
33982
33982
|
}
|
|
33983
33983
|
function romanToNumber(roman) {
|
|
@@ -33992,8 +33992,8 @@
|
|
|
33992
33992
|
return num;
|
|
33993
33993
|
}
|
|
33994
33994
|
function getStartNumberFromRoman(lvlText) {
|
|
33995
|
-
const
|
|
33996
|
-
if (
|
|
33995
|
+
const match2 = lvlText.match(/^([ivxlcdmIVXLCDM]+)/);
|
|
33996
|
+
if (match2) return romanToNumber(match2[1]);
|
|
33997
33997
|
return null;
|
|
33998
33998
|
}
|
|
33999
33999
|
const startHelperMap = /* @__PURE__ */ new Map([
|
|
@@ -34795,11 +34795,11 @@
|
|
|
34795
34795
|
this.handler = config2.handler;
|
|
34796
34796
|
}
|
|
34797
34797
|
}
|
|
34798
|
-
const inputRuleMatcherHandler = (text2,
|
|
34799
|
-
if (isRegExp$1(
|
|
34800
|
-
return
|
|
34798
|
+
const inputRuleMatcherHandler = (text2, match2) => {
|
|
34799
|
+
if (isRegExp$1(match2)) {
|
|
34800
|
+
return match2.exec(text2);
|
|
34801
34801
|
}
|
|
34802
|
-
const inputRuleMatch =
|
|
34802
|
+
const inputRuleMatch = match2(text2);
|
|
34803
34803
|
if (!inputRuleMatch) {
|
|
34804
34804
|
return null;
|
|
34805
34805
|
}
|
|
@@ -34831,14 +34831,14 @@
|
|
|
34831
34831
|
if (matched) {
|
|
34832
34832
|
return;
|
|
34833
34833
|
}
|
|
34834
|
-
const
|
|
34835
|
-
if (!
|
|
34834
|
+
const match2 = inputRuleMatcherHandler(textBefore, rule.match);
|
|
34835
|
+
if (!match2) {
|
|
34836
34836
|
return;
|
|
34837
34837
|
}
|
|
34838
34838
|
const tr = view.state.tr;
|
|
34839
34839
|
const state2 = chainableEditorState(tr, view.state);
|
|
34840
34840
|
const range2 = {
|
|
34841
|
-
from: from2 - (
|
|
34841
|
+
from: from2 - (match2[0].length - text2.length),
|
|
34842
34842
|
to
|
|
34843
34843
|
};
|
|
34844
34844
|
const { commands: commands2, chain, can } = new CommandService({
|
|
@@ -34848,7 +34848,7 @@
|
|
|
34848
34848
|
const handler2 = rule.handler({
|
|
34849
34849
|
state: state2,
|
|
34850
34850
|
range: range2,
|
|
34851
|
-
match,
|
|
34851
|
+
match: match2,
|
|
34852
34852
|
commands: commands2,
|
|
34853
34853
|
chain,
|
|
34854
34854
|
can
|
|
@@ -35767,7 +35767,7 @@ ${e}</tr>
|
|
|
35767
35767
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : w(e.text);
|
|
35768
35768
|
}
|
|
35769
35769
|
};
|
|
35770
|
-
var $$
|
|
35770
|
+
var $$2 = class $ {
|
|
35771
35771
|
strong({ text: e }) {
|
|
35772
35772
|
return e;
|
|
35773
35773
|
}
|
|
@@ -35801,7 +35801,7 @@ ${e}</tr>
|
|
|
35801
35801
|
__publicField$2(this, "options");
|
|
35802
35802
|
__publicField$2(this, "renderer");
|
|
35803
35803
|
__publicField$2(this, "textRenderer");
|
|
35804
|
-
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 $$
|
|
35804
|
+
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 $$2();
|
|
35805
35805
|
}
|
|
35806
35806
|
static parse(e, t) {
|
|
35807
35807
|
return new l2(t).parse(e);
|
|
@@ -35974,7 +35974,7 @@ ${e}</tr>
|
|
|
35974
35974
|
__publicField$2(this, "parseInline", this.parseMarkdown(false));
|
|
35975
35975
|
__publicField$2(this, "Parser", b);
|
|
35976
35976
|
__publicField$2(this, "Renderer", P);
|
|
35977
|
-
__publicField$2(this, "TextRenderer", $$
|
|
35977
|
+
__publicField$2(this, "TextRenderer", $$2);
|
|
35978
35978
|
__publicField$2(this, "Lexer", x);
|
|
35979
35979
|
__publicField$2(this, "Tokenizer", y);
|
|
35980
35980
|
__publicField$2(this, "Hooks", S);
|
|
@@ -36146,7 +36146,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
36146
36146
|
k$1.Parser = b;
|
|
36147
36147
|
k$1.parser = b.parse;
|
|
36148
36148
|
k$1.Renderer = P;
|
|
36149
|
-
k$1.TextRenderer = $$
|
|
36149
|
+
k$1.TextRenderer = $$2;
|
|
36150
36150
|
k$1.Lexer = x;
|
|
36151
36151
|
k$1.lexer = x.lex;
|
|
36152
36152
|
k$1.Tokenizer = y;
|
|
@@ -40041,7 +40041,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
40041
40041
|
insertNewRelationship,
|
|
40042
40042
|
getNewRelationshipId
|
|
40043
40043
|
};
|
|
40044
|
-
const kebabCase$2 = (str) => str.replace(/[A-Z]/g, (
|
|
40044
|
+
const kebabCase$2 = (str) => str.replace(/[A-Z]/g, (match2) => `-${match2.toLowerCase()}`);
|
|
40045
40045
|
const comments_module_events$1 = {
|
|
40046
40046
|
ADD: "add",
|
|
40047
40047
|
UPDATE: "update",
|
|
@@ -40311,9 +40311,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
40311
40311
|
};
|
|
40312
40312
|
const parsedSwitches = {};
|
|
40313
40313
|
for (const [key2, pattern] of Object.entries(availableSwitches)) {
|
|
40314
|
-
const
|
|
40315
|
-
if (
|
|
40316
|
-
parsedSwitches[key2] =
|
|
40314
|
+
const match2 = instruction.match(pattern);
|
|
40315
|
+
if (match2) {
|
|
40316
|
+
parsedSwitches[key2] = match2.groups?.value || true;
|
|
40317
40317
|
}
|
|
40318
40318
|
}
|
|
40319
40319
|
if (parsedSwitches.new_window) {
|
|
@@ -41887,7 +41887,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
41887
41887
|
const getInitials = (name) => {
|
|
41888
41888
|
if (!name) return null;
|
|
41889
41889
|
const preparedText = name.replace("(imported)", "").trim();
|
|
41890
|
-
const initials = preparedText.split(" ").map((
|
|
41890
|
+
const initials = preparedText.split(" ").map((word2) => word2[0]).join("");
|
|
41891
41891
|
return initials;
|
|
41892
41892
|
};
|
|
41893
41893
|
const toIsoNoFractional = (unixMillis) => {
|
|
@@ -42428,7 +42428,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
42428
42428
|
static getStoredSuperdocVersion(docx) {
|
|
42429
42429
|
return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
|
|
42430
42430
|
}
|
|
42431
|
-
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.
|
|
42431
|
+
static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.2") {
|
|
42432
42432
|
return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
|
|
42433
42433
|
}
|
|
42434
42434
|
/**
|
|
@@ -45730,7 +45730,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
45730
45730
|
}
|
|
45731
45731
|
}
|
|
45732
45732
|
/**
|
|
45733
|
-
* @vue/shared v3.5.
|
|
45733
|
+
* @vue/shared v3.5.26
|
|
45734
45734
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
45735
45735
|
* @license MIT
|
|
45736
45736
|
**/
|
|
@@ -45763,9 +45763,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
45763
45763
|
const isFunction$2 = (val) => typeof val === "function";
|
|
45764
45764
|
const isString = (val) => typeof val === "string";
|
|
45765
45765
|
const isSymbol$2 = (val) => typeof val === "symbol";
|
|
45766
|
-
const isObject$
|
|
45766
|
+
const isObject$4 = (val) => val !== null && typeof val === "object";
|
|
45767
45767
|
const isPromise = (val) => {
|
|
45768
|
-
return (isObject$
|
|
45768
|
+
return (isObject$4(val) || isFunction$2(val)) && isFunction$2(val.then) && isFunction$2(val.catch);
|
|
45769
45769
|
};
|
|
45770
45770
|
const objectToString$2 = Object.prototype.toString;
|
|
45771
45771
|
const toTypeString = (value) => objectToString$2.call(value);
|
|
@@ -45843,7 +45843,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
45843
45843
|
}
|
|
45844
45844
|
}
|
|
45845
45845
|
return res;
|
|
45846
|
-
} else if (isString(value) || isObject$
|
|
45846
|
+
} else if (isString(value) || isObject$4(value)) {
|
|
45847
45847
|
return value;
|
|
45848
45848
|
}
|
|
45849
45849
|
}
|
|
@@ -45871,7 +45871,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
45871
45871
|
res += normalized + " ";
|
|
45872
45872
|
}
|
|
45873
45873
|
}
|
|
45874
|
-
} else if (isObject$
|
|
45874
|
+
} else if (isObject$4(value)) {
|
|
45875
45875
|
for (const name in value) {
|
|
45876
45876
|
if (value[name]) {
|
|
45877
45877
|
res += name + " ";
|
|
@@ -45900,7 +45900,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
45900
45900
|
return !!(val && val["__v_isRef"] === true);
|
|
45901
45901
|
};
|
|
45902
45902
|
const toDisplayString = (val) => {
|
|
45903
|
-
return isString(val) ? val : val == null ? "" : isArray$3(val) || isObject$
|
|
45903
|
+
return isString(val) ? val : val == null ? "" : isArray$3(val) || isObject$4(val) && (val.toString === objectToString$2 || !isFunction$2(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
|
|
45904
45904
|
};
|
|
45905
45905
|
const replacer = (_key, val) => {
|
|
45906
45906
|
if (isRef$1(val)) {
|
|
@@ -45921,7 +45921,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
45921
45921
|
};
|
|
45922
45922
|
} else if (isSymbol$2(val)) {
|
|
45923
45923
|
return stringifySymbol(val);
|
|
45924
|
-
} else if (isObject$
|
|
45924
|
+
} else if (isObject$4(val) && !isArray$3(val) && !isPlainObject$5(val)) {
|
|
45925
45925
|
return String(val);
|
|
45926
45926
|
}
|
|
45927
45927
|
return val;
|
|
@@ -46433,13 +46433,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
46433
46433
|
}
|
|
46434
46434
|
}
|
|
46435
46435
|
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
46436
|
-
const ITERATE_KEY = Symbol(
|
|
46436
|
+
const ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
46437
46437
|
""
|
|
46438
46438
|
);
|
|
46439
|
-
const MAP_KEY_ITERATE_KEY = Symbol(
|
|
46439
|
+
const MAP_KEY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
46440
46440
|
""
|
|
46441
46441
|
);
|
|
46442
|
-
const ARRAY_ITERATE_KEY = Symbol(
|
|
46442
|
+
const ARRAY_ITERATE_KEY = /* @__PURE__ */ Symbol(
|
|
46443
46443
|
""
|
|
46444
46444
|
);
|
|
46445
46445
|
function track$1(target, type2, key2) {
|
|
@@ -46788,9 +46788,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
46788
46788
|
}
|
|
46789
46789
|
if (isRef(res)) {
|
|
46790
46790
|
const value = targetIsArray && isIntegerKey(key2) ? res : res.value;
|
|
46791
|
-
return isReadonly2 && isObject$
|
|
46791
|
+
return isReadonly2 && isObject$4(value) ? readonly(value) : value;
|
|
46792
46792
|
}
|
|
46793
|
-
if (isObject$
|
|
46793
|
+
if (isObject$4(res)) {
|
|
46794
46794
|
return isReadonly2 ? readonly(res) : reactive(res);
|
|
46795
46795
|
}
|
|
46796
46796
|
return res;
|
|
@@ -47134,7 +47134,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
47134
47134
|
);
|
|
47135
47135
|
}
|
|
47136
47136
|
function createReactiveObject(target, isReadonly2, baseHandlers2, collectionHandlers, proxyMap) {
|
|
47137
|
-
if (!isObject$
|
|
47137
|
+
if (!isObject$4(target)) {
|
|
47138
47138
|
return target;
|
|
47139
47139
|
}
|
|
47140
47140
|
if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
|
|
@@ -47180,8 +47180,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
47180
47180
|
}
|
|
47181
47181
|
return value;
|
|
47182
47182
|
}
|
|
47183
|
-
const toReactive = (value) => isObject$
|
|
47184
|
-
const toReadonly = (value) => isObject$
|
|
47183
|
+
const toReactive = (value) => isObject$4(value) ? reactive(value) : value;
|
|
47184
|
+
const toReadonly = (value) => isObject$4(value) ? readonly(value) : value;
|
|
47185
47185
|
function isRef(r2) {
|
|
47186
47186
|
return r2 ? r2["__v_isRef"] === true : false;
|
|
47187
47187
|
}
|
|
@@ -47304,7 +47304,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
47304
47304
|
return source;
|
|
47305
47305
|
} else if (isFunction$2(source)) {
|
|
47306
47306
|
return new GetterRefImpl(source);
|
|
47307
|
-
} else if (isObject$
|
|
47307
|
+
} else if (isObject$4(source) && arguments.length > 1) {
|
|
47308
47308
|
return propertyToRef(source, key2, defaultValue);
|
|
47309
47309
|
} else {
|
|
47310
47310
|
return ref(source);
|
|
@@ -47519,7 +47519,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
47519
47519
|
return watchHandle;
|
|
47520
47520
|
}
|
|
47521
47521
|
function traverse(value, depth = Infinity, seen) {
|
|
47522
|
-
if (depth <= 0 || !isObject$
|
|
47522
|
+
if (depth <= 0 || !isObject$4(value) || value["__v_skip"]) {
|
|
47523
47523
|
return value;
|
|
47524
47524
|
}
|
|
47525
47525
|
seen = seen || /* @__PURE__ */ new Map();
|
|
@@ -47942,7 +47942,126 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
47942
47942
|
}
|
|
47943
47943
|
}
|
|
47944
47944
|
}
|
|
47945
|
-
|
|
47945
|
+
function provide(key2, value) {
|
|
47946
|
+
if (currentInstance) {
|
|
47947
|
+
let provides = currentInstance.provides;
|
|
47948
|
+
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
47949
|
+
if (parentProvides === provides) {
|
|
47950
|
+
provides = currentInstance.provides = Object.create(parentProvides);
|
|
47951
|
+
}
|
|
47952
|
+
provides[key2] = value;
|
|
47953
|
+
}
|
|
47954
|
+
}
|
|
47955
|
+
function inject(key2, defaultValue, treatDefaultAsFactory = false) {
|
|
47956
|
+
const instance = getCurrentInstance();
|
|
47957
|
+
if (instance || currentApp) {
|
|
47958
|
+
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
|
|
47959
|
+
if (provides && key2 in provides) {
|
|
47960
|
+
return provides[key2];
|
|
47961
|
+
} else if (arguments.length > 1) {
|
|
47962
|
+
return treatDefaultAsFactory && isFunction$2(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
47963
|
+
} else ;
|
|
47964
|
+
}
|
|
47965
|
+
}
|
|
47966
|
+
function hasInjectionContext() {
|
|
47967
|
+
return !!(getCurrentInstance() || currentApp);
|
|
47968
|
+
}
|
|
47969
|
+
const ssrContextKey$2 = /* @__PURE__ */ Symbol.for("v-scx");
|
|
47970
|
+
const useSSRContext = () => {
|
|
47971
|
+
{
|
|
47972
|
+
const ctx2 = inject(ssrContextKey$2);
|
|
47973
|
+
return ctx2;
|
|
47974
|
+
}
|
|
47975
|
+
};
|
|
47976
|
+
function watchEffect(effect2, options) {
|
|
47977
|
+
return doWatch(effect2, null, options);
|
|
47978
|
+
}
|
|
47979
|
+
function watch(source, cb, options) {
|
|
47980
|
+
return doWatch(source, cb, options);
|
|
47981
|
+
}
|
|
47982
|
+
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
47983
|
+
const { immediate, deep, flush, once } = options;
|
|
47984
|
+
const baseWatchOptions = extend$2({}, options);
|
|
47985
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
47986
|
+
let ssrCleanup;
|
|
47987
|
+
if (isInSSRComponentSetup) {
|
|
47988
|
+
if (flush === "sync") {
|
|
47989
|
+
const ctx2 = useSSRContext();
|
|
47990
|
+
ssrCleanup = ctx2.__watcherHandles || (ctx2.__watcherHandles = []);
|
|
47991
|
+
} else if (!runsImmediately) {
|
|
47992
|
+
const watchStopHandle = () => {
|
|
47993
|
+
};
|
|
47994
|
+
watchStopHandle.stop = NOOP;
|
|
47995
|
+
watchStopHandle.resume = NOOP;
|
|
47996
|
+
watchStopHandle.pause = NOOP;
|
|
47997
|
+
return watchStopHandle;
|
|
47998
|
+
}
|
|
47999
|
+
}
|
|
48000
|
+
const instance = currentInstance;
|
|
48001
|
+
baseWatchOptions.call = (fn, type2, args) => callWithAsyncErrorHandling(fn, instance, type2, args);
|
|
48002
|
+
let isPre = false;
|
|
48003
|
+
if (flush === "post") {
|
|
48004
|
+
baseWatchOptions.scheduler = (job) => {
|
|
48005
|
+
queuePostRenderEffect(job, instance && instance.suspense);
|
|
48006
|
+
};
|
|
48007
|
+
} else if (flush !== "sync") {
|
|
48008
|
+
isPre = true;
|
|
48009
|
+
baseWatchOptions.scheduler = (job, isFirstRun) => {
|
|
48010
|
+
if (isFirstRun) {
|
|
48011
|
+
job();
|
|
48012
|
+
} else {
|
|
48013
|
+
queueJob(job);
|
|
48014
|
+
}
|
|
48015
|
+
};
|
|
48016
|
+
}
|
|
48017
|
+
baseWatchOptions.augmentJob = (job) => {
|
|
48018
|
+
if (cb) {
|
|
48019
|
+
job.flags |= 4;
|
|
48020
|
+
}
|
|
48021
|
+
if (isPre) {
|
|
48022
|
+
job.flags |= 2;
|
|
48023
|
+
if (instance) {
|
|
48024
|
+
job.id = instance.uid;
|
|
48025
|
+
job.i = instance;
|
|
48026
|
+
}
|
|
48027
|
+
}
|
|
48028
|
+
};
|
|
48029
|
+
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
48030
|
+
if (isInSSRComponentSetup) {
|
|
48031
|
+
if (ssrCleanup) {
|
|
48032
|
+
ssrCleanup.push(watchHandle);
|
|
48033
|
+
} else if (runsImmediately) {
|
|
48034
|
+
watchHandle();
|
|
48035
|
+
}
|
|
48036
|
+
}
|
|
48037
|
+
return watchHandle;
|
|
48038
|
+
}
|
|
48039
|
+
function instanceWatch(source, value, options) {
|
|
48040
|
+
const publicThis = this.proxy;
|
|
48041
|
+
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
48042
|
+
let cb;
|
|
48043
|
+
if (isFunction$2(value)) {
|
|
48044
|
+
cb = value;
|
|
48045
|
+
} else {
|
|
48046
|
+
cb = value.handler;
|
|
48047
|
+
options = value;
|
|
48048
|
+
}
|
|
48049
|
+
const reset = setCurrentInstance(this);
|
|
48050
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
48051
|
+
reset();
|
|
48052
|
+
return res;
|
|
48053
|
+
}
|
|
48054
|
+
function createPathGetter(ctx2, path2) {
|
|
48055
|
+
const segments = path2.split(".");
|
|
48056
|
+
return () => {
|
|
48057
|
+
let cur = ctx2;
|
|
48058
|
+
for (let i2 = 0; i2 < segments.length && cur; i2++) {
|
|
48059
|
+
cur = cur[segments[i2]];
|
|
48060
|
+
}
|
|
48061
|
+
return cur;
|
|
48062
|
+
};
|
|
48063
|
+
}
|
|
48064
|
+
const TeleportEndKey = /* @__PURE__ */ Symbol("_vte");
|
|
47946
48065
|
const isTeleport = (type2) => type2.__isTeleport;
|
|
47947
48066
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
47948
48067
|
const isTeleportDeferred = (props) => props && (props.defer || props.defer === "");
|
|
@@ -48274,8 +48393,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
48274
48393
|
}
|
|
48275
48394
|
return targetAnchor;
|
|
48276
48395
|
}
|
|
48277
|
-
const leaveCbKey = Symbol("_leaveCb");
|
|
48278
|
-
const enterCbKey$1 = Symbol("_enterCb");
|
|
48396
|
+
const leaveCbKey = /* @__PURE__ */ Symbol("_leaveCb");
|
|
48397
|
+
const enterCbKey$1 = /* @__PURE__ */ Symbol("_enterCb");
|
|
48279
48398
|
function useTransitionState() {
|
|
48280
48399
|
const state2 = {
|
|
48281
48400
|
isMounted: false,
|
|
@@ -49008,7 +49127,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49008
49127
|
}
|
|
49009
49128
|
const COMPONENTS = "components";
|
|
49010
49129
|
const DIRECTIVES = "directives";
|
|
49011
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
49130
|
+
const NULL_DYNAMIC_COMPONENT = /* @__PURE__ */ Symbol.for("v-ndc");
|
|
49012
49131
|
function resolveDynamicComponent(component) {
|
|
49013
49132
|
if (isString(component)) {
|
|
49014
49133
|
return resolveAsset(COMPONENTS, component, false) || component;
|
|
@@ -49074,7 +49193,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49074
49193
|
for (let i2 = 0; i2 < source; i2++) {
|
|
49075
49194
|
ret[i2] = renderItem(i2 + 1, i2, void 0, cached);
|
|
49076
49195
|
}
|
|
49077
|
-
} else if (isObject$
|
|
49196
|
+
} else if (isObject$4(source)) {
|
|
49078
49197
|
if (source[Symbol.iterator]) {
|
|
49079
49198
|
ret = Array.from(
|
|
49080
49199
|
source,
|
|
@@ -49325,7 +49444,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49325
49444
|
}
|
|
49326
49445
|
if (dataOptions) {
|
|
49327
49446
|
const data = dataOptions.call(publicThis, publicThis);
|
|
49328
|
-
if (!isObject$
|
|
49447
|
+
if (!isObject$4(data)) ;
|
|
49329
49448
|
else {
|
|
49330
49449
|
instance.data = reactive(data);
|
|
49331
49450
|
}
|
|
@@ -49414,7 +49533,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49414
49533
|
for (const key2 in injectOptions) {
|
|
49415
49534
|
const opt = injectOptions[key2];
|
|
49416
49535
|
let injected;
|
|
49417
|
-
if (isObject$
|
|
49536
|
+
if (isObject$4(opt)) {
|
|
49418
49537
|
if ("default" in opt) {
|
|
49419
49538
|
injected = inject(
|
|
49420
49539
|
opt.from || key2,
|
|
@@ -49459,7 +49578,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49459
49578
|
{
|
|
49460
49579
|
watch(getter, raw.bind(publicThis));
|
|
49461
49580
|
}
|
|
49462
|
-
} else if (isObject$
|
|
49581
|
+
} else if (isObject$4(raw)) {
|
|
49463
49582
|
if (isArray$3(raw)) {
|
|
49464
49583
|
raw.forEach((r2) => createWatcher(r2, ctx2, publicThis, key2));
|
|
49465
49584
|
} else {
|
|
@@ -49495,7 +49614,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49495
49614
|
}
|
|
49496
49615
|
mergeOptions(resolved, base2, optionMergeStrategies);
|
|
49497
49616
|
}
|
|
49498
|
-
if (isObject$
|
|
49617
|
+
if (isObject$4(base2)) {
|
|
49499
49618
|
cache2.set(base2, resolved);
|
|
49500
49619
|
}
|
|
49501
49620
|
return resolved;
|
|
@@ -49633,7 +49752,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49633
49752
|
if (!isFunction$2(rootComponent)) {
|
|
49634
49753
|
rootComponent = extend$2({}, rootComponent);
|
|
49635
49754
|
}
|
|
49636
|
-
if (rootProps != null && !isObject$
|
|
49755
|
+
if (rootProps != null && !isObject$4(rootProps)) {
|
|
49637
49756
|
rootProps = null;
|
|
49638
49757
|
}
|
|
49639
49758
|
const context = createAppContext();
|
|
@@ -49736,125 +49855,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49736
49855
|
};
|
|
49737
49856
|
}
|
|
49738
49857
|
let currentApp = null;
|
|
49739
|
-
function provide(key2, value) {
|
|
49740
|
-
if (currentInstance) {
|
|
49741
|
-
let provides = currentInstance.provides;
|
|
49742
|
-
const parentProvides = currentInstance.parent && currentInstance.parent.provides;
|
|
49743
|
-
if (parentProvides === provides) {
|
|
49744
|
-
provides = currentInstance.provides = Object.create(parentProvides);
|
|
49745
|
-
}
|
|
49746
|
-
provides[key2] = value;
|
|
49747
|
-
}
|
|
49748
|
-
}
|
|
49749
|
-
function inject(key2, defaultValue, treatDefaultAsFactory = false) {
|
|
49750
|
-
const instance = getCurrentInstance();
|
|
49751
|
-
if (instance || currentApp) {
|
|
49752
|
-
let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
|
|
49753
|
-
if (provides && key2 in provides) {
|
|
49754
|
-
return provides[key2];
|
|
49755
|
-
} else if (arguments.length > 1) {
|
|
49756
|
-
return treatDefaultAsFactory && isFunction$2(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
|
|
49757
|
-
} else ;
|
|
49758
|
-
}
|
|
49759
|
-
}
|
|
49760
|
-
function hasInjectionContext() {
|
|
49761
|
-
return !!(getCurrentInstance() || currentApp);
|
|
49762
|
-
}
|
|
49763
|
-
const ssrContextKey$2 = Symbol.for("v-scx");
|
|
49764
|
-
const useSSRContext = () => {
|
|
49765
|
-
{
|
|
49766
|
-
const ctx2 = inject(ssrContextKey$2);
|
|
49767
|
-
return ctx2;
|
|
49768
|
-
}
|
|
49769
|
-
};
|
|
49770
|
-
function watchEffect(effect2, options) {
|
|
49771
|
-
return doWatch(effect2, null, options);
|
|
49772
|
-
}
|
|
49773
|
-
function watch(source, cb, options) {
|
|
49774
|
-
return doWatch(source, cb, options);
|
|
49775
|
-
}
|
|
49776
|
-
function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
49777
|
-
const { immediate, deep, flush, once } = options;
|
|
49778
|
-
const baseWatchOptions = extend$2({}, options);
|
|
49779
|
-
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
49780
|
-
let ssrCleanup;
|
|
49781
|
-
if (isInSSRComponentSetup) {
|
|
49782
|
-
if (flush === "sync") {
|
|
49783
|
-
const ctx2 = useSSRContext();
|
|
49784
|
-
ssrCleanup = ctx2.__watcherHandles || (ctx2.__watcherHandles = []);
|
|
49785
|
-
} else if (!runsImmediately) {
|
|
49786
|
-
const watchStopHandle = () => {
|
|
49787
|
-
};
|
|
49788
|
-
watchStopHandle.stop = NOOP;
|
|
49789
|
-
watchStopHandle.resume = NOOP;
|
|
49790
|
-
watchStopHandle.pause = NOOP;
|
|
49791
|
-
return watchStopHandle;
|
|
49792
|
-
}
|
|
49793
|
-
}
|
|
49794
|
-
const instance = currentInstance;
|
|
49795
|
-
baseWatchOptions.call = (fn, type2, args) => callWithAsyncErrorHandling(fn, instance, type2, args);
|
|
49796
|
-
let isPre = false;
|
|
49797
|
-
if (flush === "post") {
|
|
49798
|
-
baseWatchOptions.scheduler = (job) => {
|
|
49799
|
-
queuePostRenderEffect(job, instance && instance.suspense);
|
|
49800
|
-
};
|
|
49801
|
-
} else if (flush !== "sync") {
|
|
49802
|
-
isPre = true;
|
|
49803
|
-
baseWatchOptions.scheduler = (job, isFirstRun) => {
|
|
49804
|
-
if (isFirstRun) {
|
|
49805
|
-
job();
|
|
49806
|
-
} else {
|
|
49807
|
-
queueJob(job);
|
|
49808
|
-
}
|
|
49809
|
-
};
|
|
49810
|
-
}
|
|
49811
|
-
baseWatchOptions.augmentJob = (job) => {
|
|
49812
|
-
if (cb) {
|
|
49813
|
-
job.flags |= 4;
|
|
49814
|
-
}
|
|
49815
|
-
if (isPre) {
|
|
49816
|
-
job.flags |= 2;
|
|
49817
|
-
if (instance) {
|
|
49818
|
-
job.id = instance.uid;
|
|
49819
|
-
job.i = instance;
|
|
49820
|
-
}
|
|
49821
|
-
}
|
|
49822
|
-
};
|
|
49823
|
-
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
49824
|
-
if (isInSSRComponentSetup) {
|
|
49825
|
-
if (ssrCleanup) {
|
|
49826
|
-
ssrCleanup.push(watchHandle);
|
|
49827
|
-
} else if (runsImmediately) {
|
|
49828
|
-
watchHandle();
|
|
49829
|
-
}
|
|
49830
|
-
}
|
|
49831
|
-
return watchHandle;
|
|
49832
|
-
}
|
|
49833
|
-
function instanceWatch(source, value, options) {
|
|
49834
|
-
const publicThis = this.proxy;
|
|
49835
|
-
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
49836
|
-
let cb;
|
|
49837
|
-
if (isFunction$2(value)) {
|
|
49838
|
-
cb = value;
|
|
49839
|
-
} else {
|
|
49840
|
-
cb = value.handler;
|
|
49841
|
-
options = value;
|
|
49842
|
-
}
|
|
49843
|
-
const reset = setCurrentInstance(this);
|
|
49844
|
-
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
49845
|
-
reset();
|
|
49846
|
-
return res;
|
|
49847
|
-
}
|
|
49848
|
-
function createPathGetter(ctx2, path2) {
|
|
49849
|
-
const segments = path2.split(".");
|
|
49850
|
-
return () => {
|
|
49851
|
-
let cur = ctx2;
|
|
49852
|
-
for (let i2 = 0; i2 < segments.length && cur; i2++) {
|
|
49853
|
-
cur = cur[segments[i2]];
|
|
49854
|
-
}
|
|
49855
|
-
return cur;
|
|
49856
|
-
};
|
|
49857
|
-
}
|
|
49858
49858
|
const getModelModifiers = (props, modelName) => {
|
|
49859
49859
|
return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`];
|
|
49860
49860
|
};
|
|
@@ -49931,7 +49931,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49931
49931
|
}
|
|
49932
49932
|
}
|
|
49933
49933
|
if (!raw && !hasExtends) {
|
|
49934
|
-
if (isObject$
|
|
49934
|
+
if (isObject$4(comp)) {
|
|
49935
49935
|
cache2.set(comp, null);
|
|
49936
49936
|
}
|
|
49937
49937
|
return null;
|
|
@@ -49941,7 +49941,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
49941
49941
|
} else {
|
|
49942
49942
|
extend$2(normalized, raw);
|
|
49943
49943
|
}
|
|
49944
|
-
if (isObject$
|
|
49944
|
+
if (isObject$4(comp)) {
|
|
49945
49945
|
cache2.set(comp, normalized);
|
|
49946
49946
|
}
|
|
49947
49947
|
return normalized;
|
|
@@ -50370,7 +50370,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
50370
50370
|
}
|
|
50371
50371
|
}
|
|
50372
50372
|
if (!raw && !hasExtends) {
|
|
50373
|
-
if (isObject$
|
|
50373
|
+
if (isObject$4(comp)) {
|
|
50374
50374
|
cache2.set(comp, EMPTY_ARR);
|
|
50375
50375
|
}
|
|
50376
50376
|
return EMPTY_ARR;
|
|
@@ -50420,7 +50420,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
50420
50420
|
}
|
|
50421
50421
|
}
|
|
50422
50422
|
const res = [normalized, needCastKeys];
|
|
50423
|
-
if (isObject$
|
|
50423
|
+
if (isObject$4(comp)) {
|
|
50424
50424
|
cache2.set(comp, res);
|
|
50425
50425
|
}
|
|
50426
50426
|
return res;
|
|
@@ -50642,7 +50642,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
50642
50642
|
} else {
|
|
50643
50643
|
const el = n2.el = n1.el;
|
|
50644
50644
|
if (n2.children !== n1.children) {
|
|
50645
|
-
|
|
50645
|
+
{
|
|
50646
|
+
hostSetText(el, n2.children);
|
|
50647
|
+
}
|
|
50646
50648
|
}
|
|
50647
50649
|
}
|
|
50648
50650
|
};
|
|
@@ -50987,7 +50989,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
50987
50989
|
} else {
|
|
50988
50990
|
if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
|
|
50989
50991
|
// of renderSlot() with no valid children
|
|
50990
|
-
n1.dynamicChildren) {
|
|
50992
|
+
n1.dynamicChildren && n1.dynamicChildren.length === dynamicChildren.length) {
|
|
50991
50993
|
patchBlockChildren(
|
|
50992
50994
|
n1.dynamicChildren,
|
|
50993
50995
|
dynamicChildren,
|
|
@@ -51484,8 +51486,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
51484
51486
|
const nextChild = c2[nextIndex];
|
|
51485
51487
|
const anchorVNode = c2[nextIndex + 1];
|
|
51486
51488
|
const anchor = nextIndex + 1 < l2 ? (
|
|
51487
|
-
// #13559, fallback to el placeholder for unresolved async component
|
|
51488
|
-
anchorVNode.el || anchorVNode
|
|
51489
|
+
// #13559, #14173 fallback to el placeholder for unresolved async component
|
|
51490
|
+
anchorVNode.el || resolveAsyncComponentPlaceholder(anchorVNode)
|
|
51489
51491
|
) : parentAnchor;
|
|
51490
51492
|
if (newIndexToOldIndexMap[i2] === 0) {
|
|
51491
51493
|
patch2(
|
|
@@ -51727,9 +51729,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
51727
51729
|
};
|
|
51728
51730
|
let isFlushing = false;
|
|
51729
51731
|
const render2 = (vnode, container, namespace2) => {
|
|
51732
|
+
let instance;
|
|
51730
51733
|
if (vnode == null) {
|
|
51731
51734
|
if (container._vnode) {
|
|
51732
51735
|
unmount2(container._vnode, null, null, true);
|
|
51736
|
+
instance = container._vnode.component;
|
|
51733
51737
|
}
|
|
51734
51738
|
} else {
|
|
51735
51739
|
patch2(
|
|
@@ -51745,7 +51749,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
51745
51749
|
container._vnode = vnode;
|
|
51746
51750
|
if (!isFlushing) {
|
|
51747
51751
|
isFlushing = true;
|
|
51748
|
-
flushPreFlushCbs();
|
|
51752
|
+
flushPreFlushCbs(instance);
|
|
51749
51753
|
flushPostFlushCbs();
|
|
51750
51754
|
isFlushing = false;
|
|
51751
51755
|
}
|
|
@@ -51799,9 +51803,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
51799
51803
|
if (!shallow && c2.patchFlag !== -2)
|
|
51800
51804
|
traverseStaticChildren(c1, c2);
|
|
51801
51805
|
}
|
|
51802
|
-
if (c2.type === Text$1
|
|
51803
|
-
|
|
51804
|
-
|
|
51806
|
+
if (c2.type === Text$1) {
|
|
51807
|
+
if (c2.patchFlag !== -1) {
|
|
51808
|
+
c2.el = c1.el;
|
|
51809
|
+
} else {
|
|
51810
|
+
c2.__elIndex = i2 + // take fragment start anchor into account
|
|
51811
|
+
(n1.type === Fragment ? 1 : 0);
|
|
51812
|
+
}
|
|
51805
51813
|
}
|
|
51806
51814
|
if (c2.type === Comment && !c2.el) {
|
|
51807
51815
|
c2.el = c1.el;
|
|
@@ -51865,6 +51873,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
51865
51873
|
hooks[i2].flags |= 8;
|
|
51866
51874
|
}
|
|
51867
51875
|
}
|
|
51876
|
+
function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
51877
|
+
if (anchorVnode.placeholder) {
|
|
51878
|
+
return anchorVnode.placeholder;
|
|
51879
|
+
}
|
|
51880
|
+
const instance = anchorVnode.component;
|
|
51881
|
+
if (instance) {
|
|
51882
|
+
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
51883
|
+
}
|
|
51884
|
+
return null;
|
|
51885
|
+
}
|
|
51868
51886
|
const isSuspense = (type2) => type2.__isSuspense;
|
|
51869
51887
|
function queueEffectWithSuspense(fn, suspense) {
|
|
51870
51888
|
if (suspense && suspense.pendingBranch) {
|
|
@@ -51877,10 +51895,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
51877
51895
|
queuePostFlushCb(fn);
|
|
51878
51896
|
}
|
|
51879
51897
|
}
|
|
51880
|
-
const Fragment = Symbol.for("v-fgt");
|
|
51881
|
-
const Text$1 = Symbol.for("v-txt");
|
|
51882
|
-
const Comment = Symbol.for("v-cmt");
|
|
51883
|
-
const Static = Symbol.for("v-stc");
|
|
51898
|
+
const Fragment = /* @__PURE__ */ Symbol.for("v-fgt");
|
|
51899
|
+
const Text$1 = /* @__PURE__ */ Symbol.for("v-txt");
|
|
51900
|
+
const Comment = /* @__PURE__ */ Symbol.for("v-cmt");
|
|
51901
|
+
const Static = /* @__PURE__ */ Symbol.for("v-stc");
|
|
51884
51902
|
const blockStack = [];
|
|
51885
51903
|
let currentBlock = null;
|
|
51886
51904
|
function openBlock(disableTracking = false) {
|
|
@@ -52032,14 +52050,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
52032
52050
|
if (klass && !isString(klass)) {
|
|
52033
52051
|
props.class = normalizeClass(klass);
|
|
52034
52052
|
}
|
|
52035
|
-
if (isObject$
|
|
52053
|
+
if (isObject$4(style2)) {
|
|
52036
52054
|
if (isProxy(style2) && !isArray$3(style2)) {
|
|
52037
52055
|
style2 = extend$2({}, style2);
|
|
52038
52056
|
}
|
|
52039
52057
|
props.style = normalizeStyle(style2);
|
|
52040
52058
|
}
|
|
52041
52059
|
}
|
|
52042
|
-
const shapeFlag = isString(type2) ? 1 : isSuspense(type2) ? 128 : isTeleport(type2) ? 64 : isObject$
|
|
52060
|
+
const shapeFlag = isString(type2) ? 1 : isSuspense(type2) ? 128 : isTeleport(type2) ? 64 : isObject$4(type2) ? 4 : isFunction$2(type2) ? 2 : 0;
|
|
52043
52061
|
return createBaseVNode(
|
|
52044
52062
|
type2,
|
|
52045
52063
|
props,
|
|
@@ -52401,7 +52419,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
52401
52419
|
} else {
|
|
52402
52420
|
instance.render = setupResult;
|
|
52403
52421
|
}
|
|
52404
|
-
} else if (isObject$
|
|
52422
|
+
} else if (isObject$4(setupResult)) {
|
|
52405
52423
|
instance.setupState = proxyRefs(setupResult);
|
|
52406
52424
|
} else ;
|
|
52407
52425
|
finishComponentSetup(instance);
|
|
@@ -52467,9 +52485,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
52467
52485
|
function formatComponentName(instance, Component, isRoot = false) {
|
|
52468
52486
|
let name = getComponentName(Component);
|
|
52469
52487
|
if (!name && Component.__file) {
|
|
52470
|
-
const
|
|
52471
|
-
if (
|
|
52472
|
-
name =
|
|
52488
|
+
const match2 = Component.__file.match(/([^/\\]+)\.\w+$/);
|
|
52489
|
+
if (match2) {
|
|
52490
|
+
name = match2[1];
|
|
52473
52491
|
}
|
|
52474
52492
|
}
|
|
52475
52493
|
if (!name && instance) {
|
|
@@ -52498,7 +52516,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
52498
52516
|
setBlockTracking(-1);
|
|
52499
52517
|
const l = arguments.length;
|
|
52500
52518
|
if (l === 2) {
|
|
52501
|
-
if (isObject$
|
|
52519
|
+
if (isObject$4(propsOrChildren) && !isArray$3(propsOrChildren)) {
|
|
52502
52520
|
if (isVNode(propsOrChildren)) {
|
|
52503
52521
|
return createVNode(type2, null, [propsOrChildren]);
|
|
52504
52522
|
}
|
|
@@ -52518,7 +52536,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
52518
52536
|
setBlockTracking(1);
|
|
52519
52537
|
}
|
|
52520
52538
|
}
|
|
52521
|
-
const version$1 = "3.5.
|
|
52539
|
+
const version$1 = "3.5.26";
|
|
52522
52540
|
let policy = void 0;
|
|
52523
52541
|
const tt = typeof window !== "undefined" && window.trustedTypes;
|
|
52524
52542
|
if (tt) {
|
|
@@ -52600,7 +52618,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
52600
52618
|
};
|
|
52601
52619
|
const TRANSITION = "transition";
|
|
52602
52620
|
const ANIMATION = "animation";
|
|
52603
|
-
const vtcKey = Symbol("_vtc");
|
|
52621
|
+
const vtcKey = /* @__PURE__ */ Symbol("_vtc");
|
|
52604
52622
|
const DOMTransitionPropsValidators = {
|
|
52605
52623
|
name: String,
|
|
52606
52624
|
type: String,
|
|
@@ -52759,7 +52777,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
52759
52777
|
function normalizeDuration(duration2) {
|
|
52760
52778
|
if (duration2 == null) {
|
|
52761
52779
|
return null;
|
|
52762
|
-
} else if (isObject$
|
|
52780
|
+
} else if (isObject$4(duration2)) {
|
|
52763
52781
|
return [NumberOf(duration2.enter), NumberOf(duration2.leave)];
|
|
52764
52782
|
} else {
|
|
52765
52783
|
const n = NumberOf(duration2);
|
|
@@ -52888,8 +52906,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
52888
52906
|
el.className = value;
|
|
52889
52907
|
}
|
|
52890
52908
|
}
|
|
52891
|
-
const vShowOriginalDisplay = Symbol("_vod");
|
|
52892
|
-
const vShowHidden = Symbol("_vsh");
|
|
52909
|
+
const vShowOriginalDisplay = /* @__PURE__ */ Symbol("_vod");
|
|
52910
|
+
const vShowHidden = /* @__PURE__ */ Symbol("_vsh");
|
|
52893
52911
|
const vShow = {
|
|
52894
52912
|
// used for prop mismatch check during hydration
|
|
52895
52913
|
name: "show",
|
|
@@ -52930,7 +52948,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
52930
52948
|
el.style.display = value ? el[vShowOriginalDisplay] : "none";
|
|
52931
52949
|
el[vShowHidden] = !value;
|
|
52932
52950
|
}
|
|
52933
|
-
const CSS_VAR_TEXT = Symbol("");
|
|
52951
|
+
const CSS_VAR_TEXT = /* @__PURE__ */ Symbol("");
|
|
52934
52952
|
function useCssVars(getter) {
|
|
52935
52953
|
const instance = getCurrentInstance();
|
|
52936
52954
|
if (!instance) {
|
|
@@ -53158,7 +53176,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
53158
53176
|
function removeEventListener$1(el, event, handler2, options) {
|
|
53159
53177
|
el.removeEventListener(event, handler2, options);
|
|
53160
53178
|
}
|
|
53161
|
-
const veiKey = Symbol("_vei");
|
|
53179
|
+
const veiKey = /* @__PURE__ */ Symbol("_vei");
|
|
53162
53180
|
function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
|
|
53163
53181
|
const invokers = el[veiKey] || (el[veiKey] = {});
|
|
53164
53182
|
const existingInvoker = invokers[rawName];
|
|
@@ -53296,8 +53314,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
53296
53314
|
}
|
|
53297
53315
|
const positionMap = /* @__PURE__ */ new WeakMap();
|
|
53298
53316
|
const newPositionMap = /* @__PURE__ */ new WeakMap();
|
|
53299
|
-
const moveCbKey = Symbol("_moveCb");
|
|
53300
|
-
const enterCbKey = Symbol("_enterCb");
|
|
53317
|
+
const moveCbKey = /* @__PURE__ */ Symbol("_moveCb");
|
|
53318
|
+
const enterCbKey = /* @__PURE__ */ Symbol("_enterCb");
|
|
53301
53319
|
const decorate = (t) => {
|
|
53302
53320
|
delete t.props.mode;
|
|
53303
53321
|
return t;
|
|
@@ -53447,7 +53465,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
53447
53465
|
target.dispatchEvent(new Event("input"));
|
|
53448
53466
|
}
|
|
53449
53467
|
}
|
|
53450
|
-
const assignKey = Symbol("_assign");
|
|
53468
|
+
const assignKey = /* @__PURE__ */ Symbol("_assign");
|
|
53451
53469
|
function castValue(value, trim, number2) {
|
|
53452
53470
|
if (trim) value = value.trim();
|
|
53453
53471
|
if (number2) value = looseToNumber(value);
|
|
@@ -53597,7 +53615,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
53597
53615
|
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
53598
53616
|
var __privateSet = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
53599
53617
|
var __privateMethod$1 = (obj, member, method) => (__accessCheck$1(obj, member, "access private method"), method);
|
|
53600
|
-
var _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _currentEpoch, _mapsByFromEpoch, _maxEpochsToKeep, _EpochPositionMapper_instances, pruneByCurrentEpoch_fn, _entries, _windowRoot, _getPainterHost, _onRebuild, _observer, _rebuildScheduled, _rebuildRafId, _docEpoch, _layoutEpoch, _layoutUpdating, _pending, _scheduled, _rafHandle, _scheduler, _SelectionSyncCoordinator_instances, isSafeToRender_fn, maybeSchedule_fn, cancelScheduledRender_fn, _windowRoot2, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _pageGeometryHelper, _dragHandlerCleanup, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionSync, _remoteCursorUpdateScheduled, _epochMapper, _layoutEpoch2, _domPositionIndex, _domIndexObserverManager, _debugLastPointer, _debugLastHit, _pendingMarginClick, _rafHandle2, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _a11ySelectionAnnounceTimeout, _a11yLastAnnouncedSelectionKey, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _dragAnchor, _dragAnchorPageIndex, _isDragging, _dragExtensionMode, _dragLastPointer, _dragLastRawHit, _dragUsedPageNotMountedFallback, _cellAnchor, _cellDragMode, _remoteCursorState, _remoteCursorElements, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _scrollTimeout, _lastRemoteCursorRenderTime, _remoteCursorThrottleTimeout, _PresentationEditor_instances, collectCommentPositions_fn, updateSelectionDebugHud_fn, computePendingMarginClick_fn, aggregateLayoutBounds_fn, rebuildDomPositionIndex_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, updateLocalAwarenessCursor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, setupPointerHandlers_fn, setupDragHandlers_fn, focusEditorAfterImageSelection_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, getCellPosFromTableHit_fn, getTablePosFromHit_fn, shouldUseCellSelection_fn, setCellAnchor_fn, clearCellAnchor_fn, hitTestTable_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, _handlePointerMove, _handlePointerLeave, _handleVisibleHostFocusIn, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, computeExpectedSectionType_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, syncHiddenEditorA11yAttributes_fn, scheduleA11ySelectionAnnouncement_fn, announceSelectionNow_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, isSelectionAwareVirtualizationEnabled_fn, updateSelectionVirtualizationPins_fn, finalizeDragSelectionWithDom_fn, scrollPageIntoView_fn, waitForPageMount_fn, getEffectivePageGap_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderCellSelectionOverlay_fn, renderHoverRegion_fn, clearHoverRegion_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, applyZoom_fn, getPageOffsetX_fn, convertPageLocalToOverlayCoords_fn, computeSelectionRectsFromDom_fn, computeDomCaretPageLocal_fn, normalizeClientPoint_fn, computeCaretLayoutRectGeometry_fn, computeCaretLayoutRect_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
|
|
53618
|
+
var _a, _Attribute_static, getGlobalAttributes_fn, getNodeAndMarksAttributes_fn, _Schema_static, createNodesSchema_fn, createMarksSchema_fn, _events, _ExtensionService_instances, setupExtensions_fn, attachEditorEvents_fn, _editor, _stateValidators, _xmlValidators, _requiredNodeTypes, _requiredMarkTypes, _SuperValidator_instances, initializeValidators_fn, collectValidatorRequirements_fn, analyzeDocument_fn, dispatchWithFallback_fn, _commandService, _Editor_instances, initContainerElement_fn, init_fn, initRichText_fn, onFocus_fn, checkHeadless_fn, registerCopyHandler_fn, insertNewFileData_fn, getPluginKeyName_fn, createExtensionService_fn, createCommandService_fn, createConverter_fn, initMedia_fn, initFonts_fn, checkFonts_fn, determineUnsupportedFonts_fn, createSchema_fn, generatePmData_fn, createView_fn, onCollaborationReady_fn, initComments_fn, dispatchTransaction_fn, handleNodeSelection_fn, prepareDocumentForImport_fn, prepareDocumentForExport_fn, endCollaboration_fn, validateDocumentInit_fn, validateDocumentExport_fn, initDevTools_fn, _currentEpoch, _mapsByFromEpoch, _maxEpochsToKeep, _EpochPositionMapper_instances, pruneByCurrentEpoch_fn, _entries, _windowRoot, _getPainterHost, _onRebuild, _observer, _rebuildScheduled, _rebuildRafId, _docEpoch, _layoutEpoch, _layoutUpdating, _pending, _scheduled, _rafHandle, _scheduler, _SelectionSyncCoordinator_instances, isSafeToRender_fn, maybeSchedule_fn, cancelScheduledRender_fn, _windowRoot2, _layoutSurfaces, _getTargetDom, _isEditable, _onTargetChanged, _listeners, _currentTarget, _destroyed, _useWindowFallback, _PresentationInputBridge_instances, addListener_fn, dispatchToTarget_fn, forwardKeyboardEvent_fn, forwardTextEvent_fn, forwardCompositionEvent_fn, forwardContextMenu_fn, isEventOnActiveTarget_fn, shouldSkipSurface_fn, isInLayoutSurface_fn, getListenerTargets_fn, isPlainCharacterKey_fn, _map, _editor2, _descriptors, _collections, _editorEntries, _maxCachedEditors, _editorAccessOrder, _pendingCreations, _cacheHits, _cacheMisses, _evictions, _HeaderFooterEditorManager_instances, hasConverter_fn, extractCollections_fn, collectDescriptors_fn, teardownMissingEditors_fn, teardownEditors_fn, createEditor_fn, createEditorContainer_fn, registerConverterEditor_fn, unregisterConverterEditor_fn, updateAccessOrder_fn, enforceCacheSizeLimit_fn, _manager, _mediaFiles, _blockCache, _HeaderFooterLayoutAdapter_instances, getBlocks_fn, getConverterContext_fn, _selectionOverlay, _activeEditorHost, _activeDecorationContainer, _activeRegion, _borderLine, _dimmingOverlay, _EditorOverlayManager_instances, findDecorationContainer_fn, ensureEditorHost_fn, positionEditorHost_fn, showHeaderFooterBorder_fn, hideHeaderFooterBorder_fn, _instances, _options, _editor3, _visibleHost, _viewportHost, _painterHost, _selectionOverlay2, _hiddenHost, _layoutOptions, _layoutState, _domPainter, _pageGeometryHelper, _dragHandlerCleanup, _layoutError, _layoutErrorState, _errorBanner, _errorBannerMessage, _telemetryEmitter, _renderScheduled, _pendingDocChange, _isRerendering, _selectionSync, _remoteCursorUpdateScheduled, _epochMapper, _layoutEpoch2, _domPositionIndex, _domIndexObserverManager, _debugLastPointer, _debugLastHit, _pendingMarginClick, _rafHandle2, _editorListeners, _sectionMetadata, _documentMode, _inputBridge, _trackedChangesMode, _trackedChangesEnabled, _trackedChangesOverrides, _headerFooterManager, _headerFooterAdapter, _headerFooterIdentifier, _multiSectionIdentifier, _headerLayoutResults, _footerLayoutResults, _headerLayoutsByRId, _footerLayoutsByRId, _headerDecorationProvider, _footerDecorationProvider, _headerFooterManagerCleanups, _headerRegions, _footerRegions, _session, _activeHeaderFooterEditor, _overlayManager, _hoverOverlay, _hoverTooltip, _modeBanner, _ariaLiveRegion, _a11ySelectionAnnounceTimeout, _a11yLastAnnouncedSelectionKey, _hoverRegion, _clickCount, _lastClickTime, _lastClickPosition, _lastSelectedImageBlockId, _dragAnchor, _dragAnchorPageIndex, _isDragging, _dragExtensionMode, _dragLastPointer, _dragLastRawHit, _dragUsedPageNotMountedFallback, _cellAnchor, _cellDragMode, _remoteCursorState, _remoteCursorElements, _remoteCursorDirty, _remoteCursorOverlay, _localSelectionLayer, _awarenessCleanup, _scrollCleanup, _scrollTimeout, _lastRemoteCursorRenderTime, _remoteCursorThrottleTimeout, _PresentationEditor_instances, wrapHiddenEditorFocus_fn, collectCommentPositions_fn, updateSelectionDebugHud_fn, computePendingMarginClick_fn, aggregateLayoutBounds_fn, rebuildDomPositionIndex_fn, setupEditorListeners_fn, setupCollaborationCursors_fn, updateLocalAwarenessCursor_fn, scheduleRemoteCursorUpdate_fn, scheduleRemoteCursorReRender_fn, updateRemoteCursors_fn, renderRemoteCursors_fn, setupPointerHandlers_fn, setupDragHandlers_fn, focusEditorAfterImageSelection_fn, setupInputBridge_fn, initHeaderFooterRegistry_fn, _handlePointerDown, getFirstTextPosition_fn, registerPointerClick_fn, getCellPosFromTableHit_fn, getTablePosFromHit_fn, shouldUseCellSelection_fn, setCellAnchor_fn, clearCellAnchor_fn, hitTestTable_fn, selectWordAt_fn, selectParagraphAt_fn, calculateExtendedSelection_fn, _handlePointerMove, _handlePointerLeave, _handleVisibleHostFocusIn, _handlePointerUp, _handleDragOver, _handleDrop, _handleDoubleClick, _handleKeyDown, focusHeaderFooterShortcut_fn, scheduleRerender_fn, flushRerenderQueue_fn, rerender_fn, ensurePainter_fn, scheduleSelectionUpdate_fn, updateSelection_fn, resolveLayoutOptions_fn, buildHeaderFooterInput_fn, computeHeaderFooterConstraints_fn, layoutPerRIdHeaderFooters_fn, updateDecorationProviders_fn, createDecorationProvider_fn, findHeaderFooterPageForPageNumber_fn, computeDecorationBox_fn, computeExpectedSectionType_fn, rebuildHeaderFooterRegions_fn, hitTestHeaderFooterRegion_fn, pointInRegion_fn, activateHeaderFooterRegion_fn, enterHeaderFooterMode_fn, exitHeaderFooterMode_fn, getActiveDomTarget_fn, emitHeaderFooterModeChanged_fn, emitHeaderFooterEditingContext_fn, updateAwarenessSession_fn, updateModeBanner_fn, announce_fn, syncHiddenEditorA11yAttributes_fn, scheduleA11ySelectionAnnouncement_fn, announceSelectionNow_fn, validateHeaderFooterEditPermission_fn, emitHeaderFooterEditBlocked_fn, resolveDescriptorForRegion_fn, createDefaultHeaderFooter_fn, getPageElement_fn, isSelectionAwareVirtualizationEnabled_fn, updateSelectionVirtualizationPins_fn, finalizeDragSelectionWithDom_fn, scrollPageIntoView_fn, waitForPageMount_fn, getEffectivePageGap_fn, getBodyPageHeight_fn, getHeaderFooterPageHeight_fn, renderCellSelectionOverlay_fn, renderHoverRegion_fn, clearHoverRegion_fn, getHeaderFooterContext_fn, computeHeaderFooterSelectionRects_fn, syncTrackedChangesPreferences_fn, deriveTrackedChangesMode_fn, deriveTrackedChangesEnabled_fn, getTrackChangesPluginState_fn, computeDefaultLayoutDefaults_fn, applyZoom_fn, getPageOffsetX_fn, convertPageLocalToOverlayCoords_fn, computeSelectionRectsFromDom_fn, computeDomCaretPageLocal_fn, normalizeClientPoint_fn, computeCaretLayoutRectGeometry_fn, computeCaretLayoutRect_fn, getCurrentPageIndex_fn, findRegionForPage_fn, handleLayoutError_fn, decorateError_fn, showLayoutErrorBanner_fn, dismissErrorBanner_fn, _DocumentSectionView_instances, init_fn2, addToolTip_fn, _ParagraphNodeView_instances, checkShouldUpdate_fn, updateHTMLAttributes_fn, updateDOMStyles_fn, resolveNeighborParagraphProperties_fn, updateListStyles_fn, initList_fn, checkIsList_fn, createMarker_fn, createSeparator_fn, calculateTabSeparatorStyle_fn, calculateMarkerStyle_fn, removeList_fn, getParagraphContext_fn, scheduleAnimation_fn, cancelScheduledAnimation_fn, _FieldAnnotationView_instances, createAnnotation_fn, _AutoPageNumberNodeView_instances, renderDom_fn, scheduleUpdateNodeStyle_fn, _VectorShapeView_instances, ensureParentPositioned_fn, _ShapeGroupView_instances, ensureParentPositioned_fn2;
|
|
53601
53619
|
var GOOD_LEAF_SIZE = 200;
|
|
53602
53620
|
var RopeSequence = function RopeSequence2() {
|
|
53603
53621
|
};
|
|
@@ -56730,12 +56748,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
56730
56748
|
return fragment;
|
|
56731
56749
|
for (let d2 = $context.depth; d2 >= 0; d2--) {
|
|
56732
56750
|
let parent = $context.node(d2);
|
|
56733
|
-
let
|
|
56751
|
+
let match2 = parent.contentMatchAt($context.index(d2));
|
|
56734
56752
|
let lastWrap, result = [];
|
|
56735
56753
|
fragment.forEach((node2) => {
|
|
56736
56754
|
if (!result)
|
|
56737
56755
|
return;
|
|
56738
|
-
let wrap2 =
|
|
56756
|
+
let wrap2 = match2.findWrapping(node2.type), inLast;
|
|
56739
56757
|
if (!wrap2)
|
|
56740
56758
|
return result = null;
|
|
56741
56759
|
if (inLast = result.length && lastWrap.length && addToSibling(wrap2, lastWrap, node2, result[result.length - 1], 0)) {
|
|
@@ -56745,7 +56763,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
56745
56763
|
result[result.length - 1] = closeRight(result[result.length - 1], lastWrap.length);
|
|
56746
56764
|
let wrapped = withWrappers(node2, wrap2);
|
|
56747
56765
|
result.push(wrapped);
|
|
56748
|
-
|
|
56766
|
+
match2 = match2.matchType(wrapped.type);
|
|
56749
56767
|
lastWrap = wrap2;
|
|
56750
56768
|
}
|
|
56751
56769
|
});
|
|
@@ -56764,8 +56782,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
56764
56782
|
let inner = addToSibling(wrap2, lastWrap, node2, sibling.lastChild, depth + 1);
|
|
56765
56783
|
if (inner)
|
|
56766
56784
|
return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
|
|
56767
|
-
let
|
|
56768
|
-
if (
|
|
56785
|
+
let match2 = sibling.contentMatchAt(sibling.childCount);
|
|
56786
|
+
if (match2.matchType(depth == wrap2.length - 1 ? node2.type : wrap2[depth + 1]))
|
|
56769
56787
|
return sibling.copy(sibling.content.append(Fragment$1.from(withWrappers(node2, wrap2, depth + 1))));
|
|
56770
56788
|
}
|
|
56771
56789
|
}
|
|
@@ -59322,15 +59340,40 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59322
59340
|
const BITS6 = 63;
|
|
59323
59341
|
const BITS7$1 = 127;
|
|
59324
59342
|
const BITS31 = 2147483647;
|
|
59343
|
+
const MAX_SAFE_INTEGER$4 = Number.MAX_SAFE_INTEGER;
|
|
59344
|
+
const MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER;
|
|
59325
59345
|
const isInteger = Number.isInteger || ((num) => typeof num === "number" && isFinite(num) && floor$2(num) === num);
|
|
59326
59346
|
const create$2$1 = () => /* @__PURE__ */ new Set();
|
|
59347
|
+
const every$1 = (arr, f2) => {
|
|
59348
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
59349
|
+
if (!f2(arr[i2], i2, arr)) {
|
|
59350
|
+
return false;
|
|
59351
|
+
}
|
|
59352
|
+
}
|
|
59353
|
+
return true;
|
|
59354
|
+
};
|
|
59355
|
+
const some = (arr, f2) => {
|
|
59356
|
+
for (let i2 = 0; i2 < arr.length; i2++) {
|
|
59357
|
+
if (f2(arr[i2], i2, arr)) {
|
|
59358
|
+
return true;
|
|
59359
|
+
}
|
|
59360
|
+
}
|
|
59361
|
+
return false;
|
|
59362
|
+
};
|
|
59363
|
+
const unfold = (len2, f2) => {
|
|
59364
|
+
const array = new Array(len2);
|
|
59365
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
59366
|
+
array[i2] = f2(i2, array);
|
|
59367
|
+
}
|
|
59368
|
+
return array;
|
|
59369
|
+
};
|
|
59327
59370
|
const isArray$2 = Array.isArray;
|
|
59328
59371
|
const fromCharCode$1 = String.fromCharCode;
|
|
59329
59372
|
const toLowerCase$1 = (s2) => s2.toLowerCase();
|
|
59330
59373
|
const trimLeftRegex$1 = /^\s*/g;
|
|
59331
59374
|
const trimLeft$1 = (s2) => s2.replace(trimLeftRegex$1, "");
|
|
59332
59375
|
const fromCamelCaseRegex$1 = /([A-Z])/g;
|
|
59333
|
-
const fromCamelCase$1 = (s2, separator) => trimLeft$1(s2.replace(fromCamelCaseRegex$1, (
|
|
59376
|
+
const fromCamelCase$1 = (s2, separator) => trimLeft$1(s2.replace(fromCamelCaseRegex$1, (match2) => `${separator}${toLowerCase$1(match2)}`));
|
|
59334
59377
|
const _encodeUtf8Polyfill$1 = (str) => {
|
|
59335
59378
|
const encodedString = unescape(encodeURIComponent(str));
|
|
59336
59379
|
const len2 = encodedString.length;
|
|
@@ -59351,6 +59394,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59351
59394
|
if (utf8TextDecoder$1 && utf8TextDecoder$1.decode(new Uint8Array()).length === 1) {
|
|
59352
59395
|
utf8TextDecoder$1 = null;
|
|
59353
59396
|
}
|
|
59397
|
+
const repeat$1 = (source, n) => unfold(n, () => source).join("");
|
|
59354
59398
|
let Encoder$1 = class Encoder {
|
|
59355
59399
|
constructor() {
|
|
59356
59400
|
this.cpos = 0;
|
|
@@ -59364,7 +59408,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59364
59408
|
f2(encoder);
|
|
59365
59409
|
return toUint8Array$1(encoder);
|
|
59366
59410
|
};
|
|
59367
|
-
const length$
|
|
59411
|
+
const length$1 = (encoder) => {
|
|
59368
59412
|
let len2 = encoder.cpos;
|
|
59369
59413
|
for (let i2 = 0; i2 < encoder.bufs.length; i2++) {
|
|
59370
59414
|
len2 += encoder.bufs[i2].length;
|
|
@@ -59372,7 +59416,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59372
59416
|
return len2;
|
|
59373
59417
|
};
|
|
59374
59418
|
const toUint8Array$1 = (encoder) => {
|
|
59375
|
-
const uint8arr = new Uint8Array(length$
|
|
59419
|
+
const uint8arr = new Uint8Array(length$1(encoder));
|
|
59376
59420
|
let curPos = 0;
|
|
59377
59421
|
for (let i2 = 0; i2 < encoder.bufs.length; i2++) {
|
|
59378
59422
|
const d2 = encoder.bufs[i2];
|
|
@@ -59547,7 +59591,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59547
59591
|
}
|
|
59548
59592
|
return set;
|
|
59549
59593
|
};
|
|
59594
|
+
const EqualityTraitSymbol$1 = Symbol("Equality");
|
|
59595
|
+
const equals = (a2, b2) => a2 === b2 || a2[EqualityTraitSymbol$1]?.(b2) || false;
|
|
59596
|
+
const isObject$2 = (o) => typeof o === "object";
|
|
59550
59597
|
const keys$4 = Object.keys;
|
|
59598
|
+
const size$3 = (obj) => keys$4(obj).length;
|
|
59551
59599
|
const every = (obj, f2) => {
|
|
59552
59600
|
for (const key2 in obj) {
|
|
59553
59601
|
if (!f2(obj[key2], key2)) {
|
|
@@ -59556,6 +59604,81 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59556
59604
|
}
|
|
59557
59605
|
return true;
|
|
59558
59606
|
};
|
|
59607
|
+
const hasProperty$2 = (obj, key2) => Object.prototype.hasOwnProperty.call(obj, key2);
|
|
59608
|
+
const equalityDeep$1 = (a2, b2) => {
|
|
59609
|
+
if (a2 === b2) {
|
|
59610
|
+
return true;
|
|
59611
|
+
}
|
|
59612
|
+
if (a2 == null || b2 == null || a2.constructor !== b2.constructor && (a2.constructor || Object) !== (b2.constructor || Object)) {
|
|
59613
|
+
return false;
|
|
59614
|
+
}
|
|
59615
|
+
if (a2[EqualityTraitSymbol$1] != null) {
|
|
59616
|
+
return a2[EqualityTraitSymbol$1](b2);
|
|
59617
|
+
}
|
|
59618
|
+
switch (a2.constructor) {
|
|
59619
|
+
case ArrayBuffer:
|
|
59620
|
+
a2 = new Uint8Array(a2);
|
|
59621
|
+
b2 = new Uint8Array(b2);
|
|
59622
|
+
// eslint-disable-next-line no-fallthrough
|
|
59623
|
+
case Uint8Array: {
|
|
59624
|
+
if (a2.byteLength !== b2.byteLength) {
|
|
59625
|
+
return false;
|
|
59626
|
+
}
|
|
59627
|
+
for (let i2 = 0; i2 < a2.length; i2++) {
|
|
59628
|
+
if (a2[i2] !== b2[i2]) {
|
|
59629
|
+
return false;
|
|
59630
|
+
}
|
|
59631
|
+
}
|
|
59632
|
+
break;
|
|
59633
|
+
}
|
|
59634
|
+
case Set: {
|
|
59635
|
+
if (a2.size !== b2.size) {
|
|
59636
|
+
return false;
|
|
59637
|
+
}
|
|
59638
|
+
for (const value of a2) {
|
|
59639
|
+
if (!b2.has(value)) {
|
|
59640
|
+
return false;
|
|
59641
|
+
}
|
|
59642
|
+
}
|
|
59643
|
+
break;
|
|
59644
|
+
}
|
|
59645
|
+
case Map: {
|
|
59646
|
+
if (a2.size !== b2.size) {
|
|
59647
|
+
return false;
|
|
59648
|
+
}
|
|
59649
|
+
for (const key2 of a2.keys()) {
|
|
59650
|
+
if (!b2.has(key2) || !equalityDeep$1(a2.get(key2), b2.get(key2))) {
|
|
59651
|
+
return false;
|
|
59652
|
+
}
|
|
59653
|
+
}
|
|
59654
|
+
break;
|
|
59655
|
+
}
|
|
59656
|
+
case void 0:
|
|
59657
|
+
case Object:
|
|
59658
|
+
if (size$3(a2) !== size$3(b2)) {
|
|
59659
|
+
return false;
|
|
59660
|
+
}
|
|
59661
|
+
for (const key2 in a2) {
|
|
59662
|
+
if (!hasProperty$2(a2, key2) || !equalityDeep$1(a2[key2], b2[key2])) {
|
|
59663
|
+
return false;
|
|
59664
|
+
}
|
|
59665
|
+
}
|
|
59666
|
+
break;
|
|
59667
|
+
case Array:
|
|
59668
|
+
if (a2.length !== b2.length) {
|
|
59669
|
+
return false;
|
|
59670
|
+
}
|
|
59671
|
+
for (let i2 = 0; i2 < a2.length; i2++) {
|
|
59672
|
+
if (!equalityDeep$1(a2[i2], b2[i2])) {
|
|
59673
|
+
return false;
|
|
59674
|
+
}
|
|
59675
|
+
}
|
|
59676
|
+
break;
|
|
59677
|
+
default:
|
|
59678
|
+
return false;
|
|
59679
|
+
}
|
|
59680
|
+
return true;
|
|
59681
|
+
};
|
|
59559
59682
|
const isOneOf$1 = (value, options) => options.includes(value);
|
|
59560
59683
|
const createMutex = () => {
|
|
59561
59684
|
let token = true;
|
|
@@ -59596,7 +59719,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59596
59719
|
const yUndoPluginKey = new PluginKey("y-undo");
|
|
59597
59720
|
const yCursorPluginKey = new PluginKey("yjs-cursor");
|
|
59598
59721
|
const rand = Math.random;
|
|
59599
|
-
const oneOf = (arr) => arr[floor$2(rand() * arr.length)];
|
|
59722
|
+
const oneOf$1 = (arr) => arr[floor$2(rand() * arr.length)];
|
|
59600
59723
|
const undefinedToNull$1 = (v2) => v2 === void 0 ? null : v2;
|
|
59601
59724
|
let VarStoragePolyfill$1 = class VarStoragePolyfill {
|
|
59602
59725
|
constructor() {
|
|
@@ -59670,15 +59793,771 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59670
59793
|
const hasParam$1 = (name) => computeParams$1().has(name);
|
|
59671
59794
|
const getVariable$1 = (name) => isNode$1 ? undefinedToNull$1(process$1$1.env[name.toUpperCase().replaceAll("-", "_")]) : undefinedToNull$1(varStorage$1.getItem(name));
|
|
59672
59795
|
const hasConf$1 = (name) => hasParam$1("--" + name) || getVariable$1(name) !== null;
|
|
59673
|
-
hasConf$1("production");
|
|
59796
|
+
const production = hasConf$1("production");
|
|
59674
59797
|
const forceColor$1 = isNode$1 && isOneOf$1(process$1$1.env.FORCE_COLOR, ["true", "1", "2"]);
|
|
59675
59798
|
forceColor$1 || !hasParam$1("--no-colors") && // @todo deprecate --no-colors
|
|
59676
59799
|
!hasConf$1("no-color") && (!isNode$1 || process$1$1.stdout.isTTY) && (!isNode$1 || hasParam$1("--color") || getVariable$1("COLORTERM") !== null || (getVariable$1("TERM") || "").includes("color"));
|
|
59800
|
+
const toBase64Browser$1 = (bytes) => {
|
|
59801
|
+
let s2 = "";
|
|
59802
|
+
for (let i2 = 0; i2 < bytes.byteLength; i2++) {
|
|
59803
|
+
s2 += fromCharCode$1(bytes[i2]);
|
|
59804
|
+
}
|
|
59805
|
+
return btoa(s2);
|
|
59806
|
+
};
|
|
59807
|
+
const toBase64Node$1 = (bytes) => Buffer2.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString("base64");
|
|
59808
|
+
const toBase64$1 = isBrowser$1$2 ? toBase64Browser$1 : toBase64Node$1;
|
|
59809
|
+
const encodeAny = (data) => encode((encoder) => writeAny(encoder, data));
|
|
59810
|
+
const bool = (gen) => gen.next() >= 0.5;
|
|
59811
|
+
const int53 = (gen, min2, max2) => floor$2(gen.next() * (max2 + 1 - min2) + min2);
|
|
59812
|
+
const int32 = (gen, min2, max2) => floor$2(gen.next() * (max2 + 1 - min2) + min2);
|
|
59813
|
+
const int31 = (gen, min2, max2) => int32(gen, min2, max2);
|
|
59814
|
+
const letter = (gen) => fromCharCode$1(int31(gen, 97, 122));
|
|
59815
|
+
const word = (gen, minLen = 0, maxLen = 20) => {
|
|
59816
|
+
const len2 = int31(gen, minLen, maxLen);
|
|
59817
|
+
let str = "";
|
|
59818
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
59819
|
+
str += letter(gen);
|
|
59820
|
+
}
|
|
59821
|
+
return str;
|
|
59822
|
+
};
|
|
59823
|
+
const oneOf = (gen, array) => array[int31(gen, 0, array.length - 1)];
|
|
59824
|
+
const schemaSymbol = Symbol("0schema");
|
|
59825
|
+
class ValidationError {
|
|
59826
|
+
constructor() {
|
|
59827
|
+
this._rerrs = [];
|
|
59828
|
+
}
|
|
59829
|
+
/**
|
|
59830
|
+
* @param {string?} path
|
|
59831
|
+
* @param {string} expected
|
|
59832
|
+
* @param {string} has
|
|
59833
|
+
* @param {string?} message
|
|
59834
|
+
*/
|
|
59835
|
+
extend(path2, expected, has, message = null) {
|
|
59836
|
+
this._rerrs.push({ path: path2, expected, has, message });
|
|
59837
|
+
}
|
|
59838
|
+
toString() {
|
|
59839
|
+
const s2 = [];
|
|
59840
|
+
for (let i2 = this._rerrs.length - 1; i2 > 0; i2--) {
|
|
59841
|
+
const r2 = this._rerrs[i2];
|
|
59842
|
+
s2.push(repeat$1(" ", (this._rerrs.length - i2) * 2) + `${r2.path != null ? `[${r2.path}] ` : ""}${r2.has} doesn't match ${r2.expected}. ${r2.message}`);
|
|
59843
|
+
}
|
|
59844
|
+
return s2.join("\n");
|
|
59845
|
+
}
|
|
59846
|
+
}
|
|
59847
|
+
const shapeExtends = (a2, b2) => {
|
|
59848
|
+
if (a2 === b2) return true;
|
|
59849
|
+
if (a2 == null || b2 == null || a2.constructor !== b2.constructor) return false;
|
|
59850
|
+
if (a2[EqualityTraitSymbol$1]) return equals(a2, b2);
|
|
59851
|
+
if (isArray$2(a2)) {
|
|
59852
|
+
return every$1(
|
|
59853
|
+
a2,
|
|
59854
|
+
(aitem) => some(b2, (bitem) => shapeExtends(aitem, bitem))
|
|
59855
|
+
);
|
|
59856
|
+
} else if (isObject$2(a2)) {
|
|
59857
|
+
return every(
|
|
59858
|
+
a2,
|
|
59859
|
+
(aitem, akey) => shapeExtends(aitem, b2[akey])
|
|
59860
|
+
);
|
|
59861
|
+
}
|
|
59862
|
+
return false;
|
|
59863
|
+
};
|
|
59864
|
+
let Schema$1 = (_a = class {
|
|
59865
|
+
/**
|
|
59866
|
+
* @param {Schema<any>} other
|
|
59867
|
+
*/
|
|
59868
|
+
extends(other) {
|
|
59869
|
+
let [a2, b2] = [
|
|
59870
|
+
/** @type {any} */
|
|
59871
|
+
this.shape,
|
|
59872
|
+
/** @type {any} */
|
|
59873
|
+
other.shape
|
|
59874
|
+
];
|
|
59875
|
+
if (
|
|
59876
|
+
/** @type {typeof Schema<any>} */
|
|
59877
|
+
this.constructor._dilutes
|
|
59878
|
+
) [b2, a2] = [a2, b2];
|
|
59879
|
+
return shapeExtends(a2, b2);
|
|
59880
|
+
}
|
|
59881
|
+
/**
|
|
59882
|
+
* Overwrite this when necessary. By default, we only check the `shape` property which every shape
|
|
59883
|
+
* should have.
|
|
59884
|
+
* @param {Schema<any>} other
|
|
59885
|
+
*/
|
|
59886
|
+
equals(other) {
|
|
59887
|
+
return this.constructor === other.constructor && equalityDeep$1(this.shape, other.shape);
|
|
59888
|
+
}
|
|
59889
|
+
[schemaSymbol]() {
|
|
59890
|
+
return true;
|
|
59891
|
+
}
|
|
59892
|
+
/**
|
|
59893
|
+
* @param {object} other
|
|
59894
|
+
*/
|
|
59895
|
+
[EqualityTraitSymbol$1](other) {
|
|
59896
|
+
return this.equals(
|
|
59897
|
+
/** @type {any} */
|
|
59898
|
+
other
|
|
59899
|
+
);
|
|
59900
|
+
}
|
|
59901
|
+
/**
|
|
59902
|
+
* Use `schema.validate(obj)` with a typed parameter that is already of typed to be an instance of
|
|
59903
|
+
* Schema. Validate will check the structure of the parameter and return true iff the instance
|
|
59904
|
+
* really is an instance of Schema.
|
|
59905
|
+
*
|
|
59906
|
+
* @param {T} o
|
|
59907
|
+
* @return {boolean}
|
|
59908
|
+
*/
|
|
59909
|
+
validate(o) {
|
|
59910
|
+
return this.check(o);
|
|
59911
|
+
}
|
|
59912
|
+
/* c8 ignore start */
|
|
59913
|
+
/**
|
|
59914
|
+
* Similar to validate, but this method accepts untyped parameters.
|
|
59915
|
+
*
|
|
59916
|
+
* @param {any} _o
|
|
59917
|
+
* @param {ValidationError} [_err]
|
|
59918
|
+
* @return {_o is T}
|
|
59919
|
+
*/
|
|
59920
|
+
check(_o, _err) {
|
|
59921
|
+
methodUnimplemented();
|
|
59922
|
+
}
|
|
59923
|
+
/* c8 ignore stop */
|
|
59924
|
+
/**
|
|
59925
|
+
* @type {Schema<T?>}
|
|
59926
|
+
*/
|
|
59927
|
+
get nullable() {
|
|
59928
|
+
return $union(this, $null);
|
|
59929
|
+
}
|
|
59930
|
+
/**
|
|
59931
|
+
* @type {$Optional<Schema<T>>}
|
|
59932
|
+
*/
|
|
59933
|
+
get optional() {
|
|
59934
|
+
return new $Optional(
|
|
59935
|
+
/** @type {Schema<T>} */
|
|
59936
|
+
this
|
|
59937
|
+
);
|
|
59938
|
+
}
|
|
59939
|
+
/**
|
|
59940
|
+
* Cast a variable to a specific type. Returns the casted value, or throws an exception otherwise.
|
|
59941
|
+
* Use this if you know that the type is of a specific type and you just want to convince the type
|
|
59942
|
+
* system.
|
|
59943
|
+
*
|
|
59944
|
+
* **Do not rely on these error messages!**
|
|
59945
|
+
* Performs an assertion check only if not in a production environment.
|
|
59946
|
+
*
|
|
59947
|
+
* @template OO
|
|
59948
|
+
* @param {OO} o
|
|
59949
|
+
* @return {Extract<OO, T> extends never ? T : (OO extends Array<never> ? T : Extract<OO,T>)}
|
|
59950
|
+
*/
|
|
59951
|
+
cast(o) {
|
|
59952
|
+
assert(o, this);
|
|
59953
|
+
return (
|
|
59954
|
+
/** @type {any} */
|
|
59955
|
+
o
|
|
59956
|
+
);
|
|
59957
|
+
}
|
|
59958
|
+
/**
|
|
59959
|
+
* EXPECTO PATRONUM!! 🪄
|
|
59960
|
+
* This function protects against type errors. Though it may not work in the real world.
|
|
59961
|
+
*
|
|
59962
|
+
* "After all this time?"
|
|
59963
|
+
* "Always." - Snape, talking about type safety
|
|
59964
|
+
*
|
|
59965
|
+
* Ensures that a variable is a a specific type. Returns the value, or throws an exception if the assertion check failed.
|
|
59966
|
+
* Use this if you know that the type is of a specific type and you just want to convince the type
|
|
59967
|
+
* system.
|
|
59968
|
+
*
|
|
59969
|
+
* Can be useful when defining lambdas: `s.lambda(s.$number, s.$void).expect((n) => n + 1)`
|
|
59970
|
+
*
|
|
59971
|
+
* **Do not rely on these error messages!**
|
|
59972
|
+
* Performs an assertion check if not in a production environment.
|
|
59973
|
+
*
|
|
59974
|
+
* @param {T} o
|
|
59975
|
+
* @return {o extends T ? T : never}
|
|
59976
|
+
*/
|
|
59977
|
+
expect(o) {
|
|
59978
|
+
assert(o, this);
|
|
59979
|
+
return o;
|
|
59980
|
+
}
|
|
59981
|
+
}, // this.shape must not be defined on Schema. Otherwise typecheck on metatypes (e.g. $$object) won't work as expected anymore
|
|
59982
|
+
/**
|
|
59983
|
+
* If true, the more things are added to the shape the more objects this schema will accept (e.g.
|
|
59984
|
+
* union). By default, the more objects are added, the the fewer objects this schema will accept.
|
|
59985
|
+
* @protected
|
|
59986
|
+
*/
|
|
59987
|
+
__publicField$1(_a, "_dilutes", false), _a);
|
|
59988
|
+
class $ConstructedBy extends Schema$1 {
|
|
59989
|
+
/**
|
|
59990
|
+
* @param {C} c
|
|
59991
|
+
* @param {((o:Instance<C>)=>boolean)|null} check
|
|
59992
|
+
*/
|
|
59993
|
+
constructor(c2, check) {
|
|
59994
|
+
super();
|
|
59995
|
+
this.shape = c2;
|
|
59996
|
+
this._c = check;
|
|
59997
|
+
}
|
|
59998
|
+
/**
|
|
59999
|
+
* @param {any} o
|
|
60000
|
+
* @param {ValidationError} [err]
|
|
60001
|
+
* @return {o is C extends ((...args:any[]) => infer T) ? T : (C extends (new (...args:any[]) => any) ? InstanceType<C> : never)} o
|
|
60002
|
+
*/
|
|
60003
|
+
check(o, err = void 0) {
|
|
60004
|
+
const c2 = o?.constructor === this.shape && (this._c == null || this._c(o));
|
|
60005
|
+
!c2 && err?.extend(null, this.shape.name, o?.constructor.name, o?.constructor !== this.shape ? "Constructor match failed" : "Check failed");
|
|
60006
|
+
return c2;
|
|
60007
|
+
}
|
|
60008
|
+
}
|
|
60009
|
+
const $constructedBy = (c2, check = null) => new $ConstructedBy(c2, check);
|
|
60010
|
+
$constructedBy($ConstructedBy);
|
|
60011
|
+
class $Custom extends Schema$1 {
|
|
60012
|
+
/**
|
|
60013
|
+
* @param {(o:any) => boolean} check
|
|
60014
|
+
*/
|
|
60015
|
+
constructor(check) {
|
|
60016
|
+
super();
|
|
60017
|
+
this.shape = check;
|
|
60018
|
+
}
|
|
60019
|
+
/**
|
|
60020
|
+
* @param {any} o
|
|
60021
|
+
* @param {ValidationError} err
|
|
60022
|
+
* @return {o is any}
|
|
60023
|
+
*/
|
|
60024
|
+
check(o, err) {
|
|
60025
|
+
const c2 = this.shape(o);
|
|
60026
|
+
!c2 && err?.extend(null, "custom prop", o?.constructor.name, "failed to check custom prop");
|
|
60027
|
+
return c2;
|
|
60028
|
+
}
|
|
60029
|
+
}
|
|
60030
|
+
const $custom = (check) => new $Custom(check);
|
|
60031
|
+
$constructedBy($Custom);
|
|
60032
|
+
class $Literal extends Schema$1 {
|
|
60033
|
+
/**
|
|
60034
|
+
* @param {Array<T>} literals
|
|
60035
|
+
*/
|
|
60036
|
+
constructor(literals) {
|
|
60037
|
+
super();
|
|
60038
|
+
this.shape = literals;
|
|
60039
|
+
}
|
|
60040
|
+
/**
|
|
60041
|
+
*
|
|
60042
|
+
* @param {any} o
|
|
60043
|
+
* @param {ValidationError} [err]
|
|
60044
|
+
* @return {o is T}
|
|
60045
|
+
*/
|
|
60046
|
+
check(o, err) {
|
|
60047
|
+
const c2 = this.shape.some((a2) => a2 === o);
|
|
60048
|
+
!c2 && err?.extend(null, this.shape.join(" | "), o.toString());
|
|
60049
|
+
return c2;
|
|
60050
|
+
}
|
|
60051
|
+
}
|
|
60052
|
+
const $literal = (...literals) => new $Literal(literals);
|
|
60053
|
+
const $$literal = $constructedBy($Literal);
|
|
60054
|
+
const _regexEscape = (
|
|
60055
|
+
/** @type {any} */
|
|
60056
|
+
RegExp.escape || /** @type {(str:string) => string} */
|
|
60057
|
+
((str) => str.replace(/[().|&,$^[\]]/g, (s2) => "\\" + s2))
|
|
60058
|
+
);
|
|
60059
|
+
const _schemaStringTemplateToRegex = (s2) => {
|
|
60060
|
+
if ($string.check(s2)) {
|
|
60061
|
+
return [_regexEscape(s2)];
|
|
60062
|
+
}
|
|
60063
|
+
if ($$literal.check(s2)) {
|
|
60064
|
+
return (
|
|
60065
|
+
/** @type {Array<string|number>} */
|
|
60066
|
+
s2.shape.map((v2) => v2 + "")
|
|
60067
|
+
);
|
|
60068
|
+
}
|
|
60069
|
+
if ($$number.check(s2)) {
|
|
60070
|
+
return ["[+-]?\\d+.?\\d*"];
|
|
60071
|
+
}
|
|
60072
|
+
if ($$string.check(s2)) {
|
|
60073
|
+
return [".*"];
|
|
60074
|
+
}
|
|
60075
|
+
if ($$union.check(s2)) {
|
|
60076
|
+
return s2.shape.map(_schemaStringTemplateToRegex).flat(1);
|
|
60077
|
+
}
|
|
60078
|
+
unexpectedCase();
|
|
60079
|
+
};
|
|
60080
|
+
class $StringTemplate extends Schema$1 {
|
|
60081
|
+
/**
|
|
60082
|
+
* @param {T} shape
|
|
60083
|
+
*/
|
|
60084
|
+
constructor(shape) {
|
|
60085
|
+
super();
|
|
60086
|
+
this.shape = shape;
|
|
60087
|
+
this._r = new RegExp("^" + shape.map(_schemaStringTemplateToRegex).map((opts) => `(${opts.join("|")})`).join("") + "$");
|
|
60088
|
+
}
|
|
60089
|
+
/**
|
|
60090
|
+
* @param {any} o
|
|
60091
|
+
* @param {ValidationError} [err]
|
|
60092
|
+
* @return {o is CastStringTemplateArgsToTemplate<T>}
|
|
60093
|
+
*/
|
|
60094
|
+
check(o, err) {
|
|
60095
|
+
const c2 = this._r.exec(o) != null;
|
|
60096
|
+
!c2 && err?.extend(null, this._r.toString(), o.toString(), "String doesn't match string template.");
|
|
60097
|
+
return c2;
|
|
60098
|
+
}
|
|
60099
|
+
}
|
|
60100
|
+
$constructedBy($StringTemplate);
|
|
60101
|
+
const isOptionalSymbol = Symbol("optional");
|
|
60102
|
+
class $Optional extends Schema$1 {
|
|
60103
|
+
/**
|
|
60104
|
+
* @param {S} shape
|
|
60105
|
+
*/
|
|
60106
|
+
constructor(shape) {
|
|
60107
|
+
super();
|
|
60108
|
+
this.shape = shape;
|
|
60109
|
+
}
|
|
60110
|
+
/**
|
|
60111
|
+
* @param {any} o
|
|
60112
|
+
* @param {ValidationError} [err]
|
|
60113
|
+
* @return {o is (Unwrap<S>|undefined)}
|
|
60114
|
+
*/
|
|
60115
|
+
check(o, err) {
|
|
60116
|
+
const c2 = o === void 0 || this.shape.check(o);
|
|
60117
|
+
!c2 && err?.extend(null, "undefined (optional)", "()");
|
|
60118
|
+
return c2;
|
|
60119
|
+
}
|
|
60120
|
+
get [isOptionalSymbol]() {
|
|
60121
|
+
return true;
|
|
60122
|
+
}
|
|
60123
|
+
}
|
|
60124
|
+
const $$optional = $constructedBy($Optional);
|
|
60125
|
+
class $Never extends Schema$1 {
|
|
60126
|
+
/**
|
|
60127
|
+
* @param {any} _o
|
|
60128
|
+
* @param {ValidationError} [err]
|
|
60129
|
+
* @return {_o is never}
|
|
60130
|
+
*/
|
|
60131
|
+
check(_o, err) {
|
|
60132
|
+
err?.extend(null, "never", typeof _o);
|
|
60133
|
+
return false;
|
|
60134
|
+
}
|
|
60135
|
+
}
|
|
60136
|
+
$constructedBy($Never);
|
|
60137
|
+
const _$Object = class _$Object2 extends Schema$1 {
|
|
60138
|
+
/**
|
|
60139
|
+
* @param {S} shape
|
|
60140
|
+
* @param {boolean} partial
|
|
60141
|
+
*/
|
|
60142
|
+
constructor(shape, partial = false) {
|
|
60143
|
+
super();
|
|
60144
|
+
this.shape = shape;
|
|
60145
|
+
this._isPartial = partial;
|
|
60146
|
+
}
|
|
60147
|
+
/**
|
|
60148
|
+
* @type {Schema<Partial<$ObjectToType<S>>>}
|
|
60149
|
+
*/
|
|
60150
|
+
get partial() {
|
|
60151
|
+
return new _$Object2(this.shape, true);
|
|
60152
|
+
}
|
|
60153
|
+
/**
|
|
60154
|
+
* @param {any} o
|
|
60155
|
+
* @param {ValidationError} err
|
|
60156
|
+
* @return {o is $ObjectToType<S>}
|
|
60157
|
+
*/
|
|
60158
|
+
check(o, err) {
|
|
60159
|
+
if (o == null) {
|
|
60160
|
+
err?.extend(null, "object", "null");
|
|
60161
|
+
return false;
|
|
60162
|
+
}
|
|
60163
|
+
return every(this.shape, (vv, vk) => {
|
|
60164
|
+
const c2 = this._isPartial && !hasProperty$2(o, vk) || vv.check(o[vk], err);
|
|
60165
|
+
!c2 && err?.extend(vk.toString(), vv.toString(), typeof o[vk], "Object property does not match");
|
|
60166
|
+
return c2;
|
|
60167
|
+
});
|
|
60168
|
+
}
|
|
60169
|
+
};
|
|
60170
|
+
__publicField$1(_$Object, "_dilutes", true);
|
|
60171
|
+
let $Object = _$Object;
|
|
60172
|
+
const $object = (def2) => (
|
|
60173
|
+
/** @type {any} */
|
|
60174
|
+
new $Object(def2)
|
|
60175
|
+
);
|
|
60176
|
+
const $$object = $constructedBy($Object);
|
|
60177
|
+
const $objectAny = $custom((o) => o != null && (o.constructor === Object || o.constructor == null));
|
|
60178
|
+
class $Record extends Schema$1 {
|
|
60179
|
+
/**
|
|
60180
|
+
* @param {Keys} keys
|
|
60181
|
+
* @param {Values} values
|
|
60182
|
+
*/
|
|
60183
|
+
constructor(keys2, values) {
|
|
60184
|
+
super();
|
|
60185
|
+
this.shape = {
|
|
60186
|
+
keys: keys2,
|
|
60187
|
+
values
|
|
60188
|
+
};
|
|
60189
|
+
}
|
|
60190
|
+
/**
|
|
60191
|
+
* @param {any} o
|
|
60192
|
+
* @param {ValidationError} err
|
|
60193
|
+
* @return {o is { [key in Unwrap<Keys>]: Unwrap<Values> }}
|
|
60194
|
+
*/
|
|
60195
|
+
check(o, err) {
|
|
60196
|
+
return o != null && every(o, (vv, vk) => {
|
|
60197
|
+
const ck = this.shape.keys.check(vk, err);
|
|
60198
|
+
!ck && err?.extend(vk + "", "Record", typeof o, ck ? "Key doesn't match schema" : "Value doesn't match value");
|
|
60199
|
+
return ck && this.shape.values.check(vv, err);
|
|
60200
|
+
});
|
|
60201
|
+
}
|
|
60202
|
+
}
|
|
60203
|
+
const $record = (keys2, values) => new $Record(keys2, values);
|
|
60204
|
+
const $$record = $constructedBy($Record);
|
|
60205
|
+
class $Tuple extends Schema$1 {
|
|
60206
|
+
/**
|
|
60207
|
+
* @param {S} shape
|
|
60208
|
+
*/
|
|
60209
|
+
constructor(shape) {
|
|
60210
|
+
super();
|
|
60211
|
+
this.shape = shape;
|
|
60212
|
+
}
|
|
60213
|
+
/**
|
|
60214
|
+
* @param {any} o
|
|
60215
|
+
* @param {ValidationError} err
|
|
60216
|
+
* @return {o is { [K in keyof S]: S[K] extends Schema<infer Type> ? Type : never }}
|
|
60217
|
+
*/
|
|
60218
|
+
check(o, err) {
|
|
60219
|
+
return o != null && every(this.shape, (vv, vk) => {
|
|
60220
|
+
const c2 = (
|
|
60221
|
+
/** @type {Schema<any>} */
|
|
60222
|
+
vv.check(o[vk], err)
|
|
60223
|
+
);
|
|
60224
|
+
!c2 && err?.extend(vk.toString(), "Tuple", typeof vv);
|
|
60225
|
+
return c2;
|
|
60226
|
+
});
|
|
60227
|
+
}
|
|
60228
|
+
}
|
|
60229
|
+
const $tuple = (...def2) => new $Tuple(def2);
|
|
60230
|
+
$constructedBy($Tuple);
|
|
60231
|
+
class $Array extends Schema$1 {
|
|
60232
|
+
/**
|
|
60233
|
+
* @param {Array<S>} v
|
|
60234
|
+
*/
|
|
60235
|
+
constructor(v2) {
|
|
60236
|
+
super();
|
|
60237
|
+
this.shape = v2.length === 1 ? v2[0] : new $Union(v2);
|
|
60238
|
+
}
|
|
60239
|
+
/**
|
|
60240
|
+
* @param {any} o
|
|
60241
|
+
* @param {ValidationError} [err]
|
|
60242
|
+
* @return {o is Array<S extends Schema<infer T> ? T : never>} o
|
|
60243
|
+
*/
|
|
60244
|
+
check(o, err) {
|
|
60245
|
+
const c2 = isArray$2(o) && every$1(o, (oi) => this.shape.check(oi));
|
|
60246
|
+
!c2 && err?.extend(null, "Array", "");
|
|
60247
|
+
return c2;
|
|
60248
|
+
}
|
|
60249
|
+
}
|
|
60250
|
+
const $array = (...def2) => new $Array(def2);
|
|
60251
|
+
const $$array = $constructedBy($Array);
|
|
60252
|
+
const $arrayAny = $custom((o) => isArray$2(o));
|
|
60253
|
+
class $InstanceOf extends Schema$1 {
|
|
60254
|
+
/**
|
|
60255
|
+
* @param {new (...args:any) => T} constructor
|
|
60256
|
+
* @param {((o:T) => boolean)|null} check
|
|
60257
|
+
*/
|
|
60258
|
+
constructor(constructor, check) {
|
|
60259
|
+
super();
|
|
60260
|
+
this.shape = constructor;
|
|
60261
|
+
this._c = check;
|
|
60262
|
+
}
|
|
60263
|
+
/**
|
|
60264
|
+
* @param {any} o
|
|
60265
|
+
* @param {ValidationError} err
|
|
60266
|
+
* @return {o is T}
|
|
60267
|
+
*/
|
|
60268
|
+
check(o, err) {
|
|
60269
|
+
const c2 = o instanceof this.shape && (this._c == null || this._c(o));
|
|
60270
|
+
!c2 && err?.extend(null, this.shape.name, o?.constructor.name);
|
|
60271
|
+
return c2;
|
|
60272
|
+
}
|
|
60273
|
+
}
|
|
60274
|
+
const $instanceOf = (c2, check = null) => new $InstanceOf(c2, check);
|
|
60275
|
+
$constructedBy($InstanceOf);
|
|
60276
|
+
const $$schema = $instanceOf(Schema$1);
|
|
60277
|
+
class $Lambda extends Schema$1 {
|
|
60278
|
+
/**
|
|
60279
|
+
* @param {Args} args
|
|
60280
|
+
*/
|
|
60281
|
+
constructor(args) {
|
|
60282
|
+
super();
|
|
60283
|
+
this.len = args.length - 1;
|
|
60284
|
+
this.args = $tuple(...args.slice(-1));
|
|
60285
|
+
this.res = args[this.len];
|
|
60286
|
+
}
|
|
60287
|
+
/**
|
|
60288
|
+
* @param {any} f
|
|
60289
|
+
* @param {ValidationError} err
|
|
60290
|
+
* @return {f is _LArgsToLambdaDef<Args>}
|
|
60291
|
+
*/
|
|
60292
|
+
check(f2, err) {
|
|
60293
|
+
const c2 = f2.constructor === Function && f2.length <= this.len;
|
|
60294
|
+
!c2 && err?.extend(null, "function", typeof f2);
|
|
60295
|
+
return c2;
|
|
60296
|
+
}
|
|
60297
|
+
}
|
|
60298
|
+
const $$lambda = $constructedBy($Lambda);
|
|
60299
|
+
const $function = $custom((o) => typeof o === "function");
|
|
60300
|
+
class $Intersection extends Schema$1 {
|
|
60301
|
+
/**
|
|
60302
|
+
* @param {T} v
|
|
60303
|
+
*/
|
|
60304
|
+
constructor(v2) {
|
|
60305
|
+
super();
|
|
60306
|
+
this.shape = v2;
|
|
60307
|
+
}
|
|
60308
|
+
/**
|
|
60309
|
+
* @param {any} o
|
|
60310
|
+
* @param {ValidationError} [err]
|
|
60311
|
+
* @return {o is Intersect<UnwrapArray<T>>}
|
|
60312
|
+
*/
|
|
60313
|
+
check(o, err) {
|
|
60314
|
+
const c2 = every$1(this.shape, (check) => check.check(o, err));
|
|
60315
|
+
!c2 && err?.extend(null, "Intersectinon", typeof o);
|
|
60316
|
+
return c2;
|
|
60317
|
+
}
|
|
60318
|
+
}
|
|
60319
|
+
$constructedBy($Intersection, (o) => o.shape.length > 0);
|
|
60320
|
+
class $Union extends Schema$1 {
|
|
60321
|
+
/**
|
|
60322
|
+
* @param {Array<Schema<S>>} v
|
|
60323
|
+
*/
|
|
60324
|
+
constructor(v2) {
|
|
60325
|
+
super();
|
|
60326
|
+
this.shape = v2;
|
|
60327
|
+
}
|
|
60328
|
+
/**
|
|
60329
|
+
* @param {any} o
|
|
60330
|
+
* @param {ValidationError} [err]
|
|
60331
|
+
* @return {o is S}
|
|
60332
|
+
*/
|
|
60333
|
+
check(o, err) {
|
|
60334
|
+
const c2 = some(this.shape, (vv) => vv.check(o, err));
|
|
60335
|
+
err?.extend(null, "Union", typeof o);
|
|
60336
|
+
return c2;
|
|
60337
|
+
}
|
|
60338
|
+
}
|
|
60339
|
+
__publicField$1($Union, "_dilutes", true);
|
|
60340
|
+
const $union = (...schemas) => schemas.findIndex(($s) => $$union.check($s)) >= 0 ? $union(...schemas.map(($s) => $$1($s)).map(($s) => $$union.check($s) ? $s.shape : [$s]).flat(1)) : schemas.length === 1 ? schemas[0] : new $Union(schemas);
|
|
60341
|
+
const $$union = (
|
|
60342
|
+
/** @type {Schema<$Union<any>>} */
|
|
60343
|
+
$constructedBy($Union)
|
|
60344
|
+
);
|
|
60345
|
+
const _t = () => true;
|
|
60346
|
+
const $any = $custom(_t);
|
|
60347
|
+
const $$any = (
|
|
60348
|
+
/** @type {Schema<Schema<any>>} */
|
|
60349
|
+
$constructedBy($Custom, (o) => o.shape === _t)
|
|
60350
|
+
);
|
|
60351
|
+
const $bigint = $custom((o) => typeof o === "bigint");
|
|
60352
|
+
const $$bigint = (
|
|
60353
|
+
/** @type {Schema<Schema<BigInt>>} */
|
|
60354
|
+
$custom((o) => o === $bigint)
|
|
60355
|
+
);
|
|
60356
|
+
const $symbol = $custom((o) => typeof o === "symbol");
|
|
60357
|
+
$custom((o) => o === $symbol);
|
|
60358
|
+
const $number = $custom((o) => typeof o === "number");
|
|
60359
|
+
const $$number = (
|
|
60360
|
+
/** @type {Schema<Schema<number>>} */
|
|
60361
|
+
$custom((o) => o === $number)
|
|
60362
|
+
);
|
|
60363
|
+
const $string = $custom((o) => typeof o === "string");
|
|
60364
|
+
const $$string = (
|
|
60365
|
+
/** @type {Schema<Schema<string>>} */
|
|
60366
|
+
$custom((o) => o === $string)
|
|
60367
|
+
);
|
|
60368
|
+
const $boolean = $custom((o) => typeof o === "boolean");
|
|
60369
|
+
const $$boolean = (
|
|
60370
|
+
/** @type {Schema<Schema<Boolean>>} */
|
|
60371
|
+
$custom((o) => o === $boolean)
|
|
60372
|
+
);
|
|
60373
|
+
const $undefined = $literal(void 0);
|
|
60374
|
+
$constructedBy($Literal, (o) => o.shape.length === 1 && o.shape[0] === void 0);
|
|
60375
|
+
$literal(void 0);
|
|
60376
|
+
const $null = $literal(null);
|
|
60377
|
+
const $$null = (
|
|
60378
|
+
/** @type {Schema<Schema<null>>} */
|
|
60379
|
+
$constructedBy($Literal, (o) => o.shape.length === 1 && o.shape[0] === null)
|
|
60380
|
+
);
|
|
60381
|
+
$constructedBy(Uint8Array);
|
|
60382
|
+
$constructedBy($ConstructedBy, (o) => o.shape === Uint8Array);
|
|
60383
|
+
const $primitive = $union($number, $string, $null, $undefined, $bigint, $boolean, $symbol);
|
|
60384
|
+
(() => {
|
|
60385
|
+
const $jsonArr = (
|
|
60386
|
+
/** @type {$Array<$any>} */
|
|
60387
|
+
$array($any)
|
|
60388
|
+
);
|
|
60389
|
+
const $jsonRecord = (
|
|
60390
|
+
/** @type {$Record<$string,$any>} */
|
|
60391
|
+
$record($string, $any)
|
|
60392
|
+
);
|
|
60393
|
+
const $json = $union($number, $string, $null, $boolean, $jsonArr, $jsonRecord);
|
|
60394
|
+
$jsonArr.shape = $json;
|
|
60395
|
+
$jsonRecord.shape.values = $json;
|
|
60396
|
+
return $json;
|
|
60397
|
+
})();
|
|
60398
|
+
const $$1 = (o) => {
|
|
60399
|
+
if ($$schema.check(o)) {
|
|
60400
|
+
return (
|
|
60401
|
+
/** @type {any} */
|
|
60402
|
+
o
|
|
60403
|
+
);
|
|
60404
|
+
} else if ($objectAny.check(o)) {
|
|
60405
|
+
const o2 = {};
|
|
60406
|
+
for (const k2 in o) {
|
|
60407
|
+
o2[k2] = $$1(o[k2]);
|
|
60408
|
+
}
|
|
60409
|
+
return (
|
|
60410
|
+
/** @type {any} */
|
|
60411
|
+
$object(o2)
|
|
60412
|
+
);
|
|
60413
|
+
} else if ($arrayAny.check(o)) {
|
|
60414
|
+
return (
|
|
60415
|
+
/** @type {any} */
|
|
60416
|
+
$union(...o.map($$1))
|
|
60417
|
+
);
|
|
60418
|
+
} else if ($primitive.check(o)) {
|
|
60419
|
+
return (
|
|
60420
|
+
/** @type {any} */
|
|
60421
|
+
$literal(o)
|
|
60422
|
+
);
|
|
60423
|
+
} else if ($function.check(o)) {
|
|
60424
|
+
return (
|
|
60425
|
+
/** @type {any} */
|
|
60426
|
+
$constructedBy(
|
|
60427
|
+
/** @type {any} */
|
|
60428
|
+
o
|
|
60429
|
+
)
|
|
60430
|
+
);
|
|
60431
|
+
}
|
|
60432
|
+
unexpectedCase();
|
|
60433
|
+
};
|
|
60434
|
+
const assert = production ? () => {
|
|
60435
|
+
} : (o, schema) => {
|
|
60436
|
+
const err = new ValidationError();
|
|
60437
|
+
if (!schema.check(o, err)) {
|
|
60438
|
+
throw create$1$1(`Expected value to be of type ${schema.constructor.name}.
|
|
60439
|
+
${err.toString()}`);
|
|
60440
|
+
}
|
|
60441
|
+
};
|
|
60442
|
+
class PatternMatcher {
|
|
60443
|
+
/**
|
|
60444
|
+
* @param {Schema<State>} [$state]
|
|
60445
|
+
*/
|
|
60446
|
+
constructor($state) {
|
|
60447
|
+
this.patterns = [];
|
|
60448
|
+
this.$state = $state;
|
|
60449
|
+
}
|
|
60450
|
+
/**
|
|
60451
|
+
* @template P
|
|
60452
|
+
* @template R
|
|
60453
|
+
* @param {P} pattern
|
|
60454
|
+
* @param {(o:NoInfer<Unwrap<ReadSchema<P>>>,s:State)=>R} handler
|
|
60455
|
+
* @return {PatternMatcher<State,Patterns|Pattern<Unwrap<ReadSchema<P>>,R>>}
|
|
60456
|
+
*/
|
|
60457
|
+
if(pattern, handler2) {
|
|
60458
|
+
this.patterns.push({ if: $$1(pattern), h: handler2 });
|
|
60459
|
+
return this;
|
|
60460
|
+
}
|
|
60461
|
+
/**
|
|
60462
|
+
* @template R
|
|
60463
|
+
* @param {(o:any,s:State)=>R} h
|
|
60464
|
+
*/
|
|
60465
|
+
else(h2) {
|
|
60466
|
+
return this.if($any, h2);
|
|
60467
|
+
}
|
|
60468
|
+
/**
|
|
60469
|
+
* @return {State extends undefined
|
|
60470
|
+
* ? <In extends Unwrap<Patterns['if']>>(o:In,state?:undefined)=>PatternMatchResult<Patterns,In>
|
|
60471
|
+
* : <In extends Unwrap<Patterns['if']>>(o:In,state:State)=>PatternMatchResult<Patterns,In>}
|
|
60472
|
+
*/
|
|
60473
|
+
done() {
|
|
60474
|
+
return (
|
|
60475
|
+
/** @type {any} */
|
|
60476
|
+
((o, s2) => {
|
|
60477
|
+
for (let i2 = 0; i2 < this.patterns.length; i2++) {
|
|
60478
|
+
const p2 = this.patterns[i2];
|
|
60479
|
+
if (p2.if.check(o)) {
|
|
60480
|
+
return p2.h(o, s2);
|
|
60481
|
+
}
|
|
60482
|
+
}
|
|
60483
|
+
throw create$1$1("Unhandled pattern");
|
|
60484
|
+
})
|
|
60485
|
+
);
|
|
60486
|
+
}
|
|
60487
|
+
}
|
|
60488
|
+
const match = (state2) => new PatternMatcher(
|
|
60489
|
+
/** @type {any} */
|
|
60490
|
+
state2
|
|
60491
|
+
);
|
|
60492
|
+
const _random = (
|
|
60493
|
+
/** @type {any} */
|
|
60494
|
+
match(
|
|
60495
|
+
/** @type {Schema<prng.PRNG>} */
|
|
60496
|
+
$any
|
|
60497
|
+
).if($$number, (_o, gen) => int53(gen, MIN_SAFE_INTEGER, MAX_SAFE_INTEGER$4)).if($$string, (_o, gen) => word(gen)).if($$boolean, (_o, gen) => bool(gen)).if($$bigint, (_o, gen) => BigInt(int53(gen, MIN_SAFE_INTEGER, MAX_SAFE_INTEGER$4))).if($$union, (o, gen) => random(gen, oneOf(gen, o.shape))).if($$object, (o, gen) => {
|
|
60498
|
+
const res = {};
|
|
60499
|
+
for (const k2 in o.shape) {
|
|
60500
|
+
let prop = o.shape[k2];
|
|
60501
|
+
if ($$optional.check(prop)) {
|
|
60502
|
+
if (bool(gen)) {
|
|
60503
|
+
continue;
|
|
60504
|
+
}
|
|
60505
|
+
prop = prop.shape;
|
|
60506
|
+
}
|
|
60507
|
+
res[k2] = _random(prop, gen);
|
|
60508
|
+
}
|
|
60509
|
+
return res;
|
|
60510
|
+
}).if($$array, (o, gen) => {
|
|
60511
|
+
const arr = [];
|
|
60512
|
+
const n = int32(gen, 0, 42);
|
|
60513
|
+
for (let i2 = 0; i2 < n; i2++) {
|
|
60514
|
+
arr.push(random(gen, o.shape));
|
|
60515
|
+
}
|
|
60516
|
+
return arr;
|
|
60517
|
+
}).if($$literal, (o, gen) => {
|
|
60518
|
+
return oneOf(gen, o.shape);
|
|
60519
|
+
}).if($$null, (o, gen) => {
|
|
60520
|
+
return null;
|
|
60521
|
+
}).if($$lambda, (o, gen) => {
|
|
60522
|
+
const res = random(gen, o.res);
|
|
60523
|
+
return () => res;
|
|
60524
|
+
}).if($$any, (o, gen) => random(gen, oneOf(gen, [
|
|
60525
|
+
$number,
|
|
60526
|
+
$string,
|
|
60527
|
+
$null,
|
|
60528
|
+
$undefined,
|
|
60529
|
+
$bigint,
|
|
60530
|
+
$boolean,
|
|
60531
|
+
$array($number),
|
|
60532
|
+
$record($union("a", "b", "c"), $number)
|
|
60533
|
+
]))).if($$record, (o, gen) => {
|
|
60534
|
+
const res = {};
|
|
60535
|
+
const keysN = int53(gen, 0, 3);
|
|
60536
|
+
for (let i2 = 0; i2 < keysN; i2++) {
|
|
60537
|
+
const key2 = random(gen, o.shape.keys);
|
|
60538
|
+
const val = random(gen, o.shape.values);
|
|
60539
|
+
res[key2] = val;
|
|
60540
|
+
}
|
|
60541
|
+
return res;
|
|
60542
|
+
}).done()
|
|
60543
|
+
);
|
|
60544
|
+
const random = (gen, schema) => (
|
|
60545
|
+
/** @type {any} */
|
|
60546
|
+
_random($$1(schema), gen)
|
|
60547
|
+
);
|
|
59677
60548
|
const doc = (
|
|
59678
60549
|
/** @type {Document} */
|
|
59679
60550
|
typeof document !== "undefined" ? document : {}
|
|
59680
60551
|
);
|
|
60552
|
+
$custom((el) => el.nodeType === DOCUMENT_FRAGMENT_NODE);
|
|
59681
60553
|
typeof DOMParser !== "undefined" ? new DOMParser() : null;
|
|
60554
|
+
$custom((el) => el.nodeType === ELEMENT_NODE);
|
|
60555
|
+
$custom((el) => el.nodeType === TEXT_NODE);
|
|
60556
|
+
const ELEMENT_NODE = doc.ELEMENT_NODE;
|
|
60557
|
+
const TEXT_NODE = doc.TEXT_NODE;
|
|
60558
|
+
const DOCUMENT_NODE = doc.DOCUMENT_NODE;
|
|
60559
|
+
const DOCUMENT_FRAGMENT_NODE = doc.DOCUMENT_FRAGMENT_NODE;
|
|
60560
|
+
$custom((el) => el.nodeType === DOCUMENT_NODE);
|
|
59682
60561
|
const createTimeoutClass = (clearFunction) => class TT {
|
|
59683
60562
|
/**
|
|
59684
60563
|
* @param {number} timeoutId
|
|
@@ -59861,16 +60740,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59861
60740
|
}
|
|
59862
60741
|
}
|
|
59863
60742
|
const digest = (data) => new Hasher().digest(data);
|
|
59864
|
-
const toBase64Browser$1 = (bytes) => {
|
|
59865
|
-
let s2 = "";
|
|
59866
|
-
for (let i2 = 0; i2 < bytes.byteLength; i2++) {
|
|
59867
|
-
s2 += fromCharCode$1(bytes[i2]);
|
|
59868
|
-
}
|
|
59869
|
-
return btoa(s2);
|
|
59870
|
-
};
|
|
59871
|
-
const toBase64Node$1 = (bytes) => Buffer2.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString("base64");
|
|
59872
|
-
const toBase64$1 = isBrowser$1$2 ? toBase64Browser$1 : toBase64Node$1;
|
|
59873
|
-
const encodeAny = (data) => encode((encoder) => writeAny(encoder, data));
|
|
59874
60743
|
const _convolute = (digest2) => {
|
|
59875
60744
|
const N2 = 6;
|
|
59876
60745
|
for (let i2 = N2; i2 < digest2.length; i2++) {
|
|
@@ -59893,7 +60762,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
59893
60762
|
colorMapping.forEach((color2) => usedColors.add(color2));
|
|
59894
60763
|
colors2 = colors2.filter((color2) => !usedColors.has(color2));
|
|
59895
60764
|
}
|
|
59896
|
-
colorMapping.set(user, oneOf(colors2));
|
|
60765
|
+
colorMapping.set(user, oneOf$1(colors2));
|
|
59897
60766
|
}
|
|
59898
60767
|
return (
|
|
59899
60768
|
/** @type {ColorDef} */
|
|
@@ -61781,7 +62650,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
61781
62650
|
return Object.fromEntries(markEntries);
|
|
61782
62651
|
};
|
|
61783
62652
|
__privateAdd$1(_Schema, _Schema_static);
|
|
61784
|
-
let Schema$
|
|
62653
|
+
let Schema$2 = _Schema;
|
|
61785
62654
|
class OxmlNode extends Node$1 {
|
|
61786
62655
|
constructor(config2) {
|
|
61787
62656
|
super(config2);
|
|
@@ -62174,9 +63043,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
62174
63043
|
dispatch(state2.tr.insertText("\n").scrollIntoView());
|
|
62175
63044
|
return true;
|
|
62176
63045
|
};
|
|
62177
|
-
function defaultBlockAt(
|
|
62178
|
-
for (let i2 = 0; i2 <
|
|
62179
|
-
let { type: type2 } =
|
|
63046
|
+
function defaultBlockAt(match2) {
|
|
63047
|
+
for (let i2 = 0; i2 < match2.edgeCount; i2++) {
|
|
63048
|
+
let { type: type2 } = match2.edge(i2);
|
|
62180
63049
|
if (type2.isTextblock && !type2.hasRequiredAttrs())
|
|
62181
63050
|
return type2;
|
|
62182
63051
|
}
|
|
@@ -62303,12 +63172,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
62303
63172
|
return true;
|
|
62304
63173
|
}
|
|
62305
63174
|
function deleteBarrier(state2, $cut, dispatch, dir) {
|
|
62306
|
-
let before = $cut.nodeBefore, after = $cut.nodeAfter, conn,
|
|
63175
|
+
let before = $cut.nodeBefore, after = $cut.nodeAfter, conn, match2;
|
|
62307
63176
|
let isolated = before.type.spec.isolating || after.type.spec.isolating;
|
|
62308
63177
|
if (!isolated && joinMaybeClear(state2, $cut, dispatch))
|
|
62309
63178
|
return true;
|
|
62310
63179
|
let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
|
|
62311
|
-
if (canDelAfter && (conn = (
|
|
63180
|
+
if (canDelAfter && (conn = (match2 = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match2.matchType(conn[0] || after.type).validEnd) {
|
|
62312
63181
|
if (dispatch) {
|
|
62313
63182
|
let end2 = $cut.pos + after.nodeSize, wrap2 = Fragment$1.empty;
|
|
62314
63183
|
for (let i2 = conn.length - 1; i2 >= 0; i2--)
|
|
@@ -64210,7 +65079,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
64210
65079
|
};
|
|
64211
65080
|
});
|
|
64212
65081
|
this.extensions = _ExtensionService2.getResolvedExtensions([...extensions, ...this.externalExtensions]);
|
|
64213
|
-
this.schema = Schema$
|
|
65082
|
+
this.schema = Schema$2.createSchemaByExtensions(this.extensions, editor);
|
|
64214
65083
|
__privateMethod$1(this, _ExtensionService_instances, setupExtensions_fn).call(this);
|
|
64215
65084
|
}
|
|
64216
65085
|
/**
|
|
@@ -65842,7 +66711,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
65842
66711
|
const onlyInputTypeMeta = ["inputType", "uiEvent", "paste", "pointer"];
|
|
65843
66712
|
const notAllowedMeta = ["historyUndo", "historyRedo", "acceptReject"];
|
|
65844
66713
|
const isProgrammaticInput = tr.getMeta("inputType") === "programmatic";
|
|
65845
|
-
|
|
66714
|
+
const ySyncMeta = tr.getMeta(ySyncPluginKey);
|
|
66715
|
+
const allowedMeta = /* @__PURE__ */ new Set([...onlyInputTypeMeta, ySyncPluginKey.key]);
|
|
66716
|
+
const hasDisallowedMeta = tr.meta && Object.keys(tr.meta).some((meta2) => !allowedMeta.has(meta2));
|
|
66717
|
+
if (ySyncMeta?.isChangeOrigin || // Skip Yjs-origin transactions (remote/rehydration).
|
|
66718
|
+
!tr.steps.length || hasDisallowedMeta && !isProgrammaticInput || notAllowedMeta.includes(tr.getMeta("inputType")) || tr.getMeta(CommentsPluginKey)) {
|
|
65846
66719
|
return tr;
|
|
65847
66720
|
}
|
|
65848
66721
|
const newTr = state2.tr;
|
|
@@ -67511,7 +68384,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
67511
68384
|
const shouldSkipNodeView = (editor) => {
|
|
67512
68385
|
return isHeadless(editor);
|
|
67513
68386
|
};
|
|
67514
|
-
const summaryVersion = "1.0.
|
|
68387
|
+
const summaryVersion = "1.0.2";
|
|
67515
68388
|
const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
|
|
67516
68389
|
const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
|
|
67517
68390
|
function mapAttributes(attrs) {
|
|
@@ -68300,7 +69173,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
68300
69173
|
{ default: remarkStringify2 },
|
|
68301
69174
|
{ default: remarkGfm2 }
|
|
68302
69175
|
] = await Promise.all([
|
|
68303
|
-
Promise.resolve().then(() =>
|
|
69176
|
+
Promise.resolve().then(() => indexDDZ1ZT8N),
|
|
68304
69177
|
Promise.resolve().then(() => indexDRCvimau),
|
|
68305
69178
|
Promise.resolve().then(() => indexC_x_N6Uh),
|
|
68306
69179
|
Promise.resolve().then(() => indexD_sWOSiG),
|
|
@@ -68505,7 +69378,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
68505
69378
|
* Process collaboration migrations
|
|
68506
69379
|
*/
|
|
68507
69380
|
processCollaborationMigrations() {
|
|
68508
|
-
console.debug("[checkVersionMigrations] Current editor version", "1.0.
|
|
69381
|
+
console.debug("[checkVersionMigrations] Current editor version", "1.0.2");
|
|
68509
69382
|
if (!this.options.ydoc) return;
|
|
68510
69383
|
const metaMap = this.options.ydoc.getMap("meta");
|
|
68511
69384
|
let docVersion = metaMap.get("version");
|
|
@@ -79504,6 +80377,86 @@ ${l}
|
|
|
79504
80377
|
}
|
|
79505
80378
|
};
|
|
79506
80379
|
};
|
|
80380
|
+
const DEFAULT_CONFIG = {
|
|
80381
|
+
logLevel: "off",
|
|
80382
|
+
hud: false,
|
|
80383
|
+
dumpRects: false,
|
|
80384
|
+
disableRectDedupe: false
|
|
80385
|
+
};
|
|
80386
|
+
const levelOrder = {
|
|
80387
|
+
error: 0,
|
|
80388
|
+
warn: 1,
|
|
80389
|
+
info: 2,
|
|
80390
|
+
verbose: 3
|
|
80391
|
+
};
|
|
80392
|
+
function getSelectionDebugConfig() {
|
|
80393
|
+
var _a2;
|
|
80394
|
+
if (typeof window === "undefined") {
|
|
80395
|
+
return DEFAULT_CONFIG;
|
|
80396
|
+
}
|
|
80397
|
+
window.superdocDebug ?? (window.superdocDebug = {});
|
|
80398
|
+
(_a2 = window.superdocDebug).selection ?? (_a2.selection = {});
|
|
80399
|
+
const cfg = window.superdocDebug.selection;
|
|
80400
|
+
return {
|
|
80401
|
+
logLevel: cfg.logLevel ?? DEFAULT_CONFIG.logLevel,
|
|
80402
|
+
hud: cfg.hud ?? DEFAULT_CONFIG.hud,
|
|
80403
|
+
dumpRects: cfg.dumpRects ?? DEFAULT_CONFIG.dumpRects,
|
|
80404
|
+
disableRectDedupe: cfg.disableRectDedupe ?? DEFAULT_CONFIG.disableRectDedupe
|
|
80405
|
+
};
|
|
80406
|
+
}
|
|
80407
|
+
function debugLog(level, message, data) {
|
|
80408
|
+
const cfg = getSelectionDebugConfig();
|
|
80409
|
+
if (cfg.logLevel === "off") return;
|
|
80410
|
+
if (levelOrder[level] > levelOrder[cfg.logLevel]) return;
|
|
80411
|
+
const prefix2 = "[Selection]";
|
|
80412
|
+
if (data) {
|
|
80413
|
+
console.log(prefix2, message, data);
|
|
80414
|
+
} else {
|
|
80415
|
+
console.log(prefix2, message);
|
|
80416
|
+
}
|
|
80417
|
+
}
|
|
80418
|
+
const HUD_DATA_ATTR = "data-superdoc-selection-debug-hud";
|
|
80419
|
+
function updateSelectionDebugHud(host, state2) {
|
|
80420
|
+
const cfg = getSelectionDebugConfig();
|
|
80421
|
+
const doc2 = host.ownerDocument ?? (typeof document !== "undefined" ? document : null);
|
|
80422
|
+
if (!doc2) return;
|
|
80423
|
+
const existing = host.querySelector(`[${HUD_DATA_ATTR}="true"]`);
|
|
80424
|
+
if (!cfg.hud) {
|
|
80425
|
+
existing?.remove();
|
|
80426
|
+
return;
|
|
80427
|
+
}
|
|
80428
|
+
const hud = existing ?? doc2.createElement("div");
|
|
80429
|
+
hud.setAttribute(HUD_DATA_ATTR, "true");
|
|
80430
|
+
hud.style.position = "absolute";
|
|
80431
|
+
hud.style.top = "8px";
|
|
80432
|
+
hud.style.left = "8px";
|
|
80433
|
+
hud.style.zIndex = "9999";
|
|
80434
|
+
hud.style.maxWidth = "420px";
|
|
80435
|
+
hud.style.padding = "6px 8px";
|
|
80436
|
+
hud.style.borderRadius = "6px";
|
|
80437
|
+
hud.style.background = "rgba(0, 0, 0, 0.72)";
|
|
80438
|
+
hud.style.color = "white";
|
|
80439
|
+
hud.style.fontFamily = 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace';
|
|
80440
|
+
hud.style.fontSize = "12px";
|
|
80441
|
+
hud.style.lineHeight = "1.3";
|
|
80442
|
+
hud.style.pointerEvents = "none";
|
|
80443
|
+
hud.style.whiteSpace = "pre";
|
|
80444
|
+
const behind = Math.max(0, state2.docEpoch - state2.layoutEpoch);
|
|
80445
|
+
const selectionText = state2.selection ? `${state2.selection.from}..${state2.selection.to}` : "null";
|
|
80446
|
+
const pointerText = state2.lastPointer ? `${state2.lastPointer.clientX},${state2.lastPointer.clientY} -> ${Math.round(state2.lastPointer.x)},${Math.round(
|
|
80447
|
+
state2.lastPointer.y
|
|
80448
|
+
)}` : "null";
|
|
80449
|
+
const hitText = state2.lastHit ? `${state2.lastHit.source} pos=${state2.lastHit.pos ?? "null"} epoch=${state2.lastHit.layoutEpoch ?? "null"} mapped=${state2.lastHit.mappedPos ?? "null"}` : "null";
|
|
80450
|
+
hud.textContent = [
|
|
80451
|
+
`docEpoch=${state2.docEpoch} layoutEpoch=${state2.layoutEpoch} behind=${behind}`,
|
|
80452
|
+
`selection=${selectionText}`,
|
|
80453
|
+
`pointer=${pointerText}`,
|
|
80454
|
+
`hit=${hitText}`
|
|
80455
|
+
].join("\n");
|
|
80456
|
+
if (!existing) {
|
|
80457
|
+
host.appendChild(hud);
|
|
80458
|
+
}
|
|
80459
|
+
}
|
|
79507
80460
|
class DomPositionIndex {
|
|
79508
80461
|
constructor() {
|
|
79509
80462
|
__privateAdd$1(this, _entries, []);
|
|
@@ -79560,6 +80513,7 @@ ${l}
|
|
|
79560
80513
|
}
|
|
79561
80514
|
for (const node2 of pmNodes) {
|
|
79562
80515
|
if (node2.classList.contains(DOM_CLASS_NAMES.INLINE_SDT_WRAPPER)) continue;
|
|
80516
|
+
if (node2.closest(".superdoc-page-header, .superdoc-page-footer")) continue;
|
|
79563
80517
|
if (leafOnly && nonLeaf.has(node2)) continue;
|
|
79564
80518
|
const pmStart = Number(node2.dataset.pmStart ?? "NaN");
|
|
79565
80519
|
const pmEnd = Number(node2.dataset.pmEnd ?? "NaN");
|
|
@@ -79569,6 +80523,60 @@ ${l}
|
|
|
79569
80523
|
}
|
|
79570
80524
|
entries.sort((a2, b2) => a2.pmStart - b2.pmStart !== 0 ? a2.pmStart - b2.pmStart : a2.pmEnd - b2.pmEnd);
|
|
79571
80525
|
__privateSet(this, _entries, entries);
|
|
80526
|
+
const isVerbose = getSelectionDebugConfig().logLevel === "verbose";
|
|
80527
|
+
if (isVerbose) {
|
|
80528
|
+
const counts = { total: entries.length, body: 0, header: 0, footer: 0 };
|
|
80529
|
+
const bodySamples = [];
|
|
80530
|
+
const headerSamples = [];
|
|
80531
|
+
const footerSamples = [];
|
|
80532
|
+
for (const entry of entries) {
|
|
80533
|
+
const pageEl = entry.el.closest(`.${DOM_CLASS_NAMES.PAGE}`);
|
|
80534
|
+
const pageIndex = pageEl?.dataset.pageIndex ?? null;
|
|
80535
|
+
const section = entry.el.closest(".superdoc-page-header") ? "header" : entry.el.closest(".superdoc-page-footer") ? "footer" : "body";
|
|
80536
|
+
if (section === "header") {
|
|
80537
|
+
counts.header += 1;
|
|
80538
|
+
if (headerSamples.length < 10) {
|
|
80539
|
+
headerSamples.push({
|
|
80540
|
+
pmStart: entry.pmStart,
|
|
80541
|
+
pmEnd: entry.pmEnd,
|
|
80542
|
+
pageIndex,
|
|
80543
|
+
text: (entry.el.textContent ?? "").slice(0, 40)
|
|
80544
|
+
});
|
|
80545
|
+
}
|
|
80546
|
+
continue;
|
|
80547
|
+
}
|
|
80548
|
+
if (section === "footer") {
|
|
80549
|
+
counts.footer += 1;
|
|
80550
|
+
if (footerSamples.length < 10) {
|
|
80551
|
+
footerSamples.push({
|
|
80552
|
+
pmStart: entry.pmStart,
|
|
80553
|
+
pmEnd: entry.pmEnd,
|
|
80554
|
+
pageIndex,
|
|
80555
|
+
text: (entry.el.textContent ?? "").slice(0, 40)
|
|
80556
|
+
});
|
|
80557
|
+
}
|
|
80558
|
+
continue;
|
|
80559
|
+
}
|
|
80560
|
+
counts.body += 1;
|
|
80561
|
+
if (bodySamples.length < 10) {
|
|
80562
|
+
bodySamples.push({
|
|
80563
|
+
pmStart: entry.pmStart,
|
|
80564
|
+
pmEnd: entry.pmEnd,
|
|
80565
|
+
pageIndex,
|
|
80566
|
+
text: (entry.el.textContent ?? "").slice(0, 40)
|
|
80567
|
+
});
|
|
80568
|
+
}
|
|
80569
|
+
}
|
|
80570
|
+
debugLog(
|
|
80571
|
+
"verbose",
|
|
80572
|
+
`DomPositionIndex: rebuild summary ${JSON.stringify({
|
|
80573
|
+
counts,
|
|
80574
|
+
bodySamples,
|
|
80575
|
+
headerSamples,
|
|
80576
|
+
footerSamples
|
|
80577
|
+
})}`
|
|
80578
|
+
);
|
|
80579
|
+
}
|
|
79572
80580
|
}
|
|
79573
80581
|
/**
|
|
79574
80582
|
* Finds the index entry whose position range contains the given position.
|
|
@@ -79818,82 +80826,6 @@ ${l}
|
|
|
79818
80826
|
_observer = /* @__PURE__ */ new WeakMap();
|
|
79819
80827
|
_rebuildScheduled = /* @__PURE__ */ new WeakMap();
|
|
79820
80828
|
_rebuildRafId = /* @__PURE__ */ new WeakMap();
|
|
79821
|
-
const DEFAULT_CONFIG = {
|
|
79822
|
-
logLevel: "off",
|
|
79823
|
-
hud: false
|
|
79824
|
-
};
|
|
79825
|
-
const levelOrder = {
|
|
79826
|
-
error: 0,
|
|
79827
|
-
warn: 1,
|
|
79828
|
-
info: 2,
|
|
79829
|
-
verbose: 3
|
|
79830
|
-
};
|
|
79831
|
-
function getSelectionDebugConfig() {
|
|
79832
|
-
var _a2;
|
|
79833
|
-
if (typeof window === "undefined") {
|
|
79834
|
-
return DEFAULT_CONFIG;
|
|
79835
|
-
}
|
|
79836
|
-
window.superdocDebug ?? (window.superdocDebug = {});
|
|
79837
|
-
(_a2 = window.superdocDebug).selection ?? (_a2.selection = {});
|
|
79838
|
-
const cfg = window.superdocDebug.selection;
|
|
79839
|
-
return {
|
|
79840
|
-
logLevel: cfg.logLevel ?? DEFAULT_CONFIG.logLevel,
|
|
79841
|
-
hud: cfg.hud ?? DEFAULT_CONFIG.hud
|
|
79842
|
-
};
|
|
79843
|
-
}
|
|
79844
|
-
function debugLog(level, message, data) {
|
|
79845
|
-
const cfg = getSelectionDebugConfig();
|
|
79846
|
-
if (cfg.logLevel === "off") return;
|
|
79847
|
-
if (levelOrder[level] > levelOrder[cfg.logLevel]) return;
|
|
79848
|
-
const prefix2 = "[Selection]";
|
|
79849
|
-
if (data) {
|
|
79850
|
-
console.log(prefix2, message, data);
|
|
79851
|
-
} else {
|
|
79852
|
-
console.log(prefix2, message);
|
|
79853
|
-
}
|
|
79854
|
-
}
|
|
79855
|
-
const HUD_DATA_ATTR = "data-superdoc-selection-debug-hud";
|
|
79856
|
-
function updateSelectionDebugHud(host, state2) {
|
|
79857
|
-
const cfg = getSelectionDebugConfig();
|
|
79858
|
-
const doc2 = host.ownerDocument ?? (typeof document !== "undefined" ? document : null);
|
|
79859
|
-
if (!doc2) return;
|
|
79860
|
-
const existing = host.querySelector(`[${HUD_DATA_ATTR}="true"]`);
|
|
79861
|
-
if (!cfg.hud) {
|
|
79862
|
-
existing?.remove();
|
|
79863
|
-
return;
|
|
79864
|
-
}
|
|
79865
|
-
const hud = existing ?? doc2.createElement("div");
|
|
79866
|
-
hud.setAttribute(HUD_DATA_ATTR, "true");
|
|
79867
|
-
hud.style.position = "absolute";
|
|
79868
|
-
hud.style.top = "8px";
|
|
79869
|
-
hud.style.left = "8px";
|
|
79870
|
-
hud.style.zIndex = "9999";
|
|
79871
|
-
hud.style.maxWidth = "420px";
|
|
79872
|
-
hud.style.padding = "6px 8px";
|
|
79873
|
-
hud.style.borderRadius = "6px";
|
|
79874
|
-
hud.style.background = "rgba(0, 0, 0, 0.72)";
|
|
79875
|
-
hud.style.color = "white";
|
|
79876
|
-
hud.style.fontFamily = 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace';
|
|
79877
|
-
hud.style.fontSize = "12px";
|
|
79878
|
-
hud.style.lineHeight = "1.3";
|
|
79879
|
-
hud.style.pointerEvents = "none";
|
|
79880
|
-
hud.style.whiteSpace = "pre";
|
|
79881
|
-
const behind = Math.max(0, state2.docEpoch - state2.layoutEpoch);
|
|
79882
|
-
const selectionText = state2.selection ? `${state2.selection.from}..${state2.selection.to}` : "null";
|
|
79883
|
-
const pointerText = state2.lastPointer ? `${state2.lastPointer.clientX},${state2.lastPointer.clientY} -> ${Math.round(state2.lastPointer.x)},${Math.round(
|
|
79884
|
-
state2.lastPointer.y
|
|
79885
|
-
)}` : "null";
|
|
79886
|
-
const hitText = state2.lastHit ? `${state2.lastHit.source} pos=${state2.lastHit.pos ?? "null"} epoch=${state2.lastHit.layoutEpoch ?? "null"} mapped=${state2.lastHit.mappedPos ?? "null"}` : "null";
|
|
79887
|
-
hud.textContent = [
|
|
79888
|
-
`docEpoch=${state2.docEpoch} layoutEpoch=${state2.layoutEpoch} behind=${behind}`,
|
|
79889
|
-
`selection=${selectionText}`,
|
|
79890
|
-
`pointer=${pointerText}`,
|
|
79891
|
-
`hit=${hitText}`
|
|
79892
|
-
].join("\n");
|
|
79893
|
-
if (!existing) {
|
|
79894
|
-
host.appendChild(hud);
|
|
79895
|
-
}
|
|
79896
|
-
}
|
|
79897
80829
|
function computeSelectionRectsFromDom(options, from2, to) {
|
|
79898
80830
|
const painterHost = options.painterHost;
|
|
79899
80831
|
if (!painterHost) return null;
|
|
@@ -79914,6 +80846,34 @@ ${l}
|
|
|
79914
80846
|
);
|
|
79915
80847
|
const out = [];
|
|
79916
80848
|
let rebuiltOnce = false;
|
|
80849
|
+
const debugConfig = getSelectionDebugConfig();
|
|
80850
|
+
const isVerbose = debugConfig.logLevel === "verbose";
|
|
80851
|
+
const dumpRects = isVerbose && debugConfig.dumpRects;
|
|
80852
|
+
const disableRectDedupe = debugConfig.disableRectDedupe;
|
|
80853
|
+
const entryDebugInfo = (entry) => {
|
|
80854
|
+
const pageEl = entry.el.closest(`.${DOM_CLASS_NAMES.PAGE}`);
|
|
80855
|
+
const section = entry.el.closest(".superdoc-page-header") ? "header" : entry.el.closest(".superdoc-page-footer") ? "footer" : "body";
|
|
80856
|
+
return {
|
|
80857
|
+
pmStart: entry.pmStart,
|
|
80858
|
+
pmEnd: entry.pmEnd,
|
|
80859
|
+
pageIndex: pageEl?.dataset.pageIndex ?? null,
|
|
80860
|
+
section,
|
|
80861
|
+
connected: entry.el.isConnected,
|
|
80862
|
+
layoutEpoch: entry.el.dataset.layoutEpoch ?? null,
|
|
80863
|
+
pageEpoch: pageEl?.dataset.layoutEpoch ?? null,
|
|
80864
|
+
text: (entry.el.textContent ?? "").slice(0, 80)
|
|
80865
|
+
};
|
|
80866
|
+
};
|
|
80867
|
+
const rectDebugInfo = (rect) => ({
|
|
80868
|
+
x: rect.x,
|
|
80869
|
+
y: rect.y,
|
|
80870
|
+
width: rect.width,
|
|
80871
|
+
height: rect.height,
|
|
80872
|
+
top: rect.top,
|
|
80873
|
+
left: rect.left,
|
|
80874
|
+
right: rect.right,
|
|
80875
|
+
bottom: rect.bottom
|
|
80876
|
+
});
|
|
79917
80877
|
for (const pageEl of pageEls) {
|
|
79918
80878
|
const pageIndex = Number(pageEl.dataset.pageIndex ?? "NaN");
|
|
79919
80879
|
if (!Number.isFinite(pageIndex)) continue;
|
|
@@ -79937,9 +80897,47 @@ ${l}
|
|
|
79937
80897
|
if (sliceEntries.length === 0) {
|
|
79938
80898
|
continue;
|
|
79939
80899
|
}
|
|
80900
|
+
if (isVerbose) {
|
|
80901
|
+
debugLog(
|
|
80902
|
+
"verbose",
|
|
80903
|
+
`DOM selection rects: slice entries ${JSON.stringify({
|
|
80904
|
+
pageIndex,
|
|
80905
|
+
sliceFrom,
|
|
80906
|
+
sliceTo,
|
|
80907
|
+
entriesCount: sliceEntries.length,
|
|
80908
|
+
entriesPreview: sliceEntries.slice(0, 20).map(entryDebugInfo)
|
|
80909
|
+
})}`
|
|
80910
|
+
);
|
|
80911
|
+
}
|
|
79940
80912
|
let startEntry = options.domPositionIndex.findEntryAtPosition(sliceFrom) ?? sliceEntries[0];
|
|
79941
80913
|
let endEntry = options.domPositionIndex.findEntryAtPosition(sliceTo) ?? sliceEntries[sliceEntries.length - 1];
|
|
79942
|
-
if (
|
|
80914
|
+
if (isVerbose) {
|
|
80915
|
+
debugLog(
|
|
80916
|
+
"verbose",
|
|
80917
|
+
`DOM selection rects: boundaries ${JSON.stringify({
|
|
80918
|
+
pageIndex,
|
|
80919
|
+
sliceFrom,
|
|
80920
|
+
sliceTo,
|
|
80921
|
+
start: entryDebugInfo(startEntry),
|
|
80922
|
+
end: entryDebugInfo(endEntry)
|
|
80923
|
+
})}`
|
|
80924
|
+
);
|
|
80925
|
+
}
|
|
80926
|
+
let startContained = pageEl.contains(startEntry.el);
|
|
80927
|
+
let endContained = pageEl.contains(endEntry.el);
|
|
80928
|
+
if (!startContained || !endContained) {
|
|
80929
|
+
if (isVerbose) {
|
|
80930
|
+
debugLog(
|
|
80931
|
+
"verbose",
|
|
80932
|
+
`DOM selection rects: boundary containment ${JSON.stringify({
|
|
80933
|
+
pageIndex,
|
|
80934
|
+
sliceFrom,
|
|
80935
|
+
sliceTo,
|
|
80936
|
+
startContained,
|
|
80937
|
+
endContained
|
|
80938
|
+
})}`
|
|
80939
|
+
);
|
|
80940
|
+
}
|
|
79943
80941
|
if (!rebuiltOnce) {
|
|
79944
80942
|
options.rebuildDomPositionIndex();
|
|
79945
80943
|
rebuiltOnce = true;
|
|
@@ -79947,9 +80945,34 @@ ${l}
|
|
|
79947
80945
|
if (sliceEntries.length === 0) continue;
|
|
79948
80946
|
startEntry = options.domPositionIndex.findEntryAtPosition(sliceFrom) ?? sliceEntries[0];
|
|
79949
80947
|
endEntry = options.domPositionIndex.findEntryAtPosition(sliceTo) ?? sliceEntries[sliceEntries.length - 1];
|
|
80948
|
+
startContained = pageEl.contains(startEntry.el);
|
|
80949
|
+
endContained = pageEl.contains(endEntry.el);
|
|
80950
|
+
if (isVerbose) {
|
|
80951
|
+
debugLog(
|
|
80952
|
+
"verbose",
|
|
80953
|
+
`DOM selection rects: boundary containment after rebuild ${JSON.stringify({
|
|
80954
|
+
pageIndex,
|
|
80955
|
+
sliceFrom,
|
|
80956
|
+
sliceTo,
|
|
80957
|
+
startContained,
|
|
80958
|
+
endContained,
|
|
80959
|
+
start: entryDebugInfo(startEntry),
|
|
80960
|
+
end: entryDebugInfo(endEntry)
|
|
80961
|
+
})}`
|
|
80962
|
+
);
|
|
80963
|
+
}
|
|
79950
80964
|
}
|
|
79951
|
-
if (!
|
|
79952
|
-
debugLog(
|
|
80965
|
+
if (!startContained || !endContained) {
|
|
80966
|
+
debugLog(
|
|
80967
|
+
"warn",
|
|
80968
|
+
`DOM selection rects: stale index after rebuild ${JSON.stringify({
|
|
80969
|
+
pageIndex,
|
|
80970
|
+
sliceFrom,
|
|
80971
|
+
sliceTo,
|
|
80972
|
+
start: entryDebugInfo(startEntry),
|
|
80973
|
+
end: entryDebugInfo(endEntry)
|
|
80974
|
+
})}`
|
|
80975
|
+
);
|
|
79953
80976
|
return null;
|
|
79954
80977
|
}
|
|
79955
80978
|
}
|
|
@@ -79964,8 +80987,83 @@ ${l}
|
|
|
79964
80987
|
}
|
|
79965
80988
|
let clientRects = [];
|
|
79966
80989
|
try {
|
|
79967
|
-
|
|
79968
|
-
|
|
80990
|
+
let rawRects = Array.from(range2.getClientRects());
|
|
80991
|
+
if (dumpRects) {
|
|
80992
|
+
debugLog(
|
|
80993
|
+
"verbose",
|
|
80994
|
+
`DOM selection rects: raw rects ${JSON.stringify({
|
|
80995
|
+
pageIndex,
|
|
80996
|
+
sliceFrom,
|
|
80997
|
+
sliceTo,
|
|
80998
|
+
rects: rawRects.map(rectDebugInfo)
|
|
80999
|
+
})}`
|
|
81000
|
+
);
|
|
81001
|
+
}
|
|
81002
|
+
let missingEntries = null;
|
|
81003
|
+
if (typeof range2.intersectsNode === "function") {
|
|
81004
|
+
for (const entry of sliceEntries) {
|
|
81005
|
+
try {
|
|
81006
|
+
if (!range2.intersectsNode(entry.el)) {
|
|
81007
|
+
missingEntries ?? (missingEntries = []);
|
|
81008
|
+
missingEntries.push(entry);
|
|
81009
|
+
}
|
|
81010
|
+
} catch {
|
|
81011
|
+
}
|
|
81012
|
+
}
|
|
81013
|
+
}
|
|
81014
|
+
if (missingEntries && missingEntries.length > 0) {
|
|
81015
|
+
if (isVerbose) {
|
|
81016
|
+
debugLog(
|
|
81017
|
+
"verbose",
|
|
81018
|
+
`DOM selection rects: range missing entries ${JSON.stringify({
|
|
81019
|
+
pageIndex,
|
|
81020
|
+
sliceFrom,
|
|
81021
|
+
sliceTo,
|
|
81022
|
+
missingCount: missingEntries.length,
|
|
81023
|
+
missingPreview: missingEntries.slice(0, 20).map(entryDebugInfo)
|
|
81024
|
+
})}`
|
|
81025
|
+
);
|
|
81026
|
+
}
|
|
81027
|
+
rawRects = collectClientRectsByLine(doc2, sliceEntries, sliceFrom, sliceTo);
|
|
81028
|
+
if (dumpRects) {
|
|
81029
|
+
debugLog(
|
|
81030
|
+
"verbose",
|
|
81031
|
+
`DOM selection rects: fallback raw rects ${JSON.stringify({
|
|
81032
|
+
pageIndex,
|
|
81033
|
+
sliceFrom,
|
|
81034
|
+
sliceTo,
|
|
81035
|
+
rects: rawRects.map(rectDebugInfo)
|
|
81036
|
+
})}`
|
|
81037
|
+
);
|
|
81038
|
+
}
|
|
81039
|
+
}
|
|
81040
|
+
clientRects = disableRectDedupe ? rawRects : deduplicateOverlappingRects(rawRects);
|
|
81041
|
+
if (dumpRects) {
|
|
81042
|
+
debugLog(
|
|
81043
|
+
"verbose",
|
|
81044
|
+
`DOM selection rects: final rects ${JSON.stringify({
|
|
81045
|
+
pageIndex,
|
|
81046
|
+
sliceFrom,
|
|
81047
|
+
sliceTo,
|
|
81048
|
+
dedupeDisabled: disableRectDedupe,
|
|
81049
|
+
rects: clientRects.map(rectDebugInfo)
|
|
81050
|
+
})}`
|
|
81051
|
+
);
|
|
81052
|
+
const nonPositive = clientRects.filter(
|
|
81053
|
+
(rect) => !Number.isFinite(rect.width) || !Number.isFinite(rect.height) || rect.width <= 0 || rect.height <= 0
|
|
81054
|
+
);
|
|
81055
|
+
if (nonPositive.length > 0) {
|
|
81056
|
+
debugLog(
|
|
81057
|
+
"verbose",
|
|
81058
|
+
`DOM selection rects: non-positive rects ${JSON.stringify({
|
|
81059
|
+
pageIndex,
|
|
81060
|
+
sliceFrom,
|
|
81061
|
+
sliceTo,
|
|
81062
|
+
rects: nonPositive.map(rectDebugInfo)
|
|
81063
|
+
})}`
|
|
81064
|
+
);
|
|
81065
|
+
}
|
|
81066
|
+
}
|
|
79969
81067
|
} catch (error) {
|
|
79970
81068
|
debugLog("warn", "DOM selection rects: getClientRects failed", { error: String(error) });
|
|
79971
81069
|
return null;
|
|
@@ -79989,6 +81087,57 @@ ${l}
|
|
|
79989
81087
|
}
|
|
79990
81088
|
return out;
|
|
79991
81089
|
}
|
|
81090
|
+
function collectClientRectsByLine(doc2, entries, sliceFrom, sliceTo) {
|
|
81091
|
+
const rects = [];
|
|
81092
|
+
const lineMap = /* @__PURE__ */ new Map();
|
|
81093
|
+
const looseEntries = [];
|
|
81094
|
+
for (const entry of entries) {
|
|
81095
|
+
const lineEl = entry.el.closest(".superdoc-line");
|
|
81096
|
+
if (!lineEl) {
|
|
81097
|
+
looseEntries.push(entry);
|
|
81098
|
+
continue;
|
|
81099
|
+
}
|
|
81100
|
+
const list2 = lineMap.get(lineEl);
|
|
81101
|
+
if (list2) {
|
|
81102
|
+
list2.push(entry);
|
|
81103
|
+
} else {
|
|
81104
|
+
lineMap.set(lineEl, [entry]);
|
|
81105
|
+
}
|
|
81106
|
+
}
|
|
81107
|
+
for (const [, lineEntries] of lineMap) {
|
|
81108
|
+
lineEntries.sort((a2, b2) => a2.pmStart - b2.pmStart !== 0 ? a2.pmStart - b2.pmStart : a2.pmEnd - b2.pmEnd);
|
|
81109
|
+
const linePmStart = lineEntries[0]?.pmStart ?? Infinity;
|
|
81110
|
+
const linePmEnd = lineEntries[lineEntries.length - 1]?.pmEnd ?? -Infinity;
|
|
81111
|
+
if (!Number.isFinite(linePmStart) || !Number.isFinite(linePmEnd) || linePmEnd <= linePmStart) continue;
|
|
81112
|
+
const lineFrom = Math.max(sliceFrom, linePmStart);
|
|
81113
|
+
const lineTo = Math.min(sliceTo, linePmEnd);
|
|
81114
|
+
if (lineFrom >= lineTo) continue;
|
|
81115
|
+
const startEntry = lineEntries.find((entry) => lineFrom >= entry.pmStart && lineFrom <= entry.pmEnd) ?? lineEntries[0];
|
|
81116
|
+
const endEntry = lineEntries.find((entry) => lineTo >= entry.pmStart && lineTo <= entry.pmEnd) ?? lineEntries[lineEntries.length - 1];
|
|
81117
|
+
const range2 = doc2.createRange();
|
|
81118
|
+
try {
|
|
81119
|
+
if (!setDomRangeStart(range2, startEntry, lineFrom)) continue;
|
|
81120
|
+
if (!setDomRangeEnd(range2, endEntry, lineTo)) continue;
|
|
81121
|
+
} catch {
|
|
81122
|
+
continue;
|
|
81123
|
+
}
|
|
81124
|
+
rects.push(...Array.from(range2.getClientRects()));
|
|
81125
|
+
}
|
|
81126
|
+
for (const entry of looseEntries) {
|
|
81127
|
+
const entryFrom = Math.max(sliceFrom, entry.pmStart);
|
|
81128
|
+
const entryTo = Math.min(sliceTo, entry.pmEnd);
|
|
81129
|
+
if (entryFrom >= entryTo) continue;
|
|
81130
|
+
const range2 = doc2.createRange();
|
|
81131
|
+
try {
|
|
81132
|
+
if (!setDomRangeStart(range2, entry, entryFrom)) continue;
|
|
81133
|
+
if (!setDomRangeEnd(range2, entry, entryTo)) continue;
|
|
81134
|
+
} catch {
|
|
81135
|
+
continue;
|
|
81136
|
+
}
|
|
81137
|
+
rects.push(...Array.from(range2.getClientRects()));
|
|
81138
|
+
}
|
|
81139
|
+
return rects;
|
|
81140
|
+
}
|
|
79992
81141
|
function setDomRangeStart(range2, entry, pos) {
|
|
79993
81142
|
const el = entry.el;
|
|
79994
81143
|
const pmStart = entry.pmStart;
|
|
@@ -80098,31 +81247,69 @@ ${l}
|
|
|
80098
81247
|
return a2.x - b2.x;
|
|
80099
81248
|
});
|
|
80100
81249
|
const result = [];
|
|
80101
|
-
|
|
80102
|
-
|
|
80103
|
-
|
|
80104
|
-
|
|
80105
|
-
|
|
80106
|
-
|
|
80107
|
-
|
|
80108
|
-
|
|
80109
|
-
|
|
80110
|
-
|
|
80111
|
-
|
|
80112
|
-
|
|
80113
|
-
|
|
80114
|
-
|
|
80115
|
-
|
|
80116
|
-
|
|
80117
|
-
|
|
80118
|
-
|
|
80119
|
-
|
|
80120
|
-
|
|
80121
|
-
|
|
81250
|
+
const groups = [];
|
|
81251
|
+
let currentGroup = [];
|
|
81252
|
+
for (const rect of sorted) {
|
|
81253
|
+
if (currentGroup.length === 0) {
|
|
81254
|
+
currentGroup.push(rect);
|
|
81255
|
+
continue;
|
|
81256
|
+
}
|
|
81257
|
+
const groupY = currentGroup[0].y;
|
|
81258
|
+
if (Math.abs(rect.y - groupY) <= Y_SAME_LINE_THRESHOLD_PX) {
|
|
81259
|
+
currentGroup.push(rect);
|
|
81260
|
+
} else {
|
|
81261
|
+
groups.push(currentGroup);
|
|
81262
|
+
currentGroup = [rect];
|
|
81263
|
+
}
|
|
81264
|
+
}
|
|
81265
|
+
if (currentGroup.length > 0) {
|
|
81266
|
+
groups.push(currentGroup);
|
|
81267
|
+
}
|
|
81268
|
+
const SIZE_EPS_PX = 0.5;
|
|
81269
|
+
const X_DUPLICATE_EPS_PX = 1;
|
|
81270
|
+
const hasSignificantOverlap = (a2, b2) => {
|
|
81271
|
+
const xOverlapStart = Math.max(a2.x, b2.x);
|
|
81272
|
+
const xOverlapEnd = Math.min(a2.x + a2.width, b2.x + b2.width);
|
|
81273
|
+
const hasHorizontalOverlap = xOverlapEnd > xOverlapStart;
|
|
81274
|
+
if (!hasHorizontalOverlap) return false;
|
|
81275
|
+
const overlapWidth = Math.max(0, xOverlapEnd - xOverlapStart);
|
|
81276
|
+
const minWidth = Math.min(a2.width, b2.width);
|
|
81277
|
+
return minWidth > 0 && overlapWidth / minWidth > HORIZONTAL_OVERLAP_THRESHOLD;
|
|
81278
|
+
};
|
|
81279
|
+
const isLargerRect = (a2, b2) => {
|
|
81280
|
+
return a2.width > b2.width + SIZE_EPS_PX || a2.height > b2.height + SIZE_EPS_PX;
|
|
81281
|
+
};
|
|
81282
|
+
for (const group of groups) {
|
|
81283
|
+
const unique2 = [];
|
|
81284
|
+
for (const rect of group) {
|
|
81285
|
+
const isDuplicate = unique2.some((existing) => {
|
|
81286
|
+
const xClose = Math.abs(existing.x - rect.x) <= X_DUPLICATE_EPS_PX;
|
|
81287
|
+
const yClose = Math.abs(existing.y - rect.y) <= Y_SAME_LINE_THRESHOLD_PX;
|
|
81288
|
+
const widthClose = Math.abs(existing.width - rect.width) <= SIZE_EPS_PX;
|
|
81289
|
+
const heightClose = Math.abs(existing.height - rect.height) <= SIZE_EPS_PX;
|
|
81290
|
+
return xClose && yClose && widthClose && heightClose;
|
|
81291
|
+
});
|
|
81292
|
+
if (!isDuplicate) {
|
|
81293
|
+
unique2.push(rect);
|
|
80122
81294
|
}
|
|
80123
81295
|
}
|
|
80124
|
-
|
|
80125
|
-
|
|
81296
|
+
if (unique2.length <= 1) {
|
|
81297
|
+
result.push(...unique2);
|
|
81298
|
+
continue;
|
|
81299
|
+
}
|
|
81300
|
+
const containers = /* @__PURE__ */ new Set();
|
|
81301
|
+
for (const rect of unique2) {
|
|
81302
|
+
for (const other of unique2) {
|
|
81303
|
+
if (rect === other) continue;
|
|
81304
|
+
if (!hasSignificantOverlap(rect, other)) continue;
|
|
81305
|
+
if (isLargerRect(rect, other)) {
|
|
81306
|
+
containers.add(rect);
|
|
81307
|
+
break;
|
|
81308
|
+
}
|
|
81309
|
+
}
|
|
81310
|
+
}
|
|
81311
|
+
const filtered = unique2.filter((rect) => !containers.has(rect));
|
|
81312
|
+
result.push(...filtered.length > 0 ? filtered : unique2);
|
|
80126
81313
|
}
|
|
80127
81314
|
return result;
|
|
80128
81315
|
}
|
|
@@ -80246,10 +81433,11 @@ ${l}
|
|
|
80246
81433
|
function createHiddenHost(doc2, widthPx) {
|
|
80247
81434
|
const host = doc2.createElement("div");
|
|
80248
81435
|
host.className = "presentation-editor__hidden-host";
|
|
80249
|
-
host.style.position = "
|
|
81436
|
+
host.style.position = "fixed";
|
|
80250
81437
|
host.style.left = "-9999px";
|
|
80251
81438
|
host.style.top = "0";
|
|
80252
81439
|
host.style.width = `${widthPx}px`;
|
|
81440
|
+
host.style.setProperty("overflow-anchor", "none");
|
|
80253
81441
|
host.style.pointerEvents = "none";
|
|
80254
81442
|
host.style.opacity = "0";
|
|
80255
81443
|
host.style.zIndex = "-1";
|
|
@@ -80723,7 +81911,8 @@ ${l}
|
|
|
80723
81911
|
});
|
|
80724
81912
|
let hitChain = [];
|
|
80725
81913
|
const doc2 = document;
|
|
80726
|
-
|
|
81914
|
+
const hasElementsFromPoint = typeof doc2.elementsFromPoint === "function";
|
|
81915
|
+
if (hasElementsFromPoint) {
|
|
80727
81916
|
try {
|
|
80728
81917
|
hitChain = doc2.elementsFromPoint(viewX, viewY) ?? [];
|
|
80729
81918
|
} catch {
|
|
@@ -80769,11 +81958,14 @@ ${l}
|
|
|
80769
81958
|
log("All fragments on page:", JSON.stringify(fragmentData, null, 2));
|
|
80770
81959
|
const fragmentEl = hitChain.find((el) => el.classList?.contains?.(CLASS_NAMES.fragment));
|
|
80771
81960
|
if (!fragmentEl) {
|
|
81961
|
+
if (hasElementsFromPoint) {
|
|
81962
|
+
return null;
|
|
81963
|
+
}
|
|
80772
81964
|
const fallbackFragment = pageEl.querySelector(`.${CLASS_NAMES.fragment}`);
|
|
80773
81965
|
if (!fallbackFragment) {
|
|
80774
81966
|
return null;
|
|
80775
81967
|
}
|
|
80776
|
-
log("Using fallback fragment:", {
|
|
81968
|
+
log("Using fallback fragment (no elementsFromPoint):", {
|
|
80777
81969
|
blockId: fallbackFragment.dataset.blockId,
|
|
80778
81970
|
pmStart: fallbackFragment.dataset.pmStart,
|
|
80779
81971
|
pmEnd: fallbackFragment.dataset.pmEnd
|
|
@@ -88384,9 +89576,9 @@ ${l}
|
|
|
88384
89576
|
}
|
|
88385
89577
|
return types2;
|
|
88386
89578
|
}
|
|
88387
|
-
const isObject$
|
|
89579
|
+
const isObject$3 = (value) => typeof value === "object" && value !== null;
|
|
88388
89580
|
function buildPositionMapFromPmDoc(pmDoc, jsonDoc) {
|
|
88389
|
-
if (!pmDoc || !isObject$
|
|
89581
|
+
if (!pmDoc || !isObject$3(jsonDoc)) return null;
|
|
88390
89582
|
const map2 = /* @__PURE__ */ new WeakMap();
|
|
88391
89583
|
const walk = (pmNode, jsonNode, pos, isDoc) => {
|
|
88392
89584
|
const jsonType = jsonNode.type;
|
|
@@ -88407,7 +89599,7 @@ ${l}
|
|
|
88407
89599
|
let ok22 = true;
|
|
88408
89600
|
pmNode.forEach((child, offset2, index2) => {
|
|
88409
89601
|
const jsonChild = jsonContent[index2];
|
|
88410
|
-
if (!isObject$
|
|
89602
|
+
if (!isObject$3(jsonChild)) {
|
|
88411
89603
|
ok22 = false;
|
|
88412
89604
|
return;
|
|
88413
89605
|
}
|
|
@@ -92811,13 +94003,13 @@ ${l}
|
|
|
92811
94003
|
(name) => name.startsWith("w:") ? [name, name.slice(2)] : [name, `w:${name}`]
|
|
92812
94004
|
)
|
|
92813
94005
|
);
|
|
92814
|
-
const
|
|
94006
|
+
const match2 = elements.find((el) => {
|
|
92815
94007
|
if (!el || typeof el !== "object") return false;
|
|
92816
94008
|
const name = el.name;
|
|
92817
94009
|
return typeof name === "string" && normalizedTargets.has(name);
|
|
92818
94010
|
});
|
|
92819
|
-
if (!
|
|
92820
|
-
const rawVal =
|
|
94011
|
+
if (!match2) return void 0;
|
|
94012
|
+
const rawVal = match2.attributes?.["w:val"] ?? match2.attributes?.val;
|
|
92821
94013
|
if (rawVal == null) return true;
|
|
92822
94014
|
if (isExplicitFalse(rawVal)) return false;
|
|
92823
94015
|
if (isTruthy(rawVal)) return true;
|
|
@@ -94352,11 +95544,11 @@ ${l}
|
|
|
94352
95544
|
if (typeof raw === "number" && Number.isFinite(raw)) return raw;
|
|
94353
95545
|
if (typeof raw !== "string") return void 0;
|
|
94354
95546
|
const trimmed = raw.trim();
|
|
94355
|
-
const
|
|
94356
|
-
if (!
|
|
94357
|
-
const numeric = parseFloat(
|
|
95547
|
+
const match2 = trimmed.match(/^(-?\d+(\.\d+)?)([a-z%]*)$/i);
|
|
95548
|
+
if (!match2) return void 0;
|
|
95549
|
+
const numeric = parseFloat(match2[1]);
|
|
94358
95550
|
if (!Number.isFinite(numeric)) return void 0;
|
|
94359
|
-
const unit =
|
|
95551
|
+
const unit = match2[3]?.toLowerCase();
|
|
94360
95552
|
if (!unit || unit === "px") return numeric;
|
|
94361
95553
|
if (unit === "pt") return numeric * PT_TO_PX;
|
|
94362
95554
|
return numeric;
|
|
@@ -98464,8 +99656,8 @@ ${l}
|
|
|
98464
99656
|
}
|
|
98465
99657
|
}
|
|
98466
99658
|
for (let wordIndex = 0; wordIndex < words.length; wordIndex++) {
|
|
98467
|
-
const
|
|
98468
|
-
if (
|
|
99659
|
+
const word2 = words[wordIndex];
|
|
99660
|
+
if (word2 === "") {
|
|
98469
99661
|
const spaceStartChar = charPosInRun;
|
|
98470
99662
|
const spaceEndChar = charPosInRun + 1;
|
|
98471
99663
|
const singleSpaceWidth = measureRunWidth(" ", font, ctx2, run2);
|
|
@@ -98519,15 +99711,15 @@ ${l}
|
|
|
98519
99711
|
charPosInRun = spaceEndChar;
|
|
98520
99712
|
continue;
|
|
98521
99713
|
}
|
|
98522
|
-
const wordOnlyWidth = measureRunWidth(
|
|
99714
|
+
const wordOnlyWidth = measureRunWidth(word2, font, ctx2, run2);
|
|
98523
99715
|
const shouldIncludeDelimiterSpace = wordIndex < lastNonEmptyWordIndex;
|
|
98524
99716
|
const spaceWidth = shouldIncludeDelimiterSpace ? measureRunWidth(" ", font, ctx2, run2) : 0;
|
|
98525
99717
|
const wordCommitWidth = wordOnlyWidth + spaceWidth;
|
|
98526
99718
|
const wordStartChar = charPosInRun;
|
|
98527
|
-
const wordEndNoSpace = charPosInRun +
|
|
99719
|
+
const wordEndNoSpace = charPosInRun + word2.length;
|
|
98528
99720
|
const wordEndWithSpace = wordEndNoSpace + (shouldIncludeDelimiterSpace ? 1 : 0);
|
|
98529
99721
|
const effectiveMaxWidth = currentLine ? currentLine.maxWidth : getEffectiveWidth(lines.length === 0 ? initialAvailableWidth : contentWidth);
|
|
98530
|
-
if (wordOnlyWidth > effectiveMaxWidth &&
|
|
99722
|
+
if (wordOnlyWidth > effectiveMaxWidth && word2.length > 1) {
|
|
98531
99723
|
if (currentLine && currentLine.width > 0 && currentLine.segments && currentLine.segments.length > 0) {
|
|
98532
99724
|
trimTrailingWrapSpaces(currentLine);
|
|
98533
99725
|
const metrics = calculateTypographyMetrics(currentLine.maxFontSize, spacing, currentLine.maxFontInfo);
|
|
@@ -98543,7 +99735,7 @@ ${l}
|
|
|
98543
99735
|
const hasTabOnlyLine = currentLine && currentLine.segments && currentLine.segments.length === 0 && currentLine.width > 0;
|
|
98544
99736
|
const remainingWidthAfterTab = hasTabOnlyLine ? currentLine.maxWidth - currentLine.width : lineMaxWidth;
|
|
98545
99737
|
const chunkWidth = hasTabOnlyLine ? Math.max(remainingWidthAfterTab, lineMaxWidth * 0.25) : lineMaxWidth;
|
|
98546
|
-
const chunks = breakWordIntoChunks(
|
|
99738
|
+
const chunks = breakWordIntoChunks(word2, chunkWidth - WIDTH_FUDGE_PX2, font, ctx2, run2);
|
|
98547
99739
|
let chunkCharOffset = wordStartChar;
|
|
98548
99740
|
for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) {
|
|
98549
99741
|
const chunk = chunks[chunkIndex];
|
|
@@ -99218,10 +100410,10 @@ ${l}
|
|
|
99218
100410
|
const width = getMeasuredTextWidth(text2, font, letterSpacing, ctx2);
|
|
99219
100411
|
return roundValue(width);
|
|
99220
100412
|
};
|
|
99221
|
-
const breakWordIntoChunks = (
|
|
100413
|
+
const breakWordIntoChunks = (word2, maxWidth, font, ctx2, run2) => {
|
|
99222
100414
|
const chunks = [];
|
|
99223
100415
|
if (maxWidth <= 0) {
|
|
99224
|
-
for (const char of
|
|
100416
|
+
for (const char of word2) {
|
|
99225
100417
|
const charWidth = measureRunWidth(char, font, ctx2, run2);
|
|
99226
100418
|
chunks.push({ text: char, width: charWidth });
|
|
99227
100419
|
}
|
|
@@ -99229,8 +100421,8 @@ ${l}
|
|
|
99229
100421
|
}
|
|
99230
100422
|
let currentChunk = "";
|
|
99231
100423
|
let currentWidth = 0;
|
|
99232
|
-
for (let i2 = 0; i2 <
|
|
99233
|
-
const char =
|
|
100424
|
+
for (let i2 = 0; i2 < word2.length; i2++) {
|
|
100425
|
+
const char = word2[i2];
|
|
99234
100426
|
const testChunk = currentChunk + char;
|
|
99235
100427
|
const testWidth = measureRunWidth(testChunk, font, ctx2, run2);
|
|
99236
100428
|
if (testWidth > maxWidth && currentChunk.length > 0) {
|
|
@@ -99803,6 +100995,25 @@ ${l}
|
|
|
99803
100995
|
} else {
|
|
99804
100996
|
__privateSet(this, _dragExtensionMode, "char");
|
|
99805
100997
|
}
|
|
100998
|
+
debugLog(
|
|
100999
|
+
"verbose",
|
|
101000
|
+
`Drag selection start ${JSON.stringify({
|
|
101001
|
+
pointer: { clientX: event.clientX, clientY: event.clientY, x: x2, y: y2 },
|
|
101002
|
+
clickDepth,
|
|
101003
|
+
extensionMode: __privateGet$1(this, _dragExtensionMode),
|
|
101004
|
+
anchor: __privateGet$1(this, _dragAnchor),
|
|
101005
|
+
anchorPageIndex: __privateGet$1(this, _dragAnchorPageIndex),
|
|
101006
|
+
rawHit: rawHit ? {
|
|
101007
|
+
pos: rawHit.pos,
|
|
101008
|
+
pageIndex: rawHit.pageIndex,
|
|
101009
|
+
blockId: rawHit.blockId,
|
|
101010
|
+
lineIndex: rawHit.lineIndex,
|
|
101011
|
+
layoutEpoch: rawHit.layoutEpoch
|
|
101012
|
+
} : null,
|
|
101013
|
+
mapped: mapped ? mapped.ok ? { ok: true, pos: mapped.pos, fromEpoch: mapped.fromEpoch, toEpoch: mapped.toEpoch } : { ok: false, reason: mapped.reason, fromEpoch: mapped.fromEpoch, toEpoch: mapped.toEpoch } : null,
|
|
101014
|
+
hit: hit ? { pos: hit.pos, pageIndex: hit.pageIndex, layoutEpoch: hit.layoutEpoch } : null
|
|
101015
|
+
})}`
|
|
101016
|
+
);
|
|
99806
101017
|
if (typeof __privateGet$1(this, _viewportHost).setPointerCapture === "function") {
|
|
99807
101018
|
__privateGet$1(this, _viewportHost).setPointerCapture(event.pointerId);
|
|
99808
101019
|
}
|
|
@@ -99839,6 +101050,8 @@ ${l}
|
|
|
99839
101050
|
if (!normalized) return;
|
|
99840
101051
|
if (__privateGet$1(this, _isDragging) && __privateGet$1(this, _dragAnchor) !== null && event.buttons & 1) {
|
|
99841
101052
|
__privateSet(this, _pendingMarginClick, null);
|
|
101053
|
+
const prevPointer = __privateGet$1(this, _dragLastPointer);
|
|
101054
|
+
const prevRawHit = __privateGet$1(this, _dragLastRawHit);
|
|
99842
101055
|
__privateSet(this, _dragLastPointer, { clientX: event.clientX, clientY: event.clientY, x: normalized.x, y: normalized.y });
|
|
99843
101056
|
const rawHit = clickToPosition(
|
|
99844
101057
|
__privateGet$1(this, _layoutState).layout,
|
|
@@ -99850,7 +101063,17 @@ ${l}
|
|
|
99850
101063
|
event.clientY,
|
|
99851
101064
|
__privateGet$1(this, _pageGeometryHelper) ?? void 0
|
|
99852
101065
|
);
|
|
99853
|
-
if (!rawHit)
|
|
101066
|
+
if (!rawHit) {
|
|
101067
|
+
debugLog(
|
|
101068
|
+
"verbose",
|
|
101069
|
+
`Drag selection update (no hit) ${JSON.stringify({
|
|
101070
|
+
pointer: { clientX: event.clientX, clientY: event.clientY, x: normalized.x, y: normalized.y },
|
|
101071
|
+
prevPointer,
|
|
101072
|
+
anchor: __privateGet$1(this, _dragAnchor)
|
|
101073
|
+
})}`
|
|
101074
|
+
);
|
|
101075
|
+
return;
|
|
101076
|
+
}
|
|
99854
101077
|
const doc22 = __privateGet$1(this, _editor3).state?.doc;
|
|
99855
101078
|
if (!doc22) return;
|
|
99856
101079
|
__privateSet(this, _dragLastRawHit, rawHit);
|
|
@@ -99863,6 +101086,27 @@ ${l}
|
|
|
99863
101086
|
const mappedHead = __privateGet$1(this, _epochMapper).mapPosFromLayoutToCurrentDetailed(rawHit.pos, rawHit.layoutEpoch, 1);
|
|
99864
101087
|
if (!mappedHead.ok) {
|
|
99865
101088
|
debugLog("warn", "drag mapping failed", mappedHead);
|
|
101089
|
+
debugLog(
|
|
101090
|
+
"verbose",
|
|
101091
|
+
`Drag selection update (map failed) ${JSON.stringify({
|
|
101092
|
+
pointer: { clientX: event.clientX, clientY: event.clientY, x: normalized.x, y: normalized.y },
|
|
101093
|
+
prevPointer,
|
|
101094
|
+
anchor: __privateGet$1(this, _dragAnchor),
|
|
101095
|
+
rawHit: {
|
|
101096
|
+
pos: rawHit.pos,
|
|
101097
|
+
pageIndex: rawHit.pageIndex,
|
|
101098
|
+
blockId: rawHit.blockId,
|
|
101099
|
+
lineIndex: rawHit.lineIndex,
|
|
101100
|
+
layoutEpoch: rawHit.layoutEpoch
|
|
101101
|
+
},
|
|
101102
|
+
mapped: {
|
|
101103
|
+
ok: false,
|
|
101104
|
+
reason: mappedHead.reason,
|
|
101105
|
+
fromEpoch: mappedHead.fromEpoch,
|
|
101106
|
+
toEpoch: mappedHead.toEpoch
|
|
101107
|
+
}
|
|
101108
|
+
})}`
|
|
101109
|
+
);
|
|
99866
101110
|
return;
|
|
99867
101111
|
}
|
|
99868
101112
|
const hit = {
|
|
@@ -99877,6 +101121,41 @@ ${l}
|
|
|
99877
101121
|
mappedPos: hit.pos
|
|
99878
101122
|
});
|
|
99879
101123
|
__privateMethod$1(this, _PresentationEditor_instances, updateSelectionDebugHud_fn).call(this);
|
|
101124
|
+
const anchor = __privateGet$1(this, _dragAnchor);
|
|
101125
|
+
const head = hit.pos;
|
|
101126
|
+
const { selAnchor, selHead } = __privateMethod$1(this, _PresentationEditor_instances, calculateExtendedSelection_fn).call(this, anchor, head, __privateGet$1(this, _dragExtensionMode));
|
|
101127
|
+
debugLog(
|
|
101128
|
+
"verbose",
|
|
101129
|
+
`Drag selection update ${JSON.stringify({
|
|
101130
|
+
pointer: { clientX: event.clientX, clientY: event.clientY, x: normalized.x, y: normalized.y },
|
|
101131
|
+
prevPointer,
|
|
101132
|
+
rawHit: {
|
|
101133
|
+
pos: rawHit.pos,
|
|
101134
|
+
pageIndex: rawHit.pageIndex,
|
|
101135
|
+
blockId: rawHit.blockId,
|
|
101136
|
+
lineIndex: rawHit.lineIndex,
|
|
101137
|
+
layoutEpoch: rawHit.layoutEpoch
|
|
101138
|
+
},
|
|
101139
|
+
prevRawHit: prevRawHit ? {
|
|
101140
|
+
pos: prevRawHit.pos,
|
|
101141
|
+
pageIndex: prevRawHit.pageIndex,
|
|
101142
|
+
blockId: prevRawHit.blockId,
|
|
101143
|
+
lineIndex: prevRawHit.lineIndex,
|
|
101144
|
+
layoutEpoch: prevRawHit.layoutEpoch
|
|
101145
|
+
} : null,
|
|
101146
|
+
mappedHead: { pos: mappedHead.pos, fromEpoch: mappedHead.fromEpoch, toEpoch: mappedHead.toEpoch },
|
|
101147
|
+
hit: { pos: hit.pos, pageIndex: hit.pageIndex, layoutEpoch: hit.layoutEpoch },
|
|
101148
|
+
anchor,
|
|
101149
|
+
head,
|
|
101150
|
+
selAnchor,
|
|
101151
|
+
selHead,
|
|
101152
|
+
direction: head >= anchor ? "down" : "up",
|
|
101153
|
+
selectionDirection: selHead >= selAnchor ? "down" : "up",
|
|
101154
|
+
extensionMode: __privateGet$1(this, _dragExtensionMode),
|
|
101155
|
+
hitSource: pageMounted ? "dom" : "geometry",
|
|
101156
|
+
pageMounted
|
|
101157
|
+
})}`
|
|
101158
|
+
);
|
|
99880
101159
|
const currentTableHit = __privateMethod$1(this, _PresentationEditor_instances, hitTestTable_fn).call(this, normalized.x, normalized.y);
|
|
99881
101160
|
const shouldUseCellSel = __privateMethod$1(this, _PresentationEditor_instances, shouldUseCellSelection_fn).call(this, currentTableHit);
|
|
99882
101161
|
if (shouldUseCellSel && __privateGet$1(this, _cellAnchor)) {
|
|
@@ -99911,9 +101190,6 @@ ${l}
|
|
|
99911
101190
|
return;
|
|
99912
101191
|
}
|
|
99913
101192
|
}
|
|
99914
|
-
const anchor = __privateGet$1(this, _dragAnchor);
|
|
99915
|
-
const head = hit.pos;
|
|
99916
|
-
const { selAnchor, selHead } = __privateMethod$1(this, _PresentationEditor_instances, calculateExtendedSelection_fn).call(this, anchor, head, __privateGet$1(this, _dragExtensionMode));
|
|
99917
101193
|
try {
|
|
99918
101194
|
const tr = __privateGet$1(this, _editor3).state.tr.setSelection(TextSelection$1.create(__privateGet$1(this, _editor3).state.doc, selAnchor, selHead));
|
|
99919
101195
|
__privateGet$1(this, _editor3).view?.dispatch(tr);
|
|
@@ -100308,6 +101584,7 @@ ${l}
|
|
|
100308
101584
|
editorProps: normalizedEditorProps,
|
|
100309
101585
|
documentMode: __privateGet$1(this, _documentMode)
|
|
100310
101586
|
}));
|
|
101587
|
+
__privateMethod$1(this, _PresentationEditor_instances, wrapHiddenEditorFocus_fn).call(this);
|
|
100311
101588
|
__privateGet$1(this, _editor3).presentationEditor = this;
|
|
100312
101589
|
__privateGet$1(this, _editor3)._presentationEditor = this;
|
|
100313
101590
|
__privateMethod$1(this, _PresentationEditor_instances, syncHiddenEditorA11yAttributes_fn).call(this);
|
|
@@ -101507,6 +102784,65 @@ ${l}
|
|
|
101507
102784
|
_lastRemoteCursorRenderTime = /* @__PURE__ */ new WeakMap();
|
|
101508
102785
|
_remoteCursorThrottleTimeout = /* @__PURE__ */ new WeakMap();
|
|
101509
102786
|
_PresentationEditor_instances = /* @__PURE__ */ new WeakSet();
|
|
102787
|
+
wrapHiddenEditorFocus_fn = function() {
|
|
102788
|
+
const view = __privateGet$1(this, _editor3)?.view;
|
|
102789
|
+
if (!view || !view.dom || typeof view.focus !== "function") {
|
|
102790
|
+
return;
|
|
102791
|
+
}
|
|
102792
|
+
const viewWithFlag = view;
|
|
102793
|
+
if (viewWithFlag.__sdPreventScrollFocus) {
|
|
102794
|
+
return;
|
|
102795
|
+
}
|
|
102796
|
+
const focusFn = view.focus;
|
|
102797
|
+
if (focusFn.mock) {
|
|
102798
|
+
return;
|
|
102799
|
+
}
|
|
102800
|
+
viewWithFlag.__sdPreventScrollFocus = true;
|
|
102801
|
+
const originalFocus = view.focus.bind(view);
|
|
102802
|
+
view.focus = () => {
|
|
102803
|
+
const win = __privateGet$1(this, _visibleHost).ownerDocument?.defaultView;
|
|
102804
|
+
if (!win) {
|
|
102805
|
+
originalFocus();
|
|
102806
|
+
return;
|
|
102807
|
+
}
|
|
102808
|
+
const beforeX = win.scrollX;
|
|
102809
|
+
const beforeY = win.scrollY;
|
|
102810
|
+
let focused = false;
|
|
102811
|
+
try {
|
|
102812
|
+
view.dom.focus({ preventScroll: true });
|
|
102813
|
+
focused = true;
|
|
102814
|
+
} catch (error) {
|
|
102815
|
+
debugLog("warn", "Hidden editor focus: preventScroll failed", {
|
|
102816
|
+
error: String(error),
|
|
102817
|
+
strategy: "preventScroll"
|
|
102818
|
+
});
|
|
102819
|
+
}
|
|
102820
|
+
if (!focused) {
|
|
102821
|
+
try {
|
|
102822
|
+
view.dom.focus();
|
|
102823
|
+
focused = true;
|
|
102824
|
+
} catch (error) {
|
|
102825
|
+
debugLog("warn", "Hidden editor focus: standard focus failed", {
|
|
102826
|
+
error: String(error),
|
|
102827
|
+
strategy: "standard"
|
|
102828
|
+
});
|
|
102829
|
+
}
|
|
102830
|
+
}
|
|
102831
|
+
if (!focused) {
|
|
102832
|
+
try {
|
|
102833
|
+
originalFocus();
|
|
102834
|
+
} catch (error) {
|
|
102835
|
+
debugLog("error", "Hidden editor focus: all strategies failed", {
|
|
102836
|
+
error: String(error),
|
|
102837
|
+
strategy: "original"
|
|
102838
|
+
});
|
|
102839
|
+
}
|
|
102840
|
+
}
|
|
102841
|
+
if (win.scrollX !== beforeX || win.scrollY !== beforeY) {
|
|
102842
|
+
win.scrollTo(beforeX, beforeY);
|
|
102843
|
+
}
|
|
102844
|
+
};
|
|
102845
|
+
};
|
|
101510
102846
|
collectCommentPositions_fn = function() {
|
|
101511
102847
|
return collectCommentPositions(__privateGet$1(this, _editor3)?.state?.doc ?? null, {
|
|
101512
102848
|
commentMarkName: CommentMarkName,
|
|
@@ -103021,8 +104357,8 @@ ${l}
|
|
|
103021
104357
|
}
|
|
103022
104358
|
if (region.sectionType) {
|
|
103023
104359
|
const descriptors2 = __privateGet$1(this, _headerFooterManager).getDescriptors(region.kind);
|
|
103024
|
-
const
|
|
103025
|
-
if (
|
|
104360
|
+
const match2 = descriptors2.find((entry) => entry.variant === region.sectionType);
|
|
104361
|
+
if (match2) return match2;
|
|
103026
104362
|
}
|
|
103027
104363
|
const descriptors = __privateGet$1(this, _headerFooterManager).getDescriptors(region.kind);
|
|
103028
104364
|
if (!descriptors.length) {
|
|
@@ -106264,7 +107600,7 @@ ${l}
|
|
|
106264
107600
|
*/
|
|
106265
107601
|
getDocumentStats: () => ({ editor }) => {
|
|
106266
107602
|
const text2 = editor.getText();
|
|
106267
|
-
const words = text2.split(/\s+/).filter((
|
|
107603
|
+
const words = text2.split(/\s+/).filter((word2) => word2.length > 0).length;
|
|
106268
107604
|
const characters = text2.length;
|
|
106269
107605
|
const paragraphs = editor.state.doc.content.childCount;
|
|
106270
107606
|
return {
|
|
@@ -106380,9 +107716,9 @@ ${l}
|
|
|
106380
107716
|
ranges.forEach(({ from: from2, to }) => {
|
|
106381
107717
|
state2.doc.nodesBetween(from2, to, (node2, pos, parent, index2) => {
|
|
106382
107718
|
if (!node2.isText || !parent || parent.type === runType) return;
|
|
106383
|
-
const
|
|
106384
|
-
if (
|
|
106385
|
-
if (!
|
|
107719
|
+
const match2 = parent.contentMatchAt ? parent.contentMatchAt(index2) : null;
|
|
107720
|
+
if (match2 && !match2.matchType(runType)) return;
|
|
107721
|
+
if (!match2 && !parent.type.contentMatch.matchType(runType)) return;
|
|
106386
107722
|
const runProperties = decodeRPrFromMarks(node2.marks);
|
|
106387
107723
|
const runNode = runType.create({ runProperties }, node2);
|
|
106388
107724
|
replacements.push({ from: pos, to: pos + node2.nodeSize, runNode });
|
|
@@ -109079,8 +110415,8 @@ ${l}
|
|
|
109079
110415
|
let resolvedTablePos = tablePos;
|
|
109080
110416
|
if (typeof resolvedTablePos !== "number" && workingTable) {
|
|
109081
110417
|
const tables = editor.getNodesOfType("table");
|
|
109082
|
-
const
|
|
109083
|
-
resolvedTablePos =
|
|
110418
|
+
const match2 = workingTable ? tables.find((t) => t.node.eq(workingTable)) : tables[0];
|
|
110419
|
+
resolvedTablePos = match2?.pos ?? null;
|
|
109084
110420
|
}
|
|
109085
110421
|
if (typeof resolvedTablePos !== "number") {
|
|
109086
110422
|
return false;
|
|
@@ -120067,8 +121403,8 @@ ${l}
|
|
|
120067
121403
|
if (from2 < 1) return false;
|
|
120068
121404
|
const textBefore = this.getMentionText(from2);
|
|
120069
121405
|
const mentionPattern = /(?:^|\s)@[\w]*$/;
|
|
120070
|
-
const
|
|
120071
|
-
return
|
|
121406
|
+
const match2 = textBefore.match(mentionPattern);
|
|
121407
|
+
return match2 && this.state.selection.empty;
|
|
120072
121408
|
}
|
|
120073
121409
|
destroy() {
|
|
120074
121410
|
this.tippyInstance.destroy();
|
|
@@ -120146,8 +121482,8 @@ ${l}
|
|
|
120146
121482
|
let $from = state2.doc.resolve(result.from);
|
|
120147
121483
|
let marks = $from.marksAcross(state2.doc.resolve(result.to));
|
|
120148
121484
|
let ranges = [];
|
|
120149
|
-
let frag = Fragment$1.empty, pos = result.from, { match } = result;
|
|
120150
|
-
let groups =
|
|
121485
|
+
let frag = Fragment$1.empty, pos = result.from, { match: match2 } = result;
|
|
121486
|
+
let groups = match2 ? getGroupIndices(match2) : [[0, result.to - result.from]];
|
|
120151
121487
|
let replParts = parseReplacement(this.unquote(this.replace));
|
|
120152
121488
|
for (let part of replParts) {
|
|
120153
121489
|
if (typeof part == "string") {
|
|
@@ -120225,39 +121561,39 @@ ${l}
|
|
|
120225
121561
|
return scanTextblocks(state2.doc, from2, to, (node2, start2) => {
|
|
120226
121562
|
let content2 = textContent(node2).slice(0, Math.min(node2.content.size, to - start2));
|
|
120227
121563
|
this.regexp.lastIndex = from2 - start2;
|
|
120228
|
-
let
|
|
120229
|
-
if (!
|
|
120230
|
-
const absoluteIndex =
|
|
121564
|
+
let match2 = this.regexp.exec(content2);
|
|
121565
|
+
if (!match2) return null;
|
|
121566
|
+
const absoluteIndex = match2.index;
|
|
120231
121567
|
const fromPos = mapIndexToDocPos(node2, start2, absoluteIndex);
|
|
120232
|
-
const toPos = mapIndexToDocPos(node2, start2, absoluteIndex +
|
|
120233
|
-
return { from: fromPos, to: toPos, match, matchStart: start2 };
|
|
121568
|
+
const toPos = mapIndexToDocPos(node2, start2, absoluteIndex + match2[0].length);
|
|
121569
|
+
return { from: fromPos, to: toPos, match: match2, matchStart: start2 };
|
|
120234
121570
|
});
|
|
120235
121571
|
}
|
|
120236
121572
|
findPrev(state2, from2, to) {
|
|
120237
121573
|
return scanTextblocks(state2.doc, from2, to, (node2, start2) => {
|
|
120238
121574
|
let content2 = textContent(node2).slice(0, Math.min(node2.content.size, from2 - start2));
|
|
120239
|
-
let
|
|
121575
|
+
let match2;
|
|
120240
121576
|
for (let off2 = 0; ; ) {
|
|
120241
121577
|
this.regexp.lastIndex = off2;
|
|
120242
121578
|
let next2 = this.regexp.exec(content2);
|
|
120243
121579
|
if (!next2) break;
|
|
120244
|
-
|
|
121580
|
+
match2 = next2;
|
|
120245
121581
|
off2 = next2.index + 1;
|
|
120246
121582
|
}
|
|
120247
|
-
if (!
|
|
120248
|
-
const absoluteIndex =
|
|
121583
|
+
if (!match2) return null;
|
|
121584
|
+
const absoluteIndex = match2.index;
|
|
120249
121585
|
const fromPos = mapIndexToDocPos(node2, start2, absoluteIndex);
|
|
120250
|
-
const toPos = mapIndexToDocPos(node2, start2, absoluteIndex +
|
|
120251
|
-
return { from: fromPos, to: toPos, match, matchStart: start2 };
|
|
121586
|
+
const toPos = mapIndexToDocPos(node2, start2, absoluteIndex + match2[0].length);
|
|
121587
|
+
return { from: fromPos, to: toPos, match: match2, matchStart: start2 };
|
|
120252
121588
|
});
|
|
120253
121589
|
}
|
|
120254
121590
|
}
|
|
120255
|
-
function getGroupIndices(
|
|
120256
|
-
if (
|
|
120257
|
-
let result = [[0,
|
|
120258
|
-
for (let i2 = 1, pos = 0; i2 <
|
|
120259
|
-
let found2 =
|
|
120260
|
-
result.push(found2 < 0 ? void 0 : [found2, pos = found2 +
|
|
121591
|
+
function getGroupIndices(match2) {
|
|
121592
|
+
if (match2.indices) return match2.indices;
|
|
121593
|
+
let result = [[0, match2[0].length]];
|
|
121594
|
+
for (let i2 = 1, pos = 0; i2 < match2.length; i2++) {
|
|
121595
|
+
let found2 = match2[i2] ? match2[0].indexOf(match2[i2], pos) : -1;
|
|
121596
|
+
result.push(found2 < 0 ? void 0 : [found2, pos = found2 + match2[i2].length]);
|
|
120261
121597
|
}
|
|
120262
121598
|
return result;
|
|
120263
121599
|
}
|
|
@@ -120499,8 +121835,8 @@ ${l}
|
|
|
120499
121835
|
const matches2 = storage?.searchResults;
|
|
120500
121836
|
if (!matches2?.length) return null;
|
|
120501
121837
|
const decorations = matches2.map(
|
|
120502
|
-
(
|
|
120503
|
-
id: `search-match-${
|
|
121838
|
+
(match2) => Decoration.inline(match2.from, match2.to, {
|
|
121839
|
+
id: `search-match-${match2.id}`
|
|
120504
121840
|
})
|
|
120505
121841
|
);
|
|
120506
121842
|
return DecorationSet.create(state2.doc, decorations);
|
|
@@ -120604,10 +121940,10 @@ ${l}
|
|
|
120604
121940
|
* editor.commands.goToSearchResult(searchResults[3])
|
|
120605
121941
|
* @note Scrolls to match and selects it
|
|
120606
121942
|
*/
|
|
120607
|
-
goToSearchResult: (
|
|
121943
|
+
goToSearchResult: (match2) => (
|
|
120608
121944
|
/** @returns {boolean} */
|
|
120609
121945
|
(({ state: state2, dispatch, editor }) => {
|
|
120610
|
-
const { from: from2, to } =
|
|
121946
|
+
const { from: from2, to } = match2;
|
|
120611
121947
|
editor.view.focus();
|
|
120612
121948
|
const tr = state2.tr.setSelection(TextSelection$1.create(state2.doc, from2, to)).scrollIntoView();
|
|
120613
121949
|
dispatch(tr);
|
|
@@ -121347,7 +122683,7 @@ ${l}
|
|
|
121347
122683
|
}
|
|
121348
122684
|
const kebabRegex$1 = /[A-Z]/g;
|
|
121349
122685
|
function kebabCase$1(pattern) {
|
|
121350
|
-
return pattern.replace(kebabRegex$1, (
|
|
122686
|
+
return pattern.replace(kebabRegex$1, (match2) => "-" + match2.toLowerCase());
|
|
121351
122687
|
}
|
|
121352
122688
|
function unwrapProperty$1(prop, indent2 = " ") {
|
|
121353
122689
|
if (typeof prop === "object" && prop !== null) {
|
|
@@ -123871,7 +125207,7 @@ ${style2}
|
|
|
123871
125207
|
var parseDimension$1 = function(pixel) {
|
|
123872
125208
|
return parseFloat(pixel || "0");
|
|
123873
125209
|
};
|
|
123874
|
-
var size$
|
|
125210
|
+
var size$2 = function(inlineSize, blockSize, switchSizes) {
|
|
123875
125211
|
if (inlineSize === void 0) {
|
|
123876
125212
|
inlineSize = 0;
|
|
123877
125213
|
}
|
|
@@ -123884,9 +125220,9 @@ ${style2}
|
|
|
123884
125220
|
return new ResizeObserverSize$1((switchSizes ? blockSize : inlineSize) || 0, (switchSizes ? inlineSize : blockSize) || 0);
|
|
123885
125221
|
};
|
|
123886
125222
|
var zeroBoxes$1 = freeze$1({
|
|
123887
|
-
devicePixelContentBoxSize: size$
|
|
123888
|
-
borderBoxSize: size$
|
|
123889
|
-
contentBoxSize: size$
|
|
125223
|
+
devicePixelContentBoxSize: size$2(),
|
|
125224
|
+
borderBoxSize: size$2(),
|
|
125225
|
+
contentBoxSize: size$2(),
|
|
123890
125226
|
contentRect: new DOMRectReadOnly$1(0, 0, 0, 0)
|
|
123891
125227
|
});
|
|
123892
125228
|
var calculateBoxSizes$1 = function(target, forceRecalculation) {
|
|
@@ -123927,9 +125263,9 @@ ${style2}
|
|
|
123927
125263
|
var borderBoxWidth = contentWidth + horizontalPadding + verticalScrollbarThickness + horizontalBorderArea;
|
|
123928
125264
|
var borderBoxHeight = contentHeight + verticalPadding + horizontalScrollbarThickness + verticalBorderArea;
|
|
123929
125265
|
var boxes = freeze$1({
|
|
123930
|
-
devicePixelContentBoxSize: size$
|
|
123931
|
-
borderBoxSize: size$
|
|
123932
|
-
contentBoxSize: size$
|
|
125266
|
+
devicePixelContentBoxSize: size$2(Math.round(contentWidth * devicePixelRatio), Math.round(contentHeight * devicePixelRatio), switchSizes),
|
|
125267
|
+
borderBoxSize: size$2(borderBoxWidth, borderBoxHeight, switchSizes),
|
|
125268
|
+
contentBoxSize: size$2(contentWidth, contentHeight, switchSizes),
|
|
123933
125269
|
contentRect: new DOMRectReadOnly$1(paddingLeft, paddingTop, contentWidth, contentHeight)
|
|
123934
125270
|
});
|
|
123935
125271
|
cache$1.set(target, boxes);
|
|
@@ -125459,8 +126795,8 @@ ${style2}
|
|
|
125459
126795
|
if (string.charCodeAt(0) === 46) {
|
|
125460
126796
|
result.push("");
|
|
125461
126797
|
}
|
|
125462
|
-
string.replace(rePropName$1, function(
|
|
125463
|
-
result.push(quote ? subString.replace(reEscapeChar$1, "$1") : number2 ||
|
|
126798
|
+
string.replace(rePropName$1, function(match2, number2, quote, subString) {
|
|
126799
|
+
result.push(quote ? subString.replace(reEscapeChar$1, "$1") : number2 || match2);
|
|
125464
126800
|
});
|
|
125465
126801
|
return result;
|
|
125466
126802
|
});
|
|
@@ -131459,9 +132795,9 @@ ${style2}
|
|
|
131459
132795
|
function getJsonBetweenFencesFromResponse(buffer2) {
|
|
131460
132796
|
try {
|
|
131461
132797
|
const jsonRegex = /```json\s*\n([\s\S]*?)\n\s*```/;
|
|
131462
|
-
const
|
|
131463
|
-
if (
|
|
131464
|
-
const jsonObj = JSON.parse(
|
|
132798
|
+
const match2 = buffer2.match(jsonRegex);
|
|
132799
|
+
if (match2 && match2[1]) {
|
|
132800
|
+
const jsonObj = JSON.parse(match2[1]);
|
|
131465
132801
|
if (jsonObj.custom_prompt && jsonObj.custom_prompt.value !== void 0) {
|
|
131466
132802
|
return jsonObj.custom_prompt.value || "";
|
|
131467
132803
|
}
|
|
@@ -131553,19 +132889,19 @@ ${style2}
|
|
|
131553
132889
|
formatRegistry.rules.forEach((rule) => {
|
|
131554
132890
|
rule.pattern.lastIndex = 0;
|
|
131555
132891
|
const matches2 = [];
|
|
131556
|
-
let
|
|
131557
|
-
while ((
|
|
132892
|
+
let match2;
|
|
132893
|
+
while ((match2 = rule.pattern.exec(docText)) !== null) {
|
|
131558
132894
|
matches2.push({
|
|
131559
132895
|
rule,
|
|
131560
|
-
startPos:
|
|
131561
|
-
endPos:
|
|
131562
|
-
originalText:
|
|
131563
|
-
contentText:
|
|
132896
|
+
startPos: match2.index,
|
|
132897
|
+
endPos: match2.index + match2[0].length,
|
|
132898
|
+
originalText: match2[0],
|
|
132899
|
+
contentText: match2[1]
|
|
131564
132900
|
});
|
|
131565
132901
|
}
|
|
131566
132902
|
matches2.sort((a2, b2) => b2.startPos - a2.startPos);
|
|
131567
|
-
for (const
|
|
131568
|
-
const { startPos, endPos, originalText, contentText } =
|
|
132903
|
+
for (const match22 of matches2) {
|
|
132904
|
+
const { startPos, endPos, originalText, contentText } = match22;
|
|
131569
132905
|
try {
|
|
131570
132906
|
let tr = editor.state.tr;
|
|
131571
132907
|
const replacement = rule.transform(originalText, contentText, editor);
|
|
@@ -139422,7 +140758,7 @@ ${style2}
|
|
|
139422
140758
|
const trimLeftRegex = /^\s*/g;
|
|
139423
140759
|
const trimLeft = (s2) => s2.replace(trimLeftRegex, "");
|
|
139424
140760
|
const fromCamelCaseRegex = /([A-Z])/g;
|
|
139425
|
-
const fromCamelCase = (s2, separator) => trimLeft(s2.replace(fromCamelCaseRegex, (
|
|
140761
|
+
const fromCamelCase = (s2, separator) => trimLeft(s2.replace(fromCamelCaseRegex, (match2) => `${separator}${toLowerCase(match2)}`));
|
|
139426
140762
|
const _encodeUtf8Polyfill = (str) => {
|
|
139427
140763
|
const encodedString = unescape(encodeURIComponent(str));
|
|
139428
140764
|
const len2 = encodedString.length;
|
|
@@ -139482,6 +140818,7 @@ ${style2}
|
|
|
139482
140818
|
/** @type {any} */
|
|
139483
140819
|
eventHandler
|
|
139484
140820
|
);
|
|
140821
|
+
const EqualityTraitSymbol = Symbol("Equality");
|
|
139485
140822
|
const keys$2 = Object.keys;
|
|
139486
140823
|
const map$4 = (obj, f2) => {
|
|
139487
140824
|
const results = [];
|
|
@@ -139490,14 +140827,13 @@ ${style2}
|
|
|
139490
140827
|
}
|
|
139491
140828
|
return results;
|
|
139492
140829
|
};
|
|
139493
|
-
const
|
|
140830
|
+
const size$1 = (obj) => keys$2(obj).length;
|
|
139494
140831
|
const hasProperty$1 = (obj, key2) => Object.prototype.hasOwnProperty.call(obj, key2);
|
|
139495
|
-
const EqualityTraitSymbol = Symbol("Equality");
|
|
139496
140832
|
const equalityDeep = (a2, b2) => {
|
|
139497
140833
|
if (a2 === b2) {
|
|
139498
140834
|
return true;
|
|
139499
140835
|
}
|
|
139500
|
-
if (a2 == null || b2 == null || a2.constructor !== b2.constructor) {
|
|
140836
|
+
if (a2 == null || b2 == null || a2.constructor !== b2.constructor && (a2.constructor || Object) !== (b2.constructor || Object)) {
|
|
139501
140837
|
return false;
|
|
139502
140838
|
}
|
|
139503
140839
|
if (a2[EqualityTraitSymbol] != null) {
|
|
@@ -139541,8 +140877,9 @@ ${style2}
|
|
|
139541
140877
|
}
|
|
139542
140878
|
break;
|
|
139543
140879
|
}
|
|
140880
|
+
case void 0:
|
|
139544
140881
|
case Object:
|
|
139545
|
-
if (
|
|
140882
|
+
if (size$1(a2) !== size$1(b2)) {
|
|
139546
140883
|
return false;
|
|
139547
140884
|
}
|
|
139548
140885
|
for (const key2 in a2) {
|
|
@@ -139715,7 +141052,7 @@ ${style2}
|
|
|
139715
141052
|
const errorIntegerOutOfRange = create$4("Integer out of Range");
|
|
139716
141053
|
class Decoder {
|
|
139717
141054
|
/**
|
|
139718
|
-
* @param {Uint8Array} uint8Array Binary data to decode
|
|
141055
|
+
* @param {Uint8Array<Buf>} uint8Array Binary data to decode
|
|
139719
141056
|
*/
|
|
139720
141057
|
constructor(uint8Array) {
|
|
139721
141058
|
this.arr = uint8Array;
|
|
@@ -139866,10 +141203,14 @@ ${style2}
|
|
|
139866
141203
|
writeVarUint8Array(encoder, Y__namespace.encodeStateAsUpdate(doc2, encodedStateVector));
|
|
139867
141204
|
};
|
|
139868
141205
|
const readSyncStep1 = (decoder, encoder, doc2) => writeSyncStep2(encoder, doc2, readVarUint8Array(decoder));
|
|
139869
|
-
const readSyncStep2 = (decoder, doc2, transactionOrigin) => {
|
|
141206
|
+
const readSyncStep2 = (decoder, doc2, transactionOrigin, errorHandler) => {
|
|
139870
141207
|
try {
|
|
139871
141208
|
Y__namespace.applyUpdate(doc2, readVarUint8Array(decoder), transactionOrigin);
|
|
139872
141209
|
} catch (error) {
|
|
141210
|
+
if (errorHandler != null) errorHandler(
|
|
141211
|
+
/** @type {Error} */
|
|
141212
|
+
error
|
|
141213
|
+
);
|
|
139873
141214
|
console.error("Caught error while handling a Yjs update", error);
|
|
139874
141215
|
}
|
|
139875
141216
|
};
|
|
@@ -139878,17 +141219,17 @@ ${style2}
|
|
|
139878
141219
|
writeVarUint8Array(encoder, update);
|
|
139879
141220
|
};
|
|
139880
141221
|
const readUpdate = readSyncStep2;
|
|
139881
|
-
const readSyncMessage = (decoder, encoder, doc2, transactionOrigin) => {
|
|
141222
|
+
const readSyncMessage = (decoder, encoder, doc2, transactionOrigin, errorHandler) => {
|
|
139882
141223
|
const messageType = readVarUint(decoder);
|
|
139883
141224
|
switch (messageType) {
|
|
139884
141225
|
case messageYjsSyncStep1:
|
|
139885
141226
|
readSyncStep1(decoder, encoder, doc2);
|
|
139886
141227
|
break;
|
|
139887
141228
|
case messageYjsSyncStep2:
|
|
139888
|
-
readSyncStep2(decoder, doc2, transactionOrigin);
|
|
141229
|
+
readSyncStep2(decoder, doc2, transactionOrigin, errorHandler);
|
|
139889
141230
|
break;
|
|
139890
141231
|
case messageYjsUpdate:
|
|
139891
|
-
readUpdate(decoder, doc2, transactionOrigin);
|
|
141232
|
+
readUpdate(decoder, doc2, transactionOrigin, errorHandler);
|
|
139892
141233
|
break;
|
|
139893
141234
|
default:
|
|
139894
141235
|
throw new Error("Unknown message type");
|
|
@@ -142021,7 +143362,7 @@ ${reason}`);
|
|
|
142021
143362
|
}
|
|
142022
143363
|
const kebabRegex = /[A-Z]/g;
|
|
142023
143364
|
function kebabCase(pattern) {
|
|
142024
|
-
return pattern.replace(kebabRegex, (
|
|
143365
|
+
return pattern.replace(kebabRegex, (match2) => "-" + match2.toLowerCase());
|
|
142025
143366
|
}
|
|
142026
143367
|
function unwrapProperty(prop, indent2 = " ") {
|
|
142027
143368
|
if (typeof prop === "object" && prop !== null) {
|
|
@@ -146189,8 +147530,8 @@ ${style2}
|
|
|
146189
147530
|
if (string.charCodeAt(0) === 46) {
|
|
146190
147531
|
result.push("");
|
|
146191
147532
|
}
|
|
146192
|
-
string.replace(rePropName, function(
|
|
146193
|
-
result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 ||
|
|
147533
|
+
string.replace(rePropName, function(match2, number2, quote, subString) {
|
|
147534
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match2);
|
|
146194
147535
|
});
|
|
146195
147536
|
return result;
|
|
146196
147537
|
});
|
|
@@ -154525,8 +155866,8 @@ ${style2}
|
|
|
154525
155866
|
setup(__props) {
|
|
154526
155867
|
const props = __props;
|
|
154527
155868
|
const getValue2 = computed(() => {
|
|
154528
|
-
const
|
|
154529
|
-
return
|
|
155869
|
+
const match2 = props.field.options.find((o) => o.annotationId.includes(props.optionId));
|
|
155870
|
+
return match2?.checked;
|
|
154530
155871
|
});
|
|
154531
155872
|
const getPreviewStyle = computed(() => {
|
|
154532
155873
|
const borderWidth = 2;
|
|
@@ -155898,7 +157239,7 @@ ${style2}
|
|
|
155898
157239
|
this.config.colors = shuffleArray(this.config.colors);
|
|
155899
157240
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
155900
157241
|
this.colorIndex = 0;
|
|
155901
|
-
this.version = "1.0.
|
|
157242
|
+
this.version = "1.0.2";
|
|
155902
157243
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
155903
157244
|
this.superdocId = config2.superdocId || v4();
|
|
155904
157245
|
this.colors = this.config.colors;
|
|
@@ -156434,8 +157775,8 @@ ${style2}
|
|
|
156434
157775
|
* @param {Object} match The match object
|
|
156435
157776
|
* @returns {void}
|
|
156436
157777
|
*/
|
|
156437
|
-
goToSearchResult(
|
|
156438
|
-
return this.activeEditor?.commands.goToSearchResult(
|
|
157778
|
+
goToSearchResult(match2) {
|
|
157779
|
+
return this.activeEditor?.commands.goToSearchResult(match2);
|
|
156439
157780
|
}
|
|
156440
157781
|
/**
|
|
156441
157782
|
* Set the document to locked or unlocked
|
|
@@ -158371,7 +159712,7 @@ ${style2}
|
|
|
158371
159712
|
value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
|
|
158372
159713
|
);
|
|
158373
159714
|
}
|
|
158374
|
-
const
|
|
159715
|
+
const indexDDZ1ZT8N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
158375
159716
|
__proto__: null,
|
|
158376
159717
|
unified
|
|
158377
159718
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -159590,8 +160931,8 @@ ${style2}
|
|
|
159590
160931
|
let tagName;
|
|
159591
160932
|
while (start2 < value.length) {
|
|
159592
160933
|
search.lastIndex = start2;
|
|
159593
|
-
const
|
|
159594
|
-
const subvalue = value.slice(start2,
|
|
160934
|
+
const match2 = search.exec(value);
|
|
160935
|
+
const subvalue = value.slice(start2, match2 ? match2.index : value.length);
|
|
159595
160936
|
if (subvalue) {
|
|
159596
160937
|
if (!previous2) {
|
|
159597
160938
|
tagName = subvalue;
|
|
@@ -159604,8 +160945,8 @@ ${style2}
|
|
|
159604
160945
|
}
|
|
159605
160946
|
start2 += subvalue.length;
|
|
159606
160947
|
}
|
|
159607
|
-
if (
|
|
159608
|
-
previous2 =
|
|
160948
|
+
if (match2) {
|
|
160949
|
+
previous2 = match2[0];
|
|
159609
160950
|
start2++;
|
|
159610
160951
|
}
|
|
159611
160952
|
}
|
|
@@ -169095,8 +170436,8 @@ ${style2}
|
|
|
169095
170436
|
return character === " " || character === "\n";
|
|
169096
170437
|
}
|
|
169097
170438
|
function replaceNewlines(value) {
|
|
169098
|
-
const
|
|
169099
|
-
return
|
|
170439
|
+
const match2 = /\r?\n|\r/.exec(value);
|
|
170440
|
+
return match2 ? match2[0] : " ";
|
|
169100
170441
|
}
|
|
169101
170442
|
function replaceWhitespace() {
|
|
169102
170443
|
return " ";
|
|
@@ -169440,8 +170781,8 @@ ${style2}
|
|
|
169440
170781
|
let start2 = 0;
|
|
169441
170782
|
while (start2 <= value.length) {
|
|
169442
170783
|
searchLineFeeds.lastIndex = start2;
|
|
169443
|
-
const
|
|
169444
|
-
const end2 =
|
|
170784
|
+
const match2 = searchLineFeeds.exec(value);
|
|
170785
|
+
const end2 = match2 && "index" in match2 ? match2.index : value.length;
|
|
169445
170786
|
lines.push(
|
|
169446
170787
|
// Any sequence of collapsible spaces and tabs immediately preceding or
|
|
169447
170788
|
// following a segment break is removed.
|
|
@@ -169481,15 +170822,15 @@ ${style2}
|
|
|
169481
170822
|
let end2;
|
|
169482
170823
|
while (start2 < value.length) {
|
|
169483
170824
|
searchTabOrSpaces.lastIndex = start2;
|
|
169484
|
-
const
|
|
169485
|
-
end2 =
|
|
169486
|
-
if (!start2 && !end2 &&
|
|
170825
|
+
const match2 = searchTabOrSpaces.exec(value);
|
|
170826
|
+
end2 = match2 ? match2.index : value.length;
|
|
170827
|
+
if (!start2 && !end2 && match2 && !breakBefore) {
|
|
169487
170828
|
result.push("");
|
|
169488
170829
|
}
|
|
169489
170830
|
if (start2 !== end2) {
|
|
169490
170831
|
result.push(value.slice(start2, end2));
|
|
169491
170832
|
}
|
|
169492
|
-
start2 =
|
|
170833
|
+
start2 = match2 ? end2 + match2[0].length : end2;
|
|
169493
170834
|
}
|
|
169494
170835
|
if (start2 !== end2 && !breakAfter) {
|
|
169495
170836
|
result.push("");
|
|
@@ -171191,14 +172532,14 @@ ${style2}
|
|
|
171191
172532
|
while (++index2 < state2.unsafe.length) {
|
|
171192
172533
|
const pattern = state2.unsafe[index2];
|
|
171193
172534
|
const expression = state2.compilePattern(pattern);
|
|
171194
|
-
let
|
|
172535
|
+
let match2;
|
|
171195
172536
|
if (!pattern.atBreak) continue;
|
|
171196
|
-
while (
|
|
171197
|
-
let position2 =
|
|
172537
|
+
while (match2 = expression.exec(value)) {
|
|
172538
|
+
let position2 = match2.index;
|
|
171198
172539
|
if (value.charCodeAt(position2) === 10 && value.charCodeAt(position2 - 1) === 13) {
|
|
171199
172540
|
position2--;
|
|
171200
172541
|
}
|
|
171201
|
-
value = value.slice(0, position2) + " " + value.slice(
|
|
172542
|
+
value = value.slice(0, position2) + " " + value.slice(match2.index + 1);
|
|
171202
172543
|
}
|
|
171203
172544
|
}
|
|
171204
172545
|
return sequence + value + sequence;
|
|
@@ -171935,11 +173276,11 @@ ${style2}
|
|
|
171935
173276
|
const result = [];
|
|
171936
173277
|
let start2 = 0;
|
|
171937
173278
|
let line = 0;
|
|
171938
|
-
let
|
|
171939
|
-
while (
|
|
171940
|
-
one2(value.slice(start2,
|
|
171941
|
-
result.push(
|
|
171942
|
-
start2 =
|
|
173279
|
+
let match2;
|
|
173280
|
+
while (match2 = eol.exec(value)) {
|
|
173281
|
+
one2(value.slice(start2, match2.index));
|
|
173282
|
+
result.push(match2[0]);
|
|
173283
|
+
start2 = match2.index + match2[0].length;
|
|
171943
173284
|
line++;
|
|
171944
173285
|
}
|
|
171945
173286
|
one2(value.slice(start2));
|
|
@@ -171960,11 +173301,11 @@ ${style2}
|
|
|
171960
173301
|
continue;
|
|
171961
173302
|
}
|
|
171962
173303
|
const expression = state2.compilePattern(pattern);
|
|
171963
|
-
let
|
|
171964
|
-
while (
|
|
173304
|
+
let match2;
|
|
173305
|
+
while (match2 = expression.exec(value)) {
|
|
171965
173306
|
const before = "before" in pattern || Boolean(pattern.atBreak);
|
|
171966
173307
|
const after = "after" in pattern;
|
|
171967
|
-
const position2 =
|
|
173308
|
+
const position2 = match2.index + (before ? match2[1].length : 0);
|
|
171968
173309
|
if (positions.includes(position2)) {
|
|
171969
173310
|
if (infos[position2].before && !before) {
|
|
171970
173311
|
infos[position2].before = false;
|
|
@@ -172014,9 +173355,9 @@ ${style2}
|
|
|
172014
173355
|
const whole = value + after;
|
|
172015
173356
|
let index2 = -1;
|
|
172016
173357
|
let start2 = 0;
|
|
172017
|
-
let
|
|
172018
|
-
while (
|
|
172019
|
-
positions.push(
|
|
173358
|
+
let match2;
|
|
173359
|
+
while (match2 = expression.exec(whole)) {
|
|
173360
|
+
positions.push(match2.index);
|
|
172020
173361
|
}
|
|
172021
173362
|
while (++index2 < positions.length) {
|
|
172022
173363
|
if (start2 !== positions[index2]) {
|
|
@@ -172197,15 +173538,15 @@ ${style2}
|
|
|
172197
173538
|
let change = false;
|
|
172198
173539
|
let nodes = [];
|
|
172199
173540
|
find2.lastIndex = 0;
|
|
172200
|
-
let
|
|
172201
|
-
while (
|
|
172202
|
-
const position2 =
|
|
173541
|
+
let match2 = find2.exec(node2.value);
|
|
173542
|
+
while (match2) {
|
|
173543
|
+
const position2 = match2.index;
|
|
172203
173544
|
const matchObject = {
|
|
172204
|
-
index:
|
|
172205
|
-
input:
|
|
173545
|
+
index: match2.index,
|
|
173546
|
+
input: match2.input,
|
|
172206
173547
|
stack: [...parents, node2]
|
|
172207
173548
|
};
|
|
172208
|
-
let value = replace2(...
|
|
173549
|
+
let value = replace2(...match2, matchObject);
|
|
172209
173550
|
if (typeof value === "string") {
|
|
172210
173551
|
value = value.length > 0 ? { type: "text", value } : void 0;
|
|
172211
173552
|
}
|
|
@@ -172223,13 +173564,13 @@ ${style2}
|
|
|
172223
173564
|
} else if (value) {
|
|
172224
173565
|
nodes.push(value);
|
|
172225
173566
|
}
|
|
172226
|
-
start2 = position2 +
|
|
173567
|
+
start2 = position2 + match2[0].length;
|
|
172227
173568
|
change = true;
|
|
172228
173569
|
}
|
|
172229
173570
|
if (!find2.global) {
|
|
172230
173571
|
break;
|
|
172231
173572
|
}
|
|
172232
|
-
|
|
173573
|
+
match2 = find2.exec(node2.value);
|
|
172233
173574
|
}
|
|
172234
173575
|
if (change) {
|
|
172235
173576
|
if (start2 < node2.value.length) {
|
|
@@ -172340,9 +173681,9 @@ ${style2}
|
|
|
172340
173681
|
{ ignore: ["link", "linkReference"] }
|
|
172341
173682
|
);
|
|
172342
173683
|
}
|
|
172343
|
-
function findUrl(_2, protocol, domain2, path2,
|
|
173684
|
+
function findUrl(_2, protocol, domain2, path2, match2) {
|
|
172344
173685
|
let prefix2 = "";
|
|
172345
|
-
if (!previous(
|
|
173686
|
+
if (!previous(match2)) {
|
|
172346
173687
|
return false;
|
|
172347
173688
|
}
|
|
172348
173689
|
if (/^w/i.test(protocol)) {
|
|
@@ -172366,10 +173707,10 @@ ${style2}
|
|
|
172366
173707
|
}
|
|
172367
173708
|
return result;
|
|
172368
173709
|
}
|
|
172369
|
-
function findEmail(_2, atext, label,
|
|
173710
|
+
function findEmail(_2, atext, label, match2) {
|
|
172370
173711
|
if (
|
|
172371
173712
|
// Not an expected previous character.
|
|
172372
|
-
!previous(
|
|
173713
|
+
!previous(match2, true) || // Label ends in not allowed character.
|
|
172373
173714
|
/[-\d_]$/.test(label)
|
|
172374
173715
|
) {
|
|
172375
173716
|
return false;
|
|
@@ -172406,9 +173747,9 @@ ${style2}
|
|
|
172406
173747
|
}
|
|
172407
173748
|
return [url, trail2];
|
|
172408
173749
|
}
|
|
172409
|
-
function previous(
|
|
172410
|
-
const code2 =
|
|
172411
|
-
return (
|
|
173750
|
+
function previous(match2, email) {
|
|
173751
|
+
const code2 = match2.input.charCodeAt(match2.index - 1);
|
|
173752
|
+
return (match2.index === 0 || unicodeWhitespace(code2) || unicodePunctuation(code2)) && // If it’s an email, the previous character should not be a slash.
|
|
172412
173753
|
(!email || code2 !== 47);
|
|
172413
173754
|
}
|
|
172414
173755
|
function normalizeIdentifier(value) {
|