@superdoc-dev/mcp 0.11.0-next.15 → 0.11.0-next.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +641 -767
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -43378,90 +43378,70 @@ Actual: ` + parser.attribValue);
43378
43378
  });
43379
43379
  });
43380
43380
 
43381
- // ../../packages/superdoc/dist/chunks/uuid-qzgm05fK.es.js
43382
- function rng() {
43383
- if (!getRandomValues) {
43384
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
43385
- if (!getRandomValues)
43386
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
43387
- }
43388
- return getRandomValues(rnds8);
43389
- }
43381
+ // ../../packages/superdoc/dist/chunks/uuid-B2wVPhPi.es.js
43390
43382
  function validate(uuid3) {
43391
43383
  return typeof uuid3 === "string" && regex_default.test(uuid3);
43392
43384
  }
43393
- function unsafeStringify(arr, offset = 0) {
43394
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
43395
- }
43396
43385
  function parse6(uuid3) {
43397
43386
  if (!validate_default(uuid3))
43398
43387
  throw TypeError("Invalid UUID");
43399
43388
  let v;
43400
- const arr = new Uint8Array(16);
43401
- arr[0] = (v = parseInt(uuid3.slice(0, 8), 16)) >>> 24;
43402
- arr[1] = v >>> 16 & 255;
43403
- arr[2] = v >>> 8 & 255;
43404
- arr[3] = v & 255;
43405
- arr[4] = (v = parseInt(uuid3.slice(9, 13), 16)) >>> 8;
43406
- arr[5] = v & 255;
43407
- arr[6] = (v = parseInt(uuid3.slice(14, 18), 16)) >>> 8;
43408
- arr[7] = v & 255;
43409
- arr[8] = (v = parseInt(uuid3.slice(19, 23), 16)) >>> 8;
43410
- arr[9] = v & 255;
43411
- arr[10] = (v = parseInt(uuid3.slice(24, 36), 16)) / 1099511627776 & 255;
43412
- arr[11] = v / 4294967296 & 255;
43413
- arr[12] = v >>> 24 & 255;
43414
- arr[13] = v >>> 16 & 255;
43415
- arr[14] = v >>> 8 & 255;
43416
- arr[15] = v & 255;
43417
- return arr;
43389
+ return Uint8Array.of((v = parseInt(uuid3.slice(0, 8), 16)) >>> 24, v >>> 16 & 255, v >>> 8 & 255, v & 255, (v = parseInt(uuid3.slice(9, 13), 16)) >>> 8, v & 255, (v = parseInt(uuid3.slice(14, 18), 16)) >>> 8, v & 255, (v = parseInt(uuid3.slice(19, 23), 16)) >>> 8, v & 255, (v = parseInt(uuid3.slice(24, 36), 16)) / 1099511627776 & 255, v / 4294967296 & 255, v >>> 24 & 255, v >>> 16 & 255, v >>> 8 & 255, v & 255);
43390
+ }
43391
+ function unsafeStringify(arr, offset = 0) {
43392
+ return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
43393
+ }
43394
+ function rng() {
43395
+ if (!getRandomValues) {
43396
+ if (typeof crypto === "undefined" || !crypto.getRandomValues)
43397
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
43398
+ getRandomValues = crypto.getRandomValues.bind(crypto);
43399
+ }
43400
+ return getRandomValues(rnds8);
43418
43401
  }
43419
43402
  function stringToBytes(str) {
43420
43403
  str = unescape(encodeURIComponent(str));
43421
- const bytes = [];
43404
+ const bytes = new Uint8Array(str.length);
43422
43405
  for (let i2 = 0;i2 < str.length; ++i2)
43423
- bytes.push(str.charCodeAt(i2));
43406
+ bytes[i2] = str.charCodeAt(i2);
43424
43407
  return bytes;
43425
43408
  }
43426
- function v35(name, version3, hashfunc) {
43427
- function generateUUID(value, namespace, buf, offset) {
43428
- var _namespace;
43429
- if (typeof value === "string")
43430
- value = stringToBytes(value);
43431
- if (typeof namespace === "string")
43432
- namespace = parse_default(namespace);
43433
- if (((_namespace = namespace) === null || _namespace === undefined ? undefined : _namespace.length) !== 16)
43434
- throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
43435
- let bytes = new Uint8Array(16 + value.length);
43436
- bytes.set(namespace);
43437
- bytes.set(value, namespace.length);
43438
- bytes = hashfunc(bytes);
43439
- bytes[6] = bytes[6] & 15 | version3;
43440
- bytes[8] = bytes[8] & 63 | 128;
43441
- if (buf) {
43442
- offset = offset || 0;
43443
- for (let i2 = 0;i2 < 16; ++i2)
43444
- buf[offset + i2] = bytes[i2];
43445
- return buf;
43446
- }
43447
- return unsafeStringify(bytes);
43409
+ function v35(version3, hash2, value, namespace, buf, offset) {
43410
+ const valueBytes = typeof value === "string" ? stringToBytes(value) : value;
43411
+ const namespaceBytes = typeof namespace === "string" ? parse_default(namespace) : namespace;
43412
+ if (typeof namespace === "string")
43413
+ namespace = parse_default(namespace);
43414
+ if (namespace?.length !== 16)
43415
+ throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
43416
+ let bytes = new Uint8Array(16 + valueBytes.length);
43417
+ bytes.set(namespaceBytes);
43418
+ bytes.set(valueBytes, namespaceBytes.length);
43419
+ bytes = hash2(bytes);
43420
+ bytes[6] = bytes[6] & 15 | version3;
43421
+ bytes[8] = bytes[8] & 63 | 128;
43422
+ if (buf) {
43423
+ offset = offset || 0;
43424
+ if (offset < 0 || offset + 16 > buf.length)
43425
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
43426
+ for (let i2 = 0;i2 < 16; ++i2)
43427
+ buf[offset + i2] = bytes[i2];
43428
+ return buf;
43448
43429
  }
43449
- try {
43450
- generateUUID.name = name;
43451
- } catch (err) {}
43452
- generateUUID.DNS = DNS;
43453
- generateUUID.URL = URL2;
43454
- return generateUUID;
43430
+ return unsafeStringify(bytes);
43455
43431
  }
43456
43432
  function v4(options, buf, offset) {
43457
43433
  if (native_default.randomUUID && !buf && !options)
43458
43434
  return native_default.randomUUID();
43459
43435
  options = options || {};
43460
- const rnds = options.random || (options.rng || rng)();
43436
+ const rnds = options.random ?? options.rng?.() ?? rng();
43437
+ if (rnds.length < 16)
43438
+ throw new Error("Random bytes length must be >= 16");
43461
43439
  rnds[6] = rnds[6] & 15 | 64;
43462
43440
  rnds[8] = rnds[8] & 63 | 128;
43463
43441
  if (buf) {
43464
43442
  offset = offset || 0;
43443
+ if (offset < 0 || offset + 16 > buf.length)
43444
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
43465
43445
  for (let i2 = 0;i2 < 16; ++i2)
43466
43446
  buf[offset + i2] = rnds[i2];
43467
43447
  return buf;
@@ -43497,14 +43477,10 @@ function sha1(bytes) {
43497
43477
  271733878,
43498
43478
  3285377520
43499
43479
  ];
43500
- if (typeof bytes === "string") {
43501
- const msg = unescape(encodeURIComponent(bytes));
43502
- bytes = [];
43503
- for (let i2 = 0;i2 < msg.length; ++i2)
43504
- bytes.push(msg.charCodeAt(i2));
43505
- } else if (!Array.isArray(bytes))
43506
- bytes = Array.prototype.slice.call(bytes);
43507
- bytes.push(128);
43480
+ const newBytes = new Uint8Array(bytes.length + 1);
43481
+ newBytes.set(bytes);
43482
+ newBytes[bytes.length] = 128;
43483
+ bytes = newBytes;
43508
43484
  const l = bytes.length / 4 + 2;
43509
43485
  const N = Math.ceil(l / 16);
43510
43486
  const M = new Array(N);
@@ -43543,41 +43519,26 @@ function sha1(bytes) {
43543
43519
  H[3] = H[3] + d >>> 0;
43544
43520
  H[4] = H[4] + e >>> 0;
43545
43521
  }
43546
- return [
43547
- H[0] >> 24 & 255,
43548
- H[0] >> 16 & 255,
43549
- H[0] >> 8 & 255,
43550
- H[0] & 255,
43551
- H[1] >> 24 & 255,
43552
- H[1] >> 16 & 255,
43553
- H[1] >> 8 & 255,
43554
- H[1] & 255,
43555
- H[2] >> 24 & 255,
43556
- H[2] >> 16 & 255,
43557
- H[2] >> 8 & 255,
43558
- H[2] & 255,
43559
- H[3] >> 24 & 255,
43560
- H[3] >> 16 & 255,
43561
- H[3] >> 8 & 255,
43562
- H[3] & 255,
43563
- H[4] >> 24 & 255,
43564
- H[4] >> 16 & 255,
43565
- H[4] >> 8 & 255,
43566
- H[4] & 255
43567
- ];
43522
+ return Uint8Array.of(H[0] >> 24, H[0] >> 16, H[0] >> 8, H[0], H[1] >> 24, H[1] >> 16, H[1] >> 8, H[1], H[2] >> 24, H[2] >> 16, H[2] >> 8, H[2], H[3] >> 24, H[3] >> 16, H[3] >> 8, H[3], H[4] >> 24, H[4] >> 16, H[4] >> 8, H[4]);
43568
43523
  }
43569
- var getRandomValues, rnds8, regex_default, validate_default, byteToHex, parse_default, DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8", native_default, v4_default, v5_default;
43570
- var init_uuid_qzgm05fK_es = __esm(() => {
43571
- rnds8 = new Uint8Array(16);
43572
- regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
43524
+ function v5(value, namespace, buf, offset) {
43525
+ return v35(80, sha1_default, value, namespace, buf, offset);
43526
+ }
43527
+ var regex_default, validate_default, parse_default, byteToHex, getRandomValues, rnds8, DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8", native_default, v4_default, sha1_default, v5_default;
43528
+ var init_uuid_B2wVPhPi_es = __esm(() => {
43529
+ regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
43573
43530
  validate_default = validate;
43531
+ parse_default = parse6;
43574
43532
  byteToHex = [];
43575
43533
  for (let i2 = 0;i2 < 256; ++i2)
43576
43534
  byteToHex.push((i2 + 256).toString(16).slice(1));
43577
- parse_default = parse6;
43535
+ rnds8 = new Uint8Array(16);
43578
43536
  native_default = { randomUUID: typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto) };
43579
43537
  v4_default = v4;
43580
- v5_default = v35("v5", 80, sha1);
43538
+ sha1_default = sha1;
43539
+ v5.DNS = DNS;
43540
+ v5.URL = URL2;
43541
+ v5_default = v5;
43581
43542
  });
43582
43543
 
43583
43544
  // ../../packages/superdoc/dist/chunks/constants-D9qj59G2.es.js
@@ -52211,7 +52172,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
52211
52172
  emptyOptions2 = {};
52212
52173
  });
52213
52174
 
52214
- // ../../packages/superdoc/dist/chunks/SuperConverter-DOoAJ6Zk.es.js
52175
+ // ../../packages/superdoc/dist/chunks/SuperConverter-CJi2bUhE.es.js
52215
52176
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
52216
52177
  const fieldValue = extension$1.config[field];
52217
52178
  if (typeof fieldValue === "function")
@@ -61335,9 +61296,9 @@ function decode$66(params) {
61335
61296
  });
61336
61297
  if (params.isFinalDoc)
61337
61298
  return null;
61338
- const textNode = translatedTextNode.elements.find((n) => n.name === "w:t");
61339
- if (textNode)
61340
- textNode.name = "w:delText";
61299
+ (translatedTextNode.elements || []).filter((n) => n.name === "w:t").forEach((n) => {
61300
+ n.name = "w:delText";
61301
+ });
61341
61302
  return {
61342
61303
  name: "w:del",
61343
61304
  attributes: {
@@ -82438,14 +82399,37 @@ function getTextNodeForExport(text$2, marks, params) {
82438
82399
  wordIdAllocator: params?.converter?.wordIdAllocator || null,
82439
82400
  partPath: resolveExportPartPath(params)
82440
82401
  });
82441
- textNodes.push({
82442
- name: "w:t",
82443
- elements: [{
82444
- text: text$2,
82445
- type: "text"
82446
- }],
82447
- attributes: nodeAttrs
82448
- });
82402
+ const textValue = typeof text$2 === "string" ? text$2 : "";
82403
+ const normalizedText = textValue.includes("\r") ? textValue.replace(/\r\n?/g, `
82404
+ `) : textValue;
82405
+ if (normalizedText.includes(`
82406
+ `)) {
82407
+ const segments = normalizedText.split(`
82408
+ `);
82409
+ segments.forEach((segment, index2) => {
82410
+ if (segment.length > 0) {
82411
+ const segmentNeedsSpace = /^\s|\s$/.test(segment);
82412
+ textNodes.push({
82413
+ name: "w:t",
82414
+ elements: [{
82415
+ text: segment,
82416
+ type: "text"
82417
+ }],
82418
+ attributes: segmentNeedsSpace ? { "xml:space": "preserve" } : null
82419
+ });
82420
+ }
82421
+ if (index2 < segments.length - 1)
82422
+ textNodes.push({ name: "w:br" });
82423
+ });
82424
+ } else
82425
+ textNodes.push({
82426
+ name: "w:t",
82427
+ elements: [{
82428
+ text: normalizedText,
82429
+ type: "text"
82430
+ }],
82431
+ attributes: nodeAttrs
82432
+ });
82449
82433
  if (params?.editor?.extensionService?.extensions) {
82450
82434
  const customMarks = params.editor.extensionService.extensions.filter((extension$1) => extension$1.isExternal === true);
82451
82435
  normalizedMarks.forEach((mark) => {
@@ -91633,6 +91617,9 @@ function hasTrackDeleteMark(node2) {
91633
91617
  function shouldSkipTextNode(node2, options) {
91634
91618
  return isVisibleTextModel(options) && hasTrackDeleteMark(node2);
91635
91619
  }
91620
+ function shouldSkipLeafNode(node2, options) {
91621
+ return isVisibleTextModel(options) && hasTrackDeleteMark(node2);
91622
+ }
91636
91623
  function resolveSegmentPosition(targetOffset, segmentStart, segmentLength, docFrom, docTo) {
91637
91624
  if (segmentLength <= 1)
91638
91625
  return targetOffset <= segmentStart ? docFrom : docTo;
@@ -91664,7 +91651,13 @@ function pmPositionToTextOffset(blockNode, blockPos, pmPos, options) {
91664
91651
  return;
91665
91652
  }
91666
91653
  if (node2.isLeaf) {
91667
- if (pmPos >= docPos + node2.nodeSize)
91654
+ const endPos = docPos + node2.nodeSize;
91655
+ if (shouldSkipLeafNode(node2, options)) {
91656
+ if (pmPos < endPos)
91657
+ done = true;
91658
+ return;
91659
+ }
91660
+ if (pmPos >= endPos)
91668
91661
  offset += 1;
91669
91662
  else
91670
91663
  done = true;
@@ -91705,6 +91698,8 @@ function computeTextContentLength(blockNode, options) {
91705
91698
  return;
91706
91699
  }
91707
91700
  if (node2.isLeaf) {
91701
+ if (shouldSkipLeafNode(node2, options))
91702
+ return;
91708
91703
  length += 1;
91709
91704
  return;
91710
91705
  }
@@ -91764,6 +91759,8 @@ function resolveTextRangeInBlock(blockNode, blockPos, range, options) {
91764
91759
  return;
91765
91760
  }
91766
91761
  if (node2.isLeaf) {
91762
+ if (shouldSkipLeafNode(node2, options))
91763
+ return;
91767
91764
  advanceSegment(1, docPos, docPos + node2.nodeSize);
91768
91765
  return;
91769
91766
  }
@@ -91795,7 +91792,10 @@ function textContentInBlock(blockNode, options) {
91795
91792
  return;
91796
91793
  }
91797
91794
  if (node2.isLeaf) {
91798
- text$2 += "";
91795
+ if (shouldSkipLeafNode(node2, options))
91796
+ return;
91797
+ const leafText = node2.type?.spec?.leafText;
91798
+ text$2 += typeof leafText === "function" ? leafText(node2) : "";
91799
91799
  return;
91800
91800
  }
91801
91801
  let isFirstChild$1 = true;
@@ -91820,19 +91820,31 @@ function textContentInBlock(blockNode, options) {
91820
91820
  return text$2;
91821
91821
  }
91822
91822
  function buildTextWithTabs(schema, text$2, marks, opts = {}) {
91823
- if (!text$2.includes("\t"))
91824
- return schema.text(text$2, marks);
91825
- const tabNodeType = schema.nodes?.tab;
91826
- if (!tabNodeType || opts.parentAllowsTab === false)
91827
- return schema.text(text$2, marks);
91828
- const tabMarks = marks ?? null;
91829
- const parts = text$2.split("\t");
91823
+ const normalized = text$2.includes("\r") ? text$2.replace(/\r\n?/g, `
91824
+ `) : text$2;
91825
+ const hasTab = normalized.includes("\t");
91826
+ const hasNewline = normalized.includes(`
91827
+ `);
91828
+ if (!hasTab && !hasNewline)
91829
+ return schema.text(normalized, marks);
91830
+ const tabNodeType = hasTab && opts.parentAllowsTab !== false ? schema.nodes?.tab : undefined;
91831
+ const lineBreakNodeType = hasNewline && opts.parentAllowsLineBreak !== false ? schema.nodes?.lineBreak : undefined;
91832
+ if (!tabNodeType && !lineBreakNodeType)
91833
+ return schema.text(normalized, marks);
91834
+ const tabMarks = marks ?? undefined;
91835
+ const splitPattern = [tabNodeType ? "\\t" : null, lineBreakNodeType ? "\\n" : null].filter(Boolean).join("|");
91836
+ const parts = normalized.split(/* @__PURE__ */ new RegExp(`(${splitPattern})`));
91830
91837
  const nodes = [];
91831
- for (let i$1 = 0;i$1 < parts.length; i$1++) {
91832
- if (parts[i$1])
91833
- nodes.push(schema.text(parts[i$1], marks));
91834
- if (i$1 < parts.length - 1)
91838
+ for (const part of parts) {
91839
+ if (part === "")
91840
+ continue;
91841
+ if (part === "\t" && tabNodeType)
91835
91842
  nodes.push(tabNodeType.create(null, null, tabMarks));
91843
+ else if (part === `
91844
+ ` && lineBreakNodeType)
91845
+ nodes.push(lineBreakNodeType.create());
91846
+ else
91847
+ nodes.push(schema.text(part, marks));
91836
91848
  }
91837
91849
  return Fragment.from(nodes);
91838
91850
  }
@@ -91874,6 +91886,8 @@ function textBetweenWithTabs(doc$2, from2, to, blockSeparator, leafFallback, opt
91874
91886
  }
91875
91887
  if (node2.isLeaf) {
91876
91888
  if (node2.isInline) {
91889
+ if (options.textModel === "visible" && node2.marks?.some((mark) => mark.type.name === "trackDelete"))
91890
+ return false;
91877
91891
  const leafTextFn = node2.type?.spec?.leafText;
91878
91892
  if (typeof leafTextFn === "function")
91879
91893
  out += leafTextFn(node2);
@@ -117882,11 +117896,11 @@ var isRegExp = (value) => {
117882
117896
  state.kern = kernNode.attributes["w:val"];
117883
117897
  }
117884
117898
  }, SuperConverter;
117885
- var init_SuperConverter_DOoAJ6Zk_es = __esm(() => {
117899
+ var init_SuperConverter_CJi2bUhE_es = __esm(() => {
117886
117900
  init_rolldown_runtime_Bg48TavK_es();
117887
117901
  init_jszip_C49i9kUs_es();
117888
117902
  init_xml_js_CqGKpaft_es();
117889
- init_uuid_qzgm05fK_es();
117903
+ init_uuid_B2wVPhPi_es();
117890
117904
  init_constants_D9qj59G2_es();
117891
117905
  init_dist_B8HfvhaK_es();
117892
117906
  init_unified_Dsuw2be5_es();
@@ -157219,7 +157233,7 @@ var init_SuperConverter_DOoAJ6Zk_es = __esm(() => {
157219
157233
  };
157220
157234
  });
157221
157235
 
157222
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-DUhzXJ4D.es.js
157236
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-B3f9Th4u.es.js
157223
157237
  function parseSizeUnit(val = "0") {
157224
157238
  const length = val.toString() || "0";
157225
157239
  const value = Number.parseFloat(length);
@@ -161067,6 +161081,8 @@ function executeTextRewrite(editor, tr, target, step2, mapping) {
161067
161081
  const absTo = mapping.map(target.absTo);
161068
161082
  const replacementText = getReplacementText(step2.args.replacement);
161069
161083
  const marks = resolveMarksForRange(editor, target, step2);
161084
+ const lineBreakNodeType = editor.state.schema.nodes?.lineBreak;
161085
+ const parentAllowsLineBreakAt = (pos) => lineBreakNodeType ? parentAllowsNodeAt(tr, pos, lineBreakNodeType) : false;
161070
161086
  const structuralRewrite = resolveStructuralRangeRewrite(tr.doc, absFrom, absTo, step2);
161071
161087
  if (structuralRewrite) {
161072
161088
  const slice2 = buildReplacementParagraphSlice(editor, structuralRewrite.replacementBlocks, marks, structuralRewrite.paragraphAttrs, step2.id, structuralRewrite.leadingWrappers, structuralRewrite.trailingWrappers, structuralRewrite.openStart, structuralRewrite.openEnd);
@@ -161094,7 +161110,7 @@ function executeTextRewrite(editor, tr, target, step2, mapping) {
161094
161110
  tr.delete(absFrom, absTo);
161095
161111
  return { changed: target.text.length > 0 };
161096
161112
  }
161097
- const content2 = buildTextWithTabs(editor.state.schema, replacementText, asProseMirrorMarks(marks));
161113
+ const content2 = buildTextWithTabs(editor.state.schema, replacementText, asProseMirrorMarks(marks), { parentAllowsLineBreak: parentAllowsLineBreakAt(absFrom) });
161098
161114
  tr.replaceWith(absFrom, absTo, content2);
161099
161115
  return { changed: replacementText !== target.text };
161100
161116
  }
@@ -161136,17 +161152,17 @@ function executeTextRewrite(editor, tr, target, step2, mapping) {
161136
161152
  if (change.type === "delete")
161137
161153
  tr.delete(remap(change.docFrom), remap(change.docTo));
161138
161154
  else if (change.type === "insert") {
161139
- const content2 = buildTextWithTabs(editor.state.schema, change.newText, asProseMirrorMarks(marks));
161155
+ const content2 = buildTextWithTabs(editor.state.schema, change.newText, asProseMirrorMarks(marks), { parentAllowsLineBreak: parentAllowsLineBreakAt(remap(change.docPos)) });
161140
161156
  tr.insert(remap(change.docPos), content2);
161141
161157
  } else {
161142
- const content2 = buildTextWithTabs(editor.state.schema, change.newText, asProseMirrorMarks(marks));
161158
+ const content2 = buildTextWithTabs(editor.state.schema, change.newText, asProseMirrorMarks(marks), { parentAllowsLineBreak: parentAllowsLineBreakAt(remap(change.docFrom)) });
161143
161159
  tr.replaceWith(remap(change.docFrom), remap(change.docTo), content2);
161144
161160
  }
161145
161161
  }
161146
161162
  } else if (trimmedNew.length === 0)
161147
161163
  tr.delete(trimmedFrom, trimmedTo);
161148
161164
  else {
161149
- const content2 = buildTextWithTabs(editor.state.schema, trimmedNew, asProseMirrorMarks(marks));
161165
+ const content2 = buildTextWithTabs(editor.state.schema, trimmedNew, asProseMirrorMarks(marks), { parentAllowsLineBreak: parentAllowsLineBreakAt(trimmedFrom) });
161150
161166
  tr.replaceWith(trimmedFrom, trimmedTo, content2);
161151
161167
  }
161152
161168
  return { changed: replacementText !== target.text };
@@ -161217,7 +161233,12 @@ function executeTextInsert(editor, tr, target, step2, mapping) {
161217
161233
  }
161218
161234
  const tabNodeType = editor.state.schema.nodes?.tab;
161219
161235
  const parentAllowsTab = tabNodeType && text4.includes("\t") ? parentAllowsNodeAt(tr, absPos, tabNodeType) : false;
161220
- tr.insert(absPos, buildTextWithTabs(editor.state.schema, text4, marks, { parentAllowsTab }));
161236
+ const lineBreakNodeType = editor.state.schema.nodes?.lineBreak;
161237
+ const parentAllowsLineBreak = lineBreakNodeType && /[\r\n]/.test(text4) ? parentAllowsNodeAt(tr, absPos, lineBreakNodeType) : false;
161238
+ tr.insert(absPos, buildTextWithTabs(editor.state.schema, text4, marks, {
161239
+ parentAllowsTab,
161240
+ parentAllowsLineBreak
161241
+ }));
161221
161242
  return { changed: true };
161222
161243
  }
161223
161244
  function executeTextDelete(_editor, tr, target, _step, mapping) {
@@ -161311,7 +161332,9 @@ function executeSpanTextRewrite(editor, tr, target, step2, mapping) {
161311
161332
  const absTo = mapping.map(lastSeg.absTo, -1);
161312
161333
  if (replacementBlocks.length === 1) {
161313
161334
  const marks = resolveSpanMarks(editor, target, policy, step2.id);
161314
- const content2 = buildTextWithTabs(editor.state.schema, replacementBlocks[0], asProseMirrorMarks(marks));
161335
+ const lineBreakNodeType = editor.state.schema.nodes?.lineBreak;
161336
+ const parentAllowsLineBreak = lineBreakNodeType ? parentAllowsNodeAt(tr, absFrom, lineBreakNodeType) : false;
161337
+ const content2 = buildTextWithTabs(editor.state.schema, replacementBlocks[0], asProseMirrorMarks(marks), { parentAllowsLineBreak });
161315
161338
  tr.replaceWith(absFrom, absTo, content2);
161316
161339
  return { changed: true };
161317
161340
  }
@@ -162538,7 +162561,7 @@ function materializeTab(schema) {
162538
162561
  return nodeType.create();
162539
162562
  }
162540
162563
  function materializeLineBreak(schema) {
162541
- const nodeType = schema.nodes.hardBreak ?? schema.nodes.lineBreak;
162564
+ const nodeType = schema.nodes.lineBreak ?? schema.nodes.hardBreak;
162542
162565
  if (!nodeType)
162543
162566
  return schema.text(`
162544
162567
  `);
@@ -166663,6 +166686,11 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
166663
166686
  disabled: !context,
166664
166687
  value: typeof superdoc?.getZoom === "function" ? superdoc.getZoom() : 100
166665
166688
  };
166689
+ }, createZoomFitWidthStateDeriver = () => ({ context, superdoc }) => {
166690
+ return {
166691
+ active: (typeof superdoc?.getZoomState === "function" ? superdoc.getZoomState()?.mode : undefined) === "fit-width",
166692
+ disabled: !context || typeof superdoc?.setZoomMode !== "function"
166693
+ };
166666
166694
  }, createDocumentModeStateDeriver = () => ({ context, superdoc }) => {
166667
166695
  return {
166668
166696
  active: false,
@@ -166683,6 +166711,12 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
166683
166711
  return false;
166684
166712
  superdoc.setZoom?.(normalizedPayload);
166685
166713
  return true;
166714
+ }, createZoomFitWidthExecute = () => ({ superdoc }) => {
166715
+ if (typeof superdoc?.setZoomMode !== "function")
166716
+ return false;
166717
+ const mode = typeof superdoc.getZoomState === "function" ? superdoc.getZoomState()?.mode : undefined;
166718
+ superdoc.setZoomMode(mode === "fit-width" ? "manual" : "fit-width");
166719
+ return true;
166686
166720
  }, createDocumentModeExecute = () => ({ superdoc, payload }) => {
166687
166721
  const validModes = [
166688
166722
  "editing",
@@ -167356,6 +167390,11 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
167356
167390
  state: createZoomStateDeriver(),
167357
167391
  execute: createZoomExecute()
167358
167392
  },
167393
+ "zoom-fit-width": {
167394
+ id: "zoom-fit-width",
167395
+ state: createZoomFitWidthStateDeriver(),
167396
+ execute: createZoomFitWidthExecute()
167397
+ },
167359
167398
  "document-mode": {
167360
167399
  id: "document-mode",
167361
167400
  state: createDocumentModeStateDeriver(),
@@ -167552,9 +167591,9 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, normalizeActorId = (value) => {
167552
167591
  }
167553
167592
  };
167554
167593
  };
167555
- var init_create_headless_toolbar_DUhzXJ4D_es = __esm(() => {
167556
- init_SuperConverter_DOoAJ6Zk_es();
167557
- init_uuid_qzgm05fK_es();
167594
+ var init_create_headless_toolbar_B3f9Th4u_es = __esm(() => {
167595
+ init_SuperConverter_CJi2bUhE_es();
167596
+ init_uuid_B2wVPhPi_es();
167558
167597
  init_constants_D9qj59G2_es();
167559
167598
  init_dist_B8HfvhaK_es();
167560
167599
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -168741,7 +168780,7 @@ var init_remark_stringify_6MMJfY0k_es = __esm(() => {
168741
168780
  eol = /\r?\n|\r/g;
168742
168781
  });
168743
168782
 
168744
- // ../../packages/superdoc/dist/chunks/detect-container-B6sqy7HZ.es.js
168783
+ // ../../packages/superdoc/dist/chunks/detect-container-sTWXwOzh.es.js
168745
168784
  function matchesMagic(bytes, magic) {
168746
168785
  if (bytes.length < magic.length)
168747
168786
  return false;
@@ -168759,7 +168798,7 @@ function detectContainerType(data) {
168759
168798
  return "unknown";
168760
168799
  }
168761
168800
  var ZIP_MAGIC, CFB_MAGIC;
168762
- var init_detect_container_B6sqy7HZ_es = __esm(() => {
168801
+ var init_detect_container_sTWXwOzh_es = __esm(() => {
168763
168802
  ZIP_MAGIC = [
168764
168803
  80,
168765
168804
  75,
@@ -168778,13 +168817,13 @@ var init_detect_container_B6sqy7HZ_es = __esm(() => {
168778
168817
  ];
168779
168818
  });
168780
168819
 
168781
- // ../../packages/superdoc/dist/chunks/detect-container-Cs3KoJVc.es.js
168782
- var exports_detect_container_Cs3KoJVc_es = {};
168783
- __export(exports_detect_container_Cs3KoJVc_es, {
168820
+ // ../../packages/superdoc/dist/chunks/detect-container-0tUwtCR4.es.js
168821
+ var exports_detect_container_0tUwtCR4_es = {};
168822
+ __export(exports_detect_container_0tUwtCR4_es, {
168784
168823
  detectContainerType: () => detectContainerType
168785
168824
  });
168786
- var init_detect_container_Cs3KoJVc_es = __esm(() => {
168787
- init_detect_container_B6sqy7HZ_es();
168825
+ var init_detect_container_0tUwtCR4_es = __esm(() => {
168826
+ init_detect_container_sTWXwOzh_es();
168788
168827
  });
168789
168828
 
168790
168829
  // ../../packages/superdoc/dist/chunks/errors-CNaD6vcg.es.js
@@ -168837,9 +168876,9 @@ var init_errors_CNaD6vcg_es = __esm(() => {
168837
168876
  };
168838
168877
  });
168839
168878
 
168840
- // ../../packages/superdoc/dist/chunks/decrypt-docx-G2a7hkiV.es.js
168841
- var exports_decrypt_docx_G2a7hkiV_es = {};
168842
- __export(exports_decrypt_docx_G2a7hkiV_es, {
168879
+ // ../../packages/superdoc/dist/chunks/decrypt-docx-CPcaRl5W.es.js
168880
+ var exports_decrypt_docx_CPcaRl5W_es = {};
168881
+ __export(exports_decrypt_docx_CPcaRl5W_es, {
168843
168882
  decryptDocxIfNeeded: () => decryptDocxIfNeeded
168844
168883
  });
168845
168884
  function concatUint8Arrays(chunks) {
@@ -169380,10 +169419,10 @@ async function decryptDocxIfNeeded(data, options) {
169380
169419
  };
169381
169420
  }
169382
169421
  var CFB_SIGNATURE, CFB_END_OF_CHAIN = 4294967294, CFB_OBJECT_TYPE, utf16LeDecoder, AGILE_VERSION = 4, AGILE_RESERVED = 4, STANDARD_VERSION_3 = 3, STANDARD_VERSION_4 = 4, STANDARD_RESERVED = 3, MIN_HEADER_SIZE = 8, BLOCK_KEY_VERIFIER_INPUT, BLOCK_KEY_VERIFIER_VALUE, BLOCK_KEY_ENCRYPTED_KEY, BLOCK_KEY_HMAC_KEY, BLOCK_KEY_HMAC_VALUE, SEGMENT_SIZE = 4096, PACKAGE_HEADER_SIZE = 8;
169383
- var init_decrypt_docx_G2a7hkiV_es = __esm(() => {
169422
+ var init_decrypt_docx_CPcaRl5W_es = __esm(() => {
169384
169423
  init_dist_B8HfvhaK_es();
169385
169424
  init_errors_CNaD6vcg_es();
169386
- init_detect_container_B6sqy7HZ_es();
169425
+ init_detect_container_sTWXwOzh_es();
169387
169426
  CFB_SIGNATURE = new Uint8Array([
169388
169427
  208,
169389
169428
  207,
@@ -169452,7 +169491,7 @@ var init_decrypt_docx_G2a7hkiV_es = __esm(() => {
169452
169491
  ]);
169453
169492
  });
169454
169493
 
169455
- // ../../packages/superdoc/dist/chunks/DocxZipper-Bu2Fhqkw.es.js
169494
+ // ../../packages/superdoc/dist/chunks/DocxZipper-FUsfThjV.es.js
169456
169495
  function sniffEncoding(u8) {
169457
169496
  if (u8.length >= 2) {
169458
169497
  const b0 = u8[0], b1 = u8[1];
@@ -169768,11 +169807,11 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
169768
169807
  return new Uint8Array(0);
169769
169808
  }
169770
169809
  async getDocxData(file2, isNode = false, options = {}) {
169771
- const { detectContainerType: detectContainerType2 } = await Promise.resolve().then(() => (init_detect_container_Cs3KoJVc_es(), exports_detect_container_Cs3KoJVc_es));
169810
+ const { detectContainerType: detectContainerType2 } = await Promise.resolve().then(() => (init_detect_container_0tUwtCR4_es(), exports_detect_container_0tUwtCR4_es));
169772
169811
  const containerType = detectContainerType2(await this.#peekBytes(file2, 8));
169773
169812
  let fileData = file2;
169774
169813
  if (containerType === "cfb") {
169775
- const { decryptDocxIfNeeded: decryptDocxIfNeeded2 } = await Promise.resolve().then(() => (init_decrypt_docx_G2a7hkiV_es(), exports_decrypt_docx_G2a7hkiV_es));
169814
+ const { decryptDocxIfNeeded: decryptDocxIfNeeded2 } = await Promise.resolve().then(() => (init_decrypt_docx_CPcaRl5W_es(), exports_decrypt_docx_CPcaRl5W_es));
169776
169815
  const result = await decryptDocxIfNeeded2(file2 instanceof Uint8Array ? file2 : file2 instanceof ArrayBuffer ? new Uint8Array(file2) : new Uint8Array(await file2.arrayBuffer()), { password: options.password });
169777
169816
  fileData = result.data;
169778
169817
  this.decryptedFileData = result.data;
@@ -170125,7 +170164,7 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
170125
170164
  return `image/${MIME_TYPE_FOR_EXT[detectedType] || detectedType}`;
170126
170165
  }
170127
170166
  }, DocxZipper_default;
170128
- var init_DocxZipper_Bu2Fhqkw_es = __esm(() => {
170167
+ var init_DocxZipper_FUsfThjV_es = __esm(() => {
170129
170168
  init_rolldown_runtime_Bg48TavK_es();
170130
170169
  init_jszip_C49i9kUs_es();
170131
170170
  init_xml_js_CqGKpaft_es();
@@ -211525,9 +211564,9 @@ var init_unified_vFnLRfAM_es = __esm(() => {
211525
211564
  init_unified_Dsuw2be5_es();
211526
211565
  });
211527
211566
 
211528
- // ../../packages/superdoc/dist/chunks/rehype-parse-q8NfsLv7.es.js
211529
- var exports_rehype_parse_q8NfsLv7_es = {};
211530
- __export(exports_rehype_parse_q8NfsLv7_es, {
211567
+ // ../../packages/superdoc/dist/chunks/rehype-parse-DTSDs3kr.es.js
211568
+ var exports_rehype_parse_DTSDs3kr_es = {};
211569
+ __export(exports_rehype_parse_DTSDs3kr_es, {
211531
211570
  default: () => rehypeParse
211532
211571
  });
211533
211572
  function merge2(definitions, space) {
@@ -217476,7 +217515,7 @@ var Schema2 = class {
217476
217515
  }
217477
217516
  }
217478
217517
  }, TABLE_VOID_ELEMENTS, errors4, base2 = "https://html.spec.whatwg.org/multipage/parsing.html#parse-error-", dashToCamelRe, formatCRe, formatXRe, fatalities, emptyOptions3;
217479
- var init_rehype_parse_q8NfsLv7_es = __esm(() => {
217518
+ var init_rehype_parse_DTSDs3kr_es = __esm(() => {
217480
217519
  init_rolldown_runtime_Bg48TavK_es();
217481
217520
  init_default_BqgWzMfR_es();
217482
217521
  init_lib_CYqLdG4z_es();
@@ -220221,9 +220260,9 @@ var init_rehype_parse_q8NfsLv7_es = __esm(() => {
220221
220260
  emptyOptions3 = {};
220222
220261
  });
220223
220262
 
220224
- // ../../packages/superdoc/dist/chunks/rehype-remark-CKg94dxK.es.js
220225
- var exports_rehype_remark_CKg94dxK_es = {};
220226
- __export(exports_rehype_remark_CKg94dxK_es, {
220263
+ // ../../packages/superdoc/dist/chunks/rehype-remark-Bt5njn02.es.js
220264
+ var exports_rehype_remark_Bt5njn02_es = {};
220265
+ __export(exports_rehype_remark_Bt5njn02_es, {
220227
220266
  default: () => rehypeRemark
220228
220267
  });
220229
220268
  function anyFactory2(tests) {
@@ -221843,7 +221882,7 @@ var env, deserializer = ($2, _2) => {
221843
221882
  if (is(parent.children[index2], index2, parent))
221844
221883
  return parent.children[index2];
221845
221884
  }, searchLineFeeds, searchTabOrSpaces, br$1, cell, p$1, row, notRendered, blockOrCaption, prefix = "language-", defaultChecked = "[x]", defaultUnchecked = "[ ]", own$12, list$1, basic, meta3, defaultQuotes, nodeHandlers2, handlers2, own6, emptyOptions4, defaults;
221846
- var init_rehype_remark_CKg94dxK_es = __esm(() => {
221885
+ var init_rehype_remark_Bt5njn02_es = __esm(() => {
221847
221886
  init_lib_DEff_P2k_es();
221848
221887
  env = typeof self === "object" ? self : globalThis;
221849
221888
  ({ toString: toString$1 } = {});
@@ -222237,7 +222276,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
222237
222276
  init_remark_gfm_BhnWr3yf_es();
222238
222277
  });
222239
222278
 
222240
- // ../../packages/superdoc/dist/chunks/src-DEnygTyz.es.js
222279
+ // ../../packages/superdoc/dist/chunks/src-Bp0jHIlx.es.js
222241
222280
  function deleteProps(obj, propOrProps) {
222242
222281
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
222243
222282
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -253695,7 +253734,12 @@ function insertTextAroundSdt(editor, target, content3, resolvePos) {
253695
253734
  const { tr } = editor.state;
253696
253735
  const tabType = editor.schema.nodes?.tab;
253697
253736
  const parentAllowsTab = tabType && content3.includes("\t") ? parentAllowsNodeAt(tr, pos, tabType) : false;
253698
- tr.insert(pos, buildTextWithTabs(editor.schema, content3, undefined, { parentAllowsTab }));
253737
+ const lineBreakType = editor.schema.nodes?.lineBreak;
253738
+ const parentAllowsLineBreak = lineBreakType && /[\r\n]/.test(content3) ? parentAllowsNodeAt(tr, pos, lineBreakType) : false;
253739
+ tr.insert(pos, buildTextWithTabs(editor.schema, content3, undefined, {
253740
+ parentAllowsTab,
253741
+ parentAllowsLineBreak
253742
+ }));
253699
253743
  dispatchTransaction$1(editor, tr);
253700
253744
  return true;
253701
253745
  }
@@ -295828,17 +295872,25 @@ var Node$13 = class Node$14 {
295828
295872
  this.deco = deco;
295829
295873
  }
295830
295874
  }, searchKey, BLOCK_SEPARATOR = `
295831
- `, ATOM_PLACEHOLDER = "", DELETION_BARRIER = "\x00", DEFAULT_SEARCH_MODEL$1 = "raw", hasTrackDeleteMark$2 = (node2) => node2?.marks?.some((mark2) => mark2?.type?.name === "trackDelete") ?? false, SearchIndex, customSearchHighlightsKey, isRegExp2 = (value) => Object.prototype.toString.call(value) === "[object RegExp]", SEARCH_POSITION_TRACKER_TYPE = "search-match", DEFAULT_SEARCH_MODEL = "raw", normalizeSearchModel = (value) => value === "visible" ? "visible" : DEFAULT_SEARCH_MODEL, mapIndexMatchesToDocMatches = ({ searchIndex, indexMatches, doc: doc$12, positionTracker }) => {
295875
+ `, ATOM_PLACEHOLDER = "", DELETION_BARRIER = "\x00", DEFAULT_SEARCH_MODEL$1 = "raw", hasTrackDeleteMark$2 = (node2) => node2?.marks?.some((mark2) => mark2?.type?.name === "trackDelete") ?? false, readLeafText = (node2) => {
295876
+ const leafText = node2?.type?.spec?.leafText;
295877
+ if (typeof leafText === "function")
295878
+ return leafText(node2);
295879
+ if (typeof leafText === "string")
295880
+ return leafText;
295881
+ return ATOM_PLACEHOLDER;
295882
+ }, SearchIndex, customSearchHighlightsKey, isRegExp2 = (value) => Object.prototype.toString.call(value) === "[object RegExp]", SEARCH_POSITION_TRACKER_TYPE = "search-match", DEFAULT_SEARCH_MODEL = "raw", normalizeSearchModel = (value) => value === "visible" ? "visible" : DEFAULT_SEARCH_MODEL, mapIndexMatchesToDocMatches = ({ searchIndex, indexMatches, doc: doc$12, positionTracker }) => {
295832
295883
  const matches2 = [];
295833
295884
  for (const indexMatch of indexMatches) {
295834
295885
  const ranges = searchIndex.offsetRangeToDocRanges(indexMatch.start, indexMatch.end);
295835
295886
  if (ranges.length === 0)
295836
295887
  continue;
295837
295888
  const matchTexts = ranges.map((r$1) => doc$12.textBetween(r$1.from, r$1.to));
295889
+ const matchText = typeof indexMatch.text === "string" ? indexMatch.text : matchTexts.join("");
295838
295890
  const match$1 = {
295839
295891
  from: ranges[0].from,
295840
295892
  to: ranges[ranges.length - 1].to,
295841
- text: matchTexts.join(""),
295893
+ text: matchText,
295842
295894
  id: v4_default(),
295843
295895
  ranges,
295844
295896
  trackerIds: []
@@ -319422,19 +319474,19 @@ menclose::after {
319422
319474
  return;
319423
319475
  console.log(...args$1);
319424
319476
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
319425
- var init_src_DEnygTyz_es = __esm(() => {
319477
+ var init_src_Bp0jHIlx_es = __esm(() => {
319426
319478
  init_rolldown_runtime_Bg48TavK_es();
319427
- init_SuperConverter_DOoAJ6Zk_es();
319479
+ init_SuperConverter_CJi2bUhE_es();
319428
319480
  init_jszip_C49i9kUs_es();
319429
319481
  init_xml_js_CqGKpaft_es();
319430
- init_uuid_qzgm05fK_es();
319431
- init_create_headless_toolbar_DUhzXJ4D_es();
319482
+ init_uuid_B2wVPhPi_es();
319483
+ init_create_headless_toolbar_B3f9Th4u_es();
319432
319484
  init_constants_D9qj59G2_es();
319433
319485
  init_dist_B8HfvhaK_es();
319434
319486
  init_unified_Dsuw2be5_es();
319435
319487
  init_remark_gfm_BhnWr3yf_es();
319436
319488
  init_remark_stringify_6MMJfY0k_es();
319437
- init_DocxZipper_Bu2Fhqkw_es();
319489
+ init_DocxZipper_FUsfThjV_es();
319438
319490
  init__plugin_vue_export_helper_5t5P5NuM_es();
319439
319491
  init_eventemitter3_BnGqBE_Q_es();
319440
319492
  init_errors_CNaD6vcg_es();
@@ -323326,10 +323378,12 @@ ${err.toString()}`);
323326
323378
  return false;
323327
323379
  const { $from } = selection;
323328
323380
  let paragraph2 = null;
323381
+ let paragraphDepth = null;
323329
323382
  for (let d = $from.depth;d >= 0; d--) {
323330
323383
  const node2 = $from.node(d);
323331
323384
  if (node2.type.name === "paragraph") {
323332
323385
  paragraph2 = node2;
323386
+ paragraphDepth = d;
323333
323387
  break;
323334
323388
  }
323335
323389
  }
@@ -323339,7 +323393,14 @@ ${err.toString()}`);
323339
323393
  return false;
323340
323394
  if (!isVisuallyEmptyParagraph(paragraph2) && !hasOnlyBreakContent(paragraph2))
323341
323395
  return false;
323342
- const tr = state.tr.insertText(event.data);
323396
+ let tr = state.tr;
323397
+ if (hasOnlyBreakContent(paragraph2) && paragraphDepth != null) {
323398
+ const contentStart = $from.start(paragraphDepth);
323399
+ const contentEnd = $from.end(paragraphDepth);
323400
+ tr = tr.delete(contentStart, contentEnd).insertText(event.data, contentStart);
323401
+ tr = tr.setSelection(TextSelection.create(tr.doc, contentStart + event.data.length));
323402
+ } else
323403
+ tr = tr.insertText(event.data);
323343
323404
  view.dispatch(tr);
323344
323405
  event.preventDefault();
323345
323406
  return true;
@@ -323659,6 +323720,8 @@ ${err.toString()}`);
323659
323720
  selectable: false,
323660
323721
  content: "",
323661
323722
  atom: true,
323723
+ leafText: () => `
323724
+ `,
323662
323725
  addOptions() {
323663
323726
  return {};
323664
323727
  },
@@ -337490,7 +337553,7 @@ function print() { __p += __j.call(arguments, '') }
337490
337553
  if (searchModel === "visible")
337491
337554
  this.#buildVisible(doc$12);
337492
337555
  else
337493
- this.text = doc$12.textBetween(0, doc$12.content.size, BLOCK_SEPARATOR, ATOM_PLACEHOLDER);
337556
+ this.text = doc$12.textBetween(0, doc$12.content.size, BLOCK_SEPARATOR, readLeafText);
337494
337557
  this.segments = [];
337495
337558
  this.docSize = doc$12.content.size;
337496
337559
  this.doc = doc$12;
@@ -337537,7 +337600,11 @@ function print() { __p += __j.call(arguments, '') }
337537
337600
  return;
337538
337601
  }
337539
337602
  if (node2.isLeaf) {
337540
- parts.push(ATOM_PLACEHOLDER);
337603
+ if (hasTrackDeleteMark$2(node2)) {
337604
+ appendDeletionBarrier();
337605
+ return;
337606
+ }
337607
+ parts.push(readLeafText(node2));
337541
337608
  emittedDeletionBarrier = false;
337542
337609
  return;
337543
337610
  }
@@ -337600,26 +337667,43 @@ function print() { __p += __j.call(arguments, '') }
337600
337667
  return offset$1;
337601
337668
  }
337602
337669
  if (node2.isLeaf) {
337670
+ if (searchModel === "visible" && hasTrackDeleteMark$2(node2)) {
337671
+ if (context?.deletionBarrierActive)
337672
+ return offset$1;
337673
+ addSegment({
337674
+ offsetStart: offset$1,
337675
+ offsetEnd: offset$1 + 1,
337676
+ docFrom: docPos,
337677
+ docTo: docPos + node2.nodeSize,
337678
+ kind: "atom"
337679
+ });
337680
+ if (context)
337681
+ context.deletionBarrierActive = true;
337682
+ return offset$1 + 1;
337683
+ }
337603
337684
  if (context && searchModel === "visible")
337604
337685
  context.deletionBarrierActive = false;
337686
+ const leafText = readLeafText(node2);
337687
+ if (leafText.length === 0)
337688
+ return offset$1;
337605
337689
  if (node2.type.name === "hard_break") {
337606
337690
  addSegment({
337607
337691
  offsetStart: offset$1,
337608
- offsetEnd: offset$1 + 1,
337692
+ offsetEnd: offset$1 + leafText.length,
337609
337693
  docFrom: docPos,
337610
337694
  docTo: docPos + node2.nodeSize,
337611
337695
  kind: "hardBreak"
337612
337696
  });
337613
- return offset$1 + 1;
337697
+ return offset$1 + leafText.length;
337614
337698
  }
337615
337699
  addSegment({
337616
337700
  offsetStart: offset$1,
337617
- offsetEnd: offset$1 + 1,
337701
+ offsetEnd: offset$1 + leafText.length,
337618
337702
  docFrom: docPos,
337619
337703
  docTo: docPos + node2.nodeSize,
337620
337704
  kind: "atom"
337621
337705
  });
337622
- return offset$1 + 1;
337706
+ return offset$1 + leafText.length;
337623
337707
  }
337624
337708
  return this.#walkNodeContent(node2, docPos + 1, offset$1, addSegment, searchModel, context);
337625
337709
  }
@@ -337636,24 +337720,56 @@ function print() { __p += __j.call(arguments, '') }
337636
337720
  }
337637
337721
  offsetRangeToDocRanges(start$1, end$1) {
337638
337722
  const ranges = [];
337723
+ let current = null;
337639
337724
  for (const segment of this.segments) {
337640
337725
  if (segment.offsetEnd <= start$1)
337641
337726
  continue;
337642
337727
  if (segment.offsetStart >= end$1)
337643
337728
  break;
337644
- if (segment.kind !== "text")
337729
+ if (segment.kind === "blockSep") {
337730
+ if (current) {
337731
+ ranges.push({
337732
+ from: current.from,
337733
+ to: current.to
337734
+ });
337735
+ current = null;
337736
+ }
337645
337737
  continue;
337738
+ }
337646
337739
  const overlapStart = Math.max(start$1, segment.offsetStart);
337647
337740
  const overlapEnd = Math.min(end$1, segment.offsetEnd);
337648
- if (overlapStart < overlapEnd) {
337649
- const startInSegment = overlapStart - segment.offsetStart;
337650
- const endInSegment = overlapEnd - segment.offsetStart;
337651
- ranges.push({
337652
- from: segment.docFrom + startInSegment,
337653
- to: segment.docFrom + endInSegment
337654
- });
337741
+ if (overlapStart >= overlapEnd)
337742
+ continue;
337743
+ let from$1;
337744
+ let to;
337745
+ if (segment.kind === "text") {
337746
+ from$1 = segment.docFrom + (overlapStart - segment.offsetStart);
337747
+ to = segment.docFrom + (overlapEnd - segment.offsetStart);
337748
+ } else {
337749
+ from$1 = segment.docFrom;
337750
+ to = segment.docTo;
337751
+ }
337752
+ if (current && segment.offsetStart === current.offsetEnd && from$1 === current.to) {
337753
+ current.to = to;
337754
+ current.offsetEnd = overlapEnd;
337755
+ } else {
337756
+ if (current)
337757
+ ranges.push({
337758
+ from: current.from,
337759
+ to: current.to
337760
+ });
337761
+ current = {
337762
+ from: from$1,
337763
+ to,
337764
+ offsetEnd: overlapEnd
337765
+ };
337655
337766
  }
337656
337767
  }
337768
+ if (current)
337769
+ ranges.push({
337770
+ from: current.from,
337771
+ to: current.to
337772
+ });
337657
337773
  return ranges;
337658
337774
  }
337659
337775
  offsetToDocPos(offset$1) {
@@ -345417,8 +345533,8 @@ function print() { __p += __j.call(arguments, '') }
345417
345533
  try {
345418
345534
  const [{ unified: unified$1 }, { default: rehypeParse2 }, { default: rehypeRemark2 }, { default: remarkStringify$1 }, { default: remarkGfm$1 }] = await Promise.all([
345419
345535
  Promise.resolve().then(() => (init_unified_vFnLRfAM_es(), exports_unified_vFnLRfAM_es)),
345420
- Promise.resolve().then(() => (init_rehype_parse_q8NfsLv7_es(), exports_rehype_parse_q8NfsLv7_es)),
345421
- Promise.resolve().then(() => (init_rehype_remark_CKg94dxK_es(), exports_rehype_remark_CKg94dxK_es)),
345536
+ Promise.resolve().then(() => (init_rehype_parse_DTSDs3kr_es(), exports_rehype_parse_DTSDs3kr_es)),
345537
+ Promise.resolve().then(() => (init_rehype_remark_Bt5njn02_es(), exports_rehype_remark_Bt5njn02_es)),
345422
345538
  Promise.resolve().then(() => (init_remark_stringify_B_orWEvD_es(), exports_remark_stringify_B_orWEvD_es)),
345423
345539
  Promise.resolve().then(() => (init_remark_gfm_eZN6yzWQ_es(), exports_remark_gfm_eZN6yzWQ_es))
345424
345540
  ]);
@@ -354268,11 +354384,11 @@ function print() { __p += __j.call(arguments, '') }
354268
354384
  ]);
354269
354385
  });
354270
354386
 
354271
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-CmcU7hTR.es.js
354387
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DjZHlQQ4.es.js
354272
354388
  var headlessToolbarConstants, MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
354273
- var init_create_super_doc_ui_CmcU7hTR_es = __esm(() => {
354274
- init_SuperConverter_DOoAJ6Zk_es();
354275
- init_create_headless_toolbar_DUhzXJ4D_es();
354389
+ var init_create_super_doc_ui_DjZHlQQ4_es = __esm(() => {
354390
+ init_SuperConverter_CJi2bUhE_es();
354391
+ init_create_headless_toolbar_B3f9Th4u_es();
354276
354392
  headlessToolbarConstants = {
354277
354393
  DEFAULT_TEXT_ALIGN_OPTIONS: [
354278
354394
  {
@@ -354554,16 +354670,16 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
354554
354670
 
354555
354671
  // ../../packages/superdoc/dist/super-editor.es.js
354556
354672
  var init_super_editor_es = __esm(() => {
354557
- init_src_DEnygTyz_es();
354558
- init_SuperConverter_DOoAJ6Zk_es();
354673
+ init_src_Bp0jHIlx_es();
354674
+ init_SuperConverter_CJi2bUhE_es();
354559
354675
  init_jszip_C49i9kUs_es();
354560
354676
  init_xml_js_CqGKpaft_es();
354561
- init_create_headless_toolbar_DUhzXJ4D_es();
354677
+ init_create_headless_toolbar_B3f9Th4u_es();
354562
354678
  init_constants_D9qj59G2_es();
354563
354679
  init_dist_B8HfvhaK_es();
354564
354680
  init_unified_Dsuw2be5_es();
354565
- init_DocxZipper_Bu2Fhqkw_es();
354566
- init_create_super_doc_ui_CmcU7hTR_es();
354681
+ init_DocxZipper_FUsfThjV_es();
354682
+ init_create_super_doc_ui_DjZHlQQ4_es();
354567
354683
  init_ui_C5PAS9hY_es();
354568
354684
  init_eventemitter3_BnGqBE_Q_es();
354569
354685
  init_errors_CNaD6vcg_es();
@@ -388035,6 +388151,9 @@ function hasTrackDeleteMark3(node3) {
388035
388151
  function shouldSkipTextNode2(node3, options) {
388036
388152
  return isVisibleTextModel2(options) && hasTrackDeleteMark3(node3);
388037
388153
  }
388154
+ function shouldSkipLeafNode2(node3, options) {
388155
+ return isVisibleTextModel2(options) && hasTrackDeleteMark3(node3);
388156
+ }
388038
388157
  function resolveSegmentPosition3(targetOffset, segmentStart, segmentLength, docFrom, docTo) {
388039
388158
  if (segmentLength <= 1) {
388040
388159
  return targetOffset <= segmentStart ? docFrom : docTo;
@@ -388068,6 +388187,11 @@ function pmPositionToTextOffset2(blockNode, blockPos, pmPos, options) {
388068
388187
  }
388069
388188
  if (node3.isLeaf) {
388070
388189
  const endPos = docPos + node3.nodeSize;
388190
+ if (shouldSkipLeafNode2(node3, options)) {
388191
+ if (pmPos < endPos)
388192
+ done = true;
388193
+ return;
388194
+ }
388071
388195
  if (pmPos >= endPos) {
388072
388196
  offset2 += 1;
388073
388197
  } else {
@@ -388111,6 +388235,8 @@ function computeTextContentLength2(blockNode, options) {
388111
388235
  return;
388112
388236
  }
388113
388237
  if (node3.isLeaf) {
388238
+ if (shouldSkipLeafNode2(node3, options))
388239
+ return;
388114
388240
  length3 += 1;
388115
388241
  return;
388116
388242
  }
@@ -388174,6 +388300,8 @@ function resolveTextRangeInBlock2(blockNode, blockPos, range, options) {
388174
388300
  return;
388175
388301
  }
388176
388302
  if (node3.isLeaf) {
388303
+ if (shouldSkipLeafNode2(node3, options))
388304
+ return;
388177
388305
  advanceSegment(1, docPos, docPos + node3.nodeSize);
388178
388306
  return;
388179
388307
  }
@@ -388200,7 +388328,10 @@ function textContentInBlock2(blockNode, options) {
388200
388328
  return;
388201
388329
  }
388202
388330
  if (node3.isLeaf) {
388203
- text5 += "";
388331
+ if (shouldSkipLeafNode2(node3, options))
388332
+ return;
388333
+ const leafText = node3.type?.spec?.leafText;
388334
+ text5 += typeof leafText === "function" ? leafText(node3) : "";
388204
388335
  return;
388205
388336
  }
388206
388337
  let isFirstChild2 = true;
@@ -388230,19 +388361,32 @@ var init_text_offset_resolver = __esm(() => {
388230
388361
 
388231
388362
  // ../../packages/super-editor/src/editors/v1/document-api-adapters/helpers/text-with-tabs.ts
388232
388363
  function buildTextWithTabs2(schema, text5, marks, opts = {}) {
388233
- if (!text5.includes("\t"))
388234
- return schema.text(text5, marks);
388235
- const tabNodeType = schema.nodes?.tab;
388236
- if (!tabNodeType || opts.parentAllowsTab === false)
388237
- return schema.text(text5, marks);
388238
- const tabMarks = marks ?? null;
388239
- const parts = text5.split("\t");
388364
+ const normalized = text5.includes("\r") ? text5.replace(/\r\n?/g, `
388365
+ `) : text5;
388366
+ const hasTab = normalized.includes("\t");
388367
+ const hasNewline = normalized.includes(`
388368
+ `);
388369
+ if (!hasTab && !hasNewline)
388370
+ return schema.text(normalized, marks);
388371
+ const tabNodeType = hasTab && opts.parentAllowsTab !== false ? schema.nodes?.tab : undefined;
388372
+ const lineBreakNodeType = hasNewline && opts.parentAllowsLineBreak !== false ? schema.nodes?.lineBreak : undefined;
388373
+ if (!tabNodeType && !lineBreakNodeType)
388374
+ return schema.text(normalized, marks);
388375
+ const tabMarks = marks ?? undefined;
388376
+ const splitPattern = [tabNodeType ? "\\t" : null, lineBreakNodeType ? "\\n" : null].filter(Boolean).join("|");
388377
+ const parts = normalized.split(new RegExp(`(${splitPattern})`));
388240
388378
  const nodes = [];
388241
- for (let i4 = 0;i4 < parts.length; i4++) {
388242
- if (parts[i4])
388243
- nodes.push(schema.text(parts[i4], marks));
388244
- if (i4 < parts.length - 1)
388379
+ for (const part of parts) {
388380
+ if (part === "")
388381
+ continue;
388382
+ if (part === "\t" && tabNodeType) {
388245
388383
  nodes.push(tabNodeType.create(null, null, tabMarks));
388384
+ } else if (part === `
388385
+ ` && lineBreakNodeType) {
388386
+ nodes.push(lineBreakNodeType.create());
388387
+ } else {
388388
+ nodes.push(schema.text(part, marks));
388389
+ }
388246
388390
  }
388247
388391
  return Fragment4.from(nodes);
388248
388392
  }
@@ -388287,6 +388431,9 @@ function textBetweenWithTabs2(doc5, from3, to, blockSeparator, leafFallback, opt
388287
388431
  }
388288
388432
  if (node3.isLeaf) {
388289
388433
  if (node3.isInline) {
388434
+ if (options.textModel === "visible" && node3.marks?.some((mark2) => mark2.type.name === TrackDeleteMarkName2)) {
388435
+ return false;
388436
+ }
388290
388437
  const leafTextFn = node3.type?.spec?.leafText;
388291
388438
  if (typeof leafTextFn === "function") {
388292
388439
  out += leafTextFn(node3);
@@ -420666,489 +420813,176 @@ var init_dist10 = __esm(() => {
420666
420813
  columnResizingPluginKey2 = new PluginKey2("tableColumnResizing");
420667
420814
  });
420668
420815
 
420669
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/rng.js
420670
- var require_rng = __commonJS((exports) => {
420671
- Object.defineProperty(exports, "__esModule", {
420672
- value: true
420673
- });
420674
- exports.default = rng2;
420675
- var _crypto = _interopRequireDefault(__require("crypto"));
420676
- function _interopRequireDefault(obj) {
420677
- return obj && obj.__esModule ? obj : { default: obj };
420678
- }
420679
- var rnds8Pool = new Uint8Array(256);
420680
- var poolPtr = rnds8Pool.length;
420681
- function rng2() {
420682
- if (poolPtr > rnds8Pool.length - 16) {
420683
- _crypto.default.randomFillSync(rnds8Pool);
420684
- poolPtr = 0;
420685
- }
420686
- return rnds8Pool.slice(poolPtr, poolPtr += 16);
420816
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/native.js
420817
+ import { randomUUID } from "crypto";
420818
+ var native_default2;
420819
+ var init_native = __esm(() => {
420820
+ native_default2 = { randomUUID };
420821
+ });
420822
+
420823
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/rng.js
420824
+ import { randomFillSync } from "crypto";
420825
+ function rng2() {
420826
+ if (poolPtr > rnds8Pool.length - 16) {
420827
+ randomFillSync(rnds8Pool);
420828
+ poolPtr = 0;
420687
420829
  }
420830
+ return rnds8Pool.slice(poolPtr, poolPtr += 16);
420831
+ }
420832
+ var rnds8Pool, poolPtr;
420833
+ var init_rng = __esm(() => {
420834
+ rnds8Pool = new Uint8Array(256);
420835
+ poolPtr = rnds8Pool.length;
420688
420836
  });
420689
420837
 
420690
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/regex.js
420691
- var require_regex = __commonJS((exports) => {
420692
- Object.defineProperty(exports, "__esModule", {
420693
- value: true
420694
- });
420695
- exports.default = undefined;
420696
- var _default3 = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
420697
- exports.default = _default3;
420838
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/regex.js
420839
+ var regex_default2;
420840
+ var init_regex = __esm(() => {
420841
+ regex_default2 = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
420698
420842
  });
420699
420843
 
420700
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/validate.js
420701
- var require_validate2 = __commonJS((exports) => {
420702
- Object.defineProperty(exports, "__esModule", {
420703
- value: true
420704
- });
420705
- exports.default = undefined;
420706
- var _regex2 = _interopRequireDefault(require_regex());
420707
- function _interopRequireDefault(obj) {
420708
- return obj && obj.__esModule ? obj : { default: obj };
420709
- }
420710
- function validate2(uuid3) {
420711
- return typeof uuid3 === "string" && _regex2.default.test(uuid3);
420712
- }
420713
- var _default3 = validate2;
420714
- exports.default = _default3;
420844
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/validate.js
420845
+ function validate2(uuid3) {
420846
+ return typeof uuid3 === "string" && regex_default2.test(uuid3);
420847
+ }
420848
+ var validate_default2;
420849
+ var init_validate = __esm(() => {
420850
+ init_regex();
420851
+ validate_default2 = validate2;
420715
420852
  });
420716
420853
 
420717
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/stringify.js
420718
- var require_stringify = __commonJS((exports) => {
420719
- Object.defineProperty(exports, "__esModule", {
420720
- value: true
420721
- });
420722
- exports.default = undefined;
420723
- exports.unsafeStringify = unsafeStringify2;
420724
- var _validate = _interopRequireDefault(require_validate2());
420725
- function _interopRequireDefault(obj) {
420726
- return obj && obj.__esModule ? obj : { default: obj };
420727
- }
420728
- var byteToHex2 = [];
420854
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/stringify.js
420855
+ function unsafeStringify2(arr, offset2 = 0) {
420856
+ return (byteToHex2[arr[offset2 + 0]] + byteToHex2[arr[offset2 + 1]] + byteToHex2[arr[offset2 + 2]] + byteToHex2[arr[offset2 + 3]] + "-" + byteToHex2[arr[offset2 + 4]] + byteToHex2[arr[offset2 + 5]] + "-" + byteToHex2[arr[offset2 + 6]] + byteToHex2[arr[offset2 + 7]] + "-" + byteToHex2[arr[offset2 + 8]] + byteToHex2[arr[offset2 + 9]] + "-" + byteToHex2[arr[offset2 + 10]] + byteToHex2[arr[offset2 + 11]] + byteToHex2[arr[offset2 + 12]] + byteToHex2[arr[offset2 + 13]] + byteToHex2[arr[offset2 + 14]] + byteToHex2[arr[offset2 + 15]]).toLowerCase();
420857
+ }
420858
+ var byteToHex2;
420859
+ var init_stringify = __esm(() => {
420860
+ byteToHex2 = [];
420729
420861
  for (let i5 = 0;i5 < 256; ++i5) {
420730
420862
  byteToHex2.push((i5 + 256).toString(16).slice(1));
420731
420863
  }
420732
- function unsafeStringify2(arr, offset2 = 0) {
420733
- return byteToHex2[arr[offset2 + 0]] + byteToHex2[arr[offset2 + 1]] + byteToHex2[arr[offset2 + 2]] + byteToHex2[arr[offset2 + 3]] + "-" + byteToHex2[arr[offset2 + 4]] + byteToHex2[arr[offset2 + 5]] + "-" + byteToHex2[arr[offset2 + 6]] + byteToHex2[arr[offset2 + 7]] + "-" + byteToHex2[arr[offset2 + 8]] + byteToHex2[arr[offset2 + 9]] + "-" + byteToHex2[arr[offset2 + 10]] + byteToHex2[arr[offset2 + 11]] + byteToHex2[arr[offset2 + 12]] + byteToHex2[arr[offset2 + 13]] + byteToHex2[arr[offset2 + 14]] + byteToHex2[arr[offset2 + 15]];
420734
- }
420735
- function stringify(arr, offset2 = 0) {
420736
- const uuid3 = unsafeStringify2(arr, offset2);
420737
- if (!(0, _validate.default)(uuid3)) {
420738
- throw TypeError("Stringified UUID is invalid");
420739
- }
420740
- return uuid3;
420741
- }
420742
- var _default3 = stringify;
420743
- exports.default = _default3;
420744
- });
420745
-
420746
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/v1.js
420747
- var require_v1 = __commonJS((exports) => {
420748
- Object.defineProperty(exports, "__esModule", {
420749
- value: true
420750
- });
420751
- exports.default = undefined;
420752
- var _rng = _interopRequireDefault(require_rng());
420753
- var _stringify = require_stringify();
420754
- function _interopRequireDefault(obj) {
420755
- return obj && obj.__esModule ? obj : { default: obj };
420756
- }
420757
- var _nodeId;
420758
- var _clockseq;
420759
- var _lastMSecs = 0;
420760
- var _lastNSecs = 0;
420761
- function v1(options, buf, offset2) {
420762
- let i5 = buf && offset2 || 0;
420763
- const b2 = buf || new Array(16);
420764
- options = options || {};
420765
- let node4 = options.node || _nodeId;
420766
- let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
420767
- if (node4 == null || clockseq == null) {
420768
- const seedBytes = options.random || (options.rng || _rng.default)();
420769
- if (node4 == null) {
420770
- node4 = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
420771
- }
420772
- if (clockseq == null) {
420773
- clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383;
420774
- }
420775
- }
420776
- let msecs = options.msecs !== undefined ? options.msecs : Date.now();
420777
- let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
420778
- const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
420779
- if (dt < 0 && options.clockseq === undefined) {
420780
- clockseq = clockseq + 1 & 16383;
420781
- }
420782
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
420783
- nsecs = 0;
420784
- }
420785
- if (nsecs >= 1e4) {
420786
- throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
420787
- }
420788
- _lastMSecs = msecs;
420789
- _lastNSecs = nsecs;
420790
- _clockseq = clockseq;
420791
- msecs += 12219292800000;
420792
- const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
420793
- b2[i5++] = tl >>> 24 & 255;
420794
- b2[i5++] = tl >>> 16 & 255;
420795
- b2[i5++] = tl >>> 8 & 255;
420796
- b2[i5++] = tl & 255;
420797
- const tmh = msecs / 4294967296 * 1e4 & 268435455;
420798
- b2[i5++] = tmh >>> 8 & 255;
420799
- b2[i5++] = tmh & 255;
420800
- b2[i5++] = tmh >>> 24 & 15 | 16;
420801
- b2[i5++] = tmh >>> 16 & 255;
420802
- b2[i5++] = clockseq >>> 8 | 128;
420803
- b2[i5++] = clockseq & 255;
420804
- for (let n = 0;n < 6; ++n) {
420805
- b2[i5 + n] = node4[n];
420806
- }
420807
- return buf || (0, _stringify.unsafeStringify)(b2);
420808
- }
420809
- var _default3 = v1;
420810
- exports.default = _default3;
420811
- });
420812
-
420813
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/parse.js
420814
- var require_parse = __commonJS((exports) => {
420815
- Object.defineProperty(exports, "__esModule", {
420816
- value: true
420817
- });
420818
- exports.default = undefined;
420819
- var _validate = _interopRequireDefault(require_validate2());
420820
- function _interopRequireDefault(obj) {
420821
- return obj && obj.__esModule ? obj : { default: obj };
420822
- }
420823
- function parse9(uuid3) {
420824
- if (!(0, _validate.default)(uuid3)) {
420825
- throw TypeError("Invalid UUID");
420826
- }
420827
- let v;
420828
- const arr = new Uint8Array(16);
420829
- arr[0] = (v = parseInt(uuid3.slice(0, 8), 16)) >>> 24;
420830
- arr[1] = v >>> 16 & 255;
420831
- arr[2] = v >>> 8 & 255;
420832
- arr[3] = v & 255;
420833
- arr[4] = (v = parseInt(uuid3.slice(9, 13), 16)) >>> 8;
420834
- arr[5] = v & 255;
420835
- arr[6] = (v = parseInt(uuid3.slice(14, 18), 16)) >>> 8;
420836
- arr[7] = v & 255;
420837
- arr[8] = (v = parseInt(uuid3.slice(19, 23), 16)) >>> 8;
420838
- arr[9] = v & 255;
420839
- arr[10] = (v = parseInt(uuid3.slice(24, 36), 16)) / 1099511627776 & 255;
420840
- arr[11] = v / 4294967296 & 255;
420841
- arr[12] = v >>> 24 & 255;
420842
- arr[13] = v >>> 16 & 255;
420843
- arr[14] = v >>> 8 & 255;
420844
- arr[15] = v & 255;
420845
- return arr;
420846
- }
420847
- var _default3 = parse9;
420848
- exports.default = _default3;
420849
420864
  });
420850
420865
 
420851
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/v35.js
420852
- var require_v35 = __commonJS((exports) => {
420853
- Object.defineProperty(exports, "__esModule", {
420854
- value: true
420855
- });
420856
- exports.URL = exports.DNS = undefined;
420857
- exports.default = v352;
420858
- var _stringify = require_stringify();
420859
- var _parse2 = _interopRequireDefault(require_parse());
420860
- function _interopRequireDefault(obj) {
420861
- return obj && obj.__esModule ? obj : { default: obj };
420866
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/v4.js
420867
+ function v42(options, buf, offset2) {
420868
+ if (native_default2.randomUUID && !buf && !options) {
420869
+ return native_default2.randomUUID();
420862
420870
  }
420863
- function stringToBytes2(str) {
420864
- str = unescape(encodeURIComponent(str));
420865
- const bytes = [];
420866
- for (let i5 = 0;i5 < str.length; ++i5) {
420867
- bytes.push(str.charCodeAt(i5));
420868
- }
420869
- return bytes;
420871
+ options = options || {};
420872
+ const rnds = options.random ?? options.rng?.() ?? rng2();
420873
+ if (rnds.length < 16) {
420874
+ throw new Error("Random bytes length must be >= 16");
420870
420875
  }
420871
- var DNS2 = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
420872
- exports.DNS = DNS2;
420873
- var URL3 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
420874
- exports.URL = URL3;
420875
- function v352(name, version3, hashfunc) {
420876
- function generateUUID(value, namespace, buf, offset2) {
420877
- var _namespace;
420878
- if (typeof value === "string") {
420879
- value = stringToBytes2(value);
420880
- }
420881
- if (typeof namespace === "string") {
420882
- namespace = (0, _parse2.default)(namespace);
420883
- }
420884
- if (((_namespace = namespace) === null || _namespace === undefined ? undefined : _namespace.length) !== 16) {
420885
- throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
420886
- }
420887
- let bytes = new Uint8Array(16 + value.length);
420888
- bytes.set(namespace);
420889
- bytes.set(value, namespace.length);
420890
- bytes = hashfunc(bytes);
420891
- bytes[6] = bytes[6] & 15 | version3;
420892
- bytes[8] = bytes[8] & 63 | 128;
420893
- if (buf) {
420894
- offset2 = offset2 || 0;
420895
- for (let i5 = 0;i5 < 16; ++i5) {
420896
- buf[offset2 + i5] = bytes[i5];
420897
- }
420898
- return buf;
420899
- }
420900
- return (0, _stringify.unsafeStringify)(bytes);
420876
+ rnds[6] = rnds[6] & 15 | 64;
420877
+ rnds[8] = rnds[8] & 63 | 128;
420878
+ if (buf) {
420879
+ offset2 = offset2 || 0;
420880
+ if (offset2 < 0 || offset2 + 16 > buf.length) {
420881
+ throw new RangeError(`UUID byte range ${offset2}:${offset2 + 15} is out of buffer bounds`);
420901
420882
  }
420902
- try {
420903
- generateUUID.name = name;
420904
- } catch (err) {}
420905
- generateUUID.DNS = DNS2;
420906
- generateUUID.URL = URL3;
420907
- return generateUUID;
420908
- }
420909
- });
420910
-
420911
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/md5.js
420912
- var require_md5 = __commonJS((exports) => {
420913
- Object.defineProperty(exports, "__esModule", {
420914
- value: true
420915
- });
420916
- exports.default = undefined;
420917
- var _crypto = _interopRequireDefault(__require("crypto"));
420918
- function _interopRequireDefault(obj) {
420919
- return obj && obj.__esModule ? obj : { default: obj };
420920
- }
420921
- function md5(bytes) {
420922
- if (Array.isArray(bytes)) {
420923
- bytes = Buffer.from(bytes);
420924
- } else if (typeof bytes === "string") {
420925
- bytes = Buffer.from(bytes, "utf8");
420883
+ for (let i5 = 0;i5 < 16; ++i5) {
420884
+ buf[offset2 + i5] = rnds[i5];
420926
420885
  }
420927
- return _crypto.default.createHash("md5").update(bytes).digest();
420886
+ return buf;
420928
420887
  }
420929
- var _default3 = md5;
420930
- exports.default = _default3;
420888
+ return unsafeStringify2(rnds);
420889
+ }
420890
+ var v4_default2;
420891
+ var init_v42 = __esm(() => {
420892
+ init_native();
420893
+ init_rng();
420894
+ init_stringify();
420895
+ v4_default2 = v42;
420931
420896
  });
420932
420897
 
420933
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/v3.js
420934
- var require_v3 = __commonJS((exports) => {
420935
- Object.defineProperty(exports, "__esModule", {
420936
- value: true
420937
- });
420938
- exports.default = undefined;
420939
- var _v = _interopRequireDefault(require_v35());
420940
- var _md = _interopRequireDefault(require_md5());
420941
- function _interopRequireDefault(obj) {
420942
- return obj && obj.__esModule ? obj : { default: obj };
420898
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/sha1.js
420899
+ import { createHash } from "crypto";
420900
+ function sha12(bytes) {
420901
+ if (Array.isArray(bytes)) {
420902
+ bytes = Buffer.from(bytes);
420903
+ } else if (typeof bytes === "string") {
420904
+ bytes = Buffer.from(bytes, "utf8");
420943
420905
  }
420944
- var v3 = (0, _v.default)("v3", 48, _md.default);
420945
- var _default3 = v3;
420946
- exports.default = _default3;
420906
+ return createHash("sha1").update(bytes).digest();
420907
+ }
420908
+ var sha1_default2;
420909
+ var init_sha1 = __esm(() => {
420910
+ sha1_default2 = sha12;
420947
420911
  });
420948
420912
 
420949
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/native.js
420950
- var require_native = __commonJS((exports) => {
420951
- Object.defineProperty(exports, "__esModule", {
420952
- value: true
420953
- });
420954
- exports.default = undefined;
420955
- var _crypto = _interopRequireDefault(__require("crypto"));
420956
- function _interopRequireDefault(obj) {
420957
- return obj && obj.__esModule ? obj : { default: obj };
420913
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/parse.js
420914
+ function parse9(uuid3) {
420915
+ if (!validate_default2(uuid3)) {
420916
+ throw TypeError("Invalid UUID");
420958
420917
  }
420959
- var _default3 = {
420960
- randomUUID: _crypto.default.randomUUID
420961
- };
420962
- exports.default = _default3;
420918
+ let v;
420919
+ return Uint8Array.of((v = parseInt(uuid3.slice(0, 8), 16)) >>> 24, v >>> 16 & 255, v >>> 8 & 255, v & 255, (v = parseInt(uuid3.slice(9, 13), 16)) >>> 8, v & 255, (v = parseInt(uuid3.slice(14, 18), 16)) >>> 8, v & 255, (v = parseInt(uuid3.slice(19, 23), 16)) >>> 8, v & 255, (v = parseInt(uuid3.slice(24, 36), 16)) / 1099511627776 & 255, v / 4294967296 & 255, v >>> 24 & 255, v >>> 16 & 255, v >>> 8 & 255, v & 255);
420920
+ }
420921
+ var parse_default2;
420922
+ var init_parse4 = __esm(() => {
420923
+ init_validate();
420924
+ parse_default2 = parse9;
420963
420925
  });
420964
420926
 
420965
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/v4.js
420966
- var require_v4 = __commonJS((exports) => {
420967
- Object.defineProperty(exports, "__esModule", {
420968
- value: true
420969
- });
420970
- exports.default = undefined;
420971
- var _native = _interopRequireDefault(require_native());
420972
- var _rng = _interopRequireDefault(require_rng());
420973
- var _stringify = require_stringify();
420974
- function _interopRequireDefault(obj) {
420975
- return obj && obj.__esModule ? obj : { default: obj };
420927
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/v35.js
420928
+ function stringToBytes2(str) {
420929
+ str = unescape(encodeURIComponent(str));
420930
+ const bytes = new Uint8Array(str.length);
420931
+ for (let i5 = 0;i5 < str.length; ++i5) {
420932
+ bytes[i5] = str.charCodeAt(i5);
420976
420933
  }
420977
- function v42(options, buf, offset2) {
420978
- if (_native.default.randomUUID && !buf && !options) {
420979
- return _native.default.randomUUID();
420980
- }
420981
- options = options || {};
420982
- const rnds = options.random || (options.rng || _rng.default)();
420983
- rnds[6] = rnds[6] & 15 | 64;
420984
- rnds[8] = rnds[8] & 63 | 128;
420985
- if (buf) {
420986
- offset2 = offset2 || 0;
420987
- for (let i5 = 0;i5 < 16; ++i5) {
420988
- buf[offset2 + i5] = rnds[i5];
420989
- }
420990
- return buf;
420934
+ return bytes;
420935
+ }
420936
+ function v352(version3, hash5, value, namespace, buf, offset2) {
420937
+ const valueBytes = typeof value === "string" ? stringToBytes2(value) : value;
420938
+ const namespaceBytes = typeof namespace === "string" ? parse_default2(namespace) : namespace;
420939
+ if (typeof namespace === "string") {
420940
+ namespace = parse_default2(namespace);
420941
+ }
420942
+ if (namespace?.length !== 16) {
420943
+ throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
420944
+ }
420945
+ let bytes = new Uint8Array(16 + valueBytes.length);
420946
+ bytes.set(namespaceBytes);
420947
+ bytes.set(valueBytes, namespaceBytes.length);
420948
+ bytes = hash5(bytes);
420949
+ bytes[6] = bytes[6] & 15 | version3;
420950
+ bytes[8] = bytes[8] & 63 | 128;
420951
+ if (buf) {
420952
+ offset2 = offset2 || 0;
420953
+ if (offset2 < 0 || offset2 + 16 > buf.length) {
420954
+ throw new RangeError(`UUID byte range ${offset2}:${offset2 + 15} is out of buffer bounds`);
420991
420955
  }
420992
- return (0, _stringify.unsafeStringify)(rnds);
420993
- }
420994
- var _default3 = v42;
420995
- exports.default = _default3;
420996
- });
420997
-
420998
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/sha1.js
420999
- var require_sha1 = __commonJS((exports) => {
421000
- Object.defineProperty(exports, "__esModule", {
421001
- value: true
421002
- });
421003
- exports.default = undefined;
421004
- var _crypto = _interopRequireDefault(__require("crypto"));
421005
- function _interopRequireDefault(obj) {
421006
- return obj && obj.__esModule ? obj : { default: obj };
421007
- }
421008
- function sha12(bytes) {
421009
- if (Array.isArray(bytes)) {
421010
- bytes = Buffer.from(bytes);
421011
- } else if (typeof bytes === "string") {
421012
- bytes = Buffer.from(bytes, "utf8");
420956
+ for (let i5 = 0;i5 < 16; ++i5) {
420957
+ buf[offset2 + i5] = bytes[i5];
421013
420958
  }
421014
- return _crypto.default.createHash("sha1").update(bytes).digest();
421015
- }
421016
- var _default3 = sha12;
421017
- exports.default = _default3;
421018
- });
421019
-
421020
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/v5.js
421021
- var require_v5 = __commonJS((exports) => {
421022
- Object.defineProperty(exports, "__esModule", {
421023
- value: true
421024
- });
421025
- exports.default = undefined;
421026
- var _v = _interopRequireDefault(require_v35());
421027
- var _sha = _interopRequireDefault(require_sha1());
421028
- function _interopRequireDefault(obj) {
421029
- return obj && obj.__esModule ? obj : { default: obj };
420959
+ return buf;
421030
420960
  }
421031
- var v5 = (0, _v.default)("v5", 80, _sha.default);
421032
- var _default3 = v5;
421033
- exports.default = _default3;
421034
- });
421035
-
421036
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/nil.js
421037
- var require_nil = __commonJS((exports) => {
421038
- Object.defineProperty(exports, "__esModule", {
421039
- value: true
421040
- });
421041
- exports.default = undefined;
421042
- var _default3 = "00000000-0000-0000-0000-000000000000";
421043
- exports.default = _default3;
420961
+ return unsafeStringify2(bytes);
420962
+ }
420963
+ var DNS2 = "6ba7b810-9dad-11d1-80b4-00c04fd430c8", URL3 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
420964
+ var init_v35 = __esm(() => {
420965
+ init_parse4();
420966
+ init_stringify();
421044
420967
  });
421045
420968
 
421046
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/version.js
421047
- var require_version = __commonJS((exports) => {
421048
- Object.defineProperty(exports, "__esModule", {
421049
- value: true
421050
- });
421051
- exports.default = undefined;
421052
- var _validate = _interopRequireDefault(require_validate2());
421053
- function _interopRequireDefault(obj) {
421054
- return obj && obj.__esModule ? obj : { default: obj };
421055
- }
421056
- function version3(uuid3) {
421057
- if (!(0, _validate.default)(uuid3)) {
421058
- throw TypeError("Invalid UUID");
421059
- }
421060
- return parseInt(uuid3.slice(14, 15), 16);
421061
- }
421062
- var _default3 = version3;
421063
- exports.default = _default3;
420969
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/v5.js
420970
+ function v52(value, namespace, buf, offset2) {
420971
+ return v352(80, sha1_default2, value, namespace, buf, offset2);
420972
+ }
420973
+ var v5_default2;
420974
+ var init_v5 = __esm(() => {
420975
+ init_sha1();
420976
+ init_v35();
420977
+ v52.DNS = DNS2;
420978
+ v52.URL = URL3;
420979
+ v5_default2 = v52;
421064
420980
  });
421065
420981
 
421066
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/index.js
421067
- var require_dist3 = __commonJS((exports) => {
421068
- Object.defineProperty(exports, "__esModule", {
421069
- value: true
421070
- });
421071
- Object.defineProperty(exports, "NIL", {
421072
- enumerable: true,
421073
- get: function() {
421074
- return _nil.default;
421075
- }
421076
- });
421077
- Object.defineProperty(exports, "parse", {
421078
- enumerable: true,
421079
- get: function() {
421080
- return _parse2.default;
421081
- }
421082
- });
421083
- Object.defineProperty(exports, "stringify", {
421084
- enumerable: true,
421085
- get: function() {
421086
- return _stringify.default;
421087
- }
421088
- });
421089
- Object.defineProperty(exports, "v1", {
421090
- enumerable: true,
421091
- get: function() {
421092
- return _v.default;
421093
- }
421094
- });
421095
- Object.defineProperty(exports, "v3", {
421096
- enumerable: true,
421097
- get: function() {
421098
- return _v2.default;
421099
- }
421100
- });
421101
- Object.defineProperty(exports, "v4", {
421102
- enumerable: true,
421103
- get: function() {
421104
- return _v3.default;
421105
- }
421106
- });
421107
- Object.defineProperty(exports, "v5", {
421108
- enumerable: true,
421109
- get: function() {
421110
- return _v4.default;
421111
- }
421112
- });
421113
- Object.defineProperty(exports, "validate", {
421114
- enumerable: true,
421115
- get: function() {
421116
- return _validate.default;
421117
- }
421118
- });
421119
- Object.defineProperty(exports, "version", {
421120
- enumerable: true,
421121
- get: function() {
421122
- return _version.default;
421123
- }
421124
- });
421125
- var _v = _interopRequireDefault(require_v1());
421126
- var _v2 = _interopRequireDefault(require_v3());
421127
- var _v3 = _interopRequireDefault(require_v4());
421128
- var _v4 = _interopRequireDefault(require_v5());
421129
- var _nil = _interopRequireDefault(require_nil());
421130
- var _version = _interopRequireDefault(require_version());
421131
- var _validate = _interopRequireDefault(require_validate2());
421132
- var _stringify = _interopRequireDefault(require_stringify());
421133
- var _parse2 = _interopRequireDefault(require_parse());
421134
- function _interopRequireDefault(obj) {
421135
- return obj && obj.__esModule ? obj : { default: obj };
421136
- }
421137
- });
421138
-
421139
- // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/wrapper.mjs
421140
- var import_dist, v1, v3, v42, v5, NIL, version3, validate2, stringify, parse9;
421141
- var init_wrapper = __esm(() => {
421142
- import_dist = __toESM(require_dist3(), 1);
421143
- v1 = import_dist.default.v1;
421144
- v3 = import_dist.default.v3;
421145
- v42 = import_dist.default.v4;
421146
- v5 = import_dist.default.v5;
421147
- NIL = import_dist.default.NIL;
421148
- version3 = import_dist.default.version;
421149
- validate2 = import_dist.default.validate;
421150
- stringify = import_dist.default.stringify;
421151
- parse9 = import_dist.default.parse;
420982
+ // ../../node_modules/.pnpm/uuid@11.1.1/node_modules/uuid/dist/esm/index.js
420983
+ var init_esm2 = __esm(() => {
420984
+ init_v42();
420985
+ init_v5();
421152
420986
  });
421153
420987
 
421154
420988
  // ../../packages/super-editor/src/editors/v1/core/super-converter/exporter-docx-defs.js
@@ -422972,9 +422806,9 @@ function decode24(params3) {
422972
422806
  if (params3.isFinalDoc) {
422973
422807
  return null;
422974
422808
  }
422975
- const textNode = translatedTextNode.elements.find((n) => n.name === "w:t");
422976
- if (textNode)
422977
- textNode.name = "w:delText";
422809
+ (translatedTextNode.elements || []).filter((n) => n.name === "w:t").forEach((n) => {
422810
+ n.name = "w:delText";
422811
+ });
422978
422812
  return {
422979
422813
  name: "w:del",
422980
422814
  attributes: {
@@ -433153,11 +432987,11 @@ class Renderer3 {
433153
432987
  case Helper3.GDI.MetafileType.MEMORYMETAFILE:
433154
432988
  case Helper3.GDI.MetafileType.DISKMETAFILE:
433155
432989
  if (size3 === Helper3.GDI.METAHEADER_SIZE / 2) {
433156
- const version4 = reader.readUint16();
433157
- switch (version4) {
432990
+ const version3 = reader.readUint16();
432991
+ switch (version3) {
433158
432992
  case Helper3.GDI.MetafileVersion.METAVERSION100:
433159
432993
  case Helper3.GDI.MetafileVersion.METAVERSION300:
433160
- this._img = new WMF2(reader, placable, version4, headerstart + size3 * 2);
432994
+ this._img = new WMF2(reader, placable, version3, headerstart + size3 * 2);
433161
432995
  break;
433162
432996
  }
433163
432997
  }
@@ -433211,8 +433045,8 @@ class WMF2 {
433211
433045
  _hdrsize;
433212
433046
  _placable;
433213
433047
  _records;
433214
- constructor(reader, placable, version4, hdrsize) {
433215
- this._version = version4;
433048
+ constructor(reader, placable, version3, hdrsize) {
433049
+ this._version = version3;
433216
433050
  this._hdrsize = hdrsize;
433217
433051
  this._placable = placable;
433218
433052
  this._records = new WMFRecords2(reader, this._hdrsize);
@@ -443355,7 +443189,7 @@ function handleImageNode3(node4, params3, isAnchor) {
443355
443189
  const wrapValue = wrap6;
443356
443190
  const relativeHeight = isAnchor ? parseRelativeHeight2(attributes["relativeHeight"]) : null;
443357
443191
  const docPrId = docPr?.attributes?.id ?? "";
443358
- const sdImageId = v5(`${currentFile}:${rEmbed}:${docPrId}`, SD_IMAGE_ID_NAMESPACE2);
443192
+ const sdImageId = v5_default2(`${currentFile}:${rEmbed}:${docPrId}`, SD_IMAGE_ID_NAMESPACE2);
443359
443193
  const nodeAttrs = {
443360
443194
  sdImageId,
443361
443195
  relativeHeight,
@@ -444047,7 +443881,7 @@ var DRAWING_XML_TAG2 = "w:drawing", SHAPE_URI2 = "http://schemas.microsoft.com/o
444047
443881
  };
444048
443882
  };
444049
443883
  var init_encode_image_node_helpers = __esm(() => {
444050
- init_wrapper();
443884
+ init_esm2();
444051
443885
  init_helpers();
444052
443886
  init_vector_shape_helpers();
444053
443887
  init_metafile_converter();
@@ -445724,11 +445558,33 @@ function getTextNodeForExport2(text7, marks, params3) {
445724
445558
  wordIdAllocator: params3?.converter?.wordIdAllocator || null,
445725
445559
  partPath: resolveExportPartPath3(params3)
445726
445560
  });
445727
- textNodes.push({
445728
- name: "w:t",
445729
- elements: [{ text: text7, type: "text" }],
445730
- attributes: nodeAttrs
445731
- });
445561
+ const textValue = typeof text7 === "string" ? text7 : "";
445562
+ const normalizedText = textValue.includes("\r") ? textValue.replace(/\r\n?/g, `
445563
+ `) : textValue;
445564
+ if (normalizedText.includes(`
445565
+ `)) {
445566
+ const segments = normalizedText.split(`
445567
+ `);
445568
+ segments.forEach((segment, index3) => {
445569
+ if (segment.length > 0) {
445570
+ const segmentNeedsSpace = /^\s|\s$/.test(segment);
445571
+ textNodes.push({
445572
+ name: "w:t",
445573
+ elements: [{ text: segment, type: "text" }],
445574
+ attributes: segmentNeedsSpace ? { "xml:space": "preserve" } : null
445575
+ });
445576
+ }
445577
+ if (index3 < segments.length - 1) {
445578
+ textNodes.push({ name: "w:br" });
445579
+ }
445580
+ });
445581
+ } else {
445582
+ textNodes.push({
445583
+ name: "w:t",
445584
+ elements: [{ text: normalizedText, type: "text" }],
445585
+ attributes: nodeAttrs
445586
+ });
445587
+ }
445732
445588
  if (params3?.editor?.extensionService?.extensions) {
445733
445589
  const customMarks = params3.editor.extensionService.extensions.filter((extension2) => extension2.isExternal === true);
445734
445590
  normalizedMarks.forEach((mark2) => {
@@ -452148,12 +452004,12 @@ var readCommentAttribute2 = (attributes, primaryName, fallbackName) => {
452148
452004
  if (internalId != null)
452149
452005
  return internalId;
452150
452006
  if (importedId == null || !Number.isFinite(createdTime))
452151
- return v42();
452007
+ return v4_default2();
452152
452008
  const hash5 = stableHexHash2(`${importedId}-${createdTime}`);
452153
452009
  return `imported-${hash5}`;
452154
452010
  };
452155
452011
  var init_documentCommentsImporter = __esm(() => {
452156
- init_wrapper();
452012
+ init_esm2();
452157
452013
  init_docxImporter();
452158
452014
  });
452159
452015
 
@@ -452195,7 +452051,7 @@ function assignInternalId2(element3, idMap, context, insideTrackedChange, nextTr
452195
452051
  return;
452196
452052
  if (insideTrackedChange) {
452197
452053
  if (!idMap.has(wordId)) {
452198
- idMap.set(wordId, v42());
452054
+ idMap.set(wordId, v4_default2());
452199
452055
  }
452200
452056
  return;
452201
452057
  }
@@ -452209,7 +452065,7 @@ function assignInternalId2(element3, idMap, context, insideTrackedChange, nextTr
452209
452065
  context.lastTrackedChange = null;
452210
452066
  context.beforeLastTrackedChange = null;
452211
452067
  } else {
452212
- const internalId = idMap.get(wordId) ?? v42();
452068
+ const internalId = idMap.get(wordId) ?? v4_default2();
452213
452069
  idMap.set(wordId, internalId);
452214
452070
  context.beforeLastTrackedChange = context.lastTrackedChange;
452215
452071
  context.lastTrackedChange = { ...current, internalId };
@@ -452270,7 +452126,7 @@ function buildTrackedChangeIdMapsByPart2(docx, options = {}) {
452270
452126
  }
452271
452127
  var TRACKED_CHANGE_NAMES2, PAIRING_TRANSPARENT_NAMES2;
452272
452128
  var init_trackedChangeIdMapper = __esm(() => {
452273
- init_wrapper();
452129
+ init_esm2();
452274
452130
  TRACKED_CHANGE_NAMES2 = new Set(["w:ins", "w:del"]);
452275
452131
  PAIRING_TRANSPARENT_NAMES2 = new Set([
452276
452132
  "w:commentRangeStart",
@@ -458983,7 +458839,7 @@ function buildSourcesRootElement2(sources, styleMetadata) {
458983
458839
  const sourceElements = sources.map(buildSourceNode2).filter(Boolean);
458984
458840
  const selectedStyle = styleMetadata.selectedStyle || DEFAULT_SELECTED_STYLE2;
458985
458841
  const styleName = styleMetadata.styleName || DEFAULT_STYLE_NAME2;
458986
- const version4 = styleMetadata.version || DEFAULT_VERSION2;
458842
+ const version3 = styleMetadata.version || DEFAULT_VERSION2;
458987
458843
  return {
458988
458844
  type: "element",
458989
458845
  name: "b:Sources",
@@ -458992,7 +458848,7 @@ function buildSourcesRootElement2(sources, styleMetadata) {
458992
458848
  xmlns: BIBLIOGRAPHY_NAMESPACE_URI2,
458993
458849
  SelectedStyle: selectedStyle,
458994
458850
  StyleName: styleName,
458995
- Version: version4
458851
+ Version: version3
458996
458852
  },
458997
458853
  elements: sourceElements
458998
458854
  };
@@ -459128,9 +458984,9 @@ function syncBibliographyPartToPackage2(convertedXml, bibliographyPart) {
459128
458984
  const itemRelsPath = `customXml/_rels/item${itemIndex}.xml.rels`;
459129
458985
  const selectedStyle = bibliographyPart?.selectedStyle ?? currentPackageState.selectedStyle ?? DEFAULT_SELECTED_STYLE2;
459130
458986
  const styleName = bibliographyPart?.styleName ?? currentPackageState.styleName ?? DEFAULT_STYLE_NAME2;
459131
- const version4 = bibliographyPart?.version ?? currentPackageState.version ?? DEFAULT_VERSION2;
458987
+ const version3 = bibliographyPart?.version ?? currentPackageState.version ?? DEFAULT_VERSION2;
459132
458988
  const existingPartDeclaration = convertedXml[partPath]?.declaration;
459133
- const sourcesRoot = buildSourcesRootElement2(normalizedSources, { selectedStyle, styleName, version: version4 });
458989
+ const sourcesRoot = buildSourcesRootElement2(normalizedSources, { selectedStyle, styleName, version: version3 });
459134
458990
  convertedXml[partPath] = createXmlDocument3(sourcesRoot, existingPartDeclaration);
459135
458991
  const relationshipsRoot = ensureDocumentRelationshipsRoot3(convertedXml);
459136
458992
  const expectedTarget = buildDocumentRelationshipTarget2(partPath);
@@ -459153,7 +459009,7 @@ function syncBibliographyPartToPackage2(convertedXml, bibliographyPart) {
459153
459009
  }
459154
459010
  const existingItemProps = convertedXml[itemPropsPath];
459155
459011
  const existingItemPropsDeclaration = existingItemProps?.declaration;
459156
- const dataStoreItemId = extractExistingDataStoreItemId2(existingItemProps) || `{${v42().toUpperCase()}}`;
459012
+ const dataStoreItemId = extractExistingDataStoreItemId2(existingItemProps) || `{${v4_default2().toUpperCase()}}`;
459157
459013
  convertedXml[itemPropsPath] = createXmlDocument3(buildItemPropsRootElement2(dataStoreItemId), existingItemPropsDeclaration);
459158
459014
  const existingItemRelsDeclaration = convertedXml[itemRelsPath]?.declaration;
459159
459015
  convertedXml[itemRelsPath] = createXmlDocument3(buildCustomXmlItemRelationshipsRoot2(`itemProps${itemIndex}.xml`), existingItemRelsDeclaration);
@@ -459164,7 +459020,7 @@ function syncBibliographyPartToPackage2(convertedXml, bibliographyPart) {
459164
459020
  itemRelsPath,
459165
459021
  selectedStyle,
459166
459022
  styleName,
459167
- version: version4
459023
+ version: version3
459168
459024
  };
459169
459025
  }
459170
459026
  function getBibliographyPartExportPaths2(bibliographyPart) {
@@ -459173,7 +459029,7 @@ function getBibliographyPartExportPaths2(bibliographyPart) {
459173
459029
  }
459174
459030
  var BIBLIOGRAPHY_NAMESPACE_URI2 = "http://schemas.openxmlformats.org/officeDocument/2006/bibliography", CUSTOM_XML_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", DEFAULT_SELECTED_STYLE2 = "/APA.XSL", DEFAULT_STYLE_NAME2 = "APA", DEFAULT_VERSION2 = "6", API_TO_OOXML_SOURCE_TYPE2, OOXML_TO_API_SOURCE_TYPE2, SIMPLE_FIELD_TO_XML_TAG2, XML_TAG_TO_SIMPLE_FIELD2;
459175
459031
  var init_citation_sources = __esm(() => {
459176
- init_wrapper();
459032
+ init_esm2();
459177
459033
  init_helpers();
459178
459034
  init_constants4();
459179
459035
  API_TO_OOXML_SOURCE_TYPE2 = Object.freeze({
@@ -459280,7 +459136,7 @@ var xmljs2, FONT_FAMILY_FALLBACKS3, DEFAULT_GENERIC_FALLBACK3 = "sans-serif", DE
459280
459136
  }
459281
459137
  }, SuperConverter3;
459282
459138
  var init_SuperConverter = __esm(() => {
459283
- init_wrapper();
459139
+ init_esm2();
459284
459140
  init_exporter();
459285
459141
  init_docxImporter();
459286
459142
  init_normalizeDuplicateBlockIdentitiesInContent();
@@ -459597,8 +459453,8 @@ var init_SuperConverter = __esm(() => {
459597
459453
  static getStoredSuperdocVersion(docx) {
459598
459454
  return SuperConverter3.getStoredCustomProperty(docx, "SuperdocVersion");
459599
459455
  }
459600
- static setStoredSuperdocVersion(docx = this.convertedXml, version4 = CURRENT_APP_VERSION3) {
459601
- return SuperConverter3.setStoredCustomProperty(docx, "SuperdocVersion", version4, false);
459456
+ static setStoredSuperdocVersion(docx = this.convertedXml, version3 = CURRENT_APP_VERSION3) {
459457
+ return SuperConverter3.setStoredCustomProperty(docx, "SuperdocVersion", version3, false);
459602
459458
  }
459603
459459
  static generateWordTimestamp() {
459604
459460
  const date6 = new Date;
@@ -459692,7 +459548,7 @@ var init_SuperConverter = __esm(() => {
459692
459548
  }
459693
459549
  async#generateContentHash() {
459694
459550
  if (!this.fileSource) {
459695
- return `HASH-${v42().replace(/-/g, "").substring(0, 8).toUpperCase()}`;
459551
+ return `HASH-${v4_default2().replace(/-/g, "").substring(0, 8).toUpperCase()}`;
459696
459552
  }
459697
459553
  try {
459698
459554
  let data;
@@ -459705,12 +459561,12 @@ var init_SuperConverter = __esm(() => {
459705
459561
  const arrayBuffer = await this.fileSource.arrayBuffer();
459706
459562
  data = new Uint8Array(arrayBuffer);
459707
459563
  } else {
459708
- return `HASH-${v42().replace(/-/g, "").substring(0, 8).toUpperCase()}`;
459564
+ return `HASH-${v4_default2().replace(/-/g, "").substring(0, 8).toUpperCase()}`;
459709
459565
  }
459710
459566
  return `HASH-${computeCrc32Hex2(data).toUpperCase()}`;
459711
459567
  } catch (e) {
459712
459568
  console.warn("[super-converter] Could not generate content hash:", e);
459713
- return `HASH-${v42().replace(/-/g, "").substring(0, 8).toUpperCase()}`;
459569
+ return `HASH-${v4_default2().replace(/-/g, "").substring(0, 8).toUpperCase()}`;
459714
459570
  }
459715
459571
  }
459716
459572
  async getDocumentIdentifier() {
@@ -459723,7 +459579,7 @@ var init_SuperConverter = __esm(() => {
459723
459579
  this.documentUniqueIdentifier = this.#generateIdentifierHash();
459724
459580
  } else {
459725
459581
  if (!hasGuid) {
459726
- this.documentGuid = v42();
459582
+ this.documentGuid = v4_default2();
459727
459583
  }
459728
459584
  if (!hasTimestamp) {
459729
459585
  this.setDocumentCreatedTimestamp(SuperConverter3.generateWordTimestamp());
@@ -459736,7 +459592,7 @@ var init_SuperConverter = __esm(() => {
459736
459592
  promoteToGuid() {
459737
459593
  if (this.documentGuid)
459738
459594
  return this.documentGuid;
459739
- this.documentGuid = this.getMicrosoftDocId() || v42();
459595
+ this.documentGuid = this.getMicrosoftDocId() || v4_default2();
459740
459596
  this.documentModified = true;
459741
459597
  this.documentUniqueIdentifier = null;
459742
459598
  return this.documentGuid;
@@ -459928,7 +459784,7 @@ var init_SuperConverter = __esm(() => {
459928
459784
  this.documentInternalId = w15DocId?.attributes?.["w15:val"];
459929
459785
  }
459930
459786
  createDocumentIdElement() {
459931
- const docId = v42().toUpperCase();
459787
+ const docId = v4_default2().toUpperCase();
459932
459788
  this.documentInternalId = docId;
459933
459789
  return {
459934
459790
  type: "element",
@@ -460087,7 +459943,7 @@ var init_SuperConverter = __esm(() => {
460087
459943
  SuperConverter3.setStoredCustomProperty(this.convertedXml, SUPERDOC_DOCUMENT_ORIGIN_PROPERTY3, storedDocumentOrigin, false);
460088
459944
  if (this.documentModified || this.documentGuid) {
460089
459945
  if (!this.documentGuid) {
460090
- this.documentGuid = this.getMicrosoftDocId() || v42();
459946
+ this.documentGuid = this.getMicrosoftDocId() || v4_default2();
460091
459947
  }
460092
459948
  SuperConverter3.setStoredCustomProperty(this.convertedXml, "DocumentGuid", this.documentGuid, true);
460093
459949
  }
@@ -460432,9 +460288,9 @@ var init_SuperConverter = __esm(() => {
460432
460288
  console.warn("getStoredSuperdocId is deprecated, use getDocumentGuid instead");
460433
460289
  return SuperConverter3.extractDocumentGuid(docx);
460434
460290
  }
460435
- static updateDocumentVersion(docx, version4) {
460291
+ static updateDocumentVersion(docx, version3) {
460436
460292
  console.warn("updateDocumentVersion is deprecated, use setStoredSuperdocVersion instead");
460437
- return SuperConverter3.setStoredSuperdocVersion(docx, version4);
460293
+ return SuperConverter3.setStoredSuperdocVersion(docx, version3);
460438
460294
  }
460439
460295
  };
460440
460296
  });
@@ -462126,10 +461982,10 @@ var require_supports_color = __commonJS((exports, module) => {
462126
461982
  return 3;
462127
461983
  }
462128
461984
  if ("TERM_PROGRAM" in env2) {
462129
- const version4 = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
461985
+ const version3 = parseInt((env2.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
462130
461986
  switch (env2.TERM_PROGRAM) {
462131
461987
  case "iTerm.app":
462132
- return version4 >= 3 ? 3 : 2;
461988
+ return version3 >= 3 ? 3 : 2;
462133
461989
  case "Apple_Terminal":
462134
461990
  return 2;
462135
461991
  }
@@ -462684,7 +462540,7 @@ function parse10(options) {
462684
462540
  }
462685
462541
  }
462686
462542
  }
462687
- var init_parse4 = __esm(() => {
462543
+ var init_parse5 = __esm(() => {
462688
462544
  init_micromark_util_combine_extensions();
462689
462545
  init_content2();
462690
462546
  init_document();
@@ -462791,7 +462647,7 @@ var init_preprocess = __esm(() => {
462791
462647
 
462792
462648
  // ../../node_modules/.pnpm/micromark@4.0.2/node_modules/micromark/dev/index.js
462793
462649
  var init_dev19 = __esm(() => {
462794
- init_parse4();
462650
+ init_parse5();
462795
462651
  init_postprocess();
462796
462652
  init_preprocess();
462797
462653
  });
@@ -463829,7 +463685,7 @@ function buildImageAttrs2(node4, ctx2) {
463829
463685
  src: node4.url,
463830
463686
  alt: node4.alt ?? null,
463831
463687
  title: node4.title ?? null,
463832
- sdImageId: v42(),
463688
+ sdImageId: v4_default2(),
463833
463689
  id: generateUniqueImageDocPrId2(ctx2)
463834
463690
  };
463835
463691
  const dimensions = readImageDimensionsFromDataUri2(node4.url);
@@ -463914,7 +463770,7 @@ function addDiagnostic3(ctx2, severity, nodeType, message, node4) {
463914
463770
  }
463915
463771
  var FULL_WIDTH_TABLE_PCT2 = 5000, imageDocPrIdsByContext2, HEADING_STYLE_MAP2;
463916
463772
  var init_mdastToProseMirror = __esm(() => {
463917
- init_wrapper();
463773
+ init_esm2();
463918
463774
  init_list_numbering_helpers();
463919
463775
  init_image_dimensions();
463920
463776
  imageDocPrIdsByContext2 = new WeakMap;
@@ -468072,6 +467928,8 @@ function executeTextRewrite2(editor, tr, target, step3, mapping) {
468072
467928
  const absTo = mapping.map(target.absTo);
468073
467929
  const replacementText = getReplacementText2(step3.args.replacement);
468074
467930
  const marks = resolveMarksForRange2(editor, target, step3);
467931
+ const lineBreakNodeType = editor.state.schema.nodes?.lineBreak;
467932
+ const parentAllowsLineBreakAt = (pos) => lineBreakNodeType ? parentAllowsNodeAt2(tr, pos, lineBreakNodeType) : false;
468075
467933
  const structuralRewrite = resolveStructuralRangeRewrite2(tr.doc, absFrom, absTo, step3);
468076
467934
  if (structuralRewrite) {
468077
467935
  const slice3 = buildReplacementParagraphSlice2(editor, structuralRewrite.replacementBlocks, marks, structuralRewrite.paragraphAttrs, step3.id, structuralRewrite.leadingWrappers, structuralRewrite.trailingWrappers, structuralRewrite.openStart, structuralRewrite.openEnd);
@@ -468099,7 +467957,9 @@ function executeTextRewrite2(editor, tr, target, step3, mapping) {
468099
467957
  tr.delete(absFrom, absTo);
468100
467958
  return { changed: target.text.length > 0 };
468101
467959
  }
468102
- const content5 = buildTextWithTabs2(editor.state.schema, replacementText, asProseMirrorMarks2(marks));
467960
+ const content5 = buildTextWithTabs2(editor.state.schema, replacementText, asProseMirrorMarks2(marks), {
467961
+ parentAllowsLineBreak: parentAllowsLineBreakAt(absFrom)
467962
+ });
468103
467963
  tr.replaceWith(absFrom, absTo, content5);
468104
467964
  return { changed: replacementText !== target.text };
468105
467965
  }
@@ -468143,17 +468003,23 @@ function executeTextRewrite2(editor, tr, target, step3, mapping) {
468143
468003
  if (change.type === "delete") {
468144
468004
  tr.delete(remap(change.docFrom), remap(change.docTo));
468145
468005
  } else if (change.type === "insert") {
468146
- const content5 = buildTextWithTabs2(editor.state.schema, change.newText, asProseMirrorMarks2(marks));
468006
+ const content5 = buildTextWithTabs2(editor.state.schema, change.newText, asProseMirrorMarks2(marks), {
468007
+ parentAllowsLineBreak: parentAllowsLineBreakAt(remap(change.docPos))
468008
+ });
468147
468009
  tr.insert(remap(change.docPos), content5);
468148
468010
  } else {
468149
- const content5 = buildTextWithTabs2(editor.state.schema, change.newText, asProseMirrorMarks2(marks));
468011
+ const content5 = buildTextWithTabs2(editor.state.schema, change.newText, asProseMirrorMarks2(marks), {
468012
+ parentAllowsLineBreak: parentAllowsLineBreakAt(remap(change.docFrom))
468013
+ });
468150
468014
  tr.replaceWith(remap(change.docFrom), remap(change.docTo), content5);
468151
468015
  }
468152
468016
  }
468153
468017
  } else if (trimmedNew.length === 0) {
468154
468018
  tr.delete(trimmedFrom, trimmedTo);
468155
468019
  } else {
468156
- const content5 = buildTextWithTabs2(editor.state.schema, trimmedNew, asProseMirrorMarks2(marks));
468020
+ const content5 = buildTextWithTabs2(editor.state.schema, trimmedNew, asProseMirrorMarks2(marks), {
468021
+ parentAllowsLineBreak: parentAllowsLineBreakAt(trimmedFrom)
468022
+ });
468157
468023
  tr.replaceWith(trimmedFrom, trimmedTo, content5);
468158
468024
  }
468159
468025
  return { changed: replacementText !== target.text };
@@ -468234,7 +468100,9 @@ function executeTextInsert2(editor, tr, target, step3, mapping) {
468234
468100
  }
468235
468101
  const tabNodeType = editor.state.schema.nodes?.tab;
468236
468102
  const parentAllowsTab = tabNodeType && text9.includes("\t") ? parentAllowsNodeAt2(tr, absPos, tabNodeType) : false;
468237
- tr.insert(absPos, buildTextWithTabs2(editor.state.schema, text9, marks, { parentAllowsTab }));
468103
+ const lineBreakNodeType = editor.state.schema.nodes?.lineBreak;
468104
+ const parentAllowsLineBreak = lineBreakNodeType && /[\r\n]/.test(text9) ? parentAllowsNodeAt2(tr, absPos, lineBreakNodeType) : false;
468105
+ tr.insert(absPos, buildTextWithTabs2(editor.state.schema, text9, marks, { parentAllowsTab, parentAllowsLineBreak }));
468238
468106
  return { changed: true };
468239
468107
  }
468240
468108
  function executeTextDelete2(_editor, tr, target, _step, mapping) {
@@ -468329,7 +468197,11 @@ function executeSpanTextRewrite2(editor, tr, target, step3, mapping) {
468329
468197
  const absTo = mapping.map(lastSeg.absTo, -1);
468330
468198
  if (replacementBlocks.length === 1) {
468331
468199
  const marks = resolveSpanMarks2(editor, target, policy, step3.id);
468332
- const content5 = buildTextWithTabs2(editor.state.schema, replacementBlocks[0], asProseMirrorMarks2(marks));
468200
+ const lineBreakNodeType = editor.state.schema.nodes?.lineBreak;
468201
+ const parentAllowsLineBreak = lineBreakNodeType ? parentAllowsNodeAt2(tr, absFrom, lineBreakNodeType) : false;
468202
+ const content5 = buildTextWithTabs2(editor.state.schema, replacementBlocks[0], asProseMirrorMarks2(marks), {
468203
+ parentAllowsLineBreak
468204
+ });
468333
468205
  tr.replaceWith(absFrom, absTo, content5);
468334
468206
  return { changed: true };
468335
468207
  }
@@ -469095,7 +468967,7 @@ function resolveBlockId2(node4, seenIds, existingDocIds) {
469095
468967
  seenIds.add(id2);
469096
468968
  return id2;
469097
468969
  }
469098
- const generated = v42();
468970
+ const generated = v4_default2();
469099
468971
  seenIds.add(generated);
469100
468972
  return generated;
469101
468973
  }
@@ -469185,7 +469057,7 @@ function materializeTable2(schema, node4, seenIds, existingDocIds, operation, op
469185
469057
  const rows = (payload.rows ?? []).map((row2) => materializeTableRow2(schema, row2, seenIds, existingDocIds, operation, options));
469186
469058
  const attrs = {
469187
469059
  sdBlockId: resolveBlockId2(node4, seenIds, existingDocIds),
469188
- paraId: v42()
469060
+ paraId: v4_default2()
469189
469061
  };
469190
469062
  const styleRef = payload.styleRef ?? payload.style;
469191
469063
  const tableProperties = isRecord8(payload.tableProperties) ? { ...payload.tableProperties } : {};
@@ -469227,7 +469099,7 @@ function materializeTable2(schema, node4, seenIds, existingDocIds, operation, op
469227
469099
  }
469228
469100
  function materializeTableRow2(schema, row2, seenIds, existingDocIds, operation, options) {
469229
469101
  const cells = (row2.cells ?? []).map((cell2) => materializeTableCell2(schema, cell2, seenIds, existingDocIds, operation, options));
469230
- const attrs = { sdBlockId: v42() };
469102
+ const attrs = { sdBlockId: v4_default2() };
469231
469103
  if (row2.props?.minHeight !== undefined)
469232
469104
  attrs.minHeight = row2.props.minHeight;
469233
469105
  if (row2.props?.cantSplit !== undefined)
@@ -469236,7 +469108,7 @@ function materializeTableRow2(schema, row2, seenIds, existingDocIds, operation,
469236
469108
  }
469237
469109
  function materializeTableCell2(schema, cell2, seenIds, existingDocIds, operation, options) {
469238
469110
  const children = (cell2.content ?? [{ type: "paragraph" }]).map((child) => materializeNode2(schema, child, seenIds, existingDocIds, operation, options));
469239
- const attrs = { sdBlockId: v42() };
469111
+ const attrs = { sdBlockId: v4_default2() };
469240
469112
  if (cell2.colSpan !== undefined)
469241
469113
  attrs.colspan = cell2.colSpan;
469242
469114
  if (cell2.rowSpan !== undefined)
@@ -469371,15 +469243,15 @@ function materializeListItem2(schema, item, _parentPayload, seenIds, existingDoc
469371
469243
  const kind = resolveKind2(itemContent[0]);
469372
469244
  if (["paragraph", "heading", "table", "list", "image"].includes(kind)) {
469373
469245
  const children = itemContent.map((child) => materializeNode2(schema, child, seenIds, existingDocIds, operation, options));
469374
- const attrs2 = { sdBlockId: v42() };
469246
+ const attrs2 = { sdBlockId: v4_default2() };
469375
469247
  if (item.level !== undefined)
469376
469248
  attrs2.level = item.level;
469377
469249
  return schema.nodes.listItem.create(attrs2, children);
469378
469250
  }
469379
469251
  }
469380
469252
  const content5 = materializeInlineContent2(schema, itemContent, operation, options);
469381
- const paragraph4 = schema.nodes.paragraph.create({ sdBlockId: v42() }, content5);
469382
- const attrs = { sdBlockId: v42() };
469253
+ const paragraph4 = schema.nodes.paragraph.create({ sdBlockId: v4_default2() }, content5);
469254
+ const attrs = { sdBlockId: v4_default2() };
469383
469255
  if (item.level !== undefined)
469384
469256
  attrs.level = item.level;
469385
469257
  return schema.nodes.listItem.create(attrs, [paragraph4]);
@@ -469634,7 +469506,7 @@ function materializeTab2(schema) {
469634
469506
  return nodeType.create();
469635
469507
  }
469636
469508
  function materializeLineBreak2(schema) {
469637
- const nodeType = schema.nodes.hardBreak ?? schema.nodes.lineBreak;
469509
+ const nodeType = schema.nodes.lineBreak ?? schema.nodes.hardBreak;
469638
469510
  if (!nodeType)
469639
469511
  return schema.text(`
469640
469512
  `);
@@ -469804,7 +469676,7 @@ function buildMarksFromLegacyRun2(schema, run2) {
469804
469676
  var CONTENT_CAPABILITIES2, INLINE_CAPABILITIES2, SDT_LOCK_TO_LOCK_MODE2;
469805
469677
  var init_node_materializer = __esm(() => {
469806
469678
  init_dist2();
469807
- init_wrapper();
469679
+ init_esm2();
469808
469680
  init_errors4();
469809
469681
  init_text_with_tabs();
469810
469682
  CONTENT_CAPABILITIES2 = new Map([
@@ -470325,7 +470197,7 @@ function ensureMarkdownImageIds2(nodes) {
470325
470197
  const attrs = isJsonObject2(node4.attrs) ? { ...node4.attrs } : {};
470326
470198
  const hasStableId = typeof attrs.sdImageId === "string" && attrs.sdImageId.length > 0;
470327
470199
  if (!hasStableId) {
470328
- attrs.sdImageId = v42();
470200
+ attrs.sdImageId = v4_default2();
470329
470201
  }
470330
470202
  node4.attrs = attrs;
470331
470203
  }
@@ -470373,7 +470245,7 @@ function toCompiledTarget2(stepId, op, resolved) {
470373
470245
  };
470374
470246
  }
470375
470247
  function executeDomainCommand2(editor, handler3, options) {
470376
- const stepId = v42();
470248
+ const stepId = v4_default2();
470377
470249
  const step3 = {
470378
470250
  id: stepId,
470379
470251
  op: "domain.command",
@@ -470429,7 +470301,7 @@ function writeWrapper2(editor, request, options) {
470429
470301
  runtime.commit(editor);
470430
470302
  return mapPlanReceiptToTextReceipt2(receipt3, resolved.resolution);
470431
470303
  }
470432
- const stepId = v42();
470304
+ const stepId = v4_default2();
470433
470305
  const step3 = {
470434
470306
  id: stepId,
470435
470307
  op: "text.insert",
@@ -470523,7 +470395,7 @@ function selectionMutationWrapper2(editor, request, options) {
470523
470395
  if (mode === "tracked")
470524
470396
  ensureTrackedInlinePropertySupport2(inlineKeys);
470525
470397
  }
470526
- const stepId = v42();
470398
+ const stepId = v4_default2();
470527
470399
  const where = buildSelectionWhere2(request);
470528
470400
  const step3 = buildSelectionStepDef2(stepId, request, where);
470529
470401
  const compiled = compilePlan2(storyEditor, [step3]);
@@ -470724,7 +470596,7 @@ function insertStructuredInner2(editor, input2, options) {
470724
470596
  }
470725
470597
  effectiveTarget = { kind: "text", blockId, range: { start: offset2, end: offset2 } };
470726
470598
  } else if (ref4) {
470727
- const dummyStepId = v42();
470599
+ const dummyStepId = v4_default2();
470728
470600
  const dummyStep = {
470729
470601
  id: dummyStepId,
470730
470602
  op: "text.insert",
@@ -471286,7 +471158,7 @@ function executeStructuralReplaceWrapper2(editor, input2, options) {
471286
471158
  }
471287
471159
  var STUB_WHERE2, EMPTY_RESOLUTION2, CONTAINER_NODE_TYPES2, VALID_EDGE_NODE_TYPES4;
471288
471160
  var init_plan_wrappers = __esm(() => {
471289
- init_wrapper();
471161
+ init_esm2();
471290
471162
  init_src();
471291
471163
  init_compiler();
471292
471164
  init_executor();
@@ -473491,7 +473363,7 @@ function addCommentHandler2(editor, input2, options) {
473491
473363
  }
473492
473364
  };
473493
473365
  }
473494
- const commentId = v42();
473366
+ const commentId = v4_default2();
473495
473367
  let trackedPayload = null;
473496
473368
  const receipt2 = executeDomainCommand2(editor, () => {
473497
473369
  const addComment = requireEditorCommand2(editor.commands?.addComment, "comments.create (addComment)");
@@ -473584,7 +473456,7 @@ function replyToCommentHandler2(editor, input2, options) {
473584
473456
  const store = getCommentEntityStore2(editor);
473585
473457
  const parentRecord = findCommentEntity2(store, parentIdentity.commentId);
473586
473458
  const inheritedTrackedFields = buildTrackedChangeEntityFieldsFromRecord2(parentRecord) ?? buildTrackedChangeEntityFields2(resolveCommentTrackedChangeSnapshot2(editor, parentIdentity.commentId));
473587
- const replyId = v42();
473459
+ const replyId = v4_default2();
473588
473460
  let trackedPayload = null;
473589
473461
  const receipt2 = executeDomainCommand2(editor, () => {
473590
473462
  const didReply = addCommentReply({
@@ -473975,7 +473847,7 @@ function createCommentsWrapper2(editor) {
473975
473847
  var init_comments_wrappers = __esm(() => {
473976
473848
  init_src();
473977
473849
  init_dist5();
473978
- init_wrapper();
473850
+ init_esm2();
473979
473851
  init_errors4();
473980
473852
  init_mutation_helpers();
473981
473853
  init_index_cache();
@@ -481510,7 +481382,7 @@ function createParagraphWrapper2(editor, input2, options) {
481510
481382
  }
481511
481383
  };
481512
481384
  }
481513
- const paragraphId = v42();
481385
+ const paragraphId = v4_default2();
481514
481386
  let canonicalId = paragraphId;
481515
481387
  let trackedChangeRefs;
481516
481388
  const receipt2 = executeDomainCommand2(storyEditor, () => {
@@ -481594,7 +481466,7 @@ function createHeadingWrapper2(editor, input2, options) {
481594
481466
  }
481595
481467
  };
481596
481468
  }
481597
- const headingId = v42();
481469
+ const headingId = v4_default2();
481598
481470
  let canonicalId = headingId;
481599
481471
  let trackedChangeRefs;
481600
481472
  const receipt2 = executeDomainCommand2(storyEditor, () => {
@@ -481640,7 +481512,7 @@ function createHeadingWrapper2(editor, input2, options) {
481640
481512
  }
481641
481513
  }
481642
481514
  var init_create_wrappers = __esm(() => {
481643
- init_wrapper();
481515
+ init_esm2();
481644
481516
  init_index_cache();
481645
481517
  init_create_insertion();
481646
481518
  init_tracked_change_refs();
@@ -482876,7 +482748,7 @@ function resolveInsertedListItem2(editor, sdBlockId) {
482876
482748
  throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Inserted list item with sdBlockId "${sdBlockId}" could not be resolved after insertion.`);
482877
482749
  }
482878
482750
  function generateRuntimeParaId2() {
482879
- return v42().replace(/-/g, "").slice(0, 8).toUpperCase();
482751
+ return v4_default2().replace(/-/g, "").slice(0, 8).toUpperCase();
482880
482752
  }
482881
482753
  function withListTarget2(editor, input2) {
482882
482754
  return resolveListItem2(editor, input2.target);
@@ -482962,7 +482834,7 @@ function listsInsertWrapper2(editor, input2, options) {
482962
482834
  }
482963
482835
  };
482964
482836
  }
482965
- const createdId = v42();
482837
+ const createdId = v4_default2();
482966
482838
  const createdParaId = generateRuntimeParaId2();
482967
482839
  let created = null;
482968
482840
  const receipt2 = executeDomainCommand2(editor, () => {
@@ -483657,7 +483529,7 @@ function listsConvertToTextWrapper2(editor, input2, options) {
483657
483529
  }
483658
483530
  var PRESET_KIND_MAP2;
483659
483531
  var init_lists_wrappers = __esm(() => {
483660
- init_wrapper();
483532
+ init_esm2();
483661
483533
  init_errors4();
483662
483534
  init_mutation_helpers();
483663
483535
  init_plan_wrappers();
@@ -485576,7 +485448,7 @@ function createSeparatorParagraph2(schema) {
485576
485448
  if (!paragraphType)
485577
485449
  return null;
485578
485450
  const separatorAttrs = {
485579
- sdBlockId: v42(),
485451
+ sdBlockId: v4_default2(),
485580
485452
  paraId: generateDocxHexId2()
485581
485453
  };
485582
485454
  return paragraphType.createAndFill(separatorAttrs) ?? paragraphType.createAndFill();
@@ -486865,15 +486737,15 @@ function tablesConvertFromTextAdapter2(editor, input2, options) {
486865
486737
  const content5 = text9 ? schema.text(text9) : undefined;
486866
486738
  const para = schema.nodes.paragraph.createAndFill(null, content5);
486867
486739
  tableCells.push(schema.nodes.tableCell.createAndFill({
486868
- sdBlockId: v42()
486740
+ sdBlockId: v4_default2()
486869
486741
  }, para));
486870
486742
  }
486871
486743
  tableRows.push(schema.nodes.tableRow.createAndFill({
486872
- sdBlockId: v42(),
486744
+ sdBlockId: v4_default2(),
486873
486745
  paraId: generateDocxHexId2()
486874
486746
  }, tableCells));
486875
486747
  }
486876
- const tableId = v42();
486748
+ const tableId = v4_default2();
486877
486749
  const tableNode = schema.nodes.table.create({ sdBlockId: tableId }, tableRows);
486878
486750
  const startPos = paragraphs[0].pos;
486879
486751
  const lastP = paragraphs[paragraphs.length - 1];
@@ -487012,7 +486884,7 @@ function tablesInsertCellAdapter2(editor, input2, options) {
487012
486884
  const makeEmptyCell = (preferHeader = false) => {
487013
486885
  const candidateType = preferHeader ? schema.nodes.tableHeader ?? schema.nodes.tableCell : schema.nodes.tableCell;
487014
486886
  return candidateType.createAndFill({
487015
- sdBlockId: v42()
486887
+ sdBlockId: v4_default2()
487016
486888
  }) ?? candidateType.createAndFill();
487017
486889
  };
487018
486890
  const overflowRowCells = [];
@@ -487024,7 +486896,7 @@ function tablesInsertCellAdapter2(editor, input2, options) {
487024
486896
  const templateRowAttrs = tableNode.child(Math.max(0, map10.height - 1)).attrs ?? {};
487025
486897
  const overflowRowAttrs = {
487026
486898
  ...templateRowAttrs,
487027
- sdBlockId: v42(),
486899
+ sdBlockId: v4_default2(),
487028
486900
  paraId: generateDocxHexId2()
487029
486901
  };
487030
486902
  const overflowRow = schema.nodes.tableRow.createAndFill(overflowRowAttrs, overflowRowCells) ?? schema.nodes.tableRow.create(overflowRowAttrs, overflowRowCells);
@@ -488433,7 +488305,7 @@ function createTableAdapter2(editor, input2, options) {
488433
488305
  }
488434
488306
  };
488435
488307
  }
488436
- const tableId = v42();
488308
+ const tableId = v4_default2();
488437
488309
  const didApply = insertTableAt2({
488438
488310
  pos: insertAt,
488439
488311
  rows: input2.rows,
@@ -488740,7 +488612,7 @@ function tablesClearDefaultStyleAdapter2(editor, _input, options) {
488740
488612
  }
488741
488613
  var POINTS_TO_PIXELS2, POINTS_TO_TWIPS2 = 20, PIXELS_TO_TWIPS2, DEFAULT_TABLE_GRID_WIDTH_TWIPS2 = 1500, SETTINGS_PART2 = "word/settings.xml", PRESET_GREY2 = "999999", PRESET_BLACK2 = "000000", STATIC_PRESETS2, IDENTITY_BLOCK_ATTRS2, WORD_DEFAULT_TBL_LOOK2, FLAG_TO_OOXML_KEY2, INVERTED_FLAGS2, XML_KEY_TO_STYLE_OPTION2, CLEARED_BORDER_OOXML2, TABLE_MARGIN_KEY_GROUPS2;
488742
488614
  var init_tables_adapter = __esm(() => {
488743
- init_wrapper();
488615
+ init_esm2();
488744
488616
  init_identity_attrs();
488745
488617
  init_dist10();
488746
488618
  init_index_cache();
@@ -489376,7 +489248,7 @@ function createTableWrapper2(editor, input2, options) {
489376
489248
  }
489377
489249
  let adapterResult;
489378
489250
  const step3 = {
489379
- id: v42(),
489251
+ id: v4_default2(),
489380
489252
  op: "create.table",
489381
489253
  where: STUB_WHERE2,
489382
489254
  args: {},
@@ -489400,7 +489272,7 @@ function createTableWrapper2(editor, input2, options) {
489400
489272
  return adapterResult;
489401
489273
  }
489402
489274
  var init_create_table_wrapper = __esm(() => {
489403
- init_wrapper();
489275
+ init_esm2();
489404
489276
  init_executor();
489405
489277
  init_revision_tracker();
489406
489278
  init_plan_wrappers();
@@ -489780,7 +489652,7 @@ function executeTableCommand2(editor, op, adapterFn, input2, options) {
489780
489652
  }
489781
489653
  let adapterResult;
489782
489654
  const step3 = {
489783
- id: v42(),
489655
+ id: v4_default2(),
489784
489656
  op,
489785
489657
  where: STUB_WHERE2,
489786
489658
  args: {},
@@ -489924,7 +489796,7 @@ function tablesApplyPresetWrapper2(editor, input2, options) {
489924
489796
  return executeTableCommand2(editor, "tables.applyPreset", tablesApplyPresetAdapter2, input2, options);
489925
489797
  }
489926
489798
  var init_tables_wrappers = __esm(() => {
489927
- init_wrapper();
489799
+ init_esm2();
489928
489800
  init_executor();
489929
489801
  init_revision_tracker();
489930
489802
  init_plan_wrappers();
@@ -495425,14 +495297,14 @@ function validateEngine2(engine) {
495425
495297
  throw new DiffServiceError2("INVALID_INPUT", `Unsupported engine "${engine}". This adapter only supports "${ENGINE_ID2}".`);
495426
495298
  }
495427
495299
  }
495428
- function validateSnapshotVersion2(version4) {
495429
- if (version4 !== "sd-diff-snapshot/v1" && version4 !== SNAPSHOT_VERSION_V22) {
495430
- throw new DiffServiceError2("CAPABILITY_UNSUPPORTED", `Unsupported snapshot version "${version4}". Expected "sd-diff-snapshot/v1" or "${SNAPSHOT_VERSION_V22}".`);
495300
+ function validateSnapshotVersion2(version3) {
495301
+ if (version3 !== "sd-diff-snapshot/v1" && version3 !== SNAPSHOT_VERSION_V22) {
495302
+ throw new DiffServiceError2("CAPABILITY_UNSUPPORTED", `Unsupported snapshot version "${version3}". Expected "sd-diff-snapshot/v1" or "${SNAPSHOT_VERSION_V22}".`);
495431
495303
  }
495432
495304
  }
495433
- function validatePayloadVersion2(version4) {
495434
- if (version4 !== PAYLOAD_VERSION_V12 && version4 !== PAYLOAD_VERSION_V22) {
495435
- throw new DiffServiceError2("CAPABILITY_UNSUPPORTED", `Unsupported diff version "${version4}". Expected "${PAYLOAD_VERSION_V12}" or "${PAYLOAD_VERSION_V22}".`);
495305
+ function validatePayloadVersion2(version3) {
495306
+ if (version3 !== PAYLOAD_VERSION_V12 && version3 !== PAYLOAD_VERSION_V22) {
495307
+ throw new DiffServiceError2("CAPABILITY_UNSUPPORTED", `Unsupported diff version "${version3}". Expected "${PAYLOAD_VERSION_V12}" or "${PAYLOAD_VERSION_V22}".`);
495436
495308
  }
495437
495309
  }
495438
495310
  function validateSnapshotFingerprints2(snapshot2) {
@@ -495481,8 +495353,8 @@ function validateCoverageForPayloadVersion2(diffPayload) {
495481
495353
  throw new DiffServiceError2("INVALID_INPUT", `Coverage mismatch for payload version "${diffPayload.version}". ` + `Expected ${JSON.stringify(expectedCoverage)}, got ${JSON.stringify(diffPayload.coverage)}.`);
495482
495354
  }
495483
495355
  }
495484
- function getCoverageForSnapshotVersion2(version4) {
495485
- return version4 === "sd-diff-snapshot/v1" ? V1_COVERAGE2 : V2_COVERAGE2;
495356
+ function getCoverageForSnapshotVersion2(version3) {
495357
+ return version3 === "sd-diff-snapshot/v1" ? V1_COVERAGE2 : V2_COVERAGE2;
495486
495358
  }
495487
495359
  function getPayloadVersionForCoverage2(coverage) {
495488
495360
  return coverage.headerFooters ? PAYLOAD_VERSION_V22 : PAYLOAD_VERSION_V12;
@@ -496475,7 +496347,7 @@ function prepareTableOfContentsInsertion2(editor, input2, options) {
496475
496347
  const { content: content5, sources } = materializeTocContent2(editor.state.doc, withRightAlign2(config46, input2.config?.rightAlignPageNumbers), editor, {
496476
496348
  pageMap: getPageMap2(editor) ?? undefined
496477
496349
  });
496478
- const sdBlockId = v42();
496350
+ const sdBlockId = v4_default2();
496479
496351
  return {
496480
496352
  pos,
496481
496353
  instruction,
@@ -496537,7 +496409,7 @@ function createTableOfContentsWrapper2(editor, input2, options) {
496537
496409
  }
496538
496410
  var NO_ENTRIES_PLACEHOLDER2, TOC_ENTRY_STYLE_RE2;
496539
496411
  var init_toc_wrappers = __esm(() => {
496540
- init_wrapper();
496412
+ init_esm2();
496541
496413
  init_src();
496542
496414
  init_toc_switches();
496543
496415
  init_toc_resolver();
@@ -497077,7 +496949,7 @@ function createImageWrapper2(editor, input2, options) {
497077
496949
  };
497078
496950
  }
497079
496951
  const drawingId = generateUniqueDocPrId2(storyEditor);
497080
- const sdImageId = v42();
496952
+ const sdImageId = v4_default2();
497081
496953
  const insertPos = input2.at ? resolveImageInsertPosition2(storyEditor, input2.at) : null;
497082
496954
  if (options?.dryRun) {
497083
496955
  return {
@@ -497860,7 +497732,7 @@ function imagesRemoveCaptionWrapper2(editor, input2, options) {
497860
497732
  }
497861
497733
  var ALLOWED_WRAP_ATTRS2, WRAP_TYPES_SUPPORTING_SIDE2, WRAP_TYPES_SUPPORTING_DISTANCES2, RELATIVE_HEIGHT_MIN3 = 0, RELATIVE_HEIGHT_MAX3 = 4294967295;
497862
497734
  var init_images_wrappers = __esm(() => {
497863
- init_wrapper();
497735
+ init_esm2();
497864
497736
  init_image_resolver();
497865
497737
  init_errors4();
497866
497738
  init_mutation_helpers();
@@ -499001,7 +498873,9 @@ function insertTextAroundSdt2(editor, target, content5, resolvePos) {
499001
498873
  const { tr } = editor.state;
499002
498874
  const tabType = editor.schema.nodes?.tab;
499003
498875
  const parentAllowsTab = tabType && content5.includes("\t") ? parentAllowsNodeAt2(tr, pos, tabType) : false;
499004
- tr.insert(pos, buildTextWithTabs2(editor.schema, content5, undefined, { parentAllowsTab }));
498876
+ const lineBreakType = editor.schema.nodes?.lineBreak;
498877
+ const parentAllowsLineBreak = lineBreakType && /[\r\n]/.test(content5) ? parentAllowsNodeAt2(tr, pos, lineBreakType) : false;
498878
+ tr.insert(pos, buildTextWithTabs2(editor.schema, content5, undefined, { parentAllowsTab, parentAllowsLineBreak }));
499005
498879
  dispatchTransaction5(editor, tr);
499006
498880
  return true;
499007
498881
  }
@@ -500989,7 +500863,7 @@ function createCustomXmlPart2(convertedXml, { content: content5, schemaRefs }, c
500989
500863
  const partName = partNameFromIndex2(index3);
500990
500864
  const propsPartName = propsPartNameFromIndex2(index3);
500991
500865
  const itemRelsPath = `customXml/_rels/item${index3}.xml.rels`;
500992
- const itemId = `{${v42().toUpperCase()}}`;
500866
+ const itemId = `{${v4_default2().toUpperCase()}}`;
500993
500867
  convertedXml[partName] = createXmlDocument4(root4, declaration);
500994
500868
  convertedXml[propsPartName] = createXmlDocument4(buildItemPropsRoot2(itemId, schemaRefs));
500995
500869
  convertedXml[itemRelsPath] = createXmlDocument4(buildItemRelsRoot2(`itemProps${index3}.xml`));
@@ -501031,11 +500905,11 @@ function patchCustomXmlPart2(convertedXml, target, { content: content5, schemaRe
501031
500905
  return null;
501032
500906
  propsPartName = propsPartNameFromIndex2(idx);
501033
500907
  const itemRelsPath = `customXml/_rels/item${idx}.xml.rels`;
501034
- resolvedId = `{${v42().toUpperCase()}}`;
500908
+ resolvedId = `{${v4_default2().toUpperCase()}}`;
501035
500909
  convertedXml[itemRelsPath] = createXmlDocument4(buildItemRelsRoot2(`itemProps${idx}.xml`));
501036
500910
  }
501037
500911
  if (!resolvedId)
501038
- resolvedId = `{${v42().toUpperCase()}}`;
500912
+ resolvedId = `{${v4_default2().toUpperCase()}}`;
501039
500913
  const existingDecl = convertedXml[propsPartName]?.declaration;
501040
500914
  convertedXml[propsPartName] = createXmlDocument4(buildItemPropsRoot2(resolvedId, schemaRefs), existingDecl);
501041
500915
  } else {
@@ -501096,7 +500970,7 @@ function invalidateConverterCachesForPath2(converter, partName) {
501096
500970
  }
501097
500971
  var xmljs3, CUSTOM_XML_DATA_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE4 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", CUSTOM_XML_DATASTORE_NAMESPACE2 = "http://schemas.openxmlformats.org/officeDocument/2006/customXml";
501098
500972
  var init_custom_xml_parts = __esm(() => {
501099
- init_wrapper();
500973
+ init_esm2();
501100
500974
  init_helpers();
501101
500975
  init_constants4();
501102
500976
  xmljs3 = __toESM(require_lib3(), 1);
@@ -501593,7 +501467,7 @@ function metadataResolveWrapper2(editor, input2) {
501593
501467
  }
501594
501468
  function metadataAttachWrapper2(editor, input2, options) {
501595
501469
  rejectTrackedMode2("metadata.attach", options);
501596
- const id2 = input2.id ?? v42();
501470
+ const id2 = input2.id ?? v4_default2();
501597
501471
  const convertedXml = getConvertedXml5(editor);
501598
501472
  try {
501599
501473
  resolveSelectionTarget2(editor, input2.target);
@@ -501677,7 +501551,7 @@ function createAnchoredMetadataAdapter2(editor) {
501677
501551
  };
501678
501552
  }
501679
501553
  var init_anchored_metadata_wrappers = __esm(() => {
501680
- init_wrapper();
501554
+ init_esm2();
501681
501555
  init_src();
501682
501556
  init_custom_xml_parts();
501683
501557
  init_errors4();
@@ -504984,7 +504858,7 @@ function bibliographyGetWrapper2(editor, input2) {
504984
504858
  }
504985
504859
  function bibliographyInsertWrapper2(editor, input2, options) {
504986
504860
  rejectTrackedMode2("citations.bibliography.insert", options);
504987
- const nodeId = v42();
504861
+ const nodeId = v4_default2();
504988
504862
  const address2 = { kind: "block", nodeType: "bibliography", nodeId };
504989
504863
  if (options?.dryRun)
504990
504864
  return bibSuccess2(address2);
@@ -505141,7 +505015,7 @@ function buildCitationInstruction2(sourceIds) {
505141
505015
  return parts.join(" ");
505142
505016
  }
505143
505017
  var init_citation_wrappers = __esm(() => {
505144
- init_wrapper();
505018
+ init_esm2();
505145
505019
  init_src();
505146
505020
  init_citation_resolver();
505147
505021
  init_adapter_utils();
@@ -512722,14 +512596,14 @@ import { createRequire as createRequire2 } from "node:module";
512722
512596
  async function main() {
512723
512597
  await server.connect(transport);
512724
512598
  }
512725
- var require2, version4, PRESETS_SUPPORTED, requestedPreset, server, sessions, transport;
512599
+ var require2, version3, PRESETS_SUPPORTED, requestedPreset, server, sessions, transport;
512726
512600
  var init_server3 = __esm(() => {
512727
512601
  init_mcp();
512728
512602
  init_stdio2();
512729
512603
  init_session_manager();
512730
512604
  init_tools();
512731
512605
  require2 = createRequire2(import.meta.url);
512732
- ({ version: version4 } = require2("../package.json"));
512606
+ ({ version: version3 } = require2("../package.json"));
512733
512607
  PRESETS_SUPPORTED = new Set(["legacy"]);
512734
512608
  requestedPreset = process.env.MCP_PRESET ?? "legacy";
512735
512609
  if (!PRESETS_SUPPORTED.has(requestedPreset)) {
@@ -512738,7 +512612,7 @@ var init_server3 = __esm(() => {
512738
512612
  }
512739
512613
  server = new McpServer({
512740
512614
  name: "superdoc",
512741
- version: version4
512615
+ version: version3
512742
512616
  }, {
512743
512617
  instructions: MCP_SYSTEM_PROMPT
512744
512618
  });