@harbour-enterprises/superdoc 0.24.0-next.2 → 0.24.0-next.3

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 (39) hide show
  1. package/dist/chunks/{PdfViewer--Z8scsXq.es.js → PdfViewer-DEWI6Uts.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-CYiJzT44.cjs → PdfViewer-skWUtg2N.cjs} +1 -1
  3. package/dist/chunks/{index-CBSXpA57.cjs → index-2QL0aZ2S.cjs} +2 -2
  4. package/dist/chunks/{index-CCf_X9Jy.es.js → index-C_AMhrHP.es.js} +2 -2
  5. package/dist/chunks/{super-editor.es-CZFQdEKI.cjs → super-editor.es-CfK_qBM9.cjs} +1484 -897
  6. package/dist/chunks/{super-editor.es-BFco6Gra.es.js → super-editor.es-iMAoOYOw.es.js} +1484 -897
  7. package/dist/core/types/index.d.ts.map +1 -1
  8. package/dist/style.css +5 -4
  9. package/dist/super-editor/ai-writer.es.js +2 -2
  10. package/dist/super-editor/chunks/{converter-nWAUAQ83.js → converter-BueCftlx.js} +1167 -858
  11. package/dist/super-editor/chunks/{docx-zipper-B2uMUaj9.js → docx-zipper-C9jmfWYZ.js} +1 -1
  12. package/dist/super-editor/chunks/{editor-DAyiX5AL.js → editor-BsuNqVvp.js} +332 -53
  13. package/dist/super-editor/chunks/{toolbar-LmzuO_YJ.js → toolbar-DxhfgAoa.js} +2 -2
  14. package/dist/super-editor/converter.es.js +1 -1
  15. package/dist/super-editor/docx-zipper.es.js +2 -2
  16. package/dist/super-editor/editor.es.js +3 -3
  17. package/dist/super-editor/file-zipper.es.js +1 -1
  18. package/dist/super-editor/style.css +5 -4
  19. package/dist/super-editor/super-editor/src/core/super-converter/helpers.d.ts +22 -0
  20. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts +1 -0
  21. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/trackChangesImporter.d.ts +5 -0
  22. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/types/index.d.ts +1 -0
  23. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/helpers.d.ts +1 -0
  24. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/del/del-translator.d.ts +7 -0
  25. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/del/index.d.ts +1 -0
  26. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/ins/index.d.ts +1 -0
  27. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/ins/ins-translator.d.ts +7 -0
  28. package/dist/super-editor/super-editor/src/extensions/image/image.d.ts +1 -1
  29. package/dist/super-editor/super-editor/src/extensions/image/imageHelpers/index.d.ts +1 -0
  30. package/dist/super-editor/super-editor/src/extensions/image/imageHelpers/legacyAttributes.d.ts +17 -0
  31. package/dist/super-editor/super-editor.es.js +7 -7
  32. package/dist/super-editor/toolbar.es.js +2 -2
  33. package/dist/super-editor.cjs +1 -1
  34. package/dist/super-editor.es.js +1 -1
  35. package/dist/superdoc.cjs +2 -2
  36. package/dist/superdoc.es.js +2 -2
  37. package/dist/superdoc.umd.js +1484 -897
  38. package/dist/superdoc.umd.js.map +1 -1
  39. package/package.json +1 -1
@@ -22832,14 +22832,21 @@
22832
22832
  function twipsToPixels(twips) {
22833
22833
  if (twips == null) return;
22834
22834
  const inches = twipsToInches(twips);
22835
+ return inchesToPixels(inches);
22836
+ }
22837
+ function pixelsToTwips(pixels) {
22838
+ const inches = pixelsToInches(pixels);
22839
+ return inchesToTwips(inches);
22840
+ }
22841
+ function inchesToPixels(inches) {
22835
22842
  if (inches == null) return;
22836
22843
  const pixels = inches * 96;
22837
22844
  return Math.round(pixels * 1e3) / 1e3;
22838
22845
  }
22839
- function pixelsToTwips(pixels) {
22846
+ function pixelsToInches(pixels) {
22840
22847
  if (pixels == null) return;
22841
22848
  const inches = Number(pixels) / 96;
22842
- return inchesToTwips(inches);
22849
+ return inches;
22843
22850
  }
22844
22851
  function twipsToLines(twips) {
22845
22852
  if (twips == null) return;
@@ -22890,6 +22897,71 @@
22890
22897
  if (degrees == null) return;
22891
22898
  return degrees * 6e4;
22892
22899
  }
22900
+ function pixelsToPolygonUnits(pixels) {
22901
+ if (pixels == null) return;
22902
+ const pu = pixels * 96;
22903
+ return Math.round(pu);
22904
+ }
22905
+ function polygonUnitsToPixels(pu) {
22906
+ if (pu == null) return;
22907
+ const pixels = Number(pu) / 96;
22908
+ return Math.round(pixels * 1e3) / 1e3;
22909
+ }
22910
+ function polygonToObj(polygonNode) {
22911
+ if (!polygonNode) return null;
22912
+ const points = [];
22913
+ polygonNode.elements.forEach((element) => {
22914
+ if (["wp:start", "wp:lineTo"].includes(element.name)) {
22915
+ const { x, y: y2 } = element.attributes;
22916
+ points.push([polygonUnitsToPixels(x), polygonUnitsToPixels(y2)]);
22917
+ }
22918
+ });
22919
+ if (points.length > 1) {
22920
+ const firstPoint = points[0];
22921
+ const lastPoint = points[points.length - 1];
22922
+ if (firstPoint[0] === lastPoint[0] && firstPoint[1] === lastPoint[1]) {
22923
+ points.pop();
22924
+ }
22925
+ }
22926
+ return points;
22927
+ }
22928
+ function objToPolygon(points) {
22929
+ if (!points || !Array.isArray(points)) return null;
22930
+ const polygonNode = {
22931
+ name: "wp:wrapPolygon",
22932
+ type: "wp:wrapPolygon",
22933
+ attributes: {
22934
+ edited: "0"
22935
+ },
22936
+ elements: []
22937
+ };
22938
+ points.forEach((point, index2) => {
22939
+ const [x, y2] = point;
22940
+ const tagName = index2 === 0 ? "wp:start" : "wp:lineTo";
22941
+ const pointNode = {
22942
+ name: tagName,
22943
+ type: tagName,
22944
+ attributes: {
22945
+ x: pixelsToPolygonUnits(x),
22946
+ y: pixelsToPolygonUnits(y2)
22947
+ }
22948
+ };
22949
+ polygonNode.elements.push(pointNode);
22950
+ });
22951
+ if (points.length > 0) {
22952
+ const [startX, startY] = points[0];
22953
+ const closePointNode = {
22954
+ name: "wp:lineTo",
22955
+ type: "wp:lineTo",
22956
+ attributes: {
22957
+ x: pixelsToPolygonUnits(startX),
22958
+ y: pixelsToPolygonUnits(startY)
22959
+ }
22960
+ };
22961
+ polygonNode.elements.push(closePointNode);
22962
+ }
22963
+ return polygonNode;
22964
+ }
22893
22965
  const getTextIndentExportValue = (indent) => {
22894
22966
  const [value, unit] = parseSizeUnit(indent);
22895
22967
  const functionsMap = {
@@ -32205,37 +32277,37 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32205
32277
  };
32206
32278
  __publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
32207
32279
  let NodeTranslator = _NodeTranslator;
32208
- const encode$1c = (attributes) => {
32280
+ const encode$1e = (attributes) => {
32209
32281
  return attributes["w:type"];
32210
32282
  };
32211
- const decode$14 = (attrs) => {
32283
+ const decode$16 = (attrs) => {
32212
32284
  const { lineBreakType } = attrs;
32213
32285
  return lineBreakType;
32214
32286
  };
32215
32287
  const attrConfig$G = Object.freeze({
32216
32288
  xmlName: "w:type",
32217
32289
  sdName: "lineBreakType",
32218
- encode: encode$1c,
32219
- decode: decode$14
32290
+ encode: encode$1e,
32291
+ decode: decode$16
32220
32292
  });
32221
- const encode$1b = (attributes) => {
32293
+ const encode$1d = (attributes) => {
32222
32294
  const xmlAttrValue = attributes["w:clear"];
32223
32295
  return xmlAttrValue;
32224
32296
  };
32225
- const decode$13 = (attrs) => {
32297
+ const decode$15 = (attrs) => {
32226
32298
  const { clear } = attrs;
32227
32299
  return clear;
32228
32300
  };
32229
32301
  const attrConfig$F = Object.freeze({
32230
32302
  xmlName: "w:clear",
32231
32303
  sdName: "clear",
32232
- encode: encode$1b,
32233
- decode: decode$13
32304
+ encode: encode$1d,
32305
+ decode: decode$15
32234
32306
  });
32235
- const validXmlAttributes$n = [attrConfig$G, attrConfig$F];
32236
- const XML_NODE_NAME$z = "w:br";
32307
+ const validXmlAttributes$p = [attrConfig$G, attrConfig$F];
32308
+ const XML_NODE_NAME$B = "w:br";
32237
32309
  const SD_NODE_NAME$h = "lineBreak";
32238
- const encode$1a = (_2, encodedAttrs) => {
32310
+ const encode$1c = (_2, encodedAttrs) => {
32239
32311
  const isPageBreak = encodedAttrs?.lineBreakType === "page";
32240
32312
  const translated = {
32241
32313
  type: isPageBreak ? "hardBreak" : "lineBreak"
@@ -32245,7 +32317,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32245
32317
  }
32246
32318
  return translated;
32247
32319
  };
32248
- const decode$12 = (params2, decodedAttrs) => {
32320
+ const decode$14 = (params2, decodedAttrs) => {
32249
32321
  const { node } = params2;
32250
32322
  if (!node) return;
32251
32323
  const wBreak = { name: "w:br" };
@@ -32262,39 +32334,39 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32262
32334
  };
32263
32335
  return translated;
32264
32336
  };
32265
- const config$w = {
32266
- xmlName: XML_NODE_NAME$z,
32337
+ const config$y = {
32338
+ xmlName: XML_NODE_NAME$B,
32267
32339
  sdNodeOrKeyName: SD_NODE_NAME$h,
32268
32340
  type: NodeTranslator.translatorTypes.NODE,
32269
- encode: encode$1a,
32270
- decode: decode$12,
32271
- attributes: validXmlAttributes$n
32341
+ encode: encode$1c,
32342
+ decode: decode$14,
32343
+ attributes: validXmlAttributes$p
32272
32344
  };
32273
- const translator$1a = NodeTranslator.from(config$w);
32274
- const encode$19 = (attributes) => attributes?.["w:val"];
32275
- const decode$11 = (attrs) => attrs?.highlight;
32345
+ const translator$1c = NodeTranslator.from(config$y);
32346
+ const encode$1b = (attributes) => attributes?.["w:val"];
32347
+ const decode$13 = (attrs) => attrs?.highlight;
32276
32348
  const attrConfig$E = Object.freeze({
32277
32349
  xmlName: "w:val",
32278
32350
  sdName: "highlight",
32279
- encode: encode$19,
32280
- decode: decode$11
32351
+ encode: encode$1b,
32352
+ decode: decode$13
32281
32353
  });
32282
- const validXmlAttributes$m = [attrConfig$E];
32283
- const XML_NODE_NAME$y = "w:highlight";
32284
- const SD_ATTR_KEY$g = "highlight";
32354
+ const validXmlAttributes$o = [attrConfig$E];
32355
+ const XML_NODE_NAME$A = "w:highlight";
32356
+ const SD_ATTR_KEY$i = "highlight";
32285
32357
  const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
32286
- const encode$18 = (params2, encodedAttrs = {}) => {
32358
+ const encode$1a = (params2, encodedAttrs = {}) => {
32287
32359
  const { nodes } = params2;
32288
32360
  const node = nodes?.[0];
32289
32361
  const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
32290
32362
  return {
32291
32363
  type: "attr",
32292
- xmlName: XML_NODE_NAME$y,
32293
- sdNodeOrKeyName: SD_ATTR_KEY$g,
32364
+ xmlName: XML_NODE_NAME$A,
32365
+ sdNodeOrKeyName: SD_ATTR_KEY$i,
32294
32366
  attributes: { "w:val": value ?? null }
32295
32367
  };
32296
32368
  };
32297
- const decode$10 = (params2) => {
32369
+ const decode$12 = (params2) => {
32298
32370
  const attrs = params2?.node?.attrs || {};
32299
32371
  const highlightValue = attrs.highlight ?? attrs.color ?? null;
32300
32372
  if (!highlightValue) return void 0;
@@ -32302,14 +32374,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32302
32374
  if (!normalizedValue) return void 0;
32303
32375
  if (DISABLED_TOKENS.has(normalizedValue)) {
32304
32376
  return {
32305
- name: XML_NODE_NAME$y,
32377
+ name: XML_NODE_NAME$A,
32306
32378
  attributes: { "w:val": "none" }
32307
32379
  };
32308
32380
  }
32309
32381
  const keyword = getDocxHighlightKeywordFromHex(highlightValue);
32310
32382
  if (keyword) {
32311
32383
  return {
32312
- name: XML_NODE_NAME$y,
32384
+ name: XML_NODE_NAME$A,
32313
32385
  attributes: { "w:val": keyword }
32314
32386
  };
32315
32387
  }
@@ -32324,63 +32396,63 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32324
32396
  }
32325
32397
  };
32326
32398
  };
32327
- const config$v = {
32328
- xmlName: XML_NODE_NAME$y,
32329
- sdNodeOrKeyName: SD_ATTR_KEY$g,
32399
+ const config$x = {
32400
+ xmlName: XML_NODE_NAME$A,
32401
+ sdNodeOrKeyName: SD_ATTR_KEY$i,
32330
32402
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
32331
- encode: encode$18,
32332
- decode: decode$10,
32333
- attributes: validXmlAttributes$m
32403
+ encode: encode$1a,
32404
+ decode: decode$12,
32405
+ attributes: validXmlAttributes$o
32334
32406
  };
32335
- const translator$19 = NodeTranslator.from(config$v);
32336
- const encode$17 = (attributes) => {
32407
+ const translator$1b = NodeTranslator.from(config$x);
32408
+ const encode$19 = (attributes) => {
32337
32409
  return attributes["w:val"];
32338
32410
  };
32339
- const decode$$ = (attrs) => {
32411
+ const decode$11 = (attrs) => {
32340
32412
  const { tabSize } = attrs || {};
32341
32413
  return tabSize;
32342
32414
  };
32343
32415
  const attrConfig$D = Object.freeze({
32344
32416
  xmlName: "w:val",
32345
32417
  sdName: "tabSize",
32346
- encode: encode$17,
32347
- decode: decode$$
32418
+ encode: encode$19,
32419
+ decode: decode$11
32348
32420
  });
32349
- const encode$16 = (attributes) => {
32421
+ const encode$18 = (attributes) => {
32350
32422
  return attributes["w:leader"];
32351
32423
  };
32352
- const decode$_ = (attrs) => {
32424
+ const decode$10 = (attrs) => {
32353
32425
  const { leader } = attrs || {};
32354
32426
  return leader;
32355
32427
  };
32356
32428
  const attrConfig$C = Object.freeze({
32357
32429
  xmlName: "w:leader",
32358
32430
  sdName: "leader",
32359
- encode: encode$16,
32360
- decode: decode$_
32431
+ encode: encode$18,
32432
+ decode: decode$10
32361
32433
  });
32362
- const encode$15 = (attributes) => {
32434
+ const encode$17 = (attributes) => {
32363
32435
  return attributes["w:pos"];
32364
32436
  };
32365
- const decode$Z = (attrs) => {
32437
+ const decode$$ = (attrs) => {
32366
32438
  const { pos } = attrs || {};
32367
32439
  return pos;
32368
32440
  };
32369
32441
  const attrConfig$B = Object.freeze({
32370
32442
  xmlName: "w:pos",
32371
32443
  sdName: "pos",
32372
- encode: encode$15,
32373
- decode: decode$Z
32444
+ encode: encode$17,
32445
+ decode: decode$$
32374
32446
  });
32375
- const validXmlAttributes$l = [attrConfig$D, attrConfig$B, attrConfig$C];
32376
- const XML_NODE_NAME$x = "w:tab";
32447
+ const validXmlAttributes$n = [attrConfig$D, attrConfig$B, attrConfig$C];
32448
+ const XML_NODE_NAME$z = "w:tab";
32377
32449
  const SD_NODE_NAME$g = "tab";
32378
- const encode$14 = (_2, encodedAttrs = {}) => {
32450
+ const encode$16 = (_2, encodedAttrs = {}) => {
32379
32451
  const translated = { type: "tab" };
32380
32452
  if (encodedAttrs) translated.attrs = { ...encodedAttrs };
32381
32453
  return translated;
32382
32454
  };
32383
- const decode$Y = (params2, decodedAttrs = {}) => {
32455
+ const decode$_ = (params2, decodedAttrs = {}) => {
32384
32456
  const { node } = params2 || {};
32385
32457
  if (!node) return;
32386
32458
  const wTab = { name: "w:tab" };
@@ -32396,15 +32468,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32396
32468
  }
32397
32469
  return translated;
32398
32470
  };
32399
- const config$u = {
32400
- xmlName: XML_NODE_NAME$x,
32471
+ const config$w = {
32472
+ xmlName: XML_NODE_NAME$z,
32401
32473
  sdNodeOrKeyName: SD_NODE_NAME$g,
32402
32474
  type: NodeTranslator.translatorTypes.NODE,
32403
- encode: encode$14,
32404
- decode: decode$Y,
32405
- attributes: validXmlAttributes$l
32475
+ encode: encode$16,
32476
+ decode: decode$_,
32477
+ attributes: validXmlAttributes$n
32406
32478
  };
32407
- const translator$18 = NodeTranslator.from(config$u);
32479
+ const translator$1a = NodeTranslator.from(config$w);
32408
32480
  const mergeTextNodes = (nodes) => {
32409
32481
  if (!nodes || !Array.isArray(nodes)) {
32410
32482
  return nodes;
@@ -32922,91 +32994,91 @@ Please report this to https://github.com/markedjs/marked.`, e) {
32922
32994
  }
32923
32995
  return schemaNode;
32924
32996
  };
32925
- const encode$13 = (attributes) => {
32997
+ const encode$15 = (attributes) => {
32926
32998
  return attributes["w:rsidDel"];
32927
32999
  };
32928
- const decode$X = (attrs) => {
33000
+ const decode$Z = (attrs) => {
32929
33001
  return attrs.rsidDel;
32930
33002
  };
32931
33003
  const attrConfig$A = Object.freeze({
32932
33004
  xmlName: "w:rsidDel",
32933
33005
  sdName: "rsidDel",
32934
- encode: encode$13,
32935
- decode: decode$X
33006
+ encode: encode$15,
33007
+ decode: decode$Z
32936
33008
  });
32937
- const encode$12 = (attributes) => {
33009
+ const encode$14 = (attributes) => {
32938
33010
  return attributes["w:rsidP"];
32939
33011
  };
32940
- const decode$W = (attrs) => {
33012
+ const decode$Y = (attrs) => {
32941
33013
  return attrs.rsidP;
32942
33014
  };
32943
33015
  const attrConfig$z = Object.freeze({
32944
33016
  xmlName: "w:rsidP",
32945
33017
  sdName: "rsidP",
32946
- encode: encode$12,
32947
- decode: decode$W
33018
+ encode: encode$14,
33019
+ decode: decode$Y
32948
33020
  });
32949
- const encode$11 = (attributes) => {
33021
+ const encode$13 = (attributes) => {
32950
33022
  return attributes["w:rsidR"];
32951
33023
  };
32952
- const decode$V = (attrs) => {
33024
+ const decode$X = (attrs) => {
32953
33025
  return attrs.rsidR;
32954
33026
  };
32955
33027
  const attrConfig$y = Object.freeze({
32956
33028
  xmlName: "w:rsidR",
32957
33029
  sdName: "rsidR",
32958
- encode: encode$11,
32959
- decode: decode$V
33030
+ encode: encode$13,
33031
+ decode: decode$X
32960
33032
  });
32961
- const encode$10 = (attributes) => {
33033
+ const encode$12 = (attributes) => {
32962
33034
  return attributes["w:rsidRPr"];
32963
33035
  };
32964
- const decode$U = (attrs) => {
33036
+ const decode$W = (attrs) => {
32965
33037
  return attrs.rsidRPr;
32966
33038
  };
32967
33039
  const attrConfig$x = Object.freeze({
32968
33040
  xmlName: "w:rsidRPr",
32969
33041
  sdName: "rsidRPr",
32970
- encode: encode$10,
32971
- decode: decode$U
33042
+ encode: encode$12,
33043
+ decode: decode$W
32972
33044
  });
32973
- const encode$$ = (attributes) => {
33045
+ const encode$11 = (attributes) => {
32974
33046
  return attributes["w:rsidRDefault"];
32975
33047
  };
32976
- const decode$T = (attrs) => {
33048
+ const decode$V = (attrs) => {
32977
33049
  return attrs.rsidRDefault;
32978
33050
  };
32979
33051
  const attrConfig$w = Object.freeze({
32980
33052
  xmlName: "w:rsidRDefault",
32981
33053
  sdName: "rsidRDefault",
32982
- encode: encode$$,
32983
- decode: decode$T
33054
+ encode: encode$11,
33055
+ decode: decode$V
32984
33056
  });
32985
- const encode$_ = (attributes) => {
33057
+ const encode$10 = (attributes) => {
32986
33058
  return attributes["w14:paraId"];
32987
33059
  };
32988
- const decode$S = (attrs) => {
33060
+ const decode$U = (attrs) => {
32989
33061
  return attrs.paraId;
32990
33062
  };
32991
33063
  const attrConfig$v = Object.freeze({
32992
33064
  xmlName: "w14:paraId",
32993
33065
  sdName: "paraId",
32994
- encode: encode$_,
32995
- decode: decode$S
33066
+ encode: encode$10,
33067
+ decode: decode$U
32996
33068
  });
32997
- const encode$Z = (attributes) => {
33069
+ const encode$$ = (attributes) => {
32998
33070
  return attributes["w14:textId"];
32999
33071
  };
33000
- const decode$R = (attrs) => {
33072
+ const decode$T = (attrs) => {
33001
33073
  return attrs.textId;
33002
33074
  };
33003
33075
  const attrConfig$u = Object.freeze({
33004
33076
  xmlName: "w14:textId",
33005
33077
  sdName: "textId",
33006
- encode: encode$Z,
33007
- decode: decode$R
33078
+ encode: encode$$,
33079
+ decode: decode$T
33008
33080
  });
33009
- const validXmlAttributes$k = [
33081
+ const validXmlAttributes$m = [
33010
33082
  attrConfig$v,
33011
33083
  attrConfig$u,
33012
33084
  attrConfig$y,
@@ -33015,9 +33087,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33015
33087
  attrConfig$x,
33016
33088
  attrConfig$A
33017
33089
  ];
33018
- const XML_NODE_NAME$w = "w:p";
33090
+ const XML_NODE_NAME$y = "w:p";
33019
33091
  const SD_NODE_NAME$f = "paragraph";
33020
- const encode$Y = (params2, encodedAttrs = {}) => {
33092
+ const encode$_ = (params2, encodedAttrs = {}) => {
33021
33093
  const node = handleParagraphNode$1(params2);
33022
33094
  if (!node) return void 0;
33023
33095
  if (encodedAttrs && Object.keys(encodedAttrs).length) {
@@ -33025,7 +33097,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33025
33097
  }
33026
33098
  return node;
33027
33099
  };
33028
- const decode$Q = (params2, decodedAttrs = {}) => {
33100
+ const decode$S = (params2, decodedAttrs = {}) => {
33029
33101
  const translated = translateParagraphNode(params2);
33030
33102
  if (!translated) return void 0;
33031
33103
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
@@ -33033,16 +33105,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33033
33105
  }
33034
33106
  return translated;
33035
33107
  };
33036
- const config$t = {
33037
- xmlName: XML_NODE_NAME$w,
33108
+ const config$v = {
33109
+ xmlName: XML_NODE_NAME$y,
33038
33110
  sdNodeOrKeyName: SD_NODE_NAME$f,
33039
33111
  type: NodeTranslator.translatorTypes.NODE,
33040
- encode: encode$Y,
33041
- decode: decode$Q,
33042
- attributes: validXmlAttributes$k
33112
+ encode: encode$_,
33113
+ decode: decode$S,
33114
+ attributes: validXmlAttributes$m
33043
33115
  };
33044
- const translator$17 = NodeTranslator.from(config$t);
33045
- const encode$X = (attributes) => {
33116
+ const translator$19 = NodeTranslator.from(config$v);
33117
+ const encode$Z = (attributes) => {
33046
33118
  const raw = attributes?.["w:val"];
33047
33119
  if (raw === void 0 || raw === null) return void 0;
33048
33120
  if (typeof raw === "boolean") return raw;
@@ -33052,24 +33124,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33052
33124
  if (val === "1" || val === "true" || val === "on") return true;
33053
33125
  return void 0;
33054
33126
  };
33055
- const decode$P = (runProps) => {
33127
+ const decode$R = (runProps) => {
33056
33128
  if (runProps?.bold === false) return "0";
33057
33129
  return void 0;
33058
33130
  };
33059
33131
  const attrConfig$t = Object.freeze({
33060
33132
  xmlName: "w:val",
33061
33133
  sdName: "bold",
33062
- encode: encode$X,
33063
- decode: decode$P
33134
+ encode: encode$Z,
33135
+ decode: decode$R
33064
33136
  });
33065
- const validXmlAttributes$j = [attrConfig$t];
33066
- const XML_NODE_NAME$v = "w:b";
33067
- const SD_ATTR_KEY$f = "bold";
33068
- const encode$W = (params2, encodedAttrs = {}) => {
33137
+ const validXmlAttributes$l = [attrConfig$t];
33138
+ const XML_NODE_NAME$x = "w:b";
33139
+ const SD_ATTR_KEY$h = "bold";
33140
+ const encode$Y = (params2, encodedAttrs = {}) => {
33069
33141
  const { nodes } = params2;
33070
33142
  const node = nodes[0];
33071
33143
  if (!node) return void 0;
33072
- const val = encodedAttrs?.[SD_ATTR_KEY$f];
33144
+ const val = encodedAttrs?.[SD_ATTR_KEY$h];
33073
33145
  let attributes;
33074
33146
  if (val === false) attributes = { "w:val": "0" };
33075
33147
  else if (val === true)
@@ -33077,85 +33149,85 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33077
33149
  else attributes = node.attributes || {};
33078
33150
  return {
33079
33151
  type: "attr",
33080
- xmlName: XML_NODE_NAME$v,
33081
- sdNodeOrKeyName: SD_ATTR_KEY$f,
33152
+ xmlName: XML_NODE_NAME$x,
33153
+ sdNodeOrKeyName: SD_ATTR_KEY$h,
33082
33154
  attributes
33083
33155
  };
33084
33156
  };
33085
- const config$s = {
33086
- xmlName: XML_NODE_NAME$v,
33087
- sdNodeOrKeyName: SD_ATTR_KEY$f,
33157
+ const config$u = {
33158
+ xmlName: XML_NODE_NAME$x,
33159
+ sdNodeOrKeyName: SD_ATTR_KEY$h,
33088
33160
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33089
- encode: encode$W,
33090
- attributes: validXmlAttributes$j
33161
+ encode: encode$Y,
33162
+ attributes: validXmlAttributes$l
33091
33163
  };
33092
- const translator$16 = NodeTranslator.from(config$s);
33093
- const XML_NODE_NAME$u = "w:i";
33094
- const SD_ATTR_KEY$e = "italic";
33095
- const encode$V = (params2) => {
33164
+ const translator$18 = NodeTranslator.from(config$u);
33165
+ const XML_NODE_NAME$w = "w:i";
33166
+ const SD_ATTR_KEY$g = "italic";
33167
+ const encode$X = (params2) => {
33096
33168
  const { nodes } = params2;
33097
33169
  const node = nodes?.[0];
33098
33170
  if (!node) return void 0;
33099
33171
  return {
33100
33172
  type: "attr",
33101
- xmlName: XML_NODE_NAME$u,
33102
- sdNodeOrKeyName: SD_ATTR_KEY$e,
33173
+ xmlName: XML_NODE_NAME$w,
33174
+ sdNodeOrKeyName: SD_ATTR_KEY$g,
33103
33175
  attributes: {
33104
33176
  "w:val": node.attributes?.["w:val"] ?? null
33105
33177
  }
33106
33178
  };
33107
33179
  };
33108
- const config$r = {
33109
- xmlName: XML_NODE_NAME$u,
33110
- sdNodeOrKeyName: SD_ATTR_KEY$e,
33180
+ const config$t = {
33181
+ xmlName: XML_NODE_NAME$w,
33182
+ sdNodeOrKeyName: SD_ATTR_KEY$g,
33111
33183
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33112
- encode: encode$V
33184
+ encode: encode$X
33113
33185
  };
33114
- const translator$15 = NodeTranslator.from(config$r);
33115
- const encode$U = (attributes) => attributes?.["w:val"];
33116
- const decode$O = (attrs) => attrs?.underline;
33186
+ const translator$17 = NodeTranslator.from(config$t);
33187
+ const encode$W = (attributes) => attributes?.["w:val"];
33188
+ const decode$Q = (attrs) => attrs?.underline;
33117
33189
  const attrConfig$s = Object.freeze({
33118
33190
  xmlName: "w:val",
33119
33191
  sdName: "underline",
33120
- encode: encode$U,
33121
- decode: decode$O
33192
+ encode: encode$W,
33193
+ decode: decode$Q
33122
33194
  });
33123
- const encode$T = (attributes) => attributes?.["w:color"];
33124
- const decode$N = (attrs) => attrs?.color;
33195
+ const encode$V = (attributes) => attributes?.["w:color"];
33196
+ const decode$P = (attrs) => attrs?.color;
33125
33197
  const attrConfig$r = Object.freeze({
33126
33198
  xmlName: "w:color",
33127
33199
  sdName: "color",
33128
- encode: encode$T,
33129
- decode: decode$N
33200
+ encode: encode$V,
33201
+ decode: decode$P
33130
33202
  });
33131
- const encode$S = (attributes) => attributes?.["w:themeColor"];
33132
- const decode$M = (attrs) => attrs?.themeColor;
33203
+ const encode$U = (attributes) => attributes?.["w:themeColor"];
33204
+ const decode$O = (attrs) => attrs?.themeColor;
33133
33205
  const attrConfig$q = Object.freeze({
33134
33206
  xmlName: "w:themeColor",
33135
33207
  sdName: "themeColor",
33136
- encode: encode$S,
33137
- decode: decode$M
33208
+ encode: encode$U,
33209
+ decode: decode$O
33138
33210
  });
33139
- const encode$R = (attributes) => attributes?.["w:themeTint"];
33140
- const decode$L = (attrs) => attrs?.themeTint;
33211
+ const encode$T = (attributes) => attributes?.["w:themeTint"];
33212
+ const decode$N = (attrs) => attrs?.themeTint;
33141
33213
  const attrConfig$p = Object.freeze({
33142
33214
  xmlName: "w:themeTint",
33143
33215
  sdName: "themeTint",
33144
- encode: encode$R,
33145
- decode: decode$L
33216
+ encode: encode$T,
33217
+ decode: decode$N
33146
33218
  });
33147
- const encode$Q = (attributes) => attributes?.["w:themeShade"];
33148
- const decode$K = (attrs) => attrs?.themeShade;
33219
+ const encode$S = (attributes) => attributes?.["w:themeShade"];
33220
+ const decode$M = (attrs) => attrs?.themeShade;
33149
33221
  const attrConfig$o = Object.freeze({
33150
33222
  xmlName: "w:themeShade",
33151
33223
  sdName: "themeShade",
33152
- encode: encode$Q,
33153
- decode: decode$K
33224
+ encode: encode$S,
33225
+ decode: decode$M
33154
33226
  });
33155
- const validXmlAttributes$i = [attrConfig$s, attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o];
33156
- const XML_NODE_NAME$t = "w:u";
33157
- const SD_ATTR_KEY$d = "underline";
33158
- const encode$P = (params2, encodedAttrs = {}) => {
33227
+ const validXmlAttributes$k = [attrConfig$s, attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o];
33228
+ const XML_NODE_NAME$v = "w:u";
33229
+ const SD_ATTR_KEY$f = "underline";
33230
+ const encode$R = (params2, encodedAttrs = {}) => {
33159
33231
  const { nodes } = params2;
33160
33232
  const node = nodes?.[0];
33161
33233
  const sourceAttrs = node?.attributes || {};
@@ -33171,12 +33243,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33171
33243
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
33172
33244
  return {
33173
33245
  type: "attr",
33174
- xmlName: XML_NODE_NAME$t,
33175
- sdNodeOrKeyName: SD_ATTR_KEY$d,
33246
+ xmlName: XML_NODE_NAME$v,
33247
+ sdNodeOrKeyName: SD_ATTR_KEY$f,
33176
33248
  attributes
33177
33249
  };
33178
33250
  };
33179
- const decode$J = (params2) => {
33251
+ const decode$L = (params2) => {
33180
33252
  const attrs = params2?.node?.attrs || {};
33181
33253
  const underlineType = attrs.underlineType ?? attrs.underline ?? null;
33182
33254
  const color = attrs.underlineColor ?? attrs.color ?? null;
@@ -33194,20 +33266,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33194
33266
  if (themeTint) attributes["w:themeTint"] = themeTint;
33195
33267
  if (themeShade) attributes["w:themeShade"] = themeShade;
33196
33268
  return {
33197
- name: XML_NODE_NAME$t,
33269
+ name: XML_NODE_NAME$v,
33198
33270
  attributes
33199
33271
  };
33200
33272
  };
33201
- const config$q = {
33202
- xmlName: XML_NODE_NAME$t,
33203
- sdNodeOrKeyName: SD_ATTR_KEY$d,
33273
+ const config$s = {
33274
+ xmlName: XML_NODE_NAME$v,
33275
+ sdNodeOrKeyName: SD_ATTR_KEY$f,
33204
33276
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33205
- encode: encode$P,
33206
- decode: decode$J,
33207
- attributes: validXmlAttributes$i
33277
+ encode: encode$R,
33278
+ decode: decode$L,
33279
+ attributes: validXmlAttributes$k
33208
33280
  };
33209
- const translator$14 = NodeTranslator.from(config$q);
33210
- const encode$O = (attributes) => {
33281
+ const translator$16 = NodeTranslator.from(config$s);
33282
+ const encode$Q = (attributes) => {
33211
33283
  const raw = attributes?.["w:val"];
33212
33284
  if (raw === void 0 || raw === null) return void 0;
33213
33285
  if (typeof raw === "boolean") return raw;
@@ -33217,24 +33289,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33217
33289
  if (val === "1" || val === "true" || val === "on") return true;
33218
33290
  return void 0;
33219
33291
  };
33220
- const decode$I = (attrs) => {
33292
+ const decode$K = (attrs) => {
33221
33293
  if (attrs?.strike === false) return "0";
33222
33294
  return void 0;
33223
33295
  };
33224
33296
  const attrConfig$n = Object.freeze({
33225
33297
  xmlName: "w:val",
33226
33298
  sdName: "strike",
33227
- encode: encode$O,
33228
- decode: decode$I
33299
+ encode: encode$Q,
33300
+ decode: decode$K
33229
33301
  });
33230
- const validXmlAttributes$h = [attrConfig$n];
33231
- const XML_NODE_NAME$s = "w:strike";
33232
- const SD_ATTR_KEY$c = "strike";
33233
- const encode$N = (params2, encodedAttrs = {}) => {
33302
+ const validXmlAttributes$j = [attrConfig$n];
33303
+ const XML_NODE_NAME$u = "w:strike";
33304
+ const SD_ATTR_KEY$e = "strike";
33305
+ const encode$P = (params2, encodedAttrs = {}) => {
33234
33306
  const { nodes } = params2;
33235
33307
  const node = nodes?.[0];
33236
33308
  if (!node) return void 0;
33237
- const val = encodedAttrs?.[SD_ATTR_KEY$c];
33309
+ const val = encodedAttrs?.[SD_ATTR_KEY$e];
33238
33310
  let attributes;
33239
33311
  if (val === false) attributes = { "w:val": "0" };
33240
33312
  else if (val === true) attributes = {};
@@ -33243,55 +33315,55 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33243
33315
  else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
33244
33316
  return {
33245
33317
  type: "attr",
33246
- xmlName: XML_NODE_NAME$s,
33247
- sdNodeOrKeyName: SD_ATTR_KEY$c,
33318
+ xmlName: XML_NODE_NAME$u,
33319
+ sdNodeOrKeyName: SD_ATTR_KEY$e,
33248
33320
  attributes
33249
33321
  };
33250
33322
  };
33251
- const config$p = {
33252
- xmlName: XML_NODE_NAME$s,
33253
- sdNodeOrKeyName: SD_ATTR_KEY$c,
33323
+ const config$r = {
33324
+ xmlName: XML_NODE_NAME$u,
33325
+ sdNodeOrKeyName: SD_ATTR_KEY$e,
33254
33326
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33255
- encode: encode$N,
33256
- attributes: validXmlAttributes$h
33327
+ encode: encode$P,
33328
+ attributes: validXmlAttributes$j
33257
33329
  };
33258
- const translator$13 = NodeTranslator.from(config$p);
33259
- const encode$M = (attributes) => attributes?.["w:val"];
33260
- const decode$H = (attrs) => attrs?.color;
33330
+ const translator$15 = NodeTranslator.from(config$r);
33331
+ const encode$O = (attributes) => attributes?.["w:val"];
33332
+ const decode$J = (attrs) => attrs?.color;
33261
33333
  const attrConfig$m = Object.freeze({
33262
33334
  xmlName: "w:val",
33263
33335
  sdName: "color",
33264
- encode: encode$M,
33265
- decode: decode$H
33336
+ encode: encode$O,
33337
+ decode: decode$J
33266
33338
  });
33267
- const encode$L = (attributes) => attributes?.["w:themeColor"];
33268
- const decode$G = (attrs) => attrs?.themeColor;
33339
+ const encode$N = (attributes) => attributes?.["w:themeColor"];
33340
+ const decode$I = (attrs) => attrs?.themeColor;
33269
33341
  const attrConfig$l = Object.freeze({
33270
33342
  xmlName: "w:themeColor",
33271
33343
  sdName: "themeColor",
33272
- encode: encode$L,
33273
- decode: decode$G
33344
+ encode: encode$N,
33345
+ decode: decode$I
33274
33346
  });
33275
- const encode$K = (attributes) => attributes?.["w:themeTint"];
33276
- const decode$F = (attrs) => attrs?.themeTint;
33347
+ const encode$M = (attributes) => attributes?.["w:themeTint"];
33348
+ const decode$H = (attrs) => attrs?.themeTint;
33277
33349
  const attrConfig$k = Object.freeze({
33278
33350
  xmlName: "w:themeTint",
33279
33351
  sdName: "themeTint",
33280
- encode: encode$K,
33281
- decode: decode$F
33352
+ encode: encode$M,
33353
+ decode: decode$H
33282
33354
  });
33283
- const encode$J = (attributes) => attributes?.["w:themeShade"];
33284
- const decode$E = (attrs) => attrs?.themeShade;
33355
+ const encode$L = (attributes) => attributes?.["w:themeShade"];
33356
+ const decode$G = (attrs) => attrs?.themeShade;
33285
33357
  const attrConfig$j = Object.freeze({
33286
33358
  xmlName: "w:themeShade",
33287
33359
  sdName: "themeShade",
33288
- encode: encode$J,
33289
- decode: decode$E
33360
+ encode: encode$L,
33361
+ decode: decode$G
33290
33362
  });
33291
- const validXmlAttributes$g = [attrConfig$m, attrConfig$l, attrConfig$k, attrConfig$j];
33292
- const XML_NODE_NAME$r = "w:color";
33293
- const SD_ATTR_KEY$b = "color";
33294
- const encode$I = (params2, encodedAttrs = {}) => {
33363
+ const validXmlAttributes$i = [attrConfig$m, attrConfig$l, attrConfig$k, attrConfig$j];
33364
+ const XML_NODE_NAME$t = "w:color";
33365
+ const SD_ATTR_KEY$d = "color";
33366
+ const encode$K = (params2, encodedAttrs = {}) => {
33295
33367
  const { nodes } = params2;
33296
33368
  const node = nodes?.[0];
33297
33369
  const sourceAttrs = node?.attributes || {};
@@ -33306,63 +33378,63 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33306
33378
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
33307
33379
  return {
33308
33380
  type: "attr",
33309
- xmlName: XML_NODE_NAME$r,
33310
- sdNodeOrKeyName: SD_ATTR_KEY$b,
33381
+ xmlName: XML_NODE_NAME$t,
33382
+ sdNodeOrKeyName: SD_ATTR_KEY$d,
33311
33383
  attributes
33312
33384
  };
33313
33385
  };
33314
- const config$o = {
33315
- xmlName: XML_NODE_NAME$r,
33316
- sdNodeOrKeyName: SD_ATTR_KEY$b,
33386
+ const config$q = {
33387
+ xmlName: XML_NODE_NAME$t,
33388
+ sdNodeOrKeyName: SD_ATTR_KEY$d,
33317
33389
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33318
- encode: encode$I,
33319
- attributes: validXmlAttributes$g
33390
+ encode: encode$K,
33391
+ attributes: validXmlAttributes$i
33320
33392
  };
33321
- const translator$12 = NodeTranslator.from(config$o);
33322
- const encode$H = (attributes) => attributes?.["w:eastAsia"];
33323
- const decode$D = (attrs) => attrs?.eastAsia;
33393
+ const translator$14 = NodeTranslator.from(config$q);
33394
+ const encode$J = (attributes) => attributes?.["w:eastAsia"];
33395
+ const decode$F = (attrs) => attrs?.eastAsia;
33324
33396
  const attrConfig$i = Object.freeze({
33325
33397
  xmlName: "w:eastAsia",
33326
33398
  sdName: "eastAsia",
33327
- encode: encode$H,
33328
- decode: decode$D
33399
+ encode: encode$J,
33400
+ decode: decode$F
33329
33401
  });
33330
- const encode$G = (attributes) => attributes?.["w:ascii"];
33331
- const decode$C = (attrs) => attrs?.ascii;
33402
+ const encode$I = (attributes) => attributes?.["w:ascii"];
33403
+ const decode$E = (attrs) => attrs?.ascii;
33332
33404
  const attrConfig$h = Object.freeze({
33333
33405
  xmlName: "w:ascii",
33334
33406
  sdName: "ascii",
33335
- encode: encode$G,
33336
- decode: decode$C
33407
+ encode: encode$I,
33408
+ decode: decode$E
33337
33409
  });
33338
- const encode$F = (attributes) => attributes?.["w:hAnsi"];
33339
- const decode$B = (attrs) => attrs?.hAnsi;
33410
+ const encode$H = (attributes) => attributes?.["w:hAnsi"];
33411
+ const decode$D = (attrs) => attrs?.hAnsi;
33340
33412
  const attrConfig$g = Object.freeze({
33341
33413
  xmlName: "w:hAnsi",
33342
33414
  sdName: "hAnsi",
33343
- encode: encode$F,
33344
- decode: decode$B
33415
+ encode: encode$H,
33416
+ decode: decode$D
33345
33417
  });
33346
- const encode$E = (attributes) => attributes?.["w:cs"];
33347
- const decode$A = (attrs) => attrs?.cs;
33418
+ const encode$G = (attributes) => attributes?.["w:cs"];
33419
+ const decode$C = (attrs) => attrs?.cs;
33348
33420
  const attrConfig$f = Object.freeze({
33349
33421
  xmlName: "w:cs",
33350
33422
  sdName: "cs",
33351
- encode: encode$E,
33352
- decode: decode$A
33423
+ encode: encode$G,
33424
+ decode: decode$C
33353
33425
  });
33354
- const encode$D = (attributes) => attributes?.["w:val"];
33355
- const decode$z = (attrs) => attrs?.value;
33426
+ const encode$F = (attributes) => attributes?.["w:val"];
33427
+ const decode$B = (attrs) => attrs?.value;
33356
33428
  const attrConfig$e = Object.freeze({
33357
33429
  xmlName: "w:val",
33358
33430
  sdName: "value",
33359
- encode: encode$D,
33360
- decode: decode$z
33431
+ encode: encode$F,
33432
+ decode: decode$B
33361
33433
  });
33362
- const validXmlAttributes$f = [attrConfig$i, attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e];
33363
- const XML_NODE_NAME$q = "w:rFonts";
33364
- const SD_ATTR_KEY$a = "fontFamily";
33365
- const encode$C = (params2, encodedAttrs = {}) => {
33434
+ const validXmlAttributes$h = [attrConfig$i, attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e];
33435
+ const XML_NODE_NAME$s = "w:rFonts";
33436
+ const SD_ATTR_KEY$c = "fontFamily";
33437
+ const encode$E = (params2, encodedAttrs = {}) => {
33366
33438
  const { nodes } = params2;
33367
33439
  const node = nodes?.[0];
33368
33440
  const sourceAttrs = node?.attributes || {};
@@ -33388,109 +33460,109 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33388
33460
  if (attributes["w:val"] === void 0) delete attributes["w:val"];
33389
33461
  return {
33390
33462
  type: "attr",
33391
- xmlName: XML_NODE_NAME$q,
33392
- sdNodeOrKeyName: SD_ATTR_KEY$a,
33463
+ xmlName: XML_NODE_NAME$s,
33464
+ sdNodeOrKeyName: SD_ATTR_KEY$c,
33393
33465
  attributes
33394
33466
  };
33395
33467
  };
33396
- const config$n = {
33397
- xmlName: XML_NODE_NAME$q,
33398
- sdNodeOrKeyName: SD_ATTR_KEY$a,
33468
+ const config$p = {
33469
+ xmlName: XML_NODE_NAME$s,
33470
+ sdNodeOrKeyName: SD_ATTR_KEY$c,
33399
33471
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33400
- encode: encode$C,
33401
- attributes: validXmlAttributes$f
33472
+ encode: encode$E,
33473
+ attributes: validXmlAttributes$h
33402
33474
  };
33403
- const translator$11 = NodeTranslator.from(config$n);
33404
- const encode$B = (attributes) => attributes?.["w:val"];
33405
- const decode$y = (attrs) => attrs?.styleId;
33475
+ const translator$13 = NodeTranslator.from(config$p);
33476
+ const encode$D = (attributes) => attributes?.["w:val"];
33477
+ const decode$A = (attrs) => attrs?.styleId;
33406
33478
  const attrConfig$d = Object.freeze({
33407
33479
  xmlName: "w:val",
33408
33480
  sdName: "styleId",
33409
- encode: encode$B,
33410
- decode: decode$y
33481
+ encode: encode$D,
33482
+ decode: decode$A
33411
33483
  });
33412
- const validXmlAttributes$e = [attrConfig$d];
33413
- const XML_NODE_NAME$p = "w:rStyle";
33414
- const SD_ATTR_KEY$9 = "styleId";
33415
- const encode$A = (params2, encodedAttrs = {}) => {
33484
+ const validXmlAttributes$g = [attrConfig$d];
33485
+ const XML_NODE_NAME$r = "w:rStyle";
33486
+ const SD_ATTR_KEY$b = "styleId";
33487
+ const encode$C = (params2, encodedAttrs = {}) => {
33416
33488
  const { nodes } = params2;
33417
33489
  const node = nodes?.[0];
33418
33490
  const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
33419
33491
  return {
33420
33492
  type: "attr",
33421
- xmlName: XML_NODE_NAME$p,
33422
- sdNodeOrKeyName: SD_ATTR_KEY$9,
33493
+ xmlName: XML_NODE_NAME$r,
33494
+ sdNodeOrKeyName: SD_ATTR_KEY$b,
33423
33495
  attributes: { "w:val": value ?? null }
33424
33496
  };
33425
33497
  };
33426
- const config$m = {
33427
- xmlName: XML_NODE_NAME$p,
33428
- sdNodeOrKeyName: SD_ATTR_KEY$9,
33498
+ const config$o = {
33499
+ xmlName: XML_NODE_NAME$r,
33500
+ sdNodeOrKeyName: SD_ATTR_KEY$b,
33429
33501
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33430
- encode: encode$A,
33431
- attributes: validXmlAttributes$e
33502
+ encode: encode$C,
33503
+ attributes: validXmlAttributes$g
33432
33504
  };
33433
- const translator$10 = NodeTranslator.from(config$m);
33434
- const encode$z = (attributes) => attributes?.["w:val"];
33435
- const decode$x = (attrs) => attrs?.fontSize;
33505
+ const translator$12 = NodeTranslator.from(config$o);
33506
+ const encode$B = (attributes) => attributes?.["w:val"];
33507
+ const decode$z = (attrs) => attrs?.fontSize;
33436
33508
  const attrConfig$c = Object.freeze({
33437
33509
  xmlName: "w:val",
33438
33510
  sdName: "fontSize",
33439
- encode: encode$z,
33440
- decode: decode$x
33511
+ encode: encode$B,
33512
+ decode: decode$z
33441
33513
  });
33442
- const validXmlAttributes$d = [attrConfig$c];
33443
- const XML_NODE_NAME$o = "w:sz";
33444
- const SD_ATTR_KEY$8 = "fontSize";
33445
- const encode$y = (params2, encodedAttrs = {}) => {
33514
+ const validXmlAttributes$f = [attrConfig$c];
33515
+ const XML_NODE_NAME$q = "w:sz";
33516
+ const SD_ATTR_KEY$a = "fontSize";
33517
+ const encode$A = (params2, encodedAttrs = {}) => {
33446
33518
  const { nodes } = params2;
33447
33519
  const node = nodes?.[0];
33448
33520
  const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
33449
33521
  return {
33450
33522
  type: "attr",
33451
- xmlName: XML_NODE_NAME$o,
33452
- sdNodeOrKeyName: SD_ATTR_KEY$8,
33523
+ xmlName: XML_NODE_NAME$q,
33524
+ sdNodeOrKeyName: SD_ATTR_KEY$a,
33453
33525
  attributes: { "w:val": value ?? null }
33454
33526
  };
33455
33527
  };
33456
- const config$l = {
33457
- xmlName: XML_NODE_NAME$o,
33458
- sdNodeOrKeyName: SD_ATTR_KEY$8,
33528
+ const config$n = {
33529
+ xmlName: XML_NODE_NAME$q,
33530
+ sdNodeOrKeyName: SD_ATTR_KEY$a,
33459
33531
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33460
- encode: encode$y,
33461
- attributes: validXmlAttributes$d
33532
+ encode: encode$A,
33533
+ attributes: validXmlAttributes$f
33462
33534
  };
33463
- const translator$$ = NodeTranslator.from(config$l);
33464
- const encode$x = (attributes) => attributes?.["w:val"];
33465
- const decode$w = (attrs) => attrs?.fontSizeCs;
33535
+ const translator$11 = NodeTranslator.from(config$n);
33536
+ const encode$z = (attributes) => attributes?.["w:val"];
33537
+ const decode$y = (attrs) => attrs?.fontSizeCs;
33466
33538
  const attrConfig$b = Object.freeze({
33467
33539
  xmlName: "w:val",
33468
33540
  sdName: "fontSizeCs",
33469
- encode: encode$x,
33470
- decode: decode$w
33541
+ encode: encode$z,
33542
+ decode: decode$y
33471
33543
  });
33472
- const validXmlAttributes$c = [attrConfig$b];
33473
- const XML_NODE_NAME$n = "w:szCs";
33474
- const SD_ATTR_KEY$7 = "fontSizeCs";
33475
- const encode$w = (params2, encodedAttrs = {}) => {
33544
+ const validXmlAttributes$e = [attrConfig$b];
33545
+ const XML_NODE_NAME$p = "w:szCs";
33546
+ const SD_ATTR_KEY$9 = "fontSizeCs";
33547
+ const encode$y = (params2, encodedAttrs = {}) => {
33476
33548
  const { nodes } = params2;
33477
33549
  const node = nodes?.[0];
33478
33550
  const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
33479
33551
  return {
33480
33552
  type: "attr",
33481
- xmlName: XML_NODE_NAME$n,
33482
- sdNodeOrKeyName: SD_ATTR_KEY$7,
33553
+ xmlName: XML_NODE_NAME$p,
33554
+ sdNodeOrKeyName: SD_ATTR_KEY$9,
33483
33555
  attributes: { "w:val": value ?? null }
33484
33556
  };
33485
33557
  };
33486
- const config$k = {
33487
- xmlName: XML_NODE_NAME$n,
33488
- sdNodeOrKeyName: SD_ATTR_KEY$7,
33558
+ const config$m = {
33559
+ xmlName: XML_NODE_NAME$p,
33560
+ sdNodeOrKeyName: SD_ATTR_KEY$9,
33489
33561
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33490
- encode: encode$w,
33491
- attributes: validXmlAttributes$c
33562
+ encode: encode$y,
33563
+ attributes: validXmlAttributes$e
33492
33564
  };
33493
- const translator$_ = NodeTranslator.from(config$k);
33565
+ const translator$10 = NodeTranslator.from(config$m);
33494
33566
  const generateV2HandlerEntity = (handlerName, translator2) => ({
33495
33567
  handlerName,
33496
33568
  handler: (params2) => {
@@ -33624,9 +33696,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33624
33696
  const intValue = parseInteger(value);
33625
33697
  return intValue != void 0 ? String(intValue) : void 0;
33626
33698
  };
33627
- const XML_NODE_NAME$m = "w:caps";
33628
- const SD_ATTR_KEY$6 = "textTransform";
33629
- const encode$v = (params2, encodedAttrs = {}) => {
33699
+ const XML_NODE_NAME$o = "w:caps";
33700
+ const SD_ATTR_KEY$8 = "textTransform";
33701
+ const encode$x = (params2, encodedAttrs = {}) => {
33630
33702
  const { nodes } = params2;
33631
33703
  const node = nodes[0];
33632
33704
  if (!node) return void 0;
@@ -33638,31 +33710,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33638
33710
  }
33639
33711
  return {
33640
33712
  type: "attr",
33641
- xmlName: XML_NODE_NAME$m,
33642
- sdNodeOrKeyName: SD_ATTR_KEY$6,
33643
- attributes: { [SD_ATTR_KEY$6]: result }
33713
+ xmlName: XML_NODE_NAME$o,
33714
+ sdNodeOrKeyName: SD_ATTR_KEY$8,
33715
+ attributes: { [SD_ATTR_KEY$8]: result }
33644
33716
  };
33645
33717
  };
33646
- const config$j = {
33647
- xmlName: XML_NODE_NAME$m,
33648
- sdNodeOrKeyName: SD_ATTR_KEY$6,
33718
+ const config$l = {
33719
+ xmlName: XML_NODE_NAME$o,
33720
+ sdNodeOrKeyName: SD_ATTR_KEY$8,
33649
33721
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33650
- encode: encode$v,
33722
+ encode: encode$x,
33651
33723
  attributes: [createAttributeHandler("w:val")]
33652
33724
  };
33653
- const translator$Z = NodeTranslator.from(config$j);
33725
+ const translator$$ = NodeTranslator.from(config$l);
33654
33726
  const runPropertyTranslators = Object.freeze({
33655
- "w:b": translator$16,
33656
- "w:i": translator$15,
33657
- "w:u": translator$14,
33658
- "w:strike": translator$13,
33659
- "w:color": translator$12,
33660
- "w:highlight": translator$19,
33661
- "w:rFonts": translator$11,
33662
- "w:rStyle": translator$10,
33663
- "w:sz": translator$$,
33664
- "w:szCs": translator$_,
33665
- "w:caps": translator$Z
33727
+ "w:b": translator$18,
33728
+ "w:i": translator$17,
33729
+ "w:u": translator$16,
33730
+ "w:strike": translator$15,
33731
+ "w:color": translator$14,
33732
+ "w:highlight": translator$1b,
33733
+ "w:rFonts": translator$13,
33734
+ "w:rStyle": translator$12,
33735
+ "w:sz": translator$11,
33736
+ "w:szCs": translator$10,
33737
+ "w:caps": translator$$
33666
33738
  });
33667
33739
  const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
33668
33740
  const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
@@ -33676,9 +33748,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33676
33748
  attributes: { ...candidate.attributes || {} }
33677
33749
  };
33678
33750
  };
33679
- const XML_NODE_NAME$l = "w:rPr";
33680
- const SD_ATTR_KEY$5 = "runProperties";
33681
- const encode$u = (params2) => {
33751
+ const XML_NODE_NAME$n = "w:rPr";
33752
+ const SD_ATTR_KEY$7 = "runProperties";
33753
+ const encode$w = (params2) => {
33682
33754
  const { nodes } = params2;
33683
33755
  const node = nodes?.[0] || {};
33684
33756
  const contents = Array.isArray(node.elements) ? node.elements : [];
@@ -33712,16 +33784,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
33712
33784
  attributes: runPropsArray
33713
33785
  };
33714
33786
  };
33715
- const config$i = {
33716
- xmlName: XML_NODE_NAME$l,
33717
- sdNodeOrKeyName: SD_ATTR_KEY$5,
33787
+ const config$k = {
33788
+ xmlName: XML_NODE_NAME$n,
33789
+ sdNodeOrKeyName: SD_ATTR_KEY$7,
33718
33790
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
33719
- encode: encode$u
33791
+ encode: encode$w
33720
33792
  };
33721
- const translator$Y = NodeTranslator.from(config$i);
33793
+ const translator$_ = NodeTranslator.from(config$k);
33722
33794
  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;
33723
33795
  const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
33724
- const collectRunProperties = (params2, rPrNode, translator2 = translator$Y) => {
33796
+ const collectRunProperties = (params2, rPrNode, translator2 = translator$_) => {
33725
33797
  if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
33726
33798
  const result = translator2.encode({ ...params2, nodes: [rPrNode] }) || {};
33727
33799
  let entries = [];
@@ -34194,7 +34266,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34194
34266
  }
34195
34267
  return runs;
34196
34268
  };
34197
- const XML_NODE_NAME$k = "w:hyperlink";
34269
+ const XML_NODE_NAME$m = "w:hyperlink";
34198
34270
  const SD_NODE_NAME$e = "link";
34199
34271
  const _createAttributeHandler = (xmlName, sdName) => ({
34200
34272
  xmlName,
@@ -34202,7 +34274,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34202
34274
  encode: (attributes) => attributes[xmlName],
34203
34275
  decode: (attributes) => attributes[sdName]
34204
34276
  });
34205
- const validXmlAttributes$b = [
34277
+ const validXmlAttributes$d = [
34206
34278
  _createAttributeHandler("w:anchor", "anchor"),
34207
34279
  _createAttributeHandler("w:docLocation", "docLocation"),
34208
34280
  {
@@ -34215,7 +34287,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34215
34287
  _createAttributeHandler("r:id", "rId"),
34216
34288
  _createAttributeHandler("w:tgtFrame", "target")
34217
34289
  ];
34218
- const encode$t = (params2, encodedAttrs) => {
34290
+ const encode$v = (params2, encodedAttrs) => {
34219
34291
  const { nodes, docx, nodeListHandler } = params2;
34220
34292
  const node = nodes[0];
34221
34293
  let href = _resolveHref(docx, encodedAttrs);
@@ -34249,7 +34321,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34249
34321
  }
34250
34322
  return href;
34251
34323
  };
34252
- function decode$v(params2) {
34324
+ function decode$x(params2) {
34253
34325
  const { hyperlinkGroup = [params2.node] } = params2.extraParams || {};
34254
34326
  const node = hyperlinkGroup[0];
34255
34327
  const linkMark = node.marks.find((m2) => m2.type === "link");
@@ -34298,55 +34370,55 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34298
34370
  });
34299
34371
  return id;
34300
34372
  }
34301
- const config$h = {
34302
- xmlName: XML_NODE_NAME$k,
34373
+ const config$j = {
34374
+ xmlName: XML_NODE_NAME$m,
34303
34375
  sdNodeOrKeyName: SD_NODE_NAME$e,
34304
34376
  type: NodeTranslator.translatorTypes.NODE,
34305
- encode: encode$t,
34306
- decode: decode$v,
34307
- attributes: validXmlAttributes$b
34377
+ encode: encode$v,
34378
+ decode: decode$x,
34379
+ attributes: validXmlAttributes$d
34308
34380
  };
34309
- const translator$X = NodeTranslator.from(config$h);
34310
- const encode$s = (attributes) => {
34381
+ const translator$Z = NodeTranslator.from(config$j);
34382
+ const encode$u = (attributes) => {
34311
34383
  return attributes["w:rsidR"];
34312
34384
  };
34313
- const decode$u = (attrs) => {
34385
+ const decode$w = (attrs) => {
34314
34386
  return attrs.rsidR;
34315
34387
  };
34316
34388
  const attrConfig$a = Object.freeze({
34317
34389
  xmlName: "w:rsidR",
34318
34390
  sdName: "rsidR",
34319
- encode: encode$s,
34320
- decode: decode$u
34391
+ encode: encode$u,
34392
+ decode: decode$w
34321
34393
  });
34322
- const encode$r = (attributes) => {
34394
+ const encode$t = (attributes) => {
34323
34395
  return attributes["w:rsidRPr"];
34324
34396
  };
34325
- const decode$t = (attrs) => {
34397
+ const decode$v = (attrs) => {
34326
34398
  return attrs.rsidRPr;
34327
34399
  };
34328
34400
  const attrConfig$9 = Object.freeze({
34329
34401
  xmlName: "w:rsidRPr",
34330
34402
  sdName: "rsidRPr",
34331
- encode: encode$r,
34332
- decode: decode$t
34403
+ encode: encode$t,
34404
+ decode: decode$v
34333
34405
  });
34334
- const encode$q = (attributes) => {
34406
+ const encode$s = (attributes) => {
34335
34407
  return attributes["w:rsidDel"];
34336
34408
  };
34337
- const decode$s = (attrs) => {
34409
+ const decode$u = (attrs) => {
34338
34410
  return attrs.rsidDel;
34339
34411
  };
34340
34412
  const attrConfig$8 = Object.freeze({
34341
34413
  xmlName: "w:rsidDel",
34342
34414
  sdName: "rsidDel",
34343
- encode: encode$q,
34344
- decode: decode$s
34415
+ encode: encode$s,
34416
+ decode: decode$u
34345
34417
  });
34346
- const validXmlAttributes$a = [attrConfig$a, attrConfig$9, attrConfig$8];
34347
- const XML_NODE_NAME$j = "w:r";
34418
+ const validXmlAttributes$c = [attrConfig$a, attrConfig$9, attrConfig$8];
34419
+ const XML_NODE_NAME$l = "w:r";
34348
34420
  const SD_KEY_NAME = "run";
34349
- const encode$p = (params2, encodedAttrs = {}) => {
34421
+ const encode$r = (params2, encodedAttrs = {}) => {
34350
34422
  const { nodes = [], nodeListHandler } = params2 || {};
34351
34423
  const runNode = nodes[0];
34352
34424
  if (!runNode) return void 0;
@@ -34394,7 +34466,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34394
34466
  }
34395
34467
  return runNodeResult;
34396
34468
  };
34397
- const decode$r = (params2, decodedAttrs = {}) => {
34469
+ const decode$t = (params2, decodedAttrs = {}) => {
34398
34470
  const { node } = params2 || {};
34399
34471
  if (!node) return void 0;
34400
34472
  const isLinkNode = node.marks?.some((m2) => m2.type === "link");
@@ -34403,7 +34475,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34403
34475
  ...params2.extraParams,
34404
34476
  linkProcessed: true
34405
34477
  };
34406
- return translator$X.decode({ ...params2, extraParams });
34478
+ return translator$Z.decode({ ...params2, extraParams });
34407
34479
  }
34408
34480
  const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
34409
34481
  const runAttrs = runNodeForExport.attrs || {};
@@ -34459,7 +34531,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34459
34531
  runs.push(trackedClone);
34460
34532
  return;
34461
34533
  }
34462
- const runWrapper = { name: XML_NODE_NAME$j, elements: [] };
34534
+ const runWrapper = { name: XML_NODE_NAME$l, elements: [] };
34463
34535
  applyBaseRunProps(runWrapper);
34464
34536
  if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
34465
34537
  runWrapper.elements.push(cloneXmlNode(child));
@@ -34467,7 +34539,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34467
34539
  });
34468
34540
  const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
34469
34541
  if (!trackedRuns.length) {
34470
- const emptyRun = { name: XML_NODE_NAME$j, elements: [] };
34542
+ const emptyRun = { name: XML_NODE_NAME$l, elements: [] };
34471
34543
  applyBaseRunProps(emptyRun);
34472
34544
  trackedRuns.push(emptyRun);
34473
34545
  }
@@ -34481,15 +34553,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34481
34553
  }
34482
34554
  return trackedRuns;
34483
34555
  };
34484
- const config$g = {
34485
- xmlName: XML_NODE_NAME$j,
34556
+ const config$i = {
34557
+ xmlName: XML_NODE_NAME$l,
34486
34558
  sdNodeOrKeyName: SD_KEY_NAME,
34487
34559
  type: NodeTranslator.translatorTypes.NODE,
34488
- encode: encode$p,
34489
- decode: decode$r,
34490
- attributes: validXmlAttributes$a
34560
+ encode: encode$r,
34561
+ decode: decode$t,
34562
+ attributes: validXmlAttributes$c
34491
34563
  };
34492
- const translator$W = NodeTranslator.from(config$g);
34564
+ const translator$Y = NodeTranslator.from(config$i);
34493
34565
  function preProcessVerticalMergeCells(table, { editorSchema }) {
34494
34566
  if (!table || !Array.isArray(table.content)) {
34495
34567
  return table;
@@ -34530,13 +34602,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34530
34602
  }
34531
34603
  return table;
34532
34604
  }
34533
- const translator$V = NodeTranslator.from({
34605
+ const translator$X = NodeTranslator.from({
34534
34606
  xmlName: "w:cantSplit",
34535
34607
  sdNodeOrKeyName: "cantSplit",
34536
34608
  encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
34537
34609
  decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
34538
34610
  });
34539
- const translator$U = NodeTranslator.from({
34611
+ const translator$W = NodeTranslator.from({
34540
34612
  xmlName: "w:cnfStyle",
34541
34613
  sdNodeOrKeyName: "cnfStyle",
34542
34614
  attributes: [
@@ -34562,8 +34634,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34562
34634
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
34563
34635
  }
34564
34636
  });
34565
- const translator$T = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
34566
- const translator$S = NodeTranslator.from(
34637
+ const translator$V = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
34638
+ const translator$U = NodeTranslator.from(
34567
34639
  createSingleAttrPropertyHandler(
34568
34640
  "w:gridAfter",
34569
34641
  null,
@@ -34572,7 +34644,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34572
34644
  (v2) => integerToString(v2)
34573
34645
  )
34574
34646
  );
34575
- const translator$R = NodeTranslator.from(
34647
+ const translator$T = NodeTranslator.from(
34576
34648
  createSingleAttrPropertyHandler(
34577
34649
  "w:gridBefore",
34578
34650
  null,
@@ -34581,21 +34653,21 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34581
34653
  (v2) => integerToString(v2)
34582
34654
  )
34583
34655
  );
34584
- const translator$Q = NodeTranslator.from({
34656
+ const translator$S = NodeTranslator.from({
34585
34657
  xmlName: "w:hidden",
34586
34658
  sdNodeOrKeyName: "hidden",
34587
34659
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
34588
34660
  decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
34589
34661
  });
34590
- const translator$P = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
34591
- const translator$O = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
34592
- const translator$N = NodeTranslator.from({
34662
+ const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
34663
+ const translator$Q = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
34664
+ const translator$P = NodeTranslator.from({
34593
34665
  xmlName: "w:tblHeader",
34594
34666
  sdNodeOrKeyName: "repeatHeader",
34595
34667
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
34596
34668
  decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
34597
34669
  });
34598
- const translator$M = NodeTranslator.from({
34670
+ const translator$O = NodeTranslator.from({
34599
34671
  xmlName: "w:trHeight",
34600
34672
  sdNodeOrKeyName: "rowHeight",
34601
34673
  encode: ({ nodes }) => {
@@ -34622,11 +34694,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34622
34694
  return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
34623
34695
  }
34624
34696
  });
34625
- const translator$L = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
34626
- const translator$K = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
34627
- const XML_NODE_NAME$i = "w:trPr";
34628
- const SD_ATTR_KEY$4 = "tableRowProperties";
34629
- const encode$o = (params2) => {
34697
+ const translator$N = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
34698
+ const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
34699
+ const XML_NODE_NAME$k = "w:trPr";
34700
+ const SD_ATTR_KEY$6 = "tableRowProperties";
34701
+ const encode$q = (params2) => {
34630
34702
  const { nodes } = params2;
34631
34703
  const node = nodes[0];
34632
34704
  let attributes = {
@@ -34640,12 +34712,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34640
34712
  };
34641
34713
  return {
34642
34714
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
34643
- xmlName: XML_NODE_NAME$i,
34644
- sdNodeOrKeyName: SD_ATTR_KEY$4,
34715
+ xmlName: XML_NODE_NAME$k,
34716
+ sdNodeOrKeyName: SD_ATTR_KEY$6,
34645
34717
  attributes
34646
34718
  };
34647
34719
  };
34648
- const decode$q = (params2) => {
34720
+ const decode$s = (params2) => {
34649
34721
  const { tableRowProperties = {} } = params2.node.attrs || {};
34650
34722
  const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
34651
34723
  const newNode = {
@@ -34657,6 +34729,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34657
34729
  return newNode;
34658
34730
  };
34659
34731
  const propertyTranslators$3 = [
34732
+ translator$X,
34733
+ translator$W,
34660
34734
  translator$V,
34661
34735
  translator$U,
34662
34736
  translator$T,
@@ -34666,9 +34740,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34666
34740
  translator$P,
34667
34741
  translator$O,
34668
34742
  translator$N,
34669
- translator$M,
34670
- translator$L,
34671
- translator$K
34743
+ translator$M
34672
34744
  ];
34673
34745
  const propertyTranslatorsByXmlName$2 = {};
34674
34746
  propertyTranslators$3.forEach((translator2) => {
@@ -34678,25 +34750,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34678
34750
  propertyTranslators$3.forEach((translator2) => {
34679
34751
  propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
34680
34752
  });
34681
- const config$f = {
34682
- xmlName: XML_NODE_NAME$i,
34683
- sdNodeOrKeyName: SD_ATTR_KEY$4,
34753
+ const config$h = {
34754
+ xmlName: XML_NODE_NAME$k,
34755
+ sdNodeOrKeyName: SD_ATTR_KEY$6,
34684
34756
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
34685
- encode: encode$o,
34686
- decode: decode$q
34757
+ encode: encode$q,
34758
+ decode: decode$s
34687
34759
  };
34688
- const translator$J = NodeTranslator.from(config$f);
34689
- const XML_NODE_NAME$h = "w:tr";
34760
+ const translator$L = NodeTranslator.from(config$h);
34761
+ const XML_NODE_NAME$j = "w:tr";
34690
34762
  const SD_NODE_NAME$d = "tableRow";
34691
- const validXmlAttributes$9 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
34763
+ const validXmlAttributes$b = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
34692
34764
  (xmlName) => createAttributeHandler(xmlName)
34693
34765
  );
34694
- const encode$n = (params2, encodedAttrs) => {
34766
+ const encode$p = (params2, encodedAttrs) => {
34695
34767
  const { row } = params2.extraParams;
34696
34768
  let tableRowProperties = {};
34697
34769
  const tPr = row.elements.find((el) => el.name === "w:trPr");
34698
34770
  if (tPr) {
34699
- ({ attributes: tableRowProperties } = translator$J.encode({
34771
+ ({ attributes: tableRowProperties } = translator$L.encode({
34700
34772
  ...params2,
34701
34773
  nodes: [tPr]
34702
34774
  }));
@@ -34709,7 +34781,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34709
34781
  let currentColumnIndex = 0;
34710
34782
  const content = cellNodes?.map((n) => {
34711
34783
  let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
34712
- const result = translator$a.encode({
34784
+ const result = translator$c.encode({
34713
34785
  ...params2,
34714
34786
  extraParams: {
34715
34787
  ...params2.extraParams,
@@ -34731,7 +34803,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34731
34803
  };
34732
34804
  return newNode;
34733
34805
  };
34734
- const decode$p = (params2, decodedAttrs) => {
34806
+ const decode$r = (params2, decodedAttrs) => {
34735
34807
  const { node } = params2;
34736
34808
  const elements = translateChildNodes(params2);
34737
34809
  if (node.attrs?.tableRowProperties) {
@@ -34743,7 +34815,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34743
34815
  }
34744
34816
  }
34745
34817
  tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
34746
- const trPr = translator$J.decode({
34818
+ const trPr = translator$L.decode({
34747
34819
  ...params2,
34748
34820
  node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
34749
34821
  });
@@ -34755,22 +34827,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34755
34827
  elements
34756
34828
  };
34757
34829
  };
34758
- const config$e = {
34759
- xmlName: XML_NODE_NAME$h,
34830
+ const config$g = {
34831
+ xmlName: XML_NODE_NAME$j,
34760
34832
  sdNodeOrKeyName: SD_NODE_NAME$d,
34761
34833
  type: NodeTranslator.translatorTypes.NODE,
34762
- encode: encode$n,
34763
- decode: decode$p,
34764
- attributes: validXmlAttributes$9
34834
+ encode: encode$p,
34835
+ decode: decode$r,
34836
+ attributes: validXmlAttributes$b
34765
34837
  };
34766
- const translator$I = NodeTranslator.from(config$e);
34767
- const translator$H = NodeTranslator.from({
34838
+ const translator$K = NodeTranslator.from(config$g);
34839
+ const translator$J = NodeTranslator.from({
34768
34840
  xmlName: "w:bidiVisual",
34769
34841
  sdNodeOrKeyName: "rightToLeft",
34770
34842
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
34771
34843
  decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
34772
34844
  });
34773
- const translator$G = NodeTranslator.from({
34845
+ const translator$I = NodeTranslator.from({
34774
34846
  xmlName: "w:shd",
34775
34847
  sdNodeOrKeyName: "shading",
34776
34848
  attributes: [
@@ -34792,11 +34864,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34792
34864
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
34793
34865
  }
34794
34866
  });
34795
- const translator$F = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
34796
- const translator$E = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
34797
- const translator$D = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
34798
- const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
34799
- const translator$B = NodeTranslator.from({
34867
+ const translator$H = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
34868
+ const translator$G = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
34869
+ const translator$F = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
34870
+ const translator$E = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
34871
+ const translator$D = NodeTranslator.from({
34800
34872
  xmlName: "w:tblLook",
34801
34873
  sdNodeOrKeyName: "tblLook",
34802
34874
  attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
@@ -34808,16 +34880,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34808
34880
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
34809
34881
  }
34810
34882
  });
34811
- const translator$A = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
34812
- const translator$z = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
34813
- const translator$y = NodeTranslator.from(
34883
+ const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
34884
+ const translator$B = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
34885
+ const translator$A = NodeTranslator.from(
34814
34886
  createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
34815
34887
  );
34816
- const translator$x = NodeTranslator.from(
34888
+ const translator$z = NodeTranslator.from(
34817
34889
  createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
34818
34890
  );
34819
- const translator$w = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
34820
- const translator$v = NodeTranslator.from({
34891
+ const translator$y = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
34892
+ const translator$x = NodeTranslator.from({
34821
34893
  xmlName: "w:tblpPr",
34822
34894
  sdNodeOrKeyName: "floatingTableProperties",
34823
34895
  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))),
@@ -34829,29 +34901,29 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34829
34901
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
34830
34902
  }
34831
34903
  });
34832
- const translator$u = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
34833
- const translator$t = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
34834
- const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:end"));
34835
- const translator$r = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
34836
- const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
34837
- const translator$p = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
34838
- const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:left"));
34839
- const translator$n = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
34840
- const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:right"));
34841
- const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
34842
- const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:start"));
34843
- const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
34844
- const translator$i = NodeTranslator.from(createBorderPropertyHandler("w:top"));
34845
- const translator$h = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
34846
- const XML_NODE_NAME$g = "w:tblBorders";
34847
- const SD_ATTR_KEY$3 = "borders";
34848
- const encode$m = (params2) => {
34904
+ const translator$w = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
34905
+ const translator$v = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
34906
+ const translator$u = NodeTranslator.from(createBorderPropertyHandler("w:end"));
34907
+ const translator$t = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
34908
+ const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
34909
+ const translator$r = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
34910
+ const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:left"));
34911
+ const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
34912
+ const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:right"));
34913
+ const translator$n = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
34914
+ const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:start"));
34915
+ const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
34916
+ const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:top"));
34917
+ const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
34918
+ const XML_NODE_NAME$i = "w:tblBorders";
34919
+ const SD_ATTR_KEY$5 = "borders";
34920
+ const encode$o = (params2) => {
34849
34921
  const { nodes } = params2;
34850
34922
  const node = nodes[0];
34851
34923
  const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
34852
34924
  return Object.keys(attributes).length > 0 ? attributes : void 0;
34853
34925
  };
34854
- const decode$o = (params2) => {
34926
+ const decode$q = (params2) => {
34855
34927
  const { borders = {} } = params2.node.attrs || {};
34856
34928
  const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
34857
34929
  const newNode = {
@@ -34863,14 +34935,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34863
34935
  return newNode;
34864
34936
  };
34865
34937
  const propertyTranslators$2 = [
34938
+ translator$w,
34866
34939
  translator$u,
34867
34940
  translator$s,
34941
+ translator$r,
34868
34942
  translator$q,
34869
- translator$p,
34870
34943
  translator$o,
34871
34944
  translator$m,
34872
- translator$k,
34873
- translator$i
34945
+ translator$k
34874
34946
  ];
34875
34947
  const tblBordersTranslatorsByXmlName = {};
34876
34948
  const tblBordersTranslatorsBySdName = {};
@@ -34878,27 +34950,27 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34878
34950
  tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
34879
34951
  tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
34880
34952
  });
34881
- const translator$g = NodeTranslator.from({
34882
- xmlName: XML_NODE_NAME$g,
34883
- sdNodeOrKeyName: SD_ATTR_KEY$3,
34953
+ const translator$i = NodeTranslator.from({
34954
+ xmlName: XML_NODE_NAME$i,
34955
+ sdNodeOrKeyName: SD_ATTR_KEY$5,
34884
34956
  type: NodeTranslator.translatorTypes.NODE,
34885
34957
  attributes: [],
34886
- encode: encode$m,
34887
- decode: decode$o
34958
+ encode: encode$o,
34959
+ decode: decode$q
34888
34960
  });
34889
- const XML_NODE_NAME$f = "w:tblCellMar";
34890
- const SD_ATTR_KEY$2 = "cellMargins";
34891
- const encode$l = (params2) => {
34961
+ const XML_NODE_NAME$h = "w:tblCellMar";
34962
+ const SD_ATTR_KEY$4 = "cellMargins";
34963
+ const encode$n = (params2) => {
34892
34964
  const { nodes } = params2;
34893
34965
  const node = nodes[0];
34894
34966
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
34895
34967
  return Object.keys(attributes).length > 0 ? attributes : void 0;
34896
34968
  };
34897
- const decode$n = (params2) => {
34969
+ const decode$p = (params2) => {
34898
34970
  const { cellMargins = {} } = params2.node.attrs || {};
34899
34971
  const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
34900
34972
  const newNode = {
34901
- name: XML_NODE_NAME$f,
34973
+ name: XML_NODE_NAME$h,
34902
34974
  type: "element",
34903
34975
  attributes: {},
34904
34976
  elements
@@ -34906,12 +34978,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34906
34978
  return newNode;
34907
34979
  };
34908
34980
  const propertyTranslators$1 = [
34981
+ translator$v,
34909
34982
  translator$t,
34910
- translator$r,
34983
+ translator$p,
34911
34984
  translator$n,
34912
34985
  translator$l,
34913
- translator$j,
34914
- translator$h
34986
+ translator$j
34915
34987
  ];
34916
34988
  const propertyTranslatorsByXmlName$1 = {};
34917
34989
  const propertyTranslatorsBySdName$1 = {};
@@ -34919,27 +34991,27 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34919
34991
  propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
34920
34992
  propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
34921
34993
  });
34922
- const translator$f = NodeTranslator.from({
34923
- xmlName: XML_NODE_NAME$f,
34924
- sdNodeOrKeyName: SD_ATTR_KEY$2,
34994
+ const translator$h = NodeTranslator.from({
34995
+ xmlName: XML_NODE_NAME$h,
34996
+ sdNodeOrKeyName: SD_ATTR_KEY$4,
34925
34997
  type: NodeTranslator.translatorTypes.NODE,
34926
34998
  attributes: [],
34927
- encode: encode$l,
34928
- decode: decode$n
34999
+ encode: encode$n,
35000
+ decode: decode$p
34929
35001
  });
34930
- const XML_NODE_NAME$e = "w:tblPr";
34931
- const SD_ATTR_KEY$1 = "tableProperties";
34932
- const encode$k = (params2) => {
35002
+ const XML_NODE_NAME$g = "w:tblPr";
35003
+ const SD_ATTR_KEY$3 = "tableProperties";
35004
+ const encode$m = (params2) => {
34933
35005
  const { nodes } = params2;
34934
35006
  const node = nodes[0];
34935
35007
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
34936
35008
  return {
34937
- xmlName: XML_NODE_NAME$e,
34938
- sdNodeOrKeyName: SD_ATTR_KEY$1,
35009
+ xmlName: XML_NODE_NAME$g,
35010
+ sdNodeOrKeyName: SD_ATTR_KEY$3,
34939
35011
  attributes
34940
35012
  };
34941
35013
  };
34942
- const decode$m = (params2) => {
35014
+ const decode$o = (params2) => {
34943
35015
  const { tableProperties = {} } = params2.node.attrs || {};
34944
35016
  const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
34945
35017
  const newNode = {
@@ -34951,11 +35023,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34951
35023
  return newNode;
34952
35024
  };
34953
35025
  const propertyTranslators = [
35026
+ translator$J,
35027
+ translator$R,
35028
+ translator$I,
34954
35029
  translator$H,
34955
- translator$P,
35030
+ translator$Q,
34956
35031
  translator$G,
34957
35032
  translator$F,
34958
- translator$O,
34959
35033
  translator$E,
34960
35034
  translator$D,
34961
35035
  translator$C,
@@ -34964,10 +35038,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34964
35038
  translator$z,
34965
35039
  translator$y,
34966
35040
  translator$x,
34967
- translator$w,
34968
- translator$v,
34969
- translator$g,
34970
- translator$f
35041
+ translator$i,
35042
+ translator$h
34971
35043
  ];
34972
35044
  const propertyTranslatorsByXmlName = {};
34973
35045
  const propertyTranslatorsBySdName = {};
@@ -34975,14 +35047,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
34975
35047
  propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
34976
35048
  propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
34977
35049
  });
34978
- const config$d = {
34979
- xmlName: XML_NODE_NAME$e,
34980
- sdNodeOrKeyName: SD_ATTR_KEY$1,
34981
- encode: encode$k,
34982
- decode: decode$m
35050
+ const config$f = {
35051
+ xmlName: XML_NODE_NAME$g,
35052
+ sdNodeOrKeyName: SD_ATTR_KEY$3,
35053
+ encode: encode$m,
35054
+ decode: decode$o
34983
35055
  };
34984
- const translator$e = NodeTranslator.from(config$d);
34985
- const translator$d = NodeTranslator.from(
35056
+ const translator$g = NodeTranslator.from(config$f);
35057
+ const translator$f = NodeTranslator.from(
34986
35058
  createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
34987
35059
  );
34988
35060
  const DEFAULT_COLUMN_WIDTH_PX = 100;
@@ -35032,20 +35104,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35032
35104
  }
35033
35105
  return Math.max(fallbackWidthTwips, cellMinWidthTwips);
35034
35106
  };
35035
- const XML_NODE_NAME$d = "w:tblGrid";
35036
- const SD_ATTR_KEY = "grid";
35107
+ const XML_NODE_NAME$f = "w:tblGrid";
35108
+ const SD_ATTR_KEY$2 = "grid";
35037
35109
  const cellMinWidth = pixelsToTwips(10);
35038
- const encode$j = (params2) => {
35110
+ const encode$l = (params2) => {
35039
35111
  const { nodes } = params2;
35040
35112
  const node = nodes[0];
35041
- const attributes = encodeProperties(node, { [translator$d.xmlName]: translator$d }, true);
35113
+ const attributes = encodeProperties(node, { [translator$f.xmlName]: translator$f }, true);
35042
35114
  return {
35043
- xmlName: XML_NODE_NAME$d,
35044
- sdNodeOrKeyName: SD_ATTR_KEY,
35115
+ xmlName: XML_NODE_NAME$f,
35116
+ sdNodeOrKeyName: SD_ATTR_KEY$2,
35045
35117
  attributes
35046
35118
  };
35047
35119
  };
35048
- const decode$l = (params2) => {
35120
+ const decode$n = (params2) => {
35049
35121
  const { grid: rawGrid } = params2.node.attrs || {};
35050
35122
  const grid = Array.isArray(rawGrid) ? rawGrid : [];
35051
35123
  const { firstRow = {} } = params2.extraParams || {};
@@ -35064,10 +35136,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35064
35136
  numericWidth = fallbackColumnWidthTwips;
35065
35137
  }
35066
35138
  numericWidth = Math.max(numericWidth, cellMinWidth);
35067
- const decoded = translator$d.decode({
35139
+ const decoded = translator$f.decode({
35068
35140
  node: { type: (
35069
35141
  /** @type {string} */
35070
- translator$d.sdNodeOrKeyName
35142
+ translator$f.sdNodeOrKeyName
35071
35143
  ), attrs: { col: numericWidth } }
35072
35144
  });
35073
35145
  if (decoded) elements.push(decoded);
@@ -35102,19 +35174,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35102
35174
  columnIndex++;
35103
35175
  }
35104
35176
  const newNode = {
35105
- name: XML_NODE_NAME$d,
35177
+ name: XML_NODE_NAME$f,
35106
35178
  attributes: {},
35107
35179
  elements
35108
35180
  };
35109
35181
  return newNode;
35110
35182
  };
35111
- const config$c = {
35112
- xmlName: XML_NODE_NAME$d,
35113
- sdNodeOrKeyName: SD_ATTR_KEY,
35114
- encode: encode$j,
35115
- decode: decode$l
35183
+ const config$e = {
35184
+ xmlName: XML_NODE_NAME$f,
35185
+ sdNodeOrKeyName: SD_ATTR_KEY$2,
35186
+ encode: encode$l,
35187
+ decode: decode$n
35116
35188
  };
35117
- const translator$c = NodeTranslator.from(config$c);
35189
+ const translator$e = NodeTranslator.from(config$e);
35118
35190
  const DEFAULT_PAGE_WIDTH_TWIPS = 12240;
35119
35191
  const DEFAULT_PAGE_MARGIN_TWIPS = 1440;
35120
35192
  const DEFAULT_CONTENT_WIDTH_TWIPS = DEFAULT_PAGE_WIDTH_TWIPS - 2 * DEFAULT_PAGE_MARGIN_TWIPS;
@@ -35177,19 +35249,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35177
35249
  columnWidths: Array(columnCount).fill(fallbackColumnWidthPx)
35178
35250
  };
35179
35251
  };
35180
- const XML_NODE_NAME$c = "w:tbl";
35252
+ const XML_NODE_NAME$e = "w:tbl";
35181
35253
  const SD_NODE_NAME$c = "table";
35182
- const encode$i = (params2, encodedAttrs) => {
35254
+ const encode$k = (params2, encodedAttrs) => {
35183
35255
  const { nodes } = params2;
35184
35256
  const node = nodes[0];
35185
35257
  const tblPr = node.elements.find((el) => el.name === "w:tblPr");
35186
35258
  if (tblPr) {
35187
- const encodedProperties = translator$e.encode({ ...params2, nodes: [tblPr] });
35259
+ const encodedProperties = translator$g.encode({ ...params2, nodes: [tblPr] });
35188
35260
  encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
35189
35261
  }
35190
35262
  const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
35191
35263
  if (tblGrid) {
35192
- encodedAttrs["grid"] = translator$c.encode({ ...params2, nodes: [tblGrid] }).attributes;
35264
+ encodedAttrs["grid"] = translator$e.encode({ ...params2, nodes: [tblGrid] }).attributes;
35193
35265
  }
35194
35266
  [
35195
35267
  "tableStyleId",
@@ -35256,7 +35328,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35256
35328
  }
35257
35329
  const content = [];
35258
35330
  rows.forEach((row) => {
35259
- const result = translator$I.encode({
35331
+ const result = translator$K.encode({
35260
35332
  ...params2,
35261
35333
  nodes: [row],
35262
35334
  extraParams: {
@@ -35275,13 +35347,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35275
35347
  attrs: encodedAttrs
35276
35348
  };
35277
35349
  };
35278
- const decode$k = (params2, decodedAttrs) => {
35350
+ const decode$m = (params2, decodedAttrs) => {
35279
35351
  params2.node = preProcessVerticalMergeCells(params2.node, params2);
35280
35352
  const { node } = params2;
35281
35353
  const elements = translateChildNodes(params2);
35282
35354
  const firstRow = node.content?.find((n) => n.type === "tableRow");
35283
35355
  const properties = node.attrs.grid;
35284
- const element = translator$c.decode({
35356
+ const element = translator$e.decode({
35285
35357
  ...params2,
35286
35358
  node: { ...node, attrs: { ...node.attrs, grid: properties } },
35287
35359
  extraParams: {
@@ -35291,7 +35363,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35291
35363
  if (element) elements.unshift(element);
35292
35364
  if (node.attrs?.tableProperties) {
35293
35365
  const properties2 = { ...node.attrs.tableProperties };
35294
- const element2 = translator$e.decode({
35366
+ const element2 = translator$g.decode({
35295
35367
  ...params2,
35296
35368
  node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
35297
35369
  });
@@ -35357,7 +35429,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35357
35429
  if (baseTblPr && baseTblPr.elements) {
35358
35430
  tblPr.elements.push(...baseTblPr.elements);
35359
35431
  }
35360
- const tableProperties = translator$e.encode({ ...params2, nodes: [tblPr] }).attributes;
35432
+ const tableProperties = translator$g.encode({ ...params2, nodes: [tblPr] }).attributes;
35361
35433
  const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
35362
35434
  if (borders) stylesToReturn.borders = borders;
35363
35435
  if (rowBorders) stylesToReturn.rowBorders = rowBorders;
@@ -35374,16 +35446,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35374
35446
  }
35375
35447
  return stylesToReturn;
35376
35448
  }
35377
- const config$b = {
35378
- xmlName: XML_NODE_NAME$c,
35449
+ const config$d = {
35450
+ xmlName: XML_NODE_NAME$e,
35379
35451
  sdNodeOrKeyName: SD_NODE_NAME$c,
35380
35452
  type: NodeTranslator.translatorTypes.NODE,
35381
- encode: encode$i,
35382
- decode: decode$k,
35453
+ encode: encode$k,
35454
+ decode: decode$m,
35383
35455
  attributes: []
35384
35456
  };
35385
- const translator$b = NodeTranslator.from(config$b);
35386
- const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$b);
35457
+ const translator$d = NodeTranslator.from(config$d);
35458
+ const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$d);
35387
35459
  function getReferencedTableStyles(tblStyleTag, docx) {
35388
35460
  if (!tblStyleTag) return null;
35389
35461
  const stylesToReturn = {};
@@ -35745,10 +35817,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35745
35817
  if (left2 != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left2) } });
35746
35818
  return elements;
35747
35819
  }
35748
- const XML_NODE_NAME$b = "w:tc";
35820
+ const XML_NODE_NAME$d = "w:tc";
35749
35821
  const SD_NODE_NAME$b = "tableCell";
35750
- const validXmlAttributes$8 = [];
35751
- function encode$h(params2, encodedAttrs) {
35822
+ const validXmlAttributes$a = [];
35823
+ function encode$j(params2, encodedAttrs) {
35752
35824
  const {
35753
35825
  node,
35754
35826
  table,
@@ -35775,22 +35847,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35775
35847
  }
35776
35848
  return schemaNode;
35777
35849
  }
35778
- function decode$j(params2, decodedAttrs) {
35850
+ function decode$l(params2, decodedAttrs) {
35779
35851
  const translated = translateTableCell(params2);
35780
35852
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
35781
35853
  translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
35782
35854
  }
35783
35855
  return translated;
35784
35856
  }
35785
- const config$a = {
35786
- xmlName: XML_NODE_NAME$b,
35857
+ const config$c = {
35858
+ xmlName: XML_NODE_NAME$d,
35787
35859
  sdNodeOrKeyName: SD_NODE_NAME$b,
35788
35860
  type: NodeTranslator.translatorTypes.NODE,
35789
- encode: encode$h,
35790
- decode: decode$j,
35791
- attributes: validXmlAttributes$8
35861
+ encode: encode$j,
35862
+ decode: decode$l,
35863
+ attributes: validXmlAttributes$a
35792
35864
  };
35793
- const translator$a = NodeTranslator.from(config$a);
35865
+ const translator$c = NodeTranslator.from(config$c);
35794
35866
  function parseTagValueJSON(json) {
35795
35867
  if (typeof json !== "string") {
35796
35868
  return {};
@@ -36217,8 +36289,64 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36217
36289
  const vRelativeFrom = positionVTag?.attributes.relativeFrom;
36218
36290
  const alignV = positionVTag?.elements?.find((el) => el.name === "wp:align")?.elements[0]?.text;
36219
36291
  const simplePos = node.elements.find((el) => el.name === "wp:simplePos");
36220
- const wrapSquare = node.elements.find((el) => el.name === "wp:wrapSquare");
36221
- const wrapTopAndBottom = node.elements.find((el) => el.name === "wp:wrapTopAndBottom");
36292
+ const wrapNode = isAnchor ? node.elements.find(
36293
+ (el) => ["wp:wrapNone", "wp:wrapSquare", "wp:wrapThrough", "wp:wrapTight", "wp:wrapTopAndBottom"].includes(el.name)
36294
+ ) : null;
36295
+ const wrap2 = isAnchor ? { type: wrapNode?.name.slice(7) || "None", attrs: {} } : { type: "Inline" };
36296
+ switch (wrap2.type) {
36297
+ case "Square":
36298
+ wrap2.attrs.wrapText = wrapNode.attributes.wrapText;
36299
+ if ("distB" in (wrapNode.attributes || {})) {
36300
+ wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
36301
+ }
36302
+ if ("distL" in (wrapNode.attributes || {})) {
36303
+ wrap2.attrs.distLeft = emuToPixels(wrapNode.attributes.distL);
36304
+ }
36305
+ if ("distR" in (wrapNode.attributes || {})) {
36306
+ wrap2.attrs.distRight = emuToPixels(wrapNode.attributes.distR);
36307
+ }
36308
+ if ("distT" in (wrapNode.attributes || {})) {
36309
+ wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
36310
+ }
36311
+ break;
36312
+ case "Tight":
36313
+ case "Through": {
36314
+ if ("distL" in (wrapNode.attributes || {})) {
36315
+ wrap2.attrs.distLeft = emuToPixels(wrapNode.attributes.distL);
36316
+ }
36317
+ if ("distR" in (wrapNode.attributes || {})) {
36318
+ wrap2.attrs.distRight = emuToPixels(wrapNode.attributes.distR);
36319
+ }
36320
+ if ("distT" in (wrapNode.attributes || {})) {
36321
+ wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
36322
+ }
36323
+ if ("distB" in (wrapNode.attributes || {})) {
36324
+ wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
36325
+ }
36326
+ if ("wrapText" in (wrapNode.attributes || {})) {
36327
+ wrap2.attrs.wrapText = wrapNode.attributes.wrapText;
36328
+ }
36329
+ const polygon = wrapNode.elements?.find((el) => el.name === "wp:wrapPolygon");
36330
+ if (polygon) {
36331
+ wrap2.attrs.polygon = polygonToObj(polygon);
36332
+ if (polygon.attributes?.edited !== void 0) {
36333
+ wrap2.attrs.polygonEdited = polygon.attributes.edited;
36334
+ }
36335
+ }
36336
+ break;
36337
+ }
36338
+ case "TopAndBottom":
36339
+ if ("distB" in (wrapNode.attributes || {})) {
36340
+ wrap2.attrs.distBottom = emuToPixels(wrapNode.attributes.distB);
36341
+ }
36342
+ if ("distT" in (wrapNode.attributes || {})) {
36343
+ wrap2.attrs.distTop = emuToPixels(wrapNode.attributes.distT);
36344
+ }
36345
+ break;
36346
+ case "None":
36347
+ wrap2.attrs.behindDoc = node.attributes?.behindDoc === "1";
36348
+ break;
36349
+ }
36222
36350
  const docPr = node.elements.find((el) => el.name === "wp:docPr");
36223
36351
  let anchorData = null;
36224
36352
  if (hRelativeFrom || alignH || vRelativeFrom || alignV) {
@@ -36230,7 +36358,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36230
36358
  };
36231
36359
  }
36232
36360
  const marginOffset = {
36233
- left: positionHValue,
36361
+ horizontal: positionHValue,
36234
36362
  top: positionVValue
36235
36363
  };
36236
36364
  const { attributes: blipAttributes = {} } = blip;
@@ -36269,10 +36397,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36269
36397
  y: simplePos.attributes.y
36270
36398
  }
36271
36399
  },
36272
- ...wrapSquare && {
36273
- wrapText: wrapSquare.attributes.wrapText
36274
- },
36275
- wrapTopAndBottom: !!wrapTopAndBottom,
36400
+ wrap: wrap2,
36276
36401
  originalPadding: {
36277
36402
  distT: attributes["distT"],
36278
36403
  distB: attributes["distB"],
@@ -36620,7 +36745,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36620
36745
  function translateAnchorNode(params2) {
36621
36746
  const { attrs } = params2.node;
36622
36747
  const anchorElements = [];
36623
- const wrapElements = [];
36624
36748
  if (attrs.simplePos) {
36625
36749
  anchorElements.push({
36626
36750
  name: "wp:simplePos",
@@ -36632,10 +36756,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36632
36756
  }
36633
36757
  if (attrs.anchorData) {
36634
36758
  const hElements = [];
36635
- if (attrs.marginOffset.left !== void 0) {
36759
+ if (attrs.marginOffset.horizontal !== void 0) {
36636
36760
  hElements.push({
36637
36761
  name: "wp:posOffset",
36638
- elements: [{ type: "text", text: pixelsToEmu(attrs.marginOffset.left).toString() }]
36762
+ elements: [{ type: "text", text: pixelsToEmu(attrs.marginOffset.horizontal).toString() }]
36639
36763
  });
36640
36764
  }
36641
36765
  if (attrs.anchorData.alignH) {
@@ -36668,38 +36792,110 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36668
36792
  ...vElements.length && { elements: vElements }
36669
36793
  });
36670
36794
  }
36671
- if (attrs.wrapText) {
36672
- wrapElements.push({
36673
- name: "wp:wrapSquare",
36674
- attributes: {
36675
- wrapText: attrs.wrapText
36676
- }
36677
- });
36795
+ const nodeElements = translateImageNode(params2);
36796
+ const inlineAttrs = {
36797
+ ...attrs.originalAttributes || {},
36798
+ ...nodeElements.attributes || {}
36799
+ };
36800
+ if (inlineAttrs.relativeHeight == null) {
36801
+ inlineAttrs.relativeHeight = 1;
36678
36802
  }
36679
- if (attrs.wrapTopAndBottom) {
36680
- wrapElements.push({
36681
- name: "wp:wrapTopAndBottom"
36682
- });
36803
+ if (attrs.originalAttributes?.simplePos !== void 0) {
36804
+ inlineAttrs.simplePos = attrs.originalAttributes.simplePos;
36805
+ } else if (attrs.simplePos !== void 0) {
36806
+ inlineAttrs.simplePos = attrs.simplePos;
36683
36807
  }
36684
- if (!wrapElements.length) {
36685
- wrapElements.push({
36686
- name: "wp:wrapNone"
36687
- });
36808
+ if (attrs.originalAttributes?.locked !== void 0) {
36809
+ inlineAttrs.locked = attrs.originalAttributes.locked;
36688
36810
  }
36689
- const nodeElements = translateImageNode(params2);
36690
- const inlineAttrs = {
36691
- ...nodeElements.attributes,
36692
- simplePos: attrs.originalAttributes?.simplePos,
36693
- relativeHeight: 1,
36694
- behindDoc: attrs.originalAttributes?.behindDoc,
36695
- locked: attrs.originalAttributes?.locked,
36696
- layoutInCell: attrs.originalAttributes?.layoutInCell,
36697
- allowOverlap: attrs.originalAttributes?.allowOverlap
36811
+ if (attrs.originalAttributes?.layoutInCell !== void 0) {
36812
+ inlineAttrs.layoutInCell = attrs.originalAttributes.layoutInCell;
36813
+ }
36814
+ if (attrs.originalAttributes?.allowOverlap !== void 0) {
36815
+ inlineAttrs.allowOverlap = attrs.originalAttributes.allowOverlap;
36816
+ }
36817
+ const wrapElement = {
36818
+ name: `wp:wrap${attrs.wrap?.type || "None"}`
36819
+ // Important: wp:anchor will break if no wrapping is specified. We need to use wrapNone.
36698
36820
  };
36821
+ switch (attrs.wrap?.type) {
36822
+ case "Square":
36823
+ wrapElement.attributes = {
36824
+ wrapText: attrs.wrap.attrs.wrapText
36825
+ };
36826
+ if ("distBottom" in (attrs.wrap.attrs || {})) {
36827
+ wrapElement.attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
36828
+ }
36829
+ if ("distLeft" in (attrs.wrap.attrs || {})) {
36830
+ wrapElement.attributes.distL = pixelsToEmu(attrs.wrap.attrs.distLeft);
36831
+ }
36832
+ if ("distRight" in (attrs.wrap.attrs || {})) {
36833
+ wrapElement.attributes.distR = pixelsToEmu(attrs.wrap.attrs.distRight);
36834
+ }
36835
+ if ("distTop" in (attrs.wrap.attrs || {})) {
36836
+ wrapElement.attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
36837
+ }
36838
+ break;
36839
+ case "TopAndBottom": {
36840
+ const attributes = {};
36841
+ let hasKeys = false;
36842
+ if ("distBottom" in (attrs.wrap.attrs || {})) {
36843
+ attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
36844
+ hasKeys = true;
36845
+ }
36846
+ if ("distTop" in (attrs.wrap.attrs || {})) {
36847
+ attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
36848
+ hasKeys = true;
36849
+ }
36850
+ if (hasKeys) {
36851
+ wrapElement.attributes = attributes;
36852
+ }
36853
+ break;
36854
+ }
36855
+ case "Through":
36856
+ case "Tight": {
36857
+ const attributes = {};
36858
+ if ("distLeft" in (attrs.wrap.attrs || {})) {
36859
+ attributes.distL = pixelsToEmu(attrs.wrap.attrs.distLeft);
36860
+ }
36861
+ if ("distRight" in (attrs.wrap.attrs || {})) {
36862
+ attributes.distR = pixelsToEmu(attrs.wrap.attrs.distRight);
36863
+ }
36864
+ if ("distTop" in (attrs.wrap.attrs || {})) {
36865
+ attributes.distT = pixelsToEmu(attrs.wrap.attrs.distTop);
36866
+ }
36867
+ if ("distBottom" in (attrs.wrap.attrs || {})) {
36868
+ attributes.distB = pixelsToEmu(attrs.wrap.attrs.distBottom);
36869
+ }
36870
+ const wrapText = attrs.wrap.attrs?.wrapText || "bothSides";
36871
+ {
36872
+ attributes.wrapText = wrapText;
36873
+ }
36874
+ if (Object.keys(attributes).length) {
36875
+ wrapElement.attributes = attributes;
36876
+ }
36877
+ if (attrs.wrap.attrs?.polygon) {
36878
+ const polygonNode = objToPolygon(attrs.wrap.attrs.polygon);
36879
+ if (polygonNode) {
36880
+ if (attrs.wrap.attrs?.polygonEdited !== void 0) {
36881
+ polygonNode.attributes = {
36882
+ ...polygonNode.attributes || {},
36883
+ edited: String(attrs.wrap.attrs.polygonEdited)
36884
+ };
36885
+ }
36886
+ wrapElement.elements = [polygonNode];
36887
+ }
36888
+ }
36889
+ break;
36890
+ }
36891
+ case "None":
36892
+ inlineAttrs.behindDoc = attrs.wrap.attrs?.behindDoc ? "1" : "0";
36893
+ break;
36894
+ }
36699
36895
  const effectIndex = nodeElements.elements.findIndex((el) => el.name === "wp:effectExtent");
36700
36896
  const elementsWithWrap = [
36701
36897
  ...nodeElements.elements.slice(0, effectIndex + 1),
36702
- ...wrapElements,
36898
+ wrapElement,
36703
36899
  ...nodeElements.elements.slice(effectIndex + 1)
36704
36900
  ];
36705
36901
  return {
@@ -36708,32 +36904,32 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36708
36904
  elements: [...anchorElements, ...elementsWithWrap]
36709
36905
  };
36710
36906
  }
36711
- const XML_NODE_NAME$a = "wp:anchor";
36907
+ const XML_NODE_NAME$c = "wp:anchor";
36712
36908
  const SD_NODE_NAME$a = ["image"];
36713
- const validXmlAttributes$7 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
36714
- function encode$g(params2) {
36909
+ const validXmlAttributes$9 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
36910
+ function encode$i(params2) {
36715
36911
  const { node } = params2.extraParams;
36716
36912
  if (!node || !node.type) {
36717
36913
  return null;
36718
36914
  }
36719
36915
  return handleAnchorNode(params2);
36720
36916
  }
36721
- function decode$i(params2) {
36917
+ function decode$k(params2) {
36722
36918
  const { node } = params2;
36723
36919
  if (!node || !node.type) {
36724
36920
  return null;
36725
36921
  }
36726
36922
  return translateAnchorNode(params2);
36727
36923
  }
36728
- const config$9 = {
36729
- xmlName: XML_NODE_NAME$a,
36924
+ const config$b = {
36925
+ xmlName: XML_NODE_NAME$c,
36730
36926
  sdNodeOrKeyName: SD_NODE_NAME$a,
36731
36927
  type: NodeTranslator.translatorTypes.NODE,
36732
- encode: encode$g,
36733
- decode: decode$i,
36734
- attributes: validXmlAttributes$7
36928
+ encode: encode$i,
36929
+ decode: decode$k,
36930
+ attributes: validXmlAttributes$9
36735
36931
  };
36736
- const translator$9 = NodeTranslator.from(config$9);
36932
+ const translator$b = NodeTranslator.from(config$b);
36737
36933
  function handleInlineNode(params2) {
36738
36934
  const { node } = params2.extraParams;
36739
36935
  if (node.name !== "wp:inline") {
@@ -36749,41 +36945,41 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36749
36945
  elements: nodeElements.elements
36750
36946
  };
36751
36947
  }
36752
- const XML_NODE_NAME$9 = "wp:inline";
36948
+ const XML_NODE_NAME$b = "wp:inline";
36753
36949
  const SD_NODE_NAME$9 = ["image"];
36754
- const validXmlAttributes$6 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
36755
- function encode$f(params2) {
36950
+ const validXmlAttributes$8 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
36951
+ function encode$h(params2) {
36756
36952
  const { node } = params2.extraParams;
36757
36953
  if (!node || !node.type) {
36758
36954
  return null;
36759
36955
  }
36760
36956
  return handleInlineNode(params2);
36761
36957
  }
36762
- function decode$h(params2) {
36958
+ function decode$j(params2) {
36763
36959
  const { node } = params2;
36764
36960
  if (!node || !node.type) {
36765
36961
  return null;
36766
36962
  }
36767
36963
  return translateInlineNode(params2);
36768
36964
  }
36769
- const config$8 = {
36770
- xmlName: XML_NODE_NAME$9,
36965
+ const config$a = {
36966
+ xmlName: XML_NODE_NAME$b,
36771
36967
  sdNodeOrKeyName: SD_NODE_NAME$9,
36772
36968
  type: NodeTranslator.translatorTypes.NODE,
36773
- encode: encode$f,
36774
- decode: decode$h,
36775
- attributes: validXmlAttributes$6
36969
+ encode: encode$h,
36970
+ decode: decode$j,
36971
+ attributes: validXmlAttributes$8
36776
36972
  };
36777
- const translator$8 = NodeTranslator.from(config$8);
36778
- const XML_NODE_NAME$8 = "w:drawing";
36973
+ const translator$a = NodeTranslator.from(config$a);
36974
+ const XML_NODE_NAME$a = "w:drawing";
36779
36975
  const SD_NODE_NAME$8 = [];
36780
- const validXmlAttributes$5 = [];
36781
- function encode$e(params2) {
36976
+ const validXmlAttributes$7 = [];
36977
+ function encode$g(params2) {
36782
36978
  const nodes = params2.nodes;
36783
36979
  const node = nodes[0];
36784
36980
  const translatorByChildName = {
36785
- "wp:anchor": translator$9,
36786
- "wp:inline": translator$8
36981
+ "wp:anchor": translator$b,
36982
+ "wp:inline": translator$a
36787
36983
  };
36788
36984
  return node.elements.reduce((acc, child) => {
36789
36985
  if (acc) return acc;
@@ -36792,12 +36988,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36792
36988
  return translator2.encode({ ...params2, extraParams: { node: child } }) || acc;
36793
36989
  }, null);
36794
36990
  }
36795
- function decode$g(params2) {
36991
+ function decode$i(params2) {
36796
36992
  const { node } = params2;
36797
36993
  if (!node || !node.type) {
36798
36994
  return null;
36799
36995
  }
36800
- const childTranslator = node.attrs.isAnchor ? translator$9 : translator$8;
36996
+ const childTranslator = node.attrs.isAnchor ? translator$b : translator$a;
36801
36997
  const resultNode = childTranslator.decode(params2);
36802
36998
  return wrapTextInRun(
36803
36999
  {
@@ -36807,15 +37003,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
36807
37003
  []
36808
37004
  );
36809
37005
  }
36810
- const config$7 = {
36811
- xmlName: XML_NODE_NAME$8,
37006
+ const config$9 = {
37007
+ xmlName: XML_NODE_NAME$a,
36812
37008
  sdNodeOrKeyName: SD_NODE_NAME$8,
36813
37009
  type: NodeTranslator.translatorTypes.NODE,
36814
- encode: encode$e,
36815
- decode: decode$g,
36816
- attributes: validXmlAttributes$5
37010
+ encode: encode$g,
37011
+ decode: decode$i,
37012
+ attributes: validXmlAttributes$7
36817
37013
  };
36818
- const translator$7 = NodeTranslator.from(config$7);
37014
+ const translator$9 = NodeTranslator.from(config$9);
36819
37015
  class CommandService {
36820
37016
  /**
36821
37017
  * @param {import('./commands/types/index.js').CommandServiceOptions} props
@@ -38163,7 +38359,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38163
38359
  return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
38164
38360
  }
38165
38361
  function prepareImageAnnotation(params2, imageSize) {
38166
- return translator$7.decode({
38362
+ return translator$9.decode({
38167
38363
  ...params2,
38168
38364
  imageSize
38169
38365
  });
@@ -38478,10 +38674,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38478
38674
  };
38479
38675
  return result;
38480
38676
  }
38481
- const XML_NODE_NAME$7 = "w:sdt";
38677
+ const XML_NODE_NAME$9 = "w:sdt";
38482
38678
  const SD_NODE_NAME$7 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
38483
- const validXmlAttributes$4 = [];
38484
- function encode$d(params2) {
38679
+ const validXmlAttributes$6 = [];
38680
+ function encode$f(params2) {
38485
38681
  const nodes = params2.nodes;
38486
38682
  const node = nodes[0];
38487
38683
  const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
@@ -38491,7 +38687,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38491
38687
  const result = handler2(params2);
38492
38688
  return result;
38493
38689
  }
38494
- function decode$f(params2) {
38690
+ function decode$h(params2) {
38495
38691
  const { node } = params2;
38496
38692
  if (!node || !node.type) {
38497
38693
  return null;
@@ -38509,85 +38705,85 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38509
38705
  const result = decoder();
38510
38706
  return result;
38511
38707
  }
38512
- const config$6 = {
38513
- xmlName: XML_NODE_NAME$7,
38708
+ const config$8 = {
38709
+ xmlName: XML_NODE_NAME$9,
38514
38710
  sdNodeOrKeyName: SD_NODE_NAME$7,
38515
38711
  type: NodeTranslator.translatorTypes.NODE,
38516
- encode: encode$d,
38517
- decode: decode$f,
38518
- attributes: validXmlAttributes$4
38712
+ encode: encode$f,
38713
+ decode: decode$h,
38714
+ attributes: validXmlAttributes$6
38519
38715
  };
38520
- const translator$6 = NodeTranslator.from(config$6);
38521
- const encode$c = (attributes) => {
38716
+ const translator$8 = NodeTranslator.from(config$8);
38717
+ const encode$e = (attributes) => {
38522
38718
  return attributes["w:id"];
38523
38719
  };
38524
- const decode$e = (attrs) => {
38720
+ const decode$g = (attrs) => {
38525
38721
  return attrs.id;
38526
38722
  };
38527
38723
  const attrConfig$7 = Object.freeze({
38528
38724
  xmlName: "w:id",
38529
38725
  sdName: "id",
38530
- encode: encode$c,
38531
- decode: decode$e
38726
+ encode: encode$e,
38727
+ decode: decode$g
38532
38728
  });
38533
- const encode$b = (attributes) => {
38729
+ const encode$d = (attributes) => {
38534
38730
  return attributes["w:name"];
38535
38731
  };
38536
- const decode$d = (attrs) => {
38732
+ const decode$f = (attrs) => {
38537
38733
  return attrs.name;
38538
38734
  };
38539
38735
  const attrConfig$6 = Object.freeze({
38540
38736
  xmlName: "w:name",
38541
38737
  sdName: "name",
38542
- encode: encode$b,
38543
- decode: decode$d
38738
+ encode: encode$d,
38739
+ decode: decode$f
38544
38740
  });
38545
- const encode$a = (attributes) => {
38741
+ const encode$c = (attributes) => {
38546
38742
  return attributes["w:colFirst"];
38547
38743
  };
38548
- const decode$c = (attrs) => {
38744
+ const decode$e = (attrs) => {
38549
38745
  return attrs.colFirst;
38550
38746
  };
38551
38747
  const attrConfig$5 = Object.freeze({
38552
38748
  xmlName: "w:colFirst",
38553
38749
  sdName: "colFirst",
38554
- encode: encode$a,
38555
- decode: decode$c
38750
+ encode: encode$c,
38751
+ decode: decode$e
38556
38752
  });
38557
- const encode$9 = (attributes) => {
38753
+ const encode$b = (attributes) => {
38558
38754
  return attributes["w:colLast"];
38559
38755
  };
38560
- const decode$b = (attrs) => {
38756
+ const decode$d = (attrs) => {
38561
38757
  return attrs.colLast;
38562
38758
  };
38563
38759
  const attrConfig$4 = Object.freeze({
38564
38760
  xmlName: "w:colLast",
38565
38761
  sdName: "colLast",
38566
- encode: encode$9,
38567
- decode: decode$b
38762
+ encode: encode$b,
38763
+ decode: decode$d
38568
38764
  });
38569
- const encode$8 = (attributes) => {
38765
+ const encode$a = (attributes) => {
38570
38766
  return attributes["w:displacedByCustomXml"];
38571
38767
  };
38572
- const decode$a = (attrs) => {
38768
+ const decode$c = (attrs) => {
38573
38769
  return attrs.displacedByCustomXml;
38574
38770
  };
38575
38771
  const attrConfig$3 = Object.freeze({
38576
38772
  xmlName: "w:displacedByCustomXml",
38577
38773
  sdName: "displacedByCustomXml",
38578
- encode: encode$8,
38579
- decode: decode$a
38774
+ encode: encode$a,
38775
+ decode: decode$c
38580
38776
  });
38581
- const validXmlAttributes$3 = [attrConfig$7, attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3];
38582
- const XML_NODE_NAME$6 = "w:bookmarkStart";
38777
+ const validXmlAttributes$5 = [attrConfig$7, attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3];
38778
+ const XML_NODE_NAME$8 = "w:bookmarkStart";
38583
38779
  const SD_NODE_NAME$6 = "bookmarkStart";
38584
- const encode$7 = (params2, encodedAttrs = {}) => {
38780
+ const encode$9 = (params2, encodedAttrs = {}) => {
38585
38781
  return {
38586
38782
  type: "bookmarkStart",
38587
38783
  attrs: encodedAttrs
38588
38784
  };
38589
38785
  };
38590
- const decode$9 = (params2, decodedAttrs = {}) => {
38786
+ const decode$b = (params2, decodedAttrs = {}) => {
38591
38787
  const result = {
38592
38788
  name: "w:bookmarkStart",
38593
38789
  elements: []
@@ -38597,49 +38793,49 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38597
38793
  }
38598
38794
  return result;
38599
38795
  };
38600
- const config$5 = {
38601
- xmlName: XML_NODE_NAME$6,
38796
+ const config$7 = {
38797
+ xmlName: XML_NODE_NAME$8,
38602
38798
  sdNodeOrKeyName: SD_NODE_NAME$6,
38603
38799
  type: NodeTranslator.translatorTypes.NODE,
38604
- encode: encode$7,
38605
- decode: decode$9,
38606
- attributes: validXmlAttributes$3
38800
+ encode: encode$9,
38801
+ decode: decode$b,
38802
+ attributes: validXmlAttributes$5
38607
38803
  };
38608
- const translator$5 = NodeTranslator.from(config$5);
38609
- const encode$6 = (attributes) => {
38804
+ const translator$7 = NodeTranslator.from(config$7);
38805
+ const encode$8 = (attributes) => {
38610
38806
  return attributes["w:id"];
38611
38807
  };
38612
- const decode$8 = (attrs) => {
38808
+ const decode$a = (attrs) => {
38613
38809
  return attrs.id;
38614
38810
  };
38615
38811
  const attrConfig$2 = Object.freeze({
38616
38812
  xmlName: "w:id",
38617
38813
  sdName: "id",
38618
- encode: encode$6,
38619
- decode: decode$8
38814
+ encode: encode$8,
38815
+ decode: decode$a
38620
38816
  });
38621
- const encode$5 = (attributes) => {
38817
+ const encode$7 = (attributes) => {
38622
38818
  return attributes["w:displacedByCustomXml"];
38623
38819
  };
38624
- const decode$7 = (attrs) => {
38820
+ const decode$9 = (attrs) => {
38625
38821
  return attrs.displacedByCustomXml;
38626
38822
  };
38627
38823
  const attrConfig$1 = Object.freeze({
38628
38824
  xmlName: "w:displacedByCustomXml",
38629
38825
  sdName: "displacedByCustomXml",
38630
- encode: encode$5,
38631
- decode: decode$7
38826
+ encode: encode$7,
38827
+ decode: decode$9
38632
38828
  });
38633
- const validXmlAttributes$2 = [attrConfig$2, attrConfig$1];
38634
- const XML_NODE_NAME$5 = "w:bookmarkEnd";
38829
+ const validXmlAttributes$4 = [attrConfig$2, attrConfig$1];
38830
+ const XML_NODE_NAME$7 = "w:bookmarkEnd";
38635
38831
  const SD_NODE_NAME$5 = "bookmarkEnd";
38636
- const encode$4 = (params2, encodedAttrs = {}) => {
38832
+ const encode$6 = (params2, encodedAttrs = {}) => {
38637
38833
  return {
38638
38834
  type: "bookmarkEnd",
38639
38835
  attrs: encodedAttrs
38640
38836
  };
38641
38837
  };
38642
- const decode$6 = (params2, decodedAttrs = {}) => {
38838
+ const decode$8 = (params2, decodedAttrs = {}) => {
38643
38839
  const result = {
38644
38840
  name: "w:bookmarkEnd",
38645
38841
  elements: []
@@ -38649,27 +38845,27 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38649
38845
  }
38650
38846
  return result;
38651
38847
  };
38652
- const config$4 = {
38653
- xmlName: XML_NODE_NAME$5,
38848
+ const config$6 = {
38849
+ xmlName: XML_NODE_NAME$7,
38654
38850
  sdNodeOrKeyName: SD_NODE_NAME$5,
38655
38851
  type: NodeTranslator.translatorTypes.NODE,
38656
- encode: encode$4,
38657
- decode: decode$6,
38658
- attributes: validXmlAttributes$2
38852
+ encode: encode$6,
38853
+ decode: decode$8,
38854
+ attributes: validXmlAttributes$4
38659
38855
  };
38660
- const translator$4 = NodeTranslator.from(config$4);
38661
- const decode$5 = (attrs) => attrs?.["w:id"];
38856
+ const translator$6 = NodeTranslator.from(config$6);
38857
+ const decode$7 = (attrs) => attrs?.["w:id"];
38662
38858
  const attrConfig = Object.freeze({
38663
38859
  xmlName: "w:id",
38664
38860
  sdName: "w:id",
38665
38861
  // We do not translate it from 'w:id' to 'id' when encoding, so the name is the same
38666
38862
  encode: () => {
38667
38863
  },
38668
- decode: decode$5
38864
+ decode: decode$7
38669
38865
  });
38670
- const XML_NODE_NAME$4 = "w:commentRange";
38866
+ const XML_NODE_NAME$6 = "w:commentRange";
38671
38867
  const SD_NODE_NAME$4 = "commentRange";
38672
- const decode$4 = (params2) => {
38868
+ const decode$6 = (params2) => {
38673
38869
  const { node, comments, commentsExportType, exportedCommentDefs } = params2;
38674
38870
  if (!node) return;
38675
38871
  if (!comments) return;
@@ -38712,19 +38908,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38712
38908
  };
38713
38909
  };
38714
38910
  const getConfig = (type2) => ({
38715
- xmlName: `${XML_NODE_NAME$4}${type2}`,
38911
+ xmlName: `${XML_NODE_NAME$6}${type2}`,
38716
38912
  sdNodeOrKeyName: `${SD_NODE_NAME$4}${type2}`,
38717
38913
  type: NodeTranslator.translatorTypes.NODE,
38718
38914
  encode: () => {
38719
38915
  },
38720
- decode: decode$4,
38916
+ decode: decode$6,
38721
38917
  attributes: [attrConfig]
38722
38918
  });
38723
38919
  const commentRangeStartTranslator = NodeTranslator.from(getConfig("Start"));
38724
38920
  const commentRangeEndTranslator = NodeTranslator.from(getConfig("End"));
38725
- const XML_NODE_NAME$3 = "sd:pageReference";
38921
+ const XML_NODE_NAME$5 = "sd:pageReference";
38726
38922
  const SD_NODE_NAME$3 = "pageReference";
38727
- const encode$3 = (params2) => {
38923
+ const encode$5 = (params2) => {
38728
38924
  const { nodes = [], nodeListHandler } = params2 || {};
38729
38925
  const node = nodes[0];
38730
38926
  const processedText = nodeListHandler.handler({
@@ -38741,7 +38937,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38741
38937
  };
38742
38938
  return processedNode;
38743
38939
  };
38744
- const decode$3 = (params2) => {
38940
+ const decode$5 = (params2) => {
38745
38941
  const { node } = params2;
38746
38942
  const outputMarks = processOutputMarks(node.attrs?.marksAsAttrs || []);
38747
38943
  const contentNodes = (node.content ?? []).flatMap((n) => exportSchemaToJson({ ...params2, node: n }));
@@ -38814,17 +39010,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38814
39010
  ];
38815
39011
  return translated;
38816
39012
  };
38817
- const config$3 = {
38818
- xmlName: XML_NODE_NAME$3,
39013
+ const config$5 = {
39014
+ xmlName: XML_NODE_NAME$5,
38819
39015
  sdNodeOrKeyName: SD_NODE_NAME$3,
38820
39016
  type: NodeTranslator.translatorTypes.NODE,
38821
- encode: encode$3,
38822
- decode: decode$3
39017
+ encode: encode$5,
39018
+ decode: decode$5
38823
39019
  };
38824
- const translator$3 = NodeTranslator.from(config$3);
38825
- const XML_NODE_NAME$2 = "sd:tableOfContents";
39020
+ const translator$5 = NodeTranslator.from(config$5);
39021
+ const XML_NODE_NAME$4 = "sd:tableOfContents";
38826
39022
  const SD_NODE_NAME$2 = "tableOfContents";
38827
- const encode$2 = (params2) => {
39023
+ const encode$4 = (params2) => {
38828
39024
  const { nodes = [], nodeListHandler } = params2 || {};
38829
39025
  const node = nodes[0];
38830
39026
  const processedContent = nodeListHandler.handler({
@@ -38840,7 +39036,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38840
39036
  };
38841
39037
  return processedNode;
38842
39038
  };
38843
- const decode$2 = (params2) => {
39039
+ const decode$4 = (params2) => {
38844
39040
  const { node } = params2;
38845
39041
  const contentNodes = node.content.map((n) => exportSchemaToJson({ ...params2, node: n }));
38846
39042
  const tocBeginElements = [
@@ -38887,14 +39083,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
38887
39083
  }
38888
39084
  return contentNodes;
38889
39085
  };
38890
- const config$2 = {
38891
- xmlName: XML_NODE_NAME$2,
39086
+ const config$4 = {
39087
+ xmlName: XML_NODE_NAME$4,
38892
39088
  sdNodeOrKeyName: SD_NODE_NAME$2,
38893
39089
  type: NodeTranslator.translatorTypes.NODE,
38894
- encode: encode$2,
38895
- decode: decode$2
39090
+ encode: encode$4,
39091
+ decode: decode$4
38896
39092
  };
38897
- const translator$2 = NodeTranslator.from(config$2);
39093
+ const translator$4 = NodeTranslator.from(config$4);
38898
39094
  function parseInlineStyles(styleString) {
38899
39095
  if (!styleString) return {};
38900
39096
  return styleString.split(";").filter((style2) => !!style2.trim()).reduce((acc, style2) => {
@@ -39028,7 +39224,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39028
39224
  if (mainNode.name === "w:drawing") node = mainNode;
39029
39225
  else node = mainNode.elements.find((el) => el.name === "w:drawing");
39030
39226
  if (!node) return { nodes: [], consumed: 0 };
39031
- const schemaNode = translator$7.encode(params2);
39227
+ const schemaNode = translator$9.encode(params2);
39032
39228
  const newNodes = schemaNode ? [schemaNode] : [];
39033
39229
  return { nodes: newNodes, consumed: 1 };
39034
39230
  };
@@ -39036,6 +39232,203 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39036
39232
  handlerName: "drawingNodeHandler",
39037
39233
  handler: handleDrawingNode
39038
39234
  };
39235
+ const createTrackStyleMark = (marks) => {
39236
+ const trackStyleMark = marks.find((mark) => mark.type === "trackFormat");
39237
+ if (trackStyleMark) {
39238
+ return {
39239
+ type: "element",
39240
+ name: "w:rPrChange",
39241
+ attributes: {
39242
+ "w:id": trackStyleMark.attrs.id,
39243
+ "w:author": trackStyleMark.attrs.author,
39244
+ "w:authorEmail": trackStyleMark.attrs.authorEmail,
39245
+ "w:date": trackStyleMark.attrs.date
39246
+ },
39247
+ elements: trackStyleMark.attrs.before.map((mark) => processOutputMarks([mark])).filter((r2) => r2 !== void 0)
39248
+ };
39249
+ }
39250
+ return void 0;
39251
+ };
39252
+ const XML_NODE_NAME$3 = "w:del";
39253
+ const SD_ATTR_KEY$1 = "trackDelete";
39254
+ const validXmlAttributes$3 = [
39255
+ createAttributeHandler("w:id", "id"),
39256
+ createAttributeHandler("w:date", "date"),
39257
+ createAttributeHandler("w:author", "author"),
39258
+ createAttributeHandler("w:authorEmail", "authorEmail")
39259
+ ];
39260
+ const encode$3 = (params2, encodedAttrs = {}) => {
39261
+ const { nodeListHandler, extraParams = {} } = params2;
39262
+ const { node } = extraParams;
39263
+ const subs = nodeListHandler.handler({
39264
+ ...params2,
39265
+ insideTrackChange: true,
39266
+ nodes: node.elements,
39267
+ path: [...params2.path || [], node]
39268
+ });
39269
+ encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
39270
+ subs.forEach((subElement) => {
39271
+ if (subElement.marks === void 0) subElement.marks = [];
39272
+ subElement.marks.push({ type: "trackDelete", attrs: encodedAttrs });
39273
+ });
39274
+ return subs;
39275
+ };
39276
+ function decode$3(params2) {
39277
+ const { node } = params2;
39278
+ if (!node || !node.type) {
39279
+ return null;
39280
+ }
39281
+ const trackingMarks = ["trackInsert", "trackFormat", "trackDelete"];
39282
+ const marks = node.marks;
39283
+ const trackedMark = marks.find((m2) => m2.type === "trackDelete");
39284
+ const trackStyleMark = createTrackStyleMark(marks);
39285
+ node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
39286
+ if (trackStyleMark) {
39287
+ node.marks.push(trackStyleMark);
39288
+ }
39289
+ const translatedTextNode = exportSchemaToJson({ ...params2, node });
39290
+ const textNode = translatedTextNode.elements.find((n) => n.name === "w:t");
39291
+ textNode.name = "w:delText";
39292
+ return {
39293
+ name: "w:del",
39294
+ attributes: {
39295
+ "w:id": trackedMark.attrs.id,
39296
+ "w:author": trackedMark.attrs.author,
39297
+ "w:authorEmail": trackedMark.attrs.authorEmail,
39298
+ "w:date": trackedMark.attrs.date
39299
+ },
39300
+ elements: [translatedTextNode]
39301
+ };
39302
+ }
39303
+ const config$3 = {
39304
+ xmlName: XML_NODE_NAME$3,
39305
+ sdNodeOrKeyName: SD_ATTR_KEY$1,
39306
+ type: NodeTranslator.translatorTypes.ATTRIBUTE,
39307
+ encode: encode$3,
39308
+ decode: decode$3,
39309
+ attributes: validXmlAttributes$3
39310
+ };
39311
+ const translator$3 = NodeTranslator.from(config$3);
39312
+ const XML_NODE_NAME$2 = "w:ins";
39313
+ const SD_ATTR_KEY = "trackInsert";
39314
+ const validXmlAttributes$2 = [
39315
+ createAttributeHandler("w:id", "id"),
39316
+ createAttributeHandler("w:date", "date"),
39317
+ createAttributeHandler("w:author", "author"),
39318
+ createAttributeHandler("w:authorEmail", "authorEmail")
39319
+ ];
39320
+ const encode$2 = (params2, encodedAttrs = {}) => {
39321
+ const { nodeListHandler, extraParams = {} } = params2;
39322
+ const { node } = extraParams;
39323
+ const subs = nodeListHandler.handler({
39324
+ ...params2,
39325
+ insideTrackChange: true,
39326
+ nodes: node.elements,
39327
+ path: [...params2.path || [], node]
39328
+ });
39329
+ encodedAttrs.importedAuthor = `${encodedAttrs.author} (imported)`;
39330
+ subs.forEach((subElement) => {
39331
+ if (subElement.marks === void 0) subElement.marks = [];
39332
+ subElement.marks.push({ type: "trackInsert", attrs: encodedAttrs });
39333
+ });
39334
+ return subs;
39335
+ };
39336
+ function decode$2(params2) {
39337
+ const { node } = params2;
39338
+ if (!node || !node.type) {
39339
+ return null;
39340
+ }
39341
+ const trackingMarks = ["trackInsert", "trackFormat", "trackDelete"];
39342
+ const marks = node.marks;
39343
+ const trackedMark = marks.find((m2) => m2.type === "trackInsert");
39344
+ const trackStyleMark = createTrackStyleMark(marks);
39345
+ node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
39346
+ if (trackStyleMark) {
39347
+ node.marks.push(trackStyleMark);
39348
+ }
39349
+ const translatedTextNode = exportSchemaToJson({ ...params2, node });
39350
+ return {
39351
+ name: "w:ins",
39352
+ attributes: {
39353
+ "w:id": trackedMark.attrs.id,
39354
+ "w:author": trackedMark.attrs.author,
39355
+ "w:authorEmail": trackedMark.attrs.authorEmail,
39356
+ "w:date": trackedMark.attrs.date
39357
+ },
39358
+ elements: [translatedTextNode]
39359
+ };
39360
+ }
39361
+ const config$2 = {
39362
+ xmlName: XML_NODE_NAME$2,
39363
+ sdNodeOrKeyName: SD_ATTR_KEY,
39364
+ type: NodeTranslator.translatorTypes.ATTRIBUTE,
39365
+ encode: encode$2,
39366
+ decode: decode$2,
39367
+ attributes: validXmlAttributes$2
39368
+ };
39369
+ const translator$2 = NodeTranslator.from(config$2);
39370
+ const isTrackChangeElement = (node) => node?.name === "w:del" || node?.name === "w:ins";
39371
+ const unwrapTrackChangeNode = (node) => {
39372
+ if (!node) {
39373
+ return null;
39374
+ }
39375
+ if (isTrackChangeElement(node)) {
39376
+ return node;
39377
+ }
39378
+ if (node.name === "w:sdt") {
39379
+ const content = node.elements?.find((element) => element.name === "w:sdtContent");
39380
+ if (!content?.elements?.length) {
39381
+ return null;
39382
+ }
39383
+ for (const child of content.elements) {
39384
+ const trackChange = unwrapTrackChangeNode(child);
39385
+ if (trackChange) {
39386
+ return trackChange;
39387
+ }
39388
+ }
39389
+ }
39390
+ return null;
39391
+ };
39392
+ const handleTrackChangeNode = (params2) => {
39393
+ const { nodes } = params2;
39394
+ if (nodes.length === 0) {
39395
+ return { nodes: [], consumed: 0 };
39396
+ }
39397
+ const mainNode = unwrapTrackChangeNode(nodes[0]);
39398
+ if (!mainNode) {
39399
+ return { nodes: [], consumed: 0 };
39400
+ }
39401
+ let result;
39402
+ const translatorParams = {
39403
+ ...params2,
39404
+ nodes: [mainNode]
39405
+ };
39406
+ switch (mainNode.name) {
39407
+ case "w:del":
39408
+ result = translator$3.encode({
39409
+ extraParams: {
39410
+ node: mainNode
39411
+ },
39412
+ ...translatorParams
39413
+ });
39414
+ break;
39415
+ case "w:ins":
39416
+ result = translator$2.encode({
39417
+ extraParams: {
39418
+ node: mainNode
39419
+ },
39420
+ ...translatorParams
39421
+ });
39422
+ break;
39423
+ }
39424
+ return { nodes: result, consumed: 1 };
39425
+ };
39426
+ const trackChangeNodeHandlerEntity = {
39427
+ handlerName: "trackChangeNodeHandler",
39428
+ handler: handleTrackChangeNode
39429
+ };
39430
+ const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$Z);
39431
+ const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$Y);
39039
39432
  function parseProperties(node) {
39040
39433
  const marks = [];
39041
39434
  const unknownMarks = [];
@@ -39087,51 +39480,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39087
39480
  const isPropertiesElement = (element) => {
39088
39481
  return !!SuperConverter.propertyTypes[element.name || element.type];
39089
39482
  };
39090
- const handleTrackChangeNode = (params2) => {
39091
- const { nodes, nodeListHandler } = params2;
39092
- if (nodes.length === 0 || !(nodes[0].name === "w:del" || nodes[0].name === "w:ins" || nodes[0].name === "w:sdt")) {
39093
- return { nodes: [], consumed: 0 };
39094
- }
39095
- const mainNode = nodes[0];
39096
- let node;
39097
- if (["w:ins", "w:del"].includes(mainNode.name)) {
39098
- node = mainNode;
39099
- } else {
39100
- const sdtContent = mainNode.elements.find((el) => el.name === "w:sdtContent");
39101
- const trackedChange = sdtContent?.elements.find((el) => ["w:ins", "w:del"].includes(el.name));
39102
- if (trackedChange) node = trackedChange;
39103
- }
39104
- if (!node) {
39105
- return { nodes: [], consumed: 0 };
39106
- }
39107
- const { name } = node;
39108
- const { attributes, elements } = parseProperties(node);
39109
- const subs = nodeListHandler.handler({
39110
- ...params2,
39111
- insideTrackChange: true,
39112
- nodes: elements,
39113
- path: [...params2.path || [], node]
39114
- });
39115
- const changeType = name === "w:del" ? TrackDeleteMarkName : TrackInsertMarkName;
39116
- const mappedAttributes = {
39117
- id: attributes["w:id"],
39118
- date: attributes["w:date"],
39119
- author: attributes["w:author"],
39120
- authorEmail: attributes["w:authorEmail"],
39121
- importedAuthor: `${attributes["w:author"]} (imported)`
39122
- };
39123
- subs.forEach((subElement) => {
39124
- if (subElement.marks === void 0) subElement.marks = [];
39125
- subElement.marks.push({ type: changeType, attrs: mappedAttributes });
39126
- });
39127
- return { nodes: subs, consumed: 1 };
39128
- };
39129
- const trackChangeNodeHandlerEntity = {
39130
- handlerName: "trackChangeNodeHandler",
39131
- handler: handleTrackChangeNode
39132
- };
39133
- const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$X);
39134
- const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$W);
39135
39483
  const handleTextNode = (params2) => {
39136
39484
  const { nodes, insideTrackChange } = params2;
39137
39485
  if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
@@ -39172,7 +39520,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39172
39520
  if (nodes.length === 0 || nodes[0].name !== "w:p") {
39173
39521
  return { nodes: [], consumed: 0 };
39174
39522
  }
39175
- const schemaNode = translator$17.encode(params2);
39523
+ const schemaNode = translator$19.encode(params2);
39176
39524
  const newNodes = schemaNode ? [schemaNode] : [];
39177
39525
  return { nodes: newNodes, consumed: 1 };
39178
39526
  };
@@ -39185,7 +39533,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39185
39533
  if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
39186
39534
  return { nodes: [], consumed: 0 };
39187
39535
  }
39188
- const result = translator$6.encode(params2);
39536
+ const result = translator$8.encode(params2);
39189
39537
  if (!result) {
39190
39538
  return { nodes: [], consumed: 0 };
39191
39539
  }
@@ -39275,7 +39623,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39275
39623
  if (nodes.length === 0 || nodes[0].name !== "w:br") {
39276
39624
  return { nodes: [], consumed: 0 };
39277
39625
  }
39278
- const result = translator$1a.encode(params2);
39626
+ const result = translator$1c.encode(params2);
39279
39627
  if (!result) return { nodes: [], consumed: 0 };
39280
39628
  return {
39281
39629
  nodes: [result],
@@ -39347,7 +39695,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39347
39695
  if (isCustomMarkBookmark(nodes[0], params2.editor)) {
39348
39696
  return handleBookmarkNode(params2);
39349
39697
  }
39350
- const node = translator$5.encode(params2);
39698
+ const node = translator$7.encode(params2);
39351
39699
  if (!node) return { nodes: [], consumed: 0 };
39352
39700
  return { nodes: [node], consumed: 1 };
39353
39701
  };
@@ -39379,7 +39727,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39379
39727
  if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
39380
39728
  return { nodes: [], consumed: 0 };
39381
39729
  }
39382
- const node = translator$4.encode(params2);
39730
+ const node = translator$6.encode(params2);
39383
39731
  if (!node) return { nodes: [], consumed: 0 };
39384
39732
  return { nodes: [node], consumed: 1 };
39385
39733
  };
@@ -39512,7 +39860,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39512
39860
  handlerName: "autoTotalPageCountEntity",
39513
39861
  handler: handleAutoTotalPageNumber
39514
39862
  };
39515
- const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$3);
39863
+ const pageReferenceEntity = generateV2HandlerEntity("pageReferenceNodeHandler", translator$5);
39516
39864
  const handlePictNode = (params2) => {
39517
39865
  const { nodes } = params2;
39518
39866
  if (!nodes.length || nodes[0].name !== "w:p") {
@@ -39874,14 +40222,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
39874
40222
  if (!nodes.length || nodes[0].name !== "w:tab") {
39875
40223
  return { nodes: [], consumed: 0 };
39876
40224
  }
39877
- const node = translator$18.encode(params2);
40225
+ const node = translator$1a.encode(params2);
39878
40226
  return { nodes: [node], consumed: 1 };
39879
40227
  };
39880
40228
  const tabNodeEntityHandler = {
39881
40229
  handlerName: "w:tabTranslator",
39882
40230
  handler: handleTabNode
39883
40231
  };
39884
- const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$2);
40232
+ const tableOfContentsHandlerEntity = generateV2HandlerEntity("tableOfContentsHandler", translator$4);
39885
40233
  function preProcessPageInstruction(nodesToCombine) {
39886
40234
  const pageNumNode = {
39887
40235
  name: "sd:autoPageNumber",
@@ -40822,7 +41170,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40822
41170
  const XML_NODE_NAME = "w:pict";
40823
41171
  const SD_NODE_NAME = ["shapeContainer", "contentBlock"];
40824
41172
  const validXmlAttributes = [];
40825
- function encode$1d(params2) {
41173
+ function encode$1f(params2) {
40826
41174
  const { node, pNode } = params2.extraParams;
40827
41175
  const { type: pictType, handler: handler2 } = pictNodeTypeStrategy(node);
40828
41176
  if (!handler2 || pictType === "unknown") {
@@ -40854,7 +41202,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40854
41202
  xmlName: XML_NODE_NAME,
40855
41203
  sdNodeOrKeyName: SD_NODE_NAME,
40856
41204
  type: NodeTranslator.translatorTypes.NODE,
40857
- encode: encode$1d,
41205
+ encode: encode$1f,
40858
41206
  decode,
40859
41207
  attributes: validXmlAttributes
40860
41208
  };
@@ -40930,35 +41278,35 @@ Please report this to https://github.com/markedjs/marked.`, e) {
40930
41278
  doc: translateDocumentNode,
40931
41279
  body: translateBodyNode,
40932
41280
  heading: translateHeadingNode,
40933
- paragraph: translator$17,
40934
- run: translator$W,
41281
+ paragraph: translator$19,
41282
+ run: translator$Y,
40935
41283
  text: translateTextNode,
40936
41284
  bulletList: translateList,
40937
41285
  orderedList: translateList,
40938
- lineBreak: translator$1a,
40939
- table: translator$b,
40940
- tableRow: translator$I,
40941
- tableCell: translator$a,
40942
- bookmarkStart: translator$5,
40943
- bookmarkEnd: translator$4,
40944
- fieldAnnotation: translator$6,
40945
- tab: translator$18,
40946
- image: translator$7,
40947
- hardBreak: translator$1a,
41286
+ lineBreak: translator$1c,
41287
+ table: translator$d,
41288
+ tableRow: translator$K,
41289
+ tableCell: translator$c,
41290
+ bookmarkStart: translator$7,
41291
+ bookmarkEnd: translator$6,
41292
+ fieldAnnotation: translator$8,
41293
+ tab: translator$1a,
41294
+ image: translator$9,
41295
+ hardBreak: translator$1c,
40948
41296
  commentRangeStart: commentRangeStartTranslator,
40949
41297
  commentRangeEnd: commentRangeEndTranslator,
40950
41298
  commentReference: () => null,
40951
41299
  shapeContainer: translator,
40952
41300
  shapeTextbox: translator,
40953
41301
  contentBlock: translator,
40954
- structuredContent: translator$6,
40955
- structuredContentBlock: translator$6,
40956
- documentPartObject: translator$6,
40957
- documentSection: translator$6,
41302
+ structuredContent: translator$8,
41303
+ structuredContentBlock: translator$8,
41304
+ documentPartObject: translator$8,
41305
+ documentSection: translator$8,
40958
41306
  "page-number": translatePageNumberNode,
40959
41307
  "total-page-number": translateTotalPageNumberNode,
40960
- pageReference: translator$3,
40961
- tableOfContents: translator$2
41308
+ pageReference: translator$5,
41309
+ tableOfContents: translator$4
40962
41310
  };
40963
41311
  let handler2 = router[type2];
40964
41312
  if (handler2 && "decode" in handler2 && typeof handler2.decode === "function") {
@@ -41294,62 +41642,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41294
41642
  function translateTextNode(params2) {
41295
41643
  const { node, extraParams } = params2;
41296
41644
  const trackedMarks = [TrackInsertMarkName, TrackDeleteMarkName];
41297
- const isTrackedNode = node.marks?.some((m2) => trackedMarks.includes(m2.type));
41298
- if (isTrackedNode) return translateTrackedNode(params2);
41645
+ const trackedMark = node.marks?.find((m2) => trackedMarks.includes(m2.type));
41646
+ if (trackedMark) {
41647
+ switch (trackedMark.type) {
41648
+ case "trackDelete":
41649
+ return translator$3.decode(params2);
41650
+ case "trackInsert":
41651
+ return translator$2.decode(params2);
41652
+ }
41653
+ }
41299
41654
  const isLinkNode = node.marks?.some((m2) => m2.type === "link");
41300
41655
  if (isLinkNode && !extraParams?.linkProcessed) {
41301
- return translator$X.decode(params2);
41656
+ return translator$Z.decode(params2);
41302
41657
  }
41303
41658
  const { text, marks = [] } = node;
41304
41659
  return getTextNodeForExport(text, marks, params2);
41305
41660
  }
41306
- function createTrackStyleMark(marks) {
41307
- const trackStyleMark = marks.find((mark) => mark.type === TrackFormatMarkName);
41308
- if (trackStyleMark) {
41309
- const markElement = {
41310
- type: "element",
41311
- name: "w:rPrChange",
41312
- attributes: {
41313
- "w:id": trackStyleMark.attrs.id,
41314
- "w:author": trackStyleMark.attrs.author,
41315
- "w:authorEmail": trackStyleMark.attrs.authorEmail,
41316
- "w:date": trackStyleMark.attrs.date
41317
- },
41318
- elements: trackStyleMark.attrs.before.map((mark) => processOutputMarks([mark])).filter((r2) => r2 !== void 0)
41319
- };
41320
- return markElement;
41321
- }
41322
- return void 0;
41323
- }
41324
- function translateTrackedNode(params2) {
41325
- const { node } = params2;
41326
- const marks = node.marks;
41327
- const trackingMarks = [TrackInsertMarkName, TrackDeleteMarkName, TrackFormatMarkName];
41328
- const trackedMark = marks.find((m2) => trackingMarks.includes(m2.type));
41329
- const isInsert = trackedMark.type === TrackInsertMarkName;
41330
- const trackStyleMark = createTrackStyleMark(marks);
41331
- node.marks = marks.filter((m2) => !trackingMarks.includes(m2.type));
41332
- if (trackStyleMark) {
41333
- node.marks.push(trackStyleMark);
41334
- }
41335
- const translatedTextNode = exportSchemaToJson({ ...params2, node });
41336
- if (!isInsert) {
41337
- const textNode = translatedTextNode.elements.find((n) => n.name === "w:t");
41338
- textNode.name = "w:delText";
41339
- }
41340
- const trackedNode = {
41341
- name: isInsert ? "w:ins" : "w:del",
41342
- type: "element",
41343
- attributes: {
41344
- "w:id": trackedMark.attrs.id,
41345
- "w:author": trackedMark.attrs.author,
41346
- "w:authorEmail": trackedMark.attrs.authorEmail,
41347
- "w:date": trackedMark.attrs.date
41348
- },
41349
- elements: [translatedTextNode]
41350
- };
41351
- return trackedNode;
41352
- }
41353
41661
  function wrapTextInRun(nodeOrNodes, marks) {
41354
41662
  let elements = [];
41355
41663
  if (Array.isArray(nodeOrNodes)) elements = nodeOrNodes;
@@ -41605,7 +41913,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41605
41913
  markElement.type = "element";
41606
41914
  break;
41607
41915
  case "underline": {
41608
- const translated = translator$14.decode({
41916
+ const translated = translator$16.decode({
41609
41917
  node: {
41610
41918
  attrs: {
41611
41919
  underlineType: attrs.underlineType ?? attrs.underline ?? null,
@@ -41669,7 +41977,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
41669
41977
  break;
41670
41978
  case "highlight": {
41671
41979
  const highlightValue = attrs.color ?? attrs.highlight ?? null;
41672
- const translated = translator$19.decode({ node: { attrs: { highlight: highlightValue } } });
41980
+ const translated = translator$1b.decode({ node: { attrs: { highlight: highlightValue } } });
41673
41981
  return translated || {};
41674
41982
  }
41675
41983
  case "link":
@@ -71612,6 +71920,58 @@ Please report this to https://github.com/markedjs/marked.`, e) {
71612
71920
  }
71613
71921
  });
71614
71922
  };
71923
+ const normalizeWrap = (attrs = {}) => {
71924
+ const wrap2 = attrs.wrap;
71925
+ if (wrap2?.type && wrap2.type !== "Inline") {
71926
+ return {
71927
+ type: wrap2.type,
71928
+ attrs: wrap2.attrs ?? {}
71929
+ };
71930
+ }
71931
+ if (wrap2?.type === "Inline" && Object.keys(wrap2.attrs ?? {}).length) {
71932
+ return {
71933
+ type: "Inline",
71934
+ attrs: wrap2.attrs
71935
+ };
71936
+ }
71937
+ if (!wrap2 && attrs.wrapText) {
71938
+ return {
71939
+ type: "Square",
71940
+ attrs: {
71941
+ wrapText: attrs.wrapText
71942
+ }
71943
+ };
71944
+ }
71945
+ if (!wrap2 && attrs.wrapTopAndBottom) {
71946
+ return {
71947
+ type: "TopAndBottom",
71948
+ attrs: {}
71949
+ };
71950
+ }
71951
+ if (wrap2?.type === "Inline") {
71952
+ return {
71953
+ type: "Inline",
71954
+ attrs: wrap2.attrs ?? {}
71955
+ };
71956
+ }
71957
+ return {
71958
+ type: "Inline",
71959
+ attrs: {}
71960
+ };
71961
+ };
71962
+ const normalizeMarginOffset = (marginOffset = {}) => {
71963
+ const { left: left2, horizontal, ...rest } = marginOffset;
71964
+ return {
71965
+ ...rest,
71966
+ horizontal: horizontal ?? left2
71967
+ };
71968
+ };
71969
+ const getNormalizedImageAttrs = (attrs = {}) => {
71970
+ return {
71971
+ wrap: normalizeWrap(attrs),
71972
+ marginOffset: normalizeMarginOffset(attrs.marginOffset ?? {})
71973
+ };
71974
+ };
71615
71975
  const ImagePositionPluginKey = new PluginKey("ImagePosition");
71616
71976
  const ImagePositionPlugin = ({ editor }) => {
71617
71977
  const { view } = editor;
@@ -71659,7 +72019,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
71659
72019
  let style2 = "";
71660
72020
  let className = "";
71661
72021
  const { vRelativeFrom, alignH } = node.attrs.anchorData;
71662
- const { size: size2, padding, marginOffset } = node.attrs;
72022
+ const { size: size2, padding } = node.attrs;
72023
+ const { marginOffset } = getNormalizedImageAttrs(node.attrs);
71663
72024
  const pageBreak = findPreviousDomNodeWithClass(view, pos, "pagination-break-wrapper");
71664
72025
  if (pageBreak) {
71665
72026
  switch (alignH) {
@@ -71776,7 +72137,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
71776
72137
  rendered: false
71777
72138
  },
71778
72139
  originalAttributes: { rendered: false },
71779
- wrapTopAndBottom: { rendered: false },
72140
+ /**
72141
+ * @category Attribute
72142
+ * @param {Object} wrap - Wrapping options
72143
+ * @param {string} wrap.type - Wrap type: "None", "Square", "Through", "Tight", "TopAndBottom", "Inline"
72144
+ * @param {Object} [wrap.attrs] - Wrap attributes (only allowed attributes for the given type will be accepted)
72145
+ * @param {string} [wrap.attrs.wrapText] - Text wrapping mode for Square type: "bothSides", "largest", "left", "right"
72146
+ * @param {number} [wrap.attrs.distTop] - Top distance in pixels
72147
+ * @param {number} [wrap.attrs.distBottom] - Bottom distance in pixels
72148
+ * @param {number} [wrap.attrs.distLeft] - Left distance in pixels
72149
+ * @param {number} [wrap.attrs.distRight] - Right distance in pixels
72150
+ * @param {Array} [wrap.attrs.polygon] - Polygon points for Through/Tight types: [[x1,y1], [x2,y2], ...]
72151
+ * @param {boolean} [wrap.attrs.behindDoc] - Whether image should be behind document text (for wrapNone)
72152
+ */
72153
+ wrap: {
72154
+ default: { type: "Inline" },
72155
+ rendered: false
72156
+ // Handled in main renderDOM
72157
+ },
71780
72158
  anchorData: {
71781
72159
  default: null,
71782
72160
  rendered: false
@@ -71822,7 +72200,6 @@ Please report this to https://github.com/markedjs/marked.`, e) {
71822
72200
  * @private
71823
72201
  */
71824
72202
  simplePos: { rendered: false },
71825
- wrapText: { rendered: false },
71826
72203
  extension: { rendered: false },
71827
72204
  size: {
71828
72205
  default: {},
@@ -71838,55 +72215,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
71838
72215
  },
71839
72216
  padding: {
71840
72217
  default: {},
71841
- renderDOM: ({ size: size2 = {}, padding, marginOffset, transformData = {} }) => {
71842
- let { left: left2 = 0, top: top2 = 0, bottom: bottom2 = 0, right: right2 = 0 } = padding ?? {};
71843
- const { rotation } = transformData;
71844
- const { height, width } = size2;
71845
- if (rotation && height && width) {
71846
- const { horizontal, vertical } = getRotationMargins(width, height, rotation);
71847
- left2 += horizontal;
71848
- right2 += horizontal;
71849
- top2 += vertical;
71850
- bottom2 += vertical;
71851
- }
71852
- let style2 = "";
71853
- if (left2 && marginOffset?.left == null) style2 += `margin-left: ${left2}px;`;
71854
- if (top2 && marginOffset?.top == null) style2 += `margin-top: ${top2}px;`;
71855
- if (bottom2) style2 += `margin-bottom: ${bottom2}px;`;
71856
- if (right2) style2 += `margin-right: ${right2}px;`;
71857
- return { style: style2 };
71858
- }
72218
+ rendered: false
72219
+ // Handled in main renderDOM
71859
72220
  },
71860
72221
  marginOffset: {
71861
72222
  default: {},
71862
- renderDOM: ({ marginOffset, anchorData, transformData, size: size2 }) => {
71863
- const hasAnchorData = Boolean(anchorData);
71864
- const hasMarginOffsets = marginOffset?.left != null || marginOffset?.top != null;
71865
- if (!hasAnchorData && !hasMarginOffsets) return {};
71866
- const relativeFromPageV = anchorData?.vRelativeFrom === "page";
71867
- const maxMarginV = 500;
71868
- const baseLeft = marginOffset?.left ?? 0;
71869
- const baseTop = marginOffset?.top ?? 0;
71870
- let rotationLeft = 0;
71871
- let rotationTop = 0;
71872
- const { rotation } = transformData ?? {};
71873
- const { height, width } = size2 ?? {};
71874
- if (rotation && height && width) {
71875
- const { horizontal, vertical } = getRotationMargins(width, height, rotation);
71876
- rotationLeft = horizontal;
71877
- rotationTop = vertical;
71878
- }
71879
- const left2 = baseLeft + rotationLeft;
71880
- const top2 = baseTop + rotationTop;
71881
- let style2 = "";
71882
- if (left2) style2 += `margin-left: ${left2}px;`;
71883
- if (top2) {
71884
- if (relativeFromPageV && top2 >= maxMarginV) style2 += `margin-top: ${maxMarginV}px;`;
71885
- else style2 += `margin-top: ${top2}px;`;
71886
- }
71887
- if (!style2) return {};
71888
- return { style: style2 };
71889
- }
72223
+ rendered: false
72224
+ // Handled in main renderDOM
71890
72225
  },
71891
72226
  style: {
71892
72227
  default: null,
@@ -71905,8 +72240,181 @@ Please report this to https://github.com/markedjs/marked.`, e) {
71905
72240
  }
71906
72241
  ];
71907
72242
  },
71908
- renderDOM({ htmlAttributes }) {
71909
- return ["img", Attribute.mergeAttributes(this.options.htmlAttributes, htmlAttributes)];
72243
+ renderDOM({ node, htmlAttributes }) {
72244
+ const { wrap: wrap2, marginOffset } = getNormalizedImageAttrs(node.attrs);
72245
+ const { anchorData, padding, transformData = {}, size: size2 = { width: 0, height: 0 } } = node.attrs;
72246
+ const margin = {
72247
+ left: 0,
72248
+ right: 0,
72249
+ top: 0,
72250
+ bottom: 0
72251
+ };
72252
+ let centered = false;
72253
+ let floatRight = false;
72254
+ let baseHorizontal = marginOffset?.horizontal || 0;
72255
+ let style2 = "";
72256
+ if (padding) {
72257
+ if (padding.left) margin.left += padding.left;
72258
+ if (padding.right) margin.right += padding.right;
72259
+ if (padding.top) margin.top += padding.top;
72260
+ if (padding.bottom) margin.bottom += padding.bottom;
72261
+ }
72262
+ const { rotation } = transformData;
72263
+ const { height, width } = size2;
72264
+ if (rotation && height && width) {
72265
+ const { horizontal, vertical } = getRotationMargins(width, height, rotation);
72266
+ margin.left += horizontal;
72267
+ margin.right += horizontal;
72268
+ margin.top += vertical;
72269
+ margin.bottom += vertical;
72270
+ }
72271
+ if (wrap2 && wrap2.type) {
72272
+ const { type: type2, attrs = {} } = wrap2;
72273
+ switch (type2) {
72274
+ case "None":
72275
+ style2 += "position: absolute;";
72276
+ if (attrs.behindDoc) {
72277
+ style2 += "z-index: -1;";
72278
+ } else {
72279
+ style2 += "z-index: 1;";
72280
+ }
72281
+ break;
72282
+ case "Square":
72283
+ style2 += "shape-outside: border-box; clear: both;";
72284
+ if (attrs.wrapText === "right") {
72285
+ style2 += "float: left;";
72286
+ } else if (attrs.wrapText === "left") {
72287
+ style2 += "float: right;";
72288
+ floatRight = true;
72289
+ } else if (["largest", "bothSides"].includes(attrs.wrapText)) {
72290
+ const pageStyles2 = this.editor?.converter?.pageStyles;
72291
+ if (pageStyles2?.pageSize && pageStyles2?.pageMargins && size2.width) {
72292
+ const pageWidth = inchesToPixels(pageStyles2.pageSize.width);
72293
+ const leftMargin = inchesToPixels(pageStyles2.pageMargins.left);
72294
+ const rightMargin = inchesToPixels(pageStyles2.pageMargins.right);
72295
+ const contentWidth = pageWidth - leftMargin - rightMargin;
72296
+ const imageWidth = size2.width + (attrs.distLeft || 0) + (attrs.distRight || 0);
72297
+ const leftSpace = marginOffset.horizontal;
72298
+ const rightSpace = contentWidth - leftSpace - imageWidth;
72299
+ if (rightSpace < 0) {
72300
+ style2 += "float: left;";
72301
+ } else if (rightSpace > leftSpace) {
72302
+ style2 += "float: left;";
72303
+ } else {
72304
+ style2 += "float: right;";
72305
+ floatRight = true;
72306
+ baseHorizontal = rightSpace;
72307
+ }
72308
+ } else {
72309
+ style2 += "float: left;";
72310
+ }
72311
+ }
72312
+ if (attrs.distTop) margin.top += attrs.distTop;
72313
+ if (attrs.distBottom) margin.bottom += attrs.distBottom;
72314
+ if (attrs.distLeft) margin.left += attrs.distLeft;
72315
+ if (attrs.distRight) margin.right += attrs.distRight;
72316
+ break;
72317
+ case "Through":
72318
+ case "Tight":
72319
+ style2 += "clear: both;";
72320
+ const pageStyles = this.editor?.converter?.pageStyles;
72321
+ if (pageStyles?.pageSize && pageStyles?.pageMargins && size2.width) {
72322
+ const pageWidth = inchesToPixels(pageStyles.pageSize.width);
72323
+ const leftMargin = inchesToPixels(pageStyles.pageMargins.left);
72324
+ const rightMargin = inchesToPixels(pageStyles.pageMargins.right);
72325
+ const contentWidth = pageWidth - leftMargin - rightMargin;
72326
+ const imageWidth = size2.width + (attrs.distLeft || 0) + (attrs.distRight || 0);
72327
+ const leftSpace = marginOffset.horizontal;
72328
+ const rightSpace = contentWidth - leftSpace - imageWidth;
72329
+ if (rightSpace < 0) {
72330
+ style2 += "float: left;";
72331
+ } else if (rightSpace > leftSpace) {
72332
+ style2 += "float: left;";
72333
+ } else {
72334
+ style2 += "float: right;";
72335
+ floatRight = true;
72336
+ baseHorizontal = rightSpace;
72337
+ }
72338
+ } else {
72339
+ style2 += "float: left;";
72340
+ }
72341
+ if (attrs.distTop) margin.top += attrs.distTop;
72342
+ if (attrs.distBottom) margin.bottom += attrs.distBottom;
72343
+ if (attrs.distLeft) margin.left += attrs.distLeft;
72344
+ if (attrs.distRight) margin.right += attrs.distRight;
72345
+ if (attrs.polygon) {
72346
+ let horizontalOffset = floatRight ? attrs.polygon[0][0] || 0 : marginOffset.horizontal + 15;
72347
+ let maxX = 0;
72348
+ let minX = 0;
72349
+ let minY = 0;
72350
+ let maxY = 0;
72351
+ attrs.polygon.forEach(([x, y2]) => {
72352
+ if (floatRight && x < horizontalOffset) horizontalOffset = x;
72353
+ if (x > maxX) maxX = x;
72354
+ if (x < minX) minX = x;
72355
+ if (y2 > maxY) maxY = y2;
72356
+ if (y2 < minY) minY = y2;
72357
+ });
72358
+ const originalWidth = maxX - minX;
72359
+ const originalHeight = maxY - minY;
72360
+ const scaleWidth = Math.min(1, size2.width / originalWidth);
72361
+ const scaleHeight = Math.min(1, size2.height / originalHeight);
72362
+ const verticalOffset = Math.max(0, marginOffset.top);
72363
+ const points = attrs.polygon.map(([x, y2]) => `${horizontalOffset + x * scaleWidth}px ${verticalOffset + y2 * scaleHeight}px`).join(", ");
72364
+ style2 += `shape-outside: polygon(${points});`;
72365
+ }
72366
+ break;
72367
+ case "TopAndBottom":
72368
+ style2 += "display: block; clear: both;";
72369
+ if (attrs.distTop) margin.top += attrs.distTop;
72370
+ if (attrs.distBottom) margin.bottom += attrs.distBottom;
72371
+ centered = true;
72372
+ break;
72373
+ }
72374
+ }
72375
+ const hasAnchorData = Boolean(anchorData);
72376
+ const hasMarginOffsets = marginOffset?.horizontal != null || marginOffset?.top != null;
72377
+ if (hasAnchorData || hasMarginOffsets) {
72378
+ const relativeFromPageV = anchorData?.vRelativeFrom === "page";
72379
+ const maxMarginV = 500;
72380
+ const baseTop = Math.max(0, marginOffset?.top ?? 0);
72381
+ let rotationHorizontal = 0;
72382
+ let rotationTop = 0;
72383
+ const { rotation: rotation2 } = transformData ?? {};
72384
+ const { height: height2, width: width2 } = size2 ?? {};
72385
+ if (rotation2 && height2 && width2) {
72386
+ const { horizontal: horizontal2, vertical } = getRotationMargins(width2, height2, rotation2);
72387
+ rotationHorizontal = horizontal2;
72388
+ rotationTop = vertical;
72389
+ }
72390
+ const horizontal = baseHorizontal + rotationHorizontal;
72391
+ const top2 = baseTop + rotationTop;
72392
+ if (horizontal) {
72393
+ if (floatRight) {
72394
+ margin.right += horizontal;
72395
+ } else {
72396
+ margin.left += horizontal;
72397
+ }
72398
+ }
72399
+ if (top2) {
72400
+ if (relativeFromPageV && top2 >= maxMarginV) margin.top += maxMarginV;
72401
+ else margin.top += top2;
72402
+ }
72403
+ }
72404
+ if (centered) {
72405
+ style2 += "margin-left: auto; margin-right: auto;";
72406
+ } else {
72407
+ if (margin.left) style2 += `margin-left: ${margin.left}px;`;
72408
+ if (margin.right) style2 += `margin-right: ${margin.right}px;`;
72409
+ }
72410
+ if (margin.top) style2 += `margin-top: ${margin.top}px;`;
72411
+ if (margin.bottom) style2 += `margin-bottom: ${margin.bottom}px;`;
72412
+ const finalAttributes = { ...htmlAttributes };
72413
+ if (style2) {
72414
+ const existingStyle = finalAttributes.style || "";
72415
+ finalAttributes.style = existingStyle + (existingStyle ? " " : "") + style2;
72416
+ }
72417
+ return ["img", Attribute.mergeAttributes(this.options.htmlAttributes, finalAttributes)];
71910
72418
  },
71911
72419
  addCommands() {
71912
72420
  return {
@@ -71928,6 +72436,85 @@ Please report this to https://github.com/markedjs/marked.`, e) {
71928
72436
  type: this.name,
71929
72437
  attrs: options
71930
72438
  });
72439
+ },
72440
+ /**
72441
+ * Set the wrapping mode and attributes for the selected image
72442
+ * @category Command
72443
+ * @param {Object} options - Wrapping options
72444
+ * @param {string} options.type - Wrap type: "None", "Square", "Through", "Tight", "TopAndBottom", "Inline"
72445
+ * @param {Object} [options.attrs] - Wrap attributes (only allowed attributes for the given type will be accepted)
72446
+ * @param {string} [options.attrs.wrapText] - Text wrapping mode for Square type: "bothSides", "largest", "left", "right"
72447
+ * @param {number} [options.attrs.distTop] - Top distance in pixels
72448
+ * @param {number} [options.attrs.distBottom] - Bottom distance in pixels
72449
+ * @param {number} [options.attrs.distLeft] - Left distance in pixels
72450
+ * @param {number} [options.attrs.distRight] - Right distance in pixels
72451
+ * @param {Array} [options.attrs.polygon] - Polygon points for Through/Tight types: [[x1,y1], [x2,y2], ...]
72452
+ * @param {boolean} [options.attrs.behindDoc] - Whether image should be behind document text (for wrapNone)
72453
+ * @example
72454
+ * // No wrapping, behind document
72455
+ * editor.commands.setWrapping({ type: 'None', attrs: {behindDoc: true} })
72456
+ *
72457
+ * // Square wrapping on both sides with distances
72458
+ * editor.commands.setWrapping({
72459
+ * type: 'Square',
72460
+ * attrs: {
72461
+ * wrapText: 'bothSides',
72462
+ * distTop: 10,
72463
+ * distBottom: 10,
72464
+ * distLeft: 10,
72465
+ * distRight: 10
72466
+ * }
72467
+ * })
72468
+ *
72469
+ * // Tight wrapping with polygon
72470
+ * editor.commands.setWrapping({
72471
+ * type: 'Tight',
72472
+ * attrs: {
72473
+ * polygon: [[0, 0], [100, 0], [100, 100], [0, 100]]
72474
+ * }
72475
+ * })
72476
+ *
72477
+ * // Top and bottom wrapping
72478
+ * editor.commands.setWrapping({
72479
+ * type: 'TopAndBottom',
72480
+ * attrs: {
72481
+ * distTop: 15,
72482
+ * distBottom: 15
72483
+ * }
72484
+ * })
72485
+ */
72486
+ setWrapping: (options) => ({ chain, state: state2 }) => {
72487
+ const { selection } = state2;
72488
+ const { $from } = selection;
72489
+ const node = $from.nodeAfter;
72490
+ if (!node || node.type.name !== this.name) {
72491
+ return false;
72492
+ }
72493
+ const { type: type2, attrs = {} } = options;
72494
+ const allowedAttrs = {};
72495
+ const allowedAttributes = {
72496
+ None: ["behindDoc"],
72497
+ Square: ["wrapText", "distTop", "distBottom", "distLeft", "distRight"],
72498
+ Through: ["distTop", "distBottom", "distLeft", "distRight", "polygon"],
72499
+ Tight: ["distTop", "distBottom", "distLeft", "distRight", "polygon"],
72500
+ TopAndBottom: ["distTop", "distBottom"],
72501
+ Inline: []
72502
+ };
72503
+ const allowedForType = allowedAttributes[type2] || [];
72504
+ Object.keys(attrs).forEach((key2) => {
72505
+ if (allowedForType.includes(key2)) {
72506
+ allowedAttrs[key2] = attrs[key2];
72507
+ }
72508
+ });
72509
+ const updatedAttrs = {
72510
+ ...node.attrs,
72511
+ wrap: {
72512
+ type: type2,
72513
+ attrs: allowedAttrs
72514
+ },
72515
+ isAnchor: type2 !== "Inline"
72516
+ };
72517
+ return chain().updateAttributes(this.name, updatedAttrs).run();
71931
72518
  }
71932
72519
  };
71933
72520
  },
@@ -95276,72 +95863,72 @@ ${style2}
95276
95863
  const SuperInput = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__scopeId", "data-v-4d5cff52"]]);
95277
95864
  const additionalHandlers = Object.freeze({
95278
95865
  "mc:AlternateContent": translator$1,
95279
- "sd:pageReference": translator$3,
95280
- "sd:tableOfContents": translator$2,
95281
- "w:b": translator$16,
95282
- "w:bidiVisual": translator$H,
95283
- "w:bookmarkEnd": translator$4,
95284
- "w:bookmarkStart": translator$5,
95285
- "w:bottom": translator$u,
95286
- "w:br": translator$1a,
95287
- "w:cantSplit": translator$V,
95288
- "w:cnfStyle": translator$U,
95289
- "w:color": translator$12,
95290
- "w:divId": translator$T,
95291
- "w:drawing": translator$7,
95292
- "w:end": translator$s,
95293
- "w:gridAfter": translator$S,
95294
- "w:gridBefore": translator$R,
95295
- "w:gridCol": translator$d,
95296
- "w:hidden": translator$Q,
95297
- "w:highlight": translator$19,
95298
- "w:hyperlink": translator$X,
95299
- "w:i": translator$15,
95300
- "w:insideH": translator$q,
95301
- "w:insideV": translator$p,
95302
- "w:jc": translator$P,
95303
- "w:left": translator$o,
95304
- "w:p": translator$17,
95305
- "w:r": translator$W,
95306
- "w:rFonts": translator$11,
95307
- "w:rPr": translator$Y,
95308
- "w:rStyle": translator$10,
95309
- "w:right": translator$m,
95310
- "w:sdt": translator$6,
95311
- "w:shd": translator$G,
95312
- "w:start": translator$k,
95313
- "w:strike": translator$13,
95314
- "w:sz": translator$$,
95315
- "w:szCs": translator$_,
95316
- "w:tab": translator$18,
95317
- "w:tbl": translator$b,
95318
- "w:tblBorders": translator$g,
95319
- "w:tblCaption": translator$F,
95320
- "w:tblCellMar": translator$f,
95321
- "w:tblCellSpacing": translator$O,
95322
- "w:tblDescription": translator$E,
95323
- "w:tblGrid": translator$c,
95324
- "w:tblHeader": translator$N,
95325
- "w:tblInd": translator$D,
95326
- "w:tblLayout": translator$C,
95327
- "w:tblLook": translator$B,
95328
- "w:tblOverlap": translator$A,
95329
- "w:tblPr": translator$e,
95330
- "w:tblStyle": translator$z,
95331
- "w:tblStyleColBandSize": translator$y,
95332
- "w:tblStyleRowBandSize": translator$x,
95333
- "w:tblW": translator$w,
95334
- "w:tblpPr": translator$v,
95335
- "w:tc": translator$a,
95336
- "w:top": translator$i,
95337
- "w:tr": translator$I,
95338
- "w:trHeight": translator$M,
95339
- "w:trPr": translator$J,
95340
- "w:u": translator$14,
95341
- "w:wAfter": translator$L,
95342
- "w:wBefore": translator$K,
95343
- "wp:anchor": translator$9,
95344
- "wp:inline": translator$8,
95866
+ "sd:pageReference": translator$5,
95867
+ "sd:tableOfContents": translator$4,
95868
+ "w:b": translator$18,
95869
+ "w:bidiVisual": translator$J,
95870
+ "w:bookmarkEnd": translator$6,
95871
+ "w:bookmarkStart": translator$7,
95872
+ "w:bottom": translator$w,
95873
+ "w:br": translator$1c,
95874
+ "w:cantSplit": translator$X,
95875
+ "w:cnfStyle": translator$W,
95876
+ "w:color": translator$14,
95877
+ "w:divId": translator$V,
95878
+ "w:drawing": translator$9,
95879
+ "w:end": translator$u,
95880
+ "w:gridAfter": translator$U,
95881
+ "w:gridBefore": translator$T,
95882
+ "w:gridCol": translator$f,
95883
+ "w:hidden": translator$S,
95884
+ "w:highlight": translator$1b,
95885
+ "w:hyperlink": translator$Z,
95886
+ "w:i": translator$17,
95887
+ "w:insideH": translator$s,
95888
+ "w:insideV": translator$r,
95889
+ "w:jc": translator$R,
95890
+ "w:left": translator$q,
95891
+ "w:p": translator$19,
95892
+ "w:r": translator$Y,
95893
+ "w:rFonts": translator$13,
95894
+ "w:rPr": translator$_,
95895
+ "w:rStyle": translator$12,
95896
+ "w:right": translator$o,
95897
+ "w:sdt": translator$8,
95898
+ "w:shd": translator$I,
95899
+ "w:start": translator$m,
95900
+ "w:strike": translator$15,
95901
+ "w:sz": translator$11,
95902
+ "w:szCs": translator$10,
95903
+ "w:tab": translator$1a,
95904
+ "w:tbl": translator$d,
95905
+ "w:tblBorders": translator$i,
95906
+ "w:tblCaption": translator$H,
95907
+ "w:tblCellMar": translator$h,
95908
+ "w:tblCellSpacing": translator$Q,
95909
+ "w:tblDescription": translator$G,
95910
+ "w:tblGrid": translator$e,
95911
+ "w:tblHeader": translator$P,
95912
+ "w:tblInd": translator$F,
95913
+ "w:tblLayout": translator$E,
95914
+ "w:tblLook": translator$D,
95915
+ "w:tblOverlap": translator$C,
95916
+ "w:tblPr": translator$g,
95917
+ "w:tblStyle": translator$B,
95918
+ "w:tblStyleColBandSize": translator$A,
95919
+ "w:tblStyleRowBandSize": translator$z,
95920
+ "w:tblW": translator$y,
95921
+ "w:tblpPr": translator$x,
95922
+ "w:tc": translator$c,
95923
+ "w:top": translator$k,
95924
+ "w:tr": translator$K,
95925
+ "w:trHeight": translator$O,
95926
+ "w:trPr": translator$L,
95927
+ "w:u": translator$16,
95928
+ "w:wAfter": translator$N,
95929
+ "w:wBefore": translator$M,
95930
+ "wp:anchor": translator$b,
95931
+ "wp:inline": translator$a,
95345
95932
  "w:commentRangeStart": commentRangeStartTranslator,
95346
95933
  "w:commentRangeEnd": commentRangeEndTranslator
95347
95934
  });