@harbour-enterprises/superdoc 0.21.0-next.7 → 0.21.0

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 (41) hide show
  1. package/dist/chunks/{PdfViewer-B8R1j6LP.es.js → PdfViewer-D3zo7tPo.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-DWWRw_re.cjs → PdfViewer-OZDJ7gwT.cjs} +1 -1
  3. package/dist/chunks/{index-Bpp8Ruyf.cjs → index-CfYf4T_z.cjs} +3 -4
  4. package/dist/chunks/{index-CLGEbkfW.es.js → index-MzW5BVNd.es.js} +3 -4
  5. package/dist/chunks/{super-editor.es-DWm41myg.es.js → super-editor.es-Bntob7Wd.es.js} +761 -1155
  6. package/dist/chunks/{super-editor.es-aBw27Tag.cjs → super-editor.es-U-GVCd_F.cjs} +761 -1155
  7. package/dist/core/types/index.d.ts +0 -8
  8. package/dist/core/types/index.d.ts.map +1 -1
  9. package/dist/style.css +27 -32
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-DYAHhSrg.js → converter-3xnF_NHq.js} +643 -773
  12. package/dist/super-editor/chunks/{docx-zipper-BDbCmfbE.js → docx-zipper-CZdELYi-.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-VW8eKYoK.js → editor-BqYH4kDD.js} +2 -4
  14. package/dist/super-editor/chunks/{toolbar-B1up5fYV.js → toolbar-TkaE2kKM.js} +2 -2
  15. package/dist/super-editor/converter.es.js +1 -1
  16. package/dist/super-editor/docx-zipper.es.js +2 -2
  17. package/dist/super-editor/editor.es.js +3 -3
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/src/components/slash-menu/menuItems.d.ts +1 -5
  20. package/dist/super-editor/src/components/slash-menu/utils.d.ts +2 -9
  21. package/dist/super-editor/src/extensions/run-item/index.d.ts +1 -0
  22. package/dist/super-editor/src/extensions/run-item/run-item.d.ts +26 -0
  23. package/dist/super-editor/src/tests/helpers/helpers.d.ts +0 -1
  24. package/dist/super-editor/style.css +0 -5
  25. package/dist/super-editor/super-editor.es.js +151 -452
  26. package/dist/super-editor/toolbar.es.js +2 -2
  27. package/dist/super-editor.cjs +1 -1
  28. package/dist/super-editor.es.js +1 -1
  29. package/dist/superdoc.cjs +2 -2
  30. package/dist/superdoc.es.js +2 -2
  31. package/dist/superdoc.umd.js +762 -1157
  32. package/dist/superdoc.umd.js.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/super-editor/src/components/slash-menu/tests/testHelpers.d.ts +0 -466
  35. package/dist/super-editor/src/core/commands/__tests__/schemaWithLists.d.ts +0 -2
  36. package/dist/super-editor/src/core/commands/__tests__/testHelpers.d.ts +0 -4
  37. package/dist/super-editor/src/core/commands/__tests__/testSchema.d.ts +0 -2
  38. package/dist/super-editor/src/core/commands/tests/commandTestUtils.d.ts +0 -7
  39. package/dist/super-editor/src/core/commands/tests/test-schema.d.ts +0 -2
  40. package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/alternate-content-translator.d.ts +0 -6
  41. package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/index.d.ts +0 -1
@@ -24323,37 +24323,37 @@ const _NodeTranslator = class _NodeTranslator {
24323
24323
  /** @type {typeof TranslatorTypes} */
24324
24324
  __publicField(_NodeTranslator, "translatorTypes", TranslatorTypes);
24325
24325
  let NodeTranslator = _NodeTranslator;
24326
- const encode$18 = (attributes) => {
24326
+ const encode$17 = (attributes) => {
24327
24327
  return attributes["w:type"];
24328
24328
  };
24329
- const decode$$ = (attrs) => {
24329
+ const decode$_ = (attrs) => {
24330
24330
  const { lineBreakType } = attrs;
24331
24331
  return lineBreakType;
24332
24332
  };
24333
24333
  const attrConfig$F = Object.freeze({
24334
24334
  xmlName: "w:type",
24335
24335
  sdName: "lineBreakType",
24336
- encode: encode$18,
24337
- decode: decode$$
24336
+ encode: encode$17,
24337
+ decode: decode$_
24338
24338
  });
24339
- const encode$17 = (attributes) => {
24339
+ const encode$16 = (attributes) => {
24340
24340
  const xmlAttrValue = attributes["w:clear"];
24341
24341
  return xmlAttrValue;
24342
24342
  };
24343
- const decode$_ = (attrs) => {
24343
+ const decode$Z = (attrs) => {
24344
24344
  const { clear } = attrs;
24345
24345
  return clear;
24346
24346
  };
24347
24347
  const attrConfig$E = Object.freeze({
24348
24348
  xmlName: "w:clear",
24349
24349
  sdName: "clear",
24350
- encode: encode$17,
24351
- decode: decode$_
24350
+ encode: encode$16,
24351
+ decode: decode$Z
24352
24352
  });
24353
- const validXmlAttributes$m = [attrConfig$F, attrConfig$E];
24354
- const XML_NODE_NAME$u = "w:br";
24355
- const SD_NODE_NAME$d = "lineBreak";
24356
- const encode$16 = (_2, encodedAttrs) => {
24353
+ const validXmlAttributes$l = [attrConfig$F, attrConfig$E];
24354
+ const XML_NODE_NAME$t = "w:br";
24355
+ const SD_NODE_NAME$c = "lineBreak";
24356
+ const encode$15 = (_2, encodedAttrs) => {
24357
24357
  const isPageBreak = encodedAttrs?.lineBreakType === "page";
24358
24358
  const translated = {
24359
24359
  type: isPageBreak ? "hardBreak" : "lineBreak"
@@ -24363,7 +24363,7 @@ const encode$16 = (_2, encodedAttrs) => {
24363
24363
  }
24364
24364
  return translated;
24365
24365
  };
24366
- const decode$Z = (params, decodedAttrs) => {
24366
+ const decode$Y = (params, decodedAttrs) => {
24367
24367
  const { node } = params;
24368
24368
  if (!node) return;
24369
24369
  const wBreak = { name: "w:br" };
@@ -24380,39 +24380,39 @@ const decode$Z = (params, decodedAttrs) => {
24380
24380
  };
24381
24381
  return translated;
24382
24382
  };
24383
- const config$s = {
24384
- xmlName: XML_NODE_NAME$u,
24385
- sdNodeOrKeyName: SD_NODE_NAME$d,
24383
+ const config$r = {
24384
+ xmlName: XML_NODE_NAME$t,
24385
+ sdNodeOrKeyName: SD_NODE_NAME$c,
24386
24386
  type: NodeTranslator.translatorTypes.NODE,
24387
- encode: encode$16,
24388
- decode: decode$Z,
24389
- attributes: validXmlAttributes$m
24387
+ encode: encode$15,
24388
+ decode: decode$Y,
24389
+ attributes: validXmlAttributes$l
24390
24390
  };
24391
- const translator$16 = NodeTranslator.from(config$s);
24392
- const encode$15 = (attributes) => attributes?.["w:val"];
24393
- const decode$Y = (attrs) => attrs?.highlight;
24391
+ const translator$15 = NodeTranslator.from(config$r);
24392
+ const encode$14 = (attributes) => attributes?.["w:val"];
24393
+ const decode$X = (attrs) => attrs?.highlight;
24394
24394
  const attrConfig$D = Object.freeze({
24395
24395
  xmlName: "w:val",
24396
24396
  sdName: "highlight",
24397
- encode: encode$15,
24398
- decode: decode$Y
24397
+ encode: encode$14,
24398
+ decode: decode$X
24399
24399
  });
24400
- const validXmlAttributes$l = [attrConfig$D];
24401
- const XML_NODE_NAME$t = "w:highlight";
24400
+ const validXmlAttributes$k = [attrConfig$D];
24401
+ const XML_NODE_NAME$s = "w:highlight";
24402
24402
  const SD_ATTR_KEY$f = "highlight";
24403
24403
  const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
24404
- const encode$14 = (params, encodedAttrs = {}) => {
24404
+ const encode$13 = (params, encodedAttrs = {}) => {
24405
24405
  const { nodes } = params;
24406
24406
  const node = nodes?.[0];
24407
24407
  const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
24408
24408
  return {
24409
24409
  type: "attr",
24410
- xmlName: XML_NODE_NAME$t,
24410
+ xmlName: XML_NODE_NAME$s,
24411
24411
  sdNodeOrKeyName: SD_ATTR_KEY$f,
24412
24412
  attributes: { "w:val": value ?? null }
24413
24413
  };
24414
24414
  };
24415
- const decode$X = (params) => {
24415
+ const decode$W = (params) => {
24416
24416
  const attrs = params?.node?.attrs || {};
24417
24417
  const highlightValue = attrs.highlight ?? attrs.color ?? null;
24418
24418
  if (!highlightValue) return void 0;
@@ -24420,14 +24420,14 @@ const decode$X = (params) => {
24420
24420
  if (!normalizedValue) return void 0;
24421
24421
  if (DISABLED_TOKENS.has(normalizedValue)) {
24422
24422
  return {
24423
- name: XML_NODE_NAME$t,
24423
+ name: XML_NODE_NAME$s,
24424
24424
  attributes: { "w:val": "none" }
24425
24425
  };
24426
24426
  }
24427
24427
  const keyword = getDocxHighlightKeywordFromHex(highlightValue);
24428
24428
  if (keyword) {
24429
24429
  return {
24430
- name: XML_NODE_NAME$t,
24430
+ name: XML_NODE_NAME$s,
24431
24431
  attributes: { "w:val": keyword }
24432
24432
  };
24433
24433
  }
@@ -24442,63 +24442,63 @@ const decode$X = (params) => {
24442
24442
  }
24443
24443
  };
24444
24444
  };
24445
- const config$r = {
24446
- xmlName: XML_NODE_NAME$t,
24445
+ const config$q = {
24446
+ xmlName: XML_NODE_NAME$s,
24447
24447
  sdNodeOrKeyName: SD_ATTR_KEY$f,
24448
24448
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
24449
- encode: encode$14,
24450
- decode: decode$X,
24451
- attributes: validXmlAttributes$l
24449
+ encode: encode$13,
24450
+ decode: decode$W,
24451
+ attributes: validXmlAttributes$k
24452
24452
  };
24453
- const translator$15 = NodeTranslator.from(config$r);
24454
- const encode$13 = (attributes) => {
24453
+ const translator$14 = NodeTranslator.from(config$q);
24454
+ const encode$12 = (attributes) => {
24455
24455
  return attributes["w:val"];
24456
24456
  };
24457
- const decode$W = (attrs) => {
24457
+ const decode$V = (attrs) => {
24458
24458
  const { tabSize } = attrs || {};
24459
24459
  return tabSize;
24460
24460
  };
24461
24461
  const attrConfig$C = Object.freeze({
24462
24462
  xmlName: "w:val",
24463
24463
  sdName: "tabSize",
24464
- encode: encode$13,
24465
- decode: decode$W
24464
+ encode: encode$12,
24465
+ decode: decode$V
24466
24466
  });
24467
- const encode$12 = (attributes) => {
24467
+ const encode$11 = (attributes) => {
24468
24468
  return attributes["w:leader"];
24469
24469
  };
24470
- const decode$V = (attrs) => {
24470
+ const decode$U = (attrs) => {
24471
24471
  const { leader } = attrs || {};
24472
24472
  return leader;
24473
24473
  };
24474
24474
  const attrConfig$B = Object.freeze({
24475
24475
  xmlName: "w:leader",
24476
24476
  sdName: "leader",
24477
- encode: encode$12,
24478
- decode: decode$V
24477
+ encode: encode$11,
24478
+ decode: decode$U
24479
24479
  });
24480
- const encode$11 = (attributes) => {
24480
+ const encode$10 = (attributes) => {
24481
24481
  return attributes["w:pos"];
24482
24482
  };
24483
- const decode$U = (attrs) => {
24483
+ const decode$T = (attrs) => {
24484
24484
  const { pos } = attrs || {};
24485
24485
  return pos;
24486
24486
  };
24487
24487
  const attrConfig$A = Object.freeze({
24488
24488
  xmlName: "w:pos",
24489
24489
  sdName: "pos",
24490
- encode: encode$11,
24491
- decode: decode$U
24490
+ encode: encode$10,
24491
+ decode: decode$T
24492
24492
  });
24493
- const validXmlAttributes$k = [attrConfig$C, attrConfig$A, attrConfig$B];
24494
- const XML_NODE_NAME$s = "w:tab";
24495
- const SD_NODE_NAME$c = "tab";
24496
- const encode$10 = (_2, encodedAttrs = {}) => {
24493
+ const validXmlAttributes$j = [attrConfig$C, attrConfig$A, attrConfig$B];
24494
+ const XML_NODE_NAME$r = "w:tab";
24495
+ const SD_NODE_NAME$b = "tab";
24496
+ const encode$$ = (_2, encodedAttrs = {}) => {
24497
24497
  const translated = { type: "tab" };
24498
24498
  if (encodedAttrs) translated.attrs = { ...encodedAttrs };
24499
24499
  return translated;
24500
24500
  };
24501
- const decode$T = (params, decodedAttrs = {}) => {
24501
+ const decode$S = (params, decodedAttrs = {}) => {
24502
24502
  const { node } = params || {};
24503
24503
  if (!node) return;
24504
24504
  const wTab = { name: "w:tab" };
@@ -24514,15 +24514,15 @@ const decode$T = (params, decodedAttrs = {}) => {
24514
24514
  }
24515
24515
  return translated;
24516
24516
  };
24517
- const config$q = {
24518
- xmlName: XML_NODE_NAME$s,
24519
- sdNodeOrKeyName: SD_NODE_NAME$c,
24517
+ const config$p = {
24518
+ xmlName: XML_NODE_NAME$r,
24519
+ sdNodeOrKeyName: SD_NODE_NAME$b,
24520
24520
  type: NodeTranslator.translatorTypes.NODE,
24521
- encode: encode$10,
24522
- decode: decode$T,
24523
- attributes: validXmlAttributes$k
24521
+ encode: encode$$,
24522
+ decode: decode$S,
24523
+ attributes: validXmlAttributes$j
24524
24524
  };
24525
- const translator$14 = NodeTranslator.from(config$q);
24525
+ const translator$13 = NodeTranslator.from(config$p);
24526
24526
  const mergeTextNodes = (nodes) => {
24527
24527
  if (!nodes || !Array.isArray(nodes)) {
24528
24528
  return nodes;
@@ -25137,91 +25137,91 @@ const handleParagraphNode$1 = (params) => {
25137
25137
  }
25138
25138
  return schemaNode;
25139
25139
  };
25140
- const encode$$ = (attributes) => {
25140
+ const encode$_ = (attributes) => {
25141
25141
  return attributes["w:rsidDel"];
25142
25142
  };
25143
- const decode$S = (attrs) => {
25143
+ const decode$R = (attrs) => {
25144
25144
  return attrs.rsidDel;
25145
25145
  };
25146
25146
  const attrConfig$z = Object.freeze({
25147
25147
  xmlName: "w:rsidDel",
25148
25148
  sdName: "rsidDel",
25149
- encode: encode$$,
25150
- decode: decode$S
25149
+ encode: encode$_,
25150
+ decode: decode$R
25151
25151
  });
25152
- const encode$_ = (attributes) => {
25152
+ const encode$Z = (attributes) => {
25153
25153
  return attributes["w:rsidP"];
25154
25154
  };
25155
- const decode$R = (attrs) => {
25155
+ const decode$Q = (attrs) => {
25156
25156
  return attrs.rsidP;
25157
25157
  };
25158
25158
  const attrConfig$y = Object.freeze({
25159
25159
  xmlName: "w:rsidP",
25160
25160
  sdName: "rsidP",
25161
- encode: encode$_,
25162
- decode: decode$R
25161
+ encode: encode$Z,
25162
+ decode: decode$Q
25163
25163
  });
25164
- const encode$Z = (attributes) => {
25164
+ const encode$Y = (attributes) => {
25165
25165
  return attributes["w:rsidR"];
25166
25166
  };
25167
- const decode$Q = (attrs) => {
25167
+ const decode$P = (attrs) => {
25168
25168
  return attrs.rsidR;
25169
25169
  };
25170
25170
  const attrConfig$x = Object.freeze({
25171
25171
  xmlName: "w:rsidR",
25172
25172
  sdName: "rsidR",
25173
- encode: encode$Z,
25174
- decode: decode$Q
25173
+ encode: encode$Y,
25174
+ decode: decode$P
25175
25175
  });
25176
- const encode$Y = (attributes) => {
25176
+ const encode$X = (attributes) => {
25177
25177
  return attributes["w:rsidRPr"];
25178
25178
  };
25179
- const decode$P = (attrs) => {
25179
+ const decode$O = (attrs) => {
25180
25180
  return attrs.rsidRPr;
25181
25181
  };
25182
25182
  const attrConfig$w = Object.freeze({
25183
25183
  xmlName: "w:rsidRPr",
25184
25184
  sdName: "rsidRPr",
25185
- encode: encode$Y,
25186
- decode: decode$P
25185
+ encode: encode$X,
25186
+ decode: decode$O
25187
25187
  });
25188
- const encode$X = (attributes) => {
25188
+ const encode$W = (attributes) => {
25189
25189
  return attributes["w:rsidRDefault"];
25190
25190
  };
25191
- const decode$O = (attrs) => {
25191
+ const decode$N = (attrs) => {
25192
25192
  return attrs.rsidRDefault;
25193
25193
  };
25194
25194
  const attrConfig$v = Object.freeze({
25195
25195
  xmlName: "w:rsidRDefault",
25196
25196
  sdName: "rsidRDefault",
25197
- encode: encode$X,
25198
- decode: decode$O
25197
+ encode: encode$W,
25198
+ decode: decode$N
25199
25199
  });
25200
- const encode$W = (attributes) => {
25200
+ const encode$V = (attributes) => {
25201
25201
  return attributes["w14:paraId"];
25202
25202
  };
25203
- const decode$N = (attrs) => {
25203
+ const decode$M = (attrs) => {
25204
25204
  return attrs.paraId;
25205
25205
  };
25206
25206
  const attrConfig$u = Object.freeze({
25207
25207
  xmlName: "w14:paraId",
25208
25208
  sdName: "paraId",
25209
- encode: encode$W,
25210
- decode: decode$N
25209
+ encode: encode$V,
25210
+ decode: decode$M
25211
25211
  });
25212
- const encode$V = (attributes) => {
25212
+ const encode$U = (attributes) => {
25213
25213
  return attributes["w14:textId"];
25214
25214
  };
25215
- const decode$M = (attrs) => {
25215
+ const decode$L = (attrs) => {
25216
25216
  return attrs.textId;
25217
25217
  };
25218
25218
  const attrConfig$t = Object.freeze({
25219
25219
  xmlName: "w14:textId",
25220
25220
  sdName: "textId",
25221
- encode: encode$V,
25222
- decode: decode$M
25221
+ encode: encode$U,
25222
+ decode: decode$L
25223
25223
  });
25224
- const validXmlAttributes$j = [
25224
+ const validXmlAttributes$i = [
25225
25225
  attrConfig$u,
25226
25226
  attrConfig$t,
25227
25227
  attrConfig$x,
@@ -25230,9 +25230,9 @@ const validXmlAttributes$j = [
25230
25230
  attrConfig$w,
25231
25231
  attrConfig$z
25232
25232
  ];
25233
- const XML_NODE_NAME$r = "w:p";
25234
- const SD_NODE_NAME$b = "paragraph";
25235
- const encode$U = (params, encodedAttrs = {}) => {
25233
+ const XML_NODE_NAME$q = "w:p";
25234
+ const SD_NODE_NAME$a = "paragraph";
25235
+ const encode$T = (params, encodedAttrs = {}) => {
25236
25236
  const node = handleParagraphNode$1(params);
25237
25237
  if (!node) return void 0;
25238
25238
  if (encodedAttrs && Object.keys(encodedAttrs).length) {
@@ -25240,7 +25240,7 @@ const encode$U = (params, encodedAttrs = {}) => {
25240
25240
  }
25241
25241
  return node;
25242
25242
  };
25243
- const decode$L = (params, decodedAttrs = {}) => {
25243
+ const decode$K = (params, decodedAttrs = {}) => {
25244
25244
  const translated = translateParagraphNode(params);
25245
25245
  if (!translated) return void 0;
25246
25246
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
@@ -25248,16 +25248,16 @@ const decode$L = (params, decodedAttrs = {}) => {
25248
25248
  }
25249
25249
  return translated;
25250
25250
  };
25251
- const config$p = {
25252
- xmlName: XML_NODE_NAME$r,
25253
- sdNodeOrKeyName: SD_NODE_NAME$b,
25251
+ const config$o = {
25252
+ xmlName: XML_NODE_NAME$q,
25253
+ sdNodeOrKeyName: SD_NODE_NAME$a,
25254
25254
  type: NodeTranslator.translatorTypes.NODE,
25255
- encode: encode$U,
25256
- decode: decode$L,
25257
- attributes: validXmlAttributes$j
25255
+ encode: encode$T,
25256
+ decode: decode$K,
25257
+ attributes: validXmlAttributes$i
25258
25258
  };
25259
- const translator$13 = NodeTranslator.from(config$p);
25260
- const encode$T = (attributes) => {
25259
+ const translator$12 = NodeTranslator.from(config$o);
25260
+ const encode$S = (attributes) => {
25261
25261
  const raw = attributes?.["w:val"];
25262
25262
  if (raw === void 0 || raw === null) return void 0;
25263
25263
  if (typeof raw === "boolean") return raw;
@@ -25267,20 +25267,20 @@ const encode$T = (attributes) => {
25267
25267
  if (val === "1" || val === "true" || val === "on") return true;
25268
25268
  return void 0;
25269
25269
  };
25270
- const decode$K = (runProps) => {
25270
+ const decode$J = (runProps) => {
25271
25271
  if (runProps?.bold === false) return "0";
25272
25272
  return void 0;
25273
25273
  };
25274
25274
  const attrConfig$s = Object.freeze({
25275
25275
  xmlName: "w:val",
25276
25276
  sdName: "bold",
25277
- encode: encode$T,
25278
- decode: decode$K
25277
+ encode: encode$S,
25278
+ decode: decode$J
25279
25279
  });
25280
- const validXmlAttributes$i = [attrConfig$s];
25281
- const XML_NODE_NAME$q = "w:b";
25280
+ const validXmlAttributes$h = [attrConfig$s];
25281
+ const XML_NODE_NAME$p = "w:b";
25282
25282
  const SD_ATTR_KEY$e = "bold";
25283
- const encode$S = (params, encodedAttrs = {}) => {
25283
+ const encode$R = (params, encodedAttrs = {}) => {
25284
25284
  const { nodes } = params;
25285
25285
  const node = nodes[0];
25286
25286
  if (!node) return void 0;
@@ -25292,85 +25292,85 @@ const encode$S = (params, encodedAttrs = {}) => {
25292
25292
  else attributes = node.attributes || {};
25293
25293
  return {
25294
25294
  type: "attr",
25295
- xmlName: XML_NODE_NAME$q,
25295
+ xmlName: XML_NODE_NAME$p,
25296
25296
  sdNodeOrKeyName: SD_ATTR_KEY$e,
25297
25297
  attributes
25298
25298
  };
25299
25299
  };
25300
- const config$o = {
25301
- xmlName: XML_NODE_NAME$q,
25300
+ const config$n = {
25301
+ xmlName: XML_NODE_NAME$p,
25302
25302
  sdNodeOrKeyName: SD_ATTR_KEY$e,
25303
25303
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25304
- encode: encode$S,
25305
- attributes: validXmlAttributes$i
25304
+ encode: encode$R,
25305
+ attributes: validXmlAttributes$h
25306
25306
  };
25307
- const translator$12 = NodeTranslator.from(config$o);
25308
- const XML_NODE_NAME$p = "w:i";
25307
+ const translator$11 = NodeTranslator.from(config$n);
25308
+ const XML_NODE_NAME$o = "w:i";
25309
25309
  const SD_ATTR_KEY$d = "italic";
25310
- const encode$R = (params) => {
25310
+ const encode$Q = (params) => {
25311
25311
  const { nodes } = params;
25312
25312
  const node = nodes?.[0];
25313
25313
  if (!node) return void 0;
25314
25314
  return {
25315
25315
  type: "attr",
25316
- xmlName: XML_NODE_NAME$p,
25316
+ xmlName: XML_NODE_NAME$o,
25317
25317
  sdNodeOrKeyName: SD_ATTR_KEY$d,
25318
25318
  attributes: {
25319
25319
  "w:val": node.attributes?.["w:val"] ?? null
25320
25320
  }
25321
25321
  };
25322
25322
  };
25323
- const config$n = {
25324
- xmlName: XML_NODE_NAME$p,
25323
+ const config$m = {
25324
+ xmlName: XML_NODE_NAME$o,
25325
25325
  sdNodeOrKeyName: SD_ATTR_KEY$d,
25326
25326
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25327
- encode: encode$R
25327
+ encode: encode$Q
25328
25328
  };
25329
- const translator$11 = NodeTranslator.from(config$n);
25330
- const encode$Q = (attributes) => attributes?.["w:val"];
25331
- const decode$J = (attrs) => attrs?.underline;
25329
+ const translator$10 = NodeTranslator.from(config$m);
25330
+ const encode$P = (attributes) => attributes?.["w:val"];
25331
+ const decode$I = (attrs) => attrs?.underline;
25332
25332
  const attrConfig$r = Object.freeze({
25333
25333
  xmlName: "w:val",
25334
25334
  sdName: "underline",
25335
- encode: encode$Q,
25336
- decode: decode$J
25335
+ encode: encode$P,
25336
+ decode: decode$I
25337
25337
  });
25338
- const encode$P = (attributes) => attributes?.["w:color"];
25339
- const decode$I = (attrs) => attrs?.color;
25338
+ const encode$O = (attributes) => attributes?.["w:color"];
25339
+ const decode$H = (attrs) => attrs?.color;
25340
25340
  const attrConfig$q = Object.freeze({
25341
25341
  xmlName: "w:color",
25342
25342
  sdName: "color",
25343
- encode: encode$P,
25344
- decode: decode$I
25343
+ encode: encode$O,
25344
+ decode: decode$H
25345
25345
  });
25346
- const encode$O = (attributes) => attributes?.["w:themeColor"];
25347
- const decode$H = (attrs) => attrs?.themeColor;
25346
+ const encode$N = (attributes) => attributes?.["w:themeColor"];
25347
+ const decode$G = (attrs) => attrs?.themeColor;
25348
25348
  const attrConfig$p = Object.freeze({
25349
25349
  xmlName: "w:themeColor",
25350
25350
  sdName: "themeColor",
25351
- encode: encode$O,
25352
- decode: decode$H
25351
+ encode: encode$N,
25352
+ decode: decode$G
25353
25353
  });
25354
- const encode$N = (attributes) => attributes?.["w:themeTint"];
25355
- const decode$G = (attrs) => attrs?.themeTint;
25354
+ const encode$M = (attributes) => attributes?.["w:themeTint"];
25355
+ const decode$F = (attrs) => attrs?.themeTint;
25356
25356
  const attrConfig$o = Object.freeze({
25357
25357
  xmlName: "w:themeTint",
25358
25358
  sdName: "themeTint",
25359
- encode: encode$N,
25360
- decode: decode$G
25359
+ encode: encode$M,
25360
+ decode: decode$F
25361
25361
  });
25362
- const encode$M = (attributes) => attributes?.["w:themeShade"];
25363
- const decode$F = (attrs) => attrs?.themeShade;
25362
+ const encode$L = (attributes) => attributes?.["w:themeShade"];
25363
+ const decode$E = (attrs) => attrs?.themeShade;
25364
25364
  const attrConfig$n = Object.freeze({
25365
25365
  xmlName: "w:themeShade",
25366
25366
  sdName: "themeShade",
25367
- encode: encode$M,
25368
- decode: decode$F
25367
+ encode: encode$L,
25368
+ decode: decode$E
25369
25369
  });
25370
- const validXmlAttributes$h = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
25371
- const XML_NODE_NAME$o = "w:u";
25370
+ const validXmlAttributes$g = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
25371
+ const XML_NODE_NAME$n = "w:u";
25372
25372
  const SD_ATTR_KEY$c = "underline";
25373
- const encode$L = (params, encodedAttrs = {}) => {
25373
+ const encode$K = (params, encodedAttrs = {}) => {
25374
25374
  const { nodes } = params;
25375
25375
  const node = nodes?.[0];
25376
25376
  const sourceAttrs = node?.attributes || {};
@@ -25386,12 +25386,12 @@ const encode$L = (params, encodedAttrs = {}) => {
25386
25386
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
25387
25387
  return {
25388
25388
  type: "attr",
25389
- xmlName: XML_NODE_NAME$o,
25389
+ xmlName: XML_NODE_NAME$n,
25390
25390
  sdNodeOrKeyName: SD_ATTR_KEY$c,
25391
25391
  attributes
25392
25392
  };
25393
25393
  };
25394
- const decode$E = (params) => {
25394
+ const decode$D = (params) => {
25395
25395
  const attrs = params?.node?.attrs || {};
25396
25396
  const underlineType = attrs.underlineType ?? attrs.underline ?? null;
25397
25397
  const color = attrs.underlineColor ?? attrs.color ?? null;
@@ -25409,20 +25409,20 @@ const decode$E = (params) => {
25409
25409
  if (themeTint) attributes["w:themeTint"] = themeTint;
25410
25410
  if (themeShade) attributes["w:themeShade"] = themeShade;
25411
25411
  return {
25412
- name: XML_NODE_NAME$o,
25412
+ name: XML_NODE_NAME$n,
25413
25413
  attributes
25414
25414
  };
25415
25415
  };
25416
- const config$m = {
25417
- xmlName: XML_NODE_NAME$o,
25416
+ const config$l = {
25417
+ xmlName: XML_NODE_NAME$n,
25418
25418
  sdNodeOrKeyName: SD_ATTR_KEY$c,
25419
25419
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25420
- encode: encode$L,
25421
- decode: decode$E,
25422
- attributes: validXmlAttributes$h
25420
+ encode: encode$K,
25421
+ decode: decode$D,
25422
+ attributes: validXmlAttributes$g
25423
25423
  };
25424
- const translator$10 = NodeTranslator.from(config$m);
25425
- const encode$K = (attributes) => {
25424
+ const translator$$ = NodeTranslator.from(config$l);
25425
+ const encode$J = (attributes) => {
25426
25426
  const raw = attributes?.["w:val"];
25427
25427
  if (raw === void 0 || raw === null) return void 0;
25428
25428
  if (typeof raw === "boolean") return raw;
@@ -25432,20 +25432,20 @@ const encode$K = (attributes) => {
25432
25432
  if (val === "1" || val === "true" || val === "on") return true;
25433
25433
  return void 0;
25434
25434
  };
25435
- const decode$D = (attrs) => {
25435
+ const decode$C = (attrs) => {
25436
25436
  if (attrs?.strike === false) return "0";
25437
25437
  return void 0;
25438
25438
  };
25439
25439
  const attrConfig$m = Object.freeze({
25440
25440
  xmlName: "w:val",
25441
25441
  sdName: "strike",
25442
- encode: encode$K,
25443
- decode: decode$D
25442
+ encode: encode$J,
25443
+ decode: decode$C
25444
25444
  });
25445
- const validXmlAttributes$g = [attrConfig$m];
25446
- const XML_NODE_NAME$n = "w:strike";
25445
+ const validXmlAttributes$f = [attrConfig$m];
25446
+ const XML_NODE_NAME$m = "w:strike";
25447
25447
  const SD_ATTR_KEY$b = "strike";
25448
- const encode$J = (params, encodedAttrs = {}) => {
25448
+ const encode$I = (params, encodedAttrs = {}) => {
25449
25449
  const { nodes } = params;
25450
25450
  const node = nodes?.[0];
25451
25451
  if (!node) return void 0;
@@ -25458,55 +25458,55 @@ const encode$J = (params, encodedAttrs = {}) => {
25458
25458
  else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
25459
25459
  return {
25460
25460
  type: "attr",
25461
- xmlName: XML_NODE_NAME$n,
25461
+ xmlName: XML_NODE_NAME$m,
25462
25462
  sdNodeOrKeyName: SD_ATTR_KEY$b,
25463
25463
  attributes
25464
25464
  };
25465
25465
  };
25466
- const config$l = {
25467
- xmlName: XML_NODE_NAME$n,
25466
+ const config$k = {
25467
+ xmlName: XML_NODE_NAME$m,
25468
25468
  sdNodeOrKeyName: SD_ATTR_KEY$b,
25469
25469
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25470
- encode: encode$J,
25471
- attributes: validXmlAttributes$g
25470
+ encode: encode$I,
25471
+ attributes: validXmlAttributes$f
25472
25472
  };
25473
- const translator$$ = NodeTranslator.from(config$l);
25474
- const encode$I = (attributes) => attributes?.["w:val"];
25475
- const decode$C = (attrs) => attrs?.color;
25473
+ const translator$_ = NodeTranslator.from(config$k);
25474
+ const encode$H = (attributes) => attributes?.["w:val"];
25475
+ const decode$B = (attrs) => attrs?.color;
25476
25476
  const attrConfig$l = Object.freeze({
25477
25477
  xmlName: "w:val",
25478
25478
  sdName: "color",
25479
- encode: encode$I,
25480
- decode: decode$C
25479
+ encode: encode$H,
25480
+ decode: decode$B
25481
25481
  });
25482
- const encode$H = (attributes) => attributes?.["w:themeColor"];
25483
- const decode$B = (attrs) => attrs?.themeColor;
25482
+ const encode$G = (attributes) => attributes?.["w:themeColor"];
25483
+ const decode$A = (attrs) => attrs?.themeColor;
25484
25484
  const attrConfig$k = Object.freeze({
25485
25485
  xmlName: "w:themeColor",
25486
25486
  sdName: "themeColor",
25487
- encode: encode$H,
25488
- decode: decode$B
25487
+ encode: encode$G,
25488
+ decode: decode$A
25489
25489
  });
25490
- const encode$G = (attributes) => attributes?.["w:themeTint"];
25491
- const decode$A = (attrs) => attrs?.themeTint;
25490
+ const encode$F = (attributes) => attributes?.["w:themeTint"];
25491
+ const decode$z = (attrs) => attrs?.themeTint;
25492
25492
  const attrConfig$j = Object.freeze({
25493
25493
  xmlName: "w:themeTint",
25494
25494
  sdName: "themeTint",
25495
- encode: encode$G,
25496
- decode: decode$A
25495
+ encode: encode$F,
25496
+ decode: decode$z
25497
25497
  });
25498
- const encode$F = (attributes) => attributes?.["w:themeShade"];
25499
- const decode$z = (attrs) => attrs?.themeShade;
25498
+ const encode$E = (attributes) => attributes?.["w:themeShade"];
25499
+ const decode$y = (attrs) => attrs?.themeShade;
25500
25500
  const attrConfig$i = Object.freeze({
25501
25501
  xmlName: "w:themeShade",
25502
25502
  sdName: "themeShade",
25503
- encode: encode$F,
25504
- decode: decode$z
25503
+ encode: encode$E,
25504
+ decode: decode$y
25505
25505
  });
25506
- const validXmlAttributes$f = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
25507
- const XML_NODE_NAME$m = "w:color";
25506
+ const validXmlAttributes$e = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
25507
+ const XML_NODE_NAME$l = "w:color";
25508
25508
  const SD_ATTR_KEY$a = "color";
25509
- const encode$E = (params, encodedAttrs = {}) => {
25509
+ const encode$D = (params, encodedAttrs = {}) => {
25510
25510
  const { nodes } = params;
25511
25511
  const node = nodes?.[0];
25512
25512
  const sourceAttrs = node?.attributes || {};
@@ -25521,63 +25521,63 @@ const encode$E = (params, encodedAttrs = {}) => {
25521
25521
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
25522
25522
  return {
25523
25523
  type: "attr",
25524
- xmlName: XML_NODE_NAME$m,
25524
+ xmlName: XML_NODE_NAME$l,
25525
25525
  sdNodeOrKeyName: SD_ATTR_KEY$a,
25526
25526
  attributes
25527
25527
  };
25528
25528
  };
25529
- const config$k = {
25530
- xmlName: XML_NODE_NAME$m,
25529
+ const config$j = {
25530
+ xmlName: XML_NODE_NAME$l,
25531
25531
  sdNodeOrKeyName: SD_ATTR_KEY$a,
25532
25532
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25533
- encode: encode$E,
25534
- attributes: validXmlAttributes$f
25533
+ encode: encode$D,
25534
+ attributes: validXmlAttributes$e
25535
25535
  };
25536
- const translator$_ = NodeTranslator.from(config$k);
25537
- const encode$D = (attributes) => attributes?.["w:eastAsia"];
25538
- const decode$y = (attrs) => attrs?.eastAsia;
25536
+ const translator$Z = NodeTranslator.from(config$j);
25537
+ const encode$C = (attributes) => attributes?.["w:eastAsia"];
25538
+ const decode$x = (attrs) => attrs?.eastAsia;
25539
25539
  const attrConfig$h = Object.freeze({
25540
25540
  xmlName: "w:eastAsia",
25541
25541
  sdName: "eastAsia",
25542
- encode: encode$D,
25543
- decode: decode$y
25542
+ encode: encode$C,
25543
+ decode: decode$x
25544
25544
  });
25545
- const encode$C = (attributes) => attributes?.["w:ascii"];
25546
- const decode$x = (attrs) => attrs?.ascii;
25545
+ const encode$B = (attributes) => attributes?.["w:ascii"];
25546
+ const decode$w = (attrs) => attrs?.ascii;
25547
25547
  const attrConfig$g = Object.freeze({
25548
25548
  xmlName: "w:ascii",
25549
25549
  sdName: "ascii",
25550
- encode: encode$C,
25551
- decode: decode$x
25550
+ encode: encode$B,
25551
+ decode: decode$w
25552
25552
  });
25553
- const encode$B = (attributes) => attributes?.["w:hAnsi"];
25554
- const decode$w = (attrs) => attrs?.hAnsi;
25553
+ const encode$A = (attributes) => attributes?.["w:hAnsi"];
25554
+ const decode$v = (attrs) => attrs?.hAnsi;
25555
25555
  const attrConfig$f = Object.freeze({
25556
25556
  xmlName: "w:hAnsi",
25557
25557
  sdName: "hAnsi",
25558
- encode: encode$B,
25559
- decode: decode$w
25558
+ encode: encode$A,
25559
+ decode: decode$v
25560
25560
  });
25561
- const encode$A = (attributes) => attributes?.["w:cs"];
25562
- const decode$v = (attrs) => attrs?.cs;
25561
+ const encode$z = (attributes) => attributes?.["w:cs"];
25562
+ const decode$u = (attrs) => attrs?.cs;
25563
25563
  const attrConfig$e = Object.freeze({
25564
25564
  xmlName: "w:cs",
25565
25565
  sdName: "cs",
25566
- encode: encode$A,
25567
- decode: decode$v
25566
+ encode: encode$z,
25567
+ decode: decode$u
25568
25568
  });
25569
- const encode$z = (attributes) => attributes?.["w:val"];
25570
- const decode$u = (attrs) => attrs?.value;
25569
+ const encode$y = (attributes) => attributes?.["w:val"];
25570
+ const decode$t = (attrs) => attrs?.value;
25571
25571
  const attrConfig$d = Object.freeze({
25572
25572
  xmlName: "w:val",
25573
25573
  sdName: "value",
25574
- encode: encode$z,
25575
- decode: decode$u
25574
+ encode: encode$y,
25575
+ decode: decode$t
25576
25576
  });
25577
- const validXmlAttributes$e = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
25578
- const XML_NODE_NAME$l = "w:rFonts";
25577
+ const validXmlAttributes$d = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
25578
+ const XML_NODE_NAME$k = "w:rFonts";
25579
25579
  const SD_ATTR_KEY$9 = "fontFamily";
25580
- const encode$y = (params, encodedAttrs = {}) => {
25580
+ const encode$x = (params, encodedAttrs = {}) => {
25581
25581
  const { nodes } = params;
25582
25582
  const node = nodes?.[0];
25583
25583
  const sourceAttrs = node?.attributes || {};
@@ -25603,120 +25603,120 @@ const encode$y = (params, encodedAttrs = {}) => {
25603
25603
  if (attributes["w:val"] === void 0) delete attributes["w:val"];
25604
25604
  return {
25605
25605
  type: "attr",
25606
- xmlName: XML_NODE_NAME$l,
25606
+ xmlName: XML_NODE_NAME$k,
25607
25607
  sdNodeOrKeyName: SD_ATTR_KEY$9,
25608
25608
  attributes
25609
25609
  };
25610
25610
  };
25611
- const config$j = {
25612
- xmlName: XML_NODE_NAME$l,
25611
+ const config$i = {
25612
+ xmlName: XML_NODE_NAME$k,
25613
25613
  sdNodeOrKeyName: SD_ATTR_KEY$9,
25614
25614
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25615
- encode: encode$y,
25616
- attributes: validXmlAttributes$e
25615
+ encode: encode$x,
25616
+ attributes: validXmlAttributes$d
25617
25617
  };
25618
- const translator$Z = NodeTranslator.from(config$j);
25619
- const encode$x = (attributes) => attributes?.["w:val"];
25620
- const decode$t = (attrs) => attrs?.styleId;
25618
+ const translator$Y = NodeTranslator.from(config$i);
25619
+ const encode$w = (attributes) => attributes?.["w:val"];
25620
+ const decode$s = (attrs) => attrs?.styleId;
25621
25621
  const attrConfig$c = Object.freeze({
25622
25622
  xmlName: "w:val",
25623
25623
  sdName: "styleId",
25624
- encode: encode$x,
25625
- decode: decode$t
25624
+ encode: encode$w,
25625
+ decode: decode$s
25626
25626
  });
25627
- const validXmlAttributes$d = [attrConfig$c];
25628
- const XML_NODE_NAME$k = "w:rStyle";
25627
+ const validXmlAttributes$c = [attrConfig$c];
25628
+ const XML_NODE_NAME$j = "w:rStyle";
25629
25629
  const SD_ATTR_KEY$8 = "styleId";
25630
- const encode$w = (params, encodedAttrs = {}) => {
25630
+ const encode$v = (params, encodedAttrs = {}) => {
25631
25631
  const { nodes } = params;
25632
25632
  const node = nodes?.[0];
25633
25633
  const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
25634
25634
  return {
25635
25635
  type: "attr",
25636
- xmlName: XML_NODE_NAME$k,
25636
+ xmlName: XML_NODE_NAME$j,
25637
25637
  sdNodeOrKeyName: SD_ATTR_KEY$8,
25638
25638
  attributes: { "w:val": value ?? null }
25639
25639
  };
25640
25640
  };
25641
- const config$i = {
25642
- xmlName: XML_NODE_NAME$k,
25641
+ const config$h = {
25642
+ xmlName: XML_NODE_NAME$j,
25643
25643
  sdNodeOrKeyName: SD_ATTR_KEY$8,
25644
25644
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25645
- encode: encode$w,
25646
- attributes: validXmlAttributes$d
25645
+ encode: encode$v,
25646
+ attributes: validXmlAttributes$c
25647
25647
  };
25648
- const translator$Y = NodeTranslator.from(config$i);
25649
- const encode$v = (attributes) => attributes?.["w:val"];
25650
- const decode$s = (attrs) => attrs?.fontSize;
25648
+ const translator$X = NodeTranslator.from(config$h);
25649
+ const encode$u = (attributes) => attributes?.["w:val"];
25650
+ const decode$r = (attrs) => attrs?.fontSize;
25651
25651
  const attrConfig$b = Object.freeze({
25652
25652
  xmlName: "w:val",
25653
25653
  sdName: "fontSize",
25654
- encode: encode$v,
25655
- decode: decode$s
25654
+ encode: encode$u,
25655
+ decode: decode$r
25656
25656
  });
25657
- const validXmlAttributes$c = [attrConfig$b];
25658
- const XML_NODE_NAME$j = "w:sz";
25657
+ const validXmlAttributes$b = [attrConfig$b];
25658
+ const XML_NODE_NAME$i = "w:sz";
25659
25659
  const SD_ATTR_KEY$7 = "fontSize";
25660
- const encode$u = (params, encodedAttrs = {}) => {
25660
+ const encode$t = (params, encodedAttrs = {}) => {
25661
25661
  const { nodes } = params;
25662
25662
  const node = nodes?.[0];
25663
25663
  const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
25664
25664
  return {
25665
25665
  type: "attr",
25666
- xmlName: XML_NODE_NAME$j,
25666
+ xmlName: XML_NODE_NAME$i,
25667
25667
  sdNodeOrKeyName: SD_ATTR_KEY$7,
25668
25668
  attributes: { "w:val": value ?? null }
25669
25669
  };
25670
25670
  };
25671
- const config$h = {
25672
- xmlName: XML_NODE_NAME$j,
25671
+ const config$g = {
25672
+ xmlName: XML_NODE_NAME$i,
25673
25673
  sdNodeOrKeyName: SD_ATTR_KEY$7,
25674
25674
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25675
- encode: encode$u,
25676
- attributes: validXmlAttributes$c
25675
+ encode: encode$t,
25676
+ attributes: validXmlAttributes$b
25677
25677
  };
25678
- const translator$X = NodeTranslator.from(config$h);
25679
- const encode$t = (attributes) => attributes?.["w:val"];
25680
- const decode$r = (attrs) => attrs?.fontSizeCs;
25678
+ const translator$W = NodeTranslator.from(config$g);
25679
+ const encode$s = (attributes) => attributes?.["w:val"];
25680
+ const decode$q = (attrs) => attrs?.fontSizeCs;
25681
25681
  const attrConfig$a = Object.freeze({
25682
25682
  xmlName: "w:val",
25683
25683
  sdName: "fontSizeCs",
25684
- encode: encode$t,
25685
- decode: decode$r
25684
+ encode: encode$s,
25685
+ decode: decode$q
25686
25686
  });
25687
- const validXmlAttributes$b = [attrConfig$a];
25688
- const XML_NODE_NAME$i = "w:szCs";
25687
+ const validXmlAttributes$a = [attrConfig$a];
25688
+ const XML_NODE_NAME$h = "w:szCs";
25689
25689
  const SD_ATTR_KEY$6 = "fontSizeCs";
25690
- const encode$s = (params, encodedAttrs = {}) => {
25690
+ const encode$r = (params, encodedAttrs = {}) => {
25691
25691
  const { nodes } = params;
25692
25692
  const node = nodes?.[0];
25693
25693
  const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
25694
25694
  return {
25695
25695
  type: "attr",
25696
- xmlName: XML_NODE_NAME$i,
25696
+ xmlName: XML_NODE_NAME$h,
25697
25697
  sdNodeOrKeyName: SD_ATTR_KEY$6,
25698
25698
  attributes: { "w:val": value ?? null }
25699
25699
  };
25700
25700
  };
25701
- const config$g = {
25702
- xmlName: XML_NODE_NAME$i,
25701
+ const config$f = {
25702
+ xmlName: XML_NODE_NAME$h,
25703
25703
  sdNodeOrKeyName: SD_ATTR_KEY$6,
25704
25704
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25705
- encode: encode$s,
25706
- attributes: validXmlAttributes$b
25705
+ encode: encode$r,
25706
+ attributes: validXmlAttributes$a
25707
25707
  };
25708
- const translator$W = NodeTranslator.from(config$g);
25708
+ const translator$V = NodeTranslator.from(config$f);
25709
25709
  const runPropertyTranslators = Object.freeze({
25710
- "w:b": translator$12,
25711
- "w:i": translator$11,
25712
- "w:u": translator$10,
25713
- "w:strike": translator$$,
25714
- "w:color": translator$_,
25715
- "w:highlight": translator$15,
25716
- "w:rFonts": translator$Z,
25717
- "w:rStyle": translator$Y,
25718
- "w:sz": translator$X,
25719
- "w:szCs": translator$W
25710
+ "w:b": translator$11,
25711
+ "w:i": translator$10,
25712
+ "w:u": translator$$,
25713
+ "w:strike": translator$_,
25714
+ "w:color": translator$Z,
25715
+ "w:highlight": translator$14,
25716
+ "w:rFonts": translator$Y,
25717
+ "w:rStyle": translator$X,
25718
+ "w:sz": translator$W,
25719
+ "w:szCs": translator$V
25720
25720
  });
25721
25721
  const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
25722
25722
  const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
@@ -25730,9 +25730,9 @@ const toRunPropertyEntry = (candidate) => {
25730
25730
  attributes: { ...candidate.attributes || {} }
25731
25731
  };
25732
25732
  };
25733
- const XML_NODE_NAME$h = "w:rPr";
25733
+ const XML_NODE_NAME$g = "w:rPr";
25734
25734
  const SD_ATTR_KEY$5 = "runProperties";
25735
- const encode$r = (params) => {
25735
+ const encode$q = (params) => {
25736
25736
  const { nodes } = params;
25737
25737
  const node = nodes?.[0] || {};
25738
25738
  const contents = Array.isArray(node.elements) ? node.elements : [];
@@ -25766,16 +25766,16 @@ const encode$r = (params) => {
25766
25766
  attributes: runPropsArray
25767
25767
  };
25768
25768
  };
25769
- const config$f = {
25770
- xmlName: XML_NODE_NAME$h,
25769
+ const config$e = {
25770
+ xmlName: XML_NODE_NAME$g,
25771
25771
  sdNodeOrKeyName: SD_ATTR_KEY$5,
25772
25772
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25773
- encode: encode$r
25773
+ encode: encode$q
25774
25774
  };
25775
- const translator$V = NodeTranslator.from(config$f);
25775
+ const translator$U = NodeTranslator.from(config$e);
25776
25776
  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;
25777
25777
  const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
25778
- const collectRunProperties = (params, rPrNode, translator2 = translator$V) => {
25778
+ const collectRunProperties = (params, rPrNode, translator2 = translator$U) => {
25779
25779
  if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
25780
25780
  const result = translator2.encode({ ...params, nodes: [rPrNode] }) || {};
25781
25781
  let entries = [];
@@ -26237,46 +26237,46 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
26237
26237
  }
26238
26238
  return runs;
26239
26239
  };
26240
- const encode$q = (attributes) => {
26240
+ const encode$p = (attributes) => {
26241
26241
  return attributes["w:rsidR"];
26242
26242
  };
26243
- const decode$q = (attrs) => {
26243
+ const decode$p = (attrs) => {
26244
26244
  return attrs.rsidR;
26245
26245
  };
26246
26246
  const attrConfig$9 = Object.freeze({
26247
26247
  xmlName: "w:rsidR",
26248
26248
  sdName: "rsidR",
26249
- encode: encode$q,
26250
- decode: decode$q
26249
+ encode: encode$p,
26250
+ decode: decode$p
26251
26251
  });
26252
- const encode$p = (attributes) => {
26252
+ const encode$o = (attributes) => {
26253
26253
  return attributes["w:rsidRPr"];
26254
26254
  };
26255
- const decode$p = (attrs) => {
26255
+ const decode$o = (attrs) => {
26256
26256
  return attrs.rsidRPr;
26257
26257
  };
26258
26258
  const attrConfig$8 = Object.freeze({
26259
26259
  xmlName: "w:rsidRPr",
26260
26260
  sdName: "rsidRPr",
26261
- encode: encode$p,
26262
- decode: decode$p
26261
+ encode: encode$o,
26262
+ decode: decode$o
26263
26263
  });
26264
- const encode$o = (attributes) => {
26264
+ const encode$n = (attributes) => {
26265
26265
  return attributes["w:rsidDel"];
26266
26266
  };
26267
- const decode$o = (attrs) => {
26267
+ const decode$n = (attrs) => {
26268
26268
  return attrs.rsidDel;
26269
26269
  };
26270
26270
  const attrConfig$7 = Object.freeze({
26271
26271
  xmlName: "w:rsidDel",
26272
26272
  sdName: "rsidDel",
26273
- encode: encode$o,
26274
- decode: decode$o
26273
+ encode: encode$n,
26274
+ decode: decode$n
26275
26275
  });
26276
- const validXmlAttributes$a = [attrConfig$9, attrConfig$8, attrConfig$7];
26277
- const XML_NODE_NAME$g = "w:r";
26276
+ const validXmlAttributes$9 = [attrConfig$9, attrConfig$8, attrConfig$7];
26277
+ const XML_NODE_NAME$f = "w:r";
26278
26278
  const SD_KEY_NAME = "run";
26279
- const encode$n = (params, encodedAttrs = {}) => {
26279
+ const encode$m = (params, encodedAttrs = {}) => {
26280
26280
  const { nodes = [], nodeListHandler } = params || {};
26281
26281
  const runNode = nodes[0];
26282
26282
  if (!runNode) return void 0;
@@ -26324,7 +26324,7 @@ const encode$n = (params, encodedAttrs = {}) => {
26324
26324
  }
26325
26325
  return runNodeResult;
26326
26326
  };
26327
- const decode$n = (params, decodedAttrs = {}) => {
26327
+ const decode$m = (params, decodedAttrs = {}) => {
26328
26328
  const { node } = params || {};
26329
26329
  if (!node) return void 0;
26330
26330
  const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
@@ -26381,7 +26381,7 @@ const decode$n = (params, decodedAttrs = {}) => {
26381
26381
  runs.push(trackedClone);
26382
26382
  return;
26383
26383
  }
26384
- const runWrapper = { name: XML_NODE_NAME$g, elements: [] };
26384
+ const runWrapper = { name: XML_NODE_NAME$f, elements: [] };
26385
26385
  applyBaseRunProps(runWrapper);
26386
26386
  if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
26387
26387
  runWrapper.elements.push(cloneXmlNode(child));
@@ -26389,7 +26389,7 @@ const decode$n = (params, decodedAttrs = {}) => {
26389
26389
  });
26390
26390
  const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
26391
26391
  if (!trackedRuns.length) {
26392
- const emptyRun = { name: XML_NODE_NAME$g, elements: [] };
26392
+ const emptyRun = { name: XML_NODE_NAME$f, elements: [] };
26393
26393
  applyBaseRunProps(emptyRun);
26394
26394
  trackedRuns.push(emptyRun);
26395
26395
  }
@@ -26403,15 +26403,15 @@ const decode$n = (params, decodedAttrs = {}) => {
26403
26403
  }
26404
26404
  return trackedRuns;
26405
26405
  };
26406
- const config$e = {
26407
- xmlName: XML_NODE_NAME$g,
26406
+ const config$d = {
26407
+ xmlName: XML_NODE_NAME$f,
26408
26408
  sdNodeOrKeyName: SD_KEY_NAME,
26409
26409
  type: NodeTranslator.translatorTypes.NODE,
26410
- encode: encode$n,
26411
- decode: decode$n,
26412
- attributes: validXmlAttributes$a
26410
+ encode: encode$m,
26411
+ decode: decode$m,
26412
+ attributes: validXmlAttributes$9
26413
26413
  };
26414
- const translator$U = NodeTranslator.from(config$e);
26414
+ const translator$T = NodeTranslator.from(config$d);
26415
26415
  const generateV2HandlerEntity = (handlerName, translator2) => ({
26416
26416
  handlerName,
26417
26417
  handler: (params) => {
@@ -26585,13 +26585,13 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
26585
26585
  }
26586
26586
  return table;
26587
26587
  }
26588
- const translator$T = NodeTranslator.from({
26588
+ const translator$S = NodeTranslator.from({
26589
26589
  xmlName: "w:cantSplit",
26590
26590
  sdNodeOrKeyName: "cantSplit",
26591
26591
  encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
26592
26592
  decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
26593
26593
  });
26594
- const translator$S = NodeTranslator.from({
26594
+ const translator$R = NodeTranslator.from({
26595
26595
  xmlName: "w:cnfStyle",
26596
26596
  sdNodeOrKeyName: "cnfStyle",
26597
26597
  attributes: [
@@ -26617,8 +26617,8 @@ const translator$S = NodeTranslator.from({
26617
26617
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26618
26618
  }
26619
26619
  });
26620
- const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
26621
- const translator$Q = NodeTranslator.from(
26620
+ const translator$Q = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
26621
+ const translator$P = NodeTranslator.from(
26622
26622
  createSingleAttrPropertyHandler(
26623
26623
  "w:gridAfter",
26624
26624
  null,
@@ -26627,7 +26627,7 @@ const translator$Q = NodeTranslator.from(
26627
26627
  (v2) => integerToString(v2)
26628
26628
  )
26629
26629
  );
26630
- const translator$P = NodeTranslator.from(
26630
+ const translator$O = NodeTranslator.from(
26631
26631
  createSingleAttrPropertyHandler(
26632
26632
  "w:gridBefore",
26633
26633
  null,
@@ -26636,21 +26636,21 @@ const translator$P = NodeTranslator.from(
26636
26636
  (v2) => integerToString(v2)
26637
26637
  )
26638
26638
  );
26639
- const translator$O = NodeTranslator.from({
26639
+ const translator$N = NodeTranslator.from({
26640
26640
  xmlName: "w:hidden",
26641
26641
  sdNodeOrKeyName: "hidden",
26642
26642
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26643
26643
  decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
26644
26644
  });
26645
- const translator$N = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
26646
- const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
26647
- const translator$L = NodeTranslator.from({
26645
+ const translator$M = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
26646
+ const translator$L = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
26647
+ const translator$K = NodeTranslator.from({
26648
26648
  xmlName: "w:tblHeader",
26649
26649
  sdNodeOrKeyName: "repeatHeader",
26650
26650
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26651
26651
  decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
26652
26652
  });
26653
- const translator$K = NodeTranslator.from({
26653
+ const translator$J = NodeTranslator.from({
26654
26654
  xmlName: "w:trHeight",
26655
26655
  sdNodeOrKeyName: "rowHeight",
26656
26656
  encode: ({ nodes }) => {
@@ -26677,11 +26677,11 @@ const translator$K = NodeTranslator.from({
26677
26677
  return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
26678
26678
  }
26679
26679
  });
26680
- const translator$J = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
26681
- const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
26682
- const XML_NODE_NAME$f = "w:trPr";
26680
+ const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
26681
+ const translator$H = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
26682
+ const XML_NODE_NAME$e = "w:trPr";
26683
26683
  const SD_ATTR_KEY$4 = "tableRowProperties";
26684
- const encode$m = (params) => {
26684
+ const encode$l = (params) => {
26685
26685
  const { nodes } = params;
26686
26686
  const node = nodes[0];
26687
26687
  let attributes = {
@@ -26695,12 +26695,12 @@ const encode$m = (params) => {
26695
26695
  };
26696
26696
  return {
26697
26697
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
26698
- xmlName: XML_NODE_NAME$f,
26698
+ xmlName: XML_NODE_NAME$e,
26699
26699
  sdNodeOrKeyName: SD_ATTR_KEY$4,
26700
26700
  attributes
26701
26701
  };
26702
26702
  };
26703
- const decode$m = (params) => {
26703
+ const decode$l = (params) => {
26704
26704
  const { tableRowProperties = {} } = params.node.attrs || {};
26705
26705
  const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
26706
26706
  const newNode = {
@@ -26712,7 +26712,6 @@ const decode$m = (params) => {
26712
26712
  return newNode;
26713
26713
  };
26714
26714
  const propertyTranslators$3 = [
26715
- translator$T,
26716
26715
  translator$S,
26717
26716
  translator$R,
26718
26717
  translator$Q,
@@ -26723,7 +26722,8 @@ const propertyTranslators$3 = [
26723
26722
  translator$L,
26724
26723
  translator$K,
26725
26724
  translator$J,
26726
- translator$I
26725
+ translator$I,
26726
+ translator$H
26727
26727
  ];
26728
26728
  const propertyTranslatorsByXmlName$2 = {};
26729
26729
  propertyTranslators$3.forEach((translator2) => {
@@ -26733,25 +26733,25 @@ const propertyTranslatorsBySdName$2 = {};
26733
26733
  propertyTranslators$3.forEach((translator2) => {
26734
26734
  propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
26735
26735
  });
26736
- const config$d = {
26737
- xmlName: XML_NODE_NAME$f,
26736
+ const config$c = {
26737
+ xmlName: XML_NODE_NAME$e,
26738
26738
  sdNodeOrKeyName: SD_ATTR_KEY$4,
26739
26739
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
26740
- encode: encode$m,
26741
- decode: decode$m
26740
+ encode: encode$l,
26741
+ decode: decode$l
26742
26742
  };
26743
- const translator$H = NodeTranslator.from(config$d);
26744
- const XML_NODE_NAME$e = "w:tr";
26745
- const SD_NODE_NAME$a = "tableRow";
26746
- const validXmlAttributes$9 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
26743
+ const translator$G = NodeTranslator.from(config$c);
26744
+ const XML_NODE_NAME$d = "w:tr";
26745
+ const SD_NODE_NAME$9 = "tableRow";
26746
+ const validXmlAttributes$8 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
26747
26747
  (xmlName) => createAttributeHandler(xmlName)
26748
26748
  );
26749
- const encode$l = (params, encodedAttrs) => {
26749
+ const encode$k = (params, encodedAttrs) => {
26750
26750
  const { row } = params.extraParams;
26751
26751
  let tableRowProperties = {};
26752
26752
  const tPr = row.elements.find((el) => el.name === "w:trPr");
26753
26753
  if (tPr) {
26754
- ({ attributes: tableRowProperties } = translator$H.encode({
26754
+ ({ attributes: tableRowProperties } = translator$G.encode({
26755
26755
  ...params,
26756
26756
  nodes: [tPr]
26757
26757
  }));
@@ -26764,7 +26764,7 @@ const encode$l = (params, encodedAttrs) => {
26764
26764
  let currentColumnIndex = 0;
26765
26765
  const content = cellNodes?.map((n) => {
26766
26766
  let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
26767
- const result = translator$8.encode({
26767
+ const result = translator$7.encode({
26768
26768
  ...params,
26769
26769
  extraParams: {
26770
26770
  ...params.extraParams,
@@ -26786,7 +26786,7 @@ const encode$l = (params, encodedAttrs) => {
26786
26786
  };
26787
26787
  return newNode;
26788
26788
  };
26789
- const decode$l = (params, decodedAttrs) => {
26789
+ const decode$k = (params, decodedAttrs) => {
26790
26790
  const { node } = params;
26791
26791
  const elements = translateChildNodes(params);
26792
26792
  if (node.attrs?.tableRowProperties) {
@@ -26798,7 +26798,7 @@ const decode$l = (params, decodedAttrs) => {
26798
26798
  }
26799
26799
  }
26800
26800
  tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
26801
- const trPr = translator$H.decode({
26801
+ const trPr = translator$G.decode({
26802
26802
  ...params,
26803
26803
  node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
26804
26804
  });
@@ -26810,22 +26810,22 @@ const decode$l = (params, decodedAttrs) => {
26810
26810
  elements
26811
26811
  };
26812
26812
  };
26813
- const config$c = {
26814
- xmlName: XML_NODE_NAME$e,
26815
- sdNodeOrKeyName: SD_NODE_NAME$a,
26813
+ const config$b = {
26814
+ xmlName: XML_NODE_NAME$d,
26815
+ sdNodeOrKeyName: SD_NODE_NAME$9,
26816
26816
  type: NodeTranslator.translatorTypes.NODE,
26817
- encode: encode$l,
26818
- decode: decode$l,
26819
- attributes: validXmlAttributes$9
26817
+ encode: encode$k,
26818
+ decode: decode$k,
26819
+ attributes: validXmlAttributes$8
26820
26820
  };
26821
- const translator$G = NodeTranslator.from(config$c);
26822
- const translator$F = NodeTranslator.from({
26821
+ const translator$F = NodeTranslator.from(config$b);
26822
+ const translator$E = NodeTranslator.from({
26823
26823
  xmlName: "w:bidiVisual",
26824
26824
  sdNodeOrKeyName: "rightToLeft",
26825
26825
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26826
26826
  decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
26827
26827
  });
26828
- const translator$E = NodeTranslator.from({
26828
+ const translator$D = NodeTranslator.from({
26829
26829
  xmlName: "w:shd",
26830
26830
  sdNodeOrKeyName: "shading",
26831
26831
  attributes: [
@@ -26847,11 +26847,11 @@ const translator$E = NodeTranslator.from({
26847
26847
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26848
26848
  }
26849
26849
  });
26850
- const translator$D = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
26851
- const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
26852
- const translator$B = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
26853
- const translator$A = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
26854
- const translator$z = NodeTranslator.from({
26850
+ const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
26851
+ const translator$B = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
26852
+ const translator$A = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
26853
+ const translator$z = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
26854
+ const translator$y = NodeTranslator.from({
26855
26855
  xmlName: "w:tblLook",
26856
26856
  sdNodeOrKeyName: "tblLook",
26857
26857
  attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
@@ -26863,16 +26863,16 @@ const translator$z = NodeTranslator.from({
26863
26863
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26864
26864
  }
26865
26865
  });
26866
- const translator$y = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
26867
- const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
26868
- const translator$w = NodeTranslator.from(
26866
+ const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
26867
+ const translator$w = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
26868
+ const translator$v = NodeTranslator.from(
26869
26869
  createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
26870
26870
  );
26871
- const translator$v = NodeTranslator.from(
26871
+ const translator$u = NodeTranslator.from(
26872
26872
  createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
26873
26873
  );
26874
- const translator$u = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
26875
- const translator$t = NodeTranslator.from({
26874
+ const translator$t = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
26875
+ const translator$s = NodeTranslator.from({
26876
26876
  xmlName: "w:tblpPr",
26877
26877
  sdNodeOrKeyName: "floatingTableProperties",
26878
26878
  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))),
@@ -26884,29 +26884,29 @@ const translator$t = NodeTranslator.from({
26884
26884
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26885
26885
  }
26886
26886
  });
26887
- const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
26888
- const translator$r = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
26889
- const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:end"));
26890
- const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
26891
- const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
26892
- const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
26893
- const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:left"));
26894
- const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
26895
- const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:right"));
26896
- const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
26897
- const translator$i = NodeTranslator.from(createBorderPropertyHandler("w:start"));
26898
- const translator$h = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
26899
- const translator$g = NodeTranslator.from(createBorderPropertyHandler("w:top"));
26900
- const translator$f = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
26901
- const XML_NODE_NAME$d = "w:tblBorders";
26887
+ const translator$r = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
26888
+ const translator$q = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
26889
+ const translator$p = NodeTranslator.from(createBorderPropertyHandler("w:end"));
26890
+ const translator$o = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
26891
+ const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
26892
+ const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
26893
+ const translator$l = NodeTranslator.from(createBorderPropertyHandler("w:left"));
26894
+ const translator$k = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
26895
+ const translator$j = NodeTranslator.from(createBorderPropertyHandler("w:right"));
26896
+ const translator$i = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
26897
+ const translator$h = NodeTranslator.from(createBorderPropertyHandler("w:start"));
26898
+ const translator$g = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
26899
+ const translator$f = NodeTranslator.from(createBorderPropertyHandler("w:top"));
26900
+ const translator$e = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
26901
+ const XML_NODE_NAME$c = "w:tblBorders";
26902
26902
  const SD_ATTR_KEY$3 = "borders";
26903
- const encode$k = (params) => {
26903
+ const encode$j = (params) => {
26904
26904
  const { nodes } = params;
26905
26905
  const node = nodes[0];
26906
26906
  const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
26907
26907
  return Object.keys(attributes).length > 0 ? attributes : void 0;
26908
26908
  };
26909
- const decode$k = (params) => {
26909
+ const decode$j = (params) => {
26910
26910
  const { borders = {} } = params.node.attrs || {};
26911
26911
  const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
26912
26912
  const newNode = {
@@ -26918,14 +26918,14 @@ const decode$k = (params) => {
26918
26918
  return newNode;
26919
26919
  };
26920
26920
  const propertyTranslators$2 = [
26921
- translator$s,
26922
- translator$q,
26923
- translator$o,
26921
+ translator$r,
26922
+ translator$p,
26924
26923
  translator$n,
26925
26924
  translator$m,
26926
- translator$k,
26927
- translator$i,
26928
- translator$g
26925
+ translator$l,
26926
+ translator$j,
26927
+ translator$h,
26928
+ translator$f
26929
26929
  ];
26930
26930
  const tblBordersTranslatorsByXmlName = {};
26931
26931
  const tblBordersTranslatorsBySdName = {};
@@ -26933,27 +26933,27 @@ propertyTranslators$2.forEach((translator2) => {
26933
26933
  tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
26934
26934
  tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
26935
26935
  });
26936
- const translator$e = NodeTranslator.from({
26937
- xmlName: XML_NODE_NAME$d,
26936
+ const translator$d = NodeTranslator.from({
26937
+ xmlName: XML_NODE_NAME$c,
26938
26938
  sdNodeOrKeyName: SD_ATTR_KEY$3,
26939
26939
  type: NodeTranslator.translatorTypes.NODE,
26940
26940
  attributes: [],
26941
- encode: encode$k,
26942
- decode: decode$k
26941
+ encode: encode$j,
26942
+ decode: decode$j
26943
26943
  });
26944
- const XML_NODE_NAME$c = "w:tblCellMar";
26944
+ const XML_NODE_NAME$b = "w:tblCellMar";
26945
26945
  const SD_ATTR_KEY$2 = "cellMargins";
26946
- const encode$j = (params) => {
26946
+ const encode$i = (params) => {
26947
26947
  const { nodes } = params;
26948
26948
  const node = nodes[0];
26949
26949
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
26950
26950
  return Object.keys(attributes).length > 0 ? attributes : void 0;
26951
26951
  };
26952
- const decode$j = (params) => {
26952
+ const decode$i = (params) => {
26953
26953
  const { cellMargins = {} } = params.node.attrs || {};
26954
26954
  const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
26955
26955
  const newNode = {
26956
- name: XML_NODE_NAME$c,
26956
+ name: XML_NODE_NAME$b,
26957
26957
  type: "element",
26958
26958
  attributes: {},
26959
26959
  elements
@@ -26961,12 +26961,12 @@ const decode$j = (params) => {
26961
26961
  return newNode;
26962
26962
  };
26963
26963
  const propertyTranslators$1 = [
26964
- translator$r,
26965
- translator$p,
26966
- translator$l,
26967
- translator$j,
26968
- translator$h,
26969
- translator$f
26964
+ translator$q,
26965
+ translator$o,
26966
+ translator$k,
26967
+ translator$i,
26968
+ translator$g,
26969
+ translator$e
26970
26970
  ];
26971
26971
  const propertyTranslatorsByXmlName$1 = {};
26972
26972
  const propertyTranslatorsBySdName$1 = {};
@@ -26974,27 +26974,27 @@ propertyTranslators$1.forEach((translator2) => {
26974
26974
  propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
26975
26975
  propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
26976
26976
  });
26977
- const translator$d = NodeTranslator.from({
26978
- xmlName: XML_NODE_NAME$c,
26977
+ const translator$c = NodeTranslator.from({
26978
+ xmlName: XML_NODE_NAME$b,
26979
26979
  sdNodeOrKeyName: SD_ATTR_KEY$2,
26980
26980
  type: NodeTranslator.translatorTypes.NODE,
26981
26981
  attributes: [],
26982
- encode: encode$j,
26983
- decode: decode$j
26982
+ encode: encode$i,
26983
+ decode: decode$i
26984
26984
  });
26985
- const XML_NODE_NAME$b = "w:tblPr";
26985
+ const XML_NODE_NAME$a = "w:tblPr";
26986
26986
  const SD_ATTR_KEY$1 = "tableProperties";
26987
- const encode$i = (params) => {
26987
+ const encode$h = (params) => {
26988
26988
  const { nodes } = params;
26989
26989
  const node = nodes[0];
26990
26990
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
26991
26991
  return {
26992
- xmlName: XML_NODE_NAME$b,
26992
+ xmlName: XML_NODE_NAME$a,
26993
26993
  sdNodeOrKeyName: SD_ATTR_KEY$1,
26994
26994
  attributes
26995
26995
  };
26996
26996
  };
26997
- const decode$i = (params) => {
26997
+ const decode$h = (params) => {
26998
26998
  const { tableProperties = {} } = params.node.attrs || {};
26999
26999
  const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
27000
27000
  const newNode = {
@@ -27006,12 +27006,11 @@ const decode$i = (params) => {
27006
27006
  return newNode;
27007
27007
  };
27008
27008
  const propertyTranslators = [
27009
- translator$F,
27010
- translator$N,
27011
27009
  translator$E,
27012
- translator$D,
27013
27010
  translator$M,
27011
+ translator$D,
27014
27012
  translator$C,
27013
+ translator$L,
27015
27014
  translator$B,
27016
27015
  translator$A,
27017
27016
  translator$z,
@@ -27021,8 +27020,9 @@ const propertyTranslators = [
27021
27020
  translator$v,
27022
27021
  translator$u,
27023
27022
  translator$t,
27024
- translator$e,
27025
- translator$d
27023
+ translator$s,
27024
+ translator$d,
27025
+ translator$c
27026
27026
  ];
27027
27027
  const propertyTranslatorsByXmlName = {};
27028
27028
  const propertyTranslatorsBySdName = {};
@@ -27030,14 +27030,14 @@ propertyTranslators.forEach((translator2) => {
27030
27030
  propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
27031
27031
  propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
27032
27032
  });
27033
- const config$b = {
27034
- xmlName: XML_NODE_NAME$b,
27033
+ const config$a = {
27034
+ xmlName: XML_NODE_NAME$a,
27035
27035
  sdNodeOrKeyName: SD_ATTR_KEY$1,
27036
- encode: encode$i,
27037
- decode: decode$i
27036
+ encode: encode$h,
27037
+ decode: decode$h
27038
27038
  };
27039
- const translator$c = NodeTranslator.from(config$b);
27040
- const translator$b = NodeTranslator.from(
27039
+ const translator$b = NodeTranslator.from(config$a);
27040
+ const translator$a = NodeTranslator.from(
27041
27041
  createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
27042
27042
  );
27043
27043
  const DEFAULT_COLUMN_WIDTH_PX = 100;
@@ -27087,20 +27087,20 @@ const resolveFallbackColumnWidthTwips = (params, totalColumns, cellMinWidthTwips
27087
27087
  }
27088
27088
  return Math.max(fallbackWidthTwips, cellMinWidthTwips);
27089
27089
  };
27090
- const XML_NODE_NAME$a = "w:tblGrid";
27090
+ const XML_NODE_NAME$9 = "w:tblGrid";
27091
27091
  const SD_ATTR_KEY = "grid";
27092
27092
  const cellMinWidth = pixelsToTwips(10);
27093
- const encode$h = (params) => {
27093
+ const encode$g = (params) => {
27094
27094
  const { nodes } = params;
27095
27095
  const node = nodes[0];
27096
- const attributes = encodeProperties(node, { [translator$b.xmlName]: translator$b }, true);
27096
+ const attributes = encodeProperties(node, { [translator$a.xmlName]: translator$a }, true);
27097
27097
  return {
27098
- xmlName: XML_NODE_NAME$a,
27098
+ xmlName: XML_NODE_NAME$9,
27099
27099
  sdNodeOrKeyName: SD_ATTR_KEY,
27100
27100
  attributes
27101
27101
  };
27102
27102
  };
27103
- const decode$h = (params) => {
27103
+ const decode$g = (params) => {
27104
27104
  const { grid: rawGrid } = params.node.attrs || {};
27105
27105
  const grid = Array.isArray(rawGrid) ? rawGrid : [];
27106
27106
  const { firstRow = {} } = params.extraParams || {};
@@ -27119,10 +27119,10 @@ const decode$h = (params) => {
27119
27119
  numericWidth = fallbackColumnWidthTwips;
27120
27120
  }
27121
27121
  numericWidth = Math.max(numericWidth, cellMinWidth);
27122
- const decoded = translator$b.decode({
27122
+ const decoded = translator$a.decode({
27123
27123
  node: { type: (
27124
27124
  /** @type {string} */
27125
- translator$b.sdNodeOrKeyName
27125
+ translator$a.sdNodeOrKeyName
27126
27126
  ), attrs: { col: numericWidth } }
27127
27127
  });
27128
27128
  if (decoded) elements.push(decoded);
@@ -27157,32 +27157,32 @@ const decode$h = (params) => {
27157
27157
  columnIndex++;
27158
27158
  }
27159
27159
  const newNode = {
27160
- name: XML_NODE_NAME$a,
27160
+ name: XML_NODE_NAME$9,
27161
27161
  attributes: {},
27162
27162
  elements
27163
27163
  };
27164
27164
  return newNode;
27165
27165
  };
27166
- const config$a = {
27167
- xmlName: XML_NODE_NAME$a,
27166
+ const config$9 = {
27167
+ xmlName: XML_NODE_NAME$9,
27168
27168
  sdNodeOrKeyName: SD_ATTR_KEY,
27169
- encode: encode$h,
27170
- decode: decode$h
27169
+ encode: encode$g,
27170
+ decode: decode$g
27171
27171
  };
27172
- const translator$a = NodeTranslator.from(config$a);
27173
- const XML_NODE_NAME$9 = "w:tbl";
27174
- const SD_NODE_NAME$9 = "table";
27175
- const encode$g = (params, encodedAttrs) => {
27172
+ const translator$9 = NodeTranslator.from(config$9);
27173
+ const XML_NODE_NAME$8 = "w:tbl";
27174
+ const SD_NODE_NAME$8 = "table";
27175
+ const encode$f = (params, encodedAttrs) => {
27176
27176
  const { nodes } = params;
27177
27177
  const node = nodes[0];
27178
27178
  const tblPr = node.elements.find((el) => el.name === "w:tblPr");
27179
27179
  if (tblPr) {
27180
- const encodedProperties = translator$c.encode({ ...params, nodes: [tblPr] });
27180
+ const encodedProperties = translator$b.encode({ ...params, nodes: [tblPr] });
27181
27181
  encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
27182
27182
  }
27183
27183
  const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
27184
27184
  if (tblGrid) {
27185
- encodedAttrs["grid"] = translator$a.encode({ ...params, nodes: [tblGrid] }).attributes;
27185
+ encodedAttrs["grid"] = translator$9.encode({ ...params, nodes: [tblGrid] }).attributes;
27186
27186
  }
27187
27187
  [
27188
27188
  "tableStyleId",
@@ -27223,7 +27223,7 @@ const encode$g = (params, encodedAttrs) => {
27223
27223
  const columnWidths = (encodedAttrs["grid"] ?? []).map((item) => twipsToPixels(item.col));
27224
27224
  const content = [];
27225
27225
  rows.forEach((row) => {
27226
- const result = translator$G.encode({
27226
+ const result = translator$F.encode({
27227
27227
  ...params,
27228
27228
  nodes: [row],
27229
27229
  extraParams: {
@@ -27242,13 +27242,13 @@ const encode$g = (params, encodedAttrs) => {
27242
27242
  attrs: encodedAttrs
27243
27243
  };
27244
27244
  };
27245
- const decode$g = (params, decodedAttrs) => {
27245
+ const decode$f = (params, decodedAttrs) => {
27246
27246
  params.node = preProcessVerticalMergeCells(params.node, params);
27247
27247
  const { node } = params;
27248
27248
  const elements = translateChildNodes(params);
27249
27249
  const firstRow = node.content?.find((n) => n.type === "tableRow");
27250
27250
  const properties = node.attrs.grid;
27251
- const element = translator$a.decode({
27251
+ const element = translator$9.decode({
27252
27252
  ...params,
27253
27253
  node: { ...node, attrs: { ...node.attrs, grid: properties } },
27254
27254
  extraParams: {
@@ -27258,7 +27258,7 @@ const decode$g = (params, decodedAttrs) => {
27258
27258
  if (element) elements.unshift(element);
27259
27259
  if (node.attrs?.tableProperties) {
27260
27260
  const properties2 = { ...node.attrs.tableProperties };
27261
- const element2 = translator$c.decode({
27261
+ const element2 = translator$b.decode({
27262
27262
  ...params,
27263
27263
  node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
27264
27264
  });
@@ -27324,7 +27324,7 @@ function _getReferencedTableStyles(tableStyleReference, params) {
27324
27324
  if (baseTblPr && baseTblPr.elements) {
27325
27325
  tblPr.elements.push(...baseTblPr.elements);
27326
27326
  }
27327
- const tableProperties = translator$c.encode({ ...params, nodes: [tblPr] }).attributes;
27327
+ const tableProperties = translator$b.encode({ ...params, nodes: [tblPr] }).attributes;
27328
27328
  const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
27329
27329
  if (borders) stylesToReturn.borders = borders;
27330
27330
  if (rowBorders) stylesToReturn.rowBorders = rowBorders;
@@ -27341,16 +27341,16 @@ function _getReferencedTableStyles(tableStyleReference, params) {
27341
27341
  }
27342
27342
  return stylesToReturn;
27343
27343
  }
27344
- const config$9 = {
27345
- xmlName: XML_NODE_NAME$9,
27346
- sdNodeOrKeyName: SD_NODE_NAME$9,
27344
+ const config$8 = {
27345
+ xmlName: XML_NODE_NAME$8,
27346
+ sdNodeOrKeyName: SD_NODE_NAME$8,
27347
27347
  type: NodeTranslator.translatorTypes.NODE,
27348
- encode: encode$g,
27349
- decode: decode$g,
27348
+ encode: encode$f,
27349
+ decode: decode$f,
27350
27350
  attributes: []
27351
27351
  };
27352
- const translator$9 = NodeTranslator.from(config$9);
27353
- const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$9);
27352
+ const translator$8 = NodeTranslator.from(config$8);
27353
+ const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$8);
27354
27354
  function getReferencedTableStyles(tblStyleTag, docx) {
27355
27355
  if (!tblStyleTag) return null;
27356
27356
  const stylesToReturn = {};
@@ -27712,10 +27712,10 @@ function generateCellMargins(cellMargins) {
27712
27712
  if (left != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left) } });
27713
27713
  return elements;
27714
27714
  }
27715
- const XML_NODE_NAME$8 = "w:tc";
27716
- const SD_NODE_NAME$8 = "tableCell";
27717
- const validXmlAttributes$8 = [];
27718
- function encode$f(params, encodedAttrs) {
27715
+ const XML_NODE_NAME$7 = "w:tc";
27716
+ const SD_NODE_NAME$7 = "tableCell";
27717
+ const validXmlAttributes$7 = [];
27718
+ function encode$e(params, encodedAttrs) {
27719
27719
  const {
27720
27720
  node,
27721
27721
  table,
@@ -27742,31 +27742,31 @@ function encode$f(params, encodedAttrs) {
27742
27742
  }
27743
27743
  return schemaNode;
27744
27744
  }
27745
- function decode$f(params, decodedAttrs) {
27745
+ function decode$e(params, decodedAttrs) {
27746
27746
  const translated = translateTableCell(params);
27747
27747
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
27748
27748
  translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
27749
27749
  }
27750
27750
  return translated;
27751
27751
  }
27752
- const config$8 = {
27753
- xmlName: XML_NODE_NAME$8,
27754
- sdNodeOrKeyName: SD_NODE_NAME$8,
27752
+ const config$7 = {
27753
+ xmlName: XML_NODE_NAME$7,
27754
+ sdNodeOrKeyName: SD_NODE_NAME$7,
27755
27755
  type: NodeTranslator.translatorTypes.NODE,
27756
- encode: encode$f,
27757
- decode: decode$f,
27758
- attributes: validXmlAttributes$8
27756
+ encode: encode$e,
27757
+ decode: decode$e,
27758
+ attributes: validXmlAttributes$7
27759
27759
  };
27760
- const translator$8 = NodeTranslator.from(config$8);
27761
- const XML_NODE_NAME$7 = "w:hyperlink";
27762
- const SD_NODE_NAME$7 = "link";
27760
+ const translator$7 = NodeTranslator.from(config$7);
27761
+ const XML_NODE_NAME$6 = "w:hyperlink";
27762
+ const SD_NODE_NAME$6 = "link";
27763
27763
  const _createAttributeHandler = (xmlName, sdName) => ({
27764
27764
  xmlName,
27765
27765
  sdName,
27766
27766
  encode: (attributes) => attributes[xmlName],
27767
27767
  decode: (attributes) => attributes[sdName]
27768
27768
  });
27769
- const validXmlAttributes$7 = [
27769
+ const validXmlAttributes$6 = [
27770
27770
  _createAttributeHandler("w:anchor", "anchor"),
27771
27771
  _createAttributeHandler("w:docLocation", "docLocation"),
27772
27772
  {
@@ -27779,7 +27779,7 @@ const validXmlAttributes$7 = [
27779
27779
  _createAttributeHandler("r:id", "rId"),
27780
27780
  _createAttributeHandler("w:tgtFrame", "target")
27781
27781
  ];
27782
- const encode$e = (params, encodedAttrs) => {
27782
+ const encode$d = (params, encodedAttrs) => {
27783
27783
  const { nodes, docx, nodeListHandler } = params;
27784
27784
  const node = nodes[0];
27785
27785
  let href = _resolveHref(docx, encodedAttrs);
@@ -27845,7 +27845,7 @@ const _resolveHref = (docx, encodedAttrs) => {
27845
27845
  }
27846
27846
  return href;
27847
27847
  };
27848
- function decode$e(params) {
27848
+ function decode$d(params) {
27849
27849
  const { node } = params;
27850
27850
  const linkMark = node.marks.find((m2) => m2.type === "link");
27851
27851
  const linkAttrs = this.decodeAttributes({ ...params, node: linkMark });
@@ -27889,15 +27889,15 @@ function _addNewLinkRelationship(params, link, rId) {
27889
27889
  });
27890
27890
  return rId;
27891
27891
  }
27892
- const config$7 = {
27893
- xmlName: XML_NODE_NAME$7,
27894
- sdNodeOrKeyName: SD_NODE_NAME$7,
27892
+ const config$6 = {
27893
+ xmlName: XML_NODE_NAME$6,
27894
+ sdNodeOrKeyName: SD_NODE_NAME$6,
27895
27895
  type: NodeTranslator.translatorTypes.NODE,
27896
- encode: encode$e,
27897
- decode: decode$e,
27898
- attributes: validXmlAttributes$7
27896
+ encode: encode$d,
27897
+ decode: decode$d,
27898
+ attributes: validXmlAttributes$6
27899
27899
  };
27900
- const translator$7 = NodeTranslator.from(config$7);
27900
+ const translator$6 = NodeTranslator.from(config$6);
27901
27901
  function parseTagValueJSON(json) {
27902
27902
  if (typeof json !== "string") {
27903
27903
  return {};
@@ -28692,32 +28692,32 @@ function translateAnchorNode(params) {
28692
28692
  elements: [...anchorElements, ...elementsWithWrap]
28693
28693
  };
28694
28694
  }
28695
- const XML_NODE_NAME$6 = "wp:anchor";
28696
- const SD_NODE_NAME$6 = ["image"];
28697
- const validXmlAttributes$6 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28698
- function encode$d(params) {
28695
+ const XML_NODE_NAME$5 = "wp:anchor";
28696
+ const SD_NODE_NAME$5 = ["image"];
28697
+ const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28698
+ function encode$c(params) {
28699
28699
  const { node } = params.extraParams;
28700
28700
  if (!node || !node.type) {
28701
28701
  return null;
28702
28702
  }
28703
28703
  return handleAnchorNode(params);
28704
28704
  }
28705
- function decode$d(params) {
28705
+ function decode$c(params) {
28706
28706
  const { node } = params;
28707
28707
  if (!node || !node.type) {
28708
28708
  return null;
28709
28709
  }
28710
28710
  return translateAnchorNode(params);
28711
28711
  }
28712
- const config$6 = {
28713
- xmlName: XML_NODE_NAME$6,
28714
- sdNodeOrKeyName: SD_NODE_NAME$6,
28712
+ const config$5 = {
28713
+ xmlName: XML_NODE_NAME$5,
28714
+ sdNodeOrKeyName: SD_NODE_NAME$5,
28715
28715
  type: NodeTranslator.translatorTypes.NODE,
28716
- encode: encode$d,
28717
- decode: decode$d,
28718
- attributes: validXmlAttributes$6
28716
+ encode: encode$c,
28717
+ decode: decode$c,
28718
+ attributes: validXmlAttributes$5
28719
28719
  };
28720
- const translator$6 = NodeTranslator.from(config$6);
28720
+ const translator$5 = NodeTranslator.from(config$5);
28721
28721
  function handleInlineNode(params) {
28722
28722
  const { node } = params.extraParams;
28723
28723
  if (node.name !== "wp:inline") {
@@ -28733,41 +28733,41 @@ function translateInlineNode(params) {
28733
28733
  elements: nodeElements.elements
28734
28734
  };
28735
28735
  }
28736
- const XML_NODE_NAME$5 = "wp:inline";
28737
- const SD_NODE_NAME$5 = ["image"];
28738
- const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28739
- function encode$c(params) {
28736
+ const XML_NODE_NAME$4 = "wp:inline";
28737
+ const SD_NODE_NAME$4 = ["image"];
28738
+ const validXmlAttributes$4 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28739
+ function encode$b(params) {
28740
28740
  const { node } = params.extraParams;
28741
28741
  if (!node || !node.type) {
28742
28742
  return null;
28743
28743
  }
28744
28744
  return handleInlineNode(params);
28745
28745
  }
28746
- function decode$c(params) {
28746
+ function decode$b(params) {
28747
28747
  const { node } = params;
28748
28748
  if (!node || !node.type) {
28749
28749
  return null;
28750
28750
  }
28751
28751
  return translateInlineNode(params);
28752
28752
  }
28753
- const config$5 = {
28754
- xmlName: XML_NODE_NAME$5,
28755
- sdNodeOrKeyName: SD_NODE_NAME$5,
28753
+ const config$4 = {
28754
+ xmlName: XML_NODE_NAME$4,
28755
+ sdNodeOrKeyName: SD_NODE_NAME$4,
28756
28756
  type: NodeTranslator.translatorTypes.NODE,
28757
- encode: encode$c,
28758
- decode: decode$c,
28759
- attributes: validXmlAttributes$5
28757
+ encode: encode$b,
28758
+ decode: decode$b,
28759
+ attributes: validXmlAttributes$4
28760
28760
  };
28761
- const translator$5 = NodeTranslator.from(config$5);
28762
- const XML_NODE_NAME$4 = "w:drawing";
28763
- const SD_NODE_NAME$4 = [];
28764
- const validXmlAttributes$4 = [];
28765
- function encode$b(params) {
28761
+ const translator$4 = NodeTranslator.from(config$4);
28762
+ const XML_NODE_NAME$3 = "w:drawing";
28763
+ const SD_NODE_NAME$3 = [];
28764
+ const validXmlAttributes$3 = [];
28765
+ function encode$a(params) {
28766
28766
  const nodes = params.nodes;
28767
28767
  const node = nodes[0];
28768
28768
  const translatorByChildName = {
28769
- "wp:anchor": translator$6,
28770
- "wp:inline": translator$5
28769
+ "wp:anchor": translator$5,
28770
+ "wp:inline": translator$4
28771
28771
  };
28772
28772
  return node.elements.reduce((acc, child) => {
28773
28773
  if (acc) return acc;
@@ -28776,12 +28776,12 @@ function encode$b(params) {
28776
28776
  return translator2.encode({ ...params, extraParams: { node: child } }) || acc;
28777
28777
  }, null);
28778
28778
  }
28779
- function decode$b(params) {
28779
+ function decode$a(params) {
28780
28780
  const { node } = params;
28781
28781
  if (!node || !node.type) {
28782
28782
  return null;
28783
28783
  }
28784
- const childTranslator = node.attrs.isAnchor ? translator$6 : translator$5;
28784
+ const childTranslator = node.attrs.isAnchor ? translator$5 : translator$4;
28785
28785
  const resultNode = childTranslator.decode(params);
28786
28786
  return wrapTextInRun(
28787
28787
  {
@@ -28791,15 +28791,15 @@ function decode$b(params) {
28791
28791
  []
28792
28792
  );
28793
28793
  }
28794
- const config$4 = {
28795
- xmlName: XML_NODE_NAME$4,
28796
- sdNodeOrKeyName: SD_NODE_NAME$4,
28794
+ const config$3 = {
28795
+ xmlName: XML_NODE_NAME$3,
28796
+ sdNodeOrKeyName: SD_NODE_NAME$3,
28797
28797
  type: NodeTranslator.translatorTypes.NODE,
28798
- encode: encode$b,
28799
- decode: decode$b,
28800
- attributes: validXmlAttributes$4
28798
+ encode: encode$a,
28799
+ decode: decode$a,
28800
+ attributes: validXmlAttributes$3
28801
28801
  };
28802
- const translator$4 = NodeTranslator.from(config$4);
28802
+ const translator$3 = NodeTranslator.from(config$3);
28803
28803
  class CommandService {
28804
28804
  /**
28805
28805
  * @param {import('./commands/types/index.js').CommandServiceOptions} props
@@ -30137,7 +30137,7 @@ function prepareTextAnnotation(params) {
30137
30137
  return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params);
30138
30138
  }
30139
30139
  function prepareImageAnnotation(params, imageSize) {
30140
- return translator$4.decode({
30140
+ return translator$3.decode({
30141
30141
  ...params,
30142
30142
  imageSize
30143
30143
  });
@@ -30374,10 +30374,10 @@ function translateStructuredContent(params) {
30374
30374
  };
30375
30375
  return result;
30376
30376
  }
30377
- const XML_NODE_NAME$3 = "w:sdt";
30378
- const SD_NODE_NAME$3 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
30379
- const validXmlAttributes$3 = [];
30380
- function encode$a(params) {
30377
+ const XML_NODE_NAME$2 = "w:sdt";
30378
+ const SD_NODE_NAME$2 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
30379
+ const validXmlAttributes$2 = [];
30380
+ function encode$9(params) {
30381
30381
  const nodes = params.nodes;
30382
30382
  const node = nodes[0];
30383
30383
  const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
@@ -30387,7 +30387,7 @@ function encode$a(params) {
30387
30387
  const result = handler2(params);
30388
30388
  return result;
30389
30389
  }
30390
- function decode$a(params) {
30390
+ function decode$9(params) {
30391
30391
  const { node } = params;
30392
30392
  if (!node || !node.type) {
30393
30393
  return null;
@@ -30403,85 +30403,85 @@ function decode$a(params) {
30403
30403
  const result = decoder();
30404
30404
  return result;
30405
30405
  }
30406
- const config$3 = {
30407
- xmlName: XML_NODE_NAME$3,
30408
- sdNodeOrKeyName: SD_NODE_NAME$3,
30406
+ const config$2 = {
30407
+ xmlName: XML_NODE_NAME$2,
30408
+ sdNodeOrKeyName: SD_NODE_NAME$2,
30409
30409
  type: NodeTranslator.translatorTypes.NODE,
30410
- encode: encode$a,
30411
- decode: decode$a,
30412
- attributes: validXmlAttributes$3
30410
+ encode: encode$9,
30411
+ decode: decode$9,
30412
+ attributes: validXmlAttributes$2
30413
30413
  };
30414
- const translator$3 = NodeTranslator.from(config$3);
30415
- const encode$9 = (attributes) => {
30414
+ const translator$2 = NodeTranslator.from(config$2);
30415
+ const encode$8 = (attributes) => {
30416
30416
  return attributes["w:id"];
30417
30417
  };
30418
- const decode$9 = (attrs) => {
30418
+ const decode$8 = (attrs) => {
30419
30419
  return attrs.id;
30420
30420
  };
30421
30421
  const attrConfig$6 = Object.freeze({
30422
30422
  xmlName: "w:id",
30423
30423
  sdName: "id",
30424
- encode: encode$9,
30425
- decode: decode$9
30424
+ encode: encode$8,
30425
+ decode: decode$8
30426
30426
  });
30427
- const encode$8 = (attributes) => {
30427
+ const encode$7 = (attributes) => {
30428
30428
  return attributes["w:name"];
30429
30429
  };
30430
- const decode$8 = (attrs) => {
30430
+ const decode$7 = (attrs) => {
30431
30431
  return attrs.name;
30432
30432
  };
30433
30433
  const attrConfig$5 = Object.freeze({
30434
30434
  xmlName: "w:name",
30435
30435
  sdName: "name",
30436
- encode: encode$8,
30437
- decode: decode$8
30436
+ encode: encode$7,
30437
+ decode: decode$7
30438
30438
  });
30439
- const encode$7 = (attributes) => {
30439
+ const encode$6 = (attributes) => {
30440
30440
  return attributes["w:colFirst"];
30441
30441
  };
30442
- const decode$7 = (attrs) => {
30442
+ const decode$6 = (attrs) => {
30443
30443
  return attrs.colFirst;
30444
30444
  };
30445
30445
  const attrConfig$4 = Object.freeze({
30446
30446
  xmlName: "w:colFirst",
30447
30447
  sdName: "colFirst",
30448
- encode: encode$7,
30449
- decode: decode$7
30448
+ encode: encode$6,
30449
+ decode: decode$6
30450
30450
  });
30451
- const encode$6 = (attributes) => {
30451
+ const encode$5 = (attributes) => {
30452
30452
  return attributes["w:colLast"];
30453
30453
  };
30454
- const decode$6 = (attrs) => {
30454
+ const decode$5 = (attrs) => {
30455
30455
  return attrs.colLast;
30456
30456
  };
30457
30457
  const attrConfig$3 = Object.freeze({
30458
30458
  xmlName: "w:colLast",
30459
30459
  sdName: "colLast",
30460
- encode: encode$6,
30461
- decode: decode$6
30460
+ encode: encode$5,
30461
+ decode: decode$5
30462
30462
  });
30463
- const encode$5 = (attributes) => {
30463
+ const encode$4 = (attributes) => {
30464
30464
  return attributes["w:displacedByCustomXml"];
30465
30465
  };
30466
- const decode$5 = (attrs) => {
30466
+ const decode$4 = (attrs) => {
30467
30467
  return attrs.displacedByCustomXml;
30468
30468
  };
30469
30469
  const attrConfig$2 = Object.freeze({
30470
30470
  xmlName: "w:displacedByCustomXml",
30471
30471
  sdName: "displacedByCustomXml",
30472
- encode: encode$5,
30473
- decode: decode$5
30472
+ encode: encode$4,
30473
+ decode: decode$4
30474
30474
  });
30475
- const validXmlAttributes$2 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
30476
- const XML_NODE_NAME$2 = "w:bookmarkStart";
30477
- const SD_NODE_NAME$2 = "bookmarkStart";
30478
- const encode$4 = (params, encodedAttrs = {}) => {
30475
+ const validXmlAttributes$1 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
30476
+ const XML_NODE_NAME$1 = "w:bookmarkStart";
30477
+ const SD_NODE_NAME$1 = "bookmarkStart";
30478
+ const encode$3 = (params, encodedAttrs = {}) => {
30479
30479
  return {
30480
30480
  type: "bookmarkStart",
30481
30481
  attrs: encodedAttrs
30482
30482
  };
30483
30483
  };
30484
- const decode$4 = (params, decodedAttrs = {}) => {
30484
+ const decode$3 = (params, decodedAttrs = {}) => {
30485
30485
  const result = {
30486
30486
  name: "w:bookmarkStart",
30487
30487
  elements: []
@@ -30491,49 +30491,49 @@ const decode$4 = (params, decodedAttrs = {}) => {
30491
30491
  }
30492
30492
  return result;
30493
30493
  };
30494
- const config$2 = {
30495
- xmlName: XML_NODE_NAME$2,
30496
- sdNodeOrKeyName: SD_NODE_NAME$2,
30494
+ const config$1 = {
30495
+ xmlName: XML_NODE_NAME$1,
30496
+ sdNodeOrKeyName: SD_NODE_NAME$1,
30497
30497
  type: NodeTranslator.translatorTypes.NODE,
30498
- encode: encode$4,
30499
- decode: decode$4,
30500
- attributes: validXmlAttributes$2
30498
+ encode: encode$3,
30499
+ decode: decode$3,
30500
+ attributes: validXmlAttributes$1
30501
30501
  };
30502
- const translator$2 = NodeTranslator.from(config$2);
30503
- const encode$3 = (attributes) => {
30502
+ const translator$1 = NodeTranslator.from(config$1);
30503
+ const encode$2 = (attributes) => {
30504
30504
  return attributes["w:id"];
30505
30505
  };
30506
- const decode$3 = (attrs) => {
30506
+ const decode$2 = (attrs) => {
30507
30507
  return attrs.id;
30508
30508
  };
30509
30509
  const attrConfig$1 = Object.freeze({
30510
30510
  xmlName: "w:id",
30511
30511
  sdName: "id",
30512
- encode: encode$3,
30513
- decode: decode$3
30512
+ encode: encode$2,
30513
+ decode: decode$2
30514
30514
  });
30515
- const encode$2 = (attributes) => {
30515
+ const encode$1 = (attributes) => {
30516
30516
  return attributes["w:displacedByCustomXml"];
30517
30517
  };
30518
- const decode$2 = (attrs) => {
30518
+ const decode$1 = (attrs) => {
30519
30519
  return attrs.displacedByCustomXml;
30520
30520
  };
30521
30521
  const attrConfig = Object.freeze({
30522
30522
  xmlName: "w:displacedByCustomXml",
30523
30523
  sdName: "displacedByCustomXml",
30524
- encode: encode$2,
30525
- decode: decode$2
30524
+ encode: encode$1,
30525
+ decode: decode$1
30526
30526
  });
30527
- const validXmlAttributes$1 = [attrConfig$1, attrConfig];
30528
- const XML_NODE_NAME$1 = "w:bookmarkEnd";
30529
- const SD_NODE_NAME$1 = "bookmarkEnd";
30530
- const encode$1 = (params, encodedAttrs = {}) => {
30527
+ const validXmlAttributes = [attrConfig$1, attrConfig];
30528
+ const XML_NODE_NAME = "w:bookmarkEnd";
30529
+ const SD_NODE_NAME = "bookmarkEnd";
30530
+ const encode = (params, encodedAttrs = {}) => {
30531
30531
  return {
30532
30532
  type: "bookmarkEnd",
30533
30533
  attrs: encodedAttrs
30534
30534
  };
30535
30535
  };
30536
- const decode$1 = (params, decodedAttrs = {}) => {
30536
+ const decode = (params, decodedAttrs = {}) => {
30537
30537
  const result = {
30538
30538
  name: "w:bookmarkEnd",
30539
30539
  elements: []
@@ -30543,55 +30543,6 @@ const decode$1 = (params, decodedAttrs = {}) => {
30543
30543
  }
30544
30544
  return result;
30545
30545
  };
30546
- const config$1 = {
30547
- xmlName: XML_NODE_NAME$1,
30548
- sdNodeOrKeyName: SD_NODE_NAME$1,
30549
- type: NodeTranslator.translatorTypes.NODE,
30550
- encode: encode$1,
30551
- decode: decode$1,
30552
- attributes: validXmlAttributes$1
30553
- };
30554
- const translator$1 = NodeTranslator.from(config$1);
30555
- const XML_NODE_NAME = "mc:AlternateContent";
30556
- const SD_NODE_NAME = [];
30557
- const validXmlAttributes = [];
30558
- function encode(params) {
30559
- const { nodeListHandler } = params;
30560
- const { node } = params.extraParams;
30561
- if (!node || !node.type) {
30562
- return null;
30563
- }
30564
- const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
30565
- const wpsNode = node.elements.find(
30566
- (el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
30567
- );
30568
- if (!wpsNode) {
30569
- return null;
30570
- }
30571
- const contents = wpsNode.elements;
30572
- return nodeListHandler.handler({
30573
- ...params,
30574
- nodes: contents,
30575
- path: [...params.path || [], wpsNode]
30576
- });
30577
- }
30578
- function decode(params) {
30579
- const { node } = params;
30580
- const { drawingContent } = node.attrs;
30581
- const drawing = {
30582
- name: "w:drawing",
30583
- elements: [...drawingContent ? [...drawingContent.elements || []] : []]
30584
- };
30585
- const choice = {
30586
- name: "mc:Choice",
30587
- attributes: { Requires: "wps" },
30588
- elements: [drawing]
30589
- };
30590
- return {
30591
- name: "mc:AlternateContent",
30592
- elements: [choice]
30593
- };
30594
- }
30595
30546
  const config = {
30596
30547
  xmlName: XML_NODE_NAME,
30597
30548
  sdNodeOrKeyName: SD_NODE_NAME,
@@ -30615,30 +30566,30 @@ function exportSchemaToJson(params) {
30615
30566
  doc: translateDocumentNode,
30616
30567
  body: translateBodyNode,
30617
30568
  heading: translateHeadingNode,
30618
- paragraph: translator$13,
30619
- run: translator$U,
30569
+ paragraph: translator$12,
30570
+ run: translator$T,
30620
30571
  text: translateTextNode,
30621
30572
  bulletList: translateList,
30622
30573
  orderedList: translateList,
30623
- lineBreak: translator$16,
30624
- table: translator$9,
30625
- tableRow: translator$G,
30626
- tableCell: translator$8,
30627
- bookmarkStart: translator$2,
30628
- bookmarkEnd: translator$1,
30629
- fieldAnnotation: translator$3,
30630
- tab: translator$14,
30631
- image: translator$4,
30632
- hardBreak: translator$16,
30574
+ lineBreak: translator$15,
30575
+ table: translator$8,
30576
+ tableRow: translator$F,
30577
+ tableCell: translator$7,
30578
+ bookmarkStart: translator$1,
30579
+ bookmarkEnd: translator,
30580
+ fieldAnnotation: translator$2,
30581
+ tab: translator$13,
30582
+ image: translator$3,
30583
+ hardBreak: translator$15,
30633
30584
  commentRangeStart: () => translateCommentNode(params, "Start"),
30634
30585
  commentRangeEnd: () => translateCommentNode(params, "End"),
30635
30586
  commentReference: () => null,
30636
30587
  shapeContainer: translateShapeContainer,
30637
30588
  shapeTextbox: translateShapeTextbox,
30638
30589
  contentBlock: translateContentBlock,
30639
- structuredContent: translator$3,
30640
- structuredContentBlock: translator$3,
30641
- documentSection: translator$3,
30590
+ structuredContent: translator$2,
30591
+ structuredContentBlock: translator$2,
30592
+ documentSection: translator$2,
30642
30593
  "page-number": translatePageNumberNode,
30643
30594
  "total-page-number": translateTotalPageNumberNode
30644
30595
  };
@@ -30977,7 +30928,7 @@ function translateTextNode(params) {
30977
30928
  const isTrackedNode = node.marks?.some((m2) => trackedMarks.includes(m2.type));
30978
30929
  if (isTrackedNode) return translateTrackedNode(params);
30979
30930
  const isLinkNode = node.marks?.some((m2) => m2.type === "link");
30980
- if (isLinkNode) return translator$7.decode(params);
30931
+ if (isLinkNode) return translator$6.decode(params);
30981
30932
  const { text, marks = [] } = node;
30982
30933
  return getTextNodeForExport(text, marks, params);
30983
30934
  }
@@ -31283,7 +31234,7 @@ function translateMark(mark) {
31283
31234
  markElement.type = "element";
31284
31235
  break;
31285
31236
  case "underline": {
31286
- const translated = translator$10.decode({
31237
+ const translated = translator$$.decode({
31287
31238
  node: {
31288
31239
  attrs: {
31289
31240
  underlineType: attrs.underlineType ?? attrs.underline ?? null,
@@ -31347,7 +31298,7 @@ function translateMark(mark) {
31347
31298
  break;
31348
31299
  case "highlight": {
31349
31300
  const highlightValue = attrs.color ?? attrs.highlight ?? null;
31350
- const translated = translator$15.decode({ node: { attrs: { highlight: highlightValue } } });
31301
+ const translated = translator$14.decode({ node: { attrs: { highlight: highlightValue } } });
31351
31302
  return translated || {};
31352
31303
  }
31353
31304
  }
@@ -31403,11 +31354,23 @@ function translateShapeTextbox(params) {
31403
31354
  }
31404
31355
  function translateContentBlock(params) {
31405
31356
  const { node } = params;
31406
- const { vmlAttributes, horizontalRule } = node.attrs;
31357
+ const { drawingContent, vmlAttributes, horizontalRule } = node.attrs;
31407
31358
  if (vmlAttributes || horizontalRule) {
31408
31359
  return translateVRectContentBlock(params);
31409
31360
  }
31410
- const alternateContent = translator.decode(params);
31361
+ const drawing = {
31362
+ name: "w:drawing",
31363
+ elements: [...drawingContent ? [...drawingContent.elements || []] : []]
31364
+ };
31365
+ const choice = {
31366
+ name: "mc:Choice",
31367
+ attributes: { Requires: "wps" },
31368
+ elements: [drawing]
31369
+ };
31370
+ const alternateContent = {
31371
+ name: "mc:AlternateContent",
31372
+ elements: [choice]
31373
+ };
31411
31374
  return wrapTextInRun(alternateContent);
31412
31375
  }
31413
31376
  function translateVRectContentBlock(params) {
@@ -31611,7 +31574,7 @@ const handleDrawingNode = (params) => {
31611
31574
  if (mainNode.name === "w:drawing") node = mainNode;
31612
31575
  else node = mainNode.elements.find((el) => el.name === "w:drawing");
31613
31576
  if (!node) return { nodes: [], consumed: 0 };
31614
- const schemaNode = translator$4.encode(params);
31577
+ const schemaNode = translator$3.encode(params);
31615
31578
  const newNodes = schemaNode ? [schemaNode] : [];
31616
31579
  return { nodes: newNodes, consumed: 1 };
31617
31580
  };
@@ -31713,8 +31676,8 @@ const trackChangeNodeHandlerEntity = {
31713
31676
  handlerName: "trackChangeNodeHandler",
31714
31677
  handler: handleTrackChangeNode
31715
31678
  };
31716
- const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$7);
31717
- const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$U);
31679
+ const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$6);
31680
+ const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$T);
31718
31681
  const handleTextNode = (params) => {
31719
31682
  const { nodes, insideTrackChange } = params;
31720
31683
  if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
@@ -31755,7 +31718,7 @@ const handleParagraphNode = (params) => {
31755
31718
  if (nodes.length === 0 || nodes[0].name !== "w:p") {
31756
31719
  return { nodes: [], consumed: 0 };
31757
31720
  }
31758
- const schemaNode = translator$13.encode(params);
31721
+ const schemaNode = translator$12.encode(params);
31759
31722
  const newNodes = schemaNode ? [schemaNode] : [];
31760
31723
  return { nodes: newNodes, consumed: 1 };
31761
31724
  };
@@ -31768,7 +31731,7 @@ const handleSdtNode = (params) => {
31768
31731
  if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
31769
31732
  return { nodes: [], consumed: 0 };
31770
31733
  }
31771
- const result = translator$3.encode(params);
31734
+ const result = translator$2.encode(params);
31772
31735
  if (!result) {
31773
31736
  return { nodes: [], consumed: 0 };
31774
31737
  }
@@ -31858,7 +31821,7 @@ const handler = (params) => {
31858
31821
  if (nodes.length === 0 || nodes[0].name !== "w:br") {
31859
31822
  return { nodes: [], consumed: 0 };
31860
31823
  }
31861
- const result = translator$16.encode(params);
31824
+ const result = translator$15.encode(params);
31862
31825
  if (!result) return { nodes: [], consumed: 0 };
31863
31826
  return {
31864
31827
  nodes: [result],
@@ -31930,7 +31893,7 @@ const handleBookmarkStartNode = (params) => {
31930
31893
  if (isCustomMarkBookmark(nodes[0], params.editor)) {
31931
31894
  return handleBookmarkNode(params);
31932
31895
  }
31933
- const node = translator$2.encode(params);
31896
+ const node = translator$1.encode(params);
31934
31897
  if (!node) return { nodes: [], consumed: 0 };
31935
31898
  return { nodes: [node], consumed: 1 };
31936
31899
  };
@@ -31962,7 +31925,7 @@ const handleBookmarkEndNode = (params) => {
31962
31925
  if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
31963
31926
  return { nodes: [], consumed: 0 };
31964
31927
  }
31965
- const node = translator$1.encode(params);
31928
+ const node = translator.encode(params);
31966
31929
  if (!node) return { nodes: [], consumed: 0 };
31967
31930
  return { nodes: [node], consumed: 1 };
31968
31931
  };
@@ -31970,86 +31933,32 @@ const bookmarkEndNodeHandlerEntity = {
31970
31933
  handlerName: "w:bookmarkEndTranslator",
31971
31934
  handler: handleBookmarkEndNode
31972
31935
  };
31973
- const ALTERNATE_CONTENT_NODE = "mc:AlternateContent";
31974
- const SUPPORTED_REQUIRES = /* @__PURE__ */ new Set([
31975
- "wps",
31976
- "wp14",
31977
- "w14",
31978
- "w15",
31979
- "w16",
31980
- "w16cex",
31981
- "w16cid",
31982
- "w16du",
31983
- "w16sdtdh",
31984
- "w16sdtfl",
31985
- "w16se"
31986
- ]);
31987
- const skipHandlerResponse = { nodes: [], consumed: 0 };
31988
- const isAlternateContentNode = (node) => node?.name === ALTERNATE_CONTENT_NODE;
31989
- const isSupportedChoice = (choice) => {
31990
- if (!choice?.attributes) return false;
31991
- const requires = choice.attributes.Requires || choice.attributes.requires;
31992
- if (!requires) return false;
31993
- return requires.split(/\s+/).filter(Boolean).some((namespace) => SUPPORTED_REQUIRES.has(namespace));
31994
- };
31995
- const resolveAlternateContentElements = (alternateContent) => {
31996
- if (!alternateContent?.elements?.length) return null;
31997
- const choices = alternateContent.elements.filter((el) => el.name === "mc:Choice");
31998
- const fallback = alternateContent.elements.find((el) => el.name === "mc:Fallback");
31999
- const supportedChoice = choices.find(isSupportedChoice);
32000
- const selectedElements = supportedChoice?.elements || fallback?.elements || choices[0]?.elements;
32001
- if (!selectedElements) return null;
32002
- return carbonCopy(selectedElements);
32003
- };
32004
- const buildNodeWithoutAlternateContent = (node) => {
32005
- const { elements } = node || {};
32006
- if (!elements?.length) return null;
32007
- let replaced = false;
32008
- const updatedElements = [];
32009
- elements.forEach((element) => {
32010
- if (isAlternateContentNode(element)) {
32011
- const resolved = resolveAlternateContentElements(element);
32012
- if (resolved) {
32013
- updatedElements.push(...resolved);
32014
- replaced = true;
32015
- return;
32016
- }
32017
- updatedElements.push(carbonCopy(element));
32018
- return;
32019
- }
32020
- updatedElements.push(carbonCopy(element));
32021
- });
32022
- if (!replaced) return null;
32023
- const clone = carbonCopy(node);
32024
- clone.elements = updatedElements;
32025
- return clone;
32026
- };
32027
31936
  const handleAlternateChoice = (params) => {
31937
+ const skipHandlerResponse = { nodes: [], consumed: 0 };
32028
31938
  const { nodes, nodeListHandler } = params;
32029
- if (!nodes?.length) {
31939
+ if (nodes.length === 0 || nodes[0].name !== "w:p") {
32030
31940
  return skipHandlerResponse;
32031
31941
  }
32032
- const [currentNode] = nodes;
32033
- if (isAlternateContentNode(currentNode)) {
32034
- const resolvedElements = resolveAlternateContentElements(currentNode);
32035
- if (!resolvedElements) {
32036
- return skipHandlerResponse;
32037
- }
32038
- const result2 = nodeListHandler.handler({
32039
- ...params,
32040
- nodes: resolvedElements,
32041
- path: [...params.path || [], currentNode]
32042
- });
32043
- return { nodes: result2, consumed: 1 };
31942
+ const mainNode = nodes[0];
31943
+ const node = mainNode?.elements?.find((el) => el.name === "w:r");
31944
+ const hasAltChoice = node?.elements?.some((el) => el.name === "mc:AlternateContent");
31945
+ if (!hasAltChoice) {
31946
+ return skipHandlerResponse;
32044
31947
  }
32045
- const sanitizedNode = buildNodeWithoutAlternateContent(currentNode);
32046
- if (!sanitizedNode) {
31948
+ const altChoiceNode = node.elements.find((el) => el.name === "mc:AlternateContent");
31949
+ node.elements.findIndex((el) => el.name === "mc:AlternateContent");
31950
+ const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
31951
+ const wpsNode = altChoiceNode.elements.find(
31952
+ (el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
31953
+ );
31954
+ if (!wpsNode) {
32047
31955
  return skipHandlerResponse;
32048
31956
  }
31957
+ const contents = wpsNode.elements;
32049
31958
  const result = nodeListHandler.handler({
32050
31959
  ...params,
32051
- nodes: [sanitizedNode],
32052
- path: [...params.path || [], sanitizedNode]
31960
+ nodes: contents,
31961
+ path: [...params.path || [], wpsNode]
32053
31962
  });
32054
31963
  return { nodes: result, consumed: 1 };
32055
31964
  };
@@ -32655,7 +32564,7 @@ const handleTabNode = (params) => {
32655
32564
  if (!nodes.length || nodes[0].name !== "w:tab") {
32656
32565
  return { nodes: [], consumed: 0 };
32657
32566
  }
32658
- const node = translator$14.encode(params);
32567
+ const node = translator$13.encode(params);
32659
32568
  return { nodes: [node], consumed: 1 };
32660
32569
  };
32661
32570
  const tabNodeEntityHandler = {
@@ -33768,7 +33677,7 @@ export {
33768
33677
  objectIncludes as Z,
33769
33678
  AddMarkStep as _,
33770
33679
  Plugin as a,
33771
- translator$M as a$,
33680
+ translator$R as a$,
33772
33681
  twipsToLines as a0,
33773
33682
  pixelsToTwips as a1,
33774
33683
  helpers as a2,
@@ -33783,29 +33692,29 @@ export {
33783
33692
  handleClipboardPaste as aB,
33784
33693
  getFileObject as aC,
33785
33694
  runPropertyTranslators as aD,
33786
- translator$5 as aE,
33787
- translator$6 as aF,
33788
- translator$I as aG,
33789
- translator$J as aH,
33790
- translator$10 as aI,
33791
- translator$H as aJ,
33792
- translator$K as aK,
33793
- translator$G as aL,
33794
- translator$g as aM,
33795
- translator$8 as aN,
33796
- translator$t as aO,
33797
- translator$u as aP,
33798
- translator$v as aQ,
33799
- translator$w as aR,
33800
- translator$x as aS,
33801
- translator$c as aT,
33802
- translator$y as aU,
33803
- translator$z as aV,
33804
- translator$A as aW,
33805
- translator$B as aX,
33806
- translator$L as aY,
33807
- translator$a as aZ,
33808
- translator$C as a_,
33695
+ translator as aE,
33696
+ translator$1 as aF,
33697
+ translator$4 as aG,
33698
+ translator$5 as aH,
33699
+ translator$H as aI,
33700
+ translator$I as aJ,
33701
+ translator$G as aK,
33702
+ translator$J as aL,
33703
+ translator$F as aM,
33704
+ translator$7 as aN,
33705
+ translator$K as aO,
33706
+ translator$L as aP,
33707
+ translator$13 as aQ,
33708
+ translator$2 as aR,
33709
+ translator$U as aS,
33710
+ translator$T as aT,
33711
+ translator$12 as aU,
33712
+ translator$M as aV,
33713
+ translator$6 as aW,
33714
+ translator$N as aX,
33715
+ translator$O as aY,
33716
+ translator$P as aZ,
33717
+ translator$Q as a_,
33809
33718
  hasSomeParentWithClass as aa,
33810
33719
  isActive as ab,
33811
33720
  unflattenListsInHtml as ac,
@@ -33833,48 +33742,9 @@ export {
33833
33742
  vClickOutside as ay,
33834
33743
  getActiveFormatting as az,
33835
33744
  Slice as b,
33836
- translator$d as b0,
33837
- translator$D as b1,
33838
- translator$e as b2,
33839
- translator$9 as b3,
33840
- translator$14 as b4,
33841
- translator$W as b5,
33842
- translator$X as b6,
33843
- translator$$ as b7,
33844
- translator$i as b8,
33845
- translator$E as b9,
33846
- translator$2 as bA,
33847
- translator$1 as bB,
33848
- translator$F as bC,
33849
- translator$12 as bD,
33850
- translator as bE,
33851
- _sfc_main as bF,
33852
- translator$3 as ba,
33853
- translator$k as bb,
33854
- translator$Y as bc,
33855
- translator$V as bd,
33856
- translator$Z as be,
33857
- translator$U as bf,
33858
- translator$13 as bg,
33859
- translator$m as bh,
33860
- translator$N as bi,
33861
- translator$n as bj,
33862
- translator$o as bk,
33863
- translator$11 as bl,
33864
- translator$7 as bm,
33865
- translator$15 as bn,
33866
- translator$O as bo,
33867
- translator$b as bp,
33868
- translator$P as bq,
33869
- translator$Q as br,
33870
- translator$q as bs,
33871
- translator$4 as bt,
33872
- translator$R as bu,
33873
- translator$_ as bv,
33874
- translator$S as bw,
33875
- translator$T as bx,
33876
- translator$16 as by,
33877
- translator$s as bz,
33745
+ translator$S as b0,
33746
+ translator$15 as b1,
33747
+ _sfc_main as b2,
33878
33748
  DOMParser$1 as c,
33879
33749
  Mark as d,
33880
33750
  dropPoint as e,