@harbour-enterprises/superdoc 0.21.0-next.4 → 0.21.0-next.6

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 (36) hide show
  1. package/dist/chunks/{PdfViewer-OZDJ7gwT.cjs → PdfViewer-BrJSIJjF.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-D3zo7tPo.es.js → PdfViewer-CJAEtjUD.es.js} +1 -1
  3. package/dist/chunks/{index-MzW5BVNd.es.js → index-BDfKQQiO.es.js} +4 -3
  4. package/dist/chunks/{index-CfYf4T_z.cjs → index-NiOytIlp.cjs} +4 -3
  5. package/dist/chunks/{super-editor.es-U-GVCd_F.cjs → super-editor.es-DmkkMNKU.cjs} +2015 -787
  6. package/dist/chunks/{super-editor.es-Bntob7Wd.es.js → super-editor.es-iVTtEcot.es.js} +2015 -787
  7. package/dist/core/types/index.d.ts +8 -0
  8. package/dist/core/types/index.d.ts.map +1 -1
  9. package/dist/style.css +43 -38
  10. package/dist/super-editor/ai-writer.es.js +2 -2
  11. package/dist/super-editor/chunks/{converter-3xnF_NHq.js → converter-CYC0HBJe.js} +733 -642
  12. package/dist/super-editor/chunks/{docx-zipper-CZdELYi-.js → docx-zipper-DlwteneT.js} +1 -1
  13. package/dist/super-editor/chunks/{editor-BqYH4kDD.js → editor-BzT9rpXb.js} +59 -13
  14. package/dist/super-editor/chunks/{toolbar-TkaE2kKM.js → toolbar-BnTHDmlP.js} +6 -7
  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 +5 -1
  20. package/dist/super-editor/src/components/slash-menu/tests/testHelpers.d.ts +466 -0
  21. package/dist/super-editor/src/components/slash-menu/utils.d.ts +9 -2
  22. package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/alternate-content-translator.d.ts +6 -0
  23. package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/index.d.ts +1 -0
  24. package/dist/super-editor/src/extensions/noderesizer/helpers.d.ts +2 -0
  25. package/dist/super-editor/src/tests/helpers/helpers.d.ts +1 -0
  26. package/dist/super-editor/src/utils/shadow-root.d.ts +12 -0
  27. package/dist/super-editor/style.css +16 -11
  28. package/dist/super-editor/super-editor.es.js +1226 -134
  29. package/dist/super-editor/toolbar.es.js +2 -2
  30. package/dist/super-editor.cjs +1 -1
  31. package/dist/super-editor.es.js +1 -1
  32. package/dist/superdoc.cjs +2 -2
  33. package/dist/superdoc.es.js +2 -2
  34. package/dist/superdoc.umd.js +2017 -788
  35. package/dist/superdoc.umd.js.map +1 -1
  36. package/package.json +1 -1
@@ -24316,37 +24316,37 @@ const _NodeTranslator = class _NodeTranslator2 {
24316
24316
  };
24317
24317
  __publicField$2(_NodeTranslator, "translatorTypes", TranslatorTypes);
24318
24318
  let NodeTranslator = _NodeTranslator;
24319
- const encode$17 = (attributes) => {
24319
+ const encode$18 = (attributes) => {
24320
24320
  return attributes["w:type"];
24321
24321
  };
24322
- const decode$_ = (attrs) => {
24322
+ const decode$$ = (attrs) => {
24323
24323
  const { lineBreakType } = attrs;
24324
24324
  return lineBreakType;
24325
24325
  };
24326
24326
  const attrConfig$F = Object.freeze({
24327
24327
  xmlName: "w:type",
24328
24328
  sdName: "lineBreakType",
24329
- encode: encode$17,
24330
- decode: decode$_
24329
+ encode: encode$18,
24330
+ decode: decode$$
24331
24331
  });
24332
- const encode$16 = (attributes) => {
24332
+ const encode$17 = (attributes) => {
24333
24333
  const xmlAttrValue = attributes["w:clear"];
24334
24334
  return xmlAttrValue;
24335
24335
  };
24336
- const decode$Z = (attrs) => {
24336
+ const decode$_ = (attrs) => {
24337
24337
  const { clear } = attrs;
24338
24338
  return clear;
24339
24339
  };
24340
24340
  const attrConfig$E = Object.freeze({
24341
24341
  xmlName: "w:clear",
24342
24342
  sdName: "clear",
24343
- encode: encode$16,
24344
- decode: decode$Z
24343
+ encode: encode$17,
24344
+ decode: decode$_
24345
24345
  });
24346
- const validXmlAttributes$l = [attrConfig$F, attrConfig$E];
24347
- const XML_NODE_NAME$t = "w:br";
24348
- const SD_NODE_NAME$c = "lineBreak";
24349
- const encode$15 = (_2, encodedAttrs) => {
24346
+ const validXmlAttributes$m = [attrConfig$F, attrConfig$E];
24347
+ const XML_NODE_NAME$u = "w:br";
24348
+ const SD_NODE_NAME$d = "lineBreak";
24349
+ const encode$16 = (_2, encodedAttrs) => {
24350
24350
  const isPageBreak = encodedAttrs?.lineBreakType === "page";
24351
24351
  const translated = {
24352
24352
  type: isPageBreak ? "hardBreak" : "lineBreak"
@@ -24356,7 +24356,7 @@ const encode$15 = (_2, encodedAttrs) => {
24356
24356
  }
24357
24357
  return translated;
24358
24358
  };
24359
- const decode$Y = (params2, decodedAttrs) => {
24359
+ const decode$Z = (params2, decodedAttrs) => {
24360
24360
  const { node } = params2;
24361
24361
  if (!node) return;
24362
24362
  const wBreak = { name: "w:br" };
@@ -24373,39 +24373,39 @@ const decode$Y = (params2, decodedAttrs) => {
24373
24373
  };
24374
24374
  return translated;
24375
24375
  };
24376
- const config$r = {
24377
- xmlName: XML_NODE_NAME$t,
24378
- sdNodeOrKeyName: SD_NODE_NAME$c,
24376
+ const config$s = {
24377
+ xmlName: XML_NODE_NAME$u,
24378
+ sdNodeOrKeyName: SD_NODE_NAME$d,
24379
24379
  type: NodeTranslator.translatorTypes.NODE,
24380
- encode: encode$15,
24381
- decode: decode$Y,
24382
- attributes: validXmlAttributes$l
24380
+ encode: encode$16,
24381
+ decode: decode$Z,
24382
+ attributes: validXmlAttributes$m
24383
24383
  };
24384
- const translator$15 = NodeTranslator.from(config$r);
24385
- const encode$14 = (attributes) => attributes?.["w:val"];
24386
- const decode$X = (attrs) => attrs?.highlight;
24384
+ const translator$16 = NodeTranslator.from(config$s);
24385
+ const encode$15 = (attributes) => attributes?.["w:val"];
24386
+ const decode$Y = (attrs) => attrs?.highlight;
24387
24387
  const attrConfig$D = Object.freeze({
24388
24388
  xmlName: "w:val",
24389
24389
  sdName: "highlight",
24390
- encode: encode$14,
24391
- decode: decode$X
24390
+ encode: encode$15,
24391
+ decode: decode$Y
24392
24392
  });
24393
- const validXmlAttributes$k = [attrConfig$D];
24394
- const XML_NODE_NAME$s = "w:highlight";
24393
+ const validXmlAttributes$l = [attrConfig$D];
24394
+ const XML_NODE_NAME$t = "w:highlight";
24395
24395
  const SD_ATTR_KEY$f = "highlight";
24396
24396
  const DISABLED_TOKENS = /* @__PURE__ */ new Set(["transparent", "none", "inherit"]);
24397
- const encode$13 = (params2, encodedAttrs = {}) => {
24397
+ const encode$14 = (params2, encodedAttrs = {}) => {
24398
24398
  const { nodes } = params2;
24399
24399
  const node = nodes?.[0];
24400
24400
  const value = encodedAttrs.highlight ?? node?.attributes?.["w:val"];
24401
24401
  return {
24402
24402
  type: "attr",
24403
- xmlName: XML_NODE_NAME$s,
24403
+ xmlName: XML_NODE_NAME$t,
24404
24404
  sdNodeOrKeyName: SD_ATTR_KEY$f,
24405
24405
  attributes: { "w:val": value ?? null }
24406
24406
  };
24407
24407
  };
24408
- const decode$W = (params2) => {
24408
+ const decode$X = (params2) => {
24409
24409
  const attrs = params2?.node?.attrs || {};
24410
24410
  const highlightValue = attrs.highlight ?? attrs.color ?? null;
24411
24411
  if (!highlightValue) return void 0;
@@ -24413,14 +24413,14 @@ const decode$W = (params2) => {
24413
24413
  if (!normalizedValue) return void 0;
24414
24414
  if (DISABLED_TOKENS.has(normalizedValue)) {
24415
24415
  return {
24416
- name: XML_NODE_NAME$s,
24416
+ name: XML_NODE_NAME$t,
24417
24417
  attributes: { "w:val": "none" }
24418
24418
  };
24419
24419
  }
24420
24420
  const keyword = getDocxHighlightKeywordFromHex(highlightValue);
24421
24421
  if (keyword) {
24422
24422
  return {
24423
- name: XML_NODE_NAME$s,
24423
+ name: XML_NODE_NAME$t,
24424
24424
  attributes: { "w:val": keyword }
24425
24425
  };
24426
24426
  }
@@ -24435,63 +24435,63 @@ const decode$W = (params2) => {
24435
24435
  }
24436
24436
  };
24437
24437
  };
24438
- const config$q = {
24439
- xmlName: XML_NODE_NAME$s,
24438
+ const config$r = {
24439
+ xmlName: XML_NODE_NAME$t,
24440
24440
  sdNodeOrKeyName: SD_ATTR_KEY$f,
24441
24441
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
24442
- encode: encode$13,
24443
- decode: decode$W,
24444
- attributes: validXmlAttributes$k
24442
+ encode: encode$14,
24443
+ decode: decode$X,
24444
+ attributes: validXmlAttributes$l
24445
24445
  };
24446
- const translator$14 = NodeTranslator.from(config$q);
24447
- const encode$12 = (attributes) => {
24446
+ const translator$15 = NodeTranslator.from(config$r);
24447
+ const encode$13 = (attributes) => {
24448
24448
  return attributes["w:val"];
24449
24449
  };
24450
- const decode$V = (attrs) => {
24450
+ const decode$W = (attrs) => {
24451
24451
  const { tabSize } = attrs || {};
24452
24452
  return tabSize;
24453
24453
  };
24454
24454
  const attrConfig$C = Object.freeze({
24455
24455
  xmlName: "w:val",
24456
24456
  sdName: "tabSize",
24457
- encode: encode$12,
24458
- decode: decode$V
24457
+ encode: encode$13,
24458
+ decode: decode$W
24459
24459
  });
24460
- const encode$11 = (attributes) => {
24460
+ const encode$12 = (attributes) => {
24461
24461
  return attributes["w:leader"];
24462
24462
  };
24463
- const decode$U = (attrs) => {
24463
+ const decode$V = (attrs) => {
24464
24464
  const { leader } = attrs || {};
24465
24465
  return leader;
24466
24466
  };
24467
24467
  const attrConfig$B = Object.freeze({
24468
24468
  xmlName: "w:leader",
24469
24469
  sdName: "leader",
24470
- encode: encode$11,
24471
- decode: decode$U
24470
+ encode: encode$12,
24471
+ decode: decode$V
24472
24472
  });
24473
- const encode$10 = (attributes) => {
24473
+ const encode$11 = (attributes) => {
24474
24474
  return attributes["w:pos"];
24475
24475
  };
24476
- const decode$T = (attrs) => {
24476
+ const decode$U = (attrs) => {
24477
24477
  const { pos } = attrs || {};
24478
24478
  return pos;
24479
24479
  };
24480
24480
  const attrConfig$A = Object.freeze({
24481
24481
  xmlName: "w:pos",
24482
24482
  sdName: "pos",
24483
- encode: encode$10,
24484
- decode: decode$T
24483
+ encode: encode$11,
24484
+ decode: decode$U
24485
24485
  });
24486
- const validXmlAttributes$j = [attrConfig$C, attrConfig$A, attrConfig$B];
24487
- const XML_NODE_NAME$r = "w:tab";
24488
- const SD_NODE_NAME$b = "tab";
24489
- const encode$$ = (_2, encodedAttrs = {}) => {
24486
+ const validXmlAttributes$k = [attrConfig$C, attrConfig$A, attrConfig$B];
24487
+ const XML_NODE_NAME$s = "w:tab";
24488
+ const SD_NODE_NAME$c = "tab";
24489
+ const encode$10 = (_2, encodedAttrs = {}) => {
24490
24490
  const translated = { type: "tab" };
24491
24491
  if (encodedAttrs) translated.attrs = { ...encodedAttrs };
24492
24492
  return translated;
24493
24493
  };
24494
- const decode$S = (params2, decodedAttrs = {}) => {
24494
+ const decode$T = (params2, decodedAttrs = {}) => {
24495
24495
  const { node } = params2 || {};
24496
24496
  if (!node) return;
24497
24497
  const wTab = { name: "w:tab" };
@@ -24507,15 +24507,15 @@ const decode$S = (params2, decodedAttrs = {}) => {
24507
24507
  }
24508
24508
  return translated;
24509
24509
  };
24510
- const config$p = {
24511
- xmlName: XML_NODE_NAME$r,
24512
- sdNodeOrKeyName: SD_NODE_NAME$b,
24510
+ const config$q = {
24511
+ xmlName: XML_NODE_NAME$s,
24512
+ sdNodeOrKeyName: SD_NODE_NAME$c,
24513
24513
  type: NodeTranslator.translatorTypes.NODE,
24514
- encode: encode$$,
24515
- decode: decode$S,
24516
- attributes: validXmlAttributes$j
24514
+ encode: encode$10,
24515
+ decode: decode$T,
24516
+ attributes: validXmlAttributes$k
24517
24517
  };
24518
- const translator$13 = NodeTranslator.from(config$p);
24518
+ const translator$14 = NodeTranslator.from(config$q);
24519
24519
  const mergeTextNodes = (nodes) => {
24520
24520
  if (!nodes || !Array.isArray(nodes)) {
24521
24521
  return nodes;
@@ -25130,91 +25130,91 @@ const handleParagraphNode$1 = (params2) => {
25130
25130
  }
25131
25131
  return schemaNode;
25132
25132
  };
25133
- const encode$_ = (attributes) => {
25133
+ const encode$$ = (attributes) => {
25134
25134
  return attributes["w:rsidDel"];
25135
25135
  };
25136
- const decode$R = (attrs) => {
25136
+ const decode$S = (attrs) => {
25137
25137
  return attrs.rsidDel;
25138
25138
  };
25139
25139
  const attrConfig$z = Object.freeze({
25140
25140
  xmlName: "w:rsidDel",
25141
25141
  sdName: "rsidDel",
25142
- encode: encode$_,
25143
- decode: decode$R
25142
+ encode: encode$$,
25143
+ decode: decode$S
25144
25144
  });
25145
- const encode$Z = (attributes) => {
25145
+ const encode$_ = (attributes) => {
25146
25146
  return attributes["w:rsidP"];
25147
25147
  };
25148
- const decode$Q = (attrs) => {
25148
+ const decode$R = (attrs) => {
25149
25149
  return attrs.rsidP;
25150
25150
  };
25151
25151
  const attrConfig$y = Object.freeze({
25152
25152
  xmlName: "w:rsidP",
25153
25153
  sdName: "rsidP",
25154
- encode: encode$Z,
25155
- decode: decode$Q
25154
+ encode: encode$_,
25155
+ decode: decode$R
25156
25156
  });
25157
- const encode$Y = (attributes) => {
25157
+ const encode$Z = (attributes) => {
25158
25158
  return attributes["w:rsidR"];
25159
25159
  };
25160
- const decode$P = (attrs) => {
25160
+ const decode$Q = (attrs) => {
25161
25161
  return attrs.rsidR;
25162
25162
  };
25163
25163
  const attrConfig$x = Object.freeze({
25164
25164
  xmlName: "w:rsidR",
25165
25165
  sdName: "rsidR",
25166
- encode: encode$Y,
25167
- decode: decode$P
25166
+ encode: encode$Z,
25167
+ decode: decode$Q
25168
25168
  });
25169
- const encode$X = (attributes) => {
25169
+ const encode$Y = (attributes) => {
25170
25170
  return attributes["w:rsidRPr"];
25171
25171
  };
25172
- const decode$O = (attrs) => {
25172
+ const decode$P = (attrs) => {
25173
25173
  return attrs.rsidRPr;
25174
25174
  };
25175
25175
  const attrConfig$w = Object.freeze({
25176
25176
  xmlName: "w:rsidRPr",
25177
25177
  sdName: "rsidRPr",
25178
- encode: encode$X,
25179
- decode: decode$O
25178
+ encode: encode$Y,
25179
+ decode: decode$P
25180
25180
  });
25181
- const encode$W = (attributes) => {
25181
+ const encode$X = (attributes) => {
25182
25182
  return attributes["w:rsidRDefault"];
25183
25183
  };
25184
- const decode$N = (attrs) => {
25184
+ const decode$O = (attrs) => {
25185
25185
  return attrs.rsidRDefault;
25186
25186
  };
25187
25187
  const attrConfig$v = Object.freeze({
25188
25188
  xmlName: "w:rsidRDefault",
25189
25189
  sdName: "rsidRDefault",
25190
- encode: encode$W,
25191
- decode: decode$N
25190
+ encode: encode$X,
25191
+ decode: decode$O
25192
25192
  });
25193
- const encode$V = (attributes) => {
25193
+ const encode$W = (attributes) => {
25194
25194
  return attributes["w14:paraId"];
25195
25195
  };
25196
- const decode$M = (attrs) => {
25196
+ const decode$N = (attrs) => {
25197
25197
  return attrs.paraId;
25198
25198
  };
25199
25199
  const attrConfig$u = Object.freeze({
25200
25200
  xmlName: "w14:paraId",
25201
25201
  sdName: "paraId",
25202
- encode: encode$V,
25203
- decode: decode$M
25202
+ encode: encode$W,
25203
+ decode: decode$N
25204
25204
  });
25205
- const encode$U = (attributes) => {
25205
+ const encode$V = (attributes) => {
25206
25206
  return attributes["w14:textId"];
25207
25207
  };
25208
- const decode$L = (attrs) => {
25208
+ const decode$M = (attrs) => {
25209
25209
  return attrs.textId;
25210
25210
  };
25211
25211
  const attrConfig$t = Object.freeze({
25212
25212
  xmlName: "w14:textId",
25213
25213
  sdName: "textId",
25214
- encode: encode$U,
25215
- decode: decode$L
25214
+ encode: encode$V,
25215
+ decode: decode$M
25216
25216
  });
25217
- const validXmlAttributes$i = [
25217
+ const validXmlAttributes$j = [
25218
25218
  attrConfig$u,
25219
25219
  attrConfig$t,
25220
25220
  attrConfig$x,
@@ -25223,9 +25223,9 @@ const validXmlAttributes$i = [
25223
25223
  attrConfig$w,
25224
25224
  attrConfig$z
25225
25225
  ];
25226
- const XML_NODE_NAME$q = "w:p";
25227
- const SD_NODE_NAME$a = "paragraph";
25228
- const encode$T = (params2, encodedAttrs = {}) => {
25226
+ const XML_NODE_NAME$r = "w:p";
25227
+ const SD_NODE_NAME$b = "paragraph";
25228
+ const encode$U = (params2, encodedAttrs = {}) => {
25229
25229
  const node = handleParagraphNode$1(params2);
25230
25230
  if (!node) return void 0;
25231
25231
  if (encodedAttrs && Object.keys(encodedAttrs).length) {
@@ -25233,7 +25233,7 @@ const encode$T = (params2, encodedAttrs = {}) => {
25233
25233
  }
25234
25234
  return node;
25235
25235
  };
25236
- const decode$K = (params2, decodedAttrs = {}) => {
25236
+ const decode$L = (params2, decodedAttrs = {}) => {
25237
25237
  const translated = translateParagraphNode(params2);
25238
25238
  if (!translated) return void 0;
25239
25239
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
@@ -25241,16 +25241,16 @@ const decode$K = (params2, decodedAttrs = {}) => {
25241
25241
  }
25242
25242
  return translated;
25243
25243
  };
25244
- const config$o = {
25245
- xmlName: XML_NODE_NAME$q,
25246
- sdNodeOrKeyName: SD_NODE_NAME$a,
25244
+ const config$p = {
25245
+ xmlName: XML_NODE_NAME$r,
25246
+ sdNodeOrKeyName: SD_NODE_NAME$b,
25247
25247
  type: NodeTranslator.translatorTypes.NODE,
25248
- encode: encode$T,
25249
- decode: decode$K,
25250
- attributes: validXmlAttributes$i
25248
+ encode: encode$U,
25249
+ decode: decode$L,
25250
+ attributes: validXmlAttributes$j
25251
25251
  };
25252
- const translator$12 = NodeTranslator.from(config$o);
25253
- const encode$S = (attributes) => {
25252
+ const translator$13 = NodeTranslator.from(config$p);
25253
+ const encode$T = (attributes) => {
25254
25254
  const raw = attributes?.["w:val"];
25255
25255
  if (raw === void 0 || raw === null) return void 0;
25256
25256
  if (typeof raw === "boolean") return raw;
@@ -25260,20 +25260,20 @@ const encode$S = (attributes) => {
25260
25260
  if (val === "1" || val === "true" || val === "on") return true;
25261
25261
  return void 0;
25262
25262
  };
25263
- const decode$J = (runProps) => {
25263
+ const decode$K = (runProps) => {
25264
25264
  if (runProps?.bold === false) return "0";
25265
25265
  return void 0;
25266
25266
  };
25267
25267
  const attrConfig$s = Object.freeze({
25268
25268
  xmlName: "w:val",
25269
25269
  sdName: "bold",
25270
- encode: encode$S,
25271
- decode: decode$J
25270
+ encode: encode$T,
25271
+ decode: decode$K
25272
25272
  });
25273
- const validXmlAttributes$h = [attrConfig$s];
25274
- const XML_NODE_NAME$p = "w:b";
25273
+ const validXmlAttributes$i = [attrConfig$s];
25274
+ const XML_NODE_NAME$q = "w:b";
25275
25275
  const SD_ATTR_KEY$e = "bold";
25276
- const encode$R = (params2, encodedAttrs = {}) => {
25276
+ const encode$S = (params2, encodedAttrs = {}) => {
25277
25277
  const { nodes } = params2;
25278
25278
  const node = nodes[0];
25279
25279
  if (!node) return void 0;
@@ -25285,85 +25285,85 @@ const encode$R = (params2, encodedAttrs = {}) => {
25285
25285
  else attributes = node.attributes || {};
25286
25286
  return {
25287
25287
  type: "attr",
25288
- xmlName: XML_NODE_NAME$p,
25288
+ xmlName: XML_NODE_NAME$q,
25289
25289
  sdNodeOrKeyName: SD_ATTR_KEY$e,
25290
25290
  attributes
25291
25291
  };
25292
25292
  };
25293
- const config$n = {
25294
- xmlName: XML_NODE_NAME$p,
25293
+ const config$o = {
25294
+ xmlName: XML_NODE_NAME$q,
25295
25295
  sdNodeOrKeyName: SD_ATTR_KEY$e,
25296
25296
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25297
- encode: encode$R,
25298
- attributes: validXmlAttributes$h
25297
+ encode: encode$S,
25298
+ attributes: validXmlAttributes$i
25299
25299
  };
25300
- const translator$11 = NodeTranslator.from(config$n);
25301
- const XML_NODE_NAME$o = "w:i";
25300
+ const translator$12 = NodeTranslator.from(config$o);
25301
+ const XML_NODE_NAME$p = "w:i";
25302
25302
  const SD_ATTR_KEY$d = "italic";
25303
- const encode$Q = (params2) => {
25303
+ const encode$R = (params2) => {
25304
25304
  const { nodes } = params2;
25305
25305
  const node = nodes?.[0];
25306
25306
  if (!node) return void 0;
25307
25307
  return {
25308
25308
  type: "attr",
25309
- xmlName: XML_NODE_NAME$o,
25309
+ xmlName: XML_NODE_NAME$p,
25310
25310
  sdNodeOrKeyName: SD_ATTR_KEY$d,
25311
25311
  attributes: {
25312
25312
  "w:val": node.attributes?.["w:val"] ?? null
25313
25313
  }
25314
25314
  };
25315
25315
  };
25316
- const config$m = {
25317
- xmlName: XML_NODE_NAME$o,
25316
+ const config$n = {
25317
+ xmlName: XML_NODE_NAME$p,
25318
25318
  sdNodeOrKeyName: SD_ATTR_KEY$d,
25319
25319
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25320
- encode: encode$Q
25320
+ encode: encode$R
25321
25321
  };
25322
- const translator$10 = NodeTranslator.from(config$m);
25323
- const encode$P = (attributes) => attributes?.["w:val"];
25324
- const decode$I = (attrs) => attrs?.underline;
25322
+ const translator$11 = NodeTranslator.from(config$n);
25323
+ const encode$Q = (attributes) => attributes?.["w:val"];
25324
+ const decode$J = (attrs) => attrs?.underline;
25325
25325
  const attrConfig$r = Object.freeze({
25326
25326
  xmlName: "w:val",
25327
25327
  sdName: "underline",
25328
- encode: encode$P,
25329
- decode: decode$I
25328
+ encode: encode$Q,
25329
+ decode: decode$J
25330
25330
  });
25331
- const encode$O = (attributes) => attributes?.["w:color"];
25332
- const decode$H = (attrs) => attrs?.color;
25331
+ const encode$P = (attributes) => attributes?.["w:color"];
25332
+ const decode$I = (attrs) => attrs?.color;
25333
25333
  const attrConfig$q = Object.freeze({
25334
25334
  xmlName: "w:color",
25335
25335
  sdName: "color",
25336
- encode: encode$O,
25337
- decode: decode$H
25336
+ encode: encode$P,
25337
+ decode: decode$I
25338
25338
  });
25339
- const encode$N = (attributes) => attributes?.["w:themeColor"];
25340
- const decode$G = (attrs) => attrs?.themeColor;
25339
+ const encode$O = (attributes) => attributes?.["w:themeColor"];
25340
+ const decode$H = (attrs) => attrs?.themeColor;
25341
25341
  const attrConfig$p = Object.freeze({
25342
25342
  xmlName: "w:themeColor",
25343
25343
  sdName: "themeColor",
25344
- encode: encode$N,
25345
- decode: decode$G
25344
+ encode: encode$O,
25345
+ decode: decode$H
25346
25346
  });
25347
- const encode$M = (attributes) => attributes?.["w:themeTint"];
25348
- const decode$F = (attrs) => attrs?.themeTint;
25347
+ const encode$N = (attributes) => attributes?.["w:themeTint"];
25348
+ const decode$G = (attrs) => attrs?.themeTint;
25349
25349
  const attrConfig$o = Object.freeze({
25350
25350
  xmlName: "w:themeTint",
25351
25351
  sdName: "themeTint",
25352
- encode: encode$M,
25353
- decode: decode$F
25352
+ encode: encode$N,
25353
+ decode: decode$G
25354
25354
  });
25355
- const encode$L = (attributes) => attributes?.["w:themeShade"];
25356
- const decode$E = (attrs) => attrs?.themeShade;
25355
+ const encode$M = (attributes) => attributes?.["w:themeShade"];
25356
+ const decode$F = (attrs) => attrs?.themeShade;
25357
25357
  const attrConfig$n = Object.freeze({
25358
25358
  xmlName: "w:themeShade",
25359
25359
  sdName: "themeShade",
25360
- encode: encode$L,
25361
- decode: decode$E
25360
+ encode: encode$M,
25361
+ decode: decode$F
25362
25362
  });
25363
- const validXmlAttributes$g = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
25364
- const XML_NODE_NAME$n = "w:u";
25363
+ const validXmlAttributes$h = [attrConfig$r, attrConfig$q, attrConfig$p, attrConfig$o, attrConfig$n];
25364
+ const XML_NODE_NAME$o = "w:u";
25365
25365
  const SD_ATTR_KEY$c = "underline";
25366
- const encode$K = (params2, encodedAttrs = {}) => {
25366
+ const encode$L = (params2, encodedAttrs = {}) => {
25367
25367
  const { nodes } = params2;
25368
25368
  const node = nodes?.[0];
25369
25369
  const sourceAttrs = node?.attributes || {};
@@ -25379,12 +25379,12 @@ const encode$K = (params2, encodedAttrs = {}) => {
25379
25379
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
25380
25380
  return {
25381
25381
  type: "attr",
25382
- xmlName: XML_NODE_NAME$n,
25382
+ xmlName: XML_NODE_NAME$o,
25383
25383
  sdNodeOrKeyName: SD_ATTR_KEY$c,
25384
25384
  attributes
25385
25385
  };
25386
25386
  };
25387
- const decode$D = (params2) => {
25387
+ const decode$E = (params2) => {
25388
25388
  const attrs = params2?.node?.attrs || {};
25389
25389
  const underlineType = attrs.underlineType ?? attrs.underline ?? null;
25390
25390
  const color = attrs.underlineColor ?? attrs.color ?? null;
@@ -25402,20 +25402,20 @@ const decode$D = (params2) => {
25402
25402
  if (themeTint) attributes["w:themeTint"] = themeTint;
25403
25403
  if (themeShade) attributes["w:themeShade"] = themeShade;
25404
25404
  return {
25405
- name: XML_NODE_NAME$n,
25405
+ name: XML_NODE_NAME$o,
25406
25406
  attributes
25407
25407
  };
25408
25408
  };
25409
- const config$l = {
25410
- xmlName: XML_NODE_NAME$n,
25409
+ const config$m = {
25410
+ xmlName: XML_NODE_NAME$o,
25411
25411
  sdNodeOrKeyName: SD_ATTR_KEY$c,
25412
25412
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25413
- encode: encode$K,
25414
- decode: decode$D,
25415
- attributes: validXmlAttributes$g
25413
+ encode: encode$L,
25414
+ decode: decode$E,
25415
+ attributes: validXmlAttributes$h
25416
25416
  };
25417
- const translator$$ = NodeTranslator.from(config$l);
25418
- const encode$J = (attributes) => {
25417
+ const translator$10 = NodeTranslator.from(config$m);
25418
+ const encode$K = (attributes) => {
25419
25419
  const raw = attributes?.["w:val"];
25420
25420
  if (raw === void 0 || raw === null) return void 0;
25421
25421
  if (typeof raw === "boolean") return raw;
@@ -25425,20 +25425,20 @@ const encode$J = (attributes) => {
25425
25425
  if (val === "1" || val === "true" || val === "on") return true;
25426
25426
  return void 0;
25427
25427
  };
25428
- const decode$C = (attrs) => {
25428
+ const decode$D = (attrs) => {
25429
25429
  if (attrs?.strike === false) return "0";
25430
25430
  return void 0;
25431
25431
  };
25432
25432
  const attrConfig$m = Object.freeze({
25433
25433
  xmlName: "w:val",
25434
25434
  sdName: "strike",
25435
- encode: encode$J,
25436
- decode: decode$C
25435
+ encode: encode$K,
25436
+ decode: decode$D
25437
25437
  });
25438
- const validXmlAttributes$f = [attrConfig$m];
25439
- const XML_NODE_NAME$m = "w:strike";
25438
+ const validXmlAttributes$g = [attrConfig$m];
25439
+ const XML_NODE_NAME$n = "w:strike";
25440
25440
  const SD_ATTR_KEY$b = "strike";
25441
- const encode$I = (params2, encodedAttrs = {}) => {
25441
+ const encode$J = (params2, encodedAttrs = {}) => {
25442
25442
  const { nodes } = params2;
25443
25443
  const node = nodes?.[0];
25444
25444
  if (!node) return void 0;
@@ -25451,55 +25451,55 @@ const encode$I = (params2, encodedAttrs = {}) => {
25451
25451
  else if (val === true && attributes["w:val"] === void 0) delete attributes["w:val"];
25452
25452
  return {
25453
25453
  type: "attr",
25454
- xmlName: XML_NODE_NAME$m,
25454
+ xmlName: XML_NODE_NAME$n,
25455
25455
  sdNodeOrKeyName: SD_ATTR_KEY$b,
25456
25456
  attributes
25457
25457
  };
25458
25458
  };
25459
- const config$k = {
25460
- xmlName: XML_NODE_NAME$m,
25459
+ const config$l = {
25460
+ xmlName: XML_NODE_NAME$n,
25461
25461
  sdNodeOrKeyName: SD_ATTR_KEY$b,
25462
25462
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25463
- encode: encode$I,
25464
- attributes: validXmlAttributes$f
25463
+ encode: encode$J,
25464
+ attributes: validXmlAttributes$g
25465
25465
  };
25466
- const translator$_ = NodeTranslator.from(config$k);
25467
- const encode$H = (attributes) => attributes?.["w:val"];
25468
- const decode$B = (attrs) => attrs?.color;
25466
+ const translator$$ = NodeTranslator.from(config$l);
25467
+ const encode$I = (attributes) => attributes?.["w:val"];
25468
+ const decode$C = (attrs) => attrs?.color;
25469
25469
  const attrConfig$l = Object.freeze({
25470
25470
  xmlName: "w:val",
25471
25471
  sdName: "color",
25472
- encode: encode$H,
25473
- decode: decode$B
25472
+ encode: encode$I,
25473
+ decode: decode$C
25474
25474
  });
25475
- const encode$G = (attributes) => attributes?.["w:themeColor"];
25476
- const decode$A = (attrs) => attrs?.themeColor;
25475
+ const encode$H = (attributes) => attributes?.["w:themeColor"];
25476
+ const decode$B = (attrs) => attrs?.themeColor;
25477
25477
  const attrConfig$k = Object.freeze({
25478
25478
  xmlName: "w:themeColor",
25479
25479
  sdName: "themeColor",
25480
- encode: encode$G,
25481
- decode: decode$A
25480
+ encode: encode$H,
25481
+ decode: decode$B
25482
25482
  });
25483
- const encode$F = (attributes) => attributes?.["w:themeTint"];
25484
- const decode$z = (attrs) => attrs?.themeTint;
25483
+ const encode$G = (attributes) => attributes?.["w:themeTint"];
25484
+ const decode$A = (attrs) => attrs?.themeTint;
25485
25485
  const attrConfig$j = Object.freeze({
25486
25486
  xmlName: "w:themeTint",
25487
25487
  sdName: "themeTint",
25488
- encode: encode$F,
25489
- decode: decode$z
25488
+ encode: encode$G,
25489
+ decode: decode$A
25490
25490
  });
25491
- const encode$E = (attributes) => attributes?.["w:themeShade"];
25492
- const decode$y = (attrs) => attrs?.themeShade;
25491
+ const encode$F = (attributes) => attributes?.["w:themeShade"];
25492
+ const decode$z = (attrs) => attrs?.themeShade;
25493
25493
  const attrConfig$i = Object.freeze({
25494
25494
  xmlName: "w:themeShade",
25495
25495
  sdName: "themeShade",
25496
- encode: encode$E,
25497
- decode: decode$y
25496
+ encode: encode$F,
25497
+ decode: decode$z
25498
25498
  });
25499
- const validXmlAttributes$e = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
25500
- const XML_NODE_NAME$l = "w:color";
25499
+ const validXmlAttributes$f = [attrConfig$l, attrConfig$k, attrConfig$j, attrConfig$i];
25500
+ const XML_NODE_NAME$m = "w:color";
25501
25501
  const SD_ATTR_KEY$a = "color";
25502
- const encode$D = (params2, encodedAttrs = {}) => {
25502
+ const encode$E = (params2, encodedAttrs = {}) => {
25503
25503
  const { nodes } = params2;
25504
25504
  const node = nodes?.[0];
25505
25505
  const sourceAttrs = node?.attributes || {};
@@ -25514,63 +25514,63 @@ const encode$D = (params2, encodedAttrs = {}) => {
25514
25514
  if (themeShade !== void 0 && themeShade !== null) attributes["w:themeShade"] = themeShade;
25515
25515
  return {
25516
25516
  type: "attr",
25517
- xmlName: XML_NODE_NAME$l,
25517
+ xmlName: XML_NODE_NAME$m,
25518
25518
  sdNodeOrKeyName: SD_ATTR_KEY$a,
25519
25519
  attributes
25520
25520
  };
25521
25521
  };
25522
- const config$j = {
25523
- xmlName: XML_NODE_NAME$l,
25522
+ const config$k = {
25523
+ xmlName: XML_NODE_NAME$m,
25524
25524
  sdNodeOrKeyName: SD_ATTR_KEY$a,
25525
25525
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25526
- encode: encode$D,
25527
- attributes: validXmlAttributes$e
25526
+ encode: encode$E,
25527
+ attributes: validXmlAttributes$f
25528
25528
  };
25529
- const translator$Z = NodeTranslator.from(config$j);
25530
- const encode$C = (attributes) => attributes?.["w:eastAsia"];
25531
- const decode$x = (attrs) => attrs?.eastAsia;
25529
+ const translator$_ = NodeTranslator.from(config$k);
25530
+ const encode$D = (attributes) => attributes?.["w:eastAsia"];
25531
+ const decode$y = (attrs) => attrs?.eastAsia;
25532
25532
  const attrConfig$h = Object.freeze({
25533
25533
  xmlName: "w:eastAsia",
25534
25534
  sdName: "eastAsia",
25535
- encode: encode$C,
25536
- decode: decode$x
25535
+ encode: encode$D,
25536
+ decode: decode$y
25537
25537
  });
25538
- const encode$B = (attributes) => attributes?.["w:ascii"];
25539
- const decode$w = (attrs) => attrs?.ascii;
25538
+ const encode$C = (attributes) => attributes?.["w:ascii"];
25539
+ const decode$x = (attrs) => attrs?.ascii;
25540
25540
  const attrConfig$g = Object.freeze({
25541
25541
  xmlName: "w:ascii",
25542
25542
  sdName: "ascii",
25543
- encode: encode$B,
25544
- decode: decode$w
25543
+ encode: encode$C,
25544
+ decode: decode$x
25545
25545
  });
25546
- const encode$A = (attributes) => attributes?.["w:hAnsi"];
25547
- const decode$v = (attrs) => attrs?.hAnsi;
25546
+ const encode$B = (attributes) => attributes?.["w:hAnsi"];
25547
+ const decode$w = (attrs) => attrs?.hAnsi;
25548
25548
  const attrConfig$f = Object.freeze({
25549
25549
  xmlName: "w:hAnsi",
25550
25550
  sdName: "hAnsi",
25551
- encode: encode$A,
25552
- decode: decode$v
25551
+ encode: encode$B,
25552
+ decode: decode$w
25553
25553
  });
25554
- const encode$z = (attributes) => attributes?.["w:cs"];
25555
- const decode$u = (attrs) => attrs?.cs;
25554
+ const encode$A = (attributes) => attributes?.["w:cs"];
25555
+ const decode$v = (attrs) => attrs?.cs;
25556
25556
  const attrConfig$e = Object.freeze({
25557
25557
  xmlName: "w:cs",
25558
25558
  sdName: "cs",
25559
- encode: encode$z,
25560
- decode: decode$u
25559
+ encode: encode$A,
25560
+ decode: decode$v
25561
25561
  });
25562
- const encode$y = (attributes) => attributes?.["w:val"];
25563
- const decode$t = (attrs) => attrs?.value;
25562
+ const encode$z = (attributes) => attributes?.["w:val"];
25563
+ const decode$u = (attrs) => attrs?.value;
25564
25564
  const attrConfig$d = Object.freeze({
25565
25565
  xmlName: "w:val",
25566
25566
  sdName: "value",
25567
- encode: encode$y,
25568
- decode: decode$t
25567
+ encode: encode$z,
25568
+ decode: decode$u
25569
25569
  });
25570
- const validXmlAttributes$d = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
25571
- const XML_NODE_NAME$k = "w:rFonts";
25570
+ const validXmlAttributes$e = [attrConfig$h, attrConfig$g, attrConfig$f, attrConfig$e, attrConfig$d];
25571
+ const XML_NODE_NAME$l = "w:rFonts";
25572
25572
  const SD_ATTR_KEY$9 = "fontFamily";
25573
- const encode$x = (params2, encodedAttrs = {}) => {
25573
+ const encode$y = (params2, encodedAttrs = {}) => {
25574
25574
  const { nodes } = params2;
25575
25575
  const node = nodes?.[0];
25576
25576
  const sourceAttrs = node?.attributes || {};
@@ -25596,120 +25596,120 @@ const encode$x = (params2, encodedAttrs = {}) => {
25596
25596
  if (attributes["w:val"] === void 0) delete attributes["w:val"];
25597
25597
  return {
25598
25598
  type: "attr",
25599
- xmlName: XML_NODE_NAME$k,
25599
+ xmlName: XML_NODE_NAME$l,
25600
25600
  sdNodeOrKeyName: SD_ATTR_KEY$9,
25601
25601
  attributes
25602
25602
  };
25603
25603
  };
25604
- const config$i = {
25605
- xmlName: XML_NODE_NAME$k,
25604
+ const config$j = {
25605
+ xmlName: XML_NODE_NAME$l,
25606
25606
  sdNodeOrKeyName: SD_ATTR_KEY$9,
25607
25607
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25608
- encode: encode$x,
25609
- attributes: validXmlAttributes$d
25608
+ encode: encode$y,
25609
+ attributes: validXmlAttributes$e
25610
25610
  };
25611
- const translator$Y = NodeTranslator.from(config$i);
25612
- const encode$w = (attributes) => attributes?.["w:val"];
25613
- const decode$s = (attrs) => attrs?.styleId;
25611
+ const translator$Z = NodeTranslator.from(config$j);
25612
+ const encode$x = (attributes) => attributes?.["w:val"];
25613
+ const decode$t = (attrs) => attrs?.styleId;
25614
25614
  const attrConfig$c = Object.freeze({
25615
25615
  xmlName: "w:val",
25616
25616
  sdName: "styleId",
25617
- encode: encode$w,
25618
- decode: decode$s
25617
+ encode: encode$x,
25618
+ decode: decode$t
25619
25619
  });
25620
- const validXmlAttributes$c = [attrConfig$c];
25621
- const XML_NODE_NAME$j = "w:rStyle";
25620
+ const validXmlAttributes$d = [attrConfig$c];
25621
+ const XML_NODE_NAME$k = "w:rStyle";
25622
25622
  const SD_ATTR_KEY$8 = "styleId";
25623
- const encode$v = (params2, encodedAttrs = {}) => {
25623
+ const encode$w = (params2, encodedAttrs = {}) => {
25624
25624
  const { nodes } = params2;
25625
25625
  const node = nodes?.[0];
25626
25626
  const value = encodedAttrs.styleId ?? node?.attributes?.["w:val"];
25627
25627
  return {
25628
25628
  type: "attr",
25629
- xmlName: XML_NODE_NAME$j,
25629
+ xmlName: XML_NODE_NAME$k,
25630
25630
  sdNodeOrKeyName: SD_ATTR_KEY$8,
25631
25631
  attributes: { "w:val": value ?? null }
25632
25632
  };
25633
25633
  };
25634
- const config$h = {
25635
- xmlName: XML_NODE_NAME$j,
25634
+ const config$i = {
25635
+ xmlName: XML_NODE_NAME$k,
25636
25636
  sdNodeOrKeyName: SD_ATTR_KEY$8,
25637
25637
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25638
- encode: encode$v,
25639
- attributes: validXmlAttributes$c
25638
+ encode: encode$w,
25639
+ attributes: validXmlAttributes$d
25640
25640
  };
25641
- const translator$X = NodeTranslator.from(config$h);
25642
- const encode$u = (attributes) => attributes?.["w:val"];
25643
- const decode$r = (attrs) => attrs?.fontSize;
25641
+ const translator$Y = NodeTranslator.from(config$i);
25642
+ const encode$v = (attributes) => attributes?.["w:val"];
25643
+ const decode$s = (attrs) => attrs?.fontSize;
25644
25644
  const attrConfig$b = Object.freeze({
25645
25645
  xmlName: "w:val",
25646
25646
  sdName: "fontSize",
25647
- encode: encode$u,
25648
- decode: decode$r
25647
+ encode: encode$v,
25648
+ decode: decode$s
25649
25649
  });
25650
- const validXmlAttributes$b = [attrConfig$b];
25651
- const XML_NODE_NAME$i = "w:sz";
25650
+ const validXmlAttributes$c = [attrConfig$b];
25651
+ const XML_NODE_NAME$j = "w:sz";
25652
25652
  const SD_ATTR_KEY$7 = "fontSize";
25653
- const encode$t = (params2, encodedAttrs = {}) => {
25653
+ const encode$u = (params2, encodedAttrs = {}) => {
25654
25654
  const { nodes } = params2;
25655
25655
  const node = nodes?.[0];
25656
25656
  const value = encodedAttrs.fontSize ?? node?.attributes?.["w:val"];
25657
25657
  return {
25658
25658
  type: "attr",
25659
- xmlName: XML_NODE_NAME$i,
25659
+ xmlName: XML_NODE_NAME$j,
25660
25660
  sdNodeOrKeyName: SD_ATTR_KEY$7,
25661
25661
  attributes: { "w:val": value ?? null }
25662
25662
  };
25663
25663
  };
25664
- const config$g = {
25665
- xmlName: XML_NODE_NAME$i,
25664
+ const config$h = {
25665
+ xmlName: XML_NODE_NAME$j,
25666
25666
  sdNodeOrKeyName: SD_ATTR_KEY$7,
25667
25667
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25668
- encode: encode$t,
25669
- attributes: validXmlAttributes$b
25668
+ encode: encode$u,
25669
+ attributes: validXmlAttributes$c
25670
25670
  };
25671
- const translator$W = NodeTranslator.from(config$g);
25672
- const encode$s = (attributes) => attributes?.["w:val"];
25673
- const decode$q = (attrs) => attrs?.fontSizeCs;
25671
+ const translator$X = NodeTranslator.from(config$h);
25672
+ const encode$t = (attributes) => attributes?.["w:val"];
25673
+ const decode$r = (attrs) => attrs?.fontSizeCs;
25674
25674
  const attrConfig$a = Object.freeze({
25675
25675
  xmlName: "w:val",
25676
25676
  sdName: "fontSizeCs",
25677
- encode: encode$s,
25678
- decode: decode$q
25677
+ encode: encode$t,
25678
+ decode: decode$r
25679
25679
  });
25680
- const validXmlAttributes$a = [attrConfig$a];
25681
- const XML_NODE_NAME$h = "w:szCs";
25680
+ const validXmlAttributes$b = [attrConfig$a];
25681
+ const XML_NODE_NAME$i = "w:szCs";
25682
25682
  const SD_ATTR_KEY$6 = "fontSizeCs";
25683
- const encode$r = (params2, encodedAttrs = {}) => {
25683
+ const encode$s = (params2, encodedAttrs = {}) => {
25684
25684
  const { nodes } = params2;
25685
25685
  const node = nodes?.[0];
25686
25686
  const value = encodedAttrs.fontSizeCs ?? node?.attributes?.["w:val"];
25687
25687
  return {
25688
25688
  type: "attr",
25689
- xmlName: XML_NODE_NAME$h,
25689
+ xmlName: XML_NODE_NAME$i,
25690
25690
  sdNodeOrKeyName: SD_ATTR_KEY$6,
25691
25691
  attributes: { "w:val": value ?? null }
25692
25692
  };
25693
25693
  };
25694
- const config$f = {
25695
- xmlName: XML_NODE_NAME$h,
25694
+ const config$g = {
25695
+ xmlName: XML_NODE_NAME$i,
25696
25696
  sdNodeOrKeyName: SD_ATTR_KEY$6,
25697
25697
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25698
- encode: encode$r,
25699
- attributes: validXmlAttributes$a
25698
+ encode: encode$s,
25699
+ attributes: validXmlAttributes$b
25700
25700
  };
25701
- const translator$V = NodeTranslator.from(config$f);
25701
+ const translator$W = NodeTranslator.from(config$g);
25702
25702
  const runPropertyTranslators = Object.freeze({
25703
- "w:b": translator$11,
25704
- "w:i": translator$10,
25705
- "w:u": translator$$,
25706
- "w:strike": translator$_,
25707
- "w:color": translator$Z,
25708
- "w:highlight": translator$14,
25709
- "w:rFonts": translator$Y,
25710
- "w:rStyle": translator$X,
25711
- "w:sz": translator$W,
25712
- "w:szCs": translator$V
25703
+ "w:b": translator$12,
25704
+ "w:i": translator$11,
25705
+ "w:u": translator$10,
25706
+ "w:strike": translator$$,
25707
+ "w:color": translator$_,
25708
+ "w:highlight": translator$15,
25709
+ "w:rFonts": translator$Z,
25710
+ "w:rStyle": translator$Y,
25711
+ "w:sz": translator$X,
25712
+ "w:szCs": translator$W
25713
25713
  });
25714
25714
  const rawRunPropertyXmlNames = Object.freeze(["w:lang", "w:shd"]);
25715
25715
  const RAW_CHILD_NAME_SET = new Set(rawRunPropertyXmlNames);
@@ -25723,9 +25723,9 @@ const toRunPropertyEntry = (candidate) => {
25723
25723
  attributes: { ...candidate.attributes || {} }
25724
25724
  };
25725
25725
  };
25726
- const XML_NODE_NAME$g = "w:rPr";
25726
+ const XML_NODE_NAME$h = "w:rPr";
25727
25727
  const SD_ATTR_KEY$5 = "runProperties";
25728
- const encode$q = (params2) => {
25728
+ const encode$r = (params2) => {
25729
25729
  const { nodes } = params2;
25730
25730
  const node = nodes?.[0] || {};
25731
25731
  const contents = Array.isArray(node.elements) ? node.elements : [];
@@ -25759,16 +25759,16 @@ const encode$q = (params2) => {
25759
25759
  attributes: runPropsArray
25760
25760
  };
25761
25761
  };
25762
- const config$e = {
25763
- xmlName: XML_NODE_NAME$g,
25762
+ const config$f = {
25763
+ xmlName: XML_NODE_NAME$h,
25764
25764
  sdNodeOrKeyName: SD_ATTR_KEY$5,
25765
25765
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
25766
- encode: encode$q
25766
+ encode: encode$r
25767
25767
  };
25768
- const translator$U = NodeTranslator.from(config$e);
25768
+ const translator$V = NodeTranslator.from(config$f);
25769
25769
  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;
25770
25770
  const containsEastAsianCharacters = (text) => EAST_ASIAN_CHARACTER_REGEX.test(text);
25771
- const collectRunProperties = (params2, rPrNode, translator2 = translator$U) => {
25771
+ const collectRunProperties = (params2, rPrNode, translator2 = translator$V) => {
25772
25772
  if (!rPrNode) return { entries: [], hadRPr: false, styleChangeMarks: [] };
25773
25773
  const result = translator2.encode({ ...params2, nodes: [rPrNode] }) || {};
25774
25774
  let entries = [];
@@ -26230,46 +26230,46 @@ const ensureTrackedWrapper = (runs, trackingMarksByType = /* @__PURE__ */ new Ma
26230
26230
  }
26231
26231
  return runs;
26232
26232
  };
26233
- const encode$p = (attributes) => {
26233
+ const encode$q = (attributes) => {
26234
26234
  return attributes["w:rsidR"];
26235
26235
  };
26236
- const decode$p = (attrs) => {
26236
+ const decode$q = (attrs) => {
26237
26237
  return attrs.rsidR;
26238
26238
  };
26239
26239
  const attrConfig$9 = Object.freeze({
26240
26240
  xmlName: "w:rsidR",
26241
26241
  sdName: "rsidR",
26242
- encode: encode$p,
26243
- decode: decode$p
26242
+ encode: encode$q,
26243
+ decode: decode$q
26244
26244
  });
26245
- const encode$o = (attributes) => {
26245
+ const encode$p = (attributes) => {
26246
26246
  return attributes["w:rsidRPr"];
26247
26247
  };
26248
- const decode$o = (attrs) => {
26248
+ const decode$p = (attrs) => {
26249
26249
  return attrs.rsidRPr;
26250
26250
  };
26251
26251
  const attrConfig$8 = Object.freeze({
26252
26252
  xmlName: "w:rsidRPr",
26253
26253
  sdName: "rsidRPr",
26254
- encode: encode$o,
26255
- decode: decode$o
26254
+ encode: encode$p,
26255
+ decode: decode$p
26256
26256
  });
26257
- const encode$n = (attributes) => {
26257
+ const encode$o = (attributes) => {
26258
26258
  return attributes["w:rsidDel"];
26259
26259
  };
26260
- const decode$n = (attrs) => {
26260
+ const decode$o = (attrs) => {
26261
26261
  return attrs.rsidDel;
26262
26262
  };
26263
26263
  const attrConfig$7 = Object.freeze({
26264
26264
  xmlName: "w:rsidDel",
26265
26265
  sdName: "rsidDel",
26266
- encode: encode$n,
26267
- decode: decode$n
26266
+ encode: encode$o,
26267
+ decode: decode$o
26268
26268
  });
26269
- const validXmlAttributes$9 = [attrConfig$9, attrConfig$8, attrConfig$7];
26270
- const XML_NODE_NAME$f = "w:r";
26269
+ const validXmlAttributes$a = [attrConfig$9, attrConfig$8, attrConfig$7];
26270
+ const XML_NODE_NAME$g = "w:r";
26271
26271
  const SD_KEY_NAME = "run";
26272
- const encode$m = (params2, encodedAttrs = {}) => {
26272
+ const encode$n = (params2, encodedAttrs = {}) => {
26273
26273
  const { nodes = [], nodeListHandler } = params2 || {};
26274
26274
  const runNode = nodes[0];
26275
26275
  if (!runNode) return void 0;
@@ -26317,7 +26317,7 @@ const encode$m = (params2, encodedAttrs = {}) => {
26317
26317
  }
26318
26318
  return runNodeResult;
26319
26319
  };
26320
- const decode$m = (params2, decodedAttrs = {}) => {
26320
+ const decode$n = (params2, decodedAttrs = {}) => {
26321
26321
  const { node } = params2 || {};
26322
26322
  if (!node) return void 0;
26323
26323
  const { runNode: runNodeForExport, trackingMarksByType } = prepareRunTrackingContext(node);
@@ -26374,7 +26374,7 @@ const decode$m = (params2, decodedAttrs = {}) => {
26374
26374
  runs.push(trackedClone);
26375
26375
  return;
26376
26376
  }
26377
- const runWrapper = { name: XML_NODE_NAME$f, elements: [] };
26377
+ const runWrapper = { name: XML_NODE_NAME$g, elements: [] };
26378
26378
  applyBaseRunProps(runWrapper);
26379
26379
  if (!Array.isArray(runWrapper.elements)) runWrapper.elements = [];
26380
26380
  runWrapper.elements.push(cloneXmlNode(child));
@@ -26382,7 +26382,7 @@ const decode$m = (params2, decodedAttrs = {}) => {
26382
26382
  });
26383
26383
  const trackedRuns = ensureTrackedWrapper(runs, trackingMarksByType);
26384
26384
  if (!trackedRuns.length) {
26385
- const emptyRun = { name: XML_NODE_NAME$f, elements: [] };
26385
+ const emptyRun = { name: XML_NODE_NAME$g, elements: [] };
26386
26386
  applyBaseRunProps(emptyRun);
26387
26387
  trackedRuns.push(emptyRun);
26388
26388
  }
@@ -26396,15 +26396,15 @@ const decode$m = (params2, decodedAttrs = {}) => {
26396
26396
  }
26397
26397
  return trackedRuns;
26398
26398
  };
26399
- const config$d = {
26400
- xmlName: XML_NODE_NAME$f,
26399
+ const config$e = {
26400
+ xmlName: XML_NODE_NAME$g,
26401
26401
  sdNodeOrKeyName: SD_KEY_NAME,
26402
26402
  type: NodeTranslator.translatorTypes.NODE,
26403
- encode: encode$m,
26404
- decode: decode$m,
26405
- attributes: validXmlAttributes$9
26403
+ encode: encode$n,
26404
+ decode: decode$n,
26405
+ attributes: validXmlAttributes$a
26406
26406
  };
26407
- const translator$T = NodeTranslator.from(config$d);
26407
+ const translator$U = NodeTranslator.from(config$e);
26408
26408
  const generateV2HandlerEntity = (handlerName, translator2) => ({
26409
26409
  handlerName,
26410
26410
  handler: (params2) => {
@@ -26578,13 +26578,13 @@ function preProcessVerticalMergeCells(table, { editorSchema }) {
26578
26578
  }
26579
26579
  return table;
26580
26580
  }
26581
- const translator$S = NodeTranslator.from({
26581
+ const translator$T = NodeTranslator.from({
26582
26582
  xmlName: "w:cantSplit",
26583
26583
  sdNodeOrKeyName: "cantSplit",
26584
26584
  encode: ({ nodes }) => ["1", "true"].includes(nodes[0].attributes?.["w:val"] ?? "1"),
26585
26585
  decode: ({ node }) => node.attrs?.cantSplit ? { attributes: {} } : void 0
26586
26586
  });
26587
- const translator$R = NodeTranslator.from({
26587
+ const translator$S = NodeTranslator.from({
26588
26588
  xmlName: "w:cnfStyle",
26589
26589
  sdNodeOrKeyName: "cnfStyle",
26590
26590
  attributes: [
@@ -26610,8 +26610,8 @@ const translator$R = NodeTranslator.from({
26610
26610
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26611
26611
  }
26612
26612
  });
26613
- const translator$Q = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
26614
- const translator$P = NodeTranslator.from(
26613
+ const translator$R = NodeTranslator.from(createSingleAttrPropertyHandler("w:divId"));
26614
+ const translator$Q = NodeTranslator.from(
26615
26615
  createSingleAttrPropertyHandler(
26616
26616
  "w:gridAfter",
26617
26617
  null,
@@ -26620,7 +26620,7 @@ const translator$P = NodeTranslator.from(
26620
26620
  (v2) => integerToString(v2)
26621
26621
  )
26622
26622
  );
26623
- const translator$O = NodeTranslator.from(
26623
+ const translator$P = NodeTranslator.from(
26624
26624
  createSingleAttrPropertyHandler(
26625
26625
  "w:gridBefore",
26626
26626
  null,
@@ -26629,21 +26629,21 @@ const translator$O = NodeTranslator.from(
26629
26629
  (v2) => integerToString(v2)
26630
26630
  )
26631
26631
  );
26632
- const translator$N = NodeTranslator.from({
26632
+ const translator$O = NodeTranslator.from({
26633
26633
  xmlName: "w:hidden",
26634
26634
  sdNodeOrKeyName: "hidden",
26635
26635
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26636
26636
  decode: ({ node }) => node.attrs.hidden ? { attributes: {} } : void 0
26637
26637
  });
26638
- const translator$M = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
26639
- const translator$L = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
26640
- const translator$K = NodeTranslator.from({
26638
+ const translator$N = NodeTranslator.from(createSingleAttrPropertyHandler("w:jc", "justification"));
26639
+ const translator$M = NodeTranslator.from(createMeasurementPropertyHandler("w:tblCellSpacing", "tableCellSpacing"));
26640
+ const translator$L = NodeTranslator.from({
26641
26641
  xmlName: "w:tblHeader",
26642
26642
  sdNodeOrKeyName: "repeatHeader",
26643
26643
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26644
26644
  decode: ({ node }) => node.attrs.repeatHeader ? { attributes: {} } : void 0
26645
26645
  });
26646
- const translator$J = NodeTranslator.from({
26646
+ const translator$K = NodeTranslator.from({
26647
26647
  xmlName: "w:trHeight",
26648
26648
  sdNodeOrKeyName: "rowHeight",
26649
26649
  encode: ({ nodes }) => {
@@ -26670,11 +26670,11 @@ const translator$J = NodeTranslator.from({
26670
26670
  return Object.keys(heightAttrs).length > 0 ? { attributes: heightAttrs } : void 0;
26671
26671
  }
26672
26672
  });
26673
- const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
26674
- const translator$H = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
26675
- const XML_NODE_NAME$e = "w:trPr";
26673
+ const translator$J = NodeTranslator.from(createMeasurementPropertyHandler("w:wAfter"));
26674
+ const translator$I = NodeTranslator.from(createMeasurementPropertyHandler("w:wBefore"));
26675
+ const XML_NODE_NAME$f = "w:trPr";
26676
26676
  const SD_ATTR_KEY$4 = "tableRowProperties";
26677
- const encode$l = (params2) => {
26677
+ const encode$m = (params2) => {
26678
26678
  const { nodes } = params2;
26679
26679
  const node = nodes[0];
26680
26680
  let attributes = {
@@ -26688,12 +26688,12 @@ const encode$l = (params2) => {
26688
26688
  };
26689
26689
  return {
26690
26690
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
26691
- xmlName: XML_NODE_NAME$e,
26691
+ xmlName: XML_NODE_NAME$f,
26692
26692
  sdNodeOrKeyName: SD_ATTR_KEY$4,
26693
26693
  attributes
26694
26694
  };
26695
26695
  };
26696
- const decode$l = (params2) => {
26696
+ const decode$m = (params2) => {
26697
26697
  const { tableRowProperties = {} } = params2.node.attrs || {};
26698
26698
  const elements = decodeProperties(propertyTranslatorsBySdName$2, tableRowProperties);
26699
26699
  const newNode = {
@@ -26705,6 +26705,7 @@ const decode$l = (params2) => {
26705
26705
  return newNode;
26706
26706
  };
26707
26707
  const propertyTranslators$3 = [
26708
+ translator$T,
26708
26709
  translator$S,
26709
26710
  translator$R,
26710
26711
  translator$Q,
@@ -26715,8 +26716,7 @@ const propertyTranslators$3 = [
26715
26716
  translator$L,
26716
26717
  translator$K,
26717
26718
  translator$J,
26718
- translator$I,
26719
- translator$H
26719
+ translator$I
26720
26720
  ];
26721
26721
  const propertyTranslatorsByXmlName$2 = {};
26722
26722
  propertyTranslators$3.forEach((translator2) => {
@@ -26726,25 +26726,25 @@ const propertyTranslatorsBySdName$2 = {};
26726
26726
  propertyTranslators$3.forEach((translator2) => {
26727
26727
  propertyTranslatorsBySdName$2[translator2.sdNodeOrKeyName] = translator2;
26728
26728
  });
26729
- const config$c = {
26730
- xmlName: XML_NODE_NAME$e,
26729
+ const config$d = {
26730
+ xmlName: XML_NODE_NAME$f,
26731
26731
  sdNodeOrKeyName: SD_ATTR_KEY$4,
26732
26732
  type: NodeTranslator.translatorTypes.ATTRIBUTE,
26733
- encode: encode$l,
26734
- decode: decode$l
26733
+ encode: encode$m,
26734
+ decode: decode$m
26735
26735
  };
26736
- const translator$G = NodeTranslator.from(config$c);
26737
- const XML_NODE_NAME$d = "w:tr";
26738
- const SD_NODE_NAME$9 = "tableRow";
26739
- const validXmlAttributes$8 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
26736
+ const translator$H = NodeTranslator.from(config$d);
26737
+ const XML_NODE_NAME$e = "w:tr";
26738
+ const SD_NODE_NAME$a = "tableRow";
26739
+ const validXmlAttributes$9 = ["w:rsidDel", "w:rsidR", "w:rsidRPr", "w:rsidTr", "w14:paraId", "w14:textId"].map(
26740
26740
  (xmlName) => createAttributeHandler(xmlName)
26741
26741
  );
26742
- const encode$k = (params2, encodedAttrs) => {
26742
+ const encode$l = (params2, encodedAttrs) => {
26743
26743
  const { row } = params2.extraParams;
26744
26744
  let tableRowProperties = {};
26745
26745
  const tPr = row.elements.find((el) => el.name === "w:trPr");
26746
26746
  if (tPr) {
26747
- ({ attributes: tableRowProperties } = translator$G.encode({
26747
+ ({ attributes: tableRowProperties } = translator$H.encode({
26748
26748
  ...params2,
26749
26749
  nodes: [tPr]
26750
26750
  }));
@@ -26757,7 +26757,7 @@ const encode$k = (params2, encodedAttrs) => {
26757
26757
  let currentColumnIndex = 0;
26758
26758
  const content = cellNodes?.map((n) => {
26759
26759
  let columnWidth = gridColumnWidths?.[currentColumnIndex] || null;
26760
- const result = translator$7.encode({
26760
+ const result = translator$8.encode({
26761
26761
  ...params2,
26762
26762
  extraParams: {
26763
26763
  ...params2.extraParams,
@@ -26779,7 +26779,7 @@ const encode$k = (params2, encodedAttrs) => {
26779
26779
  };
26780
26780
  return newNode;
26781
26781
  };
26782
- const decode$k = (params2, decodedAttrs) => {
26782
+ const decode$l = (params2, decodedAttrs) => {
26783
26783
  const { node } = params2;
26784
26784
  const elements = translateChildNodes(params2);
26785
26785
  if (node.attrs?.tableRowProperties) {
@@ -26791,7 +26791,7 @@ const decode$k = (params2, decodedAttrs) => {
26791
26791
  }
26792
26792
  }
26793
26793
  tableRowProperties["cantSplit"] = node.attrs["cantSplit"];
26794
- const trPr = translator$G.decode({
26794
+ const trPr = translator$H.decode({
26795
26795
  ...params2,
26796
26796
  node: { ...node, attrs: { ...node.attrs, tableRowProperties } }
26797
26797
  });
@@ -26803,22 +26803,22 @@ const decode$k = (params2, decodedAttrs) => {
26803
26803
  elements
26804
26804
  };
26805
26805
  };
26806
- const config$b = {
26807
- xmlName: XML_NODE_NAME$d,
26808
- sdNodeOrKeyName: SD_NODE_NAME$9,
26806
+ const config$c = {
26807
+ xmlName: XML_NODE_NAME$e,
26808
+ sdNodeOrKeyName: SD_NODE_NAME$a,
26809
26809
  type: NodeTranslator.translatorTypes.NODE,
26810
- encode: encode$k,
26811
- decode: decode$k,
26812
- attributes: validXmlAttributes$8
26810
+ encode: encode$l,
26811
+ decode: decode$l,
26812
+ attributes: validXmlAttributes$9
26813
26813
  };
26814
- const translator$F = NodeTranslator.from(config$b);
26815
- const translator$E = NodeTranslator.from({
26814
+ const translator$G = NodeTranslator.from(config$c);
26815
+ const translator$F = NodeTranslator.from({
26816
26816
  xmlName: "w:bidiVisual",
26817
26817
  sdNodeOrKeyName: "rightToLeft",
26818
26818
  encode: ({ nodes }) => parseBoolean(nodes[0].attributes?.["w:val"] ?? "1"),
26819
26819
  decode: ({ node }) => node.attrs.rightToLeft ? { attributes: {} } : void 0
26820
26820
  });
26821
- const translator$D = NodeTranslator.from({
26821
+ const translator$E = NodeTranslator.from({
26822
26822
  xmlName: "w:shd",
26823
26823
  sdNodeOrKeyName: "shading",
26824
26824
  attributes: [
@@ -26840,11 +26840,11 @@ const translator$D = NodeTranslator.from({
26840
26840
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26841
26841
  }
26842
26842
  });
26843
- const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
26844
- const translator$B = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
26845
- const translator$A = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
26846
- const translator$z = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
26847
- const translator$y = NodeTranslator.from({
26843
+ const translator$D = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblCaption", "caption"));
26844
+ const translator$C = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblDescription", "description"));
26845
+ const translator$B = NodeTranslator.from(createMeasurementPropertyHandler("w:tblInd", "tableIndent"));
26846
+ const translator$A = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblLayout", "tableLayout", "w:type"));
26847
+ const translator$z = NodeTranslator.from({
26848
26848
  xmlName: "w:tblLook",
26849
26849
  sdNodeOrKeyName: "tblLook",
26850
26850
  attributes: ["w:firstColumn", "w:firstRow", "w:lastColumn", "w:lastRow", "w:noHBand", "w:noVBand"].map((attr) => createAttributeHandler(attr, null, parseBoolean, booleanToString)).concat([createAttributeHandler("w:val")]),
@@ -26856,16 +26856,16 @@ const translator$y = NodeTranslator.from({
26856
26856
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26857
26857
  }
26858
26858
  });
26859
- const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
26860
- const translator$w = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
26861
- const translator$v = NodeTranslator.from(
26859
+ const translator$y = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblOverlap", "overlap"));
26860
+ const translator$x = NodeTranslator.from(createSingleAttrPropertyHandler("w:tblStyle", "tableStyleId"));
26861
+ const translator$w = NodeTranslator.from(
26862
26862
  createSingleAttrPropertyHandler("w:tblStyleColBandSize", "tableStyleColBandSize")
26863
26863
  );
26864
- const translator$u = NodeTranslator.from(
26864
+ const translator$v = NodeTranslator.from(
26865
26865
  createSingleAttrPropertyHandler("w:tblStyleRowBandSize", "tableStyleRowBandSize")
26866
26866
  );
26867
- const translator$t = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
26868
- const translator$s = NodeTranslator.from({
26867
+ const translator$u = NodeTranslator.from(createMeasurementPropertyHandler("w:tblW", "tableWidth"));
26868
+ const translator$t = NodeTranslator.from({
26869
26869
  xmlName: "w:tblpPr",
26870
26870
  sdNodeOrKeyName: "floatingTableProperties",
26871
26871
  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))),
@@ -26877,29 +26877,29 @@ const translator$s = NodeTranslator.from({
26877
26877
  return Object.keys(decodedAttrs).length > 0 ? { attributes: decodedAttrs } : void 0;
26878
26878
  }
26879
26879
  });
26880
- const translator$r = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
26881
- const translator$q = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
26882
- const translator$p = NodeTranslator.from(createBorderPropertyHandler("w:end"));
26883
- const translator$o = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
26884
- const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
26885
- const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
26886
- const translator$l = NodeTranslator.from(createBorderPropertyHandler("w:left"));
26887
- const translator$k = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
26888
- const translator$j = NodeTranslator.from(createBorderPropertyHandler("w:right"));
26889
- const translator$i = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
26890
- const translator$h = NodeTranslator.from(createBorderPropertyHandler("w:start"));
26891
- const translator$g = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
26892
- const translator$f = NodeTranslator.from(createBorderPropertyHandler("w:top"));
26893
- const translator$e = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
26894
- const XML_NODE_NAME$c = "w:tblBorders";
26880
+ const translator$s = NodeTranslator.from(createBorderPropertyHandler("w:bottom"));
26881
+ const translator$r = NodeTranslator.from(createMeasurementPropertyHandler("w:bottom", "marginBottom"));
26882
+ const translator$q = NodeTranslator.from(createBorderPropertyHandler("w:end"));
26883
+ const translator$p = NodeTranslator.from(createMeasurementPropertyHandler("w:end", "marginEnd"));
26884
+ const translator$o = NodeTranslator.from(createBorderPropertyHandler("w:insideH"));
26885
+ const translator$n = NodeTranslator.from(createBorderPropertyHandler("w:insideV"));
26886
+ const translator$m = NodeTranslator.from(createBorderPropertyHandler("w:left"));
26887
+ const translator$l = NodeTranslator.from(createMeasurementPropertyHandler("w:left", "marginLeft"));
26888
+ const translator$k = NodeTranslator.from(createBorderPropertyHandler("w:right"));
26889
+ const translator$j = NodeTranslator.from(createMeasurementPropertyHandler("w:right", "marginRight"));
26890
+ const translator$i = NodeTranslator.from(createBorderPropertyHandler("w:start"));
26891
+ const translator$h = NodeTranslator.from(createMeasurementPropertyHandler("w:start", "marginStart"));
26892
+ const translator$g = NodeTranslator.from(createBorderPropertyHandler("w:top"));
26893
+ const translator$f = NodeTranslator.from(createMeasurementPropertyHandler("w:top", "marginTop"));
26894
+ const XML_NODE_NAME$d = "w:tblBorders";
26895
26895
  const SD_ATTR_KEY$3 = "borders";
26896
- const encode$j = (params2) => {
26896
+ const encode$k = (params2) => {
26897
26897
  const { nodes } = params2;
26898
26898
  const node = nodes[0];
26899
26899
  const attributes = encodeProperties(node, tblBordersTranslatorsByXmlName);
26900
26900
  return Object.keys(attributes).length > 0 ? attributes : void 0;
26901
26901
  };
26902
- const decode$j = (params2) => {
26902
+ const decode$k = (params2) => {
26903
26903
  const { borders = {} } = params2.node.attrs || {};
26904
26904
  const elements = decodeProperties(tblBordersTranslatorsBySdName, borders);
26905
26905
  const newNode = {
@@ -26911,14 +26911,14 @@ const decode$j = (params2) => {
26911
26911
  return newNode;
26912
26912
  };
26913
26913
  const propertyTranslators$2 = [
26914
- translator$r,
26915
- translator$p,
26914
+ translator$s,
26915
+ translator$q,
26916
+ translator$o,
26916
26917
  translator$n,
26917
26918
  translator$m,
26918
- translator$l,
26919
- translator$j,
26920
- translator$h,
26921
- translator$f
26919
+ translator$k,
26920
+ translator$i,
26921
+ translator$g
26922
26922
  ];
26923
26923
  const tblBordersTranslatorsByXmlName = {};
26924
26924
  const tblBordersTranslatorsBySdName = {};
@@ -26926,27 +26926,27 @@ propertyTranslators$2.forEach((translator2) => {
26926
26926
  tblBordersTranslatorsByXmlName[translator2.xmlName] = translator2;
26927
26927
  tblBordersTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
26928
26928
  });
26929
- const translator$d = NodeTranslator.from({
26930
- xmlName: XML_NODE_NAME$c,
26929
+ const translator$e = NodeTranslator.from({
26930
+ xmlName: XML_NODE_NAME$d,
26931
26931
  sdNodeOrKeyName: SD_ATTR_KEY$3,
26932
26932
  type: NodeTranslator.translatorTypes.NODE,
26933
26933
  attributes: [],
26934
- encode: encode$j,
26935
- decode: decode$j
26934
+ encode: encode$k,
26935
+ decode: decode$k
26936
26936
  });
26937
- const XML_NODE_NAME$b = "w:tblCellMar";
26937
+ const XML_NODE_NAME$c = "w:tblCellMar";
26938
26938
  const SD_ATTR_KEY$2 = "cellMargins";
26939
- const encode$i = (params2) => {
26939
+ const encode$j = (params2) => {
26940
26940
  const { nodes } = params2;
26941
26941
  const node = nodes[0];
26942
26942
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName$1);
26943
26943
  return Object.keys(attributes).length > 0 ? attributes : void 0;
26944
26944
  };
26945
- const decode$i = (params2) => {
26945
+ const decode$j = (params2) => {
26946
26946
  const { cellMargins = {} } = params2.node.attrs || {};
26947
26947
  const elements = decodeProperties(propertyTranslatorsBySdName$1, cellMargins);
26948
26948
  const newNode = {
26949
- name: XML_NODE_NAME$b,
26949
+ name: XML_NODE_NAME$c,
26950
26950
  type: "element",
26951
26951
  attributes: {},
26952
26952
  elements
@@ -26954,12 +26954,12 @@ const decode$i = (params2) => {
26954
26954
  return newNode;
26955
26955
  };
26956
26956
  const propertyTranslators$1 = [
26957
- translator$q,
26958
- translator$o,
26959
- translator$k,
26960
- translator$i,
26961
- translator$g,
26962
- translator$e
26957
+ translator$r,
26958
+ translator$p,
26959
+ translator$l,
26960
+ translator$j,
26961
+ translator$h,
26962
+ translator$f
26963
26963
  ];
26964
26964
  const propertyTranslatorsByXmlName$1 = {};
26965
26965
  const propertyTranslatorsBySdName$1 = {};
@@ -26967,27 +26967,27 @@ propertyTranslators$1.forEach((translator2) => {
26967
26967
  propertyTranslatorsByXmlName$1[translator2.xmlName] = translator2;
26968
26968
  propertyTranslatorsBySdName$1[translator2.sdNodeOrKeyName] = translator2;
26969
26969
  });
26970
- const translator$c = NodeTranslator.from({
26971
- xmlName: XML_NODE_NAME$b,
26970
+ const translator$d = NodeTranslator.from({
26971
+ xmlName: XML_NODE_NAME$c,
26972
26972
  sdNodeOrKeyName: SD_ATTR_KEY$2,
26973
26973
  type: NodeTranslator.translatorTypes.NODE,
26974
26974
  attributes: [],
26975
- encode: encode$i,
26976
- decode: decode$i
26975
+ encode: encode$j,
26976
+ decode: decode$j
26977
26977
  });
26978
- const XML_NODE_NAME$a = "w:tblPr";
26978
+ const XML_NODE_NAME$b = "w:tblPr";
26979
26979
  const SD_ATTR_KEY$1 = "tableProperties";
26980
- const encode$h = (params2) => {
26980
+ const encode$i = (params2) => {
26981
26981
  const { nodes } = params2;
26982
26982
  const node = nodes[0];
26983
26983
  const attributes = encodeProperties(node, propertyTranslatorsByXmlName);
26984
26984
  return {
26985
- xmlName: XML_NODE_NAME$a,
26985
+ xmlName: XML_NODE_NAME$b,
26986
26986
  sdNodeOrKeyName: SD_ATTR_KEY$1,
26987
26987
  attributes
26988
26988
  };
26989
26989
  };
26990
- const decode$h = (params2) => {
26990
+ const decode$i = (params2) => {
26991
26991
  const { tableProperties = {} } = params2.node.attrs || {};
26992
26992
  const elements = decodeProperties(propertyTranslatorsBySdName, tableProperties);
26993
26993
  const newNode = {
@@ -26999,11 +26999,12 @@ const decode$h = (params2) => {
26999
26999
  return newNode;
27000
27000
  };
27001
27001
  const propertyTranslators = [
27002
+ translator$F,
27003
+ translator$N,
27002
27004
  translator$E,
27003
- translator$M,
27004
27005
  translator$D,
27006
+ translator$M,
27005
27007
  translator$C,
27006
- translator$L,
27007
27008
  translator$B,
27008
27009
  translator$A,
27009
27010
  translator$z,
@@ -27013,9 +27014,8 @@ const propertyTranslators = [
27013
27014
  translator$v,
27014
27015
  translator$u,
27015
27016
  translator$t,
27016
- translator$s,
27017
- translator$d,
27018
- translator$c
27017
+ translator$e,
27018
+ translator$d
27019
27019
  ];
27020
27020
  const propertyTranslatorsByXmlName = {};
27021
27021
  const propertyTranslatorsBySdName = {};
@@ -27023,14 +27023,14 @@ propertyTranslators.forEach((translator2) => {
27023
27023
  propertyTranslatorsByXmlName[translator2.xmlName] = translator2;
27024
27024
  propertyTranslatorsBySdName[translator2.sdNodeOrKeyName] = translator2;
27025
27025
  });
27026
- const config$a = {
27027
- xmlName: XML_NODE_NAME$a,
27026
+ const config$b = {
27027
+ xmlName: XML_NODE_NAME$b,
27028
27028
  sdNodeOrKeyName: SD_ATTR_KEY$1,
27029
- encode: encode$h,
27030
- decode: decode$h
27029
+ encode: encode$i,
27030
+ decode: decode$i
27031
27031
  };
27032
- const translator$b = NodeTranslator.from(config$a);
27033
- const translator$a = NodeTranslator.from(
27032
+ const translator$c = NodeTranslator.from(config$b);
27033
+ const translator$b = NodeTranslator.from(
27034
27034
  createSingleAttrPropertyHandler("w:gridCol", "col", "w:w", parseInteger, integerToString)
27035
27035
  );
27036
27036
  const DEFAULT_COLUMN_WIDTH_PX = 100;
@@ -27080,20 +27080,20 @@ const resolveFallbackColumnWidthTwips = (params2, totalColumns, cellMinWidthTwip
27080
27080
  }
27081
27081
  return Math.max(fallbackWidthTwips, cellMinWidthTwips);
27082
27082
  };
27083
- const XML_NODE_NAME$9 = "w:tblGrid";
27083
+ const XML_NODE_NAME$a = "w:tblGrid";
27084
27084
  const SD_ATTR_KEY = "grid";
27085
27085
  const cellMinWidth = pixelsToTwips(10);
27086
- const encode$g = (params2) => {
27086
+ const encode$h = (params2) => {
27087
27087
  const { nodes } = params2;
27088
27088
  const node = nodes[0];
27089
- const attributes = encodeProperties(node, { [translator$a.xmlName]: translator$a }, true);
27089
+ const attributes = encodeProperties(node, { [translator$b.xmlName]: translator$b }, true);
27090
27090
  return {
27091
- xmlName: XML_NODE_NAME$9,
27091
+ xmlName: XML_NODE_NAME$a,
27092
27092
  sdNodeOrKeyName: SD_ATTR_KEY,
27093
27093
  attributes
27094
27094
  };
27095
27095
  };
27096
- const decode$g = (params2) => {
27096
+ const decode$h = (params2) => {
27097
27097
  const { grid: rawGrid } = params2.node.attrs || {};
27098
27098
  const grid = Array.isArray(rawGrid) ? rawGrid : [];
27099
27099
  const { firstRow = {} } = params2.extraParams || {};
@@ -27112,10 +27112,10 @@ const decode$g = (params2) => {
27112
27112
  numericWidth = fallbackColumnWidthTwips;
27113
27113
  }
27114
27114
  numericWidth = Math.max(numericWidth, cellMinWidth);
27115
- const decoded = translator$a.decode({
27115
+ const decoded = translator$b.decode({
27116
27116
  node: { type: (
27117
27117
  /** @type {string} */
27118
- translator$a.sdNodeOrKeyName
27118
+ translator$b.sdNodeOrKeyName
27119
27119
  ), attrs: { col: numericWidth } }
27120
27120
  });
27121
27121
  if (decoded) elements.push(decoded);
@@ -27150,32 +27150,32 @@ const decode$g = (params2) => {
27150
27150
  columnIndex++;
27151
27151
  }
27152
27152
  const newNode = {
27153
- name: XML_NODE_NAME$9,
27153
+ name: XML_NODE_NAME$a,
27154
27154
  attributes: {},
27155
27155
  elements
27156
27156
  };
27157
27157
  return newNode;
27158
27158
  };
27159
- const config$9 = {
27160
- xmlName: XML_NODE_NAME$9,
27159
+ const config$a = {
27160
+ xmlName: XML_NODE_NAME$a,
27161
27161
  sdNodeOrKeyName: SD_ATTR_KEY,
27162
- encode: encode$g,
27163
- decode: decode$g
27162
+ encode: encode$h,
27163
+ decode: decode$h
27164
27164
  };
27165
- const translator$9 = NodeTranslator.from(config$9);
27166
- const XML_NODE_NAME$8 = "w:tbl";
27167
- const SD_NODE_NAME$8 = "table";
27168
- const encode$f = (params2, encodedAttrs) => {
27165
+ const translator$a = NodeTranslator.from(config$a);
27166
+ const XML_NODE_NAME$9 = "w:tbl";
27167
+ const SD_NODE_NAME$9 = "table";
27168
+ const encode$g = (params2, encodedAttrs) => {
27169
27169
  const { nodes } = params2;
27170
27170
  const node = nodes[0];
27171
27171
  const tblPr = node.elements.find((el) => el.name === "w:tblPr");
27172
27172
  if (tblPr) {
27173
- const encodedProperties = translator$b.encode({ ...params2, nodes: [tblPr] });
27173
+ const encodedProperties = translator$c.encode({ ...params2, nodes: [tblPr] });
27174
27174
  encodedAttrs["tableProperties"] = encodedProperties?.attributes || {};
27175
27175
  }
27176
27176
  const tblGrid = node.elements.find((el) => el.name === "w:tblGrid");
27177
27177
  if (tblGrid) {
27178
- encodedAttrs["grid"] = translator$9.encode({ ...params2, nodes: [tblGrid] }).attributes;
27178
+ encodedAttrs["grid"] = translator$a.encode({ ...params2, nodes: [tblGrid] }).attributes;
27179
27179
  }
27180
27180
  [
27181
27181
  "tableStyleId",
@@ -27216,7 +27216,7 @@ const encode$f = (params2, encodedAttrs) => {
27216
27216
  const columnWidths = (encodedAttrs["grid"] ?? []).map((item) => twipsToPixels(item.col));
27217
27217
  const content = [];
27218
27218
  rows.forEach((row) => {
27219
- const result = translator$F.encode({
27219
+ const result = translator$G.encode({
27220
27220
  ...params2,
27221
27221
  nodes: [row],
27222
27222
  extraParams: {
@@ -27235,13 +27235,13 @@ const encode$f = (params2, encodedAttrs) => {
27235
27235
  attrs: encodedAttrs
27236
27236
  };
27237
27237
  };
27238
- const decode$f = (params2, decodedAttrs) => {
27238
+ const decode$g = (params2, decodedAttrs) => {
27239
27239
  params2.node = preProcessVerticalMergeCells(params2.node, params2);
27240
27240
  const { node } = params2;
27241
27241
  const elements = translateChildNodes(params2);
27242
27242
  const firstRow = node.content?.find((n) => n.type === "tableRow");
27243
27243
  const properties = node.attrs.grid;
27244
- const element = translator$9.decode({
27244
+ const element = translator$a.decode({
27245
27245
  ...params2,
27246
27246
  node: { ...node, attrs: { ...node.attrs, grid: properties } },
27247
27247
  extraParams: {
@@ -27251,7 +27251,7 @@ const decode$f = (params2, decodedAttrs) => {
27251
27251
  if (element) elements.unshift(element);
27252
27252
  if (node.attrs?.tableProperties) {
27253
27253
  const properties2 = { ...node.attrs.tableProperties };
27254
- const element2 = translator$b.decode({
27254
+ const element2 = translator$c.decode({
27255
27255
  ...params2,
27256
27256
  node: { ...node, attrs: { ...node.attrs, tableProperties: properties2 } }
27257
27257
  });
@@ -27317,7 +27317,7 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
27317
27317
  if (baseTblPr && baseTblPr.elements) {
27318
27318
  tblPr.elements.push(...baseTblPr.elements);
27319
27319
  }
27320
- const tableProperties = translator$b.encode({ ...params2, nodes: [tblPr] }).attributes;
27320
+ const tableProperties = translator$c.encode({ ...params2, nodes: [tblPr] }).attributes;
27321
27321
  const { borders, rowBorders } = _processTableBorders(tableProperties.borders || {});
27322
27322
  if (borders) stylesToReturn.borders = borders;
27323
27323
  if (rowBorders) stylesToReturn.rowBorders = rowBorders;
@@ -27334,16 +27334,16 @@ function _getReferencedTableStyles(tableStyleReference, params2) {
27334
27334
  }
27335
27335
  return stylesToReturn;
27336
27336
  }
27337
- const config$8 = {
27338
- xmlName: XML_NODE_NAME$8,
27339
- sdNodeOrKeyName: SD_NODE_NAME$8,
27337
+ const config$9 = {
27338
+ xmlName: XML_NODE_NAME$9,
27339
+ sdNodeOrKeyName: SD_NODE_NAME$9,
27340
27340
  type: NodeTranslator.translatorTypes.NODE,
27341
- encode: encode$f,
27342
- decode: decode$f,
27341
+ encode: encode$g,
27342
+ decode: decode$g,
27343
27343
  attributes: []
27344
27344
  };
27345
- const translator$8 = NodeTranslator.from(config$8);
27346
- const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$8);
27345
+ const translator$9 = NodeTranslator.from(config$9);
27346
+ const tableNodeHandlerEntity = generateV2HandlerEntity("tableNodeHandler", translator$9);
27347
27347
  function getReferencedTableStyles(tblStyleTag, docx) {
27348
27348
  if (!tblStyleTag) return null;
27349
27349
  const stylesToReturn = {};
@@ -27705,10 +27705,10 @@ function generateCellMargins(cellMargins) {
27705
27705
  if (left2 != null) elements.push({ name: "w:left", attributes: { "w:w": pixelsToTwips(left2) } });
27706
27706
  return elements;
27707
27707
  }
27708
- const XML_NODE_NAME$7 = "w:tc";
27709
- const SD_NODE_NAME$7 = "tableCell";
27710
- const validXmlAttributes$7 = [];
27711
- function encode$e(params2, encodedAttrs) {
27708
+ const XML_NODE_NAME$8 = "w:tc";
27709
+ const SD_NODE_NAME$8 = "tableCell";
27710
+ const validXmlAttributes$8 = [];
27711
+ function encode$f(params2, encodedAttrs) {
27712
27712
  const {
27713
27713
  node,
27714
27714
  table,
@@ -27735,31 +27735,31 @@ function encode$e(params2, encodedAttrs) {
27735
27735
  }
27736
27736
  return schemaNode;
27737
27737
  }
27738
- function decode$e(params2, decodedAttrs) {
27738
+ function decode$f(params2, decodedAttrs) {
27739
27739
  const translated = translateTableCell(params2);
27740
27740
  if (decodedAttrs && Object.keys(decodedAttrs).length) {
27741
27741
  translated.attributes = { ...translated.attributes || {}, ...decodedAttrs };
27742
27742
  }
27743
27743
  return translated;
27744
27744
  }
27745
- const config$7 = {
27746
- xmlName: XML_NODE_NAME$7,
27747
- sdNodeOrKeyName: SD_NODE_NAME$7,
27745
+ const config$8 = {
27746
+ xmlName: XML_NODE_NAME$8,
27747
+ sdNodeOrKeyName: SD_NODE_NAME$8,
27748
27748
  type: NodeTranslator.translatorTypes.NODE,
27749
- encode: encode$e,
27750
- decode: decode$e,
27751
- attributes: validXmlAttributes$7
27749
+ encode: encode$f,
27750
+ decode: decode$f,
27751
+ attributes: validXmlAttributes$8
27752
27752
  };
27753
- const translator$7 = NodeTranslator.from(config$7);
27754
- const XML_NODE_NAME$6 = "w:hyperlink";
27755
- const SD_NODE_NAME$6 = "link";
27753
+ const translator$8 = NodeTranslator.from(config$8);
27754
+ const XML_NODE_NAME$7 = "w:hyperlink";
27755
+ const SD_NODE_NAME$7 = "link";
27756
27756
  const _createAttributeHandler = (xmlName, sdName) => ({
27757
27757
  xmlName,
27758
27758
  sdName,
27759
27759
  encode: (attributes) => attributes[xmlName],
27760
27760
  decode: (attributes) => attributes[sdName]
27761
27761
  });
27762
- const validXmlAttributes$6 = [
27762
+ const validXmlAttributes$7 = [
27763
27763
  _createAttributeHandler("w:anchor", "anchor"),
27764
27764
  _createAttributeHandler("w:docLocation", "docLocation"),
27765
27765
  {
@@ -27772,7 +27772,7 @@ const validXmlAttributes$6 = [
27772
27772
  _createAttributeHandler("r:id", "rId"),
27773
27773
  _createAttributeHandler("w:tgtFrame", "target")
27774
27774
  ];
27775
- const encode$d = (params2, encodedAttrs) => {
27775
+ const encode$e = (params2, encodedAttrs) => {
27776
27776
  const { nodes, docx, nodeListHandler } = params2;
27777
27777
  const node = nodes[0];
27778
27778
  let href = _resolveHref(docx, encodedAttrs);
@@ -27838,7 +27838,7 @@ const _resolveHref = (docx, encodedAttrs) => {
27838
27838
  }
27839
27839
  return href;
27840
27840
  };
27841
- function decode$d(params2) {
27841
+ function decode$e(params2) {
27842
27842
  const { node } = params2;
27843
27843
  const linkMark = node.marks.find((m2) => m2.type === "link");
27844
27844
  const linkAttrs = this.decodeAttributes({ ...params2, node: linkMark });
@@ -27882,15 +27882,15 @@ function _addNewLinkRelationship(params2, link, rId) {
27882
27882
  });
27883
27883
  return rId;
27884
27884
  }
27885
- const config$6 = {
27886
- xmlName: XML_NODE_NAME$6,
27887
- sdNodeOrKeyName: SD_NODE_NAME$6,
27885
+ const config$7 = {
27886
+ xmlName: XML_NODE_NAME$7,
27887
+ sdNodeOrKeyName: SD_NODE_NAME$7,
27888
27888
  type: NodeTranslator.translatorTypes.NODE,
27889
- encode: encode$d,
27890
- decode: decode$d,
27891
- attributes: validXmlAttributes$6
27889
+ encode: encode$e,
27890
+ decode: decode$e,
27891
+ attributes: validXmlAttributes$7
27892
27892
  };
27893
- const translator$6 = NodeTranslator.from(config$6);
27893
+ const translator$7 = NodeTranslator.from(config$7);
27894
27894
  function parseTagValueJSON(json) {
27895
27895
  if (typeof json !== "string") {
27896
27896
  return {};
@@ -28685,32 +28685,32 @@ function translateAnchorNode(params2) {
28685
28685
  elements: [...anchorElements, ...elementsWithWrap]
28686
28686
  };
28687
28687
  }
28688
- const XML_NODE_NAME$5 = "wp:anchor";
28689
- const SD_NODE_NAME$5 = ["image"];
28690
- const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28691
- function encode$c(params2) {
28688
+ const XML_NODE_NAME$6 = "wp:anchor";
28689
+ const SD_NODE_NAME$6 = ["image"];
28690
+ const validXmlAttributes$6 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28691
+ function encode$d(params2) {
28692
28692
  const { node } = params2.extraParams;
28693
28693
  if (!node || !node.type) {
28694
28694
  return null;
28695
28695
  }
28696
28696
  return handleAnchorNode(params2);
28697
28697
  }
28698
- function decode$c(params2) {
28698
+ function decode$d(params2) {
28699
28699
  const { node } = params2;
28700
28700
  if (!node || !node.type) {
28701
28701
  return null;
28702
28702
  }
28703
28703
  return translateAnchorNode(params2);
28704
28704
  }
28705
- const config$5 = {
28706
- xmlName: XML_NODE_NAME$5,
28707
- sdNodeOrKeyName: SD_NODE_NAME$5,
28705
+ const config$6 = {
28706
+ xmlName: XML_NODE_NAME$6,
28707
+ sdNodeOrKeyName: SD_NODE_NAME$6,
28708
28708
  type: NodeTranslator.translatorTypes.NODE,
28709
- encode: encode$c,
28710
- decode: decode$c,
28711
- attributes: validXmlAttributes$5
28709
+ encode: encode$d,
28710
+ decode: decode$d,
28711
+ attributes: validXmlAttributes$6
28712
28712
  };
28713
- const translator$5 = NodeTranslator.from(config$5);
28713
+ const translator$6 = NodeTranslator.from(config$6);
28714
28714
  function handleInlineNode(params2) {
28715
28715
  const { node } = params2.extraParams;
28716
28716
  if (node.name !== "wp:inline") {
@@ -28726,41 +28726,41 @@ function translateInlineNode(params2) {
28726
28726
  elements: nodeElements.elements
28727
28727
  };
28728
28728
  }
28729
- const XML_NODE_NAME$4 = "wp:inline";
28730
- const SD_NODE_NAME$4 = ["image"];
28731
- const validXmlAttributes$4 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28732
- function encode$b(params2) {
28729
+ const XML_NODE_NAME$5 = "wp:inline";
28730
+ const SD_NODE_NAME$5 = ["image"];
28731
+ const validXmlAttributes$5 = ["distT", "distB", "distL", "distR"].map((xmlName) => createAttributeHandler(xmlName));
28732
+ function encode$c(params2) {
28733
28733
  const { node } = params2.extraParams;
28734
28734
  if (!node || !node.type) {
28735
28735
  return null;
28736
28736
  }
28737
28737
  return handleInlineNode(params2);
28738
28738
  }
28739
- function decode$b(params2) {
28739
+ function decode$c(params2) {
28740
28740
  const { node } = params2;
28741
28741
  if (!node || !node.type) {
28742
28742
  return null;
28743
28743
  }
28744
28744
  return translateInlineNode(params2);
28745
28745
  }
28746
- const config$4 = {
28747
- xmlName: XML_NODE_NAME$4,
28748
- sdNodeOrKeyName: SD_NODE_NAME$4,
28746
+ const config$5 = {
28747
+ xmlName: XML_NODE_NAME$5,
28748
+ sdNodeOrKeyName: SD_NODE_NAME$5,
28749
28749
  type: NodeTranslator.translatorTypes.NODE,
28750
- encode: encode$b,
28751
- decode: decode$b,
28752
- attributes: validXmlAttributes$4
28750
+ encode: encode$c,
28751
+ decode: decode$c,
28752
+ attributes: validXmlAttributes$5
28753
28753
  };
28754
- const translator$4 = NodeTranslator.from(config$4);
28755
- const XML_NODE_NAME$3 = "w:drawing";
28756
- const SD_NODE_NAME$3 = [];
28757
- const validXmlAttributes$3 = [];
28758
- function encode$a(params2) {
28754
+ const translator$5 = NodeTranslator.from(config$5);
28755
+ const XML_NODE_NAME$4 = "w:drawing";
28756
+ const SD_NODE_NAME$4 = [];
28757
+ const validXmlAttributes$4 = [];
28758
+ function encode$b(params2) {
28759
28759
  const nodes = params2.nodes;
28760
28760
  const node = nodes[0];
28761
28761
  const translatorByChildName = {
28762
- "wp:anchor": translator$5,
28763
- "wp:inline": translator$4
28762
+ "wp:anchor": translator$6,
28763
+ "wp:inline": translator$5
28764
28764
  };
28765
28765
  return node.elements.reduce((acc, child) => {
28766
28766
  if (acc) return acc;
@@ -28769,12 +28769,12 @@ function encode$a(params2) {
28769
28769
  return translator2.encode({ ...params2, extraParams: { node: child } }) || acc;
28770
28770
  }, null);
28771
28771
  }
28772
- function decode$a(params2) {
28772
+ function decode$b(params2) {
28773
28773
  const { node } = params2;
28774
28774
  if (!node || !node.type) {
28775
28775
  return null;
28776
28776
  }
28777
- const childTranslator = node.attrs.isAnchor ? translator$5 : translator$4;
28777
+ const childTranslator = node.attrs.isAnchor ? translator$6 : translator$5;
28778
28778
  const resultNode = childTranslator.decode(params2);
28779
28779
  return wrapTextInRun(
28780
28780
  {
@@ -28784,15 +28784,15 @@ function decode$a(params2) {
28784
28784
  []
28785
28785
  );
28786
28786
  }
28787
- const config$3 = {
28788
- xmlName: XML_NODE_NAME$3,
28789
- sdNodeOrKeyName: SD_NODE_NAME$3,
28787
+ const config$4 = {
28788
+ xmlName: XML_NODE_NAME$4,
28789
+ sdNodeOrKeyName: SD_NODE_NAME$4,
28790
28790
  type: NodeTranslator.translatorTypes.NODE,
28791
- encode: encode$a,
28792
- decode: decode$a,
28793
- attributes: validXmlAttributes$3
28791
+ encode: encode$b,
28792
+ decode: decode$b,
28793
+ attributes: validXmlAttributes$4
28794
28794
  };
28795
- const translator$3 = NodeTranslator.from(config$3);
28795
+ const translator$4 = NodeTranslator.from(config$4);
28796
28796
  class CommandService {
28797
28797
  /**
28798
28798
  * @param {import('./commands/types/index.js').CommandServiceOptions} props
@@ -30130,7 +30130,7 @@ function prepareTextAnnotation(params2) {
30130
30130
  return getTextNodeForExport(attrs.displayLabel, [...marks, ...marksFromAttrs], params2);
30131
30131
  }
30132
30132
  function prepareImageAnnotation(params2, imageSize) {
30133
- return translator$3.decode({
30133
+ return translator$4.decode({
30134
30134
  ...params2,
30135
30135
  imageSize
30136
30136
  });
@@ -30367,10 +30367,10 @@ function translateStructuredContent(params2) {
30367
30367
  };
30368
30368
  return result;
30369
30369
  }
30370
- const XML_NODE_NAME$2 = "w:sdt";
30371
- const SD_NODE_NAME$2 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
30372
- const validXmlAttributes$2 = [];
30373
- function encode$9(params2) {
30370
+ const XML_NODE_NAME$3 = "w:sdt";
30371
+ const SD_NODE_NAME$3 = ["fieldAnnotation", "structuredContent", "structuredContentBlock", "documentSection"];
30372
+ const validXmlAttributes$3 = [];
30373
+ function encode$a(params2) {
30374
30374
  const nodes = params2.nodes;
30375
30375
  const node = nodes[0];
30376
30376
  const { type: sdtType, handler: handler2 } = sdtNodeTypeStrategy(node);
@@ -30380,7 +30380,7 @@ function encode$9(params2) {
30380
30380
  const result = handler2(params2);
30381
30381
  return result;
30382
30382
  }
30383
- function decode$9(params2) {
30383
+ function decode$a(params2) {
30384
30384
  const { node } = params2;
30385
30385
  if (!node || !node.type) {
30386
30386
  return null;
@@ -30396,85 +30396,85 @@ function decode$9(params2) {
30396
30396
  const result = decoder();
30397
30397
  return result;
30398
30398
  }
30399
- const config$2 = {
30400
- xmlName: XML_NODE_NAME$2,
30401
- sdNodeOrKeyName: SD_NODE_NAME$2,
30399
+ const config$3 = {
30400
+ xmlName: XML_NODE_NAME$3,
30401
+ sdNodeOrKeyName: SD_NODE_NAME$3,
30402
30402
  type: NodeTranslator.translatorTypes.NODE,
30403
- encode: encode$9,
30404
- decode: decode$9,
30405
- attributes: validXmlAttributes$2
30403
+ encode: encode$a,
30404
+ decode: decode$a,
30405
+ attributes: validXmlAttributes$3
30406
30406
  };
30407
- const translator$2 = NodeTranslator.from(config$2);
30408
- const encode$8 = (attributes) => {
30407
+ const translator$3 = NodeTranslator.from(config$3);
30408
+ const encode$9 = (attributes) => {
30409
30409
  return attributes["w:id"];
30410
30410
  };
30411
- const decode$8 = (attrs) => {
30411
+ const decode$9 = (attrs) => {
30412
30412
  return attrs.id;
30413
30413
  };
30414
30414
  const attrConfig$6 = Object.freeze({
30415
30415
  xmlName: "w:id",
30416
30416
  sdName: "id",
30417
- encode: encode$8,
30418
- decode: decode$8
30417
+ encode: encode$9,
30418
+ decode: decode$9
30419
30419
  });
30420
- const encode$7 = (attributes) => {
30420
+ const encode$8 = (attributes) => {
30421
30421
  return attributes["w:name"];
30422
30422
  };
30423
- const decode$7 = (attrs) => {
30423
+ const decode$8 = (attrs) => {
30424
30424
  return attrs.name;
30425
30425
  };
30426
30426
  const attrConfig$5 = Object.freeze({
30427
30427
  xmlName: "w:name",
30428
30428
  sdName: "name",
30429
- encode: encode$7,
30430
- decode: decode$7
30429
+ encode: encode$8,
30430
+ decode: decode$8
30431
30431
  });
30432
- const encode$6 = (attributes) => {
30432
+ const encode$7 = (attributes) => {
30433
30433
  return attributes["w:colFirst"];
30434
30434
  };
30435
- const decode$6 = (attrs) => {
30435
+ const decode$7 = (attrs) => {
30436
30436
  return attrs.colFirst;
30437
30437
  };
30438
30438
  const attrConfig$4 = Object.freeze({
30439
30439
  xmlName: "w:colFirst",
30440
30440
  sdName: "colFirst",
30441
- encode: encode$6,
30442
- decode: decode$6
30441
+ encode: encode$7,
30442
+ decode: decode$7
30443
30443
  });
30444
- const encode$5 = (attributes) => {
30444
+ const encode$6 = (attributes) => {
30445
30445
  return attributes["w:colLast"];
30446
30446
  };
30447
- const decode$5 = (attrs) => {
30447
+ const decode$6 = (attrs) => {
30448
30448
  return attrs.colLast;
30449
30449
  };
30450
30450
  const attrConfig$3 = Object.freeze({
30451
30451
  xmlName: "w:colLast",
30452
30452
  sdName: "colLast",
30453
- encode: encode$5,
30454
- decode: decode$5
30453
+ encode: encode$6,
30454
+ decode: decode$6
30455
30455
  });
30456
- const encode$4 = (attributes) => {
30456
+ const encode$5 = (attributes) => {
30457
30457
  return attributes["w:displacedByCustomXml"];
30458
30458
  };
30459
- const decode$4 = (attrs) => {
30459
+ const decode$5 = (attrs) => {
30460
30460
  return attrs.displacedByCustomXml;
30461
30461
  };
30462
30462
  const attrConfig$2 = Object.freeze({
30463
30463
  xmlName: "w:displacedByCustomXml",
30464
30464
  sdName: "displacedByCustomXml",
30465
- encode: encode$4,
30466
- decode: decode$4
30465
+ encode: encode$5,
30466
+ decode: decode$5
30467
30467
  });
30468
- const validXmlAttributes$1 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
30469
- const XML_NODE_NAME$1 = "w:bookmarkStart";
30470
- const SD_NODE_NAME$1 = "bookmarkStart";
30471
- const encode$3 = (params2, encodedAttrs = {}) => {
30468
+ const validXmlAttributes$2 = [attrConfig$6, attrConfig$5, attrConfig$4, attrConfig$3, attrConfig$2];
30469
+ const XML_NODE_NAME$2 = "w:bookmarkStart";
30470
+ const SD_NODE_NAME$2 = "bookmarkStart";
30471
+ const encode$4 = (params2, encodedAttrs = {}) => {
30472
30472
  return {
30473
30473
  type: "bookmarkStart",
30474
30474
  attrs: encodedAttrs
30475
30475
  };
30476
30476
  };
30477
- const decode$3 = (params2, decodedAttrs = {}) => {
30477
+ const decode$4 = (params2, decodedAttrs = {}) => {
30478
30478
  const result = {
30479
30479
  name: "w:bookmarkStart",
30480
30480
  elements: []
@@ -30484,49 +30484,49 @@ const decode$3 = (params2, decodedAttrs = {}) => {
30484
30484
  }
30485
30485
  return result;
30486
30486
  };
30487
- const config$1 = {
30488
- xmlName: XML_NODE_NAME$1,
30489
- sdNodeOrKeyName: SD_NODE_NAME$1,
30487
+ const config$2 = {
30488
+ xmlName: XML_NODE_NAME$2,
30489
+ sdNodeOrKeyName: SD_NODE_NAME$2,
30490
30490
  type: NodeTranslator.translatorTypes.NODE,
30491
- encode: encode$3,
30492
- decode: decode$3,
30493
- attributes: validXmlAttributes$1
30491
+ encode: encode$4,
30492
+ decode: decode$4,
30493
+ attributes: validXmlAttributes$2
30494
30494
  };
30495
- const translator$1 = NodeTranslator.from(config$1);
30496
- const encode$2 = (attributes) => {
30495
+ const translator$2 = NodeTranslator.from(config$2);
30496
+ const encode$3 = (attributes) => {
30497
30497
  return attributes["w:id"];
30498
30498
  };
30499
- const decode$2 = (attrs) => {
30499
+ const decode$3 = (attrs) => {
30500
30500
  return attrs.id;
30501
30501
  };
30502
30502
  const attrConfig$1 = Object.freeze({
30503
30503
  xmlName: "w:id",
30504
30504
  sdName: "id",
30505
- encode: encode$2,
30506
- decode: decode$2
30505
+ encode: encode$3,
30506
+ decode: decode$3
30507
30507
  });
30508
- const encode$1 = (attributes) => {
30508
+ const encode$2 = (attributes) => {
30509
30509
  return attributes["w:displacedByCustomXml"];
30510
30510
  };
30511
- const decode$1 = (attrs) => {
30511
+ const decode$2 = (attrs) => {
30512
30512
  return attrs.displacedByCustomXml;
30513
30513
  };
30514
30514
  const attrConfig = Object.freeze({
30515
30515
  xmlName: "w:displacedByCustomXml",
30516
30516
  sdName: "displacedByCustomXml",
30517
- encode: encode$1,
30518
- decode: decode$1
30517
+ encode: encode$2,
30518
+ decode: decode$2
30519
30519
  });
30520
- const validXmlAttributes = [attrConfig$1, attrConfig];
30521
- const XML_NODE_NAME = "w:bookmarkEnd";
30522
- const SD_NODE_NAME = "bookmarkEnd";
30523
- const encode$18 = (params2, encodedAttrs = {}) => {
30520
+ const validXmlAttributes$1 = [attrConfig$1, attrConfig];
30521
+ const XML_NODE_NAME$1 = "w:bookmarkEnd";
30522
+ const SD_NODE_NAME$1 = "bookmarkEnd";
30523
+ const encode$1 = (params2, encodedAttrs = {}) => {
30524
30524
  return {
30525
30525
  type: "bookmarkEnd",
30526
30526
  attrs: encodedAttrs
30527
30527
  };
30528
30528
  };
30529
- const decode = (params2, decodedAttrs = {}) => {
30529
+ const decode$1 = (params2, decodedAttrs = {}) => {
30530
30530
  const result = {
30531
30531
  name: "w:bookmarkEnd",
30532
30532
  elements: []
@@ -30536,11 +30536,60 @@ const decode = (params2, decodedAttrs = {}) => {
30536
30536
  }
30537
30537
  return result;
30538
30538
  };
30539
+ const config$1 = {
30540
+ xmlName: XML_NODE_NAME$1,
30541
+ sdNodeOrKeyName: SD_NODE_NAME$1,
30542
+ type: NodeTranslator.translatorTypes.NODE,
30543
+ encode: encode$1,
30544
+ decode: decode$1,
30545
+ attributes: validXmlAttributes$1
30546
+ };
30547
+ const translator$1 = NodeTranslator.from(config$1);
30548
+ const XML_NODE_NAME = "mc:AlternateContent";
30549
+ const SD_NODE_NAME = [];
30550
+ const validXmlAttributes = [];
30551
+ function encode$19(params2) {
30552
+ const { nodeListHandler } = params2;
30553
+ const { node } = params2.extraParams;
30554
+ if (!node || !node.type) {
30555
+ return null;
30556
+ }
30557
+ const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
30558
+ const wpsNode = node.elements.find(
30559
+ (el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
30560
+ );
30561
+ if (!wpsNode) {
30562
+ return null;
30563
+ }
30564
+ const contents = wpsNode.elements;
30565
+ return nodeListHandler.handler({
30566
+ ...params2,
30567
+ nodes: contents,
30568
+ path: [...params2.path || [], wpsNode]
30569
+ });
30570
+ }
30571
+ function decode(params2) {
30572
+ const { node } = params2;
30573
+ const { drawingContent } = node.attrs;
30574
+ const drawing = {
30575
+ name: "w:drawing",
30576
+ elements: [...drawingContent ? [...drawingContent.elements || []] : []]
30577
+ };
30578
+ const choice = {
30579
+ name: "mc:Choice",
30580
+ attributes: { Requires: "wps" },
30581
+ elements: [drawing]
30582
+ };
30583
+ return {
30584
+ name: "mc:AlternateContent",
30585
+ elements: [choice]
30586
+ };
30587
+ }
30539
30588
  const config = {
30540
30589
  xmlName: XML_NODE_NAME,
30541
30590
  sdNodeOrKeyName: SD_NODE_NAME,
30542
30591
  type: NodeTranslator.translatorTypes.NODE,
30543
- encode: encode$18,
30592
+ encode: encode$19,
30544
30593
  decode,
30545
30594
  attributes: validXmlAttributes
30546
30595
  };
@@ -30559,30 +30608,30 @@ function exportSchemaToJson(params2) {
30559
30608
  doc: translateDocumentNode,
30560
30609
  body: translateBodyNode,
30561
30610
  heading: translateHeadingNode,
30562
- paragraph: translator$12,
30563
- run: translator$T,
30611
+ paragraph: translator$13,
30612
+ run: translator$U,
30564
30613
  text: translateTextNode,
30565
30614
  bulletList: translateList,
30566
30615
  orderedList: translateList,
30567
- lineBreak: translator$15,
30568
- table: translator$8,
30569
- tableRow: translator$F,
30570
- tableCell: translator$7,
30571
- bookmarkStart: translator$1,
30572
- bookmarkEnd: translator,
30573
- fieldAnnotation: translator$2,
30574
- tab: translator$13,
30575
- image: translator$3,
30576
- hardBreak: translator$15,
30616
+ lineBreak: translator$16,
30617
+ table: translator$9,
30618
+ tableRow: translator$G,
30619
+ tableCell: translator$8,
30620
+ bookmarkStart: translator$2,
30621
+ bookmarkEnd: translator$1,
30622
+ fieldAnnotation: translator$3,
30623
+ tab: translator$14,
30624
+ image: translator$4,
30625
+ hardBreak: translator$16,
30577
30626
  commentRangeStart: () => translateCommentNode(params2, "Start"),
30578
30627
  commentRangeEnd: () => translateCommentNode(params2, "End"),
30579
30628
  commentReference: () => null,
30580
30629
  shapeContainer: translateShapeContainer,
30581
30630
  shapeTextbox: translateShapeTextbox,
30582
30631
  contentBlock: translateContentBlock,
30583
- structuredContent: translator$2,
30584
- structuredContentBlock: translator$2,
30585
- documentSection: translator$2,
30632
+ structuredContent: translator$3,
30633
+ structuredContentBlock: translator$3,
30634
+ documentSection: translator$3,
30586
30635
  "page-number": translatePageNumberNode,
30587
30636
  "total-page-number": translateTotalPageNumberNode
30588
30637
  };
@@ -30921,7 +30970,7 @@ function translateTextNode(params2) {
30921
30970
  const isTrackedNode = node.marks?.some((m2) => trackedMarks.includes(m2.type));
30922
30971
  if (isTrackedNode) return translateTrackedNode(params2);
30923
30972
  const isLinkNode = node.marks?.some((m2) => m2.type === "link");
30924
- if (isLinkNode) return translator$6.decode(params2);
30973
+ if (isLinkNode) return translator$7.decode(params2);
30925
30974
  const { text, marks = [] } = node;
30926
30975
  return getTextNodeForExport(text, marks, params2);
30927
30976
  }
@@ -31227,7 +31276,7 @@ function translateMark(mark) {
31227
31276
  markElement.type = "element";
31228
31277
  break;
31229
31278
  case "underline": {
31230
- const translated = translator$$.decode({
31279
+ const translated = translator$10.decode({
31231
31280
  node: {
31232
31281
  attrs: {
31233
31282
  underlineType: attrs.underlineType ?? attrs.underline ?? null,
@@ -31291,7 +31340,7 @@ function translateMark(mark) {
31291
31340
  break;
31292
31341
  case "highlight": {
31293
31342
  const highlightValue = attrs.color ?? attrs.highlight ?? null;
31294
- const translated = translator$14.decode({ node: { attrs: { highlight: highlightValue } } });
31343
+ const translated = translator$15.decode({ node: { attrs: { highlight: highlightValue } } });
31295
31344
  return translated || {};
31296
31345
  }
31297
31346
  }
@@ -31347,23 +31396,11 @@ function translateShapeTextbox(params2) {
31347
31396
  }
31348
31397
  function translateContentBlock(params2) {
31349
31398
  const { node } = params2;
31350
- const { drawingContent, vmlAttributes, horizontalRule } = node.attrs;
31399
+ const { vmlAttributes, horizontalRule } = node.attrs;
31351
31400
  if (vmlAttributes || horizontalRule) {
31352
31401
  return translateVRectContentBlock(params2);
31353
31402
  }
31354
- const drawing = {
31355
- name: "w:drawing",
31356
- elements: [...drawingContent ? [...drawingContent.elements || []] : []]
31357
- };
31358
- const choice = {
31359
- name: "mc:Choice",
31360
- attributes: { Requires: "wps" },
31361
- elements: [drawing]
31362
- };
31363
- const alternateContent = {
31364
- name: "mc:AlternateContent",
31365
- elements: [choice]
31366
- };
31403
+ const alternateContent = translator.decode(params2);
31367
31404
  return wrapTextInRun(alternateContent);
31368
31405
  }
31369
31406
  function translateVRectContentBlock(params2) {
@@ -31567,7 +31604,7 @@ const handleDrawingNode = (params2) => {
31567
31604
  if (mainNode.name === "w:drawing") node = mainNode;
31568
31605
  else node = mainNode.elements.find((el) => el.name === "w:drawing");
31569
31606
  if (!node) return { nodes: [], consumed: 0 };
31570
- const schemaNode = translator$3.encode(params2);
31607
+ const schemaNode = translator$4.encode(params2);
31571
31608
  const newNodes = schemaNode ? [schemaNode] : [];
31572
31609
  return { nodes: newNodes, consumed: 1 };
31573
31610
  };
@@ -31669,8 +31706,8 @@ const trackChangeNodeHandlerEntity = {
31669
31706
  handlerName: "trackChangeNodeHandler",
31670
31707
  handler: handleTrackChangeNode
31671
31708
  };
31672
- const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$6);
31673
- const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$T);
31709
+ const hyperlinkNodeHandlerEntity = generateV2HandlerEntity("hyperlinkNodeHandler", translator$7);
31710
+ const runNodeHandlerEntity = generateV2HandlerEntity("runNodeHandler", translator$U);
31674
31711
  const handleTextNode = (params2) => {
31675
31712
  const { nodes, insideTrackChange } = params2;
31676
31713
  if (nodes.length === 0 || !(nodes[0].name === "w:t" || insideTrackChange && nodes[0].name === "w:delText")) {
@@ -31711,7 +31748,7 @@ const handleParagraphNode = (params2) => {
31711
31748
  if (nodes.length === 0 || nodes[0].name !== "w:p") {
31712
31749
  return { nodes: [], consumed: 0 };
31713
31750
  }
31714
- const schemaNode = translator$12.encode(params2);
31751
+ const schemaNode = translator$13.encode(params2);
31715
31752
  const newNodes = schemaNode ? [schemaNode] : [];
31716
31753
  return { nodes: newNodes, consumed: 1 };
31717
31754
  };
@@ -31724,7 +31761,7 @@ const handleSdtNode = (params2) => {
31724
31761
  if (nodes.length === 0 || nodes[0].name !== "w:sdt") {
31725
31762
  return { nodes: [], consumed: 0 };
31726
31763
  }
31727
- const result = translator$2.encode(params2);
31764
+ const result = translator$3.encode(params2);
31728
31765
  if (!result) {
31729
31766
  return { nodes: [], consumed: 0 };
31730
31767
  }
@@ -31814,7 +31851,7 @@ const handler = (params2) => {
31814
31851
  if (nodes.length === 0 || nodes[0].name !== "w:br") {
31815
31852
  return { nodes: [], consumed: 0 };
31816
31853
  }
31817
- const result = translator$15.encode(params2);
31854
+ const result = translator$16.encode(params2);
31818
31855
  if (!result) return { nodes: [], consumed: 0 };
31819
31856
  return {
31820
31857
  nodes: [result],
@@ -31886,7 +31923,7 @@ const handleBookmarkStartNode = (params2) => {
31886
31923
  if (isCustomMarkBookmark(nodes[0], params2.editor)) {
31887
31924
  return handleBookmarkNode(params2);
31888
31925
  }
31889
- const node = translator$1.encode(params2);
31926
+ const node = translator$2.encode(params2);
31890
31927
  if (!node) return { nodes: [], consumed: 0 };
31891
31928
  return { nodes: [node], consumed: 1 };
31892
31929
  };
@@ -31918,7 +31955,7 @@ const handleBookmarkEndNode = (params2) => {
31918
31955
  if (!nodes.length || nodes[0].name !== "w:bookmarkEnd") {
31919
31956
  return { nodes: [], consumed: 0 };
31920
31957
  }
31921
- const node = translator.encode(params2);
31958
+ const node = translator$1.encode(params2);
31922
31959
  if (!node) return { nodes: [], consumed: 0 };
31923
31960
  return { nodes: [node], consumed: 1 };
31924
31961
  };
@@ -31926,32 +31963,86 @@ const bookmarkEndNodeHandlerEntity = {
31926
31963
  handlerName: "w:bookmarkEndTranslator",
31927
31964
  handler: handleBookmarkEndNode
31928
31965
  };
31966
+ const ALTERNATE_CONTENT_NODE = "mc:AlternateContent";
31967
+ const SUPPORTED_REQUIRES = /* @__PURE__ */ new Set([
31968
+ "wps",
31969
+ "wp14",
31970
+ "w14",
31971
+ "w15",
31972
+ "w16",
31973
+ "w16cex",
31974
+ "w16cid",
31975
+ "w16du",
31976
+ "w16sdtdh",
31977
+ "w16sdtfl",
31978
+ "w16se"
31979
+ ]);
31980
+ const skipHandlerResponse = { nodes: [], consumed: 0 };
31981
+ const isAlternateContentNode = (node) => node?.name === ALTERNATE_CONTENT_NODE;
31982
+ const isSupportedChoice = (choice) => {
31983
+ if (!choice?.attributes) return false;
31984
+ const requires = choice.attributes.Requires || choice.attributes.requires;
31985
+ if (!requires) return false;
31986
+ return requires.split(/\s+/).filter(Boolean).some((namespace2) => SUPPORTED_REQUIRES.has(namespace2));
31987
+ };
31988
+ const resolveAlternateContentElements = (alternateContent) => {
31989
+ if (!alternateContent?.elements?.length) return null;
31990
+ const choices = alternateContent.elements.filter((el) => el.name === "mc:Choice");
31991
+ const fallback = alternateContent.elements.find((el) => el.name === "mc:Fallback");
31992
+ const supportedChoice = choices.find(isSupportedChoice);
31993
+ const selectedElements = supportedChoice?.elements || fallback?.elements || choices[0]?.elements;
31994
+ if (!selectedElements) return null;
31995
+ return carbonCopy(selectedElements);
31996
+ };
31997
+ const buildNodeWithoutAlternateContent = (node) => {
31998
+ const { elements } = node || {};
31999
+ if (!elements?.length) return null;
32000
+ let replaced = false;
32001
+ const updatedElements = [];
32002
+ elements.forEach((element) => {
32003
+ if (isAlternateContentNode(element)) {
32004
+ const resolved = resolveAlternateContentElements(element);
32005
+ if (resolved) {
32006
+ updatedElements.push(...resolved);
32007
+ replaced = true;
32008
+ return;
32009
+ }
32010
+ updatedElements.push(carbonCopy(element));
32011
+ return;
32012
+ }
32013
+ updatedElements.push(carbonCopy(element));
32014
+ });
32015
+ if (!replaced) return null;
32016
+ const clone = carbonCopy(node);
32017
+ clone.elements = updatedElements;
32018
+ return clone;
32019
+ };
31929
32020
  const handleAlternateChoice = (params2) => {
31930
- const skipHandlerResponse = { nodes: [], consumed: 0 };
31931
32021
  const { nodes, nodeListHandler } = params2;
31932
- if (nodes.length === 0 || nodes[0].name !== "w:p") {
32022
+ if (!nodes?.length) {
31933
32023
  return skipHandlerResponse;
31934
32024
  }
31935
- const mainNode = nodes[0];
31936
- const node = mainNode?.elements?.find((el) => el.name === "w:r");
31937
- const hasAltChoice = node?.elements?.some((el) => el.name === "mc:AlternateContent");
31938
- if (!hasAltChoice) {
31939
- return skipHandlerResponse;
32025
+ const [currentNode] = nodes;
32026
+ if (isAlternateContentNode(currentNode)) {
32027
+ const resolvedElements = resolveAlternateContentElements(currentNode);
32028
+ if (!resolvedElements) {
32029
+ return skipHandlerResponse;
32030
+ }
32031
+ const result2 = nodeListHandler.handler({
32032
+ ...params2,
32033
+ nodes: resolvedElements,
32034
+ path: [...params2.path || [], currentNode]
32035
+ });
32036
+ return { nodes: result2, consumed: 1 };
31940
32037
  }
31941
- const altChoiceNode = node.elements.find((el) => el.name === "mc:AlternateContent");
31942
- node.elements.findIndex((el) => el.name === "mc:AlternateContent");
31943
- const allowedNamespaces = ["wps", "wp14", "w14", "w15"];
31944
- const wpsNode = altChoiceNode.elements.find(
31945
- (el) => el.name === "mc:Choice" && allowedNamespaces.includes(el.attributes["Requires"])
31946
- );
31947
- if (!wpsNode) {
32038
+ const sanitizedNode = buildNodeWithoutAlternateContent(currentNode);
32039
+ if (!sanitizedNode) {
31948
32040
  return skipHandlerResponse;
31949
32041
  }
31950
- const contents = wpsNode.elements;
31951
32042
  const result = nodeListHandler.handler({
31952
32043
  ...params2,
31953
- nodes: contents,
31954
- path: [...params2.path || [], wpsNode]
32044
+ nodes: [sanitizedNode],
32045
+ path: [...params2.path || [], sanitizedNode]
31955
32046
  });
31956
32047
  return { nodes: result, consumed: 1 };
31957
32048
  };
@@ -32557,7 +32648,7 @@ const handleTabNode = (params2) => {
32557
32648
  if (!nodes.length || nodes[0].name !== "w:tab") {
32558
32649
  return { nodes: [], consumed: 0 };
32559
32650
  }
32560
- const node = translator$13.encode(params2);
32651
+ const node = translator$14.encode(params2);
32561
32652
  return { nodes: [node], consumed: 1 };
32562
32653
  };
32563
32654
  const tabNodeEntityHandler = {
@@ -47838,9 +47929,11 @@ const toggleHeaderFooterEditMode = ({ editor, focusedSectionEditor, isEditMode,
47838
47929
  item.editor.view.dom.setAttribute("documentmode", documentMode);
47839
47930
  });
47840
47931
  if (isEditMode) {
47841
- const pm = document.querySelector(".ProseMirror");
47842
- pm.classList.add("header-footer-edit");
47843
- pm.setAttribute("aria-readonly", true);
47932
+ const pm = editor.view?.dom;
47933
+ if (pm) {
47934
+ pm.classList.add("header-footer-edit");
47935
+ pm.setAttribute("aria-readonly", true);
47936
+ }
47844
47937
  }
47845
47938
  if (focusedSectionEditor) {
47846
47939
  focusedSectionEditor.view.focus();
@@ -50452,7 +50545,7 @@ const _Editor = class _Editor2 extends EventEmitter$1 {
50452
50545
  setDocumentMode(documentMode) {
50453
50546
  let cleanedMode = documentMode?.toLowerCase() || "editing";
50454
50547
  if (!this.extensionService || !this.state) return;
50455
- const pm = document.querySelector(".ProseMirror");
50548
+ const pm = this.view?.dom;
50456
50549
  if (this.options.role === "viewer") cleanedMode = "viewing";
50457
50550
  if (this.options.role === "suggester" && cleanedMode === "editing") cleanedMode = "suggesting";
50458
50551
  if (cleanedMode === "viewing") {
@@ -51424,9 +51517,11 @@ createView_fn = function(element) {
51424
51517
  isEditMode: false,
51425
51518
  documentMode: this.options.documentMode
51426
51519
  });
51427
- const pm = document.querySelector(".ProseMirror");
51428
- pm.classList.remove("header-footer-edit");
51429
- pm.setAttribute("aria-readonly", false);
51520
+ const pm = this.view?.dom;
51521
+ if (pm) {
51522
+ pm.classList.remove("header-footer-edit");
51523
+ pm.setAttribute("aria-readonly", false);
51524
+ }
51430
51525
  }
51431
51526
  setWordSelection(view, pos);
51432
51527
  }
@@ -69361,6 +69456,45 @@ const Search = Extension.create({
69361
69456
  };
69362
69457
  }
69363
69458
  });
69459
+ let cachedShadowRootCtor;
69460
+ const getShadowRootCtor = () => {
69461
+ if (cachedShadowRootCtor === void 0) {
69462
+ const ctor = globalThis.ShadowRoot;
69463
+ cachedShadowRootCtor = typeof ctor === "function" ? ctor : null;
69464
+ }
69465
+ return cachedShadowRootCtor;
69466
+ };
69467
+ let cachedElementCtor;
69468
+ const getElementCtor = () => {
69469
+ if (cachedElementCtor === void 0) {
69470
+ const ctor = globalThis.Element;
69471
+ cachedElementCtor = typeof ctor === "function" ? ctor : null;
69472
+ }
69473
+ return cachedElementCtor;
69474
+ };
69475
+ const queryWithinRoot = (domNode, selector) => {
69476
+ const shadowRoot = domNode?.shadowRoot;
69477
+ if (shadowRoot && typeof shadowRoot.querySelector === "function") {
69478
+ return shadowRoot.querySelector(selector);
69479
+ }
69480
+ const rawRoot = domNode?.getRootNode?.();
69481
+ const ShadowRootCtor = getShadowRootCtor();
69482
+ const isShadowRoot2 = !!ShadowRootCtor && rawRoot instanceof ShadowRootCtor;
69483
+ if (isShadowRoot2 && typeof rawRoot.querySelector === "function") {
69484
+ return rawRoot.querySelector(selector);
69485
+ }
69486
+ if (domNode && typeof domNode.querySelector === "function") {
69487
+ const localMatch = domNode.querySelector(selector);
69488
+ if (localMatch) return localMatch;
69489
+ }
69490
+ return typeof document !== "undefined" ? document.querySelector(selector) : null;
69491
+ };
69492
+ const findInEventPath = (event, selector) => {
69493
+ if (!event || !selector) return void 0;
69494
+ const path = typeof event.composedPath === "function" ? event.composedPath() : [];
69495
+ const ElementCtor = getElementCtor();
69496
+ return path.find((node) => ElementCtor && node instanceof ElementCtor && node.matches(selector));
69497
+ };
69364
69498
  const NodeResizerKey = new PluginKey("node-resizer");
69365
69499
  const nodeResizer = (nodeNames = ["image"], editor) => {
69366
69500
  let resizeState = {
@@ -69415,16 +69549,19 @@ const nodeResizer = (nodeNames = ["image"], editor) => {
69415
69549
  view(view) {
69416
69550
  editorView = view;
69417
69551
  globalClickHandler = (event) => {
69418
- if (!event.target.closest(".sd-editor-resizable-wrapper") && !event.target.closest(".sd-editor-resize-container")) {
69552
+ const wrapperInPath = findInEventPath(event, ".sd-editor-resizable-wrapper");
69553
+ const containerInPath = findInEventPath(event, ".sd-editor-resize-container");
69554
+ if (!wrapperInPath && !containerInPath) {
69419
69555
  hideResizeHandles();
69420
69556
  }
69421
69557
  };
69422
69558
  document.addEventListener("click", globalClickHandler);
69423
69559
  globalMousedownHandler = (event) => {
69424
- if (event.target.closest(".sd-editor-resize-handle")) {
69560
+ const handle = findInEventPath(event, ".sd-editor-resize-handle");
69561
+ if (handle) {
69425
69562
  event.preventDefault();
69426
69563
  event.stopPropagation();
69427
- startResize(editorView, event, event.target);
69564
+ startResize(editorView, event, handle);
69428
69565
  return true;
69429
69566
  }
69430
69567
  };
@@ -69441,7 +69578,7 @@ const nodeResizer = (nodeNames = ["image"], editor) => {
69441
69578
  const prevSelection = prevState.selection;
69442
69579
  if (selection.from !== prevSelection.from || selection.to !== prevSelection.to) {
69443
69580
  setTimeout(() => {
69444
- const selectedResizableWrapper = document.querySelector(".sd-editor-resizable-wrapper");
69581
+ const selectedResizableWrapper = queryWithinRoot(editorView?.dom, ".sd-editor-resizable-wrapper");
69445
69582
  if (selectedResizableWrapper) {
69446
69583
  showResizeHandles(view2, selectedResizableWrapper);
69447
69584
  } else {
@@ -79554,6 +79691,7 @@ const _sfc_main$1$1 = {
79554
79691
  const toolbarItemRefs = ref$1([]);
79555
79692
  const props = __props;
79556
79693
  const currentItem = ref$1(null);
79694
+ const { proxy } = getCurrentInstance();
79557
79695
  const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
79558
79696
  const isMobile = window.matchMedia("(max-width: 768px)").matches;
79559
79697
  const styleMap = {
@@ -79652,10 +79790,8 @@ const _sfc_main$1$1 = {
79652
79790
  nextButtonGroup.setAttribute("tabindex", "0");
79653
79791
  nextButtonGroup.focus();
79654
79792
  } else {
79655
- const editor = document.querySelector(".ProseMirror");
79656
- if (editor) {
79657
- editor.focus();
79658
- }
79793
+ const editorDom = proxy?.$toolbar?.activeEditor?.view?.dom;
79794
+ editorDom?.focus();
79659
79795
  }
79660
79796
  };
79661
79797
  const moveToPreviousButtonGroup = (e) => {
@@ -79801,7 +79937,7 @@ const _sfc_main$1$1 = {
79801
79937
  };
79802
79938
  }
79803
79939
  };
79804
- const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1$1, [["__scopeId", "data-v-f42ec7e6"]]);
79940
+ const ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1$1, [["__scopeId", "data-v-c1b3551b"]]);
79805
79941
  const _sfc_main$f = {
79806
79942
  __name: "Toolbar",
79807
79943
  emits: ["command", "toggle", "select"],
@@ -83552,6 +83688,115 @@ runCommandWithArgumentOnly_fn = function({ item, argument, noArgumentCallback =
83552
83688
  this.updateToolbarState();
83553
83689
  }
83554
83690
  };
83691
+ const onMarginClickCursorChange = (event, editor) => {
83692
+ const y2 = event.clientY;
83693
+ const x = event.clientX;
83694
+ const { view } = editor;
83695
+ const editorRect = view.dom.getBoundingClientRect();
83696
+ let coords = {
83697
+ left: 0,
83698
+ top: y2
83699
+ };
83700
+ let isRightMargin = false;
83701
+ if (x > editorRect.right) {
83702
+ coords.left = editorRect.left + editorRect.width - 1;
83703
+ isRightMargin = true;
83704
+ } else if (x < editorRect.left) {
83705
+ coords.left = editorRect.left;
83706
+ }
83707
+ const pos = view.posAtCoords(coords)?.pos;
83708
+ if (pos) {
83709
+ let cursorPos = pos;
83710
+ if (isRightMargin) {
83711
+ const $pos = view.state.doc.resolve(pos);
83712
+ const charOffset = $pos.textOffset;
83713
+ const node = view.state.doc.nodeAt(pos);
83714
+ const text = node?.text;
83715
+ const charAtPos = text?.charAt(charOffset);
83716
+ cursorPos = node?.isText && charAtPos !== " " ? pos - 1 : pos;
83717
+ }
83718
+ const transaction = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, cursorPos));
83719
+ view.dispatch(transaction);
83720
+ view.focus();
83721
+ }
83722
+ };
83723
+ const checkNodeSpecificClicks = (editor, event, popoverControls) => {
83724
+ if (!editor) return;
83725
+ if (selectionHasNodeOrMark(editor.view.state, "link", { requireEnds: true })) {
83726
+ popoverControls.component = LinkInput;
83727
+ popoverControls.position = {
83728
+ left: `${event.clientX - editor.element.getBoundingClientRect().left}px`,
83729
+ top: `${event.clientY - editor.element.getBoundingClientRect().top + 15}px`
83730
+ };
83731
+ popoverControls.props = {
83732
+ showInput: true
83733
+ };
83734
+ popoverControls.visible = true;
83735
+ }
83736
+ };
83737
+ function selectionHasNodeOrMark(state2, name, options = {}) {
83738
+ const { requireEnds = false } = options;
83739
+ const $from = state2.selection.$from;
83740
+ const $to = state2.selection.$to;
83741
+ if (requireEnds) {
83742
+ for (let d2 = $from.depth; d2 > 0; d2--) {
83743
+ if ($from.node(d2).type.name === name) {
83744
+ return true;
83745
+ }
83746
+ }
83747
+ for (let d2 = $to.depth; d2 > 0; d2--) {
83748
+ if ($to.node(d2).type.name === name) {
83749
+ return true;
83750
+ }
83751
+ }
83752
+ } else {
83753
+ for (let d2 = $from.depth; d2 > 0; d2--) {
83754
+ if ($from.node(d2).type.name === name) {
83755
+ return true;
83756
+ }
83757
+ }
83758
+ }
83759
+ const markType = state2.schema.marks[name];
83760
+ if (markType) {
83761
+ const { from: from2, to, empty: empty2 } = state2.selection;
83762
+ if (requireEnds) {
83763
+ const fromMarks = markType.isInSet($from.marks());
83764
+ const toMarks = markType.isInSet($to.marks());
83765
+ if (fromMarks || toMarks) {
83766
+ return true;
83767
+ }
83768
+ if (empty2 && markType.isInSet(state2.storedMarks || $from.marks())) {
83769
+ return true;
83770
+ }
83771
+ } else {
83772
+ if (empty2) {
83773
+ if (markType.isInSet(state2.storedMarks || $from.marks())) {
83774
+ return true;
83775
+ }
83776
+ } else {
83777
+ let hasMark = false;
83778
+ state2.doc.nodesBetween(from2, to, (node) => {
83779
+ if (markType.isInSet(node.marks)) {
83780
+ hasMark = true;
83781
+ return false;
83782
+ }
83783
+ });
83784
+ if (hasMark) return true;
83785
+ }
83786
+ }
83787
+ }
83788
+ return false;
83789
+ }
83790
+ function moveCursorToMouseEvent(event, editor) {
83791
+ const { view } = editor;
83792
+ const coords = { left: event.clientX, top: event.clientY };
83793
+ const pos = view.posAtCoords(coords)?.pos;
83794
+ if (typeof pos === "number") {
83795
+ const tr = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, pos));
83796
+ view.dispatch(tr);
83797
+ view.focus();
83798
+ }
83799
+ }
83555
83800
  const ICONS = {
83556
83801
  addRowBefore: plusIconSvg,
83557
83802
  addRowAfter: plusIconSvg,
@@ -83751,6 +83996,30 @@ const getPropsByItemId = (itemId, props) => {
83751
83996
  return baseProps;
83752
83997
  }
83753
83998
  };
83999
+ function normalizeClipboardContent(rawClipboardContent) {
84000
+ if (!rawClipboardContent) {
84001
+ return {
84002
+ html: null,
84003
+ text: null,
84004
+ hasContent: false,
84005
+ raw: null
84006
+ };
84007
+ }
84008
+ const html = typeof rawClipboardContent.html === "string" ? rawClipboardContent.html : null;
84009
+ const text = typeof rawClipboardContent.text === "string" ? rawClipboardContent.text : null;
84010
+ const hasHtml = !!html && html.trim().length > 0;
84011
+ const hasText = !!text && text.length > 0;
84012
+ const isObject2 = typeof rawClipboardContent === "object" && rawClipboardContent !== null;
84013
+ const fragmentSize = typeof rawClipboardContent.size === "number" ? rawClipboardContent.size : null;
84014
+ const nestedSize = isObject2 && rawClipboardContent.content && typeof rawClipboardContent.content.size === "number" ? rawClipboardContent.content.size : null;
84015
+ const hasFragmentContent = (fragmentSize ?? nestedSize ?? 0) > 0;
84016
+ return {
84017
+ html,
84018
+ text,
84019
+ hasContent: hasHtml || hasText || hasFragmentContent,
84020
+ raw: rawClipboardContent
84021
+ };
84022
+ }
83754
84023
  async function getEditorContext(editor, event) {
83755
84024
  const { view } = editor;
83756
84025
  const { state: state2 } = view;
@@ -83766,123 +84035,144 @@ async function getEditorContext(editor, event) {
83766
84035
  pos = from2;
83767
84036
  node = state2.doc.nodeAt(pos);
83768
84037
  }
83769
- const clipboardContent = await readFromClipboard(state2);
84038
+ const rawClipboardContent = await readFromClipboard(state2);
84039
+ const clipboardContent = normalizeClipboardContent(rawClipboardContent);
84040
+ const structureFromResolvedPos = pos !== null ? getStructureFromResolvedPos(state2, pos) : null;
84041
+ const isInTable2 = structureFromResolvedPos?.isInTable ?? selectionHasNodeOrMark(state2, "table", { requireEnds: true });
84042
+ const isInList = structureFromResolvedPos?.isInList ?? (selectionHasNodeOrMark(state2, "bulletList", { requireEnds: false }) || selectionHasNodeOrMark(state2, "orderedList", { requireEnds: false }));
84043
+ const isInSectionNode = structureFromResolvedPos?.isInSectionNode ?? selectionHasNodeOrMark(state2, "documentSection", { requireEnds: true });
84044
+ const currentNodeType = node?.type?.name || null;
84045
+ const activeMarks = [];
84046
+ if (event && pos !== null) {
84047
+ const $pos = state2.doc.resolve(pos);
84048
+ if ($pos.marks && typeof $pos.marks === "function") {
84049
+ $pos.marks().forEach((mark) => activeMarks.push(mark.type.name));
84050
+ }
84051
+ if (node && node.marks) {
84052
+ node.marks.forEach((mark) => activeMarks.push(mark.type.name));
84053
+ }
84054
+ } else {
84055
+ state2.storedMarks?.forEach((mark) => activeMarks.push(mark.type.name));
84056
+ state2.selection.$head.marks().forEach((mark) => activeMarks.push(mark.type.name));
84057
+ }
84058
+ const isTrackedChange = activeMarks.includes("trackInsert") || activeMarks.includes("trackDelete");
84059
+ let trackedChangeId = null;
84060
+ if (isTrackedChange && event && pos !== null) {
84061
+ const $pos = state2.doc.resolve(pos);
84062
+ const marksAtPos = $pos.marks();
84063
+ const trackedMark = marksAtPos.find((mark) => mark.type.name === "trackInsert" || mark.type.name === "trackDelete");
84064
+ if (trackedMark) {
84065
+ trackedChangeId = trackedMark.attrs.id;
84066
+ }
84067
+ }
84068
+ const cursorCoords = pos ? view.coordsAtPos(pos) : null;
84069
+ const cursorPosition = cursorCoords ? {
84070
+ x: cursorCoords.left,
84071
+ y: cursorCoords.top
84072
+ } : null;
83770
84073
  return {
83771
- editor,
84074
+ // Selection info
83772
84075
  selectedText,
84076
+ hasSelection: !empty2,
84077
+ selectionStart: from2,
84078
+ selectionEnd: to,
84079
+ // Document structure
84080
+ isInTable: isInTable2,
84081
+ isInList,
84082
+ isInSectionNode,
84083
+ currentNodeType,
84084
+ activeMarks,
84085
+ // Document state
84086
+ isTrackedChange,
84087
+ trackedChangeId,
84088
+ documentMode: editor.options?.documentMode || "editing",
84089
+ canUndo: computeCanUndo(editor, state2),
84090
+ canRedo: computeCanRedo(editor, state2),
84091
+ isEditable: editor.isEditable,
84092
+ // Clipboard
84093
+ clipboardContent,
84094
+ // Position and trigger info
84095
+ cursorPosition,
83773
84096
  pos,
83774
84097
  node,
83775
84098
  event,
83776
- clipboardContent
84099
+ // Editor reference for advanced use cases
84100
+ editor
83777
84101
  };
83778
84102
  }
83779
- const onMarginClickCursorChange = (event, editor) => {
83780
- const y2 = event.clientY;
83781
- const x = event.clientX;
83782
- const { view } = editor;
83783
- const editorRect = view.dom.getBoundingClientRect();
83784
- let coords = {
83785
- left: 0,
83786
- top: y2
83787
- };
83788
- let isRightMargin = false;
83789
- if (x > editorRect.right) {
83790
- coords.left = editorRect.left + editorRect.width - 1;
83791
- isRightMargin = true;
83792
- } else if (x < editorRect.left) {
83793
- coords.left = editorRect.left;
84103
+ function computeCanUndo(editor, state2) {
84104
+ if (typeof editor?.can === "function") {
84105
+ try {
84106
+ const can = editor.can();
84107
+ if (can && typeof can.undo === "function") {
84108
+ return !!can.undo();
84109
+ }
84110
+ } catch (error) {
84111
+ console.warn("[SlashMenu] Unable to determine undo availability via editor.can():", error);
84112
+ }
83794
84113
  }
83795
- const pos = view.posAtCoords(coords)?.pos;
83796
- if (pos) {
83797
- let cursorPos = pos;
83798
- if (isRightMargin) {
83799
- const $pos = view.state.doc.resolve(pos);
83800
- const charOffset = $pos.textOffset;
83801
- const node = view.state.doc.nodeAt(pos);
83802
- const text = node?.text;
83803
- const charAtPos = text?.charAt(charOffset);
83804
- cursorPos = node?.isText && charAtPos !== " " ? pos - 1 : pos;
84114
+ if (isCollaborationEnabled(editor)) {
84115
+ try {
84116
+ const undoManager = yUndoPluginKey.getState(state2)?.undoManager;
84117
+ return !!undoManager && undoManager.undoStack.length > 0;
84118
+ } catch (error) {
84119
+ console.warn("[SlashMenu] Unable to determine undo availability via y-prosemirror:", error);
83805
84120
  }
83806
- const transaction = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, cursorPos));
83807
- view.dispatch(transaction);
83808
- view.focus();
83809
84121
  }
83810
- };
83811
- const checkNodeSpecificClicks = (editor, event, popoverControls) => {
83812
- if (!editor) return;
83813
- if (selectionHasNodeOrMark(editor.view.state, "link", { requireEnds: true })) {
83814
- popoverControls.component = LinkInput;
83815
- popoverControls.position = {
83816
- left: `${event.clientX - editor.element.getBoundingClientRect().left}px`,
83817
- top: `${event.clientY - editor.element.getBoundingClientRect().top + 15}px`
83818
- };
83819
- popoverControls.props = {
83820
- showInput: true
83821
- };
83822
- popoverControls.visible = true;
84122
+ try {
84123
+ return undoDepth(state2) > 0;
84124
+ } catch (error) {
84125
+ console.warn("[SlashMenu] Unable to determine undo availability via history plugin:", error);
84126
+ return false;
83823
84127
  }
83824
- };
83825
- function selectionHasNodeOrMark(state2, name, options = {}) {
83826
- const { requireEnds = false } = options;
83827
- const $from = state2.selection.$from;
83828
- const $to = state2.selection.$to;
83829
- if (requireEnds) {
83830
- for (let d2 = $from.depth; d2 > 0; d2--) {
83831
- if ($from.node(d2).type.name === name) {
83832
- return true;
83833
- }
83834
- }
83835
- for (let d2 = $to.depth; d2 > 0; d2--) {
83836
- if ($to.node(d2).type.name === name) {
83837
- return true;
83838
- }
83839
- }
83840
- } else {
83841
- for (let d2 = $from.depth; d2 > 0; d2--) {
83842
- if ($from.node(d2).type.name === name) {
83843
- return true;
84128
+ }
84129
+ function computeCanRedo(editor, state2) {
84130
+ if (typeof editor?.can === "function") {
84131
+ try {
84132
+ const can = editor.can();
84133
+ if (can && typeof can.redo === "function") {
84134
+ return !!can.redo();
83844
84135
  }
84136
+ } catch (error) {
84137
+ console.warn("[SlashMenu] Unable to determine redo availability via editor.can():", error);
83845
84138
  }
83846
84139
  }
83847
- const markType = state2.schema.marks[name];
83848
- if (markType) {
83849
- const { from: from2, to, empty: empty2 } = state2.selection;
83850
- if (requireEnds) {
83851
- const fromMarks = markType.isInSet($from.marks());
83852
- const toMarks = markType.isInSet($to.marks());
83853
- if (fromMarks || toMarks) {
83854
- return true;
83855
- }
83856
- if (empty2 && markType.isInSet(state2.storedMarks || $from.marks())) {
83857
- return true;
83858
- }
83859
- } else {
83860
- if (empty2) {
83861
- if (markType.isInSet(state2.storedMarks || $from.marks())) {
83862
- return true;
83863
- }
83864
- } else {
83865
- let hasMark = false;
83866
- state2.doc.nodesBetween(from2, to, (node) => {
83867
- if (markType.isInSet(node.marks)) {
83868
- hasMark = true;
83869
- return false;
83870
- }
83871
- });
83872
- if (hasMark) return true;
83873
- }
84140
+ if (isCollaborationEnabled(editor)) {
84141
+ try {
84142
+ const undoManager = yUndoPluginKey.getState(state2)?.undoManager;
84143
+ return !!undoManager && undoManager.redoStack.length > 0;
84144
+ } catch (error) {
84145
+ console.warn("[SlashMenu] Unable to determine redo availability via y-prosemirror:", error);
83874
84146
  }
83875
84147
  }
83876
- return false;
84148
+ try {
84149
+ return redoDepth(state2) > 0;
84150
+ } catch (error) {
84151
+ console.warn("[SlashMenu] Unable to determine redo availability via history plugin:", error);
84152
+ return false;
84153
+ }
83877
84154
  }
83878
- function moveCursorToMouseEvent(event, editor) {
83879
- const { view } = editor;
83880
- const coords = { left: event.clientX, top: event.clientY };
83881
- const pos = view.posAtCoords(coords)?.pos;
83882
- if (typeof pos === "number") {
83883
- const tr = view.state.tr.setSelection(TextSelection$1.create(view.state.doc, pos));
83884
- view.dispatch(tr);
83885
- view.focus();
84155
+ function isCollaborationEnabled(editor) {
84156
+ return Boolean(editor?.options?.collaborationProvider && editor?.options?.ydoc);
84157
+ }
84158
+ function getStructureFromResolvedPos(state2, pos) {
84159
+ try {
84160
+ const $pos = state2.doc.resolve(pos);
84161
+ const ancestors = /* @__PURE__ */ new Set();
84162
+ for (let depth = $pos.depth; depth > 0; depth--) {
84163
+ ancestors.add($pos.node(depth).type.name);
84164
+ }
84165
+ const isInList = ancestors.has("bulletList") || ancestors.has("orderedList");
84166
+ const isInTable2 = ancestors.has("table") || ancestors.has("tableRow") || ancestors.has("tableCell") || ancestors.has("tableHeader");
84167
+ const isInSectionNode = ancestors.has("documentSection");
84168
+ return {
84169
+ isInTable: isInTable2,
84170
+ isInList,
84171
+ isInSectionNode
84172
+ };
84173
+ } catch (error) {
84174
+ console.warn("[SlashMenu] Unable to resolve position for structural context:", error);
84175
+ return null;
83886
84176
  }
83887
84177
  }
83888
84178
  const isModuleEnabled = (editorOptions, moduleName) => {
@@ -83896,8 +84186,52 @@ const isModuleEnabled = (editorOptions, moduleName) => {
83896
84186
  return true;
83897
84187
  }
83898
84188
  };
84189
+ function applyCustomMenuConfiguration(defaultSections, context) {
84190
+ const { editor } = context;
84191
+ const slashMenuConfig = editor.options?.slashMenuConfig;
84192
+ if (!slashMenuConfig) {
84193
+ return defaultSections;
84194
+ }
84195
+ let sections = [];
84196
+ if (slashMenuConfig.includeDefaultItems !== false) {
84197
+ sections = [...defaultSections];
84198
+ }
84199
+ if (slashMenuConfig.customItems && Array.isArray(slashMenuConfig.customItems)) {
84200
+ sections = [...sections, ...slashMenuConfig.customItems];
84201
+ }
84202
+ if (typeof slashMenuConfig.menuProvider === "function") {
84203
+ try {
84204
+ sections = slashMenuConfig.menuProvider(context, sections) || sections;
84205
+ } catch (error) {
84206
+ console.warn("[SlashMenu] Error in custom menuProvider:", error);
84207
+ }
84208
+ }
84209
+ return sections;
84210
+ }
84211
+ function filterCustomItems(sections, context) {
84212
+ return sections.map((section) => {
84213
+ const filteredItems = section.items.filter((item) => {
84214
+ if (typeof item.showWhen === "function") {
84215
+ try {
84216
+ return item.showWhen(context);
84217
+ } catch (error) {
84218
+ console.warn(`[SlashMenu] Error in showWhen for item ${item.id}:`, error);
84219
+ return false;
84220
+ }
84221
+ }
84222
+ return true;
84223
+ });
84224
+ return {
84225
+ ...section,
84226
+ items: filteredItems
84227
+ };
84228
+ }).filter((section) => section.items.length > 0);
84229
+ }
83899
84230
  function getItems(context) {
83900
84231
  const { editor, selectedText, trigger: trigger2, clipboardContent } = context;
84232
+ const clipboardHasContent = Boolean(
84233
+ clipboardContent?.hasContent || clipboardContent?.html || clipboardContent?.text || typeof clipboardContent?.size === "number" && clipboardContent.size > 0 || clipboardContent && typeof clipboardContent?.content?.size === "number" && clipboardContent.content.size > 0 || clipboardContent?.raw && typeof clipboardContent.raw.size === "number" && clipboardContent.raw.size > 0 || clipboardContent?.raw && typeof clipboardContent.raw?.content?.size === "number" && clipboardContent.raw.content.size > 0
84234
+ );
83901
84235
  const isInTable2 = selectionHasNodeOrMark(editor.view.state, "table", { requireEnds: true });
83902
84236
  const isInSectionNode = selectionHasNodeOrMark(editor.view.state, "documentSection", { requireEnds: true });
83903
84237
  const sections = [
@@ -84034,12 +84368,13 @@ function getItems(context) {
84034
84368
  ]
84035
84369
  }
84036
84370
  ];
84037
- const filteredSections = sections.map((section) => {
84371
+ let allSections = applyCustomMenuConfiguration(sections, context);
84372
+ const filteredSections = allSections.map((section) => {
84038
84373
  const filteredItems = section.items.filter((item) => {
84039
84374
  if (item.requiresModule && !isModuleEnabled(editor?.options, item.requiresModule)) return false;
84040
84375
  if (item.requiresSelection && !selectedText) return false;
84041
84376
  if (!item.allowedTriggers.includes(trigger2)) return false;
84042
- if (item.requiresClipboard && !clipboardContent) return false;
84377
+ if (item.requiresClipboard && !clipboardHasContent) return false;
84043
84378
  if (item.requiresTableParent && !isInTable2 || item.id === "insert-table" && isInTable2) return false;
84044
84379
  if (item.requiresSectionParent && !isInSectionNode) return false;
84045
84380
  return true;
@@ -84049,7 +84384,8 @@ function getItems(context) {
84049
84384
  items: filteredItems
84050
84385
  };
84051
84386
  }).filter((section) => section.items.length > 0);
84052
- return filteredSections;
84387
+ const finalSections = filterCustomItems(filteredSections, context);
84388
+ return finalSections;
84053
84389
  }
84054
84390
  const _hoisted_1$3 = { class: "slash-menu-items" };
84055
84391
  const _hoisted_2$1 = {
@@ -84084,6 +84420,7 @@ const _sfc_main$4 = {
84084
84420
  const menuRef = ref$1(null);
84085
84421
  const sections = ref$1([]);
84086
84422
  const selectedId = ref$1(null);
84423
+ const currentContext = ref$1(null);
84087
84424
  const handleEditorUpdate = () => {
84088
84425
  if (!props.editor?.isEditable && isOpen.value) {
84089
84426
  closeMenu({ restoreCursor: false });
@@ -84129,6 +84466,44 @@ const _sfc_main$4 = {
84129
84466
  selectedId.value = newItems[0].id;
84130
84467
  }
84131
84468
  });
84469
+ const customItemRefs = /* @__PURE__ */ new Map();
84470
+ const setCustomItemRef = (el, item) => {
84471
+ if (el && item.render) {
84472
+ customItemRefs.set(item.id, { element: el, item });
84473
+ nextTick(() => {
84474
+ renderCustomItem(item.id);
84475
+ });
84476
+ }
84477
+ };
84478
+ const renderCustomItem = async (itemId) => {
84479
+ const refData = customItemRefs.get(itemId);
84480
+ if (!refData || refData.element.hasCustomContent) return;
84481
+ const { element, item } = refData;
84482
+ try {
84483
+ if (!currentContext.value) {
84484
+ currentContext.value = await getEditorContext(props.editor);
84485
+ }
84486
+ const context = currentContext.value;
84487
+ const customElement = item.render(context);
84488
+ if (customElement instanceof HTMLElement) {
84489
+ element.innerHTML = "";
84490
+ element.appendChild(customElement);
84491
+ element.hasCustomContent = true;
84492
+ }
84493
+ } catch (error) {
84494
+ console.warn(`[SlashMenu] Error rendering custom item ${itemId}:`, error);
84495
+ element.innerHTML = `<span>${item.label || "Custom Item"}</span>`;
84496
+ element.hasCustomContent = true;
84497
+ }
84498
+ };
84499
+ const cleanupCustomItems = () => {
84500
+ customItemRefs.forEach((refData) => {
84501
+ if (refData.element) {
84502
+ refData.element.hasCustomContent = false;
84503
+ }
84504
+ });
84505
+ customItemRefs.clear();
84506
+ };
84132
84507
  const handleGlobalKeyDown = (event) => {
84133
84508
  if (event.key === "Escape") {
84134
84509
  event.preventDefault();
@@ -84179,22 +84554,23 @@ const _sfc_main$4 = {
84179
84554
  return;
84180
84555
  }
84181
84556
  event.preventDefault();
84557
+ const context = await getEditorContext(props.editor, event);
84558
+ currentContext.value = context;
84559
+ sections.value = getItems({ ...context, trigger: "click" });
84560
+ selectedId.value = flattenedItems.value[0]?.id || null;
84561
+ searchQuery.value = "";
84182
84562
  props.editor.view.dispatch(
84183
84563
  props.editor.view.state.tr.setMeta(SlashMenuPluginKey, {
84184
84564
  type: "open",
84185
- pos: props.editor.view.state.selection.from,
84565
+ pos: context?.pos ?? props.editor.view.state.selection.from,
84186
84566
  clientX: event.clientX,
84187
84567
  clientY: event.clientY
84188
84568
  })
84189
84569
  );
84190
- searchQuery.value = "";
84191
- const context = await getEditorContext(props.editor, event);
84192
- sections.value = getItems({ ...context, trigger: "click" });
84193
- selectedId.value = flattenedItems.value[0]?.id || null;
84194
84570
  };
84195
84571
  const executeCommand = async (item) => {
84196
84572
  if (props.editor) {
84197
- item.action ? await item.action(props.editor) : null;
84573
+ item.action ? await item.action(props.editor, currentContext.value) : null;
84198
84574
  if (item.component) {
84199
84575
  menuRef.value;
84200
84576
  const componentProps = getPropsByItemId(item.id, props);
@@ -84212,7 +84588,7 @@ const _sfc_main$4 = {
84212
84588
  const closeMenu = (options = { restoreCursor: true }) => {
84213
84589
  if (props.editor?.view) {
84214
84590
  const pluginState = SlashMenuPluginKey.getState(props.editor.view.state);
84215
- const { anchorPos } = pluginState;
84591
+ const anchorPos = pluginState?.anchorPos;
84216
84592
  props.editor.view.dispatch(
84217
84593
  props.editor.view.state.tr.setMeta(SlashMenuPluginKey, {
84218
84594
  type: "close"
@@ -84225,6 +84601,8 @@ const _sfc_main$4 = {
84225
84601
  props.editor.view.dispatch(tr);
84226
84602
  props.editor.view.focus();
84227
84603
  }
84604
+ cleanupCustomItems();
84605
+ currentContext.value = null;
84228
84606
  isOpen.value = false;
84229
84607
  searchQuery.value = "";
84230
84608
  sections.value = [];
@@ -84241,19 +84619,29 @@ const _sfc_main$4 = {
84241
84619
  isOpen.value = true;
84242
84620
  menuPosition.value = event.menuPosition;
84243
84621
  searchQuery.value = "";
84244
- const context = await getEditorContext(props.editor);
84245
- sections.value = getItems({ ...context, trigger: "slash" });
84246
- selectedId.value = flattenedItems.value[0]?.id || null;
84622
+ if (!currentContext.value) {
84623
+ const context = await getEditorContext(props.editor);
84624
+ currentContext.value = context;
84625
+ sections.value = getItems({ ...context, trigger: "slash" });
84626
+ selectedId.value = flattenedItems.value[0]?.id || null;
84627
+ } else if (sections.value.length === 0) {
84628
+ const trigger2 = currentContext.value.event?.type === "contextmenu" ? "click" : "slash";
84629
+ sections.value = getItems({ ...currentContext.value, trigger: trigger2 });
84630
+ selectedId.value = flattenedItems.value[0]?.id || null;
84631
+ }
84247
84632
  });
84248
84633
  props.editor.view.dom.addEventListener("contextmenu", handleRightClick);
84249
84634
  props.editor.on("slashMenu:close", () => {
84635
+ cleanupCustomItems();
84250
84636
  isOpen.value = false;
84251
84637
  searchQuery.value = "";
84638
+ currentContext.value = null;
84252
84639
  });
84253
84640
  });
84254
84641
  onBeforeUnmount(() => {
84255
84642
  document.removeEventListener("keydown", handleGlobalKeyDown);
84256
84643
  document.removeEventListener("mousedown", handleGlobalOutsideClick);
84644
+ cleanupCustomItems();
84257
84645
  if (props.editor) {
84258
84646
  try {
84259
84647
  props.editor.off("slashMenu:open");
@@ -84300,12 +84688,19 @@ const _sfc_main$4 = {
84300
84688
  class: normalizeClass(["slash-menu-item", { "is-selected": item.id === selectedId.value }]),
84301
84689
  onClick: ($event) => executeCommand(item)
84302
84690
  }, [
84303
- item.icon ? (openBlock(), createElementBlock("span", {
84691
+ item.render ? (openBlock(), createElementBlock("div", {
84304
84692
  key: 0,
84305
- class: "slash-menu-item-icon",
84306
- innerHTML: item.icon
84307
- }, null, 8, _hoisted_4)) : createCommentVNode("", true),
84308
- createBaseVNode("span", null, toDisplayString(item.label), 1)
84693
+ ref_for: true,
84694
+ ref: (el) => setCustomItemRef(el, item),
84695
+ class: "slash-menu-custom-item"
84696
+ }, null, 512)) : (openBlock(), createElementBlock(Fragment$1, { key: 1 }, [
84697
+ item.icon ? (openBlock(), createElementBlock("span", {
84698
+ key: 0,
84699
+ class: "slash-menu-item-icon",
84700
+ innerHTML: item.icon
84701
+ }, null, 8, _hoisted_4)) : createCommentVNode("", true),
84702
+ createBaseVNode("span", null, toDisplayString(item.label), 1)
84703
+ ], 64))
84309
84704
  ], 10, _hoisted_3$1);
84310
84705
  }), 128))
84311
84706
  ], 64);
@@ -84316,10 +84711,12 @@ const _sfc_main$4 = {
84316
84711
  }
84317
84712
  };
84318
84713
  function adjustPaginationBreaks(editorElem, editor) {
84319
- if (!editorElem.value || !editor?.value?.options?.scale) return;
84714
+ const hostElement = editorElem.value;
84715
+ if (!hostElement || !editor?.value?.options?.scale) return;
84320
84716
  const zoom = editor.value.options.scale;
84321
- const bounds = editorElem.value.getBoundingClientRect();
84322
- const breakNodes = editorElem.value.querySelectorAll(".pagination-break-wrapper");
84717
+ const bounds = hostElement.getBoundingClientRect();
84718
+ const searchRoot = hostElement.shadowRoot || hostElement;
84719
+ const breakNodes = searchRoot.querySelectorAll(".pagination-break-wrapper");
84323
84720
  let firstLeft;
84324
84721
  breakNodes.forEach((node) => {
84325
84722
  const nodeBounds = node.getBoundingClientRect();
@@ -84610,6 +85007,821 @@ const _sfc_main$2 = {
84610
85007
  };
84611
85008
  const GenericPopover = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-cbddcc0f"]]);
84612
85009
  const BlankDOCX = "data:application/octet-stream;base64,UEsDBBQABgAIAAAAIQAykW9XZgEAAKUFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0lMtqwzAQRfeF/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AAA8AAAAAAAAAAAAAAAAAVRwAAHdvcmQvc3R5bGVzLnhtbFBLAQItABQABgAIAAAAIQC+fnZiXgEAANADAAAUAAAAAAAAAAAAAAAAAG0sAAB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQC6dnA8swIAANgLAAASAAAAAAAAAAAAAAAAAP0tAAB3b3JkL2ZvbnRUYWJsZS54bWxQSwECLQAUAAYACAAAACEACvOn+GwBAADtAgAAEQAAAAAAAAAAAAAAAADgMAAAZG9jUHJvcHMvY29yZS54bWxQSwECLQAUAAYACAAAACEAIRivWWsBAADFAgAAEAAAAAAAAAAAAAAAAACDMwAAZG9jUHJvcHMvYXBwLnhtbFBLBQYAAAAADAAMAAEDAAAkNgAAAAA=";
85010
+ const editorStyles = `:root {
85011
+ /* CSS variables */
85012
+ }
85013
+ .sd-input-active {
85014
+ border: 1px solid #1355ff !important;
85015
+ }
85016
+ .sd-super-editor-html .ProseMirror {
85017
+ border: 1px solid #d9d9d9;
85018
+ outline: none;
85019
+ border-radius: 8px;
85020
+ height: 100%;
85021
+ width: 100%;
85022
+ outline: none;
85023
+ }
85024
+ a {
85025
+ text-decoration: auto;
85026
+ }
85027
+ /**
85028
+ * Basic ProseMirror styles.
85029
+ * https://github.com/ProseMirror/prosemirror-view/blob/master/style/prosemirror.css
85030
+ */
85031
+ .ProseMirror {
85032
+ position: relative;
85033
+ }
85034
+ .ProseMirror {
85035
+ word-wrap: break-word;
85036
+ white-space: pre-wrap;
85037
+ white-space: break-spaces;
85038
+ -webkit-font-variant-ligatures: none;
85039
+ font-variant-ligatures: none;
85040
+ font-feature-settings: 'liga' 0; /* the above doesn't seem to work in Edge */
85041
+ }
85042
+ .ProseMirror pre {
85043
+ white-space: pre-wrap;
85044
+ }
85045
+ .ProseMirror ol,
85046
+ .ProseMirror ul {
85047
+ margin-block-start: 0;
85048
+ margin-block-end: 0;
85049
+ margin-inline-start: 0;
85050
+ margin-inline-end: 0;
85051
+ }
85052
+ .ProseMirror ol,
85053
+ .ProseMirror ul {
85054
+ padding-inline-start: 0;
85055
+ padding-left: 0;
85056
+ list-style: none;
85057
+ }
85058
+ .ProseMirror li::marker {
85059
+ content: none;
85060
+ }
85061
+ .ProseMirror li::marker {
85062
+ padding: 0;
85063
+ margin: 0;
85064
+ }
85065
+ .ProseMirror li > p {
85066
+ margin: 0;
85067
+ padding: 0;
85068
+ display: inline-block;
85069
+ }
85070
+ .ProseMirror.header-footer-edit > p img,
85071
+ .ProseMirror.header-footer-edit > p a,
85072
+ .ProseMirror.header-footer-edit li img,
85073
+ .ProseMirror.header-footer-edit li a,
85074
+ .ProseMirror.header-footer-edit span img,
85075
+ .ProseMirror.header-footer-edit span a {
85076
+ opacity: 1;
85077
+ }
85078
+ .ProseMirror.header-footer-edit .pagination-break-wrapper {
85079
+ color: initial !important;
85080
+ }
85081
+ .ProseMirror.header-footer-edit .pagination-break-wrapper span {
85082
+ color: initial !important;
85083
+ }
85084
+ .ProseMirror.header-footer-edit .pagination-break-wrapper img,
85085
+ .ProseMirror.header-footer-edit .pagination-break-wrapper a {
85086
+ opacity: 1;
85087
+ }
85088
+ .pagination-section-header div[contenteditable='false'] {
85089
+ user-select: none;
85090
+ }
85091
+ /**
85092
+ * Hide marker for indented lists.
85093
+ * If a list-item contains a list but doesn't contain a "p" tag with text.
85094
+ */
85095
+ .ProseMirror ol {
85096
+ margin: 0;
85097
+ }
85098
+ .ProseMirror li:has(> ul:first-child, > ol:first-child):not(:has(> p)) {
85099
+ list-style-type: none;
85100
+ }
85101
+ .ProseMirror li:has(> ul:first-child, > ol:first-child):not(:has(> p))::marker {
85102
+ content: '';
85103
+ }
85104
+ .ProseMirror-hideselection *::selection {
85105
+ background: transparent;
85106
+ }
85107
+ .ProseMirror-hideselection *::-moz-selection {
85108
+ background: transparent;
85109
+ }
85110
+ .ProseMirror-hideselection * {
85111
+ caret-color: transparent;
85112
+ }
85113
+ /* See https://github.com/ProseMirror/prosemirror/issues/1421#issuecomment-1759320191 */
85114
+ .ProseMirror [draggable][contenteditable='false'] {
85115
+ user-select: text;
85116
+ }
85117
+ .ProseMirror-selectednode {
85118
+ outline: 2px solid #8cf;
85119
+ }
85120
+ /* Make sure li selections wrap around markers */
85121
+ li.ProseMirror-selectednode {
85122
+ outline: none;
85123
+ }
85124
+ li.ProseMirror-selectednode:after {
85125
+ content: '';
85126
+ position: absolute;
85127
+ left: -32px;
85128
+ right: -2px;
85129
+ top: -2px;
85130
+ bottom: -2px;
85131
+ border: 2px solid #8cf;
85132
+ pointer-events: none;
85133
+ }
85134
+ .ProseMirror img {
85135
+ height: auto;
85136
+ max-width: 100%;
85137
+ }
85138
+ /* Protect against generic img rules */
85139
+ img.ProseMirror-separator {
85140
+ display: inline !important;
85141
+ border: none !important;
85142
+ margin: 0 !important;
85143
+ }
85144
+ .ProseMirror .sd-editor-tab {
85145
+ display: inline-block;
85146
+ vertical-align: text-bottom;
85147
+ }
85148
+ .ProseMirror u .sd-editor-tab:not(.pagination-inner .sd-editor-tab) {
85149
+ white-space: pre;
85150
+ border-bottom: 1px solid #000;
85151
+ margin-bottom: 1.5px;
85152
+ }
85153
+ /*
85154
+ Tables
85155
+ https://github.com/ProseMirror/prosemirror-tables/blob/master/style/tables.css
85156
+ https://github.com/ProseMirror/prosemirror-tables/blob/master/demo/index.html
85157
+ */
85158
+ .ProseMirror.resize-cursor {
85159
+ cursor: ew-resize;
85160
+ cursor: col-resize;
85161
+ }
85162
+ .ProseMirror .tableWrapper {
85163
+ --table-border-width: 1px;
85164
+ --offset: 2px;
85165
+
85166
+ overflow-x: auto;
85167
+ scrollbar-width: thin;
85168
+ overflow: hidden;
85169
+
85170
+ /*
85171
+ The border width does not need to be multiplied by two,
85172
+ for tables it works differently. */
85173
+ width: calc(100% + (var(--table-border-width) + var(--offset)));
85174
+ }
85175
+ .ProseMirror table {
85176
+ border-collapse: collapse;
85177
+ border-spacing: 0;
85178
+ table-layout: fixed;
85179
+ margin: 0;
85180
+ /* width: 100%; */
85181
+ }
85182
+ .ProseMirror tr {
85183
+ position: relative;
85184
+ }
85185
+ .ProseMirror td,
85186
+ .ProseMirror th {
85187
+ min-width: 1em;
85188
+ position: relative;
85189
+ vertical-align: top;
85190
+ box-sizing: border-box;
85191
+ overflow-wrap: anywhere;
85192
+ }
85193
+ .ProseMirror th {
85194
+ font-weight: bold;
85195
+ text-align: left;
85196
+ }
85197
+ .ProseMirror table .column-resize-handle {
85198
+ position: absolute;
85199
+ right: -2px;
85200
+ top: 0;
85201
+ bottom: -2px; /* 0 */
85202
+ width: 4px;
85203
+ z-index: 20;
85204
+ background-color: #adf;
85205
+ pointer-events: none;
85206
+ }
85207
+ .ProseMirror table .selectedCell:after {
85208
+ position: absolute;
85209
+ content: '';
85210
+ left: 0;
85211
+ right: 0;
85212
+ top: 0;
85213
+ bottom: 0;
85214
+ background: rgba(200, 200, 255, 0.4);
85215
+ pointer-events: none;
85216
+ z-index: 2;
85217
+ }
85218
+ /* Tables - end */
85219
+ /* Track changes */
85220
+ .ProseMirror .track-insert-dec,
85221
+ .ProseMirror .track-delete-dec,
85222
+ .ProseMirror .track-format-dec {
85223
+ pointer-events: none;
85224
+ }
85225
+ .ProseMirror .track-insert-dec.hidden,
85226
+ .ProseMirror .track-delete-dec.hidden {
85227
+ display: none;
85228
+ }
85229
+ .ProseMirror .track-insert-dec.highlighted {
85230
+ border-top: 1px dashed #00853d;
85231
+ border-bottom: 1px dashed #00853d;
85232
+ background-color: #399c7222;
85233
+ }
85234
+ .ProseMirror .track-delete-dec.highlighted {
85235
+ border-top: 1px dashed #cb0e47;
85236
+ border-bottom: 1px dashed #cb0e47;
85237
+ background-color: #cb0e4722;
85238
+ text-decoration: line-through;
85239
+ text-decoration-thickness: 2px;
85240
+ }
85241
+ .ProseMirror .track-format-dec.highlighted {
85242
+ border-bottom: 2px solid gold;
85243
+ }
85244
+ .ProseMirror .track-delete-widget {
85245
+ visibility: hidden;
85246
+ }
85247
+ /* Track changes - end */
85248
+ /* Collaboration cursors */
85249
+ .ProseMirror > .ProseMirror-yjs-cursor:first-child {
85250
+ margin-top: 16px;
85251
+ }
85252
+ .ProseMirror-yjs-cursor {
85253
+ position: relative;
85254
+ margin-left: -1px;
85255
+ margin-right: -1px;
85256
+ border-left: 1px solid black;
85257
+ border-right: 1px solid black;
85258
+ border-color: orange;
85259
+ word-break: normal;
85260
+ pointer-events: none;
85261
+ }
85262
+ .ProseMirror-yjs-cursor > div {
85263
+ position: absolute;
85264
+ top: -1.05em;
85265
+ left: -1px;
85266
+ font-size: 13px;
85267
+ background-color: rgb(250, 129, 0);
85268
+ font-family: serif;
85269
+ font-style: normal;
85270
+ font-weight: normal;
85271
+ line-height: normal;
85272
+ user-select: none;
85273
+ color: white;
85274
+ padding-left: 2px;
85275
+ padding-right: 2px;
85276
+ white-space: nowrap;
85277
+ }
85278
+ /* Collaboration cursors - end */
85279
+ /* Image placeholder */
85280
+ .ProseMirror placeholder {
85281
+ display: inline;
85282
+ border: 1px solid #ccc;
85283
+ color: #ccc;
85284
+ }
85285
+ .ProseMirror placeholder:after {
85286
+ content: '☁';
85287
+ font-size: 200%;
85288
+ line-height: 0.1;
85289
+ font-weight: bold;
85290
+ }
85291
+ /* Gapcursor */
85292
+ .ProseMirror-gapcursor {
85293
+ display: none;
85294
+ pointer-events: none;
85295
+ position: absolute;
85296
+ margin: 0;
85297
+ }
85298
+ .ProseMirror-gapcursor:after {
85299
+ content: '';
85300
+ display: block;
85301
+ position: absolute;
85302
+ top: -2px;
85303
+ width: 20px;
85304
+ border-top: 1px solid black;
85305
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
85306
+ }
85307
+ @keyframes ProseMirror-cursor-blink {
85308
+ to {
85309
+ visibility: hidden;
85310
+ }
85311
+ }
85312
+ .ProseMirror-focused .ProseMirror-gapcursor {
85313
+ display: block;
85314
+ }
85315
+ .ProseMirror div[data-type='contentBlock'] {
85316
+ position: absolute;
85317
+ outline: none;
85318
+ user-select: none;
85319
+ z-index: -1;
85320
+ }
85321
+ .ProseMirror div[data-horizontal-rule='true'] {
85322
+ margin-top: auto;
85323
+ align-self: flex-end;
85324
+ }
85325
+ .sd-editor-dropcap {
85326
+ float: left;
85327
+ display: flex;
85328
+ align-items: baseline;
85329
+ margin-top: -5px;
85330
+ }
85331
+ .ProseMirror-search-match {
85332
+ background-color: #ffff0054;
85333
+ }
85334
+ .ProseMirror-active-search-match {
85335
+ background-color: #ff6a0054;
85336
+ }
85337
+ .ProseMirror span.sd-custom-selection::selection {
85338
+ background: transparent;
85339
+ }
85340
+ .sd-custom-selection {
85341
+ background-color: #d9d9d9;
85342
+ border-radius: 0.1em;
85343
+ }
85344
+ .superdoc-toolbar svg {
85345
+ width: 100%;
85346
+ height: 100%;
85347
+ display: block;
85348
+ fill: currentColor;
85349
+ }
85350
+ .superdoc-toolbar svg path {
85351
+ stroke: currentColor;
85352
+ }
85353
+ .sd-editor-toolbar-dropdown .n-dropdown-option .dropdown-select-icon {
85354
+ display: flex;
85355
+ width: 12px;
85356
+ height: 12px;
85357
+ }
85358
+ /* Custom toolbar styling */
85359
+ /* AI button icon styling with gradient */
85360
+ .toolbar-icon__icon--ai {
85361
+ position: relative;
85362
+ z-index: 1;
85363
+ }
85364
+ .toolbar-icon__icon--ai svg {
85365
+ fill: transparent;
85366
+ }
85367
+ .toolbar-icon__icon--ai::before {
85368
+ content: '';
85369
+ position: absolute;
85370
+ top: 0;
85371
+ left: 0;
85372
+ right: 0;
85373
+ bottom: 0;
85374
+ z-index: -1;
85375
+ background: linear-gradient(
85376
+ 270deg,
85377
+ rgba(218, 215, 118, 0.5) -20%,
85378
+ rgba(191, 100, 100, 1) 30%,
85379
+ rgba(77, 82, 217, 1) 60%,
85380
+ rgb(255, 219, 102) 150%
85381
+ );
85382
+ -webkit-mask: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M224 96l16-32 32-16-32-16-16-32-16 32-32 16 32 16 16 32zM80 160l26.7-53.3L160 80l-53.3-26.7L80 0 53.3 53.3 0 80l53.3 26.7L80 160zm352 128l-26.7 53.3L352 368l53.3 26.7L432 448l26.7-53.3L512 368l-53.3-26.7L432 288zm70.6-193.8L417.8 9.4C411.5 3.1 403.3 0 395.2 0c-8.2 0-16.4 3.1-22.6 9.4L9.4 372.5c-12.5 12.5-12.5 32.8 0 45.3l84.9 84.9c6.3 6.3 14.4 9.4 22.6 9.4 8.2 0 16.4-3.1 22.6-9.4l363.1-363.2c12.5-12.5 12.5-32.8 0-45.2zM359.5 203.5l-50.9-50.9 86.6-86.6 50.9 50.9-86.6 86.6z'/></svg>")
85383
+ center / contain no-repeat;
85384
+ mask: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M224 96l16-32 32-16-32-16-16-32-16 32-32 16 32 16 16 32zM80 160l26.7-53.3L160 80l-53.3-26.7L80 0 53.3 53.3 0 80l53.3 26.7L80 160zm352 128l-26.7 53.3L352 368l53.3 26.7L432 448l26.7-53.3L512 368l-53.3-26.7L432 288zm70.6-193.8L417.8 9.4C411.5 3.1 403.3 0 395.2 0c-8.2 0-16.4 3.1-22.6 9.4L9.4 372.5c-12.5 12.5-12.5 32.8 0 45.3l84.9 84.9c6.3 6.3 14.4 9.4 22.6 9.4 8.2 0 16.4-3.1 22.6-9.4l363.1-363.2c12.5-12.5 12.5-32.8 0-45.2zM359.5 203.5l-50.9-50.9 86.6-86.6 50.9 50.9-86.6 86.6z'/></svg>")
85385
+ center / contain no-repeat;
85386
+ filter: brightness(1.2);
85387
+ transition: filter 0.2s ease;
85388
+ }
85389
+ .toolbar-icon__icon--ai:hover::before {
85390
+ filter: brightness(1.3);
85391
+ }
85392
+ /* AI text appear animation */
85393
+ @keyframes aiTextAppear {
85394
+ from {
85395
+ opacity: 0;
85396
+ transform: translateY(5px);
85397
+ }
85398
+ to {
85399
+ opacity: 1;
85400
+ transform: translateY(0);
85401
+ }
85402
+ }
85403
+ .sd-ai-text-appear {
85404
+ display: inline;
85405
+ opacity: 0;
85406
+ animation: aiTextAppear 0.7s ease-out forwards;
85407
+ animation-fill-mode: both;
85408
+ will-change: opacity, transform;
85409
+ /* Ensure each mark is treated as a separate animation context */
85410
+ contain: content;
85411
+ }
85412
+ .sd-ai-loader {
85413
+ display: flex;
85414
+ justify-content: flex-start;
85415
+ }
85416
+ .sd-ai-loader > img {
85417
+ width: fit-content;
85418
+ height: 40px;
85419
+ }
85420
+ @keyframes ai-pulse {
85421
+ 0% {
85422
+ background-color: rgba(99, 102, 241, 0.1);
85423
+ }
85424
+ 50% {
85425
+ background-color: rgba(99, 102, 241, 0.375);
85426
+ }
85427
+ 100% {
85428
+ background-color: rgba(99, 102, 241, 0.1);
85429
+ }
85430
+ }
85431
+ .sd-ai-highlight-pulse {
85432
+ animation: ai-pulse 1.5s ease-in-out infinite;
85433
+ }
85434
+ .sd-editor-auto-page-number,
85435
+ .sd-editor-auto-total-pages {
85436
+ transition: all 250ms ease;
85437
+ border-bottom: 1px solid #9a9a9a;
85438
+ cursor: not-allowed;
85439
+ }
85440
+ .sd-editor-auto-page-number:hover,
85441
+ .sd-editor-auto-total-pages:hover {
85442
+ border-bottom-color: #4f4f4f;
85443
+ }
85444
+ .sd-editor-auto-page-number-content {
85445
+ pointer-events: none;
85446
+ }
85447
+ .ProseMirror.view-mode .sd-editor-auto-page-number,
85448
+ .ProseMirror.view-mode .sd-editor-auto-total-pages {
85449
+ border: none;
85450
+ }
85451
+ :root {
85452
+ --sd-editor-separator-height: 18px;
85453
+ }
85454
+ .pagination-section-header {
85455
+ cursor: default;
85456
+ }
85457
+ /* To not inherit styles from the wrapper paragraph */
85458
+ .pagination-section-header p {
85459
+ text-align: initial;
85460
+ }
85461
+ .pagination-section-footer {
85462
+ position: relative;
85463
+ width: 100%;
85464
+ min-width: 100%;
85465
+ display: flex;
85466
+ flex-direction: column;
85467
+ justify-content: flex-end;
85468
+ cursor: default;
85469
+ }
85470
+ /* To not inherit styles from the wrapper paragraph */
85471
+ .pagination-section-footer p {
85472
+ text-align: initial;
85473
+ }
85474
+ .pagination-break-wrapper {
85475
+ width: 100%;
85476
+ margin: 0;
85477
+ padding: 0;
85478
+ cursor: default;
85479
+ position: relative;
85480
+ }
85481
+ .pagination-separator {
85482
+ position: relative;
85483
+ display: block;
85484
+ height: var(--sd-editor-separator-height);
85485
+ min-height: var(--sd-editor-separator-height);
85486
+ min-width: 100%;
85487
+ width: 100%;
85488
+ border-top: 1px solid #dbdbdb;
85489
+ border-bottom: 1px solid #dbdbdb;
85490
+ cursor: default;
85491
+ }
85492
+ .pagination-separator--table {
85493
+ border: 0;
85494
+ }
85495
+ .pagination-separator-floating {
85496
+ position: absolute;
85497
+ height: var(--sd-editor-separator-height);
85498
+ border-top: 1px solid #dbdbdb;
85499
+ border-bottom: 1px solid #dbdbdb;
85500
+ pointer-events: none;
85501
+ }
85502
+ .pagination-inner {
85503
+ position: absolute;
85504
+ top: 0;
85505
+ left: 0;
85506
+ display: flex;
85507
+ flex-direction: column;
85508
+ background-color: white;
85509
+ }
85510
+ /**
85511
+ Workaround to display pagination in footer
85512
+ on the right if it is inside shape textbox.
85513
+ */
85514
+ .pagination-section-footer .sd-editor-shape-container:has([data-id='auto-page-number'], [data-id='auto-total-pages']) {
85515
+ margin-left: auto;
85516
+ }
85517
+ .pagination-section-header img[contenteditable='false'],
85518
+ .pagination-section-footer img[contenteditable='false'] {
85519
+ pointer-events: none;
85520
+ }
85521
+ .pagination-break-wrapper {
85522
+ font-weight: normal;
85523
+ font-style: normal;
85524
+ color: initial;
85525
+ }
85526
+ /* TODO: This is going to be enabled again */
85527
+ /* .pagination-section-header div[contenteditable="false"]:not([documentmode="viewing"]),
85528
+ .pagination-section-footer div[contenteditable="false"]:not([documentmode="viewing"]) {
85529
+ opacity: 0.5;
85530
+ } */
85531
+ .sd-editor-popover {
85532
+ background-color: #fff;
85533
+ border-radius: 8px;
85534
+ -webkit-box-shadow: 0px 4px 12px 0px rgba(50, 50, 50, 0.15);
85535
+ -moz-box-shadow: 0px 4px 12px 0px rgba(50, 50, 50, 0.15);
85536
+ box-shadow: 0px 4px 12px 0px rgba(50, 50, 50, 0.15);
85537
+ padding: 0;
85538
+ width: auto;
85539
+ height: auto;
85540
+ font-size: 14px;
85541
+ color: #333;
85542
+ z-index: 1000;
85543
+ }
85544
+ .sd-editor-popover .popover-header {
85545
+ font-weight: bold;
85546
+ margin-bottom: 8px;
85547
+ }
85548
+ .tippy-box[data-theme~='sd-editor-popover'] {
85549
+ background-color: #fff;
85550
+ border-radius: 8px;
85551
+ box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
85552
+ border: none !important;
85553
+ padding: 0 !important;
85554
+ }
85555
+ .tippy-box[data-theme~='sd-editor-popover'] .tippy-arrow {
85556
+ color: #fff;
85557
+ border: 1px solid #dbdbdb;
85558
+ }
85559
+ .tippy-box[data-theme~='sd-editor-popover'] .tippy-content {
85560
+ padding: 0;
85561
+ }
85562
+ .sd-editor-placeholder::before {
85563
+ content: attr(data-placeholder);
85564
+ color: #aaa;
85565
+ pointer-events: none;
85566
+ display: block;
85567
+ height: 0;
85568
+ }
85569
+ .sd-editor-mention {
85570
+ background-color: #1355ff15;
85571
+ color: #222;
85572
+ font-weight: 400;
85573
+ border-radius: 3px;
85574
+ padding: 0 5px;
85575
+ cursor: default;
85576
+ display: inline-block;
85577
+ box-sizing: border-box;
85578
+ }
85579
+ .sd-editor-comment-highlight {
85580
+ transition: background-color 250ms ease;
85581
+ }
85582
+ .sd-editor-comment-highlight:hover {
85583
+ background-color: #1354ff55;
85584
+ }
85585
+ .sd-editor-comment-highlight.sd-custom-selection {
85586
+ background-color: #d6c0c6 !important;
85587
+ }
85588
+ .sd-editor-list-item-node-view {
85589
+ position: relative;
85590
+ width: 100%;
85591
+ }
85592
+ .sd-editor-list-item-numbering {
85593
+ position: absolute;
85594
+ top: 0;
85595
+ white-space: nowrap;
85596
+ user-select: none;
85597
+ pointer-events: auto;
85598
+ text-align: right;
85599
+ z-index: 1;
85600
+ }
85601
+ .sd-editor-list-item-content-dom {
85602
+ position: relative;
85603
+ min-height: inherit;
85604
+ word-wrap: break-word;
85605
+ }
85606
+ /* temporary fix */
85607
+ .sd-editor-list-item-node-view .sd-custom-selection {
85608
+ font-size: inherit !important;
85609
+ }
85610
+ /* Resize handles container */
85611
+ .sd-editor-resize-container {
85612
+ position: absolute;
85613
+ pointer-events: none;
85614
+ z-index: 11;
85615
+ }
85616
+ /* Resize handles */
85617
+ .sd-editor-resize-handle {
85618
+ position: absolute;
85619
+ width: 12px;
85620
+ height: 12px;
85621
+ background-color: #4dabf7;
85622
+ border: 2px solid #fff;
85623
+ border-radius: 50%;
85624
+ box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
85625
+ pointer-events: auto;
85626
+ transition: all 0.1s ease;
85627
+ }
85628
+ .sd-editor-resize-handle:hover {
85629
+ background-color: #228be6;
85630
+ transform: scale(1.1);
85631
+ box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
85632
+ }
85633
+ /* Handle positions */
85634
+ .sd-editor-resize-handle-nw {
85635
+ top: -6px;
85636
+ left: -6px;
85637
+ cursor: nwse-resize;
85638
+ }
85639
+ .sd-editor-resize-handle-ne {
85640
+ top: -6px;
85641
+ right: -6px;
85642
+ cursor: nesw-resize;
85643
+ }
85644
+ .sd-editor-resize-handle-sw {
85645
+ bottom: -6px;
85646
+ left: -6px;
85647
+ cursor: nesw-resize;
85648
+ }
85649
+ .sd-editor-resize-handle-se {
85650
+ bottom: -6px;
85651
+ right: -6px;
85652
+ cursor: nwse-resize;
85653
+ }
85654
+ /* Hide handles when editor loses focus */
85655
+ .ProseMirror:not(.ProseMirror-focused) .sd-editor-resize-container {
85656
+ display: none;
85657
+ }
85658
+ /* Smooth transitions for resizing */
85659
+ .sd-editor-resizable-wrapper * {
85660
+ transition: none;
85661
+ }
85662
+ .sd-editor-resizable-wrapper *:not([style*='width']) {
85663
+ transition: all 0.2s ease;
85664
+ }
85665
+ /* Resize feedback indicator */
85666
+ .sd-editor-resizable-wrapper::after {
85667
+ content: 'Drag corners to resize';
85668
+ position: absolute;
85669
+ bottom: -25px;
85670
+ left: 50%;
85671
+ transform: translateX(-50%);
85672
+ background-color: rgba(77, 171, 247, 0.9);
85673
+ color: white;
85674
+ font-size: 11px;
85675
+ padding: 4px 8px;
85676
+ border-radius: 4px;
85677
+ white-space: nowrap;
85678
+ pointer-events: none;
85679
+ opacity: 0;
85680
+ transition: opacity 0.3s ease;
85681
+ z-index: 12;
85682
+ }
85683
+ .sd-editor-resizable-wrapper:hover::after {
85684
+ opacity: 1;
85685
+ }
85686
+ .sd-document-section-block {
85687
+ background-color: #fafafa;
85688
+ border: 1px solid #ababab;
85689
+ border-radius: 4px;
85690
+ position: relative;
85691
+ }
85692
+ .sd-document-section-block-info {
85693
+ position: absolute;
85694
+ top: -19px;
85695
+ left: -1px;
85696
+ max-width: 100px;
85697
+ min-width: 0;
85698
+ height: 18px;
85699
+ border: 1px solid #ababab;
85700
+ border-bottom: none;
85701
+ border-radius: 6px 6px 0 0;
85702
+ padding: 0 8px;
85703
+ align-items: center;
85704
+ font-size: 10px;
85705
+ display: none;
85706
+ z-index: 100;
85707
+ background-color: #fafafa;
85708
+ }
85709
+ .sd-document-section-block:hover {
85710
+ border-radius: 0 4px 4px 4px;
85711
+ }
85712
+ .sd-document-section-block:hover .sd-document-section-block-info {
85713
+ display: flex;
85714
+ align-items: center;
85715
+ }
85716
+ .sd-document-section-block-info span {
85717
+ max-width: 100%;
85718
+ overflow: hidden;
85719
+ white-space: nowrap;
85720
+ text-overflow: ellipsis;
85721
+ }
85722
+ .sd-structured-content,
85723
+ .sd-structured-content-block {
85724
+ padding: 1px;
85725
+ box-sizing: border-box;
85726
+ border-radius: 4px;
85727
+ border: 1px solid #629be7;
85728
+ position: relative;
85729
+ }
85730
+ .sd-structured-content-draggable {
85731
+ font-size: 10px;
85732
+ align-items: center;
85733
+ justify-content: center;
85734
+ position: absolute;
85735
+ left: 2px;
85736
+ bottom: 100%;
85737
+ width: calc(100% - 4px);
85738
+ max-width: 110px;
85739
+ min-width: 0;
85740
+ height: 18px;
85741
+ padding: 0 4px;
85742
+ border: 1px solid #629be7;
85743
+ border-bottom: none;
85744
+ border-radius: 6px 6px 0 0;
85745
+ background-color: #629be7dd;
85746
+ z-index: 10;
85747
+ cursor: grab;
85748
+ display: none;
85749
+ }
85750
+ .sd-structured-content-draggable span {
85751
+ max-width: 100%;
85752
+ overflow: hidden;
85753
+ white-space: nowrap;
85754
+ text-overflow: ellipsis;
85755
+ }
85756
+ .sd-structured-content:hover .sd-structured-content-draggable,
85757
+ .sd-structured-content-block:hover .sd-structured-content-draggable {
85758
+ display: inline-flex;
85759
+ }
85760
+ `;
85761
+ let cachedStyleSheet = null;
85762
+ const defaultEditorStyles = editorStyles;
85763
+ let shadowEditorStyles = defaultEditorStyles;
85764
+ const supportsConstructableStylesheets = () => {
85765
+ const DocumentCtor = (
85766
+ /** @type {typeof Document | undefined} */
85767
+ globalThis.Document
85768
+ );
85769
+ const CSSStyleSheetCtor = (
85770
+ /** @type {typeof CSSStyleSheet | undefined} */
85771
+ globalThis.CSSStyleSheet
85772
+ );
85773
+ if (!DocumentCtor || !CSSStyleSheetCtor) return false;
85774
+ const documentPrototype = DocumentCtor.prototype;
85775
+ const styleSheetPrototype = CSSStyleSheetCtor.prototype;
85776
+ return !!documentPrototype && "adoptedStyleSheets" in documentPrototype && !!styleSheetPrototype && typeof styleSheetPrototype.replaceSync === "function";
85777
+ };
85778
+ const ensureStyleSheet = (root2) => {
85779
+ if (!root2 || !shadowEditorStyles) return;
85780
+ if (supportsConstructableStylesheets()) {
85781
+ if (!cachedStyleSheet) {
85782
+ const CSSStyleSheetCtor = (
85783
+ /** @type {typeof CSSStyleSheet} */
85784
+ globalThis.CSSStyleSheet
85785
+ );
85786
+ cachedStyleSheet = new CSSStyleSheetCtor();
85787
+ cachedStyleSheet.replaceSync(shadowEditorStyles);
85788
+ }
85789
+ const sheets = Array.isArray(root2.adoptedStyleSheets) ? root2.adoptedStyleSheets : [];
85790
+ if (!sheets.includes(cachedStyleSheet)) {
85791
+ root2.adoptedStyleSheets = [...sheets, cachedStyleSheet];
85792
+ }
85793
+ return;
85794
+ }
85795
+ const doc2 = (
85796
+ /** @type {Document | undefined} */
85797
+ globalThis.document
85798
+ );
85799
+ if (!doc2 || typeof root2.querySelector !== "function") return;
85800
+ if (!root2.querySelector("style[data-super-editor-styles]")) {
85801
+ const styleEl = doc2.createElement("style");
85802
+ styleEl.setAttribute("data-super-editor-styles", "");
85803
+ styleEl.textContent = shadowEditorStyles;
85804
+ root2.appendChild(styleEl);
85805
+ }
85806
+ };
85807
+ const ensureEditorShadowRoot = (hostElement) => {
85808
+ const doc2 = (
85809
+ /** @type {Document | undefined} */
85810
+ globalThis.document
85811
+ );
85812
+ if (!hostElement || !doc2 || typeof hostElement.attachShadow !== "function") {
85813
+ return { root: null, mount: null };
85814
+ }
85815
+ const root2 = hostElement.shadowRoot || hostElement.attachShadow({ mode: "open" });
85816
+ ensureStyleSheet(root2);
85817
+ let mount2 = root2.querySelector(".sd-editor-mount");
85818
+ if (!mount2) {
85819
+ mount2 = doc2.createElement("div");
85820
+ mount2.className = "sd-editor-mount";
85821
+ root2.appendChild(mount2);
85822
+ }
85823
+ return { root: root2, mount: mount2 };
85824
+ };
84613
85825
  const _hoisted_1$1 = { class: "super-editor-container" };
84614
85826
  const _hoisted_2 = {
84615
85827
  key: 1,
@@ -84648,6 +85860,7 @@ const _sfc_main$1 = {
84648
85860
  const message = useMessage();
84649
85861
  const editorWrapper = ref$1(null);
84650
85862
  const editorElem = ref$1(null);
85863
+ const editorMountPoint = shallowRef(null);
84651
85864
  const fileSource = ref$1(null);
84652
85865
  const popoverControls = reactive({
84653
85866
  visible: false,
@@ -84736,9 +85949,15 @@ const _sfc_main$1 = {
84736
85949
  return extensions;
84737
85950
  };
84738
85951
  const initEditor = async ({ content, media = {}, mediaFiles = {}, fonts = {} } = {}) => {
85952
+ if (!editorElem.value) return;
85953
+ const { mount: mount2 } = ensureEditorShadowRoot(editorElem.value);
85954
+ editorMountPoint.value = mount2;
85955
+ if (editorMountPoint.value) {
85956
+ editorMountPoint.value.innerHTML = "";
85957
+ }
84739
85958
  editor.value = new Editor({
84740
85959
  mode: "docx",
84741
- element: editorElem.value,
85960
+ element: editorMountPoint.value || editorElem.value,
84742
85961
  fileSource: fileSource.value,
84743
85962
  extensions: getExtensions(),
84744
85963
  externalExtensions: props.options.externalExtensions,
@@ -84785,11 +86004,12 @@ const _sfc_main$1 = {
84785
86004
  };
84786
86005
  const handleSuperEditorClick = (event) => {
84787
86006
  emit("editor-click", { editor: editor.value });
84788
- let pmElement = editorElem.value?.querySelector(".ProseMirror");
86007
+ const pmElement = editor.value?.view?.dom;
84789
86008
  if (!pmElement || !editor.value) {
84790
86009
  return;
84791
86010
  }
84792
- let isInsideEditor = pmElement.contains(event.target);
86011
+ const eventPath = event.composedPath?.() || [];
86012
+ const isInsideEditor = eventPath.includes(pmElement);
84793
86013
  if (!isInsideEditor && editor.value.isEditable) {
84794
86014
  editor.value.view?.focus();
84795
86015
  }
@@ -84802,7 +86022,9 @@ const _sfc_main$1 = {
84802
86022
  if (props.options?.suppressSkeletonLoader || !props.options?.collaborationProvider) editorReady.value = true;
84803
86023
  });
84804
86024
  const handleMarginClick = (event) => {
84805
- if (event.target.classList.contains("ProseMirror")) return;
86025
+ const pmElement = editor.value?.view?.dom;
86026
+ const eventPath = event.composedPath?.() || [];
86027
+ if (pmElement && eventPath.includes(pmElement)) return;
84806
86028
  onMarginClickCursorChange(event, editor.value);
84807
86029
  };
84808
86030
  const handleMarginChange = ({ side, value }) => {
@@ -84908,7 +86130,7 @@ const _sfc_main$1 = {
84908
86130
  };
84909
86131
  }
84910
86132
  };
84911
- const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0c36dd72"]]);
86133
+ const SuperEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-3d49a1a6"]]);
84912
86134
  const _hoisted_1 = ["innerHTML"];
84913
86135
  const _sfc_main = {
84914
86136
  __name: "SuperInput",
@@ -84938,6 +86160,7 @@ const _sfc_main = {
84938
86160
  const props = __props;
84939
86161
  const editor = shallowRef();
84940
86162
  const editorElem = ref$1(null);
86163
+ const editorMountPoint = shallowRef(null);
84941
86164
  const isFocused = ref$1(false);
84942
86165
  const onTransaction = ({ editor: editor2, transaction }) => {
84943
86166
  const contents = editor2.getHTML();
@@ -84957,10 +86180,15 @@ const _sfc_main = {
84957
86180
  props.options.onTransaction = onTransaction;
84958
86181
  props.options.onFocus = onFocus;
84959
86182
  props.options.onBlur = onBlur;
86183
+ const { mount: mount2 } = ensureEditorShadowRoot(editorElem.value);
86184
+ editorMountPoint.value = mount2;
86185
+ if (editorMountPoint.value) {
86186
+ editorMountPoint.value.innerHTML = "";
86187
+ }
84960
86188
  editor.value = new Editor({
84961
86189
  mode: "text",
84962
86190
  content: document.getElementById("currentContent"),
84963
- element: editorElem.value,
86191
+ element: editorMountPoint.value || editorElem.value,
84964
86192
  extensions: getRichTextExtensions(),
84965
86193
  users: props.users,
84966
86194
  ...props.options
@@ -84999,35 +86227,35 @@ const _sfc_main = {
84999
86227
  };
85000
86228
  }
85001
86229
  };
85002
- const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4d5cff52"]]);
86230
+ const SuperInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-23a4e794"]]);
85003
86231
  const baseHandlers = {
85004
86232
  ...runPropertyTranslators,
85005
- "w:br": translator$15,
85006
- "w:cantSplit": translator$S,
85007
- "w:cnfStyle": translator$R,
85008
- "w:divId": translator$Q,
85009
- "w:gridAfter": translator$P,
85010
- "w:gridBefore": translator$O,
85011
- "w:hidden": translator$N,
85012
- "w:hyperlink": translator$6,
85013
- "w:jc": translator$M,
85014
- "w:p": translator$12,
85015
- "w:r": translator$T,
85016
- "w:rPr": translator$U,
85017
- "w:sdt": translator$2,
85018
- "w:tab": translator$13,
85019
- "w:tblCellSpacing": translator$L,
85020
- "w:tblHeader": translator$K,
85021
- "w:tc": translator$7,
85022
- "w:tr": translator$F,
85023
- "w:trHeight": translator$J,
85024
- "w:trPr": translator$G,
85025
- "w:wAfter": translator$I,
85026
- "w:wBefore": translator$H,
85027
- "wp:anchor": translator$5,
85028
- "wp:inline": translator$4,
85029
- "w:bookmarkStart": translator$1,
85030
- "w:bookmarkEnd": translator
86233
+ "w:br": translator$16,
86234
+ "w:cantSplit": translator$T,
86235
+ "w:cnfStyle": translator$S,
86236
+ "w:divId": translator$R,
86237
+ "w:gridAfter": translator$Q,
86238
+ "w:gridBefore": translator$P,
86239
+ "w:hidden": translator$O,
86240
+ "w:hyperlink": translator$7,
86241
+ "w:jc": translator$N,
86242
+ "w:p": translator$13,
86243
+ "w:r": translator$U,
86244
+ "w:rPr": translator$V,
86245
+ "w:sdt": translator$3,
86246
+ "w:tab": translator$14,
86247
+ "w:tblCellSpacing": translator$M,
86248
+ "w:tblHeader": translator$L,
86249
+ "w:tc": translator$8,
86250
+ "w:tr": translator$G,
86251
+ "w:trHeight": translator$K,
86252
+ "w:trPr": translator$H,
86253
+ "w:wAfter": translator$J,
86254
+ "w:wBefore": translator$I,
86255
+ "wp:anchor": translator$6,
86256
+ "wp:inline": translator$5,
86257
+ "w:bookmarkStart": translator$2,
86258
+ "w:bookmarkEnd": translator$1
85031
86259
  };
85032
86260
  const registeredHandlers = Object.freeze(baseHandlers);
85033
86261
  const Extensions = {