kindy-editor 3.2.2 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/assets/{worker-CHtzL1YW.js → worker-BIFTSRF2.js} +7043 -7021
- package/dist-lib/{browser-BxYyzpLt.js → browser-xuRja-pP.js} +2 -2
- package/dist-lib/builder.js +7 -7
- package/dist-lib/changeAggregator-ymKDXGA8.js +376 -0
- package/dist-lib/{editorApp-N20nk5uQ.js → editorApp-zIpjgEaZ.js} +7281 -7230
- package/dist-lib/events.js +119 -43
- package/dist-lib/export.js +1739 -1732
- package/dist-lib/generate-toc.js +5 -5
- package/dist-lib/import.js +2 -2
- package/dist-lib/{kindy-editor-D4xSNtvA.js → kindy-editor-DuN692fi.js} +5 -5
- package/dist-lib/kindy-editor.js +9 -6
- package/dist-lib/{lists-DpmgbDyt.js → lists-BVCy5dMa.js} +2 -2
- package/dist-lib/measure.js +3 -3
- package/dist-lib/{measureHost-C2NOdNkI.js → measureHost-y37gLU6M.js} +2 -2
- package/dist-lib/{metrics-DHgtBP-R.js → metrics-CdfHD-8y.js} +3 -3
- package/dist-lib/{paintStyle-Cjk9egel.js → paintStyle-Cb7IGKPW.js} +51 -51
- package/dist-lib/{parse-JE_w0NNt.js → parse-DJZd-2A7.js} +20 -20
- package/dist-lib/{pipeline-CgbvBwNe.js → pipeline-DKgBMmw1.js} +301 -301
- package/dist-lib/recalc-docx.js +2 -2
- package/dist-lib/{recalcToc-DKJK9f5X.js → recalcToc-DCykIt4o.js} +80 -80
- package/dist-lib/{styleProps-OePkgWnD.js → styleProps-Dg3Wf-ZJ.js} +3 -3
- package/dist-lib/{stylesheet-COz2MSt6.js → stylesheet-EQFx9l5c.js} +3 -3
- package/dist-lib/{toc-C6XLbDEA.js → toc-BIj8uQ-W.js} +48 -48
- package/dist-lib/{webmcp-DrpPKUeh.js → webmcp-QA5rVg1F.js} +2 -2
- package/docs/http-event-sink.md +7 -0
- package/docs/public-events.md +102 -0
- package/docs/track-changes-events.md +551 -0
- package/package.json +2 -2
- package/types/events.d.ts +67 -1
- package/types/kindy-editor.d.ts +4 -0
- package/dist-lib/eventHub-CZFpTVqe.js +0 -71
- package/dist-lib/events-D_WEQDa6.js +0 -104
- package/docs/.vitepress/cache/deps/@theme_index.js +0 -275
- package/docs/.vitepress/cache/deps/@theme_index.js.map +0 -7
- package/docs/.vitepress/cache/deps/_metadata.json +0 -40
- package/docs/.vitepress/cache/deps/chunk-FNDFPMRQ.js +0 -13131
- package/docs/.vitepress/cache/deps/chunk-FNDFPMRQ.js.map +0 -7
- package/docs/.vitepress/cache/deps/chunk-IOFLAFGL.js +0 -9719
- package/docs/.vitepress/cache/deps/chunk-IOFLAFGL.js.map +0 -7
- package/docs/.vitepress/cache/deps/package.json +0 -3
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +0 -4483
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +0 -7
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +0 -583
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +0 -7
- package/docs/.vitepress/cache/deps/vue.js +0 -347
- package/docs/.vitepress/cache/deps/vue.js.map +0 -7
- package/docs/.vitepress/config.ts +0 -32
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as ne, D as oe,
|
|
2
|
-
import { h as je, e as f, b as h, n as y, v as nt, o as Z, c as
|
|
3
|
-
import { u as ie,
|
|
1
|
+
import { t as ne, D as oe, l as Ie, n as ze, m as $e } from "./toc-BIj8uQ-W.js";
|
|
2
|
+
import { h as je, e as f, b as h, n as y, v as nt, o as Z, c as lt, p as vt, r as wt, d as ot, t as Pt, I as xt, g as Et, f as Ge, W as _e } from "./contentTypes-ChqPfcVI.js";
|
|
3
|
+
import { u as ie, s as Ue } from "./browser-xuRja-pP.js";
|
|
4
4
|
function Me() {
|
|
5
5
|
return { type: "row", children: [] };
|
|
6
6
|
}
|
|
@@ -125,21 +125,21 @@ function qe(t) {
|
|
|
125
125
|
const e = te(t).name;
|
|
126
126
|
return e.length > 0 && !Xe(e);
|
|
127
127
|
}
|
|
128
|
-
const re = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ae = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
128
|
+
const re = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ae = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], Ke = (t) => t.map((e) => ({ text: e.text, style: { ...e.style } })), Je = (t) => t && t !== "arabic" ? `:${t}` : "", Ze = (t) => t === "roman" ? " \\* roman" : t === "Roman" ? " \\* ROMAN" : t === "alpha" ? " \\* alphabetic" : t === "Alpha" ? " \\* ALPHABETIC" : "";
|
|
129
129
|
function ce(t, e) {
|
|
130
130
|
const n = (a, r = 2) => String(a).padStart(r, "0"), o = (t.getHours() + 11) % 12 + 1;
|
|
131
131
|
let i = "", s = 0;
|
|
132
132
|
for (; s < e.length; ) {
|
|
133
133
|
if (e[s] === "'") {
|
|
134
|
-
const
|
|
135
|
-
if (
|
|
134
|
+
const d = e.indexOf("'", s + 1);
|
|
135
|
+
if (d < 0) {
|
|
136
136
|
i += e.slice(s + 1);
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
|
-
i += e.slice(s + 1,
|
|
139
|
+
i += e.slice(s + 1, d), s = d + 1;
|
|
140
140
|
continue;
|
|
141
141
|
}
|
|
142
|
-
const a = e.slice(s), r = (
|
|
142
|
+
const a = e.slice(s), r = (d) => a.startsWith(d);
|
|
143
143
|
r("yyyy") ? (i += n(t.getFullYear(), 4), s += 4) : r("yy") ? (i += n(t.getFullYear() % 100), s += 2) : r("MMMM") ? (i += re[t.getMonth()], s += 4) : r("MMM") ? (i += re[t.getMonth()].slice(0, 3), s += 3) : r("MM") ? (i += n(t.getMonth() + 1), s += 2) : r("M") ? (i += String(t.getMonth() + 1), s += 1) : r("dddd") ? (i += ae[t.getDay()], s += 4) : r("ddd") ? (i += ae[t.getDay()].slice(0, 3), s += 3) : r("dd") ? (i += n(t.getDate()), s += 2) : r("d") ? (i += String(t.getDate()), s += 1) : r("HH") ? (i += n(t.getHours()), s += 2) : r("H") ? (i += String(t.getHours()), s += 1) : r("hh") ? (i += n(o), s += 2) : r("h") ? (i += String(o), s += 1) : r("mm") ? (i += n(t.getMinutes()), s += 2) : r("m") ? (i += String(t.getMinutes()), s += 1) : r("ss") ? (i += n(t.getSeconds()), s += 2) : r("s") ? (i += String(t.getSeconds()), s += 1) : r("AM/PM") ? (i += t.getHours() < 12 ? "AM" : "PM", s += 5) : r("am/pm") ? (i += t.getHours() < 12 ? "am" : "pm", s += 5) : (i += e[s], s += 1);
|
|
144
144
|
}
|
|
145
145
|
return i;
|
|
@@ -162,12 +162,12 @@ function Qe(t, e, n) {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
function tn(t) {
|
|
165
|
-
return
|
|
165
|
+
return Ke(Qe(t.operandA, t.op, t.operandB) ? t.trueRuns : t.falseRuns);
|
|
166
166
|
}
|
|
167
167
|
function jo(t, e, n) {
|
|
168
168
|
switch (t.type) {
|
|
169
169
|
case "PAGE":
|
|
170
|
-
return { kind: "token", token: `{page${
|
|
170
|
+
return { kind: "token", token: `{page${Je(t.numFmt)}}` };
|
|
171
171
|
case "NUMPAGES":
|
|
172
172
|
return { kind: "token", token: "{pages}" };
|
|
173
173
|
case "DATE":
|
|
@@ -179,29 +179,29 @@ function jo(t, e, n) {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
const en = /* @__PURE__ */ new Set(["=", "<>", "<", ">", "<=", ">="]);
|
|
182
|
-
function
|
|
182
|
+
function le(t) {
|
|
183
183
|
if (/\\\*\s*ROMAN\b/.test(t)) return "Roman";
|
|
184
184
|
if (/\\\*\s*roman\b/.test(t)) return "roman";
|
|
185
185
|
if (/\\\*\s*ALPHABETIC\b/.test(t)) return "Alpha";
|
|
186
186
|
if (/\\\*\s*alphabetic\b/.test(t)) return "alpha";
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function de(t) {
|
|
189
189
|
return t.match(/\\@\s*"([^"]*)"/)?.[1] ?? t.match(/\\@\s*(\S+)/)?.[1];
|
|
190
190
|
}
|
|
191
191
|
function nn(t, e) {
|
|
192
192
|
switch (t.name) {
|
|
193
193
|
case "PAGE": {
|
|
194
|
-
const n =
|
|
194
|
+
const n = le(t.raw);
|
|
195
195
|
return n ? { type: "PAGE", numFmt: n } : { type: "PAGE" };
|
|
196
196
|
}
|
|
197
197
|
case "NUMPAGES": {
|
|
198
|
-
const n =
|
|
198
|
+
const n = le(t.raw);
|
|
199
199
|
return n ? { type: "NUMPAGES", numFmt: n } : { type: "NUMPAGES" };
|
|
200
200
|
}
|
|
201
201
|
case "DATE":
|
|
202
|
-
return { type: "DATE", format:
|
|
202
|
+
return { type: "DATE", format: de(t.raw) ?? "M/d/yyyy" };
|
|
203
203
|
case "TIME":
|
|
204
|
-
return { type: "TIME", format:
|
|
204
|
+
return { type: "TIME", format: de(t.raw) ?? "h:mm AM/PM" };
|
|
205
205
|
case "IF": {
|
|
206
206
|
const [n, o, i, s, a] = t.args;
|
|
207
207
|
return n === void 0 || o === void 0 || i === void 0 || !en.has(o) ? void 0 : {
|
|
@@ -234,7 +234,7 @@ function Go(t) {
|
|
|
234
234
|
const Tt = (t) => {
|
|
235
235
|
const e = t.indexOf(":");
|
|
236
236
|
return e === -1 ? t : t.slice(e + 1);
|
|
237
|
-
},
|
|
237
|
+
}, dt = (t) => t.children.filter(je), gt = (t, e) => dt(t).find((n) => Tt(n.tagName) === e), _o = (t) => {
|
|
238
238
|
let e = "";
|
|
239
239
|
for (const n of t.children) typeof n == "string" && (e += n);
|
|
240
240
|
return e.trim();
|
|
@@ -245,7 +245,7 @@ const Tt = (t) => {
|
|
|
245
245
|
const n = gt(t, e);
|
|
246
246
|
if (n)
|
|
247
247
|
return Xt(n, "m:val") ?? Xt(n, "w:val") ?? "";
|
|
248
|
-
},
|
|
248
|
+
}, Kt = (t, e) => {
|
|
249
249
|
const n = gt(t, e);
|
|
250
250
|
if (!n) return !1;
|
|
251
251
|
const o = Xt(n, "m:val") ?? Xt(n, "w:val");
|
|
@@ -288,10 +288,10 @@ function rn(t, e) {
|
|
|
288
288
|
return t ? e ? { ...t, ...e } : t : e;
|
|
289
289
|
}
|
|
290
290
|
function an(t, e) {
|
|
291
|
-
const n = (
|
|
291
|
+
const n = (d, u, p) => (
|
|
292
292
|
// Cell edges are named directly; the table/style layers use the named edge
|
|
293
293
|
// on the boundary and the inside edge between cells.
|
|
294
|
-
t.cell?.[
|
|
294
|
+
t.cell?.[d] ?? t.table?.[p ? d : u] ?? t.style?.[p ? d : u]
|
|
295
295
|
), o = {}, i = ct(n("top", "insideH", e.top));
|
|
296
296
|
i && (o.top = i);
|
|
297
297
|
const s = ct(n("bottom", "insideH", e.bottom));
|
|
@@ -312,7 +312,7 @@ function cn(t) {
|
|
|
312
312
|
const s = ct(t.left);
|
|
313
313
|
return s && (e.left = s), Object.keys(e).length > 0 ? e : void 0;
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function ln(t) {
|
|
316
316
|
if (!t) return;
|
|
317
317
|
const e = {}, n = ct(t.top);
|
|
318
318
|
n && (e.top = n);
|
|
@@ -340,7 +340,7 @@ function Ae(t) {
|
|
|
340
340
|
const a = ct(t.between);
|
|
341
341
|
return a && (e.between = a), Object.keys(e).length > 0 ? e : void 0;
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function dn(t) {
|
|
344
344
|
return ct(t);
|
|
345
345
|
}
|
|
346
346
|
function ct(t) {
|
|
@@ -380,8 +380,8 @@ function St(t) {
|
|
|
380
380
|
const rt = h(r, "w:themeShade");
|
|
381
381
|
rt && (e.colorThemeShade = rt);
|
|
382
382
|
}
|
|
383
|
-
const
|
|
384
|
-
|
|
383
|
+
const d = y(f(t, "w:sz"), "w:val");
|
|
384
|
+
d !== void 0 && (e.sizeHalfPoints = d);
|
|
385
385
|
const u = y(f(t, "w:spacing"), "w:val");
|
|
386
386
|
u !== void 0 && (e.letterSpacingTwips = u);
|
|
387
387
|
const p = f(t, "w:rFonts");
|
|
@@ -403,8 +403,8 @@ function St(t) {
|
|
|
403
403
|
const it = h(p, "w:eastAsiaTheme");
|
|
404
404
|
it && (e.fontThemeEastAsia = it);
|
|
405
405
|
}
|
|
406
|
-
const
|
|
407
|
-
|
|
406
|
+
const l = nt(t, "w:highlight");
|
|
407
|
+
l && l !== "none" && (e.highlight = l);
|
|
408
408
|
const m = nt(t, "w:vertAlign");
|
|
409
409
|
m && (e.vertAlign = m);
|
|
410
410
|
const g = Z(f(t, "w:vanish"));
|
|
@@ -433,8 +433,8 @@ function St(t) {
|
|
|
433
433
|
$ && $ !== "none" && (e.emphasisMark = $);
|
|
434
434
|
const ft = Z(f(t, "w:outline"));
|
|
435
435
|
ft !== void 0 && (e.outline = ft);
|
|
436
|
-
const
|
|
437
|
-
|
|
436
|
+
const J = Z(f(t, "w:shadow"));
|
|
437
|
+
J !== void 0 && (e.shadow = J);
|
|
438
438
|
const U = Z(f(t, "w:emboss"));
|
|
439
439
|
U !== void 0 && (e.emboss = U);
|
|
440
440
|
const E = Z(f(t, "w:imprint"));
|
|
@@ -481,18 +481,18 @@ function Gt(t, e) {
|
|
|
481
481
|
const Q = y(r, "w:firstLine"), F = y(r, "w:hanging");
|
|
482
482
|
Q !== void 0 ? n.indentFirstLineTwips = Q : F !== void 0 && (n.indentFirstLineTwips = -F);
|
|
483
483
|
}
|
|
484
|
-
const
|
|
485
|
-
|
|
484
|
+
const d = Z(f(t, "w:keepNext"));
|
|
485
|
+
d !== void 0 && (n.keepWithNext = d);
|
|
486
486
|
const u = Z(f(t, "w:keepLines"));
|
|
487
487
|
u !== void 0 && (n.keepLinesTogether = u);
|
|
488
488
|
const p = Z(f(t, "w:contextualSpacing"));
|
|
489
489
|
p !== void 0 && (n.contextualSpacing = p);
|
|
490
|
-
const
|
|
491
|
-
|
|
490
|
+
const l = Z(f(t, "w:bidi"));
|
|
491
|
+
l !== void 0 && (n.direction = l ? "rtl" : "ltr");
|
|
492
492
|
const m = f(t, "w:tabs");
|
|
493
493
|
if (m) {
|
|
494
494
|
const E = [];
|
|
495
|
-
for (const q of
|
|
495
|
+
for (const q of lt(m, "w:tab")) {
|
|
496
496
|
const Q = y(q, "w:pos"), F = h(q, "w:val");
|
|
497
497
|
if (Q === void 0 || F === "clear" || F === "bar") continue;
|
|
498
498
|
const j = { posTwips: Q };
|
|
@@ -538,8 +538,8 @@ function Gt(t, e) {
|
|
|
538
538
|
$ !== void 0 && (n.mirrorIndents = $);
|
|
539
539
|
const ft = Z(f(t, "w:adjustRightInd"));
|
|
540
540
|
ft !== void 0 && (n.adjustRightInd = ft);
|
|
541
|
-
const
|
|
542
|
-
|
|
541
|
+
const J = f(t, "w:rPr");
|
|
542
|
+
J && (n.markRunProps = St(J));
|
|
543
543
|
const U = f(t, "w:sectPr");
|
|
544
544
|
if (U) {
|
|
545
545
|
const E = nt(U, "w:type");
|
|
@@ -559,7 +559,7 @@ function Gt(t, e) {
|
|
|
559
559
|
}
|
|
560
560
|
const rt = f(U, "w:cols");
|
|
561
561
|
if (rt) {
|
|
562
|
-
const ut =
|
|
562
|
+
const ut = lt(rt, "w:col"), it = y(rt, "w:num") ?? (ut.length > 1 ? ut.length : 1);
|
|
563
563
|
if (it > 1) {
|
|
564
564
|
n.sectionColumns = { count: it };
|
|
565
565
|
const mt = y(rt, "w:space");
|
|
@@ -588,7 +588,7 @@ function Gt(t, e) {
|
|
|
588
588
|
mt("top"), mt("right"), mt("bottom"), mt("left"), (it.top || it.right || it.bottom || it.left) && (n.sectionPgBorders = it);
|
|
589
589
|
}
|
|
590
590
|
const bt = y(f(U, "w:pgNumType"), "w:start");
|
|
591
|
-
bt !== void 0 && (n.sectionPageNumberStart = bt), (
|
|
591
|
+
bt !== void 0 && (n.sectionPageNumberStart = bt), (lt(U, "w:headerReference").length > 0 || lt(U, "w:footerReference").length > 0) && (n.sectionHasBands = !0);
|
|
592
592
|
}
|
|
593
593
|
return n;
|
|
594
594
|
}
|
|
@@ -610,12 +610,12 @@ function mn(t) {
|
|
|
610
610
|
if (i.tagName !== "w:comment") continue;
|
|
611
611
|
const s = h(i, "w:id");
|
|
612
612
|
if (s === void 0) continue;
|
|
613
|
-
const a = h(i, "w:author") || "Anonymous", r = h(i, "w:initials"),
|
|
613
|
+
const a = h(i, "w:author") || "Anonymous", r = h(i, "w:initials"), d = h(i, "w:date"), u = [];
|
|
614
614
|
let p;
|
|
615
|
-
for (const
|
|
616
|
-
if (
|
|
617
|
-
p || (p = h(
|
|
618
|
-
for (const m of ot(
|
|
615
|
+
for (const l of ot(i))
|
|
616
|
+
if (l.tagName === "w:p") {
|
|
617
|
+
p || (p = h(l, "w14:paraId"));
|
|
618
|
+
for (const m of ot(l)) {
|
|
619
619
|
if (m.tagName !== "w:r" || f(m, "w:annotationRef")) continue;
|
|
620
620
|
const g = f(m, "w:rPr"), v = g ? St(g) : {};
|
|
621
621
|
let P = "";
|
|
@@ -645,7 +645,7 @@ function mn(t) {
|
|
|
645
645
|
author: a,
|
|
646
646
|
runs: u,
|
|
647
647
|
...r !== void 0 ? { initials: r } : {},
|
|
648
|
-
...
|
|
648
|
+
...d !== void 0 ? { date: d } : {},
|
|
649
649
|
...p !== void 0 ? { paraId: p } : {}
|
|
650
650
|
});
|
|
651
651
|
}
|
|
@@ -658,10 +658,10 @@ function pn(t) {
|
|
|
658
658
|
if (i.tagName !== "w15:commentEx" && i.tagName !== "w:commentEx") continue;
|
|
659
659
|
const s = h(i, "w15:paraId") ?? h(i, "w:paraId");
|
|
660
660
|
if (!s) continue;
|
|
661
|
-
const a = h(i, "w15:paraIdParent") ?? h(i, "w:paraIdParent"), r = h(i, "w15:done") ?? h(i, "w:done"),
|
|
661
|
+
const a = h(i, "w15:paraIdParent") ?? h(i, "w:paraIdParent"), r = h(i, "w15:done") ?? h(i, "w:done"), d = r === "1" || r === "true";
|
|
662
662
|
e.set(s, {
|
|
663
663
|
paraId: s,
|
|
664
|
-
done:
|
|
664
|
+
done: d,
|
|
665
665
|
...a !== void 0 ? { paraIdParent: a } : {}
|
|
666
666
|
});
|
|
667
667
|
}
|
|
@@ -677,8 +677,8 @@ function hn(t, e, n, o) {
|
|
|
677
677
|
if (!u.paraId) continue;
|
|
678
678
|
const p = e.get(u.paraId);
|
|
679
679
|
if (p?.paraIdParent) {
|
|
680
|
-
const
|
|
681
|
-
|
|
680
|
+
const l = i.get(p.paraIdParent);
|
|
681
|
+
l && l.id !== u.id && s.set(u.id, l.id);
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
684
|
const a = /* @__PURE__ */ new Map(), r = [];
|
|
@@ -689,32 +689,32 @@ function hn(t, e, n, o) {
|
|
|
689
689
|
a.get(u).push(m);
|
|
690
690
|
}
|
|
691
691
|
for (const [u, p] of t) {
|
|
692
|
-
const
|
|
693
|
-
if (
|
|
694
|
-
let m =
|
|
692
|
+
const l = s.get(u);
|
|
693
|
+
if (l) {
|
|
694
|
+
let m = l;
|
|
695
695
|
for (; s.has(m); )
|
|
696
696
|
m = s.get(m);
|
|
697
697
|
a.has(m) || (a.set(m, []), r.push(m)), a.get(m).push(fe(p));
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
|
-
const
|
|
700
|
+
const d = [];
|
|
701
701
|
for (const u of r) {
|
|
702
702
|
const p = a.get(u);
|
|
703
703
|
if (!p || p.length === 0) continue;
|
|
704
|
-
const
|
|
705
|
-
v &&
|
|
704
|
+
const l = t.get(u), g = (l?.paraId ? e.get(l.paraId) : void 0)?.done ? "resolved" : "open", v = n.get(u) ?? o;
|
|
705
|
+
v && d.push({
|
|
706
706
|
id: Ie(),
|
|
707
707
|
anchor: v,
|
|
708
708
|
status: g,
|
|
709
709
|
comments: p
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
|
-
if (
|
|
712
|
+
if (d.length !== 0)
|
|
713
713
|
return {
|
|
714
714
|
docId: "imported",
|
|
715
715
|
baseVersion: 0,
|
|
716
716
|
suggestions: [],
|
|
717
|
-
threads:
|
|
717
|
+
threads: d
|
|
718
718
|
};
|
|
719
719
|
}
|
|
720
720
|
function fe(t) {
|
|
@@ -737,15 +737,15 @@ function fe(t) {
|
|
|
737
737
|
}
|
|
738
738
|
function Ee(t) {
|
|
739
739
|
const e = Tt(t.tagName) === "oMathPara" ? gt(t, "oMath") ?? t : t;
|
|
740
|
-
return yt(
|
|
740
|
+
return yt(dt(e));
|
|
741
741
|
}
|
|
742
742
|
const gn = /^[^\p{L}\p{N}\s]+$/u, wn = (t) => Tt(t.tagName).endsWith("Pr");
|
|
743
743
|
function yt(t) {
|
|
744
744
|
return { type: "row", children: t.filter((e) => !wn(e)).map(Tn) };
|
|
745
745
|
}
|
|
746
|
-
function
|
|
746
|
+
function K(t, e) {
|
|
747
747
|
const n = gt(t, e);
|
|
748
|
-
return n ? yt(
|
|
748
|
+
return n ? yt(dt(n)) : Me();
|
|
749
749
|
}
|
|
750
750
|
function ue(t) {
|
|
751
751
|
return t.type === "row" && t.children.length === 1 ? t.children[0] : void 0;
|
|
@@ -760,7 +760,7 @@ function bn(t, e) {
|
|
|
760
760
|
}
|
|
761
761
|
function kn(t) {
|
|
762
762
|
let e = "";
|
|
763
|
-
for (const n of
|
|
763
|
+
for (const n of dt(t))
|
|
764
764
|
if (Tt(n.tagName) === "t")
|
|
765
765
|
for (const o of n.children) typeof o == "string" && (e += o);
|
|
766
766
|
return e;
|
|
@@ -820,37 +820,37 @@ function Tn(t) {
|
|
|
820
820
|
case "lim":
|
|
821
821
|
case "deg":
|
|
822
822
|
case "fName":
|
|
823
|
-
return yt(
|
|
823
|
+
return yt(dt(t));
|
|
824
824
|
case "r":
|
|
825
825
|
return yn(t);
|
|
826
826
|
case "f": {
|
|
827
827
|
const e = gt(t, "fPr"), n = e ? kt(e, "type") : void 0;
|
|
828
828
|
return {
|
|
829
829
|
type: "frac",
|
|
830
|
-
num:
|
|
831
|
-
den:
|
|
830
|
+
num: K(t, "num"),
|
|
831
|
+
den: K(t, "den"),
|
|
832
832
|
...n === "skw" ? { bevelled: !0 } : {},
|
|
833
833
|
...n === "noBar" || n === "lin" ? { thickness: "0" } : {}
|
|
834
834
|
};
|
|
835
835
|
}
|
|
836
836
|
case "sSup":
|
|
837
|
-
return { type: "script", base:
|
|
837
|
+
return { type: "script", base: K(t, "e"), sup: K(t, "sup") };
|
|
838
838
|
case "sSub":
|
|
839
|
-
return { type: "script", base:
|
|
839
|
+
return { type: "script", base: K(t, "e"), sub: K(t, "sub") };
|
|
840
840
|
case "sSubSup":
|
|
841
|
-
return { type: "script", base:
|
|
841
|
+
return { type: "script", base: K(t, "e"), sub: K(t, "sub"), sup: K(t, "sup") };
|
|
842
842
|
case "sPre":
|
|
843
|
-
return { type: "script", base:
|
|
843
|
+
return { type: "script", base: K(t, "e"), sub: K(t, "sub"), sup: K(t, "sup") };
|
|
844
844
|
case "rad": {
|
|
845
|
-
const e = gt(t, "radPr"), n = e ?
|
|
845
|
+
const e = gt(t, "radPr"), n = e ? Kt(e, "degHide") : !1, o = gt(t, "deg"), i = !n && o !== void 0 && dt(o).length > 0;
|
|
846
846
|
return {
|
|
847
847
|
type: "radical",
|
|
848
|
-
radicand:
|
|
849
|
-
...i ? { index:
|
|
848
|
+
radicand: K(t, "e"),
|
|
849
|
+
...i ? { index: K(t, "deg") } : {}
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
852
|
case "d": {
|
|
853
|
-
const e = gt(t, "dPr"), n = e ? kt(e, "begChr") : void 0, o = e ? kt(e, "endChr") : void 0, i = e ? kt(e, "sepChr") : void 0, s =
|
|
853
|
+
const e = gt(t, "dPr"), n = e ? kt(e, "begChr") : void 0, o = e ? kt(e, "endChr") : void 0, i = e ? kt(e, "sepChr") : void 0, s = dt(t).filter((r) => Tt(r.tagName) === "e").map((r) => yt(dt(r))), a = s.length <= 1 ? s[0] ?? Me() : { type: "row", children: bn(s, i) };
|
|
854
854
|
return {
|
|
855
855
|
type: "fenced",
|
|
856
856
|
open: n ?? "(",
|
|
@@ -859,54 +859,54 @@ function Tn(t) {
|
|
|
859
859
|
};
|
|
860
860
|
}
|
|
861
861
|
case "nary": {
|
|
862
|
-
const e = gt(t, "naryPr"), n = (e ? kt(e, "chr") : void 0) ?? "∫", o = e ?
|
|
862
|
+
const e = gt(t, "naryPr"), n = (e ? kt(e, "chr") : void 0) ?? "∫", o = e ? Kt(e, "subHide") : !1, i = e ? Kt(e, "supHide") : !1, s = gt(t, "sub"), a = gt(t, "sup"), r = !o && s && dt(s).length > 0 ? yt(dt(s)) : void 0, d = !i && a && dt(a).length > 0 ? yt(dt(a)) : void 0;
|
|
863
863
|
return {
|
|
864
864
|
type: "nary",
|
|
865
865
|
op: n,
|
|
866
866
|
...r ? { sub: r } : {},
|
|
867
|
-
...
|
|
868
|
-
body:
|
|
867
|
+
...d ? { sup: d } : {},
|
|
868
|
+
body: K(t, "e")
|
|
869
869
|
};
|
|
870
870
|
}
|
|
871
871
|
case "limLow": {
|
|
872
|
-
const e =
|
|
872
|
+
const e = K(t, "e"), n = K(t, "lim"), o = ue(e);
|
|
873
873
|
return o && o.type === "limit" && o.over && !o.under && !o.accent ? { type: "limit", base: o.base, under: n, over: o.over } : { type: "limit", base: e, under: n };
|
|
874
874
|
}
|
|
875
875
|
case "limUpp": {
|
|
876
|
-
const e =
|
|
876
|
+
const e = K(t, "e"), n = K(t, "lim"), o = ue(e);
|
|
877
877
|
return o && o.type === "limit" && o.under && !o.over && !o.accent ? { type: "limit", base: o.base, under: o.under, over: n } : { type: "limit", base: e, over: n };
|
|
878
878
|
}
|
|
879
879
|
case "acc": {
|
|
880
880
|
const e = gt(t, "accPr"), n = (e ? kt(e, "chr") : void 0) ?? "̂";
|
|
881
|
-
return { type: "limit", base:
|
|
881
|
+
return { type: "limit", base: K(t, "e"), over: { type: "op", text: n }, accent: !0 };
|
|
882
882
|
}
|
|
883
883
|
case "bar": {
|
|
884
884
|
const e = gt(t, "barPr"), n = e ? kt(e, "pos") : "top", o = { type: "op", text: n === "bot" ? "_" : "‾", stretchy: !0 };
|
|
885
|
-
return n === "bot" ? { type: "limit", base:
|
|
885
|
+
return n === "bot" ? { type: "limit", base: K(t, "e"), under: o } : { type: "limit", base: K(t, "e"), over: o };
|
|
886
886
|
}
|
|
887
887
|
case "groupChr": {
|
|
888
888
|
const e = gt(t, "groupChrPr"), n = (e ? kt(e, "chr") : void 0) ?? "⏟", o = e ? kt(e, "pos") : "bot", i = { type: "op", text: n, stretchy: !0 };
|
|
889
|
-
return o === "top" ? { type: "limit", base:
|
|
889
|
+
return o === "top" ? { type: "limit", base: K(t, "e"), over: i } : { type: "limit", base: K(t, "e"), under: i };
|
|
890
890
|
}
|
|
891
891
|
case "func":
|
|
892
|
-
return { type: "row", children: [
|
|
892
|
+
return { type: "row", children: [K(t, "fName"), K(t, "e")] };
|
|
893
893
|
case "phant":
|
|
894
|
-
return { type: "phantom", child:
|
|
894
|
+
return { type: "phantom", child: K(t, "e") };
|
|
895
895
|
case "box":
|
|
896
896
|
case "borderBox":
|
|
897
|
-
return
|
|
897
|
+
return K(t, "e");
|
|
898
898
|
case "eqArr":
|
|
899
|
-
return { type: "matrix", rows:
|
|
899
|
+
return { type: "matrix", rows: dt(t).filter((n) => Tt(n.tagName) === "e").map((n) => [yt(dt(n))]) };
|
|
900
900
|
case "m":
|
|
901
901
|
return Sn(t);
|
|
902
902
|
default:
|
|
903
|
-
return
|
|
903
|
+
return dt(t).length ? yt(dt(t)) : { type: "unknown" };
|
|
904
904
|
}
|
|
905
905
|
}
|
|
906
906
|
function Sn(t) {
|
|
907
907
|
const e = [];
|
|
908
|
-
for (const n of
|
|
909
|
-
Tt(n.tagName) === "mr" && e.push(
|
|
908
|
+
for (const n of dt(t))
|
|
909
|
+
Tt(n.tagName) === "mr" && e.push(dt(n).filter((o) => Tt(o.tagName) === "e").map((o) => yt(dt(o))));
|
|
910
910
|
return { type: "matrix", rows: e };
|
|
911
911
|
}
|
|
912
912
|
const qt = () => ({ depth: 0, topInstr: "", openId: null, markBlock: null, next: { n: 0 }, registry: {} });
|
|
@@ -928,7 +928,7 @@ function Pn(t, e, n) {
|
|
|
928
928
|
throw new xt("MALFORMED_XML", `${e} has no w:document/w:body root.`);
|
|
929
929
|
const s = {}, a = { warnings: n, fieldTokens: !1, sdts: s, nextSdt: { n: 0 }, blockSdtStack: [], inlineSdtStack: [], pendingBookmarks: [], currentBookmarks: null, pendingMarkers: [], currentMarkers: null, pendingCommentMarkers: [], currentCommentMarkers: null, trackFields: !0, fieldTrack: qt() }, r = [];
|
|
930
930
|
It(ot(i), r, a);
|
|
931
|
-
const
|
|
931
|
+
const d = f(i, "w:sectPr"), u = d ? Vn(d) : null, p = o ? f(o, "w:background") : void 0, l = p ? h(p, "w:color") : void 0, m = l && l !== "auto" ? l : void 0, g = a.fieldTrack.registry, v = Object.keys(g).length > 0 ? { blocks: r, section: u, sdts: s, fields: g } : { blocks: r, section: u, sdts: s };
|
|
932
932
|
return m && (v.pageColorHex = m), v;
|
|
933
933
|
}
|
|
934
934
|
function In(t, e, n, o = {}) {
|
|
@@ -1007,10 +1007,10 @@ function xn(t, e) {
|
|
|
1007
1007
|
e.pendingMarkers = [], e.currentMarkers = a;
|
|
1008
1008
|
const r = e.pendingCommentMarkers;
|
|
1009
1009
|
e.pendingCommentMarkers = [], e.currentCommentMarkers = r;
|
|
1010
|
-
const
|
|
1011
|
-
At(ot(t), i, e,
|
|
1010
|
+
const d = { depth: 0, instr: "", suppressResult: !1 };
|
|
1011
|
+
At(ot(t), i, e, d), e.currentBookmarks = null, e.currentMarkers = null, e.currentCommentMarkers = null;
|
|
1012
1012
|
const u = { kind: "paragraph", props: o, inlines: i };
|
|
1013
|
-
return s.length > 0 && (u.bookmarks = s), a.length > 0 && (u.bookmarkMarkers = a), r.length > 0 && (u.commentMarkers = r),
|
|
1013
|
+
return s.length > 0 && (u.bookmarks = s), a.length > 0 && (u.bookmarkMarkers = a), r.length > 0 && (u.commentMarkers = r), d.tocInstr !== void 0 && (u.tocField = d.tocInstr), u;
|
|
1014
1014
|
}
|
|
1015
1015
|
const En = /* @__PURE__ */ new Set(["PAGE", "NUMPAGES", "DATE", "TIME", "IF"]), Rn = { fontFamily: "", fontSizePx: 16, bold: !1, italic: !1, underline: !1, strikethrough: !1, color: "#000000" };
|
|
1016
1016
|
function Cn(t) {
|
|
@@ -1033,8 +1033,8 @@ function At(t, e, n, o) {
|
|
|
1033
1033
|
case "w:hyperlink": {
|
|
1034
1034
|
const s = h(i, "r:id"), a = h(i, "w:anchor"), r = e.length;
|
|
1035
1035
|
if (At(ot(i), e, n, o), s || a)
|
|
1036
|
-
for (let
|
|
1037
|
-
const u = e[
|
|
1036
|
+
for (let d = r; d < e.length; d++) {
|
|
1037
|
+
const u = e[d], p = u.kind === "run" ? u.props : u.kind === "mathInline" ? u.props ??= {} : void 0;
|
|
1038
1038
|
p && (s ? p.linkRelId = s : a && (p.linkAnchor = a));
|
|
1039
1039
|
}
|
|
1040
1040
|
break;
|
|
@@ -1099,17 +1099,17 @@ function Bn(t) {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
function Nn(t, e, n, o) {
|
|
1101
1101
|
const i = f(t, "w:rPr"), s = i ? St(i) : {}, a = e.length, r = n.inlineSdtStack.length ? [...n.inlineSdtStack] : void 0;
|
|
1102
|
-
let
|
|
1102
|
+
let d = "";
|
|
1103
1103
|
const u = () => {
|
|
1104
|
-
|
|
1105
|
-
}, p = (
|
|
1106
|
-
for (const m of
|
|
1104
|
+
d.length > 0 && (o.pagerefAnchor && s.linkAnchor === void 0 && s.linkRelId === void 0 && (s.linkAnchor = o.pagerefAnchor), e.push({ kind: "run", text: d, props: s, ...o.resultFieldId ? { fieldId: o.resultFieldId } : {} })), d = "";
|
|
1105
|
+
}, p = (l) => {
|
|
1106
|
+
for (const m of l)
|
|
1107
1107
|
switch (m.tagName) {
|
|
1108
1108
|
case "w:t":
|
|
1109
|
-
o.suppressResult || (
|
|
1109
|
+
o.suppressResult || (d += Pt(m));
|
|
1110
1110
|
break;
|
|
1111
1111
|
case "w:tab":
|
|
1112
|
-
o.suppressResult || (
|
|
1112
|
+
o.suppressResult || (d += " ");
|
|
1113
1113
|
break;
|
|
1114
1114
|
case "w:br": {
|
|
1115
1115
|
u();
|
|
@@ -1121,11 +1121,11 @@ function Nn(t, e, n, o) {
|
|
|
1121
1121
|
u(), e.push({ kind: "break" });
|
|
1122
1122
|
break;
|
|
1123
1123
|
case "w:noBreakHyphen":
|
|
1124
|
-
|
|
1124
|
+
d += "‑";
|
|
1125
1125
|
break;
|
|
1126
1126
|
case "w:commentReference": {
|
|
1127
1127
|
const g = h(m, "w:id");
|
|
1128
|
-
g && n.currentCommentMarkers && n.currentCommentMarkers.push({ id: g, kind: "ref", offset: Mt(e) +
|
|
1128
|
+
g && n.currentCommentMarkers && n.currentCommentMarkers.push({ id: g, kind: "ref", offset: Mt(e) + d.length });
|
|
1129
1129
|
break;
|
|
1130
1130
|
}
|
|
1131
1131
|
case "w:sym": {
|
|
@@ -1184,8 +1184,8 @@ function Nn(t, e, n, o) {
|
|
|
1184
1184
|
}
|
|
1185
1185
|
};
|
|
1186
1186
|
if (p(ot(t)), u(), r)
|
|
1187
|
-
for (let
|
|
1188
|
-
const m = e[
|
|
1187
|
+
for (let l = a; l < e.length; l++) {
|
|
1188
|
+
const m = e[l];
|
|
1189
1189
|
m.kind === "run" && (m.sdtPath = r);
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
@@ -1200,10 +1200,10 @@ function Ln(t, e, n, o, i) {
|
|
|
1200
1200
|
if (o.trackFields) {
|
|
1201
1201
|
const r = te(i.instr);
|
|
1202
1202
|
if (En.has(r.name)) {
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1203
|
+
const d = nn(r, Rn);
|
|
1204
|
+
if (d) {
|
|
1205
1205
|
const u = `field${s.next.n++}`;
|
|
1206
|
-
s.registry[u] = { id: u, instruction: i.instr, name: r.name, kind: "builtin", spec:
|
|
1206
|
+
s.registry[u] = { id: u, instruction: i.instr, name: r.name, kind: "builtin", spec: d }, d.type === "PAGE" || d.type === "NUMPAGES" ? (n.push({ kind: "run", text: Cn(d), props: e, fieldId: u }), i.suppressResult = !0) : i.resultFieldId = u;
|
|
1207
1207
|
break;
|
|
1208
1208
|
}
|
|
1209
1209
|
}
|
|
@@ -1235,21 +1235,21 @@ function Hn(t, e) {
|
|
|
1235
1235
|
e.warnings.add("images-skipped", "A drawing without an embedded image reference was skipped.");
|
|
1236
1236
|
return;
|
|
1237
1237
|
}
|
|
1238
|
-
const a = f(o, "wp:extent"), r = { kind: "image", relId: s, anchored: !!n },
|
|
1239
|
-
|
|
1238
|
+
const a = f(o, "wp:extent"), r = { kind: "image", relId: s, anchored: !!n }, d = y(a, "cx");
|
|
1239
|
+
d !== void 0 && (r.widthEmu = d);
|
|
1240
1240
|
const u = y(a, "cy");
|
|
1241
1241
|
u !== void 0 && (r.heightEmu = u);
|
|
1242
1242
|
const p = Et(o, "a:srcRect");
|
|
1243
1243
|
if (p) {
|
|
1244
|
-
const
|
|
1244
|
+
const l = (g) => {
|
|
1245
1245
|
const v = y(p, g);
|
|
1246
1246
|
return v !== void 0 && Number.isFinite(v) ? v / 1e5 : 0;
|
|
1247
|
-
}, m = { left:
|
|
1247
|
+
}, m = { left: l("l"), top: l("t"), right: l("r"), bottom: l("b") };
|
|
1248
1248
|
(m.left || m.top || m.right || m.bottom) && m.left + m.right < 1 && m.top + m.bottom < 1 && (r.crop = m);
|
|
1249
1249
|
}
|
|
1250
1250
|
if (n) {
|
|
1251
|
-
const
|
|
1252
|
-
r.anchorWrap =
|
|
1251
|
+
const l = f(n, "wp:wrapSquare") ?? f(n, "wp:wrapTight") ?? f(n, "wp:wrapThrough"), m = f(n, "wp:wrapNone");
|
|
1252
|
+
r.anchorWrap = l ? "square" : "block";
|
|
1253
1253
|
const g = f(n, "wp:positionH"), v = f(n, "wp:positionV"), P = g && f(g, "wp:align"), T = P && Pt(P);
|
|
1254
1254
|
if ((T === "left" || T === "right" || T === "center") && (r.anchorAlign = T), m) {
|
|
1255
1255
|
const N = Et(n, "adec:decorative"), L = y(n, "relativeHeight");
|
|
@@ -1262,7 +1262,7 @@ function Hn(t, e) {
|
|
|
1262
1262
|
decorative: !!N && h(N, "val") !== "0",
|
|
1263
1263
|
...L !== void 0 ? { z: L } : {}
|
|
1264
1264
|
};
|
|
1265
|
-
} else
|
|
1265
|
+
} else l || e.warnings.add(
|
|
1266
1266
|
"images-anchored",
|
|
1267
1267
|
"Some floating images (overlapping or top-and-bottom wrap) were placed in the text flow."
|
|
1268
1268
|
);
|
|
@@ -1289,10 +1289,10 @@ function jn(t, e) {
|
|
|
1289
1289
|
return;
|
|
1290
1290
|
}
|
|
1291
1291
|
const i = { kind: "image", relId: o, anchored: !1 }, s = Et(t, "v:shape"), a = (s && h(s, "style")) ?? "", r = (p) => {
|
|
1292
|
-
const
|
|
1293
|
-
return
|
|
1294
|
-
},
|
|
1295
|
-
|
|
1292
|
+
const l = a.match(new RegExp(`(?:^|;)\\s*${p}:([\\d.]+)pt`));
|
|
1293
|
+
return l ? Number(l[1]) * 12700 : void 0;
|
|
1294
|
+
}, d = r("width");
|
|
1295
|
+
d !== void 0 && (i.widthEmu = d);
|
|
1296
1296
|
const u = r("height");
|
|
1297
1297
|
return u !== void 0 && (i.heightEmu = u), i;
|
|
1298
1298
|
}
|
|
@@ -1318,16 +1318,16 @@ function Gn(t) {
|
|
|
1318
1318
|
}
|
|
1319
1319
|
function _n(t, e) {
|
|
1320
1320
|
const n = [];
|
|
1321
|
-
for (const a of
|
|
1321
|
+
for (const a of lt(t, "w:tr")) {
|
|
1322
1322
|
const r = [];
|
|
1323
|
-
for (const p of
|
|
1323
|
+
for (const p of lt(a, "w:tc"))
|
|
1324
1324
|
r.push(Un(p, e));
|
|
1325
|
-
const
|
|
1326
|
-
u && (
|
|
1325
|
+
const d = { cells: r }, u = Gn(f(a, "w:trPr"));
|
|
1326
|
+
u && (d.props = u), n.push(d);
|
|
1327
1327
|
}
|
|
1328
1328
|
const o = { kind: "table", rows: n }, i = f(t, "w:tblGrid");
|
|
1329
1329
|
if (i) {
|
|
1330
|
-
const a =
|
|
1330
|
+
const a = lt(i, "w:gridCol").map((r) => y(r, "w:w")).filter((r) => r !== void 0 && r > 0);
|
|
1331
1331
|
a.length > 0 && (o.colWidthsTwips = a);
|
|
1332
1332
|
}
|
|
1333
1333
|
const s = f(t, "w:tblPr");
|
|
@@ -1336,34 +1336,34 @@ function _n(t, e) {
|
|
|
1336
1336
|
a && (o.styleId = a);
|
|
1337
1337
|
const r = f(s, "w:tblLook");
|
|
1338
1338
|
if (r) {
|
|
1339
|
-
const
|
|
1339
|
+
const J = (U) => {
|
|
1340
1340
|
const E = h(r, U);
|
|
1341
1341
|
return E === "1" || E === "true";
|
|
1342
1342
|
};
|
|
1343
1343
|
o.look = {
|
|
1344
|
-
firstRow:
|
|
1345
|
-
lastRow:
|
|
1346
|
-
firstCol:
|
|
1347
|
-
lastCol:
|
|
1348
|
-
bandRows: !
|
|
1349
|
-
bandCols: !
|
|
1344
|
+
firstRow: J("w:firstRow"),
|
|
1345
|
+
lastRow: J("w:lastRow"),
|
|
1346
|
+
firstCol: J("w:firstColumn"),
|
|
1347
|
+
lastCol: J("w:lastColumn"),
|
|
1348
|
+
bandRows: !J("w:noHBand"),
|
|
1349
|
+
bandCols: !J("w:noVBand")
|
|
1350
1350
|
};
|
|
1351
1351
|
}
|
|
1352
1352
|
f(s, "w:tblBorders") && (o.bordersSpecified = !0);
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1353
|
+
const d = Yt(f(s, "w:tblBorders"));
|
|
1354
|
+
d && (o.borders = d);
|
|
1355
1355
|
const u = Nt(f(s, "w:shd"));
|
|
1356
1356
|
u && (o.shd = u);
|
|
1357
1357
|
const p = Ce(f(s, "w:tblCellMar"));
|
|
1358
1358
|
p && (o.cellMarginTwips = p);
|
|
1359
|
-
const
|
|
1359
|
+
const l = f(s, "w:tblLayout"), m = l ? h(l, "w:type") : void 0, g = f(s, "w:tblW"), v = g && h(g, "w:type"), P = g ? y(g, "w:w") : void 0, T = v === "pct" && (P ?? 0) > 0;
|
|
1360
1360
|
m === "autofit" ? o.widthMode = T ? "autofitWindow" : "autofitContents" : m !== "fixed" && T && (o.widthMode = "autofitWindow"), o.widthMode || (v === "dxa" && P !== void 0 && P > 0 ? o.preferredWidthTwips = P : T && m === "fixed" && (o.preferredWidthPct = (P ?? 0) / 50));
|
|
1361
1361
|
const N = f(s, "w:jc"), L = N ? h(N, "w:val") : void 0;
|
|
1362
1362
|
L === "center" ? o.align = "center" : (L === "right" || L === "end") && (o.align = "right");
|
|
1363
1363
|
const x = f(s, "w:tblInd");
|
|
1364
1364
|
if (x) {
|
|
1365
|
-
const
|
|
1366
|
-
U !== void 0 && U !== 0 && (
|
|
1365
|
+
const J = h(x, "w:type"), U = y(x, "w:w");
|
|
1366
|
+
U !== void 0 && U !== 0 && (J === "dxa" || J === void 0) && (o.indentTwips = U);
|
|
1367
1367
|
}
|
|
1368
1368
|
Z(f(s, "w:bidiVisual")) && (o.bidiVisual = !0);
|
|
1369
1369
|
const tt = nt(s, "w:tblOverlap");
|
|
@@ -1378,26 +1378,26 @@ function _n(t, e) {
|
|
|
1378
1378
|
function Un(t, e) {
|
|
1379
1379
|
const n = f(t, "w:tcPr"), o = (n && y(f(n, "w:gridSpan"), "w:val")) ?? 1, i = n && f(n, "w:vMerge"), s = !!i && (h(i, "w:val") ?? "continue") === "continue", a = [], r = e.blockSdtStack;
|
|
1380
1380
|
e.blockSdtStack = [], It(ot(t), a, e), e.blockSdtStack = r;
|
|
1381
|
-
const
|
|
1381
|
+
const d = { blocks: a, gridSpan: o, vMergeContinue: s };
|
|
1382
1382
|
if (n) {
|
|
1383
|
-
f(n, "w:tcBorders") && (
|
|
1383
|
+
f(n, "w:tcBorders") && (d.bordersSpecified = !0);
|
|
1384
1384
|
const u = Yt(f(n, "w:tcBorders"));
|
|
1385
|
-
u && (
|
|
1385
|
+
u && (d.borders = u);
|
|
1386
1386
|
const p = Nt(f(n, "w:shd"));
|
|
1387
|
-
p && (
|
|
1388
|
-
const
|
|
1389
|
-
|
|
1387
|
+
p && (d.shd = p);
|
|
1388
|
+
const l = Ce(f(n, "w:tcMar"));
|
|
1389
|
+
l && (d.marginTwips = l);
|
|
1390
1390
|
const m = f(n, "w:tcW"), g = m ? y(m, "w:w") : void 0;
|
|
1391
1391
|
if (m && g !== void 0 && g > 0) {
|
|
1392
1392
|
const N = h(m, "w:type");
|
|
1393
|
-
N === "pct" ?
|
|
1393
|
+
N === "pct" ? d.preferredWidth = { type: "pct", frac: g / 5e3 } : (N === "dxa" || N === void 0) && (d.preferredWidth = { type: "abs", twips: g });
|
|
1394
1394
|
}
|
|
1395
1395
|
const v = f(n, "w:vAlign"), P = v && h(v, "w:val");
|
|
1396
|
-
(P === "center" || P === "bottom") && (
|
|
1396
|
+
(P === "center" || P === "bottom") && (d.vAlign = P);
|
|
1397
1397
|
const T = nt(n, "w:textDirection");
|
|
1398
|
-
(T === "tbRl" || T === "btLr" || T === "lrTbV" || T === "tbRlV" || T === "tbLrV") && (
|
|
1398
|
+
(T === "tbRl" || T === "btLr" || T === "lrTbV" || T === "tbRlV" || T === "tbLrV") && (d.textDirection = T), Z(f(n, "w:noWrap")) && (d.noWrap = !0), Z(f(n, "w:tcFitText")) && (d.fitText = !0), Z(f(n, "w:hideMark")) && (d.hideMark = !0);
|
|
1399
1399
|
}
|
|
1400
|
-
return
|
|
1400
|
+
return d;
|
|
1401
1401
|
}
|
|
1402
1402
|
function Fe(t) {
|
|
1403
1403
|
if (!t) return null;
|
|
@@ -1406,20 +1406,20 @@ function Fe(t) {
|
|
|
1406
1406
|
const i = f(t, "w:tag"), s = i && h(i, "w:val");
|
|
1407
1407
|
s && (e.tag = s), f(t, "w:text") && (e.type = "plainText");
|
|
1408
1408
|
const a = f(t, "w:dropDownList") ?? f(t, "w:comboBox");
|
|
1409
|
-
a && (e.type = a.tagName === "w:dropDownList" ? "dropDown" : "comboBox", e.listItems =
|
|
1410
|
-
display: h(
|
|
1411
|
-
value: h(
|
|
1409
|
+
a && (e.type = a.tagName === "w:dropDownList" ? "dropDown" : "comboBox", e.listItems = lt(a, "w:listItem").map((l) => ({
|
|
1410
|
+
display: h(l, "w:displayText") ?? h(l, "w:value") ?? "",
|
|
1411
|
+
value: h(l, "w:value") ?? h(l, "w:displayText") ?? ""
|
|
1412
1412
|
})));
|
|
1413
1413
|
const r = f(t, "w:date");
|
|
1414
1414
|
if (r) {
|
|
1415
1415
|
e.type = "date";
|
|
1416
|
-
const
|
|
1416
|
+
const l = f(r, "w:dateFormat"), m = l && h(l, "w:val");
|
|
1417
1417
|
m && (e.dateFormat = m);
|
|
1418
1418
|
}
|
|
1419
|
-
const
|
|
1420
|
-
if (
|
|
1419
|
+
const d = f(t, "w14:checkbox");
|
|
1420
|
+
if (d) {
|
|
1421
1421
|
e.type = "checkbox";
|
|
1422
|
-
const
|
|
1422
|
+
const l = f(d, "w14:checked"), m = l && h(l, "w14:val");
|
|
1423
1423
|
e.checked = m === "1" || m === "true";
|
|
1424
1424
|
}
|
|
1425
1425
|
f(t, "w:showingPlcHdr") && (e.placeholder = !0);
|
|
@@ -1440,13 +1440,13 @@ function Vn(t, e) {
|
|
|
1440
1440
|
const x = y(a, "w:footer");
|
|
1441
1441
|
x !== void 0 && (n.footerDistTwips = x);
|
|
1442
1442
|
}
|
|
1443
|
-
const r = ge(
|
|
1443
|
+
const r = ge(lt(t, "w:headerReference"));
|
|
1444
1444
|
r && (n.headerRefs = r);
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1445
|
+
const d = ge(lt(t, "w:footerReference"));
|
|
1446
|
+
d && (n.footerRefs = d), f(t, "w:titlePg") && (n.titlePg = !0);
|
|
1447
1447
|
const u = f(t, "w:cols");
|
|
1448
1448
|
if (u) {
|
|
1449
|
-
const v =
|
|
1449
|
+
const v = lt(u, "w:col"), P = y(u, "w:num") ?? (v.length > 1 ? v.length : 1);
|
|
1450
1450
|
if (P > 1) {
|
|
1451
1451
|
n.columns = { count: P };
|
|
1452
1452
|
const T = y(u, "w:space");
|
|
@@ -1476,8 +1476,8 @@ function Vn(t, e) {
|
|
|
1476
1476
|
};
|
|
1477
1477
|
T("top"), T("right"), T("bottom"), T("left"), (P.top || P.right || P.bottom || P.left) && (n.pageBorders = P);
|
|
1478
1478
|
}
|
|
1479
|
-
const
|
|
1480
|
-
|
|
1479
|
+
const l = y(f(t, "w:pgNumType"), "w:start");
|
|
1480
|
+
l !== void 0 && (n.pageNumberStart = l);
|
|
1481
1481
|
const m = xe(f(t, "w:lnNumType"));
|
|
1482
1482
|
m && (n.lineNumbering = m);
|
|
1483
1483
|
const g = nt(t, "w:type");
|
|
@@ -1513,11 +1513,11 @@ function Xn(t, e, n, o = {}) {
|
|
|
1513
1513
|
trackFields: !1,
|
|
1514
1514
|
fieldTrack: qt()
|
|
1515
1515
|
};
|
|
1516
|
-
for (const r of
|
|
1517
|
-
const
|
|
1518
|
-
if (
|
|
1516
|
+
for (const r of lt(s, "w:footnote")) {
|
|
1517
|
+
const d = h(r, "w:id");
|
|
1518
|
+
if (d === void 0 || h(r, "w:type")) continue;
|
|
1519
1519
|
const p = [];
|
|
1520
|
-
It(ot(r), p, a), i.set(
|
|
1520
|
+
It(ot(r), p, a), i.set(d, p);
|
|
1521
1521
|
}
|
|
1522
1522
|
return i;
|
|
1523
1523
|
}
|
|
@@ -1540,11 +1540,11 @@ function Yn(t, e, n, o = {}) {
|
|
|
1540
1540
|
trackFields: !1,
|
|
1541
1541
|
fieldTrack: qt()
|
|
1542
1542
|
};
|
|
1543
|
-
for (const r of
|
|
1544
|
-
const
|
|
1545
|
-
if (
|
|
1543
|
+
for (const r of lt(s, "w:endnote")) {
|
|
1544
|
+
const d = h(r, "w:id");
|
|
1545
|
+
if (d === void 0 || h(r, "w:type")) continue;
|
|
1546
1546
|
const p = [];
|
|
1547
|
-
It(ot(r), p, a), i.set(
|
|
1547
|
+
It(ot(r), p, a), i.set(d, p);
|
|
1548
1548
|
}
|
|
1549
1549
|
return i;
|
|
1550
1550
|
}
|
|
@@ -1579,7 +1579,7 @@ function ke(t) {
|
|
|
1579
1579
|
const e = {};
|
|
1580
1580
|
return t.countBy !== void 0 && (e.countBy = t.countBy), t.start !== void 0 && (e.start = t.start), t.restart !== void 0 && (e.restart = t.restart), t.distanceTwips !== void 0 && (e.distancePx = I(H(t.distanceTwips))), e;
|
|
1581
1581
|
}
|
|
1582
|
-
const
|
|
1582
|
+
const Kn = () => {
|
|
1583
1583
|
}, Be = {
|
|
1584
1584
|
fontFamily: "Times New Roman, serif",
|
|
1585
1585
|
fontSizePx: 16,
|
|
@@ -1589,7 +1589,7 @@ const Jn = () => {
|
|
|
1589
1589
|
underline: !1,
|
|
1590
1590
|
strikethrough: !1,
|
|
1591
1591
|
color: "#000000"
|
|
1592
|
-
},
|
|
1592
|
+
}, Jn = {
|
|
1593
1593
|
align: "left",
|
|
1594
1594
|
lineHeight: 1,
|
|
1595
1595
|
spaceBeforePx: 0,
|
|
@@ -1603,7 +1603,7 @@ const Jn = () => {
|
|
|
1603
1603
|
};
|
|
1604
1604
|
function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
1605
1605
|
let r = 0;
|
|
1606
|
-
const
|
|
1606
|
+
const d = () => `i${r++}`, u = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), P = [], T = (c) => {
|
|
1607
1607
|
let b = v.get(c);
|
|
1608
1608
|
return b === void 0 && (b = String(v.size + 1), v.set(c, b), P.push(c)), b;
|
|
1609
1609
|
}, N = /* @__PURE__ */ new Map(), L = [], x = (c) => {
|
|
@@ -1616,12 +1616,12 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1616
1616
|
if (!C) return;
|
|
1617
1617
|
const W = eo(C);
|
|
1618
1618
|
return tt.set(c, W), W;
|
|
1619
|
-
}, ft =
|
|
1619
|
+
}, ft = Jt(e.run(void 0, {})), J = ve(e.para({})), U = () => ({
|
|
1620
1620
|
kind: "paragraph",
|
|
1621
|
-
id:
|
|
1621
|
+
id: d(),
|
|
1622
1622
|
revision: 0,
|
|
1623
1623
|
runs: [{ text: "", style: { ...ft } }],
|
|
1624
|
-
style: { ...
|
|
1624
|
+
style: { ...J }
|
|
1625
1625
|
}), E = (c, b) => {
|
|
1626
1626
|
if (!b) return 0;
|
|
1627
1627
|
const C = $(b.numId);
|
|
@@ -1642,7 +1642,7 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1642
1642
|
for (let b = c.length - 1; b >= 0; b--) if (c[b].kind === "paragraph") return c[b];
|
|
1643
1643
|
};
|
|
1644
1644
|
let G;
|
|
1645
|
-
const rt = (c, b, C =
|
|
1645
|
+
const rt = (c, b, C = Kn) => {
|
|
1646
1646
|
const W = [];
|
|
1647
1647
|
let M = !1, B = !1, Y = !1, _ = !1;
|
|
1648
1648
|
const st = (k) => k.some((w) => w.kind !== "paragraph" || w.runs.some((S) => S.text.trim().length > 0 && !S.style.hidden));
|
|
@@ -1672,7 +1672,7 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1672
1672
|
return !1;
|
|
1673
1673
|
};
|
|
1674
1674
|
for (let k = 0; k < c.length; k++) {
|
|
1675
|
-
const w = c[k], S = w.kind === "paragraph" ? bt(w, b, C) : w.kind === "math" ? [{ kind: "equation", id:
|
|
1675
|
+
const w = c[k], S = w.kind === "paragraph" ? bt(w, b, C) : w.kind === "math" ? [{ kind: "equation", id: d(), revision: 0, equation: { root: w.root, display: w.display }, align: w.align ?? "center" }] : [pt(w, b, C)];
|
|
1676
1676
|
if (w.fieldId) for (const z of S) z.fieldId = w.fieldId;
|
|
1677
1677
|
if (w.sdtPath) for (const z of S) z.sdtPath = w.sdtPath;
|
|
1678
1678
|
if (w.kind === "paragraph" && w.tocField !== void 0 && G === void 0) {
|
|
@@ -1681,7 +1681,7 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1681
1681
|
}
|
|
1682
1682
|
if (M && S.length > 0) {
|
|
1683
1683
|
const z = S[0];
|
|
1684
|
-
z.kind === "paragraph" && z.runs.every((Rt) => Rt.text.length === 0 || Rt.style.hidden) || ((w.kind === "paragraph" && e.isHeading(w.props.styleId) || B) && (z.kind === "paragraph" ? z.style.pageBreakBefore = !0 : S.unshift({ ...U(), style: { ...
|
|
1684
|
+
z.kind === "paragraph" && z.runs.every((Rt) => Rt.text.length === 0 || Rt.style.hidden) || ((w.kind === "paragraph" && e.isHeading(w.props.styleId) || B) && (z.kind === "paragraph" ? z.style.pageBreakBefore = !0 : S.unshift({ ...U(), style: { ...J, pageBreakBefore: !0 } })), M = !1, B = !1);
|
|
1685
1685
|
}
|
|
1686
1686
|
if (w.kind === "paragraph" && w.props.sectionBreak === "page") {
|
|
1687
1687
|
const z = w.props;
|
|
@@ -1726,13 +1726,13 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1726
1726
|
}
|
|
1727
1727
|
};
|
|
1728
1728
|
function bt(c, b, C) {
|
|
1729
|
-
const W = e.para(c.props), M = ve(W), B = E(M, W.list), Y =
|
|
1729
|
+
const W = e.para(c.props), M = ve(W), B = E(M, W.list), Y = Jt(e.run(c.props.styleId, c.props.markRunProps ?? {})), _ = [];
|
|
1730
1730
|
let st = [], O = !1, A = !1, at = !1;
|
|
1731
1731
|
const R = (k) => {
|
|
1732
1732
|
const w = { ...M };
|
|
1733
1733
|
return A && (w.pageBreakBefore = !0, A = !1), at && (w.columnBreakBefore = !0, at = !1), {
|
|
1734
1734
|
kind: "paragraph",
|
|
1735
|
-
id:
|
|
1735
|
+
id: d(),
|
|
1736
1736
|
revision: 0,
|
|
1737
1737
|
runs: ze(k, Y),
|
|
1738
1738
|
style: w
|
|
@@ -1776,7 +1776,7 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1776
1776
|
const k = _[0], w = k.kind === "paragraph" ? k.runs.reduce((S, z) => S + z.text.length, 0) : 0;
|
|
1777
1777
|
for (const S of c.commentMarkers) {
|
|
1778
1778
|
const z = { blockId: k.id, offset: Math.min(S.offset, w) };
|
|
1779
|
-
S.kind === "start" ?
|
|
1779
|
+
S.kind === "start" ? l.set(S.id, z) : S.kind === "end" ? m.set(S.id, z) : S.kind === "ref" && g.set(S.id, z);
|
|
1780
1780
|
}
|
|
1781
1781
|
}
|
|
1782
1782
|
return _;
|
|
@@ -1790,7 +1790,7 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1790
1790
|
}
|
|
1791
1791
|
const M = {
|
|
1792
1792
|
kind: "image",
|
|
1793
|
-
id:
|
|
1793
|
+
id: d(),
|
|
1794
1794
|
revision: 0,
|
|
1795
1795
|
src: W,
|
|
1796
1796
|
widthPx: I(Lt(c.widthEmu)),
|
|
@@ -1818,7 +1818,7 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
function it(c, b, C, W, M) {
|
|
1820
1820
|
let B = c;
|
|
1821
|
-
const Y =
|
|
1821
|
+
const Y = Jt(b);
|
|
1822
1822
|
if (b.linkRelId) {
|
|
1823
1823
|
const _ = C(b.linkRelId);
|
|
1824
1824
|
_ ? Y.link = _ : t.add("links-unresolved", "A hyperlink target could not be resolved and was dropped.");
|
|
@@ -1846,11 +1846,11 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1846
1846
|
const W = (R) => {
|
|
1847
1847
|
const X = [];
|
|
1848
1848
|
for (const w of R.blocks) {
|
|
1849
|
-
const S = w.kind === "paragraph" ? bt(w, b, C) : w.kind === "math" ? [{ kind: "equation", id:
|
|
1849
|
+
const S = w.kind === "paragraph" ? bt(w, b, C) : w.kind === "math" ? [{ kind: "equation", id: d(), revision: 0, equation: { root: w.root, display: w.display }, align: w.align ?? "center" }] : [pt(w, b, C)];
|
|
1850
1850
|
if (w.sdtPath) for (const z of S) z.sdtPath = w.sdtPath;
|
|
1851
1851
|
X.push(...S);
|
|
1852
1852
|
}
|
|
1853
|
-
const D = { id:
|
|
1853
|
+
const D = { id: d(), blocks: X.length > 0 ? X : [U()] };
|
|
1854
1854
|
R.gridSpan > 1 && (D.colSpan = R.gridSpan);
|
|
1855
1855
|
const k = (w) => R.marginTwips?.[w] ?? c.cellMarginTwips?.[w] ?? Ft[w];
|
|
1856
1856
|
return D.margin = Ht({ top: k("top"), right: k("right"), bottom: k("bottom"), left: k("left") }), R.preferredWidth && (D.preferredWidth = R.preferredWidth.type === "pct" ? { type: "pct", px: R.preferredWidth.frac } : { type: "abs", px: I(H(R.preferredWidth.twips)) }), R.vAlign && (D.vAlign = R.vAlign), R.textDirection && (D.textDirection = R.textDirection), R.noWrap && (D.noWrap = !0), R.fitText && (D.fitText = !0), R.hideMark && (D.hideMark = !0), D;
|
|
@@ -1871,7 +1871,7 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1871
1871
|
k += S;
|
|
1872
1872
|
}
|
|
1873
1873
|
for (; k < M; ) {
|
|
1874
|
-
const w = { id:
|
|
1874
|
+
const w = { id: d(), blocks: [U()] };
|
|
1875
1875
|
D.push({ cell: w, ir: null, startRow: X, startCol: k, colSpan: 1 }), B[k] = w, k += 1;
|
|
1876
1876
|
}
|
|
1877
1877
|
return D;
|
|
@@ -1884,9 +1884,9 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1884
1884
|
k.heightTwips !== void 0 && k.heightRule && (w.height = { value: I(H(k.heightTwips)), rule: k.heightRule }), k.cantSplit && (w.cantSplit = !0), k.tblHeader && (w.repeatHeader = !0), Object.keys(w).length > 0 && (D.props = w);
|
|
1885
1885
|
}
|
|
1886
1886
|
return D;
|
|
1887
|
-
}), A = { kind: "table", id:
|
|
1887
|
+
}), A = { kind: "table", id: d(), revision: 0, rows: O };
|
|
1888
1888
|
c.styleId && (A.styleId = c.styleId), c.look && (A.condOverrides = { ...c.look }), A.colFractions = so(c.colWidthsTwips, M), c.widthMode && c.widthMode !== "fixed" && (A.widthMode = c.widthMode), c.preferredWidthTwips ? A.preferredWidth = { type: "px", value: I(H(c.preferredWidthTwips)) } : c.preferredWidthPct && (A.preferredWidth = { type: "pct", value: c.preferredWidthPct }), c.align && c.align !== "left" && (A.align = c.align), c.indentTwips && (A.indentPx = I(H(c.indentTwips))), c.bidiVisual && (A.bidiVisual = !0), c.overlap && (A.overlap = c.overlap), c.caption && (A.caption = c.caption), c.description && (A.description = c.description);
|
|
1889
|
-
const at =
|
|
1889
|
+
const at = ln(c.borders);
|
|
1890
1890
|
if (at ? A.defaultBorders = at : c.bordersSpecified && (A.defaultBorders = {}), c.shd && (A.defaultShading = c.shd), c.cellMarginTwips) {
|
|
1891
1891
|
const R = c.cellMarginTwips;
|
|
1892
1892
|
A.defaultCellMargin = Ht({
|
|
@@ -1926,9 +1926,9 @@ function Zn(t, e, n = {}, o = /* @__PURE__ */ new Map(), i = () => ({}), s, a) {
|
|
|
1926
1926
|
footnoteRefs: () => P.map((c) => ({ docxId: c, noteId: `fn${c}` })),
|
|
1927
1927
|
endnoteRefs: () => L.map((c) => ({ docxId: c, noteId: `en${c}` })),
|
|
1928
1928
|
commentAnchors: () => {
|
|
1929
|
-
const c = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set([...
|
|
1929
|
+
const c = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set([...l.keys(), ...m.keys(), ...g.keys()]);
|
|
1930
1930
|
for (const C of b) {
|
|
1931
|
-
const W =
|
|
1931
|
+
const W = l.get(C) ?? g.get(C) ?? m.get(C), M = m.get(C) ?? g.get(C) ?? W;
|
|
1932
1932
|
W && M && c.set(C, { start: W, end: M });
|
|
1933
1933
|
}
|
|
1934
1934
|
return c;
|
|
@@ -2031,7 +2031,7 @@ const ro = {
|
|
|
2031
2031
|
black: "#000000",
|
|
2032
2032
|
white: "#ffffff"
|
|
2033
2033
|
};
|
|
2034
|
-
function
|
|
2034
|
+
function Jt(t) {
|
|
2035
2035
|
const e = { ...Be };
|
|
2036
2036
|
return Le(e, t), e;
|
|
2037
2037
|
}
|
|
@@ -2070,7 +2070,7 @@ function Le(t, e) {
|
|
|
2070
2070
|
o && (t.emphasisMark = o);
|
|
2071
2071
|
}
|
|
2072
2072
|
if (e.outline !== void 0 && (t.outline = e.outline), e.shadow !== void 0 && (t.shadow = e.shadow), e.emboss !== void 0 && (t.emboss = e.emboss), e.imprint !== void 0 && (t.imprint = e.imprint), e.runBorder) {
|
|
2073
|
-
const o =
|
|
2073
|
+
const o = dn(e.runBorder);
|
|
2074
2074
|
o && (t.runBorder = o);
|
|
2075
2075
|
}
|
|
2076
2076
|
e.fitTextTwips !== void 0 && e.fitTextTwips > 0 && (t.fitTextPx = I(H(e.fitTextTwips))), e.symbol && (t.symbol = { font: e.symbol.font, char: e.symbol.char }, t.fontFamily = `${e.symbol.font}, sans-serif`);
|
|
@@ -2131,26 +2131,26 @@ function po(t) {
|
|
|
2131
2131
|
for (const i of t.styles.values()) i.type === "table" && e.add(i.id);
|
|
2132
2132
|
if (e.size === 0) return;
|
|
2133
2133
|
const n = (i, s, a, r) => {
|
|
2134
|
-
const
|
|
2135
|
-
Object.keys(u).length > 0 && (
|
|
2134
|
+
const d = {}, u = ee(i);
|
|
2135
|
+
Object.keys(u).length > 0 && (d.char = u);
|
|
2136
2136
|
const p = Oe(s);
|
|
2137
|
-
Object.keys(p).length > 0 && (
|
|
2138
|
-
const
|
|
2139
|
-
return
|
|
2137
|
+
Object.keys(p).length > 0 && (d.para = p);
|
|
2138
|
+
const l = cn(a);
|
|
2139
|
+
return l && (d.borders = l), r !== void 0 && (d.shading = r), d;
|
|
2140
2140
|
}, o = {};
|
|
2141
2141
|
for (const i of e) {
|
|
2142
2142
|
const s = t.styles.get(i), a = {
|
|
2143
2143
|
wholeTable: n(s.rPr, s.pPr, s.tblBorders, s.tblShd)
|
|
2144
2144
|
};
|
|
2145
|
-
for (const [
|
|
2146
|
-
a[
|
|
2145
|
+
for (const [d, u] of Object.entries(s.tblStylePr ?? {}))
|
|
2146
|
+
a[d] = n(u.rPr, u.pPr, u.borders, u.shd);
|
|
2147
2147
|
const r = { id: i, name: s.name ?? i, conds: a };
|
|
2148
2148
|
s.basedOnId && e.has(s.basedOnId) && (r.basedOn = s.basedOnId), s.rowBandSize !== void 0 && (r.rowBandSize = s.rowBandSize), s.colBandSize !== void 0 && (r.colBandSize = s.colBandSize), o[i] = r;
|
|
2149
2149
|
}
|
|
2150
2150
|
return o;
|
|
2151
2151
|
}
|
|
2152
2152
|
function ve(t) {
|
|
2153
|
-
const e = { ...
|
|
2153
|
+
const e = { ...Jn };
|
|
2154
2154
|
t.align && (e.align = t.align), t.direction && (e.direction = t.direction), t.lineHeight !== void 0 && (e.lineHeight = I(t.lineHeight)), (t.lineRule === "exact" || t.lineRule === "atLeast") && (e.lineRule = t.lineRule, t.lineExactTwips !== void 0 && (e.lineHeightPx = I(H(t.lineExactTwips)))), t.spaceBeforeTwips !== void 0 && (e.spaceBeforePx = I(H(t.spaceBeforeTwips))), t.spaceAfterTwips !== void 0 && (e.spaceAfterPx = I(H(t.spaceAfterTwips))), t.indentLeftTwips !== void 0 && (e.indentLeftPx = I(H(t.indentLeftTwips))), t.indentRightTwips !== void 0 && (e.indentRightPx = I(H(t.indentRightTwips))), t.indentFirstLineTwips !== void 0 && (e.indentFirstLinePx = I(H(t.indentFirstLineTwips))), t.keepWithNext && (e.keepWithNext = !0), t.keepLinesTogether && (e.keepLinesTogether = !0), t.contextualSpacing !== void 0 && (e.contextualSpacing = t.contextualSpacing), t.tabStops && (e.tabStops = Ne(t.tabStops)), t.pageBreakBefore && (e.pageBreakBefore = !0), t.outlineLevel !== void 0 && (e.outlineLevel = t.outlineLevel);
|
|
2155
2155
|
const n = Ae(t.borders);
|
|
2156
2156
|
return n && (e.borders = n), t.shd !== void 0 && (e.shading = t.shd), He(t, e), t.styleId && (e.namedStyle = t.styleId), e;
|
|
@@ -2175,15 +2175,15 @@ function go(t, e, n, o) {
|
|
|
2175
2175
|
}
|
|
2176
2176
|
if (i.has(r.target)) return i.get(r.target);
|
|
2177
2177
|
if (r.external) {
|
|
2178
|
-
const
|
|
2179
|
-
|
|
2178
|
+
const l = /^https?:\/\//i.test(r.target);
|
|
2179
|
+
l ? n.add("media-external", "Linked (external) images load from their original URL.") : n.add(
|
|
2180
2180
|
"media-external-unreachable",
|
|
2181
2181
|
"Linked images pointing at local files can't be loaded in the browser — skipped."
|
|
2182
2182
|
);
|
|
2183
|
-
const m =
|
|
2183
|
+
const m = l ? r.target : void 0;
|
|
2184
2184
|
return i.set(r.target, m), m;
|
|
2185
2185
|
}
|
|
2186
|
-
let
|
|
2186
|
+
let d;
|
|
2187
2187
|
const u = r.target.slice(r.target.lastIndexOf(".") + 1).toLowerCase(), p = ho[u];
|
|
2188
2188
|
if (!p)
|
|
2189
2189
|
n.add(
|
|
@@ -2191,15 +2191,15 @@ function go(t, e, n, o) {
|
|
|
2191
2191
|
`Some images use formats browsers can't display (.${u}, typically metafiles) — skipped.`
|
|
2192
2192
|
);
|
|
2193
2193
|
else {
|
|
2194
|
-
const
|
|
2195
|
-
if (!
|
|
2194
|
+
const l = t.part(r.target);
|
|
2195
|
+
if (!l)
|
|
2196
2196
|
n.add("media-missing", "An image reference had no matching relationship — skipped.");
|
|
2197
2197
|
else {
|
|
2198
|
-
const m = new Uint8Array(
|
|
2199
|
-
o ?
|
|
2198
|
+
const m = new Uint8Array(l);
|
|
2199
|
+
o ? d = o.add(m, p) : (d = URL.createObjectURL(new Blob([m], { type: p })), s.push(d));
|
|
2200
2200
|
}
|
|
2201
2201
|
}
|
|
2202
|
-
return i.set(r.target,
|
|
2202
|
+
return i.set(r.target, d), d;
|
|
2203
2203
|
},
|
|
2204
2204
|
urls: () => [...s]
|
|
2205
2205
|
};
|
|
@@ -2209,27 +2209,27 @@ function bo(t) {
|
|
|
2209
2209
|
const e = /* @__PURE__ */ new Map(), n = wt(vt(t, "numbering.xml"), "w:numbering");
|
|
2210
2210
|
if (!n) return e;
|
|
2211
2211
|
const o = /* @__PURE__ */ new Map();
|
|
2212
|
-
for (const i of
|
|
2212
|
+
for (const i of lt(n, "w:abstractNum")) {
|
|
2213
2213
|
const s = h(i, "w:abstractNumId");
|
|
2214
2214
|
s !== void 0 && o.set(s, ko(i));
|
|
2215
2215
|
}
|
|
2216
|
-
for (const i of
|
|
2216
|
+
for (const i of lt(n, "w:num")) {
|
|
2217
2217
|
const s = h(i, "w:numId");
|
|
2218
2218
|
if (s === void 0) continue;
|
|
2219
2219
|
const a = nt(i, "w:abstractNumId"), r = a !== void 0 ? o.get(a) : void 0;
|
|
2220
2220
|
if (!r) continue;
|
|
2221
|
-
const
|
|
2222
|
-
for (const u of
|
|
2223
|
-
const p = y(u, "w:ilvl") ?? 0,
|
|
2224
|
-
m &&
|
|
2221
|
+
const d = r.map((u) => ({ ...u }));
|
|
2222
|
+
for (const u of lt(i, "w:lvlOverride")) {
|
|
2223
|
+
const p = y(u, "w:ilvl") ?? 0, l = y(f(u, "w:startOverride"), "w:val"), m = f(u, "w:lvl");
|
|
2224
|
+
m && d[p] && (d[p] = De(m, p)), l !== void 0 && d[p] && (d[p].start = l);
|
|
2225
2225
|
}
|
|
2226
|
-
e.set(s, { id: s, levels:
|
|
2226
|
+
e.set(s, { id: s, levels: d });
|
|
2227
2227
|
}
|
|
2228
2228
|
return e;
|
|
2229
2229
|
}
|
|
2230
2230
|
function ko(t) {
|
|
2231
2231
|
const e = [];
|
|
2232
|
-
for (const n of
|
|
2232
|
+
for (const n of lt(t, "w:lvl")) {
|
|
2233
2233
|
const o = y(n, "w:ilvl") ?? e.length;
|
|
2234
2234
|
e[o] = De(n, o);
|
|
2235
2235
|
}
|
|
@@ -2244,8 +2244,8 @@ function De(t, e) {
|
|
|
2244
2244
|
if (s) {
|
|
2245
2245
|
const r = y(s, "w:left") ?? y(s, "w:start");
|
|
2246
2246
|
r !== void 0 && (o.indentLeftTwips = r);
|
|
2247
|
-
const
|
|
2248
|
-
|
|
2247
|
+
const d = y(s, "w:hanging");
|
|
2248
|
+
d !== void 0 && (o.hangingTwips = d);
|
|
2249
2249
|
}
|
|
2250
2250
|
const a = f(t, "w:rPr");
|
|
2251
2251
|
return a && (o.markerRunProps = St(a)), o;
|
|
@@ -2255,10 +2255,10 @@ function vo(t, e) {
|
|
|
2255
2255
|
if (!i) return o;
|
|
2256
2256
|
for (const s of ot(i)) {
|
|
2257
2257
|
if (s.tagName !== "Relationship") continue;
|
|
2258
|
-
const a = h(s, "Id"), r = h(s, "Type"),
|
|
2259
|
-
if (!a || !r || !
|
|
2258
|
+
const a = h(s, "Id"), r = h(s, "Type"), d = h(s, "Target");
|
|
2259
|
+
if (!a || !r || !d) continue;
|
|
2260
2260
|
const u = h(s, "TargetMode") === "External";
|
|
2261
|
-
o.set(a, { id: a, type: r, target: u ?
|
|
2261
|
+
o.set(a, { id: a, type: r, target: u ? d : yo(n, d), external: u });
|
|
2262
2262
|
}
|
|
2263
2263
|
return o;
|
|
2264
2264
|
}
|
|
@@ -2301,11 +2301,11 @@ function Io(t, e, n) {
|
|
|
2301
2301
|
const o = Mo(t);
|
|
2302
2302
|
if (!o) return t;
|
|
2303
2303
|
let [i, s, a] = o;
|
|
2304
|
-
const r = Te(e),
|
|
2304
|
+
const r = Te(e), d = Te(n);
|
|
2305
2305
|
if (r !== void 0) {
|
|
2306
2306
|
const u = (p) => Math.round(p * r + 255 * (1 - r));
|
|
2307
2307
|
[i, s, a] = [u(i), u(s), u(a)];
|
|
2308
|
-
} else
|
|
2308
|
+
} else d !== void 0 && ([i, s, a] = [Math.round(i * d), Math.round(s * d), Math.round(a * d)]);
|
|
2309
2309
|
return Zt(i) + Zt(s) + Zt(a);
|
|
2310
2310
|
}
|
|
2311
2311
|
function Mo(t) {
|
|
@@ -2322,20 +2322,20 @@ function Ao(t) {
|
|
|
2322
2322
|
if (!o) return e;
|
|
2323
2323
|
const i = f(o, "a:fontScheme");
|
|
2324
2324
|
if (i) {
|
|
2325
|
-
const a = f(i, "a:majorFont"), r = f(i, "a:minorFont"),
|
|
2325
|
+
const a = f(i, "a:majorFont"), r = f(i, "a:minorFont"), d = (u, p, l, m) => {
|
|
2326
2326
|
if (!u) return;
|
|
2327
2327
|
const g = (v, P) => {
|
|
2328
2328
|
const T = xo(f(u, v));
|
|
2329
2329
|
T && (e[P] = T);
|
|
2330
2330
|
};
|
|
2331
|
-
g("a:latin", p), g("a:ea",
|
|
2331
|
+
g("a:latin", p), g("a:ea", l), g("a:cs", m);
|
|
2332
2332
|
};
|
|
2333
|
-
|
|
2333
|
+
d(a, "majorLatin", "majorEastAsia", "majorComplexScript"), d(r, "minorLatin", "minorEastAsia", "minorComplexScript");
|
|
2334
2334
|
}
|
|
2335
2335
|
const s = f(o, "a:clrScheme");
|
|
2336
2336
|
if (s)
|
|
2337
2337
|
for (const a of ot(s)) {
|
|
2338
|
-
const r = a.tagName.replace(/^a:/, ""),
|
|
2338
|
+
const r = a.tagName.replace(/^a:/, ""), d = f(a, "a:srgbClr"), u = f(a, "a:sysClr"), p = (d && h(d, "val")) ?? (u && h(u, "lastClr"));
|
|
2339
2339
|
p && e.colors.set(r, p);
|
|
2340
2340
|
}
|
|
2341
2341
|
return e;
|
|
@@ -2351,19 +2351,19 @@ function Ro(t, e) {
|
|
|
2351
2351
|
if (i) {
|
|
2352
2352
|
const s = f(i, "w:rPrDefault"), a = s && f(s, "w:rPr");
|
|
2353
2353
|
a && (n.docDefaultsRun = St(a));
|
|
2354
|
-
const r = f(i, "w:pPrDefault"),
|
|
2355
|
-
|
|
2354
|
+
const r = f(i, "w:pPrDefault"), d = r && f(r, "w:pPr");
|
|
2355
|
+
d && (n.docDefaultsPara = Gt(d));
|
|
2356
2356
|
}
|
|
2357
|
-
for (const s of
|
|
2357
|
+
for (const s of lt(o, "w:style")) {
|
|
2358
2358
|
const a = h(s, "w:styleId"), r = h(s, "w:type");
|
|
2359
2359
|
if (!a || !r) continue;
|
|
2360
|
-
const
|
|
2360
|
+
const d = f(s, "w:rPr"), u = f(s, "w:pPr"), p = {
|
|
2361
2361
|
id: a,
|
|
2362
2362
|
type: r,
|
|
2363
|
-
rPr:
|
|
2363
|
+
rPr: d ? St(d) : {},
|
|
2364
2364
|
pPr: u ? Gt(u) : {}
|
|
2365
|
-
},
|
|
2366
|
-
|
|
2365
|
+
}, l = nt(s, "w:name");
|
|
2366
|
+
l && (p.name = l);
|
|
2367
2367
|
const m = nt(s, "w:basedOn");
|
|
2368
2368
|
if (m && (p.basedOnId = m), r === "table") {
|
|
2369
2369
|
const v = f(s, "w:tblPr");
|
|
@@ -2378,7 +2378,7 @@ function Ro(t, e) {
|
|
|
2378
2378
|
x && Number.isFinite(Number(x)) && (p.colBandSize = Number(x));
|
|
2379
2379
|
}
|
|
2380
2380
|
const P = {};
|
|
2381
|
-
for (const T of
|
|
2381
|
+
for (const T of lt(s, "w:tblStylePr")) {
|
|
2382
2382
|
const N = h(T, "w:type");
|
|
2383
2383
|
if (!N) continue;
|
|
2384
2384
|
const L = f(T, "w:rPr"), x = f(T, "w:pPr"), tt = f(T, "w:tcPr"), $ = {
|
|
@@ -2386,8 +2386,8 @@ function Ro(t, e) {
|
|
|
2386
2386
|
pPr: x ? Gt(x) : {}
|
|
2387
2387
|
}, ft = tt && Yt(f(tt, "w:tcBorders"));
|
|
2388
2388
|
ft && ($.borders = ft);
|
|
2389
|
-
const
|
|
2390
|
-
|
|
2389
|
+
const J = tt && Nt(f(tt, "w:shd"));
|
|
2390
|
+
J && ($.shd = J), P[N] = $;
|
|
2391
2391
|
}
|
|
2392
2392
|
Object.keys(P).length > 0 && (p.tblStylePr = P);
|
|
2393
2393
|
}
|
|
@@ -2410,21 +2410,21 @@ function Co(t, e) {
|
|
|
2410
2410
|
const Fo = ["bold", "italic", "strikethrough", "vanish", "caps", "smallCaps"];
|
|
2411
2411
|
function Bo(t, e) {
|
|
2412
2412
|
const n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = (p) => {
|
|
2413
|
-
const
|
|
2413
|
+
const l = [], m = /* @__PURE__ */ new Set();
|
|
2414
2414
|
for (let g = t.styles.get(p); g && !m.has(g.id); g = g.basedOnId ? t.styles.get(g.basedOnId) : void 0)
|
|
2415
|
-
m.add(g.id),
|
|
2416
|
-
return
|
|
2415
|
+
m.add(g.id), l.unshift(g);
|
|
2416
|
+
return l;
|
|
2417
2417
|
}, s = (p) => {
|
|
2418
|
-
let
|
|
2419
|
-
return
|
|
2418
|
+
let l = n.get(p);
|
|
2419
|
+
return l || (l = i(p).reduce((m, g) => Wt(m, g.rPr), {}), n.set(p, l)), l;
|
|
2420
2420
|
}, a = (p) => {
|
|
2421
|
-
let
|
|
2422
|
-
return
|
|
2423
|
-
}, r = /* @__PURE__ */ new Map(),
|
|
2424
|
-
const m = `${p ?? ""}|${
|
|
2421
|
+
let l = o.get(p);
|
|
2422
|
+
return l || (l = i(p).reduce((m, g) => _t(m, g.pPr), {}), o.set(p, l)), l;
|
|
2423
|
+
}, r = /* @__PURE__ */ new Map(), d = (p, l) => {
|
|
2424
|
+
const m = `${p ?? ""}|${l ?? ""}`;
|
|
2425
2425
|
let g = r.get(m);
|
|
2426
2426
|
if (g) return g;
|
|
2427
|
-
const v = p ? s(p) : {}, P =
|
|
2427
|
+
const v = p ? s(p) : {}, P = l ? s(l) : {};
|
|
2428
2428
|
g = Wt(Wt(t.docDefaultsRun, v), P);
|
|
2429
2429
|
for (const T of Fo) {
|
|
2430
2430
|
if (t.docDefaultsRun[T] === void 0 && v[T] === void 0 && P[T] === void 0) continue;
|
|
@@ -2434,47 +2434,47 @@ function Bo(t, e) {
|
|
|
2434
2434
|
return r.set(m, g), g;
|
|
2435
2435
|
};
|
|
2436
2436
|
return {
|
|
2437
|
-
run(p,
|
|
2438
|
-
const m = p ?? t.defaultParaStyleId, g =
|
|
2439
|
-
return u(Wt(g,
|
|
2437
|
+
run(p, l) {
|
|
2438
|
+
const m = p ?? t.defaultParaStyleId, g = d(m, l.styleId);
|
|
2439
|
+
return u(Wt(g, l));
|
|
2440
2440
|
},
|
|
2441
2441
|
para(p) {
|
|
2442
|
-
const
|
|
2442
|
+
const l = p.styleId ?? t.defaultParaStyleId, m = l ? a(l) : {}, g = _t(_t(t.docDefaultsPara, m), p);
|
|
2443
2443
|
return p.styleId ? g.styleId = p.styleId : delete g.styleId, g;
|
|
2444
2444
|
},
|
|
2445
2445
|
isHeading(p) {
|
|
2446
2446
|
if (!p) return !1;
|
|
2447
|
-
const
|
|
2448
|
-
return i(p).some((m) =>
|
|
2447
|
+
const l = (m) => m !== void 0 && /(^|\s)heading(\s|\d|$)/i.test(m);
|
|
2448
|
+
return i(p).some((m) => l(m.name) || l(m.id));
|
|
2449
2449
|
}
|
|
2450
2450
|
};
|
|
2451
2451
|
function u(p) {
|
|
2452
|
-
const
|
|
2453
|
-
if (!
|
|
2454
|
-
const m = Dt(e,
|
|
2455
|
-
m && (
|
|
2452
|
+
const l = { ...p };
|
|
2453
|
+
if (!l.fontAscii && l.fontThemeAscii) {
|
|
2454
|
+
const m = Dt(e, l.fontThemeAscii);
|
|
2455
|
+
m && (l.fontAscii = m);
|
|
2456
2456
|
}
|
|
2457
|
-
if (!
|
|
2458
|
-
const m = Dt(e,
|
|
2459
|
-
m && (
|
|
2457
|
+
if (!l.fontHAnsi && l.fontThemeHAnsi) {
|
|
2458
|
+
const m = Dt(e, l.fontThemeHAnsi);
|
|
2459
|
+
m && (l.fontHAnsi = m);
|
|
2460
2460
|
}
|
|
2461
|
-
if (!
|
|
2462
|
-
const m = Dt(e,
|
|
2463
|
-
m && (
|
|
2461
|
+
if (!l.fontCs && l.fontThemeCs) {
|
|
2462
|
+
const m = Dt(e, l.fontThemeCs);
|
|
2463
|
+
m && (l.fontCs = m);
|
|
2464
2464
|
}
|
|
2465
|
-
if (!
|
|
2466
|
-
const m = Dt(e,
|
|
2467
|
-
m && (
|
|
2465
|
+
if (!l.fontEastAsia && l.fontThemeEastAsia) {
|
|
2466
|
+
const m = Dt(e, l.fontThemeEastAsia);
|
|
2467
|
+
m && (l.fontEastAsia = m);
|
|
2468
2468
|
}
|
|
2469
|
-
if ((
|
|
2470
|
-
const m = ye(e,
|
|
2471
|
-
m && (
|
|
2469
|
+
if ((l.color === void 0 || l.color === "auto") && l.colorTheme) {
|
|
2470
|
+
const m = ye(e, l.colorTheme);
|
|
2471
|
+
m && (l.color = Io(m, l.colorThemeTint, l.colorThemeShade));
|
|
2472
2472
|
}
|
|
2473
|
-
if ((
|
|
2474
|
-
const m = ye(e,
|
|
2475
|
-
m && (
|
|
2473
|
+
if ((l.underlineColor === void 0 || l.underlineColor === "auto") && l.underlineColorTheme) {
|
|
2474
|
+
const m = ye(e, l.underlineColorTheme);
|
|
2475
|
+
m && (l.underlineColor = m);
|
|
2476
2476
|
}
|
|
2477
|
-
return
|
|
2477
|
+
return l;
|
|
2478
2478
|
}
|
|
2479
2479
|
}
|
|
2480
2480
|
function Wt(t, e) {
|
|
@@ -2503,7 +2503,7 @@ function Oo(t) {
|
|
|
2503
2503
|
throw new xt("NOT_ZIP", `Corrupt zip container: ${a instanceof Error ? a.message : String(a)}`);
|
|
2504
2504
|
}
|
|
2505
2505
|
const i = /* @__PURE__ */ new Map(), s = (a) => {
|
|
2506
|
-
const r = ie(t, { filter: (
|
|
2506
|
+
const r = ie(t, { filter: (d) => d.name === a })[a];
|
|
2507
2507
|
return r && (n[a] = r), r;
|
|
2508
2508
|
};
|
|
2509
2509
|
return {
|
|
@@ -2511,9 +2511,9 @@ function Oo(t) {
|
|
|
2511
2511
|
text(a) {
|
|
2512
2512
|
const r = i.get(a);
|
|
2513
2513
|
if (r !== void 0) return r;
|
|
2514
|
-
const
|
|
2515
|
-
if (!
|
|
2516
|
-
const u = Ue(
|
|
2514
|
+
const d = n[a];
|
|
2515
|
+
if (!d) return;
|
|
2516
|
+
const u = Ue(d);
|
|
2517
2517
|
return i.set(a, u), u;
|
|
2518
2518
|
},
|
|
2519
2519
|
names: () => [...Object.keys(n), ...o.filter((a) => !(a in n))]
|
|
@@ -2529,12 +2529,12 @@ function Uo(t, e, n) {
|
|
|
2529
2529
|
o("unzip", 0);
|
|
2530
2530
|
const r = Oo(t);
|
|
2531
2531
|
o("unzip", 1);
|
|
2532
|
-
const
|
|
2532
|
+
const d = r.text("[Content_Types].xml"), u = (d !== void 0 ? Ge(d) : void 0) ?? "word/document.xml", p = r.text(u);
|
|
2533
2533
|
if (p === void 0)
|
|
2534
2534
|
throw new xt("NO_DOCUMENT_PART", `Main document part "${u}" not found in the archive.`);
|
|
2535
|
-
const
|
|
2535
|
+
const l = Ut(r, u);
|
|
2536
2536
|
o("styles", 0);
|
|
2537
|
-
const m = zt(r,
|
|
2537
|
+
const m = zt(r, l, "styles") ?? r.text("word/styles.xml"), g = m !== void 0 ? Ro(m) : Eo, v = zt(r, l, "theme") ?? r.text("word/theme/theme1.xml"), P = v !== void 0 ? Ao(v) : So, T = Bo(g, P), N = zt(r, l, "numbering") ?? r.text("word/numbering.xml"), L = N !== void 0 ? bo(N) : wo;
|
|
2538
2538
|
o("styles", 1), o("parse", 0);
|
|
2539
2539
|
const x = Pn(p, u, i);
|
|
2540
2540
|
o("parse", 1), o("map", 0);
|
|
@@ -2549,18 +2549,18 @@ function Uo(t, e, n) {
|
|
|
2549
2549
|
(O) => Co(g, O),
|
|
2550
2550
|
tt,
|
|
2551
2551
|
{ lineNumbering: x.section?.lineNumbering, pageNumberStart: x.section?.pageNumberStart }
|
|
2552
|
-
), ft = [],
|
|
2552
|
+
), ft = [], J = (O) => {
|
|
2553
2553
|
const A = go(r, O, i, a);
|
|
2554
2554
|
return ft.push(A), A;
|
|
2555
|
-
}, U = $.mapBlocks(x.blocks,
|
|
2555
|
+
}, U = $.mapBlocks(x.blocks, J(l), Vt(l));
|
|
2556
2556
|
U.length === 0 && U.push($.emptyParagraph());
|
|
2557
2557
|
const E = $.mapSection(x.section);
|
|
2558
2558
|
x.pageColorHex && (E.pageColorHex = `#${x.pageColorHex}`);
|
|
2559
|
-
const q = zt(r,
|
|
2560
|
-
Pe(E, "header", x.section?.headerRefs, x.section?.titlePg ?? !1, F, r,
|
|
2561
|
-
const j = $t(
|
|
2559
|
+
const q = zt(r, l, "settings") ?? r.text("word/settings.xml"), Q = q !== void 0 ? Do(q) : { evenAndOdd: !1 }, F = Q.evenAndOdd;
|
|
2560
|
+
Pe(E, "header", x.section?.headerRefs, x.section?.titlePg ?? !1, F, r, l, $, J, i, x.sdts), Pe(E, "footer", x.section?.footerRefs, x.section?.titlePg ?? !1, F, r, l, $, J, i, x.sdts);
|
|
2561
|
+
const j = $t(l, "footnotes") ?? "word/footnotes.xml", G = r.text(j), rt = G !== void 0 ? Xn(G, j, i, x.sdts) : /* @__PURE__ */ new Map(), ht = {};
|
|
2562
2562
|
if (rt.size > 0) {
|
|
2563
|
-
const O = Ut(r, j), A =
|
|
2563
|
+
const O = Ut(r, j), A = J(O), at = Vt(O);
|
|
2564
2564
|
for (const { docxId: R, noteId: X } of $.footnoteRefs()) {
|
|
2565
2565
|
const D = rt.get(R);
|
|
2566
2566
|
if (!D) {
|
|
@@ -2571,7 +2571,7 @@ function Uo(t, e, n) {
|
|
|
2571
2571
|
w.length < k.length && i.add("footnote-tables", "Tables inside footnotes were dropped (footnotes hold paragraphs only)."), w.length > 0 && (ht[X] = w);
|
|
2572
2572
|
}
|
|
2573
2573
|
}
|
|
2574
|
-
const bt = $t(
|
|
2574
|
+
const bt = $t(l, "endnotes") ?? "word/endnotes.xml", ut = r.text(bt), it = ut !== void 0 ? Yn(ut, bt, i, x.sdts) : /* @__PURE__ */ new Map(), mt = {};
|
|
2575
2575
|
let pt;
|
|
2576
2576
|
for (const { docxId: O, noteId: A } of $.endnoteRefs()) {
|
|
2577
2577
|
const at = it.get(O);
|
|
@@ -2581,7 +2581,7 @@ function Uo(t, e, n) {
|
|
|
2581
2581
|
}
|
|
2582
2582
|
if (!pt) {
|
|
2583
2583
|
const D = Ut(r, bt);
|
|
2584
|
-
pt = { media:
|
|
2584
|
+
pt = { media: J(D), link: Vt(D) };
|
|
2585
2585
|
}
|
|
2586
2586
|
const R = $.mapBlocks(at, pt.media, pt.link), X = R.filter((D) => D.kind === "paragraph");
|
|
2587
2587
|
X.length < R.length && i.add("endnote-tables", "Tables inside endnotes were dropped (endnotes hold paragraphs only)."), X.length > 0 && (mt[A] = X);
|
|
@@ -2601,10 +2601,10 @@ function Uo(t, e, n) {
|
|
|
2601
2601
|
M && (V.tableStyles = M);
|
|
2602
2602
|
const B = $.tocField();
|
|
2603
2603
|
B && (V.tocInstruction = B.instruction, $e(V) === 0 && (V.tocAnchorBlockId = B.blockId)), x.fields && (V.fields = x.fields), Q.defaultTabStopPx !== void 0 && (V.defaultTabStopPx = Q.defaultTabStopPx), Q.compatSettings && (V.compatSettings = Q.compatSettings);
|
|
2604
|
-
const Y = $t(
|
|
2604
|
+
const Y = $t(l, "comments") ?? "word/comments.xml", _ = r.text(Y);
|
|
2605
2605
|
let st;
|
|
2606
2606
|
if (_ !== void 0) {
|
|
2607
|
-
const O = mn(_), A = $t(
|
|
2607
|
+
const O = mn(_), A = $t(l, "commentsExtended") ?? "word/commentsExtended.xml", at = r.text(A), R = at !== void 0 ? pn(at) : /* @__PURE__ */ new Map(), X = $.commentAnchors(), D = U[0]?.id;
|
|
2608
2608
|
st = hn(O, R, X, D ? { start: { blockId: D, offset: 0 }, end: { blockId: D, offset: 0 } } : void 0);
|
|
2609
2609
|
}
|
|
2610
2610
|
return {
|
|
@@ -2617,21 +2617,21 @@ function Uo(t, e, n) {
|
|
|
2617
2617
|
}
|
|
2618
2618
|
function Ho(t, e, n, o, i, s, a) {
|
|
2619
2619
|
if (!n) return;
|
|
2620
|
-
const r = e.get(n),
|
|
2621
|
-
if (r === void 0 ||
|
|
2620
|
+
const r = e.get(n), d = r && !r.external ? t.text(r.target) : void 0;
|
|
2621
|
+
if (r === void 0 || d === void 0) {
|
|
2622
2622
|
s.add("header-missing", "A referenced header/footer part was missing from the archive.");
|
|
2623
2623
|
return;
|
|
2624
2624
|
}
|
|
2625
|
-
const u = Ut(t, r.target), p = In(
|
|
2626
|
-
return
|
|
2625
|
+
const u = Ut(t, r.target), p = In(d, r.target, s, a), l = o.mapBlocks(p, i(u), Vt(u));
|
|
2626
|
+
return l.length > 0 ? l : void 0;
|
|
2627
2627
|
}
|
|
2628
|
-
function Pe(t, e, n, o, i, s, a, r,
|
|
2628
|
+
function Pe(t, e, n, o, i, s, a, r, d, u, p) {
|
|
2629
2629
|
if (!n) return;
|
|
2630
|
-
const
|
|
2631
|
-
const P = Ho(s, a, v, r,
|
|
2630
|
+
const l = (g) => `${e}${g}`, m = (g, v) => {
|
|
2631
|
+
const P = Ho(s, a, v, r, d, u, p);
|
|
2632
2632
|
P && (t[g] = P);
|
|
2633
2633
|
};
|
|
2634
|
-
m(
|
|
2634
|
+
m(l(""), n.default), o && m(l("First"), n.first), i && m(l("Even"), n.even);
|
|
2635
2635
|
}
|
|
2636
2636
|
function Do(t) {
|
|
2637
2637
|
const e = wt(vt(t, "settings.xml"), "w:settings");
|
|
@@ -2640,7 +2640,7 @@ function Do(t) {
|
|
|
2640
2640
|
o !== void 0 && o > 0 && o !== 720 && (n.defaultTabStopPx = I(H(o)));
|
|
2641
2641
|
const i = f(e, "w:compat");
|
|
2642
2642
|
if (i) {
|
|
2643
|
-
const s =
|
|
2643
|
+
const s = lt(i, "w:compatSetting").map((a) => ({ name: h(a, "w:name") ?? "", uri: h(a, "w:uri") ?? "", val: h(a, "w:val") ?? "" })).filter((a) => a.name !== "");
|
|
2644
2644
|
s.length > 0 && (n.compatSettings = s);
|
|
2645
2645
|
}
|
|
2646
2646
|
return n;
|
|
@@ -2664,14 +2664,14 @@ function $t(t, e) {
|
|
|
2664
2664
|
return n && !n.external ? n.target : void 0;
|
|
2665
2665
|
}
|
|
2666
2666
|
export {
|
|
2667
|
-
|
|
2667
|
+
Xt as a,
|
|
2668
2668
|
Go as b,
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2669
|
+
dt as c,
|
|
2670
|
+
jo as d,
|
|
2671
|
+
Me as e,
|
|
2672
|
+
tn as f,
|
|
2673
|
+
ce as g,
|
|
2674
|
+
se as h,
|
|
2675
2675
|
Tt as l,
|
|
2676
2676
|
Ct as m,
|
|
2677
2677
|
Uo as r,
|