oasis-editor 0.0.294 → 0.0.296

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.
@@ -12563,12 +12563,15 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12563
12563
  return r && t.push(r), t;
12564
12564
  }
12565
12565
  function Ni(e) {
12566
- const { propertyRevision: t, styleId: r, ...n } = e.previous, o = ki(n), i = o ? o.slice(7, -8) : "", a = r ? `<w:pStyle w:val="${oo(r)}"/>` : "";
12566
+ const { propertyRevision: t, styleId: r, ...n } = e.previous, o = _i(n), i = o ? o.slice(7, -8) : "", a = r ? `<w:pStyle w:val="${oo(r)}"/>` : "";
12567
12567
  return `<w:pPrChange ${xi(e)}><w:pPr>${a}${i}</w:pPr></w:pPrChange>`;
12568
12568
  }
12569
12569
  function ki(e) {
12570
+ return "justify" === e ? "both" : String(e);
12571
+ }
12572
+ function _i(e) {
12570
12573
  const t = [];
12571
- if (e.align && t.push(`<w:jc w:val="${e.align}"/>`), void 0 !== e.spacingBefore || void 0 !== e.spacingAfter || void 0 !== e.lineHeight) {
12574
+ if (e.align && t.push(`<w:jc w:val="${ki(e.align)}"/>`), void 0 !== e.spacingBefore || void 0 !== e.spacingAfter || void 0 !== e.lineHeight) {
12572
12575
  const r = [], n = ao(e.spacingBefore), o = ao(e.spacingAfter), i = void 0 !== e.lineHeight && null !== e.lineHeight && Number.isFinite(e.lineHeight), a = "exact" === e.lineRule || "atLeast" === e.lineRule, s = i ? a ? io(e.lineHeight, 0) : Math.round(240 * e.lineHeight) : null;
12573
12576
  null !== n && r.push(`w:before="${n}"`), null !== o && r.push(`w:after="${o}"`), null !== s && r.push(`w:line="${s}"`), null !== s && a && r.push(`w:lineRule="${e.lineRule}"`), r.length > 0 && t.push(`<w:spacing ${r.join(" ")}/>`);
12574
12577
  }
@@ -12581,7 +12584,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12581
12584
  const n = bo(e);
12582
12585
  return n && t.push(n), e.shading && t.push(co(e.shading)), e.textDirection && t.push(`<w:textDirection w:val="${e.textDirection}"/>`), null != e.outlineLevel && t.push(`<w:outlineLvl w:val="${e.outlineLevel}"/>`), t.push(...Si(e)), e.propertyRevision && t.push(Ni(e.propertyRevision)), t.length > 0 ? `<w:pPr>${t.join("")}</w:pPr>` : "";
12583
12586
  }
12584
- function _i(e, t, r, n) {
12587
+ function Ti(e, t, r, n) {
12585
12588
  const o = [], i = function(e, t) {
12586
12589
  const r = ie(e.style, t);
12587
12590
  return {
@@ -12628,7 +12631,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12628
12631
  propertyRevision: e.style?.propertyRevision
12629
12632
  };
12630
12633
  }(e, r), a = e.style?.align ?? n?.align ?? i.align;
12631
- if (e.style?.styleId && o.push(`<w:pStyle w:val="${oo(e.style.styleId)}"/>`), a && o.push(`<w:jc w:val="${a}"/>`), void 0 !== i.spacingBefore || void 0 !== i.spacingAfter || void 0 !== i.lineHeight) {
12634
+ if (e.style?.styleId && o.push(`<w:pStyle w:val="${oo(e.style.styleId)}"/>`), a && o.push(`<w:jc w:val="${ki(a)}"/>`), void 0 !== i.spacingBefore || void 0 !== i.spacingAfter || void 0 !== i.lineHeight) {
12632
12635
  const e = [], t = ao(i.spacingBefore), r = ao(i.spacingAfter), n = void 0 !== i.lineHeight && null !== i.lineHeight && Number.isFinite(i.lineHeight), a = "exact" === i.lineRule || "atLeast" === i.lineRule, s = n ? a ? io(i.lineHeight, 0) : Math.round(240 * i.lineHeight) : null;
12633
12636
  null !== t && e.push(`w:before="${t}"`), null !== r && e.push(`w:after="${r}"`), null !== s && e.push(`w:line="${s}"`), null !== s && a && e.push(`w:lineRule="${i.lineRule}"`), e.length > 0 && o.push(`<w:spacing ${e.join(" ")}/>`);
12634
12637
  }
@@ -12647,7 +12650,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12647
12650
  }
12648
12651
  return e.style?.propertyRevision && o.push(Ni(e.style.propertyRevision)), o.length > 0 ? `<w:pPr>${o.join("")}</w:pPr>` : "";
12649
12652
  }
12650
- const Ti = {
12653
+ const Ii = {
12651
12654
  black: [
12652
12655
  0,
12653
12656
  0,
@@ -12728,7 +12731,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12728
12731
  211,
12729
12732
  211
12730
12733
  ]
12731
- }, Ii = {
12734
+ }, Ai = {
12732
12735
  ffff00: "yellow",
12733
12736
  fef08a: "yellow",
12734
12737
  ff0000: "red",
@@ -12738,26 +12741,26 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12738
12741
  ff00ff: "magenta",
12739
12742
  "000000": "black",
12740
12743
  ffffff: "white"
12741
- }, Ai = "http://schemas.openxmlformats.org/markup-compatibility/2006";
12742
- function Ci(e) {
12744
+ }, Ci = "http://schemas.openxmlformats.org/markup-compatibility/2006";
12745
+ function Ri(e) {
12743
12746
  return `<w14:solidFill><w14:srgbClr w14:val="${lo(e)}"/></w14:solidFill>`;
12744
12747
  }
12745
- function Ri(e) {
12746
- return "solid" === e.type ? Ci(e.color) : `<w14:gradFill><w14:gsLst>${e.stops.map((e) => {
12748
+ function $i(e) {
12749
+ return "solid" === e.type ? Ri(e.color) : `<w14:gradFill><w14:gsLst>${e.stops.map((e) => {
12747
12750
  const t = lo(e.color);
12748
12751
  return `<w14:gs w14:pos="${Math.round(e.position * R)}"><w14:srgbClr w14:val="${t}">${void 0 !== e.alpha ? `<w14:alpha w14:val="${Math.round(e.alpha * R)}"/>` : ""}</w14:srgbClr></w14:gs>`;
12749
12752
  }).join("")}</w14:gsLst><w14:lin w14:ang="${Math.round((e.angle ?? 0) * $)}" w14:scaled="0"/></w14:gradFill>`;
12750
12753
  }
12751
- function $i(e, t) {
12754
+ function Di(e, t) {
12752
12755
  return `<w14:srgbClr w14:val="${lo(e)}">${void 0 !== t ? `<w14:alpha w14:val="${Math.round(t * R)}"/>` : ""}</w14:srgbClr>`;
12753
12756
  }
12754
- function Di(e) {
12755
- return `<mc:AlternateContent xmlns:mc="${Ai}"><mc:Choice Requires="w14">${e}</mc:Choice><mc:Fallback/></mc:AlternateContent>`;
12756
- }
12757
12757
  function Pi(e) {
12758
+ return `<mc:AlternateContent xmlns:mc="${Ci}"><mc:Choice Requires="w14">${e}</mc:Choice><mc:Fallback/></mc:AlternateContent>`;
12759
+ }
12760
+ function Fi(e) {
12758
12761
  return null != e && Number.isFinite(e) ? Math.round(20 * e) : null;
12759
12762
  }
12760
- const Fi = function(e) {
12763
+ const Mi = function(e) {
12761
12764
  if (!e) return null;
12762
12765
  const t = hr(e);
12763
12766
  return fr.test(t) ? [
@@ -12766,7 +12769,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12766
12769
  Number.parseInt(t.slice(4, 6), 16)
12767
12770
  ] : null;
12768
12771
  };
12769
- function Mi(e) {
12772
+ function Oi(e) {
12770
12773
  if (!e) return "";
12771
12774
  const t = [];
12772
12775
  e.styleId && t.push(`<w:rStyle w:val="${oo(e.styleId)}"/>`);
@@ -12778,7 +12781,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12778
12781
  t.push(`<w:u w:val="${oo(r)}"${n}/>`);
12779
12782
  } else !1 === e.underline && t.push("<w:u w:val=\"none\"/>");
12780
12783
  if (r(e.strike, "strike"), r(e.doubleStrike, "dstrike"), r(e.outline, "outline"), r(e.shadow, "shadow"), r(e.emboss, "emboss"), r(e.imprint, "imprint"), r(e.smallCaps, "smallCaps"), r(e.allCaps, "caps"), r(e.hidden, "vanish"), r(e.noProof, "noProof"), r(e.webHidden, "webHidden"), r(e.specVanish, "specVanish"), !1 === e.snapToGrid && t.push("<w:snapToGrid w:val=\"0\"/>"), e.textEffect && t.push(`<w:effect w:val="${oo(e.textEffect)}"/>`), e.textBorder && t.push(`<w:bdr ${wo(e.textBorder)}`), void 0 !== e.characterScale && null !== e.characterScale && Number.isFinite(e.characterScale) && t.push(`<w:w w:val="${Math.max(1, Math.round(e.characterScale))}"/>`), void 0 !== e.characterSpacing && null !== e.characterSpacing) {
12781
- const r = Pi(e.characterSpacing);
12784
+ const r = Fi(e.characterSpacing);
12782
12785
  null !== r && t.push(`<w:spacing w:val="${r}"/>`);
12783
12786
  }
12784
12787
  void 0 !== e.baselineShift && null !== e.baselineShift && Number.isFinite(e.baselineShift) && t.push(`<w:position w:val="${Math.round(2 * e.baselineShift)}"/>`), void 0 !== e.kerningThreshold && null !== e.kerningThreshold && Number.isFinite(e.kerningThreshold) && t.push(`<w:kern w:val="${Math.max(0, Math.round(2 * e.kerningThreshold))}"/>`);
@@ -12821,36 +12824,36 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12821
12824
  if (e.textFill) {
12822
12825
  const r = "solid" === e.textFill.type ? e.textFill.color : e.color;
12823
12826
  t.push(function(e, t) {
12824
- const r = Ri(e), n = lo(t ?? "000000");
12825
- return `<mc:AlternateContent xmlns:mc="${Ai}"><mc:Choice Requires="w14"><w14:textFill>${r}</w14:textFill></mc:Choice><mc:Fallback><w:color w:val="${n}"/></mc:Fallback></mc:AlternateContent>`;
12827
+ const r = $i(e), n = lo(t ?? "000000");
12828
+ return `<mc:AlternateContent xmlns:mc="${Ci}"><mc:Choice Requires="w14"><w14:textFill>${r}</w14:textFill></mc:Choice><mc:Fallback><w:color w:val="${n}"/></mc:Fallback></mc:AlternateContent>`;
12826
12829
  }(e.textFill, r ?? null));
12827
12830
  } else e.color && t.push(`<w:color w:val="${lo(e.color, "auto")}"/>`);
12828
12831
  if (e.textOutline && t.push(function(e) {
12829
- const t = Math.round(Math.max(0, e.widthPt) * A), r = e.fill ? Ri(e.fill) : e.color ? Ci(e.color) : "";
12830
- return `<mc:AlternateContent xmlns:mc="${Ai}"><mc:Choice Requires="w14"><w14:textOutline w14:w="${t}" w14:cap="flat" w14:cmpd="sng" w14:algn="ctr">` + r + "</w14:textOutline></mc:Choice><mc:Fallback><w:outline/></mc:Fallback></mc:AlternateContent>";
12832
+ const t = Math.round(Math.max(0, e.widthPt) * A), r = e.fill ? $i(e.fill) : e.color ? Ri(e.color) : "";
12833
+ return `<mc:AlternateContent xmlns:mc="${Ci}"><mc:Choice Requires="w14"><w14:textOutline w14:w="${t}" w14:cap="flat" w14:cmpd="sng" w14:algn="ctr">` + r + "</w14:textOutline></mc:Choice><mc:Fallback><w:outline/></mc:Fallback></mc:AlternateContent>";
12831
12834
  }(e.textOutline)), e.textShadow && t.push(function(e) {
12832
- const t = Math.round(Math.max(0, e.blurPt) * A), r = Math.round(Math.max(0, e.distPt) * A), n = Math.round(e.dirDeg * $), o = $i(e.color, e.alpha);
12833
- return `<mc:AlternateContent xmlns:mc="${Ai}"><mc:Choice Requires="w14"><w14:shadow w14:blurRad="${t}" w14:dist="${r}" w14:dir="${n}" w14:sx="100000" w14:sy="100000" w14:kx="0" w14:ky="0" w14:algn="ctr">` + o + "</w14:shadow></mc:Choice><mc:Fallback><w:shadow/></mc:Fallback></mc:AlternateContent>";
12835
+ const t = Math.round(Math.max(0, e.blurPt) * A), r = Math.round(Math.max(0, e.distPt) * A), n = Math.round(e.dirDeg * $), o = Di(e.color, e.alpha);
12836
+ return `<mc:AlternateContent xmlns:mc="${Ci}"><mc:Choice Requires="w14"><w14:shadow w14:blurRad="${t}" w14:dist="${r}" w14:dir="${n}" w14:sx="100000" w14:sy="100000" w14:kx="0" w14:ky="0" w14:algn="ctr">` + o + "</w14:shadow></mc:Choice><mc:Fallback><w:shadow/></mc:Fallback></mc:AlternateContent>";
12834
12837
  }(e.textShadow)), e.glow && t.push(function(e) {
12835
- const t = Math.round(Math.max(0, e.radiusPt) * A), r = $i(e.color, e.alpha);
12836
- return `<mc:AlternateContent xmlns:mc="${Ai}"><mc:Choice Requires="w14"><w14:glow w14:rad="${t}">${r}</w14:glow></mc:Choice><mc:Fallback/></mc:AlternateContent>`;
12838
+ const t = Math.round(Math.max(0, e.radiusPt) * A), r = Di(e.color, e.alpha);
12839
+ return `<mc:AlternateContent xmlns:mc="${Ci}"><mc:Choice Requires="w14"><w14:glow w14:rad="${t}">${r}</w14:glow></mc:Choice><mc:Fallback/></mc:AlternateContent>`;
12837
12840
  }(e.glow)), e.reflection && t.push(function(e) {
12838
12841
  const t = Math.round(Math.max(0, e.blurPt) * A), r = Math.round(e.startAlpha * R), n = Math.round(e.startPos * R), o = Math.round(e.endAlpha * R), i = Math.round(e.endPos * R), a = Math.round(Math.max(0, e.distPt) * A);
12839
- return `<mc:AlternateContent xmlns:mc="${Ai}"><mc:Choice Requires="w14"><w14:reflection w14:blurRad="${t}" w14:stA="${r}" w14:stPos="${n}" w14:endA="${o}" w14:endPos="${i}" w14:dist="${a}" w14:dir="5400000" w14:fadeDir="5400000" w14:sx="100000" w14:sy="-100000" w14:kx="0" w14:ky="0" w14:algn="bl"/></mc:Choice><mc:Fallback/></mc:AlternateContent>`;
12840
- }(e.reflection)), e.scene3dXml && t.push(Di(e.scene3dXml)), e.props3dXml && t.push(Di(e.props3dXml)), e.highlight && t.push(`<w:highlight w:val="${oo(function(e) {
12841
- if (e in Ti) return e;
12842
- const t = (gr(e) ?? e).trim().replace(/^#/, "").toLowerCase(), r = Ii[t];
12842
+ return `<mc:AlternateContent xmlns:mc="${Ci}"><mc:Choice Requires="w14"><w14:reflection w14:blurRad="${t}" w14:stA="${r}" w14:stPos="${n}" w14:endA="${o}" w14:endPos="${i}" w14:dist="${a}" w14:dir="5400000" w14:fadeDir="5400000" w14:sx="100000" w14:sy="-100000" w14:kx="0" w14:ky="0" w14:algn="bl"/></mc:Choice><mc:Fallback/></mc:AlternateContent>`;
12843
+ }(e.reflection)), e.scene3dXml && t.push(Pi(e.scene3dXml)), e.props3dXml && t.push(Pi(e.props3dXml)), e.highlight && t.push(`<w:highlight w:val="${oo(function(e) {
12844
+ if (e in Ii) return e;
12845
+ const t = (gr(e) ?? e).trim().replace(/^#/, "").toLowerCase(), r = Ai[t];
12843
12846
  if (r) return r;
12844
- const n = Fi(t);
12847
+ const n = Mi(t);
12845
12848
  if (!n) return "yellow";
12846
12849
  let o = "yellow", i = Number.POSITIVE_INFINITY;
12847
- for (const [a, s] of Object.entries(Ti)) {
12850
+ for (const [a, s] of Object.entries(Ii)) {
12848
12851
  const e = (s[0] - n[0]) ** 2 + (s[1] - n[1]) ** 2 + (s[2] - n[2]) ** 2;
12849
12852
  e < i && (i = e, o = a);
12850
12853
  }
12851
12854
  return o;
12852
12855
  }(e.highlight))}"/>`), e.shading && t.push(co(e.shading)), void 0 !== e.fitText && null !== e.fitText && Number.isFinite(e.fitText)) {
12853
- const r = Pi(e.fitText);
12856
+ const r = Fi(e.fitText);
12854
12857
  null !== r && r > 0 && t.push(`<w:fitText w:val="${r}"/>`);
12855
12858
  }
12856
12859
  if (r(e.rtl, "rtl"), r(e.complexScript, "cs"), e.emphasisMark && t.push(`<w:em w:val="${oo(e.emphasisMark)}"/>`), e.language) {
@@ -12858,28 +12861,28 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12858
12861
  e.language.value && r.push(`w:val="${oo(e.language.value)}"`), e.language.eastAsia && r.push(`w:eastAsia="${oo(e.language.eastAsia)}"`), e.language.bidi && r.push(`w:bidi="${oo(e.language.bidi)}"`), r.length > 0 && t.push(`<w:lang ${r.join(" ")}/>`);
12859
12862
  }
12860
12863
  return e.propertyRevision && t.push(function(e) {
12861
- const { propertyRevision: t, styleId: r, ...n } = e.previous, o = Mi(n), i = o ? o.slice(7, -8) : "", a = r ? `<w:rStyle w:val="${oo(r)}"/>` : "";
12864
+ const { propertyRevision: t, styleId: r, ...n } = e.previous, o = Oi(n), i = o ? o.slice(7, -8) : "", a = r ? `<w:rStyle w:val="${oo(r)}"/>` : "";
12862
12865
  return `<w:rPrChange ${xi(e)}><w:rPr>${a}${i}</w:rPr></w:rPrChange>`;
12863
12866
  }(e.propertyRevision)), t.length > 0 ? `<w:rPr>${t.join("")}</w:rPr>` : "";
12864
12867
  }
12865
- function Oi(e) {
12868
+ function Li(e) {
12866
12869
  return 0 === e.length ? "" : `<w:t${t = e, /^\s|\s$/.test(t) || t.includes(" ") ? " xml:space=\"preserve\"" : ""}>${oo(e)}</w:t>`;
12867
12870
  var t;
12868
12871
  }
12869
- function Li(e) {
12872
+ function Bi(e) {
12870
12873
  if (0 === e.length) return "<w:t></w:t>";
12871
12874
  let t = "", r = "";
12872
- for (const n of e) "\n" !== n ? "\v" !== n ? " " !== n ? "‑" !== n ? "­" !== n ? r += n : (t += Oi(r), r = "", t += "<w:softHyphen/>") : (t += Oi(r), r = "", t += "<w:noBreakHyphen/>") : (t += Oi(r), r = "", t += "<w:tab/>") : (t += Oi(r), r = "", t += "<w:br w:type=\"column\"/>") : (t += Oi(r), r = "", t += "<w:br/>");
12873
- return t += Oi(r), t || "<w:t></w:t>";
12875
+ for (const n of e) "\n" !== n ? "\v" !== n ? " " !== n ? "‑" !== n ? "­" !== n ? r += n : (t += Li(r), r = "", t += "<w:softHyphen/>") : (t += Li(r), r = "", t += "<w:noBreakHyphen/>") : (t += Li(r), r = "", t += "<w:tab/>") : (t += Li(r), r = "", t += "<w:br w:type=\"column\"/>") : (t += Li(r), r = "", t += "<w:br/>");
12876
+ return t += Li(r), t || "<w:t></w:t>";
12874
12877
  }
12875
- function Bi(e, t) {
12878
+ function Ui(e, t) {
12876
12879
  return e ?? t ? "1" : "0";
12877
12880
  }
12878
- function Ui(e, t, r) {
12881
+ function zi(e, t, r) {
12879
12882
  const n = oo(t?.relativeFrom ?? r);
12880
12883
  return t?.align ? `<wp:${e} relativeFrom="${n}"><wp:align>${oo(t.align)}</wp:align></wp:${e}>` : `<wp:${e} relativeFrom="${n}"><wp:posOffset>${t?.offset ?? 0}</wp:posOffset></wp:${e}>`;
12881
12884
  }
12882
- function zi(e) {
12885
+ function Hi(e) {
12883
12886
  if (!e || e.length < 3) return "";
12884
12887
  const t = (e) => Math.round(21600 * Math.min(1, Math.max(0, e))), r = (e, r) => `<wp:${r} x="${t(e.x)}" y="${t(e.y)}"/>`, n = e[0];
12885
12888
  return `<wp:wrapPolygon edited="0">${[
@@ -12888,28 +12891,28 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12888
12891
  r(n, "lineTo")
12889
12892
  ].join("")}</wp:wrapPolygon>`;
12890
12893
  }
12891
- function Hi(e) {
12894
+ function ji(e) {
12892
12895
  const { cx: t, cy: r, floating: n, docPrId: o, docPrName: i, altAttr: a, graphicXml: s } = e, l = oo(i);
12893
12896
  if (!n) return `<w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${t}" cy="${r}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:docPr id="${o}" name="${l}"${a}/>${s}</wp:inline></w:drawing>`;
12894
- const c = n.distT ?? 0, u = n.distB ?? 0, d = n.distL ?? 0, p = n.distR ?? 0, f = Ui("positionH", n.positionH, "column"), h = Ui("positionV", n.positionV, "paragraph"), m = function(e, t, r) {
12897
+ const c = n.distT ?? 0, u = n.distB ?? 0, d = n.distL ?? 0, p = n.distR ?? 0, f = zi("positionH", n.positionH, "column"), h = zi("positionV", n.positionV, "paragraph"), m = function(e, t, r) {
12895
12898
  const n = t && "bothSides" !== t ? ` wrapText="${t}"` : "";
12896
12899
  switch (e) {
12897
12900
  case "square": return `<wp:wrapSquare${n}/>`;
12898
12901
  case "tight": {
12899
- const e = zi(r);
12902
+ const e = Hi(r);
12900
12903
  return e ? `<wp:wrapTight${n}>${e}</wp:wrapTight>` : `<wp:wrapTight${n}/>`;
12901
12904
  }
12902
12905
  case "through": {
12903
- const e = zi(r);
12906
+ const e = Hi(r);
12904
12907
  return e ? `<wp:wrapThrough${n}>${e}</wp:wrapThrough>` : `<wp:wrapThrough${n}/>`;
12905
12908
  }
12906
12909
  case "topAndBottom": return "<wp:wrapTopAndBottom/>";
12907
12910
  default: return "<wp:wrapNone/>";
12908
12911
  }
12909
12912
  }(n.wrap, n.wrapText, e.wrapPolygon);
12910
- return `<w:drawing><wp:anchor distT="${c}" distB="${u}" distL="${d}" distR="${p}" simplePos="${Bi(n.simplePos, !1)}" relativeHeight="${n.relativeHeight ?? 0}" behindDoc="${Bi(n.behindDoc, !1)}" locked="${Bi(n.locked, !1)}" layoutInCell="${Bi(n.layoutInCell, !0)}" allowOverlap="${Bi(n.allowOverlap, !0)}"><wp:simplePos x="0" y="0"/>${f}${h}<wp:extent cx="${t}" cy="${r}"/><wp:effectExtent l="0" t="0" r="0" b="0"/>${m}<wp:docPr id="${o}" name="${l}"${a}/>${s}</wp:anchor></w:drawing>`;
12913
+ return `<w:drawing><wp:anchor distT="${c}" distB="${u}" distL="${d}" distR="${p}" simplePos="${Ui(n.simplePos, !1)}" relativeHeight="${n.relativeHeight ?? 0}" behindDoc="${Ui(n.behindDoc, !1)}" locked="${Ui(n.locked, !1)}" layoutInCell="${Ui(n.layoutInCell, !0)}" allowOverlap="${Ui(n.allowOverlap, !0)}"><wp:simplePos x="0" y="0"/>${f}${h}<wp:extent cx="${t}" cy="${r}"/><wp:effectExtent l="0" t="0" r="0" b="0"/>${m}<wp:docPr id="${o}" name="${l}"${a}/>${s}</wp:anchor></w:drawing>`;
12911
12914
  }
12912
- function ji(e, t, r, n) {
12915
+ function qi(e, t, r, n) {
12913
12916
  const o = r.images.find((e) => e.rId === t);
12914
12917
  if (!o) return null;
12915
12918
  const i = (parseInt(t.replace(/\D+/g, ""), 10) || 0) + 1, a = void 0 !== o.alt ? ` descr="${oo(o.alt)}" title="${oo(o.alt)}"` : "", s = function(e) {
@@ -12932,7 +12935,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12932
12935
  return `<a:prstGeom prst="${oo(e.preset)}">${r}</a:prstGeom>`;
12933
12936
  }(o.cropShape);
12934
12937
  return `<w:r>${n}${function(e, t, r, n) {
12935
- return Hi({
12938
+ return ji({
12936
12939
  cx: e.cx,
12937
12940
  cy: e.cy,
12938
12941
  floating: e.floating,
@@ -12944,7 +12947,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12944
12947
  });
12945
12948
  }(o, i, a, `<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="0" name="Picture"${a}/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip ${p} xmlns:r="${ro}">${f}</a:blip>${l}${d}</pic:blipFill><pic:spPr><a:xfrm${s}><a:off x="0" y="0"/><a:ext cx="${o.cx}" cy="${o.cy}"/></a:xfrm>${h}${c}</pic:spPr></pic:pic></a:graphicData></a:graphic>`)}</w:r>`;
12946
12949
  }
12947
- function qi(e, t, r, n, o, i) {
12950
+ function Wi(e, t, r, n, o, i) {
12948
12951
  const a = Math.round(t.width * I), s = Math.round(t.height * I), l = r.textBoxDocPrIds.get(e.id) ?? 1, c = t.name ?? "Text Box", u = void 0 !== t.alt ? ` descr="${oo(t.alt)}" title="${oo(t.alt)}"` : "", d = function(e, t, r, n, o, i) {
12949
12952
  const a = e.shape, s = oo(a?.preset ?? "rect"), l = e.rotation ? Math.round(e.rotation * $) : 0, c = 0 !== l ? ` rot="${l}"` : "", u = a?.fill ? `<a:solidFill><a:srgbClr val="${oo(a.fill.replace(/^#/, ""))}"/></a:solidFill>` : "";
12950
12953
  let d = "";
@@ -12954,7 +12957,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12954
12957
  const h = p?.autoFit ? "<a:spAutoFit/>" : "", m = e.blocks.length > 0, g = m ? i(e.blocks, n, o) : "";
12955
12958
  return "<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"><a:graphicData uri=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\"><wps:wsp>" + (m ? "<wps:cNvSpPr txBox=\"1\"><a:spLocks noChangeArrowheads=\"1\"/></wps:cNvSpPr>" : "<wps:cNvSpPr/>") + `<wps:spPr bwMode="auto"><a:xfrm${c}><a:off x="0" y="0"/><a:ext cx="${t}" cy="${r}"/></a:xfrm><a:prstGeom prst="${s}"><a:avLst/></a:prstGeom>` + u + d + "</wps:spPr>" + (m ? `<wps:txbx><w:txbxContent>${g}</w:txbxContent></wps:txbx>` : "") + `<wps:bodyPr ${f.join(" ")}>${h}</wps:bodyPr></wps:wsp></a:graphicData></a:graphic>`;
12956
12959
  }(t, a, s, r, n, i);
12957
- return `<w:r>${o}${Hi({
12960
+ return `<w:r>${o}${ji({
12958
12961
  cx: a,
12959
12962
  cy: s,
12960
12963
  floating: t.floating,
@@ -12964,61 +12967,61 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
12964
12967
  graphicXml: d
12965
12968
  })}</w:r>`;
12966
12969
  }
12967
- const Wi = {
12970
+ const Gi = {
12968
12971
  footnote: "FootnoteReference",
12969
12972
  endnote: "EndnoteReference"
12970
12973
  };
12971
- function Gi(e) {
12972
- return `<w:r><w:rPr><w:rStyle w:val="${Wi[e]}"/><w:vertAlign w:val="superscript"/></w:rPr><w:${e}Ref/></w:r>`;
12974
+ function Vi(e) {
12975
+ return `<w:r><w:rPr><w:rStyle w:val="${Gi[e]}"/><w:vertAlign w:val="superscript"/></w:rPr><w:${e}Ref/></w:r>`;
12973
12976
  }
12974
- function Vi(e, t, r, n) {
12977
+ function Xi(e, t, r, n) {
12975
12978
  if (!t) return null;
12976
12979
  const o = ("footnote" === e ? n.footnoteIdMap : n.endnoteIdMap)?.get(t.noteId);
12977
12980
  if (void 0 === o) return null;
12978
12981
  const i = {
12979
12982
  ...r ?? {},
12980
- styleId: Wi[e],
12983
+ styleId: Gi[e],
12981
12984
  superscript: !0
12982
12985
  }, a = t.customMark ? " w:customMarkFollows=\"1\"" : "", s = t.customMark ? `<w:t xml:space="preserve">${oo(t.customMark)}</w:t>` : "";
12983
- return `<w:r>${Mi(i)}<w:${e}Reference${a} w:id="${o}"/>${s}</w:r>`;
12986
+ return `<w:r>${Oi(i)}<w:${e}Reference${a} w:id="${o}"/>${s}</w:r>`;
12984
12987
  }
12985
- function Xi(e, t) {
12988
+ function Zi(e, t) {
12986
12989
  return void 0 === t ? "" : ` m:${e}="${oo(String(t))}"`;
12987
12990
  }
12988
- function Zi(e) {
12989
- return e.map(Yi).join("");
12990
- }
12991
12991
  function Yi(e) {
12992
+ return e.map(Qi).join("");
12993
+ }
12994
+ function Qi(e) {
12992
12995
  switch (e.kind) {
12993
12996
  case "text": return function(e) {
12994
12997
  const t = e.style;
12995
12998
  return `<m:r>${t ? `<m:rPr>${t.bold ? "<m:b/>" : ""}${t.italic ? "<m:i/>" : ""}${t.normalText ? "<m:nor/>" : ""}${t.script ? `<m:sty m:val="${oo(t.script)}"/>` : ""}</m:rPr>` : ""}<m:t xml:space="preserve">${oo(e.value)}</m:t></m:r>`;
12996
12999
  }(e);
12997
- case "fraction": return `<m:f>${!1 === e.bar ? "<m:fPr><m:type m:val=\"noBar\"/></m:fPr>" : ""}<m:num>${Zi(e.numerator)}</m:num><m:den>${Zi(e.denominator)}</m:den></m:f>`;
12998
- case "radical": return e.degree ? `<m:rad><m:deg>${Zi(e.degree)}</m:deg><m:e>${Zi(e.radicand)}</m:e></m:rad>` : `<m:rad><m:e>${Zi(e.radicand)}</m:e></m:rad>`;
13000
+ case "fraction": return `<m:f>${!1 === e.bar ? "<m:fPr><m:type m:val=\"noBar\"/></m:fPr>" : ""}<m:num>${Yi(e.numerator)}</m:num><m:den>${Yi(e.denominator)}</m:den></m:f>`;
13001
+ case "radical": return e.degree ? `<m:rad><m:deg>${Yi(e.degree)}</m:deg><m:e>${Yi(e.radicand)}</m:e></m:rad>` : `<m:rad><m:e>${Yi(e.radicand)}</m:e></m:rad>`;
12999
13002
  case "script": {
13000
13003
  const t = e.subscript && e.superscript ? "sSubSup" : e.subscript ? "sSub" : "sSup";
13001
- return `<m:${t}><m:e>${Zi(e.base)}</m:e>${e.subscript ? `<m:sub>${Zi(e.subscript)}</m:sub>` : ""}${e.superscript ? `<m:sup>${Zi(e.superscript)}</m:sup>` : ""}</m:${t}>`;
13002
- }
13003
- case "delimiter": return `<m:d><m:dPr>${Xi("begChr", e.begin)}${Xi("endChr", e.end)}${Xi("sepChr", e.separator)}${!1 === e.grow ? "<m:grow m:val=\"0\"/>" : ""}</m:dPr>${e.children.map((e) => `<m:e>${Zi(e)}</m:e>`).join("")}</m:d>`;
13004
- case "accent": return `<m:acc><m:accPr><m:chr${Xi("val", e.accent)}/></m:accPr><m:e>${Zi(e.children)}</m:e></m:acc>`;
13005
- case "nary": return `<m:nary><m:naryPr><m:chr${Xi("val", e.operator)}/>${!1 === e.grow ? "<m:grow m:val=\"0\"/>" : ""}</m:naryPr>${e.subscript ? `<m:sub>${Zi(e.subscript)}</m:sub>` : ""}${e.superscript ? `<m:sup>${Zi(e.superscript)}</m:sup>` : ""}<m:e>${Zi(e.children)}</m:e></m:nary>`;
13006
- case "limit": return "low" === e.operator ? `<m:limLow><m:e>${Zi(e.base)}</m:e><m:lim>${Zi(e.limit)}</m:lim></m:limLow>` : `<m:limUpp><m:e>${Zi(e.base)}</m:e><m:lim>${Zi(e.limit)}</m:lim></m:limUpp>`;
13007
- case "matrix": return `<m:m>${e.rows.map((e) => `<m:mr>${e.map((e) => `<m:e>${Zi(e)}</m:e>`).join("")}</m:mr>`).join("")}</m:m>`;
13008
- case "box": return `<m:${e.hidden ? "phant" : e.border ? "borderBox" : "box"}><m:e>${Zi(e.children)}</m:e></m:${e.hidden ? "phant" : e.border ? "borderBox" : "box"}>`;
13009
- case "group": return Zi(e.children);
13004
+ return `<m:${t}><m:e>${Yi(e.base)}</m:e>${e.subscript ? `<m:sub>${Yi(e.subscript)}</m:sub>` : ""}${e.superscript ? `<m:sup>${Yi(e.superscript)}</m:sup>` : ""}</m:${t}>`;
13005
+ }
13006
+ case "delimiter": return `<m:d><m:dPr>${Zi("begChr", e.begin)}${Zi("endChr", e.end)}${Zi("sepChr", e.separator)}${!1 === e.grow ? "<m:grow m:val=\"0\"/>" : ""}</m:dPr>${e.children.map((e) => `<m:e>${Yi(e)}</m:e>`).join("")}</m:d>`;
13007
+ case "accent": return `<m:acc><m:accPr><m:chr${Zi("val", e.accent)}/></m:accPr><m:e>${Yi(e.children)}</m:e></m:acc>`;
13008
+ case "nary": return `<m:nary><m:naryPr><m:chr${Zi("val", e.operator)}/>${!1 === e.grow ? "<m:grow m:val=\"0\"/>" : ""}</m:naryPr>${e.subscript ? `<m:sub>${Yi(e.subscript)}</m:sub>` : ""}${e.superscript ? `<m:sup>${Yi(e.superscript)}</m:sup>` : ""}<m:e>${Yi(e.children)}</m:e></m:nary>`;
13009
+ case "limit": return "low" === e.operator ? `<m:limLow><m:e>${Yi(e.base)}</m:e><m:lim>${Yi(e.limit)}</m:lim></m:limLow>` : `<m:limUpp><m:e>${Yi(e.base)}</m:e><m:lim>${Yi(e.limit)}</m:lim></m:limUpp>`;
13010
+ case "matrix": return `<m:m>${e.rows.map((e) => `<m:mr>${e.map((e) => `<m:e>${Yi(e)}</m:e>`).join("")}</m:mr>`).join("")}</m:m>`;
13011
+ case "box": return `<m:${e.hidden ? "phant" : e.border ? "borderBox" : "box"}><m:e>${Yi(e.children)}</m:e></m:${e.hidden ? "phant" : e.border ? "borderBox" : "box"}>`;
13012
+ case "group": return Yi(e.children);
13010
13013
  case "raw": return e.xml;
13011
13014
  }
13012
13015
  }
13013
- const Qi = "http://schemas.openxmlformats.org/markup-compatibility/2006", Ki = /* @__PURE__ */ new Set([
13016
+ const Ki = "http://schemas.openxmlformats.org/markup-compatibility/2006", Ji = /* @__PURE__ */ new Set([
13014
13017
  "t",
13015
13018
  "tab",
13016
13019
  "br",
13017
13020
  "cr",
13018
13021
  "noBreakHyphen",
13019
13022
  "softHyphen"
13020
- ]), Ji = /* @__PURE__ */ new Set([
13021
- ...Ki,
13023
+ ]), ea = /* @__PURE__ */ new Set([
13024
+ ...Ji,
13022
13025
  "drawing",
13023
13026
  "pict",
13024
13027
  "sym",
@@ -13028,7 +13031,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13028
13031
  "endnoteReference",
13029
13032
  "separator",
13030
13033
  "continuationSeparator"
13031
- ]), ea = /* @__PURE__ */ new Set([
13034
+ ]), ta = /* @__PURE__ */ new Set([
13032
13035
  "rStyle",
13033
13036
  "rFonts",
13034
13037
  "b",
@@ -13068,7 +13071,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13068
13071
  "eastAsianLayout",
13069
13072
  "specVanish",
13070
13073
  "oMath"
13071
- ]), ta = /* @__PURE__ */ new Set([
13074
+ ]), ra = /* @__PURE__ */ new Set([
13072
13075
  "ligatures",
13073
13076
  "numSpacing",
13074
13077
  "numForm",
@@ -13082,10 +13085,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13082
13085
  "scene3d",
13083
13086
  "props3d"
13084
13087
  ]);
13085
- function ra(e) {
13088
+ function na(e) {
13086
13089
  return /\br:(?:id|embed|link)\s*=/.test(e);
13087
13090
  }
13088
- function na(e) {
13091
+ function oa(e) {
13089
13092
  const t = [];
13090
13093
  for (let r = 0; r < e.childNodes.length; r += 1) {
13091
13094
  const n = e.childNodes[r];
@@ -13093,93 +13096,93 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13093
13096
  }
13094
13097
  return t;
13095
13098
  }
13096
- function oa(e) {
13099
+ function ia(e) {
13097
13100
  return e.localName ?? e.tagName;
13098
13101
  }
13099
- function ia(e, t, r) {
13100
- return na(e).find((e) => e.namespaceURI === t && oa(e) === r);
13101
- }
13102
- function aa(e) {
13103
- return `${e.namespaceURI ?? ""}\0${oa(e)}`;
13102
+ function aa(e, t, r) {
13103
+ return oa(e).find((e) => e.namespaceURI === t && ia(e) === r);
13104
13104
  }
13105
13105
  function sa(e) {
13106
- const t = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
13107
- return t && "r" === oa(t) ? t : void 0;
13106
+ return `${e.namespaceURI ?? ""}\0${ia(e)}`;
13108
13107
  }
13109
13108
  function la(e) {
13110
- const t = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${eo}" xmlns:w14="${no}" xmlns:r="${ro}" xmlns:mc="${Qi}" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">${e}</oasis:root>`, "application/xml").documentElement;
13111
- if (!t) return;
13112
- const r = na(t);
13113
- return 1 === r.length && "r" === oa(r[0]) ? r[0] : void 0;
13109
+ const t = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
13110
+ return t && "r" === ia(t) ? t : void 0;
13114
13111
  }
13115
13112
  function ca(e) {
13116
- return "http://www.w3.org/2000/xmlns/" === e.namespaceURI || "xmlns" === e.prefix || "xmlns" === e.name;
13113
+ const t = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${eo}" xmlns:w14="${no}" xmlns:r="${ro}" xmlns:mc="${Ki}" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">${e}</oasis:root>`, "application/xml").documentElement;
13114
+ if (!t) return;
13115
+ const r = oa(t);
13116
+ return 1 === r.length && "r" === ia(r[0]) ? r[0] : void 0;
13117
13117
  }
13118
13118
  function ua(e) {
13119
+ return "http://www.w3.org/2000/xmlns/" === e.namespaceURI || "xmlns" === e.prefix || "xmlns" === e.name;
13120
+ }
13121
+ function da(e) {
13119
13122
  for (let t = 0; t < e.attributes.length; t += 1) {
13120
13123
  const r = e.attributes[t];
13121
- if (r && !ca(r) && "http://schemas.openxmlformats.org/officeDocument/2006/relationships" !== r.namespaceURI) return !0;
13124
+ if (r && !ua(r) && "http://schemas.openxmlformats.org/officeDocument/2006/relationships" !== r.namespaceURI) return !0;
13122
13125
  }
13123
13126
  return !1;
13124
13127
  }
13125
- function da(e) {
13126
- const t = oa(e);
13127
- return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI ? ea.has(t) : "http://schemas.microsoft.com/office/word/2010/wordml" === e.namespaceURI ? ta.has(t) : e.namespaceURI === Qi && "AlternateContent" === t;
13128
+ function pa(e) {
13129
+ const t = ia(e);
13130
+ return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI ? ta.has(t) : "http://schemas.microsoft.com/office/word/2010/wordml" === e.namespaceURI ? ra.has(t) : e.namespaceURI === Ki && "AlternateContent" === t;
13128
13131
  }
13129
- function pa(e, t) {
13130
- const r = ia(e, eo, "rPr");
13132
+ function fa(e, t) {
13133
+ const r = aa(e, eo, "rPr");
13131
13134
  if (!r) return;
13132
- const n = na(r), o = ia(t, eo, "rPr"), i = o ? na(o) : [], a = new Set(i.map(aa)), s = n.filter((e) => !da(e) && !a.has(aa(e)));
13135
+ const n = oa(r), o = aa(t, eo, "rPr"), i = o ? oa(o) : [], a = new Set(i.map(sa)), s = n.filter((e) => !pa(e) && !a.has(sa(e)));
13133
13136
  if (0 === s.length) return;
13134
13137
  const l = function(e) {
13135
- const t = ia(e, eo, "rPr");
13138
+ const t = aa(e, eo, "rPr");
13136
13139
  if (t) return t;
13137
13140
  const r = e.ownerDocument.createElementNS(eo, "w:rPr");
13138
13141
  return e.insertBefore(r, e.firstChild), r;
13139
13142
  }(t);
13140
13143
  for (const c of s) {
13141
- const e = n.indexOf(c), t = n.slice(e + 1).find((e) => a.has(aa(e))), r = t ? na(l).find((e) => aa(e) === aa(t)) ?? null : null;
13144
+ const e = n.indexOf(c), t = n.slice(e + 1).find((e) => a.has(sa(e))), r = t ? oa(l).find((e) => sa(e) === sa(t)) ?? null : null;
13142
13145
  l.insertBefore(c.cloneNode(!0), r);
13143
13146
  }
13144
13147
  }
13145
- function fa(e) {
13146
- const t = oa(e);
13147
- return e.namespaceURI === Qi && "AlternateContent" === t ? function(e) {
13148
- const t = (e) => na(e).some((e) => {
13149
- const r = oa(e);
13150
- return !("http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI || !Ji.has(r)) || t(e);
13148
+ function ha(e) {
13149
+ const t = ia(e);
13150
+ return e.namespaceURI === Ki && "AlternateContent" === t ? function(e) {
13151
+ const t = (e) => oa(e).some((e) => {
13152
+ const r = ia(e);
13153
+ return !("http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI || !ea.has(r)) || t(e);
13151
13154
  });
13152
13155
  return t(e);
13153
- }(e) : "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && ("rPr" === t || Ji.has(t));
13156
+ }(e) : "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && ("rPr" === t || ea.has(t));
13154
13157
  }
13155
- function ha(e) {
13158
+ function ma(e) {
13156
13159
  const t = Yr(e);
13157
- if (t && !ra(t.xml) && (r = t.xml, !Br.test(r))) {
13160
+ if (t && !na(t.xml) && (r = t.xml, !Br.test(r))) {
13158
13161
  var r;
13159
13162
  if (t.semanticSignature === Vr(e)) return t.xml;
13160
13163
  if (t.structureSignature === Xr(e)) return function(e, t) {
13161
13164
  if ("text" !== e.kind) return;
13162
- const r = sa(t);
13165
+ const r = la(t);
13163
13166
  if (!r) return;
13164
- const n = na(r), o = n.filter((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && Ki.has(oa(e))), i = o[0] ?? n.find((e) => !("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "rPr" === oa(e))) ?? null, a = la(`<w:r>${Li(e.text)}</w:r>`);
13167
+ const n = oa(r), o = n.filter((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && Ji.has(ia(e))), i = o[0] ?? n.find((e) => !("http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && "rPr" === ia(e))) ?? null, a = ca(`<w:r>${Bi(e.text)}</w:r>`);
13165
13168
  if (!a) return;
13166
- const s = na(a);
13169
+ const s = oa(a);
13167
13170
  for (const l of s) r.insertBefore(l.cloneNode(!0), i);
13168
13171
  for (const l of o) r.removeChild(l);
13169
13172
  return new b.XMLSerializer().serializeToString(r);
13170
13173
  }(e, t.xml);
13171
13174
  }
13172
13175
  }
13173
- function ma(e, t) {
13176
+ function ga(e, t) {
13174
13177
  const r = Yr(e);
13175
- if (!r || ra(r.xml)) return t;
13176
- const n = sa(r.xml);
13178
+ if (!r || na(r.xml)) return t;
13179
+ const n = la(r.xml);
13177
13180
  if (!n || !function(e) {
13178
- if (ua(e)) return !0;
13179
- const t = ia(e, eo, "rPr");
13180
- return !(!t || !ua(t) && !na(t).some((e) => !da(e))) || na(e).some((e) => !fa(e));
13181
+ if (da(e)) return !0;
13182
+ const t = aa(e, eo, "rPr");
13183
+ return !(!t || !da(t) && !oa(t).some((e) => !pa(e))) || oa(e).some((e) => !ha(e));
13181
13184
  }(n)) return t;
13182
- const o = la(t);
13185
+ const o = ca(t);
13183
13186
  return o ? (function(e, t) {
13184
13187
  for (let r = 0; r < e.attributes.length; r += 1) {
13185
13188
  const n = e.attributes[r];
@@ -13187,22 +13190,22 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13187
13190
  const o = n.localName ?? n.name;
13188
13191
  (n.namespaceURI ? t.hasAttributeNS(n.namespaceURI, o) : t.hasAttribute(n.name)) || (n.namespaceURI ? t.setAttributeNS(n.namespaceURI, n.name, n.value) : t.setAttribute(n.name, n.value));
13189
13192
  }
13190
- }(n, o), pa(n, o), function(e, t) {
13191
- const r = na(e), n = na(t), o = new Set(n.map(aa)), i = r.filter((e) => !fa(e) && !o.has(aa(e)));
13193
+ }(n, o), fa(n, o), function(e, t) {
13194
+ const r = oa(e), n = oa(t), o = new Set(n.map(sa)), i = r.filter((e) => !ha(e) && !o.has(sa(e)));
13192
13195
  for (const a of i) {
13193
- const e = r.indexOf(a), n = r.slice(e + 1).find((e) => fa(e)), o = n ? na(t).find((e) => aa(e) === aa(n)) ?? null : null;
13196
+ const e = r.indexOf(a), n = r.slice(e + 1).find((e) => ha(e)), o = n ? oa(t).find((e) => sa(e) === sa(n)) ?? null : null;
13194
13197
  t.insertBefore(a.cloneNode(!0), o);
13195
13198
  }
13196
13199
  }(n, o), new b.XMLSerializer().serializeToString(o)) : t;
13197
13200
  }
13198
- function ga(e, t, r, n, o) {
13201
+ function wa(e, t, r, n, o) {
13199
13202
  if (e.revisionRangeMarker) return function(e) {
13200
13203
  const t = `move${"from" === e.move ? "From" : "To"}Range${"start" === e.edge ? "Start" : "End"}`, r = [`w:id="${yi(e.id)}"`];
13201
13204
  return void 0 !== e.displacedByCustomXml && r.push(`w:displacedByCustomXml="${oo(e.displacedByCustomXml)}"`), "start" === e.edge && (void 0 !== e.name && r.push(`w:name="${oo(e.name)}"`), void 0 !== e.author && r.push(`w:author="${oo(e.author)}"`), void 0 !== e.date && Number.isFinite(e.date) && r.push(`w:date="${new Date(e.date).toISOString()}"`), void 0 !== e.columnFirst && r.push(`w:colFirst="${Math.trunc(e.columnFirst)}"`), void 0 !== e.columnLast && r.push(`w:colLast="${Math.trunc(e.columnLast)}"`)), `<w:${t} ${r.join(" ")}/>`;
13202
13205
  }(e.revisionRangeMarker);
13203
- if (e.__isFootnoteRefMarker) return Gi("footnote");
13204
- if (e.__isEndnoteRefMarker) return Gi("endnote");
13205
- const i = ha(e);
13206
+ if (e.__isFootnoteRefMarker) return Vi("footnote");
13207
+ if (e.__isEndnoteRefMarker) return Vi("endnote");
13208
+ const i = ma(e);
13206
13209
  if (i) return i;
13207
13210
  const a = function(e, t, r) {
13208
13211
  const n = oe(e.styles, t, r), o = {
@@ -13259,18 +13262,18 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13259
13262
  }, i = oe(e.styles?.styleId ? { styleId: e.styles.styleId } : void 0, t, r);
13260
13263
  for (const a of Object.keys(o)) ("styleId" !== a && e.styles?.styleId && "character" === r?.[e.styles.styleId]?.type && void 0 === e.styles[a] && o[a] === i[a] || !1 === o[a] && !1 !== e.styles?.[a] && !0 !== i[a]) && delete o[a];
13261
13264
  return e.styles?.link && (o.link = e.styles.link), o;
13262
- }(e, r, n), s = () => Mi(a), l = () => `<w:r>${s()}${Li(e.text)}</w:r>`;
13263
- return ma(e, z(e, {
13265
+ }(e, r, n), s = () => Oi(a), l = () => `<w:r>${s()}${Bi(e.text)}</w:r>`;
13266
+ return ga(e, z(e, {
13264
13267
  footnoteReference: (e) => function(e, t, r) {
13265
13268
  const n = B(e);
13266
- return Vi("footnote", n ? {
13269
+ return Xi("footnote", n ? {
13267
13270
  noteId: n.footnoteId,
13268
13271
  customMark: n.customMark
13269
13272
  } : void 0, t, r);
13270
13273
  }(e, a, t) ?? l(),
13271
13274
  endnoteReference: (e) => function(e, t, r) {
13272
13275
  const n = U(e);
13273
- return Vi("endnote", n ? {
13276
+ return Xi("endnote", n ? {
13274
13277
  noteId: n.endnoteId,
13275
13278
  customMark: n.customMark
13276
13279
  } : void 0, t, r);
@@ -13295,25 +13298,25 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13295
13298
  }
13296
13299
  return `<w:fldSimple w:instr="${oo(n)}"><w:r>${t}<w:t xml:space="preserve">${oo(r)}</w:t></w:r></w:fldSimple>`;
13297
13300
  }(e.field, s(), "DATE" === e.field.type || "REF" === e.field.type ? e.text : void 0),
13298
- textBox: (e) => qi(e, e.textBox, t, n, s(), o),
13301
+ textBox: (e) => Wi(e, e.textBox, t, n, s(), o),
13299
13302
  image: (e) => {
13300
13303
  const r = t.imageMap.get(e.id);
13301
13304
  if (r) {
13302
- const n = ji(e.id, r, t, s());
13305
+ const n = qi(e.id, r, t, s());
13303
13306
  if (null !== n) return n;
13304
13307
  }
13305
13308
  return l();
13306
13309
  },
13307
13310
  sym: (e) => `<w:r>${s()}<w:sym w:font="${oo(e.sym.font)}" w:char="${e.sym.char}"/></w:r>`,
13308
13311
  math: (e) => function(e) {
13309
- const t = `<m:oMath>${Zi(e.children)}</m:oMath>`;
13312
+ const t = `<m:oMath>${Yi(e.children)}</m:oMath>`;
13310
13313
  return e.display ? `<m:oMathPara>${t}</m:oMathPara>` : t;
13311
13314
  }(e.math),
13312
13315
  text: () => l()
13313
13316
  }));
13314
13317
  }
13315
- function wa(e, t, r, n, o) {
13316
- let i = ga(e, t, r, n, o);
13318
+ function ba(e, t, r, n, o) {
13319
+ let i = wa(e, t, r, n, o);
13317
13320
  if (e.revisionRangeMarker) return i;
13318
13321
  "delete" === e.revision?.type && (i = vi(i));
13319
13322
  const a = e.styles?.link, s = a ? function(e, t, r) {
@@ -13328,7 +13331,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13328
13331
  return `<w:${n} ${r}>${e}</w:${n}>`;
13329
13332
  }(s, e.revision) : s;
13330
13333
  }
13331
- function ba(e, t) {
13334
+ function va(e, t) {
13332
13335
  let r = "", n = 0;
13333
13336
  for (; n < e.length;) {
13334
13337
  const o = e[n], i = o.sdtWrappers?.[0];
@@ -13345,12 +13348,12 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13345
13348
  sdtWrappers: r.length > 0 ? r : void 0
13346
13349
  }), s += 1;
13347
13350
  }
13348
- const l = ba(a, t);
13351
+ const l = va(a, t);
13349
13352
  r += `<w:sdt>${Lo(i.sdtPr)}${i.sdtEndPrXml ?? ""}<w:sdtContent>${l}</w:sdtContent></w:sdt>`, n = s;
13350
13353
  }
13351
13354
  return r;
13352
13355
  }
13353
- const va = /* @__PURE__ */ new Set([
13356
+ const ya = /* @__PURE__ */ new Set([
13354
13357
  "pStyle",
13355
13358
  "keepNext",
13356
13359
  "keepLines",
@@ -13388,10 +13391,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13388
13391
  "sectPr",
13389
13392
  "pPrChange"
13390
13393
  ]);
13391
- function ya(e) {
13394
+ function xa(e) {
13392
13395
  return /\br:(?:id|embed|link)\s*=/.test(e);
13393
13396
  }
13394
- function xa(e) {
13397
+ function Ea(e) {
13395
13398
  const t = [];
13396
13399
  for (let r = 0; r < e.childNodes.length; r += 1) {
13397
13400
  const n = e.childNodes[r];
@@ -13399,21 +13402,21 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13399
13402
  }
13400
13403
  return t;
13401
13404
  }
13402
- function Ea(e) {
13405
+ function Sa(e) {
13403
13406
  return e.localName ?? e.tagName;
13404
13407
  }
13405
- function Sa(e) {
13406
- return `${e.namespaceURI ?? ""}\0${Ea(e)}`;
13408
+ function Na(e) {
13409
+ return `${e.namespaceURI ?? ""}\0${Sa(e)}`;
13407
13410
  }
13408
- function Na(e, t) {
13409
- if (!e || ya(e)) return t;
13411
+ function ka(e, t) {
13412
+ if (!e || xa(e)) return t;
13410
13413
  const r = function(e) {
13411
13414
  const t = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
13412
- return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t?.namespaceURI && "pPr" === Ea(t) ? t : void 0;
13415
+ return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t?.namespaceURI && "pPr" === Sa(t) ? t : void 0;
13413
13416
  }(e), n = function(e) {
13414
13417
  if (e) {
13415
- const t = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${eo}">${e}</oasis:root>`, "application/xml").documentElement, r = t ? xa(t) : [];
13416
- if (1 === r.length && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === r[0].namespaceURI && "pPr" === Ea(r[0])) return r[0];
13418
+ const t = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${eo}">${e}</oasis:root>`, "application/xml").documentElement, r = t ? Ea(t) : [];
13419
+ if (1 === r.length && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === r[0].namespaceURI && "pPr" === Sa(r[0])) return r[0];
13417
13420
  }
13418
13421
  return new b.DOMParser().parseFromString(`<w:pPr xmlns:w="${eo}"/>`, "application/xml").documentElement;
13419
13422
  }(t);
@@ -13426,29 +13429,29 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13426
13429
  (n.namespaceURI ? t.hasAttributeNS(n.namespaceURI, o) : t.hasAttribute(n.name)) || (n.namespaceURI ? t.setAttributeNS(n.namespaceURI, n.name, n.value) : t.setAttribute(n.name, n.value));
13427
13430
  }
13428
13431
  })(r, n);
13429
- const o = xa(r), i = xa(n), a = /* @__PURE__ */ new Map();
13432
+ const o = Ea(r), i = Ea(n), a = /* @__PURE__ */ new Map();
13430
13433
  for (const u of i) {
13431
- const e = Sa(u), t = a.get(e) ?? [];
13434
+ const e = Na(u), t = a.get(e) ?? [];
13432
13435
  t.push(u), a.set(e, t);
13433
13436
  }
13434
13437
  const s = /* @__PURE__ */ new Map();
13435
13438
  for (const u of o) {
13436
- const e = Sa(u), t = s.get(e) ?? 0;
13439
+ const e = Na(u), t = s.get(e) ?? 0;
13437
13440
  s.set(e, t + 1);
13438
13441
  const r = a.get(e)?.[t];
13439
13442
  r && Vo(u, r);
13440
13443
  }
13441
- const l = new Set(i.map(Sa)), c = o.filter((e) => {
13442
- return !(t = e, "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t.namespaceURI && va.has(Ea(t)) || l.has(Sa(e)));
13444
+ const l = new Set(i.map(Na)), c = o.filter((e) => {
13445
+ return !(t = e, "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t.namespaceURI && ya.has(Sa(t)) || l.has(Na(e)));
13443
13446
  var t;
13444
13447
  });
13445
13448
  for (const u of c) {
13446
- const e = o.indexOf(u), t = o.slice(e + 1).find((e) => l.has(Sa(e))), r = t ? xa(n).find((e) => Sa(e) === Sa(t)) ?? null : null;
13449
+ const e = o.indexOf(u), t = o.slice(e + 1).find((e) => l.has(Na(e))), r = t ? Ea(n).find((e) => Na(e) === Na(t)) ?? null : null;
13447
13450
  n.insertBefore(u.cloneNode(!0), r);
13448
13451
  }
13449
- return t || 1 !== n.attributes.length || 0 !== xa(n).length ? new b.XMLSerializer().serializeToString(n) : "";
13452
+ return t || 1 !== n.attributes.length || 0 !== Ea(n).length ? new b.XMLSerializer().serializeToString(n) : "";
13450
13453
  }
13451
- const ka = /* @__PURE__ */ new Set([
13454
+ const _a = /* @__PURE__ */ new Set([
13452
13455
  "pPr",
13453
13456
  "r",
13454
13457
  "hyperlink",
@@ -13458,7 +13461,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13458
13461
  "commentRangeStart",
13459
13462
  "commentRangeEnd"
13460
13463
  ]);
13461
- function _a(e) {
13464
+ function Ta(e) {
13462
13465
  const t = [];
13463
13466
  for (let r = 0; r < e.childNodes.length; r += 1) {
13464
13467
  const n = e.childNodes[r];
@@ -13466,90 +13469,90 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13466
13469
  }
13467
13470
  return t;
13468
13471
  }
13469
- function Ta(e) {
13472
+ function Ia(e) {
13470
13473
  return e.localName ?? e.tagName;
13471
13474
  }
13472
- function Ia(e, t) {
13475
+ function Aa(e, t) {
13473
13476
  const r = new b.DOMParser().parseFromString(`<oasis:root xmlns:oasis="urn:oasis:docx" xmlns:w="${eo}" xmlns:w14="${no}" xmlns:r="${ro}" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">${e}</oasis:root>`, "application/xml").documentElement;
13474
13477
  if (!r) return;
13475
- const n = _a(r);
13476
- return 1 === n.length && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === n[0].namespaceURI && Ta(n[0]) === t ? n[0] : void 0;
13478
+ const n = Ta(r);
13479
+ return 1 === n.length && "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === n[0].namespaceURI && Ia(n[0]) === t ? n[0] : void 0;
13477
13480
  }
13478
- function Aa(e) {
13481
+ function Ca(e) {
13479
13482
  return "http://www.w3.org/2000/xmlns/" === e.namespaceURI || "xmlns" === e.prefix || "xmlns" === e.name;
13480
13483
  }
13481
- function Ca(e, t) {
13482
- const r = (n = "pPr", _a(e).find((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && Ta(e) === n));
13484
+ function Ra(e, t) {
13485
+ const r = (n = "pPr", Ta(e).find((e) => "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === e.namespaceURI && Ia(e) === n));
13483
13486
  var n;
13484
13487
  if (!t) return r && e.removeChild(r), !0;
13485
- const o = Ia(t, "pPr");
13488
+ const o = Aa(t, "pPr");
13486
13489
  if (!o) return !1;
13487
13490
  const i = o.cloneNode(!0);
13488
13491
  return r ? e.replaceChild(i, r) : e.insertBefore(i, e.firstChild), !0;
13489
13492
  }
13490
- function Ra(e, t, r, n) {
13493
+ function $a(e, t, r, n) {
13491
13494
  const o = Jr(e)?.xml;
13492
13495
  if (!o || n.hasOverrides || n.hasBoundaryTokens || e.dropCap || /\br:(?:id|embed|link)\s*=/.test(o)) return;
13493
13496
  const i = function(e) {
13494
13497
  const t = new b.DOMParser().parseFromString(e, "application/xml").documentElement;
13495
- return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t?.namespaceURI && "p" === Ta(t) ? t : void 0;
13498
+ return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" === t?.namespaceURI && "p" === Ia(t) ? t : void 0;
13496
13499
  }(o);
13497
13500
  if (!i || !function(e) {
13498
13501
  for (let t = 0; t < e.attributes.length; t += 1) {
13499
13502
  const r = e.attributes[t];
13500
- if (r && !Aa(r) && "http://schemas.openxmlformats.org/officeDocument/2006/relationships" !== r.namespaceURI) return !0;
13503
+ if (r && !Ca(r) && "http://schemas.openxmlformats.org/officeDocument/2006/relationships" !== r.namespaceURI) return !0;
13501
13504
  }
13502
- return _a(e).some((e) => {
13503
- const t = Ta(e);
13504
- return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI || !ka.has(t);
13505
+ return Ta(e).some((e) => {
13506
+ const t = Ia(e);
13507
+ return "http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== e.namespaceURI || !_a.has(t);
13505
13508
  });
13506
13509
  }(i)) return;
13507
13510
  const a = function(e) {
13508
13511
  const t = [], r = (e) => {
13509
- for (const n of _a(e)) {
13510
- const e = Ta(n);
13512
+ for (const n of Ta(e)) {
13513
+ const e = Ia(n);
13511
13514
  "http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== n.namespaceURI || "r" !== e ? ("http://schemas.openxmlformats.org/wordprocessingml/2006/main" !== n.namespaceURI || "pPr" !== e && "p" !== e && "tbl" !== e && "txbxContent" !== e) && r(n) : t.push(n);
13512
13515
  }
13513
13516
  };
13514
13517
  return r(e), t;
13515
13518
  }(i);
13516
13519
  if (a.length !== r.length) return;
13517
- const s = r.map((e) => Ia(e, "r"));
13518
- if (!s.some((e) => !e) && Ca(i, t)) {
13520
+ const s = r.map((e) => Aa(e, "r"));
13521
+ if (!s.some((e) => !e) && Ra(i, t)) {
13519
13522
  for (let e = 0; e < a.length; e += 1) a[e].parentNode?.replaceChild(s[e].cloneNode(!0), a[e]);
13520
13523
  return new b.XMLSerializer().serializeToString(i);
13521
13524
  }
13522
13525
  }
13523
- function $a(e, t) {
13526
+ function Da(e, t) {
13524
13527
  return e.rows.some((e) => e.cells.some((e) => e.blocks.some((e) => function(e, t) {
13525
13528
  switch (e.type) {
13526
13529
  case "paragraph": return Boolean(t.bookmarkEventsByParagraph?.has(e.id) || t.commentEventsByParagraph?.has(e.id));
13527
- case "table": return $a(e, t);
13530
+ case "table": return Da(e, t);
13528
13531
  default: return L(e, "block");
13529
13532
  }
13530
13533
  }(e, t))));
13531
13534
  }
13532
- function Da(e, t, r) {
13535
+ function Pa(e, t, r) {
13533
13536
  switch (e.type) {
13534
- case "paragraph": return Fa(e, t, r);
13537
+ case "paragraph": return Ma(e, t, r);
13535
13538
  case "table": return (e.style?.pageBreakBefore ? "<w:p><w:r><w:br w:type=\"page\"/></w:r></w:p>" : "") + ((function(e) {
13536
13539
  const t = cn(e)?.xml;
13537
13540
  return Boolean(t && /<w:trPr(?:\s|>)[\s\S]*?<w:jc\b[^>]*\bw:val="(?:start|end)"/.test(t));
13538
13541
  }(e) ? void 0 : function(e, t) {
13539
13542
  const r = cn(e);
13540
13543
  if (r && !t.hasBoundaryTokens && !jr(r.xml)) return r.semanticSignature === en(e) ? r.xml : void 0;
13541
- }(e, { hasBoundaryTokens: $a(e, t) })) ?? mi(e, (e, n) => function(e, t, r, n) {
13542
- return "paragraph" === e.type ? Fa(e, r, n, { align: t.style?.horizontalAlign }) : Da(e, r, n);
13544
+ }(e, { hasBoundaryTokens: Da(e, t) })) ?? mi(e, (e, n) => function(e, t, r, n) {
13545
+ return "paragraph" === e.type ? Ma(e, r, n, { align: t.style?.horizontalAlign }) : Pa(e, r, n);
13543
13546
  }(e, n, t, r)));
13544
13547
  default: return L(e, "block");
13545
13548
  }
13546
13549
  }
13547
- function Pa(e, t, r) {
13550
+ function Fa(e, t, r) {
13548
13551
  let n = "", o = 0;
13549
13552
  for (; o < e.length;) {
13550
13553
  const i = e[o], a = i.sdtWrappers?.[0];
13551
13554
  if (!a) {
13552
- n += Da(i, t, r), o += 1;
13555
+ n += Pa(i, t, r), o += 1;
13553
13556
  continue;
13554
13557
  }
13555
13558
  const s = [];
@@ -13561,19 +13564,19 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13561
13564
  sdtWrappers: t.length > 0 ? t : void 0
13562
13565
  }), l += 1;
13563
13566
  }
13564
- const c = Pa(s, t, r);
13567
+ const c = Fa(s, t, r);
13565
13568
  n += `<w:sdt>${Lo(a.sdtPr)}${a.sdtEndPrXml ?? ""}<w:sdtContent>${c}</w:sdtContent></w:sdt>`, o = l;
13566
13569
  }
13567
13570
  return n;
13568
13571
  }
13569
- function Fa(e, t, r, n) {
13572
+ function Ma(e, t, r, n) {
13570
13573
  const o = e.runs.length > 0 ? e.runs : [{
13571
13574
  id: "",
13572
13575
  text: "",
13573
13576
  kind: "text"
13574
13577
  }], i = e.dropCap ? function(e) {
13575
- const t = Mi(e.style);
13576
- return `<w:p><w:pPr><w:keepNext/><w:framePr w:dropCap="${e.type}" w:lines="${e.lines}" w:wrap="around" w:vAnchor="text" w:hAnchor="text"/><w:spacing w:after="0"/>${t ? `<w:rPr>${r = t, r.replace(/^<w:rPr>/, "").replace(/<\/w:rPr>$/, "")}</w:rPr>` : ""}</w:pPr><w:r>${t}${Li(e.text)}</w:r></w:p>`;
13578
+ const t = Oi(e.style);
13579
+ return `<w:p><w:pPr><w:keepNext/><w:framePr w:dropCap="${e.type}" w:lines="${e.lines}" w:wrap="around" w:vAnchor="text" w:hAnchor="text"/><w:spacing w:after="0"/>${t ? `<w:rPr>${r = t, r.replace(/^<w:rPr>/, "").replace(/<\/w:rPr>$/, "")}</w:rPr>` : ""}</w:pPr><w:r>${t}${Bi(e.text)}</w:r></w:p>`;
13577
13580
  var r;
13578
13581
  }(e.dropCap) : "", a = t.bookmarkEventsByParagraph?.get(e.id), s = t.commentEventsByParagraph?.get(e.id), l = [...(a ?? []).map((e) => ({
13579
13582
  offset: e.offset,
@@ -13591,9 +13594,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13591
13594
  hasBoundaryTokens: l.length > 0
13592
13595
  });
13593
13596
  if (c) return c;
13594
- const u = (n) => wa(n, t, e.style?.styleId, r, Pa), d = 0 === l.length ? o.map(u) : void 0, p = 0 === l.length ? ba(o, u) : function(e, t, r, n, o) {
13597
+ const u = (n) => ba(n, t, e.style?.styleId, r, Fa), d = 0 === l.length ? o.map(u) : void 0, p = 0 === l.length ? va(o, u) : function(e, t, r, n, o) {
13595
13598
  const i = [...t].sort((e, t) => e.offset - t.offset || e.seq - t.seq);
13596
- let a = 0, s = 0, l = ba(e, (e) => {
13599
+ let a = 0, s = 0, l = va(e, (e) => {
13597
13600
  let t = "";
13598
13601
  const l = s, c = l + e.text.length;
13599
13602
  for (; a < i.length && i[a].offset <= l;) t += i[a].xml, a += 1;
@@ -13603,16 +13606,16 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13603
13606
  let s = l;
13604
13607
  for (; a < i.length && i[a].offset < c;) {
13605
13608
  const c = i[a];
13606
- c.offset > s && (t += wa({
13609
+ c.offset > s && (t += ba({
13607
13610
  ...e,
13608
13611
  text: e.text.slice(s - l, c.offset - l)
13609
- }, r, n, o, Pa)), t += c.xml, a += 1, s = c.offset;
13612
+ }, r, n, o, Fa)), t += c.xml, a += 1, s = c.offset;
13610
13613
  }
13611
- s < c && (t += wa({
13614
+ s < c && (t += ba({
13612
13615
  ...e,
13613
13616
  text: e.text.slice(s - l)
13614
- }, r, n, o, Pa));
13615
- } else t += wa(e, r, n, o, Pa);
13617
+ }, r, n, o, Fa));
13618
+ } else t += ba(e, r, n, o, Fa);
13616
13619
  return s = c, t;
13617
13620
  });
13618
13621
  for (; a < i.length;) l += i[a].xml, a += 1;
@@ -13621,10 +13624,10 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13621
13624
  return Jr(e)?.attributes;
13622
13625
  }(e), h = f ? ` ${f}` : "", g = function(e, t, r) {
13623
13626
  const n = Jr(e)?.paragraphProperties;
13624
- return !n || ya(n.xml) ? t : r || e.list || n.semanticSignature !== Kr(e) ? Na(n.xml, t) : n.xml;
13625
- }(e, _i(e, t.numberingInfo, r, n), Boolean(n));
13627
+ return !n || xa(n.xml) ? t : r || e.list || n.semanticSignature !== Kr(e) ? ka(n.xml, t) : n.xml;
13628
+ }(e, Ti(e, t.numberingInfo, r, n), Boolean(n));
13626
13629
  if (d) {
13627
- const t = Ra(e, g, d, {
13630
+ const t = $a(e, g, d, {
13628
13631
  hasOverrides: Boolean(n),
13629
13632
  hasBoundaryTokens: !1
13630
13633
  });
@@ -13632,7 +13635,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13632
13635
  }
13633
13636
  return `${i}<w:p${h}>${g}${p}</w:p>`;
13634
13637
  }
13635
- function Ma(e) {
13638
+ function Oa(e) {
13636
13639
  const t = e.footnotes?.items;
13637
13640
  if (!t) return [];
13638
13641
  const r = /* @__PURE__ */ new Map(), n = go(t);
@@ -13650,11 +13653,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13650
13653
  }
13651
13654
  return Array.from(r.values());
13652
13655
  }
13653
- function Oa(e) {
13654
- if (0 === e.length) return [La()];
13656
+ function La(e) {
13657
+ if (0 === e.length) return [Ba()];
13655
13658
  const [t, ...r] = e;
13656
13659
  return "paragraph" !== t.type ? [
13657
- La(!0),
13660
+ Ba(!0),
13658
13661
  t,
13659
13662
  ...r
13660
13663
  ] : [(n = t, {
@@ -13676,7 +13679,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13676
13679
  }), ...r];
13677
13680
  var n;
13678
13681
  }
13679
- function La(e = !0) {
13682
+ function Ba(e = !0) {
13680
13683
  return {
13681
13684
  id: "synthetic:footnote-body-empty",
13682
13685
  type: "paragraph",
@@ -13697,7 +13700,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13697
13700
  style: { styleId: "FootnoteText" }
13698
13701
  };
13699
13702
  }
13700
- function Ba(e) {
13703
+ function Ua(e) {
13701
13704
  const t = e.endnotes?.items;
13702
13705
  if (!t) return [];
13703
13706
  const r = /* @__PURE__ */ new Map(), n = go(t);
@@ -13715,11 +13718,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13715
13718
  }
13716
13719
  return Array.from(r.values());
13717
13720
  }
13718
- function Ua(e) {
13719
- if (0 === e.length) return [za()];
13721
+ function za(e) {
13722
+ if (0 === e.length) return [Ha()];
13720
13723
  const [t, ...r] = e;
13721
13724
  return "paragraph" !== t.type ? [
13722
- za(!0),
13725
+ Ha(!0),
13723
13726
  t,
13724
13727
  ...r
13725
13728
  ] : [(n = t, {
@@ -13741,7 +13744,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13741
13744
  }), ...r];
13742
13745
  var n;
13743
13746
  }
13744
- function za(e = !0) {
13747
+ function Ha(e = !0) {
13745
13748
  return {
13746
13749
  id: "synthetic:endnote-body-empty",
13747
13750
  type: "paragraph",
@@ -13762,7 +13765,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13762
13765
  style: { styleId: "EndnoteText" }
13763
13766
  };
13764
13767
  }
13765
- const Ha = [
13768
+ const ja = [
13766
13769
  "wholeTable",
13767
13770
  "band1Horz",
13768
13771
  "band2Horz",
@@ -13777,7 +13780,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13777
13780
  "swCell",
13778
13781
  "seCell"
13779
13782
  ];
13780
- function ja(e) {
13783
+ function qa(e) {
13781
13784
  const t = {
13782
13785
  ...e.borders ? {
13783
13786
  ...e.borders.borderTop ? { borderTop: e.borders.borderTop } : {},
@@ -13794,7 +13797,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13794
13797
  style: t
13795
13798
  }) : "";
13796
13799
  }
13797
- function qa(e, t) {
13800
+ function Wa(e, t) {
13798
13801
  if ("number" == typeof t) return `<w:${e} w:w="${so(t) ?? 0}" w:type="dxa"/>`;
13799
13802
  if ("string" == typeof t && t.endsWith("%")) {
13800
13803
  const r = Number.parseFloat(t);
@@ -13802,15 +13805,15 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13802
13805
  }
13803
13806
  return "auto" === t ? `<w:${e} w:w="0" w:type="auto"/>` : "";
13804
13807
  }
13805
- function Wa(e) {
13808
+ function Ga(e) {
13806
13809
  if (!e) return "";
13807
13810
  const t = [];
13808
13811
  void 0 !== e.rowBandSize && t.push(`<w:tblStyleRowBandSize w:val="${e.rowBandSize}"/>`), void 0 !== e.colBandSize && t.push(`<w:tblStyleColBandSize w:val="${e.colBandSize}"/>`);
13809
- const r = qa("tblW", e.width);
13812
+ const r = Wa("tblW", e.width);
13810
13813
  r && t.push(r);
13811
- const n = qa("tblInd", e.indentLeft);
13814
+ const n = Wa("tblInd", e.indentLeft);
13812
13815
  n && t.push(n);
13813
- const o = qa("tblCellSpacing", e.cellSpacing);
13816
+ const o = Wa("tblCellSpacing", e.cellSpacing);
13814
13817
  if (o && t.push(o), e.align && t.push(`<w:jc w:val="${e.align}"/>`), e.layout && t.push(`<w:tblLayout w:type="${e.layout}"/>`), void 0 !== e.bidiVisual && t.push(`<w:bidiVisual w:val="${e.bidiVisual ? "1" : "0"}"/>`), e.defaultCellMargins) {
13815
13818
  const r = Object.entries(e.defaultCellMargins).map(([e, t]) => `<w:${e} w:w="${so(t) ?? 0}" w:type="dxa"/>`).join("");
13816
13819
  r && t.push(`<w:tblCellMar>${r}</w:tblCellMar>`);
@@ -13821,36 +13824,36 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13821
13824
  }
13822
13825
  return t.length > 0 ? `<w:tblPr>${t.join("")}</w:tblPr>` : "";
13823
13826
  }
13824
- function Ga(e, t) {
13825
- const r = [], n = t.paragraphStyle ? ki(t.paragraphStyle) : "";
13827
+ function Va(e, t) {
13828
+ const r = [], n = t.paragraphStyle ? _i(t.paragraphStyle) : "";
13826
13829
  n && r.push(n);
13827
- const o = t.textStyle ? Mi(t.textStyle) : "";
13830
+ const o = t.textStyle ? Oi(t.textStyle) : "";
13828
13831
  o && r.push(o);
13829
- const i = Wa(t.tableStyle);
13832
+ const i = Ga(t.tableStyle);
13830
13833
  i && r.push(i);
13831
13834
  const a = t.rowStyle ? Ro(t.rowStyle) : "";
13832
13835
  a && r.push(a);
13833
- const s = ja(t);
13836
+ const s = qa(t);
13834
13837
  return s && r.push(s), 0 === r.length ? "" : `<w:tblStylePr w:type="${oo(e)}">${r.join("")}</w:tblStylePr>`;
13835
13838
  }
13836
- function Va(e) {
13839
+ function Xa(e) {
13837
13840
  const t = [];
13838
13841
  if (t.push(`<w:name w:val="${oo(e.name)}"/>`), e.basedOn && t.push(`<w:basedOn w:val="${oo(e.basedOn)}"/>`), e.nextStyle && t.push(`<w:next w:val="${oo(e.nextStyle)}"/>`), void 0 !== e.uiPriority && t.push(`<w:uiPriority w:val="${Math.max(0, Math.floor(e.uiPriority))}"/>`), void 0 !== e.qFormat && t.push(`<w:qFormat w:val="${e.qFormat ? "1" : "0"}"/>`), void 0 !== e.semiHidden && t.push(`<w:semiHidden w:val="${e.semiHidden ? "1" : "0"}"/>`), void 0 !== e.unhideWhenUsed && t.push(`<w:unhideWhenUsed w:val="${e.unhideWhenUsed ? "1" : "0"}"/>`), ("paragraph" === e.type || "table" === e.type) && e.paragraphStyle) {
13839
- const r = ki(e.paragraphStyle);
13842
+ const r = _i(e.paragraphStyle);
13840
13843
  r && t.push(r);
13841
13844
  }
13842
13845
  if (e.textStyle) {
13843
- const r = Mi(e.textStyle);
13846
+ const r = Oi(e.textStyle);
13844
13847
  r && t.push(r);
13845
13848
  }
13846
13849
  if ("table" === e.type && e.tableStyle) {
13847
- const r = e.tableStyle, n = Wa(r);
13850
+ const r = e.tableStyle, n = Ga(r);
13848
13851
  if (n && t.push(n), r.conditionalFormats) {
13849
- const e = [...Ha.filter((e) => e in r.conditionalFormats), ...Object.keys(r.conditionalFormats).filter((e) => !Ha.includes(e))];
13852
+ const e = [...ja.filter((e) => e in r.conditionalFormats), ...Object.keys(r.conditionalFormats).filter((e) => !ja.includes(e))];
13850
13853
  for (const n of e) {
13851
13854
  const e = r.conditionalFormats[n];
13852
13855
  if (e) {
13853
- const r = Ga(n, e);
13856
+ const r = Va(n, e);
13854
13857
  r && t.push(r);
13855
13858
  }
13856
13859
  }
@@ -13858,7 +13861,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13858
13861
  }
13859
13862
  return `<w:style w:type="${"character" === e.type ? "character" : "table" === e.type ? "table" : "paragraph"}" w:styleId="${oo(e.id)}"${e.isDefault ? " w:default=\"1\"" : ""}>${t.join("")}</w:style>`;
13860
13863
  }
13861
- function Xa(e, t, r, n, o, i, a, s, l, c = !1) {
13864
+ function Za(e, t, r, n, o, i, a, s, l, c = !1) {
13862
13865
  const u = n.map((e) => {
13863
13866
  const t = "header" === e.kind ? "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml" : "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";
13864
13867
  return `<Override PartName="/word/${e.path}" ContentType="${t}"/>`;
@@ -13875,23 +13878,23 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13875
13878
  return r;
13876
13879
  }(t)}<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>${a ? "<Override PartName=\"/word/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"/>" : ""}${e ? "<Override PartName=\"/word/numbering.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml\"/>" : ""}${r ? "<Override PartName=\"/word/settings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\"/>" : ""}${o ? "<Override PartName=\"/word/footnotes.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml\"/>" : ""}${i ? "<Override PartName=\"/word/endnotes.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml\"/>" : ""}${s ? "<Override PartName=\"/word/comments.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml\"/><Override PartName=\"/word/commentsExtended.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml\"/>" : ""}${l ? "<Override PartName=\"/word/fontTable.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\"/>" : ""}${c ? "<Override PartName=\"/word/theme/theme1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>" : ""}${u}</Types>`;
13877
13880
  }
13878
- const Za = {
13881
+ const Ya = {
13879
13882
  decimal: "decimal",
13880
13883
  lowerRoman: "lowerRoman",
13881
13884
  upperRoman: "upperRoman",
13882
13885
  lowerLetter: "lowerLetter",
13883
13886
  upperLetter: "upperLetter",
13884
13887
  symbol: "symbol"
13885
- }, Ya = {
13888
+ }, Qa = {
13886
13889
  continuous: "continuous",
13887
13890
  eachSection: "eachSect"
13888
13891
  };
13889
- function Qa(e, t) {
13892
+ function Ka(e, t) {
13890
13893
  if (!t) return null;
13891
13894
  const r = [];
13892
- return t.numberFormat && r.push(`<w:numFmt w:val="${Za[t.numberFormat]}"/>`), void 0 !== t.startAt && r.push(`<w:numStart w:val="${Math.max(1, t.startAt)}"/>`), t.restart && r.push(`<w:numRestart w:val="${Ya[t.restart]}"/>`), r.length > 0 ? `<w:${e}>${r.join("")}</w:${e}>` : null;
13895
+ return t.numberFormat && r.push(`<w:numFmt w:val="${Ya[t.numberFormat]}"/>`), void 0 !== t.startAt && r.push(`<w:numStart w:val="${Math.max(1, t.startAt)}"/>`), t.restart && r.push(`<w:numRestart w:val="${Qa[t.restart]}"/>`), r.length > 0 ? `<w:${e}>${r.join("")}</w:${e}>` : null;
13893
13896
  }
13894
- function Ka(e, t) {
13897
+ function Ja(e, t) {
13895
13898
  let r = "";
13896
13899
  for (const n of t) r += `<Relationship Id="${n.rId}" Type="${ro}/hyperlink" Target="${oo(n.href)}" TargetMode="External"/>`;
13897
13900
  for (const n of e) {
@@ -13900,64 +13903,64 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13900
13903
  }
13901
13904
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${to}">${r}</Relationships>`;
13902
13905
  }
13903
- function Ja(e, t) {
13906
+ function es(e, t) {
13904
13907
  t(e);
13905
- for (const r of e.runs) "textBox" === r.kind && es(r.textBox.blocks, t);
13908
+ for (const r of e.runs) "textBox" === r.kind && ts(r.textBox.blocks, t);
13906
13909
  }
13907
- function es(e, t) {
13910
+ function ts(e, t) {
13908
13911
  for (const r of e) switch (r.type) {
13909
13912
  case "paragraph":
13910
- Ja(r, t);
13913
+ es(r, t);
13911
13914
  break;
13912
13915
  case "table":
13913
- for (const e of r.rows) for (const r of e.cells) es(r.blocks, t);
13916
+ for (const e of r.rows) for (const r of e.cells) ts(r.blocks, t);
13914
13917
  break;
13915
13918
  default: L(r, "block");
13916
13919
  }
13917
13920
  }
13918
- function ts(e, t) {
13921
+ function rs(e, t) {
13919
13922
  for (let r = 0; r < e.attributes.length; r += 1) {
13920
13923
  const n = e.attributes.item(r);
13921
13924
  if (n?.localName === t) return n.value;
13922
13925
  }
13923
13926
  }
13924
- function rs(e, t, r) {
13927
+ function ns(e, t, r) {
13925
13928
  if (!e) return 0;
13926
13929
  const n = new b.DOMParser().parseFromString(e, "application/xml");
13927
13930
  let o = 0;
13928
13931
  for (const i of Array.from(n.getElementsByTagNameNS(eo, t))) {
13929
- const e = ts(i, r);
13932
+ const e = rs(i, r);
13930
13933
  if (!e || !/^\d+$/.test(e)) continue;
13931
13934
  const t = Number.parseInt(e, 10);
13932
13935
  Number.isSafeInteger(t) && (o = Math.max(o, t));
13933
13936
  }
13934
13937
  return o;
13935
13938
  }
13936
- function ns(e, t) {
13939
+ function os(e, t) {
13937
13940
  return void 0 !== e && Number.isSafeInteger(e) && e >= t;
13938
13941
  }
13939
- function os(e) {
13942
+ function is(e) {
13940
13943
  const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), n = [], o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = function(e) {
13941
13944
  const t = e.sourcePackage;
13942
13945
  if (!t) return;
13943
13946
  const r = t.parts[t.mainDocumentPart]?.relationships?.find((e) => "External" !== e.targetMode && e.type.endsWith("/numbering") && Boolean(e.resolvedTarget)), n = r?.resolvedTarget ? t.parts[r.resolvedTarget] : void 0;
13944
13947
  return "xml" === n?.kind ? n.data : void 0;
13945
13948
  }(e);
13946
- let s = Math.max(1, rs(a, "abstractNum", "abstractNumId") + 1), l = Math.max(1, rs(a, "num", "numId") + 1);
13949
+ let s = Math.max(1, ns(a, "abstractNum", "abstractNumId") + 1), l = Math.max(1, ns(a, "num", "numId") + 1);
13947
13950
  const c = (e) => {
13948
- if (ns(e, 0) && !o.has(e)) return o.add(e), e;
13951
+ if (os(e, 0) && !o.has(e)) return o.add(e), e;
13949
13952
  for (; o.has(s);) s += 1;
13950
13953
  const t = s;
13951
13954
  return s += 1, o.add(t), t;
13952
13955
  }, u = (e) => {
13953
- if (ns(e, 1) && !i.has(e)) return i.add(e), e;
13956
+ if (os(e, 1) && !i.has(e)) return i.add(e), e;
13954
13957
  for (; i.has(l);) l += 1;
13955
13958
  const t = l;
13956
13959
  return l += 1, i.add(t), t;
13957
13960
  }, d = [], p = (e) => {
13958
13961
  e.list && d.push(e);
13959
13962
  };
13960
- for (const f of le(e)) es(f.blocks, p), f.header && es(f.header, p), f.firstPageHeader && es(f.firstPageHeader, p), f.evenPageHeader && es(f.evenPageHeader, p), f.footer && es(f.footer, p), f.firstPageFooter && es(f.firstPageFooter, p), f.evenPageFooter && es(f.evenPageFooter, p);
13963
+ for (const f of le(e)) ts(f.blocks, p), f.header && ts(f.header, p), f.firstPageHeader && ts(f.firstPageHeader, p), f.evenPageHeader && ts(f.evenPageHeader, p), f.footer && ts(f.footer, p), f.firstPageFooter && ts(f.firstPageFooter, p), f.evenPageFooter && ts(f.evenPageFooter, p);
13961
13964
  for (const f of d) {
13962
13965
  const e = f.list, o = Math.max(0, e.level ?? 0), i = e.bulletGlyph ?? "", a = e.instanceId ? `instance:${e.instanceId}` : `legacy:${e.kind}:${o}:${i}`;
13963
13966
  let s = r.get(a);
@@ -13998,8 +14001,8 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
13998
14001
  definitions: n
13999
14002
  };
14000
14003
  }
14001
- const is = `xmlns:w="${eo}" xmlns:w14="${no}" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:r="${ro}"`;
14002
- function as(e, t, r, n) {
14004
+ const as = `xmlns:w="${eo}" xmlns:w14="${no}" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:r="${ro}"`;
14005
+ function ss(e, t, r, n) {
14003
14006
  const o = io(e.width, 12240), i = io(e.height, 15840), a = e.margins, s = "landscape" === e.orientation ? " w:orient=\"landscape\"" : "", l = [
14004
14007
  t?.header?.first ? `<w:headerReference w:type="first" r:id="${t.header.first.relId}"/>` : "",
14005
14008
  t?.header?.even ? `<w:headerReference w:type="even" r:id="${t.header.even.relId}"/>` : "",
@@ -14022,7 +14025,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14022
14025
  const e = [];
14023
14026
  void 0 !== f.start && e.push(`w:start="${f.start}"`), f.format && e.push(`w:fmt="${oo(f.format)}"`), f.chapterStyle && e.push(`w:chapStyle="${oo(f.chapterStyle)}"`), f.chapterSeparator && e.push(`w:chapSep="${oo(f.chapterSeparator)}"`), e.length > 0 && (h = `<w:pgNumType ${e.join(" ")}/>`);
14024
14027
  }
14025
- const m = r.verticalAlignment && "top" !== r.verticalAlignment ? `<w:vAlign w:val="${r.verticalAlignment}"/>` : "", g = r.bidi ? "<w:bidi/>" : "", w = r.pageBorder, b = w?.color.replace("#", "").toUpperCase(), v = w ? `<w:pgBorders w:offsetFrom="page"><w:top w:val="${w.style}" w:sz="${Math.max(1, Math.round(8 * w.width))}" w:space="${Math.max(0, Math.round(w.distance ?? 0))}" w:color="${b}"/><w:left w:val="${w.style}" w:sz="${Math.max(1, Math.round(8 * w.width))}" w:space="${Math.max(0, Math.round(w.distance ?? 0))}" w:color="${b}"/><w:bottom w:val="${w.style}" w:sz="${Math.max(1, Math.round(8 * w.width))}" w:space="${Math.max(0, Math.round(w.distance ?? 0))}" w:color="${b}"/><w:right w:val="${w.style}" w:sz="${Math.max(1, Math.round(8 * w.width))}" w:space="${Math.max(0, Math.round(w.distance ?? 0))}" w:color="${b}"/></w:pgBorders>` : "", y = r.propertyRevision ? `<w:sectPrChange ${xi(r.propertyRevision)}>${as(r.propertyRevision.previous.pageSettings, void 0, (x = r.propertyRevision.previous, {
14028
+ const m = r.verticalAlignment && "top" !== r.verticalAlignment ? `<w:vAlign w:val="${r.verticalAlignment}"/>` : "", g = r.bidi ? "<w:bidi/>" : "", w = r.pageBorder, b = w?.color.replace("#", "").toUpperCase(), v = w ? `<w:pgBorders w:offsetFrom="page"><w:top w:val="${w.style}" w:sz="${Math.max(1, Math.round(8 * w.width))}" w:space="${Math.max(0, Math.round(w.distance ?? 0))}" w:color="${b}"/><w:left w:val="${w.style}" w:sz="${Math.max(1, Math.round(8 * w.width))}" w:space="${Math.max(0, Math.round(w.distance ?? 0))}" w:color="${b}"/><w:bottom w:val="${w.style}" w:sz="${Math.max(1, Math.round(8 * w.width))}" w:space="${Math.max(0, Math.round(w.distance ?? 0))}" w:color="${b}"/><w:right w:val="${w.style}" w:sz="${Math.max(1, Math.round(8 * w.width))}" w:space="${Math.max(0, Math.round(w.distance ?? 0))}" w:color="${b}"/></w:pgBorders>` : "", y = r.propertyRevision ? `<w:sectPrChange ${xi(r.propertyRevision)}>${ss(r.propertyRevision.previous.pageSettings, void 0, (x = r.propertyRevision.previous, {
14026
14029
  id: "section:revision",
14027
14030
  blocks: [],
14028
14031
  pageSettings: x.pageSettings,
@@ -14034,41 +14037,41 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14034
14037
  var x;
14035
14038
  return `<w:sectPr>${l}${c}${u}<w:pgSz w:w="${o}" w:h="${i}"${s}/><w:pgMar w:top="${io(a.top, 1440)}" w:right="${io(a.right, 1440)}" w:bottom="${io(a.bottom, 1440)}" w:left="${io(a.left, 1440)}" w:header="${io(a.header, 720)}" w:footer="${io(a.footer, 720)}" w:gutter="${io(a.gutter, 0)}"/>${h}${p}${m}${g}${v}${y}</w:sectPr>`;
14036
14039
  }
14037
- function ss(e, t, r) {
14038
- const n = le(e), o = n.map((o, i) => Pa(o.blocks, t, e.styles) + as(o.pageSettings, r[i], o, n[i + 1]?.breakType)).join(""), i = e.design?.pageColor?.replace("#", "").toUpperCase();
14039
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document ${is}>${i ? `<w:background w:color="${i}"/>` : ""}<w:body>${o}</w:body></w:document>`;
14040
+ function ls(e, t, r) {
14041
+ const n = le(e), o = n.map((o, i) => Fa(o.blocks, t, e.styles) + ss(o.pageSettings, r[i], o, n[i + 1]?.breakType)).join(""), i = e.design?.pageColor?.replace("#", "").toUpperCase();
14042
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document ${as}>${i ? `<w:background w:color="${i}"/>` : ""}<w:body>${o}</w:body></w:document>`;
14040
14043
  }
14041
- function ls(e, t, r, n, o) {
14044
+ function cs(e, t, r, n, o) {
14042
14045
  const i = "header" === e ? "hdr" : "ftr", a = "header" === e && "text" === o?.kind && o.text ? `<w:pict xmlns:v="urn:schemas-microsoft-com:vml"><v:shape type="#_x0000_t136" style="position:absolute;margin-left:0;margin-top:0;width:468pt;height:216pt;z-index:-251654144;rotation:${o.rotation ?? -45}" fillcolor="${o.color ?? "#94a3b8"}" fillopacity="${o.opacity ?? .25}"><v:textpath on="true" string="${oo(o.text)}" style="font-family:${oo(o.fontFamily ?? "Arial")};font-size:${o.fontSize ?? 48}pt"/></v:shape></w:pict>` : "header" === e && "image" === o?.kind && r.images.some((e) => "__watermark" === e.runId) ? `<w:pict xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><v:shape type="#_x0000_t75" style="position:absolute;margin-left:0;margin-top:0;width:468pt;height:216pt;z-index:-251654144;rotation:${o.rotation ?? -45}" fillcolor="${o.color ?? "#ffffff"}" fillopacity="${o.opacity ?? .25}" stroked="f"><v:imagedata r:id="rIdWatermark" o:title="Watermark"/></v:shape></w:pict>` : "";
14043
- return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${i} ${is}>${a}${Pa(t, r, n)}</w:${i}>`;
14046
+ return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${i} ${as}>${a}${Fa(t, r, n)}</w:${i}>`;
14044
14047
  }
14045
- function cs(e) {
14048
+ function us(e) {
14046
14049
  if (e) return {
14047
14050
  ...e,
14048
14051
  propertyRevision: e.propertyRevision ? {
14049
14052
  ...e.propertyRevision,
14050
- previous: cs(e.propertyRevision.previous) ?? {}
14053
+ previous: us(e.propertyRevision.previous) ?? {}
14051
14054
  } : void 0
14052
14055
  };
14053
14056
  }
14054
- function us(e) {
14057
+ function ds(e) {
14055
14058
  if (e) return {
14056
14059
  ...e,
14057
14060
  tabs: e.tabs ? e.tabs.map((e) => ({ ...e })) : e.tabs,
14058
14061
  propertyRevision: e.propertyRevision ? {
14059
14062
  ...e.propertyRevision,
14060
- previous: us(e.propertyRevision.previous) ?? {}
14063
+ previous: ds(e.propertyRevision.previous) ?? {}
14061
14064
  } : void 0
14062
14065
  };
14063
14066
  }
14064
- function ds(e) {
14065
- return Array.isArray(e) ? e.map(ds) : e && "object" == typeof e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, ds(t)])) : e;
14066
- }
14067
14067
  function ps(e) {
14068
+ return Array.isArray(e) ? e.map(ps) : e && "object" == typeof e ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, ps(t)])) : e;
14069
+ }
14070
+ function fs(e) {
14068
14071
  const t = {
14069
14072
  id: e.id,
14070
14073
  text: e.text,
14071
- styles: cs(e.styles),
14074
+ styles: us(e.styles),
14072
14075
  revision: e.revision ? { ...e.revision } : void 0,
14073
14076
  revisionRangeMarker: e.revisionRangeMarker ? { ...e.revisionRangeMarker } : void 0,
14074
14077
  sdtWrappers: e.sdtWrappers ? [...e.sdtWrappers] : void 0
@@ -14099,7 +14102,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14099
14102
  } : void 0,
14100
14103
  shape: r.shape ? { ...r.shape } : void 0,
14101
14104
  body: r.body ? { ...r.body } : void 0,
14102
- blocks: hs(r.blocks)
14105
+ blocks: ms(r.blocks)
14103
14106
  })
14104
14107
  };
14105
14108
  var r;
@@ -14138,25 +14141,25 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14138
14141
  return {
14139
14142
  ...t,
14140
14143
  kind: "math",
14141
- math: (r = e.math, ds(r))
14144
+ math: (r = e.math, ps(r))
14142
14145
  };
14143
14146
  var r;
14144
14147
  }
14145
14148
  }));
14146
14149
  }
14147
- function fs(e) {
14150
+ function hs(e) {
14148
14151
  return {
14149
14152
  ...e,
14150
- runs: e.runs.map(ps),
14151
- style: us(e.style),
14153
+ runs: e.runs.map(fs),
14154
+ style: ds(e.style),
14152
14155
  list: e.list ? { ...e.list } : void 0,
14153
14156
  numberingRevision: e.numberingRevision ? { ...e.numberingRevision } : void 0
14154
14157
  };
14155
14158
  }
14156
- function hs(e) {
14159
+ function ms(e) {
14157
14160
  return e.map((e) => {
14158
14161
  switch (e.type) {
14159
- case "paragraph": return fs(e);
14162
+ case "paragraph": return hs(e);
14160
14163
  case "table": return {
14161
14164
  ...e,
14162
14165
  style: e.style ? {
@@ -14192,7 +14195,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14192
14195
  ...e,
14193
14196
  mergeRevisionState: void 0,
14194
14197
  style: e.style ? { ...e.style } : void 0,
14195
- blocks: hs(e.blocks)
14198
+ blocks: ms(e.blocks)
14196
14199
  }))
14197
14200
  } : void 0,
14198
14201
  style: e.style ? {
@@ -14203,7 +14206,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14203
14206
  previous: { ...e.style.propertyRevision.previous }
14204
14207
  } : void 0
14205
14208
  } : void 0,
14206
- blocks: hs(e.blocks)
14209
+ blocks: ms(e.blocks)
14207
14210
  }))
14208
14211
  }))
14209
14212
  };
@@ -14211,7 +14214,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14211
14214
  }
14212
14215
  });
14213
14216
  }
14214
- function ms(e) {
14217
+ function gs(e) {
14215
14218
  return !!e && "caption" === e.style?.styleId?.toLowerCase() && e.runs.some((e) => {
14216
14219
  const t = function(e) {
14217
14220
  return "fieldInstruction" === e.kind ? e.fieldInstruction : void 0;
@@ -14219,11 +14222,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14219
14222
  return void 0 !== t && (/* @__PURE__ */ new RegExp("\\bSEQ\\s+Figure\\b", "i")).test(t);
14220
14223
  });
14221
14224
  }
14222
- function gs(e, t) {
14225
+ function ws(e, t) {
14223
14226
  return e.map((e) => {
14224
14227
  switch (e.type) {
14225
- case "paragraph": return ms(e) ? function(e, t) {
14226
- if (!ms(e)) return fs(e);
14228
+ case "paragraph": return gs(e) ? function(e, t) {
14229
+ if (!gs(e)) return hs(e);
14227
14230
  let r = !1, n = !1;
14228
14231
  const o = e.runs.map((e) => "fieldChar" === e.kind && "separate" === e.fieldChar.kind ? (r = !0, {
14229
14232
  ...e,
@@ -14236,17 +14239,17 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14236
14239
  text: String(t)
14237
14240
  }) : { ...e });
14238
14241
  return n ? {
14239
- ...fs(e),
14242
+ ...hs(e),
14240
14243
  runs: o
14241
- } : fs(e);
14242
- }(e, t.next++) : fs(e);
14244
+ } : hs(e);
14245
+ }(e, t.next++) : hs(e);
14243
14246
  case "table": return {
14244
14247
  ...e,
14245
14248
  rows: e.rows.map((e) => ({
14246
14249
  ...e,
14247
14250
  cells: e.cells.map((e) => ({
14248
14251
  ...e,
14249
- blocks: gs(e.blocks, t)
14252
+ blocks: ws(e.blocks, t)
14250
14253
  }))
14251
14254
  }))
14252
14255
  };
@@ -14254,7 +14257,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14254
14257
  }
14255
14258
  });
14256
14259
  }
14257
- const ws = {
14260
+ const bs = {
14258
14261
  oasis: {
14259
14262
  accent: "0F766E",
14260
14263
  heading: "115E59",
@@ -14286,9 +14289,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14286
14289
  body: "1F2937"
14287
14290
  }
14288
14291
  };
14289
- function bs(e, t, r, n) {
14292
+ function vs(e, t, r, n) {
14290
14293
  const o = [], i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), s = [], l = /* @__PURE__ */ new Map();
14291
- return es(e, (e) => {
14294
+ return ts(e, (e) => {
14292
14295
  for (const t of e.runs) {
14293
14296
  const e = t.styles?.link;
14294
14297
  if (e && !e.startsWith("#") && !l.has(e)) {
@@ -14347,23 +14350,23 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14347
14350
  hyperlinkMap: l
14348
14351
  };
14349
14352
  }
14350
- function vs(e, t, r) {
14351
- r && (e.file(`word/${t}.xml`, r.xml), (r.partContext.images.length > 0 || r.partContext.hyperlinks.length > 0) && e.file(`word/_rels/${t}.xml.rels`, Ka(r.partContext.images, r.partContext.hyperlinks)));
14353
+ function ys(e, t, r) {
14354
+ r && (e.file(`word/${t}.xml`, r.xml), (r.partContext.images.length > 0 || r.partContext.hyperlinks.length > 0) && e.file(`word/_rels/${t}.xml.rels`, Ja(r.partContext.images, r.partContext.hyperlinks)));
14352
14355
  }
14353
- async function ys(e) {
14356
+ async function xs(e) {
14354
14357
  e = function(e) {
14355
14358
  const t = { next: 1 }, r = le(e).map((e) => ({
14356
14359
  ...e,
14357
- blocks: gs(e.blocks, t),
14358
- header: e.header ? hs(e.header) : void 0,
14359
- footer: e.footer ? hs(e.footer) : void 0
14360
+ blocks: ws(e.blocks, t),
14361
+ header: e.header ? ms(e.header) : void 0,
14362
+ footer: e.footer ? ms(e.footer) : void 0
14360
14363
  }));
14361
14364
  return {
14362
14365
  ...e,
14363
14366
  sections: r
14364
14367
  };
14365
14368
  }(e);
14366
- const t = new w.default(), r = os(e), n = {
14369
+ const t = new w.default(), r = is(e), n = {
14367
14370
  nextImageId: 1,
14368
14371
  nextTextBoxDocPrId: 1000001
14369
14372
  }, o = le(e), i = function(e) {
@@ -14381,11 +14384,11 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14381
14384
  cx: 1,
14382
14385
  cy: 1
14383
14386
  } : void 0;
14384
- }(e), a = Ma(e), s = function(e) {
14387
+ }(e), a = Oa(e), s = function(e) {
14385
14388
  const t = /* @__PURE__ */ new Map();
14386
14389
  for (const r of e) t.set(r.footnoteId, r.docxId);
14387
14390
  return t;
14388
- }(a), l = a.length > 0, c = Ba(e), u = function(e) {
14391
+ }(a), l = a.length > 0, c = Ua(e), u = function(e) {
14389
14392
  const t = /* @__PURE__ */ new Map();
14390
14393
  for (const r of e) t.set(r.endnoteId, r.docxId);
14391
14394
  return t;
@@ -14475,12 +14478,12 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14475
14478
  eventsByParagraph: i,
14476
14479
  comments: s
14477
14480
  };
14478
- }(e), h = (e) => (e.footnoteIdMap = s, e.endnoteIdMap = u, e.bookmarkEventsByParagraph = p, e.commentEventsByParagraph = f?.eventsByParagraph, e), m = h(bs(o.flatMap((e) => e.blocks), r, n, e)), g = void 0 !== f, b = [], v = o.map(() => ({}));
14481
+ }(e), h = (e) => (e.footnoteIdMap = s, e.endnoteIdMap = u, e.bookmarkEventsByParagraph = p, e.commentEventsByParagraph = f?.eventsByParagraph, e), m = h(vs(o.flatMap((e) => e.blocks), r, n, e)), g = void 0 !== f, b = [], v = o.map(() => ({}));
14479
14482
  let y = 1, x = 1;
14480
14483
  o.forEach((t, o) => {
14481
14484
  const a = (t, a, s) => {
14482
14485
  if (!(s && 0 !== s.length || "header" === t && "text" === e.design?.watermark?.kind || "header" === t && void 0 !== i)) return;
14483
- const l = s ?? [], c = "header" === t ? y : x, u = `${t}${c}.xml`, d = `rId${"header" === t ? "Header" : "Footer"}${c}`, p = h(bs(l, r, n, e));
14486
+ const l = s ?? [], c = "header" === t ? y : x, u = `${t}${c}.xml`, d = `rId${"header" === t ? "Header" : "Footer"}${c}`, p = h(vs(l, r, n, e));
14484
14487
  "header" === t && i && p.images.push({ ...i }), b.push({
14485
14488
  kind: t,
14486
14489
  type: a,
@@ -14495,34 +14498,34 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14495
14498
  a("header", "first", t.firstPageHeader), a("header", "even", t.evenPageHeader), a("header", "default", t.header), a("footer", "first", t.firstPageFooter), a("footer", "even", t.evenPageFooter), a("footer", "default", t.footer);
14496
14499
  });
14497
14500
  const E = r.definitions.length > 0, S = o.some((e) => (e.evenPageHeader?.length ?? 0) > 0 || (e.evenPageFooter?.length ?? 0) > 0), N = S || void 0 !== e.settings?.defaultTabStop || void 0 !== e.settings?.allowSpaceOfSameStyleInTable || void 0 !== e.settings?.autoHyphenation || void 0 !== e.settings?.consecutiveHyphenLimit || void 0 !== e.settings?.hyphenationZone || void 0 !== e.settings?.doNotHyphenateCaps || void 0 !== e.footnotes?.settings || void 0 !== e.endnotes?.settings, k = [...m.images, ...b.flatMap((e) => e.context.images)], _ = l ? function(e, t, r, n, o, i, a) {
14498
- const s = o(t.flatMap((e) => Oa(e.footnote.blocks)));
14501
+ const s = o(t.flatMap((e) => La(e.footnote.blocks)));
14499
14502
  s.footnoteIdMap = a;
14500
14503
  const l = t.map((e) => {
14501
- const t = Pa(Oa(e.footnote.blocks), s, i);
14504
+ const t = Fa(La(e.footnote.blocks), s, i);
14502
14505
  return `<w:footnote w:id="${e.docxId}">${t}</w:footnote>`;
14503
14506
  }).join("");
14504
14507
  return {
14505
14508
  xml: `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:footnotes xmlns:w="${eo}" xmlns:w14="${no}" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:r="${ro}"><w:footnote w:type="separator" w:id="-1"><w:p><w:r><w:separator/></w:r></w:p></w:footnote><w:footnote w:type="continuationSeparator" w:id="0"><w:p><w:r><w:continuationSeparator/></w:r></w:p></w:footnote>${l}</w:footnotes>`,
14506
14509
  partContext: s
14507
14510
  };
14508
- }(0, a, 0, 0, (t) => bs(t, r, n, e), e.styles, s) : null;
14511
+ }(0, a, 0, 0, (t) => vs(t, r, n, e), e.styles, s) : null;
14509
14512
  _ && k.push(..._.partContext.images);
14510
14513
  const T = d ? function(e, t, r, n, o, i, a) {
14511
- const s = o(t.flatMap((e) => Ua(e.endnote.blocks)));
14514
+ const s = o(t.flatMap((e) => za(e.endnote.blocks)));
14512
14515
  s.endnoteIdMap = a;
14513
14516
  const l = t.map((e) => {
14514
- const t = Pa(Ua(e.endnote.blocks), s, i);
14517
+ const t = Fa(za(e.endnote.blocks), s, i);
14515
14518
  return `<w:endnote w:id="${e.docxId}">${t}</w:endnote>`;
14516
14519
  }).join("");
14517
14520
  return {
14518
14521
  xml: `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:endnotes xmlns:w="${eo}" xmlns:w14="${no}" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:r="${ro}"><w:endnote w:type="separator" w:id="-1"><w:p><w:r><w:separator/></w:r></w:p></w:endnote><w:endnote w:type="continuationSeparator" w:id="0"><w:p><w:r><w:continuationSeparator/></w:r></w:p></w:endnote>${l}</w:endnotes>`,
14519
14522
  partContext: s
14520
14523
  };
14521
- }(0, c, 0, 0, (t) => bs(t, r, n, e), e.styles, u) : null;
14524
+ }(0, c, 0, 0, (t) => vs(t, r, n, e), e.styles, u) : null;
14522
14525
  T && k.push(...T.partContext.images);
14523
14526
  const I = k.filter((e) => "embedded" === e.kind).map((e) => e.target.split(".").pop()?.toLowerCase()).filter((e) => Boolean(e)), A = null != e.styles && Object.keys(e.styles).length > 0, C = (e.fontTable?.length ?? 0) > 0, R = void 0 !== e.design;
14524
- t.file("[Content_Types].xml", Xa(E, I, N, b, l, d, A, g, C, R)), t.file("_rels/.rels", `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${to}"><Relationship Id="rId1" Type="${ro}/officeDocument" Target="word/document.xml"/></Relationships>`), t.file("word/document.xml", ss(e, m, v)), A && t.file("word/styles.xml", function(e) {
14525
- const t = Object.values(e).map(Va).join("");
14527
+ t.file("[Content_Types].xml", Za(E, I, N, b, l, d, A, g, C, R)), t.file("_rels/.rels", `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${to}"><Relationship Id="rId1" Type="${ro}/officeDocument" Target="word/document.xml"/></Relationships>`), t.file("word/document.xml", ls(e, m, v)), A && t.file("word/styles.xml", function(e) {
14528
+ const t = Object.values(e).map(Xa).join("");
14526
14529
  return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="${no}">${t}</w:styles>`;
14527
14530
  }(e.styles)), E && t.file("word/numbering.xml", function(e) {
14528
14531
  const t = e.map(({ abstractNumId: e, levels: t }) => `<w:abstractNum w:abstractNumId="${e}">${t.sort((e, t) => e.level - t.level).map(({ kind: e, level: t, format: r, startAt: n, levelText: o, suffix: i, alignment: a, legal: s, bulletGlyph: l, bulletFont: c, ooxml: u }) => {
@@ -14556,7 +14559,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14556
14559
  }(e.fontTable)), R && t.file("word/theme/theme1.xml", function(e) {
14557
14560
  const t = e?.themeData?.sourceXml;
14558
14561
  if (t) return t;
14559
- const r = ws[e?.themeId ?? "oasis"] ?? ws.oasis, n = e?.themeData, o = (e, t) => (n?.colors?.[e] ?? t).replace(/^#/, "").toUpperCase(), i = {
14562
+ const r = bs[e?.themeId ?? "oasis"] ?? bs.oasis, n = e?.themeData, o = (e, t) => (n?.colors?.[e] ?? t).replace(/^#/, "").toUpperCase(), i = {
14560
14563
  dk1: o("dk1", "000000"),
14561
14564
  lt1: o("lt1", "FFFFFF"),
14562
14565
  dk2: o("dk2", r.body),
@@ -14576,9 +14579,9 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14576
14579
  null !== s && a.push(`<w:defaultTabStop w:val="${s}"/>`), i?.autoHyphenation && a.push("<w:autoHyphenation/>"), void 0 !== i?.consecutiveHyphenLimit && i.consecutiveHyphenLimit >= 0 && a.push(`<w:consecutiveHyphenLimit w:val="${i.consecutiveHyphenLimit}"/>`);
14577
14580
  const l = so(i?.hyphenationZone);
14578
14581
  null !== l && a.push(`<w:hyphenationZone w:val="${l}"/>`), i?.doNotHyphenateCaps && a.push("<w:doNotHyphenateCaps/>");
14579
- const c = Qa("footnotePr", r);
14582
+ const c = Ka("footnotePr", r);
14580
14583
  c && a.push(c);
14581
- const u = Qa("endnotePr", n);
14584
+ const u = Ka("endnotePr", n);
14582
14585
  return u && a.push(u), e && a.push("<w:evenAndOddHeaders/>"), o && a.push("<w:compat><w:allowSpaceOfSameStyleInTable/></w:compat>"), `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:settings xmlns:w="${eo}">${a.join("")}</w:settings>`;
14583
14586
  }(S, e.settings?.defaultTabStop, e.footnotes?.settings, e.endnotes?.settings, e.settings?.allowSpaceOfSameStyleInTable, {
14584
14587
  autoHyphenation: e.settings?.autoHyphenation,
@@ -14586,8 +14589,8 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14586
14589
  hyphenationZone: e.settings?.hyphenationZone,
14587
14590
  doNotHyphenateCaps: e.settings?.doNotHyphenateCaps
14588
14591
  }));
14589
- for (const w of b) t.file(`word/${w.path}`, ls(w.kind, w.blocks, w.context, e.styles, e.design?.watermark)), (w.context.images.length > 0 || w.context.hyperlinks.length > 0) && t.file(`word/_rels/${w.path}.rels`, Ka(w.context.images, w.context.hyperlinks));
14590
- vs(t, "footnotes", _), vs(t, "endnotes", T), f && (t.file("word/comments.xml", ho(f)), t.file("word/commentsExtended.xml", function(e) {
14592
+ for (const w of b) t.file(`word/${w.path}`, cs(w.kind, w.blocks, w.context, e.styles, e.design?.watermark)), (w.context.images.length > 0 || w.context.hyperlinks.length > 0) && t.file(`word/_rels/${w.path}.rels`, Ja(w.context.images, w.context.hyperlinks));
14593
+ ys(t, "footnotes", _), ys(t, "endnotes", T), f && (t.file("word/comments.xml", ho(f)), t.file("word/commentsExtended.xml", function(e) {
14591
14594
  const t = new Map(e.comments.map(({ comment: e, paraId: t }) => [e.id, t])), r = e.comments.map(({ comment: e, paraId: r }) => {
14592
14595
  const n = e.parentId ? t.get(e.parentId) : void 0;
14593
14596
  return `<w15:commentEx w15:paraId="${r}"${n ? ` w15:paraIdParent="${n}"` : ""} w15:done="${e.resolved ? "1" : "0"}"/>`;
@@ -14597,34 +14600,34 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14597
14600
  for (const w of k) "embedded" === w.kind && w.base64 && t.file(`word/${w.target}`, w.base64, { base64: !0 });
14598
14601
  return t.generateAsync({ type: "arraybuffer" });
14599
14602
  }
14600
- function xs(e) {
14603
+ function Es(e) {
14601
14604
  let t = 2166136261;
14602
14605
  for (const r of e) t ^= r, t = Math.imul(t, 16777619);
14603
14606
  return (t >>> 0).toString(16).padStart(8, "0");
14604
14607
  }
14605
- async function Es(e) {
14608
+ async function Ss(e) {
14606
14609
  return async function(e) {
14607
14610
  const t = await w.default.loadAsync(e), r = {};
14608
- for (const [n, o] of Object.entries(t.files)) o.dir || (r[Zn(n)] = xs(await o.async("uint8array")));
14611
+ for (const [n, o] of Object.entries(t.files)) o.dir || (r[Zn(n)] = Es(await o.async("uint8array")));
14609
14612
  return r;
14610
- }(await ys(e));
14613
+ }(await xs(e));
14611
14614
  }
14612
- const Ss = "word/document.xml";
14613
- function Ns(e) {
14615
+ const Ns = "word/document.xml";
14616
+ function ks(e) {
14614
14617
  let t = 2166136261;
14615
14618
  for (let r = 0; r < e.length; r += 1) t ^= e.charCodeAt(r), t = Math.imul(t, 16777619);
14616
14619
  return (t >>> 0).toString(16).padStart(8, "0");
14617
14620
  }
14618
- function ks(e, t) {
14621
+ function _s(e, t) {
14619
14622
  const r = t.overrides[e];
14620
14623
  if (r) return r;
14621
14624
  const n = e.includes(".") ? e.slice(e.lastIndexOf(".") + 1).toLowerCase() : "";
14622
14625
  return t.defaults[n];
14623
14626
  }
14624
- function _s(e, t) {
14627
+ function Ts(e, t) {
14625
14628
  return !(!e.endsWith(".xml") && !e.endsWith(".rels")) || "application/xml" === t || Boolean(t?.endsWith("+xml"));
14626
14629
  }
14627
- async function Ts(e) {
14630
+ async function Is(e) {
14628
14631
  const t = await w.default.loadAsync(e), r = [], n = await t.file("[Content_Types].xml")?.async("string"), o = function(e) {
14629
14632
  const t = {
14630
14633
  defaults: {},
@@ -14655,14 +14658,14 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14655
14658
  const i = {};
14656
14659
  for (const [l, c] of Object.entries(t.files)) {
14657
14660
  if (c.dir) continue;
14658
- const e = Zn(l), t = ks(e, o), r = _s(e, t) ? "xml" : "binary", n = "xml" === r ? await c.async("string") : await c.async("base64");
14661
+ const e = Zn(l), t = _s(e, o), r = Ts(e, t) ? "xml" : "binary", n = "xml" === r ? await c.async("string") : await c.async("base64");
14659
14662
  i[e] = {
14660
14663
  path: e,
14661
14664
  ...t ? { contentType: t } : {},
14662
14665
  kind: r,
14663
14666
  data: n,
14664
14667
  encoding: "xml" === r ? "utf8" : "base64",
14665
- originalHash: Ns(n)
14668
+ originalHash: ks(n)
14666
14669
  };
14667
14670
  }
14668
14671
  let a = [];
@@ -14692,8 +14695,8 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14692
14695
  }
14693
14696
  let s = a.find((e) => "External" !== e.targetMode && e.type.endsWith("/officeDocument"))?.resolvedTarget;
14694
14697
  if (!s || !i[s]) {
14695
- if (!i[Ss]) throw new Error("DOCX package has no resolvable officeDocument relationship or word/document.xml fallback.");
14696
- s = Ss, r.push({
14698
+ if (!i[Ns]) throw new Error("DOCX package has no resolvable officeDocument relationship or word/document.xml fallback.");
14699
+ s = Ns, r.push({
14697
14700
  level: "warning",
14698
14701
  code: "main-document-fallback",
14699
14702
  message: "The officeDocument relationship was absent or invalid; word/document.xml was used as a compatibility fallback."
@@ -14708,7 +14711,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14708
14711
  ...r.length > 0 ? { diagnostics: r } : {}
14709
14712
  };
14710
14713
  }
14711
- const Is = "word/document.xml", As = {
14714
+ const As = "word/document.xml", Cs = {
14712
14715
  "/styles": "word/styles.xml",
14713
14716
  "/numbering": "word/numbering.xml",
14714
14717
  "/settings": "word/settings.xml",
@@ -14719,67 +14722,67 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14719
14722
  "/comments": "word/comments.xml",
14720
14723
  "/commentsExtended": "word/commentsExtended.xml"
14721
14724
  };
14722
- function Cs(e) {
14725
+ function Rs(e) {
14723
14726
  const t = e.lastIndexOf("/"), r = t >= 0 ? e.slice(0, t) : "", n = t >= 0 ? e.slice(t + 1) : e;
14724
14727
  return r ? `${r}/_rels/${n}.rels` : `_rels/${n}.rels`;
14725
14728
  }
14726
- function Rs(e, t, r) {
14729
+ function $s(e, t, r) {
14727
14730
  "base64" === r.encoding ? e.file(t, r.data, { base64: !0 }) : e.file(t, r.data);
14728
14731
  }
14729
- function $s(e) {
14732
+ function Ds(e) {
14730
14733
  return `word/__oasis_source__/${e}`;
14731
14734
  }
14732
- function Ds(e) {
14735
+ function Ps(e) {
14733
14736
  return e ? e.map((e) => "External" !== e.targetMode && e.resolvedTarget ? {
14734
14737
  ...e,
14735
- target: `/${$s(e.resolvedTarget)}`,
14738
+ target: `/${Ds(e.resolvedTarget)}`,
14736
14739
  resolvedTarget: void 0
14737
14740
  } : e) : [];
14738
14741
  }
14739
- function Ps(e) {
14740
- for (const [t, r] of Object.entries(As)) if (e.type.endsWith(t)) return r;
14742
+ function Fs(e) {
14743
+ for (const [t, r] of Object.entries(Cs)) if (e.type.endsWith(t)) return r;
14741
14744
  }
14742
- async function Fs(e, t) {
14745
+ async function Ms(e, t) {
14743
14746
  if (!function(e) {
14744
- if (e.mainDocumentPart !== Is) return !0;
14747
+ if (e.mainDocumentPart !== As) return !0;
14745
14748
  const t = e.parts[e.mainDocumentPart];
14746
14749
  return Boolean(t?.relationships?.some((e) => {
14747
- const t = Ps(e);
14750
+ const t = Fs(e);
14748
14751
  return Boolean(t && e.resolvedTarget && e.resolvedTarget !== t);
14749
14752
  }));
14750
14753
  }(t)) return e;
14751
14754
  const r = new w.default();
14752
- for (const i of Object.values(t.parts)) Rs(r, i.path, i);
14755
+ for (const i of Object.values(t.parts)) $s(r, i.path, i);
14753
14756
  for (const i of Object.values(t.parts)) {
14754
14757
  if (i.path.endsWith(".rels") || "[Content_Types].xml" === i.path) continue;
14755
- const e = $s(i.path);
14756
- Rs(r, e, i);
14757
- const t = Ds(i.relationships);
14758
- t.length > 0 && r.file(Cs(e), Kn(t));
14758
+ const e = Ds(i.path);
14759
+ $s(r, e, i);
14760
+ const t = Ps(i.relationships);
14761
+ t.length > 0 && r.file(Rs(e), Kn(t));
14759
14762
  }
14760
14763
  const n = t.parts[t.mainDocumentPart];
14761
14764
  if (!n) throw new Error(`DOCX source package is missing its main part: ${t.mainDocumentPart}`);
14762
- Rs(r, Is, n);
14763
- const o = Ds(n.relationships);
14764
- o.length > 0 && r.file(Cs(Is), Kn(o));
14765
+ $s(r, As, n);
14766
+ const o = Ps(n.relationships);
14767
+ o.length > 0 && r.file(Rs(As), Kn(o));
14765
14768
  for (const i of n.relationships ?? []) {
14766
14769
  if ("External" === i.targetMode || !i.resolvedTarget) continue;
14767
- const e = Ps(i), n = t.parts[i.resolvedTarget];
14770
+ const e = Fs(i), n = t.parts[i.resolvedTarget];
14768
14771
  if (!e || !n) continue;
14769
- Rs(r, e, n);
14770
- const o = Ds(n.relationships);
14771
- o.length > 0 && r.file(Cs(e), Kn(o));
14772
+ $s(r, e, n);
14773
+ const o = Ps(n.relationships);
14774
+ o.length > 0 && r.file(Rs(e), Kn(o));
14772
14775
  }
14773
14776
  return r.generateAsync({ type: "arraybuffer" });
14774
14777
  }
14775
- function Ms(e) {
14778
+ function Os(e) {
14776
14779
  globalThis.postMessage(e);
14777
14780
  }
14778
14781
  globalThis.addEventListener("message", async (e) => {
14779
14782
  const t = e.data;
14780
14783
  if ("import-docx" === t?.type) try {
14781
- const e = await Ts(t.buffer), n = await Gn(await Fs(t.buffer, e), { onProgress: (e, r) => {
14782
- Ms({
14784
+ const e = await Is(t.buffer), n = await Gn(await Ms(t.buffer, e), { onProgress: (e, r) => {
14785
+ Os({
14783
14786
  type: "progress",
14784
14787
  id: t.id,
14785
14788
  stage: e,
@@ -14788,7 +14791,7 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14788
14791
  } });
14789
14792
  await async function(e, t) {
14790
14793
  try {
14791
- t.rebuiltPartHashes = await Es(e);
14794
+ t.rebuiltPartHashes = await Ss(e);
14792
14795
  } catch (r) {
14793
14796
  (t.diagnostics ??= []).push({
14794
14797
  level: "warning",
@@ -14796,13 +14799,13 @@ while (n === s[++o] && n === s[++o] && n === s[++o] && n === s[++o] && n === s[+
14796
14799
  message: `The imported document could not be fingerprinted for granular source-part preservation: ${r instanceof Error ? r.message : String(r)}`
14797
14800
  });
14798
14801
  }
14799
- }(n, e), n.sourcePackage = e, Ms({
14802
+ }(n, e), n.sourcePackage = e, Os({
14800
14803
  type: "done",
14801
14804
  id: t.id,
14802
14805
  document: n
14803
14806
  });
14804
14807
  } catch (r) {
14805
- Ms({
14808
+ Os({
14806
14809
  type: "error",
14807
14810
  id: t.id,
14808
14811
  error: r instanceof Error ? r.message : String(r)