@forevka/wordcanvas 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist-lib/assets/{worker-4HYrkNrG.js → worker-CqU4Popa.js} +399 -375
  2. package/dist-lib/assets/{worker-CJpwUzKh.js → worker-Cw5cYW5z.js} +359 -344
  3. package/dist-lib/{blockFactory-B_CLnkUh.js → blockFactory-DDCRWDnA.js} +16 -31
  4. package/dist-lib/browser-BUrsjziD.js +612 -0
  5. package/dist-lib/builder.js +16 -17
  6. package/dist-lib/editorApp-CB_ZArIF.js +9566 -0
  7. package/dist-lib/export.js +28 -28
  8. package/dist-lib/generate-toc.js +6 -6
  9. package/dist-lib/import.js +2 -2
  10. package/dist-lib/lists-DpmgbDyt.js +110 -0
  11. package/dist-lib/measure.js +2 -2
  12. package/dist-lib/{measureHost-B2aKX7lF.js → measureHost-BlukHGwx.js} +1 -1
  13. package/dist-lib/metrics-bvGO8KDK.js +96 -0
  14. package/dist-lib/paintStyle-vT6jtWbH.js +74 -0
  15. package/dist-lib/{pipeline-DD0nxAYM.js → pipeline-UryP-u7Z.js} +80 -80
  16. package/dist-lib/recalc-docx.js +2 -2
  17. package/dist-lib/{recalcToc-CFCGCgij.js → recalcToc-BfXlXZik.js} +3 -3
  18. package/dist-lib/{stylesheet-B6oczA-L.js → stylesheet-LTBEGkvG.js} +32 -27
  19. package/dist-lib/toc-D09f4PrI.js +939 -0
  20. package/dist-lib/{webmcp-CXghUon_.js → webmcp-K6UZgQJ0.js} +60 -68
  21. package/dist-lib/wordcanvas-DBx2ana_.js +734 -0
  22. package/dist-lib/wordcanvas.js +4 -2
  23. package/dist-node/{chunk-PIMVQULL.js → chunk-373K2XRY.js} +34 -22
  24. package/dist-node/chunk-373K2XRY.js.map +7 -0
  25. package/dist-node/{chunk-57L5XMCL.js → chunk-3PUV3BG6.js} +2 -2
  26. package/dist-node/{chunk-U27EBKBG.js → chunk-5RX3IHWE.js} +3 -3
  27. package/dist-node/chunk-5RX3IHWE.js.map +7 -0
  28. package/dist-node/{chunk-SA26UVIJ.js → chunk-HWQKGDS2.js} +2 -2
  29. package/dist-node/{chunk-T3253N22.js → chunk-ZLLSXOO2.js} +3 -3
  30. package/dist-node/{engine-5F7DUU4W.js → engine-LLA6PCS5.js} +4 -4
  31. package/dist-node/export.js +5 -5
  32. package/dist-node/generate-toc.js +4 -4
  33. package/dist-node/import.js +2 -2
  34. package/dist-node/measure.js +2 -2
  35. package/dist-node/recalc-docx.js +3 -3
  36. package/package.json +1 -1
  37. package/types/wordcanvas.d.ts +649 -212
  38. package/dist-lib/browser-p_rkUcqE.js +0 -1339
  39. package/dist-lib/editorApp-mTD0YNv-.js +0 -9863
  40. package/dist-lib/lists-Sc5I40JO.js +0 -110
  41. package/dist-lib/metrics-BUMIC9Mv.js +0 -164
  42. package/dist-lib/toc-Dj57zdz-.js +0 -213
  43. package/dist-lib/wordcanvas-D5DI9ZR1.js +0 -151
  44. package/dist-node/chunk-PIMVQULL.js.map +0 -7
  45. package/dist-node/chunk-U27EBKBG.js.map +0 -7
  46. /package/dist-node/{chunk-57L5XMCL.js.map → chunk-3PUV3BG6.js.map} +0 -0
  47. /package/dist-node/{chunk-SA26UVIJ.js.map → chunk-HWQKGDS2.js.map} +0 -0
  48. /package/dist-node/{chunk-T3253N22.js.map → chunk-ZLLSXOO2.js.map} +0 -0
  49. /package/dist-node/{engine-5F7DUU4W.js.map → engine-LLA6PCS5.js.map} +0 -0
@@ -1,6 +1,6 @@
1
- import { m as st } from "./toc-Dj57zdz-.js";
2
- import { e as f, a as m, n as v, v as Z, o as ae, b as Y, r as ne, p as ie, I as fe, c as J, d as ge, t as de, f as it, W as rt } from "./contentTypes-f7VddqoF.js";
3
- import { t as xe, C as at, u as Be, a as ct } from "./browser-p_rkUcqE.js";
1
+ import { t as xe, I as st, Q as it } from "./toc-D09f4PrI.js";
2
+ import { e as f, a as m, n as v, v as Z, o as ae, b as Y, r as ne, p as ie, I as fe, c as J, d as ge, t as de, f as rt, W as at } from "./contentTypes-f7VddqoF.js";
3
+ import { u as Be, a as ct } from "./browser-BUrsjziD.js";
4
4
  const lt = /* @__PURE__ */ new Set([
5
5
  "TOC",
6
6
  "PAGE",
@@ -222,7 +222,7 @@ function Te(e) {
222
222
  function Pt(e, t) {
223
223
  return e ? t ? { ...e, ...t } : e : t;
224
224
  }
225
- function St(e, t) {
225
+ function It(e, t) {
226
226
  const n = (d, p, u) => (
227
227
  // Cell edges are named directly; the table/style layers use the named edge
228
228
  // on the boundary and the inside edge between cells.
@@ -236,7 +236,7 @@ function St(e, t) {
236
236
  const i = se(n("right", "insideV", t.right));
237
237
  return i && (s.right = i), s;
238
238
  }
239
- function It(e) {
239
+ function St(e) {
240
240
  if (!e) return;
241
241
  const t = {}, n = se(e.top);
242
242
  n && (t.top = n);
@@ -270,8 +270,8 @@ function ce(e) {
270
270
  if (i) {
271
271
  const g = m(i, "w:val");
272
272
  g && (t.color = g);
273
- const S = m(i, "w:themeColor");
274
- S && (t.colorTheme = S);
273
+ const I = m(i, "w:themeColor");
274
+ I && (t.colorTheme = I);
275
275
  }
276
276
  const d = v(f(e, "w:sz"), "w:val");
277
277
  d !== void 0 && (t.sizeHalfPoints = d);
@@ -279,8 +279,8 @@ function ce(e) {
279
279
  if (p) {
280
280
  const g = m(p, "w:ascii");
281
281
  g && (t.fontAscii = g);
282
- const S = m(p, "w:asciiTheme");
283
- S && (t.fontThemeAscii = S);
282
+ const I = m(p, "w:asciiTheme");
283
+ I && (t.fontThemeAscii = I);
284
284
  }
285
285
  const u = Z(e, "w:highlight");
286
286
  u && u !== "none" && (t.highlight = u);
@@ -350,8 +350,8 @@ function be(e, t) {
350
350
  const b = Z(g, "w:numId");
351
351
  b !== void 0 && (n.list = b === "0" ? null : { numId: b, level: v(f(g, "w:ilvl"), "w:val") ?? 0 });
352
352
  }
353
- const S = f(e, "w:rPr");
354
- S && (n.markRunProps = ce(S));
353
+ const I = f(e, "w:rPr");
354
+ I && (n.markRunProps = ce(I));
355
355
  const E = f(e, "w:sectPr");
356
356
  if (E) {
357
357
  n.sectionBreak = Z(E, "w:type") === "continuous" ? "continuous" : "page";
@@ -420,8 +420,8 @@ function At(e, t, n) {
420
420
  throw new fe("MALFORMED_XML", `${t} has no w:document/w:body root.`);
421
421
  const r = {}, a = { warnings: n, fieldTokens: !1, sdts: r, nextSdt: { n: 0 }, pendingBookmarks: [], currentBookmarks: null, pendingMarkers: [], currentMarkers: null, trackFields: !0, fieldTrack: Fe() }, i = [];
422
422
  ue(J(o), i, a);
423
- const d = f(o, "w:sectPr"), p = d ? Vt(d) : null, u = s ? f(s, "w:background") : void 0, l = u ? m(u, "w:color") : void 0, h = l && l !== "auto" ? l : void 0, g = a.fieldTrack.registry, S = Object.keys(g).length > 0 ? { blocks: i, section: p, sdts: r, fields: g } : { blocks: i, section: p, sdts: r };
424
- return h && (S.pageColorHex = h), S;
423
+ const d = f(o, "w:sectPr"), p = d ? Vt(d) : null, u = s ? f(s, "w:background") : void 0, l = u ? m(u, "w:color") : void 0, h = l && l !== "auto" ? l : void 0, g = a.fieldTrack.registry, I = Object.keys(g).length > 0 ? { blocks: i, section: p, sdts: r, fields: g } : { blocks: i, section: p, sdts: r };
424
+ return h && (I.pageColorHex = h), I;
425
425
  }
426
426
  function Ft(e, t, n, s = {}) {
427
427
  const o = ie(e, t), r = ne(o, "w:hdr") ?? ne(o, "w:ftr");
@@ -490,7 +490,7 @@ const Bt = /* @__PURE__ */ new Set(["PAGE", "NUMPAGES", "DATE", "TIME", "IF"]),
490
490
  function Ot(e) {
491
491
  return e.type === "NUMPAGES" ? "{pages}" : e.type === "PAGE" ? `{page${e.numFmt && e.numFmt !== "arabic" ? `:${e.numFmt}` : ""}}` : "";
492
492
  }
493
- function Ie(e) {
493
+ function Se(e) {
494
494
  if (/\bNUMPAGES\b/.test(e)) return "{pages}";
495
495
  if (/\bPAGE\b/.test(e)) return "{page}";
496
496
  }
@@ -531,7 +531,7 @@ function le(e, t, n, s) {
531
531
  break;
532
532
  }
533
533
  case "w:fldSimple": {
534
- const r = m(o, "w:instr") ?? "", a = n.fieldTokens ? Ie(r) : void 0;
534
+ const r = m(o, "w:instr") ?? "", a = n.fieldTokens ? Se(r) : void 0;
535
535
  a ? t.push({ kind: "run", text: a, props: Nt(o) }) : le(J(o), t, n, s);
536
536
  break;
537
537
  }
@@ -644,14 +644,14 @@ function Ht(e, t, n, s, o) {
644
644
  }
645
645
  }
646
646
  }
647
- const a = s.fieldTokens ? Ie(o.instr) : void 0;
647
+ const a = s.fieldTokens ? Se(o.instr) : void 0;
648
648
  a && (n.push({ kind: "run", text: a, props: t }), o.suppressResult = !0);
649
649
  break;
650
650
  }
651
651
  case "end":
652
652
  if (s.trackFields && r.depth > 0 && (r.depth === 1 && (He(s), r.openId = null, r.topInstr = ""), r.depth--), o.depth > 0 && o.depth--, o.depth === 0) {
653
653
  if (!o.suppressResult) {
654
- const a = s.fieldTokens ? Ie(o.instr) : void 0;
654
+ const a = s.fieldTokens ? Se(o.instr) : void 0;
655
655
  a && n.push({ kind: "run", text: a, props: t });
656
656
  }
657
657
  o.instr = "", o.suppressResult = !1, o.pagerefAnchor = void 0, o.resultFieldId = void 0;
@@ -673,7 +673,7 @@ function zt(e, t) {
673
673
  if (p !== void 0 && (i.heightEmu = p), n) {
674
674
  const u = f(n, "wp:wrapSquare") ?? f(n, "wp:wrapTight") ?? f(n, "wp:wrapThrough"), l = f(n, "wp:wrapNone");
675
675
  i.anchorWrap = u ? "square" : "block";
676
- const h = f(n, "wp:positionH"), g = f(n, "wp:positionV"), S = h && f(h, "wp:align"), E = S && de(S);
676
+ const h = f(n, "wp:positionH"), g = f(n, "wp:positionV"), I = h && f(h, "wp:align"), E = I && de(I);
677
677
  if ((E === "left" || E === "right" || E === "center") && (i.anchorAlign = E), l) {
678
678
  const b = ge(n, "adec:decorative"), A = v(n, "relativeHeight");
679
679
  i.anchorFloat = {
@@ -830,8 +830,8 @@ function Vt(e, t) {
830
830
  r !== void 0 && (n.pageHeightTwips = r);
831
831
  const a = f(e, "w:pgMar");
832
832
  if (a) {
833
- const h = v(a, "w:top"), g = v(a, "w:right"), S = v(a, "w:bottom"), E = v(a, "w:left");
834
- h !== void 0 && g !== void 0 && S !== void 0 && E !== void 0 && (n.marginTwips = { top: h, right: g, bottom: S, left: E });
833
+ const h = v(a, "w:top"), g = v(a, "w:right"), I = v(a, "w:bottom"), E = v(a, "w:left");
834
+ h !== void 0 && g !== void 0 && I !== void 0 && E !== void 0 && (n.marginTwips = { top: h, right: g, bottom: I, left: E });
835
835
  const b = v(a, "w:header");
836
836
  b !== void 0 && (n.headerDistTwips = b);
837
837
  const A = v(a, "w:footer");
@@ -846,8 +846,8 @@ function Vt(e, t) {
846
846
  const h = Y(p, "w:col"), g = v(p, "w:num") ?? (h.length > 1 ? h.length : 1);
847
847
  if (g > 1) {
848
848
  n.columns = { count: g };
849
- const S = v(p, "w:space");
850
- if (S !== void 0 && (n.columns.spaceTwips = S), (m(p, "w:sep") === "1" || m(p, "w:sep") === "true") && (n.columns.sep = !0), h.length === g) {
849
+ const I = v(p, "w:space");
850
+ if (I !== void 0 && (n.columns.spaceTwips = I), (m(p, "w:sep") === "1" || m(p, "w:sep") === "true") && (n.columns.sep = !0), h.length === g) {
851
851
  const E = h.map((b) => ({
852
852
  wTwips: v(b, "w:w") ?? 0,
853
853
  spaceTwips: v(b, "w:space") ?? 0
@@ -860,7 +860,7 @@ function Vt(e, t) {
860
860
  if (u) {
861
861
  const g = {
862
862
  offsetFrom: m(u, "w:offsetFrom") === "text" ? "text" : "page"
863
- }, S = (E) => {
863
+ }, I = (E) => {
864
864
  const b = f(u, "w:" + E);
865
865
  if (!b) return;
866
866
  const A = v(b, "w:sz"), H = v(b, "w:space"), T = m(b, "w:color");
@@ -871,7 +871,7 @@ function Vt(e, t) {
871
871
  ...T !== void 0 ? { color: T } : {}
872
872
  };
873
873
  };
874
- S("top"), S("right"), S("bottom"), S("left"), (g.top || g.right || g.bottom || g.left) && (n.pageBorders = g);
874
+ I("top"), I("right"), I("bottom"), I("left"), (g.top || g.right || g.bottom || g.left) && (n.pageBorders = g);
875
875
  }
876
876
  const l = v(f(e, "w:pgNumType"), "w:start");
877
877
  return l !== void 0 && (n.pageNumberStart = l), n;
@@ -964,14 +964,14 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
964
964
  const i = () => `i${a++}`, d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), l = [], h = (c) => {
965
965
  let w = u.get(c);
966
966
  return w === void 0 && (w = String(u.size + 1), u.set(c, w), l.push(c)), w;
967
- }, g = /* @__PURE__ */ new Map(), S = (c) => {
967
+ }, g = /* @__PURE__ */ new Map(), I = (c) => {
968
968
  const w = g.get(c);
969
969
  if (w) return w;
970
970
  const x = s.get(c);
971
971
  if (!x) return;
972
972
  const O = nn(x);
973
973
  return g.set(c, O), O;
974
- }, E = Se(t.run(void 0, {})), b = je(t.para({})), A = () => ({
974
+ }, E = Ie(t.run(void 0, {})), b = je(t.para({})), A = () => ({
975
975
  kind: "paragraph",
976
976
  id: i(),
977
977
  revision: 0,
@@ -979,7 +979,7 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
979
979
  style: { ...b }
980
980
  }), H = (c, w) => {
981
981
  if (!w) return 0;
982
- const x = S(w.numId);
982
+ const x = I(w.numId);
983
983
  if (!x)
984
984
  return e.add("list-missing", "A list reference had no matching definition — markers were dropped."), 0;
985
985
  c.list = { listId: w.numId, level: w.level };
@@ -997,7 +997,7 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
997
997
  let j;
998
998
  const X = (c, w, x = qt) => {
999
999
  const O = [];
1000
- let P = !1, F = !1, B = !1, I = !1;
1000
+ let P = !1, F = !1, B = !1, S = !1;
1001
1001
  const z = (L) => L.some((y) => y.kind !== "paragraph" || y.runs.some((k) => k.text.trim().length > 0 && !k.style.hidden));
1002
1002
  let G = 0, $ = null;
1003
1003
  const _ = (L) => {
@@ -1034,10 +1034,10 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1034
1034
  R.sectionHasBands && e.add(
1035
1035
  "section-bands-flattened",
1036
1036
  "Per-section headers/footers on geometry-preserving section breaks were not applied (the document section's are used)."
1037
- ), P = !0, F = !B && I || N(L), G > 0 && $ && N(G - 1) && ($.style.pageBreakBefore = !0);
1037
+ ), P = !0, F = !B && S || N(L), G > 0 && $ && N(G - 1) && ($.style.pageBreakBefore = !0);
1038
1038
  B = !0;
1039
1039
  }
1040
- y.kind === "paragraph" && y.props.sectionBreak !== void 0 ? (G = L + 1, $ = null) : $ || ($ = _(k) ?? null), O.push(...k), B || (I ||= z(k));
1040
+ y.kind === "paragraph" && y.props.sectionBreak !== void 0 ? (G = L + 1, $ = null) : $ || ($ = _(k) ?? null), O.push(...k), B || (S ||= z(k));
1041
1041
  }
1042
1042
  return K(O), O;
1043
1043
  }, K = (c) => {
@@ -1046,7 +1046,7 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1046
1046
  const F = c[P];
1047
1047
  if (F.kind !== "paragraph" || !F.style.namedStyle || !t.isHeading(F.style.namedStyle)) continue;
1048
1048
  const B = [];
1049
- let I = 0, z = -1;
1049
+ let S = 0, z = -1;
1050
1050
  for (let G = P + 1; G < c.length && G <= P + 6; G++) {
1051
1051
  const $ = c[G];
1052
1052
  if (w($)) {
@@ -1055,8 +1055,8 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1055
1055
  }
1056
1056
  if ($.kind !== "paragraph") break;
1057
1057
  if (!x($)) {
1058
- if (I >= 2 || O($) > 300) break;
1059
- I++, B.push($);
1058
+ if (S >= 2 || O($) > 300) break;
1059
+ S++, B.push($);
1060
1060
  }
1061
1061
  }
1062
1062
  if (!(z < 0)) {
@@ -1066,7 +1066,7 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1066
1066
  }
1067
1067
  };
1068
1068
  function Q(c, w, x) {
1069
- const O = t.para(c.props), P = je(O), F = H(P, O.list), B = Se(t.run(c.props.styleId, c.props.markRunProps ?? {})), I = [];
1069
+ const O = t.para(c.props), P = je(O), F = H(P, O.list), B = Ie(t.run(c.props.styleId, c.props.markRunProps ?? {})), S = [];
1070
1070
  let z = [], G = !1, $ = !1, _ = !1;
1071
1071
  const N = (k) => {
1072
1072
  const R = { ...P };
@@ -1074,20 +1074,20 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1074
1074
  kind: "paragraph",
1075
1075
  id: i(),
1076
1076
  revision: 0,
1077
- runs: at(k, B),
1077
+ runs: st(k, B),
1078
1078
  style: R
1079
1079
  };
1080
1080
  }, L = () => {
1081
- z.length !== 0 && (I.push(N(z)), z = []);
1081
+ z.length !== 0 && (S.push(N(z)), z = []);
1082
1082
  };
1083
1083
  for (const k of c.inlines)
1084
1084
  switch (k.kind) {
1085
1085
  case "break":
1086
- !k.page && !k.column ? (e.add("soft-breaks", "Soft line breaks (Shift+Enter) became paragraph breaks."), z.length > 0 ? L() : I.push(N([]))) : (z.length > 0 && L(), k.page && ($ = !0), k.column && (_ = !0)), G = !0;
1086
+ !k.page && !k.column ? (e.add("soft-breaks", "Soft line breaks (Shift+Enter) became paragraph breaks."), z.length > 0 ? L() : S.push(N([]))) : (z.length > 0 && L(), k.page && ($ = !0), k.column && (_ = !0)), G = !0;
1087
1087
  break;
1088
1088
  case "image": {
1089
1089
  const R = V(k, w, P.align);
1090
- R && (L(), ($ || _) && I.push(N([])), I.push(R), G = !1);
1090
+ R && (L(), ($ || _) && S.push(N([])), S.push(R), G = !1);
1091
1091
  break;
1092
1092
  }
1093
1093
  case "run": {
@@ -1096,18 +1096,18 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1096
1096
  break;
1097
1097
  }
1098
1098
  }
1099
- L(), (G || I.length === 0) && I.push(N([]));
1100
- const y = I.filter((k) => k.kind === "paragraph");
1099
+ L(), (G || S.length === 0) && S.push(N([]));
1100
+ const y = S.filter((k) => k.kind === "paragraph");
1101
1101
  if (y.forEach((k, R) => {
1102
1102
  R > 0 && (k.style.spaceBeforePx = 0), R < y.length - 1 && (k.style.spaceAfterPx = 0), R > 0 && k.style.list && (delete k.style.list, k.style.indentLeftPx = M(k.style.indentLeftPx + F));
1103
- }), c.bookmarkMarkers && c.bookmarkMarkers.length > 0 && I[0]) {
1104
- const k = I[0], R = k.kind === "paragraph" ? k.runs.reduce((D, q) => D + q.text.length, 0) : 0;
1103
+ }), c.bookmarkMarkers && c.bookmarkMarkers.length > 0 && S[0]) {
1104
+ const k = S[0], R = k.kind === "paragraph" ? k.runs.reduce((D, q) => D + q.text.length, 0) : 0;
1105
1105
  for (const D of c.bookmarkMarkers) {
1106
1106
  const q = { blockId: k.id, offset: Math.min(D.offset, R) };
1107
1107
  D.kind === "start" && D.name ? d.set(D.id, { name: D.name, pos: q }) : D.kind === "end" && p.set(D.id, q);
1108
1108
  }
1109
1109
  }
1110
- return I;
1110
+ return S;
1111
1111
  }
1112
1112
  function V(c, w, x) {
1113
1113
  const O = w.resolve(c.relId);
@@ -1141,20 +1141,20 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1141
1141
  }
1142
1142
  function ee(c, w, x, O, P) {
1143
1143
  let F = c;
1144
- const B = Se(w);
1144
+ const B = Ie(w);
1145
1145
  if (w.linkRelId) {
1146
- const I = x(w.linkRelId);
1147
- I ? B.link = I : e.add("links-unresolved", "A hyperlink target could not be resolved and was dropped.");
1146
+ const S = x(w.linkRelId);
1147
+ S ? B.link = S : e.add("links-unresolved", "A hyperlink target could not be resolved and was dropped.");
1148
1148
  } else w.linkAnchor && (B.link = `#${w.linkAnchor}`);
1149
1149
  if (w.footnoteId !== void 0 && (F = h(w.footnoteId), B.footnoteRef = `fn${w.footnoteId}`, B.verticalAlign = "super"), O) {
1150
1150
  B.sdtId = O;
1151
- const I = n[O];
1152
- I?.type === "checkbox" && F.length > 0 && (F = I.checked ? "☒" : "☐", B.fontFamily = Ze.fontFamily);
1151
+ const S = n[O];
1152
+ S?.type === "checkbox" && F.length > 0 && (F = S.checked ? "☒" : "☐", B.fontFamily = Ze.fontFamily);
1153
1153
  }
1154
1154
  return P && (B.fieldId = P), w.styleId && (B.charStyleId = w.styleId), { text: F, style: B };
1155
1155
  }
1156
1156
  function re(c, w, x, O, P, F) {
1157
- const B = c.cell.rowSpan ?? 1, I = {
1157
+ const B = c.cell.rowSpan ?? 1, S = {
1158
1158
  top: c.startRow === 0,
1159
1159
  bottom: c.startRow + B - 1 === F - 1,
1160
1160
  left: c.startCol === 0,
@@ -1162,7 +1162,7 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1162
1162
  }, z = c.ir?.shd ?? w.shd ?? x.shd;
1163
1163
  if (z && (c.cell.shading = z), O) {
1164
1164
  const G = { cell: c.ir?.borders, table: w.borders, style: x.borders };
1165
- c.cell.borders = St(G, I);
1165
+ c.cell.borders = It(G, S);
1166
1166
  }
1167
1167
  }
1168
1168
  function oe(c, w, x) {
@@ -1195,8 +1195,8 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1195
1195
  L.push({ cell: k, ir: null, startRow: N, startCol: y, colSpan: 1 }), F[y] = k, y += 1;
1196
1196
  }
1197
1197
  return L;
1198
- }), I = c.styleId ? o(c.styleId) : {}, z = !!I.borders || !!c.borders || !!c.bordersSpecified || c.rows.some((_) => _.cells.some((N) => N.borders || N.bordersSpecified));
1199
- for (const _ of B) for (const N of _) re(N, c, I, z, P, c.rows.length);
1198
+ }), S = c.styleId ? o(c.styleId) : {}, z = !!S.borders || !!c.borders || !!c.bordersSpecified || c.rows.some((_) => _.cells.some((N) => N.borders || N.bordersSpecified));
1199
+ for (const _ of B) for (const N of _) re(N, c, S, z, P, c.rows.length);
1200
1200
  const G = B.map((_) => ({ cells: _.map((N) => N.cell) })), $ = { kind: "table", id: i(), revision: 0, rows: G };
1201
1201
  return c.styleId && ($.styleId = c.styleId), c.look && ($.condOverrides = { ...c.look }), $.colFractions = an(c.colWidthsTwips, P), $;
1202
1202
  }
@@ -1216,7 +1216,7 @@ function Qt(e, t, n = {}, s = /* @__PURE__ */ new Map(), o = () => ({}), r) {
1216
1216
  // Realize EVERY defined numbering definition (not just referenced ones) so a
1217
1217
  // list style authored in the editor survives save→reopen before it's applied.
1218
1218
  lists: () => {
1219
- for (const c of s.keys()) S(c);
1219
+ for (const c of s.keys()) I(c);
1220
1220
  return Object.fromEntries(g);
1221
1221
  },
1222
1222
  bookmarks: () => {
@@ -1331,7 +1331,7 @@ const cn = {
1331
1331
  black: "#000000",
1332
1332
  white: "#ffffff"
1333
1333
  };
1334
- function Se(e) {
1334
+ function Ie(e) {
1335
1335
  const t = { ...Ze };
1336
1336
  return et(t, e), t;
1337
1337
  }
@@ -1388,7 +1388,7 @@ function fn(e) {
1388
1388
  Object.keys(p).length > 0 && (d.char = p);
1389
1389
  const u = tt(r);
1390
1390
  Object.keys(u).length > 0 && (d.para = u);
1391
- const l = It(a);
1391
+ const l = St(a);
1392
1392
  return l && (d.borders = l), i !== void 0 && (d.shading = i), d;
1393
1393
  }, s = {};
1394
1394
  for (const o of t) {
@@ -1547,7 +1547,7 @@ function Pn(e, t) {
1547
1547
  if (t.startsWith("major")) return e.majorLatin;
1548
1548
  if (t.startsWith("minor")) return e.minorLatin;
1549
1549
  }
1550
- function Sn(e) {
1550
+ function In(e) {
1551
1551
  const t = { colors: /* @__PURE__ */ new Map() }, n = ne(ie(e, "theme"), "a:theme"), s = n && f(n, "a:themeElements");
1552
1552
  if (!s) return t;
1553
1553
  const o = f(s, "a:fontScheme");
@@ -1569,7 +1569,7 @@ function We(e) {
1569
1569
  const t = e && f(e, "a:latin");
1570
1570
  return t && m(t, "typeface") || void 0;
1571
1571
  }
1572
- const In = { docDefaultsRun: {}, docDefaultsPara: {}, styles: /* @__PURE__ */ new Map() };
1572
+ const Sn = { docDefaultsRun: {}, docDefaultsPara: {}, styles: /* @__PURE__ */ new Map() };
1573
1573
  function Mn(e, t) {
1574
1574
  const n = { docDefaultsRun: {}, docDefaultsPara: {}, styles: /* @__PURE__ */ new Map() }, s = ne(ie(e, "styles.xml"), "w:styles");
1575
1575
  if (!s) return n;
@@ -1592,15 +1592,15 @@ function Mn(e, t) {
1592
1592
  l && (u.name = l);
1593
1593
  const h = Z(r, "w:basedOn");
1594
1594
  if (h && (u.basedOnId = h), i === "table") {
1595
- const S = f(r, "w:tblPr");
1596
- if (S) {
1597
- const b = ye(f(S, "w:tblBorders"));
1595
+ const I = f(r, "w:tblPr");
1596
+ if (I) {
1597
+ const b = ye(f(I, "w:tblBorders"));
1598
1598
  b && (u.tblBorders = b);
1599
- const A = Te(f(S, "w:shd"));
1599
+ const A = Te(f(I, "w:shd"));
1600
1600
  A && (u.tblShd = A);
1601
- const H = Z(S, "w:tblStyleRowBandSize");
1601
+ const H = Z(I, "w:tblStyleRowBandSize");
1602
1602
  H && Number.isFinite(Number(H)) && (u.rowBandSize = Number(H));
1603
- const T = Z(S, "w:tblStyleColBandSize");
1603
+ const T = Z(I, "w:tblStyleColBandSize");
1604
1604
  T && Number.isFinite(Number(T)) && (u.colBandSize = Number(T));
1605
1605
  }
1606
1606
  const E = {};
@@ -1650,12 +1650,12 @@ function Fn(e, t) {
1650
1650
  const h = `${u ?? ""}|${l ?? ""}`;
1651
1651
  let g = i.get(h);
1652
1652
  if (g) return g;
1653
- const S = u ? r(u) : {}, E = l ? r(l) : {};
1654
- g = we(we(e.docDefaultsRun, S), E);
1653
+ const I = u ? r(u) : {}, E = l ? r(l) : {};
1654
+ g = we(we(e.docDefaultsRun, I), E);
1655
1655
  for (const b of An) {
1656
- if (e.docDefaultsRun[b] === void 0 && S[b] === void 0 && E[b] === void 0) continue;
1656
+ if (e.docDefaultsRun[b] === void 0 && I[b] === void 0 && E[b] === void 0) continue;
1657
1657
  const A = e.docDefaultsRun[b] ?? !1;
1658
- g[b] = A !== (S[b] === !0) != (E[b] === !0);
1658
+ g[b] = A !== (I[b] === !0) != (E[b] === !0);
1659
1659
  }
1660
1660
  return i.set(h, g), g;
1661
1661
  };
@@ -1730,21 +1730,21 @@ function Bn(e) {
1730
1730
  };
1731
1731
  }
1732
1732
  function Un(e, t, n) {
1733
- const s = (I, z) => (n?.onProgress ?? t)?.(I, z), o = new rt(), r = [], a = n?.collectMediaBytes ? {
1734
- add(I, z) {
1733
+ const s = (S, z) => (n?.onProgress ?? t)?.(S, z), o = new at(), r = [], a = n?.collectMediaBytes ? {
1734
+ add(S, z) {
1735
1735
  const G = `cw-media:${r.length}`;
1736
- return r.push({ src: G, bytes: I, mime: z }), G;
1736
+ return r.push({ src: G, bytes: S, mime: z }), G;
1737
1737
  }
1738
1738
  } : void 0;
1739
1739
  s("unzip", 0);
1740
1740
  const i = Bn(e);
1741
1741
  s("unzip", 1);
1742
- const d = i.text("[Content_Types].xml"), p = (d !== void 0 ? it(d) : void 0) ?? "word/document.xml", u = i.text(p);
1742
+ const d = i.text("[Content_Types].xml"), p = (d !== void 0 ? rt(d) : void 0) ?? "word/document.xml", u = i.text(p);
1743
1743
  if (u === void 0)
1744
1744
  throw new fe("NO_DOCUMENT_PART", `Main document part "${p}" not found in the archive.`);
1745
1745
  const l = Me(i, p);
1746
1746
  s("styles", 0);
1747
- const h = ke(i, l, "styles") ?? i.text("word/styles.xml"), g = h !== void 0 ? Mn(h, o) : In, S = ke(i, l, "theme") ?? i.text("word/theme/theme1.xml"), E = S !== void 0 ? Sn(S) : vn, b = Fn(g, E), A = ke(i, l, "numbering") ?? i.text("word/numbering.xml"), H = A !== void 0 ? gn(A) : hn;
1747
+ const h = ke(i, l, "styles") ?? i.text("word/styles.xml"), g = h !== void 0 ? Mn(h, o) : Sn, I = ke(i, l, "theme") ?? i.text("word/theme/theme1.xml"), E = I !== void 0 ? In(I) : vn, b = Fn(g, E), A = ke(i, l, "numbering") ?? i.text("word/numbering.xml"), H = A !== void 0 ? gn(A) : hn;
1748
1748
  s("styles", 1), s("parse", 0);
1749
1749
  const T = At(u, p, o);
1750
1750
  s("parse", 1), s("map", 0);
@@ -1756,10 +1756,10 @@ function Un(e, t, n) {
1756
1756
  b,
1757
1757
  T.sdts,
1758
1758
  H,
1759
- (I) => En(g, I),
1759
+ (S) => En(g, S),
1760
1760
  W
1761
- ), te = [], j = (I) => {
1762
- const z = pn(i, I, o, a);
1761
+ ), te = [], j = (S) => {
1762
+ const z = pn(i, S, o, a);
1763
1763
  return te.push(z), z;
1764
1764
  }, X = U.mapBlocks(T.blocks, j(l), Ee(l));
1765
1765
  X.length === 0 && X.push(U.emptyParagraph());
@@ -1769,7 +1769,7 @@ function Un(e, t, n) {
1769
1769
  Ve(K, "header", T.section?.headerRefs, T.section?.titlePg ?? !1, V, i, l, U, j, o, T.sdts), Ve(K, "footer", T.section?.footerRefs, T.section?.titlePg ?? !1, V, i, l, U, j, o, T.sdts);
1770
1770
  const ee = Cn(l, "footnotes") ?? "word/footnotes.xml", re = i.text(ee), oe = re !== void 0 ? Yt(re, ee, o, T.sdts) : /* @__PURE__ */ new Map(), pe = {};
1771
1771
  if (oe.size > 0) {
1772
- const I = Me(i, ee), z = j(I), G = Ee(I);
1772
+ const S = Me(i, ee), z = j(S), G = Ee(S);
1773
1773
  for (const { docxId: $, noteId: _ } of U.footnoteRefs()) {
1774
1774
  const N = oe.get($);
1775
1775
  if (!N) {
@@ -1794,10 +1794,10 @@ function Un(e, t, n) {
1794
1794
  const F = fn(g);
1795
1795
  F && (c.tableStyles = F);
1796
1796
  const B = U.tocField();
1797
- return B && (c.tocInstruction = B.instruction, st(c) === 0 && (c.tocAnchorBlockId = B.blockId)), T.fields && (c.fields = T.fields), {
1797
+ return B && (c.tocInstruction = B.instruction, it(c) === 0 && (c.tocAnchorBlockId = B.blockId)), T.fields && (c.fields = T.fields), {
1798
1798
  doc: c,
1799
1799
  warnings: o.list,
1800
- mediaUrls: te.flatMap((I) => I.urls()),
1800
+ mediaUrls: te.flatMap((S) => S.urls()),
1801
1801
  media: r
1802
1802
  };
1803
1803
  }
@@ -1813,8 +1813,8 @@ function Ln(e, t, n, s, o, r, a) {
1813
1813
  }
1814
1814
  function Ve(e, t, n, s, o, r, a, i, d, p, u) {
1815
1815
  if (!n) return;
1816
- const l = (g) => `${t}${g}`, h = (g, S) => {
1817
- const E = Ln(r, a, S, i, d, p, u);
1816
+ const l = (g) => `${t}${g}`, h = (g, I) => {
1817
+ const E = Ln(r, a, I, i, d, p, u);
1818
1818
  E && (e[g] = E);
1819
1819
  };
1820
1820
  h(l(""), n.default), s && h(l("First"), n.first), o && h(l("Even"), n.even);
@@ -1,6 +1,6 @@
1
- import { u, a as f, s as m, z as g } from "./browser-p_rkUcqE.js";
1
+ import { u, a as f, s as m, z as g } from "./browser-BUrsjziD.js";
2
2
  import { f as h } from "./contentTypes-f7VddqoF.js";
3
- import { p as b, c as k } from "./recalcToc-CFCGCgij.js";
3
+ import { p as b, c as k } from "./recalcToc-BfXlXZik.js";
4
4
  function w(s, r) {
5
5
  const n = b(r), a = {};
6
6
  for (const [o, i] of Object.entries(s.bookmarks ?? {})) {
@@ -1,6 +1,6 @@
1
- import { v as kn, G as Dn, t as bn, i as Ln } from "./browser-p_rkUcqE.js";
2
- import { e as On, f as ye } from "./lists-Sc5I40JO.js";
3
- import { m as ae, w as Pe, x as We } from "./metrics-BUMIC9Mv.js";
1
+ import { C as kn, N as Dn, t as bn, s as Ln } from "./toc-D09f4PrI.js";
2
+ import { e as On, f as ye } from "./lists-DpmgbDyt.js";
3
+ import { a as ae, m as Pe, f as We } from "./metrics-bvGO8KDK.js";
4
4
  const yn = [
5
5
  "BN",
6
6
  "BN",
@@ -1,28 +1,28 @@
1
- import { p as u } from "./browser-p_rkUcqE.js";
1
+ import { c as u } from "./toc-D09f4PrI.js";
2
2
  function p(e) {
3
3
  return e.type ?? "paragraph";
4
4
  }
5
5
  function c(e, t) {
6
6
  return e.styles.find((a) => a.id === t);
7
7
  }
8
- function m(e, t) {
8
+ function g(e, t) {
9
9
  const a = [], r = /* @__PURE__ */ new Set();
10
10
  for (let s = c(e, t); s && !r.has(s.id); s = s.basedOn ? c(e, s.basedOn) : void 0)
11
11
  r.add(s.id), a.unshift(s);
12
12
  const o = {}, n = {};
13
13
  for (const s of a)
14
- Object.assign(o, d(s.char)), Object.assign(n, d(s.para));
14
+ Object.assign(o, f(s.char)), Object.assign(n, f(s.para));
15
15
  return { char: o, para: n };
16
16
  }
17
- function g(e, t) {
17
+ function O(e, t) {
18
18
  const a = [], r = /* @__PURE__ */ new Set();
19
19
  for (let n = c(e, t); n && !r.has(n.id); n = n.basedOn ? c(e, n.basedOn) : void 0)
20
20
  r.add(n.id), a.unshift(n);
21
21
  const o = {};
22
- for (const n of a) Object.assign(o, d(n.char));
22
+ for (const n of a) Object.assign(o, f(n.char));
23
23
  return o;
24
24
  }
25
- function b(e, t) {
25
+ function y(e, t) {
26
26
  const a = /* @__PURE__ */ new Set();
27
27
  let r = !0;
28
28
  for (; r; ) {
@@ -32,22 +32,22 @@ function b(e, t) {
32
32
  }
33
33
  return a;
34
34
  }
35
- function O(e, t, a) {
36
- return a ? a === t ? !0 : b(e, t).has(a) : !1;
35
+ function S(e, t, a) {
36
+ return a ? a === t ? !0 : y(e, t).has(a) : !1;
37
37
  }
38
- function y(e) {
39
- const t = (a) => Object.entries(d(a)).sort(([r], [o]) => r < o ? -1 : r > o ? 1 : 0);
38
+ function h(e) {
39
+ const t = (a) => Object.entries(f(a)).sort(([r], [o]) => r < o ? -1 : r > o ? 1 : 0);
40
40
  return JSON.stringify([p(e), e.basedOn ?? "", t(e.char), t(e.para)]);
41
41
  }
42
- function S(e) {
42
+ function x(e) {
43
43
  const t = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
44
44
  for (const n of e.styles) {
45
- const s = y(n), i = a.get(s);
45
+ const s = h(n), i = a.get(s);
46
46
  if (i === void 0)
47
47
  a.set(s, n.id);
48
48
  else if (n.id === e.defaultStyleId) {
49
49
  a.set(s, n.id), t.set(i, n.id);
50
- for (const [f, l] of t) l === i && t.set(f, n.id);
50
+ for (const [l, d] of t) d === i && t.set(l, n.id);
51
51
  } else
52
52
  t.set(n.id, i);
53
53
  }
@@ -64,30 +64,31 @@ function S(e) {
64
64
  }
65
65
  return { sheet: { styles: o, defaultStyleId: r(e.defaultStyleId) }, remap: t };
66
66
  }
67
- function d(e) {
67
+ function f(e) {
68
68
  const t = {};
69
69
  for (const [a, r] of Object.entries(e))
70
70
  r !== void 0 && (t[a] = r);
71
71
  return t;
72
72
  }
73
- function x(e, t) {
73
+ function P(e, t) {
74
74
  return u(e).filter((a) => a.style.namedStyle === t);
75
75
  }
76
- function P() {
76
+ function b(e = {}) {
77
+ const t = e.fontFamily ?? "Georgia, serif", a = e.fontSizePx ?? 16, r = e.color ?? "#202124", o = e.headingFontFamily ?? "Arial, sans-serif", n = { lineHeight: e.lineHeight ?? 1.5, spaceBeforePx: 0, spaceAfterPx: 12 };
77
78
  return {
78
79
  defaultStyleId: "Normal",
79
80
  styles: [
80
81
  {
81
82
  id: "Normal",
82
83
  name: "Normal",
83
- char: { fontFamily: "Georgia, serif", fontSizePx: 16, bold: !1, italic: !1, color: "#202124" },
84
- para: { ...{ lineHeight: 1.5, spaceBeforePx: 0, spaceAfterPx: 12 }, align: "left", indentFirstLinePx: 0 }
84
+ char: { fontFamily: t, fontSizePx: a, bold: !1, italic: !1, color: r },
85
+ para: { ...n, align: "left", indentFirstLinePx: 0 }
85
86
  },
86
87
  {
87
88
  id: "Title",
88
89
  name: "Title",
89
90
  basedOn: "Normal",
90
- char: { fontFamily: "Arial, sans-serif", fontSizePx: 32, bold: !0, color: "#1a1a2e" },
91
+ char: { fontFamily: o, fontSizePx: 32, bold: !0, color: "#1a1a2e" },
91
92
  para: { align: "center", spaceAfterPx: 4 }
92
93
  },
93
94
  {
@@ -101,7 +102,7 @@ function P() {
101
102
  id: "Heading1",
102
103
  name: "Heading 1",
103
104
  basedOn: "Normal",
104
- char: { fontFamily: "Arial, sans-serif", fontSizePx: 24, bold: !0, color: "#1a1a2e" },
105
+ char: { fontFamily: o, fontSizePx: 24, bold: !0, color: "#1a1a2e" },
105
106
  para: { spaceBeforePx: 18, spaceAfterPx: 8, keepWithNext: !0 }
106
107
  },
107
108
  {
@@ -128,14 +129,18 @@ function P() {
128
129
  ]
129
130
  };
130
131
  }
132
+ function v() {
133
+ return b();
134
+ }
131
135
  export {
132
136
  p as a,
133
- m as b,
134
- b as c,
135
- P as d,
136
- S as m,
137
- x as p,
138
- g as r,
137
+ g as b,
138
+ x as c,
139
+ v as d,
140
+ y as e,
141
+ b as m,
142
+ P as p,
143
+ O as r,
139
144
  c as s,
140
- O as w
145
+ S as w
141
146
  };