@harbour-enterprises/superdoc 0.22.1 → 0.23.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/chunks/{PdfViewer-D2BPnEBG.cjs → PdfViewer-BItyloFT.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-CBmOiHsj.es.js → PdfViewer-MPmm-SUD.es.js} +1 -1
  3. package/dist/chunks/{index-B0CI50e4.cjs → index-CdJOxoqt.cjs} +2 -2
  4. package/dist/chunks/{index-BSDcfSFc.es.js → index-OVF3JhUR.es.js} +2 -2
  5. package/dist/chunks/{super-editor.es-DOOwW-Iv.cjs → super-editor.es-C7stybby.cjs} +1608 -1032
  6. package/dist/chunks/{super-editor.es-BW1T3N2-.es.js → super-editor.es-DQnqUJZs.es.js} +1608 -1032
  7. package/dist/style.css +3 -0
  8. package/dist/super-editor/ai-writer.es.js +2 -2
  9. package/dist/super-editor/chunks/{converter-UuZxU-p8.js → converter-BVirrB35.js} +1463 -1028
  10. package/dist/super-editor/chunks/{docx-zipper-Bss48sB0.js → docx-zipper-Cpb9d2an.js} +1 -1
  11. package/dist/super-editor/chunks/{editor--v3HbUU0.js → editor-DIINh50j.js} +151 -10
  12. package/dist/super-editor/chunks/{toolbar-BeXlvdV8.js → toolbar-CmDmkPHL.js} +2 -2
  13. package/dist/super-editor/converter.es.js +1 -1
  14. package/dist/super-editor/docx-zipper.es.js +2 -2
  15. package/dist/super-editor/editor.es.js +3 -3
  16. package/dist/super-editor/file-zipper.es.js +1 -1
  17. package/dist/super-editor/src/core/super-converter/exporter.d.ts +4 -4
  18. package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/hyperlink-preprocessor.d.ts +9 -0
  19. package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/index.d.ts +2 -0
  20. package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/num-pages-preprocessor.d.ts +9 -0
  21. package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/page-preprocessor.d.ts +9 -0
  22. package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/page-ref-preprocessor.d.ts +9 -0
  23. package/dist/super-editor/src/core/super-converter/field-references/fld-preprocessors/toc-preprocessor.d.ts +8 -0
  24. package/dist/super-editor/src/core/super-converter/field-references/index.d.ts +1 -0
  25. package/dist/super-editor/src/core/super-converter/field-references/preProcessNodesForFldChar.d.ts +21 -0
  26. package/dist/super-editor/src/core/super-converter/v2/exporter/helpers/translateChildNodes.d.ts +3 -3
  27. package/dist/super-editor/src/core/super-converter/v2/importer/pageReferenceImporter.d.ts +4 -0
  28. package/dist/super-editor/src/core/super-converter/v2/importer/tableOfContentsImporter.d.ts +4 -0
  29. package/dist/super-editor/src/core/super-converter/v2/types/index.d.ts +7 -1
  30. package/dist/super-editor/src/core/super-converter/v3/handlers/sd/pageReference/index.d.ts +1 -0
  31. package/dist/super-editor/src/core/super-converter/v3/handlers/sd/pageReference/pageReference-translator.d.ts +7 -0
  32. package/dist/super-editor/src/core/super-converter/v3/handlers/sd/tableOfContents/index.d.ts +1 -0
  33. package/dist/super-editor/src/core/super-converter/v3/handlers/sd/tableOfContents/tableOfContents-translator.d.ts +10 -0
  34. package/dist/super-editor/src/core/super-converter/v3/handlers/w/caps/caps-translator.d.ts +7 -0
  35. package/dist/super-editor/src/core/super-converter/v3/handlers/w/p/helpers/w-p-helpers.d.ts +0 -2
  36. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/handle-doc-part-obj.d.ts +9 -1
  37. package/dist/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/translate-document-part-obj.d.ts +6 -0
  38. package/dist/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +2 -2
  39. package/dist/super-editor/src/extensions/page-reference/index.d.ts +1 -0
  40. package/dist/super-editor/src/extensions/page-reference/page-reference.d.ts +2 -0
  41. package/dist/super-editor/src/extensions/structured-content/document-part-object.d.ts +2 -0
  42. package/dist/super-editor/src/extensions/structured-content/index.d.ts +1 -0
  43. package/dist/super-editor/src/extensions/tab/helpers/tabDecorations.d.ts +2 -2
  44. package/dist/super-editor/src/extensions/table-of-contents/index.d.ts +1 -0
  45. package/dist/super-editor/src/extensions/table-of-contents/table-of-contents.d.ts +2 -0
  46. package/dist/super-editor/style.css +3 -0
  47. package/dist/super-editor/super-editor.es.js +10 -8
  48. package/dist/super-editor/toolbar.es.js +2 -2
  49. package/dist/super-editor.cjs +1 -1
  50. package/dist/super-editor.es.js +1 -1
  51. package/dist/superdoc.cjs +2 -2
  52. package/dist/superdoc.es.js +2 -2
  53. package/dist/superdoc.umd.js +1608 -1032
  54. package/dist/superdoc.umd.js.map +1 -1
  55. package/package.json +1 -1
@@ -22985,13 +22985,56 @@ function translateChildNodes(params2) {
22985
22985
  const { content: nodes } = params2.node;
22986
22986
  if (!nodes) return [];
22987
22987
  const translatedNodes = [];
22988
- nodes.forEach((node) => {
22988
+ const hyperlinkGroup = [];
22989
+ let index2 = 0;
22990
+ while (index2 < nodes.length) {
22991
+ const node = nodes[index2];
22992
+ const linkMark = _isLinkNode(node);
22993
+ if (linkMark) {
22994
+ hyperlinkGroup.push(node);
22995
+ const nextNode = index2 + 1 < nodes.length ? nodes[index2 + 1] : null;
22996
+ const nextIsLink = _isLinkNode(nextNode, linkMark);
22997
+ if (nextIsLink) {
22998
+ index2++;
22999
+ continue;
23000
+ } else {
23001
+ let translatedLinkGroup = exportSchemaToJson({
23002
+ ...params2,
23003
+ node: hyperlinkGroup[0],
23004
+ extraParams: { ...params2.extraParams || {}, hyperlinkGroup: hyperlinkGroup.slice() }
23005
+ });
23006
+ if (translatedLinkGroup instanceof Array) translatedNodes.push(...translatedLinkGroup);
23007
+ else translatedNodes.push(translatedLinkGroup);
23008
+ hyperlinkGroup.length = 0;
23009
+ index2++;
23010
+ continue;
23011
+ }
23012
+ }
22989
23013
  let translatedNode = exportSchemaToJson({ ...params2, node });
22990
23014
  if (translatedNode instanceof Array) translatedNodes.push(...translatedNode);
22991
23015
  else translatedNodes.push(translatedNode);
22992
- });
23016
+ index2++;
23017
+ }
22993
23018
  return translatedNodes.filter((n) => n);
22994
23019
  }
23020
+ function _isLinkNode(node, referenceMark = null) {
23021
+ if (!node || !node.marks && !node.attrs?.marksAsAttrs) return null;
23022
+ const marks = node.marks || node.attrs.marksAsAttrs;
23023
+ const linkMark = marks.find((mark) => mark.type === "link");
23024
+ if (!linkMark) return null;
23025
+ if (referenceMark) {
23026
+ return _isSameLinkMark(linkMark.attrs, referenceMark.attrs) ? linkMark : null;
23027
+ }
23028
+ return linkMark;
23029
+ }
23030
+ function _isSameLinkMark(attrsA, attrsB) {
23031
+ for (let key2 of ["anchor", "docLocation", "history", "href", "rId", "target"]) {
23032
+ if (attrsA[key2] != attrsB[key2]) {
23033
+ return false;
23034
+ }
23035
+ }
23036
+ return true;
23037
+ }
22995
23038
  const baseNumbering = {
22996
23039
  declaration: {
22997
23040
  attributes: {
@@ -24338,37 +24381,37 @@ const _NodeTranslator = class _NodeTranslator2 {
24338
24381
  };
24339
24382
  __publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
24340
24383
  let NodeTranslator = _NodeTranslator;
24341
- const encode$18 = (attributes) => {
24384
+ const encode$1b = (attributes) => {
24342
24385
  return attributes["w:type"];
24343
24386
  };
24344
- const decode$$ = (attrs) => {
24387
+ const decode$11 = (attrs) => {
24345
24388
  const { lineBreakType } = attrs;
24346
24389
  return lineBreakType;
24347
24390
  };
24348
24391
  const attrConfig$F = Object.freeze({
24349
24392
  xmlName: "w:type",
24350
24393
  sdName: "lineBreakType",
24351
- encode: encode$18,
24352
- decode: decode$$
24394
+ encode: encode$1b,
24395
+ decode: decode$11
24353
24396
  });
24354
- const encode$17 = (attributes) => {
24397
+ const encode$1a = (attributes) => {
24355
24398
  const xmlAttrValue = attributes["w:clear"];
24356
24399
  return xmlAttrValue;
24357
24400
  };
24358
- const decode$_ = (attrs) => {
24401
+ const decode$10 = (attrs) => {
24359
24402
  const { clear } = attrs;
24360
24403
  return clear;
24361
24404
  };
24362
24405
  const attrConfig$E = Object.freeze({
24363
24406
  xmlName: "w:clear",
24364
24407
  sdName: "clear",
24365
- encode: encode$17,
24366
- decode: decode$_
24408
+ encode: encode$1a,
24409
+ decode: decode$10
24367
24410
  });
24368
24411
  const validXmlAttributes$m = [attrConfig$F, attrConfig$E];
24369
- const XML_NODE_NAME$u = "w:br";
24370
- const SD_NODE_NAME$d = "lineBreak";
24371
- const encode$16 = (_2, encodedAttrs) => {
24412
+ const XML_NODE_NAME$x = "w:br";
24413
+ const SD_NODE_NAME$f = "lineBreak";
24414
+ const encode$19 = (_2, encodedAttrs) => {
24372
24415
  const isPageBreak = encodedAttrs?.lineBreakType === "page";
24373
24416
  const translated = {
24374
24417
  type: isPageBreak ? "hardBreak" : "lineBreak"
@@ -24378,7 +24421,7 @@ const encode$16 = (_2, encodedAttrs) => {
24378
24421
  }
24379
24422
  return translated;
24380
24423
  };
24381
- const decode$Z = (params2, decodedAttrs) => {
24424
+ const decode$$ = (params2, decodedAttrs) => {
24382
24425
  const { node } = params2;
24383
24426
  if (!node) return;
24384
24427
  const wBreak = { name: "w:br" };
@@ -24395,39 +24438,39 @@ const decode$Z = (params2, decodedAttrs) => {
24395
24438
  };
24396
24439
  return translated;
24397
24440
  };
24398
- const config$s = {
24399
- xmlName: XML_NODE_NAME$u,
24400
- sdNodeOrKeyName: SD_NODE_NAME$d,
24441
+ const config$v = {
24442
+ xmlName: XML_NODE_NAME$x,
24443
+ sdNodeOrKeyName: SD_NODE_NAME$f,
24401
24444
  type: NodeTranslator.translatorTypes.NODE,
24402
- encode: encode$16,
24403
- decode: decode$Z,
24445
+ encode: encode$19,
24446
+ decode: decode$$,
24404
24447
  attributes: validXmlAttributes$m
24405
24448
  };
24406
- const translator$16 = NodeTranslator.from(config$s);
24407
- const encode$15 = (attributes) => attributes?.["w:val"];
24408
- const decode$Y = (attrs) => attrs?.highlight;
24449
+ const translator$19 = NodeTranslator.from(config$v);
24450
+ const encode$18 = (attributes) => attributes?.["w:val"];
24451
+ const decode$_ = (attrs) => attrs?.highlight;
24409
24452
  const attrConfig$D = Object.freeze({
24410
24453
  xmlName: "w:val",
24411
24454
  sdName: "highlight",
24412
- encode: encode$15,
24413
- decode: decode$Y
24455
+ encode: encode$18,
24456
+ decode: decode$_
24414
24457
  });
24415
24458
  const validXmlAttributes$l = [attrConfig$D];
24416
- const XML_NODE_NAME$t = "w:highlight";
24417
- const SD_ATTR_KEY$f = "highlight";
24459
+ const XML_NODE_NAME$w = "w:highlight";
24460
+ const SD_ATTR_KEY$g = "highlight";
24418
24461
  const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
24419
- const encode$14 = (params2, encodedAttrs = {}) => {
24462
+ const encode$17 = (params2, encodedAttrs = {}) => {
24420
24463
  const { nodes } = params2;
24421
24464
  const node = nodes?.[0];
24422
24465
  const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
24423
24466
  return {
24424
24467
  type: "attr",
24425
- xmlName: XML_NODE_NAME$t,
24426
- sdNodeOrKeyName: SD_ATTR_KEY$f,
24468
+ xmlName: XML_NODE_NAME$w,
24469
+ sdNodeOrKeyName: SD_ATTR_KEY$g,
24427
24470
  attributes: { "w:val": value ?? null }
24428
24471
  };
24429
24472
  };
24430
- const decode$X = (params2) => {
24473
+ const decode$Z = (params2) => {
24431
24474
  const attrs = params2?.node?.attrs || {};
24432
24475
  const highlightValue = attrs.highlight ?? attrs.color ?? null;
24433
24476
  if (!highlightValue) return void 0;
@@ -24435,14 +24478,14 @@ const decode$X = (params2) => {
24435
24478
  if (!normalizedValue) return void 0;
24436
24479
  if (DISABLED_TOKENS.has(normalizedValue)) {
24437
24480
  return {
24438
- name: XML_NODE_NAME$t,
24481
+ name: XML_NODE_NAME$w,
24439
24482
  attributes: { "w:val": "none" }
24440
24483
  };
24441
24484
  }
24442
24485
  const keyword = getDocxHighlightKeywordFromHex(highlightValue);
24443
24486
  if (keyword) {
24444
24487
  return {
24445
- name: XML_NODE_NAME$t,
24488
+ name: XML_NODE_NAME$w,
24446
24489
  attributes: { "w:val": keyword }
24447
24490
  };
24448
24491
  }
@@ -24457,63 +24500,63 @@ const decode$X = (params2) => {
24457
24500
  }
24458
24501
  };
24459
24502
  };
24460
- const config$r = {
24461
- xmlName: XML_NODE_NAME$t,
24462
- sdNodeOrKeyName: SD_ATTR_KEY$f,
24503
+ const config$u = {
24504
+ xmlName: XML_NODE_NAME$w,
24505
+ sdNodeOrKeyName: SD_ATTR_KEY$g,
24463
24506
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
24464
- encode: encode$14,
24465
- decode: decode$X,
24507
+ encode: encode$17,
24508
+ decode: decode$Z,
24466
24509
  attributes: validXmlAttributes$l
24467
24510
  };
24468
- const translator$15 = NodeTranslator.from(config$r);
24469
- const encode$13 = (attributes) => {
24511
+ const translator$18 = NodeTranslator.from(config$u);
24512
+ const encode$16 = (attributes) => {
24470
24513
  return attributes["w:val"];
24471
24514
  };
24472
- const decode$W = (attrs) => {
24515
+ const decode$Y = (attrs) => {
24473
24516
  const { tabSize } = attrs || {};
24474
24517
  return tabSize;
24475
24518
  };
24476
24519
  const attrConfig$C = Object.freeze({
24477
24520
  xmlName: "w:val",
24478
24521
  sdName: "tabSize",
24479
- encode: encode$13,
24480
- decode: decode$W
24522
+ encode: encode$16,
24523
+ decode: decode$Y
24481
24524
  });
24482
- const encode$12 = (attributes) => {
24525
+ const encode$15 = (attributes) => {
24483
24526
  return attributes["w:leader"];
24484
24527
  };
24485
- const decode$V = (attrs) => {
24528
+ const decode$X = (attrs) => {
24486
24529
  const { leader } = attrs || {};
24487
24530
  return leader;
24488
24531
  };
24489
24532
  const attrConfig$B = Object.freeze({
24490
24533
  xmlName: "w:leader",
24491
24534
  sdName: "leader",
24492
- encode: encode$12,
24493
- decode: decode$V
24535
+ encode: encode$15,
24536
+ decode: decode$X
24494
24537
  });
24495
- const encode$11 = (attributes) => {
24538
+ const encode$14 = (attributes) => {
24496
24539
  return attributes["w:pos"];
24497
24540
  };
24498
- const decode$U = (attrs) => {
24541
+ const decode$W = (attrs) => {
24499
24542
  const { pos } = attrs || {};
24500
24543
  return pos;
24501
24544
  };
24502
24545
  const attrConfig$A = Object.freeze({
24503
24546
  xmlName: "w:pos",
24504
24547
  sdName: "pos",
24505
- encode: encode$11,
24506
- decode: decode$U
24548
+ encode: encode$14,
24549
+ decode: decode$W
24507
24550
  });
24508
24551
  const validXmlAttributes$k = [attrConfig$C, attrConfig$A, attrConfig$B];
24509
- const XML_NODE_NAME$s = "w:tab";
24510
- const SD_NODE_NAME$c = "tab";
24511
- const encode$10 = (_2, encodedAttrs = {}) => {
24552
+ const XML_NODE_NAME$v = "w:tab";
24553
+ const SD_NODE_NAME$e = "tab";
24554
+ const encode$13 = (_2, encodedAttrs = {}) => {
24512
24555
  const translated = { type: "tab" };
24513
24556
  if (encodedAttrs) translated.attrs = { ...encodedAttrs };
24514
24557
  return translated;
24515
24558
  };
24516
- const decode$T = (params2, decodedAttrs = {}) => {
24559
+ const decode$V = (params2, decodedAttrs = {}) => {
24517
24560
  const { node } = params2 || {};
24518
24561
  if (!node) return;
24519
24562
  const wTab = { name: "w:tab" };
@@ -24529,15 +24572,15 @@ const decode$T = (params2, decodedAttrs = {}) => {
24529
24572
  }
24530
24573
  return translated;
24531
24574
  };
24532
- const config$q = {
24533
- xmlName: XML_NODE_NAME$s,
24534
- sdNodeOrKeyName: SD_NODE_NAME$c,
24575
+ const config$t = {
24576
+ xmlName: XML_NODE_NAME$v,
24577
+ sdNodeOrKeyName: SD_NODE_NAME$e,
24535
24578
  type: NodeTranslator.translatorTypes.NODE,
24536
- encode: encode$10,
24537
- decode: decode$T,
24579
+ encode: encode$13,
24580
+ decode: decode$V,
24538
24581
  attributes: validXmlAttributes$k
24539
24582
  };
24540
- const translator$14 = NodeTranslator.from(config$q);
24583
+ const translator$17 = NodeTranslator.from(config$t);
24541
24584
  const mergeTextNodes = (nodes) => {
24542
24585
  if (!nodes || !Array.isArray(nodes)) {
24543
24586
  return nodes;
@@ -24911,104 +24954,10 @@ const getDefaultParagraphStyle = (docx, styleId = "") => {
24911
24954
  justify: pPrByIdJcAttr
24912
24955
  };
24913
24956
  };
24914
- const preProcessNodesForFldChar = (nodes = []) => {
24915
- const processedNodes = [];
24916
- let buffer2 = [];
24917
- let collecting = false;
24918
- for (const node of nodes) {
24919
- const fldCharEl = node.elements?.find((el) => el.name === "w:fldChar");
24920
- const fldType = fldCharEl?.attributes?.["w:fldCharType"];
24921
- if (fldType === "begin") {
24922
- buffer2 = [node];
24923
- collecting = true;
24924
- continue;
24925
- }
24926
- if (fldType === "separate" && collecting) {
24927
- buffer2.push(node);
24928
- continue;
24929
- }
24930
- if (fldType === "end" && collecting) {
24931
- buffer2.push(node);
24932
- processedNodes.push(...processCombinedNodesForFldChar(buffer2));
24933
- buffer2 = [];
24934
- collecting = false;
24935
- continue;
24936
- }
24937
- if (collecting) {
24938
- buffer2.push(node);
24939
- } else {
24940
- processedNodes.push(node);
24941
- }
24942
- }
24943
- if (buffer2.length) {
24944
- processedNodes.push(...buffer2);
24945
- }
24946
- return processedNodes;
24947
- };
24948
- const processCombinedNodesForFldChar = (nodesToCombine = []) => {
24949
- let processedNodes = [];
24950
- let hasPageMarker = false;
24951
- let isNumPages = false;
24952
- const textStart = nodesToCombine.findIndex(
24953
- (n) => n.elements?.some((el) => el.name === "w:fldChar" && el.attributes["w:fldCharType"] === "separate")
24954
- );
24955
- const textEnd = nodesToCombine.findIndex(
24956
- (n) => n.elements?.some((el) => el.name === "w:fldChar" && el.attributes["w:fldCharType"] === "end")
24957
- );
24958
- const textNodes = nodesToCombine.slice(textStart + 1, textEnd);
24959
- const instrTextContainer = nodesToCombine.find((n) => n.elements?.some((el) => el.name === "w:instrText"));
24960
- const instrTextNode = instrTextContainer?.elements?.find((el) => el.name === "w:instrText");
24961
- const instrText = instrTextNode?.elements[0].text;
24962
- if (!hasPageMarker) hasPageMarker = instrText?.trim().startsWith("PAGE");
24963
- if (!isNumPages) isNumPages = instrText?.trim().startsWith("NUMPAGES");
24964
- const urlMatch = instrText?.match(/HYPERLINK\s+"([^"]+)"/);
24965
- if (hasPageMarker) {
24966
- const pageNumNode = {
24967
- name: "sd:autoPageNumber",
24968
- type: "element"
24969
- };
24970
- nodesToCombine.forEach((n) => {
24971
- const rPrNode = n.elements.find((el) => el.name === "w:rPr");
24972
- if (rPrNode) pageNumNode.elements = [rPrNode];
24973
- });
24974
- processedNodes.push(pageNumNode);
24975
- } else if (isNumPages) {
24976
- const totalPageNumNode = {
24977
- name: "sd:totalPageNumber",
24978
- type: "element"
24979
- };
24980
- nodesToCombine.forEach((n) => {
24981
- const rPrNode = n.elements.find((el) => el.name === "w:rPr");
24982
- if (rPrNode) totalPageNumNode.elements = [rPrNode];
24983
- });
24984
- processedNodes.push(totalPageNumNode);
24985
- } else if (urlMatch && urlMatch?.length >= 2) {
24986
- const url = urlMatch[1];
24987
- const textMarks = [];
24988
- textNodes.forEach((n) => {
24989
- const rPr2 = n.elements.find((el) => el.name === "w:rPr");
24990
- if (!rPr2) return;
24991
- const { elements } = rPr2;
24992
- elements.forEach((el) => {
24993
- textMarks.push(el);
24994
- });
24995
- });
24996
- const linkMark = { name: "link", attributes: { href: url } };
24997
- const rPr = { name: "w:rPr", type: "element", elements: [linkMark, ...textMarks] };
24998
- processedNodes.push({
24999
- name: "w:r",
25000
- type: "element",
25001
- elements: [rPr, ...textNodes]
25002
- });
25003
- }
25004
- return processedNodes;
25005
- };
25006
24957
  const handleParagraphNode$1 = (params2) => {
25007
24958
  const { nodes, docx, nodeListHandler, filename } = params2;
25008
24959
  const node = carbonCopy(nodes[0]);
25009
24960
  let schemaNode;
25010
- let processedElements = preProcessNodesForFldChar(node.elements);
25011
- node.elements = processedElements;
25012
24961
  const handleStandardNode2 = nodeListHandler.handlerEntities.find(
25013
24962
  (e) => e.handlerName === "standardNodeHandler"
25014
24963
  )?.handler;
@@ -25149,89 +25098,89 @@ const handleParagraphNode$1 = (params2) => {
25149
25098
  }
25150
25099
  return schemaNode;
25151
25100
  };
25152
- const encode$$ = (attributes) => {
25101
+ const encode$12 = (attributes) => {
25153
25102
  return attributes["w:rsidDel"];
25154
25103
  };
25155
- const decode$S = (attrs) => {
25104
+ const decode$U = (attrs) => {
25156
25105
  return attrs.rsidDel;
25157
25106
  };
25158
25107
  const attrConfig$z = Object.freeze({
25159
25108
  xmlName: "w:rsidDel",
25160
25109
  sdName: "rsidDel",
25161
- encode: encode$$,
25162
- decode: decode$S
25110
+ encode: encode$12,
25111
+ decode: decode$U
25163
25112
  });
25164
- const encode$_ = (attributes) => {
25113
+ const encode$11 = (attributes) => {
25165
25114
  return attributes["w:rsidP"];
25166
25115
  };
25167
- const decode$R = (attrs) => {
25116
+ const decode$T = (attrs) => {
25168
25117
  return attrs.rsidP;
25169
25118
  };
25170
25119
  const attrConfig$y = Object.freeze({
25171
25120
  xmlName: "w:rsidP",
25172
25121
  sdName: "rsidP",
25173
- encode: encode$_,
25174
- decode: decode$R
25122
+ encode: encode$11,
25123
+ decode: decode$T
25175
25124
  });
25176
- const encode$Z = (attributes) => {
25125
+ const encode$10 = (attributes) => {
25177
25126
  return attributes["w:rsidR"];
25178
25127
  };
25179
- const decode$Q = (attrs) => {
25128
+ const decode$S = (attrs) => {
25180
25129
  return attrs.rsidR;
25181
25130
  };
25182
25131
  const attrConfig$x = Object.freeze({
25183
25132
  xmlName: "w:rsidR",
25184
25133
  sdName: "rsidR",
25185
- encode: encode$Z,
25186
- decode: decode$Q
25134
+ encode: encode$10,
25135
+ decode: decode$S
25187
25136
  });
25188
- const encode$Y = (attributes) => {
25137
+ const encode$$ = (attributes) => {
25189
25138
  return attributes["w:rsidRPr"];
25190
25139
  };
25191
- const decode$P = (attrs) => {
25140
+ const decode$R = (attrs) => {
25192
25141
  return attrs.rsidRPr;
25193
25142
  };
25194
25143
  const attrConfig$w = Object.freeze({
25195
25144
  xmlName: "w:rsidRPr",
25196
25145
  sdName: "rsidRPr",
25197
- encode: encode$Y,
25198
- decode: decode$P
25146
+ encode: encode$$,
25147
+ decode: decode$R
25199
25148
  });
25200
- const encode$X = (attributes) => {
25149
+ const encode$_ = (attributes) => {
25201
25150
  return attributes["w:rsidRDefault"];
25202
25151
  };
25203
- const decode$O = (attrs) => {
25152
+ const decode$Q = (attrs) => {
25204
25153
  return attrs.rsidRDefault;
25205
25154
  };
25206
25155
  const attrConfig$v = Object.freeze({
25207
25156
  xmlName: "w:rsidRDefault",
25208
25157
  sdName: "rsidRDefault",
25209
- encode: encode$X,
25210
- decode: decode$O
25158
+ encode: encode$_,
25159
+ decode: decode$Q
25211
25160
  });
25212
- const encode$W = (attributes) => {
25161
+ const encode$Z = (attributes) => {
25213
25162
  return attributes["w14:paraId"];
25214
25163
  };
25215
- const decode$N = (attrs) => {
25164
+ const decode$P = (attrs) => {
25216
25165
  return attrs.paraId;
25217
25166
  };
25218
25167
  const attrConfig$u = Object.freeze({
25219
25168
  xmlName: "w14:paraId",
25220
25169
  sdName: "paraId",
25221
- encode: encode$W,
25222
- decode: decode$N
25170
+ encode: encode$Z,
25171
+ decode: decode$P
25223
25172
  });
25224
- const encode$V = (attributes) => {
25173
+ const encode$Y = (attributes) => {
25225
25174
  return attributes["w14:textId"];
25226
25175
  };
25227
- const decode$M = (attrs) => {
25176
+ const decode$O = (attrs) => {
25228
25177
  return attrs.textId;
25229
25178
  };
25230
25179
  const attrConfig$t = Object.freeze({
25231
25180
  xmlName: "w14:textId",
25232
25181
  sdName: "textId",
25233
- encode: encode$V,
25234
- decode: decode$M
25182
+ encode: encode$Y,
25183
+ decode: decode$O
25235
25184
  });
25236
25185
  const validXmlAttributes$j = [
25237
25186
  attrConfig$u,
@@ -25242,9 +25191,9 @@ const validXmlAttributes$j = [
25242
25191
  attrConfig$w,
25243
25192
  attrConfig$z
25244
25193
  ];
25245
- const XML_NODE_NAME$r = "w:p";
25246
- const SD_NODE_NAME$b = "paragraph";
25247
- const encode$U = (params2, encodedAttrs = {}) => {
25194
+ const XML_NODE_NAME$u = "w:p";
25195
+ const SD_NODE_NAME$d = "paragraph";
25196
+ const encode$X = (params2, encodedAttrs = {}) => {
25248
25197
  const node = handleParagraphNode$1(params2);
25249
25198
  if (!node) return void 0;
25250
25199
  if (encodedAttrs && Object.keys(encodedAttrs).length) {
@@ -25252,7 +25201,7 @@ const encode$U = (params2, encodedAttrs = {}) => {
25252
25201
  }
25253
25202
  return node;
25254
25203
  };
25255
- const decode$L = (params2, decodedAttrs = {}) => {
25204
+ const decode$N = (params2, decodedAttrs = {}) => {
25256
25205
  const translated = translateParagraphNode(params2);
25257
25206
  if (!translated) return void 0;
25258
25207
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
@@ -25260,16 +25209,16 @@ const decode$L = (params2, decodedAttrs = {}) => {
25260
25209
  }
25261
25210
  return translated;
25262
25211
  };
25263
- const config$p = {
25264
- xmlName: XML_NODE_NAME$r,
25265
- sdNodeOrKeyName: SD_NODE_NAME$b,
25212
+ const config$s = {
25213
+ xmlName: XML_NODE_NAME$u,
25214
+ sdNodeOrKeyName: SD_NODE_NAME$d,
25266
25215
  type: NodeTranslator.translatorTypes.NODE,
25267
- encode: encode$U,
25268
- decode: decode$L,
25216
+ encode: encode$X,
25217
+ decode: decode$N,
25269
25218
  attributes: validXmlAttributes$j
25270
25219
  };
25271
- const translator$13 = NodeTranslator.from(config$p);
25272
- const encode$T = (attributes) => {
25220
+ const translator$16 = NodeTranslator.from(config$s);
25221
+ const encode$W = (attributes) => {
25273
25222
  const raw = attributes?.["w:val"];
25274
25223
  if (raw === void 0 || raw === null) return void 0;
25275
25224
  if (typeof raw === "boolean") return raw;
@@ -25279,24 +25228,24 @@ const encode$T = (attributes) => {
25279
25228
  if (val === "1" || val === "true" || val === "on") return true;
25280
25229
  return void 0;
25281
25230
  };
25282
- const decode$K = (runProps) => {
25231
+ const decode$M = (runProps) => {
25283
25232
  if (runProps?.bold === false) return "0";
25284
25233
  return void 0;
25285
25234
  };
25286
25235
  const attrConfig$s = Object.freeze({
25287
25236
  xmlName: "w:val",
25288
25237
  sdName: "bold",
25289
- encode: encode$T,
25290
- decode: decode$K
25238
+ encode: encode$W,
25239
+ decode: decode$M
25291
25240
  });
25292
25241
  const validXmlAttributes$i = [attrConfig$s];
25293
- const XML_NODE_NAME$q = "w:b";
25294
- const SD_ATTR_KEY$e = "bold";
25295
- const encode$S = (params2, encodedAttrs = {}) => {
25242
+ const XML_NODE_NAME$t = "w:b";
25243
+ const SD_ATTR_KEY$f = "bold";
25244
+ const encode$V = (params2, encodedAttrs = {}) => {
25296
25245
  const { nodes } = params2;
25297
25246
  const node = nodes[0];
25298
25247
  if (!node) return void 0;
25299
- const val = encodedAttrs?.[SD_ATTR_KEY$e];
25248
+ const val = encodedAttrs?.[SD_ATTR_KEY$f];
25300
25249
  let attributes;
25301
25250
  if (val === false) attributes = { "w:val": "0" };
25302
25251
  else if (val === true)
@@ -25304,85 +25253,85 @@ const encode$S = (params2, encodedAttrs = {}) => {
25304
25253
  else attributes = node.attributes || {};
25305
25254
  return {
25306
25255
  type: "attr",
25307
- xmlName: XML_NODE_NAME$q,
25308
- sdNodeOrKeyName: SD_ATTR_KEY$e,
25256
+ xmlName: XML_NODE_NAME$t,
25257
+ sdNodeOrKeyName: SD_ATTR_KEY$f,
25309
25258
  attributes
25310
25259
  };
25311
25260
  };
25312
- const config$o = {
25313
- xmlName: XML_NODE_NAME$q,
25314
- sdNodeOrKeyName: SD_ATTR_KEY$e,
25261
+ const config$r = {
25262
+ xmlName: XML_NODE_NAME$t,
25263
+ sdNodeOrKeyName: SD_ATTR_KEY$f,
25315
25264
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25316
- encode: encode$S,
25265
+ encode: encode$V,
25317
25266
  attributes: validXmlAttributes$i
25318
25267
  };
25319
- const translator$12 = NodeTranslator.from(config$o);
25320
- const XML_NODE_NAME$p = "w:i";
25321
- const SD_ATTR_KEY$d = "italic";
25322
- const encode$R = (params2) => {
25268
+ const translator$15 = NodeTranslator.from(config$r);
25269
+ const XML_NODE_NAME$s = "w:i";
25270
+ const SD_ATTR_KEY$e = "italic";
25271
+ const encode$U = (params2) => {
25323
25272
  const { nodes } = params2;
25324
25273
  const node = nodes?.[0];
25325
25274
  if (!node) return void 0;
25326
25275
  return {
25327
25276
  type: "attr",
25328
- xmlName: XML_NODE_NAME$p,
25329
- sdNodeOrKeyName: SD_ATTR_KEY$d,
25277
+ xmlName: XML_NODE_NAME$s,
25278
+ sdNodeOrKeyName: SD_ATTR_KEY$e,
25330
25279
  attributes: {
25331
25280
  "w:val": node.attributes?.["w:val"] ?? null
25332
25281
  }
25333
25282
  };
25334
25283
  };
25335
- const config$n = {
25336
- xmlName: XML_NODE_NAME$p,
25337
- sdNodeOrKeyName: SD_ATTR_KEY$d,
25284
+ const config$q = {
25285
+ xmlName: XML_NODE_NAME$s,
25286
+ sdNodeOrKeyName: SD_ATTR_KEY$e,
25338
25287
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25339
- encode: encode$R
25288
+ encode: encode$U
25340
25289
  };
25341
- const translator$11 = NodeTranslator.from(config$n);
25342
- const encode$Q = (attributes) => attributes?.["w:val"];
25343
- const decode$J = (attrs) => attrs?.underline;
25290
+ const translator$14 = NodeTranslator.from(config$q);
25291
+ const encode$T = (attributes) => attributes?.["w:val"];
25292
+ const decode$L = (attrs) => attrs?.underline;
25344
25293
  const attrConfig$r = Object.freeze({
25345
25294
  xmlName: "w:val",
25346
25295
  sdName: "underline",
25347
- encode: encode$Q,
25348
- decode: decode$J
25296
+ encode: encode$T,
25297
+ decode: decode$L
25349
25298
  });
25350
- const encode$P = (attributes) => attributes?.["w:color"];
25351
- const decode$I = (attrs) => attrs?.color;
25299
+ const encode$S = (attributes) => attributes?.["w:color"];
25300
+ const decode$K = (attrs) => attrs?.color;
25352
25301
  const attrConfig$q = Object.freeze({
25353
25302
  xmlName: "w:color",
25354
25303
  sdName: "color",
25355
- encode: encode$P,
25356
- decode: decode$I
25304
+ encode: encode$S,
25305
+ decode: decode$K
25357
25306
  });
25358
- const encode$O = (attributes) => attributes?.["w:themeColor"];
25359
- const decode$H = (attrs) => attrs?.themeColor;
25307
+ const encode$R = (attributes) => attributes?.["w:themeColor"];
25308
+ const decode$J = (attrs) => attrs?.themeColor;
25360
25309
  const attrConfig$p = Object.freeze({
25361
25310
  xmlName: "w:themeColor",
25362
25311
  sdName: "themeColor",
25363
- encode: encode$O,
25364
- decode: decode$H
25312
+ encode: encode$R,
25313
+ decode: decode$J
25365
25314
  });
25366
- const encode$N = (attributes) => attributes?.["w:themeTint"];
25367
- const decode$G = (attrs) => attrs?.themeTint;
25315
+ const encode$Q = (attributes) => attributes?.["w:themeTint"];
25316
+ const decode$I = (attrs) => attrs?.themeTint;
25368
25317
  const attrConfig$o = Object.freeze({
25369
25318
  xmlName: "w:themeTint",
25370
25319
  sdName: "themeTint",
25371
- encode: encode$N,
25372
- decode: decode$G
25320
+ encode: encode$Q,
25321
+ decode: decode$I
25373
25322
  });
25374
- const encode$M = (attributes) => attributes?.["w:themeShade"];
25375
- const decode$F = (attrs) => attrs?.themeShade;
25323
+ const encode$P = (attributes) => attributes?.["w:themeShade"];
25324
+ const decode$H = (attrs) => attrs?.themeShade;
25376
25325
  const attrConfig$n = Object.freeze({
25377
25326
  xmlName: "w:themeShade",
25378
25327
  sdName: "themeShade",
25379
- encode: encode$M,
25380
- decode: decode$F
25328
+ encode: encode$P,
25329
+ decode: decode$H
25381
25330
  });
25382
25331
  const validXmlAttributes$h = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
25383
- const XML_NODE_NAME$o = "w:u";
25384
- const SD_ATTR_KEY$c = "underline";
25385
- const encode$L = (params2, encodedAttrs = {}) => {
25332
+ const XML_NODE_NAME$r = "w:u";
25333
+ const SD_ATTR_KEY$d = "underline";
25334
+ const encode$O = (params2, encodedAttrs = {}) => {
25386
25335
  const { nodes } = params2;
25387
25336
  const node = nodes?.[0];
25388
25337
  const sourceAttrs = node?.attributes || {};
@@ -25398,12 +25347,12 @@ const encode$L = (params2, encodedAttrs = {}) => {
25398
25347
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
25399
25348
  return {
25400
25349
  type: "attr",
25401
- xmlName: XML_NODE_NAME$o,
25402
- sdNodeOrKeyName: SD_ATTR_KEY$c,
25350
+ xmlName: XML_NODE_NAME$r,
25351
+ sdNodeOrKeyName: SD_ATTR_KEY$d,
25403
25352
  attributes
25404
25353
  };
25405
25354
  };
25406
- const decode$E = (params2) => {
25355
+ const decode$G = (params2) => {
25407
25356
  const attrs = params2?.node?.attrs || {};
25408
25357
  const underlineType = attrs.underlineType ?? attrs.underline ?? null;
25409
25358
  const color = attrs.underlineColor ?? attrs.color ?? null;
@@ -25421,20 +25370,20 @@ const decode$E = (params2) => {
25421
25370
  if (themeTint) attributes["w:themeTint"] = themeTint;
25422
25371
  if (themeShade) attributes["w:themeShade"] = themeShade;
25423
25372
  return {
25424
- name: XML_NODE_NAME$o,
25373
+ name: XML_NODE_NAME$r,
25425
25374
  attributes
25426
25375
  };
25427
25376
  };
25428
- const config$m = {
25429
- xmlName: XML_NODE_NAME$o,
25430
- sdNodeOrKeyName: SD_ATTR_KEY$c,
25377
+ const config$p = {
25378
+ xmlName: XML_NODE_NAME$r,
25379
+ sdNodeOrKeyName: SD_ATTR_KEY$d,
25431
25380
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25432
- encode: encode$L,
25433
- decode: decode$E,
25381
+ encode: encode$O,
25382
+ decode: decode$G,
25434
25383
  attributes: validXmlAttributes$h
25435
25384
  };
25436
- const translator$10 = NodeTranslator.from(config$m);
25437
- const encode$K = (attributes) => {
25385
+ const translator$13 = NodeTranslator.from(config$p);
25386
+ const encode$N = (attributes) => {
25438
25387
  const raw = attributes?.["w:val"];
25439
25388
  if (raw === void 0 || raw === null) return void 0;
25440
25389
  if (typeof raw === "boolean") return raw;
@@ -25444,24 +25393,24 @@ const encode$K = (attributes) => {
25444
25393
  if (val === "1" || val === "true" || val === "on") return true;
25445
25394
  return void 0;
25446
25395
  };
25447
- const decode$D = (attrs) => {
25396
+ const decode$F = (attrs) => {
25448
25397
  if (attrs?.strike === false) return "0";
25449
25398
  return void 0;
25450
25399
  };
25451
25400
  const attrConfig$m = Object.freeze({
25452
25401
  xmlName: "w:val",
25453
25402
  sdName: "strike",
25454
- encode: encode$K,
25455
- decode: decode$D
25403
+ encode: encode$N,
25404
+ decode: decode$F
25456
25405
  });
25457
25406
  const validXmlAttributes$g = [attrConfig$m];
25458
- const XML_NODE_NAME$n = "w:strike";
25459
- const SD_ATTR_KEY$b = "strike";
25460
- const encode$J = (params2, encodedAttrs = {}) => {
25407
+ const XML_NODE_NAME$q = "w:strike";
25408
+ const SD_ATTR_KEY$c = "strike";
25409
+ const encode$M = (params2, encodedAttrs = {}) => {
25461
25410
  const { nodes } = params2;
25462
25411
  const node = nodes?.[0];
25463
25412
  if (!node) return void 0;
25464
- const val = encodedAttrs?.[SD_ATTR_KEY$b];
25413
+ const val = encodedAttrs?.[SD_ATTR_KEY$c];
25465
25414
  let attributes;
25466
25415
  if (val === false) attributes = { "w:val": "0" };
25467
25416
  else if (val === true) attributes = {};
@@ -25470,55 +25419,55 @@ const encode$J = (params2, encodedAttrs = {}) => {
25470
25419
  else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
25471
25420
  return {
25472
25421
  type: "attr",
25473
- xmlName: XML_NODE_NAME$n,
25474
- sdNodeOrKeyName: SD_ATTR_KEY$b,
25422
+ xmlName: XML_NODE_NAME$q,
25423
+ sdNodeOrKeyName: SD_ATTR_KEY$c,
25475
25424
  attributes
25476
25425
  };
25477
25426
  };
25478
- const config$l = {
25479
- xmlName: XML_NODE_NAME$n,
25480
- sdNodeOrKeyName: SD_ATTR_KEY$b,
25427
+ const config$o = {
25428
+ xmlName: XML_NODE_NAME$q,
25429
+ sdNodeOrKeyName: SD_ATTR_KEY$c,
25481
25430
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25482
- encode: encode$J,
25431
+ encode: encode$M,
25483
25432
  attributes: validXmlAttributes$g
25484
25433
  };
25485
- const translator$$ = NodeTranslator.from(config$l);
25486
- const encode$I = (attributes) => attributes?.["w:val"];
25487
- const decode$C = (attrs) => attrs?.color;
25434
+ const translator$12 = NodeTranslator.from(config$o);
25435
+ const encode$L = (attributes) => attributes?.["w:val"];
25436
+ const decode$E = (attrs) => attrs?.color;
25488
25437
  const attrConfig$l = Object.freeze({
25489
25438
  xmlName: "w:val",
25490
25439
  sdName: "color",
25491
- encode: encode$I,
25492
- decode: decode$C
25440
+ encode: encode$L,
25441
+ decode: decode$E
25493
25442
  });
25494
- const encode$H = (attributes) => attributes?.["w:themeColor"];
25495
- const decode$B = (attrs) => attrs?.themeColor;
25443
+ const encode$K = (attributes) => attributes?.["w:themeColor"];
25444
+ const decode$D = (attrs) => attrs?.themeColor;
25496
25445
  const attrConfig$k = Object.freeze({
25497
25446
  xmlName: "w:themeColor",
25498
25447
  sdName: "themeColor",
25499
- encode: encode$H,
25500
- decode: decode$B
25448
+ encode: encode$K,
25449
+ decode: decode$D
25501
25450
  });
25502
- const encode$G = (attributes) => attributes?.["w:themeTint"];
25503
- const decode$A = (attrs) => attrs?.themeTint;
25451
+ const encode$J = (attributes) => attributes?.["w:themeTint"];
25452
+ const decode$C = (attrs) => attrs?.themeTint;
25504
25453
  const attrConfig$j = Object.freeze({
25505
25454
  xmlName: "w:themeTint",
25506
25455
  sdName: "themeTint",
25507
- encode: encode$G,
25508
- decode: decode$A
25456
+ encode: encode$J,
25457
+ decode: decode$C
25509
25458
  });
25510
- const encode$F = (attributes) => attributes?.["w:themeShade"];
25511
- const decode$z = (attrs) => attrs?.themeShade;
25459
+ const encode$I = (attributes) => attributes?.["w:themeShade"];
25460
+ const decode$B = (attrs) => attrs?.themeShade;
25512
25461
  const attrConfig$i = Object.freeze({
25513
25462
  xmlName: "w:themeShade",
25514
25463
  sdName: "themeShade",
25515
- encode: encode$F,
25516
- decode: decode$z
25464
+ encode: encode$I,
25465
+ decode: decode$B
25517
25466
  });
25518
25467
  const validXmlAttributes$f = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
25519
- const XML_NODE_NAME$m = "w:color";
25520
- const SD_ATTR_KEY$a = "color";
25521
- const encode$E = (params2, encodedAttrs = {}) => {
25468
+ const XML_NODE_NAME$p = "w:color";
25469
+ const SD_ATTR_KEY$b = "color";
25470
+ const encode$H = (params2, encodedAttrs = {}) => {
25522
25471
  const { nodes } = params2;
25523
25472
  const node = nodes?.[0];
25524
25473
  const sourceAttrs = node?.attributes || {};
@@ -25533,63 +25482,63 @@ const encode$E = (params2, encodedAttrs = {}) => {
25533
25482
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
25534
25483
  return {
25535
25484
  type: "attr",
25536
- xmlName: XML_NODE_NAME$m,
25537
- sdNodeOrKeyName: SD_ATTR_KEY$a,
25485
+ xmlName: XML_NODE_NAME$p,
25486
+ sdNodeOrKeyName: SD_ATTR_KEY$b,
25538
25487
  attributes
25539
25488
  };
25540
25489
  };
25541
- const config$k = {
25542
- xmlName: XML_NODE_NAME$m,
25543
- sdNodeOrKeyName: SD_ATTR_KEY$a,
25490
+ const config$n = {
25491
+ xmlName: XML_NODE_NAME$p,
25492
+ sdNodeOrKeyName: SD_ATTR_KEY$b,
25544
25493
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25545
- encode: encode$E,
25494
+ encode: encode$H,
25546
25495
  attributes: validXmlAttributes$f
25547
25496
  };
25548
- const translator$_ = NodeTranslator.from(config$k);
25549
- const encode$D = (attributes) => attributes?.["w:eastAsia"];
25550
- const decode$y = (attrs) => attrs?.eastAsia;
25497
+ const translator$11 = NodeTranslator.from(config$n);
25498
+ const encode$G = (attributes) => attributes?.["w:eastAsia"];
25499
+ const decode$A = (attrs) => attrs?.eastAsia;
25551
25500
  const attrConfig$h = Object.freeze({
25552
25501
  xmlName: "w:eastAsia",
25553
25502
  sdName: "eastAsia",
25554
- encode: encode$D,
25555
- decode: decode$y
25503
+ encode: encode$G,
25504
+ decode: decode$A
25556
25505
  });
25557
- const encode$C = (attributes) => attributes?.["w:ascii"];
25558
- const decode$x = (attrs) => attrs?.ascii;
25506
+ const encode$F = (attributes) => attributes?.["w:ascii"];
25507
+ const decode$z = (attrs) => attrs?.ascii;
25559
25508
  const attrConfig$g = Object.freeze({
25560
25509
  xmlName: "w:ascii",
25561
25510
  sdName: "ascii",
25562
- encode: encode$C,
25563
- decode: decode$x
25511
+ encode: encode$F,
25512
+ decode: decode$z
25564
25513
  });
25565
- const encode$B = (attributes) => attributes?.["w:hAnsi"];
25566
- const decode$w = (attrs) => attrs?.hAnsi;
25514
+ const encode$E = (attributes) => attributes?.["w:hAnsi"];
25515
+ const decode$y = (attrs) => attrs?.hAnsi;
25567
25516
  const attrConfig$f = Object.freeze({
25568
25517
  xmlName: "w:hAnsi",
25569
25518
  sdName: "hAnsi",
25570
- encode: encode$B,
25571
- decode: decode$w
25519
+ encode: encode$E,
25520
+ decode: decode$y
25572
25521
  });
25573
- const encode$A = (attributes) => attributes?.["w:cs"];
25574
- const decode$v = (attrs) => attrs?.cs;
25522
+ const encode$D = (attributes) => attributes?.["w:cs"];
25523
+ const decode$x = (attrs) => attrs?.cs;
25575
25524
  const attrConfig$e = Object.freeze({
25576
25525
  xmlName: "w:cs",
25577
25526
  sdName: "cs",
25578
- encode: encode$A,
25579
- decode: decode$v
25527
+ encode: encode$D,
25528
+ decode: decode$x
25580
25529
  });
25581
- const encode$z = (attributes) => attributes?.["w:val"];
25582
- const decode$u = (attrs) => attrs?.value;
25530
+ const encode$C = (attributes) => attributes?.["w:val"];
25531
+ const decode$w = (attrs) => attrs?.value;
25583
25532
  const attrConfig$d = Object.freeze({
25584
25533
  xmlName: "w:val",
25585
25534
  sdName: "value",
25586
- encode: encode$z,
25587
- decode: decode$u
25535
+ encode: encode$C,
25536
+ decode: decode$w
25588
25537
  });
25589
25538
  const validXmlAttributes$e = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
25590
- const XML_NODE_NAME$l = "w:rFonts";
25591
- const SD_ATTR_KEY$9 = "fontFamily";
25592
- const encode$y = (params2, encodedAttrs = {}) => {
25539
+ const XML_NODE_NAME$o = "w:rFonts";
25540
+ const SD_ATTR_KEY$a = "fontFamily";
25541
+ const encode$B = (params2, encodedAttrs = {}) => {
25593
25542
  const { nodes } = params2;
25594
25543
  const node = nodes?.[0];
25595
25544
  const sourceAttrs = node?.attributes || {};
@@ -25615,120 +25564,281 @@ const encode$y = (params2, encodedAttrs = {}) => {
25615
25564
  if (attributes["w:val"] === void 0) delete attributes["w:val"];
25616
25565
  return {
25617
25566
  type: "attr",
25618
- xmlName: XML_NODE_NAME$l,
25619
- sdNodeOrKeyName: SD_ATTR_KEY$9,
25567
+ xmlName: XML_NODE_NAME$o,
25568
+ sdNodeOrKeyName: SD_ATTR_KEY$a,
25620
25569
  attributes
25621
25570
  };
25622
25571
  };
25623
- const config$j = {
25624
- xmlName: XML_NODE_NAME$l,
25625
- sdNodeOrKeyName: SD_ATTR_KEY$9,
25572
+ const config$m = {
25573
+ xmlName: XML_NODE_NAME$o,
25574
+ sdNodeOrKeyName: SD_ATTR_KEY$a,
25626
25575
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25627
- encode: encode$y,
25576
+ encode: encode$B,
25628
25577
  attributes: validXmlAttributes$e
25629
25578
  };
25630
- const translator$Z = NodeTranslator.from(config$j);
25631
- const encode$x = (attributes) => attributes?.["w:val"];
25632
- const decode$t = (attrs) => attrs?.styleId;
25579
+ const translator$10 = NodeTranslator.from(config$m);
25580
+ const encode$A = (attributes) => attributes?.["w:val"];
25581
+ const decode$v = (attrs) => attrs?.styleId;
25633
25582
  const attrConfig$c = Object.freeze({
25634
25583
  xmlName: "w:val",
25635
25584
  sdName: "styleId",
25636
- encode: encode$x,
25637
- decode: decode$t
25585
+ encode: encode$A,
25586
+ decode: decode$v
25638
25587
  });
25639
25588
  const validXmlAttributes$d = [attrConfig$c];
25640
- const XML_NODE_NAME$k = "w:rStyle";
25641
- const SD_ATTR_KEY$8 = "styleId";
25642
- const encode$w = (params2, encodedAttrs = {}) => {
25589
+ const XML_NODE_NAME$n = "w:rStyle";
25590
+ const SD_ATTR_KEY$9 = "styleId";
25591
+ const encode$z = (params2, encodedAttrs = {}) => {
25643
25592
  const { nodes } = params2;
25644
25593
  const node = nodes?.[0];
25645
25594
  const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
25646
25595
  return {
25647
25596
  type: "attr",
25648
- xmlName: XML_NODE_NAME$k,
25649
- sdNodeOrKeyName: SD_ATTR_KEY$8,
25597
+ xmlName: XML_NODE_NAME$n,
25598
+ sdNodeOrKeyName: SD_ATTR_KEY$9,
25650
25599
  attributes: { "w:val": value ?? null }
25651
25600
  };
25652
25601
  };
25653
- const config$i = {
25654
- xmlName: XML_NODE_NAME$k,
25655
- sdNodeOrKeyName: SD_ATTR_KEY$8,
25602
+ const config$l = {
25603
+ xmlName: XML_NODE_NAME$n,
25604
+ sdNodeOrKeyName: SD_ATTR_KEY$9,
25656
25605
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25657
- encode: encode$w,
25606
+ encode: encode$z,
25658
25607
  attributes: validXmlAttributes$d
25659
25608
  };
25660
- const translator$Y = NodeTranslator.from(config$i);
25661
- const encode$v = (attributes) => attributes?.["w:val"];
25662
- const decode$s = (attrs) => attrs?.fontSize;
25609
+ const translator$$ = NodeTranslator.from(config$l);
25610
+ const encode$y = (attributes) => attributes?.["w:val"];
25611
+ const decode$u = (attrs) => attrs?.fontSize;
25663
25612
  const attrConfig$b = Object.freeze({
25664
25613
  xmlName: "w:val",
25665
25614
  sdName: "fontSize",
25666
- encode: encode$v,
25667
- decode: decode$s
25615
+ encode: encode$y,
25616
+ decode: decode$u
25668
25617
  });
25669
25618
  const validXmlAttributes$c = [attrConfig$b];
25670
- const XML_NODE_NAME$j = "w:sz";
25671
- const SD_ATTR_KEY$7 = "fontSize";
25672
- const encode$u = (params2, encodedAttrs = {}) => {
25619
+ const XML_NODE_NAME$m = "w:sz";
25620
+ const SD_ATTR_KEY$8 = "fontSize";
25621
+ const encode$x = (params2, encodedAttrs = {}) => {
25673
25622
  const { nodes } = params2;
25674
25623
  const node = nodes?.[0];
25675
25624
  const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
25676
25625
  return {
25677
25626
  type: "attr",
25678
- xmlName: XML_NODE_NAME$j,
25679
- sdNodeOrKeyName: SD_ATTR_KEY$7,
25627
+ xmlName: XML_NODE_NAME$m,
25628
+ sdNodeOrKeyName: SD_ATTR_KEY$8,
25680
25629
  attributes: { "w:val": value ?? null }
25681
25630
  };
25682
25631
  };
25683
- const config$h = {
25684
- xmlName: XML_NODE_NAME$j,
25685
- sdNodeOrKeyName: SD_ATTR_KEY$7,
25632
+ const config$k = {
25633
+ xmlName: XML_NODE_NAME$m,
25634
+ sdNodeOrKeyName: SD_ATTR_KEY$8,
25686
25635
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25687
- encode: encode$u,
25636
+ encode: encode$x,
25688
25637
  attributes: validXmlAttributes$c
25689
25638
  };
25690
- const translator$X = NodeTranslator.from(config$h);
25691
- const encode$t = (attributes) => attributes?.["w:val"];
25692
- const decode$r = (attrs) => attrs?.fontSizeCs;
25639
+ const translator$_ = NodeTranslator.from(config$k);
25640
+ const encode$w = (attributes) => attributes?.["w:val"];
25641
+ const decode$t = (attrs) => attrs?.fontSizeCs;
25693
25642
  const attrConfig$a = Object.freeze({
25694
25643
  xmlName: "w:val",
25695
25644
  sdName: "fontSizeCs",
25696
- encode: encode$t,
25697
- decode: decode$r
25645
+ encode: encode$w,
25646
+ decode: decode$t
25698
25647
  });
25699
25648
  const validXmlAttributes$b = [attrConfig$a];
25700
- const XML_NODE_NAME$i = "w:szCs";
25701
- const SD_ATTR_KEY$6 = "fontSizeCs";
25702
- const encode$s = (params2, encodedAttrs = {}) => {
25649
+ const XML_NODE_NAME$l = "w:szCs";
25650
+ const SD_ATTR_KEY$7 = "fontSizeCs";
25651
+ const encode$v = (params2, encodedAttrs = {}) => {
25703
25652
  const { nodes } = params2;
25704
25653
  const node = nodes?.[0];
25705
25654
  const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
25706
25655
  return {
25707
25656
  type: "attr",
25708
- xmlName: XML_NODE_NAME$i,
25709
- sdNodeOrKeyName: SD_ATTR_KEY$6,
25657
+ xmlName: XML_NODE_NAME$l,
25658
+ sdNodeOrKeyName: SD_ATTR_KEY$7,
25710
25659
  attributes: { "w:val": value ?? null }
25711
25660
  };
25712
25661
  };
25713
- const config$g = {
25714
- xmlName: XML_NODE_NAME$i,
25715
- sdNodeOrKeyName: SD_ATTR_KEY$6,
25662
+ const config$j = {
25663
+ xmlName: XML_NODE_NAME$l,
25664
+ sdNodeOrKeyName: SD_ATTR_KEY$7,
25716
25665
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25717
- encode: encode$s,
25666
+ encode: encode$v,
25718
25667
  attributes: validXmlAttributes$b
25719
25668
  };
25720
- const translator$W = NodeTranslator.from(config$g);
25669
+ const translator$Z = NodeTranslator.from(config$j);
25670
+ const generateV2HandlerEntity = (handlerName, translator2) => ({
25671
+ handlerName,
25672
+ handler: (params2) => {
25673
+ const { nodes } = params2;
25674
+ if (nodes.length === 0 || nodes[0].name !== translator2.xmlName) {
25675
+ return { nodes: [], consumed: 0 };
25676
+ }
25677
+ const result = translator2.encode(params2);
25678
+ if (!result) return { nodes: [], consumed: 0 };
25679
+ return {
25680
+ nodes: Array.isArray(result) ? result : [result],
25681
+ consumed: 1
25682
+ };
25683
+ }
25684
+ });
25685
+ function createSingleAttrPropertyHandler(xmlName, sdName = null, attrName = "w:val", transformEncode = null, transformDecode = null) {
25686
+ if (!sdName) sdName = xmlName.split(":")[1];
25687
+ if (!transformEncode) transformEncode = (v2) => v2;
25688
+ if (!transformDecode) transformDecode = (v2) => v2;
25689
+ return {
25690
+ xmlName,
25691
+ sdNodeOrKeyName: sdName,
25692
+ encode: ({ nodes }) => {
25693
+ return transformEncode(nodes[0].attributes[attrName]) ?? void 0;
25694
+ },
25695
+ decode: ({ node }) => {
25696
+ const value = node.attrs?.[sdName] != null ? transformDecode(node.attrs[sdName]) : void 0;
25697
+ return value != null ? { name: xmlName, attributes: { [attrName]: value } } : void 0;
25698
+ }
25699
+ };
25700
+ }
25701
+ function createMeasurementPropertyHandler(xmlName, sdName = null) {
25702
+ if (!sdName) sdName = xmlName.split(":")[1];
25703
+ return {
25704
+ xmlName,
25705
+ sdNodeOrKeyName: sdName,
25706
+ attributes: [
25707
+ createAttributeHandler("w:w", "value", parseInteger, integerToString),
25708
+ createAttributeHandler("w:type")
25709
+ ],
25710
+ encode: (_2, encodedAttrs) => {
25711
+ return encodedAttrs["value"] != null ? encodedAttrs : void 0;
25712
+ },
25713
+ decode: function({ node }) {
25714
+ const decodedAttrs = this.decodeAttributes({ node: { ...node, attrs: node.attrs[sdName] || {} } });
25715
+ return decodedAttrs["w:w"] != null ? { attributes: decodedAttrs } : void 0;
25716
+ }
25717
+ };
25718
+ }
25719
+ function createBorderPropertyHandler(xmlName, sdName = null) {
25720
+ if (!sdName) sdName = xmlName.split(":")[1];
25721
+ return {
25722
+ xmlName,
25723
+ sdNodeOrKeyName: sdName,
25724
+ attributes: [
25725
+ createAttributeHandler("w:val"),
25726
+ createAttributeHandler("w:color"),
25727
+ createAttributeHandler("w:themeColor"),
25728
+ createAttributeHandler("w:themeTint"),
25729
+ createAttributeHandler("w:themeShade"),
25730
+ createAttributeHandler("w:sz", "size", parseInteger, integerToString),
25731
+ createAttributeHandler("w:space", null, parseInteger, integerToString),
25732
+ createAttributeHandler("w:shadow", null, parseBoolean, booleanToString),
25733
+ createAttributeHandler("w:frame", null, parseBoolean, booleanToString)
25734
+ ],
25735
+ encode: (params2, encodedAttrs) => {
25736
+ return Object.keys(encodedAttrs).length > 0 ? encodedAttrs : void 0;
25737
+ },
25738
+ decode: function({ node }, context) {
25739
+ const decodedAttrs = this.decodeAttributes({ node: { ...node, attrs: node.attrs[sdName] || {} } });
25740
+ return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
25741
+ }
25742
+ };
25743
+ }
25744
+ const createAttributeHandler = (xmlName, sdName = null, transformEncode = null, transformDecode = null) => {
25745
+ if (!transformEncode) transformEncode = (v2) => v2;
25746
+ if (!transformDecode) transformDecode = (v2) => v2;
25747
+ if (!sdName) sdName = xmlName.split(":")[1];
25748
+ return {
25749
+ xmlName,
25750
+ sdName,
25751
+ encode: (attributes) => transformEncode(attributes[xmlName]),
25752
+ decode: (attributes) => transformDecode(attributes[sdName])
25753
+ };
25754
+ };
25755
+ function encodeProperties(node, translatorsByXmlName, asArray = false) {
25756
+ if (!node?.elements || node.elements.length === 0) {
25757
+ return asArray ? [] : {};
25758
+ }
25759
+ const attributes = asArray ? [] : {};
25760
+ node.elements.forEach((el) => {
25761
+ const translator2 = translatorsByXmlName[el.name];
25762
+ if (translator2) {
25763
+ const encodedAttr = translator2.encode({ nodes: [el] });
25764
+ if (encodedAttr != null) {
25765
+ if (asArray) {
25766
+ attributes.push({ [translator2.sdNodeOrKeyName]: encodedAttr });
25767
+ } else {
25768
+ attributes[translator2.sdNodeOrKeyName] = encodedAttr;
25769
+ }
25770
+ }
25771
+ }
25772
+ });
25773
+ return attributes;
25774
+ }
25775
+ function decodeProperties(translatorsBySdName, properties) {
25776
+ if (!properties || typeof properties !== "object") {
25777
+ return [];
25778
+ }
25779
+ const elements = [];
25780
+ Object.keys(properties).forEach((key2) => {
25781
+ const translator2 = translatorsBySdName[key2];
25782
+ if (translator2) {
25783
+ const result = translator2.decode({ node: { attrs: { [key2]: properties[key2] } } });
25784
+ if (result != null) {
25785
+ result.name = translator2.xmlName;
25786
+ elements.push(result);
25787
+ }
25788
+ }
25789
+ });
25790
+ return elements;
25791
+ }
25792
+ const parseBoolean = (value) => value != null ? ["1", "true"].includes(value) : void 0;
25793
+ const booleanToString = (value) => value != null ? value ? "1" : "0" : void 0;
25794
+ const parseInteger = (value) => {
25795
+ if (value == null) return void 0;
25796
+ const intValue = parseInt(value, 10);
25797
+ return isNaN(intValue) ? void 0 : intValue;
25798
+ };
25799
+ const integerToString = (value) => {
25800
+ const intValue = parseInteger(value);
25801
+ return intValue != void 0 ? String(intValue) : void 0;
25802
+ };
25803
+ const XML_NODE_NAME$k = "w:caps";
25804
+ const SD_ATTR_KEY$6 = "textTransform";
25805
+ const encode$u = (params2, encodedAttrs = {}) => {
25806
+ const { nodes } = params2;
25807
+ const node = nodes[0];
25808
+ if (!node) return void 0;
25809
+ let result;
25810
+ if (!["false", "0"].includes(encodedAttrs.val)) {
25811
+ result = "uppercase";
25812
+ } else {
25813
+ return void 0;
25814
+ }
25815
+ return {
25816
+ type: "attr",
25817
+ xmlName: XML_NODE_NAME$k,
25818
+ sdNodeOrKeyName: SD_ATTR_KEY$6,
25819
+ attributes: { [SD_ATTR_KEY$6]: result }
25820
+ };
25821
+ };
25822
+ const config$i = {
25823
+ xmlName: XML_NODE_NAME$k,
25824
+ sdNodeOrKeyName: SD_ATTR_KEY$6,
25825
+ type: NodeTranslator.translatorTypes.ATTRIBUTE,
25826
+ encode: encode$u,
25827
+ attributes: [createAttributeHandler("w:val")]
25828
+ };
25829
+ const translator$Y = NodeTranslator.from(config$i);
25721
25830
  const runPropertyTranslators = Object.freeze({
25722
- "w:b": translator$12,
25723
- "w:i": translator$11,
25724
- "w:u": translator$10,
25725
- "w:strike": translator$$,
25726
- "w:color": translator$_,
25727
- "w:highlight": translator$15,
25728
- "w:rFonts": translator$Z,
25729
- "w:rStyle": translator$Y,
25730
- "w:sz": translator$X,
25731
- "w:szCs": translator$W
25831
+ "w:b": translator$15,
25832
+ "w:i": translator$14,
25833
+ "w:u": translator$13,
25834
+ "w:strike": translator$12,
25835
+ "w:color": translator$11,
25836
+ "w:highlight": translator$18,
25837
+ "w:rFonts": translator$10,
25838
+ "w:rStyle": translator$$,
25839
+ "w:sz": translator$_,
25840
+ "w:szCs": translator$Z,
25841
+ "w:caps": translator$Y
25732
25842
  });
25733
25843
  const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
25734
25844
  const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
@@ -25742,9 +25852,9 @@ const toRunPropertyEntry = (candidate) => {
25742
25852
  attributes: { ...candidate.attributes || {} }
25743
25853
  };
25744
25854
  };
25745
- const XML_NODE_NAME$h = "w:rPr";
25855
+ const XML_NODE_NAME$j = "w:rPr";
25746
25856
  const SD_ATTR_KEY$5 = "runProperties";
25747
- const encode$r = (params2) => {
25857
+ const encode$t = (params2) => {
25748
25858
  const { nodes } = params2;
25749
25859
  const node = nodes?.[0] || {};
25750
25860
  const contents = Array.isArray(node.elements) ? node.elements : [];
@@ -25778,16 +25888,16 @@ const encode$r = (params2) => {
25778
25888
  attributes: runPropsArray
25779
25889
  };
25780
25890
  };
25781
- const config$f = {
25782
- xmlName: XML_NODE_NAME$h,
25891
+ const config$h = {
25892
+ xmlName: XML_NODE_NAME$j,
25783
25893
  sdNodeOrKeyName: SD_ATTR_KEY$5,
25784
25894
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25785
- encode: encode$r
25895
+ encode: encode$t
25786
25896
  };
25787
- const translator$V = NodeTranslator.from(config$f);
25897
+ const translator$X = NodeTranslator.from(config$h);
25788
25898
  const EAST_ASIAN_CHARACTER_REGEX = /[\u1100-\u11FF\u2E80-\u2EFF\u2F00-\u2FDF\u3040-\u30FF\u3100-\u312F\u3130-\u318F\u31A0-\u31BF\u3400-\u4DBF\u4E00-\u9FFF\uA960-\uA97F\uAC00-\uD7AF\uF900-\uFAFF\uFF00-\uFFEF]/u;
25789
25899
  const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
25790
- const collectRunProperties = (params2, rPrNode, translator2 = translator$V) => {
25900
+ const collectRunProperties = (params2, rPrNode, translator2 = translator$X) => {
25791
25901
  if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
25792
25902
  const result = translator2.encode({ ...params2, nodes: [rPrNode] }) || {};
25793
25903
  let entries = [];
@@ -25856,7 +25966,10 @@ const applyRunMarks = (node, inlineMarks, textStyleAttrs) => {
25856
25966
  };
25857
25967
  const deriveStyleMarks = ({ docx, paragraphStyleId, runStyleId }) => {
25858
25968
  const paragraphStyleMarks = collectStyleMarks(paragraphStyleId, docx);
25859
- const runStyleMarks = collectStyleMarks(runStyleId, docx);
25969
+ if (paragraphStyleId?.startsWith("TOC")) {
25970
+ return paragraphStyleMarks;
25971
+ }
25972
+ let runStyleMarks = collectStyleMarks(runStyleId, docx);
25860
25973
  const inlineMarks = mergeInlineMarkSets(paragraphStyleMarks.inlineMarks, runStyleMarks.inlineMarks);
25861
25974
  const textStyleAttrs = mergeTextStyleAttrs(paragraphStyleMarks.textStyleAttrs, runStyleMarks.textStyleAttrs);
25862
25975
  return { inlineMarks, textStyleAttrs };
@@ -26082,6 +26195,13 @@ const splitRunProperties = (entries = [], docx = null) => {
26082
26195
  }
26083
26196
  break;
26084
26197
  }
26198
+ case "w:caps": {
26199
+ if (attributes["textTransform"] != null) {
26200
+ hasTextStyle = true;
26201
+ textStyleAttrs.textTransform = attributes["textTransform"];
26202
+ }
26203
+ break;
26204
+ }
26085
26205
  case "w:rFonts": {
26086
26206
  const asciiFamily = attributes["w:ascii"] || attributes["w:hAnsi"] || (attributes["w:eastAsia"] ? void 0 : attributes["w:val"]);
26087
26207
  const eastAsiaFamily = attributes["w:eastAsia"];
@@ -26101,9 +26221,10 @@ const splitRunProperties = (entries = [], docx = null) => {
26101
26221
  case "w:sz":
26102
26222
  case "w:szCs": {
26103
26223
  const rawSize = Number(attributes["w:val"]);
26224
+ const attrName = entry.xmlName === "w:sz" ? "fontSize" : "fontSizeCs";
26104
26225
  if (Number.isFinite(rawSize) && rawSize > 0) {
26105
26226
  hasTextStyle = true;
26106
- textStyleAttrs.fontSize = `${rawSize / 2}pt`;
26227
+ textStyleAttrs[attrName] = `${rawSize / 2}pt`;
26107
26228
  }
26108
26229
  break;
26109
26230
  }
@@ -26249,46 +26370,166 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
26249
26370
  }
26250
26371
  return runs;
26251
26372
  };
26252
- const encode$q = (attributes) => {
26373
+ const XML_NODE_NAME$i = "w:hyperlink";
26374
+ const SD_NODE_NAME$c = "link";
26375
+ const _createAttributeHandler = (xmlName, sdName) => ({
26376
+ xmlName,
26377
+ sdName,
26378
+ encode: (attributes) => attributes[xmlName],
26379
+ decode: (attributes) => attributes[sdName]
26380
+ });
26381
+ const validXmlAttributes$a = [
26382
+ _createAttributeHandler("w:anchor", "anchor"),
26383
+ _createAttributeHandler("w:docLocation", "docLocation"),
26384
+ {
26385
+ xmlName: "w:history",
26386
+ sdName: "history",
26387
+ encode: (attributes) => attributes["w:history"] === "1" || attributes["w:history"] === "true",
26388
+ decode: (attributes) => attributes["history"] ? "1" : "0"
26389
+ },
26390
+ _createAttributeHandler("w:tooltip", "tooltip"),
26391
+ _createAttributeHandler("r:id", "rId"),
26392
+ _createAttributeHandler("w:tgtFrame", "target")
26393
+ ];
26394
+ const encode$s = (params2, encodedAttrs) => {
26395
+ const { nodes, docx, nodeListHandler } = params2;
26396
+ const node = nodes[0];
26397
+ let href = _resolveHref(docx, encodedAttrs);
26398
+ const linkMark = { type: "link", attrs: { ...encodedAttrs, href } };
26399
+ const referenceNodeTypes = ["sd:pageReference", "sd:autoPageNumber", "sd:totalPageNumber"];
26400
+ const contentNodes = node.elements.filter((el) => el.name === "w:r" || referenceNodeTypes.includes(el.name));
26401
+ contentNodes.forEach((contentNode) => {
26402
+ const existingMarks = Array.isArray(contentNode.marks) ? contentNode.marks : [];
26403
+ const marksWithoutLink = existingMarks.filter((mark) => mark?.type !== "link");
26404
+ contentNode.marks = [...marksWithoutLink, linkMark];
26405
+ });
26406
+ const updatedNode = nodeListHandler.handler({
26407
+ ...params2,
26408
+ nodes: contentNodes,
26409
+ path: [...params2.path || [], node]
26410
+ });
26411
+ return updatedNode;
26412
+ };
26413
+ const _resolveHref = (docx, encodedAttrs) => {
26414
+ const rels = docx["word/_rels/document.xml.rels"];
26415
+ const relationships = rels.elements.find((el) => el.name === "Relationships");
26416
+ const { elements } = relationships;
26417
+ const { rId, anchor } = encodedAttrs;
26418
+ let href;
26419
+ if (!rId && anchor) {
26420
+ href = `#${anchor}`;
26421
+ } else if (rId) {
26422
+ const rel = elements.find((el) => el.attributes["Id"] === rId) || {};
26423
+ const { attributes: relAttributes = {} } = rel;
26424
+ href = relAttributes["Target"];
26425
+ }
26426
+ return href;
26427
+ };
26428
+ function decode$s(params2) {
26429
+ const { hyperlinkGroup = [params2.node] } = params2.extraParams || {};
26430
+ const node = hyperlinkGroup[0];
26431
+ const linkMark = node.marks.find((m2) => m2.type === "link");
26432
+ const linkAttrs = this.decodeAttributes({ ...params2, node: linkMark });
26433
+ let { anchor, href: link } = linkMark.attrs;
26434
+ const isExternalLink = !anchor;
26435
+ if (isExternalLink) {
26436
+ linkAttrs["r:id"] = _addNewLinkRelationship(params2, link, linkAttrs["r:id"]);
26437
+ }
26438
+ let contentNodes = [];
26439
+ hyperlinkGroup.forEach((linkNode) => {
26440
+ if ("marks" in linkNode) {
26441
+ linkNode.marks = linkNode.marks.filter((m2) => m2.type !== "link");
26442
+ } else {
26443
+ linkNode.attrs.marksAsAttrs = linkNode.attrs.marksAsAttrs.filter((m2) => m2.type !== "link");
26444
+ }
26445
+ const outputNode = exportSchemaToJson({ ...params2, node: linkNode });
26446
+ if (outputNode) {
26447
+ if (outputNode instanceof Array) contentNodes.push(...outputNode);
26448
+ else contentNodes.push(outputNode);
26449
+ }
26450
+ });
26451
+ const newNode = {
26452
+ name: "w:hyperlink",
26453
+ type: "element",
26454
+ attributes: {
26455
+ ...linkAttrs
26456
+ },
26457
+ elements: contentNodes
26458
+ };
26459
+ return newNode;
26460
+ }
26461
+ function _addNewLinkRelationship(params2, link, rId) {
26462
+ if (!rId) rId = generateDocxRandomId();
26463
+ if (!params2.relationships || !Array.isArray(params2.relationships)) {
26464
+ params2.relationships = [];
26465
+ }
26466
+ const existingRel = params2.relationships.find(
26467
+ (rel) => rel.attributes && rel.attributes.Id === rId && rel.attributes.Target === link
26468
+ );
26469
+ if (existingRel) {
26470
+ return rId;
26471
+ }
26472
+ params2.relationships.push({
26473
+ type: "element",
26474
+ name: "Relationship",
26475
+ attributes: {
26476
+ Id: rId,
26477
+ Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
26478
+ Target: link,
26479
+ TargetMode: "External"
26480
+ }
26481
+ });
26482
+ return rId;
26483
+ }
26484
+ const config$g = {
26485
+ xmlName: XML_NODE_NAME$i,
26486
+ sdNodeOrKeyName: SD_NODE_NAME$c,
26487
+ type: NodeTranslator.translatorTypes.NODE,
26488
+ encode: encode$s,
26489
+ decode: decode$s,
26490
+ attributes: validXmlAttributes$a
26491
+ };
26492
+ const translator$W = NodeTranslator.from(config$g);
26493
+ const encode$r = (attributes) => {
26253
26494
  return attributes["w:rsidR"];
26254
26495
  };
26255
- const decode$q = (attrs) => {
26496
+ const decode$r = (attrs) => {
26256
26497
  return attrs.rsidR;
26257
26498
  };
26258
26499
  const attrConfig$9 = Object.freeze({
26259
26500
  xmlName: "w:rsidR",
26260
26501
  sdName: "rsidR",
26261
- encode: encode$q,
26262
- decode: decode$q
26502
+ encode: encode$r,
26503
+ decode: decode$r
26263
26504
  });
26264
- const encode$p = (attributes) => {
26505
+ const encode$q = (attributes) => {
26265
26506
  return attributes["w:rsidRPr"];
26266
26507
  };
26267
- const decode$p = (attrs) => {
26508
+ const decode$q = (attrs) => {
26268
26509
  return attrs.rsidRPr;
26269
26510
  };
26270
26511
  const attrConfig$8 = Object.freeze({
26271
26512
  xmlName: "w:rsidRPr",
26272
26513
  sdName: "rsidRPr",
26273
- encode: encode$p,
26274
- decode: decode$p
26514
+ encode: encode$q,
26515
+ decode: decode$q
26275
26516
  });
26276
- const encode$o = (attributes) => {
26517
+ const encode$p = (attributes) => {
26277
26518
  return attributes["w:rsidDel"];
26278
26519
  };
26279
- const decode$o = (attrs) => {
26520
+ const decode$p = (attrs) => {
26280
26521
  return attrs.rsidDel;
26281
26522
  };
26282
26523
  const attrConfig$7 = Object.freeze({
26283
26524
  xmlName: "w:rsidDel",
26284
26525
  sdName: "rsidDel",
26285
- encode: encode$o,
26286
- decode: decode$o
26526
+ encode: encode$p,
26527
+ decode: decode$p
26287
26528
  });
26288
- const validXmlAttributes$a = [attrConfig$9, attrConfig$8, attrConfig$7];
26289
- const XML_NODE_NAME$g = "w:r";
26529
+ const validXmlAttributes$9 = [attrConfig$9, attrConfig$8, attrConfig$7];
26530
+ const XML_NODE_NAME$h = "w:r";
26290
26531
  const SD_KEY_NAME = "run";
26291
- const encode$n = (params2, encodedAttrs = {}) => {
26532
+ const encode$o = (params2, encodedAttrs = {}) => {
26292
26533
  const { nodes = [], nodeListHandler } = params2 || {};
26293
26534
  const runNode = nodes[0];
26294
26535
  if (!runNode) return void 0;
@@ -26336,9 +26577,11 @@ const encode$n = (params2, encodedAttrs = {}) => {
26336
26577
  }
26337
26578
  return runNodeResult;
26338
26579
  };
26339
- const decode$n = (params2, decodedAttrs = {}) => {
26580
+ const decode$o = (params2, decodedAttrs = {}) => {
26340
26581
  const { node } = params2 || {};
26341
26582
  if (!node) return void 0;
26583
+ const isLinkNode = node.marks?.some((m2) => m2.type === "link");
26584
+ if (isLinkNode) return translator$W.decode(params2);
26342
26585
  const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
26343
26586
  const runAttrs = runNodeForExport.attrs || {};
26344
26587
  const runProperties = Array.isArray(runAttrs.runProperties) ? runAttrs.runProperties : [];
@@ -26393,7 +26636,7 @@ const decode$n = (params2, decodedAttrs = {}) => {
26393
26636
  runs.push(trackedClone);
26394
26637
  return;
26395
26638
  }
26396
- const runWrapper = { name: XML_NODE_NAME$g, elements: [] };
26639
+ const runWrapper = { name: XML_NODE_NAME$h, elements: [] };
26397
26640
  applyBaseRunProps(runWrapper);
26398
26641
  if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
26399
26642
  runWrapper.elements.push(cloneXmlNode(child));
@@ -26401,7 +26644,7 @@ const decode$n = (params2, decodedAttrs = {}) => {
26401
26644
  });
26402
26645
  const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
26403
26646
  if (!trackedRuns.length) {
26404
- const emptyRun = { name: XML_NODE_NAME$g, elements: [] };
26647
+ const emptyRun = { name: XML_NODE_NAME$h, elements: [] };
26405
26648
  applyBaseRunProps(emptyRun);
26406
26649
  trackedRuns.push(emptyRun);
26407
26650
  }
@@ -26415,148 +26658,15 @@ const decode$n = (params2, decodedAttrs = {}) => {
26415
26658
  }
26416
26659
  return trackedRuns;
26417
26660
  };
26418
- const config$e = {
26419
- xmlName: XML_NODE_NAME$g,
26661
+ const config$f = {
26662
+ xmlName: XML_NODE_NAME$h,
26420
26663
  sdNodeOrKeyName: SD_KEY_NAME,
26421
26664
  type: NodeTranslator.translatorTypes.NODE,
26422
- encode: encode$n,
26423
- decode: decode$n,
26424
- attributes: validXmlAttributes$a
26425
- };
26426
- const translator$U = NodeTranslator.from(config$e);
26427
- const generateV2HandlerEntity = (handlerName, translator2) => ({
26428
- handlerName,
26429
- handler: (params2) => {
26430
- const { nodes } = params2;
26431
- if (nodes.length === 0 || nodes[0].name !== translator2.xmlName) {
26432
- return { nodes: [], consumed: 0 };
26433
- }
26434
- const result = translator2.encode(params2);
26435
- if (!result) return { nodes: [], consumed: 0 };
26436
- return {
26437
- nodes: Array.isArray(result) ? result : [result],
26438
- consumed: 1
26439
- };
26440
- }
26441
- });
26442
- function createSingleAttrPropertyHandler(xmlName, sdName = null, attrName = "w:val", transformEncode = null, transformDecode = null) {
26443
- if (!sdName) sdName = xmlName.split(":")[1];
26444
- if (!transformEncode) transformEncode = (v2) => v2;
26445
- if (!transformDecode) transformDecode = (v2) => v2;
26446
- return {
26447
- xmlName,
26448
- sdNodeOrKeyName: sdName,
26449
- encode: ({ nodes }) => {
26450
- return transformEncode(nodes[0].attributes[attrName]) ?? void 0;
26451
- },
26452
- decode: ({ node }) => {
26453
- const value = node.attrs?.[sdName] != null ? transformDecode(node.attrs[sdName]) : void 0;
26454
- return value != null ? { name: xmlName, attributes: { [attrName]: value } } : void 0;
26455
- }
26456
- };
26457
- }
26458
- function createMeasurementPropertyHandler(xmlName, sdName = null) {
26459
- if (!sdName) sdName = xmlName.split(":")[1];
26460
- return {
26461
- xmlName,
26462
- sdNodeOrKeyName: sdName,
26463
- attributes: [
26464
- createAttributeHandler("w:w", "value", parseInteger, integerToString),
26465
- createAttributeHandler("w:type")
26466
- ],
26467
- encode: (_2, encodedAttrs) => {
26468
- return encodedAttrs["value"] != null ? encodedAttrs : void 0;
26469
- },
26470
- decode: function({ node }) {
26471
- const decodedAttrs = this.decodeAttributes({ node: { ...node, attrs: node.attrs[sdName] || {} } });
26472
- return decodedAttrs["w:w"] != null ? { attributes: decodedAttrs } : void 0;
26473
- }
26474
- };
26475
- }
26476
- function createBorderPropertyHandler(xmlName, sdName = null) {
26477
- if (!sdName) sdName = xmlName.split(":")[1];
26478
- return {
26479
- xmlName,
26480
- sdNodeOrKeyName: sdName,
26481
- attributes: [
26482
- createAttributeHandler("w:val"),
26483
- createAttributeHandler("w:color"),
26484
- createAttributeHandler("w:themeColor"),
26485
- createAttributeHandler("w:themeTint"),
26486
- createAttributeHandler("w:themeShade"),
26487
- createAttributeHandler("w:sz", "size", parseInteger, integerToString),
26488
- createAttributeHandler("w:space", null, parseInteger, integerToString),
26489
- createAttributeHandler("w:shadow", null, parseBoolean, booleanToString),
26490
- createAttributeHandler("w:frame", null, parseBoolean, booleanToString)
26491
- ],
26492
- encode: (params2, encodedAttrs) => {
26493
- return Object.keys(encodedAttrs).length > 0 ? encodedAttrs : void 0;
26494
- },
26495
- decode: function({ node }, context) {
26496
- const decodedAttrs = this.decodeAttributes({ node: { ...node, attrs: node.attrs[sdName] || {} } });
26497
- return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26498
- }
26499
- };
26500
- }
26501
- const createAttributeHandler = (xmlName, sdName = null, transformEncode = null, transformDecode = null) => {
26502
- if (!transformEncode) transformEncode = (v2) => v2;
26503
- if (!transformDecode) transformDecode = (v2) => v2;
26504
- if (!sdName) sdName = xmlName.split(":")[1];
26505
- return {
26506
- xmlName,
26507
- sdName,
26508
- encode: (attributes) => transformEncode(attributes[xmlName]),
26509
- decode: (attributes) => transformDecode(attributes[sdName])
26510
- };
26511
- };
26512
- function encodeProperties(node, translatorsByXmlName, asArray = false) {
26513
- if (!node?.elements || node.elements.length === 0) {
26514
- return asArray ? [] : {};
26515
- }
26516
- const attributes = asArray ? [] : {};
26517
- node.elements.forEach((el) => {
26518
- const translator2 = translatorsByXmlName[el.name];
26519
- if (translator2) {
26520
- const encodedAttr = translator2.encode({ nodes: [el] });
26521
- if (encodedAttr != null) {
26522
- if (asArray) {
26523
- attributes.push({ [translator2.sdNodeOrKeyName]: encodedAttr });
26524
- } else {
26525
- attributes[translator2.sdNodeOrKeyName] = encodedAttr;
26526
- }
26527
- }
26528
- }
26529
- });
26530
- return attributes;
26531
- }
26532
- function decodeProperties(translatorsBySdName, properties) {
26533
- if (!properties || typeof properties !== "object") {
26534
- return [];
26535
- }
26536
- const elements = [];
26537
- Object.keys(properties).forEach((key2) => {
26538
- const translator2 = translatorsBySdName[key2];
26539
- if (translator2) {
26540
- const result = translator2.decode({ node: { attrs: { [key2]: properties[key2] } } });
26541
- if (result != null) {
26542
- result.name = translator2.xmlName;
26543
- elements.push(result);
26544
- }
26545
- }
26546
- });
26547
- return elements;
26548
- }
26549
- const parseBoolean = (value) => value != null ? ["1", "true"].includes(value) : void 0;
26550
- const booleanToString = (value) => value != null ? value ? "1" : "0" : void 0;
26551
- const parseInteger = (value) => {
26552
- if (value == null) return void 0;
26553
- const intValue = parseInt(value, 10);
26554
- return isNaN(intValue) ? void 0 : intValue;
26555
- };
26556
- const integerToString = (value) => {
26557
- const intValue = parseInteger(value);
26558
- return intValue != void 0 ? String(intValue) : void 0;
26665
+ encode: encode$o,
26666
+ decode: decode$o,
26667
+ attributes: validXmlAttributes$9
26559
26668
  };
26669
+ const translator$V = NodeTranslator.from(config$f);
26560
26670
  function preProcessVerticalMergeCells(table, { editorSchema }) {
26561
26671
  if (!table || !Array.isArray(table.content)) {
26562
26672
  return table;
@@ -26597,13 +26707,13 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
26597
26707
  }
26598
26708
  return table;
26599
26709
  }
26600
- const translator$T = NodeTranslator.from({
26710
+ const translator$U = NodeTranslator.from({
26601
26711
  xmlName: "w:cantSplit",
26602
26712
  sdNodeOrKeyName: "cantSplit",
26603
26713
  encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
26604
26714
  decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
26605
26715
  });
26606
- const translator$S = NodeTranslator.from({
26716
+ const translator$T = NodeTranslator.from({
26607
26717
  xmlName: "w:cnfStyle",
26608
26718
  sdNodeOrKeyName: "cnfStyle",
26609
26719
  attributes: [
@@ -26629,8 +26739,8 @@ const translator$S = NodeTranslator.from({
26629
26739
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26630
26740
  }
26631
26741
  });
26632
- const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
26633
- const translator$Q = NodeTranslator.from(
26742
+ const translator$S = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
26743
+ const translator$R = NodeTranslator.from(
26634
26744
  createSingleAttrPropertyHandler(
26635
26745
  "w:gridAfter",
26636
26746
  null,
@@ -26639,7 +26749,7 @@ const translator$Q = NodeTranslator.from(
26639
26749
  (v2) => integerToString(v2)
26640
26750
  )
26641
26751
  );
26642
- const translator$P = NodeTranslator.from(
26752
+ const translator$Q = NodeTranslator.from(
26643
26753
  createSingleAttrPropertyHandler(
26644
26754
  "w:gridBefore",
26645
26755
  null,
@@ -26648,21 +26758,21 @@ const translator$P = NodeTranslator.from(
26648
26758
  (v2) => integerToString(v2)
26649
26759
  )
26650
26760
  );
26651
- const translator$O = NodeTranslator.from({
26761
+ const translator$P = NodeTranslator.from({
26652
26762
  xmlName: "w:hidden",
26653
26763
  sdNodeOrKeyName: "hidden",
26654
26764
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26655
26765
  decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
26656
26766
  });
26657
- const translator$N = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
26658
- const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
26659
- const translator$L = NodeTranslator.from({
26767
+ const translator$O = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
26768
+ const translator$N = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
26769
+ const translator$M = NodeTranslator.from({
26660
26770
  xmlName: "w:tblHeader",
26661
26771
  sdNodeOrKeyName: "repeatHeader",
26662
26772
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26663
26773
  decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
26664
26774
  });
26665
- const translator$K = NodeTranslator.from({
26775
+ const translator$L = NodeTranslator.from({
26666
26776
  xmlName: "w:trHeight",
26667
26777
  sdNodeOrKeyName: "rowHeight",
26668
26778
  encode: ({ nodes }) => {
@@ -26689,11 +26799,11 @@ const translator$K = NodeTranslator.from({
26689
26799
  return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
26690
26800
  }
26691
26801
  });
26692
- const translator$J = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
26693
- const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
26694
- const XML_NODE_NAME$f = "w:trPr";
26802
+ const translator$K = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
26803
+ const translator$J = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
26804
+ const XML_NODE_NAME$g = "w:trPr";
26695
26805
  const SD_ATTR_KEY$4 = "tableRowProperties";
26696
- const encode$m = (params2) => {
26806
+ const encode$n = (params2) => {
26697
26807
  const { nodes } = params2;
26698
26808
  const node = nodes[0];
26699
26809
  let attributes = {
@@ -26707,12 +26817,12 @@ const encode$m = (params2) => {
26707
26817
  };
26708
26818
  return {
26709
26819
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
26710
- xmlName: XML_NODE_NAME$f,
26820
+ xmlName: XML_NODE_NAME$g,
26711
26821
  sdNodeOrKeyName: SD_ATTR_KEY$4,
26712
26822
  attributes
26713
26823
  };
26714
26824
  };
26715
- const decode$m = (params2) => {
26825
+ const decode$n = (params2) => {
26716
26826
  const { tableRowProperties = {} } = params2.node.attrs || {};
26717
26827
  const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
26718
26828
  const newNode = {
@@ -26724,6 +26834,7 @@ const decode$m = (params2) => {
26724
26834
  return newNode;
26725
26835
  };
26726
26836
  const propertyTranslators$3 = [
26837
+ translator$U,
26727
26838
  translator$T,
26728
26839
  translator$S,
26729
26840
  translator$R,
@@ -26734,8 +26845,7 @@ const propertyTranslators$3 = [
26734
26845
  translator$M,
26735
26846
  translator$L,
26736
26847
  translator$K,
26737
- translator$J,
26738
- translator$I
26848
+ translator$J
26739
26849
  ];
26740
26850
  const propertyTranslatorsByXmlName$2 = {};
26741
26851
  propertyTranslators$3.forEach((translator2) => {
@@ -26745,25 +26855,25 @@ const propertyTranslatorsBySdName$2 = {};
26745
26855
  propertyTranslators$3.forEach((translator2) => {
26746
26856
  propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
26747
26857
  });
26748
- const config$d = {
26749
- xmlName: XML_NODE_NAME$f,
26858
+ const config$e = {
26859
+ xmlName: XML_NODE_NAME$g,
26750
26860
  sdNodeOrKeyName: SD_ATTR_KEY$4,
26751
26861
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
26752
- encode: encode$m,
26753
- decode: decode$m
26862
+ encode: encode$n,
26863
+ decode: decode$n
26754
26864
  };
26755
- const translator$H = NodeTranslator.from(config$d);
26756
- const XML_NODE_NAME$e = "w:tr";
26757
- const SD_NODE_NAME$a = "tableRow";
26758
- const validXmlAttributes$9 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
26865
+ const translator$I = NodeTranslator.from(config$e);
26866
+ const XML_NODE_NAME$f = "w:tr";
26867
+ const SD_NODE_NAME$b = "tableRow";
26868
+ const validXmlAttributes$8 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
26759
26869
  (xmlName) => createAttributeHandler(xmlName)
26760
26870
  );
26761
- const encode$l = (params2, encodedAttrs) => {
26871
+ const encode$m = (params2, encodedAttrs) => {
26762
26872
  const { row } = params2.extraParams;
26763
26873
  let tableRowProperties = {};
26764
26874
  const tPr = row.elements.find((el) => el.name === "w:trPr");
26765
26875
  if (tPr) {
26766
- ({ attributes: tableRowProperties } = translator$H.encode({
26876
+ ({ attributes: tableRowProperties } = translator$I.encode({
26767
26877
  ...params2,
26768
26878
  nodes: [tPr]
26769
26879
  }));
@@ -26776,7 +26886,7 @@ const encode$l = (params2, encodedAttrs) => {
26776
26886
  let currentColumnIndex = 0;
26777
26887
  const content = cellNodes?.map((n) => {
26778
26888
  let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
26779
- const result = translator$8.encode({
26889
+ const result = translator$9.encode({
26780
26890
  ...params2,
26781
26891
  extraParams: {
26782
26892
  ...params2.extraParams,
@@ -26798,7 +26908,7 @@ const encode$l = (params2, encodedAttrs) => {
26798
26908
  };
26799
26909
  return newNode;
26800
26910
  };
26801
- const decode$l = (params2, decodedAttrs) => {
26911
+ const decode$m = (params2, decodedAttrs) => {
26802
26912
  const { node } = params2;
26803
26913
  const elements = translateChildNodes(params2);
26804
26914
  if (node.attrs?.tableRowProperties) {
@@ -26810,7 +26920,7 @@ const decode$l = (params2, decodedAttrs) => {
26810
26920
  }
26811
26921
  }
26812
26922
  tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
26813
- const trPr = translator$H.decode({
26923
+ const trPr = translator$I.decode({
26814
26924
  ...params2,
26815
26925
  node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
26816
26926
  });
@@ -26822,22 +26932,22 @@ const decode$l = (params2, decodedAttrs) => {
26822
26932
  elements
26823
26933
  };
26824
26934
  };
26825
- const config$c = {
26826
- xmlName: XML_NODE_NAME$e,
26827
- sdNodeOrKeyName: SD_NODE_NAME$a,
26935
+ const config$d = {
26936
+ xmlName: XML_NODE_NAME$f,
26937
+ sdNodeOrKeyName: SD_NODE_NAME$b,
26828
26938
  type: NodeTranslator.translatorTypes.NODE,
26829
- encode: encode$l,
26830
- decode: decode$l,
26831
- attributes: validXmlAttributes$9
26939
+ encode: encode$m,
26940
+ decode: decode$m,
26941
+ attributes: validXmlAttributes$8
26832
26942
  };
26833
- const translator$G = NodeTranslator.from(config$c);
26834
- const translator$F = NodeTranslator.from({
26943
+ const translator$H = NodeTranslator.from(config$d);
26944
+ const translator$G = NodeTranslator.from({
26835
26945
  xmlName: "w:bidiVisual",
26836
26946
  sdNodeOrKeyName: "rightToLeft",
26837
26947
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26838
26948
  decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
26839
26949
  });
26840
- const translator$E = NodeTranslator.from({
26950
+ const translator$F = NodeTranslator.from({
26841
26951
  xmlName: "w:shd",
26842
26952
  sdNodeOrKeyName: "shading",
26843
26953
  attributes: [
@@ -26859,11 +26969,11 @@ const translator$E = NodeTranslator.from({
26859
26969
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26860
26970
  }
26861
26971
  });
26862
- const translator$D = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
26863
- const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
26864
- const translator$B = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
26865
- const translator$A = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
26866
- const translator$z = NodeTranslator.from({
26972
+ const translator$E = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
26973
+ const translator$D = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
26974
+ const translator$C = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
26975
+ const translator$B = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
26976
+ const translator$A = NodeTranslator.from({
26867
26977
  xmlName: "w:tblLook",
26868
26978
  sdNodeOrKeyName: "tblLook",
26869
26979
  attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
@@ -26875,16 +26985,16 @@ const translator$z = NodeTranslator.from({
26875
26985
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26876
26986
  }
26877
26987
  });
26878
- const translator$y = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
26879
- const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
26880
- const translator$w = NodeTranslator.from(
26988
+ const translator$z = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
26989
+ const translator$y = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
26990
+ const translator$x = NodeTranslator.from(
26881
26991
  createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
26882
26992
  );
26883
- const translator$v = NodeTranslator.from(
26993
+ const translator$w = NodeTranslator.from(
26884
26994
  createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
26885
26995
  );
26886
- const translator$u = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
26887
- const translator$t = NodeTranslator.from({
26996
+ const translator$v = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
26997
+ const translator$u = NodeTranslator.from({
26888
26998
  xmlName: "w:tblpPr",
26889
26999
  sdNodeOrKeyName: "floatingTableProperties",
26890
27000
  attributes: ["w:leftFromText", "w:rightFromText", "w:topFromText", "w:bottomFromText", "w:tblpX", "w:tblpY"].map((attr) => createAttributeHandler(attr, null, parseInteger, integerToString)).concat(["w:horzAnchor", "w:vertAnchor", "w:tblpXSpec", "w:tblpYSpec"].map((attr) => createAttributeHandler(attr))),
@@ -26896,29 +27006,29 @@ const translator$t = NodeTranslator.from({
26896
27006
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26897
27007
  }
26898
27008
  });
26899
- const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
26900
- const translator$r = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
26901
- const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:end"));
26902
- const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
26903
- const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
26904
- const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
26905
- const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:left"));
26906
- const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
26907
- const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:right"));
26908
- const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
26909
- const translator$i = NodeTranslator.from(createBorderPropertyHandler("w:start"));
26910
- const translator$h = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
26911
- const translator$g = NodeTranslator.from(createBorderPropertyHandler("w:top"));
26912
- const translator$f = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
26913
- const XML_NODE_NAME$d = "w:tblBorders";
27009
+ const translator$t = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
27010
+ const translator$s = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
27011
+ const translator$r = NodeTranslator.from(createBorderPropertyHandler("w:end"));
27012
+ const translator$q = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
27013
+ const translator$p = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
27014
+ const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
27015
+ const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:left"));
27016
+ const translator$m = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
27017
+ const translator$l = NodeTranslator.from(createBorderPropertyHandler("w:right"));
27018
+ const translator$k = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
27019
+ const translator$j = NodeTranslator.from(createBorderPropertyHandler("w:start"));
27020
+ const translator$i = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
27021
+ const translator$h = NodeTranslator.from(createBorderPropertyHandler("w:top"));
27022
+ const translator$g = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
27023
+ const XML_NODE_NAME$e = "w:tblBorders";
26914
27024
  const SD_ATTR_KEY$3 = "borders";
26915
- const encode$k = (params2) => {
27025
+ const encode$l = (params2) => {
26916
27026
  const { nodes } = params2;
26917
27027
  const node = nodes[0];
26918
27028
  const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
26919
27029
  return Object.keys(attributes).length > 0 ? attributes : void 0;
26920
27030
  };
26921
- const decode$k = (params2) => {
27031
+ const decode$l = (params2) => {
26922
27032
  const { borders = {} } = params2.node.attrs || {};
26923
27033
  const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
26924
27034
  const newNode = {
@@ -26930,14 +27040,14 @@ const decode$k = (params2) => {
26930
27040
  return newNode;
26931
27041
  };
26932
27042
  const propertyTranslators$2 = [
26933
- translator$s,
26934
- translator$q,
27043
+ translator$t,
27044
+ translator$r,
27045
+ translator$p,
26935
27046
  translator$o,
26936
27047
  translator$n,
26937
- translator$m,
26938
- translator$k,
26939
- translator$i,
26940
- translator$g
27048
+ translator$l,
27049
+ translator$j,
27050
+ translator$h
26941
27051
  ];
26942
27052
  const tblBordersTranslatorsByXmlName = {};
26943
27053
  const tblBordersTranslatorsBySdName = {};
@@ -26945,27 +27055,27 @@ propertyTranslators$2.forEach((translator2) => {
26945
27055
  tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
26946
27056
  tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
26947
27057
  });
26948
- const translator$e = NodeTranslator.from({
26949
- xmlName: XML_NODE_NAME$d,
27058
+ const translator$f = NodeTranslator.from({
27059
+ xmlName: XML_NODE_NAME$e,
26950
27060
  sdNodeOrKeyName: SD_ATTR_KEY$3,
26951
27061
  type: NodeTranslator.translatorTypes.NODE,
26952
27062
  attributes: [],
26953
- encode: encode$k,
26954
- decode: decode$k
27063
+ encode: encode$l,
27064
+ decode: decode$l
26955
27065
  });
26956
- const XML_NODE_NAME$c = "w:tblCellMar";
27066
+ const XML_NODE_NAME$d = "w:tblCellMar";
26957
27067
  const SD_ATTR_KEY$2 = "cellMargins";
26958
- const encode$j = (params2) => {
27068
+ const encode$k = (params2) => {
26959
27069
  const { nodes } = params2;
26960
27070
  const node = nodes[0];
26961
27071
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
26962
27072
  return Object.keys(attributes).length > 0 ? attributes : void 0;
26963
27073
  };
26964
- const decode$j = (params2) => {
27074
+ const decode$k = (params2) => {
26965
27075
  const { cellMargins = {} } = params2.node.attrs || {};
26966
27076
  const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
26967
27077
  const newNode = {
26968
- name: XML_NODE_NAME$c,
27078
+ name: XML_NODE_NAME$d,
26969
27079
  type: "element",
26970
27080
  attributes: {},
26971
27081
  elements
@@ -26973,12 +27083,12 @@ const decode$j = (params2) => {
26973
27083
  return newNode;
26974
27084
  };
26975
27085
  const propertyTranslators$1 = [
26976
- translator$r,
26977
- translator$p,
26978
- translator$l,
26979
- translator$j,
26980
- translator$h,
26981
- translator$f
27086
+ translator$s,
27087
+ translator$q,
27088
+ translator$m,
27089
+ translator$k,
27090
+ translator$i,
27091
+ translator$g
26982
27092
  ];
26983
27093
  const propertyTranslatorsByXmlName$1 = {};
26984
27094
  const propertyTranslatorsBySdName$1 = {};
@@ -26986,27 +27096,27 @@ propertyTranslators$1.forEach((translator2) => {
26986
27096
  propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
26987
27097
  propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
26988
27098
  });
26989
- const translator$d = NodeTranslator.from({
26990
- xmlName: XML_NODE_NAME$c,
27099
+ const translator$e = NodeTranslator.from({
27100
+ xmlName: XML_NODE_NAME$d,
26991
27101
  sdNodeOrKeyName: SD_ATTR_KEY$2,
26992
27102
  type: NodeTranslator.translatorTypes.NODE,
26993
27103
  attributes: [],
26994
- encode: encode$j,
26995
- decode: decode$j
27104
+ encode: encode$k,
27105
+ decode: decode$k
26996
27106
  });
26997
- const XML_NODE_NAME$b = "w:tblPr";
27107
+ const XML_NODE_NAME$c = "w:tblPr";
26998
27108
  const SD_ATTR_KEY$1 = "tableProperties";
26999
- const encode$i = (params2) => {
27109
+ const encode$j = (params2) => {
27000
27110
  const { nodes } = params2;
27001
27111
  const node = nodes[0];
27002
27112
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
27003
27113
  return {
27004
- xmlName: XML_NODE_NAME$b,
27114
+ xmlName: XML_NODE_NAME$c,
27005
27115
  sdNodeOrKeyName: SD_ATTR_KEY$1,
27006
27116
  attributes
27007
27117
  };
27008
27118
  };
27009
- const decode$i = (params2) => {
27119
+ const decode$j = (params2) => {
27010
27120
  const { tableProperties = {} } = params2.node.attrs || {};
27011
27121
  const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
27012
27122
  const newNode = {
@@ -27018,11 +27128,12 @@ const decode$i = (params2) => {
27018
27128
  return newNode;
27019
27129
  };
27020
27130
  const propertyTranslators = [
27131
+ translator$G,
27132
+ translator$O,
27021
27133
  translator$F,
27022
- translator$N,
27023
27134
  translator$E,
27135
+ translator$N,
27024
27136
  translator$D,
27025
- translator$M,
27026
27137
  translator$C,
27027
27138
  translator$B,
27028
27139
  translator$A,
@@ -27032,9 +27143,8 @@ const propertyTranslators = [
27032
27143
  translator$w,
27033
27144
  translator$v,
27034
27145
  translator$u,
27035
- translator$t,
27036
- translator$e,
27037
- translator$d
27146
+ translator$f,
27147
+ translator$e
27038
27148
  ];
27039
27149
  const propertyTranslatorsByXmlName = {};
27040
27150
  const propertyTranslatorsBySdName = {};
@@ -27042,14 +27152,14 @@ propertyTranslators.forEach((translator2) => {
27042
27152
  propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
27043
27153
  propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
27044
27154
  });
27045
- const config$b = {
27046
- xmlName: XML_NODE_NAME$b,
27155
+ const config$c = {
27156
+ xmlName: XML_NODE_NAME$c,
27047
27157
  sdNodeOrKeyName: SD_ATTR_KEY$1,
27048
- encode: encode$i,
27049
- decode: decode$i
27158
+ encode: encode$j,
27159
+ decode: decode$j
27050
27160
  };
27051
- const translator$c = NodeTranslator.from(config$b);
27052
- const translator$b = NodeTranslator.from(
27161
+ const translator$d = NodeTranslator.from(config$c);
27162
+ const translator$c = NodeTranslator.from(
27053
27163
  createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
27054
27164
  );
27055
27165
  const DEFAULT_COLUMN_WIDTH_PX = 100;
@@ -27099,20 +27209,20 @@ const resolveFallbackColumnWidthTwips = (params2, totalColumns, cellMinWidthTwip
27099
27209
  }
27100
27210
  return Math.max(fallbackWidthTwips, cellMinWidthTwips);
27101
27211
  };
27102
- const XML_NODE_NAME$a = "w:tblGrid";
27212
+ const XML_NODE_NAME$b = "w:tblGrid";
27103
27213
  const SD_ATTR_KEY = "grid";
27104
27214
  const cellMinWidth = pixelsToTwips(10);
27105
- const encode$h = (params2) => {
27215
+ const encode$i = (params2) => {
27106
27216
  const { nodes } = params2;
27107
27217
  const node = nodes[0];
27108
- const attributes = encodeProperties(node, { [translator$b.xmlName]: translator$b }, true);
27218
+ const attributes = encodeProperties(node, { [translator$c.xmlName]: translator$c }, true);
27109
27219
  return {
27110
- xmlName: XML_NODE_NAME$a,
27220
+ xmlName: XML_NODE_NAME$b,
27111
27221
  sdNodeOrKeyName: SD_ATTR_KEY,
27112
27222
  attributes
27113
27223
  };
27114
27224
  };
27115
- const decode$h = (params2) => {
27225
+ const decode$i = (params2) => {
27116
27226
  const { grid: rawGrid } = params2.node.attrs || {};
27117
27227
  const grid = Array.isArray(rawGrid) ? rawGrid : [];
27118
27228
  const { firstRow = {} } = params2.extraParams || {};
@@ -27131,10 +27241,10 @@ const decode$h = (params2) => {
27131
27241
  numericWidth = fallbackColumnWidthTwips;
27132
27242
  }
27133
27243
  numericWidth = Math.max(numericWidth, cellMinWidth);
27134
- const decoded = translator$b.decode({
27244
+ const decoded = translator$c.decode({
27135
27245
  node: { type: (
27136
27246
  /** @type {string} */
27137
- translator$b.sdNodeOrKeyName
27247
+ translator$c.sdNodeOrKeyName
27138
27248
  ), attrs: { col: numericWidth } }
27139
27249
  });
27140
27250
  if (decoded) elements.push(decoded);
@@ -27169,19 +27279,19 @@ const decode$h = (params2) => {
27169
27279
  columnIndex++;
27170
27280
  }
27171
27281
  const newNode = {
27172
- name: XML_NODE_NAME$a,
27282
+ name: XML_NODE_NAME$b,
27173
27283
  attributes: {},
27174
27284
  elements
27175
27285
  };
27176
27286
  return newNode;
27177
27287
  };
27178
- const config$a = {
27179
- xmlName: XML_NODE_NAME$a,
27288
+ const config$b = {
27289
+ xmlName: XML_NODE_NAME$b,
27180
27290
  sdNodeOrKeyName: SD_ATTR_KEY,
27181
- encode: encode$h,
27182
- decode: decode$h
27291
+ encode: encode$i,
27292
+ decode: decode$i
27183
27293
  };
27184
- const translator$a = NodeTranslator.from(config$a);
27294
+ const translator$b = NodeTranslator.from(config$b);
27185
27295
  const DEFAULT_PAGE_WIDTH_TWIPS = 12240;
27186
27296
  const DEFAULT_PAGE_MARGIN_TWIPS = 1440;
27187
27297
  const DEFAULT_CONTENT_WIDTH_TWIPS = DEFAULT_PAGE_WIDTH_TWIPS - 2 * DEFAULT_PAGE_MARGIN_TWIPS;
@@ -27244,19 +27354,19 @@ const buildFallbackGridForTable = ({ params: params2, rows, tableWidth, tableWid
27244
27354
  columnWidths: Array(columnCount).fill(fallbackColumnWidthPx)
27245
27355
  };
27246
27356
  };
27247
- const XML_NODE_NAME$9 = "w:tbl";
27248
- const SD_NODE_NAME$9 = "table";
27249
- const encode$g = (params2, encodedAttrs) => {
27357
+ const XML_NODE_NAME$a = "w:tbl";
27358
+ const SD_NODE_NAME$a = "table";
27359
+ const encode$h = (params2, encodedAttrs) => {
27250
27360
  const { nodes } = params2;
27251
27361
  const node = nodes[0];
27252
27362
  const tblPr = node.elements.find((el) => el.name === "w:tblPr");
27253
27363
  if (tblPr) {
27254
- const encodedProperties = translator$c.encode({ ...params2, nodes: [tblPr] });
27364
+ const encodedProperties = translator$d.encode({ ...params2, nodes: [tblPr] });
27255
27365
  encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
27256
27366
  }
27257
27367
  const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
27258
27368
  if (tblGrid) {
27259
- encodedAttrs["grid"] = translator$a.encode({ ...params2, nodes: [tblGrid] }).attributes;
27369
+ encodedAttrs["grid"] = translator$b.encode({ ...params2, nodes: [tblGrid] }).attributes;
27260
27370
  }
27261
27371
  [
27262
27372
  "tableStyleId",
@@ -27323,7 +27433,7 @@ const encode$g = (params2, encodedAttrs) => {
27323
27433
  }
27324
27434
  const content = [];
27325
27435
  rows.forEach((row) => {
27326
- const result = translator$G.encode({
27436
+ const result = translator$H.encode({
27327
27437
  ...params2,
27328
27438
  nodes: [row],
27329
27439
  extraParams: {
@@ -27342,13 +27452,13 @@ const encode$g = (params2, encodedAttrs) => {
27342
27452
  attrs: encodedAttrs
27343
27453
  };
27344
27454
  };
27345
- const decode$g = (params2, decodedAttrs) => {
27455
+ const decode$h = (params2, decodedAttrs) => {
27346
27456
  params2.node = preProcessVerticalMergeCells(params2.node, params2);
27347
27457
  const { node } = params2;
27348
27458
  const elements = translateChildNodes(params2);
27349
27459
  const firstRow = node.content?.find((n) => n.type === "tableRow");
27350
27460
  const properties = node.attrs.grid;
27351
- const element = translator$a.decode({
27461
+ const element = translator$b.decode({
27352
27462
  ...params2,
27353
27463
  node: { ...node, attrs: { ...node.attrs, grid: properties } },
27354
27464
  extraParams: {
@@ -27358,7 +27468,7 @@ const decode$g = (params2, decodedAttrs) => {
27358
27468
  if (element) elements.unshift(element);
27359
27469
  if (node.attrs?.tableProperties) {
27360
27470
  const properties2 = { ...node.attrs.tableProperties };
27361
- const element2 = translator$c.decode({
27471
+ const element2 = translator$d.decode({
27362
27472
  ...params2,
27363
27473
  node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
27364
27474
  });
@@ -27424,7 +27534,7 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
27424
27534
  if (baseTblPr && baseTblPr.elements) {
27425
27535
  tblPr.elements.push(...baseTblPr.elements);
27426
27536
  }
27427
- const tableProperties = translator$c.encode({ ...params2, nodes: [tblPr] }).attributes;
27537
+ const tableProperties = translator$d.encode({ ...params2, nodes: [tblPr] }).attributes;
27428
27538
  const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
27429
27539
  if (borders) stylesToReturn.borders = borders;
27430
27540
  if (rowBorders) stylesToReturn.rowBorders = rowBorders;
@@ -27441,16 +27551,16 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
27441
27551
  }
27442
27552
  return stylesToReturn;
27443
27553
  }
27444
- const config$9 = {
27445
- xmlName: XML_NODE_NAME$9,
27446
- sdNodeOrKeyName: SD_NODE_NAME$9,
27554
+ const config$a = {
27555
+ xmlName: XML_NODE_NAME$a,
27556
+ sdNodeOrKeyName: SD_NODE_NAME$a,
27447
27557
  type: NodeTranslator.translatorTypes.NODE,
27448
- encode: encode$g,
27449
- decode: decode$g,
27558
+ encode: encode$h,
27559
+ decode: decode$h,
27450
27560
  attributes: []
27451
27561
  };
27452
- const translator$9 = NodeTranslator.from(config$9);
27453
- const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$9);
27562
+ const translator$a = NodeTranslator.from(config$a);
27563
+ const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$a);
27454
27564
  function getReferencedTableStyles(tblStyleTag, docx) {
27455
27565
  if (!tblStyleTag) return null;
27456
27566
  const stylesToReturn = {};
@@ -27812,10 +27922,10 @@ function generateCellMargins(cellMargins) {
27812
27922
  if (left2 != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left2) } });
27813
27923
  return elements;
27814
27924
  }
27815
- const XML_NODE_NAME$8 = "w:tc";
27816
- const SD_NODE_NAME$8 = "tableCell";
27817
- const validXmlAttributes$8 = [];
27818
- function encode$f(params2, encodedAttrs) {
27925
+ const XML_NODE_NAME$9 = "w:tc";
27926
+ const SD_NODE_NAME$9 = "tableCell";
27927
+ const validXmlAttributes$7 = [];
27928
+ function encode$g(params2, encodedAttrs) {
27819
27929
  const {
27820
27930
  node,
27821
27931
  table,
@@ -27842,162 +27952,22 @@ function encode$f(params2, encodedAttrs) {
27842
27952
  }
27843
27953
  return schemaNode;
27844
27954
  }
27845
- function decode$f(params2, decodedAttrs) {
27955
+ function decode$g(params2, decodedAttrs) {
27846
27956
  const translated = translateTableCell(params2);
27847
27957
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
27848
27958
  translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
27849
27959
  }
27850
27960
  return translated;
27851
27961
  }
27852
- const config$8 = {
27853
- xmlName: XML_NODE_NAME$8,
27854
- sdNodeOrKeyName: SD_NODE_NAME$8,
27855
- type: NodeTranslator.translatorTypes.NODE,
27856
- encode: encode$f,
27857
- decode: decode$f,
27858
- attributes: validXmlAttributes$8
27859
- };
27860
- const translator$8 = NodeTranslator.from(config$8);
27861
- const XML_NODE_NAME$7 = "w:hyperlink";
27862
- const SD_NODE_NAME$7 = "link";
27863
- const _createAttributeHandler = (xmlName, sdName) => ({
27864
- xmlName,
27865
- sdName,
27866
- encode: (attributes) => attributes[xmlName],
27867
- decode: (attributes) => attributes[sdName]
27868
- });
27869
- const validXmlAttributes$7 = [
27870
- _createAttributeHandler("w:anchor", "anchor"),
27871
- _createAttributeHandler("w:docLocation", "docLocation"),
27872
- {
27873
- xmlName: "w:history",
27874
- sdName: "history",
27875
- encode: (attributes) => attributes["w:history"] === "1" || attributes["w:history"] === "true",
27876
- decode: (attributes) => attributes["history"] ? "1" : "0"
27877
- },
27878
- _createAttributeHandler("w:tooltip", "tooltip"),
27879
- _createAttributeHandler("r:id", "rId"),
27880
- _createAttributeHandler("w:tgtFrame", "target")
27881
- ];
27882
- const encode$e = (params2, encodedAttrs) => {
27883
- const { nodes, docx, nodeListHandler } = params2;
27884
- const node = nodes[0];
27885
- let href = _resolveHref(docx, encodedAttrs);
27886
- const linkMark = { attrs: { ...encodedAttrs, href } };
27887
- const runNodes = node.elements.filter((el) => el.name === "w:r");
27888
- runNodes.forEach((runNode) => {
27889
- const existingRunMarks = Array.isArray(runNode.marks) ? runNode.marks : [];
27890
- const runMarksWithoutLink = existingRunMarks.filter((mark) => mark?.type !== "link");
27891
- runNode.marks = runMarksWithoutLink;
27892
- });
27893
- const updatedNode = nodeListHandler.handler({
27894
- ...params2,
27895
- nodes: runNodes,
27896
- path: [...params2.path || [], node]
27897
- });
27898
- const cloneMark2 = (mark) => {
27899
- if (!mark || typeof mark !== "object") return mark;
27900
- if (!mark.attrs) return { ...mark };
27901
- return { ...mark, attrs: { ...mark.attrs } };
27902
- };
27903
- const ensureLinkMark = (child) => {
27904
- if (!child || typeof child !== "object") return child;
27905
- if (Array.isArray(child.content)) {
27906
- const updatedContent = child.content.map((item) => ensureLinkMark(item));
27907
- if (updatedContent !== child.content) {
27908
- child = { ...child, content: updatedContent };
27909
- }
27910
- }
27911
- if (child.type === "run") {
27912
- const existingMarks2 = Array.isArray(child.marks) ? child.marks : [];
27913
- const filteredMarks = existingMarks2.filter((mark) => mark?.type !== "link").map((mark) => cloneMark2(mark));
27914
- if (filteredMarks.length !== existingMarks2.length) {
27915
- if (filteredMarks.length) child = { ...child, marks: filteredMarks };
27916
- else {
27917
- const { marks: _removedMarks, ...rest } = child;
27918
- child = rest;
27919
- }
27920
- }
27921
- return child;
27922
- }
27923
- if (child.type !== "text") return child;
27924
- const existingMarks = Array.isArray(child.marks) ? child.marks.map((mark) => cloneMark2(mark)) : [];
27925
- const hasLink = existingMarks.some((mark) => mark?.type === "link");
27926
- if (hasLink) return child;
27927
- const linkClone = { type: "link", attrs: { ...linkMark.attrs } };
27928
- return { ...child, marks: [...existingMarks, linkClone] };
27929
- };
27930
- if (!Array.isArray(updatedNode)) return updatedNode;
27931
- return updatedNode.map((child) => ensureLinkMark(child));
27932
- };
27933
- const _resolveHref = (docx, encodedAttrs) => {
27934
- const rels = docx["word/_rels/document.xml.rels"];
27935
- const relationships = rels.elements.find((el) => el.name === "Relationships");
27936
- const { elements } = relationships;
27937
- const { rId, anchor } = encodedAttrs;
27938
- let href;
27939
- if (!rId && anchor) {
27940
- href = `#${anchor}`;
27941
- } else if (rId) {
27942
- const rel = elements.find((el) => el.attributes["Id"] === rId) || {};
27943
- const { attributes: relAttributes = {} } = rel;
27944
- href = relAttributes["Target"];
27945
- }
27946
- return href;
27947
- };
27948
- function decode$e(params2) {
27949
- const { node } = params2;
27950
- const linkMark = node.marks.find((m2) => m2.type === "link");
27951
- const linkAttrs = this.decodeAttributes({ ...params2, node: linkMark });
27952
- let { anchor, href: link } = linkMark.attrs;
27953
- const isExternalLink = !anchor;
27954
- if (isExternalLink) {
27955
- linkAttrs["r:id"] = _addNewLinkRelationship(params2, link, linkAttrs["r:id"]);
27956
- }
27957
- node.marks = node.marks.filter((m2) => m2.type !== "link");
27958
- const outputNode = exportSchemaToJson({ ...params2, node });
27959
- const newNode = {
27960
- name: "w:hyperlink",
27961
- type: "element",
27962
- attributes: {
27963
- ...linkAttrs
27964
- },
27965
- elements: [outputNode]
27966
- };
27967
- return newNode;
27968
- }
27969
- function _addNewLinkRelationship(params2, link, rId) {
27970
- if (!rId) rId = generateDocxRandomId();
27971
- if (!params2.relationships || !Array.isArray(params2.relationships)) {
27972
- params2.relationships = [];
27973
- }
27974
- const existingRel = params2.relationships.find(
27975
- (rel) => rel.attributes && rel.attributes.Id === rId && rel.attributes.Target === link
27976
- );
27977
- if (existingRel) {
27978
- return rId;
27979
- }
27980
- params2.relationships.push({
27981
- type: "element",
27982
- name: "Relationship",
27983
- attributes: {
27984
- Id: rId,
27985
- Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
27986
- Target: link,
27987
- TargetMode: "External"
27988
- }
27989
- });
27990
- return rId;
27991
- }
27992
- const config$7 = {
27993
- xmlName: XML_NODE_NAME$7,
27994
- sdNodeOrKeyName: SD_NODE_NAME$7,
27962
+ const config$9 = {
27963
+ xmlName: XML_NODE_NAME$9,
27964
+ sdNodeOrKeyName: SD_NODE_NAME$9,
27995
27965
  type: NodeTranslator.translatorTypes.NODE,
27996
- encode: encode$e,
27997
- decode: decode$e,
27966
+ encode: encode$g,
27967
+ decode: decode$g,
27998
27968
  attributes: validXmlAttributes$7
27999
27969
  };
28000
- const translator$7 = NodeTranslator.from(config$7);
27970
+ const translator$9 = NodeTranslator.from(config$9);
28001
27971
  function parseTagValueJSON(json) {
28002
27972
  if (typeof json !== "string") {
28003
27973
  return {};
@@ -28133,12 +28103,32 @@ function handleDocPartObj(params2) {
28133
28103
  }
28134
28104
  const content = node?.elements.find((el) => el.name === "w:sdtContent");
28135
28105
  const handler2 = validGalleryTypeMap[docPartGalleryType];
28136
- const result = handler2({ ...params2, nodes: [content] });
28106
+ const result = handler2({
28107
+ ...params2,
28108
+ nodes: [content],
28109
+ extraParams: { ...params2.extraParams || {}, sdtPr }
28110
+ });
28137
28111
  return result;
28138
28112
  }
28139
28113
  const tableOfContentsHandler = (params2) => {
28140
28114
  const node = params2.nodes[0];
28141
- return params2.nodeListHandler.handler({ ...params2, nodes: node.elements });
28115
+ const translatedContent = params2.nodeListHandler.handler({
28116
+ ...params2,
28117
+ nodes: node.elements,
28118
+ path: [...params2.path || [], node]
28119
+ });
28120
+ const sdtPr = params2.extraParams.sdtPr;
28121
+ const id = sdtPr.elements?.find((el) => el.name === "w:id")?.attributes["w:val"] || "";
28122
+ const result = {
28123
+ type: "documentPartObject",
28124
+ content: translatedContent,
28125
+ attrs: {
28126
+ id,
28127
+ docPartGallery: "Table of Contents",
28128
+ docPartUnique: true
28129
+ }
28130
+ };
28131
+ return result;
28142
28132
  };
28143
28133
  const validGalleryTypeMap = {
28144
28134
  "Table of Contents": tableOfContentsHandler
@@ -28796,32 +28786,32 @@ function translateAnchorNode(params2) {
28796
28786
  elements: [...anchorElements, ...elementsWithWrap]
28797
28787
  };
28798
28788
  }
28799
- const XML_NODE_NAME$6 = "wp:anchor";
28800
- const SD_NODE_NAME$6 = ["image"];
28789
+ const XML_NODE_NAME$8 = "wp:anchor";
28790
+ const SD_NODE_NAME$8 = ["image"];
28801
28791
  const validXmlAttributes$6 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28802
- function encode$d(params2) {
28792
+ function encode$f(params2) {
28803
28793
  const { node } = params2.extraParams;
28804
28794
  if (!node || !node.type) {
28805
28795
  return null;
28806
28796
  }
28807
28797
  return handleAnchorNode(params2);
28808
28798
  }
28809
- function decode$d(params2) {
28799
+ function decode$f(params2) {
28810
28800
  const { node } = params2;
28811
28801
  if (!node || !node.type) {
28812
28802
  return null;
28813
28803
  }
28814
28804
  return translateAnchorNode(params2);
28815
28805
  }
28816
- const config$6 = {
28817
- xmlName: XML_NODE_NAME$6,
28818
- sdNodeOrKeyName: SD_NODE_NAME$6,
28806
+ const config$8 = {
28807
+ xmlName: XML_NODE_NAME$8,
28808
+ sdNodeOrKeyName: SD_NODE_NAME$8,
28819
28809
  type: NodeTranslator.translatorTypes.NODE,
28820
- encode: encode$d,
28821
- decode: decode$d,
28810
+ encode: encode$f,
28811
+ decode: decode$f,
28822
28812
  attributes: validXmlAttributes$6
28823
28813
  };
28824
- const translator$6 = NodeTranslator.from(config$6);
28814
+ const translator$8 = NodeTranslator.from(config$8);
28825
28815
  function handleInlineNode(params2) {
28826
28816
  const { node } = params2.extraParams;
28827
28817
  if (node.name !== "wp:inline") {
@@ -28837,41 +28827,41 @@ function translateInlineNode(params2) {
28837
28827
  elements: nodeElements.elements
28838
28828
  };
28839
28829
  }
28840
- const XML_NODE_NAME$5 = "wp:inline";
28841
- const SD_NODE_NAME$5 = ["image"];
28830
+ const XML_NODE_NAME$7 = "wp:inline";
28831
+ const SD_NODE_NAME$7 = ["image"];
28842
28832
  const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28843
- function encode$c(params2) {
28833
+ function encode$e(params2) {
28844
28834
  const { node } = params2.extraParams;
28845
28835
  if (!node || !node.type) {
28846
28836
  return null;
28847
28837
  }
28848
28838
  return handleInlineNode(params2);
28849
28839
  }
28850
- function decode$c(params2) {
28840
+ function decode$e(params2) {
28851
28841
  const { node } = params2;
28852
28842
  if (!node || !node.type) {
28853
28843
  return null;
28854
28844
  }
28855
28845
  return translateInlineNode(params2);
28856
28846
  }
28857
- const config$5 = {
28858
- xmlName: XML_NODE_NAME$5,
28859
- sdNodeOrKeyName: SD_NODE_NAME$5,
28847
+ const config$7 = {
28848
+ xmlName: XML_NODE_NAME$7,
28849
+ sdNodeOrKeyName: SD_NODE_NAME$7,
28860
28850
  type: NodeTranslator.translatorTypes.NODE,
28861
- encode: encode$c,
28862
- decode: decode$c,
28851
+ encode: encode$e,
28852
+ decode: decode$e,
28863
28853
  attributes: validXmlAttributes$5
28864
28854
  };
28865
- const translator$5 = NodeTranslator.from(config$5);
28866
- const XML_NODE_NAME$4 = "w:drawing";
28867
- const SD_NODE_NAME$4 = [];
28855
+ const translator$7 = NodeTranslator.from(config$7);
28856
+ const XML_NODE_NAME$6 = "w:drawing";
28857
+ const SD_NODE_NAME$6 = [];
28868
28858
  const validXmlAttributes$4 = [];
28869
- function encode$b(params2) {
28859
+ function encode$d(params2) {
28870
28860
  const nodes = params2.nodes;
28871
28861
  const node = nodes[0];
28872
28862
  const translatorByChildName = {
28873
- "wp:anchor": translator$6,
28874
- "wp:inline": translator$5
28863
+ "wp:anchor": translator$8,
28864
+ "wp:inline": translator$7
28875
28865
  };
28876
28866
  return node.elements.reduce((acc, child) => {
28877
28867
  if (acc) return acc;
@@ -28880,12 +28870,12 @@ function encode$b(params2) {
28880
28870
  return translator2.encode({ ...params2, extraParams: { node: child } }) || acc;
28881
28871
  }, null);
28882
28872
  }
28883
- function decode$b(params2) {
28873
+ function decode$d(params2) {
28884
28874
  const { node } = params2;
28885
28875
  if (!node || !node.type) {
28886
28876
  return null;
28887
28877
  }
28888
- const childTranslator = node.attrs.isAnchor ? translator$6 : translator$5;
28878
+ const childTranslator = node.attrs.isAnchor ? translator$8 : translator$7;
28889
28879
  const resultNode = childTranslator.decode(params2);
28890
28880
  return wrapTextInRun(
28891
28881
  {
@@ -28895,15 +28885,15 @@ function decode$b(params2) {
28895
28885
  []
28896
28886
  );
28897
28887
  }
28898
- const config$4 = {
28899
- xmlName: XML_NODE_NAME$4,
28900
- sdNodeOrKeyName: SD_NODE_NAME$4,
28888
+ const config$6 = {
28889
+ xmlName: XML_NODE_NAME$6,
28890
+ sdNodeOrKeyName: SD_NODE_NAME$6,
28901
28891
  type: NodeTranslator.translatorTypes.NODE,
28902
- encode: encode$b,
28903
- decode: decode$b,
28892
+ encode: encode$d,
28893
+ decode: decode$d,
28904
28894
  attributes: validXmlAttributes$4
28905
28895
  };
28906
- const translator$4 = NodeTranslator.from(config$4);
28896
+ const translator$6 = NodeTranslator.from(config$6);
28907
28897
  class CommandService {
28908
28898
  /**
28909
28899
  * @param {import('./commands/types/index.js').CommandServiceOptions} props
@@ -30241,7 +30231,7 @@ function prepareTextAnnotation(params2) {
30241
30231
  return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
30242
30232
  }
30243
30233
  function prepareImageAnnotation(params2, imageSize) {
30244
- return translator$4.decode({
30234
+ return translator$6.decode({
30245
30235
  ...params2,
30246
30236
  imageSize
30247
30237
  });
@@ -30461,6 +30451,49 @@ const generateSdtPrTagForDocumentSection = (id, title, tag) => {
30461
30451
  ]
30462
30452
  };
30463
30453
  };
30454
+ function translateDocumentPartObj(params2) {
30455
+ const { node } = params2;
30456
+ const { attrs = {} } = node;
30457
+ const childContent = translateChildNodes({ ...params2, nodes: node.content });
30458
+ const nodeElements = [
30459
+ {
30460
+ name: "w:sdtPr",
30461
+ elements: [
30462
+ {
30463
+ name: "w:id",
30464
+ attributes: {
30465
+ "w:val": attrs.id
30466
+ }
30467
+ },
30468
+ {
30469
+ name: "w:docPartObj",
30470
+ elements: [
30471
+ {
30472
+ name: "w:docPartGallery",
30473
+ attributes: {
30474
+ "w:val": attrs.docPartGallery
30475
+ }
30476
+ },
30477
+ ...attrs.docPartUnique ? [
30478
+ {
30479
+ name: "w:docPartUnique"
30480
+ }
30481
+ ] : []
30482
+ ]
30483
+ }
30484
+ ]
30485
+ },
30486
+ {
30487
+ name: "w:sdtContent",
30488
+ elements: childContent
30489
+ }
30490
+ ];
30491
+ const result = {
30492
+ name: "w:sdt",
30493
+ elements: nodeElements
30494
+ };
30495
+ return result;
30496
+ }
30464
30497
  function translateStructuredContent(params2) {
30465
30498
  const { node } = params2;
30466
30499
  const childContent = translateChildNodes({ ...params2, nodes: node.content });
@@ -30512,10 +30545,10 @@ function generateSdtPrTagForStructuredContent({ node }) {
30512
30545
  };
30513
30546
  return result;
30514
30547
  }
30515
- const XML_NODE_NAME$3 = "w:sdt";
30516
- const SD_NODE_NAME$3 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
30548
+ const XML_NODE_NAME$5 = "w:sdt";
30549
+ const SD_NODE_NAME$5 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
30517
30550
  const validXmlAttributes$3 = [];
30518
- function encode$a(params2) {
30551
+ function encode$c(params2) {
30519
30552
  const nodes = params2.nodes;
30520
30553
  const node = nodes[0];
30521
30554
  const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
@@ -30525,7 +30558,7 @@ function encode$a(params2) {
30525
30558
  const result = handler2(params2);
30526
30559
  return result;
30527
30560
  }
30528
- function decode$a(params2) {
30561
+ function decode$c(params2) {
30529
30562
  const { node } = params2;
30530
30563
  if (!node || !node.type) {
30531
30564
  return null;
@@ -30535,91 +30568,93 @@ function decode$a(params2) {
30535
30568
  structuredContent: () => translateStructuredContent(params2),
30536
30569
  structuredContentBlock: () => translateStructuredContent(params2),
30537
30570
  documentSection: () => translateDocumentSection(params2),
30571
+ documentPartObject: () => translateDocumentPartObj(params2),
30572
+ // Handled in doc-part-obj translator
30538
30573
  default: () => null
30539
30574
  };
30540
30575
  const decoder = types2[node.type] ?? types2.default;
30541
30576
  const result = decoder();
30542
30577
  return result;
30543
30578
  }
30544
- const config$3 = {
30545
- xmlName: XML_NODE_NAME$3,
30546
- sdNodeOrKeyName: SD_NODE_NAME$3,
30579
+ const config$5 = {
30580
+ xmlName: XML_NODE_NAME$5,
30581
+ sdNodeOrKeyName: SD_NODE_NAME$5,
30547
30582
  type: NodeTranslator.translatorTypes.NODE,
30548
- encode: encode$a,
30549
- decode: decode$a,
30583
+ encode: encode$c,
30584
+ decode: decode$c,
30550
30585
  attributes: validXmlAttributes$3
30551
30586
  };
30552
- const translator$3 = NodeTranslator.from(config$3);
30553
- const encode$9 = (attributes) => {
30587
+ const translator$5 = NodeTranslator.from(config$5);
30588
+ const encode$b = (attributes) => {
30554
30589
  return attributes["w:id"];
30555
30590
  };
30556
- const decode$9 = (attrs) => {
30591
+ const decode$b = (attrs) => {
30557
30592
  return attrs.id;
30558
30593
  };
30559
30594
  const attrConfig$6 = Object.freeze({
30560
30595
  xmlName: "w:id",
30561
30596
  sdName: "id",
30562
- encode: encode$9,
30563
- decode: decode$9
30597
+ encode: encode$b,
30598
+ decode: decode$b
30564
30599
  });
30565
- const encode$8 = (attributes) => {
30600
+ const encode$a = (attributes) => {
30566
30601
  return attributes["w:name"];
30567
30602
  };
30568
- const decode$8 = (attrs) => {
30603
+ const decode$a = (attrs) => {
30569
30604
  return attrs.name;
30570
30605
  };
30571
30606
  const attrConfig$5 = Object.freeze({
30572
30607
  xmlName: "w:name",
30573
30608
  sdName: "name",
30574
- encode: encode$8,
30575
- decode: decode$8
30609
+ encode: encode$a,
30610
+ decode: decode$a
30576
30611
  });
30577
- const encode$7 = (attributes) => {
30612
+ const encode$9 = (attributes) => {
30578
30613
  return attributes["w:colFirst"];
30579
30614
  };
30580
- const decode$7 = (attrs) => {
30615
+ const decode$9 = (attrs) => {
30581
30616
  return attrs.colFirst;
30582
30617
  };
30583
30618
  const attrConfig$4 = Object.freeze({
30584
30619
  xmlName: "w:colFirst",
30585
30620
  sdName: "colFirst",
30586
- encode: encode$7,
30587
- decode: decode$7
30621
+ encode: encode$9,
30622
+ decode: decode$9
30588
30623
  });
30589
- const encode$6 = (attributes) => {
30624
+ const encode$8 = (attributes) => {
30590
30625
  return attributes["w:colLast"];
30591
30626
  };
30592
- const decode$6 = (attrs) => {
30627
+ const decode$8 = (attrs) => {
30593
30628
  return attrs.colLast;
30594
30629
  };
30595
30630
  const attrConfig$3 = Object.freeze({
30596
30631
  xmlName: "w:colLast",
30597
30632
  sdName: "colLast",
30598
- encode: encode$6,
30599
- decode: decode$6
30633
+ encode: encode$8,
30634
+ decode: decode$8
30600
30635
  });
30601
- const encode$5 = (attributes) => {
30636
+ const encode$7 = (attributes) => {
30602
30637
  return attributes["w:displacedByCustomXml"];
30603
30638
  };
30604
- const decode$5 = (attrs) => {
30639
+ const decode$7 = (attrs) => {
30605
30640
  return attrs.displacedByCustomXml;
30606
30641
  };
30607
30642
  const attrConfig$2 = Object.freeze({
30608
30643
  xmlName: "w:displacedByCustomXml",
30609
30644
  sdName: "displacedByCustomXml",
30610
- encode: encode$5,
30611
- decode: decode$5
30645
+ encode: encode$7,
30646
+ decode: decode$7
30612
30647
  });
30613
30648
  const validXmlAttributes$2 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
30614
- const XML_NODE_NAME$2 = "w:bookmarkStart";
30615
- const SD_NODE_NAME$2 = "bookmarkStart";
30616
- const encode$4 = (params2, encodedAttrs = {}) => {
30649
+ const XML_NODE_NAME$4 = "w:bookmarkStart";
30650
+ const SD_NODE_NAME$4 = "bookmarkStart";
30651
+ const encode$6 = (params2, encodedAttrs = {}) => {
30617
30652
  return {
30618
30653
  type: "bookmarkStart",
30619
30654
  attrs: encodedAttrs
30620
30655
  };
30621
30656
  };
30622
- const decode$4 = (params2, decodedAttrs = {}) => {
30657
+ const decode$6 = (params2, decodedAttrs = {}) => {
30623
30658
  const result = {
30624
30659
  name: "w:bookmarkStart",
30625
30660
  elements: []
@@ -30629,49 +30664,49 @@ const decode$4 = (params2, decodedAttrs = {}) => {
30629
30664
  }
30630
30665
  return result;
30631
30666
  };
30632
- const config$2 = {
30633
- xmlName: XML_NODE_NAME$2,
30634
- sdNodeOrKeyName: SD_NODE_NAME$2,
30667
+ const config$4 = {
30668
+ xmlName: XML_NODE_NAME$4,
30669
+ sdNodeOrKeyName: SD_NODE_NAME$4,
30635
30670
  type: NodeTranslator.translatorTypes.NODE,
30636
- encode: encode$4,
30637
- decode: decode$4,
30671
+ encode: encode$6,
30672
+ decode: decode$6,
30638
30673
  attributes: validXmlAttributes$2
30639
30674
  };
30640
- const translator$2 = NodeTranslator.from(config$2);
30641
- const encode$3 = (attributes) => {
30675
+ const translator$4 = NodeTranslator.from(config$4);
30676
+ const encode$5 = (attributes) => {
30642
30677
  return attributes["w:id"];
30643
30678
  };
30644
- const decode$3 = (attrs) => {
30679
+ const decode$5 = (attrs) => {
30645
30680
  return attrs.id;
30646
30681
  };
30647
30682
  const attrConfig$1 = Object.freeze({
30648
30683
  xmlName: "w:id",
30649
30684
  sdName: "id",
30650
- encode: encode$3,
30651
- decode: decode$3
30685
+ encode: encode$5,
30686
+ decode: decode$5
30652
30687
  });
30653
- const encode$2 = (attributes) => {
30688
+ const encode$4 = (attributes) => {
30654
30689
  return attributes["w:displacedByCustomXml"];
30655
30690
  };
30656
- const decode$2 = (attrs) => {
30691
+ const decode$4 = (attrs) => {
30657
30692
  return attrs.displacedByCustomXml;
30658
30693
  };
30659
30694
  const attrConfig = Object.freeze({
30660
30695
  xmlName: "w:displacedByCustomXml",
30661
30696
  sdName: "displacedByCustomXml",
30662
- encode: encode$2,
30663
- decode: decode$2
30697
+ encode: encode$4,
30698
+ decode: decode$4
30664
30699
  });
30665
30700
  const validXmlAttributes$1 = [attrConfig$1, attrConfig];
30666
- const XML_NODE_NAME$1 = "w:bookmarkEnd";
30667
- const SD_NODE_NAME$1 = "bookmarkEnd";
30668
- const encode$1 = (params2, encodedAttrs = {}) => {
30701
+ const XML_NODE_NAME$3 = "w:bookmarkEnd";
30702
+ const SD_NODE_NAME$3 = "bookmarkEnd";
30703
+ const encode$3 = (params2, encodedAttrs = {}) => {
30669
30704
  return {
30670
30705
  type: "bookmarkEnd",
30671
30706
  attrs: encodedAttrs
30672
30707
  };
30673
30708
  };
30674
- const decode$1 = (params2, decodedAttrs = {}) => {
30709
+ const decode$3 = (params2, decodedAttrs = {}) => {
30675
30710
  const result = {
30676
30711
  name: "w:bookmarkEnd",
30677
30712
  elements: []
@@ -30681,19 +30716,19 @@ const decode$1 = (params2, decodedAttrs = {}) => {
30681
30716
  }
30682
30717
  return result;
30683
30718
  };
30684
- const config$1 = {
30685
- xmlName: XML_NODE_NAME$1,
30686
- sdNodeOrKeyName: SD_NODE_NAME$1,
30719
+ const config$3 = {
30720
+ xmlName: XML_NODE_NAME$3,
30721
+ sdNodeOrKeyName: SD_NODE_NAME$3,
30687
30722
  type: NodeTranslator.translatorTypes.NODE,
30688
- encode: encode$1,
30689
- decode: decode$1,
30723
+ encode: encode$3,
30724
+ decode: decode$3,
30690
30725
  attributes: validXmlAttributes$1
30691
30726
  };
30692
- const translator$1 = NodeTranslator.from(config$1);
30693
- const XML_NODE_NAME = "mc:AlternateContent";
30694
- const SD_NODE_NAME = [];
30727
+ const translator$3 = NodeTranslator.from(config$3);
30728
+ const XML_NODE_NAME$2 = "mc:AlternateContent";
30729
+ const SD_NODE_NAME$2 = [];
30695
30730
  const validXmlAttributes = [];
30696
- function encode$19(params2) {
30731
+ function encode$2(params2) {
30697
30732
  const { nodeListHandler } = params2;
30698
30733
  const { node } = params2.extraParams;
30699
30734
  if (!node || !node.type) {
@@ -30713,7 +30748,7 @@ function encode$19(params2) {
30713
30748
  path: [...params2.path || [], wpsNode]
30714
30749
  });
30715
30750
  }
30716
- function decode(params2) {
30751
+ function decode$2(params2) {
30717
30752
  const { node } = params2;
30718
30753
  const { drawingContent } = node.attrs;
30719
30754
  const drawing = {
@@ -30730,13 +30765,186 @@ function decode(params2) {
30730
30765
  elements: [choice]
30731
30766
  };
30732
30767
  }
30768
+ const config$2 = {
30769
+ xmlName: XML_NODE_NAME$2,
30770
+ sdNodeOrKeyName: SD_NODE_NAME$2,
30771
+ type: NodeTranslator.translatorTypes.NODE,
30772
+ encode: encode$2,
30773
+ decode: decode$2,
30774
+ attributes: validXmlAttributes
30775
+ };
30776
+ const translator$2 = NodeTranslator.from(config$2);
30777
+ const XML_NODE_NAME$1 = "sd:pageReference";
30778
+ const SD_NODE_NAME$1 = "pageReference";
30779
+ const encode$1 = (params2, _2) => {
30780
+ const { nodes = [], nodeListHandler } = params2 || {};
30781
+ const node = nodes[0];
30782
+ const processedText = nodeListHandler.handler({
30783
+ ...params2,
30784
+ nodes: node.elements
30785
+ });
30786
+ const processedNode = {
30787
+ type: "pageReference",
30788
+ attrs: {
30789
+ instruction: node.attributes?.instruction || "",
30790
+ marksAsAttrs: node.marks || []
30791
+ },
30792
+ content: processedText
30793
+ };
30794
+ return processedNode;
30795
+ };
30796
+ const decode$1 = (params2, _2) => {
30797
+ const { node } = params2;
30798
+ const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
30799
+ const contentNodes = (node.content ?? []).flatMap((n) => exportSchemaToJson({ ...params2, node: n }));
30800
+ const translated = [
30801
+ {
30802
+ name: "w:r",
30803
+ elements: [
30804
+ {
30805
+ name: "w:rPr",
30806
+ elements: outputMarks
30807
+ },
30808
+ {
30809
+ name: "w:fldChar",
30810
+ attributes: {
30811
+ "w:fldCharType": "begin"
30812
+ }
30813
+ }
30814
+ ]
30815
+ },
30816
+ {
30817
+ name: "w:r",
30818
+ elements: [
30819
+ {
30820
+ name: "w:rPr",
30821
+ elements: outputMarks
30822
+ },
30823
+ {
30824
+ name: "w:instrText",
30825
+ attributes: { "xml:space": "preserve" },
30826
+ elements: [
30827
+ {
30828
+ type: "text",
30829
+ text: `${node.attrs.instruction}`
30830
+ }
30831
+ ]
30832
+ }
30833
+ ]
30834
+ },
30835
+ {
30836
+ name: "w:r",
30837
+ elements: [
30838
+ {
30839
+ name: "w:rPr",
30840
+ elements: outputMarks
30841
+ },
30842
+ {
30843
+ name: "w:fldChar",
30844
+ attributes: {
30845
+ "w:fldCharType": "separate"
30846
+ }
30847
+ }
30848
+ ]
30849
+ },
30850
+ ...contentNodes,
30851
+ {
30852
+ name: "w:r",
30853
+ elements: [
30854
+ {
30855
+ name: "w:rPr",
30856
+ elements: outputMarks
30857
+ },
30858
+ {
30859
+ name: "w:fldChar",
30860
+ attributes: {
30861
+ "w:fldCharType": "end"
30862
+ }
30863
+ }
30864
+ ]
30865
+ }
30866
+ ];
30867
+ return translated;
30868
+ };
30869
+ const config$1 = {
30870
+ xmlName: XML_NODE_NAME$1,
30871
+ sdNodeOrKeyName: SD_NODE_NAME$1,
30872
+ type: NodeTranslator.translatorTypes.NODE,
30873
+ encode: encode$1,
30874
+ decode: decode$1
30875
+ };
30876
+ const translator$1 = NodeTranslator.from(config$1);
30877
+ const XML_NODE_NAME = "sd:tableOfContents";
30878
+ const SD_NODE_NAME = "tableOfContents";
30879
+ const encode$1c = (params2, _2) => {
30880
+ const { nodes = [], nodeListHandler } = params2 || {};
30881
+ const node = nodes[0];
30882
+ const processedContent = nodeListHandler.handler({
30883
+ ...params2,
30884
+ nodes: node.elements || []
30885
+ });
30886
+ const processedNode = {
30887
+ type: "tableOfContents",
30888
+ attrs: {
30889
+ instruction: node.attributes?.instruction || ""
30890
+ },
30891
+ content: processedContent
30892
+ };
30893
+ return processedNode;
30894
+ };
30895
+ const decode = (params2, _2) => {
30896
+ const { node } = params2;
30897
+ const contentNodes = node.content.map((n) => exportSchemaToJson({ ...params2, node: n }));
30898
+ const tocBeginElements = [
30899
+ {
30900
+ name: "w:r",
30901
+ elements: [{ name: "w:fldChar", attributes: { "w:fldCharType": "begin" }, elements: [] }]
30902
+ },
30903
+ {
30904
+ name: "w:r",
30905
+ elements: [
30906
+ {
30907
+ name: "w:instrText",
30908
+ attributes: { "xml:space": "preserve" },
30909
+ elements: [{ text: node.attrs?.instruction || "", type: "text", name: "#text", elements: [] }]
30910
+ }
30911
+ ]
30912
+ },
30913
+ { name: "w:r", elements: [{ name: "w:fldChar", attributes: { "w:fldCharType": "separate" }, elements: [] }] }
30914
+ ];
30915
+ if (contentNodes.length > 0) {
30916
+ const firstParagraph = contentNodes[0];
30917
+ let insertIndex = 0;
30918
+ if (firstParagraph.elements) {
30919
+ const pPrIndex = firstParagraph.elements.findIndex((el) => el.name === "w:pPr");
30920
+ insertIndex = pPrIndex >= 0 ? pPrIndex + 1 : 0;
30921
+ } else {
30922
+ firstParagraph.elements = [];
30923
+ }
30924
+ firstParagraph.elements.splice(insertIndex, 0, ...tocBeginElements);
30925
+ } else {
30926
+ contentNodes.push({
30927
+ name: "w:p",
30928
+ elements: tocBeginElements
30929
+ });
30930
+ }
30931
+ const tocEndElements = [
30932
+ { name: "w:r", elements: [{ name: "w:fldChar", attributes: { "w:fldCharType": "end" }, elements: [] }] }
30933
+ ];
30934
+ const lastParagraph = contentNodes[contentNodes.length - 1];
30935
+ if (lastParagraph.elements) {
30936
+ lastParagraph.elements.push(...tocEndElements);
30937
+ } else {
30938
+ lastParagraph.elements = [...tocEndElements];
30939
+ }
30940
+ return contentNodes;
30941
+ };
30733
30942
  const config = {
30734
30943
  xmlName: XML_NODE_NAME,
30735
30944
  sdNodeOrKeyName: SD_NODE_NAME,
30736
30945
  type: NodeTranslator.translatorTypes.NODE,
30737
- encode: encode$19,
30738
- decode,
30739
- attributes: validXmlAttributes
30946
+ encode: encode$1c,
30947
+ decode
30740
30948
  };
30741
30949
  const translator = NodeTranslator.from(config);
30742
30950
  const DEFAULT_SECTION_PROPS_TWIPS = Object.freeze({
@@ -30810,32 +31018,35 @@ function exportSchemaToJson(params2) {
30810
31018
  doc: translateDocumentNode,
30811
31019
  body: translateBodyNode,
30812
31020
  heading: translateHeadingNode,
30813
- paragraph: translator$13,
30814
- run: translator$U,
31021
+ paragraph: translator$16,
31022
+ run: translator$V,
30815
31023
  text: translateTextNode,
30816
31024
  bulletList: translateList,
30817
31025
  orderedList: translateList,
30818
- lineBreak: translator$16,
30819
- table: translator$9,
30820
- tableRow: translator$G,
30821
- tableCell: translator$8,
30822
- bookmarkStart: translator$2,
30823
- bookmarkEnd: translator$1,
30824
- fieldAnnotation: translator$3,
30825
- tab: translator$14,
30826
- image: translator$4,
30827
- hardBreak: translator$16,
31026
+ lineBreak: translator$19,
31027
+ table: translator$a,
31028
+ tableRow: translator$H,
31029
+ tableCell: translator$9,
31030
+ bookmarkStart: translator$4,
31031
+ bookmarkEnd: translator$3,
31032
+ fieldAnnotation: translator$5,
31033
+ tab: translator$17,
31034
+ image: translator$6,
31035
+ hardBreak: translator$19,
30828
31036
  commentRangeStart: () => translateCommentNode(params2, "Start"),
30829
31037
  commentRangeEnd: () => translateCommentNode(params2, "End"),
30830
31038
  commentReference: () => null,
30831
31039
  shapeContainer: translateShapeContainer,
30832
31040
  shapeTextbox: translateShapeTextbox,
30833
31041
  contentBlock: translateContentBlock,
30834
- structuredContent: translator$3,
30835
- structuredContentBlock: translator$3,
30836
- documentSection: translator$3,
31042
+ structuredContent: translator$5,
31043
+ structuredContentBlock: translator$5,
31044
+ documentPartObject: translator$5,
31045
+ documentSection: translator$5,
30837
31046
  "page-number": translatePageNumberNode,
30838
- "total-page-number": translateTotalPageNumberNode
31047
+ "total-page-number": translateTotalPageNumberNode,
31048
+ pageReference: translator$1,
31049
+ tableOfContents: translator
30839
31050
  };
30840
31051
  let handler2 = router[type2];
30841
31052
  if (handler2 && "decode" in handler2 && typeof handler2.decode === "function") {
@@ -31173,8 +31384,6 @@ function translateTextNode(params2) {
31173
31384
  const trackedMarks = [TrackInsertMarkName, TrackDeleteMarkName];
31174
31385
  const isTrackedNode = node.marks?.some((m2) => trackedMarks.includes(m2.type));
31175
31386
  if (isTrackedNode) return translateTrackedNode(params2);
31176
- const isLinkNode = node.marks?.some((m2) => m2.type === "link");
31177
- if (isLinkNode) return translator$7.decode(params2);
31178
31387
  const { text, marks = [] } = node;
31179
31388
  return getTextNodeForExport(text, marks, params2);
31180
31389
  }
@@ -31480,7 +31689,7 @@ function translateMark(mark) {
31480
31689
  markElement.type = "element";
31481
31690
  break;
31482
31691
  case "underline": {
31483
- const translated = translator$10.decode({
31692
+ const translated = translator$13.decode({
31484
31693
  node: {
31485
31694
  attrs: {
31486
31695
  underlineType: attrs.underlineType ?? attrs.underline ?? null,
@@ -31544,7 +31753,7 @@ function translateMark(mark) {
31544
31753
  break;
31545
31754
  case "highlight": {
31546
31755
  const highlightValue = attrs.color ?? attrs.highlight ?? null;
31547
- const translated = translator$15.decode({ node: { attrs: { highlight: highlightValue } } });
31756
+ const translated = translator$18.decode({ node: { attrs: { highlight: highlightValue } } });
31548
31757
  return translated || {};
31549
31758
  }
31550
31759
  }
@@ -31604,7 +31813,7 @@ function translateContentBlock(params2) {
31604
31813
  if (vmlAttributes || horizontalRule) {
31605
31814
  return translateVRectContentBlock(params2);
31606
31815
  }
31607
- const alternateContent = translator.decode(params2);
31816
+ const alternateContent = translator$2.decode(params2);
31608
31817
  return wrapTextInRun(alternateContent);
31609
31818
  }
31610
31819
  function translateVRectContentBlock(params2) {
@@ -31750,6 +31959,7 @@ const getAutoPageJson = (type2, outputMarks = []) => {
31750
31959
  },
31751
31960
  {
31752
31961
  name: "w:instrText",
31962
+ attributes: { "xml:space": "preserve" },
31753
31963
  elements: [
31754
31964
  {
31755
31965
  type: "text",
@@ -31809,7 +32019,7 @@ const handleDrawingNode = (params2) => {
31809
32019
  if (mainNode.name === "w:drawing") node = mainNode;
31810
32020
  else node = mainNode.elements.find((el) => el.name === "w:drawing");
31811
32021
  if (!node) return { nodes: [], consumed: 0 };
31812
- const schemaNode = translator$4.encode(params2);
32022
+ const schemaNode = translator$6.encode(params2);
31813
32023
  const newNodes = schemaNode ? [schemaNode] : [];
31814
32024
  return { nodes: newNodes, consumed: 1 };
31815
32025
  };
@@ -31911,8 +32121,8 @@ const trackChangeNodeHandlerEntity = {
31911
32121
  handlerName: "trackChangeNodeHandler",
31912
32122
  handler: handleTrackChangeNode
31913
32123
  };
31914
- const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$7);
31915
- const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$U);
32124
+ const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$W);
32125
+ const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$V);
31916
32126
  const handleTextNode = (params2) => {
31917
32127
  const { nodes, insideTrackChange } = params2;
31918
32128
  if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
@@ -31953,7 +32163,7 @@ const handleParagraphNode = (params2) => {
31953
32163
  if (nodes.length === 0 || nodes[0].name !== "w:p") {
31954
32164
  return { nodes: [], consumed: 0 };
31955
32165
  }
31956
- const schemaNode = translator$13.encode(params2);
32166
+ const schemaNode = translator$16.encode(params2);
31957
32167
  const newNodes = schemaNode ? [schemaNode] : [];
31958
32168
  return { nodes: newNodes, consumed: 1 };
31959
32169
  };
@@ -31966,7 +32176,7 @@ const handleSdtNode = (params2) => {
31966
32176
  if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
31967
32177
  return { nodes: [], consumed: 0 };
31968
32178
  }
31969
- const result = translator$3.encode(params2);
32179
+ const result = translator$5.encode(params2);
31970
32180
  if (!result) {
31971
32181
  return { nodes: [], consumed: 0 };
31972
32182
  }
@@ -32056,7 +32266,7 @@ const handler = (params2) => {
32056
32266
  if (nodes.length === 0 || nodes[0].name !== "w:br") {
32057
32267
  return { nodes: [], consumed: 0 };
32058
32268
  }
32059
- const result = translator$16.encode(params2);
32269
+ const result = translator$19.encode(params2);
32060
32270
  if (!result) return { nodes: [], consumed: 0 };
32061
32271
  return {
32062
32272
  nodes: [result],
@@ -32128,7 +32338,7 @@ const handleBookmarkStartNode = (params2) => {
32128
32338
  if (isCustomMarkBookmark(nodes[0], params2.editor)) {
32129
32339
  return handleBookmarkNode(params2);
32130
32340
  }
32131
- const node = translator$2.encode(params2);
32341
+ const node = translator$4.encode(params2);
32132
32342
  if (!node) return { nodes: [], consumed: 0 };
32133
32343
  return { nodes: [node], consumed: 1 };
32134
32344
  };
@@ -32160,7 +32370,7 @@ const handleBookmarkEndNode = (params2) => {
32160
32370
  if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
32161
32371
  return { nodes: [], consumed: 0 };
32162
32372
  }
32163
- const node = translator$1.encode(params2);
32373
+ const node = translator$3.encode(params2);
32164
32374
  if (!node) return { nodes: [], consumed: 0 };
32165
32375
  return { nodes: [node], consumed: 1 };
32166
32376
  };
@@ -32293,6 +32503,7 @@ const autoTotalPageCountEntity = {
32293
32503
  handlerName: "autoTotalPageCountEntity",
32294
32504
  handler: handleAutoTotalPageNumber
32295
32505
  };
32506
+ const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$1);
32296
32507
  const handlePictNode = (params2) => {
32297
32508
  const { nodes } = params2;
32298
32509
  if (!nodes.length || nodes[0].name !== "w:p") {
@@ -32791,6 +33002,7 @@ const getDefaultStyleDefinition = (defaultStyleId, docx) => {
32791
33002
  const spacing = pPr?.elements?.find((el) => el.name === "w:spacing");
32792
33003
  const justify = pPr?.elements?.find((el) => el.name === "w:jc");
32793
33004
  const indent = pPr?.elements?.find((el) => el.name === "w:ind");
33005
+ const tabs = pPr?.elements?.find((el) => el.name === "w:tabs");
32794
33006
  let lineSpaceBefore, lineSpaceAfter, line;
32795
33007
  if (spacing) {
32796
33008
  lineSpaceBefore = twipsToPixels(spacing?.attributes["w:before"]);
@@ -32804,6 +33016,22 @@ const getDefaultStyleDefinition = (defaultStyleId, docx) => {
32804
33016
  rightIndent = twipsToPixels(indent?.attributes["w:right"]);
32805
33017
  firstLine = twipsToPixels(indent?.attributes["w:firstLine"]);
32806
33018
  }
33019
+ let tabStops = [];
33020
+ if (tabs) {
33021
+ tabStops = (tabs.elements || []).filter((el) => el.name === "w:tab").map((tab) => {
33022
+ let val = tab.attributes["w:val"];
33023
+ if (val == "left") {
33024
+ val = "start";
33025
+ } else if (val == "right") {
33026
+ val = "end";
33027
+ }
33028
+ return {
33029
+ val,
33030
+ pos: twipsToPixels(tab.attributes["w:pos"]),
33031
+ leader: tab.attributes["w:leader"]
33032
+ };
33033
+ });
33034
+ }
32807
33035
  const keepNext = pPr?.elements?.find((el) => el.name === "w:keepNext");
32808
33036
  const keepLines = pPr?.elements?.find((el) => el.name === "w:keepLines");
32809
33037
  const outlineLevel = pPr?.elements?.find((el) => el.name === "w:outlineLvl");
@@ -32836,7 +33064,8 @@ const getDefaultStyleDefinition = (defaultStyleId, docx) => {
32836
33064
  const parsedStyles = {
32837
33065
  spacing: { lineSpaceAfter, lineSpaceBefore, line },
32838
33066
  textAlign,
32839
- indent: { leftIndent, rightIndent, firstLine }
33067
+ indent: { leftIndent, rightIndent, firstLine },
33068
+ tabStops: tabStops.length > 0 ? tabStops : null
32840
33069
  };
32841
33070
  parsedMarks.forEach((mark) => {
32842
33071
  const { type: type2, attrs } = mark;
@@ -32860,13 +33089,213 @@ const handleTabNode = (params2) => {
32860
33089
  if (!nodes.length || nodes[0].name !== "w:tab") {
32861
33090
  return { nodes: [], consumed: 0 };
32862
33091
  }
32863
- const node = translator$14.encode(params2);
33092
+ const node = translator$17.encode(params2);
32864
33093
  return { nodes: [node], consumed: 1 };
32865
33094
  };
32866
33095
  const tabNodeEntityHandler = {
32867
33096
  handlerName: "w:tabTranslator",
32868
33097
  handler: handleTabNode
32869
33098
  };
33099
+ const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator);
33100
+ function preProcessPageInstruction(nodesToCombine, _2, __) {
33101
+ const pageNumNode = {
33102
+ name: "sd:autoPageNumber",
33103
+ type: "element"
33104
+ };
33105
+ nodesToCombine.forEach((n) => {
33106
+ const rPrNode = n.elements.find((el) => el.name === "w:rPr");
33107
+ if (rPrNode) pageNumNode.elements = [rPrNode];
33108
+ });
33109
+ return [pageNumNode];
33110
+ }
33111
+ function preProcessNumPagesInstruction(nodesToCombine, _2, __) {
33112
+ const totalPageNumNode = {
33113
+ name: "sd:totalPageNumber",
33114
+ type: "element"
33115
+ };
33116
+ nodesToCombine.forEach((n) => {
33117
+ const rPrNode = n.elements?.find((el) => el.name === "w:rPr");
33118
+ if (rPrNode) totalPageNumNode.elements = [rPrNode];
33119
+ });
33120
+ return [totalPageNumNode];
33121
+ }
33122
+ function preProcessPageRefInstruction(nodesToCombine, instrText, _2) {
33123
+ const pageRefNode = {
33124
+ name: "sd:pageReference",
33125
+ type: "element",
33126
+ attributes: {
33127
+ instruction: instrText
33128
+ },
33129
+ elements: nodesToCombine
33130
+ };
33131
+ return [pageRefNode];
33132
+ }
33133
+ function preProcessHyperlinkInstruction(nodesToCombine, instruction, docx) {
33134
+ const urlMatch = instruction.match(/HYPERLINK\s+"([^"]+)"/);
33135
+ let linkAttributes;
33136
+ if (urlMatch && urlMatch.length >= 2) {
33137
+ const url = urlMatch[1];
33138
+ const rels = docx["word/_rels/document.xml.rels"];
33139
+ const relationships = rels?.elements.find((el) => el.name === "Relationships");
33140
+ if (relationships) {
33141
+ const rId = generateDocxRandomId();
33142
+ relationships.elements.push({
33143
+ type: "element",
33144
+ name: "Relationship",
33145
+ attributes: {
33146
+ Id: rId,
33147
+ Type: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
33148
+ Target: url,
33149
+ TargetMode: "External"
33150
+ }
33151
+ });
33152
+ linkAttributes = { "r:id": rId };
33153
+ } else {
33154
+ linkAttributes = { "w:anchor": url };
33155
+ }
33156
+ } else {
33157
+ const availableSwitches = {
33158
+ "w:anchor": `l "(?<value>[^"]+)"`,
33159
+ new_window: `
33160
+ `,
33161
+ "w:tgtFrame": ` "(?<value>[^"]+)"`,
33162
+ "w:tooltip": `o "(?<value>[^"]+)"`
33163
+ };
33164
+ const parsedSwitches = {};
33165
+ for (const [key2, regex] of Object.entries(availableSwitches)) {
33166
+ const match = instruction.match(new RegExp(regex));
33167
+ if (match) {
33168
+ parsedSwitches[key2] = match.groups?.value || true;
33169
+ }
33170
+ }
33171
+ if (parsedSwitches.new_window) {
33172
+ parsedSwitches["w:tgtFrame"] = "_blank";
33173
+ delete parsedSwitches.new_window;
33174
+ }
33175
+ linkAttributes = { ...parsedSwitches };
33176
+ }
33177
+ return [
33178
+ {
33179
+ name: "w:hyperlink",
33180
+ type: "element",
33181
+ attributes: linkAttributes,
33182
+ elements: nodesToCombine
33183
+ }
33184
+ ];
33185
+ }
33186
+ function preProcessTocInstruction(nodesToCombine, instrText) {
33187
+ return [
33188
+ {
33189
+ name: "sd:tableOfContents",
33190
+ type: "element",
33191
+ attributes: {
33192
+ instruction: instrText
33193
+ },
33194
+ elements: nodesToCombine
33195
+ }
33196
+ ];
33197
+ }
33198
+ const getInstructionPreProcessor = (instruction) => {
33199
+ const instructionType = instruction.split(" ")[0];
33200
+ switch (instructionType) {
33201
+ case "PAGE":
33202
+ return preProcessPageInstruction;
33203
+ case "NUMPAGES":
33204
+ return preProcessNumPagesInstruction;
33205
+ case "PAGEREF":
33206
+ return preProcessPageRefInstruction;
33207
+ case "HYPERLINK":
33208
+ return preProcessHyperlinkInstruction;
33209
+ case "TOC":
33210
+ return preProcessTocInstruction;
33211
+ default:
33212
+ return null;
33213
+ }
33214
+ };
33215
+ const preProcessNodesForFldChar = (nodes = [], docx) => {
33216
+ const processedNodes = [];
33217
+ let collectedNodesStack = [];
33218
+ let currentFieldStack = [];
33219
+ let unpairedEnd = null;
33220
+ let collecting = false;
33221
+ const finalizeField = () => {
33222
+ if (collecting) {
33223
+ const collectedNodes = collectedNodesStack.pop().filter((n) => n !== null);
33224
+ const currentField = currentFieldStack.pop();
33225
+ const combined = _processCombinedNodesForFldChar(collectedNodes, currentField.instrText.trim(), docx);
33226
+ if (collectedNodesStack.length === 0) {
33227
+ processedNodes.push(...combined);
33228
+ } else {
33229
+ collectedNodesStack[collectedNodesStack.length - 1].push(...combined);
33230
+ }
33231
+ } else {
33232
+ unpairedEnd = true;
33233
+ }
33234
+ };
33235
+ for (const node of nodes) {
33236
+ const fldCharEl = node.elements?.find((el) => el.name === "w:fldChar");
33237
+ const fldType = fldCharEl?.attributes?.["w:fldCharType"];
33238
+ const instrTextEl = node.elements?.find((el) => el.name === "w:instrText");
33239
+ collecting = collectedNodesStack.length > 0;
33240
+ if (fldType === "begin") {
33241
+ collectedNodesStack.push([null]);
33242
+ currentFieldStack.push({ instrText: "" });
33243
+ continue;
33244
+ }
33245
+ if (instrTextEl && collecting && currentFieldStack.length > 0) {
33246
+ currentFieldStack[currentFieldStack.length - 1].instrText += (instrTextEl.elements?.[0]?.text || "") + " ";
33247
+ continue;
33248
+ }
33249
+ if (fldType === "end") {
33250
+ finalizeField();
33251
+ continue;
33252
+ } else if (fldType === "separate") {
33253
+ continue;
33254
+ }
33255
+ if (Array.isArray(node.elements)) {
33256
+ const childResult = preProcessNodesForFldChar(node.elements, docx);
33257
+ node.elements = childResult.processedNodes;
33258
+ if (childResult.unpairedBegin) {
33259
+ childResult.unpairedBegin.forEach((pendingField) => {
33260
+ currentFieldStack.push(pendingField.fieldInfo);
33261
+ collectedNodesStack.push([node]);
33262
+ });
33263
+ } else if (childResult.unpairedEnd) {
33264
+ collectedNodesStack[collectedNodesStack.length - 1].push(node);
33265
+ finalizeField();
33266
+ } else if (collecting) {
33267
+ collectedNodesStack[collectedNodesStack.length - 1].push(node);
33268
+ } else {
33269
+ processedNodes.push(node);
33270
+ }
33271
+ } else if (collecting) {
33272
+ collectedNodesStack[collectedNodesStack.length - 1].push(node);
33273
+ } else {
33274
+ processedNodes.push(node);
33275
+ }
33276
+ }
33277
+ let unpairedBegin = null;
33278
+ if (collectedNodesStack.length > 0) {
33279
+ unpairedBegin = [];
33280
+ for (let i = 0; i < collectedNodesStack.length; i++) {
33281
+ processedNodes.push(...collectedNodesStack[i].filter((n) => n !== null));
33282
+ unpairedBegin.push({
33283
+ nodes: collectedNodesStack[i],
33284
+ fieldInfo: currentFieldStack[i]
33285
+ });
33286
+ }
33287
+ }
33288
+ return { processedNodes, unpairedBegin, unpairedEnd };
33289
+ };
33290
+ const _processCombinedNodesForFldChar = (nodesToCombine = [], instrText, docx) => {
33291
+ const instructionType = instrText.trim().split(" ")[0];
33292
+ const instructionPreProcessor = getInstructionPreProcessor(instructionType);
33293
+ if (instructionPreProcessor) {
33294
+ return instructionPreProcessor(nodesToCombine, instrText, docx);
33295
+ } else {
33296
+ return nodesToCombine;
33297
+ }
33298
+ };
32870
33299
  const createDocumentJson = (docx, converter, editor) => {
32871
33300
  const json = carbonCopy(getInitialJSON(docx));
32872
33301
  if (!json) return null;
@@ -32896,6 +33325,8 @@ const createDocumentJson = (docx, converter, editor) => {
32896
33325
  if (bodyNode) {
32897
33326
  ensureSectionProperties(bodyNode);
32898
33327
  const node = bodyNode;
33328
+ const { processedNodes } = preProcessNodesForFldChar(node.elements ?? [], docx);
33329
+ node.elements = processedNodes;
32899
33330
  const contentElements = node.elements?.filter((n) => n.name !== "w:sectPr") ?? [];
32900
33331
  const content = pruneIgnoredNodes(contentElements);
32901
33332
  const comments = importCommentData({ docx, converter, editor });
@@ -32951,8 +33382,10 @@ const defaultNodeListHandler = () => {
32951
33382
  trackChangeNodeHandlerEntity,
32952
33383
  tableNodeHandlerEntity,
32953
33384
  tabNodeEntityHandler,
33385
+ tableOfContentsHandlerEntity,
32954
33386
  autoPageHandlerEntity,
32955
33387
  autoTotalPageCountEntity,
33388
+ pageReferenceEntity,
32956
33389
  standardNodeHandlerEntity
32957
33390
  ];
32958
33391
  const handler2 = createNodeListHandler(entities);
@@ -54407,6 +54840,48 @@ const DocumentSection = Node$1.create({
54407
54840
  };
54408
54841
  }
54409
54842
  });
54843
+ const DocumentPartObject = Node$1.create({
54844
+ name: "documentPartObject",
54845
+ group: "block",
54846
+ content: "block*",
54847
+ isolating: true,
54848
+ addOptions() {
54849
+ return {
54850
+ htmlAttributes: {
54851
+ class: "sd-document-part-object-block",
54852
+ "aria-label": "Structured document part block"
54853
+ }
54854
+ };
54855
+ },
54856
+ parseDOM() {
54857
+ return [
54858
+ {
54859
+ tag: "div.sd-document-part-object-block",
54860
+ priority: 60
54861
+ }
54862
+ ];
54863
+ },
54864
+ renderDOM({ htmlAttributes }) {
54865
+ return ["div", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
54866
+ },
54867
+ addAttributes() {
54868
+ return {
54869
+ sdBlockId: {
54870
+ default: null,
54871
+ keepOnSplit: false,
54872
+ parseDOM: (elem) => elem.getAttribute("data-sd-block-id"),
54873
+ renderDOM: (attrs) => {
54874
+ return attrs.sdBlockId ? { "data-sd-block-id": attrs.sdBlockId } : {};
54875
+ }
54876
+ },
54877
+ id: {},
54878
+ docPartGallery: {},
54879
+ docPartUnique: {
54880
+ default: true
54881
+ }
54882
+ };
54883
+ }
54884
+ });
54410
54885
  const Document = Node$1.create({
54411
54886
  name: "doc",
54412
54887
  topNode: true,
@@ -55543,7 +56018,12 @@ const generateDecorations = (state2, styles) => {
55543
56018
  return { ...base2, ...linkedStyle.definition?.styles || {} };
55544
56019
  };
55545
56020
  const pMap = buildStyleMap(paragraphStyleId);
55546
- const tMap = buildStyleMap(inlineTextStyleId);
56021
+ let tMap;
56022
+ if (paragraphStyleId?.startsWith("TOC")) {
56023
+ tMap = {};
56024
+ } else {
56025
+ tMap = buildStyleMap(inlineTextStyleId);
56026
+ }
55547
56027
  const rMap = buildStyleMap(runStyleId);
55548
56028
  const finalStyles = { ...pMap, ...tMap, ...rMap };
55549
56029
  if (Object.keys(finalStyles).length === 0) return;
@@ -56840,7 +57320,7 @@ const CommentsMark = Mark2.create({
56840
57320
  });
56841
57321
  const defaultTabDistance = 48;
56842
57322
  const defaultLineLength = 816;
56843
- const getTabDecorations = (doc2, view, from2 = 0, to = null) => {
57323
+ const getTabDecorations = (doc2, view, helpers2, from2 = 0, to = null) => {
56844
57324
  const decorations = [];
56845
57325
  const paragraphCache = /* @__PURE__ */ new Map();
56846
57326
  const end2 = to ?? doc2.content.size;
@@ -56848,7 +57328,7 @@ const getTabDecorations = (doc2, view, from2 = 0, to = null) => {
56848
57328
  if (node.type.name !== "tab") return;
56849
57329
  let extraStyles = "";
56850
57330
  const $pos = doc2.resolve(pos);
56851
- const paragraphContext = getParagraphContext($pos, paragraphCache);
57331
+ const paragraphContext = getParagraphContext($pos, paragraphCache, helpers2);
56852
57332
  if (!paragraphContext) return;
56853
57333
  try {
56854
57334
  const { tabStops, flattened, startPos } = paragraphContext;
@@ -56903,18 +57383,27 @@ const getTabDecorations = (doc2, view, from2 = 0, to = null) => {
56903
57383
  });
56904
57384
  return decorations;
56905
57385
  };
56906
- function getParagraphContext($pos, cache2) {
57386
+ function getParagraphContext($pos, cache2, helpers2) {
56907
57387
  for (let depth = $pos.depth; depth >= 0; depth--) {
56908
57388
  const node = $pos.node(depth);
56909
57389
  if (node?.type?.name === "paragraph") {
56910
57390
  const startPos = $pos.start(depth);
56911
57391
  if (!cache2.has(startPos)) {
57392
+ let tabStops = [];
57393
+ if (Array.isArray(node.attrs?.tabStops)) {
57394
+ tabStops = node.attrs.tabStops;
57395
+ } else {
57396
+ const style2 = helpers2.linkedStyles.getStyleById(node.attrs?.styleId);
57397
+ if (Array.isArray(style2?.definition?.styles?.tabStops)) {
57398
+ tabStops = style2.definition.styles.tabStops;
57399
+ }
57400
+ }
56912
57401
  cache2.set(startPos, {
56913
57402
  paragraph: node,
56914
57403
  paragraphDepth: depth,
56915
57404
  startPos,
56916
57405
  indent: node.attrs?.indent || {},
56917
- tabStops: Array.isArray(node.attrs?.tabStops) ? node.attrs.tabStops : [],
57406
+ tabStops,
56918
57407
  flattened: flattenParagraph(node, startPos),
56919
57408
  accumulatedTabWidth: 0
56920
57409
  });
@@ -57080,7 +57569,7 @@ const TabNode = Node$1.create({
57080
57569
  };
57081
57570
  },
57082
57571
  addPmPlugins() {
57083
- const { view } = this.editor;
57572
+ const { view, helpers: helpers2 } = this.editor;
57084
57573
  const tabPlugin = new Plugin({
57085
57574
  name: "tabPlugin",
57086
57575
  key: new PluginKey("tabPlugin"),
@@ -57090,7 +57579,7 @@ const TabNode = Node$1.create({
57090
57579
  },
57091
57580
  apply(tr, { decorations }, _oldState, newState) {
57092
57581
  if (!decorations) {
57093
- decorations = DecorationSet.create(newState.doc, getTabDecorations(newState.doc, view));
57582
+ decorations = DecorationSet.create(newState.doc, getTabDecorations(newState.doc, view, helpers2));
57094
57583
  }
57095
57584
  if (!tr.docChanged) {
57096
57585
  return { decorations };
@@ -57130,7 +57619,7 @@ const TabNode = Node$1.create({
57130
57619
  rangesToRecalculate.forEach(([start2, end2]) => {
57131
57620
  const oldDecorations = decorations.find(start2, end2);
57132
57621
  decorations = decorations.remove(oldDecorations);
57133
- const newDecorations = getTabDecorations(newState.doc, view, start2, end2);
57622
+ const newDecorations = getTabDecorations(newState.doc, view, helpers2, start2, end2);
57134
57623
  decorations = decorations.add(newState.doc, newDecorations);
57135
57624
  });
57136
57625
  return { decorations };
@@ -63411,6 +63900,43 @@ const processMarks = (marks) => {
63411
63900
  });
63412
63901
  return styles;
63413
63902
  };
63903
+ const PageReference = Node$1.create({
63904
+ name: "pageReference",
63905
+ group: "inline",
63906
+ inline: true,
63907
+ atom: true,
63908
+ draggable: false,
63909
+ selectable: false,
63910
+ content: "inline*",
63911
+ addOptions() {
63912
+ return {
63913
+ htmlAttributes: {
63914
+ contenteditable: false,
63915
+ "data-id": "auto-page-reference",
63916
+ "aria-label": "Page reference node",
63917
+ class: "sd-editor-page-reference"
63918
+ }
63919
+ };
63920
+ },
63921
+ addAttributes() {
63922
+ return {
63923
+ marksAsAttrs: {
63924
+ default: null,
63925
+ rendered: false
63926
+ },
63927
+ instruction: {
63928
+ default: "",
63929
+ rendered: false
63930
+ }
63931
+ };
63932
+ },
63933
+ parseDOM() {
63934
+ return [{ tag: 'span[data-id="auto-page-reference"]' }];
63935
+ },
63936
+ renderDOM({ htmlAttributes }) {
63937
+ return ["span", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
63938
+ }
63939
+ });
63414
63940
  const ShapeContainer = Node$1.create({
63415
63941
  name: "shapeContainer",
63416
63942
  group: "block",
@@ -63824,6 +64350,51 @@ const checkForNewBlockNodesInTrs = (transactions) => {
63824
64350
  });
63825
64351
  });
63826
64352
  };
64353
+ const TableOfContents = Node$1.create({
64354
+ name: "tableOfContents",
64355
+ group: "block",
64356
+ content: "paragraph+",
64357
+ inline: false,
64358
+ addOptions() {
64359
+ return {
64360
+ htmlAttributes: {
64361
+ "data-id": "table-of-contents",
64362
+ "aria-label": "Table of Contents"
64363
+ }
64364
+ };
64365
+ },
64366
+ parseDOM() {
64367
+ return [
64368
+ {
64369
+ tag: 'div[data-id="table-of-contents"]'
64370
+ }
64371
+ ];
64372
+ },
64373
+ renderDOM({ htmlAttributes }) {
64374
+ return ["div", Attribute2.mergeAttributes(this.options.htmlAttributes, htmlAttributes), 0];
64375
+ },
64376
+ addAttributes() {
64377
+ return {
64378
+ instruction: {
64379
+ default: null,
64380
+ rendered: false
64381
+ },
64382
+ /**
64383
+ * @private
64384
+ * @category Attribute
64385
+ * @param {string} [sdBlockId] - Internal block tracking ID (not user-configurable)
64386
+ */
64387
+ sdBlockId: {
64388
+ default: null,
64389
+ keepOnSplit: false,
64390
+ parseDOM: (elem) => elem.getAttribute("data-sd-block-id"),
64391
+ renderDOM: (attrs) => {
64392
+ return attrs.sdBlockId ? { "data-sd-block-id": attrs.sdBlockId } : {};
64393
+ }
64394
+ }
64395
+ };
64396
+ }
64397
+ });
63827
64398
  const TextStyle = Mark2.create({
63828
64399
  name: "textStyle",
63829
64400
  addOptions() {
@@ -70430,6 +71001,7 @@ const getStarterExtensions = () => {
70430
71001
  SlashMenu,
70431
71002
  Strike,
70432
71003
  TabNode,
71004
+ TableOfContents,
70433
71005
  Text,
70434
71006
  TextAlign,
70435
71007
  TextIndent,
@@ -70464,6 +71036,7 @@ const getStarterExtensions = () => {
70464
71036
  AiLoaderNode,
70465
71037
  PageNumber,
70466
71038
  TotalPageCount,
71039
+ PageReference,
70467
71040
  ShapeContainer,
70468
71041
  ShapeTextbox,
70469
71042
  ContentBlock,
@@ -70472,6 +71045,7 @@ const getStarterExtensions = () => {
70472
71045
  StructuredContentBlock,
70473
71046
  StructuredContentCommands,
70474
71047
  DocumentSection,
71048
+ DocumentPartObject,
70475
71049
  NodeResizer,
70476
71050
  CustomSelection,
70477
71051
  TextTransform
@@ -86008,71 +86582,73 @@ const _sfc_main = {
86008
86582
  };
86009
86583
  const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
86010
86584
  const additionalHandlers = Object.freeze({
86011
- "mc:AlternateContent": translator,
86012
- "w:b": translator$12,
86013
- "w:bidiVisual": translator$F,
86014
- "w:bookmarkEnd": translator$1,
86015
- "w:bookmarkStart": translator$2,
86016
- "w:bottom": translator$s,
86017
- "w:br": translator$16,
86018
- "w:cantSplit": translator$T,
86019
- "w:cnfStyle": translator$S,
86020
- "w:color": translator$_,
86021
- "w:divId": translator$R,
86022
- "w:drawing": translator$4,
86023
- "w:end": translator$q,
86024
- "w:gridAfter": translator$Q,
86025
- "w:gridBefore": translator$P,
86026
- "w:gridCol": translator$b,
86027
- "w:hidden": translator$O,
86028
- "w:highlight": translator$15,
86029
- "w:hyperlink": translator$7,
86030
- "w:i": translator$11,
86031
- "w:insideH": translator$o,
86032
- "w:insideV": translator$n,
86033
- "w:jc": translator$N,
86034
- "w:left": translator$m,
86035
- "w:p": translator$13,
86036
- "w:r": translator$U,
86037
- "w:rFonts": translator$Z,
86038
- "w:rPr": translator$V,
86039
- "w:rStyle": translator$Y,
86040
- "w:right": translator$k,
86041
- "w:sdt": translator$3,
86042
- "w:shd": translator$E,
86043
- "w:start": translator$i,
86044
- "w:strike": translator$$,
86045
- "w:sz": translator$X,
86046
- "w:szCs": translator$W,
86047
- "w:tab": translator$14,
86048
- "w:tbl": translator$9,
86049
- "w:tblBorders": translator$e,
86050
- "w:tblCaption": translator$D,
86051
- "w:tblCellMar": translator$d,
86052
- "w:tblCellSpacing": translator$M,
86053
- "w:tblDescription": translator$C,
86054
- "w:tblGrid": translator$a,
86055
- "w:tblHeader": translator$L,
86056
- "w:tblInd": translator$B,
86057
- "w:tblLayout": translator$A,
86058
- "w:tblLook": translator$z,
86059
- "w:tblOverlap": translator$y,
86060
- "w:tblPr": translator$c,
86061
- "w:tblStyle": translator$x,
86062
- "w:tblStyleColBandSize": translator$w,
86063
- "w:tblStyleRowBandSize": translator$v,
86064
- "w:tblW": translator$u,
86065
- "w:tblpPr": translator$t,
86066
- "w:tc": translator$8,
86067
- "w:top": translator$g,
86068
- "w:tr": translator$G,
86069
- "w:trHeight": translator$K,
86070
- "w:trPr": translator$H,
86071
- "w:u": translator$10,
86072
- "w:wAfter": translator$J,
86073
- "w:wBefore": translator$I,
86074
- "wp:anchor": translator$6,
86075
- "wp:inline": translator$5
86585
+ "mc:AlternateContent": translator$2,
86586
+ "sd:pageReference": translator$1,
86587
+ "sd:tableOfContents": translator,
86588
+ "w:b": translator$15,
86589
+ "w:bidiVisual": translator$G,
86590
+ "w:bookmarkEnd": translator$3,
86591
+ "w:bookmarkStart": translator$4,
86592
+ "w:bottom": translator$t,
86593
+ "w:br": translator$19,
86594
+ "w:cantSplit": translator$U,
86595
+ "w:cnfStyle": translator$T,
86596
+ "w:color": translator$11,
86597
+ "w:divId": translator$S,
86598
+ "w:drawing": translator$6,
86599
+ "w:end": translator$r,
86600
+ "w:gridAfter": translator$R,
86601
+ "w:gridBefore": translator$Q,
86602
+ "w:gridCol": translator$c,
86603
+ "w:hidden": translator$P,
86604
+ "w:highlight": translator$18,
86605
+ "w:hyperlink": translator$W,
86606
+ "w:i": translator$14,
86607
+ "w:insideH": translator$p,
86608
+ "w:insideV": translator$o,
86609
+ "w:jc": translator$O,
86610
+ "w:left": translator$n,
86611
+ "w:p": translator$16,
86612
+ "w:r": translator$V,
86613
+ "w:rFonts": translator$10,
86614
+ "w:rPr": translator$X,
86615
+ "w:rStyle": translator$$,
86616
+ "w:right": translator$l,
86617
+ "w:sdt": translator$5,
86618
+ "w:shd": translator$F,
86619
+ "w:start": translator$j,
86620
+ "w:strike": translator$12,
86621
+ "w:sz": translator$_,
86622
+ "w:szCs": translator$Z,
86623
+ "w:tab": translator$17,
86624
+ "w:tbl": translator$a,
86625
+ "w:tblBorders": translator$f,
86626
+ "w:tblCaption": translator$E,
86627
+ "w:tblCellMar": translator$e,
86628
+ "w:tblCellSpacing": translator$N,
86629
+ "w:tblDescription": translator$D,
86630
+ "w:tblGrid": translator$b,
86631
+ "w:tblHeader": translator$M,
86632
+ "w:tblInd": translator$C,
86633
+ "w:tblLayout": translator$B,
86634
+ "w:tblLook": translator$A,
86635
+ "w:tblOverlap": translator$z,
86636
+ "w:tblPr": translator$d,
86637
+ "w:tblStyle": translator$y,
86638
+ "w:tblStyleColBandSize": translator$x,
86639
+ "w:tblStyleRowBandSize": translator$w,
86640
+ "w:tblW": translator$v,
86641
+ "w:tblpPr": translator$u,
86642
+ "w:tc": translator$9,
86643
+ "w:top": translator$h,
86644
+ "w:tr": translator$H,
86645
+ "w:trHeight": translator$L,
86646
+ "w:trPr": translator$I,
86647
+ "w:u": translator$13,
86648
+ "w:wAfter": translator$K,
86649
+ "w:wBefore": translator$J,
86650
+ "wp:anchor": translator$8,
86651
+ "wp:inline": translator$7
86076
86652
  });
86077
86653
  const baseHandlers = {
86078
86654
  ...runPropertyTranslators,